bayi 1 year atrás
parent
commit
e888efb03c

+ 4 - 0
pages/editUser/index.js

@@ -96,6 +96,10 @@ Page({
         let nickName = e.detail.value;
         if (nickName == this.data.userInfo.nickName) {
             return
+        } else if (!nickName) {
+            return this.setData({
+                ['userInfo.nickName']: this.data.userInfo.nickName
+            })
         }
         this.setUserInfo({
             nickName

+ 18 - 55
salesperson/pages/saleOffice/index.js

@@ -1,62 +1,25 @@
-// salesperson/pages/saleOffice/index.js
+import {
+    getMyInfo,
+} from '~/api/user'
+import {
+    createStoreBindings
+} from 'mobx-miniprogram-bindings'
+import {
+    store
+} from '~/store/index'
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
+        userInfo: {},
     },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
+    async onLoad() {
+        // 手工绑定 
+        this.storeBindings = createStoreBindings(this, {
+            store,
+            fields: {
+                userInfo: 'userInfo',
+            }
+        })
     },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
     /**
      * 用户点击右上角分享
      */

+ 2 - 1
salesperson/pages/saleOffice/index.json

@@ -1,3 +1,4 @@
 {
-    "usingComponents": {}
+    "usingComponents": {},
+    "navigationBarTitleText": "推荐中心"
 }

+ 59 - 1
salesperson/pages/saleOffice/index.less

@@ -1 +1,59 @@
-/* salesperson/pages/saleOffice/index.wxss */
+.container {
+    position: relative;
+    height: 100vh;
+    padding: 38rpx 24rpx;
+    background: url(https://reader-wx.ai160.com/images/reader/sell/bg1.jpg)no-repeat;
+    background-size: contain;
+
+    .userBox {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+
+        .left {
+            display: flex;
+
+            .avatar {
+                width: 106rpx;
+                height: 106rpx;
+                border-radius: 50%;
+                border: 1rpx solid white;
+            }
+
+            .identity {
+                margin-left: 24rpx;
+                .nickName {
+                    margin: 6rpx 0 20rpx;
+                    font-size: 30rpx;
+                }
+
+                .tag {
+                    padding: 5rpx 20rpx;
+                    border-radius: 20rpx;
+                    font-size: 22rpx;
+                    font-weight: bold;
+                    color: #FC6E1C;
+                    background: #FFFFFF;
+                }
+            }
+        }
+    }
+
+    .bottom {
+        position: absolute;
+        width: 100%;
+        padding: 26rpx 0;
+        bottom: 0;
+        left: 0;
+        background-color: white;
+
+        .btn {
+            margin: 0 auto;
+            width: 466rpx;
+            padding: 14rpx 0;
+            background: linear-gradient(180deg, #6EC8FF 0%, #31BDFE 100%);
+            border-radius: 39rpx;
+            color: white;
+        }
+    }
+}

+ 17 - 2
salesperson/pages/saleOffice/index.wxml

@@ -1,2 +1,17 @@
-<!--salesperson/pages/saleOffice/index.wxml-->
-<text>salesperson/pages/saleOffice/index.wxml</text>
+<view class="container">
+    <view class="userBox">
+        <view class="left">
+            <image class='avatar' src='{{ userInfo.avatar}}'></image>
+            <view class="identity">
+                <view class="nickName">{{ userInfo.nickName}}</view>
+                <view class="tag">初级团长</view>
+            </view>
+        </view>
+    </view>
+
+    <view class="bottom">
+        <button class="resetBtn btn" open-type="share">
+            邀请用户
+        </button>
+    </view>
+</view>

+ 52 - 1
salesperson/pages/saleOffice/index.wxss

@@ -1 +1,52 @@
-/* salesperson/pages/saleOffice/index.wxss */
+.container {
+  position: relative;
+  height: 100vh;
+  padding: 38rpx 24rpx;
+  background: url(https://reader-wx.ai160.com/images/reader/sell/bg1.jpg) no-repeat;
+  background-size: contain;
+}
+.container .userBox {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.container .userBox .left {
+  display: flex;
+}
+.container .userBox .left .avatar {
+  width: 106rpx;
+  height: 106rpx;
+  border-radius: 50%;
+  border: 1rpx solid white;
+}
+.container .userBox .left .identity {
+  margin-left: 24rpx;
+}
+.container .userBox .left .identity .nickName {
+  margin: 6rpx 0 20rpx;
+  font-size: 30rpx;
+}
+.container .userBox .left .identity .tag {
+  padding: 5rpx 20rpx;
+  border-radius: 20rpx;
+  font-size: 22rpx;
+  font-weight: bold;
+  color: #FC6E1C;
+  background: #FFFFFF;
+}
+.container .bottom {
+  position: absolute;
+  width: 100%;
+  padding: 26rpx 0;
+  bottom: 0;
+  left: 0;
+  background-color: white;
+}
+.container .bottom .btn {
+  margin: 0 auto;
+  width: 466rpx;
+  padding: 14rpx 0;
+  background: linear-gradient(180deg, #6EC8FF 0%, #31BDFE 100%);
+  border-radius: 39rpx;
+  color: white;
+}