Browse Source

2023-3-30

cmy 1 year ago
parent
commit
cd496e5833

+ 1 - 1
App.vue

@@ -33,7 +33,7 @@
 	let green =
 		'--view-theme: rgba(66,202,77,1);--view-theme-16: #42CA4D;--view-priceColor:#FF7600;--view-minorColor:rgba(108, 198, 94, 0.5);--view-minorColorT:rgba(66, 202, 77, 0.1);--view-bntColor:#FE960F;--view-op-ten: rgba(66,202,77, 0.1);--view-main-start:#70E038; --view-main-over:#42CA4D;--view-op-point-four: rgba(66,202,77, 0.04);'
 	let red =
-		'--view-theme: rgba(233,51,35,1);--view-theme-16: #e93323;--view-priceColor:#e93323;--view-minorColor:rgba(233, 51, 35, 0.5);--view-minorColorT:rgba(233, 51, 35, 0.1);--view-bntColor:#FE960F;--view-op-ten: rgba(233,51,35, 0.1);--view-main-start:#FF6151; --view-main-over:#e93323;--view-op-point-four: rgba(233,51,35, 0.04);'
+		'--view-theme: rgba(32,33,53,1);--view-theme-16:rgba(22,22,39,1);--view-priceColor:#75EFFA;--view-minorColor:rgba(32,33,53,1);--view-minorColorT:rgba(32,33,53,0.1);--view-bntColor:#FE960F;--view-op-ten: rgba(233,51,35, 0.1);--view-main-start:rgba(22,22,39,1); --view-main-over:rgba(32,33,53,1);--view-op-point-four: rgba(233,51,35, 0.04);'
 	let blue =
 		'--view-theme: rgba(29,176,252,1);--view-theme-16:#1db0fc;--view-priceColor:#FD502F;--view-minorColor:rgba(58, 139, 236, 0.5);--view-minorColorT:rgba(9, 139, 243, 0.1);--view-bntColor:#22CAFD;--view-op-ten: rgba(29,176,252, 0.1);--view-main-start:#40D1F4; --view-main-over:#1DB0FC;--view-op-point-four: rgba(29,176,252, 0.04);'
 	let pink =

+ 143 - 1
api/rent.js

@@ -2,10 +2,152 @@ import request from "@/utils/request.js";
 
 /**
  * 获取车辆列表
- * @param data object 用户账号密码
+ * @param data object 
  */
 export function getCarList(data) {
 	return request.get(
 		"v3/rent", data
 	);
 }
+/**
+ * 获取车辆详情
+ * @param data object 
+ */
+export function getCarDetail(data) {
+	return request.get(
+		`v3/rent/${data.id}`
+	);
+}
+/**
+ * 创建订单
+ * @param data object 
+ */
+export function postCarCreate(data) {
+	return request.post(
+		`v3/rent/create`, data
+	);
+}
+/**
+ * 订单状态查询
+ * @param data object 
+ */
+export function getOrderStatus(id) {
+	return request.get(
+		`v3/rentinfo/detail/${id}`
+	);
+}
+/**
+ * 订单列表
+ * @param data object 
+ */
+export function getRentOrder(data) {
+	return request.get(
+		`v3/rent/order`, data
+	);
+}
+
+/**
+ * 订单统计数据
+ * @param data object 
+ */
+export function getRentOrderData(data) {
+	return request.get(
+		`v3/rent/order_data`, data
+	);
+}
+
+/**
+ * 订单详情
+ * @param data object 
+ */
+export function getRentOrderDteail(id) {
+	return request.get(
+		`v3/rent/order_detail/${id}`
+	);
+}
+/**
+ * 订单支付
+ * @param data object 
+ */
+export function postRentPay(data) {
+	return request.post(
+		`v3/rent/pay`, data
+	);
+}
+/**
+ * 绑定车辆
+ * @param data object 
+ */
+export function rentSetcar(data) {
+	return request.post(
+		`v3/rent/setcar`, data
+	);
+}
+
+/**
+ * 获取我的车辆
+ * @param data object 
+ * {
+ *	status:unlock开锁,lock关锁,deblock解锁,cushion开坐垫,find寻车
+ *}
+ */
+export function getMyCar(data) {
+	return request.get(
+		`v3/car/my`, data
+	);
+}
+
+/**
+ * 发送车辆指令
+ * @param data object 
+ */
+export function getLock(data) {
+	return request.get(
+		`v3/car/control/${data.type}`, data
+	);
+}
+
+
+
+/**
+ * 车辆控制记录
+ * @param data object 
+ * {
+	 type:auth授权record行程notice报警record_charge收费position当前车辆信息
+ }
+ * 
+ */
+export function getOneinfo(data) {
+	return request.get(
+		`v3/car/oneinfo/${data.type}`, data
+	);
+}
+/**
+ * 车辆行车记录
+ * @param data object 
+ */
+export function getRouterDetail(data) {
+	return request.get(
+		`v3/car/onedetail/${data.type}`, data
+	);
+}
+/**
+ * 车辆授权
+ * @param data object 
+ */
+export function postCarAuth(data) {
+	return request.post(
+		`v3/car/auth/0`, data
+	);
+}
+
+/**
+ * 撤销车辆授权
+ * @param data object 
+ */
+export function deleteCarAuth(data) {
+	return request.delete(
+		`v3/car/auth/${data.id}`, data
+	);
+}
+

+ 1 - 1
components/emptyPage.vue

@@ -36,7 +36,7 @@
 		}
 		.txt{
 			font-size: 26rpx;
-			color: #999;
+			color: $uni-color-tip;
 		}
 	}
 </style>

+ 4 - 3
manifest.json

@@ -20,7 +20,8 @@
             "Payment" : {},
             "Share" : {},
             "VideoPlayer" : {},
-            "OAuth" : {}
+            "OAuth" : {},
+            "Maps" : {}
         },
         "safearea" : {
             "bottom" : {
@@ -50,7 +51,7 @@
                     "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
                 ],
-                "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
                 "permissionExternalStorage" : {
                     "request" : "none",
                     "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
@@ -115,7 +116,7 @@
                 "maps" : {
                     "amap" : {
                         "appkey_ios" : "aeb768547b9d752891e37e1ca0a2b66d",
-                        "appkey_android" : "41ec5c3f4d110ce02a326210fe147be8"
+                        "appkey_android" : "a40e1e7e908aa1fa1b8ca25c8027f03a"
                     }
                 },
                 "oauth" : {

+ 138 - 17
pages.json

@@ -62,7 +62,7 @@
 			}
 		},
 		{
-			"path": "pages/mall/index",
+			"path": "pages/renttab/index",
 			"style": {
 				"navigationBarTitleText": "商城",
 				"app-plus": {
@@ -73,22 +73,143 @@
 					// #endif
 				}
 			}
-		},
-		{
-			"path": "pages/mall/carDetail",
-			"style": {
-				"navigationBarTitleText": "商品详情",
-				"app-plus": {
-					// #ifdef APP-PLUS
-					"titleNView": {
-						"type": "default"
-					}
-					// #endif
-				}
-			}
 		}
 	],
