修复bug
parent
c2e2863bd2
commit
5e5d8ce41c
147
pages.json
147
pages.json
|
|
@ -16,154 +16,175 @@
|
|||
"navigationBarTitleText": "若依移动端框架",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/work/index",
|
||||
}, {"path": "pages/work/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/index",
|
||||
}, {"path": "pages/mine/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/avatar/index",
|
||||
}, {"path": "pages/product/product",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages/mine",
|
||||
"pages": [
|
||||
{"path": "avatar/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改头像"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/info/index",
|
||||
},
|
||||
{"path": "info/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人信息"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/info/edit",
|
||||
},
|
||||
{"path": "info/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑资料"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/pwd/index",
|
||||
},
|
||||
{"path": "pwd/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改密码"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/setting/index",
|
||||
},
|
||||
{"path": "setting/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "应用设置"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/help/index",
|
||||
},
|
||||
{"path": "help/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/about/index",
|
||||
},
|
||||
{"path": "about/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/common/webview/index",
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/common",
|
||||
"pages": [
|
||||
{"path": "webview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览网页"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/common/textview/index",
|
||||
},
|
||||
{
|
||||
"path": "textview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览文本"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pages/user/user",
|
||||
"root": "pages/product",
|
||||
"pages": [
|
||||
{"path": "../addProduct/addProduct",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/settings/settings",
|
||||
"path": "../batchDeleteProduct/batchDeleteProduct",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/product/product",
|
||||
"path": "../edit/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/brand",
|
||||
"pages": [
|
||||
{
|
||||
"path": "../addBrand/addBrand",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/asset/asset",
|
||||
"path": "../BrandSelector/BrandSelector",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择品牌"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pages/other",
|
||||
"pages": [
|
||||
{
|
||||
"path": "../menu",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/enter/enter",
|
||||
{"path": "../user/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/addProduct/addProduct",
|
||||
{"path": "../settings/settings",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/storeSelect/storeSelect",
|
||||
{"path": "../asset/asset",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{"path": "../enter/enter",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{"path": "../storeSelect/storeSelect",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择门店"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/edit/edit",
|
||||
{"path": "../import/import",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/import/import",
|
||||
"path": "../userStores/userStores",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/userStores/userStores",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/batchDeleteProduct/batchDeleteProduct",
|
||||
"path": "../category/category",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/addBrand/addBrand",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/BrandSelector/BrandSelector",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择品牌"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/category/category",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/back/back",
|
||||
"path": "../back/back",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#000000",
|
||||
|
|
|
|||
|
|
@ -404,6 +404,7 @@
|
|||
addNewGoods() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/addProduct/addProduct'
|
||||
// url: '/pages/enter/enter'
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
<template>
|
||||
<view class="nickname-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<view class="navbar">
|
||||
<view class="nav-left" @click="goBack">
|
||||
<!-- <text class="nav-icon"><</text> -->
|
||||
</view>
|
||||
<view class="nav-title">昵称</view>
|
||||
<view class="nav-right" @click="saveNickname">
|
||||
<text class="nav-text">完成</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 内容区 -->
|
||||
<view class="content">
|
||||
<view class="input-item">
|
||||
<text class="label">名称</text>
|
||||
<input
|
||||
class="input"
|
||||
v-model="nickname"
|
||||
placeholder="请输入昵称"
|
||||
maxlength="20"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
nickname: '' // 绑定输入框的昵称值
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// 如果是从其他页面跳转过来,可以接收并回显旧昵称
|
||||
if (options.oldNickname) {
|
||||
this.nickname = options.oldNickname
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
// 保存昵称
|
||||
saveNickname() {
|
||||
if (!this.nickname.trim()) {
|
||||
uni.showToast({
|
||||
title: '昵称不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 这里可以调用接口保存昵称到后端
|
||||
uni.showLoading({
|
||||
title: '保存中...'
|
||||
})
|
||||
|
||||
// 模拟接口请求
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
// 保存成功后返回上一页,并携带新昵称
|
||||
uni.navigateBack({
|
||||
success() {
|
||||
const pages = getCurrentPages()
|
||||
const prevPage = pages[pages.length - 1]
|
||||
if (prevPage) {
|
||||
// 通知上一页更新昵称显示
|
||||
prevPage.$vm.$emit('updateNickname', this.nickname)
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.nickname-page {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 顶部导航栏 */
|
||||
.navbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 44px;
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.nav-left {
|
||||
width: 40px;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.nav-icon {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 17px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
width: 40px;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.nav-text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* 内容区 */
|
||||
.content {
|
||||
margin-top: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.input-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 15px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
width: 60px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<!-- 账户信息模块 -->
|
||||
<view class="info-module">
|
||||
<view class="module-item">
|
||||
<view class="module-item" @click="goUpdateUserName">
|
||||
<text class="item-label">昵称</text>
|
||||
<text class="item-value">名称</text>
|
||||
</view>
|
||||
|
|
@ -103,6 +103,11 @@
|
|||
icon: 'none'
|
||||
})
|
||||
},
|
||||
goUpdateUserName(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/updateUserName/updateUserName'
|
||||
});
|
||||
},
|
||||
// 注销账号
|
||||
handleCancelAccount() {
|
||||
uni.showModal({
|
||||
|
|
@ -202,7 +207,7 @@
|
|||
|
||||
/* ========== 标题模块 ========== */
|
||||
.header-module {
|
||||
background-color: cornflowerblue;
|
||||
background-color: firebrick;
|
||||
padding: 40rpx 40rpx 60rpx;
|
||||
border-bottom: 2rpx solid #f5f5f5;
|
||||
text-align: center;
|
||||
|
|
|
|||
Loading…
Reference in New Issue