3
0
Fork 0

feat(upgrade): 升级单到达指定等级可以选择区域

This commit is contained in:
woody 2025-07-12 10:53:10 +08:00
parent 51379fe674
commit 7b52076c44
3 changed files with 65 additions and 7 deletions

View File

@ -15,12 +15,11 @@ module.exports = vm => {
// 初始化请求配置
uni.$u.http.setConfig(config => {
// config.baseURL = 'https://p1.hzs413.com/inter-api';
// 192.168.0.100:8080
//#ifdef DEV_SERVER
console.log('DEV_SERVER')
config.baseURL = 'http://192.168.0.86:8080'
config.baseURL = 'http://t-bl.beida777.com/prod-api'
//#endif
//#ifdef QA_SERVER

View File

@ -11,8 +11,9 @@
/>
</u-form-item>
<u-form-item
v-if="[60, 70, 80].includes(gradeValue)"
v-if="[60, 70, 80].includes(gradeValue) && provinceList.length"
@click="regionSelectHandle"
required
label="会员区域"
borderBottom
prop="regionProvince"
@ -499,6 +500,7 @@ export default {
transType: 1,
pkGradeVal: '',
placeParentName: '',
// regionProvince: '',
},
deliList: [],
diqu: '',
@ -660,11 +662,9 @@ export default {
},
methods: {
regionSelectHandle() {
console.log(this.provinceList, '....pkId')
this.$refs.regionAddress.setShow(this.provinceList[0].pkId)
},
setRegionAddress(area) {
console.log(area, '....area')
this.regionAddress = area
},
setPageTitle(areaId) {
@ -1211,7 +1211,7 @@ export default {
})
api
.confirmRegOrder(
Object.assign({}, this.form, this.allGoodsData, {
Object.assign({}, this.form, extParams, this.allGoodsData, {
deleteList: deleteList,
shopList: deleteList,
parentCode: this.form.parent,

View File

@ -10,6 +10,28 @@
disabled
/>
</u-form-item>
<u-form-item
v-if="[60, 70, 80].includes(gradeValue) && provinceList.length"
@click="regionSelectHandle"
required
label="会员区域"
borderBottom
prop="regionProvince"
>
<view class="disFlex justBwn">
<view v-if="regionAddress.length">
{{ regionAddress.map(item => item.name).join('-') }}
</view>
<view
v-else
class="uni-input-placeholder input-placeholder"
style="position: relative !important"
>请选择区域</view
>
<!-- <u-input v-model="form.regionProvince" border="none" disabled /> -->
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item label="会员编号" required borderBottom prop="memberCode">
<u-input
disabled
@ -328,6 +350,13 @@
:defaultCode="defaultCode"
@addressData="addressData"
></v-address>
<RegionAddress
ref="regionAddress"
:provinceList="provinceList"
:cityList="cityList"
:countyList="countyList"
@setAddress="setRegionAddress"
></RegionAddress>
</view>
</template>
@ -343,12 +372,16 @@ import {
REPURCHASE_AREA,
REISSUE_AREA,
} from '@/util/specialAreaMap'
import regionSelect from '@/pages/commonMixins/regionSelect'
import RegionAddress from '@/components/region-address.vue'
export default {
components: {
'v-address': address,
mustAgreeMent,
agreement,
RegionAddress,
},
mixins: [regionSelect],
data() {
return {
isDeliveryWay: true,
@ -406,6 +439,7 @@ export default {
orderItemsParams: [],
isLoading: false,
centerCodeId: '',
regionAddress: [],
rules: {
parent: [
{
@ -488,6 +522,8 @@ export default {
},
delId: '',
selTable: [],
regionAddress: [],
gradeValue: '',
}
},
onLoad(options) {
@ -538,6 +574,12 @@ export default {
this.getAddressList()
},
methods: {
regionSelectHandle() {
this.$refs.regionAddress.setShow(this.provinceList[0].pkId)
},
setRegionAddress(area) {
this.regionAddress = area
},
setPageTitle(areaId) {
const areaList = [
REGIEST_AREA,
@ -677,6 +719,10 @@ export default {
console.log(res.data, 'res.data.memLevel')
if (res.data.isEnough) {
this.form.pkGradeVal = res.data.pkGradeVal
if ([60, 70, 80].includes(res.data.gradeValue)) {
this.gradeValue = res.data.gradeValue
this.getRegionAreaList(res.data.gradeValue)
}
} else {
this.form.pkGradeVal = ''
uni.showToast({
@ -958,6 +1004,19 @@ export default {
})
},
goBuy() {
const extParams = {}
if ([60, 70, 80].includes(this.gradeValue) && this.provinceList?.length) {
if (!this.regionAddress.length) {
uni.showToast({
title: '请选择会员区域',
icon: 'none',
})
return
}
extParams.regionProvince = this.regionAddress[0]?.pkId || -1
extParams.regionCity = this.regionAddress[1]?.pkId || -1
extParams.regionCounty = this.regionAddress[2]?.pkId || -1
}
this.$refs.uForm.validate().then(res => {
this.isLoading = true
let deleteList = []
@ -967,7 +1026,7 @@ export default {
})
})
upgradeOrder(
Object.assign({}, this.form, this.allGoodsData, {
Object.assign({}, this.form, extParams, this.allGoodsData, {
deleteList: deleteList,
shopList: deleteList,
parentCode: this.form.parent,