Browse Source

用户信息编辑页面

master
kuaileWu 1 year ago
parent
commit
c0a6a9c8b3
  1. 2
      components/tabbar.vue
  2. 11
      pages.json
  3. 183
      pages/user_modify/user_modify.vue
  4. 16
      pages/usercenter/usercenter.vue
  5. 1
      static/images/frontend/copy.svg

2
components/tabbar.vue

@ -11,7 +11,7 @@
<view class="tabbar_item tabbar_item05" style="" v-if="is_admin" @click="addArticle">
<image :src="cssUrl+'add.svg'"></image>
</view>
<view class="tabbar_item tabbar_item04" @click="jumpto('/pages/user_center/user_center')" style="">
<view class="tabbar_item tabbar_item04" @click="jumpto('/pages/usercenter/usercenter')" style="">
<view :class="[current==2?'tabbarYes':'tabbarNone']">
<image :src="current==2?cssUrl+'tabbar_user_active.svg':cssUrl+'tabbar_user.svg'"></image>
<view :class="[current==2?'tabbarYes':'tabbarNone']">我的</view>

11
pages.json

@ -1,10 +1,19 @@
{
"pages": [
{
"path" : "pages/user_modify/user_modify",
"style" :
{
"navigationBarTitleText": "修改资料",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/usercenter/usercenter",
"style" :
{
"navigationBarTitleText": "",
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
}

183
pages/user_modify/user_modify.vue

@ -0,0 +1,183 @@
<template>
<view class="page-user-modify">
<view class="item-box btPadding">
<view class="item">
<view class="left PfScMedium">头像</view>
<view class="right" @click="upload">
<img :src="avator" class="avator">
<view class="avator_tips">点击上传照片</view>
</view>
</view>
<view class="item">
<view class="left PfScMedium">昵称</view>
<view class="right">
<input type="text" placeholder="请输入用户昵称">
</view>
</view>
<view class="item">
<view class="left PfScMedium">用户编号</view>
<view class="right over copy-box">
<view>17678689931</view>
<img :src="cssUrl+'copy.svg'" class="copy" @click="copyUid('17678689931')">
</view>
</view>
<view class="submit-blank"></view>
</view>
<view class="submit-box btPadding">
<view class="primary btn btn3" hover-class="hover">保存</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
cssUrl:this.cssUrl,
avator:this.cssUrl+'default_avator.svg'
}
},
methods: {
copyUid(uid) {
uni.setClipboardData({
data: uid,
success: function () {
uni.showToast({
title:'用户编号已复制',
icon:'none'
})
}
});
},
upload() {
uni.chooseImage({
count: 1,
success: function(res) {
var tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: 'http://example.com/upload',
filePath: tempFilePaths[0],
name: 'file',
header: {
'content-type' : 'multipart/form-data'
},
formData:{
'user': 'test'
},
success: function(res){
console.log(res.data);
},
fail: function(res){
console.log(res);
}
});
}
});
}
}
}
</script>
<style lang="scss" scoped>
.page-user-modify{
background: #F8F8F8;
width: 100%;
height: 100vh;
box-sizing: border-box;
.item-box{
margin-top: 20rpx;
width:710rpx;
margin: 0 auto;
background: #FFFFFF;
box-sizing: border-box;
.item{
width: 686rpx;
margin: 0 auto;
box-sizing: border-box;
padding: 40rpx 12rpx;
border-bottom: 2rpx solid rgba(151,151,151, 0.15);
display: flex;
align-items: center;
line-height: 44rpx;
justify-content: space-between;
&:last-of-type{
border-bottom: none;
}
.left{
height: 44rpx;
line-height: 44rpx;
font-size: 32rpx;
color: #000000;
letter-spacing: 2rpx;
padding-left: 12rpx;
width: 133rpx;
flex-shrink: 0;
}
.right{
flex-grow: 1;
position: relative;
text-align: right;
line-height: 44rpx;
.avator{
width: 160rpx;
height: 160rpx;
background: #F8F8F8;
border-radius: 12rpx;
}
.avator_tips{
position: absolute;
bottom: 0;
right: 0;
width: 100%;
z-index: 1;
height: 44rpx;
line-height: 44rpx;
background: rgba(0,0,0,0.28);
border-radius: 12rpx;
width: 160rpx;
font-size: 22rpx;
text-align: center;
color: #FFFFFF;
}
&.copy-box{
display: flex;
justify-content: flex-end;
align-items: center;
view{
flex-grow: 1;
max-width: 272rpx;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.copy{
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
margin-left: 16rpx;
}
}
}
}
}
.submit-blank{
width: 100%;
height: 134rpx;
}
.submit-box{
width: 750rpx;
height: 124rpx;
background: #FFFFFF;
box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(181,181,181,0.13);
position: fixed;
bottom: 0;
view{
margin: 0 auto;
}
}
}
</style>

16
pages/usercenter/usercenter.vue

@ -90,21 +90,5 @@
}
}
}
// <view class="avator">
// <img :src="cssUrl+'default_avator.svg'" alt="">
// </view>
// <view class="ucode">UID998777</view>
// <view class="menu">
// <view class="item">
// <img :src="cssUrl+'default_avator.svg'" alt="">
//
// </view>
// <view class="item">
// <img :src="cssUrl+'default_avator.svg'" alt="">
//
// </view>
// </view>
}
</style>

