@@ -1,7 +1,14 @@ | |||
{ | |||
"ext": { | |||
"attr": { | |||
"mchId": "1602801645", | |||
"car": { | |||
"etcp": { | |||
"etcpAppId": "wx192b7d2e8dcbefd0", | |||
"etcpVersion": "release", | |||
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback" | |||
} | |||
}, | |||
"mchId": "1604439800", | |||
"imgProxy": [ | |||
{ | |||
"newUrl": "https://ctest.malls.iformall.com/img", | |||
@@ -17,16 +24,12 @@ | |||
} | |||
], | |||
"configUrl": "https://ctest.malls.iformall.com/C/api", | |||
"etcpAppId": "wx219a81b9c87aa4f7", | |||
"etcpVersion": "release", | |||
"businessSwitch": "1", | |||
"businessVersion": "1", | |||
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback", | |||
"ifHaveWebSocket": "0", | |||
"ifHaveCarModular": "1" | |||
}, | |||
"name": "富茂光谷测试版", | |||
"weappId": "wx219a81b9c87aa4f7", | |||
"name": "金泸商务", | |||
"weappId": "wx649b3be73c1afe47", | |||
"appVersion": "C.test.5.2.0" | |||
}, | |||
"debug": false, | |||
@@ -74,15 +77,15 @@ | |||
}, | |||
"plugins": { | |||
"auto-points-plugin": { | |||
"version": "2.4.0", | |||
"version": "1.3.0", | |||
"provider": "wxfab2bf944bfc4da6" | |||
}, | |||
"live-player-plugin": { | |||
"version": "1.2.5", | |||
"version": "1.3.4", | |||
"provider": "wx2b03c6e691cd7370" | |||
} | |||
}, | |||
"extAppid": "wx219a81b9c87aa4f7", | |||
"extAppid": "wx649b3be73c1afe47", | |||
"extEnable": true, | |||
"permission": { | |||
"scope.userLocation": { | |||
@@ -2,6 +2,7 @@ let app = getApp(); | |||
const Http = require("../../utils/HttpBasics"); | |||
const bgColor = require("../../utils/bgColor.js") | |||
const config = require("../../config/config"); | |||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | |||
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0' | |||
Page({ | |||
@@ -9,6 +10,7 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
navigationBarHeight, | |||
avatarUrl: defaultAvatarUrl, | |||
theme: wx.getSystemInfoSync().theme, | |||
typeLsit: {}, | |||
@@ -46,22 +48,31 @@ Page({ | |||
avatarUrl: this.data.avatarUrl, | |||
nickName: e.detail.value.nickname | |||
} | |||
Http.post({ | |||
url: "/user/updateUserInfo", | |||
data, | |||
}).then(res => { | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: '更改成功!', | |||
duration: 2000 | |||
}) | |||
setTimeout(() => { | |||
wx.navigateBack() | |||
}, 2000) | |||
} | |||
}).catch(err => { | |||
console.log(err); | |||
}) | |||
if (data.nickName) { | |||
Http.post({ | |||
url: "/user/updateUserInfo", | |||
data, | |||
}).then(res => { | |||
if (res.code == 200) { | |||
wx.showToast({ | |||
title: '更改成功', | |||
icon: 'success', | |||
duration: 2000 | |||
}) | |||
setTimeout(() => { | |||
wx.navigateBack() | |||
}, 2000) | |||
} | |||
}).catch(err => { | |||
console.log(err); | |||
}) | |||
} else { | |||
wx.showToast({ | |||
title: '请输入昵称', | |||
icon: 'error', | |||
duration: 2000 | |||
}) | |||
} | |||
}, | |||
/** | |||
@@ -1,15 +1,17 @@ | |||
<view> | |||
<navbar home back color="{{typeLsit.sy_top_f.styleClass}}" background="{{typeLsit.sy_top.styleClass}}" text="用户名和昵称"></navbar> | |||
<navbar home back color="{{typeLsit.sy_top_f.styleClass}}" background="{{typeLsit.sy_top.styleClass}}" text="头像和昵称"></navbar> | |||
<view style="height:{{navigationBarHeight}} "></view> | |||
<view class="container"> | |||
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"> | |||
<image class="avatar" src="{{avatarUrl}}"></image> | |||
</button> | |||
<view class="des">点击更换头像</view> | |||
<form bindsubmit="formSubmit"> | |||
<view class="avatar"> | |||
<text>头像</text> | |||
<button class="avatarBtn" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"> | |||
<image class="avatarCover" src="{{avatarUrl}}"></image> | |||
</button> | |||
</view> | |||
<form bindsubmit="formSubmit" class="form"> | |||
<text class="nickName">昵称</text> | |||
<input type="nickname" name='nickname' class="input" placeholder="请输入昵称" /> | |||
<button class="submit" type="primary" form-type='submit'>确定</button> | |||
</form> | |||
</view> | |||
</view> |
@@ -1,36 +1,47 @@ | |||
@import "../../app.wxss"; | |||
.container { | |||
margin-top: 200rpx; | |||
margin-top: 30rpx; | |||
padding: 0 40rpx 0 40rpx; | |||
text-align: center; | |||
} | |||
.avatar-wrapper { | |||
.avatar { | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
margin-bottom: 50rpx; | |||
} | |||
.avatarBtn { | |||
width: 100rpx; | |||
height: 100rpx; | |||
border: 1px #b6b6b6 solid; | |||
border-radius: 50%; | |||
margin: 0; | |||
padding: 0; | |||
width: 103rpx !important; | |||
border-radius: 10rpx; | |||
margin-top: 40rpx; | |||
margin-bottom: 40rpx; | |||
} | |||
.avatar { | |||
display: block; | |||
width: 56px; | |||
height: 56px; | |||
.avatarCover { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.des { | |||
margin-bottom: 30rpx; | |||
.form { | |||
position: relative; | |||
} | |||
.submit { | |||
margin-top: 40rpx; | |||
.nickName { | |||
position: absolute; | |||
top: 18rpx; | |||
width: 60rpx; | |||
} | |||
.input { | |||
text-align: left; | |||
text-align: right; | |||
padding-left: 20rpx; | |||
height: 70rpx; | |||
border-bottom: 1px solid #afafaf; | |||
} | |||
.submit { | |||
margin-top: 50rpx; | |||
} |
@@ -1,14 +1,17 @@ | |||
<navbar back home text="个人信息" background='#FD832D' color="white"></navbar> | |||
<view style="height:{{navigationBarHeight}} "></view> | |||
<view class="item" bindtap="go" data-url="/pages/edit/edit?type=0"> | |||
我的个人信息 | |||
<view class="logo">></view> | |||
</view> | |||
<view class="item" bindtap="go" data-url="/pages/edit/edit?type=1"> | |||
我的子女信息 | |||
<view class="logo">></view> | |||
</view> | |||
<view class="item" bindtap="go" data-url="/pages/siteUser/siteUser"> | |||
我的收货地址 | |||
<view class="logo">></view> | |||
<view class="items"> | |||
<view class="item" bindtap="go" data-url="/pages/edit/edit?type=0"> | |||
我的个人信息 | |||
<view class="logo">⟩</view> | |||
</view> | |||
<view class="item" bindtap="go" data-url="/pages/edit/edit?type=1"> | |||
我的子女信息 | |||
<view class="logo">⟩</view> | |||
</view> | |||
<view class="item" bindtap="go" data-url="/pages/siteUser/siteUser"> | |||
我的收货地址 | |||
<view class="logo">⟩</view> | |||
</view> | |||
</view> |
@@ -1,19 +1,22 @@ | |||
/* pages/site/site.wxss */ | |||
.item{ | |||
position: relative; | |||
.items { | |||
text-align: center; | |||
padding: 0 25rpx 0 25rpx; | |||
} | |||
.item { | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
text-align: center; | |||
width: 88%; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
border-radius: 16rpx; | |||
border: 1rpx #333 solid; | |||
margin: 20rpx auto | |||
margin: 20rpx 0 20rpx 0 | |||
} | |||
.logo{ | |||
.logo { | |||
width: 50rpx; | |||
position: absolute; | |||
right: 10rpx; | |||
top: 0rpx; | |||
font-size: 36rpx; | |||
color: rgba(0, 0, 0, 0.8); | |||
} |