Explorar o código

1.历史消费,

guo %!s(int64=2) %!d(string=hai) anos
pai
achega
c217dbe8b3
Modificáronse 6 ficheiros con 365 adicións e 285 borrados
  1. 27 0
      pages.json
  2. 161 0
      pages/user/checkReport.vue
  3. 20 256
      pages/user/historyDetail.vue
  4. 18 12
      pages/user/historySpend.vue
  5. 27 0
      pages/user/reportDetail.vue
  6. 112 17
      pages/user/user.vue

+ 27 - 0
pages.json

@@ -23,6 +23,33 @@
                 "enablePullDownRefresh": true
             }
             
+        },
+		{
+		    "path" : "pages/user/historyDetail",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "消费明细",
+		        "enablePullDownRefresh": true
+		    }
+		    
+		}
+        ,{
+            "path" : "pages/user/checkReport",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "车检报告",
+                "enablePullDownRefresh": true
+            }
+            
+        }
+        ,{
+            "path" : "pages/user/reportDetail",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "检测报告",
+                "enablePullDownRefresh": false
+            }
+            
         }
     ],
 	"tabBar": {

+ 161 - 0
pages/user/checkReport.vue

@@ -0,0 +1,161 @@
+<template>
+	<view class="box">
+		<view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.ID)">
+			<view class="time">2021-09-03</view>
+			<view class="carPlate">
+				<view class="plate">鲁A12345</view>
+				<view class="mileage">1000km</view>
+			</view>
+
+			<view class="shopName">丰田 卡罗拉 2021款 1.2T 无极</view>
+			<view class="itemContent">这是门店名称这是门店名称这是门店名称这是门店名称这是...</view>
+		</view>
+
+		<!-- 上拉 加载更多 -->
+		<view class="noMore" v-if="noMoreShow">没有更多数据</view>
+		<!-- 无数据空白页 -->
+		<nodata v-if="itemData.length==0"></nodata>
+
+	</view>
+</template>
+
+<script>
+	import nodata from '../../components/nodata/nodata.vue'
+	export default {
+		components: {
+			nodata,
+		},
+
+		data() {
+			return {
+				page: 1,
+				itemData: [1, 2, 3],
+				noMoreShow: false,
+			}
+		},
+		onLoad() {
+			this.page = 1
+			// this.myOrderCoupon()
+		},
+		methods: {
+			goDetail(id) {
+				uni.navigateTo({
+					url: 'reportDetail?id=' + id
+				})
+			},
+			myOrderCoupon() {
+				uni.showLoading({
+					title: '加载中'
+				})
+				this.$http('worldKeepCar/keepCarMy/listTCouponPage', {
+
+					page: this.page,
+					limit: 10,
+				}, 'GET').then(res => {
+					uni.hideLoading();
+					var list = res.data.Items
+
+					// 处理 undefined和null转为空白字符串
+					list.forEach((item, index) => {
+						for (const key in item) {
+							item[key] = this.$praseStrEmpty(item[key])
+						}
+					})
+
+					if (this.page == 1) {
+						this.itemData = list
+					} else {
+						this.itemData = this.itemData.concat(list)
+					}
+
+					if (list.length < 10) {
+						this.noMoreShow = true
+					} else {
+						this.noMoreShow = false
+					}
+
+					if (this.itemData.length != 0) {
+						this.itemData.forEach((item, index) => {
+							if (item.pickNum <= 0) {
+								this.allHave = false
+							}
+						})
+					}
+
+
+
+				})
+			},
+
+
+		},
+
+		// 下拉刷新 上拉加载更多
+		onPullDownRefresh() {
+			this.page = 1
+			this.myOrderCoupon()
+			setTimeout(function() {
+				uni.stopPullDownRefresh();
+			}, 1000);
+		},
+		onReachBottom() {
+			this.page++;
+			this.myOrderCoupon()
+		},
+	}
+</script>
+
+<style>
+	.box {
+		min-height: 100vh;
+		background-color: #F4F5F7;
+		padding-top: 20rpx;
+	}
+
+	.itemHistory {
+		margin: 0rpx 24rpx 20rpx;
+		padding: 20rpx;
+		background-color: #FFFFFF;
+		border-radius: 10rpx;
+
+	}
+
+	.time {
+		font-size: 24rpx;
+		color: #999999;
+	}
+
+	.carPlate {
+		margin: 20rpx 0rpx 15rpx;
+		display: flex;
+		align-items: center;
+		justify-content: flex-start;
+	}
+
+	.plate {
+		font-size: 30rpx;
+		color: #3C3C3C;
+		font-weight: bold;
+		margin-right: 20rpx;
+	}
+
+	.mileage {
+		font-size: 24rpx;
+		color: #F19D01;
+		padding: 0rpx 10rpx;
+		border: 1rpx solid #F19D01;
+		border-radius: 4rpx;
+		height: 36rpx;
+	}
+
+	.shopName,
+	.itemContent {
+		color: #666666;
+		font-size: 24rpx;
+		margin: 15rpx 0rpx;
+		/* 隐藏文字显示 ...不换行 */
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+	}
+</style>

