mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-11 09:32:48 +00:00
同步uni-app
This commit is contained in:
parent
57d110237b
commit
16a8825962
@ -7,9 +7,9 @@ import useConfigStore from '@/stores/config'
|
||||
import useSystemStore from '@/stores/system'
|
||||
import { useLogin } from '@/hooks/useLogin'
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
const locationVal = useLocation(true);
|
||||
onLaunch((data: any) => {
|
||||
|
||||
// 添加初始化拦截器
|
||||
launchInterceptor()
|
||||
const systemStore = useSystemStore()
|
||||
|
||||
@ -1,15 +1,16 @@
|
||||
<template>
|
||||
<view class="diy-group" id="componentList">
|
||||
<top-tabbar v-if="data.global && Object.keys(data.global).length && data.global.topStatusBar && data.global.topStatusBar.isShow"
|
||||
<top-tabbar
|
||||
v-if="data.global && Object.keys(data.global).length && data.global.topStatusBar && data.global.topStatusBar.isShow"
|
||||
:scrollBool="diyGroup.componentsScrollBool.TopTabbar" ref="topTabbarRef" :data="data.global" />
|
||||
<pop-ads v-if="data.global && Object.keys(data.global).length && data.global.popWindow && data.global.popWindow.show" ref="popAbsRef" :data="data.global" />
|
||||
<pop-ads
|
||||
v-if="data.global && Object.keys(data.global).length && data.global.popWindow && data.global.popWindow.show"
|
||||
ref="popAbsRef" :data="data.global" />
|
||||
<template v-for="(component, index) in data.value" :key="component.id">
|
||||
<view
|
||||
v-show="component.componentIsShow"
|
||||
@click="diyStore.changeCurrentIndex(index, component)"
|
||||
:class="diyGroup.getComponentClass(index,component)" :style="component.pageStyle"
|
||||
>
|
||||
<view class="relative" :style="{ marginTop : component.margin.top < 0 ? (component.margin.top * 2) + 'rpx' : '0', marginBottom : component.margin.bottom < 0 ? (component.margin.bottom * 2) + 'rpx' : '0' }">
|
||||
<view v-show="component.componentIsShow" @click="diyStore.changeCurrentIndex(index, component)"
|
||||
:class="diyGroup.getComponentClass(index,component)" :style="component.pageStyle">
|
||||
<view class="relative"
|
||||
:style="{ marginTop : component.margin.top < 0 ? (component.margin.top * 2) + 'rpx' : '0', marginBottom : component.margin.bottom < 0 ? (component.margin.bottom * 2) + 'rpx' : '0' }">
|
||||
|
||||
<!-- 装修模式下,设置负上边距后超出的内容,禁止选中设置 -->
|
||||
<view v-if="diyGroup.isShowPlaceHolder(index,component)" class="absolute w-full z-1"
|
||||
@ -56,7 +57,8 @@
|
||||
<diy-float-btn :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'CarouselSearch'">
|
||||
<diy-carousel-search :scrollBool="diyGroup.componentsScrollBool.CarouselSearch" :component="component" :global="data.global" :index="index" />
|
||||
<diy-carousel-search :scrollBool="diyGroup.componentsScrollBool.CarouselSearch"
|
||||
:component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'PictureShow'">
|
||||
<diy-picture-show :component="component" :global="data.global" :index="index" />
|
||||
@ -65,61 +67,80 @@
|
||||
<diy-form-submit :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormInput'">
|
||||
<diy-form-input ref="diyFormInputRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-input ref="diyFormInputRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTextarea'">
|
||||
<diy-form-textarea ref="diyFormTextareaRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-textarea ref="diyFormTextareaRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormIdentity'">
|
||||
<diy-form-identity ref="diyFormIdentityRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-identity ref="diyFormIdentityRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormEmail'">
|
||||
<diy-form-email ref="diyFormEmailRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-email ref="diyFormEmailRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormMobile'">
|
||||
<diy-form-mobile ref="diyFormMobileRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-mobile ref="diyFormMobileRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormWechatName'">
|
||||
<diy-form-wechat-name ref="diyFormWechatNameRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-wechat-name ref="diyFormWechatNameRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormNumber'">
|
||||
<diy-form-number ref="diyFormNumberRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-number ref="diyFormNumberRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormRadio'">
|
||||
<diy-form-radio ref="diyFormRadioRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-radio ref="diyFormRadioRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormCheckbox'">
|
||||
<diy-form-checkbox ref="diyFormCheckboxRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-checkbox ref="diyFormCheckboxRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTable'">
|
||||
<diy-form-table ref="diyFormTableRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-table ref="diyFormTableRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormDate'">
|
||||
<diy-form-date ref="diyFormDateRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-date ref="diyFormDateRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormDateScope'">
|
||||
<diy-form-date-scope ref="diyFormDateScopeRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-date-scope ref="diyFormDateScopeRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTime'">
|
||||
<diy-form-time ref="diyFormTimeRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-time ref="diyFormTimeRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTimeScope'">
|
||||
<diy-form-time-scope ref="diyFormTimeScopeRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-time-scope ref="diyFormTimeScopeRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormLocation'">
|
||||
<diy-form-location ref="diyFormLocationRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-location ref="diyFormLocationRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormAddress'">
|
||||
<diy-form-address ref="diyFormAddressRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-address ref="diyFormAddressRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormImage'">
|
||||
<diy-form-image ref="diyFormImageRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-image ref="diyFormImageRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormVideo'">
|
||||
<diy-form-video ref="diyFormVideoRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-video ref="diyFormVideoRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormFile'">
|
||||
<diy-form-file ref="diyFormFileRef" :component="component" :global="data.global" :index="index" />
|
||||
<diy-form-file ref="diyFormFileRef" :component="component" :global="data.global"
|
||||
:index="index" />
|
||||
</template>
|
||||
|
||||
|
||||
@ -127,13 +148,13 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="diyStore.mode == '' && data.global && diyGroup.showCopyright.value && data.global.copyright && data.global.copyright.isShow">
|
||||
<copy-right />
|
||||
<template v-if="data.global && diyGroup.showCopyright.value && data.global.copyright && data.global.copyright.isShow">
|
||||
<copy-right :textColor="data.global.copyright.textColor" />
|
||||
</template>
|
||||
|
||||
<template v-if="diyStore.mode == '' && data.global && data.global.bottomTabBar && data.global.bottomTabBar.isShow">
|
||||
<view class="pt-[20rpx]"></view>
|
||||
<tabbar :addon="data.global.bottomTabBar.designNav.key" />
|
||||
<tabbar :addon="data.global.bottomTabBar.designNav?.key" />
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
@ -146,7 +167,7 @@ import useDiyStore from '@/app/stores/diy';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
|
||||
const props = defineProps(['data']);
|
||||
const instance: any = getCurrentInstance();
|
||||
const instance : any = getCurrentInstance();
|
||||
const getFormRef = () => {
|
||||
return {
|
||||
componentRefs: instance.refs
|
||||
@ -155,6 +176,7 @@ const getFormRef = () => {
|
||||
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
|
||||
const diyGroup = useDiyGroup({
|
||||
...props,
|
||||
getFormRef
|
||||
|
||||
@ -102,7 +102,6 @@ export function useDiyGroup(params: any = {}) {
|
||||
}
|
||||
// 新增:页面加载完成后,显示版权
|
||||
showCopyright.value = true;
|
||||
console.log('组件加载完成', showCopyright.value);
|
||||
|
||||
}, 500)
|
||||
});
|
||||
|
||||
@ -27,3 +27,87 @@ export function getShareInfo(params: Record<string, any>) {
|
||||
export function getMemberFormRecord() {
|
||||
return request.get('diy/form/member_record')
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取项目列表供组件调用
|
||||
*/
|
||||
export function getGoodsComponents(params: Record<string, any>) {
|
||||
return request.get(`home_service/goods/components`, params)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 次卡套餐
|
||||
* @param orderId
|
||||
* @returns
|
||||
*/
|
||||
export function getFirstCard(orderId: number) {
|
||||
return request.get(`home_service/member/firstCard`)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品分类列表
|
||||
*/
|
||||
export function getGoodsCategoryList(params: Record<string, any>) {
|
||||
return request.get(`home_service/goods/category/list`, params)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取次卡列表供组件调用
|
||||
*/
|
||||
export function getCardComponents(params: Record<string, any>) {
|
||||
return request.get(`home_service/card/components`, params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取优惠券、次卡
|
||||
* @param orderId
|
||||
* @returns
|
||||
*/
|
||||
export function getCouponCard(orderId: number) {
|
||||
return request.get(`home_service/member/memberDiscountCount`)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 技师信息
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export function getTechnicianInfo(params: Record<string, any>) {
|
||||
return request.get(`home_service/technician/info`,params,{ showErrorMessage: false })
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取门店信息
|
||||
* @returns 门店信息数据
|
||||
*/
|
||||
export function getStoreInfo() {
|
||||
return request.get('home_service/store/info',{},{ showErrorMessage: false })
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 技师入驻申请资料
|
||||
* @param params 技师入驻申请参数
|
||||
* @returns
|
||||
*/
|
||||
export function getTechnicianApply() {
|
||||
return request.get(`home_service/technician/apply`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 门店入驻申请资料
|
||||
* @param params 门店入驻申请参数
|
||||
* @returns
|
||||
*/
|
||||
export function getStoreApply() {
|
||||
return request.get(`home_service/member/store/application`)
|
||||
}
|
||||
|
||||
|
||||
@ -7,9 +7,20 @@ export function pay(data : AnyObject) {
|
||||
return request.post(`pay`, data, { showErrorMessage: true })
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试支付
|
||||
*/
|
||||
export function testPay(data : AnyObject) {
|
||||
return request.get(`home_service/pay/pay`, data, { showErrorMessage: true })
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取支付信息
|
||||
*/
|
||||
export function getPayInfo(tradeType : string, tradeId : number, params: Record<string, any>) {
|
||||
return request.get(`pay/info/${tradeType}/${tradeId}`, params, { showErrorMessage: true })
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -17,12 +17,19 @@
|
||||
import { t } from '@/locale'
|
||||
import { img } from '@/utils/common';
|
||||
import { ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
const sendMessageTitle = ref('')
|
||||
const sendMessagePath = ref('')
|
||||
const sendMessageImg = ref('')
|
||||
|
||||
sendMessageImg.value = img('static/resource/images/member/contact_service.png')
|
||||
|
||||
onLoad((data: any) => {
|
||||
data.send_title && (sendMessageTitle.value = data.send_title)
|
||||
data.send_path && (sendMessagePath.value = decodeURIComponent(data.send_path))
|
||||
data.send_img && (sendMessageImg.value = decodeURIComponent(data.send_img))
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -47,6 +47,7 @@ const useDiyStore = defineStore('diy', {
|
||||
copyright:{
|
||||
control: true, // 是否允许展示编辑
|
||||
isShow: false, // 是否显示
|
||||
textColor: '#ccc',
|
||||
},
|
||||
bgUrl: ''
|
||||
},
|
||||
|
||||
@ -1,18 +1,25 @@
|
||||
<template>
|
||||
<view class="flex flex-col justify-center items-center p-[30rpx] ">
|
||||
<view>
|
||||
<template v-if="diyStore.mode == 'decorate'">
|
||||
<view class="flex flex-col justify-center items-center p-[30rpx] text-[22rpx]" :style="{ color:textColor}">
|
||||
示例版权信息
|
||||
</view>
|
||||
</template>
|
||||
<tempalte v-else>
|
||||
<view class="flex flex-col justify-center items-center p-[30rpx]" :style="{ color:textColor}">
|
||||
<img :src="img(systemStore.copyright.logo)" mode="heightFix" class="max-h-[60rpx]" v-if="systemStore.copyright?.logo" />
|
||||
<view class="text-[#666] text-[22rpx] mt-[20rpx]" v-if="systemStore.copyright?.copyright_desc" @click="systemStore.copyright?.copyright_link && redirect({ url: systemStore.copyright.copyright_link})">
|
||||
<view class="text-[22rpx] mt-[20rpx]" v-if="systemStore.copyright?.copyright_desc" @click="systemStore.copyright?.copyright_link && redirect({ url: systemStore.copyright.copyright_link})">
|
||||
{{ systemStore.copyright.copyright_desc }}
|
||||
</view>
|
||||
<view class="text-[#666] text-[22rpx] mt-[20rpx]" v-if="systemStore.copyright?.icp">
|
||||
<view class="text-[22rpx] mt-[20rpx]" v-if="systemStore.copyright?.icp">
|
||||
备案号:{{ systemStore.copyright.icp }}
|
||||
</view>
|
||||
<view class="text-[#666] text-[22rpx] mt-[20rpx] flex items-center" v-if="systemStore.copyright?.gov_record" @click="systemStore.copyright?.gov_url && redirect({ url: systemStore.copyright.gov_url})">
|
||||
<view class="text-[22rpx] mt-[20rpx] flex items-center" v-if="systemStore.copyright?.gov_record" @click="systemStore.copyright?.gov_url && redirect({ url: systemStore.copyright.gov_url})">
|
||||
<img :src="img('static/resource/images/copy_right.png')" mode="heightFix" class="w-[28rpx] h-[28rpx] mr-[10rpx]" />
|
||||
{{ systemStore.copyright.gov_record }}
|
||||
</view>
|
||||
|
||||
<!-- <view class="h-[100rpx]"></view> -->
|
||||
</view>
|
||||
</tempalte>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -21,6 +28,16 @@ import { ref, nextTick } from 'vue'
|
||||
import { redirect,img } from '@/utils/common'
|
||||
import useSystemStore from '@/stores/system';
|
||||
const systemStore = useSystemStore()
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
const prop = defineProps({
|
||||
textColor: {
|
||||
type: String,
|
||||
default: '#ccc'
|
||||
},
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -10,7 +10,9 @@
|
||||
:send-message-title="props.sendMessageTitle"
|
||||
:send-message-path="props.sendMessagePath"
|
||||
:send-message-img="props.sendMessageImg"
|
||||
:show-message-card="true">
|
||||
:show-message-card="true"
|
||||
@contact="handleContact"
|
||||
>
|
||||
</button>
|
||||
|
||||
<u-popup :show="popupShow" @close="popupShow = false" mode="center" :round="5" :safeAreaInsetBottom="false">
|
||||
@ -33,6 +35,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import useSystemStore from '@/stores/system'
|
||||
import { redirect } from '@/utils/common';
|
||||
|
||||
const props = defineProps({
|
||||
sendMessageTitle: {
|
||||
@ -70,6 +73,12 @@ const callPhone = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const handleContact = (e) => {
|
||||
if (e.detail && e.detail.path) {
|
||||
redirect({ mode: 'redirectTo', url: e.detail.path, param: e.detail.query || {} })
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({})
|
||||
</script>
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="btn-wrap">
|
||||
<button class="primary-btn-bg btn" hover-class="none" :loading="loading" @click="confirmPay">{{ t('pay.confirmPay') }}</button>
|
||||
<button class="primary-btn-bg bg-[var(--primary-color)] btn" hover-class="none" :loading="loading" @click="confirmPay">{{ t('pay.confirmPay') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
@ -34,7 +34,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { t } from '@/locale'
|
||||
import { getPayInfo, pay } from '@/app/api/pay'
|
||||
import { getPayInfo, pay,testPay } from '@/app/api/pay'
|
||||
import { img, redirect, isWeixinBrowser, moneyFormat } from '@/utils/common'
|
||||
import wechat from '@/utils/wechat'
|
||||
|
||||
|
||||
@ -113,6 +113,7 @@ const props = defineProps({
|
||||
const emits = defineEmits(['close'])
|
||||
|
||||
const sharePopupShow = ref(false);
|
||||
const posterType = ref(props.posterType)
|
||||
|
||||
// 复制
|
||||
const copyUrl = () => {
|
||||
@ -134,7 +135,8 @@ const copyUrl = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const openShare = () => {
|
||||
const openShare = (data: any) => {
|
||||
posterType.value = data?.type || posterType.value || ''
|
||||
sharePopupShow.value = true
|
||||
loadPoster();
|
||||
}
|
||||
@ -154,7 +156,7 @@ const loadPoster = () => {
|
||||
isPosterImg.value = false;
|
||||
let obj = {
|
||||
id: props.posterId,
|
||||
type: props.posterType,
|
||||
type: posterType.value,
|
||||
param: props.posterParam
|
||||
}
|
||||
let startTime = Date.parse(new Date());
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, getCurrentInstance, nextTick } from 'vue';
|
||||
import { redirect, img } from '@/utils/common';
|
||||
import { redirect, img ,currRoute} from '@/utils/common';
|
||||
import useSystemStore from '@/stores/system';
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
@ -192,7 +192,9 @@ if (componentsScrollVal) {
|
||||
let pages = getCurrentPages();
|
||||
const isBackShow = computed(() => {
|
||||
let bool = false;
|
||||
if (props.isBack) {
|
||||
if (props.isBack && pages.length > 1) {
|
||||
bool = true;
|
||||
} else if (currRoute() == 'app/pages/auth/index') {
|
||||
bool = true;
|
||||
}
|
||||
return bool;
|
||||
|
||||
@ -12,6 +12,7 @@ import { getWechatAuthCode } from '@/app/api/system'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import useSystemStore from '@/stores/system'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export function useLogin() {
|
||||
/**
|
||||
@ -84,20 +85,44 @@ export function useLogin() {
|
||||
/**
|
||||
* 执行登录后跳转
|
||||
*/
|
||||
const handleLoginBack = () => {
|
||||
const ler = ref(0)
|
||||
const handleLoginBack = (e) => {
|
||||
ler.value = e
|
||||
uni.removeStorageSync('autoLoginLock')
|
||||
uni.getStorage({
|
||||
key: 'loginBack',
|
||||
success: (res: any) => {
|
||||
if(ler.value == 1){
|
||||
redirect({
|
||||
url:'/addon/home_service/technician/pages/member/index',
|
||||
mode: 'redirectTo'
|
||||
})
|
||||
}else if(ler.value == 2){
|
||||
redirect({
|
||||
url:'/addon/home_service/store/pages/member/index',
|
||||
mode: 'redirectTo'
|
||||
})
|
||||
}else{
|
||||
res ? redirect(
|
||||
{
|
||||
...res.data,
|
||||
mode: 'redirectTo'
|
||||
}
|
||||
) : redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||
}
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||
console.log(ler.value)
|
||||
if(ler.value==1){
|
||||
redirect({ url:'/addon/home_service/technician/pages/member/index', mode: 'switchTab' })
|
||||
|
||||
}else if(ler.value==2){
|
||||
redirect({ url:'/addon/home_service/store/pages/member/index', mode: 'switchTab' })
|
||||
}else{
|
||||
redirect({ url:'/app/pages/index/index', mode: 'switchTab' })
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -155,5 +155,8 @@
|
||||
"shop_fenxiao.orderNo": "订单号",
|
||||
"shop_giftcard.actualPayment": "实付款",
|
||||
"shop_giftcard.orderClose": "关闭订单",
|
||||
"shop_giftcard.orderNo": "订单号"
|
||||
"shop_giftcard.orderNo": "订单号",
|
||||
"notHave": "无",
|
||||
"onceCard": "次卡",
|
||||
"cardUnit": "张"
|
||||
}
|
||||
@ -1,36 +1,36 @@
|
||||
{
|
||||
"name": "",
|
||||
"appid": "__UNI__9B03DBD",
|
||||
"description": "",
|
||||
"versionName": "1.0.0",
|
||||
"versionCode": "100",
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
"compatible": {
|
||||
"ignoreVersion": true
|
||||
"name" : "",
|
||||
"appid" : "__UNI__9B03DBD",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"compatible" : {
|
||||
"ignoreVersion" : true
|
||||
},
|
||||
"usingComponents": true,
|
||||
"nvueStyleCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": true,
|
||||
"waiting": true,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
"modules": {
|
||||
"Camera": {},
|
||||
"Barcode": {},
|
||||
"Contacts": {},
|
||||
"Geolocation": {},
|
||||
"Payment": {},
|
||||
"VideoPlayer": {},
|
||||
"Maps": {},
|
||||
"Share": {}
|
||||
"modules" : {
|
||||
"Camera" : {},
|
||||
"Barcode" : {},
|
||||
"Contacts" : {},
|
||||
"Geolocation" : {},
|
||||
"Payment" : {},
|
||||
"VideoPlayer" : {},
|
||||
"Maps" : {},
|
||||
"Share" : {}
|
||||
},
|
||||
"distribute": {
|
||||
"android": {
|
||||
"permissions": [
|
||||
"distribute" : {
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
@ -48,71 +48,67 @@
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
"ios": {
|
||||
"dSYMs": false
|
||||
"ios" : {
|
||||
"dSYMs" : false
|
||||
},
|
||||
"sdkConfigs": {
|
||||
"maps": {
|
||||
"tencent": {
|
||||
"key": "6ZDBZ-CLSLX-66747-7MVM4-HLK47-XMBXU"
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"tencent" : {
|
||||
"key" : "6ZDBZ-CLSLX-66747-7MVM4-HLK47-XMBXU"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"quickapp": {},
|
||||
"mp-weixin": {
|
||||
"appid": "",
|
||||
"setting": {
|
||||
"urlCheck": false
|
||||
"quickapp" : {},
|
||||
"mp-weixin" : {
|
||||
"appid" : "",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents": true,
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "为了更好地为您提供服务"
|
||||
"usingComponents" : true,
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "为了更好地为您提供服务"
|
||||
},
|
||||
"scope.writePhotosAlbum": {
|
||||
"desc": "为了更好地为您提供服务"
|
||||
"scope.writePhotosAlbum" : {
|
||||
"desc" : "为了更好地为您提供服务"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": [
|
||||
"chooseLocation",
|
||||
"getLocation",
|
||||
"chooseAddress"
|
||||
],
|
||||
"__usePrivacyCheck__": true
|
||||
"requiredPrivateInfos" : [ "chooseLocation", "getLocation", "chooseAddress" ],
|
||||
"__usePrivacyCheck__" : true
|
||||
},
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion": "3",
|
||||
"h5": {
|
||||
"router": {
|
||||
"mode": "history",
|
||||
"base": "/wap/"
|
||||
"vueVersion" : "3",
|
||||
"h5" : {
|
||||
"router" : {
|
||||
"mode" : "history",
|
||||
"base" : "/wap/"
|
||||
},
|
||||
"sdkConfigs": {
|
||||
"maps": {
|
||||
"qqmap": {
|
||||
"key": ""
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"qqmap" : {
|
||||
"key" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"loading": "",
|
||||
"error": "",
|
||||
"delay": 0,
|
||||
"timeout": 3000
|
||||
"async" : {
|
||||
"loading" : "",
|
||||
"error" : "",
|
||||
"delay" : 0,
|
||||
"timeout" : 3000
|
||||
}
|
||||
},
|
||||
"fallbackLocale": "zh-Hans"
|
||||
"fallbackLocale" : "zh-Hans"
|
||||
}
|
||||
@ -1,8 +1,9 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 3952239 */
|
||||
src: url('https://at.alicdn.com/t/c/font_3952239_yxckpayhvp.woff2?t=1755857288182') format('woff2'),
|
||||
url('https://at.alicdn.com/t/c/font_3952239_yxckpayhvp.woff?t=1755857288182') format('woff'),
|
||||
url('https://at.alicdn.com/t/c/font_3952239_yxckpayhvp.ttf?t=1755857288182') format('truetype');
|
||||
font-family: "iconfont";
|
||||
/* Project id 3952239 */
|
||||
src: url('//at.alicdn.com/t/c/font_3952239_waynfpfdr5.woff2?t=1762225321119') format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_3952239_waynfpfdr5.woff?t=1762225321119') format('woff'),
|
||||
url('//at.alicdn.com/t/c/font_3952239_waynfpfdr5.ttf?t=1762225321119') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@ -13,6 +14,54 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icondingdanzhongxinPC-3:before {
|
||||
content: "\e7af";
|
||||
}
|
||||
|
||||
.iconshangchuantupian:before {
|
||||
content: "\e6e9";
|
||||
}
|
||||
|
||||
.iconnew_icon_bianjiqi_chexiao_keyong:before {
|
||||
content: "\e64a";
|
||||
}
|
||||
|
||||
.iconnew_icon_bianjiqi_zhongzuo_keyong:before {
|
||||
content: "\e64b";
|
||||
}
|
||||
|
||||
.iconbiaotizhengwenqiehuan:before {
|
||||
content: "\e6e2";
|
||||
}
|
||||
|
||||
.iconjuyouduiqi:before {
|
||||
content: "\e6e6";
|
||||
}
|
||||
|
||||
.iconbianjiqifengexian:before {
|
||||
content: "\e6eb";
|
||||
}
|
||||
|
||||
.iconbianjiqijuzhongduiqi:before {
|
||||
content: "\e6ec";
|
||||
}
|
||||
|
||||
.iconzitijiacu:before {
|
||||
content: "\ec83";
|
||||
}
|
||||
|
||||
.iconzitixiahuaxian:before {
|
||||
content: "\ec85";
|
||||
}
|
||||
|
||||
.iconzitixieti:before {
|
||||
content: "\ec86";
|
||||
}
|
||||
|
||||
.icont:before {
|
||||
content: "\eb24";
|
||||
}
|
||||
|
||||
.iconjiahaoV6xx1:before {
|
||||
content: "\e7cc";
|
||||
}
|
||||
|
||||
@ -2,13 +2,14 @@ import { getTabbarPages } from './pages'
|
||||
import useDiyStore from '@/app/stores/diy'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import useSystemStore from '@/stores/system'
|
||||
import wechat from '@/utils/wechat'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import { getNeedLoginPages } from '@/utils/pages'
|
||||
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
/**
|
||||
* 跳转页面
|
||||
*/
|
||||
export const redirect = (redirect: any) => {
|
||||
export const redirect = (redirect : any) => {
|
||||
// 装修模式禁止跳转
|
||||
if (useDiyStore().mode == 'decorate') return
|
||||
|
||||
@ -90,7 +91,6 @@ export const redirect = (redirect: any) => {
|
||||
if (newLogin) {
|
||||
uni.setStorage({ key: 'loginBack', data: { url: originalUrl } });
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case 'switchTab':
|
||||
uni.switchTab({
|
||||
@ -155,7 +155,7 @@ export const redirect = (redirect: any) => {
|
||||
* 自定义跳转链接
|
||||
* @param {Object} link
|
||||
*/
|
||||
export const diyRedirect = (link: any) => {
|
||||
export const diyRedirect = (link : any) => {
|
||||
const diyStore = useDiyStore();
|
||||
// 装修模式禁止跳转
|
||||
if (diyStore.mode == 'decorate') return;
|
||||
@ -211,7 +211,7 @@ export const currRoute = () => {
|
||||
|
||||
// 获取分享路由
|
||||
export const currShareRoute = () => {
|
||||
const pages: any = getCurrentPages()
|
||||
const pages : any = getCurrentPages()
|
||||
if (pages.length == 0) {
|
||||
return {
|
||||
path: '/',
|
||||
@ -221,15 +221,15 @@ export const currShareRoute = () => {
|
||||
let currentRoute = pages[pages.length - 1].route //获取当前页面路由
|
||||
|
||||
// #ifndef MP
|
||||
let currentParam: any = pages[pages.length - 1].$page.options; //获取路由参数
|
||||
let currentParam : any = pages[pages.length - 1].$page.options; //获取路由参数
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
let currentParam: any = pages[pages.length - 1].options || {}; //获取路由参数
|
||||
let currentParam : any = pages[pages.length - 1].options || {}; //获取路由参数
|
||||
// #endif
|
||||
|
||||
// 拼接参数
|
||||
let params: any = {};
|
||||
let params : any = {};
|
||||
for (let key in currentParam) {
|
||||
params[key] = currentParam[key]
|
||||
}
|
||||
@ -245,7 +245,7 @@ export const currShareRoute = () => {
|
||||
* 获取token
|
||||
* @returns
|
||||
*/
|
||||
export function getToken(): null | string {
|
||||
export function getToken() : null | string {
|
||||
return useMemberStore().token
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ export function getToken(): null | string {
|
||||
* @param token
|
||||
* @returns
|
||||
*/
|
||||
export function setToken(token: string): void {
|
||||
export function setToken(token : string) : void {
|
||||
uni.setStorageSync(import.meta.env.VITE_REQUEST_STORAGE_TOKEN_KEY, token)
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ export function setToken(token: string): void {
|
||||
* 移除token
|
||||
* @returns
|
||||
*/
|
||||
export function removeToken(): void {
|
||||
export function removeToken() : void {
|
||||
uni.removeStorageSync(import.meta.env.VITE_REQUEST_STORAGE_TOKEN_KEY)
|
||||
}
|
||||
|
||||
@ -273,7 +273,7 @@ export function urlDeconstruction(url: string) {
|
||||
const query: any = {}
|
||||
const [path, param] = url.split('?')
|
||||
|
||||
param && param.split('&').forEach((str: string) => {
|
||||
param && param.split('&').forEach((str : string) => {
|
||||
let [name, value] = str.split('=')
|
||||
query[name] = value
|
||||
})
|
||||
@ -286,7 +286,7 @@ export function urlDeconstruction(url: string) {
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
export function isUrl(str: string): boolean {
|
||||
export function isUrl(str : string) : boolean {
|
||||
return str && (str.indexOf('http://') != -1 || str.indexOf('https://') != -1) || false
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ export function isUrl(str: string): boolean {
|
||||
* @param path
|
||||
* @returns
|
||||
*/
|
||||
export function img(path: string): string {
|
||||
export function img(path : string) : string {
|
||||
// #ifdef H5
|
||||
let imgDomain = import.meta.env.VITE_IMG_DOMAIN || location.origin
|
||||
// #endif
|
||||
@ -314,7 +314,7 @@ export function img(path: string): string {
|
||||
* @param path
|
||||
* @returns
|
||||
*/
|
||||
export function getUrl(path: string): string {
|
||||
export function getUrl(path : string) : string {
|
||||
// #ifdef H5
|
||||
let urlDomain = import.meta.env.VITE_IMG_DOMAIN || location.origin
|
||||
// #endif
|
||||
@ -332,14 +332,14 @@ export function getUrl(path: string): string {
|
||||
/**
|
||||
* 手机号隐藏
|
||||
*/
|
||||
export function mobileHide(mobile: string) {
|
||||
export function mobileHide(mobile : string) {
|
||||
return mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是微信浏览器
|
||||
*/
|
||||
export function isWeixinBrowser(): boolean {
|
||||
export function isWeixinBrowser() : boolean {
|
||||
// #ifndef H5
|
||||
return false
|
||||
// #endif
|
||||
@ -350,7 +350,7 @@ export function isWeixinBrowser(): boolean {
|
||||
/**
|
||||
* 获取应用场景值
|
||||
*/
|
||||
export function getAppChannel(): string {
|
||||
export function getAppChannel() : string {
|
||||
// #ifdef APP-PLUS
|
||||
return 'app'
|
||||
// #endif
|
||||
@ -365,21 +365,21 @@ export function getAppChannel(): string {
|
||||
/**
|
||||
* 金额格式化
|
||||
*/
|
||||
export function moneyFormat(money: string): string {
|
||||
export function moneyFormat(money : string) : string {
|
||||
return isNaN(parseFloat(money)) ? money : parseFloat(money).toFixed(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号隐藏
|
||||
*/
|
||||
export function mobileConceal(mobile: string): string {
|
||||
export function mobileConceal(mobile : string) : string {
|
||||
return mobile.substring(0, 3) + "****" + mobile.substr(mobile.length - 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点id
|
||||
*/
|
||||
export function getSiteId(siteId: number | string) {
|
||||
export function getSiteId(siteId : number | string) {
|
||||
// #ifdef H5
|
||||
const match = location.href.match(/\/wap\/(\d*)\//);
|
||||
match && (siteId = match[1])
|
||||
@ -400,19 +400,19 @@ export function getSiteId(siteId: number | string) {
|
||||
* @param timeStamp
|
||||
* @param type
|
||||
*/
|
||||
export function timeStampTurnTime(timeStamp: any, type = "") {
|
||||
export function timeStampTurnTime(timeStamp : any, type = "") {
|
||||
if (timeStamp != undefined && timeStamp != "" && timeStamp > 0) {
|
||||
const date = new Date();
|
||||
date.setTime(timeStamp * 1000);
|
||||
const y = date.getFullYear();
|
||||
let m: any = date.getMonth() + 1;
|
||||
let m : any = date.getMonth() + 1;
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
let d: any = date.getDate();
|
||||
let d : any = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
let h: any = date.getHours();
|
||||
let h : any = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
let minute: any = date.getMinutes();
|
||||
let second: any = date.getSeconds();
|
||||
let minute : any = date.getMinutes();
|
||||
let second : any = date.getSeconds();
|
||||
minute = minute < 10 ? ('0' + minute) : minute;
|
||||
second = second < 10 ? ('0' + second) : second;
|
||||
if (type) {
|
||||
@ -433,7 +433,7 @@ export function timeStampTurnTime(timeStamp: any, type = "") {
|
||||
* 日期格式转时间戳
|
||||
* @param dateStr
|
||||
*/
|
||||
export function timeTurnTimeStamp(dateStr: string) {
|
||||
export function timeTurnTimeStamp(dateStr : string) {
|
||||
// 输入验证
|
||||
if (!dateStr || typeof dateStr !== 'string' || dateStr.trim() === '') {
|
||||
return null;
|
||||
@ -446,22 +446,22 @@ export function timeTurnTimeStamp(dateStr: string) {
|
||||
// 'YYYY年M月D日' -> 'YYYY-MM-DD'
|
||||
{
|
||||
pattern: /(\d{4})年(\d{1,2})月(\d{1,2})日/,
|
||||
transform: (str: string) => str.replace(/(\d{4})年(\d{1,2})月(\d{1,2})日/, '$1-$2-$3')
|
||||
transform: (str : string) => str.replace(/(\d{4})年(\d{1,2})月(\d{1,2})日/, '$1-$2-$3')
|
||||
},
|
||||
// 'YYYY年M月D日 HH时mm分' -> 'YYYY-MM-DD HH:mm'
|
||||
{
|
||||
pattern: /(\d{4})年(\d{1,2})月(\d{1,2})日\s+(\d{1,2})时(\d{1,2})分/,
|
||||
transform: (str: string) => str.replace(/(\d{4})年(\d{1,2})月(\d{1,2})日\s+(\d{1,2})时(\d{1,2})分/, '$1-$2-$3 $4:$5')
|
||||
transform: (str : string) => str.replace(/(\d{4})年(\d{1,2})月(\d{1,2})日\s+(\d{1,2})时(\d{1,2})分/, '$1-$2-$3 $4:$5')
|
||||
},
|
||||
// 'YYYY/MM/DD' -> 'YYYY-MM-DD'
|
||||
{
|
||||
pattern: /^\d{4}\/\d{1,2}\/\d{1,2}(\s+\d{1,2}:\d{1,2}(:\d{1,2})?)?$/,
|
||||
transform: (str: string) => str.replace(/\//g, '-')
|
||||
transform: (str : string) => str.replace(/\//g, '-')
|
||||
},
|
||||
// 标准格式,无需转换
|
||||
{
|
||||
pattern: /^\d{4}-\d{1,2}-\d{1,2}(\s+\d{1,2}:\d{1,2}(:\d{1,2})?)?$/,
|
||||
transform: (str: string) => str
|
||||
transform: (str : string) => str
|
||||
}
|
||||
];
|
||||
|
||||
@ -495,7 +495,7 @@ export function timeTurnTimeStamp(dateStr: string) {
|
||||
* 日期格式转时间戳 (兼容 iOS)
|
||||
* @param dateStr
|
||||
*/
|
||||
export function timeTurnTimeStampTwo(dateStr: string) {
|
||||
export function timeTurnTimeStampTwo(dateStr : string) {
|
||||
if (!dateStr || typeof dateStr !== 'string' || dateStr.trim() === '') {
|
||||
return null;
|
||||
}
|
||||
@ -507,13 +507,13 @@ export function timeTurnTimeStampTwo(dateStr: string) {
|
||||
// 'YYYY年M月D日'
|
||||
{
|
||||
pattern: /(\d{4})年(\d{1,2})月(\d{1,2})日/,
|
||||
transform: (str: string) =>
|
||||
transform: (str : string) =>
|
||||
str.replace(/(\d{4})年(\d{1,2})月(\d{1,2})日/, '$1/$2/$3'),
|
||||
},
|
||||
// 'YYYY年M月D日 HH时mm分'
|
||||
{
|
||||
pattern: /(\d{4})年(\d{1,2})月(\d{1,2})日\s+(\d{1,2})时(\d{1,2})分/,
|
||||
transform: (str: string) =>
|
||||
transform: (str : string) =>
|
||||
str.replace(
|
||||
/(\d{4})年(\d{1,2})月(\d{1,2})日\s+(\d{1,2})时(\d{1,2})分/,
|
||||
'$1/$2/$3 $4:$5'
|
||||
@ -522,22 +522,22 @@ export function timeTurnTimeStampTwo(dateStr: string) {
|
||||
// 'YYYY-MM-DD HH:mm:ss' -> 'YYYY/MM/DD HH:mm:ss' (iOS兼容)
|
||||
{
|
||||
pattern: /^\d{4}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{1,2}(:\d{1,2})?$/,
|
||||
transform: (str: string) => str.replace(/-/g, '/'),
|
||||
transform: (str : string) => str.replace(/-/g, '/'),
|
||||
},
|
||||
// 'YYYY-MM-DD' -> 'YYYY/MM/DD' (iOS兼容)
|
||||
{
|
||||
pattern: /^\d{4}-\d{1,2}-\d{1,2}$/,
|
||||
transform: (str: string) => str.replace(/-/g, '/'),
|
||||
transform: (str : string) => str.replace(/-/g, '/'),
|
||||
},
|
||||
// 'YYYY/MM/DD' / 'YYYY/MM/DD HH:mm:ss'
|
||||
{
|
||||
pattern: /^\d{4}\/\d{1,2}\/\d{1,2}(\s+\d{1,2}:\d{1,2}(:\d{1,2})?)?$/,
|
||||
transform: (str: string) => str,
|
||||
transform: (str : string) => str,
|
||||
},
|
||||
];
|
||||
|
||||
// 尝试匹配并转换
|
||||
let normalizedDateStr: string | null = null;
|
||||
let normalizedDateStr : string | null = null;
|
||||
for (const rule of formatRules) {
|
||||
if (rule.pattern.test(trimmedDateStr)) {
|
||||
normalizedDateStr = rule.transform(trimmedDateStr);
|
||||
@ -565,7 +565,7 @@ export function timeTurnTimeStampTwo(dateStr: string) {
|
||||
* @param {Object} value
|
||||
* @param {Object} callback
|
||||
*/
|
||||
export function copy(value: any, callback: any) {
|
||||
export function copy(value : any, callback : any) {
|
||||
// #ifdef H5
|
||||
const oInput = document.createElement('input'); //创建一个隐藏input(重要!)
|
||||
oInput.value = value; //赋值
|
||||
@ -612,8 +612,8 @@ export function copy(value: any, callback: any) {
|
||||
* 处理onLoad传递的参数
|
||||
* @param option
|
||||
*/
|
||||
export function handleOnloadParams(option: any) {
|
||||
let params: any = {};
|
||||
export function handleOnloadParams(option : any) {
|
||||
let params : any = {};
|
||||
|
||||
// 处理小程序扫码进入的场景值参数
|
||||
if (option.scene) {
|
||||
@ -639,7 +639,7 @@ export function handleOnloadParams(option: any) {
|
||||
* @param {object} obj 需要深度克隆的对象
|
||||
* @returns {*} 克隆后的对象或者原值(不是对象)
|
||||
*/
|
||||
export function deepClone(obj: any) {
|
||||
export function deepClone(obj : any) {
|
||||
// 对常见的“非”值,直接返回原来值
|
||||
if ([null, undefined, NaN, false].includes(obj)) return obj
|
||||
if (typeof obj !== 'object' && typeof obj !== 'function') {
|
||||
@ -661,8 +661,8 @@ export function deepClone(obj: any) {
|
||||
* @param delay
|
||||
* @returns
|
||||
*/
|
||||
export function debounce(fn: (args?: any) => any, delay: number = 300) {
|
||||
let timer: null | number = null
|
||||
export function debounce(fn : (args ?: any) => any, delay : number = 300) {
|
||||
let timer : null | number = null
|
||||
return function (...args) {
|
||||
if (timer != null) {
|
||||
clearTimeout(timer)
|
||||
@ -674,7 +674,7 @@ export function debounce(fn: (args?: any) => any, delay: number = 300) {
|
||||
}
|
||||
}
|
||||
|
||||
const isArray = (value: any) => {
|
||||
const isArray = (value : any) => {
|
||||
if (typeof Array.isArray === 'function') {
|
||||
return Array.isArray(value)
|
||||
}
|
||||
@ -682,14 +682,14 @@ const isArray = (value: any) => {
|
||||
}
|
||||
|
||||
// px转rpx
|
||||
export function pxToRpx(px: any) {
|
||||
export function pxToRpx(px : any) {
|
||||
const systemStore = useSystemStore()
|
||||
const screenWidth = systemStore.systemInfo.screenWidth;
|
||||
return (750 * Number.parseInt(px)) / screenWidth;
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
export function goback(data: any) {
|
||||
export function goback(data : any) {
|
||||
let { url, mode, param, title } = data
|
||||
uni.showToast({
|
||||
title: title,
|
||||
@ -729,10 +729,10 @@ export function getWinxinOpenId() {
|
||||
}
|
||||
|
||||
// 获取有效期
|
||||
export function getValidTime(minutes: any = 1) {
|
||||
export function getValidTime(minutes : any = 1) {
|
||||
const date = new Date();
|
||||
date.setSeconds(60 * minutes);
|
||||
let validTime: any = parseInt(date.getTime() / 1000); // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||
let validTime : any = parseInt(date.getTime() / 1000); // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||
return validTime;
|
||||
}
|
||||
|
||||
@ -742,10 +742,10 @@ export function getValidTime(minutes: any = 1) {
|
||||
* 设置插件应用的主色调
|
||||
* @param path
|
||||
*/
|
||||
export function setThemeColor (path: string) {
|
||||
export function setThemeColor(path : string) {
|
||||
let pathArr = path.split('/')
|
||||
let index = !pathArr[0] ? 1 : 0;
|
||||
let route = pathArr[index] == 'addon' ? pathArr[(index+1)] : 'app';
|
||||
let route = pathArr[index] == 'addon' ? pathArr[(index + 1)] : 'app';
|
||||
|
||||
// 设置底部导航
|
||||
const configStore = useConfigStore()
|
||||
@ -760,38 +760,38 @@ export function setThemeColor (path: string) {
|
||||
if (route != 'app') {
|
||||
try {
|
||||
currTheme = theme_color_list[route];
|
||||
if(currTheme && currTheme.theme){
|
||||
if (currTheme && currTheme.theme) {
|
||||
configStore.themeColor = themeColorToHex(currTheme.theme)
|
||||
uni.setStorageSync('current_theme_color', JSON.stringify(themeColorToHex(currTheme.theme)));
|
||||
}else if( !currTheme && current_theme_color){
|
||||
} else if (!currTheme && current_theme_color) {
|
||||
configStore.themeColor = ''
|
||||
}else{
|
||||
} else {
|
||||
currTheme = theme_color_list.app || Object.values(theme_color_list)[0];
|
||||
configStore.themeColor = themeColorToHex(currTheme.theme)
|
||||
uni.setStorageSync('current_theme_color', JSON.stringify(themeColorToHex(currTheme.theme)));
|
||||
}
|
||||
} catch (e) {
|
||||
// 设置插件应用的主色调发生错误,若不存在则使用最后有效的主色调
|
||||
if(!current_theme_color && theme_color_list && Object.keys(theme_color_list).length > 0){
|
||||
if (!current_theme_color && theme_color_list && Object.keys(theme_color_list).length > 0) {
|
||||
currTheme = theme_color_list.app || Object.values(theme_color_list)[0];
|
||||
configStore.themeColor = themeColorToHex(currTheme.theme)
|
||||
uni.setStorageSync('current_theme_color', JSON.stringify(themeColorToHex(currTheme.theme)));
|
||||
}else{
|
||||
} else {
|
||||
configStore.themeColor = '';
|
||||
}
|
||||
}
|
||||
|
||||
}else if (!current_theme_color && theme_color_list && Object.keys(theme_color_list).length > 0) {
|
||||
} else if (!current_theme_color && theme_color_list && Object.keys(theme_color_list).length > 0) {
|
||||
currTheme = theme_color_list.app || Object.values(theme_color_list)[0]
|
||||
configStore.themeColor = themeColorToHex(currTheme.theme)
|
||||
uni.setStorageSync("current_theme_color", JSON.stringify(themeColorToHex(currTheme.theme)))
|
||||
}
|
||||
}
|
||||
|
||||
export function themeColorToHex (param: any) {
|
||||
export function themeColorToHex(param : any) {
|
||||
const hexRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/
|
||||
const rgbaRegex = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(,\s*\d*\.?\d+)?\)$/
|
||||
for(let key in param){
|
||||
for (let key in param) {
|
||||
if (rgbaRegex.test(param[key])) {
|
||||
const values = param[key].replace('rgba(', '').replace(')', '').split(',');
|
||||
// 提取 r, g, b, a 值,并将它们转换为合适的类型
|
||||
@ -799,14 +799,14 @@ export function themeColorToHex (param: any) {
|
||||
const g = parseInt(values[1].trim(), 10); // Green 分量
|
||||
const b = parseInt(values[2].trim(), 10); // Blue 分量
|
||||
const a = parseFloat(values[3].trim()); // Alpha 分量
|
||||
param[key] = rgbaToHex(r,g,b,a)
|
||||
param[key] = rgbaToHex(r, g, b, a)
|
||||
}
|
||||
}
|
||||
return param
|
||||
}
|
||||
|
||||
// rgba转十六进制颜色
|
||||
export function rgbaToHex (r, g, b, a) {
|
||||
export function rgbaToHex(r, g, b, a) {
|
||||
// 计算混合后的RGB值,假设背景是白色 (255, 255, 255)
|
||||
let rBlend = Math.round((1 - a) * 255 + a * r)
|
||||
let gBlend = Math.round((1 - a) * 255 + a * g)
|
||||
@ -823,7 +823,7 @@ export function rgbaToHex (r, g, b, a) {
|
||||
}
|
||||
|
||||
// 获取 topFixedStatus 缓存名称
|
||||
export function getTopFixedStatusName(data: any = {}) {
|
||||
export function getTopFixedStatusName(data : any = {}) {
|
||||
let name = 'topFixedStatus'
|
||||
if (data.id) name += '_' + data.id
|
||||
if (data.site_id) name += '_' + data.site_id
|
||||
|
||||
@ -4,6 +4,7 @@ import { redirect, getToken, getSiteId,currRoute, setThemeColor } from '@/utils/
|
||||
import { memberLog } from '@/app/api/auth'
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
|
||||
|
||||
/**
|
||||
* 页面跳转拦截器
|
||||
*/
|
||||
@ -24,7 +25,10 @@ export const redirectInterceptor = (route: { path: string, query: object }) => {
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
route.path.indexOf('addon') != -1 && language.loadAllLocaleMessages('addon', uni.getLocale())
|
||||
try {
|
||||
language.loadAllLocaleMessages('addon', uni.getLocale())
|
||||
} catch (e) {
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 校验是否需要登录
|
||||
|
||||
6974
uni-app/yarn.lock
Normal file
6974
uni-app/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user