15102826049 8 часов назад
Родитель
Сommit
a2193609e1
29 измененных файлов с 724 добавлено и 153 удалено
  1. 1 2
      dist/dev/mp-weixin/app.js
  2. 9 0
      dist/dev/mp-weixin/app.json
  3. 19 19
      dist/dev/mp-weixin/common/vendor.js
  4. 40 0
      dist/dev/mp-weixin/components/userLoginPopup.js
  5. 6 0
      dist/dev/mp-weixin/components/userLoginPopup.json
  6. 1 0
      dist/dev/mp-weixin/components/userLoginPopup.wxml
  7. 53 0
      dist/dev/mp-weixin/components/userLoginPopup.wxss
  8. 10 8
      dist/dev/mp-weixin/pages/index/index.js
  9. 2 1
      dist/dev/mp-weixin/pages/index/index.json
  10. 1 1
      dist/dev/mp-weixin/pages/index/index.wxml
  11. 23 19
      dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.js
  12. 1 1
      dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.wxml
  13. 0 1
      dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.wxss
  14. 29 20
      dist/dev/mp-weixin/pagesOne/winner/index.js
  15. 0 0
      dist/dev/mp-weixin/pagesOne/winner/index.wxml
  16. 61 11
      dist/dev/mp-weixin/pagesOne/winner/uploadImage.js
  17. 1 1
      dist/dev/mp-weixin/pagesOne/winner/uploadImage.wxml
  18. 16 9
      dist/dev/mp-weixin/project.private.config.json
  19. 32 0
      dist/dev/mp-weixin/services/ams.js
  20. 27 0
      dist/dev/mp-weixin/utils/system.js
  21. 1 1
      src/App.vue
  22. 87 0
      src/components/userLoginPopup.vue
  23. 63 9
      src/pages/index/index.vue
  24. 29 7
      src/pagesOne/winner/components/uploadReceptPopop.vue
  25. 55 21
      src/pagesOne/winner/index.vue
  26. 69 11
      src/pagesOne/winner/uploadImage.vue
  27. 22 11
      src/services/ams.ts
  28. 24 0
      src/store/info.ts
  29. 42 0
      src/utils/system.ts

+ 1 - 2
dist/dev/mp-weixin/app.js

@@ -24,8 +24,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       console.log("App Hide");
     });
     common_vendor.onLoad(() => {
-      const appid = common_vendor.wx$1.getAccountInfoSync().miniProgram.appId;
-      console.log("------------------", appid);
+      common_vendor.wx$1.getAccountInfoSync().miniProgram.appId;
     });
     return () => {
     };

+ 9 - 0
dist/dev/mp-weixin/app.json

@@ -41,5 +41,14 @@
       }
     ]
   },
+  "requiredPrivateInfos": [
+    "getLocation",
+    "chooseLocation"
+  ],
+  "permission": {
+    "scope.userLocation": {
+      "desc": "是否允许授权地理位置信息。"
+    }
+  },
   "usingComponents": {}
 }

+ 19 - 19
dist/dev/mp-weixin/common/vendor.js

@@ -9051,25 +9051,6 @@ const swiperNavprops = {
    */
   type: makeStringProp("dots")
 };
-const iconProps = {
-  ...baseProps,
-  /**
-   * 使用的图标名字,可以使用链接图片
-   */
-  name: makeRequiredProp(String),
-  /**
-   * 图标的颜色
-   */
-  color: String,
-  /**
-   * 图标的字体大小
-   */
-  size: numericProp,
-  /**
-   * 类名前缀,用于使用自定义图标
-   */
-  classPrefix: makeStringProp("wd-icon")
-};
 const popupProps = {
   ...baseProps,
   /**
@@ -9153,6 +9134,25 @@ const popupProps = {
    */
   lockScroll: makeBooleanProp(true)
 };
