zhang 1 năm trước cách đây
mục cha
commit
916910470d

+ 2 - 1
.gitignore

@@ -1,4 +1,5 @@
 /unpackage/dist
-/unpackage/chart
+/unpackage/release
+/unpackage/cache
 /.hbuilderx
 /node_modules

+ 10 - 3
api/index.js

@@ -17,6 +17,13 @@ export function getIndex(data) {
 	});
 }
 
-
-
-
+/**
+ * 商品分类类版本
+ */
+export function getAppVersion(data) {
+	return request({
+		url: '/api/version',
+		method: 'get',
+		data
+	});
+}

+ 3 - 3
components/input-password/input-password.vue

@@ -44,8 +44,7 @@
 				}
 				// 判断是否输入的是取消案件
 				else if (val.keyCode == 190) {
-					this.colsePayPassword();
-					// 输入.无效
+					this.$emit('colse')
 				} else {
 					arr.push(val.key);
 				}
@@ -119,5 +118,6 @@
 				color: $base;
 			}
 		}
-	}
+	}
+
 </style>

+ 3 - 1
libs/i18n/lang/cn.json

@@ -508,7 +508,9 @@
 		"b6": "请输入验证码",
 		"b7": "确定要退出登录吗?",
 		"b8": "忘记支付密码?",
-		"b9": "请输入正确的邮箱地址"
+		"b9": "请输入正确的邮箱地址",
+		"c2": "无法在微信中下载,请用浏览器打开下载",
+		"c3": "注册成功是否登录?"
 	}
 	
 }

+ 3 - 1
libs/i18n/lang/en.json

@@ -598,6 +598,8 @@
 		"b6": "Please enter code",
 		"b7": "Are you sure you want to log out",
 		"b8": "Forgot payment password?",
-		"b9": "Please enter the correct email address"
+		"b9": "Please enter the correct email address",
+		"c2": "Unable to download on WeChat. Please open the download using your browser",
+		"c3": "Successfully registered, do you want to log in?"
 	}
 }

+ 3 - 1
libs/i18n/lang/tw.json

@@ -595,6 +595,8 @@
 		"b6": "請輸入驗證碼",
 		"b7": "確定要退出登錄嗎?",
 		"b8": "忘記支付密碼?",
-		"b9": "請輸入正確的郵箱地址"
+		"b9": "請輸入正確的郵箱地址",
+		"c2": "無法在微信中下載,請用瀏覽器打開下載",
+		"c3": "註冊成功是否登錄?"
 	}
 }

+ 74 - 22
pages/public/register.vue

@@ -46,6 +46,12 @@
 			</view>
 			<view><button class="uni-button uni-button-green uni-button-green-plain" type="green" plain="true"
 					hover-class="none" @click="login">{{$t('login.a4')}}</button></view>
+			<!-- #ifdef H5 -->
+			<view class="flex">
+				<button class="uni-button loadapp" @click="domApp('apk')">APK下载</button>
+				<button class="uni-button loadapp" @click="domApp('ios')">IOS下载</button>
+			</view>
+			<!-- #endif -->
 		</view>
 	</view>
 </template>
@@ -54,6 +60,9 @@
 		register,
 		verify
 	} from '@/api/login.js';
