完善功能
This commit is contained in:
@ -48,10 +48,10 @@
|
||||
label="现住省份:" :border-bottom="false" placeholder="请选择省、市、区">
|
||||
</u-field>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<!-- <view class="form-item">
|
||||
<u-field v-model="reason" :label-width="150" type="textarea" label="申请原因:"
|
||||
placeholder="(必填)" :field-style="{ height: '250rpx'}" />
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<button class="apply-btn bg-primary white md m-t-20 flex row-center br60" @tap="formSubmit">
|
||||
@ -218,12 +218,15 @@
|
||||
applyDetail,
|
||||
getSuperiorInfo,
|
||||
getDistribution,
|
||||
veryfiyDistribute
|
||||
veryfiyDistribute,
|
||||
scanSubmit
|
||||
} from "@/api/user";
|
||||
import area from '@/utils/area'
|
||||
import {
|
||||
copy
|
||||
copy,
|
||||
strToParams
|
||||
} from '@/utils/tools'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -255,10 +258,24 @@
|
||||
inviteStatus: false,
|
||||
showRegion: false,
|
||||
regionLists: area,
|
||||
distributionInfo: {}
|
||||
distributionInfo: {},
|
||||
isScanEntry: false
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
onLoad() {
|
||||
this.isScanEntry = false
|
||||
console.log("🚀 ~ this.$Route.query:", this.$Route.query)
|
||||
if (this.$Route.query && this.$Route.query.scene) {
|
||||
console.log("🚀 ~ this.$Route.query:", this.$Route.query.scene)
|
||||
|
||||
const query = this.parseScanQuery(this.$Route.query.scene)
|
||||
console.log("🚀 ~ query:", query)
|
||||
if (query.type == 1 || query.type == '1') {
|
||||
// 页面扫码进入
|
||||
this.isScanEntry = true
|
||||
}
|
||||
}
|
||||
|
||||
// 获取上级及个人信息
|
||||
this.getSuperiorInfoFun()
|
||||
// 判断是否是分销会员
|
||||
@ -267,6 +284,40 @@
|
||||
|
||||
|
||||
methods: {
|
||||
parseScanQuery(scene) {
|
||||
if (!scene || typeof scene !== 'string') return {}
|
||||
|
||||
let parsed = {}
|
||||
let decodedScene = scene
|
||||
|
||||
try {
|
||||
decodedScene = decodeURIComponent(scene)
|
||||
} catch (error) {
|
||||
decodedScene = scene
|
||||
}
|
||||
|
||||
try {
|
||||
parsed = strToParams(decodedScene)
|
||||
} catch (error) {
|
||||
parsed = {}
|
||||
}
|
||||
|
||||
if (!Object.keys(parsed).length && decodedScene.includes('=')) {
|
||||
const [key, value = ''] = decodedScene.split('=')
|
||||
parsed = {
|
||||
[key]: value
|
||||
}
|
||||
}
|
||||
|
||||
const keys = Object.keys(parsed)
|
||||
if (keys.length === 1 && keys[0].includes('%3D')) {
|
||||
try {
|
||||
parsed = strToParams(decodeURIComponent(keys[0]))
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
return parsed
|
||||
},
|
||||
// 分销会员信息
|
||||
async getDistributionFun() {
|
||||
const {
|
||||
@ -281,20 +332,26 @@
|
||||
|
||||
veryfiyDistributeFun() {
|
||||
veryfiyDistribute().then(res => {
|
||||
console.log("🚀 ~ res.code:", res.code)
|
||||
console.log("🚀 ~ res.code:", this.isScanEntry)
|
||||
|
||||
if (res.code == 10001) {
|
||||
// 分销会员
|
||||
this.vipState = 2
|
||||
this.getDistributionFun()
|
||||
} else if (res.code == 20001) {
|
||||
} else if (res.code == 20001 && this.isScanEntry == true) {
|
||||
// 非分销会员
|
||||
this.vipState = 0;
|
||||
this.applyDetailFun()
|
||||
} else if (res.code == 0) {
|
||||
} else {
|
||||
this.$toast({
|
||||
title: "请先扫码"
|
||||
});
|
||||
// 返回上一页
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -307,8 +364,7 @@
|
||||
if (code == 1) {
|
||||
this.showLoading = false
|
||||
switch (data.status) {
|
||||
case 0:
|
||||
// 待审核
|
||||
case 0: // 待审核
|
||||
case 2:
|
||||
// 审核不通过
|
||||
this.vipState = 1;
|
||||
@ -359,23 +415,23 @@
|
||||
province: provinceId,
|
||||
city: cityId,
|
||||
district: districtId,
|
||||
reason: reason,
|
||||
// reason: reason,
|
||||
mobile
|
||||
};
|
||||
const {
|
||||
data,
|
||||
code,
|
||||
msg
|
||||
} = await applyDistribute(params)
|
||||
} = await scanSubmit(params)
|
||||
if (code == 1) {
|
||||
this.$toast({
|
||||
title: msg
|
||||
});
|
||||
this.veryfiyDistributeFun();
|
||||
this.applyDetailFun();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 填写邀请码
|
||||
bindSuperiorFun() {
|
||||
bindSuperior({
|
||||
|
||||
Reference in New Issue
Block a user