1004749546@qq.com 4 years ago
parent
commit
1bbe1b8767
4 changed files with 97 additions and 61 deletions
  1. 4 0
      pages/index/index.vue
  2. 17 6
      pages/order/finish.vue
  3. 49 50
      pages/order/hisOrderDetail.vue
  4. 27 5
      pages/order/waitOrderDetail.vue

+ 4 - 0
pages/index/index.vue

@@ -190,6 +190,9 @@
 			getList (lat,lng) {
 				// let lat = this.currentPosition.lat
 				// let lng = this.currentPosition.lng
+				uni.showLoading({
+					title: '加载中...'
+				})
 				waitOrderQuery({handleUserLng:lat,handleUserLat:lng}).then(res => {
 					console.log(res)
 					if(res.status == 200){
@@ -199,6 +202,7 @@
 							item.reserveTime = moment(item.confirmDate).format('YYYY-MM-DD') + item.reserveTimeType
 						})
 					}
+					uni.hideLoading()
 				})
 			},
 			// 今日统计

+ 17 - 6
pages/order/finish.vue

@@ -3,7 +3,10 @@
 		<view class="content-result">
 			<u-image src="/static/def_pay_success.png" width="250" height="180"></u-image>
 			<view class="result-yuyue">服务完成</view>
-			<view class="result-yuyueDetail" @click="seeDetail">返回首页</view>
+			<view class="money">
+				交易金额:{{money}}元
+			</view>
+			<view class="result-yuyueDetail" @click="backHome">返回首页</view>
 		</view>
 	</view>
 </template>
@@ -12,13 +15,16 @@
 	export default{
 		data(){
 			return{
-				
+				money: 0
 			}
 		},
+		onLoad(option) {
+			this.money = option.money
+		},
 		methods:{
-			seeDetail(){
-				uni.navigateTo({
-				    url: '/pages/index/yuyue'
+			backHome(){
+				uni.switchTab({
+				    url: '/pages/index/index'
 				})
 			}
 		}
@@ -36,12 +42,17 @@
 		padding: 0;
 		.content-result{
 			.result-yuyue{
-				margin: 40upx 0 140upx;
+				margin: 40upx 0 20upx;
 				font-size: 40upx;
 				font-family: PingFang SC;
 				font-weight: bold;
 				color: #222222;
 			}
+			.money{
+				font-size: 28rpx;
+				color: #666E75;
+				margin-bottom: 200rpx;
+			}
 			.result-yuyueDetail{
 				height: 80upx;
 				line-height: 80upx;

+ 49 - 50
pages/order/hisOrderDetail.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="order-pages">
+		<v-select v-show="false" ref="rubbishType" placeholder="" code="RESERVE_RUBBISH_TYPE" style="width: 100%"></v-select>
 		<view class="order-info">
 			<!-- 订单状态 -->
 			<view class="order-status">
@@ -8,7 +9,7 @@
 				{{orderInfo.orderStatusDictValue || '--'}}
 				</view>
 				<view class="status-care">
-					预约时间:2021-05-10 15:10:05
+					预约时间:{{orderInfo.reserveTime}}
 				</view>
 			</view>
 			<!-- 服务信息 -->
@@ -30,7 +31,7 @@
 			<view class="item-info">
 				<view class="item flex justify_between">
 					<text>预约品类</text>
-					<text>纸品类,金属类</text>
+					<text>{{typeNames}}</text>
 				</view>
 				<view class="item flex justify_between">
 					<text>预约重量</text>
@@ -48,38 +49,38 @@
 				</view>
 				<view class="item flex justify_between">
 					<text>下单时间</text>
-					<text>{{orderInfo.confirmDate}}</text>
+					<text>{{orderInfo.createDate}}</text>
 				</view>
 				<view class="item flex justify_between">
 					<text>服务时间</text>
-					<text>2021-04-19 15:33</text>
+					<text>{{orderInfo.finishDate}}</text>
 				</view>
 			</view>
 			<!-- 图片 -->
-			<view class="item-info">
+			<!-- <view class="item-info">
 				<view class="item-title flex justify_between">
 					<text>图片</text>
 				</view>
 				<view class="item flex">
 					<u-image class="img-icon" :src="item.icon?item.icon:'../../static/img/mddef.jpg'" border-radius="16" width="160" height="160"></u-image>
 				</view>
-			</view>
+			</view> -->
 			<!-- 回收品类明细 -->
 			<view class="item-info">
 				<view class="item-title flex justify_between">
 					<text>回收品类明细</text>
 				</view>
 				<view class="item flex">
-					<view class="item-type active">
-						纸质类
+					<view :class="['item-type', curType == item.code ? 'active' : '']" v-for="(item,index) in typeData" :key="item.id"  @click="curIndex=index" >
+						{{item.name}}
 					</view>
-					<view class="item-type">
+					<!-- <view class="item-type">
 						纸质类
-					</view>
+					</view> -->
 				</view>
-				<view class="item flex justify_between">
-					<text>黄纸1.24元/kg</text>
-					<text>5kg/6.20元</text>
+				<view v-for="item in typeData[curIndex].typeList" :key="item.id" class="item flex justify_between">
+					<text>{{item.typeName || '--'}} {{item.rubbishPrice || 0}}元/kg</text>
+					<text>{{item.rubbishWeight || 0}}kg/{{item.totalAmount || 0}}元</text>
 				</view>
 			</view>
 			<!-- 金额 -->
@@ -100,47 +101,18 @@
 <script>
 	import moment from 'moment'
 	import { orderDetailFind } from '@/api/order.js'
+	import vSelect from '@/components/select/v-select.vue'
 	export default {
+		components: {
+			vSelect
+		},
 		data() {
 			return {
-				orderInfo: {
-					id: '',
-					createDate: '2021-05-10 15:22',
-					orderStateDictValue: '已完成',
-					storeName: '昆仑润滑·车领主 (西咸新区-...',
-					location: '2.9km',
-					orderState:'WAIT_PAY',
-					type: [
-						{
-							name:'纸质类',
-							id: '1'
-						},
-						{
-							name:'衣物类',
-							id: '12'
-						}
-					],
-					orderGoodsList: [
-						{
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-						},
-						{
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-						},
-					],
-					payGold: 450
-				},
-				totalPrice: 0, // 支付合计
-				password: '', // 支付密码
+				orderInfo: {},
 				orderReserveNo: '', // 订单no
+				typeData: [], // 订单包含类型数据
+				typeNames: '', // 预约品类名称
+				curIndex: 0 // 当前类型下标
 			}
 		},
 		onLoad(options) {
@@ -161,13 +133,40 @@
 		methods: {
 			// 获取订单详情
 			getOrderDetail() {
+				uni.showLoading({
+					title: '加载中...'
+				})
+				this.typeData = []
+				this.typeNames = ''
 				orderDetailFind({
 					orderReserveNo: this.orderReserveNo
 				}).then(res => {
 					console.log(res,'rrrrrrrr')
 					if (res.status == 200) {
 						this.orderInfo = res.data
+						this.orderInfo.reserveTime = moment(this.orderInfo.confirmDate).format('YYYY-MM-DD') + this.orderInfo.reserveTimeType
+						let data = this.$refs.rubbishType.getDataList()
+						// 重组类型数据
+						data.map(k =>{
+							let arr = this.orderInfo.orderReserveItemEntityList.filter(item=>{
+								return item.rubbishType == k.code
+							})
+							console.log(arr,'dddd')
+							if(arr.length) {
+								let p = {
+									typeCode: k.code,
+									name: k.dispName,
+									typeList: arr
+								}
+								this.typeData.push(p)
+								console.log(p,this.typeData,'pppppp')
+							}
+						})
+						this.typeData.map(item=>{
+							this.typeNames = (this.typeNames ? (this.typeNames + ','):'') + item.name
+						})
 					} 
+					uni.hideLoading()
 				})
 			},
 			

+ 27 - 5
pages/order/waitOrderDetail.vue

@@ -8,7 +8,7 @@
 				{{orderInfo.orderStatusDictValue}}
 				</view>
 				<view class="status-care">
-					预约时间:2021-05-10 15:10:05
+					预约时间:{{orderInfo.reserveTime}}
 				</view>
 			</view>
 			<!-- 回收品类明细 -->
@@ -50,10 +50,8 @@
 				<view class="item flex justify_between">
 					<text>支付方式</text>
 					<v-select class="flex_1" ref="payType" placeholder="请选择支付方式" @itemChange="chooseType" code="ORDER_RESERVE_PAY_TYPE" style="width: 100%"></v-select>
-					<!-- <vSelect :code="ORDER_RESERVE_PAY_TYPE"></vSelect> -->
+					<u-icon name="arrow-right" color="#9DA8B5" size="28"></u-icon>
 				</view>
-				<!-- <view class="item">
-				</view> -->
 			</view>
 			<!-- 服务信息 -->
 			<view class="info-main flex flex_column">
@@ -136,13 +134,18 @@
 		methods: {
 			// 获取订单详情
 			getOrderDetail() {
+				uni.showLoading({
+					title: '加载中...'
+				})
 				orderDetailFind({
 					orderReserveNo: this.orderReserveNo
 				}).then(res => {
 					console.log(res,'rrrrrrrr')
 					if (res.status == 200) {
 						this.orderInfo = res.data
+						this.orderInfo.reserveTime = moment(this.orderInfo.confirmDate).format('YYYY-MM-DD') + this.orderInfo.reserveTimeType
 					} 
+					uni.hideLoading()
 				})
 			},
 			// 获取垃圾类型数据
@@ -200,6 +203,10 @@
 			},
 			// 提交
 			submit() {
+				// uni.redirectTo({
+				// 	url: '/pages/order/finish?money=' + 12
+				// })
+				// return
 				let arr = []
 				this.list.map(item =>{
 					item.typeList.map(k =>{
@@ -215,6 +222,20 @@
 						}
 					})
 				})
+				if(arr.length==0) {
+					uni.showToast({
+						title: '请先输入回收品类的重量!',
+						icon: 'none'
+					})
+					return
+				}
+				if (!this.payType) {
+					uni.showToast({
+						title: '请选择支付方式!',
+						icon: 'none'
+					})
+					return
+				}
 				let params = {
 					"payType": this.payType, //支付方式
 					originalAmount: this.originalAmount, // 支付总金额
@@ -228,7 +249,8 @@
 				orderSubmit(params).then(res=>{
 					if(res.status == 200) {
 						uni.showToast({
-							title: res.message
+							title: res.message,
+							icon: 'none'
 						})
 						uni.redirectTo({
 							url: '/pages/order/finish?money=' + res.data