|
@@ -11,21 +11,22 @@ |
|
@@ -11,21 +11,22 @@ |
11
|
:deleteSkn="deleteskn"></swiper-list>
|
11
|
:deleteSkn="deleteskn"></swiper-list>
|
12
|
</div>
|
12
|
</div>
|
13
|
<div v-if="nodata">
|
13
|
<div v-if="nodata">
|
14
|
- <div class='title-wrap'>浏览记录</div>
|
14
|
+ <!--<div class='title-wrap'>浏览记录</div>-->
|
15
|
<div class="nodata">
|
15
|
<div class="nodata">
|
16
|
<i></i>
|
16
|
<i></i>
|
17
|
<div class="tip1">暂无浏览记录</div>
|
17
|
<div class="tip1">暂无浏览记录</div>
|
18
|
<div class="tip2">You have no recently viewed items</div>
|
18
|
<div class="tip2">You have no recently viewed items</div>
|
19
|
- <a class="go" href="//m.yohoblk.com">随便逛逛</a>
|
19
|
+ <a class="go" href="/product/new">随便逛逛</a>
|
20
|
</div>
|
20
|
</div>
|
21
|
</div>
|
21
|
</div>
|
22
|
</template>
|
22
|
</template>
|
23
|
|
23
|
|
24
|
<script>
|
24
|
<script>
|
25
|
- const yoho = require('yoho');
|
25
|
+const yoho = require('yoho');
|
26
|
const $ = require('jquery');
|
26
|
const $ = require('jquery');
|
27
|
const swiperList = require('component/me/swiperList.vue');
|
27
|
const swiperList = require('component/me/swiperList.vue');
|
28
|
const modal = require('common/modal');
|
28
|
const modal = require('common/modal');
|
|
|
29
|
+const interceptClick = require('common/intercept-click');
|
29
|
let originList, originCategory, categoryLen;
|
30
|
let originList, originCategory, categoryLen;
|
30
|
|
31
|
|
31
|
module.exports = {
|
32
|
module.exports = {
|
|
@@ -46,7 +47,7 @@ module.exports = { |
|
@@ -46,7 +47,7 @@ module.exports = { |
46
|
this.headIco = 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw==';
|
47
|
this.headIco = 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw==';
|
47
|
},
|
48
|
},
|
48
|
reload() {
|
49
|
reload() {
|
49
|
- if (!yoho.isLogin()) {
|
50
|
+ if (yoho.isLogin()) {
|
50
|
$.ajax({
|
51
|
$.ajax({
|
51
|
url: '/me/recordDataNew'
|
52
|
url: '/me/recordDataNew'
|
52
|
}).then(result => {
|
53
|
}).then(result => {
|
|
@@ -76,6 +77,9 @@ module.exports = { |
|
@@ -76,6 +77,9 @@ module.exports = { |
76
|
|
77
|
|
77
|
this.hasdata = 1;
|
78
|
this.hasdata = 1;
|
78
|
this.nodata = 0;
|
79
|
this.nodata = 0;
|
|
|
80
|
+
|
|
|
81
|
+ // 绑定清空事件
|
|
|
82
|
+ yoho.addNativeMethod('clearRecords', this.clearAllRecords);
|
79
|
} else {
|
83
|
} else {
|
80
|
this.nodata = 1;
|
84
|
this.nodata = 1;
|
81
|
this.hasdata = 0;
|
85
|
this.hasdata = 0;
|
|
@@ -105,6 +109,7 @@ module.exports = { |
|
@@ -105,6 +109,7 @@ module.exports = { |
105
|
if (!originList.length) {
|
109
|
if (!originList.length) {
|
106
|
this.nodata = 1;
|
110
|
this.nodata = 1;
|
107
|
this.hasdata = 0;
|
111
|
this.hasdata = 0;
|
|
|
112
|
+ this.updateNavBar();
|
108
|
} else {
|
113
|
} else {
|
109
|
let deleteId = true;
|
114
|
let deleteId = true;
|
110
|
|
115
|
|
|
@@ -138,7 +143,7 @@ module.exports = { |
|
@@ -138,7 +143,7 @@ module.exports = { |
138
|
let that = this;
|
143
|
let that = this;
|
139
|
let name, id, index;
|
144
|
let name, id, index;
|
140
|
|
145
|
|
141
|
- //寻找类别
|
146
|
+ // 寻找类别
|
142
|
for (let i = 0; i < categoryLen; i++) {
|
147
|
for (let i = 0; i < categoryLen; i++) {
|
143
|
if (this.category[i].focus === true) {
|
148
|
if (this.category[i].focus === true) {
|
144
|
name = this.category[i].category_name;
|
149
|
name = this.category[i].category_name;
|
|
@@ -175,6 +180,7 @@ module.exports = { |
|
@@ -175,6 +180,7 @@ module.exports = { |
175
|
if (!index || !originList.length) {
|
180
|
if (!index || !originList.length) {
|
176
|
that.nodata = 1;
|
181
|
that.nodata = 1;
|
177
|
that.hasdata = 0;
|
182
|
that.hasdata = 0;
|
|
|
183
|
+ that.updateNavBar();
|
178
|
} else {
|
184
|
} else {
|
179
|
|
185
|
|
180
|
// 更新页面
|
186
|
// 更新页面
|
|
@@ -186,8 +192,8 @@ module.exports = { |
|
@@ -186,8 +192,8 @@ module.exports = { |
186
|
data: {
|
192
|
data: {
|
187
|
skn: skn
|
193
|
skn: skn
|
188
|
}
|
194
|
}
|
189
|
- }).then(result => {
|
|
|
190
|
- if (result.code === 200) {}
|
195
|
+ }).then(() => {
|
|
|
196
|
+
|
191
|
});
|
197
|
});
|
192
|
this.hide();
|
198
|
this.hide();
|
193
|
return false;
|
199
|
return false;
|
|
@@ -195,15 +201,15 @@ module.exports = { |
|
@@ -195,15 +201,15 @@ module.exports = { |
195
|
},
|
201
|
},
|
196
|
focusCate(id, index, event) {
|
202
|
focusCate(id, index, event) {
|
197
|
if (event) {
|
203
|
if (event) {
|
|
|
204
|
+ let el = event.target;
|
|
|
205
|
+
|
198
|
event.preventDefault();
|
206
|
event.preventDefault();
|
199
|
- }
|
|
|
200
|
|
207
|
|
201
|
// 标签移动
|
208
|
// 标签移动
|
202
|
- let el = event.target;
|
|
|
203
|
-
|
|
|
204
|
if (el.getBoundingClientRect().right > window.innerWidth) {
|
209
|
if (el.getBoundingClientRect().right > window.innerWidth) {
|
205
|
el.parentNode.scrollLeft += el.getBoundingClientRect().right - window.innerWidth + 10;
|
210
|
el.parentNode.scrollLeft += el.getBoundingClientRect().right - window.innerWidth + 10;
|
206
|
}
|
211
|
}
|
|
|
212
|
+ }
|
207
|
let list = Object.assign([], originList);
|
213
|
let list = Object.assign([], originList);
|
208
|
let newList;
|
214
|
let newList;
|
209
|
|
215
|
|
|
@@ -224,6 +230,14 @@ module.exports = { |
|
@@ -224,6 +230,14 @@ module.exports = { |
224
|
refreshRecords() {
|
230
|
refreshRecords() {
|
225
|
this.list = originList;
|
231
|
this.list = originList;
|
226
|
this.focusCate(0, 0);
|
232
|
this.focusCate(0, 0);
|
|
|
233
|
+ },
|
|
|
234
|
+ updateNavBar() {
|
|
|
235
|
+ const header = Object.assign({}, interceptClick.defaultTitleMap[3]);
|
|
|
236
|
+
|
|
|
237
|
+ header.right.des = '';
|
|
|
238
|
+ yoho.updateNavigationBar({
|
|
|
239
|
+ header: header
|
|
|
240
|
+ });
|
227
|
}
|
241
|
}
|
228
|
},
|
242
|
},
|
229
|
ready() {
|
243
|
ready() {
|