浏览代码

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/wechat into dev

许成详 6 年前
父节点
当前提交
e07f6dee0c

+ 1
- 0
package.json 查看文件

23
     "exif-js": "^2.3.0",
23
     "exif-js": "^2.3.0",
24
     "html2canvas": "^1.0.0-alpha.12",
24
     "html2canvas": "^1.0.0-alpha.12",
25
     "jQuery": "^1.7.4",
25
     "jQuery": "^1.7.4",
26
+    "jsbarcode": "^3.11.0",
26
     "less": "^3.0.4",
27
     "less": "^3.0.4",
27
     "less-loader": "^4.1.0",
28
     "less-loader": "^4.1.0",
28
     "node-sass": "^4.9.3",
29
     "node-sass": "^4.9.3",

+ 1
- 1
src/pages/bodyCheck/app.js 查看文件

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

+ 1
- 1
src/pages/sales/app.js 查看文件

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

+ 9
- 9
src/pages/user/App.vue 查看文件

12
   name: 'app',
12
   name: 'app',
13
   data () {
13
   data () {
14
     return {
14
     return {
15
-      showPage: false 
15
+      showPage: true 
16
     }
16
     }
17
   },
17
   },
18
   components: {},
18
   components: {},
23
     })
23
     })
24
   },
24
   },
25
   created () {
25
   created () {
26
-    if (location.search && this.toolClass.UrlSearch(location.search).code) {
27
-      this.code = this.toolClass.UrlSearch(location.search).code
28
-    } else {
29
-      this.code = null
30
-    }
31
-    this.getUserInfo({ org: this.org, code: this.code }).then(() => {
32
-      this.showPage = true
33
-    })
26
+    // if (location.search && this.toolClass.UrlSearch(location.search).code) {
27
+    //   this.code = this.toolClass.UrlSearch(location.search).code
28
+    // } else {
29
+    //   this.code = null
30
+    // }
31
+    // this.getUserInfo({ org: this.org, code: this.code }).then(() => {
32
+    //   this.showPage = true
33
+    // })
34
   },
34
   },