+ 20 - 256
pages/user/historyDetail.vue

@@ -41,37 +41,37 @@
 		<!-- 订单信息 -->
 		<view class="information">
 			<view class="carMes">
-				<view class="plate">鲁A12345</view>
-				<view class="mileage">1000km</view>
+				<view class="plate">{{orderData.billsheet.PlateNumber}}</view>
+				<view class="mileage">{{orderData.billsheet.CurrentMileage}}km</view>
 			</view>
 			<view class="informationLine">
 				<view class="informationTxt">姓名:</view>
-				<view class="informationNum">{{orderData.Code}}</view>
+				<view class="informationNum">{{orderData.billsheet.CustomerName}}</view>
 			</view>
 			<view class="informationLine">
 				<view class="informationTxt">手机号:</view>
-				<view class="informationNum">{{orderData.MemberName}}</view>
+				<view class="informationNum">{{orderData.billsheet.MobilePhone}}</view>
 			</view>
 			<view class="informationLine">
 				<view class="informationTxt">单号:</view>
-				<view class="informationNum">{{orderData.CreateTime}}</view>
+				<view class="informationNum">{{orderData.billsheet}}no</view>
 			</view>
 			<view class="informationLine">
 				<view class="informationTxt">接车时间:</view>
-				<view class="informationNum">{{orderData.Comment}}</view>
+				<view class="informationNum">{{orderData.billsheet.time}}</view>
 			</view>
 			<view class="informationLine">
 				<view class="informationTxt">服务顾问:</view>
-				<view class="informationNum" v-if="orderData.ConfirmTime != null">{{orderData.ConfirmTime}}</view>
+				<view class="informationNum">{{orderData.billsheet}}no</view>
 			</view>
 
 		</view>
 
 		<!-- 项目明细 -->
-		<view class="detailedBox itemBox" v-if=" orderData.items.length!=0">
+		<view class="detailedBox itemBox" v-if=" orderData.listItems.length!=0">
 			<view class="detailedTitle">项目</view>
 			<view class="detailedLineBox">
-				<view class="detailedLine" v-for="(item,index) in orderData.items">
+				<view class="detailedLine" v-for="(item,index) in orderData.listItems">
 
 					<view class="detailedCont">
 						<view class="detailedName">{{item.ItemName}}项目名称</view>
@@ -83,10 +83,10 @@
 
 
 		<!-- 商品明细-->
-		<view class="detailedBox itemBox" v-if="orderData.goods.length!=0">
+		<view class="detailedBox itemBox" v-if="orderData.listParts.length!=0">
 			<view class="detailedTitle">商品</view>
 			<view class="detailedLineBox">
-				<view class="detailedLine" v-for="(item,index) in orderData.goods">
+				<view class="detailedLine" v-for="(item,index) in orderData.listParts">
 
 					<view class="detailedCont">
 						<view class="detailedName">{{item.GoodsName}}商品名称</view>
