shish 2 lat temu
rodzic
commit
49fff885c0

+ 73 - 0
ghsApp/src/admin/custom/balanceChange.vue

@@ -0,0 +1,73 @@
+<template>
+<view class="app-content">
+		<block v-if="!$util.isEmpty(list.data)">
+			<t-table :headerBackgroundColor="'#F0F2F6'">
+				<t-tr header>
+					<t-th>日期</t-th>
+					<t-th><view style="width:230upx;">事项</view></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.addTime.substr(5,11) }}</view></t-td>
+						<t-td align="center" color="info"><view style="width:230upx;">{{ item.event }}</view></t-td>
+						<t-td align="center" color="info"><view >{{ item.amount }}</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>
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { debtChangeList } from '@/api/custom'
+import list from '@/mixins/list'
+export default {
+	name: "debtChange",
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[list],
+	data() {
+		return {
+		};
+	},
+	methods: {
+		async init(){
+			const res = await debtChangeList({ page:this.list.page,customId:this.option.customId })
+			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 ? '-'+parseFloat(item.amount) : '+'+parseFloat(item.amount)
+			});
+			res.data.list = currentList
+			this.completes(res)
+		},
+		goDetail(item){
+		}
+	},
+	async onPullDownRefresh() {
+		this.resetList();
+		await this.init()
+		uni.stopPullDownRefresh();
+	},
+	async onReachBottom() {
+		if (!this.list.finished) {
+			await this.init()
+			uni.stopPullDownRefresh();;
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	
+};
+</script>
+<style lang="scss" scoped></style>

+ 2 - 2
ghsApp/src/api/custom/index.js

@@ -1,7 +1,7 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
-export const rechargeClear = data => {
-	return https.get('/custom/recharge-clear', data)
+export const rechargeFn = data => {
+	return https.get('/custom/recharge', data)
 }
 
 export const modifySeatSnFn = data => {

+ 15 - 13
ghsApp/src/pagesClient/member/detail.vue

@@ -24,14 +24,15 @@
               </view>
 
               <view class="total-list">
-                <view class="app-color-3">消费次数</view>
-                <view class="list-num">{{ parseFloat(userInfo.buyNum) || 0 }}</view>
+                <view class="app-color-3">余额</view>
+                <view class="list-num">{{ userInfo.balance ? parseFloat(userInfo.balance) : 0 }}</view>
               </view>
 
-              <view class="total-list">
+              <view class="total-list" @click="showNum(userInfo)">
                 <view class="app-color-3">消费金额</view>
                 <view class="list-num">{{ parseFloat(userInfo.buyAmount) || 0 }}</view>
               </view>
+
           </view>
         </view>
       </view>
@@ -80,6 +81,10 @@
               <div class="tui-title">欠款变动明细</div>
             </tui-list-cell>
 
+            <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/admin/custom/balanceChange?customId='+userInfo.id})">
+              <div class="tui-title">余额变动明细</div>
+            </tui-list-cell>
+
             <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({url:'/admin/order/itemOrder?customId='+userInfo.id})">
               <div class="tui-title">下单记录</div>
             </tui-list-cell>
@@ -151,7 +156,7 @@
       </template>
 		</modal-module>
 
-		<modal-module :show="czShow" @click="confirmRecharge" :maskClosable="true" title="充值结账" padding="30rpx 30rpx" >
+		<modal-module :show="czShow" @click="confirmRecharge" :maskClosable="true" title="充值" padding="30rpx 30rpx" >
       <template v-slot:content>
         <div class="app-modal-input-wrap">
         <div class="inp-list-line">
@@ -171,7 +176,7 @@ import { share } from "@/mixins";
 import ModalModule from "@/components/plugin/modal"
 import { getUserDet,debt} from "@/api/member";
 import { changeShowStock,changeWlName,changeLevel,createSeatSnFn,modifySeatSnFn } from "@/api/custom"
-import { updateDebtLimit,updateCustomBlack,changeDiscount,changeName,rechargeClear} from "@/api/custom";
+import { updateDebtLimit,updateCustomBlack,changeDiscount,changeName,rechargeFn} from "@/api/custom";
 export default {
   name: "detail",
   components: {
@@ -209,7 +214,7 @@ export default {
           }
         },
         {
-          name: "充值结账",
+          name: "充值",
           img: `${this.$constant.imgUrl}/retail/member/tab-icon-1.png`,
           funtion: () => {
             this.czShow = true
@@ -249,6 +254,9 @@ export default {
     this.getUserDetail()
   },
   methods: {
+    showNum(info){
+      this.$msg("消费"+info.buyNum+"次")
+    },
     changeLevelPrice(){
 			const that = this;
 			uni.showActionSheet({
@@ -342,7 +350,7 @@ export default {
         this.$msg('充值金额需要大于0')
         return false
       }
-      rechargeClear({amount:this.rechargeMoney}).then(res=>{
+      rechargeFn({amount:this.rechargeMoney,customId:this.userInfo.id}).then(res=>{
         if(res.code == 1){
           that.czShow = false
 				  that.czFocus = false
@@ -418,7 +426,6 @@ export default {
       this.getUserDetail()
     },
     getUserDetail() {
-      let that = this
       getUserDet({ id: this.option.id }).then(res => {
         this.debtLimit = res.data.debtLimit;
         this.userInfo = res.data;
@@ -428,11 +435,6 @@ export default {
         this.form.showStock = this.userInfo.showStock
         this.discount = parseFloat(res.data.discount)
       })
-    },
-    orderMoreFn() {
-      this.orderMoreStatus = false;
-    },
-    modalCancel() {
     }
   }
 };