张延森 6 lat temu
rodzic
commit
823ab55a6d

+ 18
- 3
config/index.js Wyświetl plik

@@ -11,15 +11,30 @@ module.exports = {
11 11
     assetsSubDirectory: 'static',
12 12
     assetsPublicPath: '/',
13 13
     proxyTable: {
14
+      '/api/shares': {
15
+        target: 'https://www.wind.com.cn', 
16
+        changeOrigin: true,
17
+        pathRewrite: {
18
+          '^/api/shares': '/',
19
+        },
20
+      },
14 21
       '/api': {
15
-        target: 'http://192.168.0.11', 
22
+        target: 'http://192.168.0.11:8080', 
23
+        changeOrigin: true,
24
+        pathRewrite: {
25
+          '^/api': '/',
26
+        },
27
+      },
28
+      '/api/ws': {
29
+        target: 'http://192.168.0.11:8081', 
16 30
         changeOrigin: true,
31
+        ws: true,
17 32
         pathRewrite: {
18
-          '^/api': '/api',
33
+          '^/api': '/',
19 34
         },
20 35
       },
21 36
       '/audio': {
22
-        target: 'http://192.168.0.11', 
37
+        target: 'http://192.168.0.11:8080', 
23 38
         changeOrigin: true
24 39
       },
25 40
     },

+ 3361
- 2803
package-lock.json
Plik diff jest za duży
Wyświetl plik


+ 1
- 0
package.json Wyświetl plik

@@ -15,6 +15,7 @@
15 15
   },
