18016688350 4 years ago
parent
commit
cba5fea41d
3 changed files with 18 additions and 2 deletions
  1. 10 2
      pages/agent/add.js
  2. 7 0
      pages/agent/add.wxml
  3. 1 0
      pages/device/index.js

+ 10 - 2
pages/agent/add.js

@@ -8,6 +8,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    userInfo:{},
     user: {
       username:'',
       realname:'',
@@ -21,7 +22,9 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.setData({
+      userInfo: app.globalData.userInfo,
+    })
   },
 
   /**
@@ -86,7 +89,12 @@ Page({
       name: "agentPhone",
       rule: ["required", "isMobile"],
       msg: ["请输入代理手机号", "请输入正确的手机号"]
-    }];
+    },{
+      name: "areaDivide",
+      rule: ["required"],
+      msg: ["请输入代理分成"]
+    }
+    ];
     //进行表单检查
     let formData = e.detail.value;
     let checkRes = form.validation(formData, rules);

+ 7 - 0
pages/agent/add.wxml

@@ -28,6 +28,13 @@
       </view>
     </tui-list-cell>
 
+    <tui-list-cell hover="{{false}}" wx:if="{{userInfo.mgvmRole==3}}">
+      <view class="tui-line-cell">
+        <view class="tui-title">代理分成%:</view>
+        <input placeholder-class="phcolor" class="tui-input" name="areaDivide" placeholder="请输入代理分成百分比" maxlength="50" catchinput="inputedit" type="number" data-name="user.areaDivide"/>
+      </view>
+    </tui-list-cell>
+
     <view class="tui-btn-box">
       <button class="btn-primary margin-bottom-xs" hover-class="btn-hover" formType="submit" type="primary" bindtap="addStore">提交</button>
       <button class="btn-primary btn-gray" hover-class="btn-gray-hover" formType="reset">重置</button>

+ 1 - 0
pages/device/index.js

@@ -70,6 +70,7 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
+    var that = this
     //只是测试效果,逻辑以实际数据为准
     this.setData({
       loadding: true,