Kaynağa Gözat

Merge branch 'dev'

zjxpcyc 6 yıl önce
ebeveyn
işleme
11d41291f8
100 değiştirilmiş dosya ile 4536 ekleme ve 305 silme
  1. 69
    6
      package-lock.json
  2. 9
    1
      package.json
  3. 8
    2
      public/index.html
  4. 56
    0
      src/common/css/reset.css
  5. BIN
      src/common/icon/Rectangle.png
  6. BIN
      src/common/icon/b1-.jpg
  7. BIN
      src/common/icon/b1.jpg
  8. BIN
      src/common/icon/b10-.jpg
  9. BIN
      src/common/icon/b10.jpg
  10. BIN
      src/common/icon/b11-.jpg
  11. BIN
      src/common/icon/b11.jpg
  12. BIN
      src/common/icon/b12-.jpg
  13. BIN
      src/common/icon/b12.jpg
  14. BIN
      src/common/icon/b2-.jpg
  15. BIN
      src/common/icon/b2.jpg
  16. BIN
      src/common/icon/b3-.jpg
  17. BIN
      src/common/icon/b3.jpg
  18. BIN
      src/common/icon/b4-.jpg
  19. BIN
      src/common/icon/b4.jpg
  20. BIN
      src/common/icon/b5-.jpg
  21. BIN
      src/common/icon/b5.jpg
  22. BIN
      src/common/icon/b6-.png
  23. BIN
      src/common/icon/b6.jpg
  24. BIN
      src/common/icon/b7-.jpg
  25. BIN
      src/common/icon/b7.jpg
  26. BIN
      src/common/icon/b8-.jpg
  27. BIN
      src/common/icon/b8.jpg
  28. BIN
      src/common/icon/b9-.jpg
  29. BIN
      src/common/icon/b9.jpg
  30. BIN
      src/common/icon/checked.png
  31. BIN
      src/common/icon/coverBlack.jpg
  32. BIN
      src/common/icon/coverRed.jpg
  33. BIN
      src/common/icon/dz.jpg
  34. BIN
      src/common/icon/endBlack.jpg
  35. BIN
      src/common/icon/heise.png
  36. BIN
      src/common/icon/honhse.png
  37. BIN
      src/common/icon/kong.png
  38. BIN
      src/common/icon/loading-red.gif
  39. BIN
      src/common/icon/pointer.png
  40. BIN
      src/common/icon/r1-.jpg
  41. BIN
      src/common/icon/r10-.jpg
  42. BIN
      src/common/icon/r11-.jpg
  43. BIN
      src/common/icon/r12-.jpg
  44. BIN
      src/common/icon/r2-.jpg
  45. BIN
      src/common/icon/r3-.jpg
  46. BIN
      src/common/icon/r4-.jpg
  47. BIN
      src/common/icon/r5-.jpg
  48. BIN
      src/common/icon/r6-.jpg
  49. BIN
      src/common/icon/r7-.jpg
  50. BIN
      src/common/icon/r8-.jpg
  51. BIN
      src/common/icon/r9-.jpg
  52. BIN
      src/common/icon/reSet.png
  53. BIN
      src/common/icon/reloadImg.png
  54. BIN
      src/common/icon/tabBar-icon-4.png
  55. BIN
      src/common/icon/text-h.png
  56. BIN
      src/common/icon/text-l.png
  57. BIN
      src/common/icon/topImgBlack.png
  58. BIN
      src/common/icon/topImgRed.jpg
  59. BIN
      src/common/icon/unchecked.png
  60. BIN
      src/common/icon/uploadImg.png
  61. 2
    2
      src/components/courseItem/index.vue
  62. 243
    0
      src/components/libraryListItem/index.vue
  63. 1
    0
      src/components/orderItem/page.scss
  64. 101
    0
      src/components/preview/preview.vue
  65. 68
    0
      src/components/radio/index.vue
  66. 180
    0
      src/components/slideTabH/index.vue
  67. 272
    0
      src/components/vue-load-more/index.vue
  68. BIN
      src/components/vue-load-more/loading.gif
  69. 1
    1
      src/pages/bodyCheck/app.js
  70. 1
    1
      src/pages/sales/app.js
  71. 1
    1
      src/pages/user/App.vue
  72. 62
    0
      src/pages/user/activeList/activeList.vue
  73. 1
    1
      src/pages/user/app.js
  74. 26
    17
      src/pages/user/bindMobile/bindMobile.vue
  75. 2
    2
      src/pages/user/bindMobile/page.scss
  76. 151
    0
      src/pages/user/calendar/calendar.vue
  77. 96
    0
      src/pages/user/calendar/checkModel.vue
  78. 697
    0
      src/pages/user/calendar/making.vue
  79. 37
    0
      src/pages/user/calendar/preview.vue
  80. 106
    0
      src/pages/user/courseList/index.vue
  81. 31
    0
      src/pages/user/courseList/page.scss
  82. 216
    0
      src/pages/user/customization/customizationDetail.vue
  83. 116
    0
      src/pages/user/customization/customizationList.vue
  84. 34
    7
      src/pages/user/fiveA/index.vue
  85. 172
    0
      src/pages/user/library/booksList/index.vue
  86. 274
    0
      src/pages/user/library/booksSearch/index.vue
  87. 276
    0
      src/pages/user/library/borrowedRecord/index.vue
  88. 84
    0
      src/pages/user/library/navList/index.vue
  89. 2
    1
      src/pages/user/mainPage/coffeeIndex/index.vue
  90. 5
    1
      src/pages/user/mainPage/index.vue
  91. 203
    97
      src/pages/user/mainPage/indexPage/index.vue
  92. 203
    142
      src/pages/user/mainPage/indexPage/page.scss
  93. 344
    0
      src/pages/user/mainPage/libraryIndex/index.vue
  94. 83
    0
      src/pages/user/mainPage/libraryIndex/page.scss
  95. 66
    15
      src/pages/user/mainPage/userCenter/index.vue
  96. 83
    7
      src/pages/user/mainPage/userCenter/page.scss
  97. 2
    1
      src/pages/user/majorProjectsDetail/index.vue
  98. 97
    0
      src/pages/user/majorProjectsList/index.vue
  99. 55
    0
      src/pages/user/majorProjectsList/page.scss
  100. 0
    0
      src/pages/user/placeOrder/page.scss

+ 69
- 6
package-lock.json Dosyayı Görüntüle

@@ -2219,6 +2219,12 @@
2219 2219
         }
2220 2220
       }
2221 2221
     },
2222
+    "base64-arraybuffer": {
2223
+      "version": "0.1.5",
2224
+      "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
2225
+      "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=",
2226
+      "dev": true
2227
+    },
2222 2228
     "base64-js": {
2223 2229
       "version": "1.3.0",
2224 2230
       "resolved": "http://registry.npm.taobao.org/base64-js/download/base64-js-1.3.0.tgz",
@@ -2458,7 +2464,7 @@
2458 2464
       "integrity": "sha1-KGlFnZqjviRf6P4sofRuLn9U1z8=",
2459 2465
       "dev": true,
2460 2466
       "requires": {
2461
-        "pako": "1.0.6"
2467
+        "pako": "1.0.7"
2462 2468
       }
2463 2469
     },
2464 2470
     "browserslist": {
@@ -2665,6 +2671,18 @@
2665 2671
       "integrity": "sha1-xkTDlYjdQtNJjpUiNMNy5aQKQSM=",
2666 2672
       "dev": true
2667 2673
     },
2674
+    "canvas-exif-orientation": {
2675
+      "version": "0.4.0",
2676
+      "resolved": "https://registry.npmjs.org/canvas-exif-orientation/-/canvas-exif-orientation-0.4.0.tgz",
2677
+      "integrity": "sha1-tIfzcBmYqeh56xBAELKlgRU2i2s=",
2678
+      "dev": true
2679
+    },
2680
+    "canvas2image": {
2681
+      "version": "1.0.5",
2682
+      "resolved": "https://registry.npmjs.org/canvas2image/-/canvas2image-1.0.5.tgz",
2683
+      "integrity": "sha1-Z2oJS0NjiIordmLli5zl07+8nRQ=",
2684
+      "dev": true
2685
+    },
2668 2686
     "case-sensitive-paths-webpack-plugin": {
2669 2687
       "version": "2.1.2",
2670 2688
       "resolved": "http://registry.npm.taobao.org/case-sensitive-paths-webpack-plugin/download/case-sensitive-paths-webpack-plugin-2.1.2.tgz",
@@ -3424,6 +3442,15 @@
3424 3442
         }
3425 3443
       }
3426 3444
     },
3445
+    "css-line-break": {
3446
+      "version": "1.0.1",
3447
+      "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-1.0.1.tgz",
3448
+      "integrity": "sha1-GfIGOjPpX7KDG4ZEbAuAwYivRQo=",
3449
+      "dev": true,
3450
+      "requires": {
3451
+        "base64-arraybuffer": "0.1.5"
3452
+      }
3453
+    },
3427 3454
     "css-loader": {
3428 3455
       "version": "1.0.0",
3429 3456
       "resolved": "http://registry.npm.taobao.org/css-loader/download/css-loader-1.0.0.tgz",
@@ -4513,6 +4540,12 @@
4513 4540
         "strip-eof": "1.0.0"
4514 4541
       }
4515 4542
     },
4543
+    "exif-js": {
4544
+      "version": "2.3.0",
4545
+      "resolved": "https://registry.npmjs.org/exif-js/-/exif-js-2.3.0.tgz",
4546
+      "integrity": "sha1-nRCBm/Vx+HOBPnZAJBJVq5zhqBQ=",
4547
+      "dev": true
4548
+    },
4516 4549
     "expand-brackets": {
4517 4550
       "version": "0.1.5",
4518 4551
       "resolved": "http://registry.npm.taobao.org/expand-brackets/download/expand-brackets-0.1.5.tgz",
@@ -6310,6 +6343,15 @@
6310 6343
         }
6311 6344
       }
6312 6345
     },
6346
+    "html2canvas": {
6347
+      "version": "1.0.0-alpha.12",
6348
+      "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.0.0-alpha.12.tgz",
6349
+      "integrity": "sha1-OxmS48mz9WBjw1/WIElPN+uohRM=",
6350
+      "dev": true,
6351
+      "requires": {
6352
+        "css-line-break": "1.0.1"
6353
+      }
6354
+    },
6313 6355
     "htmlparser2": {
6314 6356
       "version": "3.3.0",
6315 6357
       "resolved": "http://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.3.0.tgz",
@@ -7267,6 +7309,12 @@
7267 7309
       "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
7268 7310
       "dev": true
7269 7311
     },
7312
+    "jQuery": {
7313
+      "version": "1.7.4",
7314
+      "resolved": "https://registry.npmjs.org/jQuery/-/jQuery-1.7.4.tgz",
7315
+      "integrity": "sha1-8y3FyFpwRO6GS0RDue5F+UeLoTc=",
7316
+      "dev": true
7317
+    },
7270 7318
     "javascript-stringify": {
7271 7319
       "version": "1.6.0",
7272 7320
       "resolved": "http://registry.npm.taobao.org/javascript-stringify/download/javascript-stringify-1.6.0.tgz",
@@ -7327,6 +7375,12 @@
7327 7375
         "esprima": "4.0.1"
7328 7376
       }
7329 7377
     },
7378
+    "jsbarcode": {
7379
+      "version": "3.11.0",
7380
+      "resolved": "https://registry.npmjs.org/jsbarcode/-/jsbarcode-3.11.0.tgz",
7381
+      "integrity": "sha512-/ozCd7wsa+VIHo9sUc03HneVEQrH7cVWfJolUT/WOW1m8mJ2e3iYZje6C9X3LFHdczlesqFHRpxLtbVsNtjyow==",
7382
+      "dev": true
7383
+    },
7330 7384
     "jsbn": {
7331 7385
       "version": "0.1.1",
7332 7386
       "resolved": "http://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
@@ -8880,9 +8934,9 @@
8880 8934
       "dev": true
8881 8935
     },
8882 8936
     "pako": {
8883
-      "version": "1.0.6",
8884
-      "resolved": "http://registry.npm.taobao.org/pako/download/pako-1.0.6.tgz",
8885
-      "integrity": "sha1-AQEhG6pwxLykoPY/Igbpe3368lg=",
8937
+      "version": "1.0.7",
8938
+      "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.7.tgz",
8939
+      "integrity": "sha512-3HNK5tW4x8o5mO8RuHZp3Ydw9icZXx0RANAOMzlMzx7LVXhMJ4mo3MOBpzyd7r/+RUu8BmndP47LXT+vzjtWcQ==",
8886 8940
       "dev": true
8887 8941
     },
8888 8942
     "parallel-transform": {
@@ -12734,6 +12788,16 @@
12734 12788
         "swiper": "4.3.5"
12735 12789
       }
12736 12790
     },
12791
+    "vue-croppa": {
12792
+      "version": "1.3.8",
12793
+      "resolved": "https://registry.npmjs.org/vue-croppa/-/vue-croppa-1.3.8.tgz",
12794
+      "integrity": "sha512-WwYgEKscTCD7BzhnbfRJfzWIU6RcMq2JRimB3aI5gGzpADmpKuqmDh9+oVfiZaEnpmRthgXZxcAvbxU6CeIU9w==",
12795
+      "dev": true,
12796
+      "requires": {
12797
+        "canvas-exif-orientation": "0.4.0",
12798
+        "object-assign": "4.1.1"
12799
+      }
12800
+    },
12737 12801
     "vue-eslint-parser": {
12738 12802
       "version": "2.0.3",
12739 12803
       "resolved": "http://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-2.0.3.tgz",
@@ -13389,8 +13453,7 @@
13389 13453
     "weixin-js-sdk": {
13390 13454
       "version": "1.3.3",
13391 13455
       "resolved": "https://registry.npmjs.org/weixin-js-sdk/-/weixin-js-sdk-1.3.3.tgz",
13392
-      "integrity": "sha512-1ofMi7Q1ioXV8/V8tGv3DrU7pugmyvhN86Pxbj1WaGeIEs/+yz0Jdv/5L+ocuDh/JAbKmtvMvBXh0OyuP6kQ8A==",
13393
-      "dev": true
13456
+      "integrity": "sha512-1ofMi7Q1ioXV8/V8tGv3DrU7pugmyvhN86Pxbj1WaGeIEs/+yz0Jdv/5L+ocuDh/JAbKmtvMvBXh0OyuP6kQ8A=="
13394 13457
     },
13395 13458
     "which": {
13396 13459
       "version": "1.3.1",

+ 9
- 1
package.json Dosyayı Görüntüle

@@ -9,6 +9,7 @@
9 9
   },
10 10
   "dependencies": {
11 11
     "element-ui": "^2.4.6",
12
+    "jsbarcode": "^3.11.0",
12 13
     "vue": "^2.5.17",
13 14
     "weixin-js-sdk": "^1.3.3"
14 15
   },
@@ -19,16 +20,23 @@
19 20
     "@vue/eslint-config-prettier": "^3.0.1",
20 21
     "axios": "^0.18.0",
21 22
     "better-scroll": "^1.12.6",
23
+    "canvas2image": "^1.0.5",
24
+    "exif-js": "^2.3.0",
25
+    "html2canvas": "^1.0.0-alpha.12",
26
+    "jQuery": "^1.7.4",
27
+    "jsbarcode": "^3.11.0",
22 28
     "less": "^3.0.4",
23 29
     "less-loader": "^4.1.0",
24 30
     "node-sass": "^4.9.3",
31
+    "pako": "^1.0.7",
25 32
     "qrcodejs2": "^0.0.2",
26 33
     "sass-loader": "^7.1.0",
27 34
     "vant": "^1.3.0",
28 35
     "vue-awesome-swiper": "^3.1.3",
36
+    "vue-croppa": "^1.3.8",
29 37
     "vue-router": "^3.0.1",
30 38
     "vue-template-compiler": "^2.5.17",
31 39
     "vuex": "^3.0.1",
32
-    "weixin-js-sdk": "^1.3.3"
40
+    "weixin-jsapi": "^1.1.0"
33 41
   }
34 42
 }

+ 8
- 2
public/index.html Dosyayı Görüntüle

@@ -6,8 +6,13 @@
6 6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
8 8
     charset="utf-8" />
9
-  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_s109s6ry4gl.css">
9
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_clu263vfyod.css">
10 10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
11
+  <!-- <script src="https://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/vconsole/3.0.0/vconsole.min.js"></script>
12
+  <script> new VConsole(); </script> -->
13
+  <!-- <script src="https://jsconsole.com/js/remote.js?34f890f2-39c4-46f7-9d9e-7a8cb29a6007"></script> -->
14
+  <!-- <script src="//cdn.bootcss.com/eruda/1.5.2/eruda.min.js"></script>
15
+  <script>eruda.init();</script> -->
11 16
   <title>
12 17
     <%= htmlWebpackPlugin.options.title %>
13 18
   </title>
@@ -15,7 +20,8 @@
15 20
 
16 21
 <body>
17 22
   <noscript>
18
-    <strong>We're sorry but multiple-pages doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
23
+    <strong>We're sorry but multiple-pages doesn't work properly without JavaScript enabled. Please enable it to
24
+      continue.</strong>
19 25
   </noscript>
20 26
   <div id="app"></div>
21 27
   <!-- built files will be auto injected -->

+ 56
- 0
src/common/css/reset.css Dosyayı Görüntüle