+const iconProps = {
+  ...baseProps,
+  /**
+   * 使用的图标名字,可以使用链接图片
+   */
+  name: makeRequiredProp(String),
+  /**
+   * 图标的颜色
+   */
+  color: String,
+  /**
+   * 图标的字体大小
+   */
+  size: numericProp,
+  /**
+   * 类名前缀,用于使用自定义图标
+   */
+  classPrefix: makeStringProp("wd-icon")
+};
 const tagProps = {
   ...baseProps,
   /**

+ 40 - 0
dist/dev/mp-weixin/components/userLoginPopup.js

@@ -0,0 +1,40 @@
+"use strict";
+const common_vendor = require("../common/vendor.js");
+const utils_system = require("../utils/system.js");
+if (!Array) {
+  const _easycom_wd_popup2 = common_vendor.resolveComponent("wd-popup");
+  _easycom_wd_popup2();
+}
+const _easycom_wd_popup = () => "../node-modules/wot-design-uni/components/wd-popup/wd-popup.js";
+if (!Math) {
+  _easycom_wd_popup();
+}
+const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
+  __name: "userLoginPopup",
+  emits: ["update:show"],
+  setup(__props, { expose: __expose, emit: __emit }) {
+    let show = common_vendor.ref(false);
+    const getphonenumber = async (e) => {
+      await utils_system.getMobile(e.detail.code);
+      const phone = common_vendor.index.getStorageSync("phone");
+      if (phone) {
+        show.value = false;
+      }
+    };
+    __expose({ show });
+    return (_ctx, _cache) => {
+      return {
+        a: common_vendor.o(getphonenumber),
+        b: common_vendor.o(_ctx.handleClose),
+        c: common_vendor.o(($event) => common_vendor.isRef(show) ? show.value = $event : show = $event),
+        d: common_vendor.p({
+          position: "bottom",
+          ["custom-style"]: "height: 400rpx;",
+          modelValue: common_vendor.unref(show)
+        })
+      };
+    };
+  }
+});
+const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1b693f85"]]);
+wx.createComponent(Component);

+ 6 - 0
dist/dev/mp-weixin/components/userLoginPopup.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "wd-popup": "../node-modules/wot-design-uni/components/wd-popup/wd-popup"
+  }
+}

+ 1 - 0
dist/dev/mp-weixin/components/userLoginPopup.wxml

@@ -0,0 +1 @@
+<view class="userLoginPopup data-v-1b693f85"><wd-popup wx:if="{{d}}" class="data-v-1b693f85" u-s="{{['d']}}" bindclose="{{b}}" u-i="1b693f85-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"><view class="content data-v-1b693f85"><view class="flex-start-center data-v-1b693f85"><image class="data-v-1b693f85" src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/log.png"></image><text class="brand data-v-1b693f85">今麦郎</text></view><view class="desc data-v-1b693f85"> 允许我们在必要场景下,合理使用你的个人信息,并充分保障你的合法权利。 </view><button class="btn data-v-1b693f85" open-type="getPhoneNumber" bindgetphonenumber="{{a}}"> 授权登录 </button></view></wd-popup></view>

+ 53 - 0
dist/dev/mp-weixin/components/userLoginPopup.wxss

@@ -0,0 +1,53 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+/* 颜色变量 */
+/* 行为相关颜色 */
+/* 文字基本颜色 */
+/* 背景颜色 */
+/* 边框颜色 */
+/* 尺寸变量 */
+/* 文字尺寸 */
+/* 图片尺寸 */
+/* Border Radius */
+/* 水平间距 */
+/* 垂直间距 */
+/* 透明度 */
+/* 文章场景相关 */
+.userLoginPopup .content.data-v-1b693f85 {
+  padding: 80rpx 48rpx;
+}
+.userLoginPopup .content image.data-v-1b693f85 {
+  width: 76rpx;
+  height: 46rpx;
+}
+.userLoginPopup .content .brand.data-v-1b693f85 {
+  font-size: 32rpx;
+  color: #333;
+  margin-left: 14rpx;
+  font-weight: 600;
+}
+.userLoginPopup .content .desc.data-v-1b693f85 {
+  font-size: 28rpx;
+  color: #666;
+  margin-top: 24rpx;
+  margin-bottom: 48rpx;
+}
+.userLoginPopup .btn.data-v-1b693f85 {
+  font-weight: 600;
+  line-height: 104rpx;
+  width: 560rpx;
+  background: linear-gradient(90deg, #225036 0%, #3b8e5e 45.92%, #296141 100%);
+  border-radius: 40rpx;
+  color: #fff;
+  font-size: 32rpx;
+}

+ 10 - 8
dist/dev/mp-weixin/pages/index/index.js

@@ -1,14 +1,16 @@
 "use strict";
 const common_vendor = require("../../common/vendor.js");
 const services_ams = require("../../services/ams.js");
+const utils_system = require("../../utils/system.js");
 if (!Array) {
   const _easycom_wd_swiper2 = common_vendor.resolveComponent("wd-swiper");
   _easycom_wd_swiper2();
 }
 const _easycom_wd_swiper = () => "../../node-modules/wot-design-uni/components/wd-swiper/wd-swiper.js";
 if (!Math) {
-  _easycom_wd_swiper();
+  (_easycom_wd_swiper + UserLoginPopup)();
 }
+const UserLoginPopup = () => "../../components/userLoginPopup.js";
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
@@ -16,22 +18,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const appid = common_vendor.index.getStorageSync("appid");
     common_vendor.onLoad(() => {
       getBanner();
+      utils_system.isGetPhone();
     });
-    const getphonenumber = (e) => {
-      console.log("-----------------------", e.detail.code);
-    };
     const bannerList = common_vendor.ref([]);
     const getBanner = () => {
       services_ams.getCarousel(appid).then((res) => {
         bannerList.value = res.data;
       });
     };
+    const loginRef = common_vendor.ref(null);
     const toActivity = () => {
-      common_vendor.index.navigateTo({
-        url: "/pagesOne/winner/index"
-      });
+      console.log("==============3333333333", utils_system.isGetPhone());
     };
     common_vendor.onShow(() => {
+      utils_system.getActivityData();
     });
     return (_ctx, _cache) => {
       return {
@@ -43,7 +43,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           value: current.value
         }),
         b: common_vendor.o(toActivity),
-        c: common_vendor.o(getphonenumber)
+        c: common_vendor.sr(loginRef, "f5f2151a-1", {
+          "k": "loginRef"
+        })
       };
     };
   }

+ 2 - 1
dist/dev/mp-weixin/pages/index/index.json

@@ -1,6 +1,7 @@
 {
   "navigationStyle": "custom",
   "usingComponents": {
-    "wd-swiper": "../../node-modules/wot-design-uni/components/wd-swiper/wd-swiper"
+    "wd-swiper": "../../node-modules/wot-design-uni/components/wd-swiper/wd-swiper",
+    "user-login-popup": "../../components/userLoginPopup"
   }
 }

+ 1 - 1
dist/dev/mp-weixin/pages/index/index.wxml

@@ -1 +1 @@
-<view class="homeContent"><wd-swiper wx:if="{{a}}" u-i="f5f2151a-0" bind:__l="__l" u-p="{{a}}"></wd-swiper><image class="enter-img" src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/enter.png" mode="scaleToFill" bindtap="{{b}}"/><button open-type="getPhoneNumber" bindgetphonenumber="{{c}}"> 获取手机号 </button></view>
+<view class="homeContent"><wd-swiper wx:if="{{a}}" u-i="f5f2151a-0" bind:__l="__l" u-p="{{a}}"></wd-swiper><image class="enter-img" src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/enter.png" mode="scaleToFill" bindtap="{{b}}"/><user-login-popup class="r" u-r="loginRef" u-i="f5f2151a-1" bind:__l="__l"></user-login-popup></view>

+ 23 - 19
dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.js

@@ -26,20 +26,23 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const props = __props;
     const emit = __emit;
     common_vendor.ref("1");
