修改html标签为uni标签,修改rem单位为rpx,修改提示及确认为uniapi,修改登录模块为uni接口,修改css入口为APP.vue,增加app端样式支持
This commit is contained in:
@ -1,28 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="switchWindow" :class="switchActive === true ? 'on' : ''">
|
||||
<view>
|
||||
<view class="switchWindow" :class="switchActive === true ? 'on' : ''">
|
||||
<!-- @/assets/images/public.png -->
|
||||
<div class="pictrue">
|
||||
<img v-if="login_type === 'h5'" :src="$VUE_APP_RESOURCES_URL+'/images/h5.png'" />
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/h5.png'" alt="" v-else />
|
||||
</div>
|
||||
<view class="pictrue">
|
||||
<image v-if="login_type === 'h5'" :src="$VUE_APP_RESOURCES_URL+'/images/h5.png'" />
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/h5.png'" alt v-else />
|
||||
</view>
|
||||
<!-- 是否选择切换到小程序账户? -->
|
||||
<div class="info">
|
||||
是否选择切换到<span class="font-color" v-if="login_type === 'h5'"
|
||||
>微信账号</span
|
||||
>
|
||||
<span class="font-color" v-else>手机用户</span>?
|
||||
</div>
|
||||
<div class="switchBnt" @click="switchH5">切换</div>
|
||||
<div class="switchBnt cancelBnt" @click="switchClose">取消</div>
|
||||
</div>
|
||||
<div
|
||||
class="mask"
|
||||
@touchmove.prevent
|
||||
v-show="switchActive === true"
|
||||
@click="switchClose"
|
||||
></div>
|
||||
</div>
|
||||
<view class="info">
|
||||
<text>是否选择切换到</text>
|
||||
<text class="font-color" v-if="login_type === 'h5'">微信账号</text>
|
||||
<text class="font-color" v-else>手机用户</text>
|
||||
<text>?</text>
|
||||
</view>
|
||||
<view class="switchBnt" @click="switchH5">
|
||||
<text>切换</text>
|
||||
</view>
|
||||
<view class="switchBnt cancelBnt" @click="switchClose">
|
||||
<text>取消</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent v-show="switchActive === true" @click="switchClose"></view>
|
||||
</view>
|
||||
</template>
|
||||
<style>
|
||||
.switchWindow {
|
||||
@ -47,6 +46,7 @@
|
||||
opacity: 0;
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
.switchWindow.on {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
@ -55,22 +55,26 @@
|
||||
-moz-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
}
|
||||
|
||||
.switchWindow .pictrue {
|
||||
width: 2.36rem;
|
||||
height: 2.36rem;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.switchWindow .pictrue img {
|
||||
|
||||
.switchWindow .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.switchWindow .info {
|
||||
font-size: 0.32rem;
|
||||
color: #282828;
|
||||
margin-top: 0.44rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.switchWindow .switchBnt {
|
||||
font-size: 0.32rem;
|
||||
color: #fff;
|
||||
@ -84,6 +88,7 @@
|
||||
background-image: -webkit-linear-gradient(to right, #f67a38 0%, #f11b09 100%);
|
||||
background-image: -moz-linear-gradient(to right, #f67a38 0%, #f11b09 100%);
|
||||
}
|
||||
|
||||
.switchWindow .switchBnt.cancelBnt {
|
||||
background-color: #fff;
|
||||
color: #999;
|
||||
@ -119,25 +124,31 @@ export default {
|
||||
},
|
||||
switchH5() {
|
||||
let that = this;
|
||||
uni.showLoading({title: '正在切换中'})
|
||||
uni.showLoading({
|
||||
title: "正在切换中"
|
||||
});
|
||||
if (that.login_type === "h5") {
|
||||
cookie.set("loginType", "wechat", 60);
|
||||
uni.hideLoading()
|
||||
uni.hideLoading();
|
||||
this.$store.commit("LOGOUT");
|
||||
this.$emit("changeswitch", false);
|
||||
location.reload();
|
||||
} else {
|
||||
switchH5Login()
|
||||
.then(({ data }) => {
|
||||
uni.hideLoading()
|
||||
uni.hideLoading();
|
||||
const expires_time = dayjs(data.expires_time);
|
||||
store.commit("LOGIN", data.token, expires_time);
|
||||
this.$emit("changeswitch", false);
|
||||
location.reload();
|
||||
})
|
||||
.catch(err => {
|
||||
uni.hideLoading()
|
||||
return that.$dialog.toast({ mes: err });
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user