shenxin 4 年 前
コミット
ef06918b9b

+ 1 - 0
src/pages/classification.vue

@@ -128,6 +128,7 @@ export default {
           type: 'gcj02',
           success: (res) => {
             this.isLocation = true
+            this.$store.commit('changeLocation', { lat: res.latitude, lng: res.longitude })
             resolve(res)
           },
           fail: () => {

+ 1 - 0
src/pages/index.vue

@@ -196,6 +196,7 @@ export default {
           type: 'gcj02',
           success: (res) => {
             this.isLocation = true
+            this.$store.commit('changeLocation', { lat: res.latitude, lng: res.longitude })
             resolve(res)
           },
           fail: () => {

+ 25 - 4
src/pagesSub/activity/activityDetail.vue

@@ -161,6 +161,7 @@
     <view class="fixed-copy">
       <view class="btn-copy u-font-22"
             :style="{marginBottom: `${footerHeight}rpx`}"
+            v-show="detail.search_key"
             @click.stop="copyShopName">复制店名</view>
     </view>
   </view>
@@ -196,7 +197,8 @@ export default {
         shop_address: '',
         join_status: '',
         start_time: '',
-        end_time: ''
+        end_time: '',
+        search_key: ''
       }
     }
   },
@@ -311,6 +313,7 @@ export default {
         uni.getLocation({
           type: 'gcj02',
           success: (res) => {
+            this.$store.commit('changeLocation', { lat: res.latitude, lng: res.longitude })
             resolve(res)
           },
           fail: () => {
@@ -344,6 +347,12 @@ export default {
       }
       if (type === 1) {
         params.id = this.detail.id
+        if (this.$store.state.lat) {
+          params.lat = this.$store.state.lat
+        }
+        if (this.$store.state.lng) {
+          params.lng = this.$store.state.lng
+        }
       } else {
         params.record_id = this.detail.user_activity_id
       }
@@ -383,7 +392,19 @@ export default {
       //     this.joinActivity(1)
       //   }
       // })
-      this.joinActivity(1)
+      if (this.detail.tips) {
+        uni.showModal({
+          title: '提示',
+          content: this.detail.tips,
+          success: (res) => {
+            if (res.confirm) {
+              this.joinActivity(1)
+            }
+          }
+        })
+      } else {
+        this.joinActivity(1)
+      }
     },
     // 取消报名
     cancelJoin () {
@@ -419,11 +440,11 @@ export default {
     },
     copyShopName () {
       uni.setClipboardData({
-        data: this.detail.shop_name,
+        data: this.detail.search_key,
         success: () => {
           uni.showToast({
             icon: 'none',
-            title: '平台门店复制成功'
+            title: '搜索关键字复制成功'
           })
         }
       })

+ 20 - 11
src/pagesSub/order/rule.vue

@@ -1,3 +1,11 @@
+<!--
+ * @Author: your name
+ * @Date: 2021-01-27 12:27:59
+ * @LastEditTime: 2021-03-12 12:06:42
+ * @LastEditors: your name
+ * @Description: In User Settings Edit
+ * @FilePath: \rebatedine-mini\src\pagesSub\order\rule.vue
+-->
 <template>
   <view class="rule-main">
     <network-error />
@@ -26,6 +34,7 @@ export default {
         uni.getLocation({
           type: 'gcj02',
           success: (res) => {
+            this.$store.commit('changeLocation', { lat: res.latitude, lng: res.longitude })
             resolve(res)
           },
           fail: () => {
@@ -53,16 +62,16 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-  .rule-main {
-    box-sizing: border-box;
-    padding: 48px 32px 0;
-    height: 100vh;
-    background-color: #fff;
-    .color-212121 {
-      color: #212121;
-    }
-    .color-333 {
-      color: #333;
-    }
+.rule-main {
+  box-sizing: border-box;
+  padding: 48px 32px 0;
+  height: 100vh;
+  background-color: #fff;
+  .color-212121 {
+    color: #212121;
   }
+  .color-333 {
+    color: #333;
+  }
+}
 </style>

+ 1 - 1
src/pagesSub/order/submitOrder.vue

@@ -114,7 +114,7 @@
       <view class="item u-border-bottom">
         <view class="label u-flex">
           <view class="icon-bt"></view>
-          <view>门店搜索结果页截图<span class="u-content-color u-font-30 line-42">(截图需包含当前门店)</span>
+          <view>浏览轨迹<span class="u-content-color u-font-30 line-42">(搜索活动门店关键词找到该门店的截图)</span>
           </view>
         </view>
         <view class="u-flex u-flex-wrap u-p-t-40">

+ 1 - 0
src/pagesSub/order/submitOutcome.vue

@@ -47,6 +47,7 @@ export default {
         uni.getLocation({
           type: 'gcj02',
           success: (res) => {
+            this.$store.commit('changeLocation', { lat: res.latitude, lng: res.longitude })
             resolve(res)
           },
           fail: () => {

+ 11 - 1
src/store/index.js

@@ -11,12 +11,22 @@ const store = new Vuex.Store({
     ossImgResize: {},
     openid: uni.getStorageSync(storageKeys.OPENIDID) || '', // 微信code换取openid
     userInfo: uni.getStorageSync(storageKeys.USER_INFO) || {}, // 用户信息
-    cateId: ''
+    cateId: '',
+    lat: uni.getStorageSync(storageKeys.LAT) || '',
+    lng: uni.getStorageSync(storageKeys.LNG) || ''
   },
   mutations: {
     changeOssImgResize (state, data) {
       state.ossImgResize = data
     },
+    changeLocation (state, data) {
+      if (data) {
+        state.lat = data.lat
+        state.lng = data.lng
+        uni.setStorageSync(storageKeys.LAT, data.lat)
+        uni.setStorageSync(storageKeys.LNG, data.lng)
+      }
+    },
     changeOpenId (state, data) {
       if (!data) data = ''
       state.openid = data

+ 12 - 0
src/store/storageKeys.js

@@ -1,5 +1,17 @@
+/*
+ * @Author: your name
+ * @Date: 2021-01-25 11:32:04
+ * @LastEditTime: 2021-03-12 11:54:23
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \rebatedine-mini\src\store\storageKeys.js
+ */
 export const OPENIDID = 'OPENIDID' // openid
 
 export const USER_TOKEN = 'USER_TOKEN'
 
 export const USER_INFO = 'USER_INFO'
+
+export const LAT = 'LAT'
+
+export const LNG = 'LNG'