+	import {
+		getAppVersion
+	} from '@/api/index.js'
 	export default {
 		data() {
 			return {
@@ -67,7 +76,7 @@
 				time: '', //保存倒计时对象
 				countDown: 0, //倒计时
 				trade_password: '', // 交易密码
-				isPhone: true,  //是否为手机号,默认为true
+				isPhone: true, //是否为手机号,默认为true
 			};
 		},
 		onLoad(option) {
@@ -87,7 +96,7 @@
 			}
 			// #endif
 			// 获取扫码邀请人id
-			this.spread = option.spread||uni.getStorageSync('spread') || '';
+			this.spread = option.spread || uni.getStorageSync('spread') || '';
 		},
 		watch: {
 			// 监听倒计时
@@ -98,11 +107,38 @@
 			}
 		},
 		methods: {
-			
+			// #ifdef H5
+			domApp(type) {
+				console.log('111');
+				const bool = navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger';
+				if (bool) {
+					uni.showModal({
+						// title: '提示',
+						title: this.$t("enter.a7"),
+						// content: '无法在微信中下载,请用浏览器打开下载',
+						content: this.$t("login.c2"),
+						showCancel: false,
+					});
+				} else {
+					if (type == 'apk') {
+						getAppVersion().then((res) => {
+							console.log(res, 'res');
+							window.open(res.data.apk);
+						}).catch((err) => {
+							console.log(err, 'err');
+						})
+						return
+					}
+					if(type=="ios"){
+						
+					}
+				}
+			},
+			// #endif
 			checkAccount() {
-				 const regPhone = /^1[3|4|5|7|8][0-9]{9}$/;
-				    const regEmail = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
-				    this.isPhone = regPhone.test(this.account);
+				const regPhone = /^1[3|4|5|7|8][0-9]{9}$/;
+				const regEmail = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
+				this.isPhone = regPhone.test(this.account);
 			},
 			// 注册
 			register() {
@@ -112,16 +148,16 @@
 					return;
 				}
 				if (this.isPhone) {
-				      if (!/^1[3|4|5|7|8][0-9]{9}$/.test(this.account)) {
-				        this.$api.msg(obj.$t("safe.b8"));
-				        return;
-				      }
-				    } else {
-				      if (!/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/.test(this.account)) {
-				        this.$api.msg(obj.$t("login.b9"));
-				        return;
-				      }
-				    }
+					if (!/^1[3|4|5|7|8][0-9]{9}$/.test(this.account)) {
+						this.$api.msg(obj.$t("safe.b8"));
+						return;
+					}
+				} else {
+					if (!/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/.test(this.account)) {
+						this.$api.msg(obj.$t("login.b9"));
+						return;
+					}
+				}
 				// if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.account)) {
 				// 	obj.$api.msg('请输入正确的手机号');
 				// 	return;
@@ -148,12 +184,21 @@
 						duration: 2000,
 						position: 'top'
 					});
-					setTimeout(function() {
-						uni.navigateTo({
-							url: '/pages/public/login'
-						});
-					}, 1000)
-
+					uni.showModal({
+						title: this.$t("enter.a7"),
+						content: this.$t("login.c3"),
+						cancelText: this.$t("zy.b4"),
+						confirmText: this.$t("zy.b3"),
+						success: res => {
+							if(res.confirm){
+								uni.navigateTo({
+									url: '/pages/public/login'
+								});
+							}
+						},
+						fail: () => {},
+						complete: () => {}
+					});
 				});
 				//调用注册接口,成功跳转登录页
 			},
@@ -297,6 +342,13 @@
 			color: #999999;
 		}
 
