跳转新增地址

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": [
"pages/mine/mine",
"pages/index/index", "pages/index/index",
"pages/order/quasi", "pages/order/quasi",
"pages/order/show", "pages/order/show",
@ -7,7 +8,6 @@
"pages/order/list", "pages/order/list",
"pages/order/content", "pages/order/content",
"pages/mine/coupon", "pages/mine/coupon",
"pages/mine/mine",
"pages/order/review", "pages/order/review",
"pages/index/search", "pages/index/search",
"pages/index/category", "pages/index/category",

View File

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

View File

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

View File

@ -10,7 +10,7 @@
</view> </view>
</navigator> </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 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> </navigator>
</view> </view>
</view> </view>

View File

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