增加运营商申请,二维码分享申请跳转至运营商申请(分销申请`)
This commit is contained in:
parent
0a40ca57bd
commit
c02dc1ac5a
|
|
@ -259,6 +259,10 @@ export default {
|
|||
let userProfile = uni.getStorageSync('userProfile');
|
||||
return userProfile;
|
||||
},
|
||||
async refreshCurUserCache() {
|
||||
let newUserInfo = await this.getCurUserNoCache();
|
||||
uni.setStorageSync('userProfile', newUserInfo);
|
||||
},
|
||||
async getCurUserNoCache() {
|
||||
let userInfo = this.getCurUserInfo();
|
||||
let wxGetUserRes = await this.qryUserInfo(userInfo.openId);
|
||||
|
|
@ -525,5 +529,33 @@ export default {
|
|||
data: params
|
||||
})
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
"path": "my-address"
|
||||
}, {
|
||||
"path": "edit-address"
|
||||
}, {
|
||||
"path": "apply-operator"
|
||||
}, {
|
||||
"path": "my-team-member"
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@
|
|||
</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="action bar-first-action">
|
||||
<view class="cuIcon-titles text-main-color"></view>
|
||||
|
|
@ -236,21 +236,21 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="cu-list grid no-border col-4">
|
||||
<view class="cu-item">
|
||||
<!-- <view class="cu-item">
|
||||
<view class="cuIcon-brandfill text-mauve"></view>
|
||||
<text>商家注册</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="cu-item" @click="showApplyOperator">
|
||||
<view class="cuIcon-wenzi text-pink"></view>
|
||||
<text>运营商申请</text>
|
||||
</view>
|
||||
<view class="cu-item">
|
||||
<!-- <view class="cu-item">
|
||||
<view class="cuIcon-searchlist text-brown"></view>
|
||||
<text>后台数据</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- app二维码分享 -->
|
||||
<view class="cu-modal" :class="appShareQrcodeModal?'show':''">
|
||||
|
|
@ -367,26 +367,34 @@
|
|||
});
|
||||
},
|
||||
showApplyOperator() {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
// 判断当前用户的是否已提交分销资格申请
|
||||
if (this.curUserInfo.placeStatus == 0) {
|
||||
uni.navigateTo({
|
||||
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() {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
// 判断当前用户的是否已通过分销资格审核
|
||||
if (this.curUserInfo.placeStatus == 1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '审核中'
|
||||
title: '申请审核中'
|
||||
})
|
||||
} else if (this.curUserInfo.placeStatus != 2) {
|
||||
await this.$request.updateUser({
|
||||
customerId: this.curUserInfo.customerId,
|
||||
placeStatus: 1
|
||||
});
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '已提交进行分销审核'
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/apply-operator'
|
||||
})
|
||||
} else {
|
||||
// 判断是否有绑定银行信息
|
||||
|
|
|
|||
|
|
@ -55,21 +55,28 @@
|
|||
</view>
|
||||
<form @submit="submit">
|
||||
<view class="cu-form-group">
|
||||
<view class="title">您的姓名</view>
|
||||
<view class="title">您的姓名<text class="text-red">*</text></view>
|
||||
<input name="name" placeholder="请输入姓名"></input>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="title">注册电话</view>
|
||||
<input name="phone" placeholder="请输入手机号"></input>
|
||||
<view class="title">注册电话<text class="text-red">*</text></view>
|
||||
<input name="phone" placeholder="请输入手机号" v-model="formData.phone"></input>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="title">申请城市</view>
|
||||
<input name="city" placeholder="请输入城市名"></input>
|
||||
<view class="title">申请城市<text class="text-red">*</text></view>
|
||||
<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 class="cu-form-group">
|
||||
<view class="title">验证码</view>
|
||||
<input name="identifyCode" placeholder="请输入验证码"></input>
|
||||
<button class='cu-btn bg-main-color shadow' @click="getPhoneVertifyNum">获取验证码</button>
|
||||
<view class="title">验证码<text class="text-red">*</text></view>
|
||||
<input class="radius-input" type="number" name="code" placeholder="请输入验证码"></input>
|
||||
<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 class="cu-form-group">
|
||||
<view class="title">关联信息</view>
|
||||
|
|
@ -77,7 +84,7 @@
|
|||
</view>
|
||||
<view class="cu-form-group">
|
||||
<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">
|
||||
</checkbox>
|
||||
<text class="margin-left-xs" @click="showContract">合同同意书链接</text>
|
||||
|
|
@ -96,47 +103,119 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
curUserInfo: {},
|
||||
areaList: [],
|
||||
multiIndex: [0, 0],
|
||||
countDownNum: 0,
|
||||
formData: {
|
||||
operatorType: '',
|
||||
agreeContract: false
|
||||
agreeContract: false,
|
||||
area: null
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.loadAreaList();
|
||||
},
|
||||
changeOperatorType(e) {
|
||||
this.operatorType = e.detail.value;
|
||||
this.formData.operatorType = e.detail.value;
|
||||
},
|
||||
changeAgreeContract() {
|
||||
this.agreeContract = !this.agreeContract;
|
||||
this.formData.agreeContract = !this.formData.agreeContract;
|
||||
},
|
||||
showContract() {
|
||||
uni.navigateTo({
|
||||
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({
|
||||
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) {
|
||||
let formInfoValid = Boolean(confirmFormData.name) &&
|
||||
Boolean(confirmFormData.phone) &&
|
||||
Boolean(confirmFormData.city) &&
|
||||
Boolean(confirmFormData.identifyCode) &&
|
||||
Boolean(confirmFormData.comments);
|
||||
Boolean(confirmFormData.area) &&
|
||||
Boolean(confirmFormData.code);
|
||||
if (!formInfoValid) {
|
||||
uni.showToast({
|
||||
title: '请填写完整信息',
|
||||
icon: 'none',
|
||||
mask: true
|
||||
})
|
||||
} else if (!Boolean(confirmFormData.operatorType)) {
|
||||
uni.showToast({
|
||||
title: '请选择入驻运营商类型',
|
||||
icon: 'none',
|
||||
mask: true
|
||||
});
|
||||
formInfoValid = false;
|
||||
} else if (!confirmFormData.agreeContract) {
|
||||
uni.showToast({
|
||||
title: '请阅读并同意合同书',
|
||||
|
|
@ -147,25 +226,39 @@
|
|||
}
|
||||
return formInfoValid;
|
||||
},
|
||||
submit(e) {
|
||||
let formData = e.detail.value;
|
||||
formData.operatorType = this.operatorType;
|
||||
formData.agreeContract = this.agreeContract;
|
||||
async submit(e) {
|
||||
let formData = {
|
||||
...e.detail.value,
|
||||
...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);
|
||||
console.log(formData);
|
||||
if (formValid) {
|
||||
// uni.showToast({
|
||||
// title: '保存成功',
|
||||
// icon: 'success',
|
||||
// mask: true
|
||||
// })
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/my/my-operator'
|
||||
// })
|
||||
uni.showToast({
|
||||
title: '功能开发中,暂无法使用',
|
||||
icon: 'none'
|
||||
let res = await this.$request.addCustomerPlace(formData);
|
||||
if (res && res.code === 0) {
|
||||
await this.$request.refreshCurUserCache();
|
||||
uni.navigateBack({
|
||||
delta: -1
|
||||
})
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,16 +3,23 @@
|
|||
<!-- 顶部操作条 -->
|
||||
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">查看团队({{myOperaMembers.totalMembers}})</block>
|
||||
<block slot="content">查看团队({{totalMembers}})</block>
|
||||
</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'"
|
||||
:vCard="member"></horizontal-name-card>
|
||||
<view class="flex justify-start">
|
||||
<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="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>
|
||||
</view>
|
||||
|
|
@ -45,19 +52,26 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<load-status-bar class="margin-tb-xl" ref="loadStatusBar" @loadMore="loadMyOperaMembers"></load-status-bar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import horizontalNameCard from '@/components/common-card/horizontal-name-card.vue';
|
||||
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
horizontalNameCard
|
||||
horizontalNameCard,
|
||||
loadStatusBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
myOperaMembers: {}
|
||||
totalMembers: 0,
|
||||
members: [],
|
||||
curUserInfo: {},
|
||||
pageNum: 0,
|
||||
pageSize: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
|
@ -65,7 +79,42 @@
|
|||
},
|
||||
methods: {
|
||||
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;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
font-size: 40rpx;
|
||||
font-size: 50rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue