chenjj 5 gün önce
ebeveyn
işleme
3d643cdae3

+ 19 - 1
api/mine.js

@@ -60,4 +60,22 @@ export function getVolunteerChangeList(params) {
         method: 'get',
         params
     })
-}
+}
+
+//提交提现申请
+export function submitAmountApply(data) {
+    return request({
+        url: `/core/volunteer/account/submitAmountApply`,
+        method: 'post',
+        data
+    })
+}
+
+//获取当前用户提现状态
+export function getWithdrawStatus() {
+    return request({
+        url: `/core/volunteer/account/getWithdrawStatus`,
+        method: 'get',
+    })
+}
+

+ 2 - 2
config.js

@@ -2,8 +2,8 @@
 const config = {
 	// baseUrl: 'https://vue.ruoyi.vip/prod-api',
 	//cloud后台网关地址
-	baseUrl: 'http://192.168.100.95:9527',//嵘哥
-	// baseUrl: 'http://192.168.100.121:9527',//龙哥
+	// baseUrl: 'http://192.168.100.95:9527',//嵘哥
+	baseUrl: 'http://192.168.100.112:9527',//龙哥
 	// baseUrl: 'https://zybooks.tech/prod-api',
 	mapKey:'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',
 	appName: '金邻助家',

+ 0 - 1
pages/mine.vue

@@ -221,7 +221,6 @@ const userList = ref([
 	}
 ]);
 
