Bläddra i källkod

框架大换血

yuantianjiao 6 år sedan
förälder
incheckning
63f360c1c0
100 ändrade filer med 20477 tillägg och 0 borttagningar
  1. 3
    0
      .browserslistrc
  2. 16
    0
      .eslintrc.js
  3. 21
    0
      .gitignore
  4. 5
    0
      .postcssrc.js
  5. 4
    0
      .prettierrc
  6. 44
    0
      README.md
  7. 3
    0
      babel.config.js
  8. 12877
    0
      package-lock.json
  9. 32
    0
      package.json
  10. Binär
      public/favicon.ico
  11. 17
    0
      public/index.html
  12. 10
    0
      server.js
  13. 72
    0
      src/common/css/reset.css
  14. Binär
      src/common/icon/Artboard.png
  15. Binär
      src/common/icon/Line3.png
  16. Binär
      src/common/icon/already.png
  17. Binär
      src/common/icon/bg.jpg
  18. Binär
      src/common/icon/bottomMsg.png
  19. Binär
      src/common/icon/cicyle.png
  20. Binär
      src/common/icon/inv.png
  21. Binär
      src/common/icon/loading.gif
  22. Binär
      src/common/icon/logo-t.png
  23. Binär
      src/common/icon/logo.png
  24. Binär
      src/common/icon/status-icon-1.png
  25. Binär
      src/common/icon/status-icon-2.png
  26. Binär
      src/common/icon/status-icon-3.png
  27. Binär
      src/common/icon/tabBar-icon-1.png
  28. Binär
      src/common/icon/tabBar-icon-2.png
  29. Binär
      src/common/icon/tabBar-icon-3.png
  30. Binär
      src/common/icon/userCenter-icon-1.png
  31. Binär
      src/common/icon/userCenter-icon-2.png
  32. Binär
      src/common/icon/userCenter-icon-3.png
  33. 139
    0
      src/components/bubble/bubble.vue
  34. 77
    0
      src/components/calcMenu/index.vue
  35. 148
    0
      src/components/calcMenu/page.scss
  36. 49
    0
      src/components/caseTableItem/index.vue
  37. 69
    0
      src/components/caseTableItem/page.scss
  38. 66
    0
      src/components/courseItem/index.vue
  39. 94
    0
      src/components/courseItem/page.scss
  40. 99
    0
      src/components/customerCard/customerCard.vue
  41. 161
    0
      src/components/discounts/discounts.vue
  42. Binär
      src/components/loading/loading.gif
  43. 20
    0
      src/components/loading/loading.vue
  44. 154
    0
      src/components/myCard/myCard.vue
  45. 47
    0
      src/components/newsItem/index.vue
  46. 46
    0
      src/components/newsItem/page.scss
  47. 27
    0
      src/components/noMore/noMore.vue
  48. 86
    0
      src/components/orderItem/index.vue
  49. 74
    0
      src/components/orderItem/page.scss
  50. 71
    0
      src/components/orderListItem/index.vue
  51. 120
    0
      src/components/orderListItem/page.scss
  52. 115
    0
      src/components/orderPopup/index.vue
  53. 139
    0
      src/components/orderPopup/page.scss
  54. 65
    0
      src/components/qrCodeCard/qrCodeCard.vue
  55. 324
    0
      src/components/scroll/scroll.vue
  56. 42
    0
      src/components/topCaseInfo/index.vue
  57. 31
    0
      src/components/topCaseInfo/page.scss
  58. 22
    0
      src/pages/sales/App.vue
  59. 23
    0
      src/pages/sales/app.js
  60. 169
    0
      src/pages/sales/coffeeIndex/index.vue
  61. 158
    0
      src/pages/sales/coffeeIndex/page.scss
  62. 108
    0
      src/pages/sales/login/index.vue
  63. 130
    0
      src/pages/sales/login/page.scss
  64. 308
    0
      src/pages/sales/placeOrder/index.vue
  65. 241
    0
      src/pages/sales/placeOrder/page.scss
  66. 34
    0
      src/pages/sales/router.js
  67. 22
    0
      src/pages/user/App.vue
  68. 23
    0
      src/pages/user/app.js
  69. 180
    0
      src/pages/user/bindMobile/bindMobile.vue
  70. 129
    0
      src/pages/user/bindMobile/page.scss
  71. 176
    0
      src/pages/user/card/index.vue
  72. 163
    0
      src/pages/user/card/page.scss
  73. 57
    0
      src/pages/user/cardDetail/index.vue
  74. 60
    0
      src/pages/user/cardDetail/page.scss
  75. 97
    0
      src/pages/user/coupons/index.vue
  76. 7
    0
      src/pages/user/coupons/page.scss
  77. 56
    0
      src/pages/user/couponsDetail/index.vue
  78. 58
    0
      src/pages/user/couponsDetail/page.scss
  79. 184
    0
      src/pages/user/fiveA/index.vue
  80. 107
    0
      src/pages/user/fiveA/page.scss
  81. 84
    0
      src/pages/user/lessonDetail/index.vue
  82. 73
    0
      src/pages/user/lessonDetail/page.scss
  83. 136
    0
      src/pages/user/lessonOrder/index.vue
  84. 78
    0
      src/pages/user/lessonOrder/page.scss
  85. 105
    0
      src/pages/user/mainPage/coffeeIndex/index.vue
  86. 76
    0
      src/pages/user/mainPage/coffeeIndex/page.scss
  87. 57
    0
      src/pages/user/mainPage/index.vue
  88. 161
    0
      src/pages/user/mainPage/indexPage/index.vue
  89. 184
    0
      src/pages/user/mainPage/indexPage/page.scss
  90. 47
    0
      src/pages/user/mainPage/page.scss
  91. 119
    0
      src/pages/user/mainPage/userCenter/index.vue
  92. 121
    0
      src/pages/user/mainPage/userCenter/page.scss
  93. 221
    0
      src/pages/user/majorProjects/index.vue
  94. 151
    0
      src/pages/user/majorProjects/page.scss
  95. 145
    0
      src/pages/user/majorProjectsDetail/index.vue
  96. 247
    0
      src/pages/user/majorProjectsDetail/page.scss
  97. 135
    0
      src/pages/user/orderList/index.vue
  98. 150
    0
      src/pages/user/orderList/page.scss
  99. 308
    0
      src/pages/user/placeOrder/index.vue
  100. 0
    0
      src/pages/user/placeOrder/page.scss

+ 3
- 0
.browserslistrc Visa fil

@@ -0,0 +1,3 @@
1
+> 1%
2
+last 2 versions
3
+not ie <= 8

+ 16
- 0
.eslintrc.js Visa fil

@@ -0,0 +1,16 @@
1
+module.exports = {
2
+  root: true,
3
+  env: {
4
+    node: true
5
+  },
6
+  'extends': [
7
+    'plugin:vue/essential'
8
+  ],
9
+  rules: {
10
+    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
11
+    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
12
+  },
13
+  parserOptions: {
14
+    parser: 'babel-eslint'
15
+  }
16
+}

+ 21
- 0
.gitignore Visa fil

@@ -0,0 +1,21 @@
1
+.DS_Store
2
+node_modules
3
+/dist
4
+
5
+# local env files
6
+.env.local
7
+.env.*.local
8
+
9
+# Log files
10
+npm-debug.log*
11
+yarn-debug.log*
12
+yarn-error.log*
13
+
14
+# Editor directories and files
15
+.idea
16
+.vscode
17
+*.suo
18
+*.ntvs*
19
+*.njsproj
20
+*.sln
21
+*.sw*

+ 5
- 0
.postcssrc.js Visa fil

@@ -0,0 +1,5 @@
1
+module.exports = {
2
+  plugins: {
3
+    autoprefixer: {}
4
+  }
5
+}

+ 4
- 0
.prettierrc Visa fil

@@ -0,0 +1,4 @@
1
+{
2
+  "semi": false,
3
+  "singleQuote": true
4
+}

+ 44
- 0
README.md Visa fil

@@ -0,0 +1,44 @@
1
+# vue-multiple-pages
2
+
3
+## A multiple Pages Starter use Vue-cli3
4
+
5
+## Project setup
6
+
7
+download and:
8
+
9
+```
10
+npm install
11
+```
12
+### Compiles and hot-reloads for development
13
+```
14
+npm run serve
15
+```
16
+
17
+
18
+### Compiles and minifies for production
19
+```
20
+npm run build
21
+```
22
+
23
+### Lints and fixes files
24
+```
25
+npm run lint
26
+```
27
+
28
+### Modify Page Title
29
+
30
+In the root folder `title.js`.
31
+
32
+Code likes:
33
+
34
+```
35
+{
36
+  index: '主页',
37
+  'user/login': '登录',
38
+  'customer/home': '用户首页'
39
+}
40
+```
41
+
42
+### More Config
43
+
44
+[Vue-cli 3](https://cli.vuejs.org/)

+ 3
- 0
babel.config.js Visa fil

@@ -0,0 +1,3 @@
1
+module.exports = {
2
+  presets: ["@vue/app"]
3
+};

+ 12877
- 0
package-lock.json
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 32
- 0
package.json Visa fil

@@ -0,0 +1,32 @@
1
+{
2
+  "name": "multiple-pages",
3
+  "version": "0.1.0",
4
+  "private": true,
5
+  "scripts": {
6
+    "serve": "vue-cli-service serve",
7
+    "build": "vue-cli-service build",
8
+    "lint": "vue-cli-service lint"
9
+  },
10
+  "dependencies": {
11
+    "element-ui": "^2.4.6",
12
+    "vue": "^2.5.17"
13
+  },
14
+  "devDependencies": {
15
+    "@vue/cli-plugin-babel": "^3.0.1",
16
+    "@vue/cli-plugin-eslint": "^3.0.1",
17
+    "@vue/cli-service": "^3.0.1",
18
+    "@vue/eslint-config-prettier": "^3.0.1",
19
+    "axios": "^0.18.0",
20
+    "better-scroll": "^1.12.6",
21
+    "less": "^3.0.4",
22
+    "less-loader": "^4.1.0",
23
+    "node-sass": "^4.9.3",
24
+    "qrcodejs2": "^0.0.2",
25
+    "sass-loader": "^7.1.0",
26
+    "vant": "^1.3.0",
27
+    "vue-awesome-swiper": "^3.1.3",
28
+    "vue-router": "^3.0.1",
29
+    "vue-template-compiler": "^2.5.17",
30
+    "vuex": "^3.0.1"
31
+  }
32
+}

Binär
public/favicon.ico Visa fil


+ 17
- 0
public/index.html Visa fil

@@ -0,0 +1,17 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8">
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
+    <title><%= htmlWebpackPlugin.options.title %></title>
9
+  </head>
10
+  <body>
11
+    <noscript>
12
+      <strong>We're sorry but multiple-pages doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
+    </noscript>
14
+    <div id="app"></div>
15
+    <!-- built files will be auto injected -->
16
+  </body>
17
+</html>

+ 10
- 0
server.js Visa fil

@@ -0,0 +1,10 @@
1
+var express = require('express')
2
+var app = express()
3
+
4
+app.use(express.static('./dist'))
5
+
6
+app.get('/', function (req, res) {
7
+  res.send('Hello Vue')
8
+})
9
+
10
+app.listen(2333)

+ 72
- 0
src/common/css/reset.css Visa fil

@@ -0,0 +1,72 @@
1
+@charset "utf-8";
2
+html,body{width:100%;height:100%;-webkit-text-size-adjust:100%;position:relative;color:#333;overflow-x:hidden;font-size:100px;}
3
+@media screen and (max-width:320px){html,body{font-size:85px;}}
4
+@media screen and (min-width:375px){html,body{font-size:100px;}}
5
+@media screen and (min-width:414px){html,body{font-size:110px;}}
6
+*{margin:0;padding:0;color:#000;font-family:"微软雅黑";-webkit-tap-highlight-color:rgba(255,0,0,0);-webkit-font-smoothing:antialiased;}
7
+body *{font-size:.13rem;}
8
+a{text-decoration:none;}
9
+a:hover{cursor:pointer;}
10
+em{font-style:normal;}
11
+li{list-style:none;}
12
+img{border:0;vertical-align:middle;}
13
+table{border-collapse:collapse;border-spacing:0;}
14
+p{word-wrap:break-word;}
15
+b{font-weight:normal;}
16
+input,textarea{border:0;-webkit-appearance:none;}
17
+input[type=input]{-webkit-appearance:none;}
18
+input[type=checkbox]{-webkit-appearance:checkbox;}
19
+.text-overflow-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
20
+.centerLabel{display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);-webkit-transform:translate(-50%,-50%);}
21
+.flex-h{display:flex;display:-webkit-flex;}
22
+.flex-v{display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;}
23
+.flex-item{flex:1;-webkit-flex:1;position:relative;overflow:hidden;}
24
+*[class*="text-overflowEllipsis-line"]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;}
25
+.text-overflowEllipsis-line2{-webkit-line-clamp:2;}
26
+.text-overflowEllipsis-line3{-webkit-line-clamp:3;}
27
+.text-overflowEllipsis-line4{-webkit-line-clamp:4;}
28
+*[class*="overflow-scroll-y"]{overflow-x:hidden;overflow-y:scroll;-webkit-overflow-scrolling:touch;}
29
+*[class*="overflow-scroll-x"]{overflow-y:hidden;overflow-x:scroll;-webkit-overflow-scrolling:touch;}
30
+.overflow-scroll-y-3d,.overflow-scroll-x-3d{transform:translateZ(0);-webkit-transform:translateZ(0);}
31
+.overflow-scroll-x::-webkit-scrollbar,.overflow-scroll-x-3d::-webkit-scrollbar{width:0;height:0;color:transparent;display:none;}
32
+input:focus,textarea:focus,select:focus {
33
+    outline:none;
34
+}
35
+textarea{
36
+	resize: none;
37
+}
38
+
39
+select{
40
+	direction: rtl;
41
+}
42
+
43
+select option {
44
+    direction: ltr;
45
+}
46
+
47
+*>img.cover{
48
+	width: 100%;
49
+	height: 100%;
50
+	object-fit: cover;
51
+}
52
+
53
+*>img.contain{
54
+	width: 100%;
55
+	height: 100%;
56
+	object-fit: contain;
57
+}
58
+
59
+.mainPage{
60
+	width: 100%;
61
+	height: 100%;
62
+	position: relative;
63
+	background: #fff;
64
+}
65
+
66
+.van-toast div{
67
+	color: white;
68
+}
69
+
70
+.van-picker{
71
+	z-index: 101;
72
+}

Binär
src/common/icon/Artboard.png Visa fil


Binär
src/common/icon/Line3.png Visa fil


Binär
src/common/icon/already.png Visa fil


Binär
src/common/icon/bg.jpg Visa fil


Binär
src/common/icon/bottomMsg.png Visa fil


Binär
src/common/icon/cicyle.png Visa fil


Binär
src/common/icon/inv.png Visa fil


Binär
src/common/icon/loading.gif Visa fil


Binär
src/common/icon/logo-t.png Visa fil


Binär
src/common/icon/logo.png Visa fil


Binär
src/common/icon/status-icon-1.png Visa fil


Binär
src/common/icon/status-icon-2.png Visa fil


Binär
src/common/icon/status-icon-3.png Visa fil


Binär
src/common/icon/tabBar-icon-1.png Visa fil


Binär
src/common/icon/tabBar-icon-2.png Visa fil


Binär
src/common/icon/tabBar-icon-3.png Visa fil


Binär
src/common/icon/userCenter-icon-1.png Visa fil


Binär
src/common/icon/userCenter-icon-2.png Visa fil


Binär
src/common/icon/userCenter-icon-3.png Visa fil


+ 139
- 0
src/components/bubble/bubble.vue Visa fil

@@ -0,0 +1,139 @@
1
+<template>
2
+  <canvas ref="bubble" :width="width" :height="height" :style="style"></canvas>
3
+</template>
4
+
5
+<script type="text/ecmascript-6">
6
+export default {
7
+  props: {
8
+    y: {
9
+      type: Number,
10
+      default: 0
11
+    }
12
+  },
13
+  data () {
14
+    return {
15
+      width: 50,
16
+      height: 80
17
+    }
18
+  },
19
+  computed: {
20
+    distance () {
21
+      return Math.max(0, Math.min(this.y * this.ratio, this.maxDistance))
22
+    },
23
+    style () {
24
+      return `width:${this.width / this.ratio}px;height:${this.height / this.ratio}px`
25
+    }
26
+  },
27
+  created () {
28
+    this.ratio = window.devicePixelRatio
29
+    this.width *= this.ratio
30
+    this.height *= this.ratio
31
+    this.initRadius = 18 * this.ratio
32
+    this.minHeadRadius = 12 * this.ratio
33
+    this.minTailRadius = 5 * this.ratio
34
+    this.initArrowRadius = 10 * this.ratio
35
+    this.minArrowRadius = 6 * this.ratio
36
+    this.arrowWidth = 3 * this.ratio
37
+    this.maxDistance = 40 * this.ratio
38
+    this.initCenterX = 25 * this.ratio
39
+    this.initCenterY = 25 * this.ratio
40
+    this.headCenter = {
41
+      x: this.initCenterX,
42
+      y: this.initCenterY
43
+    }
44
+  },
45
+  mounted () {
46
+    this._draw()
47
+  },
48
+  methods: {
49
+    _draw () {
50
+      const bubble = this.$refs.bubble
51
+      let ctx = bubble.getContext('2d')
52
+      ctx.clearRect(0, 0, bubble.width, bubble.height)
53
+
54
+      this._drawBubble(ctx)
55
+
56
+      this._drawArrow(ctx)
57
+    },
58
+    _drawBubble (ctx) {
59
+      ctx.save()
60
+      ctx.beginPath()
61
+
62
+      const rate = this.distance / this.maxDistance
63
+      const headRadius = this.initRadius - (this.initRadius - this.minHeadRadius) * rate
64
+
65
+      this.headCenter.y = this.initCenterY - (this.initRadius - this.minHeadRadius) * rate
66
+
67
+      // 画上半弧线
68
+      ctx.arc(this.headCenter.x, this.headCenter.y, headRadius, 0, Math.PI, true)
69
+
70
+      // 画左侧贝塞尔
71
+      const tailRadius = this.initRadius - (this.initRadius - this.minTailRadius) * rate
72
+      const tailCenter = {
73
+        x: this.headCenter.x,
74
+        y: this.headCenter.y + this.distance
75
+      }
76
+
77
+      const tailPointL = {
78
+        x: tailCenter.x - tailRadius,
79
+        y: tailCenter.y
80
+      }
81
+      const controlPointL = {
82
+        x: tailPointL.x,
83
+        y: tailPointL.y - this.distance / 2
84
+      }
85
+
86
+      ctx.quadraticCurveTo(controlPointL.x, controlPointL.y, tailPointL.x, tailPointL.y)
87
+
88
+      // 画下半弧线
89
+      ctx.arc(tailCenter.x, tailCenter.y, tailRadius, Math.PI, 0, true)
90
+
91
+      // 画右侧贝塞尔
92
+      const headPointR = {
93
+        x: this.headCenter.x + headRadius,
94
+        y: this.headCenter.y
95
+      }
96
+      const controlPointR = {
97
+        x: tailCenter.x + tailRadius,
98
+        y: headPointR.y + this.distance / 2
99
+      }
100
+      ctx.quadraticCurveTo(controlPointR.x, controlPointR.y, headPointR.x, headPointR.y)
101
+
102
+      ctx.fillStyle = 'rgb(170,170,170)'
103
+      ctx.fill()
104
+      ctx.strokeStyle = 'rgb(153,153,153)'
105
+      ctx.stroke()
106
+      ctx.restore()
107
+    },
108
+    _drawArrow (ctx) {
109
+      ctx.save()
110
+      ctx.beginPath()
111
+
112
+      const rate = this.distance / this.maxDistance
113
+      const arrowRadius = this.initArrowRadius - (this.initArrowRadius - this.minArrowRadius) * rate
114
+
115
+      // 画内圆
116
+      ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius - (this.arrowWidth - rate), -Math.PI / 2, 0, true)
117
+
118
+      // 画外圆
119
+      ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius, 0, Math.PI * 3 / 2, false)
120
+
121
+      ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius - this.arrowWidth / 2 + rate)
122
+      ctx.lineTo(this.headCenter.x + this.arrowWidth * 2 - rate * 2, this.headCenter.y - arrowRadius + this.arrowWidth / 2)
123
+
124
+      ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius + this.arrowWidth * 3 / 2 - rate)
125
+
126
+      ctx.fillStyle = 'rgb(255,255,255)'
127
+      ctx.fill()
128
+      ctx.strokeStyle = 'rgb(170,170,170)'
129
+      ctx.stroke()
130
+      ctx.restore()
131
+    }
132
+  },
133
+  watch: {
134
+    y () {
135
+      this._draw()
136
+    }
137
+  }
138
+}
139
+</script>

+ 77
- 0
src/components/calcMenu/index.vue Visa fil

@@ -0,0 +1,77 @@
1
+<template>
2
+  <div class="calcMenu" :class="{'show':show}">
3
+    <div class="centerLabel flex-h">
4
+      <div class="flex-item">
5
+        <div>
6
+          <div class="top">
7
+            <span>确认下单信息</span>
8
+            <span>下单完成后共计使用<em>{{totalNum}}</em>次</span>
9
+          </div>
10
+          <div class="content">
11
+            <span v-if="!data.length">您还没有点单哦~</span>  
12
+            <ul>
13
+              <li class="flex-h" v-for="(item,index) in data" :key="index">
14
+                <span>{{item.name}}</span>
15
+                <span v-if="item.specName !== null">({{item.specName}})</span>
16
+                <div class="flex-item">
17
+                  <div>
18
+                    <span>x{{item.defaultNum === null ? item.num : item.defaultNum}}</span>
19
+                  </div>
20
+                </div>
21
+              </li>
22
+            </ul>
23
+          </div>
24
+          <div class="bottom">
25
+            <div class="flex-h" v-if="data.length">
26
+              <span>备注:</span>
27
+              <div class="flex-item">
28
+                <div>
29
+                  <textarea cols="30" rows="3"></textarea>
30
+                </div>
31
+              </div>
32
+            </div>
33
+            <ul class="flex-h">
34
+              <li class="flex-item" @click="close">再看看</li>
35
+              <li class="flex-item" @click="placeOrder">下单</li>
36
+            </ul>
37
+          </div>
38
+        </div>
39
+      </div>
40
+    </div>
41
+  </div>
42
+</template>
43
+
44
+<script>
45
+
46
+export default {
47
+  name: '',
48
+  props: ['show', 'data', 'totalNum'],
49
+  data () {
50
+    return {
51
+
52
+    }
53
+  },
54
+  computed: {
55
+
56
+  },
57
+  components: {
58
+
59
+  },
60
+  created () {
61
+
62
+  },
63
+  methods: {
64
+    close () { // 关闭菜单
65
+      this.$emit('closeCalcMenu')
66
+    },
67
+    placeOrder () { // 点单
68
+      this.$emit('placeOrder')
69
+    },
70
+  }
71
+}
72
+</script>
73
+
74
+<!-- Add "scoped" attribute to limit CSS to this component only -->
75
+<style lang="scss" scoped>
76
+@import "page.scss";
77
+</style>

+ 148
- 0
src/components/calcMenu/page.scss Visa fil

@@ -0,0 +1,148 @@
1
+.calcMenu{
2
+  width: 100%;
3
+  position: absolute;
4
+  left: 0;
5
+  bottom: 0;
6
+  top: 0;
7
+  background: rgba(0, 0, 0, .5);
8
+  z-index: 500;
9
+  display: none;
10
+  &.show{
11
+    display: block;
12
+  }
13
+  &>div{
14
+    width: 3.2rem;
15
+    border-radius: .1rem;
16
+    background: #fff;
17
+    position: absolute;
18
+    overflow: hidden;
19
+    &>div{
20
+      margin: 0 .2rem;
21
+      &>div{
22
+        width: 100%;
23
+        position: relative;
24
+        overflow: hidden;
25
+        .top{
26
+          width: 100%;
27
+          position: relative;
28
+          overflow: hidden;
29
+          margin: .1rem auto 0;
30
+          padding-bottom: .05rem;
31
+          border-bottom: .01rem solid #eee;
32
+          span{
33
+            width: 100%;
34
+            display: block;
35
+            text-align: center;
36
+            font-size: .11rem;
37
+            color: #666;
38
+            line-height: .22rem;
39
+            &:first-child{
40
+              line-height: .26rem;
41
+              font-size: .15rem;
42
+              color: #333;
43
+            }
44
+            em{
45
+              color: #f1644b;
46
+              font-size: .11rem;
47
+            }
48
+          }
49
+        }
50
+        .content{
51
+          width: 100%;
52
+          max-height: 2rem;
53
+          position: relative;
54
+          overflow-y: scroll;
55
+          -webkit-overflow-scrolling: touch;
56
+          transform: translateZ(0);
57
+          -webkit-transform: translateZ(0);
58
+          border-bottom: .01rem solid #eee;
59
+          padding-bottom: .1rem;
60
+          &>span{
61
+            width: 100%;
62
+            display: block;
63
+            line-height: .4rem;
64
+            text-align: center;
65
+            font-size: .15rem;
66
+            color: #ccc;
67
+          }
68
+          ul{
69
+            margin: .1rem auto 0;
70
+            li{
71
+              &>*{
72
+                line-height: .34rem;
73
+                font-size: .14rem;
74
+                &:first-child{
75
+                  width: 30%;
76
+                  text-align: center;
77
+                }
78
+                &:nth-child(2){
79
+                  font-size: .11rem;
80
+                  color: #666;
81
+                }
82
+              }
83
+              &>div{
84
+                margin-right: .2rem;
85
+                &>div{
86
+                  width: 100%;
87
+                  position: relative;
88
+                  overflow: hidden;
89
+                  span{
90
+                    width: 100%;
91
+                    display: block;
92
+                    text-align: right;
93
+                    font-size: .14rem;
94
+                    color: #666;
95
+                  }
96
+                }
97
+              }
98
+            }
99
+          }
100
+        }
101
+        .bottom{
102
+          margin: .1rem auto 0;
103
+          &>div.flex-h{
104
+            align-items: flex-start;
105
+            &>span{
106
+              line-height: .2rem;
107
+              font-size: .13rem;
108
+              color: #666;
109
+            }
110
+            &>div{
111
+              &>div{
112
+                width: 100%;
113
+                position: relative;
114
+                overflow: hidden;
115
+                textarea{
116
+                  width: 100%;
117
+                  line-height: .2rem;
118
+                  font-size: .13rem;
119
+                  color: #666;
120
+                }
121
+              }
122
+            }
123
+          }
124
+          ul{
125
+            width: 100%;
126
+            position: relative;
127
+            overflow: hidden;
128
+            margin-bottom: .25rem;
129
+            li{
130
+              line-height: .36rem;
131
+              border: .01rem solid #333;
132
+              padding: 0 .15rem;
133
+              font-size: .15rem;
134
+              border-radius: .04rem;
135
+              text-align: center;
136
+              &:nth-child(1){
137
+                margin-right: .1rem;
138
+              }
139
+              &:nth-child(2){
140
+                margin-left: .1rem;
141
+              }
142
+            }
143
+          }
144
+        }
145
+      }
146
+    }
147
+  }
148
+}

+ 49
- 0
src/components/caseTableItem/index.vue Visa fil

@@ -0,0 +1,49 @@
1
+<template>
2
+  <div class="caseTableItem flex-h">
3
+    <i class="iconfont icon-yinchenglogo"></i>
4
+    <div class="itemNo">
5
+      <a>
6
+        <div class="centerLabel">
7
+          <i v-if="String(index + 1).length < 2" class="iconfont icon-0"></i>
8
+          <i class="iconfont" v-for="(numItem,numIndex) in String(index + 1).length" :key="numIndex" :class="'icon-' + String(index + 1).substring(numIndex, numIndex + 1)"></i>
9
+        </div>
10
+      </a>
11
+    </div>
12
+    <div class="flex-item">
13
+      <div>
14
+        <span>案场一号桌</span>
15
+        <router-link :to="{name: 'placeOrder', query: {}}">选择点单</router-link>
16
+      </div>
17
+    </div>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+
23
+export default {
24
+  name: '',
25
+  props: ['item','index'],
26
+  data () {
27
+    return {
28
+      
29
+    }
30
+  },
31
+  computed: {
32
+    
33
+  },
34
+  components: {
35
+    
36
+  },
37
+  created () {
38
+    
39
+  },
40
+  methods: {
41
+    
42
+  }
43
+}
44
+</script>
45
+
46
+<!-- Add "scoped" attribute to limit CSS to this component only -->
47
+<style lang="scss" scoped>
48
+@import "page.scss";
49
+</style>

+ 69
- 0
src/components/caseTableItem/page.scss Visa fil