@@ -107,28 +107,18 @@
 		data() {
 			return {
 				location: '',
-				isload: false,
 				id: '',
 				orderData: '',
-				type: '',
+				
 
-				ifShow: false,
-
-				timeShow: false,
-				orderTime: '',
-				OrderTimes: '',
-				orderTimeIndex1: 0,
-				orderTimeIndex2: -1,
-				isShowMa: true,
-				noClick: true,
 			}
 		},
 		onLoad(opt) {
-			// this.location = uni.getStorageSync("locationCity");
-			// this.id = opt.id
+			this.location = uni.getStorageSync("locationCity");
+			this.id = opt.id
+			
+			this.getData()
 			
-			// this.getData()
-			// this.type = opt.type;
 
 		},
 		onShow() {
@@ -137,75 +127,7 @@
 			}
 		},
 		methods: {
-			refundDetail() {
-				uni.navigateTo({
-					url: '../refundMoney/refundMoneyDetail?id=' + this.orderData.AfterServiceID
-
-				})
-			},
-			changeDetail() {
-				uni.navigateTo({
-					url: '../changeStore/changeStoreDetail?id=' + this.orderData.ChangeShopID
-				})
-			},
-			changeStore() {
-				// 是否可以更换门店
-				this.haveChangeStore();
-			},
-			haveChangeStore() {
-				uni.showLoading({
-					title: '加载中'
-				});
-
-				this.$http('worldKeepCar/orderChangeShop/queryIfConChangeShop', {
-					sheetId: this.id,
-
-				}, 'GET').then(res => {
-					uni.hideLoading();
-					if (res.code == 1) {
-
-						uni.showModal({
-							title: '提示',
-							showCancel: false,
-							content: res.msg,
-							success: function(res) {
-
-
-							}
-						});
-					} else if (res.code == 0) {
-						uni.navigateTo({
-							url: '../changeStore/changeStore?sheetId=' + this.id + '&oldShopID=' + this
-								.orderData.ShopID + '&oldStoreName=' + this
-								.orderData.ShopName + '&oldStoreAddress=' + this.orderData.ProvinceName +
-								this.orderData.CityName + this.orderData.AreaName + this.orderData
-								.Address + '&brand=' + this.orderData.Brand
-						})
-					}
-
-				})
-			},
-			showMa() {
-				this.isShowMa = !this.isShowMa
-			},
-			gopingjia() {
-				uni.navigateTo({
-					url: '../me/myAppraiseDetail?id=' + this.id
-				})
-			},
-			timeShowClick() {
-				if (this.OrderTimes) {
-					this.timeShow = true
-				} else {
-					uni.showToast({
-						title: '当前店铺尚未设置可预约时间',
-						icon: 'none',
-						duration: 3000
-					});
-				}
-
-			},
-
+			
 			map() {
 				console.log("打开地图")
 				var that = this;
@@ -252,7 +174,7 @@
 					uni.hideLoading();
 					this.orderData = res.data;
 
-					this.getOrderTimes();
+					
 				})
 			},
 			goback() {
@@ -261,168 +183,10 @@
 
 
 			},
