Procházet zdrojové kódy

Merge branch '2.1.3' of http://git.ycjcjy.com/SpaceOfCheng/admin into 2.1.3

wangfei před 6 roky
rodič
revize
2742f598b5
31 změnil soubory, kde provedl 5898 přidání a 5428 odebrání
  1. 1
    1
      config/index.js
  2. 1
    1
      dist/index.html
  3. 5332
    5190
      package-lock.json
  4. 2
    0
      package.json
  5. 1
    1
      src/pages/system/cardAndCouponManager/cardManager/index.vue
  6. 1
    1
      src/pages/system/cardAndCouponManager/couponManager/index.vue
  7. 24
    17
      src/pages/system/cardAndCouponManager/vipManager/activateVip.vue
  8. 1
    1
      src/pages/system/cardAndCouponManager/vipManager/edit.vue
  9. 0
    1
      src/pages/system/courseManager/courseList/add.vue
  10. 1
    0
      src/pages/system/courseManager/courseList/index.vue
  11. 23
    23
      src/pages/system/dashboard/index.vue
  12. 7
    1
      src/pages/system/dataStatistics/goodsOrderList/index.vue
  13. 4
    3
      src/pages/system/marketingActivities/activitiesList/index.vue
  14. 28
    4
      src/pages/system/marketingActivities/addActivities/index.vue
  15. 132
    18
      src/pages/system/marketingActivities/listOfLotteryActivities/edit.vue
  16. 1
    1
      src/pages/system/marketingActivities/listOfLotteryActivities/page.scss
  17. 39
    5
      src/pages/system/marketingActivities/snapUpList/edit.vue
  18. 1
    1
      src/pages/system/marketingActivities/snapUpList/index.vue
  19. 1
    1
      src/pages/system/marketingActivities/snapUpList/page.scss
  20. 94
    138
      src/pages/system/newOrder/newOrderList/index.vue
  21. 60
    0
      src/pages/system/newOrder/newOrderList/print.vue
  22. 1
    1
      src/pages/system/systemSet/userManager/add.vue
  23. 1
    1
      src/pages/system/systemSet/userManager/edit.vue
  24. 6
    0
      src/pages/system/systemSet/userManager/index.vue
  25. 12
    2
      src/pages/system/verificationManager/drawVerification/verificationList/index.vue
  26. 12
    1
      src/pages/system/verificationManager/flashbuyVerification/verificationList/index.vue
  27. 15
    13
      src/store/goods/order.js
  28. 3
    1
      src/style/main.css
  29. 1
    1
      src/util/ajax.js
  30. 1
    0
      src/util/upload.js
  31. 92
    0
      src/util/websocket.js

+ 1
- 1
config/index.js Zobrazit soubor

