lilei 4 months ago
parent
commit
3666e83101

+ 5 - 4
pagesB/accountBalance/accountBalance.vue

@@ -19,10 +19,10 @@
       >
         <view class="flex justify_between align_center">
 			<view class="recharge-val flex align_center justify_center">
-				<text>¥{{ opt.rechargeAmount }}</text>
+				<text>¥{{ Number(opt.rechargeAmount).toFixed(2) }}</text>
 			</view>
 			<view class="recharge-option-content flex_1">
-				<view><text class="gift-text">充值{{ opt.rechargeAmount }}元送{{ opt.giveAmount }}元抵扣</text></view>
+				<view><text class="gift-text">充值{{ Number(opt.rechargeAmount).toFixed(2) }}元送{{ Number(opt.giveAmount).toFixed(2) }}元抵扣</text></view>
 			</view>
 			<view class="recharge-btn flex align_center justify_center" @tap="handleRecharge(opt)">
 				<text>去充值</text>
@@ -95,7 +95,7 @@ export default {
   methods: {
 	  // 抵扣余额
 	  getStoreAccount(){
-		storeAccount({storeSn:this.shelfInfo.storeSn}).then(res => {
+		storeAccount({storeSn:this.shelfInfo.storeSn }).then(res => {
 			this.$store.state.vuex_storeAccount = res.data
 			this.balanceList[0].value = Number(res.data.rechargeBalance||0).toFixed(2)
 			this.balanceList[1].value = Number(res.data.giveBalance||0).toFixed(2)
@@ -250,7 +250,7 @@ export default {
 		  font-size: 16px;
 		  color: red;
 		  padding: 20rpx;
-		  width: 180rpx;
+		  width: 200rpx;
 		  border-right: 1px dashed #fbdbd1;
 	  }
 	  .recharge-btn{
@@ -270,6 +270,7 @@ export default {
 		  padding: 10rpx 20rpx;
 		  border-top: 1px dashed #fbdbd1;
 		  line-height: 1.8;
+		  word-break: break-all;
 	  }
     }
     

+ 10 - 1
pagesB/components/payOptions.vue

@@ -5,9 +5,12 @@
 		</view>
 		<view class="pay-item">
 			<view class="flex align_center justify_between" v-if="hasBalancePay" @tap="changeItem(0)">
-				<view>
+				<view v-if="!disableCz">
 					<uni-icons size="18" :type="defaultValue=='0'?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons>
 				</view>
+				<view v-else>
+					<uni-icons size="18" type="circle-filled" color="#aaa"></uni-icons>
+				</view>
 				<view class="flex align_center">充值余额(<text class="pf">¥</text>{{balance}})</view>
 			</view>
 			<view class="flex align_center justify_between" v-if="hasPay" @tap="changeItem(1)">
@@ -48,6 +51,10 @@
 			hasPay: {
 				type: Boolean,
 				default: false
+			},
+			disableCz:{
+				type: Boolean,
+				default: false
 			}
 		},
 		data() {
@@ -57,6 +64,8 @@
 		},
 		methods: {
 			changeItem(val){
+				// 禁用充值选项
+				if(val==0 && this.disableCz){return}
 				this.defaultValue = val
 				this.$emit('input',this.defaultValue)
 				this.$emit('change',this.defaultValue)

+ 10 - 5
pagesB/procureOrder/creatOrder.vue

@@ -45,7 +45,7 @@
 									<text>¥{{subsidyAmount}}</text>
 								</view>
 								<view class="flex align_center" v-else>
-									<uni-icons size="18" type="checkbox" color="#999"></uni-icons>
+									<uni-icons size="18" type="circle-filled" color="#aaa"></uni-icons>
 									<text>¥{{subsidyAmount}}</text>
 								</view>
 							</view>
@@ -63,7 +63,7 @@
 							</view>
 						</view>
 						<view style="margin-top: 10px;">
-							<payOptions v-model="payType" :hasBalancePay="hasBalancePay" :hasPay="shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'" @change="v=>hasKdk=v!=2" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
+							<payOptions v-model="payType" :hasBalancePay="hasBalancePay" :disableCz="disCzOption" :hasPay="shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'" @change="v=>hasKdk=v!=2" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
 						</view>
 					</view>
 				</scroll-view>
@@ -171,11 +171,11 @@
 			showBalanceAuth(){
 				return this.$store.state.vuex_showBalanceAuth
 			},
-			// 余额支付是否显示,合计金额小于充值余额
+			// 充值余额支付是否显示,合计金额小于充值余额
 			hasBalancePay(){
-				return this.$store.state.vuex_showBalanceAuth&&this.storeAccount&&this.totalAmount<=this.storeAccount.rechargeBalance
+				return this.$store.state.vuex_showBalanceAuth&&this.storeAccount&&!this.disCzOption
 			},
-			// 抵扣余额
+			// 抵扣余额
 			storeAccount(){
 				return this.$store.state.vuex_storeAccount
 			},
@@ -184,6 +184,11 @@
 				const kdk = this.storeAccount&&this.subsidyAmount>0&&this.subsidyAmount<=this.storeAccount.giveBalance
 				return this.payType==2 || !kdk
 			},
+			// 禁用的支付选项
+			disCzOption(){
+				const ta = this.hasKdk?this.totalAmount-this.subsidyAmount:this.totalAmount
+				return ta>this.storeAccount.rechargeBalance
+			},
 			// 最小支付金额
 			minPayAmount(){
 				const shelfInfo = this.shelfInfo

+ 14 - 3
pagesB/shopiing/productDetail.vue

@@ -190,7 +190,7 @@
 									<text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
 								</view>
 								<view class="flex align_center" v-else>
-									<uni-icons size="18" type="checkbox" color="#999"></uni-icons> 
+									<uni-icons size="18" type="circle-filled" color="#aaa"></uni-icons> 
 									<text class="pf">¥</text>{{detail.shopProductSubsidy.subsidyAmount}}
 								</view>
 							</view>
@@ -199,7 +199,7 @@
 								<view style="font-weight: bold;"><text class="pf">¥</text>{{payAmount}}</view>
 							</view>
 						</view>
-						<payOptions v-model="payType" :hasBalancePay="showBalanceAuth" :hasPay="hasPay" @change="payTypeChange" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
+						<payOptions v-model="payType" :hasBalancePay="showBalanceAuth" :disableCz="disCzOption" :hasPay="hasPay" @change="payTypeChange" :balance="storeAccount?storeAccount.rechargeBalance:0"></payOptions>
 					</view>
 				</view>
 				<view class="popu-content-btn">
@@ -320,6 +320,11 @@
 			  type: '1'
 			}
 		},
+		watch: {
+			disCzOption(v){
+				this.payType = v ? (this.hasPay ? 1 : 2) : 0
+			}
+		},
 		computed: {
 			...mapState(['hasLogin']),
 			// 登录用户信息
@@ -330,7 +335,7 @@
 			shelfInfo(){
 				return this.$store.state.vuex_storeShelf
 			},
-			//是否开启线上支付,支付方式不是线下支付
+			//是否开启线上支付,支付方式不是线下支付
 			hasPay(){
 				const shelfInfo = this.shelfInfo
 				return shelfInfo&&shelfInfo.payOnlineFlag&&shelfInfo.payOnlineFlag=='1'&&this.payType!=2
@@ -348,9 +353,14 @@
 			hasBalancePay(){
 				return this.$store.state.vuex_showBalanceAuth&&this.storeAccount.giveBalance&&this.detail&&!this.detail.shopPromoProduct
 			},
+			// 门店账户信息
 			storeAccount(){
 				return this.$store.state.vuex_storeAccount
 			},
+			// 禁用的支付选项
+			disCzOption(){
+				return this.payAmount>this.storeAccount.rechargeBalance
+			},
 			// 禁用抵扣金额
 			disKdk(){
 				const kdk = this.detail&&this.detail.shopProductSubsidy&&this.storeAccount&&this.detail.shopProductSubsidy.subsidyAmount>0&&this.detail.shopProductSubsidy.subsidyAmount<=this.storeAccount.giveBalance
@@ -361,6 +371,7 @@
 				const shelfInfo = this.shelfInfo
 				return shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
 			},
+			// 总数
 			totalNum(){
 				return this.hasLogin&&this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_cartTotal : 0
 			},