wangfei hace 6 años
padre
commit
b415a358af

+ 4
- 4
src/pages/user/bindMobile/bindMobile.vue Ver fichero

@@ -98,7 +98,8 @@ export default {
98 98
   },
99 99
   computed: {
100 100
     ...mapState({
101
-      caseInfo: x => x.userCenter.caseInfo
101
+      caseInfo: x => x.userCenter.caseInfo,
102
+      org: x => x.app.orgId,
102 103
     })
103 104
   },
104 105
   created () {
@@ -213,14 +214,13 @@ export default {
213 214
                   window.location.href = `${window.location.origin}/game/luckdraw/${from}`
214 215
                 }, 2000)
215 216
               } else {
216
-                this.getUserInfo().then(() => {
217
+                this.getUserInfo({ org: this.org }).then(() => {
217 218
                   setTimeout(() => {
218 219
                     window.history.go(-1)
219 220
                   }, 2000)
220 221
                 })
221 222
               }
222 223
             }).catch(() => {
223
-              console.log(111)
224 224
               this.canSubmit = true
225 225
             })
226 226
           } else {
@@ -237,7 +237,7 @@ export default {
237 237
               window.location.href = `${window.location.origin}/game/luckdraw/${from}`
238 238
             }, 2000)
239 239
           } else {
240
-            this.getUserInfo().then(() => {
240
+            this.getUserInfo({ org: this.org }).then(() => {
241 241
               setTimeout(() => {
242 242
                 window.history.go(-1)
243 243
               }, 2000)

+ 15
- 4
src/pages/user/mainPage/libraryIndex/index.vue Ver fichero

@@ -5,11 +5,11 @@
5 5
         <div class="header flex-h">
6 6
           <div class="flex-item flex-h">
7 7
             <i class="iconfont icon-sousuo"></i>
8
-            <router-link
8
+            <a
9 9
               class="flex-item"
10 10
               style="line-height: .3rem;color: #ccc;"
11
-              :to="{name: 'booksSearch', query: {caseid: currentCaseId}}"
12
-            >书本名称</router-link>
11
+              @click="tosearch"
12
+            >书本名称</a>
13 13
           </div>
14 14
           <a @click="showDialog = true">
15 15
             <i class="iconfont icon-dingwei"></i>
@@ -79,6 +79,7 @@ import toolClass from '../../../../util/util'
79 79
 import { mapState, createNamespacedHelpers } from 'vuex'
80 80
 const { mapActions: mapAppActions } = createNamespacedHelpers('app')
81 81
 const { mapState: mapBookState, mapActions: mapBookActions } = createNamespacedHelpers('book')
82
+import { Toast } from '../../../../../node_modules/vant';
82 83
 import wxsdk from '../../../../util/share'
83 84
 const wx = require('weixin-js-sdk')
84 85
 export default {
@@ -151,6 +152,17 @@ export default {
151 152
       'updateRecommendBookLeftNum',
152 153
       'setBookCase',
153 154
     ]),
155
+    tosearch () {
156
+      if (this.currentCaseId === '') {
157
+        Toast.fail({
158
+          duration: 2000, // 持续展示 toast
159
+          forbidClick: true, // 禁用背景点击
160
+          message: '请先选择案场'
161
+        })
162
+        return 
163
+      }
164
+      this.$router.push({name: 'booksSearch', query: {caseid: this.currentCaseId}})
165
+    },
154 166
     Location () {
155 167
       let that = this
156 168
       wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
@@ -160,7 +172,6 @@ export default {
160 172
         thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
161 173
       }).then(() => {
162 174
       })
163
-      console.log(this.bookcaseid)
164 175
       if(this.bookcaseid === '') {
165 176
         wx.getLocation({
166 177
           type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'