wangfei пре 6 година
родитељ
комит
d358dc1b75

+ 3
- 3
src/components/libraryListItem/index.vue Прегледај датотеку

2
   <div class="libraryListItem flex-h" @click="itemClick(data)">
2
   <div class="libraryListItem flex-h" @click="itemClick(data)">
3
     <div class="img">
3
     <div class="img">
4
       <a>
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
       </a>
6
       </a>
7
       <span v-if="type === 1" :class="data.BorrowStatus=='0'?'active':''">{{myBookStatus}}</span>
7
       <span v-if="type === 1" :class="data.BorrowStatus=='0'?'active':''">{{myBookStatus}}</span>
8
     </div>
8
     </div>
11
         <span>{{data.BookName}}</span>
11
         <span>{{data.BookName}}</span>
12
         <h5 v-if="!type">{{data.BookDescription}}</h5>
12
         <h5 v-if="!type">{{data.BookDescription}}</h5>
13
         <div v-if="!type" class="flex-h" style="margin-top: .06rem;">
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
           <span class="status" :class="{'active' : status != 1 && status != 0 && status != 4}" @click="appointmentBook(data.BookId)">{{bookStatus}}</span>
15
           <span class="status" :class="{'active' : status != 1 && status != 0 && status != 4}" @click="appointmentBook(data.BookId)">{{bookStatus}}</span>
16
         </div>
16
         </div>
17
         <div v-if="!type" class="flex-h">
17
         <div v-if="!type" class="flex-h">
61
   props: ['data', 'type', 'status'],
61
   props: ['data', 'type', 'status'],
62
   data () {
62
   data () {
63
     return {
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
   computed: {
67
   computed: {

+ 4
- 1
src/pages/user/library/booksSearch/index.vue Прегледај датотеку

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

+ 3
- 2
src/pages/user/library/borrowedRecord/index.vue Прегледај датотеку

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

+ 1
- 1
src/pages/user/mainPage/index.vue Прегледај датотеку

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

+ 50
- 31
src/pages/user/mainPage/libraryIndex/index.vue Прегледај датотеку

7
             <i class="iconfont icon-sousuo"></i>
7
             <i class="iconfont icon-sousuo"></i>
8
             <router-link
8
             <router-link
9
               class="flex-item"
9
               class="flex-item"
10
+              style="line-height: .3rem;color: #ccc;"
10
               :to="{name: 'booksSearch', query: {caseid: currentCaseId}}"
11
               :to="{name: 'booksSearch', query: {caseid: currentCaseId}}"
11
-            >{{indexSearchKey}}</router-link>
12
+            >书本名称</router-link>
12
           </div>
13
           </div>
13
           <a @click="showDialog = true">
14
           <a @click="showDialog = true">
14
             <i class="iconfont icon-dingwei"></i>
15
             <i class="iconfont icon-dingwei"></i>
26
             <span>{{item.BookTypeName}}</span>
27
             <span>{{item.BookTypeName}}</span>
27
           </a>
28
           </a>
28
           <a v-if="(navList || []).length > 8 " @click="moreNav()">
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
             <span>更多</span>
31
             <span>更多</span>
31
           </a>
32
           </a>
32
         </nav>
33
         </nav>
58
         <div class="dialogContent">
59
         <div class="dialogContent">
59
           <span class="title">确认在线预约当前图书?</span>
60
           <span class="title">确认在线预约当前图书?</span>
60
           <div>
61
           <div>
61
-            <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
62
+            <span style="color: #666;font-size:0.14rem;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则将取消预约资格</span>
62
           </div>
63
           </div>
63
           <div class="btn">
64
           <div class="btn">
64
             <a @click="sureAppointmentBook">确定</a>
65
             <a @click="sureAppointmentBook">确定</a>
108
       navList: x => x.types.list,
109
       navList: x => x.types.list,
109
       books: x => x.recommends,
110
       books: x => x.recommends,
110
       mineBooks: x => x.minebooks,
111
       mineBooks: x => x.minebooks,
112
+      bookcaseid: x => x.bookcaseid,
111
     }),
113
     }),
112
     reserveEndDate () {
114
     reserveEndDate () {
113
       return toolClass.calDate(7)
115
       return toolClass.calDate(7)
118
     radio,
120
     radio,
119
     loadMore
121
     loadMore
120
   },
122
   },
121
-  created () {
123
+  mounted () {
122
     if (!this.CaseList.length || this.CaseList === null) {
124
     if (!this.CaseList.length || this.CaseList === null) {
123
       this.getCaseList().then((res) => {
125
       this.getCaseList().then((res) => {
124
         (res.cases || []).map((item) => {
126
         (res.cases || []).map((item) => {
147
       'getMineBook',
149
       'getMineBook',
148
       'reserveBook',
150
       'reserveBook',
149
       'updateRecommendBookLeftNum',
151
       'updateRecommendBookLeftNum',
152
+      'setBookCase',
150
     ]),
153
     ]),
151
     Location () {
154
     Location () {
152
       let that = this
155
       let that = this
157
         thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
160
         thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
158
       }).then(() => {
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
             that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
197
             that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
198
+            that.caseId = that.currentCaseId
199
+            that.setBookCase(that.caseid)
176
             that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
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
     selectCaseId () { // 选择案场
210
     selectCaseId () { // 选择案场
193
       if (this.currentCaseId !== this.caseId) {
211
       if (this.currentCaseId !== this.caseId) {
195
         this.CaseList.map((item) => {
213
         this.CaseList.map((item) => {
196
           if (item.CaseId === this.currentCaseId) this.currentCaseName = item.CaseName
214
           if (item.CaseId === this.currentCaseId) this.currentCaseName = item.CaseName
197
         })
215
         })
216
+        this.setBookCase(this.caseId)
198
         this.page = 1
217
         this.page = 1
199
         this.init()
218
         this.init()
200
       }
219
       }

+ 7
- 0
src/store/book/index.js Прегледај датотеку

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