Browse Source

系统设置 修改用户名 关于纸掌柜

devlop
杨阁辉 4 years ago
parent
commit
53afe7bb5a
5 changed files with 275 additions and 4 deletions
  1. 8
      apis/setting.js
  2. 22
      pages.json
  3. 70
      pages/about/index.vue
  4. 75
      pages/setting/index.vue
  5. 104
      pages/user-info/index.vue

8
apis/setting.js

@ -0,0 +1,8 @@
import http from '../utils/http/index.js'
// 修改员工姓名
export function employeeName(data) {
return http.post({
url: '/yyt-uec/update/my/employee-name?userId='+data.userId +'&enterpriseId=' +data.enterpriseId,
data
})
}

22
pages.json

@ -258,7 +258,27 @@
"enablePullDownRefresh": false
}
}
],
,{
"path" : "pages/user-info/index",
"style" :
{
"navigationBarTitleText": "用户名",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/about/index",
"style" :
{
"navigationBarTitleText": "关于",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",

70
pages/about/index.vue

@ -0,0 +1,70 @@
<template>
<view class="about">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="about-title">关于纸掌柜</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="about-main">
<view class=""><image class="about-image" src="../../static/logo.png" mode=""></image></view>
<view class="about-text"><text>纸掌柜</text></view>
<view class="about-subtext"><text>帮你卖好每一吨纸</text></view>
<view class="about-vs"><text>版本号 纸掌柜 V1.0.0</text></view>
</view>
</view>
</template>
<script>
import { back, go2, uploadFile } from '@/utils/hook.js'
export default {
data() {
return {}
},
methods: {
back
}
}
</script>
<style lang="scss">
.about {
.about-main {
text-align: center;
}
.about-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.about-image {
width: 160rpx;
height: 160rpx;
margin-top: 180rpx;
}
.about-text {
opacity: 0.8;
font-size: 64rpx;
color: #000000;
font-weight: 400;
}
.about-subtext {
font-size: 28rpx;
color: #555555;
letter-spacing: 0;
font-weight: 400;
margin-top: 18rpx;
}
.about-vs {
font-size: 28rpx;
color: #888888;
letter-spacing: 0;
font-weight: 400;
margin-top: 100rpx;
}
}
</style>

75
pages/setting/index.vue

@ -1,9 +1,78 @@
<template>
<view>设置</view>
<view class="system-settimg">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="system-settimg-title">系统设置</view>
<view slot="left"></view>
<view slot="right"></view>
</uni-nav-bar>
</view>
<view class="list-main" v-for="(item,index) in name" :key="index">
<view class="list-flex" :class="(index+1) === name.length ? '':'list-border'" @click="checkList(index)">
<view class="list-text"><text>{{item}}</text></view>
<view class="">
<text><uni-icons type="right" color="#000000" size="18"></uni-icons></text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {}
import { back, go2, uploadFile } from '@/utils/hook.js'
export default {
data() {
return {
name:['用户名','账号管理','用户协议','系统权限','关于纸掌柜']
}
},
methods: {
back,
checkList(item){
switch (item){
case 0:
go2('user-info')
break;
case 4:
go2('about')
break;
default:
break;
}
},
}
}
</script>
<style></style>
<style lang="scss">
.system-settimg {
.system-settimg-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.list-main{
background-color: #FFFFFF;
}
.list-border{
border-bottom: 2rpx solid #d8d8d8;
}
.list-flex {
display: flex;
justify-content: space-between;
margin: 0rpx 32rpx;
height: 100rpx;
align-items: center;
}
.list-text {
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 400;
}
}
</style>

104
pages/user-info/index.vue

@ -0,0 +1,104 @@
<template>
<view class="user-info">
<view>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="">
<view class="user-info-title">用户名</view>
<view slot="left"></view>
<view slot="right">
<button type="primary" class="user-btn" @click="save">保存</button>
</view>
</uni-nav-bar>
</view>
<view class="user-contant">
<text class=""><uni-icons custom-prefix="iconfont" type="icon-required" size="14" color="#F5222D"></uni-icons></text>
<text class="user-text">请输入新的用户名</text>
</view>
<view class="">
<uni-easyinput maxlength="100" :inputBorder="false" type="textarea" class="user-info-input" v-model="name" placeholder="请输入内容"></uni-easyinput>
</view>
</view>
</template>
<script>
import { back, go2, uploadFile } from '@/utils/hook.js'
import { employeeName, } from '@/apis/setting.js'
export default {
data() {
return {
name:''
}
},
onLoad() {
this.name = this.$store.state.userInfo.name
},
methods: {
back,
save(){
if(this.name === '' || this.name === null){
uni.showToast({
title: '请完善信息',
icon: 'none'
})
return
}
var params = {
userId:this.$store.state.userInfo.userId,
name:this.name,
enterpriseId :this.$store.state.supplierInfo.id
}
employeeName(params).then(res => {
if (res) {
uni.showToast({
title: '修改成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
}
})
}
}
}
</script>
<style lang="scss">
.user-info{
background-color: #FFFFFF;
height: 800rpx;
.user-info-title {
width: 100%;
font-size: 36rpx;
color: #000000;
letter-spacing: 0;
text-align: center;
font-weight: 500;
}
.user-btn{
width: 108rpx;
height: 54rpx;
background: #007AFF;
border-radius: 27rpx;
font-size: 28rpx;
color: #FFFFFF;
letter-spacing: 0;
font-weight: 500;
line-height: 60rpx;
}
.user-text{
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
font-weight: 500;
}
.user-contant{
margin: 20rpx 32rpx;
}
.user-info-input {
background: #f7f8fa;
border-radius: 20rpx;
margin: 10rpx 32rpx 32rpx 32rpx;
width: 686rpx;
}
}
</style>
Loading…
Cancel
Save