跳转新增地址

This commit is contained in:
Kiyan 2017-06-08 09:52:42 +08:00
parent d7737a9fe1
commit 87a1eac740
5 changed files with 26 additions and 12 deletions

View File

@ -1,5 +1,6 @@
{
"pages": [
"pages/mine/mine",
"pages/index/index",
"pages/order/quasi",
"pages/order/show",
@ -7,7 +8,6 @@
"pages/order/list",
"pages/order/content",
"pages/mine/coupon",
"pages/mine/mine",
"pages/order/review",
"pages/index/search",
"pages/index/category",

View File

@ -53,6 +53,14 @@ Page({
})
wx.hideNavigationBarLoading()
cb && cb()
if(data.length === 0) {
wx.navigateTo({
url: '/pages/address/add',
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
})
}
},
error() {
that.setData({

View File

@ -14,7 +14,7 @@ Page({
},
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
this.id = options.id || '2859'
this.id = options.id || '2908'
this.loadData()
},
onReady: function () {
@ -130,7 +130,7 @@ Page({
return
}
if (!info.receiver_addr_id) {
return alert('请选择用户地址')
return alert('请选择收货地址')
}
this.setData({
loading: true

View File

@ -10,7 +10,7 @@
</view>
</navigator>
<navigator wx:else url="/pages/address/select?callback=callbackAddress" class=" weui-media-box weui-media-box_text weui-cell__ft_in-access weui-media-box_address primary-color text-large">
选择地址
选择收货地址
</navigator>
</view>
</view>

View File

@ -87,14 +87,20 @@ export function login(options) {
} = options
wx.login({
success(res) {
fetch({
url: 'index.php?m=Api&c=WeixinMall&a=login',
data: {
phone, code,
wx_code: res['code'],
session_3rd: wx.getStorageSync('session_3rd')
},
success, error
getApp().getCurrentAddress(address => {
fetch({
url: 'index.php?m=Api&c=WeixinMall&a=login',
data: {
phone, code,
wx_code: res['code'],
session_3rd: wx.getStorageSync('session_3rd'),
city_id: address.city_id,
city_name: address.city,
district_id: address.district_id,
district_name: address.district,
},
success, error
})
})
},
error(res) {