if (type ==“体验版”)
{
var url = app.globalData.url + ‘/coupon/heavy’;
var ii = utils.heavy(url,function(obj){
console.log(obj.data.code);
if(obj.data.code==200)
{
wx.showToast({
title: ‘已经购买体验订单,不能重复购买’,
icon: ‘none’,
mask: true,
duration: 2000,
});
return false; //这里不生效 想要这下面不在执行
}
})
}
console.log(type );
if (type ==“体验版”)
{
var url = app.globalData.url + ‘/coupon/heavy’;
var ii = utils.heavy(url,function(obj){
console.log(obj.data.code);
if(obj.data.code==200)
{
wx.showToast({
title: ‘已经购买体验订单,不能重复购买’,
icon: ‘none’,
mask: true,
duration: 2000,
});
return 2222;
}else{
return 1111;
}
})
console.log(ii);
}
// return false
var info = wx.getStorageSync(“memberInfo”);
console.log(‘info’,info);
const heavy = (url,cb) => {
var info = wx.getStorageSync(“memberInfo”);
wx.request({
url: url,
data: {
info: info[‘id’],
},
success: function (t) {
console.log( t);
var mag = t.data.code;
if (mag == 200) {
typeof cb == “function” && cb(t)
} else {
typeof error === ‘function’ && error()
}
}
})
}