登录,获取手机号,帐号绑定,实名校验及弹窗
This commit is contained in:
parent
02a8f31e16
commit
25cd0d0fe9
|
|
@ -2,7 +2,7 @@ export default {
|
|||
deptId: 101,
|
||||
from: 'server',
|
||||
initPageNum: 1,
|
||||
initPageSize: 20,
|
||||
initPageSize: 1,
|
||||
timeRangeList: [
|
||||
'08:00-08:30',
|
||||
'08:30-09:00',
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
<script>
|
||||
export default {
|
||||
name: "module-bar",
|
||||
emits: ['getCurPageInfo'],
|
||||
props: {
|
||||
moduleBarInfos: {
|
||||
type: Array,
|
||||
|
|
@ -48,13 +49,13 @@
|
|||
navChange(e, isChangeFocus) {
|
||||
let cur = e.currentTarget.dataset.cur;
|
||||
this.curPageCode = isChangeFocus ? cur : this.curPageCode;
|
||||
uni.$emit('getCurPageInfo', {
|
||||
this.$emit('getCurPageInfo', {
|
||||
curPageCode: cur
|
||||
});
|
||||
},
|
||||
navChangeByCode(curPageCode, isChangeFocus) {
|
||||
this.curPageCode = isChangeFocus ? curPageCode : this.curPageCode;
|
||||
uni.$emit('getCurPageInfo', {
|
||||
this.$emit('getCurPageInfo', {
|
||||
curPageCode: curPageCode
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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
11
main.js
|
|
@ -10,9 +10,20 @@ import dateUtil from './common/js/dateUtil.js';
|
|||
import commonFun from './common/js/commonFun.js';
|
||||
import request from './common/js/request.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('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 => {
|
||||
//模拟异步请求数据
|
||||
return new Promise(resolve => {
|
||||
|
|
|
|||
|
|
@ -179,6 +179,9 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 账户及实名弹窗 -->
|
||||
<vertify-bank-bind ref="vertifyBankBind"></vertify-bank-bind>
|
||||
<vertify-certify ref="vertifyCertify"></vertify-certify>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -263,7 +266,9 @@
|
|||
chosenArea: [],
|
||||
categoryList: [],
|
||||
categoryMultiIndex: [0, 0, 0],
|
||||
chosenCategory: []
|
||||
chosenCategory: [],
|
||||
bankCard: null,
|
||||
certifyInfo: null
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
|
@ -271,8 +276,9 @@
|
|||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
// this.tasks = await this.$api.data('tasks');
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.checkBankAndCertify();
|
||||
// this.tasks = await this.$api.data('tasks');
|
||||
this.reloadMasterOrderPage();
|
||||
// this.takeCertify = await this.$api.data('takeCertify');
|
||||
// this.areaList = await this.$api.data('areaList');
|
||||
|
|
@ -280,6 +286,24 @@
|
|||
this.loadCategoryList();
|
||||
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 = {}) {
|
||||
params.pageSize = this.$globalData.initPageSize;
|
||||
params.pageNum = this.pageNum;
|
||||
|
|
@ -306,7 +330,7 @@
|
|||
this.tasks = this.tasks.concat(res.rows);
|
||||
// this.pageParams[this.tabCur].pageNum++;
|
||||
this.pageNum++;
|
||||
if (rowsLength === this.pageSize) {
|
||||
if (rowsLength === params.pageSize) {
|
||||
this.$refs.loadStatusBar.showLoadMore();
|
||||
return;
|
||||
}
|
||||
|
|
@ -473,6 +497,11 @@
|
|||
})
|
||||
},
|
||||
async takeTask(e, task) {
|
||||
let checkRes = await this.checkBankAndCertify();
|
||||
if (!checkRes) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.curUserInfo.status !== 0 || this.curUserInfo.type !== 0) {
|
||||
// 未认证需提示前往认证
|
||||
e.currentTarget.dataset.modal = e.currentTarget.dataset.certifyModal;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
:style="'width: 120rpx; height: 120rpx; background-image:url(' + curUserInfo.bannerUrl + ');'">
|
||||
</view>
|
||||
<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='cu-tag bg-white radius'>编辑</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-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 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 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>
|
||||
|
|
@ -47,7 +48,7 @@
|
|||
</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">
|
||||
<view class="padding-sm">
|
||||
<view class="flex justify-between align-center margin-bottom-xs">
|
||||
|
|
@ -58,9 +59,12 @@
|
|||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view v-else class="screen-swiper padding text-center">
|
||||
未登录
|
||||
</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="">
|
||||
<text class="text-main-color">[每周公告]</text>
|
||||
|
|
@ -76,81 +80,22 @@
|
|||
<view class="margin-lr-sm margin-top">
|
||||
<view class="text-lg">服务中心</view>
|
||||
<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'}]"
|
||||
v-for="(item,index) in servModules " :key="index">
|
||||
<view :class="index === 0 ? 'text-xxl' : 'text-xl'">{{item.title}}</view>
|
||||
<!-- <view class="nav-name">{{item.name}}</view> -->
|
||||
<text :class="'cuIcon-' + item.cuIcon"></text>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 首页引导 -->
|
||||
<view class="cu-modal" :class="isShowSteer?'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" @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>
|
||||
<vertify-worker-type ref="vertifyWorkerType"></vertify-worker-type>
|
||||
<!-- 登录校验弹窗 -->
|
||||
<vertify-login ref="vertifyLogin" @reload="authLogin"></vertify-login>
|
||||
<vertify-phone ref="vertifyPhone" @reload="authLogin"></vertify-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -167,14 +112,16 @@
|
|||
name: '查看详情',
|
||||
color: 'blue',
|
||||
cuIcon: 'list',
|
||||
pageUrl: ''
|
||||
pageUrl: '',
|
||||
checkLogin: true
|
||||
}, {
|
||||
id: 2,
|
||||
title: '我的订单',
|
||||
name: '查看详情',
|
||||
color: 'orange',
|
||||
cuIcon: 'text',
|
||||
pageUrl: '/pages/order-manage/order-manage'
|
||||
pageUrl: '/pages/order-manage/order-manage',
|
||||
checkLogin: true
|
||||
}, {
|
||||
id: 3,
|
||||
title: '叮咚学院',
|
||||
|
|
@ -195,7 +142,8 @@
|
|||
name: '查看详情',
|
||||
color: 'olive',
|
||||
cuIcon: 'group',
|
||||
pageUrl: '/pages/area-proxy/my-team'
|
||||
pageUrl: '/pages/area-proxy/my-team',
|
||||
checkLogin: true
|
||||
}],
|
||||
curUserInfo: {},
|
||||
myInfo: {},
|
||||
|
|
@ -209,26 +157,35 @@
|
|||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
async authLogin() {
|
||||
// 更新缓存中的userInfo
|
||||
let res = await this.$request.storageExistUser();
|
||||
// 获取缓存中的userInfo
|
||||
let curUserInfo = this.$request.getCurUserInfo();
|
||||
this.isAuthWxLoginModal = curUserInfo && curUserInfo.openId ? false : true;
|
||||
if (this.isAuthWxLoginModal) {
|
||||
return;
|
||||
// 校验提示登录
|
||||
if (!curUserInfo || !curUserInfo.openId) {
|
||||
this.$refs.vertifyLogin.showModal();
|
||||
return false;
|
||||
} else {
|
||||
this.$refs.vertifyLogin.hideModal();
|
||||
}
|
||||
this.isAuthWxPhoneModal = !curUserInfo.phone ? true : false;
|
||||
if (this.isAuthWxPhoneModal) {
|
||||
return;
|
||||
// 校验提示获取手机号码
|
||||
if (!curUserInfo.phone) {
|
||||
this.$refs.vertifyPhone.showModal();
|
||||
return false;
|
||||
} else {
|
||||
this.$refs.vertifyPhone.hideModal();
|
||||
}
|
||||
this.curUserInfo = curUserInfo;
|
||||
|
||||
// 是否展示选择入驻类型的模态框
|
||||
this.isShowSteer = this.curUserInfo.type == null ? true : false;
|
||||
// 是否展示认证提示模态框
|
||||
this.showTakeCertifiedModal = this.curUserInfo.type === 0 && this.curUserInfo.status !== 0 ? true : false;
|
||||
|
||||
// 提示选择师傅类型
|
||||
if (curUserInfo.type == null) {
|
||||
this.$refs.vertifyWorkerType.showModal();
|
||||
}
|
||||
this.loadData();
|
||||
return true;
|
||||
},
|
||||
async loadData() {
|
||||
// 获取缓存中的userInfo
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.myInfo = await this.$api.data('myInfo');
|
||||
// this.isShowSteer = !this.myInfo.entryType;
|
||||
let newServModules = this.servModules.concat();
|
||||
|
|
@ -273,19 +230,15 @@
|
|||
url: '/pages/demand-center/rule?paramObj=' + encodeURIComponent(JSON.stringify(paramObj))
|
||||
})
|
||||
},
|
||||
authWxLogin() {
|
||||
this.$request.login().then(res => {
|
||||
async clickServModule(pageObj) {
|
||||
if (pageObj.checkLogin) {
|
||||
let res = await this.authLogin();
|
||||
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;
|
||||
}
|
||||
|
||||
.nav-list-panel>navigator:first-child {
|
||||
.nav-list-panel>.serv-module:first-child {
|
||||
width: 46%;
|
||||
height: 249rpx;
|
||||
line-height: 195rpx;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,13 @@
|
|||
<goods-manage v-else-if="curPageCode === 'supplyChainPage'"></goods-manage>
|
||||
<my-home v-else-if="curPageCode === 'myPage'"></my-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>
|
||||
</template>
|
||||
|
||||
|
|
@ -26,19 +32,16 @@
|
|||
data() {
|
||||
return {
|
||||
moduleBarInfos: [],
|
||||
curPageCode: 'indexPage'
|
||||
curPageCode: 'indexPage',
|
||||
forwardingPageCode: null
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.loadData();
|
||||
this.bindEvent();
|
||||
if (options && options.menuCode) {
|
||||
this.changeCurPageCode(options.menuCode)
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
this.offEvent();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
// uni.getSystemInfo({
|
||||
|
|
@ -48,21 +51,56 @@
|
|||
// console.log('高度:' + res.screenHeight)
|
||||
// }
|
||||
// })
|
||||
|
||||
this.moduleBarInfos = await this.$api.data('moduleBarInfos');
|
||||
},
|
||||
bindEvent() {
|
||||
uni.$on('getCurPageInfo', function(data) {
|
||||
if (data.curPageCode === 'publishPage') {
|
||||
this.isShowPublish = true;
|
||||
} else {
|
||||
this.isShowPublish = false;
|
||||
this.curPageCode = data.curPageCode;
|
||||
}
|
||||
}.bind(this));
|
||||
reloadForwardPage() {
|
||||
this.getCurPageInfo({
|
||||
curPageCode: this.forwardingPageCode
|
||||
})
|
||||
},
|
||||
offEvent() {
|
||||
uni.$off('getCurPageInfo')
|
||||
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;
|
||||
} else {
|
||||
this.isShowPublish = false;
|
||||
this.curPageCode = pageCode;
|
||||
}
|
||||
},
|
||||
async authLogin() {
|
||||
// 更新缓存中的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) {
|
||||
// #ifdef MP
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -218,6 +218,9 @@
|
|||
<button class="cu-btn bg-main-color shadow-blur long-btn" @click="submit">确定</button>
|
||||
</view>
|
||||
</form>
|
||||
<!-- 账户及实名弹窗 -->
|
||||
<vertify-bank-bind ref="vertifyBankBind"></vertify-bank-bind>
|
||||
<vertify-certify ref="vertifyCertify"></vertify-certify>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -277,7 +280,10 @@
|
|||
}, {
|
||||
code: 3,
|
||||
name: '45天'
|
||||
}]
|
||||
}],
|
||||
curUserInfo: {},
|
||||
bankCard: null,
|
||||
certifyInfo: null
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
@ -289,12 +295,32 @@
|
|||
},
|
||||
methods: {
|
||||
async loadData(goodId) {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.checkBankAndCertify();
|
||||
this.loadCategoryList();
|
||||
this.loadRegionList();
|
||||
// TODO 如果存在goodId说明是修改,需要查询good信息进行回显
|
||||
// this.categoryList = await this.$api.data('categoryList');
|
||||
// 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) {
|
||||
let typeList = await this.$request.listByStep();
|
||||
typeList = typeList.data;
|
||||
|
|
@ -485,6 +511,11 @@
|
|||
// uni.hideLoading();
|
||||
// },
|
||||
async submit() {
|
||||
let checkRes = await this.checkBankAndCertify();
|
||||
if (!checkRes) {
|
||||
return;
|
||||
}
|
||||
|
||||
let goodsStandardList = this.formData.specsList.filter((item) => {
|
||||
if (item.checked) {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@
|
|||
this.orderList = this.orderList.concat(res.rows);
|
||||
// this.pageParams[this.tabCur].pageNum++;
|
||||
this.pageNum++;
|
||||
if (rowsLength === this.pageSize) {
|
||||
if (rowsLength === params.pageSize) {
|
||||
this.$refs.loadStatusBar.showLoadMore();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue