From 059e1a3e377b3e84d90204720f617bd03a131a2b Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Wed, 15 Aug 2018 16:59:22 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=94=AF=E4=BB=98][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/common.js | 6 +++--- config/config.js | 24 ++++++++++++------------ pages/coupons/details/index.js | 3 ++- project.config.json | 2 +- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/common/common.js b/common/common.js index bbf2914..77acd42 100755 --- a/common/common.js +++ b/common/common.js @@ -137,13 +137,13 @@ const func = { wx.request({ url: config.api.orderSave, header: { - "token": app.globalData.token + 'token': app.globalData.token }, - method: "Post", data: { couponId: couponId, token: app.globalData.token }, + method: "POST", success: function (res) { resolve(res) }, @@ -163,11 +163,11 @@ const func = { header: { "token": app.globalData.token }, - method: "Post", data: { orderId: orderId, token: app.globalData.token }, + method: "POST", success: function (res) { resolve(res) }, diff --git a/config/config.js b/config/config.js index 89f95ba..34c0ef8 100755 --- a/config/config.js +++ b/config/config.js @@ -1,45 +1,45 @@ -var url = 'https://ciformall.youlane.cn' -//var url = 'http://localhost:8001' -var apiPrefix = url + '/C/api'; +//var url = 'https://ciformall.youlane.cn' +var url = 'http://localhost:8001' +var apiPrefix = url + '/C'; var config = { name: "富茂", api: { /** * 接口用途:login */ - login: '/user/login', + login: '/api/user/login', /** * 授权后获取用户的昵称,unionId等信息 */ - getUserInfo: '/user/getUserInfo', + getUserInfo: '/api/user/getUserInfo', /** * 接口用途:授权后获取用户的手机号 */ - getUserPhone: '/user/getUserPhone', + getUserPhone: '/api/user/getUserPhone', /** * 优惠券查询 */ - couponList: '/coupon/list', + couponList: '/wxCoupon/list', /** * 优惠券详情 */ - couponDetail: '/coupon/findById', + couponDetail: '/wxCoupon/findById', /** * 下订单 */ - orderSave: '/order/save', + orderSave: '/api/order/save', /** * 支付订单 */ - payOrderCreate: '/pay/create', + payOrderCreate: '/api/pay/create', /** * 订单列表 */ - orderSave: '/order/list', + orderList: '/api/order/list', }, weapp: { - AppId: 'wx649b3be73c1afe47', + AppId: 'wx8eb8275b78db4ede', } }; diff --git a/pages/coupons/details/index.js b/pages/coupons/details/index.js index f36441f..df48aed 100644 --- a/pages/coupons/details/index.js +++ b/pages/coupons/details/index.js @@ -26,7 +26,8 @@ Page({ wx.hideLoading(); console.log(res) if (res.data.code == 200) { - Common.payOrderCreate(res.data.data.id) + + Common.payOrderCreate('' + res.data.data.id) .then(res =>{ wx.requestPayment({ timeStamp: res.data.data.timeStamp, diff --git a/project.config.json b/project.config.json index eec3456..5fb3347 100644 --- a/project.config.json +++ b/project.config.json @@ -12,7 +12,7 @@ }, "compileType": "miniprogram", "libVersion": "2.2.2", - "appid": "wx649b3be73c1afe47", + "appid": "wx8eb8275b78db4ede", "projectname": "C", "isGameTourist": false, "condition": {