Commit f738c1a5 authored by 汪欢's avatar 汪欢
parents 2eec2c09 f8b6fb06
...@@ -130,7 +130,10 @@ Page({ ...@@ -130,7 +130,10 @@ Page({
flag = true; flag = true;
const { activityId } = app; const { activityId } = app;
const { item } = e.target.dataset; const { item } = e.target.dataset;
const userAddress = await getUserAddress({ joinTag: " " }) const userAddress = await getUserAddress({ joinTag: " " }).catch((data)=>{
flag = false
console.log('getUserAddress出错了,错误信息是',data);
})
// my.hideLoading(); // my.hideLoading();
if (!userAddress) return if (!userAddress) return
// commonToast(' getUserAddress =>'+JSON.stringify( userAddress)) // commonToast(' getUserAddress =>'+JSON.stringify( userAddress))
......
...@@ -300,10 +300,10 @@ export const getUserAddress = async (opts = {}) => { ...@@ -300,10 +300,10 @@ export const getUserAddress = async (opts = {}) => {
let _opts = Object.assign({}, defaults, opts); let _opts = Object.assign({}, defaults, opts);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
my.authorize({ my.authorize({
scopes: 'scope.addressList', scopes: 'scope.addressList',
success: () => { success: () => {
const { addAddress, searchAddress, locateAddress, joinTag } = _opts; const { addAddress, searchAddress, locateAddress, joinTag } = _opts;
if (!my.tb.chooseAddress) { if (!my.tb || !my.tb.chooseAddress) {
reject({ reject({
noSupport: true, noSupport: true,
errorMessage: '当前版本不支持选择收货地址,请升级到最新版本' errorMessage: '当前版本不支持选择收货地址,请升级到最新版本'
...@@ -336,6 +336,9 @@ export const getUserAddress = async (opts = {}) => { ...@@ -336,6 +336,9 @@ export const getUserAddress = async (opts = {}) => {
reject(res); reject(res);
} }
); );
},
fail: err => {
reject(err);
} }
}); });
}); });
......
'use strict';
import resList from '../../resconfig/resList'; //import API from '../../api';
import API from '../../api';
const app = getApp();
const { tbcc } = app;
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Page({
data: {
ruleModalVisible: false
},
onLoad(props) {
this.setData({
resList: resList
});
},
gotoVipPage() {
API.getVipInfo().then(res => {
if (!res.vip)
navigateToOutside(res.url)
else
my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye' });
})
},
handleStart() {
console.log('change')
my.redirectTo({
url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye'
});
},
showRuleModal() {
this.setData({
ruleModalVisible: true
})
},
ruleModalClose() {
this.setData({
ruleModalVisible: false
})
}
});
\ 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