Browse Source

bug修改

wangfei 6 years ago
parent
commit
b415a358af

+ 4
- 4
src/pages/user/bindMobile/bindMobile.vue View File

98
   },
98
   },
99
   computed: {
99
   computed: {
100
     ...mapState({
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
   created () {
105
   created () {
213
                   window.location.href = `${window.location.origin}/game/luckdraw/${from}`
214
                   window.location.href = `${window.location.origin}/game/luckdraw/${from}`
214
                 }, 2000)
215
                 }, 2000)
215
               } else {
216
               } else {
216
-                this.getUserInfo().then(() => {
217
+                this.getUserInfo({ org: this.org }).then(() => {
217
                   setTimeout(() => {
218
                   setTimeout(() => {
218
                     window.history.go(-1)
219
                     window.history.go(-1)
219
                   }, 2000)
220
                   }, 2000)
220
                 })
221
                 })
221
               }
222
               }
222
             }).catch(() => {
223
             }).catch(() => {
223
-              console.log(111)
224
               this.canSubmit = true
224
               this.canSubmit = true
225
             })
225
             })
226
           } else {
226
           } else {
237
               window.location.href = `${window.location.origin}/game/luckdraw/${from}`
237
               window.location.href = `${window.location.origin}/game/luckdraw/${from}`
238
             }, 2000)
238
             }, 2000)
239
           } else {
239
           } else {
240
-            this.getUserInfo().then(() => {
240
+            this.getUserInfo({ org: this.org }).then(() => {
241
               setTimeout(() => {
241
               setTimeout(() => {
242
                 window.history.go(-1)
242
                 window.history.go(-1)
243
               }, 2000)
243
               }, 2000)

+ 15
- 4
src/pages/user/mainPage/libraryIndex/index.vue View File

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