@@ -0,0 +1,69 @@
1
+.caseTableItem{
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  align-items: center;
6
+  &>i{
7
+    display: inline-block;
8
+    position: absolute;
9
+    right: .1rem;
10
+    top: .05rem;
11
+    font-size: .36rem;
12
+    z-index: 1;
13
+    color: rgba(255, 0, 0, .1);
14
+  }
15
+  .itemNo{
16
+    width: .44rem;
17
+    position: relative;
18
+    overflow: hidden;
19
+    margin-left: .15rem;
20
+    z-index: 2;
21
+    a{
22
+      width: 100%;
23
+      display: block;
24
+      padding-bottom: 100%;
25
+      box-sizing: border-box;
26
+      border: .01rem solid #eee;
27
+      border-radius: 100%;
28
+      position: relative;
29
+      overflow: hidden;
30
+      div{
31
+        width: 100%;
32
+        text-align: center;
33
+        font-size: 0;
34
+        white-space: nowrap;
35
+        i{
36
+          display: inline-block;
37
+          font-size: .13rem;
38
+          color: #666;
39
+        }
40
+      }
41
+    }
42
+  }
43
+  &>div.flex-item{
44
+    margin: 0 .1rem;
45
+    position: relative;
46
+    overflow: hidden;
47
+    z-index: 2;
48
+    &>div{
49
+      width: 100%;
50
+      position: relative;
51
+      overflow: hidden;
52
+      span{
53
+        width: 100%;
54
+        display: block;
55
+        overflow: hidden;
56
+        text-overflow: ellipsis;
57
+        white-space: nowrap;
58
+        font-size: .13rem;
59
+        color: #666;
60
+        line-height: .24rem;
61
+      }
62
+      a{
63
+        line-height: .22rem;
64
+        color: #fb6b2f;
65
+        font-size: .13rem;
66
+      }
67
+    }
68
+  }
69
+}

+ 66
- 0
src/components/courseItem/index.vue Visa fil

@@ -0,0 +1,66 @@
1
+<template>
2
+  <div class="courseItem flex-h">
3
+    <div class="img">
4
+      <a>
5
+        <img :src="data.img" class="centerLabel cover" alt="">
6
+      </a>
7
+    </div>
8
+    <div class="flex-item flex-v">
9
+      <div class="flex-item">
10
+        <div class="content">
11
+          <div class="title flex-h">
12
+            <div class="flex-item">
13
+              <span>{{data.title}}</span>
14
+            </div>
15
+            <div v-if="data.getWay=='ticket'">
16
+              <span>{{data.defaultPrice}}</span><br>
17
+              <span>优惠券体验</span>
18
+            </div>
19
+          </div>
20
+          <span>时间:{{data.time}}</span>
21
+          <span>地点:{{data.address}}</span>
22
+        </div>
23
+      </div>
24
+      <ul v-if="data.getWay=='ticket'">
25
+        <li v-for="(item,index) in data.tag" :key="index">{{item}}</li>
26
+      </ul>
27
+      <div v-if="data.getWay=='free'" class="flex-h">
28
+        <div class="flex-item">
29
+          <i class="iconfont icon-kecheng"></i>
30
+          <span>团体课</span>  
31
+        </div>
32
+        <span>免费体验</span>
33
+      </div>
34
+    </div>
35
+  </div>
36
+</template>
37
+
38
+<script>
39
+
40
+export default {
41
+  name: '',
42
+  props: ['data'],
43
+  data () {
44
+    return {
45
+      
46
+    }
47
+  },
48
+  computed: {
49
+    
50
+  },
51
+  components: {
52
+    
53
+  },
54
+  created () {
55
+    
56
+  },
57
+  methods: {
58
+    
59
+  }
60
+}
61
+</script>
62
+
63
+<!-- Add "scoped" attribute to limit CSS to this component only -->
64
+<style lang="scss" scoped>
65
+@import "page.scss";
66
+</style>

+ 94
- 0
src/components/courseItem/page.scss Visa fil

@@ -0,0 +1,94 @@
1
+.courseItem{
2
+  .img{
3
+    width: .8rem;
4
+    position: relative;
5
+    overflow: hidden;
6
+    a{
7
+      width: 100%;
8
+      padding-bottom: 125%;
9
+      display: block;
10
+      background: #eee;
11
+      border-radius: .06rem;
12
+      position: relative;
13
+      overflow: hidden;
14
+    }
15
+  }
16
+  &>div.flex-item{
17
+    position: relative;
18
+    overflow: hidden;
19
+    margin-left: .15rem;
20
+    &>div.flex-item{
21
+      .title{
22
+        align-items: center;
23
+        &>.flex-item{
24
+          span{
25
+            width: 100%;
26
+            font-size: .15rem;
27
+            display: block;
28
+            white-space: nowrap;
29
+            text-overflow: ellipsis;
30
+            color: #323b45;
31
+          }
32
+          &+div{
33
+            text-align: right;
34
+            *{
35
+              display: inline-block;
36
+              line-height: .14rem;
37
+              font-size: .11rem;
38
+              color: #ff1414;
39
+            }
40
+            &>*:first-child{
41
+              text-decoration: line-through;
42
+              color: #ccc;
43
+            }
44
+          }
45
+        }
46
+      }
47
+      &>div.content{
48
+        &>span{
49
+          width: 100%;
50
+          display: block;
51
+          line-height: .16rem;
52
+          font-size: .11rem;
53
+          color: #565656;
54
+        }
55
+      }
56
+    }
57
+    &>ul{
58
+      white-space: nowrap;
59
+      font-size: 0;
60
+      li{
61
+        display: inline-block;
62
+        line-height: .2rem;
63
+        background: #f2f4f7;
64
+        color: #92a7c9;
65
+        font-size: .11rem;
66
+        margin-right: .05rem;
67
+        padding: 0 .05rem;
68
+        border-radius: .04rem;
69
+      }
70
+    }
71
+    &>div.flex-h{
72
+      div{
73
+        font-size: 0;
74
+        white-space: nowrap;
75
+        *{
76
+          font-size: .11rem;
77
+          vertical-align: middle;
78
+          line-height: .2rem;
79
+          display: inline-block;
80
+          margin-right: .05rem;
81
+          color: #fa2a00;
82
+        }
83
+        i{
84
+          font-size: .13rem;
85
+        }
86
+      }
87
+      &>span{
88
+        line-height: .2rem;
89
+        color: #fa2a00;
90
+        font-size: .11rem;
91
+      }
92
+    }
93
+  }
94
+}

+ 99
- 0
src/components/customerCard/customerCard.vue Visa fil

@@ -0,0 +1,99 @@
1
+<template>
2
+  <div class="card-content">
3
+    <div class="card-top flex-h">
4
+      <div class="flex-h">
5
+        <img :src="inv" alt="">
6
+        <div>
7
+          <span>姓名:王丽丽</span>
8
+          <span>手机号:17372957078</span>
9
+        </div>
10
+      </div>
11
+      <div>
12
+        <div>领取记录</div>
13
+        <div>历史备注</div>
14
+      </div>
15
+    </div>
16
+    <div class="card-bottom">
17
+      <span>备注:老客户,人非常好。</span>
18
+      <span>+ 添加备注</span>
19
+    </div>
20
+  </div>
21
+</template>
22
+
23
+<script>
24
+import inv from '../../common/icon/inv.png'
25
+export default {
26
+  name: 'myCard',
27
+  data () {
28
+    return {
29
+      inv
30
+    }
31
+  },
32
+  props: {
33
+    data: {
34
+      type: Object,
35
+      default: () => { }
36
+    }
37
+  },
38
+  methods: {
39
+    share () {
40
+      this.$emit('share', this.data)
41
+    }
42
+  }
43
+}
44
+</script>
45
+
46
+<style lang="scss" scoped>
47
+.card-content {
48
+  box-shadow: 0px 2px 0.1rem 0px rgba(193, 204, 217, 0.5);
49
+  border-radius: 0.08rem;
50
+  overflow: hidden;
51
+  margin-bottom: 0.2rem;
52
+  .card-top {
53
+    padding: 0.3rem 0.1rem;
54
+    > div:nth-of-type(1) {
55
+      align-items: center;
56
+      img {
57
+        width: 0.5rem;
58
+        height: 0.5rem;
59
+        border-radius: 50%;
60
+        padding-right: 0.2rem;
61
+      }
62
+      div {
63
+        span {
64
+          display: block;
65
+          padding: .02rem 0;
66
+        }
67
+      }
68
+    }
69
+    > div:nth-of-type(2) {
70
+      display: flex;
71
+      flex-flow: column nowrap;
72
+      align-items: center;
73
+      justify-content: center;
74
+      flex: 1;
75
+      padding-left: .15rem;
76
+      div{
77
+        color: #FC6243;
78
+        font-size: .12rem;
79
+        padding: 0.02rem .15rem;
80
+        border: 1px solid #FC6243;
81
+        border-radius: 20px;
82
+        margin: 0.05rem 0;
83
+      }
84
+    }
85
+  }
86
+  .card-bottom{
87
+    background: #F2F2F2;
88
+    display: flex;
89
+    padding: .15rem;
90
+    justify-content: space-between;
91
+    span:nth-of-type(1){
92
+      color: #323645;
93
+    }
94
+    span:nth-of-type(2){
95
+      color: #909090;
96
+    }
97
+  }
98
+}
99
+</style>

+ 161
- 0
src/components/discounts/discounts.vue Visa fil

@@ -0,0 +1,161 @@
1
+<template>
2
+  <div class="discounts">
3
+    <div class="flex-h" :class="{'opacity' : data.useType == '已失效' || data.useType == '已使用', 'gray': data.useType == '已使用'}" @click="toDetail">
4
+      <div class="card-left">
5
+        <div class="title">
6
+          <i class="iconfont icon-youhuiquan"></i>
7
+          <div>{{data.title}}</div>
8
+        </div>
9
+        <div class="desc">{{data.desc}}</div>
10
+        <div class="time">有效期至{{data.time}}</div>
11
+      </div>
12
+      <div class="card-right">
13
+        <img :src="logo" alt="" width="100%" height="100%">
14
+        <div class="btn" @click.stop="toUse" v-if="data.useType == '未使用'">去使用</div>
15
+      </div>
16
+      <div class="tag" :class="{'gray-location' : data.useType == '已使用'}">
17
+        <span>{{data.tag}}</span>
18
+      </div>
19
+    </div>
20
+    <div class="useType">
21
+      <img :src="used" alt="已使用" v-if="data.useType == '已使用'" width="100%" height="100%">
22
+      <img :src="failure" alt="已失效" v-if="data.useType == '已失效'" width="100%" height="100%">
23
+    </div>
24
+  </div>
25
+</template>
26
+
27
+<script>
28
+import logo from '../../common/icon/logo-t.png'
29
+import used from '../../common/icon/already.png'
30
+import failure from '../../common/icon/inv.png'
31
+export default {
32
+  props: ['data'],
33
+  data () {
34
+    return {
35
+      logo,
36
+      used,
37
+      failure
38
+    }
39
+  },
40
+  methods: {
41
+    toUse () {
42
+      this.$emit('toUse', this.data)
43
+    },
44
+    toDetail () {
45
+      this.$emit('toDetail', this.data)
46
+    }
47
+  }
48
+}
49
+</script>
50
+
51
+<style lang="scss" scoped>
52
+.discounts {
53
+  padding: 0.15rem 0.2rem;
54
+  box-sizing: border-box;
55
+  background: rgba(255, 255, 255, 1);
56
+  box-shadow: 0px 2px 0.1rem 0px rgba(193, 204, 217, 0.5);
57
+  border-radius: 0.08rem;
58
+  margin-bottom: 0.2rem;
59
+  position: relative;
60
+  overflow: hidden;
61
+  .flex-h {
62
+    &.opacity {
63
+      opacity: 0.5;
64
+    }
65
+    &.gray {
66
+      filter: grayscale(100%);
67
+    }
68
+    .card-left {
69
+      flex: 1;
70
+      display: flex;
71
+      flex-flow: column nowrap;
72
+      .title {
73
+        display: flex;
74
+        align-items: center;
75
+        i {
76
+          padding-right: 0.08rem;
77
+          color: #ff7c1c;
78
+          font-weight: bold;
79
+          font-size: 0.2rem;
80
+        }
81
+        div {
82
+          font-size: 0.16rem;
83
+          font-weight: bold;
84
+          color: rgba(50, 54, 69, 1);
85
+        }
86
+      }
87
+      .desc {
88
+        flex: 1;
89
+        display: flex;
90
+        align-items: center;
91
+        font-size: 0.12rem;
92
+        color: rgba(128, 128, 128, 1);
93
+      }
94
+      .time {
95
+        font-size: 0.12rem;
96
+        color: rgba(128, 128, 128, 1);
97
+      }
98
+    }
99
+    .card-right {
100
+      width: 0.9rem;
101
+      height: 0.9rem;
102
+      position: relative;
103
+      .btn {
104
+        position: absolute;
105
+        top: 50%;
106
+        left: 50%;
107
+        transform: translate(-25%, -50%);
108
+        color: #ff7c1c;
109
+        width: 0.62rem;
110
+        text-align: center;
111
+        padding-bottom: 0.02rem;
112
+        border: 1px solid #ff7c1c;
113
+        border-radius: 0.2rem;
114
+        z-index: 2;
115
+      }
116
+    }
117
+
118
+    .tag {
119
+      position: absolute;
120
+      background: linear-gradient(
121
+        45deg,
122
+        rgba(255, 105, 0, 1) 0%,
123
+        rgba(255, 136, 0, 0.76) 100%
124
+      );
125
+      opacity: 0.85;
126
+      width: 0.6rem;
127
+      height: 0.6rem;
128
+      transform: rotate(45deg);
129
+      bottom: -0.3rem;
130
+      right: -0.3rem;
131
+      &.gray-location {
132
+        background: rgba(189, 189, 189, 1);
133
+      }
134
+      span {
135
+        position: absolute;
136
+        top: 0.22rem;
137
+        left: -0.03rem;
138
+        font-size: 0.12rem;
139
+        color: #fff;
140
+        transform: rotate(-90deg);
141
+      }
142
+    }
143
+  }
144
+  .useType {
145
+    position: absolute;
146
+    bottom: 0.25rem;
147
+    right: 0.25rem;
148
+    width: 0.76rem;
149
+    height: 0.76rem;
150
+  }
151
+}
152
+
153
+@media screen and (max-width: 320px) {
154
+  .tag {
155
+    span {
156
+      top: 0.2rem !important;
157
+      left: -0.05rem !important;
158
+    }
159
+  }
160
+}
161
+</style>

Binär
src/components/loading/loading.gif Visa fil


+ 20
- 0
src/components/loading/loading.vue Visa fil

@@ -0,0 +1,20 @@
1
+<template>
2
+  <div class="mf-loading-container">
3
+    <img src="./loading.gif">
4
+  </div>
5
+</template>
6
+<script type="text/ecmascript-6">
7
+const COMPONENT_NAME = 'loading'
8
+export default {
9
+  name: COMPONENT_NAME
10
+}
11
+</script>
12
+<style lang="scss" scoped>
13
+.mf-loading-container {
14
+  img {
15
+    width: 20px;
16
+    height: 20px;
17
+    display: block;
18
+  }
19
+}
20
+</style>

+ 154
- 0
src/components/myCard/myCard.vue Visa fil

@@ -0,0 +1,154 @@
1
+<template>
2
+  <div class="card-content flex-l" :class="{invalid: data.invalid}">
3
+    <div class="card-top flex-h">
4
+      <div>
5
+        <img :src="logo" class="logo">
6
+        <span>¥ <span> 9999 </span> 元</span>
7
+        <img :src="line3" class="line3">
8
+      </div>
9
+      <div>
10
+        <h2>咖啡团课一次体验卡</h2>
11
+        <span>可在银城会所健身房体验私教课一次</span>
12
+        <span>2018年02月17日-2018年3月17日</span>
13
+      </div>
14
+    </div>
15
+    <div class="card-main flex-h">
16
+      <img :src="line">
17
+      <div class="flex-h">
18
+        <span>总数量</span>
19
+        <span>40</span>
20
+      </div>
21
+      <div>
22
+        <span>总剩余</span>
23
+        <span>40</span>
24
+      </div>
25
+      <div>
26
+        <span>用户领取</span>
27
+        <span>40</span>
28
+      </div>
29
+      <div>
30
+        <span>用户使用</span>
31
+        <span>40</span>
32
+      </div>
33
+    </div>
34
+    <div class="card-bottom" @click.stop="share">
35
+      分享卡券
36
+    </div>
37
+  </div>
38
+</template>
39
+
40
+<script>
41
+import logo from '../../common/icon/logo-t.png'
42
+import line from '../../common/icon/cicyle.png'
43
+import line3 from '../../common/icon/Line3.png'
44
+export default {
45
+  name: 'myCard',
46
+  data () {
47
+    return {
48
+      logo,
49
+      line,
50
+      line3
51
+    }
52
+  },
53
+  props: {
54
+    data: {
55
+      type: Object,
56
+      default: () => { }
57
+    }
58
+  },
59
+  methods: {
60
+    share () {
61
+      this.$emit('share', this.data)
62
+    }
63
+  }
64
+}
65
+</script>
66
+
67
+<style lang="scss" scoped>
68
+.card-content {
69
+  box-shadow: 0px 2px 0.1rem 0px rgba(193, 204, 217, 0.5);
70
+  border-radius: 0.08rem;
71
+  overflow: hidden;
72
+  margin-bottom: 0.2rem;
73
+  &.invalid {
74
+    filter: grayscale(100%);
75
+  }
76
+  .card-top {
77
+    height: 0.88rem;
78
+    padding: 0.1rem;
79
+    box-sizing: border-box;
80
+    div:nth-of-type(1) {
81
+      width: 1.2rem;
82
+      position: relative;
83
+      .logo {
84
+        width: 85%;
85
+        position: absolute;
86
+      }
87
+      .line3 {
88
+        height: 80%;
89
+        position: absolute;
90
+        right: 0.15rem;
91
+        top: 10%;
92
+      }
93
+      > span {
94
+        color: #fc6243;
95
+        position: absolute;
96
+        top: 50%;
97
+        left: 40%;
98
+        transform: translate(-50%, -50%);
99
+        font-size: 0.14rem;
100
+        display: flex;
101
+        align-items: baseline;
102
+        span {
103
+          color: #fc6243;
104
+          font-size: 0.26rem;
105
+        }
106
+      }
107
+    }
108
+    div:nth-of-type(2) {
109
+      flex: 1;
110
+      h2 {
111
+        font-size: 0.16rem;
112
+      }
113
+      span {
114
+        display: block;
115
+        color: #323645;
116
+        font-size: 12px;
117
+        padding-top: 0.03rem;
118
+      }
119
+    }
120
+  }
121
+  .card-main {
122
+    position: relative;
123
+    img {
124
+      width: 100%;
125
+      position: absolute;
126
+      top: 0;
127
+      left: 0;
128
+    }
129
+    div {
130
+      flex: 1;
131
+      display: flex;
132
+      flex-flow: column nowrap;
133
+      justify-content: center;
134
+      align-items: center;
135
+      padding-top: 0.15rem;
136
+      span:nth-of-type(1) {
137
+        font-size: 0.12rem;
138
+        color: #323645;
139
+      }
140
+      span:nth-of-type(2) {
141
+        font-size: 0.12rem;
142
+        color: #fc6243;
143
+      }
144
+    }
145
+  }
146
+  .card-bottom {
147
+    padding: 0.1rem;
148
+    margin-top: 0.1rem;
149
+    background-color: #fc6243;
150
+    text-align: center;
151
+    color: #fff;
152
+  }
153
+}
154
+</style>

+ 47
- 0
src/components/newsItem/index.vue Visa fil

@@ -0,0 +1,47 @@
1
+<template>
2
+  <div class="newsItem flex-h" @click="jump">
3
+    <div class="img">
4
+      <a><img :src="data.ImageUrl" class="centerLabel cover" alt=""></a>
5
+    </div>
6
+    <div class="flex-item flex-v">
7
+      <div class="flex-item">
8
+        <div>
9
+          <span>{{data.Title}}</span>
10
+        </div>
11
+      </div>
12
+      <span>{{toolClass.dateFormat(data.CreateDate)}}</span>
13
+    </div>
14
+  </div>
15
+</template>
16
+
17
+<script>
18
+
19
+export default {
20
+  name: '',
21
+  props: ['data'],
22
+  data () {
23
+    return {
24
+      
25
+    }
26
+  },
27
+  computed: {
28
+    
29
+  },
30
+  components: {
31
+    
32
+  },
33
+  created () {
34
+    
35
+  },
36
+  methods: {
37
+    jump () {
38
+      this.$emit('jump', this.data)
39
+    }
40
+  }
41
+}
42
+</script>
43
+
44
+<!-- Add "scoped" attribute to limit CSS to this component only -->
45
+<style lang="scss" scoped>
46
+@import "page.scss";
47
+</style>

+ 46
- 0
src/components/newsItem/page.scss Visa fil

@@ -0,0 +1,46 @@
1
+.newsItem{
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  padding: .15rem 0;
6
+  .img{
7
+    width: .86rem;
8
+    position: relative;
9
+    overflow: hidden;
10
+    margin-right: .1rem;
11
+    a{
12
+      width: 100%;
13
+      display: block;
14
+      padding-bottom: 60%;
15
+      background: #eee;
16
+      border-radius: .04rem;
17
+      position: relative;
18
+      overflow: hidden;
19
+    }
20
+  }
21
+  &>div.flex-item{
22
+    div{
23
+      div{
24
+        width: 100%;
25
+        position: relative;
26
+        overflow: hidden;
27
+        span{
28
+          width: 100%;
29
+          line-height: .18rem;
30
+          font-size: .14rem;
31
+          display: block;
32
+          overflow: hidden;
33
+          white-space: nowrap;
34
+          text-overflow: ellipsis;
35
+        }
36
+      }
37
+    }
38
+    &>span{
39
+      width: 100%;
40
+      line-height: .14rem;
41
+      font-size: .1rem;
42
+      display: block;
43
+      color: #b0b0b0;
44
+    }
45
+  }
46
+}

+ 27
- 0
src/components/noMore/noMore.vue Visa fil

@@ -0,0 +1,27 @@
1
+<template>
2
+  <div class="nomore">
3
+    <img :src="bottomImg" alt="">
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+import bottomImg from '../../common/icon/bottomMsg.png'
9
+export default {
10
+  data () {
11
+    return {
12
+      bottomImg
13
+    }
14
+  }
15
+}
16
+</script>
17
+
18
+<style lang="scss" scoped>
19
+.nomore{
20
+  img{
21
+    width: 100%;
22
+    position: absolute;
23
+    top: 40%;
24
+    transform: translateX(-50%);
25
+  }
26
+}
27
+</style>

+ 86
- 0
src/components/orderItem/index.vue Visa fil

@@ -0,0 +1,86 @@
1
+<template>
2
+  <div class="orderItem flex-h">
3
+    <div class="img">
4
+      <a>
5
+        <img src="" class="centerLabel cover" alt="">
6
+      </a>
7
+    </div>
8
+    <div class="content flex-item flex-v">
9
+      <div class="flex-item">
10
+        <div>
11
+          <span>{{data.name}}</span>
12
+        </div>
13
+      </div>
14
+      <div class="flex-h">
15
+        <div class="flex-item">
16
+          <div>
17
+            <span>¥{{data.price}}</span>
18
+          </div>
19
+        </div>
20
+        <i class="iconfont icon-jian" @click="subtract" v-if="!data.spec.length && data.status === 1"></i>
21
+        <input v-if="!data.spec.length && data.status === 1" type="tel" @input="input" v-model="defaultNum">
22
+        <i class="iconfont icon-jia" :class="{'active': defaultNum > 0}" @click="add" v-if="!data.spec.length && data.status === 1"></i>
23
+        <a v-if="data.spec.length && data.status === 1" @click="selectSpec">选规格</a>
24
+        <span v-if="data.status !== 1">已售罄</span>
25
+      </div>
26
+    </div>
27
+  </div>
28
+</template>
29
+
30
+<script>
31
+
32
+export default {
33
+  name: '',
34
+  props: ['data'],
35
+  data () {
36
+    return {
37
+      defaultNum: 0,
38
+    }
39
+  },
40
+  computed: {
41
+
42
+  },
43
+  components: {
44
+
45
+  },
46
+  created () {
47
+
48
+  },
49
+  methods: {
50
+    add () { // 增加
51
+      this.defaultNum += 1
52
+      this.select()
53
+    },
54
+    subtract () { // 减少
55
+      if (this.defaultNum > 0) this.defaultNum -= 1; this.select()
56
+    },
57
+    input () { // 输入
58
+      if (Number(this.defaultNum)) {
59
+        this.select()
60
+      } else {
61
+
62
+      }
63
+    },
64
+    select () { // 返回数据
65
+      this.$emit('returnData', {
66
+        name: this.data.name,
67
+        id: this.data.id,
68
+        specId: null,
69
+        specName: null,
70
+        num: null,
71
+        defaultNum: Number(this.defaultNum),
72
+        price: null,
73
+        defaultPrice: this.data.price,
74
+      })
75
+    },
76
+    selectSpec () { // 选规格
77
+      this.$emit('selectSpec', this.data)
78
+    },
79
+  }
80
+}
81
+</script>
82
+
83
+<!-- Add "scoped" attribute to limit CSS to this component only -->
84
+<style lang="scss" scoped>
85
+@import "page.scss";
86
+</style>

+ 74
- 0
src/components/orderItem/page.scss Visa fil

@@ -0,0 +1,74 @@
1
+.orderItem{
2
+  .img{
3
+    width: .72rem;
4
+    position: relative;
5
+    overflow: hidden;
6
+    margin: 0 .1rem;
7
+    a{
8
+      width: 100%;
9
+      display: block;
10
+      padding-bottom: 100%;
11
+      background: #eee;
12
+      border-radius: .04rem;
13
+      position: relative;
14
+      overflow: hidden;
15
+    }
16
+  }
17
+  &>.flex-item{
18
+    margin-right: .15rem;
19
+    &>div.flex-item{
20
+      &>div{
21
+        width: 100%;
22
+        position: relative;
23
+        overflow: hidden;
24
+        span{
25
+          width: 100%;
26
+          display: block;
27
+          line-height: .22rem;
28
+          font-size: .13rem;
29
+          overflow: hidden;
30
+          white-space: nowrap;
31
+          text-overflow: ellipsis;
32
+        }
33
+      }
34
+    }
35
+    &>div.flex-h{
36
+      &>div{
37
+        &>div{
38
+          span{
39
+            width: 100%;
40
+            line-height: .2rem;
41
+            font-size: .11rem;
42
+          }
43
+        }
44
+      }
45
+      i{
46
+        font-size: .18rem;
47
+        line-height: .2rem;
48
+        color: #ccc;
49
+        &.active{
50
+          color: red;
51
+        }
52
+      }
53
+      input{
54
+        width: .4rem;
55
+        line-height: .18rem;
56
+        text-align: center;
57
+        margin: 0 .05rem;
58
+      }
59
+      a{
60
+        display: inline-block;
61
+        line-height: .2rem;
62
+        font-size: .11rem;
63
+        padding: 0 .15rem;
64
+        border-radius: .2rem;
65
+        background: #fc6243;
66
+        color: #fff;
67
+      }
68
+      &>span{
69
+        font-size: .13rem;
70
+        color: #666;
71
+      }
72
+    }
73
+  }
74
+}

+ 71
- 0
src/components/orderListItem/index.vue Visa fil

@@ -0,0 +1,71 @@
1
+<template>
2
+  <div class="orderListItem">
3
+    <div class="title flex-h">
4
+      <div class="orange" v-if="data.status === 0">
5
+        <i class="iconfont icon-dengdai"></i><br>
6
+        <span>制作中</span>
7
+      </div>
8
+      <div class="grey" v-if="data.status === 1">
9
+        <i class="iconfont icon-quxiao"></i><br>
10
+        <span>已取消</span>
11
+      </div>
12
+      <div class="green" v-if="data.status === 2">
13
+        <i class="iconfont icon-gouxuan"></i><br>
14
+        <span>已完成</span>
15
+      </div>
16
+      <div class="flex-item">
17
+        <div>
18
+          <span>{{data.caseName}}</span>
19
+        </div>
20
+      </div>
21
+      <span>{{data.creatTime}}</span>
22
+    </div>
23
+    <div class="line">
24
+      <div>
25
+        <i v-for="(iconItem,iconIndex) in 40" :key="iconIndex"></i>
26
+      </div>
27
+    </div>
28
+    <div class="list flex-h">
29
+      <div class="flex-item">
30
+        <ul>
31
+          <li v-for="(subItem,subIndex) in data.goodsList" :key="subIndex">
32
+            <span>{{subItem.name}}</span>
33
+            <div>
34
+              <span>¥{{subItem.price === null ? subItem.specPrice : subItem.price}} x {{subItem.num === null ? subItem.specNum : subItem.num}}</span>
35
+            </div>
36
+          </li>
37
+        </ul>
38
+      </div>
39
+    </div>
40
+  </div>
41
+</template>
42
+
43
+<script>
44
+
45
+export default {
46
+  name: '',
47
+  props: ['data'],
48
+  data () {
49
+    return {
50
+
51
+    }
52
+  },
53
+  computed: {
54
+
55
+  },
56
+  components: {
57
+
58
+  },
59
+  created () {
60
+
61
+  },
62
+  methods: {
63
+    
64
+  }
65
+}
66
+</script>
67
+
68
+<!-- Add "scoped" attribute to limit CSS to this component only -->
69
+<style lang="scss" scoped>
70
+@import "page.scss";
71
+</style>

+ 120
- 0
src/components/orderListItem/page.scss Visa fil

@@ -0,0 +1,120 @@
1
+.orderListItem{
2
+  width: 100%;
3
+  position: relative;
4
+  overflow: hidden;
5
+  .title{
6
+    width: 100%;
7
+    position: relative;
8
+    overflow: hidden;
9
+    align-items: center;
10
+    &>div:nth-child(1){
11
+      width: .5rem;
12
+      text-align: center;
13
+      *{
14
+        display: inline-block;
15
+        font-size: .1rem;
16
+        line-height: .17rem;
17
+      }
18
+      i{
19
+        font-size: .15rem;
20
+      }
21
+    }
22
+    &>div:nth-child(1).orange{
23
+      *{
24
+        color: #fc6243;
25
+      }
26
+    }
27
+    &>div:nth-child(1).grey{
28
+      *{
29
+        color: #ccc;
30
+      }
31
+    }
32
+    &>div:nth-child(1).green{
33
+      *{
34
+        color: #63c86f;
35
+      }
36
+    }
37
+    &>div:nth-child(2){
38
+      margin-right: .1rem;
39
+      &>div{
40
+        width: 100%;
41
+        position: relative;
42
+        overflow: hidden;
43
+        span{
44
+          width: 100%;
45
+          display: block;
46
+          font-size: .14rem;
47
+          overflow: hidden;
48
+          text-overflow: ellipsis;
49
+          white-space: nowrap;
50
+        }
51
+      }
52
+    }
53
+    &>span{
54
+      font-size: .11rem;
55
+      color: #666;
56
+      margin-right: .15rem;
57
+    }
58
+  }
59
+  .line{
60
+    width: 100%;
61
+    height: .2rem;
62
+    position: relative;
63
+    overflow: hidden;
64
+    &>div{
65
+      width: 100%;
66
+      position: absolute;
67
+      overflow: hidden;
68
+      left: 0;
69
+      top: 50%;
70
+      transform: translateY(-50%) translateX(-.035rem);
71
+      -webkit-transform: translateY(-50%) translateX(-.035rem);
72
+      font-size: 0;
73
+      white-space: nowrap;
74
+      i{
75
+        display: inline-block;
76
+        width: .07rem;
77
+        height: .07rem;
78
+        position: relative;
79
+        overflow: hidden;
80
+        border-radius: 100%;
81
+        background: #eee;
82
+        margin-right: .1rem;
83
+      }
84
+    }
85
+  }
86
+  .list{
87
+    &>div{
88
+      margin: 0 .15rem;
89
+      &>ul{
90
+        margin: .06rem auto;
91
+        &>li{
92
+          font-size: 0;
93
+          white-space: nowrap;
94
+          &>*{
95
+            display: inline-block;
96
+            vertical-align: middle;
97
+            width: 50%;
98
+            overflow: hidden;
99
+            text-overflow: ellipsis;
100
+            white-space: nowrap;
101
+          }
102
+          &>span{
103
+            line-height: .26rem;
104
+            font-size: .14rem;
105
+            color: #555;
106
+          }
107
+          &>div{
108
+            text-align: right;
109
+            font-size: 0;
110
+            span{
111
+              font-size: .11rem;
112
+              line-height: .26rem;
113
+              color: #666;
114
+            }
115
+          }
116
+        }
117
+      }
118
+    }
119
+  }
120
+}

+ 115
- 0
src/components/orderPopup/index.vue Visa fil

@@ -0,0 +1,115 @@
1
+<template>
2
+  <div class="orderPopup" :class="{'show':show}">
3
+    <div class="centerLabel" v-if="data !== null">
4
+      <div class="top">
5
+        <span>{{data.name}}</span>
6
+        <i class="iconfont icon-guanbi" @click="close"></i>
7
+      </div>
8
+      <div class="content flex-h">
9
+        <div class="flex-item">
10
+          <div>
11
+            <span>规格:</span>
12
+            <ul>
13
+              <li v-for="(item,index) in data.spec" :class="{'active': index === activeIndex, 'grey': item.status !== 1}" :key="index" @click="selectItem(item, index)">{{item.value}}</li>
14
+            </ul>
15
+          </div>
16
+        </div>
17
+      </div>
18
+      <div class="bottom flex-h">
19
+        <div class="flex-item">
20
+          <div>
21
+            <span>¥{{price * num}}</span>
22
+          </div>
23
+        </div>
24
+        <i class="iconfont icon-jian" @click="subtract"></i>
25
+        <input type="tel" v-model="num">
26
+        <i class="iconfont icon-jia" @click="add"></i>
27
+        <a @click="sure">确定</a>
28
+      </div>
29
+      <!-- <a class="sure">确定</a> -->
30
+    </div>
31
+  </div>
32
+</template>
33
+
34
+<script>
35
+
36
+export default {
37
+  name: '',
38
+  props: ['show', 'data'],
39
+  data () {
40
+    return {
41
+      activeIndex: '',
42
+      price: 0,
43
+      num: 1,
44
+      specId: '',
45
+      specName: '',
46
+    }
47
+  },
48
+  computed: {
49
+
50
+  },
51
+  components: {
52
+
53
+  },
54
+  created () {
55
+
56
+  },
57
+  methods: {
58
+    sure () { // 确定
59
+      if (this.activeIndex === '' || this.price === 0 || this.num < 1) {
60
+        return false
61
+      }
62
+      this.$emit('returnData', {
63
+        name: this.data.name,
64
+        id: this.data.id,
65
+        specId: this.specId,
66
+        specName: this.specName,
67
+        num: this.num,
68
+        defaultNum: null,
69
+        price: this.price,
70
+        defaultPrice: null,
71
+      })
72
+      this.close()
73
+    },
74
+    subtract () { // 减
75
+      if (this.num > 1) {
76
+        this.num -= 1
77
+      }
78
+    },
79
+    add () { // 加
80
+      this.num += 1
81
+    },
82
+    selectItem (item, index) { // 选择规格
83
+      if (item.status === 1) {
84
+        if (this.activeIndex === index) {
85
+          this.activeIndex = ''
86
+          this.price = 0
87
+          this.specId = ''
88
+          this.specName = ''
89
+        } else {
90
+          this.activeIndex = index
91
+          this.price = item.price
92
+          this.specId = item.id
93
+          this.specName = item.value
94
+        }
95
+      }
96
+    },
97
+    close () { // 关闭弹窗
98
+      this.$emit('closePopup')
99
+      this.resetData()
100
+    },
101
+    resetData () { // 重置状态
102
+      this.activeIndex = ''
103
+      this.price = 0
104
+      this.num = 1
105
+      this.specName = ''
106
+      this.specId = ''
107
+    },
108
+  }
109
+}
110
+</script>
111
+
112
+<!-- Add "scoped" attribute to limit CSS to this component only -->
113
+<style lang="scss" scoped>
114
+@import "page.scss";
115
+</style>

+ 139
- 0
src/components/orderPopup/page.scss Visa fil

@@ -0,0 +1,139 @@
1
+.orderPopup{
2
+  width: 100%;
3
+  position: absolute;
4
+  left: 0;
5
+  bottom: 0;
6
+  top: 0;
7
+  background: rgba(0, 0, 0, .5);
8
+  z-index: 500;
9
+  display: none;
10
+  &.show{
11
+    display: block;
12
+  }
13
+  &>.centerLabel{
14
+    width: 3.35rem;
15
+    background: #fff;
16
+    border-radius: .08rem;
17
+    overflow: hidden;
18
+    .top{
19
+      width: 100%;
20
+      position: relative;
21
+      overflow: hidden;
22
+      margin: .1rem auto 0;
23
+      span{
24
+        width: 100%;
25
+        display: block;
26
+        line-height: .28rem;
27
+        text-align: center;
28
+        font-size: .17rem;
29
+      }
30
+      i{
31
+        display: inline-block;
32
+        position: absolute;
33
+        top: 50%;
34
+        transform: translateY(-50%);
35
+        -webkit-transform: translateY(-50%);
36
+        right: .1rem;
37
+        font-size: .2rem;
38
+        color: #999;
39
+      }
40
+    }
41
+    .content{
42
+      width: 100%;
43
+      position: relative;
44
+      overflow: hidden;
45
+      &>div{
46
+        margin: 0 .2rem;
47
+        &>div{
48
+          width: 100%;
49
+          position: relative;
50
+          overflow: hidden;
51
+          &>span{
52
+            width: 100%;
53
+            display: block;
54
+            line-height: .26rem;
55
+            font-size: .14rem;
56
+            color: #666;
57
+            margin: .24rem auto 0;
58
+          }
59
+          ul{
60
+            font-size: 0;
61
+            li{
62
+              display: inline-block;
63
+              line-height: .32rem;
64
+              padding: 0 .15rem;
65
+              font-size: .14rem;
66
+              color: #666;
67
+              border: .01rem solid #eee;
68
+              border-radius: .04rem;
69
+              margin: .1rem .1rem 0 0;
70
+              &.active{
71
+                color: #fc6243;
72
+                border-color: #fc6243;
73
+              }
74
+              &.grey{
75
+                color: #ccc;
76
+                border-color: #eee;
77
+                border-style: dashed;
78
+              }
79
+            }
80
+          }
81
+        }
82
+      }
83
+    }
84
+    .bottom{
85
+      background: #f2f2f2;
86
+      margin-top: .3rem;
87
+      align-items: center;
88
+      &>div{
89
+        &>div{
90
+          width: 100%;
91
+          position: relative;
92
+          overflow: hidden;
93
+          span{
94
+            width: 100%;
95
+            display: block;
96
+            text-indent: .2rem;
97
+            line-height: .5rem;
98
+            font-size: .15rem;
99
+            color: #fc6243;
100
+          }
101
+        }
102
+      }
103
+      i{
104
+        font-size: .2rem;
105
+        color: #fc6243;
106
+        margin-left: .1rem;
107
+        &:last-child{
108
+          margin-right: .2rem;
109
+        }
110
+      }
111
+      input{
112
+        width: .3rem;
113
+        background: none;
114
+        line-height: .2rem;
115
+        font-size: .13rem;
116
+        text-align: center;
117
+        margin-left: .1rem;
118
+      }
119
+      a{
120
+        display: inline-block;
121
+        line-height: .5rem;
122
+        background: #fc6243;
123
+        color: #fff;
124
+        font-size: .15rem;
125
+        padding: 0 .3rem;
126
+        margin-left: .3rem;
127
+      }
128
+    }
129
+    .sure{
130
+      width: 100%;
131
+      display: block;
132
+      line-height: .5rem;
133
+      text-align: center;
134
+      background: #fc6243;
135
+      color: #fff;
136
+      font-size: .15rem;
137
+    }
138
+  }
139
+}

+ 65
- 0
src/components/qrCodeCard/qrCodeCard.vue Visa fil

@@ -0,0 +1,65 @@
1
+<template>
2
+  <div class="codeLayout">
3
+    <div id="QRcode"></div>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+import QRCode from 'qrcodejs2'
9
+export default {
10
+  name: 'qrCodeCard',
11
+  props: {
12
+    msg: {
13
+      type: Object,
14
+      default: () => {}
15
+    }
16
+  },
17
+  data () {
18
+    return {
19
+      lessonType: {
20
+        800: '1012-',
21
+        801: '1012-',
22
+        802: '1011-',
23
+        803: '1010-',
24
+        804: '1013-'
25
+      }
26
+    }
27
+  },
28
+  methods: {
29
+    InitCodeRules (info) {
30
+      let codeText
31
+      for (var Key in this.lessonType
32
+      ) {
33
+        if (parseInt(Key) === this.msg.course_type) {
34
+          codeText = this.lessonType[Key] + '-1'
35
+        }
36
+      }
37
+      const ele = document.querySelector('#QRcode')
38
+      this.qrCode = new QRCode(ele, {
39
+        text: codeText,
40
+        width: '100',
41
+        height: '100',
42
+        colorDark: '#000000',
43
+        colorLight: '#ffffff',
44
+        correctLevel: QRCode.CorrectLevel.H
45
+      })
46
+    }
47
+  },
48
+  components: {
49
+    QRCode
50
+  },
51
+  mounted () {
52
+    this.InitCodeRules()
53
+  }
54
+}
55
+</script>
56
+
57
+<style lang="scss" scoped>
58
+.codeLayout{
59
+  display: flex;
60
+  flex-flow: column nowrap;
61
+  justify-content: center;
62
+  align-items: center;
63
+  padding-bottom: .1rem;
64
+}
65
+</style>

+ 324
- 0
src/components/scroll/scroll.vue Visa fil

@@ -0,0 +1,324 @@
1
+<template>
2
+  <div ref="wrapper" class="list-wrapper">
3
+    <div class="scroll-content">
4
+      <div ref="listWrapper">
5
+        <slot></slot>
6
+      </div>
7
+      <slot name="pullup" v-if="isloading" :pullUpLoad="pullUpLoad" :isPullUpLoad="isPullUpLoad">
8
+        <div class="pullup-wrapper" v-if="pullUpLoad">
9
+          <div class="before-trigger" v-if="!isPullUpLoad">
10
+            <span>{{pullUpTxt}}</span>
11
+          </div>
12
+          <div class="after-trigger" v-else>
13
+            <loading></loading>
14
+          </div>
15
+        </div>
16
+      </slot>
17
+    </div>
18
+    <slot name="pulldown" :pullDownRefresh="pullDownRefresh" :pullDownStyle="pullDownStyle" :beforePullDown="beforePullDown" :isPullingDown="isPullingDown" :bubbleY="bubbleY" >
19
+      <div ref="pulldown" class="pulldown-wrapper" :style="pullDownStyle" v-if="pullDownRefresh">
20
+        <div class="before-trigger" v-if="beforePullDown">
21
+          <bubble :y="bubbleY"></bubble>
22
+        </div>
23
+        <div class="after-trigger" v-else>
24
+          <div v-if="isPullingDown" class="loading">
25
+            <loading></loading>
26
+          </div>
27
+          <div v-else>
28
+            <span>{{refreshTxt}}</span>
29
+          </div>
30
+        </div>
31
+      </div>
32
+    </slot>
33
+  </div>
34
+</template>
35
+<script type="text/ecmascript-6">
36
+import BScroll from 'better-scroll'
37
+import Loading from '../loading/loading.vue'
38
+import Bubble from '../bubble/bubble.vue'
39
+import Dom from '../../util/dom'
40
+const COMPONENT_NAME = 'scroll'
41
+const DIRECTION_H = 'horizontal'
42
+const DIRECTION_V = 'vertical'
43
+
44
+export default {
45
+  name: COMPONENT_NAME,
46
+  props: {
47
+    data: {
48
+      type: Array,
49
+      default: function () {
50
+        return []
51
+      }
52
+    },
53
+    probeType: {
54
+      type: Number,
55
+      default: 1
56
+    },
57
+    click: {
58
+      type: Boolean,
59
+      default: true
60
+    },
61
+    listenScroll: {
62
+      type: Boolean,
63
+      default: false
64
+    },
65
+    listenBeforeScroll: {
66
+      type: Boolean,
67
+      default: false
68
+    },
69
+    direction: {
70
+      type: String,
71
+      default: DIRECTION_V
72
+    },
73
+    scrollbar: {
74
+      type: null,
75
+      default: false
76
+    },
77
+    pullDownRefresh: {
78
+      type: null,
79
+      default: false
80
+    },
81
+    pullUpLoad: {
82
+      type: null,
83
+      default: false
84
+    },
85
+    startY: {
86
+      type: Number,
87
+      default: 0
88
+    },
89
+    refreshDelay: {
90
+      type: Number,
91
+      default: 20
92
+    },
93
+    freeScroll: {
94
+      type: Boolean,
95
+      default: false
96
+    },
97
+    mouseWheel: {
98
+      type: Boolean,
99
+      default: false
100
+    },
101
+    bounce: {
102
+      default: false
103
+    },
104
+    isloading: {
105
+      type: Boolean,
106
+      default: false
107
+    }
108
+  },
109
+  data () {
110
+    return {
111
+      beforePullDown: true,
112
+      isRebounding: false,
113
+      isPullingDown: false,
114
+      isPullUpLoad: false,
115
+      pullUpDirty: true,
116
+      pullDownStyle: '',
117
+      bubbleY: 0
118
+    }
119
+  },
120
+  computed: {
121
+    pullUpTxt () {
122
+      const moreTxt = '--- 上拉更多 ---'
123
+
124
+      const noMoreTxt = '--- 我也是有底线的 ---'
125
+
126
+      return this.pullUpDirty ? moreTxt : noMoreTxt
127
+    },
128
+    refreshTxt () {
129
+      return this.pullDownRefresh && (this.pullDownRefresh.txt || '已刷新')
130
+    }
131
+  },
132
+  created () {
133
+    this.pullDownInitTop = -50
134
+  },
135
+  mounted () {
136
+    this.$nextTick(() => {
137
+      this.initScroll()
138
+    })
139
+  },
140
+  methods: {
141
+    initScroll () {
142
+      if (!this.$refs.wrapper) {
143
+        return
144
+      }
145
+      if (this.$refs.listWrapper && (this.pullDownRefresh || this.pullUpLoad)) {
146
+        this.$refs.listWrapper.style.minHeight = `${Dom.getRect(this.$refs.wrapper).height + 1}px`
147
+      }
148
+
149
+      let options = {
150
+        probeType: this.probeType,
151
+        click: this.click,
152
+        scrollY: this.freeScroll || this.direction === DIRECTION_V,
153
+        scrollX: this.freeScroll || this.direction === DIRECTION_H,
154
+        scrollbar: this.scrollbar,
155
+        pullDownRefresh: this.pullDownRefresh,
156
+        pullUpLoad: this.pullUpLoad,
157
+        startY: this.startY,
158
+        freeScroll: this.freeScroll,
159
+        mouseWheel: this.mouseWheel,
160
+        bounce: this.bounce
161
+      }
162
+
163
+      this.scroll = new BScroll(this.$refs.wrapper, options)
164
+
165
+      if (this.listenScroll) {
166
+        this.scroll.on('scroll', (pos) => {
167
+          this.$emit('scroll', pos)
168
+        })
169
+      }
170
+
171
+      if (this.listenBeforeScroll) {
172
+        this.scroll.on('beforeScrollStart', () => {
173
+          this.$emit('beforeScrollStart')
174
+        })
175
+      }
176
+
177
+      if (this.pullDownRefresh) {
178
+        this._initPullDownRefresh()
179
+      }
180
+
181
+      if (this.pullUpLoad) {
182
+        this._initPullUpLoad()
183
+      }
184
+    },
185
+    disable () {
186
+      this.scroll && this.scroll.disable()
187
+    },
188
+    enable () {
189
+      this.scroll && this.scroll.enable()
190
+    },
191
+    refresh () {
192
+      this.scroll && this.scroll.refresh()
193
+    },
194
+    scrollTo () {
195
+      this.scroll && this.scroll.scrollTo.apply(this.scroll, arguments)
196
+    },
197
+    scrollToElement () {
198
+      this.scroll && this.scroll.scrollToElement.apply(this.scroll, arguments)
199
+    },
200
+    clickItem (e, item) {
201
+      this.$emit('click', item)
202
+    },
203
+    destroy () {
204
+      this.scroll.destroy()
205
+    },
206
+    forceUpdate (dirty) {
207
+      if (this.pullDownRefresh && this.isPullingDown) {
208
+        this.isPullingDown = false
209
+        this._reboundPullDown().then(() => {
210
+          this._afterPullDown()
211
+        })
212
+      } else if (this.pullUpLoad && this.isPullUpLoad) {
213
+        this.isPullUpLoad = false
214
+        this.scroll.finishPullUp()
215
+        this.pullUpDirty = dirty
216
+        this.refresh()
217
+      } else {
218
+        this.refresh()
219
+      }
220
+    },
221
+    _initPullDownRefresh () {
222
+      this.scroll.on('pullingDown', () => {
223
+        this.beforePullDown = false
224
+        this.isPullingDown = true
225
+        this.$emit('pullingDown')
226
+      })
227
+
228
+      this.scroll.on('scroll', (pos) => {
229
+        if (!this.pullDownRefresh) {
230
+          return
231
+        }
232
+        if (this.beforePullDown) {
233
+          this.bubbleY = Math.max(0, pos.y + this.pullDownInitTop)
234
+          this.pullDownStyle = `top:${Math.min(pos.y + this.pullDownInitTop, 10)}px`
235
+        } else {
236
+          this.bubbleY = 0
237
+        }
238
+
239
+        if (this.isRebounding) {
240
+          this.pullDownStyle = `top:${10 - (this.pullDownRefresh.stop - pos.y)}px`
241
+        }
242
+      })
243
+    },
244
+    _initPullUpLoad () {
245
+      this.scroll.on('pullingUp', () => {
246
+        this.isPullUpLoad = true
247
+        this.$emit('pullingUp')
248
+      })
249
+    },
250
+    _reboundPullDown () {
251
+      const { stopTime = 600 } = this.pullDownRefresh
252
+      return new Promise((resolve) => {
253
+        setTimeout(() => {
254
+          this.isRebounding = true
255
+          this.scroll.finishPullDown()
256
+          resolve()
257
+        }, stopTime)
258
+      })
259
+    },
260
+    _afterPullDown () {
261
+      setTimeout(() => {
262
+        this.pullDownStyle = `top:${this.pullDownInitTop}px`
263
+        this.beforePullDown = true
264
+        this.isRebounding = false
265
+        this.refresh()
266
+      }, this.scroll.options.bounceTime)
267
+    }
268
+  },
269
+  watch: {
270
+    data () {
271
+      setTimeout(() => {
272
+        this.forceUpdate(true)
273
+      }, this.refreshDelay)
274
+    }
275
+  },
276
+  components: {
277
+    Loading,
278
+    Bubble
279
+  }
280
+}
281
+
282
+</script>
283
+
284
+<style lang="scss" scoped>
285
+.list-wrapper {
286
+  position: relative;
287
+  height: 100%;
288
+  overflow: hidden;
289
+  background: #fff;
290
+}
291
+
292
+.scroll-content {
293
+  position: relative;
294
+  z-index: 1;
295
+}
296
+
297
+.list-content {
298
+  position: relative;
299
+  z-index: 10;
300
+  background: #fff;
301
+}
302
+
303
+.pulldown-wrapper {
304
+  position: absolute;
305
+  width: 100%;
306
+  left: 0;
307
+  display: flex;
308
+  justify-content: center;
309
+  align-items: center;
310
+  transition: all;
311
+}
312
+
313
+.after-trigger {
314
+  margin-top: 10px;
315
+}
316
+
317
+.pullup-wrapper {
318
+  width: 100%;
319
+  display: flex;
320
+  justify-content: center;
321
+  align-items: center;
322
+  padding-bottom: 10px;
323
+}
324
+</style>

+ 42
- 0
src/components/topCaseInfo/index.vue Visa fil

@@ -0,0 +1,42 @@
1
+<template>
2
+  <div class="topCaseInfo flex-h">
3
+    <i class="iconfont icon-dingwei"></i>
4
+      <span>{{data.caseName}}</span>
5
+      <a v-if="data.showSelect" @click="selectCase">请选择</a>
6
+      <div class="flex-item">
7
+        <span>{{data.userName}}您好!</span>
8
+      </div>
9
+  </div>
10
+</template>
11
+
12
+<script>
13
+
14
+export default {
15
+  name: '',
16
+  props: ['data'],
17
+  data () {
18
+    return {
19
+
20
+    }
21
+  },
22
+  computed: {
23
+
24
+  },
25
+  components: {
26
+
27
+  },
28
+  created () {
29
+
30
+  },
31
+  methods: {
32
+    selectCase () { // 选择案场
33
+      this.$emit('selectCase')
34
+    },
35
+  }
36
+}
37
+</script>
38
+
39
+<!-- Add "scoped" attribute to limit CSS to this component only -->
40
+<style lang="scss" scoped>
41
+@import "page.scss";
42
+</style>

+ 31
- 0
src/components/topCaseInfo/page.scss Visa fil

@@ -0,0 +1,31 @@
1
+.topCaseInfo{
2
+  align-items: center;
3
+  background: rgba(0, 0, 0, .3);
4
+  padding: .05rem 0;
5
+  &>*{
6
+    margin-left: .05rem;
7
+    line-height: .2rem;
8
+    font-size: .12rem;
9
+    color: #fff;
10
+  }
11
+  i{
12
+    font-size: .15rem;
13
+  }
14
+  a{
15
+    color: #fb6b2f;
16
+    text-decoration: underline;
17
+    margin-left: .1rem;
18
+  }
19
+  &>*:first-child{
20
+    margin-left: .2rem;
21
+  }
22
+  &>div{
23
+    text-align: right;
24
+    margin-right: .2rem;
25
+    font-size: 0;
26
+    span{
27
+      font-size: .12rem;
28
+      color: #fff;
29
+    }
30
+  }
31
+}

+ 22
- 0
src/pages/sales/App.vue Visa fil

@@ -0,0 +1,22 @@
1
+<template>
2
+  <div id="app">
3
+    <router-view></router-view>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+  import '../../common/css/reset.css'
9
+
10
+  export default {
11
+    name: 'app',
12
+    components: {}
13
+  }
14
+</script>
15
+
16
+<style>
17
+  #app {
18
+    width: 100%;
19
+    height: 100%;
20
+    position: relative;
21
+  }
22
+</style>

+ 23
- 0
src/pages/sales/app.js Visa fil

@@ -0,0 +1,23 @@
1
+import Vue from 'vue'
2
+import App from './App.vue'
3
+import Vant from 'vant'
4
+import 'vant/lib/vant-css/index.css'
5
+import router from './router'
6
+import store from '../../store/index'
7
+import Vuex from 'vuex'
8
+import Ajax from '../../util/ajax'
9
+import api from '../../util/api'
10
+import toolClass from '../../util/util'
11
+
12
+Vue.use(Vant)
13
+Vue.use(Vuex)
14
+Vue.prototype.$api = api
15
+Vue.prototype.$ajax = Ajax
16
+Vue.prototype.toolClass = toolClass
17
+/* eslint-disable no-new */
18
+new Vue({
19
+  el: '#app',
20
+  router,
21
+  store,
22
+  render: h => h(App)
23
+})

+ 169
- 0
src/pages/sales/coffeeIndex/index.vue Visa fil

@@ -0,0 +1,169 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="top">
4
+      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
5
+    </div>
6
+    <nav class="flex-h">
7
+      <a class="flex-item" v-for="(item,index) in cutNavList" :key="index" :class="{'active': navActive === index}" @click="cutNav(index)">{{item.value}}</a>
8
+    </nav>
9
+    <div class="content flex-item">
10
+      <div>
11
+        <ul>
12
+          <li :hidden="navActive !== 0" class="placeOrder">
13
+            <div class="topInfo flex-h">
14
+              <div class="flex-item">
15
+                <div>
16
+                  <span>共计已使用:45杯</span>
17
+                </div>
18
+              </div>
19
+              <div class="flex-item">
20
+                <div>
21
+                  <span>本月已用:0杯</span>
22
+                </div>
23
+              </div>
24
+              <a>点单记录</a>
25
+            </div>
26
+            <div class="areaListParent flex-h">
27
+              <div class="flex-item">
28
+                <div>
29
+                  <ul class="areaList">
30
+                    <li v-for="(item,index) in list" :key="index">
31
+                      <div class="title">
32
+                        <i class="iconfont icon-yinchenglogo"></i>
33
+                        <span>{{item.name}}</span>
34
+                      </div>
35
+                      <ul class="subAreaList flex-h">
36
+                        <li class="flex-item flex-h" v-for="(subItem,subIndex) in item.list" :key="subIndex">
37
+                          <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
38
+                        </li>
39
+                        <li class="flex-item noData" v-if="item.list.length % 2 != 0"></li>
40
+                      </ul>
41
+                    </li>
42
+                  </ul>
43
+                </div>
44
+              </div>
45
+            </div>
46
+          </li>
47
+          <li :hidden="navActive !== 1" class="my-card">
48
+            <div class="list-box">
49
+              <myCard v-for="(item,index) in cardList" :key="index" :data='item' @share='share'></myCard>
50
+            </div>
51
+          </li>
52
+          <li :hidden="navActive !== 2" class="customer-card">
53
+            <div class="list-box">
54
+              <customerCard v-for="(item,index) in cardList" :key="index" :data='item' @share='share'></customerCard>
55
+            </div>
56
+          </li>
57
+        </ul>
58
+      </div>
59
+    </div>
60
+    <div class="selectCase" :hidden="!showSelect"></div>
61
+    <van-picker :hidden="!showSelect"
62
+      show-toolbar
63
+      title="选择案场"
64
+      :columns="caseList"
65
+      @cancel="showSelect = false"
66
+      @confirm="selectCase"
67
+      value-key="value"
68
+    />
69
+  </div>
70
+</template>
71
+
72
+<script>
73
+import caseTableItem from '../../../components/caseTableItem/index'
74
+import topCaseInfo from '../../../components/topCaseInfo/index'
75
+import myCard from '../../../components/myCard/myCard'
76
+import customerCard from '../../../components/customerCard/customerCard'
77
+
78
+export default {
79
+  name: '',
80
+  data () {
81
+    return {
82
+      navActive: 2,
83
+      cutNavList: [{
84
+        value: '城咖啡',
85
+        id: '1',
86
+      }, {
87
+        value: '我的卡券',
88
+        id: '2',
89
+      }, {
90
+        value: '我的客户',
91
+        id: '3',
92
+      }],
93
+      topCaseInfoData: {
94
+        caseName: '',
95
+        caseId: '',
96
+        showSelect: true,
97
+        userName: 'xxx'
98
+      },
99
+      caseInfo: {
100
+        value: '',
101
+        id: ''
102
+      },
103
+      showSelect: false,
104
+      caseList: [{
105
+        value: '案场一',
106
+        id: ''
107
+      }, {
108
+        value: '案场二',
109
+        id: ''
110
+      }, {
111
+        value: '案场三',
112
+        id: ''
113
+      }, {
114
+        value: '案场四',
115
+        id: ''
116
+      }],
117
+      list: [{
118
+        name: '案场名称1',
119
+        list: [{}, {}, {}, {}, {}],
120
+      }, {
121
+        name: '案场名称2',
122
+        list: [{}, {}, {}, {}, {}],
123
+      }],
124
+      cardList: [
125
+        {
126
+          invalid: true
127
+        },
128
+        {
129
+          invalid: false
130
+        },
131
+        {
132
+          invalid: false
133
+        }
134
+      ]
135
+    }
136
+  },
137
+  computed: {
138
+
139
+  },
140
+  components: {
141
+    topCaseInfo,
142
+    caseTableItem,
143
+    myCard,
144
+    customerCard
145
+  },
146
+  created () {
147
+
148
+  },
149
+  methods: {
150
+    cutNav (index) { // 切换nav
151
+      this.navActive = index
152
+    },
153
+    selectCase (val) { // 选择案场
154
+      this.caseInfo = val
155
+      this.topCaseInfoData.caseName = val.value
156
+      this.topCaseInfoData.caseId = val.id
157
+      this.showSelect = false
158
+    },
159
+    share (item) {
160
+      console.log(item)
161
+    }
162
+  }
163
+}
164
+</script>
165
+
166
+<!-- Add "scoped" attribute to limit CSS to this component only -->
167
+<style lang="scss" scoped>
168
+@import "page.scss";
169
+</style>

+ 158
- 0
src/pages/sales/coffeeIndex/page.scss Visa fil

@@ -0,0 +1,158 @@
1
+.mainPage{
2
+  .top{
3
+    position: relative;
4
+    overflow: hidden;
5
+  }
6
+  >nav{
7
+    width: 100%;
8
+    position: relative;
9
+    z-index: 10;
10
+    background: #fff;
11
+    box-shadow: 0 0 .1rem .02rem rgba(0, 0, 0, .1);
12
+    a{
13
+      text-align: center;
14
+      line-height: .4rem;
15
+      font-size: .14rem;
16
+      color: #ccc;
17
+      position: relative;
18
+      &.active{
19
+        color: #333;
20
+        &::after{
21
+          content: '';
22
+          width: 50%;
23
+          height: .02rem;
24
+          background: #fc6243;
25
+          position: absolute;
26
+          bottom: 0;
27
+          left: 50%;
28
+          transform: translateX(-50%);
29
+          -webkit-transform: translateX(-50%);
30
+        }
31
+      }
32
+    }
33
+  }
34
+  .content{
35
+    &>div{
36
+      width: 100%;
37
+      position: absolute;
38
+      left: 0;
39
+      top: 0;
40
+      bottom: 0;
41
+      overflow: hidden;
42
+      &>ul{
43
+        width: 100%;
44
+        height: 100%;
45
+        position: relative;
46
+        overflow: hidden;
47
+        &>li{
48
+          width: 100%;
49
+          height: 100%;
50
+          position: relative;
51
+          overflow-y: scroll;
52
+          -webkit-overflow-scrolling: touch;
53
+          transform: translateZ(0);
54
+          -webkit-transform: translateZ(0);
55
+          &.placeOrder{
56
+            .topInfo{
57
+              align-items: center;
58
+              margin: .1rem auto 0;
59
+              >div{
60
+                >div{
61
+                  width: 100%;
62
+                  position: relative;
63
+                  overflow: hidden;
64
+                  span{
65
+                    width: 100%;
66
+                    display: block;
67
+                    text-indent: .2rem;
68
+                    line-height: .3rem;
69
+                    font-size: .14rem;
70
+                    color: #666;
71
+                  }
72
+                }
73
+              }
74
+              a{
75
+                line-height: .22rem;
76
+                font-size: .12rem;
77
+                color: #fc6243;
78
+                border: .01rem solid #fc6243;
79
+                padding: 0 .15rem;
80
+                border-radius: .05rem;
81
+                margin-right: .2rem;
82
+              }
83
+            }
84
+            .areaListParent{
85
+              position: relative;
86
+              overflow: visible;
87
+              >div{
88
+                margin: 0 .2rem;
89
+                position: relative;
90
+                overflow: visible;
91
+                >div{
92
+                  width: 100%;
93
+                  position: relative;
94
+                  overflow: visible;
95
+                  .areaList{
96
+                    &:last-child{
97
+                      margin-bottom: .2rem;
98
+                    }
99
+                    .title{
100
+                      font-size: 0;
101
+                      white-space: nowrap;
102
+                      margin-top: .22rem;
103
+                      *{
104
+                        line-height: .26rem;
105
+                        font-size: .14rem;
106
+                      }
107
+                      i{
108
+                        color: red;
109
+                        margin-right: .05rem;
110
+                      }
111
+                    }
112
+                    .subAreaList{
113
+                      position: relative;
114
+                      overflow: visible;
115
+                      flex-wrap: wrap;
116
+                      -webkit-flex-wrap: wrap;
117
+                      &>li{
118
+                        position: relative;
119
+                        overflow: hidden;
120
+                        border-radius: .06rem;
121
+                        background: #fff;
122
+                        padding: .15rem 0;
123
+                        box-shadow: 0 0 .1rem .01rem rgba(0, 0, 0, .1);
124
+                        min-width: 40%;
125
+                        margin-top: .2rem;
126
+                        &:nth-child(2n){
127
+                          margin-left: .2rem;
128
+                        }
129
+                        &.noData{
130
+                          box-shadow: none;
131
+                          background: none;
132
+                        }
133
+                      }
134
+                    }
135
+                  }
136
+                }
137
+              }
138
+            }
139
+          }
140
+          &.my-card, &.customer-card{
141
+            .list-box{
142
+              padding: .26rem .2rem;
143
+            }
144
+          }
145
+        }
146
+      }
147
+    }
148
+  }
149
+  .selectCase{
150
+    width: 100%;
151
+    position: absolute;
152
+    left: 0;
153
+    top: 0;
154
+    bottom: 0;
155
+    background: rgba(0, 0, 0, .3);
156
+    z-index: 100;
157
+  }
158
+}

+ 108
- 0
src/pages/sales/login/index.vue Visa fil

@@ -0,0 +1,108 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="mask">
4
+      <img :src="logo" class="logo" alt="">
5
+      <div class="centerLabel" style="width:100%;">
6
+        <div class="box" style="margin:0 auto;">
7
+          <div class="title">登录</div>
8
+
9
+          <div class="mobile">
10
+            <i class="iconfont icon-dianhua"></i>
11
+            <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
12
+          </div>
13
+
14
+          <div class="sms" style="margin-top:.2rem;">
15
+            <i class="iconfont icon-mima"></i>
16
+            <input type="number" maxlength="6" placeholder="验证码" v-model="postData.captcha">
17
+            <div class="sand" v-if="seconds === 60" @click="sandMsg">发送验证码</div>
18
+            <div class="sand" v-else>{{seconds}}后可重发</div>
19
+          </div>
20
+        </div>
21
+        <div class="submit" @click="submit">
22
+          <div>通过验证</div>
23
+        </div>
24
+      </div>
25
+
26
+      <transition name="slide">
27
+        <div class="select" v-if="showCase">
28
+          <van-picker
29
+            show-toolbar
30
+            title="请选择"
31
+            value-key='CaseName'
32
+            :columns="columns"
33
+            @cancel="onCancelC"
34
+            @confirm="onConfirmC"
35
+          />
36
+        </div>
37
+      </transition>
38
+      <transition name="slide">
39
+        <div class="select" v-if="showSales">
40
+          <van-picker
41
+            show-toolbar
42
+            title="请选择"
43
+            value-key='UserName'
44
+            :columns="columnsS"
45
+            @cancel="onCancelS"
46
+            @confirm="onConfirmS"
47
+          />
48
+        </div>
49
+      </transition>
50
+    </div>
51
+  </div>
52
+</template>
53
+
54
+<script>
55
+import logo from '../../../common/icon/logo.png'
56
+import { createNamespacedHelpers } from 'vuex'
57
+const { mapActions: actions } = createNamespacedHelpers('userCenter')
58
+const { mapActions: mapLoginActions } = createNamespacedHelpers('login')
59
+export default {
60
+  data () {
61
+    return {
62
+      logo,
63
+      showCase: false,
64
+      showSales: false,
65
+      seconds: 60,
66
+      postData: {
67
+        phone: '',
68
+        captcha: ''
69
+      }
70
+    }
71
+  },
72
+  methods: {
73
+    ...actions(['getCaptcha']),
74
+    ...mapLoginActions(['submitData']),
75
+    sandMsg () {
76
+      if (!this.postData.phone) {
77
+        this.$toast('请先填写手机号')
78
+        return
79
+      }
80
+      this.getCaptcha(this.postData.phone)
81
+      this.runTime()
82
+    },
83
+    runTime () {
84
+      setTimeout(() => {
85
+        this.seconds--
86
+        if (this.seconds < 60 && this.seconds >= 1) {
87
+          this.runTime()
88
+        } else if (this.seconds < 1) {
89
+          this.seconds = 60
90
+        }
91
+      }, 1000)
92
+    },
93
+    submit () {
94
+      if (!this.postData.captcha) {
95
+        this.$toast('请先获取验证码')
96
+        return
97
+      }
98
+      this.submitData(this.postData).then((res) => {
99
+        this.$toast(res)
100
+      })
101
+    }
102
+  }
103
+}
104
+</script>
105
+
106
+<style lang="scss" scoped>
107
+@import "page.scss";
108
+</style>

+ 130
- 0
src/pages/sales/login/page.scss Visa fil

@@ -0,0 +1,130 @@
1
+.mainPage {
2
+  background: url("../../../common/icon/bg.jpg") no-repeat 0 -0.8rem;
3
+  background-size: 100% calc(100% + 90px);
4
+  position: relative;
5
+  .mask{
6
+    width: 100%;
7
+    height: 100%;
8
+    display: flex;
9
+    justify-content: center;
10
+    align-items: center;
11
+    // background: rgba(0,0,0,0.3);
12
+    position: relative;
13
+    .logo{
14
+      position: absolute;
15
+      top: .5rem;
16
+      left: .3rem;
17
+      width: 1.8rem;
18
+    }
19
+    .select {
20
+      position: absolute;
21
+      bottom: 0;
22
+      left: 0;
23
+      width: 100%;
24
+    }
25
+    .box{
26
+      width: 3.25rem;
27
+      overflow: hidden;
28
+      background:rgba(255,255,255,1);
29
+      border-radius:8px;
30
+      padding: .2rem;
31
+      box-sizing: border-box;
32
+      .title{
33
+        font-size: .16rem;
34
+        font-weight: bold;
35
+        text-align: center;
36
+        padding-bottom: .24rem;
37
+      }
38
+      .mobile,.sms{
39
+        width: 2.85rem;
40
+        height: .5rem;
41
+        background:rgba(255,255,255,1);
42
+        border-radius:8px;
43
+        border:1px solid rgba(168,182,200,0.2);
44
+        display: flex;
45
+        align-items: center;
46
+        position: relative;
47
+        i{
48
+          color: rgba(168,182,200,1);
49
+          padding: .14rem;
50
+          font-size: .18rem;
51
+        }
52
+        input{
53
+          flex: 1;
54
+          height: 100%;
55
+        }
56
+        .sand{
57
+          padding: 0 .1rem;
58
+          height: .24rem;
59
+          border-radius:20px;
60
+          border:1px solid rgba(218,218,218,1);
61
+          color: rgba(218,218,218,1);
62
+          font-size: .12rem;
63
+          text-align: center;
64
+          line-height: .24rem;
65
+          position: absolute;
66
+          right: .1rem;
67
+        }
68
+      }
69
+      .recommend{
70
+        width: 2.85rem;
71
+        height: .4rem;
72
+        padding: .15rem 0;
73
+        display: flex;
74
+        align-items: center;
75
+        justify-content: space-between;
76
+        span{
77
+          color: rgba(168,182,200,1);
78
+        }
79
+        i{
80
+          color: rgba(168,182,200,1);
81
+          padding-left: .14rem;
82
+          font-size: .12rem;
83
+        }
84
+        div{
85
+          height: 100%;
86
+          display: flex;
87
+          flex: 1;
88
+          margin-left: .1rem;
89
+          align-items: center;
90
+          border-radius:8px;
91
+          border:1px solid rgba(168,182,200,0.2);
92
+          padding: .1rem;
93
+          box-sizing: border-box;
94
+          span{
95
+            width: 70%;
96
+            overflow:hidden;
97
+            text-overflow:ellipsis;
98
+            white-space:nowrap;
99
+          }
100
+        }
101
+      }
102
+    }
103
+    
104
+    .submit{
105
+      margin: .24rem auto 0;
106
+      width: 2.85rem;
107
+      height: .48rem;
108
+      border-radius:.04rem;
109
+      background: rgba(255,66,28,1);
110
+      text-align: center;
111
+      line-height: .48rem;
112
+      div{
113
+        font-size: .15rem;
114
+        color: #fff;
115
+      }
116
+    }
117
+  }
118
+}
119
+
120
+.slide-enter-active {
121
+  transition: all .3s ease;
122
+}
123
+.slide-leave-active {
124
+  transition: all .3s ease;
125
+}
126
+.slide-enter, .slide-leave-to
127
+/* .slide-fade-leave-active for below version 2.1.8 */ {
128
+  transform: translateY(2.6rem);
129
+  opacity: 0;
130
+}

+ 308
- 0
src/pages/sales/placeOrder/index.vue Visa fil

@@ -0,0 +1,308 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="flex-item flex-v">
4
+      <div class="banner">
5
+        <img src="" class="centerLabel cover" alt="">
6
+        <div class="bannerInfo flex-h">
7
+          <div class="flex-item">
8
+            <div>
9
+              <span>项目名称:xxxx</span>
10
+            </div>
11
+          </div>
12
+          <span>xxx您好!</span>
13
+        </div>
14
+      </div>
15
+      <div class="tableInfo flex-h">
16
+        <div class="flex-item">
17
+          <div>
18
+            <span>桌号:案场11号桌</span>
19
+            <span>本月已用:150杯</span>
20
+          </div>
21
+        </div>
22
+        <router-link :to="{name: 'coffeeIndex', query: {}}">返回选择桌号</router-link>
23
+      </div>
24
+      <div class="content flex-item flex-h">
25
+        <div class="slideMenus">
26
+          <div>
27
+            <ul>
28
+              <li v-for="(item,index) in menuList" :key="index" :class="{'active': slideMenusActive == index}" @click="cutMenu(index)">
29
+                <span>{{item.value}}</span>
30
+                <span>{{item.eValue}}</span>
31
+              </li>
32
+            </ul>
33
+          </div>
34
+        </div>
35
+        <div class="flex-item">
36
+          <div>
37
+            <swiper :options="swiperOption" ref="mySwiper">
38
+              <swiper-slide class="swiper-slide" v-for="(item,index) in menuList" :key="index">
39
+                <div class="flex-v">
40
+                  <h4>{{item.value + ' ' + item.eValue}}</h4>
41
+                  <div class="flex-item">
42
+                    <div>
43
+                      <swiper :options="subSwiperOption" ref="mySubSwiper">
44
+                        <swiper-slide class="swiper-slide" v-for="(subItem,subIndex) in item.list" :key="subIndex">
45
+                          <orderItem :data="subItem" @returnData="calcMenus" @selectSpec="selectSpec"></orderItem>
46
+                        </swiper-slide>
47
+                      </swiper>
48
+                    </div>
49
+                  </div>
50
+                </div>
51
+              </swiper-slide>
52
+            </swiper>
53
+          </div>
54
+        </div>
55
+      </div>
56
+    </div>
57
+    <div class="flex-h">
58
+      <div class="flex-item">
59
+        <div>
60
+          <span>总计</span>
61
+          <span>{{totalNum}}</span>
62
+          <span>杯</span>
63
+          <span>共</span>
64
+          <span>{{totalPrice}}</span>
65
+          <span>元</span>
66
+          <i class="iconfont" :class="{'icon-jiantou-up': !showCalcMenu,'icon-jiantou-down': showCalcMenu}" @click="showCalcMenu = true"></i>
67
+        </div>
68
+      </div>
69
+      <!-- <router-link :to="{name: 'placeOrderDetail', query: {info: JSON.stringify(settlementList)}}">下单</router-link> -->
70
+      <a @click="showCalcMenu = true">下单</a>
71
+    </div>
72
+    <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
73
+    <calcMenu :show="showCalcMenu" :totalNum="totalCupNum" :data="settlementList" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import orderItem from '../../../components/orderItem/index'
79
+import orderPopup from '../../../components/orderPopup/index'
80
+import calcMenu from '../../../components/calcMenu/index'
81
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
82
+import 'swiper/dist/css/swiper.css'
83
+
84
+export default {
85
+  name: '',
86
+  data () {
87
+    const _self = this
88
+    return {
89
+      totalCupNum: 0, // 共计使用杯数
90
+      showCalcMenu: false, // 显隐已点菜单弹窗
91
+      currentSpec: null, // 当前选择规格
92
+      showPopup: false, // 显隐选规格弹窗
93
+      totalNum: 0, // 总杯数
94
+      totalPrice: 0, // 总价格
95
+      settlementList: [], // 商品选择清单
96
+      slideMenusActive: 0, // 左侧菜单选中索引值
97
+      menuList: [{ // 商品数据
98
+        value: '咖啡',
99
+        eValue: 'Coffee',
100
+        id: '1',
101
+        status: 1,
102
+        list: [{
103
+          img: '',
104
+          name: '商品名称',
105
+          id: '1-1',
106
+          status: 1,
107
+          spec: [{
108
+            value: '去冰',
109
+            id: '1-1-1',
110
+            num: 0,
111
+            status: 0,
112
+            price: '10',
113
+          }, {
114
+            value: '少冰',
115
+            id: '1-1-2',
116
+            num: 0,
117
+            status: 1,
118
+            price: '15',
119
+          }, {
120
+            value: '正常',
121
+            id: '1-1-3',
122
+            num: 0,
123
+            status: 1,
124
+            price: '20',
125
+          }, {
126
+            value: '多冰',
127
+            id: '1-1-4',
128
+            num: 0,
129
+            status: 1,
130
+            price: '25',
131
+          }],
132
+          price: '100',
133
+        }, {
134
+          img: '',
135
+          name: '商品名称',
136
+          id: '1-2',
137
+          spec: [],
138
+          status: 0,
139
+          price: '100',
140
+        }, {
141
+          img: '',
142
+          name: '商品名称',
143
+          id: '1-3',
144
+          spec: [],
145
+          status: 1,
146
+          price: '100',
147
+        }, {
148
+          img: '',
149
+          name: '商品名称',
150
+          id: '1-4',
151
+          spec: [],
152
+          status: 1,
153
+          price: '100',
154
+        }, {
155
+          img: '',
156
+          name: '商品名称',
157
+          id: '1-5',
158
+          spec: [],
159
+          status: 1,
160
+          price: '100',
161
+        }, {
162
+          img: '',
163
+          name: '商品名称',
164
+          id: '1-6',
165
+          spec: [],
166
+          status: 1,
167
+          price: '100',
168
+        }],
169
+      }, {
170
+        value: '咖啡一',
171
+        eValue: 'Coffee',
172
+        id: '2',
173
+        status: 1,
174
+        list: [],
175
+      }, {
176
+        value: '咖啡二',
177
+        eValue: 'Coffee',
178
+        id: '3',
179
+        status: 1,
180
+        list: [],
181
+      }, {
182
+        value: '咖啡三',
183
+        eValue: 'Coffee',
184
+        id: '4',
185
+        status: 1,
186
+        list: [],
187
+      }, {
188
+        value: '咖啡四',
189
+        eValue: 'Coffee',
190
+        id: '5',
191
+        status: 1,
192
+        list: [],
193
+      }],
194
+      swiperOption: {
195
+        observer: true,
196
+        direction: 'vertical',
197
+        on: {
198
+          transitionEnd () {
199
+            _self.slideMenusActive = this.activeIndex
200
+          },
201
+        }
202
+      },
203
+      subSwiperOption: {
204
+        observer: true,
205
+        direction: 'vertical',
206
+        nested: true,
207
+        slidesPerView: 'auto',
208
+        freeMode: true,
209
+        freeModeMomentumVelocityRatio: 2,
210
+      },
211
+    }
212
+  },
213
+  computed: {
214
+    MySwiper () {
215
+      return this.$refs.mySwiper.swiper
216
+    },
217
+    MySubSwiper () {
218
+      return this.$refs.mySubSwiper.swiper
219
+    },
220
+  },
221
+  components: {
222
+    swiper,
223
+    swiperSlide,
224
+    orderItem,
225
+    orderPopup,
226
+    calcMenu,
227
+  },
228
+  created () { },
229
+  methods: {
230
+    placeOrder () { // 下单
231
+      this.$router.push({name: 'orderList', query: {}})
232
+    },
233
+    closeCalcMenu () { // 关闭已选菜单
234
+      this.showCalcMenu = false
235
+    },
236
+    emptyMenus () { // 清空菜单
237
+      this.settlementList = []
238
+    },
239
+    closePopup () { // 关闭规格弹窗
240
+      this.showPopup = false
241
+      this.currentSpec = null
242
+    },
243
+    selectSpec (val) { // 选规格
244
+      this.currentSpec = val
245
+      this.showPopup = true
246
+    },
247
+    cutMenu (index) { // 切换菜单
248
+      this.MySwiper.slideTo(index, 300)
249
+    },
250
+    calcMenus (val) { // 计算清单
251
+      var bool = true, arr = this.settlementList.slice()
252
+      if (val.specId === null) {
253
+        for (var n = 0; n < arr.length; n++) {
254
+          if (arr[n].id === val.id && arr[n].specId === null) {
255
+            bool = false
256
+            arr[n] = val
257
+          }
258
+        }
259
+        if (bool) {
260
+          arr.push(val)
261
+        }
262
+      } else {
263
+        for (var n = 0; n < arr.length; n++) {
264
+          if (arr[n].specId === val.specId) {
265
+            bool = false
266
+            arr[n] = val
267
+          }
268
+        }
269
+        if (bool) {
270
+          arr.push(val)
271
+        }
272
+      }
273
+      for (var n = 0; n < arr.length; n++) {
274
+        if (arr[n].num === 0 || arr[n].defaultNum === 0) {
275
+          arr.splice(n, 1)
276
+        }
277
+      }
278
+      this.settlementList = arr
279
+      // console.log(JSON.stringify(this.settlementList))
280
+      this.calcTotalNum()
281
+    },
282
+    calcTotalNum () { // 计算总数量、价格
283
+      var num = 0, price = 0
284
+      if (!this.settlementList.length) {
285
+        this.totalNum = 0
286
+        this.totalPrice = 0
287
+        return
288
+      }
289
+      for (var n = 0; n < this.settlementList.length; n++) {
290
+        if (this.settlementList[n].specId === null) {
291
+          num += this.settlementList[n].defaultNum
292
+          price += this.settlementList[n].defaultPrice * this.settlementList[n].defaultNum
293
+        } else {
294
+          num += this.settlementList[n].num
295
+          price += this.settlementList[n].price * this.settlementList[n].num
296
+        }
297
+      }
298
+      this.totalNum = num
299
+      this.totalPrice = price
300
+    },
301
+  }
302
+}
303
+</script>
304
+
305
+<!-- Add "scoped" attribute to limit CSS to this component only -->
306
+<style lang="scss" scoped>
307
+@import "page.scss";
308
+</style>

+ 241
- 0
src/pages/sales/placeOrder/page.scss Visa fil

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

+ 34
- 0
src/pages/sales/router.js Visa fil

@@ -0,0 +1,34 @@
1
+import Vue from 'vue'
2
+import Router from 'vue-router'
3
+
4
+import login from './login/index' // 登录
5
+import coffeeIndex from './coffeeIndex/index' // 点单首页
6
+import placeOrder from './placeOrder/index' // 城咖啡-点单
7
+
8
+Vue.use(Router)
9
+
10
+const router = new Router({
11
+  routes: [{
12
+    path: '/login',
13
+    name: 'login',
14
+    component: login,
15
+    children: []
16
+  },{
17
+    path: '/coffeeIndex',
18
+    name: 'coffeeIndex',
19
+    component: coffeeIndex,
20
+    children: []
21
+  },{
22
+    path: '/placeOrder',
23
+    name: 'placeOrder',
24
+    component: placeOrder,
25
+    children: []
26
+  }],
27
+})
28
+
29
+router.beforeEach((to, from, next) => {
30
+  
31
+  next()
32
+})
33
+
34
+export default router

+ 22
- 0
src/pages/user/App.vue Visa fil

@@ -0,0 +1,22 @@
1
+<template>
2
+  <div id="app">
3
+    <router-view></router-view>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+  import '../../common/css/reset.css'
9
+
10
+  export default {
11
+    name: 'app',
12
+    components: {}
13
+  }
14
+</script>
15
+
16
+<style>
17
+  #app {
18
+    width: 100%;
19
+    height: 100%;
20
+    position: relative;
21
+  }
22
+</style>

+ 23
- 0
src/pages/user/app.js Visa fil

@@ -0,0 +1,23 @@
1
+import Vue from 'vue'
2
+import App from './App.vue'
3
+import Vant from 'vant'
4
+import 'vant/lib/vant-css/index.css'
5
+import router from './router'
6
+import store from '../../store/index'
7
+import Vuex from 'vuex'
8
+import Ajax from '../../util/ajax'
9
+import api from '../../util/api'
10
+import toolClass from '../../util/util'
11
+
12
+Vue.use(Vant)
13
+Vue.use(Vuex)
14
+Vue.prototype.$api = api
15
+Vue.prototype.$ajax = Ajax
16
+Vue.prototype.toolClass = toolClass
17
+/* eslint-disable no-new */
18
+new Vue({
19
+  el: '#app',
20
+  router,
21
+  store,
22
+  render: h => h(App)
23
+})

+ 180
- 0
src/pages/user/bindMobile/bindMobile.vue Visa fil

@@ -0,0 +1,180 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="mask">
4
+      <img :src="logo" class="logo" alt="">
5
+      <div class="box">
6
+        <div class="title">绑定</div>
7
+
8
+        <div class="mobile">
9
+          <i class="iconfont icon-dianhua"></i>
10
+          <input type="number" maxlength="11" placeholder="手机号" v-model="postData.phone">
11
+        </div>
12
+
13
+        <div class="recommend">
14
+          <span>推荐人</span>
15
+          <div @click="selectCase">
16
+            <span>{{caseName}}</span>
17
+            <i class="iconfont icon-triangle-bottom"></i>
18
+          </div>
19
+          <div @click="selectSales">
20
+            <span>{{salesName}}</span>
21
+            <i class="iconfont icon-triangle-bottom"></i>
22
+          </div>
23
+        </div>
24
+
25
+        <div class="sms">
26
+          <i class="iconfont icon-mima"></i>
27
+          <input type="number" maxlength="6" placeholder="验证码" v-model="postData.captcha">
28
+          <div class="sand" v-if="seconds === 60" @click="sandMsg">发送验证码</div>
29
+          <div class="sand" v-else>{{seconds}}后可重发</div>
30
+        </div>
31
+
32
+        <div class="submit" @click="submit">
33
+          <div>提交</div>
34
+        </div>
35
+      </div>
36
+      <transition name="slide">
37
+        <div class="select" v-if="showCase">
38
+          <van-picker
39
+            show-toolbar
40
+            title="请选择"
41
+            value-key='CaseName'
42
+            :columns="columns"
43
+            @cancel="onCancelC"
44
+            @confirm="onConfirmC"
45
+          />
46
+        </div>
47
+      </transition>
48
+      <transition name="slide">
49
+        <div class="select" v-if="showSales">
50
+          <van-picker
51
+            show-toolbar
52
+            title="请选择"
53
+            value-key='UserName'
54
+            :columns="columnsS"
55
+            @cancel="onCancelS"
56
+            @confirm="onConfirmS"
57
+          />
58
+        </div>
59
+      </transition>
60
+    </div>
61
+  </div>
62
+</template>
63
+
64
+<script>
65
+import logo from '../../../common/icon/logo.png'
66
+import { mapState, createNamespacedHelpers } from 'vuex'
67
+const { mapActions: actions } = createNamespacedHelpers('userCenter')
68
+export default {
69
+  data () {
70
+    return {
71
+      logo,
72
+      showCase: false,
73
+      showSales: false,
74
+      columns: [],
75
+      columnsS: [],
76
+      caseName: '选择案场',
77
+      salesName: '选择销售',
78
+      seconds: 60,
79
+      postData: {
80
+        phone: '',
81
+        case: '',
82
+        sales: '',
83
+        captcha: ''
84
+      }
85
+    }
86
+  },
87
+  computed: {
88
+    ...mapState({
89
+      caseInfo: x => x.userCenter.caseInfo
90
+    })
91
+  },
92
+  created () {
93
+    this.getCaseInfo(1).then(() => {
94
+      this.columns = this.caseInfo.cases
95
+    })
96
+  },
97
+  methods: {
98
+    ...actions(['getCaseInfo']),
99
+    ...actions(['getCaptcha']),
100
+    ...actions(['submitData']),
101
+    onConfirmC (value, index) {
102
+      this.caseName = value.CaseName
103
+      this.postData.case = value.CaseId
104
+      this.columnsS = []
105
+      this.salesName = '选择销售'
106
+      if (this.caseInfo.sales) {
107
+        for (let i = 0; i < this.caseInfo.sales.length; i++) {
108
+          if (this.caseInfo.sales[i].CaseId === this.postData.case) {
109
+            this.columnsS.push(this.caseInfo.sales[i])
110
+          }
111
+        }
112
+      }
113
+      this.showCase = false
114
+    },
115
+    onCancelC () {
116
+      this.showCase = false
117
+    },
118
+    onConfirmS (value, index) {
119
+      this.salesName = value.UserName
120
+      this.postData.sales = value.UserId
121
+      this.showSales = false
122
+    },
123
+    onCancelS () {
124
+      this.showSales = false
125
+    },
126
+    selectCase () {
127
+      this.showCase = true
128
+    },
129
+    selectSales () {
130
+      if (!this.postData.case) {
131
+        this.$toast('请先选择案场')
132
+        return
133
+      } else if (this.columnsS.length <= 0) {
134
+        this.$toast('此案场无销售')
135
+        return
136
+      }
137
+      this.showSales = true
138
+    },
139
+    sandMsg () {
140
+      if (!this.postData.phone) {
141
+        this.$toast('请先填写手机号')
142
+        return
143
+      }
144
+      this.getCaptcha(this.postData.phone)
145
+      this.runTime()
146
+    },
147
+    runTime () {
148
+      setTimeout(() => {
149
+        this.seconds--
150
+        if (this.seconds < 60 && this.seconds >= 1) {
151
+          this.runTime()
152
+        } else if (this.seconds < 1) {
153
+          this.seconds = 60
154
+        }
155
+      }, 1000)
156
+    },
157
+    submit () {
158
+      if (!this.postData.captcha) {
159
+        this.$toast('请先获取验证码')
160
+        return
161
+      }
162
+      if (!this.postData.case) {
163
+        this.$toast('请选择案场')
164
+        return
165
+      }
166
+      if (!this.postData.sales) {
167
+        this.$toast('请选择销售')
168
+        return
169
+      }
170
+      this.submitData(this.postData).then((res) => {
171
+        this.$toast(res)
172
+      })
173
+    }
174
+  }
175
+}
176
+</script>
177
+
178
+<style lang="scss" scoped>
179
+@import "page.scss";
180
+</style>

+ 129
- 0
src/pages/user/bindMobile/page.scss Visa fil

@@ -0,0 +1,129 @@
1
+.mainPage {
2
+  background: url("../../../common/icon/bg.jpg") no-repeat 0 -0.8rem;
3
+  background-size: 100% calc(100% + 90px);
4
+  position: relative;
5
+  .mask{
6
+    width: 100%;
7
+    height: 100%;
8
+    display: flex;
9
+    justify-content: center;
10
+    align-items: center;
11
+    // background: rgba(0,0,0,0.3);
12
+    position: relative;
13
+    .logo{
14
+      position: absolute;
15
+      top: .5rem;
16
+      left: .3rem;
17
+      width: 1.8rem;
18
+    }
19
+    .select {
20
+      position: absolute;
21
+      bottom: 0;
22
+      left: 0;
23
+      width: 100%;
24
+    }
25
+    .box{
26
+      width: 3.25rem;
27
+      height: 3.34rem;
28
+      background:rgba(255,255,255,1);
29
+      border-radius:8px;
30
+      padding: .2rem;
31
+      box-sizing: border-box;
32
+      .title{
33
+        font-size: .16rem;
34
+        font-weight: bold;
35
+        text-align: center;
36
+        padding-bottom: .24rem;
37
+      }
38
+      .mobile,.sms{
39
+        width: 2.85rem;
40
+        height: .5rem;
41
+        background:rgba(255,255,255,1);
42
+        border-radius:8px;
43
+        border:1px solid rgba(168,182,200,0.2);
44
+        display: flex;
45
+        align-items: center;
46
+        position: relative;
47
+        i{
48
+          color: rgba(168,182,200,1);
49
+          padding: .14rem;
50
+          font-size: .18rem;
51
+        }
52
+        input{
53
+          flex: 1;
54
+          height: 100%;
55
+        }
56
+        .sand{
57
+          padding: 0 .1rem;
58
+          height: .24rem;
59
+          border-radius:20px;
60
+          border:1px solid rgba(218,218,218,1);
61
+          color: rgba(218,218,218,1);
62
+          font-size: .12rem;
63
+          text-align: center;
64
+          line-height: .24rem;
65
+          position: absolute;
66
+          right: .1rem;
67
+        }
68
+      }
69
+      .recommend{
70
+        width: 2.85rem;
71
+        height: .4rem;
72
+        padding: .15rem 0;
73
+        display: flex;
74
+        align-items: center;
75
+        justify-content: space-between;
76
+        span{
77
+          color: rgba(168,182,200,1);
78
+        }
79
+        i{
80
+          color: rgba(168,182,200,1);
81
+          padding-left: .14rem;
82
+          font-size: .12rem;
83
+        }
84
+        div{
85
+          height: 100%;
86
+          display: flex;
87
+          flex: 1;
88
+          margin-left: .1rem;
89
+          align-items: center;
90
+          border-radius:8px;
91
+          border:1px solid rgba(168,182,200,0.2);
92
+          padding: .1rem;
93
+          box-sizing: border-box;
94
+          span{
95
+            width: 70%;
96
+            overflow:hidden;
97
+            text-overflow:ellipsis;
98
+            white-space:nowrap;
99
+          }
100
+        }
101
+      }
102
+      .submit{
103
+        margin-top: .24rem;
104
+        width: 2.85rem;
105
+        height: .48rem;
106
+        border-radius:25px;
107
+        border:1px solid rgba(255,66,28,1);
108
+        text-align: center;
109
+        line-height: .48rem;
110
+        div{
111
+          font-size: .15rem;
112
+          color: rgba(255,66,28,1);
113
+        }
114
+      }
115
+    }
116
+  }
117
+}
118
+
119
+.slide-enter-active {
120
+  transition: all .3s ease;
121
+}
122
+.slide-leave-active {
123
+  transition: all .3s ease;
124
+}
125
+.slide-enter, .slide-leave-to
126
+/* .slide-fade-leave-active for below version 2.1.8 */ {
127
+  transform: translateY(2.6rem);
128
+  opacity: 0;
129
+}

+ 176
- 0
src/pages/user/card/index.vue Visa fil

@@ -0,0 +1,176 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <nav class="flex-h">
4
+      <a class="flex-item" v-for="(item,index) in nav" :key="index" :class="{'active':index==active}" @click="change(item,index)">{{item}}</a>
5
+    </nav>
6
+    <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='data[active].list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
7
+      <div class="box">
8
+        <div v-if="active == 0">
9
+          <discounts v-for="(item,index) in data[0].list" :key='index' @toUse='toUse' :data='item' @toDetail="toCouponsDetail(item)"></discounts>
10
+          <noMore v-if="data[active].hasPic"></noMore>
11
+        </div>
12
+        <div v-if="active == 1">
13
+          <div class="fitness-card" v-for="(item,index) in data[1].list" :key='index'>
14
+            <div :class="{'opacity' : item.useType == '已失效' || item.useType == '已使用', 'gray': item.useType == '已使用'}" @click="toCardDetail(item)">
15
+              <div class="card-top">
16
+                <div class="top-left">
17
+                  <img :src="logo" alt="">
18
+                  <div class="price">
19
+                    <span>¥</span>
20
+                    <h1>{{item.price}}</h1>
21
+                    <span>元</span>
22
+                  </div>
23
+                </div>
24
+                <div class="top-right">
25
+                  <img :src="Line3" alt="">
26
+                  <div>{{item.title}}</div>
27
+                  <div>{{item.desc}}</div>
28
+                </div>
29
+              </div>
30
+              <div class="card-bottom">
31
+                <img :src="line" alt="">
32
+                <div class="time">有效期:{{item.time}}</div>
33
+                <div class="status" :class="{'gray-location' : item.useType == '已使用'}">
34
+                  <span>{{item.tag}}</span>
35
+                </div>
36
+              </div>
37
+            </div>
38
+            <div class="useType">
39
+              <img :src="used" alt="已使用" v-if="item.useType == '已使用'" width="100%" height="100%">
40
+              <img :src="failure" alt="已失效" v-if="item.useType == '已失效'" width="100%" height="100%">
41
+            </div>
42
+          </div>
43
+          <noMore v-if="data[active].hasPic"></noMore>
44
+        </div>
45
+      </div>
46
+    </scroll>
47
+  </div>
48
+</template>
49
+
50
+<script>
51
+import line from '../../../common/icon/cicyle.png'
52
+import logo from '../../../common/icon/logo-t.png'
53
+import Line3 from '../../../common/icon/Line3.png'
54
+import used from '../../../common/icon/already.png'
55
+import failure from '../../../common/icon/inv.png'
56
+// 上拉加载组件
57
+import scroll from '../../../components/scroll/scroll'
58
+import noMore from '../../../components/noMore/noMore'
59
+import discounts from '../../../components/discounts/discounts'
60
+export default {
61
+  data () {
62
+    return {
63
+      nav: ['课程体验卡', '健身卡'],
64
+      active: 0,
65
+      logo,
66
+      Line3,
67
+      used,
68
+      failure,
69
+      pullUpLoad: true,
70
+      pullUpLoadThreshold: 40,
71
+      startY: 0,
72
+      isloading: true,
73
+      hasMore: true,
74
+      data: [
75
+        {
76
+          hasPic: false,
77
+          hasMore: true,
78
+          list: [
79
+            {
80
+              title: '小小外交官体验卡',
81
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
82
+              time: '2018年02月17日',
83
+              useType: '未使用',
84
+              tag: '共享'
85
+            },
86
+            {
87
+              title: '小小外交官体验卡',
88
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
89
+              time: '2018年02月17日',
90
+              useType: '已使用',
91
+              tag: '商品'
92
+            },
93
+            {
94
+              title: '小小外交官体验卡',
95
+              desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
96
+              time: '2018年02月17日',
97
+              useType: '已失效',
98
+              tag: '商品'
99
+            }
100
+          ]
101
+        },
102
+        {
103
+          hasPic: false,
104
+          hasMore: true,
105
+          list: [
106
+            {
107
+              title: '会所健身体验卡',
108
+              desc: '适用于游泳',
109
+              time: '2018年02月17日-2018年3月17日',
110
+              price: '120',
111
+              useType: '未使用',
112
+              tag: '年卡'
113
+            },
114
+            {
115
+              title: '会所健身体验卡',
116
+              desc: '适用于游泳',
117
+              time: '2018年02月17日-2018年3月17日',
118
+              price: '120',
119
+              useType: '已使用',
120
+              tag: '季卡'
121
+            },
122
+            {
123
+              title: '会所健身体验卡',
124
+              desc: '适用于游泳',
125
+              time: '2018年02月17日-2018年3月17日',
126
+              price: '120',
127
+              useType: '已失效',
128
+              tag: '次卡'
129
+            }
130
+          ]
131
+        }
132
+      ],
133
+      line
134
+    }
135
+  },
136
+  components: {
137
+    scroll,
138
+    noMore,
139
+    discounts
140
+  },
141
+  computed: {
142
+    pullUpLoadObj: function () {
143
+      return this.pullUpLoad
144
+        ? {
145
+          threshold: parseInt(this.pullUpLoadThreshold),
146
+          txt: {
147
+            more: this.pullUpLoadMoreTxt,
148
+            noMore: this.pullUpLoadNoMoreTxt
149
+          }
150
+        }
151
+        : false
152
+    }
153
+  },
154
+  methods: {
155
+    change (item, index) {
156
+      this.active = index
157
+    },
158
+    toUse (item) {
159
+      console.log(item)
160
+    },
161
+    getList () {
162
+      console.log(111)
163
+    },
164
+    toCardDetail (item) {
165
+      this.$router.push({ name: 'cardDetail' })
166
+    },
167
+    toCouponsDetail () {
168
+      this.$router.push({ name: 'couponsDetail' })
169
+    }
170
+  }
171
+}
172
+</script>
173
+
174
+<style lang="scss" scoped>
175
+@import "page.scss";
176
+</style>

+ 163
- 0
src/pages/user/card/page.scss Visa fil

@@ -0,0 +1,163 @@
1
+.mainPage{
2
+  background: #fff;
3
+  nav{
4
+    white-space: nowrap;
5
+    overflow-x: scroll;
6
+    -webkit-overflow-scrolling: touch;
7
+    font-size: 0;
8
+    padding: .09rem 0;
9
+    background: #fff;
10
+    z-index: 100;
11
+    position: relative;
12
+    a{
13
+      line-height: .32rem;
14
+      text-align: center;
15
+      position: relative;
16
+      &.active::after{
17
+        content: '';
18
+        width: 20%;
19
+        height: .02rem;
20
+        display: block;
21
+        position: absolute;
22
+        left: 50%;
23
+        bottom: 0;
24
+        transform: translateX(-50%);
25
+        -webkit-transform: translateX(-50%);
26
+        background: #fc6243;
27
+      }
28
+    }
29
+  }
30
+  .box{
31
+    padding: .25rem;
32
+    box-sizing: border-box;
33
+    .fitness-card{
34
+      overflow: hidden;
35
+      background: rgba(255,255,255,1);
36
+      box-shadow: 0px 2px .1rem 0px rgba(193,204,217,0.5);
37
+      border-radius: 8px;
38
+      margin-bottom: .2rem;
39
+      position: relative;
40
+      .opacity {
41
+        opacity: .5;
42
+      }
43
+      .gray {
44
+        filter: grayscale(100%);
45
+      }
46
+      .card-top{
47
+        display: flex;
48
+        .top-left{
49
+          padding: .09rem;
50
+          position: relative;
51
+          box-sizing: border-box;
52
+          img{
53
+            width: 1.15rem;
54
+            position: absolute;
55
+            top: .09rem;
56
+            left: .09rem;
57
+          }
58
+          .price{
59
+            display: flex;
60
+            width: 1.1rem;
61
+            height: 1.1rem;
62
+            justify-content: center;
63
+            align-items: baseline;
64
+            line-height: 1.1rem;
65
+            span{
66
+              font-size: .14rem;
67
+              color: #FC6243;
68
+            }
69
+            h1{
70
+              font-size: .36rem;
71
+              color: #FC6243;
72
+            }
73
+          }
74
+        }
75
+        .top-right {
76
+          position: relative;
77
+          flex: 1;
78
+          box-sizing: border-box;
79
+          padding: .21rem .14rem;
80
+          img{
81
+            position: absolute;
82
+            left: 0;
83
+            top: 50%;
84
+            height: 60%;
85
+            transform: translateY(-50%);
86
+          }
87
+          div:nth-of-type(1){
88
+            font-size: .18rem;
89
+            font-weight: 600;
90
+            color: rgba(50,54,69,1);
91
+            padding-bottom: .16rem;
92
+          }
93
+          div:nth-of-type(2){
94
+            font-size: .12rem;
95
+            color: rgba(50,54,69,1);
96
+          }
97
+        }
98
+      }
99
+      .card-bottom{
100
+        position: relative;
101
+        padding: .06rem .2rem .12rem;
102
+        box-sizing: border-box;
103
+        img{
104
+          width: 100%;
105
+          height: .07rem;
106
+          position: absolute;
107
+          top: -0.15rem;
108
+          left: 0rem;
109
+        }
110
+        .time {
111
+          font-size: .12rem;
112
+          color: rgba(50,54,69,1);
113
+          overflow: hidden;
114
+        }
115
+        .status{
116
+          position: absolute;
117
+          background:linear-gradient(45deg,rgba(255,105,0,1) 0%,rgba(255,136,0,0.76) 100%);
118
+          opacity:0.85;
119
+          width: .6rem;
120
+          height: .6rem;
121
+          transform: rotate(45deg);
122
+          bottom: -0.3rem;
123
+          right: -0.3rem;
124
+          &.gray-location{
125
+            background: rgba(189,189,189,1);
126
+          }
127
+          span{
128
+            position: absolute;
129
+            top: .22rem;
130
+            left: -0.03rem;
131
+            font-size: .12rem;
132
+            color: #fff;
133
+            transform: rotate(-90deg);
134
+          }
135
+        }
136
+      }
137
+      .useType{
138
+        position: absolute;
139
+        bottom: .25rem;
140
+        right: .25rem;
141
+        width: .76rem;
142
+        height: .76rem;
143
+      }
144
+    }
145
+  }
146
+}
147
+
148
+@media screen and (max-width: 320px) {
149
+  .mainPage{
150
+    .box{
151
+      .fitness-card{
152
+        .card-bottom{
153
+          .status{
154
+            span{
155
+              top: .2rem !important;
156
+              left: -0.05rem !important;
157
+            }
158
+          }
159
+        }
160
+      }
161
+    }
162
+  }
163
+}

+ 57
- 0
src/pages/user/cardDetail/index.vue Visa fil

@@ -0,0 +1,57 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="title">体验卡详情</div>
4
+    <div class="content">
5
+      <div class="message">
6
+        <div>
7
+          <span>会所健身体验卡</span>
8
+          <span class="sub">(可在银城会所健身房和游泳池使用)</span>
9
+        </div>
10
+        <div>
11
+          <span>有效时间</span>
12
+          <span>{{time}}</span>
13
+        </div>
14
+      </div>
15
+      <div class="rule">
16
+        <div>使用规则</div>
17
+        <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
18
+        <div>2. 此卡不可多人使用,一人记一次。 </div>
19
+        <div>3. 非会员可凭此卡享受对应课程。 </div>
20
+        <div>4. 截止日期至{{time}}。 </div>
21
+      </div>
22
+      <div class="line">
23
+        <img :src="Artboard" alt="" width="100%">
24
+      </div>
25
+      <div class="qr-code" style="margin-top:.1rem;">
26
+        <div class="number">核销编码: 3423487682734</div>
27
+        <qrCode :msg='msg'></qrCode>
28
+      </div>
29
+    </div>
30
+  </div>
31
+</template>
32
+
33
+<script>
34
+import qrCode from '../../../components/qrCodeCard/qrCodeCard'
35
+import Artboard from '../../../common/icon/Artboard.png'
36
+export default {
37
+  data () {
38
+    return {
39
+      msg: {
40
+        course_type: 800
41
+      },
42
+      Artboard,
43
+      time: '2018年3月17日'
44
+    }
45
+  },
46
+  methods: {
47
+
48
+  },
49
+  components: {
50
+    qrCode
51
+  }
52
+}
53
+</script>
54
+
55
+<style lang="scss" scoped>
56
+@import "page.scss";
57
+</style>

+ 60
- 0
src/pages/user/cardDetail/page.scss Visa fil

@@ -0,0 +1,60 @@
1
+.mainPage{
2
+  padding: .3rem .16rem .45rem;
3
+  box-sizing: border-box;
4
+  .title{
5
+    font-size: .18rem;
6
+    font-weight: bold;
7
+    padding-bottom: .14rem;
8
+    padding-left: .2rem;
9
+  }
10
+  .content{
11
+    background:#fff;
12
+    box-shadow:0px .08rem .37rem 0px rgba(202,202,202,0.42);
13
+    border-radius:.1rem;
14
+    padding: .12rem 0;
15
+    .message{
16
+      padding: 0 .22rem;
17
+      div{
18
+        margin-bottom: .2rem;
19
+        display: flex;
20
+        justify-content: space-between;
21
+        align-items: center;
22
+        span:nth-of-type(1){
23
+          font-size: .14rem;
24
+        }
25
+        span:nth-last-of-type(1){
26
+          text-align: right;
27
+        }
28
+        .sub{
29
+          color: #FA2A00;
30
+          font-size: .12rem;
31
+        }
32
+      }
33
+    }
34
+    .rule{
35
+      padding: 0 .22rem;
36
+      div:nth-of-type(1){
37
+        margin-bottom: .2rem;
38
+        font-size: .14rem;
39
+        color: #000;
40
+      }
41
+      div{
42
+        font-size: .12rem;
43
+        color: rgba(174,174,174,1);
44
+        margin-bottom: .1rem;
45
+      }
46
+    }
47
+  }
48
+  .number{
49
+    text-align: center;
50
+    color:rgba(143,143,143,1);
51
+    margin-bottom: .2rem;
52
+  }
53
+  .useType{
54
+    position: absolute;
55
+    bottom: 1.6rem;
56
+    right: .8rem;
57
+    width: .76rem;
58
+    height: .76rem;
59
+  }
60
+}

+ 97
- 0
src/pages/user/coupons/index.vue Visa fil

@@ -0,0 +1,97 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
4
+      <div class="box">
5
+        <discounts v-for="(item,index) in list" :key='index' @toUse='toUse' :data='item'></discounts>
6
+        <noMore v-if="hasPic"></noMore>
7
+      </div>
8
+    </scroll>
9
+  </div>
10
+</template>
11
+
12
+<script>
13
+import line from '../../../common/icon/cicyle.png'
14
+import logo from '../../../common/icon/logo-t.png'
15
+import Line3 from '../../../common/icon/Line3.png'
16
+import used from '../../../common/icon/already.png'
17
+import failure from '../../../common/icon/inv.png'
18
+// 上拉加载组件
19
+import scroll from '../../../components/scroll/scroll'
20
+import noMore from '../../../components/noMore/noMore'
21
+import discounts from '../../../components/discounts/discounts'
22
+export default {
23
+  data () {
24
+    return {
25
+      nav: ['课程体验卡', '健身卡'],
26
+      active: 0,
27
+      logo,
28
+      Line3,
29
+      used,
30
+      failure,
31
+      pullUpLoad: true,
32
+      pullUpLoadThreshold: 40,
33
+      startY: 0,
34
+      isloading: true,
35
+      hasPic: false,
36
+      hasMore: true,
37
+      list: [
38
+        {
39
+          title: '小小外交官体验卡',
40
+          desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
41
+          time: '2018年02月17日',
42
+          useType: '未使用',
43
+          tag: '共享'
44
+        },
45
+        {
46
+          title: '小小外交官体验卡',
47
+          desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
48
+          time: '2018年02月17日',
49
+          useType: '已使用',
50
+          tag: '商品'
51
+        },
52
+        {
53
+          title: '小小外交官体验卡',
54
+          desc: '凭此体验券可让一位小朋友体验一次 适用于小小外交官课程',
55
+          time: '2018年02月17日',
56
+          useType: '已失效',
57
+          tag: '商品'
58
+        }
59
+      ],
60
+      line
61
+    }
62
+  },
63
+  components: {
64
+    scroll,
65
+    noMore,
66
+    discounts
67
+  },
68
+  computed: {
69
+    pullUpLoadObj: function () {
70
+      return this.pullUpLoad
71
+        ? {
72
+          threshold: parseInt(this.pullUpLoadThreshold),
73
+          txt: {
74
+            more: this.pullUpLoadMoreTxt,
75
+            noMore: this.pullUpLoadNoMoreTxt
76
+          }
77
+        }
78
+        : false
79
+    }
80
+  },
81
+  methods: {
82
+    change (item, index) {
83
+      this.active = index
84
+    },
85
+    toUse (item) {
86
+      console.log(item)
87
+    },
88
+    getList () {
89
+      console.log(111)
90
+    }
91
+  }
92
+}
93
+</script>
94
+
95
+<style lang="scss" scoped>
96
+@import "page.scss";
97
+</style>

+ 7
- 0
src/pages/user/coupons/page.scss Visa fil

@@ -0,0 +1,7 @@
1
+.mainPage{
2
+  background: #fff;
3
+  .box{
4
+    padding: .25rem;
5
+    box-sizing: border-box;
6
+  }
7
+}

+ 56
- 0
src/pages/user/couponsDetail/index.vue Visa fil

@@ -0,0 +1,56 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="title">体验券详情</div>
4
+    <div class="content">
5
+      <div class="message">
6
+        <div>
7
+          <span>体验券名称:小小外交官体验券</span>
8
+        </div>
9
+        <div>
10
+          <span>有效时间:</span>
11
+          <div class="time">{{time}}</div>
12
+        </div>
13
+      </div>
14
+      <div class="rule">
15
+        <div>使用规则</div>
16
+        <div>1. 此卡不可兑换现金,不可与其他优惠活动同时使用。 </div>
17
+        <div>2. 此卡不可多人使用,一人记一次。 </div>
18
+        <div>3. 非会员可凭此卡享受对应课程。 </div>
19
+        <div>4. 截止日期至{{time}}。 </div>
20
+      </div>
21
+      <div class="line">
22
+        <img :src="Artboard" alt="" width="100%">
23
+      </div>
24
+      <div class="qr-code" style="margin-top:.1rem;">
25
+        <div class="number">核销编码: 3423487682734</div>
26
+        <qrCode :msg='msg'></qrCode>
27
+      </div>
28
+    </div>
29
+  </div>
30
+</template>
31
+
32
+<script>
33
+import qrCode from '../../../components/qrCodeCard/qrCodeCard'
34
+import Artboard from '../../../common/icon/Artboard.png'
35
+export default {
36
+  data () {
37
+    return {
38
+      msg: {
39
+        course_type: 800
40
+      },
41
+      Artboard,
42
+      time: '2018年3月17日'
43
+    }
44
+  },
45
+  methods: {
46
+
47
+  },
48
+  components: {
49
+    qrCode
50
+  }
51
+}
52
+</script>
53
+
54
+<style lang="scss" scoped>
55
+@import "page.scss";
56
+</style>

+ 58
- 0
src/pages/user/couponsDetail/page.scss Visa fil

@@ -0,0 +1,58 @@
1
+.mainPage{
2
+  padding: .3rem .16rem .45rem;
3
+  box-sizing: border-box;
4
+  .title{
5
+    font-size: .18rem;
6
+    font-weight: bold;
7
+    padding-bottom: .14rem;
8
+    padding-left: .2rem;
9
+  }
10
+  .content{
11
+    background:#fff;
12
+    box-shadow:0px .08rem .37rem 0px rgba(202,202,202,0.42);
13
+    border-radius:.1rem;
14
+    padding: .12rem 0;
15
+    .message{
16
+      padding: 0 .22rem;
17
+      div{
18
+        margin-bottom: .2rem;
19
+        span:nth-of-type(1){
20
+          font-size: .14rem;
21
+        }
22
+        span:nth-last-of-type(1){
23
+          text-align: right;
24
+        }
25
+        .time{
26
+          margin-top: .1rem;
27
+          color: rgba(174,174,174,1);
28
+          font-size: .14rem;
29
+        }
30
+      }
31
+    }
32
+    .rule{
33
+      padding: 0 .22rem;
34
+      div:nth-of-type(1){
35
+        margin-bottom: .2rem;
36
+        font-size: .14rem;
37
+        color: #000;
38
+      }
39
+      div{
40
+        font-size: .12rem;
41
+        color: rgba(174,174,174,1);
42
+        margin-bottom: .1rem;
43
+      }
44
+    }
45
+  }
46
+  .number{
47
+    text-align: center;
48
+    color:rgba(143,143,143,1);
49
+    margin-bottom: .2rem;
50
+  }
51
+  .useType{
52
+    position: absolute;
53
+    bottom: 1.6rem;
54
+    right: .8rem;
55
+    width: .76rem;
56
+    height: .76rem;
57
+  }
58
+}

+ 184
- 0
src/pages/user/fiveA/index.vue Visa fil

@@ -0,0 +1,184 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <nav class="flex-h">
4
+      <a class="flex-item" v-for="(item,index) in nav" :key="index" :class="{'active':index==active.index}" @click="changeLocation(item,index)">{{item.LocationName}}</a>
5
+    </nav>
6
+    <div class="flex-item">
7
+      <div>
8
+        <div v-for="(item,index) in nav" :key="index" v-if="index==active.index">
9
+          <div class="banner flex-h">
10
+            <div class="flex-item">
11
+              <swiper :options="swiperOption" ref="mySwiper">
12
+                <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
13
+                  <img :src='item.ImageUrl' class="cover" style="border-radius: .12rem;" alt=""  @click="jump(item)">
14
+                </swiper-slide>
15
+              </swiper>
16
+            </div>
17
+          </div>
18
+          <h5>结识更多朋友</h5>
19
+          <div class="courseList flex-h">
20
+            <ul class="flex-item">
21
+              <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in courseList" :key="index">
22
+                <courseItem :data="item"></courseItem>
23
+              </router-link>
24
+            </ul>
25
+          </div>
26
+          <router-link :to="{name:'',query:{}}" class="more">查看更多</router-link>
27
+          <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
28
+          <h5>资讯</h5>
29
+          <div class="newsList flex-h">
30
+            <ul class="flex-item">
31
+              <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in newsList" :key="index">
32
+                <newsItem :data="item" @jump='jump'></newsItem>
33
+              </router-link>
34
+            </ul>
35
+          </div>
36
+        </div>
37
+      </div>
38
+    </div>
39
+  </div>
40
+</template>
41
+
42
+<script>
43
+import courseItem from '../../../components/courseItem/index'
44
+import newsItem from '../../../components/newsItem/index'
45
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
46
+import 'swiper/dist/css/swiper.css'
47
+import { mapState, createNamespacedHelpers } from 'vuex'
48
+const { mapActions: mapFiveAActions } = createNamespacedHelpers('fiveA')
49
+export default {
50
+  name: '',
51
+  data () {
52
+    return {
53
+      active: {
54
+        index: 1,
55
+        locationid: ''
56
+      },
57
+      swiperOption: {
58
+        observer: true,
59
+        loop: true,
60
+        autoplay: {
61
+          disableOnInteraction: false,
62
+        }
63
+      },
64
+      nav: [{
65
+        LocationId: "selected",
66
+        LocationName: "精选"
67
+      }],
68
+      courseList: [{ // 课程列表
69
+        id: '',
70
+        title: '课程名称',
71
+        img: '',
72
+        time: '2018.04.04 18:30-20:00',
73
+        address: '南京南',
74
+        tag: ['儿童教育', '小小外交官'],
75
+        courseType: '团体课',
76
+        defaultPrice: '168/节',
77
+        getWay: 'ticket'
78
+      }, {
79
+        id: '',
80
+        title: '课程名称',
81
+        img: '',
82
+        time: '2018.04.04 18:30-20:00',
83
+        address: '南京南',
84
+        tag: ['儿童教育', '小小外交官'],
85
+        courseType: '团体课',
86
+        defaultPrice: '168/节',
87
+        getWay: 'free'
88
+      }, {
89
+        id: '',
90
+        title: '课程名称',
91
+        img: '',
92
+        time: '2018.04.04 18:30-20:00',
93
+        address: '南京南',
94
+        tag: ['儿童教育', '小小外交官'],
95
+        courseType: '团体课',
96
+        defaultPrice: '168/节',
97
+        getWay: 'free'
98
+      }],
99
+      newsList: [{ // 资讯列表
100
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
101
+        time: '2018年5月25日',
102
+        img: '',
103
+        id: ''
104
+      }, {
105
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
106
+        time: '2018年5月25日',
107
+        img: '',
108
+        id: ''
109
+      }, {
110
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
111
+        time: '2018年5月25日',
112
+        img: '',
113
+        id: ''
114
+      }, {
115
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
116
+        time: '2018年5月25日',
117
+        img: '',
118
+        id: ''
119
+      }, {
120
+        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
121
+        time: '2018年5月25日',
122
+        img: '',
123
+        id: ''
124
+      }]
125
+    }
126
+  },
127
+  computed: {
128
+    ...mapState({
129
+      orgid: x => x.app.orgId,
130
+      navList: x => x.fiveA.nav,
131
+      banner: x => x.fiveA.banner,
132
+      cms: x => x.fiveA.cms
133
+    }),
134
+    MySwiper () {
135
+      return this.$refs.mySwiper.swiper
136
+    },
137
+    MySwiperMsg () {
138
+      return this.$refs.MySwiperMsg.swiper
139
+    }
140
+  },
141
+  components: {
142
+    newsItem,
143
+    swiper,
144
+    swiperSlide,
145
+    courseItem,
146
+  },
147
+  created () {
148
+    this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
149
+      this.nav = this.nav.concat(this.navList)
150
+      this.active.locationid = this.nav[this.active.index].LocationId
151
+      this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
152
+        this.newsList = this.cms
153
+      })
154
+    })
155
+  },
156
+  methods: {
157
+    ...mapFiveAActions(['getNav']),
158
+    ...mapFiveAActions(['getFiveAInfo']),
159
+    changeLocation (item, index) {
160
+      this.active.index = index
161
+      this.active.locationid = item.LocationId
162
+      this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
163
+        this.newsList = this.cms
164
+      })
165
+    },
166
+    jump (item) {
167
+      console.log(item)
168
+      item.ForwardType = item.ForwardType || ''
169
+      if (item.ForwardType === 'url') {
170
+        window.location.href = '//' + item.ForwardUrl
171
+      } else if (item.ForwardType === 'course') {
172
+        this.$router.push({ name: '', query: { id: item.ForwardResourceId } }) // 此处去课程详情
173
+      } else {
174
+        window.location.href = '//' + item.InfoUrl
175
+      }
176
+    }
177
+  }
178
+}
179
+</script>
180
+
181
+<!-- Add "scoped" attribute to limit CSS to this component only -->
182
+<style lang="scss" scoped>
183
+@import "page.scss";
184
+</style>

+ 107
- 0
src/pages/user/fiveA/page.scss Visa fil

@@ -0,0 +1,107 @@
1
+.mainPage{
2
+  background: #fff;
3
+  &>nav{
4
+    white-space: nowrap;
5
+    overflow-x: scroll;
6
+    -webkit-overflow-scrolling: touch;
7
+    font-size: 0;
8
+    padding: .09rem 0;
9
+    background: #fff;
10
+    z-index: 100;
11
+    position: relative;
12
+    a{
13
+      line-height: .32rem;
14
+      text-align: center;
15
+      position: relative;
16
+      &.active::after{
17
+        content: '';
18
+        width: 50%;
19
+        height: .02rem;
20
+        display: block;
21
+        position: absolute;
22
+        left: 50%;
23
+        bottom: 0;
24
+        transform: translateX(-50%);
25
+        -webkit-transform: translateX(-50%);
26
+        background: #fc6243;
27
+      }
28
+    }
29
+  }
30
+  &>div.flex-item{
31
+    position: relative;
32
+    &>div{
33
+      width: 100%;
34
+      position: absolute;
35
+      left: 0;
36
+      top: 0;
37
+      bottom: 0;
38
+      overflow: hidden;
39
+      &>div{
40
+        width: 100%;
41
+        height: 100%;
42
+        position: relative;
43
+        overflow-y: scroll;
44
+        -webkit-overflow-scrolling: touch;
45
+        transform: translateZ(0);
46
+        -webkit-transform: translateZ(0);
47
+        .banner{
48
+          margin: .2rem auto 0;
49
+          overflow: visible;
50
+          &>div{
51
+            margin: 0 .2rem;
52
+            position: relative;
53
+            overflow: hidden;
54
+            border-radius: .12rem;
55
+            padding-bottom: 46%;
56
+            background: #eee;
57
+            box-shadow: 0 0 .2rem .01rem rgba(0, 0, 0, .1);
58
+            &>div{
59
+              width: 100%;
60
+              position: absolute;
61
+              left: 0;
62
+              top: 0;
63
+              bottom: 0;
64
+              overflow: hidden;
65
+            }
66
+          }
67
+        }
68
+        h5{
69
+          width: 100%;
70
+          display: block;
71
+          line-height: .26rem;
72
+          font-size: .14rem;
73
+          text-indent: .2rem;
74
+          margin: .2rem auto 0;
75
+        }
76
+        .courseList{
77
+          &>ul{
78
+            margin: 0 .2rem;
79
+            &>li{
80
+              padding: .15rem 0;
81
+              border-bottom: .01rem solid #eee;
82
+            }
83
+          }
84
+        }
85
+        .more{
86
+          width: 100%;
87
+          display: block;
88
+          text-align: center;
89
+          font-size: .12rem;
90
+          line-height: .4rem;
91
+        }
92
+      }
93
+      .newsList{
94
+        &>ul{
95
+          margin: 0 .2rem;
96
+          &>li{
97
+            padding: .15rem 0;
98
+            border-top: .01rem solid #eee;
99
+            &:first-child{
100
+              border-top: none;
101
+            }
102
+          }
103
+        }
104
+      }
105
+    }
106
+  }
107
+}

+ 84
- 0
src/pages/user/lessonDetail/index.vue Visa fil

@@ -0,0 +1,84 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="title">课程详情</div>
4
+    <div class="content" :class="{'opacity' : useType == '已失效' || useType == '已使用', 'gray': useType == '已使用' || useType == '已失效'}">
5
+      <div class="list-item">
6
+        <span>订单编号</span>
7
+        <span>144215646445464</span>
8
+      </div>
9
+      <div class="list-item">
10
+        <span>订单名称</span>
11
+        <span>拉伸柔韧度</span>
12
+      </div>
13
+      <div class="list-item">
14
+        <span>节课数</span>
15
+        <span>2节课</span>
16
+      </div>
17
+      <div class="list-item">
18
+        <span>类型</span>
19
+        <span>健身</span>
20
+      </div>
21
+      <div class="list-item">
22
+        <span>商品价格</span>
23
+        <span>¥1999</span>
24
+      </div>
25
+      <div class="list-item">
26
+        <span>下单时间</span>
27
+        <span>2018/04/12 14:26:09</span>
28
+      </div>
29
+      <div class="list-item">
30
+        <span>课程时间</span>
31
+        <span>2018/04/12 12:00至14:00 计划备注(每周六 19:30)</span>
32
+      </div>
33
+      <div class="list-item">
34
+        <span>地点</span>
35
+        <span>悦见山G99</span>
36
+      </div>
37
+      <div class="list-item">
38
+        <span>付款方式</span>
39
+        <span>优惠券抵用 <div class="coupon-name">小拉伸柔韧度体验券</div></span>
40
+      </div>
41
+      <div class="half-cic">
42
+        <span></span>
43
+        <span></span>
44
+      </div>
45
+      <div class="qr-code">
46
+        <qrCode :msg='msg'></qrCode>
47
+        <div class="number">32237489123</div>
48
+      </div>
49
+    </div>
50
+    <div class="useType">
51
+      <img :src="used" alt="已使用" v-if="useType == '已使用'" width="100%" height="100%">
52
+      <img :src="failure" alt="已失效" v-if="useType == '已失效'" width="100%" height="100%">
53
+    </div>
54
+  </div>
55
+</template>
56
+
57
+<script>
58
+import qrCode from '../../../components/qrCodeCard/qrCodeCard'
59
+import used from '../../../common/icon/already.png'
60
+import failure from '../../../common/icon/inv.png'
61
+export default {
62
+  data () {
63
+    return {
64
+      msg: {
65
+        course_type: 800,
66
+        orderNo: '342897789334'
67
+      },
68
+      useType: '未使用',
69
+      used,
70
+      failure,
71
+    }
72
+  },
73
+  methods: {
74
+
75
+  },
76
+  components: {
77
+    qrCode
78
+  }
79
+}
80
+</script>
81
+
82
+<style lang="scss" scoped>
83
+@import "page.scss";
84
+</style>

+ 73
- 0
src/pages/user/lessonDetail/page.scss Visa fil

@@ -0,0 +1,73 @@
1
+.mainPage{
2
+  padding: .3rem .16rem .45rem;
3
+  box-sizing: border-box;
4
+  .title{
5
+    font-size: .18rem;
6
+    font-weight: bold;
7
+    padding-bottom: .14rem;
8
+    padding-left: .2rem;
9
+  }
10
+  .content{
11
+    background:#fff;
12
+    box-shadow:0px .08rem .37rem 0px rgba(202,202,202,0.42);
13
+    border-radius:.1rem;
14
+    padding: .12rem 0;
15
+    &.opacity {
16
+      opacity: .5;
17
+    }
18
+    &.gray {
19
+      filter: grayscale(100%);
20
+    }
21
+    .list-item{
22
+      display: flex;
23
+      justify-content: space-between;
24
+      align-items: flex-start;
25
+      padding: 0 .22rem;
26
+      margin-bottom: .1rem;
27
+      span{
28
+        display: block;
29
+        color: #666;
30
+      }
31
+      span:nth-of-type(2){
32
+        width: 60%;
33
+        text-align: right;
34
+        color: #000;
35
+        .coupon-name{
36
+          color: #FF2B00;
37
+          font-size: .12rem;
38
+        }
39
+      }
40
+    }
41
+    .half-cic{
42
+      height: .25rem;
43
+      display: flex;
44
+      justify-content: space-between;
45
+      overflow: hidden;
46
+      span{
47
+        display: block;
48
+        width: .25rem;
49
+        height: .25rem;
50
+        border-radius: 50%;
51
+        background: rgba(202,202,202,0.2);
52
+      }
53
+      span:nth-of-type(1){
54
+        transform: translateX(-50%);
55
+      }
56
+      span:nth-of-type(2){
57
+        transform: translateX(50%);
58
+      }
59
+    }
60
+    .number{
61
+      text-align: center;
62
+      color:rgba(143,143,143,1);
63
+      margin-top: .2rem;
64
+    }
65
+  }
66
+  .useType{
67
+    position: absolute;
68
+    bottom: 1.6rem;
69
+    right: .8rem;
70
+    width: .76rem;
71
+    height: .76rem;
72
+  }
73
+}

+ 136
- 0
src/pages/user/lessonOrder/index.vue Visa fil

@@ -0,0 +1,136 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
4
+      <div class="box">
5
+        <div class="order-card flex-h" v-for="(item,index) in list" :key='index' :class="{'opacity' : item.useType == '已失效'}" @click="toDetail(item)">
6
+          <div class="card-pic">
7
+            <div :class="{'gray-location' : item.useType == '已失效'}"><span>{{item.LocationName}}</span></div>
8
+            <img src="" class="cover" width="100%" height="100%" alt="">
9
+          </div>
10
+          <div class="card-msg">
11
+            <div class="title">{{item.title}}</div>
12
+            <div class="text">付款方式:{{item.payType}}</div>
13
+            <div class="text">下单时间:{{item.time}}</div>
14
+          </div>
15
+          <div class="card-price">
16
+            <div class="price">¥ {{item.price}}</div>
17
+            <div class="type" :class="{'un-use' : item.useType == '未使用'}">{{item.useType}}</div>
18
+          </div>
19
+        </div>
20
+        <!-- <noMore v-if="hasPic"></noMore> -->
21
+      </div>
22
+    </scroll>
23
+  </div>
24
+</template>
25
+
26
+<script>
27
+// 上拉加载组件
28
+import scroll from '../../../components/scroll/scroll'
29
+import noMore from '../../../components/noMore/noMore'
30
+export default {
31
+  data () {
32
+    return {
33
+      hasPic: false,
34
+      pullUpLoad: true,
35
+      pullUpLoadThreshold: 40,
36
+      startY: 0,
37
+      isloading: true,
38
+      hasMore: true,
39
+      list: [
40
+        {
41
+          LocationName: '社交',
42
+          title: '小小外交官课程',
43
+          payType: '优惠券抵用',
44
+          time: '2018-7-18 12:19',
45
+          price: 199,
46
+          useType: '未使用'
47
+        },
48
+        {
49
+          LocationName: '社交',
50
+          title: '小小外交官课程',
51
+          payType: '优惠券抵用',
52
+          time: '2018-7-18 12:19',
53
+          price: 199,
54
+          useType: '已使用'
55
+        },
56
+        {
57
+          LocationName: '社交',
58
+          title: '小小外交官课程',
59
+          payType: '优惠券抵用',
60
+          time: '2018-7-18 12:19',
61
+          price: 199,
62
+          useType: '已失效'
63
+        },
64
+        {
65
+          LocationName: '社交',
66
+          title: '小小外交官课程',
67
+          payType: '优惠券抵用',
68
+          time: '2018-7-18 12:19',
69
+          price: 199,
70
+          useType: '已失效'
71
+        },
72
+        {
73
+          LocationName: '社交',
74
+          title: '小小外交官课程',
75
+          payType: '优惠券抵用',
76
+          time: '2018-7-18 12:19',
77
+          price: 199,
78
+          useType: '已失效'
79
+        },
80
+        {
81
+          LocationName: '社交',
82
+          title: '小小外交官课程',
83
+          payType: '优惠券抵用',
84
+          time: '2018-7-18 12:19',
85
+          price: 199,
86
+          useType: '已失效'
87
+        }
88
+      ]
89
+    }
90
+  },
91
+  components: {
92
+    scroll,
93
+    noMore
94
+  },
95
+  computed: {
96
+    pullUpLoadObj: function () {
97
+      return this.pullUpLoad
98
+        ? {
99
+          threshold: parseInt(this.pullUpLoadThreshold),
100
+          txt: {
101
+            more: this.pullUpLoadMoreTxt,
102
+            noMore: this.pullUpLoadNoMoreTxt
103
+          }
104
+        }
105
+        : false
106
+    }
107
+  },
108
+  methods: {
109
+    getList () {
110
+      this.list.length <= 8 ? this.hasMore = true : this.hasMore = false
111
+      if (this.hasMore) {
112
+        setTimeout(() => {
113
+          this.list.push({
114
+            LocationName: '社交',
115
+            title: '小小外交官课程',
116
+            payType: '优惠券抵用',
117
+            time: '2018-7-18 12:19',
118
+            price: 199,
119
+            useType: '已失效'
120
+          })
121
+        }, 1000)
122
+      } else {
123
+        this.$refs.scroll.forceUpdate()
124
+        return false
125
+      }
126
+    },
127
+    toDetail () {
128
+      this.$router.push({name: 'lessonDetail'})
129
+    }
130
+  }
131
+}
132
+</script>
133
+
134
+<style lang="scss" scoped>
135
+@import "page.scss";
136
+</style>

+ 78
- 0
src/pages/user/lessonOrder/page.scss Visa fil

@@ -0,0 +1,78 @@
1
+.box {
2
+  padding: .2rem .16rem 0;
3
+  .order-card {
4
+    padding: .2rem .15rem .2rem .1rem;
5
+    box-sizing: border-box;
6
+    background:rgba(255,255,255,1);
7
+    box-shadow:0px 2px 8px 0px rgba(204,204,204,0.5);
8
+    border-radius:10px;
9
+    margin-bottom: .2rem;
10
+    &.opacity {
11
+      opacity: .5;
12
+    }
13
+    .card-pic {
14
+      width: .8rem;
15
+      height: .8rem;
16
+      border-radius: .08rem;
17
+      overflow: hidden;
18
+      position: relative;
19
+      div{
20
+        position: absolute;
21
+        background:linear-gradient(45deg,rgba(255,105,0,1) 0%,rgba(255,136,0,0.76) 100%);
22
+        opacity:0.85;
23
+        width: .6rem;
24
+        height: .6rem;
25
+        transform: rotate(45deg);
26
+        top: -0.3rem;
27
+        left: -0.3rem;
28
+        &.gray-location{
29
+          background: rgba(189,189,189,1);
30
+        }
31
+        span{
32
+          position: absolute;
33
+          bottom: .22rem;
34
+          right: -0.03rem;
35
+          font-size: .12rem;
36
+          color: #fff;
37
+          transform: rotate(-90deg);
38
+        }
39
+      }
40
+    }
41
+    .card-msg{
42
+      width: 1.7rem;
43
+      padding-left: .12rem;
44
+      .title{
45
+        font-size: .14rem;
46
+        padding-bottom: .12rem
47
+      }
48
+      .text{
49
+        font-size: .12rem;
50
+        color:rgba(153,153,153,1);
51
+        padding-bottom: .06rem;
52
+      }
53
+    }
54
+    .card-price{
55
+      flex: 1;
56
+      text-align: right;
57
+      .price, .type{
58
+        font-size: .14rem;
59
+        color: #000;
60
+        &.un-use{
61
+          color: #F25004;
62
+        }
63
+      }
64
+    }
65
+  }
66
+}
67
+
68
+@media screen and (max-width: 320px) {
69
+  .order-card {
70
+    .card-pic {
71
+      div{
72
+        span{
73
+          bottom: .2rem !important;
74
+        }
75
+      }
76
+    }
77
+  }
78
+}

+ 105
- 0
src/pages/user/mainPage/coffeeIndex/index.vue Visa fil

@@ -0,0 +1,105 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="top">
4
+      <topCaseInfo :data="topCaseInfoData" @selectCase="showSelect = true"></topCaseInfo>
5
+    </div>
6
+    <div class="content flex-item">
7
+      <div>
8
+        <div class="flex-h">
9
+          <div class="flex-item">
10
+            <ul class="areaList">
11
+              <li v-for="(item,index) in list" :key="index">
12
+                <div class="title">
13
+                  <i class="iconfont icon-yinchenglogo"></i>
14
+                  <span>{{item.name}}</span>
15
+                </div>
16
+                <ul class="subAreaList flex-h">
17
+                  <li class="flex-item flex-h" v-for="(subItem,subIndex) in item.list" :key="subIndex">
18
+                    <caseTableItem :item="subItem" :index="subIndex"></caseTableItem>
19
+                  </li>
20
+                  <li class="flex-item noData" v-if="item.list.length % 2 != 0"></li>
21
+                </ul>
22
+              </li>
23
+            </ul>
24
+          </div>
25
+        </div>
26
+      </div>
27
+    </div>
28
+    <div class="selectCase" :hidden="!showSelect"></div>
29
+    <van-picker :hidden="!showSelect"
30
+      show-toolbar
31
+      title="选择案场"
32
+      :columns="caseList"
33
+      @cancel="showSelect = false"
34
+      @confirm="selectCase"
35
+      value-key="value"
36
+    />
37
+  </div>
38
+</template>
39
+
40
+<script>
41
+import caseTableItem from '../../../../components/caseTableItem/index'
42
+import topCaseInfo from '../../../../components/topCaseInfo/index'
43
+
44
+export default {
45
+  name: '',
46
+  data () {
47
+    return {
48
+      topCaseInfoData: {
49
+        caseName: '',
50
+        caseId: '',
51
+        showSelect: true,
52
+        userName: 'xxx'
53
+      },
54
+      caseInfo: {
55
+        value: '',
56
+        id: ''
57
+      },
58
+      showSelect: false,
59
+      caseList: [{
60
+        value: '案场一',
61
+        id: ''
62
+      }, {
63
+        value: '案场二',
64
+        id: ''
65
+      }, {
66
+        value: '案场三',
67
+        id: ''
68
+      }, {
69
+        value: '案场四',
70
+        id: ''
71
+      }],
72
+      list: [{
73
+        name: '案场名称1',
74
+        list: [{}, {}, {}, {}, {}],
75
+      }, {
76
+        name: '案场名称2',
77
+        list: [{}, {}, {}, {}, {}],
78
+      }]
79
+    }
80
+  },
81
+  computed: {
82
+
83
+  },
84
+  components: {
85
+    topCaseInfo,
86
+    caseTableItem,
87
+  },
88
+  created () {
89
+
90
+  },
91
+  methods: {
92
+    selectCase (val) { // 选择案场
93
+      this.caseInfo = val
94
+      this.topCaseInfoData.caseName = val.value
95
+      this.topCaseInfoData.caseId = val.id
96
+      this.showSelect = false
97
+    },
98
+  }
99
+}
100
+</script>
101
+
102
+<!-- Add "scoped" attribute to limit CSS to this component only -->
103
+<style lang="scss" scoped>
104
+@import "page.scss";
105
+</style>

+ 76
- 0
src/pages/user/mainPage/coffeeIndex/page.scss Visa fil

@@ -0,0 +1,76 @@
1
+.mainPage{
2
+  .top{
3
+    position: relative;
4
+    overflow: hidden;
5
+  }
6
+  .content{
7
+    &>div{
8
+      width: 100%;
9
+      position: absolute;
10
+      left: 0;
11
+      top: 0;
12
+      bottom: 0;
13
+      overflow-y: scroll;
14
+      -webkit-overflow-scrolling: touch;
15
+      transform: translateZ(0);
16
+      -webkit-transform: translateZ(0);
17
+      &>div.flex-h{
18
+        &>div{
19
+          margin: 0 .2rem;
20
+          position: relative;
21
+          overflow: visible;
22
+          .areaList{
23
+            &:last-child{
24
+              margin-bottom: .2rem;
25
+            }
26
+            .title{
27
+              font-size: 0;
28
+              white-space: nowrap;
29
+              margin-top: .22rem;
30
+              *{
31
+                line-height: .26rem;
32
+                font-size: .14rem;
33
+              }
34
+              i{
35
+                color: red;
36
+                margin-right: .05rem;
37
+              }
38
+            }
39
+            .subAreaList{
40
+              position: relative;
41
+              overflow: visible;
42
+              flex-wrap: wrap;
43
+              -webkit-flex-wrap: wrap;
44
+              &>li{
45
+                position: relative;
46
+                overflow: hidden;
47
+                border-radius: .06rem;
48
+                background: #fff;
49
+                padding: .15rem 0;
50
+                box-shadow: 0 0 .1rem .01rem rgba(0, 0, 0, .1);
51
+                min-width: 40%;
52
+                margin-top: .2rem;
53
+                &:nth-child(2n){
54
+                  margin-left: .2rem;
55
+                }
56
+                &.noData{
57
+                  box-shadow: none;
58
+                  background: none;
59
+                }
60
+              }
61
+            }
62
+          }
63
+        }
64
+      }
65
+    }
66
+  }
67
+  .selectCase{
68
+    width: 100%;
69
+    position: absolute;
70
+    left: 0;
71
+    top: 0;
72
+    bottom: 0;
73
+    background: rgba(0, 0, 0, .3);
74
+    z-index: 100;
75
+  }
76
+}

+ 57
- 0
src/pages/user/mainPage/index.vue Visa fil

@@ -0,0 +1,57 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="subPage flex-item">
4
+      <div>
5
+        <router-view></router-view>
6
+      </div>
7
+    </div>
8
+    <nav class="flex-h">
9
+      <router-link :to="{name:item.pathName,query:{}}" class="flex-item" active-class="active" v-for="(item, index) in tabBar" :key="index">
10
+        <div>
11
+          <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">
12
+          <img v-if="index==1" class="centerLabel" src="../../../common/icon/tabBar-icon-2.png" alt="">
13
+          <img v-if="index==2" class="centerLabel" src="../../../common/icon/tabBar-icon-3.png" alt="">
14
+        </div>
15
+        <span>{{item.name}}</span>
16
+      </router-link>
17
+    </nav>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+
23
+export default {
24
+  name: '',
25
+  data () {
26
+    return {
27
+      tabBar: [{
28
+        pathName:'indexPage',
29
+        name:'会所'
30
+      },{
31
+        pathName:'coffeeIndex',
32
+        name:'城咖啡'
33
+      },{
34
+        pathName:'userCenter',
35
+        name:'会员'
36
+      }]
37
+    }
38
+  },
39
+  computed: {
40
+    
41
+  },
42
+  components: {
43
+    
44
+  },
45
+  created () {
46
+    
47
+  },
48
+  methods: {
49
+    
50
+  }
51
+}
52
+</script>
53
+
54
+<!-- Add "scoped" attribute to limit CSS to this component only -->
55
+<style lang="scss" scoped>
56
+@import "page.scss";
57
+</style>

+ 161
- 0
src/pages/user/mainPage/indexPage/index.vue Visa fil

