瀏覽代碼

style:“优化一些变量名称”

soobin 2 年之前
父節點
當前提交
9cdc0d1a4a

+ 3 - 3
src/common/js/utils.js

@@ -48,7 +48,7 @@ cal:操作符 add sub mul div
 nums:保留多少位小数
 format:msg不存在时是否格式化
 */
-export const $M_FormatCalcuDecial = (msg, calNums = 1, cal = 'mul', nums = 0, format = '0') => {
+export const Format_calcuDecial = (msg, calNums = 1, cal = 'mul', nums = 0, format = '0') => {
   if (msg !== '-') {
     // 强制转成数字
     const firstNum = Number(msg);
@@ -104,11 +104,11 @@ export const $M_ExportFile = (data, headers) => {
   window.URL.revokeObjectURL(href); //释放掉blob对象
 }
 // 格式化时间
-// export const $M_FormatTime = (time, format = "YYYY-MM-DD HH:MM") => {
+// export const Format_time = (time, format = "YYYY-MM-DD HH:MM") => {
 //   if (time) return moment(time).format(format);
 //   return time;
 // }
-export const $M_FormatTime = (time, format = 'YYYY-MM-DD HH:mm') => {
+export const Format_time = (time, format = 'YYYY-MM-DD HH:mm') => {
   if (time) return dayjs(time).format(format);
   return time;
 }

+ 3 - 3
src/views/advertManage/advertRule/index.vue

@@ -57,7 +57,7 @@
               <div class="l-flex-RC o-mt-14">
                 <span class="c-color c-text-12">{{ $t("advertManage.advertRule.createTime") }}:</span>
                 <span class="c-text-color c-text-12">{{
-                  $M_FormatTime(item.createDate)
+                  Format_time(item.createDate)
                 }}</span>
               </div>
             </div>
@@ -88,7 +88,7 @@
 
 <script>
 import { useStore } from "vuex";
-import { $M_FormatTime, styleUrl } from "../../../common/js/utils";
+import { Format_time, styleUrl } from "../../../common/js/utils";
 import kDialog from "../../../components/commom/kDialog/index.vue";
 // 导入接口
 import {
@@ -277,7 +277,7 @@ export default {
       kDialogRef,
       noticeClk,
       toEdit,
-      $M_FormatTime,
+      Format_time,
     };
   },
 };

+ 3 - 3
src/views/apkManage/index.vue

@@ -67,7 +67,7 @@
               <div class="l-flex-RC">
                 <span class="c-color c-text-12">{{ $t("advertManage.advertRule.createTime") }}:</span>
                 <span class="c-text-color c-text-12">{{
-                  $M_FormatTime(item.createDate)
+                  Format_time(item.createDate)
                 }}</span>
               </div>
             </div>
@@ -94,7 +94,7 @@
 </template>
 
 <script>
-import { $M_FormatTime } from "@/common/js/utils";
+import { Format_time } from "@/common/js/utils";
 import kDialog from "@/components/commom/kDialog/index.vue";
 // 导入接口
 import {
@@ -266,7 +266,7 @@ export default {
       kDialogRef,
       noticeClk,
       toEdit,
-      $M_FormatTime,
+      Format_time,
     };
   },
 };

+ 9 - 9
src/views/device/index.vue

@@ -164,29 +164,29 @@
                   <template v-if="item.isMaterialUse === '1' && (item.machineType == '0' || item.machineType == null)">
                     <van-row justify="space-between" class="sugarTxt o-ptb-8 kBordBott">
                       <van-col>
-                        {{ $t("device.whiteSugar") }}:{{ $M_FormatCalcuDecial(item.whiteSugar) }}%
+                        {{ $t("device.whiteSugar") }}:{{ Format_calcuDecial(item.whiteSugar) }}%
                       </van-col>
                       <van-col>
-                        {{ $t("device.redSugar") }}:{{ $M_FormatCalcuDecial(item.redSugar) }}%
+                        {{ $t("device.redSugar") }}:{{ Format_calcuDecial(item.redSugar) }}%
                       </van-col>
                       <van-col>
-                        {{ $t("device.yellowSugar") }}:{{ $M_FormatCalcuDecial(item.yellowSugar) }}%
+                        {{ $t("device.yellowSugar") }}:{{ Format_calcuDecial(item.yellowSugar) }}%
                       </van-col>
                       <van-col>
-                        {{ $t("device.blueSugar") }}:{{ $M_FormatCalcuDecial(item.blueSugar) }}%
+                        {{ $t("device.blueSugar") }}:{{ Format_calcuDecial(item.blueSugar) }}%
                       </van-col>
                     </van-row>
                     <div class="sugarTxt o-ptb-8 kBordBott">
                       <span>{{ $t("device.stick") }}:{{
-                        $M_FormatCalcuDecial(item.stick)
+                        Format_calcuDecial(item.stick)
                       }}%</span>
                     </div>
                     <van-row gutter="50" class="sugarTxt o-ptb-8 kBordBott">
                       <van-col>
-                        {{ $t("device.water") }}:{{ $M_FormatCalcuDecial(item.water) }}%
+                        {{ $t("device.water") }}:{{ Format_calcuDecial(item.water) }}%
                       </van-col>
                       <van-col>
-                        {{ $t("device.wasteWater") }}:{{ $M_FormatCalcuDecial(item.wasteWater) }}%
+                        {{ $t("device.wasteWater") }}:{{ Format_calcuDecial(item.wasteWater) }}%
                       </van-col>
                     </van-row>
                     <span class="txt5 o-ptb-8 kBordBott l-flex-RC"><span>{{ $t("device.oneKeyFeed") }}:</span>
@@ -253,7 +253,7 @@ import { onMounted, reactive, toRefs, ref } from "vue";
 import { Toast, Dialog } from "vant";
 import navBar from "../../components/NavBar";
 import sHeader from "../../components/SimpleHeader";
-import { getLoginUser, $M_FormatCalcuDecial, styleUrl } from "../../common/js/utils";
+import { getLoginUser, Format_calcuDecial, styleUrl } from "../../common/js/utils";
 import {
   getDeviceList,
   eliminate,
@@ -496,7 +496,7 @@ export default {
       sys,
       viewPosiClk,
       replenishmentClk,
-      $M_FormatCalcuDecial,
+      Format_calcuDecial,
       operFinish,
       equipStatus,
       eqeStatusClk,

+ 2 - 2
src/views/discountCode/payCode.vue

@@ -63,7 +63,7 @@
 <script>
 import sHeader from "@/components/SimpleHeader";
 import { onMounted, reactive, toRefs, ref, watch } from "vue";
-import { getLoginUser, $M_FormatCalcuDecial, styleUrl } from "@/common/js/utils";
+import { getLoginUser, Format_calcuDecial, styleUrl } from "@/common/js/utils";
 import { Toast } from "vant";
 import { addCode } from "@/service/discountCode";
 import { useRouter } from "vue-router";
@@ -127,7 +127,7 @@ export default {
     const validDays = ref('0天');
     // 监听有效期,计算有效天数
     watch(() => payParams.month, (newVal) => {
-      validDays.value = $M_FormatCalcuDecial(newVal, 30) + '天';
+      validDays.value = Format_calcuDecial(newVal, 30) + '天';
     }, { immediate: true, deep: true });
     return {
       ...toRefs(payParams),

+ 3 - 3
src/views/distributionSet/index.vue

@@ -74,7 +74,7 @@
               <div>
                 <span class="titleName c-text-13">{{ $t('distributionSet.applTime') }}:</span>
                 <span class="valueName c-text-13">{{
-                  $M_FormatTime(item.createDate, "YYYY-MM-DD HH:MM")
+                  Format_time(item.createDate, "YYYY-MM-DD HH:MM")
                 }}</span>
               </div>
               <div v-if="tabActive === 1" class="effective c-text-15 c-text-w5 o-ml-20">
@@ -93,7 +93,7 @@
 
 <script>
 // 导入公用方法
-import { $M_FormatTime } from "../../common/js/utils";
+import { Format_time } from "../../common/js/utils";
 // 导入接口
 import { Api_getPageProportion } from "../../service/distributionSet";
 import { onMounted, toRefs, ref, reactive } from "vue";
@@ -216,7 +216,7 @@ export default {
       tabChg,
       tabActive,
       tabList,
-      $M_FormatTime,
+      Format_time,
     };
   },
 };

+ 3 - 3
src/views/home/index.vue

@@ -65,7 +65,7 @@
       </div>
       <!-- 时间 -->
       <div v-if="showDataDiv" class="c-text-c c-text-18">
-        {{ $M_FormatTime(dateSelect.startDate, 'YYYY-MM-DD') }}--{{ $M_FormatTime(dateSelect.endDate, 'YYYY-MM-DD') }}
+        {{ Format_time(dateSelect.startDate, 'YYYY-MM-DD') }}--{{ Format_time(dateSelect.endDate, 'YYYY-MM-DD') }}
       </div>
       <!-- ECharts
       <template v-if="showDataDiv && !noData(salesVolume, salesNumber)">
@@ -122,7 +122,7 @@ import sHeader from "../../components/SimpleHeader";
 import navBar from "../../components/NavBar";
 import dateSelectList from "../../components/dateSelectList";
 import typeSelectList from "../../components/typeSelectList";
-import { getLoginUser, $M_Menus, $M_FormatTime, styleUrl } from "../../common/js/utils";
+import { getLoginUser, $M_Menus, Format_time, styleUrl } from "../../common/js/utils";
 import { useRouter } from "vue-router";
 import {
   getStatistics,
@@ -552,7 +552,7 @@ export default {
       noticeContent,
       showLogo,
       dateSelect,
-      $M_FormatTime,
+      Format_time,
       showDataDiv
     };
   },

+ 3 - 3
src/views/labelMan/index.vue

@@ -59,7 +59,7 @@
           <div class="l-flex-RC">
             <span class="c-color c-text-12">{{ $t("advertManage.advertRule.createTime") }}:</span>
             <span class="c-text-color c-text-12">{{
-                $M_FormatTime(item.createDate)
+                Format_time(item.createDate)
               }}</span>
           </div>
         </div>
@@ -87,7 +87,7 @@
 // 导入tab组件
 import kTabs from "../../components/commom/kTabs/index.vue";
 // 导入公用方法
-import { $M_FormatTime, getLoginUser, styleUrl } from "../../common/js/utils";
+import { Format_time, getLoginUser, styleUrl } from "../../common/js/utils";
 // 导入弹窗
 import kDialog from "../../components/commom/kDialog/index.vue";
 // 导入接口
@@ -241,7 +241,7 @@ export default {
       kDialogRef,
       noticeClk,
       toEdit,
-      $M_FormatTime,
+      Format_time,
       tabList,
       tabChg,
     };

+ 3 - 3
src/views/merchantManage/index.vue

@@ -36,7 +36,7 @@
               <span class="txt2" v-html="`${$t('merchantManage.managementSystemId')}:` + item.managerId"></span>
               <div class="box3 flex-col">
                 <span class="txt3"
-                      v-html="`${$t('merchantManage.creationTime')}:` + $M_FormatTime(item.createDate)"></span>
+                      v-html="`${$t('merchantManage.creationTime')}:` + Format_time(item.createDate)"></span>
               </div>
             </div>
           </div>
@@ -50,7 +50,7 @@
 import { onMounted, reactive, ref } from "vue";
 import sHeader from "../../components/SimpleHeader";
 import { getAdminList } from '../../service/merchantManage';
-import { getLoginUser, $M_FormatTime, styleUrl } from "../../common/js/utils";
+import { getLoginUser, Format_time, styleUrl } from "../../common/js/utils";
 import { Toast } from 'vant';
 import merchantSearch from './merchantSearch.vue';
 import { useRouter } from "vue-router";
@@ -115,7 +115,7 @@ export default {
       searchRef,
       search,
       merchantSet,
-      $M_FormatTime,
+      Format_time,
     };
   },
 };

+ 48 - 41
src/views/orderCenter/index.vue

@@ -60,7 +60,7 @@
         <div class="o-mtb-10" style="height: 10px; background: #f5f5f5"></div>
         <!-- 时间 -->
         <div class="c-text-c c-text-18">
-          {{ $M_FormatTime(searchParams.startDate, 'YYYY-MM-DD') }}--{{ $M_FormatTime(searchParams.endDate, 'YYYY-MM-DD')
+          {{ Format_time(searchParams.startDate, 'YYYY-MM-DD') }}--{{ Format_time(searchParams.endDate, 'YYYY-MM-DD')
           }}
         </div>
         <div class="group7 flex-col justify-center">
@@ -170,7 +170,7 @@
               <div class="outer1 flex-col">
                 <!-- <span class="txt4">这里是设备名称</span> -->
                 <span class="info1">{{ $t('orderCenter.business') }}</span>
-                <span class="txt5">+{{ refundObject.price }}</span>
+                <span class="txt5">+ {{ refundObject.refundAmount == null ? refundObject.price.toFixed(2) : (refundObject.price - refundObject.refundAmount).toFixed(2) }}</span>
               </div>
             </div>
             <div class="layer1 flex-col"></div>
@@ -225,7 +225,6 @@
     <kDialog :isCloseForConfirm="false" :dialogTitle="$t('orderCenter.refundTip')"
       :confirmBtnTxt="$t('orderCenter.refundSubmit')" ref="kDialogRef" @confirmclk="confirmClk">
       <template #content>
-
         <!-- <van-field colon required type="number" clearable v-model="cofficentForm.price" class="inputAmount"
           :placeholder="$t('orderCenter.refundAmountPlace')" :label="$t('orderCenter.refundAmount')">
           <template #extra>
@@ -278,7 +277,7 @@ import sHeader from "../../components/SimpleHeader";
 import orderSearch from "./orderSearch.vue";
 import { getOrderList, refundOrder } from "../../service/order/index";
 import { Toast } from "vant";
-import { getLoginUser, $M_IsDate, $M_FormatTime, $M_ExportFile, styleUrl } from "../../common/js/utils";
+import { getLoginUser, $M_IsDate, Format_time, $M_ExportFile, styleUrl } from "../../common/js/utils";
 import { getHuifuId } from "../../service/huifuMch/index";
 import dateUtil from "../../utils/dateUtil";
 import dateSelectList from "../../components/dateSelectList";
@@ -302,7 +301,7 @@ export default {
     // 退款商户数量
     const refundNum = ref([]);
     // 加载状态
-    const isLoading = ref(false);
+    // const isLoading = ref(false);
     // 监控退款选择框状态
     const checkGood = (index) => {
       if (isChecked.value[index]) {
@@ -397,9 +396,9 @@ export default {
           // title: "提示",
           message: t('orderCenter.refundCheck'),
         }).then(() => {
-          isLoading.value = true; // 开始加载
+          // isLoading.value = true; // 开始加载
           refundAjax();
-          isLoading.value = false; // 加载完成
+          // isLoading.value = false; // 加载完成
 
           kDialogRef.value.closeDialog();
         }).catch(() => {
@@ -484,6 +483,7 @@ export default {
     // 滚动加载
     const onLoad = () => {
       if (!finished.value) {
+        loading.value = true;
         searchParams.current = searchParams.current + 1;
         getList();
       }
@@ -504,8 +504,8 @@ export default {
       dateType: "0", // 所选时间类型 String 0:创建时间 1:退款时间
       startDate: "", // 开始时间 Date
       endDate: "", // 结束时间 Date
-      current: 1, // 页数
-      size: 20, // 页大小
+      current: 0, // 页数
+      size: 15, // 页大小
       status: "",//支付状态
       companyType: "", // 公司平台
       machineType: "", // 设备类型
@@ -514,6 +514,7 @@ export default {
     let chartType = "day";
     // 获取订单列表数据
     const getList = async () => {
+      console.log("loading",loading.value);
       finished.value = false;
       getStatisticsFun();
       // 因为订单的时间格式不一样
@@ -538,38 +539,42 @@ export default {
       // 获取订单列表
       const { data } = await getOrderList(Object.assign({}, params));
       if (data.code === "00000") {
-        if (params.current === 1) {
-          orderList.value = [];
-        }
-        // 列表值叠加
-        if (data.data) {
-          orderList.value = orderList.value.concat(
-            data.data.records.map((item) => {
-              return {
-                ...item,
-                statusText:
-                  item.altInfo != null
-                    ? t('orderCenter.onlinePayment')
-                    : t('orderCenter.offlinePayment'),
-              };
-            })
-          );
-          orderTotal.value = data.data.total;
-          if (
-            data.data.total === 0 ||
-            (data.data.total > 0 &&
-              orderList.value.length === data.data.total) ||
-            data.data.records.length === 0
-          ) {
+        if (data.data.total === 0) {
+          finished.value = true;
+        } else {
+          // orderTotal.value = data.data.total;
+          if (params.current === 1) {
+            orderList.value = [];
+            orderTotal.value = 0;
+          }
+          // 列表值叠加
+          if (data.data.records.length > 0) {
+            orderList.value = orderList.value.concat(
+              data.data.records.map((item) => {
+                return {
+                  ...item,
+                  statusText:
+                    item.altInfo != null
+                      ? t('orderCenter.onlinePayment')
+                      : t('orderCenter.offlinePayment'),
+                };
+              })
+            );
+            orderTotal.value = data.data.records.length + orderTotal.value;
+            if (orderTotal.value === data.data.total) {
+              finished.value = true;
+            }
+          } else {
             finished.value = true;
           }
-        } else {
-          finished.value = true;
         }
         loading.value = false;
       } else {
-        Toast.fail(data.message);
+        // error.value = true;
+        Toast.fail("数据加载失败");
       }
+      console.log("finished", finished.value);
+      console.log("loading",loading.value);
     };
     // 搜索表单点击
     const searchClick = () => {
@@ -602,8 +607,8 @@ export default {
     onMounted(async () => {
       // 加载样式
       styleUrl('orderCenter');
-      orderList.value = [];
-      searchParams.current = 1;
+      // orderList.value = [];
+      // searchParams.current = 1;
       if (user) {
         searchParams.adminId = user.id;
         searchParams.userName = user.username;
@@ -624,8 +629,10 @@ export default {
         let endDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);
         searchParams.endDate = dateUtil.formateDate(endDate, "yyyy-MM-dd hh:mm:ss");
 
-        finished.value = false;
-        getList();
+        // finished.value = false;
+        // getList();
+        onLoad();
+        addEventListener('load', onLoad);
         // 获取账户详情
         getAccountDetail(user.id);
       }
@@ -815,7 +822,7 @@ export default {
       confirmClk,
       cofficentForm,
       accountDetail,
-      $M_FormatTime,
+      Format_time,
       searchParams,
       orderDetails,
       huifuId,
@@ -828,7 +835,7 @@ export default {
       checkGood,
       plusRefundGood,
       minusRefundGood,
-      isLoading,
+      // isLoading,
       isRefund,
     };
   },

+ 3 - 3
src/views/subLedgerManage/index.vue

@@ -111,7 +111,7 @@
                   <div class="main10 flex-col">
                     <span class="word14"
                       >{{ $t("subLedgerManage.lastSettTime") }}:{{
-                        $M_FormatTime(item.modifyDate, "YYYY-MM-DD HH:MM:SS")
+                        Format_time(item.modifyDate, "YYYY-MM-DD HH:MM:SS")
                       }}</span
                     >
                   </div>
@@ -178,7 +178,7 @@
 </template>
 <script>
 // 导入公用方法
-import { $M_FormatTime, $M_ExportFile } from "@/common/js/utils";
+import { Format_time, $M_ExportFile } from "@/common/js/utils";
 // 导入接口
 import {
   Api_getPageShandeMch,
@@ -376,7 +376,7 @@ export default {
       onRefresh,
       onLoad,
       ...toRefs(ruleData),
-      $M_FormatTime,
+      Format_time,
       settleParam,
       exportFile,
       pageTotals,

+ 2 - 2
src/views/weChatPay.vue

@@ -24,8 +24,8 @@ export default {
 
         const wxPay = () => {
             // 处理回调接口
-            // const redirectUri = encodeURIComponent('http://szwlh.sunzee.com.cn/PAY-SERVER/sz/tOrder/callback');
-            const redirectUri = encodeURIComponent('http://szwltest.sunzee.com.cn/PAY-SERVER/tOrder/callback');
+            const redirectUri = encodeURIComponent('http://szwlh.sunzee.com.cn/PAY-SERVER/tOrder/callback');
+            // const redirectUri = encodeURIComponent('http://szwltest.sunzee.com.cn/PAY-SERVER/tOrder/callback');
             const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=${id}&connect_redirect=1#wechat_redirect`;
             console.log(url)
             window.location.replace(url);