sen
2026-03-10 933046f7fd7fa9104bc33862951d570d88d7e2df
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<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>