lilei 4 months ago
parent
commit
db0325520c

+ 2 - 2
App.vue

@@ -1,8 +1,8 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.2.132:9110/saas/clz/', // 本地
-			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
+			// baseUrl: 'http://192.168.2.132:9110/saas/clz/', // 本地
+			baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},
 		onLaunch: function() {

+ 6 - 4
pagesB/accountBalance/accountBalance.vue

@@ -121,9 +121,11 @@ export default {
   flex-direction: column;
   
   .balance-info {
-	background: linear-gradient(to bottom, #00aaff, #0188c5);  
-	padding: 10rpx 20rpx 30rpx;
-    box-shadow: 0 4rpx 12rpx rgba(30, 144, 255, 0.5);
+	background: linear-gradient(to bottom, #03A9F4, #2196F3);
+	padding: 20rpx;
+	box-shadow: 0 4rpx 12rpx rgba(30, 144, 255, 0.5);
+	margin: 10px;
+	border-radius: 10px;
     
     .balance-item {
       width: 50%;
@@ -162,7 +164,7 @@ export default {
 	  .recharge-val{
 		  font-size: 16px;
 		  color: whitesmoke;
-		  background: #ff9800;
+		  background: #ff5722;
 		  padding: 20rpx;
 		  width: 150rpx;
 	  }

+ 77 - 0
pagesB/components/payOptions.vue

@@ -0,0 +1,77 @@
+<template>
+	<view class="pay-options">
+		<view class="flex align_center justify_between">
+			<text>{{title}}:</text>
+		</view>
+		<view class="pay-item">
+			<view class="flex align_center justify_between" @tap="changeItem(0)">
+				<view>
+					<uni-icons size="18" :type="defaultValue=='0'?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons>
+				</view>
+				<view>充值余额(<text class="pf">¥</text>{{balance}})</view>
+			</view>
+			<view class="flex align_center justify_between" @tap="changeItem(1)">
+				<view>
+					<uni-icons size="18" :type="defaultValue=='1'?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons>
+				</view>
+				<view>微信支付</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			title: {
+				type: String,
+				default: '支付方式'
+			},
+			value: {
+				type: String,
+				default: '1'
+			},
+			balance: {
+				type: Number,
+				default: 0
+			}
+		},
+		data() {
+			return {
+				defaultValue: this.value,
+			}
+		},
+		methods: {
+			changeItem(val){
+				this.defaultValue = val
+				this.$emit('input',this.defaultValue)
+				this.$emit('change',this.defaultValue)
+			}
+		},
+		watch: {
+			value(val) {
+				this.defaultValue = val
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	.pay-options {
+		padding: 0;
+		.pay-item {
+			margin-top: 10upx;
+			>view {
+				padding: 10upx 0;
+				font-size: 28upx;
+				color: #666;
+			}
+			.pf{
+				font-size:20rpx;
+			}
+			>view:last-child {
+				border-bottom: none;
+			}
+		}
+	}
+</style>

+ 19 - 1
pagesB/procureOrder/creatOrder.vue

@@ -35,9 +35,15 @@
 					<view class="product-price">
 						<view>
 							<view class="product-price-item">
-								<text>合计</text>
+								<text>总金额</text>
 								<text class="price">¥{{Number(totalAmount).toFixed(2)}}</text>
 							</view>
+							<view class="product-price-item" v-if="hasBalancePay">
+								<view class="flex align_center"><uni-icons size="18" :type="hasBlancel?'checkbox-filled':'checkbox'" color="#2196f3"></uni-icons> 抵扣(余额:¥3.00)</view>
+								<view class="flex align_center">
+									<text>¥2.00</text>
+								</view>
+							</view>
 							<view class="product-price-item" v-if="totalDiscount">
 								<text>优惠金额</text>
 								<text class="price">¥{{Number(totalDiscount).toFixed(2)}}</text>
@@ -46,6 +52,10 @@
 								<text>代金券</text>
 								<text class="price">¥{{Number(totalCoupon).toFixed(2)}}</text>
 							</view>
+							<view class="product-price-item" v-if="totalAmount">
+								<text>合计:</text>
+								<text class="price">¥{{Number(totalAmount).toFixed(2)}}</text>
+							</view>
 						</view>
 					</view>
 				</scroll-view>
@@ -124,6 +134,7 @@
 				safeAreaBottom: 0, // 底部安全区域高度
 				showPopu: false, // 弹框
 				payData: null ,// 付款参数
+				hasBlancel: true
 			}
 		},
 		computed: {
@@ -139,6 +150,10 @@
 			shelfInfo(){
 				return this.$store.state.vuex_storeShelf
 			},
+			// 抵扣余额支付是否可用,有【余额支付权限】且该产品有抵扣金额
+			hasBalancePay(){
+				return true
+			},
 			// 最小支付金额
 			minPayAmount(){
 				const shelfInfo = this.shelfInfo
@@ -419,6 +434,9 @@
 								font-weight: bold;
 							}
 						}
+						&:last-child{
+							justify-content: flex-end;
+						}
 					}
 				}
 			}

+ 36 - 5
pagesB/shopiing/productDetail.vue

@@ -170,10 +170,23 @@
 						<text>配送商:{{shelfInfo.dealerName}}</text>
 						<view @click="callPhone()"><uni-icons size="18" type="phone" color="dodgerblue"></uni-icons><text style="font-size:12px;">拨打</text></view>
 					</view>
-					<!-- <view class="flex align_center justify_between" v-if="shelfInfo">
-						<text>支付方式:在线支付</text>
-						<view><uni-icons size="18" type="right" color="dodgerblue"></uni-icons></view>
-					</view> -->
+					<view v-if="hasBalancePay&&!isAddCart">
+						<view class="totalBar-box">
+							<view class="flex align_center justify_between">
+								<view>总金额</view>
+								<view><text class="pf">¥</text>50.00</view>
+							</view>
+							<view class="flex align_center justify_between">
+								<view>抵扣(余额:<text class="pf">¥</text>3.00)</view>
+								<view class="flex align_center"><uni-icons size="18" type="checkbox" color="#2196f3"></uni-icons> <text class="pf">¥</text>2.00</view>
+							</view>
+							<view class="flex align_center justify_between">
+								<view>合计</view>
+								<view><text class="pf">¥</text>48.00</view>
+							</view>
+						</view>
+						<payOptions v-model="payType"></payOptions>
+					</view>
 				</view>
 				<view class="popu-content-btn">
 					<view class="popu-content-btn-item cartbtn" v-if="isAddCart" @click="submitCart($event)">加入购物车</view>
@@ -242,7 +255,11 @@
 	import { getShopDetail } from '@/api/shop.js'
 	import { purchaseSave, purchaseCheck, purchasePay } from '@/api/purchase.js'
 	import { toAuthStore, toLogin } from "@/utils/index.js"
+	import payOptions from '../components/payOptions.vue'
 	export default {
+		components: {
+			payOptions
+		},
 		data() {
 			return {
 				loading: false,
@@ -264,6 +281,7 @@
 				showPay: false, // 是否显示付款信息
 				isAddCart: false, // 是否加入购物车
 				payData: null, // 支付参数
+				payType: 0, // 支付方式,抵扣、还是微信
 			}
 		},
 		onLoad(option) {
@@ -304,6 +322,10 @@
 				const shelfInfo = this.shelfInfo
 				return shelfInfo&&shelfInfo.minAmount ? shelfInfo.minAmount : 0
 			},
+			// 抵扣余额支付是否可用,有【余额支付权限】且该产品有抵扣金额
+			hasBalancePay(){
+				return true
+			},
 			// 经销商电话
 			dealerPhone(){
 				const shelfInfo = this.shelfInfo
@@ -1160,7 +1182,16 @@
 					width: 100%;
 					padding-top: 20px;
 					> view{
-						padding: 10px 0;
+						padding: 5px 0;
+					}
+					.totalBar-box{
+						margin-bottom: 20rpx;
+						> view{
+							padding: 5px 0;
+						}
+						.pf{
+							font-size: 20rpx;
+						}
 					}
 				}
 				.pupu-box-pay-item{