lilei 7 months ago
parent
commit
ae9445dfce

+ 7 - 0
api/purchase.js

@@ -32,6 +32,13 @@ export const purchaseQueryDetailPage = params => {
     data: params
   })
 }
+// 采购单-详情
+export const purchaseDetail = params => {
+  return request({
+    url: `purchase/findBySn/${params.purchaseSn}`,
+    method: 'get',
+  })
+}
 // 采购单-取消
 export const purchaseCancel = params => {
   return request({

+ 17 - 11
pages/index/index.vue

@@ -475,19 +475,25 @@
 			// 员工用户是否开启商城
 			getShopUserStatus(flag){
 				const data = this.$store.state.vuex_storeShelf
-				getShopUserParam({shelfSn: data.shelfSn}).then(res=>{
-					const item = res.data
-					this.hasShopiing = item && item.paramMap && item.paramMap.mall_flag && item.paramMap.mall_flag.paramValue == 1
-					this.$store.state.vuex_hasShopiing = this.hasShopiing
-					if(this.hasShopiing){
-						// 判断员工是否开启商城
-						this.showShopPage(flag)
-					}else{
-						this.showNoShopPage(flag)
-					}
+				if(data){
+					getShopUserParam({shelfSn: data.shelfSn}).then(res=>{
+						const item = res.data
+						this.hasShopiing = item && item.paramMap && item.paramMap.mall_flag && item.paramMap.mall_flag.paramValue == 1
+						this.$store.state.vuex_hasShopiing = this.hasShopiing
+						if(this.hasShopiing){
+							// 判断员工是否开启商城
+							this.showShopPage(flag)
+						}else{
+							this.showNoShopPage(flag)
+						}
+						// 查询红包活动
+						this.getRedPacketRule()
+					})
+				}else{
+					this.showNoShopPage(flag)
 					// 查询红包活动
 					this.getRedPacketRule()
-				})
+				}
 			},
 			// 显示开通商城的页面
 			showShopPage(flag){

+ 6 - 0
pagesB/cart/index.vue

@@ -483,6 +483,7 @@
 				this.totalNum = 0
 				this.totalSel = 0
 				this.list.forEach(key => {
+					// 已选择
 					key.filter(item=>item.checked).forEach(item => {
 						this.totalAmount += item.price * item.qty // 总金额
 						this.totalNum += item.qty // 总数量
@@ -498,6 +499,11 @@
 						// 满赠
 						item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
 					})
+					// 未选择
+					key.filter(item=>!item.checked).forEach(item => {
+						// 满赠
+						item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
+					})
 				})
 			},
 		}

+ 5 - 4
pagesB/components/payModal.vue

@@ -23,7 +23,7 @@
 					<text>代金券</text>
 					<view class="popu-content-price">¥{{payInfo.totalTicketGiveAmount}}</view>
 				</view>
-				<view style="height: 5px;"></view>
+				<view style="height: 10px;"></view>
 				<view class="popu-content-title flex align_center justify_between">
 					<text>付款方式</text>
 					<view></view>
@@ -99,10 +99,11 @@
 					if(this.closeCurPage){
 						uni.navigateBack()
 					}
-					// 确认付款,去订单详情页
+					// 付款成功
 					if(this.submitOk){
 						this.$emit('payComplete',this.payInfo, true)
 					}else{
+						// 付款失败或取消
 						this.$emit('payComplete',this.payInfo, false)
 					}
 				}
@@ -202,7 +203,7 @@
 					padding: 6px 0;
 				}
 				.popu-content-amount{
-					font-size: 24px;
+					font-size: 28px;
 					color: red;
 					padding-top: 30px;
 				}
@@ -215,7 +216,7 @@
 				display: flex;
 				align-items: center;
 				justify-content: space-around;
-				margin: 20px 0 10px;
+				margin: 30px 0 20px;
 				.popu-content-btn-item{
 					width: 30%;
 					height: 34px;

+ 14 - 14
pagesB/procureOrder/creatOrder.vue

@@ -38,11 +38,11 @@
 								<text>商品金额</text>
 								<text class="price">¥{{Number(totalAmount).toFixed(2)}}</text>
 							</view>
-							<view class="product-price-item">
+							<view class="product-price-item" v-if="totalDiscount">
 								<text>优惠金额</text>
 								<text class="price">¥{{Number(totalDiscount).toFixed(2)}}</text>
 							</view>
-							<view class="product-price-item">
+							<view class="product-price-item" v-if="totalCoupon">
 								<text>代金券</text>
 								<text class="price">¥{{Number(totalCoupon).toFixed(2)}}</text>
 							</view>
@@ -75,7 +75,7 @@
 				</view>
 		</view>
 		<!-- 付款弹框 -->
-		<payModal :showPopu="showPopu" :closeCurPage="true" :payInfo="payInfo" :payData="payData" @close="showPopu=false" @payComplete="toOrderDetial"></payModal> 
+		<payModal v-if="hasPay" :showPopu="showPopu" :closeCurPage="true" :payInfo="payInfo" :payData="payData" @close="showPopu=false" @payComplete="payComplete"></payModal> 
 	</view>
 </template>
 
@@ -264,13 +264,11 @@
 						// 删除已提交产品
 						uni.$emit('removeCatGood',cartSn,true,false)
 						res.data.detailList = []
-						// 倒计时
-						let now = new Date(res.data.purchaseDate)
-						now.setMilliseconds(now.getMilliseconds() + 30 * 60 * 1000)
-						res.data.timestamp = now.getTime()
-						this.$store.state.vuex_tempOrderData = res.data
 						// 这里判断是否开通支付,如果开通打开确认付款弹框
 						if(this.hasPay){
+							// 倒计时
+							res.data.timestamp = (new Date(res.data.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
+							this.$store.state.vuex_tempOrderData = res.data
 							purchasePay({
 								bizSn:res.data.purchaseSn,
 								bizNo:res.data.purchaseNo,
@@ -282,8 +280,8 @@
 								this.$store.state.vuex_tempOrderData.billStatus = 'WAIT_PAY'
 							})
 						}else{
-							// 创建成功,跳转到订单详情页
-							this.toOrderDetial(null,true)
+							this.$store.state.vuex_tempOrderData = res.data
+							this.payComplete(null,true)
 						}
 					}else{
 						uni.showToast({
@@ -294,7 +292,7 @@
 				})
 			},
 			// 订单详情页
-			toOrderDetial(data, result){
+			payComplete(data, result){
 				console.log(result)
 				// 创建成功,跳转到订单详情页
 				this.showPopu = false
@@ -304,9 +302,11 @@
 				}else{
 					this.$store.state.vuex_tempOrderData.billStatus = 'WAIT_AUDIT'
 				}
-				uni.navigateTo({
-					url: "/pagesB/procureOrder/orderDetail"
-				})
+				setTimeout(()=>{
+					uni.navigateTo({
+						url: "/pagesB/procureOrder/orderDetail"
+					})
+				},50)
 			},
 			// 计算总款数、合计、数量
 			getChooseHeji(){

+ 75 - 36
pagesB/procureOrder/orderDetail.vue

@@ -8,12 +8,12 @@
 						</u-icon>
 						<text>{{statusText}}</text>
 					</view>
-					<view class="messageText" v-if="statusMessage"><text>{{statusMessage}}</text></view>
 					<view v-if="info.billStatus=='WAIT_PAY'" class="messageText">
 						请尽快支付,
-						<u-count-down separator="zh" :separator-size="24" bg-color="none" color="#ffff7f" separator-color="#ffff7f" :timestamp="info.timestamp" :show-days="false" :show-hours="false"></u-count-down>
+						<u-count-down separator="zh" :separator-size="24" bg-color="none" color="#ffff7f" separator-color="#ffff7f" :timestamp="info.timestamp" :show-days="false" :show-hours="false" @end="countDownEnd()"></u-count-down>
 						后订单将自动取消。
 					</view>
+					<view v-else class="messageText"><text>{{statusMessage}}</text></view>
 				</view>
 			</view>
 		</view>
@@ -30,7 +30,7 @@
 				<view v-for="(item,dix) in partList" :key="item.id" class="item-list-box">
 					<view class="item-list flex">
 						<view style="height: 160rpx;width: 160rpx;">
-							<u-image :src="item.product.images+'?x-oss-process=image/resize,p_50'" border-radius="16" width="160" height="160" bg-color="#EBEBEB" ></u-image>
+							<u-image :src="item.product.images ? item.product.images+'?x-oss-process=image/resize,p_50':'/static/def_imgs.png'" border-radius="16" width="160" height="160" bg-color="#EBEBEB" ></u-image>
 						</view>
 						<view>
 							<view class="item-name">
@@ -64,7 +64,7 @@
 					<!-- 赠品 -->
 					<view class="item-list flex gift-box" v-if="item.giftObj">
 						<view style="height: 120rpx;width: 120rpx;margin-left: 40rpx;">
-							<u-image :src="item.giftObj.product.images+'?x-oss-process=image/resize,p_50'" border-radius="16" width="120" height="120" bg-color="#EBEBEB" ></u-image>
+							<u-image :src="item.giftObj.product.images ? item.giftObj.product.images+'?x-oss-process=image/resize,p_50':'/static/def_imgs.png'" border-radius="16" width="120" height="120" bg-color="#EBEBEB" ></u-image>
 						</view>
 						<view>
 							<view class="item-name flex align_center">
@@ -94,22 +94,22 @@
 				</view>
 			</view>
 			<view class="info" v-if="info">
-				<view class="infoList gray-text" v-if="info.totalTicketGiveAmount">
-					<text>代金券</text>
-					<text class="cText">¥{{Number(info.totalTicketGiveAmount).toFixed(2)}}</text>
+				<view class="infoList">
+					<text>总金额</text>
+					<view class="price-txt">¥<text>{{Number(info.totalAmount).toFixed(2)}}</text></view>
 				</view>
 				<view class="infoList gray-text" v-if="info.totalSpecialGiveAmount">
 					<text>总优惠</text>
 					<text class="cText">¥{{Number(info.totalSpecialGiveAmount).toFixed(2)}}</text>
 				</view>
-				<view class="infoList">
-					<text>总金额</text>
-					<view class="price-txt">¥<text>{{Number(info.totalAmount).toFixed(2)}}</text></view>
+				<view class="infoList gray-text" v-if="info.totalTicketGiveAmount">
+					<text>代金券</text>
+					<text class="cText">¥{{Number(info.totalTicketGiveAmount).toFixed(2)}}</text>
 				</view>
 			</view>
 			<view class="info" v-if="info">
 				<view class="infoList">
-					<view class="title">单信息</view>
+					<view class="title">单信息</view>
 					<view class="statu"></view>
 				</view>
 				<view class="infoList dju">
@@ -124,50 +124,46 @@
 					<text>下单人员</text>
 					<text>{{info.purchaserName || '--'}}</text>
 				</view>
-				<!-- 线下支付正常显示 -->
-				<view class="infoList" v-if="info&&info.payOnlineFlag&&info.payOnlineFlag==0">
-					<text>付款时间</text>
-					<text>{{info.purchaseDate||'--'}}</text>
-				</view>
+				
 				<!-- 线上支付 显示 -->
-				<view v-if="info&&info.payOnlineFlag==1&&info.payInfo">>
-					<view class="infoList">
+				<view v-if="hasPay">
+					<view class="infoList" v-if="info&&info.billStatus != 'WAIT_AUDIT'&&info.billStatus != 'WAIT_PAY'&&isPayOk">
+						<text>审核时间</text>
+						<text>{{info.auditDate||'--'}}</text>
+					</view>
+					<view class="infoList" v-if="isPayOk">
 						<text>支付方式</text>
 						<text>{{info.payInfo.payWay||'--'}}</text>
 					</view>
-					<view class="infoList">
+					<view class="infoList" v-if="isPayOk">
 						<text>支付时间</text>
 						<text>{{info.payInfo.payDate||'--'}}</text>
 					</view>
-					<view class="infoList" v-if="info&&info.billStatus != 'WAIT_AUDIT'&&info.billStatus != 'WAIT_PAY'">
-						<text>审核时间</text>
-						<text>{{info.payInfo.purchaseDate||'--'}}</text>
-					</view>
-					<view class="infoList">
+					<view class="infoList" v-if="info&&info.billStatus == 'CANCEL'&&isPayOk">
 						<text>退款方式</text>
-						<text>{{info.payInfo.refundWay ||'--'}}</text>
+						<text>原支付返回</text>
 					</view>
-					<view class="infoList">
+					<view class="infoList" v-if="info&&info.billStatus == 'CANCEL'&&isPayOk">
 						<text>退款时间</text>
 						<text>{{info.payInfo.refundDate ||'--'}}</text>
 					</view>
-					<view class="infoList" v-if="info&&info.billStatus === 'CANCEL'">
+					<view class="infoList" v-if="info&&info.billStatus == 'CANCEL'">
 						<text>取消时间</text>
-						<text>{{info.purchaseDate||'--'}}</text>
+						<text>{{info.cancelDate ||'--'}}</text>
 					</view>
-					<view class="infoList" v-if="info&&(info.billStatus === 'CANCEL'||info.billStatus === 'WAIT_AUDIT'||info.billStatus == 'WAIT_PAY')">
+					<view class="infoList" v-if="shelfInfo">
 						<text>配送汽配商</text>
-						<text>{{info.purchaseDate||'--'}}</text>
+						<text>{{shelfInfo.dealerName}}</text>
 					</view>
 				</view>
 			</view>
 		</view>
 		<view v-if="info&&info.billStatus == 'WAIT_AUDIT'||info.billStatus == 'WAIT_PAY'||info.billStatus == 'WAIT_RECEIVE'" style="background-color: #fff;">
 			<view class="footer flex align_center justify_center">
-				<u-button style="margin-left: 10px;" v-if="info.billStatus == 'WAIT_AUDIT'" size="mini" shape="round" type="default" plain @click="cancelOrder(info)">取消订单</u-button>
-				<u-button style="margin-left: 10px;" v-if="info.billStatus == 'WAIT_PAY'" size="mini" shape="round" type="error" plain @click="payOrder(info)">立即支付</u-button>
-				<!-- <u-button style="margin-left: 10px;" v-if="info.billStatus == 'FINISH'" size="mini" shape="round" type="error" plain @click="buyAgain(info)">再次购买</u-button> -->
-				<u-button style="margin-left: 10px;" v-if="info.billStatus == 'WAIT_RECEIVE'" size="mini" shape="round" type="error" plain @click="receiveOrder(info)">确认收货</u-button>
+				<u-button style="margin-left: 10px;" v-if="info.billStatus == 'WAIT_AUDIT'||info.billStatus == 'WAIT_PAY'" size="medium" shape="round" type="default" plain @click="cancelOrder(info)">取消订单</u-button>
+				<u-button style="margin-left: 10px;" v-if="info.billStatus == 'WAIT_PAY'" size="medium" shape="round" type="error" plain @click="payOrder(info)">立即支付</u-button>
+				<!-- <u-button style="margin-left: 10px;" v-if="info.billStatus == 'FINISH'" size="medium" shape="round" type="error" plain @click="buyAgain(info)">再次购买</u-button> -->
+				<u-button style="margin-left: 10px;" v-if="info.billStatus == 'WAIT_RECEIVE'" size="medium" shape="round" type="error" plain @click="receiveOrder(info)">确认收货</u-button>
 			</view>
 			<view :style="{height:safeAreaBottom+'px'}"></view>
 		</view>
@@ -178,7 +174,8 @@
 
 <script>
 	import payModal from '../components/payModal.vue'
-	import { purchaseQueryDetailPage,purchaseCancel,purchaseReceive,purchasePay } from '@/api/purchase.js'
+	import { purchaseQueryDetailPage,purchaseDetail,purchaseCancel,purchaseReceive,purchasePay } from '@/api/purchase.js'
+	import moment from 'moment'
 	export default {
 	   name: 'procureDetailOrder',
 	   components:{
@@ -232,6 +229,19 @@
 		   totalPages(){
 			   return Math.ceil(this.total / this.pageSize)
 		   },
+		   // 货架经销商信息
+		   shelfInfo(){
+				return this.$store.state.vuex_storeShelf
+		   },
+		   //是否有支付信息
+		   hasPay(){
+				return this.info&&this.info.payOnlineFlag==1&&this.info.payInfo
+		   },
+		   //是否已付款
+		   isPayOk(){
+			   const item = this.info
+			   return this.hasPay && item.payInfo.payState!='WAIT'
+		   },
 		   // 付款信息
 		   payInfo(){
 				return this.$store.state.vuex_tempOrderData
@@ -297,8 +307,36 @@
 		 		}
 		 	});
 		 },
+		 // 倒计时结束,取消订单刷新页面
+		 countDownEnd(){
+			 this.showPopu = false
+			 const _this = this
+			 uni.showModal({
+			 	title: '提示',
+			 	content: '订单超过30分钟已自动取消',
+				showCancel:false,
+				confirmText:'知道了',
+			 	success: function (res) {
+			 		uni.$emit('refreshPurcaOrder',_this.info,'CANCEL')
+			 		_this.state = 'CANCEL'
+			 		_this.info.billStatus = 'CANCEL'
+			 		_this.statusText = '已取消'
+			 		_this.statusIcon = 'close-circle'
+			 		_this.statusMessage = '订单超过30分钟已自动取消'
+			 		_this.info.cancelDate = moment().format('YYYY-MM-DD hh:mm:ss')
+			 		// 更改标题栏背景色
+			 		uni.setNavigationBarColor({
+			 			frontColor: '#ffffff',
+			 			backgroundColor: '#e61100',
+			 		}) 
+			 	}
+			 });
+		 },
 		 // 立即支付
 		 payOrder(item){
+			uni.showLoading({
+				title: '加载中...'
+			})
 			purchasePay({
 				bizSn:item.purchaseSn,
 				bizNo:item.purchaseNo,
@@ -307,6 +345,7 @@
 			}).then(res=>{
 				this.showPopu = true
 				this.payData = res.data?res.data.payRequestRest:null
+				uni.hideLoading()
 			})
 		 },
 		 // 付款成功,isOk: false 取消支付或支付失败,true 支付完成
@@ -524,7 +563,7 @@
 			}
 		}
 		.footer{
-			padding: 20upx 20upx 0;
+			padding: 20upx;
 			background: #FFFFFF;
 		}
 	}

+ 75 - 41
pagesB/procureOrder/orderList.vue

@@ -2,8 +2,18 @@
 	<view class="digitShelf-pagesCons">
 		<view class="tab-body">
 			    <view>
-					<u-tabs-swiper ref="uTabs" :list="tabList" :offset="[5,40]" bar-width='100' active-color="#1283d4" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
-					 swiperWidth="750"></u-tabs-swiper>
+					<u-tabs-swiper 
+					ref="uTabs" 
+					:list="tabList" 
+					:offset="[5,5]" 
+					bar-width='100' 
+					active-color="#1283d4" 
+					name="dispName" 
+					:current="current" 
+					@change="tabsChange" 
+					:is-scroll="false"
+					swiperWidth="750">
+					</u-tabs-swiper>
 				</view>
 				<swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
 					<swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;" v-for="(tabs, indexs) in tabList" :key="indexs">
@@ -21,7 +31,7 @@
 										<view v-if="item.billStatus == 'WAIT_PAY'" class="waitPay">
 											<text>待付款</text>
 											<view style="padding:0 5px;">
-												<u-count-down separator="zh" :separator-size="24" bg-color="none" :timestamp="item.timestamp" :show-days="false" :show-hours="false"></u-count-down>
+												<u-count-down separator="zh" :separator-size="24" bg-color="none" :timestamp="item.timestamp" :show-days="false" :show-hours="false" @end="resetList(item,'CANCEl')"></u-count-down>
 											</view>
 										</view>
 										<span v-if="item.billStatus == 'AUDIT_REJECT'">审核不通过</span>
@@ -58,7 +68,7 @@
 										 {{item.createDate}}
 									 </view>
 									 <view style="text-align: right;color: #999;">
-										 <u-button style="margin-left: 10px;" v-if="item.billStatus == 'WAIT_AUDIT'" size="mini" shape="round" type="default" plain @click="cancelOrder(item)">取消订单</u-button>
+										 <u-button style="margin-left: 10px;" v-if="item.billStatus == 'WAIT_AUDIT'||item.billStatus == 'WAIT_PAY'" size="mini" shape="round" type="default" plain @click="cancelOrder(item)">取消订单</u-button>
 										 <u-button style="margin-left: 10px;" v-if="item.billStatus == 'WAIT_PAY'" size="mini" shape="round" type="error" plain @click="payOrder(item)">立即支付</u-button>
 										 <!-- <u-button style="margin-left: 10px;" v-if="item.billStatus == 'CANCEL'" size="mini" shape="round" type="error" plain @click="buyAgain(item)">再次购买</u-button> -->
 										 <u-button style="margin-left: 10px;" v-if="item.billStatus == 'WAIT_RECEIVE'" size="mini" shape="round" type="error" plain @click="receiveOrder(item)">确认收货</u-button>
@@ -90,7 +100,32 @@
 				status: 'loading',
 				noDataText: '暂无数据',
 				showPopu: false,
-				tabList: [
+				current: 1,
+				swiperCurrent: 1,
+				// 查询条件
+				pageNo: 1,
+				pageSize: 10,
+				list: [],
+				total: 0,
+				payData: null
+			}
+		},
+		computed: {
+			// 货架经销商信息
+			shelfInfo(){
+				return this.$store.state.vuex_storeShelf
+			},
+			//是否开启线上支付
+			hasPay(){
+				const shelfInfo = this.shelfInfo
+				return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'
+			},
+			// 付款信息
+			payInfo(){
+				return this.$store.state.vuex_tempOrderData
+			},
+			tabList(){
+				const arr = [
 					  {
 						  dispName: '全部',
 						  typeId: 1,
@@ -121,21 +156,12 @@
 					  	typeId: 6,
 					  	count: 0
 					  },
-				  ],
-				current: 1,
-				swiperCurrent: 1,
-				// 查询条件
-				pageNo: 1,
-				pageSize: 10,
-				list: [],
-				total: 0,
-				payData: null
-			}
-		},
-		computed: {
-			// 付款信息
-			payInfo(){
-				return this.$store.state.vuex_tempOrderData
+				  ]
+				// 如果没有开通支付  
+				if(!this.hasPay){
+					arr.splice(1,1)
+				}  
+				return arr
 			}
 		},
 		onLoad() {
@@ -236,6 +262,9 @@
 			// 立即支付
 			payOrder(item){
 				this.$store.state.vuex_tempOrderData = item
+				uni.showLoading({
+					title: '加载中...'
+				})
 				purchasePay({
 					bizSn:item.purchaseSn,
 					bizNo:item.purchaseNo,
@@ -244,6 +273,7 @@
 				}).then(res=>{
 					this.showPopu = true
 					this.payData = res.data?res.data.payRequestRest:null
+					uni.hideLoading()
 				})
 			},
 			// 付款成功,isOk: false 取消支付或支付失败,true 支付完成
@@ -292,25 +322,25 @@
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
 			  }
-			  // 状态条件
 			  // 待付款
-			  if(this.swiperCurrent == 1){
+			  if(this.swiperCurrent == 1 && this.hasPay){
 				 params.billStatusList = ['WAIT_AUDIT']
 			  }
+			  const tab = this.hasPay ? this.swiperCurrent : this.swiperCurrent + 1
 			  // 待收货
-			  if(this.swiperCurrent == 2){
+			  if(tab == 2){
 				  params.billStatusList = ['WAIT_AUDIT','WAIT_OUT_WAREHOUSE','WAIT_RECEIVE']
 			  }
 			  // 已完成
-			  if(this.swiperCurrent == 3){
+			  if(tab == 3){
 				  params.billStatusList = ['FINISH']
 			  }
 			  // 已取消
-			  if(this.swiperCurrent == 4){
+			  if(tab == 4){
 			  	  params.billStatusList = ['CANCEL']
 			  }
 			  // 未审核通过
-			  if(this.swiperCurrent == 5){
+			  if(tab == 5){
 			  	  params.billStatusList = ['AUDIT_REJECT']
 			  }
 			  this.status = "loading"
@@ -318,27 +348,28 @@
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
 				  let list = res.data.list || []
 				  list.map(item => {
-					  let now = new Date(item.purchaseDate)
-					  now.setMilliseconds(now.getMilliseconds() + 30 * 60 * 1000)
-					  item.timestamp = now.getTime()
 					  item.billStatus = item.billStatus == 'WAIT_AUDIT'&&item.payOnlineFlag==1&&item.payInfo&&item.payInfo.payState=='WAIT'?'WAIT_PAY':item.billStatus
+					  // 计算待付款剩余倒计时
+					  if(item.billStatus== 'WAIT_PAY'){
+					  	item.timestamp = (new Date(item.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
+					  }
 				  })
-				  // 待收款
-				  if(_this.swiperCurrent==1){
-					  list = list.filter(item => {
-						  return item.billStatus == 'WAIT_PAY'
-					  })
+				  
+				  // 只显示待付款
+				  if(_this.hasPay&&this.swiperCurrent == 1){
+					  list = list.filter(item => item.billStatus== 'WAIT_PAY')
 				  }
-				  if(_this.pageNo>1){
-					  _this.list = _this.list.concat(list)
-				  }else{
-					  _this.list = list
+				  // 待收货里去除待付款
+				  if(_this.hasPay&&this.swiperCurrent == 2 || !_this.hasPay&&this.swiperCurrent == 1){
+				  	  list = list.filter(item => item.billStatus!= 'WAIT_PAY')
 				  }
 				  
+				  _this.list = _this.list.concat(list)
 				  _this.total = res.data.count || 0
-				  // 待收货
-				  if(_this.swiperCurrent == 2){
-					  _this.tabList[2].count = _this.total
+				  
+				  // 待收货或待付款显示总数
+				  if(_this.swiperCurrent == 1){
+					  // _this.tabList[_this.swiperCurrent].count = _this.total
 				  }
 				  
 				} else {
@@ -351,6 +382,9 @@
 			},
 			// 详细页
 			viewRow(item){
+				if(item.billStatus== 'WAIT_PAY'){
+					item.timestamp = (new Date(item.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
+				}
 				this.$store.state.vuex_tempOrderData = item
 				uni.navigateTo({
 					url: "/pagesB/procureOrder/orderDetail?purchaseSn="+item.purchaseSn+"&state="+item.billStatus

+ 29 - 25
pagesB/shopiing/productDetail.vue

@@ -113,6 +113,9 @@
 						<view class="popu-content-info-title">
 							<text class="ellipsis-two">{{detail.productName}}</text>
 						</view>
+						<view class="popu-content-info-code">
+							<text class="ellipsis-two">{{detail.product.code}}</text>
+						</view>
 						<view class="popu-content-box">
 							<view class="popu-content-price" v-if="hasLogin">
 								¥<text>{{detail.priceStr[0]}}</text>.{{detail.priceStr[1]}}
@@ -128,6 +131,16 @@
 								特价<text>¥{{detail.orginPrice}}</text>
 							</view>
 						</view>
+						<view style="margin-top: 10px;" class="popu-content-num flex align_center justify_between">
+							<text>数量</text>
+							<view class="flex align_center qty-box">
+								<view class="qty-btn" @click="changeQty(qty-1)" :class="(qty <= 1)?'qty-disabled':''">-</view>
+								<view class="qty-num" @click="$refs.showPopu.open()" :style="{width:Number(qty).toString().length*8+10+'px'}">
+									{{qty}}
+								</view>
+								<view class="qty-btn" @click="changeQty(qty+1)" :class="(qty >= 999)?'qty-disabled':''">+</view>
+							</view>
+						</view>
 					</view>
 				</view>
 				<view class="pupu-box gift-box" v-if="giftNum">
@@ -141,8 +154,7 @@
 							</view>
 							<view class="ellipsis-two">{{detail.productName}}</view>
 						</view>
-						<view class="popu-content-box justify_between">
-							<view></view>
+						<view class="popu-content-box">
 							<view class="popu-content-num flex align_center">
 								<text>X</text> {{giftNum}}
 							</view>
@@ -150,17 +162,6 @@
 					</view>
 				</view>
 				<view class="pupu-box-item">
-					<view class="popu-content-num flex align_center justify_between">
-						<text>数量</text>
-						<!-- <uni-number-box v-model="qty" :input-width="60" :input-height="40" :min="1" :max="999"></uni-number-box> -->
-						<view class="flex align_center qty-box">
-							<view class="qty-btn" @click="changeQty(qty-1)" :class="(qty <= 1)?'qty-disabled':''">-</view>
-							<view class="qty-num" @click="$refs.showPopu.open()" :style="{width:Number(qty).toString().length*8+10+'px'}">
-								{{qty}}
-							</view>
-							<view class="qty-btn" @click="changeQty(qty+1)" :class="(qty >= 999)?'qty-disabled':''">+</view>
-						</view>
-					</view>
 					<view class="flex align_center justify_between" v-if="shelfInfo">
 						<text>配送商:{{shelfInfo.dealerName}}</text>
 						<view @click="callPhone()"><uni-icons size="18" type="phone" color="dodgerblue"></uni-icons><text style="font-size:12px;">拨打</text></view>
@@ -174,7 +175,7 @@
 					<view class="popu-content-btn-item cartbtn" v-if="isAddCart" @click="submitCart($event)">加入购物车</view>
 					<view class="popu-content-btn-item okbtn" v-if="!isAddCart" @click="toBuy">
 						{{hasPay?'立即支付':'确定采购'}}
-						<text class="payAmount" v-if="payAmount&&hasPay">¥{{payAmount}}</text>
+						<text class="payAmount">¥{{payAmount}}</text>
 					</view>
 				</view>
 			</view>
@@ -195,7 +196,7 @@
 						<text>代金券</text>
 						<view class="popu-content-price">¥{{payInfo.totalTicketGiveAmount}}</view>
 					</view>
-					<view style="height: 5px;"></view>
+					<view style="height: 10px;"></view>
 					<view class="popu-content-title flex align_center justify_between">
 						<text>付款方式</text>
 						<view></view>
@@ -556,13 +557,11 @@
 				}).then(res => {
 					if(res.status == 200){
 						res.data.detailList = []
-						// 倒计时
-						let now = new Date(res.data.purchaseDate)
-						now.setMilliseconds(now.getMilliseconds() + 30 * 60 * 1000)
-						res.data.timestamp = now.getTime()
 						this.$store.state.vuex_tempOrderData = res.data
 						// 这里判断是否开通支付,如果开通打开确认付款弹框
 						if(this.hasPay){
+							// 计算待付款剩余倒计时
+							res.data.timestamp = (new Date(res.data.createDate.replace(/-/g,'/')).getTime() + 1800000 - new Date().getTime())/1000
 							purchasePay({
 								bizSn:res.data.purchaseSn,
 								bizNo:res.data.purchaseNo,
@@ -968,7 +967,7 @@
 				font-size: 16px;
 			}
 			.popu-content-num{
-				font-size: 14px;
+				font-size: 24rpx;
 				color: #999999;
 				padding: 10px 0;
 				> text{
@@ -1066,10 +1065,15 @@
 					.popu-content-info-title{
 						font-size: 14px;
 					}
+					.popu-content-info-code{
+						font-size: 12px;
+						color: #00aaff;
+						margin-top: 5px;
+					}
 				}
 				.gift-box{
 					padding-left: 8%;
-					margin-top: 0;
+					margin-top: 10px;
 					border-top: 1px solid #eee;
 					padding-top: 10px;
 					.popu-content-img{
@@ -1084,7 +1088,7 @@
 						margin-top: 0;
 					}
 					.popu-content-num{
-						padding:5px 0;
+						padding:5px 15px;
 						>text{
 						  font-size: 10px;
 						}
@@ -1118,7 +1122,7 @@
 				}
 				.pupu-box-item,.pupu-box-pay-item{
 					width: 100%;
-					padding-top: 10px;
+					padding-top: 20px;
 					> view{
 						padding: 10px 0;
 					}
@@ -1128,7 +1132,7 @@
 						padding: 6px 0;
 					}
 					.popu-content-amount{
-						font-size: 24px;
+						font-size: 28px;
 						color: red;
 					}
 					.popu-content-title{
@@ -1145,7 +1149,7 @@
 					display: flex;
 					align-items: center;
 					justify-content: space-around;
-					margin: 20px 0 10px;
+					margin: 30px 0 20px;
 					.popu-content-btn-item{
 						width: 30%;
 						height: 34px;