Compare commits
5 Commits
71332e070a
...
c58d7cd2ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c58d7cd2ba | ||
|
|
a6b35c3a2e | ||
|
|
31dc706eed | ||
|
|
295872ccf1 | ||
|
|
e4a21804b0 |
@ -124,9 +124,9 @@ export default {
|
|||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 过滤出距离1km以内的数据
|
// 过滤出距离1km以内的数据,确保距离为0的值也能被正确保留
|
||||||
processedList = processedList.filter(item =>
|
processedList = processedList.filter(item =>
|
||||||
item.distanceValue && item.distanceValue <= 1
|
item.distanceValue !== undefined && item.distanceValue !== null && item.distanceValue <= 1
|
||||||
);
|
);
|
||||||
|
|
||||||
// 调用腾讯地图API获取附近1km的小区(包含图片信息)
|
// 调用腾讯地图API获取附近1km的小区(包含图片信息)
|
||||||
@ -179,10 +179,10 @@ export default {
|
|||||||
mergedList = uniqueByField(mergedList, 'community_id');
|
mergedList = uniqueByField(mergedList, 'community_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据距离排序
|
// 根据距离排序,确保距离为0的值也能正确排序
|
||||||
mergedList.sort((a, b) => {
|
mergedList.sort((a, b) => {
|
||||||
const distanceA = a.distanceValue || Infinity;
|
const distanceA = a.distanceValue !== undefined && a.distanceValue !== null ? a.distanceValue : Infinity;
|
||||||
const distanceB = b.distanceValue || Infinity;
|
const distanceB = b.distanceValue !== undefined && b.distanceValue !== null ? b.distanceValue : Infinity;
|
||||||
|
|
||||||
return distanceA - distanceB;
|
return distanceA - distanceB;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -315,11 +315,11 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.CateList_Box {
|
.CateList_Box {
|
||||||
width: 71.5%;
|
width: 95%;
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
/* position: relative; */
|
position: relative;
|
||||||
position: fixed;
|
/* position: fixed; */
|
||||||
z-index: 15;
|
z-index: 15;
|
||||||
padding: 20rpx 10rpx;
|
padding: 20rpx 10rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
@ -368,7 +368,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.CateIte {
|
.CateIte {
|
||||||
margin-top: 80rpx;
|
/* margin-top: 80rpx; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.CateInfo {
|
.CateInfo {
|
||||||
|
|||||||
@ -63,7 +63,8 @@
|
|||||||
{{ item.category_name }}
|
{{ item.category_name }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="Con_right" v-if="tagList1.length > 0">
|
<view class="Con_right" v-if="tagList1.length > 0" ref="conRightRef"
|
||||||
|
:style="{ overflow: cateListShow ? 'hidden' : 'auto' }">
|
||||||
<view class="CateList_Box" :class="cateListShow ? 'bgf' : ''">
|
<view class="CateList_Box" :class="cateListShow ? 'bgf' : ''">
|
||||||
<view class="CateList" ref="cateListRef">
|
<view class="CateList" ref="cateListRef">
|
||||||
<view class="CateList_Item" v-for="(item, index) in tagList" :key="item.id"
|
<view class="CateList_Item" v-for="(item, index) in tagList" :key="item.id"
|
||||||
@ -135,14 +136,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="gg" @click="chooseGG(item,items)" v-if="
|
<view class="gg" @click="chooseGG(item, items)" v-if="
|
||||||
items.commodity_goods_info_list.length > 1 && !items.isShow
|
items.commodity_goods_info_list.length > 1 && !items.isShow
|
||||||
">
|
">
|
||||||
选择规格
|
选择规格
|
||||||
<u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon>
|
<u-icon name="arrow-down" size="26rpx" color="#FF370B"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="gg" @click="chooseGG(item,items)" v-if="
|
<view class="gg" @click="chooseGG(item, items)" v-if="
|
||||||
items.commodity_goods_info_list.length > 1 && items.isShow
|
items.commodity_goods_info_list.length > 1 && items.isShow
|
||||||
">
|
">
|
||||||
收起
|
收起
|
||||||
@ -152,7 +153,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="GGList" v-if="items.isShow">
|
<view class="GGList" v-if="items.isShow">
|
||||||
<view class="GGItem" v-for="ite in items.commodity_goods_info_list" :key="ite.id" @click="goods(ite,items)">
|
<view class="GGItem" v-for="ite in items.commodity_goods_info_list" :key="ite.id"
|
||||||
|
@click="goods(ite, items)">
|
||||||
<view class="GGItem_Image">
|
<view class="GGItem_Image">
|
||||||
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
|
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
|
||||||
<image :src="picUrl + ite.commodity_pic" mode="aspectFill"></image>
|
<image :src="picUrl + ite.commodity_pic" mode="aspectFill"></image>
|
||||||
@ -227,6 +229,7 @@ export default {
|
|||||||
search: "",
|
search: "",
|
||||||
value: "1",
|
value: "1",
|
||||||
cateListShow: false,
|
cateListShow: false,
|
||||||
|
scrollTop: 0,
|
||||||
conRightElement: null,
|
conRightElement: null,
|
||||||
iconList: [
|
iconList: [
|
||||||
{
|
{
|
||||||
@ -325,6 +328,20 @@ export default {
|
|||||||
//顶部分类点击
|
//顶部分类点击
|
||||||
changeCateListShow() {
|
changeCateListShow() {
|
||||||
this.cateListShow = !this.cateListShow;
|
this.cateListShow = !this.cateListShow;
|
||||||
|
// 当cateListShow展开时,禁止Con_right滚动
|
||||||
|
if (this.conRightRef) {
|
||||||
|
if (this.cateListShow) {
|
||||||
|
// 保存当前滚动位置
|
||||||
|
this.scrollTop = this.conRightRef.scrollTop;
|
||||||
|
} else {
|
||||||
|
// 恢复滚动位置
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.conRightRef) {
|
||||||
|
this.conRightRef.scrollTop = this.scrollTop || 0;
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//选择右下角分类
|
//选择右下角分类
|
||||||
checkItem(index) {
|
checkItem(index) {
|
||||||
@ -338,7 +355,7 @@ export default {
|
|||||||
this.topShow = !this.topShow;
|
this.topShow = !this.topShow;
|
||||||
},
|
},
|
||||||
// 选择商品规格
|
// 选择商品规格
|
||||||
chooseGG(item,targetItems) {
|
chooseGG(item, targetItems) {
|
||||||
// 根据两个参数的id判断点击的数据
|
// 根据两个参数的id判断点击的数据
|
||||||
if (item && targetItems && item.id) {
|
if (item && targetItems && item.id) {
|
||||||
for (let i = 1; i < this.tagList.length; i++) {
|
for (let i = 1; i < this.tagList.length; i++) {
|
||||||
@ -362,7 +379,7 @@ export default {
|
|||||||
NavgateTo("../search/index");
|
NavgateTo("../search/index");
|
||||||
},
|
},
|
||||||
//商品详情页
|
//商品详情页
|
||||||
goods(ite,items) {
|
goods(ite, items) {
|
||||||
NavgateTo(`../goods/index?item=${JSON.stringify(ite)}`);
|
NavgateTo(`../goods/index?item=${JSON.stringify(ite)}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onLoad() {
|
async onLoad() {
|
||||||
uni.removeStorageSync('changeWorkOrderData');
|
|
||||||
const workOrderPermission = uni.getStorageSync('work_order_permission');
|
const workOrderPermission = uni.getStorageSync('work_order_permission');
|
||||||
const orderDispatchPermission = uni.getStorageSync('order_dispatch_permission');
|
const orderDispatchPermission = uni.getStorageSync('order_dispatch_permission');
|
||||||
this.showWorkOrderSection = !(workOrderPermission === false && orderDispatchPermission === false);
|
this.showWorkOrderSection = !(workOrderPermission === false && orderDispatchPermission === false);
|
||||||
@ -90,8 +89,21 @@ export default {
|
|||||||
});
|
});
|
||||||
this.communityList = res.rows;
|
this.communityList = res.rows;
|
||||||
|
|
||||||
// 如果没有选中的小区且有小区列表,则默认选中第一个
|
const changeCommData = uni.getStorageSync('changeWorkOrderData');
|
||||||
if (!uni.getStorageSync('changeWorkOrderData') && res.rows.length > 0) {
|
// 检查本地存储的小区是否存在于返回的列表中
|
||||||
|
if (changeCommData) {
|
||||||
|
const exists = res.rows.some(item => item.community_id === changeCommData.id);
|
||||||
|
// 如果不存在,则清除数据并设置为第一个
|
||||||
|
if (!exists && res.rows.length > 0) {
|
||||||
|
uni.setStorageSync('changeWorkOrderData', { id: res.rows[0].community_id, name: res.rows[0].name });
|
||||||
|
this.communityVal = res.rows[0].name;
|
||||||
|
} else if (!exists) {
|
||||||
|
// 如果列表为空,则清除数据
|
||||||
|
uni.removeStorageSync('changeWorkOrderData');
|
||||||
|
this.communityVal = "切换小区";
|
||||||
|
}
|
||||||
|
} else if (res.rows.length > 0) {
|
||||||
|
// 如果没有选中的小区且有小区列表,则默认选中第一个
|
||||||
uni.setStorageSync('changeWorkOrderData', { id: res.rows[0].community_id, name: res.rows[0].name });
|
uni.setStorageSync('changeWorkOrderData', { id: res.rows[0].community_id, name: res.rows[0].name });
|
||||||
this.communityVal = res.rows[0].name;
|
this.communityVal = res.rows[0].name;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<view>巡检人:{{ item.inspection_plan_info.community_worker_info.name }}</view>
|
<view>巡检人:{{ item.inspection_plan_info.community_worker_info.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-content-right">
|
<view class="item-content-right">
|
||||||
<button class="Btn" @click="goInspection(item)">去巡检</button>
|
<button class="Btn" @click="goInspection(item)" :disabled="item.inspection_plan_info.community_worker_info.inspection_permission != 1">去巡检</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user