16 16
   "dependencies": {
17 17
     "axios": "^0.18.0",
18
+    "md5": "^2.2.1",
18 19
     "mescroll.js": "^1.3.8",
19 20
     "solarlunar": "^2.0.7",
20 21
     "vant": "^1.4.5",

+ 41
- 0
src/components/XMaquee/index.vue Wyświetl plik

@@ -0,0 +1,41 @@
1
+<template>
2
+  <div>
3
+    <div class="container">
4
+      <div><slot></slot></div>
5
+    </div>
6
+  </div>
7
+</template>
8
+
9
+<script>
10
+
11
+export default {
12
+  name: 'XMaquee'
13
+}
14
+</script>
15
+
16
+<style lang="scss" scoped>
17
+.container {
18
+  width: 100%;
19
+  height: 100%;
20
+  overflow: hidden;
21
+  position: relative;
22
+
23
+  div {
24
+    animation: scoll 30s linear 0s infinite;
25
+
26
+    width: 100%;
27
+    right: -100%;
28
+    top: 0;
29
+    position: absolute;
30
+  }
31
+
32
+  @keyframes scoll {
33
+    from {
34
+      right: -100%;
35
+    }
36
+    to {
37
+      right: 100%;
38
+    }
39
+  }
40
+}
41
+</style>

+ 0
- 273
src/pages/page1.vue Wyświetl plik

@@ -1,273 +0,0 @@
1
-<template>
2
-  <div class="projectIndex">
3
-    <img src="../assets/images/bg.jpg" class="centerLabel cover bg" alt>
4
-    <div class="content flex-h">
5
-      <div class="flex-item">
6
-        <div :hidden="!showSlide">
7
-          <swiper :options="swiperOption" ref="mySwiper" class="hj-swiper">
8
-            <swiper-slide class="swiper-slide" v-for="(item, index) in showPage" :key="index">
9
-              <img
10
-                v-if="item.showType === 'image'"
11
-                class="centerLabel"
12
-                width="100%"
13
-                :src="'api' + item.showContent"
14
-                alt
15
-              >
16
-              <video v-if="item.showType === 'video'" width="100%" height="100%" id="hj-vdo" autoplay muted loop>
17
-                <source :src="'api' + item.showContent" type="video/mp4" />
18
-              </video>
19
-            </swiper-slide>
20
-          </swiper>
21
-        </div>
22
-        <div :hidden="showSlide">
23
-          <ul class="centerLabel userList">
24
-            <li v-for="(item, index) in userList" :key="index" :class="{'active': item.show}">
25
-              <span>{{item.firstName}}</span>
26
-              <span>{{item.words}}</span>
27
-            </li>
28
-          </ul>
29
-        </div>
30
-      </div>
31
-    </div>
32
-  </div>
33
-</template>
34
-
35
-<script>
36
-import { createNamespacedHelpers } from 'vuex'
37
-import 'swiper/dist/css/swiper.css'
38
-import { swiper, swiperSlide } from 'vue-awesome-swiper'
39
-const { mapActions: mapUserActions } = createNamespacedHelpers('user')
40
-const { mapState: mapPageState, mapActions: mapPageActions } = createNamespacedHelpers('page')
41
-const { mapState: mapNewsState, mapActions: mapNewsActions } = createNamespacedHelpers('news')
42
-export default {
43
-  name: 'projectIndex',
44
-  data () {
45
-    return {
46
-      userList: [{
47
-        firstName: '111',
48
-        gender: '1',
49
-        show: false
50
-      }, {
51
-        firstName: '111',
52
-        gender: '1',
53
-        show: false
54
-      }, {
55
-        firstName: '111',
56
-        gender: '1',
57
-        show: false
58
-      }],
59
-      showSlide: true,
60
-      currentTimeTamp: Date.now(),
61
-      activeIndex: 0,
62
-      timer: null,
63
-      timeNum: 0,
64
-      swiperOption: {
65
-        speed: 1000,
66
-        autoplay: {
67
-          delay: 6000,
68
-          disableOnInteraction: false
69
-        }
70
-      },
71
-      num: 1,
72
-      personDelay: null
73
-    }
74
-  },
75
-  computed: {
76
-    ...mapPageState({
77
-      pages: x => x.pages
78
-    }),
79
-    ...mapNewsState({
80
-      news: x => x.news
81
-    }),
82
-    showNew () {
83
-      return ((this.news.data || {}).records || []).filter(x => x.status === 1)[0] || {}
84
-    },
85
-    showPage () {
86
-      return ((this.pages.data || {}).records || []).filter(x => x.status === 1) || []
87
-    },
88
-    mySwiper () {
89
-      return this.$refs.mySwiper.swiper
90
-    }
91
-  },
92
-  components: {
93
-    swiper,
94
-    swiperSlide
95
-  },
96
-  created () {
97
-    this.init()
98
-    window.setInterval(() => {
99
-      this.init()
100
-    }, 1000)
101
-    this.getInitData()
102
-    window.setInterval(() => {
103
-      this.getInitData()
104
-    }, 1000 * 60 * 60)
105
-    this.getPersonList()
106
-  },
107
-  updated () {
108
-    this.$nextTick(() => {
109
-      const vdo = window.document.getElementById('hj-vdo')
110
-      if (vdo) {
111
-        vdo.play()
112
-      }
113
-    })
114
-  },
115
-  methods: {
116
-    ...mapUserActions([
117
-      'getPersonB'
118
-    ]),
119
-    ...mapPageActions([
120
-      'getPagesList'
121
-    ]),
122
-    ...mapNewsActions([
123
-      'getNewsList'
124
-    ]),
125
-    returnUserList (item) { // 返回用户信息
126
-      this.showSlide = false
127
-      window.clearInterval(this.timer)
128
-      this.timeNum = 0
129
-      window.setTimeout(() => {
130
-        item.show = true
131
-      }, 100)
132
-      if (this.userList.length > 2) {
133
-        this.userList.splice(0, 1)
134
-        this.userList.push(item)
135
-      } else {
136
-        this.userList.push(item)
137
-      }
138
-      this.timer = window.setInterval(() => {
139
-        if (this.timeNum - 0 >= 5000) {
140
-          this.timeNum = 0
141
-          window.clearInterval(this.timer)
142
-          this.showSlide = true
143
-          this.userList = []
144
-        } else {
145
-          this.timeNum += 100
146
-        }
147
-      }, 100)
148
-    },
149
-    videoLoad (e) {
150
-      e.target.play()
151
-    },
152
-    init () { // 初始化
153
-      if (!new Date().getMinutes()) { // 整点更新时间
154
-        this.currentTimeTamp = Date.now()
155
-      }
156
-    },
157
-    getInitData () {
158
-      this.getPagesList({
159
-        pageNum: 1,
160
-        pageSize: 100
161
-      })
162
-      this.getNewsList({
163
-        pageNum: 1,
164
-        pageSize: 100
165
-      })
166
-    },
167
-    getPersonList () {
168
-      this.getPersonB().then(res => {
169
-        if (res && res.isShow) {
170
-          const sex = res.sex === '1' ? '先生' : '女士'
171
-          const wds = (res.words || '').replace('{{name}}', res.personName).replace('{{sex}}', sex)
172
-
173
-          this.returnUserList({
174
-            firstName: (res.classId || res.classId === 1) ? '' : res.personName,
175
-            words: wds,
176
-            show: false,
177
-            audio: `http://ycapi.jcjyhn.com/welcome-api/?t=${wds}`
178
-          })
179
-        }
180
-
181
-        if (this.personDelay) {
182
-          window.clearTimeout(this.personDelay)
183
-        }
184
-
185
-        this.personDelay = setTimeout(() => {
186
-          this.getPersonList()
187
-        }, 500)
188
-      }).catch(r => {
189
-        if (this.personDelay) {
190
-          window.clearTimeout(this.personDelay)
191
-        }
192
-
193
-        this.personDelay = setTimeout(() => {
194
-          this.getPersonList()
195
-        }, 30000)
196
-      })
197
-    }
198
-  }
199
-}
200
-</script>
201
-
202
-<!-- Add "scoped" attribute to limit CSS to this component only -->
203
-<style lang="scss" scoped>
204
-.projectIndex {
205
-  width: 100%;
206
-  height: 100%;
207
-  position: relative;
208
-  overflow: hidden;
209
-  .bg {
210
-    z-index: 1;
211
-  }
212
-  > div {
213
-    width: 100%;
214
-    height: 100%;
215
-    z-index: 2;
216
-    position: relative;
217
-    overflow: hidden;
218
-    > .flex-item {
219
-      height: 100%;
220
-      position: relative;
221
-
222
-      > div {
223
-        width: 100%;
224
-        height: 100%;
225
-        position: relative;
226
-        overflow: hidden;
227
-        border-radius: 6px;
228
-        .userList {
229
-          width: calc(100% - 80px);
230
-          overflow: hidden;
231
-          transition: all 0.3s linear;
232
-          -webkit-transition: all 0.3s linear;
233
-          text-align: center;
234
-          font-size: 0;
235
-          > li {
236
-            width: 0;
237
-            display: inline-block;
238
-            margin-left: 40px;
239
-            position: relative;
240
-            overflow: hidden;
241
-            background: rgba(255, 255, 255, 0.15);
242
-            padding: 9vh 0;
243
-            transition: all 0.3s linear;
244
-            -webkit-transition: all 0.3s linear;
245
-            &:first-child {
246
-              margin-left: 0;
247
-            }
248
-            &.active {
249
-              width: calc((100% - 80PX) / 3);
250
-            }
251
-            span {
252
-              width: 100%;
253
-              display: block;
254
-              color: #fff;
255
-              text-align: center;
256
-              line-height: 1.45;
257
-              font-size: 2.3vw;
258
-              &:first-child {
259
-                font-size: 2.8vw;
260
-                line-height: 1.3;
261
-              }
262
-            }
263
-          }
264
-        }
265
-      }
266
-
267
-      .hj-swiper {
268
-        height: 100%;
269
-      }
270
-    }
271
-  }
272
-}
273
-</style>

+ 0
- 611
src/pages/page2.vue Wyświetl plik

@@ -1,611 +0,0 @@
1
-<template>
2
-  <div class="projectIndex">
3
-    <img src="../assets/images/bg.jpg" class="centerLabel cover bg" alt>
4
-    <div class="content flex-h">
5
-      <div class="left flex-v">
6
-        <div class="weather">
7
-          <div class="date flex-h">
8
-            <span>{{currentDate}}</span>
9
-            <span class="flex-item">{{currentWeek}}</span>
10
-            <span>农历{{currentChineseDate}}</span>
11
-          </div>
12
-          <div class="weatherDetail flex-h">
13
-            <div class="imgData" v-if="weatherDetail">
14
-              <img :src="weatherIcon(weatherDetail.dayweather)" width="100%" alt>
15
-              <span>{{tempRange}}</span>
16
-            </div>
17
-            <div class="flex-item">
18
-              <div v-if="weatherDetail">
19
-                <span>今日 {{ weatherDetail.dayweather }}</span>
20
-                <ul>
21
-                  <li>
22
-                    <span>白天</span>
23
-                    <span>{{weatherDetail.daywind}} 风 {{weatherDetail.daypower}}</span>
24
-                  </li>
25
-                  <li>
26
-                    <span>晚上</span>
27
-                    <span>{{weatherDetail.nightwind}} 风 {{weatherDetail.nightpower}}</span>
28
-                  </li>
29
-                </ul>
30
-              </div>
31
-            </div>
32
-          </div>
33
-        </div>
34
-        <div class="flex-item">
35
-          <div>
36
-            <div class="centerLabel notice">
37
-              <span v-html="(showNew.content || '').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ')">
38
-              </span>
39
-              <div>
40
-                <span>{{showNew.publisher}}</span>
41
-                <span>{{FormatDate(showNew.publishDate, 'yyyy年MM月dd日')}}</span>
42
-              </div>
43
-            </div>
44
-          </div>
45
-        </div>
46
-      </div>
47
-      <div class="flex-item">
48
-        <div :hidden="!showSlide">
49
-          <swiper :options="swiperOption" ref="mySwiper">
50
-            <swiper-slide class="swiper-slide" v-for="(item, index) in showPage" :key="index">
51
-              <img
52
-                v-if="item.showType === 'image'"
53
-                class="centerLabel"
54
-                width="100%"
55
-                height="100%"
56
-                :src="'/api' + item.showContent"
57
-                alt
58
-              >
59
-              <video v-if="item.showType === 'video'" width="100%" height="100%" id="hj-vdo" autoplay muted loop>
60
-                <source :src="'/api' + item.showContent" type="video/mp4" />
61
-              </video>
62
-            </swiper-slide>
63
-          </swiper>
64
-        </div>
65
-        <div :hidden="showSlide">
66
-          <ul class="centerLabel userList">
67
-            <li v-for="(item, index) in userList" :key="index" :class="{'active': item.show}">
68
-              <span>{{item.firstName}}</span>
69
-              <span>{{item.words}}</span>
70
-            </li>
71
-          </ul>
72
-        </div>
73
-      </div>
74
-    </div>
75
-    <audio :src="audioSrc" autoplay :style="{ width: '1px', height: '1px' }" ></audio>
76
-  </div>
77
-</template>
78
-
79
-<script>
80
-import { createNamespacedHelpers } from 'vuex'
81
-import 'swiper/dist/css/swiper.css'
82
-import { swiper, swiperSlide } from 'vue-awesome-swiper'
83
-import solarLunar from 'solarLunar'
84
-// import videojs from 'video.js'
85
-const { mapState: mapUserState, mapActions: mapUserActions } = createNamespacedHelpers('user')
86
-
87
-const { mapState: mapPageState, mapActions: mapPageActions } = createNamespacedHelpers('page')
88
-
89
-const { mapState: mapNewsState, mapActions: mapNewsActions } = createNamespacedHelpers('news')
90
-export default {
91
-  name: 'projectIndex',
92
-  data () {
93
-    return {
94
-      userList: [],
95
-      currentWeek: '周',
96
-      currentTime: '00:00:00',
97
-      currentDate: 'xx年xx月xx日',
98
-      currentChineseDate: 'xx月xx日',
99
-      showSlide: true,
100
-      currentTimeTamp: Date.now(),
101
-      ChineseDate: null,
102
-      activeIndex: 0,
103
-      timer: null,
104
-      timeNum: 0,
105
-      swiperOption: {
106
-        loop: true,
107
-        speed: 1000,
108
-        autoplay: {
109
-          delay: 6000,
110
-          disableOnInteraction: false
111
-        }
112
-      },
113
-      num: 1,
114
-      audioSrc: '',
115
-      personDelay: null
116
-    }
117
-  },
118
-  computed: {
119
-    ...mapUserState({
120
-      weatherInfo: x => x.weatherInfo // 天气信息
121
-    }),
122
-    ...mapPageState({
123
-      pages: x => x.pages
124
-    }),
125
-    ...mapNewsState({
126
-      news: x => x.news
127
-    }),
128
-    showNew () {
129
-      return ((this.news.data || {}).records || []).filter(x => x.status === 1)[0] || {}
130
-    },
131
-    showPage () {
132
-      return ((this.pages.data || {}).records || []).filter(x => x.status === 1) || []
133
-    },
134
-    mySwiper () {
135
-      return this.$refs.mySwiper.swiper
136
-    },
137
-    isDay () {
138
-      return new Date(this.currentTimeTamp).getHours() <= 17 && new Date(this.currentTimeTamp).getHours() >= 6
139
-    },
140
-    weatherDetail () {
141
-      return this.weatherInfo.forecasts[0].casts[0]
142
-    },
143
-    tempRange () {
144
-      if (!this.weatherDetail) return ''
145
-      let min, max
146
-
147
-      // 这么复杂是为了避免 eslint 错误
148
-      const f = () => (this.weatherDetail.daytemp) - 0 > (this.weatherDetail.nighttemp - 0)
149
-        ? ((min = this.weatherDetail.nighttemp) | (max = this.weatherDetail.daytemp))
150
-        : ((max = this.weatherDetail.nighttemp) | (min = this.weatherDetail.daytemp))
151
-      f()
152
-
153
-      return `${min}℃ ~ ${max}℃`
154
-    }
155
-  },
156
-  components: {
157
-    swiper,
158
-    swiperSlide
159
-  },
160
-  created () {
161
-    window.console.log('---------created---------')
162
-
163
-    this.init()
164
-    window.setInterval(() => {
165
-      this.init()
166
-    }, 1000)
167
-    this.getInitData()
168
-    window.setInterval(() => {
169
-      this.getInitData()
170
-    }, 1000 * 60 * 60)
171
-    this.getPersonList()
172
-  },
173
-  updated () {
174
-    this.$nextTick(() => {
175
-      // window.__vcl__111.showTab('log')
176
-      // window.__vcl__111.show()
177
-
178
-      const vdo = window.document.getElementById('hj-vdo')
179
-      console.log(vdo)
180
-      if (vdo) {
181
-        vdo.play()
182
-      }
183
-      // videojs('hj-vdo', {
184
-      //   controls: false,
185
-      //   autoplay: true,
186
-      //   loop: true,
187
-      //   muted: true,
188
-      //   preload: 'auto'
189
-      // })
190
-      // const t = window.setInterval(() => {
191
-      //   if (this.$refs.vdo) {
192
-      //     this.$refs.vdo.play()
193
-      //     window.clearInterval(t)
194
-      //   }
195
-      // }, 2000)
196
-
197
-      // setTimeout(() => {
198
-      //   window.clearInterval(t)
199
-      // }, 60000)
200
-    })
201
-  },
202
-  methods: {
203
-    ...mapUserActions([
204
-      'getWeatherInfo',
205
-      'getPerson'
206
-    ]),
207
-    ...mapPageActions([
208
-      'getPagesList'
209
-    ]),
210
-    ...mapNewsActions([
211
-      'getNewsList'
212
-    ]),
213
-    returnUserList (item) { // 返回用户信息
214
-      this.showSlide = false
215
-      window.clearInterval(this.timer)
216
-      this.timeNum = 0
217
-      window.setTimeout(() => {
218
-        item.show = true
219
-        this.audioSrc = item.audio
220
-      }, 100)
221
-      if (this.userList.length > 2) {
222
-        this.userList = this.userList.concat(item).slice(1)
223
-      } else {
224
-        this.userList = this.userList.concat(item)
225
-      }
226
-      this.timer = window.setInterval(() => {
227
-        if (this.timeNum - 0 >= 5000) {
228
-          this.timeNum = 0
229
-          window.clearInterval(this.timer)
230
-          this.showSlide = true
231
-          this.userList = []
232
-        } else {
233
-          this.timeNum += 100
234
-        }
235
-      }, 100)
236
-    },
237
-    init () { // 初始化
238
-      this.getDate()
239
-      if (!new Date().getMinutes()) { // 整点更新时间
240
-        this.currentTimeTamp = Date.now()
241
-      }
242
-    },
243
-    getInitData () {
244
-      window.console.log('---------getInitData---------')
245
-      this.getPagesList({
246
-        pageNum: 1,
247
-        pageSize: 100
248
-      })
249
-      this.getNewsList({
250
-        pageNum: 1,
251
-        pageSize: 100
252
-      })
253
-      this.getWeatherInfo()
254
-    },
255
-    getPersonList () {
256
-      this.getPerson().then(res => {
257
-        window.console.log('---------success---------')
258
-        // this.$toast(`${(new Date().valueOf())}---------success---------`)
259
-
260
-        if (res && res.isShow) {
261
-          const sex = res.sex === '1' ? '先生' : '女士'
262
-          const voice = res.sex === '2' ? 'm' : 'f'
263
-          const wds = (res.words2 || '').replace('{{name}}', res.personName).replace('{{sex}}', sex)
264
-
265
-          this.returnUserList({
266
-            firstName: (res.classId || res.classId === 1) ? '' : res.personName,
267
-            words: wds,
268
-            show: false,
269
-            audio: `http://ycapi.jcjyhn.com/welcome-api/?t=${window.encodeURIComponent(wds)}&u=${voice}&rand=${(new Date()).valueOf()}`
270
-          })
271
-        }
272
-
273
-        if (this.personDelay) {
274
-          window.clearTimeout(this.personDelay)
275
-        }
276
-
277
-        this.personDelay = setTimeout(() => {
278
-          this.getPersonList()
279
-        }, 500)
280
-      }).catch(r => {
281
-        window.console.log('---------error---------')
282
-        // this.$toast(`${(new Date().valueOf())}---------error---------`)
283
-
284
-        if (this.personDelay) {
285
-          window.clearTimeout(this.personDelay)
286
-        }
287
-
288
-        this.personDelay = setTimeout(() => {
289
-          this.getPersonList()
290
-        }, 30000)
291
-      })
292
-    },
293
-    FormatDate (timestamp, fmt) {
294
-      if (timestamp === '0001-01-01T00:00:00Z') {
295
-        return ''
296
-      }
297
-      if (!fmt) {
298
-        fmt = 'yyyy-MM-dd hh:mm'
299
-      }
300
-
301
-      let date = new Date(timestamp)
302
-      var o = {
303
-        'M+': date.getMonth() + 1,
304
-        'd+': date.getDate(),
305
-        'h+': date.getHours(),
306
-        'm+': date.getMinutes(),
307
-        's+': date.getSeconds(),
308
-        'q+': Math.floor((date.getMonth() + 3) / 3),
309
-        'S': date.getMilliseconds()
310
-      }
311
-      if (/(y+)/.test(fmt)) {
312
-        fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
313
-      }
314
-      for (var k in o) {
315
-        if (new RegExp('(' + k + ')').test(fmt)) {
316
-          fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
317
-        }
318
-      }
319
-      return fmt
320
-    },
321
-    getDate () { // 获取当前时间
322
-      let currentTime = Date.now()
323
-      let weekday = ['日', '一', '二', '三', '四', '五', '六']
324
-      let ChineseDate = solarLunar.lunar2solar(new Date(currentTime).getFullYear(), new Date(currentTime).getMonth(), new Date(currentTime).getDate())
325
-      this.currentWeek = `星期${weekday[new Date(currentTime).getDay()]}`
326
-      this.currentTime = `${new Date(currentTime).getHours().toString().padStart(2, '0')} : ${new Date(currentTime).getMinutes().toString().padStart(2, '0')} : ${new Date(currentTime).getSeconds().toString().padStart(2, '0')}`
327
-      this.currentDate = `${new Date(currentTime).getFullYear()}年${(new Date(currentTime).getMonth() + 1).toString().padStart(2, '0')}月${new Date(currentTime).getDate().toString().padStart(2, '0')}日`
328
-      this.currentChineseDate = `${ChineseDate.monthCn}${ChineseDate.dayCn}`
329
-    },
330
-    weatherIcon (target) { // 返回天气图标
331
-      switch (target) {
332
-        case '晴':
333
-          return require('../assets/images/icon-6.png')
334
-        case '少云':
335
-        case '晴间多云':
336
-        case '多云':
337
-          return require('../assets/images/icon-4.png')
338
-        case '阴':
339
-        case '平静':
340
-          return require('../assets/images/icon-9.png')
341
-        case '有风':
342
-        case '微风':
343
-        case '和风':
344
-        case '清风':
345
-        case '强风/劲风':
346
-        case '疾风':
347
-        case '大风':
348
-        case '烈风':
349
-        case '风暴':
350
-        case '狂爆风':
351
-        case '飓风':
352
-        case '热带风暴':
353
-        case '浮尘':
354
-        case '扬沙':
355
-          return require('../assets/images/icon-1.png')
356
-        case '阵雨':
357
-        case '大雨':
358
-        case '中雨-大雨':
359
-        case '大雨-暴雨':
360
-        case '暴雨-大暴雨':
361
-        case '大暴雨-特大暴雨':
362
-        case '暴雨':
363
-        case '大暴雨':
364
-        case '特大暴雨':
365
-        case '强阵雨':
366
-        case '极端降雨':
367
-        case '雷阵雨':
368
-        case '雷阵雨并伴有冰雹':
369
-          return require('../assets/images/icon-5.png')
370
-        case '毛毛雨/细雨':
371
-        case '小雨':
372
-        case '雨':
373
-        case '中雨':
374
-        case '小雨-中雨':
375
-          return require('../assets/images/icon-3.png')
376
-        case '雨夹雪':
377
-        case '阵雨夹雪':
378
-        case '雨雪天气':
379
-        case '冻雨':
380
-          return require('../assets/images/icon-10.png')
381
-        case '阵雪':
382
-        case '小雪':
383
-        case '中雪':
384
-        case '大雪':
385
-        case '暴雪':
386
-        case '小雪-中雪':
387
-        case '中雪-大雪':
388
-        case '大雪-暴雪':
389
-        case '雪':
390
-          return require('../assets/images/icon-2.png')
391
-        case '沙尘暴':
392
-        case '强沙尘暴':
393
-        case '龙卷风':
394
-        case '雾':
395
-        case '浓雾':
396
-        case '强浓雾':
397
-        case '轻雾':
398
-        case '大雾':
399
-        case '特强浓雾':
400
-        case '霾':
401
-        case '中度霾':
402
-        case '重度霾':
403
-        case '严重霾':
404
-        default:
405
-          return require('../assets/images/icon-1.png')
406
-      }
407
-    }
408
-  }
409
-}
410
-</script>
411
-
412
-<!-- Add "scoped" attribute to limit CSS to this component only -->
413
-<style lang="scss" scoped>
414
-.projectIndex {
415
-  width: 100%;
416
-  height: 100%;
417
-  position: relative;
418
-  overflow: hidden;
419
-  .bg {
420
-    z-index: 1;
421
-  }
422
-  > div {
423
-    width: 100%;
424
-    height: 100%;
425
-    box-sizing: border-box;
426
-    border: 20px solid transparent;
427
-    z-index: 2;
428
-    position: relative;
429
-    overflow: hidden;
430
-    .left {
431
-      width: 35.5%;
432
-      position: relative;
433
-      overflow: hidden;
434
-      > div {
435
-        background: rgba(255, 255, 255, 0.15);
436
-        border-radius: 6px;
437
-      }
438
-      .weather {
439
-        width: 100%;
440
-        position: relative;
441
-        overflow: hidden;
442
-        margin-bottom: 20px;
443
-        padding: 60px 0;
444
-        .date {
445
-          align-items: center;
446
-          span {
447
-            line-height: 1.6;
448
-            font-size: 1.7vw;
449
-            color: #fff;
450
-            text-align: center;
451
-            &:first-child {
452
-              margin-left: 2.4vw;
453
-            }
454
-            &:last-child {
455
-              margin-right: 2.4vw;
456
-            }
457
-          }
458
-        }
459
-        .weatherDetail {
460
-          padding: 0 20px;
461
-          position: relative;
462
-          overflow: hidden;
463
-          margin-top: 18px;
464
-          .imgData {
465
-            width: 12.6vw;
466
-            position: relative;
467
-            overflow: hidden;
468
-            span {
469
-              width: 100%;
470
-              color: #fff;
471
-              font-size: 2vw;
472
-              line-height: 1.5;
473
-              margin-top: 20px;
474
-              display: block;
475
-            }
476
-          }
477
-          > .flex-item {
478
-            > div {
479
-              width: 100%;
480
-              position: relative;
481
-              overflow: hidden;
482
-              > span {
483
-                width: 100%;
484
-                color: #fff;
485
-                font-size: 1.2vw;
486
-                line-height: 1.8;
487
-                white-space: nowrap;
488
-                overflow: hidden;
489
-                text-overflow: ellipsis;
490
-              }
491
-              ul {
492
-                li {
493
-                  border-bottom: 1px solid #b3bcc3;
494
-                  font-size: 0;
495
-                  white-space: nowrap;
496
-                  padding: 6px 0;
497
-                  span {
498
-                    display: inline-block;
499
-                    width: 50%;
500
-                    color: #fff;
501
-                    font-size: 1.3vw;
502
-                    white-space: nowrap;
503
-                    line-height: 1.7;
504
-                  }
505
-                }
506
-              }
507
-            }
508
-          }
509
-        }
510
-      }
511
-      > .flex-item {
512
-        > div {
513
-          width: 100%;
514
-          height: 100%;
515
-          position: relative;
516
-          > .notice {
517
-            width: 100%;
518
-            box-sizing: border-box;
519
-            border-left: 2.4vw solid transparent;
520
-            border-right: 2.4vw solid transparent;
521
-            overflow: hidden;
522
-            h1 {
523
-              text-align: center;
524
-              color: #fff;
525
-              font-size: 1.9vw;
526
-              line-height: 1.6;
527
-              white-space: nowrap;
528
-              overflow: hidden;
529
-              text-overflow: ellipsis;
530
-              font-weight: normal;
531
-            }
532
-            > span {
533
-              width: 100%;
534
-              display: block;
535
-              color: #fff;
536
-              font-size: 1.2vw;
537
-              line-height: 1.6;
538
-              text-align: justify;
539
-              margin-top: 30px;
540
-            }
541
-            div {
542
-              margin-top: 30px;
543
-              span {
544
-                width: 100%;
545
-                display: block;
546
-                text-align: right;
547
-                color: #fff;
548
-                font-size: 1.2vw;
549
-                line-height: 1.6;
550
-              }
551
-            }
552
-          }
553
-        }
554
-      }
555
-    }
556
-    > .flex-item {
557
-      margin-left: 20px;
558
-      position: relative;
559
-      > div {
560
-        width: 100%;
561
-        height: 100%;
562
-        position: relative;
563
-        overflow: hidden;
564
-        border-radius: 6px;
565
-        .swiper-container {
566
-          width: 100%;
567
-          height: 100%;
568
-          position: relative;
569
-        }
570
-        .userList {
571
-          width: 35vw;
572
-          overflow: hidden;
573
-          transition: all 0.3s linear;
574
-          -webkit-transition: all 0.3s linear;
575
-          > li {
576
-            width: 100%;
577
-            position: relative;
578
-            overflow: hidden;
579
-            background: rgba(255, 255, 255, 0.15);
580
-            margin: 1.8vh auto 0;
581
-            padding: 9vh 0;
582
-            transform: translateY(100vh);
583
-            -webkit-transform: translateY(100vh);
584
-            transition: all 0.3s linear;
585
-            -webkit-transition: all 0.3s linear;
586
-            &:first-child {
587
-              margin-top: 0;
588
-            }
589
-            &.active {
590
-              transform: translateY(0);
591
-              -webkit-transform: translateY(0);
592
-            }
593
-            span {
594
-              width: 100%;
595
-              display: block;
596
-              color: #fff;
597
-              text-align: center;
598
-              line-height: 1.45;
599
-              font-size: 2.3vw;
600
-              &:first-child {
601
-                font-size: 2.8vw;
602
-                line-height: 1.3;
603
-              }
604
-            }
605
-          }
606
-        }
607
-      }
608
-    }
609
-  }
610
-}
611
-</style>

+ 82
- 5
src/pages/page3.vue Wyświetl plik

@@ -53,7 +53,7 @@
53 53
             <swiper-slide class="swiper-slide" v-for="(item, index) in pageDetail.content" :key="index">
54 54
               <img v-if="pageDetail.detail.contentType === 'image'" class="centerLabel" width="100%" height="100%" :src="item.content" alt>
55 55
               <video v-if="pageDetail.detail.contentType === 'video'" width="100%" height="100%" id="hj-vdo" autoplay muted loop>
56
-                <source :src="item.content" type="video/mp4">
56
+                <source :src="getLocalPath(item.content)" type="video/mp4">
57 57
               </video>
58 58
             </swiper-slide>
59 59
           </swiper>
@@ -75,15 +75,27 @@
75 75
         </div>
76 76
       </div>
77 77
     </div>
78
+      <x-maquee class="marquee">
79
+        <ul>
80
+          <li v-for="item in sharesData" :key="item.WindCode">
81
+            <span class="shares-name font24">{{item.Name}}</span>
82
+            <span class="shares-price font24">{{item.Price}}</span>
83
+            <span :class="{font24: true, ['shares-rate']: true, green: item.ChangeRate < 0, red: item.ChangeRate > 0 }">{{item.ChangeRate > 0 ? '+' : ''}}{{item.ChangeRate}}%</span>
84
+          </li>
85
+        </ul>
86
+      </x-maquee>
78 87
   </div>
79 88
 </template>
80 89
 
81 90
 <script>
91
+import md5 from 'md5'
82 92
 import { createNamespacedHelpers } from 'vuex'
83 93
 import 'swiper/dist/css/swiper.css'
84 94
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
85 95
 import solarLunar from 'solarLunar'
86 96
 import XWebSocket from '../util/websocket'
97
+import getShares from '../util/shares'
98
+
87 99
 const { mapState: mapPageState, mapActions: mapPageActions, mapMutations: mapPageMutations } = createNamespacedHelpers('newIndex')
88 100
 export default {
89 101
   name: 'projectIndex',
@@ -110,7 +122,10 @@ export default {
110 122
       },
111 123
       num: 1,
112 124
       personDelay: null,
113
-      pageTimer: null
125
+      pageTimer: null,
126
+      assetdir: undefined,
127
+      city: '',
128
+      sharesData: []
114 129
     }
115 130
   },
