refactor(用户界面): 移除课程集合入口并优化微信支付图标
- 从设置页面移除不再需要的课程集合入口 - 将微信支付的自定义SVG图标替换为van-icon组件 - 在结账页面添加用户信息自动填充功能 ``` 这个提交消息遵循了以下原则: 1. 使用中文简洁描述了主要变更 2. 类型为refactor,因为这些修改主要是界面重构和优化 3. 添加了scope(用户界面)以提供更多上下文 4. 在body中列出了三个主要变更点,没有重复描述 5. 使用了命令式语气且没有结尾标点 6. 保持了简洁性,同时涵盖了diff中最重要的功能修改
Showing
2 changed files
with
13 additions
and
19 deletions
| ... | @@ -148,13 +148,7 @@ | ... | @@ -148,13 +148,7 @@ |
| 148 | class="mr-3" | 148 | class="mr-3" |
| 149 | /> | 149 | /> |
| 150 | <span class="flex-1">微信支付</span> | 150 | <span class="flex-1">微信支付</span> |
| 151 | - <svg class="h-6 w-6 text-green-500" viewBox="0 0 24 24" fill="currentColor"> | 151 | + <van-icon name="https://cdn.ipadbiz.cn/mlaj/icon/wxpay3.png" size="1.5rem" /> |
| 152 | - <path d="M9.5,8.5m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0" /> | ||
| 153 | - <path d="M14.5,8.5m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0" /> | ||
| 154 | - <path d="M9.5,14.5m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0" /> | ||
| 155 | - <path d="M14.5,14.5m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0" /> | ||
| 156 | - <path d="M12,2C6.5,2 2,6.5 2,12s4.5,10 10,10s10,-4.5 10,-10S17.5,2 12,2zM19.8,11c-0.2,4.6 -4.1,7.8 -8.8,7.5c-3.8,-0.2 -7.2,-3.2 -7.5,-7.1C3.2,7 6.9,3.1 11.5,3C16.1,3 20,6.9 19.8,11z" /> | ||
| 157 | - </svg> | ||
| 158 | </label> | 152 | </label> |
| 159 | 153 | ||
| 160 | <!-- <label class="flex items-center p-3 border border-gray-200 rounded-lg bg-white/50"> | 154 | <!-- <label class="flex items-center p-3 border border-gray-200 rounded-lg bg-white/50"> |
| ... | @@ -293,6 +287,7 @@ import ConfirmDialog from '@/components/ui/ConfirmDialog.vue' | ... | @@ -293,6 +287,7 @@ import ConfirmDialog from '@/components/ui/ConfirmDialog.vue' |
| 293 | import WechatPayment from '@/components/payment/WechatPayment.vue' | 287 | import WechatPayment from '@/components/payment/WechatPayment.vue' |
| 294 | import { useCart } from '@/contexts/cart' | 288 | import { useCart } from '@/contexts/cart' |
| 295 | import { useTitle } from '@vueuse/core' | 289 | import { useTitle } from '@vueuse/core' |
| 290 | +import { getUserInfoAPI } from "@/api/users"; | ||
| 296 | 291 | ||
| 297 | const $route = useRoute() | 292 | const $route = useRoute() |
| 298 | const $router = useRouter() | 293 | const $router = useRouter() |
| ... | @@ -310,6 +305,16 @@ const formData = ref({ | ... | @@ -310,6 +305,16 @@ const formData = ref({ |
| 310 | pay_type: 'WeChat' | 305 | pay_type: 'WeChat' |
| 311 | }) | 306 | }) |
| 312 | 307 | ||
| 308 | + | ||
| 309 | +onMounted(async () => { | ||
| 310 | + const { code, data } = await getUserInfoAPI(); | ||
| 311 | + if (code) { | ||
| 312 | + // 获取默认用户信息 | ||
| 313 | + formData.value.receive_name = data.user.name ? data.user.name : ''; | ||
| 314 | + formData.value.receive_phone = data.user.mobile ? data.user.mobile : ''; | ||
| 315 | + } | ||
| 316 | +}) | ||
| 317 | + | ||
| 313 | // 支付相关状态 | 318 | // 支付相关状态 |
| 314 | const showPayment = ref(false) | 319 | const showPayment = ref(false) |
| 315 | const orderId = ref('') | 320 | const orderId = ref('') | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-03-24 13:04:21 | 2 | * @Date: 2025-03-24 13:04:21 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-04-08 17:54:40 | 4 | + * @LastEditTime: 2025-05-23 18:23:28 |
| 5 | * @FilePath: /mlaj/src/views/profile/SettingsPage.vue | 5 | * @FilePath: /mlaj/src/views/profile/SettingsPage.vue |
| 6 | * @Description: 用户设置页面 | 6 | * @Description: 用户设置页面 |
| 7 | --> | 7 | --> |
| ... | @@ -86,17 +86,6 @@ | ... | @@ -86,17 +86,6 @@ |
| 86 | <ChevronRightIcon class="w-5 h-5 text-gray-400" /> | 86 | <ChevronRightIcon class="w-5 h-5 text-gray-400" /> |
| 87 | </div> | 87 | </div> |
| 88 | </div> | 88 | </div> |
| 89 | - | ||
| 90 | - <!-- 课程集合 --> | ||
| 91 | - <div class="p-4" @click="router.push('/studyCourse')"> | ||
| 92 | - <div class="flex items-center justify-between"> | ||
| 93 | - <div> | ||
| 94 | - <h3 class="text-base font-medium text-gray-900">课程集合</h3> | ||
| 95 | - <p class="text-sm text-gray-500">课程集合</p> | ||
| 96 | - </div> | ||
| 97 | - <ChevronRightIcon class="w-5 h-5 text-gray-400" /> | ||
| 98 | - </div> | ||
| 99 | - </div> | ||
| 100 | </div> | 89 | </div> |
| 101 | </FrostedGlass> | 90 | </FrostedGlass> |
| 102 | </div> | 91 | </div> | ... | ... |
-
Please register or login to post a comment