homeNologin.js
2.6 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import {
request
} from "../../request/index.js"
const a = getApp()
Page({
data: {
imagesUrl: a.globalData.baseUrl,
swiperList: {},
id: '',
way: 2
},
onShow: function () {},
onLoad: function (options) {
console.log(options);
this.setData({
id: options.id
})
this.getStoreList()
},
async getStoreList() {
let that = this
try {
const {
data: {
data
}
} = await request({
url: 'api/active/orderDetail',
data: {
id: that.data.id
}
})
console.log(data);
that.setData({
swiperList: data
})
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popMaskTest()
}
},
cancelRefund(e) { // 取消退款
let that = this
wx.showModal({
title: '提示',
content: '确定要取消退款吗?',
success: async function (res) {
if (res.confirm) {
try {
const {
data
} = await request({
url: 'api/active/qvTui',
data: {
order_no: e.currentTarget.dataset.order_no
}
})
console.log(data, "取消退款");
if (data.code == 1) {
a.popSuccessTest(data.msg)
setTimeout(() => {
// that.getMyorder()
wx.navigateBack()
}, 800);
}
} catch (err) {
a.popTest(err.msg)
}
} else {
}
}
})
},
async cancelOrder(e) {
let that = this
let id = e.currentTarget.dataset.id
try {
const {
data
} = await request({
url: 'api/active/tuiOrder',
data: {
id: id
}
})
console.log(data);
that.setData({
msg: data.msg
})
that.popSuccessTest()
setTimeout(() => {
wx.navigateBack()
}, 1500);
} catch (err) {
console.log(err);
that.setData({
msg: err.msg
})
that.popMaskTest()
}
},
popSuccessTest() {
wx.showToast({
title: this.data.msg,
icon: '', //默认值是success,就算没有icon这个值,就算有其他值最终也显示success
duration: 2000, //停留时间
})
},
popMaskTest() {
wx.showToast({
title: this.data.msg,
duration: 2000,
icon: 'none',
mask: true //是否有透明蒙层,默认为false
//如果有透明蒙层,弹窗的期间不能点击文档内容
})
},
})