diff --git a/src/components/Index.vue b/src/components/Index.vue index f5d19e8..8c09818 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -216,6 +216,7 @@ const activityList = reactive([ { id: 3, show: store.state.userAccount.isBirthMon, + // show: 1, banner: require("../assets/img/activity_3.png"), btnImg: require("../assets/img/li_btn_3.png"), }, diff --git a/src/components/MyPrize.vue b/src/components/MyPrize.vue index 475d629..28e284d 100644 --- a/src/components/MyPrize.vue +++ b/src/components/MyPrize.vue @@ -141,7 +141,7 @@ const getMoney = (val) => { // 红包类型未参与红包: 需先绑定牛卡号 if (val.type == 1) { - if (!store.state.userAccount.nkh) { + if (store.state.userAccount.nkh == '') { // Toast("牛卡号为空,先绑定牛卡号"); Dialog.confirm({ title: "温馨提示", diff --git a/src/page/Home/Home.vue b/src/page/Home/Home.vue index 3cf1b84..90d170e 100644 --- a/src/page/Home/Home.vue +++ b/src/page/Home/Home.vue @@ -159,6 +159,7 @@ const apiAll = ()=>{ // 更细二维码 store.commit({ type: "updateeEqcodeImg", eqcodeImg: result[0].data.data,}); // 更新资金账号记录 + store.commit({ type: "updateeNkh", eqcodeImg: result[1].data.data,}); // 更新红包记录 store.commit({ type: "updatePrizeList", prizeList: result[2].data.data,}); @@ -185,7 +186,7 @@ const apiAll = ()=>{ // 页面未挂载 onBeforeMount(() => { - // apiAll() + apiAll() console.log("link:", window.location.href); console.log("用户活动信息:", store.state.userAccount); @@ -252,10 +253,6 @@ const getOpenId = (code) => { console.log("后端返回的openid:", res.data); // 更新openid store.commit({ type: "updateXGLOpenid", openid: res.data.data }); - // store.commit({ type: "updateToken", token: h5plugin.getQueryString('token') }); - // store.commit({ type: "updateCardId", cardId: h5plugin.getQueryString('cardId') }); - // store.commit({ type: "updateNkh", cardId: h5plugin.getQueryString('nkh') }); - // console.log("用户活动信息:", store.state.userAccount); apiAll() } }); diff --git a/src/store/index.js b/src/store/index.js index 5ee1643..450181a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,7 +10,7 @@ export default createStore({ xglOpenId: 'o9B_fvjtyh2KELQYc2t9A3MEh7JQ', //用户openid token: h5plugin.getQueryString('token'), //用户token cardId: h5plugin.getQueryString('cardId'), //carid - nkh: h5plugin.getQueryString('nkh'), //牛卡号 + nkh: '', //牛卡号 isDraw: false, //是否抽过奖 isHasAccount: false, //是否存在牛卡号 isAddCustomer: 0, //是否添加过服务人员 @@ -38,12 +38,13 @@ export default createStore({ state.userAccount.token = val.token }, - updateCardId(state,val){ - state.userAccount.cardId = val.cardId + // 更新牛卡号 + updateeNkh(state,val){ + state.userAccount.nkh = val.nkh }, - updateNkh(state,val){ - state.userAccount.nkh = val.nkh + updateCardId(state,val){ + state.userAccount.cardId = val.cardId }, updateeEqcodeImg(state,val){