cmy 1 gadu atpakaļ
vecāks
revīzija
0b6f56166e
5 mainītis faili ar 116 papildinājumiem un 81 dzēšanām
  1. 2 4
      pages/navigation/index.vue
  2. 1 1
      pages/public/forget.vue
  3. 10 10
      pages/user/mytihuolist.vue
  4. 11 1
      store/index.js
  5. 92 65
      utils/upApp.js

+ 2 - 4
pages/navigation/index.vue

@@ -33,11 +33,9 @@
 			<view class="nav-item" @click="nav('/pages/index/index')">
 				<image class="nav-img" src="../../static/img/newbanner.png" mode=""></image>
 			</view>
-			<!-- #ifndef APP -->
-			<view class="nav-item" @click="nav('/pages/navigation/main')">
+			<view v-if="changeState" class="nav-item" @click="nav('/pages/navigation/main')">
 				<image class="nav-img" src="../../static/img/oldbanner.png" mode=""></image>
 			</view>
-			<!-- #endif -->
 		</view>
 		<view class="box margin-t-30 flex">
 			<view class="leftbox flex">
@@ -114,7 +112,7 @@
 		},
 		onLoad() {},
 		methods: {
-			...mapMutations(['setLat', 'setLon', 'setChoose']),
+			...mapMutations(['setLat', 'setLon', 'setChoose','changeState']),
 			goDetails(e) {
 				uni.navigateTo({
 					url: '/pages/index/messageInfo?id=' + this.article[e].id

+ 1 - 1
pages/public/forget.vue

@@ -59,7 +59,7 @@ export default {
 				obj.$api.msg('请输入手机');
 				return;
 			}
-			if (!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(obj.phone) && !/(^1[3|4|5|6|7|8|9][0-9]{9}$)/.test(this.phone)) {
+			if (this.phone.length!=11) {
 				obj.$api.msg('请输入正确的手机');
 				return;
 			}

+ 10 - 10
pages/user/mytihuolist.vue

@@ -154,17 +154,17 @@
 				uni.navigateTo({
 					url:"./goodProduct?id="+item.id
 				})
-				uni.showModal({
-					title: '支付提示',
-					content: `是否立即兑换兑换`,
-					cancelText: '取消',
-					confirmText: '兑换',
-					success: res => {
-						if(res.confirm){
+				// uni.showModal({
+				// 	title: '支付提示',
+				// 	content: `是否立即兑换兑换`,
+				// 	cancelText: '取消',
+				// 	confirmText: '兑换',
+				// 	success: res => {
+				// 		if(res.confirm){
 							
-						}
-					},
-				});
+				// 		}
+				// 	},
+				// });
 			},
 			// 转换金额为数字
 			moneyNum(value) {

+ 11 - 1
store/index.js

@@ -23,7 +23,13 @@ const store = new Vuex.Store({
 		weichatObj: '', //微信对象
 		// #endif
 		latitude: '',
-		longitude: ''
+		longitude: '',
+		// #ifdef APP-PLUS
+		isShowIllegality:false,//不显示ios审核不允许的功能
+		// #endif
+		// #ifndef APP-PLUS
+		isShowIllegality:true,//允许显示隐藏信息
+		// #endif
 	},
 	mutations: {
 		setLat(state, provider) {
@@ -56,6 +62,10 @@ const store = new Vuex.Store({
 		setBuy1(state, provider) {
 			state.isbuy1 = provider;
 		},
+		// 修改显示隐藏ios审核不允许显示的功能
+		changeState(state, provider){
+			state.isShowIllegality = provider;
+		}
 	},
 	modules: {
 		user

+ 92 - 65
utils/upApp.js

@@ -1,90 +1,117 @@
 import store from '../store/index.js'
 const baseurl = store.state.baseURL
-const getUpAppUrl = baseurl + '/api/version'
+const getUpAppUrl = baseurl + '/api/version';
+const getIosUpAppUrl = 'https://itunes.apple.com/cn/lookup?id=6474850968'
+// 请求升级获取数据地址
 const iosAppStroeUrl =
-	'https://apps.apple.com/cn/app/%E6%98%93%E8%B6%A3cbb/id6474850968';
+	'https://apps.apple.com/cn/app/%E6%98%93%E8%B6%A3cbb/id=6474850968';
 
 // 获取app是否需要升级
 export function getUpApp() {
 	// 获取当前运行系统
 	let hj = uni.getSystemInfoSync().platform;
 	// 获取仓库app数据对象
-	let app = store.state.isShowIllegality;
-	// 当前系统为安卓则显示数据
-	if (hj === 'android') {
-		// 设置默认显示数据
-		app = true;
-		// store.commit('changeState', {
-		// 	name: 'app',
-		// 	value: app
-		// });
-	}
-	uni.request({
-		url: getUpAppUrl,
-		method: 'GET',
-		data: {},
-		success: res => {
-			let r = res.data.data;
-			console.log(r.data, '234')
-			plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
-				// 保存线上版本号
-				let version = r.url;
-				console.log(version, 'versionversionversionversion');
-				// 获取线上版本
-				console.log(r, '+++++++++++')
-				const arr = r.version.split('.');
-
-				// 获取当前系统
-				const arr1 = wgtinfo.version.split('.');
-				console.log(arr, arr1)
-				for (let i = 0; i < arr.length; i++) {
-					// 线上版本号
-					const x = +arr[i];
-					// 线下版本号
-					const y = +arr1[i];
-					console.log(arr, arr1, "版本号")
-					// 判断当前版本是否为小于等于线上版本
-					if (x >= y) {
-						console.log('dashabi2020')
-						console.log(x, y)
-						// 只有ios才需要显示
-						if (hj === 'ios') {
+	if (hj === 'ios') {
+		uni.request({
+			url: getIosUpAppUrl,
+			method: 'POST',
+			data: {},
+			success: res => {
+				let r = res.data;
+				plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
+					// 保存线上版本号
+					let version = r.results[0].version;
+					// 获取线上版本
+					const arr = r.results[0].version.split('.');
+					// 获取当前系统
+					const arr1 = wgtinfo.version.split('.');
+					for (let i = 0; i < arr.length; i++) {
+						// 线上版本号
+						const x = +arr[i];
+						// 本地版本号
+						const y = +arr1[i];
+						// 判断当前版本是否为小于等于线上版本
+						if (x >= y) {
 							// 设置显示数据
-							app = true;
 							store.commit('changeState', {
 								name: 'app',
-								value: app
+								value: true
 							});
-						}
-						// 当版本较低时更新数据
-						if (x > y) {
-							uni.showModal({
-								title: '提示',
-								content: '请更新应用',
-								showCancel: false,
-								success(e) {
-									if (hj === 'ios') {
+							// 当版本较低时更新数据
+							if (x > y) {
+								uni.showModal({
+									title: '提示',
+									content: '请更新应用',
+									showCancel: false,
+									success(e) {
 										plus.runtime.openURL(
 											iosAppStroeUrl
 										);
 									}
-									if (hj === 'android') {
+								});
+							}
+						}
+					}
+				});
+			},
+		});
+		// 设置显示数据
+		return
+	}
+	// 当前系统为安卓则显示数据
+	if (hj === 'android') {
+		// 设置默认显示数据
+		store.commit('changeState', {
+			name: 'app',
+			value: true
+		});
+		uni.request({
+			url: getUpAppUrl,
+			method: 'GET',
+			data: {},
+			success: res => {
+				let r = res.data.data;
+				console.log(r.data, '234')
+				plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
+					// 保存线上版本号
+					let version = r.url;
+					console.log(version, 'versionversionversionversion');
+					// 获取线上版本
+					console.log(r, '+++++++++++')
+					const arr = r.version.split('.');
+					// 获取当前系统
+					const arr1 = wgtinfo.version.split('.');
+					console.log(arr, arr1)
+					for (let i = 0; i < arr.length; i++) {
+						// 线上版本号
+						const x = +arr[i];
+						// 线下版本号
+						const y = +arr1[i];
+						console.log(arr, arr1, "版本号")
+						// 判断当前版本是否为小于等于线上版本
+						if (x >= y) {
+							// 只有ios才需要显示
+							// 当版本较低时更新数据
+							if (x > y) {
+								uni.showModal({
+									title: '提示',
+									content: '请更新应用',
+									showCancel: false,
+									success(e) {
 										// plus.runtime.openURL('http://lxscimg.liuniu946.com/lxscV' + version + '.apk');
 										downApp(version);
-
 									}
-								}
-							});
-							return;
+								});
+							}
 						}
 					}
-				}
-			});
-		},
-		fail: res => {
-			console.log(res, 'shib');
-		}
-	});
+				});
+			},
+			fail: res => {
+				console.log(res, 'shib');
+			}
+		});
+	}
 }
 // 下载app
 export function downApp(version) {