wangfei 6 lat temu
rodzic
commit
d358dc1b75

+ 3
- 3
src/components/libraryListItem/index.vue Wyświetl plik

@@ -2,7 +2,7 @@
2 2
   <div class="libraryListItem flex-h" @click="itemClick(data)">
3 3
     <div class="img">
4 4
       <a>
5
-        <img :src="data.BookImg || defaultimg" class="centerLabel cover" alt>
5
+        <img :src="(data.BookImg || defaultimg) + '?x-oss-process=style/compress-rotate'" class="centerLabel cover" alt>
6 6
       </a>
7 7
       <span v-if="type === 1" :class="data.BorrowStatus=='0'?'active':''">{{myBookStatus}}</span>
8 8
     </div>
@@ -11,7 +11,7 @@
11 11
         <span>{{data.BookName}}</span>
12 12
         <h5 v-if="!type">{{data.BookDescription}}</h5>
13 13
         <div v-if="!type" class="flex-h" style="margin-top: .06rem;">
14
-          <span class="flex-item">{{data.Author}} </span>
14
+          <span class="flex-item">{{data.Author == '' ? '': data.Author + '著'}} </span>
15 15
           <span class="status" :class="{'active' : status != 1 && status != 0 && status != 4}" @click="appointmentBook(data.BookId)">{{bookStatus}}</span>
16 16
         </div>
17 17
         <div v-if="!type" class="flex-h">