@@ -85,4 +85,60 @@ select option {
85 85
 
86 86
 .van-dialog__message .van-dialog__message--has-title{
87 87
 	text-align: center;
88
+}
89
+
90
+.dialogContent{
91
+	padding: 0 .15rem;
92
+}
93
+
94
+.dialogContent>.title{
95
+	width: 100%;
96
+	text-align: center;
97
+	display: block;
98
+	line-height: .26rem;
99
+	font-size: .16rem;
100
+	margin: .15rem auto 0;
101
+}
102
+
103
+.dialogContent>div{
104
+	width: 100%;
105
+	position: relative;
106
+	overflow: hidden;
107
+	margin: .15rem auto 0;
108
+}
109
+
110
+.dialogContent .btn{
111
+	width: 100%;
112
+	position: relative;
113
+	overflow: hidden;
114
+	margin-bottom: .2rem;
115
+	white-space: nowrap;
116
+	font-size: 0;
117
+	text-align: center;
118
+}
119
+
120
+.dialogContent>.btn>a{
121
+	width: 1rem;
122
+	display: inline-block;
123
+	line-height: .36rem;
124
+	border-radius: .05rem;
125
+	text-align: center;
126
+	border: 1px solid #787878;
127
+	margin-left: .2rem;
128
+}
129
+
130
+.dialogContent>.btn>a:first-child{
131
+	margin-left: 0;
132
+	background: #fc6243;
133
+	color: #fff;
134
+	border: 1px solid #fc6243;
135
+}
136
+
137
+.dialogContent>.btn>a:only-child{
138
+	width: 1.6rem;
139
+	display: block;
140
+	margin:  0 auto;
141
+	background: #fc6243;
142
+	color: #fff;
143
+	border: 1px solid #fc6243;
88 144
 }

BIN
src/common/icon/Rectangle.png Dosyayı Görüntüle


BIN
src/common/icon/b1-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b1.jpg Dosyayı Görüntüle


BIN
src/common/icon/b10-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b10.jpg Dosyayı Görüntüle


BIN
src/common/icon/b11-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b11.jpg Dosyayı Görüntüle


BIN
src/common/icon/b12-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b12.jpg Dosyayı Görüntüle


BIN
src/common/icon/b2-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b2.jpg Dosyayı Görüntüle


BIN
src/common/icon/b3-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b3.jpg Dosyayı Görüntüle


BIN
src/common/icon/b4-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b4.jpg Dosyayı Görüntüle


BIN
src/common/icon/b5-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b5.jpg Dosyayı Görüntüle


BIN
src/common/icon/b6-.png Dosyayı Görüntüle


BIN
src/common/icon/b6.jpg Dosyayı Görüntüle


BIN
src/common/icon/b7-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b7.jpg Dosyayı Görüntüle


BIN
src/common/icon/b8-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b8.jpg Dosyayı Görüntüle


BIN
src/common/icon/b9-.jpg Dosyayı Görüntüle


BIN
src/common/icon/b9.jpg Dosyayı Görüntüle


BIN
src/common/icon/checked.png Dosyayı Görüntüle


BIN
src/common/icon/coverBlack.jpg Dosyayı Görüntüle


BIN
src/common/icon/coverRed.jpg Dosyayı Görüntüle


BIN
src/common/icon/dz.jpg Dosyayı Görüntüle


BIN
src/common/icon/endBlack.jpg Dosyayı Görüntüle


BIN
src/common/icon/heise.png Dosyayı Görüntüle


BIN
src/common/icon/honhse.png Dosyayı Görüntüle


BIN
src/common/icon/kong.png Dosyayı Görüntüle


BIN
src/common/icon/loading-red.gif Dosyayı Görüntüle


BIN
src/common/icon/pointer.png Dosyayı Görüntüle


BIN
src/common/icon/r1-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r10-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r11-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r12-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r2-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r3-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r4-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r5-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r6-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r7-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r8-.jpg Dosyayı Görüntüle


BIN
src/common/icon/r9-.jpg Dosyayı Görüntüle


BIN
src/common/icon/reSet.png Dosyayı Görüntüle


BIN
src/common/icon/reloadImg.png Dosyayı Görüntüle


BIN
src/common/icon/tabBar-icon-4.png Dosyayı Görüntüle


BIN
src/common/icon/text-h.png Dosyayı Görüntüle


BIN
src/common/icon/text-l.png Dosyayı Görüntüle


BIN
src/common/icon/topImgBlack.png Dosyayı Görüntüle


BIN
src/common/icon/topImgRed.jpg Dosyayı Görüntüle


BIN
src/common/icon/unchecked.png Dosyayı Görüntüle


BIN
src/common/icon/uploadImg.png Dosyayı Görüntüle


+ 2
- 2
src/components/courseItem/index.vue Dosyayı Görüntüle

@@ -5,7 +5,7 @@
5 5
         <img :src="data.img" class="centerLabel cover" alt="">
6 6
       </a>
7 7
     </div>
8
-    <div class="flex-item flex-v">
8
+    <div class="flex-item flex-v" :style="{marginRight: marginRight + 'rem'}">
9 9
       <div class="flex-item">
10 10
         <div class="content">
11 11
           <div class="title flex-h">
@@ -41,7 +41,7 @@
41 41
 
42 42
 export default {
43 43
   name: '',
44
-  props: ['data'],
44
+  props: ['data', 'marginRight'],
45 45
   data () {
46 46
     return {
47 47
       

+ 243
- 0
src/components/libraryListItem/index.vue Dosyayı Görüntüle

@@ -0,0 +1,243 @@
1
+<template>
2
+  <div class="libraryListItem flex-h" @click="itemClick(data)">
3
+    <div class="img">
4
+      <a>
5
+        <img :src="(data.BookImg || defaultimg) + '?x-oss-process=style/compress-rotate'" class="centerLabel cover" alt>
6
+      </a>
7
+      <span v-if="type === 1" :class="data.BorrowStatus=='0'?'active':''">{{myBookStatus}}</span>
8
+    </div>
9
+    <div class="flex-item">
10
+      <div>
11
+        <span>{{data.BookName}}</span>
12
+        <h5 v-if="!type">{{data.BookDescription}}</h5>
13
+        <div v-if="!type" class="flex-h" style="margin-top: .06rem;">
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>
16
+        </div>
17
+        <div v-if="!type" class="flex-h">
18
+          <span class="flex-item">{{data.Publisher}}</span>
19
+          <span>
20
+            剩余可借
21
+            <em>{{data.LeftNum}}</em>本
22
+          </span>
23
+        </div>
24
+        <div v-if="type === 1" class="flex-h" style="margin-top: .06rem;">
25
+          <span class="flex-item">应还时间:{{toolClass.dateFormat(data.EndDate, 'yyyy-MM-dd')}}</span>
26
+        </div>
27
+        <div v-if="type === 1" class="flex-h">
28
+          <span class="flex-item">{{data.CaseName}}</span>
29
+          <span v-if="data.BorrowStatus=='3' || data.BorrowStatus=='2'">已归还</span>
30
+          <span v-if="data.BorrowStatus == '1'">
31
+            已借阅
32
+            <em>{{borrowDay}}</em>天
33
+          </span>
34
+          <span v-if="data.BorrowStatus == '0'">
35
+            已逾期
36
+            <em>{{lateDay}}</em>天
37
+          </span>
38
+        </div>
39
+        <div v-if="type === 2" class="flex-h" style="margin-top: .06rem;">
40
+          <span class="flex-item">预约时间:{{toolClass.dateFormat(data.ReserveDate)}}</span>
41
+        </div>
42
+        <div v-if="type === 2" class="flex-h" style="margin-top: 0;">
43
+          <span
44
+            class="flex-item"
45
+          >预约资格将保留至:{{toolClass.dateFormat(data.ReserveEndDate, 'yyyy-MM-dd')}}</span>
46
+        </div>
47
+        <div v-if="type === 2" class="flex-h" style="margin-top: 0;">
48
+          <span class="flex-item">{{data.CaseName}}</span>
49
+        </div>
50
+      </div>
51
+    </div>
52
+  </div>
53
+</template>
54
+
55
+<script>
56
+import toolClass from '../../util/util'
57
+import { mapState } from 'vuex'
58
+
59
+export default {
60
+  name: '',
61
+  props: ['data', 'type', 'status'],
62
+  data () {
63
+    return {
64
+      defaultimg: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/book_default.png',
65
+    }
66
+  },
67
+  computed: {
68
+    ...mapState({
69
+      user: item => item.userCenter.userInfo.customer
70
+    }),
71
+    bookStatus () {
72
+      let status = '在线预约'
73
+      switch (this.status) {
74
+        case '4':
75
+          status = '已预约'
76
+          break
77
+        case '1':
78
+          status = '借阅中'
79
+          break
80
+        case '0':
81
+          status = '借阅中'
82
+          break
83
+      }
84
+      return status
85
+    },
86
+    myBookStatus () {
87
+      let status = ''
88
+      switch (this.data.BorrowStatus) {
89
+        case '4':
90
+          status = '已预约'
91
+          break
92
+        case '1':
93
+          status = '借阅中'
94
+          break
95
+        case '0':
96
+          status = '逾期未还'
97
+          break
98
+        case '3':
99
+          status = '逾期归还'
100
+          break
101
+        case '2':
102
+          status = '已归还'
103
+          break
104
+      }
105
+      return status
106
+    },
107
+    lateDay () {
108
+      const nowdata = toolClass.dateFormat(new Date(),'yyyy/MM/dd 00:00:00')
109
+      const EndDate = new Date(toolClass.dateFormat(new Date(this.data.EndDate),'yyyy/MM/dd 00:00:00'))
110
+      return toolClass.diffDate(EndDate, nowdata)
111
+    },
112
+    borrowDay () {
113
+      const nowdata = toolClass.dateFormat(new Date(),'yyyy/MM/dd 00:00:00')
114
+      const BorrowDate = new Date(toolClass.dateFormat(new Date(this.data.BorrowDate),'yyyy/MM/dd 00:00:00'))
115
+      return toolClass.diffDate(BorrowDate, nowdata)
116
+    }
117
+  },
118
+  components: {
119
+  },
120
+  created () {
121
+  },
122
+  methods: {
123
+    appointmentBook (id) {
124
+      if (this.status == '4' || this.status == '1' || this.status == '0') {
125
+        return
126
+      }
127
+      if (!this.user.Phone) {
128
+        this.$router.push({ name: 'bindMobile' })
129
+        return
130
+      }
131
+      this.$emit('appointmentBook', id)
132
+    },
133
+    itemClick (target) {
134
+      this.$emit('itemClick', target)
135
+    }
136
+  }
137
+}
138
+</script>
139
+
140
+<!-- Add "scoped" attribute to limit CSS to this component only -->
141
+<style lang="scss" scoped>
142
+.libraryListItem {
143
+  width: 100%;
144
+  position: relative;
145
+  overflow: visible;
146
+  align-items: center;
147
+  .img {
148
+    width: 0.78rem;
149
+    position: relative;
150
+    overflow: visible;
151
+    a {
152
+      width: 100%;
153
+      display: block;
154
+      height: 0;
155
+      position: relative;
156
+      overflow: hidden;
157
+      padding-bottom: 143.5%;
158
+      background: #eee;
159
+      border-radius: 0.03rem;
160
+      z-index: 1;
161
+    }
162
+    > span {
163
+      width: .7rem;
164
+      text-align: center;
165
+      display: inline-block;
166
+      position: absolute;
167
+      left: -0.1rem;
168
+      bottom: 0.2rem;
169
+      z-index: 2;
170
+      font-size: 0.12rem;
171
+      color: #fff;
172
+      background: #333;
173
+      line-height: 0.25rem;
174
+      border-radius: 0.25rem;
175
+      box-shadow: 0 0 .1rem .02rem rgba(0, 0, 0, .15);
176
+      &.active {
177
+        background: #fc5534;
178
+      }
179
+    }
180
+  }
181
+  > div.flex-item {
182
+    margin-left: 0.1rem;
183
+    > div {
184
+      width: 100%;
185
+      position: relative;
186
+      overflow: hidden;
187
+      > span {
188
+        width: 100%;
189
+        display: block;
190
+        line-height: 0.22rem;
191
+        font-size: 0.16rem;
192
+        overflow: hidden;
193
+        text-overflow: ellipsis;
194
+        display: -webkit-box;
195
+        -webkit-box-orient: vertical;
196
+        -webkit-line-clamp: 2;
197
+        max-height: 0.43rem;
198
+      }
199
+      > h5 {
200
+        font-size: 0.11rem;
201
+        color: #ccc;
202
+        line-height: 0.16rem;
203
+        font-weight: normal;
204
+        overflow: hidden;
205
+        text-overflow: ellipsis;
206
+        display: -webkit-box;
207
+        -webkit-box-orient: vertical;
208
+        -webkit-line-clamp: 2;
209
+        max-height: 0.31rem;
210
+      }
211
+      > div {
212
+        margin-top: 0.03rem;
213
+        align-items: center;
214
+        span {
215
+          line-height: 0.25rem;
216
+          font-size: 0.12rem;
217
+          color: #999;
218
+          white-space: nowrap;
219
+          em {
220
+            color: #fc5534;
221
+            font-size: 0.13rem;
222
+          }
223
+          &.status {
224
+            width: .7rem;
225
+            text-align: center;
226
+            font-size: 0.12rem;
227
+            color: #999;
228
+            background: #fff;
229
+            border: 1px solid #ccc;
230
+            border-radius: 0.25rem;
231
+            box-sizing: border-box;
232
+          }
233
+          &.status.active {
234
+            color: #fc674a;
235
+            background: #fcf3f3;
236
+            border: none;
237
+          }
238
+        }
239
+      }
240
+    }
241
+  }
242
+}
243
+</style>

+ 1
- 0
src/components/orderItem/page.scss Dosyayı Görüntüle

@@ -1,4 +1,5 @@
1 1
 .orderItem{
2
+  padding: .15rem 0;
2 3
   .img{
3 4
     width: .72rem;
4 5
     position: relative;

+ 101
- 0
src/components/preview/preview.vue Dosyayı Görüntüle

@@ -0,0 +1,101 @@
1
+<template>
2
+  <div>
3
+    <div class="topBanner">
4
+      <swiper :options="swiperOption" ref="mySwiper">
5
+        <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
6
+          <div class="item">
7
+            <img :src="item.CalendarImg">
8
+          </div>
9
+        </swiper-slide>
10
+      </swiper>
11
+      <div class="swiper-button-next">
12
+        <i class="iconfont icon-you"></i>
13
+      </div>
14
+      <div class="swiper-button-prev">
15
+        <i class="iconfont icon-left"></i>
16
+      </div>
17
+      <div class="swiper-pagination"></div>
18
+    </div>
19
+  </div>
20
+</template>
21
+
22
+<script>
23
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
24
+import 'swiper/dist/css/swiper.css'
25
+export default {
26
+  props: ['banner'],
27
+  data () {
28
+    const self = this
29
+    return {
30
+      mainIndex: 1,
31
+      swiperOption: {
32
+        observer: true,
33
+        speed: 1500,
34
+        navigation: {
35
+          nextEl: '.swiper-button-next',
36
+          prevEl: '.swiper-button-prev',
37
+        },
38
+        pagination: {
39
+          el: '.swiper-pagination',
40
+          type: 'fraction',
41
+        },
42
+        on: {
43
+          transitionStart: function () {
44
+            self.mainIndex = this.activeIndex + 1
45
+          }
46
+        }
47
+      },
48
+    }
49
+  },
50
+  components: {
51
+    swiper,
52
+    swiperSlide
53
+  },
54
+  computed: {
55
+    MySwiper () {
56
+      return this.$refs.mySwiper.swiper
57
+    }
58
+  },
59
+}
60
+</script>
61
+
62
+<style lang="scss" scoped>
63
+.topBanner {
64
+  width: 100%;
65
+  height: 100%;
66
+  background: #e9e9e9;
67
+  position: relative;
68
+  overflow: hidden;
69
+  .swiper-container {
70
+    width: 100%;
71
+    height: 100%;
72
+  }
73
+  .swiper-button-next,
74
+  .swiper-button-prev {
75
+    background-image: url();
76
+    outline: 0px;
77
+    text-align: center;
78
+    line-height: 0.44rem;
79
+  }
80
+  .swiper-cover {
81
+    z-index: 2;
82
+    position: absolute;
83
+    bottom: 0.1rem;
84
+    left: 50%;
85
+    transform: translateX(-50%);
86
+    font-size: 0.12rem;
87
+    color: #fc6243;
88
+  }
89
+  .item {
90
+    position: relative;
91
+    height: 100%;
92
+    img {
93
+      width: 2.8rem;
94
+      position: absolute;
95
+      top: 50%;
96
+      left: 50%;
97
+      transform: translate(-50%, -50%);
98
+    }
99
+  }
100
+}
101
+</style>

+ 68
- 0
src/components/radio/index.vue Dosyayı Görüntüle

@@ -0,0 +1,68 @@
1
+<template>
2
+  <div class="radio">
3
+    <a v-for="(item,index) in data" :key="index" :class="{'active': item.id === value}" @click="cut(item)">{{item.value}}</a>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: '',
10
+  props: ['data', 'value', 'disabled'],
11
+  data () {
12
+    return {
13
+    }
14
+  },
15
+  created () {
16
+  },
17
+  methods: {
18
+    cut (item) {
19
+      if (!this.disabled) {
20
+        this.$emit('input', item.id)
21
+      }
22
+    }
23
+  }
24
+}
25
+</script>
26
+
27
+<!-- Add "scoped" attribute to limit CSS to this component only -->
28
+<style lang="scss" scoped>
29
+.radio {
30
+  font-size: 0;
31
+  white-space: nowrap;
32
+  > * {
33
+    display: block;
34
+    font-size: 0.15rem;
35
+    position: relative;
36
+    padding-left: 0.25rem;
37
+    color: #a1a1a1;
38
+    margin-left: 0.5rem;
39
+    line-height: .3rem;
40
+    &::after {
41
+      content: "";
42
+      width: 0.14rem;
43
+      height: 0.14rem;
44
+      position: absolute;
45
+      left: 0;
46
+      top: 50%;
47
+      transform: translateY(-50%);
48
+      -webkit-transform: translateY(-50%);
49
+      border-radius: 100%;
50
+      border: 0.01rem solid #fc6243;
51
+      z-index: 1;
52
+    }
53
+    &.active::before {
54
+      content: "";
55
+      width: 0.08rem;
56
+      height: 0.08rem;
57
+      position: absolute;
58
+      left: 0.04rem;
59
+      top: 50%;
60
+      transform: translateY(-50%);
61
+      -webkit-transform: translateY(-50%);
62
+      border-radius: 100%;
63
+      background: #fc6243;
64
+      z-index: 2;
65
+    }
66
+  }
67
+}
68
+</style>

+ 180
- 0
src/components/slideTabH/index.vue Dosyayı Görüntüle

@@ -0,0 +1,180 @@
1
+<template>
2
+  <div class="components flex-v">
3
+    <div class="tabNav flex-h" :style="{backgroundColor: backgroundColor || '#fff'}">
4
+      <a
5
+        class="flex-item"
6
+        v-for="(item, index) in data"
7
+        :key="index"
8
+        @click="cutNav(index)"
9
+        :style="{fontSize: fontSize + 'px', fontWeight: index === activeIndex ? 'bolder' : 'normal'}"
10
+      >{{item.value}}</a>
11
+      <div class="activeLine" id="activeLine"></div>
12
+    </div>
13
+    <div class="flex-item">
14
+      <div>
15
+        <swiper :options="swiperOption" ref="mySwiper">
16
+          <swiper-slide class="swiper-slide" v-for="(item, index) in data" :key="index">
17
+            <slot :name="'slideTabH-' + item.id"></slot>
18
+          </swiper-slide>
19
+        </swiper>
20
+      </div>
21
+    </div>
22
+  </div>
23
+</template>
24
+
25
+<script>
26
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
27
+import 'swiper/dist/css/swiper.css'
28
+export default {
29
+  name: 'slideTabH',
30
+  props: ['data', 'fontSize', 'activeColor', 'normalColor', 'backgroundColor', 'initIndex'],
31
+  data () {
32
+    var _self = this
33
+    return {
34
+      leftArr: [],
35
+      widthArr: [],
36
+      activeWidth: 0,
37
+      activeIndex: 0,
38
+      stepNum: 120,
39
+      swiperOption: {
40
+        watchSlidesProgress: true,
41
+        initialSlide: _self.activeIndex,
42
+        on: {
43
+          init () {
44
+            document.getElementById('activeLine').style.width = _self.widthArr[_self.activeIndex * _self.stepNum] + 'px'
45
+            document.getElementById('activeLine').style.left = _self.leftArr[_self.activeIndex * _self.stepNum] + 'px'
46
+          },
47
+          setTranslate (translate) { // 滑动偏移量监听
48
+            var num = (-translate / document.body.clientWidth * _self.stepNum).toFixed(0)
49
+            if (num >= 0 && num <= (_self.data.length - 1) * _self.stepNum) {
50
+              document.getElementById('activeLine').style.width = _self.widthArr[num] + 'px'
51
+              document.getElementById('activeLine').style.left = _self.leftArr[num] + 'px'
52
+            }
53
+          },
54
+          touchStart () {
55
+            document.getElementById('activeLine').style.transition = ''
56
+            document.getElementById('activeLine').style.WebkitTransition = ''
57
+          },
58
+          touchEnd () {
59
+            document.getElementById('activeLine').style.transition = '300ms'
60
+            document.getElementById('activeLine').style.WebkitTransition = '300ms'
61
+            if (this.realIndex !== _self.activeIndex) {
62
+              document.getElementById('activeLine').style.width = (_self.widthArr[this.realIndex * _self.stepNum]) + 'px'
63
+              document.getElementById('activeLine').style.left = (_self.leftArr[this.realIndex * _self.stepNum]) + 'px'
64
+            }
65
+          },
66
+          setTransition (speed) {
67
+            if (this.realIndex !== _self.activeIndex) {
68
+              document.getElementById('activeLine').style.width = (_self.widthArr[this.realIndex * _self.stepNum]) + 'px'
69
+              document.getElementById('activeLine').style.left = (_self.leftArr[this.realIndex * _self.stepNum]) + 'px'
70
+            }
71
+          },
72
+          transitionEnd () {
73
+            _self.activeIndex = this.activeIndex
74
+            _self.$emit('slideChange', this.activeIndex)
75
+          }
76
+        }
77
+      }
78
+    }
79
+  },
80
+  computed: {
81
+    MySwiper () {
82
+      return this.$refs.mySwiper.swiper
83
+    }
84
+  },
85
+  components: {
86
+    swiper,
87
+    swiperSlide
88
+  },
89
+  created () {
90
+    this.activeIndex = this.initIndex || 0
91
+    var aLeft = (document.body.clientWidth / this.data.length).toFixed(0)
92
+    this.data.map((item, index) => {
93
+      this.widthArr.push((item.value.length / 2).toFixed(2) * (this.fontSize || 15))
94
+      this.leftArr.push((aLeft * index - 0) + ((aLeft / 2).toFixed(0) - 0) - this.widthArr[index] / 2)
95
+    })
96
+    this.activeWidth = this.widthArr[this.activeIndex]
97
+    this.widthArr = this.calcArr(this.widthArr, this.stepNum)
98
+    this.leftArr = this.calcArr(this.leftArr, this.stepNum)
99
+  },
100
+  mounted () {
101
+    this.$nextTick(() => {
102
+    })
103
+  },
104
+  methods: {
105
+    cutNav (index) { // 切换nav
106
+      document.getElementById('activeLine').style.transition = '300ms'
107
+      document.getElementById('activeLine').style.WebkitTransition = '300ms'
108
+      this.MySwiper.slideTo(index, 0, false)
109
+    },
110
+    calcArr (arr, num) { // 构造间隔数组:arr-原数组;num-间隔数
111
+      arr = arr || []
112
+      num = num || 20
113
+      var aArr = []
114
+      arr.map((item, index) => {
115
+        if (index < arr.length - 1) {
116
+          aArr.push([])
117
+          for (var n = 0; n < num; n++) {
118
+            aArr[index].push(item + (arr[index + 1] - item) * (n + 1) / num)
119
+          }
120
+        }
121
+      })
122
+      return [arr[0]].concat(...aArr)
123
+    }
124
+  }
125
+}
126
+</script>
127
+
128
+<!-- Add "scoped" attribute to limit CSS to this component only -->
129
+<style lang="scss" scoped>
130
+.components {
131
+  width: 100%;
132
+  height: 100%;
133
+  position: relative;
134
+  overflow: hidden;
135
+  .tabNav {
136
+    background: #fff;
137
+    position: relative;
138
+    overflow: visible;
139
+    box-shadow: 0 0 0.1rem 0.02rem rgba(0, 0, 0, 0.05);
140
+    z-index: 100;
141
+    > a {
142
+      line-height: 0.45rem;
143
+      text-align: center;
144
+      color: #333;
145
+      position: relative;
146
+      z-index: 1001;
147
+      background: #fff;
148
+    }
149
+    .activeLine {
150
+      height: 0.02rem;
151
+      background: #fc6243;
152
+      position: absolute;
153
+      left: 0;
154
+      bottom: -.02rem;
155
+      z-index: 1000;
156
+      box-shadow: 0 0 .1rem .01rem rgba(252, 98, 67, 0.9);
157
+    }
158
+  }
159
+  > .flex-item {
160
+    position: relative;
161
+    > div {
162
+      width: 100%;
163
+      position: absolute;
164
+      left: 0;
165
+      bottom: 0;
166
+      top: 0;
167
+      overflow: hidden;
168
+      > div {
169
+        width: 100%;
170
+        height: 100%;
171
+      }
172
+    }
173
+  }
174
+  .swiper-slide {
175
+    background: #f8f8f8;
176
+    position: relative;
177
+    z-index: 1;
178
+  }
179
+}
180
+</style>

+ 272
- 0
src/components/vue-load-more/index.vue Dosyayı Görüntüle

@@ -0,0 +1,272 @@
1
+<template>
2
+  <div
3
+    class="yo-scroll"
4
+    :class="{'down':(state===0),'up':(state==1),refresh:(state===2),touch:touching}"
5
+    @touchstart="touchStart($event)"
6
+    @touchmove="touchMove($event)"
7
+    @touchend="touchEnd($event)"
8
+  >
9
+    <section class="inner" :style="{ transform: 'translate3d(0, 0px, 0)' }">
10
+      <header class="pull-refresh">
11
+        <!-- <slot name="pull-refresh">
12
+          <span class="down-tip">下拉更新</span>
13
+          <span class="up-tip">松开刷新数据</span>
14
+          <span class="refresh-tip">加载中……</span>
15
+        </slot>-->
16
+      </header>
17
+      <slot></slot>
18
+      <footer class="load-more" v-show="!dataList.noFlag">
19
+        <slot name="load-more">
20
+          <span v-show="downFlag === false">上拉加载更多</span>
21
+          <span v-show="downFlag === true">加载中……</span>
22
+        </slot>
23
+      </footer>
24
+      <!-- <div class="nullData" v-show="dataList.noFlag">暂无更多数据</div> -->
25
+    </section>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+export default {
31
+  props: {
32
+    offset: { // 默认高度
33
+      type: Number,
34
+      default: 100
35
+    },
36
+    enableInfinite: { // 上拉加载
37
+      type: Boolean,
38
+      default: true
39
+    },
40
+    enableRefresh: { // 下拉刷新
41
+      type: Boolean,
42
+      default: false
43
+    },
44
+    dataList: { // 数据列表
45
+      default: undefined,
46
+      required: false
47
+    },
48
+    onRefresh: { // 加载方法
49
+      type: Function,
50
+      default: undefined,
51
+      required: false
52
+    },
53
+    onInfinite: { // 刷新方法
54
+      type: Function,
55
+      default: undefined,
56
+      require: false
57
+    }
58
+  },
59
+  data () {
60
+    return {
61
+      top: 0,
62
+      state: 0,
63
+      startX: 0,
64
+      startY: 0,
65
+      touching: false,
66
+      infiniteLoading: false,
67
+      downFlag: false // 用来显示是否加载中
68
+    }
69
+  },
70
+  created () { },
71
+  methods: {
72
+    touchStart (e) {
73
+      this.startY = e.targetTouches[0].pageY
74
+      this.startX = e.targetTouches[0].pageX
75
+      this.startScroll = this.$el.scrollTop || 0
76
+      this.touching = true // 留着有用,不能删除
77
+
78
+      // this.dataList.noFlag = false
79
+      // this.$el.querySelector('.load-more').style.display = 'block'
80
+    },
81
+    touchMove (e) {
82
+      if (this.dataList.noFlag || !this.touching) {
83
+        return
84
+      }
85
+      let diff = e.targetTouches[0].pageY - this.startY - this.startScroll
86
+      if (diff > 0) e.preventDefault()
87
+      this.top = Math.pow(diff, 0.8) + (this.state === 2 ? this.offset : 0)
88
+      if (this.state === 2) { // in refreshing
89
+        return
90
+      }
91
+      if (this.top >= this.offset) {
92
+        this.state = 1
93
+      } else {
94
+        this.state = 0
95
+      }
96
+
97
+      let more = this.$el.querySelector('.load-more')
98
+      if (!this.top && this.state === 0) {
99
+        more.style.display = 'block'
100
+      } else {
101
+        more.style.display = 'none'
102
+      }
103
+    },
104
+    touchEnd (e) {
105
+      // if (!this.enableRefresh) {
106
+      //   return
107
+      // }
108
+      this.touching = false
109
+      if (this.state === 2) { // in refreshing
110
+        this.state = 2
111
+        this.top = this.offset
112
+        return
113
+      }
114
+      if (this.top >= this.offset) { // do refresh
115
+        this.refresh()
116
+      } else { // cancel refresh
117
+        this.state = 0
118
+        this.top = 0
119
+      }
120
+
121
+      // 用于判断滑动是否在原地 ----begin
122
+      let endX = e.changedTouches[0].pageX
123
+      let endY = e.changedTouches[0].pageY
124
+      let dy = this.startY - endY
125
+      let dx = endX - this.startX
126
+      // 如果滑动距离太短
127
+      if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
128
+        // console.log("滑动距离太短")
129
+        this.downFlag = false
130
+        return
131
+      }
132
+      // --------end--------
133
+
134
+      // if (!this.enableInfinite || this.infiniteLoading) {
135
+      //   return
136
+      // }
137
+
138
+      if (this.dataList.noFlag) {
139
+        return
140
+      }
141
+
142
+      let outerHeight = this.$el.clientHeight
143
+      let innerHeight = this.$el.querySelector('.inner').clientHeight
144
+      let scrollTop = this.$el.scrollTop
145
+      let ptrHeight = this.onRefresh ? this.$el.querySelector('.pull-refresh').clientHeight : 0
146
+      let bottom = innerHeight - outerHeight - scrollTop - ptrHeight
147
+
148
+      // console.log(bottom + " __ " + this.offset)
149
+
150
+      if (bottom <= this.offset && this.state === 0) {
151
+        this.downFlag = true
152
+        this.infinite()
153
+      } else {
154
+        this.$el.querySelector('.load-more').style.display = 'none'
155
+        this.downFlag = false
156
+      }
157
+    },
158
+    refresh () {
159
+      this.state = 2
160
+      this.top = this.offset
161
+      setTimeout(() => {
162
+        this.onRefresh(this.refreshDone)
163
+      }, 1000)
164
+    },
165
+    refreshDone () {
166
+      this.state = 0
167
+      this.top = 0
168
+    },
169
+
170
+    infinite () {
171
+      this.infiniteLoading = true
172
+
173
+      setTimeout(() => {
174
+        this.onInfinite(this.infiniteDone)
175
+      }, 2000)
176
+    },
177
+
178
+    infiniteDone () {
179
+      this.infiniteLoading = false
180
+      this.downFlag = false
181
+    }
182
+  }
183
+}
184
+</script>
185
+
186
+<style lang="scss" scoped>
187
+.yo-scroll {
188
+  font-size: 0.24rem;
189
+  position: absolute;
190
+  top: 0;
191
+  right: 0;
192
+  bottom: 0;
193
+  left: 0;
194
+  overflow: auto;
195
+  z-index: 100;
196
+  height: auto;
197
+  -webkit-overflow-scrolling: touch;
198
+  .inner {
199
+    position: absolute;
200
+    top: -0.5rem;
201
+    width: 100%;
202
+    height: auto;
203
+    transition-duration: 300ms;
204
+    .pull-refresh {
205
+      position: relative;
206
+      left: 0;
207
+      top: 0;
208
+      width: 100%;
209
+      height: 0.5rem;
210
+      display: flex;
211
+      display: -webkit-flex;
212
+      align-items: center;
213
+      justify-content: center;
214
+    }
215
+    .load-more {
216
+      height: 0.5rem;
217
+      line-height: 0.5rem;
218
+      display: flex;
219
+      text-align: center;
220
+      align-items: center;
221
+      justify-content: center;
222
+      display: none;
223
+    }
224
+    .nullData {
225
+      // 暂无更多数据样式
226
+      font-size: 0.13rem;
227
+      color: #999999;
228
+      height: 0.5rem;
229
+      line-height: 0.5rem;
230
+      text-align: center;
231
+    }
232
+    .down-tip,
233
+    .refresh-tip,
234
+    .up-tip {
235
+      display: none;
236
+    }
237
+    .up-tip:before,
238
+    .refresh-tip:before {
239
+      content: '';
240
+      display: inline-block;
241
+      width: 1.6rem;
242
+      height: 0.7rem;
243
+      background-size: 70% !important;
244
+      position: absolute;
245
+      top: 0;
246
+      left: 20%;
247
+    }
248
+    // .up-tip:before {
249
+    //   background: url(./loading.gif) no-repeat center;
250
+    // }
251
+    // .refresh-tip:before {
252
+    //   background: url(./loading.gif) no-repeat center;
253
+    // }
254
+  }
255
+}
256
+
257
+.yo-scroll.touch .inner {
258
+  transition-duration: 0;
259
+}
260
+
261
+.yo-scroll.down .down-tip {
262
+  display: block;
263
+}
264
+
265
+.yo-scroll.up .up-tip {
266
+  display: block;
267
+}
268
+
269
+.yo-scroll.refresh .refresh-tip {
270
+  display: block;
271
+}
272
+</style>

BIN
src/components/vue-load-more/loading.gif Dosyayı Görüntüle


+ 1
- 1
src/pages/bodyCheck/app.js Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import Vue from 'vue'
2 2
 import App from './App.vue'
3 3
 import Vant from 'vant'
4
-import 'vant/lib/vant-css/index.css'
4
+import 'vant/lib/index.css'
5 5
 import router from './router'
6 6
 import store from '../../store/index'
7 7
 import Vuex from 'vuex'

+ 1
- 1
src/pages/sales/app.js Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import Vue from 'vue'
2 2
 import App from './App.vue'
3 3
 import Vant from 'vant'
4
-import 'vant/lib/vant-css/index.css'
4
+import 'vant/lib/index.css'
5 5
 import router from './router'
6 6
 import store from '../../store/index'
7 7
 import Vuex from 'vuex'

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

@@ -12,7 +12,7 @@ export default {
12 12
   name: 'app',
13 13
   data () {
14 14
     return {
15
-      showPage: false
15
+      showPage: false 
16 16
     }
17 17
   },
18 18
   components: {},

+ 62
- 0
src/pages/user/activeList/activeList.vue Dosyayı Görüntüle

@@ -0,0 +1,62 @@
1
+<template>
2
+  <div class="content mainPage">
3
+    <div class="list" @click="toCustomizationList">
4
+      <img :src="dz">
5
+      <span>定制记录</span>
6
+      <i class="iconfont icon-you"></i>
7
+    </div>
8
+  </div>
9
+</template>
10
+
11
+<script>
12
+import dz from '@/common/icon/dz.jpg'
13
+export default {
14
+  data () {
15
+    return {
16
+      dz
17
+    }
18
+  },
19
+  methods: {
20
+    toCustomizationList () {
21
+      this.$router.push({ name: 'customizationList' })
22
+    }
23
+  }
24
+}
25
+</script>
26
+
27
+<style lang="scss" scoped>
28
+.content {
29
+  padding: 0 0 0 0.1rem;
30
+  background: #fff;
31
+  height: 100%;
32
+  box-sizing: border-box;
33
+  .list {
34
+    width: 100%;
35
+    height: 0.8rem;
36
+    display: flex;
37
+    align-items: center;
38
+    padding: 0.05rem;
39
+    box-sizing: border-box;
40
+    border-bottom: 1px solid #f1f1f1;
41
+    img {
42
+      width: 0.88rem;
43
+      height: 0.54rem;
44
+      border-radius: 0.07rem;
45
+      object-fit: cover;
46
+    }
47
+    span {
48
+      flex: 1;
49
+      padding-left: 0.1rem;
50
+      overflow: hidden;
51
+      text-overflow: ellipsis;
52
+      white-space: nowrap;
53
+      font-size: 0.14rem;
54
+      color: #000;
55
+    }
56
+    i {
57
+      color: #ddd;
58
+      padding-right: 0.1rem;
59
+    }
60
+  }
61
+}
62
+</style>

+ 1
- 1
src/pages/user/app.js Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import Vue from 'vue'
2 2
 import App from './App.vue'
3 3
 import Vant from 'vant'
4
-import 'vant/lib/vant-css/index.css'
4
+import 'vant/lib/index.css'
5 5
 import router from './router'
6 6
 import store from '../../store/index'
7 7
 import Vuex from 'vuex'

+ 26
- 17
src/pages/user/bindMobile/bindMobile.vue Dosyayı Görüntüle

@@ -20,10 +20,14 @@
20 20
             <span>{{salesName}}</span>
21 21
             <i class="iconfont icon-triangle-bottom"></i>
22 22
           </div>
23
-        </div> -->
24
-
23
+        </div>-->
25 24
         <div class="mobile">
26 25
           <i class="iconfont icon-zhanghu"></i>
26
+          <input placeholder="真实姓名" v-model="postData.name">
27
+        </div>
28
+
29
+        <div class="mobile">
30
+          <i class="iconfont icon-mima"></i>
27 31
           <input type="tel" placeholder="推荐码 (非必填)" v-model="postData.recommendCode">
28 32
         </div>
29 33
 
@@ -61,7 +65,7 @@
61 65
             @confirm="onConfirmS"
62 66
           />
63 67
         </div>
64
-      </transition> -->
68
+      </transition>-->
65 69
     </div>
66 70
   </div>
67 71
 </template>
@@ -83,6 +87,7 @@ export default {
83 87
       seconds: 61,
84 88
       postData: {
85 89
         phone: '',
90
+        name: '',
86 91
         // case: '',
87 92
         // sales: '',
88 93
         recommendCode: '',
@@ -93,7 +98,8 @@ export default {
93 98
   },
94 99
   computed: {
95 100
     ...mapState({
96
-      caseInfo: x => x.userCenter.caseInfo
101
+      caseInfo: x => x.userCenter.caseInfo,
102
+      org: x => x.app.orgId,
97 103
     })
98 104
   },
99 105
   created () {
@@ -103,10 +109,7 @@ export default {
103 109
     console.log(1123)
104 110
   },
105 111
   methods: {
106
-    ...actions(['getCaseInfo']),
107
-    ...actions(['getCaptcha']),
108
-    ...actions(['submitData']),
109
-    ...actions(['recommendCode']),
112
+    ...actions(['getCaseInfo', 'getCaptcha', 'submitData', 'recommendCode', 'getUserInfo']),
110 113
     // onConfirmC (value, index) {
111 114
     //   this.caseName = value.CaseName
112 115
     //   this.postData.case = value.CaseId
@@ -196,6 +199,11 @@ export default {
196 199
         this.canSubmit = true
197 200
         return
198 201
       }
202
+      if (!this.postData.name) {
203
+        this.$toast('请填真实姓名')
204
+        this.canSubmit = true
205
+        return
206
+      }
199 207
       if (this.postData.recommendCode) {
200 208
         this.recommendCode({ recommendCode: this.postData.recommendCode }).then((res) => {
201 209
           if (res) {
@@ -206,13 +214,13 @@ export default {
206 214
                   window.location.href = `${window.location.origin}/game/luckdraw/${from}`
207 215
                 }, 2000)
208 216
               } else {
209
-                setTimeout(() => {
210
-                  // this.$router.push({name: 'userCenter'})
211
-                  window.history.go(-1)
212
-                }, 2000)
217
+                this.getUserInfo({ org: this.org }).then(() => {
218
+                  setTimeout(() => {
219
+                    window.history.go(-1)
220
+                  }, 2000)
221
+                })
213 222
               }
214 223
             }).catch(() => {
215
-              console.log(111)
216 224
               this.canSubmit = true
217 225
             })
218 226
           } else {
@@ -229,10 +237,11 @@ export default {
229 237
               window.location.href = `${window.location.origin}/game/luckdraw/${from}`
230 238
             }, 2000)
231 239
           } else {
232
-            setTimeout(() => {
233
-              // this.$router.push({name: 'userCenter'})
234
-              window.history.go(-1)
235
-            }, 2000)
240
+            this.getUserInfo({ org: this.org }).then(() => {
241
+              setTimeout(() => {
242
+                window.history.go(-1)
243
+              }, 2000)
244
+            })
236 245
           }
237 246
         }).catch(() => {
238 247
           console.log(111)

+ 2
- 2
src/pages/user/bindMobile/page.scss Dosyayı Görüntüle

@@ -10,7 +10,6 @@
10 10
     height: 100%;
11 11
     display: flex;
12 12
     justify-content: center;
13
-    align-items: center;
14 13
     // background: rgba(0,0,0,0.3);
15 14
     position: relative;
16 15
     .logo{
@@ -27,11 +26,12 @@
27 26
     }
28 27
     .box{
29 28
       width: 3.25rem;
30
-      height: 3.5rem;
29
+      height: 4.2rem;
31 30
       background:rgba(255,255,255,1);
32 31
       border-radius:8px;
33 32
       padding: .2rem;
34 33
       box-sizing: border-box;
34
+      margin-top: 130px;
35 35
       .title{
36 36
         font-size: .16rem;
37 37
         font-weight: bold;

+ 151
- 0
src/pages/user/calendar/calendar.vue Dosyayı Görüntüle

@@ -0,0 +1,151 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="top">
4
+      <img :src="topImg" alt>
5
+    </div>
6
+    <div class="middle">
7
+      <p>云台天境 定制您的2019专属台历</p>
8
+      <span>时间: 2018年12月11日-2018年12月18日</span>
9
+      <span>地点: 江宁区云台山河路1号云台天境售楼处</span>
10
+    </div>
11
+    <div class="bottom">
12
+      <p class="title">活动详情</p>
13
+      <div>用户在线上传照片(最少3张)生成2019年台历,可通过填写邮箱,获得电子版台历(1个工作日内)。</div>
14
+      <div>前200名上传成功用户,可在关注【城的空间】公众号接到推送或接到短信通知后来云台天境售楼处领取精美实物台历一份。</div>
15
+      <div>活动电话:025-86426666</div>
16
+      <div>服务案场:银城旭辉云台天境</div>
17
+      <div>地址:江宁区云台山河路1号云台天境售楼处</div>
18
+      <div>*活动最终解释权归南京佳运城房地产开发有限公司所有</div>
19
+    </div>
20
+    <div class="btn">
21
+      <div v-if="state === 1" class="disable">活动未开始</div>
22
+      <div v-if="state === 2" @click="toCheckModel">立即参与</div>
23
+      <div v-if="state === 3" class="disable">已参与</div>
24
+      <div v-if="state === 4" class="disable">活动已结束</div>
25
+    </div>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+import wxsdk from '../../../util/share'
31
+import { mapState, createNamespacedHelpers } from 'vuex'
32
+const { mapActions: mapMakingActions } = createNamespacedHelpers('making')
33
+const { mapActions: actions } = createNamespacedHelpers('userCenter')
34
+import topImg from '@/common/icon/topImgBlack.png'
35
+export default {
36
+  data () {
37
+    return {
38
+      topImg,
39
+      state: 1,
40
+      startTime: "2018/12/11 00:00:00",
41
+      endTime: "2018/12/18 23:59:59"
42
+    }
43
+  },
44
+  created () {
45
+    wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
46
+      title: '幸福升舱 云帆起航',
47
+      desc: '有一份2019年的台历待您查收!',
48
+      link: `${window.location.origin}${window.location.pathname}#/calendar`,
49
+      thu_image: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/DE4F9402-9449-48fc-8C0D-61C198E82E481543982444.png'
50
+    })
51
+    this.getUserInfo({ org: this.org }).then(() => {
52
+      this.getCalendarCustomer().then((res) => {
53
+        if (res) {
54
+          this.state = 3
55
+        } else {
56
+          let start = new Date(this.startTime).getTime()
57
+          let end = new Date(this.endTime).getTime()
58
+          let now = new Date().getTime()
59
+          if (start <= now && end >= now) {
60
+            this.state = 2
61
+          } else if (start > now) {
62
+            this.state = 1
63
+          } else {
64
+            this.state = 4
65
+          }
66
+        }
67
+      })
68
+    })
69
+  },
70
+  computed: {
71
+    ...mapState({
72
+      org: x => x.app.orgId,
73
+      userInfo: x => x.userCenter.userInfo
74
+    })
75
+  },
76
+  methods: {
77
+    ...actions(['getUserInfo']),
78
+    ...mapMakingActions(['getCalendarCustomer']),
79
+    toCheckModel () {
80
+      if (!this.userInfo.customer.Phone) {
81
+        this.$dialog.confirm({
82
+          title: '提示',
83
+          message: '您还不是注册会员,注册成功后即可参与此活动'
84
+        }).then(() => {
85
+          // on confirm
86
+          this.$router.push({ name: 'bindMobile' })
87
+        }).catch(() => {
88
+          // on cancel
89
+        });
90
+      } else {
91
+        this.$router.push({ name: 'checkModel' })
92
+      }
93
+    }
94
+  }
95
+}
96
+</script>
97
+ 
98
+<style lang="scss" scoped>
99
+.top {
100
+  width: 100%;
101
+  img {
102
+    width: 100%;
103
+  }
104
+}
105
+.middle {
106
+  padding: 0.14rem 0.25rem;
107
+  border-bottom: 0.1rem solid rgba(235, 241, 242, 1);
108
+  p {
109
+    font-size: 0.16rem;
110
+    padding-bottom: 0.05rem;
111
+    font-weight: bold;
112
+  }
113
+  span {
114
+    padding-bottom: 0.05rem;
115
+    display: block;
116
+  }
117
+}
118
+.bottom {
119
+  padding: 0.14rem 0.25rem 0.6rem;
120
+  p {
121
+    font-size: 0.16rem;
122
+    padding-bottom: 0.05rem;
123
+    font-weight: bold;
124
+  }
125
+  div {
126
+    padding-bottom: 0.08rem;
127
+  }
128
+}
129
+.btn {
130
+  position: fixed;
131
+  bottom: 0;
132
+  left: 0;
133
+  width: 100%;
134
+  padding: 0.1rem 0.25rem;
135
+  box-sizing: border-box;
136
+  background: #fff;
137
+  div {
138
+    width: 100%;
139
+    height: 0.4rem;
140
+    border-radius: 0.2rem;
141
+    background-color: rgba(252, 98, 67, 1);
142
+    color: #fff;
143
+    text-align: center;
144
+    line-height: 0.4rem;
145
+  }
146
+  .disable {
147
+    background: #ccc;
148
+  }
149
+}
150
+</style>
151
+ 

+ 96
- 0
src/pages/user/calendar/checkModel.vue Dosyayı Görüntüle

@@ -0,0 +1,96 @@
1
+<template>
2
+  <div class="content">
3
+    <div @click="checkModel(1)">
4
+      <img :src="coverBlack">
5
+      <p>主题一 (黑色)</p>
6
+      <div>
7
+        <img v-if="check === 1" :src="checked" alt>
8
+        <img v-if="check === 2" :src="unchecked" alt>
9
+      </div>
10
+    </div>
11
+    <div @click="checkModel(2)">
12
+      <img :src="coverRed">
13
+      <p>主题二 (红色)</p>
14
+      <div>
15
+        <img v-if="check === 2" :src="checked" alt>
16
+        <img v-if="check === 1" :src="unchecked" alt>
17
+      </div>
18
+    </div>
19
+    <span class="btn" @click="submit">确定</span>
20
+  </div>
21
+</template>
22
+
23
+<script>
24
+import coverBlack from '@/common/icon/coverBlack.jpg'
25
+import coverRed from '@/common/icon/coverRed.jpg'
26
+import checked from '@/common/icon/checked.png'
27
+import unchecked from '@/common/icon/unchecked.png'
28
+export default {
29
+  data () {
30
+    return {
31
+      coverBlack,
32
+      coverRed,
33
+      unchecked,
34
+      checked,
35
+      check: 1
36
+    }
37
+  },
38
+  methods: {
39
+    checkModel (type) {
40
+      this.check = type
41
+    },
42
+    submit () {
43
+      this.$router.push({ name: 'making', query: { type: this.check } })
44
+    }
45
+  }
46
+}
47
+</script>
48
+
49
+<style lang="scss" scoped>
50
+.content {
51
+  display: flex;
52
+  height: 100%;
53
+  align-items: center;
54
+  > div {
55
+    flex: 1;
56
+    padding: 0.12rem;
57
+    box-sizing: border-box;
58
+    position: relative;
59
+    > img {
60
+      width: 100%;
61
+    }
62
+    p{
63
+      font-size: .14rem;
64
+      font-weight: bold;
65
+      text-align: center;
66
+      margin-top: .05rem;
67
+    }
68
+    div {
69
+      position: absolute;
70
+      right: 0.2rem;
71
+      top: 0.2rem;
72
+      width: 0.3rem;
73
+      height: 0.3rem;
74
+      img {
75
+        width: 100%;
76
+        height: 100%;
77
+      }
78
+    }
79
+  }
80
+  .btn {
81
+    display: block;
82
+    position: fixed;
83
+    width: 3rem;
84
+    height: 0.4rem;
85
+    bottom: 0.2rem;
86
+    left: 50%;
87
+    transform: translateX(-50%);
88
+    text-align: center;
89
+    line-height: 0.4rem;
90
+    font-size: 0.16rem;
91
+    color: #fff;
92
+    background-color: #fc6243;
93
+    border-radius: 0.2rem;
94
+  }
95
+}
96
+</style>

+ 697
- 0
src/pages/user/calendar/making.vue Dosyayı Görüntüle

@@ -0,0 +1,697 @@
1
+<template>
2
+  <div style="background:#fff;" class="mainPage" id="main">
3
+    <div>
4
+      <div v-if="isLoading || windowLoad" class="loading">
5
+        <img :src="loading" alt>
6
+        <span>{{msg}}</span>
7
+      </div>
8
+      <div class="cutBox" v-for="(item,index) in banner" :key="index">
9
+        <div class="cutDom" v-if="index === mainIndex-1">
10
+          <img :src="item.bgImg" class="cover">
11
+          <div :style="item.styleCut" v-show="!item.CustomerImg && item.defaultBg" class="cla">
12
+            <img :src="item.defaultBg">
13
+          </div>
14
+          <div :style="item.styleCut" v-if="item.CustomerImg" class="cla">
15
+            <img :src="item.CustomerImg">
16
+          </div>
17
+          <img class="text-h" v-if="item.ImgName === '10月'" :src="textH">
18
+          <img class="text-l" v-if="item.ImgName === '4月' || item.ImgName === '7月'" :src="textL">
19
+        </div>
20
+      </div>
21
+      <div class="topBanner">
22
+        <swiper :options="swiperOption" ref="mySwiper">
23
+          <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
24
+            <div
25
+              class="item"
26
+              v-if="index === mainIndex-1 || index === mainIndex ||  index === mainIndex-2"
27
+            >
28
+              <div>
29
+                <img :src="item.bgImg" class="cover">
30
+                <img
31
+                  :style="item.style"
32
+                  v-if="!item.CustomerImg && item.defaultBg"
33
+                  :src="item.defaultBg"
34
+                >
35
+                <img :src="item.CustomerImg" :style="item.style" v-if="item.CustomerImg">
36
+                <img class="text-h" v-if="item.ImgName === '10月'" :src="textH">
37
+                <img
38
+                  class="text-l"
39
+                  v-if="item.ImgName === '4月' || item.ImgName === '7月'"
40
+                  :src="textL"
41
+                >
42
+                <div class="reload-img">
43
+                  <van-uploader :after-read="onRead" v-show="mainIndex !== 1">
44
+                    <img :src="reloadImg">
45
+                  </van-uploader>
46
+                </div>
47
+              </div>
48
+            </div>
49
+          </swiper-slide>
50
+        </swiper>
51
+        <div class="swiper-button-next">
52
+          <i class="iconfont icon-you"></i>
53
+        </div>
54
+        <div class="swiper-button-prev">
55
+          <i class="iconfont icon-left"></i>
56
+        </div>
57
+        <div class="swiper-pagination"></div>
58
+      </div>
59
+      <div class="meassage" v-if="mainIndex !== 1">备注:为了美观效果请上传{{size}}尺寸照片,未按尺寸会默认裁剪</div>
60
+      <div class="meassage" v-else>左右滑动可上传自定义图片</div>
61
+      <div class="operation">
62
+        <div>
63
+          <van-uploader :after-read="onRead" v-show="mainIndex !== 1">
64
+            <img :src="uploadImg">
65
+            <p>自定义图片</p>
66
+          </van-uploader>
67
+        </div>
68
+        <div>
69
+          <img :src="reSet" v-show="mainIndex !== 1" @click="changeOld">
70
+          <p v-show="mainIndex !== 1">恢复默认</p>
71
+        </div>
72
+      </div>
73
+      <div class="email">
74
+        <span>邮箱</span>
75
+        <input
76
+          class="input"
77
+          type="text"
78
+          @blur="emailBlur"
79
+          placeholder="接收电子版"
80
+          v-model="email"
81
+          style="border-radius:5px;background:rgba(245, 246, 250, 1);"
82
+        >
83
+      </div>
84
+      <div class="btn">
85
+        <div @click="pre">预览</div>
86
+        <div @click="showPop=true">确定</div>
87
+      </div>
88
+      <div v-show="showPop" class="pop-box">
89
+        <div class="pop-content">
90
+          <div>确认定制此台历?</div>
91
+          <div>
92
+            <div @click="submit">确定</div>
93
+            <div @click="showPop=false">取消</div>
94
+          </div>
95
+        </div>
96
+      </div>
97
+    </div>
98
+  </div>
99
+</template>
100
+
101
+<script>
102
+import html2canvas from 'html2canvas'
103
+import canvas2image from '@/util/canvas2image.js'
104
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
105
+import 'swiper/dist/css/swiper.css'
106
+import { createNamespacedHelpers } from 'vuex'
107
+const { mapState: mapMakingState, mapActions: mapMakingActions } = createNamespacedHelpers('making')
108
+import textH from '@/common/icon/text-h.png'
109
+import textL from '@/common/icon/text-l.png'
110
+import uploadImg from '@/common/icon/uploadImg.png'
111
+import reloadImg from '@/common/icon/reloadImg.png'
112
+import reSet from '@/common/icon/reSet.png'
113
+import loading from '@/common/icon/loading-red.gif'
114
+
115
+export default {
116
+  data () {
117
+    const self = this
118
+    return {
119
+      textH,
120
+      textL,
121
+      uploadImg,
122
+      reSet,
123
+      reloadImg,
124
+      loading,
125
+      banner: [],
126
+      mainIndex: 1,
127
+      isLoading: false,
128
+      showPop: false,
129
+      imglength: 0,
130
+      msg: '请稍候...',
131
+      swiperOption: {
132
+        observer: false,
133
+        speed: 1500,
134
+        navigation: {
135
+          nextEl: '.swiper-button-next',
136
+          prevEl: '.swiper-button-prev',
137
+        },
138
+        pagination: {
139
+          el: '.swiper-pagination',
140
+          type: 'fraction',
141
+        },
142
+        on: {
143
+          transitionStart: function () {
144
+            self.mainIndex = this.activeIndex + 1
145
+            self.$nextTick(() => {
146
+              self.calSize()
147
+            })
148
+          }
149
+        }
150
+      }
151
+    }
152
+  },
153
+  components: {
154
+    swiper,
155
+    swiperSlide
156
+  },
157
+  computed: {
158
+    MySwiper () {
159
+      return this.$refs.mySwiper.swiper
160
+    },
161
+    ...mapMakingState({
162
+      bannerBlack: item => item.bannerBlack,
163
+      bannerRed: item => item.bannerRed,
164
+      Email: item => item.email
165
+    }),
166
+    size () {
167
+      if (this.mainIndex === 2 || this.mainIndex === 5 || this.mainIndex === 8 || this.mainIndex === 11) {
168
+        return '横'
169
+      } else {
170
+        return '竖'
171
+      }
172
+    },
173
+    email: {
174
+      get () {
175
+        console.log(this.Email)
176
+        return this.Email
177
+      },
178
+      set (val) {
179
+        this.setEmail(val)
180
+      }
181
+    }
182
+  },
183
+  created () {
184
+    if (this.$route.query.type == 1) {
185
+      this.banner = this.bannerBlack
186
+    } else {
187
+      this.banner = this.bannerRed
188
+    }
189
+  },
190
+  methods: {
191
+    ...mapMakingActions(['setBanner', 'calendar', 'setEmail']),
192
+    upload (url) {
193
+      this.banner[this.mainIndex - 1].CustomerImg = url + '?x-oss-process=style/calendar-thumb'
194
+      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) }).then(() => {
195
+        this.calSize().then(() => {
196
+          let cutDoms = document.getElementsByClassName('cutDom')[0]
197
+          this.convert2canvas(cutDoms, this.mainIndex - 1).then(() => {
198
+            this.isLoading = false
199
+          }).catch(() => {
200
+            this.isLoading = false
201
+          })
202
+        })
203
+      })
204
+    },
205
+    emailBlur () {
206
+      var currentPosition, timer;
207
+      var speed = 1;//页面滚动距离
208
+      timer = setInterval(function () {
209
+        currentPosition = document.documentElement.scrollTop || document.body.scrollTop;
210
+        currentPosition -= speed;
211
+        window.scrollTo(0, currentPosition);//页面向上滚动
212
+        currentPosition += speed; //speed变量
213
+        window.scrollTo(0, currentPosition);//页面向下滚动
214
+        clearInterval(timer);
215
+      }, 1);
216
+    },
217
+    onRead (file) {
218
+      let that = this
219
+      this.isLoading = true
220
+      let reg = new RegExp("[`/?%#&=:\s\+]")
221
+      if (reg.test(file.file.name)) {
222
+        this.$toast('图片名称中包含非法字符')
223
+        this.isLoading = false
224
+        return
225
+      }
226
+      let reader = new FileReader();
227
+      reader.readAsDataURL(file.file);
228
+      reader.onload = function (e) {
229
+        let data = e.target.result;
230
+        //加载图片获取图片真实宽度和高度
231
+        let image = new Image();
232
+        image.src = data;
233
+        image.onload = function () {
234
+          let width = image.width;
235
+          let height = image.height;
236
+          // if (!/.(jpg|jpeg)$/.test(image.src)) {
237
+          //   that.isLoading = false
238
+          //   that.$toast('只允许JPG/JPEG格式的图片')
239
+          //   return
240
+          // }
241
+          if (width / height > 2.5) {
242
+            that.isLoading = false
243
+            that.$toast('该图片长度过长,请重新选择')
244
+            return
245
+          }
246
+          // this.banner[this.mainIndex - 1].CustomerImgShow = file.content
247
+          // this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) })
248
+          that.toolClass.upload(file).then((res) => {
249
+            that.upload(res.result.url)
250
+          }).catch(() => {
251
+            that.isLoading = false
252
+          })
253
+        };
254
+      };
255
+    },
256
+    changeOld () {
257
+      if (!this.banner[this.mainIndex - 1].CustomerImg) {
258
+        return
259
+      }
260
+      this.isLoading = true
261
+      this.banner[this.mainIndex - 1].CustomerImg = ''
262
+      // this.banner[this.mainIndex - 1].CustomerImgShow = ''
263
+      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) }).then(() => {
264
+        this.$nextTick(() => {
265
+          this.calSize().then(() => {
266
+            let cutDoms = document.getElementsByClassName('cutDom')[0]
267
+            this.convert2canvas(cutDoms, this.mainIndex - 1).then(() => {
268
+              this.isLoading = false
269
+            }).catch(() => {
270
+              this.isLoading = false
271
+            })
272
+          })
273
+        })
274
+      })
275
+    },
276
+    submit () {
277
+      this.showPop = false
278
+      if (!this.email) {
279
+        this.$toast('邮箱为必填项')
280
+        return
281
+      } else if (this.email.indexOf('@') <= -1) {
282
+        this.$toast('请输入正确的邮箱')
283
+        return
284
+      }
285
+      let data = JSON.parse(JSON.stringify(this.banner))
286
+      data.forEach((curr, index) => {
287
+        delete curr['bgImg']
288
+        delete curr['defaultBg']
289
+        delete curr['style']
290
+        delete curr['styleCut']
291
+        if (!curr.CustomerImg) {
292
+          curr.CustomerImg = curr.defaultNoUser
293
+        } else {
294
+          curr.CustomerImg = curr.CustomerImg.replace('?x-oss-process=style/calendar-thumb', '')
295
+        }
296
+        delete curr['defaultNoUser']
297
+        delete curr['CustomerImgShow']
298
+      });
299
+      let submitData = {
300
+        ModelName: this.$route.query.type == 1 ? '黑色' : '红色',
301
+        Email: this.email,
302
+        CaseId: '13',
303
+        Imgs: data
304
+      }
305
+      this.calendar({ Calendar: JSON.stringify(submitData) }).then(() => {
306
+        this.$toast('活动参与成功')
307
+        this.$router.replace({ name: 'userCenter' })
308
+      })
309
+    },
310
+    pre () {
311
+      this.$router.push({ name: 'preview', query: { type: this.$route.query.type } })
312
+    },
313
+    convert2canvas (dom, i) {
314
+      return new Promise((resolve, reject) => {
315
+        const that = this
316
+        var shareContent = dom;
317
+        var width = shareContent.offsetWidth; //获取dom 宽度
318
+        var height = shareContent.offsetHeight; //获取dom 高度
319
+        var canvas = document.createElement("canvas"); //创建一个canvas节点
320
+        var scale = 1; //定义任意放大倍数 支持小数
321
+        canvas.width = width * scale; //定义canvas 宽度 * 缩放
322
+        canvas.height = height * scale; //定义canvas高度 *缩放
323
+        canvas.getContext("2d").scale(scale, scale); //获取context,设置scale 
324
+        var opts = {
325
+          scale: scale, // 添加的scale 参数
326
+          canvas: canvas, //自定义 canvas
327
+          // logging: true, //日志开关,便于查看html2canvas的内部执行流程
328
+          width: width, //dom 原始宽度
329
+          height: height,
330
+          useCORS: true // 【重要】开启跨域配置
331
+        };
332
+
333
+        html2canvas(shareContent, opts).then(function (canvas) {
334
+          var context = canvas.getContext('2d');
335
+          // 【重要】关闭抗锯齿
336
+          context.mozImageSmoothingEnabled = false;
337
+          context.webkitImageSmoothingEnabled = false;
338
+          context.msImageSmoothingEnabled = false;
339
+          context.imageSmoothingEnabled = false;
340
+          // 【重要】默认转化的格式为png,也可设置为其他格式
341
+          // var img = canvas2image.convertToJPEG(canvas, canvas.width, canvas.height);
342
+          // var blobs = that.urltoblob(img.src);
343
+          // var namestr = `${that.banner[i].ImgName}.jpg`;
344
+          // var file = {
345
+          //   content: img.src,
346
+          //   file: that.blobToFile(blobs, namestr)
347
+          // }
348
+          // that.toolClass.upload(file).then((res) => {
349
+          //   that.banner[i].CalendarImg = res.result.url
350
+          //   that.setBanner({ type: that.$route.query.type, data: JSON.parse(JSON.stringify(that.banner)) })
351
+          //   resolve()
352
+          // }).catch(() => {
353
+          //   reject()
354
+          // })
355
+          let file = {
356
+            namestr: `${that.banner[i].ImgName}.jpg`,
357
+            base64str: encodeURIComponent(canvas.toDataURL('image/jpeg', 0.8))
358
+          }
359
+          that.toolClass.uploadBase64(file).then((res) => {
360
+            that.banner[i].CalendarImg = res.result.url
361
+            that.setBanner({ type: that.$route.query.type, data: JSON.parse(JSON.stringify(that.banner)) })
362
+            resolve()
363
+          }).catch(() => {
364
+            reject()
365
+          })
366
+        }).catch((err) => {
367
+          console.log(err)
368
+          that.isLoading = false
369
+        })
370
+      })
371
+    },
372
+    urltoblob (dataURL) {
373
+      var BASE64_MARKER = ';base64,';
374
+      if (dataURL.indexOf(BASE64_MARKER) == -1) {
375
+        var parts = dataURL.split(',');
376
+        var contentType = parts[0].split(':')[1];
377
+        var raw = decodeURIComponent(parts[1]);
378
+        return new Blob([raw], { type: contentType });
379
+      }
380
+      var parts = dataURL.split(BASE64_MARKER);
381
+      var contentType = parts[0].split(':')[1];
382
+      var raw = window.atob(parts[1]);
383
+      var rawLength = raw.length;
384
+      var uInt8Array = new Uint8Array(rawLength);
385
+      for (var i = 0; i < rawLength; ++i) {
386
+        uInt8Array[i] = raw.charCodeAt(i);
387
+      }
388
+      return new Blob([uInt8Array], { type: contentType });
389
+    },
390
+    blobToFile (theBlob, fileName) {
391
+      theBlob.lastModifiedDate = new Date();
392
+      theBlob.name = fileName;
393
+      return theBlob;
394
+    },
395
+    calSize () {
396
+      return new Promise((resolve) => {
397
+        let rotate = this.size
398
+        let dom = document.getElementsByClassName('cla')
399
+        if (dom.length < 2) {
400
+          resolve()
401
+          return
402
+        }
403
+        dom = dom[1]
404
+        let parentW = dom.offsetWidth
405
+        let parentH = dom.offsetHeight
406
+        dom.children[0].onload = function () {
407
+          let imgW = dom.children[0].naturalWidth
408
+          let imgH = dom.children[0].naturalHeight
409
+          if (rotate === '横') {
410
+            if (imgW <= imgH) {
411
+              dom.children[0].style = 'width:100%;'
412
+              let Offset = -((dom.children[0].height - parentH) / 2)
413
+              dom.children[0].style = `width:100%;position:relative;top:${Offset}px;left:0`
414
+              resolve()
415
+            } else {
416
+              dom.children[0].style = 'height:100%;'
417
+              let Offset = -((dom.children[0].width - parentW) / 2)
418
+              dom.children[0].style = `height:100%;position:relative;left:${Offset}px;top:0`
419
+              resolve()
420
+            }
421
+          } else {
422
+            if (imgW >= imgH) {
423
+              dom.children[0].style = 'height:100%;'
424
+              let Offset = -((dom.children[0].width - parentW) / 2)
425
+              dom.children[0].style = `height:100%;position:relative;left:${Offset}px;top:0`
426
+              resolve()
427
+            } else {
428
+              dom.children[0].style = 'width:100%;'
429
+              let Offset = -((dom.children[0].height - parentH) / 2)
430
+              dom.children[0].style = `width:100%;position:relative;top:${Offset}px;left:0`
431
+              resolve()
432
+            }
433
+          }
434
+        }
435
+      })
436
+    }
437
+  }
438
+}
439
+</script>
440
+
441
+<style lang="scss">
442
+.swiper-pagination-current {
443
+  color: #fc6243;
444
+}
445
+</style>
446
+
447
+
448
+<style lang="scss" scoped>
449
+.input {
450
+  border-radius: 5px;
451
+  background: rgb(245, 246, 250);
452
+  width: 100%;
453
+  height: 0.4rem;
454
+  padding-left: 0.1rem;
455
+}
456
+.mainPage {
457
+  position: fixed;
458
+  overflow-y: scroll;
459
+}
460
+.cla {
461
+  overflow: hidden;
462
+  z-index: 10;
463
+}
464
+.loading {
465
+  width: 100%;
466
+  height: 100%;
467
+  position: fixed;
468
+  left: 0;
469
+  top: 0;
470
+  display: flex;
471
+  flex-flow: column nowrap;
472
+  justify-content: center;
473
+  align-items: center;
474
+  z-index: 1000;
475
+  background: rgba(0, 0, 0, 0.6);
476
+  img {
477
+    width: 0.5rem;
478
+    height: 0.5rem;
479
+  }
480
+  span {
481
+    font-size: 0.14rem;
482
+    color: #fff;
483
+  }
484
+}
485
+.meassage {
486
+  color: red;
487
+  padding: 0.1rem;
488
+  text-align: center;
489
+  font-size: 0.12rem;
490
+}
491
+.pop-box {
492
+  width: 100%;
493
+  height: 100%;
494
+  position: fixed;
495
+  left: 0;
496
+  top: 0;
497
+  display: flex;
498
+  flex-flow: column nowrap;
499
+  justify-content: center;
500
+  align-items: center;
501
+  z-index: 1000;
502
+  background: rgba(0, 0, 0, 0.6);
503
+  .pop-content {
504
+    width: 2.6rem;
505
+    height: 1.7rem;
506
+    background: rgba(255, 255, 255, 1);
507
+    box-shadow: 0px 2px 4px 0px rgba(194, 194, 194, 0.5);
508
+    border-radius: 4px;
509
+    > div {
510
+      padding-top: 0.5rem;
511
+      font-size: 0.16rem;
512
+      display: flex;
513
+      justify-content: center;
514
+      align-items: center;
515
+      div {
516
+        margin: 0 0.12rem;
517
+        padding: 0.08rem 0.3rem;
518
+        border-radius: 4px;
519
+        border: 1px solid;
520
+      }
521
+    }
522
+  }
523
+}
524
+.cutBox {
525
+  z-index: -1;
526
+  position: absolute;
527
+  top: -10rem;
528
+  left: -10rem;
529
+  > div {
530
+    position: relative;
531
+    width: 13cm;
532
+    height: 21cm;
533
+    .cover {
534
+      width: 100%;
535
+      height: 100%;
536
+    }
537
+    .text-h {
538
+      width: 9cm;
539
+      position: absolute;
540
+      top: 8.8cm;
541
+      left: 1cm;
542
+      z-index: 3;
543
+    }
544
+    .text-l {
545
+      width: 0.85cm;
546
+      position: absolute;
547
+      top: 2.8cm;
548
+      left: 1cm;
549
+      z-index: 3;
550
+    }
551
+  }
552
+}
553
+.topBanner {
554
+  width: 100%;
555
+  height: 3.3rem;
556
+  background: #e9e9e9;
557
+  position: relative;
558
+  overflow: hidden;
559
+  &::before {
560
+    content: '';
561
+    position: absolute;
562
+    left: 0;
563
+    top: 0;
564
+    width: 100%;
565
+    height: 1.65rem;
566
+    box-sizing: border-box;
567
+    border-bottom: 1px dashed #d1d1d1;
568
+    transform-origin: bottom center;
569
+    transform: rotateZ(41deg) scale(1.414);
570
+  }
571
+  &::after {
572
+    content: '';
573
+    position: absolute;
574
+    left: 0;
575
+    top: 0;
576
+    width: 100%;
577
+    height: 1.65rem;
578
+    box-sizing: border-box;
579
+    border-bottom: 1px dashed #d1d1d1;
580
+    transform-origin: bottom center;
581
+    transform: rotateZ(-41deg) scale(1.414);
582
+  }
583
+  .swiper-container {
584
+    width: 100%;
585
+    height: 100%;
586
+  }
587
+  .swiper-button-next,
588
+  .swiper-button-prev {
589
+    background-image: url();
590
+    outline: 0px;
591
+    text-align: center;
592
+    line-height: 0.44rem;
593
+  }
594
+  .swiper-cover {
595
+    z-index: 2;
596
+    position: absolute;
597
+    bottom: 0.1rem;
598
+    left: 50%;
599
+    transform: translateX(-50%);
600
+    font-size: 0.12rem;
601
+    color: #fc6243;
602
+  }
603
+  .item {
604
+    position: relative;
605
+    height: 100%;
606
+    > div {
607
+      position: absolute;
608
+      width: 1.7rem;
609
+      height: 2.7rem;
610
+      top: 50%;
611
+      left: 50%;
612
+      transform: translate(-50%, -50%);
613
+      .cover {
614
+        width: 100%;
615
+        height: 100%;
616
+      }
617
+      .text-h {
618
+        width: 1.2rem;
619
+        position: absolute;
620
+        top: 1.12rem;
621
+        left: 0.2rem;
622
+        z-index: 3;
623
+      }
624
+      .text-l {
625
+        width: 0.1rem;
626
+        position: absolute;
627
+        top: 0.4rem;
628
+        left: 0.16rem;
629
+        z-index: 3;
630
+      }
631
+      .reload-img {
632
+        width: 0.2rem;
633
+        height: 0.2rem;
634
+        position: absolute;
635
+        top: 0.02rem;
636
+        right: 0.02rem;
637
+        z-index: 3;
638
+        img {
639
+          width: 100%;
640
+          height: 100%;
641
+        }
642
+      }
643
+    }
644
+  }
645
+}
646
+.operation {
647
+  display: flex;
648
+  justify-content: center;
649
+  align-items: center;
650
+  padding: 0.15rem 0.2rem 0.3rem;
651
+  > div {
652
+    text-align: center;
653
+    height: 0.68rem;
654
+    margin: 0 0.4rem;
655
+    img {
656
+      width: 0.68rem;
657
+      height: 0.68rem;
658
+    }
659
+    p {
660
+      color: #8a8a8a;
661
+      padding-top: 0.05rem;
662
+    }
663
+  }
664
+}
665
+.email {
666
+  display: flex;
667
+  justify-content: center;
668
+  align-items: center;
669
+  padding: 0 0.25rem;
670
+  box-sizing: border-box;
671
+  span {
672
+    width: 0.5rem;
673
+  }
674
+}
675
+.btn {
676
+  margin-top: 0.1rem;
677
+  width: 100%;
678
+  box-sizing: border-box;
679
+  display: flex;
680
+  justify-content: center;
681
+  align-items: center;
682
+  padding: 0 0.2rem;
683
+  div {
684
+    flex: 1;
685
+    margin: 0.1rem;
686
+    border-radius: 20px;
687
+    height: 0.4rem;
688
+    text-align: center;
689
+    line-height: 0.4rem;
690
+    background-color: #fc6243;
691
+    color: #fff;
692
+  }
693
+  div:nth-of-type(1) {
694
+    background: #9db0ce;
695
+  }
696
+}
697
+</style>

+ 37
- 0
src/pages/user/calendar/preview.vue Dosyayı Görüntüle

@@ -0,0 +1,37 @@
1
+<template>
2
+  <div style="height:100%">
3
+    <preview :banner="banner" style="height:100%;z-index:100;"></preview>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+import preview from '@/components/preview/preview.vue'
9
+import { createNamespacedHelpers } from 'vuex'
10
+const { mapState: mapMakingState, mapActions: mapMakingActions } = createNamespacedHelpers('making')
11
+export default {
12
+  data(){
13
+    return{
14
+      banner:[]
15
+    }
16
+  },
17
+  components: {
18
+    preview
19
+  },
20
+  computed: {
21
+    ...mapMakingState({
22
+      bannerBlack: item => item.bannerBlack,
23
+      bannerRed: item => item.bannerRed
24
+    })
25
+  },
26
+  created () {
27
+    if (this.$route.query.type == 1) {
28
+      this.banner = this.bannerBlack
29
+    } else {
30
+      this.banner = this.bannerRed
31
+    }
32
+  }
33
+}
34
+</script>
35
+
36
+<style lang="scss" scoped>
37
+</style>

+ 106
- 0
src/pages/user/courseList/index.vue Dosyayı Görüntüle

@@ -0,0 +1,106 @@
1
+<template>
2
+  <div class="mainPage" @scroll="pageScroll" ref="parentBox">
3
+    <div class="flex-h">
4
+      <div class="flex-item">
5
+        <div ref="box">
6
+          <ul>
7
+            <router-link
8
+              tag="li"
9
+              v-for="(item,index) in list"
10
+              :key="index"
11
+              :to="{name: 'majorProjectsDetail', query: {id: item.id}}"
12
+              class="flex-h"
13
+            >
14
+              <div class="flex-item">
15
+                <div>
16
+                  <courseItem :data="item" marginRight=".2"></courseItem>
17
+                </div>
18
+              </div>
19
+            </router-link>
20
+          </ul>
21
+          <span class="footerWord" v-if="total === list.length">加载完毕</span>
22
+          <span class="footerWord" v-else>正在加载更多</span>
23
+        </div>
24
+      </div>
25
+    </div>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+import { mapState, createNamespacedHelpers } from 'vuex'
31
+import courseItem from '../../../components/courseItem/index'
32
+const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('index')
33
+
34
+export default {
35
+  name: '',
36
+  data () {
37
+    return {
38
+      list: [],
39
+      ajaxOff: true,
40
+      postData: {
41
+        pagesize: 10,
42
+        page: 1
43
+      },
44
+      total: 1
45
+    }
46
+  },
47
+  computed: {
48
+    ...mapState({
49
+      orgid: x => x.app.orgId,
50
+      fiveA: x => x.index.fiveA,
51
+      banner: x => x.index.banner,
52
+      message: x => x.index.message,
53
+      project: x => x.index.project,
54
+      cms: x => x.index.cms,
55
+    }),
56
+    ...mapIndexState({
57
+      courseList: x => x.courseList
58
+    })
59
+  },
60
+  components: {
61
+    courseItem
62
+  },
63
+  created () {
64
+    this.getData()
65
+  },
66
+  methods: {
67
+    ...mapIndexActions(['getCourseList']),
68
+    pageScroll () {
69
+      var docHeight = this.$refs.box.offsetHeight, parHeight = this.$refs.parentBox.offsetHeight, scrollTop = this.$refs.parentBox.scrollTop
70
+      if (scrollTop === docHeight - parHeight) {
71
+        if (this.ajaxOff && this.list.length < this.total) {
72
+          this.ajaxOff = false
73
+          this.postData.page += 1
74
+          this.getData()
75
+        }
76
+      }
77
+    },
78
+    getData () {
79
+      this.getCourseList(this.postData).then((res) => {
80
+        this.ajaxOff = true
81
+        this.total = res.pagenum;
82
+        (res.list || []).map((item) => {
83
+          this.list.push({
84
+            id: item.CourseId,
85
+            title: item.CourseName,
86
+            img: item.CourseImg,
87
+            remark: this.toolClass.dateFormat(item.BeginDate, 'yyyy.MM.dd') + '~' + this.toolClass.dateFormat(item.EndDate, 'MM.dd'),
88
+            address: item.CaseAddress,
89
+            tag: item.CourseTags,
90
+            courseType: '团体课',
91
+            defaultPrice: item.Price + '/节',
92
+            getWay: 'ticket',
93
+            startDate: new Date(item.BeginDate).getTime(),
94
+            endDate: new Date(item.EndDate).getTime(),
95
+          })
96
+        })
97
+      })
98
+    }
99
+  }
100
+}
101
+</script>
102
+
103
+<!-- Add "scoped" attribute to limit CSS to this component only -->
104
+<style lang="scss" scoped>
105
+@import 'page.scss';
106
+</style>

+ 31
- 0
src/pages/user/courseList/page.scss Dosyayı Görüntüle

@@ -0,0 +1,31 @@
1
+.mainPage{
2
+  background: #fff;
3
+  overflow-y: scroll;
4
+  -webkit-overflow-scrolling: touch;
5
+  transform: translateZ(0);
6
+  -webkit-transform: translateZ(0);
7
+  >div{
8
+    >div{
9
+      margin-left: .2rem;
10
+      >div{
11
+        width: 100%;
12
+        position: relative;
13
+        overflow: hidden;
14
+        >ul{
15
+          >li{
16
+            padding: .2rem 0;
17
+            border-bottom: 1px solid #eee;
18
+          }
19
+        }
20
+      }
21
+    }
22
+    .footerWord{
23
+      width: 100%;
24
+      display: block;
25
+      text-align: center;
26
+      text-indent: -.1rem;
27
+      line-height: .4rem;
28
+      color: #666;
29
+    }
30
+  }
31
+}

+ 216
- 0
src/pages/user/customization/customizationDetail.vue Dosyayı Görüntüle

@@ -0,0 +1,216 @@
1
+<template>
2
+  <div class="mainPage" v-if="showPage">
3
+    <div class="top">
4
+      <img :src="detail.ModelName === '黑色'?topImgBlack:topImgRed">
5
+      <div>
6
+        <div class="list">
7
+          <img :src="detail.ModelName === '黑色'?cover:cover2">
8
+          <div>
9
+            <div>定制您的2019专属台历</div>
10
+            <div>主办案场: {{detail.CaseName}}</div>
11
+            <div>参与时间: {{toolClass.dateFormat(detail.CreateDate)}}</div>
12
+          </div>
13
+          <span>{{detail.MakeStatus === 'making' ? '制作中' : '制作完成'}}</span>
14
+        </div>
15
+      </div>
16
+    </div>
17
+    <div class="main">
18
+      <div class="title">定制模版</div>
19
+      <img :src="detail.cover.CalendarImg">
20
+      <div class="text">云台天境日历模版</div>
21
+    </div>
22
+    <div class="bottom">
23
+      <div class="title">定制预览</div>
24
+      <div class="pic-list">
25
+        <img
26
+          v-for="(item,index) in detail.Imgs"
27
+          :src="item.CalendarImg"
28
+          :key="index"
29
+          v-if="showMore || index < 4"
30
+          @click="large(item.CalendarImg)"
31
+        >
32
+      </div>
33
+      <div v-if="!showMore" @click="more()" class="more">
34
+        查看更多
35
+        <i class="iconfont icon-xia"></i>
36
+      </div>
37
+      <div v-else @click="noMore()" class="more">
38
+        收起
39
+        <i class="iconfont icon-shang"></i>
40
+      </div>
41
+    </div>
42
+    <div class="foot">
43
+      <div @click="tel()">联系我们: 025-86426666</div>
44
+    </div>
45
+  </div>
46
+</template>
47
+
48
+<script>
49
+import cover from '@/common/icon/heise.png'
50
+import cover2 from '@/common/icon/honhse.png'
51
+import topImgRed from '@/common/icon/topImgRed.jpg'
52
+import topImgBlack from '@/common/icon/topImgBlack.png'
53
+import { createNamespacedHelpers } from 'vuex'
54
+const { mapState: mapCustomizationState, mapActions: mapCustomizationActions } = createNamespacedHelpers('customization')
55
+export default {
56
+  data () {
57
+    return {
58
+      topImgRed,
59
+      topImgBlack,
60
+      cover,
61
+      cover2,
62
+      showPage: false,
63
+      showMore: false
64
+    }
65
+  },
66
+  created () {
67
+    this.getDetail({ calendarId: this.$route.query.id }).then(() => {
68
+      this.showPage = true
69
+    })
70
+  },
71
+  computed: {
72
+    ...mapCustomizationState({
73
+      detail: item => item.detail
74
+    })
75
+  },
76
+  methods: {
77
+    ...mapCustomizationActions(['getDetail']),
78
+    more () {
79
+      this.showMore = true
80
+    },
81
+    noMore () {
82
+      this.showMore = false
83
+    },
84
+    large (src) {
85
+      let list = []
86
+      this.detail.Imgs.forEach(item => {
87
+        list.push(item.CalendarImg)
88
+      });
89
+      WeixinJSBridge.invoke('imagePreview', {
90
+        'current': src,
91
+        'urls': list
92
+      })
93
+    },
94
+    tel () {
95
+      window.location.href = 'tel:02586426666'
96
+    }
97
+  }
98
+}
99
+</script>
100
+
101
+<style lang="scss" scoped>
102
+.mainPage {
103
+  overflow-y: scroll;
104
+  -webkit-overflow-scrolling: touch;
105
+  transform: translateZ(0);
106
+  -webkit-transform: translateZ(0);
107
+}
108
+.title {
109
+  font-size: 0.16rem;
110
+  padding: 0.2rem 0 0.1rem 0.25rem;
111
+  text-align: left;
112
+}
113
+.top {
114
+  > img {
115
+    width: 100%;
116
+  }
117
+  > div {
118
+    height: 0.85rem;
119
+    background: #f2f2f2;
120
+    position: relative;
121
+    .list {
122
+      box-sizing: border-box;
123
+      position: absolute;
124
+      bottom: 0.1rem;
125
+      left: 50%;
126
+      transform: translateX(-50%);
127
+      width: 3.43rem;
128
+      height: 1.1rem;
129
+      background: #fff;
130
+      padding: 0.16rem 0.1rem;
131
+      display: flex;
132
+      box-shadow: 0px 2px 8px 0px rgba(204, 204, 204, 0.5);
133
+      border-radius: 10px;
134
+      img {
135
+        width: 0.8rem;
136
+        height: 0.8rem;
137
+        border-radius: 0.05rem;
138
+      }
139
+      > div {
140
+        padding: 0.05rem 0.14rem;
141
+        flex: 1;
142
+        div:nth-of-type(1) {
143
+          color: #000;
144
+          padding: 0px;
145
+        }
146
+        div:nth-of-type(2) {
147
+          padding-top: 0.12rem;
148
+        }
149
+        div {
150
+          font-size: 0.12rem;
151
+          padding-top: 0.08rem;
152
+          color: #999999;
153
+        }
154
+      }
155
+      span {
156
+        position: absolute;
157
+        right: 0;
158
+        top: 0.1rem;
159
+        display: block;
160
+        background: linear-gradient(
161
+          270deg,
162
+          rgba(227, 191, 172, 1) 0%,
163
+          rgba(178, 144, 132, 1) 100%
164
+        );
165
+        border-radius: 10px 0px 0px 10px;
166
+        padding: 1px 0.1rem 2px 0.15rem;
167
+        font-size: 0.12rem;
168
+      }
169
+    }
170
+  }
171
+}
172
+.main {
173
+  border-bottom: 0.1rem solid #f2f2f2;
174
+  text-align: center;
175
+  background: #fff;
176
+  .text {
177
+    padding-bottom: 0.15rem;
178
+  }
179
+  img {
180
+    width: 1.65rem;
181
+    margin: 20px;
182
+  }
183
+}
184
+.bottom {
185
+  background: #fff;
186
+  .pic-list {
187
+    justify-content: center;
188
+    padding: 0.05rem;
189
+    box-sizing: border-box;
190
+    display: flex;
191
+    flex-flow: row wrap;
192
+    img {
193
+      width: 1.65rem;
194
+      height: 2.6rem;
195
+      margin: 0.08rem;
196
+    }
197
+  }
198
+  .more {
199
+    color: #77a5f0;
200
+    text-align: center;
201
+    margin-bottom: 0.1rem;
202
+    i {
203
+      color: #77a5f0;
204
+    }
205
+  }
206
+}
207
+.foot {
208
+  height: 0.9rem;
209
+  text-align: center;
210
+  line-height: 0.9rem;
211
+  background: #f2f2f2;
212
+  div {
213
+    color: #77a5f0;
214
+  }
215
+}
216
+</style>

+ 116
- 0
src/pages/user/customization/customizationList.vue Dosyayı Görüntüle

@@ -0,0 +1,116 @@
1
+<template>
2
+  <div class="content mainPage" v-if="showPage">
3
+    <div
4
+      class="list"
5
+      v-for="(item,index) in list"
6
+      :key="index"
7
+      @click="toDetail(item.CustomerCalendarId)"
8
+    >
9
+      <img :src="item.ModelName === '黑色'?cover:cover2">
10
+      <div>
11
+        <div>定制您的2019专属台历</div>
12
+        <div>主办案场: {{item.CaseName}}</div>
13
+        <div>参与时间: {{toolClass.dateFormat(item.CreateDate)}}</div>
14
+      </div>
15
+      <span>{{item.MakeStatus === 'making' ? '制作中' : '制作完成'}}</span>
16
+    </div>
17
+    <noMore v-if="list.length === 0"></noMore>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+import cover from '@/common/icon/heise.png'
23
+import cover2 from '@/common/icon/honhse.png'
24
+import noMore from '@/components/noMore/noMore.vue'
25
+import { createNamespacedHelpers } from 'vuex'
26
+const { mapState: mapCustomizationState, mapActions: mapCustomizationActions } = createNamespacedHelpers('customization')
27
+export default {
28
+  data () {
29
+    return {
30
+      showPage: false,
31
+      cover,
32
+      cover2
33
+    }
34
+  },
35
+  components:{
36
+    noMore
37
+  },
38
+  created () {
39
+    this.getList().then(() => {
40
+      this.showPage = true
41
+      console.log(this.list)
42
+    })
43
+  },
44
+  computed: {
45
+    ...mapCustomizationState({
46
+      list: item => item.list
47
+    })
48
+  },
49
+  methods: {
50
+    ...mapCustomizationActions(['getList']),
51
+    toDetail (id) {
52
+      this.$router.push({ name: 'customizationDetail', query: { id: id } })
53
+    }
54
+  },
55
+  // beforeRouteLeave (to, from, next) {
56
+  //   console.log(to)
57
+  //   console.log(from)
58
+  //   if (to.name === 'making') {
59
+  //     next({ name: 'activeList' })
60
+  //   } else {
61
+  //     next()
62
+  //   }
63
+  // }
64
+}
65
+</script>
66
+
67
+<style lang="scss" scoped>
68
+.content {
69
+  padding: 0.2rem 0.16rem;
70
+  box-sizing: border-box;
71
+  .list {
72
+    padding: 0.16rem 0.1rem;
73
+    display: flex;
74
+    box-shadow: 0px 2px 8px 0px rgba(204, 204, 204, 0.5);
75
+    border-radius: 10px;
76
+    position: relative;
77
+    img {
78
+      width: 0.8rem;
79
+      height: 0.8rem;
80
+      border-radius: 0.05rem;
81
+    }
82
+    > div {
83
+      padding: 0.05rem 0.14rem;
84
+      flex: 1;
85
+      div:nth-of-type(1) {
86
+        color: #000;
87
+        padding: 0px;
88
+        font-size: 0.15rem;
89
+      }
90
+      div:nth-of-type(2) {
91
+        padding-top: 0.12rem;
92
+      }
93
+      div {
94
+        font-size: 0.12rem;
95
+        padding-top: 0.08rem;
96
+        color: #999999;
97
+      }
98
+    }
99
+    span {
100
+      position: absolute;
101
+      right: 0;
102
+      top: 0.1rem;
103
+      display: block;
104
+      background: linear-gradient(
105
+        24deg,
106
+        rgba(250, 80, 140, 1) 0%,
107
+        rgba(255, 200, 110, 1) 100%
108
+      );
109
+      border-radius: 100px 0px 0px 100px;
110
+      padding: 2px 0.1rem 4px 0.15rem;
111
+      color: white;
112
+      font-size: 0.12rem;
113
+    }
114
+  }
115
+}
116
+</style>

+ 34
- 7
src/pages/user/fiveA/index.vue Dosyayı Görüntüle

@@ -1,7 +1,13 @@
1 1
 <template>
2 2
   <div class="mainPage flex-v">
3 3
     <nav class="flex-h">
4
-      <a class="flex-item" v-for="(item,index) in locations" :key="index" :class="{'active':index==active.index}" @click="changeLocation(item,index)">{{item.LocationName}}</a>
4
+      <a
5
+        class="flex-item"
6
+        v-for="(item,index) in locations"
7
+        :key="index"
8
+        :class="{'active':index==active.index}"
9
+        @click="changeLocation(item,index)"
10
+      >{{item.LocationName}}</a>
5 11
     </nav>
6 12
     <div class="flex-item">
7 13
       <div>
@@ -9,8 +15,18 @@
9 15
           <div class="banner flex-h">
10 16
             <div class="flex-item">
11 17
               <swiper :options="swiperOption" ref="mySwiper">
12
-                <swiper-slide class="swiper-slide" v-for="(banner,bindex) in item.Banners" :key="bindex">
13
-                  <img :src='banner.ImageUrl' class="cover" style="border-radius: .12rem;" alt=""  @click="jump(banner)">
18
+                <swiper-slide
19
+                  class="swiper-slide"
20
+                  v-for="(banner,bindex) in item.Banners"
21
+                  :key="bindex"
22
+                >
23
+                  <img
24
+                    :src="banner.ImageUrl"
25
+                    class="cover"
26
+                    style="border-radius: .12rem;"
27
+                    alt
28
+                    @click="jump(banner)"
29
+                  >
14 30
                 </swiper-slide>
15 31
               </swiper>
16 32
             </div>
@@ -18,7 +34,12 @@
18 34
           <h5>{{item.Title}}</h5>
19 35
           <div class="courseList flex-h">
20 36
             <ul class="flex-item" v-if="!fiveANoData">
21
-              <router-link tag="li" v-for="(course,cindex) in item.Courses" :key="cindex" :to="{name:'majorProjectsDetail',query:{id: course.CourseId}}">
37
+              <router-link
38
+                tag="li"
39
+                v-for="(course,cindex) in item.Courses"
40
+                :key="cindex"
41
+                :to="{name:'majorProjectsDetail',query:{id: course.CourseId}}"
42
+              >
22 43
                 <courseItem :data="courseInfo(course)"></courseItem>
23 44
               </router-link>
24 45
             </ul>
@@ -28,7 +49,13 @@
28 49
           <h5>{{item.Consult || '资讯'}}</h5>
29 50
           <div class="newsList flex-h">
30 51
             <ul class="flex-item">
31
-              <li tag="li" @click="jump(newinfo)" v-for="(newinfo,nindex) in item.News" v-if="nindex < 5" :key="nindex">
52
+              <li
53
+                tag="li"
54
+                @click="jump(newinfo)"
55
+                v-for="(newinfo,nindex) in item.News"
56
+                v-if="nindex < 5"
57
+                :key="nindex"
58
+              >
32 59
                 <newsItem :data="newinfo"></newsItem>
33 60
               </li>
34 61
             </ul>
@@ -107,7 +134,7 @@ export default {
107 134
         id: course.CourseId,
108 135
         title: course.CourseName,
109 136
         img: course.CourseImg,
110
-        remark: course.Remark,
137
+        remark: `${this.toolClass.dateFormat(course.BeginDate, 'yyyy-MM-dd')} ~ ${this.toolClass.dateFormat(course.EndDate, 'yyyy-MM-dd')}`,
111 138
         address: course.CaseAddress,
112 139
         tag: course.CourseTags || [],
113 140
         courseType: '',
@@ -126,7 +153,7 @@ export default {
126 153
       if (item.ForwardType === 'url') {
127 154
         window.location.href = item.ForwardUrl
128 155
       } else if (item.ForwardType === 'course') {
129
-        if (item.ForwardResourceId){
156
+        if (item.ForwardResourceId) {
130 157
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
131 158
         } else {
132 159
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardCourseId } }) // 此处去课程详情

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

@@ -0,0 +1,172 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <loadMore :on-infinite="onInfinite" :dataList="scrollData">
4
+      <div class="box">
5
+        <div class="noData" v-if="show && (books.list || []).length < 1">
6
+          <img src="../../../../common/icon/kong.png" alt>
7
+          <span>暂无内容</span>
8
+        </div>
9
+        <ul>
10
+          <li v-for="(item, index) in (books.list || [])" :key="index" v-if="show">
11
+            <libraryListItem
12
+              :data="item"
13
+              :status="mineBookStatus(item)"
14
+              @appointmentBook="appointmentBook"
15
+            ></libraryListItem>
16
+          </li>
17
+        </ul>
18
+      </div>
19
+    </loadMore>
20
+    <van-dialog v-model="showAppointmentDialog" :show-confirm-button="false">
21
+      <div class="dialogContent">
22
+        <span class="title">确认在线预约当前图书?</span>
23
+        <div>
24
+          <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
25
+        </div>
26
+        <div class="btn">
27
+          <a @click="sureAppointmentBook">确定</a>
28
+          <a @click="showAppointmentDialog = false">取消</a>
29
+        </div>
30
+      </div>
31
+    </van-dialog>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+import libraryListItem from '../../../../components/libraryListItem/index'
37
+import loadMore from '@/components/vue-load-more/index'
38
+import { createNamespacedHelpers } from 'vuex'
39
+import toolClass from '../../../../util/util'
40
+const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
41
+export default {
42
+  data () {
43
+    return {
44
+      showAppointmentDialog: false,
45
+      query: {
46
+        caseid: '',
47
+        booktype: '',
48
+        page: 1,
49
+        pagesize: 10,
50
+      },
51
+      reserveBookId: '',
52
+      show: false,
53
+      scrollData: {
54
+        noFlag: false // 暂无更多数据显示
55
+      },
56
+    }
57
+  },
58
+  created () {
59
+    this.query.booktype = this.$route.query.type
60
+    this.query.caseid = this.$route.query.caseid
61
+    this.$nextTick(() => {
62
+      this.onInfinite()
63
+    })
64
+    // this.getBookList(this.query).then(() => {
65
+    //   this.show = true
66
+    // })
67
+    this.getMineBook({
68
+      page: 1,
69
+      pagesize: 1000,
70
+    })
71
+  },
72
+  computed: {
73
+    ...mapBookState({
74
+      books: x => x.books,
75
+      mineBooks: x => x.minebooks,
76
+    }),
77
+    reserveEndDate () {
78
+      return toolClass.calDate(7)
79
+    }
80
+  },
81
+  components: {
82
+    libraryListItem,
83
+    loadMore
84
+  },
85
+  methods: {
86
+    ...mapBookAction([
87
+      'getBookList',
88
+      "getMineBook",
89
+      "reserveBook",
90
+      "updateBookLeftNum",
91
+    ]),
92
+    appointmentBook (id) { // 预约图书
93
+      this.reserveBookId = id
94
+      this.showAppointmentDialog = true
95
+    },
96
+    sureAppointmentBook () { // 确定预约图书
97
+      this.reserveBook({
98
+        bookid: this.reserveBookId,
99
+      }).then(() => {
100
+        this.updateBookLeftNum(this.reserveBookId)
101
+        this.getMineBook({
102
+          page: 1,
103
+          pagesize: 1000,
104
+        })
105
+      })
106
+      this.showAppointmentDialog = false
107
+    },
108
+    mineBookStatus (item) {
109
+      return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId && (x.BorrowStatus == '4' || x.BorrowStatus == '1' || x.BorrowStatus == '0'))[0] || {}).BorrowStatus
110
+    },
111
+    onInfinite () {
112
+      let more = this.$el.querySelector('.load-more')
113
+      this.getBookList(this.query).then((res) => {
114
+        this.show = true
115
+        this.query.page++
116
+        res.list = res.list || []
117
+        if (res.list.length < res.pageSize) {
118
+          more.style.display = 'none'// 隐藏加载条
119
+          this.scrollData.noFlag = true
120
+        } else {
121
+          more.style.display = 'none'// 隐藏加载条
122
+        }
123
+      })
124
+    }
125
+  }
126
+}
127
+</script>
128
+
129
+<style lang="scss" scoped>
130
+.mainPage {
131
+  .box {
132
+    width: 100%;
133
+    // position: absolute;
134
+    // left: 0;
135
+    // top: 0;
136
+    // bottom: 0;
137
+    // overflow-y: scroll;
138
+    // -webkit-overflow-scrolling: touch;
139
+    // transform: translateZ(0);
140
+    // -webkit-transform: translateZ(0);
141
+    .noData {
142
+      width: 100%;
143
+      margin: 0.5rem auto 0;
144
+      position: relative;
145
+      overflow: hidden;
146
+      img {
147
+        width: 0.7rem;
148
+        display: block;
149
+        margin: 0 auto;
150
+      }
151
+      span {
152
+        width: 100%;
153
+        display: block;
154
+        text-align: center;
155
+        line-height: 0.3rem;
156
+        color: #b4b4b4;
157
+        font-size: 0.14rem;
158
+        margin: 0.05rem auto 0;
159
+      }
160
+    }
161
+    > ul {
162
+      padding: 0 0.16rem;
163
+      margin-bottom: 0.1rem;
164
+      position: relative;
165
+      overflow: hidden;
166
+      li {
167
+        margin: 0.1rem auto 0;
168
+      }
169
+    }
170
+  }
171
+}
172
+</style>

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

@@ -0,0 +1,274 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <loadMore :on-infinite="onInfinite" :dataList="scrollData">
4
+      <div class="header flex-h">
5
+        <div class="flex-item flex-h">
6
+          <i class="iconfont icon-sousuo"></i>
7
+          <div class="flex-item">
8
+            <div>
9
+              <input type="text" v-model="searchKey" autofocus="autofocus" placeholder="请输入图书名">
10
+            </div>
11
+          </div>
12
+        </div>
13
+        <a @click="search">搜索</a>
14
+      </div>
15
+      <div class="searchRemark" v-if="showSearch">
16
+        <span>
17
+          关于“
18
+          <em>{{doSearchKey}}</em>”的搜索结果:
19
+        </span>
20
+      </div>
21
+      <div class="flex-item list" :hidden="!showSearch">
22
+        <div>
23
+          <div class="noData" v-if="(books.list || []).length < 1">
24
+            <img src="../../../../common/icon/kong.png" alt>
25
+            <span>暂无内容</span>
26
+          </div>
27
+          <ul v-else>
28
+            <li v-for="(item, index) in books.list" :key="index">
29
+              <libraryListItem
30
+                :data="item"
31
+                :status="mineBookStatus(item)"
32
+                @appointmentBook="appointmentBook"
33
+              ></libraryListItem>
34
+            </li>
35
+          </ul>
36
+        </div>
37
+      </div>
38
+    </loadMore>
39
+    <van-dialog v-model="showAppointmentDialog" :show-confirm-button="false">
40
+      <div class="dialogContent">
41
+        <span class="title">确认在线预约当前图书?</span>
42
+        <div>
43
+          <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
44
+        </div>
45
+        <div class="btn">
46
+          <a @click="sureAppointmentBook">确定</a>
47
+          <a @click="showAppointmentDialog = false">取消</a>
48
+        </div>
49
+      </div>
50
+    </van-dialog>
51
+  </div>
52
+</template>
53
+
54
+<script>
55
+import libraryListItem from '../../../../components/libraryListItem/index'
56
+import toolClass from '../../../../util/util'
57
+import loadMore from '@/components/vue-load-more/index'
58
+import { mapState, createNamespacedHelpers } from 'vuex'
59
+const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
60
+export default {
61
+  data () {
62
+    return {
63
+      searchKey: '',
64
+      showSearch: false,
65
+      noData: false,
66
+      showAppointmentDialog: false,
67
+      caseid: '',
68
+      page: 1,
69
+      pagesize: 10,
70
+      doSearchKey: '',
71
+      reserveBookId: '',
72
+      scrollData: {
73
+        noFlag: false // 暂无更多数据显示
74
+      },
75
+    }
76
+  },
77
+  created () {
78
+    this.caseid = this.$route.query.caseid
79
+    this.getMineBook({
80
+      page: 1,
81
+      pagesize: 1000,
82
+    })
83
+  },
84
+  computed: {
85
+    ...mapBookState({
86
+      books: x => x.books,
87
+      mineBooks: x => x.minebooks,
88
+    }),
89
+    reserveEndDate () {
90
+      return toolClass.calDate(7)
91
+    }
92
+  },
93
+  mounted () {
94
+    // this.$nextTick(() => {
95
+    //   document.getElementById("seltxt").focus()
96
+    // })
97
+  },
98
+  components: {
99
+    loadMore,
100
+    libraryListItem
101
+  },
102
+  methods: {
103
+    ...mapBookAction([
104
+      'getBookList',
105
+      'getMineBook',
106
+      'reserveBook',
107
+      "updateBookLeftNum",
108
+      "updateRecommendBookLeftNum",
109
+    ]),
110
+    search () { // 搜索
111
+      if (this.searchKey !== '') {
112
+        this.doSearchKey = this.searchKey
113
+        this.page = 1
114
+        this.onInfinite()
115
+      } else {
116
+        this.$toast('搜索关键词不能为空')
117
+      }
118
+    },
119
+    appointmentBook (id) { // 预约图书
120
+      this.reserveBookId = id
121
+      this.showAppointmentDialog = true
122
+    },
123
+    sureAppointmentBook () { // 确定预约图书
124
+      this.reserveBook({
125
+        bookid: this.reserveBookId,
126
+      }).then(() => {
127
+        this.updateBookLeftNum(this.reserveBookId)
128
+        this.updateRecommendBookLeftNum(this.reserveBookId)
129
+        this.getMineBook({
130
+          page: 1,
131
+          pagesize: 1000,
132
+        })
133
+      })
134
+      this.showAppointmentDialog = false
135
+    },
136
+    getSearchList () {
137
+      this.getBookList({
138
+        caseid: this.caseid,
139
+        name: this.doSearchKey,
140
+        page: this.page,
141
+        pagesize: this.pagesize,
142
+      }).then(() => {
143
+        this.showSearch = true
144
+      })
145
+    },
146
+    mineBookStatus (item) {
147
+      return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId && (x.BorrowStatus == '4' || x.BorrowStatus == '1' || x.BorrowStatus == '0'))[0] || {}).BorrowStatus
148
+    },
149
+    onInfinite () {
150
+      let more = this.$el.querySelector('.load-more')
151
+      this.getBookList({
152
+        caseid: this.caseid,
153
+        name: this.doSearchKey,
154
+        page: this.page,
155
+        pagesize: this.pagesize,
156
+      }).then((res) => {
157
+        this.showSearch = true
158
+        this.page++
159
+        res.list = res.list || []
160
+        if (res.list.length < res.pageSize) {
161
+          more.style.display = 'none'// 隐藏加载条
162
+          this.scrollData.noFlag = true
163
+        } else {
164
+          more.style.display = 'none'// 隐藏加载条
165
+        }
166
+      })
167
+    },
168
+  }
169
+}
170
+</script>
171
+
172
+<style lang="scss" scoped>
173
+.mainPage {
174
+  .header {
175
+    padding: 0.1rem 0.2rem;
176
+    > div {
177
+      background: #f2f2f2;
178
+      position: relative;
179
+      overflow: hidden;
180
+      i {
181
+        font-size: 0.15rem;
182
+        color: #ccc;
183
+        margin-left: 0.08rem;
184
+        line-height: 0.3rem;
185
+      }
186
+      > div {
187
+        margin-left: 0.1rem;
188
+        > div {
189
+          width: 100%;
190
+          position: relative;
191
+          overflow: hidden;
192
+          input {
193
+            width: 100%;
194
+            display: block;
195
+            line-height: 0.2rem;
196
+            padding: 0.05rem 0;
197
+            background: none;
198
+            font-size: 0.13rem;
199
+          }
200
+        }
201
+      }
202
+    }
203
+    > a {
204
+      line-height: 0.3rem;
205
+      margin-left: 0.1rem;
206
+      font-size: 0.14rem;
207
+    }
208
+  }
209
+  .searchRemark {
210
+    padding: 0 0.2rem;
211
+    span {
212
+      width: 100%;
213
+      white-space: nowrap;
214
+      overflow: hidden;
215
+      display: block;
216
+      line-height: 0.22rem;
217
+      font-size: 0.14rem;
218
+      color: #616161;
219
+      em {
220
+        line-height: 0.22rem;
221
+        font-size: 0.14rem;
222
+        color: #fc5634;
223
+      }
224
+    }
225
+  }
226
+  .list {
227
+    position: relative;
228
+    overflow: hidden;
229
+    > div {
230
+      width: 100%;
231
+      // position: absolute;
232
+      // left: 0;
233
+      // top: 0;
234
+      // bottom: 0;
235
+      // overflow-y: scroll;
236
+      // -webkit-overflow-scrolling: touch;
237
+      // transform: translateZ(0);
238
+      // -webkit-transform: translateZ(0);
239
+      .noData {
240
+        width: 100%;
241
+        margin: 0.5rem auto 0;
242
+        position: relative;
243
+        overflow: hidden;
244
+        img {
245
+          width: 0.7rem;
246
+          display: block;
247
+          margin: 0 auto;
248
+        }
249
+        span {
250
+          width: 100%;
251
+          display: block;
252
+          text-align: center;
253
+          line-height: 0.3rem;
254
+          color: #b4b4b4;
255
+          font-size: 0.14rem;
256
+          margin: 0.05rem auto 0;
257
+        }
258
+      }
259
+      > ul {
260
+        padding: 0 0.2rem;
261
+        margin: 0 auto 0.1rem;
262
+        position: relative;
263
+        overflow: hidden;
264
+        > li {
265
+          width: 100%;
266
+          position: relative;
267
+          overflow: hidden;
268
+          margin: 0.1rem auto 0;
269
+        }
270
+      }
271
+    }
272
+  }
273
+}
274
+</style>

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

@@ -0,0 +1,276 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <slideTabH
4
+      :data="tabList"
5
+      fontSize="16"
6
+      activeColor="red"
7
+      normalColor="#666"
8
+      @slideChange="slideChange"
9
+    >
10
+      <div class="subMain" slot="slideTabH-1">
11
+        <div>
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">
17
+            <li v-for="(item, index) in borrowBooks.list" :key="index">
18
+              <libraryListItem :data="item" :type="1" @itemClick="borrowedRecordClick"></libraryListItem>
19
+            </li>
20
+          </ul>
21
+        </div>
22
+      </div>
23
+      <div class="subMain" slot="slideTabH-2">
24
+        <div>
25
+          <span>请在资格保留时间内至案场借阅图书,超出预约时间将取消预约资格</span>
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">
31
+            <li v-for="(item, index) in reserveBooks.list" :key="index">
32
+              <libraryListItem :data="item" :type="2"></libraryListItem>
33
+            </li>
34
+          </ul>
35
+        </div>
36
+      </div>
37
+    </slideTabH>
38
+    <van-dialog v-model="showDialog" :show-confirm-button="false" :closeOnClickOverlay="true">
39
+      <div class="borrowedRecordContent flex-h" @click="showDialog = false">
40
+        <div class="img">
41
+          <a>
42
+            <img
43
+              :src="(currentItem.BookImg || defaultimg) + '?x-oss-process=style/compress-rotate'"
44
+              class="centerLabel"
45
+              style="width: 100%;
46
+                height: 100%;
47
+                object-fit: cover"
48
+            >
49
+          </a>
50
+        </div>
51
+        <div class="flex-item">
52
+          <div>
53
+            <div>
54
+              <span :class="currentItem.BorrowStatus=='0'?'active':''">{{myBookStatus}}</span>
55
+            </div>
56
+            <span class="title">{{currentItem.BookName}}</span>
57
+            <span>借阅时间:{{toolClass.dateFormat(currentItem.BorrowDate)}}</span>
58
+            <span>应还时间:{{toolClass.dateFormat(currentItem.EndDate, 'yyyy-MM-dd')}}</span>
59
+            <span>归还时间:{{currentItem.BorrowStatus == '1' || currentItem.BorrowStatus == '0' ? '暂未归还' : toolClass.dateFormat(currentItem.ReturnDate)}}</span>
60
+          </div>
61
+        </div>
62
+      </div>
63
+    </van-dialog>
64
+  </div>
65
+</template>
66
+
67
+<script>
68
+import slideTabH from '../../../../components/slideTabH/index'
69
+import libraryListItem from '../../../../components/libraryListItem/index'
70
+import toolClass from '../../../../util/util'
71
+import { createNamespacedHelpers } from 'vuex'
72
+const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
73
+export default {
74
+  data () {
75
+    return {
76
+      tabList: [{ value: '借阅记录', id: '1' }, { value: '线上预约记录', id: '2' }],
77
+      showDialog: false,
78
+      status: '1',
79
+      page: 1,
80
+      pagesize: 10000,
81
+      reserveBooks: {},
82
+      borrowBooks: {},
83
+      currentItem: {},
84
+      borrowshow: false,
85
+      reserveshow: false,
86
+      defaultimg: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/book_default.png',
87
+    }
88
+  },
89
+  created () {
90
+    this.getList('1')
91
+    this.getList('2')
92
+  },
93
+  computed: {
94
+    myBookStatus () {
95
+      let status = ''
96
+      switch (this.currentItem.BorrowStatus) {
97
+        case '4':
98
+          status = '已预约'
99
+          break
100
+        case '1':
101
+          status = '借阅中'
102
+          break
103
+        case '0':
104
+          status = '逾期未还'
105
+          break
106
+        case '3':
107
+          status = '逾期归还'
108
+          break
109
+        case '2':
110
+          status = '已归还'
111
+          break
112
+      }
113
+      return status
114
+    },
115
+  },
116
+  components: {
117
+    libraryListItem,
118
+    slideTabH
119
+  },
120
+  methods: {
121
+    ...mapBookAction([
122
+      'getMineBook',
123
+    ]),
124
+    slideChange (e) {
125
+      if (this.status !== this.tabList[e].id) {
126
+        this.status = this.tabList[e].id
127
+        // this.page = 1
128
+        // this.getList()
129
+      }
130
+    },
131
+    borrowedRecordClick (e) { // 借阅记录点击事件
132
+      this.currentItem = e
133
+      this.showDialog = true
134
+    },
135
+    getList (status) {
136
+      const _that = this
137
+      this.getMineBook({
138
+        page: this.page,
139
+        pagesize: this.pagesize,
140
+        status: status == '1' ? '1,3,2,0' : '4',
141
+      }).then((res) => {
142
+        if (status == '1') {
143
+          _that.borrowBooks = res
144
+          _that.borrowshow = true
145
+        } else {
146
+          _that.reserveBooks = res
147
+          _that.reserveshow = true
148
+        }
149
+      })
150
+    }
151
+  }
152
+}
153
+</script>
154
+
155
+<style lang="scss" scoped>
156
+.mainPage {
157
+  .subMain {
158
+    width: 100%;
159
+    height: 100%;
160
+    position: relative;
161
+    overflow-y: scroll;
162
+    -webkit-overflow-scrolling: touch;
163
+    transform: translateZ(0);
164
+    -webkit-transform: translateZ(0);
165
+    .noData {
166
+      width: 100%;
167
+      margin: 0.5rem auto 0;
168
+      position: relative;
169
+      overflow: hidden;
170
+      img {
171
+        width: 0.7rem;
172
+        display: block;
173
+        margin: 0 auto;
174
+      }
175
+      span {
176
+        width: 100%;
177
+        display: block;
178
+        text-align: center;
179
+        line-height: 0.3rem;
180
+        color: #b4b4b4;
181
+        font-size: 0.14rem;
182
+        margin: 0.05rem auto 0;
183
+      }
184
+    }
185
+    > div {
186
+      width: 100%;
187
+      position: relative;
188
+      overflow: hidden;
189
+      > span {
190
+        width: 100%;
191
+        display: block;
192
+        white-space: nowrap;
193
+        overflow: hidden;
194
+        font-size: 0.1rem;
195
+        background: #fdecec;
196
+        color: #fc6243;
197
+        line-height: 0.24rem;
198
+        text-indent: 0.15rem;
199
+        padding-top: 0.02rem;
200
+      }
201
+      > ul {
202
+        padding: 0 0.16rem;
203
+        margin-bottom: 0.1rem;
204
+        position: relative;
205
+        overflow: hidden;
206
+        li {
207
+          margin: 0.1rem auto 0;
208
+        }
209
+      }
210
+    }
211
+  }
212
+  .borrowedRecordContent {
213
+    padding: 0.12rem;
214
+    position: relative;
215
+    overflow: hidden;
216
+    align-items: center;
217
+    .img {
218
+      width: 0.8rem;
219
+      position: relative;
220
+      overflow: hidden;
221
+      a {
222
+        width: 100%;
223
+        display: block;
224
+        height: 0;
225
+        position: relative;
226
+        overflow: hidden;
227
+        padding-bottom: 137.5%;
228
+        border-radius: 0.03rem;
229
+        background: #eee;
230
+      }
231
+    }
232
+    > div.flex-item {
233
+      position: relative;
234
+      overflow: visible;
235
+      margin-left: 0.12rem;
236
+      > div {
237
+        width: 100%;
238
+        position: relative;
239
+        overflow: visible;
240
+        > div {
241
+          text-align: right;
242
+          span {
243
+            display: inline-block;
244
+            line-height: 0.24rem;
245
+            font-size: 0.12rem;
246
+            color: #869ec3;
247
+            background: #f2f4f7;
248
+            padding: 0 0.1rem 0 0.15rem;
249
+            border-radius: 0.15rem 0 0 0.15rem;
250
+            margin-right: -0.12rem;
251
+          }
252
+          .active {
253
+            background-color: #fc5534;
254
+            color: #fff;
255
+          }
256
+        }
257
+        > span {
258
+          width: 100%;
259
+          display: block;
260
+          line-height: 0.18rem;
261
+          font-size: 0.11rem;
262
+          color: #666;
263
+          white-space: nowrap;
264
+          overflow: hidden;
265
+          text-overflow: ellipsis;
266
+          &.title {
267
+            font-size: 0.16rem;
268
+            color: #333;
269
+            line-height: 0.22rem;
270
+          }
271
+        }
272
+      }
273
+    }
274
+  }
275
+}
276
+</style>

