...
|
...
|
@@ -11,21 +11,22 @@ |
|
|
:deleteSkn="deleteskn"></swiper-list>
|
|
|
</div>
|
|
|
<div v-if="nodata">
|
|
|
<div class='title-wrap'>浏览记录</div>
|
|
|
<!--<div class='title-wrap'>浏览记录</div>-->
|
|
|
<div class="nodata">
|
|
|
<i></i>
|
|
|
<div class="tip1">暂无浏览记录</div>
|
|
|
<div class="tip2">You have no recently viewed items</div>
|
|
|
<a class="go" href="//m.yohoblk.com">随便逛逛</a>
|
|
|
<a class="go" href="/product/new">随便逛逛</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
const yoho = require('yoho');
|
|
|
const yoho = require('yoho');
|
|
|
const $ = require('jquery');
|
|
|
const swiperList = require('component/me/swiperList.vue');
|
|
|
const modal = require('common/modal');
|
|
|
const interceptClick = require('common/intercept-click');
|
|
|
let originList, originCategory, categoryLen;
|
|
|
|
|
|
module.exports = {
|
...
|
...
|
@@ -46,7 +47,7 @@ module.exports = { |
|
|
this.headIco = 'data:image/png;base64,R0lGODlhFAAUAIAAAP///wAAACH5BAEAAAAALAAAAAAUABQAAAIRhI+py+0Po5y02ouz3rz7rxUAOw==';
|
|
|
},
|
|
|
reload() {
|
|
|
if (!yoho.isLogin()) {
|
|
|
if (yoho.isLogin()) {
|
|
|
$.ajax({
|
|
|
url: '/me/recordDataNew'
|
|
|
}).then(result => {
|
...
|
...
|
@@ -76,6 +77,9 @@ module.exports = { |
|
|
|
|
|
this.hasdata = 1;
|
|
|
this.nodata = 0;
|
|
|
|
|
|
// 绑定清空事件
|
|
|
yoho.addNativeMethod('clearRecords', this.clearAllRecords);
|
|
|
} else {
|
|
|
this.nodata = 1;
|
|
|
this.hasdata = 0;
|
...
|
...
|
@@ -105,6 +109,7 @@ module.exports = { |
|
|
if (!originList.length) {
|
|
|
this.nodata = 1;
|
|
|
this.hasdata = 0;
|
|
|
this.updateNavBar();
|
|
|
} else {
|
|
|
let deleteId = true;
|
|
|
|
...
|
...
|
@@ -138,7 +143,7 @@ module.exports = { |
|
|
let that = this;
|
|
|
let name, id, index;
|
|
|
|
|
|
//寻找类别
|
|
|
// 寻找类别
|
|
|
for (let i = 0; i < categoryLen; i++) {
|
|
|
if (this.category[i].focus === true) {
|
|
|
name = this.category[i].category_name;
|
...
|
...
|
@@ -175,6 +180,7 @@ module.exports = { |
|
|
if (!index || !originList.length) {
|
|
|
that.nodata = 1;
|
|
|
that.hasdata = 0;
|
|
|
that.updateNavBar();
|
|
|
} else {
|
|
|
|
|
|
// 更新页面
|
...
|
...
|
@@ -186,8 +192,8 @@ module.exports = { |
|
|
data: {
|
|
|
skn: skn
|
|
|
}
|
|
|
}).then(result => {
|
|
|
if (result.code === 200) {}
|
|
|
}).then(() => {
|
|
|
|
|
|
});
|
|
|
this.hide();
|
|
|
return false;
|
...
|
...
|
@@ -195,15 +201,15 @@ module.exports = { |
|
|
},
|
|
|
focusCate(id, index, event) {
|
|
|
if (event) {
|
|
|
let el = event.target;
|
|
|
|
|
|
event.preventDefault();
|
|
|
}
|
|
|
|
|
|
// 标签移动
|
|
|
let el = event.target;
|
|
|
|
|
|
if (el.getBoundingClientRect().right > window.innerWidth) {
|
|
|
el.parentNode.scrollLeft += el.getBoundingClientRect().right - window.innerWidth + 10;
|
|
|
}
|
|
|
}
|
|
|
let list = Object.assign([], originList);
|
|
|
let newList;
|
|
|
|
...
|
...
|
@@ -224,6 +230,14 @@ module.exports = { |
|
|
refreshRecords() {
|
|
|
this.list = originList;
|
|
|
this.focusCate(0, 0);
|
|
|
},
|
|
|
updateNavBar() {
|
|
|
const header = Object.assign({}, interceptClick.defaultTitleMap[3]);
|
|
|
|
|
|
header.right.des = '';
|
|
|
yoho.updateNavigationBar({
|
|
|
header: header
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
ready() {
|
...
|
...
|
|