@@ -61,7 +61,7 @@ export default {
61 61
   props: ['data', 'type', 'status'],
62 62
   data () {
63 63
     return {
64
-      defaultimg: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/voting/yttj_banner.png',
64
+      defaultimg: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/book_default.png',
65 65
     }
66 66
   },
67 67
   computed: {

+ 4
- 1
src/pages/user/library/booksSearch/index.vue Wyświetl plik

@@ -6,7 +6,7 @@
6 6
           <i class="iconfont icon-sousuo"></i>
7 7
           <div class="flex-item">
8 8
             <div>
9
-              <input type="text" v-model="searchKey" placeholder="请输入图书名">
9
+              <input type="text" v-model="searchKey" autofocus="autofocus" placeholder="请输入图书名">
10 10
             </div>
11 11
           </div>
12 12
         </div>
@@ -91,6 +91,9 @@ export default {
91 91
     }
92 92
   },
93 93
   mounted () {
94
+    // this.$nextTick(() => {
95
+    //   document.getElementById("seltxt").focus()
96
+    // })
94 97
   },
95 98
   components: {
96 99
     loadMore,

+ 3
- 2
src/pages/user/library/borrowedRecord/index.vue Wyświetl plik

@@ -35,12 +35,12 @@
35 35
         </div>
36 36
       </div>
37 37
     </slideTabH>
38
-    <van-dialog v-model="showDialog" :show-confirm-button="false">
38
+    <van-dialog v-model="showDialog" :show-confirm-button="false" :closeOnClickOverlay="true">
39 39
       <div class="borrowedRecordContent flex-h" @click="showDialog = false">
40 40
         <div class="img">
41 41
           <a>
42 42
             <img
43
-              :src="currentItem.BookImg"
43
+              :src="(currentItem.BookImg || defaultimg) + '?x-oss-process=style/compress-rotate'"
44 44
               class="centerLabel"
45 45
               style="width: 100%;
46 46
                 height: 100%;
@@ -83,6 +83,7 @@ export default {
83 83
       currentItem: {},
84 84
       borrowshow: false,
85 85
       reserveshow: false,
86
+      defaultimg: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/book_default.png',
86 87
     }
87 88
   },
88 89
   created () {

+ 1
- 1
src/pages/user/mainPage/index.vue Wyświetl plik

@@ -34,7 +34,7 @@ export default {
34 34
         name: '城咖啡'
35 35
       }, {
36 36
         pathName: 'libraryIndex',
37
-        name: '图书馆'
37
+        name: '在线书吧'
38 38
       }, {
39 39
         pathName: 'userCenter',
40 40
         name: '会员'

+ 50
- 31
src/pages/user/mainPage/libraryIndex/index.vue Wyświetl plik

@@ -7,8 +7,9 @@
7 7
             <i class="iconfont icon-sousuo"></i>
8 8
             <router-link
9 9
               class="flex-item"
10
+              style="line-height: .3rem;color: #ccc;"
10 11
               :to="{name: 'booksSearch', query: {caseid: currentCaseId}}"
11
-            >{{indexSearchKey}}</router-link>
12
+            >书本名称</router-link>
12 13
           </div>
13 14
           <a @click="showDialog = true">
14 15
             <i class="iconfont icon-dingwei"></i>
@@ -26,7 +27,7 @@
26 27
             <span>{{item.BookTypeName}}</span>
27 28
           </a>
28 29
           <a v-if="(navList || []).length > 8 " @click="moreNav()">
29
-            <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/test-icon8.png" alt>
30
+            <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/icon_more.png" alt>
30 31
             <span>更多</span>
31 32
           </a>
32 33
         </nav>
@@ -58,7 +59,7 @@
58 59
         <div class="dialogContent">
59 60
           <span class="title">确认在线预约当前图书?</span>
60 61
           <div>
61
-            <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
62
+            <span style="color: #666;font-size:0.14rem;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则将取消预约资格</span>
62 63
           </div>
63 64
           <div class="btn">
64 65
             <a @click="sureAppointmentBook">确定</a>
@@ -108,6 +109,7 @@ export default {
108 109
       navList: x => x.types.list,
109 110
       books: x => x.recommends,
110 111
       mineBooks: x => x.minebooks,
112
+      bookcaseid: x => x.bookcaseid,
111 113
     }),
112 114
     reserveEndDate () {
113 115
       return toolClass.calDate(7)
@@ -118,7 +120,7 @@ export default {
118 120
     radio,
119 121
     loadMore
120 122
   },
121
-  created () {
123
+  mounted () {
122 124
     if (!this.CaseList.length || this.CaseList === null) {
123 125
       this.getCaseList().then((res) => {
124 126
         (res.cases || []).map((item) => {
@@ -147,6 +149,7 @@ export default {
147 149
       'getMineBook',
148 150
       'reserveBook',
149 151
       'updateRecommendBookLeftNum',
152
+      'setBookCase',
150 153
     ]),
151 154
     Location () {
152 155
       let that = this
@@ -157,37 +160,52 @@ export default {
157 160
         thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
158 161
       }).then(() => {
159 162
       })
160
-      wx.getLocation({
161
-        type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
162
-        success: function (res) {
163
-          let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
164
-          let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
165
-          for (let i = 0; i < that.CaseList.length; i++) {
166
-            let result = that.CaseList[i].Coordinate.split(",")
167
-            let latitude2 = parseFloat(result[0])
168
-            let longitude2 = parseFloat(result[1])
169
-            if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
170
-              that.currentCaseId = that.CaseList[i].CaseId
171
-              that.currentCaseName = that.CaseList[i].CaseName
163
+      console.log(this.bookcaseid)
164
+      if(this.bookcaseid === '') {
165
+        wx.getLocation({
166
+          type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
167
+          success: function (res) {
168
+            let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
169
+            let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
170
+            for (let i = 0; i < that.CaseList.length; i++) {
171
+              let result = that.CaseList[i].Coordinate.split(",")
172
+              let latitude2 = parseFloat(result[0])
173
+              let longitude2 = parseFloat(result[1])
174
+              if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
175
+                that.currentCaseId = that.CaseList[i].CaseId
176
+                that.caseId = that.currentCaseId
177
+                that.setBookCase(that.caseid)
178
+                that.currentCaseName = that.CaseList[i].CaseName
179
+              }
172 180
             }
173
-          }
174
-          if (!that.currentCaseId || !that.currentCaseName) {
181
+            if (!that.currentCaseId || !that.currentCaseName) {
182
+              that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
183
+              that.caseId = that.currentCaseId
184
+              that.setBookCase(that.caseid)
185
+              that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
186
+            }
187
+            that.init()
188
+          },
189
+          cancel: function () {
190
+            that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
191
+            that.caseId = that.currentCaseId
192
+            that.setBookCase(that.caseid)
193
+            that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
194
+            that.init()
195
+          },
196
+          fail: function () {
175 197
             that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
198
+            that.caseId = that.currentCaseId
199
+            that.setBookCase(that.caseid)
176 200
             that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
201
+            that.init()
177 202
           }
178
-          that.init()
179
-        },
180
-        cancel: function () {
181
-          that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
182
-          that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
183
-          that.init()
184
-        },
185
-        fail: function () {
186
-          that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
187
-          that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
188
-          that.init()
189
-        }
190
-      })
203
+        })
204
+      } else {
205
+        this.currentCaseId = this.bookcaseid
206
+        this.caseId = this.bookcaseid
207
+        this.currentCaseName = (this.CaseList.filter(x => x.CaseId === this.currentCaseId)[0] || {}).CaseName
208
+      }
191 209
     },
192 210
     selectCaseId () { // 选择案场
193 211
       if (this.currentCaseId !== this.caseId) {
@@ -195,6 +213,7 @@ export default {
195 213
         this.CaseList.map((item) => {
196 214
           if (item.CaseId === this.currentCaseId) this.currentCaseName = item.CaseName
197 215
         })
216
+        this.setBookCase(this.caseId)
198 217
         this.page = 1
199 218
         this.init()
200 219
       }

+ 7
- 0
src/store/book/index.js Wyświetl plik

@@ -12,6 +12,7 @@ export default {
12 12
       list: []
13 13
     },
14 14
     minebooks: {},
15
+    bookcaseid: '',
15 16
   },
16 17
   mutations: {
17 18
     updateTypeList (state, payload) {
@@ -66,6 +67,9 @@ export default {
66 67
         })
67 68
       }
68 69
     },
70
+    updateBookCase (state, caseid) {
71
+      state.bookcaseid = caseid
72
+    }
69 73
   },
70 74
   actions: {
71 75
     getBookType ({ commit }, payload) {
@@ -149,5 +153,8 @@ export default {
149 153
     updateRecommendBookLeftNum ({ commit }, bookid) {
150 154
       commit('updateRecommendBookLeftNum', bookid)
151 155
     },
156
+    setBookCase ({ commit }, caseid) {
157
+      commit('updateBookCase', caseid)
158
+    },
152 159
   }
153 160
 }