yuantianjiao 6 anni fa
parent
commit
f09d3be374
69 ha cambiato i file con 1995 aggiunte e 13 eliminazioni
  1. 3
    0
      package.json
  2. 1
    1
      public/index.html
  3. BIN
      src/common/icon/b1-.jpg
  4. BIN
      src/common/icon/b1.jpg
  5. BIN
      src/common/icon/b10-.jpg
  6. BIN
      src/common/icon/b10.jpg
  7. BIN
      src/common/icon/b11-.jpg
  8. BIN
      src/common/icon/b11.jpg
  9. BIN
      src/common/icon/b12-.jpg
  10. BIN
      src/common/icon/b12.jpg
  11. BIN
      src/common/icon/b2-.jpg
  12. BIN
      src/common/icon/b2.jpg
  13. BIN
      src/common/icon/b3-.jpg
  14. BIN
      src/common/icon/b3.jpg
  15. BIN
      src/common/icon/b4-.jpg
  16. BIN
      src/common/icon/b4.jpg
  17. BIN
      src/common/icon/b5-.jpg
  18. BIN
      src/common/icon/b5.jpg
  19. BIN
      src/common/icon/b6-.png
  20. BIN
      src/common/icon/b6.jpg
  21. BIN
      src/common/icon/b7-.jpg
  22. BIN
      src/common/icon/b7.jpg
  23. BIN
      src/common/icon/b8-.jpg
  24. BIN
      src/common/icon/b8.jpg
  25. BIN
      src/common/icon/b9-.jpg
  26. BIN
      src/common/icon/b9.jpg
  27. BIN
      src/common/icon/checked.png
  28. BIN
      src/common/icon/coverBlack.jpg
  29. BIN
      src/common/icon/coverRed.jpg
  30. BIN
      src/common/icon/dz.jpg
  31. BIN
      src/common/icon/endBlack.jpg
  32. BIN
      src/common/icon/heise.png
  33. BIN
      src/common/icon/loading-red.gif
  34. BIN
      src/common/icon/r1-.jpg
  35. BIN
      src/common/icon/r10-.jpg
  36. BIN
      src/common/icon/r11-.jpg
  37. BIN
      src/common/icon/r12-.jpg
  38. BIN
      src/common/icon/r2-.jpg
  39. BIN
      src/common/icon/r3-.jpg
  40. BIN
      src/common/icon/r4-.jpg
  41. BIN
      src/common/icon/r5-.jpg
  42. BIN
      src/common/icon/r6-.jpg
  43. BIN
      src/common/icon/r7-.jpg
  44. BIN
      src/common/icon/r8-.jpg
  45. BIN
      src/common/icon/r9-.jpg
  46. BIN
      src/common/icon/reSet.png
  47. BIN
      src/common/icon/reloadImg.png
  48. BIN
      src/common/icon/text-h.png
  49. BIN
      src/common/icon/text-l.png
  50. BIN
      src/common/icon/topImg.png
  51. BIN
      src/common/icon/unchecked.png
  52. BIN
      src/common/icon/uploadImg.png
  53. 102
    0
      src/components/preview/preview.vue
  54. 54
    0
      src/pages/user/activeList/activeList.vue
  55. 117
    0
      src/pages/user/calendar/calendar.vue
  56. 88
    0
      src/pages/user/calendar/checkModel.vue
  57. 537
    0
      src/pages/user/calendar/making.vue
  58. 37
    0
      src/pages/user/calendar/preview.vue
  59. 186
    0
      src/pages/user/customization/customizationDetail.vue
  60. 97
    0
      src/pages/user/customization/customizationList.vue
  61. 18
    8
      src/pages/user/mainPage/userCenter/index.vue
  62. 35
    0
      src/pages/user/router.js
  63. 52
    0
      src/store/customization/index.js
  64. 2
    0
      src/store/index.js
  65. 350
    0
      src/store/making/index.js
  66. 27
    2
      src/util/api.js
  67. 268
    0
      src/util/canvas2image.js
  68. 19
    0
      src/util/util.js
  69. 2
    2
      vue.config.js

+ 3
- 0
package.json Vedi File

@@ -19,6 +19,9 @@
19 19
     "@vue/eslint-config-prettier": "^3.0.1",
20 20
     "axios": "^0.18.0",
21 21
     "better-scroll": "^1.12.6",
22
+    "canvas2image": "^1.0.5",
23
+    "html2canvas": "^1.0.0-alpha.12",
24
+    "jQuery": "^1.7.4",
22 25
     "less": "^3.0.4",
23 26
     "less-loader": "^4.1.0",
24 27
     "node-sass": "^4.9.3",

+ 1
- 1
public/index.html Vedi File

@@ -6,7 +6,7 @@
6 6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 7
   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
8 8
     charset="utf-8" />
9
-  <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_s109s6ry4gl.css">
9
+  <link rel="stylesheet" href="//at.alicdn.com/t/font_681879_zlsjvjaiir.css">
10 10
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
11 11
   <title>
12 12
     <%= htmlWebpackPlugin.options.title %>

BIN
src/common/icon/b1-.jpg Vedi File


BIN
src/common/icon/b1.jpg Vedi File


BIN
src/common/icon/b10-.jpg Vedi File


BIN
src/common/icon/b10.jpg Vedi File


BIN
src/common/icon/b11-.jpg Vedi File


BIN
src/common/icon/b11.jpg Vedi File


BIN
src/common/icon/b12-.jpg Vedi File


BIN
src/common/icon/b12.jpg Vedi File


BIN
src/common/icon/b2-.jpg Vedi File


BIN
src/common/icon/b2.jpg Vedi File


BIN
src/common/icon/b3-.jpg Vedi File


BIN
src/common/icon/b3.jpg Vedi File


BIN
src/common/icon/b4-.jpg Vedi File


BIN
src/common/icon/b4.jpg Vedi File


BIN
src/common/icon/b5-.jpg Vedi File


BIN
src/common/icon/b5.jpg Vedi File


BIN
src/common/icon/b6-.png Vedi File


BIN
src/common/icon/b6.jpg Vedi File


BIN
src/common/icon/b7-.jpg Vedi File


BIN
src/common/icon/b7.jpg Vedi File


BIN
src/common/icon/b8-.jpg Vedi File


BIN
src/common/icon/b8.jpg Vedi File


BIN
src/common/icon/b9-.jpg Vedi File


BIN
src/common/icon/b9.jpg Vedi File


BIN
src/common/icon/checked.png Vedi File


BIN
src/common/icon/coverBlack.jpg Vedi File


BIN
src/common/icon/coverRed.jpg Vedi File


BIN
src/common/icon/dz.jpg Vedi File


BIN
src/common/icon/endBlack.jpg Vedi File


BIN
src/common/icon/heise.png Vedi File


BIN
src/common/icon/loading-red.gif Vedi File


BIN
src/common/icon/r1-.jpg Vedi File


BIN
src/common/icon/r10-.jpg Vedi File


BIN
src/common/icon/r11-.jpg Vedi File


BIN
src/common/icon/r12-.jpg Vedi File


BIN
src/common/icon/r2-.jpg Vedi File


BIN
src/common/icon/r3-.jpg Vedi File


BIN
src/common/icon/r4-.jpg Vedi File


BIN
src/common/icon/r5-.jpg Vedi File


BIN
src/common/icon/r6-.jpg Vedi File


BIN
src/common/icon/r7-.jpg Vedi File


BIN
src/common/icon/r8-.jpg Vedi File


BIN
src/common/icon/r9-.jpg Vedi File


BIN
src/common/icon/reSet.png Vedi File


BIN
src/common/icon/reloadImg.png Vedi File


BIN
src/common/icon/text-h.png Vedi File


BIN
src/common/icon/text-l.png Vedi File


BIN
src/common/icon/topImg.png Vedi File


BIN
src/common/icon/unchecked.png Vedi File


BIN
src/common/icon/uploadImg.png Vedi File


+ 102
- 0
src/components/preview/preview.vue Vedi File

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

+ 54
- 0
src/pages/user/activeList/activeList.vue Vedi File

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

+ 117
- 0
src/pages/user/calendar/calendar.vue Vedi File

