Commit 8617b849 by cen

fix:格式化

1 parent 5a88f7bb
{
"files.associations": {
"*.uvue": "vue",
"*.uts": "uts"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[uts]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[uvue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.documentSelectors": ["**/*.uvue", "**/*.uts", "**/*.ts"],
"prettier.requireConfig": true,
"[ets]": {
"editor.defaultFormatter": "NailyZero.vscode-naily-ets"
},
"scss.lint.unknownAtRules": "ignore",
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
}
}
...@@ -3,46 +3,46 @@ ...@@ -3,46 +3,46 @@
* 预留 portrait / desktop,当前仅使用 pad * 预留 portrait / desktop,当前仅使用 pad
*/ */
export type LayoutMode = 'portrait' | 'pad' | 'desktop' export type LayoutMode = "desktop" | "pad" | "portrait"
export type LayoutModeConfig = { export type LayoutModeConfig = {
mode: LayoutMode
name: string
baseWidth: number
baseHeight: number baseHeight: number
baseWidth: number
maxWidth: null | number
minWidth: number minWidth: number
maxWidth: number | null mode: LayoutMode
name: string
} }
const portraitConfig: LayoutModeConfig = { const portraitConfig: LayoutModeConfig = {
mode: 'portrait', mode: "portrait",
name: '竖屏布局', name: "竖屏布局",
baseWidth: 750, baseWidth: 750,
baseHeight: 1334, baseHeight: 1334,
minWidth: 0, minWidth: 0,
maxWidth: 768 maxWidth: 768
} };
const padConfig: LayoutModeConfig = { const padConfig: LayoutModeConfig = {
mode: 'pad', mode: "pad",
name: 'Pad布局', name: "Pad布局",
baseWidth: 1024, baseWidth: 1024,
baseHeight: 768, baseHeight: 768,
minWidth: 768, minWidth: 768,
maxWidth: 1440 maxWidth: 1440
} };
const desktopConfig: LayoutModeConfig = { const desktopConfig: LayoutModeConfig = {
mode: 'desktop', mode: "desktop",
name: '大屏布局', name: "大屏布局",
baseWidth: 1920, baseWidth: 1920,
baseHeight: 1080, baseHeight: 1080,
minWidth: 1440, minWidth: 1440,
maxWidth: null as number | null maxWidth: null as null | number
} };
export const LAYOUT_MODES = { export const LAYOUT_MODES = {
portrait: portraitConfig, portrait: portraitConfig,
pad: padConfig, pad: padConfig,
desktop: desktopConfig desktop: desktopConfig
} as UTSJSONObject } as UTSJSONObject;
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<layout-root> <layout-root>
<!-- #endif --> <!-- #endif -->
<view class="page-container container"> <view class="page-container container">
<home-frame <HomeFrame ref="homeRef"
ref="homeRef" :show-footer="true"
:showFooter="true" :swiper-custom="true"
:swiperCustom="true" @start="handleStart">
@start="handleStart" <template #swiperCustom>
> <view v-if="loadComplete" class="swiper-custom-wrap">
<template #swiperCustom> <view v-if="packageList.length > 0" class="swiper-custom-content">
<view v-if="loadComplete" class="swiper-custom-wrap"> <swiper class="package-swiper"
<view v-if="packageList.length > 0" class="swiper-custom-content"> :current="currentSwiperIndex"
<swiper @change="onSwiperChange">
class="package-swiper" <swiper-item v-for="(item, idx) in packageList"
:current="currentSwiperIndex" :key="idx"
@change="onSwiperChange" @tap="toDetail(idx)">
> <image v-if="getPkg(item, 'bannerImg')"
<swiper-item v-for="(item, idx) in packageList" :key="idx" @tap="toDetail(idx)"> class="swiper-bg"
<image mode="aspectFill"
v-if="getPkg(item, 'bannerImg')" :src="getPkg(item, 'bannerImg')" />
class="swiper-bg" <view class="swiper-name">
:src="getPkg(item, 'bannerImg')" {{ getPkg(item, 'name') }}
mode="aspectFill" </view>
/> <view class="swiper-content-box">
<view class="swiper-name">{{ getPkg(item, 'name') }}</view> <view class="price price-1">
<view class="swiper-content-box"> <text class="price-label">市场价</text>
<view class="price price-1"> <view class="num">
<text class="price-label">市场价</text> <text class="unit">¥</text>
<view class="num"> <text>{{ getPkg(item, 'marketPrice') }}</text>
<text class="unit">¥</text> </view>
<text>{{ getPkg(item, 'marketPrice') }}</text> </view>
<view class="price price-2">
{{ getPkg(item, 'discountPrice') }}
</view>
<view class="price price-3">
<text class="price-label">套餐价</text>
<view class="num">
<text class="unit">¥</text>
<text>{{ getPkg(item, 'packagePrice') }}</text>
</view>
</view>
<view class="briefIntroduction">
{{ getPkg(item, 'briefIntroduction') }}
</view>
</view>
<view class="swiper-btn">
查看详情
</view>
</swiper-item>
</swiper>
<view class="swiper-dots">
<view v-for="(_, i) in packageList"
:key="i"
class="dot"
:class="[{ active: i == currentSwiperIndex }]" />
</view>
</view>
<view v-else class="swiper-empty">
<text class="empty-text">{{ swiperNoDataObject.text }}</text>
</view>
</view> </view>
</view> <view v-else class="swiper-loading">
<view class="price price-2">{{ getPkg(item, 'discountPrice') }}</view> <text>加载中...</text>
<view class="price price-3">
<text class="price-label">套餐价</text>
<view class="num">
<text class="unit">¥</text>
<text>{{ getPkg(item, 'packagePrice') }}</text>
</view> </view>
</view> </template>
<view class="briefIntroduction">{{ getPkg(item, 'briefIntroduction') }}</view>
</view>
<view class="swiper-btn">查看详情</view>
</swiper-item>
</swiper>
<view class="swiper-dots">
<view
v-for="(_, i) in packageList"
:key="i"
:class="['dot', { active: i == currentSwiperIndex }]"
/>
</view>
</view>
<view v-else class="swiper-empty">
<text class="empty-text">{{ swiperNoDataObject.text }}</text>
</view>
</view>
<view v-else class="swiper-loading">
<text>加载中...</text>
</view>
</template>
<template #detail> <template #detail>
<view class="detail-content"> <view class="detail-content">
<text class="detail-title">详情页</text> <text class="detail-title">详情页</text>
</view> </view>
</template> </template>
</home-frame> </HomeFrame>
<center-popup <CenterPopup ref="customerTypeRef"
ref="customerTypeRef" :list="typeList"
:list="typeList" title="请选择当前洽谈的客户类型"
title="请选择当前洽谈的客户类型" @choose="chooseCustomerType" />
@choose="chooseCustomerType" <PackageDetailPopup ref="packageRef" @close="closePackageDetail">
/> <view class="package-detail-box">
<package-detail-popup ref="packageRef" @close="closePackageDetail"> <view class="package-box">
<view class="package-detail-box"> <view class="package-name">
<view class="package-box"> 套餐内容
<view class="package-name">套餐内容</view> </view>
<view class="package-content"> <view class="package-content">
<rich-text :nodes="chooseItem.content ?? ''"></rich-text> <rich-text :nodes="chooseItem.content ?? ''"></rich-text>
</view> </view>
</view> </view>
<view class="package-box package-detail"> <view class="package-box package-detail">
<view class="package-name">套餐介绍</view> <view class="package-name">
<view class="package-content"> 套餐介绍
<rich-text :nodes="chooseItem.scriptIntroduction ?? ''"></rich-text> </view>
</view> <view class="package-content">
<rich-text :nodes="chooseItem.scriptIntroduction ?? ''"></rich-text>
</view>
</view>
</view>
</PackageDetailPopup>
</view> </view>
</view> <!-- #ifdef APP -->
</package-detail-popup> </layout-root>
</view> <!-- #endif -->
<!-- #ifdef APP -->
</layout-root>
<!-- #endif -->
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { ref } from 'vue' import { ref } from "vue";
import { onLoad, onShow } from '@dcloudio/uni-app'
import { storage } from '@/utils/storage.uts' import { getBoutiquePackageList as apiGetBoutiquePackageList, getBoutiqueMaterialConfig } from "@/api/boutique-api.uts";
import { store, dispatch } from '@/store/index.uts' import { getEmployeeList } from "@/api/common-api.uts";
import HomeFrame from '@/components/HomeFrame/index.uvue' import { getBoutiqueMockData, getMockData } from "@/api/system-api.uts";
import CenterPopup from '@/components/CenterPopup.uvue' import CenterPopup from "@/components/CenterPopup.uvue";
import PackageDetailPopup from '@/pages/boutique/components/PackageDetailPopup.uvue' import HomeFrame from "@/components/HomeFrame/index.uvue";
import { getBoutiquePackageList as apiGetBoutiquePackageList } from '@/api/boutique-api.uts' import PackageDetailPopup from "@/pages/boutique/components/PackageDetailPopup.uvue";
import { getBoutiqueMaterialConfig } from '@/api/boutique-api.uts' import { dispatch, store } from "@/store/index.uts";
import { getMockData, getBoutiqueMockData } from '@/api/system-api.uts' import { storage } from "@/utils/storage.uts";
import { getEmployeeList } from '@/api/common-api.uts' import { onLoad, onShow } from "@dcloudio/uni-app";
const _emptyArr: any[] = [] as any[] const _emptyArr: any[] = [] as any[];
const homeRef = ref(null) const homeRef = ref(null);
const customerTypeRef = ref(null) const customerTypeRef = ref(null);
const packageRef = ref(null) const packageRef = ref(null);
const loadComplete = ref<boolean>(false) const loadComplete = ref<boolean>(false);
const requested = ref<boolean>(false) const requested = ref<boolean>(false);
const packageList = ref<any[]>([]) const packageList = ref<any[]>([]);
const moduleList = ref<any[]>([]) const moduleList = ref<any[]>([]);
const toolList = ref<any[]>([]) const toolList = ref<any[]>([]);
const chooseItem = ref<UTSJSONObject>({}) const chooseItem = ref<UTSJSONObject>({});
const id = ref<string>('') const id = ref<string>("");
const type = ref<string>('') const type = ref<string>("");
const customerType = ref<number>(-1) const customerType = ref<number>(-1);
const tabId = ref<number>(1) const tabId = ref<number>(1);
const carBannerList = ref<any[]>([]) const carBannerList = ref<any[]>([]);
const currentCarId = ref<string>('') const currentCarId = ref<string>("");
const currentSwiperIndex = ref<number>(0) const currentSwiperIndex = ref<number>(0);
const defaultCarId = ref<string>('') const defaultCarId = ref<string>("");
const swiperNoDataObject = { icon: '', text: '敬请期待' } const swiperNoDataObject = { icon: "", text: "敬请期待" };
function getPkg(item: any, key: string): any { function getPkg(item: any, key: string): any {
if (item == null) return '' if (item == null) return "";
const obj = item as UTSJSONObject const obj = item as UTSJSONObject;
const v = obj[key] const v = obj[key];
return v != null ? v : '' return v != null ? v : "";
} }
function callExposedMethod(comp: any, methodName: string): void { function callExposedMethod(comp: any, methodName: string): void {
if (comp == null) return if (comp == null) return;
const obj = comp as UTSJSONObject const obj = comp as UTSJSONObject;
const fn = obj[methodName] const fn = obj[methodName];
if (fn != null) { if (fn != null) {
const f = fn as () => void const f = fn as () => void;
f() f();
} }
} }
const typeList = [ const typeList = [
{ title: '回店客户', describe: '客户已领精品券且已上牌完成\n交付安排客户当日回店提车', icon: 'icon-customer-1' }, { title: "回店客户", describe: "客户已领精品券且已上牌完成\n交付安排客户当日回店提车", icon: "icon-customer-1" },
{ title: '现场客户', describe: '客户未领取精品券\n首次到店', icon: 'icon-customer-2' } { title: "现场客户", describe: "客户未领取精品券\n首次到店", icon: "icon-customer-2" }
] ];
function clearHistory(): void { function clearHistory(): void {
dispatch('clearCustomerInfo') dispatch("clearCustomerInfo");
dispatch('clearHistory') dispatch("clearHistory");
dispatch('clearReceptionTrack') dispatch("clearReceptionTrack");
} }
function jumpPage(pid: string): void { function jumpPage(pid: string): void {
const list = carBannerList.value const list = carBannerList.value;
let carIndex = list.findIndex((e: any) => (e as UTSJSONObject)['carModelId'] == defaultCarId.value) let carIndex = list.findIndex((e: any) => (e as UTSJSONObject).carModelId == defaultCarId.value);
if (list.length == 1 || carIndex < 0) carIndex = 0 if (list.length == 1 || carIndex < 0) carIndex = 0;
const mod0 = moduleList.value[0] as UTSJSONObject const mod0 = moduleList.value[0] as UTSJSONObject;
const mod0Id = mod0 != null ? mod0['id'] : null const mod0Id = mod0 != null ? mod0.id : null;
id.value = pid != '' ? pid : (mod0Id != null ? (mod0Id as any).toString() : '') id.value = pid != "" ? pid : (mod0Id != null ? (mod0Id as any).toString() : "");
tabId.value = 1 tabId.value = 1;
const carItem = list[carIndex] const carItem = list[carIndex];
currentCarId.value = carItem != null ? ((carItem as UTSJSONObject)['carModelId'] ?? '') as string : '' currentCarId.value = carItem != null ? ((carItem as UTSJSONObject).carModelId ?? "") as string : "";
type.value = 'edit' type.value = "edit";
if (homeRef.value != null) { if (homeRef.value != null) {
const h = homeRef.value as UTSJSONObject const h = homeRef.value as UTSJSONObject;
const showFn = h['showDetailPage'] const showFn = h.showDetailPage;
if (showFn != null && typeof showFn == 'function') { if (showFn != null && typeof showFn === "function") {
;(showFn as () => void)() ;(showFn as () => void)();
} }
} }
} }
function handleStart(): void { function handleStart(): void {
const comp = customerTypeRef.value const comp = customerTypeRef.value;
if (comp != null) { if (comp != null) {
const compObj = comp as UTSJSONObject const compObj = comp as UTSJSONObject;
const openFn = compObj['open'] const openFn = compObj.open;
if (openFn != null && typeof openFn == 'function') { if (openFn != null && typeof openFn === "function") {
;(openFn as () => void)() ;(openFn as () => void)();
} }
} }
} }
function chooseCustomerType(index: number): void { function chooseCustomerType(index: number): void {
customerType.value = index customerType.value = index;
if (index == 0) { if (index == 0) {
const ml = moduleList.value const ml = moduleList.value;
if (ml.length >= 3) { if (ml.length >= 3) {
const mid = (ml[2] as UTSJSONObject)['id'] const mid = (ml[2] as UTSJSONObject).id;
jumpPage(mid != null ? (mid as any).toString() : '') jumpPage(mid != null ? (mid as any).toString() : "");
} else { } else {
jumpPage('') jumpPage("");
} }
} else { } else {
jumpPage('') jumpPage("");
} }
} }
function toDetail(index: number): void { function toDetail(index: number): void {
const item = packageList.value[index] const item = packageList.value[index];
if (item != null) { if (item != null) {
chooseItem.value = item as UTSJSONObject chooseItem.value = item as UTSJSONObject;
packageRef.value != null && (packageRef.value as UTSJSONObject)['open'] != null packageRef.value != null && (packageRef.value as UTSJSONObject).open != null
? ((packageRef.value as UTSJSONObject)['open'] as () => void)() ? ((packageRef.value as UTSJSONObject).open as () => void)()
: null : null;
} }
} }
function closePackageDetail(): void { function closePackageDetail(): void {
chooseItem.value = {} chooseItem.value = {};
} }
function onSwiperChange(e: any): void { function onSwiperChange(e: any): void {
const detail = (e as UTSJSONObject)['detail'] as UTSJSONObject | null const detail = (e as UTSJSONObject).detail as null | UTSJSONObject;
if (detail != null) { if (detail != null) {
const cur = detail['current'] as number | null const cur = detail.current as null | number;
if (cur != null) currentSwiperIndex.value = cur if (cur != null) currentSwiperIndex.value = cur;
} }
} }
async function init(): Promise<void> { async function init(): Promise<void> {
const userInfo = storage.get('userInfo') as UTSJSONObject | null const userInfo = storage.get("userInfo") as null | UTSJSONObject;
if (userInfo == null) return if (userInfo == null) return;
const shopMerchantId = userInfo['shopMerchantId'] as string | null const shopMerchantId = userInfo.shopMerchantId as null | string;
if (shopMerchantId == null) return if (shopMerchantId == null) return;
customerType.value = -1 customerType.value = -1;
getEmployeeList({ merchantId: shopMerchantId, sceneList: [1], appQGFlag: 1 }) getEmployeeList({ merchantId: shopMerchantId, sceneList: [1], appQGFlag: 1 })
.then((res: any) => { .then((res: any) => {
dispatch('setEmployeeList', res) dispatch("setEmployeeList", res);
}) })
.catch(() => {}) .catch(() => {});
uni.showLoading({ title: '加载中', mask: true }) uni.showLoading({ title: "加载中", mask: true });
getBoutiqueMaterialConfig({ merchantId: shopMerchantId } as UTSJSONObject) getBoutiqueMaterialConfig({ merchantId: shopMerchantId } as UTSJSONObject)
.then((res: any) => { .then((res: any) => {
uni.hideLoading() uni.hideLoading();
const resp = res as UTSJSONObject | null const resp = res as null | UTSJSONObject;
const materials = (resp != null && resp['materials'] != null ? resp['materials'] : _emptyArr) as any[] const materials = (resp != null && resp.materials != null ? resp.materials : _emptyArr) as any[];
const hidePackage = (resp != null ? resp['hidePackage'] : false) ?? false const hidePackage = (resp != null ? resp.hidePackage : false) ?? false;
let boutiqueMediaConfig = {} as UTSJSONObject const boutiqueMediaConfig = {} as UTSJSONObject;
const carBannerListTemp: any[] = _emptyArr.slice() const carBannerListTemp: any[] = _emptyArr.slice();
const boutiqueCarListTemp: any[] = _emptyArr.slice() const boutiqueCarListTemp: any[] = _emptyArr.slice();
for (let i = 0; i < materials.length; i++) { for (const material of materials) {
const e = materials[i] as UTSJSONObject const e = material as UTSJSONObject;
const eCarModelName = e['carModelName'] const eCarModelName = e.carModelName;
const eCarModelId = e['carModelId'] const eCarModelId = e.carModelId;
if (e != null && eCarModelName != null && eCarModelId != null) { if (e != null && eCarModelName != null && eCarModelId != null) {
const configItems = [ const configItems = [
{ key: 'films', configIndex: 1 }, { key: "films", configIndex: 1 },
{ key: 'products', configIndex: 2 } { key: "products", configIndex: 2 }
] ];
if (hidePackage == false) configItems.unshift({ key: 'packages', configIndex: 0 }) if (hidePackage == false) configItems.unshift({ key: "packages", configIndex: 0 });
const retrofitting: any[] = _emptyArr.slice() const retrofitting: any[] = _emptyArr.slice();
carBannerListTemp.push({ carBannerListTemp.push({
title: (e['seriesName'] ?? e['brandName'] ?? '') as string, title: (e.seriesName ?? e.brandName ?? "") as string,
url: (e['modelDisplayPicurl'] ?? '') as string, url: (e.modelDisplayPicurl ?? "") as string,
name: eCarModelName, name: eCarModelName,
carModelId: eCarModelId, carModelId: eCarModelId,
seriesId: e['seriesId'] seriesId: e.seriesId
}) });
boutiqueMediaConfig[eCarModelId as string] = {} as UTSJSONObject boutiqueMediaConfig[eCarModelId as string] = {} as UTSJSONObject;
boutiqueCarListTemp.push({ boutiqueCarListTemp.push({
carModelName: eCarModelName, carModelName: eCarModelName,
carModelId: eCarModelId, carModelId: eCarModelId,
brandId: e['brandId'], brandId: e.brandId,
brandName: e['brandName'], brandName: e.brandName,
name: e['seriesName'], name: e.seriesName,
id: e['seriesId'] id: e.seriesId
}) });
for (let j = 0; j < configItems.length; j++) { for (const it of configItems) {
const it = configItems[j] const listVal = e[it.key as string];
const listVal = e[it.key as string] retrofitting.push({
retrofitting.push({ list: listVal != null ? listVal : _emptyArr,
list: listVal != null ? listVal : _emptyArr, tabId: (it.configIndex as number) + 1
tabId: (it.configIndex as number) + 1 });
}) }
} const cfg = boutiqueMediaConfig[eCarModelId as string] as UTSJSONObject;
const cfg = boutiqueMediaConfig[eCarModelId as string] as UTSJSONObject cfg.retrofitting = retrofitting;
cfg['retrofitting'] = retrofitting cfg.optionals = e.optionals != null ? e.optionals : _emptyArr;
cfg['optionals'] = e['optionals'] != null ? e['optionals'] : _emptyArr }
} }
}
const withConfig = carBannerListTemp.map((c: any) => {
const withConfig = carBannerListTemp.map((c: any) => { const cid = (c as UTSJSONObject).carModelId;
const cid = (c as UTSJSONObject)['carModelId'] const cfg = boutiqueMediaConfig[cid as string] as UTSJSONObject
const cfg = boutiqueMediaConfig[cid as string] as UTSJSONObject ;(c as UTSJSONObject).configList = cfg != null && cfg.retrofitting != null ? cfg.retrofitting : _emptyArr;
;(c as UTSJSONObject)['configList'] = cfg != null && cfg['retrofitting'] != null ? cfg['retrofitting'] : _emptyArr return c;
return c });
}) carBannerList.value = withConfig;
carBannerList.value = withConfig const userState = (store.state as UTSJSONObject).user as UTSJSONObject;
const userState = (store.state as UTSJSONObject)['user'] as UTSJSONObject userState.boutiqueMediaConfig = boutiqueMediaConfig;
userState['boutiqueMediaConfig'] = boutiqueMediaConfig userState.boutiqueCarList = boutiqueCarListTemp;
userState['boutiqueCarList'] = boutiqueCarListTemp })
}) .catch((error) => {
.catch((err) => { uni.hideLoading();
uni.hideLoading() uni.showToast({ title: error != null ? (error as any).toString() : "加载失败", icon: "none" });
uni.showToast({ title: err != null ? (err as any).toString() : '加载失败', icon: 'none' }) });
})
const baseConfigData = await getBoutiqueMockData(true);
const baseConfigData = await getBoutiqueMockData(true) const ml = baseConfigData.moduleList != null ? baseConfigData.moduleList : _emptyArr;
const ml = baseConfigData['moduleList'] != null ? baseConfigData['moduleList'] : _emptyArr const tl = baseConfigData.toolList != null ? baseConfigData.toolList : _emptyArr;
const tl = baseConfigData['toolList'] != null ? baseConfigData['toolList'] : _emptyArr const dc = baseConfigData.defaultCarId ?? "";
const dc = baseConfigData['defaultCarId'] ?? '' dispatch("setBoutiqueBaseConfig", baseConfigData);
dispatch('setBoutiqueBaseConfig', baseConfigData) moduleList.value = ml as any[];
moduleList.value = ml as any[] toolList.value = tl as any[];
toolList.value = tl as any[] defaultCarId.value = dc as string;
defaultCarId.value = dc as string
} }
async function getBoutiquePackageList(): Promise<void> { async function getBoutiquePackageList(): Promise<void> {
loadComplete.value = false loadComplete.value = false;
packageList.value = [] packageList.value = [];
const userInfo = storage.get('userInfo') as UTSJSONObject | null const userInfo = storage.get("userInfo") as null | UTSJSONObject;
if (userInfo == null) return if (userInfo == null) return;
const merchantId = userInfo['shopMerchantId'] as string | null const merchantId = userInfo.shopMerchantId as null | string;
if (merchantId == null) return if (merchantId == null) return;
try { try {
const data = await apiGetBoutiquePackageList({ merchantId: merchantId } as UTSJSONObject) const data = await apiGetBoutiquePackageList({ merchantId } as UTSJSONObject);
const arr = (data != null ? data : _emptyArr) as any[] const arr = (data != null ? data : _emptyArr) as any[];
const list: any[] = _emptyArr.slice() const list: any[] = _emptyArr.slice();
for (let i = 0; i < arr.length; i++) { for (const element of arr) {
const e = arr[i] as UTSJSONObject const e = element as UTSJSONObject;
if (e != null) { if (e != null) {
e['scriptIntroduction'] = ((e['scriptIntroduction'] ?? '') as string).replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') e.scriptIntroduction = ((e.scriptIntroduction ?? "") as string).replaceAll(/<\/?br\s*\/?>|\\n|\n/g, "<br>");
e['content'] = ((e['content'] ?? '') as string).replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') e.content = ((e.content ?? "") as string).replaceAll(/<\/?br\s*\/?>|\\n|\n/g, "<br>");
if (e['marketPrice'] != null) e['marketPrice'] = parseFloat((e['marketPrice'] as any).toString()).toString() if (e.marketPrice != null) e.marketPrice = Number.parseFloat((e.marketPrice as any).toString()).toString();
if (e['packagePrice'] != null) e['packagePrice'] = parseFloat((e['packagePrice'] as any).toString()).toString() if (e.packagePrice != null) e.packagePrice = Number.parseFloat((e.packagePrice as any).toString()).toString();
list.push(e) list.push(e);
} }
} }
packageList.value = list packageList.value = list;
} catch (_) { } catch {
packageList.value = [] packageList.value = [];
} finally { } finally {
loadComplete.value = true loadComplete.value = true;
} }
} }
onLoad((_options: OnLoadOptions) => { onLoad((_options: OnLoadOptions) => {
uni.hideLoading() uni.hideLoading();
}) });
onShow(async () => { onShow(async () => {
const userInfo = storage.get('userInfo') const userInfo = storage.get("userInfo");
if (userInfo == null) { if (userInfo == null) {
storage.remove('userInfo') storage.remove("userInfo");
storage.remove('sessionId') storage.remove("sessionId");
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: "/pages/common/login" });
return return;
} }
const userInfoObj = userInfo as UTSJSONObject const userInfoObj = userInfo as UTSJSONObject;
const shopMerchantId = userInfoObj['shopMerchantId'] as string | null const shopMerchantId = userInfoObj.shopMerchantId as null | string;
const shopMerchantName = userInfoObj['shopMerchantName'] as string | null const shopMerchantName = userInfoObj.shopMerchantName as null | string;
if (shopMerchantId == null || shopMerchantId == '' || shopMerchantName == null || shopMerchantName == '') { if (shopMerchantId == null || shopMerchantId == "" || shopMerchantName == null || shopMerchantName == "") {
storage.remove('userInfo') storage.remove("userInfo");
storage.remove('sessionId') storage.remove("sessionId");
uni.reLaunch({ url: '/pages/common/login' }) uni.reLaunch({ url: "/pages/common/login" });
return return;
} }
if (!requested.value) { if (!requested.value) {
await getMockData(true) await getMockData(true);
init() init();
requested.value = true requested.value = true;
} }
getBoutiquePackageList() getBoutiquePackageList();
setTimeout((): void => { setTimeout((): void => {
const home = homeRef.value const home = homeRef.value;
if (home != null) { if (home != null) {
callExposedMethod(home, 'updateApp') callExposedMethod(home, "updateApp");
} }
}, 0) }, 0);
}) });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
"extends": "@vue/tsconfig/tsconfig.json", "extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": { "compilerOptions": {
"ignoreDeprecations": "5.0", "ignoreDeprecations": "5.0",
"verbatimModuleSyntax": true,
"experimentalDecorators": true,
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"noImplicitAny": false,
"types": ["@dcloudio/types", "vue"],
"lib": ["esnext", "dom"], "lib": ["esnext", "dom"],
"outDir": "esbuild", "experimentalDecorators": true,
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@/*": ["./*"], "@/*": ["./*"],
"$/*": ["./uni_modules/*"] "$/*": ["./uni_modules/*"]
} },
"resolveJsonModule": true,
"types": ["@dcloudio/types", "vue"],
"noImplicitAny": false,
"outDir": "esbuild",
"sourceMap": true,
"esModuleInterop": true,
"verbatimModuleSyntax": true
}, },
"vueCompilerOptions": { "vueCompilerOptions": {
"extensions": [".vue", ".uvue"] "extensions": [".vue", ".uvue"]
......
...@@ -641,6 +641,9 @@ importers: ...@@ -641,6 +641,9 @@ importers:
'@types/echarts': '@types/echarts':
specifier: ^5.0.0 specifier: ^5.0.0
version: 5.0.0 version: 5.0.0
'@types/uni-app':
specifier: ^1.4.8
version: 1.4.8(typescript@5.9.3)
'@weapp-tailwindcss/merge': '@weapp-tailwindcss/merge':
specifier: ^2.0.1 specifier: ^2.0.1
version: 2.1.6 version: 2.1.6
...@@ -693,6 +696,9 @@ importers: ...@@ -693,6 +696,9 @@ importers:
postcss: postcss:
specifier: ^8.5.6 specifier: ^8.5.6
version: 8.5.6 version: 8.5.6
prettier:
specifier: ^3.5.3
version: 3.7.4
tailwindcss: tailwindcss:
specifier: '3' specifier: '3'
version: 3.4.17 version: 3.4.17
...@@ -729,18 +735,18 @@ importers: ...@@ -729,18 +735,18 @@ importers:
apps/uniappX/uniapp-x-tape/uni_modules/uni-getbatteryinfo: {} apps/uniappX/uniapp-x-tape/uni_modules/uni-getbatteryinfo: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-icons: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-logger: {}
apps/uniappX/uniapp-x-tape/uni_modules/uts-alioss: {}
apps/uniappX/uniapp-x-tape/uni_modules/uts-openSchema: {} apps/uniappX/uniapp-x-tape/uni_modules/uts-openSchema: {}
apps/uniappX/uniapp-x-tape/uni_modules/uts-recorder: {} apps/uniappX/uniapp-x-tape/uni_modules/uts-recorder: {}
apps/uniappX/uniapp-x-tape/uni_modules/z-paging-x: {} apps/uniappX/uniapp-x-tape/uni_modules/z-paging-x: {}
apps/uniappX/uniapp-x-tape/unpackage/dist/build/app-android/uni_modules/lime-sqlite:
dependencies:
sql.js:
specifier: ^1.13.0
version: 1.14.0
apps/web/venus-agentic/venus-agentic-assisant: apps/web/venus-agentic/venus-agentic-assisant:
dependencies: dependencies:
'@element-plus/icons-vue': '@element-plus/icons-vue':
...@@ -4042,6 +4048,9 @@ packages: ...@@ -4042,6 +4048,9 @@ packages:
'@types/trusted-types@2.0.7': '@types/trusted-types@2.0.7':
resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==}
'@types/uni-app@1.4.8':
resolution: {integrity: sha512-plxwi9MvGDrekCsDKuNlCN3ZXIv9zkqHsKZJOsc8FQqLSHveDBOm11qOaswe4QyNWVHpvwZMViii/Ni1/d40LA==}
'@types/unist@3.0.3': '@types/unist@3.0.3':
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
...@@ -13838,6 +13847,12 @@ snapshots: ...@@ -13838,6 +13847,12 @@ snapshots:
'@types/trusted-types@2.0.7': {} '@types/trusted-types@2.0.7': {}
'@types/uni-app@1.4.8(typescript@5.9.3)':
dependencies:
vue: 3.5.26(typescript@5.9.3)
transitivePeerDependencies:
- typescript
'@types/unist@3.0.3': {} '@types/unist@3.0.3': {}
'@types/web-bluetooth@0.0.20': {} '@types/web-bluetooth@0.0.20': {}
......
File mode changed
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!