Commit 467b32c6 by 宋冰琦

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

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