fix(关注/足迹): 优化交互逻辑

This commit is contained in:
2026-01-07 11:35:28 +08:00
parent d1b9e528f8
commit 8df59abd03
11 changed files with 111 additions and 31 deletions

View File

@@ -65,7 +65,7 @@
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
<text class="unit price-style small">.{{
parseFloat(item.member_price).toFixed(2).split('.')[1]
}}</text>
}}</text>
<image :src="$util.img('public/uniapp/index/VIP.png')" />
</view>
</view>
@@ -79,7 +79,7 @@
}}
<text class="unit price-style small">.{{
parseFloat(item.discount_price).toFixed(2).split('.')[1]
}}</text>
}}</text>
<image
:src="$util.img('public/uniapp/index/discount.png')" />
</view>
@@ -95,7 +95,7 @@
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
<text class="unit price-style small">.{{
parseFloat(item.member_price).toFixed(2).split('.')[1]
}}</text>
}}</text>
<image :src="$util.img('public/uniapp/index/VIP.png')" />
</view>
</view>
@@ -108,7 +108,7 @@
{{ parseFloat(item.price).toFixed(2).split('.')[0] }}
<text class="unit price-style small">.{{
parseFloat(item.price).toFixed(2).split('.')[1]
}}</text>
}}</text>
</view>
</view>
</block>
@@ -175,7 +175,7 @@
}}
<text class="unit price-style small">.{{
parseFloat(goodsItem.member_price).toFixed(2).split('.')[1]
}}</text>
}}</text>
<image :src="$util.img('public/uniapp/index/VIP.png')" />
</template>
<template v-else>
@@ -185,7 +185,7 @@
}}
<text class="unit price-style small">.{{
parseFloat(goodsItem.discount_price).toFixed(2).split('.')[1]
}}</text>
}}</text>
</template>
</text>
</view>
@@ -199,9 +199,12 @@
</block>
<block v-else>
<view class="cart-empty">
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"></ns-empty>
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
@click="toLogin">去登录</button>
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :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>
</block>
<ns-goods-recommend ref="goodrecommend" route="cart"></ns-goods-recommend>
@@ -316,9 +319,9 @@
<text class="unit price-font">{{ $lang('common.currencySymbol') }}</text>
<block v-if="Object.keys(discount).length">
<text class="value price-font">{{ parseFloat(discount.order_money).toFixed(2).split('.')[0]
}}</text>
}}</text>
<text class="unit price-font">.{{ parseFloat(discount.order_money).toFixed(2).split('.')[1]
}}</text>
}}</text>
</block>
<block v-else>
<text class="value price-font">{{ parseFloat(totalPrice).toFixed(2).split('.')[0] }}</text>

View File

@@ -1,4 +1,7 @@
import common from './common.js';
export default {
mixins: [common],
data() {
return {
cartData: [], // 购物车
@@ -444,9 +447,6 @@ export default {
// });
}
},
toLogin() {
this.$refs.login.open();
},
// 重置编辑状态
resetEditStatus() {
if (this.cartData.length) {

View File

@@ -0,0 +1,8 @@
export default {
methods: {
// 跳转至登录页
toLogin() {
this.$refs.login.open();
},
}
}