| | |
| | | }, |
| | | { |
| | | root: 'subpackages/sercice', |
| | | pages: ['serciceDetail/serciceDetail'], |
| | | pages: ['serciceDetail/serciceDetail', 'addStandardOrder/addStandardOrder'], |
| | | }, |
| | | { |
| | | root: 'subpackages/user', |
| | |
| | | mineReserveServiceConfirm = '/subpackages/mine/mineReserveServiceConfirm/mineReserveServiceConfirm', |
| | | |
| | | serciceDetail = '/subpackages/sercice/serciceDetail/serciceDetail', |
| | | addStandardOrder = '/subpackages/sercice/addStandardOrder/addStandardOrder', |
| | | |
| | | extraPage = '/subpackages/extraPage/extraPage/extraPage', |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- <LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch"> --> |
| | | <ContentScrollView hasPaddingTop> |
| | | <MineServiceDetailView /> |
| | | </ContentScrollView> |
| | | <PageFooter> |
| | | <PageFooterBtn type="primary" class="business-card-btn" @click="goCancel" |
| | | >åæ¶æå¡</PageFooterBtn |
| | | > |
| | | <PageFooterBtn type="primary" class="business-card-btn" @click="goConfirm" |
| | | >æå¡ç¡®è®¤</PageFooterBtn |
| | | > |
| | | </PageFooter> |
| | | <!-- </LoadingLayout> --> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import MineServiceDetailView from '../../components/MineServiceDetailView.vue'; |
| | | import Taro from '@tarojs/taro'; |
| | | import * as standardServiceServices from '@12333/services/apiV2/standardService'; |
| | | import { RouterPath } from '@/constants'; |
| | | |
| | | defineOptions({ |
| | | name: 'InnerPage', |
| | | }); |
| | | |
| | | const route = Taro.useRouter(); |
| | | const id = route.params?.id as string; |
| | | |
| | | function goCancel() { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.mineReserveServiceCancel}?id=${id}`, |
| | | }); |
| | | } |
| | | |
| | | function goConfirm() { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.mineReserveServiceConfirm}?id=${id}`, |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import '@/styles/common.scss'; |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | export default definePageConfig({ |
| | | disableScroll: true, |
| | | }); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <PageLayout class="addStandardOrder-page-wrapper" title="é¢çº¦ä¸å" has-border> |
| | | <InnerPage /> |
| | | </PageLayout> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import InnerPage from './InnerPage.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'addStandardOrder', |
| | | }); |
| | | </script> |
| | |
| | | export default definePageConfig({ |
| | | disableScroll: true, |
| | | }); |
| | |
| | | <LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch"> |
| | | <ContentScrollView style="background-color: transparent"> serciceDetail </ContentScrollView> |
| | | <PageFooter> |
| | | <!-- <PageFooterAction |
| | | :icon="IconShare" |
| | | text="å享" |
| | | :isFlex="false" |
| | | openType="share" |
| | | ></PageFooterAction> |
| | | <PageFooterAction |
| | | :icon="userResumeInfo.isCollected ? IconAttentionActive : IconAttention" |
| | | text="æ¶è" |
| | | :isFlex="false" |
| | | @click="handleAttention" |
| | | ></PageFooterAction> --> |
| | | <PageFooterBtn type="primary" @click="skuState.visible = true">é¢çº¦ä¸å</PageFooterBtn> |
| | | <PageFooterAction |
| | | :icon="detail.isCollection ? IconAttentionActive : IconAttention" |
| | | text="æ¶è" |
| | | :isFlex="false" |
| | | @click="handleAttention" |
| | | ></PageFooterAction> |
| | | <PageFooterAction |
| | | :icon="IconShare" |
| | | text="å享" |
| | | :isFlex="false" |
| | | :open-type="'contact'" |
| | | ></PageFooterAction> |
| | | <PageFooterBtn type="primary" @click="openSkuDialog()">é¢çº¦ä¸å</PageFooterBtn> |
| | | <PageFooterBtn type="primary" @click="pay">é¢çº¦ä¸å</PageFooterBtn> |
| | | </PageFooter> |
| | | <Sku |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import * as standardOrderServices from '@12333/services/apiV2/standardOrder'; |
| | | import { toThousand, setOSSLink } from '@12333/utils'; |
| | | import { Sku, Goods, SkuItem } from '@12333/components'; |
| | | import { Sku, Goods, SkuItem, SkuUtils } from '@12333/components'; |
| | | import { useAccessLogin } from '@/hooks'; |
| | | import IconShare from '@/assets/flexJob/icon-share.png'; |
| | | import IconAttention from '@/assets/flexJob/icon-attention-lg.png'; |
| | | import IconAttentionActive from '@/assets/flexJob/icon-attention-lg-active.png'; |
| | | |
| | | defineOptions({ |
| | | name: 'serciceDetail', |
| | |
| | | onSuccess(res) { |
| | | skuState.sku = [ |
| | | { |
| | | id: '1', |
| | | id: SkuUtils.DefaultSkuSpecId, |
| | | name: 'è§æ ¼', |
| | | list: res.specs.map((item, index) => ({ |
| | | id: item.id, |
| | |
| | | }, |
| | | ]; |
| | | skuState.goods = { |
| | | skuId: '1', |
| | | skuId: SkuUtils.DefaultSkuSpecId, |
| | | price: toThousand(res.specs[0].price), |
| | | imagePath: setOSSLink(res.files[0]), |
| | | name: res.name, |
| | |
| | | }); |
| | | |
| | | // åºé¨æä½æé®è§¦å |
| | | const clickBtnOperate = (op) => { |
| | | console.log('ç¹å»äºæä½æé®', op); |
| | | const clickBtnOperate = (op: { type: string; value: number }) => { |
| | | addStandardOrder(op.value); |
| | | }; |
| | | |
| | | async function addStandardOrder() { |
| | | const openSkuDialog = useAccessLogin(() => { |
| | | skuState.visible = true; |
| | | }); |
| | | |
| | | function goAddStandardOrder(specNumber: number) { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.addStandardOrder}?specNumber=${specNumber}`, |
| | | }); |
| | | } |
| | | |
| | | async function addStandardOrder(specNumber: number) { |
| | | try { |
| | | const spec = SkuUtils.getCurrentActiveSpec(skuState.sku); |
| | | let params: API.AddStandardOrderCommand = { |
| | | serviceId: '3fa85f64-5717-4562-b3fc-2c963f66afa6', |
| | | serviceName: 'string', |
| | | specId: '3fa85f64-5717-4562-b3fc-2c963f66afa6', |
| | | specName: 'string', |
| | | specPrice: 0, |
| | | specNumber: 0, |
| | | serviceId: detail.value.id, |
| | | serviceName: detail.value.name, |
| | | serviceCode: detail.value.code, |
| | | specId: spec.id, |
| | | specName: spec.name, |
| | | specPrice: detail.value.specs.find((x) => x.id === spec.id)?.price ?? 0, |
| | | specNumber: specNumber, |
| | | addressId: '3fa85f64-5717-4562-b3fc-2c963f66afa6', |
| | | beginTime: '2025-12-24T06:44:24.840Z', |
| | | endTime: '2025-12-24T06:44:24.840Z', |
| | | name: detail.value.name, |
| | | contactPhoneNumber: 'string', |
| | | provinceCode: 'string', |
| | | provinceContent: 'string', |
| | | cityCode: 'string', |
| | | cityContent: 'string', |
| | | areaCode: 'string', |
| | | areaContent: 'string', |
| | | addressName: 'string', |
| | | addressDetail: 'string', |
| | | longitude: 0, |
| | | latitude: 0, |
| | | beginTime: '2025-12-24T08:25:08.372Z', |
| | | endTime: '2025-12-24T08:25:08.372Z', |
| | | supplierEnterpriseId: '3fa85f64-5717-4562-b3fc-2c963f66afa6', |
| | | enterpriseEmployeeIds: ['3fa85f64-5717-4562-b3fc-2c963f66afa6'], |
| | | remark: 'string', |
| | |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function handleAttention() {} |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | |
| | | <template #sku-header-price> |
| | | <div class="pro-sku-header"> |
| | | <div class="pro-sku-header-title">{{ goods.name }}</div> |
| | | <nut-price :price="goods.price" /> |
| | | <div class="pro-sku-header-spec">{{ currentSpecName }}</div> |
| | | <nut-price :price="goods.price" size="large" /> |
| | | </div> |
| | | </template> |
| | | <template #sku-header-extra> |
| | | <div></div> |
| | | </template> |
| | | </nut-sku> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { toThousand } from '@12333/utils'; |
| | | import { Goods, SkuItem } from './sku'; |
| | | import { Goods, SkuItem, SkuUtils } from './sku'; |
| | | import { computed } from 'vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'Sku', |
| | |
| | | price: toThousand(sku.price), |
| | | }; |
| | | }; |
| | | |
| | | const currentSpecName = computed(() => { |
| | | const spec = SkuUtils.getCurrentActiveSpec(props.sku); |
| | | if (spec) { |
| | | return spec.name ?? ''; |
| | | } |
| | | return ''; |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | |
| | | .pro-sku-header { |
| | | flex: 1; |
| | | min-height: 0; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | |
| | | .pro-sku-header-title { |
| | | color: boleGetCssVar('text-color', 'primary'); |
| | | } |
| | | |
| | | .pro-sku-header-spec { |
| | | color: boleGetCssVar('text-color', 'secondary'); |
| | | font-size: 26px; |
| | | } |
| | | } |
| | | |
| | | .nut-sku-content { |
| | | width: 100%; |
| | | box-sizing: border-box; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | skuId: string; |
| | | name: string; |
| | | }; |
| | | |
| | | export class SkuUtils { |
| | | static DefaultSkuSpecId = 'spec'; |
| | | |
| | | static getCurrentSku(skuList: SkuItem[], goods: Goods) { |
| | | const sku = skuList.find((item) => item.id === goods.skuId); |
| | | return sku; |
| | | } |
| | | |
| | | static getCurrentSpecSkuItem(skuList: SkuItem[]) { |
| | | const sku = skuList.find((item) => item.id === this.DefaultSkuSpecId); |
| | | return sku; |
| | | } |
| | | |
| | | static getCurrentActiveSpec(skuList: SkuItem[]) { |
| | | const sku = this.getCurrentSpecSkuItem(skuList); |
| | | if (sku) { |
| | | return sku.list.find((item) => item.active); |
| | | } |
| | | return null; |
| | | } |
| | | } |