commit
d106fc89c0
@ -83,7 +83,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://47.115.23.82:3306/stdiet?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://47.115.23.82:3306/stdiet_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
password: gzDxPaZcSiXJpi2N
|
password: gzDxPaZcSiXJpi2N
|
||||||
username: root
|
username: root
|
||||||
slave:
|
slave:
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
trigger="click"
|
trigger="click"
|
||||||
>
|
>
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="avatar" class="user-avatar" alt="avatar" />
|
<img :src="avatar" class="user-avatar" />
|
||||||
<em class="el-icon-caret-bottom" />
|
<em class="el-icon-caret-bottom" />
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
@ -72,7 +72,7 @@ export default {
|
|||||||
window.addEventListener("message", this.handleOnMessage);
|
window.addEventListener("message", this.handleOnMessage);
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
beforeUnmount();
|
beforeUnmount(1000);
|
||||||
window.removeEventListener("message", this.handleOnMessage);
|
window.removeEventListener("message", this.handleOnMessage);
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
|
||||||
|
import { dealHealthy } from "@/utils/healthyData";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
fetchTopicList,
|
fetchTopicList,
|
||||||
postTopicReply,
|
postTopicReply,
|
||||||
@ -9,7 +12,11 @@ const oriState = {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
topicList: [],
|
topicList: [],
|
||||||
detailData: {},
|
detailData: {},
|
||||||
selTopicId: ""
|
selTopicId: "",
|
||||||
|
healthyData: {},
|
||||||
|
healthDataLoading: false,
|
||||||
|
healthyDataType: 0,
|
||||||
|
avoidFoodIds: []
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@ -46,10 +53,12 @@ const actions = {
|
|||||||
});
|
});
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
if (!detailData.topicId) {
|
if (!detailData.topicId) {
|
||||||
|
// 默认展示第一个
|
||||||
const [defTopic] = result.rows;
|
const [defTopic] = result.rows;
|
||||||
dispatch("fetchTopicDetailActions", {
|
dispatch("fetchTopicDetailActions", {
|
||||||
topicId: defTopic.topicId,
|
topicId: defTopic.topicId,
|
||||||
id: defTopic.id
|
id: defTopic.id,
|
||||||
|
uid: defTopic.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (result.rows.length) {
|
if (result.rows.length) {
|
||||||
@ -60,9 +69,15 @@ const actions = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fetchTopicDetailActions({ commit }, payload) {
|
async fetchTopicDetailActions({ commit, dispatch, state }, payload) {
|
||||||
const { topicId, id } = payload;
|
const { topicId, id, uid } = payload;
|
||||||
|
const { healthyData } = state;
|
||||||
commit("save", { selTopicId: topicId });
|
commit("save", { selTopicId: topicId });
|
||||||
|
// 客户信息
|
||||||
|
if (healthyData.customerId !== parseInt(uid)) {
|
||||||
|
dispatch("getHealthyData", { cusId: uid });
|
||||||
|
}
|
||||||
|
//
|
||||||
const result = await fetchTopicDetail({ topicId, id });
|
const result = await fetchTopicDetail({ topicId, id });
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
commit("save", { detailData: result.data[0] });
|
commit("save", { detailData: result.data[0] });
|
||||||
@ -89,11 +104,35 @@ const actions = {
|
|||||||
if (tarTopic) {
|
if (tarTopic) {
|
||||||
dispatch("fetchTopicDetailActions", {
|
dispatch("fetchTopicDetailActions", {
|
||||||
topicId: tarTopic.topicId,
|
topicId: tarTopic.topicId,
|
||||||
id: tarTopic.id
|
id: tarTopic.id,
|
||||||
|
uid: tarTopic.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
},
|
||||||
|
async getHealthyData({ commit }, payload) {
|
||||||
|
commit("save", { healthDataLoading: true });
|
||||||
|
const healthyDataResult = await getCustomerPhysicalSignsByCusId(
|
||||||
|
payload.cusId
|
||||||
|
);
|
||||||
|
let healthyData = undefined,
|
||||||
|
healthyDataType = 0;
|
||||||
|
if (healthyDataResult.code === 200) {
|
||||||
|
if (!healthyDataResult.data.customerHealthy) {
|
||||||
|
throw new Error("客户还没填写健康评估表");
|
||||||
|
}
|
||||||
|
healthyDataType = healthyDataResult.data.type;
|
||||||
|
healthyData = dealHealthy(healthyDataResult.data.customerHealthy);
|
||||||
|
} else {
|
||||||
|
throw new Error(healthyDataResult.msg);
|
||||||
|
}
|
||||||
|
commit("save", {
|
||||||
|
healthDataLoading: false,
|
||||||
|
healthyDataType,
|
||||||
|
healthyData,
|
||||||
|
avoidFoodIds: (healthyData.avoidFood || []).map(obj => obj.id)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ function connect() {
|
|||||||
|
|
||||||
ws.onerror = event => {
|
ws.onerror = event => {
|
||||||
// console.log({ event });
|
// console.log({ event });
|
||||||
|
ws.close();
|
||||||
ws = undefined;
|
ws = undefined;
|
||||||
window.removeEventListener("message", handleOnMessageReceive);
|
window.removeEventListener("message", handleOnMessageReceive);
|
||||||
|
|
||||||
@ -56,6 +57,7 @@ function connect() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log(error);
|
// console.log(error);
|
||||||
// console.log("浏览器不支持websocket");
|
// console.log("浏览器不支持websocket");
|
||||||
|
ws.close();
|
||||||
ws = undefined;
|
ws = undefined;
|
||||||
websocketInit();
|
websocketInit();
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="user_message_wrapper">
|
<div class="user_message_wrapper">
|
||||||
<MessageBrowser />
|
<MessageBrowser />
|
||||||
<div class="info_zone"></div>
|
<UserInfo />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import MessageBrowser from "./messageBrowser/index";
|
import MessageBrowser from "./messageBrowser/index";
|
||||||
|
import UserInfo from "./userInfo/index";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
MessageBrowser,
|
MessageBrowser,
|
||||||
|
UserInfo,
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
}`"
|
}`"
|
||||||
/>
|
/>
|
||||||
<div class="topic_item_content">
|
<div class="topic_item_content">
|
||||||
<div class="topic_content">{{ topic.content }}</div>
|
<div class="topic_content" :style="{ width: `${itemWidth}px` }">
|
||||||
|
{{ topic.content }}
|
||||||
|
</div>
|
||||||
<div class="topic_user_name">by {{ topic.name }}</div>
|
<div class="topic_user_name">by {{ topic.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="topic_info">
|
<div class="topic_info">
|
||||||
@ -91,13 +93,14 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
topicTypeDict: {
|
topicTypeDict: {
|
||||||
0: "建议",
|
0: "食材",
|
||||||
1: "食谱",
|
1: "身体",
|
||||||
2: "咨询",
|
2: "环境",
|
||||||
},
|
},
|
||||||
replyTarget: "",
|
replyTarget: "",
|
||||||
replyContent: "",
|
replyContent: "",
|
||||||
replyObj: {},
|
replyObj: {},
|
||||||
|
itemWidth: 160,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: { Comment },
|
components: { Comment },
|
||||||
@ -106,6 +109,14 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
window.addEventListener("message", this.handleOnMessage);
|
window.addEventListener("message", this.handleOnMessage);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const itemElm = document.querySelector(".topic_item");
|
||||||
|
if (itemElm) {
|
||||||
|
console.log(itemElm);
|
||||||
|
this.itemWidth = itemElm.clientWidth - 32 - 20 - 80;
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
window.removeEventListener("message", this.handleOnMessage);
|
window.removeEventListener("message", this.handleOnMessage);
|
||||||
@ -154,7 +165,12 @@ export default {
|
|||||||
(obj) => obj.topicId === topicId
|
(obj) => obj.topicId === topicId
|
||||||
);
|
);
|
||||||
if (tarTopic) {
|
if (tarTopic) {
|
||||||
this.fetchTopicDetailActions({ topicId, id: tarTopic.id });
|
console.log({ tarTopic });
|
||||||
|
this.fetchTopicDetailActions({
|
||||||
|
topicId,
|
||||||
|
id: tarTopic.id,
|
||||||
|
uid: tarTopic.uid,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,7 +182,11 @@ export default {
|
|||||||
this.replyTarget = "";
|
this.replyTarget = "";
|
||||||
this.replyContent = "";
|
this.replyContent = "";
|
||||||
this.replyObj = {};
|
this.replyObj = {};
|
||||||
this.fetchTopicDetailActions({ topicId: data.topicId, id: data.id });
|
this.fetchTopicDetailActions({
|
||||||
|
topicId: data.topicId,
|
||||||
|
id: data.id,
|
||||||
|
uid: data.uid,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleOnReplyTopic(data) {
|
handleOnReplyTopic(data) {
|
||||||
this.replyTarget = "主题";
|
this.replyTarget = "主题";
|
||||||
@ -265,7 +285,7 @@ export default {
|
|||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
|
|
||||||
.topic_content {
|
.topic_content {
|
||||||
width: 260px;
|
width: 100px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
38
stdiet-ui/src/views/custom/message/userInfo/index.vue
Normal file
38
stdiet-ui/src/views/custom/message/userInfo/index.vue
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<div v-loading="healthDataLoading">
|
||||||
|
<HealthyView
|
||||||
|
dev
|
||||||
|
:data="healthyDataType === 0 ? healthyData : {}"
|
||||||
|
v-show="healthyDataType === 0"
|
||||||
|
/>
|
||||||
|
<BodySignView
|
||||||
|
dev
|
||||||
|
:data="healthyDataType === 1 ? healthyData : {}"
|
||||||
|
v-show="healthyDataType === 1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { createNamespacedHelpers } from "vuex";
|
||||||
|
import HealthyView from "@/components/HealthyView";
|
||||||
|
import BodySignView from "@/components/BodySignView";
|
||||||
|
const {
|
||||||
|
mapActions,
|
||||||
|
mapState,
|
||||||
|
mapMutations,
|
||||||
|
mapGetters,
|
||||||
|
} = createNamespacedHelpers("message");
|
||||||
|
export default {
|
||||||
|
name: "SignUserInfo",
|
||||||
|
components: {
|
||||||
|
HealthyView,
|
||||||
|
BodySignView,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["healthyData", "healthyDataType", "healthDataLoading"]),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
x
Reference in New Issue
Block a user