Browse Source

bug修改

1004749546@qq.com 4 years ago
parent
commit
e154989a08
1 changed files with 22 additions and 16 deletions
  1. 22 16
      pages/order/waitOrderDetail.vue

+ 22 - 16
pages/order/waitOrderDetail.vue

@@ -6,10 +6,10 @@
 				<view class="status-title flex align_center justify_center">
 					<u-icon class="icon" name="icon_service"
 					custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
-				{{orderInfo.orderStatusDictValue}}
+				{{orderInfo.orderStatusDictValue || '--'}}
 				</view>
 				<view class="status-care">
-					预约时间:{{orderInfo.reserveTime}}
+					预约时间:{{orderInfo.reserveTime || '--'}}
 				</view>
 			</view>
 			<!-- 回收品类明细 -->
@@ -30,13 +30,13 @@
 				</view>
 				<view v-if="list.length && list[curIndex].typeList.length" v-for="item in list[curIndex].typeList" :key="item.id" class="item flex justify_between align_center">
 					<view class="flex align_center">
-						<text>{{item.name}}</text>
-						<u-input :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="item.customerPrice" placeholder="" type="number" />
+						<text class="item-name">{{item.name}}</text>
+						<u-input type="digit" @input="numberToFixed(item,'customerPrice',2)" :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="item.customerPrice" placeholder="输入单价" />
 					</view>
 					<view class="flex flex_1 align_center">
-						<u-input input-align="center" :clearable="false" v-model="item.rubbishWeight" placeholder="请输入重量" type="number" />
+						<u-input type="digit" @input="numberToFixed(item,'rubbishWeight',2)" :custom-style="inputRightStyle" input-align="center" :clearable="false" v-model="item.rubbishWeight" placeholder="请输入重量" />
 					</view>
-					<view class="flex_1 flex align_center justify_center">{{item.customerPrice*item.rubbishWeight}}</view>
+					<view class="flex_1 flex align_center justify_center">{{item.totalAmount}}</view>
 				</view>
 			</view>
 			<!-- 金额 -->
@@ -47,7 +47,7 @@
 				</view>
 				<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>
+					<v-select class="flex_1" ref="payType" :disabled="true" placeholder="请选择支付方式" @itemChange="chooseType" code="ORDER_RESERVE_PAY_TYPE" style="width: 100%"></v-select>
 				</view>
 			</view>
 			<!-- 服务信息 -->
@@ -78,6 +78,7 @@
 	import { getLookUpDatas } from '@/api/data.js'
 	import { reservePriceFind } from '@/api/index.js'
 	import vSelect from '@/components/select/v-select.vue'
+	import {numberToFixed} from '@/libs/tools.js'
 	export default {
 		components: {
 			vSelect
@@ -88,11 +89,15 @@
 				totalPrice: 0, // 支付合计
 				orderReserveNo: '', // 订单号
 				inputLeftStyle: {
-					Width: '120rpx',
+					Width: '110rpx',
 					borderBottom: '1px solid #707070',
 					padding: '0rpx 10rpx',
 					color: '#191919'
 				},
+				inputRightStyle:{
+					padding: '0rpx 10rpx',
+					color: '#191919'
+				},
 				curType: '', // 当前类型
 				curIndex: 0, // 当前类型index
 				typeData: [], // 垃圾类型数据
@@ -147,6 +152,7 @@
 			  let ret = numberToFixed(val, num, 999999)
 			  this.$nextTick(() => {
 				item[key] = Number(ret)
+				item.totalAmount = (item.customerPrice * item.rubbishWeight).toFixed(2)
 			  })
 			},
 			// 获取订单详情
@@ -158,7 +164,7 @@
 					orderReserveNo: this.orderReserveNo
 				}).then(res => {
 					console.log(res,'rrrrrrrr')
-					if (res.status == 200) {
+					if (res.status == 200 && res.data) {
 						this.orderInfo = res.data
 						this.orderInfo.reserveTime = moment(this.orderInfo.confirmDate).format('YYYY-MM-DD') + this.orderInfo.reserveTimeTypeDictValue
 					} 
@@ -169,7 +175,6 @@
 			getRubbishType() {
 				this.list = []
 				getLookUpDatas({type:'RESERVE_RUBBISH_TYPE'}).then(res=>{
-					console.log(res,'------rrrrrr')
 					if(res.status == 200) {
 						this.typeData = res.data || []
 						this.typeData.map(k =>{
@@ -180,7 +185,7 @@
 							console.log(p,'pppppp')
 							this.list.push(p)
 						})
-						console.log(this.list,'this.list----------')
+						// console.log(this.list,'this.list----------')
 						this.curType = this.typeData.length ? this.typeData[0].code : ''
 						this.curIndex = 0
 						this.getRow()
@@ -201,11 +206,8 @@
 							item.rubbishWeight = ''
 							item.totalAmount = ''
 						})
-						this.$nextTick(()=>{
-							this.list[this.curIndex].typeList = data
-							console.log(this.list[this.curIndex].typeList,this.curIndex,'----------lllll22222222')
-						})
-						
+						this.list[this.curIndex].typeList = data
+						// console.log(this.list,'----this.list')
 					} else {
 						this.list[this.curIndex].typeList = []
 						this.total = 0
@@ -378,6 +380,10 @@
 					padding: 28rpx 0;
 					font-size: 32rpx;
 					border-bottom: 1px solid #EBEBEB;
+					.item-name{
+						width: 100rpx;
+						font-size: 28rpx;
+					}
 					:first-child{
 						color: #7C7D7E;
 					}