lilei 2 years ago
parent
commit
6ad93505e6

+ 11 - 0
pages/digitalShelf/choosePart.vue

@@ -156,6 +156,9 @@
 					<u-image width="44" height="44" :src="`/static/icon_shopping@3x.png`"></u-image>
 				</div>
 			</div>
+			<view v-if="showPrice[1]=='CAR_OWNER_PRICE'&&totalAmount">
+				合计:<text>¥{{totalAmount}}</text>
+			</view>
 			<div>
 				<u-button type="primary" :loading="saveLoading" @click="submitForm" :custom-style="{background:'#066cff',fontSize:'32rpx'}" shape="circle">立即提交</u-button>
 			</div>
@@ -260,6 +263,13 @@
 				})
 				return ret
 			},
+			totalAmount(){
+				let ret = 0
+				this.partListData.map(item => {
+					ret = ret + item.price||0
+				})
+				return ret.toFixed(2)
+			},
 			dealerPhone(){
 				const shelfInfo = this.$store.state.vuex_storeShelf
 				return shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
@@ -582,6 +592,7 @@
 					saveShelfOrder(params).then(res => {
 						console.log(res,'saveShelfOrder')
 						if(res.status == 200){
+							res.data.shelfOrder.remindMessage = '请在货架上按照指定位置拿取配件'
 							// 提交成功
 							uni.redirectTo({
 								url:"/pages/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify(res.data))+"&state=1"

+ 4 - 4
pages/digitalShelf/choosePartResult.vue

@@ -9,11 +9,11 @@
 						<text>{{statusText}}</text>
 					</view>
 					<view class="messageText" v-html="info&&info.shelfOrder&&info.shelfOrder.remindMessage||''"></view>
-					<view class="button-group">
+					<!-- <view class="button-group"> -->
 						<!-- <button :hover-stop-propagation="true" @click="toScan" v-if="state == 1&&partList.length" class="back" size="mini">扫码取货</button> -->
-						<button :hover-stop-propagation="true" :loading="loading" @click="onceQh" v-if="state == 1&&partList.length" class="action" size="mini">一键取货</button>
+						<!-- <button :hover-stop-propagation="true" :loading="loading" @click="onceQh" v-if="state == 1&&partList.length" class="action" size="mini">一键取货</button> -->
 						<!-- <button :hover-stop-propagation="true" @click="toSettle" v-if="state == 0" class="actionFail" size="mini">去结算</button> -->
-					</view>
+					<!-- </view> -->
 				</view>
 			</view>
 		</view>
@@ -268,7 +268,7 @@
 					text{
 						color: #ffaa00;
 					}
-					padding: 10rpx 0;
+					padding: 20rpx 0 10rpx;
 				}
 				.button-group{
 					padding: 20rpx 0;

+ 13 - 6
pages/digitalShelf/orderDetail.vue

@@ -1,17 +1,17 @@
 <template>
 	<view class="orderDetail-digitalShel flex flex_column">
-		<view class="contHead">
+		<view class="contHead" :style="{background:state== 'FINISH'?'#1283d4':'#ff5500',color:'#fff'}">
 			<view class="statusH">
 				<view class="flex flex_column align_center">
 					<view class="status-row">
-						<u-icon :name="statusIcon" size="42" color="#333"> 
+						<u-icon :name="statusIcon" size="42" color="#fff"> 
 						</u-icon>
 						<text>{{statusText}}</text>
 					</view>
 					<view class="messageText">{{statusMessage}}</view>
 				</view>
 			</view>
-			<view class="flex align-center orderTj" v-if="info">
+			<!-- <view class="flex align-center orderTj" v-if="info">
 				<view>
 					<view class="redText">{{info.totalQty}}</view>
 					<view>总数量</view>
@@ -20,7 +20,7 @@
 					<view>{{info.confirmQty}}</view>
 					<view>已取货</view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		<view class="order-body">
 			<!-- 头部车辆信息 -->
@@ -63,7 +63,7 @@
 						<view class="item-head">
 							<view>
 								数量:<text class="redText">{{item.totalQty}}</text>
-								已取:<text>{{item.confirmQty}}</text>
+								<!-- 已取:<text>{{item.confirmQty}}</text> -->
 							</view>
 							<text class="item-no">{{item.shelfPlaceCode}}</text>
 						</view>
@@ -120,13 +120,20 @@
 			   statusIcon: '', // 结算状态icon
 			   statusMessage: '',
 			   partList: [], // 配件列表
-			   shelfOrderSn: null
+			   shelfOrderSn: null,
+			   state: ''
 		   }
 	   },
 	   onReady() {
 	   },
 	   onLoad(option) { 
 		  this.shelfOrderSn = option.shelfOrderSn
+		  this.state = option.state
+		  // 更改标题栏背景色
+		  uni.setNavigationBarColor({
+		  	frontColor: '#ffffff',
+		  	backgroundColor: option.state== 'FINISH' ? '#1283d4':'#ff5500',
+		  })
 	   },
 	   onShow() {
 	   	this.getDetail()

+ 10 - 10
pages/digitalShelf/orderList.vue

@@ -54,7 +54,7 @@
 									 <view style="text-align: right;">
 										 <button :hover-stop-propagation="true" @click.stop="deleteRow(item,index)" v-if="item.billState != 'CLOSE'&&item.settleState=='WAIT'" class="action del" size="mini">取消订单</button>
 										 <!-- <button :hover-stop-propagation="true" @click.stop="sanCodeRow(item)" v-if="item.billState == 'WAIT'" class="action finish" size="mini">扫码取货</button> -->
-										 <button :hover-stop-propagation="true" @click.stop="onceQh(item,index)" :loading="loading" v-if="item.billState == 'WAIT'" class="action finish" size="mini">一键取货</button>
+										 <!-- <button :hover-stop-propagation="true" @click.stop="onceQh(item,index)" :loading="loading" v-if="item.billState == 'WAIT'" class="action finish" size="mini">一键取货</button> -->
 									 </view>
 								 </view>
 							 </view>
@@ -82,19 +82,19 @@
 				status: 'loading',
 				noDataText: '暂无数据',
 				tabList: [
-					  {
-						  dispName: '待取货',
-						  typeId: 1,
-						  count: 0
-					   },
+					  // {
+						 //  dispName: '待取货',
+						 //  typeId: 1,
+						 //  count: 0
+					  //  },
 					  {
 					    dispName: '已取货',
-					  	typeId: 2,
+					  	typeId: 1,
 						count: 0
 					  },
 					  {
 					    dispName: '已取消',
-					  	typeId: 3,
+					  	typeId: 2,
 						count: 0
 					  },
 				  ],
@@ -184,7 +184,7 @@
 			    this.pageNo = pageNo
 			  }
 			  // 状态条件
-			  const state = ['WAIT','FINISH','CLOSE']
+			  const state = ['FINISH','CLOSE']
 			  let params = {
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
@@ -213,7 +213,7 @@
 			// 详细页
 			viewRow(item){
 				uni.navigateTo({
-					url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+item.shelfOrderSn
+					url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+item.shelfOrderSn+"&state="+['FINISH','CLOSE'][this.swiperCurrent]
 				})
 			},
 			// 删除

+ 10 - 3
pages/digitalShelf/tempOrderList/orderDetail.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="orderDetail-digitalShel flex flex_column">
-		<view class="contHead">
+		<view class="contHead" :style="{background:state== 0?'#1283d4':'#06ab50',color:'#fff'}">
 			<view class="statusH">
 				<view class="flex flex_column align_center">
 					<view class="status-row">
-						<u-icon :name="statusIcon" size="42" color="#333"> 
+						<u-icon :name="statusIcon" size="42" color="#ffffff"> 
 						</u-icon>
 						<text>{{statusText}}</text>
 					</view>
@@ -96,13 +96,20 @@
 			   statusIcon: '', // 结算状态icon
 			   statusMessage: '',
 			   partList: [], // 配件列表
-			   shelfOrderSn: null
+			   shelfOrderSn: null,
+			   state: ''
 		   }
 	   },
 	   onReady() {
 	   },
 	   onLoad(option) { 
 		  this.shelfOrderSn = option.orderSn
+		  this.state = option.state
+		  // 更改标题栏背景色
+		  uni.setNavigationBarColor({
+		  	frontColor: '#ffffff',
+		  	backgroundColor: option.state== 0 ? '#1283d4':'#06ab50',
+		  })
 	   },
 	   onShow() {
 	   	this.getDetail()

+ 1 - 1
pages/digitalShelf/tempOrderList/tempOrderList.vue

@@ -205,7 +205,7 @@
 			// 详细页
 			viewRow(item){
 				uni.navigateTo({
-					url: "/pages/digitalShelf/tempOrderList/orderDetail?orderSn="+item.tempSn
+					url: "/pages/digitalShelf/tempOrderList/orderDetail?orderSn="+item.tempSn+"&state="+(item.billState == 'FINISH'?1:0)
 				})
 			},
 			// 获取待取货数量

+ 12 - 5
pages/index/index.vue

@@ -56,11 +56,11 @@
 			</view>
 			<view class="body-box">	
 				<!-- 扫描按钮 -->
-				<view class="scanButton flex align_center" @click="openCamera">
+				<!-- <view class="scanButton flex align_center" @click="openCamera">
 					<u-icon name="scan" size="60"></u-icon><text class="ml10">扫描VIN</text>
-				</view>
+				</view> -->
 				<!-- 直接取货 -->
-				<view class="quickButton flex align_center" v-if="userInfo.sysUserFlag == '1'" @click="openTakeGood">
+				<view class="scanButton flex align_center" v-if="userInfo.sysUserFlag == '1'" @click="openTakeGood">
 					<text>没有VIN,直接取货</text>
 				</view>
 				<view class="flex align_center justify_center">
@@ -95,7 +95,7 @@
 			</view>
 			</view>
 		</view>
-		<u-tabbar :list="vuex_tabBarList" :mid-button="true"></u-tabbar>
+		<u-tabbar :list="vuex_tabBarList" :before-switch="beforeSwitch" :mid-button="true"></u-tabbar>
 	</view>
 </template>
 
@@ -205,6 +205,13 @@
 			}
 		},
 		methods: {
+			beforeSwitch(index){
+				if(index==1){
+					this.openCamera()
+				}else{
+					return true
+				}
+			},
 			async getPriceShow(){
 				await findPriceShow({paramCode:'PRICE_SHOW'}).then(res => {
 					this.showPrice = res.data ? res.data.paramValue=='1' : false
@@ -530,7 +537,7 @@
 				}
 			}
 			.quickButton{
-				margin: 0 0 0.5em 0;
+				margin: 0.8em 0 0.5em;
 				padding: 0.5em;
 				background: #fff;
 				color: #333;

+ 37 - 2
pages/morePage/morePage.vue

@@ -80,7 +80,7 @@
 			</view>
 		</u-popup>
 	</view>
-	<u-tabbar :list="vuex_tabBarList" :mid-button="true"></u-tabbar>
+	<u-tabbar :list="vuex_tabBarList" :before-switch="beforeSwitch" :mid-button="true"></u-tabbar>
 	</view>
 </template>
 
@@ -97,7 +97,7 @@
 			}
 		},
 		computed: {
-			...mapState(['hasLogin','vuex_tabBarList']),
+			...mapState(['hasLogin','vuex_vinScanNums','vuex_scanMaxNums','vuex_tabBarList']),
 			hasShelf(){
 				return !!this.$store.state.vuex_storeShelf
 			},
@@ -113,6 +113,41 @@
 			this.dealerPhone = shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
 		},
 		methods: {
+			beforeSwitch(index){
+				if(index==1){
+					this.openCamera()
+				}else{
+					return true
+				}
+			},
+			// 去扫描
+			openCamera(){
+				if(this.hasLogin){
+					if(this.userInfo.sysUserFlag == '0'){
+						if(this.vuex_vinScanNums < this.vuex_scanMaxNums){
+							uni.navigateTo({
+								url: "/pages/scan-frame/scan-frame"
+							})
+						}else{
+							uni.showModal({
+								title: '提示',
+								content: '个人用户扫描VIN仅限10次,您的次数已用完!',
+								confirmText: '好的',
+								showCancel: false,
+								success(res) {}
+							})
+						}
+					}else{
+						uni.navigateTo({
+							url: "/pages/scan-frame/scan-frame"
+						})
+					}
+				}else{
+					uni.navigateTo({
+						url: '/pages/login/login'
+					})
+				}
+			},
 			toPage(path){
 				const _this = this
 				if(this.hasLogin){