From a92693e789b1bc5e4107961d3fd6b276c9d730eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAPTOP-D7TKRI82=5C=E9=82=93?= <52643018@qq.com> Date: Wed, 23 Jun 2021 19:00:10 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81]=20?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=B5=8B=E8=AF=95=E4=B8=8B=E5=8D=95=E6=94=AF?= =?UTF-8?q?=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api.js | 4 +++- pages/index/index.vue | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/common/api.js b/common/api.js index fe04211..2d27944 100644 --- a/common/api.js +++ b/common/api.js @@ -19,4 +19,6 @@ export const API_COFIRMORDER_DETAILS = '/api/order/confirm'; /* 商品详情相关 */ export const API_GOODS_DETAIL = '/api/goods/detail'; // 商品详情 -export const API_COLLECT_DEAL = '/api/collect/deal'; // 商品收藏 \ No newline at end of file +export const API_COLLECT_DEAL = '/api/collect/deal'; // 商品收藏 + +export const TEST = '/api/order/deal'; \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 85e19c1..37435f3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -49,8 +49,42 @@ }, onLoad() { this.getCategoryList(); + // this.get(); }, methods: { + get(){ + this.$http(this.API.TEST, { + goods_id: 1, + goods_specs_id: 1, + number: 1, + token: 'b1f20b424ec9e7a2a4c9788fd0f75643' + }).then(res => { + console.log(res) + + // let nonceStr = res.data.nonceStr + // appId: "wxb35ef055a4dd8ad4" + // nonceStr: "60d3125d138af" + // order_num: "2842855348400816128" + // package: "prepay_id=wx23185213000285e14ea77ac97acc670000" + // paySign: "6DC330CBDF6C29BEDD4D254D9DA97364" + // signType: "MD5" + // timeStamp: "1624445533" + + + uni.requestPayment({ + orderInfo: res.data.order_num, + timeStamp: res.data.timeStamp, + nonceStr: res.data.nonceStr, + package: res.data.package, + signType: res.data.signType, + paySign: res.data.paySign, + complete: result => { + console.log(result) + } + }) + + }) + }, // 切换tab change(index) { this.current = index;