Browse Source

我的页面增加车牌相关

XWookey 1 year ago
parent
commit
702122543c

+ 3 - 1
app.json

@@ -44,7 +44,9 @@
     "pages/ucenter/accountsecurity/unbindphone/unbindphone",
     "pages/howtouse/howtouse",
     "pages/agreement/userAgreement",
-    "pages/agreement/list"
+    "pages/agreement/list",
+    "pages/ucenter/car/car",
+    "pages/ucenter/car/bindCar"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 183 - 0
components/selectpopup/selectpopup.js

@@ -0,0 +1,183 @@
+// components/selectpopup/selectpopup.js
+
+//上次按钮点击时间
+var lasttime = 0;
+//按键防抖时间
+var clickTime = 200;
+
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    itemHeight: {
+      type: Number,
+      value:100
+    },
+    padding: {
+      type: Number,
+      value:15
+    },
+    radius: {
+      type: Number,
+      value:15
+    },
+    showExit: {
+      type: Boolean,
+      value:true
+    },
+    exitText: {
+      type: String,
+      value:"取消"
+    },
+    exitColor: {
+      type: String,
+      value:"#666666"
+    },
+    selectItemText: {
+      type: Array,
+      value: ["测试1", "测试2"]
+    },
+    selectItemTextColor: {
+      type: Array,
+      value: ["#576B95", "#576B95"],
+    },
+    outExit: {
+      type: Boolean,
+      value:false
+    },
+    mark: {
+      type: String,
+      value:"selectPopup"
+    },
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    //item高度,单位rpx
+    itemHeight: 100,
+    //padding
+    padding: 15,
+    //圆角
+    radius: 15,
+    //是否显示取消按钮
+    showExit: true,
+    //取消按钮文字
+    exitText: "取消",
+    //取消按钮文字颜色
+    exitColor: "#666666",
+    //item内容,数组
+    selectItemText: ["测试1", "测试2"],
+    //item文字颜色,数组,不设置默认#576B95
+    selectItemTextColor: ["#576B95", "#ff0000"],
+    popupSelectDisplay: "hidden",
+    //点击空白区域是否取消显示
+    outExit:false,
+    //组件标识
+    mark:"selectPopup",
+
+
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+    click: function (e) {
+      //获取点击时间
+      let d = new Date();
+      let nowtime = d.getTime();
+      if (nowtime - lasttime > clickTime) {
+        lasttime = nowtime;
+        let index = parseInt(e.currentTarget.id.replace("list_", ""));
+        console.log(index)
+        this.closePopup('selectPopupItemClick', [ index,this.data.mark ])
+      }
+    },
+    exitClick: function (e) {
+      //获取点击时间
+      let d = new Date();
+      let nowtime = d.getTime();
+      if (nowtime - lasttime > clickTime) {
+        lasttime = nowtime;
+        switch (e.currentTarget.id) {
+          case "out":
+            if(this.data.outExit){
+              this.closePopup('selectPopupExit', [ -1,this.data.mark ])
+            }
+            break;
+            case "cancel":
+              this.closePopup('selectPopupExit', [ -1,this.data.mark ])
+            
+            break;
+        }
+        
+      }
+    },
+    show(selectItemText,selectItemTextColor){
+      var that = this
+      that.setData({
+        selectItemText: selectItemText,
+        selectItemTextColor:selectItemTextColor,
+      })
+      this.openPopup() 
+    },
+
+    //打开弹窗
+    openPopup() {
+      var query = this.createSelectorQuery()
+      var that = this
+
+      query.select('#popup_select_content').boundingClientRect(function (res) {
+
+        var screenH = res.height;
+        that.setData({
+          popupSelectDisplay: "visible",
+        })
+        that.animation_select = wx.createAnimation({
+          duration: 300,
+          timingFunction: 'ease',
+          delay: 0,
+          transformOrigin: 'left top 0',
+        })
+        that.animation_select.translate(0, -screenH).step()
+        that.setData({
+          //输出动画
+          animation_select: that.animation_select.export()
+        })
+      }).exec();
+
+    },
+    //关闭弹窗
+    closePopup(event,detail) {
+      //实例化一个动画
+      var that = this
+      that.animation_select = wx.createAnimation({
+        // 动画持续时间,单位ms,默认值 400
+        duration: 300,
+        timingFunction: 'ease',
+        // 延迟多长时间开始
+        delay: 0,
+        transformOrigin: 'left top 0',
+      })
+      that.animation_select.translate(0, 0).step()
+      that.setData({
+        //输出动画
+        animation_select: that.animation_select.export()
+      })
+      setTimeout(function () {
+        that.setData({
+          popupSelectDisplay: "hidden",
+        })
+        this.triggerEvent(event,detail,{}) 
+
+      }.bind(this), 300)
+    }
+
+  }
+})

