deguodaigou/components/order/commodity/index.js

61 lines
1.8 KiB
JavaScript
Raw Normal View History

2019-12-23 09:24:26 +00:00
import bin from "../../../utils/bin"
2019-12-23 02:04:09 +00:00
Component({
2019-12-23 08:53:54 +00:00
properties: {
2019-12-23 09:24:26 +00:00
num: String,
cprice: String,
freight: String,
goods: Array,
2019-12-24 06:08:26 +00:00
gid: String,
type:String
2019-12-23 08:53:54 +00:00
},
2019-12-23 02:04:09 +00:00
data: {},
methods: {
2019-12-24 06:08:26 +00:00
shouhuo(){
bin.getuserid().then((id)=>{
bin.request({
url:"User/orderConfirm",
urldata:{
user_id:id,
order_id:this.data.gid
}
}).then((res)=>{
console.log(res)
})
2019-12-23 02:04:09 +00:00
})
2019-12-23 09:24:26 +00: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 02:04:09 +00:00
}
}
2019-12-14 02:25:59 +00:00
})