From f4d3a468d151ce6ff4ef6b2158c2b13ebae18d43 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 19 三月 2025 18:05:13 +0800 Subject: [PATCH] fix: 三期需求 --- packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue | 14 - apps/taro/src/subpackages/order/order/InnerPage.vue | 4 packages/components/src/components/RechargeTipsView/RechargeTipsView.vue | 20 + packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue | 12 - packages/components/src/components/Image/PreviewImage.vue | 57 ++++++ packages/core/modern.config.ts | 5 packages/components/vite.config.ts | 3 packages/components/src/utils/index.ts | 1 packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue | 12 - packages/services/api/typings.d.ts | 50 +++++ packages/components/src/styles/components.scss | 45 +++++ packages/components/src/components/Image/previewImage.ts | 18 ++ packages/components/src/utils/env.ts | 28 +++ packages/core/src/lifeRechargeConstants.ts | 23 ++ packages/components/src/components/RichEditCard/RichContent.vue | 48 +++++ packages/components/src/components/Image/AutoWidthImage.vue | 73 ++++++++ packages/core/src/lifeRechargeServices.ts | 30 +++ packages/components/src/hooks/index.ts | 29 +++ packages/services/api/LifePay.ts | 58 ++++++ 19 files changed, 489 insertions(+), 41 deletions(-) diff --git a/apps/taro/src/subpackages/order/order/InnerPage.vue b/apps/taro/src/subpackages/order/order/InnerPage.vue index 62835f4..fbe3cba 100644 --- a/apps/taro/src/subpackages/order/order/InnerPage.vue +++ b/apps/taro/src/subpackages/order/order/InnerPage.vue @@ -6,9 +6,9 @@ <ProTabPane title="鐢佃垂璁㈠崟" pane-key="2"> <ElectricOrder @goApplyRefund="goApplyRefund" @goRefundDetail="goRefundDetail" /> </ProTabPane> - <ProTabPane title="鐕冩皵璁㈠崟" pane-key="3"> + <!-- <ProTabPane title="鐕冩皵璁㈠崟" pane-key="3"> <GasOrder @goApplyRefund="goApplyRefund" @goRefundDetail="goRefundDetail" /> - </ProTabPane> + </ProTabPane> --> </ProTabs> </template> diff --git a/packages/components/src/components/Image/AutoWidthImage.vue b/packages/components/src/components/Image/AutoWidthImage.vue new file mode 100644 index 0000000..7c641ca --- /dev/null +++ b/packages/components/src/components/Image/AutoWidthImage.vue @@ -0,0 +1,73 @@ +<template> + <PreviewImage :mode="openScale ? 'scaleToFill' : 'widthFix'" :style="_style" v-bind="props" /> +</template> + +<script setup lang="ts"> +import PreviewImage from './PreviewImage.vue'; +import { previewImageProps } from './previewImage'; +import Taro from '@tarojs/taro'; +import { CSSProperties, computed, reactive, watch } from 'vue'; + +defineOptions({ + name: 'AutoWidthImage', +}); + +const props = defineProps({ + ...previewImageProps, + openScale: { + type: Boolean, + }, +}); + +const MaxHeight = 375; +const MaxWidth = 375; + +const state = reactive({ + width: 0, + height: 0, +}); + +watch( + () => props.src, + () => { + if (props.src) { + Taro.getImageInfo({ + src: props.src, + success(result) { + state.width = result.width; + state.height = result.height; + }, + }); + } + }, + { + immediate: true, + } +); + +const _style = computed(() => { + if (state.width > state.height) { + if (props.openScale) { + const width = Math.min(MaxWidth, state.width); + const scale = width / state.width; + + return { + height: `${state.height * scale}px`, + width: `${width}px`, + } as CSSProperties; + } else { + return { + width: `${state.width}px`, + maxWidth: '100%', + }; + } + } else { + const height = Math.min(MaxHeight, state.height); + const scale = height / state.height; + return { + height: `${height}px`, + width: `${state.width * scale}px`, + } as CSSProperties; + } +}); +</script> diff --git a/packages/components/src/components/Image/PreviewImage.vue b/packages/components/src/components/Image/PreviewImage.vue new file mode 100644 index 0000000..7aa750f --- /dev/null +++ b/packages/components/src/components/Image/PreviewImage.vue @@ -0,0 +1,57 @@ +<template> + <div :class="['preview-image-wrapper', wrapperClassName]"> + <Image @tap="handeClick" :mode="mode" :src="src" v-bind="$attrs" /> + </div> +</template> + +<script setup lang="ts"> +import { Image, ITouchEvent } from '@tarojs/components'; +import Taro from '@tarojs/taro'; +import { previewImageProps } from './previewImage'; +import { reactive, computed, watch } from 'vue'; + +defineOptions({ + name: 'PreviewImage', + inheritAttrs: false, +}); + +const props = defineProps(previewImageProps); + +const state = reactive({ + width: 0, + height: 0, + isLoaded: false, +}); + +const mode = computed(() => (state.width > state.height ? 'heightFix' : 'widthFix')); + +watch( + () => props.src, + () => { + if (props.src) { + Taro.getImageInfo({ + src: props.src, + success(result) { + state.width = result.width; + state.height = result.height; + state.isLoaded = true; + }, + }); + } + }, + { + immediate: true, + } +); + +function handeClick(event: ITouchEvent) { + if (props.onClick) { + props.onClick(event); + } else { + Taro.previewImage({ + current: props.src, + urls: props.urls.length > 0 ? props.urls : [props.src], + }); + } +} +</script> diff --git a/packages/components/src/components/Image/previewImage.ts b/packages/components/src/components/Image/previewImage.ts new file mode 100644 index 0000000..c3a3f83 --- /dev/null +++ b/packages/components/src/components/Image/previewImage.ts @@ -0,0 +1,18 @@ +import { PropType } from 'vue'; +import { ITouchEvent } from '@tarojs/components'; + +export const previewImageProps = { + urls: { + type: Array as PropType<string[]>, + default: () => [], + }, + wrapperClassName: { + type: String, + }, + src: { + type: String, + }, + onClick: { + type: Function as PropType<(event: ITouchEvent) => void>, + }, +}; diff --git a/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue b/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue index 294e782..09d4ce7 100644 --- a/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue +++ b/packages/components/src/components/RechargeTipsView/RechargeTipsView.vue @@ -7,23 +7,35 @@ *鍚屼竴鍙风爜鍏呭�兼湡闂淬�愬垏鍕垮骞冲彴閲嶅鍏呭�笺�戯紒锛侊紒鍦ㄤ笅鍗曞墠锛岃鍔″繀浠旂粏闃呰鍏憡鍐呭锛侊紒锛佽嫢鎺ュ埌闄岀敓鏉ョ數锛岃鍕胯交淇★紒锛侊紒 </slot> </div> - <div class="recharge-tips-list"> + <!-- <div class="recharge-tips-list"> <div class="recharge-tips-item" v-for="(item, index) in props.tips" :key="index"> {{ index + 1 }}.{{ item }} </div> - </div> + </div> --> + <RichContent :content="introInfo" size="small" /> </div> </div> </template> <script setup lang="ts"> +import RichContent from '../RichEditCard/RichContent.vue'; +import { useIntroInfo } from '../../hooks'; +import { LifeRechargeConstants } from '@life-payment/core-vue'; + defineOptions({ name: 'RechargeTipsView', }); type Props = { - tips: string[]; + tips?: string[]; + lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum; }; -const props = withDefaults(defineProps<Props>(), {}); +const props = withDefaults(defineProps<Props>(), { + tips: () => [], +}); + +const { introInfo } = useIntroInfo({ + lifePayOrderType: props.lifePayOrderType, +}); </script> diff --git a/packages/components/src/components/RichEditCard/RichContent.vue b/packages/components/src/components/RichEditCard/RichContent.vue new file mode 100644 index 0000000..c30bb49 --- /dev/null +++ b/packages/components/src/components/RichEditCard/RichContent.vue @@ -0,0 +1,48 @@ +<template> + <div :class="['rich-edit-content', size]"> + <template v-for="(item, index) in content" :key="index"> + <!-- <AutoWidthImage + v-if="item.type === LifeRechargeConstants.EditorType.Image" + wrapperClassName="rich-content-item rich-content-image-item" + :src="setOSSLink(item.path)" + /> --> + <PreviewImage + v-if="item.type === LifeRechargeConstants.EditorType.Image" + wrapperClassName="rich-content-item rich-content-image-item" + :src="setOSSLink(item.path)" + style="max-width: 100%" + mode="widthFix" + /> + <Video + v-else-if="item.type === LifeRechargeConstants.EditorType.Video" + class="rich-content-item rich-content-video-item" + :src="setOSSLink(item.path)" + ></Video> + <div v-else class="rich-content-item rich-content-text-item"> + {{ item.content }} + </div> + </template> + </div> +</template> + +<script setup lang="ts"> +import AutoWidthImage from '../Image/AutoWidthImage.vue'; +import { Video } from '@tarojs/components'; +import { LifeRechargeConstants, LifePayIntroInfoOutput } from '@life-payment/core-vue'; +import { setOSSLink } from '../../utils'; +import PreviewImage from '../Image/PreviewImage.vue'; + +defineOptions({ + name: 'RichContent', +}); + +type Props = { + content?: LifePayIntroInfoOutput[]; + size?: 'small' | 'default' | 'large'; +}; + +const props = withDefaults(defineProps<Props>(), { + content: () => [], + size: 'default', +}); +</script> diff --git a/packages/components/src/hooks/index.ts b/packages/components/src/hooks/index.ts index ec903cc..805b447 100644 --- a/packages/components/src/hooks/index.ts +++ b/packages/components/src/hooks/index.ts @@ -276,3 +276,32 @@ gasParValueList, }; } + +type UseIntroInfoOptions = { + lifePayOrderType: MaybeRef<LifeRechargeConstants.LifePayOrderTypeEnum>; + onSuccess?: (data: API.LifePayIntroInfoOutput[]) => any; +}; + +export function useIntroInfo({ lifePayOrderType, onSuccess }: UseIntroInfoOptions) { + const { blLifeRecharge } = useLifeRechargeContext(); + + const { data: introInfo } = useQuery({ + queryKey: ['blLifeRecharge/getIntroInfo', lifePayOrderType], + queryFn: async () => { + return await blLifeRecharge.services.getIntroInfo( + { + type: unref(lifePayOrderType), + }, + { + showLoading: false, + } + ); + }, + placeholderData: () => [] as API.LifePayIntroInfoOutput[], + onSuccess: (data) => { + onSuccess?.(data); + }, + }); + + return { introInfo }; +} diff --git a/packages/components/src/styles/components.scss b/packages/components/src/styles/components.scss index 30e1569..0a06f6d 100644 --- a/packages/components/src/styles/components.scss +++ b/packages/components/src/styles/components.scss @@ -245,3 +245,48 @@ } } } + +.preview-image-wrapper { + width: 100%; + height: 100%; + overflow: hidden; +} + +.auto-width-image-wrapper { + width: auto !important; + height: auto !important; +} + +.rich-edit-content { + .rich-content-item { + margin-bottom: 10px; + + &:last-child { + margin-bottom: 0; + } + } + + .rich-content-image-item { + display: block; + } + + .rich-content-text-item { + word-break: break-all; + white-space: pre-line; + font-size: 30px; + line-height: 50px; + color: boleGetCssVar('text-color', 'primary'); + } + + .rich-content-video-item { + width: 100%; + height: 300px; + } + + &.small { + .rich-content-text-item { + font-size: 24px; + line-height: 36px; + } + } +} diff --git a/packages/components/src/utils/env.ts b/packages/components/src/utils/env.ts new file mode 100644 index 0000000..7b51f4e --- /dev/null +++ b/packages/components/src/utils/env.ts @@ -0,0 +1,28 @@ +type NODE_ENV = 'development' | 'production'; + +export const env = process.env.NODE_ENV as NODE_ENV; + +export const OSSBaseURL = + env === 'development' + ? 'https://waterdroptest2.oss-cn-hangzhou.aliyuncs.com/' + : 'https://parkmanagement.oss-cn-hangzhou.aliyuncs.com/'; + +export const combineURLs = (baseURL: string, relativeURL: string) => { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + +export const isAbsoluteURL = (url: string) => { + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +}; + +export function setOSSLink(url: string) { + if (!url) { + return ''; + } + if (!isAbsoluteURL(url)) { + return combineURLs(OSSBaseURL, url); + } + return url; +} diff --git a/packages/components/src/utils/index.ts b/packages/components/src/utils/index.ts index 17e3987..d543f8a 100644 --- a/packages/components/src/utils/index.ts +++ b/packages/components/src/utils/index.ts @@ -1,3 +1,4 @@ export * from './validator'; export * from './common'; export * from './recharge'; +export * from './env'; diff --git a/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue index 8fc4f5d..b4ec7a2 100644 --- a/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue +++ b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue @@ -68,7 +68,7 @@ <div class="recharge-button-text">绔嬪嵆鍏呭��</div> </div> </nut-button> - <RechargeTipsView :tips="tips"> + <RechargeTipsView :lifePayOrderType="LifeRechargeConstants.LifePayOrderTypeEnum.鐕冩皵璁㈠崟"> <template #tips-top> 鍚屼竴鐢佃垂璐︽埛鍦ㄥ厖鍊兼湡闂村垏鍕垮湪澶氬钩鍙伴噸澶嶅厖鍊硷紝涓嬪崟鍓嶈浠旂粏闃呰涓嬫柟椤荤煡鍐呭銆傝嫢鎺ュ埌闄岀敓鏉ョ數锛屽垏鍕胯交淇★紒锛侊紒 </template> @@ -116,7 +116,6 @@ import { useGetRate, useGetGasParValue, useSetUserAccountBySelect } from '../../hooks'; import { useGasBillRechargeContext, GasUserAccountExtraProperties } from './context'; import { FormValidator, initLifePayType } from '../../utils'; -import { CustomerServiceTips } from '../../constants'; import AccountAddCard from '../../components/Card/AccountAddCard.vue'; import AccountCard from '../../components/Card/AccountCard.vue'; import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; @@ -213,17 +212,6 @@ } }); } - -const tips = [ - '骞冲彴鎻愪緵鎱㈠厖鏈嶅姟锛岃鍗曟彁浜ゅ悗锛岀噧姘斿皢浜�0 - 72 灏忔椂鍐呭埌璐︼紝鑻ユ湭鑳芥寜鏃跺埌璐︼紝绯荤粺灏嗚嚜鍔ㄥ彂璧烽��娆俱��', - '鐩墠骞冲彴浠呮敮鎸佷腑鍥界噧姘斿拰鍖椾含鐕冩皵鍏呭�兼湇鍔°��', - '涓浗鐕冩皵鍏呭�兼埛鍙峰繀椤诲湪鈥滃9鍝佹収鈥滱PP鐕冩皵缂磋垂鐣岄潰鏌ヨ鍒拌处鎴蜂俊鎭紝鎴峰彿涓�11寮�澶存垨鑰�5寮�澶寸殑10浣嶆暟瀛椼��', - '鍖椾含鐕冩皵涓嶆敮鎸佹瑺璐瑰厖鍊硷紝浠呮敮鎸佹櫤鑳借〃鐨勬埛鍙凤紝鎴峰彿鏄�9寮�澶�11浣嶇殑璐︽埛杩涜鍏呭�笺��', - '鍏呭�兼湡闂达紝鑻ュ悓涓�璐︽埛鐨勫厖鍊兼鏈埌璐︼紝璇峰嬁鍦ㄥ叾浠栧钩鍙伴噸澶嶅厖鍊硷紝鍥犱笂杩版搷浣滃鑷寸殑璧勯噾鎹熷け锛岀敱鐢ㄦ埛鑷鎵挎媴銆�', - '濡傛帴鍒伴檶鐢熸潵鐢碉紝瀵规柟浠ョ即璐规垨璇搷浣滅瓑鐞嗙敱瑕佹眰澶勭悊娆鹃」锛屽姟蹇呯珛鍗虫媺榛戯紝璋ㄩ槻璇堥獥銆�', - '涓嬪崟鏃讹紝璇锋偍鍔″繀鍑嗙‘濉啓瀹屾暣鐨勭渷甯傚強鎴峰彿淇℃伅銆傚厖鍊煎畬鎴愬悗锛屽彂绁ㄧ敱杩愯惀鍟嗘彁渚涳紝鎮ㄥ彲鐧诲綍缃戜笂钀ヤ笟鍘呬笅杞藉搴旂殑鐢靛瓙鍙戠エ銆�', - CustomerServiceTips, -]; const confirmDialogVisible = ref(false); diff --git a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue b/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue index c79c7f8..4912744 100644 --- a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue +++ b/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue @@ -72,7 +72,7 @@ <div class="recharge-button-text">绔嬪嵆鍏呭��</div> </div> </nut-button> - <RechargeTipsView :tips="tips" /> + <RechargeTipsView :lifePayOrderType="LifeRechargeConstants.LifePayOrderTypeEnum.璇濊垂璁㈠崟" /> </div> <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay"> <template #info> @@ -109,7 +109,6 @@ import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; import { useGetRate, useGetPhoneParValue, useSetUserAccountBySelect } from '../../hooks'; -import { CustomerServiceTips } from '../../constants'; import AccountAddCard from '../../components/Card/AccountAddCard.vue'; import AccountCard from '../../components/Card/AccountCard.vue'; import { usePhoneBillRechargeContext, PhoneUserAccountExtraProperties } from './context'; @@ -204,15 +203,6 @@ } }); } - -const tips = [ - '骞冲彴鎻愪緵鎱㈠厖鏈嶅姟锛岃鍗曟彁浜ゅ悗锛岃瘽璐瑰皢浜�0 - 24灏忔椂鍐呭埌璐︺�傝嫢鏈兘鎸夋椂鍒拌处锛岀郴缁熷皢鑷姩鍙戣捣閫�娆俱��', - '鍏呭�兼湡闂达紝鑻ュ悓涓�鍙风爜娆鹃」鏈埌璐︼紝璇峰嬁鍦ㄥ叾浠栧钩鍙伴噸澶嶅厖鍊硷紱涓诲壇鍗′笉鍙悓鏃跺厖鍊笺�傚洜涓婅堪鎿嶄綔瀵艰嚧鐨勮祫閲戞崯澶憋紝鐢辩敤鎴疯嚜琛屾壙鎷呫��', - '鏈钩鍙拌瘽璐瑰厖鍊兼湇鍔′笉閫傜敤浜庡凡鍋滄満鍙风爜銆傜數淇″彿鐮佽嫢鏈夋瑺璐癸紝涔熸棤娉曞畬鎴愬厖鍊笺�傜數淇″凡瀹屾垚缁存姢鐨勫尯鍩熷寘鎷細骞夸笢銆佹睙鑻忋�佹箹鍖椼�佸洓宸濄�佹睙瑗裤�佹渤鍖椼�佹渤鍗椼�佺寤恒�佽窘瀹併�傚叾瀹冨尯鍩熸鍦ㄥ垎鎵规杩涜缁存姢涓紝鍦ㄦ鏈熼棿鍙兘浼氬嚭鐜板厖鍊间笉鎴愬姛骞惰嚜鍔ㄩ��娆剧殑鎯呭喌锛岃鎮ㄨ皡瑙c��', - '濡傛帴鍒伴檶鐢熸潵鐢碉紝瀵规柟浠ョ即璐规垨璇搷浣滅瓑鐞嗙敱瑕佹眰澶勭悊娆鹃」锛屽姟蹇呯珛鍗虫媺榛戯紝璋ㄩ槻璇堥獥銆�', - '鍏呭�煎彂绁ㄧ敱杩愯惀鍟嗘彁渚涳紝鎮ㄥ彲鐧诲綍缃戜笂钀ヤ笟鍘呬笅杞界數瀛愬彂绁ㄣ��', - CustomerServiceTips, -]; const confirmDialogVisible = ref(false); diff --git a/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue index 5984a9f..6a1a910 100644 --- a/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue +++ b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue @@ -74,7 +74,7 @@ <div class="recharge-button-text">绔嬪嵆鍏呭��</div> </div> </nut-button> - <RechargeTipsView :tips="tips" /> + <RechargeTipsView :lifePayOrderType="LifeRechargeConstants.LifePayOrderTypeEnum.鐢佃垂璁㈠崟" /> </div> <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay"> <template #tips> @@ -120,7 +120,6 @@ import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; import { useGetRate, useGetElectricParValue, useSetUserAccountBySelect } from '../../hooks'; import { FormValidator, initLifePayType } from '../../utils'; -import { CustomerServiceTips } from '../../constants'; import AccountAddCard from '../../components/Card/AccountAddCard.vue'; import AccountCard from '../../components/Card/AccountCard.vue'; import { useElectricBillRechargeContext, ElectricUserAccountExtraProperties } from './context'; @@ -221,15 +220,6 @@ } }); } - -const tips = [ - '骞冲彴鎻愪緵鎱㈠厖鏈嶅姟锛岃鍗曟彁浜ゅ悗锛岀數璐瑰皢浜�0 - 72 灏忔椂鍐呭埌璐︼紝鑻ユ湭鑳芥寜鏃跺埌璐︼紝绯荤粺灏嗚嚜鍔ㄥ彂璧烽��娆俱��', - '鍏呭�兼湡闂达紝鑻ュ悓涓�璐︽埛鐨勫厖鍊兼鏈埌璐︼紝璇峰嬁鍦ㄥ叾浠栧钩鍙伴噸澶嶅厖鍊硷紝鍥犱笂杩版搷浣滃鑷寸殑璧勯噾鎹熷け锛岀敱鐢ㄦ埛鑷鎵挎媴銆�', - '涓虹‘淇濆厖鍊奸『鍒╄繘琛岋紝鐩墠骞冲彴涓嶆敮鎸佸娆犳閲戦瓒呰繃1000鍏冪殑璐︽埛杩涜鍏呭�硷紝涓旀瘡娆″厖鍊奸噾棰濆繀椤婚珮浜庢瑺璐规�婚銆�', - '濡傛帴鍒伴檶鐢熸潵鐢碉紝瀵规柟浠ョ即璐规垨璇搷浣滅瓑鐞嗙敱瑕佹眰澶勭悊娆鹃」锛屽姟蹇呯珛鍗虫媺榛戯紝璋ㄩ槻璇堥獥銆�', - '涓嬪崟鏃讹紝璇锋偍鍔″繀鍑嗙‘濉啓瀹屾暣鐨勭渷甯傚強鎴峰彿淇℃伅銆傚厖鍊煎畬鎴愬悗锛屽彂绁ㄧ敱杩愯惀鍟嗘彁渚涳紝鎮ㄥ彲鐧诲綍缃戜笂钀ヤ笟鍘呬笅杞藉搴旂殑鐢靛瓙鍙戠エ銆�', - CustomerServiceTips, -]; const confirmDialogVisible = ref(false); diff --git a/packages/components/vite.config.ts b/packages/components/vite.config.ts index 4a28a3b..5d5ee98 100644 --- a/packages/components/vite.config.ts +++ b/packages/components/vite.config.ts @@ -20,6 +20,9 @@ external: Object.keys(pkg.peerDependencies), }, }, + define: { + 'process.env.NODE_ENV': JSON.stringify('production'), + }, plugins: [ vue(), // jsx銆乼sx璇硶鏀寔 diff --git a/packages/core/modern.config.ts b/packages/core/modern.config.ts index e2d1d36..4ba8278 100644 --- a/packages/core/modern.config.ts +++ b/packages/core/modern.config.ts @@ -3,4 +3,9 @@ export default defineConfig({ plugins: [moduleTools()], buildPreset: 'npm-library', + // buildConfig: { + // define: { + // 'process.env.NODE_ENV': process.env.NODE_ENV || 'production', + // }, + // }, }); diff --git a/packages/core/src/lifeRechargeConstants.ts b/packages/core/src/lifeRechargeConstants.ts index 449487e..610436a 100644 --- a/packages/core/src/lifeRechargeConstants.ts +++ b/packages/core/src/lifeRechargeConstants.ts @@ -135,4 +135,27 @@ [GasOrgCodeEnum.涓噧鐕冩皵]: '涓噧鐕冩皵', [GasOrgCodeEnum.鍖椾含鐕冩皵]: '鍖椾含鐕冩皵', }; + + export enum EditorType { + /** + * 鏂囨湰 + */ + Text, + /** + * 鍥剧墖 + */ + Image, + /** + * 瑙嗛 + */ + Video, + /** + * 瀵屾枃鏈� + */ + Rich, + /** + * 寰俊鐨勫唴瀹� + */ + WXContent, + } } diff --git a/packages/core/src/lifeRechargeServices.ts b/packages/core/src/lifeRechargeServices.ts index c7ed9f6..90b6604 100644 --- a/packages/core/src/lifeRechargeServices.ts +++ b/packages/core/src/lifeRechargeServices.ts @@ -315,6 +315,17 @@ ...(options || {}), }); } + + /** 鑾峰彇椤荤煡 GET /api/LifePay/GetIntroInfo */ + async getIntroInfo(params: APIgetIntroInfoParams, options?: RequestConfig) { + return this.request<LifePayIntroInfoOutput[]>('/api/LifePay/GetIntroInfo', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); + } } export interface PhoneMesssageCodeLoginInput { @@ -725,3 +736,22 @@ checkChannelId?: string; orderNo?: string; } + +export interface APIgetIntroInfoParams { + type?: LifeRechargeConstants.LifePayOrderTypeEnum; +} + +export interface LifePayIntroInfoOutput { + type?: IntroInfoTypeEnum; + lifePayType?: LifeRechargeConstants.LifePayOrderTypeEnum; + /** 鎽樿 */ + contentSummary?: string; + /** 鏂囨湰鍐呭 */ + content?: string; + /** 鍥剧墖/瑙嗛璺緞 */ + path?: string; + /** 鎺掑簭 */ + sequence?: number; +} + +export type IntroInfoTypeEnum = 0 | 1 | 2 | 3 | 4; diff --git a/packages/services/api/LifePay.ts b/packages/services/api/LifePay.ts index 315aa96..684ae8d 100644 --- a/packages/services/api/LifePay.ts +++ b/packages/services/api/LifePay.ts @@ -29,6 +29,21 @@ }); } +/** 鎵嬬画璐硅垂鐜囬厤缃� POST /api/LifePay/CreateEditLifePayPremium */ +export async function createEditLifePayPremium( + body: API.LifePayPremiumInput[], + options?: API.RequestConfig +) { + return request<number>('/api/LifePay/CreateEditLifePayPremium', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + /** 鎶樻墸閰嶇疆 POST /api/LifePay/CreateEditLifePayRate */ export async function createEditLifePayRate( body: API.LifePayRateInput[], @@ -119,6 +134,18 @@ }); } +/** 椤荤煡閰嶇疆 POST /api/LifePay/EditIntroInfo */ +export async function editIntroInfo(body: API.LifePayIntroInfoInput, options?: API.RequestConfig) { + return request<number>('/api/LifePay/EditIntroInfo', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + /** 鑾峰彇鐢ㄦ埛鎴峰彿鍒嗛〉鏁版嵁 POST /api/LifePay/GetAccountPage */ export async function getAccountPage( body: API.QueryUserAccountListInput, @@ -184,6 +211,29 @@ 'Content-Type': 'application/json', }, data: body, + ...(options || {}), + }); +} + +/** 鑾峰彇椤荤煡 GET /api/LifePay/GetIntroInfo */ +export async function getIntroInfo( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄) + params: API.APIgetIntroInfoParams, + options?: API.RequestConfig +) { + return request<API.LifePayIntroInfoOutput[]>('/api/LifePay/GetIntroInfo', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 鑾峰彇鍏ㄩ儴缂磋垂娓犻亾 GET /api/LifePay/GetLifePayChannlesAllList */ +export async function getLifePayChannlesAllList(options?: API.RequestConfig) { + return request<API.CreateEditPayChannelsInput[]>('/api/LifePay/GetLifePayChannlesAllList', { + method: 'GET', ...(options || {}), }); } @@ -287,6 +337,14 @@ }); } +/** 鑾峰彇鎵嬬画璐硅垂鐜� GET /api/LifePay/GetPremium */ +export async function getPremium(options?: API.RequestConfig) { + return request<API.LifePayPremiumListOutput[]>('/api/LifePay/GetPremium', { + method: 'GET', + ...(options || {}), + }); +} + /** 鑾峰彇鎶樻墸 GET /api/LifePay/GetRate */ export async function getRate(options?: API.RequestConfig) { return request<API.LifePayRateListOutput[]>('/api/LifePay/GetRate', { diff --git a/packages/services/api/typings.d.ts b/packages/services/api/typings.d.ts index 6e05af1..757003d 100644 --- a/packages/services/api/typings.d.ts +++ b/packages/services/api/typings.d.ts @@ -168,6 +168,10 @@ moduleId?: string; } + interface APIgetIntroInfoParams { + type?: LifePayOrderTypeEnum; + } + interface APIgetLifePayChannlesDtoParams { id?: string; } @@ -469,6 +473,7 @@ channlesName?: string; channlesNum?: string; channlesRate?: number; + channlesRakeRate?: number; switchType?: LifePaySwitchTypeEnum; status?: LifePayChannelsStatsEnum; channlesType?: LifePayChannlesTypeEnum; @@ -924,6 +929,8 @@ roleNames: string[]; } + type IntroInfoTypeEnum = 0 | 1 | 2 | 3 | 4; + interface IStringValueType { name?: string; properties?: Record<string, any>; @@ -1003,6 +1010,37 @@ type LifePayChannlesTypeEnum = 10 | 20; + interface LifePayIntroInfoDetail { + type?: IntroInfoTypeEnum; + /** 鎽樿 */ + contentSummary?: string; + /** 鏂囨湰鍐呭 */ + content?: string; + /** 鍥剧墖/瑙嗛璺緞 */ + path?: string; + /** 鎺掑簭 */ + sequence?: number; + } + + interface LifePayIntroInfoInput { + lifePayType?: LifePayOrderTypeEnum; + /** 鏇存柊鍐呭 */ + data?: LifePayIntroInfoDetail[]; + } + + interface LifePayIntroInfoOutput { + type?: IntroInfoTypeEnum; + lifePayType?: LifePayOrderTypeEnum; + /** 鎽樿 */ + contentSummary?: string; + /** 鏂囨湰鍐呭 */ + content?: string; + /** 鍥剧墖/瑙嗛璺緞 */ + path?: string; + /** 鎺掑簭 */ + sequence?: number; + } + interface LifePayOrderListOutput { id?: string; userId?: string; @@ -1056,6 +1094,18 @@ phoneNumber: string; } + interface LifePayPremiumInput { + premiumType?: LifePayTypeEnum; + rate?: number; + id?: string; + } + + interface LifePayPremiumListOutput { + premiumType?: LifePayTypeEnum; + rate?: number; + id?: string; + } + interface LifePayRateInput { rateType?: LifePayRateTypeEnum; rate?: number; -- Gitblit v1.9.1