my_benefit.html
5.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<!--<script src="../../assets/js/fontsize.js"></script>-->
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/index.css">
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<title>我的权益</title>
<style>
body {
/*background-color: #f2f2f2;*/
height: 100%;
position: relative;
}
.post_title_box {
top: 0;
left: 0;
position: fixed;
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.post_title {
font-size: 15px;
color: #424242;
text-align: center;
padding: 20px 0;
width: 100%;
}
.benefit_btn {
display: flex;
align-items: center;
justify-content: space-around;
font-size: 15px;
color: #DDBB73;
padding: 25px 0;
margin: 16px 14px;
border-radius: 8px;
/*border: 4px solid #DDBB73;*/
}
.benefit_btn span {
border: 1px solid #DDBB73;
border-radius: 10px;
width: 40%;
text-align: center;
padding: 7px 0;
}
.content{
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.25rem;
}
.content img{
width: 100%;
}
</style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div v-if="post_content==null" class="post_title_box">
<div class="benefit_btn post_title">你还没有购买权益哦</div>
</div>
<div v-else>
<!--<div class="post_title">{{post_title}}</div>-->
<div v-html="post_content" class="content"></div>
<div class="benefit_btn">
<span @click="changeEqual(1)">申请转让</span>
<span @click="changeEqual(2)">申请转等额转消费金</span>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
post_title: '',
post_content: '',
able: ''
},
created: function () {
apiready = function () {
app.getMyRight();
app.changeValue();
}
},
methods: {
getMyRight: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/myRights', null, header).then(function (res) {
if (res.data.code == 1) {
app.post_title = res.data.data.post_title;
app.post_content = res.data.data.post_content;
} else {
toastMsg(res.data.msg);
}
loadEnd()
});
},
changeValue: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/myRightsCheck', null, header).then(function (res) {
// alert(JSON.stringify(res))
if (res.data.code == 1) {
app.able = res.data.data.able
}
else {
}
})
},
changeEqual: function (type) {
if (app.able == 1) {
var post = {
change_type: type
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
}
api.confirm({
title: '确定转让?',
msg: '转让权益',
buttons: ['确定', '取消']
}, function (ret, err) {
var index = ret.buttonIndex;
if (index == 1) {
getRequest('post', 'user/index/confirmChangeRights', post, header).then(function (res) {
if (res.data.code == 1) {
toastMsg(res.data.msg)
}
})
} else {
toastMsg('取消')
}
});
} else {
toastMsg('您好!您的权益还未到期转让')
}
}
}
})
</script>