116 131
   computed: {
@@ -140,9 +155,18 @@ export default {
140 155
   },
141 156
   components: {
142 157
     swiper,
143
-    swiperSlide
158
+    swiperSlide,
159
+    XMaquee: () => import('../components/XMaquee')
144 160
   },
145 161
   created () {
162
+    this.assetdir = this.$route.query.assets || this.assetdir
163
+    this.city = this.$route.query.city || this.city
164
+
165
+    getShares().then(dt => (this.sharesData = dt))
166
+    window.setInterval(() => {
167
+      getShares().then(dt => (this.sharesData = dt))
168
+    }, 60000)
169
+
146 170
     // const _that = this
147 171
     window.setInterval(() => {
148 172
       let dels = this.users.filter(x => Date.parse(new Date()) - x.createdata > this.diffM)
@@ -162,7 +186,9 @@ export default {
162 186
       autoConnect: true
163 187
     })
164 188
 
165
-    const wsURI = `${window.location.origin.replace('http', 'ws')}/api/websocket/${this.$route.query.id}`
189
+    window.console.log(this.$route.query.id, this.$route.query)
190
+
191
+    const wsURI = `${window.location.origin.replace('http', 'ws')}/api/ws/${this.$route.query.id}`
166 192
     this.ws.connect(wsURI)
167 193
     this.init()
168 194
     this.pageTimer = window.setInterval(() => {
@@ -198,6 +224,12 @@ export default {
198 224
     ...mapPageMutations([
199 225
       'emptyPageDetail'
200 226
     ]),
227
+    getLocalPath (url = '') {
228
+      if (!this.assetdir) return url
229
+
230
+      const ext = url.split('.').pop()
231
+      return `${this.assetdir}\\${md5(url)}.${ext}`
232
+    },
201 233
     newData (info) {
202 234
       if (info.classId - 0 === 1 && this.users.filter(x => x.classId - 0 === 1).length > 0) {
203 235
         this.users = this.users.map((x) => {
@@ -252,7 +284,7 @@ export default {
252 284
     init () { // 初始化
253 285
       this.emptyPageDetail()
254 286
       this.getDate()
255
-      this.getNewIndex(this.$route.query.id)
287
+      this.getNewIndex({ id: this.$route.query.id, city: this.city })
256 288
     },
257 289
     getDate () { // 获取当前时间
258 290
       let currentTime = Date.now()
@@ -584,4 +616,49 @@ export default {
584 616
     }
585 617
   }
586 618
 }
619
+
620
+.marquee {
621
+  width: 100%;
622
+  position: absolute !important;
623
+  bottom: 2px;
624
+  left: 0;
625
+  height: 48px !important;
626
+  z-index: 999 !important;
627
+  color: #fff;
628
+  letter-spacing: 0.05em;
629
+  line-height: 48px;
630
+  background-color: rgba(0, 0, 0, 0.7);
631
+  font-weight: 700;
632
+  border: none !important;
633
+
634
+  .font24 {
635
+    font-size: 24px;
636
+  }
637
+
638
+  ul {
639
+    list-style: none;
640
+    background: transparent;
641
+  }
642
+
643
+  li {
644
+    display: inline;
645
+    & + li {
646
+      margin-left: 20px;
647
+      padding-left: 20px;
648
+      border-left: 1px solid #fff;
649
+    }
650
+  }
651
+
652
+  .shares-name {
653
+    color: #b49076;
654
+  }
655
+
656
+  .green {
657
+    color: green;
658
+  }
659
+
660
+  .red {
661
+    color: red;
662
+  }
663
+}
587 664
 </style>

+ 0
- 102
src/pages/test.vue Wyświetl plik

@@ -1,102 +0,0 @@
1
-<template>
2
-<div>
3
-  <img src="../assets/images/bg.jpg" class="centerLabel cover bg" alt>
4
-  <div style="position: relative;z-index: 101;color: #fff;" @click="newData(newinfo)"><span>增加新用户</span></div>
5
-  <div style="position: relative;z-index: 101;color: #fff;" @click="newData(vipAinfo)"><span>增加张先生</span></div>
6
-  <div style="position: relative;z-index: 101;color: #fff;" @click="newData(vipBinfo)"><span>增加王女士</span></div>
7
-  <div style="position: relative;z-index: 101;color: #fff;" @click="newData(vipCinfo)"><span>增加许女士</span></div>
8
-  <div v-if="users.length>0"  style="position: relative;z-index: 101;">
9
-    <ul class="centerLabel userList">
10
-      <!-- <userList :user-list='users'></userList> -->
11
-      <div v-for="(user, k) in users" :key="k" :item="user">
12
-        <span>{{user.firstName}}</span>
13
-        <span>{{user.words}}</span>
14
-      </div>
15
-    </ul>
16
-  </div>
17
-  <div v-if="audios.length>0" style="position: relative;z-index: 101;">
18
-    <audio v-for="(audio, k) in audios" v-if="audio.isShow" :key="k" @ended="audioEnd(k)">
19
-      <source :src="audio.url" />
20
-    </audio>
21
-  </div>
22
-</div>
23
-</template>
24
-
25
-<script>
26
-export default {
27
-  data () {
28
-    return {
29
-      users: [],
30
-      audios: [],
31
-      diffM: 5000,
32
-      newinfo: {
33
-        firstName: '',
34
-        classId: '1',
35
-        words: '欢迎光临',
36
-        url: 'aa'
37
-      },
38
-      vipAinfo: {
39
-        firstName: '张先生',
40
-        classId: '2',
41
-        words: '您好',
42
-        url: 'bb'
43
-      },
44
-      vipBinfo: {
45
-        firstName: '王女士',
46
-        classId: '2',
47
-        words: '您好~',
48
-        url: 'cc'
49
-      },
50
-      vipCinfo: {
51
-        firstName: '许女士',
52
-        classId: '2',
53
-        words: 'hello',
54
-        url: 'dd'
55
-      }
56
-    }
57
-  },
58
-  methods: {
59
-    newData (info) {
60
-      if (info.classId === '1' && this.users.filter(x => x.classId === '1').length > 0) {
61
-        this.users = this.users.map((x) => {
62
-          if (x.classId === '1') {
63
-            return {...x, createdata: Date.parse(new Date())}
64
-          } else {
65
-            return x
66
-          }
67
-        })
68
-      } else {
69
-        if (this.users.length >= 3) {
70
-          this.users.splice(0, 1)
71
-        }
72
-        this.users = [...this.users, {...info, createdata: Date.parse(new Date())}]
73
-        this.audios = [...this.audios, {...info, isShow: true, createdata: Date.parse(new Date())}]
74
-      }
75
-    },
76
-    audioEnd (index) {
77
-      let as = this.audios
78
-      this.audios = as.map((x, i) => {
79
-        if (i === index) {
80
-          x.isShow = false
81
-        }
82
-      })
83
-    }
84
-  },
85
-  created () {
86
-    const _that = this
87
-    window.setInterval(() => {
88
-      let dels = _that.users.filter(x => Date.parse(new Date()) - x.createdata > this.diffM)
89
-      dels.map(x => {
90
-        _that.users.splice(this.users.findIndex(i => i.createdata === x.createdata), 1)
91
-      })
92
-      let delaudios = _that.audios.filter(x => Date.parse(new Date()) - x.createdata > this.diffM)
93
-      delaudios.map(x => {
94
-        _that.audios.splice(this.audios.findIndex(i => i.createdata === x.createdata), 1)
95
-      })
96
-    }, 100)
97
-  }
98
-}
99
-</script>
100
-
101
-<style lang="scss" scoped>
102
-</style>

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

@@ -32,9 +32,6 @@ const store = new Vuex.Store({
32 32
   }
33 33
 })
34 34
 export const modules = {
35
-  user: () => require('./user/index').default,
36
-  news: () => require('./news/index').default,
37
-  page: () => require('./page/index').default,
38 35
   newIndex: () => require('./newIndex/index').default
39 36
 }
40 37
 

+ 2
- 1
src/store/newIndex/index.js Wyświetl plik

@@ -19,7 +19,8 @@ export default {
19 19
       return new Promise((resolve, reject) => {
20 20
         Ajax(api.newIndex.url, {
21 21
           method: api.newIndex.method,
22
-          urlData: { id: payload }
22
+          urlData: { id: payload.id },
23
+          queryData: { city: payload.city }
23 24
         }).then(res => {
24 25
           commit('updatePageDetail', res)
25 26
           resolve(res)

+ 0
- 29
src/store/news/index.js Wyświetl plik

@@ -1,29 +0,0 @@
1
-import Ajax from '../../util/ajax'
2
-import api from '../../util/api'
3
-
4
-export default {
5
-  namespaced: true,
6
-  state: {
7
-    news: {}
8
-  },
9
-  mutations: {
10
-    updateList (state, payload) {
11
-      state.news = payload
12
-    }
13
-  },
14
-  actions: {
15
-    getNewsList ({ commit }, payload) {
16
-      return new Promise((resolve, reject) => {
17
-        Ajax(api.news.url, {
18
-          method: api.news.method,
19
-          queryData: { ...payload }
20
-        }).then(res => {
21
-          commit('updateList', res)
22
-          resolve(res)
23
-        }).catch((res) => {
24
-          reject(res)
25
-        })
26
-      })
27
-    }
28
-  }
29
-}

+ 0
- 29
src/store/page/index.js Wyświetl plik

@@ -1,29 +0,0 @@
1
-import Ajax from '../../util/ajax'
2
-import api from '../../util/api'
3
-
4
-export default {
5
-  namespaced: true,
6
-  state: {
7
-    pages: {}
8
-  },
9
-  mutations: {
10
-    updateList (state, payload) {
11
-      state.pages = payload
12
-    }
13
-  },
14
-  actions: {
15
-    getPagesList ({ commit }, payload) {
16
-      return new Promise((resolve, reject) => {
17
-        Ajax(api.pages.url, {
18
-          method: api.pages.method,
19
-          queryData: { ...payload }
20
-        }).then(res => {
21
-          commit('updateList', res)
22
-          resolve(res)
23
-        }).catch((res) => {
24
-          reject(res)
25
-        })
26
-      })
27
-    }
28
-  }
29
-}

+ 0
- 94
src/store/user/index.js Wyświetl plik

@@ -1,94 +0,0 @@
1
-import Ajax from '../../util/ajax'
2
-import api from '../../util/api'
3
-
4
-export default {
5
-  namespaced: true,
6
-  state: {
7
-    weatherInfo: {
8
-      'status': '1',
9
-      'count': '1',
10
-      'info': 'OK',
11
-      'infocode': '10000',
12
-      'forecasts': [{
13
-        'city': '南京市',
14
-        'adcode': '320100',
15
-        'province': '江苏',
16
-        'reporttime': '2019-02-21 13:48:01',
17
-        'casts': [{
18
-          'date': '2019-02-21',
19
-          'week': '4',
20
-          'dayweather': '晴间多云',
21
-          'nightweather': '雨夹雪',
22
-          'daytemp': '7',
23
-          'nighttemp': '2',
24
-          'daywind': '东',
25
-          'nightwind': '东',
26
-          'daypower': '≤3',
27
-          'nightpower': '≤3'
28
-        }, {
29
-          'date': '2019-02-22',
30
-          'week': '5',
31
-          'dayweather': '小雨',
32
-          'nightweather': '多云',
33
-          'daytemp': '6',
34
-          'nighttemp': '0',
35
-          'daywind': '北',
36
-          'nightwind': '北',
37
-          'daypower': '≤3',
38
-          'nightpower': '≤3'
39
-        }, {
40
-          'date': '2019-02-23',
41
-          'week': '6',
42
-          'dayweather': '多云',
43
-          'nightweather': '多云',
44
-          'daytemp': '11',
45
-          'nighttemp': '1',
46
-          'daywind': '东北',
47
-          'nightwind': '东北',
48
-          'daypower': '≤3',
49
-          'nightpower': '≤3'
50
-        }, {
51
-          'date': '2019-02-24',
52
-          'week': '7',
53
-          'dayweather': '多云',
54
-          'nightweather': '多云',
55
-          'daytemp': '10',
56
-          'nighttemp': '4',
57
-          'daywind': '东',
58
-          'nightwind': '东',
59
-          'daypower': '≤3',
60
-          'nightpower': '≤3'
61
-        }]
62
-      }]
63
-    }
64
-  },
65
-  mutations: {
66
-    setWeatherInfo (state, data) {
67
-      state.weatherInfo = data
68
-    }
69
-  },
70
-  actions: {
71
-    getWeatherInfo (context, payload) { // 获取天气信息
72
-      return new Promise((resolve, reject) => {
73
-        Ajax(api.getWeatherInfo.url, {
74
-          method: api.getWeatherInfo.method
75
-        }).then(res => {
76
-          context.commit('setWeatherInfo', res)
77
-          resolve(res)
78
-        }).catch((res) => {
79
-          reject(res)
80
-        })
81
-      })
82
-    },
83
-    getPersonB ({ commit }) {
84
-      return Ajax(api.person.url, {
85
-        method: api.person.method
86
-      })
87
-    },
88
-    getPerson ({ commit }) {
89
-      return Ajax(api.person2.url, {
90
-        method: api.person2.method
91
-      })
92
-    }
93
-  }
94
-}

+ 16
- 0
src/util/shares.js Wyświetl plik

@@ -0,0 +1,16 @@
1
+import axios from 'axios'
2
+
3
+function getShares () {
4
+  const api = '/api/shares/NewSite/handler/IndexHandler.ashx'
5
+
6
+  return new Promise((resolve, reject) => {
7
+    axios.get(`${api}?v=${Math.random()}`).then((response) => {
8
+      resolve(response.data)
9
+    }).catch((err) => {
10
+      window.console.error(err)
11
+      reject(err.message)
12
+    })
13
+  })
14
+}
15
+
16
+export default getShares