|
@@ -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;
|