-	"subPackages": [{  // 模块分包
+	"subPackages": [{ // 模块分包
+			"root": "pages/rent",
+			"name": "rent",
+			"pages": [{
+					"path": "carpay/carDetail",
+					"style": {
+						"navigationBarTitleText": "商品详情",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "carpay/paySuccess",
+					"style": {
+						"navigationBarTitleText": "支付成功",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "order/orderList",
+					"style": {
+						"navigationBarTitleText": "我的服务",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "order/orderDetail",
+					"style": {
+						"navigationBarTitleText": "服务详情",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "order/onBindCar",
+					"style": {
+						"navigationBarTitleText": "绑定车辆",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "mycar/index",
+					"style": {
+						"navigationBarTitleText": "我的车辆",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "control/route",
+					"style": {
+						"navigationBarTitleText": "行程记录",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "control/routeDetail",
+					"style": {
+						"navigationBarTitleText": "路径详情",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "control/authList",
+					"style": {
+						"navigationBarTitleText": "授权列表",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "control/auth",
+					"style": {
+						"navigationBarTitleText": "车辆授权",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				}
+			]
+		}, { // 模块分包
 			"root": "pages/extension",
 			"name": "extension",
 			"pages": [{
@@ -523,7 +644,7 @@
 						"app-plus": {
 							// #ifdef APP-PLUS
 							"titleNView": {
-				  		"type": "default"
+								"type": "default"
 							}
 							// #endif
 						}
@@ -1552,7 +1673,7 @@
 			]
 		}
 	],
-	"tabBar": {  // 底部菜单
+	"tabBar": { // 底部菜单
 		"color": "#282828",
 		"selectedColor": "#ff3366",
 		"borderStyle": "white",

+ 311 - 173
pages/index/newindex/index.vue

@@ -1,17 +1,19 @@
 <template>
-	<view class="pageBox">
-		<view class="userOff" v-if="actionCartItem">
+	<view class="pageBox" :style="colorStyle">
+		<view class="userOff" v-if="actionCartItem.id">
 			<view class="navBox">
-				<view class="flex topIconBox">
-					<image @click="navTo('/pages/index/shopTab?type=1')" class="topIcon"
-						src="../../../static/images/controller_witchShop.png" mode="widthFix"></image>
+				<view class="acea-row row-between-wrapper topIconBox">
+					<navigator url="/pages/renttab/index">
+						<image class="topIcon" src="../../../static/images/controller_witchShop.png" mode="widthFix">
+						</image>
+					</navigator>
 					<view v-if="actionCartItem" class="clamp padding-l-10 padding-r-10">
-						{{actionCartItem.car_name||''}}
+						{{actionCartItem.machine_name||''}}
 					</view>
 					<image @click="navTo('/pages/index/notice')" class="topIcon"
 						src="../../../static/images/controller_witchMessage.png" mode="widthFix">
 					</image>
-					<view class="topIconNum flex" v-if="notify>0">
+					<view class="topIconNum acea-row row-between-wrapper" v-if="notify>0">
 						<text>
 							{{notify}}
 						</text>
@@ -19,30 +21,39 @@
 				</view>
 			</view>
 			<view class="actionBox">
-				<image class="cartImg" :src="actionCartItem.image" mode="aspectFit"></image>
-				<view class="timeBox" v-if="actionCartItem.day>0">
-					<view style="border-radius: 20rpx;"
-						class="rowContentBox flexCenter lineBorder padding-l-20 padding-r-20 padding-t-10 padding-b-10">
-						<view class="tipMen"></view>
-						<view class="dayBox" v-if="actionCartItem.car_operate">
-							<view>
-								{{actionCartItem.day}}
+
+				<map class="map" :markers="[{
+					id:1,
+					longitude:actionCartItem.longitude||121.420761,
+					latitude: actionCartItem.latitude||28.65641,
+					iconPath:'../../static/images/location.png',
+					width:30,
+					height:35
+				}]" :longitude='actionCartItem.longitude||121.420761' :latitude='actionCartItem.latitude||28.65641'></map>
+				<view class="timeBox" v-if="actionCartItem.is_available==1">
+					<view class="rightTip rowContentBox acea-row row-between-wrapper">
+						<view class="dayBox acea-row row-middle">
+							<view class="oldDay ">
+								编号:
 							</view>
-							<view class="oldDay margin-t-10">
-								剩余天数
+							<view class="tip">
+								{{actionCartItem.machine_no}}
 							</view>
 						</view>
-						<view class="dayBox" v-else>
-							<view class="oldDay margin-t-10 font-color-red">
-								已欠费
+						<view class=" dayBox acea-row row-middle" v-if="actionCartItem.plate_number">
+							<view class="oldDay ">
+								车牌号:
+							</view>
+							<view class="tip">
+								{{actionCartItem.plate_number}}
 							</view>
 						</view>
 					</view>
 				</view>
 			</view>
-			<view class="content">
+			<view class="content acea-row row-middle">
 				<view class="contentButtom flexCenter">
-					<view class="buttomBox flex">
+					<view class="buttomBox acea-row row-between-wrapper">
 						<view class="leftBox">
 							<view class="buttom buttomLg ">
 								<view @click="authSet" class="rowContentBox flexCenter lineBorder">
@@ -62,10 +73,10 @@
 								<view class="buttomPaddingBg">
 								</view>
 							</view>
-							<view class="leftCenterButtom buttom" @click="navTo('/pages/user/money/recharge')">
+							<view class="leftCenterButtom buttom" @click="navTo('/pages/users/user_payment/index')">
 								<view class="rowContentBox flexCenter lineBorder">
 									<view class="tipMen"></view>
-									<view>
+									<view style="z-index: 99;">
 										<view>
 										</view>
@@ -107,8 +118,8 @@
 										<view class="boxBgJb borderRadiusAll flexCenter">
 											<view class="flex-center">
 												<view class="iconButtomBox borderRadiusAll flexCenter"
-													:class="{greedBg:actionCartItem.status==1||actionCartItem.status==3||actionCartItem.status==4}"
-													@click="tabCarStatus('tab',actionCartItem)">
+													:class="{greedBg:actionCartItem.status==0||actionCartItem.status==2}"
+													@click="setCarType((actionCartItem.status==2||actionCartItem.status==0)?'unlock':'lock')">
 													<view class="mr borderRadiusAll "></view>
 													<view class="iconButtomJb">
 														<view>
@@ -116,8 +127,7 @@
 																src="../../../static/images/controller_qidong.png"
 																mode="aspectFit"></image>
 														</view>
-														<view class="margin-t-10"
-															v-if="actionCartItem.status==1||actionCartItem.status==3||actionCartItem.status==4">
+														<view class="margin-t-10" v-if="actionCartItem.status==0">
 															启动
 														</view>
 														<view class="margin-t-10" v-else>
@@ -130,7 +140,7 @@
 									</view>
 									<view class="line left"></view>
 									<view class="line right"></view>
-									<view @click="alertCartList" class="topButtomTipBox posbuttom flexCenter">
+									<view @click="alertCarList=true" class="topButtomTipBox posbuttom flexCenter">
 										<view class="centerTextBox">
 											<view>
 												<image class="tipIcon"
@@ -142,8 +152,7 @@
 											</view>
 										</view>
 									</view>
-									<view class="rightButtomTipBox posbuttom flexCenter"
-										@click="tabCarStatus('seek',actionCartItem)">
+									<view class="rightButtomTipBox posbuttom flexCenter" @click="setCarType('find')">
 										<view class="centerTextBox">
 											<view>
 												<image class="tipIcon"
@@ -155,8 +164,7 @@
 											</view>
 										</view>
 									</view>
-									<view
-										@click="openMap(actionCartItem.cartInfo.latitude,actionCartItem.cartInfo.longitude)"
+									<view @click="setCarType('deblock')"
 										class="bottomButtomTipBox posbuttom flexCenter">
 										<view class="centerTextBox">
 											<view>
@@ -165,12 +173,11 @@
 													mode="aspectFit"></image>
 											</view>
 											<view class="margin-t-10">
-												定位
+												解锁
 											</view>
 										</view>
 									</view>
-									<view class="leftButtomTipBox posbuttom flexCenter"
-										@click="tabCarStatus('unlock',actionCartItem)">
+									<view class="leftButtomTipBox posbuttom flexCenter" @click="setCarType('cushion')">
 										<view class="centerTextBox">
 											<view>
 												<image class="tipIcon"
@@ -186,11 +193,10 @@
 							</view>
 						</view>
 						<view class="rightBox">
-							<view class="rightButtom buttom flex">
-
+							<view class="rightButtom buttom acea-row row-between-wrapper">
 								<view class="centerTextBox">
 									<view>
-										{{actionCartItem.bfb||0}}%
+										{{actionCartItem.residue||0}}%
 									</view>
 									<view>
 										<image class="tipIcon" src="../../../static/images/controller_dianchi.png"
@@ -198,26 +204,16 @@
 									</view>
 								</view>
 								<view class="rightElectric flexCenter">
-									<view class="electric" :class="{greedBg:actionCartItem.bfb>91}"></view>
-									<view class="electric" :class="{greedBg:actionCartItem.bfb>83}"></view>
-									<view class="electric" :class="{greedBg:actionCartItem.bfb>75}"></view>
-									<view class="electric" :class="{greedBg:actionCartItem.bfb>66}"></view>
-									<view class="electric" :class="{yellowBg:actionCartItem.bfb>58}"></view>
-									<view class="electric" :class="{yellowBg:actionCartItem.bfb>50}"></view>
-									<view class="electric" :class="{yellowBg:actionCartItem.bfb>41}"></view>
-									<view class="electric" :class="{yellowBg:actionCartItem.bfb>33}"></view>
-									<view class="electric" :class="{redGb:actionCartItem.bfb>24}"></view>
-									<view class="electric" :class="{redGb:actionCartItem.bfb>16}"></view>
-									<view class="electric" :class="{redGb:actionCartItem.bfb>8}"></view>
-									<view class="electric" :class="{redGb:actionCartItem.bfb>0}"></view>
+									<view class="electric" v-for="(ls,ind) in residueList"
+										:class="{greedBg:actionCartItem.residue>ls}" :key="ind"></view>
 								</view>
 							</view>
 							<view class=" buttomLg buttom"
-								@click="navTo('/pages/index/route?id='+actionCartItem.car_number)">
+								@click="navTo('/pages/rent/control/route?id='+actionCartItem.id)">
 								<view class="topBageBg"></view>
 								<view class="rowContentBox flexCenter lineBorder">
 									<view class="tipMen"></view>
-									<view class="centerTextBox margin-l-40 padding-l-30">
+									<view class="centerTextBox  repair ">
 										<view>
 											<image class="tipIcon" src="../../../static/images/controller_xincheng.png"
 												mode="aspectFit"></image>
@@ -235,49 +231,88 @@
 				</view>
 			</view>
 		</view>
-		<uni-popup ref="popup" type="bottom" v-if="actionCartItem">
+		<view v-if="actionCartItem.id" class="payment" :class="{on:alertCarList}">
 			<view class="cartListAlertButtom">
-				<view class="cartTitle flex">
+				<view class="cartTitle acea-row row-between-wrapper">
 					<view>
 						请选择更换的车辆
 					</view>
-					<image @click="popupClose" class="exit" src="../../../static/images/goodsExit.png"
+					<image @click="alertCarList=false" class="exit" src="../../../static/images/goodsExit.png"
 						mode="scaleToFill">
 					</image>
 				</view>
-				<view class="actionCartBox">
-					<view class="itemCart flex" :class="{action:item.id==actionCartItem.id}"
-						v-for="(item,index) in myCartList" @click="changeCart(index)" :key='index'>
-						<image class="cartImg" :src="item.image" mode="scaleToFill"></image>
-						<view class="content">
-							<view class="title clamp2" :class="{action:item.id==actionCartItem.id}">
-								{{item.car_name||''}}
+				<view class="item" v-for="(item,ind) in myCartList"
+					@click="()=>{alertCarList=false,actionCartItem=item}" :class="{action:item.id==actionCartItem.id}">
+					<view class="acea-row">
+						<image class="img" src="../../rent/static/cart.png" mode="scaleToFill"></image>
+						<view class="title line2">
+							{{item.machine_name}}
+						</view>
+					</view>
+					<view class="machine ">
+						<view class="acea-row row-between">
+							<view class="it">
+								当前位置:{{item.address?item.address:'未定位'}}
+							</view>
+							<view class="status">
+								电量:{{item.residue}}%
+							</view>
+						</view>
+					</view>
+					<view class="machine acea-row row-between-wrapper">
+
+						<view class="acea-row row-left">
+							<view class="it">
+								编号:
+							</view>
+							<view class="code">
+								{{item.machine_no}}
+
 							</view>
-							<view class="address margin-t-20" :class="{action:item.id==actionCartItem.id}">
-								{{item.address||"暂无定位信息"}}
+						</view>
+						<view class="acea-row row-right" v-if="item.plate_number">
+							<view class="it">
+								车牌号:
+							</view>
+							<view class="code">
+								{{item.plate_number}}
 							</view>
 						</view>
 					</view>
+					<view v-if="item.status==0" class="text_red tip ">
+						关锁
+					</view>
+					<view v-if="item.status==1" class="text_blue tip">
+						开锁
+					</view>
+					<view v-if="item.status==2" class="text_greed tip">
+						解锁
+					</view>
 				</view>
 				<view style="height: 1px;"></view>
 			</view>
-		</uni-popup>
+		</view>
 		<pageFoot></pageFoot>
 	</view>
 </template>
 <script>
 	import {
-		mycar,
-		getCarInfo,
-		getcar_status,
-		car_switch,
-		getUserInfo
-	} from '@/api/user.js';
+		getMyCar,
+		getLock
+	} from '@/api/rent.js';
+	import {
+		getUserInfo,
+	} from "@/api/user.js";
+	import {
+		toLogin
+	} from "@/libs/login.js";
 	import {
 		mapGetters
 	} from 'vuex';
 	import pageFoot from '@/components/pageFooter/index.vue';
+	import colors from '@/mixins/color.js';
 	export default {
+		mixins: [colors],
 		props: {
 			notify: {
 				type: Number,
@@ -289,7 +324,6 @@
 		},
 		data() {
 			return {
-				chickedMyCart: 0, //默认选中的车辆
 				// 我的车辆
 				myCartList: [],
 				ladingCart: false, //判断是否已经加载过我的车辆
@@ -301,54 +335,119 @@
 				// #endif
 				timeOut: '', //用于存放调用定时获取对象数据
 				reachangeAlert: false, //判断是否已经提示过充值
+				alertCarList: false,
+				actionCartItem: {
+					id: 0
+				},
+				// 进度百分比
+				residueList: [91, 83, 75, 66, 58, 50, 41, 33, 24, 16, 8, 0],
 			};
 		},
-		watch: {
-			reachange(newValue, oldValue) {
-				if (newValue && (this.actionCartItem.auth_num != -1)) {
+		watch: {},
+		computed: {
+			...mapGetters(['isLogin', 'uid']),
+		},
+		created() {
+			if (this.isLogin) {
+				this.getCarInfo();
+			} else {
+				toLogin();
+			}
+		},
+		methods: {
+			changeCart() {
+
+			},
+			navTo(url) {
+				if (this.isLogin) {
+					uni.navigateTo({
+						url,
+					});
+				} else {
+					toLogin();
+				}
+			},
+			// 设置车锁状态
+			async setCarType(type) {
+				uni.showLoading({
+					title: '提交中',
+					mask: true
+				});
+				const bool = await this.$util.$L.getLocation();
+				// 判断是否获取地址失败
+				if (!bool) {
+					uni.hideLoading()
 					uni.showModal({
-						title: '错误',
-						content: '您的余额已不足三天支付是否马上充值',
-						cancelText: '关闭',
-						confirmText: '马上充值',
+						title: '提示',
+						content: '未获取地址数据,请授权后再试',
+						cancelText: '取消',
+						confirmText: '授权',
 						success: res => {
 							if (res.confirm) {
-								this.navTo('/pages/user/money/recharge');
+								this.setCarType(type)
 							}
 						},
 					});
+					return;
 				}
-
-			}
-		},
-		computed: {
-			...mapGetters(['userInfo']),
-			actionCartItem() {
-				if (this.myCartList[this.chickedMyCart]) {
-					return this.myCartList[this.chickedMyCart]
-				} else {
-					return false
-				}
+				console.log(uni.getStorageSync('CACHE_LONGITUDE'));
+				console.log(uni.getStorageSync('CACHE_LATITUDE'));
+				getLock({
+					type: type,
+					'machine_no': this.actionCartItem.machine_no,
+					'longitude': uni.getStorageSync('CACHE_LONGITUDE'),
+					'latitude': uni.getStorageSync('CACHE_LATITUDE')
+				}).then((res) => {
+					console.log(res);
+					uni.hideLoading()
+				}).catch((res) => {
+					uni.hideLoading()
+					uni.showToast({
+						title: res,
+						icon: 'error'
+					});
+				})
 			},
-			reachange() {
-				// 余额
-				const a1 = +this.userInfo.now_money;
-				if (!this.actionCartItem) {
-					return false
+			// 父元素启动监听
+			onStartGetCartInfo() {
+				if (this.timeOut) {
+					this.outGetCartInfo();
 				}
-				// 三天内应该付的金额
-				const a2 = this.actionCartItem.day_deducted * 3;
-				if (a1 < a2 && !this.reachangeAlert && this.actionCartItem.day > 0) {
-					// 处理已加载提示用户充值信息
-					this.reachangeAlert = true;
-					return (new Date()).getTime()
+				this.onGetCartInfo()
+			},
+			// 关闭定时获取车辆信息
+			outGetCartInfo() {
+				clearInterval(this.timeOut)
+			},
+			// 获取车辆数据
+			onGetCartInfo() {
+				this.getCarInfo();
+				this.timeOut = setInterval((e) => {
+					this.getCarInfo();
+				}, 60000)
+			},
+			//获取车辆信息
+			getCarInfo() {
+				getMyCar({}).then((e) => {
+					this.myCartList = e.data;
+					this.actionCartItem = e.data[0]
+					console.log(e)
+				}).catch((e) => {
+					console.log(e);
+				})
+			},
+			// 判断是否有权限授权车辆
+			authSet() {
+				if ((+this.actionCartItem.uid) == (+this.uid)) {
+					this.navTo('/pages/rent/control/authList?id=' + this.actionCartItem.id)
 				} else {
-					return false
+					uni.showModal({
+						title: '提示',
+						content: '该车辆是他人授权给您的车辆您无权二次授权',
+						showCancel: false,
+					});
 				}
-			}
-		},
-		created() {
-			// this.getUserInfo();
+			},
 		},
 	};
 </script>
@@ -363,8 +462,8 @@
 	$maxBoxBg:#1f2136;
 
 	.pageBox {
-		height: 0;
-		min-height: 100%;
+		height: 100vh;
+		padding-bottom: 45px;
 	}
 
 	.flexCenter {
@@ -425,40 +524,49 @@
 			text-align: center;
 			height: 400rpx;
 			position: relative;
+			flex-direction: column;
+			display: flex;
 
-			.cartImg {
-				height: 100%;
+			.map {
+				height: calc(100% - 80rpx);
 				width: 100%;
 			}
 
 			.timeBox {
-				position: absolute;
 				color: #FFFFFF;
-				right: 30rpx;
-				top: 30rpx;
+				width: 100%;
 				font-size: $uni-font-size-base;
 				font-weight: bold;
+				flex-shrink: 0;
+
+				.rightTip {
+					padding: 20rpx;
+				}
 
 				.dayBox {
 					z-index: 1;
 					line-height: 1;
+					font-size: $uni-font-size-sm;
+
+					.tip {
+						color: #75EFFA;
+						background-color: rgba($color: #75EFFA, $alpha: 0.2);
+						padding: 10rpx 10rpx;
+						border-radius: 10rpx;
+					}
 				}
 
 				.oldDay {
+					padding: 6rpx 10rpx;
+					text-align: left;
 					font-size: $uni-font-size-sm - 2rpx;
-					color: $uni-border-color;
-				}
-
-				.tipMen {
-					transform-origin: top left;
-					margin-left: 0;
+					color: #FFF;
 				}
 			}
 		}
 
 		.content {
 			flex-shrink: 0;
-			flex-grow: 1;
 		}
 
 		.lineBorder {
@@ -588,6 +696,11 @@
 				.buttomLg {
 					width: 180rpx;
 					height: 180rpx;
+
+					.repair {
+						margin-left: 40rpx;
+						padding-left: 30rpx;
+					}
 				}
 
 
@@ -845,72 +958,97 @@
 	.cartListAlertButtom {
 		position: relative;
 		padding-top: 20rpx;
-		border-top-left-radius: 30rpx;
-		border-top-right-radius: 30rpx;
-		background-color: #FFFFFF;
+		padding: 30rpx;
+		overflow: hidden;
 		z-index: 999;
-		/* #ifdef H5 */
-		padding-bottom: var(--window-bottom);
 
-		/* #endif */
-		.actionCartBox {
-			padding-bottom: 40rpx;
-
-			.itemCart {
-				background-color: #F3F6F8;
-				margin: 0 30rpx 30rpx;
-				padding: 0 30rpx;
-				border-radius: 20rpx;
-				height: 200rpx;
-				text-align: left;
-
-				&.action {
-					background-color: $uni-color-success;
-				}
+		.cartTitle {
+			margin: 0 30rpx;
+			margin-bottom: 30rpx;
+			font-size: $uni-font-size-lg;
+			font-weight: bold;
+			color: #FFF;
 
-				.cartImg {
-					width: 120rpx;
-					height: 120rpx;
-				}
+			.exit {
+				width: 50rpx;
+				height: 50rpx;
+			}
+		}
+
+		.item {
+			position: relative;
+			background-color: var(--view-theme-16);
+			padding: 30rpx;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+			overflow: hidden;
 
-				.content {
-					flex-grow: 1;
-					padding-left: 20rpx;
+			.title {
+				font-weight: bold;
+				font-size: $uni-font-size-lg;
+				color: #fff;
+				padding-left: 10rpx;
+			}
+
+			.machine {
+				font-size: $uni-font-size-sm;
+				color: #999999;
+				margin-top: 20rpx;
+
+				.code {
+					color: var(--view-priceColor);
+					background-color: rgba(#75EFFA, 0.2);
+					padding: 5rpx 10rpx;
+					border-radius: 10rpx;
 				}
+			}
 
-				.title {
-					font-size: $uni-font-size-base;
-					font-weight: bold;
-					color: $uni-color-title;
+			.img {
+				width: 40rpx;
+				height: 40rpx;
+			}
 
-					&.action {
-						color: #FFFFFF;
-					}
+			.tip {
+				position: absolute;
+				top: 0;
+				right: 0;
+				padding: 5rpx 20rpx;
+				font-size: 20rpx;
+				border-bottom-left-radius: 10rpx;
+
+				&.text_greed {
+					color: #49D8A8;
+					background-color: rgba(#49D8A8, 0.2);
 				}
 
-				.address {
-					line-height: 1;
-					font-size: $uni-font-size-sm - 2rpx;
-					color: $uni-border-color;
+				&.text_red {
+					color: rgba(254, 92, 45, 1);
+					background-color: rgba(rgba(254, 92, 45, 1), 0.2);
+				}
 
-					&.action {
-						color: #FFFFFF;
-					}
+				&.text_blue {
+					color: #1db0fc;
+					background-color: rgba(#1db0fc, 0.2);
 				}
 			}
 		}
+	}
 
-		.cartTitle {
-			margin: 0 30rpx;
-			margin-bottom: 30rpx;
-			font-size: $uni-font-size-lg;
-			font-weight: bold;
+	.payment {
+		position: fixed;
+		bottom: 45px;
+		left: 0;
+		width: 100%;
+		background-color: var(--view-theme);
+		border-top-left-radius: 40rpx;
+		border-top-right-radius: 40rpx;
+		z-index: 999;
+		transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
+		border: 1px solid #999;
+		transform: translate3d(0, 100%, 0);
 
-			.exit {
-				width: 50rpx;
-				height: 50rpx;
-			}
+		&.on {
+			transform: translate3d(0, 0, 0);
 		}
-
 	}
 </style>

+ 0 - 8
pages/mall/carDetail.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 905 - 0
pages/rent/carpay/carDetail.vue

@@ -0,0 +1,905 @@
+<template>
+	<view class="product-con">
+		<view class="product-con">
+			<!-- #ifndef APP-PLUS -->
+			<view class="navbar" :style="{ height: navH + 'rpx', opacity: opacity }">
+				<view class="navbarH" :style="'height:' + navH + 'rpx;'">
+					<view class="navbarCon acea-row row-center-wrapper"
+						:style="{ paddingRight: (navbarRight-20) + 'px' }">
+						<view class="header acea-row row-center-wrapper">
+						</view>
+					</view>
+				</view>
+			</view>
+			<!-- #endif -->
+			<!-- #ifndef APP-PLUS -->
+			<view id="home" class="home acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
+				:style="{ top: homeTop +'rpx'}">
+				<view class="iconfont icon-fanhui2" @tap="returns"></view>
+				<!-- #ifdef MP -->
+				<view class="line"></view>
+				<view class="iconfont icon-gengduo5" @click="moreNav"></view>
+				<!-- #endif -->
+			</view>
+			<!-- #endif -->
+			<view>
+				<scroll-view scroll-y="true" scroll-with-animation="true" :style="'height:' + height + 'px;'">
+					<view id="past0">
+						<!-- #ifdef APP-PLUS || MP -->
+						<view class="" :style="'width:100%;' + 'height:'+sysHeight"></view>
+						<!-- #endif -->
+						<productConSwiper ref="proSwiper" :imgUrls="storeInfo.images" :videoline="storeInfo.video_link">
+						</productConSwiper>
+						<view class="wrapper">
+							<view class="introduce" v-text="`${storeInfo.title}`"></view>
+							<view class="share acea-row row-between row-bottom">
+								<view class="money font-color">
+									{{$t(`¥`)}}
+									<text class="num" v-text="storeInfo.price || 0"></text>/月
+								</view>
+							</view>
+						</view>
+					</view>
+					<view class="product-intro" id="past3">
+						<view class="title">{{$t(`产品介绍`)}}</view>
+						<view class="conter">
+							<!-- #ifndef APP-PLUS -->
+							<parser :html="description" ref="article" :tag-style="tagStyle"></parser>
+							<!-- #endif -->
+							<!-- #ifdef APP-PLUS -->
+							<view class="description" v-html="description"></view>
+							<!-- #endif -->
+						</view>
+					</view>
+				</scroll-view>
+			</view>
+			<view class="footer acea-row row-between-wrapper" :class="{'eject':storeInfo.id}">
+				<navigator hover-class="none" class="item" open-type="switchTab" url="/pages/index/index">
+					<view class="iconfont icon-shouye6"></view>
+					<view class="p_center">{{$t(`首页`)}}</view>
+				</navigator>
+				<view class="bnt">
+					<form @submit="goBuy" class="buy bnts ">
+						<button class="buy bnts virbnt" form-type="submit">
+							{{$t(`立即购买`)}}
+						</button>
+					</form>
+				</view>
+			</view>
+		</view>
+		<payment :payMode="cartArr" :pay_close="pay_close" :isCall="true" :totalPrice="storeInfo.price"
+			@changePayType="(type)=>{payType=type}" @onChangeFun="onChangeFun"></payment>
+	</view>
+</template>
+
+<script>
+	let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
+	import {
+		getCarDetail,
+		postCarCreate
+	} from "@/api/rent.js";
+	import {
+		getUserInfo,
+	} from "@/api/user.js";
+	import {
+		mapGetters
+	} from "vuex";
+	import productConSwiper from "@/components/productConSwiper";
+	let app = getApp();
+	import parser from "@/components/jyf-parser/jyf-parser";
+	import {
+		toLogin
+	} from "@/libs/login.js";
+	import payment from '@/components/payment';
+	export default {
+		components: {
+			productConSwiper,
+			parser,
+			payment
+		},
+		data() {
+			let that = this;
+			return {
+				sysHeight: sysHeight,
+				id: 0, //商品id
+				storeInfo: {}, //商品详情
+				cart_num: 1, //购买数量
+				description: "",
+				navH: "",
+				opacity: 0,
+				height: 0,
+				tagStyle: {
+					img: "width:100%;display:block;",
+					table: "width:100%",
+					video: "width:100%;height:100%;",
+				},
+				navbarRight: 0,
+				homeTop: 20,
+				// 当前支付方式
+				payType:'weixin',
+				cartArr: [{
+						"name": this.$t(`微信支付`),
+						"icon": "icon-weixin2",
+						value: 'weixin',
+						title: this.$t(`使用微信快捷支付`),
+						payStatus: 1,
+					},
+					{
+						"name": this.$t(`支付宝支付`),
+						"icon": "icon-zhifubao",
+						value: 'alipay',
+						title: this.$t(`使用支付宝支付`),
+						payStatus: 1,
+					},
+					{
+						"name": this.$t(`余额支付`),
+						"icon": "icon-yuezhifu",
+						value: 'yue',
+						title: this.$t(`可用余额`),
+						payStatus: 1,
+						number:'0'
+					},
+				],
+				// 显示隐藏支付弹窗
+				pay_close: false,
+				// 用户信息
+				userdata:{},
+				username:'',//购买用户名称
+				from:'',//订单来源
+			};
+		},
+		watch:{
+			storeInfo: {
+				handler: function() {
+					this.$nextTick(() => {});
+				},
+				immediate: true,
+			},
+		},
+		computed: mapGetters(["isLogin"]),
+		onLoad(options) {
+			let that = this;
+			// #ifdef MP
+			that.navH = app.globalData.navHeight;
+			that.from = 'routine'
+			// #endif
+			// #ifdef H5
+			that.navH = 96;
+			that.from = that.$wechat.isWeixin() ? 'weixin' : 'weixinh5'
+			// #endif
+			// #ifdef APP-PLUS
+			that.navH = 30;
+			that.from = 'app'
+			// #endif
+			
+			
+			that.id = options.id;
+			uni.getSystemInfo({
+				success: function(res) {
+					that.height = res.windowHeight;
+					//res.windowHeight:获取整个窗口高度为px,*2为rpx;98为头部占据的高度;
+					// #ifndef APP-PLUS || H5 || MP-ALIPAY
+					that.navbarRight =
+						res.windowWidth - uni.getMenuButtonBoundingClientRect().left;
+					// #endif
+				},
+			});
+			//扫码携带参数处理
+			// #ifdef MP
+			if (options.scene) {
+				let value = that.$util.getUrlParams(decodeURIComponent(options.scene));
+				if (value.id) options.id = value.id;
+				//记录推广人uid
+				if (value.pid) app.globalData.spid = value.pid;
+			}
+			// #endif
+			that.getGoodsDetails();
+		},
+		onReady: function() {
+			this.$nextTick(function() {
+				// #ifdef MP
+				const menuButton = uni.getMenuButtonBoundingClientRect();
+				const query = uni.createSelectorQuery().in(this);
+				query
+					.select("#home")
+					.boundingClientRect((data) => {
+						this.homeTop = menuButton.top * 2 + menuButton.height - data.height || 0;
+					})
+					.exec();
+				// #endif
+			});
+		},
+		methods: {
+			// 支付弹窗触发事件
+			onChangeFun: function(e) {
+				let opt = e;
+				let action = opt.action || null;
+				let value = opt.value != undefined ? opt.value : null;
+				action && this[action] && this[action](value);
+			},
+			// 弹窗支付点击事件
+			payCheck(e){
+				const that = this;
+				that.payType = e;
+				postCarCreate({
+					'company_id': that.storeInfo.company_id,
+					'agent_id': that.storeInfo.agent_id,
+					'store_id': that.storeInfo.store_id,
+					'cooperate_id': that.storeInfo.cooperate_id,
+					'rent_id': that.storeInfo.id,
+					'car_lease': that.storeInfo.car_lease,
+					'several_months': that.storeInfo.several_months,
+					'pay_type': that.payType,
+					'pay_price':that.storeInfo.price,
+					'real_name': that.username,
+					'user_phone': that.userdata.record_phone,
+					from:that.from
+				}).then((res) => {
+					let status = res.data.status,
+					orderId = res.data.result.order_id,
+					jsConfig = res.data.result.jsConfig,
+					goPages = '/pages/rent/paySuccess?order_id=' + orderId + '&msg=' + res.msg +
+					'&type=3' + '&totalPrice=' + that.storeInfo.price,
+					friendPay = '/pages/users/payment_on_behalf/index?order_id=' + orderId + '&spread=' +
+					that.$store.state.app.uid
+					switch (status) {
+						case 'ORDER_EXIST':
+						case 'EXTEND_ORDER':
+							uni.hideLoading();
+							return that.$util.Tips({
+								title: res.msg
+							}, {
+								tab: 5,
+								url: goPages
+							});
+						case 'ALLINPAY_PAY':
+							uni.hideLoading();
+							// #ifdef MP
+							this.initIn = true
+							wx.openEmbeddedMiniProgram({
+								appId: 'wxef277996acc166c3',
+								extraData: {
+									cusid: jsConfig.cusid,
+									appid: jsConfig.appid,
+									version: jsConfig.version,
+									trxamt: jsConfig.trxamt,
+									reqsn: jsConfig.reqsn,
+									notify_url: jsConfig.notify_url,
+									body: jsConfig.body,
+									remark: jsConfig.remark,
+									validtime: jsConfig.validtime,
+									randomstr: jsConfig.randomstr,
+									paytype: jsConfig.paytype,
+									sign: jsConfig.sign,
+									signtype: jsConfig.signtype
+								}
+							})
+							this.jumpData = {
+								orderId: res.data.result.orderId,
+								msg: res.msg,
+							}
+							// #endif
+							// #ifdef APP-PLUS
+							plus.runtime.openURL(jsConfig.payinfo);
+							setTimeout(e => {
+								uni.reLaunch({
+									url: goPages
+								})
+							}, 1000)
+							// #endif
+							// #ifdef H5
+							this.formpost(res.data.result.pay_url, jsConfig)
+							// #endif
+							break;
+						case 'PAY_ERROR':
+							uni.hideLoading();
+							return that.$util.Tips({
+								title: res.msg
+							}, {
+								tab: 5,
+								url: goPages
+							});
+							break;
+						case 'SUCCESS':
+							uni.hideLoading();
+							if ((that.BargainId || that.combinationId || that.pinkId || that.seckillId || that
+									.discountId) && that.payType != 'friend')
+								return that.$util.Tips({
+									title: res.msg,
+									icon: 'success'
+								}, {
+									tab: 4,
+									url: goPages
+								});
+							return that.$util.Tips({
+								title: res.msg,
+								icon: 'success'
+							}, {
+								tab: 4,
+								url: that.payType == 'friend' ? friendPay : goPages
+							});
+							break;
+						case 'WECHAT_PAY':
+							that.toPay = true;
+							// #ifdef MP
+							/* that.toPay = true; */
+							let mp_pay_name = ''
+							if (uni.requestOrderPayment) {
+								mp_pay_name = 'requestOrderPayment'
+							} else {
+								mp_pay_name = 'requestPayment'
+							}
+							uni[mp_pay_name]({
+								timeStamp: jsConfig.timestamp,
+								nonceStr: jsConfig.nonceStr,
+								package: jsConfig.package,
+								signType: jsConfig.signType,
+								paySign: jsConfig.paySign,
+								success: function(res) {
+									uni.hideLoading();
+									if (that.BargainId || that.combinationId || that.pinkId || that
+										.seckillId || that.discountId)
+										return that.$util.Tips({
+											title: that.$t(`支付成功`),
+											icon: 'success'
+										}, {
+											tab: 4,
+											url: goPages
+										});
+									return that.$util.Tips({
+										title: that.$t(`支付成功`),
+										icon: 'success'
+									}, {
+										tab: 5,
+										url: goPages
+									});
+								},
+								fail: function(e) {
+									uni.hideLoading();
+									return that.$util.Tips({
+										title: that.$t(`取消支付`)
+									}, {
+										tab: 5,
+										url: goPages + '&status=2'
+									});
+								},
+								complete: function(e) {
+									uni.hideLoading();
+									//关闭当前页面跳转至订单状态
+									if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
+										'requestOrderPayment:cancel') return that.$util
+										.Tips({
+											title: that.$t(`取消支付`)
+										}, {
+											tab: 5,
+											url: goPages + '&status=2'
+										});
+								},
+							})
+							// #endif
+							// #ifdef H5
+							this.$wechat.pay(res.data.result.jsConfig).then(res => {
+								return that.$util.Tips({
+									title: that.$t(`支付成功`),
+									icon: 'success'
+								}, {
+									tab: 5,
+									url: goPages
+								});
+							}).catch(res => {
+								if (!this.$wechat.isWeixin()) {
+									uni.redirectTo({
+										url: goPages + '&msg=' + that.$t(`支付失败`) + '&status=2'
+										// '&msg=支付失败&status=2'
+									})
+								}
+								if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
+									title: that.$t(`取消支付`)
+								}, {
+									tab: 5,
+									url: goPages + '&status=2'
+								});
+							})
+							// #endif
+							// #ifdef APP-PLUS
+							uni.requestPayment({
+								provider: 'wxpay',
+								orderInfo: jsConfig,
+								success: (e) => {
+									let url = goPages;
+									uni.showToast({
+										title: that.$t(`支付成功`)
+									})
+									setTimeout(res => {
+										uni.redirectTo({
+											url: url
+										})
+									}, 2000)
+								},
+								fail: (e) => {
+									let url = '/pages/goods/order_pay_status/index?order_id=' +
+										orderId +
+										'&msg=' + that.$t(`支付失败`);
+									uni.showModal({
+										content: that.$t(`支付失败`),
+										showCancel: false,
+										success: function(res) {
+											if (res.confirm) {
+												uni.redirectTo({
+													url: url
+												})
+											} else if (res.cancel) {}
+										}
+									})
+								},
+								complete: () => {
+									uni.hideLoading();
+								},
+							});
+							// #endif
+							break;
+						case 'PAY_DEFICIENCY':
+							uni.hideLoading();
+							//余额不足
+							return that.$util.Tips({
+								title: res.msg
+							}, {
+								tab: 5,
+								url: goPages + '&status=1'
+							});
+							break;
+					
+						case "WECHAT_H5_PAY":
+							uni.hideLoading();
+							that.$util.Tips({
+								title: that.$t(`订单创建成功`)
+							}, {
+								tab: 4,
+								url: goPages + '&status=0'
+							});
+							setTimeout(() => {
+								location.href = res.data.result.jsConfig.mweb_url;
+							}, 2000);
+							break;
+					
+						case 'ALIPAY_PAY':
+							//#ifdef H5
+							if (this.from === 'weixin') {
+								uni.redirectTo({
+									url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
+								});
+							} else {
+								uni.hideLoading();
+								that.formContent = res.data.result.jsConfig;
+								that.$nextTick(() => {
+									document.getElementById('alipaysubmit').submit();
+								})
+							}
+							//#endif
+							// #ifdef MP
+							uni.navigateTo({
+								url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
+							});
+							// #endif
+							// #ifdef APP-PLUS
+							uni.requestPayment({
+								provider: 'alipay',
+								orderInfo: jsConfig,
+								success: (e) => {
+									uni.showToast({
+										title: that.$t(`支付成功`)
+									})
+									let url = '/pages/goods/order_pay_status/index?order_id=' +
+										orderId +
+										'&msg=' + that.$t(`支付成功`);
+									setTimeout(res => {
+										uni.redirectTo({
+											url: url
+										})
+									}, 2000)
+					
+								},
+								fail: (e) => {
+									let url = '/pages/goods/order_pay_status/index?order_id=' +
+										orderId +
+										'&msg=' + that.$t(`支付失败`);
+									uni.showModal({
+										content: that.$t(`支付失败`),
+										showCancel: false,
+										success: function(res) {
+											if (res.confirm) {
+												uni.redirectTo({
+													url: url
+												})
+											} else if (res.cancel) {}
+										}
+									})
+								},
+								complete: () => {
+									uni.hideLoading();
+								},
+							});
+							// #endif
+							break;
+					}
+				}).catch((res) => {
+					console.log(res);
+				})
+			},
+			// 支付弹窗关闭事件
+			payClose: function() {
+				this.pay_close = false;
+			},
+			// 购买
+			goBuy() {
+				if (this.isLogin === false) {
+					toLogin();
+				} else {
+					if(!this.userdata.record_phone){
+						uni.showModal({
+							title: '提示',
+							content: '您未绑定手机号请先绑定手机号',
+							cancelText: '取消',
+							confirmText: '立即绑定',
+							success: res => {
+								if(res.confirm){
+									uni.navigateTo({
+										url:'/pages/users/user_phone/index'
+									})
+								}
+							},
+						});
+					}else{
+						uni.showModal({
+							title: '请输入购买人姓名',
+							editable: true,
+							cancelText: '取消',
+							confirmText: '确定',
+							success: res => {
+								if(res.confirm){
+									if(!res.content){
+										uni.showToast({
+											title: '请输入姓名',
+											icon:"error"
+										});
+									}else{
+										this.username = res.content;
+										this.pay_close = true;
+									}
+								}
+							},
+						});
+					}
+				}
+			},
+			// 后退
+			returns() {
+				// #ifdef H5
+				return history.back();
+				// #endif
+				// #ifndef H5
+				return uni.navigateBack({
+					delta: 1,
+				})
+				// #endif
+			},
+			/*
+			 * 获取用户信息
+			 */
+			getUserInfo: function() {
+				let that = this;
+				getUserInfo().then((res) => {
+					that.$set(that, "userdata", res.data);
+					that.cartArr[2].number = res.data.now_money
+				});
+			},
+			/**
+			 * 获取产品详情
+			 *
+			 */
+			getGoodsDetails: function() {
+				let that = this;
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				getCarDetail({
+						id: that.id
+					})
+					.then((res) => {
+						uni.hideLoading();
+						let storeInfo = res.data.info;
+						let goodArray = new Array();
+						that.$set(that, "storeInfo", storeInfo);
+						that.$set(that, "description", storeInfo.description);
+						if (this.description) {
+							this.description = this.description.replace(
+								/<img/gi,
+								'<img style="max-width:100%;height:auto;float:left;display:block" '
+							);
+							this.description = this.description.replace(
+								/<video/gi,
+								'<video style="width:100%;height:300px;display:block" '
+							);
+
+						}
+						if (that.isLogin) {
+							that.getUserInfo();
+						}
+					})
+					.catch((err) => {
+						uni.hideLoading();
+						//状态异常返回上级页面
+						return that.$util.Tips({
+							title: err.toString(),
+						}, {
+							tab: 3,
+							url: 1,
+						});
+					});
+			},
+		},
+	};
+</script>
+
+<style scoped lang="scss">
+	button {
+		padding: 0;
+		margin: 0;
+		line-height: normal;
+		background-color: #fff;
+	}
+
+	button::after {
+		border: 0;
+	}
+
+	action-sheet-item {
+		padding: 0;
+		height: 240rpx;
+		align-items: center;
+		display: flex;
+	}
+
+
+
+	.action-sheet {
+		font-size: 17px;
+		line-height: 1.8;
+		width: 50%;
+		position: absolute;
+		top: 0;
+		right: 0;
+		padding: 25rpx 0;
+	}
+
+
+
+
+
+
+	.navbar .header {
+		height: 96rpx;
+		font-size: 30rpx;
+		color: #050505;
+		background-color: #fff;
+		/* #ifdef APP-PLUS */
+		width: 100%;
+		/* #endif */
+	}
+
+	.home {
+		/* #ifdef H5 */
+		top: 20rpx !important;
+		/* #endif */
+	}
+
+	.navbar .header .item {
+		position: relative;
+		margin: 0 25rpx;
+	}
+
+	.navbar .header .item.on:before {
+		position: absolute;
+		width: 60rpx;
+		height: 5rpx;
+		background-repeat: no-repeat;
+		content: '';
+		// background-image: linear-gradient(to right, #ff3366 0%, #ff6533 100%);
+		background-color: var(--view-theme);
+		bottom: -10rpx;
+		left: 50%;
+		margin-left: -28rpx;
+	}
+
+	.navbar {
+		position: fixed;
+		background-color: #fff;
+		top: 0;
+		left: 0;
+		z-index: 99;
+		width: 100%;
+	}
+
+	.navbar .navbarH {
+		position: relative;
+	}
+
+	.navbar .navbarH .navbarCon {
+		position: absolute;
+		bottom: 0;
+		height: 100rpx;
+		width: 100%;
+		/* #ifndef APP-PLUS || H5 || MP-ALIPAY */
+		// justify-content: flex-end;
+		padding-left: 48px;
+		/* #endif */
+	}
+
+	.home {
+		color: #333;
+		position: fixed;
+		/* #ifdef MP */
+		width: 126rpx;
+		left: 15rpx;
+		/* #endif */
+		/* #ifndef MP */
+		width: 56rpx;
+		left: 33rpx;
+		/* #endif */
+		height: 56rpx;
+		z-index: 99;
+		background: rgba(255, 255, 255, 0.3);
+		border: 1px solid rgba(0, 0, 0, 0.1);
+		border-radius: 40rpx;
+		font-size: 33rpx;
+
+		&.right {
+			right: 33rpx;
+			left: unset
+		}
+
+		&.on {
+			background: unset;
+			color: #333;
+		}
+
+		&.homeIndex {
+			/* #ifdef MP */
+			width: 98rpx;
+			/* #endif */
+			/* #ifndef MP */
+			border-color: rgba(255, 255, 255, 0);
+			/* #endif */
+		}
+	}
+
+	.home .iconfont {
+		width: 58rpx;
+		text-align: center;
+	}
+
+	.home .line {
+		width: 1rpx;
+		height: 34rpx;
+		background: #B3B3B3;
+	}
+
+
+
+	.product-con .conter {
+		display: block;
+	}
+
+	.product-con .conter img {
+		display: block;
+	}
+
+	.product-con {
+		.wrapper {
+			padding-top: 1rpx;
+		}
+	}
+
+	.product-con .wrapper .share .money image {
+		width: 66rpx;
+		height: 26rpx;
+	}
+
+	.introduce {
+		min-height: 44rpx;
+	}
+
+	.limit_good {
+		font-size: 16rpx;
+		margin: 10rpx 30rpx;
+		color: red;
+	}
+
+	.flex {
+		display: flex;
+		justify-content: space-between;
+		width: 100%;
+	}
+
+	.introduce {
+		min-height: 44rpx;
+	}
+
+	.product-con .footer {
+		padding: 0 20rpx 0 30rpx;
+		position: fixed;
+		bottom: 0;
+		width: 100%;
+		box-sizing: border-box;
+		background-color: rgba(255, 255, 255, 0.85);
+		backdrop-filter: blur(10px);
+		z-index: 277;
+		border-top: 1rpx solid #f0f0f0;
+		height: 100rpx;
+		height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
+		height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
+		transform: translate3d(0, 100%, 0);
+		transition: all .3s cubic-bezier(.25, .5, .5, .9);
+	}
+
+	.product-con {
+		.footer {
+			.item {
+				font-size: 18rpx;
+				color: #666;
+
+				.iconfont {
+					text-align: center;
+					font-size: 40rpx;
+
+					&.icon-shoucang1 {
+						color: var(--view-theme);
+					}
+
+					&.icon-gouwuche1 {
+						font-size: 40rpx;
+						position: relative;
+
+						.num {
+							color: #fff;
+							position: absolute;
+							font-size: 18rpx;
+							padding: 2rpx 10rpx 3rpx;
+							border-radius: 200rpx;
+							top: -10rpx;
+							right: -10rpx;
+						}
+					}
+				}
+			}
+
+			.bnt {
+				margin-left: 30rpx;
+				width: 444rpx;
+				height: 76rpx;
+				flex-grow: 1;
+
+				.bnts {
+					text-align: center;
+					line-height: 76rpx;
+					color: #fff;
+					font-size: 28rpx;
+					width: 100%;
+				}
+
+				.buy {
+					border-radius: 50rpx;
+					background-color: var(--view-theme);
+					background-image: linear-gradient(to right, #fa6514 0%, #e93323 100%);
+				}
+
+				.virbnt {
+					height: 76rpx !important;
+					border-radius: 50rpx !important;
+					overflow: hidden;
+				}
+			}
+		}
+	}
+</style>

+ 339 - 0
pages/rent/carpay/paySuccess.vue

@@ -0,0 +1,339 @@
+<template>
+	<view :style="colorStyle">
+		<view class='payment-status' v-if="order_pay_info.paid && loading">
+			<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
+			<view class='iconfont icons icon-duihao2 bg-color'
+				v-if="order_pay_info.paid || order_pay_info.pay_type == 'offline'"></view>
+			<view class='iconfont icons icon-iconfontguanbi' v-else></view>
+			<!-- 失败时:订单支付失败 -->
+			<view class='status' v-if="order_pay_info.pay_type != 'offline'">
+				{{order_pay_info.paid ? $t(`订单支付成功`):$t(payType ? `订单支付中`:`订单支付失败`)}}
+			</view>
+			<view class='status' v-else>{{$t(`订单创建成功`)}}</view>
+			<view class='wrapper'>
+				<view class='item acea-row row-between-wrapper'>
+					<view>{{$t(`订单号`)}}</view>
+					<view class='itemCom'>{{orderId}}</view>
+				</view>
+				<view class='item acea-row row-between-wrapper'>
+					<view>{{$t(`下单时间`)}}</view>
+					<view class='itemCom'>{{order_pay_info.add_time}}</view>
+				</view>
+				<view class='item acea-row row-between-wrapper'>
+					<view>{{$t(`支付方式`)}}</view>
+					<view class='itemCom'>{{$t(order_pay_info._payType) || $t(`暂未支付`)}}</view>
+				</view>
+				<view class='item acea-row row-between-wrapper'>
+					<view>{{$t(`支付金额`)}}</view>
+					<view class='itemCom'>{{order_pay_info.pay_price}}</view>
+				</view>
+				<!--失败时加上这个  -->
+				<view class='item acea-row row-between-wrapper'
+					v-if="order_pay_info.paid==0 && order_pay_info.pay_type != 'offline'">
+					<view>{{$t(`失败原因`)}}</view>
+					<view class='itemCom'>{{status==2 ? $t(`取消支付`):msg}}</view>
+				</view>
+			</view>
+			<!--失败时: 重新购买 -->
+			<view @tap="goOrderDetails" v-if="status==0">
+				<button formType="submit" class='returnBnt bg-color' hover-class='none'>{{$t(`查看订单`)}}</button>
+			</view>
+			<view @tap="getOrderPayInfo" v-if="payType == 'ALLINPAY_PAY'">
+				<button class='returnBnt bg-color' hover-class='none'>{{$t(`刷新支付状态`)}}</button>
+			</view>
+			<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
+				<button class='returnBnt bg-color' hover-class='none'>{{$t(`重新购买`)}}</button>
+			</view>
+			<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2">
+				<button class='returnBnt bg-color' hover-class='none'>{{$t(`重新支付`)}}</button>
+			</view>
+			<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none'
+				v-else>{{$t(`返回首页`)}}</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		getOrderStatus,
+	} from '@/api/rent.js';
+	import {
+		openOrderSubscribe
+	} from '@/utils/SubscribeMessage.js';
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		mapGetters
+	} from "vuex";
+	// #ifdef MP
+	import authorize from '@/components/Authorize';
+	// #endif
+	import colors from "@/mixins/color";
+	export default {
+		components: {
+			// #ifdef MP
+			authorize
+			// #endif
+		},
+		mixins: [colors],
+		data() {
+			return {
+				loading: false,
+				orderId: '',
+				order_pay_info: {
+					paid: 1,
+					_status: {}
+				},
+				status: 0,
+				msg: '',
+				payType: ''
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getOrderPayInfo();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad: function(options) {
+			if (!options.order_id) return this.$util.Tips({
+				title: this.$t(`缺少参数无法查看订单支付状态`)
+			}, {
+				tab: 3,
+				url: 1
+			});
+			this.orderId = options.order_id;
+			this.status = options.status || 0;
+			this.msg = options.msg || '';
+			this.payType = options.payType || '';
+
+			// // #ifdef H5
+			// document.addEventListener('visibilitychange', (e) => {
+			// 	let state = document.visibilityState
+			// 	if (state == 'hidden') {
+			// 		console.log('用户离开了');
+			// 	}
+			// 	if (state == 'visible') {
+			// 		this.getOrderPayInfo();
+			// 	}
+			// });
+			// // #endif
+		},
+		onShow() {
+			if (this.isLogin) {
+				this.getOrderPayInfo();
+			} else {
+				toLogin();
+			}
+		},
+		methods: {
+			onLoadFun: function() {
+				this.getOrderPayInfo();
+			},
+			/**
+			 * 
+			 * 支付完成查询支付状态
+			 * 
+			 */
+			getOrderPayInfo: function() {
+				let that = this;
+				uni.showLoading({
+					title: that.$t(`正在加载中`)
+				});
+				getOrderStatus(that.orderId).then(res => {
+					
+					uni.hideLoading();
+					that.$set(that, 'order_pay_info', res.data);
+					uni.setNavigationBarTitle({
+						title: res.data.paid ? that.$t(`支付成功`) : that.$t(`未支付`)
+					});
+					this.loading = true
+				}).catch(err => {
+					this.loading = true
+					uni.hideLoading();
+				});
+			},
+			/**
+			 * 去首页关闭当前所有页面
+			 */
+			goIndex: function(e) {
+				uni.switchTab({
+					url: '/pages/index/index'
+				});
+			},
+			/**
+			 * 
+			 * 去订单详情页面
+			 */
+			goOrderDetails: function(e) {
+				let that = this;
+				// #ifdef MP
+				uni.showLoading({
+					title: that.$t(`正在加载中`),
+				})
+				openOrderSubscribe().then(res => {
+					uni.hideLoading();
+					uni.redirectTo({
+						url: '/pages/rent/order/orderDetail?id=' + that.order_pay_info.rent.order_id
+					});
+				}).catch(() => {
+					nui.hideLoading();
+				});
+				// #endif
+				// #ifndef MP
+				uni.redirectTo({
+					url: '/pages/rent/order/orderDetail?id=' + that.order_pay_info.rent.order_id
+				})
+				// #endif
+			}
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	.coupons {
+		.title {
+			margin: 30rpx 0 25rpx 0;
+
+			.line {
+				width: 70rpx;
+				height: 1px;
+				background: #DCDCDC;
+			}
+
+			.name {
+				font-size: 24rpx;
+				color: #999;
+				margin: 0 10rpx;
+			}
+		}
+
+		.list {
+			padding: 0 20rpx;
+
+			.item {
+				margin-bottom: 20rpx;
+				box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
+
+				.price {
+					width: 236rpx;
+					height: 160rpx;
+					font-size: 26rpx;
+					color: #fff;
+					font-weight: 800;
+
+					text {
+						font-size: 54rpx;
+					}
+				}
+
+				.text {
+					width: 385rpx;
+
+					.name {
+						font-size: #282828;
+						font-size: 30rpx;
+					}
+
+					.priceMin {
+						font-size: 24rpx;
+						color: #999;
+						margin-top: 10rpx;
+					}
+
+					.time {
+						font-size: 24rpx;
+						color: #999;
+						margin-top: 15rpx;
+					}
+				}
+			}
+
+			.open {
+				font-size: 24rpx;
+				color: #999;
+				margin-top: 30rpx;
+
+				.iconfont {
+					font-size: 25rpx;
+					margin: 5rpx 0 0 10rpx;
+				}
+			}
+		}
+	}
+
+	.payment-status {
+		background-color: #fff;
+		margin: 195rpx 30rpx 0 30rpx;
+		border-radius: 10rpx;
+		padding: 1rpx 0 28rpx 0;
+	}
+
+	.payment-status .icons {
+		font-size: 70rpx;
+		width: 140rpx;
+		height: 140rpx;
+		border-radius: 50%;
+		color: #fff;
+		text-align: center;
+		line-height: 140rpx;
+		text-shadow: 0px 4px 0px rgba(255, 255, 255, 0.5);
+		border: 6rpx solid #f5f5f5;
+		margin: -76rpx auto 0 auto;
+		background-color: #999;
+	}
+
+	.payment-status .icons.icon-iconfontguanbi {
+		text-shadow: 0px 4px 0px #6c6d6d;
+	}
+
+	.payment-status .iconfont.fail {
+		text-shadow: 0px 4px 0px #7a7a7a;
+	}
+
+	.payment-status .status {
+		font-size: 32rpx;
+		font-weight: bold;
+		text-align: center;
+		margin: 25rpx 0 37rpx 0;
+	}
+
+	.payment-status .wrapper {
+		border: 1rpx solid #eee;
+		margin: 0 30rpx 47rpx 30rpx;
+		padding: 35rpx 0;
+		border-left: 0;
+		border-right: 0;
+	}
+
+	.payment-status .wrapper .item {
+		font-size: 28rpx;
+		color: #282828;
+	}
+
+	.payment-status .wrapper .item~.item {
+		margin-top: 20rpx;
+	}
+
+	.payment-status .wrapper .item .itemCom {
+		color: #666;
+	}
+
+	.payment-status .returnBnt {
+		width: 630rpx;
+		height: 86rpx;
+		border-radius: 50rpx;
+		color: #fff;
+		font-size: 30rpx;
+		text-align: center;
+		line-height: 86rpx;
+		margin: 0 auto 20rpx auto;
+	}
+</style>

+ 208 - 0
pages/rent/components/invoiceModal/index.vue

@@ -0,0 +1,208 @@
+<template>
+	<view class="aleart" v-if="aleartStatus" :style="colorStyle">
+		<view class="icon-top">
+			<text class="iconfont icon-fapiao2"
+				:style="invoiceData.is_invoice?'background-color: var(--view-theme)':'background-color: #999'"></text>
+			<view class="bill">
+				{{invoiceData.is_invoice?$t(`已开票`): $t(`未开票`)}}
+			</view>
+		</view>
+
+		<view class="aleart-body">
+			<view class="body-head">{{$t(`发票信息`)}}</view>
+			<view class="label">
+				<view class="">
+					{{$t(`发票抬头`)}}
+				</view>
+				<view class="label-value">
+					{{invoiceData.name}}
+				</view>
+			</view>
+			<view class="label">
+				<view class="">
+					{{$t(`发票抬头类型`)}}
+				</view>
+				<view class="label-value">
+					{{invoiceData.header_type == 1?$t(`个人`):$t(`企业`)}}
+				</view>
+			</view>
+			<view class="label">
+				<view class="">
+					{{$t(`发票类型`)}}
+				</view>
+				<view class="label-value">
+					{{invoiceData.type==1?$t(`电子普通发票`):$t(`电子专用发票`)}}
+				</view>
+			</view>
+			<view class="label" v-if="invoiceData.duty_number">
+				<view class="">
+					{{$t(`企业税号`)}}
+				</view>
+				<view class="label-value">
+					{{invoiceData.duty_number}}
+				</view>
+			</view>
+
+			<view class="body-head">{{$t(`联系信息`)}}</view>
+			<view class="label">
+				<view class="">
+					{{$t(`真实姓名`)}}
+				</view>
+				<view class="label-value">
+					{{invoiceData.name}}
+				</view>
+			</view>
+			<view class="label">
+				<view class="">
+					{{$t(`联系电话`)}}
+				</view>
+				<view class="label-value">
+					{{invoiceData.drawer_phone}}
+				</view>
+			</view>
+			<view class="label">
+				<view class="">
+					{{$t(`联系邮箱`)}}
+				</view>
+				<view class="label-value">
+					{{invoiceData.email}}
+				</view>
+			</view>
+		</view>
+		<view class="btn" @click="close">
+{{$t(`确认`)}}
+		</view>
+	</view>
+</template>
+
+<script>
+	import colors from '@/mixins/color.js';
+	export default ({
+		data() {
+			return {
+
+			}
+		},
+		mixins: [colors],
+		props: {
+			aleartStatus: {
+				type: Boolean,
+				default: false
+			},
+			invoiceData: {
+				type: Object,
+				default: () => {}
+			}
+		},
+		methods: {
+			close() {
+				this.$emit('close')
+			},
+		}
+	})
+</script>
+
+<style lang="scss" scoped>
+	.aleart {
+		width: 80%;
+		// height: 714rpx;
+		position: fixed;
+		left: 50%;
+		transform: translateX(-50%);
+		z-index: 9999;
+		top: 45%;
+		margin-top: -357rpx;
+		background-color: #fff;
+		padding: 30rpx;
+		border-radius: 12rpx;
+		background-image: -webkit-gradient(linear, //表示渐变的为直线 另外一个值是radial
+				50% 0, //直线型渐变的起点位置 后边有一个属性background-size规定背景的大小,30 X 15px  50% 0 都是乘以父元素的宽高。 
+				0 100%, //结束点的位置 和上类似
+				from(transparent), //起点的颜色
+				color-stop(.5, transparent), //中间某一个点必须达到这个颜色,表示变化过程  .5b表示这个渐变范围长度的总长的50%
+				color-stop(.5, #999999), //同上
+				to(#999999)), //结束段的颜色
+			//一个背景块的分为两个15X 15  组成。
+
+			-webkit-gradient(linear, 50% 0, 100% 100%, from(transparent),
+				color-stop(.5, transparent),
+				color-stop(.5, #999999),
+				to(#999999));
+		background-size: 20rpx 10rpx;
+		background-repeat: repeat-x;
+		background-position: 0 100%;
+
+		.icon-top {
+			margin-left: calc(50% - 40rpx);
+			margin-top: -40rpx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			border-radius: 50%;
+			width: 100rpx;
+			height: 100rpx;
+
+			.icon-fapiao2 {
+				text-align: center;
+				border-radius: 50%;
+				font-size: 80rpx;
+				color: #fff;
+				background-color: var(--view-theme);
+				padding: 20rpx;
+				border: 4rpx solid #fff;
+				margin-top: -40rpx;
+			}
+			.bill {
+				width: 172rpx;
+				text-align: center;
+			}
+		}
+
+		.title {
+			font-size: 34rpx;
+			color: var(--view-theme);
+			font-weight: bold;
+			text-align: center;
+			padding-bottom: 10rpx;
+			border-bottom: 1px solid var(--view-op-ten);
+		}
+
+		.aleart-body {
+			display: flex;
+			justify-content: center;
+			flex-direction: column;
+			padding: 60rpx 0;
+
+			.body-head {
+				font-size: 30rpx;
+				font-weight: bold;
+				padding-bottom: 10rpx;
+				border-bottom: 1px solid #EEEEEE;
+				margin: 10rpx 0;
+			}
+
+			.label {
+				width: 100%;
+				display: flex;
+				justify-content: space-between;
+				margin-bottom: 15rpx;
+				color: #333333;
+				font-size: 28rpx;
+
+				.label-value {
+					color: #666666;
+				}
+			}
+		}
+
+		.btn {
+			width: 100%;
+			padding: 15rpx 0;
+			color: #fff;
+			background: var(--view-theme);
+			border-radius: 20px;
+			text-align: center;
+			margin-bottom: 30rpx;
+		}
+	}
+</style>

File diff suppressed because it is too large
+ 173 - 0
pages/rent/components/invoicePicker/index.vue


+ 215 - 0
pages/rent/control/auth.vue

@@ -0,0 +1,215 @@
+<template>
+	<view>
+		<form @submit="formSubmit">
+			<view class='personal-data' :style="colorStyle">
+				<view class='list'>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`手机号`)}}</view>
+						<view class='input'>
+							<input type='nickname' placeholder="请输入手机号" name='nickname' :maxlength="16" v-model='phone'></input>
+						</view>
+					</view>
+					<picker mode="selector" range-key='text' :range="timeList" @change="changeTime">
+						<view class='item acea-row row-between-wrapper'>
+							<view>{{$t(`授权时长`)}}</view>
+							<view class='input'>
+								{{time||'请选择时间'}}
+							</view>
+						</view>
+					</picker>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`备注`)}}</view>
+						<view class='input'><input placeholder="备注信息填写" type='nickname' name='nickname' :maxlength="16"
+								v-model='mask'></input>
+						</view>
+					</view>
+
+				</view>
+				<button class='modifyBnt bg-color' formType="submit">{{$t(`保存修改`)}}</button>
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		postCarAuth,
+	} from '@/api/rent.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import colors from '@/mixins/color.js';
+	export default {
+		mixins: [colors],
+		data() {
+			return {
+				id: '',
+				phone: '',
+				indexTime: '',
+				mask:'',
+				time:'',
+				timeList: [{
+						type: 0,
+						text: '长期'
+					},
+					{
+						type: 1,
+						text: '1天'
+					},
+					{
+						type: 3,
+						text: '3天'
+					},
+					{
+						type: 7,
+						text: '7天'
+					},
+					{
+						type: 30,
+						text: '30天'
+					}
+				],
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		onLoad(options) {
+			this.id = options.id
+			if (!this.isLogin) {
+				toLogin();
+			}
+		},
+		methods: {
+			// 切换
+			changeTime(e) {
+				this.time = this.timeList[e.detail.value].text
+				this.indexTime = e.detail.value;
+			},
+			// 提交
+			formSubmit(e) {
+				let obj = this;
+				if (!obj.phone) {
+					uni.showToast({
+						title: '请输入授权用户手机号',
+						icon: 'none'
+					})
+					return
+				}
+				if (obj.time == '授权时长') {
+					uni.showToast({
+						title: '请选择授权时长',
+						icon: 'none'
+					})
+					return
+				}
+				uni.showLoading({
+					title: '授权申请中',
+					mask: true
+				});
+				postCarAuth({
+						 phone: obj.phone,
+						car_id: obj.id,
+						day: obj.indexTime,
+						nickname: obj.mask
+					})
+					.then(({
+						data
+					}) => {
+						uni.hideLoading()
+						uni.showToast({
+							title: '授权成功',
+							icon: 'success'
+						})
+						setTimeout(function() {
+							uni.redirectTo({
+								url:'./authList?id='+obj.id,
+								fail(e){
+									console.log(e)
+								}
+							});
+						}, 1000);
+					})
+					.catch(err => {
+						uni.hideLoading()
+						uni.showToast({
+							title: err,
+							icon:"error"
+						});
+					});
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.personal-data .list {
+		/* #ifndef H5 */
+		margin-top: 15rpx;
+		/* #endif */
+		background-color: #fff;
+
+		.item {
+			padding: 30rpx 30rpx 30rpx 0;
+			border-bottom: 1rpx solid #f2f2f2;
+			margin-left: 30rpx;
+			font-size: 28rpx;
+			color: #282828;
+
+			.input {
+				flex-grow: 1;
+				text-align: right;
+				color: #868686;
+				font-size: $uni-font-size-lg;
+				.icon-suozi {
+					margin-left: 10rpx;
+				}
+
+				.id {
+					// width: 180rpx;
+				}
+
+				.iconfont {
+					font-size: 24rpx;
+				}
+			}
+		}
+	}
+
+	.modifyBnt {
+		font-size: 32rpx;
+		color: #fff;
+		width: 690rpx;
+		height: 90rpx;
+		border-radius: 50rpx;
+		text-align: center;
+		line-height: 90rpx;
+		margin: 76rpx auto 0 auto;
+	}
+
+	.monthslist {
+		background-color: #FFF;
+		border-radius: 10rpx;
+		margin: 20rpx 20rpx 0rpx 20rpx;
+		padding: 20rpx;
+
+		.time,
+		.peytype {
+			font-size: 24rpx;
+			color: #999;
+		}
+
+		.info {
+			color: var(--view-theme);
+		}
+
+		.right {
+			text-align: right;
+
+			.money {
+				color: var(--view-theme);
+			}
+		}
+	}
+</style>

+ 312 - 0
pages/rent/control/authList.vue

@@ -0,0 +1,312 @@
+<template>
+	<view class="listbox" :style="colorStyle">
+		<view class="item" v-for="(item,ind) in list">
+			<view class="acea-row">
+				<image class="img" src="../static/cart.png" mode="scaleToFill"></image>
+				<view class="title line2">
+					{{item.car.machine_name}}
+				</view>
+			</view>
+			<view class="machine ">
+				<view class="acea-row row-between">
+					<view class="it">
+						当前位置:{{item.car.address?item.car.address:'未定位'}}
+					</view>
+					<view class="status">
+						电量:{{item.car.residue}}%
+					</view>
+				</view>
+			</view>
+			<view class="machine acea-row row-between-wrapper">
+				<view class="acea-row row-left">
+					<view class="it">
+						编号:
+					</view>
+					<view class="code">
+						{{item.car.machine_no}}
+
+					</view>
+				</view>
+				<view class="acea-row row-rightss" v-if="item.plate_number">
+					<view class="it">
+						车牌号:
+					</view>
+					<view class="code">
+						{{item.car.plate_number}}
+					</view>
+				</view>
+			</view>
+			<view class="machine acea-row row-between-wrapper" v-if="item.touser">
+				<view class="acea-row row-left">
+					<view class="it">
+						姓名:
+					</view>
+					<view>
+						{{item.touser.nickname}}
+					</view>
+				</view>
+				<view class="acea-row row-left">
+					<view class="it">
+						电话:
+					</view>
+					<view>
+						{{item.touser.phone}}
+					</view>
+				</view>
+				<view class="acea-row row-left">
+					<view class="it">
+						备注:
+					</view>
+					<view>
+						{{item.nickname}}
+					</view>
+				</view>
+			</view>
+			<view class="machine acea-row row-between-wrapper">
+				<view class="acea-row row-right shrink-no">
+					<view class="it">
+						到期:
+					</view>
+					<view>
+						{{item.end_time}}
+					</view>
+				</view>
+				<view @click="outAuth(item.id,ind)" class="acea-row row-right shrink-no">
+					<view class="btn">
+						撤销授权
+					</view>
+				</view>
+			</view>
+			<view v-if="item.car.status==0" class="text_red tip ">
+				关锁
+			</view>
+			<view v-if="item.car.status==1" class="text_blue tip">
+				开锁
+			</view>
+			<view v-if="item.car.status==2" class="text_greed tip">
+				解锁
+			</view>
+		</view>
+		<view class="loadingicon acea-row row-center-wrapper font-color-white" v-if="list.length > 0">
+			<text class="loading iconfont icon-jiazai font-color-white" :hidden="loading == false"></text>
+			{{ loadTitle }}
+		</view>
+		<view v-if="list.length == 0">
+			<emptyPage v-if="!loading" :title="$t(`暂无授权`)"></emptyPage>
+			<view class="loadingicon acea-row row-center-wrapper">
+				<text class="loading iconfont icon-jiazai font-color-white" :hidden="loading == false"></text>
+			</view>
+		</view>
+		<navigator :url="`./auth?id=`+id">
+			<button class='modifyBnt acea-row row-middle row-center'>
+				<text>
+			{{$t(`新增授权`)}}
+				</text>
+			</button>
+		</navigator>
+	</view>
+</template>
+
+<script>
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		getOneinfo,
+		deleteCarAuth
+	} from '@/api/rent.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import colors from '@/mixins/color.js';
+	import emptyPage from '@/components/emptyPage.vue';
+	export default {
+		mixins: [colors],
+		components: {
+			emptyPage,
+		},
+		data() {
+			return {
+				loading: false, //是否加载中
+				loadend: false, //是否加载完毕
+				loadTitle: this.$t(`加载更多`), //提示语
+				list: [],
+				page: 1,
+				limit: 20,
+				id: '',
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getList();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			if (this.isLogin) {
+				this.getList();
+			} else {
+				toLogin();
+			}
+		},
+		methods: {
+			// 撤销授权
+			outAuth(id,ind) {
+				const that = this;
+				uni.showLoading({
+					title: '申请撤销授权中',
+					mask: true
+				});
+				deleteCarAuth({
+					id
+				}).then((res) => {
+					uni.hideLoading()
+					uni.showToast({
+						title: '撤销授权成功'
+					});
+					that.list.splice(ind,1)
+				}).catch((res) => {
+					uni.hideLoading()
+				})
+			},
+			// 授权列表
+			getList: function() {
+				let that = this;
+				if (that.loadend) return;
+				if (that.loading) return;
+				that.loading = true;
+				that.loadTitle = that.$t(`加载更多`);
+				getOneinfo({
+						id: that.id,
+						type: 'auth',
+						page: that.page,
+						limit: that.limit
+					})
+					.then(res => {
+						let list = res.data.list || [];
+						let loadend = list.length < that.limit;
+						that.list = that.$util.SplitArray(list, that.list);
+						that.$set(that, 'list', that.list);
+						that.loadend = loadend;
+						that.loading = false;
+						that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
+						that.page = that.page + 1;
+						console.log(that.list);
+					})
+					.catch(err => {
+						that.loading = false;
+						that.loadTitle = that.$t(`加载更多`);
+					});
+			},
+		},
+		onReachBottom: function() {
+
+			this.getList();
+		},
+		// 滚动监听
+		onPageScroll(e) {
+			// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
+			uni.$emit('scroll');
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	.item {
+		position: relative;
+		background-color: var(--view-theme-16);
+		padding: 30rpx;
+		border-radius: 10rpx;
+		margin-bottom: 20rpx;
+		overflow: hidden;
+
+		.title {
+			font-weight: bold;
+			font-size: $uni-font-size-lg;
+			color: #fff;
+			padding-left: 10rpx;
+		}
+
+		.machine {
+			font-size: $uni-font-size-sm;
+			color: #999999;
+			margin-top: 20rpx;
+
+			.code {
+				color: var(--view-priceColor);
+				background-color: rgba(#75EFFA, 0.2);
+				padding: 5rpx 10rpx;
+				border-radius: 10rpx;
+			}
+
+			.shrink-no {
+				flex-shrink: 0;
+			}
+
+			.btn {
+				color: #FFF;
+				background-color: $uni-color-primary;
+				line-height: 1;
+				padding: 10rpx 20rpx;
+				border-radius: 10rpx;
+
+			}
+		}
+
+		.img {
+			width: 40rpx;
+			height: 40rpx;
+		}
+
+		.tip {
+			position: absolute;
+			top: 0;
+			right: 0;
+			padding: 5rpx 20rpx;
+			font-size: 20rpx;
+			border-bottom-left-radius: 10rpx;
+
+			&.text_greed {
+				color: #49D8A8;
+				background-color: rgba(#49D8A8, 0.2);
+			}
+
+			&.text_red {
+				color: rgba(254, 92, 45, 1);
+				background-color: rgba(rgba(254, 92, 45, 1), 0.2);
+			}
+
+			&.text_blue {
+				color: #1db0fc;
+				background-color: rgba(#1db0fc, 0.2);
+			}
+		}
+	}
+
+	.listbox {
+		padding: 30rpx;
+		min-height: 100vh;
+		background-color: var(--view-theme);
+		padding-bottom: 150rpx;
+	}
+
+	.modifyBnt {
+		position: fixed;
+		bottom: 30rpx;
+		left: 30rpx;
+		border: 2px solid #FFF;
+		font-size: 32rpx;
+		color: #fff;
+		width: 690rpx;
+		height: 90rpx;
+		border-radius: 50rpx;
+		text-align: center;
+		background-color: var(--view-bntColor);
+	}
+</style>

+ 234 - 0
pages/rent/control/route.vue

@@ -0,0 +1,234 @@
+<template>
+	<view class="content" :style="colorStyle">
+		<!-- 订单列表 -->
+		<view v-for="(item,index) in list" @click="navTo('./routeDetail?id='+item.id)">
+			<!-- <view class="timeDay">
+							{{items.time}}
+						</view> -->
+			<view class="routeItemBox">
+				<view class="cartName acea-row row-between-wrapper">
+					<view class="acea-row row-between-wrapper">
+						<image class="cartImg" src="../static/cart.png" mode="scaleToFill">
+						</image>
+						<text class="carNameTitle">
+							{{item.car.machine_name}}
+						</text>
+					</view>
+					<view class="iconfont  icon-xiangyou"></view>
+				</view>
+				<view class="routeItem acea-row row-between-wrapper">
+					<!-- <view class="leftTime">
+						<view>
+							{{item.machine_no}}
+						</view>
+					</view> -->
+					<view class="rightRoute acea-row row-between-wrapper">
+						<view class="leftImg">
+							<image src="../static/routeContent.png" mode="widthFix"></image>
+						</view>
+						<view class="rightConent">
+							<view class="statusTitle">
+								起点:{{item.add_time}}
+							</view>
+							<view class="routeName line2">
+								{{item.start_address}}
+							</view>
+							<view class="contentJg">
+
+							</view>
+							<view class="statusTitle">
+								终点:{{item.end_time}}
+							</view>
+							<view class="routeName line2 end">
+								{{item.last_address}}
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="loadingicon acea-row row-center-wrapper font-color-white" v-if="list.length > 0">
+			<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
+			{{ loadTitle }}
+		</view>
+		<view v-if="list.length == 0">
+			<emptyPage v-if="!loading" :title="$t(`暂无行程记录`)"></emptyPage>
+			<view class="loadingicon acea-row row-center-wrapper">
+				<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		getOneinfo
+	} from '@/api/rent.js';
+	import colors from '@/mixins/color.js';
+	import emptyPage from '@/components/emptyPage.vue';
+	export default {
+		data() {
+			return {
+				id: '', //保存车辆car_number
+				loading: false, //是否加载中
+				loadend: false, //是否加载完毕
+				loadTitle: this.$t(`加载更多`), //提示语
+				list: [], //订单数组
+				page: 1,
+				limit: 10
+			};
+		},
+		components: {
+			emptyPage
+		},
+		mixins: [colors],
+		onLoad(options) {
+			this.id = options.id || ''
+			this.loadData();
+		},
+		methods: {
+			navTo(url) {
+				uni.navigateTo({
+					url: url
+				})
+			},
+			// 转换金额为数字
+			// 确认收货
+			//获取订单列表
+			loadData() {
+				let that = this;
+				if (that.loadend) return;
+				if (that.loading) return;
+				that.loading = true;
+				that.loadTitle = that.$t(`加载更多`);
+				getOneinfo({
+						type: "record",
+						page: that.page,
+						limit: that.limit,
+						id: that.id
+					})
+					.then(res => {
+						let list = res.data.list || [];
+						let loadend = list.length < that.limit;
+						that.list = that.$util.SplitArray(list, that.list);
+						that.$set(that, 'list', that.list);
+						that.loadend = loadend;
+						that.loading = false;
+						that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
+						that.page = that.page + 1;
+					})
+					.catch(err => {
+						that.loading = false;
+						that.loadTitle = that.$t(`加载更多`);
+					});
+			},
+		}
+	};
+</script>
+
+<style lang="scss">
+	.content {
+		background: var(--view-theme);
+		height: 100vh;
+		padding-top: 30rpx;
+	}
+
+	.list-scroll-content,
+	.swiper-box {
+		height: 100%;
+	}
+
+	.timeDay {
+		font-size: 32rpx;
+		font-weight: 400;
+		padding: 30rpx;
+	}
+
+	.routeItemBox {
+		background-color: #FFFFFF;
+		border-radius: 20rpx;
+		margin: 0 30rpx;
+		margin-bottom: 30rpx;
+		line-height: 1.5;
+		.cartName {
+			font-size: 32rpx;
+			font-weight: 400;
+			padding: 20rpx 30rpx;
+			border-bottom: 1px solid $uni-border-color;
+			
+			.carNameTitle {
+				padding-left: 20rpx;
+			}
+
+			.cartImg {
+				width: 60rpx;
+				height: 60rpx;
+			}
+
+			.iconRight {
+				width: 26rpx;
+			}
+		}
+
+		.detailRoute {
+			color: var(--view-theme);
+			font-weight: 100;
+			margin: 0 30rpx;
+			background-color: #F3F6F8;
+			padding: 10rpx 30rpx;
+			border-radius: 20rpx;
+
+			image {
+				width: 36rpx;
+				font-size: 24rpx;
+			}
+		}
+
+		.routeItem {
+			align-items: flex-start;
+			padding: 30rpx;
+
+			.leftTime {
+				width: 70rpx;
+				margin: 50rpx;
+				flex-shrink: 0;
+				font-size: 24rpx;
+				font-weight: 100;
+			}
+
+			.rightRoute {
+				flex-grow: 1;
+				// height: 262rpx;
+				align-items: flex-start;
+
+				.leftImg {
+					image {
+						width: 36rpx;
+					}
+				}
+
+				.rightConent {
+					padding-left: 20rpx;
+					flex-grow: 1;
+
+					.statusTitle {
+						color: $uni-border-color;
+						font-size: 22rpx;
+					}
+
+					.routeName {
+						color: var(--view-theme);
+						font-size: 28rpx;
+						min-height: 2.5rem;
+						margin-bottom: 15rpx;
+
+						&.end {
+							min-height: 1.5rem;
+							margin-bottom: 0;
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 82 - 0
pages/rent/control/routeDetail.vue

@@ -0,0 +1,82 @@
+<template>
+	<map class="map" id="map" ref="map1" :polyline='carRouteList' :markers="markers"></map>
+</template>
+
+<script>
+	import {
+		getRouterDetail
+	} from '@/api/rent.js';
+	export default {
+		data() {
+			return {
+				// 路线图
+				carRouteList: [],
+				id: 0,
+				map: '',
+				markers: [],
+			};
+		},
+		onLoad: function(option) {
+			this.id = option.id
+		},
+		onReady() {
+			this.info()
+		},
+		methods: {
+			// 获取路径详细
+			info() {
+				getRouterDetail({
+					id: this.id,
+					type: 'record'
+				}).then((e) => {
+					let data = [{
+						points: [],
+						color: '#0BBB62',
+						width: 5,
+						arrowLine: true
+					}]
+					const startRouter = data[0];
+					
+					e.data.location.forEach((e) => {
+						const address = e.split(',');
+						startRouter.points.push({
+							longitude: +address[0],
+							latitude: +address[1]
+						})
+					})
+					this.carRouteList = data;
+					const item0 = startRouter.points[0];
+					const item1 = startRouter.points[startRouter.points.length - 1];
+					this.markers = [{
+						id: 1,
+						longitude: item0.longitude,
+						latitude: item0.latitude,
+						iconPath: '../static/stImg.png',
+						width: 30,
+						height: 30
+					}, {
+						id: 2,
+						longitude: item1.longitude,
+						latitude: item1.latitude,
+						iconPath: '../static/endImg.png',
+						width: 30,
+						height: 30
+					}]
+
+					this.map = uni.createMapContext("map", this);
+					this.map.includePoints({
+						padding: [100, 20, 300, 20],
+						points: startRouter.points
+					})
+				})
+			}
+		}
+	};
+</script>
+
+<style>
+	.map {
+		height: 100vh;
+		width: 750rpx;
+	}
+</style>

+ 209 - 0
pages/rent/mycar/index.vue

@@ -0,0 +1,209 @@
+<template>
+	<view class="listbox" :style="colorStyle">
+		<view class="item" v-for="(item,ind) in list">
+			<view class="acea-row">
+				<image class="img" src="../static/cart.png" mode="scaleToFill"></image>
+				<view class="title line2">
+					{{item.machine_name}}
+				</view>
+			</view>
+			<view class="machine ">
+				<view  class="acea-row row-between">
+					<view class="it">
+						当前位置:{{item.address?item.address:'未定位'}}
+					</view>
+					<view class="status">
+						电量:{{item.residue}}%
+					</view>
+				</view>
+			</view>
+			<view class="machine acea-row row-between-wrapper">
+
+				<view class="acea-row row-left">
+					<view class="it">
+						编号:
+					</view>
+					<view class="code">
+						{{item.machine_no}}
+
+					</view>
+				</view>
+				<view class="acea-row row-rightss" v-if="item.plate_number">
+					<view class="it">
+						车牌号:
+					</view>
+					<view class="code">
+						{{item.plate_number}}
+					</view>
+				</view>
+			</view>
+			<view v-if="item.status==0" class="text_red tip ">
+				关锁
+			</view>
+			<view v-if="item.status==1" class="text_blue tip">
+				开锁
+			</view>
+			<view v-if="item.status==2" class="text_greed tip">
+				解锁
+			</view>
+		</view>
+		<view class="loadingicon acea-row row-center-wrapper font-color-white" v-if="list.length > 0">
+			<text class="loading iconfont icon-jiazai " :hidden="loading == false"></text>
+			{{ loadTitle }}
+		</view>
+		<view v-if="list.length == 0">
+			<emptyPage v-if="!loading" :title="$t(`暂无车辆`)"></emptyPage>
+			<view class="loadingicon acea-row row-center-wrapper">
+				<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		getMyCar,
+	} from '@/api/rent.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import colors from '@/mixins/color.js';
+	import emptyPage from '@/components/emptyPage.vue';
+	export default {
+		mixins: [colors],
+		components: {
+			emptyPage,
+		},
+		data() {
+			return {
+				loading: false, //是否加载中
+				loadend: false, //是否加载完毕
+				loadTitle: this.$t(`加载更多`), //提示语
+				list: [],
+				page: 1,
+				limit: 20,
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getList();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			if (this.isLogin) {
+				this.getList();
+			} else {
+				toLogin();
+			}
+		},
+		methods: {
+			getList: function() {
+				let that = this;
+				if (that.loadend) return;
+				if (that.loading) return;
+				that.loading = true;
+				that.loadTitle = that.$t(`加载更多`);
+				getMyCar({
+						page: that.page,
+						limit: that.limit
+					})
+					.then(res => {
+						let list = res.data || [];
+						let loadend = list.length < that.limit;
+						that.list = that.$util.SplitArray(list, that.list);
+						that.$set(that, 'list', that.list);
+						that.loadend = loadend;
+						that.loading = false;
+						that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
+						that.page = that.page + 1;
+						console.log(that.list);
+					})
+					.catch(err => {
+						that.loading = false;
+						that.loadTitle = that.$t(`加载更多`);
+					});
+			},
+		},
+		onReachBottom: function() {
+			this.getList();
+		},
+		// 滚动监听
+		onPageScroll(e) {
+			// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
+			uni.$emit('scroll');
+		},
+	}
+</script>
+
+<style scoped lang="scss">
+	.item {
+		position: relative;
+		background-color: var(--view-theme-16);
+		padding: 30rpx;
+		border-radius: 10rpx;
+		margin-bottom: 20rpx;
+		overflow: hidden;
+		.title {
+			font-weight: bold;
+			font-size: $uni-font-size-lg;
+			color: #fff;
+			padding-left: 10rpx;
+		}
+
+		.machine {
+			font-size: $uni-font-size-sm;
+			color: #999999;
+			margin-top: 20rpx;
+			.code {
+				color: var(--view-priceColor);
+				background-color: rgba(#75EFFA, 0.2);
+				padding: 5rpx 10rpx;
+				border-radius: 10rpx;
+			}
+		}
+
+		.img {
+			width: 40rpx;
+			height: 40rpx;
+		}
+
+		.tip {
+			position: absolute;
+			top: 0;
+			right: 0;
+			padding: 5rpx 20rpx;
+			font-size: 20rpx;
+			border-bottom-left-radius: 10rpx;
+			&.text_greed {
+				color: #49D8A8;
+				background-color: rgba(#49D8A8, 0.2);
+			}
+			
+			&.text_red {
+				color: rgba(254, 92, 45, 1);
+				background-color: rgba(rgba(254, 92, 45, 1), 0.2);
+			}
+			
+			&.text_blue {
+				color: #1db0fc;
+				background-color: rgba(#1db0fc, 0.2);
+			}
+		}
+	}
+
+	.listbox {
+		padding: 30rpx;
+		min-height: 100vh;
+		background-color: var(--view-theme);
+	}
+</style>

+ 208 - 0
pages/rent/order/onBindCar.vue

@@ -0,0 +1,208 @@
+<template>
+	<view>
+		<form @submit="formSubmit">
+			<view class='personal-data' :style="colorStyle">
+				<view class='list'>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`创建时间`)}}</view>
+						<view class='input'>
+							{{carDateil.add_time}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`类型`)}}</view>
+						<view class='input' v-if="carDateil.car_lease==1">
+							以租代购
+						</view>
+						<view class='input' v-if="carDateil.car_lease==0">
+							月租
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper' v-if="carDateil.car_lease==1">
+						<view>{{$t(`总月份`)}}</view>
+						<view class='input'>
+							{{carDateil.several_months}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper' v-if="carDateil.car_lease==1">
+						<view>{{$t(`已付月份`)}}</view>
+						<view class='input'>
+							{{carDateil.months}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`月租`)}}</view>
+						<view class='input'>
+							{{carDateil.pay_price}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`绑定人`)}}</view>
+						<view class='input'>
+							{{carDateil.real_name}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>绑定车辆编号</view>
+						<view class='input acea-row row-between-wrapper'>
+							<input type='text' placeholder="请输入车辆编号" v-model='carDateil.machine_no' class='id'></input>
+							<!-- #ifndef H5 -->
+							<text @click="openQr" class='iconfont icon-saoma'></text>
+							<!-- #endif -->
+						</view>
+					</view>
+				</view>
+
+				<button class='modifyBnt bg-color' formType="submit">{{$t(`保存修改`)}}</button>
+			</view>
+		</form>
+	</view>
+</template>
+
+<script>
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		getRentOrderDteail,
+		rentSetcar
+	} from '@/api/rent.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import colors from '@/mixins/color.js';
+	export default {
+		mixins: [colors],
+		data() {
+			return {
+				id: '',
+				carDateil: {
+					machine_no: '',
+				}
+
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getRentOrderDteail();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			if (this.isLogin) {
+				this.getRentOrderDteail();
+			} else {
+				toLogin();
+			}
+		},
+		methods: {
+			// #ifndef APP-PLUS
+			// 打开二维码
+			openQr() {
+				const that = this;
+				uni.scanCode({
+					onlyFromCamera: true,
+					scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
+					success(res) {
+						that.carDateil.machine_no = res.result;
+					}
+				})
+			},
+			// #endif
+			// 提交绑定
+			formSubmit() {
+				uni.showLoading({
+					title: '提交中',
+					mask: true
+				});
+				rentSetcar({
+					id: this.carDateil.id,
+					machine_no: this.carDateil.machine_no
+				}).then((res) => {
+					uni.hideLoading()
+					uni.showToast({
+						title: '绑定成功'
+					});
+					setTimeout(()=>{
+						uni.redirectTo({
+							url:'/pages/rent/order/orderList?status=1'
+						})
+					},1000)
+				}).catch((res) => {
+					console.log(res);
+					uni.hideLoading()
+					uni.showToast({
+						title: res,
+						icon:'error'
+					});
+					console.log(res);
+				})
+			},
+			// 查询车辆详情
+			getRentOrderDteail() {
+				getRentOrderDteail(this.id).then((res) => {
+					console.log(res, 'fh');
+					this.carDateil = res.data;
+				}).catch((res) => {
+					console.log(res);
+				})
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.icon-saoma {
+		font-size: $uni-font-size-lg !important;
+	}
+
+	.personal-data .list {
+		/* #ifndef H5 */
+		margin-top: 15rpx;
+		/* #endif */
+		background-color: #fff;
+	}
+
+	.personal-data .list .item {
+		padding: 30rpx 30rpx 30rpx 0;
+		border-bottom: 1rpx solid #f2f2f2;
+		margin-left: 30rpx;
+		font-size: 28rpx;
+		color: #282828;
+	}
+
+	.personal-data .list .item .input {
+		max-width: 400rpx;
+		text-align: right;
+		color: #868686;
+
+		.icon-suozi {
+			margin-left: 10rpx;
+		}
+	}
+
+	.personal-data .list .item .input .id {
+		// width: 180rpx;
+	}
+
+	.personal-data .list .item .input .iconfont {
+		font-size: 24rpx;
+	}
+
+	.personal-data .modifyBnt {
+		font-size: 32rpx;
+		color: #fff;
+		width: 690rpx;
+		height: 90rpx;
+		border-radius: 50rpx;
+		text-align: center;
+		line-height: 90rpx;
+		margin: 76rpx auto 0 auto;
+	}
+</style>

+ 289 - 0
pages/rent/order/orderDetail.vue

@@ -0,0 +1,289 @@
+<template>
+	<view>
+		<form @submit="formSubmit">
+			<view class='personal-data' :style="colorStyle">
+				<view class='list'>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`创建时间`)}}</view>
+						<view class='input'>
+							{{carDateil.add_time}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`类型`)}}</view>
+						<view class='input' v-if="carDateil.car_lease==1">
+							以租代购
+						</view>
+						<view class='input' v-if="carDateil.car_lease==0">
+							月租
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper' v-if="carDateil.car_lease==1">
+						<view>{{$t(`总月份`)}}</view>
+						<view class='input'>
+							{{carDateil.several_months}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper' v-if="carDateil.car_lease==1">
+						<view>{{$t(`已付月份`)}}</view>
+						<view class='input'>
+							{{carDateil.months}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`月租`)}}</view>
+						<view class='input'>
+							{{carDateil.pay_price}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>{{$t(`绑定人`)}}</view>
+						<view class='input'>
+							{{carDateil.real_name}}
+						</view>
+					</view>
+					<view class='item acea-row row-between-wrapper'>
+						<view>绑定车辆编号</view>
+						<view class='input acea-row row-between-wrapper' @click="carDateil.machine_no?'':bind()">
+							{{carDateil.machine_no?carDateil.machine_no:'未绑定'}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</form>
+		<view class="monthslist" v-for="(item,ind) in carDateil.info">
+			<view class="item acea-row row-between-wrapper row-middle">
+				<view class="title">
+					<view class="info">
+						支付第{{item.months}}月租金
+					</view>
+					<view class="time">
+						{{item.pay_time}}
+					</view>
+				</view>
+				<view class="right">
+					<view class="money">
+						{{item.pay_price}}
+					</view>
+					<block v-if="item.paid!=0">
+						<view class="peytype" v-if="item.pay_type=='yue'">
+							余额支付
+						</view>
+						<view class="peytype" v-if="item.pay_type=='alipay'">
+							支付宝支付
+						</view>
+						<view class="peytype" v-if="item.pay_type=='weixin'">
+							微信支付
+						</view>
+					</block>
+					<view v-else class="peytype">
+						未支付
+					</view>
+				</view>
+			</view>
+
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		getRentOrderDteail,
+		rentSetcar
+	} from '@/api/rent.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import colors from '@/mixins/color.js';
+	export default {
+		mixins: [colors],
+		data() {
+			return {
+				id: '',
+				carDateil: {
+					machine_no: '',
+				}
+
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getRentOrderDteail();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad(options) {
+			this.id = options.id
+			if (this.isLogin) {
+				this.getRentOrderDteail();
+			} else {
+				toLogin();
+			}
+		},
+		methods: {
+			// #ifndef APP-PLUS
+			// 打开二维码
+			openQr() {
+				const that = this;
+				uni.scanCode({
+					onlyFromCamera: true,
+					scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
+					success(res) {
+						that.carDateil.machine_no = res.result;
+					}
+				})
+			},
+			// #endif
+
+			bind() {
+				const that = this;
+				// #ifndef H5
+				uni.showModal({
+					title: '提示',
+					content: '请选择绑定方式',
+					showCancel: false,
+					cancelText: '扫码',
+					confirmText: '手填',
+					success: res => {
+						if (res.confirm) {
+							that.bindImport(that.id)
+						}
+						if (res.cancel) {
+							that.bindQr(that.id)
+						}
+					},
+					fail: () => {},
+					complete: () => {}
+				});
+				// #endif
+				// #ifdef H5
+				that.bindImport(that.id)
+				// #endif
+
+			},
+			// 手输
+			bindImport(id) {
+				const that = this;
+				uni.showModal({
+					title: '绑定车辆',
+					placeholderText: '请输入车辆编号',
+					editable: true,
+					cancelText: '取消',
+					confirmText: '确定',
+					success: res => {
+						if (res.confirm) {
+							if (res.content) {
+								that.rentSetcar(res.content, id)
+							} else {
+								uni.showToast({
+									title: '请输入车辆编号',
+									icon: 'error'
+								})
+								that.bindImport(id)
+							}
+						}
+					},
+					fail: () => {},
+					complete: () => {}
+				});
+			},
+			// 扫码绑定
+			bindQr(id) {
+				uni.scanCode({
+					onlyFromCamera: true,
+					scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
+					success(res) {
+						that.rentSetcar(res.result, id)
+					}
+				})
+			},
+			// 提交绑定
+			rentSetcar(content, id) {
+				rentSetcar({
+					id,
+					machine_no: content
+				}).then((res) => {
+
+				}).catch((res) => {
+					console.log(res);
+				})
+			},
+			// 查询车辆详情
+			getRentOrderDteail() {
+				getRentOrderDteail(this.id).then((res) => {
+					console.log(res, 'fh');
+					this.carDateil = res.data;
+				}).catch((res) => {
+					console.log(res);
+				})
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.personal-data .list {
+		/* #ifndef H5 */
+		margin-top: 15rpx;
+		/* #endif */
+		background-color: #fff;
+
+		.item {
+			padding: 30rpx 30rpx 30rpx 0;
+			border-bottom: 1rpx solid #f2f2f2;
+			margin-left: 30rpx;
+			font-size: 28rpx;
+			color: #282828;
+
+			.input {
+				max-width: 400rpx;
+				text-align: right;
+				color: #868686;
+
+				.icon-suozi {
+					margin-left: 10rpx;
+				}
+
+				.id {
+					// width: 180rpx;
+				}
+
+				.iconfont {
+					font-size: 24rpx;
+				}
+			}
+		}
+	}
+
+	.monthslist {
+		background-color: #FFF;
+		border-radius: 10rpx;
+		margin: 20rpx 20rpx 0rpx 20rpx;
+		padding: 20rpx;
+
+		.time,
+		.peytype {
+			font-size: 24rpx;
+			color: #999;
+		}
+
+		.info {
+			color: var(--view-theme);
+		}
+
+		.right {
+			text-align: right;
+			.money {
+				color: var(--view-theme);
+			}
+		}
+	}
+</style>

+ 1002 - 0
pages/rent/order/orderList.vue

@@ -0,0 +1,1002 @@
+<template>
+	<view :style="colorStyle">
+		<view class="my-order">
+			<view class="header bg-color">
+				<view class="picTxt acea-row row-between-wrapper">
+					<view class="text">
+						<view class="name">{{$t(`服务信息`)}}</view>
+						<view>{{$t(`消费订单`)}}:{{ orderData.sun_order_count || 0 }}
+							{{$t(`总消费`)}}:{{$t(`¥`)}}{{ orderData.sun_order_amount || 0 }}
+						</view>
+					</view>
+					<view class="pictrue">
+						<image src="../static/orderTime.png"></image>
+					</view>
+				</view>
+			</view>
+			<view class="nav acea-row row-around">
+				<view class="item" :class="orderStatus ==-1 ? 'on' : ''" @click="statusClick(-1)">
+					<view>{{$t(`全部`)}}</view>
+					<view class="num">{{ orderData.sun_order_count || 0 }}</view>
+				</view>
+				<view class="item" :class="orderStatus == 0 ? 'on' : ''" @click="statusClick(0)">
+					<view>{{$t(`待支付`)}}</view>
+					<view class="num">{{ orderData.unpaid_count || 0 }}</view>
+				</view>
+				<view class="item" :class="orderStatus == 1 ? 'on' : ''" @click="statusClick(1)">
+					<view>{{$t(`进行中`)}}</view>
+					<view class="num">{{ orderData.progress_count || 0 }}</view>
+				</view>
+				<view class="item" :class="orderStatus == 2 ? 'on' : ''" @click="statusClick(2)">
+					<view>{{$t(`已完成`)}}</view>
+					<view class="num ">{{ orderData.finish_count || 0 }}</view>
+				</view>
+				<view class="item" :class="orderStatus == 3 ? 'on' : ''" @click="statusClick(3)">
+					<view>{{$t(`已释放`)}}</view>
+					<view class="num">{{ orderData.unbinding_count || 0 }}</view>
+				</view>
+			</view>
+			<view class="list">
+				<view class="item" v-for="(item, index) in orderList" :key="index">
+					<view @click="goOrderDetails(item.order_id)">
+						<view class="title acea-row row-between-wrapper">
+							<view class="acea-row row-middle">
+								<view>{{ item.add_time }}</view>
+							</view>
+							<view v-if="item.status == 0" class="font-color">待支付</view>
+							<view v-else-if="item.status == 1" class="font-color">进行中</view>
+							<view v-else-if="item.status == 2 " class="font-color">
+								已完成
+							</view>
+							<view v-else-if="item.status == 3 " class="font-color">
+								待释放
+							</view>
+						</view>
+						<view class="item-info acea-row row-between row-top">
+							<view class="pictrue">
+								<easy-loadimage mode="widthFix" :image-src="item.rent.image"></easy-loadimage>
+							</view>
+							<view class="text">
+								<text class="name line2">{{ item.rent.title }}</text>
+								<view class="money">
+									<block v-if="item.car_lease==1">
+										<view class="return">
+											以租代购
+
+										</view>
+										<view class="lowe">
+											剩余{{item.several_months-item.months}}月
+										</view>
+									</block>
+									<view v-if="item.car_lease==0" class="return">
+										月付
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>
+					<view class="bottom acea-row row-right row-middle">
+						<view class="totalPrice">
+							<text class="money">每月{{$t(`¥`)}}{{ item.pay_price }}</text>
+						</view>
+						<view class="bnt cancelBnt" v-if="item.binding_state == 0 &&item.status == 1"
+							@click="onCartBind(item)">
+							绑定车辆</view>
+						<view class="bnt cancelBnt" v-if="item.status == 0"
+							@click="goPay(item.pay_price, item.order_id)">
+							<text>{{$t(`立即付款`)}}</text>
+						</view>
+						<view class="bnt cancelBnt" v-if="item.status == 1&&item.months!=item.several_months"
+							@click="goPay(item.pay_price, item.order_id)">
+							<text >{{$t(`续费`)}}</text>
+						</view>
+						<!-- <view @click="navDetail(item)" class="bnt gredBnt" v-if="item.status >0">
+							明细
+						</view> -->
+					</view>
+				</view>
+			</view>
+			<view class="loadingicon acea-row row-center-wrapper font-color-white" v-if="orderList.length > 0">
+				<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
+				{{ loadTitle }}
+			</view>
+			<view v-if="orderList.length == 0">
+				<emptyPage v-if="!loading" :title="$t(`暂无订单`)"></emptyPage>
+				<view class="loadingicon acea-row row-center-wrapper">
+					<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
+				</view>
+			</view>
+		</view>
+		<!-- #ifndef MP -->
+		<home></home>
+		<!-- #endif -->
+		<payment :payMode="payMode" :pay_close="pay_close" @onChangeFun="onChangeFun" :order_id="pay_order_id"
+			:isCall="true" :totalPrice="totalPrice"></payment>
+	</view>
+</template>
+
+<script>
+	import {
+		orderDel,
+	} from '@/api/order.js';
+	import {
+		getUserInfo
+	} from '@/api/user.js';
+	import {
+		getRentOrderData,
+		getRentOrder,
+		postRentPay,
+		// rentSetcar
+	} from '@/api/rent.js';
+	import home from '@/components/home';
+	import payment from '@/components/payment';
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		mapGetters
+	} from 'vuex';
+	import emptyPage from '@/components/emptyPage.vue';
+	import colors from '@/mixins/color.js';
+	export default {
+		components: {
+			payment,
+			home,
+			emptyPage,
+		},
+		mixins: [colors],
+		data() {
+			return {
+				loading: false, //是否加载中
+				loadend: false, //是否加载完毕
+				loadTitle: this.$t(`加载更多`), //提示语
+				orderList: [], //订单数组
+				orderData: {}, //订单详细统计
+				orderStatus: -1, //订单状态
+				page: 1,
+				limit: 20,
+				payMode: [{
+						name: this.$t(`微信支付`),
+						icon: 'icon-weixinzhifu',
+						value: 'weixin',
+						title: this.$t(`使用微信快捷支付`),
+						payStatus: true
+					},
+					{
+						name: this.$t(`支付宝支付`),
+						icon: 'icon-zhifubao',
+						value: 'alipay',
+						title: this.$t(`使用支付宝支付`),
+						payStatus: true
+					},
+					{
+						name: this.$t(`余额支付`),
+						icon: 'icon-yuezhifu',
+						value: 'yue',
+						title: this.$t(`可用余额`),
+						number: 0,
+						payStatus: true
+					},
+				],
+				pay_close: false,
+				pay_order_id: '',
+				totalPrice: '0',
+				// 保存当前订单数据
+				actionOrder: {},
+				payLoding:false,//判断是否支付中
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		onShow() {
+			if (this.isLogin) {
+				this.page = 1;
+				this.orderList = []
+				this.loadend = false;
+				this.onLoadFun();
+				this.getRentOrder();
+			} else {
+				toLogin();
+			}
+		},
+		methods: {
+			navDetail(item) {
+				uni.navigateTo({
+					url: './orderDetail?id='+item.order_id,
+				});
+			},
+
+			onLoadFun() {
+				this.getRentOrderData();
+				this.getUserInfo();
+			},
+			/**
+			 * 事件回调
+			 *
+			 */
+			onChangeFun: function(e) {
+				console.log(e, '2333');
+				let opt = e;
+				let action = opt.action || null;
+				let value = opt.value != undefined ? opt.value : null;
+				action && this[action] && this[action](value);
+			},
+			/**
+			 * 获取用户信息
+			 *
+			 */
+			getUserInfo: function() {
+				let that = this;
+				getUserInfo().then(res => {
+					that.payMode[2].number = res.data.now_money;
+					that.$set(that, 'payMode', that.payMode);
+				});
+			},
+			/**
+			 * 关闭支付组件
+			 *
+			 */
+			payClose: function() {
+				this.pay_close = false;
+			},
+			/**
+			 * 生命周期函数--监听页面加载
+			 */
+			onLoad: function(options) {
+				if (options.status) this.orderStatus = options.status;
+			},
+			/**
+			 * 获取订单统计数据
+			 *
+			 */
+			getRentOrderData: function() {
+				let that = this;
+				getRentOrderData().then(res => {
+					res.data.progress_count += res.data.not_binding_count;
+					that.$set(that, 'orderData', res.data);
+					that.payMode.map(item => {
+						if (item.value == 'weixin') {
+							item.payStatus = res.data.pay_weixin_open ? true : false;
+						}
+						if (item.value == 'alipay') {
+							item.payStatus = res.data.ali_pay_status ? true : false;
+						}
+						if (item.value == 'yue') {
+							item.payStatus = res.data.yue_pay_status == 1 ? true : false;
+						}
+						if (item.value == 'friend') {
+							item.payStatus = res.data.friend_pay_status == 1 ? true : false;
+						}
+					});
+					//#ifdef MP
+					this.payMode[1].payStatus = false;
+					//#endif
+				});
+			},
+			onCartBind(item) {
+				const that = this;
+				uni.navigateTo({
+					url: './onBindCar?id=' + item.order_id,
+				});
+				return
+
+				// // #ifndef H5
+				// uni.showModal({
+				// 	title: '提示',
+				// 	content: '请选择绑定方式',
+				// 	showCancel: false,
+				// 	cancelText: '扫码',
+				// 	confirmText: '手填',
+				// 	success: res => {
+				// 		if (res.confirm) {
+				// 			that.bindImport(item.id)
+				// 		}
+				// 		if (res.cancel) {
+				// 			that.bindQr(item.id)
+				// 		}
+				// 	},
+				// 	fail: () => {},
+				// 	complete: () => {}
+				// });
+				// // #endif
+				// // #ifdef H5
+				// that.bindImport(item.id)
+				// // #endif
+			},
+			// 手输
+			// bindImport(id) {
+			// 	const that = this;
+			// 	uni.showModal({
+			// 		title: '绑定车辆',
+			// 		placeholderText: '请输入车辆编号',
+			// 		editable: true,
+			// 		cancelText: '取消',
+			// 		confirmText: '确定',
+			// 		success: res => {
+			// 			if (res.confirm) {
+			// 				if (res.content) {
+			// 					that.rentSetcar(res.content, id)
+			// 				} else {
+			// 					uni.showToast({
+			// 						title: '请输入车辆编号',
+			// 						icon: 'error'
+			// 					})
+			// 					that.bindImport(id)
+			// 				}
+			// 			}
+			// 		},
+			// 		fail: () => {},
+			// 		complete: () => {}
+			// 	});
+			// },
+			// 扫码绑定
+			// bindQr(id) {
+			// 	uni.scanCode({
+			// 		onlyFromCamera: true,
+			// 		scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
+			// 		success(res) {
+			// 			that.rentSetcar(res.result, id)
+			// 		}
+			// 	})
+			// },
+			// 提交绑定
+			// rentSetcar(content, id) {
+			// 	rentSetcar({
+			// 		id,
+			// 		machine_no: content
+			// 	}).then((res) => {
+
+			// 	}).catch((res) => {
+			// 		console.log(res);
+			// 	})
+			// },
+			/**
+			 * 打开支付组件
+			 *
+			 */
+			goPay: function(pay_price, order_id) {
+				this.$set(this, 'pay_close', true);
+				this.$set(this, 'pay_order_id', order_id);
+				this.$set(this, 'totalPrice', pay_price);
+			},
+			// 支付方式
+			payCheck(value) {
+				const that = this;
+				if(that.payLoding){
+					return
+				}
+				that.payLoding = true;
+				postRentPay({
+					'order_id': that.pay_order_id,
+					'pay_type': value,
+					// 'quitUrt': that.storeInfo.cooperate_id,
+					// #ifdef MP
+					from: 'routine',
+					// #endif
+					// #ifdef H5
+					from: that.$wechat.isWeixin() ? 'weixin' : 'weixinh5',
+					// #endif
+					// #ifdef APP-PLUS
+					from: 'app'
+					// #endif
+				}).then((res) => {
+					let status = res.data.status,
+						orderId = res.data.result.order_id,
+						jsConfig = res.data.result.jsConfig,
+						goPages = '/pages/rent/carpay/paySuccess?order_id=' + orderId + '&msg=' + res.msg +'&type=3' + '&totalPrice=' + that.totalPrice,friendPay = '/pages/users/payment_on_behalf/index?order_id=' + orderId + '&spread=' +that.$store.state.app.uid
+					switch (status) {
+						case 'ORDER_EXIST':
+						case 'EXTEND_ORDER':
+							uni.hideLoading();
+							return that.$util.Tips({
+								title: res.msg
+							}, {
+								tab: 5,
+								url: goPages
+							});
+						case 'ALLINPAY_PAY':
+							uni.hideLoading();
+							// #ifdef MP
+							this.initIn = true
+							wx.openEmbeddedMiniProgram({
+								appId: 'wxef277996acc166c3',
+								extraData: {
+									cusid: jsConfig.cusid,
+									appid: jsConfig.appid,
+									version: jsConfig.version,
+									trxamt: jsConfig.trxamt,
+									reqsn: jsConfig.reqsn,
+									notify_url: jsConfig.notify_url,
+									body: jsConfig.body,
+									remark: jsConfig.remark,
+									validtime: jsConfig.validtime,
+									randomstr: jsConfig.randomstr,
+									paytype: jsConfig.paytype,
+									sign: jsConfig.sign,
+									signtype: jsConfig.signtype
+								}
+							})
+							this.jumpData = {
+								orderId: res.data.result.orderId,
+								msg: res.msg,
+							}
+							// #endif
+							// #ifdef APP-PLUS
+							plus.runtime.openURL(jsConfig.payinfo);
+							setTimeout(e => {
+								uni.reLaunch({
+									url: goPages
+								})
+							}, 1000)
+							// #endif
+							// #ifdef H5
+							this.formpost(res.data.result.pay_url, jsConfig)
+							// #endif
+							break;
+						case 'PAY_ERROR':
+							uni.hideLoading();
+							return that.$util.Tips({
+								title: res.msg
+							}, {
+								tab: 5,
+								url: goPages
+							});
+							break;
+						case 'SUCCESS':
+							uni.hideLoading();
+							if ((that.BargainId || that.combinationId || that.pinkId || that.seckillId || that.discountId) && that.payType != 'friend')
+								return that.$util.Tips({
+									title: res.msg,
+									icon: 'success'
+								}, {
+									tab: 4,
+									url: goPages
+								});
+							return that.$util.Tips({
+								title: res.msg,
+								icon: 'success'
+							}, {
+								tab: 4,
+								url: that.payType == 'friend' ? friendPay : goPages
+							});
+							break;
+						case 'WECHAT_PAY':
+							that.toPay = true;
+							// #ifdef MP
+							/* that.toPay = true; */
+							let mp_pay_name = ''
+							if (uni.requestOrderPayment) {
+								mp_pay_name = 'requestOrderPayment'
+							} else {
+								mp_pay_name = 'requestPayment'
+							}
+							uni[mp_pay_name]({
+								timeStamp: jsConfig.timestamp,
+								nonceStr: jsConfig.nonceStr,
+								package: jsConfig.package,
+								signType: jsConfig.signType,
+								paySign: jsConfig.paySign,
+								success: function(res) {
+									uni.hideLoading();
+									if (that.BargainId || that.combinationId || that.pinkId || that.seckillId || that.discountId)
+										return that.$util.Tips({
+											title: that.$t(`支付成功`),
+											icon: 'success'
+										}, {
+											tab: 4,
+											url: goPages
+										});
+									return that.$util.Tips({
+										title: that.$t(`支付成功`),
+										icon: 'success'
+									}, {
+										tab: 5,
+										url: goPages
+									});
+								},
+								fail: function(e) {
+									uni.hideLoading();
+									return that.$util.Tips({
+										title: that.$t(`取消支付`)
+									}, {
+										tab: 5,
+										url: goPages + '&status=2'
+									});
+								},
+								complete: function(e) {
+									uni.hideLoading();
+									//关闭当前页面跳转至订单状态
+									if (res.errMsg == 'requestPayment:cancel' || e.errMsg =='requestOrderPayment:cancel') return
+									 that.$util
+										.Tips({
+											title: that.$t(`取消支付`)
+										}, {
+											tab: 5,
+											url: goPages + '&status=2'
+										});
+								},
+							})
+							// #endif
+							// #ifdef H5
+							this.$wechat.pay(res.data.result.jsConfig).then(res => {
+								return that.$util.Tips({
+									title: that.$t(`支付成功`),
+									icon: 'success'
+								}, {
+									tab: 5,
+									url: goPages
+								});
+							}).catch(res => {
+								if (!this.$wechat.isWeixin()) {
+									uni.redirectTo({
+										url: goPages + '&msg=' + that.$t(`支付失败`) + '&status=2'
+										// '&msg=支付失败&status=2'
+									})
+								}
+								if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
+									title: that.$t(`取消支付`)
+								}, {
+									tab: 5,
+									url: goPages + '&status=2'
+								});
+							})
+							// #endif
+							// #ifdef APP-PLUS
+							uni.requestPayment({
+								provider: 'wxpay',
+								orderInfo: jsConfig,
+								success: (e) => {
+									let url = goPages;
+									uni.showToast({
+										title: that.$t(`支付成功`)
+									})
+									setTimeout(res => {
+										uni.redirectTo({
+											url: url
+										})
+									}, 2000)
+								},
+								fail: (e) => {
+									let url = '/pages/rent/carpay/paySuccess?order_id=' +orderId +'&msg=' + that.$t(`支付失败`);
+									uni.showModal({
+										content: that.$t(`支付失败`),
+										showCancel: false,
+										success: function(res) {
+											if (res.confirm) {
+												uni.redirectTo({
+													url: url
+												})
+											} else if (res.cancel) {}
+										}
+									})
+								},
+								complete: () => {
+									uni.hideLoading();
+								},
+							});
+							// #endif
+							break;
+						case 'PAY_DEFICIENCY':
+							uni.hideLoading();
+							//余额不足
+							return that.$util.Tips({
+								title: res.msg
+							}, {
+								tab: 5,
+								url: goPages + '&status=1'
+							});
+							break;
+
+						case "WECHAT_H5_PAY":
+							uni.hideLoading();
+							that.$util.Tips({
+								title: that.$t(`订单创建成功`)
+							}, {
+								tab: 4,
+								url: goPages + '&status=0'
+							});
+							setTimeout(() => {
+								location.href = res.data.result.jsConfig.mweb_url;
+							}, 2000);
+							break;
+
+						case 'ALIPAY_PAY':
+							//#ifdef H5
+							if (this.from === 'weixin') {
+								uni.redirectTo({
+									url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
+								});
+							} else {
+								uni.hideLoading();
+								that.formContent = res.data.result.jsConfig;
+								that.$nextTick(() => {
+									document.getElementById('alipaysubmit').submit();
+								})
+							}
+							//#endif
+							// #ifdef MP
+							uni.navigateTo({
+								url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
+							});
+							// #endif
+							// #ifdef APP-PLUS
+							uni.requestPayment({
+								provider: 'alipay',
+								orderInfo: jsConfig,
+								success: (e) => {
+									uni.showToast({
+										title: that.$t(`支付成功`)
+									})
+									let url = '/pages/rent/carpay/paySuccess?order_id=' +orderId +'&msg=' + that.$t(`支付成功`);
+									setTimeout(res => {
+										uni.redirectTo({
+											url: url
+										})
+									}, 2000)
+
+								},
+								fail: (e) => {
+									let url = '/pages/rent/carpay/paySuccess?order_id=' + orderId +'&msg=' + that.$t(`支付失败`);
+									uni.showModal({
+										content: that.$t(`支付失败`),
+										showCancel: false,
+										success: function(res) {
+											if (res.confirm) {
+												uni.redirectTo({
+													url: url
+												})
+											} else if (res.cancel) {}
+										}
+									})
+								},
+								complete: () => {
+									uni.hideLoading();
+								},
+							});
+							// #endif
+							break;
+					}
+					that.payLoding = false;
+				}).catch((res) => {
+					console.log(res);
+					that.payLoding = false;
+				})
+
+			},
+			/**
+			 * 支付成功回调
+			 *
+			 */
+			pay_complete: function() {
+				this.loadend = false;
+				this.page = 1;
+				this.$set(this, 'orderList', []);
+				this.pay_close = false;
+				uni.navigateTo({
+					url: '/pages/rent/carpay/paySuccess?order_id=' + this.pay_order_id +'&msg=' + this.$t(`支付成功`) + '&type=3&totalPrice=' + this.totalPrice
+				})
+				this.pay_order_id = '';
+				this.getRentOrderData();
+				this.getRentOrder();
+			},
+			/**
+			 * 支付失败回调
+			 *
+			 */
+			pay_fail: function() {
+				this.pay_close = false;
+				this.pay_order_id = '';
+			},
+			/**
+			 * 去订单详情
+			 */
+			goOrderDetails: function(order_id) {
+				let that = this;
+				if (!order_id) {
+					return that.$util.Tips({
+						title: that.$t(`缺少订单号无法查看订单详情`)
+					})
+				};
+				uni.navigateTo({
+					url: './orderDetail?id=' + order_id
+				});
+			},
+			/**
+			 * 切换类型
+			 */
+			statusClick: function(status) {
+				if (status == this.orderStatus) return;
+				this.orderStatus = status;
+				this.loadend = false;
+				this.page = 1;
+				this.$set(this, 'orderList', []);
+				this.getRentOrder();
+			},
+			/**
+			 * 获取订单列表
+			 */
+			getRentOrder: function() {
+				let that = this;
+				if (that.loadend) return;
+				if (that.loading) return;
+				that.loading = true;
+				that.loadTitle = that.$t(`加载更多`);
+				getRentOrder({
+						status: that.orderStatus,
+						page: that.page,
+						limit: that.limit
+					})
+					.then(res => {
+						let list = res.data.list || [];
+						let loadend = list.length < that.limit;
+						that.orderList = that.$util.SplitArray(list, that.orderList);
+						that.$set(that, 'orderList', that.orderList);
+						that.loadend = loadend;
+						that.loading = false;
+						that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
+						that.page = that.page + 1;
+					})
+					.catch(err => {
+						that.loading = false;
+						that.loadTitle = that.$t(`加载更多`);
+					});
+			},
+
+			/**
+			 * 删除订单
+			 */
+			delOrder: function(order_id, index) {
+				let that = this;
+				uni.showModal({
+					title: that.$t(`删除订单`),
+					content: that.$t(`确定删除该订单`),
+					success: function(res) {
+						if (res.confirm) {
+							orderDel(order_id)
+								.then(res => {
+									that.orderList.splice(index, 1);
+									that.$set(that, 'orderList', that.orderList);
+									that.$set(that.orderData, 'unpaid_count', that.orderData
+										.unpaid_count - 1);
+									that.getRentOrderData();
+									return that.$util.Tips({
+										title: that.$t(`删除成功`),
+										icon: 'success'
+									});
+								})
+								.catch(err => {
+									return that.$util.Tips({
+										title: err
+									});
+								});
+						} else if (res.cancel) {
+							return that.$util.Tips({
+								title: that.$t(`已取消`)
+							});
+						}
+					}
+				});
+
+			}
+		},
+		onReachBottom: function() {
+			this.getRentOrder();
+		},
+		// 滚动监听
+		onPageScroll(e) {
+			// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
+			uni.$emit('scroll');
+		},
+	};
+</script>
+
+<style scoped lang="scss">
+	.my-order {
+		background-color: var(--view-theme);
+		min-height: 100vh;
+
+		.header {
+			height: 260rpx;
+			padding: 0 30rpx;
+
+			.picTxt {
+				height: 190rpx;
+
+				.text {
+					color: rgba(255, 255, 255, 0.8);
+					font-size: 26rpx;
+					font-family: 'Guildford Pro';
+
+					.name {
+						font-size: 34rpx;
+						font-weight: bold;
+						color: #fff;
+						margin-bottom: 20rpx;
+					}
+
+				}
+
+				.pictrue {
+					width: 122rpx;
+					height: 109rpx;
+
+					image {
+						width: 100%;
+						height: 100%;
+					}
+
+				}
+			}
+		}
+
+		.nav {
+			background-color: var(--view-theme-16);
+			width: 690rpx;
+			height: 140rpx;
+			border-radius: 6rpx;
+			margin: -73rpx auto 0 auto;
+
+			.item {
+				text-align: center;
+				font-size: 26rpx;
+				color: #fff;
+				width: 3rem;
+				padding: 27rpx 0;
+				border-bottom: 5rpx solid transparent;
+
+				&.on {
+					/* #ifdef H5 || MP */
+					font-weight: bold;
+					/* #endif */
+					/* #ifdef APP-PLUS */
+					color: #000;
+					/* #endif */
+					border-color: var(--view-priceColor);
+				}
+			}
+
+			.num {
+				margin-top: 18rpx;
+			}
+		}
+
+		.list {
+			width: 690rpx;
+			margin: 14rpx auto 0 auto;
+
+			.item {
+				background-color: var(--view-theme-16);
+				border-radius: 6rpx;
+				margin-bottom: 14rpx;
+
+				.title {
+					height: 84rpx;
+					padding: 0 30rpx;
+					border-bottom: 2rpx solid var(--view-theme);
+					font-size: 28rpx;
+					color: #FFF;
+
+					.sign {
+						font-size: 24rpx;
+						padding: 0 7rpx;
+						height: 36rpx;
+						margin-right: 15rpx;
+					}
+				}
+
+				.item-info {
+					padding: 0 30rpx;
+					margin-top: 22rpx;
+
+					.pictrue {
+						width: 120rpx;
+						height: 120rpx;
+						background-color: #FFF;
+
+						/deep/,
+						/deep/image,
+						/deep/.easy-loadimage,
+						/deep/uni-image {
+
+							width: 120rpx;
+							height: 120rpx;
+							border-radius: 6rpx;
+						}
+
+						image {
+							width: 100%;
+							height: 100%;
+							border-radius: 6rpx;
+						}
+					}
+
+					.text {
+						width: 486rpx;
+						font-size: 28rpx;
+						color: #999;
+						margin-top: 6rpx;
+						// display: flex;
+						line-height: 39rpx;
+
+						.name {
+							// width: 306rpx;
+							color: #FFF;
+							height: 78rpx;
+						}
+
+						.money {
+							text-align: left;
+							flex: 1;
+							display: flex;
+							.return {
+								font-size: 24rpx;
+								background-color: var(--view-priceColor);
+								color: var(--view-theme);
+								border-radius: 50rpx;
+								padding: 0 20rpx;
+								margin-right: 10rpx;
+							}
+							.lowe{
+								color: #FFF;
+							}
+						}
+					}
+				}
+
+				.totalPrice {
+					font-size: 26rpx;
+					color: #282828;
+					text-align: left;
+					flex-grow: 1;
+
+					.money {
+						font-size: 28rpx;
+						font-weight: bold;
+						color: var(--view-priceColor);
+					}
+				}
+
+				.bottom {
+					height: 107rpx;
+					padding: 0 30rpx;
+
+					.bnt {
+						width: 170rpx;
+						height: 50rpx;
+						text-align: center;
+						line-height: 50rpx;
+						color: #fff;
+						border-radius: 50rpx;
+						font-size: 27rpx;
+
+						&.cancelBnt {
+							color: var(--view-theme);
+							background-color: var(--view-priceColor);
+						}
+						&.gredBnt{
+							color: #999;
+							background-color: #FFF;
+							// border: 1px solid var(--view-priceColor);
+						}
+						&~.bnt {
+							margin-left: 17rpx;
+						}
+					}
+				}
+
+			}
+		}
+	}
+	.noCart {
+		margin-top: 171rpx;
+		padding-top: 0.1rpx;
+		.pictrue {
+			width: 414rpx;
+			height: 336rpx;
+			margin: 78rpx auto 56rpx auto;
+			image {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+</style>

BIN
pages/rent/static/bao.png


BIN
pages/rent/static/cart.png


BIN
pages/rent/static/dom.png


BIN
pages/rent/static/endImg.png


BIN
pages/rent/static/orderTime.png


BIN
pages/rent/static/routeContent.png


BIN
pages/rent/static/shuoming.png


BIN
pages/rent/static/stImg.png


BIN
pages/rent/static/writeOff.jpg


BIN
pages/rent/static/written.png


+ 9 - 3
pages/mall/index.vue → pages/renttab/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="bg">
+	<view class="bg" :style="colorStyle">
 		<headerSerch v-if="headerData" :dataConfig="headerData"></headerSerch>
 		<view class="navTitle">
 			<view class="left_tab" @click="navTabIndex==0">租车</view>
@@ -25,10 +25,9 @@
 			</view> -->
 		</view>
 		<view class="list acea-row row-between ">
-			<view class="ls" v-for="(item,ind) in carList" :key='ind'>
+			<view class="ls" v-for="(item,ind) in carList" :key='ind' @click="navTo(item)">
 				<image class="img" :src="item.image" mode="scaleToFill"></image>
 				<view class="content">
-
 					<view class="line1 title">
 						{{item.title}}
 					</view>
@@ -55,6 +54,7 @@
 	import headerSerch from '../index/diy/components/headerSerch.vue';
 	import swiperBg from '../index/diy/components/swiperBg';
 	import tabNav from '../index/diy/components/tabNav';
+	import colors from '@/mixins/color';
 	import {
 		getDiy
 	} from '@/api/api.js';
@@ -80,6 +80,7 @@
 			tabNav,
 			swiperBg
 		},
+		mixins: [colors],
 		onShow() {
 			uni.hideTabBar()
 
@@ -90,6 +91,11 @@
 			this.getCarList();
 		},
 		methods: {
+			navTo(item){
+				uni.navigateTo({
+					url: `/pages/rent/carDetail?id=${item.id}`
+				});
+			},
 			bindSortId(data) {
 				console.log(data)
 			},

+ 104 - 131
pages/user/index.vue

@@ -18,14 +18,6 @@
 						<view class="bg"></view>
 						<view class="user-info">
 							<view>
-								<!-- 注释这个是加的bnt -->
-								<!-- #ifdef H5 -->
-								<!-- <button class="bntImg" v-if="userInfo.is_complete == 0 && isWeixin"
-									@click="getWechatuserinfo">
-									<image class="avatar" src='/static/images/f.png'></image>
-									<view class="avatarName">{{$t('获取头像')}}</view>
-								</button> -->
-								<!-- #endif -->
 								<!-- #ifndef APP-PLUS -->
 								<view class="avatar-box" :class="{on:userInfo.is_money_level}">
 									<image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar"
@@ -86,18 +78,6 @@
 									<view class="iconfont icon-shezhi"></view>
 								</navigator>
 							</view>
-							<view class="message">
-								<navigator url="/pages/users/message_center/index" hover-class="none">
-									<view v-if="userInfo.service_num" class="num">
-										{{userInfo.service_num >= 100 ? '99+' : userInfo.service_num}}
-									</view>
-									<view class="iconfont icon-s-kefu"></view>
-								</navigator>
-							</view>
-							<!-- #ifdef MP -->
-							<!-- <view class="setting" @click="Setting"><text class="iconfont icon-shezhi"></text></view> -->
-							<!-- #endif -->
-
 						</view>
 						<view class="num-wrapper">
 							<view class="num-item" v-if="userInfo.balance_func_status"
@@ -105,82 +85,18 @@
 								<text class="num">{{userInfo.now_money || 0}}</text>
 								<view class="txt">{{$t('余额')}}</view>
 							</view>
-							<view class="num-item" v-else
-								@click="goMenuPage('/pages/users/user_goods_collection/index')">
-								<text class="num">{{userInfo.collectCount || 0}}</text>
-								<view class="txt">{{$t('收藏')}}</view>
-							</view>
-							<view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
-								<text class="num">{{userInfo.couponCount || 0}}</text>
-								<view class="txt">{{$t('优惠券')}}</view>
-							</view>
-							<view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')">
-								<text class="num">{{userInfo.integral || 0}}</text>
-								<view class="txt">{{$t('积分')}}</view>
-							</view>
-						</view>
-						<!-- <view class="sign" @click="goSignIn">签到</view> -->
-						<view class="cardVipA acea-row row-between-wrapper"
-							v-if="userInfo.svip_open && member_style==1">
-							<view class="left-box">
-								<view v-if="userInfo.vip_status == 1" class="small">{{$t('永久')}}</view>
-								<view v-else-if="userInfo.vip_status == 3" class="small">{{$t('会员到期')}}
-									{{ userInfo.overdue_time | dateFormat }}
-								</view>
-								<view v-else-if="userInfo.vip_status == -1" class="small">{{$t('已过期')}}</view>
-								<view v-else-if="userInfo.vip_status == 2" class="small">{{$t('未开通会员')}}
-								</view>
-							</view>
-							<view class="acea-row row-middle">
-								<navigator v-if="userInfo.vip_status == 1" url="/pages/annex/vip_paid/index"
-									hover-class="none" class="btn">{{$t('查看会员权益')}}</navigator>
-								<navigator v-else url="/pages/annex/vip_paid/index" hover-class="none" class="btn">
-									{{ userInfo.overdue_time ? $t('立即续费') : $t('立即激活') }}
-								</navigator>
-								<text class="iconfont icon-xiangyou"></text>
-							</view>
-						</view>
-						<view class="cardVipB acea-row row-between" v-if="userInfo.svip_open && member_style==3">
-							<view class="left-box acea-row">
-								<view class="pictrue">
-									<image src="../../static/images/member01.png"></image>
-								</view>
-								<view v-if="userInfo.vip_status == 1" class="small">{{$t('永久')}}</view>
-								<view v-else-if="userInfo.vip_status == 3" class="small">{{$t('会员到期')}}
-									{{ userInfo.overdue_time | dateFormat }}
-								</view>
-								<view v-else-if="userInfo.vip_status == -1" class="small">{{$t('已过期')}}</view>
-								<view v-else-if="userInfo.vip_status == 2" class="small">{{$t('未开通会员')}}
-								</view>
-							</view>
-							<view class="acea-row">
-								<navigator v-if="userInfo.vip_status == 1" url="/pages/annex/vip_paid/index"
-									hover-class="none" class="btn">{{$t('会员可享多项权益')}}</navigator>
-								<navigator v-else url="/pages/annex/vip_paid/index" hover-class="none" class="btn">
-									{{ userInfo.overdue_time ? $t('立即续费') : $t('立即激活') }}
-								</navigator>
-								<text class="iconfont icon-xiangyou btn"></text>
-							</view>
-						</view>
-					</view>
-					<view class="card-vip" v-if="userInfo.svip_open && member_style==2">
-						<view class="left-box">
-							<view class="big">{{$t('会员可享多项权益')}}</view>
-							<view v-if="userInfo.vip_status == 1" class="small">{{$t('永久')}}</view>
-							<view v-else-if="userInfo.vip_status == 3" class="small">{{$t('会员到期')}}
-								{{ userInfo.overdue_time | dateFormat }}
+
+							<view class="num-item" @click="goMenuPage('/pages/users/user_spread_money/index?type=2')">
+								<text class="num">{{userInfo.brokerage_price || 0}}</text>
+								<view class="txt">{{$t('佣金')}}</view>
 							</view>
-							<view v-else-if="userInfo.vip_status == -1" class="small">{{$t('已过期')}}</view>
-							<view v-else-if="userInfo.vip_status == 2" class="small">{{$t('未开通会员')}}
+							<view class="num-item" @click="goMenuPage('/pages/users/message_center/index')">
+								<text class="num">{{userInfo.service_num >= 100 ? '99+' : userInfo.service_num}}</text>
+								<view class="txt">{{$t('消息')}}</view>
 							</view>
 						</view>
-						<navigator v-if="userInfo.vip_status == 1" url="/pages/annex/vip_paid/index" hover-class="none"
-							class="btn">{{$t('查看会员权益')}}</navigator>
-						<navigator v-else url="/pages/annex/vip_paid/index" hover-class="none" class="btn">
-							{{ userInfo.overdue_time ? $t('立即续费') : $t('立即激活') }}
-						</navigator>
 					</view>
-					<view class="order-wrapper" :class="userInfo.svip_open?'':'height'">
+					<view class="order-wrapper" style="margin-top: -100rpx;" :class="userInfo.svip_open?'':'height'">
 						<view class="order-hd flex">
 							<view class="left">{{$t('订单中心')}}</view>
 							<navigator class="right flex" hover-class="none" url="/pages/goods/order_list/index"
@@ -195,13 +111,34 @@
 									<view class="pic">
 										<!-- <image :src="item.img" mode=""></image> -->
 										<text class="iconfont" :class="item.img"></text>
-										<text class="order-status-num" v-if="item.num > 0">{{ item.num }}</text>
+										<text class="order-status-num" v-if="item.num > 0">{{ item.num > 99?'99+':item.num }}</text>
 									</view>
 									<view class="txt">{{$t(item.title)}}</view>
 								</navigator>
 							</block>
 						</view>
 					</view>
+					<view class="order-wrapper" :class="userInfo.svip_open?'':'height'">
+						<view class="order-hd flex">
+							<view class="left">我的服务</view>
+							<navigator class="right flex" hover-class="none" url="/pages/rent/orderList?status=-1"
+								open-type="navigate">
+								{{$t('查看全部')}}
+								<text class="iconfont icon-xiangyou"></text>
+							</navigator>
+						</view>
+						<view class="order-bd">
+							<block v-for="(item,index) in rentMenu" :key="index">
+								<navigator class="order-item max-width" hover-class="none" :url="item.url">
+									<view class="pic">
+										<text class="iconfont" :class="item.img"></text>
+										<text class="order-status-num" v-if="item.num > 0">{{  item.num > 99?'99+':item.num }}</text>
+									</view>
+									<view class="txt">{{ item.title }}</view>
+								</navigator>
+							</block>
+						</view>
+					</view>
 				</view>
 				<!-- 轮播 -->
 				<view class="slider-wrapper" v-if="imgUrls.length>0 && my_banner_status">
@@ -219,14 +156,16 @@
 				</view>
 				<!-- 会员菜单 -->
 				<view class="user-menus" style="margin-top: 20rpx;">
-					<view class="menu-title">{{$t('我的服务')}}</view>
 					<view class="list-box">
 						<!-- #ifdef APP-PLUS || H5 -->
 						<block v-for="(item,index) in MyMenus" :key="index">
 							<view class="item" v-if="item.url!='#' && item.url!='/pages/service/index'"
 								@click="goMenuPage(item.url, item.name)">
-								<image :src="item.pic"></image>
-								<text>{{$t(item.name)}}</text>
+								<view class="acea-row row-middle">
+									<image :src="item.pic"></image>
+									<view>{{$t(item.name)}}</view>
+								</view>
+								<view class="iconfont  icon-xiangyou"></view>
 							</view>
 						</block>
 						<!-- #endif -->
@@ -241,7 +180,6 @@
 								<text>{{$t(item.name)}}</text>
 							</view>
 						</block>
-
 						<button class="item" open-type='contact' v-if="routineContact == 1">
 							<image src="/static/images/contact.png"></image>
 							<text>{{$t('联系客服')}}</text>
@@ -249,33 +187,22 @@
 						<!-- #endif -->
 						<!-- #ifdef APP-PLUS -->
 						<view class="item" hover-class="none" @click="goMenuPage('/pages/users/privacy/index?type=3')">
+							<view class="acea-row row-middle">
 							<image src="/static/images/menu.png"></image>
 							<text>{{$t('隐私协议')}}</text>
+							</view>
+							<view class="iconfont  icon-xiangyou"></view>
 						</view>
 						<!-- #endif -->
 					</view>
 				</view>
-				<view class="user-menus" style="margin-top: 20rpx;" v-if="storeMenu.length">
-					<view class="menu-title">{{$t('商家管理')}}</view>
-					<view class="list-box">
-						<block v-for="(item,index) in storeMenu" :key="index">
-							<view class="item" :url="item.url" hover-class="none"
-								v-if="item.url!='#' && item.url!='/pages/service/index'"
-								@click="goMenuPage(item.url, item.name)">
-								<image :src="item.pic"></image>
-								<text>{{$t(item.name)}}</text>
-							</view>
-						</block>
-					</view>
-				</view>
 				<image :src="copyRightPic" alt="" class='support'></image>
 				<view class="uni-p-b-98"></view>
 			</scroll-view>
 			<editUserModal :isShow="editModal" @closeEdit="closeEdit" @editSuccess="editSuccess">
 			</editUserModal>
 		</view>
-		<tabBar v-if="!is_diy" :pagePath="'/pages/user/index'"></tabBar>
-		<pageFooter v-else></pageFooter>
+		<pageFooter></pageFooter>
 	</view>
 </template>
 <script>
@@ -304,7 +231,6 @@
 	import dayjs from '@/plugin/dayjs/dayjs.min.js';
 	import Routine from '@/libs/routine';
 	import colors from '@/mixins/color';
-	import tabBar from "@/pages/index/visualization/components/tabBar.vue";
 	import pageFooter from '@/components/pageFooter/index.vue'
 	import {
 		getCustomer
@@ -312,7 +238,6 @@
 	import editUserModal from '@/components/eidtUserModal/index.vue'
 	export default {
 		components: {
-			tabBar,
 			pageFooter,
 			editUserModal
 		},
@@ -340,8 +265,8 @@
 		data() {
 			return {
 				editModal: false, // 编辑头像信息
-				storeMenu: [], // 商家管理
-				orderMenu: [{
+				orderMenu: [
+					{
 						img: 'icon-daifukuan',
 						title: '待付款',
 						url: '/pages/goods/order_list/index?status=0'
@@ -367,6 +292,23 @@
 						url: '/pages/users/user_return_list/index'
 					},
 				],
+				rentMenu: [{
+					img: 'icon-daifukuan-ju',
+					title: '待支付',
+					url: '/pages/rent/order/orderList?status=0'
+				},{
+					img: 'icon-daifahuo-ju',
+					title: '进行中',
+					url: '/pages/rent/order/orderList?status=1'
+				}, {
+					img: 'icon-daishouhuo-ju',
+					title: '已完成',
+					url: '/pages/rent/order/orderList?status=2'
+				}, {
+					img: 'icon-shouhou-tuikuan-ju',
+					title: '已释放',
+					url: '/pages/rent/order/orderList?status=3'
+				}],
 				imgUrls: [],
 				autoplay: true,
 				circular: true,
@@ -375,6 +317,7 @@
 				isAuto: false, //没有授权的不会自动授权
 				isShowAuth: false, //是否隐藏授权
 				orderStatusNum: {},
+				rentStatusNum: {}, //我的服务数量
 				userInfo: {},
 				MyMenus: [],
 				sysHeight: sysHeight,
@@ -529,6 +472,24 @@
 				getUserInfo().then(res => {
 					that.userInfo = res.data
 					that.$store.commit("SETUID", res.data.uid);
+					that.rentMenu.forEach((item, index) => {
+						switch (item.title) {
+							case '待支付':
+								item.num = res.data.rentStatusNum.unpaid_count
+								break
+								break
+							case '进行中':
+								item.num = res.data.rentStatusNum.progress_count+res.data.rentStatusNum.not_binding_count
+								
+								break
+							case '已完成':
+								item.num = res.data.rentStatusNum.finish_count
+								break
+							case '已释放':
+								item.num = res.data.rentStatusNum.unbinding_count
+								break
+						}
+					});
 					that.orderMenu.forEach((item, index) => {
 						switch (item.title) {
 							case '待付款':
@@ -881,6 +842,7 @@
 		display: flex;
 		flex-direction: column;
 		height: 100%;
+		background-color: rgba(32, 33, 53, 1);
 
 		.sys-head {
 			position: relative;
@@ -1122,7 +1084,7 @@
 			}
 
 			.order-wrapper {
-				background: #fff;
+				background: rgba(22, 23, 38, 1);
 				margin: 0 30rpx;
 				border-radius: 16rpx;
 				position: relative;
@@ -1130,10 +1092,11 @@
 
 				.order-hd {
 					justify-content: space-between;
-					padding: 30rpx 20rpx 10rpx 30rpx;
+					padding: 20rpx 20rpx 20rpx 30rpx;
 					margin-top: 25rpx;
 					font-size: 30rpx;
-					color: #282828;
+					color: #FFFFFF;
+					border-bottom: 2px solid var(--view-theme);
 
 					.left {
 						font-weight: bold;
@@ -1142,7 +1105,7 @@
 					.right {
 						display: flex;
 						align-items: center;
-						color: #666666;
+						color: #FFFFFF;
 						font-size: 26rpx;
 
 						.icon-xiangyou {
@@ -1164,13 +1127,17 @@
 						width: 20%;
 						height: 140rpx;
 
+						&.max-width {
+							width: 25%;
+						}
+
 						.pic {
 							position: relative;
 							text-align: center;
 
 							.iconfont {
 								font-size: 48rpx;
-								color: var(--view-theme);
+								color: rgba(255, 255, 255, 1);
 							}
 
 							image {
@@ -1182,7 +1149,7 @@
 						.txt {
 							margin-top: 6rpx;
 							font-size: 26rpx;
-							color: #333;
+							color: rgba(255, 255, 255, 1);
 						}
 					}
 				}
@@ -1206,21 +1173,21 @@
 		}
 
 		.user-menus {
-			background-color: #fff;
+			background-color: rgba(22, 23, 38, 1);
 			margin: 0 30rpx;
 			border-radius: 16rpx;
 
 			.menu-title {
 				padding: 30rpx 30rpx 40rpx;
 				font-size: 30rpx;
-				color: #282828;
+				color: #FFFFFF;
 				font-weight: bold;
 			}
 
 			.list-box {
 				display: flex;
 				flex-wrap: wrap;
-				padding: 0;
+				padding: 15rpx 30rpx;
 			}
 
 			.item {
@@ -1228,21 +1195,27 @@
 				display: flex;
 				align-items: center;
 				justify-content: space-between;
-				flex-direction: column;
-				width: 25%;
-				margin-bottom: 47rpx;
+				width: 100%;
 				font-size: 26rpx;
-				color: #333333;
+				color: #FFFFFF;
+				line-height: 1;
+				padding: 15rpx 0;
+				border-bottom: 2px solid var(--view-theme);
+				;
 
 				image {
 					width: 52rpx;
 					height: 52rpx;
-					margin-bottom: 18rpx;
+					margin-right: 10rpx;
 				}
 
-
 				&:last-child::before {
 					display: none;
+
+				}
+
+				&:last-child {
+					border-bottom: none;
 				}
 			}
 

+ 7 - 2
static/css/base.css

@@ -398,14 +398,15 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
 
 .loading {
 	width: 100%;
-	height: 100rpx;
-	line-height: 100rpx;
+	height: 50rpx;
+	line-height: 50rpx;
 	align-items: center;
 	justify-content: center;
 	position: relative;
 	text-align: center
 }
 
+
 .loading .line {
 	position: absolute;
 	width: 450rpx;
@@ -447,4 +448,8 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
 
 .pd10{
 	padding: 10rpx;
+}
+
+.font-color-white{
+	color: #ccc !important;
 }

BIN
static/images/location.png


BIN
static/images/support.png


+ 0 - 39
utils/log.js

@@ -1,39 +0,0 @@
-
-const logLength=100;//缓存存储上限
-const name = 'log';//缓存名字
-export function addLog (data,content='') {
-	let log = uni.getStorageSync(name)||[];
-	log.unshift({
-		title:data,
-		content:content
-	});
-	uni.setStorageSync(name,log);
-	initLog(log);
-}
-
-
-export function delLog () {
-	return uni.setStorageSync(name,'');
-}
-
-export function getLog () {
-	return uni.getStorageSync(name);
-}
-
-export function initLog (log) {
-	if(log.length>logLength){
-		const newarr = log.slice(log.length-logLength);
-		uni.setStorageSync(name,newarr);
-	}
-}
-export function showLog (log) {
-	
-	let str = '';
-	uni.getStorageSync(name).forEach((e) => {
-		str+=e.title+':'+JSON.stringify(e.content)
-	})
-	uni.showModal({
-		title:"日志",
-		content:str
-	})
-}

+ 0 - 24
utils/platform.js

@@ -1,24 +0,0 @@
-export function isAndroid() {  
-    var ua = navigator.userAgent,  
-            _isAndroid = ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1;  
-    return _isAndroid;  
-}  
-
-export function isIOS() {  
-    return !!navigator.userAgent.match(/(i[^;]+\;(U;)? CPU.+Mac OS X)/);  
-}  
-
-export function isPad() {  
-    return navigator.userAgent.toLowerCase().match(/iPad/i) == "ipad";  
-}  
-
-export function isWinPad() {  
-    return navigator.userAgent.indexOf("Windows NT") >= 0;  
-}  
-
-export default {
-	isAndroid,
-	isIOS,
-	isPad,
-	isWinPad
-}

+ 34 - 25
utils/util.js

@@ -891,35 +891,44 @@ export default {
 				return;
 			}
 			// #endif
+			const bool = await this.doGetLocation();
 
-			this.doGetLocation();
+			return bool
 		},
 		doGetLocation() {
-			uni.getLocation({
-				success: (res) => {
-					uni.removeStorageSync('CACHE_LONGITUDE');
-					uni.removeStorageSync('CACHE_LATITUDE');
-					uni.setStorageSync('CACHE_LONGITUDE', res.longitude);
-					uni.setStorageSync('CACHE_LATITUDE', res.latitude);
-				},
-				fail: (err) => {
-					// #ifdef MP-BAIDU
-					if (err.errCode === 202 || err.errCode === 10003) { // 202模拟器 10003真机 user deny
-						this.openSetting();
-					}
-					// #endif
-					// #ifndef MP-BAIDU
-					if (err.errMsg.indexOf("auth deny") >= 0) {
-						uni.showToast({
-							title: i18n.t(`访问位置被拒绝`)
-						})
-					} else {
-						uni.showToast({
-							title: err.errMsg
-						})
+			console.log('开始获取地址权限');
+			return new Promise((resolve, reject) => {
+				uni.getLocation({
+					success: (res) => {
+						console.log('获取成功');
+						uni.removeStorageSync('CACHE_LONGITUDE');
+						uni.removeStorageSync('CACHE_LATITUDE');
+						uni.setStorageSync('CACHE_LONGITUDE', res.longitude);
+						uni.setStorageSync('CACHE_LATITUDE', res.latitude);
+						resolve(true)
+					},
+					fail: (err) => {
+						console.log('获取失败');
+						// #ifdef MP-BAIDU
+						if (err.errCode === 202 || err.errCode ===
+							10003) { // 202模拟器 10003真机 user deny
+							this.openSetting();
+						}
+						// #endif
+						// #ifndef MP-BAIDU
+						if (err.errMsg.indexOf("auth deny") >= 0) {
+							uni.showToast({
+								title: i18n.t(`访问位置被拒绝`)
+							})
+						} else {
+							uni.showToast({
+								title: err.errMsg
+							})
+						}
+						// #endif
+						resolve(false)
 					}
-					// #endif
-				}
+				})
 			})
 		},
 		getSetting: function() {

+ 0 - 251
utils/wxAuthorized.js

@@ -1,251 +0,0 @@
-import {
-	wechatConfig,
-	share
-} from '@/api/wx';
-// 加载日志
-import * as log from './log.js'
-import {
-	isAndroid
-} from './platform.js'
-import store from '../store';
-// 保存wx对象
-import weixinObj from "@/plugin/jweixin-module/index.js";
-// 保存分享数据
-let shareData = '';
-// 保存注册返回appId数据
-let appId = '';
-//保存路由对象
-let router = '';
-//微信登录
-/**
- * @param {string} 当前页面地址信息
- */
-export async function loginWinxin() {
-	console.log('1');
-	let pages, page, path;
-	if (!router) {
-		router = await setRouter();
-	}
-	try {
-		pages = getCurrentPages();
-		// 获取跳转前页面
-		page = pages[pages.length - 1];
-		// 获取跳转前路由地址
-		path = page.route;
-	} catch (e) {
-		console.log(e);
-		//TODO handle the exception
-	}
-	// 判断是否在登录页
-	if (path != 'pages/public/redirect') {
-		log.addLog('开始注册微信')
-		weixindata().then(() => {
-			// 调用
-			try {
-				weixinSq();
-			} catch (e) {
-				console.log(e);
-				//TODO handle the exception
-			}
-		});
-	}
-};
-// 微信授权登录
-function weixinSq() {
-	// 微信授权后跳转页面
-	try {
-		// 判断是否真实路由模式
-		const type = router.mode === "history"?'':'/#'
-		let ul = encodeURIComponent(store.state.baseURL + store.state.urlFile +type+ '/pages/public/redirect');
-		// 打开微信授权页面
-		let url =
-			'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
-			appId +
-			'&redirect_uri=' +
-			ul +
-			'&response_type=code&scope=snsapi_userinfo&state=' +
-			new Date().getTime() +
-			'#wechat_redirect';
-		window.location.href = url;
-	} catch (e) {
-		console.log(e);
-		//TODO handle the exception
-	}
-};
-
-// 微信注册
-export async function weixindata(config) {
-	let url;
-	try {
-		// 判断是否存在router
-		if (!router) {
-			router = await setRouter();
-		}
-		if (router.mode === "history") {
-			// 在ios中时候注册为微信刚进入时候的页面
-			if (!window.entryUrl) {
-				window.entryUrl = location.href.split('#')[0]
-			}
-			url = isAndroid() ? location.href.split('#')[0] : window.entryUrl;
-		}
-		if (router.mode === "hash") {
-			url = location.href.split('#')[0];
-		}
-		log.addLog('注册开始', url)
-		console.log('开始注册', url);
-
-	} catch (e) {
-		console.log('错误', e);
-	}
-	return new Promise((ok, error) => {
-		try {
-			//注册微信信息
-			wechatConfig({
-					url
-				})
-				.then(({
-					data
-				}) => {
-					try {
-						// 保存appId
-						appId = data.appId
-						// 微信信息配置
-						weixinObj.config({
-							debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-							appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
-							timestamp: data.timestamp, // 必填,生成签名的时间戳
-							nonceStr: data.nonceStr, // 必填,生成签名的随机串
-							signature: data.signature, // 必填,签名,见附录1
-							jsApiList: data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-						});
-						weixinObj.ready((e) => {
-							log.addLog("注册完毕", data)
-							console.log('注册完毕');
-							ok(data,weixinObj)
-						})
-					} catch (e) {
-						console.log(e)
-					}
-				})
-				.catch(e => {
-					error(e);
-					console.log(e);
-				});
-		} catch (e) {
-			console.log(e);
-			//TODO handle the exception
-		}
-	})
-}
-
-// 判断分享调用方法
-export function shareLoad(config) {
-	console.log('开始调用分享')
-	try {
-		weixindata().then((e) => {
-			// 判断有无自定义数据
-			if (config) {
-				shareFun(config)
-			} else {
-				// 判断是否已经缓存了默认数据
-				if (shareData) {
-					shareFun()
-				} else {
-					// 请求获取默认数据
-					share({}).then(({
-						data
-					}) => {
-						shareData = data.data
-						shareFun()
-					});
-				}
-			}
-		})
-	} catch (e) {
-		console.log('报错', e)
-		//TODO handle the exception
-	}
-}
-// 配置分享数据
-function shareFun(config) {
-	try {
-		console.log('再付分享内容', config);
-		let mess;
-		if (config) {
-			mess = {
-				link: config.link, // 分享链接
-				imgUrl: config.imgUrl,
-				desc: config.desc,
-				title: config.title,
-				success: config.success || function(e) {
-					console.log(e);
-				},
-				fail: config.fail || function(e) {
-					console.log(e);
-				}
-			}
-		} else {
-			const userInfo = uni.getStorageSync('userInfo')
-			console.log(userInfo);
-			const url = window.location.href + '?spread=' + userInfo.uid;
-			url = url.replace(/[\?,&]{0,1}from=singlemessage/g, '');
-			mess = {
-				title: shareData.title,
-				link: url, // 分享链接
-				imgUrl: shareData.img, // 分享图标
-				desc: shareData.synopsis,
-				success: function() {
-					// uni.showModal({
-					// 	title: '分享',
-					// 	content: '分享成功',
-					// 	showCancel: false,
-					// 	success: res => {
-					//    console.log('分享成功回调接口');
-					// 	},
-					// 	fail: () => {},
-					// 	complete: () => {}
-					// });
-				}
-			}
-		}
-		// 获取仓库数据
-		// 分享好友
-		weixinObj.updateAppMessageShareData(mess);
-
-		// 分享朋友圈
-		weixinObj.updateTimelineShareData(mess)
-	} catch (e) {
-		console.log(e);
-		//TODO handle the exception
-	}
-}
-
-// 保存路由对象
-export function setRouter(route) {
-	return new Promise((ok, err) => {
-		router = getApp().$router;
-		console.log(router,'开始数据');
-		if (!router) {
-			const set = setInterval(() => {
-				router = getApp().$router;
-				console.log(router,'返回数据');
-				if (router) {
-					console.log(router,'结束');
-					clearInterval(set)
-					ok(router)
-				}
-			}, 100);
-		}else{
-			console.log(router,'成功');
-			ok(router)
-		}
-	})
-}
-
-export default {
-	weixinObj,
-	shareData,
-	appId,
-	setRouter,
-	shareLoad
-}

Some files were not shown because too many files changed in this diff