增加运营商申请,二维码分享申请跳转至运营商申请(分销申请`)

This commit is contained in:
donqi 2022-08-12 22:21:47 +08:00
parent 0a40ca57bd
commit c02dc1ac5a
5 changed files with 267 additions and 83 deletions

View File

@ -259,6 +259,10 @@ export default {
let userProfile = uni.getStorageSync('userProfile'); let userProfile = uni.getStorageSync('userProfile');
return userProfile; return userProfile;
}, },
async refreshCurUserCache() {
let newUserInfo = await this.getCurUserNoCache();
uni.setStorageSync('userProfile', newUserInfo);
},
async getCurUserNoCache() { async getCurUserNoCache() {
let userInfo = this.getCurUserInfo(); let userInfo = this.getCurUserInfo();
let wxGetUserRes = await this.qryUserInfo(userInfo.openId); let wxGetUserRes = await this.qryUserInfo(userInfo.openId);
@ -525,5 +529,33 @@ export default {
data: params data: params
}) })
return res[1].data; return res[1].data;
},
async sendVertifyCode(params = {}) {
let res = await uni.request({
url: '/tool/sms/send',
method: 'POST',
data: params
})
return res[1].data;
},
async addCustomerPlace(params = {}) {
let res = await uni.request({
url: '/customer/place/app/add',
method: 'POST',
data: params
})
return res[1].data;
},
async qryCustomerList(params = {}) {
let res = await uni.request({
url: '/customer/app/list',
method: 'POST',
data: params,
header: {
pageNum: params.pageNum,
pageSize: params.pageSize
}
})
return res[1].data;
} }
} }

View File

@ -32,6 +32,8 @@
"path": "my-address" "path": "my-address"
}, { }, {
"path": "edit-address" "path": "edit-address"
}, {
"path": "apply-operator"
}, { }, {
"path": "my-team-member" "path": "my-team-member"
}, { }, {

View File

@ -228,7 +228,7 @@
</view> </view>
</view> </view>
<!-- 后台入口 --> <!-- 后台入口 -->
<!-- <view class="bg-white padding-lr padding-bottom"> <view class="bg-white padding-lr padding-bottom">
<view class="cu-bar margin-top-sm solid-bottom"> <view class="cu-bar margin-top-sm solid-bottom">
<view class="action bar-first-action"> <view class="action bar-first-action">
<view class="cuIcon-titles text-main-color"></view> <view class="cuIcon-titles text-main-color"></view>
@ -236,21 +236,21 @@
</view> </view>
</view> </view>
<view class="cu-list grid no-border col-4"> <view class="cu-list grid no-border col-4">
<view class="cu-item"> <!-- <view class="cu-item">
<view class="cuIcon-brandfill text-mauve"></view> <view class="cuIcon-brandfill text-mauve"></view>
<text>商家注册</text> <text>商家注册</text>
</view> </view> -->
<view class="cu-item" @click="showApplyOperator"> <view class="cu-item" @click="showApplyOperator">
<view class="cuIcon-wenzi text-pink"></view> <view class="cuIcon-wenzi text-pink"></view>
<text>运营商申请</text> <text>运营商申请</text>
</view> </view>
<view class="cu-item"> <!-- <view class="cu-item">
<view class="cuIcon-searchlist text-brown"></view> <view class="cuIcon-searchlist text-brown"></view>
<text>后台数据</text> <text>后台数据</text>
</view>
</view>
</view> --> </view> -->
</view> </view>
</view>
</view>
<!-- app二维码分享 --> <!-- app二维码分享 -->
<view class="cu-modal" :class="appShareQrcodeModal?'show':''"> <view class="cu-modal" :class="appShareQrcodeModal?'show':''">
@ -367,26 +367,34 @@
}); });
}, },
showApplyOperator() { showApplyOperator() {
this.curUserInfo = this.$request.getCurUserInfo();
//
if (this.curUserInfo.placeStatus == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/my/apply-operator' url: '/pages/my/apply-operator'
}) })
} else if (this.curUserInfo.placeStatus == 2) {
uni.navigateTo({
url: '/pages/my/my-team-member'
})
} else {
uni.showToast({
icon: 'none',
title: '申请审核中'
})
}
}, },
async showAppInviteQrcode() { async showAppInviteQrcode() {
this.curUserInfo = this.$request.getCurUserInfo();
// //
if (this.curUserInfo.placeStatus == 1) { if (this.curUserInfo.placeStatus == 1) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '审核中' title: '申请审核中'
}) })
} else if (this.curUserInfo.placeStatus != 2) { } else if (this.curUserInfo.placeStatus != 2) {
await this.$request.updateUser({ uni.navigateTo({
customerId: this.curUserInfo.customerId, url: '/pages/my/apply-operator'
placeStatus: 1
});
this.curUserInfo = this.$request.getCurUserInfo();
uni.showToast({
icon: 'none',
title: '已提交进行分销审核'
}) })
} else { } else {
// //

View File

@ -55,21 +55,28 @@
</view> </view>
<form @submit="submit"> <form @submit="submit">
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">您的姓名</view> <view class="title">您的姓名<text class="text-red">*</text></view>
<input name="name" placeholder="请输入姓名"></input> <input name="name" placeholder="请输入姓名"></input>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">注册电话</view> <view class="title">注册电话<text class="text-red">*</text></view>
<input name="phone" placeholder="请输入手机号"></input> <input name="phone" placeholder="请输入手机号" v-model="formData.phone"></input>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">申请城市</view> <view class="title">申请城市<text class="text-red">*</text></view>
<input name="city" placeholder="请输入城市名"></input> <picker :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange" :value="multiIndex" :range-key="'areaName'" :range="areaList">
<view class="picker">
{{formData.area && formData.area.length ? formData.area[0].areaName + '-' + formData.area[1].areaName : '请选择'}}
</view>
</picker>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">验证码</view> <view class="title">验证码<text class="text-red">*</text></view>
<input name="identifyCode" placeholder="请输入验证码"></input> <input class="radius-input" type="number" name="code" placeholder="请输入验证码"></input>
<button class='cu-btn bg-main-color shadow' @click="getPhoneVertifyNum">获取验证码</button> <view v-if="countDownNum === 0" class="cu-btn bg-blue round-btn margin-left-xs shadow-blur" @click="sendVertifyCode">发送验证码
</view>
<view v-else class="cu-btn bg-gray round-btn margin-left-sm shadow-blur">已发送({{countDownNum}})
</view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">关联信息</view> <view class="title">关联信息</view>
@ -77,7 +84,7 @@
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view> <view>
<checkbox style="transform:scale(0.7)" class="main-color" :value="agreeContract" :checked="agreeContract" <checkbox style="transform:scale(0.7)" class="main-color" :value="formData.agreeContract" :checked="formData.agreeContract"
@click="changeAgreeContract"> @click="changeAgreeContract">
</checkbox> </checkbox>
<text class="margin-left-xs" @click="showContract">合同同意书链接</text> <text class="margin-left-xs" @click="showContract">合同同意书链接</text>
@ -96,47 +103,119 @@
export default { export default {
data() { data() {
return { return {
curUserInfo: {},
areaList: [],
multiIndex: [0, 0],
countDownNum: 0,
formData: {
operatorType: '', operatorType: '',
agreeContract: false agreeContract: false,
area: null
},
} }
}, },
onLoad() {
this.loadData();
},
methods: { methods: {
loadData() {
this.curUserInfo = this.$request.getCurUserInfo();
this.loadAreaList();
},
changeOperatorType(e) { changeOperatorType(e) {
this.operatorType = e.detail.value; this.formData.operatorType = e.detail.value;
}, },
changeAgreeContract() { changeAgreeContract() {
this.agreeContract = !this.agreeContract; this.formData.agreeContract = !this.formData.agreeContract;
}, },
showContract() { showContract() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/my/contract' url: '/pages/my/contract'
}) })
}, },
getPhoneVertifyNum() { async loadAreaList() {
let areaList = await this.$request.areaListByStep();
areaList = areaList.data;
let col1Code = areaList[0].areaCode;
let subAreaList = await this.$request.areaListByStep({ parentCode: col1Code });
subAreaList = subAreaList.data;
// let col2Code = subAreaList[0].areaCode;
// let subSubAreaList = await this.$request.areaListByStep({ parentCode: col2Code });
// subSubAreaList = subSubAreaList.data;
this.areaList.push(areaList);
this.areaList.push(subAreaList);
// this.areaList.push(subSubAreaList);
},
regionChange(e) {
this.multiIndex = e.detail.value;
let chosenArea = [];
for(let i = 0; i < this.areaList.length; i++) {
chosenArea.push(this.areaList[i][this.multiIndex[i]]);
}
this.formData.area = chosenArea;
},
async regionColChange(e) {
let colObj = e.detail;
if (colObj.column == 0) {
let subSubAreaList = [];
//
let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[0][colObj.value].areaCode});
subAreaList = subAreaList.data;
this.areaList.pop();
this.areaList.push(subAreaList);
this.multiIndex = [colObj.value, 0];
}
},
startCountDownNum() {
this.countDownNum = 180;
let t = setInterval(() => {
this.countDownNum -= 1;
if (this.countDownNum === 0) {
clearInterval(t);
}
}, 1000);
},
async sendVertifyCode() {
console.log(this.formData)
if (this.$validate.validContactNum(this.formData.phone)) {
let res = await this.$request.sendVertifyCode({
to: this.formData.phone
});
if (res && res.code === 0) {
uni.showToast({ uni.showToast({
title: '功能开发中,暂无法使用', icon: 'none',
icon: 'none' title: '验证码已发送'
}) })
this.startCountDownNum();
} else if (res && res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} else {
uni.showToast({
icon: 'none',
title: '验证码发送失败'
})
}
} else {
uni.showToast({
icon: 'none',
title: '请正确输入手机号码'
})
}
}, },
validateForm(confirmFormData) { validateForm(confirmFormData) {
let formInfoValid = Boolean(confirmFormData.name) && let formInfoValid = Boolean(confirmFormData.name) &&
Boolean(confirmFormData.phone) && Boolean(confirmFormData.phone) &&
Boolean(confirmFormData.city) && Boolean(confirmFormData.area) &&
Boolean(confirmFormData.identifyCode) && Boolean(confirmFormData.code);
Boolean(confirmFormData.comments);
if (!formInfoValid) { if (!formInfoValid) {
uni.showToast({ uni.showToast({
title: '请填写完整信息', title: '请填写完整信息',
icon: 'none', icon: 'none',
mask: true mask: true
}) })
} else if (!Boolean(confirmFormData.operatorType)) {
uni.showToast({
title: '请选择入驻运营商类型',
icon: 'none',
mask: true
});
formInfoValid = false;
} else if (!confirmFormData.agreeContract) { } else if (!confirmFormData.agreeContract) {
uni.showToast({ uni.showToast({
title: '请阅读并同意合同书', title: '请阅读并同意合同书',
@ -147,25 +226,39 @@
} }
return formInfoValid; return formInfoValid;
}, },
submit(e) { async submit(e) {
let formData = e.detail.value; let formData = {
formData.operatorType = this.operatorType; ...e.detail.value,
formData.agreeContract = this.agreeContract; ...this.formData,
city: this.formData.area && this.formData.area.length ? this.formData.area[this.formData.area.length - 1].areaId : null,
customerId: this.curUserInfo.customerId
}
let formValid = this.validateForm(formData); let formValid = this.validateForm(formData);
console.log(formData);
if (formValid) { if (formValid) {
// uni.showToast({ let res = await this.$request.addCustomerPlace(formData);
// title: '', if (res && res.code === 0) {
// icon: 'success', await this.$request.refreshCurUserCache();
// mask: true uni.navigateBack({
// }) delta: -1
// uni.navigateTo({
// url: '/pages/my/my-operator'
// })
uni.showToast({
title: '功能开发中,暂无法使用',
icon: 'none'
}) })
uni.showToast({
title: '提交成功',
icon: 'success',
duration: 2000
})
} else if (res && res.msg) {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: '提交失败',
icon: 'error',
duration: 2000
})
}
} }
} }
} }

View File

@ -3,16 +3,23 @@
<!-- 顶部操作条 --> <!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true"> <cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block> <block slot="backText">返回</block>
<block slot="content">查看团队{{myOperaMembers.totalMembers}}</block> <block slot="content">查看团队{{totalMembers}}</block>
</cu-custom> </cu-custom>
<!-- 团队成员信息 --> <!-- 团队成员信息 -->
<view class="margin-top-sm margin-lr-sm padding bg-white name-card shadow-warp" v-for="(member, index) in myOperaMembers.members"> <view class="margin-top-sm margin-lr-sm padding bg-white name-card shadow-warp" v-for="(member, index) in members">
<!-- 个人名片 --> <!-- 个人名片 -->
<horizontal-name-card :avatarWidth="'130rpx'" :avatarHeight="'130rpx'" :avatarPubClass="'round'" <view class="flex justify-start">
:vCard="member"></horizontal-name-card> <view class="cu-avatar round" :style="'background-image:url(' + member.customerLogoUrl + '); width: 130rpx; height: 130rpx;'"></view>
<view class="margin-left-sm flex-column-around">
<view class="text-black text-xl">{{member.name}}</view>
<view class="">
<text class="margin-right-xs">角色合伙人</text>
</view>
</view>
</view>
<!-- 实名及公告图标 --> <!-- 实名及公告图标 -->
<view class="flex justify-end oper-bar"> <view class="flex justify-end oper-bar">
<view class="text-center margin-right-sm" @click="showCertificationForm"> <view class="text-center margin-right-sm text-orange" @click="makePhoneCall(member.phone)">
<view class="cuIcon-phone"></view> <view class="cuIcon-phone"></view>
</view> </view>
</view> </view>
@ -45,19 +52,26 @@
</view> </view>
</view> </view>
</view> </view>
<load-status-bar class="margin-tb-xl" ref="loadStatusBar" @loadMore="loadMyOperaMembers"></load-status-bar>
</view> </view>
</template> </template>
<script> <script>
import horizontalNameCard from '@/components/common-card/horizontal-name-card.vue'; import horizontalNameCard from '@/components/common-card/horizontal-name-card.vue';
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
export default { export default {
components: { components: {
horizontalNameCard horizontalNameCard,
loadStatusBar
}, },
data() { data() {
return { return {
myOperaMembers: {} totalMembers: 0,
members: [],
curUserInfo: {},
pageNum: 0,
pageSize: 0
} }
}, },
onLoad() { onLoad() {
@ -65,7 +79,42 @@
}, },
methods: { methods: {
async loadData() { async loadData() {
this.myOperaMembers = await this.$api.data('myOperaMembers'); this.curUserInfo = this.$request.getCurUserInfo();
this.resetData();
// this.myOperaMembers = await this.$api.data('myOperaMembers');
this.loadMyOperaMembers();
},
resetData() {
this.pageNum = this.$globalData.initPageNum;
this.pageSize = this.$globalData.initPageSize;
},
makePhoneCall(phoneNum) {
uni.makePhoneCall({
phoneNumber: phoneNum
})
},
async loadMyOperaMembers(params = {}) {
params.pageNum = this.pageNum;
params.pageSize = this.pageSize;
params.customerPlace = this.curUserInfo.customerId;
this.$refs.loadStatusBar.showLoading();
try {
let res = await this.$request.qryCustomerList(params);
let rowsLength = res.rows.length;
if (rowsLength > 0) {
this.members = this.members.concat(res.rows);
this.totalMembers = res.total;
this.pageNum++;
if (rowsLength === this.pageSize) {
this.$refs.loadStatusBar.showLoadMore();
return;
}
}
this.$refs.loadStatusBar.showLoadOver();
} catch (e) {
console.error(e)
this.$refs.loadStatusBar.showLoadErr();
}
} }
} }
} }
@ -80,6 +129,6 @@
position: absolute; position: absolute;
top: 20rpx; top: 20rpx;
right: 20rpx; right: 20rpx;
font-size: 40rpx; font-size: 50rpx;
} }
</style> </style>