feat: 优化
This commit is contained in:
@@ -1,43 +1,20 @@
|
||||
<template>
|
||||
<view class="choiceness_warp">
|
||||
<view class="choiceness_title">
|
||||
<up-image
|
||||
src="/static/common/jingxuan_left.png"
|
||||
width="24"
|
||||
height="8"
|
||||
bgColor="#f1f6ff00"
|
||||
></up-image>
|
||||
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
|
||||
<view class="choiceness_title_msg">为您精选</view>
|
||||
<up-image
|
||||
src="/static/common/jingxuan_right.png"
|
||||
width="24"
|
||||
height="8"
|
||||
bgColor="#f1f6ff00"
|
||||
></up-image>
|
||||
<up-image src="/static/common/jingxuan_right.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
|
||||
</view>
|
||||
<view
|
||||
class="choiceness_product"
|
||||
:class="platformType ? '' : 'iosplatformType'"
|
||||
>
|
||||
<view
|
||||
v-for="item in productList"
|
||||
:key="item.id"
|
||||
class="choiceness_product_item"
|
||||
@click="jumpInfo(item)"
|
||||
>
|
||||
<up-image
|
||||
:src="item.url"
|
||||
width="100%"
|
||||
height="140"
|
||||
bgColor="#f1f6ff00"
|
||||
></up-image>
|
||||
<view class="choiceness_product" :class="platformType ? '' : 'iosplatformType'">
|
||||
<view v-for="item in productList" :key="item.id" class="choiceness_product_item" @click="jumpInfo(item)">
|
||||
<up-image :src="item.url" width="100%" height="140" bgColor="#f1f6ff00"></up-image>
|
||||
<view class="product_item_name">{{ item.title }}</view>
|
||||
<view class="product_item_price">
|
||||
<view class="price_">
|
||||
<text>¥</text>
|
||||
<text style="color: 36rpx">{{ item.price }}</text>
|
||||
</view>
|
||||
<view class="price_sell">已售{{ item.sales }}件</view>
|
||||
<view class="price_sell">全网销量{{ limit999(item.sales) }}件</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -56,13 +33,20 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
/*#ifdef APP-PLUS*/
|
||||
/*#ifdef APP-PLUS*/
|
||||
const appUpdate = uni.getStorageSync("platform");
|
||||
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
|
||||
/*#endif*/
|
||||
/*#endif*/
|
||||
this.getSearchList();
|
||||
},
|
||||
methods: {
|
||||
limit999(n) {
|
||||
const num = Number(n);
|
||||
if (isNaN(num) || num < 10000) {
|
||||
return n != null && n !== '' ? String(n) : '0';
|
||||
}
|
||||
return `${Math.floor(num / 10000)}万+`;
|
||||
},
|
||||
//
|
||||
jumpInfo(item) {
|
||||
uni.navigateTo({
|
||||
@@ -104,6 +88,7 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
|
||||
|
||||
&.iosplatformType {
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
<scroll-view :scroll-y="true" class="address-bottom-list" :scroll-into-view="scrollId">
|
||||
<scroll-view :scroll-y="true" class="address-bottom-list" :scroll-into-view="scrollId"
|
||||
:scroll-top="scrollTop">
|
||||
<view class="address-data-view" v-for="(item, index) in dataList" :key="index" :id="item.zi">
|
||||
<text class="text-32 text-gray text-bold">{{ item.zi }}</text>
|
||||
<view class="address-data-data" @click="onItem(item, xItem)" v-for="(xItem, xIndex) in item.data"
|
||||
@@ -45,6 +46,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
scrollId: '',
|
||||
scrollTop: 0,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@@ -68,10 +70,23 @@ export default {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
watch: {
|
||||
dataList() {
|
||||
this.resetScroll();
|
||||
},
|
||||
curSelect() {
|
||||
this.resetScroll();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resetScroll() {
|
||||
this.scrollId = '';
|
||||
this.scrollTop = this.scrollTop === 0 ? 0.01 : 0;
|
||||
this.$nextTick(() => {
|
||||
this.scrollTop = 0;
|
||||
});
|
||||
},
|
||||
onClose() {
|
||||
this.$emit('close')
|
||||
},
|
||||
@@ -83,6 +98,7 @@ export default {
|
||||
},
|
||||
onSelectItrm(item, index) {
|
||||
if (index != this.curSelect) {
|
||||
this.resetScroll();
|
||||
this.$emit('select', item, index);
|
||||
}
|
||||
},
|
||||
@@ -91,6 +107,7 @@ export default {
|
||||
Func.debounce(() => this.onItemOne(item, xItem), 150);
|
||||
},
|
||||
onItemOne(item, xItem) {
|
||||
this.resetScroll();
|
||||
this.$emit('itemSelect', item, xItem);
|
||||
}
|
||||
}
|
||||
@@ -127,8 +144,8 @@ export default {
|
||||
|
||||
.address-bottom-list {
|
||||
width: 100%;
|
||||
height: calc(100% - 88rpx - 88rpx - 32rpx);
|
||||
margin-top: 32rpx;
|
||||
height: calc(100% - 60rpx - 88rpx - 32rpx);
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
@@ -153,8 +170,8 @@ export default {
|
||||
|
||||
.address-select-view {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
min-height: 88rpx;
|
||||
height: 60rpx;
|
||||
min-height: 60rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
+24
-13
@@ -22,9 +22,9 @@
|
||||
<view class="templ_img_item" v-for="item in uploadTemplList" :key="item.id">
|
||||
<up-image :src="item.url" width="100%" height="50" bgColor="#f1f6ff00"></up-image>
|
||||
<view class="templ_img_item_msg">
|
||||
<up-image :src="item.isOk ? '/static/common/ID_ok_1.png' : '/static/common/ID_error.png'" width="10"
|
||||
height="10" bgColor="#f1f6ff00"></up-image>
|
||||
<view class="templ_img_item_msg_title">{{ item.title }}</view>
|
||||
<up-image :src="item.isOk ? '/static/common/ID_ok_1.png' : '/static/common/ID_error.png'"
|
||||
width="10" height="10" bgColor="#f1f6ff00"></up-image>
|
||||
<view class="templ_img_item_msg_title">{{ item.title }}111</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -41,7 +41,7 @@ import { getStorageFun, TOKEN_NAME } from '@/utils/auth.js';
|
||||
|
||||
export default {
|
||||
name: "common_card",
|
||||
props:['Fimg','Bimg'],
|
||||
props: ['Fimg', 'Bimg'],
|
||||
data() {
|
||||
return {
|
||||
uploadTemplList: [
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
id: 2,
|
||||
title: "边框缺失",
|
||||
isOk: false,
|
||||
url: "https://static.tbmall.xin/static/ID_error_1.png",
|
||||
url: "https://static.tbmall.xin/static/ID_gq.png",
|
||||
}, {
|
||||
id: 3,
|
||||
title: "照片模糊",
|
||||
@@ -71,15 +71,15 @@ export default {
|
||||
fileListF: {},// 身份反面照片
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
Fimg(p,r){
|
||||
if(p){
|
||||
this.fileListZ = {accessUrl:p};
|
||||
watch: {
|
||||
Fimg(p, r) {
|
||||
if (p) {
|
||||
this.fileListZ = { accessUrl: p };
|
||||
}
|
||||
},
|
||||
Bimg(p,r){
|
||||
if(p){
|
||||
this.fileListF = {accessUrl:p};
|
||||
Bimg(p, r) {
|
||||
if (p) {
|
||||
this.fileListF = { accessUrl: p };
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -176,4 +176,15 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
<style scoped lang="scss">
|
||||
.data_common_warp {
|
||||
background: #FFFFFF;
|
||||
border-radius: 30rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 92rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -16,7 +16,7 @@
|
||||
<!-- 无优惠券 -->
|
||||
<view class="flex-r-lr price-line" v-else>
|
||||
<text class="text-28 text-zi text-bold">¥{{ obj.price }}</text>
|
||||
<text class="text-24 sold">已售{{ obj.sales }}件</text>
|
||||
<text class="text-24 sold">全网销量{{ limit999(obj.sales) }}件</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -32,6 +32,13 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
limit999(n) {
|
||||
const num = Number(n);
|
||||
if (isNaN(num) || num < 10000) {
|
||||
return n != null && n !== '' ? String(n) : '0';
|
||||
}
|
||||
return `${Math.floor(num / 10000)}万+`;
|
||||
},
|
||||
onClick() {
|
||||
this.$emit('ok', this.obj.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user