fix(关注/足迹): 优化交互逻辑
This commit is contained in:
@@ -19,5 +19,10 @@ export const lang = {
|
|||||||
currencySymbol: '¥',
|
currencySymbol: '¥',
|
||||||
submit: 'Submit',
|
submit: 'Submit',
|
||||||
searchTip: 'Please enter search keywords'
|
searchTip: 'Please enter search keywords'
|
||||||
}
|
},
|
||||||
|
|
||||||
|
login: 'Login/Register',
|
||||||
|
loginTips: 'Click to login and enjoy more exciting information',
|
||||||
|
toLogin: 'Go to login',
|
||||||
|
toGoodsCategoryPage: 'Go shopping',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ export const lang = {
|
|||||||
searchTip: '请输入搜索关键词'
|
searchTip: '请输入搜索关键词'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
login: '登录/注册',
|
||||||
|
loginTpis: '点击登录 享受更多精彩信息',
|
||||||
|
toLogin: '去登录',
|
||||||
|
toGoodsCategoryPage: '去逛逛',
|
||||||
|
|
||||||
waitpay: '待付款',
|
waitpay: '待付款',
|
||||||
waitsend: '待发货',
|
waitsend: '待发货',
|
||||||
|
|||||||
@@ -199,9 +199,12 @@
|
|||||||
</block>
|
</block>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<view class="cart-empty">
|
<view class="cart-empty">
|
||||||
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"></ns-empty>
|
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"
|
||||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
:emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||||
@click="toLogin">去登录</button>
|
<button type="primary" size="mini" class="button mini" v-if="!storeToken" @click="toLogin">{{
|
||||||
|
$lang('toLogin')
|
||||||
|
}}</button>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<ns-goods-recommend ref="goodrecommend" route="cart"></ns-goods-recommend>
|
<ns-goods-recommend ref="goodrecommend" route="cart"></ns-goods-recommend>
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import common from './common.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [common],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cartData: [], // 购物车
|
cartData: [], // 购物车
|
||||||
@@ -444,9 +447,6 @@ export default {
|
|||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toLogin() {
|
|
||||||
this.$refs.login.open();
|
|
||||||
},
|
|
||||||
// 重置编辑状态
|
// 重置编辑状态
|
||||||
resetEditStatus() {
|
resetEditStatus() {
|
||||||
if (this.cartData.length) {
|
if (this.cartData.length) {
|
||||||
|
|||||||
8
pages_goods/public/js/common.js
Normal file
8
pages_goods/public/js/common.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
// 跳转至登录页
|
||||||
|
toLogin() {
|
||||||
|
this.$refs.login.open();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :style="themeColor">
|
<view :style="themeColor">
|
||||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh"
|
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh">
|
||||||
v-if="storeToken">
|
<block class="goods_list" slot="list">
|
||||||
<view class="goods_list" slot="list">
|
|
||||||
<block v-if="collectionList.length > 0">
|
<block v-if="collectionList.length > 0">
|
||||||
<view class="goods_li margin-top" v-for="(item, index) in collectionList" :key="index"
|
<view class="goods_li margin-top" v-for="(item, index) in collectionList" :key="index"
|
||||||
@click.stop="toDetail(item)">
|
@click.stop="toDetail(item)">
|
||||||
@@ -30,9 +29,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<!-- 第一个列表为空时 -->
|
<!-- 第一个列表为空时 -->
|
||||||
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text="暂无关注的商品" :isIndex="false"></ns-empty>
|
<view class="collection-empty" v-else>
|
||||||
<ns-goods-recommend ref="goodsRecommend"></ns-goods-recommend>
|
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text="暂无关注的商品"
|
||||||
|
:isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||||
|
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||||
|
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<ns-goods-recommend ref="goodsRecommend"></ns-goods-recommend>
|
||||||
|
</block>
|
||||||
</mescroll-uni>
|
</mescroll-uni>
|
||||||
<ns-login ref="login"></ns-login>
|
<ns-login ref="login"></ns-login>
|
||||||
<loading-cover ref="loadingCover"></loading-cover>
|
<loading-cover ref="loadingCover"></loading-cover>
|
||||||
@@ -40,11 +45,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import common from './public/js/common.js';
|
||||||
import collection from './public/js/collection.js';
|
import collection from './public/js/collection.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [collection],
|
mixins: [common, collection],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
@@ -53,7 +58,7 @@ export default {
|
|||||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||||
} else {
|
} else {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.login.open('/pages_tool/member/collection');
|
this.$refs.loadingCover.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
<view class="head-wrap" v-if="storeToken">
|
<view class="head-wrap" v-if="storeToken">
|
||||||
<text @click="manageFootprint">{{ manage ? '完成' : '管理' }}</text>
|
<text @click="manageFootprint">{{ manage ? '完成' : '管理' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<mescroll-uni ref="mescroll" @getData="getListData" top="110rpx" v-if="storeToken">
|
<mescroll-uni ref="mescroll" @getData="getListData" top="110rpx">
|
||||||
<block slot="list">
|
<block slot="list">
|
||||||
<view class="goods-list single-column" v-if="goodsList.length">
|
<view class="goods-list single-column" v-if="goodsList.length > 0">
|
||||||
<view v-for="(item, index) in goodsList" :key="index">
|
<view v-for="(item, index) in goodsList" :key="index">
|
||||||
<view class="datetime">{{ datetime(item) }}</view>
|
<view class="datetime">{{ datetime(item) }}</view>
|
||||||
<view class="goods-item" :class="{ manage: manage }">
|
<view class="goods-item" :class="{ manage: manage }">
|
||||||
@@ -45,7 +45,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else><ns-empty text="暂无浏览过的商品"></ns-empty></view>
|
<view class="footprint-empty" v-else>
|
||||||
|
<ns-empty text="暂无浏览过的商品" :isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||||
|
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||||
|
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="bottom-wrap" v-if="goodsList.length && manage">
|
<view class="bottom-wrap" v-if="goodsList.length && manage">
|
||||||
<view class="all-election" @click="allElection">
|
<view class="all-election" @click="allElection">
|
||||||
@@ -65,7 +69,10 @@
|
|||||||
<script>
|
<script>
|
||||||
var dateList = [];
|
var dateList = [];
|
||||||
|
|
||||||
|
import common from './public/js/common.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [common],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
@@ -81,7 +88,7 @@ export default {
|
|||||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||||
} else {
|
} else {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.login.open('/pages_tool/member/footprint');
|
this.$refs.loadingCover.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -108,9 +115,7 @@ export default {
|
|||||||
if (res.code == 0 && res.data) {
|
if (res.code == 0 && res.data) {
|
||||||
newArr = res.data.list;
|
newArr = res.data.list;
|
||||||
} else {
|
} else {
|
||||||
this.$util.showToast({
|
console.log(`后台服务器返回的信息:${msg}`);
|
||||||
title: msg
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
mescroll.endSuccess(newArr.length);
|
mescroll.endSuccess(newArr.length);
|
||||||
//设置列表数据
|
//设置列表数据
|
||||||
|
|||||||
@@ -99,3 +99,24 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-top: 50rpx;
|
margin-top: 50rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.collection-empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 140rpx $padding 80rpx $padding;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 380rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
min-width: 300rpx;
|
||||||
|
margin-top: 100rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx !important;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
&.visit-the {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,27 @@
|
|||||||
margin-top: 100rpx;
|
margin-top: 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footprint-empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 140rpx $padding 80rpx $padding;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 380rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
min-width: 300rpx;
|
||||||
|
margin-top: 100rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx !important;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
&.visit-the {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.lineheight-clear {
|
.lineheight-clear {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
let newArr = res.data.list;
|
let newArr = res.data?.list || [];
|
||||||
for (var i = 0; i < newArr.length; i++) {
|
for (var i = 0; i < newArr.length; i++) {
|
||||||
newArr[i].composite_score = Math.floor((parseFloat(newArr[i].shop_desccredit) + parseFloat(newArr[i].shop_servicecredit) + parseFloat(newArr[i].shop_deliverycredit)) / 3).toFixed(1);
|
newArr[i].composite_score = Math.floor((parseFloat(newArr[i].shop_desccredit) + parseFloat(newArr[i].shop_servicecredit) + parseFloat(newArr[i].shop_deliverycredit)) / 3).toFixed(1);
|
||||||
}
|
}
|
||||||
|
|||||||
8
pages_tool/member/public/js/common.js
Normal file
8
pages_tool/member/public/js/common.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
// 跳转至登录页
|
||||||
|
toLogin() {
|
||||||
|
this.$refs.login.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user