瀏覽代碼

修改禁用账号 退出app功能

achao 3 年之前
父節點
當前提交
973328d05a
共有 6 個文件被更改,包括 228 次插入192 次删除
  1. 46 13
      pages/goodSource/index.vue
  2. 50 13
      pages/mine/index.vue
  3. 40 6
      pages/news/index.vue
  4. 39 14
      pages/order/index.vue
  5. 51 70
      pages/public/code.vue
  6. 2 76
      pages/public/login.vue

+ 46 - 13
pages/goodSource/index.vue

@@ -42,7 +42,8 @@
 				<view v-if="good.peripheralInfo==1&&isFirstIndex==index" class="other-goods">周边货源</view>
 				<view class="good-list">
 					<view style="padding: 0 35rpx 20rpx 35rpx;position: relative;">
-						<image src="@/static/images/goodSource/xf.png" mode="widthFix" class="xf-iamge" v-if="good.freightAdvance==1"></image>
+						<image src="@/static/images/goodSource/xf.png" mode="widthFix" class="xf-iamge"
+							v-if="good.freightAdvance==1"></image>
 						<view class="flex align-center">
 							<view class="item1">
 								<view class="ssx">{{$helper.getProvinceAbbreviation(good.sendPrivate)}}</view>
@@ -112,8 +113,9 @@
 			</view>
 		</mescroll-body>
 		<u-toast ref="uToast"></u-toast>
-		<u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
-			confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
+		<u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :confirmText='confirmText'
+			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
+			@cancel="cancelClick"></u-modal>
 	</view>
 </template>
 <script>
@@ -129,6 +131,8 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				confirmText: '',
+				showCancelButton: true,
 				isFirstIndex: null,
 				ObjSelect: {},
 				isShowAlert: false,
@@ -220,8 +224,24 @@
 			// this.mescroll.resetUpScroll()
 
 		},
-		onLoad() {
+		async onLoad() {
 			that = this
+			// #ifdef APP-PLUS
+			let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
+				driverPhone: this.userInfo.phone,
+			}).then(res => {
+				return res.data.authenticationStatus
+			})
+			if (_status == '已禁用') {
+				this.isShowAlert = true
+				this.alertTitle = '账号审核中'
+				this.confirmText = '退出APP'
+				this.showCancelButton = false
+			} else {
+				console.log(1231233212332312312213)
+			}
+			// #endif
+
 		},
 		onPageScroll(res) {
 			this.scrollTop = res.scrollTop
@@ -248,6 +268,16 @@
 				this.mescroll = mescroll;
 			},
 			confirmClick() {
+				// #ifdef APP-PLUS
+				if (this.alertTitle = '账号审核中') {
+					if (uni.getSystemInfoSync().platform == 'ios') {
+						plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+					} else if (uni.getSystemInfoSync().platform == 'android') {
+						plus.runtime.quit();
+					}
+					return
+				}
+				// #endif
 				let item = this.ObjSelect
 				let _obj = {
 					driverCommonId: this.firstAuthentication.commonId,
@@ -281,10 +311,10 @@
 									})
 								}
 							})
-						}else{
+						} else {
 							this.$refs.uToast.show({
 								type: 'error',
-								message:res.message,
+								message: res.message,
 							})
 						}
 					})
@@ -568,9 +598,10 @@
 </script>
 
 <style scoped lang="scss">
