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