From 333f9fa5acdbaca886625df218b5cf7a34dc7534 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Tue, 14 Aug 2018 22:22:11 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=AE=A2=E5=8D=95][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=B8=8B=E5=8D=95=E6=8E=A5=E5=8F=A3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8Ctoken=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.js | 24 ++++++++++++++++-------- pages/coupons/details/index.js | 14 ++++++++++---- pages/coupons/details/index.wxml | 2 +- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/config/config.js b/config/config.js index c96a165..89f95ba 100755 --- a/config/config.js +++ b/config/config.js @@ -1,33 +1,41 @@ var url = 'https://ciformall.youlane.cn' //var url = 'http://localhost:8001' -var apiPrefix = url + '/C/'; +var apiPrefix = url + '/C/api'; var config = { name: "富茂", api: { /** * 接口用途:login */ - login: '/api/user/login', + login: '/user/login', /** * 授权后获取用户的昵称,unionId等信息 */ - getUserInfo: '/api/user/getUserInfo', + getUserInfo: '/user/getUserInfo', /** * 接口用途:授权后获取用户的手机号 */ - getUserPhone: '/api/user/getUserPhone', + getUserPhone: '/user/getUserPhone', /** * 优惠券查询 */ - couponList: '/wxCoupon/list', + couponList: '/coupon/list', /** * 优惠券详情 */ - couponDetail: '/wxCoupon/findById', + couponDetail: '/coupon/findById', /** - * 下单 + * 下订单 */ - orderSave: '/wxOrder/save', + orderSave: '/order/save', + /** + * 支付订单 + */ + payOrderCreate: '/pay/create', + /** + * 订单列表 + */ + orderSave: '/order/list', }, weapp: { diff --git a/pages/coupons/details/index.js b/pages/coupons/details/index.js index 64c261d..39c7f53 100644 --- a/pages/coupons/details/index.js +++ b/pages/coupons/details/index.js @@ -16,7 +16,7 @@ Page({ }) }) }, - aaa(){ + orderfunc(){ wx.showLoading({ title: '加载中...', }) @@ -28,13 +28,19 @@ Page({ if (res.data.code == 200) { wx.showToast({ title: '购买成功', - }) - wx.navigateBack({ - delta: 2 + duration: 2000 }) setTimeout(() => { wx.hideToast(); }, 2000) + wx.navigateBack({ + delta: 2 + }) + } else { + wx.showToast({ + title: res.data.message, + duration: 3000 + }) } }) } diff --git a/pages/coupons/details/index.wxml b/pages/coupons/details/index.wxml index df72178..b759cef 100644 --- a/pages/coupons/details/index.wxml +++ b/pages/coupons/details/index.wxml @@ -42,5 +42,5 @@ 每桌限用2张 - + \ No newline at end of file