Quellcode durchsuchen

做到了余额支付

shish vor 1 Jahr
Ursprung
Commit
36e566263e

+ 10 - 8
hdApp/src/admin/billing/affirm.vue

@@ -42,7 +42,7 @@
 				<view class="module-com input-line-wrap">
 				<view class="module-com input-line-wrap">
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
 						<view class="tui-title ">客户</view>
 						<view class="tui-title ">客户</view>
-						<view class="tui-input" v-if="clientInfo.id">{{ clientInfo.name }}</view>
+						<view class="tui-input" v-if="customId>0">{{ customName }}</view>
 						<view class="tui-placeholder" style="width: 100%" v-else>游客</view>
 						<view class="tui-placeholder" style="width: 100%" v-else>游客</view>
 					</tui-list-cell>
 					</tui-list-cell>
 
 
@@ -50,6 +50,7 @@
 						<view class="tui-title">结账方式</view>
 						<view class="tui-title">结账方式</view>
 						<button @tap="hasPay = 1" class="admin-button-com middle" :class="hasPay == 1 ? 'blue' : 'default'">线下</button>
 						<button @tap="hasPay = 1" class="admin-button-com middle" :class="hasPay == 1 ? 'blue' : 'default'">线下</button>
 						<button @click="hasPay = 2" class="admin-button-com middle" :class="hasPay == 2 ? 'blue' : 'default'">赊账</button>
 						<button @click="hasPay = 2" class="admin-button-com middle" :class="hasPay == 2 ? 'blue' : 'default'">赊账</button>
+						<button @click="hasPay = 4" class="admin-button-com middle" :class="hasPay == 4 ? 'blue' : 'default'">余额</button>
 					</tui-list-cell>
 					</tui-list-cell>
 
 
 					<tui-list-cell class="line-cell" :arrow="true" v-if="hasPay == 1">
 					<tui-list-cell class="line-cell" :arrow="true" v-if="hasPay == 1">
@@ -138,14 +139,15 @@ export default {
 			freight:'',
 			freight:'',
 			modifyPrice:0,
 			modifyPrice:0,
 			payWay:0,
 			payWay:0,
-			clientInfo: '',
 			showCustomer: false,
 			showCustomer: false,
 			sendType:1,
 			sendType:1,
 			discountIndex:0,
 			discountIndex:0,
 			discount:['打折','95折','9折','85折','8折','75折','7折','65折','6折'],
 			discount:['打折','95折','9折','85折','8折','75折','7折','65折','6折'],
 			payWayList:[{name:"线下微信",id:0},{name:"线下支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
 			payWayList:[{name:"线下微信",id:0},{name:"线下支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
 			payWayindex:0,
 			payWayindex:0,
-			hasPay:1
+			hasPay:1,
+			customId:0,
+			customName:''
 		};
 		};
 	},
 	},
 	onLoad() {
 	onLoad() {
@@ -160,7 +162,10 @@ export default {
 				title: this.getMerchantInfo.name
 				title: this.getMerchantInfo.name
 			});
 			});
 		}
 		}
