Переглянути джерело

✨ 对接个人中心/对接角色切换/对接客户信息

谢创宏 3 роки тому
батько
коміт
4b673e45a4

BIN
images/.DS_Store


BIN
images/icon_tools_01.png


BIN
images/icon_tools_02.png


BIN
images/icon_tools_03.png


BIN
images/icon_tools_04.png


BIN
images/icon_tools_05.png


+ 67 - 6
pages/clientInfo/clientInfo.js

@@ -1,3 +1,5 @@
1
+import { get } from "../../utils/http"
2
+
1 3
 // pages/clientInfo/clientInfo.js
2 4
 Page({
3 5
 
@@ -16,6 +18,14 @@ Page({
16 18
       "https://img1.baidu.com/it/u=510862345,2249984174&fm=26&fmt=auto",
17 19
       "https://img2.baidu.com/it/u=2222750380,2392750381&fm=26&fmt=auto",
18 20
     ],
21
+    sex: {
22
+      0: '保密',
23
+      1: '男',
24
+      2: '女'
25
+    },
26
+    list: [],
27
+    total: 0,
28
+    page: 1,
19 29
     tags: ['美丽貌美','短短胳膊粗粗的腿','闭月羞花','人美声甜白富美']
20 30
   },
21 31
 
@@ -23,7 +33,17 @@ Page({
23 33
    * 生命周期函数--监听页面加载
24 34
    */
25 35
   onLoad: function (options) {
26
-
36
+    console.log(options)
37
+    if(options.userId) {
38
+      this.setData({
39
+        userId: options.userId
40
+      },() => {
41
+        this.getUserInfo()
42
+        this.getfeedbackList()
43
+      })
44
+      
45
+    }
46
+    
27 47
   },
28 48
 
29 49
   /**
@@ -65,7 +85,9 @@ Page({
65 85
    * 页面上拉触底事件的处理函数
66 86
    */
67 87
   onReachBottom: function () {
68
-
88
+    if(this.data.page * 10 < this.data.total) {
89
+      this.getfeedbackList(++this.data.page)
90
+    }
69 91
   },
70 92
 
71 93
   /**
@@ -96,10 +118,49 @@ Page({
96 118
   /**
97 119
    * 图片预览
98 120
    */
99
-  previewImage(e) {
100
-    wx.previewImage({
101
-      current: e.currentTarget.dataset.index,
102
-      urls: this.data.urls
121
+  previewMedia(e) {
122
+    let { idx,index } = e.currentTarget.dataset;
123
+    let arr = this.data.list[idx].media_list
124
+    let current = index
125
+    wx.previewMedia({
126
+      sources: arr,
127
+      current
128
+    })
129
+  },
130
+
131
+  /**
132
+   * 获取客户信息
133
+   * api/user/info
134
+  */
135
+  getUserInfo(user_id) {
136
+    let { userId } = this.data;
137
+    get('api/user/info',{
138
+      user_id: userId
139
+    },(res) => {
140
+      this.setData({
141
+        userInfo: res.data
142
+      })
143
+      console.log(res)
144
+    })
145
+  },
146
+
147
+  /**
148
+   * 获取订单反馈记录
149
+   * api/feedback/list/user
150
+  */
151
+  getfeedbackList(_page) {
152
+    let { page,list,userId } = this.data;
153
+    get('api/feedback/list/user',{
154
+      user_id: userId,
155
+      page: _page || page,
156
+      limit: 10
157
+    },(res) => {
158
+      console.log(res)
159
+      res.data.list.forEach((item,index) => {
160
+        item.media_list = JSON.parse(item.media_list)
161
+      })
162
+      list.push(...res.data.list)
163
+      this.setData({ list,total: res.data.total, })
103 164
     })
104 165
   }
105 166
 })

+ 46 - 24
pages/clientInfo/clientInfo.wxml

@@ -2,55 +2,61 @@
2 2
   <view class="border-radius padding user-info">
3 3
     <view class="top flex-justify-space-between">
4 4
       <text style="font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;">基本信息</text>
5
-      <navigator url="/pages/clientInfoEdit/clientInfoEdit" hover-class="none">
5
+      <navigator url="/pages/clientInfoEdit/clientInfoEdit?userId={{userId}}" hover-class="none">
6 6
         <view class="edit-btn flex-center">编辑信息</view>
7 7
       </navigator>
8 8
     </view>
9 9
     <view class="user-avatar flex-align-center">
10
-      <image src=""></image>
11
-      <text style="font-size: 28rpx;">查理兹·塞隆…</text>
10
+      <image src="{{ userInfo.avatar_url }}"></image>
11
+      <text style="font-size: 28rpx;">{{ userInfo.nickname }}</text>
12 12
       <text class="flex1"></text>
13
-      <text style="font-size: 28rpx;color: #999;">下午  3:45</text>
13
+      <text style="font-size: 28rpx;color: #999;">{{ userInfo.update_time }}</text>
14 14
     </view>
15 15
     <view class="user-content flex-column">
16
-      <text>姓名:陈姐</text>
17
-      <text>性别:女</text>
18
-      <text>生日:1980-01-01</text>
19
-      <text>手机号码:13888888888</text>
20
-      <text>所在地区:广东省,深圳市,南山区</text>
16
+      <text>姓名:{{ userInfo.realname }}</text>
17
+      <text>性别:{{ userInfo.sex == 1 ? "男" : "" }}</text>
18
+      <text>生日:{{ userInfo.birthday || '-' }}</text>
19
+      <text>手机号码:{{ userInfo.mobile || '-' }}</text>
20
+      <text>所在地区:{{ userInfo.city || '-' }}</text>
21 21
       <view class="tags-list flex-align-center">
22 22
         <text>客户标签:</text>
23
-        <view class="item" wx:for="{{ tags }}" wx:key="index">
24
-          <text>{{ item }}</text>
25
-        </view>
23
+        <block wx:if="{{ userInfo.tags && userInfo.tags.length > 0 }}">
24
+          <view class="item" wx:for="{{ userInfo.tags }}" wx:key="index">
25
+            <text>相逢是缘</text>
26
+          </view>
27
+        </block>
28
+        <block wx:else>
29
+          <text>-</text>
30
+        </block>
26 31
       </view>
27 32
     </view>
28 33
   </view>
29 34
   <view class="border-radius padding buy-info">
30 35
     <text style="font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;">会员信息</text>
31
-    <view class="buy-content flex-column">
32
-      <text class="ellipsis {{ index == 0 ? 'active' : '' }}" wx:for="{{ 10 }}" wx:key="index">2020/01/01-2020/02/01:40分钟月卡会员</text>
36
+    <view class="buy-content flex-column" wx:if="{{ userInfo.card_list && userInfo.card_list.length > 0 }}">
37
+      <text class="ellipsis {{ index == 0 ? 'active' : '' }}" wx:for="{{ userInfo.card_list }}" wx:key="index">2020/01/01-2020/02/01:40分钟月卡会员</text>
33 38
       <view class="buy-active flex-center">生效中</view>
34 39
     </view>
35
-    <view class="btn-more flex-center" style="color: #666;">查看更多记录</view>
40
+    <view class="no-more-data" style="padding-bottom: 28rpx;" wx:else>暂无数据~</view>
41
+    <!-- <view class="btn-more flex-center" style="color: #666;">查看更多记录</view> -->
36 42
   </view>
37
-  <view class="border-radius padding">
43
+  <!-- <view class="border-radius padding">
38 44
     <calendar 
39 45
       id="calendar"
40 46
       bind:afterCalendarRender="afterCalendarRender"
41 47
     />
42
-  </view>
48
+  </view> -->
43 49
   <view class="border-radius padding list">
44 50
     <view class="item-top flex-align-center">
45 51
       <text class="flex1">反馈记录</text>
46
-      <view class="btn flex-center">订单</view>
52
+      <!-- <view class="btn flex-center">订单</view> -->
47 53
     </view>
48
-    <view class="item flex-column" wx:for="{{4}}" wx:key="index">
54
+    <view class="item flex-column" wx:for="{{ list }}" wx:for-index="idx" wx:key="index">
49 55
       <view class="user-info flex-align-center">
50
-        <image></image>
56
+        <image src="{{ item.avatar_url }}"></image>
51 57
         <view class="info flex-column flex1">
52
-          <text style="font-size: 28rpx;margin-bottom: 6rpx;">查理兹·塞隆…</text>
53
-          <text style="font-size: 20rpx;color: #999;">下午  3:45</text>
58
+          <text style="font-size: 28rpx;margin-bottom: 6rpx;">{{ item.nickname }}</text>
59
+          <text style="font-size: 20rpx;color: #999;">{{ item.create_time }}</text>
54 60
         </view>
55 61
         <!-- <view class="more flex-align-center flex-justify-space-between" bindtap="onEditItem">
56 62
           <text></text>
@@ -59,10 +65,26 @@
59 65
         </view> -->
60 66
         <!-- <view class="more">···</view> -->
61 67
       </view>
62
-      <text style="font-size: 28rpx;color: #666;">当前皮肤毛孔出现堵塞,抓哟集中在T区,主要问题在于自身油脂分泌过多。</text>
68
+      <text style="font-size: 28rpx;color: #666;">{{ item.content }}</text>
63 69
       <view class="box">
64
-        <image src="{{item}}" data-index="{{item}}" bindtap="previewImage" wx:for="{{urls}}" wx:key="index"></image>
70
+        <view class="item-media" wx:for="{{ item.media_list }}" wx:key="index">
71
+          <block wx:if="{{ item.type == 'video' }}">
72
+            <!-- <video src="{{ item.url }}"></video> -->
73
+            <!-- <text>视频播放</text> -->
74
+            <view class="flex-center" style="font-size: 28rpx;width: 100%;height: 100%;background-color: #ccc;" data-idx="{{ idx }}" data-index="{{index}}" bindtap="previewMedia">
75
+              <!-- 这个是视频 -->
76
+              <image class="icon-01" src="/images/icon_01.png"></image>
77
+              <!-- <text style="position: absolute;">这个是视频</text> -->
78
+              <image class="img-content" data-index="{{index}}" src="{{ item.thumb }}" alt=""></image>
79
+            </view>
80
+          </block>
81
+          <block wx:if="{{ item.type == 'image' }}">
82
+            <image class="img-content" data-idx="{{ idx }}" data-index="{{index}}" src="{{ item.url }}" alt="" bindtap="previewMedia"></image>
83
+          </block>
84
+        </view>
85
+        <!-- <image src="{{item}}" data-index="{{item}}" bindtap="previewImage" wx:for="{{urls}}" wx:key="index"></image> -->
65 86
       </view>
66 87
     </view>
67 88
   </view>
89
+  <view class="no-more-data" style="display: {{list.length > 0 && list.length >= total ? 'block' : 'none'}};">已经到底啦~~</view>
68 90
 </view>

+ 7 - 1
pages/clientInfo/clientInfo.wxss

@@ -156,5 +156,11 @@
156 156
   width: 198rpx;
157 157
   height: 198rpx;
158 158
   border-radius: 16rpx;
159
-  background-color: red;
159
+  /* background-color: red; */
160
+}
161
+
162
+.list .box .icon-01 {
163
+  width: 64rpx;
164
+  height: 64rpx;
165
+  position: absolute;
160 166
 }

+ 40 - 10
pages/clientInfoEdit/clientInfoEdit.js

@@ -1,6 +1,6 @@
1
-// import {
2
-//   get, post,
3
-// } from '../../utils/http';
1
+import {
2
+  get, post,
3
+} from '../../utils/http';
4 4
 Page({
5 5
 
6 6
   /**
@@ -19,7 +19,14 @@ Page({
19 19
    * 生命周期函数--监听页面加载
20 20
    */
21 21
   onLoad: function (options) {
22
-
22
+    console.log(options)
23
+    if(options.userId) {
24
+      this.setData({
25
+        userId: options.userId
26
+      },() => {
27
+        // this.getUserInfo()
28
+      })
29
+    }
23 30
   },
24 31
 
25 32
   /**
@@ -34,6 +41,7 @@ Page({
34 41
    */
35 42
   onShow: function () {
36 43
     // this.getUserFiles()
44
+    this.getUserInfo()
37 45
   },
38 46
 
39 47
   /**
@@ -144,14 +152,36 @@ Page({
144 152
    * api/user/save_files
145 153
   */
146 154
   setUserFiles() {
147
-    let { real_name,birthday,sex,city } = this.data.userInfo;
148
-    post('api/user/save_files',{
149
-      real_name,
150
-      birthday,
155
+    let { user_id,avatar_url,nickname,realname,sex,birthday,mobile,city,tags } = this.data.userInfo;
156
+    post('api/user/update',{
157
+      user_id,
158
+      avatar_url,
159
+      nickname,
160
+      realname,
151 161
       sex,
152
-      city
162
+      birthday,
163
+      mobile,
164
+      city,
165
+      tags
153 166
     },() => {
154 167
 
155 168
     })
156
-  }
169
+  },
170
+
171
+  /**
172
+   * 获取用户信息
173
+   * api/user/info
174
+  */
175
+  getUserInfo() {
176
+    let { userId } = this.data;
177
+    get('api/user/info',{
178
+      user_id: userId
179
+    },(res) => {
180
+      this.setData({
181
+        userInfo: res.data
182
+      })
183
+      console.log(res)
184
+    })
185
+  },
186
+  
157 187
 })

+ 22 - 10
pages/clientInfoEdit/clientInfoEdit.wxml

@@ -3,21 +3,29 @@
3 3
     <text class="flex1">头像</text>
4 4
     <image class="avatar" src="{{userInfo.avatar_url}}"></image>
5 5
   </view>
6
-  <navigator url="/pages/name/name" hover-class="none">
6
+  <view class="item flex-align-center">
7
+    <view class="flex-column flex1">
8
+      <text class="title">昵称</text>
9
+      <text class="flex1" wx:if="{{ userInfo.nickname }}">{{ userInfo.nickname  }}</text>
10
+      <text class="flex1" wx:else style="font-size: 28rpx;color: #ccc;">请填写昵称</text>
11
+    </view>
12
+    <!-- <image class="icon-right" src="/images/icon_02.png"></image> -->
13
+  </view>
14
+  <!-- <navigator url="/pages/name/name?name={{ userInfo.nickname }}&type=nickname&userId={{ userInfo.user_id }}" hover-class="none">
7 15
     <view class="item flex-align-center">
8 16
       <view class="flex-column flex1">
9 17
         <text class="title">昵称</text>
10
-        <text class="flex1" wx:if="{{ userInfo.real_name }}">{{ userInfo.real_name  }}</text>
18
+        <text class="flex1" wx:if="{{ userInfo.nickname }}">{{ userInfo.nickname  }}</text>
11 19
         <text class="flex1" wx:else style="font-size: 28rpx;color: #ccc;">请填写昵称</text>
12 20
       </view>
13 21
       <image class="icon-right" src="/images/icon_02.png"></image>
14 22
     </view>
15
-  </navigator>
16
-  <navigator url="/pages/name/name" hover-class="none">
23
+  </navigator> -->
24
+  <navigator url="/pages/name/name?name={{ userInfo.realname }}&type=realname&userId={{ userInfo.user_id }}" hover-class="none">
17 25
     <view class="item flex-align-center">
18 26
       <view class="flex-column flex1">
19 27
         <text class="title">姓名</text>
20
-        <text class="flex1" wx:if="{{ userInfo.real_name }}">{{ userInfo.real_name  }}</text>
28
+        <text class="flex1" wx:if="{{ userInfo.realname }}">{{ userInfo.realname  }}</text>
21 29
         <text class="flex1" wx:else style="font-size: 28rpx;color: #ccc;">请填写姓名</text>
22 30
       </view>
23 31
       <image class="icon-right" src="/images/icon_02.png"></image>
@@ -61,14 +69,18 @@
61 69
       <image class="icon-right" src="/images/icon_02.png"></image>
62 70
     </view>
63 71
   </picker>
64
-  <navigator url="/pages/tagsEdit/tagsEdit" hover-class="none">
72
+  <navigator url="/pages/tagsEdit/tagsEdit?user_id={{ userInfo.user_id }}" hover-class="none">
65 73
     <view class="item flex-align-center" style="height: auto;padding: 40rpx 24rpx 30rpx;">
66 74
       <view class="flex-column flex1">
67 75
         <text class="title">客户标签</text>
68
-        <view class="tags-list flex">
69
-          <view class="tags-item" wx:for="{{ 10 }}" wx:key="index">美丽貌美</view>
70
-        </view>
71
-        <!-- <text class="flex1" wx:if="{{ userInfo.real_name }}">{{ userInfo.real_name  }}</text>
76
+        <block wx:if="{{ userInfo.tags && userInfo.tags.length > 0 }}">
77
+          <view class="tags-list flex">
78
+            <view class="tags-item" wx:for="{{ userInfo.tags }}" wx:key="index">{{ item }}</view>
79
+          </view>
80
+        </block>
81
+        <text class="flex1" wx:else style="font-size: 28rpx;color: #ccc;">暂无客户标签</text>
82
+        
83
+        <!-- <text class="flex1" wx:if="{{ userInfo.realname }}">{{ userInfo.realname  }}</text>
72 84
         <text class="flex1" wx:else style="font-size: 28rpx;color: #ccc;">请填写昵称</text> -->
73 85
       </view>
74 86
       <image class="icon-right" src="/images/icon_02.png"></image>

+ 10 - 9
pages/dossier/dossier.js

@@ -1,6 +1,6 @@
1
-// import {
2
-//   get, post,
3
-// } from '../../utils/http';
1
+import {
2
+  get, post,
3
+} from '../../utils/http';
4 4
 Page({
5 5
 
6 6
   /**
@@ -33,7 +33,7 @@ Page({
33 33
    * 生命周期函数--监听页面显示
34 34
    */
35 35
   onShow: function () {
36
-    // this.getUserFiles()
36
+    this.getUserFiles()
37 37
   },
38 38
 
39 39
   /**
@@ -129,7 +129,7 @@ Page({
129 129
    * api/user/files
130 130
   */
131 131
   getUserFiles() {
132
-    get('api/user/files',{},(res) => {
132
+    get('api/mruser/info',{},(res) => {
133 133
       this.setData({
134 134
         userInfo: res.data
135 135
       })
@@ -142,12 +142,13 @@ Page({
142 142
    * api/user/save_files
143 143
   */
144 144
   setUserFiles() {
145
-    let { real_name,birthday,sex,city } = this.data.userInfo;
146
-    post('api/user/save_files',{
147
-      real_name,
145
+    let { avatar_url,realname,birthday,sex,city } = this.data.userInfo;
146
+    post('api/mruser/update',{
147
+      avatar_url,
148
+      realname,
148 149
       birthday,
149 150
       sex,
150
-      city
151
+      city: ''
151 152
     },() => {
152 153
 
153 154
     })

+ 1 - 1
pages/dossier/dossier.wxml

@@ -7,7 +7,7 @@
7 7
     <view class="item flex-align-center">
8 8
       <view class="flex-column flex1">
9 9
         <text class="title">姓名</text>
10
-        <text class="flex1" wx:if="{{ userInfo.real_name }}">{{ userInfo.real_name  }}</text>
10
+        <text class="flex1" wx:if="{{ userInfo.realname }}">{{ userInfo.realname  }}</text>
11 11
         <text class="flex1" wx:else style="font-size: 28rpx;color: #ccc;">请填写姓名</text>
12 12
       </view>
13 13
       <image class="icon-right" src="/images/my/right.png"></image>

+ 7 - 1
pages/home/home.js

@@ -15,7 +15,13 @@ Page({
15 15
     homeData: {},
16 16
     list: [],
17 17
     total: 0,
18
-    page: 1
18
+    page: 1,
19
+    // 状态,1待进行,2进行中,3已完成
20
+    status: {
21
+      1: '待进行',
22
+      2: '进行中',
23
+      3: '已完成',
24
+    }
19 25
   },
20 26
 
21 27
   /**

+ 12 - 9
pages/home/home.wxml

@@ -34,25 +34,28 @@
34 34
     <navigator url="/pages/orderDetail/orderDetail?orderId={{item.order_id}}" hover-class="none" wx:for="{{ list }}" wx:key="index">
35 35
       <view class="item border-radius">
36 36
         <view class="item-top flex-align-center">
37
-          <text class="flex1">水氧清洁水光提升综合管理</text>
38
-          <text style="font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;color: #FF77B0;">已完成</text>
37
+          <text class="flex1 ellipsis">{{ item.project_name }}</text>
38
+          <text style="font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;color: #FF77B0;">{{ status[item.status] }}</text>
39 39
         </view>
40 40
         <view class="item-text flex-column">
41
-          <text>预约客户:查理兹·塞隆</text>
42
-          <text>会员信息:非会员</text>
43
-          <text>预约时间:2019-8-7  8:00~10:00</text>
44
-          <text>设备:面部综合仪(5号房间)</text>
41
+          <text>预约客户:{{ item.user_name }}</text>
42
+          <text>会员信息:{{ item.vip_name }}</text>
43
+          <text>预约时间:{{ item.order_time }}</text>
44
+          <text>设备:{{ item.device_name }}</text>
45 45
         </view>
46 46
         <view class="flex-align-center price">
47 47
           <text>预约费用:</text>
48
-          <text style="color: #FF77B0;">¥888.88</text>
48
+          <text style="color: #FF77B0;">¥{{ item.price }}</text>
49 49
         </view>
50 50
         <view class="item-btn flex-align-center flex-justify-space-between">
51 51
           <view class="btn flex-center">订单详情</view>
52
-          <navigator url="/pages/clientInfo/clientInfo" hover-class="none">
52
+          <navigator url="/pages/clientInfo/clientInfo?userId={{ item.user_id }}" hover-class="none">
53 53
             <view class="btn flex-center">客户信息</view>
54 54
           </navigator>
55
-          <view class="btn flex-center">记录反馈</view>
55
+          <navigator url="/pages/feedback/feedback?orderId={{ item.order_id }}&cover={{ detailData.cover_url }}&name={{ item.project_name }}" hover-class="none">
56
+            <view class="btn flex-center">记录反馈</view>
57
+          </navigator>
58
+          <!-- <view class="btn flex-center">记录反馈</view> -->
56 59
         </view>
57 60
       </view>
58 61
     </navigator>

+ 1 - 0
pages/login/login.json

@@ -1,3 +1,4 @@
1 1
 {
2
+  "navigationBarTitleText": "登录",
2 3
   "usingComponents": {}
3 4
 }

+ 2 - 2
pages/login/login.wxml

@@ -6,10 +6,10 @@
6 6
     <button class="flex-center" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:else>授权绑定手机号</button>
7 7
   </view>
8 8
   <view class="flex1"></view>
9
-  <view class="bottom">
9
+  <!-- <view class="bottom">
10 10
     <text>登录代表同意I JOLI JOLI </text>
11 11
     <text style="color: #E95564;" bindtap="goToAgree" data-agree="user_agreement">用户协议、</text>
12 12
     <text style="color: #E95564;" bindtap="goToAgree" data-agree="user_private">隐私协议</text>
13
-  </view>
13
+  </view> -->
14 14
 </view>
15 15
 

+ 7 - 46
pages/member/member.js

@@ -1,7 +1,7 @@
1
-// import {
2
-//   get,
3
-//   post
4
-// } from '../../utils/http';
1
+import {
2
+  get,
3
+  post
4
+} from '../../utils/http';
5 5
 // import {
6 6
 //   formatActivity,
7 7
 // } from '../../utils/time';
@@ -36,7 +36,7 @@ Page({
36 36
    * 生命周期函数--监听页面显示
37 37
    */
38 38
   onShow: function () {
39
-    // this.getUser()
39
+    this.getUser()
40 40
     // this.getUserActivity()
41 41
     // this.setData({ agree: wx.getStorageSync('agree') || false })
42 42
   },
@@ -94,7 +94,8 @@ Page({
94 94
    * api/user
95 95
   */
96 96
   getUser() {
97
-    get('api/user',{},(res) => {
97
+    // api/mruser/info
98
+    get('api/mruser/info',{},(res) => {
98 99
       if(res.data) {
99 100
         this.setData({
100 101
           userInfo: res.data
@@ -105,44 +106,4 @@ Page({
105 106
     })
106 107
   },
107 108
 
108
-  /**
109
-   * 跳转vip页面
110
-  */
111
-  goToVip() {
112
-    console.log(this.data.userInfo)
113
-    let nextDatas = JSON.stringify(this.data.userInfo)
114
-    wx.navigateTo({
115
-      url: `/pages/vip/vip?userInfo=${encodeURIComponent(nextDatas)}`
116
-      // url: `/pages/vip/vip?userInfo=${JSON.stringify(this.data.userInfo)}`
117
-      // url: '/pages/vip/vip?userInfo='+ JSON.stringify(this.data.userInfo),
118
-    })
119
-  },
120
-
121
-  /**
122
-   * 获取首次开卡优惠
123
-   * api/user/activity
124
-  */
125
-  getUserActivity() {
126
-    if(this.timer) {
127
-      clearInterval(this.timer_);
128
-    }
129
-    get('api/user/activity',{},(res) => {
130
-      if(res.data) {
131
-        res.data.currentTime = formatActivity(res.data.expire_time_seconds)
132
-        this.setData({
133
-          activity: res.data
134
-        })
135
-        this.timer_ = setInterval(() => {
136
-          if(res.data.expire_time_seconds <= 0) {
137
-            clearInterval(this.timer_);
138
-          }
139
-          res.data.expire_time_seconds--
140
-          res.data.currentTime = formatActivity(res.data.expire_time_seconds)
141
-          this.setData({
142
-            activity: res.data
143
-          })
144
-        }, 1000);
145
-      }
146
-    })
147
-  },
148 109
 })

+ 7 - 6
pages/member/member.wxml

@@ -62,16 +62,17 @@
62 62
   <view class="item-radius" style="margin-top: 20rpx;">
63 63
     <navigator url="/pages/recordList/recordList">
64 64
       <view class="item line">
65
-        <image class="icon-left" src="/images/tools_07.png"></image>
65
+        <image class="icon-left" src="/images/icon_tools_01.png"></image>
66 66
         <text class="flex1">门店检查记录</text>
67
-        <text class="active" style="color:#999999;">今日未检查</text>
67
+        <!-- check_status -->
68
+        <text class="active" style="color:#999999;">{{ userInfo.check_status == 1 ? '今日已检查' : '今日未检查' }}</text>
68 69
         <image class="icon-right" src="/images/right.png"></image>
69 70
       </view>
70 71
     </navigator>
71 72
 
72 73
     <navigator url="/pages/beautyPlanList/beautyPlanList">
73 74
       <view class="item line">
74
-        <image class="icon-left" src="/images/tools_08.png"></image>
75
+        <image class="icon-left" src="/images/icon_tools_02.png"></image>
75 76
         <text class="flex1">门店客户记录</text>
76 77
         <!-- <text class="active" wx:if="{{ userInfo.card_num>0 }}">{{userInfo.card_num}}张可用</text> -->
77 78
         <image class="icon-right" src="/images/right.png"></image>
@@ -80,7 +81,7 @@
80 81
     
81 82
     <navigator url="/pages/dossier/dossier">
82 83
       <view class="item line">
83
-        <image class="icon-left" src="/images/tools_02.png"></image>
84
+        <image class="icon-left" src="/images/icon_tools_03.png"></image>
84 85
         <text class="flex1">个人信息</text>
85 86
         <text class="active" style="color:#999999;">去修改</text>
86 87
         <image class="icon-right" src="/images/right.png"></image>
@@ -91,14 +92,14 @@
91 92
   <view class="item-radius" style="margin-top: 20rpx;">
92 93
     <navigator url="/pages/role/role" hover-class="none">
93 94
       <view class="item line">
94
-        <image class="icon-left" src="/images/tools_05.png"></image>
95
+        <image class="icon-left" src="/images/icon_tools_04.png"></image>
95 96
         <text class="flex1">切换角色</text>
96 97
         <image class="icon-right" src="/images/right.png"></image>
97 98
       </view>
98 99
     </navigator>
99 100
     <navigator url="/pages/contact/contact" hover-class="none">
100 101
       <view class="item">
101
-        <image class="icon-left" src="/images/tools_06.png"></image>
102
+        <image class="icon-left" src="/images/icon_tools_05.png"></image>
102 103
         <text class="flex1">联系我们</text>
103 104
         <!-- <text class="active" style="color:#999999;">去修改</text> -->
104 105
         <image class="icon-right" src="/images/right.png"></image>

+ 1 - 1
pages/member/member.wxss

@@ -187,7 +187,7 @@ page {
187 187
   width: 48rpx;
188 188
   height: 48rpx;
189 189
   margin-right: 20rpx;
190
-  background-color: #ccc;
190
+  /* background-color: #ccc; */
191 191
 }
192 192
 
193 193
 .tools .item .icon-right {

+ 47 - 12
pages/name/name.js

@@ -1,20 +1,33 @@
1
-// import {
2
-//   get, post,
3
-// } from '../../utils/http';
1
+import {
2
+  get, post,
3
+} from '../../utils/http';
4 4
 Page({
5 5
 
6 6
   /**
7 7
    * 页面的初始数据
8 8
    */
9 9
   data: {
10
-    userInfo: {}
10
+    userInfo: {},
11
+    customerInfo: {},
12
+    name: '',
13
+    type: '',
14
+    userId: ''
11 15
   },
12 16
 
13 17
   /**
14 18
    * 生命周期函数--监听页面加载
15 19
    */
16 20
   onLoad: function (options) {
17
-    // this.getUserFiles()
21
+    console.log(options)
22
+    if(options.userId) {
23
+      this.setData({
24
+        name: options.name,
25
+        type: options.type,
26
+        userId: options.userId
27
+      })
28
+    } else {
29
+      this.getUserFiles()
30
+    }
18 31
   },
19 32
 
20 33
   /**
@@ -71,16 +84,36 @@ Page({
71 84
    */
72 85
   onChangeName(e) {
73 86
     this.setData({
74
-      ['userInfo.real_name']: e.detail.value,
87
+      ['userInfo.realname']: e.detail.value,
88
+    })
89
+  },
90
+
91
+  /**
92
+   * 更新客户档案
93
+   * Customer
94
+   * 
95
+  */
96
+  setCustomerInfo() {
97
+    let { userInfo,type,userId } = this.data;
98
+    post('api/user/update',{
99
+      user_id: userId,
100
+      [type]: userInfo.realname
101
+    },(res) => {
102
+      wx.showToast({
103
+        title: '修改成功',
104
+      })
105
+      setTimeout(() => {
106
+        wx.navigateBack()
107
+      }, 1000);
75 108
     })
76 109
   },
77 110
 
78 111
   /**
79
-   * 获取用户档案
112
+   * 获取美导师用户档案
80 113
    * api/user/files
81 114
    */
82 115
   getUserFiles() {
83
-    get('api/user/files', {}, (res) => {
116
+    get('api/mruser/info', {}, (res) => {
84 117
       this.setData({
85 118
         userInfo: res.data
86 119
       })
@@ -88,18 +121,20 @@ Page({
88 121
   },
89 122
 
90 123
   /**
91
-   * 更新用户档案
124
+   * 更新美导师档案
92 125
    * api/user/save_files
93 126
    */
94 127
   setUserFiles() {
95 128
     let {
96
-      real_name,
129
+      avatar_url,
130
+      realname,
97 131
       birthday,
98 132
       sex,
99 133
       city
100 134
     } = this.data.userInfo;
101
-    post('api/user/save_files', {
102
-      real_name,
135
+    post('api/mruser/update', {
136
+      avatar_url,
137
+      realname,
103 138
       birthday,
104 139
       sex,
105 140
       city

+ 3 - 2
pages/name/name.wxml

@@ -1,4 +1,5 @@
1 1
 <view class="content flex-column flex-align-center">
2
-  <input type="text" focus maxlength="20" placeholder="请输入姓名" value="{{userInfo.real_name}}" bindinput="onChangeName"/>
3
-  <view class="btn border-radius flex-center" bindtap="setUserFiles">确定</view>
2
+  <input type="text" focus maxlength="20" placeholder="请输入姓名" value="{{userId ? name :userInfo.realname}}" bindinput="onChangeName"/>
3
+  <view class="btn border-radius flex-center" bindtap="setCustomerInfo" wx:if="{{ type }}">确定</view>
4
+  <view class="btn border-radius flex-center" bindtap="setUserFiles" wx:else>确定</view>
4 5
 </view>

+ 41 - 3
pages/role/role.js

@@ -1,18 +1,22 @@
1
-// pages/role/role.js
1
+import {
2
+  get,
3
+  post
4
+} from '../../utils/http';
2 5
 Page({
3 6
 
4 7
   /**
5 8
    * 页面的初始数据
6 9
    */
7 10
   data: {
8
-    current: 0
11
+    current: 0,
12
+    list: []
9 13
   },
10 14
 
11 15
   /**
12 16
    * 生命周期函数--监听页面加载
13 17
    */
14 18
   onLoad: function (options) {
15
-
19
+    this.getMruserRole()
16 20
   },
17 21
 
18 22
   /**
@@ -68,5 +72,39 @@ Page({
68 72
     this.setData({
69 73
       current: e.currentTarget.dataset.index
70 74
     })
75
+  },
76
+
77
+  /**
78
+   * 获取美容师列表
79
+   * api/mruser/role
80
+  */
81
+  getMruserRole() {
82
+    get('api/mruser/role',{},(res) => {
83
+      this.setData({
84
+        list: res.data
85
+      })
86
+    })
87
+  },
88
+
89
+  /**
90
+   * 提交
91
+  */
92
+  onSubmit() {
93
+    // this
94
+    // api/mruser/change_role
95
+    let { current,list } = this.data;
96
+    post('api/mruser/change_role',{
97
+      role_id: list[current].id
98
+    },(res) => {
99
+      wx.showToast({
100
+        title: res.msg,
101
+        icon: 'none'
102
+      })
103
+      setTimeout(() => {
104
+        wx.reLaunch({
105
+          url: '/pages/home/home',
106
+        })
107
+      }, 1500);
108
+    })
71 109
   }
72 110
 })

+ 2 - 2
pages/role/role.wxml

@@ -1,7 +1,7 @@
1 1
 <view class="content">
2
-  <view class="item flex-align-center {{ index== current ? 'active' : '' }}" wx:for="{{ 3 }}" wx:key="index" bindtap="onChangeRole" data-index="{{index}}">南山店美导师3号</view>
2
+  <view class="item flex-align-center {{ index== current ? 'active' : '' }}" wx:for="{{ list }}" wx:key="index" bindtap="onChangeRole" data-id="{{ item.id }}" data-index="{{index}}">{{ item.name }}</view>
3 3
 </view>
4 4
 
5 5
 <view class="btn-box">
6
-  <view class="btn flex-center">确认</view>
6
+  <view class="btn flex-center" bindtap="onSubmit">确认</view>
7 7
 </view>

+ 30 - 4
pages/tagsEdit/tagsEdit.js

@@ -1,18 +1,28 @@
1
-// pages/tagsEdit/tagsEdit.js
1
+import {
2
+  get, post,
3
+} from '../../utils/http';
2 4
 Page({
3 5
 
4 6
   /**
5 7
    * 页面的初始数据
6 8
    */
7 9
   data: {
8
-
10
+    user_id: ''
9 11
   },
10 12
 
11 13
   /**
12 14
    * 生命周期函数--监听页面加载
13 15
    */
14 16
   onLoad: function (options) {
15
-
17
+    console.log(options)
18
+    if(options.user_id) {
19
+      this.setData({
20
+        user_id: options.user_id
21
+      },() => {
22
+        this.getUserInfo()
23
+      })
24
+    }
25
+    
16 26
   },
17 27
 
18 28
   /**
@@ -62,5 +72,21 @@ Page({
62 72
    */
63 73
   onShareAppMessage: function () {
64 74
 
65
-  }
75
+  },
76
+
77
+    /**
78
+   * 获取用户信息
79
+   * api/user/info
80
+  */
81
+  getUserInfo() {
82
+    let { user_id } = this.data;
83
+    get('api/user/info',{
84
+      user_id
85
+    },(res) => {
86
+      this.setData({
87
+        userInfo: res.data
88
+      })
89
+      console.log(res)
90
+    })
91
+  },
66 92
 })

+ 2 - 2
pages/tagsEdit/tagsEdit.wxml

@@ -1,10 +1,10 @@
1 1
 <view class="content">
2 2
   <view class="title flex-align-center">
3 3
     <text style="font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;">客户标签</text>
4
-    <text style="font-size: 28rpx;color:#999;margin-left: 10rpx;">(3/10)</text>
4
+    <text style="font-size: 28rpx;color:#999;margin-left: 10rpx;">({{userInfo.tags.length || 0}}/10)</text>
5 5
   </view>
6 6
   <view class="list">
7
-    <view class="item flex-align-center" wx:for="{{ 3 }}" wx:key="index">爱美乐观派</view>
7
+    <view class="item flex-align-center" wx:for="{{ userInfo.tags }}" wx:key="index">{{ item }}</view>
8 8
   </view>
9 9
   <view class="no-more-data">没有更多标签啦~</view>
10 10
 </view>