@@ -15,7 +15,7 @@ module.exports = {
15 15
         target: 'http://192.168.0.62:8080', //wf
16 16
         // target: 'http://127.0.0.1:8080', 
17 17
         // target: 'http://192.168.0.11:8080', //ys
18
-        // target: 'http://192.168.0.102:8080', //hyq
18
+        // target: 'http://192.168.0.125:8080', //hyq
19 19
         // target: 'http://dev.ycjcjy.com', //frp
20 20
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
21 21
         // pathRewrite: {

+ 1
- 1
dist/index.html Zobrazit soubor

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.ee89fb0019a07dfb9399a5a73bab0752.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.3c9a16350e1e47228e4f.js></script><script type=text/javascript src=./static/js/app.bb25f2ba0fa9270e8761.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.2b6862742e5b7ddbd4c73a63f85dc175.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.d824a66773bc281133c0.js></script><script type=text/javascript src=./static/js/vendor.d93cccd3231f9f669168.js></script><script type=text/javascript src=./static/js/app.3be0be8da89125188ad1.js></script></body></html>

+ 5332
- 5190
package-lock.json
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 2
- 0
package.json Zobrazit soubor

@@ -22,6 +22,7 @@
22 22
     "g2-vue": "^1.0.1",
23 23
     "js-base64": "^2.4.8",
24 24
     "js-md5": "^0.7.3",
25
+    "quill-plugin-image": "0.0.6",
25 26
     "vue": "^2.5.2",
26 27
     "vue-amap": "^0.5.8",
27 28
     "vue-cookie": "^1.1.4",
@@ -80,6 +81,7 @@
80 81
     "postcss-import": "^11.0.0",
81 82
     "postcss-loader": "^2.0.8",
82 83
     "postcss-url": "^7.2.1",
84
+    "quill-image-extend-module": "^1.1.2",
83 85
     "rimraf": "^2.6.0",
84 86
     "sass-loader": "^7.1.0",
85 87
     "sass-resources-loader": "^1.3.3",

+ 1
- 1
src/pages/system/cardAndCouponManager/cardManager/index.vue Zobrazit soubor

@@ -92,7 +92,7 @@
92 92
               size="mini"
93 93
               type="success"
94 94
               v-if="scope.row.SendType === 'channel'"
95
-              v-clipboard:copy="clientUrl + 'user.html#/receiveChannelShared/' + scope.row.CardId + '/card/receive'"
95
+              v-clipboard:copy="clientUrl + '/wechat/user.html#/receiveChannelShared/' + scope.row.CardId + '/card/receive'"
96 96
               v-clipboard:success="onCopy"
97 97
               v-clipboard:error="onError"
98 98
               >点击复制链接</el-button>

+ 1
- 1
src/pages/system/cardAndCouponManager/couponManager/index.vue Zobrazit soubor

@@ -87,7 +87,7 @@
87 87
               size="mini"
88 88
               type="success"
89 89
               v-if="scope.row.SendType === 'channel'"
90
-              v-clipboard:copy="clientUrl + 'user.html#/receiveChannelShared/' + scope.row.CouponId + '/coupon/receive'"
90
+              v-clipboard:copy="clientUrl + '/wechat/user.html#/receiveChannelShared/' + scope.row.CouponId + '/coupon/receive'"
91 91
               v-clipboard:success="onCopy"
92 92
               v-clipboard:error="onError"
93 93
               >点击复制链接</el-button>

+ 24
- 17
src/pages/system/cardAndCouponManager/vipManager/activateVip.vue Zobrazit soubor

@@ -81,7 +81,7 @@
81 81
       </div>
82 82
       <span slot="footer" class="dialog-footer">
83 83
         <el-button @click="centerDialogVisible = false">取 消</el-button>
84
-        <el-button type="primary" @click="vipCharge">激 活</el-button>
84
+        <el-button type="primary" @click="vipCharger">激 活</el-button>
85 85
       </span>
86 86
     </el-dialog>
87 87
   </div>
@@ -97,6 +97,7 @@ export default {
97 97
   name: '',
98 98
   data () {
99 99
     return {
100
+      ajaxOff: true,
100 101
       centerDialogVisible: false,
101 102
       CardNo: '',
102 103
       salesPhone: '',
@@ -194,7 +195,7 @@ export default {
194 195
         })
195 196
       }
196 197
     },
197
-    vipCharge () {
198
+    vipCharger () {
198 199
       if (this.vip.VipCardChildCode === '') {
199 200
         this.$message({
200 201
           type: 'error',
@@ -209,22 +210,28 @@ export default {
209 210
         })
210 211
         return
211 212
       }
212
-      var that = this
213
-      this.VipCharge({
214
-        code: this.vip.VipCardChildCode,
215
-        tel: this.customer.Phone,
216
-        salesid: this.sales.UserId || '',
217
-        salesname: this.sales.RealName || '',
218
-      }).then(() => {
219
-        this.$message({
220
-          type: 'success',
221
-          message: '激活成功!',
213
+      if (this.ajaxOff) {
214
+        this.ajaxOff = false
215
+        this.VipCharge({
216
+          code: this.vip.VipCardChildCode,
217
+          tel: this.customer.Phone,
218
+          salesid: this.sales.UserId || '',
219
+          salesname: this.sales.RealName || '',
220
+        }).then(() => {
221
+          this.ajaxOff = true
222
+          this.$message({
223
+            type: 'success',
224
+            message: '激活成功!',
225
+          })
226
+          // setTimeout(() => {
227
+          //   that.setNull()
228
+          //   that.centerDialogVisible = false
229
+          // }, 1000)
230
+          this.$router.push({name: 'vipList'})
231
+        }).catch(() => {
232
+          this.ajaxOff = true
222 233
         })
223
-        setTimeout(() => {
224
-          that.setNull()
225
-          that.centerDialogVisible = false
226
-        }, 1000)
227
-      })
234
+      }
228 235
     },
229 236
   },
230 237
   mounted () { }

+ 1
- 1
src/pages/system/cardAndCouponManager/vipManager/edit.vue Zobrazit soubor

@@ -53,7 +53,7 @@
53 53
               </el-date-picker>
54 54
               <span style="line-height:40px;">至</span>
55 55
               <el-date-picker
56
-                value-format="yyyy-MM-ddT00:00:00+08:00"
56
+                value-format="yyyy-MM-ddT23:59:59+08:00"
57 57
                 v-model="postData.EndDate"
58 58
                 type="date"
59 59
                 placeholder="选择截止日期">

+ 0
- 1
src/pages/system/courseManager/courseList/add.vue Zobrazit soubor

@@ -5,7 +5,6 @@
5 5
         <li class="flex-h">
6 6
           <span>课程主图:<em>*</em></span>
7 7
           <div class="flex-item">
8
-            <div class="red-hint">建议上传750*960尺寸的图片</div>
9 8
             <div>
10 9
               <el-upload
11 10
                 class="avatar-uploader"

+ 1
- 0
src/pages/system/courseManager/courseList/index.vue Zobrazit soubor

@@ -163,6 +163,7 @@
163 163
         <li class="flex-h" style="align-items: flex-start;">
164 164
           <span>课程详情图片:</span>
165 165
           <div class="flex-item">
166
+            <div class="red-hint">建议上传750*960尺寸的图片</div>
166 167
             <div>
167 168
               <el-upload
168 169
                 class="avatar-uploader"

+ 23
- 23
src/pages/system/dashboard/index.vue Zobrazit soubor

@@ -35,7 +35,7 @@
35 35
         </div>
36 36
       </div>
37 37
     </div>
38
-    <div class="bottomData">
38
+    <div class="bottomData" :hidden="!bottomData.length">
39 39
       <div class="flex-h">
40 40
         <div class="flex-item">
41 41
           <h1>数据统计</h1>
@@ -92,24 +92,24 @@ export default {
92 92
       bottomNav: ['推荐会员新增', '排课数', '课程预约量', '饮品下单量', '到场人次'],
93 93
       bottomData: [],
94 94
       pageData: [
95
-        [
96
-          { type: 'dashboardList', remark: '列表面板', data: { title: '', list: [{ name: '会员总数', value: '1000', }, { name: '课程预约总量', value: '1000', }, { name: '饮品下单总量', value: '1000', }] } }
97
-        ],
98
-        [
99
-          { type: 'histogram', remark: '柱状图', data: { title: '今日数据', list: [{ x: '推荐会员新增', y: 38 }, { x: '课程数', y: 52 }, { x: '预约数', y: 61 }, { x: '到场人次', y: 145 }] } },
100
-          { type: 'pieDiagram', remark: '扇形图', data: { title: '明日课程预约数据', list: [{ item: '小小体验官', count: 40, percent: 0.4 }, { item: '哈他瑜伽', count: 52, percent: 0.52 }, { item: '小小飞行家', count: 8, percent: 0.08 }] } }
101
-        ],
102
-        [
103
-          { type: 'brokenLineGraph', remark: '折线图', data: { title: '下单饮品数据', list: [{ x: '09/05', y: 3 }, { x: '09/06', y: 4 }, { x: '09/07', y: 3.5 }, { x: '09/08', y: 5 }, { x: '09/09', y: 4.9 }, { x: '09/10', y: 6 }, { x: '09/11', y: 7 }, { x: '09/12', y: 9 }, { x: '09/13', y: 13 }] } },
104
-          { type: 'ringChart', remark: '环形图', data: { title: '本月课程预约', list: [{ item: '健身课程', count: 40, percent: 0.4 }, { item: '社交课程', count: 21, percent: 0.21 }, { item: '教育课程', count: 17, percent: 0.17 }, { item: '健康课程', count: 13, percent: 0.13 }, { item: '艺术课程', count: 9, percent: 0.09 }] } },
105
-        ],
106
-        [
107
-          { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 5.6 }] } },
108
-          { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 3.1 }] } },
109
-        ],
110
-        [
111
-          { type: 'brokenLineGraphGroup', remark: '折线图组合', data: { title: '下单饮品数据', list: [{ month: 'Jan', city: 'Tokyo', temperature: 7 }, { month: 'Jan', city: 'London', temperature: 3.9 }, { month: 'Feb', city: 'Tokyo', temperature: 6.9 }, { month: 'Feb', city: 'London', temperature: 4.2 }, { month: 'Mar', city: 'Tokyo', temperature: 9.5 }, { month: 'Mar', city: 'London', temperature: 5.7 }, { month: 'Apr', city: 'Tokyo', temperature: 14.5 }, { month: 'Apr', city: 'London', temperature: 8.5 }, { month: 'May', city: 'Tokyo', temperature: 18.4 }, { month: 'May', city: 'London', temperature: 11.9 }, { month: 'Jun', city: 'Tokyo', temperature: 21.5 }, { month: 'Jun', city: 'London', temperature: 15.2 }, { month: 'Jul', city: 'Tokyo', temperature: 25.2 }, { month: 'Jul', city: 'London', temperature: 17 }, { month: 'Aug', city: 'Tokyo', temperature: 26.5 }, { month: 'Aug', city: 'London', temperature: 16.6 }, { month: 'Sep', city: 'Tokyo', temperature: 23.3 }, { month: 'Sep', city: 'London', temperature: 14.2 }, { month: 'Oct', city: 'Tokyo', temperature: 18.3 }, { month: 'Oct', city: 'London', temperature: 10.3 }, { month: 'Nov', city: 'Tokyo', temperature: 13.9 }, { month: 'Nov', city: 'London', temperature: 6.6 }, { month: 'Dec', city: 'Tokyo', temperature: 9.6 }, { month: 'Dec', city: 'London', temperature: 4.8 }] } },
112
-        ],
95
+        // [
96
+        //   { type: 'dashboardList', remark: '列表面板', data: { title: '', list: [{ name: '会员总数', value: '1000', }, { name: '课程预约总量', value: '1000', }, { name: '饮品下单总量', value: '1000', }] } }
97
+        // ],
98
+        // [
99
+        //   { type: 'histogram', remark: '柱状图', data: { title: '今日数据', list: [{ x: '推荐会员新增', y: 38 }, { x: '课程数', y: 52 }, { x: '预约数', y: 61 }, { x: '到场人次', y: 145 }] } },
100
+        //   { type: 'pieDiagram', remark: '扇形图', data: { title: '明日课程预约数据', list: [{ item: '小小体验官', count: 40, percent: 0.4 }, { item: '哈他瑜伽', count: 52, percent: 0.52 }, { item: '小小飞行家', count: 8, percent: 0.08 }] } }
101
+        // ],
102
+        // [
103
+        //   { type: 'brokenLineGraph', remark: '折线图', data: { title: '下单饮品数据', list: [{ x: '09/05', y: 3 }, { x: '09/06', y: 4 }, { x: '09/07', y: 3.5 }, { x: '09/08', y: 5 }, { x: '09/09', y: 4.9 }, { x: '09/10', y: 6 }, { x: '09/11', y: 7 }, { x: '09/12', y: 9 }, { x: '09/13', y: 13 }] } },
104
+        //   { type: 'ringChart', remark: '环形图', data: { title: '本月课程预约', list: [{ item: '健身课程', count: 40, percent: 0.4 }, { item: '社交课程', count: 21, percent: 0.21 }, { item: '教育课程', count: 17, percent: 0.17 }, { item: '健康课程', count: 13, percent: 0.13 }, { item: '艺术课程', count: 9, percent: 0.09 }] } },
105
+        // ],
106
+        // [
107
+        //   { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 5.6 }] } },
108
+        //   { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 3.1 }] } },
109
+        // ],
110
+        // [
111
+        //   { type: 'brokenLineGraphGroup', remark: '折线图组合', data: { title: '下单饮品数据', list: [{ month: 'Jan', city: 'Tokyo', temperature: 7 }, { month: 'Jan', city: 'London', temperature: 3.9 }, { month: 'Feb', city: 'Tokyo', temperature: 6.9 }, { month: 'Feb', city: 'London', temperature: 4.2 }, { month: 'Mar', city: 'Tokyo', temperature: 9.5 }, { month: 'Mar', city: 'London', temperature: 5.7 }, { month: 'Apr', city: 'Tokyo', temperature: 14.5 }, { month: 'Apr', city: 'London', temperature: 8.5 }, { month: 'May', city: 'Tokyo', temperature: 18.4 }, { month: 'May', city: 'London', temperature: 11.9 }, { month: 'Jun', city: 'Tokyo', temperature: 21.5 }, { month: 'Jun', city: 'London', temperature: 15.2 }, { month: 'Jul', city: 'Tokyo', temperature: 25.2 }, { month: 'Jul', city: 'London', temperature: 17 }, { month: 'Aug', city: 'Tokyo', temperature: 26.5 }, { month: 'Aug', city: 'London', temperature: 16.6 }, { month: 'Sep', city: 'Tokyo', temperature: 23.3 }, { month: 'Sep', city: 'London', temperature: 14.2 }, { month: 'Oct', city: 'Tokyo', temperature: 18.3 }, { month: 'Oct', city: 'London', temperature: 10.3 }, { month: 'Nov', city: 'Tokyo', temperature: 13.9 }, { month: 'Nov', city: 'London', temperature: 6.6 }, { month: 'Dec', city: 'Tokyo', temperature: 9.6 }, { month: 'Dec', city: 'London', temperature: 4.8 }] } },
112
+        // ],
113 113
       ],
114 114
     }
115 115
   },
@@ -148,10 +148,10 @@ export default {
148 148
   },
