Parcourir la source

feat: 客户管理

listKer il y a 2 ans
Parent
commit
883f84cccc
4 fichiers modifiés avec 218 ajouts et 137 suppressions
  1. 50 108
      src/pages/customerMan/details/index.vue
  2. 131 24
      src/pages/customerMan/myOrder/index.vue
  3. 23 4
      src/server/home.js
  4. 14 1
      src/server/urls.js

+ 50 - 108
src/pages/customerMan/details/index.vue

@@ -3,74 +3,76 @@
3 3
     <div class="left">
4 4
       <div class="user-info">
5 5
         <div class="user-img">
6
-          <img :src="userInfo.image" alt />
6
+          <img :src="userInfo.avatar_url" alt />
7 7
         </div>
8 8
         <div class="user-span">
9 9
           <div class="name">
10 10
             昵称:
11
-            <span>{{userInfo.name}}</span>
11
+            <span>{{userInfo.nickname}}</span>
12 12
           </div>
13 13
           <div class="sex">
14 14
             性别:
15
-            <span>{{userInfo.sex}}</span>
15
+            <span>{{userInfo.sex==1?'男':'女'}}</span>
16 16
           </div>
17 17
           <div class="age">
18 18
             肤龄:
19
-            <span>{{userInfo.age}}</span>
19
+            <span>{{userInfo.age||'--'}}</span>
20 20
           </div>
21 21
           <div class="skin-type">
22 22
             肤质:
23
-            <span>{{userInfo.skinType}}</span>
23
+            <span>{{userInfo.skin}}</span>
24 24
           </div>
25 25
         </div>
26 26
       </div>
27
+
27 28
       <div class="personage-data">
28 29
         <div class="myDataList">
29 30
           肌肤得分:
30
-          <span class="bigSixe">56分</span>
31
+          <span class="bigSixe">{{userInfo.scorec}}分</span>
31 32
         </div>
32 33
         <div class="myDataList">
33 34
           皮肤状态:
34
-          <span>肤质一般</span>
35
+          <span>{{userInfo.skin_status}}</span>
35 36
         </div>
36 37
         <div class="myDataList">
37 38
           上传检测时间:
38
-          <span>2022.0418 16:04</span>
39
+          <span>{{userInfo.check_time}}</span>
39 40
         </div>
40 41
         <div class="myDataList">
41 42
           出生日期:
42
-          <span>2000.02.29</span>
43
+          <span>{{userInfo.birthday}}</span>
43 44
         </div>
44 45
         <div class="myDataList">
45 46
           联系电话:
46
-          <span>13334597987</span>
47
+          <span>{{userInfo.mobile}}</span>
47 48
         </div>
48 49
 
49 50
         <div class="myDataList">
50 51
           所在地:
51
-          <span>广东省,深圳市,南山区</span>
52
+          <span>{{userInfo.city}}</span>
52 53
         </div>
53 54
 
54 55
         <div class="myDataList">
55 56
           开卡店铺:
56
-          <span>JOLIJOLI(西安店)</span>
57
+          <span>{{userInfo.store_name}}</span>
57 58
         </div>
58 59
 
59 60
         <div class="myDataList">
60 61
           卡卷数量:
61
-          <span>5</span>
62
+          <span>{{userInfo.card_num}}</span>
62 63
         </div>
63 64
 
64 65
         <div class="myDataList">
65 66
           储值金额:
66 67
           <span class="JEcolor">
67 68
68
-            <span class="bigSixe">500</span>.00
69
+            <span class="bigSixe">{{userInfo.amount}}</span>
70
+            <!-- .00 -->
69 71
           </span>
70 72
         </div>
71 73
         <div class="myDataList">
72 74
           积分:
73
-          <span>200</span>
75
+          <span>{{userInfo.coin}}</span>
74 76
         </div>
75 77
       </div>
76 78
     </div>
@@ -85,24 +87,24 @@
85 87
           </div>
86 88
           <div class="ps">
87 89
             <div class="ps-title">备注</div>
88
-            <div class="ps-text">{{'富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆富婆' | ellipsis(20)}}</div>
90
+            <div class="ps-text">{{remarks | ellipsis(20)}}</div>
89 91
           </div>
90 92
         </div>
91
-        <div class="right-top-list" @click="toOrder(1)">
92
-          <div class="dataList">
93
+        <div class="right-top-list">
94
+          <div class="dataList" @click="toOrder(1)">
93 95
             <img :src="userInfo.image" />
