元子 6 ヶ月 前
コミット
72db570d28

+ 1 - 1
pages/home/home.js

@@ -82,7 +82,7 @@ Page({
                 name: '会议服务',
                 img: '/static/home/home-9.png',
                 url: '/pages/orderMeal/index/index?type=order-audit',
-                jurisdiction: [2],
+                jurisdiction: [3],
             },
         ],
         // accountId: null,

+ 1 - 1
pages/home/home.wxml

@@ -27,7 +27,7 @@
             </view>
             <!-- 功能区 -->
             <view class="flex fun">
-                <view class="item" wx:for="{{funList}}" wx:key="index" bindtap="goFun" data-item="{{item}}" wx:if="{{utils.indexOf(item.)}}" wx:if="{{utils.indexOf(item.jurisdiction,userInfo.appointmentAuth,userInfo.checkAuth)}}">
+                <view class="item" wx:for="{{funList}}" wx:key="index" bindtap="goFun" data-item="{{item}}" wx:if="{{utils.indexOf(item.)}}" wx:if="{{utils.indexOf(item.jurisdiction,userInfo.appointmentAuth,userInfo.checkAuth,userInfo.serivceAuth)}}">
                     <image class="item-icon" src="{{item.img}}" mode="" />
                     {{item.name}}
                 </view>

+ 4 - 3
pages/home/home.wxss

@@ -6,10 +6,11 @@
 
 .top-area {
     position: absolute;
-    width: 1300rpx;
+    /* width: 1300rpx; */
+    width: 100%;
     height: 368rpx;
-    border-bottom-left-radius: 80%;
-    border-bottom-right-radius: 80%;
+    border-bottom-left-radius: 7%;
+    border-bottom-right-radius: 7%;
     background-color: #495dfc;
 }
 

+ 2 - 2
pages/login/index.wxml

@@ -10,11 +10,11 @@
         <view class="login">
             <view class="item">
                 <view class="tit">账号</view>
-                <input type="text" value="{{username}}" placeholder="请输入您的账号" placeholder-class="center" bindinput="getVal" data-type="username"></input>
+                <input class="login-input" type="text" value="{{username}}" placeholder="请输入您的账号" placeholder-class="center" bindinput="getVal" data-type="username"></input>
             </view>
             <view class="item">
                 <view class="tit">密码</view>
-                <input password="{{!open}}" data-type="password" value="{{form.password}}" placeholder="请输入您的密码" placeholder-class="center" bindinput="getVal" />
+                <input class="login-input" password="{{!open}}" data-type="password" value="{{form.password}}" placeholder="请输入您的密码" placeholder-class="center" bindinput="getVal" />
                 <van-icon class="position" name="eye-o" wx:if="{{open}}" bindtap="switch" />
                 <van-icon class="position" name="closed-eye" wx:if="{{!open}}" bindtap="switch" />
             </view>

+ 8 - 4
pages/login/index.wxss

@@ -7,10 +7,11 @@
 
 .top-area {
     position: absolute;
-    width: 1300rpx;
+    /* width: 1300rpx; */
+    width: 100%;
     height: 368rpx;
-    border-bottom-left-radius: 80%;
-    border-bottom-right-radius: 80%;
+    border-bottom-left-radius: 7%;
+    border-bottom-right-radius: 7%;
     background-color: #495dfc;
 }
 .user {
@@ -44,9 +45,12 @@
 }
 .position{
     position: absolute;
-    top: 57rpx;
+    top: 70rpx;
     right: 0;
 }
 input{
     width: 500rpx;
+}
+.login-input{
+  height: 75rpx;
 }

+ 4 - 4
pages/mine/index/index.js

