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))
unplugin-auto-import:
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:
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))
@ -752,6 +752,9 @@ packages:
'@types/qs@6.9.17':
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':
resolution: {integrity: sha512-0gDNY0kWK9jzPhbLGYINISsxSNRzcW+8CAeb1gvHqfSo80lI48uAb/bOET2IU9sIhG9Rwg4Xy08fXn0ca+0ZFw==}
peerDependencies:
@ -905,6 +908,19 @@ packages:
'@vue/shared@3.5.13':
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:
resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==}
engines: {node: '>=0.4.0'}
@ -3323,6 +3339,9 @@ snapshots:
'@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)':
dependencies:
'@unocss/core': 0.65.2
@ -3575,6 +3594,22 @@ snapshots:
'@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.15.0: {}
@ -5503,7 +5538,7 @@ snapshots:
- supports-color
- 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:
local-pkg: 1.1.1
magic-string: 0.30.17
@ -5513,6 +5548,7 @@ snapshots:
unplugin-utils: 0.2.4
optionalDependencies:
'@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:
dependencies:

View File

@ -1,5 +1,5 @@
<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"/>
</nut-drag>
</template>
@ -8,7 +8,7 @@
import { ChevronLeft } from 'lucide-vue-next';
import { useRouter } from 'vue-router';
const props = defineProps({
defineProps({
bottom:{
type:String,
default:""

View File

@ -12,15 +12,15 @@ export const useGetLessonCategory = () => {
return { lessonCategory }
}
export const useGetLessonList = () => {
const lessonList = ref<any[]>([]);
getRequest(getLessonList()).then(resp => {
export const lessonList = ref<any[]>([]);
export const useGetLessonList = (type:number = 1) => {
getRequest(getLessonList(),{type}).then(resp => {
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 = () => {

View File

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

View File

@ -35,14 +35,14 @@
<script lang="ts" setup>
import { useShoppingCartStore } from "@/store/shoppingCart";
import { useGetCourseDetail,useGetLessonList } from "@/composables/useCourses";
import { useGetCourseDetail,useGetLessonList,lessonList } from "@/composables/useCourses";
import { useRouter } from "vue-router";
import { CartTypeEnum } from "@/types/cart";
const router = useRouter();
const shoppingCartStore = useShoppingCartStore();
const { courseDetail } = useGetCourseDetail();
const { lessonList } = useGetLessonList();
useGetLessonList();
const paidCourseName = computed(() =>{
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 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>
</nut-tab-pane>

View File

@ -1,7 +1,7 @@
<template>
<div class="flex flex-col">
<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
:src="item.icon"
alt="icon"
@ -11,8 +11,8 @@
</li>
</ul>
<nut-list :list-data="lessonList" class="bg-#F5F5F5">
<template #default="{ item }">
<ul class="bg-#F5F5F5">
<li v-for="(item,index) in lessonList" :key="index">
<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]">
<div class="ml-[20rpx] pt-[30rpx] pb-[20rpx] pr-[20rpx] flex-auto flex flex-col justify-between">
@ -29,13 +29,13 @@
</div>
</div>
</div>
</template>
</nut-list>
</li>
</ul>
</div>
</template>
<script lang="ts" setup>
import { useGetLessonCategory, useGetLessonList } from "@/composables/useCourses";
import { useGetLessonCategory, useGetLessonList,lessonList } from "@/composables/useCourses";
import { ChevronRight } from "lucide-vue-next";
import { useRouter } from "vue-router";
@ -48,7 +48,12 @@
activeMenu.value = lessonCategory.value[0].id;
})
const { lessonList } = useGetLessonList();
useGetLessonList();
const handleChange = (id: number) => {
activeMenu.value = id;
useGetLessonList(id);
}
const navigateToPage = (id: string) => {
router.push({name:'courses-detail',params:{id}})

View File

@ -1,7 +1,7 @@
<template>
<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]">
<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
:src="item.icon"
alt="icon"
@ -11,16 +11,15 @@
</li>
</ul>
<nut-list class="" :list-data="products" @scroll-bottom="onScrollBottom">
<template #default="{ item }">
<ul>
<li v-for="(item,index) in products" :key="index">
<div class="flex items-center mt-[30rpx] mx-[30rpx]" @click="toProductInfo(item)">
<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]" />
<div class="flex flex-col p-[30rpx] flex-auto justify-between">
<div class="text-[40rpx] font-500">{{ item.title }}</div>
<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-[28rpx]"></div>
</div>
@ -34,8 +33,8 @@
</div>
</div>
</div>
</template>
</nut-list>
</li>
</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]">
<span>没有您要的服务请联系</span>
<PhoneCall :stroke-width="1.5" class="ml-[12rpx]" />
@ -53,33 +52,33 @@
useGetUserAddressList();
const router = useRouter();
const filterList = [
{ id: 0, name: "居家照护", icon: "/images/shop/care.png" },
{ id: 1, name: "住院陪护", icon: "/images/shop/hospital.png" },
{ id: 1, name: "居家照护", icon: "/images/shop/care.png" },
{ id: 2, name: "住院陪护", icon: "/images/shop/hospital.png" },
{ id: 3, name: "上门助浴", icon: "/images/shop/bath.png" },
{ id: 4, name: "陪诊陪检", icon: "/images/shop/medic.png" },
];
const activeMenu = ref(0);
const activeMenu = ref(1);
const products = ref<any[]>([]);
const useProducts = () => {
getRequest(getHospitalCompanionList()).then((resp) => {
getRequest(getHospitalCompanionList(), { type: activeMenu.value }).then((resp) => {
products.value = (resp.result as { data: any[] }).data;
});
};
useProducts();
const onScrollBottom = () => {
// useProducts()
};
const toProductInfo = (product: any) => {
router.push({
name: "health-care-order",
params: {
id:product.id
}
id: product.id,
},
});
};
const handleChange = (id: number) => {
activeMenu.value = id;
useProducts();
};
</script>

View File

@ -14,7 +14,7 @@
</div>
</template>
<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
v-for="(item, index) in cleaningList"
:key="index"
@ -34,8 +34,11 @@
</div>
</div>
</li>
<li class="rounded-[20rpx] flex flex-col" v-else>
<img src="/images/housekeeping/housekeeping.png" alt="" class="w-full bg-contain flex-1" />
<li class="rounded-[20rpx] flex flex-col h-full" v-else>
<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">
<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]" />

View File

@ -2,7 +2,12 @@
<div class="flex flex-col">
<ul class="flex-auto bg-[#F5F5F5] p-[30rpx] overflow-auto">
<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>
<div class="flex items-center text-[#333] text-[32rpx] font-400 my-[30rpx]">
<span class="mr-[20rpx]">{{ item.name }}</span>
@ -11,8 +16,7 @@
<div class="flex items-center justify-between">
<nut-radio :label="item.id">
<template #icon>
<div class="w-[36rpx] h-[36rpx] rounded-full border-solid border-[#999] border-[2rpx] mr-[10rpx]">
</div>
<div class="w-[36rpx] h-[36rpx] rounded-full border-solid border-[#999] border-[2rpx] mr-[10rpx]"></div>
<span class="text-[#999] text-[32rpx] font-400">设为默认</span>
</template>
<template #checkedIcon>
@ -51,31 +55,41 @@
<script lang="ts" setup>
import { Check, Trash2, PencilLine, CirclePlus } from "lucide-vue-next";
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 { setUserDefaultAddress } from "@/api/interfaceDocument";
import { showToast } from "@nutui/nutui";
import { useUserStore } from "@/store/user";
useGetUserAddressList();
const router = useRouter()
const router = useRouter();
const userStore = useUserStore();
const handleBack = () => {
router.back()
}
router.back();
};
const handleRemoveAddress = (index: number) => {
address.value.splice(index,1)
}
address.value.splice(index, 1);
};
const handleRadioChange = (_val: number) => {
postRequest(setUserDefaultAddress()).then(() => {
showToast.text("修改成功")
})
}
userStore.setDefaultAddress(userStore.recvAddrList.filter(item => item.id === _val)[0]);
showToast.text("修改成功");
});
};
const toAddAddressPage = () => {
router.push({path:'/mine/add/address'})
}
</script>
router.push({ path: "/mine/add/address" });
};
const handleChooseLocation = (item: any) => {
postRequest(setUserDefaultAddress()).then(() => {
userStore.setDefaultAddress(item);
showToast.text("修改成功");
handleBack();
});
};
</script>

View File

@ -47,7 +47,7 @@
<span class="text-[32rpx] font-500">消息中心</span>
</div>
<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 />
</div>
</li>

View File

@ -10,7 +10,7 @@
<template #page>
<div
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>
</template>
</nut-swiper>
@ -66,6 +66,7 @@
});
const showFn = () => {
state.showPreview = true;
state.imgData = foodDetail.value.cover.map((item:string) => ({src:item}))
};
const hideFn = () => {
state.showPreview = false;

View File

@ -1,7 +1,7 @@
<template>
<div class="flex flex-col">
<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
:src="item.icon"
alt="icon"
@ -14,7 +14,7 @@
<template #default="{ item }">
<div class="flex items-center justify-center mt-[30rpx] mx-[30rpx]" @click="toProductInfo(item)">
<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="text-[40rpx] font-500">{{ item.name }}</div>
<div class="flex justify-between items-end">
@ -38,12 +38,12 @@
useGetUserAddressList();
const router = useRouter();
const filterList = [
{ id: 0, name: "推荐", icon: "/images/shop/recommend.png" },
{ id: 1, name: "居家安全", icon: "/images/shop/wheelchair.png" },
{ id: 1, name: "推荐", icon: "/images/shop/recommend.png" },
{ id: 2, name: "居家安全", icon: "/images/shop/wheelchair.png" },
{ id: 3, name: "出行助理", icon: "/images/shop/travel.png" },
{ id: 4, name: "洗护用品", icon: "/images/shop/toiletries.png" },
];
const activeMenu = ref(0);
const activeMenu = ref(1);
const useProductCategory = () => {
getRequest(getProductCategory()).then((_resp) => {});
@ -52,7 +52,7 @@
const products = ref<any[]>([]);
const useProducts = () => {
getRequest(getMallRecommend()).then((resp) => {
getRequest(getMallRecommend(),{type:activeMenu.value}).then((resp) => {
products.value = (resp.result as { products: any[] }).products;
});
};
@ -65,4 +65,9 @@
const toProductInfo = (product: any) => {
router.push({ path: "/shop/product", query: { id: product.id } });
};
const handleChange = (id: number) => {
activeMenu.value = id;
useProducts();
};
</script>