-		this.modifyPrice = this.allPrice.toFixed(2);
+		this.modifyPrice = this.allPrice.toFixed(2)
+
+		this.customId = this.option.customId ? this.option.customId : 0
+		this.customName = this.option.customName ? this.option.customName : ''
 	},
 	},
 	computed: {
 	computed: {
 		...mapGetters(["getMerchantInfo", "getLoginInfo","getDictionariesInfo"])
 		...mapGetters(["getMerchantInfo", "getLoginInfo","getDictionariesInfo"])
@@ -212,9 +217,6 @@ export default {
 			let allPrices = this.allPrice.toFixed(2)
 			let allPrices = this.allPrice.toFixed(2)
 			this.modifyPrice = (Number(allPrices) + Number(this.freight) + Number(this.packingMoney)).toFixed(2);
 			this.modifyPrice = (Number(allPrices) + Number(this.freight) + Number(this.packingMoney)).toFixed(2);
 		},
 		},
-		changeCustomerFn(info) {
-			this.clientInfo = info;
-		},
 		affirmFormSubmit(){
 		affirmFormSubmit(){
 
 
 			if(this.$util.isEmpty(this.selectList)){
 			if(this.$util.isEmpty(this.selectList)){
@@ -236,7 +238,7 @@ export default {
 				orderType:2,//开单类型,1商品开单 2花材开单
 				orderType:2,//开单类型,1商品开单 2花材开单
 				packingFee:packingFee,
 				packingFee:packingFee,
 				sendCost:this.freight,
 				sendCost:this.freight,
-				customId:this.clientInfo.id,
+				customId:this.customId,
 				payWay:this.payWay,
 				payWay:this.payWay,
 				sendType:this.sendType,
 				sendType:this.sendType,
 				modifyPrice: this.modifyPrice,
 				modifyPrice: this.modifyPrice,

+ 7 - 7
hdApp/src/admin/home/workbench.vue

@@ -23,10 +23,10 @@
         <div class="price">{{ $util.numberFormat(data.todayData.income) }}</div>
         <div class="price">{{ $util.numberFormat(data.todayData.income) }}</div>
       </div>
       </div>
       <div class="user-bottom">
       <div class="user-bottom">
-        <div class="info-list" @click="goToKindStat">
-          <div class="info-list-name">花束</div>
+        <div class="info-list">
+          <div class="info-list-name">访客</div>
           <div class="info-list-value">
           <div class="info-list-value">
-            {{ $util.numberFormat(data.todayData.bouquet) || 0 }}
+            {{ $util.numberFormat(data.todayData.visit) || 0 }}
           </div>
           </div>
         </div>
         </div>
         <navigator url="/admin/home/order" open-type="switchTab" class="info-list">
         <navigator url="/admin/home/order" open-type="switchTab" class="info-list">
@@ -35,10 +35,10 @@
             {{ $util.numberFormat(data.todayData.order) || 0 }}
             {{ $util.numberFormat(data.todayData.order) || 0 }}
           </div>
           </div>
         </navigator>
         </navigator>
-        <div class="info-list">
-          <div class="info-list-name">访客</div>
+        <div class="info-list" @click="">
+          <div class="info-list-name">昨天</div>
           <div class="info-list-value">
           <div class="info-list-value">
-            {{ $util.numberFormat(data.todayData.visit) || 0 }}
+            {{ $util.numberFormat(0) || 0 }}
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
@@ -587,7 +587,7 @@ export default {
       this.$util.pageTo({url:'/admin/order/workOrder'})
       this.$util.pageTo({url:'/admin/order/workOrder'})
     },
     },
     goKjKd(){
     goKjKd(){
-      this.$util.pageTo({url:'/admin/billing/index?customId=0&customName=""'})
+      this.$util.pageTo({url:'/admin/billing/index?customId=0'})
     },
     },
     goShKd(){
     goShKd(){
       this.$util.pageTo({url:'/admin/custom/selectCustom'})
       this.$util.pageTo({url:'/admin/custom/selectCustom'})

+ 6 - 3
mallApp/src/pages/billing/affirmGhs.vue

@@ -285,7 +285,8 @@ export default {
 				}
 				}
 				return { productId: ele.id, num:num,ptItemId:ele.itemId,property:1,unitType:unitType,property:1};
 				return { productId: ele.id, num:num,ptItemId:ele.itemId,property:1,unitType:unitType,property:1};
 			});
 			});
-			let params = { product: JSON.stringify(product),...this.form }
+			let hdId = this.option.hdId ? this.option.hdId : 0
+			let params = { product: JSON.stringify(product),...this.form,hdId:hdId }
 			if(this.form.sendType == 2){
 			if(this.form.sendType == 2){
 				if(this.$util.isEmpty(this.userInfo.lat) || this.$util.isEmpty(this.userInfo.long)){
 				if(this.$util.isEmpty(this.userInfo.lat) || this.$util.isEmpty(this.userInfo.long)){
 					this.$msg('请填写地址')
 					this.$msg('请填写地址')
@@ -297,12 +298,14 @@ export default {
 				uni.hideLoading()
 				uni.hideLoading()
 				this.removeMemory()
 				this.removeMemory()
 				if(res.code && res.code == 1){
 				if(res.code && res.code == 1){
-					this.$util.pageTo({ url: "/pages/callback/index", type: 2, query: { pageStatus: 1, ...res.data } })
+					this.$util.pageTo({ url: "/pages/callback/index", type: 2, query: { pageStatus: 1, ...res.data,hdId:hdId } })
 				}
 				}
 			});
 			});
 		},
 		},
 		modifyItem() {
 		modifyItem() {
-			this.$util.pageTo({url:'/pages/item/item?account='+this.account,type:2})
+			let account = this.option.account ? this.option.account : 0
+			let hdId = this.option.hdId ? this.option.hdId : 0
+			this.$util.pageTo({url:'/pages/item/item?account='+account+'&hdId='+hdId,type:2})
 		}
 		}
 	}
 	}
 };
 };