1
static/images/frontend/copy.svg

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg version="1.1" width="30px" height="30px" viewBox="0 0 30.0 30.0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><clipPath id="i0"><path d="M750,0 L750,1624 L0,1624 L0,0 L750,0 Z"></path></clipPath><clipPath id="i1"><path d="M5.62562649,7.50199999 L5.62562649,9.3775024 L3.75175268,9.3775024 C2.71671771,9.37750242 1.87587689,10.2150656 1.87587689,11.2509989 L1.87587689,26.2489898 C1.87640758,26.7464035 2.07434213,27.2232334 2.42613714,27.5745822 C2.77793215,27.925931 3.25477037,28.1230181 3.75175268,28.1224864 L18.7507512,28.1224864 C19.2477335,28.1230181 19.7245717,27.925931 20.0763667,27.5745822 C20.4281617,27.2232334 20.6260963,26.7464035 20.626627,26.2489898 L20.6226229,24.377497 L22.4964968,24.377497 L22.4964968,26.2529973 C22.4964968,27.247804 22.1012447,28.2017785 21.3978571,28.9046491 C20.6944694,29.6075196 19.7406899,30.0015863 18.7467472,29.9999952 L3.7497507,29.9999952 C2.75546096,30.001587 1.80137754,29.6072455 1.09793215,28.9039413 C0.394486754,28.2006371 -0.000531912526,27.2461474 5.37573669e-07,26.2509936 L5.37573669e-07,11.2530027 C5.37573669e-07,10.2574807 0.395400941,9.30279126 1.09910619,8.59922689 C1.80281143,7.89566252 2.75709466,7.50093854 3.75175268,7.50199999 L5.62562649,7.50199999 Z M26.2502504,5.34886983e-07 C27.2442149,0.00147325089 28.1976802,0.396157108 28.9008947,1.09923042 C29.6041092,1.80230373 29.9994692,2.75617436 30,3.7510016 L30,18.7469888 C30,20.814848 28.3243244,22.4939818 26.2522524,22.4939818 L11.2512519,22.4939818 C9.17917994,22.4939818 7.50150231,20.8168518 7.50150231,18.7469888 L7.50150231,3.7510016 C7.50150231,2.75582714 7.89662782,1.80144169 8.59989989,1.09793501 C9.30317197,0.394428323 10.2569406,-0.000530542032 11.2512519,5.34886983e-07 L26.2502504,5.34886983e-07 Z M26.2522524,1.87750509 L11.2512519,1.87750509 C10.2182189,1.87750509 9.37737813,2.71707197 9.37737813,3.7510016 L9.37737813,18.7489925 C9.37848296,19.7840201 10.2171213,20.6224901 11.2512519,20.6224901 L26.2522524,20.6224901 C26.7490504,20.6230208 27.2256828,20.42587 27.57716,20.0744635 C27.9286372,19.7230571 28.1261262,19.246222 28.1261262,18.7489925 L28.1261262,3.7510016 C28.1261262,2.71707197 27.2872874,1.87750509 26.2522524,1.87750509 Z"></path></clipPath></defs><g transform="translate(-678.0 -619.0)"><g clip-path="url(#i0)"><g transform="translate(45.0 612.0)"><g transform="translate(447.0 1.0)"><g transform="translate(186.0 6.0)"><g clip-path="url(#i1)"><polygon points="6.46080534e-14,-1.86051285e-14 30,-1.86051285e-14 30,30 6.46080534e-14,30 6.46080534e-14,-1.86051285e-14" stroke="none" fill="#999999"></polygon></g></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

Loading…
Cancel
Save