cancel-reason.vue
1.47 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
<template>
<div class="reason-list">
<span v-for="val in options" track-by="id" @click="select(val.id, val.reason)">{{val.reason}}</span>
</div>
</template>
<script>
'use strict';
import $ from 'jquery';
import yoho from 'yoho';
import tip from 'common/tip';
export default {
data() {
return {
options: [],
};
},
created() {
yoho.store.set('cancelReason', {
iscancel: true
});
$.ajax({
url: '/me/getCancelOrderReason',
}).then(result => {
if (result && result.data) {
this.options = result.data;
}
}).fail(() => {
tip('操作失败');
});
},
methods: {
select(id, reason) {
yoho.store.set('cancelReason', Object.assign(yoho.store.get('cancelReason'), {
id: id,
reason: reason
}));
yoho.goBack();
}
}
};
</script>
<style>
.cancel-reason {
width: 100%;
.reason-list {
width: 100%;
margin-left: 30px;
span {
display: block;
height: 90px;
line-height: 90px;
font-size: 34px;
border-bottom: 1px solid #eee;
}
}
}
</style>