+ 4 - 0
components/selectpopup/selectpopup.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 37 - 0
components/selectpopup/selectpopup.wxml

@@ -0,0 +1,37 @@
+<!--components/selectpopup/selectpopup.wxml-->
+
+
+
+<!--  start -->
+<view class="popup_select_bg" style=" visibility:{{popupSelectDisplay}}" id="out" bindtap='exitClick'>
+
+	<view class="popup_select_content_bg " style="padding:{{padding}}rpx" id="popup_select_content" animation="{{animation_select}}">
+
+
+		<view class="popup_select_content_top" style="border-bottom-left-radius: {{padding== 0 ? '0':radius}}rpx;border-bottom-right-radius: {{padding== 0 ? '0':radius}}rpx; border-top-left-radius:{{radius}}rpx;border-top-right-radius:{{radius}}rpx;">
+
+
+
+
+			<view class="popup_select_item_bg" style="height:{{itemHeight}}rpx"  wx:for="{{selectItemText}}"  wx:key="selectItemText" >
+				<view class="popup_select_item_view" id="list_{{index}}" bindtap='click' hover-class="click_hover" hover-stay-time="100" style="color:{{selectItemTextColor[index]}}"> {{item}} </view>
+		
+			<view class="popup_select_item_splitLine"  hidden="{{(index+1)==selectItemText.length? true:false}}"   />
+
+	</view>
+
+
+		</view>
+
+		<view class="popup_select_item_splitLine" hidden="{{((padding== 0)&showExit) ? false:true}}" />
+
+		<view class="popup_select_content_exit" hidden="{{!showExit}}"  style="margin-top: {{padding== 0 ? '0':padding}}rpx;  border-radius: {{padding== 0 ? '0':radius}}rpx;">
+			<view class="popup_select_item_bg" style="height:{{itemHeight}}rpx">
+				<view class="popup_select_item_view" id="cancel" bindtap='exitClick' hover-class="click_hover" hover-stay-time="100" style="color:{{exitColor}}"> {{exitText}} </view>
+			</view>
+
+		</view>
+
+	</view>
+</view>
+<!--  end -->

+ 104 - 0
components/selectpopup/selectpopup.wxss

