Browse Source

添加app 退出功能

achao 3 years ago
parent
commit
828f024fa9
6 changed files with 156 additions and 35 deletions
  1. 2 2
      config/index.js
  2. 16 1
      manifest.json
  3. 14 2
      pages/mine/index.vue
  4. 43 5
      pages/news/index.vue
  5. 45 19
      pages/order/index.vue
  6. 36 6
      pages/release/release.vue

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 const dev = {
-	baseUrlNew: 'https://apitest.eliangeyun.com',
-	// baseUrlNew: 'http://192.168.1.114:8099',
+	// baseUrlNew: 'https://apitest.eliangeyun.com',
+	baseUrlNew: 'http://192.168.1.114:8099',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 16 - 1
manifest.json

@@ -109,7 +109,22 @@
                 }
             }
         },
-        "nativePlugins" : {}
+        "nativePlugins" : {
+            "KJ-Camera" : {
+                "__plugin_info__" : {
+                    "name" : "相机自定义拍照录像,可设置相机分辨率、相机焦距、相机无声录像、相机支持横竖屏 - [试用版,仅用于自定义调试基座]",
+                    "description" : "相机自定义拍照录像,可设置相机分辨率、相机焦距、相机无声录像、相机支持横竖屏、相机切换前后摄像头 QQ群:863776189 可接单 离线包:单价*10  源码:单价*15",
+                    "platforms" : "Android,iOS",
+                    "url" : "https://ext.dcloud.net.cn/plugin?id=3404",
+                    "android_package_name" : "",
+                    "ios_bundle_id" : "",
+                    "isCloud" : true,
+                    "bought" : 0,
+                    "pid" : "3404",
+                    "parameters" : {}
+                }
+            }
+        }
     },
     /* 快应用特有相关 */
     "quickapp" : {},

+ 14 - 2
pages/mine/index.vue

@@ -96,7 +96,7 @@
 			</view>
 		</view>
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
-			:showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
+			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
 			@cancel="cancelClick"></u-modal>
 		<u-toast ref="uToast"></u-toast>
 	</view>
@@ -109,7 +109,9 @@
 	export default {
 		data() {
 			return {
-				isShowAlert:false,
+				confirmText: '',
+				showCancelButton: true,
+				isShowAlert: false,
 				alertTitle: '',
 				userName: '',
 				phone: '',
@@ -168,6 +170,16 @@
 		},
 		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
 				this.isShowAlert = false
 				uni.$u.route('/pages/public/login');
 			},

+ 43 - 5
pages/news/index.vue

@@ -44,6 +44,10 @@
 				</view> -->
 
 			</view>
+			<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
+				:closeOnClickOverlay='true' :showCancelButton='showCancelButton' @confirm="confirmClick"
+				@close="cancelClick" @cancel="cancelClick" class="modal">
+			</u-modal>
 		</view>
 	</mescroll-body>
 </template>
@@ -58,6 +62,12 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				confirmText: '',
+				showCancelButton: true,
+				alertTitle: '',
+				alertContent: "",
+				isShowAlert: false,
+				showCancelButton: true,
 				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
 				bgColor: '#317AFE',
 				value: 100,
@@ -66,8 +76,24 @@
 				mescroll: null
 			}
 		},
