From e69a45ac873f79f85ddb1d4015aed752afd2f9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BE=81?= Date: Tue, 17 May 2022 12:37:32 +0800 Subject: [PATCH 1/3] merge --- nuxt.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuxt.config.js b/nuxt.config.js index 57b5147..66bcdb8 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -45,7 +45,7 @@ export default { '@plugins/axiosTk.js', '@plugins/vue-inject.js', '@/plugins/v-distpicker', - '@/plugins/router', + // '@/plugins/router', '@/plugins/im' ], From 1240635f5c1f27ad517a50d3a334e2fa9977efb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BE=81?= Date: Tue, 17 May 2022 14:29:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=BD=A0?= =?UTF-8?q?=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/BsChosen.vue | 3 ++- pages/account/index/message.vue | 4 ++-- plugins/im.js | 10 +++++++--- store/index.js | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/BsChosen.vue b/components/BsChosen.vue index 097ff1b..308f9c6 100644 --- a/components/BsChosen.vue +++ b/components/BsChosen.vue @@ -39,7 +39,8 @@ export default { categoryId: "", order: "", }); - vm.recommendedData = res.result; + console.log(res.result) + vm.recommendedData = res.result.records; }, }, }; diff --git a/pages/account/index/message.vue b/pages/account/index/message.vue index 5064ecd..58b3a7a 100644 --- a/pages/account/index/message.vue +++ b/pages/account/index/message.vue @@ -43,10 +43,10 @@ export default { return {}; }, computed: { - ...mapState(["token"], ["socketMsgData"]), + ...mapState(["token","socketMsgData"]), }, mounted(){ - console.log(`socketMsgData`,this.socketMsgData) + console.log(`socketMsgData`,this.$store) }, methods: {}, }; diff --git a/plugins/im.js b/plugins/im.js index e88ae1a..b6d0484 100644 --- a/plugins/im.js +++ b/plugins/im.js @@ -18,7 +18,7 @@ Vue.prototype.$startWebSockets = function () { Vue.prototype.Socket.onopen = () => { let traceId = guid(); Vue.prototype.Socket.send( - `{"traceId":${traceId},traceType:1,"content":{"size": 100}}` + `{"traceId":"${traceId}",traceType:1,"content":{"size": 100}}` ); }; Vue.prototype.Socket.onclose = () => { @@ -40,7 +40,7 @@ Vue.prototype.$startWebSockets = function () { if (msg.traceType == 1) { let traceId = guid(); let sys = msg.content.sessionVOS.find((item) => item.type != 3); - let str = `{"traceId":${traceId},traceType:2,"content":{"sessionId":${sys.id}}}`; + let str = `{"traceId":"${traceId}",traceType:2,"content":{"sessionId":${sys.id}}}`; Vue.prototype.Socket.send(str); this.$store.commit("setUnreadCount", msg.content.totalUnreadCount); } @@ -54,9 +54,13 @@ Vue.prototype.$startWebSockets = function () { if (msg.traceType == 3) { let traceId = guid(); Vue.prototype.Socket.send( - `{"traceId":${traceId},traceType:1,"content":{"size": 100}}` + `{"traceId":"${traceId}",traceType:1,"content":{"size": 100}}` ); } + + setTimeout(()=>{ + console.log(this.$store.state) + },500) }; } }; diff --git a/store/index.js b/store/index.js index f7315b5..a655789 100644 --- a/store/index.js +++ b/store/index.js @@ -54,6 +54,7 @@ const mutations = { }, setSocketMsgData(state, val){ state.socketMsgData = val; + console.log(state.socketMsgData) } }; const actions = { From 4f0f97e2194e5218514ef3089576fed02c8736f6 Mon Sep 17 00:00:00 2001 From: xiaoguang Date: Tue, 17 May 2022 14:29:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=93=8D=E5=BA=94=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=A0=81=E4=B8=BA=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=BF=94=E5=9B=9Ereject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/module/header/HeaderCart.vue | 11 ++++------- layouts/module/header/index.vue | 17 ++++++++--------- plugins/axiosTk.js | 1 - 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/layouts/module/header/HeaderCart.vue b/layouts/module/header/HeaderCart.vue index f06ea24..710caba 100644 --- a/layouts/module/header/HeaderCart.vue +++ b/layouts/module/header/HeaderCart.vue @@ -10,7 +10,7 @@
购物车 @@ -144,16 +144,13 @@ export default { }, }, methods: { - onJumpCart() { - if (!this.$isLoginValidate()) { - return; - } - this.$router.push("/cart"); - }, onJumpGoodsDetail(id) { this.$router.push(`/goods/detail/${id}`); }, onJumCartPage() { + if (!this.$isLoginValidate()) { + return; + } this.$router.push("/cart"); }, }, diff --git a/layouts/module/header/index.vue b/layouts/module/header/index.vue index faded79..eac91ff 100644 --- a/layouts/module/header/index.vue +++ b/layouts/module/header/index.vue @@ -61,14 +61,13 @@
-
- +
+
+ +