@@ -0,0 +1,104 @@
+/* components/selectpopup/selectpopup.wxss */
+
+
+.popup_select_bg{
+  position: absolute;
+  /* display: flex;
+    justify-content: end;
+    align-items:center;
+    flex-direction: column-reverse; */
+  height: 100%;
+  width: 100%;
+  background: rgba(100, 100, 100, 0.4);
+  z-index: 9999;
+}
+.popup_select_content_bg{
+  position: absolute;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items:center;
+height: auto;
+padding: 20rpx;
+width: 100%;
+top: 100%;
+box-sizing: border-box;
+}
+
+.popup_select_content_top{
+  display: flex;
+  justify-content: end;
+  align-items:center;
+  flex-direction: column;
+height: auto;
+width: 100%;
+border-bottom-left-radius: 15rpx;
+border-bottom-right-radius: 15rpx;
+border-top-right-radius: 15rpx;
+border-top-left-radius: 15rpx;
+background-color: #ffffff;
+}
+
+.popup_select_content_exit{
+  display: flex;
+  justify-content: end;
+  align-items:center;
+  flex-direction: column;
+height: auto;
+width: 100%;
+margin-top: 20rpx;
+border-radius: 15rpx;
+background-color: #ffffff;
+
+
+
+
+}
+
+
+
+
+.popup_select_item_view{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+
+
+.popup_select_item_bg{
+  width: 100%;
+  height: 100rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: #576B95;
+  flex-direction: column;
+ 
+}
+
+.popup_select_item_splitLine {
+  height: 1px;
+  width: 100%;
+  background:linear-gradient(to left,#ffffff,#dddddd,#ffffff);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.click_hover{
+   opacity: 0.5;
+ }

BIN
images/car_more.png


+ 151 - 0
pages/ucenter/car/bindCar.js

@@ -0,0 +1,151 @@
+// pages/ucenter/car/bindCar.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    carNum: '',
+    carId: '',
+    updateFlag: false
+  },
+  inputPlateNumber(e){
+    this.setData({
+      carNum: e.detail.value
+    });
+  },
+  saveCarNum(){
+    let carNum = this.data.carNum;
+    if (!this.checkCarNum(carNum)) {
+      wx.showModal({
+        title: '提示',
+        showCancel:false,
+        content: '车牌号输入有误,请重新输入',
+        confirmColor:'#00AADD',
+      });
+      return;
+    } else {
+      this.setData({
+        carNum: carNum,
+        errorMsg: ''
+      });
+    }
+    this.bindUpdateCarNum(carNum);
+  },
+  checkCarNum(carNum){
+    if (carNum){
+      // if (!(/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(this.data.carNum))) {
+      if (!/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领].*$/.test(carNum)) {
+        return false;
+      }
+    }
+    return true;
+  },
+  bindUpdateCarNum(carNum) {
+    let userInfo = wx.getStorageSync('userInfo');
+    // loginName: userInfo.loginName
+    
+    // 判断是更新车牌还是新增车牌
+    console.info(this.data.updateFlag)
+    if(this.data.updateFlag){
+      console.info("更新车牌号:" + carNum + ",用户:" + userInfo.loginName + ",车牌号:" + this.data.carId)
+      wx.navigateBack({
+        delta: 1
+      });
+    }else{
+      console.info("新增车牌号:" + carNum + ",用户:" + userInfo.loginName + "")
+    }
+    
+    
+    
+    // wx.request({
+    //   url: getApp().globalData.postHeadAgreement + '/restapi/wechat/updateUser',
+    //   data: {
+    //     loginName,
+    //     sex: sex,
+    //     license_number,
+    //     email,
+    //   },
+    //   method: 'POST',
+    //   success(res1) {
+    //     if (res1.data.code == 1) {
+    //       that.setData({
+    //         errorMsg: res1.data.msg
+    //       })
+    //     }
+    //   }
+    // });
+
+
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    let {carId} = options;
+    let updateFlag = false;
+    if(carId){
+      updateFlag = true;
+    }else{
+      if(carId==0){
+        updateFlag = true
+      }else{
+        updateFlag = false
+      }
+    }
+    console.info(updateFlag?'更新模式':'新增模式')
+    this.setData({
+      carId,
+      updateFlag
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 4 - 0
pages/ucenter/car/bindCar.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "绑定车辆",
+  "usingComponents": {}
+}

+ 11 - 0
pages/ucenter/car/bindCar.wxml

@@ -0,0 +1,11 @@
+<!--pages/ucenter/car/bindCar.wxml-->
+<view class="card">
+  <view class="icard">
+    <view class="t1">车牌号</view>
+    <view class="t2">绑定后可在指定场站享受停车费减免优惠</view>
+    <view class='input_view'>
+      <input placeholder='请输车牌号' bindchange='inputPlateNumber' placeholder-class='placeholder'></input>
+    </view>
+    <button class='login_button' bindtap="saveCarNum" >保存</button>
+  </view>
+</view>

+ 109 - 0
pages/ucenter/car/bindCar.wxss

@@ -0,0 +1,109 @@
+/* pages/ucenter/car/bindCar.wxss */
+page{
+  background-color: #F5F5F5;
+}
+
+.card{
+  width: calc(100% - 100rpx);
+  margin: 10rpx;
+  height: 540rpx;
+  background-color: #FFFFFF;
+  border-radius: 10rpx;
+  display: flex;
+  flex-direction: column;
+  padding: 20rpx 40rpx;
+}
+
+.card .t1{
+  font-size: 32rpx;
+  margin: 10rpx 0;
+}
+
+.card .t2{
+  font-size: 24rpx;
+  color:#aaaaaa;
+}
+
+.input_view input {
+  width: calc(100% - 122rpx);
+  display: inline-block;
+  font-size: 34rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
+  color: #434343;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.input_view .placeholder {
+  color: #999999;
+  font-size: 34rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.input_view{
+  box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 40rpx 0rpx;
+  height: 88rpx;
+}
+
+.login_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 125rpx 135rpx 0 135rpx;
+}
+
+.login_button_disable {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #c9c9c9;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 125rpx 135rpx 0 135rpx;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}
+

+ 221 - 0
pages/ucenter/car/car.js

@@ -0,0 +1,221 @@
+// pages/ucenter/car/car.js
+
+var selectPopup;
+var idx;
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    textArray : ["设为默认","修改车牌号","删除车牌号"],
+    textArrayColor : ["#576B95","#576B95","#576B95"],
+    userCarList: [{
+      "carId":1,
+      "sysUser":{},
+      "plateNumber":'绯·ABCDEFG',
+      "defaultType":1,
+      "status":0
+      },
+      {
+      "carId":2,
+      "sysUser":{},
+      "plateNumber":'绯·ABCDEFG',
+      "defaultType":0,
+      "status":0
+      },
+      {
+      "carId":3,
+      "sysUser":{},
+      "plateNumber":'绯·ABCDEFG',
+      "defaultType":0,
+      "status":0
+      },
+      {
+      "carId":1,
+      "sysUser":{},
+      "plateNumber":'绯·ABCDEFG',
+      "defaultType":0,
+      "status":0
+      },
+      {
+        "carId":0,
+        "sysUser":{},
+        "plateNumber":'绯·ABCDEFG',
+        "defaultType":0,
+        "status":0
+        },
+      {
+        "carId":0,
+        "sysUser":{},
+        "plateNumber":'绯·ABCDEFG',
+        "defaultType":0,
+        "status":0
+        },
+        {
+          "carId":0,
+          "sysUser":{},
+          "plateNumber":'绯·ABCDEFG',
+          "defaultType":0,
+          "status":0
+          },
+          {
+            "carId":0,
+            "sysUser":{},
+            "plateNumber":'绯·ABCDEFG',
+            "defaultType":0,
+            "status":0
+            },
+            {
+              "carId":0,
+              "sysUser":{},
+              "plateNumber":'绯·ABCDEFG',
+              "defaultType":0,
+              "status":0
+              },
+              {
+                "carId":0,
+                "sysUser":{},
+                "plateNumber":'绯·ABCDEFG',
+                "defaultType":0,
+                "status":0
+                },
+    ]
+  },
+  showMore(e){
+    idx = e.currentTarget.dataset.idx;
+    selectPopup.show(this.data.textArray,this.data.textArrayColor);
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+    selectPopup = this.selectComponent("#selectpopup");
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    let userInfo = wx.getStorageSync('userInfo');
+		wx.request({
+		  url: getApp().globalData.postHeadAgreement + '/restapi/wechat/carList',
+		  data: {
+			loginName: userInfo.loginName
+		  },
+		  method: 'POST',
+		  success: function (res) {
+        console.info(res)
+		  },
+		  fail(e) {
+			console.log("查询车辆失败");
+			log.info('[查询车辆]','[fail]', e);
+		  }
+		});
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  },
+  bindCar(){
+    let url = '/pages/ucenter/car/bindCar'
+    wx.navigateTo({
+      url
+    });
+  },
+  selectPopupItemClick:function(e){
+    if((!idx) && idx!=0){
+      console.info("idx is null!!!")
+      return;
+    }
+    let index = e.detail[0]
+    this.data.textArray[index]
+    // ["设为默认","修改车牌号","删除车牌号"],
+    let userInfo = wx.getStorageSync('userInfo');
+    if(index==0){
+      console.info("设为默认")
+      // wx.request({
+      //   url: getApp().globalData.postHeadAgreement + '/restapi/wechat/carAlter',
+      //   data: {
+      //     loginName: userInfo.loginName,
+      //     carId: idx,
+
+      //   },
+      //   method: 'POST',
+      //   success: function (res) {
+      //     console.info(res)
+      //   },
+      //   fail(e) {
+      //   console.log("查询车辆失败");
+      //   log.info('[查询车辆]','[fail]', e);
+      //   }
+      // });
+    }else if(index==1){
+      console.info("修改车牌号")
+      let url = '/pages/ucenter/car/bindCar?carId=' + idx
+      wx.navigateTo({
+        url
+      });
+    }else if(index==2){
+      console.info("删除车牌号")
+      wx.showModal({
+        title: '提示',
+        content: '确定要删除当前车辆信息?',
+        confirmText: '确定',
+        showCancel:true,
+        confirmColor:'#00AADD',
+        cancelColor:'#00AADD',
+        success: function (res1) {
+          console.info("调用删除车牌号")
+        }
+      });
+    }
+    // console.log("选择的item下标:"+e.detail[0])
+    // console.log("组件标识:"+e.detail[1])
+  },
+
+  selectPopupExit:function(e){
+    console.log(e)
+    // console.log("点击了取消或空白区域取消")
+    // console.log("组件标识:"+e.detail[1])
+  }
+})