@@ -0,0 +1,117 @@
1
+<template>
2
+  <div style="padding-bottom:.6rem;">
3
+    <div class="top">
4
+      <img :src="topImg" alt>
5
+    </div>
6
+    <div class="middle">
7
+      <p>云台天境定制专属你的台历</p>
8
+      <span>时间: 2018年12月12-21日</span>
9
+      <span>地点: 宁区秣陵街道创新东路2号银城蓝溪郡营销中心</span>
10
+    </div>
11
+    <div class="bottom">
12
+      <p class="title">活动详情</p>
13
+      <div>相关活动介绍参与活动需出示“城的空间”官微报名截图并支付198元现金(现金需在活动现场支付)</div>
14
+      <div>以上礼品需成交方可享受,成交指签订车位销售合同/商品房现售合同,并支付全部价款或支付首付款且办理完毕贷款手续,开发商承诺客户交纳的198元,我司无条件退还,活动名额仅限10人,先到先得。</div>
15
+      <div>活动电话:025-86426677</div>
16
+      <div>服务案场:银城蓝溪郡</div>
17
+      <div>地址:江宁区秣陵街道创新东路2号</div>
18
+      <div>*活动最终解释权归银城蓝溪郡开发商所有</div>
19
+    </div>
20
+    <div class="btn">
21
+      <div v-if="state === 1" @click="toCheckModel">立即参与</div>
22
+      <div v-if="state === 2" class="disable">已参与</div>
23
+      <div v-if="state === 3" class="disable">活动已结束</div>
24
+    </div>
25
+  </div>
26
+</template>
27
+
28
+<script>
29
+import { createNamespacedHelpers } from 'vuex'
30
+const { mapActions: mapMakingActions } = createNamespacedHelpers('making')
31
+import topImg from '@/common/icon/topImg.png'
32
+export default {
33
+  data () {
34
+    return {
35
+      topImg,
36
+      state: 1
37
+    }
38
+  },
39
+  created () {
40
+    this.getCalendarCustomer().then((res) => {
41
+      if (res) {
42
+        this.state = 2
43
+      } else {
44
+        let stringTime = "2018-12-22 00:00:00"
45
+        let timestamp = Date.parse(new Date(stringTime))
46
+        let now = new Date().getTime()
47
+        if (timestamp >= now) {
48
+          this.state = 1
49
+        } else {
50
+          this.state = 3
51
+        }
52
+      }
53
+    })
54
+  },
55
+  methods: {
56
+    ...mapMakingActions(['getCalendarCustomer']),
57
+    toCheckModel () {
58
+      this.$router.push({ name: 'checkModel' })
59
+    }
60
+  }
61
+}
62
+</script>
63
+ 
64
+<style lang="scss" scoped>
65
+.top {
66
+  width: 100%;
67
+  img {
68
+    width: 100%;
69
+  }
70
+}
71
+.middle {
72
+  padding: 0.14rem 0.25rem;
73
+  border-bottom: 0.1rem solid rgba(235, 241, 242, 1);
74
+  p {
75
+    font-size: 0.16rem;
76
+    padding-bottom: 0.05rem;
77
+    font-weight: bold;
78
+  }
79
+  span {
80
+    padding-bottom: 0.05rem;
81
+    display: block;
82
+  }
83
+}
84
+.bottom {
85
+  padding: 0.14rem 0.25rem;
86
+  p {
87
+    font-size: 0.16rem;
88
+    padding-bottom: 0.05rem;
89
+    font-weight: bold;
90
+  }
91
+  div{
92
+    padding-bottom: .08rem;
93
+  }
94
+}
95
+.btn {
96
+  position: fixed;
97
+  bottom: 0;
98
+  left: 0;
99
+  width: 100%;
100
+  padding: 0.1rem 0.25rem;
101
+  box-sizing: border-box;
102
+  background: #fff;
103
+  div {
104
+    width: 100%;
105
+    height: 0.4rem;
106
+    border-radius: 0.2rem;
107
+    background-color: rgba(252, 98, 67, 1);
108
+    color: #fff;
109
+    text-align: center;
110
+    line-height: 0.4rem;
111
+  }
112
+  .disable {
113
+    background: #ccc;
114
+  }
115
+}
116
+</style>
117
+ 

+ 88
- 0
src/pages/user/calendar/checkModel.vue Vedi File

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

+ 537
- 0
src/pages/user/calendar/making.vue Vedi File

@@ -0,0 +1,537 @@
1
+<template>
2
+  <div>
3
+    <div v-if="isLoading || windowLoad" class="loading">
4
+      <img :src="loading" alt>
5
+      <span>{{msg}}</span>
6
+    </div>
7
+    <div class="cutBox" v-for="(item,index) in banner" :key="index">
8
+      <div class="cutDom" v-if="index === mainIndex-1">
9
+        <img :src="item.bgImg" class="cover">
10
+        <img
11
+          :style="item.styleCut"
12
+          v-if="!item.CustomerImg && item.defaultBg"
13
+          :src="item.defaultBg"
14
+        >
15
+        <img :style="item.styleCut" v-if="item.CustomerImg" :src="item.CustomerImg">
16
+        <img class="text-h" v-if="item.ImgName === '10月'" :src="textH">
17
+        <img class="text-l" v-if="item.ImgName === '4月' || item.ImgName === '7月'" :src="textL">
18
+      </div>
19
+    </div>
20
+    <div class="topBanner">
21
+      <swiper :options="swiperOption" ref="mySwiper">
22
+        <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
23
+          <div
24
+            class="item"
25
+            v-if="index === mainIndex-1 || index === mainIndex ||  index === mainIndex-2"
26
+          >
27
+            <div>
28
+              <img :src="item.bgImg" class="cover">
29
+              <img
30
+                :style="item.style"
31
+                v-if="!item.CustomerImg && item.defaultBg"
32
+                :src="item.defaultBg"
33
+              >
34
+              <img :style="item.style" v-if="item.CustomerImg" :src="item.CustomerImg">
35
+              <img class="text-h" v-if="item.ImgName === '10月'" :src="textH">
36
+              <img
37
+                class="text-l"
38
+                v-if="item.ImgName === '4月' || item.ImgName === '7月'"
39
+                :src="textL"
40
+              >
41
+              <div class="reload-img">
42
+                <van-uploader :after-read="onRead" v-show="mainIndex !== 1">
43
+                  <img :src="reloadImg">
44
+                </van-uploader>
45
+              </div>
46
+            </div>
47
+          </div>
48
+        </swiper-slide>
49
+      </swiper>
50
+      <div class="swiper-button-next">
51
+        <i class="iconfont icon-you"></i>
52
+      </div>
53
+      <div class="swiper-button-prev">
54
+        <i class="iconfont icon-left"></i>
55
+      </div>
56
+      <div class="swiper-pagination" v-show="mainIndex !== 1"></div>
57
+      <div class="swiper-cover" v-show="mainIndex === 1">封面</div>
58
+    </div>
59
+    <div class="operation">
60
+      <div>
61
+        <van-uploader :after-read="onRead" v-show="mainIndex !== 1">
62
+          <img :src="uploadImg">
63
+          <p>自定义图片</p>
64
+        </van-uploader>
65
+      </div>
66
+      <div>
67
+        <img :src="reSet" v-show="mainIndex !== 1" @click="changeOld">
68
+        <p v-show="mainIndex !== 1">恢复默认</p>
69
+      </div>
70
+    </div>
71
+    <div class="email">
72
+      <span>邮箱</span>
73
+      <van-field v-model="email" placeholder="接收电子版" style="border-radius:5px;"/>
74
+    </div>
75
+    <div class="btn">
76
+      <div @click="pre">预览</div>
77
+      <div @click="showPop=true">确定</div>
78
+    </div>
79
+    <div v-show="showPop" class="pop-box">
80
+      <div class="pop-content">
81
+        <div>确认定制此台历?</div>
82
+        <div>
83
+          <div @click="submit">确定</div>
84
+          <div @click="showPop=false">取消</div>
85
+        </div>
86
+      </div>
87
+    </div>
88
+  </div>
89
+</template>
90
+
91
+<script>
92
+import html2canvas from 'html2canvas'
93
+import canvas2image from '@/util/canvas2image.js'
94
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
95
+import 'swiper/dist/css/swiper.css'
96
+import { createNamespacedHelpers } from 'vuex'
97
+const { mapState: mapMakingState, mapActions: mapMakingActions } = createNamespacedHelpers('making')
98
+import textH from '@/common/icon/text-h.png'
99
+import textL from '@/common/icon/text-l.png'
100
+import uploadImg from '@/common/icon/uploadImg.png'
101
+import reloadImg from '@/common/icon/reloadImg.png'
102
+import reSet from '@/common/icon/reSet.png'
103
+import loading from '@/common/icon/loading-red.gif'
104
+
105
+export default {
106
+  data () {
107
+    const self = this
108
+    return {
109
+      textH,
110
+      textL,
111
+      uploadImg,
112
+      reSet,
113
+      reloadImg,
114
+      loading,
115
+      banner: [],
116
+      mainIndex: 1,
117
+      isLoading: false,
118
+      showPop: false,
119
+      imglength: 0,
120
+      msg: '请稍候...',
121
+      swiperOption: {
122
+        observer: true,
123
+        speed: 1500,
124
+        navigation: {
125
+          nextEl: '.swiper-button-next',
126
+          prevEl: '.swiper-button-prev',
127
+        },
128
+        pagination: {
129
+          el: '.swiper-pagination',
130
+          type: 'fraction',
131
+        },
132
+        on: {
133
+          transitionStart: function () {
134
+            self.mainIndex = this.activeIndex + 1
135
+          }
136
+        }
137
+      },
138
+      email: ''
139
+    }
140
+  },
141
+  components: {
142
+    swiper,
143
+    swiperSlide
144
+  },
145
+  computed: {
146
+    MySwiper () {
147
+      return this.$refs.mySwiper.swiper
148
+    },
149
+    ...mapMakingState({
150
+      bannerBlack: item => item.bannerBlack,
151
+      bannerRed: item => item.bannerRed
152
+    })
153
+  },
154
+  created () {
155
+    if (this.$route.query.type == 1) {
156
+      this.banner = this.bannerBlack
157
+    } else {
158
+      this.banner = this.bannerRed
159
+    }
160
+  },
161
+  methods: {
162
+    ...mapMakingActions(['setBanner', 'calendar']),
163
+    upload (url) {
164
+      this.banner[this.mainIndex - 1].CustomerImg = url
165
+      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) })
166
+      console.log(this.banner)
167
+      let cutDoms = document.getElementsByClassName('cutDom')[0]
168
+      this.convert2canvas(cutDoms, this.mainIndex - 1).then(() => {
169
+        this.isLoading = false
170
+      }).catch(() => {
171
+        this.isLoading = false
172
+      })
173
+    },
174
+    onRead (file) {
175
+      this.isLoading = true
176
+      this.toolClass.upload(file).then((res) => {
177
+        this.upload(res.result.url)
178
+      }).catch(() => {
179
+        this.isLoading = false
180
+      })
181
+    },
182
+    changeOld () {
183
+      this.isLoading = true
184
+      this.banner[this.mainIndex - 1].CustomerImg = ''
185
+      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) })
186
+      setTimeout(() => {
187
+        let cutDoms = document.getElementsByClassName('cutDom')[0]
188
+        this.convert2canvas(cutDoms, this.mainIndex - 1).then(() => {
189
+          this.isLoading = false
190
+        }).catch(() => {
191
+          this.isLoading = false
192
+        })
193
+      }, 100)
194
+    },
195
+    submit () {
196
+      this.showPop = false
197
+      if (!this.email) {
198
+        this.$toast('邮箱为必填项')
199
+        return
200
+      } else if (this.email.indexOf('@') <= -1) {
201
+        this.$toast('请输入正确的邮箱')
202
+        return
203
+      }
204
+      let data = JSON.parse(JSON.stringify(this.banner))
205
+      data.forEach((curr, index) => {
206
+        delete curr['bgImg']
207
+        delete curr['defaultBg']
208
+        delete curr['style']
209
+        delete curr['styleCut']
210
+      });
211
+      let submitData = {
212
+        ModelName: this.$route.query.type == 1 ? '黑色' : '红色',
213
+        Email: this.email,
214
+        CaseId: '13',
215
+        Imgs: data
216
+      }
217
+      this.calendar({ Calendar: JSON.stringify(submitData) }).then(() => {
218
+        this.$toast('日历已生成')
219
+        this.$router.push({ name: 'customizationList' })
220
+      })
221
+    },
222
+    pre () {
223
+      this.$router.push({ name: 'preview', query: { type: this.$route.query.type } })
224
+    },
225
+    convert2canvas (dom, i) {
226
+      return new Promise((resolve, reject) => {
227
+        const that = this
228
+        var shareContent = dom;
229
+        var width = shareContent.offsetWidth; //获取dom 宽度
230
+        var height = shareContent.offsetHeight; //获取dom 高度
231
+        var canvas = document.createElement("canvas"); //创建一个canvas节点
232
+        var scale = 1; //定义任意放大倍数 支持小数
233
+        canvas.width = width * scale; //定义canvas 宽度 * 缩放
234
+        canvas.height = height * scale; //定义canvas高度 *缩放
235
+        canvas.getContext("2d").scale(scale, scale); //获取context,设置scale 
236
+        var opts = {
237
+          scale: scale, // 添加的scale 参数
238
+          canvas: canvas, //自定义 canvas
239
+          // logging: true, //日志开关,便于查看html2canvas的内部执行流程
240
+          width: width, //dom 原始宽度
241
+          height: height,
242
+          useCORS: true // 【重要】开启跨域配置
243
+        };
244
+
245
+        html2canvas(shareContent, opts).then(function (canvas) {
246
+          var context = canvas.getContext('2d');
247
+          // 【重要】关闭抗锯齿
248
+          context.mozImageSmoothingEnabled = false;
249
+          context.webkitImageSmoothingEnabled = false;
250
+          context.msImageSmoothingEnabled = false;
251
+          context.imageSmoothingEnabled = false;
252
+
253
+          // 【重要】默认转化的格式为png,也可设置为其他格式
254
+          var img = canvas2image.convertToJPEG(canvas, canvas.width, canvas.height);
255
+          var blobs = that.urltoblob(img.src);
256
+          var namestr = `${that.banner[i].ImgName}.jpg`;
257
+          var file = {
258
+            content: img.src,
259
+            file: that.blobToFile(blobs, namestr)
260
+          }
261
+          console.log(file)
262
+          that.toolClass.upload(file).then((res) => {
263
+            that.banner[i].CalendarImg = res.result.url
264
+            that.setBanner({ type: that.$route.query.type, data: JSON.parse(JSON.stringify(that.banner)) })
265
+            resolve()
266
+          }).catch(() => {
267
+            reject()
268
+          })
269
+        }).catch((err) => {
270
+          console.log(err)
271
+          that.isLoading = false
272
+        })
273
+      })
274
+    },
275
+    urltoblob (dataURL) {
276
+      var BASE64_MARKER = ';base64,';
277
+      if (dataURL.indexOf(BASE64_MARKER) == -1) {
278
+        var parts = dataURL.split(',');
279
+        var contentType = parts[0].split(':')[1];
280
+        var raw = decodeURIComponent(parts[1]);
281
+        return new Blob([raw], { type: contentType });
282
+      }
283
+      var parts = dataURL.split(BASE64_MARKER);
284
+      var contentType = parts[0].split(':')[1];
285
+      var raw = window.atob(parts[1]);
286
+      var rawLength = raw.length;
287
+      var uInt8Array = new Uint8Array(rawLength);
288
+      for (var i = 0; i < rawLength; ++i) {
289
+        uInt8Array[i] = raw.charCodeAt(i);
290
+      }
291
+      return new Blob([uInt8Array], { type: contentType });
292
+    },
293
+    blobToFile (theBlob, fileName) {
294
+      theBlob.lastModifiedDate = new Date();
295
+      theBlob.name = fileName;
296
+      return theBlob;
297
+    }
298
+  }
299
+}
300
+</script>
301
+
302
+<style lang="scss">
303
+.swiper-pagination-current {
304
+  color: #fc6243;
305
+}
306
+</style>
307
+
308
+
309
+<style lang="scss" scoped>
310
+.loading {
311
+  width: 100%;
312
+  height: 100%;
313
+  position: fixed;
314
+  left: 0;
315
+  top: 0;
316
+  display: flex;
317
+  flex-flow: column nowrap;
318
+  justify-content: center;
319
+  align-items: center;
320
+  z-index: 1000;
321
+  background: rgba(0, 0, 0, 0.6);
322
+  img {
323
+    width: 0.5rem;
324
+    height: 0.5rem;
325
+  }
326
+  span {
327
+    font-size: 0.14rem;
328
+    color: #fff;
329
+  }
330
+}
331
+.pop-box {
332
+  width: 100%;
333
+  height: 100%;
334
+  position: fixed;
335
+  left: 0;
336
+  top: 0;
337
+  display: flex;
338
+  flex-flow: column nowrap;
339
+  justify-content: center;
340
+  align-items: center;
341
+  z-index: 1000;
342
+  background: rgba(0, 0, 0, 0.6);
343
+  .pop-content {
344
+    width: 2.6rem;
345
+    height: 1.7rem;
346
+    background: rgba(255, 255, 255, 1);
347
+    box-shadow: 0px 2px 4px 0px rgba(194, 194, 194, 0.5);
348
+    border-radius: 4px;
349
+    > div {
350
+      padding-top: 0.5rem;
351
+      font-size: 0.16rem;
352
+      display: flex;
353
+      justify-content: center;
354
+      align-items: center;
355
+      div {
356
+        margin: 0 0.12rem;
357
+        padding: 0.08rem 0.3rem;
358
+        border-radius: 4px;
359
+        border: 1px solid;
360
+      }
361
+    }
362
+  }
363
+}
364
+.cutBox {
365
+  z-index: -1;
366
+  position: absolute;
367
+  top: -10rem;
368
+  left: -10rem;
369
+  > div {
370
+    position: relative;
371
+    width: 13cm;
372
+    height: 21cm;
373
+    .cover {
374
+      width: 100%;
375
+      height: 100%;
376
+    }
377
+    .text-h {
378
+      width: 9cm;
379
+      position: absolute;
380
+      top: 8.8cm;
381
+      left: 1cm;
382
+      z-index: 3;
383
+    }
384
+    .text-l {
385
+      width: 0.85cm;
386
+      position: absolute;
387
+      top: 2.8cm;
388
+      left: 1cm;
389
+      z-index: 3;
390
+    }
391
+  }
392
+}
393
+.topBanner {
394
+  width: 100%;
395
+  height: 3.3rem;
396
+  background: #e9e9e9;
397
+  position: relative;
398
+  overflow: hidden;
399
+  &::before {
400
+    content: '';
401
+    position: absolute;
402
+    left: 0;
403
+    top: 0;
404
+    width: 100%;
405
+    height: 1.65rem;
406
+    box-sizing: border-box;
407
+    border-bottom: 1px dashed #d1d1d1;
408
+    transform-origin: bottom center;
409
+    transform: rotateZ(41deg) scale(1.414);
410
+  }
411
+  &::after {
412
+    content: '';
413
+    position: absolute;
414
+    left: 0;
415
+    top: 0;
416
+    width: 100%;
417
+    height: 1.65rem;
418
+    box-sizing: border-box;
419
+    border-bottom: 1px dashed #d1d1d1;
420
+    transform-origin: bottom center;
421
+    transform: rotateZ(-41deg) scale(1.414);
422
+  }
423
+  .swiper-container {
424
+    width: 100%;
425
+    height: 100%;
426
+  }
427
+  .swiper-button-next,
428
+  .swiper-button-prev {
429
+    background-image: url();
430
+    outline: 0px;
431
+    text-align: center;
432
+    line-height: 0.44rem;
433
+  }
434
+  .swiper-cover {
435
+    z-index: 2;
436
+    position: absolute;
437
+    bottom: 0.1rem;
438
+    left: 50%;
439
+    transform: translateX(-50%);
440
+    font-size: 0.12rem;
441
+    color: #fc6243;
442
+  }
443
+  .item {
444
+    position: relative;
445
+    height: 100%;
446
+    > div {
447
+      position: absolute;
448
+      width: 1.7rem;
449
+      height: 2.7rem;
450
+      top: 50%;
451
+      left: 50%;
452
+      transform: translate(-50%, -50%);
453
+      .cover {
454
+        width: 100%;
455
+        height: 100%;
456
+      }
457
+      .text-h {
458
+        width: 1.2rem;
459
+        position: absolute;
460
+        top: 1.12rem;
461
+        left: 0.2rem;
462
+        z-index: 3;
463
+      }
464
+      .text-l {
465
+        width: 0.1rem;
466
+        position: absolute;
467
+        top: 0.4rem;
468
+        left: 0.16rem;
469
+        z-index: 3;
470
+      }
471
+      .reload-img {
472
+        width: 0.2rem;
473
+        height: 0.2rem;
474
+        position: absolute;
475
+        top: 0.02rem;
476
+        right: 0.02rem;
477
+        z-index: 3;
478
+        img {
479
+          width: 100%;
480
+          height: 100%;
481
+        }
482
+      }
483
+    }
484
+  }
485
+}
486
+.operation {
487
+  display: flex;
488
+  justify-content: center;
489
+  align-items: center;
490
+  padding: 0.5rem 0.2rem;
491
+  > div {
492
+    flex: 1;
493
+    text-align: center;
494
+    height: 0.68rem;
495
+    img {
496
+      width: 0.68rem;
497
+      height: 0.68rem;
498
+    }
499
+    p {
500
+      color: #8a8a8a;
501
+      padding-top: 0.05rem;
502
+    }
503
+  }
504
+}
505
+.email {
506
+  display: flex;
507
+  justify-content: center;
508
+  align-items: center;
509
+  padding: 0 0.25rem;
510
+  box-sizing: border-box;
511
+  span {
512
+    width: 0.6rem;
513
+  }
514
+}
515
+.btn {
516
+  margin-top: 0.3rem;
517
+  width: 100%;
518
+  box-sizing: border-box;
519
+  display: flex;
520
+  justify-content: center;
521
+  align-items: center;
522
+  padding: 0 0.2rem;
523
+  div {
524
+    flex: 1;
525
+    margin: 0.1rem;
526
+    border-radius: 20px;
527
+    height: 0.4rem;
528
+    text-align: center;
529
+    line-height: 0.4rem;
530
+    background-color: #fc6243;
531
+    color: #fff;
532
+  }
533
+  div:nth-of-type(1) {
534
+    background: #9db0ce;
535
+  }
536
+}
537
+</style>

