shish 5 лет назад
Родитель
Сommit
185fd37bb3

+ 37 - 8
ghsApp/src/admin/home/me.vue

@@ -64,20 +64,25 @@
                         <text>¥ </text> {{infoData.balance}}
                         </view>
                         <view>
-                            可提现余额 ¥ {{infoData.txBalance}}
+                            可提现余额 ¥ {{infoData.txBalance}} 
+                            <text v-if="infoData.txBalance > 0" @click="checkToApplyCash" class="to-cash">提现</text>
                         </view>
                     </view>
-                    <button @click="applyCach" class="admin-button-com default" >提现</button>
+                    <button @click="pageTo({url:'/pagesStore/me/recharge'})" class="admin-button-com default" >充值</button>
                 </view>
                 <view class="module-com content_box user-open_bx">
                     <view class="input-line-wrap">
                         <tui-list-cell @click="pageTo({url:'/pagesStore/me/withdraw'})" class="line-cell" :hover="false" :arrow="true">
                             <div class="tui-title">提现记录</div>
-                        <!-- <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请输入" maxlength="50" type="text" /> -->
                         </tui-list-cell>
                         <tui-list-cell @click="pageTo({url:'/pagesStore/me/incomeExpenses'})" class="line-cell" :hover="false" :arrow="true">
                             <div class="tui-title">收支明细</div>
-                        <!-- <input v-model="form.name" placeholder-class="phcolor" class="tui-input" name="name" placeholder="请输入" maxlength="50" type="text" /> -->
+                        </tui-list-cell>
+                        <tui-list-cell @click="pageTo({url:'/pagesStore/me/rechargeList'})" class="line-cell" :hover="false" :arrow="true">
+                            <div class="tui-title">充值记录</div>
+                        </tui-list-cell>
+                        <tui-list-cell @click="pageTo({url:'/pagesStore/me/cashSet'})" class="line-cell" :hover="false" :arrow="true">
+                            <div class="tui-title">提现帐号设置</div>
                         </tui-list-cell>
                     </view>
                 </view>
@@ -123,7 +128,6 @@
             shopShow(){
                 this.shopId = this.getLoginInfo.shopId
                 this.$refs.dorpdownSelect.dropdownShow = true;
-                
             },
            async init(){
                 try {
@@ -151,11 +155,29 @@
               }
               
             },
