<template>
|
<view class="">
|
<Nav title="车辆预约平台" :isShowLeft="sso_user_token" leftText="退出登录" customBack="pages/login/index"></Nav>
|
|
<view>
|
<view class="content-item" @click="goToCar('pages/vehicle/list')">
|
<u-image src="/static/image/clyy.png" width="119px" height="119px"></u-image>
|
<view style="display: flex;align-items: center;font-weight: bold">车辆预约</view>
|
</view>
|
<view class="content-item" @click="goToAudit('pages/auditCar/list')">
|
<u-image src="/static/image/yysh.png" width="119px" height="119px"></u-image>
|
<view style="display: flex;align-items: center;font-weight: bold">预约审核</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {getSessionKey} from "../../common/api";
|
|
export default {
|
name: "index",
|
data() {
|
return {
|
form:{}
|
}
|
},
|
onLoad(){
|
this.wxLogin();
|
},
|
|
methods:{
|
goToCar(url){
|
this.$u.route(url);
|
},
|
goToAudit(url){
|
if (this.sso_user_token){
|
this.$u.route(url);
|
}else{
|
this.$u.route("pages/login/index");
|
}
|
|
},
|
wxLogin(){
|
let _this = this;
|
uni.login({
|
provider:'weixin',
|
success:function (loginRes) {
|
if (loginRes.errMsg.indexOf('ok') !== -1){
|
_this.getOpenId(loginRes.code);
|
}
|
},
|
fail:(e)=>{
|
}
|
})
|
},
|
getOpenId(code){
|
let self = this;
|
getSessionKey({code:code}).then(res =>{
|
self.form.openId = res.msg;
|
this.$u.vuex('car_open_id', res.msg);
|
});
|
}
|
}
|
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.content {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.top-bg {
|
padding: 20px 40px;
|
box-sizing: border-box;
|
width: 100%;
|
text-align: center;
|
height: 120px;
|
background: #67a8fa;
|
color: #ffffff;
|
display: flex;
|
align-items: center;
|
}
|
.content-item{
|
width: 90%;
|
margin: 20px auto;
|
background: #409effc1;
|
border-radius: 10px;
|
height: 120px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
box-sizing: border-box;
|
padding: 0 20px 0 40px;
|
}
|
.box-title {
|
background: #fff;
|
color: #67a8fa;
|
font-size: 12px;
|
width: 60px;
|
border-radius: 3px;
|
margin-top: 10px;
|
}
|
</style>
|