2019-12-23 17:24:26 +08:00
|
|
|
import bin from "../../../utils/bin"
|
2019-12-23 10:04:09 +08:00
|
|
|
Component({
|
2019-12-23 16:53:54 +08:00
|
|
|
properties: {
|
2019-12-23 17:24:26 +08:00
|
|
|
num: String,
|
|
|
|
cprice: String,
|
|
|
|
freight: String,
|
|
|
|
goods: Array,
|
|
|
|
gid: String
|
2019-12-23 16:53:54 +08:00
|
|
|
},
|
2019-12-23 10:04:09 +08:00
|
|
|
data: {},
|
|
|
|
methods: {
|
|
|
|
todetail() {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: "/pages/undetermined/undetermined"
|
|
|
|
})
|
2019-12-23 17:24:26 +08:00
|
|
|
},
|
|
|
|
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
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
2019-12-23 10:04:09 +08:00
|
|
|
}
|
|
|
|
}
|
2019-12-14 10:25:59 +08:00
|
|
|
})
|