|
@@ -1,78 +1,83 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <car-common :login="true"></car-common>
|
|
|
+ <u-navbar :is-back="false" title="我的" :border-bottom="false">
|
|
|
+ </u-navbar>
|
|
|
+ <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30 u-p-t-30">
|
|
|
+ <view class="u-m-r-20">
|
|
|
+ <u-avatar :src="pic" size="100"></u-avatar>
|
|
|
+ </view>
|
|
|
+ <view class="u-flex-1">
|
|
|
+ <view class="u-font-18 u-p-b-20">用户名称</view>
|
|
|
+ </view>
|
|
|
+ <view class="u-m-l-10 u-p-10">
|
|
|
+ <u-button type="primary" plain size="mini" shape="circle">修改资料</u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30 u-p-t-30">
|
|
|
+ <view class="u-m-r-20">
|
|
|
+ <u-avatar :src="pic" size="100"></u-avatar>
|
|
|
+ </view>
|
|
|
+ <view class="u-flex-1">
|
|
|
+ <view class="u-font-18 u-p-b-20">登录/注册</view>
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
|
|
|
+ <u-cell-group>
|
|
|
+ <u-cell-item title="乘车记录"></u-cell-item>
|
|
|
+ </u-cell-group>
|
|
|
+
|
|
|
+ <view class="u-m-t-20">
|
|
|
+ <u-cell-group>
|
|
|
+ <u-cell-item title="意见反馈"></u-cell-item>
|
|
|
+ <u-cell-item title="已绑定手机号"></u-cell-item>
|
|
|
+ <u-cell-item title="重置密码"></u-cell-item>
|
|
|
+ <u-cell-item title="关于车信达"></u-cell-item>
|
|
|
+ </u-cell-group>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="u-m-t-20">
|
|
|
+ <view class="signOut">退出账号</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import CarCommon from '@/components/Common.vue'
|
|
|
- import * as m from '@/utils/mixin.js'
|
|
|
- import * as API_WeiXin from '@/apis/weixin.js'
|
|
|
-
|
|
|
- import {
|
|
|
- getUrlParam,
|
|
|
- getWeixinRedirectURI,
|
|
|
- isWeiXin
|
|
|
- } from '@/utils'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ pic:'/static/img/user.png',
|
|
|
+ show:true
|
|
|
}
|
|
|
},
|
|
|
- components:{
|
|
|
- CarCommon
|
|
|
- },
|
|
|
- onReady() {
|
|
|
- console.log("my-mounted")
|
|
|
+ onLoad() {
|
|
|
|
|
|
},
|
|
|
- onShow() {
|
|
|
- console.log("my-mounted-show")
|
|
|
- console.log(m.get("wx_openId"))
|
|
|
-
|
|
|
- if(!m.get("wx_openId")){
|
|
|
-
|
|
|
- if (isWeiXin()) {
|
|
|
- this.getOpenid();
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
- getOpenid(){
|
|
|
- console.log("!!!!")
|
|
|
- const code = getUrlParam('code');
|
|
|
- if (!code) {
|
|
|
- var url= document.URL;
|
|
|
- if(process.car.NODE_ENV=='test'){
|
|
|
- url="http://xpgj.xiaoxinda.com/#/"
|
|
|
- }
|
|
|
- window.location.href = getWeixinRedirectURI(process.car.VUE_APP_WXAPPID,url);
|
|
|
- }else{
|
|
|
- console.log("code"+code)
|
|
|
-
|
|
|
- debugger
|
|
|
- API_WeiXin.getDataByCode(code).then(response => {
|
|
|
- console.log("openId+!!!!"+response.openid)
|
|
|
- debugger
|
|
|
- m.set("wx_openId",code)
|
|
|
- var linkUrl =document.URL.replace(/\?code=(.*?)&state=STATE/g, '');
|
|
|
- window.location = linkUrl;//隐藏参数
|
|
|
- //return Promise.resolve(response.openid);
|
|
|
- }).catch(error => {
|
|
|
- console.log(error);
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
+<style lang="scss">
|
|
|
+page{
|
|
|
+ background-color: #ededed;
|
|
|
+}
|
|
|
|
|
|
+.camera{
|
|
|
+ width: 54px;
|
|
|
+ height: 44px;
|
|
|
+
|
|
|
+ &:active{
|
|
|
+ background-color: #ededed;
|
|
|
+ }
|
|
|
+}
|
|
|
+.user-box{
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+.signOut{
|
|
|
+ height: 50px;
|
|
|
+ background-color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 50px;
|
|
|
+}
|
|
|
</style>
|