update
This commit is contained in:
parent
b39018e90a
commit
5af8d7e996
@ -194,8 +194,8 @@ export default {
|
||||
box-sizing: border-box;
|
||||
border-radius: 12rpx;
|
||||
// background: linear-gradient(to left, #1f1f1f, #62605f);
|
||||
color: #1f1f1f;
|
||||
border: 1px solid #62605f;
|
||||
color: #07C160;
|
||||
border: 1px solid #07C160;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@ -203,8 +203,8 @@ export default {
|
||||
height: 88rpx;
|
||||
width: calc(50% - 16rpx);
|
||||
line-height: 88rpx;
|
||||
background: linear-gradient(to right, #1f1f1f, #62605f);
|
||||
color: #f0dccf;
|
||||
background: linear-gradient(270deg, #27B25F 0%, #4CCC7F 100%);
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
margin-left: 5%;
|
||||
|
||||
@ -53,6 +53,20 @@
|
||||
:value="saveMsg.doorplate"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 地址识别功能 -->
|
||||
<div class="address-recognition borbottom" v-if="addressRecognition.show">
|
||||
<span class="content-title">地址识别</span>
|
||||
<div class="content-input recognition-input">
|
||||
<textarea auto-height placeholder="请粘贴完整地址,如:北京市朝阳区三里屯街道工体北路8号" @input="onAddressRecognitionInput"
|
||||
:value="addressRecognition.inputText" class="recognition-textarea"></textarea>
|
||||
<div class="recognition-buttons" v-if="addressRecognition.showButtons">
|
||||
<view class="btn-cancel" @click="cancelAddressRecognition">取消</view>
|
||||
<view class="btn-recognize" @click="recognizeAddress">识别</view>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="adress-content borbottom">
|
||||
<span class="content-title">标签</span>
|
||||
<div class="content-input tip-content">
|
||||
@ -176,7 +190,13 @@ export default {
|
||||
county_list: [],
|
||||
addressSelectIndex: [0, 0, 0],
|
||||
streetList: [],
|
||||
streetIndex: 0,
|
||||
streetIndex: -1,
|
||||
// 地址识别相关数据
|
||||
addressRecognition: {
|
||||
show: true, // 是否显示地址识别区域
|
||||
inputText: '', // 输入的地址文本
|
||||
showButtons: false, // 是否显示取消和识别按钮
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -343,16 +363,17 @@ export default {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.streetList && this.streetList.length > 0) {
|
||||
if (this.streetIndex >= 0) {
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请选择街道地址!",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 街道选择是可选的,如果有街道列表但未选择,允许保存
|
||||
// if (this.streetList && this.streetList.length > 0) {
|
||||
// if (this.streetIndex >= 0) {
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// title: "请选择街道地址!",
|
||||
// icon: "none",
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
if (flag === 0) {
|
||||
this.saveFn();
|
||||
}
|
||||
@ -375,7 +396,7 @@ export default {
|
||||
this.areaData[provinceIndex].region_id,
|
||||
this.city_list[cityIndex].region_id,
|
||||
this.county_list[countryIndex].region_id,
|
||||
this.streetList && this.streetList.length > 0
|
||||
this.streetList && this.streetList.length > 0 && this.streetIndex >= 0
|
||||
? this.streetList[this.streetIndex].region_id
|
||||
: "",
|
||||
];
|
||||
@ -652,6 +673,244 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 地址识别相关方法
|
||||
onAddressRecognitionInput(event) {
|
||||
this.addressRecognition.inputText = event.mp.detail.value;
|
||||
// 当有输入内容时显示按钮
|
||||
this.addressRecognition.showButtons = this.addressRecognition.inputText.trim().length > 0;
|
||||
},
|
||||
|
||||
cancelAddressRecognition() {
|
||||
this.addressRecognition.inputText = '';
|
||||
this.addressRecognition.showButtons = false;
|
||||
},
|
||||
|
||||
async recognizeAddress() {
|
||||
if (!this.addressRecognition.inputText.trim()) {
|
||||
uni.showToast({
|
||||
title: '请输入地址信息',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await this.parseAddress(this.addressRecognition.inputText);
|
||||
|
||||
if (result.success) {
|
||||
// 设置省市区
|
||||
if (result.province && result.city && result.district) {
|
||||
await this.setAddressFromRecognition(result);
|
||||
}
|
||||
|
||||
// 设置详细地址
|
||||
if (result.detail) {
|
||||
this.saveMsg.doorplate = result.detail;
|
||||
}
|
||||
|
||||
// 清空识别输入框
|
||||
this.cancelAddressRecognition();
|
||||
|
||||
uni.showToast({
|
||||
title: '地址识别成功',
|
||||
icon: 'success'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: result.message || '地址识别失败,请检查地址格式',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('地址识别错误:', error);
|
||||
uni.showToast({
|
||||
title: '识别失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
|
||||
parseAddress(addressText) {
|
||||
return new Promise((resolve) => {
|
||||
try {
|
||||
// 地址解析正则表达式(使用非贪婪匹配)
|
||||
const provinceRegex = /(北京市|上海市|天津市|重庆市|[\u4e00-\u9fa5]{2,}?省|[\u4e00-\u9fa5]{2,}?自治区)/;
|
||||
const cityRegex = /([\u4e00-\u9fa5]{2,}?市|[\u4e00-\u9fa5]{2,}?地区|[\u4e00-\u9fa5]{2,}?州|[\u4e00-\u9fa5]{2,}?盟)/;
|
||||
const districtRegex = /([\u4e00-\u9fa5]{2,}?区|[\u4e00-\u9fa5]{2,}?县|[\u4e00-\u9fa5]{2,}?市)/;
|
||||
const streetRegex = /([\u4e00-\u9fa5]{2,}?街道|[\u4e00-\u9fa5]{2,}?镇|[\u4e00-\u9fa5]{2,}?乡)/;
|
||||
|
||||
let currentText = addressText.trim();
|
||||
let province = '', city = '', district = '', street = '', detail = '';
|
||||
|
||||
console.log('解析地址:', addressText);
|
||||
console.log('初始文本:', currentText);
|
||||
|
||||
// 提取省份
|
||||
const provinceMatch = currentText.match(provinceRegex);
|
||||
if (provinceMatch) {
|
||||
province = provinceMatch[1];
|
||||
currentText = currentText.replace(province, '').trim();
|
||||
console.log('省份:', province, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 提取城市
|
||||
const cityMatch = currentText.match(cityRegex);
|
||||
if (cityMatch) {
|
||||
city = cityMatch[1];
|
||||
currentText = currentText.replace(city, '').trim();
|
||||
console.log('城市:', city, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 提取区县
|
||||
const districtMatch = currentText.match(districtRegex);
|
||||
if (districtMatch) {
|
||||
district = districtMatch[1];
|
||||
currentText = currentText.replace(district, '').trim();
|
||||
console.log('区县:', district, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 提取街道
|
||||
const streetMatch = currentText.match(streetRegex);
|
||||
if (streetMatch) {
|
||||
street = streetMatch[1];
|
||||
currentText = currentText.replace(street, '').trim();
|
||||
console.log('街道:', street, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 剩余的作为详细地址
|
||||
detail = currentText;
|
||||
console.log('详细地址:', detail);
|
||||
|
||||
console.log('解析结果:', { province, city, district, street, detail });
|
||||
|
||||
if (province && city && district) {
|
||||
resolve({
|
||||
success: true,
|
||||
province: province,
|
||||
city: city,
|
||||
district: district,
|
||||
street: street,
|
||||
detail: detail
|
||||
});
|
||||
} else {
|
||||
resolve({
|
||||
success: false,
|
||||
message: `无法识别完整的省市区信息,请检查地址格式。当前识别到:省份=${province}, 城市=${city}, 区县=${district}`
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('地址解析错误:', error);
|
||||
resolve({
|
||||
success: false,
|
||||
message: '地址解析错误'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
async setAddressFromRecognition(result) {
|
||||
try {
|
||||
// 先获取所有省份数据
|
||||
if (!this.areaData || this.areaData.length === 0) {
|
||||
await this.handleGetProviceCode();
|
||||
}
|
||||
|
||||
let provinceIndex = -1, cityIndex = -1, districtIndex = -1;
|
||||
|
||||
// 查找省份
|
||||
this.areaData.forEach((item, index) => {
|
||||
if (item.region_name === result.province ||
|
||||
item.region_name.includes(result.province.replace('省', '').replace('市', '').replace('自治区', ''))) {
|
||||
provinceIndex = index;
|
||||
}
|
||||
});
|
||||
|
||||
if (provinceIndex === -1) {
|
||||
throw new Error('未找到匹配的省份');
|
||||
}
|
||||
|
||||
// 获取城市数据
|
||||
const cityReq = {
|
||||
parentId: this.areaData[provinceIndex].region_id,
|
||||
page: 1,
|
||||
pageSize: 999,
|
||||
};
|
||||
const cityData = await this.$api.$postNode("/pino/region/list", cityReq);
|
||||
this.city_list = cityData.data.data;
|
||||
|
||||
// 查找城市
|
||||
this.city_list.forEach((item, index) => {
|
||||
if (item.region_name === result.city ||
|
||||
item.region_name.includes(result.city.replace('市', '').replace('州', '').replace('地区', '').replace('盟', ''))) {
|
||||
cityIndex = index;
|
||||
}
|
||||
});
|
||||
|
||||
if (cityIndex === -1) {
|
||||
throw new Error('未找到匹配的城市');
|
||||
}
|
||||
|
||||
// 获取区县数据
|
||||
const districtReq = {
|
||||
parentId: this.city_list[cityIndex].region_id,
|
||||
page: 1,
|
||||
pageSize: 999,
|
||||
};
|
||||
const districtData = await this.$api.$postNode("/pino/region/list", districtReq);
|
||||
this.county_list = districtData.data.data;
|
||||
|
||||
// 查找区县
|
||||
this.county_list.forEach((item, index) => {
|
||||
if (item.region_name === result.district ||
|
||||
item.region_name.includes(result.district.replace('区', '').replace('县', '').replace('市', ''))) {
|
||||
districtIndex = index;
|
||||
}
|
||||
});
|
||||
|
||||
if (districtIndex === -1) {
|
||||
throw new Error('未找到匹配的区县');
|
||||
}
|
||||
|
||||
// 设置选中的地址
|
||||
this.addressSelectIndex = [provinceIndex, cityIndex, districtIndex];
|
||||
this.saveMsg.address =
|
||||
this.areaData[provinceIndex].region_name +
|
||||
this.city_list[cityIndex].region_name +
|
||||
this.county_list[districtIndex].region_name;
|
||||
|
||||
// 获取街道数据
|
||||
await this.handleGetStreetData();
|
||||
|
||||
// 如果解析出了街道信息,尝试匹配街道选择器
|
||||
if (result.street && this.streetList && this.streetList.length > 0) {
|
||||
let streetIndex = -1;
|
||||
this.streetList.forEach((item, index) => {
|
||||
if (item.region_name === result.street ||
|
||||
item.region_name.includes(result.street.replace('街道', '').replace('镇', '').replace('乡', ''))) {
|
||||
streetIndex = index;
|
||||
}
|
||||
});
|
||||
|
||||
// 只有匹配到才设置,匹配不到就保持默认不选择
|
||||
if (streetIndex !== -1) {
|
||||
this.streetIndex = streetIndex;
|
||||
} else {
|
||||
// 街道不匹配时,保持默认状态(不选择任何街道)
|
||||
this.streetIndex = -1;
|
||||
}
|
||||
} else {
|
||||
// 没有解析到街道信息时,也保持不选择状态
|
||||
this.streetIndex = -1;
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('地址设置错误:', error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
},
|
||||
onUnload() {
|
||||
this.saveMsg = {
|
||||
@ -666,6 +925,12 @@ export default {
|
||||
this.tipCodes.map((n) => {
|
||||
n.isChecked = false;
|
||||
});
|
||||
// 重置地址识别状态
|
||||
this.addressRecognition = {
|
||||
show: true,
|
||||
inputText: '',
|
||||
showButtons: false,
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.pageMsg.id = option.id || "";
|
||||
@ -909,4 +1174,69 @@ textarea {
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
// 地址识别相关样式
|
||||
.address-recognition {
|
||||
padding: 32rpx 0;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.recognition-input {
|
||||
position: relative;
|
||||
|
||||
.recognition-textarea {
|
||||
width: 100%;
|
||||
min-height: 80rpx;
|
||||
max-height: 200rpx;
|
||||
line-height: 30rpx;
|
||||
padding: 12rpx;
|
||||
border: 2rpx solid #dcdcdc;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
|
||||
&:focus {
|
||||
border-color: #07c160;
|
||||
}
|
||||
}
|
||||
|
||||
.recognition-buttons {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 16rpx;
|
||||
margin-top: 16rpx;
|
||||
|
||||
.btn-cancel, .btn-recognize {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
min-width: 80rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
background-color: #f5f5f5;
|
||||
color: #666;
|
||||
border: 1rpx solid #dcdcdc;
|
||||
|
||||
&:active {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-recognize {
|
||||
background-color: #07c160;
|
||||
color: #fff;
|
||||
border: 1rpx solid #07c160;
|
||||
|
||||
&:active {
|
||||
background-color: #05a04f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -46,9 +46,10 @@
|
||||
orderInfo.SALEBILL_STATE !== 9999 &&
|
||||
orderInfo.COMMENT_STATE === 0
|
||||
">
|
||||
<!-- orderInfo.SALEBILL_STATE !== 1005 &&
|
||||
<!-- orderInfo.SALEBILL_STATE !== 1005
|
||||
orderInfo.SALEBILL_STATE !== 1010 && -->
|
||||
<div class="continu-btn" @click="handleRefund" v-if="orderInfo.SALEBILL_STATE === 1010">
|
||||
<div class="continu-btn" @click="handleRefund"
|
||||
v-if="orderInfo.SALEBILL_STATE === 1010 && orderInfo.SALEBILL_TYPE !== 3001">
|
||||
发起退款
|
||||
</div>
|
||||
<!-- <div class="back-btn" @click="goShop" v-if="orderInfo.SALEBILL_STATE!=1010">再来一单</div> -->
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
<view class="pageName" :style="{ color: pageType === 'UnionMall' ? '#000' : '#000' }">{{
|
||||
pageType === "UnionMall" ? "工会之家" : "彩云驿商城"
|
||||
}}</view>
|
||||
<view class="backArrowBox"></view>
|
||||
<view class="backArrowBox" style="background-color: transparent;border: none;"></view>
|
||||
|
||||
<view class="moreFunBox" :style="{ top: showExportObj.y + 20 + 'px' }" v-if="showExportFun">
|
||||
<view class="triangle"></view>
|
||||
@ -891,11 +891,11 @@ export default {
|
||||
handleMaskClick(e) {
|
||||
this.priceRangeRefShow = false
|
||||
},
|
||||
handleGoPointsMall() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
});
|
||||
},
|
||||
// handleGoPointsMall() {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
// });
|
||||
// },
|
||||
// 滚动到底部 加载更多的方法
|
||||
handleScrollBottom() {
|
||||
this.handleToBottom();
|
||||
@ -1580,8 +1580,12 @@ export default {
|
||||
},
|
||||
// 跳转积分商城
|
||||
handleGoPointsMall() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
// });
|
||||
|
||||
uni.redirectTo({
|
||||
url: `/pages/shopMallPage/shopType/index?selectIndex=${999999}&pageType=${this.pageType}`,
|
||||
});
|
||||
},
|
||||
// 切换甄选商品的类型
|
||||
|
||||
@ -80,12 +80,15 @@
|
||||
<!-- style="width: 70px" -->
|
||||
|
||||
<div class="itemBox">
|
||||
<div class="normal">
|
||||
<div :class="activeTabs === 999999 ? 'tab_active normal' : 'normal'">
|
||||
<div class="imgBox">
|
||||
<image style="width: 100%; height: 100%" :src="'/static/images/home/markShopIcon.png'"></image>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab_txt_normal">积分商城</div>
|
||||
<div :class="activeTabs === 999999
|
||||
? 'tab_txt_active tab_txt_normal'
|
||||
: 'tab_txt_normal'
|
||||
">积分商城</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -948,8 +951,12 @@ export default {
|
||||
}
|
||||
|
||||
this.shopTypeList = resList;
|
||||
console.log("拿到全部商品的分类", this.shopTypeList);
|
||||
this.handleGetAllShopItem(resList[this.activeTabs].UserdefinedType_Id);
|
||||
|
||||
if (this.activeTabs === 999999) {
|
||||
this.handleGoPointsMall()
|
||||
} else {
|
||||
this.handleGetAllShopItem(resList[this.activeTabs].UserdefinedType_Id);
|
||||
}
|
||||
},
|
||||
// 按照小类的 UserdefinedType_PIndex 字段 从小到大排序
|
||||
handleSortLeftType(oldList) {
|
||||
@ -1541,10 +1548,85 @@ export default {
|
||||
}
|
||||
},
|
||||
// 跳转商品列表
|
||||
handleGoPointsMall() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
});
|
||||
async handleGoPointsMall() {
|
||||
uni.showLoading({ title: "加载中" });
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
// });
|
||||
this.activeTabs = 999999
|
||||
this.leftSelectIndex = 999999;
|
||||
this.leftToView = `left_0_999999`
|
||||
this.leftTypeList = [{ USERDEFINEDTYPE_NAME: "积分商城", USERDEFINEDTYPE_ID: 999999 }]
|
||||
|
||||
await this.handleGetPointMallShop()
|
||||
uni.hideLoading()
|
||||
},
|
||||
// 拿到积分商城的商品
|
||||
async handleGetPointMallShop() {
|
||||
let req = {
|
||||
action_type: "WeChat_GetMallGoodsInfo",
|
||||
ownerUnitId: 911,
|
||||
justCommodity: 1,
|
||||
payMethod: "2000,3000",
|
||||
excludeNature: this.user.INDUSTRY_MEMBERSHIP_ID ? '' : 5070,
|
||||
};
|
||||
const data = await this.$api.getCoop(req);
|
||||
let list = data.Data.List
|
||||
|
||||
|
||||
let shopList = []
|
||||
if (list && list.length > 0) {
|
||||
list.forEach((item) => {
|
||||
if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
item.COMMODITYLIST.forEach((subItem) => {
|
||||
shopList.push(subItem)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
console.log('shopListshopListshopList', shopList);
|
||||
|
||||
|
||||
if (shopList && shopList.length > 0) {
|
||||
shopList.forEach((item) => {
|
||||
// 判断当前的购物车里面 是不是已经有数据了 有数据的话 把原本的商品数量赋值进去
|
||||
if (this.shopCarList && this.shopCarList.length > 0) {
|
||||
this.shopCarList.forEach((shopCarItem) => {
|
||||
if (shopCarItem.COMMODITY_ID === item.COMMODITY_ID) {
|
||||
item.count = shopCarItem.count;
|
||||
item.showReduce = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
item.COMMODITY_MEMBERPRICE &&
|
||||
item.COMMODITY_MEMBERPRICE.toString().indexOf(".") !== -1
|
||||
) {
|
||||
item.bigNumber =
|
||||
item.COMMODITY_MEMBERPRICE.toString().split(".")[0];
|
||||
item.smallNumber =
|
||||
item.COMMODITY_MEMBERPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
item.bigNumber = item.COMMODITY_MEMBERPRICE;
|
||||
}
|
||||
if (
|
||||
item.COMMODITY_RETAILPRICE &&
|
||||
item.COMMODITY_RETAILPRICE.toString().indexOf(".") !== -1
|
||||
) {
|
||||
item.RETbigNumber =
|
||||
item.COMMODITY_RETAILPRICE.toString().split(".")[0];
|
||||
item.RETsmallNumber =
|
||||
item.COMMODITY_RETAILPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
item.RETbigNumber = item.COMMODITY_RETAILPRICE;
|
||||
}
|
||||
});
|
||||
this.changBigTypeLoading = true;
|
||||
this.rightShopList = shopList;
|
||||
this.visibleList = shopList.slice(0, this.visibleCount + this.buffer * 2);
|
||||
}
|
||||
},
|
||||
// 跳转工会之家
|
||||
handleGoUnionMall() {
|
||||
|
||||
@ -1285,6 +1285,7 @@ export default {
|
||||
box-sizing: border-box;
|
||||
padding: 40rpx 42rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.headerImgBox {
|
||||
width: 136rpx;
|
||||
@ -1310,6 +1311,7 @@ export default {
|
||||
height: 100%;
|
||||
margin-left: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.userInfoLeft {
|
||||
@ -1580,7 +1582,7 @@ export default {
|
||||
font-family: 'PingFangSC';
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #716F69;
|
||||
color: #000;
|
||||
line-height: 36rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
@ -1644,7 +1646,7 @@ export default {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #222222;
|
||||
color: #000;
|
||||
line-height: 36rpx;
|
||||
text-align: right;
|
||||
font-style: normal;
|
||||
@ -2074,7 +2076,7 @@ export default {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #716f69;
|
||||
color: #000;
|
||||
line-height: 36rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -72,16 +72,16 @@
|
||||
font-size: 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 12rpx;
|
||||
color: #1f1f1f;
|
||||
border: 1px solid #62605f;
|
||||
color: #07C160;
|
||||
border: 1px solid #07C160;
|
||||
display: inline-block;
|
||||
}
|
||||
.bottonBtnBox .btn.data-v-0a907f67 {
|
||||
height: 88rpx;
|
||||
width: calc(50% - 16rpx);
|
||||
line-height: 88rpx;
|
||||
background: linear-gradient(to right, #1f1f1f, #62605f);
|
||||
color: #f0dccf;
|
||||
background: linear-gradient(270deg, #27B25F 0%, #4CCC7F 100%);
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
margin-left: 5%;
|
||||
|
||||
@ -229,9 +229,18 @@ var _default = {
|
||||
county_list: [],
|
||||
addressSelectIndex: [0, 0, 0],
|
||||
streetList: [],
|
||||
streetIndex: 0
|
||||
streetIndex: -1,
|
||||
// 地址识别相关数据
|
||||
addressRecognition: {
|
||||
show: true,
|
||||
// 是否显示地址识别区域
|
||||
inputText: '',
|
||||
// 输入的地址文本
|
||||
showButtons: false // 是否显示取消和识别按钮
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
computed: _objectSpread({}, (0, _vuex.mapGetters)(["user"])),
|
||||
methods: {
|
||||
// 拿到省份数据 默认数据
|
||||
@ -436,15 +445,17 @@ var _default = {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.streetList && this.streetList.length > 0) {
|
||||
if (this.streetIndex >= 0) {} else {
|
||||
uni.showToast({
|
||||
title: "请选择街道地址!",
|
||||
icon: "none"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 街道选择是可选的,如果有街道列表但未选择,允许保存
|
||||
// if (this.streetList && this.streetList.length > 0) {
|
||||
// if (this.streetIndex >= 0) {
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// title: "请选择街道地址!",
|
||||
// icon: "none",
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
if (flag === 0) {
|
||||
this.saveFn();
|
||||
}
|
||||
@ -464,7 +475,7 @@ var _default = {
|
||||
provinceIndex = _this$addressSelectIn[0],
|
||||
cityIndex = _this$addressSelectIn[1],
|
||||
countryIndex = _this$addressSelectIn[2];
|
||||
arr.addressCode = [this.areaData[provinceIndex].region_id, this.city_list[cityIndex].region_id, this.county_list[countryIndex].region_id, this.streetList && this.streetList.length > 0 ? this.streetList[this.streetIndex].region_id : ""];
|
||||
arr.addressCode = [this.areaData[provinceIndex].region_id, this.city_list[cityIndex].region_id, this.county_list[countryIndex].region_id, this.streetList && this.streetList.length > 0 && this.streetIndex >= 0 ? this.streetList[this.streetIndex].region_id : ""];
|
||||
console.log("arr", arr);
|
||||
this.$api.postCoop(arr).then(function (res) {
|
||||
if (res.ResultCode === "100") {
|
||||
@ -738,6 +749,293 @@ var _default = {
|
||||
console.log("用户授权失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 地址识别相关方法
|
||||
onAddressRecognitionInput: function onAddressRecognitionInput(event) {
|
||||
this.addressRecognition.inputText = event.mp.detail.value;
|
||||
// 当有输入内容时显示按钮
|
||||
this.addressRecognition.showButtons = this.addressRecognition.inputText.trim().length > 0;
|
||||
},
|
||||
cancelAddressRecognition: function cancelAddressRecognition() {
|
||||
this.addressRecognition.inputText = '';
|
||||
this.addressRecognition.showButtons = false;
|
||||
},
|
||||
recognizeAddress: function recognizeAddress() {
|
||||
var _this6 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
||||
var result;
|
||||
return _regenerator.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
switch (_context5.prev = _context5.next) {
|
||||
case 0:
|
||||
if (_this6.addressRecognition.inputText.trim()) {
|
||||
_context5.next = 3;
|
||||
break;
|
||||
}
|
||||
uni.showToast({
|
||||
title: '请输入地址信息',
|
||||
icon: 'none'
|
||||
});
|
||||
return _context5.abrupt("return");
|
||||
case 3:
|
||||
_context5.prev = 3;
|
||||
_context5.next = 6;
|
||||
return _this6.parseAddress(_this6.addressRecognition.inputText);
|
||||
case 6:
|
||||
result = _context5.sent;
|
||||
if (!result.success) {
|
||||
_context5.next = 16;
|
||||
break;
|
||||
}
|
||||
if (!(result.province && result.city && result.district)) {
|
||||
_context5.next = 11;
|
||||
break;
|
||||
}
|
||||
_context5.next = 11;
|
||||
return _this6.setAddressFromRecognition(result);
|
||||
case 11:
|
||||
// 设置详细地址
|
||||
if (result.detail) {
|
||||
_this6.saveMsg.doorplate = result.detail;
|
||||
}
|
||||
|
||||
// 清空识别输入框
|
||||
_this6.cancelAddressRecognition();
|
||||
uni.showToast({
|
||||
title: '地址识别成功',
|
||||
icon: 'success'
|
||||
});
|
||||
_context5.next = 17;
|
||||
break;
|
||||
case 16:
|
||||
uni.showToast({
|
||||
title: result.message || '地址识别失败,请检查地址格式',
|
||||
icon: 'none'
|
||||
});
|
||||
case 17:
|
||||
_context5.next = 23;
|
||||
break;
|
||||
case 19:
|
||||
_context5.prev = 19;
|
||||
_context5.t0 = _context5["catch"](3);
|
||||
console.error('地址识别错误:', _context5.t0);
|
||||
uni.showToast({
|
||||
title: '识别失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
case 23:
|
||||
_context5.prev = 23;
|
||||
uni.hideLoading();
|
||||
return _context5.finish(23);
|
||||
case 26:
|
||||
case "end":
|
||||
return _context5.stop();
|
||||
}
|
||||
}
|
||||
}, _callee5, null, [[3, 19, 23, 26]]);
|
||||
}))();
|
||||
},
|
||||
parseAddress: function parseAddress(addressText) {
|
||||
return new Promise(function (resolve) {
|
||||
try {
|
||||
// 地址解析正则表达式(使用非贪婪匹配)
|
||||
var provinceRegex = /(北京市|上海市|天津市|重庆市|[\u4e00-\u9fa5]{2,}?省|[\u4e00-\u9fa5]{2,}?自治区)/;
|
||||
var cityRegex = /([\u4e00-\u9fa5]{2,}?市|[\u4e00-\u9fa5]{2,}?地区|[\u4e00-\u9fa5]{2,}?州|[\u4e00-\u9fa5]{2,}?盟)/;
|
||||
var districtRegex = /([\u4e00-\u9fa5]{2,}?区|[\u4e00-\u9fa5]{2,}?县|[\u4e00-\u9fa5]{2,}?市)/;
|
||||
var streetRegex = /([\u4e00-\u9fa5]{2,}?街道|[\u4e00-\u9fa5]{2,}?镇|[\u4e00-\u9fa5]{2,}?乡)/;
|
||||
var currentText = addressText.trim();
|
||||
var province = '',
|
||||
city = '',
|
||||
district = '',
|
||||
street = '',
|
||||
detail = '';
|
||||
console.log('解析地址:', addressText);
|
||||
console.log('初始文本:', currentText);
|
||||
|
||||
// 提取省份
|
||||
var provinceMatch = currentText.match(provinceRegex);
|
||||
if (provinceMatch) {
|
||||
province = provinceMatch[1];
|
||||
currentText = currentText.replace(province, '').trim();
|
||||
console.log('省份:', province, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 提取城市
|
||||
var cityMatch = currentText.match(cityRegex);
|
||||
if (cityMatch) {
|
||||
city = cityMatch[1];
|
||||
currentText = currentText.replace(city, '').trim();
|
||||
console.log('城市:', city, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 提取区县
|
||||
var districtMatch = currentText.match(districtRegex);
|
||||
if (districtMatch) {
|
||||
district = districtMatch[1];
|
||||
currentText = currentText.replace(district, '').trim();
|
||||
console.log('区县:', district, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 提取街道
|
||||
var streetMatch = currentText.match(streetRegex);
|
||||
if (streetMatch) {
|
||||
street = streetMatch[1];
|
||||
currentText = currentText.replace(street, '').trim();
|
||||
console.log('街道:', street, '剩余:', currentText);
|
||||
}
|
||||
|
||||
// 剩余的作为详细地址
|
||||
detail = currentText;
|
||||
console.log('详细地址:', detail);
|
||||
console.log('解析结果:', {
|
||||
province: province,
|
||||
city: city,
|
||||
district: district,
|
||||
street: street,
|
||||
detail: detail
|
||||
});
|
||||
if (province && city && district) {
|
||||
resolve({
|
||||
success: true,
|
||||
province: province,
|
||||
city: city,
|
||||
district: district,
|
||||
street: street,
|
||||
detail: detail
|
||||
});
|
||||
} else {
|
||||
resolve({
|
||||
success: false,
|
||||
message: "\u65E0\u6CD5\u8BC6\u522B\u5B8C\u6574\u7684\u7701\u5E02\u533A\u4FE1\u606F\uFF0C\u8BF7\u68C0\u67E5\u5730\u5740\u683C\u5F0F\u3002\u5F53\u524D\u8BC6\u522B\u5230\uFF1A\u7701\u4EFD=".concat(province, ", \u57CE\u5E02=").concat(city, ", \u533A\u53BF=").concat(district)
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('地址解析错误:', error);
|
||||
resolve({
|
||||
success: false,
|
||||
message: '地址解析错误'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
setAddressFromRecognition: function setAddressFromRecognition(result) {
|
||||
var _this7 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
||||
var provinceIndex, cityIndex, districtIndex, cityReq, cityData, districtReq, districtData, streetIndex;
|
||||
return _regenerator.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
switch (_context6.prev = _context6.next) {
|
||||
case 0:
|
||||
_context6.prev = 0;
|
||||
if (!(!_this7.areaData || _this7.areaData.length === 0)) {
|
||||
_context6.next = 4;
|
||||
break;
|
||||
}
|
||||
_context6.next = 4;
|
||||
return _this7.handleGetProviceCode();
|
||||
case 4:
|
||||
provinceIndex = -1, cityIndex = -1, districtIndex = -1; // 查找省份
|
||||
_this7.areaData.forEach(function (item, index) {
|
||||
if (item.region_name === result.province || item.region_name.includes(result.province.replace('省', '').replace('市', '').replace('自治区', ''))) {
|
||||
provinceIndex = index;
|
||||
}
|
||||
});
|
||||
if (!(provinceIndex === -1)) {
|
||||
_context6.next = 8;
|
||||
break;
|
||||
}
|
||||
throw new Error('未找到匹配的省份');
|
||||
case 8:
|
||||
// 获取城市数据
|
||||
cityReq = {
|
||||
parentId: _this7.areaData[provinceIndex].region_id,
|
||||
page: 1,
|
||||
pageSize: 999
|
||||
};
|
||||
_context6.next = 11;
|
||||
return _this7.$api.$postNode("/pino/region/list", cityReq);
|
||||
case 11:
|
||||
cityData = _context6.sent;
|
||||
_this7.city_list = cityData.data.data;
|
||||
|
||||
// 查找城市
|
||||
_this7.city_list.forEach(function (item, index) {
|
||||
if (item.region_name === result.city || item.region_name.includes(result.city.replace('市', '').replace('州', '').replace('地区', '').replace('盟', ''))) {
|
||||
cityIndex = index;
|
||||
}
|
||||
});
|
||||
if (!(cityIndex === -1)) {
|
||||
_context6.next = 16;
|
||||
break;
|
||||
}
|
||||
throw new Error('未找到匹配的城市');
|
||||
case 16:
|
||||
// 获取区县数据
|
||||
districtReq = {
|
||||
parentId: _this7.city_list[cityIndex].region_id,
|
||||
page: 1,
|
||||
pageSize: 999
|
||||
};
|
||||
_context6.next = 19;
|
||||
return _this7.$api.$postNode("/pino/region/list", districtReq);
|
||||
case 19:
|
||||
districtData = _context6.sent;
|
||||
_this7.county_list = districtData.data.data;
|
||||
|
||||
// 查找区县
|
||||
_this7.county_list.forEach(function (item, index) {
|
||||
if (item.region_name === result.district || item.region_name.includes(result.district.replace('区', '').replace('县', '').replace('市', ''))) {
|
||||
districtIndex = index;
|
||||
}
|
||||
});
|
||||
if (!(districtIndex === -1)) {
|
||||
_context6.next = 24;
|
||||
break;
|
||||
}
|
||||
throw new Error('未找到匹配的区县');
|
||||
case 24:
|
||||
// 设置选中的地址
|
||||
_this7.addressSelectIndex = [provinceIndex, cityIndex, districtIndex];
|
||||
_this7.saveMsg.address = _this7.areaData[provinceIndex].region_name + _this7.city_list[cityIndex].region_name + _this7.county_list[districtIndex].region_name;
|
||||
|
||||
// 获取街道数据
|
||||
_context6.next = 28;
|
||||
return _this7.handleGetStreetData();
|
||||
case 28:
|
||||
// 如果解析出了街道信息,尝试匹配街道选择器
|
||||
if (result.street && _this7.streetList && _this7.streetList.length > 0) {
|
||||
streetIndex = -1;
|
||||
_this7.streetList.forEach(function (item, index) {
|
||||
if (item.region_name === result.street || item.region_name.includes(result.street.replace('街道', '').replace('镇', '').replace('乡', ''))) {
|
||||
streetIndex = index;
|
||||
}
|
||||
});
|
||||
|
||||
// 只有匹配到才设置,匹配不到就保持默认不选择
|
||||
if (streetIndex !== -1) {
|
||||
_this7.streetIndex = streetIndex;
|
||||
} else {
|
||||
// 街道不匹配时,保持默认状态(不选择任何街道)
|
||||
_this7.streetIndex = -1;
|
||||
}
|
||||
} else {
|
||||
// 没有解析到街道信息时,也保持不选择状态
|
||||
_this7.streetIndex = -1;
|
||||
}
|
||||
_context6.next = 35;
|
||||
break;
|
||||
case 31:
|
||||
_context6.prev = 31;
|
||||
_context6.t0 = _context6["catch"](0);
|
||||
console.error('地址设置错误:', _context6.t0);
|
||||
throw _context6.t0;
|
||||
case 35:
|
||||
case "end":
|
||||
return _context6.stop();
|
||||
}
|
||||
}
|
||||
}, _callee6, null, [[0, 31]]);
|
||||
}))();
|
||||
}
|
||||
},
|
||||
onUnload: function onUnload() {
|
||||
@ -753,6 +1051,12 @@ var _default = {
|
||||
this.tipCodes.map(function (n) {
|
||||
n.isChecked = false;
|
||||
});
|
||||
// 重置地址识别状态
|
||||
this.addressRecognition = {
|
||||
show: true,
|
||||
inputText: '',
|
||||
showButtons: false
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad(option) {
|
||||
this.pageMsg.id = option.id || "";
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -179,4 +179,59 @@ textarea.data-v-f752e738 {
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.address-recognition.data-v-f752e738 {
|
||||
padding: 32rpx 0;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.recognition-input.data-v-f752e738 {
|
||||
position: relative;
|
||||
}
|
||||
.recognition-input .recognition-textarea.data-v-f752e738 {
|
||||
width: 100%;
|
||||
min-height: 80rpx;
|
||||
max-height: 200rpx;
|
||||
line-height: 30rpx;
|
||||
padding: 12rpx;
|
||||
border: 2rpx solid #dcdcdc;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
}
|
||||
.recognition-input .recognition-textarea.data-v-f752e738:focus {
|
||||
border-color: #07c160;
|
||||
}
|
||||
.recognition-input .recognition-buttons.data-v-f752e738 {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 16rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.recognition-input .recognition-buttons .btn-cancel.data-v-f752e738,
|
||||
.recognition-input .recognition-buttons .btn-recognize.data-v-f752e738 {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
min-width: 80rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
.recognition-input .recognition-buttons .btn-cancel.data-v-f752e738 {
|
||||
background-color: #f5f5f5;
|
||||
color: #666;
|
||||
border: 1rpx solid #dcdcdc;
|
||||
}
|
||||
.recognition-input .recognition-buttons .btn-cancel.data-v-f752e738:active {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
.recognition-input .recognition-buttons .btn-recognize.data-v-f752e738 {
|
||||
background-color: #07c160;
|
||||
color: #fff;
|
||||
border: 1rpx solid #07c160;
|
||||
}
|
||||
.recognition-input .recognition-buttons .btn-recognize.data-v-f752e738:active {
|
||||
background-color: #05a04f;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -393,7 +393,6 @@ var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime
|
||||
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
|
||||
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
|
||||
var _vuex = __webpack_require__(/*! vuex */ 33);
|
||||
var _methods;
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
||||
var shopTabbar = function shopTabbar() {
|
||||
@ -658,7 +657,7 @@ var _default = {
|
||||
path: "/pages/index/index?pageType=".concat(this.pageType)
|
||||
};
|
||||
},
|
||||
methods: (_methods = {
|
||||
methods: {
|
||||
handleHideExportFun: function handleHideExportFun() {
|
||||
this.showExportFun = false;
|
||||
},
|
||||
@ -682,11 +681,11 @@ var _default = {
|
||||
handleMaskClick: function handleMaskClick(e) {
|
||||
this.priceRangeRefShow = false;
|
||||
},
|
||||
handleGoPointsMall: function handleGoPointsMall() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopPages/shopList/index?pageType=pointsMall"
|
||||
});
|
||||
},
|
||||
// handleGoPointsMall() {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
// });
|
||||
// },
|
||||
// 滚动到底部 加载更多的方法
|
||||
handleScrollBottom: function handleScrollBottom() {
|
||||
this.handleToBottom();
|
||||
@ -1471,152 +1470,176 @@ var _default = {
|
||||
});
|
||||
}
|
||||
this.todayOffersList = shopList;
|
||||
}
|
||||
}, (0, _defineProperty2.default)(_methods, "handleGoPointsMall", function handleGoPointsMall() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopPages/shopList/index?pageType=pointsMall"
|
||||
});
|
||||
}), (0, _defineProperty2.default)(_methods, "handleChangeShopMallType", function handleChangeShopMallType(obj) {
|
||||
this.selectProducts = obj.UserdefinedType_Id;
|
||||
this.shopMsg = {
|
||||
pageSize: 6,
|
||||
pageIndex: 1,
|
||||
isOver: false
|
||||
};
|
||||
this.handleGetProductsList();
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGetProductsList", function handleGetProductsList() {
|
||||
var _this13 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
||||
var data, list, resList, thisResList;
|
||||
return _regenerator.default.wrap(function _callee11$(_context11) {
|
||||
while (1) {
|
||||
switch (_context11.prev = _context11.next) {
|
||||
case 0:
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
});
|
||||
_context11.next = 3;
|
||||
return _this13.$api.$javaGet('/third-party/getWeChatGetMallGoodsInfo', {
|
||||
ownerUnitId: 911,
|
||||
justCommodity: 1,
|
||||
payMethod: "2000,3000",
|
||||
COMMODITYNATURE: 6000
|
||||
});
|
||||
case 3:
|
||||
data = _context11.sent;
|
||||
list = data.Data.List;
|
||||
console.log('积分商城', list);
|
||||
resList = [];
|
||||
thisResList = [];
|
||||
if (_this13.shopMsg.pageIndex > 1) {
|
||||
resList = _this13.productsList;
|
||||
}
|
||||
if (list && list.length > 0) {
|
||||
// this.selectProducts = list[0].UserdefinedType_Id;
|
||||
list.forEach(function (item) {
|
||||
if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
item.COMMODITYLIST.forEach(function (subItem) {
|
||||
if (subItem.COMMODITY_MEMBERPRICE && subItem.COMMODITY_MEMBERPRICE.toString().indexOf(".") !== -1) {
|
||||
subItem.bigNumber = subItem.COMMODITY_MEMBERPRICE.toString().split(".")[0];
|
||||
subItem.smallNumber = subItem.COMMODITY_MEMBERPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
subItem.bigNumber = subItem.COMMODITY_MEMBERPRICE;
|
||||
}
|
||||
if (subItem.COMMODITY_RETAILPRICE && subItem.COMMODITY_RETAILPRICE.toString().indexOf(".") !== -1) {
|
||||
subItem.RETbigNumber = subItem.COMMODITY_RETAILPRICE.toString().split(".")[0];
|
||||
subItem.RETsmallNumber = subItem.COMMODITY_RETAILPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
subItem.RETbigNumber = subItem.COMMODITY_RETAILPRICE;
|
||||
}
|
||||
thisResList.push(subItem);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (thisResList && thisResList.length < 6) {
|
||||
_this13.shopMsg.isOver = true;
|
||||
}
|
||||
// this.productsList = list;
|
||||
_this13.productsList = resList.concat(thisResList);
|
||||
console.log("甄选商品", _this13.productsList);
|
||||
uni.hideLoading();
|
||||
|
||||
// let shopList = []
|
||||
// if (list && list.length > 0) {
|
||||
// list.forEach((item) => {
|
||||
// if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
// item.COMMODITYLIST.forEach((subItem) => {
|
||||
// shopList.push(subItem)
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
case 14:
|
||||
case "end":
|
||||
return _context11.stop();
|
||||
}
|
||||
}
|
||||
}, _callee11);
|
||||
}))();
|
||||
}), (0, _defineProperty2.default)(_methods, "handleBackHome", function handleBackHome() {
|
||||
if (this.pageType === "UnionMall") {
|
||||
// uni.navigateBack({
|
||||
// delta: 1,
|
||||
},
|
||||
// 跳转积分商城
|
||||
handleGoPointsMall: function handleGoPointsMall() {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
// });
|
||||
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/index/index"
|
||||
url: "/pages/shopMallPage/shopType/index?selectIndex=".concat(999999, "&pageType=", this.pageType)
|
||||
});
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
},
|
||||
// 切换甄选商品的类型
|
||||
handleChangeShopMallType: function handleChangeShopMallType(obj) {
|
||||
this.selectProducts = obj.UserdefinedType_Id;
|
||||
this.shopMsg = {
|
||||
pageSize: 6,
|
||||
pageIndex: 1,
|
||||
isOver: false
|
||||
};
|
||||
this.handleGetProductsList();
|
||||
},
|
||||
// 拿到甄选商品 3000
|
||||
handleGetProductsList: function handleGetProductsList() {
|
||||
var _this13 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
||||
var data, list, resList, thisResList;
|
||||
return _regenerator.default.wrap(function _callee11$(_context11) {
|
||||
while (1) {
|
||||
switch (_context11.prev = _context11.next) {
|
||||
case 0:
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
});
|
||||
_context11.next = 3;
|
||||
return _this13.$api.$javaGet('/third-party/getWeChatGetMallGoodsInfo', {
|
||||
ownerUnitId: 911,
|
||||
justCommodity: 1,
|
||||
payMethod: "2000,3000",
|
||||
COMMODITYNATURE: 6000
|
||||
});
|
||||
case 3:
|
||||
data = _context11.sent;
|
||||
list = data.Data.List;
|
||||
console.log('积分商城', list);
|
||||
resList = [];
|
||||
thisResList = [];
|
||||
if (_this13.shopMsg.pageIndex > 1) {
|
||||
resList = _this13.productsList;
|
||||
}
|
||||
if (list && list.length > 0) {
|
||||
// this.selectProducts = list[0].UserdefinedType_Id;
|
||||
list.forEach(function (item) {
|
||||
if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
item.COMMODITYLIST.forEach(function (subItem) {
|
||||
if (subItem.COMMODITY_MEMBERPRICE && subItem.COMMODITY_MEMBERPRICE.toString().indexOf(".") !== -1) {
|
||||
subItem.bigNumber = subItem.COMMODITY_MEMBERPRICE.toString().split(".")[0];
|
||||
subItem.smallNumber = subItem.COMMODITY_MEMBERPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
subItem.bigNumber = subItem.COMMODITY_MEMBERPRICE;
|
||||
}
|
||||
if (subItem.COMMODITY_RETAILPRICE && subItem.COMMODITY_RETAILPRICE.toString().indexOf(".") !== -1) {
|
||||
subItem.RETbigNumber = subItem.COMMODITY_RETAILPRICE.toString().split(".")[0];
|
||||
subItem.RETsmallNumber = subItem.COMMODITY_RETAILPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
subItem.RETbigNumber = subItem.COMMODITY_RETAILPRICE;
|
||||
}
|
||||
thisResList.push(subItem);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (thisResList && thisResList.length < 6) {
|
||||
_this13.shopMsg.isOver = true;
|
||||
}
|
||||
// this.productsList = list;
|
||||
_this13.productsList = resList.concat(thisResList);
|
||||
console.log("甄选商品", _this13.productsList);
|
||||
uni.hideLoading();
|
||||
|
||||
// let shopList = []
|
||||
// if (list && list.length > 0) {
|
||||
// list.forEach((item) => {
|
||||
// if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
// item.COMMODITYLIST.forEach((subItem) => {
|
||||
// shopList.push(subItem)
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
case 14:
|
||||
case "end":
|
||||
return _context11.stop();
|
||||
}
|
||||
}
|
||||
}, _callee11);
|
||||
}))();
|
||||
},
|
||||
// 返回首页
|
||||
handleBackHome: function handleBackHome() {
|
||||
if (this.pageType === "UnionMall") {
|
||||
// uni.navigateBack({
|
||||
// delta: 1,
|
||||
// });
|
||||
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/index/index"
|
||||
});
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 跳转公告页面
|
||||
handleGoNotice: function handleGoNotice() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/noticePage/index"
|
||||
});
|
||||
},
|
||||
// 跳转商品列表接口
|
||||
handleGoShopList: function handleGoShopList(value, index) {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?type=${type}&pageType=${this.pageType || ""
|
||||
// }`,
|
||||
// });
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?leftId=".concat(value, "&pageType=").concat(this.pageType, "&selectIndex=").concat(index)
|
||||
});
|
||||
},
|
||||
// 跳转商品详情
|
||||
handleGoShopDetail: function handleGoShopDetail(obj) {
|
||||
console.log("obj", obj);
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopPages/shopDetail/index?id=".concat(obj.COMMODITY_ID, "&pageType=").concat(this.pageType)
|
||||
});
|
||||
},
|
||||
// 跳转到商品分类页面
|
||||
handleGoShopPage: function handleGoShopPage(obj, index) {
|
||||
console.log("obj", obj);
|
||||
console.log("index", index);
|
||||
if (this.pageType === "UnionMall") {
|
||||
// if (obj.UserdefinedType_Name === "工会活动") {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/allFunPage/unionActivities`,
|
||||
// });
|
||||
// } else {
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?leftId=".concat(obj.UserdefinedType_Id, "&pageType=").concat(this.pageType, "&selectIndex=").concat(index)
|
||||
// url: `/pages/shopMallPage/shopType/index?pageType=${this.pageType}`,
|
||||
});
|
||||
// }
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?selectIndex=".concat(index, "&pageType=").concat(this.pageType)
|
||||
});
|
||||
}
|
||||
},
|
||||
// 活动直接跳转分类页面 分类页面的互动是第一个 所以 selectIndex 传0就好
|
||||
handleGoActivityType: function handleGoActivityType() {
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?selectIndex=".concat(0, "&pageType=", this.pageType)
|
||||
});
|
||||
},
|
||||
// 跳转工会之家
|
||||
handleGoUnionMall: function handleGoUnionMall() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopMallPage/index/index?pageType=UnionMall"
|
||||
});
|
||||
}
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoNotice", function handleGoNotice() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/noticePage/index"
|
||||
});
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoShopList", function handleGoShopList(value, index) {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?type=${type}&pageType=${this.pageType || ""
|
||||
// }`,
|
||||
// });
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?leftId=".concat(value, "&pageType=").concat(this.pageType, "&selectIndex=").concat(index)
|
||||
});
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoShopDetail", function handleGoShopDetail(obj) {
|
||||
console.log("obj", obj);
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopPages/shopDetail/index?id=".concat(obj.COMMODITY_ID, "&pageType=").concat(this.pageType)
|
||||
});
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoShopPage", function handleGoShopPage(obj, index) {
|
||||
console.log("obj", obj);
|
||||
console.log("index", index);
|
||||
if (this.pageType === "UnionMall") {
|
||||
// if (obj.UserdefinedType_Name === "工会活动") {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/allFunPage/unionActivities`,
|
||||
// });
|
||||
// } else {
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?leftId=".concat(obj.UserdefinedType_Id, "&pageType=").concat(this.pageType, "&selectIndex=").concat(index)
|
||||
// url: `/pages/shopMallPage/shopType/index?pageType=${this.pageType}`,
|
||||
});
|
||||
// }
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?selectIndex=".concat(index, "&pageType=").concat(this.pageType)
|
||||
});
|
||||
}
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoActivityType", function handleGoActivityType() {
|
||||
uni.redirectTo({
|
||||
url: "/pages/shopMallPage/shopType/index?selectIndex=".concat(0, "&pageType=", this.pageType)
|
||||
});
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoUnionMall", function handleGoUnionMall() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopMallPage/index/index?pageType=UnionMall"
|
||||
});
|
||||
}), _methods)
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -876,8 +876,11 @@ var _default = {
|
||||
});
|
||||
}
|
||||
this.shopTypeList = resList;
|
||||
console.log("拿到全部商品的分类", this.shopTypeList);
|
||||
this.handleGetAllShopItem(resList[this.activeTabs].UserdefinedType_Id);
|
||||
if (this.activeTabs === 999999) {
|
||||
this.handleGoPointsMall();
|
||||
} else {
|
||||
this.handleGetAllShopItem(resList[this.activeTabs].UserdefinedType_Id);
|
||||
}
|
||||
}), (0, _defineProperty2.default)(_methods, "handleSortLeftType", function handleSortLeftType(oldList) {
|
||||
var list = oldList;
|
||||
if (list && list.length > 0) {
|
||||
@ -1401,9 +1404,102 @@ var _default = {
|
||||
});
|
||||
}
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoPointsMall", function handleGoPointsMall() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopPages/shopList/index?pageType=pointsMall"
|
||||
});
|
||||
var _this10 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
||||
return _regenerator.default.wrap(function _callee5$(_context5) {
|
||||
while (1) {
|
||||
switch (_context5.prev = _context5.next) {
|
||||
case 0:
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/shopPages/shopList/index?pageType=pointsMall`,
|
||||
// });
|
||||
_this10.activeTabs = 999999;
|
||||
_this10.leftSelectIndex = 999999;
|
||||
_this10.leftToView = "left_0_999999";
|
||||
_this10.leftTypeList = [{
|
||||
USERDEFINEDTYPE_NAME: "积分商城",
|
||||
USERDEFINEDTYPE_ID: 999999
|
||||
}];
|
||||
_context5.next = 7;
|
||||
return _this10.handleGetPointMallShop();
|
||||
case 7:
|
||||
uni.hideLoading();
|
||||
case 8:
|
||||
case "end":
|
||||
return _context5.stop();
|
||||
}
|
||||
}
|
||||
}, _callee5);
|
||||
}))();
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGetPointMallShop", function handleGetPointMallShop() {
|
||||
var _this11 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
||||
var req, data, list, shopList;
|
||||
return _regenerator.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
switch (_context6.prev = _context6.next) {
|
||||
case 0:
|
||||
req = {
|
||||
action_type: "WeChat_GetMallGoodsInfo",
|
||||
ownerUnitId: 911,
|
||||
justCommodity: 1,
|
||||
payMethod: "2000,3000",
|
||||
excludeNature: _this11.user.INDUSTRY_MEMBERSHIP_ID ? '' : 5070
|
||||
};
|
||||
_context6.next = 3;
|
||||
return _this11.$api.getCoop(req);
|
||||
case 3:
|
||||
data = _context6.sent;
|
||||
list = data.Data.List;
|
||||
shopList = [];
|
||||
if (list && list.length > 0) {
|
||||
list.forEach(function (item) {
|
||||
if (item.COMMODITYLIST && item.COMMODITYLIST.length > 0) {
|
||||
item.COMMODITYLIST.forEach(function (subItem) {
|
||||
shopList.push(subItem);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log('shopListshopListshopList', shopList);
|
||||
if (shopList && shopList.length > 0) {
|
||||
shopList.forEach(function (item) {
|
||||
// 判断当前的购物车里面 是不是已经有数据了 有数据的话 把原本的商品数量赋值进去
|
||||
if (_this11.shopCarList && _this11.shopCarList.length > 0) {
|
||||
_this11.shopCarList.forEach(function (shopCarItem) {
|
||||
if (shopCarItem.COMMODITY_ID === item.COMMODITY_ID) {
|
||||
item.count = shopCarItem.count;
|
||||
item.showReduce = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (item.COMMODITY_MEMBERPRICE && item.COMMODITY_MEMBERPRICE.toString().indexOf(".") !== -1) {
|
||||
item.bigNumber = item.COMMODITY_MEMBERPRICE.toString().split(".")[0];
|
||||
item.smallNumber = item.COMMODITY_MEMBERPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
item.bigNumber = item.COMMODITY_MEMBERPRICE;
|
||||
}
|
||||
if (item.COMMODITY_RETAILPRICE && item.COMMODITY_RETAILPRICE.toString().indexOf(".") !== -1) {
|
||||
item.RETbigNumber = item.COMMODITY_RETAILPRICE.toString().split(".")[0];
|
||||
item.RETsmallNumber = item.COMMODITY_RETAILPRICE.toString().split(".")[1];
|
||||
} else {
|
||||
item.RETbigNumber = item.COMMODITY_RETAILPRICE;
|
||||
}
|
||||
});
|
||||
_this11.changBigTypeLoading = true;
|
||||
_this11.rightShopList = shopList;
|
||||
_this11.visibleList = shopList.slice(0, _this11.visibleCount + _this11.buffer * 2);
|
||||
}
|
||||
case 9:
|
||||
case "end":
|
||||
return _context6.stop();
|
||||
}
|
||||
}
|
||||
}, _callee6);
|
||||
}))();
|
||||
}), (0, _defineProperty2.default)(_methods, "handleGoUnionMall", function handleGoUnionMall() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/shopMallPage/index/index?pageType=UnionMall"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -39,6 +39,7 @@
|
||||
box-sizing: border-box;
|
||||
padding: 40rpx 42rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.main .pageTop .userTopInfo .userInfoBox .headerImgBox.data-v-137d5072 {
|
||||
width: 136rpx;
|
||||
@ -60,6 +61,7 @@
|
||||
height: 100%;
|
||||
margin-left: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.main .pageTop .userTopInfo .userInfoBox .userInfo .userInfoLeft.data-v-137d5072 {
|
||||
width: 100%;
|
||||
@ -265,7 +267,7 @@
|
||||
font-family: 'PingFangSC';
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #716F69;
|
||||
color: #000;
|
||||
line-height: 36rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
@ -319,7 +321,7 @@
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #222222;
|
||||
color: #000;
|
||||
line-height: 36rpx;
|
||||
text-align: right;
|
||||
font-style: normal;
|
||||
@ -702,7 +704,7 @@
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #716f69;
|
||||
color: #000;
|
||||
line-height: 36rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user