-           async applyCach(){
+            checkToApplyCash(){
+                let self = this;
+                //没有设置提现帐号则提示
+                if(self.infoData.cashAccount == ''){
+                    console.log(1111)
+                    uni.showModal({
+                        title: '提示',
+                        content: '您还没有设置提现帐号',
+                        confirmText: "去设置",
+                        success: function (res) {
+                            if (res.confirm) {
+                                self.applyCash()
+                            }
+                        }
+                    });
+                }else{
+                    self.applyCash()
+                }
+            },
+           async applyCash(){
                 uni.showLoading({
                     title: '加载中'
-                });
-                
+                }); 
                try {
                    const { data } = await applyCash({})
                    uni.showToast({
@@ -308,6 +330,13 @@
                 height: 50upx;
                 border-radius: 25upx;
             }
+            & .to-cash{
+               margin-left:20upx;
+               border:1upx solid rgba(0,0,0,.2);
+               border-radius:18upx;
+               font-size:1upx;
+               padding:0 15upx 0 15upx;
+            }
         }
         & .user-open_bx {
             margin-top: 20px;

+ 4 - 1
ghsApp/src/pages.json

@@ -160,7 +160,10 @@
 			"root": "pagesStore",
 			"pages": [
 				{"path": "me/withdraw","style": {"navigationBarTitleText": "提现记录"}},
-				{"path": "me/incomeExpenses","style": {"navigationBarTitleText": "收支记录"}}
+				{"path": "me/incomeExpenses","style": {"navigationBarTitleText": "收支记录"}},
+				{"path": "me/recharge","style": {"navigationBarTitleText": "充值"}},
+				{"path": "me/rechargeList","style": {"navigationBarTitleText": "充值记录"}},
+				{"path": "me/cashSet","style": {"navigationBarTitleText": "提现帐号设置"}}
 			]
 		},
 		{

+ 75 - 0
ghsApp/src/pagesStore/me/cashSet.vue

@@ -0,0 +1,75 @@
+<template>
+<view>充值</view>
+</template>
+
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { withdrawCashList } from '@/api/store'
+import list from '@/mixins/list'
+export default {
+	name: "cashSet",//提现记录
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[list],
+	data() {
+		return {
+			columns: [
+				{
+					name: "提现时间",
+					dataIndex: "time",
+					color: "info",
+					align: "center"
+				},
+				{
+					name: "提现金额",
+					dataIndex: "amount",
+					color: "info",
+					align: "center"
+				},
+				{
+					name: "状态",
+					dataIndex: "statusText",
+					color: "info",
+					align: "center"
+				}
+			],
+		};
+	},
+	methods: {
+		async init(){
+			 uni.showLoading({
+                    title: '加载中'
+                });
+				try {
+				const res = await withdrawCashList({
+					page:this.list.page
+				})
+				res.data.list  = res.data.list.map(i=>({
+					...i,
+					statusText: i.status ==1?'待处理':i.status ==2?'处理中':'已完成'				  
+				}))
+			   this.completes(res)
+              } finally {
+                 uni.hideLoading(); 
+              }
+		}
+	},
+	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>

+ 75 - 0
ghsApp/src/pagesStore/me/recharge.vue

@@ -0,0 +1,75 @@
+<template>
+<view>充值</view>
+</template>
+
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { withdrawCashList } from '@/api/store'
+import list from '@/mixins/list'
+export default {
+	name: "recharge",//提现记录
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[list],
+	data() {
+		return {
+			columns: [
+				{
+					name: "提现时间",
+					dataIndex: "time",
+					color: "info",
+					align: "center"
+				},
+				{
+					name: "提现金额",
+					dataIndex: "amount",
+					color: "info",
+					align: "center"
+				},
+				{
+					name: "状态",
+					dataIndex: "statusText",
+					color: "info",
+					align: "center"
+				}
+			],
+		};
+	},
+	methods: {
+		async init(){
+			 uni.showLoading({
+                    title: '加载中'
+                });
+				try {
+				const res = await withdrawCashList({
+					page:this.list.page
+				})
+				res.data.list  = res.data.list.map(i=>({
+					...i,
+					statusText: i.status ==1?'待处理':i.status ==2?'处理中':'已完成'				  
+				}))
+			   this.completes(res)
+              } finally {
+                 uni.hideLoading(); 
+              }
+		}
+	},
+	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>

+ 75 - 0
ghsApp/src/pagesStore/me/rechargeList.vue

@@ -0,0 +1,75 @@
+<template>
+<view>充值</view>
+</template>
+
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { withdrawCashList } from '@/api/store'
+import list from '@/mixins/list'
+export default {
+	name: "rechargeList",//提现记录
+	components: {
+		AppWrapperEmpty
+	},
+	mixins:[list],
+	data() {
+		return {
+			columns: [
+				{
+					name: "提现时间",
+					dataIndex: "time",
+					color: "info",
+					align: "center"
+				},
+				{
+					name: "提现金额",
+					dataIndex: "amount",
+					color: "info",
+					align: "center"
+				},
+				{
+					name: "状态",
+					dataIndex: "statusText",
+					color: "info",
+					align: "center"
+				}
+			],
+		};
+	},
+	methods: {
+		async init(){
+			 uni.showLoading({
+                    title: '加载中'
+                });
+				try {
+				const res = await withdrawCashList({
+					page:this.list.page
+				})
+				res.data.list  = res.data.list.map(i=>({
+					...i,
+					statusText: i.status ==1?'待处理':i.status ==2?'处理中':'已完成'				  
+				}))
+			   this.completes(res)
+              } finally {
+                 uni.hideLoading(); 
+              }
+		}
+	},
+	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>