Browse Source

支付宝提现修改

jiayubo 3 months ago
parent
commit
5a8c0f0be2

+ 12 - 0
pages_classify/pages/handle/index.vue

@@ -10,6 +10,7 @@
         <view class="user-name">
           <text class="user-PlaEde">下单时间:</text>
           <text>{{ detaile.workDate }}</text>
+          <up-text type="primary" text="查看时间" class="view-time"></up-text>
         </view>
         <view class="user-name">
           <text class="user-PlaEde">上门时间:</text>
@@ -348,6 +349,9 @@ onUnload(() => {
     opacity: 0.4;
     border-bottom: 1rpx solid rgba(216, 216, 216, 0.8);
     margin-bottom: 30rpx;
+    margin-left: 38rpx;
+    display: flex;
+    align-items: center;
   }
   .user-PlaEde {
     width: 140rpx;
@@ -389,6 +393,7 @@ onUnload(() => {
     height: 50rpx;
     opacity: 0.4;
     margin-bottom: 30rpx;
+    margin-left: 38rpx;
   }
 
   .remark-title {
@@ -411,6 +416,13 @@ onUnload(() => {
     vertical-align: top;
     font-size: 28rpx;
   }
+
+  .view-time {
+    margin-left: auto;
+    font-size: 24rpx;
+    margin-left: 96rpx;
+    font-weight: 600;
+  }
 }
 
 .footer-g {

+ 1 - 3
pages_classify/pages/orderItem/orderdetails.vue

@@ -3,7 +3,6 @@
     <view class="address-container">
       <view class="address-header">
         <!-- 左侧默认标签-->
-        <up-tag text="默认" type="error"></up-tag>
 
         <!-- 中间收货人信息 -->
         <view class="contact-info">
@@ -33,8 +32,7 @@
               <view class="info-item">服务类别:{{ listData.businessManagementName }}</view>
               <view class="info-item">服务时长:{{ listData.serviceDuration }}分钟</view>
               <view class="info-item">服务价格:{{ listData.serviceOnePrice }}</view>
-              <view class="info-item">服务数量:{{ listData.singleQuantity
-                }}{{ listData.businessUnit }}</view>
+              <view class="info-item">服务数量:{{ listData.singleQuantity}}{{ listData.businessUnit }}</view>
               <view class="info-itemIform">服务描述:{{ listData.businessDescribe }}</view>
             </view>
 

+ 1 - 1
pages_mine/pages/integral/index.vue

@@ -23,7 +23,7 @@
         <view class="popup-content">
           <view class="popup-title">收益说明</view>
           <view class="popup-text">用户积分:用户通过平台生成的二维码进行分享,以拉取新用户或志愿者(服务者)并获得相应积分。</view>
-          <view class="popup-text">积分规则:拉取一个新用户可获得1分,拉取一个新志愿者(服务者)可获得5分。</view>
+          <view class="popup-text">积分规则:拉取一个新用户可获得1分,拉取一个新志愿者(服务者)可获得10分。</view>
           <view class="popup-text">积分兑换:所获积分可以兑换等价值的商品或购买各类居家服务。</view>
           <view class="popup-text">积分生效:用户积分的兑换,以所拉取用户在平台上产生交易为准,即产生了交易的用户或志愿者(服务者)其相应的积分才可实现兑换。</view>
           <view class="popup-close" @click="close">关闭</view>

+ 5 - 5
pages_mine/pages/wallet/index.vue

@@ -6,7 +6,7 @@
 
             <!-- <text class="wallet-hi-text">为了您更好地使用钱包功能, <text class="wallet-active" @click="onAddBankCard" >添加银行卡> </text> </text> -->
         </view>
-        <view class="wallet-box card-box ">
+        <view class="wallet-box card-box">
             <view class="wallet-box-top">
                 <view class="flex-center-column">
                     <text class="wallet-box-title">钱包总额(元)</text>
@@ -20,16 +20,16 @@
             <up-divider v-if="userType === 2"></up-divider>
             <view class="wallet-box-bottom" v-if="userType === 2">
                 <view class="flex-center-column">
-                    <text class="wallet-box-title">可提现(元)</text>
-                    <view class="wallet-box-price2">{{ data.balance }}</view>
+                    <text class="wallet-box-title">累积可提现(元)</text>
+                    <view class="wallet-box-price2">{{ data.totalBalance }}</view>
                 </view>
                 <view class="flex-center-column">
                     <text class="wallet-box-title">待入账(元)</text>
                     <view class="wallet-box-price2">{{  data.orderFrozenBalance }}</view>
                 </view>
                 <view class="flex-center-column">
-                    <text class="wallet-box-title">银行卡(张)</text>
-                    <view class="wallet-box-price2">0</view>
+                    <text class="wallet-box-title">提现中的金额(元)</text>
+                    <view class="wallet-box-price2">{{data.beBalance}}</view>
                 </view>
             </view>
         </view>

+ 259 - 182
pages_mine/pages/withdrawal/index.vue

@@ -1,234 +1,311 @@
 <template>
-    <view class="withdrawal-main">
-        <view class="withdrawal-item">
-            <label class="withdrawal-label">提现到账</label>
-            <view class="withdrawal-item-right" @click="openSheet">
-                <view class="withdrawal-text">{{ w_key }}</view>
-                <up-icon name="arrow-right"></up-icon>
-            </view>
-        </view>
-        <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-main">
+    <view class="withdrawal-item">
+      <label class="withdrawal-label">提现到账</label>
+      <view class="withdrawal-item-right" @click="openSheet">
+        <view class="withdrawal-text">{{ w_key }}</view>
+        <up-icon name="arrow-right"></up-icon>
+      </view>
+    </view>
+    <view class="withdrawal-item">
+      <label class="withdrawal-label">本人支付宝账号提现</label>
+      <view class="withdrawal-item-right" @click="openSheetNumber">
+        <view class="withdrawal-text">{{ s_key }}</view>
+        <up-icon name="arrow-right"></up-icon>
+      </view>
+    </view>
+    <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 v-show="s_key === '他人支付宝账号提现'">
         <view class="withdrawal-item">
-            <label class="withdrawal-label">提现金额</label>
+          <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="priceData.price" @change="change" />
-        </view>
-        <view class="withdrawal-item">
-            <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>
+          <input
+            class="price-input2"
+            placeholder="请输入身份证号"
+            border="none"
+            v-model="priceData.idCard"
+          />
         </view>
+      </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="priceData.price"
+        @change="change"
+      />
+    </view>
+    <view class="withdrawal-item">
+      <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>
 
-        <up-action-sheet :show="show" @close="close" @select="select" :actions="actions">
-        </up-action-sheet>
+    <view style="margin-top: 45px">
+      <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="showNumber"
+      @close="close"
+      @select="selectNumber"
+      :actions="actionsProxy"
+    ></up-action-sheet>
+  </view>
 </template>
 
 <script setup>
-import { ref } from 'vue';
-import { getVolunteerAccountInfo,getAccountInfo,submitAmountApply} from "@/api/mine";
+import { ref, relative } from 'vue'
 import {
-    onShow,
-} from "@dcloudio/uni-app";
+  getVolunteerAccountInfo,
+  getAccountInfo,
+  submitAmountApply,
+} from '@/api/mine'
+import { onShow } from '@dcloudio/uni-app'
+import row from 'uview-plus/components/u-row/row'
 const actions = [
-    {
-        name: '支付宝账户',
-    }
+  {
+    name: '支付宝账户',
+  },
 ]
-const userType = uni.getStorageSync('userType') //读取本地存储
-const w_key = ref('支付宝账户');
-const show = ref(false);
 
-const maxPrice = ref(0);
+const actionsProxy = [
+  {
+    name: '本人支付宝账号提现',
+    value: 1,
+  },
+  {
+    name: '他人支付宝账号提现',
+    value: 2,
+  },
+]
+const userType = uni.getStorageSync('userType') //读取本地存储
+const w_key = ref('支付宝账户')
+const s_key = ref('本人支付宝账号提现')
+const show = ref(false)
+const showNumber = ref(false)
+const maxPrice = ref(0)
 
 const priceData = ref({
-    // price: '0.01',
-    // name: '搁置',
-    // code: '18696601943'
+  // price: '0.01',
+  // name: '搁置',
+  // code: '18696601943'
 
-    price: '',
-    name: '',
-    code: ''
+  price: '',
+  name: '',
+  code: '',
+  idCard: '',
 })
 
-
 const change = (e) => {
-    console.log('change', e);
-    const regex = /^\d*\.?\d*$/;
-    if (!regex.test(e.detail.value)) {
-        priceData.value.price = priceData.value.price.replace(/[^\d.]/g, '');
-    }
-};
+  console.log('change', e)
+  const regex = /^\d*\.?\d*$/
+  if (!regex.test(e.detail.value)) {
+    priceData.value.price = priceData.value.price.replace(/[^\d.]/g, '')
+  }
+}
 
 const openSheet = (index) => {
-    show.value = true;
+  show.value = true
+}
+
+const openSheetNumber = (index) => {
+  showNumber.value = true
 }
+
 const close = () => {
-    show.value = false;
+  show.value = false
+  showNumber.value = false
 }
 const select = (row) => {
-    w_key.value = row.name
-    console.log('select', index);
+  w_key.value = row.name
+  console.log('select', row)
 }
 
-const errors =  (e) => {
-    uni.showToast({
-        title: e,
-        icon: 'none',
-        })
+const selectNumber = (row) => {
+  s_key.value = row.name
+  console.log('selectNumber', row)
 }
 
-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 errors = (e) => {
+  uni.showToast({
+    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)
-        }
+  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',
+      alipayAccountType: s_key.value === '本人支付宝账号提现' ? 1 : 2,
+      idCard: priceData.value.idCard,
+    }).then((res) => {
+      if (res.code === 200) {
+        uni.showToast({
+          title: '提交成功',
+          icon: 'success',
+        })
+        setTimeout(() => {
+          uni.redirectTo({ url: `/pages_mine/pages/wallet/index` })
+        }, 800)
+      }
     })
 }
 
 const onMaxChange = () => {
-    priceData.value.price = 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();
-	}
+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();
+onShow(() => {
+  init()
 })
 </script>
 
 <style lang="scss" scoped>
 .withdrawal-main {
-    position: fixed;
-    top: 0px;
-    left: 0px;
-    right: 0px;
-    bottom: 0px;
-    background-color: #fff;
-    padding: 0 12px;
-
-    .withdrawal-item {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        padding: 12px 0;
-
-        .withdrawal-label {
-            font-size: 14px;
-            font-weight: 500;
-            line-height: 20.27px;
-            color: rgba(153, 153, 153, 1);
-
-            display: flex;
-            align-items: center;
-        }
-
-        .withdrawal-item-right {
-            display: flex;
-            align-items: center;
-
-            .withdrawal-text {
-                font-size: 16px;
-                font-weight: 700;
-                line-height: 23.17px;
-                color: rgba(0, 0, 0, 1);
-                margin-right: 6px;
-            }
-
-        }
+  position: fixed;
+  top: 0px;
+  left: 0px;
+  right: 0px;
+  bottom: 0px;
+  background-color: #fff;
+  padding: 0 12px;
+
+  .withdrawal-item {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 12px 0;
+
+    .withdrawal-label {
+      font-size: 14px;
+      font-weight: 500;
+      line-height: 20.27px;
+      color: rgba(153, 153, 153, 1);
+
+      display: flex;
+      align-items: center;
     }
 
-    .price-box {
-        display: flex;
-
-        .price-input {
-            flex: 1;
-            height: 58px;
-            padding: 0 12px;
-            font-size: 28px;
-        }
-        .price-input2 {
-            flex: 1;
-            height: 38px;
-            padding: 0 12px;
-            font-size: 16px;
-        }
+    .withdrawal-item-right {
+      display: flex;
+      align-items: center;
+
+      .withdrawal-text {
+        font-size: 16px;
+        font-weight: 700;
+        line-height: 23.17px;
+        color: rgba(0, 0, 0, 1);
+        margin-right: 6px;
+      }
+    }
+  }
+
+  .price-box {
+    display: flex;
+
+    .price-input {
+      flex: 1;
+      height: 58px;
+      padding: 0 12px;
+      font-size: 28px;
+    }
+    .price-input2 {
+      flex: 1;
+      height: 38px;
+      padding: 0 12px;
+      font-size: 16px;
     }
+  }
 }
 </style>