Merge branch 'feature/task1.0.0' into 'msb_test'

Feature/task1.0.0

See merge request yanxuan-frontend/shop-pc!79
merge-requests/81/merge
肖广 3 years ago
commit 24201b110e

@ -39,7 +39,8 @@ export default {
categoryId: "", categoryId: "",
order: "", order: "",
}); });
vm.recommendedData = res.result; console.log(res.result)
vm.recommendedData = res.result.records;
}, },
}, },
}; };

@ -10,7 +10,7 @@
<div <div
slot="reference" slot="reference"
class="header-cart-popover__refrence flex flex-middle" class="header-cart-popover__refrence flex flex-middle"
@click="onJumpCart" @click="onJumCartPage"
> >
<img src="~/assets/img/layout/icon-shop.png" /> <img src="~/assets/img/layout/icon-shop.png" />
<span>购物车</span> <span>购物车</span>
@ -144,16 +144,13 @@ export default {
}, },
}, },
methods: { methods: {
onJumpCart() {
if (!this.$isLoginValidate()) {
return;
}
this.$router.push("/cart");
},
onJumpGoodsDetail(id) { onJumpGoodsDetail(id) {
this.$router.push(`/goods/detail/${id}`); this.$router.push(`/goods/detail/${id}`);
}, },
onJumCartPage() { onJumCartPage() {
if (!this.$isLoginValidate()) {
return;
}
this.$router.push("/cart"); this.$router.push("/cart");
}, },
}, },

@ -61,14 +61,13 @@
<HeaderInfoBar /> <HeaderInfoBar />
<div class="default-bar-header"> <div class="default-bar-header">
<div class="bar-header-box"> <div class="bar-header-box">
<div <div class="bar-header-box__wrap flex flex-between flex-middle">
class="bar-header-box__wrap flex flex-between flex-middle" <div @click="onOpenHomePage">
@click="onOpenHomePage" <img
> class="header-box-wrap__logo"
<img src="~/assets/img/layout/logo.png"
class="header-box-wrap__logo" />
src="~/assets/img/layout/logo.png" </div>
/>
<div class="header-box-wrap__right flex flex-middle"> <div class="header-box-wrap__right flex flex-middle">
<div class="box-wrap-right__search flex"> <div class="box-wrap-right__search flex">
<div class="search-input"> <div class="search-input">
@ -76,7 +75,7 @@
v-model="searchContent" v-model="searchContent"
clearable clearable
placeholder="请输入商品名称" placeholder="请输入商品名称"
@keyup.enter="onSearch" @keyup.enter.native="onSearch"
> >
</el-input> </el-input>
</div> </div>

@ -46,7 +46,7 @@ export default {
'@plugins/axiosTk.js', '@plugins/axiosTk.js',
'@plugins/vue-inject.js', '@plugins/vue-inject.js',
'@/plugins/v-distpicker', '@/plugins/v-distpicker',
'@/plugins/router', // '@/plugins/router',
'@/plugins/im' '@/plugins/im'
], ],

@ -43,10 +43,10 @@ export default {
return {}; return {};
}, },
computed: { computed: {
...mapState(["token"], ["socketMsgData"]), ...mapState(["token","socketMsgData"]),
}, },
mounted(){ mounted(){
console.log(`socketMsgData`,this.socketMsgData) console.log(`socketMsgData`,this.$store)
}, },
methods: {}, methods: {},
}; };

@ -25,7 +25,6 @@ export default function ({$axios, store, route}, inject) {
if(result.code === 'TOKEN_FAIL'){ if(result.code === 'TOKEN_FAIL'){
store.commit('setLoginOut'); store.commit('setLoginOut');
store.commit('setLoginVisible'); store.commit('setLoginVisible');
return result;
} }
return Promise.reject(result); return Promise.reject(result);
} }

@ -18,7 +18,7 @@ Vue.prototype.$startWebSockets = function () {
Vue.prototype.Socket.onopen = () => { Vue.prototype.Socket.onopen = () => {
let traceId = guid(); let traceId = guid();
Vue.prototype.Socket.send( Vue.prototype.Socket.send(
`{"traceId":${traceId},traceType:1,"content":{"size": 100}}` `{"traceId":"${traceId}",traceType:1,"content":{"size": 100}}`
); );
}; };
Vue.prototype.Socket.onclose = () => { Vue.prototype.Socket.onclose = () => {
@ -40,7 +40,7 @@ Vue.prototype.$startWebSockets = function () {
if (msg.traceType == 1) { if (msg.traceType == 1) {
let traceId = guid(); let traceId = guid();
let sys = msg.content.sessionVOS.find((item) => item.type != 3); 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); Vue.prototype.Socket.send(str);
this.$store.commit("setUnreadCount", msg.content.totalUnreadCount); this.$store.commit("setUnreadCount", msg.content.totalUnreadCount);
} }
@ -54,9 +54,13 @@ Vue.prototype.$startWebSockets = function () {
if (msg.traceType == 3) { if (msg.traceType == 3) {
let traceId = guid(); let traceId = guid();
Vue.prototype.Socket.send( 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)
}; };
} }
}; };

@ -54,6 +54,7 @@ const mutations = {
}, },
setSocketMsgData(state, val){ setSocketMsgData(state, val){
state.socketMsgData = val; state.socketMsgData = val;
console.log(state.socketMsgData)
} }
}; };
const actions = { const actions = {

Loading…
Cancel
Save