-	.content{
+	.content {
 		background: #F2F4F7;
 	}
+
 	.banner {
 		width: 100%;
 		position: relative;
@@ -632,11 +663,11 @@
 	}
 
 	.good-list {
-		    background-color: white;
-		    margin: 10px 10px 15px 10px;
-		    padding: 10px 0px 0px 0;
-		    border-radius: 30rpx;
-		    box-shadow: 0px 5rpx 20rpx #E3E3E3;
+		background-color: white;
+		margin: 10px 10px 15px 10px;
+		padding: 10px 0px 0px 0;
+		border-radius: 30rpx;
+		box-shadow: 0px 5rpx 20rpx #E3E3E3;
 
 		.item1,
 		.item3 {
@@ -677,6 +708,7 @@
 		background: #F0F5FF;
 		padding: 0 30rpx;
 		border-radius: 0 0 30rpx 30rpx;
+
 		.name {
 			font-size: 26rpx;
 			font-weight: 700;
@@ -744,7 +776,8 @@
 			top: -30rpx;
 		}
 	}
-	.xf-iamge{
+
+	.xf-iamge {
 		width: 74rpx;
 		height: 43rpx;
 		position: absolute;

+ 50 - 13
pages/mine/index.vue

@@ -50,7 +50,9 @@
 					</image>
 					<view>管理银行卡</view>
 				</view>
-				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image> </view>
+				<view>
+					<image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
+				</view>
 			</view>
 			<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/manageVehicles/index',3)">
 				<view class="flex align-center">
@@ -58,7 +60,9 @@
 					</image>
 					<view>管理车辆</view>
 				</view>
-				<view><image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
+				<view>
+					<image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
+				</view>
 			</view>
 			<view class="flex flex-space-between" @click="$helper.contactCustomerService">
 				<view class="flex align-center">
@@ -66,7 +70,9 @@
 					</image>
 					<view>联系客服</view>
 				</view>
-				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
+				<view>
+					<image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
+				</view>
 			</view>
 			<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/helpDescription')">
 				<view class="flex align-center">
@@ -74,7 +80,9 @@
 					</image>
 					<view>帮助说明</view>
 				</view>
-				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
+				<view>
+					<image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
+				</view>
 			</view>
 			<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/set')">
 				<view class="flex align-center">
@@ -82,11 +90,13 @@
 					</image>
 					<view>设置</view>
 				</view>
-				<view> <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image></view>
+				<view>
+					<image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
+				</view>
 			</view>
 		</view>
-		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
-			:showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
+		<u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :confirmText='confirmText'
+			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
 			@cancel="cancelClick"></u-modal>
 		<u-toast ref="uToast"></u-toast>
 	</view>
@@ -100,6 +110,8 @@
 	export default {
 		data() {
 			return {
+				confirmText: '',
+				showCancelButton: true,
 				userName: '',
 				phone: '',
 				headUrl: "../../static/images/myimg/YongHu@3x.png",
@@ -147,8 +159,23 @@
 				}
 			})
 		},
-		onLoad() {
+		async onLoad() {
 			that = this
+			// #ifdef APP-PLUS
+			let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
+				driverPhone: this.userInfo.phone,
+			}).then(res => {
+				return res.data.authenticationStatus
+			})
+			if (_status == '已禁用') {
+				this.isShowAlert = true
+				this.alertTitle = '账号审核中'
+				this.confirmText = '退出APP'
+				this.showCancelButton = false
+			} else {
+				console.log(1231233212332312312213)
+			}
+			// #endif
 
 		},
 		computed: {
@@ -182,10 +209,9 @@
 								this.statusVal = '身份认证审核中'
 							} else if (this.firstAuthentication.authenticationStatus == '未通过') {
 								this.statusVal = '身份认证未通过'
-							}
-							 else if (this.firstAuthentication.authenticationStatus == '已过期') {
-							 	this.statusVal = '证件已过期'
-							 }else {
+							} else if (this.firstAuthentication.authenticationStatus == '已过期') {
+								this.statusVal = '证件已过期'
+							} else {
 								this.statusVal = '已认证'
 							}
 						} else {
@@ -212,6 +238,16 @@
 					});
 			},
 			confirmClick() {
+				// #ifdef APP-PLUS
+				if (this.alertTitle = '账号审核中') {
+					if (uni.getSystemInfoSync().platform == 'ios') {
+						plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+					} else if (uni.getSystemInfoSync().platform == 'android') {
+						plus.runtime.quit();
+					}
+					return
+				}
+				// #endif
 				this.isShowAlert = false
 				uni.$u.route('/pages/public/login');
 			},
@@ -266,13 +302,14 @@
 		height: var(--status-bar-height);
 	}
 