-		onLoad() {
+		async onLoad() {
 			that = this
+			// #ifdef APP-PLUS
+			let _status = await that.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
+				phone: 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 +119,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 +172,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) {

+ 45 - 19
pages/order/index.vue

@@ -125,7 +125,7 @@
 						</view>
 						<view class="normal" @click.stop="stop(good)" v-if="good.cargoOwnerStatus=='未装车'">终止</view>
 						<!-- <view class="stop active" @click.stop="stop(good)">终止</view> -->
-					
+
 						<!-- confirmLoading(good,3) -->
 						<view class="start normal" @click.stop="toDetail(good.id)"
 							v-if="good.cargoOwnerStatus=='待确认装车'">确认装车</view>
@@ -166,8 +166,8 @@
 			</view>
 		</view> -->
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
-			:closeOnClickOverlay='true' :showCancelButton='true' @confirm="confirmClick" @close="cancelClick"
-			@cancel="cancelClick" class="modal">
+			:closeOnClickOverlay='true' :showCancelButton='showCancelButton' @confirm="confirmClick"
+			@close="cancelClick" @cancel="cancelClick" class="modal">
 			<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">
@@ -195,6 +195,8 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				confirmText: '',
+				showCancelButton: true,
 				type: null,
 				objData: {},
 				showMenu: false,
@@ -292,10 +294,24 @@
 			// this.getLngLat();
 			//#endif
 		},
-		onLoad() {
-			// let _isHave = this.$utils.getRoles('aaa')
-			// console.log(_isHave)
+		async onLoad() {
 			that = this
+			// #ifdef APP-PLUS
+			let _status = await that.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
+				phone: 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() {
 			this.upCallback({
@@ -401,7 +417,7 @@
 				} else if (type == 4) {
 					this.alertTitle = '确认卸车?'
 					this.confirmText = '确定'
-				} 
+				}
 				this.isShowAlert = true
 				// uni.$u.route('/pages/order/confirmLoading', item);
 			},
@@ -435,6 +451,16 @@
 				this.isShowAlert = true
 			},
 			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
 				that.isShowAlert = false
 				if (this.type == 1 || this.type == 2) {
 					let _title = ''
@@ -473,14 +499,14 @@
 						.catch(res => {
 							uni.$u.toast(res.message);
 						});
-				}else if (this.type == 3 || this.type == 4){
-					let _flag=''
-					if (this.type==3) _flag=1
-					if (this.type==4) _flag=2
+				} else if (this.type == 3 || this.type == 4) {
+					let _flag = ''
+					if (this.type == 3) _flag = 1
+					if (this.type == 4) _flag = 2
 					this.$request.baseRequest('post', '/carrierInfo/cargoOwnerLoadingAdd', {
 							id: this.objData.id,
 							loadingFlag: _flag,
-							flag:1
+							flag: 1
 						}).then(res => {
 							if (res.code == 200) {
 								this.$refs.uToast.show({
@@ -493,14 +519,13 @@
 										})
 									}
 								})
-					
+
 							}
 						})
 						.catch(res => {
 							uni.$u.toast(res.message);
 						});
-				}
-				 else {
+				} else {
 					this.$request.baseRequest('post', '/orderInfo/api/end', {
 							id: this.id,
 							terminator: 2,
@@ -876,7 +901,7 @@
 
 	.tab-content {
 		position: relative;
-	   padding-right: 100rpx;
+		padding-right: 100rpx;
 	}
 
 	.right-btn {
@@ -899,7 +924,7 @@
 	.tabs {
 		// background: red;
 		margin-top: 20rpx;
-		overflow-x:scroll ;
+		overflow-x: scroll;
 	}
 
 	/deep/.u-transition {
@@ -942,8 +967,9 @@
 		z-index: 99;
 		top: 260rpx;
 	}
-	.look-map{
-		background:#2772FB;
+
+	.look-map {
+		background: #2772FB;
 		color: white;
 	}
 </style>

+ 36 - 6
pages/release/release.vue

@@ -206,7 +206,7 @@
 			:closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
 		</u-picker>
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
-			:showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
+			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
 			@cancel="cancelClick"></u-modal>
 		<u-toast ref="uToast"></u-toast>
 	</view>
@@ -220,6 +220,7 @@
 	export default {
 		data() {
 			return {
+				showCancelButton:true,
 				qyList: [],
 				isShowAlert: false,
 				alertTitle: '确定发布运输任务?',
@@ -328,15 +329,30 @@
 			}
 			this.getSFList()
 		},
-		onLoad(options) {
-
-			_this = this;
+		async onLoad() {
+			that = this
+			// #ifdef APP-PLUS
+			let _status = await that.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
+				phone: this.userInfo.phone,
+			}).then(res => {
+				return res.data.authenticationStatus
+			})
+			if (_status == '已禁用') {
+				this.isShowAlert = true
+				this.alertTitle = '账号审核中'
+				this.confirmText = '退出APP'
+				this.showCancelButton=false
+				return
+			} else {
+				console.log(1231233212332312312213)
+			}
+			// #endif
 			this.validityPeriod = this.$helper.makeValidityPeriod(0, '随时')
 			this.validityPeriodcq = this.$helper.makeValidityPeriod(0, '长期')
 			let _faddress = uni.getStorageSync('storage_faddress');
 			let _saddress = uni.getStorageSync('storage_saddress');
 			if (_faddress) {
-
+			
 				this.dataObj.sendCity = _faddress.city
 				this.dataObj.sendArea = _faddress.area
 				this.dataObj.sendPrivate = _faddress.province
@@ -368,8 +384,12 @@
 			this.dataObj.loadingDateStart = '随时'
 			this.dataObj.loadingDateEnd = '随时'
 			this.dataObj.taskValidity = '长期'
+			
+			
+		},
+		onLoad(options) {
 
-
+		
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
@@ -558,6 +578,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
 				if (this.validate()) return
 				if (this.dataObj.billingMethod == '元/吨') {