-			evaluate() {
-				uni.navigateTo({
-					url: 'evaluate?sheetID=' + this.id + '&shopID=' + this.orderData.ShopID
-				})
-			},
-
-			cancelOrder() {
-				var that = this;
-				uni.showModal({
-					title: '提示',
-					content: '确定要取消订单吗',
-					success: function(res) {
-						if (res.confirm) {
-							uni.showLoading({
-								title: '取消中'
-							})
-							that.$http('worldKeepCar/keepCarMy/cancelMiNiTMSheet', {
-								id: that.orderData.ID
-							}, 'POST').then(res => {
-								uni.hideLoading();
-
-
-								uni.showModal({
-									title: '提示',
-									content: '订单取消成功',
-									showCancel: false,
-									success: function(res) {
-										that.getData()
-									}
-								});
-							})
-						} else if (res.cancel) {
-
-						}
-					}
-				});
-			},
-			refundMoney() {
-				console.log('退款');
-
-
-				// 是否可以退款
-				this.haveRefundMoney();
-			},
-			haveRefundMoney() {
-				uni.showLoading({
-					title: '加载中'
-				});
-
-				this.$http('worldKeepCar/orderRefund/queryIfConRefund', {
-					sheetId: this.id,
-
-				}, 'GET').then(res => {
-					uni.hideLoading();
-					if (res.code == 1) {
-
-						uni.showModal({
-							title: '提示',
-							showCancel: false,
-							content: res.msg,
-							success: function(res) {
-
-
-							}
-						});
-					} else if (res.code == 0) {
-
-						uni.navigateTo({
-							url: '../refundMoney/refundMoney?sheetId=' + this.id + '&maxMoney=' + this
-								.orderData.PayMoney
-
-						})
-					}
-
-				})
-			},
-			orderPay() {
-				uni.showLoading({
-					title: '支付中'
-				})
-				var that = this;
-				this.$http('worldKeepCar/maintainOrder/orderPay', {
-					sheetID: this.orderData.ID
-				}, 'POST').then(res => {
-					uni.hideLoading();
-					if (res.isPay == 0) {
-						uni.showToast({
-							title: '支付成功',
-							icon: 'none',
-							duration: 2000
-						});
-						that.getData()
-					} else {
-						var payInfo = JSON.parse(res.data.payInfo)
-						uni.requestPayment({
-							provider: 'wxpay',
-							// timeStamp: String(Date.now()),
-							timeStamp: payInfo.timeStamp,
-							nonceStr: payInfo.nonceStr,
-							package: payInfo.package,
-							signType: payInfo.signType,
-							paySign: payInfo.paySign,
-							success: function(res) {
-								console.log('success:' + JSON.stringify(res));
-								uni.showToast({
-									title: '支付成功',
-									icon: 'none',
-									duration: 2000
-								});
-								that.getData()
-							},
-							fail: function(err) {
-								console.log('fail:' + JSON.stringify(err));
-
-							}
-						});
-					}
-				})
-			},
-			timeSfCk(item, index) {
-				if (item.type == 1) {
-					this.orderTimeIndex2 = index;
-					var orderTime = this.OrderTimes[this.orderTimeIndex1].date + ' ' + item.time
-					this.orderTime = orderTime
-				}
-
-			},
-			timeCk() {
-				this.timeShow = false;
-				var urlStr = ''
-				if (this.orderData.OrderState == 1) {
-					urlStr = 'worldKeepCar/keepCarMy/saveOrderTime'
-				}
-				if (this.orderData.OrderState == 2) {
-					urlStr = 'worldKeepCar/keepCarMy/changeTSheetTime'
-				}
-				this.$http(urlStr, {
-					id: this.id,
-					orderTime: this.orderTime
-				}, 'POST').then(res => {
-					if (res.code == 0) {
-						uni.showToast({
-							title: '预约成功',
-							icon: 'none',
-							duration: 2000
-						});
-					}
-					this.getData()
-				})
-			},
-			getOrderTimes() {
-				this.$http('worldKeepCar/keepCarMy/getTSheetTimes', {
-					shopId: this.orderData.ShopID,
-					id: this.orderData.ID,
-				}, 'GET').then(res => {
-
-					this.OrderTimes = res.data;
-				})
-			}
+			
 		},
 		onPullDownRefresh() {
-			this.getOrderTimes()
+			
 			this.getData()
 			setTimeout(function() {
 				uni.stopPullDownRefresh();

+ 18 - 12
pages/user/historySpend.vue

@@ -1,14 +1,17 @@
 <template>
 	<view class="box">
 		<view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.ID)">
-			<view class="time">2021-09-03</view>
+			<view class="time">{{item.time}}</view>
 			<view class="carPlate">
-				<view class="plate">鲁A12345</view>
-				<view class="mileage">1000km</view>
+				<view class="plate">{{item.PlateNumber}}</view>
+				<view class="mileage">{{item.CurrentMileage}}km</view>
 			</view>
 
-			<view class="shopName">门店名称门店名称门店名称门店名称门店名称门店名称门店名称</view>
-			<view class="itemContent">商品 项目商品 项目商品 项目商品 项目商品 项目商品 项目商品 项目</view>
+			<view class="shopName">{{item.ShopName}}</view>
+			
+			<view class="itemContent" v-show="item.listItems.length != 0" v-for="(v,i) in item.listItems.">{{v.ItemName}},</view>
+			<view class="itemContent" v-show="item.listParts.length != 0" v-for="(v,i) in item.listParts.">{{v.GoodsName}},</view>
+			
 		</view>
 
 		<!-- 上拉 加载更多 -->
@@ -29,7 +32,7 @@
 		data() {
 			return {
 				page: 1,
-				itemData: [1, 2, 3],
+				itemData: [],
 				noMoreShow: false,
 			}
 		},
@@ -49,11 +52,12 @@
 				})
 				this.$http('worldKeepCar/keepCarMy/listTCouponPage', {
 
-					page: this.page,
-					limit: 10,
+					// page: this.page,
+					// limit: 10,
 				}, 'GET').then(res => {
 					uni.hideLoading();
-					var list = res.data.Items
+					// var list = res.data.Items
+					var list = res.data
 
 					// 处理 undefined和null转为空白字符串
 					list.forEach((item, index) => {
@@ -90,16 +94,18 @@
 
 		},
 
-		// 下拉刷新 上拉加载更多
+		// 下拉刷新 
 		onPullDownRefresh() {
 			this.page = 1
 			this.myOrderCoupon()
 			setTimeout(function() {
 				uni.stopPullDownRefresh();
 			}, 1000);
-		},
+		},
+		
+		// 上拉加载更多
 		onReachBottom() {
-			this.page++;
+			// this.page++;
 			this.myOrderCoupon()
 		},
 	}

+ 27 - 0
pages/user/reportDetail.vue

@@ -0,0 +1,27 @@
+<template>
+	<view>
+		<web-view :webview-styles="webviewStyles" src="http://dms.32che.cn/#/carOwner/Report/451F3ECA-8CD1-4722-A13F-0241B827A672"></web-view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				webviewStyles: {
+					progress: {
+						color: '#FF3333'
+					}
+				}
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 112 - 17
pages/user/user.vue

@@ -39,10 +39,9 @@
 
 		<!-- 我的订单 -->
 		<view class="orderBox">
-			<view class="orderTitleBg">
+			
 				<view class="orderTitle">我的订单</view>
 
-			</view>
 			<view class="orderLIneBox">
 				<view class="orderLine" @click="goorder(1)">
 					<view class="orderImgBox">
@@ -77,7 +76,29 @@
 			</view>
 		</view>
 
-
+			<!-- 店铺信息 -->
+			<view class="shopBox">
+				
+				<view class="shopCont">
+					<view class="shopName">{{orderData.ShopName}}这是门店名称</view>
+					<view class="shopRightBox">
+						<image src="../../static/img/icon_ditu.png" mode="" class="shopRightImg" style="margin-right: 67rpx;" @click="map"></image>
+						<image src="../../static/img/icon_phone.png" mode="" class="shopRightImg" @click="call"></image>
+					</view>
+			
+				</view>
+				<view class="shopTime">{{orderData.ShopName}}营业时间</view>
+				<view class="address">
+					<view class="Address">江苏省南京市鼓楼区铁路南街233
+						{{orderData.ProvinceName}}{{orderData.CityName}}{{orderData.AreaName}}{{orderData.Address}}
+					</view>
+					<view class="distance">1.8km</view>
+				</view>
+				
+				
+				
+			</view>
+			
 		
 			<!-- 我的 相关 -->
 			<view class="rowBoxBg">
@@ -116,7 +137,7 @@
 					<image src="../../static/img/rightArrow.png" mode="" class="rightArrow"></image>
 				</view>
 
-				<view class="rowBox" @click="gonavigateTo('invite')">
+				<view class="rowBox" @click="gonavigateTo('checkReport')">
 					<view class="leftView">
 						<image src="../../static/img/icon_me5.png" mode="" class="liftIcon"></image>
 						<view class="rowTitle">车检报告</view>
@@ -188,13 +209,39 @@
 					url: 'setup?phone=' + this.numList.tMember.phone + '&nickName=' + this.numList.tMember
 						.nickName + '&name=' + this.numList.tMember.name
 				})