+ 28 - 54
mallApp/src/pages/callback/index.vue

@@ -30,9 +30,10 @@
         </block>
         </block>
         <block v-if="pageStatus == 1 || pageStatus == 2">
         <block v-if="pageStatus == 1 || pageStatus == 2">
           <div class="call-one-btn">
           <div class="call-one-btn">
-            <button v-if="isYeBtnShow" class="button-com red pay-ye" @click="balancePayFn">余额支付</button>
-            <button v-if="getPayType == 1" class="button-com green pay-wx" @click="wxPayFn">微信支付</button>
-            <button v-else class="button-com green pay-wx" @click="wxPayFnOld">微信支付</button>
+            <view v-if="Number(hdInfo.balance)>0" style="color:green;font-weight:bold;font-size:36upx;margin-top:28upx;">可用余额 ¥{{ parseFloat(hdInfo.balance) }}</view>
+            <button v-if="isYeBtnShow" class="button-com green pay-wx" @click="balancePayFn" style="height:100upx;line-height:50upx;">余额支付</button>
+            <button v-if="getPayType == 1" class="button-com green pay-wx" @click="wxPayFn" style="height:100upx;line-height:50upx;">微信支付</button>
+            <button v-else class="button-com green pay-wx" @click="wxPayFnOld" style="height:100upx;line-height:50upx;">微信支付</button>
           </div>
           </div>
         </block>
         </block>
         <block v-else-if="pageStatus == 3 || pageStatus == 4 || pageStatus == 5">
         <block v-else-if="pageStatus == 3 || pageStatus == 4 || pageStatus == 5">
@@ -49,22 +50,6 @@
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
-    <modal-module :show="passwordModal" @cancel="modalCancel" @click="passwordModalClick" :maskClosable="false" title="支付密码" padding="30upx 30upx" >
-      <template v-slot:content>
-        <div class="app-modal-input-wrap">
-          <div class="inp-list-line">
-            <div class="line-input">
-              <input type="password" v-model="form.payPassword" :adjust-position="false" class="inp-input" />
-            </div>
-          </div>
-        </div>
-      </template>
-    </modal-module>
-    <alert-module :show="setPassModal" btnText="去设置" btnColor="#FF2842" padding="66upx 24upx 66upx 24upx" @click="hideAlert" >
-      <div class="go-login-module">
-        <div>请先设置密码</div>
-      </div>
-    </alert-module>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -75,6 +60,7 @@ import wexinPay from "@/utils/pay/wxPay";
 import { getShopUser } from "@/utils/auth";
 import { getShopUser } from "@/utils/auth";
 import { balancePay, wxPay } from "@/api/order";
 import { balancePay, wxPay } from "@/api/order";
 import { postWxCode } from '@/api/mini';
 import { postWxCode } from '@/api/mini';