+ 6 - 0
pages/ucenter/car/car.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "我的车辆",
+  "usingComponents": {
+    "selectpopup": "/components/selectpopup/selectpopup"
+  }
+}

+ 26 - 0
pages/ucenter/car/car.wxml

@@ -0,0 +1,26 @@
+<!--pages/ucenter/car/car.wxml-->
+<view class="selectpopup_bg">   
+ <selectpopup  id="selectpopup" bind:selectPopupItemClick="selectPopupItemClick" 
+      bind:selectPopupExit="selectPopupExit"></selectpopup>
+</view>
+
+<view class="nocar" wx:if="{{userCarList.length==0}}" >
+<view class="t1">暂无车辆</view>
+<view class="t2">绑定后可在指定场站享受停车费减免优惠</view>
+<button class='login_button' bindtap="bindCar">绑定车辆</button>
+</view>
+<view class="hascar" wx:if="{{userCarList.length>0}}" >
+  <scroll-view class='context' scroll-y='true'>
+    <block wx:for="{{userCarList}}" wx:key="*this">
+      <view data-idx="{{item.carId}}" class="carView" bindtap="showMore">
+        <text class="title">{{item.plateNumber}}</text>
+        <text class="def" wx:if="{{item.defaultType==1}}">默认</text>
+        <image src="/images/car_more.png"/>
+      </view>
+    </block>
+  </scroll-view>
+  <button class='login_button' bindtap="bindCar" >绑定车辆</button>
+
+</view>
+
+

