From 4e7e747d2a594b9f68d2d45b90bebc401d77724e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 17 十月 2023 19:01:01 +0800
Subject: [PATCH] Merge branch 'dev' of http://139.186.142.91:10010/r/productDev/parkBike into dev
---
bicycle/pages/index/index.vue | 174 +++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 125 insertions(+), 49 deletions(-)
diff --git a/bicycle/pages/index/index.vue b/bicycle/pages/index/index.vue
index cef1f8d..076c975 100644
--- a/bicycle/pages/index/index.vue
+++ b/bicycle/pages/index/index.vue
@@ -3,13 +3,16 @@
<view class="index_nav"
:style="{ height: 'calc(' + (statusbarHeight + navHeight) + 'px' + ' + ' + '224rpx' + ')' }">
<view class="index_nav_a" :style="{ height: statusbarHeight + 'px' }"></view>
- <view class="index_nav_b" :style="{ height: navHeight + 'px', lineHeight: navHeight + 'px' }">
+ <view class="index_nav_b" :style="{ height: navHeight + 'px', lineHeight: navHeight + 'px', top: navHeight + 'px' }">
<text>鍗拌薄婊ㄦ箹鑷杞�</text>
</view>
<view class="index_box">
<view class="index_box_map">
- <map class="map" :markers="markers" :latitude="latitude" :longitude="longitude" />
- <image src="@/static/icon/ic_fullscreen@2x.png" mode="widthFix"></image>
+ <map class="map" :show-location="true" :markers="markers" :latitude="latitude" :longitude="longitude" />
+ <cover-view class="index_box_icon" @click="jumpMap">
+ <image src="@/static/icon/ic_fullscreen@2x.png" mode="widthFix"></image>
+ </cover-view>
+
</view>
<view class="index_box_title" :style="{ backgroundImage: 'url(' + bgImg + ')' }">
<view class="index_box_title_left">
@@ -81,7 +84,7 @@
</u-popup>
<!-- 寮�閿� -->
<u-popup :show="show5" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
- @close="show1 = false">
+ @close="show5 = false">
<view class="loading">
<view class="loading_box">
<view class="loading_box_top">
@@ -116,12 +119,12 @@
</view>
<view class="ride_content" v-if="info.memberRidesResponse">
<view class="ride_content_a">
- <text>寮�濮嬫椂闂达細{{info.memberRidesResponse.rideStartTime.substring(10, 16)}}</text>
- <text>鏈宸查獞琛岋細{{(info.memberRidesResponse.rideTime / 60).toFixed(1)}}鍒嗛挓</text>
+ <text>寮�濮嬫椂闂达細{{info.memberRidesResponse.rideStartTimeStr}}</text>
+ <text>鏈宸查獞琛岋細{{info.memberRidesResponse.rideTime}}鍒嗛挓</text>
</view>
<view class="ride_content_b">
<text>杞﹀瀷锛歿{info.memberRidesResponse.bikeType}}锛堢紪鍙凤細{{info.memberRidesResponse.bikeCode}}锛�</text>
- <text>璁¤垂瑙勫垯锛氳捣绉焮{(info.memberRidesResponse.baseTime / 60 ).toFixed(1)}}灏忔椂{{(info.memberRidesResponse.basePrice / 100).toFixed(2)}}鍏冿紝瓒呰繃鍚巤{(info.memberRidesResponse.unitPrice / 100).toFixed(2)}}鍏�/{{info.memberRidesResponse.unitTime}}鍒嗛挓</text>
+ <text>{{info.memberRidesResponse.priceRole}}</text>
</view>
<view class="ride_content_info">
<image src="@/static/icon/ic_tip@2x.png" mode="widthFix"></image>
@@ -155,11 +158,11 @@
</view>
<view class="ride_content" v-if="info.memberRidesResponse">
<view class="ride_content_a">
- <text>鏈�鍚庨獞琛岋細{{info.memberRidesResponse.rideStartTime.substring(5, 16)}}~{{info.memberRidesResponse.rideEndTime.substring(11, 16)}}锛坽{info.memberRidesResponse.rideTime}}鍒嗛挓)</text>
+ <text>鏈�鍚庨獞琛岋細{{info.memberRidesResponse.rideStartTimeStr}}~{{info.memberRidesResponse.rideEndTimeStr}}锛坽{info.memberRidesResponse.rideTime}}鍒嗛挓)</text>
</view>
<view class="ride_content_b">
<text>杞﹀瀷锛歿{info.memberRidesResponse.bikeType}}锛堢紪鍙凤細{{info.memberRidesResponse.bikeCode}}锛�</text>
- <text>璁¤垂瑙勫垯锛氳捣绉焮{(info.memberRidesResponse.baseTime / 60).toFixed(1)}}灏忔椂{{(info.memberRidesResponse.basePrice / 100).toFixed(2)}}鍏冿紝瓒呰繃鍚巤{(info.memberRidesResponse.unitPrice / 100).toFixed(2)}}鍏�/{{info.memberRidesResponse.unitTime}}鍒嗛挓</text>
+ <text>{{info.memberRidesResponse.priceRole}}</text>
</view>
<view class="ride_content_info">
<image src="@/static/icon/ic_tip@2x.png" mode="widthFix"></image>
@@ -190,6 +193,8 @@
</u-popup>
<!-- 鎻愮ず -->
<u-modal :show="show4" :content='content' confirmColor="#01B6AD" @confirm="show4 = false"></u-modal>
+ <!-- 纭缁撶畻寮规 -->
+ <u-modal :show="show7" title="鎻愮ず" content='纭缁撶畻鍚楋紵' :showCancelButton="true" cancelText="鍙栨秷" @confirm="settlement1" @cancel="show7 = false"></u-modal>
</view>
</template>
@@ -205,13 +210,14 @@
longitude: null,
bgImg: require('@/static/images/bg_service@2x.png'),
- show: false,
- show1: false,
- show2: false,
- show3: false,
- show4: false,
- show5: false,
- show6: false,
+ show: false, // 骞垮憡
+ show1: false, // 缂寸撼鎶奸噾
+ show2: false, // 楠戣涓�
+ show3: false, // 纭缁撶畻
+ show4: false, // 鎻愮ず
+ show5: false, // 寮�閿�
+ show6: false, // 宸茶繕杞�
+ show7: false, // 纭缁撶畻寮规
active: false,
@@ -255,6 +261,11 @@
this.getSite()
},
methods: {
+ jumpMap() {
+ uni.navigateTo({
+ url: '/pages/maps/maps'
+ });
+ },
// 璁′环瑙勫垯
jumpgz() {
uni.navigateTo({
@@ -289,16 +300,20 @@
orderId: this.info.goodsOrderId
}).then(res => {
if (res.code === 200) {
+ this.refresh()
uni.showToast({ title: '缁撶畻鎴愬姛锛�', icon: 'success', duration: 2000 });
- this.info.rideStatus = -1
- this.info.depositStatus = 0
+ // this.info.rideStatus = -1
+ // this.info.depositStatus = 0
this.show3 = false
+ this.show7 = false
}
})
},
minute() {
this.show3 = false
- this.show6 = true
+ if (this.info.rideStatus !== -1) {
+ this.show6 = true
+ }
},
settlement() {
this.show6 = false
@@ -322,15 +337,17 @@
});
} else if (item.id === 2) {
if (this.info.depositStatus === 1) {
- this.settlement1()
+ // this.settlement1()
+ // this.show7 = true
+ this.show3 = true
} else {
- uni.showToast({
- title: '鎮ㄦ殏鏃犳娂閲戯紝鏃犻渶缁撶畻锛�',
- icon: 'none',
- duration: 2000
- });
+ uni.showToast({ title: '鎮ㄦ殏鏃犳娂閲戯紝鏃犻渶缁撶畻锛�', icon: 'none', duration: 2000 });
}
} else if (item.id === 1) {
+ if (this.info.depositStatus === 1) {
+ uni.showToast({ title: '鎶奸噾宸插厖鍊�', icon: 'none', duration: 2000 });
+ return
+ }
this.show1 = true
}
},
@@ -359,15 +376,14 @@
package: res.data.packageValue,
signType: 'MD5',
paySign: res.data.paySign,
- success(res) {
+ success (res) {
if (res.errMsg = 'requestPayment:ok') {
that.show1 = false
- uni.showToast({
- title: '鍏呭�兼垚鍔�',
- icon: 'success',
- duration: 2000
- });
that.info.depositStatus = 1
+ that.carRental()
+ that.refresh()
+ uni.showToast({ title: '鍏呭�兼垚鍔�', icon: 'success', duration: 2000 });
+
}
},
fail(err) {
@@ -395,20 +411,20 @@
code
} = loginRes;
that.$u.api.wxLogin({
- code
+ code
+ })
+ .then(res => {
+ that.$u.api.wxPhone({
+ encryptedData: e.detail.encryptedData,
+ iv: e.detail.iv,
+ sessionKey: res.data.sessionKey
+ }).then(result => {
+ if (result.code === 200) {
+ that.$store.commit('setUserInfo', result.data
+ .userResponse)
+ }
})
- .then(res => {
- that.$u.api.wxPhone({
- encryptedData: e.detail.encryptedData,
- iv: e.detail.iv,
- sessionKey: res.data.sessionKey
- }).then(result => {
- if (result.code === 200) {
- that.$store.commit('setUserInfo', result.data
- .userResponse)
- }
- })
- })
+ })
}
});
}
@@ -443,6 +459,7 @@
})
// 寮�閿佹垚鍔�
if (res1.data.status === 1) {
+ that.refresh()
clearInterval(timer)
that.show5 = false
setTimeout(() => {
@@ -451,12 +468,14 @@
}
// 寮�閿佸け璐�
if (res1.data.status === 3) {
+ that.refresh()
clearInterval(timer)
that.show5 = false
uni.showToast({ title: '寮�閿佸け璐�', icon: 'error', duration: 2000 });
}
// 寮�閿佽秴鏃�
- if (num === 10) {
+ if (num === 120) {
+ that.refresh()
clearInterval(timer)
that.show5 = false
uni.showToast({ title: '寮�閿佽秴鏃�', icon: 'error', duration: 2000 });
@@ -607,7 +626,7 @@
uni.showToast({ title: '寮�閿佸け璐�', icon: 'error', duration: 2000 });
}
// 寮�閿佽秴鏃�
- if (num === 10) {
+ if (num === 120) {
clearInterval(timer)
this.show5 = false
uni.showToast({ title: '寮�閿佽秴鏃�', icon: 'error', duration: 2000 });
@@ -633,6 +652,57 @@
if (res.data.isStopServe === 1) {
this.content = res.data.stopServeTips
this.show4 = true
+ }
+ }
+ })
+ },
+ // 鍒锋柊棣栭〉淇℃伅
+ refresh() {
+ this.$u.api.home()
+ .then(res => {
+ if (res.code === 200) {
+ this.info = res.data
+ // 瑙i攣涓�
+ if (res.data.rideStatus === 0) {
+ this.show5 = true
+ // 寰幆娆℃暟
+ var num = 1
+ // 寰幆鏌ョ湅瑙i攣缁撴灉
+ let timer = setInterval(async () => {
+ num += 1
+ let res1 = await this.$u.api.refreshLock({
+ id: res.data.memberRidesResponse.rideId
+ })
+ // 寮�閿佹垚鍔�
+ if (res1.data.status === 1) {
+ clearInterval(timer)
+ this.show5 = false
+ setTimeout(() => {
+ this.show2 = true
+ }, 500)
+ }
+ // 寮�閿佸け璐�
+ if (res1.data.status === 3) {
+ clearInterval(timer)
+ this.show5 = false
+ uni.showToast({ title: '寮�閿佸け璐�', icon: 'error', duration: 2000 });
+ }
+ // 寮�閿佽秴鏃�
+ if (num === 120) {
+ clearInterval(timer)
+ this.show5 = false
+ uni.showToast({ title: '寮�閿佽秴鏃�', icon: 'error', duration: 2000 });
+ }
+ }, 1000)
+ }
+ if (res.data.rideStatus === 1) {
+ this.show2 = true
+ }
+ if (res.data.rideStatus === 5) {
+ this.show5 = true
+ }
+ if (res.data.rideStatus === 2) {
+ this.show6 = true
}
}
})
@@ -663,6 +733,8 @@
width: 100%;
padding: 0 30rpx;
box-sizing: border-box;
+ position: sticky;
+ z-index: 9;
text {
font-size: 38rpx;
@@ -692,15 +764,19 @@
height: 100%;
border-radius: 20rpx;
}
-
- image {
+
+ .index_box_icon {
position: absolute;
width: 80rpx;
height: 80rpx;
right: 10rpx;
bottom: 20rpx;
- z-index: 999;
+ image {
+ width: 100%;
+ height: 100%;
+ }
}
+
}
.index_box_title {
--
Gitblit v1.9.3