@@ -16,10 +16,10 @@ Page({
                 name: '身份信息',
                 id: 1,
             },
-            // {
-            //     name: '个人信息',
-            //     id: 2,
-            // },
+            {
+                name: '修改密码',
+                id: 2,
+            },
         ]
     },
     goLogin() {

+ 7 - 6
pages/mine/index/index.wxss

@@ -8,10 +8,11 @@
 
 .top-area {
     position: absolute;
-    width: 1300rpx;
-    height: 368rpx;
-    border-bottom-left-radius: 80%;
-    border-bottom-right-radius: 80%;
+   /* width: 1300rpx; */
+   width: 100%;
+   height: 368rpx;
+   border-bottom-left-radius: 7%;
+   border-bottom-right-radius: 7%;
     background-color: #495dfc;
 }
 
@@ -86,9 +87,9 @@
     /* border-bottom: 1rpx solid #f0f0f0; */
 }
 
-/* .item:first-child {
+.item:first-child {
     border-bottom: 1rpx solid #f0f0f0;
-} */
+}
 
 .status {
     position: absolute;

+ 55 - 5
pages/mine/personage/index.js

@@ -1,18 +1,65 @@
 // pages/mine/personage/index.js
+import {
+  updateUserPassword
+} from '../../../utils/api/api.js'
 Page({
 
     /**
      * 页面的初始数据
      */
     data: {
-
+      password:'',
+      open: false, //默认不显示密码
+      userInfo: null,
     },
-    getValue(e) {
-        let type = e.currentTarget.dataset.type
+    getVal(e) {
+        let type = e.target.dataset.type
         this.setData({
-            [type]: e.detail
+            [type]: e.detail.value
         });
     },
+    switch () {
+      this.setData({
+          open: !this.data.open
+      })
+  },
+  submit(){
+    if (!this.data.password) {
+      wx.showToast({
+          title: '请填写密码',
+          icon: 'none'
+      })
+      return
+    }
+    if(!/^(((?=.*\d)(?=.*[a-z])(?=.*[A-Z]))|((?=.*\d)(?=.*[a-z])(?=.*[~!@#$%^&*]))|((?=.*\d)(?=.*[A-Z])(?=.*[~!@#$%^&*]))|((?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&*]))|((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&*]))).{10,32}$/.test(
+      this.data.password
+    )){
+      wx.showToast({
+        title: '密码格式有误',
+        icon: 'none'
+    })
+    return
+    }
+    const params ={
+      newPassword:this.data.password
+    }
+    updateUserPassword(params).then(res=>{
+        wx.showToast({
+            title: '修改成功,即将重新登录',
+            icon: 'none',
+            duration: 2000,
+            mask: true,
+            success: function () {
+                setTimeout(function () {
+                    wx.removeStorageSync('userInfo')
+                    wx.navigateTo({
+                        url: '/pages/login/index',
+                    })
+                }, 800)
+            }
+        })
+    })
+  },
     /**
      * 生命周期函数--监听页面加载
      */
@@ -31,7 +78,10 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow() {
-
+      const userInfo = wx.getStorageSync('userInfo')
+      this.setData({
+        userInfo
+      })
     },
 
     /**

+ 1 - 1
pages/mine/personage/index.json

@@ -1,4 +1,4 @@
 {
     "usingComponents": {},
-    "navigationBarTitleText":"个人信息"
+    "navigationBarTitleText":"修改密码"
 }

+ 18 - 2
pages/mine/personage/index.wxml

@@ -1,7 +1,23 @@
 <!--pages/mine/personage/index.wxml-->
 <view class="page">
-    <handle-module title="卡号" placeholder="请输入卡号" data-type="aaaaa" bindchange="getValue" />
+  <view class="personage-top">
+        <view class="personage-top-left">请为您的账号</view>
+        <view class="personage-top-text">{{userInfo?userInfo.appletUsername:''}}</view>
+        <view class="personage-top-left">设置一个新密码</view>
+  </view>
+  <view class="personage-main">
+    <view class="personage-main-text">密码</view>
+    <view class="personage-main-right">
+      <input class="personage-main-input" password="{{!open}}" data-type="password" value="{{password}}" placeholder="请输入您的密码" placeholder-class="center" bindinput="getVal"   />
+      <van-icon class="personage-icon" name="eye-o" wx:if="{{open}}" bindtap="switch" />
+      <van-icon class="personage-icon" name="closed-eye" wx:if="{{!open}}" bindtap="switch" />
+    </view>
+  </view>
+  <view class="personage-tit">
+    <van-icon name="info" />
+    必须大小写字母、数字、特殊字符,4种组合中至少满足3种,且密码长度在10-32位之间。
+  </view>
 </view>
 <view class="btn-area">
-    <button bindtap="goLogin">确定</button>
+    <button bindtap="submit">保存新密码</button>
 </view>

+ 47 - 0
pages/mine/personage/index.wxss

@@ -2,6 +2,53 @@
 .page{
     padding: 16rpx 0;
 }
+.personage-top{
+  height: 120rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background-color: #fff;
+  margin-bottom: 20rpx;
+}
+.personage-top-left{
+  font-weight: 400;
+  font-size: 28rpx;
+  line-height: 42rpx;
+  color: #606266;
+  margin: 0 10rpx;
+}
+.personage-top-text{
+font-size: 40rpx;
+font-weight: 700;
+line-height: 60rpx;
+color: #222222;
+}
+.personage-main{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0 30rpx;
+  height: 112rpx;
+  background-color: #fff;
+}
+.personage-main-right{
+  display: flex;
+  align-items: center;
+}
+.personage-main-input{
+ width: 500rpx;
+ height: 80rpx;
+}
+.personage-icon{
+  margin-left: 20rpx;
+}
+.personage-tit{
+  margin: 10rpx 30rpx;
+  font-size: 24rpx;
+  font-weight: 400;
+  line-height: 36rpx;  
+  color: #8F90A6;
+}
 .btn-area>button{
     background-color: #5158fc;
 }

+ 1 - 1
project.private.config.json

@@ -2,7 +2,7 @@
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "projectname": "meeting-management-applet",
     "setting": {
-        "compileHotReLoad": false,
+        "compileHotReLoad": true,
         "urlCheck": false
     },
     "condition": {

+ 10 - 1
utils/api/api.js

@@ -28,9 +28,18 @@ const updateUserInfo = (data) => {
         type: 'application/json'
     })
 }
-
+// 用户-修改用户密码
+const updateUserPassword = (data) => {
+  return request({
+      url: '/api/updatePassword',
+      data: data,
+      method: 'post',
+      type: 'application/json'
+  })
+}
 module.exports = {
     doGetInfo,
     doLogin,
     updateUserInfo,
+    updateUserPassword
 }

+ 1 - 1
utils/func/request.js

@@ -1,5 +1,5 @@
 //设置域名
-const dev_baseUrl = 'http://192.168.11.17:14001/ma-meeting'; //测试
+const dev_baseUrl = 'http://192.168.77.224:14001/ma-meeting'; //测试
 const pro_baseUrl = 'https://common.hz-hanghui.com:8087/ma-meeting'; //正式
 
 //是否是正式环境

+ 9 - 3
utils/util.wxs

@@ -1,6 +1,6 @@
-function indexOf(array, appointmentAuth, checkAuth) {
+function indexOf(array, appointmentAuth, checkAuth,serivceAuth) {
     // var userMsg= wx.getStorageSync('userMsg')
-    // 1预约权限;2审核权限 
+    // 1预约权限;2审核权限;3会议服务权限
     if (array) {
         if (array.length == 2 && (appointmentAuth || checkAuth)) {
             return true
@@ -13,13 +13,19 @@ function indexOf(array, appointmentAuth, checkAuth) {
             }
         }
         if (array.indexOf(2) > -1) {
-
             if (checkAuth) {
                 return true
             } else {
                 return false
             }
         }
+        if (array.indexOf(3) > -1) {
+          if (serivceAuth) {
+              return true
+          } else {
+              return false
+          }
+      }
     }
 }