Browse Source

党员中心户样式调整,登录接口联调

shibei
mk 1 year ago
parent
commit
1ce32921f0
  1. 4
      miniprogram/pages/formid/formid.wxml
  2. 1
      miniprogram/pages/home/home.js
  3. 12
      miniprogram/pages/login/login.js
  4. 2
      miniprogram/pages/login/login.wxml
  5. 35
      miniprogram/pages/my/my.js
  6. 4
      miniprogram/subpages/centralHousehold/pages/centralHousehold/centralHousehold.wxml
  7. 3
      miniprogram/subpages/centralHousehold/pages/centralHousehold/centralHousehold.wxss
  8. 8
      miniprogram/utils/api.js

4
miniprogram/pages/formid/formid.wxml

@ -27,7 +27,7 @@
<input confirm-type="next" bindblur="bindRealMobileInput" bindinput="bindRealMobileInput" value="{{form.mobile}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item ">
<view class="list-item " wx:if="{{!title}}">
<view class="left">
<text class="must">*</text>
<view class="title">密码</view>
@ -36,7 +36,7 @@
<input confirm-type="next" password bindblur="bindPassWordInput" bindinput="bindPassWordInput" value="{{form.password}}" placeholder-class="placeholder-style" placeholder="请输入" />
</view>
</view>
<view class="list-item ">
<view class="list-item " wx:if="{{!title}}">
<view class="left">
<text class="must">*</text>
<view class="title">确认密码</view>

1
miniprogram/pages/home/home.js

@ -48,6 +48,7 @@ Page({
// title: "加载中,请稍后",
// mask: true
// })
this.initLoad()
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,

12
miniprogram/pages/login/login.js

@ -7,7 +7,7 @@ Page({
* 页面的初始数据
*/
data: {
userName: '',//13000000001
mobile: '',//17637262085
password: ''//123456
},
@ -68,7 +68,7 @@ Page({
},
handleLogin () {
var that = this;
if (that.data.userName == '') {
if (that.data.mobile == '') {
wx.showToast({
title: '请输入用户名',
icon: 'none',
@ -92,11 +92,11 @@ Page({
var code = res.code;
if (code) {
var params = {
username: that.data.userName,
mobile: that.data.mobile,
password: that.data.password,
wxCode: code
};
api.userLogin(params).then( (res) =>{
api.getToken(params).then( (res) =>{
if (res.code == 0) {
wx.setStorageSync('token', res.data.token);
wx.setStorageSync('userTagKey', res.data.userTagKey);
@ -122,9 +122,9 @@ Page({
// getToken(){
// },
getUserName(e) {
getmobile(e) {
this.setData({
userName: e.detail.value
mobile: e.detail.value
});
},
getPassword (e) {

2
miniprogram/pages/login/login.wxml

@ -10,7 +10,7 @@
<image src="../../../../../../assets/images/name.png"></image>
</view> -->
<view class="info-input">
<input bindinput="getUserName" placeholder="请输入用户名" value="{{userName}}"></input>
<input bindinput="getUserName" placeholder="请输入用户名" value="{{mobile}}"></input>
</view>
</view>
<view class="password">

35
miniprogram/pages/my/my.js

@ -118,38 +118,23 @@ Page({
content: '确定退出登录',
success(res) {
if (res.confirm) {
than.logout()
// wx.showLoading({
// title: "退出中,请稍后...",
// mask: true,
// success() {
// setTimeout(() => {
// wx.removeStorage({
// key: 'token',
// })
// wx.reLaunch({
// url: '/pages/login/login'
// })
// }, 1000)
// }
// })
}
}
})
},
logout(){
api.logout().then(res=>{
if(res.code === 0){
wx.showLoading({
title: "退出中,请稍后...",
mask: true,
success() {
setTimeout(() => {
wx.removeStorage({
key: 'token',
})
wx.reLaunch({
url: '/pages/login/login'
})
}, 1000)
}
})
}
}
}).catch(err=>{
console.log(err);
})
},
tapchangeImg() {

4
miniprogram/subpages/centralHousehold/pages/centralHousehold/centralHousehold.wxml

@ -1,6 +1,8 @@
<!--subpages/redSail/pages/registerParty/registerParty.wxml-->
<view class="header" wx:if="{{informFlag}}">
<wux-icon type="ios-arrow-back" class="back" color="#fff" size="25" style=" top: {{statusHeight + 5}}px;"/>
<view class="back" style=" top: {{statusHeight + 5}}px;" bind:tap="handleBack">
<wux-icon type="ios-arrow-back" color="#fff" size="25" />
</view>
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
党员中心户
</view>

3
miniprogram/subpages/centralHousehold/pages/centralHousehold/centralHousehold.wxss

@ -41,6 +41,9 @@ page {
.header .back{
position: absolute;
left: 20rpx;
z-index: 3;
width: 50rpx;
height: 50rpx;
}
.gray {
background-color: #fafafa;

8
miniprogram/utils/api.js

@ -66,10 +66,10 @@ module.exports = {
getGridstyle: getGridstyle,
}
function getToken(wxCode) {
return fly.get("app-user/user/nmp/getToken", {
wxCode: wxCode
})
function getToken(params) {
return fly.get("app-user/user/nmp/getToken",
params
)
}
function bannerList(position) {

Loading…
Cancel
Save