梁旭颖 8 сар өмнө
parent
commit
b71545580d

BIN
.DS_Store


+ 2 - 1
.mini-ide/project-ide.json

@@ -1,4 +1,5 @@
 {
   "ignoreHttpDomainCheck": true,
-  "ignoreWebViewDomainCheck": true
+  "ignoreWebViewDomainCheck": true,
+  "enableLegacyRemoteDebug": false
 }

+ 41 - 12
app.js

@@ -55,19 +55,48 @@ App({
     id: 0,
     times: 60,
     invalid: false,
-     title: '禹见你', //全局修改此小程序名称
-    company:'禹州市途娱科技有限公司',
-    company_1:'途娱科技',
-    scanLength: 9,//车辆编码数
-    compatible: '',
-    title: '禹见你', //全局修改此小程序名称
-    logoUrl: '../../img/logo.png', //logo图片路径 网络图片/本地图片 dejin.png  shanxianLg.png  yuzhouLg.png dingding.png
-    appid: '2021002147603404', //小程序的appid wxc5f328a92356183f--遇见你appid
-    merchant_id: '1',
-    url: 'https://api.mtu.ximengnaikang.com/api', //线上域名
-    // url: 'http://api.yutu.site.ximengnaikang.com/api', //本地域名
-    mapKey: 'GTLBZ-F6BKO-5EDWH-SDHIX-K2ART-O2FRQ' //地图key值
 
+    // title: '禹见你', //全局修改此小程序名称
+    // company:'禹州市途娱科技有限公司',
+    // company_1:'途娱科技',
+    // scanLength: 9,//车辆编码数
+    // compatible: '',
+    // title: '禹见你', //全局修改此小程序名称
+    // logoUrl: '../../img/logo.png', //logo图片路径 网络图片/本地图片 dejin.png  shanxianLg.png  yuzhouLg.png dingding.png
+    // appid: '2021002147603404', //小程序的appid wxc5f328a92356183f--遇见你appid
+    // merchant_id: '1',
+    // url: 'https://api.mtu.ximengnaikang.com/api', //线上域名
+    // mapKey: 'GTLBZ-F6BKO-5EDWH-SDHIX-K2ART-O2FRQ' //地图key值
+
+    
+    // appName:'mtu',
+    // isOnlineKefu:false,//是否使用在线客服
+    // title: '禹见你', //全局修改此小程序名称
+    // company:'禹州市途娱科技有限公司',
+    // company_1:'途娱科技',
+    // scanLength: 9, //车辆编码位数  跶跶出行为11位 沃骑、禹见你9位
+    // logoUrl: '../../img/logo.png', //禹见你
+    // appid: '2021002147603404', //禹见你
+    // url: 'https://api.mtu.ximengnaikang.com/api', //禹见你
+    // mapKey: 'GTLBZ-F6BKO-5EDWH-SDHIX-K2ART-O2FRQ', //禹见你
+    // merchant_id: 1, //商户id
+    // imgUrl: 'http://resource.mtu.ximengnaikang.com/',
+    // videoUrl:'https://resource.mtu.ximengnaikang.com'
+
+    appName:'tkcx',
+    isUseTK:true,// 是否使用头盔
+    isOnlineKefu:false,//是否使用在线客服
+    title: '太康共享出行', //全局修改此小程序名称
+    company:'太康县速柯行科技有限公司',
+    company_1:'太康科技',
+    scanLength: 9, //车辆编码位数  跶跶出行为11位 沃骑、禹见你9位
+    logoUrl: '../../img/tkcx.png', //太康共享出行
+    appid: '2021004144649616', //太康共享出行
+    url: 'https://api.yjtk.ximengnaikang.com/api', //太康共享出行
+    mapKey: 'GWTBZ-3B7HN-XYVFI-SNRHK-HF2F5-2WBB2', //太康共享出行
+    merchant_id: 1, //商户id
+    imgUrl: 'http://resource.mtu.ximengnaikang.com/',
+    videoUrl:'https://resource.mtu.ximengnaikang.com'
   },
   request(api, params, method, req1) {
     var that = this;

+ 9 - 3
app.json

@@ -30,16 +30,16 @@
     "pages/phone_verif/phone_verif",
     "pages/phonelogin/phonelogin",
     "pages/logs/logs",
-    "components/foottip/foottip",
     "pages/mine_data/mine_data",
     "pages/user_rules/user_rules",
     "pages/weizhang_detail/weizhang_detail",
     "pages/agreement/agreement",
-    "pages/parking/parking"
+    "pages/parking/parking",
+    "pages/video/video"
   ],
   "window": {
     "titleBarColor": "#fff",
-    "defaultTitle": "禹见你",
+    "defaultTitle": "太康共享出行",
     "allowsBounceVertical": "YES"
   },
   "style": "v2",
@@ -47,6 +47,12 @@
   "permission": {
     "scope.userLocation": {
       "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    },
+    "scope.album": {
+      "desc": "读取照片用于上传车辆故障图片"
+    },
+    "scope.camera": {
+      "desc": "访问你的摄像头,用于扫描二维码,上传故障车辆照片"
     }
   }
 }

BIN
img/bai-p.png


BIN
img/banner.jpg


BIN
img/dada-logo.png


BIN
img/dada.jpg


BIN
img/dianniu.jpg


BIN
img/dun-woqi.png


BIN
img/dun1.png


BIN
img/dun2.png


BIN
img/error.png


BIN
img/guanbi.png


BIN
img/more.png


BIN
img/phone.png


BIN
img/tkcx.png


BIN
img/toukui.png


+ 25 - 0
img/utils.js

@@ -0,0 +1,25 @@
+function throttle(fn, gapTime) {
+  if (gapTime == null || gapTime == undefined) {
+    gapTime = 1500
+  }
+
+  let _lastTime = null
+
+  // 返回新的函数
+  return function () {
+    let _nowTime = + new Date()
+    if (_nowTime - _lastTime > gapTime || !_lastTime) {
+      fn.apply(this, arguments)   //将this和参数传给原函数
+      _lastTime = _nowTime
+    }else{
+     wx.showToast({
+      title: '您的操作过于频繁,请稍后再试~',
+      icon: 'none'
+    })
+    }
+  }
+}
+
+module.exports = {
+  throttle: throttle
+}

BIN
img/woqi.png


BIN
img/yjgx.png


+ 10 - 3
mini.project.json

@@ -1,5 +1,12 @@
 {
-  "component2": true,
-  "axmlStrictCheck": false,
-  "enableParallelLoader": true
+  "format": 2,
+  "compileOptions": {
+    "component2": true
+  },
+  "developOptions": {
+    "parallel": true
+  },
+  "unknownConfig": {
+    "axmlStrictCheck": false
+  }
 }

+ 2 - 0
pages/index/index.js

@@ -381,6 +381,8 @@ Page({
         console.log(res)
         if (res.status == 200) {
           var data = res.data;
+          data.width = 1
+          data.strokeWidth =1
           console.log(data, '区域')
           let id = data.id
           this.getNotice(id)

+ 168 - 54
pages/use_bike/use_bike.acss

@@ -1,15 +1,16 @@
 /* pages/use_bike/use_bike.wxss */
 #map {
-  height: calc(100vh - 495rpx);
+  height: calc(100vh - 595rpx);
   z-index: 8;
   /* z-index: 999999999999999999; */
   width: 100%;
 }
+
 .map-icon {
   position: fixed;
-  right:20rpx;
+  right: 20rpx;
   z-index: 999;
-  bottom:650rpx;
+  bottom: 650rpx;
 }
 
 .kefu {
@@ -22,7 +23,24 @@
   text-align: center;
 }
 
-.kefu image {
+.park {
+  height: 70rpx;
+  width: 70rpx;
+  bottom: 0rpx;
+  border-radius: 50%;
+  background-color: rgb(3, 224, 58);
+  margin-top: 50rpx;
+  text-align: center;
+}
+
+.park image {
+  height: 50rpx;
+  margin-top: 10rpx;
+  width: 50rpx;
+}
+
+.kefu
+image {
   height: 50rpx;
   margin-top: 10rpx;
   width: 50rpx;
@@ -87,13 +105,21 @@
   margin-top: 10rpx;
   margin-bottom: 70rpx;
 }
-.step1 .bike_no{
+
+.step1 .bike_no {
   /* margin-bottom: 70rpx; */
   margin-top: 15rpx;
   font-size: 30rpx;
   color: #999;
 }
-
+.step3 .bike_no {
+  /* margin-bottom: 70rpx; */
+  text-align: center;
+  /* margin-top: 15rpx; */
+  font-size: 30rpx;
+  color: #999;
+  margin-bottom: 20rpx;
+}
 .open_bike {
   height: 100rpx;
   line-height: 100rpx;
@@ -106,23 +132,26 @@
   margin: 0 auto;
   margin-top: 20rpx;
 }
-.open_bike1{
+
+.open_bike1 {
   height: 100rpx;
   line-height: 100rpx;
   border-radius: 50rpx;
   width: 60%;
   font-size: 32rpx;
   font-weight: 600;
-  background-color:#999;
+  background-color: #999;
   color: var(--fontColor);
   margin: 0 auto;
 }
-.lanya{
+
+.lanya {
   font-size: 28rpx;
   margin-top: 20rpx;
   color: var(--globleColor);
   margin-bottom: 30rpx;
 }
+
 .bottom-list {
   display: flex;
   height: 50rpx;
@@ -215,18 +244,20 @@
   border-radius: 40rpx;
   border: solid 1rpx #e5e5e5;
 }
-.bell{
-  flex:0 0 50rpx;
+
+.bell {
+  flex: 0 0 50rpx;
   height: 50rpx;
   margin-top: 35rpx;
-  width:50rpx;
+  width: 50rpx;
   line-height: 50rpx;
   border-radius: 50%;
   text-align: center;
   border: solid 1rpx var(--globleColor);
   background-color: var(--globleColor);
 }
-.bell-image{
+
+.bell-image {
   height: 40rpx;
   width: 40rpx;
   margin-top: 5rpx;
@@ -249,6 +280,10 @@
   font-weight: bold;
 }
 
+/* .woqi .step3-item-num{
+  font-size: 30rpx;
+} */
+
 .step3-item-text {
   color: #999999;
   font-size: 28rpx;
@@ -257,15 +292,15 @@
 
 .step3-bottom {
   display: flex;
-  padding: 0 50rpx;
+  padding: 0 30rpx;
   text-align: center;
   height: 100rpx;
-  margin-top:40rpx;
+  margin-top: 40rpx;
   font-size: 34rpx;
   font-weight: bold;
   line-height: 100rpx;
 
-  margin-bottom:55rpx;
+  margin-bottom: 30rpx;
   color: var(--fontColor);
 
 }
@@ -273,10 +308,18 @@
 .step3-bottom-left {
   flex: 1;
   border-radius: 50rpx;
-  margin-right: 30rpx;
+  margin-right: 20rpx;
   border: solid 1rpx var(--globleColor);
   color: var(--orgFont);
 }
+.step3-bottom-toukui{
+  flex: 1;
+  border-radius: 50rpx;
+  margin-right: 20rpx;
+  /* border: solid 1rpx #1e80ff; */
+  background-color: #1e80ff;
+  color: #fff;
+}
 
 .step3-cha {
   flex: 0 0 100rpx;
@@ -344,9 +387,11 @@
   padding: 0 30rpx;
   font-size: 28rpx;
 }
-.cha{
+
+.cha {
   float: left;
 }
+
 .frame-kefu {
   float: right;
   font-size: 28rpx;
@@ -389,14 +434,16 @@
   background-color: var(--globleColor);
   color: var(--fontColor);
 }
+
 /* 未开启位置权限 */
-.pay-frame{
+.pay-frame {
   width: 100vh;
   height: 100%;
   position: fixed;
-  z-index: 999999999;
+  z-index: 9999999999;
   background-color: rgba(0, 0, 0, 0.6);
 }
+
 .topay {
   width: 500rpx;
   height: 300rpx;
@@ -411,6 +458,7 @@
   align-items: center;
   justify-content: center;
 }
+
 .topay .text1,
 .text2 {
   font-size: 28rpx;
@@ -441,10 +489,10 @@
   opacity: 0.9;
   height: 70rpx;
   border-radius: 50rpx;
-  width: 94%; 
+  width: 94%;
   left: 3%;
   position: fixed;
-  top:30rpx;
+  top: 30rpx;
   z-index: 9998;
 }
 
@@ -452,7 +500,7 @@
   display: inline-block;
   vertical-align: middle;
   height: 40rpx;
-  width:40rpx;
+  width: 40rpx;
 
   margin: 20rpx 30rpx 20rpx 30rpx;
 }
@@ -477,7 +525,7 @@
 
 .ad-list .swiper .swiper-item {
   height: 70rpx;
-  line-height:70rpx;
+  line-height: 70rpx;
 
 }
 
@@ -487,20 +535,22 @@
   font-size: 26rpx;
   /* vertical-align: middle; */
 }
-.back-home{
+
+.back-home {
   height: 50rpx;
-  width:50rpx;
+  width: 50rpx;
   position: absolute;
   top: 35rpx;
   left: 30rpx;
 }
+
 .marquee {
   width: 80%;
   overflow: hidden;
 }
 
 .marqueeTitle {
-  color: #333333;
+  color: red;
   font-size: 26rpx;
 }
 
@@ -524,8 +574,9 @@
   height: 100%;
   align-items: center;
 }
+
 /* 轮播图 */
-.ad-swiper{
+.ad-swiper {
   position: fixed;
   top: 30rpx;
   z-index: 9999;
@@ -534,11 +585,13 @@
   left: 3%;
   /* background-color: #fff; */
 }
-.ad-swiper-list{
+
+.ad-swiper-list {
   height: 200rpx;
 }
+
 /* 屏幕中间广告弹框 */
-.ad-frame{
+.ad-frame {
   height: 100%;
   width: 100%;
   position: fixed;
@@ -547,44 +600,64 @@
   left: 0;
   z-index: 999999999999;
 }
-.ad-frame-content{
+
+.ad-frame-content {
   width: 70%;
   height: 55%;
   /* background-color: #fff; */
   margin-left: 15%;
-  margin-top:20%;
+  margin-top: 20%;
 }
-.frame-middle{
+
+.frame-middle {
   height: 100%;
   width: 100%;
 }
-.frame-middle image{
+
+.frame-middle image {
   width: 100%;
   height: 100%;
 }
-.ad-frame-close{
+
+.ad-frame-close {
   margin: 0 auto;
   margin-top: 100rpx;
   text-align: center;
   width: 60rpx;
   height: 60rpx;
-  line-height:60rpx;
-  border:solid 4rpx #fff;
+  line-height: 60rpx;
+  border: solid 4rpx #fff;
   border-radius: 50%;
-  
+
+}
+
+.ad-frame-close .icon-cha {
+  color: #fff;
+  font-weight: 300;
+  font-size: 30rpx;
+}
+
+/* 动态绑定地图样式 */
+.map1 {
+  height: calc(100vh - 80px) !important;
 }
-.ad-frame-close .icon-cha{
-color: #fff;
-font-weight: 300;
-font-size: 30rpx;
+
+.map2 {
+  height: calc(100vh - 375px) !important;
+}
+
+.map3 {
+  height: calc(100vh - 270px) !important;
 }
-.min{
-  font-size:22rpx;
+
+.min {
+  font-size: 22rpx;
   color: #999999;
-  margin-left:3px;
+  margin-left: 3px;
   font-size: 400;
 }
-.popbj{
+
+.popbj {
   background: #999;
   opacity: 0.6;
   width: 100%;
@@ -593,11 +666,12 @@ font-size: 30rpx;
   top: 0;
   left: 0;
 }
-.pops{
+
+.pops {
   position: fixed;
   top: 50%;
   left: 50%;
-  transform: translate(-50%,-50%);
+  transform: translate(-50%, -50%);
   background: white;
   border-radius: 15rpx;
   z-index: 2;
@@ -606,29 +680,69 @@ font-size: 30rpx;
   flex-direction: column;
   align-items: center;
 }
-.pops .pop-title{ 
+
+.pops .pop-title {
   font-size: 40rpx;
   font-weight: bold;
   padding: 20rpx 0rpx;
 }
-.pops .pop-cont{
-  /* display: flex;
-  align-items: center; */
+
+.pops .pop-cont {
+  display: flex;
+  align-items: center;
   font-size: 30rpx;
   color: red;
   width: 88%;
   line-height: 50rpx;
   padding-bottom: 40rpx;
 }
-.pops .pop-btn{
+
+.pops .pop-btn {
   width: 100%;
   display: flex;
   align-items: center;
   border-top: 1rpx solid #e5e5e5;
 }
-.pops .pop-btn view{
+
+.pops .pop-btn view {
   width: 49.5%;
   display: flex;
   align-items: center;
   justify-content: center;
+}
+/* 头盔 */
+.tk-prop{
+  height: 100vh;
+  width: 100vw;
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 99999999999999999999;
+  background-color: rgba(0, 0, 0, 0.7);
+}
+.tk-content{
+  width: 80vw;
+  height: 700rpx;
+  margin: 0 auto;
+  background-color: #fff;
+  margin-top: 20vh;
+  border-radius: 12rpx;
+}
+.tk-content image{
+  height: 480rpx;
+  width: 100%;
+}
+.tk-text{
+  text-align: center;
+  color: red;
+}
+.tk-know{
+width: 400rpx;
+height: 80rpx;
+text-align: center;
+line-height: 80rpx;
+background-color: var(--globleColor);
+border-radius: 45rpx;
+margin:0 auto;
+margin-top:30rpx;
 }

+ 36 - 13
pages/use_bike/use_bike.axml

@@ -39,9 +39,12 @@
     markers="{{markers}}" data-markers="{{markers}}" controls="{{controls}}" polygon="{{polygons}}">
   </map>
   <view class="map-icon">
-    <view class="kefu" onTap="findPark">
+    <view class="park" onTap="findPark">
       <image src="../../img/park.png"></image>
     </view>
+    <view class="kefu" onTap="getPosition">
+      <image src="../../img/position.png"></image>
+    </view>
   </view>
   <!--<view class="bike-tip" onTap="bikeKnow"><text class="tip-text">车辆静止30分钟将自动锁车</text></view> -->
 
@@ -59,13 +62,27 @@
     </swiper>
     <!--<image src="../../img/change.png" class="change"></image> -->
   </view>
+  
+  <!-- 佩戴头盔弹框 -->
+  <view class="tk-prop" a:if="{{isUseTK==true && ifKnowUseTK==false}}">
+    <view class="tk-content">
+      <image src="../../img/toukui.png" mode="aspectFit" />
+      <view class="tk-text">
+        骑行前请佩戴好头盔
+      </view>
+      <view class="tk-know" onTap="knowToukui">
+        我知道了
+      </view>
+    </view>
+  </view>
   <!-- 轮播图 -->
   <view class="ad-swiper" a:if="{{ads.length>0 && steps!=3}}">
     <swiper class="ad-swiper-list" indicator-dots='{{ads.length > 1 ? true : false}}' indicator-color='var(--globleColor)' 
       autoplay='true' interval="5000" current="{{currentSwiper}}" onTap="swiperChange">
       <swiper-item a:for="{{ads}}" a:key="key" class="ad-swiper-item">
-        <image mode="widthFix" a:if="{{item.type!=='wxTencentAdvertisement'}}" src="{{item.surface}}" style="width:100%;height:200rpx;" onTap="swiper" data-index="{{index}}" 
-          data-type="{{item.type}}" data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}" ></image>
+        <image mode="widthFix" a:if="{{item.type!=='wxTencentAdvertisement'}}" src="{{item.surface}}" style="width:100%;height:200rpx;" 
+          onTap="swiper" data-index="{{index}}" data-type="{{item.type}}" data-name="{{item.name}}" data-detail="{{item.detail}}" 
+          data-id="{{item.id}}"></image>
       </swiper-item>
     </swiper>
   </view>
@@ -85,19 +102,19 @@
   </view>
   <view class="use-bike-bottom" catchtouchmove='ture' a:if="{{frame == false}}">
     <!-- 屏幕中间广告弹框 -->
-    <view class="ad-frame"  a:if="{{adFrame==true}}">
+    <view class="ad-frame" a:if="{{adFrame==true}}">
       <view class="ad-frame-content">
         <swiper autoplay='true' vertical='true' class="frame-middle">
-          <swiper-item  a:for="{{mid}}"  a:key='index' class="frame-middle">
-            <image a:if="{{item.type!=='wxTencentAdvertisement'}}" src="{{item.surface}}" mode="aspectFit" onTap="swiper" data-index="{{index}}" data-type="{{item.type}}" 
-              data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}"></image>
+          <swiper-item a:for="{{mid}}" a:key='index' class="frame-middle">
+            <image a:if="{{item.type!=='wxTencentAdvertisement'}}" src="{{item.surface}}" mode="aspectFit" onTap="swiper" 
+              data-index="{{index}}" data-type="{{item.type}}" data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}"></image>
           </swiper-item>
         </swiper>
       </view>
       <view class="ad-frame-close" onTap="closeAdframe">
         <text class="iconfont icon-cha"></text></view>
     </view>
-
+    
     
     
     
@@ -134,7 +151,7 @@
             <view class="step2-text1">请勿骑出运营区,否则车辆将断电</view>
           </view>
         </view>
-          <view class="step2-content">
+        <view class="step2-content">
           <view class="step2-left">
             <image src="../../img/binride.png" style="width:80rpx;" mode="widthFix"></image>
           </view>
@@ -166,7 +183,8 @@
         <!-- 骑行中 -->
         <view class="steps3-list" a:if="{{parkStatus==0}}">
           <view class="step3-list-item">
-            <view class="step3-item-num">{{times}}<text class="min" a:if="{{isHour==false}}">分</text></view>
+            <view class="step3-item-num">{{times}}
+              <text class="min" a:if="{{isHour==false}}">分</text></view>
             <view class="step3-item-text">骑行时长</view>
           </view>
           <view class="step3-list-item">
@@ -202,19 +220,24 @@
           <view class="step3-bottom-left" a:if="{{parkStatus==1 && chaButton==0}}" onTap="openPark">解锁</view>
           <view class="step3-cha" onTap="cancelEndBike" a:if="{{chaButton==1}}">
             <text class="iconfont icon-cha"></text></view>
+          <view class="step3-bottom-left" onTap="controlToukui" wx:if="{{parkStatus==0 && chaButton==0 && isUseTK==true}}">开头盔锁</view>
           <view class="step3-bottom-right" onTap="endUseBike" a:if="{{parkStatus!==2 && chaButton==0}}">结束用车</view>
           <view class="step3-bottom-right" onTap="sureEndUseBike" a:if="{{chaButton==1}}">确认结束</view>
           <!-- 不在还车区还车提示 -->
           <view class="pops" a:if="{{popShow}}">
             <text class="pop-title">提示</text>
-            <view class="pop-cont">当前不在还车点继续还车将收取{{dispatch_money}}元调度费, <text style="color: black;">是否继续还车?</text></view>
+            <view class="pop-cont">当前不在还车点继续还车将收取{{dispatch_money}}元调度费,
+              <text style="color: black;">是否继续还车?</text></view>
             <view class="pop-btn">
-              <view style="border-right: 1rpx solid #e5e5e5;" onTap="popHide"><text>取消</text></view>
-              <view style="color: #1e80ff;" onTap="huanche"><text>继续还车</text></view>
+              <view style="border-right: 1rpx solid #e5e5e5;" onTap="popHide">
+                <text>取消</text></view>
+              <view style="color: #1e80ff;" onTap="huanche">
+                <text>继续还车</text></view>
             </view>
           </view>
           <view class="popbj" a:if="{{popShow}}"></view>
         </view>
+        <view class="bike_no">NO:{{code}}</view>
       </view>
       <view class="bottom-list">
         <view class="bottom-list-item" onTap="chargeRule">

+ 134 - 27
pages/use_bike/use_bike.js

@@ -6,10 +6,10 @@ const {
 } = require('../../utils/cache')
 var app = getApp()
 var interval;
-var inter1;
+// var inter1;
 var locationTerval;
 var huancheTime;
-var coundDown; //运动中不可锁车倒计时
+// var coundDown; //运动中不可锁车倒计时
 var linshiStop; //临时停车倒计时
 const util = require('../../utils/utils.js');
 var interval;
@@ -76,11 +76,18 @@ Page({
     area_id: '', //区域id
     mapHeight: 'calc(100vh - 300px)',
     isHour: false, //及时判断是否含有小时
-    popShow:false
-
-
+    popShow: false,
+    centerLon: '', //地图中心点经纬度
+    centerLat: '', //地图中心点经纬度
+    is_out_area: false, //当前用户是否超出区域
+    load_num: 0, //超出区域弹窗提示弹出次数控制控制弹窗弹出次数
+    isUseTK: app.globalData.isUseTK, //是否使用头盔
+    ifKnowUseTK: true, //是否已点击使用头盔
   },
   onShow: function () {
+    let isLearn = my.getStorageSync({
+      'key': 'videoLearn'
+    }).data
     let that = this
     that.setData({
       polygons1: [],
@@ -90,7 +97,11 @@ Page({
       title: app.globalData.title
     })
     clearInterval(locationTerval);
-
+    if (isLearn == false || !isLearn) {
+      my.navigateTo({
+        url: '/pages/video/video?code=' + this.data.code,
+      })
+    }
     app.login().then(res => {
       that.userState()
       that.posiLoca()
@@ -532,6 +543,37 @@ Page({
           data: res.data.status
         })
 
+        if (res.data.is_out_area == true) {
+          that.setData({
+            load_num: that.data.load_num + 1
+          })
+        }
+        if (res.data.is_out_area == true && that.data.load_num == 1) {
+          my.showModal({
+            title: '提示',
+            content: '您当前已超出骑行区域,车辆已经断电,请将车辆骑回运营区,或联系客服进行车辆回电',
+            cancelText: '联系客服',
+            confirmText: '我知道了',
+            complete: (res) => {
+              if (res.cancel) {
+                my.makePhoneCall({
+                  number: my.getStorageSync({
+                    'key': 'home'
+                  }).data.customer_service_phone,
+                })
+                that.setData({
+                  load_num: 0
+                })
+              }
+
+              if (res.confirm) {
+                that.setData({
+                  load_num: 0
+                })
+              }
+            }
+          })
+        }
         if (res.data.start_use_bike_time <= 0) {
           that.setData({
             minute: 0
@@ -678,6 +720,13 @@ Page({
           longitude: longitude,
           latitude: latitude,
         })
+        if (!that.data.centerLon) {
+          //第一次进入当前页面时为为中心点坐标赋值
+          that.setData({
+            centerLon: res.longitude,
+            centerLat: res.latitude,
+          })
+        }
         that.home()
       },
       fail: function (err) {
@@ -1300,28 +1349,41 @@ Page({
         let data = res.data.dispatch_money
         res.data.time_money = parseFloat(res.data.time_money)
         let data1 = parseFloat(data)
-        console.log(data1, 'ppppppppppppppppppp')
-        that.setData({
-          dispatch_money: data1,
-          money: res.data,
-          chaButton: 1,
-          parkStatus: 2
-        })
 
+        if (res.data.is_app_check_helmet_status == true && res.data.helmet_status == 1) {
+          my.showModal({
+            title: '提示',
+            content: '头盔未放好!请将头盔放置在头盔卡槽后重新结束用车',
+            confirmText: '我知道了',
+            showCancel: false,
+            complete: (res) => {
+
+            }
+          })
+        } else {
+          that.setData({
+            dispatch_money: data1,
+            money: res.data,
+            chaButton: 1,
+            parkStatus: 2
+          })
+        }
       }
     })
   },
   //确定结束用车
   sureEndUseBike: util.throttle(function () {
-  
-    if(this.data.dispatch_money!=0){
-      this.setData({popShow:true})
-    }else{
+
+    if (this.data.dispatch_money != 0) {
+      this.setData({
+        popShow: true
+      })
+    } else {
       this.huanche()
     }
-    
+
   }, 1000),
-  huanche(){
+  huanche() {
     //还车接口
     my.showLoading({
       content: '结算中...',
@@ -1382,11 +1444,37 @@ Page({
       my.hideLoading()
     })
   },
+  //开关头盔锁
+  controlToukui: util.throttle(function () {
+    var that = this;
+    my.showLoading({
+      title: '开锁中...',
+      mask: true
+    })
+    let data = {
+      order_no: that.data.order,
+      bike_no: that.data.code
+    }
+    // if (app.globalData.req) {
+    app.request('/order/retry-open-helmet-lock', data, 'GET', app.globalData.req).then(res => {
+      if (res.status == 200) {
+        my.hideLoading()
+        if (res.data.status == 1) {
+          //that.reloadMap()
+          my.hideLoading()
+          my.showToast({
+            content: '头盔锁已开启',
+            type: 'none'
+          })
+        }
+      } else {
+        // log.warn('重试开锁失败(order/retry-open-lock)' + '用户id' + '--' + wx.getStorageSync('user_ID'))
+        my.hideLoading()
+      }
+    })
+  }, 1000),
   //取消锁车
   cancelEndBike: function () {
-    console.log(my.getStorageSync({
-      'key': 'nowBikeStatus'
-    }).data)
     let that = this
     that.setData({
       chaButton: 0,
@@ -1410,9 +1498,11 @@ Page({
     })
   },
 
-  popHide(){
+  popHide() {
     //取消继续还车
-    this.setData({popShow:false})
+    this.setData({
+      popShow: false
+    })
   },
   //骑行优惠券
   bikeCoupon: function () {
@@ -1422,10 +1512,14 @@ Page({
   },
   //客服
   keFu: function () {
+    console.log('点击联系客服', my.getStorageSync({
+      'key': 'home'
+    }).data.customer_service_phone)
+    let phone = my.getStorageSync({
+      'key': 'home'
+    }).data.customer_service_phone
     my.makePhoneCall({
-      number: my.getStorageSync({
-        'key': 'home'
-      }).data.customer_service_phone,
+      number: phone || '13203706613'
     })
   },
   //车辆为未开锁弹框
@@ -1493,4 +1587,17 @@ Page({
       adFrame: false
     })
   },
+  //佩戴头盔提示
+  knowToukui() {
+    this.setData({
+      ifKnowUseTK: true
+    })
+  },
+  //将地图将当前位置展示在屏幕中央,防止用户滑动查看停车区时频繁定位中心点
+  getPosition: function () {
+    this.setData({
+      centerLon: this.data.longitude,
+      centerLat: this.data.latitude,
+    })
+  },
 })

+ 59 - 0
pages/video/video.acss

@@ -0,0 +1,59 @@
+/**index.wxss**/
+.userinfo {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  color: #aaa;
+  /* background-color: blue; */
+  width: 100%;
+  height: 70vh;
+}
+
+.userinfo video{
+  width: 100%;
+  height: 70vh;
+}
+
+
+.container_video {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
+  box-sizing: border-box;
+} 
+
+
+.usermotto .motto{
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+.usermotto .title{
+  font-size: 18px;
+  margin-top: 40rpx;
+  font-weight: 600;
+}
+
+.usermotto .cont{
+  font-size: 14px;
+  margin-top: 40rpx;
+  font-weight: 400;
+  color: #A1A1A1;
+}
+.red{
+  color: #ff0000;
+}
+
+.usermotto .btn{
+  width: 80vw;
+  background-color:  var(--globleColor);
+  font-size: 14px;
+  border-radius: 24rpx;
+  /* padding: 24rpx; */
+  bottom: 40rpx;
+  color: #FFF;
+  margin-top: 100rpx;
+}

+ 23 - 0
pages/video/video.axml

@@ -0,0 +1,23 @@
+<!--index.wxml-->
+<view class="container_video">
+  <view class="userinfo">
+    <video src="{{videoSrc}}" objectFit="cover" autoplay muted loop controls='{{false}}'></video>
+  </view> 
+  <view class="usermotto">
+    <view a:if="{{showContent1}}" class="motto">
+      <view class="title">蓝色运营区内骑行</view>
+      <view class="cont">超区骑行可能面临<text class="red">断电、拉黑</text>或收取<text class="red">调度费</text></view>
+      <button class="btn" onTap="showContent2"> 下一页 </button>
+    </view>
+    <view a:if="{{showContent2}}" class="motto">
+      <view class="title">P点停车区还车</view>
+      <view class="cont"><text class="red">禁停区</text>请勿还车,站点外还车可能收取<text class="red">调度费</text></view>
+      <button class="btn" onTap="showContent3"> 下一页 </button>
+    </view>
+    <view a:if="{{showContent3}}" class="motto">
+      <view class="title">临时停车规范</view>
+      <view class="cont">临时停车也记得规范停放哦,临时停放将<text class="red">正常计费</text></view>
+      <button class="btn" onTap="complateLearn"> 学习完毕,开始骑行 </button>
+    </view>
+  </view>
+</view>

+ 52 - 0
pages/video/video.js

@@ -0,0 +1,52 @@
+// index.js
+// 获取应用实例
+const app = getApp()
+
+Page({
+  data: {
+    code: '', //车辆编号
+    showContent1: true,
+    showContent2: false,
+    showContent3: false,
+    videoSrc: app.globalData.videoUrl + '/study/step_1.mp4'
+  },
+  // 切换视频源
+  changeVideoSrc: function (newSrc) {
+    this.setData({
+      videoSrc: newSrc,
+    });
+  },
+  // 显示内容2  
+  showContent2: function () {
+    this.setData({
+      showContent1: false,
+      showContent2: true,
+      showContent3: false,
+    });
+    this.changeVideoSrc(app.globalData.videoUrl + '/study/step_2.mp4');
+  },
+  // 显示内容3  
+  showContent3: function () {
+    this.setData({
+      showContent1: false,
+      showContent2: false,
+      showContent3: true
+    });
+    this.changeVideoSrc(app.globalData.videoUrl + '/study/step_3.mp4');
+  },
+  //完成学习
+  complateLearn() {
+    my.reLaunch({
+      url: '/pages/use_bike/use_bike?code=' + this.data.code,
+    })
+    my.setStorageSync({
+      'key': 'videoLearn',
+      data: true
+    });
+  },
+  onLoad(options) {
+    this.setData({
+      code: options.code
+    })
+  },
+})

+ 7 - 0
pages/video/video.json

@@ -0,0 +1,7 @@
+{
+	"usingComponents": {
+	
+	},
+	"navigationBarTitleText": "用车学习",
+	"disableScroll": true
+}