yuantianjiao 6 yıl önce
ebeveyn
işleme
8600373b9f

+ 1
- 0
package.json Dosyayı Görüntüle

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

+ 1
- 1
src/pages/bodyCheck/app.js Dosyayı Görüntüle

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

+ 1
- 1
src/pages/sales/app.js Dosyayı Görüntüle

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

+ 9
- 9
src/pages/user/App.vue Dosyayı Görüntüle

@@ -12,7 +12,7 @@ export default {
12 12
   name: 'app',
13 13
   data () {
14 14
     return {
15
-      showPage: false 
15
+      showPage: true 
16 16
     }
17 17
   },
18 18
   components: {},
@@ -23,14 +23,14 @@ export default {
23 23
     })
24 24
   },
25 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 35
   methods: {
36 36
     ...actions(['getUserInfo'])

+ 1
- 1
src/pages/user/app.js Dosyayı Görüntüle

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

+ 35
- 10
src/pages/user/mainPage/userCenter/index.vue Dosyayı Görüntüle

@@ -1,10 +1,29 @@
1 1
 <template>
2 2
   <div class="mainPage">
3 3
     <div>
4
-      <div class="userTop_view">
4
+      <div class="userTop_view" :class="{'short':!user.Phone,'long':user.Phone}">
5 5
         <div class="gradient_bg"></div>
6 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 27
           <div class="userAvatar">
9 28
             <img :src="headimgurl" alt width="100%" height="100%">
10 29
           </div>
@@ -13,7 +32,7 @@
13 32
           <div class="user-name">{{user.Name}}</div>
14 33
           <div class="mobile" v-if="user.Phone">{{user.Phone}}</div>
15 34
           <div class="mobile" v-else @click="bindMobile">绑定手机号</div>
16
-        </div>
35
+        </div> -->
17 36
       </div>
18 37
       <div class="vip-privilege flex-h">
19 38
         <div class="flex-item privilege-item" @click="toCoupons">
@@ -70,6 +89,7 @@
70 89
 </template>
71 90
 
72 91
 <script>
92
+import JsBarcode from 'JsBarcode'
73 93
 import { mapState, createNamespacedHelpers } from 'vuex'
74 94
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
75 95
 export default {
@@ -90,14 +110,19 @@ export default {
90 110
 
91 111
   },
92 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 127
   methods: {
103 128
     ...actions(['getUserInfo', 'getNum']),

+ 60
- 4
src/pages/user/mainPage/userCenter/page.scss Dosyayı Görüntüle

@@ -11,10 +11,67 @@
11 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 72
 .userTop_view {
15 73
   position: relative;
16 74
   height: 1.7rem;
17
-  margin-bottom: 1.3rem;
18 75
   .gradient_bg {
19 76
     position: absolute;
20 77
     width: 100%;
@@ -71,7 +128,7 @@
71 128
     .mobile{
72 129
       color:rgba(125,125,125,1);
73 130
       font-size: .2rem;
74
-      padding-top: 10px;
131
+      padding-top: .1rem;
75 132
       text-align: center;
76 133
     }
77 134
   }
@@ -81,7 +138,6 @@
81 138
   height: 1.2rem;
82 139
   margin: 0 .25rem;
83 140
   background:rgba(255,255,255,1);
84
-  box-shadow:0px 2px 12px 0px rgba(219,219,219,0.5);
85 141
   border-radius:8px;
86 142
   box-sizing: border-box;
87 143
   .privilege-item {
@@ -113,7 +169,7 @@
113 169
 }
114 170
 
115 171
 .userCenter-menu{
116
-  padding: 0.2rem 0.25rem;;
172
+  padding: 0 0.25rem 0.2rem;
117 173
   box-sizing: border-box;
118 174
   .menu-item{
119 175
     justify-content: space-between;