feat(index): update index style
This commit is contained in:
parent
e618f90599
commit
94cab75c5d
|
@ -44,7 +44,7 @@
|
|||
<view class="goods-sort">
|
||||
<view class="goods-flexs">
|
||||
<view
|
||||
v-for="(item, index) in goodsList.recommendSpecialAreaList"
|
||||
v-for="(item, index) in recommendSpecialAreaList"
|
||||
:key="index"
|
||||
>
|
||||
<view
|
||||
|
@ -61,7 +61,7 @@
|
|||
<view
|
||||
class="goods-list"
|
||||
v-for="(items, indexs) in item.waresList"
|
||||
v-if="indexs < 2"
|
||||
:key="indexs"
|
||||
>
|
||||
<view class="goods-content">
|
||||
<view class="goods">
|
||||
|
@ -102,24 +102,24 @@
|
|||
<view class="padding_s goods-info">
|
||||
<view class="goods-name">{{ item.waresName }}</view>
|
||||
<view class="goods-sales-wrapper">
|
||||
<view class="goods-sales">累计销量{{ item.sales | seles }}</view>
|
||||
<view class="goods-sales">累计销量{{ formatSales(item.sales) }}</view>
|
||||
<view
|
||||
class="goods-price"
|
||||
v-if="item.specialArea == 31 && userInfo.isMakerSpace == 1"
|
||||
>
|
||||
<span class="price-symbol">¥</span>
|
||||
<span>{{ item.vipPrice | numberToCurrency }}</span>
|
||||
<span>{{ formatCurrency(item.vipPrice) }}</span>
|
||||
</view>
|
||||
<view class="goods-price" v-if="item.specialArea != 31">
|
||||
<span class="price-symbol">¥</span>
|
||||
<span>{{ item.waresPrice | numberToCurrency }}</span>
|
||||
<span>{{ formatCurrency(item.waresPrice) }}</span>
|
||||
</view>
|
||||
<view
|
||||
class="goods-price"
|
||||
v-if="item.specialArea == 31 && userInfo.isMakerSpace == 0"
|
||||
>
|
||||
<span class="price-symbol">¥</span>
|
||||
<span>{{ item.waresPrice | numberToCurrency }}</span>
|
||||
<span>{{ formatCurrency(item.waresPrice) }}</span>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -177,6 +177,7 @@ import clTabbar from "@/components/cl-tabbar.vue";
|
|||
import noticePopup from "@/components/noticePopup.vue";
|
||||
import getTree from "@/components/getTree.vue";
|
||||
import znNewsPopup from "@/components/znNewsPopup.vue";
|
||||
import { getAreaGoods } from '@/config/special-area'
|
||||
// import directrankPopup from "@/components/directrankPopup.vue";
|
||||
export default {
|
||||
components: {
|
||||
|
@ -209,6 +210,7 @@ export default {
|
|||
autoplay: true,
|
||||
duration: 500,
|
||||
goodsList: [],
|
||||
recommendSpecialAreaList: [],
|
||||
zoneList: [
|
||||
{
|
||||
label: '注册专区',
|
||||
|
@ -402,6 +404,7 @@ export default {
|
|||
) {
|
||||
}
|
||||
this.getGoodsInfo();
|
||||
this.getAreaGoods();
|
||||
// this.getLanguage();
|
||||
this.getService();
|
||||
},
|
||||
|
@ -416,6 +419,20 @@ export default {
|
|||
}, 1000);
|
||||
},
|
||||
methods: {
|
||||
formatSales(value) {
|
||||
if (value > 999) {
|
||||
return "999+";
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
formatCurrency(value) {
|
||||
// Simple currency formatting, adapt if needed (e.g., using Intl.NumberFormat or a library)
|
||||
if (typeof value !== 'number') {
|
||||
return value;
|
||||
}
|
||||
return value.toFixed(2); // Assumes 2 decimal places
|
||||
},
|
||||
goAreaUrl() {
|
||||
ban.agreementName().then((res) => {
|
||||
if (res.data == 0) {
|
||||
|
@ -440,6 +457,11 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getAreaGoods() {
|
||||
getAreaGoods().then((res) => {
|
||||
this.recommendSpecialAreaList = res.data?.recommendSpecialAreaList || []
|
||||
})
|
||||
},
|
||||
toDel() {
|
||||
this.promptFlag = false;
|
||||
if (this.jumpPage == 1) {
|
||||
|
@ -816,35 +838,37 @@ header {
|
|||
.goods-cen {
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
justify-content: space-between;
|
||||
gap: 20rpx;
|
||||
// justify-content: space-between;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
// display: flex;
|
||||
margin-right: 20rpx;
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.goods-content {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
text-align: center;
|
||||
|
||||
.goods {
|
||||
image {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-flexs {
|
||||
display: flex;
|
||||
// display: flex;
|
||||
padding: 20rpx 20rpx 10rpx 0;
|
||||
position: relative;
|
||||
flex-wrap: wrap; // margin-left: -25rpx;
|
||||
|
||||
.bg-color {
|
||||
width: 343rpx;
|
||||
// width: 343rpx;
|
||||
width: 100%;
|
||||
height: 72rpx;
|
||||
background: linear-gradient(to bottom, #add8e6, #ffffff);
|
||||
border-radius: 15rpx 15rpx 0 0;
|
||||
|
@ -864,7 +888,7 @@ header {
|
|||
|
||||
.goods-view {
|
||||
position: relative;
|
||||
width: 302rpx; // height: 180rpx;
|
||||
// width: 302rpx; // height: 180rpx;
|
||||
margin-left: 20rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 15rpx;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<backIcon></backIcon>
|
||||
<!-- 轮播图 -->
|
||||
<u-swiper
|
||||
:list="imgUrlList"
|
||||
:list="bannerImgList"
|
||||
:height="isWidth"
|
||||
circular
|
||||
:autoplay="false"
|
||||
|
@ -266,6 +266,13 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
bannerImgList() {
|
||||
const list = this.imgUrlList.map(item => item)
|
||||
list.splice(1,1)
|
||||
return list
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toIndex() {
|
||||
uni.switchTab({ url: "/pages/index/index" });
|
||||
|
|
|
@ -322,15 +322,6 @@ export default {
|
|||
getGoodsInfo() {
|
||||
let userInfo = uni.getStorageSync('User')
|
||||
getAreaGoods().then((res) => {
|
||||
// if (userInfo.pkSettleCountry == 1) {
|
||||
// res.data.recommendSpecialAreaList.unshift({
|
||||
// specialArea: 21,
|
||||
// isShare: 1,
|
||||
// specialAreaName: '免费注册',
|
||||
// waresList: res.data.recommendSpecialAreaList[0].waresList,
|
||||
// })
|
||||
// }
|
||||
|
||||
this.goodsList = res.data
|
||||
this.$forceUpdate()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue