lilei 4 months ago
parent
commit
7e9e019e05

+ 3 - 3
pages/morePage/morePage.vue

@@ -40,7 +40,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 			<!-- 余额数据 -->
 			<!-- 余额数据 -->
-			<view class="list-box">
+			<view class="list-box" v-if="hasLogin">
 				<view class="list-title" v-if="hasLogin&&hasBalaceAuth" style="padding-bottom: 0;padding-top:5px;color: #999;">
 				<view class="list-title" v-if="hasLogin&&hasBalaceAuth" style="padding-bottom: 0;padding-top:5px;color: #999;">
 					<text style="font-size: 10px;">ⓛ点击充值余额去充值</text>
 					<text style="font-size: 10px;">ⓛ点击充值余额去充值</text>
 				</view>
 				</view>
@@ -48,13 +48,13 @@
 					<uni-grid :column="4" :highlight="true" :show-border="false" :square="false" @change="e=>openDataList(e)">
 					<uni-grid :column="4" :highlight="true" :show-border="false" :square="false" @change="e=>openDataList(e)">
 						<uni-grid-item v-if="hasBalaceAuth">
 						<uni-grid-item v-if="hasBalaceAuth">
 							<view class="grid-item-box" :index="0">
 							<view class="grid-item-box" :index="0">
-								<text class="value">{{storeAccount.rechargeBalance}}</text>
+								<text class="value">{{Number(storeAccount.rechargeBalance).toFixed(2)}}</text>
 								<text class="text">充值余额</text>
 								<text class="text">充值余额</text>
 							</view>
 							</view>
 						</uni-grid-item>
 						</uni-grid-item>
 						<uni-grid-item v-if="hasBalaceAuth">
 						<uni-grid-item v-if="hasBalaceAuth">
 							<view class="grid-item-box" :index="1">
 							<view class="grid-item-box" :index="1">
-								<text class="value">{{storeAccount.giveBalance}}</text>
+								<text class="value">{{Number(storeAccount.giveBalance).toFixed(2)}}</text>
 								<text class="text">抵扣余额</text>
 								<text class="text">抵扣余额</text>
 							</view>
 							</view>
 						</uni-grid-item>
 						</uni-grid-item>

+ 34 - 4
pagesB/accountBalance/accountBalance.vue

@@ -31,7 +31,7 @@
     </view>
     </view>
 	
 	
 	<!-- 付款弹框 -->
 	<!-- 付款弹框 -->
-	<payModal :showPopu="showPopu" :shelfInfo="shelfInfo" :payInfo="info" :payData="payData" @close="showPopu=false" @payComplete="payComplete"></payModal> 
+	<payModal :showPopu="showPopu" :shelfInfo="shelfInfo" :payInfo="info" :dealerPhone="dealerPhone" :payData="payData" @close="showPopu=false" @payComplete="payComplete"></payModal> 
   </view>
   </view>
 </template>
 </template>
 
 
@@ -80,6 +80,11 @@ export default {
 	storeAccount(){
 	storeAccount(){
 		return this.$store.state.vuex_storeAccount
 		return this.$store.state.vuex_storeAccount
 	},
 	},
+	//是否开启线上支付,支付方式不是线下支付
+	hasPay(){
+		const shelfInfo = this.shelfInfo
+		return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'
+	},
   },
   },
   onShow() {
   onShow() {
 	  this.getStoreAccount()
 	  this.getStoreAccount()
@@ -108,6 +113,22 @@ export default {
 	},
 	},
 	// 充值
 	// 充值
     handleRecharge(info) {
     handleRecharge(info) {
+	  if(!this.hasPay){
+		  uni.showModal({
+		  	okText:'去联系经销商',
+		  	cancelText:'取消',
+		  	title:'提示',
+		  	content:'未开启线上支付,请联系经销商',
+		  	success:(res)=>{
+		  		if(res.confirm){
+		  			uni.makePhoneCall({
+		  				phoneNumber:this.dealerPhone
+		  			})
+		  		}
+		  	}
+		  })
+		  return
+	  }
       this.info = info
       this.info = info
 	  uni.showLoading({
 	  uni.showLoading({
 	  	title:'加载中...'
 	  	title:'加载中...'
@@ -135,13 +156,19 @@ export default {
 					setTimeout(()=>{
 					setTimeout(()=>{
 						uni.hideLoading()
 						uni.hideLoading()
 					},300)
 					},300)
-					uni.showToast(ret.message)
+					uni.showToast({
+						title: ret.message,
+						icon: 'none'
+					})
 				})
 				})
 		  }else{
 		  }else{
 			  setTimeout(()=>{
 			  setTimeout(()=>{
 				uni.hideLoading()
 				uni.hideLoading()
 			  },300)
 			  },300)
-			  uni.showToast(res.message)
+			  uni.showToast({
+					title: res.message,
+					icon: 'none'
+			  })
 		  }
 		  }
 	  })
 	  })
     },
     },
@@ -149,7 +176,10 @@ export default {
 		this.showPopu = false
 		this.showPopu = false
 		if(isOk){
 		if(isOk){
 			this.getStoreAccount()
 			this.getStoreAccount()
-			uni.showToast('支付成功')
+			uni.showToast({
+				title: '支付成功',
+				icon: 'none'
+			})
 		}
 		}
 	}
 	}
   }
   }

+ 4 - 0
pagesB/components/czPayModal.vue

@@ -64,6 +64,10 @@
 					return null
 					return null
 				}
 				}
 			},
 			},
+			dealerPhone: {
+				type: String,
+				default: ''
+			}
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {

+ 2 - 1
pagesB/components/payOptions.vue

@@ -34,7 +34,7 @@
 				default: '支付方式'
 				default: '支付方式'
 			},
 			},
 			value: {
 			value: {
-				type: String,
+				type: [Number,String],
 				default: '2'
 				default: '2'
 			},
 			},
 			balance: {
 			balance: {
@@ -64,6 +64,7 @@
 		},
 		},
 		watch: {
 		watch: {
 			value(val) {
 			value(val) {
+				console.log(val)
 				this.defaultValue = val
 				this.defaultValue = val
 			}
 			}
 		}
 		}

+ 4 - 2
pagesB/procureOrder/creatOrder.vue

@@ -45,6 +45,7 @@
 									<text>¥{{subsidyAmount}}</text>
 									<text>¥{{subsidyAmount}}</text>
 								</view>
 								</view>
 								<view class="flex align_center" v-else>
 								<view class="flex align_center" v-else>
+									<uni-icons size="18" type="checkbox" color="#999"></uni-icons>
 									<text>¥{{subsidyAmount}}</text>
 									<text>¥{{subsidyAmount}}</text>
 								</view>
 								</view>
 							</view>
 							</view>
@@ -180,7 +181,7 @@
 			},
 			},
 			// 禁用抵扣金额
 			// 禁用抵扣金额
 			disKdk(){
 			disKdk(){
-				const kdk = this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<this.storeAccount.giveBalance
+				const kdk = this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
 				return this.payType==2 || !kdk
 				return this.payType==2 || !kdk
 			},
 			},
 			// 最小支付金额
 			// 最小支付金额
@@ -270,7 +271,8 @@
 								productCode: item.productCode,
 								productCode: item.productCode,
 								qty: item.qty,
 								qty: item.qty,
 								price: item.price,
 								price: item.price,
-								promoSn: item.promoSn
+								promoSn: item.promoSn,
+								payOnlineType: this.payType == 0 ? 'RECHARGE_BALANCE' : this.payType == 1 ? 'WXPAY_ONLINE' : ''
 							}
 							}
 						})
 						})
 						const delSn = cartSn.filter(item => successList.find(k => k.productSn == item.productSn)).map(item => item.cartSn)
 						const delSn = cartSn.filter(item => successList.find(k => k.productSn == item.productSn)).map(item => item.cartSn)

+ 29 - 12
pagesB/shopiing/productDetail.vue

@@ -183,13 +183,14 @@
 								<view>总金额</view>
 								<view>总金额</view>
 								<view><text class="pf">¥</text>{{totalAmount}}</view>
 								<view><text class="pf">¥</text>{{totalAmount}}</view>
 							</view>
 							</view>
-							<view class="flex align_center justify_between">
+							<view class="flex align_center justify_between" v-if="detail.shopProductSubsidy.subsidyAmount">
 								<view v-if="storeAccount">抵扣(余额:<text class="pf">¥</text>{{storeAccount.giveBalance}})</view>
 								<view v-if="storeAccount">抵扣(余额:<text class="pf">¥</text>{{storeAccount.giveBalance}})</view>
 								<view class="flex align_center" v-if="!disKdk" @click="hasKdk=!hasKdk">
 								<view class="flex align_center" v-if="!disKdk" @click="hasKdk=!hasKdk">
 									<uni-icons size="18" :type="hasKdk?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons> 
 									<uni-icons size="18" :type="hasKdk?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons> 
 									<text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
 									<text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
 								</view>
 								</view>
 								<view class="flex align_center" v-else>
 								<view class="flex align_center" v-else>
+									<uni-icons size="18" type="checkbox" color="#999"></uni-icons> 
 									<text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
 									<text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
 								</view>
 								</view>
 							</view>
 							</view>
@@ -352,8 +353,8 @@
 			},
 			},
 			// 禁用抵扣金额
 			// 禁用抵扣金额
 			disKdk(){
 			disKdk(){
-				const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.detail.shopProductSubsidy.subsidyAmount>0&&this.detail.shopProductSubsidy.subsidyAmount<this.storeAccount.giveBalance
-				return this.payType==2 || !kdk
+				const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.detail.shopProductSubsidy.subsidyAmount>0&&this.detail.shopProductSubsidy.subsidyAmount<=this.storeAccount.giveBalance
+				return this.payType=='2' || !kdk
 			},
 			},
 			// 经销商电话
 			// 经销商电话
 			dealerPhone(){
 			dealerPhone(){
@@ -365,7 +366,7 @@
 			},
 			},
 			// 总金额
 			// 总金额
 			totalAmount(){
 			totalAmount(){
-				return this.hasLogin&&this.detail&&this.detail.price * this.qty
+				return Number(this.hasLogin&&this.detail&&this.detail.price * this.qty).toFixed(2)
 			},
 			},
 			// 支付合计,结算金额
 			// 支付合计,结算金额
 			payAmount(){
 			payAmount(){
@@ -538,17 +539,28 @@
 							// 打开数量选择弹框
 							// 打开数量选择弹框
 							if(!this.showPopu){
 							if(!this.showPopu){
 								this.showPopu = true
 								this.showPopu = true
-								this.payType = this.showBalanceAuth ? 0 : (this.hasPay ? 1 : 2)
-								
+								this.payType = this.showBalanceAuth ? '0' : (this.hasPay ? '1' : '2')
+								if(this.hasBalancePay){
+									this.payType = this.storeAccount.rechargeBalance<this.payAmount ? (this.hasPay? '1' : '2'):'0'
+								}
 								this.hasKdk = this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount>0&&this.detail.shopProductSubsidy.subsidyAmount<this.storeAccount.giveBalance
 								this.hasKdk = this.detail.shopProductSubsidy&&this.detail.shopProductSubsidy.subsidyAmount>0&&this.detail.shopProductSubsidy.subsidyAmount<this.storeAccount.giveBalance
 							}else{
 							}else{
 								// 充值余额支付
 								// 充值余额支付
 								if(this.payType == 0){
 								if(this.payType == 0){
 									if(this.storeAccount.rechargeBalance<this.payAmount){
 									if(this.storeAccount.rechargeBalance<this.payAmount){
+										setTimeout(()=>{
+											this.payType = this.hasPay ? '1' : '2'
+										},100)
 										uni.showModal({
 										uni.showModal({
 											content: '充值余额不足!',
 											content: '充值余额不足!',
-											showCancel:false,
-											confirmText:'知道了'
+											confirmText:'去充值',
+											success: (res) => {
+												if (res.confirm) {
+													uni.navigateTo({
+														url: '/pagesB/accountBalance/accountBalance'
+													})
+												}
+											}
 										})
 										})
 										return;
 										return;
 									}
 									}
@@ -599,7 +611,8 @@
 										productCode: item.productCode,
 										productCode: item.productCode,
 										qty: item.qty,
 										qty: item.qty,
 										price:item.price,
 										price:item.price,
-										promoSn: item.promoSn
+										promoSn: item.promoSn,
+										payOnlineType: this.payType == 0 ? 'RECHARGE_BALANCE' : this.payType == 1 ? 'WXPAY_ONLINE' : ''
 									}
 									}
 								}) : []
 								}) : []
 								const removeList = res.data.removeList ? res.data.removeList.map(item => item.productCode) : []
 								const removeList = res.data.removeList ? res.data.removeList.map(item => item.productCode) : []
@@ -764,12 +777,16 @@
 				// 充值余额支付,判断是否不足
 				// 充值余额支付,判断是否不足
 				if(v==0){
 				if(v==0){
 					if(this.payAmount>this.storeAccount.rechargeBalance){
 					if(this.payAmount>this.storeAccount.rechargeBalance){
+						setTimeout(()=>{
+							this.payType = this.hasPay ? '1' : '2'
+						},100)
 						uni.showToast({
 						uni.showToast({
-								title: '充值余额不足',
-								icon: 'none'
+							title: '充值余额不足',
+							icon: 'none'
 						})
 						})
-						this.payType = this.hasPay ? 1 : 2
 					}
 					}
+				}else{
+					this.payType = v
 				}
 				}
 			},
 			},
 			// 确认付款
 			// 确认付款

