完成
This commit is contained in:
@@ -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
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,14 +1,12 @@
|
||||
<view class="commodity" bindtap="todetail">
|
||||
<message wx:for="{{goods}}" title="{{item.goods_name}}" spec="{{item.spec_key_name}}" price="{{item.goods_price}}" num="{{goods_num}}" image="{{item.image}}"></message>
|
||||
<view class="aggregate">
|
||||
共计{{num}}件商品 合计:
|
||||
<text>¥{{cprice}}</text>
|
||||
(含运费¥{{freight}})
|
||||
</view>
|
||||
<view class="operation">
|
||||
<view class="button">评价</view>
|
||||
|
||||
<view class="button hlight">评价</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<message wx:for="{{goods}}" title="{{item.goods_name}}" spec="{{item.spec_key_name}}" price="{{item.goods_price}}" num="{{item.goods_num}}" image="{{item.image}}"></message>
|
||||
<view class="aggregate">
|
||||
共计{{num}}件商品 合计:
|
||||
<text>¥{{cprice}}</text>
|
||||
(含运费¥{{freight}})
|
||||
</view>
|
||||
<view class="operation">
|
||||
<view class="button" catch:tap="cancel">取消订单</view>
|
||||
<view class="button hlight" catch:tap="pay">立即付款</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user