轮播图及视频调整;产品列表查询字段补充;选择品类第一级去掉全部选项

This commit is contained in:
donqi 2022-08-29 19:16:34 +08:00
parent 9e8e906ece
commit 0a2a568a12
6 changed files with 72 additions and 45 deletions

View File

@ -85,21 +85,26 @@ export default {
}
},
async getCurArea() {
let curLocation = uni.getStorageSync('curLocation');
if (curLocation && curLocation.updateTimes) {
let curTimes = new Date().getTime();
let deltaSeconds = curTimes - Number(curLocation.updateTimes);
if (deltaSeconds >= 15 * 60 * 1000) {
// 设定重新获取定位的时间间隔为15分钟
try{
let curLocation = uni.getStorageSync('curLocation');
console.log(curLocation)
if (curLocation && curLocation.updateTimes) {
let curTimes = new Date().getTime();
let deltaSeconds = curTimes - Number(curLocation.updateTimes);
if (deltaSeconds >= 15 * 60 * 1000) {
// 设定重新获取定位的时间间隔为15分钟
await this.wxGetLocation();
curLocation = uni.getStorageSync('curLocation');
}
} else {
await this.wxGetLocation();
curLocation = uni.getStorageSync('curLocation');
}
} else {
await this.wxGetLocation();
curLocation = uni.getStorageSync('curLocation');
}
if (curLocation && curLocation.area) {
return curLocation.area;
if (curLocation && curLocation.area) {
return curLocation.area;
}
}catch(e){
console.error(e)
}
return null;
},

View File

@ -16,19 +16,29 @@
<text class="text-price text-red text-bold text-xl">{{product.goodsPrice}}</text>
</view>
<view v-else-if="product.goodsStandardList && product.goodsStandardList.length > 0">
<view v-if="product.goodsStandardList[0].discountPrice" class="flex justify-start align-center">
<view v-if="product.goodsStandardList[0].discountPrice">
<text class="text-price text-red text-bold text-xl">{{product.goodsStandardList[0].discountPrice}}</text>
<text class="text-del" v-if="product.goodsPrice">¥{{product.goodsStandardList[0].goodsPrice}}</text>
<text class="margin-left-xs">/</text>
<text>{{product.goodsUnit}}</text>
</view>
<view v-else-if="product.goodsStandardList[0].goodsPrice" class="flex justify-start align-center">
<view v-else-if="product.goodsStandardList[0].goodsPrice">
<text class="text-price text-red text-bold text-xl">{{product.goodsStandardList[0].goodsPrice}}</text>
<text class="margin-left-xs">/</text>
<text>{{product.goodsUnit}}</text>
</view>
</view>
<view v-else-if="product.payMoney" class="flex justify-start align-center">
<text class="text-price text-red text-bold text-xl">{{product.payMoney}}</text>
</view>
<view class="padding-xs" v-if="product.type">
<view class='cu-tag light bg-blue'>{{product.type}}</view>
<view class="padding-xs">
<view class='cu-tag light bg-blue'>
<text v-if="product.parGoodsCategoryName">
{{product.parGoodsCategoryName}}
<text class="margin-lr-xs">/</text>
</text>
<text>{{product.deptGoodsCategoryName}}</text>
</view>
</view>
</view>
<view v-if="ifShowServArea">

View File

@ -138,7 +138,7 @@
async loadData() {
this.initBasicData();
//
this.loadRegionList();
await this.loadRegionList();
await this.getCurAreaArr();
//
let hotCategoryRes = await this.$request.getHotCategory({
@ -169,7 +169,7 @@
this.searchInfo.area = areaArr;
} else {
//
this.searchInfo.area = [regionList[0], subRegionList[0], subSubRegionList[0]];
this.searchInfo.area = [this.areaList[0][0], this.areaList[1][0], this.areaList[2][0]];
}
},
async loadCategoryList() {

View File

@ -184,19 +184,25 @@
type: 1
});
typeList = typeList.data;
// let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
// let subTypeList = await this.$request.listByStepWithAllNode({
// goodsCategoryId: col1Id
// });
// subTypeList = subTypeList.data;
// let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
// let subSubTypeList = await this.$request.listByStepWithAllNode({
// goodsCategoryId: col2Id
// });
// subSubTypeList = subSubTypeList.data;
let subTypeList = [];
let subSubTypeList = [];
if (typeList && typeList.length) {
let col1Id = typeList[0].goodsCategoryId;
subTypeList = await this.$request.listByStepWithAllNode({
goodsCategoryId: col1Id
});
subTypeList = subTypeList.data;
}
// if (subTypeList && subTypeList.length) {
// let col2Id = subTypeList[0].goodsCategoryId;
// subSubTypeList = await this.$request.listByStepWithAllNode({
// goodsCategoryId: col2Id
// });
// subSubTypeList = subSubTypeList.data;
// }
this.categoryList.push(typeList);
this.categoryList.push([]);
this.categoryList.push([]);
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
},
async loadRegionList() {
let regionList = await this.$request.areaListByStep();

View File

@ -235,19 +235,25 @@
type: 1
});
typeList = typeList.data;
// let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
// let subTypeList = await this.$request.listByStepWithAllNode({
// goodsCategoryId: col1Id
// });
// subTypeList = subTypeList.data;
// let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
// let subSubTypeList = await this.$request.listByStepWithAllNode({
// goodsCategoryId: col2Id
// });
// subSubTypeList = subSubTypeList.data;
let subTypeList = [];
let subSubTypeList = [];
if (typeList && typeList.length) {
let col1Id = typeList[0].goodsCategoryId;
subTypeList = await this.$request.listByStepWithAllNode({
goodsCategoryId: col1Id
});
subTypeList = subTypeList.data;
}
// if (subTypeList && subTypeList.length) {
// let col2Id = subTypeList[0].goodsCategoryId;
// subSubTypeList = await this.$request.listByStepWithAllNode({
// goodsCategoryId: col2Id
// });
// subSubTypeList = subSubTypeList.data;
// }
this.categoryList.push(typeList);
this.categoryList.push([]);
this.categoryList.push([]);
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
},
async loadRegionList() {
let regionList = await this.$request.areaListByStep();

View File

@ -19,7 +19,7 @@
<swiper :class="changeSwiperHeight ? 'sm-screen-swiper' : 'sm-screen-swiper lg-screen-swiper'" @change="changeSwiper">
<swiper-item v-if="productDetail.goodsVideoUrl">
<video style="width: 100%; height: 100%;" id="productVideo" :src="productDetail.goodsVideoUrl" :controls="true" :autoplay="false"
:show-center-play-btn="true" :show-fullscreen-btn="false" @click="clickSwiper($event, item, 0)"></video>
:show-center-play-btn="true" :show-fullscreen-btn="true"></video>
</swiper-item>
<swiper-item v-for="(item,index) in swiperList" :key="item.goodsImgsId" @click="clickSwiper($event, item, 1)">
<image style="width: 100%; height: 100%;" :src="item.imgUrl" mode="aspectFit"></image>
@ -405,7 +405,7 @@
}
.lg-screen-swiper {
height: 130vw;
height: 115vw;
transition: all 0.5s ease-in-out;
}
</style>