Files
sykl-sm/pages/wechat/index.vue

111 lines
2.9 KiB
Vue

<template>
<view class="content">
<!-- <image class="weChat" src="@/static/imgs/weChat_back.png"></image>
<view class="weChatCont">
<image class="weChat-title" src="@/static/imgs/weChat_title.png" mode="widthFix"></image>
<view class="weChat-text">
<view class="weChat-img">
<image src="@/static/imgs/weChat_code.png" mode="widthFix"></image>
</view>
<view class="weChat-name">
<image src="@/static/imgs/weChat_name.png" mode="widthFix"></image>
</view>
</view>
<view class="weChatBtn">
<view class="btn" @click="$Router.push({name: 'Index'})">锶享体验官</view>
<view class="btn" @click="$Router.push({name: 'User'})">锶人中心</view>
</view> -->
</view>
</view>
</template>
<script>
import { wechatCode } from '@/apis/interfaces/authUrl'
export default {
data() {
return {
}
},
onLoad(options) {
// 获取微信code
wechatCode({
code: options.code
}).then(res => {
this.$store.commit('setOpenId', res.openid)
this.$Router.push({
name: this.$Route.query.pageName
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none"
})
})
},
onShow() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
.weChat {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
}
.weChatCont {
position: absolute;
width: 100%;
z-index: 9;
left: 0;
top: 0;
padding: $padding * 2;
box-sizing: border-box;
text-align: center;
.weChat-title {
width: 80%;
margin: 0 auto;
}
.weChat-text {
width: 65%;
margin: 60rpx auto 0;
box-sizing: border-box;
.weChat-img {
background-color: #FFFFFF;
padding: $padding;
box-sizing: border-box;
margin-top: $margin;
image {
width: 100%;
}
}
.weChat-name {
padding: $padding $padding + 10;
box-sizing: border-box;
image {
width: 100%;
}
}
}
.weChatBtn {
color: #000000;
text-align: center;
margin-top: 50rpx;
.btn {
background-color: #FFFFFF;
display: inline-block;
width: 100%;
height: 80rpx;
line-height: 80rpx;
border-radius: $radius-m;
}
}
}
</style>