+import { getHdInfo } from '@/api/hd';
 export default {
 export default {
   name: "index",
   name: "index",
   components: {
   components: {
@@ -98,7 +84,9 @@ export default {
       totalPrice:0,
       totalPrice:0,
       orderSn:'',
       orderSn:'',
       getPayType:1,
       getPayType:1,
-      hasRequestApi:false
+      hasRequestApi:false,
+      hdInfo:{},
+      isYeBtnShow:false
     };
     };
   },
   },
   computed: {
   computed: {
@@ -122,27 +110,22 @@ export default {
       this.payDiscountPrice = this.option.payDiscountPrice;
       this.payDiscountPrice = this.option.payDiscountPrice;
       this.payDiscountType = this.option.payDiscountType;
       this.payDiscountType = this.option.payDiscountType;
       this.initClass(this.pageStatus);
       this.initClass(this.pageStatus);
-      getShopUser(true);
-    },
-    _balancePay() {
-      if (!this.form.payPassword) {
-        this.$msg("请先输入支付密码!");
-        return false;
+      getShopUser(true)
+
+      if(this.option.hdId && this.option.hdId>0){
+        getHdInfo({id:this.option.hdId}).then(res=>{
+          if(res.code == 1){
+            this.hdInfo = res.data.hd ? res.data.hd : {}
+            if(Number(this.hdInfo.balance) >= Number(this.totalPrice)){
+              this.isYeBtnShow = true
+            }
+          }
+        })
       }
       }
-      balancePay({
-        payPassword: this.form.payPassword,
-        orderSn: this.orderSn,
-        couponId: this.option.couponId
-      }).then(res => {
-          this.modalCancel();
-          this.$msg("支付成功!");
-          this.payCallData = res.data;
-          this.paySuccess();
-      })
+
     },
     },
     wxPayFn() {
     wxPayFn() {
       let that = this
       let that = this
-
       //解决重复提交问题
       //解决重复提交问题
       if(this.hasRequestApi == true){
       if(this.hasRequestApi == true){
         this.$msg('正在请求,请5秒后重试')
         this.$msg('正在请求,请5秒后重试')
@@ -194,24 +177,15 @@ export default {
     payFail() {
     payFail() {
     },
     },
     balancePayFn() {
     balancePayFn() {
-      if (this.shopUser.hasPayPwd == 0) {
-        this.setPassModal = true;
-      } else {
-        this.passwordModal = true;
-      }
-    },
-    passwordModalClick(e) {
-      if (e.index === 0) {
-        this.modalCancel();
-      } else {
-        this._balancePay();
-      }
-    },
-    modalCancel() {
-      this.passwordModal = false;
-      this.form.payPassword = "";
+			let that = this
+			that.$util.confirmModal({content:'确认支付?'},() => {
+        balancePay({orderSn:this.orderSn}).then(res=>{
+          if(res.code == 1){
+
+          }
+        })
+      })
     },
     },
-    // 暂未设置密码
     hideAlert() {
     hideAlert() {
       this.$util.pageTo("/pages/user/password");
       this.$util.pageTo("/pages/user/password");
     },
     },

+ 1 - 1
mallApp/src/pages/home/recent.vue

@@ -170,7 +170,7 @@ export default {
       this.$msg('开发中')
       this.$msg('开发中')
     },
     },
     bug(item){
     bug(item){
-      this.pageTo({ url:'/pages/item/item?account='+item.shopId})
+      this.pageTo({ url:'/pages/item/item?account='+item.shopId+'&hdId='+item.id})
     },
     },
     recharge(item){
     recharge(item){
       this.pageTo({ url:'/pages/member/recharge?account='+item.shopId+'&id='+item.id+'&salt='+item.salt})
       this.pageTo({ url:'/pages/member/recharge?account='+item.shopId+'&id='+item.id+'&salt='+item.salt})

+ 7 - 5
mallApp/src/pages/item/item.vue

@@ -82,7 +82,7 @@
 		<app-activily-coupon :show.sync="isNewCustom" :info="newCustomGift" :ghsId="ghsId" />
 		<app-activily-coupon :show.sync="isNewCustom" :info="newCustomGift" :ghsId="ghsId" />
 		
 		
 		<view v-if="cartItemShow == true" style="position: fixed;z-index: 190;top: 0;left: 0;width: 100vw;height: 100vh;background: rgba(0, 0, 0, 0.6);color: #fff;" @click="hideCartItem()">
 		<view v-if="cartItemShow == true" style="position: fixed;z-index: 190;top: 0;left: 0;width: 100vw;height: 100vh;background: rgba(0, 0, 0, 0.6);color: #fff;" @click="hideCartItem()">
-			<view style="position: fixed;bottom: 108upx;width:100vw;heigh:300upx;background-color:white;" @click.stop="">
+			<view style="position: fixed;bottom: 108upx;width:100vw;background-color:white;" @click.stop="">
 				<view class="commodity-view">
 				<view class="commodity-view">
 					<view class="summary-bar">
 					<view class="summary-bar">
 						<button class="admin-button-com blue middle" style="border:none;" @click.stop="delMemory()">清空花材</button>
 						<button class="admin-button-com blue middle" style="border:none;" @click.stop="delMemory()">清空花材</button>
@@ -310,7 +310,9 @@ export default {
 			this.popupShow = false;
 			this.popupShow = false;
 		},
 		},
 		buyHs(){
 		buyHs(){
-			this.$util.pageTo({url: "/pages/home/category?account="+this.option.account,type:2})
+			let hdId = this.option.hdId ? this.option.hdId : 0
+			let account = this.option.account ? this.option.account : 0
+			this.$util.pageTo({url: "/pages/home/category?account="+account+'&hdId='+hdId,type:2})
 		},
 		},
 		showBigCover(item){
 		showBigCover(item){
       		this.$util.pageTo({url: "/pages/item/detail?id="+item.id+"&account="+this.option.account})
       		this.$util.pageTo({url: "/pages/item/detail?id="+item.id+"&account="+this.option.account})
@@ -319,7 +321,6 @@ export default {
 			this.init = false
 			this.init = false
 			const shopId = uni.getStorageSync('account')
 			const shopId = uni.getStorageSync('account')
 			this.option.shopId = shopId
 			this.option.shopId = shopId
-
 			getInfo().then(res=>{
 			getInfo().then(res=>{
 				if(res.code == 1){
 				if(res.code == 1){
 					if(res.data.info && res.data.info.merchantName){
 					if(res.data.info && res.data.info.merchantName){
@@ -478,8 +479,9 @@ export default {
 					return
 					return
 				}
 				}
 				this.setSelectInfoByType({ type: this.pageType, info: list });
 				this.setSelectInfoByType({ type: this.pageType, info: list });
-
-				this.pageTo({url: '/pages/billing/affirmGhs',query:{account:this.options.account},type:2})
+				let hdId = this.option.hdId ? this.option.hdId : 0
+				let account = this.option.account ? this.option.account : 0
+				this.pageTo({url: '/pages/billing/affirmGhs?account='+account+'&hdId='+hdId,type:2})
 			} else {
 			} else {
 				this.$msg("请选择花材");
 				this.$msg("请选择花材");
 			}
 			}

+ 3 - 19
mallApp/src/pages/order/detail.vue

@@ -199,27 +199,11 @@ export default {
       });
       });
     },
     },
     payFn() {
     payFn() {
-      let data = {
-        orderSn: this.data.orderSn,
-        totalPrice: this.data.prePrice,
-        couponId: 0
-      };
-      this.$util.pageTo({
-        url: "/pages/callback/index",
-        query: {
-          pageStatus: 1,
-          id: this.data.id,
-          ...data
-        }
-      });
+      let data = { orderSn: this.data.orderSn, totalPrice: this.data.prePrice, couponId: 0 }
+      this.$util.pageTo({ url: "/pages/callback/index", query: { pageStatus: 1, id: this.data.id, ...data,hdId:this.data.hdId } })
     },
     },
     evealFn() {
     evealFn() {
-      this.$util.pageTo({
-        url: "/pages/order/comment",
-        query: {
-          id: this.data.id
-        }
-      });
+      this.$util.pageTo({ url: "/pages/order/comment", query: { id: this.data.id } })
     }
     }
   }
   }
 };
 };