Commit 467b32c6 by 宋冰琦

修复订阅消息失败时不可支付的问题

parent dd014f2b
......@@ -224,6 +224,8 @@ export default {
},
fail: (err) => {
console.log(err);
User.setAllow(2)
this.saveReserve()
}
})
},
......
import appConfig from '@/static/config/index.js';
import User from '@/request/user';
import context from '../main.js'
export function getBaseUrl() {
if (process.env.NODE_ENV === 'development') {
return appConfig.devApi;
......@@ -58,7 +59,7 @@ module.exports = (vm) => {
if (response.data.code == 401 && phoneNumber) {
User.getAuthorization(phoneNumber);
}
uni.showToast({
context.showToast({
title: response.data.msg,
icon: 'none',
duration: 2000,
......
import context from '../../main.js'
export default {
getList(id) {},
getMsg() {
......@@ -7,7 +8,7 @@ export default {
return res;
})
.catch((err) => {
uni.showToast({ title: '服务器错误', icon: 'none' });
context.showToast({ title: '服务器错误', icon: 'none' });
});
},
read(data) {
......@@ -17,7 +18,7 @@ export default {
return res;
})
.catch((err) => {
uni.showToast({ title: '服务器错误', icon: 'none' });
context.showToast({ title: '服务器错误', icon: 'none' });
});
},
getMessageCount() {
......@@ -27,7 +28,7 @@ export default {
return res;
})
.catch((err) => {
uni.showToast({ title: '服务器错误', icon: 'none' });
context.showToast({ title: '服务器错误', icon: 'none' });
});
}
};
......@@ -2,6 +2,7 @@ import Store from '@/store';
import { $EventBus } from '@/utils/EventBus';
import loadingIcon from 'uview-ui/libs/config/props/loadingIcon';
import { data } from 'uview-ui/libs/mixin/mixin';
import context from '../../main.js'
export default {
getLocation(callback) {
let _this = this;
......@@ -71,7 +72,7 @@ export default {
}
})
.catch((err) => {
uni.showToast({
context.showToast({
title: err.msg,
});
});
......@@ -86,7 +87,7 @@ export default {
const { data } = res;
uni.setStorage({ key: 'Authorization', data: data.token });
Store.commit('setAuthorization', data.token);
uni.showToast({ title: '登录成功!' });
context.showToast({ title: '登录成功!' });
});
},
wxLoginAndGetOpenid(loding, updata) {
......@@ -149,7 +150,7 @@ export default {
return callback();
}
}).catch((err) => {
uni.showToast({
context.showToast({
title: err.msg,
});
});
......@@ -165,7 +166,7 @@ export default {
return res;
})
.catch((err) => {
uni.showToast({ title: '服务器错误', icon: 'none' });
context.showToast({ title: '服务器错误', icon: 'none' });
});
},
};
......@@ -37,7 +37,7 @@ export default {
};
return DAta;
} else {
uni.showToast({
context.showToast({
title: '请选择商品',
});
}
......@@ -84,7 +84,7 @@ export default {
goodsList.forEach((item) => (size += item.num));
let countOfOrder = uni.getStorageSync('countOfOrder');
if (size >= countOfOrder) {
uni.showToast({
context.showToast({
title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none',
});
......@@ -122,7 +122,7 @@ export default {
url: `/pages/index/index?q=${res.result}`,
});
} else {
uni.showToast({
context.showToast({
title: '二维码错误',
icon: 'none',
});
......@@ -130,7 +130,7 @@ export default {
}
},
fail() {
uni.showToast({
context.showToast({
icon: 'none',
title: '扫码失败',
});
......
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