登录,获取手机号,帐号绑定,实名校验及弹窗

This commit is contained in:
donqi 2022-07-08 23:56:55 +08:00
parent 02a8f31e16
commit 25cd0d0fe9
14 changed files with 469 additions and 149 deletions

View File

@ -2,7 +2,7 @@ export default {
deptId: 101, deptId: 101,
from: 'server', from: 'server',
initPageNum: 1, initPageNum: 1,
initPageSize: 20, initPageSize: 1,
timeRangeList: [ timeRangeList: [
'08:00-08:30', '08:00-08:30',
'08:30-09:00', '08:30-09:00',

View File

@ -27,6 +27,7 @@
<script> <script>
export default { export default {
name: "module-bar", name: "module-bar",
emits: ['getCurPageInfo'],
props: { props: {
moduleBarInfos: { moduleBarInfos: {
type: Array, type: Array,
@ -48,13 +49,13 @@
navChange(e, isChangeFocus) { navChange(e, isChangeFocus) {
let cur = e.currentTarget.dataset.cur; let cur = e.currentTarget.dataset.cur;
this.curPageCode = isChangeFocus ? cur : this.curPageCode; this.curPageCode = isChangeFocus ? cur : this.curPageCode;
uni.$emit('getCurPageInfo', { this.$emit('getCurPageInfo', {
curPageCode: cur curPageCode: cur
}); });
}, },
navChangeByCode(curPageCode, isChangeFocus) { navChangeByCode(curPageCode, isChangeFocus) {
this.curPageCode = isChangeFocus ? curPageCode : this.curPageCode; this.curPageCode = isChangeFocus ? curPageCode : this.curPageCode;
uni.$emit('getCurPageInfo', { this.$emit('getCurPageInfo', {
curPageCode: curPageCode curPageCode: curPageCode
}); });
} }

View File

@ -0,0 +1,47 @@
<template>
<view>
<!-- 模态框 -->
<view class="cu-modal" :class="isShow?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view class="cuIcon-pay big-icon padding-tb text-main-color"></view>
<view>您还未完成账户绑定</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showTakeCertifiedModal"
@tap="hideModal">以后绑定</view>
<view class="action margin-0 flex-sub text-main-color solid-left"
data-modal="showTakeCertifiedModal" @tap="hideModal" @click="goToBindBank">立即绑定</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'vertify-bank-bind',
emits: ['reload'],
data() {
return {
isShow: false
}
},
methods: {
showModal(e) {
this.isShow = true
},
hideModal(e) {
this.isShow = false;
},
goToBindBank() {
uni.navigateTo({
url: '/pages/my/bank-account-bind'
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,47 @@
<template>
<view>
<!-- 模态框 -->
<view class="cu-modal" :class="isShow?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view class="cuIcon-profile big-icon padding-tb text-main-color"></view>
<view>您还未进行实名认证</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showTakeCertifiedModal"
@tap="hideModal">以后认证</view>
<view class="action margin-0 flex-sub text-main-color solid-left"
data-modal="showTakeCertifiedModal" @tap="hideModal" @click="goToCertify">立即认证</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'vertify-certify',
emits: ['reload'],
data() {
return {
isShow: false
}
},
methods: {
showModal(e) {
this.isShow = true
},
hideModal(e) {
this.isShow = false;
},
goToCertify() {
uni.navigateTo({
url: '/pages/my/certification'
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,49 @@
<template>
<view>
<!-- 模态框 -->
<view class="cu-modal" :class="isShow?'show':''">
<view class="cu-dialog">
<view class="padding-xl text-left">
<view>需先授权微信登录才可正常使用功能小程序将获取并使用以下信息</view>
<view>1.微信昵称</view>
<view>2.微信头像</view>
</view>
<view class="cu-bar bg-white">
<navigator class="modal-bottom-oper margin-0 flex-sub text-black" open-type="exit" target="miniProgram">拒绝授权
</navigator>
<view class="modal-bottom-oper margin-0 flex-sub text-main-color solid-left" @tap="confirm">确认授权</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'vertify-login',
emits: ['reload'],
data() {
return {
isShow: false
}
},
methods: {
showModal(e) {
this.isShow = true
},
hideModal(e) {
this.isShow = false;
},
confirm(e) {
this.$request.login().then(res => {
if (res) {
this.$emit('reload');
}
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,50 @@
<template>
<view>
<!-- 模态框 -->
<view class="cu-modal" :class="isShow?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view>授予小程序绑定微信手机号码的权限</view>
</view>
<view class="cu-bar bg-white">
<navigator class="modal-bottom-oper margin-0 flex-sub text-black solid-right" open-type="exit" target="miniProgram">拒绝授权
</navigator>
<view class="margin-0 flex-sub">
<button class="margin-0 flex-sub cu-btn bg-white text-main-color"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">确认授权</button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'vertify-phone',
emits: ['reload'],
data() {
return {
isShow: false
}
},
methods: {
showModal(e) {
this.isShow = true
},
hideModal(e) {
this.isShow = false;
},
getPhoneNumber(e) {
this.$request.storagePhoneIntoUserInfo(e.detail.code).then(res => {
if (res) {
this.$emit('reload');
}
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,63 @@
<template>
<view>
<!-- 模态框 -->
<view class="cu-modal" :class="isShow?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view class="cuIcon-discover big-icon padding-tb text-main-color"></view>
<view>请您选择入驻类型到家服务类请选择-服务商商品销售类请选择-配件商</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-black" data-modal="isShowSteer" @click="chooseEntryType(1)">配件商
</view>
<view class="action margin-0 flex-sub text-main-color solid-left"
data-modal="isShowSteer" @click="chooseEntryType(0)">服务商</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'vertify-worker-type',
data() {
return {
isShow: false
}
},
methods: {
showModal(e) {
this.isShow = true
},
hideModal(e) {
this.isShow = false;
},
async chooseEntryType(typeCode) {
let status = 1;
if (typeCode === 1) {
status = 0;
}
let res = await this.$request.updateWorker({
type: typeCode,
status: status
});
if (res && res.code === 0) {
this.hideModal();
if (typeCode === 1) {
uni.navigateTo({
url: '/pages/index/index?menuCode=supplyChainPage'
})
} else if (typeCode === 0) {
uni.navigateTo({
url: '/pages/my/master-settled-info'
})
}
}
}
}
}
</script>
<style>
</style>

11
main.js
View File

@ -10,9 +10,20 @@ import dateUtil from './common/js/dateUtil.js';
import commonFun from './common/js/commonFun.js'; import commonFun from './common/js/commonFun.js';
import request from './common/js/request.js'; import request from './common/js/request.js';
import globalData from './common/js/globalData.js'; import globalData from './common/js/globalData.js';
import vertifyLogin from '@/components/vertify/vertify-login.vue';
import vertifyPhone from '@/components/vertify/vertify-phone.vue';
import vertifyCertify from '@/components/vertify/vertify-certify.vue';
import vertifyWorkerType from '@/components/vertify/vertify-worker-type.vue';
import vertifyBankBind from '@/components/vertify/vertify-bank-bind.vue';
Vue.component('cu-custom', CuCustom) Vue.component('cu-custom', CuCustom)
Vue.component('confirm-modal', ConfirmModal); Vue.component('confirm-modal', ConfirmModal);
Vue.component('vertify-login', vertifyLogin);
Vue.component('vertify-phone', vertifyPhone);
Vue.component('vertify-certify', vertifyCertify);
Vue.component('vertify-worker-type', vertifyWorkerType);
Vue.component('vertify-bank-bind', vertifyBankBind);
const data = type => { const data = type => {
//模拟异步请求数据 //模拟异步请求数据
return new Promise(resolve => { return new Promise(resolve => {

View File

@ -179,6 +179,9 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 账户及实名弹窗 -->
<vertify-bank-bind ref="vertifyBankBind"></vertify-bank-bind>
<vertify-certify ref="vertifyCertify"></vertify-certify>
</view> </view>
</template> </template>
@ -263,7 +266,9 @@
chosenArea: [], chosenArea: [],
categoryList: [], categoryList: [],
categoryMultiIndex: [0, 0, 0], categoryMultiIndex: [0, 0, 0],
chosenCategory: [] chosenCategory: [],
bankCard: null,
certifyInfo: null
} }
}, },
onShow() { onShow() {
@ -271,8 +276,9 @@
}, },
methods: { methods: {
async loadData() { async loadData() {
// this.tasks = await this.$api.data('tasks');
this.curUserInfo = this.$request.getCurUserInfo(); this.curUserInfo = this.$request.getCurUserInfo();
this.checkBankAndCertify();
// this.tasks = await this.$api.data('tasks');
this.reloadMasterOrderPage(); this.reloadMasterOrderPage();
// this.takeCertify = await this.$api.data('takeCertify'); // this.takeCertify = await this.$api.data('takeCertify');
// this.areaList = await this.$api.data('areaList'); // this.areaList = await this.$api.data('areaList');
@ -280,6 +286,24 @@
this.loadCategoryList(); this.loadCategoryList();
this.loadRegionList(); this.loadRegionList();
}, },
async checkBankAndCertify() {
//
let bankCardRes = await this.$request.getBindBankCardByWorkerId({
workerId: this.curUserInfo.workerId
});
this.bankCard = bankCardRes.data;
//
let certifyInfoRes = await this.$request.getWorkerCertify();
this.certifyInfo = certifyInfoRes.data;
if (!this.bankCard || !this.bankCard.bankNum) {
this.$refs.vertifyBankBind.showModal();
return false;
} else if (!this.certifyInfo || !this.certifyInfo.workerCertificationId) {
this.$refs.vertifyCertify.showModal();
return false;
}
return true;
},
async loadMasterOrderPage(params = {}) { async loadMasterOrderPage(params = {}) {
params.pageSize = this.$globalData.initPageSize; params.pageSize = this.$globalData.initPageSize;
params.pageNum = this.pageNum; params.pageNum = this.pageNum;
@ -306,7 +330,7 @@
this.tasks = this.tasks.concat(res.rows); this.tasks = this.tasks.concat(res.rows);
// this.pageParams[this.tabCur].pageNum++; // this.pageParams[this.tabCur].pageNum++;
this.pageNum++; this.pageNum++;
if (rowsLength === this.pageSize) { if (rowsLength === params.pageSize) {
this.$refs.loadStatusBar.showLoadMore(); this.$refs.loadStatusBar.showLoadMore();
return; return;
} }
@ -473,6 +497,11 @@
}) })
}, },
async takeTask(e, task) { async takeTask(e, task) {
let checkRes = await this.checkBankAndCertify();
if (!checkRes) {
return;
}
if (this.curUserInfo.status !== 0 || this.curUserInfo.type !== 0) { if (this.curUserInfo.status !== 0 || this.curUserInfo.type !== 0) {
// //
e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal; e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal;

View File

@ -9,7 +9,8 @@
:style="'width: 120rpx; height: 120rpx; background-image:url(' + curUserInfo.bannerUrl + ');'"> :style="'width: 120rpx; height: 120rpx; background-image:url(' + curUserInfo.bannerUrl + ');'">
</view> </view>
<view class="margin-lr-sm"> <view class="margin-lr-sm">
<view class="text-xl margin-bottom-xs">{{curUserInfo.deptName}}</view> <view class="text-xl margin-bottom-xs" v-if="curUserInfo && curUserInfo.openId">{{curUserInfo.deptName}}</view>
<view class="text-xl margin-bottom-xs" v-else @click="authLogin">请先登录</view>
<!-- <view class="padding-xs text-sm"> <!-- <view class="padding-xs text-sm">
<view class='cu-tag bg-white radius'>编辑</view> <view class='cu-tag bg-white radius'>编辑</view>
</view> --> </view> -->
@ -20,15 +21,15 @@
<!-- 未预约未派单上门超时 --> <!-- 未预约未派单上门超时 -->
<view class="cu-list grid no-border col-3 margin-top-sm" style="background-color: inherit;"> <view class="cu-list grid no-border col-3 margin-top-sm" style="background-color: inherit;">
<view class="cu-item"> <view class="cu-item">
<view class="margin-bottom-xs text-xxl">{{myInfo.order.noReservation}}</view> <view class="margin-bottom-xs text-xxl">0</view>
<view>未预约</view> <view>未预约</view>
</view> </view>
<view class="cu-item"> <view class="cu-item">
<view class="margin-bottom-xs text-xxl">{{myInfo.order.noSchedule}}</view> <view class="margin-bottom-xs text-xxl">0</view>
<view>未排单</view> <view>未排单</view>
</view> </view>
<view class="cu-item"> <view class="cu-item">
<view class="margin-bottom-xs text-xxl">{{myInfo.order.onsiteTimeout}}</view> <view class="margin-bottom-xs text-xxl">0</view>
<view>上门超时</view> <view>上门超时</view>
</view> </view>
</view> </view>
@ -47,7 +48,7 @@
</view> </view>
</view> </view>
<!-- 轮播 --> <!-- 轮播 -->
<swiper class="screen-swiper" :autoplay="true" :circular="true"> <swiper v-if="curUserInfo && curUserInfo.workerId" class="screen-swiper" :autoplay="true" :circular="true">
<swiper-item v-for="(item,index) in myInfo.order.onsiteToday" :key="index"> <swiper-item v-for="(item,index) in myInfo.order.onsiteToday" :key="index">
<view class="padding-sm"> <view class="padding-sm">
<view class="flex justify-between align-center margin-bottom-xs"> <view class="flex justify-between align-center margin-bottom-xs">
@ -58,9 +59,12 @@
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view v-else class="screen-swiper padding text-center">
未登录
</view>
</view> </view>
<!-- 每周公告 --> <!-- 每周公告 -->
<view class="padding bg-white shadow-warp margin-top-sm"> <view class="padding bg-white shadow-warp margin-top-sm" v-if="curUserInfo && curUserInfo.workerId">
<view class="flex justify-between align-center"> <view class="flex justify-between align-center">
<view class=""> <view class="">
<text class="text-main-color">[每周公告]</text> <text class="text-main-color">[每周公告]</text>
@ -76,81 +80,22 @@
<view class="margin-lr-sm margin-top"> <view class="margin-lr-sm margin-top">
<view class="text-lg">服务中心</view> <view class="text-lg">服务中心</view>
<view class="nav-list-panel float-clear clearfix"> <view class="nav-list-panel float-clear clearfix">
<navigator hover-class="none" :url="item.pageUrl" class="nav-li" navigateTo <view hover-class="none" class="nav-li serv-module" @click="clickServModule(item)"
:class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]" :class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]"
v-for="(item,index) in servModules " :key="index"> v-for="(item,index) in servModules " :key="index">
<view :class="index === 0 ? 'text-xxl' : 'text-xl'">{{item.title}}</view> <view :class="index === 0 ? 'text-xxl' : 'text-xl'">{{item.title}}</view>
<!-- <view class="nav-name">{{item.name}}</view> --> <!-- <view class="nav-name">{{item.name}}</view> -->
<text :class="'cuIcon-' + item.cuIcon"></text> <text :class="'cuIcon-' + item.cuIcon"></text>
</navigator> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 首页引导 --> <!-- 首页引导 -->
<view class="cu-modal" :class="isShowSteer?'show':''"> <vertify-worker-type ref="vertifyWorkerType"></vertify-worker-type>
<view class="cu-dialog"> <!-- 登录校验弹窗 -->
<view class="padding-xl"> <vertify-login ref="vertifyLogin" @reload="authLogin"></vertify-login>
<view class="cuIcon-discover big-icon padding-tb text-main-color"></view> <vertify-phone ref="vertifyPhone" @reload="authLogin"></vertify-phone>
<view>请您选择入驻类型到家服务类请选择-服务商商品销售类请选择-配件商</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-black" @tap="hideModal" data-modal="isShowSteer" @click="chooseEntryType(1)">配件商
</view>
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
data-modal="isShowSteer" @click="chooseEntryType(0)">服务商</view>
</view>
</view>
</view>
<!-- 接单认证模态框 -->
<view class="cu-modal" :class="showTakeCertifiedModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view class="cuIcon-profile big-icon padding-tb text-main-color"></view>
<view>您还未进行认证</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="showTakeCertifiedModal"
@tap="hideModal">以后认证</view>
<view class="action margin-0 flex-sub text-main-color solid-left"
data-modal="showTakeCertifiedModal" @tap="hideModal" @click="chooseEntryType(0)">立即认证</view>
</view>
</view>
</view>
<!-- 强制要求用户授权登录的弹窗 -->
<view class="cu-modal" :class="isAuthWxLoginModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl text-left">
<view>需先授权微信登录才可正常使用功能小程序将获取并使用以下信息</view>
<view>1.微信昵称</view>
<view>2.微信头像</view>
</view>
<view class="cu-bar bg-white">
<navigator class="modal-bottom-oper margin-0 flex-sub text-black" open-type="exit"
target="miniProgram">拒绝授权
</navigator>
<view class="modal-bottom-oper margin-0 flex-sub text-main-color solid-left" @tap="authWxLogin">确认授权
</view>
</view>
</view>
</view>
<!-- 手机号授予 -->
<view class="cu-modal" :class="isAuthWxPhoneModal?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<view>授予小程序绑定微信手机号码的权限</view>
</view>
<view class="cu-bar bg-white">
<navigator class="modal-bottom-oper margin-0 flex-sub text-black solid-right" open-type="exit"
target="miniProgram">拒绝授权
</navigator>
<view class="margin-0 flex-sub">
<button class="margin-0 flex-sub cu-btn bg-white text-main-color" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber">确认授权</button>
</view>
</view>
</view>
</view>
</view> </view>
</template> </template>
@ -167,14 +112,16 @@
name: '查看详情', name: '查看详情',
color: 'blue', color: 'blue',
cuIcon: 'list', cuIcon: 'list',
pageUrl: '' pageUrl: '',
checkLogin: true
}, { }, {
id: 2, id: 2,
title: '我的订单', title: '我的订单',
name: '查看详情', name: '查看详情',
color: 'orange', color: 'orange',
cuIcon: 'text', cuIcon: 'text',
pageUrl: '/pages/order-manage/order-manage' pageUrl: '/pages/order-manage/order-manage',
checkLogin: true
}, { }, {
id: 3, id: 3,
title: '叮咚学院', title: '叮咚学院',
@ -195,7 +142,8 @@
name: '查看详情', name: '查看详情',
color: 'olive', color: 'olive',
cuIcon: 'group', cuIcon: 'group',
pageUrl: '/pages/area-proxy/my-team' pageUrl: '/pages/area-proxy/my-team',
checkLogin: true
}], }],
curUserInfo: {}, curUserInfo: {},
myInfo: {}, myInfo: {},
@ -209,26 +157,35 @@
this.loadData(); this.loadData();
}, },
methods: { methods: {
async loadData() { async authLogin() {
// userInfo // userInfo
let res = await this.$request.storageExistUser(); let res = await this.$request.storageExistUser();
// userInfo // userInfo
let curUserInfo = this.$request.getCurUserInfo(); let curUserInfo = this.$request.getCurUserInfo();
this.isAuthWxLoginModal = curUserInfo && curUserInfo.openId ? false : true; //
if (this.isAuthWxLoginModal) { if (!curUserInfo || !curUserInfo.openId) {
return; this.$refs.vertifyLogin.showModal();
return false;
} else {
this.$refs.vertifyLogin.hideModal();
} }
this.isAuthWxPhoneModal = !curUserInfo.phone ? true : false; //
if (this.isAuthWxPhoneModal) { if (!curUserInfo.phone) {
return; this.$refs.vertifyPhone.showModal();
return false;
} else {
this.$refs.vertifyPhone.hideModal();
} }
this.curUserInfo = curUserInfo; //
if (curUserInfo.type == null) {
// this.$refs.vertifyWorkerType.showModal();
this.isShowSteer = this.curUserInfo.type == null ? true : false; }
// this.loadData();
this.showTakeCertifiedModal = this.curUserInfo.type === 0 && this.curUserInfo.status !== 0 ? true : false; return true;
},
async loadData() {
// userInfo
this.curUserInfo = this.$request.getCurUserInfo();
this.myInfo = await this.$api.data('myInfo'); this.myInfo = await this.$api.data('myInfo');
// this.isShowSteer = !this.myInfo.entryType; // this.isShowSteer = !this.myInfo.entryType;
let newServModules = this.servModules.concat(); let newServModules = this.servModules.concat();
@ -273,19 +230,15 @@
url: '/pages/demand-center/rule?paramObj=' + encodeURIComponent(JSON.stringify(paramObj)) url: '/pages/demand-center/rule?paramObj=' + encodeURIComponent(JSON.stringify(paramObj))
}) })
}, },
authWxLogin() { async clickServModule(pageObj) {
this.$request.login().then(res => { if (pageObj.checkLogin) {
let res = await this.authLogin();
if (res) { if (res) {
this.loadData(); uni.navigateTo({
} url: pageObj.pageUrl
}) })
},
getPhoneNumber(e) {
this.$request.storagePhoneIntoUserInfo(e.detail.code).then(res => {
if (res) {
this.loadData();
} }
}) }
} }
}, },
} }
@ -323,7 +276,7 @@
font-weight: 300; font-weight: 300;
} }
.nav-list-panel>navigator:first-child { .nav-list-panel>.serv-module:first-child {
width: 46%; width: 46%;
height: 249rpx; height: 249rpx;
line-height: 195rpx; line-height: 195rpx;

View File

@ -4,7 +4,13 @@
<goods-manage v-else-if="curPageCode === 'supplyChainPage'"></goods-manage> <goods-manage v-else-if="curPageCode === 'supplyChainPage'"></goods-manage>
<my-home v-else-if="curPageCode === 'myPage'"></my-home> <my-home v-else-if="curPageCode === 'myPage'"></my-home>
<msg-home v-else-if="curPageCode === 'msgPage'"></msg-home> <msg-home v-else-if="curPageCode === 'msgPage'"></msg-home>
<module-bar ref="moduleBar" :moduleBarInfos="moduleBarInfos"></module-bar> <module-bar ref="moduleBar" :moduleBarInfos="moduleBarInfos" @getCurPageInfo="getCurPageInfo"></module-bar>
<!-- 首页引导 -->
<vertify-worker-type ref="vertifyWorkerType"></vertify-worker-type>
<!-- 登录校验弹窗 -->
<vertify-login ref="vertifyLogin" @reload="reloadForwardPage"></vertify-login>
<vertify-phone ref="vertifyPhone" @reload="reloadForwardPage"></vertify-phone>
</view> </view>
</template> </template>
@ -26,19 +32,16 @@
data() { data() {
return { return {
moduleBarInfos: [], moduleBarInfos: [],
curPageCode: 'indexPage' curPageCode: 'indexPage',
forwardingPageCode: null
} }
}, },
onLoad(options) { onLoad(options) {
this.loadData(); this.loadData();
this.bindEvent();
if (options && options.menuCode) { if (options && options.menuCode) {
this.changeCurPageCode(options.menuCode) this.changeCurPageCode(options.menuCode)
} }
}, },
onUnload() {
this.offEvent();
},
methods: { methods: {
async loadData() { async loadData() {
// uni.getSystemInfo({ // uni.getSystemInfo({
@ -48,21 +51,56 @@
// console.log('' + res.screenHeight) // console.log('' + res.screenHeight)
// } // }
// }) // })
this.moduleBarInfos = await this.$api.data('moduleBarInfos'); this.moduleBarInfos = await this.$api.data('moduleBarInfos');
}, },
bindEvent() { reloadForwardPage() {
uni.$on('getCurPageInfo', function(data) { this.getCurPageInfo({
if (data.curPageCode === 'publishPage') { curPageCode: this.forwardingPageCode
})
},
async getCurPageInfo(data) {
let pageCode = data.curPageCode;
this.forwardingPageCode = pageCode;
//
if (['supplyChainPage', 'myPage'].indexOf(pageCode) >= 0) {
let loginRes = await this.authLogin();
if (!loginRes) {
return;
}
}
this.forwardingPageCode = null;
if (pageCode === 'publishPage') {
this.isShowPublish = true; this.isShowPublish = true;
} else { } else {
this.isShowPublish = false; this.isShowPublish = false;
this.curPageCode = data.curPageCode; this.curPageCode = pageCode;
} }
}.bind(this));
}, },
offEvent() { async authLogin() {
uni.$off('getCurPageInfo') // userInfo
let res = await this.$request.storageExistUser();
// userInfo
let curUserInfo = this.$request.getCurUserInfo();
//
if (!curUserInfo || !curUserInfo.openId) {
this.$refs.vertifyLogin.showModal();
return false;
} else {
this.$refs.vertifyLogin.hideModal();
}
//
if (!curUserInfo.phone) {
this.$refs.vertifyPhone.showModal();
return false;
} else {
this.$refs.vertifyPhone.hideModal();
}
//
if (curUserInfo.type == null) {
this.$refs.vertifyWorkerType.showModal();
}
return true;
}, },
changeCurPageCode(targetPageCode) { changeCurPageCode(targetPageCode) {
// #ifdef MP // #ifdef MP

View File

@ -47,6 +47,7 @@
</view> </view>
</view> </view>
<view v-else class="margin bg-white padding"> <view v-else class="margin bg-white padding">
<view class="text-red padding-tb-sm">请完成入驻信息填写需求大厅将根据师傅入驻信息推送任务单无入驻信息将进行随机推送</view>
<button class="cu-btn bg-main-color shadow-blur" @click="navigate2ApplySettled">填写入驻信息</button> <button class="cu-btn bg-main-color shadow-blur" @click="navigate2ApplySettled">填写入驻信息</button>
</view> </view>
</view> </view>

View File

@ -218,6 +218,9 @@
<button class="cu-btn bg-main-color shadow-blur long-btn" @click="submit">确定</button> <button class="cu-btn bg-main-color shadow-blur long-btn" @click="submit">确定</button>
</view> </view>
</form> </form>
<!-- 账户及实名弹窗 -->
<vertify-bank-bind ref="vertifyBankBind"></vertify-bank-bind>
<vertify-certify ref="vertifyCertify"></vertify-certify>
</view> </view>
</template> </template>
@ -277,7 +280,10 @@
}, { }, {
code: 3, code: 3,
name: '45天' name: '45天'
}] }],
curUserInfo: {},
bankCard: null,
certifyInfo: null
} }
}, },
onLoad(options) { onLoad(options) {
@ -289,12 +295,32 @@
}, },
methods: { methods: {
async loadData(goodId) { async loadData(goodId) {
this.curUserInfo = this.$request.getCurUserInfo();
this.checkBankAndCertify();
this.loadCategoryList(); this.loadCategoryList();
this.loadRegionList(); this.loadRegionList();
// TODO goodIdgood // TODO goodIdgood
// this.categoryList = await this.$api.data('categoryList'); // this.categoryList = await this.$api.data('categoryList');
// this.regionList = await this.$api.data('regionList'); // this.regionList = await this.$api.data('regionList');
}, },
async checkBankAndCertify() {
//
let bankCardRes = await this.$request.getBindBankCardByWorkerId({
workerId: this.curUserInfo.workerId
});
this.bankCard = bankCardRes.data;
//
let certifyInfoRes = await this.$request.getWorkerCertify();
this.certifyInfo = certifyInfoRes.data;
if (!this.bankCard || !this.bankCard.bankNum) {
this.$refs.vertifyBankBind.showModal();
return false;
} else if (!this.certifyInfo || !this.certifyInfo.workerCertificationId) {
this.$refs.vertifyCertify.showModal();
return false;
}
return true;
},
async loadCategoryList(idArr) { async loadCategoryList(idArr) {
let typeList = await this.$request.listByStep(); let typeList = await this.$request.listByStep();
typeList = typeList.data; typeList = typeList.data;
@ -485,6 +511,11 @@
// uni.hideLoading(); // uni.hideLoading();
// }, // },
async submit() { async submit() {
let checkRes = await this.checkBankAndCertify();
if (!checkRes) {
return;
}
let goodsStandardList = this.formData.specsList.filter((item) => { let goodsStandardList = this.formData.specsList.filter((item) => {
if (item.checked) { if (item.checked) {
return { return {

View File

@ -404,7 +404,7 @@
this.orderList = this.orderList.concat(res.rows); this.orderList = this.orderList.concat(res.rows);
// this.pageParams[this.tabCur].pageNum++; // this.pageParams[this.tabCur].pageNum++;
this.pageNum++; this.pageNum++;
if (rowsLength === this.pageSize) { if (rowsLength === params.pageSize) {
this.$refs.loadStatusBar.showLoadMore(); this.$refs.loadStatusBar.showLoadMore();
return; return;
} }