完成发现,个人中心

This commit is contained in:
cbb
2026-01-06 16:35:57 +08:00
parent 07cd0f6b37
commit 578eafafa1
23 changed files with 740 additions and 61 deletions

View File

@@ -11,6 +11,10 @@
const formData = reactive({
type: '1'
})
const onTop = id => {
formData.type = id
}
</script>
<template>
@@ -83,6 +87,7 @@
<style lang="scss" scoped>
// @import './styles/public.scss';
@import '@/styles/top-selector.scss';
.comment-box {
padding: 32rpx 24rpx;
.card-box {

View File

@@ -4,7 +4,13 @@
import { reactive, ref } from 'vue'
import { formatRMB } from '@/utils'
import { getUserAddress } from '@/api'
import { getUserPayPwd } from '@/api/my-index'
import { navigateTo, redirectTo } from '@/utils/router'
import { useUI } from '@/utils/use-ui'
import { useUserStore } from '@/stores/user'
const { showToast, showDialog } = useUI()
const { refreshUserInfo } = useUserStore()
const viewData = ref({})
@@ -33,13 +39,13 @@
state: false,
loading: true
})
const tixian = ref(null)
/** 获取用户地址 */
const userRess = async () => {
topRessData.loading = true
const res = await getUserAddress({ pageNum: 1, pageSize: 99 }, false)
const data = res.rows.find(v => v.defaultAddress == 1)
console.log(data, '地址数据===')
topRessData.state = !data?.id
topRessData.name = data?.name || ''
topRessData.houseNum = data?.houseNum || ''
@@ -81,13 +87,33 @@
// 提交订单
const onConfirm = async () => {
if (!topRessData.id) {
showToast(`请选择地址`)
return
}
const res = await getUserPayPwd()
if (res?.data) {
tixian.value.open()
} else {
const show = await showDialog('提示', '请先设置支付密码')
if (show) {
navigateTo('/pages/my-index/wallet/edit-password', { type: 0 })
}
}
}
const submit = async e => {
const data = {
payPassword: e.join(''),
addressId: topRessData.id,
productId: viewData.value.id,
quantity: formData.num,
skuId: formData.spec
}
tixian.value.close()
const res = await addOrder(data)
await refreshUserInfo()
redirectTo('/pages/shop-together/detail', {
id: res.data.groupId,
type: 'add'
@@ -105,6 +131,8 @@
<template>
<view class="mall-confirm-order">
<uu-pwdModal ref="tixian" @success="submit"></uu-pwdModal>
<!-- 地址 -->
<view class="address-box" @click="onRess">
<text v-if="topRessData.state" class="wu-adres">