!265 调整界面

Merge pull request !265 from 德仔/develop
This commit is contained in:
德仔 2021-05-31 10:53:33 +08:00 committed by Gitee
commit dc661d6d0d
9 changed files with 184 additions and 25 deletions

View File

@ -0,0 +1,33 @@
import request from "@/utils/request";
export function fetchTopicList(query) {
return request({
url: "/services/topic/list",
method: "get",
params: query
});
}
export function fetchTopicDetail(query) {
return request({
url: "/services/topic/detail",
method: "get",
params: query
});
}
export function postTopicReply(data) {
return request({
url: "/services/topic/reply",
method: "post",
body: data
});
}
export function postTopicComment(data) {
return request({
url: "/services/topic/comment",
method: "post",
body: data
});
}

View File

@ -151,8 +151,11 @@
</template>
<script>
import Clipboard from "clipboard";
import { listRecipesPlanByCusId } from "@/api/custom/recipesPlan";
import { addRecipesPlan, updateRecipesPlan } from "@/api/custom/recipesPlan";
import {
listRecipesPlanByCusId,
addRecipesPlan,
updateRecipesPlan,
} from "@/api/custom/recipesPlan";
import PlanPauseDrawer from "./PlanPauseDrawer";
import VueQr from "vue-qr";
import dayjs from "dayjs";

View File

@ -103,7 +103,7 @@ export default {
this.$store.dispatch("app/toggleSideBar");
},
handleOnMessageClick() {
this.$router.push("/user/message");
},
async logout() {
this.$confirm("确定注销并退出系统吗?", "提示", {

View File

@ -83,6 +83,13 @@ export const constantRoutes = [
require(["@/views/system/user/profile/index"], resolve),
name: "Profile",
meta: { title: "个人中心", icon: "user" }
},
{
path: "message",
component: resolve =>
require(["@/views/custom/message/index"], resolve),
name: "Profile",
meta: { title: "客户消息", icon: "user" }
}
]
},

View File

@ -8,6 +8,7 @@ import settings from "./modules/settings";
import recipes from "./modules/recipes";
import recipesShow from "./modules/recipesShow";
import global from "./modules/global";
import message from "./modules/message";
import getters from "./getters";
import actions from "./actions";
@ -23,7 +24,8 @@ const store = new Vuex.Store({
settings,
recipes,
recipesShow,
global
global,
message
},
getters,
actions

View File

@ -0,0 +1,45 @@
import {
fetchTopicList,
postTopicReply,
fetchTopicDetail,
postTopicComment
} from "@/api/custom/message";
const oriState = {
topicList: undefined,
detailData: undefined
};
const mutations = {
save(state, payload) {
Object.keys(payload).forEach(key => {
state[key] = payload[key];
});
},
clean(state) {
Object.keys(oriState).forEach(key => {
state[key] = oriState[key];
});
}
};
const actions = {
async init({ rootGetters, commit }, payload) {
const {
roles: [role],
userId
} = rootGetters;
const result = await fetchTopicList({ role: "dietician", uid: 131 });
console.log({ result });
}
};
const getters = {};
export default {
namespaced: "message",
state: Object.assign({}, oriState),
mutations,
actions,
getters
};

View File

@ -0,0 +1,41 @@
<template>
<div class="user_message_wrapper">
<MessageBrowser />
<div class="info_zone"></div>
</div>
</template>
<script>
import MessageBrowser from "./messageBrowser";
export default {
data() {
return {};
},
components: {
MessageBrowser,
},
created() {},
computed: {},
methods: {},
};
</script>
<style lang="scss" scoped>
.user_message_wrapper {
padding: 12px;
display: flex;
box-sizing: border-box;
height: calc(100vh - 84px);
background: #f3f4f5;
& > div:nth-child(1) {
flex: 3;
background: white;
}
& > div:nth-child(2) {
flex: 2;
margin-left: 12px;
padding-left: 12px;
background: white;
}
}
</style>

View File

@ -0,0 +1,45 @@
<template>
<div class="message_browser_wrapper">
<div class="topic_list">
</div>
<div class="topic_detail"></div>
</div>
</template>
<script>
import { createNamespacedHelpers } from "vuex";
const {
mapActions,
mapState,
mapMutations,
mapGetters,
} = createNamespacedHelpers("message");
export default {
data() {
return {};
},
created() {
this.init();
},
computed: {
...mapState([]),
},
methods: {
...mapActions(["init"]),
...mapMutations(["clean"]),
},
};
</script>
<style lang="scss" scoped>
.message_browser_wrapper {
display: flex;
.topic_list {
flex: 2;
}
.topic_detail {
flex: 3;
background: gray;
}
}
</style>

View File

@ -115,30 +115,14 @@
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="customer" />
<el-table-column
label="客户手机号"
align="center"
prop="hidePhone"
width="180"
/>
<el-table-column
label="计划"
align="center"
prop="scopeDay"
width="200"
/>
<el-table-column
label="日期"
align="center"
prop="scopeDate"
width="200"
/>
<el-table-column label="客户手机号" align="center" prop="hidePhone" />
<el-table-column label="计划" align="center" prop="scopeDay" />
<el-table-column label="日期" align="center" prop="scopeDate" width="200"/>
<el-table-column label="营养师" align="center" prop="nutritionist" />
<el-table-column
label="营养师助理"
align="center"
prop="nutritionistAssis"
width="180"
/>
<el-table-column label="订阅情况" align="center">
<template slot-scope="scope">
@ -147,7 +131,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="发送" align="center" width="80">
<el-table-column label="发送" align="center">
<template slot-scope="scope">
<el-switch
v-model="!!scope.row.sendFlag"
@ -159,7 +143,6 @@
label="操作"
align="center"
class-name="small-padding fixed-width"
width="300"
>
<template slot-scope="scope">
<el-button