Authored by shijian

app联调

... ... @@ -219,6 +219,19 @@ const matchHeader = (path, qs, titleMap) => {
return header;
}
if (/\/me\/records/.test(path)) {
header = titleMap[3];
header.title.des = '浏览记录';
header.right = {
des: '清空',
action: 'clearRecords'
};
if (qs.type === '0') {
header.right.des = '';
}
return header;
}
return header;
};
... ...
... ... @@ -5,7 +5,7 @@ const VueTouch = require('vue-touch');
Vue.use(VueTouch);
VueTouch.config.swipe = {
threshold: 50
threshold: 10
};
yoho.ready(() => {
... ...
<template>
<div class="items" v-for="item in list" v-if="item.show" v-touch:swipeleft="showbutton($index)"
v-touch:swiperight="hidebutton($index)" :class="{showbtn:item.isshowbtn,xiajia:!item.status,shouwan:!item.storage}">
v-touch:swiperight="hidebutton($index)" :class="{showbtn:item.isshowbtn,xiajia:!item.status,shouwan:!item.storage}" v-touch-options:swipe="{ direction: 'horizontal', threshold: 10}">
<div class="wrap">
<a :href="item.goodsUrl">
<img :src='item.image'>
... ...
... ... @@ -53,7 +53,7 @@
收藏的品牌
<span class="num">{{data.brand_favorite_total}} <span class="icon icon-right"></span></span>
</a>
<a class="glist-item" href="/me/records">
<a class="glist-item auth" href="/me/records?type={{recordNum}}">
浏览记录
<span class="num">{{recordNum}}<span class="icon icon-right"></span></span>
</a>
... ... @@ -116,7 +116,7 @@
$('.auth').off('click', this.authClick);
$('.auth').removeClass('no-intercept');
if (!yoho.isLogin()) {
if (yoho.isLogin()) {
$.ajax({
url: '/me/userdata'
}).then(result => {
... ...
... ... @@ -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,14 +201,14 @@ module.exports = {
},
focusCate(id, index, event) {
if (event) {
event.preventDefault();
}
let el = event.target;
// 标签移动
let el = event.target;
event.preventDefault();
if (el.getBoundingClientRect().right > window.innerWidth) {
el.parentNode.scrollLeft += el.getBoundingClientRect().right - window.innerWidth + 10;
// 标签移动
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() {
... ...