D:删除调试用的console.log。

F:修复输入姓名和手机时不保存的问题
This commit is contained in:
iamdarcy 2023-04-13 06:48:49 +08:00
parent 2553839224
commit f98b9ddf26
6 changed files with 12 additions and 23 deletions

View File

@ -42,7 +42,6 @@ Page({
let code = ''; let code = '';
wx.login({ wx.login({
success: (res) => { success: (res) => {
console.log(res)
code = res.code; code = res.code;
}, },
}); });
@ -59,7 +58,6 @@ Page({
rawData: res.rawData, rawData: res.rawData,
signature: res.signature signature: res.signature
}; };
console.log(loginParams);
that.postLogin(loginParams); that.postLogin(loginParams);
}, },
// 失败回调 // 失败回调
@ -73,14 +71,12 @@ Page({
util.request(api.AuthLoginByWeixin, { util.request(api.AuthLoginByWeixin, {
info: info info: info
}, 'POST').then(function (res) { }, 'POST').then(function (res) {
console.log(res);
if (res.errno === 0) { if (res.errno === 0) {
wx.setStorageSync('userInfo', res.data.userInfo); wx.setStorageSync('userInfo', res.data.userInfo);
wx.setStorageSync('token', res.data.token); wx.setStorageSync('token', res.data.token);
app.globalData.userInfo = res.data.userInfo; app.globalData.userInfo = res.data.userInfo;
app.globalData.token = res.data.token; app.globalData.token = res.data.token;
let is_new = res.data.is_new; //服务器返回的数据; let is_new = res.data.is_new; //服务器返回的数据;
console.log(is_new);
if (is_new == 0) { if (is_new == 0) {
util.showErrorToast('您已经是老用户啦!'); util.showErrorToast('您已经是老用户啦!');
wx.navigateBack(); wx.navigateBack();

View File

@ -21,6 +21,9 @@ Page({
autoplay: true, autoplay: true,
showContact: 1, showContact: 1,
}, },
onLoad: function (options) {
this.getChannelShowInfo();
},
onPageScroll: function (e) { onPageScroll: function (e) {
let scrollTop = e.scrollTop; let scrollTop = e.scrollTop;
let that = this; let that = this;
@ -93,9 +96,7 @@ Page({
} }
}); });
}, },
onLoad: function (options) {
this.getChannelShowInfo();
},
onShow: function () { onShow: function () {
this.getIndexData(); this.getIndexData();
var that = this; var that = this;

View File

@ -27,13 +27,11 @@ Page({
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: ['w6AMCJ0FI2LqjCjWPIrpnVWTsFgnlNlmCf9TTDmG6_U'], tmplIds: ['w6AMCJ0FI2LqjCjWPIrpnVWTsFgnlNlmCf9TTDmG6_U'],
success(res) { success(res) {
console.log(res);
wx.switchTab({ wx.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, },
fail(err) { fail(err) {
console.log(err);
wx.switchTab({ wx.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });

View File

@ -98,11 +98,8 @@ Page({
getSettingsDetail() { getSettingsDetail() {
let that = this; let that = this;
util.request(api.SettingsDetail).then(function (res) { util.request(api.SettingsDetail).then(function (res) {
console.log(res)
if (res.errno === 0) { if (res.errno === 0) {
let userInfo = res.data; let userInfo = res.data;
console.log('userInfo')
console.log(userInfo)
// wx.setStorageSync('userInfo', userInfo); // wx.setStorageSync('userInfo', userInfo);
that.setData({ that.setData({
userInfo: userInfo, userInfo: userInfo,

View File

@ -29,10 +29,8 @@ Page({
if (res.statusCode == 200) { if (res.statusCode == 200) {
let re = res.data let re = res.data
let echo = JSON.parse(re); let echo = JSON.parse(re);
console.log(echo);
let data = echo.data; let data = echo.data;
let avatarUrl = data.fileUrl let avatarUrl = data.fileUrl
console.log(avatarUrl)
that.setData({ that.setData({
avatarUrl: avatarUrl, avatarUrl: avatarUrl,
hasAvatar: 1 hasAvatar: 1
@ -100,7 +98,6 @@ Page({
util.showErrorToast('请输入昵称'); util.showErrorToast('请输入昵称');
return false; return false;
} }
console.log(avatar)
util.request(api.SaveSettings, { util.request(api.SaveSettings, {
name: name, name: name,
mobile: mobile, mobile: mobile,

View File

@ -5,15 +5,15 @@
<view class='edit-container'> <view class='edit-container'>
<view class="a-item"> <view class="a-item">
<image class="icon" src="/images/icon/nick.png"></image> <image class="icon" src="/images/icon/nick.png"></image>
<input type="nickname" class="a-input" bindblur="bindinputNickName" value="{{nickName}}" placeholder="请输入昵称" /> <input type="nickname" class="a-input" bindinput="bindinputNickName" bindblur="bindinputNickName" value="{{nickName}}" placeholder="请输入昵称" />
</view> </view>
<view class="a-item"> <view class="a-item">
<image class="icon" src="/images/icon/receiver.png"></image> <image class="icon" src="/images/icon/receiver.png"></image>
<input class='a-input' bindblur="bindinputName" placeholder='请输入姓名' value="{{name}}"></input> <input class='a-input' bindinput="bindinputName" bindblur="bindinputName" placeholder='请输入姓名' value="{{name}}"></input>
</view> </view>
<view class="a-item"> <view class="a-item">
<image class="icon" src="/images/icon/mobile.png"></image> <image class="icon" src="/images/icon/mobile.png"></image>
<input class='a-input' bindblur="mobilechange" value="{{mobile}}" placeholder='请输入手机'></input> <input class='a-input' bindinput="mobilechange" bindblur="mobilechange" value="{{mobile}}" placeholder='请输入手机'></input>
</view> </view>
</view> </view>
<view class='wrap-btn'> <view class='wrap-btn'>