+ 149 - 0
pages/ucenter/car/car.wxss

@@ -0,0 +1,149 @@
+/* pages/ucenter/car/car.wxss */
+page{
+  background-color: #F5F5F5;
+  height:100vh;
+  overflow: hidden;
+}
+.nocar .t1{
+  width: 100%;
+  margin-top: 70rpx;
+  text-align: center;
+  font-size: 36rpx;
+}
+
+
+.nocar .t2{
+  width: 100%;
+  margin-top: 16rpx;
+  text-align: center;
+  font-size: 24rpx;
+  color:#aaaaaa;
+}
+
+.nocar .login_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 40rpx 135rpx 0 135rpx;
+}
+.hascar{
+  width: 100%;
+  height:100vh;
+}
+.hascar .carView{
+  height:100%;
+  width:100%;
+}
+.hascar .context{
+  height: calc(100vh - 200rpx);
+  overflow: hidden;
+}
+
+.hascar .carView{
+  width: calc(100% - 40rpx);
+  margin:20rpx 20rpx;
+  height: 140rpx;
+  background-color: #FFF;
+  border-radius: 10rpx;
+  font-size: 36rpx;
+  line-height: 36rpx;
+  position: relative;
+  overflow: hidden;
+}
+
+.hascar .carView .title{
+  position: absolute;
+  padding: 20rpx 20rpx;
+  top: 0;
+  left: 0;
+}
+
+.hascar .carView image{
+  position: absolute;
+  padding: 0rpx 10rpx;
+  bottom: 0;
+  right: 0;
+  width: 60rpx;
+  height: 60rpx;
+}
+
+.hascar .carView .def{
+  position: absolute;
+  top: 0;
+  right: 0;
+  width:60rpx;
+  height:36rpx;
+  color:#FFF;
+  background-color: #21ADFF;
+  font-size:18rpx;
+  text-align: center;
+  line-height: 36rpx;
+}
+
+.selectpopup_bg{
+  height:100vh;
+  width: 100%;
+  position: absolute;
+  top: 0;
+}
+
+
+.login_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 50rpx auto;
+}
+
+.login_button_disable {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #c9c9c9;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 125rpx 135rpx 0 135rpx;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}

+ 2 - 2
pages/ucenter/center/center.wxml

@@ -56,7 +56,7 @@
           <image src='/images/enter.png'></image>
         </view>
       </view>
-      <view class='input_view'>
+      <!-- <view class='input_view'>
         <view class="input_text_view">
           <text class="input_text">车牌号</text>
         </view>
@@ -65,7 +65,7 @@
         <view class="zan-ft">
           <image src='/images/enter.png'></image>
         </view>
-      </view>
+      </view> -->
     </view>
 
 <!-- <view style="width: 100%;margin-top:50rpx">

+ 13 - 0
pages/ucenter/index/index.js

@@ -171,6 +171,19 @@ Page({
       url
     });
   },
+  goCar(e) {
+    if (!this.data.isLogin) {
+      let url = `/pages/login/phone_login/phone_login`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+    let url = '/pages/ucenter/car/car'
+    wx.navigateTo({
+      url
+    });
+  },
   goMyChargeSation(e) {
     let url = '/pages/ucenter/mychargestation/mychargestation'
     wx.navigateTo({

+ 12 - 0
pages/ucenter/index/index.wxml

@@ -82,6 +82,18 @@
           <image src='/images/enter.png'></image>
         </view>
       </view>
+      <view class="zan-cell" wx:if='{{!userInfo.flag}}' hover-class="active" bindtap="goCar">
+        <view class="zan-icon">
+          <!-- <image src='/images/purse.png'></image> -->
+          <image src='/images/column.png'></image>
+        </view>
+        <view class="zan-text">
+          <text>我的车辆</text>
+        </view>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
+        </view>
+      </view>      
       <!-- 运维用户 -->
       <view class="zan-cell" wx:if='{{userInfo.flag}}' hover-class="active" bindtap="goMyChargeSation">
         <view class="zan-icon">