Преглед изворни кода

新增地图与订阅消息

15102826049 пре 1 месец
родитељ
комит
165bebab39
31 измењених фајлова са 531 додато и 140 уклоњено
  1. 1 1
      dist/build/mp-weixin/pages/my/components/nearlyStoreBox.js
  2. 1 1
      dist/build/mp-weixin/pages/my/components/nearlyStoreBox.wxml
  3. 1 1
      dist/build/mp-weixin/pages/my/components/nearlyStoreBox.wxss
  4. 1 1
      dist/build/mp-weixin/pagesOne/winner/components/activityDescPopup.js
  5. 1 1
      dist/build/mp-weixin/pagesOne/winner/components/activityDescPopup.wxml
  6. 1 1
      dist/build/mp-weixin/pagesOne/winner/components/activityDescPopup.wxss
  7. 1 0
      dist/dev/mp-weixin/app.js
  8. 2 1
      dist/dev/mp-weixin/app.json
  9. 0 8
      dist/dev/mp-weixin/pages/my/components/nearlyStoreBox.js
  10. 32 5
      dist/dev/mp-weixin/pages/my/index.js
  11. 1 2
      dist/dev/mp-weixin/pages/my/index.json
  12. 0 1
      dist/dev/mp-weixin/pages/my/index.wxml
  13. 50 7
      dist/dev/mp-weixin/pages/my/index.wxss
  14. 26 0
      dist/dev/mp-weixin/pages/my/location.js
  15. 4 0
      dist/dev/mp-weixin/pages/my/location.json
  16. 1 0
      dist/dev/mp-weixin/pages/my/location.wxml
  17. 34 33
      dist/dev/mp-weixin/pages/my/location.wxss
  18. 4 2
      dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.js
  19. 46 1
      dist/dev/mp-weixin/pagesOne/winner/index.js
  20. 25 3
      dist/dev/mp-weixin/pagesOne/winner/uploadImage.js
  21. 9 2
      dist/dev/mp-weixin/project.private.config.json
  22. 7 0
      dist/dev/mp-weixin/services/ams.js
  23. 6 0
      src/pages.json
  24. 1 1
      src/pages/my/components/nearlyStoreBox.vue
  25. 96 15
      src/pages/my/index.vue
  26. 87 0
      src/pages/my/location.vue
  27. 4 2
      src/pagesOne/winner/components/uploadReceptPopop.vue
  28. 53 45
      src/pagesOne/winner/index.vue
  29. 28 5
      src/pagesOne/winner/uploadImage.vue
  30. 8 0
      src/services/ams.ts
  31. 0 1
      vite.config.ts

+ 1 - 1
dist/build/mp-weixin/pages/my/components/nearlyStoreBox.js

@@ -1 +1 @@
-"use strict";const e={};const n=require("../../../common/vendor.js")._export_sfc(e,[["render",function(e,n){return{}}],["__scopeId","data-v-26d51410"]]);wx.createComponent(n);
+"use strict";const e={};const n=require("../../../common/vendor.js")._export_sfc(e,[["render",function(e,n){return{}}],["__scopeId","data-v-c35b6114"]]);wx.createComponent(n);

+ 1 - 1
dist/build/mp-weixin/pages/my/components/nearlyStoreBox.wxml

@@ -1 +1 @@
-<view class="nearly-box data-v-26d51410"><view class="title data-v-26d51410"> 离我最近 </view><view class="count data-v-26d51410"><view class="cont-msg data-v-26d51410"><image class="icon-img data-v-26d51410" src="https://xiangli-tesco.oss-cn-hangzhou.aliyuncs.com/qiuyu/static/home/address.png"></image><view class="store-name data-v-26d51410">附近没有门店</view></view></view></view>
+<view class="nearly-box data-v-c35b6114"><view class="title data-v-c35b6114"> 离我最近 </view><view class="count data-v-c35b6114"><view class="cont-msg data-v-c35b6114"><image class="icon-img data-v-c35b6114" src="https://xiangli-tesco.oss-cn-hangzhou.aliyuncs.com/qiuyu/static/home/address.png"></image><view class="store-name data-v-c35b6114">附近没有门店</view></view></view></view>

+ 1 - 1
dist/build/mp-weixin/pages/my/components/nearlyStoreBox.wxss

@@ -1 +1 @@
-.nearly-box.data-v-26d51410{margin-bottom:32rpx}.nearly-box .title.data-v-26d51410{color:#000;font-weight:700;font-size:28rpx;margin-bottom:12rpx}.nearly-box .count.data-v-26d51410{padding:20rpx;border-radius:16rpx;background:#fff}.nearly-box .cont-msg.data-v-26d51410{width:100%;height:108rpx;background:url(https://xiangli-tesco.oss-cn-hangzhou.aliyuncs.com/qiuyu/static/mine/nearly-bg.png) no-repeat;background-size:100% 100%;display:flex;align-items:center;justify-content:flex-start}.nearly-box .cont-msg .icon-img.data-v-26d51410{width:36rpx;height:36rpx}.nearly-box .cont-msg .store-name.data-v-26d51410{color:#0f1828;font-size:28rpx;font-style:normal;font-weight:700;float:left}.nearly-box .cont-msg .store-num.data-v-26d51410{color:#666;font-size:24rpx;font-weight:400;margin-top:10rpx}.nearly-box .cont-msg .daohang.data-v-26d51410{font-size:28rpx;color:#1a65ff;padding-right:24rpx}
+.nearly-box.data-v-c35b6114{margin-bottom:32rpx}.nearly-box .title.data-v-c35b6114{color:#000;font-weight:700;font-size:28rpx;margin-bottom:12rpx}.nearly-box .count.data-v-c35b6114{padding:20rpx;border-radius:16rpx;background:#fff}.nearly-box .cont-msg.data-v-c35b6114{width:100%;height:208rpx;background:url(https://xiangli-tesco.oss-cn-hangzhou.aliyuncs.com/qiuyu/static/mine/nearly-bg.png) no-repeat;background-size:100% 100%;display:flex;align-items:center;justify-content:flex-start}.nearly-box .cont-msg .icon-img.data-v-c35b6114{width:36rpx;height:36rpx}.nearly-box .cont-msg .store-name.data-v-c35b6114{color:#0f1828;font-size:28rpx;font-style:normal;font-weight:700;float:left}.nearly-box .cont-msg .store-num.data-v-c35b6114{color:#666;font-size:24rpx;font-weight:400;margin-top:10rpx}.nearly-box .cont-msg .daohang.data-v-c35b6114{font-size:28rpx;color:#1a65ff;padding-right:24rpx}

+ 1 - 1
dist/build/mp-weixin/pagesOne/winner/components/activityDescPopup.js

@@ -1 +1 @@
-"use strict";const e=require("../../../common/vendor.js"),o=require("../../../hooks/useDraw.js");if(!Array){e.resolveComponent("wd-popup")()}Math;const t=e.defineComponent({__name:"activityDescPopup",props:{show:{type:Boolean,default:!1},description:{type:Array,default:()=>[]}},emits:["update:show"],setup(t,{emit:s}){const r=t,p=s,{handleClose:a}=o.useDraw(r,p);return(o,s)=>({a:e.f(t.description,((o,t,s)=>({a:e.t(o),b:t}))),b:e.o(e.unref(a)),c:e.o((e=>r.show=e)),d:e.p({position:"bottom",closable:!0,"custom-style":"height: 600rpx;border-radius:16rpx",modelValue:r.show})})}}),s=e._export_sfc(t,[["__scopeId","data-v-7bceba85"]]);wx.createComponent(s);
+"use strict";const e=require("../../../common/vendor.js"),o=require("../../../hooks/useDraw.js");if(!Array){e.resolveComponent("wd-popup")()}Math;const t=e.defineComponent({__name:"activityDescPopup",props:{show:{type:Boolean,default:!1},description:{type:Array,default:()=>[]}},emits:["update:show"],setup(t,{emit:s}){const r=t,p=s,{handleClose:a}=o.useDraw(r,p);return(o,s)=>({a:e.f(t.description,((o,t,s)=>({a:e.t(o),b:t}))),b:e.o(e.unref(a)),c:e.o((e=>r.show=e)),d:e.p({position:"bottom",closable:!0,"custom-style":"height: 600rpx;border-radius:16rpx",modelValue:r.show})})}}),s=e._export_sfc(t,[["__scopeId","data-v-bb8f18c4"]]);wx.createComponent(s);

+ 1 - 1
dist/build/mp-weixin/pagesOne/winner/components/activityDescPopup.wxml

@@ -1 +1 @@
-<view class="activityDescPopup data-v-7bceba85"><wd-popup wx:if="{{d}}" class="data-v-7bceba85" u-s="{{['d']}}" bindclose="{{b}}" u-i="7bceba85-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"><view class="title data-v-7bceba85">活动说明</view><view class="content data-v-7bceba85"><view wx:for="{{a}}" wx:for-item="item" wx:key="b" class="data-v-7bceba85">{{item.a}}</view></view></wd-popup></view>
+<view class="activityDescPopup data-v-bb8f18c4"><wd-popup wx:if="{{d}}" class="data-v-bb8f18c4" u-s="{{['d']}}" bindclose="{{b}}" u-i="bb8f18c4-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"><view class="title data-v-bb8f18c4">活动说明</view><view class="content data-v-bb8f18c4"><view wx:for="{{a}}" wx:for-item="item" wx:key="b" class="data-v-bb8f18c4">{{item.a}}</view></view></wd-popup></view>

+ 1 - 1
dist/build/mp-weixin/pagesOne/winner/components/activityDescPopup.wxss

@@ -1 +1 @@
-.activityDescPopup .title.data-v-7bceba85{font-size:32rpx;color:#333;font-weight:700;text-align:center;margin-top:32rpx}.activityDescPopup .content.data-v-7bceba85{font-size:24rpx;color:#666;width:90%;margin:50rpx auto;line-height:34rpx}
+.activityDescPopup .title.data-v-bb8f18c4{font-size:32rpx;color:#333;font-weight:700;text-align:center;margin-top:32rpx}.activityDescPopup .content.data-v-bb8f18c4{font-size:24rpx;color:#666;width:90%;margin:50rpx auto;line-height:34rpx}

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

@@ -4,6 +4,7 @@ const common_vendor = require("./common/vendor.js");
 if (!Math) {
   "./pages/index/index.js";
   "./pages/my/index.js";
+  "./pages/my/location.js";
   "./pagesOne/winner/index.js";
   "./pagesOne/winner/uploadImage.js";
   "./pagesOne/record/winnerList.js";

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

@@ -1,7 +1,8 @@
 {
   "pages": [
     "pages/index/index",
-    "pages/my/index"
+    "pages/my/index",
+    "pages/my/location"
   ],
   "subPackages": [
     {

+ 0 - 8
dist/dev/mp-weixin/pages/my/components/nearlyStoreBox.js

@@ -1,8 +0,0 @@
-"use strict";
-const common_vendor = require("../../../common/vendor.js");
-const _sfc_main = {};
-function _sfc_render(_ctx, _cache) {
-  return {};
-}
-const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a58df8f5"]]);
-wx.createComponent(Component);

+ 32 - 5
dist/dev/mp-weixin/pages/my/index.js

@@ -8,10 +8,9 @@ if (!Array) {
 }
 const _easycom_wd_cell = () => "../../node-modules/wot-design-uni/components/wd-cell/wd-cell.js";
 if (!Math) {
-  (NearlyStoreBox + _easycom_wd_cell + UserLoginPopup)();
+  (_easycom_wd_cell + UserLoginPopup)();
 }
 const UserLoginPopup = () => "../../components/userLoginPopup.js";
-const NearlyStoreBox = () => "./components/nearlyStoreBox.js";
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
@@ -33,6 +32,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         num: 0
       }
     ];
+    const list2 = [
+      {
+        title: "连先生便利店",
+        label: "距离您88m",
+        content: "麓枫和苑6栋一单元",
+        src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address1.png"
+      },
+      {
+        title: "转角手作町",
+        label: "距离您126m",
+        content: "后湖创业园内",
+        src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address2.png"
+      }
+    ];
     const navTop = common_vendor.ref(0);
     const loginRef = common_vendor.ref(null);
     const path = common_vendor.ref("");
@@ -67,6 +80,11 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const getPhone = (res) => {
       mobile.value = res;
     };
+    const toLink = (data) => {
+      common_vendor.index.navigateTo({
+        url: `/pages/my/location?title=${data.title}&label=${data.label}&content=${data.content}&src=${data.src}`
+      });
+    };
     common_vendor.onLoad(() => {
       navTop.value = utils_system.getNavTop();
     });
@@ -105,11 +123,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           ["is-link"]: true,
           title: "上传记录"
         }),
-        p: common_vendor.sr(loginRef, "276ac604-3", {
+        p: common_vendor.f(list2, (item, index, i0) => {
+          return {
+            a: common_vendor.t(item.title),
+            b: common_vendor.t(item.label),
+            c: common_vendor.t(item.content),
+            d: common_vendor.o(($event) => toLink(item), index),
+            e: index
+          };
+        }),
+        q: common_vendor.sr(loginRef, "276ac604-2", {
           "k": "loginRef"
         }),
-        q: common_vendor.o(getPhone),
-        r: common_vendor.p({
+        r: common_vendor.o(getPhone),
+        s: common_vendor.p({
           path: path.value
         })
       });

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

@@ -2,7 +2,6 @@
   "navigationStyle": "custom",
   "usingComponents": {
     "wd-cell": "../../node-modules/wot-design-uni/components/wd-cell/wd-cell",
-    "user-login-popup": "../../components/userLoginPopup",
-    "nearly-store-box": "./components/nearlyStoreBox"
+    "user-login-popup": "../../components/userLoginPopup"
   }
 }

Разлика између датотеке није приказан због своје велике величине
+ 0 - 1
dist/dev/mp-weixin/pages/my/index.wxml


+ 50 - 7
dist/dev/mp-weixin/pages/my/index.wxss

@@ -26,7 +26,7 @@
 .myContent.data-v-276ac604 {
   font-family: PingFang SC;
   width: 100%;
-  height: 100vh;
+  min-height: 100vh;
   background: url("https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/myBg.png") no-repeat top center;
   background-size: 100% 452rpx;
   overflow: hidden;
@@ -106,6 +106,12 @@
   width: 92rpx;
   height: 92rpx;
 }
+.myContent .title.data-v-276ac604 {
+  color: #000;
+  font-weight: bold;
+  font-size: 28rpx;
+  padding: 24rpx 0 22rpx 24rpx;
+}
 .myContent .toolBox.data-v-276ac604 {
   margin: 26rpx 32rpx 0;
   background: #fff;
@@ -113,12 +119,6 @@
   background: #fff;
   position: relative;
 }
-.myContent .toolBox .title.data-v-276ac604 {
-  color: #000;
-  font-weight: bold;
-  font-size: 28rpx;
-  padding: 24rpx 0 22rpx 24rpx;
-}
 .myContent .toolBox image.data-v-276ac604 {
   height: 48rpx;
   width: 48rpx;
@@ -139,4 +139,47 @@
 .myContent .toolBox.data-v-276ac604 .wd-cell__title {
   color: #666;
   font-size: 28rpx;
+}
+.myContent .addressBox.data-v-276ac604 {
+  margin: 26rpx 32rpx 0;
+  background: #fff;
+  padding: 26rpx 32rpx;
+  border-radius: 24rpx;
+}
+.myContent .addressBox .title.data-v-276ac604 {
+  padding: 0;
+  margin-bottom: 32rpx;
+}
+.myContent .addressBox .address.data-v-276ac604 {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding-bottom: 16rpx;
+  margin-bottom: 16rpx;
+  border-bottom: 2rpx solid rgba(191, 200, 219, 0.5019607843);
+}
+.myContent .addressBox .address.data-v-276ac604:last-child {
+  border: none;
+}
+.myContent .addressBox .left.data-v-276ac604 {
+  color: #666;
+  font-weight: bold;
+  font-size: 28rpx;
+}
+.myContent .addressBox .left > text.data-v-276ac604 {
+  display: block;
+}
+.myContent .addressBox .left .a.data-v-276ac604 {
+  color: #337b52;
+}
+.myContent .addressBox .left .b.data-v-276ac604 {
+  color: #666;
+}
+.myContent .addressBox .left .c.data-v-276ac604 {
+  font-size: 24rpx;
+  font-weight: normal;
+}
+.myContent .addressBox image.data-v-276ac604 {
+  width: 84rpx;
+  height: 90rpx;
 }

+ 26 - 0
dist/dev/mp-weixin/pages/my/location.js

@@ -0,0 +1,26 @@
+"use strict";
+const common_vendor = require("../../common/vendor.js");
+const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
+  __name: "location",
+  setup(__props) {
+    const detail = common_vendor.ref({});
+    const map = common_vendor.ref("");
+    common_vendor.onLoad((options) => {
+      detail.value = options;
+      map.value = options.src;
+      common_vendor.index.setNavigationBarTitle({
+        title: options.title
+      });
+    });
+    return (_ctx, _cache) => {
+      return {
+        a: map.value,
+        b: common_vendor.t(detail.value.title),
+        c: common_vendor.t(detail.value.label),
+        d: common_vendor.t(detail.value.content)
+      };
+    };
+  }
+});
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3b646e3b"]]);
+wx.createPage(MiniProgramPage);

+ 4 - 0
dist/dev/mp-weixin/pages/my/location.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "地址",
+  "usingComponents": {}
+}

+ 1 - 0
dist/dev/mp-weixin/pages/my/location.wxml

@@ -0,0 +1 @@
+<view class="location data-v-3b646e3b"><image class="map data-v-3b646e3b" src="{{a}}" mode="scaleToFill"/><view class="address data-v-3b646e3b"><view class="left data-v-3b646e3b"><text class="a data-v-3b646e3b">{{b}}</text><text class="b data-v-3b646e3b">{{c}}</text><text class="c data-v-3b646e3b">{{d}}</text></view><image class="data-v-3b646e3b" src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/loca.png" mode="scaleToFill"/></view></view>

+ 34 - 33
dist/dev/mp-weixin/pages/my/components/nearlyStoreBox.wxss → dist/dev/mp-weixin/pages/my/location.wxss

@@ -23,48 +23,49 @@
 /* 垂直间距 */
 /* 透明度 */
 /* 文章场景相关 */
-.nearly-box.data-v-a58df8f5 {
-  margin-bottom: 32rpx;
-}
-.nearly-box .title.data-v-a58df8f5 {
-  color: #000;
-  font-weight: bold;
-  font-size: 28rpx;
-  margin-bottom: 12rpx;
-}
-.nearly-box .count.data-v-a58df8f5 {
-  padding: 20rpx;
-  border-radius: 16rpx;
-  background: #fff;
+.location.data-v-3b646e3b {
+  width: 100%;
+  height: 100vh;
 }
-.nearly-box .cont-msg.data-v-a58df8f5 {
+.location .map.data-v-3b646e3b {
+  height: 100%;
   width: 100%;
-  height: 108rpx;
-  background: url("https://xiangli-tesco.oss-cn-hangzhou.aliyuncs.com/qiuyu/static/mine/nearly-bg.png") no-repeat;
-  background-size: 100% 100%;
+}
+.address.data-v-3b646e3b {
   display: flex;
+  justify-content: space-between;
   align-items: center;
-  justify-content: flex-start;
+  margin-bottom: 16rpx;
+  border-bottom: 2rpx solid rgba(191, 200, 219, 0.5019607843);
+  position: fixed;
+  bottom: -20rpx;
+  width: 100%;
+  background: #fff;
+  padding: 32rpx;
+  height: 200rpx;
 }
-.nearly-box .cont-msg .icon-img.data-v-a58df8f5 {
-  width: 36rpx;
-  height: 36rpx;
+.address.data-v-3b646e3b:last-child {
+  border: none;
 }
-.nearly-box .cont-msg .store-name.data-v-a58df8f5 {
-  color: #0f1828;
-  font-size: 28rpx;
-  font-style: normal;
+.address .left.data-v-3b646e3b {
+  color: #666;
   font-weight: bold;
-  float: left;
+  font-size: 28rpx;
 }
-.nearly-box .cont-msg .store-num.data-v-a58df8f5 {
+.address .left > text.data-v-3b646e3b {
+  display: block;
+}
+.address .left .a.data-v-3b646e3b {
+  color: #337b52;
+}
+.address .left .b.data-v-3b646e3b {
   color: #666;
+}
+.address .left .c.data-v-3b646e3b {
   font-size: 24rpx;
-  font-weight: 400;
-  margin-top: 10rpx;
+  font-weight: normal;
 }
-.nearly-box .cont-msg .daohang.data-v-a58df8f5 {
-  font-size: 28rpx;
-  color: #1a65ff;
-  padding-right: 24rpx;
+.address image.data-v-3b646e3b {
+  width: 84rpx;
+  height: 90rpx;
 }

+ 4 - 2
dist/dev/mp-weixin/pagesOne/winner/components/uploadReceptPopop.js

@@ -33,11 +33,13 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const emit = __emit;
     common_vendor.ref("1");
     const toUploadImage = (type) => {
-      if (!discountId.value)
-        return common_vendor.index.showToast({
+      if (!discountId.value) {
+        common_vendor.index.showToast({
           title: "请先选择优惠力度",
           icon: "error"
         });
+        return;
+      }
       const params = {
         openid,
         marketingActivityId: props.id,

+ 46 - 1
dist/dev/mp-weixin/pagesOne/winner/index.js

@@ -78,7 +78,52 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       common_vendor.index.navigateBack({ delta: 1 });
     };
     const handledUpload = () => {
-      showUpload.value = true;
+      const location = JSON.parse(common_vendor.index.getStorageSync("location"));
+      if (!aData.authCheck.includes("2") || location.latitude) {
+        showUpload.value = true;
+        return;
+      }
+      common_vendor.index.getSetting({
+        success: (res) => {
+          if (!res.authSetting["scope.address"]) {
+            common_vendor.index.authorize({
+              scope: "scope.address",
+              success() {
+                console.log("1111111111111111111");
+              },
+              fail() {
+                common_vendor.index.showModal({
+                  title: "提示",
+                  content: "您拒绝了地址授权,请手动开启",
+                  success: () => {
+                    common_vendor.index.openSetting();
+                  }
+                });
+              }
+            });
+          } else {
+            common_vendor.index.getLocation({
+              type: "wgs84",
+              success: function(res2) {
+                console.log("---------------------------", res2);
+                console.log("当前位置的经度:" + res2.longitude);
+                console.log("当前位置的纬度:" + res2.latitude);
+                common_vendor.index.setStorageSync("location", JSON.stringify(res2));
+                setTimeout(() => {
+                  showUpload.value = true;
+                }, 500);
+              },
+              fail(error) {
+                common_vendor.index.showToast({
+                  title: "请勿频繁调用!",
+                  icon: "none"
+                });
+                console.log("失败", error);
+              }
+            });
+          }
+        }
+      });
     };
     common_vendor.onShow(() => {
       getList();

+ 25 - 3
dist/dev/mp-weixin/pagesOne/winner/uploadImage.js

@@ -47,20 +47,42 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       imgList.value = imgList.value.filter((item) => item !== data.url);
     };
     const onAdd = () => {
+      const location = JSON.parse(common_vendor.index.getStorageSync("location"));
       if (imgList.value.length === 0)
         return common_vendor.index.showToast({ title: "请上传图片", icon: "none" });
       const params = {
         openid,
         mobile: phone,
-        latitude: "",
-        longitude: "",
+        latitude: location.latitude || "",
+        longitude: location.longitude || "",
         discountId: routerInfo.discountId,
         discountLevel: routerInfo.discountLevel,
         receiptImages: imgList.value.join(","),
         marketingActivityId: aData.id
       };
       services_ams.addCustomer(params).then((res) => {
-        common_vendor.index.navigateBack();
+        if (res.code === 200) {
+          common_vendor.wx$1.requestSubscribeMessage({
+            tmplIds: ["ZZhiUAFnGXkIIIId6W9mBbf16DGC-OtX1sT_d5TWNUU"],
+            success(response) {
+              services_ams.subscribeToMessage(openid).then((res2) => {
+                if (res2.code === 200) {
+                  common_vendor.index.showToast({ title: "订阅成功", icon: "success" });
+                  common_vendor.index.navigateBack();
+                } else {
+                  common_vendor.index.showToast({ title: "订阅失败", icon: "error" });
+                  common_vendor.index.navigateBack();
+                }
+              });
+            },
+            fail(err) {
+              common_vendor.index.showToast({ title: "订阅失败", icon: "error" });
+              common_vendor.index.navigateBack();
+            }
+          });
+        } else {
+          common_vendor.index.showToast({ title: "上传图片失败", icon: "error" });
+        }
       });
     };
     common_vendor.onLoad((options) => {

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

@@ -5,11 +5,18 @@
     "miniprogram": {
       "list": [
         {
+          "name": "pages/my/location",
+          "pathName": "pages/my/location",
+          "query": "title=%E8%BF%9E%E5%85%88%E7%94%9F%E4%BE%BF%E5%88%A9%E5%BA%97&label=%E8%B7%9D%E7%A6%BB%E6%82%A888m&content=%E9%BA%93%E6%9E%AB%E5%92%8C%E8%8B%916%E6%A0%8B%E4%B8%80%E5%8D%95%E5%85%83",
+          "scene": null,
+          "launchMode": "default"
+        },
+        {
           "name": "pagesOne/record/winnerList",
           "pathName": "pagesOne/record/winnerList",
           "query": "",
-          "scene": null,
-          "launchMode": "default"
+          "launchMode": "default",
+          "scene": null
         },
         {
           "name": "pagesOne/record/uploadDetail",

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

@@ -68,6 +68,12 @@ const payment = (data) => {
     data
   });
 };
+const subscribeToMessage = (data) => {
+  return utils_http.http({
+    method: "GET",
+    url: `/customer/subscribeToMessage/${data}`
+  });
+};
 exports.addCustomer = addCustomer;
 exports.auditSuccessList = auditSuccessList;
 exports.getActivity = getActivity;
@@ -77,4 +83,5 @@ exports.getPhoneNumberInfo = getPhoneNumberInfo;
 exports.payment = payment;
 exports.rewardDetail = rewardDetail;
 exports.rewardList = rewardList;
+exports.subscribeToMessage = subscribeToMessage;
 exports.validate = validate;

+ 6 - 0
src/pages.json

@@ -19,6 +19,12 @@
       "style": {
         "navigationStyle": "custom"
       }
+    },
+    {
+      "path": "pages/my/location",
+      "style": {
+        "navigationBarTitleText": "地址"
+      }
     }
   ],
   "subPackages": [

+ 1 - 1
src/pages/my/components/nearlyStoreBox.vue

@@ -31,7 +31,7 @@
   }
   .cont-msg {
     width: 100%;
-    height: 108rpx;
+    height: 208rpx;
     background: url("https://xiangli-tesco.oss-cn-hangzhou.aliyuncs.com/qiuyu/static/mine/nearly-bg.png")
       no-repeat;
     background-size: 100% 100%;

+ 96 - 15
src/pages/my/index.vue

@@ -24,9 +24,9 @@
       </view>
     </view>
     <view class="content">
-      <view style="margin: 26rpx 32rpx 0">
+      <!-- <view style="margin: 26rpx 32rpx 0">
         <nearly-store-box></nearly-store-box>
-      </view>
+      </view> -->
       <view class="toolBox">
         <view class="title"> 常用工具 </view>
 
@@ -49,6 +49,24 @@
           </wd-cell>
         </view>
       </view>
+
+      <view class="addressBox">
+        <view class="title"> 附近门店 </view>
+        <view>
+          <view v-for="(item, index) in list2" :key="index" class="address">
+            <view class="left">
+              <text class="a">{{ item.title }}</text>
+              <text class="b">{{ item.label }}</text>
+              <text class="c">{{ item.content }}</text>
+            </view>
+            <image
+              @click="toLink(item)"
+              src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/loca.png"
+              mode="scaleToFill"
+            />
+          </view>
+        </view>
+      </view>
     </view>
 
     <user-login-popup
@@ -91,6 +109,21 @@ const list = [
   },
 ];
 
+const list2 = [
+  {
+    title: "连先生便利店",
+    label: "距离您88m",
+    content: "麓枫和苑6栋一单元",
+    src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address1.png",
+  },
+  {
+    title: "转角手作町",
+    label: "距离您126m",
+    content: "后湖创业园内",
+    src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address2.png",
+  },
+];
+
 const navTop = ref<number>(0);
 const loginRef = <any>ref(null);
 const path = ref<string>("");
@@ -125,16 +158,19 @@ const onLogin = async (e: any) => {
   if (!isGetPhone()) {
     loginRef.value.show = true;
   }
-  // setTimeout(() => {
-  //   mobile.value = uni.getStorageSync("phone");
-  //   console.log("--------------------", mobile.value);
-  // }, 2000);
-  // const data = await getMobile(e.detail.code, "");
-  // console.log(data);
 };
 const getPhone = (res: string) => {
   mobile.value = res;
 };
+
+const toLink = (data: any) => {
+  uni.navigateTo({
+    url:
+      "/pages/my/location" +
+      `?title=${data.title}&label=${data.label}&content=${data.content}&src=${data.src}`,
+  });
+};
+
 onLoad(() => {
   navTop.value = getNavTop();
 });
@@ -161,7 +197,7 @@ onShow(() => {
 .myContent {
   font-family: PingFang SC;
   width: 100%;
-  height: 100vh;
+  min-height: 100vh;
   background: url("https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/myBg.png")
     no-repeat top center;
   background-size: 100% 452rpx;
@@ -263,18 +299,19 @@ onShow(() => {
       }
     }
   }
+  .title {
+    color: #000;
+    font-weight: bold;
+    font-size: 28rpx;
+    padding: 24rpx 0 22rpx 24rpx;
+  }
   .toolBox {
     margin: 26rpx 32rpx 0;
     background: #fff;
     border-radius: 16rpx;
     background: #fff;
     position: relative;
-    .title {
-      color: #000;
-      font-weight: bold;
-      font-size: 28rpx;
-      padding: 24rpx 0 22rpx 24rpx;
-    }
+
     image {
       height: 48rpx;
       width: 48rpx;
@@ -301,5 +338,49 @@ onShow(() => {
       // margin-top: 5rpx;
     }
   }
+  .addressBox {
+    margin: 26rpx 32rpx 0;
+    background: #fff;
+    padding: 26rpx 32rpx;
+    border-radius: 24rpx;
+
+    .title {
+      padding: 0;
+      margin-bottom: 32rpx;
+    }
+    .address {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding-bottom: 16rpx;
+      margin-bottom: 16rpx;
+      border-bottom: 2rpx solid #bfc8db80;
+      &:last-child {
+        border: none;
+      }
+    }
+    .left {
+      color: #666;
+      font-weight: bold;
+      font-size: 28rpx;
+      > text {
+        display: block;
+      }
+      .a {
+        color: #337b52;
+      }
+      .b {
+        color: #666;
+      }
+      .c {
+        font-size: 24rpx;
+        font-weight: normal;
+      }
+    }
+    image {
+      width: 84rpx;
+      height: 90rpx;
+    }
+  }
 }
 </style>

+ 87 - 0
src/pages/my/location.vue

@@ -0,0 +1,87 @@
+<template>
+  <view class="location">
+    <image class="map" :src="map" mode="scaleToFill" />
+    <view class="address">
+      <view class="left">
+        <text class="a">{{ detail.title }}</text>
+        <text class="b">{{ detail.label }}</text>
+        <text class="c">{{ detail.content }}</text>
+      </view>
+      <image
+        src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/loca.png"
+        mode="scaleToFill"
+      />
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref } from "vue";
+import { onLoad } from "@dcloudio/uni-app";
+const detail = ref({} as any);
+const map = ref("");
+// const props = defineProps({
+//   item: {
+//     type: Object,
+//     default: () => {},
+//   },
+// });
+
+onLoad((options: any) => {
+  detail.value = options;
+  map.value = options.src;
+  uni.setNavigationBarTitle({
+    title: options.title,
+  });
+});
+</script>
+
+<style lang="scss" scoped>
+.location {
+  width: 100%;
+  height: 100vh;
+  .map {
+    height: 100%;
+    width: 100%;
+  }
+}
+
+.address {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 16rpx;
+  border-bottom: 2rpx solid #bfc8db80;
+  position: fixed;
+  bottom: -20rpx;
+  width: 100%;
+  background: #fff;
+  padding: 32rpx;
+  height: 200rpx;
+  &:last-child {
+    border: none;
+  }
+  .left {
+    color: #666;
+    font-weight: bold;
+    font-size: 28rpx;
+    > text {
+      display: block;
+    }
+    .a {
+      color: #337b52;
+    }
+    .b {
+      color: #666;
+    }
+    .c {
+      font-size: 24rpx;
+      font-weight: normal;
+    }
+  }
+  image {
+    width: 84rpx;
+    height: 90rpx;
+  }
+}
+</style>

+ 4 - 2
src/pagesOne/winner/components/uploadReceptPopop.vue

@@ -69,11 +69,13 @@ const emit = defineEmits(["update:show"]);
 const value = ref("1");
 
 const toUploadImage = (type: string) => {
-  if (!discountId.value)
-    return uni.showToast({
+  if (!discountId.value) {
+    uni.showToast({
       title: "请先选择优惠力度",
       icon: "error",
     });
+    return;
+  }
   const params = {
     openid,
     marketingActivityId: props.id,

+ 53 - 45
src/pagesOne/winner/index.vue

@@ -177,54 +177,62 @@ const onBack = () => {
 };
 
 const handledUpload = () => {
-  // uni.getSetting({
-  //   success: (res) => {
-  //     if (!res.authSetting["scope.address"]) {
-  //       uni.authorize({
-  //         scope: "scope.address",
-  //         success() {
-  //           console.log("1111111111111111111");
+  const location = JSON.parse(uni.getStorageSync("location"));
+  if (!aData.authCheck.includes("2") || location.latitude) {
+    showUpload.value = true;
 
-  //           // 用户同意授权
-  //         },
-  //         fail() {
-  //           // 用户拒绝授权
-  //           uni.showModal({
-  //             title: "提示",
-  //             content: "您拒绝了地址授权,请手动开启",
-  //             success: () => {
-  //               uni.openSetting();
-  //             },
-  //           });
-  //         },
-  //       });
-  //     } else {
-  //       uni.getLocation({
-  //         type: "wgs84",
-  //         success: function (res) {
-  //           console.log("当前位置的经度:" + res.longitude);
-  //           console.log("当前位置的纬度:" + res.latitude);
-  //           uni.showToast({
-  //             title: "当前位置的经纬度:" + res.longitude + "," + res.latitude,
-  //             icon: "success",
-  //             mask: true,
-  //           });
-  //         },
-  //         fail(error) {
-  //           uni.showToast({
-  //             title: "请勿频繁调用!",
-  //             icon: "none",
-  //           });
-  //           console.log("失败", error);
-  //         },
-  //       });
+    return;
+  }
+  uni.getSetting({
+    success: (res) => {
+      if (!res.authSetting["scope.address"]) {
+        uni.authorize({
+          scope: "scope.address",
+          success() {
+            console.log("1111111111111111111");
 
-  //       console.log("222222222222222222");
-  //     }
-  //   },
-  // });
+            // 用户同意授权
+          },
+          fail() {
+            // 用户拒绝授权
+            uni.showModal({
+              title: "提示",
+              content: "您拒绝了地址授权,请手动开启",
+              success: () => {
+                uni.openSetting();
+              },
+            });
+          },
+        });
+      } else {
+        uni.getLocation({
+          type: "wgs84",
+          success: function (res) {
+            console.log("---------------------------", res);
 
-  showUpload.value = true;
+            console.log("当前位置的经度:" + res.longitude);
+            console.log("当前位置的纬度:" + res.latitude);
+            uni.setStorageSync("location", JSON.stringify(res));
+            // uni.showToast({
+            //   title: "当前位置的经纬度:" + res.longitude + "," + res.latitude,
+            //   icon: "success",
+            //   mask: true,
+            // });
+            setTimeout(() => {
+              showUpload.value = true;
+            }, 500);
+          },
+          fail(error) {
+            uni.showToast({
+              title: "请勿频繁调用!",
+              icon: "none",
+            });
+            console.log("失败", error);
+          },
+        });
+      }
+    },
+  });
 };
 
 onShow(() => {

+ 28 - 5
src/pagesOne/winner/uploadImage.vue

@@ -21,7 +21,7 @@
 <script lang="ts" setup>
 import { onLoad } from "@dcloudio/uni-app";
 import { reactive, ref } from "vue";
-import { addCustomer } from "@/services/ams";
+import { addCustomer, subscribeToMessage } from "@/services/ams";
 const fileList = ref<any[]>([]);
 const imgList = ref<string[]>([]);
 const aData = JSON.parse(uni.getStorageSync("activityData"));
@@ -64,20 +64,43 @@ const handleRemove = (file: any) => {
 };
 
 const onAdd = () => {
+  const location = JSON.parse(uni.getStorageSync("location"));
   if (imgList.value.length === 0)
     return uni.showToast({ title: "请上传图片", icon: "none" });
   const params = {
     openid,
     mobile: phone,
-    latitude: "",
-    longitude: "",
+    latitude: location.latitude || "",
+    longitude: location.longitude || "",
     discountId: routerInfo.discountId,
     discountLevel: routerInfo.discountLevel,
     receiptImages: imgList.value.join(","),
     marketingActivityId: aData.id,
   };
-  addCustomer(params).then((res) => {
-    uni.navigateBack();
+  addCustomer(params).then((res: any) => {
+    if (res.code === 200) {
+      wx.requestSubscribeMessage({
+        tmplIds: ["ZZhiUAFnGXkIIIId6W9mBbf16DGC-OtX1sT_d5TWNUU"],
+        success(response: any) {
+          // uni.showToast({ title: "订阅成功", icon: "success" });
+          subscribeToMessage(openid).then((res: any) => {
+            if (res.code === 200) {
+              uni.showToast({ title: "订阅成功", icon: "success" });
+              uni.navigateBack();
+            } else {
+              uni.showToast({ title: "订阅失败", icon: "error" });
+              uni.navigateBack();
+            }
+          });
+        },
+        fail(err) {
+          uni.showToast({ title: "订阅失败", icon: "error" });
+          uni.navigateBack();
+        },
+      });
+    } else {
+      uni.showToast({ title: "上传图片失败", icon: "error" });
+    }
   });
 };
 

+ 8 - 0
src/services/ams.ts

@@ -100,3 +100,11 @@ export const payment = (data: any) => {
     data,
   });
 };
+
+//订阅
+export const subscribeToMessage = (data: any) => {
+  return http({
+    method: "GET",
+    url: `/customer/subscribeToMessage/${data}`,
+  });
+};

+ 0 - 1
vite.config.ts

@@ -1,7 +1,6 @@
 import { defineConfig } from "vite";
 import uni from "@dcloudio/vite-plugin-uni";
 import { resolve } from "path";
-console.log("222222222222222222", process.env.VITE_API_URL);
 // https://vitejs.dev/config/
 export default defineConfig({
   plugins: [uni()],

Неке датотеке нису приказане због велике количине промена