wangfei 6 yıl önce
ebeveyn
işleme
58804d5b14

+ 59
- 8
src/pages/user/library/booksList/index.vue Dosyayı Görüntüle

@@ -1,16 +1,20 @@
1 1
 <template>
2 2
   <div class="mainPage">
3 3
     <div>
4
+      <div class="noData" v-if="show && (books.list || []).length < 1">
5
+        <img src="../../../../common/icon/kong.png" alt>
6
+        <span>暂无内容</span>
7
+      </div>
4 8
       <ul>
5
-        <li v-for="(item, index) in (books.list || [])" :key="index">
6
-          <libraryListItem :data="item" @appointmentBook="appointmentBook"></libraryListItem>
9
+        <li v-for="(item, index) in (books.list || [])" :key="index" v-if="show">
10
+          <libraryListItem :data="item" :status="mineBookStatus(item)" @appointmentBook="appointmentBook"></libraryListItem>
7 11
         </li>
8 12
       </ul>
9 13
       <van-dialog v-model="showAppointmentDialog" :show-confirm-button="false">
10 14
         <div class="dialogContent">
11 15
           <span class="title">确认在线预约当前图书?</span>
12 16
           <div>
13
-            <span style="color: #666;">在线预约需在2018年12月20日前前往案场借阅图书, 否则 将取消预约资格</span>
17
+            <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
14 18
           </div>
15 19
           <div class="btn">
16 20
             <a @click="sureAppointmentBook">确定</a>
@@ -25,6 +29,7 @@
25 29
 <script>
26 30
 import libraryListItem from '../../../../components/libraryListItem/index'
27 31
 import { createNamespacedHelpers } from 'vuex'
32
+import toolClass from '../../../../util/util'
28 33
 const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
29 34
 export default {
30 35
   data () {
@@ -35,18 +40,30 @@ export default {
35 40
         bookType: '',
36 41
         page: 1,
37 42
         pagesize: 10,
38
-      }
43
+      },
44
+      reserveBookId: '',
45
+      show: false,
39 46
     }
40 47
   },
41 48
   created () {
42 49
     this.query.bookType = this.$route.query.type
43 50
     this.query.caseid = this.$route.query.caseid
44
-    this.getBookList(this.query)
51
+    this.getBookList(this.query).then(() => {
52
+      this.show = true
53
+    })
54
+    this.getMineBook({
55
+      page: 1,
56
+      pagesize: 1000,
57
+    })
45 58
   },
46 59
   computed: {
47 60
     ...mapBookState({
48
-      books: x => x.books
49
-    })
61
+      books: x => x.books,
62
+      mineBooks: x => x.minebooks,
63
+    }),
64
+    reserveEndDate() {
65
+      return toolClass.calDate(7)
66
+    }
50 67
   },
51 68
   components: {
52 69
     libraryListItem,
@@ -54,12 +71,26 @@ export default {
54 71
   methods: {
55 72
     ...mapBookAction([
56 73
       'getBookList',
74
+      "getMineBook",
75
+      "reserveBook",
57 76
     ]),
58
-    appointmentBook () { // 预约图书
77
+    appointmentBook (id) { // 预约图书
78
+      this.reserveBookId = id
59 79
       this.showAppointmentDialog = true
60 80
     },
61 81
     sureAppointmentBook () { // 确定预约图书
82
+      this.reserveBook({
83
+        bookid: this.reserveBookId,
84
+      }).then(() => {
85
+        this.getMineBook({
86
+          page: 1,
87
+          pagesize: 1000,
88
+        })
89
+      })
62 90
       this.showAppointmentDialog = false
91
+    },
92
+    mineBookStatus (item) {
93
+      return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId && (x.BorrowStatus == '4' || x.BorrowStatus == '1' || x.BorrowStatus == '0'))[0] || {}).BorrowStatus
63 94
     }
64 95
   }
65 96
 }
@@ -77,6 +108,26 @@ export default {
77 108
     -webkit-overflow-scrolling: touch;
78 109
     transform: translateZ(0);
79 110
     -webkit-transform: translateZ(0);
111
+    .noData {
112
+      width: 100%;
113
+      margin: 0.5rem auto 0;
114
+      position: relative;
115
+      overflow: hidden;
116
+      img {
117
+        width: 0.7rem;
118
+        display: block;
119
+        margin: 0 auto;
120
+      }
121
+      span {
122
+        width: 100%;
123
+        display: block;
124
+        text-align: center;
125
+        line-height: 0.3rem;
126
+        color: #b4b4b4;
127
+        font-size: 0.14rem;
128
+        margin: 0.05rem auto 0;
129
+      }
130
+    }
80 131
     >ul{
81 132
       padding: 0 .16rem;
82 133
       margin-bottom: .1rem;

+ 28
- 4
src/pages/user/library/booksSearch/index.vue Dosyayı Görüntüle

@@ -25,7 +25,7 @@
25 25
         </div>
26 26
         <ul v-else>
27 27
           <li v-for="(item, index) in books.list" :key="index">
28
-            <libraryListItem :data="item" @appointmentBook="appointmentBook"></libraryListItem>
28
+            <libraryListItem :data="item" :status="mineBookStatus(item)" @appointmentBook="appointmentBook"></libraryListItem>
29 29
           </li>
30 30
         </ul>
31 31
       </div>
@@ -34,7 +34,7 @@
34 34
       <div class="dialogContent">
35 35
         <span class="title">确认在线预约当前图书?</span>
36 36
         <div>
37
-          <span style="color: #666;">在线预约需在2018年12月20日前前往案场借阅图书, 否则 将取消预约资格</span>
37
+          <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
38 38
         </div>
39 39
         <div class="btn">
40 40
           <a @click="sureAppointmentBook">确定</a>
@@ -47,6 +47,7 @@
47 47
 
48 48
 <script>
49 49
 import libraryListItem from '../../../../components/libraryListItem/index'
50
+import toolClass from '../../../../util/util'
50 51
 import { mapState, createNamespacedHelpers } from 'vuex'
51 52
 const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
52 53
 export default {
@@ -60,15 +61,24 @@ export default {
60 61
       page: 1,
61 62
       pagesize: 10,
62 63
       doSearchKey: '',
64
+      reserveBookId: '',
63 65
     }
64 66
   },
65 67
   created () {
66 68
     this.caseid = this.$route.query.caseid
69
+    this.getMineBook({
70
+      page: 1,
71
+      pagesize: 1000,
72
+    })
67 73
   },
68 74
   computed: {
69 75
     ...mapBookState({
70 76
       books: x => x.books,
71
-    })
77
+      mineBooks: x => x.minebooks,
78
+    }),
79
+    reserveEndDate() {
80
+      return toolClass.calDate(7)
81
+    }
72 82
   },
73 83
   mounted () {
74 84
   },
@@ -78,6 +88,8 @@ export default {
78 88
   methods: {
79 89
     ...mapBookAction([
80 90
       'getBookList',
91
+      'getMineBook',
92
+      'reserveBook',
81 93
     ]),
82 94
     search () { // 搜索
83 95
       if (this.searchKey !== '') {
@@ -87,10 +99,19 @@ export default {
87 99
         this.$toast('搜索关键词不能为空')
88 100
       }
89 101
     },
90
-    appointmentBook () { // 预约图书
102
+    appointmentBook (id) { // 预约图书
103
+      this.reserveBookId = id
91 104
       this.showAppointmentDialog = true
92 105
     },
93 106
     sureAppointmentBook () { // 确定预约图书
107
+      this.reserveBook({
108
+        bookid: this.reserveBookId,
109
+      }).then(() => {
110
+        this.getMineBook({
111
+          page: 1,
112
+          pagesize: 1000,
113
+        })
114
+      })
94 115
       this.showAppointmentDialog = false
95 116
     },
96 117
     getSearchList () {
@@ -103,6 +124,9 @@ export default {
103 124
         this.showSearch = true
104 125
       })
105 126
     },
127
+    mineBookStatus (item) {
128
+      return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId && (x.BorrowStatus == '4' || x.BorrowStatus == '1' || x.BorrowStatus == '0'))[0] || {}).BorrowStatus
129
+    }
106 130
   }
107 131
 }
108 132
 </script>

+ 34
- 2
src/pages/user/library/borrowedRecord/index.vue Dosyayı Görüntüle

@@ -9,7 +9,11 @@
9 9
     >
10 10
       <div class="subMain" slot="slideTabH-1">
11 11
         <div>
12
-          <ul>
12
+          <div class="noData" v-if="borrowshow && (borrowBooks.list || []).length < 1">
13
+            <img src="../../../../common/icon/kong.png" alt>
14
+            <span>暂无内容</span>
15
+          </div>
16
+          <ul v-if="borrowshow">
13 17
             <li v-for="(item, index) in borrowBooks.list" :key="index">
14 18
               <libraryListItem :data="item" :type="1" @itemClick="borrowedRecordClick"></libraryListItem>
15 19
             </li>
@@ -19,7 +23,11 @@
19 23
       <div class="subMain" slot="slideTabH-2">
20 24
         <div>
21 25
           <span>请在资格保留时间内至案场借阅图书,超出预约时间将取消预约资格</span>
22
-          <ul>
26
+          <div class="noData" v-if="reserveshow && (reserveBooks.list || []).length < 1">
27
+            <img src="../../../../common/icon/kong.png" alt>
28
+            <span>暂无内容</span>
29
+          </div>
30
+          <ul v-if="reserveshow">
23 31
             <li v-for="(item, index) in reserveBooks.list" :key="index">
24 32
               <libraryListItem :data="item" :type="2"></libraryListItem>
25 33
             </li>
@@ -67,6 +75,8 @@ export default {
67 75
       reserveBooks: {},
68 76
       borrowBooks: {},
69 77
       currentItem: {},
78
+      borrowshow: false,
79
+      reserveshow: false,
70 80
     }
71 81
   },
72 82
   created () {
@@ -124,8 +134,10 @@ export default {
124 134
       }).then((res) => {
125 135
         if(status == '1') {
126 136
           _that.borrowBooks = res
137
+          _that.borrowshow = true
127 138
         } else {
128 139
           _that.reserveBooks = res
140
+          _that.reserveshow = true
129 141
         }
130 142
       })
131 143
     }
@@ -143,6 +155,26 @@ export default {
143 155
     -webkit-overflow-scrolling: touch;
144 156
     transform: translateZ(0);
145 157
     -webkit-transform: translateZ(0);
158
+    .noData {
159
+      width: 100%;
160
+      margin: 0.5rem auto 0;
161
+      position: relative;
162
+      overflow: hidden;
163
+      img {
164
+        width: 0.7rem;
165
+        display: block;
166
+        margin: 0 auto;
167
+      }
168
+      span {
169
+        width: 100%;
170
+        display: block;
171
+        text-align: center;
172
+        line-height: 0.3rem;
173
+        color: #b4b4b4;
174
+        font-size: 0.14rem;
175
+        margin: 0.05rem auto 0;
176
+      }
177
+    }
146 178
     > div {
147 179
       width: 100%;
148 180
       position: relative;

+ 1
- 1
src/pages/user/mainPage/libraryIndex/index.vue Dosyayı Görüntüle

@@ -182,7 +182,7 @@ export default {
182 182
       this.$router.push({ name: 'libraryNavList', query: {caseid: this.currentCaseId} })
183 183
     },
184 184
     mineBookStatus (item) {
185
-      return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId)[0] || {}).BorrowStatus
185
+      return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId && (x.BorrowStatus == '4' || x.BorrowStatus == '1' || x.BorrowStatus == '0'))[0] || {}).BorrowStatus
186 186
     }
187 187
   }
188 188
 }

+ 2
- 2
src/pages/user/mainPage/userCenter/index.vue Dosyayı Görüntüle

@@ -15,7 +15,7 @@
15 15
             <div></div>
16 16
           </div>
17 17
           <div v-if="user.Phone" class="code">
18
-            <div>卡号:2334546456456</div>
18
+            <div>卡号:{{user.Barcode}}</div>
19 19
             <svg style="width:100%" id="barcode"></svg>
20 20
           </div>
21 21
           <div v-else class="bind">
@@ -121,7 +121,7 @@ export default {
121 121
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
122 122
         this.$nextTick(() => {
123 123
           if (this.user.Phone) {
124
-            JsBarcode("#barcode", "2334546456456", {
124
+            JsBarcode("#barcode", this.user.Barcode, {
125 125
               lineColor: '#000000',
126 126
               height: 60,
127 127
               displayValue: false