郭宇琦 2 weeks ago
parent
commit
3a1d829125

+ 2 - 0
common/config_gyq.js

@@ -70,6 +70,8 @@ var config = {
 	
 	//车辆仪表盘
 	API_FLK_CAR_DASHBOARD: api_web_url +'?r=flk/car/dashboard',
+	//购买下单
+	API_FLK_ORDER_RESERVE: api_web_url +'?r=flk/order/reserve',
 	
 };
 module.exports = config;

+ 1 - 1
pages/activation/activation.vue

@@ -22,7 +22,7 @@
 				<image class="img" :src="carInfoData.model_images" mode="aspectFill"></image>
 			</view>
 		</view>
-		<view class="return-info">
+		<view v-if="shopInfo.shop_name" class="return-info">
 			<view class="h5">门店信息</view>
 			<view class="return-top  flex-row flex-between">
 				<view>门店名称:{{shopInfo.shop_name}}</view>

+ 12 - 3
pages/index/index.vue

@@ -33,7 +33,9 @@
 				</view>
 			</view>
 			<Control :contrilList="contrilList" />
-			<view class="flex-row flex-between map-card-view" >
+			
+			
+			<view v-if="car_info.exchange_package_info.activity_time" class="flex-row flex-between map-card-view" >
 				<MapCard latitude="23.099994" longitude="113.324004" :carAddress="carAddress" :carLocation="carLocation"/>
 				<view class="card-right">
 					<view class="card-bg" @tap="navTravelingTrack">
@@ -46,12 +48,15 @@
 						</view>
 						<view class="card-top-text">27.4<text class="font_24">km</text></view>
 					</view>
+					
 					<view class="card-bg">
 						<view class="flex-row card-top-title">
 							<img style="width: 36rpx;height: 36rpx;" src="https://qiniu.bms16.com/FtalApKa3STyruaBxxRB4O9hHXyE" alt="">
 							<text class="margin_l_8">{{$t("换电套餐")}}</text>
 						</view>
-						<view class=" card-top-text">30 <text class="font_24">{{$t("天")}}</text></view>
+						<view v-if="car_info.package_type == 1" class=" card-top-text">{{calculateRemainingDays(car_info.exchange_package_info.expire_time)}} <text class="font_24">{{$t("天")}}</text></view>
+						<view v-if="car_info.package_type == 2" class=" card-top-text">{{item.last_num}} <text class="font_24">{{$t("次")}}</text></view>
+						<view v-if="car_info.package_type == 3" class=" card-top-text">{{item.total_day}}{{$t("天")}}/{{item.last_num}} <text class="font_24">{{$t("次")}}</text></view>
 					</view>
 				</view>
 			</view>
@@ -129,7 +134,11 @@ import {
 				model_list:[],
 				car_list:[],//用户车辆列表
 				car_sn:'',//当前车辆编号
-				car_info:{}
+				car_info:{
+					exchange_package_info:{
+						activity_time:0
+					}
+				}
 			};
 		},
 		computed: {},

+ 171 - 138
pages/my/my.vue

@@ -1,140 +1,173 @@
 <template>