35
   methods: {
35
   methods: {
36
     ...actions(['getUserInfo'])
36
     ...actions(['getUserInfo'])

+ 1
- 1
src/pages/user/app.js 查看文件

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

+ 35
- 10
src/pages/user/mainPage/userCenter/index.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="mainPage">
2
   <div class="mainPage">
3
     <div>
3
     <div>
4
-      <div class="userTop_view">
4
+      <div class="userTop_view" :class="{'short':!user.Phone,'long':user.Phone}">
5
         <div class="gradient_bg"></div>
5
         <div class="gradient_bg"></div>
6
         <div class="zIndex_bg"></div>
6
         <div class="zIndex_bg"></div>
7
-        <div class="userAvatar_Border">
7
+        <div class="user-card">
8
+          <div>
9
+            <img :src="headimgurl" alt width="100%" height="100%">
10
+            <div>
11
+              <div class="user-name">{{user.Name}}2333</div>
12
+              <div v-if="user.Phone">{{user.Phone}}3333</div>
13
+              <div v-else>未绑定</div>
14
+            </div>
15
+            <div></div>
16
+          </div>
17
+          <div v-if="user.Phone" class="code">
18
+            <div>卡号:2334546456456</div>
19
+            <svg style="width:100%" id="barcode"></svg>
20
+          </div>
21
+          <div v-else class="bind">
22
+            <span>请绑定手机号后查看会员条形码</span>
23
+            <span>立即绑定</span>
24
+          </div>
25
+        </div>
26
+        <!-- <div class="userAvatar_Border">
8
           <div class="userAvatar">
27
           <div class="userAvatar">
9
             <img :src="headimgurl" alt width="100%" height="100%">
28
             <img :src="headimgurl" alt width="100%" height="100%">
10
           </div>
29
           </div>
13
           <div class="user-name">{{user.Name}}</div>
32
           <div class="user-name">{{user.Name}}</div>
14
           <div class="mobile" v-if="user.Phone">{{user.Phone}}</div>
33
           <div class="mobile" v-if="user.Phone">{{user.Phone}}</div>
15
           <div class="mobile" v-else @click="bindMobile">绑定手机号</div>
34
           <div class="mobile" v-else @click="bindMobile">绑定手机号</div>
16
-        </div>
35
+        </div> -->
17
       </div>
36
       </div>
18
       <div class="vip-privilege flex-h">
37
       <div class="vip-privilege flex-h">
19
         <div class="flex-item privilege-item" @click="toCoupons">
38
         <div class="flex-item privilege-item" @click="toCoupons">
70
 </template>
89
 </template>
71
 
90
 
72
 <script>
91
 <script>
92
+import JsBarcode from 'JsBarcode'
73
 import { mapState, createNamespacedHelpers } from 'vuex'
93
 import { mapState, createNamespacedHelpers } from 'vuex'
74
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
94
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
75
 export default {
95
 export default {
90
 
110
 
91
   },
111
   },
92
   mounted () {
112
   mounted () {
93
-    this.getUserInfo({ org: this.org }).then(() => {
94
-      this.user = this.userInfo.customer
95
-      if (this.user.AccountInfo) {
96
-        this.AccountInfo = JSON.parse(this.user.AccountInfo)
97
-      }
98
-      this.headimgurl = this.user.Headimgurl
113
+    // this.getUserInfo({ org: this.org }).then(() => {
114
+    //   this.user = this.userInfo.customer
115
+    //   if (this.user.AccountInfo) {
116
+    //     this.AccountInfo = JSON.parse(this.user.AccountInfo)
117
+    //   }
118
+    //   this.headimgurl = this.user.Headimgurl
119
+    // })
120
+    // this.getNum()
121
+    JsBarcode("#barcode", "2334546456456", {
122
+      lineColor: '#000000',
123
+      height: 60,
124
+      displayValue: false
99
     })
125
     })
100
-    this.getNum()
101
   },
126
   },
102
   methods: {
127
   methods: {
103
     ...actions(['getUserInfo', 'getNum']),
128
     ...actions(['getUserInfo', 'getNum']),

+ 60
- 4
src/pages/user/mainPage/userCenter/page.scss 查看文件

11
   align-items: center;
11
   align-items: center;
12
 }
12
 }
13
 
13
 
14
+.short{
15
+  margin-bottom: 0.6rem;
16
+}
17
+.long{
18
+  margin-bottom: 1.3rem;
19
+
20
+}
21
+.user-card{
22
+  width: 3.35rem;
23
+  background:rgba(255,255,255,1);
24
+  box-shadow: 0px 0px .1rem 0px rgba(0,0,0,.1);
25
+  border-radius: 8px;
26
+  position: absolute;
27
+  top: 1rem;
28
+  left: 50%;
29
+  transform: translateX(-50%);
30
+  z-index: 3;
31
+  padding: .2rem .2rem .05rem .2rem;
32
+  box-sizing: border-box;
33
+  >div:nth-of-type(1){
34
+    display: flex;
35
+    margin-bottom: .1rem;
36
+    img{
37
+      width: .56rem;
38
+      height: .56rem;
39
+      margin-right: .1rem;
40
+    }
41
+    div{
42
+      color: #7D7D7D;
43
+      font-size: .14rem;
44
+    }
45
+    .user-name{
46
+      font-size: .18rem;
47
+    }
48
+  }
49
+  .code{
50
+    text-align: center;
51
+    div{
52
+      color: #999999;
53
+      text-align: left;
54
+    }
55
+  }
56
+  .bind{
57
+    margin: .1rem;
58
+    span:nth-of-type(1){
59
+      color: #7D7D7D;
60
+      font-size: .14rem;
61
+    }
62
+    span:nth-of-type(2){
63
+      border:1px solid #FC6243;
64
+      padding: .02rem .1rem .03rem;
65
+      border-radius: .2rem;
66
+      color: #FC6243;
67
+      margin-left: .1rem;
68
+    }
69
+  }
70
+}
71
+
14
 .userTop_view {
72
 .userTop_view {
15
   position: relative;
73
   position: relative;
16
   height: 1.7rem;
74
   height: 1.7rem;
17
-  margin-bottom: 1.3rem;
18
   .gradient_bg {
75
   .gradient_bg {
19
     position: absolute;
76
     position: absolute;
20
     width: 100%;
77
     width: 100%;
71
     .mobile{
128
     .mobile{
72
       color:rgba(125,125,125,1);
129
       color:rgba(125,125,125,1);
73
       font-size: .2rem;
130
       font-size: .2rem;
74
-      padding-top: 10px;
131
+      padding-top: .1rem;
75
       text-align: center;
132
       text-align: center;
76
     }
133
     }
77
   }
134
   }
81
   height: 1.2rem;
138
   height: 1.2rem;
82
   margin: 0 .25rem;
139
   margin: 0 .25rem;
83
   background:rgba(255,255,255,1);
140
   background:rgba(255,255,255,1);
84
-  box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
85
   border-radius:8px;
141
   border-radius:8px;
86
   box-sizing: border-box;
142
   box-sizing: border-box;
87
   .privilege-item {
143
   .privilege-item {
113
 }
169
 }
114
 
170
 
115
 .userCenter-menu{
171
 .userCenter-menu{
116
-  padding: 0.2rem 0.25rem;;
172
+  padding: 0 0.25rem 0.2rem;
117
   box-sizing: border-box;
173
   box-sizing: border-box;
118
   .menu-item{
174
   .menu-item{
119
     justify-content: space-between;
175
     justify-content: space-between;