Răsfoiți Sursa

红包 余额等

shish 4 ani în urmă
părinte
comite
6b5482f686

+ 4 - 0
ghsApp/src/admin/changePrice/components/Item.vue

@@ -94,6 +94,10 @@ export default {
 			font-weight: bold;
 			color: #333333;
 			padding-top: 0px;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			width:360rpx;
 		}
 		& .kc {
 			color:red;

+ 16 - 49
ghsApp/src/admin/shopYeChange/list.vue

@@ -3,28 +3,24 @@
 		<block v-if="!$util.isEmpty(list.data)">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
-					<t-th v-for="(item, index) in columns" :key="index" :align="item.align">
-						{{ item.name }}
-					</t-th>
-				</t-tr>
-				<t-tr v-for="(item, index) in list.data" :key="index">
-					<t-td
-						v-for="(column, colIndex) in columns"
-						:key="colIndex"
-						:align="column.align"
-						:color="column.color"
-					>
-						<view>
-							{{ item[column.dataIndex] || "" }}
-						</view>
-					</t-td>
+					<t-th>事项</t-th>
+					<t-th>金额</t-th>
+					<t-th>可提现余额</t-th>
+					<t-th>总余额</t-th>
 				</t-tr>
+				<view v-for="(item, index) in list.data" :key="index">
+					<t-tr>
+						<t-td align="center" color="info"><view style="width:200rpx;">{{ item.event }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.amount) }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.txBalance) }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.balance) }}</view></t-td>
+					</t-tr>
+				</view>
 			</t-table>
 		</block>
 		<block v-else>
 			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 		</block>
-    <!-- <kd-entrance></kd-entrance> -->
 	</div>
 </template>
 
