Browse Source

feat:"增加余额显示"

soobin 7 months ago
parent
commit
e14caeed29
3 changed files with 26 additions and 24 deletions
  1. 4 0
      src/service/huifuMch/index.js
  2. 0 14
      src/views/device/deviceSet.vue
  3. 22 10
      src/views/orderCenter/index.vue

+ 4 - 0
src/service/huifuMch/index.js

@@ -62,3 +62,7 @@ export function auditUpdateMerchant(params) {
     return axios.get(`/SZWL-SERVER/tHuifuMch/auditUpdateMerchant?${stringToUrl(params)}`);
 }
 
+// 查询账户余额
+export function checkBalance(params) {
+    return axios.get(`/SZWL-SERVER/tHuifuMch/checkBalance?${stringToUrl(params)}`);
+}

+ 0 - 14
src/views/device/deviceSet.vue

@@ -168,20 +168,6 @@
         </template>
         <!-- 花型种类 -->
         <template v-if="isAdmind && (machineType === '0' || machineType === '1')">
-          <!-- <van-field readonly :label="`${$t('device.flowerType')}`" placeholder="">
-            <template #input>
-              <div class="van-cell__value van-field__value radioBox">
-                <van-radio-group v-model="deviceDetal.flowers" direction="horizontal">
-                  <van-radio name="18" icon-size="16px">18</van-radio>
-                  <van-radio name="22" icon-size="16px">22</van-radio>
-                  <van-radio name="26" icon-size="16px">26</van-radio>
-                  <van-radio name="30" icon-size="16px">30</van-radio>
-                  <van-radio name="42" icon-size="16px">42</van-radio>
-                  <van-radio name="60" icon-size="16px">60</van-radio>
-                </van-radio-group>
-              </div>
-            </template>
-</van-field> -->
           <van-field v-model="deviceDetal.flowers" is-link readonly
             :label="machineType === '1' ? '口味种类' : $t('device.flowerType')"
             :placeholder="machineType === '1' ? '选择口味种类' : '选择花型种类'" @click="clickFlowerPicker" />

+ 22 - 10
src/views/orderCenter/index.vue

@@ -159,10 +159,10 @@
           </div>
         </div>
         <div class="line flex-col"></div>
-        <!-- <div class="layer2 flex-row justify-between">
-              <span class="info2">{{ $t('orderCenter.accountBalance') }}</span>
-              <span class="txt6">{{ accountDetail.altAvilBalance }}</span>
-            </div> -->
+        <div class="orderDetailBox flex-row justify-between" v-if="user.ifForeign === '0' && user.type === 2">
+          <span class="title">{{ $t('orderCenter.accountBalance') }}</span>
+          <span class="content">{{ "¥ " + balance }} </span>
+        </div>
         <div class="orderDetailBox flex-row justify-between">
           <span class="title">{{ $t('orderCenter.orderNo') }}</span>
           <!-- <span class="content">{{ refundObject.sn }}</span> -->
@@ -299,7 +299,7 @@ import orderSearch from "./orderSearch.vue";
 import { getOrderList, refundOrder, refundWechatOrder, updateIsInvoice, sentMessage, exportOrder, refundSqbOrder } from "../../service/order/index";
 import { showFailToast, showToast, showLoadingToast } from "vant";
 import { getLoginUser, $M_IsDate, Format_time, $M_ExportFile, styleUrl } from "../../common/js/utils";
-import { getHuifuId } from "../../service/huifuMch/index";
+import { getHuifuId, checkBalance } from "../../service/huifuMch/index";
 import dateUtil from "../../utils/dateUtil";
 import dateSelectList from "../../components/dateSelectList";
 // import typeSelectList from "../../components/typeSelectList";
@@ -328,6 +328,8 @@ export default {
     const orderType = ref('');
     // 是否开发票
     const isInvoice = ref(0);
+    // 账户余额
+    const balance = ref(0);
     // 更新是否开发票
     const updateInvoice = async (id) => {
       const params = {
@@ -692,8 +694,6 @@ export default {
     onMounted(async () => {
       // 加载样式
       styleUrl('orderCenter');
-      // orderList.value = [];
-      // searchParams.current = 1;
       if (user) {
         searchParams.adminId = user.id;
         searchParams.userName = user.username;
@@ -721,8 +721,12 @@ export default {
         addEventListener('load', onLoad);
         // 获取账户详情
         if (user.ifForeign === '0') {
-          getAccountDetail(user.id);
-        }
+          if (user.payPlatform === '0' || user.payPlatform === null) {
+            getAccountDetail(user.id);
+          } else if (user.payPlatform === '1') {
+            getHuifuBalance(user.id);
+          }          
+        }       
       }
     });
 
@@ -783,8 +787,15 @@ export default {
     const getAccountDetail = (id) => {
       getAdminMch({ id }).then(res => {
         accountDetail.value = res.data.data;
+        balance.value = res.data.data.altMainBalance;
       })
     };
+    // 查询汇付账户余额
+    const getHuifuBalance = (id) => {
+      checkBalance({ adminId: id }).then(res => {
+          balance.value = res.data.data;
+      })
+    }
     // 订单时间格式转换
     const showOrderTime = (item, idx) => {
       if (idx === 1) {
@@ -966,7 +977,8 @@ export default {
       orderType,
       isInvoice,
       updateInvoice,
-      total
+      total,
+      balance
     };
   },
 };