-.arrow {
+	.arrow {
 		margin-left: 15px;
 		width: 8px;
 		height: 12px;
 		// justify-content: flex-end
 
 	}
+
 	.head {
 		.row1 {
 			display: flex;

+ 40 - 6
pages/news/index.vue

@@ -42,7 +42,9 @@
 				<view class="flex flex-space-between">
 					您的驾驶证即将到期,请尽快到“我的-身份认证”中更新,逾期将影响运费支付。
 				</view> -->
-
+				<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
+					:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick"
+					@close="cancelClick" @cancel="cancelClick"></u-modal>
 			</view>
 		</view>
 	</mescroll-body>
@@ -58,6 +60,10 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				confirmText: '',
+				showCancelButton: true,
+				isShowAlert: false,
+				alertTitle: '',
 				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
 				bgColor: '#317AFE',
 				value: 100,
@@ -66,8 +72,24 @@
 				mescroll: null
 			}
 		},
-		onLoad() {
+		async onLoad() {
 			that = this
+			// #ifdef APP-PLUS
+			let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
+				driverPhone: this.userInfo.phone,
+			}).then(res => {
+				return res.data.authenticationStatus
+			})
+			if (_status == '已禁用') {
+				this.isShowAlert = true
+				this.alertTitle = '账号审核中'
+				this.confirmText = '退出APP'
+				this.showCancelButton = false
+			} else {
+				console.log(1231233212332312312213)
+			}
+			// #endif
+
 		},
 		onShow() {
 			that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
@@ -93,12 +115,24 @@
 					}
 				}
 			})
