From acbfb9d567417c086606fcaab85dcd43ec5dea90 Mon Sep 17 00:00:00 2001 From: Kiyan Date: Wed, 31 May 2017 14:36:05 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=80=89=E6=8B=A9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/app.js | 7 +++---- app/app.json | 2 +- app/pages/order/quasi.js | 8 ++++++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/app.js b/app/app.js index d542102..74ba480 100644 --- a/app/app.js +++ b/app/app.js @@ -48,11 +48,10 @@ App({ this.getLoginInfo(loginInfo => { if (loginInfo.is_login) { this.findNearbyUserAddr(userAddress => { - if (userAddress) { - address = userAddress + if (!userAddress) { + return } - address = that.setCurrentAddress(address) - cb(address) + that.setCurrentAddress(userAddress) }) } }) diff --git a/app/app.json b/app/app.json index 8ac0f9f..b388de3 100644 --- a/app/app.json +++ b/app/app.json @@ -1,10 +1,10 @@ { "pages": [ "pages/index/index", + "pages/order/quasi", "pages/shop/show", "pages/order/list", "pages/order/show", - "pages/order/quasi", "pages/order/content", "pages/mine/coupon", "pages/mine/mine", diff --git a/app/pages/order/quasi.js b/app/pages/order/quasi.js index ef159f1..9fcd2f8 100644 --- a/app/pages/order/quasi.js +++ b/app/pages/order/quasi.js @@ -5,6 +5,7 @@ import { } from '../../utils/apis' import { + alert, requestPayment, getCurrentPage } from '../../utils/util' Page({ @@ -13,7 +14,7 @@ Page({ }, onLoad: function (options) { // 页面初始化 options为页面跳转所带来的参数 - this.id = options.id || '2843' + this.id = options.id || '2853' this.loadData() }, onReady: function () { @@ -124,10 +125,13 @@ Page({ onAddOrder(e) { var that = this var {id} = this - var {loading, content} = this.data + var {loading, content, info} = this.data if (loading) { return } + if (!info.receiver_addr_id) { + return alert('请选择用户地址') + } this.setData({ loading: true })