| | |
| | | <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"> |