优化及修复
This commit is contained in:
parent
9c031bf97d
commit
6e714fb2bc
|
|
@ -47,13 +47,17 @@
|
|||
<text v-if="skillArrIndex !== item.goodsCategories.length - 1">,</text>
|
||||
</text>
|
||||
</view>
|
||||
<view>
|
||||
<view :class="isShowAllAreaCurCity[index] ? '' : 'certern-height'">
|
||||
<text class="margin-right-xs">服务范围:</text>
|
||||
<text v-for="(area, areaArrIndex) in item.workerAreas">
|
||||
<text>{{getLastSplitAreaName(area.mergerName)}}</text>
|
||||
<text v-if="areaArrIndex !== item.workerAreas.length - 1">,</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="text-main-color bg-white padding-top-sm" @click="showAllArea('CurCity', index)">
|
||||
<text>查看全部服务区域</text>
|
||||
<text :class="'cuIcon-' + (isShowAllAreaCurCity[index] ? 'fold' : 'unfold')"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -127,13 +131,17 @@
|
|||
<text v-if="skillArrIndex !== item.goodsCategories.length - 1">,</text>
|
||||
</text>
|
||||
</view>
|
||||
<view>
|
||||
<view :class="isShowAllAreaOtherCity[index] ? '' : 'certern-height'">
|
||||
<text class="margin-right-xs">服务范围:</text>
|
||||
<text v-for="(area, areaArrIndex) in item.workerAreas">
|
||||
<text>{{getLastSplitAreaName(area.mergerName)}}</text>
|
||||
<text v-if="areaArrIndex !== item.workerAreas.length - 1">,</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="text-main-color bg-white padding-top-sm" @click="showAllArea('OtherCity', index)">
|
||||
<text>查看全部服务区域</text>
|
||||
<text :class="'cuIcon-' + (isShowAllAreaOtherCity[index] ? 'fold' : 'unfold')"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -207,10 +215,13 @@
|
|||
pageSize: 0,
|
||||
stickyTop: this.CustomBar,
|
||||
searchInfo: {},
|
||||
curPositionDistrictId: -1,
|
||||
areaList: [],
|
||||
areaMultiIndex: [0, 0],
|
||||
categoryList: [],
|
||||
categoryMultiIndex: [0, 0, 0]
|
||||
categoryMultiIndex: [0, 0, 0],
|
||||
isShowAllAreaCurCity: [],
|
||||
isShowAllAreaOtherCity: []
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
|
|
@ -230,6 +241,7 @@
|
|||
let areaArr = await this.$request.getCurArea();
|
||||
if (areaArr) {
|
||||
this.searchInfo.area = [areaArr[1], areaArr[2]];
|
||||
this.curPositionDistrictId = this.searchInfo.area[1].areaId;
|
||||
}
|
||||
},
|
||||
async reloadData(params = {}) {
|
||||
|
|
@ -253,6 +265,21 @@
|
|||
let res = await this.$request.getWorkerList(params);
|
||||
let rowsLength = res.rows.length;
|
||||
if (rowsLength > 0) {
|
||||
for (let i = 0; i < res.rows.length; i++) {
|
||||
let curDistrictWorkerAreas = [];
|
||||
let notCurDistrictWorkerAreas = [];
|
||||
let sortedWorkerAreas = [];
|
||||
for (let j = 0; j < res.rows[i].workerAreas.length; j++) {
|
||||
let curWorkerArea = res.rows[i].workerAreas[j];
|
||||
if (this.areaMultiIndex[1] === 0 && curWorkerArea.districtId === this.curPositionDistrictId) {
|
||||
curDistrictWorkerAreas.push(curWorkerArea);
|
||||
} else {
|
||||
notCurDistrictWorkerAreas.push(curWorkerArea);
|
||||
}
|
||||
}
|
||||
sortedWorkerAreas = curDistrictWorkerAreas.concat(notCurDistrictWorkerAreas);
|
||||
res.rows[i].workerAreas = sortedWorkerAreas;
|
||||
}
|
||||
this.workerInfos = this.workerInfos.concat(res.rows);
|
||||
this.pageNum++;
|
||||
if (rowsLength === this.pageSize) {
|
||||
|
|
@ -479,7 +506,15 @@
|
|||
getLastSplitAreaName(mergeName) {
|
||||
let arr = mergeName.split(",");
|
||||
return arr[arr.length - 1];
|
||||
},
|
||||
showAllArea(type, index) {
|
||||
let arr = this["isShowAllArea" + type];
|
||||
if (arr[index] == undefined) {
|
||||
arr[index] = false;
|
||||
}
|
||||
arr[index] = !arr[index];
|
||||
this["isShowAllArea" + type] = [].concat(arr);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -513,4 +548,9 @@
|
|||
.text-beside-avatar {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.certern-height {
|
||||
max-height: 200rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</view>
|
||||
</uni-transition>
|
||||
<!-- 轮播图,视频 -->
|
||||
<swiper :class="changeSwiperHeight ? 'sm-screen-swiper' : 'sm-screen-swiper lg-screen-swiper'" @change="changeSwiper">
|
||||
<swiper :autoplay="true" interval="5000" duration="500" :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="true"></video>
|
||||
|
|
@ -353,8 +353,10 @@
|
|||
},
|
||||
pauseVideo(e) {
|
||||
if (this.productVideoPlaying) {
|
||||
this.productVideoContext.exitFullScreen();
|
||||
this.productVideoContext.pause();
|
||||
} else {
|
||||
this.productVideoContext.requestFullScreen();
|
||||
this.productVideoContext.play();
|
||||
}
|
||||
this.productVideoPlaying = !this.productVideoPlaying;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<text class="cuIcon-form margin-right-xs text-main-color"></text>
|
||||
<text class="margin-right-xs">企业认证</text>
|
||||
</view>
|
||||
<view>
|
||||
<view :class="isShowAllAreaCurCity ? '' : 'certern-height'">
|
||||
<text class="cuIcon-location margin-right-xs text-main-color"></text>
|
||||
<text class="margin-right-xs">服务范围:</text>
|
||||
<text v-for="(area, areaArrIndex) in shopInfo.workerAreas">
|
||||
|
|
@ -26,6 +26,10 @@
|
|||
<text v-if="areaArrIndex !== shopInfo.workerAreas.length - 1">,</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="text-main-color bg-white padding-top-sm" @click="showAllArea(index)">
|
||||
<text>查看全部服务区域</text>
|
||||
<text :class="'cuIcon-' + (isShowAllAreaCurCity ? 'fold' : 'unfold')"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -129,7 +133,8 @@
|
|||
areaList: [],
|
||||
areaMultiIndex: [0, 0],
|
||||
categoryList: [],
|
||||
stickyTop: this.CustomBar
|
||||
stickyTop: this.CustomBar,
|
||||
isShowAllAreaCurCity: false
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
|
@ -278,6 +283,9 @@
|
|||
getLastSplitAreaName(mergeName) {
|
||||
let arr = mergeName.split(",");
|
||||
return arr[arr.length - 1];
|
||||
},
|
||||
showAllArea(index) {
|
||||
this.isShowAllAreaCurCity = !this.isShowAllAreaCurCity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -287,4 +295,8 @@
|
|||
.text-beside-avatar {
|
||||
width: 75%;
|
||||
}
|
||||
.certern-height {
|
||||
max-height: 235rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue