From a376881cd8e8256c8e9d62afe712e4bb05c72839 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 25 十二月 2025 09:24:18 +0800
Subject: [PATCH] fix: 甲方小程序
---
apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg.png | 0
packages/hooks/standardOrder.ts | 11 ++
apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg-active.png | 0
apps/housekeepingMiniApp/src/pages/service/InnerPage.vue | 21 +++
apps/housekeepingMiniApp/src/assets/flexJob/icon-localtion.png | 0
apps/housekeepingMiniApp/src/assets/flexJob/icon-share.png | 0
apps/housekeepingMiniApp/project.config.json | 4
packages/components/src/Sku/sku.ts | 1
apps/housekeepingMiniApp/src/subpackages/sercice/serciceDetail/serciceDetail.vue | 177 +++++++++++++++++++++++++++++++----
package.json | 2
apps/housekeepingMiniApp/src/pages/service/service.vue | 4
apps/housekeepingMiniApp/src/pages/home/hooks/index.ts | 1
apps/housekeepingMiniApp/src/pages/home/index.vue | 21 +++
13 files changed, 209 insertions(+), 33 deletions(-)
diff --git a/apps/housekeepingMiniApp/project.config.json b/apps/housekeepingMiniApp/project.config.json
index 3173210..1b87300 100644
--- a/apps/housekeepingMiniApp/project.config.json
+++ b/apps/housekeepingMiniApp/project.config.json
@@ -3,8 +3,8 @@
"description": "",
"setting": {
"urlCheck": false,
- "es6": false,
- "enhance": false,
+ "es6": true,
+ "enhance": true,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
diff --git a/apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg-active.png b/apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg-active.png
new file mode 100644
index 0000000..08f2982
--- /dev/null
+++ b/apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg-active.png
Binary files differ
diff --git a/apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg.png b/apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg.png
new file mode 100644
index 0000000..34a1588
--- /dev/null
+++ b/apps/housekeepingMiniApp/src/assets/flexJob/icon-attention-lg.png
Binary files differ
diff --git a/apps/housekeepingMiniApp/src/assets/flexJob/icon-localtion.png b/apps/housekeepingMiniApp/src/assets/flexJob/icon-localtion.png
new file mode 100644
index 0000000..71784b5
--- /dev/null
+++ b/apps/housekeepingMiniApp/src/assets/flexJob/icon-localtion.png
Binary files differ
diff --git a/apps/housekeepingMiniApp/src/assets/flexJob/icon-share.png b/apps/housekeepingMiniApp/src/assets/flexJob/icon-share.png
new file mode 100644
index 0000000..546e699
--- /dev/null
+++ b/apps/housekeepingMiniApp/src/assets/flexJob/icon-share.png
Binary files differ
diff --git a/apps/housekeepingMiniApp/src/pages/home/hooks/index.ts b/apps/housekeepingMiniApp/src/pages/home/hooks/index.ts
index 7c89e56..a4775a2 100644
--- a/apps/housekeepingMiniApp/src/pages/home/hooks/index.ts
+++ b/apps/housekeepingMiniApp/src/pages/home/hooks/index.ts
@@ -38,5 +38,6 @@
return {
positionListChunk,
positionGrid,
+ positionList,
};
}
diff --git a/apps/housekeepingMiniApp/src/pages/home/index.vue b/apps/housekeepingMiniApp/src/pages/home/index.vue
index d3793bc..de102a6 100644
--- a/apps/housekeepingMiniApp/src/pages/home/index.vue
+++ b/apps/housekeepingMiniApp/src/pages/home/index.vue
@@ -1,10 +1,10 @@
<template>
- <PageLayoutWithBg class="index-page-wrapper" :title="''" :need-auth="false">
- <template #left>
+ <PageLayoutWithBg class="index-page-wrapper" :title="'棣栭〉'" :need-auth="false">
+ <!-- <template #left>
<div class="menu-btn-wrapper menu-logo">
<img :src="IconLogo" class="logo" />
</div>
- </template>
+ </template> -->
<InfiniteLoading
scrollViewClassName="common-infinite-scroll-list home-list"
commonMode
@@ -44,7 +44,12 @@
style="height: 160px"
> -->
<nut-grid class="home-gird" :column-num="5">
- <nut-grid-item v-for="item in positionGrid" :key="item.value" :text="item.label">
+ <nut-grid-item
+ v-for="item in positionGrid"
+ :key="item.value"
+ :text="item.label"
+ @click="goService(item)"
+ >
<img :src="setOSSLink(item.data.field2)" class="home-grid-item-icon" />
<!-- <Dongdong /> -->
</nut-grid-item>
@@ -153,6 +158,14 @@
url: `${RouterPath.serciceDetail}?id=${item.id}`,
});
}
+
+const switchTab = useSwitchTab();
+
+function goService(item: API.SelectOptionStringGetDictionaryDataSelectQueryResultOption) {
+ switchTab({
+ url: `${RouterPath.service}?id=${item.value}`,
+ });
+}
</script>
<style lang="scss">
diff --git a/apps/housekeepingMiniApp/src/pages/service/InnerPage.vue b/apps/housekeepingMiniApp/src/pages/service/InnerPage.vue
index b0a12a9..b46deb7 100644
--- a/apps/housekeepingMiniApp/src/pages/service/InnerPage.vue
+++ b/apps/housekeepingMiniApp/src/pages/service/InnerPage.vue
@@ -1,5 +1,5 @@
<template>
- <nut-category :category="data.category" @change="change" class="category-page-inner">
+ <nut-category :category="category" @change="change" class="category-page-inner">
<nut-category-pane :categoryChild="data.categoryChild" @onChange="onChange">
</nut-category-pane>
</nut-category>
@@ -7,8 +7,8 @@
<script setup lang="ts">
import Taro from '@tarojs/taro';
-import { useCheckReceiveTasks, useTaskList } from '@12333/hooks';
-import { EnumTaskCheckReceiveStatus, EnumTaskCheckReceiveMethod } from '@12333/constants';
+import { useCheckReceiveTasks, useDictionaryDataSelect, useTaskList } from '@12333/hooks';
+import { CategoryCode, PositionCodeEnum } from '@12333/constants';
import dayjs from 'dayjs';
import { categorydata } from './3x_categoryData';
@@ -16,12 +16,27 @@
name: 'InnerPage',
});
+const router = Taro.useRouter();
+const id = router.params?.id ?? '';
+
const data = reactive({
categoryInfo: categorydata.categoryInfo,
category: categorydata.categoryInfo.category,
categoryChild: categorydata.categoryChild,
});
+const { dictionaryDataList: positionList } = useDictionaryDataSelect({
+ categoryCode: CategoryCode.Position,
+ field1: PositionCodeEnum.Housekeeping,
+});
+
+const category = computed(() =>
+ positionList.value.map((x) => ({
+ ...x,
+ catName: x.label,
+ }))
+);
+
const change = (index: number) => {
data.categoryChild = [].concat(data.categoryInfo.category[index + 1].children);
};
diff --git a/apps/housekeepingMiniApp/src/pages/service/service.vue b/apps/housekeepingMiniApp/src/pages/service/service.vue
index 38ad18d..909a2d8 100644
--- a/apps/housekeepingMiniApp/src/pages/service/service.vue
+++ b/apps/housekeepingMiniApp/src/pages/service/service.vue
@@ -1,7 +1,7 @@
<template>
- <PageLayoutWithBg class="task-page-wrapper" title="鍏ㄩ儴鍒嗙被">
+ <PageLayout class="task-page-wrapper" title="鍏ㄩ儴鍒嗙被" has-border>
<InnerPage />
- </PageLayoutWithBg>
+ </PageLayout>
</template>
<script setup lang="ts">
diff --git a/apps/housekeepingMiniApp/src/subpackages/sercice/serciceDetail/serciceDetail.vue b/apps/housekeepingMiniApp/src/subpackages/sercice/serciceDetail/serciceDetail.vue
index 744f2c1..13fc4df 100644
--- a/apps/housekeepingMiniApp/src/subpackages/sercice/serciceDetail/serciceDetail.vue
+++ b/apps/housekeepingMiniApp/src/subpackages/sercice/serciceDetail/serciceDetail.vue
@@ -1,7 +1,73 @@
<template>
- <PageLayoutWithBg class="mineHire-page-wrapper" :title="'鏈嶅姟鍚�'" :need-auth="false">
+ <PageLayout class="serciceDetail-page-wrapper" :title="detail?.name ?? ''" :need-auth="false">
<LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch">
- <ContentScrollView style="background-color: transparent"> serciceDetail </ContentScrollView>
+ <InfiniteLoading
+ commonMode
+ :refetch="refetch"
+ :isLoading="isLoading"
+ :isError="isError"
+ :showMoreText="false"
+ scrollViewClassName="common-infinite-scroll-list-no-padding"
+ >
+ <div class="serciceDetail-top-view">
+ <nut-swiper
+ :auto-play="3000"
+ v-if="detail?.files?.length > 0"
+ class="serciceDetail-swiper"
+ >
+ <nut-swiper-item
+ v-for="(item, index) in detail.files"
+ :key="item"
+ class="serciceDetail-swiper-item"
+ >
+ <img
+ :src="setOSSLink(item)"
+ class="serciceDetail-swiper-item-img"
+ draggable="false"
+ />
+ </nut-swiper-item>
+ </nut-swiper>
+
+ <div class="serciceDetail-top-view-title-wrapper">
+ <div class="serciceDetail-price-wrapper">
+ <div class="serciceDetail-price">{{ toThousand(minPrice) }}</div>
+ <div class="serciceDetail-price-unit">鍏冭捣</div>
+ </div>
+ <div class="serciceDetail-top-view-title">{{ detail?.name ?? '' }}</div>
+ </div>
+ </div>
+
+ <List class="serciceDetail-content-list">
+ <ListItem title="瑙勬牸" @click="openSkuDialog()">
+ <template #extra>
+ <div>鍏眥{ detail.specs?.length }}绫�</div>
+ </template>
+ </ListItem>
+ </List>
+ <ProTabs
+ v-model="tab"
+ name="serciceDetail-content-tab"
+ class="serciceDetail-content-tabs"
+ flexTitle
+ >
+ <ProTabPane :title="`鏈嶅姟璇︽儏`" pane-key="1">
+ <RichEditorContent :content="detail?.description ?? ''"></RichEditorContent>
+ </ProTabPane>
+ <ProTabPane :title="`瀹㈡埛璇勪环`" pane-key="2">
+ <NoData />
+ </ProTabPane>
+ <ProTabPane :title="`鐩稿叧鎺ㄨ崘`" pane-key="3">
+ <NoData />
+ </ProTabPane>
+ </ProTabs>
+ </InfiniteLoading>
+ <Sku
+ v-model:visible="skuState.visible"
+ :sku="skuState.sku"
+ v-model:goods="skuState.goods"
+ @clickBtnOperate="clickBtnOperate"
+ >
+ </Sku>
<PageFooter>
<PageFooterAction
:icon="detail.isCollection ? IconAttentionActive : IconAttention"
@@ -11,30 +77,32 @@
></PageFooterAction>
<PageFooterAction
:icon="IconShare"
- text="鍒嗕韩"
+ text="瀹㈡湇"
:isFlex="false"
:open-type="'contact'"
></PageFooterAction>
<PageFooterBtn type="primary" @click="openSkuDialog()">棰勭害涓嬪崟</PageFooterBtn>
- <PageFooterBtn type="primary" @click="pay">棰勭害涓嬪崟</PageFooterBtn>
</PageFooter>
- <Sku
- v-model:visible="skuState.visible"
- :sku="skuState.sku"
- v-model:goods="skuState.goods"
- @clickBtnOperate="clickBtnOperate"
- >
- </Sku>
</LoadingLayout>
- </PageLayoutWithBg>
+ </PageLayout>
</template>
<script setup lang="ts">
import { useStandardServiceDetail } from '@12333/hooks';
import Taro from '@tarojs/taro';
import * as standardOrderServices from '@12333/services/apiV2/standardOrder';
-import { toThousand, setOSSLink } from '@12333/utils';
-import { Sku, Goods, SkuItem, SkuUtils } from '@12333/components';
+import * as standardServiceServices from '@12333/services/apiV2/standardService';
+import { toThousand, setOSSLink, Message } from '@12333/utils';
+import {
+ Sku,
+ Goods,
+ SkuItem,
+ SkuUtils,
+ List,
+ ListItem,
+ ProTabs,
+ ProTabPane,
+} from '@12333/components';
import { useAccessLogin } from '@/hooks';
import IconShare from '@/assets/flexJob/icon-share.png';
import IconAttention from '@/assets/flexJob/icon-attention-lg.png';
@@ -47,7 +115,9 @@
const router = Taro.useRouter();
const id = router.params?.id ?? '';
-const { isLoading, isError, detail, refetch } = useStandardServiceDetail({
+const tab = ref('1');
+
+const { isLoading, isError, detail, refetch, minPrice } = useStandardServiceDetail({
id,
onSuccess(res) {
skuState.sku = [
@@ -57,6 +127,7 @@
list: res.specs.map((item, index) => ({
id: item.id,
name: item.name,
+ price: item.price,
active: index === 0,
disable: false,
})),
@@ -79,18 +150,19 @@
// 搴曢儴鎿嶄綔鎸夐挳瑙﹀彂
const clickBtnOperate = (op: { type: string; value: number }) => {
- addStandardOrder(op.value);
+ // addStandardOrder(op.value);
+ Message.warning('鏀粯绯荤粺缁存姢涓紝璇风◢鍚庨绾�');
};
-const openSkuDialog = useAccessLogin(() => {
+const openSkuDialog = () => {
skuState.visible = true;
-});
+};
-function goAddStandardOrder(specNumber: number) {
+const goAddStandardOrder = useAccessLogin((specNumber: number) => {
Taro.navigateTo({
url: `${RouterPath.addStandardOrder}?specNumber=${specNumber}`,
});
-}
+});
async function addStandardOrder(specNumber: number) {
try {
@@ -145,9 +217,72 @@
} catch (error) {}
}
-function handleAttention() {}
+async function handleAttention() {
+ try {
+ let params: API.CollectionStandardServiceCommand = {
+ ids: [id],
+ isCollect: !detail.value.isCollection,
+ };
+ let res = await standardServiceServices.collectionStandardService(params);
+ if (res) {
+ refetch({ type: 'inactive' });
+ }
+ } catch (error) {}
+}
</script>
<style lang="scss">
@import '@/styles/common.scss';
+
+.serciceDetail-page-wrapper {
+ .serciceDetail-swiper {
+ height: 640px;
+
+ .serciceDetail-swiper-item-img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ }
+ }
+
+ .serciceDetail-top-view {
+ margin-bottom: 20px;
+ background-color: #fff;
+
+ .serciceDetail-top-view-title-wrapper {
+ padding: 24px boleGetCssVar('size', 'body-padding-h') 32px;
+
+ .serciceDetail-price-wrapper {
+ display: flex;
+ align-items: flex-end;
+ margin-bottom: 24px;
+
+ .serciceDetail-price {
+ font-weight: 600;
+ font-size: 48px;
+ color: #ff6414;
+ line-height: 52px;
+ }
+
+ .serciceDetail-price-unit {
+ font-weight: 400;
+ font-size: 28px;
+ color: #ff6414;
+ line-height: 40px;
+ }
+ }
+
+ .serciceDetail-top-view-title {
+ font-weight: 500;
+ font-size: 32px;
+ color: boleGetCssVar('text-color', 'primary');
+ line-height: 44px;
+ }
+ }
+ }
+
+ .serciceDetail-content-list {
+ margin-bottom: 20px;
+ }
+}
</style>
diff --git a/package.json b/package.json
index d9d425d..c1cdcd1 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,8 @@
"CClient:staging:build": "pnpm run -C apps/cMiniApp build:weapp:staging:upload",
"UnderTakeClient:build": "pnpm run -C apps/underTakeMiniApp build:weapp:upload",
"UnderTakeClient:staging:build": "pnpm run -C apps/underTakeMiniApp build:weapp:staging:upload",
+ "Housekeeping:build": "pnpm run -C apps/housekeepingMiniApp build:weapp:upload",
+ "Housekeeping:staging:build": "pnpm run -C apps/housekeepingMiniApp build:weapp:staging:upload",
"build:all": "pnpm run -r --parallel build:weapp:upload"
},
"browserslist": [
diff --git a/packages/components/src/Sku/sku.ts b/packages/components/src/Sku/sku.ts
index 7e66361..23d2e2d 100644
--- a/packages/components/src/Sku/sku.ts
+++ b/packages/components/src/Sku/sku.ts
@@ -6,6 +6,7 @@
disable: boolean;
id: string;
name: string;
+ price: number;
}[];
};
diff --git a/packages/hooks/standardOrder.ts b/packages/hooks/standardOrder.ts
index 585b716..6c7f9d2 100644
--- a/packages/hooks/standardOrder.ts
+++ b/packages/hooks/standardOrder.ts
@@ -1,6 +1,6 @@
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import * as standardServiceServices from '@12333/services/apiV2/standardService';
-import { MaybeRef, unref } from 'vue';
+import { computed, MaybeRef, unref } from 'vue';
type UseStandardServiceDetailOptions = {
id: MaybeRef<string>;
@@ -25,10 +25,19 @@
},
});
+ const minPrice = computed(() => {
+ if (!data.value?.specs?.length) {
+ return 0;
+ } else {
+ return Math.min(...data.value.specs.map((x) => x.price));
+ }
+ });
+
return {
detail: data,
refetch,
isLoading,
isError,
+ minPrice,
};
}
--
Gitblit v1.10.0