feat: window change

master
xjs 2025-07-29 10:55:24 +08:00
parent b6a42435f9
commit 6d91e71dc3
13 changed files with 179 additions and 115 deletions

View File

@ -95,7 +95,7 @@ importers:
version: 0.65.2(postcss@5.2.18)(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.1)(jiti@2.4.1)(sass-embedded@1.86.0)(sass@1.89.2)(tsx@4.19.2))(vue@3.5.13(typescript@5.6.3)) version: 0.65.2(postcss@5.2.18)(rollup@4.28.1)(vite@6.0.3(@types/node@22.10.1)(jiti@2.4.1)(sass-embedded@1.86.0)(sass@1.89.2)(tsx@4.19.2))(vue@3.5.13(typescript@5.6.3))
unplugin-auto-import: unplugin-auto-import:
specifier: ^19.3.0 specifier: ^19.3.0
version: 19.3.0(@nuxt/kit@3.14.1592(rollup@4.28.1)) version: 19.3.0(@nuxt/kit@3.14.1592(rollup@4.28.1))(@vueuse/core@13.5.0(vue@3.5.13(typescript@5.6.3)))
unplugin-vue-components: unplugin-vue-components:
specifier: ^28.8.0 specifier: ^28.8.0
version: 28.8.0(@babel/parser@7.26.3)(@nuxt/kit@3.14.1592(rollup@4.28.1))(vue@3.5.13(typescript@5.6.3)) version: 28.8.0(@babel/parser@7.26.3)(@nuxt/kit@3.14.1592(rollup@4.28.1))(vue@3.5.13(typescript@5.6.3))
@ -752,6 +752,9 @@ packages:
'@types/qs@6.9.17': '@types/qs@6.9.17':
resolution: {integrity: sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==} resolution: {integrity: sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==}
'@types/web-bluetooth@0.0.21':
resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==}
'@unocss-applet/preset-rem-rpx@0.9.0': '@unocss-applet/preset-rem-rpx@0.9.0':
resolution: {integrity: sha512-0gDNY0kWK9jzPhbLGYINISsxSNRzcW+8CAeb1gvHqfSo80lI48uAb/bOET2IU9sIhG9Rwg4Xy08fXn0ca+0ZFw==} resolution: {integrity: sha512-0gDNY0kWK9jzPhbLGYINISsxSNRzcW+8CAeb1gvHqfSo80lI48uAb/bOET2IU9sIhG9Rwg4Xy08fXn0ca+0ZFw==}
peerDependencies: peerDependencies:
@ -905,6 +908,19 @@ packages:
'@vue/shared@3.5.13': '@vue/shared@3.5.13':
resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==}
'@vueuse/core@13.5.0':
resolution: {integrity: sha512-wV7z0eUpifKmvmN78UBZX8T7lMW53Nrk6JP5+6hbzrB9+cJ3jr//hUlhl9TZO/03bUkMK6gGkQpqOPWoabr72g==}
peerDependencies:
vue: ^3.5.0
'@vueuse/metadata@13.5.0':
resolution: {integrity: sha512-euhItU3b0SqXxSy8u1XHxUCdQ8M++bsRs+TYhOLDU/OykS7KvJnyIFfep0XM5WjIFry9uAPlVSjmVHiqeshmkw==}
'@vueuse/shared@13.5.0':
resolution: {integrity: sha512-K7GrQIxJ/ANtucxIXbQlUHdB0TPA8c+q5i+zbrjxuhJCnJ9GtBg75sBSnvmLSxHKPg2Yo8w62PWksl9kwH0Q8g==}
peerDependencies:
vue: ^3.5.0
acorn@8.14.0: acorn@8.14.0:
resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==}
engines: {node: '>=0.4.0'} engines: {node: '>=0.4.0'}
@ -3323,6 +3339,9 @@ snapshots:
'@types/qs@6.9.17': {} '@types/qs@6.9.17': {}
'@types/web-bluetooth@0.0.21':
optional: true
'@unocss-applet/preset-rem-rpx@0.9.0(@unocss/core@0.65.2)': '@unocss-applet/preset-rem-rpx@0.9.0(@unocss/core@0.65.2)':
dependencies: dependencies:
'@unocss/core': 0.65.2 '@unocss/core': 0.65.2
@ -3575,6 +3594,22 @@ snapshots:
'@vue/shared@3.5.13': {} '@vue/shared@3.5.13': {}
'@vueuse/core@13.5.0(vue@3.5.13(typescript@5.6.3))':
dependencies:
'@types/web-bluetooth': 0.0.21
'@vueuse/metadata': 13.5.0
'@vueuse/shared': 13.5.0(vue@3.5.13(typescript@5.6.3))
vue: 3.5.13(typescript@5.6.3)
optional: true
'@vueuse/metadata@13.5.0':
optional: true
'@vueuse/shared@13.5.0(vue@3.5.13(typescript@5.6.3))':
dependencies:
vue: 3.5.13(typescript@5.6.3)
optional: true
acorn@8.14.0: {} acorn@8.14.0: {}
acorn@8.15.0: {} acorn@8.15.0: {}
@ -5503,7 +5538,7 @@ snapshots:
- supports-color - supports-color
- vue - vue
unplugin-auto-import@19.3.0(@nuxt/kit@3.14.1592(rollup@4.28.1)): unplugin-auto-import@19.3.0(@nuxt/kit@3.14.1592(rollup@4.28.1))(@vueuse/core@13.5.0(vue@3.5.13(typescript@5.6.3))):
dependencies: dependencies:
local-pkg: 1.1.1 local-pkg: 1.1.1
magic-string: 0.30.17 magic-string: 0.30.17
@ -5513,6 +5548,7 @@ snapshots:
unplugin-utils: 0.2.4 unplugin-utils: 0.2.4
optionalDependencies: optionalDependencies:
'@nuxt/kit': 3.14.1592(rollup@4.28.1) '@nuxt/kit': 3.14.1592(rollup@4.28.1)
'@vueuse/core': 13.5.0(vue@3.5.13(typescript@5.6.3))
unplugin-utils@0.2.4: unplugin-utils@0.2.4:
dependencies: dependencies:

