diff --git a/src/App.vue b/src/App.vue index 0b7b909..58ed5a5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,6 +2,7 @@ import config from './config' import { getToken } from '@/utils/auth' import { useConfigStore } from '@/store' + import { useUserStore } from '@/store' import { getCurrentInstance } from "vue" import { onLaunch } from '@dcloudio/uni-app' @@ -28,6 +29,9 @@ function checkLogin() { if (!getToken()) { proxy.$tab.reLaunch('/pages/login') + } else { + // 重新获取用户权限 + useUserStore().getInfo() } } diff --git a/src/pages/distributor/add.vue b/src/pages/distributor/add.vue index f45f32f..a8d4c8d 100644 --- a/src/pages/distributor/add.vue +++ b/src/pages/distributor/add.vue @@ -37,19 +37,7 @@ /> - - 角色 - - - {{ roleOptions[roleIndex] }} - - - + 状态 @@ -87,15 +75,10 @@ const distributorForm = ref({ name: '', phone: '', - role: '初级分销员', status: '启用', remark: '' }) - // 角色选项 - const roleOptions = ['初级分销员', '中级分销员', '高级分销员'] - const roleIndex = ref(0) - // 状态选项 const statusOptions = ['启用', '禁用'] const statusIndex = ref(0) @@ -145,12 +128,7 @@ }, 1500) } - // 角色变更 - function onRoleChange(e) { - const value = e.detail.value - roleIndex.value = value - distributorForm.value.role = roleOptions[value] - } + // 状态变更 function onStatusChange(e) { @@ -226,7 +204,7 @@ .form-section { padding: 32rpx; background-color: #fff; - margin: 0 16rpx 16rpx; + margin: 16rpx; border-radius: 16rpx; box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08); } @@ -269,22 +247,47 @@ .form-input { width: 100%; + height: 70rpx; background-color: #fff; border: 1rpx solid #dcdfe6; - border-radius: 8rpx; - padding: 16rpx; + border-radius: 12rpx; + padding: 20rpx 24rpx; font-size: 24rpx; color: #303133; + transition: all 0.3s ease; + box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.02); + } + + .form-input:focus { + border-color: #409eff; + box-shadow: 0 0 0 4rpx rgba(64, 158, 255, 0.1); + outline: none; + } + + .form-input::placeholder { + color: #909399; + font-size: 22rpx; } .picker { background-color: #fff; border: 1rpx solid #dcdfe6; - border-radius: 8rpx; - padding: 16rpx; + border-radius: 12rpx; + padding: 20rpx 24rpx; display: flex; justify-content: space-between; align-items: center; + transition: all 0.3s ease; + cursor: pointer; + } + + .picker:hover { + border-color: #c6e2ff; + box-shadow: 0 2rpx 8rpx rgba(64, 158, 255, 0.1); + } + + .picker:active { + background-color: #f5faff; } .picker-text { @@ -297,11 +300,24 @@ height: 160rpx; background-color: #fff; border: 1rpx solid #dcdfe6; - border-radius: 8rpx; - padding: 16rpx; + border-radius: 12rpx; + padding: 20rpx 24rpx; font-size: 24rpx; color: #303133; resize: none; + transition: all 0.3s ease; + box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.02); + } + + .form-textarea:focus { + border-color: #409eff; + box-shadow: 0 0 0 4rpx rgba(64, 158, 255, 0.1); + outline: none; + } + + .form-textarea::placeholder { + color: #909399; + font-size: 22rpx; } .textarea-count { @@ -344,8 +360,9 @@ .form-input, .picker { - padding: 20rpx; + padding: 24rpx 28rpx; font-size: 26rpx; + border-radius: 14rpx; } .picker-text { @@ -354,8 +371,14 @@ .form-textarea { height: 200rpx; - padding: 20rpx; + padding: 24rpx 28rpx; font-size: 26rpx; + border-radius: 14rpx; + } + + .form-input::placeholder, + .form-textarea::placeholder { + font-size: 24rpx; } .textarea-count { @@ -383,7 +406,9 @@ .form-input, .picker { + padding: 28rpx 32rpx; font-size: 28rpx; + border-radius: 16rpx; } .picker-text { @@ -391,7 +416,14 @@ } .form-textarea { + padding: 28rpx 32rpx; font-size: 28rpx; + border-radius: 16rpx; + } + + .form-input::placeholder, + .form-textarea::placeholder { + font-size: 26rpx; } } \ No newline at end of file diff --git a/src/pages/distributor/edit.vue b/src/pages/distributor/edit.vue index fb409fe..b3e7ded 100644 --- a/src/pages/distributor/edit.vue +++ b/src/pages/distributor/edit.vue @@ -37,19 +37,7 @@ /> - - 角色 - - - {{ roleOptions[roleIndex] }} - - - + 状态 @@ -95,15 +83,10 @@ id: '', name: '张三', phone: '13800138001', - role: '初级分销员', status: '启用', remark: '默认分销员' }) - // 角色选项 - const roleOptions = ['初级分销员', '中级分销员', '高级分销员'] - const roleIndex = ref(0) - // 状态选项 const statusOptions = ['启用', '禁用'] const statusIndex = ref(0) @@ -182,12 +165,7 @@ }) } - // 角色变更 - function onRoleChange(e) { - const value = e.detail.value - roleIndex.value = value - distributorForm.value.role = roleOptions[value] - } + // 状态变更 function onStatusChange(e) { diff --git a/src/pages/distributor/index.vue b/src/pages/distributor/index.vue index addf0f6..846edb5 100644 --- a/src/pages/distributor/index.vue +++ b/src/pages/distributor/index.vue @@ -57,7 +57,6 @@ {{ distributor.name }} {{ distributor.phone }} - {{ distributor.role }} {{ distributor.status }} @@ -118,7 +117,6 @@ id: 1, name: '张三', phone: '13800138001', - role: '初级分销员', status: '启用', statusClass: 'active' }, @@ -126,7 +124,6 @@ id: 2, name: '李四', phone: '13800138002', - role: '中级分销员', status: '启用', statusClass: 'active' }, @@ -134,7 +131,6 @@ id: 3, name: '王五', phone: '13800138003', - role: '高级分销员', status: '禁用', statusClass: 'inactive' } @@ -162,17 +158,17 @@ // 添加分销员 function addDistributor() { - uni.showToast({ - title: '添加分销员功能开发中', - icon: 'none' + // 跳转至添加分销员页面 + uni.navigateTo({ + url: '/pages/distributor/add' }) } // 编辑分销员 function editDistributor(id) { - uni.showToast({ - title: '编辑分销员功能开发中', - icon: 'none' + // 跳转至编辑分销员页面 + uni.navigateTo({ + url: '/pages/distributor/edit?id=' + id }) } @@ -349,6 +345,7 @@ color: #303133; margin-bottom: 24rpx; padding-left: 12rpx; + margin-top: 12rpx; border-left: 8rpx solid #409eff; line-height: 1.2; } diff --git a/src/pages/work/index.vue b/src/pages/work/index.vue index 704bcc4..af596d5 100644 --- a/src/pages/work/index.vue +++ b/src/pages/work/index.vue @@ -1,11 +1,11 @@