From 92f0dd4c467019f218e05164b87ff7b2c753b39a Mon Sep 17 00:00:00 2001
From: pplokijuhyg <1162963624@qq.com>
Date: Mon, 23 Dec 2019 17:24:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/order/commodity/index.js | 44 ++++++++++++++++++++++++---
components/order/commodity/index.wxml | 24 +++++++--------
components/order/tab/index.wxml | 28 +++++++++--------
3 files changed, 67 insertions(+), 29 deletions(-)
diff --git a/components/order/commodity/index.js b/components/order/commodity/index.js
index 17e3ab3..f639a85 100644
--- a/components/order/commodity/index.js
+++ b/components/order/commodity/index.js
@@ -1,9 +1,11 @@
+import bin from "../../../utils/bin"
Component({
properties: {
- num:String,
- cprice:String,
- freight:String,
- goods:Array
+ num: String,
+ cprice: String,
+ freight: String,
+ goods: Array,
+ gid: String
},
data: {},
methods: {
@@ -11,6 +13,40 @@ Component({
wx.navigateTo({
url: "/pages/undetermined/undetermined"
})
+ },
+ cancel() {
+ bin.getuserid().then((id) => {
+ bin.request({
+ url: "User/cancelOrder",
+ urldata: {
+ user_id: id,
+ order_id: this.data.gid
+ }
+ }).then((res) => {
+ console.log(res)
+ })
+ })
+
+ },
+ pay(){
+ bin.getuserid().then((id)=>{
+ bin.request({
+ url:"Cart/getWXPayData",
+ urldata:{
+ user_id:id,
+ order_id:this.data.gid
+ }
+ }).then((res)=>{
+ console.log(res)
+ wx.requestPayment({
+ timeStamp:res.data.result.wdata.timeStamp + "",
+ nonceStr:res.data.result.wdata.nonceStr,
+ package:res.data.result.wdata.package,
+ signType:"MD5",
+ paySign:res.data.result.wdata.sign
+ })
+ })
+ })
}
}
})
\ No newline at end of file
diff --git a/components/order/commodity/index.wxml b/components/order/commodity/index.wxml
index 31abf4e..2efdcc5 100644
--- a/components/order/commodity/index.wxml
+++ b/components/order/commodity/index.wxml
@@ -1,14 +1,12 @@
-
-
- 共计{{num}}件商品 合计:
- ¥{{cprice}}
- (含运费¥{{freight}})
-
-
- 评价
-
- 评价
-
-
-
\ No newline at end of file
+
+
+ 共计{{num}}件商品 合计:
+ ¥{{cprice}}
+ (含运费¥{{freight}})
+
+
+ 取消订单
+ 立即付款
+
+
\ No newline at end of file
diff --git a/components/order/tab/index.wxml b/components/order/tab/index.wxml
index 93dd0b1..b69a174 100644
--- a/components/order/tab/index.wxml
+++ b/components/order/tab/index.wxml
@@ -1,13 +1,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file