@@ -0,0 +1,161 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="topBanner">
4
+      <swiper :options="swiperOption" ref="mySwiper">
5
+        <swiper-slide class="swiper-slide" v-for="(item,index) in banner" :key="index">
6
+          <img :src='item.ImageUrl' class="cover" alt="" @click="jump(item)">
7
+        </swiper-slide>
8
+      </swiper>
9
+    </div>
10
+    <div class="pageTitle flex-h">
11
+      <h5 class="flex-item">
12
+        <span>银城5A全龄生活体验平台</span>
13
+      </h5>
14
+    </div>
15
+    <div class="flex-h">
16
+      <nav class="pageNav flex-item">
17
+        <router-link :to="{name:'fiveA',query:{id:item.LocationId}}" v-for="(item,index) in data.fiveA" :key="index">
18
+          <a>
19
+            <img :src="item.TypeImg" class="centerLabel cover" alt="">
20
+            <em>{{item.LocationName}}</em>
21
+          </a>
22
+          <span>{{item.Title}}</span>
23
+        </router-link>
24
+      </nav>
25
+    </div>
26
+    <div class="MsgBanner">
27
+      <div class="flex-h">
28
+        <i class="iconfont icon-xiaoxi"></i>
29
+        <span>最新消息:</span>
30
+        <div class="flex-item">
31
+          <div>
32
+            <swiper :options="swiperOptionMsg" ref="mySwiperMsg">
33
+              <swiper-slide class="swiper-slide" v-for="(item,index) in message" :key="index">
34
+                <router-link :to="{name:'',query:{}}"><span @click="jump(item)">{{item.InfoName}}</span></router-link>
35
+              </swiper-slide>
36
+              <div class="swiper-pagination"  slot="pagination"></div>
37
+            </swiper>
38
+          </div>
39
+        </div>
40
+      </div>
41
+    </div>
42
+    <div class="pageTitle flex-h">
43
+      <h5 class="flex-item">
44
+        <span>售楼处项目专题</span>
45
+      </h5>
46
+    </div>
47
+    <div class="flex-h">
48
+      <ul class="projectList flex-item">
49
+        <router-link tag="li" :to="{ name:'majorProjects', query:{ id: item.CmsCaseId } }" v-for="(item,index) in project" :key="index">
50
+          <img :src='item.CaseImageUrl' class="centerLabel cover" alt="">
51
+        </router-link>
52
+      </ul>
53
+    </div>
54
+    <div style="width:100%;height:.1rem;background:#f8f8f8;margin:.25rem auto 0;"></div>
55
+    <div class="pageTitle flex-h">
56
+      <h5 class="flex-item">
57
+        <span>活动资讯</span>
58
+      </h5>
59
+    </div>
60
+    <div class="flex-h">
61
+      <ul class="newsList flex-item">
62
+        <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in newsList" :key="index">
63
+          <newsItem :data="item" @jump='jump'></newsItem>
64
+        </router-link>
65
+      </ul>
66
+    </div>
67
+  </div>
68
+</template>
69
+
70
+<script>
71
+import newsItem from '../../../../components/newsItem/index'
72
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
73
+import 'swiper/dist/css/swiper.css'
74
+import { mapState, createNamespacedHelpers } from 'vuex'
75
+const { mapActions: mapIndexActions } = createNamespacedHelpers('index')
76
+export default {
77
+  name: '',
78
+  data () {
79
+    return {
80
+      data: {
81
+        fiveA: []
82
+      },
83
+      locationId: '',
84
+      swiperOption: {
85
+        observer: true,
86
+        loop: true,
87
+        autoplay: {
88
+          disableOnInteraction: false,
89
+        }
90
+      },
91
+      swiperOptionMsg: {
92
+        observer: true,
93
+        direction: 'vertical',
94
+        loop: true,
95
+        autoplay: {
96
+          disableOnInteraction: false,
97
+        }
98
+      },
99
+      newsList: []
100
+    }
101
+  },
102
+  computed: {
103
+    ...mapState({
104
+      orgid: x => x.app.orgId,
105
+      fiveA: x => x.index.fiveA,
106
+      banner: x => x.index.banner,
107
+      message: x => x.index.message,
108
+      project: x => x.index.project,
109
+      cms: x => x.index.cms,
110
+    }),
111
+    MySwiper () {
112
+      return this.$refs.mySwiper.swiper
113
+    },
114
+    MySwiperMsg () {
115
+      return this.$refs.MySwiperMsg.swiper
116
+    }
117
+  },
118
+  components: {
119
+    newsItem,
120
+    swiper,
121
+    swiperSlide,
122
+  },
123
+  created () {
124
+    this.getIndexLocation({ orgid: this.orgid, issys: '0' }).then((res) => {
125
+      this.data.fiveA = this.fiveA
126
+      this.locationId = 'index'
127
+      this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then(() => {
128
+        this.newsList = this.cms
129
+        for (let i = 0; i < this.project.length; i++) {
130
+          if (this.project[i].CmsCaseImgs != null) {
131
+            for (let j = 0; j < this.project[i].CmsCaseImgs.length; j++) {
132
+              if (this.project[i].CmsCaseImgs[j].ImageType === 'cover') {
133
+                this.project[i].CaseImageUrl = this.project[i].CmsCaseImgs[j].CaseImageUrl
134
+              }
135
+            }
136
+          }
137
+        }
138
+      })
139
+    })
140
+  },
141
+  methods: {
142
+    ...mapIndexActions(['getIndexInfo']),
143
+    ...mapIndexActions(['getIndexLocation']),
144
+    jump (item) {
145
+      item.ForwardType = item.ForwardType || ''
146
+      if (item.ForwardType === 'url') {
147
+        window.location.href = '//' + item.ForwardUrl
148
+      } else if (item.ForwardType === 'course') {
149
+        this.$router.push({ name: '', query: { id: item.ForwardResourceId } }) // 此处去课程详情
150
+      } else {
151
+        window.location.href = '//' + item.InfoUrl
152
+      }
153
+    }
154
+  }
155
+}
156
+</script>
157
+
158
+<!-- Add "scoped" attribute to limit CSS to this component only -->
159
+<style lang="scss" scoped>
160
+@import "page.scss";
161
+</style>

+ 184
- 0
src/pages/user/mainPage/indexPage/page.scss Visa fil

@@ -0,0 +1,184 @@
1
+.mainPage{
2
+  overflow-y: scroll;
3
+  -webkit-overflow-scrolling: touch;
4
+  transform: translateZ(0);
5
+  -webkit-transform: translateZ(0);
6
+  background: #fff;
7
+  &>*:last-child{
8
+    margin-bottom: .2rem;
9
+  }
10
+  .topBanner{
11
+    width: 100%;
12
+    height: 0;
13
+    position: relative;
14
+    overflow: hidden;
15
+    padding-bottom: 54%;
16
+    background: #eee;
17
+    &>div{
18
+      width: 100%;
19
+      position: absolute;
20
+      left: 0;
21
+      bottom: 0;
22
+      top: 0;
23
+    }
24
+  }
25
+  .pageTitle{
26
+    margin: .18rem auto 0;
27
+    position: relative;
28
+    overflow: hidden;
29
+    h5{
30
+      &::after{
31
+        content: '';
32
+        width: 100%;
33
+        height: .01rem;
34
+        background: #eee;
35
+        position: absolute;
36
+        left: 0;
37
+        top: 50%;
38
+        transform: translateY(-50%);
39
+        -webkit-transform: translateY(-50%);
40
+        z-index: 1;
41
+      }
42
+      width: 100%;
43
+      display: block; 
44
+      text-align: center;
45
+      position: relative;
46
+      overflow: hidden;
47
+      margin: 0 .2rem;
48
+      span{
49
+        display: inline-block; 
50
+        line-height: .26rem;
51
+        font-size: .14rem;
52
+        font-weight: normal;
53
+        background: #fff;
54
+        position: relative;
55
+        z-index: 2;
56
+        padding: 0 .15rem;
57
+      }
58
+    }
59
+  }
60
+  .pageNav{
61
+    margin: 0 .1rem;
62
+    font-size: 0;
63
+    &>a{
64
+      width: 20%;
65
+      display: inline-block;
66
+      position: relative;
67
+      overflow: hidden;
68
+      margin-top: .15rem;
69
+      vertical-align: top;
70
+      a{
71
+        width: 70%;
72
+        display: block;
73
+        padding-bottom: 70%;
74
+        position: relative;
75
+        overflow: hidden;
76
+        background: #eee;
77
+        margin: 0 auto;
78
+        border-radius: 100%;
79
+        img{
80
+          z-index: 1;
81
+        }
82
+        em{
83
+          width: 100%;
84
+          display: block;
85
+          position: absolute;
86
+          left: 0;
87
+          bottom: 0;
88
+          line-height: .3rem;
89
+          font-size: .11rem;
90
+          text-align: center;
91
+          color: #fff;
92
+          z-index: 2;
93
+        }
94
+      }
95
+      span{
96
+        width: 70%;
97
+        display: block;
98
+        margin: .1rem auto 0;
99
+        line-height: .16rem;
100
+        font-size: .1rem;
101
+        text-align: center;
102
+        color: #666;
103
+      }
104
+    }
105
+  }
106
+  .MsgBanner{
107
+    width: 100%;
108
+    height: .44rem;
109
+    position: relative;
110
+    overflow: hidden;
111
+    background: #f8f8f8;
112
+    margin: .25rem auto 0;
113
+    &>div{
114
+      width: 100%;
115
+      position: absolute;
116
+      left: 0;
117
+      top: 0;
118
+      bottom: 0;
119
+      align-items: center;
120
+      &>i,
121
+      &>span{
122
+        color: #f05a3f;
123
+        font-size: .12rem;
124
+        margin-left: .08rem;
125
+      }
126
+      &>i{
127
+        font-size: .16rem;
128
+        margin-left: .3rem;
129
+      }
130
+      &>div{
131
+        margin-left: .1rem;
132
+        height: 100%;
133
+        margin-right: .2rem;
134
+        &>div{
135
+          width: 100%;
136
+          height: 100%;
137
+          position: relative;
138
+          overflow: hidden;
139
+          &>div{
140
+            width: 100%;
141
+            height: 100%;
142
+            a{
143
+              width: 100%;
144
+              display: inline-block;
145
+              overflow: hidden;
146
+              white-space: nowrap;
147
+              text-overflow: ellipsis;
148
+              line-height: .44rem;
149
+              color: #f05a3f;
150
+              span{
151
+                color: #f05a3f;
152
+              }
153
+            }
154
+          }
155
+        }
156
+      }
157
+    }
158
+  }
159
+  .projectList{
160
+    margin: .1rem .1rem 0;
161
+    li{
162
+      width: 100%;
163
+      position: relative;
164
+      height: 0;
165
+      padding-bottom: 30%;
166
+      background: #eee;
167
+      overflow: hidden;
168
+      margin: .08rem auto 0;
169
+    }
170
+  }
171
+  .newsList{
172
+    margin: .15rem .2rem .2rem;
173
+    &>li{
174
+      width: 100%;
175
+      display: block;
176
+      position: relative;
177
+      overflow: hidden;
178
+      border-top: .01rem solid #eee;
179
+      &:first-child{
180
+        border-top:none
181
+      }
182
+    }
183
+  }
184
+}

+ 47
- 0
src/pages/user/mainPage/page.scss Visa fil

@@ -0,0 +1,47 @@
1
+.mainPage{
2
+  .subPage{
3
+    &>div{
4
+      width: 100%;
5
+      position: absolute;
6
+      left: 0;
7
+      top: 0;
8
+      bottom: 0;
9
+      z-index: 1;
10
+    }
11
+  }
12
+  &>nav{
13
+    background: #fff;
14
+    position: relative;
15
+    z-index: 100;
16
+    box-shadow: 0 0 .1rem .02rem rgba(0, 0, 0, .05);
17
+    a{
18
+      text-align: center;
19
+      div{
20
+        width: 100%;
21
+        height: .2rem;
22
+        position: relative;
23
+        margin-top: .06rem;
24
+      }
25
+      img{
26
+        max-height: .2rem;
27
+        max-width: .2rem;
28
+        filter: grayscale(100%);
29
+        -webkit-filter: grayscale(100%);
30
+      }
31
+      span{
32
+        width: 100%;
33
+        display: inline-block;
34
+        text-align: center;
35
+        line-height: .2rem;
36
+        font-size: .1rem;
37
+        color: #000;
38
+      }
39
+    }
40
+    a.active{
41
+      img{
42
+        filter: grayscale(0);
43
+        -webkit-filter: grayscale(0);
44
+      }
45
+    }
46
+  }
47
+}

+ 119
- 0
src/pages/user/mainPage/userCenter/index.vue Visa fil

@@ -0,0 +1,119 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="loading" v-if="isLoading">
4
+      <!-- <img :src='loading' alt=""> -->
5
+      <div @click="bindMobile">请绑定手机号</div>
6
+    </div>
7
+    <div v-else>
8
+      <div class="userTop_view" >
9
+        <div class="gradient_bg"></div>
10
+        <div class="zIndex_bg"></div>
11
+        <div class="userAvatar_Border">
12
+          <div class="userAvatar">
13
+            <img :src='AccountInfo.headimgurl' alt="" width="100%" height="100%">
14
+          </div>
15
+        </div>
16
+        <div class="uesr-info">
17
+          <div class="user-name">{{user.Name}}</div>
18
+          <div class="mobile">{{user.Phone}}</div>
19
+        </div>
20
+      </div>
21
+      <div class="vip-privilege flex-h">
22
+        <div class="flex-item privilege-item" @click="toCoupons">
23
+          <div class="img-box">
24
+            <img src="../../../../common/icon/userCenter-icon-1.png" width="100%" height="100%" alt="">
25
+          </div>
26
+          <span>优惠券</span>
27
+          <span>2张未使用</span>
28
+        </div>
29
+        <div class="flex-item privilege-item" @click="toCard">
30
+          <div class="img-box">
31
+            <img src="../../../../common/icon/userCenter-icon-2.png" width="100%" height="100%" alt="">
32
+          </div>
33
+          <span>卡券</span>
34
+          <span>2张未使用</span>
35
+        </div>
36
+        <div class="flex-item privilege-item" @click="toVip">
37
+          <div class="img-box">
38
+            <img src="../../../../common/icon/userCenter-icon-3.png" width="100%" height="100%" alt="">
39
+          </div>
40
+          <span>VIP卡</span>
41
+          <span>¥200 <i class="iconfont icon-jiantou-right" style="font-size: 0.1rem;"></i></span>
42
+        </div>
43
+      </div>
44
+
45
+      <div class="userCenter-menu">
46
+        <div class="menu-item flex-h" @click="toLessonOrder">
47
+          <span>课程订单</span>
48
+          <i class="iconfont icon-jiantou-right"></i>
49
+        </div>
50
+        <div class="menu-item flex-h">
51
+          <span>商品订单</span>
52
+          <i class="iconfont icon-jiantou-right"></i>
53
+        </div>
54
+        <div class="menu-item flex-h">
55
+          <span>体检报告</span>
56
+          <i class="iconfont icon-jiantou-right"></i>
57
+        </div>
58
+      </div>
59
+    </div>
60
+  </div>
61
+</template>
62
+
63
+<script>
64
+import loading from '../../../../common/icon/loading.gif'
65
+import { mapState, createNamespacedHelpers } from 'vuex'
66
+const { mapActions: actions } = createNamespacedHelpers('userCenter')
67
+export default {
68
+  name: '',
69
+  data () {
70
+    return {
71
+      user: {},
72
+      loading,
73
+      isLoading: true
74
+    }
75
+  },
76
+  computed: {
77
+    ...mapState({
78
+      userInfo: x => x.userCenter.userInfo,
79
+      org: x => x.app.orgId
80
+    })
81
+  },
82
+  components: {
83
+
84
+  },
85
+  created () {
86
+    this.getUserInfo({ org: this.org }).then((res) => {
87
+      this.user = this.userInfo.customer
88
+      this.AccountInfo = JSON.parse(this.user.AccountInfo)
89
+      this.headimgurl = this.AccountInfo.headimgurl
90
+      this.isLoading = false
91
+    }).catch((err) => {
92
+      console.log(err)
93
+    })
94
+  },
95
+  methods: {
96
+    ...actions(['getUserInfo']),
97
+    toLessonOrder () {
98
+      this.$router.push({ name: 'lessonOrder' })
99
+    },
100
+    toVip () {
101
+      this.$router.push({ name: 'vip' })
102
+    },
103
+    toCard () {
104
+      this.$router.push({ name: 'card' })
105
+    },
106
+    toCoupons () {
107
+      this.$router.push({ name: 'coupons' })
108
+    },
109
+    bindMobile () {
110
+      this.$router.push({ name: 'bindMobile' })
111
+    }
112
+  }
113
+}
114
+</script>
115
+
116
+<!-- Add "scoped" attribute to limit CSS to this component only -->
117
+<style lang="scss" scoped>
118
+@import "page.scss";
119
+</style>

+ 121
- 0
src/pages/user/mainPage/userCenter/page.scss Visa fil

@@ -0,0 +1,121 @@
1
+.mainPage{
2
+  overflow-y: scroll;
3
+  overflow-x: hidden;
4
+}
5
+
6
+.loading{
7
+  width: 100%;
8
+  height: 100%;
9
+  display: flex;
10
+  justify-content: center;
11
+  align-items: center;
12
+}
13
+
14
+.userTop_view {
15
+  position: relative;
16
+  height: 1.7rem;
17
+  margin-bottom: 1.3rem;
18
+  .gradient_bg {
19
+    position: absolute;
20
+    width: 100%;
21
+    height: 1.7rem;
22
+    background-image: linear-gradient(24deg, #fa508c 0%, #ffc86e 100%);
23
+    z-index: 2;
24
+  }
25
+  .zIndex_bg {
26
+    position: absolute;
27
+    bottom: -.6rem;
28
+    left: 0;
29
+    width: 120%;
30
+    height: .6rem;
31
+    transform: rotate(351.5deg);
32
+    transform-origin: bottom left;
33
+    z-index: 3;
34
+    background-color: #fff;
35
+  }
36
+  .userAvatar_Border {
37
+    position: absolute;
38
+    bottom: -0.25rem;
39
+    left: 50%;
40
+    border: 0.1rem solid rgba(255, 255, 255, 0.2);
41
+    transform: translateX(-50%);
42
+    width: 1rem;
43
+    height: 1rem;
44
+    z-index: 3;
45
+    border-radius: 50%;
46
+  }
47
+  .userAvatar {
48
+    width: 1rem;
49
+    height: 1rem;
50
+    background-color: #000;
51
+    box-sizing: border-box;
52
+    border-radius: 50%;
53
+    text-align: center;
54
+    img {
55
+      display: inline-block;
56
+      vertical-align: middle;
57
+      border-radius: 50%;
58
+    }
59
+  }
60
+  .uesr-info {
61
+    position: absolute;
62
+    bottom: -1rem;
63
+    left: 0;
64
+    width: 100%;
65
+    z-index: 4;
66
+    .user-name {
67
+      font-size: .24rem;
68
+      text-align: center;
69
+      color:rgba(0,0,0,1);
70
+    }
71
+    .mobile{
72
+      color:rgba(125,125,125,1);
73
+      font-size: .2rem;
74
+      padding-top: 10px;
75
+      text-align: center;
76
+    }
77
+  }
78
+}
79
+
80
+.vip-privilege{
81
+  height: 1.2rem;
82
+  margin: 0 .25rem;
83
+  background:rgba(255,255,255,1);
84
+  box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
85
+  border-radius:8px;
86
+  box-sizing: border-box;
87
+
88
+  .privilege-item {
89
+    display: flex;
90
+    flex-flow: column nowrap;
91
+    justify-content: center;
92
+    align-items: center;
93
+    .img-box {
94
+      width: 0.24rem;
95
+      height: 0.18rem;
96
+    }
97
+    span:nth-of-type(1){
98
+      font-size: .14rem;
99
+      color:rgba(102,102,102,1);
100
+      padding: 0.08rem 0 0.04rem;
101
+    }
102
+    span:nth-of-type(2){
103
+      font-size: 12px;
104
+      color:rgba(153,153,153,1);
105
+    }
106
+  }
107
+}
108
+
109
+.userCenter-menu{
110
+  padding: 0.2rem 0.25rem;;
111
+  box-sizing: border-box;
112
+  .menu-item{
113
+    justify-content: space-between;
114
+    padding: 0.1rem 0.05rem;
115
+    border-bottom: 1px solid rgba(242,242,242,1);
116
+    span,i{
117
+      font-size: .14rem;
118
+      color:rgba(102,102,102,1);
119
+    }
120
+  }
121
+}

+ 221
- 0
src/pages/user/majorProjects/index.vue Visa fil

@@ -0,0 +1,221 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <div class="banner">
4
+      <div>
5
+        <swiper :options="swiperOption" ref="mySwiper">
6
+          <swiper-slide class="swiper-slide" v-for="(item,index) in projectInfo.CmsCaseImgs" :key="index">
7
+            <img :src='item.CaseImageUrl' class="cover" alt="">
8
+          </swiper-slide>
9
+        </swiper>
10
+      </div>
11
+    </div>
12
+    <p>{{projectInfo.DetailContent}}</p>
13
+    <div class="list flex-h">
14
+      <div class="flex-item">
15
+        <div v-for="(item,index) in courseList" :key="index">
16
+          <span>{{item.month+1}}月</span>
17
+          <ul>
18
+            <router-link tag="li" v-for="(subItem,subIndex) in item.list" :key="subIndex" :to="{name: 'majorProjectsDetail', query: {id: subItem.id}}" class="flex-h">
19
+              <div class="flex-item">
20
+                <div>
21
+                  <courseItem :data="subItem"></courseItem>
22
+                </div>
23
+              </div>
24
+            </router-link>
25
+          </ul>
26
+        </div>
27
+        <div class="cutLine"></div>
28
+        <div>
29
+          <span>关注我们</span>
30
+          <ul>
31
+            <li class="flex-h">
32
+              <div class="bottom flex-item flex-h">
33
+                <div class="flex-item flex-h">
34
+                  <div class="flex-item">
35
+                    <div>
36
+                      <span class="centerLabel">长按右方二维码<br>关注“城的空间”公众号</span>
37
+                    </div>
38
+                  </div>
39
+                  <div class="qrCode">
40
+                    <a><img src="" class="centerLabel cover" alt=""></a>
41
+                  </div>
42
+                </div>
43
+              </div>
44
+            </li>
45
+          </ul>
46
+        </div>
47
+      </div>
48
+    </div>
49
+  </div>
50
+</template>
51
+
52
+<script>
53
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
54
+import 'swiper/dist/css/swiper.css'
55
+import { mapState, createNamespacedHelpers } from 'vuex'
56
+const { mapActions: mapProjectActions, mapState: mapProjectState } = createNamespacedHelpers('majorProjects')
57
+import courseItem from '../../../components/courseItem/index'
58
+
59
+export default {
60
+  name: '',
61
+  data () {
62
+    return {
63
+      swiperOption: {
64
+        observer: true,
65
+        autoplay: {
66
+          disableOnInteraction: false,
67
+        }
68
+      },
69
+      courseList: [], // 课程列表
70
+      initList: [
71
+        // { // 初始化课程列表
72
+        //   id: '',
73
+        //   title: '课程名称',
74
+        //   img: '',
75
+        //   time: '2018.04.04 18:30-20:00',
76
+        //   address: '南京南',
77
+        //   tag: ['儿童教育', '小小外交官'],
78
+        //   courseType: '团体课',
79
+        //   defaultPrice: '168/节',
80
+        //   getWay: 'ticket',
81
+        //   startDate: 1514779200000,
82
+        //   endDate: 1514781600000,
83
+        // }, {
84
+        //   id: '',
85
+        //   title: '课程名称',
86
+        //   img: '',
87
+        //   time: '2018.04.04 18:30-20:00',
88
+        //   address: '南京南',
89
+        //   tag: ['儿童教育', '小小外交官'],
90
+        //   courseType: '团体课',
91
+        //   defaultPrice: '168/节',
92
+        //   getWay: 'ticket',
93
+        //   startDate: 1514779200000,
94
+        //   endDate: 1514781600000,
95
+        // }, {
96
+        //   id: '',
97
+        //   title: '课程名称',
98
+        //   img: '',
99
+        //   time: '2018.04.04 18:30-20:00',
100
+        //   address: '南京南',
101
+        //   tag: ['儿童教育', '小小外交官'],
102
+        //   courseType: '团体课',
103
+        //   defaultPrice: '168/节',
104
+        //   getWay: 'ticket',
105
+        //   startDate: 1517460000000,
106
+        //   endDate: 1517467200000,
107
+        // }, {
108
+        //   id: '',
109
+        //   title: '课程名称',
110
+        //   img: '',
111
+        //   time: '2018.04.04 18:30-20:00',
112
+        //   address: '南京南',
113
+        //   tag: ['儿童教育', '小小外交官'],
114
+        //   courseType: '团体课',
115
+        //   defaultPrice: '168/节',
116
+        //   getWay: 'ticket',
117
+        //   startDate: 1517460000000,
118
+        //   endDate: 1517467200000,
119
+        // }
120
+      ],
121
+    }
122
+  },
123
+  computed: {
124
+    ...mapState({
125
+      orgid: x => x.app.orgId,
126
+      fiveA: x => x.index.fiveA,
127
+      banner: x => x.index.banner,
128
+      message: x => x.index.message,
129
+      project: x => x.index.project,
130
+      cms: x => x.index.cms,
131
+    }),
132
+    ...mapProjectState({
133
+      projectInfo: x => x.projectInfo
134
+    }),
135
+    MySwiper () {
136
+      return this.$refs.mySwiper.swiper
137
+    },
138
+  },
139
+  components: {
140
+    courseItem,
141
+    swiper,
142
+    swiperSlide,
143
+  },
144
+  created () {
145
+    this.initData()
146
+  },
147
+  methods: {
148
+    ...mapProjectActions([
149
+      'getProjectInfo',
150
+    ]),
151
+    returnTag (arr) {
152
+      var aArr = []
153
+      for (var n = 0; n < arr.length; n++) {
154
+        aArr.push(arr[n].TagName)
155
+      }
156
+      return aArr
157
+    },
158
+    returnNum (val) {
159
+      return val > 9 ? val : '0' + val
160
+    },
161
+    returnDate (val) {
162
+      val = new Date(val)
163
+      return val.getFullYear() + '.' + this.returnNum(val.getMonth()+1) + '.' + this.returnNum(val.getDate())
164
+    },
165
+    initData () { // 初始化数据
166
+      this.getProjectInfo({ id: this.$route.query.id }).then((res) => {
167
+        // console.log(JSON.stringify(res))
168
+        // this.initList
169
+        var aArr = []
170
+        for (var n = 0; n < res.Courses.length; n++) {
171
+          aArr.push({
172
+            id: res.Courses[n].CourseId,
173
+            title: res.Courses[n].CourseName,
174
+            img: res.Courses[n].CourseImg,
175
+            time: this.returnDate(res.Courses[n].BeginDate) + '至' + this.returnDate(res.Courses[n].EndDate),
176
+            address: res.CaseAddress == undefined ? '暂无数据' : res.CaseAddress,
177
+            tag: this.returnTag(res.Courses[n].CourseTags),
178
+            courseType: '团体课',
179
+            defaultPrice: res.Courses[n].Price + '/节',
180
+            getWay: 'ticket',
181
+            startDate: new Date(res.Courses[n].BeginDate).getTime(),
182
+            endDate: new Date(res.Courses[n].EndDate).getTime(),
183
+          })
184
+        }
185
+        this.initList = aArr
186
+        this.calcArr()
187
+      })
188
+    },
189
+    calcArr () {
190
+      let arr = []
191
+      for (var n = 0; n < this.initList.length; n++) {
192
+        arr.push(new Date(this.initList[n].startDate).getMonth())
193
+      }
194
+      for (var i = 0; i < arr.length; i++) {
195
+        if (arr.indexOf(arr[i]) !== i) {
196
+          arr.splice(i, 1)
197
+          i--
198
+        }
199
+      }
200
+      for (var i = 0; i < arr.length; i++) {
201
+        this.courseList.push({
202
+          month: arr[i],
203
+          list: []
204
+        })
205
+      }
206
+      for (var n = 0; n < this.initList.length; n++) {
207
+        for (var i = 0; i < this.courseList.length; i++) {
208
+          if (new Date(this.initList[n].startDate).getMonth() === this.courseList[i].month) {
209
+            this.courseList[i].list.push(this.initList[n])
210
+          }
211
+        }
212
+      }
213
+    },
214
+  }
215
+}
216
+</script>
217
+
218
+<!-- Add "scoped" attribute to limit CSS to this component only -->
219
+<style lang="scss" scoped>
220
+@import "page.scss";
221
+</style>

+ 151
- 0
src/pages/user/majorProjects/page.scss Visa fil

@@ -0,0 +1,151 @@
1
+.mainPage{
2
+  background: #fff;
3
+  overflow-y: scroll;
4
+  -webkit-overflow-scrolling: touch;
5
+  transform: translateZ(0);
6
+  -webkit-transform: translateZ(0);
7
+  .banner{
8
+    width: 100%;
9
+    height: 0;
10
+    padding-bottom: 65%;
11
+    background: #eee;
12
+    position: relative;
13
+    overflow: hidden;
14
+    >div{
15
+      width: 100%;
16
+      position: absolute;
17
+      left: 0;
18
+      top: 0;
19
+      bottom: 0;
20
+      >div{
21
+        width: 100%;
22
+        position: absolute;
23
+        left: 0;
24
+        top: 0;
25
+        bottom: 0;
26
+      }
27
+    }
28
+  }
29
+  p{
30
+    width: 100%;
31
+    box-sizing: border-box;
32
+    border-left: .2rem solid transparent;
33
+    border-right: .2rem solid transparent;
34
+    line-height: .25rem;
35
+    font-size: .16rem;
36
+    color: #555;
37
+    margin: .22rem auto 0;
38
+  }
39
+  .list{
40
+    margin: .34rem auto 0;
41
+    overflow: visible;
42
+    .cutLine{
43
+      box-sizing: border-box;
44
+      height: .7rem;
45
+      border-left: .01rem dashed #b57f4e;
46
+      margin: 0 auto;
47
+      &::after{
48
+        display: none;
49
+      }
50
+    }
51
+    &>div.flex-item{
52
+      margin: 0 .2rem;
53
+      overflow: visible;
54
+      &>div{
55
+        width: 100%;
56
+        position: relative;
57
+        overflow: visible;
58
+        padding-bottom: .4rem;
59
+        &::after{
60
+          content: '';
61
+          width: .01rem;
62
+          height: 100%;
63
+          background: #b57f4e;
64
+          position: absolute;
65
+          left: 0;
66
+          top: 0;
67
+          z-index: 1;
68
+        }
69
+        &>span{
70
+          display: inline-block;
71
+          line-height: .3rem;
72
+          color: #fff;
73
+          padding: 0 .2rem;
74
+          background: #b57f4e;
75
+          font-size: .15rem;
76
+          border-top-right-radius: .3rem;
77
+          border-bottom-right-radius: .3rem;
78
+        }
79
+        &>ul{
80
+          box-sizing: border-box;
81
+          border-left: .2rem solid transparent;
82
+          &>li{
83
+            margin: .2rem auto 0;
84
+            position: relative;
85
+            overflow: visible;
86
+            box-shadow: 0 0 .2rem .02rem rgba(0, 0, 0, .1);
87
+            border-radius: .06rem;
88
+            padding: .1rem 0;
89
+            &::after{
90
+              content: '';
91
+              width: .15rem;
92
+              height: .15rem;
93
+              border: .01rem solid #b57f4e;
94
+              position: absolute;
95
+              left: -.28rem;
96
+              top: 50%;
97
+              transform: translateY(-50%);
98
+              -webkit-transform: translateY(-50%);
99
+              background: #fff;
100
+              z-index: 2;
101
+              border-radius: 100%;
102
+            }
103
+            &::before{
104
+              content: '';
105
+              width: .09rem;
106
+              height: .09rem;
107
+              position: absolute;
108
+              left: -.24rem;
109
+              top: 50%;
110
+              transform: translateY(-50%);
111
+              -webkit-transform: translateY(-50%);
112
+              background: #b57f4e;
113
+              z-index: 3;
114
+              border-radius: 100%;
115
+            }
116
+            &>div{
117
+              margin: 0 .1rem;
118
+              &.bottom{
119
+                &>div{
120
+                  &>div{
121
+                    margin-right: .2rem;
122
+                    span{
123
+                      width: 100%;
124
+                      text-align: center;
125
+                      border-right: .01rem dashed #ccc;
126
+                      line-height: .2rem;
127
+                      font-size: .11rem;
128
+                    }
129
+                  }
130
+                }
131
+              }
132
+            }
133
+            .qrCode{
134
+              width: .7rem;
135
+              position: relative;
136
+              overflow: hidden;
137
+              a{
138
+                width: 100%;
139
+                display: block;
140
+                padding-bottom: 100%;
141
+                background: #eee;
142
+                position: relative;
143
+                overflow: hidden;
144
+              }
145
+            }
146
+          }
147
+        }
148
+      }
149
+    }
150
+  }
151
+}

+ 145
- 0
src/pages/user/majorProjectsDetail/index.vue Visa fil

@@ -0,0 +1,145 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="flex-item">
4
+      <div class="content">
5
+        <div class="banner">
6
+          <div class="scrollImg">
7
+            <swiper :options="swiperOption" ref="mySwiper">
8
+              <swiper-slide class="swiper-slide" v-for="(item,index) in courseDetail.CourseImgs" :key="index">
9
+                <img :src='item.ImgUrl' class="cover" alt="">
10
+              </swiper-slide>
11
+            </swiper>
12
+          </div>
13
+          <div>
14
+            <span>{{courseDetail.CourseName}}</span>
15
+            <div>
16
+              <span>¥<em>{{courseDetail.Price}}</em>起/课时</span>
17
+              <span>参与者<em>{{courseDetail.SignupNum}}</em>/{{courseDetail.MaxNum}}人</span>
18
+            </div>
19
+          </div>
20
+        </div>
21
+        <div class="subContent time">
22
+          <h5>时间</h5>
23
+          <span>{{returnDate(courseDetail.BeginDate)}}~{{returnDate(courseDetail.EndDate)}}</span>
24
+          <div class="list flex-h">
25
+            <div class="flex-item">
26
+              <ul :class="{'show':showMoreCourse}">
27
+                <li v-for="(item,index) in courseTimeList" :key="index">{{returnCourseTime(item.BeginDate,item.EndDate)}}</li>
28
+              </ul>
29
+              <a class="moreCourse" @click="triggerCourseTime">
30
+                {{showMoreCourse ? '收起' : '更多'}}
31
+                <i v-if="!showMoreCourse" class="iconfont icon-jiantou-down"></i>
32
+                <i v-if="showMoreCourse" class="iconfont icon-jiantou-up"></i>
33
+              </a>
34
+            </div>
35
+          </div>
36
+        </div>
37
+        <div style="width:100%;height:.1rem;background:#ebf1f2;"></div>
38
+        <div class="subContent address">
39
+          <h5>地点</h5>
40
+          <div class="flex-h">
41
+            <div class="flex-item">
42
+              <div class="img">
43
+                <router-link :to="{name: '', query: {}}">
44
+                  <img :src="courseDetail.CaseInfo.CaseIcon" class="centerLabel cover" alt="">
45
+                  <div class="flex-h">
46
+                    <i class="iconfont icon-dingwei"></i>
47
+                    <div class="flex-item">
48
+                      <div>
49
+                        <span>{{courseDetail.CaseInfo.CaseName}}({{courseDetail.CaseInfo.CaseAddress}})</span>
50
+                      </div>
51
+                    </div>
52
+                  </div>
53
+                </router-link>
54
+              </div>
55
+            </div>
56
+          </div>
57
+        </div>
58
+      </div>
59
+    </div>
60
+    <div class="flex-h">
61
+      <div class="flex-item">
62
+        <div>
63
+          <span>总计¥<em>{{courseDetail.Price}}</em></span>
64
+          <span>优惠券体验</span>
65
+        </div>
66
+      </div>
67
+      <router-link :to="{name: 'placeOrderForCourse', query: {id: courseDetail.CourseId}}">去购买</router-link>
68
+    </div>
69
+  </div>
70
+</template>
71
+
72
+<script>
73
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
74
+import 'swiper/dist/css/swiper.css'
75
+import { mapState, createNamespacedHelpers } from 'vuex'
76
+const { mapActions: mapProjectActions, mapState: mapProjectState } = createNamespacedHelpers('majorProjects')
77
+
78
+export default {
79
+  name: '',
80
+  data () {
81
+    return {
82
+      swiperOption: {
83
+        observer: true,
84
+        autoplay: {
85
+          disableOnInteraction: false,
86
+        }
87
+      },
88
+      showMoreCourse: false, // 显隐更多课程时间
89
+      courseTimeList: [], // 课程时间
90
+    }
91
+  },
92
+  computed: {
93
+    ...mapState({
94
+      orgid: x => x.app.orgId,
95
+      fiveA: x => x.index.fiveA,
96
+      banner: x => x.index.banner,
97
+      message: x => x.index.message,
98
+      project: x => x.index.project,
99
+      cms: x => x.index.cms,
100
+    }),
101
+    ...mapProjectState({
102
+      courseDetail: x => x.courseDetail
103
+    }),
104
+    MySwiper () {
105
+      return this.$refs.mySwiper.swiper
106
+    },
107
+  },
108
+  components: {
109
+    swiper,
110
+    swiperSlide,
111
+  },
112
+  created () {
113
+    this.getCourseDetailInfo({ id: this.$route.query.id }).then((res) => {
114
+      var arr = res.CourseDetail
115
+      this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
116
+      console.log(JSON.stringify(this.courseTimeList))
117
+    })
118
+  },
119
+  methods: {
120
+    ...mapProjectActions([
121
+      'getCourseDetailInfo',
122
+    ]),
123
+    returnCourseTime (val,endVal) { // 返回课时时间
124
+      val = new Date(val)
125
+      endVal = new Date(endVal)
126
+      return this.returnNum(val.getMonth() + 1) + '/' + this.returnNum(val.getDate()) + ' 周' + '日一二三四五六'.split('')[new Date(val).getDay()] + ' ' + this.returnNum(val.getHours()) + ':' + this.returnNum(val.getMinutes()) + '~' + this.returnNum(endVal.getHours()) + ':' + this.returnNum(endVal.getMinutes())
127
+    },
128
+    returnNum (val) {
129
+      return val > 9 ? val : '0' + val
130
+    },
131
+    returnDate (val) {
132
+      val = new Date(val)
133
+      return val.getFullYear() + '年' + this.returnNum(val.getMonth() + 1) + '月' + this.returnNum(val.getDate()) + '日'
134
+    },
135
+    triggerCourseTime () { // 显隐更多课程时间
136
+      this.showMoreCourse = !this.showMoreCourse
137
+    },
138
+  }
139
+}
140
+</script>
141
+
142
+<!-- Add "scoped" attribute to limit CSS to this component only -->
143
+<style lang="scss" scoped>
144
+@import "page.scss";
145
+</style>

+ 247
- 0
src/pages/user/majorProjectsDetail/page.scss Visa fil

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

+ 135
- 0
src/pages/user/orderList/index.vue Visa fil

@@ -0,0 +1,135 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="top">
4
+      <topCaseInfo :data="topCaseInfoData"></topCaseInfo>
5
+    </div>
6
+    <div class="flex-item">
7
+      <div class="flex-h">
8
+        <div class="flex-item">
9
+          <ul>
10
+            <li v-for="(item,index) in list" :key="index">
11
+              <orderListItem :data="item"></orderListItem>
12
+            </li>
13
+          </ul>
14
+        </div>
15
+      </div>
16
+    </div>
17
+  </div>
18
+</template>
19
+
20
+<script>
21
+import topCaseInfo from '../../../components/topCaseInfo/index'
22
+import orderListItem from '../../../components/orderListItem/index'
23
+
24
+export default {
25
+  name: '',
26
+  data () {
27
+    return {
28
+      topCaseInfoData: {
29
+        caseName: 'xxx',
30
+        caseId: '',
31
+        showSelect: false,
32
+        userName: 'xxx'
33
+      },
34
+      list: [{
35
+        status: 0,
36
+        caseName: '案场名称',
37
+        creatTime: '02/16 14:20',
38
+        goodsList: [{
39
+          name: '商品名称1',
40
+          specName: '加冰',
41
+          price: null,
42
+          specPrice: 20,
43
+          num: null,
44
+          specNum: 2,
45
+        },{
46
+          name: '商品名称2',
47
+          specName: null,
48
+          price: 100,
49
+          specPrice: null,
50
+          num: 1,
51
+          specNum: null,
52
+        },{
53
+          name: '商品名称3',
54
+          specName: null,
55
+          price: 100,
56
+          specPrice: null,
57
+          num: 1,
58
+          specNum: null,
59
+        },{
60
+          name: '商品名称4',
61
+          specName: null,
62
+          price: 100,
63
+          specPrice: null,
64
+          num: 1,
65
+          specNum: null,
66
+        },{
67
+          name: '商品名称5',
68
+          specName: null,
69
+          price: 100,
70
+          specPrice: null,
71
+          num: 1,
72
+          specNum: null,
73
+        },{
74
+          name: '商品名称6',
75
+          specName: null,
76
+          price: 100,
77
+          specPrice: null,
78
+          num: 1,
79
+          specNum: null,
80
+        }],
81
+      },{
82
+        status: 1,
83
+        caseName: '案场名称',
84
+        creatTime: '02/16 14:20',
85
+        goodsList: [{
86
+          name: '商品名称1',
87
+          specName: '加冰',
88
+          price: null,
89
+          specPrice: 20,
90
+          num: null,
91
+          specNum: 2,
92
+        }],
93
+      },{
94
+        status: 2,
95
+        caseName: '案场名称',
96
+        creatTime: '02/16 14:20',
97
+        goodsList: [{
98
+          name: '商品名称1',
99
+          specName: '加冰',
100
+          price: null,
101
+          specPrice: 20,
102
+          num: null,
103
+          specNum: 2,
104
+        }],
105
+      },{
106
+        status: 0,
107
+        caseName: '案场名称',
108
+        creatTime: '02/16 14:20',
109
+        goodsList: [{
110
+          name: '商品名称1',
111
+          specName: '加冰',
112
+          price: null,
113
+          specPrice: 20,
114
+          num: null,
115
+          specNum: 2,
116
+        }],
117
+      }],
118
+    }
119
+  },
120
+  computed: {},
121
+  components: {
122
+    topCaseInfo,
123
+    orderListItem,
124
+  },
125
+  created () { },
126
+  methods: {
127
+    
128
+  }
129
+}
130
+</script>
131
+
132
+<!-- Add "scoped" attribute to limit CSS to this component only -->
133
+<style lang="scss" scoped>
134
+@import "page.scss";
135
+</style>

+ 150
- 0
src/pages/user/orderList/page.scss Visa fil

@@ -0,0 +1,150 @@
1
+.mainPage{
2
+  &>div.flex-item{
3
+    &>div{
4
+      width: 100%;
5
+      position: absolute;
6
+      left: 0;
7
+      top: 0;
8
+      bottom: 0;
9
+      overflow-y: scroll;
10
+      -webkit-overflow-scrolling: touch;
11
+      transform: translateZ(0);
12
+      -webkit-transform: translateZ(0);
13
+      &>div{
14
+        margin: 0 .25rem;
15
+        overflow: visible;
16
+        &>ul{
17
+          width: 100%;
18
+          position: relative;
19
+          overflow: visible;
20
+          margin-bottom: .25rem;
21
+          &>li{
22
+            width: 100%;
23
+            position: relative;
24
+            overflow: hidden;
25
+            border-radius: .1rem;
26
+            background: #fff;
27
+            box-shadow: 0 0 .2rem .02rem rgba(0, 0, 0, .1);
28
+            padding: .08rem 0;
29
+            margin: .25rem auto 0;
30
+            // .title{
31
+            //   width: 100%;
32
+            //   position: relative;
33
+            //   overflow: hidden;
34
+            //   align-items: center;
35
+            //   &>div:nth-child(1){
36
+            //     width: .5rem;
37
+            //     text-align: center;
38
+            //     *{
39
+            //       display: inline-block;
40
+            //       font-size: .1rem;
41
+            //       line-height: .17rem;
42
+            //     }
43
+            //     i{
44
+            //       font-size: .15rem;
45
+            //     }
46
+            //   }
47
+            //   &>div:nth-child(1).orange{
48
+            //     *{
49
+            //       color: #fc6243;
50
+            //     }
51
+            //   }
52
+            //   &>div:nth-child(1).grey{
53
+            //     *{
54
+            //       color: #ccc;
55
+            //     }
56
+            //   }
57
+            //   &>div:nth-child(1).green{
58
+            //     *{
59
+            //       color: #63c86f;
60
+            //     }
61
+            //   }
62
+            //   &>div:nth-child(2){
63
+            //     margin-right: .1rem;
64
+            //     &>div{
65
+            //       width: 100%;
66
+            //       position: relative;
67
+            //       overflow: hidden;
68
+            //       span{
69
+            //         width: 100%;
70
+            //         display: block;
71
+            //         font-size: .14rem;
72
+            //         overflow: hidden;
73
+            //         text-overflow: ellipsis;
74
+            //         white-space: nowrap;
75
+            //       }
76
+            //     }
77
+            //   }
78
+            //   &>span{
79
+            //     font-size: .11rem;
80
+            //     color: #666;
81
+            //     margin-right: .15rem;
82
+            //   }
83
+            // }
84
+            // .line{
85
+            //   width: 100%;
86
+            //   height: .2rem;
87
+            //   position: relative;
88
+            //   overflow: hidden;
89
+            //   &>div{
90
+            //     width: 100%;
91
+            //     position: absolute;
92
+            //     overflow: hidden;
93
+            //     left: 0;
94
+            //     top: 50%;
95
+            //     transform: translateY(-50%) translateX(-.035rem);
96
+            //     -webkit-transform: translateY(-50%) translateX(-.035rem);
97
+            //     font-size: 0;
98
+            //     white-space: nowrap;
99
+            //     i{
100
+            //       display: inline-block;
101
+            //       width: .07rem;
102
+            //       height: .07rem;
103
+            //       position: relative;
104
+            //       overflow: hidden;
105
+            //       border-radius: 100%;
106
+            //       background: #eee;
107
+            //       margin-right: .1rem;
108
+            //     }
109
+            //   }
110
+            // }
111
+            // .list{
112
+            //   &>div{
113
+            //     margin: 0 .15rem;
114
+            //     &>ul{
115
+            //       margin: .06rem auto;
116
+            //       &>li{
117
+            //         font-size: 0;
118
+            //         white-space: nowrap;
119
+            //         &>*{
120
+            //           display: inline-block;
121
+            //           vertical-align: middle;
122
+            //           width: 50%;
123
+            //           overflow: hidden;
124
+            //           text-overflow: ellipsis;
125
+            //           white-space: nowrap;
126
+            //         }
127
+            //         &>span{
128
+            //           line-height: .26rem;
129
+            //           font-size: .14rem;
130
+            //           color: #555;
131
+            //         }
132
+            //         &>div{
133
+            //           text-align: right;
134
+            //           font-size: 0;
135
+            //           span{
136
+            //             font-size: .11rem;
137
+            //             line-height: .26rem;
138
+            //             color: #666;
139
+            //           }
140
+            //         }
141
+            //       }
142
+            //     }
143
+            //   }
144
+            // }
145
+          }
146
+        }
147
+      }
148
+    }
149
+  }
150
+}

+ 308
- 0
src/pages/user/placeOrder/index.vue Visa fil

@@ -0,0 +1,308 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <div class="flex-item flex-v">
4
+      <div class="banner">
5
+        <img src="" class="centerLabel cover" alt="">
6
+        <div class="bannerInfo flex-h">
7
+          <div class="flex-item">
8
+            <div>
9
+              <span>项目名称:xxxx</span>
10
+            </div>
11
+          </div>
12
+          <span>xxx您好!</span>
13
+        </div>
14
+      </div>
15
+      <div class="tableInfo flex-h">
16
+        <div class="flex-item">
17
+          <div>
18
+            <span>桌号:案场11号桌</span>
19
+            <span>本月已用:150杯</span>
20
+          </div>
21
+        </div>
22
+        <router-link :to="{name: 'coffeeIndex', query: {}}">返回选择桌号</router-link>
23
+      </div>
24
+      <div class="content flex-item flex-h">
25
+        <div class="slideMenus">
26
+          <div>
27
+            <ul>
28
+              <li v-for="(item,index) in menuList" :key="index" :class="{'active': slideMenusActive == index}" @click="cutMenu(index)">
29
+                <span>{{item.value}}</span>
30
+                <span>{{item.eValue}}</span>
31
+              </li>
32
+            </ul>
33
+          </div>
34
+        </div>
35
+        <div class="flex-item">
36
+          <div>
37
+            <swiper :options="swiperOption" ref="mySwiper">
38
+              <swiper-slide class="swiper-slide" v-for="(item,index) in menuList" :key="index">
39
+                <div class="flex-v">
40
+                  <h4>{{item.value + ' ' + item.eValue}}</h4>
41
+                  <div class="flex-item">
42
+                    <div>
43
+                      <swiper :options="subSwiperOption" ref="mySubSwiper">
44
+                        <swiper-slide class="swiper-slide" v-for="(subItem,subIndex) in item.list" :key="subIndex">
45
+                          <orderItem :data="subItem" @returnData="calcMenus" @selectSpec="selectSpec"></orderItem>
46
+                        </swiper-slide>
47
+                      </swiper>
48
+                    </div>
49
+                  </div>
50
+                </div>
51
+              </swiper-slide>
52
+            </swiper>
53
+          </div>
54
+        </div>
55
+      </div>
56
+    </div>
57
+    <div class="flex-h">
58
+      <div class="flex-item">
59
+        <div>
60
+          <span>总计</span>
61
+          <span>{{totalNum}}</span>
62
+          <span>杯</span>
63
+          <span>共</span>
64
+          <span>{{totalPrice}}</span>
65
+          <span>元</span>
66
+          <i class="iconfont" :class="{'icon-jiantou-up': !showCalcMenu,'icon-jiantou-down': showCalcMenu}" @click="showCalcMenu = true"></i>
67
+        </div>
68
+      </div>
69
+      <router-link :to="{name: 'placeOrderDetail', query: {info: JSON.stringify(settlementList)}}">下单</router-link>
70
+      <!-- <a @click="showCalcMenu = true">下单</a> -->
71
+    </div>
72
+    <orderPopup :show="showPopup" :data="currentSpec" @closePopup="closePopup" @returnData="calcMenus"></orderPopup>
73
+    <calcMenu :show="showCalcMenu" :totalNum="totalCupNum" :data="settlementList" @returnData="calcMenus" @emptyMenus="emptyMenus" @closeCalcMenu="closeCalcMenu" @placeOrder="placeOrder"></calcMenu>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import orderItem from '../../../components/orderItem/index'
79
+import orderPopup from '../../../components/orderPopup/index'
80
+import calcMenu from '../../../components/calcMenu/index'
81
+import { swiper, swiperSlide } from 'vue-awesome-swiper'
82
+import 'swiper/dist/css/swiper.css'
83
+
84
+export default {
85
+  name: '',
86
+  data () {
87
+    const _self = this
88
+    return {
89
+      totalCupNum: 0, // 共计使用杯数
90
+      showCalcMenu: false, // 显隐已点菜单弹窗
91
+      currentSpec: null, // 当前选择规格
92
+      showPopup: false, // 显隐选规格弹窗
93
+      totalNum: 0, // 总杯数
94
+      totalPrice: 0, // 总价格
95
+      settlementList: [], // 商品选择清单
96
+      slideMenusActive: 0, // 左侧菜单选中索引值
97
+      menuList: [{ // 商品数据
98
+        value: '咖啡',
99
+        eValue: 'Coffee',
100
+        id: '1',
101
+        status: 1,
102
+        list: [{
103
+          img: '',
104
+          name: '商品名称',
105
+          id: '1-1',
106
+          status: 1,
107
+          spec: [{
108
+            value: '去冰',
109
+            id: '1-1-1',
110
+            num: 0,
111
+            status: 0,
112
+            price: '10',
113
+          }, {
114
+            value: '少冰',
115
+            id: '1-1-2',
116
+            num: 0,
117
+            status: 1,
118
+            price: '15',
119
+          }, {
120
+            value: '正常',
121
+            id: '1-1-3',
122
+            num: 0,
123
+            status: 1,
124
+            price: '20',
125
+          }, {
126
+            value: '多冰',
127
+            id: '1-1-4',
128
+            num: 0,
129
+            status: 1,
130
+            price: '25',
131
+          }],
132
+          price: '100',
133
+        }, {
134
+          img: '',
135
+          name: '商品名称',
136
+          id: '1-2',
137
+          spec: [],
138
+          status: 0,
139
+          price: '100',
140
+        }, {
141
+          img: '',
142
+          name: '商品名称',
143
+          id: '1-3',
144
+          spec: [],
145
+          status: 1,
146
+          price: '100',
147
+        }, {
148
+          img: '',
149
+          name: '商品名称',
150
+          id: '1-4',
151
+          spec: [],
152
+          status: 1,
153
+          price: '100',
154
+        }, {
155
+          img: '',
156
+          name: '商品名称',
157
+          id: '1-5',
158
+          spec: [],
159
+          status: 1,
160
+          price: '100',
161
+        }, {
162
+          img: '',
163
+          name: '商品名称',
164
+          id: '1-6',
165
+          spec: [],
166
+          status: 1,
167
+          price: '100',
168
+        }],
169
+      }, {
170
+        value: '咖啡一',
171
+        eValue: 'Coffee',
172
+        id: '2',
173
+        status: 1,
174
+        list: [],
175
+      }, {
176
+        value: '咖啡二',
177
+        eValue: 'Coffee',
178
+        id: '3',
179
+        status: 1,
180
+        list: [],
181
+      }, {
182
+        value: '咖啡三',
183
+        eValue: 'Coffee',
184
+        id: '4',
185
+        status: 1,
186
+        list: [],
187
+      }, {
188
+        value: '咖啡四',
189
+        eValue: 'Coffee',
190
+        id: '5',
191
+        status: 1,
192
+        list: [],
193
+      }],
194
+      swiperOption: {
195
+        observer: true,
196
+        direction: 'vertical',
197
+        on: {
198
+          transitionEnd () {
199
+            _self.slideMenusActive = this.activeIndex
200
+          },
201
+        }
202
+      },
203
+      subSwiperOption: {
204
+        observer: true,
205
+        direction: 'vertical',
206
+        nested: true,
207
+        slidesPerView: 'auto',
208
+        freeMode: true,
209
+        freeModeMomentumVelocityRatio: 2,
210
+      },
211
+    }
212
+  },
213
+  computed: {
214
+    MySwiper () {
215
+      return this.$refs.mySwiper.swiper
216
+    },
217
+    MySubSwiper () {
218
+      return this.$refs.mySubSwiper.swiper
219
+    },
220
+  },
221
+  components: {
222
+    swiper,
223
+    swiperSlide,
224
+    orderItem,
225
+    orderPopup,
226
+    calcMenu,
227
+  },
228
+  created () { },
229
+  methods: {
230
+    placeOrder () { // 下单
231
+      this.$router.push({name: 'orderList', query: {}})
232
+    },
233
+    closeCalcMenu () { // 关闭已选菜单
234
+      this.showCalcMenu = false
235
+    },
236
+    emptyMenus () { // 清空菜单
237
+      this.settlementList = []
238
+    },
239
+    closePopup () { // 关闭规格弹窗
240
+      this.showPopup = false
241
+      this.currentSpec = null
242
+    },
243
+    selectSpec (val) { // 选规格
244
+      this.currentSpec = val
245
+      this.showPopup = true
246
+    },
247
+    cutMenu (index) { // 切换菜单
248
+      this.MySwiper.slideTo(index, 300)
249
+    },
250
+    calcMenus (val) { // 计算清单
251
+      var bool = true, arr = this.settlementList.slice()
252
+      if (val.specId === null) {
253
+        for (var n = 0; n < arr.length; n++) {
254
+          if (arr[n].id === val.id && arr[n].specId === null) {
255
+            bool = false
256
+            arr[n] = val
257
+          }
258
+        }
259
+        if (bool) {
260
+          arr.push(val)
261
+        }
262
+      } else {
263
+        for (var n = 0; n < arr.length; n++) {
264
+          if (arr[n].specId === val.specId) {
265
+            bool = false
266
+            arr[n] = val
267
+          }
268
+        }
269
+        if (bool) {
270
+          arr.push(val)
271
+        }
272
+      }
273
+      for (var n = 0; n < arr.length; n++) {
274
+        if (arr[n].num === 0 || arr[n].defaultNum === 0) {
275
+          arr.splice(n, 1)
276
+        }
277
+      }
278
+      this.settlementList = arr
279
+      // console.log(JSON.stringify(this.settlementList))
280
+      this.calcTotalNum()
281
+    },
282
+    calcTotalNum () { // 计算总数量、价格
283
+      var num = 0, price = 0
284
+      if (!this.settlementList.length) {
285
+        this.totalNum = 0
286
+        this.totalPrice = 0
287
+        return
288
+      }
289
+      for (var n = 0; n < this.settlementList.length; n++) {
290
+        if (this.settlementList[n].specId === null) {
291
+          num += this.settlementList[n].defaultNum
292
+          price += this.settlementList[n].defaultPrice * this.settlementList[n].defaultNum
293
+        } else {
294
+          num += this.settlementList[n].num
295
+          price += this.settlementList[n].price * this.settlementList[n].num
296
+        }
297
+      }
298
+      this.totalNum = num
299
+      this.totalPrice = price
300
+    },
301
+  }
302
+}
303
+</script>
304
+
305
+<!-- Add "scoped" attribute to limit CSS to this component only -->
306
+<style lang="scss" scoped>
307
+@import "page.scss";
308
+</style>

+ 0
- 0
src/pages/user/placeOrder/page.scss Visa fil


Vissa filer visades inte eftersom för många filer har ändrats