-
 const onClick = (record) => {
 	console.log('record', record, record.page);
 	if (record.page) {

+ 2 - 1
pages_classify/pages/order/index.vue

@@ -140,7 +140,8 @@ const getOrderDetail = async () => {
 		});
 		const res = await getVolunteerOrderInfo({ orderId: orderId.value });
 		// const ad_res = await getAddress(res.data.addressId);
-		detaile.value = {...res.data.secondOrder,...res.data.address}
+		// detaile.value = {...res.data.secondOrder,...res.data.address}
+		detaile.value = { ...res.data.secondOrder, address:res.data.address.address,serveTimes:res.data.secondOrder.updateTime }
 		// if (data.volunteerPicture) {
 		// 	fileList.value = data.volunteerPicture.split(',').map(item => {
 		// 		return { url: item }

+ 5 - 4
pages_mine/pages/income/index.vue

@@ -19,8 +19,8 @@
                         <!-- <img :src="baseUrl" alt="" class="income-img"> -->
                         <view class="card-left-text">
                             <view class="card-left-name">
-                                <dict-tag :options="jlzj_client_source_type" :value="item.sourceType" />
-                                ({{ item.businessTierName }})
+                                <dict-tag :options="userType === 1?jlzj_client_source_type:jlzj_volunteer_source_type" :value="item.sourceType" />
+                                <!-- ({{ item.businessTierName }}) -->
                             </view>
                             <view class="card-left-date">{{ item.createTime }}</view>
                         </view>
@@ -62,8 +62,9 @@ import dayjs from 'dayjs/esm/index'
 import NoneView from '@/components/NoneView/index.vue'
 const {
     jlzj_money_change_type,
-    jlzj_client_source_type
-} = useDict('jlzj_money_change_type', 'jlzj_client_source_type');
+    jlzj_client_source_type,
+    jlzj_volunteer_source_type
+} = useDict('jlzj_money_change_type', 'jlzj_client_source_type','jlzj_volunteer_source_type');
 const baseUrl = config.baseUrl
 const userType = uni.getStorageSync('userType') //读取本地存储
 const data = ref({

+ 8 - 3
pages_mine/pages/wallet/index.vue

@@ -46,7 +46,7 @@
 <script setup>
 import { ref } from 'vue';
 import BankItem from '@/pages_mine/components/bank-item/bank-item.vue';
-import { getVolunteerAccountInfo,getAccountInfo } from "@/api/mine";
+import { getVolunteerAccountInfo,getAccountInfo,getWithdrawStatus } from "@/api/mine";
 import {
 	onShow
 } from '@dcloudio/uni-app';
@@ -71,9 +71,14 @@ const data = ref({
     balance: 0
 });
 const onWithdrawal = () => {
-    uni.navigateTo({
-        url: '/pages_mine/pages/withdrawal/index'
+    getWithdrawStatus().then(res => {
+        if(res.code === 200){
+        uni.navigateTo({
+                url: '/pages_mine/pages/withdrawal/index'
+            })
+        }
     })
+  
 }
 
 const onIncome = () => {

+ 121 - 24
pages_mine/pages/withdrawal/index.vue

@@ -3,60 +3,85 @@
         <view class="withdrawal-item">
             <label class="withdrawal-label">提现到账</label>
             <view class="withdrawal-item-right" @click="openSheet">
-                <view class="withdrawal-text">微信零钱</view>
+                <view class="withdrawal-text">{{ w_key }}</view>
                 <up-icon name="arrow-right"></up-icon>
             </view>
         </view>
-        <view class="withdrawal-item" >
+        <view v-if="w_key === '支付宝账户'">
+
+            <view class="withdrawal-item">
+                <label class="withdrawal-label">支付宝账户名</label>
+            </view>
+            <view class="price-box">
+                <input class="price-input2" placeholder="请输入支付宝账户名" border="none" v-model="priceData.name"
+                     />
+            </view>
+            <view class="withdrawal-item">
+                <label class="withdrawal-label">支付宝账号</label>
+            </view>
+            <view class="price-box">
+                <input class="price-input2" placeholder="请输入支付宝账号" border="none" v-model="priceData.code"
+                     />
+            </view>
+        </view>
+
+        <view class="withdrawal-item">
             <label class="withdrawal-label">提现金额</label>
         </view>
         <view class="price-box">
             <up-icon name="rmb" size="28" color="rgba(0, 0, 0, 1)"></up-icon>
-            <input class="price-input" placeholder="请输入提现金额" border="none" v-model="priceValue" @change="change" />
+            <input class="price-input" placeholder="请输入提现金额" border="none" v-model="priceData.price" @change="change" />
         </view>
         <view class="withdrawal-item">
-            <label class="withdrawal-label">可提现余额  <up-icon name="rmb"></up-icon>{{ maxPrice }}</label>
+            <label class="withdrawal-label">可提现余额 <up-icon name="rmb"></up-icon>{{ maxPrice }}</label>
             <view class="withdrawal-item-right" @click="onMaxChange">
                 <view class="withdrawal-text">全部提现</view>
             </view>
         </view>
 
         <view style="margin-top: 45px;">
-            <up-button type="primary" text="确定提现" @click="onSubmit" ></up-button> 
+            <up-button type="primary" text="确定提现" @click="onSubmit"></up-button>
         </view>
 
 
-        <up-action-sheet
-			:show="show"
-			@close="close"
-			@select="select"
-			:actions="actions"
-		>
-		</up-action-sheet>
+        <up-action-sheet :show="show" @close="close" @select="select" :actions="actions">
+        </up-action-sheet>
     </view>
 </template>
 
 <script setup>
 import { ref } from 'vue';
-
+import { getVolunteerAccountInfo,getAccountInfo,submitAmountApply} from "@/api/mine";
+import {
+    onShow,
+} from "@dcloudio/uni-app";
 const actions = [
     {
-        name: '微信零钱',
+        name: '支付宝账户',
     }
 ]
-
+const userType = uni.getStorageSync('userType') //读取本地存储
+const w_key = ref('支付宝账户');
 const show = ref(false);
 
-const maxPrice = ref(1200);
+const maxPrice = ref(0);
+
+const priceData = ref({
+    // price: '0.01',
+    // name: '搁置',
+    // code: '18696601943'
 
+    price: '',
+    name: '',
+    code: ''
+})
 
 
-const priceValue = ref('');
 const change = (e) => {
     console.log('change', e);
     const regex = /^\d*\.?\d*$/;
     if (!regex.test(e.detail.value)) {
-        priceValue.value = priceValue.value.replace(/[^\d.]/g, '');
+        priceData.value.price = priceData.value.price.replace(/[^\d.]/g, '');
     }
 };
 
@@ -66,21 +91,86 @@ const openSheet = (index) => {
 const close = () => {
     show.value = false;
 }
-const select = (index) => {
+const select = (row) => {
+    w_key.value = row.name
     console.log('select', index);
 }
 
-const onSubmit = () => {
+const errors =  (e) => {
     uni.showToast({
-        title: '提交成功',
-        icon: 'none'
+        title: e,
+        icon: 'none',
+        })
+}
+
+const handleCheck = ()=> {
+    const is =priceData.value.price && priceData.value.price>0&&priceData.value.name && priceData.value.code;
+    if(is){
+        return true
+    }
+    !priceData.value.price && errors('请输入提现金额');
+    priceData.value.price<=0 &&  errors('请输入正确的金额');
+    !priceData.value.name&&  errors('请输入账户名');
+    !priceData.value.code&&  errors('请输入账号');
+    return false
+}
+const onSubmit = () => {
+	console.log("TCL: priceData", priceData.value)
+    // init();
+  
+  const type = handleCheck();
+    
+
+  type && submitAmountApply({
+        takeAmount:priceData.value.price,
+        alipayName:priceData.value.name,
+        alipayAccountNo:priceData.value.code,
+        payType:'2'
+    }).then(res => {
+        if(res.code === 200){
+            uni.showToast({
+                title: '提交成功',
+                icon: 'success'
+            })
+            setTimeout(() => {
+                uni.redirectTo({ url: `/pages_mine/pages/wallet/index` });
+            }, 800)
+        }
     })
 }
 
 const onMaxChange = () => {
-    priceValue.value = maxPrice.value;
+    priceData.value.price = maxPrice.value;
 }
 
+const init = async() => {
+	try {
+		uni.showLoading({
+			title: '数据加载中...'
+		});
+        
+		if(userType === 2){
+			const res = await getVolunteerAccountInfo();
+            maxPrice.value = res.data.balance;
+		}
+        if(userType === 1){
+            const res = await getAccountInfo();
+            maxPrice.value = res.data.balance;
+        }
+	} catch (error) {
+		console.log('error', error);
+		uni.showToast({
+			title: error.msg,
+			icon: 'error',
+		});
+	} finally {
+		uni.hideLoading();
+	}
+}
+
+onShow(()=>{
+    init();
+})
 </script>
 
 <style lang="scss" scoped>
@@ -126,12 +216,19 @@ const onMaxChange = () => {
 
     .price-box {
         display: flex;
+
         .price-input {
             flex: 1;
             height: 58px;
-            padding: 0  12px;
+            padding: 0 12px;
             font-size: 28px;
         }
+        .price-input2 {
+            flex: 1;
+            height: 38px;
+            padding: 0 12px;
+            font-size: 16px;
+        }
     }
 }
 </style>