Commit 017b947f by songbingqi

修复部分bug

parent 15f4467a
...@@ -13,8 +13,15 @@ export default function initPopup(v) { ...@@ -13,8 +13,15 @@ export default function initPopup(v) {
state.show = false state.show = false
}, },
showPopup(state,data) { showPopup(state,data) {
state = Object.assign(state,data) state.url = ''
state.title = ''
console.log(data,'data')
const timer = setTimeout(() => {
state.url = data.url
state.title = data.title
state.show = true state.show = true
clearTimeout(timer)
}, 1);
}, },
} }
}) })
...@@ -26,4 +33,7 @@ export default function initPopup(v) { ...@@ -26,4 +33,7 @@ export default function initPopup(v) {
v.prototype.$popupStore.commit('showPopup', option) v.prototype.$popupStore.commit('showPopup', option)
} }
} }
v.prototype.closePopup = function (option) {
v.prototype.$popupStore.commit('closePopup')
}
} }
...@@ -207,6 +207,14 @@ export default { ...@@ -207,6 +207,14 @@ export default {
} else { } else {
Store.commit("setMenuOption", optionDecode); Store.commit("setMenuOption", optionDecode);
} }
}else{
if(this.userms) {
const sendData = {
phone: this.userInfo.phoneNumber,
user_id: this.userInfo.id,
};
Menu.sendUserCoupon(sendData);
}
} }
uni.getSetting({ uni.getSetting({
success: (res) => { success: (res) => {
......
...@@ -136,6 +136,10 @@ export default { ...@@ -136,6 +136,10 @@ export default {
return uni.$u.http return uni.$u.http
.post("/v1/issue/user/coupon", data) .post("/v1/issue/user/coupon", data)
.then((res) => { .then((res) => {
const { url,flag,title } = res.data.data
if(flag===1) {
context.showPopup({ url: url,title: title });
}
return res; return res;
}) })
.catch((err) => { .catch((err) => {
......
...@@ -152,6 +152,10 @@ export default { ...@@ -152,6 +152,10 @@ export default {
.post("/v1/issue/user/coupon", data) .post("/v1/issue/user/coupon", data)
.then((res) => { .then((res) => {
Store.commit("setMenuOption", {}); Store.commit("setMenuOption", {});
const { url,flag,title } = res.data.data
if(flag===1) {
context.showPopup({ url: url,title: title });
}
return res; return res;
}) })
.catch((err) => { .catch((err) => {
...@@ -190,8 +194,9 @@ export default { ...@@ -190,8 +194,9 @@ export default {
uni.setStorageSync("UserInfo", sendData); uni.setStorageSync("UserInfo", sendData);
this.getCouponImg() this.getCouponImg()
const MenuOption = Store.state.user.menuOption; const MenuOption = Store.state.user.menuOption;
if (JSON.stringify(MenuOption) !== "{}") { if (JSON.stringify(MenuOption) !== "{}") { // 扫码进入逻辑
const { num, serial_no, source, serials } = MenuOption; const { num, serial_no, source, serials } = MenuOption;
if(source) {
const sendDataOption = { const sendDataOption = {
phone: sendData.phoneNumber, phone: sendData.phoneNumber,
user_id: sendData.id, user_id: sendData.id,
...@@ -204,6 +209,16 @@ export default { ...@@ -204,6 +209,16 @@ export default {
}; };
this.sendUserCoupon(sendDataOption); this.sendUserCoupon(sendDataOption);
} }
} else { // 非扫码进入逻辑
const sendDataOption = {
phone: sendData.phoneNumber,
user_id: sendData.id
};
this.sendUserCoupon(sendDataOption);
}
}) })
.catch((err) => { .catch((err) => {
context.showToast({ context.showToast({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment