commit
dc661d6d0d
33
stdiet-ui/src/api/custom/message.js
Normal file
33
stdiet-ui/src/api/custom/message.js
Normal 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
|
||||||
|
});
|
||||||
|
}
|
@ -151,8 +151,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Clipboard from "clipboard";
|
import Clipboard from "clipboard";
|
||||||
import { listRecipesPlanByCusId } from "@/api/custom/recipesPlan";
|
import {
|
||||||
import { addRecipesPlan, updateRecipesPlan } from "@/api/custom/recipesPlan";
|
listRecipesPlanByCusId,
|
||||||
|
addRecipesPlan,
|
||||||
|
updateRecipesPlan,
|
||||||
|
} from "@/api/custom/recipesPlan";
|
||||||
import PlanPauseDrawer from "./PlanPauseDrawer";
|
import PlanPauseDrawer from "./PlanPauseDrawer";
|
||||||
import VueQr from "vue-qr";
|
import VueQr from "vue-qr";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
@ -103,7 +103,7 @@ export default {
|
|||||||
this.$store.dispatch("app/toggleSideBar");
|
this.$store.dispatch("app/toggleSideBar");
|
||||||
},
|
},
|
||||||
handleOnMessageClick() {
|
handleOnMessageClick() {
|
||||||
|
this.$router.push("/user/message");
|
||||||
},
|
},
|
||||||
async logout() {
|
async logout() {
|
||||||
this.$confirm("确定注销并退出系统吗?", "提示", {
|
this.$confirm("确定注销并退出系统吗?", "提示", {
|
||||||
|
@ -83,6 +83,13 @@ export const constantRoutes = [
|
|||||||
require(["@/views/system/user/profile/index"], resolve),
|
require(["@/views/system/user/profile/index"], resolve),
|
||||||
name: "Profile",
|
name: "Profile",
|
||||||
meta: { title: "个人中心", icon: "user" }
|
meta: { title: "个人中心", icon: "user" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "message",
|
||||||
|
component: resolve =>
|
||||||
|
require(["@/views/custom/message/index"], resolve),
|
||||||
|
name: "Profile",
|
||||||
|
meta: { title: "客户消息", icon: "user" }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,7 @@ import settings from "./modules/settings";
|
|||||||
import recipes from "./modules/recipes";
|
import recipes from "./modules/recipes";
|
||||||
import recipesShow from "./modules/recipesShow";
|
import recipesShow from "./modules/recipesShow";
|
||||||
import global from "./modules/global";
|
import global from "./modules/global";
|
||||||
|
import message from "./modules/message";
|
||||||
|
|
||||||
import getters from "./getters";
|
import getters from "./getters";
|
||||||
import actions from "./actions";
|
import actions from "./actions";
|
||||||
@ -23,7 +24,8 @@ const store = new Vuex.Store({
|
|||||||
settings,
|
settings,
|
||||||
recipes,
|
recipes,
|
||||||
recipesShow,
|
recipesShow,
|
||||||
global
|
global,
|
||||||
|
message
|
||||||
},
|
},
|
||||||
getters,
|
getters,
|
||||||
actions
|
actions
|
||||||
|
45
stdiet-ui/src/store/modules/message.js
Normal file
45
stdiet-ui/src/store/modules/message.js
Normal 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
|
||||||
|
};
|
41
stdiet-ui/src/views/custom/message/index.vue
Normal file
41
stdiet-ui/src/views/custom/message/index.vue
Normal 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>
|
45
stdiet-ui/src/views/custom/message/messageBrowser.vue
Normal file
45
stdiet-ui/src/views/custom/message/messageBrowser.vue
Normal 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>
|
@ -115,30 +115,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="客户姓名" align="center" prop="customer" />
|
<el-table-column label="客户姓名" align="center" prop="customer" />
|
||||||
<el-table-column
|
<el-table-column label="客户手机号" align="center" prop="hidePhone" />
|
||||||
label="客户手机号"
|
<el-table-column label="计划" align="center" prop="scopeDay" />
|
||||||
align="center"
|
<el-table-column label="日期" align="center" prop="scopeDate" width="200"/>
|
||||||
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="nutritionist" />
|
<el-table-column label="营养师" align="center" prop="nutritionist" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="营养师助理"
|
label="营养师助理"
|
||||||
align="center"
|
align="center"
|
||||||
prop="nutritionistAssis"
|
prop="nutritionistAssis"
|
||||||
width="180"
|
|
||||||
/>
|
/>
|
||||||
<el-table-column label="订阅情况" align="center">
|
<el-table-column label="订阅情况" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -147,7 +131,7 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="发送" align="center" width="80">
|
<el-table-column label="发送" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="!!scope.row.sendFlag"
|
v-model="!!scope.row.sendFlag"
|
||||||
@ -159,7 +143,6 @@
|
|||||||
label="操作"
|
label="操作"
|
||||||
align="center"
|
align="center"
|
||||||
class-name="small-padding fixed-width"
|
class-name="small-padding fixed-width"
|
||||||
width="300"
|
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user