View File

@ -1,5 +1,5 @@
<template> <template>
<nut-drag direction="y" attract :style="[props.bottom ? {bottom:props.bottom} : {top:props.top}]" class="rounded-full bg-[#fff] border-solid border-black border-[3rpx] left-[30rpx]" style="z-index: 999 !important;"> <nut-drag direction="y" attract :style="{bottom:'15vh'}" class="rounded-full bg-[#fff] border-solid border-black border-[3rpx] left-[30rpx]" style="z-index: 999 !important;">
<ChevronLeft class="w-[88rpx] h-[88rpx] text-black" :stroke-width="2" @click="goBack"/> <ChevronLeft class="w-[88rpx] h-[88rpx] text-black" :stroke-width="2" @click="goBack"/>
</nut-drag> </nut-drag>
</template> </template>
@ -8,7 +8,7 @@
import { ChevronLeft } from 'lucide-vue-next'; import { ChevronLeft } from 'lucide-vue-next';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
const props = defineProps({ defineProps({
bottom:{ bottom:{
type:String, type:String,
default:"" default:""

View File

@ -12,15 +12,15 @@ export const useGetLessonCategory = () => {
return { lessonCategory } return { lessonCategory }
} }
export const useGetLessonList = () => { export const lessonList = ref<any[]>([]);
const lessonList = ref<any[]>([]); export const useGetLessonList = (type:number = 1) => {
getRequest(getLessonList()).then(resp => { getRequest(getLessonList(),{type}).then(resp => {
if(resp.code === 200){ if(resp.code === 200){
lessonList.value = (resp.result as {items:any[]}).items; lessonList.value = (resp.result as {data:any[]}).data;
}else{
lessonList.value = [];
} }
}) })
return { lessonList }
} }
export const useGetCourseDetail = () => { export const useGetCourseDetail = () => {

View File

@ -6,6 +6,7 @@ type RecvAddr = {
name: string; name: string;
phone: string; phone: string;
isDefault: boolean; isDefault: boolean;
id:number
} }
type UserState = { type UserState = {

View File

@ -35,14 +35,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useShoppingCartStore } from "@/store/shoppingCart"; import { useShoppingCartStore } from "@/store/shoppingCart";
import { useGetCourseDetail,useGetLessonList } from "@/composables/useCourses"; import { useGetCourseDetail,useGetLessonList,lessonList } from "@/composables/useCourses";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { CartTypeEnum } from "@/types/cart"; import { CartTypeEnum } from "@/types/cart";
const router = useRouter(); const router = useRouter();
const shoppingCartStore = useShoppingCartStore(); const shoppingCartStore = useShoppingCartStore();
const { courseDetail } = useGetCourseDetail(); const { courseDetail } = useGetCourseDetail();
const { lessonList } = useGetLessonList(); useGetLessonList();
const paidCourseName = computed(() =>{ const paidCourseName = computed(() =>{
const courseNames = lessonList.value.filter(item => item.price > 0).map((item,index) => ({title:item.title,index:index+1})); const courseNames = lessonList.value.filter(item => item.price > 0).map((item,index) => ({title:item.title,index:index+1}));

View File

@ -43,7 +43,7 @@
</div> </div>
</div> </div>
<div class="mt-[30rpx]"> <div class="mt-[30rpx]">
<img :src="courseDetail?.extra?.qrCode" alt="" class="w-full h-max" /> <img :src="courseDetail?.extra?.qrCode" alt="" class="w-full object-cover" />
</div> </div>
</div> </div>
</nut-tab-pane> </nut-tab-pane>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="flex flex-col"> <div class="flex flex-col">
<ul class="flex items-center justify-between px-[30rpx] py-[20rpx] overflow-x-auto gap-[54rpx] min-h-[200rpx]"> <ul class="flex items-center justify-between px-[30rpx] py-[20rpx] overflow-x-auto gap-[54rpx] min-h-[200rpx]">
<li class="flex flex-col items-center min-w-max" v-for="(item, index) in lessonCategory" :key="index" @click="activeMenu = item.id"> <li class="flex flex-col items-center min-w-max" v-for="(item, index) in lessonCategory" :key="index" @click="handleChange(item.id)">
<img <img
:src="item.icon" :src="item.icon"
alt="icon" alt="icon"
@ -11,8 +11,8 @@
</li> </li>
</ul> </ul>
<nut-list :list-data="lessonList" class="bg-#F5F5F5"> <ul class="bg-#F5F5F5">
<template #default="{ item }"> <li v-for="(item,index) in lessonList" :key="index">
<div class="flex rounded-[20rpx] m-[30rpx] bg-white" @click="navigateToPage(item.id)"> <div class="flex rounded-[20rpx] m-[30rpx] bg-white" @click="navigateToPage(item.id)">
<img :src="item.image" alt="cover" class="w-[256rpx] h-[256rpx] rounded-[20rpx_0_0_20rpx]"> <img :src="item.image" alt="cover" class="w-[256rpx] h-[256rpx] rounded-[20rpx_0_0_20rpx]">
<div class="ml-[20rpx] pt-[30rpx] pb-[20rpx] pr-[20rpx] flex-auto flex flex-col justify-between"> <div class="ml-[20rpx] pt-[30rpx] pb-[20rpx] pr-[20rpx] flex-auto flex flex-col justify-between">
@ -29,13 +29,13 @@
</div> </div>
</div> </div>
</div> </div>
</template> </li>
</nut-list> </ul>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useGetLessonCategory, useGetLessonList } from "@/composables/useCourses"; import { useGetLessonCategory, useGetLessonList,lessonList } from "@/composables/useCourses";
import { ChevronRight } from "lucide-vue-next"; import { ChevronRight } from "lucide-vue-next";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
@ -48,7 +48,12 @@
activeMenu.value = lessonCategory.value[0].id; activeMenu.value = lessonCategory.value[0].id;
}) })
const { lessonList } = useGetLessonList(); useGetLessonList();
const handleChange = (id: number) => {
activeMenu.value = id;
useGetLessonList(id);
}
const navigateToPage = (id: string) => { const navigateToPage = (id: string) => {
router.push({name:'courses-detail',params:{id}}) router.push({name:'courses-detail',params:{id}})

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="flex flex-col bg-[#F5F5F5]"> <div class="flex flex-col bg-[#F5F5F5]">
<ul class="flex items-center justify-between px-[30rpx] py-[20rpx] overflow-x-auto gap-[54rpx] min-h-[200rpx]"> <ul class="flex items-center justify-between px-[30rpx] py-[20rpx] overflow-x-auto gap-[54rpx] min-h-[200rpx]">
<li class="flex flex-col items-center min-w-max" v-for="(item, index) in filterList" :key="index" @click="activeMenu = item.id"> <li class="flex flex-col items-center min-w-max" v-for="(item, index) in filterList" :key="index" @click="handleChange(item.id)">
<img <img
:src="item.icon" :src="item.icon"
alt="icon" alt="icon"
@ -11,16 +11,15 @@
</li> </li>
</ul> </ul>
<ul>
<nut-list class="" :list-data="products" @scroll-bottom="onScrollBottom"> <li v-for="(item,index) in products" :key="index">
<template #default="{ item }">
<div class="flex items-center mt-[30rpx] mx-[30rpx]" @click="toProductInfo(item)"> <div class="flex items-center mt-[30rpx] mx-[30rpx]" @click="toProductInfo(item)">
<div class="h-[256rpx] w-full rounded-[20rpx] bg-[#fff] flex"> <div class="h-[256rpx] w-full rounded-[20rpx] bg-[#fff] flex">
<img :src="item.image" alt="thumb" class="h-full object-cover w-[256rpx] rounded-[20rpx_0_0_20rpx]" /> <img :src="item.image" alt="thumb" class="h-full object-cover w-[256rpx] rounded-[20rpx_0_0_20rpx]" />
<div class="flex flex-col p-[30rpx] flex-auto justify-between"> <div class="flex flex-col p-[30rpx] flex-auto justify-between">
<div class="text-[40rpx] font-500">{{ item.title }}</div> <div class="text-[40rpx] font-500">{{ item.title }}</div>
<div class="flex items-baseline text-[#F68E1D] font-700"> <div class="flex items-baseline text-[#F68E1D] font-700">
<img src="/images/nursing/rate.png" alt="rate.png" class="w-[48rpx] h-[48rpx]"> <img src="/images/nursing/rate.png" alt="rate.png" class="w-[48rpx] h-[48rpx]" />
<div class="text-[40rpx]">{{ item.rating }}</div> <div class="text-[40rpx]">{{ item.rating }}</div>
<div class="text-[28rpx]"></div> <div class="text-[28rpx]"></div>
</div> </div>
@ -34,8 +33,8 @@
</div> </div>
</div> </div>
</div> </div>
</template> </li>
</nut-list> </ul>
<div class="h-[76rpx] w-[486rpx] rounded-full bg-[#1D86FF] flex items-center justify-center self-center text-[#fff] text-[32rpx] font-500 my-[20rpx]"> <div class="h-[76rpx] w-[486rpx] rounded-full bg-[#1D86FF] flex items-center justify-center self-center text-[#fff] text-[32rpx] font-500 my-[20rpx]">
<span>没有您要的服务请联系</span> <span>没有您要的服务请联系</span>
<PhoneCall :stroke-width="1.5" class="ml-[12rpx]" /> <PhoneCall :stroke-width="1.5" class="ml-[12rpx]" />
@ -53,33 +52,33 @@
useGetUserAddressList(); useGetUserAddressList();
const router = useRouter(); const router = useRouter();
const filterList = [ const filterList = [
{ id: 0, name: "居家照护", icon: "/images/shop/care.png" }, { id: 1, name: "居家照护", icon: "/images/shop/care.png" },
{ id: 1, name: "住院陪护", icon: "/images/shop/hospital.png" }, { id: 2, name: "住院陪护", icon: "/images/shop/hospital.png" },
{ id: 3, name: "上门助浴", icon: "/images/shop/bath.png" }, { id: 3, name: "上门助浴", icon: "/images/shop/bath.png" },
{ id: 4, name: "陪诊陪检", icon: "/images/shop/medic.png" }, { id: 4, name: "陪诊陪检", icon: "/images/shop/medic.png" },
]; ];
const activeMenu = ref(0); const activeMenu = ref(1);
const products = ref<any[]>([]); const products = ref<any[]>([]);
const useProducts = () => { const useProducts = () => {
getRequest(getHospitalCompanionList()).then((resp) => { getRequest(getHospitalCompanionList(), { type: activeMenu.value }).then((resp) => {
products.value = (resp.result as { data: any[] }).data; products.value = (resp.result as { data: any[] }).data;
}); });
}; };
useProducts(); useProducts();
const onScrollBottom = () => {
// useProducts()
};
const toProductInfo = (product: any) => { const toProductInfo = (product: any) => {
router.push({ router.push({
name:"health-care-order", name: "health-care-order",
params:{ params: {
id:product.id id: product.id,
} },
}); });
}; };
const handleChange = (id: number) => {
activeMenu.value = id;
useProducts();
};
</script> </script>

View File

@ -14,7 +14,7 @@
</div> </div>
</template> </template>
<nut-tab-pane v-for="item in list" :key="item.paneKey" :pane-key="item.paneKey"> <nut-tab-pane v-for="item in list" :key="item.paneKey" :pane-key="item.paneKey">
<ul class="flex flex-col flex-auto min-h-0 overflow-auto"> <ul class="flex flex-col h-full">
<li <li
v-for="(item, index) in cleaningList" v-for="(item, index) in cleaningList"
:key="index" :key="index"
@ -34,8 +34,11 @@
</div> </div>
</div> </div>
</li> </li>
<li class="rounded-[20rpx] flex flex-col" v-else> <li class="rounded-[20rpx] flex flex-col h-full" v-else>
<img src="/images/housekeeping/housekeeping.png" alt="" class="w-full bg-contain flex-1" /> <div class="flex-1 min-h-0 overflow-auto">
<img src="/images/housekeeping/housekeeping.png" alt="" class="w-full bg-contain" />
</div>
<div class="py-[16rpx] px-[30rpx] flex items-center mt-auto"> <div class="py-[16rpx] px-[30rpx] flex items-center mt-auto">
<a class="flex flex-col text-[#1D86FF] text-[28rpx] justify-center items-center" :href="`tel:400-810-9999`"> <a class="flex flex-col text-[#1D86FF] text-[28rpx] justify-center items-center" :href="`tel:400-810-9999`">
<PhoneCall :stroke-width="1" fill="#1D86FF" class="mb-[4rpx]" /> <PhoneCall :stroke-width="1" fill="#1D86FF" class="mb-[4rpx]" />

View File

@ -1,8 +1,13 @@
<template> <template>
<div class="flex flex-col "> <div class="flex flex-col">
<ul class="flex-auto bg-[#F5F5F5] p-[30rpx] overflow-auto"> <ul class="flex-auto bg-[#F5F5F5] p-[30rpx] overflow-auto">
<nut-radio-group v-model="defaultAddress" class="grid! gap-[30rpx]" @change="handleRadioChange"> <nut-radio-group v-model="defaultAddress" class="grid! gap-[30rpx]" @change="handleRadioChange">
<li v-for="(item, index) in address" :key="index" class="rounded-[20rpx] p-[30rpx] bg-white focus:outline outline-[4rpx] outline-[#28BEBB]" tabindex="0"> <li
v-for="(item, index) in address"
:key="index"
class="rounded-[20rpx] p-[30rpx] bg-white focus:outline outline-[4rpx] outline-[#28BEBB]"
tabindex="0"
@click.self="handleChooseLocation(item)">
<p class="text-[36rpx] font-600">{{ item.fullAddress }}</p> <p class="text-[36rpx] font-600">{{ item.fullAddress }}</p>
<div class="flex items-center text-[#333] text-[32rpx] font-400 my-[30rpx]"> <div class="flex items-center text-[#333] text-[32rpx] font-400 my-[30rpx]">
<span class="mr-[20rpx]">{{ item.name }}</span> <span class="mr-[20rpx]">{{ item.name }}</span>
@ -11,8 +16,7 @@
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<nut-radio :label="item.id"> <nut-radio :label="item.id">
<template #icon> <template #icon>
<div class="w-[36rpx] h-[36rpx] rounded-full border-solid border-[#999] border-[2rpx] mr-[10rpx]"> <div class="w-[36rpx] h-[36rpx] rounded-full border-solid border-[#999] border-[2rpx] mr-[10rpx]"></div>
</div>
<span class="text-[#999] text-[32rpx] font-400">设为默认</span> <span class="text-[#999] text-[32rpx] font-400">设为默认</span>
</template> </template>
<template #checkedIcon> <template #checkedIcon>
@ -24,12 +28,12 @@
</nut-radio> </nut-radio>
<div class="flex items-center"> <div class="flex items-center">
<div class="flex items-center mr-[40rpx]" v-show="defaultAddress !== item.id"> <div class="flex items-center mr-[40rpx]" v-show="defaultAddress !== item.id">
<Trash2 class="w-[36rpx] h-[36rpx] text-[#ccc] mr-[10rpx]"/> <Trash2 class="w-[36rpx] h-[36rpx] text-[#ccc] mr-[10rpx]" />
<span class="text-[32rpx] text-[#666] font-400" @click="handleRemoveAddress(index)"></span> <span class="text-[32rpx] text-[#666] font-400" @click="handleRemoveAddress(index)"></span>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<PencilLine class="w-[36rpx] h-[36rpx] text-[#ccc] mr-[10rpx]"/> <PencilLine class="w-[36rpx] h-[36rpx] text-[#ccc] mr-[10rpx]" />
<span class="text-[32rpx] text-[#666] font-400">修改</span> <span class="text-[32rpx] text-[#666] font-400">修改</span>
</div> </div>
</div> </div>
@ -49,33 +53,43 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Check,Trash2,PencilLine,CirclePlus } from "lucide-vue-next"; import { Check, Trash2, PencilLine, CirclePlus } from "lucide-vue-next";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import {address,defaultAddress,useGetUserAddressList} from "@/composables/useUserAddress" import { address, defaultAddress, useGetUserAddressList } from "@/composables/useUserAddress";
import { postRequest } from "@/api/customFetch"; import { postRequest } from "@/api/customFetch";
import { setUserDefaultAddress } from "@/api/interfaceDocument"; import { setUserDefaultAddress } from "@/api/interfaceDocument";
import { showToast } from "@nutui/nutui"; import { showToast } from "@nutui/nutui";
import { useUserStore } from "@/store/user";
useGetUserAddressList(); useGetUserAddressList();
const router = useRouter() const router = useRouter();
const userStore = useUserStore();
const handleBack = () => { const handleBack = () => {
router.back() router.back();
} };
const handleRemoveAddress = (index:number) => { const handleRemoveAddress = (index: number) => {
address.value.splice(index,1) address.value.splice(index, 1);
} };
const handleRadioChange = (_val:number) => { const handleRadioChange = (_val: number) => {
postRequest(setUserDefaultAddress()).then(()=>{ postRequest(setUserDefaultAddress()).then(() => {
showToast.text("修改成功") userStore.setDefaultAddress(userStore.recvAddrList.filter(item => item.id === _val)[0]);
}) showToast.text("修改成功");
} });
};
const toAddAddressPage = () =>{ const toAddAddressPage = () => {
router.push({path:'/mine/add/address'}) router.push({ path: "/mine/add/address" });
} };
const handleChooseLocation = (item: any) => {
postRequest(setUserDefaultAddress()).then(() => {
userStore.setDefaultAddress(item);
showToast.text("修改成功");
handleBack();
});
};
</script> </script>

View File

@ -47,7 +47,7 @@
<span class="text-[32rpx] font-500">消息中心</span> <span class="text-[32rpx] font-500">消息中心</span>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<div class="w-[44rpx] h-[44rpx] rounded-full bg-[#F03B25] text-white flex items-center justify-center ">{{ noticeList.length }}</div> <div class="w-[44rpx] h-[44rpx] rounded-full bg-[#F03B25] text-white flex items-center justify-center ">{{ noticeList?.length }}</div>
<ChevronRight /> <ChevronRight />
</div> </div>
</li> </li>

View File

@ -10,7 +10,7 @@
<template #page> <template #page>
<div <div
class="w-[76rpx] h-[44rpx] bg-[#545255] absolute bottom-[16rpx] right-[16rpx] flex items-center justify-center rounded-full text-[#FDFDFD] text-[28rpx]"> class="w-[76rpx] h-[44rpx] bg-[#545255] absolute bottom-[16rpx] right-[16rpx] flex items-center justify-center rounded-full text-[#FDFDFD] text-[28rpx]">
{{ val }}/4 {{ val }}/{{ foodDetail?.cover?.length }}
</div> </div>
</template> </template>
</nut-swiper> </nut-swiper>
@ -66,6 +66,7 @@
}); });
const showFn = () => { const showFn = () => {
state.showPreview = true; state.showPreview = true;
state.imgData = foodDetail.value.cover.map((item:string) => ({src:item}))
}; };
const hideFn = () => { const hideFn = () => {
state.showPreview = false; state.showPreview = false;

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="flex flex-col"> <div class="flex flex-col">
<ul class="flex items-center justify-between px-[30rpx] py-[20rpx]"> <ul class="flex items-center justify-between px-[30rpx] py-[20rpx]">
<li class="flex flex-col items-center" v-for="(item, index) in filterList" :key="index" @click="activeMenu = item.id"> <li class="flex flex-col items-center" v-for="(item, index) in filterList" :key="index" @click="handleChange(item.id)">
<img <img
:src="item.icon" :src="item.icon"
alt="icon" alt="icon"
@ -14,7 +14,7 @@
<template #default="{ item }"> <template #default="{ item }">
<div class="flex items-center justify-center mt-[30rpx] mx-[30rpx]" @click="toProductInfo(item)"> <div class="flex items-center justify-center mt-[30rpx] mx-[30rpx]" @click="toProductInfo(item)">
<div class="h-[256rpx] rounded-[20rpx] bg-[#fff] flex"> <div class="h-[256rpx] rounded-[20rpx] bg-[#fff] flex">
<img :src="item.image" alt="thumb" class="h-full object-cover w-[256rpx]" /> <img :src="item.image" alt="thumb" class="h-full object-cover w-[256rpx] rounded-[20rpx_0_0_20rpx]" />
<div class="flex flex-col p-[30rpx] flex-auto justify-between"> <div class="flex flex-col p-[30rpx] flex-auto justify-between">
<div class="text-[40rpx] font-500">{{ item.name }}</div> <div class="text-[40rpx] font-500">{{ item.name }}</div>
<div class="flex justify-between items-end"> <div class="flex justify-between items-end">
@ -38,12 +38,12 @@
useGetUserAddressList(); useGetUserAddressList();
const router = useRouter(); const router = useRouter();
const filterList = [ const filterList = [
{ id: 0, name: "推荐", icon: "/images/shop/recommend.png" }, { id: 1, name: "推荐", icon: "/images/shop/recommend.png" },
{ id: 1, name: "居家安全", icon: "/images/shop/wheelchair.png" }, { id: 2, name: "居家安全", icon: "/images/shop/wheelchair.png" },
{ id: 3, name: "出行助理", icon: "/images/shop/travel.png" }, { id: 3, name: "出行助理", icon: "/images/shop/travel.png" },
{ id: 4, name: "洗护用品", icon: "/images/shop/toiletries.png" }, { id: 4, name: "洗护用品", icon: "/images/shop/toiletries.png" },
]; ];
const activeMenu = ref(0); const activeMenu = ref(1);
const useProductCategory = () => { const useProductCategory = () => {
getRequest(getProductCategory()).then((_resp) => {}); getRequest(getProductCategory()).then((_resp) => {});
@ -52,7 +52,7 @@
const products = ref<any[]>([]); const products = ref<any[]>([]);
const useProducts = () => { const useProducts = () => {
getRequest(getMallRecommend()).then((resp) => { getRequest(getMallRecommend(),{type:activeMenu.value}).then((resp) => {
products.value = (resp.result as { products: any[] }).products; products.value = (resp.result as { products: any[] }).products;
}); });
}; };
@ -65,4 +65,9 @@
const toProductInfo = (product: any) => { const toProductInfo = (product: any) => {
router.push({ path: "/shop/product", query: { id: product.id } }); router.push({ path: "/shop/product", query: { id: product.id } });
}; };
const handleChange = (id: number) => {
activeMenu.value = id;
useProducts();
};
</script> </script>