Преглед на файлове

refactor: 抽取优惠券卡片公共样式消除三组件重复,合并双份 uploader 为公共模块并移除失效的上传队列

skyline преди 3 седмици
родител
ревизия
f25628217c

+ 5 - 99
charge-front/src/components/order-coupon-detail/order-coupon-detail.vue

@@ -35,7 +35,7 @@
                         @click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
                     <view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
                     <view class="flex-align-center" v-if="mode === 0">
-                      <view class="fs-24 color-999">享受{{ (item.discount / 10).toFixed(1) }}折服务费权益,本次充电优惠:{{ ((item.orderDiscountAmount || 0) / 100).toFixed(2) }}元
+                      <view class="fs-24 color-999">享受{{ (item.discount / 10).toFixed(1) }}折服务费权益,本次充电优惠:{{ fenToYuan(item.orderDiscountAmount) }}元
                                                 <text class="color-primary">详细规则</text>
                                                 <text class="fs-24 ml-4 color-primary">>></text>
                       </view>
@@ -69,7 +69,7 @@
                     ></image>
                     <view></view>
                     <view class="fs-48 lh-58 color-000 fw-500 ml-16" v-if="item.couponType=='FullDiscount'">
-                      {{ ((item.discount || 0) / 100).toFixed(2) }}元
+                      {{ fenToYuan(item.discount) }}元
                     </view>
 
                     <view class="fs-48 lh-58 color-000 fw-500 ml-16" v-else>
@@ -88,7 +88,7 @@
                         @click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
                     <view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
                     <view class="flex-align-center">
-                      <view class="fs-26 color-999">本次充电优惠:{{ ((item.orderDiscountAmount || 0) / 100).toFixed(2) }}元
+                      <view class="fs-26 color-999">本次充电优惠:{{ fenToYuan(item.orderDiscountAmount) }}元
                         <text class="color-primary">详细规则</text>
                         <text class="fs-24 ml-4 color-primary">>></text>
                       </view>
@@ -112,6 +112,7 @@
 import {ref} from "vue";
 import {fetchOrderDiscount} from "@/api/user";
 import {to} from "@/utils/navigate";
+import { fenToYuan } from "@/utils/money";
 
 const mode = ref(0);
 const rightsList = ref<any[]>([]);
