Commit 5221a9f5 by 李嘉林

领取会员卡方法优化

parent 2e15a091
...@@ -288,15 +288,18 @@ export function themeMemberCardClick (item) { ...@@ -288,15 +288,18 @@ export function themeMemberCardClick (item) {
cardData = innerItem; cardData = innerItem;
} }
}); });
if (cardData.receiveWay == 0) {
// 无门槛
let cardId = cardData.id; let cardId = cardData.id;
let userInfo = wx.getStorageSync("userInfo") ? JSON.parse(wx.getStorageSync("userInfo")) : ""; let userInfo = wx.getStorageSync("userInfo") ? JSON.parse(wx.getStorageSync("userInfo")) : "";
if (cardData.receiveWay == 0) {
// 无门槛
shop.drawV3Card(cardId).then(res => { shop.drawV3Card(cardId).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
wx.showToast({ wx.showToast({
title: `开通【${cardData.title}】成功`, title: `开通【${cardData.title}】成功`,
icon: "none" icon: "none"
}).then(res => {
let backParams = `&cardId=${cardData.id}&userTel=${userInfo.mobilephone}`;
toPage("/personalCenter/membershipCard", backParams);
}); });
} else { } else {
if (res.data.msg == "不能重复领卡") { if (res.data.msg == "不能重复领卡") {
...@@ -327,6 +330,13 @@ export function themeMemberCardClick (item) { ...@@ -327,6 +330,13 @@ export function themeMemberCardClick (item) {
} }
} else { } else {
wx.showToast({title:res.data.msg,icon:"none"}); wx.showToast({title:res.data.msg,icon:"none"});
if (res.data.code == 300) {
console.log('----------334')
// 未登录
const url = `/pages/login/main?back=${encodeURIComponent('/')}`;
wx.navigateTo({ url: url });
}
} }
}); });
}; };
\ No newline at end of file
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