-    <view class="container-view zx-page-linear">
-      <view class="user-switch-row">
-        <image
-          :src="QINIU_URL + 'FlL5BtEdMES2-mntjR9D3CX_LWYv'"
-          class="message"
-          @tap="routerLink({ url: '/pages/message/index' })"
-        />
-      </view>
-      <view class="user-info-wrap" @tap="loginHandle">
-        <image :src="userInfo.headimg || defaultAvatarUrl" class="head-img" />
-        <view class="user-name">{{ userInfo.nickname || '请点击登录' }}</view>
-        <view
-          v-if="userInfo.user_name"
-          class="e-mail"
-        >
-          {{ userInfo.user_name }}
-        </view>
-      </view>
-      <view class="common-tabs">
-        <view
-          v-for="(item, index) in commonTabs"
-          :key="index"
-          class="item"
-          @click="routerLink(item)"
-        >
-          <image :src="QINIU_URL + item.icon" class="icon" />
-          <view class="name">{{ item.name }}</view>
-        </view>
-      </view>
-      <view class="tabs-wrap">
-        <view
-          v-for="(item, index) in baseTabs"
-          :key="index"
-          class="tab-item"
-          @click="routerLink(item)"
-        >
-          <image :src="QINIU_URL + item.icon" class="icon" />
-          <view class="name">{{ item.name }}</view>
-        </view>
-      </view>
-      <Confirm
-        v-model="comboDialoginfo.showConfirm"
-        :dialog-info="comboDialoginfo"
-        @confirm="dialogConfirm"
-      />
-      <CustomTabbar curt-tab="my" />
-    </view>
-  </template>
-  
-  <script>
-  const storage = require('@/common/storage.js')
-  import Confirm from '@/component/comPopup/Confirm'
-  import { QINIU_URL, defaultHeadImg } from '@/common/constant'
-  import CustomTabbar from '@/component/customTabbar/index'
-  
-  var config = require('../../common/config_gyq.js');
-  var http = require('../../common/request.js');
-  
-  export default {
-    components: {
-      Confirm,
-      CustomTabbar
-    },
-    data() {
-      return {
-        QINIU_URL,
-        defaultAvatarUrl: defaultHeadImg,
-        comboDialoginfo: {
-          showConfirm: false,
-          title: '温馨提示',
-          opType: 'combo',
-          text: '您还未购买换电套餐,是否前往进行换电套餐?',
-          confirmBtnText: '前往购买',
-          showCancelButton: false
-        },
-        userInfo: {}
-      }
-    },
-    computed: {
-      commonTabs() {
-        return [
-          { name: `${this.$t('我的车辆')}`, url: '/pages/dashboard/dashboard', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
-          { name: `${this.$t('用车人')}`, url: '/pages/userManagement/userManagement', icon: 'FnxGW52BCkTkK9HxsTdVrghU7B4D' },
-          { name: `${this.$t('换电套餐')}`, jumpCheck: 'combo', url: '', icon: 'FsOsd1SxYDHDm00aiwrTib_k0Mbr' }
-        ]
-      },
-      baseTabs() {
-        const lang = t => this.$t(t)
-        return [
-          { name: `${lang('我的订单')}`, url: '/pages/order/order', icon: 'FkLJGLo1faYtJWhW4Q0gt5dphI7g' },
-          { name: `${lang('换电记录')}`, url: '/pages/batteryRecord/batteryRecord', icon: 'FnSjwcN7Mcpa-WA7Cqx2cGTvX2V1' },
-          { name: `${lang('意见反馈')}`, url: '/pages/feedback/index', icon: 'FnSjwcN7Mcpa-WA7Cqx2cGTvX2V1' },
-        //   { name: `${lang('关于我们')}`, url: '/pages/bluetoothUnlock/unlockSet', icon: 'Fmin1_DG6ZkENCdsI1qJZJpDNkhQ' },
-          { name: `${lang('客服中心')}`, url: '/pages/bluetoothUnlock/bluetoothPair', icon: 'FhA9TUbTMF0e7ma6NZXqPrkscN6l' },
-          { name: `${lang('设置')}`, url: '/pages/my/set', icon: 'Fu3f2iRi5BspRfbVLPcw8ryWc4lu' }
-        ]
-      }
-    },
-    onShow() {
-      const user_token = storage.getUserToken()
-      user_token && this.loadUserInfo()
-    },
-    methods: {
-      async loadUserInfo() {
-        const userInfo = storage.getUserInfoData()
-        this.setData({ userInfo })
-		let {data} = await http.postApi(config.API_USER_INFO,{})
-		if(data.code == 200){
-			this.userInfo = data.data.userInfo
-			storage.setUserInfoData(this.userInfo)
+	<view class="container-view zx-page-linear">
+		<view class="user-switch-row">
+			<image :src="QINIU_URL + 'FlL5BtEdMES2-mntjR9D3CX_LWYv'" class="message"
+				@tap="routerLink({ url: '/pages/message/index' })" />
+		</view>
+		<view class="user-info-wrap" @tap="loginHandle">
+			<image :src="userInfo.headimg || defaultAvatarUrl" class="head-img" />
+			<view class="user-name">{{ userInfo.nickname || '请点击登录' }}</view>
+			<view v-if="userInfo.user_name" class="e-mail">
+				{{ userInfo.user_name }}
+			</view>
+		</view>
+		<view v-if="car_info.car_sn" class="common-tabs">
+			<view class="item" @click="routerLink({url:'/pages/dashboard/dashboard'})">
+				<image :src="QINIU_URL + 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1'" class="icon" />
+				<view class="name">{{ $t('我的车辆') }}</view>
+			</view>
+			<view class="item" @click="routerLink({url:'/pages/userManagement/userManagement'})">
+				<image :src="QINIU_URL + 'FnxGW52BCkTkK9HxsTdVrghU7B4D'" class="icon" />
+				<view class="name">{{ $t('用车人') }}</view>
+			</view>
+			<view v-if="car_info.sold_time" class="item" @click="routerLink({url:'',jumpCheck:'combo'})">
+				<image :src="QINIU_URL + 'FsOsd1SxYDHDm00aiwrTib_k0Mbr'" class="icon" />
+				<view class="name">{{ $t('换电套餐') }}</view>
+			</view>
+		</view>
+
+		<view class="tabs-wrap">
+			<view v-for="(item, index) in baseTabs" :key="index" class="tab-item" @click="routerLink(item)">
+				<image :src="QINIU_URL + item.icon" class="icon" />
+				<view class="name">{{ item.name }}</view>
+			</view>
+		</view>
+		<Confirm v-model="comboDialoginfo.showConfirm" :dialog-info="comboDialoginfo" @confirm="dialogConfirm" />
+		<CustomTabbar curt-tab="my" />
+	</view>
+</template>
+
+<script>
+	const storage = require('@/common/storage.js')
+	import Confirm from '@/component/comPopup/Confirm'
+	import {
+		QINIU_URL,
+		defaultHeadImg
+	} from '@/common/constant'
+	import CustomTabbar from '@/component/customTabbar/index'
+
+	var config = require('../../common/config_gyq.js');
+	var http = require('../../common/request.js');
+
+	export default {
+		components: {
+			Confirm,
+			CustomTabbar
+		},
+		data() {
+			return {
+				car_info: {},
+				QINIU_URL,
+				defaultAvatarUrl: defaultHeadImg,
+				comboDialoginfo: {
+					showConfirm: false,
+					title: '温馨提示',
+					opType: 'combo',
+					text: '您还未购买换电套餐,是否前往进行换电套餐?',
+					confirmBtnText: '前往购买',
+					showCancelButton: false
+				},
+				userInfo: {}
+			}
+		},
+		computed: {
+			// commonTabs() {
+			//   return [
+			//     { name: `${this.$t('我的车辆')}`, url: '/pages/dashboard/dashboard', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
+			//     { name: `${this.$t('用车人')}`, url: '/pages/userManagement/userManagement', icon: 'FnxGW52BCkTkK9HxsTdVrghU7B4D' },
+			//     { name: `${this.$t('换电套餐')}`, jumpCheck: 'combo', url: '', icon: 'FsOsd1SxYDHDm00aiwrTib_k0Mbr' }
+			//   ]
+			// },
+			baseTabs() {
+				const lang = t => this.$t(t)
+				return [{
+						name: `${lang('我的订单')}`,
+						url: '/pages/order/order',
+						icon: 'FkLJGLo1faYtJWhW4Q0gt5dphI7g'
+					},
+					{
+						name: `${lang('换电记录')}`,
+						url: '/pages/batteryRecord/batteryRecord',
+						icon: 'FnSjwcN7Mcpa-WA7Cqx2cGTvX2V1'
+					},
+					{
+						name: `${lang('意见反馈')}`,
+						url: '/pages/feedback/index',
+						icon: 'FnSjwcN7Mcpa-WA7Cqx2cGTvX2V1'
+					},
+					//   { name: `${lang('关于我们')}`, url: '/pages/bluetoothUnlock/unlockSet', icon: 'Fmin1_DG6ZkENCdsI1qJZJpDNkhQ' },
+					{
+						name: `${lang('客服中心')}`,
+						url: '/pages/bluetoothUnlock/bluetoothPair',
+						icon: 'FhA9TUbTMF0e7ma6NZXqPrkscN6l'
+					},
+					{
+						name: `${lang('设置')}`,
+						url: '/pages/my/set',
+						icon: 'Fu3f2iRi5BspRfbVLPcw8ryWc4lu'
+					}
+				]
+			}
+		},
+		onShow() {
+			this.car_info = uni.getStorageSync('car_info') || {};
+			const user_token = storage.getUserToken()
+			user_token && this.loadUserInfo()
+
+		},
+		methods: {
+			async loadUserInfo() {
+				const userInfo = storage.getUserInfoData()
+				this.setData({
+					userInfo
+				})
+				let {
+					data
+				} = await http.postApi(config.API_USER_INFO, {})
+				if (data.code == 200) {
+					this.userInfo = data.data.userInfo
+					storage.setUserInfoData(this.userInfo)
+				}
+			},
+			loginHandle() {
+				if (!userInfo.nickname) {
+					uni.navigateTo({
+						url: '/pages/loginRegister/login'
+					})
+				}
+			},
+			checkHandle_combo() {
+				if(this.car_info.exchange_package_info){
+					uni.navigateTo({
+						url: `/pages/package/package`
+					})
+					return
+				}
+				this.comboDialoginfo.showConfirm = true
+				
+			},
+			dialogConfirm(type) {
+				uni.navigateTo({
+					url: `/pages/batteryPackage/batteryPackage`
+				})
+			},
+			routerLink({
+				url,
+				jumpCheck
+			}) {
+				console.log(url);
+				if (jumpCheck) {
+					this[`checkHandle_${jumpCheck}`]()
+					return
+				}
+				uni.navigateTo({
+					url
+				})
+			}
 		}
-      },
-      loginHandle() {
-        uni.navigateTo({ url: '/pages/loginRegister/login' })
-      },
-      checkHandle_combo() {
-        this.comboDialoginfo.showConfirm = true
-      },
-      dialogConfirm(type) {
-		uni.navigateTo({
-			url:`/pages/batteryPackage/batteryPackage`
-		})
-      },
-      routerLink({ url, jumpCheck }) {
-		  console.log(url);
-        if (jumpCheck) {
-          this[`checkHandle_${jumpCheck}`]()
-          return
-        }
-        uni.navigateTo({ url })
-      }
-    }
-  }
-  </script>
-  
-  <style lang="scss" scoped>
-  @import './my.scss';
-  </style>
-  
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import './my.scss';
+</style>

+ 64 - 23
pages/order/order.vue

@@ -2,7 +2,7 @@
 	<view class="container-view">
 		<view class="order-type-view flex-row flex-between">
 			<view class="car-model-list flex-row">
-				<view class="car-model-text">小米Su5</view><img class="right-corner-icon"
+				<view class="car-model-text">{{car_info.car_name}}</view><img class="right-corner-icon"
 					src="https://qiniu.bms16.com/Fqs6TrEmcdT7QNEdKWs9Hir2cacO" alt="">
 			</view>
 			<view class="order-package-type-view flex-row">
@@ -18,7 +18,9 @@
 		<view v-for="(item, index) in hireOrderList" :key="index" @tap="loadToNav" :data-sub_sn="item.sub_sn"
 			class="order-card">
 			<view class="card-top flex-row">
-				<view v-if="selectOrderType == 1">{{ item.car_model }}</view>
+				<view v-if="selectOrderType == 1">{{ item.car_name }}</view>
+				
+				
 				<block v-if="selectOrderType == 0">
 					<view v-if="item.package_type == 1">
 						{{item.total_day}}天
@@ -30,7 +32,8 @@
 						{{item.total_day}}天{{item.num}}次
 					</view>
 				</block>
-				<view v-if="item.pay_status==2">
+				
+				<view v-if="item.pay_status==2 && selectOrderType == 1">
 					<view class="card card-k" v-if="item.order_status == 1">待取车</view>
 					<view class="card card-k" v-else-if="item.order_status == 2">待激活</view>
 					<view class="card card-b" v-else-if="item.order_status == 3">使用中</view>
@@ -41,9 +44,20 @@
 					<view class="card card-k" v-else-if="item.order_status == 8 ">订单已支付,已取消</view>
 					<view class="card card-k" v-else-if=" item.order_status == 9">订单未支付,已取消</view>
 				</view>
-				<view v-if="item.pay_status!=2">
+				
+				<view v-if="item.pay_status!=2 && selectOrderType == 1">
+					<view class="card card-k" v-if="item.pay_status == 0">待支付</view>
+					<view class="card card-k" v-else-if="item.pay_status == 1">支付中</view>
+					<view class="card card-r" v-else-if="item.pay_status == 3">支付失败</view>
+					<view class="card card-k" v-else-if="item.pay_status == 4">支付取消</view>
+					<view class="card card-b" v-else-if="item.pay_status == 5">线下待审核</view>
+					<view class="card card-k" v-else-if="item.pay_status == 6">线下审核拒绝</view>
+				</view>
+
+				<view v-if="selectOrderType == 0">
 					<view class="card card-k" v-if="item.pay_status == 0">待支付</view>
 					<view class="card card-k" v-else-if="item.pay_status == 1">支付中</view>
+					<view class="card card-k" v-else-if="item.pay_status == 2">支付成功</view>
 					<view class="card card-r" v-else-if="item.pay_status == 3">支付失败</view>
 					<view class="card card-k" v-else-if="item.pay_status == 4">支付取消</view>
 					<view class="card card-b" v-else-if="item.pay_status == 5">线下待审核</view>
@@ -63,7 +77,7 @@
 							<view class="item-label">有效期至</view>
 							<view class="item-value">{{ tools.formatTime(item.hire_end_time) }}</view>
 						</view>
-						
+
 						<view v-if="item.hire_duration_time" class="item-label-view flex-row">
 							<view class="item-label">有效时长</view>
 							<view class="item-value">
@@ -72,7 +86,6 @@
 									item.hire_duration_time.hour : '' }}<text v-if="item.hire_duration_time.hour > 0">小时</text>{{ item.hire_duration_time.minute > 0 ?
 									item.hire_duration_time.minute : '' }}<text v-if="item.hire_duration_time.minute > 0">分</text>
 							</view>
-							
 						</view>
 					</block>
 					<block v-if="selectOrderType == 0">
@@ -84,10 +97,11 @@
 							<view class="item-label">有效期至</view>
 							<view class="item-value">{{ tools.formatTime(item.expire_time) }}</view>
 						</view>
-						<view  v-if="item.expire_time" class="item-label-view flex-row">
+						<view v-if="item.package_type != 2 && item.expire_time" class="item-label-view flex-row">
 							<view class="item-label">有效时长</view>
 							<view class="item-value">
-								{{validDurationFn(item.activity_time,item.expire_time)}}
+								{{calculateRemainingDays(item.expire_time)}}<text
+									style="color: #9FA7B7;">/{{item.total_day}}天</text>
 							</view>
 						</view>
 						<view v-if="item.package_type == 1" class="item-label-view flex-row">
@@ -102,20 +116,21 @@
 							<view class="item-label">免费换电数</view>
 							<view class="item-value">{{item.total_day}}天/{{item.last_num}}次</view>
 						</view>
-						
+
 					</block>
-					
+
 					<view v-if="selectOrderType==1" class="item-label-view flex-row">
 						<view class="item-label">订单类型</view>
 						<view class="item-value">{{ item.order_type==3?'购车':'租车' }}</view>
 					</view>
-					
+
 					<view v-if="selectOrderType==0" class="flex-row button-config-view">
 						<view v-if="item.order_refund_status == 1" class="return-money">申请中</view>
 						<view v-if="item.order_refund_status == 2" class="return-money">审核失败</view>
 						<view v-if="item.order_refund_status == 3" class="return-money">退款失败</view>
 						<view v-if="item.order_refund_status == 4" class="return-money">已退款</view>
-						<view class="item-value">套餐金额$ <text class="money-style">{{(item.package_money / 100).toFixed(2)}}</text></view>
+						<view class="item-value">套餐金额$ <text
+								class="money-style">{{(item.package_money / 100).toFixed(2)}}</text></view>
 					</view>
 					<view v-if="selectOrderType==1" class="flex-row button-config-view">
 						<view class="order-money">订单金额 $ {{(item.money / 100).toFixed(2)}}</view>
@@ -136,10 +151,15 @@
 	var http = require('../../common/http.js');
 	var request = require('../../common/request');
 	var storage = require('../../common/storage.js');
-	import { getRemainingTime } from '../../utils/util.js';
+	const dayjs = require('dayjs');
+	import {
+		getRemainingTime
+	} from '../../utils/util.js';
 	export default {
 		data() {
 			return {
+				is_next:0,
+				car_info: {},
 				selectOrderType: 1,
 				orderTypes: [{
 						value: 0,
@@ -170,6 +190,7 @@
 		 */
 		,
 		onLoad: function(options) {
+			this.car_info = uni.getStorageSync('car_info') || {};
 			const locationStr = uni.getStorageSync('user_current_location');
 			if (locationStr) {
 				this.myLocation = locationStr;
@@ -196,32 +217,51 @@
 		 * 页面上拉触底事件的处理函数
 		 */
 		onReachBottom: function() {
+			if(!this.is_next) return
 			this.page++
-			this.bindHireOrderList()
+			if (this.selectOrderType == 0) {
+				this.bindExchangeOrderFn()
+			} else if (this.selectOrderType == 1) {
+				this.bindHireOrderList()
+			}
 		},
 		/**
 		 * 页面下拉触底事件的处理函数
 		 */
 		onPullDownRefresh() {
 			this.page = 1
-			this.bindHireOrderList()
+			if (this.selectOrderType == 0) {
+				this.bindExchangeOrderFn()
+			} else if (this.selectOrderType == 1) {
+				this.bindHireOrderList()
+			}
 		},
 		methods: {
-			
+			calculateRemainingDays(expirationDate) {
+				// 获取当前时间
+				const now = dayjs();
+				// 解析到期时间
+				const endDate = dayjs(expirationDate);
+				// 计算剩余天数
+				const remainingDays = endDate.diff(now, 'day');
+				return remainingDays || 0;
+			},
 			//dayjs
-			validDurationFn(start,end){
-				return getRemainingTime(start,end)
+			validDurationFn(start, end) {
+				return getRemainingTime(start, end)
 			},
 			async bindExchangeOrderFn() {
-				
 				let {
 					data
 				} = await request.postApi(config_gyq.API_FLK_EXCHANGE_PACKAGE_ORDER_LIST, {
+					pay_status: -1,
+					car_sn: this.car_info.car_sn,
 					page: this.page,
 					limit: this.limit,
 				})
 				if (data.code == 200) {
 					this.hireOrderList.push.apply(this.hireOrderList, data.data.list)
+					this.is_next = data.data.is_next
 				} else {
 					common.simpleToast(resp.data.msg)
 				}
@@ -237,6 +277,7 @@
 				}, (resp) => {
 					if (resp.data.code === 200) {
 						me.hireOrderList.push.apply(me.hireOrderList, resp.data.data.list)
+						me.is_next = resp.data.data.is_next
 						if (me.hireOrderList.length > 0) {
 							me.sort_time = me.hireOrderList[me.hireOrderList.length - 1].ctime;
 							me.sort_num = me.hireOrderList[me.hireOrderList.length - 1].sort_num;
@@ -278,7 +319,7 @@
 			},
 
 			loadToNav(e) {
-				if(this.selectOrderType == 0){
+				if (this.selectOrderType == 0) {
 					return
 				}
 				const sub_sn = e.currentTarget.dataset.sub_sn
@@ -293,16 +334,16 @@
 			async activateCar(e) {
 				let car_sn = e.currentTarget.dataset.car_sn || ''
 				let model_id = e.currentTarget.dataset.model_id || ''
-				if(!car_sn){
+				if (!car_sn) {
 					let res = await uni.scanCode({
 						onlyFromCamera: true,
 						scanType: [],
 					});
-					if(res[0]) return
+					if (res[0]) return
 					car_sn = res[1].result
 				}
 				uni.navigateTo({
-					url:`/pages/activation/activation?model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${car_sn}`
+					url: `/pages/activation/activation?model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${car_sn}`
 				})
 				// uni.scanCode({
 				// 			onlyFromCamera: true,

+ 9 - 7
pages/orderStatus/orderStatus.css

@@ -446,17 +446,18 @@
 
 .cancel {
 	color: #828DA2;
-	font-size: 32rpx;
+	font-size: 28rpx;
 	margin-right: 20rpx;
 }
 
 .deposit-btn {
 	color: #060809;
-	font-size: 32rpx;
+	font-size: 28rpx;
 	background-color: #EBECEC;
-	height: 80rpx;
-	line-height: 80rpx;
+	height: 60rpx;
+	line-height: 60rpx;
 	border-radius: 40rpx;
+	padding: 0 20rpx;
 	/* padding-top: 24rpx;
 	padding-bottom: 24rpx; */
 	margin-right: 20rpx;
@@ -481,10 +482,11 @@
 
 .sesame-btn {
 	color: #ffffff;
-	font-size: 32rpx;
-	height: 80rpx;
-	line-height: 80rpx;
+	font-size: 28rpx;
+	height: 60rpx;
+	line-height: 60rpx;
 	background-color: #060809;
+	padding: 0 20rpx;
 	border-radius: 40rpx;
 	/* padding-top: 24rpx;
 	padding-bottom: 24rpx; */

+ 168 - 102
pages/orderStatus/orderStatus.vue

@@ -10,21 +10,26 @@
 					<view v-else-if="orderInfo.pay_status == 5">线下待审核</view>
 					<view v-else-if="orderInfo.pay_status == 6">线下审核拒绝</view>
 				</view>
-				<view v-if="orderInfo.order_status == 1">
-					<!-- {{('请于'+tools.formatTimeSecond(orderInfo.hire_begin_time)+'到门店取车')}} -->
+				<view v-if="orderInfo.order_status == 1 && orderInfo.hire_begin_time">
+					{{('请于'+orderInfo.hire_begin_time+'到门店取车')}}
+					
+				</view>
+				<view v-if="orderInfo.order_status == 1 && !orderInfo.hire_begin_time">
 					待取车
 				</view>
-				<view v-else-if="orderInfo.order_status == 2">请上传车辆图片激活车辆</view>
-				<view v-else-if="orderInfo.order_status == 3" class="blue-text">使用中...</view>
-				<view v-else-if="orderInfo.order_status == 4" class="red-text">已逾期</view>
-				<view v-else-if="orderInfo.order_status == 5">待门店确认</view>
-				<view v-else-if="orderInfo.order_status == 6">还车中,等待门店取车</view>
-				<view v-else-if="orderInfo.order_status == 7">已完成</view>
-				<view v-else-if="orderInfo.order_status == 8||orderInfo.order_status == 9">已取消</view>
+				<view v-if="orderInfo.order_status == 2">请上传车辆图片激活车辆</view>
+				<block v-if="orderInfo.pay_status == 2">
+					<view v-if="orderInfo.order_status == 3" class="blue-text">使用中...</view>
+					<view v-if="orderInfo.order_status == 4" class="red-text">已逾期</view>
+					<view v-if="orderInfo.order_status == 5">待门店确认</view>
+					<view v-if="orderInfo.order_status == 6">还车中,等待门店取车</view>
+					<view v-if="orderInfo.order_status == 7">已完成</view>
+				</block>
+				<view v-if="orderInfo.order_status == 8||orderInfo.order_status == 9">已取消</view>
 			</view>
-			
+
 			<view class="time-money">
-				<view class="flex-row flex-between">
+				<view v-if="orderInfo.order_type != 3" class="flex-row flex-between">
 					<view class="money-item">
 						<view :class="orderInfo.order_status == 4?'red-status':''">
 							{{orderInfo.hire_duration_time.day > 0 ? orderInfo.hire_duration_time.day :'' }}<text
@@ -41,10 +46,28 @@
 					</view>
 					<view class="money-item">
 						<view :class="orderInfo.order_status == 4?'red-status':''">
-							{{orderInfo.order_status == 4?tools.toFix(over_fee/100):tools.toFix(orderInfo.hire_money / 100)}}<text>元</text>
+							{{tools.toFix(orderInfo.hire_money / 100)}}<text>元</text>
+						</view>
+						<view>订单金额</view>
+					</view>
+					<view @tap="bindExpanded">
+						<text>{{isExpanded?'收起':'展开'}}</text>
+						<img
+							:src="isExpanded?'https://qiniu.bms16.com/FvRah8ro91B_TUVEmInBq6n69W2f':'https://qiniu.bms16.com/FtbxPP0aXYG8hyJTEJfNTXa_Puuc'" />
+					</view>
+				</view>
+
+
+				<view v-if="orderInfo.order_type == 3" class="flex-row flex-between">
+					<view class="money-item">
+						<view></view>
+						<view>租借周期:购买</view>
+					</view>
+					<view class="money-item">
+						<view :class="orderInfo.order_status == 4?'red-status':''">
+							{{orderInfo.order_status == 4?tools.toFix(over_fee/100):tools.toFix(orderInfo.money / 100)}}<text>元</text>
 						</view>
-						<view v-if="orderInfo.order_status == 4" class="red-status">逾期金额</view>
-						<view v-else>订单金额</view>
+						<view>订单金额</view>
 					</view>
 					<view @tap="bindExpanded">
 						<text>{{isExpanded?'收起':'展开'}}</text>
@@ -52,6 +75,7 @@
 							:src="isExpanded?'https://qiniu.bms16.com/FvRah8ro91B_TUVEmInBq6n69W2f':'https://qiniu.bms16.com/FtbxPP0aXYG8hyJTEJfNTXa_Puuc'" />
 					</view>
 				</view>
+
 				<view v-if="isExpanded" class="dashed-border"></view>
 				<view v-if="isExpanded">
 					<view class="big-text">订单信息</view>
@@ -74,11 +98,11 @@
 						<view v-if="orderInfo.pay_type == 2" class="sn-text">支付宝支付</view>
 						<view v-if="orderInfo.pay_type == 9" class="sn-text">钱包余额支付</view>
 					</view>
-					<view class="sn-content flex-row flex-between">
+					<view v-if="orderInfo.order_type != 3" class="sn-content flex-row flex-between">
 						<view class="sn-title">租车金额</view>
 						<view class="sn-text">$ {{tools.toFix(orderInfo.hire_money/1000)}}</view>
 					</view>
-					<view class="sn-content flex-row flex-between">
+					<view  v-if="orderInfo.order_type != 3" class="sn-content flex-row flex-between">
 						<view class="sn-title">租车押金</view>
 						<view class="sn-text"><text class="grey-text">订单结束后随时退</text> $
 							{{tools.toFix(orderInfo.deposit/1000)}}
@@ -98,10 +122,12 @@
 					<view class="store-name">{{orderInfo.shop_name}}</view>
 					<view class="store-name-address">{{orderInfo.address}}</view>
 					<view class="flex-row flex-between align-center">
-						<view  class="flex-row time-style align-center">
-							<img v-if="orderInfo.work_begin_time && orderInfo.work_end_time" style="width: 40rpx;height: 40rpx;"
+						<view class="flex-row time-style align-center">
+							<img v-if="orderInfo.work_begin_time && orderInfo.work_end_time"
+								style="width: 40rpx;height: 40rpx;"
 								src="https://qiniu.bms16.com/Fp-G1pdXxnTV-G3qFbgS453AuqcU" alt="">
-							<text v-if="orderInfo.work_begin_time && orderInfo.work_end_time">{{orderInfo.work_begin_time}}-{{orderInfo.work_end_time}}</text>
+							<text
+								v-if="orderInfo.work_begin_time && orderInfo.work_end_time">{{orderInfo.work_begin_time}}-{{orderInfo.work_end_time}}</text>
 						</view>
 						<img @click="navToCabinet" style="width: 112rpx;height: 64rpx;"
 							src="https://qiniu.bms16.com/Fts38M35doVjK09GfOza5qD-wwkK" alt="">
@@ -116,6 +142,10 @@
 					<view>{{orderInfo.model_name}}</view>
 					<view>续航{{orderInfo.endurance /100}}km|重量{{orderInfo.weight}}kg</view>
 				</view>
+				<!-- //配套服务 -->
+				<view class="">
+					asd
+				</view>
 				<img v-if="orderInfo.model_images" :src="orderInfo.model_images" alt=""></img>
 				<img v-else src="https://qiniu.bms16.com/FhEvnKUckAHPtWaC04mi2s53IEVj" alt="">
 			</view>
@@ -146,7 +176,7 @@
 						v-if="orderInfo.hire_return_time.day>0">日</text>{{orderInfo.hire_return_time.hour > 0 ? orderInfo.hire_return_time.hour :'' }}<text
 						v-if="orderInfo.hire_return_time.hour>0">小时</text>{{orderInfo.hire_return_time.minute > 0 ? orderInfo.hire_return_time.minute :'' }}<text
 						v-if="orderInfo.hire_return_time.minute>0">分</text> -->
-						共{{hireDurationUnitsFn(orderInfo.total_hire_time,orderInfo.hire_duration_unit)}}
+					共{{hireDurationUnitsFn(orderInfo.total_hire_time,orderInfo.hire_duration_unit)}}
 				</view>
 			</view>
 			<view class="return-bottom flex-row">
@@ -158,6 +188,8 @@
 				<view>{{tools.formatTimeDate(orderInfo.hire_end_time)}}</view> -->
 			</view>
 		</view>
+
+
 		<view v-if="orderInfo.order_status==2||orderInfo.order_status==3||orderInfo.order_status==4"
 			class="overdue-info">
 			<view>逾期规则</view>
@@ -175,28 +207,33 @@
 			</view>
 		</view>
 		<!-- 考虑为空的情况 -->
+
 		<view class="payment-info flex-row flex-between">
-			<view v-if="orderInfo.order_status == 1 || orderInfo.pay_status == 5" class="cancel" @tap="clickCancel">结束订单</view>
+			<view v-if="(orderInfo.order_status == 1 || orderInfo.pay_status == 5) && orderInfo.pay_type != 1" class="cancel" @tap="clickCancel">结束订单
+			</view>
 			<view v-if="orderInfo.order_status == 1" class="flex-row"> <!-- 待取车 -->
-				<view @tap="callStorePhone" class="deposit-btn w_224">联系门店</view>
-				<view @tap="navToScan" class="sesame-btn w_288">扫码绑定</view>
+				<view @tap="callStorePhone" class="deposit-btn ">联系门店</view>
+				<view @tap="navToScan" class="sesame-btn ">扫码绑定</view>
 			</view>
-			
+
 			<view v-if="orderInfo.order_status == 2" class="flex-row"> <!-- 待取车 -->
-				<view @tap="callStorePhone" class="deposit-btn w_224">联系门店</view>
-				<view @tap="navToScan" class="sesame-btn w_288">去上传</view>
+				<view @tap="callStorePhone" class="deposit-btn ">联系门店</view>
+				<view @tap="navToScan" class="sesame-btn ">去上传</view>
 			</view>
-			
-			<view v-else-if="orderInfo.order_status == 3||orderInfo.order_status == 4" class="flex-row"> <!-- 使用中 -->
+
+			<view v-else-if="(orderInfo.order_status == 3||orderInfo.order_status == 4) && orderInfo.order_type != 3" class="flex-row"> <!-- 使用中 -->
 				<view @tap="callStorePhone" class="cancel">联系门店</view>
-				<view @tap="tapReturnCar" class="deposit-btn w_254">到店还车</view>
-				<view @tap="bindRenew" class="sesame-btn w_224">续租</view>
+				<view @tap="tapReturnCar" class="deposit-btn">到店还车</view>
+				<view @tap="bindRenew" class="sesame-btn">续租</view>
 			</view>
 			<view v-else-if="orderInfo.order_status == 5||orderInfo.order_status == 6" @tap="callStorePhone"
 				class="pay-btn">
 				联系门店</view> <!-- 待门店确认||还车中,等待门店取车 -->
 			<view v-else-if="orderInfo.order_status == 7" @tap="callStorePhone" class="pay-btn">联系门店</view>
 			<!--车辆已归还 已完成 -->
+			
+			<view v-if="orderInfo.order_type == 3 && (orderInfo.order_status == 3||orderInfo.order_status == 4)" @tap="callStorePhone" class="pay-btn">联系门店</view>
+			
 		</view>
 
 		<view v-if="isShowCancel" class="cancel-b">
@@ -205,28 +242,31 @@
 					<view>选择取消原因</view>
 					<view @tap="isShowCancel = false" style="font-size: 60rpx;">×</view>
 				</view>
-				<view @tap="bindCancel" data-status="1" class="cancel-item flex-row flex-between">
+				<view @click="reason = '行程变更无需用车'"  class="cancel-item flex-row flex-between">
 					<view>行程变更无需用车</view>
 					<img
-						:src="reason == 1?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
+						:src="reason == '行程变更无需用车'?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
 				</view>
-				<view @tap="bindCancel" data-status="2" class="cancel-item flex-row flex-between">
+				<view @click="reason = '修改订单信息'"  class="cancel-item flex-row flex-between">
 					<view>修改订单信息</view>
 					<img
-						:src="reason == 2?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
+						:src="reason == '修改订单信息'?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
 				</view>
-				<view @tap="bindCancel" data-status="3" class="cancel-item flex-row flex-between">
+				<view @click="reason = '不想要了'"  class="cancel-item flex-row flex-between">
 					<view>不想要了</view>
 					<img
-						:src="reason == 3?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
+						:src="reason == '不想要了'?'https://qiniu.bms16.com/FhWimtmWybKlYMB6mgIReVWArbfq':'https://qiniu.bms16.com/Fh0JH6_QbiXYmVy7FNYnDkVIGvLC'" />
 				</view>
+				<view @click="bindCancel" class="cancel_btn">确认取消</view>
 			</view>
 		</view>
+		
 		<returnCar :isShowReturnCar="isShowReturnCar" @closeShowReturnCarBtn="()=>isShowReturnCar=false"
 			@navStoreBtn="navStoreBtn" @immediatelyReturnBtn="immediatelyReturnBtn" />
-			
-		<carPlan @payToOrder='payReturn' v-if="showCarPlan" @changeSelectType="changeSelectType" @closeShowMore="showCarPlan = false" :params="params" :selectType="selectType"/>
-		
+
+		<carPlan @payToOrder='payReturn' v-if="showCarPlan" @changeSelectType="changeSelectType"
+			@closeShowMore="showCarPlan = false" :params="params" :selectType="selectType" />
+
 		<PayTypeModel @closeShow="()=>isShowToBuy=false" @payToOrder="payToOrder" :free_price="totalPrice"
 			:isShowToBuy="isShowToBuy" />
 	</view>
@@ -242,7 +282,9 @@
 	var storage = require('../../common/storage.js');
 	var user = require('../../common/user.js');
 	// 
-	import {getRemainingTime} from '@/utils/util';
+	import {
+		getRemainingTime
+	} from '@/utils/util';
 	var appWhiteListFilter = require('../../common/appWhiteListFilter.js');
 	import allPrice from '@/component/allPrice/allPrice';
 	import ReturnCar from '@/component/returnCar/returnCar';
@@ -260,14 +302,14 @@
 		},
 		data() {
 			return {
-				select_type:'',
-				car_detail:{},
-				showCarPlan:false,
+				select_type: '',
+				car_detail: {},
+				showCarPlan: false,
 				return_imgs: {},
 				charge_standard: {},
 				isShowCancel: false,
 				order_sn: '',
-				reason: 0,
+				reason: '行程变更无需用车',
 				orderInfo: {},
 				shop_image: [],
 				isExpanded: false,
@@ -302,23 +344,23 @@
 		computed: {},
 
 		methods: {
-			
+
 			async loadCarInfo(model_id) {
 				const me = this
 				http.postApi(config.API_FLK_INDEX_CAR_MODEL_DETAIL, {
 					model_id,
 				}, (resp) => {
 					if (resp.data.code === 200) {
-						const pData={
+						const pData = {
 							...this.car_detail,
-							price:this.price
+							price: this.price
 						}
 						me.setData({
-							car_detail:resp.data.data,
-							params:{
-								order_sn:this.orderInfo.order_sn,
+							car_detail: resp.data.data,
+							params: {
+								order_sn: this.orderInfo.order_sn,
 								...resp.data.data,
-								price:(resp.data.data.rental_setting[0].hire_price/100).toFixed(2)
+								price: (resp.data.data.rental_setting[0].hire_price / 100).toFixed(2)
 							}
 						})
 						console.log('车辆信息')
@@ -328,25 +370,25 @@
 					}
 				})
 			},
-			
-			changeSelectType(select_type,price){
+
+			changeSelectType(select_type, price) {
 				this.setData({
 					selectType: select_type,
-					price:(price/100).toFixed(2)
+					price: (price / 100).toFixed(2)
 				})
 			},
-			async navToScan(){
+			async navToScan() {
 				let car_sn = this.orderInfo.car_sn || ''
-				if(!car_sn){
+				if (!car_sn) {
 					let res = await uni.scanCode({
 						onlyFromCamera: true,
 						scanType: [],
 					});
-					if(res[0]) return
+					if (res[0]) return
 					car_sn = res[1].result
 				}
 				uni.navigateTo({
-					url:`/pages/activation/activation?model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${car_sn}`
+					url: `/pages/activation/activation?model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${car_sn}`
 				})
 				// let {data} = await request.postApi(config.API_CAR_ASSIGNMENT,{sub_sn:this.sub_sn,car_sn:res[1].result})
 			},
@@ -368,7 +410,7 @@
 					success: function(res) {}
 				});
 			},
-			
+
 			hireDurationUnitFn(type) {
 				if (type == 1) {
 					return '天'
@@ -386,22 +428,22 @@
 					return '季'
 				}
 			},
-			hireDurationUnitsFn(time,type) {
-				
+			hireDurationUnitsFn(time, type) {
+
 				if (type == 1) {
 					return Math.ceil(time / 60 / 60 / 24) + '天'
 				} else if (type == 2) {
-					return Math.ceil(time / 60 / 60 / 24 / 30) +  '月'
+					return Math.ceil(time / 60 / 60 / 24 / 30) + '月'
 				} else if (type == 3) {
-					return Math.ceil(time / 60 / 60 / 24 / 30 / 365) +  '年'
+					return Math.ceil(time / 60 / 60 / 24 / 30 / 365) + '年'
 				} else if (type == 4) {
-					return Math.ceil(time / 60 / 60) +  '小时'
+					return Math.ceil(time / 60 / 60) + '小时'
 				} else if (type == 5) {
-					return Math.ceil(time / 60)  +  '分钟'
+					return Math.ceil(time / 60) + '分钟'
 				} else if (type == 6) {
-					return Math.ceil(time / 60 / 60 / 24 / 7) +  '周'
+					return Math.ceil(time / 60 / 60 / 24 / 7) + '周'
 				} else if (type == 7) {
-					return Math.ceil(time / 60 / 60 / 24 / 30 / 3) +  '季'
+					return Math.ceil(time / 60 / 60 / 24 / 30 / 3) + '季'
 				}
 			},
 
@@ -416,7 +458,7 @@
 					if (resp.data.code === 200) {
 						me.orderInfo = resp.data.data.order_info
 						// 
-						if(resp.data.data.order_info.model_id){
+						if (resp.data.data.order_info.model_id) {
 							me.loadCarInfo(resp.data.data.order_info.model_id)
 						}
 						let distance = common.getFlatternDistance(res[1].longitude, res[1].latitude, me
@@ -425,11 +467,16 @@
 						// 取还时间展示
 						// me.orderInfo.hire_return_time = common.getTimeToDay(Math.ceil(me.orderInfo
 						// 	.hire_end_time - me.orderInfo.hire_begin_time) / 60)
-						
-							me.orderInfo.hire_return_time = getRemainingTime(me.orderInfo.hire_begin_time,me.orderInfo.hire_end_time)
-							me.orderInfo.hire_begin_time = dayjs(me.orderInfo.hire_begin_time * 1000).format('YY/MM/DD') 
-							me.orderInfo.hire_end_time = dayjs(me.orderInfo.hire_end_time * 1000).format('YY/MM/DD')
-							
+
+						me.orderInfo.hire_return_time = getRemainingTime(me.orderInfo.hire_begin_time, me
+							.orderInfo.hire_end_time)
+						me.orderInfo.hire_begin_time = me.orderInfo.hire_begin_time ? dayjs(me.orderInfo
+							.hire_begin_time * 1000).format(
+							'YY-MM-DD') : 0
+						me.orderInfo.hire_end_time = me.orderInfo.hire_end_time ? dayjs(me.orderInfo
+							.hire_end_time * 1000).format(
+							'YY-MM-DD') : 0
+
 						// 剩余租期判断
 						if ((me.orderInfo.hire_type == 2 && me.orderInfo.order_status == 2) || me
 							.orderInfo.order_status == 3) {
@@ -497,7 +544,7 @@
 				} else {
 					//提交还车图片
 					uni.navigateTo({
-							url:`/pages/activation/activation?isReturnCar=true,model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${this.orderInfo.car_sn}`
+						url: `/pages/activation/activation?isReturnCar=true,model_id=${this.orderInfo.model_id}&sub_sn=${this.sub_sn}&car_sn=${this.orderInfo.car_sn}`
 					});
 				}
 
@@ -506,7 +553,32 @@
 				const phone = this.orderInfo.link_phone
 				common.callPhone(phone)
 			},
-			async clickCancel() {
+			 async clickCancel() {
+				this.isShowCancel = true
+			},
+
+			async bindCancel() {
+				// const me = this
+				// me.reason = e.currentTarget.dataset.status;
+				// me.cancel = true
+				// common.loading()
+				// setTimeout(function() {
+				// 	http.postApi(config.API_DAYHIRE_HIRE_CANCEL_ORDER, {
+				// 		order_sn: me.order_sn
+				// 	}, (resp) => {
+				// 		if (resp.data.code === 200) {
+				// 			uni.hideLoading()
+				// 			common.simpleToast('取消成功')
+				// 			setTimeout(() => {
+				// 				me.bindOrderInfo()
+				// 			}, 500);
+				// 		} else {
+				// 			common.simpleToast('订单取消失败')
+				// 		}
+				// 		me.reason = 0
+				// 		me.isShowCancel = false
+				// 	})
+				// }, 600);
 				const me = this
 				let res = await uni.showModal({
 					title: '取消订单',
@@ -517,40 +589,21 @@
 					cancelColor: '#191D23',
 				});
 				if (res[1].confirm) {
-				let {data} = await request.postApi(config.API_FLK_ORDER_CANCEL_PAY,{sub_sn:this.sub_sn})
-					if(data.code == 200){
+					let {
+						data
+					} = await request.postApi(config.API_DAYHIRE_HIRE_CANCEL_ORDER, {
+						sub_sn: this.sub_sn,
+						remark:this.reason
+					})
+					if (data.code == 200) {
 						common.simpleToast(data.msg)
 						this.bindOrderInfo()
-					}else{
+					} else {
 						common.simpleToast(data.msg)
 					}
 				}
 			},
 
-			bindCancel(e) {
-				const me = this
-				me.reason = e.currentTarget.dataset.status;
-				me.cancel = true
-				common.loading()
-				setTimeout(function() {
-					http.postApi(config.API_DAYHIRE_HIRE_CANCEL_ORDER, {
-						order_sn: me.order_sn
-					}, (resp) => {
-						if (resp.data.code === 200) {
-							uni.hideLoading()
-							common.simpleToast('取消成功')
-							setTimeout(() => {
-								me.bindOrderInfo()
-							}, 500);
-						} else {
-							common.simpleToast('订单取消失败')
-						}
-						me.reason = 0
-						me.isShowCancel = false
-					})
-				}, 600);
-			},
-
 			bindToNav() {
 				console.log(111);
 				const {
@@ -888,4 +941,17 @@
 
 <style>
 	@import './orderStatus.css';
+	.cancel_btn{
+		width: 702rpx;
+		height: 80rpx;
+		background: #060809;
+		border-radius: 40rpx;
+		font-family: PingFangSC, PingFang SC;
+		font-weight: 500;
+		font-size: 32rpx;
+		color: #FFFFFF;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
 </style>

+ 95 - 15
pages/package/package.vue

@@ -9,15 +9,15 @@
 			<view class="package-card flex-row flex-between">
 				<view class="flex-row flex-column" style="align-items: flex-start;">
 					<view class="left-first flex-row">
-						<view>小米 Su7</view>
+						<view>{{car_info.car_name}}</view>
 						<img class="left-img" src="https://qiniu.bms16.com/Fpf25Lkkrx05pvLw08mksVQKAQWf" />
 					</view>
 					<view class="left-second flex-row">
 						<view style="margin-right: 32rpx;">适用电池:<text>48v20Ah</text></view>
-						<view>押金:<text>$5.0</text></view>
+						<!-- <view>押金:<text>$5.0</text></view> -->
 					</view>
 					<view class="left-third">
-						<view>卡号:<text>2024110202578</text></view>
+						<view>车辆编号:<text>{{car_info.car_sn}}</text></view>
 					</view>
 				</view>
 				<img class="card-right" src="https://qiniu.bms16.com/FuOJQxzypa-NginyHGdsWlzwnB8z" />
@@ -40,40 +40,68 @@
 				</view>
 				<img class="card-right" src="https://qiniu.bms16.com/FuOJQxzypa-NginyHGdsWlzwnB8z" />
 			</view> -->
-			<view class="package-view" v-for="item in packageList">
+			<view class="package-view" v-for="item in hireOrderList">
 				<view class="top-view flex-row flex-between">
-					<view class="top-title">{{item.total_duration}}<text> 天 </text>{{item.total_times}}<text> 次 </text></view>
-					<view v-if="item.status==1" class="card-text card-b">生效中</view>
-					<view v-if="item.status==2" class="card-text card-o">待生效</view>
+					<view class="top-title" v-if="item.package_type == 1">
+						{{item.total_day}}天
+					</view>
+					<view class="top-title" v-if="item.package_type == 2">
+						{{item.num}}次
+					</view>
+					<view class="top-title" v-if="item.package_type == 3">
+						{{item.total_day}}天{{item.num}}次
+					</view>
+					<view v-if="item.package_status==1" class="card-text card-b">生效中</view>
+					<view v-if="item.package_status==0" class="card-text card-o">待生效</view>
+					<view v-if="item.package_status==2" class="card-text card-o">已结束</view>
 				</view>
 				<view class="package-item" style="margin-bottom: 32rpx;">
 					<view class="item-title">有效期至</view>
-					<view class="item-info">{{item.ctime}}</view>
+					<view class="item-info">{{tools.formatTime(item.expire_time)}}</view>
 				</view>
-				<view class="package-item" style="margin-bottom: 32rpx;">
+				<view v-if="item.package_type != 2" class="package-item" style="margin-bottom: 32rpx;">
 					<view class="item-title">有效时长</view>
-					<view class="item-info">{{item.efficient_day}}<text>/{{item.total_duration}}天</text></view>
+					<view class="item-info">
+						{{calculateRemainingDays(item.expire_time)}}<text style="color: #9FA7B7;">/{{item.total_day}}天</text>
+					</view>
 				</view>
-				<view class="package-item">
+				<view v-if="item.package_type == 1" class="package-item">
 					<view class="item-title">免费换电数</view>
-					<view class="item-info">{{item.change_rate}}<text>/{{item.total_times}}次</text></view>
+					<view style="color: #060809;" class="item-info">{{item.last_num}}次</view>
+				</view>
+				<view v-if="item.package_type == 2" class="package-item">
+					<view class="item-title">免费换电数</view>
+					<view class="item-info">{{item.last_num}} <text style="color: #9FA7B7;">/{{item.num}}次</text></view>
+				</view>
+				<view v-if="item.package_type == 3" class="package-item">
+					<view class="item-title">免费换电数</view>
+					<view style="color: #060809;" class="item-info">{{item.total_day}}天/{{item.last_num}}次</view>
 				</view>
 			</view>
 		</view>
+		<view style="height: 200rpx;"></view>
+		<view @click='srcFn' class="packageBtn">前往购买套餐</view>
 	</view>
 </template>
-
+<script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
+	<script module="tools" lang="sjs" src="@/pages/common/wxs/tools.sjs"></script>
 <script>
-	var config = require('../../common/config.js');
+	var config = require('../../common/config_gyq.js');
 	var common = require('../../common/common.js');
-	var http = require('../../common/http.js');
+	var http = require('../../common/request.js');
 	var storage = require('../../common/storage.js');
+	const dayjs = require('dayjs');
+	import { getRemainingTime } from '../../utils/util.js';
 	export default {
 		components: {
 			
 		},
 		data() {
 			return {
+				hireOrderList:[],
+				page: 1,
+				limit: 10,
+				car_info:{},
 				statusBarHeight: 0,
 				navabarHeight: 0,
 				packageList: [
@@ -86,6 +114,7 @@
 		 * 生命周期函数--监听页面加载
 		 */
 		onLoad: function(options) {
+			this.car_info = uni.getStorageSync('car_info') || {};
 			const clientRect = uni.getMenuButtonBoundingClientRect()
 			const sysinfo = uni.getSystemInfoSync()
 			let GAP = 8
@@ -96,6 +125,7 @@
 			this.navabarHeight = navabarHeight
 			this.statusBarHeight = sysinfo.statusBarHeight
 			this.mapCtx = uni.createMapContext('myMap');
+			this.listFn()
 		},
 		/**
 		 * 生命周期函数--监听页面显示
@@ -104,6 +134,38 @@
 			
 		},
 		methods: {
+			 calculateRemainingDays(expirationDate) {
+			  // 获取当前时间
+			  const now = dayjs();
+			  // 解析到期时间
+			  const endDate = dayjs(expirationDate);
+			  // 计算剩余天数
+			  const remainingDays = endDate.diff(now, 'day');
+			  return remainingDays || 0;
+			},
+			srcFn(){
+				uni.navigateTo({
+					url: `/pages/batteryPackage/batteryPackage`
+				})
+			},
+			validDurationFn(start,end){
+				return getRemainingTime(start,end)
+			},
+			async listFn(){
+				let {
+					data
+				} = await http.postApi(config.API_FLK_EXCHANGE_PACKAGE_ORDER_LIST, {
+					page: this.page,
+					pay_status:2,
+					car_sn:this.car_info.car_sn,
+					limit: this.limit,
+				})
+				if (data.code == 200) {
+					this.hireOrderList.push.apply(this.hireOrderList, data.data.list)
+				} else {
+					common.simpleToast(resp.data.msg)
+				}
+			},
 			bindReturnView() {
 				uni.navigateBack({
 					delta: 1,
@@ -115,4 +177,22 @@
 
 <style>
 	@import './package.css';
+	.packageBtn{
+		width: 686rpx;
+		height: 80rpx;
+		background: #060809;
+		border-radius: 40rpx;
+		font-family: PingFangSC, PingFang SC;
+		font-weight: 500;
+		font-size: 32rpx;
+		color: #FFFFFF;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		position: fixed;
+		left: 0;
+		right: 0;
+		margin: auto;
+		bottom: 60rpx;
+	}
 </style>

+ 119 - 75
pages/purchaseOrder/purchaseOrder.vue

@@ -4,7 +4,8 @@
 			<view class="flex-row">选择取车时间</view>
 			<view @tap="tapSelectTime" class="flex-row align-center" style="margin-bottom:20rpx ;">
 				<text class="select-time-text">{{takeCar}}</text>
-				<img style="width: 28rpx;height: 28rpx;" src="https://qiniu.bms16.com/FpbKGisSPfL9r8a7QkZCYXolhu1Y" alt="">
+				<img style="width: 28rpx;height: 28rpx;" src="https://qiniu.bms16.com/FpbKGisSPfL9r8a7QkZCYXolhu1Y"
+					alt="">
 			</view>
 		</view>
 		<view class="car-info-view">
@@ -13,10 +14,13 @@
 				<view class="flex-row car-info-grow">
 					<view class="flex-row align-center">
 						<view class="car-name">{{modelInfo.car_model_name}}</view>
-						<img style="width: 28rpx;height: 28rpx;" src="https://qiniu.bms16.com/FlMiRsUF-KZyevFCZDP9DwffOlag" alt="">
+						<img style="width: 28rpx;height: 28rpx;"
+							src="https://qiniu.bms16.com/FlMiRsUF-KZyevFCZDP9DwffOlag" alt="">
 					</view>
-					<view class="car-information">{{leaseUnitsResult}}  共计{{tools.countToDay(modelInfo.count,modelInfo.selectType)}}天</view>
-					<allPrice :amount="price"></allPrice>
+					<view class="car-information">{{leaseUnitsResult}}
+						共计{{tools.countToDay(modelInfo.count,modelInfo.selectType)}}天</view>
+					<allPrice v-if="modelInfo.selectType == 100" :amount="modelInfo.sell_price / 100"></allPrice>
+					<allPrice v-else :amount="price"></allPrice>
 				</view>
 			</view>
 			<view class="config-list-view">
@@ -27,8 +31,8 @@
 				</view>
 			</view>
 		</view>
-		
-		<view  class="deposit-info">
+
+		<view v-if="modelInfo.selectType != 100" class="deposit-info">
 			<view class="deposit-info-title flex-row flex-between">
 				<text>车辆押金</text>
 				<text>${{modelInfo.deposit/100}}</text>
@@ -56,14 +60,14 @@
 			</view>
 		</view>
 
-	
+
 
 		<view style="height: 224rpx;"></view>
 		<view v-if="!isShowDetail" class="payment-info">
 			<view class="payment-bottom flex-row flex-between">
-				<view class="bottom-left flex-row">
+				<view style="margin-right: 20rpx;" class="bottom-left flex-row">
 					<allPrice :amount="totalPrice"></allPrice>
-					<view @tap="bindDetail" class="all-money">明细<img
+					<view v-if="modelInfo.selectType != 100" @tap="bindDetail" class="all-money">明细<img
 							src="https://qiniu.bms16.com/Fvl1d-AWRvwY_ehNrw7bMZOK6LBZ" /></view>
 				</view>
 				<view @tap="navToPage">确认下单</view>
@@ -84,15 +88,14 @@
 						<view>
 							<!-- ¥{{(leaseTime * price_list[0].hire_price) /100}} -->
 							¥{{price+'x'+modelInfo.count}}
-							<text >{{leaseUnits}}</text>
+							<text>{{leaseUnits}}</text>
 						</view>
 					</view>
-					<view class="flex-row flex-between"
-						style="margin-bottom: 44rpx;">
+					<view class="flex-row flex-between" style="margin-bottom: 44rpx;">
 						<view>车辆押金</view>
 						<view>¥{{modelInfo.deposit /100}}</view>
 					</view>
-					
+
 					<view class="detail-money flex-row" style="padding-bottom: 44rpx;">
 						<view>支付金额</view>
 						<allPrice :amount="totalPrice"></allPrice>
@@ -116,7 +119,8 @@
 			<view class="return-item">
 				<view class="return-title flex-row flex-between">
 					<view>还车到门店</view>
-					<view @tap="isShowReturnCar = false" class="close-view"><img style="width: 24rpx;height: 24rpx;" src="https://qiniu.bms16.com/FoWVlo-Nmx6wTDpsL2Rf9_BamU7L" alt=""></view>
+					<view @tap="isShowReturnCar = false" class="close-view"><img style="width: 24rpx;height: 24rpx;"
+							src="https://qiniu.bms16.com/FoWVlo-Nmx6wTDpsL2Rf9_BamU7L" alt=""></view>
 				</view>
 				<view class="return-text">系统会根据您的定位判断您是否已到还车位置,如您已经到达门店,请点击「我已到店」按钮,待门店确认还车后,即可还车成功。</view>
 				<view class="return-btn flex-row">
@@ -128,9 +132,11 @@
 		<view v-if="isShowCheckOrder" class="return-box">
 			<view class="return-item">
 				<view style="text-align: center;margin-bottom: 120rpx;">
-					<img style="width: 88rpx;height: 88rpx;" src="https://qiniu.bms16.com/Fqb-i2uJWlZOg8EvUXHr_1qhlndf" alt="">
+					<img style="width: 88rpx;height: 88rpx;" src="https://qiniu.bms16.com/Fqb-i2uJWlZOg8EvUXHr_1qhlndf"
+						alt="">
 					<view class="check-order-text">租车订单已提交</view>
-					<view>请于 <text class="get-car-time">{{takeCar}}</text>  到 <text class="get-car-name">{{modelInfo.shop_name}}</text>  取车</view>
+					<view>请于 <text class="get-car-time">{{takeCar}}</text> 到 <text
+							class="get-car-name">{{modelInfo.shop_name}}</text> 取车</view>
 				</view>
 				<view class="return-btn flex-row">
 					<view @tap="toIndexPage">我知道了</view>
@@ -138,22 +144,26 @@
 				</view>
 			</view>
 		</view>
-		<PayTypeModel @closeShow="closeShow" @payToOrder="payToOrder" :free_price="totalPrice" :isShowToBuy="isShowToBuy"/>
+		<PayTypeModel @closeShow="closeShow" @payToOrder="payToOrder" :free_price="totalPrice"
+			:isShowToBuy="isShowToBuy" />
 	</view>
 </template>
 <script module="tools" lang="wxs" src="@/pages/common/wxs/tools.wxs"></script>
 <script module="tools" lang="sjs" src="@/pages/common/wxs/tools.sjs"></script>
 <script>
 	var config = require('../../common/config.js');
+	var config_gyq = require('../../common/config_gyq.js');
 	var common = require('../../common/common.js');
 	var http = require('../../common/http.js');
+	var request = require('../../common/request.js');
 	var storage = require('../../common/storage.js');
 	var user = require('../../common/user.js');
 	import allPrice from '@/component/allPrice/allPrice';
 	import calendar from '@/component/smartCalendar';
 	import PayTypeModel from '@/component/payTypeModel/payTypeModel';
 	import {
-		MAX_LIMITS,LEASE_TYPE_ARR
+		MAX_LIMITS,
+		LEASE_TYPE_ARR
 	} from '@/common/constant.js';
 	export default {
 		components: {
@@ -163,16 +173,16 @@
 		},
 		data() {
 			return {
-				sub_sn:"",
-				service_list:[],
+				sub_sn: "",
+				service_list: [],
 				isShowCalendar: false, //选择预约订单时间
-				price:0,
-				modelInfo:{},
-				isShowDetail:false,
-				unitPrice:0, //单价
-				isShowToBuy:false,
-				order_sn:'', //租赁订单号
-				totalPrice:0,//结算总金额
+				price: 0,
+				modelInfo: {},
+				isShowDetail: false,
+				unitPrice: 0, //单价
+				isShowToBuy: false,
+				order_sn: '', //租赁订单号
+				totalPrice: 0, //结算总金额
 			};
 		}
 		/**
@@ -180,20 +190,21 @@
 		 */
 		,
 		onLoad: function(options) {
-			if(options && options.params){
-				const model_info=JSON.parse(decodeURIComponent(options.params))||{}
-				console.log(model_info,'model_info');
+			if (options && options.params) {
+				const model_info = JSON.parse(decodeURIComponent(options.params)) || {}
+				console.log(model_info, 'model_info');
 				this.setData({
-					modelInfo:model_info,
-					unitPrice:model_info.rental_setting.find(v => v.hire_duration_unit == model_info.selectType)?.hire_price,
-					service_list:model_info.service_list||[],
-					price:model_info.totalPrice/100,
-					totalPrice:((model_info.totalPrice+model_info.deposit)/100).toFixed(2)
+					modelInfo: model_info,
+					unitPrice: model_info.rental_setting.find(v => v.hire_duration_unit == model_info
+						.selectType)?.hire_price,
+					service_list: model_info.service_list || [],
+					price: model_info.totalPrice / 100,
+					totalPrice: model_info.select_type != 100 ? ((model_info.totalPrice + model_info.deposit) / 100).toFixed(2) : ((model_info.sell_price) / 100).toFixed(2)
 				})
 			}
 			this.pick_up_time = Math.floor(new Date().getTime() / 1000)
 			this.setData({
-				takeCar:common.getFormattedTime()
+				takeCar: common.getFormattedTime()
 			})
 		},
 		/**
@@ -203,30 +214,30 @@
 		computed: {
 			leaseUnitsResult() {
 				const result = LEASE_TYPE_ARR.find(v => v.value == this.modelInfo.selectType);
-      			return result ? result.label : '';
+				return result ? result.label : '';
 			},
 			leaseUnits() {
 				const result = LEASE_TYPE_ARR.find(v => v.value == this.modelInfo.selectType);
-      			return result ? result.unit : '';
+				return result ? result.unit : '';
 			},
 
 		},
 		methods: {
 			handleValuesUpdated(e) {
 				this.isShowCalendar = false;
-				const timeStr=new Date(e.startDate)
-				this.pick_up_time=Math.floor(new Date(e.startDate).getTime()/1000)
+				const timeStr = new Date(e.startDate)
+				this.pick_up_time = Math.floor(new Date(e.startDate).getTime() / 1000)
 				this.setData({
-					takeCar:common.getFormattedTime(timeStr)
+					takeCar: common.getFormattedTime(timeStr)
 				})
-				console.log(e,'eeee');
+				console.log(e, 'eeee');
 			},
 			tapSelectTime() {
 				this.setData({
 					isShowCalendar: true
 				})
 			},
-			navAddress(){
+			navAddress() {
 				const {
 					address,
 					latitude,
@@ -239,74 +250,107 @@
 					scale: 15,
 					name: shop_name,
 					address: address,
-					success: function (res) {},
+					success: function(res) {},
 				})
 			},
 			bindDetail() {
 				this.isShowDetail = true
 			},
-			navToPage(){
+			navToPage() {
 				this.setData({
-					isShowToBuy:true
+					isShowToBuy: true
 				})
 			},
-			closeShow(){
+			closeShow() {
 				this.setData({
-					isShowToBuy:false
+					isShowToBuy: false
 				})
 			},
-			payToOrder(type){
+			payToOrder(type) {
 				const pay_type = type
-				var from=''
-				if(pay_type == 1){
+				var from = ''
+				if (pay_type == 1) {
 					from = 'wx'
-				}else if(pay_type == 2){
+				} else if (pay_type == 2) {
 					from = 'ali'
 				}
-				const hire_duration=this.modelInfo.rental_setting.find(v => v.hire_duration_unit == this.modelInfo.selectType)?.hire_duration
-				console.log(this.modelInfo,'test');
-				const pData={
+				const hire_duration = this.modelInfo.rental_setting.find(v => v.hire_duration_unit == this.modelInfo
+					.selectType)?.hire_duration
+				console.log(this.modelInfo, 'test');
+				const pData = {
 					pay_type,
-					car_model_id:this.modelInfo.model_id,
-					hire_cycle:this.modelInfo.count,
-					hire_duration_unit:this.modelInfo.selectType,
+					car_model_id: this.modelInfo.model_id,
+					hire_cycle: this.modelInfo.count,
+					hire_duration_unit: this.modelInfo.selectType,
 					hire_duration,
-					price: this.totalPrice*100,
-					pick_up_time:this.pick_up_time,
+					price: this.totalPrice * 100,
+					pick_up_time: this.pick_up_time,
 					address: this.modelInfo.address,
-					currency_code:'CNY'
+					currency_code: 'CNY'
+				}
+				common.loading();
+				if (this.modelInfo.selectType == 100) {
+					this.loadPayBuy(pData)
+					return
 				}
 				this.loadPayMethod(pData)
-				
+
 			},
-			loadPayMethod(pData){
+			async loadPayBuy(pData) {
+				let {
+					data
+				} = await request.postApi(config_gyq.API_FLK_ORDER_RESERVE, {
+					pay_type: pData.pay_type,
+					car_model_id: pData.car_model_id,
+					price: this.modelInfo.sell_price,
+					pick_up_time: pData.pick_up_time,
+					currency_code: 'CNY',
+				})
+				uni.hideLoading();
+				if (data.code == 200) {
+					if (!data.data.need_pay) {
+						common.simpleToast(this.$t('支付成功'));
+						this.order_sn = data.data.order_sn;
+						this.sub_sn = data.data.sub_sn;
+						this.setData({
+							isShowToBuy: false,
+							isShowCheckOrder: true
+						})
+					}
+				} else {
+					common.simpleToast(data.msg);
+
+				}
+			},
+			loadPayMethod(pData) {
 				const me = this;
-				common.loading();
-				http.postApi(config.API_FLK_ORDER_HIRE_MODEL, pData, function (resp) {
+				http.postApi(config.API_FLK_ORDER_HIRE_MODEL, pData, function(resp) {
 					uni.hideLoading();
 					if (resp.data.code === 200) {
-						if(!resp.data.data.need_pay){
-							common.simpleToast(me,me.$t('支付成功'));
+						if (!resp.data.data.need_pay) {
+							common.simpleToast(me, me.$t('支付成功'));
 							me.order_sn = resp.data.data.order_sn;
 							me.sub_sn = resp.data.data.sub_sn;
 							me.setData({
-								isShowToBuy:false,
-								isShowCheckOrder:true
+								isShowToBuy: false,
+								isShowCheckOrder: true
 							})
 						}
-					}  else {
-						common.simpleToast(me,resp.data.msg);
-						
+					} else {
+						common.simpleToast(me, resp.data.msg);
+
 					}
 				});
 			},
-			toIndexPage(){
+			toIndexPage() {
 				uni.switchTab({
 					url: '/pages/index/index'
 				})
 			},
-			toOrderInfo(){
-				uni.navigateTo({ url: '/pages/orderStatus/orderStatus?sub_sn=' + this.sub_sn })
+			toOrderInfo() {
+				uni.navigateTo({
+					url: '/pages/orderStatus/orderStatus?sub_sn=' + this.sub_sn
+				})
 			}
 		}
 	};

+ 3 - 3
pages/travelingTrack/travelingTrack.vue

@@ -159,9 +159,9 @@
 						console.log(me.markers,'me.markers');
 					}else{
 						// 默认返回上一个页面再提示报错
-						uni.navigateBack({
-							delta: 1
-						})
+						// uni.navigateBack({
+						// 	delta: 1
+						// })
 						common.simpleToast(resp.data.msg)
 					}
 				})