@@ -126,7 +127,6 @@ const handleClose = () => {
 const open = (startChargeSeq: string, discountType: string) => {
   visible.value = true;
   fetchOrderDiscount(startChargeSeq, discountType).then((res) => {
-    console.log(res)
     if (res) {
       if (discountType == "RechargeRights") {
         rightsList.value = [res]
@@ -146,99 +146,5 @@ defineExpose({
 </script>
 
 <style lang="scss" scoped>
-.page {
-  min-height: 100vh;
-  width: 100%;
-  background-color: #f6f7fa;
-
-  .item {
-    position: relative;
-    min-height: 220rpx;
-    border-radius: 20rpx;
-    overflow: hidden;
-    background: #fff;
-
-    .left {
-      flex-grow: 1;
-    }
-
-    .right {
-      flex-shrink: 0;
-
-      .btn {
-        border-radius: 8rpx;
-        border: 1px solid var(--color-primary);
-        color: var(--color-primary);
-        width: 144rpx;
-        height: 56rpx;
-      }
-    }
-  }
-
-  .tab-list {
-    width: 100%;
-
-    .w50 {
-      width: 50%;
-      text-align: center;
-    }
-
-    .active {
-      color: var(--color-primary);
-    }
-  }
-}
-
-.item-status {
-  font-size: 24rpx;
-  padding: 0rpx 6rpx;
-  color: var(--color-primary);
-  border: 2rpx solid var(--color-primary);
-  border-radius: 6rpx;
-
-}
-
-.item-header__left {
-  display: inline-flex;
-  align-items: flex-end;
-}
-
-.item-header__right {
-  padding: 5rpx;
-  display: flex;
-  //justify-content: flex-end;
-}
-
-.inactive {
-  cursor: not-allowed;
-  pointer-events: none;
-
-  .item-status {
-    font-size: 24rpx;
-    padding: 0rpx 6rpx;
-    color: #ccc !important;
-    border: 2rpx solid #ccc;
-    border-radius: 6rpx;
-
-  }
-
-  .color-primary {
-    color: #ccc !important;
-  }
-}
-
-.item-content_left {
-  flex-grow: 1;
-  display: flex;
-  flex-direction: column;
-  justify-content: space-around;
-
-}
-
-.item-content_right {
-  width: 120rpx;
-  display: flex;
-  align-items: center;
-  align-content: center;
-}
+@use "../../styles/coupon-card.scss";
 </style>

+ 5 - 107
charge-front/src/components/station-charge-coupon/station-charge-coupon.vue

@@ -40,7 +40,7 @@
                         @click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
                     <view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
                     <view class="flex-align-center" v-if="mode === 0">
-                      <view class="fs-26 color-999">权益余额:{{ ((item.rightsBalance || 0) / 100).toFixed(2) }}元
+                      <view class="fs-26 color-999">权益余额:{{ fenToYuan(item.rightsBalance) }}元
                         <text class="color-primary">详细规则</text>
                         <text class="fs-24 ml-4 color-primary">>></text>
                       </view>
@@ -87,7 +87,7 @@
                     ></image>
                     <view></view>
                     <view class="fs-48 lh-58 color-000 fw-500 ml-16" v-if="item.couponType=='FullDiscount'">
-                      {{ ((item.discount || 0) / 100).toFixed(2) }}元
+                      {{ fenToYuan(item.discount) }}元
                     </view>
 
                     <view class="fs-48 lh-58 color-000 fw-500 ml-16" v-else>
@@ -106,7 +106,7 @@
                         @click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
                     <view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
                     <view class="flex-align-center">
-                      <view class="fs-26 color-999">服务费门槛:{{ ((item.minServiceMoney || 0) / 100).toFixed(2) }}元
+                      <view class="fs-26 color-999">服务费门槛:{{ fenToYuan(item.minServiceMoney) }}元
                         <text class="color-primary">详细规则</text>
                         <text class="fs-24 ml-4 color-primary">>></text>
                       </view>
@@ -145,10 +145,10 @@
 </template>
 
 <script setup lang="ts">
-import {onPullDownRefresh} from "@dcloudio/uni-app";
 import {ref} from "vue";
 import {listStationAvailableRightsAndCoupons} from "@/api/user";
 import {to} from "@/utils/navigate";
+import { fenToYuan } from "@/utils/money";
 
 const mode = ref(0);
 const couponList = ref<any[]>([]);
@@ -183,15 +183,10 @@ const handleConfirm = () => {
     userRights: rightsList.value?.find((k: any) => k.rightsId == rightsId.value ),
     userCoupon: couponList.value?.find((k: any) => k.couponId == couponId.value),
   }
-   console.log(emitData)
   emits('on-change', emitData)
   handleClose();
 }
 
-onPullDownRefresh(() => {
-  loadData();
-});
-
 const changeTab = (tab: number) => {
   mode.value = tab;
 }
@@ -203,7 +198,6 @@ const changeTab = (tab: number) => {
  * @param urId userRechargeRightsId
  */
 const handleCheckRights = (val: boolean, rId: any,urId: any) => {
-  // console.log("handleCheckRights", userRightsId, val)
   if (rightsId.value == rId) {
     rightsId.value = null;
     userRechargeRightsId.value = null;
@@ -221,7 +215,6 @@ const handleCheckRights = (val: boolean, rId: any,urId: any) => {
  * @param ucid userCouponId
  */
 const handleCheckCoupon = (e: any, cid: any,ucid: any) => {
-  // console.log("handleCheckCoupon", userCouponId, e)
   if (couponId.value == cid) {
     couponId.value = null;
     userCouponId.value = null;
@@ -255,7 +248,6 @@ const loadData = () => {
       mode.value = 1;
     }
 
-    // console.log(res)
     uni.hideLoading();
   });
 }
@@ -274,99 +266,5 @@ defineExpose({
 </script>
 
 <style lang="scss" scoped>
-.page {
-  min-height: 100vh;
-  width: 100%;
-  background-color: #f6f7fa;
-
-  .item {
-    position: relative;
-    min-height: 220rpx;
-    border-radius: 20rpx;
-    overflow: hidden;
-    background: #fff;
-
-    .left {
-      flex-grow: 1;
-    }
-
-    .right {
-      flex-shrink: 0;
-
-      .btn {
-        border-radius: 8rpx;
-        border: 1px solid var(--color-primary);
-        color: var(--color-primary);
-        width: 144rpx;
-        height: 56rpx;
-      }
-    }
-  }
-
-  .tab-list {
-    width: 100%;
-
-    .w50 {
-      width: 50%;
-      text-align: center;
-    }
-
-    .active {
-      color: var(--color-primary);
-    }
-  }
-}
-
-.item-status {
-  font-size: 24rpx;
-  padding: 0rpx 6rpx;
-  color: var(--color-primary);
-  border: 2rpx solid var(--color-primary);
-  border-radius: 6rpx;
-
-}
-
-.item-header__left {
-  display: inline-flex;
-  align-items: flex-end;
-}
-
-.item-header__right {
-  padding: 5rpx;
-  display: flex;
-  //justify-content: flex-end;
-}
-
-.inactive {
-  cursor: not-allowed;
-  pointer-events: none;
-
-  .item-status {
-    font-size: 24rpx;
-    padding: 0rpx 6rpx;
-    color: #ccc !important;
-    border: 2rpx solid #ccc;
-    border-radius: 6rpx;
-
-  }
-
-  .color-primary {
-    color: #ccc !important;
-  }
-}
-
-.item-content_left {
-  flex-grow: 1;
-  display: flex;
-  flex-direction: column;
-  justify-content: space-around;
-
-}
-
-.item-content_right {
-  width: 120rpx;
-  display: flex;
-  align-items: center;
-  align-content: center;
-}
+@use "../../styles/coupon-card.scss";
 </style>

+ 5 - 106
charge-front/src/components/station-coupon/station-coupon.vue

@@ -39,7 +39,7 @@
                         @click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
                     <view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
                     <view class="flex-align-center" v-if="mode === 0">
-                      <view class="fs-24 color-999">充值{{ ((item.amountMin || 0) / 100).toFixed(2) }}元,享受{{ (item.discount / 10).toFixed(1) }}折服务费权益,有效期{{item.validity}}天
+                      <view class="fs-24 color-999">充值{{ fenToYuan(item.amountMin) }}元,享受{{ (item.discount / 10).toFixed(1) }}折服务费权益,有效期{{item.validity}}天
 <!--                        <text class="color-primary">详细规则</text>
                         <text class="fs-24 ml-4 color-primary">>></text>-->
                       </view>
@@ -91,7 +91,7 @@
                     ></image>
                     <view></view>
                     <view class="fs-48 lh-58 color-000 fw-500 ml-16" v-if="item.couponType=='FullDiscount'">
-                      {{ ((item.discount || 0) / 100).toFixed(2) }}元
+                      {{ fenToYuan(item.discount) }}元
                     </view>
 
                     <view class="fs-48 lh-58 color-000 fw-500 ml-16" v-else>
@@ -110,7 +110,7 @@
                         @click.stop="to(`/pages-common/activity/activity?id=${item.activityId}`)">
                     <view class="fs-26 color-999">到期时间:{{ item.endTime }}</view>
                     <view class="flex-align-center">
-                      <view class="fs-26 color-999">服务费门槛:{{ ((item.minServiceMoney || 0) / 100).toFixed(2) }}元
+                      <view class="fs-26 color-999">服务费门槛:{{ fenToYuan(item.minServiceMoney) }}元
                         <text class="color-primary">详细规则</text>
                         <text class="fs-24 ml-4 color-primary">>></text>
                       </view>
@@ -142,10 +142,10 @@
 </template>
 
 <script setup lang="ts">
-import {onPullDownRefresh} from "@dcloudio/uni-app";
 import {ref} from "vue";
 import {collectCoupon, listAvailableCoupons, listAvailableRights} from "@/api/user";
 import {to} from "@/utils/navigate";
+import { fenToYuan } from "@/utils/money";
 
 const mode = ref(0);
 const rightsList = ref<any[]>([]);
@@ -157,10 +157,6 @@ const handleClose = () => {
   visible.value = false;
 }
 
-onPullDownRefresh(() => {
-  loadData();
-});
-
 const changeTab = (tab: number) => {
   mode.value = tab;
 }
@@ -172,7 +168,6 @@ const handleCharge = (rights:any) => {
 const handleCollectCoupon = (coupon: any, index: number) => {
   if (coupon.collected) return;
   collectCoupon(coupon.id).then((res) => {
-    console.log(res)
     uni.showToast({
       title: "领券成功",
       icon: "success"
@@ -195,13 +190,11 @@ const loadData = () => {
     title: "加载中",
   });
   Promise.all([listAvailableCoupons(stationId.value), listAvailableRights(stationId.value)]).then((values) => {
-    console.log(values)
     uni.hideLoading();
     couponList.value = values[0].list||[];
     rightsList.value = values[1].list||[];
   })
  /* listAvailableCoupons(stationId.value).then((res) => {
-    console.log(res)
     uni.hideLoading();
     couponList.value = res.list;
   });*/
@@ -219,99 +212,5 @@ defineExpose({
 </script>
 
 <style lang="scss" scoped>
-.page {
-  min-height: 100vh;
-  width: 100%;
-  background-color: #f6f7fa;
-
-  .item {
-    position: relative;
-    min-height: 220rpx;
-    border-radius: 20rpx;
-    overflow: hidden;
-    background: #fff;
-
-    .left {
-      flex-grow: 1;
-    }
-
-    .right {
-      flex-shrink: 0;
-
-      .btn {
-        border-radius: 8rpx;
-        border: 1px solid var(--color-primary);
-        color: var(--color-primary);
-        width: 144rpx;
-        height: 56rpx;
-      }
-    }
-  }
-
-  .tab-list {
-    width: 100%;
-
-    .w50 {
-      width: 50%;
-      text-align: center;
-    }
-
-    .active {
-      color: var(--color-primary);
-    }
-  }
-}
-
-.item-status {
-  font-size: 24rpx;
-  padding: 0rpx 6rpx;
-  color: var(--color-primary);
-  border: 2rpx solid var(--color-primary);
-  border-radius: 6rpx;
-
-}
-
-.item-header__left {
-  display: inline-flex;
-  align-items: flex-end;
-}
-
-.item-header__right {
-  padding: 5rpx;
-  display: flex;
-  //justify-content: flex-end;
-}
-
-.inactive {
-  cursor: not-allowed;
-  pointer-events: none;
-
-  .item-status {
-    font-size: 24rpx;
-    padding: 0rpx 6rpx;
-    color: #ccc !important;
-    border: 2rpx solid #ccc;
-    border-radius: 6rpx;
-
-  }
-
-  .color-primary {
-    color: #ccc !important;
-  }
-}
-
-.item-content_left {
-  flex-grow: 1;
-  display: flex;
-  flex-direction: column;
-  justify-content: space-around;
-
-}
-
-.item-content_right {
-  width: 120rpx;
-  display: flex;
-  align-items: center;
-  align-content: center;
-}
+@use "../../styles/coupon-card.scss";
 </style>

+ 3 - 7
charge-front/src/pages-user/profile/profile.vue

@@ -44,7 +44,7 @@
 <script setup lang="ts">
 import { clearToken } from "../../api/auth";
 import { fetchProfile, updateProfile, logout } from "../../api/user";
-import { upload } from "../utils/uploader";
+import { upload } from "@/utils/uploader";
 import { onLoad, onShow } from "@dcloudio/uni-app";
 import { requireAuth } from "@/utils/auth";
 import { ref } from "vue";
@@ -175,9 +175,7 @@ const edit = (index: number) => {
           defaultPlateNo: res.plateNumber,
         });
       },
-      fail: (err) => {
-        console.log(err);
-      },
+      fail: (err) => {},
     });
     return;
   }
@@ -225,9 +223,7 @@ const logoutUser = () => {
   });
 };
 
-const errorHandle = (e: any) => {
-  console.log(e);
-};
+const errorHandle = (e: any) => {};
 
 onLoad(() => {
   if (!requireAuth()) {

+ 0 - 151
charge-front/src/pages-user/utils/uploader.ts

@@ -1,151 +0,0 @@
-import { host } from "../../utils/constant";
-import Http from "../../utils/http";
-const uploaderHttp = new Http(host);
-
-type UploadCallback = {
-  onSuccess?(result: { url: string }): void;
-  onFail?(error: any): void;
-  /** [onStart]
-   *
-   * 开始上传回调函数,返回微信UploadTask
-   *
-   */
-  onStart?(task: any): void;
-  onProgressUpdate?(progress: any): void;
-};
-
-type UploadItem = {
-  filePath: string;
-  callback: UploadCallback;
-};
-
-// 上传并行控制
-const UPLOAD_PARALLEL_COUNT = 2;
-const UPLOAD_QUEUE: Array<UploadItem> = [];
-
-// 单独上传一个并限制在上传并行数量中
-export function uploadByQueue(filePath: string, callback: UploadCallback) {
-  if (UPLOAD_QUEUE.length >= UPLOAD_PARALLEL_COUNT) {
-    UPLOAD_QUEUE.push({
-      filePath,
-      callback,
-    });
-    return;
-  }
-  upload(filePath, {
-    onFail: callback.onFail,
-    onStart: callback.onStart,
-    onProgressUpdate: callback.onProgressUpdate,
-    onSuccess: (res) => {
-      // 还有待上传的
-      if (UPLOAD_QUEUE.length) {
-        const item = UPLOAD_QUEUE.shift();
-        if (item) {
-          uploadByQueue(item.filePath, item.callback);
-        }
-      }
-      callback.onSuccess && callback.onSuccess(res);
-    },
-  });
-}
-
-// 单独上传一个
-export function upload(filePath: string, callback: UploadCallback): void {
-  uploaderHttp
-    .get("/file/getSts")
-    .then((oss) => {
-      const key =
-        "uniapp-scan-code-" +
-        guid() +
-        filePath.slice(filePath.lastIndexOf("."));
-      const uploadTask = wxUploadFile(
-        oss.host,
-        filePath,
-        {
-          key,
-          policy: oss.policy,
-          OSSAccessKeyId: oss.accesskeyId,
-          expire: oss.expire,
-          signature: oss.signature,
-          success_action_status: "200",
-        },
-        {
-          success: (res: any) => {
-            if (res.statusCode == 200 && /ok/.test(res.errMsg)) {
-              // https://kym-static.oss-cn-shenzhen.aliyuncs.com/uniapp-scan-code-41d308c3-2252-1b46-744a-104808f1c0c3.png
-              callback.onSuccess &&
-                callback.onSuccess({
-                  url: `${oss.host}/${key}`,
-                });
-            } else {
-              callback.onFail &&
-                callback.onFail({
-                  errMsg: `update error(${JSON.stringify(res)})`,
-                });
-            }
-          },
-          fail: callback.onFail,
-          complete: () => {
-            // 取消监听
-            callback.onProgressUpdate &&
-              uploadTask.offProgressUpdate(callback.onProgressUpdate);
-          },
-        }
-      );
-      callback.onStart && callback.onStart(uploadTask);
-      if (callback.onProgressUpdate) {
-        uploadTask.onProgressUpdate(callback.onProgressUpdate);
-      }
-    })
-    .catch(callback.onFail);
-}
-
-function wxUploadFile(
-  url: string,
-  filePath: string,
-  formData: any,
-  callback: any
-) {
-  return uni.uploadFile({
-    url,
-    filePath,
-    header: {
-      // satoken: getApp<any>().globalData.token || "",
-    },
-    name: "file",
-    formData,
-    success: (res) => {
-      callback.success && callback.success(res);
-    },
-    fail: (err) => {
-      if (err && err.errMsg.indexOf("abort") >= 0) {
-        // 主动中止s
-        return;
-      }
-      callback.fail && callback.fail(err);
-    },
-    complete: () => {
-      callback.complete && callback.complete();
-    },
-  });
-}
-
-function guid() {
-  function S4() {
-    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
-  }
-  return (
-    S4() +
-    S4() +
-    "-" +
-    S4() +
-    "-" +
-    S4() +
-    "-" +
-    S4() +
-    "-" +
-    S4() +
-    S4() +
-    S4()
-  );
-}

+ 92 - 0
charge-front/src/styles/coupon-card.scss

@@ -0,0 +1,92 @@
+/* 优惠券/权益卡卡片公共样式(station-coupon / station-charge-coupon / order-coupon-detail 共用) */
+.page {
+  min-height: 100vh;
+  width: 100%;
+  background-color: #f6f7fa;
+
+  .item {
+    position: relative;
+    min-height: 220rpx;
+    border-radius: 20rpx;
+    overflow: hidden;
+    background: #fff;
+
+    .left {
+      flex-grow: 1;
+    }
+
+    .right {
+      flex-shrink: 0;
+
+      .btn {
+        border-radius: 8rpx;
+        border: 1px solid var(--color-primary);
+        color: var(--color-primary);
+        width: 144rpx;
+        height: 56rpx;
+      }
+    }
+  }
+
+  .tab-list {
+    width: 100%;
+
+    .w50 {
+      width: 50%;
+      text-align: center;
+    }
+
+    .active {
+      color: var(--color-primary);
+    }
+  }
+}
+
+.item-status {
+  font-size: 24rpx;
+  padding: 0rpx 6rpx;
+  color: var(--color-primary);
+  border: 2rpx solid var(--color-primary);
+  border-radius: 6rpx;
+}
+
+.item-header__left {
+  display: inline-flex;
+  align-items: flex-end;
+}
+
+.item-header__right {
+  padding: 5rpx;
+  display: flex;
+}
+
+.inactive {
+  cursor: not-allowed;
+  pointer-events: none;
+
+  .item-status {
+    font-size: 24rpx;
+    padding: 0rpx 6rpx;
+    color: #ccc !important;
+    border: 2rpx solid #ccc;
+    border-radius: 6rpx;
+  }
+
+  .color-primary {
+    color: #ccc !important;
+  }
+}
+
+.item-content_left {
+  flex-grow: 1;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-around;
+}
+
+.item-content_right {
+  width: 120rpx;
+  display: flex;
+  align-items: center;
+  align-content: center;
+}

+ 7 - 44
charge-front/src/pages-charge/utils/uploader.ts → charge-front/src/utils/uploader.ts

@@ -1,55 +1,19 @@
-import { host } from "../../utils/constant";
-import Http from "../../utils/http";
+import { host } from "../utils/constant";
+import Http from "../utils/http";
+
 const uploaderHttp = new Http(host);
 
 type UploadCallback = {
   onSuccess?(result: { url: string }): void;
   onFail?(error: any): void;
-  /** [onStart]
-   *
-   * 开始上传回调函数,返回微信UploadTask
-   *
+  /**
+   * 开始上传回调函数,返回微信 UploadTask
    */
   onStart?(task: any): void;
   onProgressUpdate?(progress: any): void;
 };
 
-type UploadItem = {
-  filePath: string;
-  callback: UploadCallback;
-};
-
-// 上传并行控制
-const UPLOAD_PARALLEL_COUNT = 2;
-const UPLOAD_QUEUE: Array<UploadItem> = [];
-
-// 单独上传一个并限制在上传并行数量中
-export function uploadByQueue(filePath: string, callback: UploadCallback) {
-  if (UPLOAD_QUEUE.length >= UPLOAD_PARALLEL_COUNT) {
-    UPLOAD_QUEUE.push({
-      filePath,
-      callback,
-    });
-    return;
-  }
-  upload(filePath, {
-    onFail: callback.onFail,
-    onStart: callback.onStart,
-    onProgressUpdate: callback.onProgressUpdate,
-    onSuccess: (res) => {
-      // 还有待上传的
-      if (UPLOAD_QUEUE.length) {
-        const item = UPLOAD_QUEUE.shift();
-        if (item) {
-          uploadByQueue(item.filePath, item.callback);
-        }
-      }
-      callback.onSuccess && callback.onSuccess(res);
-    },
-  });
-}
-
-// 单独上传一个
+// 单独上传一个文件(OSS 直传,STS 凭证由服务端下发)
 export function upload(filePath: string, callback: UploadCallback): void {
   uploaderHttp
     .get("/file/getSts")
@@ -72,7 +36,6 @@ export function upload(filePath: string, callback: UploadCallback): void {
         {
           success: (res: any) => {
             if (res.statusCode == 200 && /ok/.test(res.errMsg)) {
-              // https://kym-static.oss-cn-shenzhen.aliyuncs.com/uniapp-scan-code-41d308c3-2252-1b46-744a-104808f1c0c3.png
               callback.onSuccess &&
                 callback.onSuccess({
                   url: `${oss.host}/${key}`,
@@ -119,7 +82,7 @@ function wxUploadFile(
     },
     fail: (err) => {
       if (err && err.errMsg.indexOf("abort") >= 0) {
-        // 主动中止s
+        // 主动中止
         return;
       }
       callback.fail && callback.fail(err);