149 149
   mounted () {
150 150
     this.$nextTick(function () {
151
-      if (this.defaultCaseId !== null) {
152
-        this.getData(this.defaultCaseId)
153
-        this.getBottomData(this.defaultCaseId, this.bottomSelectValue)
154
-      }
151
+      // if (this.defaultCaseId !== null) {
152
+      //   this.getData(this.defaultCaseId)
153
+      //   this.getBottomData(this.defaultCaseId, this.bottomSelectValue)
154
+      // }
155 155
     })
156 156
   },
157 157
   methods: {

+ 7
- 1
src/pages/system/dataStatistics/goodsOrderList/index.vue Zobrazit soubor

@@ -81,7 +81,7 @@
81 81
               <span>案场:{{returnListItem(goodsOrderList, index).CaseName}}</span>
82 82
               <span>用户类型:{{returnListItem(goodsOrderList, index).UserType === 'sales' ? '销售' : returnListItem(goodsOrderList, index).UserType === 'manager' ? '主管' : '用户'}}</span>
83 83
               <span>下单时间:{{toolClass.dateFormat(returnListItem(goodsOrderList, index).CreateDate)}}</span>
84
-              <span>支付方式:{{returnListItem(goodsOrderList, index).PayTypeStr}}</span>
84
+              <span>支付方式:{{returnStr(returnListItem(goodsOrderList, index).PayType)}}</span>
85 85
             </div>
86 86
             <span>{{returnStatus(returnListItem(goodsOrderList, index).MakeStatus)}}</span>
87 87
           </div>
@@ -189,6 +189,9 @@ export default {
189 189
       }, {
190 190
         value: '积分',
191 191
         id: 'points'
192
+      }, {
193
+        value: '城币+优惠券',
194
+        id: 'coupon-coin'
192 195
       }],