94 96
             <p>项目订单</p>
95
-            <span>19</span>
97
+            <span>{{order_total.project}}</span>
96 98
           </div>
97
-          <div class="dataList" style="margin:18px 0px">
99
+          <div class="dataList" style="margin:18px 0px" @click="toOrder(2)">
98 100
             <img :src="userInfo.image" />
99
-            <p>项目订单</p>
100
-            <span>19</span>
101
+            <p>卡券订单</p>
102
+            <span>{{order_total.coupon}}</span>
101 103
           </div>
102
-          <div class="dataList">
104
+          <div class="dataList" @click="toOrder(3)">
103 105
             <img :src="userInfo.image" />
104
-            <p>项目订单</p>
105
-            <span>19</span>
106
+            <p>商品订单</p>
107
+            <span>{{order_total.goods}}</span>
106 108
           </div>
107 109
         </div>
108 110
       </div>
@@ -171,81 +173,16 @@ export default {
171 173
         skinType: "中性皮肤"
172 174
       },
173 175
       //面部标签
174
-      lableList: [
175
-        {
176
-          text: "对话框的",
177
-          disabled: false
178
-        },
179
-        {
180
-          text: "对话框的",
181
-          disabled: true
182
-        },
183
-        {
184
-          text: "对话框的",
185
-          disabled: false
186
-        },
187
-        {
188
-          text: "对话框的",
189
-          disabled: false
190
-        },
191
-        {
192
-          text: "对话框的",
193
-          disabled: false
194
-        }
195
-      ],
176
+      lableList: [],
196 177
       //执行方案
197
-      programmeList: [
198
-        {
199
-          image:
200
-            "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/make.png",
201
-          title: "水氧活肤华熙智慧玻尿酸基水氧活肤华熙智慧玻尿酸基底",
202
-          tips: "+润百颜精华",
203
-          zoom: "皮肤综合仪(30号房)",
204
-          ts: "30分钟",
205
-          price: "79.00"
206
-        },
207
-        {
208
-          image:
209
-            "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/make.png",
210
-          title: "水氧活肤华熙智慧玻尿酸基水氧活肤华熙智慧玻尿酸基底",
211
-          tips: "+润百颜精华",
212
-          zoom: "皮肤综合仪(30号房)",
213
-          ts: "30分钟",
214
-          price: "79.00"
215
-        },
216
-        {
217
-          image:
218
-            "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/make.png",
219
-          title: "水氧活肤华熙智慧玻尿酸基水氧活肤华熙智慧玻尿酸基底",
220
-          tips: "+润百颜精华",
221
-          zoom: "皮肤综合仪(30号房)",
222
-          ts: "30分钟",
223
-          price: "79.00"
224
-        }
225
-      ],
178
+      programmeList: [],
179
+
180
+      remarks: {},
226 181
       //项目列表
227
-      projectList: [
228
-        {
229
-          value: "选项1",
230
-          label: "黄金糕"
231
-        },
232
-        {
233
-          value: "选项2",
234
-          label: "双皮奶"
235
-        },
236
-        {
237
-          value: "选项3",
238
-          label: "蚵仔煎"
239
-        },
240
-        {
241
-          value: "选项4",
242
-          label: "龙须面"
243
-        },
244
-        {
245
-          value: "选项5",
246
-          label: "北京烤鸭"
247
-        }
248
-      ],
182
+      projectList: [],
183
+
184
+      order_total: {},
185
+
249 186
       timesInfo: "",
250 187
       projectInfo: "",
251 188
       weekInfo: "",
@@ -258,14 +195,16 @@ export default {
258 195
   watch: {},
259 196
 
260 197
   methods: {
261
-    getUserInfo() {
262
-      api.getUserInfo({ code: this.id }).then(res => {
198
+    getPadUserInfo() {
199
+      api.getPadUserInfo({ id: this.id }).then(res => {
263 200
         this.userInfo = res.data.user;
264
-        this.order_data = res.data.order_data;
265
-        this.lableList = res.data.tags;
266
-        this.programmeList = res.data.order_data.project_list;
267
-        this.coupon_list = res.data.order_data.coupon_list;
268 201
         this.remarks = res.data.remark;
202
+        this.lableList = res.data.tags;
203
+        this.order_total = res.data.order_total;
204
+        this.programmeList = res.data.scheme_list;
205
+
206
+        // this.programmeList = res.data.order_data.project_list;
207
+        // this.coupon_list = res.data.order_data.coupon_list;
269 208
       });
270 209
     },
271 210
 
@@ -282,9 +221,12 @@ export default {
282 221
     },
283 222
     toOrder(index) {
284 223
       if (index === 1) {
285
-        this.$router.push({
286
-          path: "/customerMan/projectOrder"
287
-        });
224
+      this.$router.push({
225
+        path: "/customerMan/projectOrder",
226
+        query: {
227
+          id: this.id
228
+        }
229
+      });
288 230
       }
289 231
     },
290 232
     onSubmit() {},
@@ -294,7 +236,7 @@ export default {
294 236
   created() {
295 237
     let id = this.$route.query.id;
296 238
     this.id = id;
297
-    this.getUserInfo();
239
+    this.getPadUserInfo();
298 240
   },
299 241
 
300 242
   mounted() {}

+ 131 - 24
src/pages/customerMan/myOrder/index.vue

@@ -6,20 +6,30 @@
6 6
           <div class="user-list">
7 7
             <el-table
8 8
               ref="multipleTable"
9
-              :data="tableData"
9
+              :data="projectData"
10 10
               tooltip-effect="dark"
11 11
               height="354"
12 12
               style="width: 100%;border-radius: 8px;"
13 13
               @row-click="handleSelectionChange"
14 14
             >
15
-              <el-table-column prop="name" label="项目名称" width="120"></el-table-column>
16
-              <el-table-column prop="numberList" label="数量" show-overflow-tooltip></el-table-column>
15
+              <el-table-column prop="goods" label="项目名称" width="200">
16
+                <template slot-scope="scope">
17
+                  <div v-for="(val,index) in scope.row.goods" :key="index">
18
+                    <div>{{val.name}}</div>
19
+                  </div>
20
+                </template>
21
+              </el-table-column>
22
+              <el-table-column prop="goods" label="数量" show-overflow-tooltip>
23
+                <template slot-scope="scope">
24
+                  <div>{{scope.row.goods.length}}</div>
25
+                </template>
26
+              </el-table-column>
17 27
               <el-table-column prop="price" label="总价格" show-overflow-tooltip></el-table-column>
18
-              <el-table-column prop="date" label="预约时间" width="180" show-overflow-tooltip></el-table-column>
19
-              <el-table-column prop="shop" label="预约店铺" show-overflow-tooltip></el-table-column>
28
+              <el-table-column prop="order_time" label="预约时间" width="180" show-overflow-tooltip></el-table-column>
29
+              <el-table-column prop="store_name" label="预约店铺" show-overflow-tooltip></el-table-column>
20 30
               <el-table-column prop="status" label="状态" show-overflow-tooltip>
21 31
                 <template slot-scope="scope">
22
-                  <div :class="'classShow'+scope.$index">{{statusStr[scope.row.status]}}</div>
32
+                  <div :class="'color'+scope.row.status">{{statusStr[scope.row.status]}}</div>
23 33
                 </template>
24 34
               </el-table-column>
25 35
             </el-table>
@@ -40,20 +50,28 @@
40 50
           <div class="user-list">
41 51
             <el-table
42 52
               ref="multipleTable"
43
-              :data="tableData"
53
+              :data="couponData"
44 54
               tooltip-effect="dark"
45 55
               height="354"
46 56
               style="width: 100%;border-radius: 8px;"
47 57
               @row-click="handleSelectionChange"
48 58
             >
49
-              <el-table-column prop="name" label="卡卷名称" width="120"></el-table-column>
50
-              <el-table-column prop="numberList" label="卡卷类型" show-overflow-tooltip></el-table-column>
59
+
60
+<!-- create_time: "2022-03-10 10:39:19"
61
+ex_time: "2022.03.17 23:59"
62
+id: 2517
63
+name: "新人体验券"
64
+status: 2
65
+type: "全额券" -->
66
+
67
+              <el-table-column prop="name" label="卡卷名称" width="200"></el-table-column>
68
+              <el-table-column prop="type" label="卡卷类型" show-overflow-tooltip></el-table-column>
51 69
               <el-table-column prop="price" label="总价格" show-overflow-tooltip></el-table-column>
52
-              <el-table-column prop="date" label="到期时间" width="180" show-overflow-tooltip></el-table-column>
53
-              <el-table-column prop="date" label="创建时间" width="180" show-overflow-tooltip></el-table-column>
70
+              <el-table-column prop="create_time" label="到期时间" width="180" show-overflow-tooltip></el-table-column>
71
+              <el-table-column prop="create_time" label="创建时间" width="180" show-overflow-tooltip></el-table-column>
54 72
               <el-table-column prop="status" label="状态" show-overflow-tooltip>
55 73
                 <template slot-scope="scope">
56
-                  <div :class="'classShow'+scope.$index">{{statusStr[scope.row.status]}}</div>
74
+                  <div :class="'color'+scope.row.status">{{statusStr[scope.row.status]}}</div>
57 75
                 </template>
58 76
               </el-table-column>
59 77
             </el-table>
@@ -75,16 +93,33 @@
75 93
           <div class="user-list">
76 94
             <el-table
77 95
               ref="multipleTable"
78
-              :data="tableData"
96
+              :data="goodData"
79 97
               tooltip-effect="dark"
80 98
               height="354"
81 99
               style="width: 100%;border-radius: 8px;"
82 100
               @row-click="handleSelectionChange"
83 101
             >
84
-              <el-table-column prop="name" label="商品名称" width="120"></el-table-column>
85
-              <el-table-column prop="numberList" label="数量" show-overflow-tooltip></el-table-column>
102
+
103
+<!-- create_time: "2022-03-19 22:53:40"
104
+goods: [{order_id: 47, name: "润百颜玻尿酸屏障调理面膜", num: 1}]
105
+id: 47
106
+price: "0.01"
107
+status: 5 -->
108
+
109
+              <el-table-column prop="goods" label="商品名称" width="200">
110
+                <template slot-scope="scope">
111
+                  <div v-for="(val,index) in scope.row.goods" :key="index">
112
+                    <div>{{val.name}}</div>
113
+                  </div>
114
+                </template>
115
+              </el-table-column>
116
+              <el-table-column prop="goods" label="数量" show-overflow-tooltip>
117
+                <template slot-scope="scope">
118
+                  <div>{{scope.row.goods.length}}</div>
119
+                </template>
120
+              </el-table-column>
86 121
               <el-table-column prop="price" label="实付款" show-overflow-tooltip></el-table-column>
87
-              <el-table-column prop="date" label="下单时间" width="180" show-overflow-tooltip></el-table-column>
122
+              <el-table-column prop="create_time" label="下单时间" width="180" show-overflow-tooltip></el-table-column>
88 123
               <el-table-column prop="status" label="状态" show-overflow-tooltip>
89 124
                 <template slot-scope="scope">
90 125
                   <div :class="'classShow'+scope.$index">{{statusStr[scope.row.status]}}</div>
@@ -110,6 +145,8 @@
110 145
 </template>
111 146
 
112 147
 <script>
148
+import api from "../../../server/home";
149
+
113 150
 export default {
114 151
   data() {
115 152
     return {
@@ -147,15 +184,65 @@ export default {
147 184
           status: 1
148 185
         }
149 186
       ],
150
-      statusStr: ["未完成", "代发货", "代使用", "已完成"],
187
+      statusStr: [
188
+        "已预约",
189
+        "未支付",
190
+        "已支付",
191
+        "待使用",
192
+        "正在使用",
193
+        "已结算",
194
+        "已取消"
195
+      ],
151 196
       currentPage1: 1,
152
-      multipleSelection: ""
197
+      couponData: [],
198
+      goodData: [],
199
+      projectData: [],
200
+      total: ""
153 201
     };
154 202
   },
155 203
   computed: {},
156 204
   watch: {},
157 205
 
158 206
   methods: {
207
+    // 获取优惠券订单
208
+    getUserCoupon() {
209
+      let params = {
210
+        page: this.currentPage1,
211
+        limit: this.limit,
212
+        id: this.id
213
+      };
214
+      api.getUserCoupon(params).then(res => {
215
+        this.couponData = res.data.list;
216
+        this.total = res.data.total;
217
+      });
218
+    },
219
+
220
+    // 获取商品订单
221
+    getUserGoods() {
222
+      let params = {
223
+        page: this.currentPage1,
224
+        limit: this.limit,
225
+        id: this.id
226
+      };
227
+      api.getUserGoods(params).then(res => {
228
+        this.goodData = res.data.list;
229
+        this.total = res.data.total;
230
+      });
231
+    },
232
+
233
+    // 获取获取项目订单
234
+    getUserProject() {
235
+      let params = {
236
+        page: this.currentPage1,
237
+        limit: this.limit,
238
+        id: this.id
239
+      };
240
+      api.getUserProject(params).then(res => {
241
+        this.projectData = res.data.list;
242
+        this.total = res.data.total;
243
+      });
244
+    },
245
+
159 246
     handleSizeChange(val) {
160 247
       console.log(`每页 ${val} 条`);
161 248
     },
@@ -167,7 +254,13 @@ export default {
167 254
     submitFrequency() {}
168 255
   },
169 256
 
170
-  created() {},
257
+  created() {
258
+    let id = this.$route.query.id;
259
+    this.id = id;
260
+    this.getUserCoupon();
261
+    this.getUserGoods();
262
+    this.getUserProject();
263
+  },
171 264
 
172 265
   mounted() {}
173 266
 };
@@ -187,12 +280,26 @@ export default {
187 280
     color: green;
188 281
   }
189 282
 }
190
-.classShow1 {
191
-  color: #00EC67;
283
+.color0 {
284
+  color: #fc3019;
192 285
 }
193
-
194
-.classShow0 {
195
-  color: #FF1818;
286
+.color1 {
287
+  color: #3ef3ed;
288
+}
289
+.color2 {
290
+  color: #00eeee;
291
+}
292
+.color3 {
293
+  color: #61d09d;
294
+}
295
+.color4 {
296
+  color: #3115cc;
297
+}
298
+.color5 {
299
+  color: #fc3019;
300
+}
301
+.color6 {
302
+  color: #a999ea;
196 303
 }
197 304
 
198 305
 .priceColor {

+ 23 - 4
src/server/home.js

@@ -58,10 +58,10 @@ export default class Home {
58 58
     return $http.get(url.getUserList, parms);
59 59
   }
60 60
 
61
-  // 获取用户详情
62
-  static getUserInfo (parms) {
63
-    return $http.get(url.getUserInfo, parms);
64
-  }
61
+  // // 获取用户详情
62
+  // static getUserInfo (parms) {
63
+  //   return $http.get(url.getUserInfo, parms);
64
+  // }
65 65
 
66 66
   // 获取优惠券列表
67 67
   static getCouponInfo (parms) {
@@ -73,6 +73,25 @@ export default class Home {
73 73
     return $http.post(url.sendCoupon, parms);
74 74
   }
75 75
 
76
+  // 获取用户详情接口
77
+  static getPadUserInfo (parms) {
78
+    return $http.get(url.getPadUserInfo, parms);
79
+  }
80
+  
81
+  // 获取优惠券订单
82
+  static getUserCoupon (parms) {
83
+    return $http.get(url.getUserCoupon, parms);
84
+  }
85
+
86
+  // 获取商品订单
87
+  static getUserGoods (parms) {
88
+    return $http.get(url.getUserGoods, parms);
89
+  }
90
+
91
+  // 获取项目订单
92
+  static getUserProject (parms) {
93
+    return $http.get(url.getUserProject, parms);
94
+  }
76 95
 
77 96
 }
78 97
 

+ 14 - 1
src/server/urls.js

@@ -20,7 +20,7 @@ export default {
20 20
   //获取项目列表
21 21
   getProjectList: '/v2/pad/project/list',
22 22
   //获取升级包
23
-  getProducts:'/v2/pad/project/product',
23
+  getProducts: '/v2/pad/project/product',
24 24
 
25 25
   /**
26 26
    *  by ListKer
@@ -44,4 +44,17 @@ export default {
44 44
   // 发送优惠券接口
45 45
   sendCoupon: '/v2/pad/coupon/send',
46 46
 
47
+  // 获取用户详情
48
+  getPadUserInfo: '/v2/pad/user/info',
49
+
50
+  // 获取项目订单
51
+  getUserProject: '/v2/pad/user/order/project',
52
+
53
+  // 获取商品订单
54
+  getUserGoods: '/v2/pad/user/order/goods',
55
+
56
+  // 获取优惠券订单
57
+  getUserCoupon: '/v2/pad/user/coupon',
58
+
59
+
47 60
 }