+ 37
- 0
src/pages/user/calendar/preview.vue Vedi File

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

+ 186
- 0
src/pages/user/customization/customizationDetail.vue Vedi File

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

+ 97
- 0
src/pages/user/customization/customizationList.vue Vedi File

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

+ 18
- 8
src/pages/user/mainPage/userCenter/index.vue Vedi File

@@ -1,12 +1,12 @@
1 1
 <template>
2 2
   <div class="mainPage">
3 3
     <div>
4
-      <div class="userTop_view" >
4
+      <div class="userTop_view">
5 5
         <div class="gradient_bg"></div>
6 6
         <div class="zIndex_bg"></div>
7 7
         <div class="userAvatar_Border">
8 8
           <div class="userAvatar">
9
-            <img :src='headimgurl' alt="" width="100%" height="100%">
9
+            <img :src="headimgurl" alt width="100%" height="100%">
10 10
           </div>
11 11
         </div>
12 12
         <div class="uesr-info">
@@ -18,14 +18,14 @@
18 18
       <div class="vip-privilege flex-h">
19 19
         <div class="flex-item privilege-item" @click="toCoupons">
20 20
           <div class="img-box">
21
-            <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
21
+            <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt>
22 22
           </div>
23 23
           <span>优惠券</span>
24 24
           <span>{{Nums.couponnum || 0}}张未使用</span>
25 25
         </div>
26 26
         <div class="flex-item privilege-item" @click="toCard">
27 27
           <div class="img-box">
28
-            <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
28
+            <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt>
29 29
           </div>
30 30
           <span>卡券</span>
31 31
           <span>0张未使用</span>
@@ -33,10 +33,13 @@
33 33
         <div class="flex-item privilege-item" @click="toVipDetail">
34 34
           <i class="iconfont icon-01" @click.stop="toVip"></i>
35 35
           <div class="img-box">
36
-            <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
36
+            <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt>
37 37
           </div>
38 38
           <span>VIP卡</span>
39
-          <span>¥{{Nums.vipbalance}} <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
39
+          <span>
40
+            ¥{{Nums.vipbalance}}
41
+            <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i>
42
+          </span>
40 43
         </div>
41 44
       </div>
42 45
 
@@ -57,6 +60,10 @@
57 60
           <span>抽奖记录</span>
58 61
           <i class="iconfont icon-jiantou-right"></i>
59 62
         </div>
63
+        <div class="menu-item flex-h" @click="toActiveList">
64
+          <span>活动记录</span>
65
+          <i class="iconfont icon-jiantou-right"></i>
66
+        </div>
60 67
       </div>
61 68
     </div>
62 69
   </div>
@@ -88,7 +95,7 @@ export default {
88 95
       if (this.user.AccountInfo) {
89 96
         this.AccountInfo = JSON.parse(this.user.AccountInfo)
90 97
 
91
-        
98
+
92 99
       }
93 100
       this.headimgurl = this.user.Headimgurl
94 101
     })
@@ -102,7 +109,7 @@ export default {
102 109
     toVip () {
103 110
       this.$router.push({ name: 'vip' })
104 111
     },
105
-    toVipDetail() {
112
+    toVipDetail () {
106 113
       this.$router.push({ name: 'vipDetail' })
107 114
     },
108 115
     toCard () {
@@ -128,6 +135,9 @@ export default {
128 135
       num = num >= 1000 ? 999 : num
129 136
       userid = `${userid}${num}`
130 137
       window.location.href = `${window.location.origin}/game/luckdraw/#/lotteryList?from=${userid}`
138
+    },
139
+    toActiveList(){
140
+      this.$router.push({ name: 'activeList' })
131 141
     }
132 142
   }
133 143
 }

+ 35
- 0
src/pages/user/router.js Vedi File

@@ -26,6 +26,13 @@ import receive from './receive/index' // 领取页面
26 26
 import receiveResults from './receiveResults/index' // 领取结果页面
27 27
 import receiveChannel from './receiveChannel/index' // 渠道领取页面
28 28
 import rush from './rush/index' // 抢购
29
+import calendar from './calendar/calendar' // 台历活动页
30
+import activeList from './activeList/activeList' // 活动列表
31
+import customizationDetail from './customization/customizationDetail' // 定制详情
32
+import customizationList from './customization/customizationList' // 定制列表
33
+import checkModel from './calendar/checkModel' // 台历模板选择
34
+import making from './calendar/making' // 台历制作
35
+import preview from './calendar/preview' // 台历预览
29 36
 
30 37
 Vue.use(Router)
31 38
 
@@ -162,6 +169,34 @@ const router = new Router({
162 169
     path: '/rush',
163 170
     name: 'rush',
164 171
     component: rush
172
+  }, { // 台历活动页
173
+    path: '/calendar',
174
+    name: 'calendar',
175
+    component: calendar
176
+  }, { // 活动列表
177
+    path: '/activeList',
178
+    name: 'activeList',
179
+    component: activeList
180
+  }, { // 定制详情
181
+    path: '/customizationDetail',
182
+    name: 'customizationDetail',
183
+    component: customizationDetail
184
+  }, { // 定制列表
185
+    path: '/customizationList',
186
+    name: 'customizationList',
187
+    component: customizationList
188
+  }, { // 台历模板选择
189
+    path: '/checkModel',
190
+    name: 'checkModel',
191
+    component: checkModel
192
+  }, { // 台历制作
193
+    path: '/making',
194
+    name: 'making',
195
+    component: making
196
+  }, { // 台历预览
197
+    path: '/preview',
198
+    name: 'preview',
199
+    component: preview
165 200
   }],
166 201
   linkActiveClass: 'active',
167 202
 })

+ 52
- 0
src/store/customization/index.js Vedi File

@@ -0,0 +1,52 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+// 请求数据
5
+export default {
6
+  namespaced: true,
7
+  state: {
8
+    list: [],
9
+    detail: {}
10
+  },
11
+  mutations: {
12
+    setList (state, data) {
13
+      state.list = data.list || []
14
+    },
15
+    setDetail (state, data) {
16
+      let cover = data.Imgs.splice(0, 1)
17
+      state.detail = data || {}
18
+      state.detail.cover = cover[0]
19
+    }
20
+  },
21
+  actions: {
22
+    getList (context) {
23
+      return new Promise((resolve, reject) => {
24
+        Ajax({
25
+          ...api.calendar.getCalendarList,
26
+          queryData: {
27
+            page: 1,
28
+            pagesize: 10000
29
+          }
30
+        }).then(res => {
31
+          context.commit('setList', res)
32
+          resolve(res)
33
+        }).catch((err) => {
34
+          reject(err)
35
+        })
36
+      })
37
+    },
38
+    getDetail (context, data) {
39
+      return new Promise((resolve, reject) => {
40
+        Ajax({
41
+          ...api.calendar.getCalendarDetail,
42
+          urlData: { ...data }
43
+        }).then(res => {
44
+          context.commit('setDetail', res)
45
+          resolve()
46
+        }).catch((err) => {
47
+          reject(err)
48
+        })
49
+      })
50
+    },
51
+  }
52
+}

+ 2
- 0
src/store/index.js Vedi File

@@ -28,6 +28,8 @@ export const modules = {
28 28
   vip: () => require('./vip/index').default,
29 29
   remark: () => require('./remark/index').default,
30 30
   rush: () => require('./rush/index').default,
31
+  making: () => require('./making/index').default,
32
+  customization: () => require('./customization/index').default,
31 33
 }
32 34
 