-    const onCamera = () => {
-      common_vendor.index.chooseImage({
-        count: 1,
-        sourceType: ["camera"],
-        success: function(res) {
-          common_vendor.index.saveImageToPhotosAlbum({
-            filePath: res.tempFilePaths[0],
-            success: function() {
-              console.log("save success");
-            }
-          });
-        }
+    const toUploadImage = (type) => {
+      if (!discountId.value)
+        return common_vendor.index.showToast({
+          title: "请先选择优惠力度",
+          icon: "none"
+        });
+      common_vendor.index.navigateTo({
+        url: `/pagesOne/winner/uploadImage?discountId=${discountId.value}&discountLevel=${discountLevel.value}`
       });
     };
+    const discountId = common_vendor.ref("");
+    const discountLevel = common_vendor.ref("");
+    const radioChange = (e) => {
+      discountId.value = e.detail.value;
+      const obj = props.list.filter((item) => item.id === e.detail.value)[0];
+      discountLevel.value = `满${obj.thresholdAmount}返${obj.cashbackAmount}`;
+    };
     const { handleClose } = hooks_useDraw.useDraw(props, emit);
     return (_ctx, _cache) => {
       return {
@@ -54,21 +57,22 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           };
         }),
         b: common_vendor.unref(pagesOne_winner_utils_source.imgObj).icon1,
-        c: common_vendor.o(onCamera),
-        d: common_vendor.p({
+        c: common_vendor.o(radioChange),
+        d: common_vendor.o(toUploadImage),
+        e: common_vendor.p({
           height: "16rpx",
           ["bg-color"]: "#F7F8F9"
         }),
-        e: common_vendor.o(
+        f: common_vendor.o(
           //@ts-ignore
           (...args) => common_vendor.unref(handleClose) && common_vendor.unref(handleClose)(...args)
         ),
-        f: common_vendor.o(common_vendor.unref(handleClose)),
-        g: common_vendor.o(($event) => props.show = $event),
-        h: common_vendor.p({
+        g: common_vendor.o(common_vendor.unref(handleClose)),
+        h: common_vendor.o(($event) => props.show = $event),
+        i: common_vendor.p({
           position: "bottom",
           ["safe-area-inset-bottom"]: true,
-          ["custom-style"]: "height: 922rpx;border-radius: 40rpx 40rpx 0 0;",
+          ["custom-style"]: "max-height: 922rpx;border-radius: 40rpx 40rpx 0 0;",
           modelValue: props.show
         })
       };

+ 1 - 1
dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.wxml

@@ -1 +1 @@
-<view class="uploadReceptPopup"><wd-popup wx:if="{{h}}" u-s="{{['d']}}" bindclose="{{f}}" u-i="6fe79449-0" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"><view class="topTitle"><text>上传小票</text><text class="tips">(*先选择优惠力度再上传)</text></view><radio-group class="receptBox"><label wx:for="{{a}}" wx:for-item="item" wx:key="e" class="{{['radioItem', item.f]}}"><view class="left"><image class="icon" src="{{b}}" mode="scaleToFill"/><text class="label">满{{item.a}}返{{item.b}}</text></view><radio class="radio" color="#225036" value="{{item.c}}" style="transform:scale(0.9)" checked="{{item.d}}"/></label></radio-group><view class="btnBox"><view class="play" bindtap="{{c}}">拍摄照片</view><view class="phone">从手机相册选择</view><wd-gap wx:if="{{d}}" u-i="6fe79449-1,6fe79449-0" bind:__l="__l" u-p="{{d}}"></wd-gap><view bindtap="{{e}}">取消</view></view></wd-popup></view>
+<view class="uploadReceptPopup"><wd-popup wx:if="{{i}}" u-s="{{['d']}}" bindclose="{{g}}" u-i="6fe79449-0" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"><view class="topTitle"><text>上传小票</text><text class="tips">(*先选择优惠力度再上传)</text></view><radio-group class="receptBox" bindchange="{{c}}"><label wx:for="{{a}}" wx:for-item="item" wx:key="e" class="{{['radioItem', item.f]}}"><view class="left"><image class="icon" src="{{b}}" mode="scaleToFill"/><text class="label">满{{item.a}}返{{item.b}}</text></view><radio class="radio" color="#225036" value="{{item.c}}" style="transform:scale(0.9)" checked="{{item.d}}"/></label></radio-group><view class="btnBox"><view class="play" bindtap="{{d}}">去上传图片</view><wd-gap wx:if="{{e}}" u-i="6fe79449-1,6fe79449-0" bind:__l="__l" u-p="{{e}}"></wd-gap><view bindtap="{{f}}">取消</view></view></wd-popup></view>

+ 0 - 1
dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.wxss

@@ -35,7 +35,6 @@
   color: #bfc8db;
 }
 .uploadReceptPopup .receptBox {
-  height: 390rpx;
   overflow-y: scroll;
 }
 .uploadReceptPopup .radioItem {

+ 29 - 20
dist/dev/mp-weixin/pagesOne/winner/index.js

@@ -29,6 +29,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     );
     let aData = common_vendor.reactive({ discounts: [] });
     let list = common_vendor.ref([]);
+    const openid = common_vendor.index.getStorageSync("openid");
     common_vendor.computed(() => {
       return aData.authCheck.includes("2") ? true : false;
     });
@@ -42,29 +43,37 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
             checked: false
           };
         });
-        console.log("---------------------", aData);
+        common_vendor.index.setStorageSync("activityData", JSON.stringify(aData));
       }).catch((err) => {
         console.log(err);
       });
     };
