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