Bläddra i källkod

Merge branch 'master' of http://git.cc-lotus.info/ball-court/court-mobile

zs 3 år sedan
förälder
incheckning
f7c2d0f074
5 ändrade filer med 22 tillägg och 20 borttagningar
  1. 1 1
      pages/information/index.wxml
  2. 1 1
      pages/login/index.js
  3. 0 1
      pages/me/index.js
  4. 19 16
      pages/password/index.js
  5. 1 1
      project.config.json

+ 1 - 1
pages/information/index.wxml

@@ -17,7 +17,7 @@
                 <view class="one">
                     <view class="text">性别</view>
                     <picker name="gender" mode="selector" bindchange="bindPickerChange" range-key="name" value="{{form.gender}}" range="{{genderList}}">
-                        <view class="input">{{form.gender}}</view>
+                        <view class="input">{{form.gender||'选择性别'}}</view>
                     </picker>
                 </view>
                 <view class="one">

+ 1 - 1
pages/login/index.js

@@ -33,7 +33,7 @@ Page({
         wx.showToast({ title: `账号登录成功`, icon: 'success', duration: 2000 }) //登录成功提示
         wx.navigateTo({ url: '/pages/home/index' })// 跳转页面
       } else {
-        wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
+        wx.showToast({ title: res.errmsg, icon: 'none', duration: 2000 })
       }
     }
   },

+ 0 - 1
pages/me/index.js

@@ -52,7 +52,6 @@ Page({
   //个人用户-团队详情
   ToDetails: function (e) {
     let id = e.currentTarget.dataset.id;
-    let type = this.data.item1.type;
     wx.navigateTo({ url: `/pages/teamDetails/detail?id=${id}` })
   },
   // 我的服务-功能按钮

+ 19 - 16
pages/password/index.js

@@ -10,8 +10,8 @@ Page({
         // 主体高度
         infoHeight: '',
         frameStyle: { useTop: true, name: '修改密码', leftArrow: true, useBar: false },
-        form: {}
-    },  
+        form: {},
+    },
     //验证必填项    
     initValidate() {
         const rules = { password: { required: true }, }
@@ -25,30 +25,32 @@ Page({
     //提交
     formSubmit: function (e) {
         const value = e.detail.value;
+        var id = this.data.id;
         if (!this.WxValidate.checkForm(value)) {
             const error = this.WxValidate.errorList[0];
             wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
             return false
         } else {
             wx.request({
-                url: `${app.globalData.publicUrl}/courtAdmin/api/user/updatePwd/${res.data.id}`,
+                url: `${app.globalData.publicUrl}/courtAdmin/api/user/updatePwd/${id}`,
                 method: "post",
                 data: value,
                 header: {},
                 success: res => {
-                    if (res.data.errcode == 0) {
-                        wx.showToast({
-                            title: '保存成功',
-                            icon: 'success',
-                            duration: 2000
-                        })
-                    } else {
-                        wx.showToast({
-                            title: '保存失败',
-                            icon: 'success',
-                            duration: 2000
-                        })
-                    }
+                    wx.showModal({
+                        title: '是否修改密码',
+                        success(res) {
+                            if (res.confirm) {
+                                wx.removeStorage({
+                                    key: 'token',
+                                    success(res) {
+                                        return wx.redirectTo({ url: '/pages/index/index', })
+                                    }
+                                })
+                            } else if (res.cancel) {
+                            }
+                        }
+                    })
                 },
             })
         }
@@ -71,6 +73,7 @@ Page({
         wx.getStorage({
             key: 'token',
             success: res => {
+                that.setData({ id: res.data.id })
                 wx.request({
                     url: `${app.globalData.publicUrl}/courtAdmin/api/user/${res.data.id}`,
                     method: "get",

+ 1 - 1
project.config.json

@@ -41,6 +41,6 @@
   "compileType": "miniprogram",
   "libVersion": "2.23.3",
   "appid": "wx0fd4b616bc7cf3bb",
-  "projectname": "%E8%B5%9B%E5%9C%BA",
+  "projectname": "court-mobile",
   "condition": {}
 }