+		.loadapp {
+			border: 1px solid #feb041;
+			background-color: transparent;
+			color: #feb041;
+			width: 45%;
+		}
+
 		.uni-button-green {
 			color: #ffffff;
 			background-color: #feb041;

BIN
static/icon/注册_slices.zip


BIN
unpackage/res/icons/1024x1024.png


BIN
unpackage/res/icons/120x120.png


BIN
unpackage/res/icons/144x144.png


BIN
unpackage/res/icons/152x152.png


BIN
unpackage/res/icons/167x167.png


BIN
unpackage/res/icons/180x180.png


BIN
unpackage/res/icons/192x192.png


BIN
unpackage/res/icons/20x20.png


BIN
unpackage/res/icons/29x29.png


BIN
unpackage/res/icons/40x40.png


BIN
unpackage/res/icons/58x58.png


BIN
unpackage/res/icons/60x60.png


BIN
unpackage/res/icons/72x72.png


BIN
unpackage/res/icons/76x76.png


BIN
unpackage/res/icons/80x80.png


BIN
unpackage/res/icons/87x87.png


BIN
unpackage/res/icons/96x96.png


BIN
unpackage/res/key/accle.keystore


+ 3 - 0
unpackage/res/key/包名密码.txt

@@ -0,0 +1,3 @@
+包名: com.accle.inc 
+别名: com.accle.inc 
+密码:112233

+ 54 - 35
utils/upApp.js

@@ -1,5 +1,5 @@
-import store from '../store/index.js'
-const getUpAppUrl = 'https://itunes.apple.com/cn/lookup?id=1524593346'
+import store from '../store'
+import {getAppVersion} from '@/api/index.js'
 const iosAppStroeUrl =
 	'https://apps.apple.com/cn/app/%E6%BB%A1%E5%9B%AD%E6%98%A5%E7%BA%BF%E4%B8%8A%E5%95%86%E5%9F%8E/id1524593346';
 
@@ -8,76 +8,95 @@ export function getUpApp () {
 	// 获取当前运行系统
 	let hj = uni.getSystemInfoSync().platform;
 	// 获取仓库app数据对象
-	let app = store.state.isShowIllegality;
+	// let app = store.state.isShowIllegality;
 	// 当前系统为安卓则显示数据
 	if (hj === 'android') {
 		// 设置默认显示数据
-		app = true;
-		store.commit('changeState', {
-			name: 'app',
-			value: app
-		});
+		// app = true;
+		// store.commit('changeState', {
+		// 	name: 'app',
+		// 	value: app
+		// });
 	}
-	uni.request({
-		url: getUpAppUrl,
-		method: 'POST',
-		data: {},
-		success: res => {
+	console.log('开始升级');
+	getAppVersion().then((res)=>{
+		console.log(res,'回调');
 			let r = res.data;
 			plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
+				console.log(r.version,'获取版本');
 				// 保存线上版本号
-				let version = r.results[0].version;
+				let version = r.version;
 				// 获取线上版本
-				const arr = r.results[0].version.split('.');
+				const arr = r.version.split('.');
 				// 获取当前系统
 				const arr1 = wgtinfo.version.split('.');
+				console.log(version,'升级数据2');
+				console.log(arr,'升级数据3');
+				console.log(arr1,'升级数据4');
+				let up = false;
+				
 				for (let i = 0; i < arr.length; i++) {
 					// 线上版本号
 					const x = +arr[i];
 					// 线下版本号
 					const y = +arr1[i];
 					// 判断当前版本是否为小于等于线上版本
-					if (x <= y) {
+					console.log(x,y,'循环');
+					if (x >= y) {
 						// 只有ios才需要显示
-						if (hj === 'ios') {
-							// 设置显示数据
-							app = true;
-							store.commit('changeState', {
-								name: 'app',
-								value: app
-							});
-						}
+						// if (hj === 'ios') {
+						// 	// 设置显示数据
+						// 	// app = true;
+						// 	// store.commit('changeState', {
+						// 	// 	name: 'app',
+						// 	// 	value: app
+						// 	// });
+						// }
 						// 当版本较低时更新数据
-						if (x < y) {
+						console.log(x,y);
+						if(up==true){
+							return;
+						}
+						if (x > y) {
+							up = true;
 							uni.showModal({
 								title: '提示',
 								content: '请更新应用',
 								showCancel: false,
 								success(e) {
-									if (hj === 'ios') {
-										plus.runtime.openURL(
-											iosAppStroeUrl
-										);
-									}
+									// if (hj === 'ios') {
+									// 	plus.runtime.openURL(
+									// 		iosAppStroeUrl
+									// 	);
+									// }
 									if (hj === 'android') {
 										// plus.runtime.openURL('http://lxscimg.liuniu946.com/lxscV' + version + '.apk');
-										_self.downApp(version);
+										console.log(r.apk,'下載地址');
+										downApp(r.apk);
 									}
 								}
 							});
 						}
-						return;
+						
 					}
 				}
 			});
-		},
-	});
+	}).catch((res)=>{
+		console.log(res);
+	})
 }
 // 下载app
 export function downApp (version) {
+	let url = '';
+	if(version.indexOf('http')>-1){
+		url = version;
+	}else{
+		url = store.state.baseURL+version
+	}
+	console.log(url);
 	plus.nativeUI.showWaiting('下载升级包...');
 	plus.downloader
-		.createDownload('http://lxscimg.liuniu946.com/lxscV' + version + '.apk', {}, (d, status) => {
+		.createDownload(url, {}, (d, status) => {
 			if (status == 200) {
 				installApp(d.filename); // 安装app
 			} else {