-    const handledUpload = () => {
-      common_vendor.index.getLocation({
-        type: "gcj02",
-        success: async (res) => {
-          const { latitude, longitude } = res;
-          const key = "7c607ea6b491804270ddcdd72daad58c";
-          const url = `https://restapi.amap.com/v3/geocode/regeo?key=${key}&location=${longitude},${latitude}`;
-          await common_vendor.index.request({ url });
-          console.log("用户所在位置", res);
-        },
-        fail: (err) => {
-          common_vendor.index.showToast({
-            title: "获取位置失败",
-            icon: "none"
-          });
-        }
+    const rewardData = common_vendor.ref([]);
+    const getRewardList = () => {
+      console.log("openid", openid);
+      services_ams.rewardList({ openid }).then((res) => {
+        rewardData.value = res.rows;
+        console.log("获奖记录", rewardData);
+      });
+    };
+    const showUploadRecord = () => {
+      getRewardList();
+      showRecord.value = true;
+    };
+    const cinnerData = common_vendor.ref([]);
+    const getWinnerList = () => {
+      services_ams.auditSuccessList({ openid }).then((res) => {
+        cinnerData.value = res.rows;
+        console.log("获奖记录", rewardData);
       });
     };
+    const showWinerRecord = () => {
+      getWinnerList();
+      showWiner.value = true;
+    };
+    const handledUpload = () => {
+      showUpload.value = true;
+    };
     common_vendor.onShow(() => {
       getList();
     });
@@ -73,12 +82,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         a: backImage.value,
         b: common_vendor.o(($event) => common_vendor.isRef(showDesc) ? showDesc.value = true : showDesc = true),
         c: common_vendor.unref(pagesOne_winner_utils_source.imgObj).rule,
-        d: common_vendor.o(($event) => _ctx.showWinner = true),
-        e: common_vendor.unref(pagesOne_winner_utils_source.imgObj).record,
+        d: common_vendor.unref(pagesOne_winner_utils_source.imgObj).record,
+        e: common_vendor.o(showWinerRecord),
         f: common_vendor.unref(pagesOne_winner_utils_source.imgObj).photo,
         g: common_vendor.o(($event) => common_vendor.isRef(showExample) ? showExample.value = true : showExample = true),
         h: common_vendor.unref(pagesOne_winner_utils_source.imgObj).book,
-        i: common_vendor.o(($event) => common_vendor.isRef(showRecord) ? showRecord.value = true : showRecord = true),
+        i: common_vendor.o(showUploadRecord),
         j: common_vendor.unref(pagesOne_winner_utils_source.gifObj).pointer,
         k: common_vendor.o(handledUpload),
         l: common_vendor.f(common_vendor.unref(list), (item, k0, i0) => {

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/dev/mp-weixin/pagesOne/winner/index.wxml


+ 61 - 11
dist/dev/mp-weixin/pagesOne/winner/uploadImage.js

@@ -1,5 +1,6 @@
 "use strict";
 const common_vendor = require("../../common/vendor.js");
+const services_ams = require("../../services/ams.js");
 if (!Array) {
   const _easycom_wd_upload2 = common_vendor.resolveComponent("wd-upload");
   _easycom_wd_upload2();
@@ -11,23 +12,72 @@ if (!Math) {
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "uploadImage",
   setup(__props) {
-    const fileList = common_vendor.ref([
-      {
-        url: "https://img12.360buyimg.com//n0/jfs/t1/29118/6/4823/55969/5c35c16bE7c262192/c9fdecec4b419355.jpg"
-      }
-    ]);
-    const handleChange = (file) => {
-      console.log(file);
+    const fileList = common_vendor.ref([]);
+    const imgList = common_vendor.ref([]);
+    const aData = JSON.parse(common_vendor.index.getStorageSync("activityData"));
+    const openid = common_vendor.index.getStorageSync("openid");
+    const phone = common_vendor.index.getStorageSync("phone");
+    const routerInfo = common_vendor.reactive({ discountId: "", discountLevel: "" });
+    const action = "http://192.168.168.71:8080/miniApp/oss/upload/" + aData.brandId;
+    const customUpload = (file, formData, options) => {
+      common_vendor.index.uploadFile({
+        url: action,
+        header: options.header,
+        name: options.name,
+        fileName: options.name,
+        fileType: options.fileType,
+        formData,
+        filePath: file.url,
+        success(res) {
+          if (res.statusCode === options.statusCode) {
+            options.onSuccess(res, file, formData);
+            const data = JSON.parse(res.data);
+            imgList.value.push(data.url);
+          } else {
+            options.onError({ ...res, errMsg: res.errMsg || "" }, file, formData);
+          }
+        },
+        fail(err) {
+          options.onError(err, file, formData);
+        }
+      });
     };
+    const handleRemove = (file) => {
+      const data = JSON.parse(file.file.response);
+      imgList.value = imgList.value.filter((item) => item !== data.url);
+      console.log("---------------2222222", imgList.value);
+    };
+    const onAdd = () => {
+      const params = {
+        openid,
+        mobile: phone,
+        latitude: "",
+        longitude: "",
+        discountId: routerInfo.discountId,
+        discountLevel: routerInfo.discountLevel,
+        receiptImages: imgList.value.join(","),
+        marketingActivityId: aData.id
+      };
+      services_ams.addCustomer(params).then((res) => {
+        common_vendor.index.navigateBack();
+        console.log("---------------------", res);
+      });
+    };
+    common_vendor.onLoad((options) => {
+      routerInfo.discountId = options.discountId;
+      routerInfo.discountLevel = options.discountLevel;
+      console.log("---------------------", routerInfo);
+    });
     return (_ctx, _cache) => {
       return {
-        a: common_vendor.o(handleChange),
+        a: common_vendor.o(handleRemove),
         b: common_vendor.p({
           ["file-list"]: fileList.value,
-          action: "https://mockapi.eolink.com/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload",
           multiple: true,
-          limit: 5
-        })
+          limit: 5,
+          ["upload-method"]: customUpload
+        }),
+        c: common_vendor.o(onAdd)
       };
     };
   }

+ 1 - 1
dist/dev/mp-weixin/pagesOne/winner/uploadImage.wxml

@@ -1 +1 @@
-<view class="uploadImageBox"><wd-upload wx:if="{{b}}" u-s="{{['d']}}" bindchange="{{a}}" u-i="fad57140-0" bind:__l="__l" u-p="{{b}}"><image class="upload" src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/upload.png" mode="scaleToFill"/></wd-upload><view class="tips">最多上传5张照片</view><view class="btn">立即上传</view></view>
+<view class="uploadImageBox"><wd-upload wx:if="{{b}}" u-s="{{['d']}}" bindremove="{{a}}" u-i="fad57140-0" bind:__l="__l" u-p="{{b}}"><image class="upload" src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/upload.png" mode="scaleToFill"/></wd-upload><view class="tips">最多上传5张照片</view><view class="btn" bindtap="{{c}}">立即上传</view></view>

+ 16 - 9
dist/dev/mp-weixin/project.private.config.json

@@ -5,11 +5,25 @@
     "miniprogram": {
       "list": [
         {
+          "name": "pagesOne/winner/uploadImage",
+          "pathName": "pagesOne/winner/uploadImage",
+          "query": "discountId=1924735448735100930&discountLevel=%E6%BB%A125%E8%BF%945",
+          "scene": null,
+          "launchMode": "default"
+        },
+        {
+          "name": "pagesOne/winner/index",
+          "pathName": "pagesOne/winner/index",
+          "query": "discountId=1924735448735100930&discountLevel=%E6%BB%A125%E8%BF%945",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
           "name": "pagesOne/record/uploadDetail",
           "pathName": "pagesOne/record/uploadDetail",
           "query": "",
-          "scene": null,
-          "launchMode": "default"
+          "launchMode": "default",
+          "scene": null
         },
         {
           "name": "pagesOne/record/uploadList",
@@ -31,13 +45,6 @@
           "query": "",
           "launchMode": "default",
           "scene": null
-        },
-        {
-          "name": "pagesOne/winner/index",
-          "pathName": "pagesOne/winner/index",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
         }
       ]
     }

+ 32 - 0
dist/dev/mp-weixin/services/ams.js

@@ -13,5 +13,37 @@ const getActivity = (data) => {
     url: `/miniApp/getActivity/${data}`
   });
 };
+const addCustomer = (data) => {
+  return utils_http.http({
+    method: "POST",
+    url: "/customer/add",
+    data
+  });
+};
+const rewardList = (data) => {
+  return utils_http.http({
+    method: "POST",
+    url: "/customer/rewardList",
+    data
+  });
+};
+const auditSuccessList = (data) => {
+  return utils_http.http({
+    method: "POST",
+    url: "/customer/auditSuccessList",
+    data
+  });
+};
+const getPhoneNumberInfo = (data) => {
+  return utils_http.http({
+    method: "GET",
+    url: `/miniApp/getPhoneNumber/${data}`,
+    data
+  });
+};
+exports.addCustomer = addCustomer;
+exports.auditSuccessList = auditSuccessList;
 exports.getActivity = getActivity;
 exports.getCarousel = getCarousel;
+exports.getPhoneNumberInfo = getPhoneNumberInfo;
+exports.rewardList = rewardList;

+ 27 - 0
dist/dev/mp-weixin/utils/system.js

@@ -1,5 +1,6 @@
 "use strict";
 const common_vendor = require("../common/vendor.js");
+const services_ams = require("../services/ams.js");
 const getNavTop = () => {
   let windowWidth = common_vendor.wx$1.getSystemInfoSync().windowWidth;
   const statusBarHeight = common_vendor.wx$1.getSystemInfoSync().statusBarHeight;
@@ -8,4 +9,30 @@ const getNavTop = () => {
   const navTop = statusBarHeight * (750 / windowWidth);
   return navTop;
 };
+const getActivityData = () => {
+  const appid = common_vendor.index.getStorageSync("appid");
+  let isAuth = false;
+  services_ams.getActivity(appid).then((res) => {
+    const data = res.data[0] || {};
+    common_vendor.index.setStorageSync("activityData", JSON.stringify(data));
+  }).catch((err) => {
+    console.log(err);
+  });
+  return isAuth;
+};
+const getMobile = (code) => {
+  services_ams.getPhoneNumberInfo(code).then((res) => {
+    common_vendor.index.setStorageSync("phone", res.data);
+  });
+};
+const isGetPhone = () => {
+  const data = JSON.parse(common_vendor.index.getStorageSync("activityData")) || {};
+  const authCheck = (data == null ? void 0 : data.authCheck.split(",")) || [];
+  const isCheck = authCheck.includes("1");
+  const isPhone = common_vendor.index.getStorageSync("phone") ? true : false;
+  return isCheck && isPhone;
+};
+exports.getActivityData = getActivityData;
+exports.getMobile = getMobile;
 exports.getNavTop = getNavTop;
+exports.isGetPhone = isGetPhone;

+ 1 - 1
src/App.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import { onLaunch, onShow, onHide, onLoad } from "@dcloudio/uni-app";
+
 onLaunch(() => {
   console.log("App Launch");
 });
@@ -12,7 +13,6 @@ onHide(() => {
 });
 onLoad(() => {
   const appid = wx.getAccountInfoSync().miniProgram.appId;
-  console.log("------------------", appid);
 });
 </script>
 <style lang="scss">

+ 87 - 0
src/components/userLoginPopup.vue

@@ -0,0 +1,87 @@
+<template>
+  <view class="userLoginPopup">
+    <wd-popup
+      v-model="show"
+      position="bottom"
+      custom-style="height: 400rpx;"
+      @close="handleClose"
+    >
+      <view class="content">
+        <view class="flex-start-center">
+          <image
+            src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/log.png"
+          ></image>
+          <text class="brand">今麦郎</text></view
+        >
+        <view class="desc">
+          允许我们在必要场景下,合理使用你的个人信息,并充分保障你的合法权利。
+        </view>
+        <button
+          class="btn"
+          open-type="getPhoneNumber"
+          @getphonenumber="getphonenumber"
+        >
+          授权登录
+        </button>
+      </view>
+    </wd-popup>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref, defineExpose } from "vue";
+import { useDraw } from "@/hooks/useDraw";
+let show = ref(false);
+const emit = defineEmits(["update:show"]);
+import { verifyPhone, getMobile, isGetPhone } from "@/utils/system";
+
+const getphonenumber = async (e) => {
+  await getMobile(e.detail.code);
+  const phone = uni.getStorageSync("phone");
+  if (phone) {
+    show.value = false;
+  }
+};
+
+defineExpose({ show });
+// const { handleClose } = useDraw(props, emit);
+</script>
+
+<style lang="scss" scoped>
+.userLoginPopup {
+  .content {
+    padding: 80rpx 48rpx;
+
+    image {
+      width: 76rpx;
+      height: 46rpx;
+    }
+    .brand {
+      font-size: 32rpx;
+      color: #333;
+      margin-left: 14rpx;
+      font-weight: 600;
+    }
+    .desc {
+      font-size: 28rpx;
+      color: #666;
+      margin-top: 24rpx;
+      margin-bottom: 48rpx;
+    }
+  }
+  .btn {
+    font-weight: 600;
+    line-height: 104rpx;
+    width: 560rpx;
+    background: linear-gradient(
+      90deg,
+      #225036 0%,
+      #3b8e5e 45.92%,
+      #296141 100%
+    );
+    border-radius: 40rpx;
+    color: #fff;
+    font-size: 32rpx;
+  }
+}
+</style>

+ 63 - 9
src/pages/index/index.vue

@@ -8,21 +8,23 @@
       :value="current"
     >
     </wd-swiper>
+
     <image
       class="enter-img"
       src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/enter.png"
       mode="scaleToFill"
       @click="toActivity"
     />
-    <button open-type="getPhoneNumber" @getphonenumber="getphonenumber">
+    <!-- <button open-type="getPhoneNumber" @getphonenumber="getPhone">
       获取手机号
-    </button>
+    </button> -->
     <!-- <image class="logo" src="/static/logo.png" />
     <view class="text-area"
       <text class="title">{{ title }}</text>
     </view>
     <button hover-class="button-hover" @click="onLogin">登录</button>
     <wd-button type="success">成功按钮</wd-button> -->
+    <user-login-popup ref="loginRef"></user-login-popup>
   </view>
 </template>
 
@@ -30,17 +32,60 @@
 import { onLoad, onShow } from "@dcloudio/uni-app";
 import { getCarousel } from "@/services/ams";
 import { ref } from "vue";
+// import { useInfoStore } from "@/store/info";
+import { getActivityData, getPhoneNumber, isGetPhone } from "@/utils/system";
+import UserLoginPopup from "@/components/userLoginPopup.vue";
+
 const current = ref<number>(0);
 const appid = uni.getStorageSync("appid");
-
 onLoad(() => {
+  // payment();
   getBanner();
+  isGetPhone();
 });
 
-const getphonenumber = (e: any) => {
-  console.log("-----------------------", e.detail.code);
+const getPhone = (e: any) => {
+  isGetPhone();
+  // infoStore.getPhoneNumber(e.detail.code);
+};
+
+const payment = () => {
+  uni.login({
+    //获取code,
+    success: (res) => {
+      var code = res.code,
+        appId = "wx4f6dc4ac1674547c",
+        secret = "9e0e7fe5161541d9862b8ee2db6da840";
+      console.log("正在登录中...");
+      //根据获取的code去腾讯服务器,请求用户数据,返回的结果中,包含openid
+      wx.request({
+        url:
+          "https://api.weixin.qq.com/sns/jscode2session?appid=" +
+          appId +
+          "&secret=" +
+          secret +
+          "&js_code=" +
+          code +
+          "&grant_type=authorization_code",
+        data: {},
+        header: {
+          "content-type": "json",
+        },
+        success: (user_res) => {
+          //请求成功获取openid;
+          const user_openid = user_res.data.openid;
+          uni.setStorageSync("openid", user_openid);
+          console.log("登录成功", user_openid);
+        },
+      });
+    },
+  });
 };
 
+// const getphonenumber = (e: any) => {
+//   console.log("-----------------------", e.detail.code);
+// };
+
 const bannerList = ref([]);
 const getBanner = () => {
   getCarousel(appid).then((res: any) => {
@@ -49,12 +94,21 @@ const getBanner = () => {
   });
 };
 
+const loginRef = <any>ref(null);
 const toActivity = () => {
-  uni.navigateTo({
-    url: "/pagesOne/winner/index",
-  });
+  console.log("==============3333333333", isGetPhone());
+
+  // if (!verifyPhone() || !isGetPhone()) {
+  //   loginRef.value.show = true;
+  // } else {
+  //   uni.navigateTo({
+  //     url: "/pagesOne/winner/index",
+  //   });
+  // }
 };
-onShow(() => {});
+onShow(() => {
+  getActivityData();
+});
 </script>
 
 <style lang="scss">

+ 29 - 7
src/pagesOne/winner/components/uploadReceptPopop.vue

@@ -4,14 +4,14 @@
       v-model="props.show"
       position="bottom"
       :safe-area-inset-bottom="true"
-      custom-style="height: 922rpx;border-radius: 40rpx 40rpx 0 0;"
+      custom-style="max-height: 922rpx;border-radius: 40rpx 40rpx 0 0;"
       @close="handleClose"
     >
       <view class="topTitle">
         <text>上传小票</text>
         <text class="tips">(*先选择优惠力度再上传)</text>
       </view>
-      <radio-group class="receptBox">
+      <radio-group class="receptBox" @change="radioChange">
         <label
           v-for="item in props.list"
           :key="item.id"
@@ -35,8 +35,10 @@
       </radio-group>
 
       <view class="btnBox">
-        <view class="play" @click="onCamera">拍摄照片</view>
-        <view class="phone">从手机相册选择</view>
+        <view class="play" @click="toUploadImage">去上传图片</view>
+        <!-- <view class="phone" @click="toUploadImage('album')"
+          >从手机相册选择</view
+        > -->
         <wd-gap height="16rpx" bg-color="#F7F8F9"></wd-gap>
         <view @click="handleClose">取消</view>
       </view>
@@ -45,7 +47,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref } from "vue";
+import { reactive, ref } from "vue";
 import { imgObj } from "../utils/source";
 import { useDraw } from "@/hooks/useDraw";
 import { receptProp } from "../utils/interface";
@@ -61,10 +63,30 @@ const props = defineProps({
 const emit = defineEmits(["update:show"]);
 const value = ref("1");
 
+const toUploadImage = (type: string) => {
+  if (!discountId.value)
+    return uni.showToast({
+      title: "请先选择优惠力度",
+      icon: "none",
+    });
+  uni.navigateTo({
+    url: `/pagesOne/winner/uploadImage?discountId=${discountId.value}&discountLevel=${discountLevel.value}`,
+  });
+};
+
+const discountId = ref<string>("");
+const discountLevel = ref<string>("");
+
+const radioChange = (e: any) => {
+  discountId.value = e.detail.value;
+  const obj = props.list!.filter((item) => item.id === e.detail.value)[0];
+  discountLevel.value = `满${obj.thresholdAmount}返${obj.cashbackAmount}`;
+};
+
 const onCamera = () => {
   uni.chooseImage({
     count: 1,
-    sourceType: ["camera"],
+    // sourceType: ["camera", "ablum"],
     success: function (res) {
       uni.saveImageToPhotosAlbum({
         filePath: res.tempFilePaths[0],
@@ -100,7 +122,7 @@ const { handleClose } = useDraw(props, emit);
     }
   }
   .receptBox {
-    height: 390rpx;
+    // height: 390rpx;
     overflow-y: scroll;
   }
   .radioItem {

+ 55 - 21
src/pagesOne/winner/index.vue

@@ -5,8 +5,8 @@
       <view class="floatWindow">
         <image @click="showDesc = true" :src="imgObj.rule" mode="scaleToFill" />
         <image
-          @click="showWinner = true"
           :src="imgObj.record"
+          @click="showWinerRecord"
           mode="scaleToFill"
         />
       </view>
@@ -15,7 +15,7 @@
           <text>拍照示例</text>
           <image :src="imgObj.photo" mode="scaleToFill" />
         </view>
-        <view @click="showRecord = true">
+        <view @click="showUploadRecord">
           <text>上传记录</text>
           <image :src="imgObj.book" mode="scaleToFill" />
         </view>
@@ -74,7 +74,7 @@ import UploadReceptPopop from "./components/uploadReceptPopop.vue";
 import WinRecordPopup from "./components/winRecordPopup.vue";
 import UploadRecordPopup from "./components/uploadRecordPopup.vue";
 import ActivityDescPopup from "./components/activityDescPopup.vue";
-import { getActivity } from "@/services/ams";
+import { getActivity, rewardList, auditSuccessList } from "@/services/ams";
 import { receptProp } from "./utils/interface";
 let showExample = ref<boolean>(false);
 let showUpload = ref<boolean>(false);
@@ -89,6 +89,8 @@ const backImage = ref<string>(
 let aData: any = reactive({ discounts: [] });
 let list = ref([] as receptProp[]);
 
+const openid = uni.getStorageSync("openid");
+
 const isAddress = computed(() => {
   return aData.authCheck.includes("2") ? true : false;
 });
@@ -104,8 +106,8 @@ const getList = () => {
           checked: false,
         };
       });
-      console.log("---------------------", aData);
 
+      uni.setStorageSync("activityData", JSON.stringify(aData));
       // backImage.value = res.data[0].activityImage;
     })
     .catch((err) => {
@@ -113,26 +115,58 @@ const getList = () => {
     });
 };
 
-const handledUpload = () => {
-  uni.getLocation({
-    type: "gcj02",
-    success: async (res) => {
-      const { latitude, longitude } = res;
-      // 调用高德API
-      const key = "7c607ea6b491804270ddcdd72daad58c";
-      const url = `https://restapi.amap.com/v3/geocode/regeo?key=${key}&location=${longitude},${latitude}`;
-      const data = await uni.request({ url });
-      console.log("用户所在位置", res);
-    },
-    fail: (err) => {
-      uni.showToast({
-        title: "获取位置失败",
-        icon: "none",
-      });
-    },
+const rewardData = ref([]);
+//获取上传记录
+const getRewardList = () => {
+  console.log("openid", openid);
+  rewardList({ openid }).then((res: any) => {
+    rewardData.value = res.rows;
+    console.log("获奖记录", rewardData);
   });
 };
 
+//打开上传记录
+const showUploadRecord = () => {
+  getRewardList();
+  showRecord.value = true;
+};
+
+const cinnerData = ref([]);
+//获取奖励记录
+const getWinnerList = () => {
+  auditSuccessList({ openid }).then((res: any) => {
+    cinnerData.value = res.rows;
+    console.log("获奖记录", rewardData);
+  });
+};
+
+//打开获奖记录
+const showWinerRecord = () => {
+  getWinnerList();
+  showWiner.value = true;
+};
+
+const handledUpload = () => {
+  showUpload.value = true;
+  // uni.getLocation({
+  //   type: "gcj02",
+  //   success: async (res) => {
+  //     const { latitude, longitude } = res;
+  //     // 调用高德API
+  //     const key = "7c607ea6b491804270ddcdd72daad58c";
+  //     const url = `https://restapi.amap.com/v3/geocode/regeo?key=${key}&location=${longitude},${latitude}`;
+  //     const data = await uni.request({ url });
+  //     console.log("用户所在位置", res);
+  //   },
+  //   fail: (err) => {
+  //     uni.showToast({
+  //       title: "获取位置失败",
+  //       icon: "none",
+  //     });
+  //   },
+  // });
+};
+
 onShow(() => {
   getList();
 });

+ 69 - 11
src/pagesOne/winner/uploadImage.vue

@@ -2,10 +2,10 @@
   <view class="uploadImageBox">
     <wd-upload
       :file-list="fileList"
-      action="https://mockapi.eolink.com/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload"
-      @change="handleChange"
       multiple
       :limit="5"
+      :upload-method="customUpload"
+      @remove="handleRemove"
     >
       <image
         class="upload"
@@ -14,20 +14,78 @@
       />
     </wd-upload>
     <view class="tips">最多上传5张照片</view>
-    <view class="btn">立即上传</view>
+    <view class="btn" @click="onAdd">立即上传</view>
   </view>
 </template>
 
 <script lang="ts" setup>
-import { ref } from "vue";
-const fileList = ref<any[]>([
-  {
-    url: "https://img12.360buyimg.com//n0/jfs/t1/29118/6/4823/55969/5c35c16bE7c262192/c9fdecec4b419355.jpg",
-  },
-]);
-const handleChange = (file: any) => {
-  console.log(file);
+import { onLoad } from "@dcloudio/uni-app";
+import { reactive, ref } from "vue";
+import { addCustomer } from "@/services/ams";
+const fileList = ref<any[]>([]);
+const imgList = ref<string[]>([]);
+const aData = JSON.parse(uni.getStorageSync("activityData"));
+const openid = uni.getStorageSync("openid");
+const phone = uni.getStorageSync("phone");
+const routerInfo = reactive({ discountId: "", discountLevel: "" });
+const action =
+  import.meta.env.VITE_API_URL + "/miniApp/oss/upload/" + aData.brandId;
+
+const customUpload = (file: any, formData: any, options: any) => {
+  uni.uploadFile({
+    url: action,
+    header: options.header,
+    name: options.name,
+    fileName: options.name,
+    fileType: options.fileType,
+    formData,
+    filePath: file.url,
+    success(res) {
+      if (res.statusCode === options.statusCode) {
+        // 设置上传成功
+        options.onSuccess(res, file, formData);
+        const data = JSON.parse(res.data);
+        imgList.value.push(data.url);
+      } else {
+        // 设置上传失败
+        options.onError({ ...res, errMsg: res.errMsg || "" }, file, formData);
+      }
+    },
+    fail(err) {
+      // 设置上传失败
+      options.onError(err, file, formData);
+    },
+  });
+};
+
+const handleRemove = (file: any) => {
+  const data = JSON.parse(file.file.response);
+  imgList.value = imgList.value.filter((item) => item !== data.url);
+  console.log("---------------2222222", imgList.value);
 };
+
+const onAdd = () => {
+  const params = {
+    openid,
+    mobile: phone,
+    latitude: "",
+    longitude: "",
+    discountId: routerInfo.discountId,
+    discountLevel: routerInfo.discountLevel,
+    receiptImages: imgList.value.join(","),
+    marketingActivityId: aData.id,
+  };
+  addCustomer(params).then((res) => {
+    uni.navigateBack();
+    console.log("---------------------", res);
+  });
+};
+
+onLoad((options: any) => {
+  routerInfo.discountId = options.discountId;
+  routerInfo.discountLevel = options.discountLevel;
+  console.log("---------------------", routerInfo);
+});
 </script>
 
 <style lang="scss">

+ 22 - 11
src/services/ams.ts

@@ -29,31 +29,42 @@ export const addCustomer = (data: any) => {
   });
 };
 /**
- * 任务门店列表(新)
+ * 上传记录
  */
-export const taskDetail = (data: any) => {
+export const rewardList = (data: any) => {
   return http({
-    method: "GET",
-    url: "/wx/taskInfo/taskDetail",
+    method: "POST",
+    url: "/customer/rewardList",
     data,
   });
 };
 /**
- * 今日任务未读数量
+ * 中奖记录
  */
-export const todaysTaskCount = () => {
+export const auditSuccessList = (data: any) => {
   return http({
-    method: "GET",
-    url: "/wx/taskInfo/todaysTaskCount",
+    method: "POST",
+    url: "/customer/auditSuccessList",
+    data,
   });
 };
 /**
- * 筛选渠道列表
+ * 上传记录详情
  */
-export const channelByUserId = () => {
+export const rewardDetail = (data: any) => {
+  return http({
+    method: "POST",
+    url: "/customer/rewardDetail",
+    data,
+  });
+};
+
+//获取手机号
+export const getPhoneNumberInfo = (data: any) => {
   return http({
     method: "GET",
-    url: "/wx/taskInfo/getChannelByUserId",
+    url: `/miniApp/getPhoneNumber/${data}`,
+    data,
   });
 };
 

+ 24 - 0
src/store/info.ts

@@ -0,0 +1,24 @@
+import { defineStore } from "pinia";
+
+import { getPhoneNumberInfo, getActivity } from "@/services/ams";
+
+export const useInfoStore = defineStore("info", {
+  state: () => ({
+    // appid: uni.getStorageSync("appid"),
+  }),
+  getters: {
+    isVerfyPhone(): boolean {
+      return (
+        uni.getStorageSync("phone") !== "" && uni.getStorageSync("appid") !== ""
+      );
+    },
+  },
+  actions: {
+    getPhoneNumber(code: string) {
+      getPhoneNumberInfo(code).then((res: any) => {
+        console.log(res);
+        uni.setStorageSync("phone", res.data);
+      });
+    },
+  },
+});

+ 42 - 0
src/utils/system.ts

@@ -1,3 +1,5 @@
+import { getPhoneNumberInfo, getActivity } from "@/services/ams";
+
 export const getNavTop = () => {
   // 1.获取屏幕可使用宽度
   let windowWidth = wx.getSystemInfoSync().windowWidth;
@@ -13,3 +15,43 @@ export const getNavTop = () => {
   const navTop = statusBarHeight * (750 / windowWidth);
   return navTop;
 };
+
+export const getActivityData = () => {
+  const appid = uni.getStorageSync("appid");
+  let isAuth = false;
+  getActivity(appid)
+    .then((res: any) => {
+      const data = res.data[0] || {};
+      uni.setStorageSync("activityData", JSON.stringify(data));
+
+      // const authCheck = data?.authCheck.split(",") || [];
+      // if (authCheck.includes("1")) {
+      //   isAuth = true;
+      // } else {
+      //   isAuth = false;
+      // }
+      // console.log("---------------------1111", authCheck.includes("1"));
+    })
+    .catch((err) => {
+      console.log(err);
+
+      // isAuth = false;
+    });
+
+  return isAuth;
+};
+
+export const getMobile = (code: string) => {
+  getPhoneNumberInfo(code).then((res: any) => {
+    uni.setStorageSync("phone", res.data);
+  });
+};
+
+export const isGetPhone = () => {
+  const data = JSON.parse(uni.getStorageSync("activityData")) || {};
+  const authCheck = data?.authCheck.split(",") || [];
+  const isCheck = authCheck.includes("1");
+  const isPhone = uni.getStorageSync("phone") ? true : false;
+
+  return isCheck && isPhone;
+};

Некоторые файлы не были показаны из-за большого количества измененных файлов