-				// this.mescroll.resetUpScroll()
+			// this.mescroll.resetUpScroll()
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
 		},
 		methods: {
+			confirmClick() {
+				// #ifdef APP-PLUS
+				if (this.alertTitle = '账号审核中') {
+					if (uni.getSystemInfoSync().platform == 'ios') {
+						plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+					} else if (uni.getSystemInfoSync().platform == 'android') {
+						plus.runtime.quit();
+					}
+					return
+				}
+				// #endif
+			},
 			rightClick() {
 				uni.showLoading({
 					title: '加载中',
@@ -134,12 +168,12 @@
 						uni.$u.toast(res.message);
 					});
 			},
-			look(){
+			look() {
 				that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 					reCommonId: this.userInfo.id,
 				}).then(res3 => {
-					
-					if (res3.data||res3.data==0) {
+
+					if (res3.data || res3.data == 0) {
 						let name = 'myTip';
 						let value = res3.data
 						if (value == 0) {

+ 39 - 14
pages/order/index.vue

@@ -105,13 +105,13 @@
 						<view class="row5 flex flex-end">
 							<view class="stop active" @click.stop="stop(good)"
 								v-if="good.orderStatus=='待货主确认'||good.orderStatus=='未装车'">终止</view>
-					<!-- 		<view class="start normal" @click.stop="confirmLoading(good)"
+							<!-- 		<view class="start normal" @click.stop="confirmLoading(good)"
 								v-if="good.orderStatus=='未装车'||good.orderStatus=='货主驳回装车信息'||good.orderStatus=='平台驳回装车信息'">
 								确认装车</view> -->
-										<view class="start normal" @click.stop="toDetail(good.id)"
-											v-if="good.orderStatus=='未装车'||good.orderStatus=='货主驳回装车信息'||good.orderStatus=='平台驳回装车信息'">
-											确认装车</view>
-								
+							<view class="start normal" @click.stop="toDetail(good.id)"
+								v-if="good.orderStatus=='未装车'||good.orderStatus=='货主驳回装车信息'||good.orderStatus=='平台驳回装车信息'">
+								确认装车</view>
+
 							<view class="start normal" v-if="good.orderStatus!='未装车'&&good.orderStatus!='待货主确认'"
 								@click.stop="$helper.contactCustomerService">联系客服
 							</view>
@@ -147,9 +147,9 @@
 
 			</view>
 		</view>
-		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
-			:closeOnClickOverlay='true' :showCancelButton='true' @confirm="confirmClick" @close="cancelClick"
-			@cancel="cancelClick" class="modal">
+		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
+			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
+			@cancel="cancelClick">
 			<u-radio-group v-model="radiovalue1" placement="" v-if='isShowTerminationReason' class='row'>
 				<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
 					:label="item.name" :name="item.name" @change="radioChange">
@@ -177,6 +177,8 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				confirmText: '',
+				showCancelButton: true,
 				showMenu: false,
 				searchStyle: {
 					background: "#317AFE",
@@ -264,10 +266,23 @@
 			// this.getLngLat();
 			//#endif
 		},
-		onLoad() {
+		async onLoad() {
 			that = this
-			// let _isHave = this.$utils.getRoles('aaa')
-			// console.log(_isHave)
+			// #ifdef APP-PLUS
+			let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
+				driverPhone: this.userInfo.phone,
+			}).then(res => {
+				return res.data.authenticationStatus
+			})
+			if (_status == '已禁用') {
+				this.isShowAlert = true
+				this.alertTitle = '账号审核中'
+				this.confirmText = '退出APP'
+				this.showCancelButton = false
+			} else {
+				console.log(1231233212332312312213)
+			}
+			// #endif
 
 		},
 		onShow() {
@@ -381,6 +396,16 @@
 				this.confirmText = '确定'
 			},
 			confirmClick() {
+				// #ifdef APP-PLUS
+				if (this.alertTitle = '账号审核中') {
+					if (uni.getSystemInfoSync().platform == 'ios') {
+						plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+					} else if (uni.getSystemInfoSync().platform == 'android') {
+						plus.runtime.quit();
+					}
+					return
+				}
+				// #endif
 				if (this.alertTitle == '确定删除全部历史记录?') {
 					uni.removeStorageSync('useSearchList');
 					this.useSearchList = [];
@@ -441,10 +466,10 @@
 				// = uni.getStorageSync('useSearchList')
 
 				this.useSearchList.unshift(e)
-				this.useSearchList=[...new Set(this.useSearchList)]
+				this.useSearchList = [...new Set(this.useSearchList)]
 				uni.setStorageSync("useSearchList", this.useSearchList)
-				if(this.useSearchList.length>9){
-					this.carList.splice(this.useSearchList.length,1)
+				if (this.useSearchList.length > 9) {
+					this.carList.splice(this.useSearchList.length, 1)
 				}
 				console.log("点击搜索", e)
 				this.upCallback({

+ 51 - 70
pages/public/code.vue

@@ -123,80 +123,61 @@
 							loginFlag: 2
 						}).then(res => {
 							if (res.code == 200) {
-								that.$request.baseRequest('post', '/commonUser/api/loginQuickly', {
-									mobilePhone: this.phone,
-									veriCode: "123456",
-									loginFlag: 2
-								}).then(res1 => {
-									that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
-										reCommonId: this.userInfo.id,
-									}).then(res3 => {
-										if (res3.data) {
-											let name = 'myTip';
-											let value = res3.data
-											if (value == 0) {
-												uni.removeTabBarBadge({
-													index: 2
-												})
-											}
-											that.$store.commit('$uStore', {
-												name,
-												value
-											});
-											if (value != 0 && value) {
-												uni.setTabBarBadge({
-													index: 2,
-													text: value + ""
-												})
-											}
+								uni.setStorageSync('userInfo', res.data)
+								that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
+									reCommonId: res.data.id,
+								}).then(res3 => {
+									if (res3.data) {
+										let name = 'myTip';
+										let value = res3.data
+										if (value == 0) {
+											uni.removeTabBarBadge({
+												index: 2
+											})
 										}
-									})
-									if (res1.code == 200) {
-										uni.setStorageSync('pcuserInfo', res1.data)
-										helper.getListByUserId()
-									} else {
-										that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
-											mobilePhone: '14444444444',
-											veriCode: "123456",
-											loginFlag: 2
-										}).then(res2 => {
-											that.$request.baseRequest('get',
-											'/newsInfo/unreadMessage', {
-												reCommonId: this.userInfo.id,
-											}).then(res3 => {
-												if (res3.data) {
-													let name = 'myTip';
-													let value = res3.data
-													if (value == 0) {
-														uni.removeTabBarBadge({
-															index: 2
-														})
-													}
-													that.$store.commit('$uStore', {
-														name,
-														value
-													});
-													if (value != 0 && value) {
-														uni.setTabBarBadge({
-															index: 2,
-															text: value + ""
-														})
-													}
-												}
+										that.$store.commit('$uStore', {
+											name,
+											value
+										});
+										if (value != 0 && value) {
+											uni.setTabBarBadge({
+												index: 2,
+												text: value + ""
 											})
-											uni.setStorageSync('pcuserInfo', res2.data)
-											helper.getListByUserId()
-										})
+										}
 									}
 								})
-								uni.setStorageSync('userInfo', res.data)
-								helper.getListByUserId()
-								that.$store.commit('login', res.data)
-								// that.liangxinLogin()
-								uni.switchTab({
-									url: '/pages/goodSource/index'
-								});
-								uni.hideLoading()
+								that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
+									driverPhone: this.phone,
+								}).then(res2 => {
+									if (res.data.statusFlag == '已禁用') {
+										this.isShowAlert = true
+										uni.hideLoading()
+										return
+									}
+									uni.setStorageSync('pcuserInfo', res.data)
+									uni.setStorageSync('userInfo', res.data)
+									uni.setStorageSync('firstAuthentication', res2.data)
+									helper.getListByUserId()
+									that.$store.commit('login', res.data)
+									var name = 'userInfo';
+									var value = res.data;
+									that.$store.commit('$uStore', {
+										name,
+										value
+									});
+
+									uni.switchTab({
+										url: '/pages/goodSource/index'
+									});
+									uni.hideLoading()
+									// that.liangxinLogin()
+									uni.switchTab({
+										url: '/pages/goodSource/index'
+									});
+									uni.hideLoading()
+								})
+
 							} else {
 								uni.hideLoading()
 								uni.showToast({

+ 2 - 76
pages/public/login.vue

@@ -169,12 +169,6 @@
 						if (res.code == 200) {
 							console.log("userInfo", res.data)
 							uni.setStorageSync('userInfo', res.data)
-							// if(res.data.statusFlag=='已禁用'){
-							// 	this.isShowAlert = true
-							// 	uni.hideLoading()
-							// 	return
-							// }
-							
 							that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 								reCommonId: this.userInfo.id,
 							}).then(res3 => {
@@ -223,81 +217,13 @@
 									url: '/pages/goodSource/index'
 								});
 								uni.hideLoading()
-								// that.liangxinLogin()
 								uni.switchTab({
 									url: '/pages/goodSource/index'
 								});
 								uni.hideLoading()
-								// 
-								// 
-							})
-							// that.$request.baseRequest('post', '/commonUser/api/loginQuickly', {
-							// 	mobilePhone: this.phone,
-							// 	veriCode: "123456",
-							// 	loginFlag: 2
-							// }).then(res1 => {
-							// 	console.log("loginQuickly", res)
-							// 	if (res1.code == 200) {
-							// 		uni.setStorageSync('pcuserInfo', res1.data)
-							// 		that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
-							// 			reCommonId: this.userInfo.id,
-							// 		}).then(res3 => {
-							// 			if (res3.data) {
-							// 				let name = 'myTip';
-							// 				let value = res3.data
-							// 				if (value == 0) {
-							// 					uni.removeTabBarBadge({
-							// 						index: 2
-							// 					})
-							// 				}
-							// 				that.$store.commit('$uStore', {
-							// 					name,
-							// 					value
-							// 				});
-							// 				if (value != 0 && value) {
-							// 					uni.setTabBarBadge({
-							// 						index: 2,
-							// 						text: value + ""
-							// 					})
-							// 				}
-							// 			}
-							// 		})
-							// 		helper.getListByUserId()
-							// 	} else {
-							// 		that.$request.baseRequest('post', '/commonUser/api/loginQuickly', {
-							// 			mobilePhone: '14444444444',
-							// 			veriCode: "123456",
-							// 			loginFlag: 2
-							// 		}).then(res2 => {
-							// 			that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
-							// 				reCommonId: this.userInfo.id,
-							// 			}).then(res3 => {
-							// 				if (res3.data) {
-							// 					let name = 'myTip';
-							// 					let value = res3.data
-							// 					if (value == 0) {
-							// 						uni.removeTabBarBadge({
-							// 							index: 2
-							// 						})
-							// 					}
-							// 					that.$store.commit('$uStore', {
-							// 						name,
-							// 						value
-							// 					});
-							// 					if (value != 0 && value) {
-							// 						uni.setTabBarBadge({
-							// 							index: 2,
-							// 							text: value + ""
-							// 						})
-							// 					}
-							// 				}
-							// 			})
-							// 			uni.setStorageSync('pcuserInfo', res2.data)
-							// 			helper.getListByUserId()
-							// 		})
-							// 	}
 
-							// })
+							})
+				
 				
 						} else {
 							uni.hideLoading()