+ 84
- 0
src/pages/user/library/navList/index.vue Dosyayı Görüntüle

@@ -0,0 +1,84 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div>
4
+      <nav class="nav">
5
+        <a v-for="(item, index) in navList" :key="index" @click="navClick(item)">
6
+          <img :src="item.BookTypeImg" alt>
7
+          <span>{{item.BookTypeName}}</span>
8
+        </a>
9
+      </nav>
10
+    </div>
11
+  </div>
12
+</template>
13
+
14
+<script>
15
+import { mapState, createNamespacedHelpers } from 'vuex'
16
+const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
17
+export default {
18
+  data () {
19
+    return {
20
+      caseid: '',
21
+    }
22
+  },
23
+  created () {
24
+    this.caseid = this.$route.query.caseid
25
+    this.getBookType({
26
+      caseid: this.caseid,
27
+      page: 1,
28
+      pagesize: 10000,
29
+    })
30
+  },
31
+  computed: {
32
+    ...mapBookState({
33
+      navList: x => x.types.list
34
+    })
35
+  },
36
+  components: {
37
+  },
38
+  methods: {
39
+    ...mapBookAction(['getBookType']),
40
+    navClick (item) {
41
+      this.$router.push({ name: 'booksList', query: { type: item.BookTypeId, caseid: this.caseid } })
42
+    }
43
+  }
44
+}
45
+</script>
46
+
47
+<style lang="scss" scoped>
48
+.mainPage {
49
+  > div {
50
+    width: 100%;
51
+    position: absolute;
52
+    left: 0;
53
+    top: 0;
54
+    bottom: 0;
55
+    overflow-y: scroll;
56
+    -webkit-overflow-scrolling: touch;
57
+    transform: translateZ(0);
58
+    -webkit-transform: translateZ(0);
59
+    .nav {
60
+      width: 100%;
61
+      position: relative;
62
+      overflow: hidden;
63
+      font-size: 0;
64
+      > a {
65
+        display: inline-block;
66
+        width: 25%;
67
+        text-align: center;
68
+        margin-top: 0.15rem;
69
+        img {
70
+          height: 0.48rem;
71
+        }
72
+        span {
73
+          width: 100%;
74
+          display: inline-block;
75
+          text-align: center;
76
+          font-size: 0.12rem;
77
+          line-height: 0.22rem;
78
+          margin: 0.08rem auto 0;
79
+        }
80
+      }
81
+    }
82
+  }
83
+}
84
+</style>

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

