packageDetail.js
2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { IMG_URL } from '~/config';
Page({
data: {
orderStatus: 2,
IMGURL:IMG_URL
},
getPackageDetail(orderCode) {
wx.p.api.equityApi.packageOrderDetail({ orderCode }).then(res => {
if (res.createDate) {
res.createDate = new Date(res.createDate).format('yyyy-MM-dd hh:mm:ss')
}
if (res.refundDate) {
res.refundDate = new Date(res.refundDate).format('yyyy年MM月dd日 hh:mm')
}
this.setData({
packageInfo: res,
orderStatus: res.orderStatus
})
})
},
toUserCoupons(e) {
let { item } = e.currentTarget.dataset
// 页面接受的参数为id,所以这里得另起变量存
item.id = item.userCouponsId
let temp = JSON.stringify(item)
let { discountType, useChannel, useMemberType } = item
let detailInfo = { xx: 'xx' }
if (discountType == 2 || discountType == 4) {
wx.p.router.go('/packageMall/pages/coupon/coupon', {
userCouponId: item.id,
useMemberType,
detailInfo
})
return
}
/**线上商品代金券 */
if (discountType == 3 && useChannel == 1) {
// if(this.data.useMemberType == 1) {
// wx.$api.showToast('代金券已使用')
// return
// }
wx.p.router.go('/packageMine/pages/coupon/recommend/recommend', {
couponInfo: item
})
return
}
wx.navigateTo({
url: '/packageMine/pages/coupon/detail/detail?item=' + temp
})
},
// 套餐提交申请售后
packageSumbit() {
wx.$api.showLoading()
const { packageInfo } = this.data
let para = {
orderCode: packageInfo.orderCode,
reason: packageInfo.reason
}
wx.p.api.equityApi.packageApply(para).then(res => {
wx.hideLoading()
this.getPackageDetail(packageInfo.orderCode)
})
},
openMap() {
const { packageInfo } = this.data
wx.openLocation({
latitude: parseFloat(packageInfo.latitude),
longitude: parseFloat(packageInfo.longitude),
address: packageInfo.merchantAddress
})
},
onLoad: function (options) {
this.getPackageDetail(options.orderCode)
}
})