9.20/1
This commit is contained in:
59
frontend/pages/my/about.vue
Normal file
59
frontend/pages/my/about.vue
Normal file
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<view class="about">
|
||||
<view class="hero">
|
||||
<image class="logo" src="/static/logo.png" mode="aspectFit" />
|
||||
<text class="title">五金配件管家</text>
|
||||
<text class="subtitle">专注小微门店的极简进销存</text>
|
||||
</view>
|
||||
|
||||
<view class="card">
|
||||
<view class="row">
|
||||
<text class="label">版本</text>
|
||||
<text class="value">1.0.0</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="label">隐私协议</text>
|
||||
<text class="link" @click="openPolicy">查看</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="label">用户协议</text>
|
||||
<text class="link" @click="openTerms">查看</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="label">个人信息安全投诉</text>
|
||||
<text class="link" @click="openComplaint">提交</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
openPolicy() {
|
||||
uni.showModal({ title: '隐私协议', content: '隐私协议(静态占位)', showCancel: false })
|
||||
},
|
||||
openTerms() {
|
||||
uni.showModal({ title: '用户协议', content: '用户协议(静态占位)', showCancel: false })
|
||||
},
|
||||
openComplaint() {
|
||||
uni.showToast({ title: '暂未开通', icon: 'none' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.about { padding: 24rpx; }
|
||||
.hero { padding: 32rpx 24rpx; display: flex; flex-direction: column; align-items: center; gap: 10rpx; }
|
||||
.logo { width: 160rpx; height: 160rpx; border-radius: 32rpx; }
|
||||
.title { margin-top: 8rpx; font-size: 36rpx; font-weight: 800; color: #333; }
|
||||
.subtitle { font-size: 26rpx; color: #888; }
|
||||
.card { margin-top: 18rpx; background: #fff; border-radius: 16rpx; overflow: hidden; }
|
||||
.row { display: flex; align-items: center; padding: 24rpx; border-top: 1rpx solid #f2f2f2; }
|
||||
.label { color: #666; }
|
||||
.value { margin-left: auto; color: #333; }
|
||||
.link { margin-left: auto; color: #1aad19; }
|
||||
</style>
|
||||
|
||||
|
||||
152
frontend/pages/my/index.vue
Normal file
152
frontend/pages/my/index.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<view class="me">
|
||||
<view class="card user">
|
||||
<image class="avatar" :src="avatarUrl" mode="aspectFill" @error="onAvatarError" />
|
||||
<view class="meta">
|
||||
<text class="name">{{ shopName }}</text>
|
||||
<text class="phone">{{ mobileDisplay }}</text>
|
||||
<text class="role">老板</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="group">
|
||||
<view class="group-title">会员与订单</view>
|
||||
<view class="cell" @click="goVip">
|
||||
<text>VIP会员</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell" @click="goMyOrders">
|
||||
<text>我的订单</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="group">
|
||||
<view class="group-title">基础管理</view>
|
||||
<view class="cell" @click="goSupplier">
|
||||
<text>供应商管理</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell" @click="goCustomer">
|
||||
<text>客户管理</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell" @click="goCustomerQuote">
|
||||
<text>客户报价</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell" @click="goShop">
|
||||
<text>店铺管理</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="group">
|
||||
<view class="group-title">设置中心</view>
|
||||
<view class="cell" @click="editProfile">
|
||||
<text>账号与安全</text>
|
||||
<text class="desc">修改头像、姓名、密码</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell" @click="goProductSettings">
|
||||
<text>商品设置</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell" @click="goSystemParams">
|
||||
<text>系统参数</text>
|
||||
<text class="desc">低价提示、默认收款、单行折扣等</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell" @click="goAbout">
|
||||
<text>关于与协议</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
<view class="cell danger" @click="logout">
|
||||
<text>退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { get } from '../../common/http.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
avatarUrl: '/static/logo.png',
|
||||
shopName: '我的店铺',
|
||||
mobile: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.fetchProfile()
|
||||
},
|
||||
computed: {
|
||||
mobileDisplay() {
|
||||
const m = String(this.mobile || '')
|
||||
return m.length === 11 ? m.slice(0,3) + '****' + m.slice(7) : (m || '未绑定手机号')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async fetchProfile() {
|
||||
// 后端暂无专门店铺/用户信息接口,先使用概览接口作为在线性检测与占位数据来源
|
||||
try { await get('/api/dashboard/overview') } catch(e) {}
|
||||
// 读取本地可能保存的店铺名与头像
|
||||
try {
|
||||
const storeName = uni.getStorageSync('SHOP_NAME') || ''
|
||||
const avatar = uni.getStorageSync('USER_AVATAR') || ''
|
||||
const phone = uni.getStorageSync('USER_MOBILE') || ''
|
||||
if (storeName) this.shopName = storeName
|
||||
if (avatar) this.avatarUrl = avatar
|
||||
this.mobile = phone
|
||||
} catch(e) {}
|
||||
},
|
||||
onAvatarError() {
|
||||
this.avatarUrl = '/static/logo.png'
|
||||
},
|
||||
goVip() { uni.showToast({ title: 'VIP会员(开发中)', icon: 'none' }) },
|
||||
goMyOrders() { uni.navigateTo({ url: '/pages/detail/index' }) },
|
||||
goSupplier() { uni.navigateTo({ url: '/pages/supplier/select' }) },
|
||||
goCustomer() { uni.navigateTo({ url: '/pages/customer/select' }) },
|
||||
goCustomerQuote() { uni.showToast({ title: '客户报价(开发中)', icon: 'none' }) },
|
||||
goShop() { uni.showToast({ title: '店铺管理(开发中)', icon: 'none' }) },
|
||||
editProfile() { uni.showToast({ title: '账号与安全(开发中)', icon: 'none' }) },
|
||||
goProductSettings() { uni.navigateTo({ url: '/pages/product/settings' }) },
|
||||
goSystemParams() { uni.showToast({ title: '系统参数(开发中)', icon: 'none' }) },
|
||||
goAbout() { uni.navigateTo({ url: '/pages/my/about' }) },
|
||||
logout() {
|
||||
try {
|
||||
uni.removeStorageSync('TOKEN')
|
||||
uni.removeStorageSync('USER_AVATAR')
|
||||
uni.removeStorageSync('USER_NAME')
|
||||
uni.removeStorageSync('USER_MOBILE')
|
||||
uni.removeStorageSync('SHOP_NAME')
|
||||
uni.showToast({ title: '已退出', icon: 'none' })
|
||||
setTimeout(() => { uni.reLaunch({ url: '/pages/index/index' }) }, 300)
|
||||
} catch(e) {
|
||||
uni.reLaunch({ url: '/pages/index/index' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.me { padding: 24rpx; }
|
||||
.card.user { display: flex; gap: 18rpx; padding: 22rpx; background: #fff; border-radius: 16rpx; box-shadow: 0 6rpx 16rpx rgba(0,0,0,0.06); align-items: center; }
|
||||
.avatar { width: 120rpx; height: 120rpx; border-radius: 60rpx; background: #f5f5f5; }
|
||||
.meta { display: flex; flex-direction: column; gap: 6rpx; }
|
||||
.name { font-size: 34rpx; font-weight: 700; color: #333; }
|
||||
.phone { font-size: 26rpx; color: #888; }
|
||||
.role { font-size: 22rpx; color: #999; }
|
||||
|
||||
.group { margin-top: 24rpx; background: #fff; border-radius: 16rpx; overflow: hidden; }
|
||||
.group-title { padding: 18rpx 22rpx; font-size: 26rpx; color: #999; background: #fafafa; }
|
||||
.cell { display: flex; align-items: center; padding: 26rpx 22rpx; border-top: 1rpx solid #f0f0f0; color: #333; }
|
||||
.cell .desc { margin-left: auto; margin-right: 8rpx; font-size: 22rpx; color: #999; }
|
||||
.cell .arrow { margin-left: auto; color: #bbb; }
|
||||
.cell.danger { color: #dd524d; justify-content: center; font-weight: 700; }
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user