@@ -33,61 +29,32 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import { changeList } from '@/api/shop-ye-change'
 import list from '@/mixins/list'
 export default {
-	name: "cashList",//余额变动记录
+	name: "cashList",
 	components: {
 		AppWrapperEmpty
 	},
 	mixins:[list],
 	data() {
 		return {
-			columns: [
-				{
-					name: "事项",
-					dataIndex: "event",
-					color: "info",
-					align: "center"
-				},
-				{
-					name: "金额",
-					dataIndex: "amount",
-					color: "info",
-					align: "center"
-				},
-				{
-					name: "余额",
-					dataIndex: "txBalance",
-					color: "info",
-					align: "center"
-				}
-			],
 		};
 	},
 	methods: {
 		async init(){
-			uni.showLoading({
-                    title: '加载中'
-                });
+			uni.showLoading({title: '加载中'})
 			try {
 				const res = await changeList({
-					page:this.list.page,tx:2
+					page:this.list.page,tx:0
 				})
-
 				if (this.$util.isEmpty(res.data.list)){
 					this.completes(res)
 					return
 				}
-
-
 				let currentList = res.data.list
-
 				currentList.forEach(function(item,index,array){
-
 					array[index].amount = item.io ==0 ? '-'+item.amount : '+'+item.amount
-
 				});
 				res.data.list = currentList
-
-			   this.completes(res)
+				this.completes(res)
               } finally {
                  uni.hideLoading(); 
               }

+ 2 - 2
ghsApp/src/components/module/app-commodity.vue

@@ -6,8 +6,8 @@
 		<view class="cmd-info_bx">
 			<view class="tit" >{{ info.itemName || "" }}</view>
 			<view class="kc num-open_bx flex-end" v-if="type == COMMODITY_TYPE.COMMON">
-				<view class="price csss" v-if="Number(info.discountPrice)>0 && Number(info.discountPrice)<Number(info.price)">¥{{ info.discountPrice }}</view>
-				<view class="price csss" v-else>¥{{ info.price }}</view>
+				<view class="price csss" v-if="Number(info.discountPrice)>0 && Number(info.discountPrice)<Number(info.price)">¥{{ parseFloat(info.discountPrice) }}</view>
+				<view class="price csss" v-else>¥{{ parseFloat(info.price) }}</view>
 				<view style="text-align: right" >
 					<view class="open-bx" >
 						<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delEvent(info.variety)" v-if="bigCount > 0 || smallCount > 0"></i>

+ 11 - 7
hdApp/src/admin/billing/affirmGhs.vue

@@ -489,14 +489,18 @@ export default {
 				content: '确认提交?',
 				success: function (res) {
 					if (res.confirm) {
+						uni.showLoading({title: '加载中',mask:true})
 						createOrder(params).then(res => {
-							const {data: { orderSn,realPrice,count,hasDebtPay }} = res;
-							self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&realPrice=${realPrice}&count=${count}&hasDebtPay=${hasDebtPay}`, type: 2})
-							setTimeout(() => {
-								self.removeMemory(self.ghsInfo.id)
-								//删除小菊的记忆
-								uni.removeStorageSync("ghsXj"+params.ghsId)
-							}, 600)
+							if(res.code == 1){
+								uni.hideLoading()
+								const {orderSn,realPrice,id} = res.data
+								self.pageTo({url: '/pagesPurchase/wechatPay',query:{orderSn,realPrice,id}, type: 2})
+								setTimeout(() => {
+									self.removeMemory(self.ghsInfo.id)
+									//删除小菊的记忆
+									uni.removeStorageSync("ghsXj"+params.ghsId)
+								}, 600)
+							}
 						});
 					}
 				}

+ 10 - 9
hdApp/src/admin/home/me.vue

@@ -67,6 +67,7 @@
           </view>
         </view>
         <view class="module-com content_box user-open_bx">
+          <view class="input-line-wrap">
 
             <tui-list-cell
               @click="pageTo({ url: '/admin/coupon/couponList' })"
@@ -77,15 +78,15 @@
               <div class="tui-title">我的红包</div>
             </tui-list-cell>
 
-          <tui-list-cell
-              @click="pageTo({ url: '/pagesStore/me/shopYeChange' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-            >
-              <div class="tui-title">余额明细</div>
-          </tui-list-cell>
-          <view class="input-line-wrap">
+            <tui-list-cell
+                @click="pageTo({ url: '/pagesStore/me/shopYeChange' })"
+                class="line-cell"
+                :hover="false"
+                :arrow="true"
+              >
+                <div class="tui-title">余额明细</div>
+            </tui-list-cell>
+
             <tui-list-cell
               @click="pageTo({ url: '/pagesStore/me/withdraw' })"
               class="line-cell"

+ 5 - 0
hdApp/src/api/shop/index.js

@@ -62,3 +62,8 @@ export const addCloudPrint = data => {
 export const getPrint = data => {
 	return https.get('/shop-ext/get-print', data)
 }
+
+//获取采购所支持的支付方式
+export const getCgPayWay = data => {
+	return https.get('/shop/get-cg-pay-way', data)
+}

+ 2 - 2
hdApp/src/components/module/app-commodity.vue

@@ -11,9 +11,9 @@
 						<view style="padding:2rpx 10rpx 5rpx 10rpx;text-align: center;color: red;border: 1px solid red;margin-right: 20rpx;line-height: 1;font-size: 20rpx">
 							{{((Number(info.discountPrice)/Number(info.prePrice)).toFixed(2)*10).toFixed(1)+'折'}}
 						</view>
-						<text style="text-decoration:line-through;color:#A9A9A9">¥{{info.prePrice}}</text>
+						<text style="text-decoration:line-through;color:#A9A9A9">¥{{parseFloat(info.prePrice)}}</text>
 					</view>
-					<view class="price" >¥{{ info.price }}</view>
+					<view class="price" >¥{{ parseFloat(info.price) }}</view>
 				</view>
 				<view class="price" v-else></view>
 				<view style="text-align: right" >

+ 2 - 2
hdApp/src/pagesPurchase/purDetails.vue

@@ -191,7 +191,7 @@
 
 <script>
 
-import { purchaseDetail, purchaseClearWxPay, purchaseDebtPay, purchaseWxPay,purchaseClearCreateOrder } from "@/api/purchase/index";
+import { purchaseDetail, purchaseDebtPay, purchaseClearCreateOrder } from "@/api/purchase/index";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
   name: "info",
@@ -290,7 +290,7 @@ export default {
     },
     toPay () {
       uni.navigateTo({
-        url: `/pagesPurchase/wechatPay?type=2&orderSn=${this.detailInfo.orderSn}&realPrice=${this.detailInfo.realPrice}`
+        url: `/pagesPurchase/wechatPay?orderSn=${this.detailInfo.orderSn}&realPrice=${this.detailInfo.realPrice}&id=${this.detailInfo.id}`
       })
     },
     getError () {

+ 89 - 92
hdApp/src/pagesPurchase/wechatPay.vue

@@ -1,74 +1,45 @@
 <template>
-  <!-- 各种回调页面 -->
-  <div class="app-content awaitPayYe awaitPayYe">
+    <div class="app-content awaitPayYe awaitPayYe">
     <div class="callback-wrap">
       <div class="bg_01"></div>
       <div class="callback-blo">
-        <!-- 使用icon -->
-        <!-- 待支付 -->
         <block>
           <div class="icon">
             <i class="iconfont icondaizhifu"></i>
           </div>
         </block>
         <view class="wait">待付款</view>
-        <!-- 待支付 -->
         <block>
           <div class="price">
             <span>¥</span>
             <span class="app-size-36 app-bold">{{ realPrice || '0.00'}}</span>
           </div>
           <div class="order-num app-color-3">订单号: {{ orderSn || ''}}</div>
-          <div v-if="count >0" class="order-num app-color-3" style="margin-top:18rpx;font-size:26rpx;"><span style="font-weight:bold;padding-right:8rpx;">{{count}}</span>秒后订单失效</div>
+          <div v-if="count > miniCount" class="order-num app-color-3" style="margin-top:18rpx;font-size:26rpx;"><span style="font-weight:bold;padding-right:8rpx;">{{count}}</span>秒后失效</div>
           <div v-else class="order-num app-color-3" style="margin-top:12rpx;font-size:26rpx;">订单已失效</div>
         </block>
         <block>
-          <div v-if="count >0" class="call-one-btn">
-            <button
-              class="button-com green pay-wx"
-              @click="postponePay"
-              v-if="hasDebtPay === '1'"
-            >延期支付</button>
-            <button
-              class="button-com green pay-wx"
-              @click="_wxPay"
-              v-if="type ==='1' || type === '2'"
-            >微信支付</button>
-            <button
-              class="button-com green pay-wx"
-              @click="_balancePay"
-              v-if="type === '2'"
-            >余额支付</button>
-          </div>
-          <div v-else class="call-one-btn">
-            <button
-              class="button-com default pay-wx"
-              disabled="true"
-              v-if="hasDebtPay === '1'"
-            >延期支付</button>
-            <button
-              class="button-com default pay-wx"
-              disabled="true"
-              v-if="type ==='1' || type === '2'"
-            >微信支付</button>
-            <button
-              class="button-com default pay-wx"
-              disabled="true"
-              v-if="type === '2'"
-            >余额支付</button>
+          <view class="balance">余额:¥{{balance}}</view>
+          <div class="call-one-btn">
+
+            <view v-if="Number(balance) >= Number(realPrice)">
+              <button class="button-com pay-wx" :class="[count >miniCount ? 'green':'default']" :disabled="count >miniCount ? false : true" v-if="Number(balance) >0" @click="balancePay">余额支付</button>
+              <button class="button-com pay-wx" :class="[count >miniCount ? 'green':'default']" :disabled="count >miniCount ? false : true" @click="_wxPay">微信支付</button>
+            </view>
+            <view v-else>
+              <button class="button-com pay-wx" :class="[count >miniCount ? 'green':'default']" :disabled="count >miniCount ? false : true" @click="_wxPay">微信支付</button>
+              <button class="button-com pay-wx" :class="[count >miniCount ? 'green':'default']" :disabled="count >miniCount ? false : true" v-if="Number(balance) >0" @click="balancePay">余额支付</button>
+            </view>
+
+            <button class="button-com pay-wx" :class="[count >miniCount ? 'green':'default']" :disabled="count >miniCount ? false : true" @click="debtPay" v-if="hasDebtPay === '1'">延期支付</button>
+
           </div>
+
         </block>
       </div>
     </div>
     <!-- 键盘 -->
-    <keyboard-module
-      :show="keyShow"
-      @comfirm="hideKeyFn"
-      @clickKey="clickKeyFn"
-      :psdShow="true"
-      :type="_type"
-      @closeKey="closeKeyFn"
-    />
+    <keyboard-module :show="keyShow" @comfirm="hideKeyFn" @clickKey="clickKeyFn" :psdShow="true" :type="_type" @closeKey="closeKeyFn" />
     <alert-module>
       <div class="go-login-module">
         <div>请先设置支付密码!</div>
@@ -78,7 +49,8 @@
 </template>
 
 <script>
-import { purchaseClearCreateOrder, purchaseClearWxPay, purchaseBalancePay, purchaseDebtPay, purchaseWxPay } from "@/api/purchase/index";
+import { purchaseBalancePay, purchaseDebtPay, purchaseWxPay } from "@/api/purchase/index";
+import { getCgPayWay } from "@/api/shop/index";
 import keyboardModule from './components/keyboard'
 import { mapGetters } from "vuex";
 import wexinPay from "@/utils/pay/wxPay";
@@ -100,67 +72,81 @@ export default {
       realPrice: '',
       _type: '1',
       pageId: '',
-      count:10,
-      hasDebtPay:0
+      count:150,
+      hasDebtPay:0,
+      balance:0,
+      miniCount:120
     };
   },
   onLoad (options) {
+    this.id = options.id
     this.orderSn = options.orderSn;
     this.realPrice = options.realPrice;
-    this.type = options.type
-    this.hasDebtPay = options.hasDebtPay
-    let that = this
-    this.count = options.count
-    let t =setInterval(function(){
-      if(that.count > 0){
-        that.count--
-      }else{
-        clearInterval(t);
-      }
-    },1000);
 
   },
   computed: {
     ...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
   },
   mounted () {
-    // this.getWeChat()
   },
   methods: {
-    // 延期支付
-    postponePay () {
+    init(){
+      let that = this
+      getCgPayWay({id:this.option.id}).then(res=>{
+        if(res.code == 1){
+          that.hasDebtPay = res.data.hasDebtPay
+          that.balance = res.data.balance
+          that.count = res.data.count
+
+          let t =setInterval(function(){
+            if(that.count > 0){
+              that.count--
+            }else{
+              clearInterval(t);
+            }
+          },1000);
+
+        }
+      })
+    },
+    debtPay () {
       let that = this
       uni.showModal({
 				title: '提示',
-				content: '确认延期支付?',
+				content: '确认延期?',
 				success: function (res) {
 					if (res.confirm) {
-            console.log(that.orderSn)
+
+            uni.showLoading({title: '加载中',mask:true})
+
 						purchaseDebtPay({ orderSn: that.orderSn }).then(res => {
-              console.log(res)
-              that.pageTo({
-                url: '/pagesPurchase/particulars?id=' + res.data.id,
-                type: 2
-              })
-            }).catch(err => { console.log(err) })
+
+              //关闭加载中
+              uni.hideLoading()
+              if(res.code == 1){
+                that.pageTo({
+                  url: '/pagesPurchase/particulars?id=' + res.data.id,
+                  type: 2
+                })
+              }
+
+            }).catch(err => { })
 					}
 				}
 			});
       
     },
-    // getWeChat () {
-    //   purchaseClearCreateOrder({ id: this.options.id }).then(res => {
-    //     this.options = res.data
-    //     this.orderSn = res.data.orderSn
-    //   }).catch(err => { console.log(err) })
-    // },
     _wxPay () {
-      let Fn = this.type === '1' ? purchaseClearWxPay({ orderSn: this.orderSn }) : this.type === '2' ? purchaseWxPay({ orderSn: this.orderSn }) : null
-      Fn.then(res => {
-        console.log(res, 128)
-        this.pageId = res.data.id
-        wexinPay(res.data, this.getSuccess, this.getError)
-      }).catch(err => { console.log(err) })
+      uni.showLoading({title: '加载中',mask:true})
+      purchaseWxPay({ orderSn: this.orderSn }).then(res => {
+        uni.hideLoading()
+        if(res.code == 1){
+          this.pageId = res.data.id
+          wexinPay(res.data, this.getSuccess, this.getError)
+        }
+      }).catch(err => {
+
+      })
     },
     getSuccess () {
       this.pageTo({
@@ -174,8 +160,12 @@ export default {
     },
     getError () {
     },
-    _balancePay () {
+    balancePay () {
       let self = this
+      if(Number(this.balance) < Number(this.realPrice)){
+        this.$msg('余额不足')
+        return false;
+      }
       if (this.getLoginInfo.payPassword) {
         self.keyShow = true
       } else {
@@ -199,17 +189,22 @@ export default {
     },
     // 点击了完成
     hideKeyFn () {
+      uni.showLoading({title: '加载中',mask:true})
       if (this.psdKey.length === 6) {
         let data = {
           orderSn: this.orderSn,
           password: this.psdKey
         }
         purchaseBalancePay(data).then(res => {
-          this.pageTo({
-            url: '/pagesPurchase/particulars?id=' + res.data.id,
-            type: 2
-          })
-        }).catch(err => { console.log(err) })
+          //关闭加载中
+          uni.hideLoading()
+          if(res.code == 1){
+            this.pageTo({
+              url: '/pagesPurchase/particulars?id=' + res.data.id,
+              type: 2
+            })
+          }
+        }).catch(err => {})
       } else {
         this.$msg('请输入六位数支付密码')
       }
@@ -222,7 +217,6 @@ export default {
 .app-content {
   .callback-wrap {
     padding-top: 50px;
-    // background-image: url("../../src/static/images/callback/bg.png");
     background-repeat: no-repeat;
     background-size: 100% auto;
     position: relative;
@@ -292,4 +286,7 @@ export default {
   font-weight: 700;
   margin: 20upx 0;
 }
-</style>
+.balance{
+  margin-top:20rpx;
+}
+</style>

+ 22 - 50
hdApp/src/pagesStore/me/shopYeChange.vue

@@ -3,28 +3,24 @@
 		<block v-if="!$util.isEmpty(list.data)">
 			<t-table :headerBackgroundColor="'#F0F2F6'">
 				<t-tr header>
-					<t-th v-for="(item, index) in columns" :key="index" :align="item.align">
-						{{ item.name }}
-					</t-th>
-				</t-tr>
-				<t-tr v-for="(item, index) in list.data" :key="index">
-					<t-td
-						v-for="(column, colIndex) in columns"
-						:key="colIndex"
-						:align="column.align"
-						:color="column.color"
-					>
-						<view>
-							{{ item[column.dataIndex] || "" }}
-						</view>
-					</t-td>
+					<t-th>事项</t-th>
+					<t-th>金额</t-th>
+					<t-th>可提现余额</t-th>
+					<t-th>总余额</t-th>
 				</t-tr>
+				<view v-for="(item, index) in list.data" :key="index" @click="goDetail(item)">
+					<t-tr>
+						<t-td align="center" color="info"><view >{{ item.event }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.amount) }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.txBalance) }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ parseFloat(item.balance) }}</view></t-td>
+					</t-tr>
+				</view>
 			</t-table>
 		</block>
 		<block v-else>
 			<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 		</block>
-    <!-- <kd-entrance></kd-entrance> -->
 	</div>
 </template>
 
@@ -33,64 +29,41 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import { changeList } from '@/api/shop-ye-change'
 import list from '@/mixins/list'
 export default {
-	name: "cashList",//余额变动记录
+	name: "cashList",
 	components: {
 		AppWrapperEmpty
 	},
 	mixins:[list],
 	data() {
 		return {
-			columns: [
-				{
-					name: "事项",
-					dataIndex: "event",
-					color: "info",
-					align: "center"
-				},
-				{
-					name: "金额",
-					dataIndex: "amount",
-					color: "info",
-					align: "center"
-				},
-				{
-					name: "余额",
-					dataIndex: "txBalance",
-					color: "info",
-					align: "center"
-				}
-			],
 		};
 	},
 	methods: {
 		async init(){
-			uni.showLoading({
-                    title: '加载中'
-                });
+			uni.showLoading({title: '加载中'})
 			try {
 				const res = await changeList({
-					page:this.list.page,tx:2
+					page:this.list.page,tx:0
 				})
-
 				if (this.$util.isEmpty(res.data.list)){
 					this.completes(res)
 					return
 				}
-
-
 				let currentList = res.data.list
-
 				currentList.forEach(function(item,index,array){
-
 					array[index].amount = item.io ==0 ? '-'+item.amount : '+'+item.amount
-
 				});
 				res.data.list = currentList
-
-			   this.completes(res)
+			   	this.completes(res)
               } finally {
                  uni.hideLoading(); 
               }
+		},
+		goDetail(item){
+			console.log('item',item)
+			if(item.capitalType && item.capitalType == 11){
+				this.$util.pageTo({url: "/pagesPurchase/purDetails",query: {id:item.relateId}});
+			}
 		}
 	},
 	async onPullDownRefresh() {
@@ -109,5 +82,4 @@ export default {
 	
 };
 </script>
-
 <style lang="scss" scoped></style>