+			},
+			map() {
+				console.log("打开地图")
+				var that = this;
+				if (!that.orderData.Lat || !that.orderData.Lng) {
+					uni.showToast({
+						title: '该店铺未设置定位',
+						icon: 'none',
+						duration: 3000
+					});
+				} else {
+					uni.openLocation({
+						latitude: Number(that.orderData.Lat),
+						longitude: Number(that.orderData.Lng),
+						name: that.orderData.ShopName,
+						address: that.orderData.Address,
+						success: function() {
+							console.log('success');
+						},
+						fail(err) {
+							console.log(err)
+						}
+					});
+				}
+			
+			},
+			
+			call() {
+				uni.makePhoneCall({
+					phoneNumber: this.orderData.MobilePhone
+				});
 			},
-			call(e) {
-				// console.log(e);
-				uni.makePhoneCall({
-					phoneNumber: e
-				});
-			},
+			
 			goorder(num) {
 				uni.navigateTo({
 					url: '../order/myorder?num=' + num
@@ -360,17 +407,13 @@
 		border-radius: 10rpx;
 	}
 
-	.orderTitleBg {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-	}
+	
 
 	.orderTitle {
 		font-size: 30rpx;
 		color: #333333;
 		font-weight: bold;
-		padding-left: 20rpx;
+		
 	}
 
 	.orderAll {
@@ -423,7 +466,9 @@
 		width: 30rpx;
 		height: 30rpx;
 
-	}
+	}
+	
+	
 
 	.rowBoxBg {
 
@@ -477,5 +522,55 @@
 		text-align: center;
 		
 		margin: 40rpx 24rpx;
+	}
+	.shopBox {
+	
+		
+		padding: 20rpx;
+		margin: 20rpx 24rpx;
+		
+		background-color: #FFFFFF;
+		border-radius: 10rpx;
+		
+	}
+	
+	.shopCont {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		
+	}
+	
+	.shopName {
+		font-size: 30rpx;
+		font-weight: bold;
+		color: #3C3C3C;
+		line-height: 42rpx;
+	}
+	.shopRightBox{
+		display: flex;
+		justify-content: space-between;
+	}
+	.address{
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
+	.Address,
+	.shopTime,
+	.distance{
+		color: #999999;
+		font-size: 24rpx;
+		padding-top: 15rpx;
+	}
+	
+	
+	
+	.shopRightBox {
+		
+	}
+	.shopRightImg {
+		width: 44rpx;
+		height: 45rpx;
 	}
 </style>