33 35
 Object.keys(modules).forEach((modKey) => {

+ 350
- 0
src/store/making/index.js Vedi File

@@ -0,0 +1,350 @@
1
+import Ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+import b1bg from '@/common/icon/b1-.jpg'
4
+import r1bg from '@/common/icon/r1-.jpg'
5
+import b1 from '@/common/icon/b1.jpg'
6
+import b2bg from '@/common/icon/b2-.jpg'
7
+import r2bg from '@/common/icon/r2-.jpg'
8
+import b2 from '@/common/icon/b2.jpg'
9
+import b3bg from '@/common/icon/b3-.jpg'
10
+import r3bg from '@/common/icon/r3-.jpg'
11
+import b3 from '@/common/icon/b3.jpg'
12
+import b4bg from '@/common/icon/b4-.jpg'
13
+import r4bg from '@/common/icon/r4-.jpg'
14
+import b4 from '@/common/icon/b4.jpg'
15
+import b5bg from '@/common/icon/b5-.jpg'
16
+import r5bg from '@/common/icon/r5-.jpg'
17
+import b5 from '@/common/icon/b5.jpg'
18
+import b6bg from '@/common/icon/b6-.png'
19
+import r6bg from '@/common/icon/r6-.jpg'
20
+import b6 from '@/common/icon/b6.jpg'
21
+import b7bg from '@/common/icon/b7-.jpg'
22
+import r7bg from '@/common/icon/r7-.jpg'
23
+import b7 from '@/common/icon/b7.jpg'
24
+import b8bg from '@/common/icon/b8-.jpg'
25
+import r8bg from '@/common/icon/r8-.jpg'
26
+import b8 from '@/common/icon/b8.jpg'
27
+import b9bg from '@/common/icon/b9-.jpg'
28
+import r9bg from '@/common/icon/r9-.jpg'
29
+import b9 from '@/common/icon/b9.jpg'
30
+import b10bg from '@/common/icon/b10-.jpg'
31
+import r10bg from '@/common/icon/r10-.jpg'
32
+import b10 from '@/common/icon/b10.jpg'
33
+import b11bg from '@/common/icon/b11-.jpg'
34
+import r11bg from '@/common/icon/r11-.jpg'
35
+import b11 from '@/common/icon/b11.jpg'
36
+import b12bg from '@/common/icon/b12-.jpg'
37
+import r12bg from '@/common/icon/r12-.jpg'
38
+import b12 from '@/common/icon/b12.jpg'
39
+import coverBlack from '@/common/icon/coverBlack.jpg'
40
+import coverRed from '@/common/icon/coverRed.jpg'
41
+
42
+// 请求数据
43
+export default {
44
+  namespaced: true,
45
+  state: {
46
+    bannerBlack: [
47
+      {
48
+        bgImg: coverBlack,
49
+        defaultBg: '',
50
+        CalendarImg: coverBlack,
51
+        CustomerImg: '',
52
+        ImgName: '封面',
53
+        Sort: 1,
54
+        style: ''
55
+      },
56
+      {
57
+        bgImg: b1bg,
58
+        defaultBg: b1,
59
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546637',
60
+        CustomerImg: '',
61
+        ImgName: '1月',
62
+        Sort: 2,
63
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.25rem;left:50%;transform:translateX(-50%);object-fit: cover;',
64
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.95cm;left: .9cm;`
65
+      },
66
+      {
67
+        bgImg: b2bg,
68
+        defaultBg: b2,
69
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543547849',
70
+        CustomerImg: '',
71
+        ImgName: '2月',
72
+        Sort: 3,
73
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
74
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
75
+      },
76
+      {
77
+        bgImg: b3bg,
78
+        defaultBg: b3,
79
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546638',
80
+        CustomerImg: '',
81
+        ImgName: '3月',
82
+        Sort: 4,
83
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;right:0.16rem;object-fit: cover;',
84
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;right: 1.15cm;object-fit: cover;`
85
+      },
86
+      {
87
+        bgImg: b4bg,
88
+        defaultBg: b4,
89
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543547851',
90
+        CustomerImg: '',
91
+        ImgName: '4月',
92
+        Sort: 5,
93
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50.5%);object-fit: cover;',
94
+        styleCut: `width: 11.1cm;height: 7.3cm;position: absolute;top: 1.9cm;left: .9cm;object-fit: cover;`
95
+      },
96
+      {
97
+        bgImg: b5bg,
98
+        defaultBg: b5,
99
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546640',
100
+        CustomerImg: '',
101
+        ImgName: '5月',
102
+        Sort: 6,
103
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
104
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
105
+      },
106
+      {
107
+        bgImg: b6bg,
108
+        defaultBg: b6,
109
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546642',
110
+        CustomerImg: '',
111
+        ImgName: '6月',
112
+        Sort: 7,
113
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.24rem;right:0.16rem;object-fit: cover;',
114
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.87cm;right: 1.15cm;object-fit: cover;`
115
+      },
116
+      {
117
+        bgImg: b7bg,
118
+        defaultBg: b7,
119
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546643',
120
+        CustomerImg: '',
121
+        ImgName: '7月',
122
+        Sort: 8,
123
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
124
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
125
+      },
126
+      {
127
+        bgImg: b8bg,
128
+        defaultBg: b8,
129
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546644',
130
+        CustomerImg: '',
131
+        ImgName: '8月',
132
+        Sort: 9,
133
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.17rem;object-fit: cover;',
134
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.23cm;object-fit: cover;`
135
+      },
136
+      {
137
+        bgImg: b9bg,
138
+        defaultBg: b9,
139
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546645',
140
+        CustomerImg: '',
141
+        ImgName: '9月',
142
+        Sort: 10,
143
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
144
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.58cm;right: 1.15cm;object-fit: cover;`
145
+      },
146
+      {
147
+        bgImg: b10bg,
148
+        defaultBg: b10,
149
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546646',
150
+        CustomerImg: '',
151
+        ImgName: '10月',
152
+        Sort: 11,
153
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
154
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
155
+      },
156
+      {
157
+        bgImg: b11bg,
158
+        defaultBg: b11,
159
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546647',
160
+        CustomerImg: '',
161
+        ImgName: '11月',
162
+        Sort: 12,
163
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.16rem;object-fit: cover;',
164
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.15cm;object-fit: cover;`
165
+      },
166
+      {
167
+        bgImg: b12bg,
168
+        defaultBg: b12,
169
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543546648',
170
+        CustomerImg: '',
171
+        ImgName: '12月',
172
+        Sort: 13,
173
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
174
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.56cm;right: 1.15cm;object-fit: cover;`
175
+      }
176
+    ],
177
+    bannerRed: [
178
+      {
179
+        bgImg: coverRed,
180
+        defaultBg: '',
181
+        CalendarImg: coverRed,
182
+        CustomerImg: '',
183
+        ImgName: '封面',
184
+        Sort: 1,
185
+        style: ''
186
+      },
187
+      {
188
+        bgImg: r1bg,
189
+        defaultBg: b1,
190
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543557398',
191
+        CustomerImg: '',
192
+        ImgName: '1月',
193
+        Sort: 2,
194
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.25rem;left:50%;transform:translateX(-50%);object-fit: cover;',
195
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.95cm;left: .9cm;object-fit: cover;`
196
+      },
197
+      {
198
+        bgImg: r2bg,
199
+        defaultBg: b2,
200
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543556811',
201
+        CustomerImg: '',
202
+        ImgName: '2月',
203
+        Sort: 3,
204
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
205
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
206
+      },
207
+      {
208
+        bgImg: r3bg,
209
+        defaultBg: b3,
210
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543557399',
211
+        CustomerImg: '',
212
+        ImgName: '3月',
213
+        Sort: 4,
214
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;right:0.16rem;object-fit: cover;',
215
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;right: 1.15cm;object-fit: cover;`
216
+      },
217
+      {
218
+        bgImg: r4bg,
219
+        defaultBg: b4,
220
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543557400',
221
+        CustomerImg: '',
222
+        ImgName: '4月',
223
+        Sort: 5,
224
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50.5%);object-fit: cover;',
225
+        styleCut: `width: 11.1cm;height: 7.3cm;position: absolute;top: 1.9cm;left: .9cm;object-fit: cover;`
226
+      },
227
+      {
228
+        bgImg: r5bg,
229
+        defaultBg: b5,
230
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543556813',
231
+        CustomerImg: '',
232
+        ImgName: '5月',
233
+        Sort: 6,
234
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
235
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
236
+      },
237
+      {
238
+        bgImg: r6bg,
239
+        defaultBg: b6,
240
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543556814',
241
+        CustomerImg: '',
242
+        ImgName: '6月',
243
+        Sort: 7,
244
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.24rem;right:0.16rem;object-fit: cover;',
245
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.87cm;right: 1.15cm;object-fit: cover;`
246
+      },
247
+      {
248
+        bgImg: r7bg,
249
+        defaultBg: b7,
250
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543560521',
251
+        CustomerImg: '',
252
+        ImgName: '7月',
253
+        Sort: 8,
254
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
255
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
256
+      },
257
+      {
258
+        bgImg: r8bg,
259
+        defaultBg: b8,
260
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543556815',
261
+        CustomerImg: '',
262
+        ImgName: '8月',
263
+        Sort: 9,
264
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.17rem;object-fit: cover;',
265
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.23cm;object-fit: cover;`
266
+      },
267
+      {
268
+        bgImg: r9bg,
269
+        defaultBg: b9,
270
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543557403',
271
+        CustomerImg: '',
272
+        ImgName: '9月',
273
+        Sort: 10,
274
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
275
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.6cm;right: 1.15cm;object-fit: cover;`
276
+      },
277
+      {
278
+        bgImg: r10bg,
279
+        defaultBg: b10,
280
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543556816',
281
+        CustomerImg: '',
282
+        ImgName: '10月',
283
+        Sort: 11,
284
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
285
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
286
+      },
287
+      {
288
+        bgImg: r11bg,
289
+        defaultBg: b11,
290
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543556817',
291
+        CustomerImg: '',
292
+        ImgName: '11月',
293
+        Sort: 12,
294
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.16rem;object-fit: cover;',
295
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.15cm;object-fit: cover;`
296
+      },
297
+      {
298
+        bgImg: r12bg,
299
+        defaultBg: b12,
300
+        CalendarImg: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/blob1543556818',
301
+        CustomerImg: '',
302
+        ImgName: '12月',
303
+        Sort: 13,
304
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
305
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.56cm;right: 1.15cm;object-fit: cover;`
306
+      }
307
+    ]
308
+  },
309
+  mutations: {
310
+    upDateBanner (state, { type, data }) {
311
+      console.log(data)
312
+      if (type == 1) {
313
+        state.bannerBlack = data || []
314
+      } else {
315
+        state.bannerRed = data || []
316
+      }
317
+    },
318
+    upDateWindowLoad (state, data) {
319
+      state.windowLoad = data
320
+    }
321
+  },
322
+  actions: {
323
+    setBanner (context, { type, data }) {
324
+      context.commit('upDateBanner', { type, data })
325
+    },
326
+    calendar (context, data) {
327
+      return new Promise((resolve, reject) => {
328
+        Ajax({
329
+          ...api.calendar.calendar,
330
+          data: data
331
+        }).then(res => {
332
+          resolve(res)
333
+        }).catch((err) => {
334
+          reject(err)
335
+        })
336
+      })
337
+    },
338
+    getCalendarCustomer () {
339
+      return new Promise((resolve, reject) => {
340
+        Ajax({
341
+          ...api.calendar.getCalendarCustomer
342
+        }).then(res => {
343
+          resolve(res)
344
+        }).catch((err) => {
345
+          reject(err)
346
+        })
347
+      })
348
+    }
349
+  }
350
+}

+ 27
- 2
src/util/api.js Vedi File

@@ -2,8 +2,15 @@
2 2
 const baseUrl = '/api'
3 3
 const wechat = '/wechat/:org'
4 4
 const guest = '/guest/:org'
5
+const common = '/common/:org'
5 6
 
6 7
 const $api = {
8
+  file: {
9
+    image: { // 图片上传
10
+      method: 'post',
11
+      url: `${baseUrl}${common}/file`
12
+    }
13
+  },
7 14
   index: { // 首页
8 15
     location: { // 获取5A
9 16
       method: 'get',
@@ -291,14 +298,32 @@ const $api = {
291 298
       method: 'get',
292 299
       url: `${baseUrl}${wechat}/flashbuy/newcustomer`
293 300
     },
294
-    AddNewFlashBuyCustomer: { 
301
+    AddNewFlashBuyCustomer: {
295 302
       method: 'post',
296 303
       url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
297 304
     },
298
-    UpdateFlashBuyCustomer: { 
305
+    UpdateFlashBuyCustomer: {
299 306
       method: 'put',
300 307
       url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
301 308
     }
309
+  },
310
+  calendar: {
311
+    calendar: {
312
+      method: 'post',
313
+      url: `${baseUrl}${wechat}/calendar`
314
+    },
315
+    getCalendarList: {
316
+      method: 'get',
317
+      url: `${baseUrl}${wechat}/calendar`
318
+    },
319
+    getCalendarDetail: {
320
+      method: 'get',
321
+      url: `${baseUrl}${wechat}/calendar/:calendarId`
322
+    },
323
+    getCalendarCustomer: {
324
+      method: 'get',
325
+      url: `${baseUrl}${wechat}/calendar/isattend/customer`
326
+    }
302 327
   }
303 328
 }
304 329
 export default $api

+ 268
- 0
src/util/canvas2image.js Vedi File

@@ -0,0 +1,268 @@
1
+/**
2
+ * covert canvas to image
3
+ * and save the image file
4
+ */
5
+
6
+
7
+var Canvas2Image = function () {
8
+
9
+	// check if support sth.
10
+	var $support = function () {
11
+		var canvas = document.createElement('canvas'),
12
+			ctx = canvas.getContext('2d');
13
+
14
+		return {
15
+			canvas: !!ctx,
16
+			imageData: !!ctx.getImageData,
17
+			dataURL: !!canvas.toDataURL,
18
+			btoa: !!window.btoa
19
+		};
20
+	}();
21
+
22
+	var downloadMime = 'image/octet-stream';
23
+
24
+	function scaleCanvas (canvas, width, height) {
25
+		var w = canvas.width,
26
+			h = canvas.height;
27
+		if (width == undefined) {
28
+			width = w;
29
+		}
30
+		if (height == undefined) {
31
+			height = h;
32
+		}
33
+
34
+		var retCanvas = document.createElement('canvas');
35
+		var retCtx = retCanvas.getContext('2d');
36
+		retCanvas.width = width;
37
+		retCanvas.height = height;
38
+		retCtx.drawImage(canvas, 0, 0, w, h, 0, 0, width, height);
39
+		return retCanvas;
40
+	}
41
+
42
+	function getDataURL (canvas, type, width, height) {
43
+		canvas = scaleCanvas(canvas, width, height);
44
+		return canvas.toDataURL(type);
45
+	}
46
+
47
+	function saveFile (strData) {
48
+		document.location.href = strData;
49
+	}
50
+
51
+	function genImage (strData) {
52
+		var img = document.createElement('img');
53
+		img.src = strData;
54
+		return img;
55
+	}
56
+	function fixType (type) {
57
+		type = type.toLowerCase().replace(/jpg/i, 'jpeg');
58
+		var r = type.match(/png|jpeg|bmp|gif/)[0];
59
+		return 'image/' + r;
60
+	}
61
+	function encodeData (data) {
62
+		if (!window.btoa) { throw 'btoa undefined' }
63
+		var str = '';
64
+		if (typeof data == 'string') {
65
+			str = data;
66
+		} else {
67
+			for (var i = 0; i < data.length; i++) {
68
+				str += String.fromCharCode(data[i]);
69
+			}
70
+		}
71
+
72
+		return btoa(str);
73
+	}
74
+	function getImageData (canvas) {
75
+		var w = canvas.width,
76
+			h = canvas.height;
77
+		return canvas.getContext('2d').getImageData(0, 0, w, h);
78
+	}
79
+	function makeURI (strData, type) {
80
+		return 'data:' + type + ';base64,' + strData;
81
+	}
82
+
83
+
84
+	/**
85
+	 * create bitmap image
86
+	 * 按照规则生成图片响应头和响应体
87
+	 */
88
+	var genBitmapImage = function (oData) {
89
+
90
+		//
91
+		// BITMAPFILEHEADER: http://msdn.microsoft.com/en-us/library/windows/desktop/dd183374(v=vs.85).aspx
92
+		// BITMAPINFOHEADER: http://msdn.microsoft.com/en-us/library/dd183376.aspx
93
+		//
94
+
95
+		var biWidth = oData.width;
96
+		var biHeight = oData.height;
97
+		var biSizeImage = biWidth * biHeight * 3;
98
+		var bfSize = biSizeImage + 54; // total header size = 54 bytes
99
+
100
+		//
101
+		//  typedef struct tagBITMAPFILEHEADER {
102
+		//  	WORD bfType;
103
+		//  	DWORD bfSize;
104
+		//  	WORD bfReserved1;
105
+		//  	WORD bfReserved2;
106
+		//  	DWORD bfOffBits;
107
+		//  } BITMAPFILEHEADER;
108
+		//
109
+		var BITMAPFILEHEADER = [
110
+			// WORD bfType -- The file type signature; must be "BM"
111
+			0x42, 0x4D,
112
+			// DWORD bfSize -- The size, in bytes, of the bitmap file
113
+			bfSize & 0xff, bfSize >> 8 & 0xff, bfSize >> 16 & 0xff, bfSize >> 24 & 0xff,
114
+			// WORD bfReserved1 -- Reserved; must be zero
115
+			0, 0,
116
+			// WORD bfReserved2 -- Reserved; must be zero
117
+			0, 0,
118
+			// DWORD bfOffBits -- The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits.
119
+			54, 0, 0, 0
120
+		];
121
+
122
+		//
123
+		//  typedef struct tagBITMAPINFOHEADER {
124
+		//  	DWORD biSize;
125
+		//  	LONG  biWidth;
126
+		//  	LONG  biHeight;
127
+		//  	WORD  biPlanes;
128
+		//  	WORD  biBitCount;
129
+		//  	DWORD biCompression;
130
+		//  	DWORD biSizeImage;
131
+		//  	LONG  biXPelsPerMeter;
132
+		//  	LONG  biYPelsPerMeter;
133
+		//  	DWORD biClrUsed;
134
+		//  	DWORD biClrImportant;
135
+		//  } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
136
+		//
137
+		var BITMAPINFOHEADER = [
138
+			// DWORD biSize -- The number of bytes required by the structure
139
+			40, 0, 0, 0,
140
+			// LONG biWidth -- The width of the bitmap, in pixels
141
+			biWidth & 0xff, biWidth >> 8 & 0xff, biWidth >> 16 & 0xff, biWidth >> 24 & 0xff,
142
+			// LONG biHeight -- The height of the bitmap, in pixels
143
+			biHeight & 0xff, biHeight >> 8 & 0xff, biHeight >> 16 & 0xff, biHeight >> 24 & 0xff,
144
+			// WORD biPlanes -- The number of planes for the target device. This value must be set to 1
145
+			1, 0,
146
+			// WORD biBitCount -- The number of bits-per-pixel, 24 bits-per-pixel -- the bitmap
147
+			// has a maximum of 2^24 colors (16777216, Truecolor)
148
+			24, 0,
149
+			// DWORD biCompression -- The type of compression, BI_RGB (code 0) -- uncompressed
150
+			0, 0, 0, 0,
151
+			// DWORD biSizeImage -- The size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps
152
+			biSizeImage & 0xff, biSizeImage >> 8 & 0xff, biSizeImage >> 16 & 0xff, biSizeImage >> 24 & 0xff,
153
+			// LONG biXPelsPerMeter, unused
154
+			0, 0, 0, 0,
155
+			// LONG biYPelsPerMeter, unused
156
+			0, 0, 0, 0,
157
+			// DWORD biClrUsed, the number of color indexes of palette, unused
158
+			0, 0, 0, 0,
159
+			// DWORD biClrImportant, unused
160
+			0, 0, 0, 0
161
+		];
162
+
163
+		var iPadding = (4 - ((biWidth * 3) % 4)) % 4;
164
+
165
+		var aImgData = oData.data;
166
+
167
+		var strPixelData = '';
168
+		var biWidth4 = biWidth << 2;
169
+		var y = biHeight;
170
+		var fromCharCode = String.fromCharCode;
171
+
172
+		do {
173
+			var iOffsetY = biWidth4 * (y - 1);
174
+			var strPixelRow = '';
175
+			for (var x = 0; x < biWidth; x++) {
176
+				var iOffsetX = x << 2;
177
+				strPixelRow += fromCharCode(aImgData[iOffsetY + iOffsetX + 2]) +
178
+					fromCharCode(aImgData[iOffsetY + iOffsetX + 1]) +
179
+					fromCharCode(aImgData[iOffsetY + iOffsetX]);
180
+			}
181
+
182
+			for (var c = 0; c < iPadding; c++) {
183
+				strPixelRow += String.fromCharCode(0);
184
+			}
185
+
186
+			strPixelData += strPixelRow;
187
+		} while (--y);
188
+
189
+		var strEncoded = encodeData(BITMAPFILEHEADER.concat(BITMAPINFOHEADER)) + encodeData(strPixelData);
190
+
191
+		return strEncoded;
192
+	};
193
+
194
+	/**
195
+	 * saveAsImage
196
+	 * @param canvasElement
197
+	 * @param {String} image type
198
+	 * @param {Number} [optional] png width
199
+	 * @param {Number} [optional] png height
200
+	 */
201
+	var saveAsImage = function (canvas, width, height, type) {
202
+		if ($support.canvas && $support.dataURL) {
203
+			if (typeof canvas == "string") { canvas = document.getElementById(canvas); }
204
+			if (type == undefined) { type = 'png'; }
205
+			type = fixType(type);
206
+			if (/bmp/.test(type)) {
207
+				var data = getImageData(scaleCanvas(canvas, width, height));
208
+				var strData = genBitmapImage(data);
209
+				saveFile(makeURI(strData, downloadMime));
210
+			} else {
211
+				var strData = getDataURL(canvas, type, width, height);
212
+				saveFile(strData.replace(type, downloadMime));
213
+			}
214
+		}
215
+	};
216
+
217
+	var convertToImage = function (canvas, width, height, type) {
218
+		if ($support.canvas && $support.dataURL) {
219
+			if (typeof canvas == "string") { canvas = document.getElementById(canvas); }
220
+			if (type == undefined) { type = 'png'; }
221
+			type = fixType(type);
222
+
223
+			if (/bmp/.test(type)) {
224
+				var data = getImageData(scaleCanvas(canvas, width, height));
225
+				var strData = genBitmapImage(data);
226
+				return genImage(makeURI(strData, 'image/bmp'));
227
+			} else {
228
+				var strData = getDataURL(canvas, type, width, height);
229
+				return genImage(strData);
230
+			}
231
+		}
232
+	};
233
+
234
+
235
+
236
+	return {
237
+		saveAsImage: saveAsImage,
238
+		saveAsPNG: function (canvas, width, height) {
239
+			return saveAsImage(canvas, width, height, 'png');
240
+		},
241
+		saveAsJPEG: function (canvas, width, height) {
242
+			return saveAsImage(canvas, width, height, 'jpeg');
243
+		},
244
+		saveAsGIF: function (canvas, width, height) {
245
+			return saveAsImage(canvas, width, height, 'gif');
246
+		},
247
+		saveAsBMP: function (canvas, width, height) {
248
+			return saveAsImage(canvas, width, height, 'bmp');
249
+		},
250
+
251
+		convertToImage: convertToImage,
252
+		convertToPNG: function (canvas, width, height) {
253
+			return convertToImage(canvas, width, height, 'png');
254
+		},
255
+		convertToJPEG: function (canvas, width, height) {
256
+			return convertToImage(canvas, width, height, 'jpeg');
257
+		},
258
+		convertToGIF: function (canvas, width, height) {
259
+			return convertToImage(canvas, width, height, 'gif');
260
+		},
261
+		convertToBMP: function (canvas, width, height) {
262
+			return convertToImage(canvas, width, height, 'bmp');
263
+		}
264
+	};
265
+
266
+};
267
+
268
+export default Canvas2Image()

+ 19
- 0
src/util/util.js Vedi File

@@ -1,3 +1,5 @@
1
+import Ajax from './ajax'
2
+import api from './api'
1 3
 import wechatConfig from '../config/index'
2 4
 const toolClass = {
3 5
   dateFormat: (timestamp, fmt) => {
@@ -61,6 +63,23 @@ const toolClass = {
61 63
     s = Math.round(s * 10000) / 10000.0
62 64
     console.log(s)
63 65
     return s
66
+  },
67
+  upload (item) {
68
+    return new Promise((resolve, reject) => {
69
+      Ajax({
70
+        ...api.file.image,
71
+        data: { file: item.file },
72
+      }).then((res) => {
73
+        let result = {
74
+          result: res
75
+        }
76
+        if (item.onSuccess) {
77
+          item.onSuccess(result, item.file)
78
+        }
79
+        // console.log(result)
80
+        resolve(result)
81
+      }).catch(reject)
82
+    })
64 83
   }
65 84
 }
66 85
 

+ 2
- 2
vue.config.js Vedi File

@@ -24,9 +24,9 @@ module.exports = {
24 24
       '/api': {
25 25
         // target: 'https://dp.huiju360.com.cn/hj_operations',
26 26
         // target: 'http://192.168.0.62:8080', // wf
27
-        target: 'http://192.168.0.102:8080', // hyq
27
+        // target: 'http://192.168.0.102:8080', // hyq
28 28
         // target: 'http://192.168.0.11', // ys
29
-        // target: 'http://dev.ycjcjy.com', // frp
29
+        target: 'http://dev.ycjcjy.com', // frp
30 30
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
31 31
         // pathRewrite: {
32 32
         //   '^/api': '/api-v2/api'