193 196
       statusList: [{
194 197
         value: '',
@@ -249,6 +252,9 @@ export default {
249 252
           return '已取消'
250 253
       }
251 254
     },
255
+    returnStr (val) {
256
+      return (this.paytype.filter(x => x.id === val)[0] || {}).value || ''
257
+    },
252 258
     returnListItem (target, index) {
253 259
       return target[Math.ceil((index + 1) / 2) - 1]
254 260
     },

+ 4
- 3
src/pages/system/marketingActivities/activitiesList/index.vue Zobrazit soubor

@@ -152,6 +152,7 @@ export default {
152 152
       if (desc === '') {
153 153
         return 0
154 154
       }
155
+      desc = desc.replace(/\n/g, '')
155 156
       const descjson = JSON.parse(desc)
156 157
       return descjson.giftNum
157 158
     },
@@ -162,11 +163,11 @@ export default {
162 163
       return '未知'
163 164
     },
164 165
     getGiftLabel (desc) {
165
-      if (desc === '') {
166
+      if (desc === '' || desc === null) {
166 167
         return '未知卡券'
167 168
       }
168
-      const descjson = JSON.parse(desc)
169
-      return descjson.giftLabel
169
+      desc = desc.replace(/\n/g, '')
170
+      return JSON.parse(desc).giftLabel
170 171
     },
171 172
     handleSizeChange (val) {
172 173
       // console.log(`每页 ${val} 条`)

+ 28
- 4
src/pages/system/marketingActivities/addActivities/index.vue Zobrazit soubor

@@ -110,6 +110,8 @@
110 110
 <script>
111 111
 import { mapState, createNamespacedHelpers } from 'vuex'
112 112
 const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
113
+const { mapActions: mapCardActions } = createNamespacedHelpers('card')
114
+const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
113 115
 
114 116
 export default {
115 117
   data () {
@@ -184,14 +186,36 @@ export default {
184 186
       'getCardListByCaseId',
185 187
       'getCouponListByCaseId',
186 188
     ]),
189
+    ...mapCardActions([
190
+      'GetCardList',
191
+    ]),
192
+    ...mapCouponActions([
193
+      'GetCouponList',
194
+    ]),
187 195
     caseChange () { // 更换案场请求卡券列表
188
-      this.getCardListByCaseId(this.CaseId).then((res) => {
196
+      this.GetCardList({
197
+        page: 1,
198
+        pagesize: 100000,
199
+        sendtype: 'system',
200
+        usetype: 'luckdraw',
201
+        usedid: this.$route.query.id || '',
202
+        caseid: this.CaseId,
203
+      }).then((res) => {
189 204
         // console.log(JSON.stringify(res))
190
-        this.cardList = res
205
+        this.cardList = res.list || []
206
+        // console.log(JSON.stringify(this.cardList))
191 207
       })
192
-      this.getCouponListByCaseId(this.CaseId).then((res) => {
208
+      this.GetCouponList({
209
+        page: 1,
210
+        pagesize: 100000,
211
+        sendtype: 'system',
212
+        usetype: 'luckdraw',
213
+        usedid: this.$route.query.id || '',
214
+        caseid: this.CaseId,
215
+      }).then((res) => {
193 216
         // console.log(JSON.stringify(res))
194
-        this.couponList = res
217
+        this.couponList = res.list || []
218
+        // console.log(JSON.stringify(this.couponList))
195 219
       })
196 220
     },
197 221
     redirection (pathName) { // 重定向

+ 132
- 18
src/pages/system/marketingActivities/listOfLotteryActivities/edit.vue Zobrazit soubor

@@ -28,7 +28,7 @@
28 28
                 <span>案场:<em>*</em></span>
29 29
                 <div class="flex-item">
30 30
                   <div style="width:50%">
31
-                    <el-select :disabled="!editAll || isread" v-model="CaseId" placeholder="请选择案场">
31
+                    <el-select :disabled="!editAll || isread" v-model="CaseId" @change="selectCase" placeholder="请选择案场">
32 32
                       <el-option
33 33
                         v-for="item in cases"
34 34
                         :key="item.CaseId"
@@ -79,16 +79,16 @@
79 79
                 <div class="flex-item">
80 80
                   <div>
81 81
                     <div class="drawTemplateItem" v-for="(item,index) in templateList" :key="index">
82
-                      <a :class="{'active': templateActiveIndex === index}" @click="cutTemplate(index)" @dblclick="dbTemplateClick(index)">
82
+                      <a :class="{'active': templateActiveIndex === index}" @click="cutTemplate(index)">
83 83
                         <input type="file" :ref="'templateImg' + index" hidden @change="templateImgChange(item, $event)">
84 84
                         <img :src="item.MiniPic" style="width:100%;height:100%;object-fit: contain;">
85 85
                       </a>
86
-                      <span style="width:100%;display:block;text-align:center;font-size:11px;color:#ccc;margin-bottom:5px;">(双击更换背景图)</span>
87
-                      <el-button
86
+                      <!-- <span style="width:100%;display:block;text-align:center;font-size:11px;color:#ccc;margin-bottom:5px;">(双击更换背景图)</span> -->
87
+                      <!-- <el-button
88 88
                         v-if="item.currentImg !== ''"
89 89
                         size="mini"
90 90
                         @click="resetCurrentImg(item, index)"
91
-                        type="success">重置</el-button>
91
+                        type="success">重置</el-button> -->
92 92
                     </div>
93 93
                   </div>
94 94
                 </div>
@@ -96,9 +96,23 @@
96 96
               <li class="flex-h">
97 97
                 <span>模板背景图:</span>
98 98
                 <div class="flex-item">
99
-                  <div style="width:300px;" :style="{height: this.postData.Imgs.length ? '300px' : '40px'}">
100
-                    <img v-if="this.postData.Imgs.length" class="contain" :src="this.postData.Imgs[0].ImgUrl" alt="">
101
-                    <span v-else style="line-height:40px;font-size:11px;color:#ccc;">默认背景图</span>
99
+                  <div style="width:300px;text-align:center" v-for="(item,index) in templateList" :key="index" v-if="index === templateActiveIndex">
100
+                    <div :style="{height: item.currentImg ? '300px' : '40px'}">
101
+                      <img v-if="item.currentImg" class="contain currentImg" :src="item.currentImg" alt="" @dblclick="dbTemplateClick(index)">
102
+                      <!-- <span v-else style="width:100%;line-height:40px;font-size:11px;color:#ccc;text-align:left;display:block;">默认背景图</span> -->
103
+                      <el-button
104
+                        v-else
105
+                        style="float:left;margin-top:5px;"
106
+                        size="mini"
107
+                        @click="dbTemplateClick(index)"
108
+                        type="success">更换背景图</el-button>
109
+                    </div>
110
+                    <span v-if="item.currentImg" style="width:100%;display:block;text-align:center;font-size:11px;color:#ccc;margin-bottom:5px;">(双击更换背景图)</span>
111
+                    <el-button
112
+                      v-if="item.currentImg"
113
+                      size="mini"
114
+                      @click="resetCurrentImg(item, index)"
115
+                      type="success">重置</el-button>
102 116
                   </div>
103 117
                 </div>
104 118
               </li>
@@ -378,6 +392,7 @@
378 392
             <div class="flex-item">
379 393
               <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'card'" @change="cardChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
380 394
                 <el-option
395
+                  :disabled="!item.select"
381 396
                   v-for="item in cardList"
382 397
                   :key="item.CardId"
383 398
                   :label="item.CardName"
@@ -386,6 +401,7 @@
386 401
               </el-select>
387 402
               <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'coupon'" @change="couponChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
388 403
                 <el-option
404
+                  :disabled="!item.select"
389 405
                   v-for="item in couponList"
390 406
                   :key="item.CouponId"
391 407
                   :label="item.CouponName"
@@ -453,7 +469,7 @@
453 469
                 <div style="display: inline-block;">
454 470
                   <el-date-picker
455 471
                     :disabled="!editAll || isread"
456
-                    value-format="yyyy-MM-ddT00:00:00+08:00"
472
+                    value-format="yyyy-MM-ddT23:59:59+08:00"
457 473
                     v-model="addPrizeInfo.VerificationEnd"
458 474
                     type="date"
459 475
                     placeholder="选择截止日期">
@@ -548,11 +564,13 @@
548 564
       <div style="text-align:center;padding-bottom:20px;">
549 565
       </div>
550 566
     </el-dialog>
567
+    <div id="hiddenRule" style="display:none;"></div>
551 568
   </div>
552 569
 </template>
553 570
 <script>
554 571
 import { mapState, createNamespacedHelpers } from 'vuex'
555 572
 import { quillEditor } from 'vue-quill-editor'
573
+import uploadImage from 'quill-plugin-image'
556 574
 const { mapState: mapActivityLuckDrawState, mapActions: mapActivityLuckDrawActions } = createNamespacedHelpers('activityLuckDraw')
557 575
 const { mapActions: mapCardActions } = createNamespacedHelpers('card')
558 576
 const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
@@ -655,6 +673,14 @@ export default {
655 673
   components: {
656 674
     quillEditor,
657 675
   },
676
+  mounted () {
677
+    uploadImage(this.$refs.myQuillEditor.quill, file => {
678
+      return this.toolClass.upload({ file }).then(data => {
679
+        const url = data.result.url
680
+        return { src: url, alt: '' }
681
+      })
682
+    })
683
+  },
658 684
   created () {
659 685
     if (this.$route.query.isread) {
660 686
       this.isread = true
@@ -663,16 +689,28 @@ export default {
663 689
       page: 1,
664 690
       pagesize: 100000,
665 691
       sendtype: 'system',
666
-      usetype: 'luckdraw'
692
+      usetype: 'luckdraw',
693
+      usedid: this.$route.query.id || '',
694
+      caseid: this.CaseId,
667 695
     }).then((res) => {
696
+      res.list = res.list || []
697
+      for (var n = 0; n < res.list.length; n++) {
698
+        res.list[n].select = true
699
+      }
668 700
       this.cardList = res.list
669 701
     })
670 702
     this.GetCouponList({ // 获取券列表
671 703
       page: 1,
672 704
       pagesize: 100000,
673 705
       sendtype: 'system',
674
-      usetype: 'luckdraw'
706
+      usetype: 'luckdraw',
707
+      usedid: this.$route.query.id || '',
708
+      caseid: this.CaseId,
675 709
     }).then((res) => {
710
+      res.list = res.list || []
711
+      for (var n = 0; n < res.list.length; n++) {
712
+        res.list[n].select = true
713
+      }
676 714
       this.couponList = res.list
677 715
     })
678 716
     this.getDrawTemplateList().then((res) => { // 获取活动模板列表
@@ -704,6 +742,7 @@ export default {
704 742
             if (this.postData.Prizes[a].ValidDays === 0) {
705 743
               this.postData.Prizes[a].ValidDays = ''
706 744
             }
745
+            this.postData.Prizes[a].Defaults = this.postData.Prizes[a].Defaults || []
707 746
           }
708 747
         })
709 748
       }
@@ -722,8 +761,38 @@ export default {
722 761
     ...mapCouponActions([
723 762
       'GetCouponList',
724 763
     ]),
764
+    selectCase () {
765
+      this.GetCardList({ // 获取卡列表
766
+        page: 1,
767
+        pagesize: 100000,
768
+        sendtype: 'system',
769
+        usetype: 'luckdraw',
770
+        usedid: this.$route.query.id || '',
771
+        caseid: this.CaseId,
772
+      }).then((res) => {
773
+        res.list = res.list || []
774
+        for (var n = 0; n < res.list.length; n++) {
775
+          res.list[n].select = true
776
+        }
777
+        this.cardList = res.list
778
+      })
779
+      this.GetCouponList({ // 获取券列表
780
+        page: 1,
781
+        pagesize: 100000,
782
+        sendtype: 'system',
783
+        usetype: 'luckdraw',
784
+        usedid: this.$route.query.id || '',
785
+        caseid: this.CaseId,
786
+      }).then((res) => {
787
+        res.list = res.list || []
788
+        for (var n = 0; n < res.list.length; n++) {
789
+          res.list[n].select = true
790
+        }
791
+        this.couponList = res.list
792
+      })
793
+    },
725 794
     checkPhone (val) {
726
-      return !!(/^1[34578]\d{9}$/.test(val))
795
+      return !!(/^1[345789]\d{9}$/.test(val))
727 796
     },
728 797
     cardChange () {
729 798
       for (var n = 0; n < this.cardList.length; n++) {
@@ -848,6 +917,9 @@ export default {
848 917
       this.$router.push({ name: 'listOfLotteryActivities' })
849 918
     },
850 919
     submitLuckdrawData () { // 提交活动信息
920
+      if (this.postData.CaseId === '' && this.defaultCaseId !== '') {
921
+        this.postData.CaseId = this.defaultCaseId
922
+      }
851 923
       if (!this.checkData()) {
852 924
         return false
853 925
       }
@@ -861,13 +933,16 @@ export default {
861 933
           }
862 934
         }
863 935
         for (var a = 0; a < this.postData.Prizes.length; a++) {
936
+          this.postData.Prizes[a].Remainder = 0
937
+          this.postData.Prizes[a].Status = 1
864 938
           if (this.postData.Prizes[a].IsReality) {
865
-            if (this.postData.Prizes[a].VerificationStart === '') {
939
+            if (this.postData.Prizes[a].ValidDays === '') {
940
+              delete this.postData.Prizes[a].ValidDays
941
+            }
942
+            if (this.postData.Prizes[a].VerificationStart === '' || this.postData.Prizes[a].VerificationEnd === '') {
866 943
               delete this.postData.Prizes[a].VerificationStart
867 944
               delete this.postData.Prizes[a].VerificationEnd
868 945
               this.postData.Prizes[a].ValidDays = this.postData.Prizes[a].ValidDays - 0
869
-            } else {
870
-              delete this.postData.Prizes[a].ValidDays
871 946
             }
872 947
           } else {
873 948
             delete this.postData.Prizes[a].VerificationStart
@@ -908,8 +983,16 @@ export default {
908 983
       this.addPhoneTableData.splice(index, 1)
909 984
       this.postData.Prizes[this.editPrizePhoneIndex].Defaults.splice(index, 1)
910 985
     },
986
+    findSamePhone (num) { // 验重手机号
987
+      for (var n = 0; n < this.addPhoneTableData.length; n++) {
988
+        if (this.addPhoneTableData[n].Tel === num) {
989
+          return false
990
+        }
991
+      }
992
+      return true
993
+    },
911 994
     addPhoneInPrize () { // 添加内定奖品手机号
912
-      if (this.checkPhone(this.addPhoneNum) && this.addPhoneNum !== '') {
995
+      if (this.checkPhone(this.addPhoneNum) && this.addPhoneNum !== '' && this.findSamePhone(this.addPhoneNum)) {
913 996
         this.addPhoneTableData.push({
914 997
           Tel: this.addPhoneNum,
915 998
         })
@@ -917,6 +1000,11 @@ export default {
917 1000
           Tel: this.addPhoneNum,
918 1001
         })
919 1002
         this.addPhoneNum = ''
1003
+      } else if (!this.findSamePhone(this.addPhoneNum)) {
1004
+        this.$message({
1005
+          type: 'error',
1006
+          message: '请勿填写重复手机号'
1007
+        })
920 1008
       } else {
921 1009
         this.$message({
922 1010
           type: 'error',
@@ -941,6 +1029,19 @@ export default {
941 1029
         cancelButtonText: '取消',
942 1030
         type: 'warning'
943 1031
       }).then(() => {
1032
+        if (this.postData.Prizes[index].CouponCardType === 'card') {
1033
+          for (var n = 0; n < this.cardList.length; n++) {
1034
+            if (this.cardList[n].CardId === this.postData.Prizes[index].CouponCardId) {
1035
+              this.cardList[n].select = true
1036
+            }
1037
+          }
1038
+        } else {
1039
+          for (var a = 0; a < this.couponList.length; a++) {
1040
+            if (this.couponList[a].CouponId === this.postData.Prizes[index].CouponCardId) {
1041
+              this.couponList[a].select = true
1042
+            }
1043
+          }
1044
+        }
944 1045
         this.postData.Prizes.splice(index, 1)
945 1046
         this.$message({
946 1047
           type: 'success',
@@ -1002,17 +1103,19 @@ export default {
1002 1103
           for (var n = 0; n < this.cardList.length; n++) {
1003 1104
             if (this.cardList[n].CardId === this.addPrizeInfo.CouponCardId) {
1004 1105
               this.addPrizeInfo.PrizeName = this.cardList[n].CardName
1106
+              this.cardList[n].select = false
1005 1107
             }
1006 1108
           }
1007 1109
         } else {
1008 1110
           for (var a = 0; a < this.couponList.length; a++) {
1009 1111
             if (this.couponList[a].CouponId === this.addPrizeInfo.CouponCardId) {
1010 1112
               this.addPrizeInfo.PrizeName = this.couponList[a].CouponName
1113
+              this.couponList[a].select = false
1011 1114
             }
1012 1115
           }
1013 1116
         }
1014 1117
       } else if (this.addPrizeInfo.PrizeType === 'third') { // 第三方
1015
-        if (this.addPrizeInfo.PrizeName === '' && this.addPrizeInfo.IsReality) {
1118
+        if (this.addPrizeInfo.PrizeName === '') {
1016 1119
           this.$message({
1017 1120
             type: 'error',
1018 1121
             message: '奖品名称不能为空'
@@ -1034,7 +1137,7 @@ export default {
1034 1137
           return false
1035 1138
         }
1036 1139
         if (this.verificationType === 1 && this.addPrizeInfo.IsReality) {
1037
-          if (this.addPrizeInfo.ValidDays === '' || (this.addPrizeInfo.ValidDays - 0) % 1 !== 0 || (this.addPrizeInfo.ValidDays - 0) <= 0) {
1140
+          if (!this.addPrizeInfo.ValidDays || (this.addPrizeInfo.ValidDays - 0) % 1 !== 0 || (this.addPrizeInfo.ValidDays - 0) <= 0) {
1038 1141
             this.$message({
1039 1142
               type: 'error',
1040 1143
               message: '有效期须为大于0正整数'
@@ -1058,6 +1161,13 @@ export default {
1058 1161
             })
1059 1162
             return false
1060 1163
           }
1164
+          if (new Date(this.addPrizeInfo.VerificationStart).getTime() > new Date(this.addPrizeInfo.VerificationEnd).getTime()) {
1165
+            this.$message({
1166
+              type: 'error',
1167
+              message: '有效期开始时间不能大于截止时间'
1168
+            })
1169
+            return false
1170
+          }
1061 1171
           this.addPrizeInfo.ValidDays = ''
1062 1172
         }
1063 1173
         if (this.addPrizeInfo.PrizeImg === '') {
@@ -1114,6 +1224,7 @@ export default {
1114 1224
       if (!this.isread) {
1115 1225
         item.currentImg = ''
1116 1226
         if (this.templateActiveIndex === index) this.postData.Imgs = []
1227
+        this.$refs['templateImg' + index][0].value = ''
1117 1228
       }
1118 1229
     },
1119 1230
     addPrize () { // 新增奖品
@@ -1159,5 +1270,8 @@ export default {
1159 1270
     border: 1px solid #eee;
1160 1271
     border-bottom: none;
1161 1272
   }
1273
+  .currentImg:hover{
1274
+    cursor: pointer;
1275
+  }
1162 1276
 }
1163 1277
 </style>

+ 1
- 1
src/pages/system/marketingActivities/listOfLotteryActivities/page.scss Zobrazit soubor

@@ -2,7 +2,7 @@
2 2
   .img{
3 3
     width: 300px;
4 4
     position: relative;
5
-    overflow: hidden;
5
+    overflow: auto;
6 6
     margin: 20px;
7 7
     margin-right: 0;
8 8
     img{

+ 39
- 5
src/pages/system/marketingActivities/snapUpList/edit.vue Zobrazit soubor

@@ -67,17 +67,17 @@
67 67
                   <div>
68 68
                     <el-date-picker
69 69
                       :disabled="editOff || isread"
70
-                      value-format="yyyy-MM-ddT00:00:00+08:00"
70
+                      value-format="yyyy-MM-ddTHH:mm:ss+08:00"
71 71
                       v-model="postData.StartDate"
72
-                      type="date"
72
+                      type="datetime"
73 73
                       placeholder="选择开始日期">
74 74
                     </el-date-picker>
75 75
                     <span>至</span>
76 76
                     <el-date-picker
77 77
                       :disabled="editOff || isread"
78
-                      value-format="yyyy-MM-ddT23:59:59+08:00"
78
+                      value-format="yyyy-MM-ddTHH:mm:ss+08:00"
79 79
                       v-model="postData.EndDate"
80
-                      type="date"
80
+                      type="datetime"
81 81
                       placeholder="选择截止日期">
82 82
                     </el-date-picker>
83 83
                   </div>
@@ -162,6 +162,7 @@
162 162
 </template>
163 163
 <script>
164 164
 import { quillEditor } from 'vue-quill-editor'
165
+import uploadImage from 'quill-plugin-image'
165 166
 import { mapState, createNamespacedHelpers } from 'vuex'
166 167
 const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
167 168
 export default {
@@ -207,6 +208,14 @@ export default {
207 208
       }
208 209
     }
209 210
   },
211
+  mounted () {
212
+    uploadImage(this.$refs.myQuillEditor.quill, file => {
213
+      return this.toolClass.upload({ file }).then(data => {
214
+        const url = data.result.url
215
+        return { src: url, alt: '' }
216
+      })
217
+    })
218
+  },
210 219
   created () {
211 220
     if (this.$route.query.isread) {
212 221
       this.isread = true
@@ -248,6 +257,9 @@ export default {
248 257
       'editFlashbuy',
249 258
     ]),
250 259
     submitFlashbuy () { // 提交抢购数据
260
+      if (this.postData.CaseId === '' && this.defaultCaseId !== '') {
261
+        this.postData.CaseId = this.defaultCaseId
262
+      }
251 263
       if (!this.checkData()) {
252 264
         return false
253 265
       }
@@ -272,6 +284,7 @@ export default {
272 284
       }
273 285
     },
274 286
     checkData () { // 校验数据格式
287
+      // console.log(this.postData.FlashBuyName)
275 288
       if (this.postData.CaseId === '') {
276 289
         this.$message({
277 290
           type: 'error',
@@ -282,7 +295,7 @@ export default {
282 295
       if (this.postData.FlashBuyName === '') {
283 296
         this.$message({
284 297
           type: 'error',
285
-          message: '活动说明不能为空'
298
+          message: '活动名称不能为空'
286 299
         })
287 300
         return false
288 301
       }
@@ -307,6 +320,20 @@ export default {
307 320
         })
308 321
         return false
309 322
       }
323
+      if (new Date(this.postData.StartDate).getTime() > new Date(this.postData.EndDate).getTime()) {
324
+        this.$message({
325
+          type: 'error',
326
+          message: '活动开始时间不能大于截止时间'
327
+        })
328
+        return false
329
+      }
330
+      if (this.postData.FlashBuyInfo === '') {
331
+        this.$message({
332
+          type: 'error',
333
+          message: '活动说明不能为空'
334
+        })
335
+        return false
336
+      }
310 337
       if (this.postData.ValidateType === 'days') {
311 338
         if (this.postData.ValidateDays - 0 <= 0 || (this.postData.ValidateDays - 0) % 1 !== 0) {
312 339
           this.$message({
@@ -333,6 +360,13 @@ export default {
333 360
           })
334 361
           return false
335 362
         }
363
+        if (new Date(this.postData.ValidateStart).getTime() > new Date(this.postData.ValidateEnd).getTime()) {
364
+          this.$message({
365
+            type: 'error',
366
+            message: '有效期开始时间不能大于截止时间'
367
+          })
368
+          return false
369
+        }
336 370
         delete this.postData.ValidateDays
337 371
       }
338 372
       return true

+ 1
- 1
src/pages/system/marketingActivities/snapUpList/index.vue Zobrazit soubor

@@ -169,7 +169,7 @@
169 169
             prop="VerifyStatus"
170 170
             label="核销状态">
171 171
             <template slot-scope="scope">
172
-              {{scope.row.Status === 'useable' ? '未核销' : '已核销'}}
172
+              {{scope.row.VerifyStatus === 'useable' ? '未核销' : '已核销'}}
173 173
             </template>
174 174
           </el-table-column>
175 175
         </el-table>

+ 1
- 1
src/pages/system/marketingActivities/snapUpList/page.scss Zobrazit soubor

@@ -2,7 +2,7 @@
2 2
   .img{
3 3
     width: 300px;
4 4
     position: relative;
5
-    overflow: hidden;
5
+    overflow: auto;
6 6
     margin: 20px;
7 7
     margin-right: 0;
8 8
     img{

+ 94
- 138
src/pages/system/newOrder/newOrderList/index.vue Zobrazit soubor

@@ -25,7 +25,7 @@
25 25
       <div class="moreFilter"></div>
26 26
     </div>
27 27
     <div class="order-list-box">
28
-      <div style='position:relative;' v-for="(item,index) in list" :key="index">
28
+      <div style='position:relative;' v-for="(item,index) in ordersList" :key="index">
29 29
         <div>
30 30
           <div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;display:flex;align-items: center;">
31 31
             <!-- <i class="iconfont icon-yinchenglogo" style="font-size:70px;color:red;position: relative;bottom: 20px;margin-right:10px;"></i> -->
@@ -44,30 +44,9 @@
44 44
             </div>
45 45
           </div>
46 46
           <div style="padding:10px 20px;border-bottom:1px solid #cccccc;white-space: normal;">备注:{{item.Remark}}</div>
47
-          <div style="padding:10px 20px;" @click="printPdf(`item${index}`)">下单人:{{item.UserName}}</div>
48
-        </div>
49
-        <div class="print-area" :class="'item_' + item.OrdersId" style="width:180px;">
50
-          <div style="padding:0px 10px 5px;border-bottom:2px solid #cccccc;">
51
-            <div style="display:inline-block;">
52
-              <img class="topIcon" style="display:block;width:60%;margin:0 0 20px 0px;" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt="">
53
-              <span style="display:block;font-size:20px;font-weight:700;text-align: center;"> <img width='30px' :src='item.AreaIconWhite' alt=""> {{item.AreaName + item.TableNo}}</span>
54
-            </div>
55
-          </div>
56
-          <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
57
-            <div style="font-size:12px;"><span style="display:inline-block;width:75%;text-align:left;">{{item1.GoodsName}}</span><span style="display:inline-block;width:22%;text-align:right;font-size:12px;" v-if='!item1.SpecName'>× {{item1.Number}}</span></div>
58
-            <div style="margin-top:8px;" v-if='item1.SpecName'>
59
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{item1.SpecName}}</span>
60
-              <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{item1.Number}}</span>
61
-            </div>
62
-          </div>
63
-          <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;">
64
-            <div style="font-size:12px;">下单人:{{item.UserName}}</div>
65
-            <span style="display:block;margin-top:10px;font-size:12px;">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</span>
66
-          </div>
67
-          <div style="padding:10px 10px;font-size:12px;">备注:{{item.Remark}}</div>
68
-          <div style="text-align: right;font-size: 12px;">城的空间.城咖啡</div>
69
-          <div style="height:10px"></div>
47
+          <div style="padding:10px 20px;">下单人:{{item.UserName}}</div>
70 48
         </div>
49
+        <print-list :print-list="printList" :lodop="lodop" @printed="clearPrintList" />
71 50
         <div class="btns">
72 51
           <span @click="cancel(item.OrdersId,index)">取消</span>
73 52
           <span @click="submit(item.OrdersId,index)">确定</span>
@@ -82,22 +61,29 @@ import { createNamespacedHelpers, mapState, mapActions } from 'vuex'
82 61
 import { getLodop } from '@/util/LodopFuncs'
83 62
 import { formatTimeBySeconds } from '@/util/util'
84 63
 import { replaceURLParams } from '@/util/ajax'
64
+import XWebSocket from '@/util/websocket'
85 65
 
86 66
 // const WebSocket = require('ws')
87 67
 const { mapState: mapOrderState, mapActions: mapOrderActions } = createNamespacedHelpers('goodsorder')
88 68
 
89
-var LODOP
90 69
 export default {
91 70
   name: '',
71
+  components: {
72
+    'print-list': () => import('./print'),
73
+  },
92 74
   data () {
93 75
     return {
76
+      lodop: null,
77
+      ws: null,
78
+      wsID: '',
79
+      printList: [],
80
+
94 81
       total: 0,
95 82
       postData: { // 表格搜索条件
96 83
         phone: '', // 手机号
97 84
         page: 1, // 当前页码
98 85
         pagesize: 10, // 请求数据量
99 86
       },
100
-      currentList: [],
101 87
       leftTimes: {},
102 88
       business: false,
103 89
       caseid: '',
@@ -108,8 +94,23 @@ export default {
108 94
   },
109 95
   computed: {
110 96
     ...mapOrderState({
111
-      list: x => (x.ordersList || {}).list || [],
112
-      businessStatus: x => x.businessStatus
97
+      ordersList: x => x.ordersList,
98
+    }),
99
+    ...mapOrderState({
100
+      businessStatus (state) {
101
+        if (!state.businessStatus) {
102
+          this.ws.close()
103
+        }
104
+
105
+        if (state.businessStatus && (this.wsID !== this.CaseId) && this.CaseId) {
106
+          this.ws.close()
107
+          this.initWebSocket()
108
+        }
109
+
110
+        this.wsID = this.CaseId
111
+
112
+        return state.businessStatus
113
+      }
113 114
     }),
114 115
     ...mapState({
115 116
       cases: x => x.app.cases.list,
@@ -123,92 +124,69 @@ export default {
123 124
       set (val) {
124 125
         this.caseid = val
125 126
       }
126
-    }
127
+    },
127 128
   },
128 129
   created () {
130
+    this.lodop = getLodop()
131
+    this.lodop.PRINT_INIT('城咖啡订单')
132
+    this.lodop.SET_PRINT_PAGESIZE(3, 480, 40, '')
133
+
129 134
     this.updateSystemInfo().then(() => {
130 135
       console.log(this.CaseId)
131 136
       if (this.CaseId) {
132 137
         this.init()
133 138
       }
134 139
     })
135
-  },
136
-  mounted () {
137
-    // setTimeout(window.location.reload, 600 * 1000)
138
-  },
139
-  beforeRouteLeave (to, from, next) {
140
-    // 导航离开该组件的对应路由时调用
141
-    // 可以访问组件实例 `this`
142
-    console.log(this.websockets)
143
-    this.needReload = false
144
-    Object.keys(this.websockets).forEach((key) => {
145
-      console.log(key, this.websockets[key])
146
-      this.websockets[key].close()
147
-      clearInterval(this.websockets[key].interval)
140
+
141
+    this.ws = new XWebSocket({
142
+      message: this.receviedNewOrders.bind(this),
143
+      delay: 10,
144
+      autoConnect: true,
148 145
     })
149
-    this.websockets = {}
150
-    next()
146
+  },
147
+  beforeDestroyed () {
148
+    this.ws.close()
151 149
   },
152 150
   methods: {
153 151
     init () {
154
-      if (this.needReload) {
155
-        this.needReload = false
156
-        Object.keys(this.websockets).forEach((key) => {
157
-          // console.log(key, this.websockets[key])
158
-          this.websockets[key].close()
152
+      // 必须选案场
153
+      if (!this.CaseId) {
154
+        this.$message({
155
+          type: 'info',
156
+          message: '请先选择案场'
159 157
         })
160
-        this.websockets = {}
161
-        // console.log('init')
162
-        var param = []
163
-        if (!this.CaseId) {
164
-          this.$message({
165
-            type: 'info',
166
-            message: '请先选择案场'
167
-          })
168
-          return
158
+        return
159
+      }
160
+
161
+      // 获取新单
162
+      this.GetOrdersList({ caseid: this.CaseId }).then(list => {
163
+        // 打印新单
164
+        if (list) {
165
+          this.printList = list.map(x => x.IsIntimidate === 0)
169 166
         }
170
-        clearInterval(this.interval)
171
-        // console.log(this.CaseId)
172
-        this.GetOrdersList({ caseid: this.CaseId }).then((res) => {
173
-          for (var n = 0; n < (res.list || []).length; n++) {
174
-            if (res.list[n].IsIntimidate === 0) {
175
-              param.push(res.list[n].OrdersId)
176
-            }
177
-          }
178
-          var bool = true
179
-          var timer = setInterval(() => {
180
-            if (param.length && bool) {
181
-              bool = false
182
-              this.printPdf(`item_${param[0]}`)
183
-              this.putPrintGoodsOrder({
184
-                id: param[0]
185
-              }).then(() => {
186
-                param.splice(0, 1)
187
-                bool = true
188
-              })
189
-            } else {
190
-              this.needReload = true
191
-              clearInterval(timer)
192
-            }
193
-          }, 300)
194
-          this.getBusinessStatus(this.CaseId).then(() => {
195
-            if (this.businessStatus) {
196
-              this.initWebSocket()
197
-            }
198
-          })
167
+
168
+        // 开张, 则实时监控新单
169
+        this.getBusinessStatus(this.CaseId).then(() => {
170
+
199 171
         })
172
+
173
+        // 页面倒计时
174
+        clearInterval(this.interval)
200 175
         this.refreshList()
201
-      }
176
+      })
202 177
     },
203 178
     refreshList () {
204 179
       this.interval = setInterval(() => {
205 180
         const now = (new Date()).valueOf()
206
-        this.leftTimes = this.list.reduce((acc, it) => {
181
+        this.leftTimes = (this.ordersList || []).reduce((acc, it) => {
207 182
           const showDT = now - ((new Date(it.CreateDate)).valueOf())
208 183
           return { ...acc, [`${it.OrdersId}`]: formatTimeBySeconds(showDT) }
209 184
         }, {})
210 185
       }, 1000)
211 186
     },
187
+    clearPrintList () {
188
+      this.printList = []
189
+    },
212 190
     timeOut (c) {
213 191
       let cTime = new Date(c).valueOf()
214 192
       let time = new Date().valueOf()
@@ -243,8 +221,8 @@ export default {
243 221
             type: 'success',
244 222
             message: '确认订单成功'
245 223
           })
246
-          this.list.splice(index, 1)
247
-          this.updateList({ list: this.list })
224
+
225
+          this.updateList({ list: this.ordersList.filter(x => x.OrdersId !== id) })
248 226
         })
249 227
       }).catch((res) => {
250 228
         this.$message({
@@ -264,8 +242,8 @@ export default {
264 242
             type: 'success',
265 243
             message: '取消订单成功'
266 244
           })
267
-          this.list.splice(index, 1)
268
-          this.updateList({ list: this.list })
245
+
246
+          this.updateList({ list: this.ordersList.filter(x => x.OrdersId !== id) })
269 247
         })
270 248
       }).catch((res) => {
271 249
         this.$message({
@@ -274,60 +252,37 @@ export default {
274 252
         })
275 253
       })
276 254
     },
277
-    printPdf (cl) {
278
-      this.CreateOneFormPage(cl)
279
-      LODOP.PRINT()
280
-    },
281
-    CreateOneFormPage (cl) {
282
-      LODOP = getLodop()
283
-      LODOP.PRINT_INIT('订单')
284
-      LODOP.SET_PRINT_PAGESIZE(3, 480, 40, '')
285
-      LODOP.ADD_PRINT_HTM(0, 0, document.getElementsByClassName(cl)[0].offsetWidth, document.getElementsByClassName(cl)[0].offsetHeight, document.getElementsByClassName(cl)[0].innerHTML)
286
-    },
287 255
     initWebSocket () {
288 256
       console.log('initWebSocket')
289
-      // console.log(this.user)
290 257
       let caseid = this.CaseId
291 258
       let id = this.userInfo.UserId
292 259
       const wsPath = this.$api.system.notify.newGoodsOrders.url
293 260
       const wsRealPath = replaceURLParams(wsPath, { grps: caseid, id })
294
-      this.newWebsocket(wsRealPath)
261
+      const wsURL = `${window.location.origin.replace('http', 'ws')}${wsRealPath}?token=${localStorage.getItem('JWT')}`
262
+      this.ws.connect(wsURL)
295 263
     },
296
-    websocketonmessage (e) {
297
-      // let oldList = this.list
298
-      let newList = JSON.parse(e.data).data.refreshOnlineGoodsOrders
299
-      // let newinfo = newList.filter(x => this.list.filter(item => item.OrdersId === x.OrdersId).length === 0)
300
-      this.updateList({ list: this.list.concat(newList) }).then(() => {
301
-        newList.forEach((it) => {
302
-          // console.log('it:', it)
303
-          this.printPdf(`item_${it.OrdersId}`)
304
-          this.putPrintGoodsOrder({
305
-            id: it.OrdersId
306
-          })
264
+    receviedNewOrders (e) {
265
+      const newOrders = JSON.parse(e.data).data.refreshOnlineGoodsOrders
266
+      if (!newOrders || !newOrders.length) return
267
+
268
+      // 放入待制作队列
269
+      this.updateList({ list: this.list.concat(newOrders) })
270
+
271
+      // 放入待打队列
272
+      const ps = newOrders.filter(x => x.IsIntimidate === 0).map((orders) => {
273
+        return new Promise((resolve, reject) => {
274
+          if (orders.IsIntimidate === 0) {
275
+            // 先远程更新掉打单状态字段
276
+            this.putPrintGoodsOrder({id: orders.OrdersId}).then(() => {
277
+              resolve(orders)
278
+            })
279
+          } else {
280
+            resolve()
281
+          }
307 282
         })
308 283
       })
309
-    },
310
-    newWebsocket (wsRealPath) {
311
-      const ws = this.websockets[wsRealPath]
312
-      if (!ws) {
313
-        const url = `${window.location.origin.replace('http', 'ws')}${wsRealPath}?token=${localStorage.getItem('JWT')}`
314
-        this.websockets[wsRealPath] = new WebSocket(url)
315
-        this.websockets[wsRealPath].onopen = console.log
316
-        this.websockets[wsRealPath].onmessage = this.websocketonmessage
317
-        this.websockets[wsRealPath].onclose = this.reloadWebSocket
318
-        this.websockets[wsRealPath].onerror = this.reloadWebSocket
319
-        this.websockets[wsRealPath].interval = setInterval(() => this.websockets[wsRealPath].send(10), 120000)
320
-      }
321
-    },
322
-    reloadWebSocket (e) {
323
-      console.log(e.currentTarget.url)
324
-      Object.keys(this.websockets).forEach((key) => {
325
-        clearInterval(this.websockets[key].interval)
326
-      })
327
-      if (this.needReload) { // 此变量判断是否需要重连
328
-        this.websockets = {}
329
-        this.initWebSocket()
330
-      }
284
+
285
+      Promise.all(ps).then((its = []) => this.printList.concat(its.filter(x => x)))
331 286
     },
332 287
     open () {
333 288
       if (!this.CaseId) {
@@ -349,6 +304,7 @@ export default {
349 304
         })
350 305
         return
351 306
       }
307
+      this.ws.close()
352 308
       this.closeBusiness(this.CaseId)
353 309
     }
354 310
   }

+ 60
- 0
src/pages/system/newOrder/newOrderList/print.vue Zobrazit soubor

@@ -0,0 +1,60 @@
1
+<template>
2
+  <div>
3
+    <div refs="printPages" v-for="(item, inx) in printList" :key="inx" class="print-area" :class="'item_' + item.OrdersId" style="width:180px;">
4
+      <div style="padding:0px 10px 5px;border-bottom:2px solid #cccccc;">
5
+        <div style="display:inline-block;">
6
+          <img class="topIcon" style="display:block;width:60%;margin:0 0 20px 0px;" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt="">
7
+          <span style="display:block;font-size:20px;font-weight:700;text-align: center;"> <img width='30px' :src='item.AreaIconWhite' alt=""> {{item.AreaName + item.TableNo}}</span>
8
+        </div>
9
+      </div>
10
+      <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
11
+        <div style="font-size:12px;"><span style="display:inline-block;width:75%;text-align:left;">{{item1.GoodsName}}</span><span style="display:inline-block;width:22%;text-align:right;font-size:12px;" v-if='!item1.SpecName'>× {{item1.Number}}</span></div>
12
+        <div style="margin-top:8px;" v-if='item1.SpecName'>
13
+          <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{item1.SpecName}}</span>
14
+          <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{item1.Number}}</span>
15
+        </div>
16
+      </div>
17
+      <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;">
18
+        <div style="font-size:12px;">下单人:{{item.UserName}}</div>
19
+        <span style="display:block;margin-top:10px;font-size:12px;">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</span>
20
+      </div>
21
+      <div style="padding:10px 10px;font-size:12px;">备注:{{item.Remark}}</div>
22
+      <div style="text-align: right;font-size: 12px;">城的空间.城咖啡</div>
23
+      <div style="height:10px"></div>
24
+    </div>
25
+  </div>
26
+</template>
27
+
28
+<script>
29
+export default {
30
+  name: 'orderPrintList',
31
+  props: [
32
+    'lodop',
33
+    'printList',
34
+  ],
35
+  data () {
36
+    return {}
37
+  },
38
+  updated () {
39
+    this.print()
40
+  },
41
+  methods: {
42
+    print () {
43
+      if (this.$refs.printPages && this.$refs.printPages.length > 0) {
44
+        this.$refs.printPages.forEach(($el) => {
45
+          this.lodop.ADD_PRINT_HTM(0, 0, $el.offsetWidth, $el.offsetHeight, $el.innerHTML)
46
+        })
47
+
48
+        this.lodop.PRINT()
49
+
50
+        this.$emit('printed')
51
+      }
52
+    }
53
+  }
54
+}
55
+</script>
56
+
57
+<!-- Add "scoped" attribute to limit CSS to this component only -->
58
+<style lang="scss" scoped>
59
+@import "page.scss";
60
+</style>

+ 1
- 1
src/pages/system/systemSet/userManager/add.vue Zobrazit soubor

@@ -233,7 +233,7 @@ export default {
233 233
         })
234 234
         return false
235 235
       }
236
-      var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
236
+      var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
237 237
       if (!myreg.test(this.postData.Phone)) {
238 238
         this.$message({
239 239
           type: 'error',

+ 1
- 1
src/pages/system/systemSet/userManager/edit.vue Zobrazit soubor

@@ -258,7 +258,7 @@ export default {
258 258
         })
259 259
         return false
260 260
       }
261
-      var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
261
+      var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
262 262
       if (!myreg.test(this.postData.Phone)) {
263 263
         this.$message({
264 264
           type: 'error',

+ 6
- 0
src/pages/system/systemSet/userManager/index.vue Zobrazit soubor

@@ -57,6 +57,12 @@
57 57
         :data="currentList"
58 58
         stripe
59 59
         style="width: 100%">
60
+        <el-table-column
61
+          fixed
62
+          prop="CaseName"
63
+          label="案场"
64
+          width="150">
65
+        </el-table-column>
60 66
         <el-table-column
61 67
           fixed
62 68
           prop="UserName"

+ 12
- 2
src/pages/system/verificationManager/drawVerification/verificationList/index.vue Zobrazit soubor

@@ -60,7 +60,7 @@
60 60
                     type="success"
61 61
                     v-if="scope.row.Status === 0"
62 62
                     @click="check(scope.row)">核销</el-button>
63
-                  <span v-else>已核销</span>
63
+                  <span v-else>-</span>
64 64
                 </template>
65 65
               </el-table-column>
66 66
             </el-table>
@@ -117,7 +117,17 @@ export default {
117 117
             type: 'success',
118 118
             message: '操作成功!'
119 119
           })
120
-          this.$router.push({ name: 'drawVerification' })
120
+          this.drawVerifyList({
121
+            id: this.$route.query.code
122
+          }).then((res) => {
123
+            // console.log(JSON.stringify(res))
124
+            if (res !== null) {
125
+              this.info = []
126
+              this.info.push(res)
127
+            }
128
+            this.ajaxOff = true
129
+          })
130
+          // this.$router.push({ name: 'drawVerification' })
121 131
         })
122 132
       })
123 133
     },

+ 12
- 1
src/pages/system/verificationManager/flashbuyVerification/verificationList/index.vue Zobrazit soubor

@@ -110,7 +110,18 @@ export default {
110 110
             type: 'success',
111 111
             message: '操作成功!'
112 112
           })
113
-          this.$router.push({ name: 'flashbuyVerification' })
113
+          this.flashbuyVerifyList({
114
+            code: this.$route.query.code,
115
+            caseid: this.$route.query.caseid
116
+          }).then((res) => {
117
+            // console.log(JSON.stringify(res))
118
+            if (res !== null) {
119
+              this.info = []
120
+              this.info.push(res)
121
+            }
122
+            this.ajaxOff = true
123
+          })
124
+          // this.$router.push({ name: 'flashbuyVerification' })
114 125
         })
115 126
       })
116 127
     },

+ 15
- 13
src/store/goods/order.js Zobrazit soubor

@@ -22,11 +22,11 @@ export default {
22 22
   },
23 23
   actions: {
24 24
     putPrintGoodsOrder ({ commit }, payload) {
25
-      return new Promise((resolve) => {
25
+      return new Promise(resolve => {
26 26
         ajax(api.goodsOrder.putPrintGoodsOrder.url, {
27 27
           method: api.goodsOrder.putPrintGoodsOrder.method,
28 28
           urlData: {
29
-            ...payload,
29
+            ...payload
30 30
           }
31 31
         }).then(res => {
32 32
           resolve(res)
@@ -34,15 +34,17 @@ export default {
34 34
       })
35 35
     },
36 36
     GetOrdersList ({ commit }, payload) {
37
-      return new Promise((resolve) => {
37
+      return new Promise(resolve => {
38 38
         ajax(api.goodsOrder.getOnlineOrder.url, {
39 39
           method: api.goodsOrder.getOnlineOrder.method,
40 40
           queryData: {
41
-            ...payload,
41
+            ...payload
42 42
           }
43 43
         }).then(res => {
44
-          commit('updateList', res)
45
-          resolve(res)
44
+          const list = (res || {}).list || []
45
+
46
+          commit('updateList', list)
47
+          resolve(list)
46 48
         })
47 49
       })
48 50
     },
@@ -60,13 +62,13 @@ export default {
60 62
       })
61 63
     },
62 64
     updateList ({ commit }, data) {
63
-      return new Promise((resolve) => {
65
+      return new Promise(resolve => {
64 66
         commit('updateList', data)
65 67
         resolve(data)
66 68
       })
67 69
     },
68 70
     openBusiness ({ commit }, caseid) {
69
-      return new Promise((resolve) => {
71
+      return new Promise(resolve => {
70 72
         ajax(api.goodsOrder.openBusiness.url, {
71 73
           method: api.goodsOrder.openBusiness.method,
72 74
           urlData: {
@@ -79,7 +81,7 @@ export default {
79 81
       })
80 82
     },
81 83
     closeBusiness ({ commit }, caseid) {
82
-      return new Promise((resolve) => {
84
+      return new Promise(resolve => {
83 85
         ajax(api.goodsOrder.closeBusiness.url, {
84 86
           method: api.goodsOrder.closeBusiness.method,
85 87
           urlData: {
@@ -92,7 +94,7 @@ export default {
92 94
       })
93 95
     },
94 96
     getBusinessStatus ({ commit }, caseid) {
95
-      return new Promise((resolve) => {
97
+      return new Promise(resolve => {
96 98
         ajax(api.goodsOrder.getBusinessStatus.url, {
97 99
           method: api.goodsOrder.getBusinessStatus.method,
98 100
           urlData: {
@@ -106,12 +108,12 @@ export default {
106 108
             status = false
107 109
           }
108 110
           commit('updateBusiness', status)
109
-          resolve(res)
111
+          resolve(status)
110 112
         })
111 113
       })
112 114
     },
113 115
     checkOrder ({ commit }, data) {
114
-      return new Promise((resolve) => {
116
+      return new Promise(resolve => {
115 117
         ajax(api.goodsOrder.checkOrder.url, {
116 118
           method: api.goodsOrder.checkOrder.method,
117 119
           urlData: {
@@ -123,7 +125,7 @@ export default {
123 125
       })
124 126
     },
125 127
     cancelOrder ({ commit }, data) {
126
-      return new Promise((resolve) => {
128
+      return new Promise(resolve => {
127 129
         ajax(api.goodsOrder.cancelOrder.url, {
128 130
           method: api.goodsOrder.cancelOrder.method,
129 131
           urlData: {

+ 3
- 1
src/style/main.css Zobrazit soubor

@@ -414,7 +414,9 @@ select:focus {
414 414
   color: red;
415 415
 }
416 416
 
417
-
417
+.ql-editor{
418
+  min-height: 200px;
419
+}
418 420
 
419 421
 
420 422
 

+ 1
- 1
src/util/ajax.js Zobrazit soubor

@@ -3,7 +3,7 @@ import qs from 'qs'
3 3
 import router from '../router'
4 4
 import { Message } from 'element-ui'
5 5
 
6
-const token = function (headers) {
6
+export function token (headers) {
7 7
   let JWT
8 8
   if (headers) {
9 9
     localStorage.setItem('JWT', headers.authorization)

+ 1
- 0
src/util/upload.js Zobrazit soubor

@@ -2,6 +2,7 @@ import api from './api'
2 2
 import ajax from './ajax'
3 3
 
4 4
 export default function upload (file) {
5
+  console.log(file)
5 6
   return new Promise((resolve, reject) => {
6 7
     ajax({
7 8
       ...api.file.image,

+ 92
- 0
src/util/websocket.js Zobrazit soubor

@@ -0,0 +1,92 @@
1
+// const WsConnecting = 0
2
+const WsOpen = 1
3
+// const WsClosing = 2
4
+// const WsClosed = 3
5
+
6
+export default class XWebSocket {
7
+  addr = ''
8
+  client = null
9
+  autoConnect = false
10
+  interval = undefined
11
+  delay = 60
12
+  on = { open: null, message: null, error: null, close: null }
13
+
14
+  // constructor
15
+  constructor ({ open, message, error, close, delay, autoConnect }) {
16
+    this.on = { open, message, error, close }
17
+
18
+    if (delay >= 0) {
19
+      this.delay = delay
20
+    }
21
+
22
+    this.autoConnect = autoConnect
23
+  }
24
+
25
+  // 连接
26
+  connect (addr) {
27
+    this.addr = addr
28
+    this._wsInit()
29
+  }
30
+
31
+  // 发送
32
+  send (data) {
33
+    if (this.client && this.client.readyState === WsOpen) {
34
+      this.client.send(data)
35
+    }
36
+  }
37
+
38
+  // 关闭
39
+  close () {
40
+    if (!this.client) return
41
+
42
+    this._breforeClose(false)
43
+
44
+    this.client.close()
45
+    this.client = null
46
+  }
47
+
48
+  _breforeClose (autoConnect) {
49
+    this._wsClearHeartbeat()
50
+
51
+    if (this.client) {
52
+      if (!autoConnect) {
53
+        // 防止 onclose 中实现 断线重连
54
+        this.client.onclose = undefined
55
+      }
56
+    }
57
+  }
58
+
59
+  _wsInit () {
60
+    const _self = this
61
+
62
+    this.client = new window.WebSocket(this.addr)
63
+    this.client.onopen = this.on.open
64
+    this.client.onmessage = this.on.message
65
+    this.client.onerror = this.on.error
66
+    this.client.onclose = e => {
67
+      _self.on.close(e)
68
+      _self._breforeClose(_self.autoConnect)
69
+      _self.client = null
70
+
71
+      if (_self.autoConnect) {
72
+        window.setTimeout(() => _self._wsInit(), _self.delay * 1000)
73
+      }
74
+    }
75
+
76
+    this._wsHeartbeat()
77
+  }
78
+
79
+  _wsHeartbeat () {
80
+    this.interval = window.setInterval(() => {
81
+      if (this.client && this.client.readyState === WsOpen) {
82
+        this.client.send(10)
83
+      }
84
+    }, 60 * 1000)
85
+  }
86
+
87
+  _wsClearHeartbeat () {
88
+    if (this.interval !== undefined) {
89
+      window.clearInterval(this.interval)
90
+    }
91
+  }
92
+}