+ 21 - 4
pagesB/transactionRecord/transactionRecord.vue

@@ -14,7 +14,10 @@
 			  <view class="month-card" v-for="item in list" :key="item.tradeMonth">
 			  <view class="month-card" v-for="item in list" :key="item.tradeMonth">
 			    <view class="month-header">
 			    <view class="month-header">
 			      <text class="month-title">{{item.tradeMonth}}</text>
 			      <text class="month-title">{{item.tradeMonth}}</text>
-			      <text class="month-total">总计:¥{{item.totalAmount}}</text>
+			      <view>
+					  <text class="month-total">总计:{{item.totalAmount}}</text>
+					  <text style="font-size: 10px;margin-left:5px;"> 元</text>
+				  </view>
 			    </view>
 			    </view>
 			    
 			    
 			    <view class="record-list">
 			    <view class="record-list">
@@ -25,11 +28,16 @@
 			      >
 			      >
 			        <view class="item-left">
 			        <view class="item-left">
 			          <text class="amount-label">{{tabType==0?'充值':'消费'}}</text>
 			          <text class="amount-label">{{tabType==0?'充值':'消费'}}</text>
+					  <text class="time" v-if="tabType==0">充值人:{{sitem.operatorName}}</text>
+					  <text class="time" v-if="tabType==0">{{sitem.bizType=='ZERO'?'清零时间':'充值时间'}}:{{sitem.tradeDate}}</text>
 					  <text class="time" v-if="tabType==1&&sitem.bizType=='SALES'">{{sitem.finishFlag==1?'支付时间':'采购时间'}}:{{sitem.tradeDate}}</text>
 					  <text class="time" v-if="tabType==1&&sitem.bizType=='SALES'">{{sitem.finishFlag==1?'支付时间':'采购时间'}}:{{sitem.tradeDate}}</text>
 					  <text class="time" v-if="tabType==1&&sitem.bizType=='REFUND'">退款时间:{{sitem.tradeDate}}</text>
 					  <text class="time" v-if="tabType==1&&sitem.bizType=='REFUND'">退款时间:{{sitem.tradeDate}}</text>
-					  <text class="time" v-if="tabType==0">{{sitem.bizType=='ZERO'?'清零时间':'充值时间'}}:{{sitem.tradeDate}}</text>
 			        </view>
 			        </view>
-					<text class="amount">¥{{sitem.tradeAmount}}</text>
+					<view class="amount">
+						<text :class="sitem.bizType=='ZERO'?'red':''" v-if="tabType==0">{{sitem.bizType=='ZERO'?'':'+'}}{{sitem.tradeAmount}}</text>
+						<text :class="sitem.bizType=='SALES'?'red':''" v-if="tabType==1">{{sitem.bizType=='SALES'?'':'+'}}{{sitem.tradeAmount}}</text>
+						<text style="font-size: 10px;margin-left:5px;"> 元</text>
+					</view>
 			      </view>
 			      </view>
 			    </view>
 			    </view>
 			  </view>
 			  </view>
@@ -64,7 +72,10 @@ export default {
     }
     }
   },
   },
   onLoad(opts){
   onLoad(opts){
-	this.tabType = opts.type  
+	this.tabType = opts.type
+	uni.setNavigationBarTitle({
+		title: opts.type==0?'充值交易记录':'消费交易记录'
+	})
   },
   },
   onShow() {
   onShow() {
 	this.getRow(1)
 	this.getRow(1)
@@ -90,6 +101,9 @@ export default {
   methods: {
   methods: {
 	  changeTab(type){
 	  changeTab(type){
 		  this.tabType = type
 		  this.tabType = type
+		  uni.setNavigationBarTitle({
+		  	title: this.tabType==0?'充值交易记录':'消费交易记录'
+		  })
 		  this.list = []
 		  this.list = []
 		  this.lastMoth = ''
 		  this.lastMoth = ''
 		  this.getRow(1)
 		  this.getRow(1)
@@ -204,6 +218,9 @@ export default {
   padding: 0 15px;
   padding: 0 15px;
   background-color: #fff;
   background-color: #fff;
   border-radius: 8px;
   border-radius: 8px;
+  .red{
+	  color: #ff0000
+  }
 }
 }
 
 
 .record-item {
 .record-item {