@@ -135,13 +135,14 @@ import logo from '../../../../common/icon/indexlogo.jpg'
135 135
 import wxsdk from '../../../../util/share'
136 136
 import noMore from '../../../../components/noMore/noMore'
137 137
 import { mapState, createNamespacedHelpers } from 'vuex'
138
+import wx from 'weixin-jsapi'
138 139
 const { mapActions: actions } = createNamespacedHelpers('app')
139 140
 const { mapActions: caseTableActions } = createNamespacedHelpers('placeOrderForCoffee')
140 141
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('case')
141 142
 const { mapState: mpRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
142 143
 const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('myCard')
143 144
 const { mapActions: mapUserCenterActions } = createNamespacedHelpers('userCenter')
144
-const wx = require('weixin-js-sdk')
145
+// const wx = require('weixin-js-sdk')
145 146
 
146 147
 export default {
147 148
   name: '',

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

@@ -10,7 +10,8 @@
10 10
         <div>
11 11
           <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">
12 12
           <img v-if="index==1" class="centerLabel" src="../../../common/icon/tabBar-icon-2.png" alt="">
13
-          <img v-if="index==2" class="centerLabel" src="../../../common/icon/tabBar-icon-3.png" alt="">
13
+          <img v-if="index==2" class="centerLabel" src="../../../common/icon/tabBar-icon-4.png" alt="">
14
+          <img v-if="index==3" class="centerLabel" src="../../../common/icon/tabBar-icon-3.png" alt="">
14 15
         </div>
15 16
         <span>{{item.name}}</span>
16 17
       </router-link>
@@ -31,6 +32,9 @@ export default {
31 32
       }, {
32 33
         pathName: 'coffeeIndex',
33 34
         name: '城咖啡'
35
+      }, {
36
+        pathName: 'libraryIndex',
37
+        name: '在线书吧'
34 38
       }, {
35 39
         pathName: 'userCenter',
36 40
         name: '会员'

+ 203
- 97
src/pages/user/mainPage/indexPage/index.vue Dosyayı Görüntüle

@@ -1,113 +1,158 @@
1 1
 <template>
2
-  <div class="mainPage">
3
-    <div class="topBanner">
4
-      <swiper :options="swiperOption" ref="mySwiper">
5
-        <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
6
-          <img :src='item.ImageUrl' class="cover" alt="" @click="jump(item)">
7
-        </swiper-slide>
8
-      </swiper>
9
-    </div>
10
-    <div class="pageTitle flex-h">
11
-      <h5 class="flex-item">
12
-        <span>银城5A全龄生活体验平台</span>
13
-      </h5>
14
-    </div>
15
-    <div class="flex-h">
16
-      <nav class="pageNav flex-item">
17
-        <router-link :to="{name:'fiveA',query:{id:item.LocationId}}" v-for="(item,index) in data.fiveA" :key="index">
18
-          <a>
19
-            <img :src="item.TypeImg" class="centerLabel cover" alt="">
20
-            <em>{{item.LocationName}}</em>
21
-          </a>
22
-          <span>{{item.Title}}</span>
23
-        </router-link>
24
-      </nav>
25
-    </div>
26
-    <div class="MsgBanner">
27
-      <div class="flex-h">
28
-        <i class="iconfont icon-xiaoxi"></i>
29
-        <span>最新消息:</span>
30
-        <div class="flex-item">
2
+  <div class="mainPage" v-if="showPage">
3
+    <div class="banner flex-h">
4
+      <div class="flex-item">
5
+        <div>
31 6
           <div>
32
-            <swiper :options="swiperOptionMsg" ref="mySwiperMsg">
33
-              <swiper-slide class="swiper-slide" v-for="(item,index) in message" :key="index">
34
-                <router-link :to="{name:'',query:{}}"><span @click="jump(item)">{{item.InfoName}}</span></router-link>
7
+            <swiper :options="swiperOption" ref="mySwiper">
8
+              <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
9
+                <img :src="item.ImageUrl" class="cover" alt @click="jump(item)">
35 10
               </swiper-slide>
36
-              <div class="swiper-pagination"  slot="pagination"></div>
37 11
             </swiper>
38 12
           </div>
39 13
         </div>
40 14
       </div>
41 15
     </div>
42
-    <div class="pageTitle flex-h">
43
-      <h5 class="flex-item">
44
-        <span>售楼处项目专题</span>
45
-      </h5>
46
-    </div>
47
-    <div class="flex-h">
48
-      <ul class="projectList flex-item">
49
-        <router-link tag="li" :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }" v-for="(item,index) in project" :key="index">
50
-          <img :src='item.CaseImageUrl' class="centerLabel cover" alt="">
16
+    <div class="subNav">
17
+      <ul class="flex-h">
18
+        <router-link
19
+          tag="li"
20
+          class="flex-item"
21
+          v-for="(item, index) in fiveA"
22
+          :to="{name:'fiveA',query:{id:item.LocationId}}"
23
+          :key="index"
24
+        >
25
+          <img :src="item.TypeImg" alt>
26
+          <span>{{item.LocationName}}</span>
51 27
         </router-link>
52 28
       </ul>
53 29
     </div>
54
-    <div style="width:100%;height:.1rem;background:#f8f8f8;margin:.25rem auto 0;"></div>
55
-    <div class="pageTitle flex-h">
56
-      <h5 class="flex-item">
57
-        <span>活动资讯</span>
58
-      </h5>
30
+    <div class="areaHeader flex-h">
31
+      <h1 class="flex-item">探索·发现</h1>
32
+      <router-link v-if="project.length>5" :to="{name: 'majorProjectsList'}">查看所有</router-link>
59 33
     </div>
60
-    <div class="flex-h">
61
-      <ul class="newsList flex-item">
62
-        <li @click="jump(item)" v-for="(item,index) in newsList" v-if="index < 5" :key="index">
63
-          <newsItem :data="item"></newsItem>
64
-        </li>
65
-      </ul>
34
+    <div class="areaContent">
35
+      <div class="scroll-h find">
36
+        <div>
37
+          <swiper :options="swiperHOption" ref="mySwiperH">
38
+            <swiper-slide
39
+              class="swiper-slide"
40
+              v-for="(item,index) in ProjectWithLocationList"
41
+              v-if="index<5"
42
+              :key="index"
43
+            >
44
+              <router-link
45
+                tag="div"
46
+                :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }"
47
+                style="width:100%;height:100%;position:relative;"
48
+              >
49
+                <img :src="getImg(item.CmsCaseImgs)" class="cover" alt>
50
+                <span v-if="item.CaseId!='all'">
51
+                  <i class="iconfont icon-dingwei"></i>
52
+                  {{item.jl}}
53
+                </span>
54
+              </router-link>
55
+            </swiper-slide>
56
+          </swiper>
57
+        </div>
58
+      </div>
59
+    </div>
60
+    <div class="areaHeader flex-h" v-if="courseList.length>0">
61
+      <h1 class="flex-item">近期课程</h1>
62
+      <router-link v-show="courseList.length>5" :to="{name: 'courseList'}">查看所有</router-link>
63
+    </div>
64
+    <div class="areaContent" v-if="courseList.length>0">
65
+      <div class="scroll-h course">
66
+        <div>
67
+          <swiper :options="swiperHOption" ref="mySwiperH">
68
+            <swiper-slide
69
+              class="swiper-slide"
70
+              v-for="(item,index) in courseList"
71
+              :key="index"
72
+              v-if="index<5"
73
+            >
74
+              <router-link
75
+                tag="div"
76
+                :to="{ name:'majorProjectsDetail', query:{ id: item.CourseId } }"
77
+                style="width:100%;position:relative;overflow:visible"
78
+              >
79
+                <div class="img">
80
+                  <img :src="item.CourseImg" class="cover centerLabel" alt>
81
+                  <span>{{item.CourseName}}</span>
82
+                </div>
83
+                <div class="price">
84
+                  <span>¥{{item.Price}}</span>
85
+                </div>
86
+                <span>{{`${toolClass.dateFormat(item.BeginDate,'yyyy.MM.dd')}~${toolClass.dateFormat(item.EndDate,'MM.dd')}`}}</span>
87
+                <span>{{item.CaseName}}</span>
88
+              </router-link>
89
+            </swiper-slide>
90
+          </swiper>
91
+        </div>
92
+      </div>
93
+    </div>
94
+    <div class="areaHeader flex-h">
95
+      <h1 class="flex-item">活动资讯</h1>
96
+    </div>
97
+    <div class="areaContent newsList flex-h">
98
+      <div class="flex-item">
99
+        <div>
100
+          <ul>
101
+            <li
102
+              class="flex-h"
103
+              v-for="(item,index) in newsList"
104
+              :key="index"
105
+              @click="jump(item)"
106
+              v-if="index<5"
107
+            >
108
+              <a class="img">
109
+                <img :src="item.ImageUrl" class="centerLabel cover" alt>
110
+              </a>
111
+              <div class="flex-item">
112
+                <div>
113
+                  <span>{{item.Title}}</span>
114
+                  <span>{{toolClass.dateFormat(item.CreateDate)}}</span>
115
+                </div>
116
+              </div>
117
+            </li>
118
+          </ul>
119
+        </div>
120
+      </div>
66 121
     </div>
67 122
   </div>
68 123
 </template>
69 124
 
70 125
 <script>
71
-import newsItem from '../../../../components/newsItem/index'
72 126
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
73 127
 import 'swiper/dist/css/swiper.css'
128
+import toolClass from '../../../../util/util'
74 129
 import { mapState, createNamespacedHelpers } from 'vuex'
75
-const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
76
-const { mapState: mapUserState } = createNamespacedHelpers('userCenter')
130
+import wx from 'weixin-jsapi'
131
+const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('index')
132
+// const wx = require('weixin-js-sdk')
133
+import wxsdk from '@/util/share'
77 134
 export default {
78 135
   name: '',
79 136
   data () {
80 137
     return {
81
-      data: {
82
-        fiveA: []
83
-      },
84
-      locationId: '',
85 138
       swiperOption: {
86 139
         observer: true,
87 140
         loop: true,
88
-        speed: 1000,
141
+        speed: 400,
89 142
         autoplay: {
90 143
           disableOnInteraction: false,
91 144
         }
92 145
       },
93
-      swiperOptionMsg: {
146
+      swiperHOption: {
94 147
         observer: true,
95
-        observeParents:true,
96
-        // slidesPerView: 3,
97
-        direction: 'vertical',
98
-        speed: 1000,
99
-        // loop: true,
100
-        autoplay: {
101
-          disableOnInteraction: false,
102
-        }
148
+        freeMode: true,
149
+        slidesPerView: 'auto',
103 150
       },
104
-      newsList: []
151
+      newsList: [],
152
+      showPage: false
105 153
     }
106 154
   },
107 155
   computed: {
108
-    ...mapUserState({
109
-      userInfo: x => x.userInfo
110
-    }),
111 156
     ...mapState({
112 157
       orgid: x => x.app.orgId,
113 158
       fiveA: x => x.index.fiveA,
@@ -115,49 +160,81 @@ export default {
115 160
       message: x => x.index.message,
116 161
       project: x => x.index.project,
117 162
       cms: x => x.index.cms,
163
+      longitude1: x => x.index.longitude1,
164
+      latitude1: x => x.index.latitude1
165
+    }),
166
+    ...mapIndexState({
167
+      courseList: x => x.courseList
118 168
     }),
119 169
     MySwiper () {
120 170
       return this.$refs.mySwiper.swiper
121 171
     },
122
-    MySwiperMsg () {
123
-      return this.$refs.MySwiperMsg.swiper
172
+    MySwiperH () {
173
+      return this.$refs.mySwiperH.swiper
174
+    },
175
+    ProjectWithLocationList () {
176
+      var data = this.project || []
177
+      if (this.latitude1 === 0 && this.longitude1 === 0) {
178
+        data.forEach((item) => {
179
+          item.jl = '未获取到当前定位'
180
+        })
181
+        return data
182
+      } else {
183
+        let arr = []
184
+        let dataNew = []
185
+        data.forEach((item) => {
186
+          if (item.Coordinate) {
187
+            item.jl = parseInt(toolClass.getGreatCircleDistance(this.latitude1, this.longitude1, item.Coordinate.split(',')[0], item.Coordinate.split(',')[1]))
188
+            arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
189
+          } else {
190
+            item.jl = 400000000
191
+            arr.push({ jl: item.jl, CmsCaseId: item.CmsCaseId })
192
+          }
193
+        })
194
+        arr.sort((a, b) => { return a.jl - b.jl })
195
+        arr.forEach((curr) => {
196
+          data.forEach((item) => {
197
+            if (curr.CmsCaseId === item.CmsCaseId && item.jl === curr.jl) {
198
+              item.jl = `距离${item.jl}米`
199
+              dataNew.push(item)
200
+            }
201
+          })
202
+        })
203
+        return dataNew
204
+      }
124 205
     }
125 206
   },
126 207
   components: {
127
-    newsItem,
128 208
     swiper,
129
-    swiperSlide,
209
+    swiperSlide
130 210
   },
131 211
   created () {
132
-    this.getIndexLocation({ orgid: this.orgid, issys: '0' }).then((res) => {
133
-      this.data.fiveA = this.fiveA
134
-      this.locationId = 'index'
135
-      this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then(() => {
136
-        this.newsList = this.cms
137
-        if (this.project !== undefined && this.project !== null) {
138
-          for (let i = 0; i < this.project.length; i++) {
139
-            if (this.project[i].CmsCaseImgs != null) {
140
-              for (let j = 0; j < this.project[i].CmsCaseImgs.length; j++) {
141
-                if (this.project[i].CmsCaseImgs[j].ImageType === 'cover') {
142
-                  this.project[i].CaseImageUrl = this.project[i].CmsCaseImgs[j].CaseImageUrl
143
-                }
144
-              }
145
-            }
146
-          }
147
-        }
212
+    let that = this
213
+    wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
214
+      title: '城的空间',
215
+      desc: '城的空间',
216
+      link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
217
+      thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
218
+    }).then(() => {
219
+      wx.getLocation({
220
+        type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
221
+        success: function (res) {
222
+          that.setLocation({ latitude1: res.latitude, longitude1: res.longitude })
223
+        },
148 224
       })
149 225
     })
226
+    that.showPage = true
227
+    that.init()
150 228
   },
151 229
   methods: {
152
-    ...mapIndexActions(['getIndexInfo']),
153
-    ...mapIndexActions(['getIndexLocation']),
230
+    ...mapIndexActions(['getIndexLocation', 'getIndexInfo', 'getCourseList', 'setLocation']),
154 231
     jump (item) {
155 232
       item.ForwardType = item.ForwardType || ''
156 233
       if (item.ForwardType === 'url') {
157 234
         window.location.href = item.ForwardUrl
158 235
         return
159 236
       } else if (item.ForwardType === 'course') {
160
-        if (item.ForwardResourceId){
237
+        if (item.ForwardResourceId) {
161 238
           this.$router.push({ name: 'majorProjectsDetail', query: { id: item.ForwardResourceId } }) // 此处去课程详情
162 239
           return
163 240
         } else {
@@ -168,6 +245,35 @@ export default {
168 245
         window.location.href = item.InfoUrl
169 246
         return
170 247
       }
248
+    },
249
+    getImg (list) {
250
+      return list.filter(item => item.ImageType === 'cover')[0].CaseImageUrl
251
+    },
252
+    init () {
253
+      this.getIndexLocation({ orgid: this.orgid, issys: '0' }).then((res) => {
254
+        // this.data.fiveA = this.fiveA
255
+        this.locationId = 'index'
256
+        this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then((res) => {
257
+          this.newsList = this.cms
258
+          if (this.project !== undefined && this.project !== null) {
259
+            for (let i = 0; i < this.project.length; i++) {
260
+              if (this.project[i].CmsCaseImgs != null) {
261
+                for (let j = 0; j < this.project[i].CmsCaseImgs.length; j++) {
262
+                  if (this.project[i].CmsCaseImgs[j].ImageType === 'cover') {
263
+                    this.project[i].CaseImageUrl = this.project[i].CmsCaseImgs[j].CaseImageUrl
264
+                  }
265
+                }
266
+              }
267
+            }
268
+          }
269
+        })
270
+        this.getCourseList({
271
+          pagesize: 10000,
272
+          page: 1
273
+        }).then(() => {
274
+          this.showPage = true
275
+        })
276
+      })
171 277
     }
172 278
   }
173 279
 }

+ 203
- 142
src/pages/user/mainPage/indexPage/page.scss Dosyayı Görüntüle

@@ -4,180 +4,241 @@
4 4
   transform: translateZ(0);
5 5
   -webkit-transform: translateZ(0);
6 6
   background: #fff;
7
-  &>*:last-child{
8
-    margin-bottom: .2rem;
9
-  }
10
-  .topBanner{
7
+  .banner{
11 8
     width: 100%;
12
-    height: 0;
13
-    position: relative;
14
-    overflow: hidden;
15
-    padding-bottom: 54%;
16
-    background: #eee;
17
-    &>div{
18
-      width: 100%;
19
-      position: absolute;
20
-      left: 0;
21
-      bottom: 0;
22
-      top: 0;
23
-    }
24
-  }
25
-  .pageTitle{
26
-    margin: .18rem auto 0;
27 9
     position: relative;
28 10
     overflow: hidden;
29
-    h5{
30
-      &::after{
31
-        content: '';
32
-        width: 100%;
33
-        height: .01rem;
34
-        background: #eee;
35
-        position: absolute;
36
-        left: 0;
37
-        top: 50%;
38
-        transform: translateY(-50%);
39
-        -webkit-transform: translateY(-50%);
40
-        z-index: 1;
41
-      }
42
-      width: 100%;
43
-      display: block; 
44
-      text-align: center;
11
+    margin: .15rem auto 0;
12
+    >div{
13
+      margin: 0 .15rem;
45 14
       position: relative;
46 15
       overflow: hidden;
47
-      margin: 0 .2rem;
48
-      span{
49
-        display: inline-block; 
50
-        line-height: .26rem;
51
-        font-size: .14rem;
52
-        font-weight: normal;
53
-        background: #fff;
54
-        position: relative;
55
-        z-index: 2;
56
-        padding: 0 .15rem;
57
-      }
58
-    }
59
-  }
60
-  .pageNav{
61
-    margin: 0 .1rem;
62
-    font-size: 0;
63
-    &>a{
64
-      width: 20%;
65
-      display: inline-block;
66
-      position: relative;
67
-      overflow: hidden;
68
-      margin-top: .15rem;
69
-      vertical-align: top;
70
-      a{
71
-        width: 70%;
72
-        display: block;
73
-        padding-bottom: 70%;
16
+      >div{
17
+        width: 100%;
74 18
         position: relative;
75 19
         overflow: hidden;
20
+        border-radius: .1rem;
21
+        height: 0;
22
+        padding-bottom: 55%;
76 23
         background: #eee;
77
-        margin: 0 auto;
78
-        border-radius: 100%;
79
-        img{
80
-          z-index: 1;
81
-        }
82
-        em{
24
+        >div{
83 25
           width: 100%;
84
-          display: block;
85 26
           position: absolute;
86 27
           left: 0;
28
+          top: 0;
87 29
           bottom: 0;
88
-          line-height: .3rem;
89
-          font-size: .11rem;
90
-          text-align: center;
91
-          color: #fff;
92
-          z-index: 2;
30
+          overflow: hidden;
31
+          border-radius: .1rem;
32
+        >div{
33
+            width: 100%;
34
+            height: 100%;
35
+            border-radius: .1rem;
36
+          }
93 37
         }
94 38
       }
95
-      span{
96
-        width: 70%;
97
-        display: block;
98
-        margin: .1rem auto 0;
99
-        line-height: .16rem;
100
-        font-size: .1rem;
101
-        text-align: center;
102
-        color: #666;
103
-      }
104 39
     }
105 40
   }
106
-  .MsgBanner{
107
-    width: 100%;
108
-    height: .44rem;
109
-    position: relative;
110
-    overflow: hidden;
111
-    background: #f8f8f8;
112
-    margin: .25rem auto 0;
113
-    &>div{
41
+  .subNav{
42
+    margin: .3rem auto 0;
43
+    ul{
114 44
       width: 100%;
115
-      position: absolute;
116
-      left: 0;
117
-      top: 0;
118
-      bottom: 0;
119
-      align-items: center;
120
-      &>i,
121
-      &>span{
122
-        color: #f05a3f;
123
-        font-size: .12rem;
124
-        margin-left: .08rem;
45
+      li{
46
+        text-align: center;
47
+        font-size: 0;
48
+        img{
49
+          display: inline-block;
50
+          height: .25rem;
51
+        }
52
+        span{
53
+          width: 100%;
54
+          display: inline-block;
55
+          text-align: center;
56
+          font-size: .14rem;
57
+          line-height: .22rem;
58
+        }
125 59
       }
126
-      &>i{
127
-        font-size: .16rem;
128
-        margin-left: .3rem;
60
+    }
61
+  }
62
+  .areaHeader{
63
+    margin: .35rem auto 0;
64
+    align-items: center;
65
+    >h1{
66
+      line-height: .28rem;
67
+      margin-left: .15rem;
68
+      font-size: .17rem;
69
+    }
70
+    >a{
71
+      font-size: .12rem;
72
+      color: #f83c00;
73
+      margin-right: .15rem;
74
+    }
75
+  }
76
+  .areaContent{
77
+    margin: .2rem auto 0;
78
+    .find{
79
+      >div{
80
+        width: 100%;
81
+        position: relative;
82
+        .swiper-container{
83
+          width: 100%;
84
+          position: relative;
85
+          .swiper-slide{
86
+            width: 1.14rem;
87
+            height: .9rem;
88
+            background: #eee;
89
+            position: relative;
90
+            overflow: hidden;
91
+            border-radius: .1rem;
92
+            margin-right: .15rem;
93
+            &:first-child{
94
+              margin-left: .15rem;
95
+            }
96
+            img{
97
+              display: inline-block;
98
+              position: relative;
99
+              z-index: 1;
100
+            }
101
+            span{
102
+              display: inline-block;
103
+              position: absolute;
104
+              z-index: 2;
105
+              width: 100%;
106
+              left: 0;
107
+              bottom: .1rem;
108
+              color: #fff;
109
+              font-size: .11rem;
110
+              i{
111
+                font-size: .12rem;
112
+                color: #fff;
113
+                margin-left: .1rem;
114
+              }
115
+            }
116
+          }
117
+        }
129 118
       }
130
-      &>div{
131
-        margin-left: .1rem;
132
-        height: 100%;
133
-        margin-right: .2rem;
134
-        &>div{
119
+    }
120
+    .course{
121
+      >div{
122
+        width: 100%;
123
+        position: relative;
124
+        .swiper-container{
135 125
           width: 100%;
136
-          height: 100%;
137 126
           position: relative;
138
-          overflow: hidden;
139
-          &>div{
140
-            width: 100%;
141
-            height: 100%;
142
-            a{
127
+          .swiper-slide{
128
+            width: 1.3rem;
129
+            position: relative;
130
+            overflow: visible;
131
+            margin-right: .25rem;
132
+            &:first-child{
133
+              margin-left: .15rem;
134
+            }
135
+            .img{
143 136
               width: 100%;
144
-              display: inline-block;
137
+              padding-bottom: 1.66rem;
138
+              background: #eee;
139
+              border-radius: .1rem;
140
+              position: relative;
145 141
               overflow: hidden;
146
-              white-space: nowrap;
147
-              text-overflow: ellipsis;
148
-              line-height: .44rem;
149
-              color: #f05a3f;
142
+              img{
143
+                z-index: 1;
144
+              }
150 145
               span{
151
-                color: #f05a3f;
146
+                width: 100%;
147
+                left: 0;
148
+                top: 0;
149
+                font-size: .13rem;
150
+                top: .1rem;
151
+                text-indent: .1rem;
152
+                display: inline-block;
153
+                z-index: 2;
154
+                position: absolute;
155
+                color: #fff;
156
+                overflow: hidden;
157
+                text-overflow: ellipsis;
158
+                white-space: nowrap;
152 159
               }
153 160
             }
161
+            .price{
162
+              position: relative;
163
+              overflow: visible;
164
+              text-align: right;
165
+              height: 0;
166
+              span{
167
+                display: inline-block;
168
+                position: relative;
169
+                z-index: 2;
170
+                line-height: .24rem;
171
+                color: #fff;
172
+                padding: 0 .1rem;
173
+                background: #ec1d24;
174
+                border-radius: .24rem;
175
+                font-size: .11rem;
176
+                transform: translate(.1rem, -.35rem);
177
+                -webkit-transform: translate(.1rem, -.35rem);
178
+                box-shadow: 0 0 .1rem .01rem rgba(236, 29, 36, .15);
179
+              }
180
+              +span{
181
+                line-height: .18rem;
182
+                font-size: .1rem;
183
+                margin: .1rem auto 0;
184
+                +span{
185
+                  line-height: .2rem;
186
+                  font-size: .13rem;
187
+                  display: block;
188
+                }
189
+              }
190
+            }
191
+            >span{
192
+              width: 100%;
193
+              display: block;
194
+              overflow: hidden;
195
+              text-overflow: ellipsis;
196
+            }
154 197
           }
155 198
         }
156 199
       }
157 200
     }
158 201
   }
159
-  .projectList{
160
-    margin: .1rem .1rem 0;
161
-    li{
162
-      width: 100%;
163
-      position: relative;
164
-      height: 0;
165
-      padding-bottom: 30%;
166
-      background: #eee;
167
-      overflow: hidden;
168
-      margin: .08rem auto 0;
169
-    }
170
-  }
171 202
   .newsList{
172
-    margin: .15rem .2rem .2rem;
173
-    &>li{
174
-      width: 100%;
175
-      display: block;
176
-      position: relative;
177
-      overflow: hidden;
178
-      border-top: .01rem solid #eee;
179
-      &:first-child{
180
-        border-top:none
203
+    >div{
204
+      margin: 0 .15rem .2rem;
205
+      >div{
206
+        width: 100%;
207
+        position: relative;
208
+        overflow: hidden;
209
+        ul{
210
+          li{
211
+            margin: .2rem auto 0;
212
+            align-items: center;
213
+            &:first-child{
214
+              margin: 0 auto;
215
+            }
216
+            .img{
217
+              width: 1.25rem;
218
+              height: .8rem;
219
+              border-radius: .1rem;
220
+              background: #eee;
221
+              position: relative;
222
+              overflow: hidden;
223
+            }
224
+            >div{
225
+              margin-left: .15rem;
226
+              span{
227
+                width: 100%;
228
+                display: block;
229
+                line-height: .24rem;
230
+                &:first-child{
231
+                  font-size: .14rem;
232
+                  font-weight: bold;
233
+                }
234
+                &:nth-child(2){
235
+                  font-size: .12rem;
236
+                  color: #9d9d9d;
237
+                }
238
+              }
239
+            }
240
+          }
241
+        }
181 242
       }
182 243
     }
183 244
   }

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

@@ -0,0 +1,344 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div>
4
+      <loadMore :on-infinite="onInfinite" :dataList="scrollData">
5
+        <div class="header flex-h">
6
+          <div class="flex-item flex-h">
7
+            <i class="iconfont icon-sousuo"></i>
8
+            <a
9
+              class="flex-item"
10
+              style="line-height: .3rem;color: #ccc;"
11
+              @click="tosearch"
12
+            >书本名称</a>
13
+          </div>
14
+          <a @click="showDialog = true">
15
+            <i class="iconfont icon-dingwei"></i>
16
+            <span>{{currentCaseName}}</span>
17
+          </a>
18
+        </div>
19
+        <nav class="nav">
20
+          <a
21
+            v-for="(item, index) in navList"
22
+            v-if="(navList || []).length < 9 || index<7"
23
+            :key="index"
24
+            @click="navClick(item)"
25
+          >
26
+            <img :src="item.BookTypeImg" alt>
27
+            <span>{{item.BookTypeName}}</span>
28
+          </a>
29
+          <a v-if="(navList || []).length > 8 " @click="moreNav()">
30
+            <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/icon_more.png" alt>
31
+            <span>更多</span>
32
+          </a>
33
+        </nav>
34
+        <div class="list">
35
+          <h1>精选推荐</h1>
36
+          <ul>
37
+            <li v-for="(item, index) in books.list" :key="index">
38
+              <libraryListItem
39
+                :data="item"
40
+                :status="mineBookStatus(item)"
41
+                @appointmentBook="appointmentBook"
42
+              ></libraryListItem>
43
+            </li>
44
+          </ul>
45
+        </div>
46
+      </loadMore>
47
+      <van-dialog v-model="showDialog" :show-confirm-button="false">
48
+        <div class="dialogContent">
49
+          <span class="title">选择案场</span>
50
+          <div>
51
+            <radio :data="cases" v-model="caseId"></radio>
52
+          </div>
53
+          <div class="btn">
54
+            <a @click="selectCaseId">确定</a>
55
+          </div>
56
+        </div>
57
+      </van-dialog>
58
+      <van-dialog v-model="showAppointmentDialog" :show-confirm-button="false">
59
+        <div class="dialogContent">
60
+          <span class="title">确认在线预约当前图书?</span>
61
+          <div>
62
+            <span style="color: #666;font-size:0.14rem;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则将取消预约资格</span>
63
+          </div>
64
+          <div class="btn">
65
+            <a @click="sureAppointmentBook">确定</a>
66
+            <a @click="showAppointmentDialog = false">取消</a>
67
+          </div>
68
+        </div>
69
+      </van-dialog>
70
+    </div>
71
+  </div>
72
+</template>
73
+
74
+<script>
75
+import loadMore from '@/components/vue-load-more/index'
76
+import libraryListItem from '../../../../components/libraryListItem/index'
77
+import radio from '../../../../components/radio/index'
78
+import toolClass from '../../../../util/util'
79
+import { mapState, createNamespacedHelpers } from 'vuex'
80
+const { mapActions: mapAppActions } = createNamespacedHelpers('app')
81
+const { mapState: mapBookState, mapActions: mapBookActions } = createNamespacedHelpers('book')
82
+import { Toast } from '../../../../../node_modules/vant';
83
+import wxsdk from '../../../../util/share'
84
+import wx from 'weixin-jsapi'
85
+// const wx = require('weixin-js-sdk')
86
+export default {
87
+  name: '',
88
+  data () {
89
+    return {
90
+      showDialog: false,
91
+      showAppointmentDialog: false,
92
+      caseId: '',
93
+      currentCaseId: '',
94
+      currentCaseName: '',
95
+      cases: [],
96
+      indexSearchKey: '',
97
+      page: 1,
98
+      pagesize: 10,
99
+      scrollData: {
100
+        noFlag: false // 暂无更多数据显示
101
+      },
102
+      reserveBookId: '',
103
+      latitude: '',
104
+      longitude: '',
105
+    }
106
+  },
107
+  computed: {
108
+    ...mapState({
109
+      userInfo: x => x.userCenter.userInfo,
110
+      CaseList: x => x.app.CaseList
111
+    }),
112
+    ...mapBookState({
113
+      navList: x => x.types.list,
114
+      books: x => x.recommends,
115
+      mineBooks: x => x.minebooks,
116
+      bookcaseid: x => x.bookcaseid,
117
+    }),
118
+    reserveEndDate () {
119
+      return toolClass.calDate(7)
120
+    }
121
+  },
122
+  components: {
123
+    libraryListItem,
124
+    radio,
125
+    loadMore
126
+  },
127
+  created () {
128
+    if (!this.CaseList.length || this.CaseList === null) {
129
+      this.getCaseList().then((res) => {
130
+        (res.cases || []).map((item) => {
131
+          this.cases.push({
132
+            value: item.CaseName,
133
+            id: item.CaseId
134
+          })
135
+        })
136
+        this.detectLoc().then(() => this.init()).catch(() => this.init())
137
+      })
138
+    } else {
139
+      (this.CaseList || []).map((item) => {
140
+        this.cases.push({
141
+          value: item.CaseName,
142
+          id: item.CaseId
143
+        })
144
+      })
145
+      this.detectLoc().then(() => this.init()).catch(() => this.init())
146
+    }
147
+  },
148
+  methods: {
149
+    ...mapAppActions(['getCaseList']),
150
+    ...mapBookActions([
151
+      'getBookType',
152
+      'getRecommendBook',
153
+      'getMineBook',
154
+      'reserveBook',
155
+      'updateRecommendBookLeftNum',
156
+      'setBookCase',
157
+    ]),
158
+    tosearch () {
159
+      if (this.currentCaseId === '') {
160
+        Toast.fail({
161
+          duration: 2000, // 持续展示 toast
162
+          forbidClick: true, // 禁用背景点击
163
+          message: '请先选择案场'
164
+        })
165
+        return 
166
+      }
167
+      this.$router.push({name: 'booksSearch', query: {caseid: this.currentCaseId}})
168
+    },
169
+    detectLoc () {
170
+      return new Promise((resolve, reject) => {
171
+        let hasSol = false
172
+        const startDt = (new Date).getTime()
173
+
174
+        // const t = window.setInterval(() => {
175
+        //   const nw = (new Date).getTime()
176
+
177
+        //   if (hasSol) {
178
+        //     window.clearInterval(t)
179
+        //     return
180
+        //   }
181
+
182
+        //   // 500 毫秒还未定位则直接取消定位
183
+        //   if ((nw - startDt) >= 500) {
184
+        //     hasSol = true
185
+        //     window.clearInterval(t)
186
+
187
+        //     this.setDefaultCase(((this.CaseList || [])[0] || {}).CaseId)
188
+        //     reject('定位超时 ...')
189
+        //   }
190
+        // }, 100)
191
+
192
+        wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
193
+          title: '城的空间',
194
+          desc: '城的空间',
195
+          link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
196
+          thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
197
+        }).then(() => {
198
+          console.log(wx.getLocation)
199
+          if (hasSol) return
200
+          hasSol = true
201
+          const that = this
202
+
203
+          // 如果已经存在案场
204
+          if (!!that.bookcaseid) {
205
+            that.currentCaseId = that.bookcaseid
206
+            that.caseId = that.bookcaseid
207
+            that.currentCaseName = (that.CaseList.filter(x => x.CaseId === that.currentCaseId)[0] || {}).CaseName
208
+            resolve()
209
+          } else {
210
+            // 如果没有案场
211
+            wx.getLocation({
212
+              type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
213
+              success: function (res) {
214
+                that.latitude = res.latitude // 纬度,浮点数,范围为90 ~ -90
215
+                that.longitude = res.longitude // 经度,浮点数,范围为180 ~ -180。
216
+                console.log('获取到位置 ->', that.latitude, that.longitude)
217
+              },
218
+              complete: function (res) {
219
+                console.log(res)
220
+                console.log('获取位置后, 不管成功与否', that.latitude, that.longitude)
221
+
222
+                if(that.latitude && that.longitude ) {
223
+                  for (let i = 0; i < that.CaseList.length; i++) {
224
+                    let result = that.CaseList[i].Coordinate.split(",")
225
+                    let latitude2 = parseFloat(result[0])
226
+                    let longitude2 = parseFloat(result[1])
227
+                    if (that.toolClass.getGreatCircleDistance(that.latitude, that.longitude, latitude2, longitude2) < 500) {
228
+                      that.currentCaseId = that.CaseList[i].CaseId
229
+                    }
230
+                  }
231
+                }
232
+
233
+                if(!that.currentCaseId) {
234
+                  that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
235
+                }
236
+
237
+                that.setDefaultCase(that.currentCaseId)
238
+                resolve()
239
+              },
240
+            })
241
+          }
242
+        }).catch((err) => {
243
+          console.log('微信初始化失败', err.message)
244
+          if (hasSol) return
245
+          hasSol = true
246
+
247
+          // 如果已经存在案场
248
+          if (!!this.bookcaseid) {
249
+            this.setDefaultCase(this.bookcaseid)
250
+          } else {
251
+            this.setDefaultCase(((that.CaseList || [])[0] || {}).CaseId)
252
+          }
253
+
254
+          reject()
255
+        })
256
+      })
257
+    },
258
+    setDefaultCase(caseID) {
259
+      this.setBookCase(caseID)
260
+      this.caseId = caseID
261
+      this.currentCaseId = caseID
262
+      this.currentCaseName = (this.CaseList.filter(x => x.CaseId === caseID)[0] || {}).CaseName
263
+    },
264
+    selectCaseId () { // 选择案场
265
+      if (this.currentCaseId !== this.caseId) {
266
+        this.currentCaseId = this.caseId
267
+        this.CaseList.map((item) => {
268
+          if (item.CaseId === this.currentCaseId) this.currentCaseName = item.CaseName
269
+        })
270
+        this.setBookCase(this.caseId)
271
+        this.page = 1
272
+        this.init()
273
+      }
274
+      this.showDialog = false
275
+    },
276
+    init () { // 初始化
277
+      this.getBookType({
278
+        caseid: this.currentCaseId,
279
+        page: 1,
280
+        pagesize: 10,
281
+      })
282
+      // this.getRecommendBook({
283
+      //   caseid: this.currentCaseId,
284
+      //   page: this.page,
285
+      //   pagesize: this.pagesize,
286
+      // })
287
+      this.$nextTick(() => {
288
+        this.onInfinite()
289
+      })
290
+    },
291
+    onInfinite () {
292
+      this.getMineBook({
293
+        page: 1,
294
+        pagesize: 1000,
295
+      })
296
+      let more = this.$el.querySelector('.load-more')
297
+      this.getRecommendBook({
298
+        caseid: this.currentCaseId,
299
+        page: this.page,
300
+        pagesize: this.pagesize,
301
+      }).then((res) => {
302
+        this.page++
303
+        res.list = res.list || []
304
+        if (res.list.length < res.pageSize) {
305
+          more.style.display = 'none'// 隐藏加载条
306
+          this.scrollData.noFlag = true
307
+        } else {
308
+          more.style.display = 'none'// 隐藏加载条
309
+        }
310
+      })
311
+    },
312
+    appointmentBook (id) { // 预约图书
313
+      this.reserveBookId = id
314
+      this.showAppointmentDialog = true
315
+    },
316
+    sureAppointmentBook () { // 确定预约图书
317
+      this.reserveBook({
318
+        bookid: this.reserveBookId,
319
+      }).then(() => {
320
+        this.updateRecommendBookLeftNum(this.reserveBookId)
321
+        this.getMineBook({
322
+          page: 1,
323
+          pagesize: 1000,
324
+        })
325
+      })
326
+      this.showAppointmentDialog = false
327
+    },
328
+    navClick (item) { // 点击nav
329
+      this.$router.push({ name: 'booksList', query: { type: item.BookTypeId, caseid: this.currentCaseId } })
330
+    },
331
+    moreNav () {
332
+      this.$router.push({ name: 'libraryNavList', query: { caseid: this.currentCaseId } })
333
+    },
334
+    mineBookStatus (item) {
335
+      return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId && (x.BorrowStatus == '4' || x.BorrowStatus == '1' || x.BorrowStatus == '0'))[0] || {}).BorrowStatus
336
+    }
337
+  }
338
+}
339
+</script>
340
+
341
+<!-- Add "scoped" attribute to limit CSS to this component only -->
342
+<style lang="scss" scoped>
343
+@import 'page.scss';
344
+</style>

+ 83
- 0
src/pages/user/mainPage/libraryIndex/page.scss Dosyayı Görüntüle

@@ -0,0 +1,83 @@
1
+.mainPage{
2
+  >div{
3
+    width: 100%;
4
+    position: absolute;
5
+    left: 0;
6
+    top: 0;
7
+    bottom: 0;
8
+    overflow-y: scroll;
9
+    -webkit-overflow-scrolling: touch;
10
+    transform: translateZ(0);
11
+    -webkit-transform: translateZ(0);
12
+    .header{
13
+      border-bottom: 1px solid #f5f5f5;
14
+      align-items: center;
15
+      padding: .1rem 0;
16
+      >div{
17
+        margin: 0 .1rem 0 .2rem;
18
+        background: #f2f2f2;
19
+        i{
20
+          font-size: .15rem;
21
+          color: #ccc;
22
+          margin-left: .08rem;
23
+          line-height: .3rem;
24
+        }
25
+        >a{
26
+          margin-left: .05rem;
27
+        }
28
+      }
29
+      >a{
30
+        margin-right: .2rem;
31
+        font-size: 0;
32
+        white-space: nowrap;
33
+        >*{
34
+          display: inline-block;
35
+          vertical-align: middle;
36
+        }
37
+      }
38
+    }
39
+    .nav{
40
+      width: 100%;
41
+      position: relative;
42
+      overflow: hidden;
43
+      font-size: 0;
44
+      >a{
45
+        display: inline-block;
46
+        width: 25%;
47
+        text-align: center;
48
+        margin-top: .15rem;
49
+        img{
50
+          height: .48rem;
51
+        }
52
+        span{
53
+          width: 100%;
54
+          display: inline-block;
55
+          text-align: center;
56
+          font-size: .12rem;
57
+          line-height: .22rem;
58
+          margin: .08rem auto 0;
59
+        }
60
+      }
61
+    }
62
+    .list{
63
+      padding: 0 .16rem;
64
+      margin: .32rem auto 0;
65
+      >h1{
66
+        line-height: .28rem;
67
+        font-size: .17rem;
68
+      }
69
+      >ul{
70
+        width: 100%;
71
+        position: relative;
72
+        overflow: hidden;
73
+        margin: .1rem auto .2rem;
74
+        >li{
75
+          width: 100%;
76
+          position: relative;
77
+          overflow: hidden;
78
+          margin: .1rem auto 0;
79
+        }
80
+      }
81
+    }
82
+  }
83
+}

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

@@ -1,42 +1,69 @@
1 1
 <template>
2 2
   <div class="mainPage">
3 3
     <div>
4
-      <div class="userTop_view" >
4
+      <div class="userTop_view" :class="{'long':user.Phone}">
5 5
         <div class="gradient_bg"></div>
6 6
         <div class="zIndex_bg"></div>
7
-        <div class="userAvatar_Border">
7
+        <div class="user-card">
8
+          <div>
9
+            <img :src="headimgurl" alt width="100%" height="100%">
10
+            <div style="margin-top: 0.06rem;">
11
+              <div>
12
+                <div class="user-name" style="display:inline-block;vertical-align: middle;">{{user.Name}}</div>
13
+                <div class="vip" style="display:inline-block;vertical-align: middle;margin-left:0.05rem">
14
+                  <span>vip1</span>
15
+                  <img src="../../../../common/icon/Rectangle.png" alt="">
16
+                </div>
17
+              </div>
18
+              <div v-if="user.Phone">{{user.Phone}}</div>
19
+              <div v-else>未绑定</div>
20
+            </div>
21
+          </div>
22
+          <div v-if="user.Phone" class="code">
23
+            <div>卡号:{{user.Barcode}}</div>
24
+            <svg style="width:100%" id="barcode"></svg>
25
+          </div>
26
+          <div v-else class="bind">
27
+            <span>请绑定手机号后查看会员条形码</span>
28
+            <span @click="bindMobile">立即绑定</span>
29
+          </div>
30
+        </div>
31
+        <!-- <div class="userAvatar_Border">
8 32
           <div class="userAvatar">
9
-            <img :src='headimgurl' alt="" width="100%" height="100%">
33
+            <img :src="headimgurl" alt width="100%" height="100%">
10 34
           </div>
11 35
         </div>
12 36
         <div class="uesr-info">
13 37
           <div class="user-name">{{user.Name}}</div>
14 38
           <div class="mobile" v-if="user.Phone">{{user.Phone}}</div>
15 39
           <div class="mobile" v-else @click="bindMobile">绑定手机号</div>
16
-        </div>
40
+        </div>-->
17 41
       </div>
18 42
       <div class="vip-privilege flex-h">
19 43
         <div class="flex-item privilege-item" @click="toCoupons">
20 44
           <div class="img-box">
21
-            <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
45
+            <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt>
22 46
           </div>
23 47
           <span>优惠券</span>
24 48
           <span>{{Nums.couponnum || 0}}张未使用</span>
25 49
         </div>
26 50
         <div class="flex-item privilege-item" @click="toCard">
27 51
           <div class="img-box">
28
-            <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
52
+            <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt>
29 53
           </div>
30 54
           <span>卡券</span>
31 55
           <span>0张未使用</span>
32 56
         </div>
33
-        <div class="flex-item privilege-item" @click="toVipDetail">
34
-          <i class="iconfont icon-01" @click.stop="toVip"></i>
57
+        <div class="flex-item privilege-item">
58
+          <!-- <i class="iconfont icon-01" @click.stop="toVip"></i> -->
35 59
           <div class="img-box">
36
-            <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
60
+            <img src="../../../../common/icon/pointer.png" width="100%" height="100%" alt>
37 61
           </div>
38
-          <span>VIP卡</span>
39
-          <span>¥{{Nums.vipbalance}} <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
62
+          <span>积分</span>
63
+          <span>0
64
+            <!-- ¥{{Nums.vipbalance}} -->
65
+            <!-- <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i> -->
66
+          </span>
40 67
         </div>
41 68
       </div>
42 69
 
@@ -57,19 +84,29 @@
57 84
           <span>抽奖记录</span>
58 85
           <i class="iconfont icon-jiantou-right"></i>
59 86
         </div>
87
+        <div class="menu-item flex-h" @click="toActiveList">
88
+          <span>活动记录</span>
89
+          <i class="iconfont icon-jiantou-right"></i>
90
+        </div>
91
+        <div class="menu-item flex-h" @click="toMyBook">
92
+          <span>我的借阅</span>
93
+          <i class="iconfont icon-jiantou-right"></i>
94
+        </div>
60 95
       </div>
61 96
     </div>
62 97
   </div>
63 98
 </template>
64 99
 
65 100
 <script>
101
+import JsBarcode from 'jsbarcode'
66 102
 import { mapState, createNamespacedHelpers } from 'vuex'
67 103
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
68 104
 export default {
69 105
   name: '',
70 106
   data () {
71 107
     return {
72
-      user: {}
108
+      user: {},
109
+      headimgurl: '',
73 110
     }
74 111
   },
75 112
   computed: {
@@ -87,8 +124,16 @@ export default {
87 124
       this.user = this.userInfo.customer
88 125
       if (this.user.AccountInfo) {
89 126
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
90
-
91
-        
127
+        this.$nextTick(() => {
128
+          if (this.user.Phone) {
129
+            JsBarcode("#barcode", this.user.Barcode, {
130
+              lineColor: '#000000',
131
+              width:2.2,
132
+              height: 60,
133
+              displayValue: false
134
+            })
135
+          }
136
+        })
92 137
       }
93 138
       this.headimgurl = this.user.Headimgurl
94 139
     })
@@ -102,7 +147,7 @@ export default {
102 147
     toVip () {
103 148
       this.$router.push({ name: 'vip' })
104 149
     },
105
-    toVipDetail() {
150
+    toVipDetail () {
106 151
       this.$router.push({ name: 'vipDetail' })
107 152
     },
108 153
     toCard () {
@@ -121,6 +166,9 @@ export default {
121 166
       var url = window.location.pathname
122 167
       window.location.href = url.replace('user.html', 'bodyCheck.html') + '#/'
123 168
     },
169
+    toMyBook () {
170
+      this.$router.push({ name: 'borrowedRecord' })
171
+    },
124 172
     toLuckdraw () {
125 173
       // ^参数约定为97
126 174
       let userid = this.userInfo.customer.CustomerId
@@ -128,6 +176,9 @@ export default {
128 176
       num = num >= 1000 ? 999 : num
129 177
       userid = `${userid}${num}`
130 178
       window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
179
+    },
180
+    toActiveList () {
181
+      this.$router.push({ name: 'activeList' })
131 182
     }
132 183
   }
133 184
 }

+ 83
- 7
src/pages/user/mainPage/userCenter/page.scss Dosyayı Görüntüle

@@ -10,11 +10,83 @@
10 10
   justify-content: center;
11 11
   align-items: center;
12 12
 }
13
+.long{
14
+  margin-bottom: .65rem;
15
+
16
+}
17
+.user-card{
18
+  width: 3.35rem;
19
+  background:rgba(255,255,255,1);
20
+  box-shadow: 0px 0px .1rem 0px rgba(0,0,0,.1);
21
+  border-radius: 8px;
22
+  position: absolute;
23
+  top: .35rem;
24
+  left: 50%;
25
+  transform: translateX(-50%);
26
+  z-index: 3;
27
+  padding: .2rem .2rem .05rem .2rem;
28
+  box-sizing: border-box;
29
+  >div:nth-of-type(1){
30
+    display: flex;
31
+    margin-bottom: .1rem;
32
+    >img{
33
+      width: .56rem;
34
+      height: .56rem;
35
+      margin-right: .1rem;
36
+      border-radius: 50%;
37
+    }
38
+    div{
39
+      color: #7D7D7D;
40
+      font-size: .14rem;
41
+    }
42
+    .user-name{
43
+      color: #000;
44
+      font-size: .18rem;
45
+    }
46
+    .vip{
47
+      width: .24rem;
48
+      position: relative;
49
+      span{
50
+        position: absolute;
51
+        top: 0;
52
+        left: 0;
53
+        font-size: .09rem;
54
+        text-align: center;
55
+        width: 100%;
56
+        line-height: .22rem;
57
+        color: #fff;
58
+      }
59
+      img{
60
+        width: 100%;
61
+      }
62
+    }
63
+  }
64
+  .code{
65
+    text-align: center;
66
+    div{
67
+      color: #999999;
68
+      text-align: left;
69
+    }
70
+  }
71
+  .bind{
72
+    margin: .1rem;
73
+    span:nth-of-type(1){
74
+      color: #7D7D7D;
75
+      font-size: .14rem;
76
+    }
77
+    span:nth-of-type(2){
78
+      border:1px solid #FC6243;
79
+      padding: .02rem .1rem .03rem;
80
+      border-radius: .2rem;
81
+      color: #FC6243;
82
+      margin-left: .1rem;
83
+    }
84
+  }
85
+}
13 86
 
14 87
 .userTop_view {
15 88
   position: relative;
16 89
   height: 1.7rem;
17
-  margin-bottom: 1.3rem;
18 90
   .gradient_bg {
19 91
     position: absolute;
20 92
     width: 100%;
@@ -24,10 +96,10 @@
24 96
   }
25 97
   .zIndex_bg {
26 98
     position: absolute;
27
-    bottom: -.6rem;
99
+    bottom: -.8rem;
28 100
     left: 0;
29 101
     width: 120%;
30
-    height: .6rem;
102
+    height: .8rem;
31 103
     transform: rotate(351.5deg);
32 104
     transform-origin: bottom left;
33 105
     z-index: 3;
@@ -71,7 +143,7 @@
71 143
     .mobile{
72 144
       color:rgba(125,125,125,1);
73 145
       font-size: .2rem;
74
-      padding-top: 10px;
146
+      padding-top: .1rem;
75 147
       text-align: center;
76 148
     }
77 149
   }
@@ -81,9 +153,10 @@
81 153
   height: 1.2rem;
82 154
   margin: 0 .25rem;
83 155
   background:rgba(255,255,255,1);
84
-  box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
85 156
   border-radius:8px;
86 157
   box-sizing: border-box;
158
+  z-index: 5;
159
+  position: relative;
87 160
   .privilege-item {
88 161
     display: flex;
89 162
     flex-flow: column nowrap;
@@ -97,8 +170,11 @@
97 170
       font-size: .18rem;
98 171
     }
99 172
     .img-box {
100
-      width: 0.24rem;
173
+      width: 0.2rem;
101 174
       height: 0.18rem;
175
+      img{
176
+        object-fit: contain;
177
+      }
102 178
     }
103 179
     span:nth-of-type(1){
104 180
       font-size: .14rem;
@@ -113,7 +189,7 @@
113 189
 }
114 190
 
115 191
 .userCenter-menu{
116
-  padding: 0.2rem 0.25rem;;
192
+  padding: 0 0.25rem 0.2rem;
117 193
   box-sizing: border-box;
118 194
   .menu-item{
119 195
     justify-content: space-between;

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

@@ -83,7 +83,8 @@ import { swiper, swiperSlide } from 'vue-awesome-swiper'
83 83
 import 'swiper/dist/css/swiper.css'
84 84
 import { mapState, createNamespacedHelpers } from 'vuex'
85 85
 const { mapActions: mapProjectActions, mapState: mapProjectState } = createNamespacedHelpers('majorProjects')
86
-const wx = require('weixin-js-sdk')
86
+import wx from 'weixin-jsapi'
87
+// const wx = require('weixin-js-sdk')
87 88
 
88 89
 export default {
89 90
   name: '',

+ 97
- 0
src/pages/user/majorProjectsList/index.vue Dosyayı Görüntüle

@@ -0,0 +1,97 @@
1
+<template>
2
+  <div class="mainPage" v-if="showPage">
3
+    <div class="flex-h">
4
+      <div class="flex-item">
5
+        <div>
6
+          <ul>
7
+            <router-link
8
+              v-for="(item, index) in project"
9
+              :key="index"
10
+              class="flex-h"
11
+              tag="li"
12
+              :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }"
13
+            >
14
+              <a class="img">
15
+                <img :src="getImg(item.CmsCaseImgs)" class="cover" alt>
16
+              </a>
17
+              <router-link
18
+                tag="div"
19
+                class="flex-item"
20
+                :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }"
21
+              >
22
+                <div>
23
+                  <span>{{item.Name}}</span>
24
+                  <span>{{item.CaseAddress}}</span>
25
+                </div>
26
+              </router-link>
27
+            </router-link>
28
+          </ul>
29
+        </div>
30
+      </div>
31
+    </div>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+import { mapState, createNamespacedHelpers } from 'vuex'
37
+const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
38
+import wx from 'weixin-jsapi'
39
+// const wx = require('weixin-js-sdk')
40
+import wxsdk from '@/util/share'
41
+export default {
42
+  name: '',
43
+  data () {
44
+    return {
45
+      showPage: false
46
+    }
47
+  },
48
+  computed: {
49
+    ...mapState({
50
+      project: x => x.index.project,
51
+      orgid: x => x.app.orgId
52
+    })
53
+  },
54
+  created () {
55
+    let that = this
56
+    wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
57
+      title: '城的空间',
58
+      desc: '城的空间',
59
+      link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
60
+      thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
61
+    }).then(() => {
62
+      wx.getLocation({
63
+        type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
64
+        success: function (res) {
65
+          that.setLocation({ latitude1: res.latitude, longitude1: res.longitude })
66
+          that.showPage = true
67
+          that.init()
68
+        },
69
+        cancel: function () {
70
+          that.showPage = true
71
+          that.init()
72
+        },
73
+        fail: function () {
74
+          that.showPage = true
75
+          that.init()
76
+        }
77
+      })
78
+    })
79
+  },
80
+  methods: {
81
+    ...mapIndexActions(['getProjectList', 'setLocation']),
82
+    getImg (list) {
83
+      return list.filter(item => item.ImageType === 'cover')[0].CaseImageUrl
84
+    },
85
+    init () {
86
+      this.getProjectList({ orgid: this.orgid, locationid: 'index' }).then(() => {
87
+        this.showPage = true
88
+      })
89
+    }
90
+  }
91
+}
92
+</script>
93
+
94
+<!-- Add "scoped" attribute to limit CSS to this component only -->
95
+<style lang="scss" scoped>
96
+@import 'page.scss';
97
+</style>

+ 55
- 0
src/pages/user/majorProjectsList/page.scss Dosyayı Görüntüle

@@ -0,0 +1,55 @@
1
+.mainPage{
2
+  background: #fff;
3
+  overflow-y: scroll;
4
+  -webkit-overflow-scrolling: touch;
5
+  transform: translateZ(0);
6
+  -webkit-transform: translateZ(0);
7
+  >div{
8
+    >div{
9
+      margin: 0 .15rem;
10
+      >div{
11
+        width: 100%;
12
+        position: relative;
13
+        overflow: hidden;
14
+        >ul{
15
+          margin: .15rem auto;
16
+          >li{
17
+            width: 100%;
18
+            position: relative;
19
+            overflow: hidden;
20
+            align-items: center;
21
+            padding: .03rem 0;
22
+            border-bottom: 1px solid #ededed;
23
+            img{
24
+              width: 1.14rem;
25
+              height: .9rem;
26
+              position: relative;
27
+              overflow: hidden;
28
+              border-radius: .05rem;
29
+            }
30
+            >div{
31
+              margin-left: .15rem;
32
+              >div{
33
+                width: 100%;
34
+                position: relative;
35
+                overflow: hidden;
36
+                >span{
37
+                  width: 100%;
38
+                  display: block;
39
+                  line-height: .2rem;
40
+                  font-size: .15rem;
41
+                  font-weight: bolder;
42
+                  &:nth-child(2){
43
+                    font-size: .13rem;
44
+                    color: #999;
45
+                    font-weight: normal;
46
+                  }
47
+                }
48
+              }
49
+            }
50
+          }
51
+        }
52
+      }
53
+    }
54
+  }
55
+}

+ 0
- 0
src/pages/user/placeOrder/page.scss Dosyayı Görüntüle


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor