mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2026-01-25 12:08:10 +00:00
fix uni-app
This commit is contained in:
parent
34e68e2e70
commit
c763d20b6d
@ -71,23 +71,17 @@ const solve = () => {
|
||||
}
|
||||
|
||||
const handleWeappAddonComponents = (mode) => {
|
||||
const files = [
|
||||
`./dist/${mode}/mp-weixin/addon/components/diy/group/index.json`,
|
||||
`./dist/${mode}/mp-weixin/app/pages/index/tabbar.json`
|
||||
]
|
||||
const src = `./dist/${mode}/mp-weixin/addon/components/diy/group/index.json`
|
||||
try {
|
||||
const data = JSON.parse(fs.readFileSync(src, 'utf8'));
|
||||
data.componentPlaceholder = {};
|
||||
|
||||
files.forEach(src => {
|
||||
try {
|
||||
const data = JSON.parse(fs.readFileSync(src, 'utf8'));
|
||||
data.componentPlaceholder = {};
|
||||
|
||||
Object.keys(data.usingComponents).map(key => {
|
||||
data.componentPlaceholder[key] = "view";
|
||||
})
|
||||
fs.writeFileSync(src, JSON.stringify(data))
|
||||
} catch (err) {
|
||||
}
|
||||
})
|
||||
Object.keys(data.usingComponents).map(key => {
|
||||
data.componentPlaceholder[key] = "view";
|
||||
})
|
||||
fs.writeFileSync(src, JSON.stringify(data))
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
|
||||
const handleWeappLanguage = (mode) => {
|
||||
|
||||
@ -12,9 +12,18 @@ onLaunch((data: any) => {
|
||||
|
||||
// 添加初始化拦截器
|
||||
launchInterceptor()
|
||||
const systemStore = useSystemStore()
|
||||
|
||||
// 初始化全局数据
|
||||
const initGlobalData = () => {
|
||||
systemStore.systemInfo = uni.getSystemInfoSync();
|
||||
systemStore.getMenuButtonInfoFn()
|
||||
}
|
||||
|
||||
initGlobalData()
|
||||
|
||||
// #ifdef H5
|
||||
uni.getSystemInfoSync().platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
|
||||
systemStore.systemInfo.platform == 'ios' && (uni.setStorageSync('initUrl', location.href))
|
||||
|
||||
// 传输给后台数据
|
||||
window.parent.postMessage(JSON.stringify({
|
||||
@ -38,6 +47,8 @@ onLaunch((data: any) => {
|
||||
type: 'appOnReady',
|
||||
message: '加载完成'
|
||||
}), '*');
|
||||
// 更新全局数据
|
||||
initGlobalData()
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('uni-app App.vue 接受数据错误', e)
|
||||
@ -82,7 +93,7 @@ onLaunch((data: any) => {
|
||||
// #endif
|
||||
|
||||
// 获取初始化数据信息
|
||||
useSystemStore().getInitFn(async() => {
|
||||
useSystemStore().getInitFn(async () => {
|
||||
|
||||
const configStore = useConfigStore()
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import diyGroup from '@/addon/components/diy/group/index.vue'
|
||||
import { getFormRecord } from '@/app/api/diy_form';
|
||||
import { deepClone } from '@/utils/common'
|
||||
|
||||
const props = defineProps(['record_id', 'completeLayout']);
|
||||
const emits = defineEmits(['callback'])
|
||||
@ -17,20 +18,21 @@ const diyFormData: any = reactive({
|
||||
global: {},
|
||||
value: []
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getFormRecord({
|
||||
record_id: props.record_id
|
||||
}).then((res: any) => {
|
||||
diyFormData.global.completeLayout = props.completeLayout || 'style-1';
|
||||
if (res.data.recordsFieldList) {
|
||||
let recordsFieldList = deepClone(res.data.recordsFieldList)
|
||||
if (recordsFieldList) {
|
||||
|
||||
res.data.recordsFieldList.forEach((item: any) => {
|
||||
recordsFieldList.forEach((item: any) => {
|
||||
let comp = {
|
||||
id: item.field_key,
|
||||
componentName: item.field_type,
|
||||
pageStyle: '',
|
||||
viewFormDetail: true, // 查看表单详情标识
|
||||
componentIsShow: true,
|
||||
field: {
|
||||
name: item.field_name,
|
||||
value: item.handle_field_value,
|
||||
@ -47,7 +49,7 @@ onMounted(() => {
|
||||
diyFormData.value.push(comp);
|
||||
})
|
||||
}
|
||||
emits('callback', res.data.recordsFieldList)
|
||||
emits('callback', recordsFieldList)
|
||||
loading.value = false;
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
|
||||
@ -1,8 +1,20 @@
|
||||
<template>
|
||||
<view :style="themeColor()">
|
||||
<!-- 自定义组件渲染 -->
|
||||
<view v-show="requestData.status == 1 && !diy.getLoading()" class="diy-template-wrap">
|
||||
<diy-group ref="diyGroupRef" :data="diyFormData" />
|
||||
<view v-show="requestData.status == 1 && requestData.error && requestData.error.length === 0 && !diy.getLoading()" class="diy-template-wrap">
|
||||
<diy-group ref="diyGroupRef" :data="diyFormData"/>
|
||||
</view>
|
||||
<view class="flex flex-col" v-if="requestData.error && requestData.error.length > 0">
|
||||
<view class="flex-1 flex flex-col items-center pt-[20rpx]" v-for="(item, index) in requestData.error.slice(0, 1)" :key="index">
|
||||
<text class="nc-iconfont nc-icon-tanhaoV6mm text-[#ccc] mb-[30rpx] !text-[100rpx]"></text>
|
||||
<view class="text-[38rpx] font-bold mt-3">{{ item.title }}</view>
|
||||
<view class="p-[30rpx] mt-[20rpx] w-full">
|
||||
<view class="flex w-full">
|
||||
<view class="w-[30%] text-[#999] text-left">{{ item.type }}</view>
|
||||
<view class="w-[70%] text-left">{{ item.desc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -30,12 +42,12 @@ const diyFormData: any = reactive({})
|
||||
onMounted(() => {
|
||||
diy.getData(() => {
|
||||
diyFormData.status = diy.data.status;
|
||||
if (diyFormData.status) {
|
||||
if (diyFormData.status && requestData.value.error.length == 0) {
|
||||
diyFormData.title = diy.data.title;
|
||||
diyFormData.global = diy.data.global;
|
||||
if (diyFormData.global) {
|
||||
diyFormData.global.topStatusBar.isShow = false; // 顶部导航栏强制隐藏
|
||||
diyFormData.global.bottomTabBarSwitch = false; // 底部导航强制隐藏
|
||||
diyFormData.global.bottomTabBar.isShow = false; // 底部导航强制隐藏
|
||||
}
|
||||
let value: any = [];
|
||||
if (props.form_border == 'none') {
|
||||
@ -47,7 +59,7 @@ onMounted(() => {
|
||||
value.push(item);
|
||||
}
|
||||
})
|
||||
diyFormData.value = value;
|
||||
diyFormData.value = deepClone(value);
|
||||
diyFormData.componentRefs = null;
|
||||
diyGroupRef.value?.refresh();
|
||||
watchFormData();
|
||||
@ -95,6 +107,7 @@ const watchFormData = () => {
|
||||
const verify = () => {
|
||||
if (!diyFormData.status) return true;
|
||||
if (!diyFormData.value) return true;
|
||||
if (!requestData.value || requestData.value.error?.length > 0) return true;
|
||||
let allPass = true; // 是否全部通过验证
|
||||
|
||||
let componentRefs = diyGroupRef.value.getFormRef().componentRefs;
|
||||
|
||||
@ -3,125 +3,129 @@
|
||||
<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" />
|
||||
<view v-for="(component, index) in data.value" :key="component.id"
|
||||
@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' }">
|
||||
<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' }">
|
||||
|
||||
<!-- 装修模式下,设置负上边距后超出的内容,禁止选中设置 -->
|
||||
<view v-if="diyGroup.isShowPlaceHolder(index,component)" class="absolute w-full z-1"
|
||||
:style="{ height : (component.margin.top * 2 * -1) + 'rpx' }"
|
||||
@click.stop="diyGroup.placeholderEvent"></view>
|
||||
<!-- 装修模式下,设置负上边距后超出的内容,禁止选中设置 -->
|
||||
<view v-if="diyGroup.isShowPlaceHolder(index,component)" class="absolute w-full z-1"
|
||||
:style="{ height : (component.margin.top * 2 * -1) + 'rpx' }"
|
||||
@click.stop="diyGroup.placeholderEvent"></view>
|
||||
|
||||
<template v-if="component.componentName == 'GraphicNav'">
|
||||
<diy-graphic-nav :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HorzBlank'">
|
||||
<diy-horz-blank :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HorzLine'">
|
||||
<diy-horz-line :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HotArea'">
|
||||
<diy-hot-area :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ImageAds'">
|
||||
<diy-image-ads :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'MemberInfo'">
|
||||
<diy-member-info :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'MemberLevel'">
|
||||
<diy-member-level :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Notice'">
|
||||
<diy-notice :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'RubikCube'">
|
||||
<diy-rubik-cube :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Text'">
|
||||
<diy-text :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'RichText'">
|
||||
<diy-rich-text :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ActiveCube'">
|
||||
<diy-active-cube :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FloatBtn'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'PictureShow'">
|
||||
<diy-picture-show :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormSubmit'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTextarea'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormEmail'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormWechatName'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormRadio'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTable'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormDateScope'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTimeScope'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormAddress'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormVideo'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'GraphicNav'">
|
||||
<diy-graphic-nav :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HorzBlank'">
|
||||
<diy-horz-blank :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HorzLine'">
|
||||
<diy-horz-line :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'HotArea'">
|
||||
<diy-hot-area :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ImageAds'">
|
||||
<diy-image-ads :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'MemberInfo'">
|
||||
<diy-member-info :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'MemberLevel'">
|
||||
<diy-member-level :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Notice'">
|
||||
<diy-notice :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'RubikCube'">
|
||||
<diy-rubik-cube :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'Text'">
|
||||
<diy-text :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'RichText'">
|
||||
<diy-rich-text :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'ActiveCube'">
|
||||
<diy-active-cube :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FloatBtn'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'PictureShow'">
|
||||
<diy-picture-show :component="component" :global="data.global" :index="index" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormSubmit'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTextarea'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormEmail'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormWechatName'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormRadio'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTable'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormDateScope'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormTimeScope'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormAddress'">
|
||||
<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" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'FormVideo'">
|
||||
<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" />
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="diyStore.mode == '' && data.global && data.global.bottomTabBarSwitch">
|
||||
</template>
|
||||
<template v-if="diyStore.mode == '' && data.global && data.global.bottomTabBar && data.global.bottomTabBar.isShow">
|
||||
<view class="pt-[20rpx]"></view>
|
||||
<tabbar />
|
||||
</template>
|
||||
@ -130,7 +134,6 @@
|
||||
<script lang="ts" setup>
|
||||
import topTabbar from '@/components/top-tabbar/top-tabbar.vue'
|
||||
import popAds from '@/components/pop-ads/pop-ads.vue'
|
||||
|
||||
import { useDiyGroup } from './useDiyGroup'
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
|
||||
@ -67,7 +67,7 @@ export function useDiyGroup(params: any = {}) {
|
||||
onMounted(() => {
|
||||
// #ifdef H5
|
||||
if (diyStore.mode == 'decorate') {
|
||||
var el: any = document.getElementById('componentList');
|
||||
const el: any = document.getElementById('componentList');
|
||||
const sortable = Sortable.create(el, {
|
||||
draggable: '.draggable-element',
|
||||
animation: 200,
|
||||
@ -91,7 +91,6 @@ export function useDiyGroup(params: any = {}) {
|
||||
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
|
||||
// 初始化组件滚动值
|
||||
scrollVal = uni.getStorageSync('componentsScrollValGroup');
|
||||
if (scrollVal) {
|
||||
|
||||
@ -90,6 +90,13 @@ export function updateWechatOpenid(data: AnyObject) {
|
||||
return request.put('wechat/update_openid', data, { showErrorMessage: false })
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信公众号号修改openid
|
||||
*/
|
||||
export function updateWechatOpenidByH5(data: AnyObject) {
|
||||
return request.put('wechat/update_openid_h5', data, { showErrorMessage: false })
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序授权登录
|
||||
*/
|
||||
|
||||
@ -150,4 +150,11 @@ export function getMsgJumpPath(params: Record<string, any>) {
|
||||
*/
|
||||
export function getInitInfo(params: Record<string, any>) {
|
||||
return request.get('init', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否绑定手机号
|
||||
*/
|
||||
export function getMemberMobileExist(params: Record<string, any>) {
|
||||
return request.get('member_mobile_exist', params)
|
||||
}
|
||||
@ -146,7 +146,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -168,7 +168,7 @@ const warpCss = computed(() => {
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += 'position:absolute;top:0;width:100%;';
|
||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||
@ -213,7 +213,7 @@ const setItemStyle4 = () => {
|
||||
|
||||
// 公共模块颜色
|
||||
const commonTempCss = (data: any) => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (data.listFrame.startColor && data.listFrame.endColor) {
|
||||
style += `background:linear-gradient(${ data.listFrame.startColor },${ data.listFrame.endColor });`;
|
||||
} else {
|
||||
@ -228,7 +228,7 @@ const commonTempCss = (data: any) => {
|
||||
}
|
||||
|
||||
const btnCss = (item: any) => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += `background:linear-gradient(90deg,${ item.startColor },${ item.endColor });`;
|
||||
return style;
|
||||
};
|
||||
|
||||
@ -11,10 +11,11 @@
|
||||
</view>
|
||||
<view class="fixed-wrap" :style="fixedStyle">
|
||||
<view v-if="diyComponent.search.style == 'style-1'" class="diy-search-wrap relative z-10"
|
||||
@click="diyStore.toRedirect(diyComponent.search.link)" :style="navbarInnerStyle">
|
||||
<view class="img-wrap" v-if="diyComponent.search.logo">
|
||||
@click="diyStore.toRedirect(diyComponent.search.link)" :style="!props.global.topStatusBar.isShow ? navbarInnerStyle : ''">
|
||||
<!-- <view class="img-wrap" v-if="diyComponent.search.logo">
|
||||
<image :src="img(diyComponent.search.logo)" mode="aspectFit" />
|
||||
</view>
|
||||
</view> -->
|
||||
<image :src="img(diyComponent.search.logo)" v-if="diyComponent.search.logo" mode="aspectFit" class="max-h-[60rpx] w-[152rpx] mr-[20rpx]" />
|
||||
<view class="search-content" :style="{backgroundColor: diyComponent.search.bgColor }" @click.stop="diyStore.toRedirect(diyComponent.search.link)">
|
||||
<text class="input-content text-[#fff] text-[24rpx] leading-[68rpx]" :style="{color: diyComponent.search.color }">{{ isShowSearchPlaceholder ? diyComponent.search.text : '' }}</text>
|
||||
<text class="nc-iconfont nc-icon-sousuo-duanV6xx1 w-[80rpx] h-[52rpx] flex items-center justify-center rounded-[50rpx] text-[28rpx] text-[#fff]"
|
||||
@ -27,8 +28,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="diyComponent.search.style == 'style-2'" class="diy-search-wrap style-2 relative z-10" @click="diyStore.toRedirect(diyComponent.search.link)">
|
||||
<view class="flex items-center" :style="navbarInnerStyle">
|
||||
<view class="img-wrap" v-if="diyComponent.search.logo"><image :src="img(diyComponent.search.logo)" mode="aspectFit" /></view>
|
||||
<view class="flex items-center" :style="!props.global.topStatusBar.isShow ? navbarInnerStyle : ''">
|
||||
<!-- <view class="img-wrap" v-if="diyComponent.search.logo"><image :src="img(diyComponent.search.logo)" mode="aspectFit" /></view> -->
|
||||
<image :src="img(diyComponent.search.logo)" v-if="diyComponent.search.logo" mode="aspectFit" class="max-h-[60rpx] w-[152rpx] mr-[10rpx]" />
|
||||
<view :style="searchSubTitleCss" class="max-w-[360rpx] text-[24rpx] h-[38rpx] rounded-r-[20rpx] rounded-t-[20rpx] rounded-bl-[2rpx]" v-if="diyComponent.search.subTitle.text">
|
||||
<view class="truncate leading-[38rpx] h-[38rpx] px-[12rpx]">{{ diyComponent.search.subTitle.text }}</view>
|
||||
</view>
|
||||
@ -124,7 +126,7 @@
|
||||
|
||||
<!-- 分类展开 -->
|
||||
<u-popup :safeAreaInsetTop="true" :show="tabAllPopup" mode="top" @close="tabAllPopup = false">
|
||||
<view class="text-sm px-[30rpx] pt-3" :style="{'padding-top':(menuButtonInfo.top+'px')}">全部分类</view>
|
||||
<view class="text-sm px-[30rpx] pt-3" :style="{'padding-top':(systemStore.menuButtonInfo.top+'px')}">全部分类</view>
|
||||
<view class="flex flex-wrap pl-[30rpx] pt-[30rpx]">
|
||||
<view @click="changeData({ source : 'home' },-1)" :class="['px-[26rpx] border-[2rpx] border-solid border-transparent h-[60rpx] mr-[30rpx] mb-[30rpx] flex items-center justify-center bg-[#F4F4F4] rounded-[8rpx] text-xs', { 'tab-select-popup': currTabIndex == -1 }]">首页</view>
|
||||
<text @click="changeData(item,index)" v-for="(item, index) in diyComponent.tab.list" :key="index" :class="['px-[26rpx] border-[2rpx] border-solid border-transparent h-[60rpx] mr-[30rpx] mb-[30rpx] flex items-center justify-center bg-[#F4F4F4] rounded-[8rpx] text-xs', { 'tab-select-popup': index == currTabIndex }]">{{ item.text }}</text>
|
||||
@ -155,8 +157,6 @@ import { useLocation } from '@/hooks/useLocation'
|
||||
import useSystemStore from '@/stores/system';
|
||||
|
||||
const systemStore = useSystemStore();
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
const props = defineProps(['component', 'index', 'global', 'scrollBool']);
|
||||
const diyStore = useDiyStore();
|
||||
@ -180,7 +180,7 @@ locationVal.init();
|
||||
/************** 定位-end ****************/
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -210,7 +210,7 @@ const setModuleLocation = () => {
|
||||
|
||||
const fixedStyleBg = ref(false);
|
||||
const fixedStyle = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
||||
style += 'position: absolute;z-index: 99;left: 0;right: 0;';
|
||||
}
|
||||
@ -221,7 +221,7 @@ const fixedStyle = computed(() => {
|
||||
}
|
||||
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
||||
// h5,上移的像素,采取的是平均值
|
||||
if (systemInfo.platform === 'ios') {
|
||||
if (systemStore.systemInfo.platform === 'ios') {
|
||||
style += 'top: 55px;';
|
||||
} else {
|
||||
style += 'top: 44.5px;';
|
||||
@ -236,14 +236,12 @@ const fixedStyle = computed(() => {
|
||||
style += 'position: fixed;z-index: 99;top: 0;left: 0;right: 0;';
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
if (props.global.topStatusBar.isShow) {
|
||||
style += 'top:' + diyStore.topTabarHeight + 'px;';
|
||||
}
|
||||
// #endif
|
||||
|
||||
if (props.scrollBool == 1 || props.scrollBool == 2) {
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
if (props.global.topStatusBar.isShow) {
|
||||
style += 'top:' + diyStore.topTabarHeight + 'px;';
|
||||
}
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
if (props.global.topStatusBar.isShow && props.global.topStatusBar.style == 'style-4') {
|
||||
style += 'top:' + diyStore.topTabarHeight + 'px;';
|
||||
@ -273,7 +271,7 @@ const carouselSwiperStyle = () => {
|
||||
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
||||
// #ifdef H5
|
||||
// h5,上移的像素,采取的是平均值
|
||||
if (systemInfo.platform === 'ios') {
|
||||
if (systemStore.systemInfo.platform === 'ios') {
|
||||
style = 'margin-top: -55px;';
|
||||
} else {
|
||||
style = 'margin-top: -44.5px;';
|
||||
@ -314,7 +312,7 @@ const isShowSearchPlaceholder = computed(() => {
|
||||
|
||||
// 背景渐变
|
||||
const bgImgBoxStyle = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
let str = props.global.pageStartBgColor ? props.global.pageStartBgColor : 'rgba(255,255,255,1)';
|
||||
if (str.indexOf('(') > -1) {
|
||||
let arr = str.split('(')[1].split(')')[0].split(',');
|
||||
@ -329,7 +327,7 @@ const bgImgBoxStyle = computed(() => {
|
||||
|
||||
// 轮播样式二
|
||||
const swiperStyleBool = computed(() => {
|
||||
var style = diyComponent.value.swiper.swiperStyle == 'style-2' || diyComponent.value.swiper.swiperStyle == 'style-3' ? true : false;
|
||||
const style = diyComponent.value.swiper.swiperStyle == 'style-2' || diyComponent.value.swiper.swiperStyle == 'style-3' ? true : false;
|
||||
return style;
|
||||
})
|
||||
|
||||
@ -344,7 +342,7 @@ const swiperChange = e => {
|
||||
};
|
||||
|
||||
const swiperWarpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.swiper.topRounded) style += 'border-top-left-radius:' + diyComponent.value.swiper.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.swiper.topRounded) style += 'border-top-right-radius:' + diyComponent.value.swiper.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.swiper.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.swiper.bottomRounded * 2 + 'rpx;';
|
||||
@ -353,7 +351,7 @@ const swiperWarpCss = computed(() => {
|
||||
})
|
||||
|
||||
const searchSubTitleCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.search.subTitle.textColor) style += 'color:' + diyComponent.value.search.subTitle.textColor + ';';
|
||||
if (diyComponent.value.search.subTitle.startColor && diyComponent.value.search.subTitle.endColor) style += `background:linear-gradient(${ diyComponent.value.search.subTitle.startColor }, ${ diyComponent.value.search.subTitle.endColor });`;
|
||||
else style += 'background-color:' + (diyComponent.value.search.subTitle.startColor || diyComponent.value.search.subTitle.endColor) + ';';
|
||||
@ -383,15 +381,13 @@ const changeData = (item: any, index: any) => {
|
||||
}
|
||||
|
||||
const tabAllPopup = ref(false);
|
||||
let menuButtonInfo: any = {};
|
||||
const navbarInnerStyle = ref('')
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// 导航栏内部盒子的样式
|
||||
// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
|
||||
// 如果是各家小程序,导航栏内部的宽度需要减少右边胶囊的宽度
|
||||
navbarInnerStyle.value += 'padding-top:' + menuButtonInfo.top + 'px;';
|
||||
navbarInnerStyle.value += 'padding-top:' + systemStore.menuButtonInfo.top + 'px;';
|
||||
// #endif
|
||||
onMounted(() => {
|
||||
refresh();
|
||||
@ -418,14 +414,14 @@ onMounted(() => {
|
||||
if (diyComponent.value.positionWay == 'fixed') {
|
||||
if (props.global.topStatusBar.isShow == false) {
|
||||
navbarInnerStyle.value = ''
|
||||
let rightButtonWidth = menuButtonInfo.width ? menuButtonInfo.width * 2 + 'rpx' : '70rpx';
|
||||
let rightButtonWidth = systemStore.menuButtonInfo.width ? systemStore.menuButtonInfo.width * 2 + 'rpx' : '70rpx';
|
||||
navbarInnerStyle.value += 'padding-right:calc(' + rightButtonWidth + ' + 30rpx);';
|
||||
navbarInnerStyle.value += 'padding-top:' + menuButtonInfo.top + 'px;';
|
||||
navbarInnerStyle.value += 'padding-top:' + systemStore.menuButtonInfo.top + 'px;';
|
||||
} else if (props.global.topStatusBar) {
|
||||
navbarInnerStyle.value = ''
|
||||
}
|
||||
} else {
|
||||
let rightButtonWidth = menuButtonInfo.width ? menuButtonInfo.width * 2 + 'rpx' : '70rpx';
|
||||
let rightButtonWidth = systemStore.menuButtonInfo.width ? systemStore.menuButtonInfo.width * 2 + 'rpx' : '70rpx';
|
||||
navbarInnerStyle.value += 'padding-right:calc(' + rightButtonWidth + ' + 30rpx);';
|
||||
}
|
||||
// #endif
|
||||
@ -471,7 +467,7 @@ const getDiyInfoFn = (id: any) => {
|
||||
let sources = JSON.parse(data.value);
|
||||
diyPageData.global = sources.global;
|
||||
diyPageData.global.topStatusBar.isShow = false; // 子页面不需要展示顶部导航栏
|
||||
diyPageData.global.bottomTabBarSwitch = false; // 子页面不需要展示底部导航
|
||||
diyPageData.global.bottomTabBar.isShow = false; // 子页面不需要展示底部导航
|
||||
diyPageData.value = sources.value;
|
||||
|
||||
diyPageData.value.forEach((item: any, index) => {
|
||||
@ -811,8 +807,7 @@ if (componentsScrollVal && (typeof componentsScrollVal == "object")) {
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-radius: 6rpx;
|
||||
margin: 0;
|
||||
margin-right: 14rpx;
|
||||
margin: 0 14rpx 0 0;
|
||||
|
||||
&.last-of-type {
|
||||
margin-right: 0;
|
||||
|
||||
@ -45,7 +45,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -59,7 +59,7 @@ const warpCss = computed(() => {
|
||||
})
|
||||
|
||||
const floatBtnItemCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'width:' + diyComponent.value.imageSize * 2 + 'rpx;';
|
||||
style += 'height:' + diyComponent.value.imageSize * 2 + 'rpx;';
|
||||
style += 'border-radius:' + diyComponent.value.aroundRadius * 2 + 'rpx;';
|
||||
@ -92,7 +92,7 @@ const floatBtnWrapCss = computed(() => {
|
||||
const styleTwoRepeat = ref(true)
|
||||
const styleTwoRepeatTime: any = ref(null)
|
||||
const styleTwoWarpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -107,7 +107,7 @@ const styleTwoWarpCss = computed(() => {
|
||||
})
|
||||
|
||||
const styleTwoSphere = computed(() => {
|
||||
var style = 'transition: right .25s;background: rgba(0, 0, 0, 0.5);';
|
||||
let style = 'transition: right .25s;background: rgba(0, 0, 0, 0.5);';
|
||||
style += styleTwoRepeat.value ? '' : 'right:-32rpx !important;transition-delay: 0.25s;';
|
||||
return style
|
||||
})
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if(diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||
|
||||
@ -138,7 +138,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// 表单 多选项组件
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { ref, computed, watch, onMounted, nextTick } from 'vue';
|
||||
import { img } from '@/utils/common';
|
||||
import { t } from '@/locale'
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
@ -206,7 +206,7 @@ const eventFn = (type: any) => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -237,17 +237,24 @@ onMounted(() => {
|
||||
}
|
||||
)
|
||||
} else {
|
||||
}
|
||||
if (diyComponent.value.style == 'style-3') {
|
||||
pullDownVal.value = diyComponent.value.field.value.map(item => item.id);
|
||||
}
|
||||
if (diyComponent.value.field.value.length > 0) {
|
||||
selectValue.value = diyComponent.value.field.value.map(item => item.id);
|
||||
watch(
|
||||
() => diyComponent.value.field.value,
|
||||
(newValue, oldValue) => {
|
||||
refresh();
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
const refresh = () => {
|
||||
// console.log('diyComponent.value.field.value',diyComponent.value.field.value)
|
||||
nextTick(()=>{
|
||||
if (diyComponent.value.style == 'style-3') {
|
||||
pullDownVal.value = diyComponent.value.field.value.map(item => item.id);
|
||||
}
|
||||
if (diyComponent.value.field.value?.length) {
|
||||
selectValue.value = diyComponent.value.field.value.map(item => item.id);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const checkboxPlaceholder = computed(() => {
|
||||
|
||||
@ -196,7 +196,7 @@ const defaultDate = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -132,7 +132,7 @@ const eventFn = (type: any) => {
|
||||
|
||||
// 日期
|
||||
const startDate = computed(() => {
|
||||
var date = '';
|
||||
let date = '';
|
||||
if (diyComponent.value.field.value.date) {
|
||||
let timestamp = diyComponent.value.field.value.timestamp;
|
||||
date = getDateFn(timestamp);
|
||||
@ -158,7 +158,7 @@ const startDate = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -130,7 +130,7 @@ const eventFn = (type: any) => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if(diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||
|
||||
@ -158,7 +158,7 @@ const viewPrivacy = () => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -207,7 +207,7 @@ onUnload(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
|
||||
@ -128,7 +128,7 @@ const eventFn = (type: any) => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -77,10 +77,8 @@
|
||||
import { img } from '@/utils/common';
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
import useSystemStore from '@/stores/system';
|
||||
|
||||
const errorInfo: any = ref(null);
|
||||
const systemStore = useSystemStore();
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const props = defineProps(['component', 'index', 'global']);
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
@ -108,8 +106,8 @@
|
||||
/************** 定位-end ****************/
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
style += 'position:relative;';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -157,7 +157,7 @@ const viewPrivacy = () => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -134,7 +134,7 @@ const eventFn = (type: any) => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<view class="detail-two-content">
|
||||
<text class="detail-two-content-label">{{ diyComponent.field.name }}</text>
|
||||
<view class="flex items-center justify-end">
|
||||
<view class="detail-two-content-value w-[80%]" v-for="(item,index) in diyComponent.field.value" :key="index">{{ item.text }}</view>
|
||||
<view class="detail-two-content-value" v-for="(item,index) in diyComponent.field.value" :key="index">{{ item.text }}</view>
|
||||
<text v-if="!diyComponent.field.value || !diyComponent.field.value.length">{{ t('notHave') }}</text>
|
||||
<text v-if="diyComponent.isShowArrow" class="iconfont iconfanhui1 text-[#888] !text-[20rpx] ml-[10rpx]"></text>
|
||||
</view>
|
||||
@ -123,7 +123,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// 表单 单选项组件
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { ref, computed, watch, onMounted, nextTick } from 'vue';
|
||||
import { img } from '@/utils/common';
|
||||
import { t } from '@/locale'
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
@ -192,7 +192,7 @@ const eventFn = (type: any) => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -222,20 +222,27 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 样式三,初始化下拉数据
|
||||
if (diyComponent.value.style == 'style-3' && diyComponent.value.field.value.length > 0) {
|
||||
pullDownVal.value = diyComponent.value.field.value[0].id;
|
||||
}
|
||||
if (diyComponent.value.field.value.length > 0) {
|
||||
selectedRadioId.value = diyComponent.value.field.value[0].id;
|
||||
}else{
|
||||
watch(
|
||||
() => diyComponent.value.field.value,
|
||||
(newValue, oldValue) => {
|
||||
refresh();
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
const refresh = () => {
|
||||
// console.log('diyComponent.value.field.value',diyComponent.value.field.value)
|
||||
nextTick(() => {
|
||||
// 样式三,初始化下拉数据
|
||||
if (diyComponent.value.style == 'style-3' && diyComponent.value.field.value.length > 0) {
|
||||
pullDownVal.value = diyComponent.value.field.value[0].id;
|
||||
}
|
||||
if (diyComponent.value.field.value.length > 0) {
|
||||
selectedRadioId.value = diyComponent.value.field.value[0].id;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const radioPlaceholder = computed(() => {
|
||||
@ -271,7 +278,7 @@ const pullDownCancelFn = () => {
|
||||
const pullDownConfirmFn = (item: any) => {
|
||||
selectShow.value = false;
|
||||
pullDownVal.value = item.id;
|
||||
;
|
||||
|
||||
diyComponent.value.field.value = [{ id: item.id, text: item.text }];
|
||||
// diyComponent.value.field.value = pullDownVal.value;
|
||||
}
|
||||
@ -311,7 +318,7 @@ const selectRadio = (item) => {
|
||||
return;
|
||||
}
|
||||
selectedRadioId.value = item.id;
|
||||
;
|
||||
|
||||
diyComponent.value.field.value = [{ id: item.id, text: item.text }];
|
||||
};
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ const diyGlobal = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -60,10 +60,10 @@ const warpCss = computed(() => {
|
||||
|
||||
if (diyStore.mode != 'decorate' && diyComponent.value.btnPosition == 'hover_screen_bottom') {
|
||||
style += "position: fixed !important;";
|
||||
var height = tabbarInfo.value ? tabbarInfo.value.height : 0;
|
||||
const height = tabbarInfo.value ? tabbarInfo.value.height : 0;
|
||||
style += `left: 0;`;
|
||||
style += `right: 0;`;
|
||||
if (height && diyGlobal.value.bottomTabBarSwitch) {
|
||||
if (height && diyGlobal.value.bottomTabBar && diyGlobal.value.bottomTabBar.isShow) {
|
||||
style += `bottom: ${ height }px;`;
|
||||
} else {
|
||||
style += `bottom: 0;`;
|
||||
@ -79,7 +79,7 @@ const warpCss = computed(() => {
|
||||
if (diyComponent.value.margin.top > 0) {
|
||||
style += 'padding-top:' + diyComponent.value.margin.top * 2 + 'rpx' + ';';
|
||||
}
|
||||
if (height && diyGlobal.value.bottomTabBarSwitch) {
|
||||
if (height && diyGlobal.value.bottomTabBar && diyGlobal.value.bottomTabBar.isShow) {
|
||||
style += 'padding-bottom:' + diyComponent.value.margin.bottom * 2 + 'rpx' + ';';
|
||||
} else {
|
||||
style += `padding-bottom: ${ (diyComponent.value.margin.bottom + iphoneSecureVal.value) * 2 }rpx;`;
|
||||
@ -100,7 +100,7 @@ const warpCss = computed(() => {
|
||||
})
|
||||
|
||||
const boxCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
|
||||
if (diyComponent.value.btnPosition == 'hover_screen_bottom') {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -112,7 +112,7 @@ const boxCss = computed(() => {
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += 'position:absolute;top:0;right:0;left:0;bottom:0;';
|
||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||
@ -128,7 +128,7 @@ const maskLayer = computed(() => {
|
||||
|
||||
// 重置样式
|
||||
const resetItem = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += `color: ${ diyComponent.value.resetBtn.color };`;
|
||||
style += `background-color: ${ diyComponent.value.resetBtn.bgColor };`;
|
||||
if (diyComponent.value.topElementRounded) style += 'border-top-left-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
|
||||
@ -140,7 +140,7 @@ const resetItem = computed(() => {
|
||||
|
||||
// 保存样式
|
||||
const submitItem = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += `color: ${ diyComponent.value.submitBtn.color };`;
|
||||
style += `background-color: ${ diyComponent.value.submitBtn.bgColor };`;
|
||||
if (diyComponent.value.topElementRounded) style += 'border-top-left-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
|
||||
|
||||
@ -136,7 +136,7 @@ const eventFn = (type: any) => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -197,7 +197,7 @@ const endTime = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -117,7 +117,7 @@ const eventFn = (type: any) => {
|
||||
|
||||
// 开始时间
|
||||
const startTime = computed(() => {
|
||||
var time = '';
|
||||
let time = '';
|
||||
if (diyComponent.value.field.value) {
|
||||
time = diyComponent.value.field.value;
|
||||
diyComponent.value.field.value = time;
|
||||
@ -138,7 +138,7 @@ const startTime = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -191,8 +191,8 @@
|
||||
return props.global;
|
||||
})
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
style += 'position:relative;';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if(diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||
|
||||
@ -158,7 +158,7 @@ const shouldShowIndicator = computed(() => {
|
||||
return totalItems > itemsPerPage // 如果总项数大于每页显示的项数,显示指示器
|
||||
})
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -179,7 +179,7 @@ const warpCss = computed(() => {
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += 'position:absolute;top:0;width:100%;';
|
||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||
@ -217,7 +217,7 @@ const swiperHeight = ref(uni.getStorageSync(storageKey) || '');
|
||||
|
||||
const handleData = () => {
|
||||
if (diyComponent.value.layout == 'horizontal' && diyComponent.value.showStyle == 'pageSlide') {
|
||||
var height = 0;
|
||||
let height = 0;
|
||||
const query = uni.createSelectorQuery().in(instance);
|
||||
query.select('.graphic-nav-item').boundingClientRect((data: any) => {
|
||||
let len = 1;
|
||||
|
||||
@ -20,7 +20,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'height:' + diyComponent.value.height * 2 + 'rpx;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
|
||||
@ -24,7 +24,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'border-top:' + (diyComponent.value.borderWidth * 2) + 'rpx ' + diyComponent.value.borderStyle + ' ' + diyComponent.value.borderColor + ';';
|
||||
return style;
|
||||
})
|
||||
|
||||
@ -31,7 +31,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -40,7 +40,7 @@ const warpCss = computed(() => {
|
||||
})
|
||||
|
||||
const itemCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'height:' + diyComponent.value.imgHeight + ';';
|
||||
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view :style="warpCss">
|
||||
<view class="diy-image-ads" :style="imageAdsTempStyle()">
|
||||
<view class="diy-image-ads" :style="imageAdsTempStyle">
|
||||
<view v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden" :style="swiperWarpCss">
|
||||
<view @click="diyStore.toRedirect(diyComponent.list[0].link)">
|
||||
<image v-if="diyComponent.list[0].imageUrl" :src="img(diyComponent.list[0].imageUrl)" :style="{height: imgHeight}" mode="heightFix" class="!w-full" :show-menu-by-longpress="true" />
|
||||
@ -24,12 +24,14 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
// 图片广告
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { ref, computed, watch, onMounted, onBeforeUnmount } from 'vue';
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
import { img } from '@/utils/common';
|
||||
import useSystemStore from "@/stores/system";
|
||||
import { nextTick } from 'process';
|
||||
|
||||
const props = defineProps(['component', 'index']);
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const systemStore = useSystemStore()
|
||||
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
@ -42,28 +44,23 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
// 兼容通屏样式
|
||||
const imageAdsTempStyle = () => {
|
||||
const imageAdsTempStyle = computed(() => {
|
||||
let style = "";
|
||||
if (diyComponent.value.isSameScreen && props.index == 0) {
|
||||
// #ifdef H5
|
||||
// h5,上移的像素,采取的是平均值
|
||||
if (systemInfo.platform === 'ios') {
|
||||
if (systemStore.systemInfo.platform === 'ios') {
|
||||
style = 'margin-top: -55px;';
|
||||
} else {
|
||||
style = 'margin-top: -44.5px;';
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
// 图文导航开启沉浸式且导航栏开启时,导航栏不占位
|
||||
uni.setStorageSync('imageAdsSameScreen', true);
|
||||
// #endif
|
||||
}
|
||||
return style;
|
||||
}
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -78,7 +75,7 @@ const warpCss = computed(() => {
|
||||
})
|
||||
|
||||
const swiperWarpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
|
||||
@ -111,6 +108,10 @@ onMounted(() => {
|
||||
}
|
||||
});
|
||||
|
||||
onBeforeUnmount(()=>{
|
||||
diyStore.imageAdsSameScreen = false;
|
||||
})
|
||||
|
||||
const refresh = () => {
|
||||
// 装修模式下设置默认图
|
||||
if (diyStore.mode == 'decorate') {
|
||||
@ -121,7 +122,12 @@ const refresh = () => {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.removeStorageSync('imageAdsSameScreen');
|
||||
// #ifdef MP
|
||||
if (diyComponent.value.isSameScreen && props.index == 0) {
|
||||
// 图文导航开启沉浸式且导航栏开启时,导航栏不占位
|
||||
diyStore.imageAdsSameScreen = true;
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -79,7 +79,7 @@ const diyComponent = computed(() => {
|
||||
}
|
||||
})
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -194,11 +194,6 @@ const clickAvatar = () => {
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -123,7 +123,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||
if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
|
||||
|
||||
@ -78,7 +78,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -99,7 +99,7 @@ const warpCss = computed(() => {
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += 'position:absolute;top:0;width:100%;';
|
||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||
|
||||
@ -55,7 +55,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||
@ -68,7 +68,7 @@ const warpCss = computed(() => {
|
||||
})
|
||||
|
||||
const moduleOneCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.moduleOne.listFrame) {
|
||||
if (diyComponent.value.moduleOne.listFrame.startColor && diyComponent.value.moduleOne.listFrame.endColor) style += `background:linear-gradient(${ diyComponent.value.moduleOne.listFrame.startColor },${ diyComponent.value.moduleOne.listFrame.endColor });`;
|
||||
}
|
||||
@ -84,7 +84,7 @@ const moduleOneCss = computed(() => {
|
||||
})
|
||||
|
||||
const moduleTwoCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.moduleTwo.listFrame) {
|
||||
if (diyComponent.value.moduleTwo.listFrame.startColor && diyComponent.value.moduleTwo.listFrame.endColor) style += `background:linear-gradient(${ diyComponent.value.moduleTwo.listFrame.startColor },${ diyComponent.value.moduleTwo.listFrame.endColor });`;
|
||||
}
|
||||
@ -99,7 +99,7 @@ const moduleTwoCss = computed(() => {
|
||||
})
|
||||
|
||||
const moduleBtnCss = (data: any) => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (data.btnTitle.color) {
|
||||
style += 'color:' + data.btnTitle.color + ';';
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ const diyComponent = computed(() => {
|
||||
})
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -72,7 +72,7 @@ const warpCss = computed(() => {
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += 'position:absolute;top:0;width:100%;';
|
||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||
|
||||
@ -72,6 +72,7 @@
|
||||
import { ref, onMounted, computed, watch, nextTick, getCurrentInstance } from 'vue';
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
import { img } from '@/utils/common';
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
const props = defineProps(['component', 'index']);
|
||||
|
||||
@ -85,6 +86,9 @@ const diyComponent = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const systemStore = useSystemStore()
|
||||
systemStore.systemInfo = uni.getSystemInfoSync();
|
||||
|
||||
/**
|
||||
* 处理rpx渲染之后变成rem存在小数的问题
|
||||
* @param rpx
|
||||
@ -94,7 +98,7 @@ const upx2px = (rpx: number) => {
|
||||
}
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -115,7 +119,7 @@ const warpCss = computed(() => {
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += 'position:absolute;top:0;width:100%;';
|
||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||
@ -131,11 +135,11 @@ const maskLayer = computed(() => {
|
||||
});
|
||||
|
||||
const countBorderRadius = (type: any, index: any) => {
|
||||
var obj = '';
|
||||
let obj = '';
|
||||
if (diyComponent.value.elementAngle == 'right') {
|
||||
return obj;
|
||||
}
|
||||
var defaultData: any = {
|
||||
const defaultData: any = {
|
||||
'row1-lt-of2-rt': [
|
||||
['border-top-right-radius', 'border-bottom-right-radius'],
|
||||
['border-top-left-radius', 'border-bottom-left-radius', 'border-bottom-right-radius'],
|
||||
@ -229,7 +233,7 @@ const refresh = () => {
|
||||
}
|
||||
|
||||
const handleData = () => {
|
||||
var singleRow: any = {
|
||||
const singleRow: any = {
|
||||
'row1-of2': {
|
||||
ratio: 2,
|
||||
width: 'calc((100% - ' + upx2px(diyComponent.value.imageGap * 2) + 'px) / 2)'
|
||||
@ -269,69 +273,60 @@ const handleData = () => {
|
||||
* 高度:宽度*比例,示例:187.5*0.46=86.25
|
||||
*/
|
||||
const calcSingleRow = (params: any) => {
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
let maxHeight = 0;
|
||||
let maxHeight = 0;
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
const ratio = item.imgHeight / item.imgWidth;
|
||||
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
var ratio = item.imgHeight / item.imgWidth;
|
||||
|
||||
let width = res.windowWidth - upx2px(diyComponent.value.margin.both * 2); // 减去左右间距
|
||||
if (diyComponent.value.imageGap > 0) {
|
||||
width -= upx2px(params.ratio * diyComponent.value.imageGap * 2); // 减去间隙
|
||||
}
|
||||
item.imgWidth = width / params.ratio;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
|
||||
if (maxHeight == 0 || maxHeight < item.imgHeight) maxHeight = item.imgHeight;
|
||||
})
|
||||
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.widthStyle = params.width;
|
||||
item.imgHeight = maxHeight;
|
||||
});
|
||||
let width = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 2); // 减去左右间距
|
||||
if (diyComponent.value.imageGap > 0) {
|
||||
width -= upx2px(params.ratio * diyComponent.value.imageGap * 2); // 减去间隙
|
||||
}
|
||||
item.imgWidth = width / params.ratio;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
|
||||
if (maxHeight == 0 || maxHeight < item.imgHeight) maxHeight = item.imgHeight;
|
||||
})
|
||||
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.widthStyle = params.width;
|
||||
item.imgHeight = maxHeight;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 魔方:四方型,各占50%
|
||||
*/
|
||||
const calcFourSquare = () => {
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
let maxHeightFirst = 0;
|
||||
let maxHeightTwo = 0;
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
var ratio = item.imgHeight / item.imgWidth;
|
||||
item.imgWidth = res.windowWidth;
|
||||
item.imgWidth -= upx2px(diyComponent.value.margin.both * 4);
|
||||
if (diyComponent.value.imageGap > 0) {
|
||||
item.imgWidth -= upx2px(diyComponent.value.imageGap * 2);
|
||||
}
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
let maxHeightFirst = 0;
|
||||
let maxHeightTwo = 0;
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
const ratio = item.imgHeight / item.imgWidth;
|
||||
item.imgWidth = systemStore.systemInfo.windowWidth;
|
||||
item.imgWidth -= upx2px(diyComponent.value.margin.both * 4);
|
||||
if (diyComponent.value.imageGap > 0) {
|
||||
item.imgWidth -= upx2px(diyComponent.value.imageGap * 2);
|
||||
}
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
|
||||
// 获取每行最大高度
|
||||
if (index <= 1) {
|
||||
if (maxHeightFirst == 0 || maxHeightFirst < item.imgHeight) {
|
||||
maxHeightFirst = item.imgHeight;
|
||||
}
|
||||
} else if (index > 1) {
|
||||
if (maxHeightTwo == 0 || maxHeightTwo < item.imgHeight) {
|
||||
maxHeightTwo = item.imgHeight;
|
||||
}
|
||||
}
|
||||
});
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.imgWidth = 'calc((100% - ' + upx2px(diyComponent.value.imageGap * 2) + 'px) / 2)';
|
||||
item.widthStyle = item.imgWidth;
|
||||
if (index <= 1) {
|
||||
item.imgHeight = maxHeightFirst;
|
||||
} else if (index > 1) {
|
||||
item.imgHeight = maxHeightTwo;
|
||||
}
|
||||
});
|
||||
// 获取每行最大高度
|
||||
if (index <= 1) {
|
||||
if (maxHeightFirst == 0 || maxHeightFirst < item.imgHeight) {
|
||||
maxHeightFirst = item.imgHeight;
|
||||
}
|
||||
} else if (index > 1) {
|
||||
if (maxHeightTwo == 0 || maxHeightTwo < item.imgHeight) {
|
||||
maxHeightTwo = item.imgHeight;
|
||||
}
|
||||
}
|
||||
});
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.imgWidth = 'calc((100% - ' + upx2px(diyComponent.value.imageGap * 2) + 'px) / 2)';
|
||||
item.widthStyle = item.imgWidth;
|
||||
if (index <= 1) {
|
||||
item.imgHeight = maxHeightFirst;
|
||||
} else if (index > 1) {
|
||||
item.imgHeight = maxHeightTwo;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -343,21 +338,17 @@ const calcRowOneLeftOfTwoRight = () => {
|
||||
let rightHeight = 0; // 右侧两图平分高度
|
||||
let divide = 'left'; // 划分规则,left:左,right:右
|
||||
if (diyComponent.value.list[1].imgWidth === diyComponent.value.list[2].imgWidth) divide = 'right';
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
if (index == 0) {
|
||||
var ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
rightHeight = (item.imgHeight - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
||||
item.imgWidth += 'px';
|
||||
} else {
|
||||
item.imgWidth = diyComponent.value.list[0].imgWidth;
|
||||
item.imgHeight = rightHeight;
|
||||
}
|
||||
});
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
if (index == 0) {
|
||||
const ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
rightHeight = (item.imgHeight - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
||||
item.imgWidth += 'px';
|
||||
} else {
|
||||
item.imgWidth = diyComponent.value.list[0].imgWidth;
|
||||
item.imgHeight = rightHeight;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -366,31 +357,27 @@ const calcRowOneLeftOfTwoRight = () => {
|
||||
* 魔方:1上2下
|
||||
*/
|
||||
const calcRowOneTopOfTwoBottom = () => {
|
||||
var maxHeight = 0;
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
let maxHeight = 0;
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
|
||||
var ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||
if (index == 0) {
|
||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4);
|
||||
} else if (index > 0) {
|
||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
}
|
||||
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
|
||||
// 获取最大高度
|
||||
if (index > 0 && (maxHeight == 0 || maxHeight < item.imgHeight)) maxHeight = item.imgHeight;
|
||||
|
||||
});
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.imgWidth += 'px';
|
||||
item.widthStyle = item.imgWidth;
|
||||
if (index > 0) item.imgHeight = maxHeight;
|
||||
});
|
||||
const ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||
if (index == 0) {
|
||||
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4);
|
||||
} else if (index > 0) {
|
||||
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
}
|
||||
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
|
||||
// 获取最大高度
|
||||
if (index > 0 && (maxHeight == 0 || maxHeight < item.imgHeight)) maxHeight = item.imgHeight;
|
||||
|
||||
});
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.imgWidth += 'px';
|
||||
item.widthStyle = item.imgWidth;
|
||||
if (index > 0) item.imgHeight = maxHeight;
|
||||
});
|
||||
}
|
||||
|
||||
@ -398,29 +385,25 @@ const calcRowOneTopOfTwoBottom = () => {
|
||||
* 魔方:1左3右
|
||||
*/
|
||||
const calcRowOneLeftOfOneTopOfTwoBottom = () => {
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
// 左图
|
||||
if (index == 0) {
|
||||
var ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
} else if (index == 1) {
|
||||
item.imgWidth = diyComponent.value.list[0].imgWidth;
|
||||
item.imgHeight = (diyComponent.value.list[0].imgHeight - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
||||
} else if (index > 1) {
|
||||
item.imgWidth = (diyComponent.value.list[0].imgWidth - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
||||
item.imgHeight = diyComponent.value.list[1].imgHeight;
|
||||
}
|
||||
});
|
||||
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.imgWidth += 'px';
|
||||
});
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
// 左图
|
||||
if (index == 0) {
|
||||
const ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||
item.imgWidth = item.imgWidth / 2;
|
||||
item.imgHeight = item.imgWidth * ratio;
|
||||
} else if (index == 1) {
|
||||
item.imgWidth = diyComponent.value.list[0].imgWidth;
|
||||
item.imgHeight = (diyComponent.value.list[0].imgHeight - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
||||
} else if (index > 1) {
|
||||
item.imgWidth = (diyComponent.value.list[0].imgWidth - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
||||
item.imgHeight = diyComponent.value.list[1].imgHeight;
|
||||
}
|
||||
});
|
||||
|
||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||
item.imgWidth += 'px';
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ const textStyle2 = computed(() => {
|
||||
});
|
||||
|
||||
const warpCss = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
style += 'position:relative;';
|
||||
if (diyComponent.value.componentStartBgColor) {
|
||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
||||
@ -82,7 +82,7 @@ const warpCss = computed(() => {
|
||||
|
||||
// 背景图加遮罩层
|
||||
const maskLayer = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (diyComponent.value.componentBgUrl) {
|
||||
style += 'position:absolute;top:0;width:100%;';
|
||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<!-- #endif -->
|
||||
<view class="mx-[60rpx]">
|
||||
<view class="pt-[140rpx] text-[50rpx] text-[#333]">{{ t('bindMobile') }}</view>
|
||||
<view class="text-[26rpx] leading-[39rpx] text-[var(--text-color-light6)] mt-[16rpx] mb-[80rpx]">{{ t('bindMobileTip') }}</view>
|
||||
<view class="text-[26rpx] leading-[39rpx] text-[var(--text-color-light6)] mt-[24rpx] mb-[90rpx]">{{ t('bindMobileTip') }}</view>
|
||||
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
|
||||
<view
|
||||
class="h-[90rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6]">
|
||||
@ -28,7 +28,7 @@
|
||||
</u-form>
|
||||
<view class="mt-[100rpx]">
|
||||
<view v-if="config.agreement_show" class="flex items-center mb-[20rpx] py-[10rpx]" @click.stop="agreeChange">
|
||||
<u-checkbox-group @change="agreeChange">
|
||||
<u-checkbox-group @change="agreeChange">
|
||||
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="24rpx" :customStyle="{ 'marginTop': '4rpx' }" />
|
||||
</u-checkbox-group>
|
||||
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap">
|
||||
@ -55,18 +55,15 @@ import { useLogin } from '@/hooks/useLogin'
|
||||
import { redirect, pxToRpx } from '@/utils/common'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const systemStore = useSystemStore()
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||
/********* 自定义头部 - end ***********/
|
||||
const headerHeight = computed(() => {
|
||||
return Object.keys(menuButtonInfo).length ? pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
return Object.keys(systemStore.menuButtonInfo).length ? pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
})
|
||||
|
||||
const memberStore = useMemberStore()
|
||||
|
||||
@ -16,9 +16,8 @@
|
||||
</view>
|
||||
<view v-else class="h-[90rpx] w-[300rpx]"></view>
|
||||
</view>
|
||||
<view class="text-[var(--text-color-light6)]] text-[28rpx] text-center leading-[34rpx] min-h-[34rpx] mt-[40rpx]">{{ loginConfig.desc }}</view>
|
||||
<view class="text-[var(--text-color-light6)]] text-[28rpx] text-center leading-[34rpx] min-h-[34rpx] mt-[40rpx]">{{ loginConfig.desc }}</view>
|
||||
<view class="mt-[181rpx]">
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<!-- 微信公众号快捷登录,开启自动注册的情况下才能使用 -->
|
||||
<view v-if="isWeixinBrowser() && loginConfig.is_auth_register" class="w-full flex items-center justify-center mb-[40rpx]">
|
||||
@ -77,9 +76,9 @@
|
||||
<view v-if="loginConfig.agreement_show" class="w-full flex items-center justify-center mt-[28rpx]">
|
||||
<view class="flex items-center justify-center mt-[28rpx] py-[14rpx] px-[50rpx]" @click.stop="agreeChange">
|
||||
<u-checkbox-group @change="agreeChange">
|
||||
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="30rpx" />
|
||||
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="24rpx" />
|
||||
</u-checkbox-group>
|
||||
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap leading-[30rpx]">
|
||||
<view class="text-[24rpx] -ml-[4rpx] text-[var(--text-color-light6)] flex items-center flex-wrap leading-[30rpx]">
|
||||
<text>{{ t('agreeTips') }}</text>
|
||||
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=privacy' })" class="text-primary">《{{ t('privacyAgreement') }}》</text>
|
||||
<text>{{ t('and') }}</text>
|
||||
@ -89,11 +88,10 @@
|
||||
</view>
|
||||
|
||||
<view class="footer w-full" v-if="loginConfig.is_mobile && loginConfig.is_username">
|
||||
<view class="text-[26rpx] leading-[36rpx] text-[333] text-center mb-[30rpx] font-400">{{ t('otherLogin') }}</view>
|
||||
<view class="text-[26rpx] leading-[36rpx] text-[#666] text-center mb-[30rpx] font-400">其他登录方式</view>
|
||||
<view class="flex justify-center">
|
||||
<view class="h-[80rpx] w-[80rpx] text-center leading-[78rpx] border-[2rpx] text-[#FF7100] rounded-[50%] border-solid border-[#ddd] nc-iconfont nc-icon-wodeV6mm3 text-[46rpx] overflow-hidden" @click="redirect({ url: '/app/pages/auth/login',param:{type:'username'}})"></view>
|
||||
<text @click="redirect({ url: '/app/pages/auth/login',param:{type:'username'}})" class="w-[66rpx] h-[66rpx] flex items-center justify-center iconfont iconmima6Vmm border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
|
||||
</view>
|
||||
<view class="text-[24rpx] leading-[36rpx] text-[var(--text-color-light9)] text-center font-400 mt-[30rpx]">{{ t('accountLogin') }}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -139,17 +137,13 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import useSystemStore from '@/stores/system'
|
||||
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const systemStore = useSystemStore()
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { textColor: '#333' } })
|
||||
/********* 自定义头部 - end ***********/
|
||||
const headerHeight = computed(() => {
|
||||
return Object.keys(menuButtonInfo).length ? pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
return Object.keys(systemStore.menuButtonInfo).length ? pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
})
|
||||
const wapMemberMobile = ref('');
|
||||
const isAgree = ref(false)
|
||||
@ -164,7 +158,6 @@ const memberStore = useMemberStore()
|
||||
const memberInfo: any = computed(() => {
|
||||
return useMemberStore().info;
|
||||
})
|
||||
const systemStore = useSystemStore()
|
||||
const openType: any = computed(() => {
|
||||
if (!isAgree.value && configStore.login.agreement_show) return '';
|
||||
return 'getPhoneNumber';
|
||||
@ -198,6 +191,7 @@ const bindMobileFn = () => {
|
||||
|
||||
onLoad(async() => {
|
||||
await systemStore.getSiteInfoFn()
|
||||
await systemStore.getMemberMobileExistFn()
|
||||
await configStore.getLoginConfig()
|
||||
let normalLogin = !configStore.login.is_username && !configStore.login.is_mobile && !configStore.login.is_bind_mobile; // 未开启普通登录
|
||||
|
||||
@ -230,10 +224,7 @@ onLoad(async() => {
|
||||
return;
|
||||
}
|
||||
|
||||
wapMemberMobile.value = uni.getStorageSync('wap_member_mobile');
|
||||
if (!wapMemberMobile.value) {
|
||||
wapMemberMobile.value = uni.getStorageSync('wap_member_not_control_mobile'); // 老用户不控制强制绑定手机号
|
||||
}
|
||||
wapMemberMobile.value = uni.getStorageSync('member_mobile_exist');
|
||||
|
||||
nextTick(() => {
|
||||
if (wxPrivacyPopupRef.value) wxPrivacyPopupRef.value.proactive();
|
||||
@ -247,7 +238,7 @@ onShow(() => {
|
||||
})
|
||||
|
||||
const warpStyle = computed(() => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (configStore.login.bg_url) {
|
||||
style += 'background-image:url(' + img(configStore.login.bg_url) + ');';
|
||||
style += 'background-size: 100%;';
|
||||
@ -276,11 +267,16 @@ const oneClickLogin = (callback: any = null, data: any = null) => {
|
||||
if (checkWxPrivacy()) return;
|
||||
|
||||
if (loginLoading.value) return
|
||||
uni.showLoading({
|
||||
title: '正在登录中',
|
||||
mask: true
|
||||
});
|
||||
loginLoading.value = true
|
||||
|
||||
|
||||
if (!callback) {
|
||||
callback = () => {
|
||||
loginLoading.value = false
|
||||
uni.hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@ -310,17 +306,27 @@ const wechatLogin = () => {
|
||||
}
|
||||
if (loginConfig.wechat_error) {
|
||||
loginLoading.value = false
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: loginConfig.wechat_error, icon: 'none' })
|
||||
return;
|
||||
}
|
||||
|
||||
wapMemberMobile.value = uni.getStorageSync('wap_member_mobile');
|
||||
if (!wapMemberMobile.value) {
|
||||
wapMemberMobile.value = uni.getStorageSync('wap_member_not_control_mobile'); // 老用户不控制强制绑定手机号
|
||||
}
|
||||
wapMemberMobile.value = uni.getStorageSync('member_mobile_exist');
|
||||
let member_exist = uni.getStorageSync('member_exist')
|
||||
|
||||
if (loginConfig.is_auth_register) {
|
||||
if(!wapMemberMobile.value && loginConfig.is_bind_mobile && !member_exist && loginConfig.is_force_access_user_info){
|
||||
// 先进行微信授权获取基础信息,然后绑定手机号
|
||||
if(uni.getStorageSync('openid') && uni.getStorageSync('nickname') && uni.getStorageSync('avatar')){
|
||||
bindMobileFn();
|
||||
uni.removeStorageSync('mandatory_Mobile')
|
||||
}else{
|
||||
uni.setStorageSync('mandatory_Mobile', true)
|
||||
login.getAuthCode({ scopes: 'snsapi_userinfo' })
|
||||
}
|
||||
}else
|
||||
// 开启强制绑定手机号,必须填写才能注册
|
||||
if (!wapMemberMobile.value && loginConfig.is_bind_mobile) {
|
||||
if (!wapMemberMobile.value && loginConfig.is_bind_mobile && !member_exist) {
|
||||
bindMobileFn();
|
||||
} else if (loginConfig.is_force_access_user_info) {
|
||||
// 开启强制获取用户信息
|
||||
@ -330,13 +336,14 @@ const wechatLogin = () => {
|
||||
login.getAuthCode({ scopes: 'snsapi_base' }) // 静默获取
|
||||
}
|
||||
}else{
|
||||
if (!wapMemberMobile.value && loginConfig.is_bind_mobile) {
|
||||
if (!wapMemberMobile.value && loginConfig.is_bind_mobile && !member_exist) {
|
||||
bindMobileFn();
|
||||
}else {
|
||||
login.getAuthCode({ scopes: 'snsapi_base' }) // 静默获取
|
||||
}
|
||||
}
|
||||
loginLoading.value = false
|
||||
uni.hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,6 +354,7 @@ const weappLogin = (successCallback: any, data: any) => {
|
||||
if (loginConfig.is_auth_register && loginConfig.is_force_access_user_info && !member_exist) {
|
||||
infoFill.value.show = true
|
||||
loginLoading.value = false
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
data = data || {};
|
||||
login.getAuthCode({ backFlag: true, successCallback, ...data })
|
||||
@ -366,6 +374,7 @@ const mobileAuth = (e: any) => {
|
||||
uni.setStorageSync('wap_member_mobile', memberInfo.value.mobile) // 存储会员手机号,防止重复请求微信获取手机号接口
|
||||
}
|
||||
loginLoading.value = false
|
||||
uni.hideLoading();
|
||||
}, { mobile_code: e.detail.code });
|
||||
}
|
||||
|
||||
@ -382,7 +391,10 @@ const mobileAuth = (e: any) => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
margin-top: 200rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding-bottom: calc(151rpx + constant(safe-area-inset-bottom));
|
||||
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="w-screen h-screen flex flex-col" :style="themeColor()" v-if="type">
|
||||
<view class="w-screen h-screen flex flex-col " :style="themeColor()" v-if="type">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view :style="{'height':headerHeight}">
|
||||
<top-tabbar :data="param" :scrollBool="topTabarObj.getScrollBool()" class="top-header" />
|
||||
@ -7,23 +7,26 @@
|
||||
<!-- #endif -->
|
||||
<view class="mx-[60rpx]">
|
||||
<view class="pt-[140rpx] text-[44rpx] font-500 text-[#333]">{{ type == 'username' ? t('accountLogin') : t('mobileLogin') }}</view>
|
||||
<view class="text-[26rpx] leading-[39rpx] text-[var(--text-color-light6)] mt-[16rpx] mb-[80rpx]">{{ type == 'username' ? t('accountLoginTip') : t('mobileLoginTip') }}</view>
|
||||
<view class="text-[26rpx] text-[#333] leading-[34rpx] mt-[24rpx] mb-[90rpx]" @click="redirect({ url: '/app/pages/auth/register',param:{type} })">
|
||||
<text>{{ t('noAccount') }},</text>
|
||||
<text class="text-primary">{{ t('toRegister') }}</text>
|
||||
</view>
|
||||
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
|
||||
<template v-if="type == 'username'">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6]">
|
||||
<u-form-item label="" prop="username" :border-bottom="false">
|
||||
<u-input v-model="formData.username" border="none" maxlength="40"
|
||||
:placeholder="t('usernamePlaceholder')" autocomplete="off" class="!bg-transparent"
|
||||
:disabled="real_name_input" fontSize="26rpx"
|
||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||
placeholderClass="!text-[var(--text-color-light6)] text-[26rpx]" />
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="password" :border-bottom="false">
|
||||
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
||||
:placeholder="t('passwordPlaceholder')" autocomplete="new-password"
|
||||
class="!bg-transparent" :disabled="real_name_input" fontSize="26rpx"
|
||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]">
|
||||
placeholderClass="!text-[var(--text-color-light6)] text-[26rpx]">
|
||||
<template #suffix>
|
||||
<view @click="changePassword" v-if="formData.password">
|
||||
<u-icon :name="isPassword?'eye-off':'eye-fill'" color="#b9b9b9" size="20"></u-icon>
|
||||
@ -34,20 +37,20 @@
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="type == 'mobile'">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6]">
|
||||
<u-form-item label="" prop="mobile" :border-bottom="false">
|
||||
<u-input v-model="formData.mobile" type="number" maxlength="11" border="none"
|
||||
:placeholder="t('mobilePlaceholder')" autocomplete="off" class="!bg-transparent"
|
||||
:disabled="real_name_input" fontSize="26rpx"
|
||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||
placeholderClass="!text-[var(--text-color-light6)] text-[26rpx]" />
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx] text-[26rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx] text-[26rpx]">
|
||||
<u-form-item label="" prop="mobile_code" :border-bottom="false">
|
||||
<u-input v-model="formData.mobile_code" type="number" maxlength="4" border="none"
|
||||
class="!bg-transparent" fontSize="26rpx" :disabled="real_name_input"
|
||||
:placeholder="t('codePlaceholder')"
|
||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]">
|
||||
placeholderClass="!text-[var(--text-color-light6)] text-[26rpx]">
|
||||
<template #suffix>
|
||||
<sms-code v-if="configStore.login.agreement_show" :mobile="formData.mobile" type="login" v-model="formData.mobile_key" :isAgree="isAgree"></sms-code>
|
||||
<sms-code v-else :mobile="formData.mobile" type="login" v-model="formData.mobile_key"></sms-code>
|
||||
@ -57,11 +60,12 @@
|
||||
</view>
|
||||
</template>
|
||||
</u-form>
|
||||
<view v-if="type == 'username'" class="text-right text-[24rpx] text-[var(--text-color-light9)] leading-[34rpx] mt-[20rpx]" @click="redirect({ url: '/app/pages/auth/resetpwd' })">{{ t('resetpwd') }}</view>
|
||||
<view :class="{'mt-[160rpx]':type != 'username','mt-[106rpx]':type == 'username'}">
|
||||
<view v-if="configStore.login.agreement_show" class="flex items-center mb-[20rpx] py-[14rpx]" @click.stop="agreeChange">
|
||||
<view class="h-[34rpx] text-right text-[24rpx] text-[var(--text-color-light6)] leading-[34rpx] mt-[20rpx] " @click="toResetpwd">{{ type == 'username' ? t('resetpwd') : '' }}</view>
|
||||
<view class="mt-[106rpx]">
|
||||
<button class="w-full h-[80rpx] !bg-[var(--primary-color)] text-[26rpx] rounded-[40rpx] leading-[80rpx] font-500 !text-[#fff] !mx-[0]" :loadingText="t('logining')" @click="handleLogin">{{ t('login') }}</button>
|
||||
<view v-if="configStore.login.agreement_show" class="flex items-center mt-[20rpx] py-[14rpx]" @click.stop="agreeChange">
|
||||
<u-checkbox-group @change="agreeChange">
|
||||
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="30rpx" />
|
||||
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="24rpx" />
|
||||
</u-checkbox-group>
|
||||
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap leading-[30rpx]">
|
||||
<text>{{ t('agreeTips') }}</text>
|
||||
@ -70,14 +74,6 @@
|
||||
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=service' })" class="text-primary">《{{ t('userAgreement') }}》</text>
|
||||
</view>
|
||||
</view>
|
||||
<button class="w-full h-[80rpx] !bg-[var(--primary-color)] text-[26rpx] rounded-[40rpx] leading-[80rpx] font-500 !text-[#fff] !mx-[0]" :loadingText="t('logining')" @click="handleLogin">{{ t('login') }}</button>
|
||||
<view class="flex items-center justify-between mt-[30rpx]">
|
||||
<view class="text-[26rpx] text-[var(--text-color-light6)] leading-[34rpx]" @click="setType" v-if="(type == 'username' && configStore.login.is_mobile) || (type == 'mobile' && configStore.login.is_username )">{{ type == 'username' ? t('mobileLogin') : t('accountLogin') }}</view>
|
||||
<view class="text-[26rpx] text-[#333] leading-[34rpx]" @click="redirect({ url: '/app/pages/auth/register',param:{type} })">
|
||||
<text>{{ t('noAccount') }},</text>
|
||||
<text class="text-primary">{{ t('toRegister') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popupRef" type="dialog">
|
||||
@ -99,10 +95,12 @@
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<view class="footer w-full" v-if="isShowQuickLogin">
|
||||
<view class="text-[26rpx] leading-[36rpx] text-[#333] text-center mb-[30rpx] font-400">{{ t('oneClicklogin') }}</view>
|
||||
<view class="flex justify-center">
|
||||
<button class="h-[80rpx] w-[80rpx] text-[46rpx] !text-[#1AAB37] text-center !p-0 !bg-transparent leading-[79rpx] border-[2rpx] rounded-[50%] border-solid border-[#ddd] nc-iconfont nc-icon-weixinV6mm overflow-hidden" @click="toLink"></button>
|
||||
<view class="footer w-full" v-if="type == 'mobile' && configStore.login.is_username || type == 'username' && configStore.login.is_mobile || isShowQuickLogin">
|
||||
<view class="text-[26rpx] leading-[36rpx] text-[#666] text-center mb-[30rpx] font-400">其他登录方式</view>
|
||||
<view class="flex justify-center gap-[40rpx]">
|
||||
<text v-if="type == 'mobile' && configStore.login.is_username" @click="setType" class="w-[66rpx] h-[66rpx] flex items-center justify-center iconfont iconmima6Vmm border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
|
||||
<text v-if="type == 'username' && configStore.login.is_mobile" @click="setType" class="w-[66rpx] h-[66rpx] flex items-center justify-center iconfont iconshouji6Vmm border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
|
||||
<text v-if="isShowQuickLogin" @click="toLink" class="w-[66rpx] h-[66rpx] !text-[#1AAB37] flex items-center justify-center iconfont iconweixinV6mm1 border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -117,18 +115,15 @@ import { t } from '@/locale'
|
||||
import { redirect, getToken, pxToRpx, isWeixinBrowser } from '@/utils/common'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const systemStore = useSystemStore()
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
const param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||
/********* 自定义头部 - end ***********/
|
||||
const headerHeight = computed(() => {
|
||||
return Object.keys(menuButtonInfo).length ? pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
return Object.keys(systemStore.menuButtonInfo).length ? pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
})
|
||||
const real_name_input = ref(true);
|
||||
const memberStore = useMemberStore()
|
||||
@ -161,6 +156,14 @@ onLoad(async(option: any) => {
|
||||
redirect({ url: '/app/pages/index/index', mode: 'reLaunch' })
|
||||
}, 100)
|
||||
}
|
||||
// #ifdef H5
|
||||
uni.getStorageSync('openid') && (Object.assign(formData, { wx_openid: uni.getStorageSync('openid') }))
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.getStorageSync('openid') && (Object.assign(formData, { weapp_openid: uni.getStorageSync('openid') }))
|
||||
// #endif
|
||||
|
||||
if (option.type) {
|
||||
if (option.type == 'mobile') {
|
||||
if (configStore.login.is_mobile) {
|
||||
@ -282,8 +285,8 @@ const handleLogin = () => {
|
||||
loading.value = true
|
||||
|
||||
const login = type.value == 'username' ? usernameLogin : mobileLogin
|
||||
|
||||
login(formData).then((res: any) => {
|
||||
|
||||
memberStore.setToken(res.data.token)
|
||||
// todo 已注册的会员不受影响
|
||||
// if (configStore.login.is_bind_mobile && !res.data.mobile) {
|
||||
@ -313,6 +316,12 @@ const toLink = () => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const toResetpwd = () =>{
|
||||
if(type.value == 'username'){
|
||||
redirect({ url: '/app/pages/auth/resetpwd' })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.u-input) {
|
||||
@ -332,7 +341,12 @@ const toLink = () => {
|
||||
}
|
||||
|
||||
.footer {
|
||||
// position: absolute;
|
||||
// position: fixed;
|
||||
margin-top: 200rpx;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding-bottom: calc(151rpx + constant(safe-area-inset-bottom));
|
||||
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
@ -7,10 +7,15 @@
|
||||
<!-- #endif -->
|
||||
<view class="mx-[60rpx]">
|
||||
<view class="pt-[140rpx] text-[44rpx] font-500 text-[#333]">{{ type == 'username' ? t('usernameRegister') : t('mobileRegister') }}</view>
|
||||
<view class="text-[26rpx] leading-[39rpx] text-[var(--text-color-light6)] mt-[16rpx] mb-[80rpx]">{{ type == 'username' ? t('usernameRegisterTip') : t('mobileRegisterTip') }}</view>
|
||||
<view class="flex items-center justify-between mt-[24rpx] mb-[90rpx]">
|
||||
<view class="text-[26rpx] text-[#333] leading-[34rpx]" @click="toLink">
|
||||
<text>{{ t('haveAccount') }},</text>
|
||||
<text class="text-primary">{{ t('toLogin') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
|
||||
<template v-if="type == 'username'">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6]">
|
||||
<u-form-item label="" prop="username" :border-bottom="false">
|
||||
<u-input v-model="formData.username" border="none" maxlength="40"
|
||||
:placeholder="t('usernamePlaceholder')" class="!bg-transparent"
|
||||
@ -18,7 +23,7 @@
|
||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="password" :border-bottom="false">
|
||||
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
||||
:placeholder="t('passwordPlaceholder')" class="!bg-transparent"
|
||||
@ -32,7 +37,7 @@
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="confirm_password" :border-bottom="false">
|
||||
<u-input v-model="formData.confirm_password" border="none" :password="isConfirmPassword"
|
||||
maxlength="40" :placeholder="t('confirmPasswordPlaceholder')"
|
||||
@ -48,7 +53,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="type == 'mobile' || configStore.login.is_bind_mobile">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="mobile" :border-bottom="false">
|
||||
<u-input v-model="formData.mobile" border="none" maxlength="11"
|
||||
:placeholder="t('mobilePlaceholder')" class="!bg-transparent"
|
||||
@ -56,7 +61,7 @@
|
||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="mobile_code" :border-bottom="false">
|
||||
<u-input v-model="formData.mobile_code" border="none" maxlength="4"
|
||||
:placeholder="t('codePlaceholder')" class="!bg-transparent"
|
||||
@ -71,7 +76,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="type == 'username'">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="captcha_code" :border-bottom="false">
|
||||
<u-input v-model="formData.captcha_code" border="none"
|
||||
:placeholder="t('captchaPlaceholder')" class="!bg-transparent"
|
||||
@ -85,25 +90,25 @@
|
||||
</view>
|
||||
</template>
|
||||
</u-form>
|
||||
<view class="mt-[160rpx]">
|
||||
<view v-if="configStore.login.agreement_show" class="flex items-center mb-[20rpx] py-[14rpx]" @click.stop="agreeChange">
|
||||
<view class="mt-[140rpx]">
|
||||
<button class="w-full h-[80rpx] !bg-[var(--primary-color)] text-[26rpx] rounded-[40rpx] leading-[80rpx] font-500 !text-[#fff]" @click="handleRegister">{{ t('register') }}</button>
|
||||
<view v-if="configStore.login.agreement_show" class="flex items-center mt-[10rpx] mb-[40rpx] py-[14rpx]" @click.stop="agreeChange">
|
||||
<u-checkbox-group @change="agreeChange">
|
||||
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="30rpx" />
|
||||
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="24rpx" />
|
||||
</u-checkbox-group>
|
||||
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap leading-[30rpx]">
|
||||
<view class="text-[24rpx] -ml-[4rpx] text-[var(--text-color-light6)] flex items-center flex-wrap leading-[30rpx]">
|
||||
<text>{{ t('agreeTips') }}</text>
|
||||
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=privacy' })" class="text-primary">《{{ t('privacyAgreement') }}》</text>
|
||||
<text>{{ t('and') }}</text>
|
||||
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=service' })" class="text-primary">《{{ t('userAgreement') }}》</text>
|
||||
</view>
|
||||
</view>
|
||||
<button class="w-full h-[80rpx] !bg-[var(--primary-color)] text-[26rpx] rounded-[40rpx] leading-[80rpx] font-500 !text-[#fff]" @click="handleRegister">{{ t('register') }}</button>
|
||||
<view class="flex items-center justify-between mt-[30rpx]">
|
||||
<view class="text-[26rpx] text-[var(--text-color-light6)] leading-[34rpx]" v-if="registerType.length > 1" @click="type = type == 'username' ? 'mobile' : 'username' ">{{ type == 'username' ? t('mobileRegister') : t('usernameRegister') }}</view>
|
||||
<view class="text-[26rpx] text-[#333] leading-[34rpx]" @click="toLink">
|
||||
<text>{{ t('haveAccount') }},</text>
|
||||
<text class="text-primary">{{ t('toLogin') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer w-full" v-if="registerType.length > 1" :class="{'fixed bottom-0 left-0 right-0': type == 'mobile', 'pt-[60rpx]': type == 'username'}">
|
||||
<view class="text-[26rpx] leading-[36rpx] text-[#666] text-center mb-[30rpx] font-400">其他注册方式</view>
|
||||
<view class="flex justify-center gap-[40rpx]">
|
||||
<text v-if="type == 'mobile' && configStore.login.is_mobile" @click="type = 'username'" class="w-[66rpx] h-[66rpx] flex items-center justify-center iconfont iconmima6Vmm border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
|
||||
<text v-if="type == 'username' && configStore.login.is_username" @click="type = 'mobile'" class="w-[66rpx] h-[66rpx] flex items-center justify-center iconfont iconshouji6Vmm border-[2rpx] rounded-[50%] border-solid border-[#ddd] !text-[26rpx]"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -140,18 +145,15 @@ import { t } from '@/locale'
|
||||
import { redirect, getToken, pxToRpx } from '@/utils/common'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const systemStore = useSystemStore()
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||
/********* 自定义头部 - end ***********/
|
||||
const headerHeight = computed(() => {
|
||||
return Object.keys(menuButtonInfo).length ? pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
return Object.keys(systemStore.menuButtonInfo).length ? pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
})
|
||||
const formData = reactive({
|
||||
username: '',
|
||||
@ -371,4 +373,8 @@ const toLink = () => {
|
||||
:deep(.u-checkbox) {
|
||||
margin: 0 !important;
|
||||
}
|
||||
.footer {
|
||||
padding-bottom: calc(151rpx + constant(safe-area-inset-bottom));
|
||||
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
<!-- #endif -->
|
||||
<view class="mx-[60rpx]">
|
||||
<view class="pt-[140rpx] text-[44rpx] font-500 text-[#333]">{{ t('findPassword') }}</view>
|
||||
<view class="text-[26rpx] leading-[39rpx] text-[var(--text-color-light6)] mt-[16rpx] mb-[80rpx]">{{ t('findPasswordTip') }}</view>
|
||||
<view class="text-[26rpx] leading-[39rpx] text-[var(--text-color-light6)] mt-[24rpx] mb-[90rpx]">{{ t('findPasswordTip') }}</view>
|
||||
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6]">
|
||||
<u-form-item label="" prop="mobile" :border-bottom="false">
|
||||
<u-input v-model="formData.mobile" type="number" maxlength="11" border="none"
|
||||
:placeholder="t('mobilePlaceholder')" class="!bg-transparent"
|
||||
@ -17,7 +17,7 @@
|
||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="code" :border-bottom="false">
|
||||
<u-input v-model="formData.mobile_code" type="number" maxlength="4" border="none"
|
||||
:placeholder="t('codePlaceholder')" class="!bg-transparent" :disabled="real_name_input"
|
||||
@ -28,7 +28,7 @@
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="password" :border-bottom="false">
|
||||
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
||||
:placeholder="t('passwordPlaceholder')" class="!bg-transparent"
|
||||
@ -42,7 +42,7 @@
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
</view>
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<view class="h-[88rpx] flex w-full items-center px-[30rpx] rounded-[40rpx] box-border bg-[#F6F6F6] mt-[40rpx]">
|
||||
<u-form-item label="" prop="confirm_password" :border-bottom="false">
|
||||
<u-input v-model="formData.confirm_password" border="none" :password="isConfirmPassword"
|
||||
maxlength="40" :placeholder="t('confirmPasswordPlaceholder')" class="!bg-transparent"
|
||||
@ -70,18 +70,15 @@ import { t } from '@/locale'
|
||||
import { resetPassword } from '@/app/api/system'
|
||||
import { redirect, pxToRpx } from '@/utils/common'
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const systemStore = useSystemStore()
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||
/********* 自定义头部 - end ***********/
|
||||
const headerHeight = computed(() => {
|
||||
return Object.keys(menuButtonInfo).length ? pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
return Object.keys(systemStore.menuButtonInfo).length ? pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 'rpx' : 'auto'
|
||||
})
|
||||
const formData = reactive({
|
||||
mobile: '',
|
||||
|
||||
@ -34,7 +34,7 @@ const save = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
var reg = /^[0-9]+$/;
|
||||
const reg = /^[0-9]+$/;
|
||||
if (!reg.test(formData.siteId)) {
|
||||
uni.showToast({ title: t('pleaseEnterNumber'), icon: 'none' });
|
||||
return;
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
</view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<collect-tip ref="collectTipRef" ></collect-tip>
|
||||
<!-- 小程序隐私协议 -->
|
||||
<wx-privacy-popup ref="wxPrivacyPopupRef"></wx-privacy-popup>
|
||||
<!-- #endif -->
|
||||
@ -40,7 +41,7 @@ const diy = useDiy({
|
||||
const diyGroupRef = ref(null)
|
||||
|
||||
const wxPrivacyPopupRef: any = ref(null)
|
||||
|
||||
const collectTipRef: any = ref(null)
|
||||
// 监听页面加载
|
||||
diy.onLoad();
|
||||
|
||||
@ -57,9 +58,11 @@ diy.onShow((data: any) => {
|
||||
let share = data.share ? JSON.parse(data.share) : null;
|
||||
setShare(share);
|
||||
diyGroupRef.value?.refresh();
|
||||
|
||||
// #ifdef MP
|
||||
nextTick(() => {
|
||||
if (wxPrivacyPopupRef.value) wxPrivacyPopupRef.value.proactive();
|
||||
if (collectTipRef.value) collectTipRef.value.show();
|
||||
})
|
||||
// #endif
|
||||
});
|
||||
|
||||
@ -44,15 +44,25 @@
|
||||
</u-form-item>
|
||||
</view>
|
||||
</u-form>
|
||||
|
||||
<view class="w-full footer">
|
||||
|
||||
<view
|
||||
class="py-[var(--top-m)] px-[var(--sidebar-m)] footer w-full fixed bottom-0 left-0 right-0 box-border">
|
||||
class="py-[var(--top-m)] px-[var(--sidebar-m)] footer w-full fixed bottom-30 left-0 right-0 box-border">
|
||||
<button hover-class="none"
|
||||
class="primary-btn-bg !text-[#fff] h-[80rpx] leading-[80rpx] rounded-[100rpx] text-[26rpx] font-500"
|
||||
@click="save" :disabled="btnDisabled" :loading="operateLoading"
|
||||
:class="{'opacity-50': btnDisabled}">{{ t('save') }}
|
||||
</button>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button hover-class="none"
|
||||
class=" bg-[#fff] !text-[var(--primary-color)] h-[80rpx] leading-[80rpx] rounded-[100rpx] text-[26rpx] font-500 mt-[30rpx] borders"
|
||||
@click="choosegAddress" :disabled="btnDisabled" :loading="loadingchoosegAddress"
|
||||
> <text class="nc-iconfont nc-icon-weixinV6mm"></text> 获取微信地址
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<area-select ref="areaRef" @complete="areaSelectComplete" :area-id="formData.district_id || formData.city_id" />
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
@ -115,7 +125,7 @@ onLoad((data: any) => {
|
||||
}
|
||||
formData.value.address = data.name;
|
||||
getAddress(data.latng);
|
||||
var tempArr = getQueryVariable('latng').split(',');
|
||||
const tempArr = getQueryVariable('latng').split(',');
|
||||
formData.value.lat = tempArr[0];
|
||||
formData.value.lng = tempArr[1];
|
||||
}
|
||||
@ -277,7 +287,7 @@ const chooseLocation = () => {
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
var urlencode = formData.value;
|
||||
const urlencode = formData.value;
|
||||
uni.setStorageSync('addressInfo', urlencode);
|
||||
let backurl = location.origin + location.pathname + '?source=' + source.value;
|
||||
if (isSelectMap.value) {
|
||||
@ -310,16 +320,36 @@ const getAddress = (latlng: any) => {
|
||||
}
|
||||
|
||||
const getQueryVariable = (variable: any) => {
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split('&');
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split('=');
|
||||
const query = window.location.search.substring(1);
|
||||
const vars = query.split('&');
|
||||
for (let i = 0; i < vars.length; i++) {
|
||||
const pair = vars[i].split('=');
|
||||
if (pair[0] == variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const loadingchoosegAddress = ref(false)
|
||||
const choosegAddress = () =>{
|
||||
loadingchoosegAddress.value = true
|
||||
uni.chooseAddress({
|
||||
success(res) {
|
||||
console.log(7744)
|
||||
loadingchoosegAddress.value = false
|
||||
// 将地址信息格式化为“名字-手机号-地址(详细地址)”
|
||||
// const formattedAddress = `${res.userName}-${res.telNumber}-${res.provinceName}${res.cityName}${res.countyName}${res.detailInfoNew || res.detailInfo}`;
|
||||
console.log(res)
|
||||
formData.value.name = res.userName
|
||||
formData.value.mobile = res.telNumber
|
||||
formData.value.area = res.provinceName + res.cityName + res.countyName
|
||||
formData.value.address = res.detailInfo
|
||||
},
|
||||
fail(err) {
|
||||
loadingchoosegAddress.value = false
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -335,4 +365,7 @@ const getQueryVariable = (variable: any) => {
|
||||
height: calc(100rpx + var(--top-m) + var(--top-m) + constant(safe-area-inset-bottom)) !important;
|
||||
height: calc(100rpx + var(--top-m) + var(--top-m) + env(safe-area-inset-bottom)) !important;
|
||||
}
|
||||
.borders{
|
||||
border: 1px solid var(--primary-color);
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -136,13 +136,6 @@ onShow(() => {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const headerStyle = computed(() => {
|
||||
return {
|
||||
backgroundImage: 'url(' + img('static/resource/images/member/balance_bg.png') + ') ',
|
||||
@ -154,14 +147,14 @@ const headerStyle = computed(() => {
|
||||
|
||||
const mescrollTop = computed(() => {
|
||||
if ((cashOutConfigObj.is_open == 1 || rechargeConfigObj.is_use == 1)) {
|
||||
if (Object.keys(menuButtonInfo).length) {
|
||||
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 700) + 'rpx'
|
||||
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||
return (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 700) + 'rpx'
|
||||
} else {
|
||||
return '718rpx'
|
||||
}
|
||||
} else {
|
||||
if (Object.keys(menuButtonInfo).length) {
|
||||
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 632) + 'rpx'
|
||||
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||
return (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 632) + 'rpx'
|
||||
} else {
|
||||
return '650rpx'
|
||||
}
|
||||
|
||||
@ -77,9 +77,11 @@ import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
|
||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import selectDate from '@/components/select-date/select-date.vue';
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
const { downCallback, mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
|
||||
const memberStore = useMemberStore();
|
||||
const systemStore = useSystemStore()
|
||||
const info = computed(() => memberStore.info)
|
||||
// 提现
|
||||
const applyCashOut = () => {
|
||||
@ -92,12 +94,6 @@ const topTabarObj = topTabar()
|
||||
let param = topTabarObj.setTopTabbarParam({ title: '我的佣金', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||
/********* 自定义头部 - end ***********/
|
||||
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const headerStyle = computed(() => {
|
||||
return {
|
||||
backgroundImage: 'url(' + img('static/resource/images/member/commission/commission_bg.png') + ') ',
|
||||
@ -108,7 +104,7 @@ const headerStyle = computed(() => {
|
||||
})
|
||||
// 16为自定头部的padding-bottom
|
||||
const mescrollTop = computed(() => {
|
||||
return Object.keys(menuButtonInfo).length ? (Number(menuButtonInfo.height) * 2 + menuButtonInfo.top * 2 + 470 + 16) + 'rpx' : '470rpx'
|
||||
return Object.keys(systemStore.menuButtonInfo).length ? (Number(systemStore.menuButtonInfo.height) * 2 + systemStore.menuButtonInfo.top * 2 + 470 + 16) + 'rpx' : '470rpx'
|
||||
})
|
||||
|
||||
//来源类型
|
||||
@ -173,7 +169,7 @@ const confirmFn = (data: any) => {
|
||||
<style lang="scss">
|
||||
.member-level {
|
||||
background: linear-gradient(360deg, #F23621 11%, #FF7F71 100%), #D9D9D9;
|
||||
border-radius: 0rpx 20rpx 20rpx 0rpx;
|
||||
border-radius: 0 20rpx 20rpx 0;
|
||||
}
|
||||
|
||||
:deep(.uni-scroll-view) {
|
||||
|
||||
@ -22,6 +22,8 @@ onMounted(() => {
|
||||
|
||||
props.data.formField.forEach((item: any) => {
|
||||
let comp = {
|
||||
|
||||
componentIsShow: true, // 是否显示
|
||||
id: item.field_key,
|
||||
componentName: item.field_type,
|
||||
pageStyle: '',
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="!loading && (!list || !list.length)">
|
||||
<view v-if="!loading && (!list || !list.length)">
|
||||
<!-- #ifdef MP -->
|
||||
<top-tabbar :data="topTabbarDataEmpty" />
|
||||
<!-- #endif -->
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="w-full min-h-screen bg-page personal-wrap !pb-[20rpx]" v-if="info" :style="themeColor()">
|
||||
<view class="w-full min-h-screen bg-page personal-wrap !pb-[20rpx] overflow-hidden" v-if="info" :style="themeColor()">
|
||||
<view class="my-[var(--top-m)] sidebar-margin overflow-hidden card-template py-[20rpx]">
|
||||
<u-cell-group :border="false" class="cell-group">
|
||||
<u-cell :title="t('headimg')" :titleStyle="{'font-size': '28rpx'}" :is-link="true">
|
||||
@ -217,7 +217,7 @@ page {
|
||||
.u-cell {
|
||||
.u-cell__body {
|
||||
padding: 0;
|
||||
height: 90rpx;
|
||||
height: 80rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ page {
|
||||
}
|
||||
|
||||
.u-cell__title-text {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ page {
|
||||
|
||||
.u-cell__value {
|
||||
line-height: 1;
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ page {
|
||||
}
|
||||
|
||||
.u-action-sheet__item-wrap__item__name {
|
||||
font-size: 30rpx !important;
|
||||
font-size: 26rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,8 +287,8 @@ page {
|
||||
}
|
||||
}
|
||||
.detail-two-content{
|
||||
padding-top: 32rpx !important;
|
||||
padding-bottom: 32rpx !important;
|
||||
padding-top: 30rpx !important;
|
||||
padding-bottom: 30rpx !important;
|
||||
margin-bottom: 0 !important;
|
||||
& > view{
|
||||
width: 72% !important;
|
||||
@ -297,7 +297,11 @@ page {
|
||||
height: 136rpx !important;
|
||||
}
|
||||
}
|
||||
& > view, .detail-two-content-label{
|
||||
font-size: 26rpx!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -106,29 +106,25 @@ import { t } from '@/locale'
|
||||
import { redirect, img, pxToRpx } from '@/utils/common';
|
||||
import { getMemberAccountPointcount, getTaskPoint } from '@/app/api/member';
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
let param = topTabarObj.setTopTabbarParam({ title: '我的积分' })
|
||||
/********* 自定义头部 - end ***********/
|
||||
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const systemStore = useSystemStore()
|
||||
const headerStyle = computed(() => {
|
||||
return {
|
||||
backgroundImage: 'url(' + img('static/resource/images/member/point/point_bg.png') + ') ',
|
||||
backgroundSize: 'cover',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
backgroundPosition: 'bottom',
|
||||
// paddingTop:Object.keys(menuButtonInfo).length?(Number(menuButtonInfo.height) * 2 + menuButtonInfo.top * 2 + 77)+'rpx':'77rpx',
|
||||
// paddingTop:Object.keys(systemStore.menuButtonInfo).length?(Number(systemStore.menuButtonInfo.height) * 2 + systemStore.menuButtonInfo.top * 2 + 77)+'rpx':'77rpx',
|
||||
}
|
||||
})
|
||||
const topStyle = computed(() => {
|
||||
let style = Object.keys(menuButtonInfo).length ? (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + 50) + 'rpx;' : '50rpx'
|
||||
let style = Object.keys(systemStore.menuButtonInfo).length ? (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + 50) + 'rpx;' : '50rpx'
|
||||
return style
|
||||
})
|
||||
|
||||
|
||||
@ -247,6 +247,7 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getSignInfo, getSignConfig, setSign, getDayPack } from '@/app/api/member'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import { topTabar } from '@/utils/topTabbar'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
const state = reactive({
|
||||
dataCount: [], //当月所有天数
|
||||
@ -462,23 +463,18 @@ const filteredDate = (date: any) => {
|
||||
return date > 0 ? date : ''
|
||||
}
|
||||
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo: any = {};
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
const systemStore = useSystemStore()
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
let topTabbarData = topTabarObj.setTopTabbarParam({ title: '我的签到' })
|
||||
/********* 自定义头部 - end ***********/
|
||||
|
||||
const headStyle = computed(() => {
|
||||
let style = pxToRpx(Number(menuButtonInfo.height) + menuButtonInfo.top + 8) + 382 + 'rpx;'
|
||||
let style = pxToRpx(Number(systemStore.menuButtonInfo.height) + systemStore.menuButtonInfo.top + 8) + 382 + 'rpx;'
|
||||
return style
|
||||
})
|
||||
const topStyle = computed(() => {
|
||||
let style = pxToRpx(Number(menuButtonInfo.height) + menuButtonInfo.top + 8) + 50 + 'rpx;'
|
||||
let style = pxToRpx(Number(systemStore.menuButtonInfo.height) + systemStore.menuButtonInfo.top + 8) + 50 + 'rpx;'
|
||||
return style
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
<view class="h-[88rpx] flex-center bg-[#fff] mx-[var(--sidebar-m)] rounded-[var(--rounded-big)] text-[28rpx]" @click="memberStore.logout(true)">{{ t('logout') }}</view>
|
||||
<view class="h-[88rpx] flex-center bg-[#fff] mx-[var(--sidebar-m)] rounded-[var(--rounded-big)] text-[26rpx]" @click="memberStore.logout(true)">{{ t('logout') }}</view>
|
||||
|
||||
<u-action-sheet :actions="langList" :show="langSheetShow" :closeOnClickOverlay="true"
|
||||
:safeAreaInsetBottom="true"
|
||||
@ -63,7 +63,7 @@ page {
|
||||
.u-cell {
|
||||
.u-cell__body {
|
||||
padding: 0;
|
||||
height: 90rpx;
|
||||
height: 80rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ page {
|
||||
}
|
||||
|
||||
.u-cell__title-text {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ page {
|
||||
|
||||
.u-cell__value {
|
||||
line-height: 1;
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.u-line {
|
||||
@ -104,7 +104,7 @@ page {
|
||||
}
|
||||
|
||||
.u-action-sheet__item-wrap__item__name {
|
||||
font-size: 30rpx !important;
|
||||
font-size: 26rpx !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -156,7 +156,7 @@ const scanCode = () => {
|
||||
|
||||
let isLoading = false;
|
||||
const confirm = () => {
|
||||
var reg = /[\S]+/;
|
||||
const reg = /[\S]+/;
|
||||
if (!reg.test(verify_code.value)) {
|
||||
uni.showToast({
|
||||
title: '请输入核销码',
|
||||
|
||||
@ -12,7 +12,7 @@ interface Diy {
|
||||
title: string,
|
||||
pageStartBgColor: string, // 页面背景颜色(开始)
|
||||
pageEndBgColor: string, // 页面背景颜色(结束)
|
||||
bottomTabBarSwitch: boolean, // 底部导航开关
|
||||
bottomTabBar: any, // 底部导航
|
||||
bgUrl: string
|
||||
},
|
||||
// 组件集合
|
||||
@ -20,7 +20,8 @@ interface Diy {
|
||||
topFixedStatus: string, // 置顶组件的状态
|
||||
scrollTop: number,
|
||||
topTabarHeight: number,
|
||||
componentRefs: any
|
||||
componentRefs: any,
|
||||
imageAdsSameScreen: any // 图片广告, 是否设置沉浸式
|
||||
}
|
||||
|
||||
const useDiyStore = defineStore('diy', {
|
||||
@ -34,14 +35,18 @@ const useDiyStore = defineStore('diy', {
|
||||
title: "",
|
||||
pageStartBgColor: '', // 页面背景颜色(开始)
|
||||
pageEndBgColor: '', // 页面背景颜色(结束)
|
||||
bottomTabBarSwitch: true,
|
||||
bottomTabBar: {
|
||||
control: true, // 是否允许展示编辑
|
||||
isShow: true, // 是否显示
|
||||
},
|
||||
bgUrl: ''
|
||||
},
|
||||
value: [], // 组件集合
|
||||
topFixedStatus: 'home', // 顶部 置顶组件状态,home:展示首页数据、diy:展示置顶组件定义的子页面
|
||||
scrollTop: 0, // 滚动位置
|
||||
topTabarHeight: 0,
|
||||
componentRefs: null
|
||||
componentRefs: null,
|
||||
imageAdsSameScreen: false
|
||||
}
|
||||
},
|
||||
getters: {},
|
||||
@ -49,7 +54,7 @@ const useDiyStore = defineStore('diy', {
|
||||
// 初始化
|
||||
init() {
|
||||
// #ifdef H5
|
||||
var data = JSON.stringify({
|
||||
const data = JSON.stringify({
|
||||
type: 'init',
|
||||
load: true
|
||||
});
|
||||
@ -68,6 +73,7 @@ const useDiyStore = defineStore('diy', {
|
||||
if (this.value) {
|
||||
this.value.forEach((item, index) => {
|
||||
item.pageStyle = '';
|
||||
item.componentIsShow = true // 是否显示
|
||||
if (item.pageStartBgColor) {
|
||||
if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${ item.pageGradientAngle },${ item.pageStartBgColor },${ item.pageEndBgColor });`;
|
||||
else item.pageStyle += 'background-color:' + item.pageStartBgColor + ';';
|
||||
@ -118,7 +124,7 @@ const useDiyStore = defineStore('diy', {
|
||||
// 减少重复请求
|
||||
if (this.currentIndex == index) return;
|
||||
this.currentIndex = index;
|
||||
var data = JSON.stringify({
|
||||
const data = JSON.stringify({
|
||||
type: 'change',
|
||||
index,
|
||||
component: toRaw(component)
|
||||
|
||||
242
uni-app/src/components/area-select/area-select copy.vue
Normal file
242
uni-app/src/components/area-select/area-select copy.vue
Normal file
@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<u-popup :show="show" @close="show = false" mode="bottom" :round="10" :safe-area-inset-bottom="true">
|
||||
<view class="area-picker-container">
|
||||
<view class="header">
|
||||
<text class="title">请选择地区</text>
|
||||
<text class="close-icon" @click="handleClose">
|
||||
<u-icon name="close" size="18" color="#999"></u-icon>
|
||||
</text>
|
||||
</view>
|
||||
<view class="selected-path">
|
||||
<text>{{ selectedText }}</text>
|
||||
</view>
|
||||
<view class="columns">
|
||||
<!-- 省份列 -->
|
||||
<scroll-view :scroll-into-view="'province-' + (selected.province?.id || '')" scroll-y="true" class="column">
|
||||
<view v-for="item in areaList.province" :key="item.id" :id="'province-' + item.id" class="item"
|
||||
:class="{ 'active': selected.province && selected.province.id === item.id }"
|
||||
@click="selected.province = item">
|
||||
<text class="item-text">{{ item.name }}</text>
|
||||
<u-icon v-if="selected.province && selected.province.id === item.id" name="checkbox-mark" color="var(--primary-color)" size="18"></u-icon>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 城市列 -->
|
||||
<scroll-view v-if="areaList.city.length" :scroll-into-view="'city-' + (selected.city?.id || '')" scroll-y="true" class="column">
|
||||
<view v-for="item in areaList.city" :key="item.id" :id="'city-' + item.id" class="item"
|
||||
:class="{ 'active': selected.city && selected.city.id === item.id }"
|
||||
@click="selected.city = item">
|
||||
<text class="item-text">{{ item.name }}</text>
|
||||
<u-icon v-if="selected.city && selected.city.id === item.id" name="checkbox-mark"
|
||||
color="var(--primary-color)" size="18"></u-icon>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 区县列 -->
|
||||
<scroll-view v-if="areaList.district.length" :scroll-into-view="'district-' + (selected.district?.id || '')" scroll-y="true" class="column">
|
||||
<view v-for="item in areaList.district" :key="item.id" :id="'district-' + item.id" class="item"
|
||||
:class="{ 'active': selected.district && selected.district.id === item.id }"
|
||||
@click="selected.district = item">
|
||||
<text class="item-text">{{ item.name }}</text>
|
||||
<u-icon v-if="selected.district && selected.district.id === item.id" name="checkbox-mark" color="var(--primary-color)" size="18"></u-icon>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch, computed } from 'vue'
|
||||
import { getAreaListByPid, getAreaByCode } from '@/app/api/system'
|
||||
|
||||
const prop = defineProps({
|
||||
areaId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
|
||||
const show = ref(false)
|
||||
const areaList = reactive({
|
||||
province: [] as any[],
|
||||
city: [] as any[],
|
||||
district: [] as any[]
|
||||
})
|
||||
|
||||
const selected = reactive({
|
||||
province: null as any,
|
||||
city: null as any,
|
||||
district: null as any
|
||||
})
|
||||
|
||||
// 原始数据加载逻辑
|
||||
getAreaListByPid(0).then((res: any) => {
|
||||
areaList.province = res.data
|
||||
}).catch()
|
||||
|
||||
// 根据ID初始化
|
||||
watch(() => prop.areaId, (nval, oval) => {
|
||||
if (nval && !oval) {
|
||||
getAreaByCode(nval).then((res: any) => {
|
||||
const { data } = res;
|
||||
data.province && (selected.province = data.province);
|
||||
data.city && (selected.city = data.city);
|
||||
data.district && (selected.district = data.district);
|
||||
if (data.city == undefined && data.province && data.district) {
|
||||
selected.city = data.district;
|
||||
selected.district = null;
|
||||
}
|
||||
})
|
||||
}
|
||||
}, {
|
||||
immediate: true
|
||||
})
|
||||
|
||||
// 监听省份选择 (适配UI,选择新省份时清空下级)
|
||||
watch(() => selected.province, (newVal) => {
|
||||
selected.city = null
|
||||
selected.district = null
|
||||
areaList.district = []
|
||||
|
||||
if (newVal) {
|
||||
getAreaListByPid(newVal.id).then((res: any) => {
|
||||
areaList.city = res.data
|
||||
}).catch()
|
||||
} else {
|
||||
areaList.city = []
|
||||
}
|
||||
}, { deep: true })
|
||||
|
||||
// 监听城市选择 (适配UI,选择新城市时清空下级)
|
||||
watch(() => selected.city, (newVal) => {
|
||||
selected.district = null
|
||||
|
||||
if (newVal) {
|
||||
getAreaListByPid(newVal.id).then((res: any) => {
|
||||
const { data } = res;
|
||||
areaList.district = data
|
||||
if (!data.length) { // 如果没有区县,则选择完成
|
||||
emits('complete', selected)
|
||||
show.value = false
|
||||
}
|
||||
}).catch()
|
||||
} else {
|
||||
areaList.district = []
|
||||
}
|
||||
}, { deep: true })
|
||||
|
||||
const emits = defineEmits(['complete'])
|
||||
|
||||
// 监听区县选择
|
||||
watch(() => selected.district, (newVal) => {
|
||||
if (newVal) {
|
||||
emits('complete', selected)
|
||||
show.value = false
|
||||
}
|
||||
}, { deep: true })
|
||||
|
||||
const handleClose = () => {
|
||||
show.value = false
|
||||
}
|
||||
|
||||
const open = () => {
|
||||
show.value = true
|
||||
}
|
||||
|
||||
// 顶部显示文本
|
||||
const selectedText = computed(() => {
|
||||
const parts = []
|
||||
if (selected.province) parts.push(selected.province.name)
|
||||
if (selected.city) parts.push(selected.city.name)
|
||||
if (selected.district) parts.push(selected.district.name)
|
||||
if (parts.length === 0) return "请选择您所在的地区"
|
||||
return parts.join(' / ')
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.area-picker-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 75vh;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
padding: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.selected-path {
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
color: var(--primary-color);
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #eee;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.columns {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.column {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
width: 33.33%;
|
||||
|
||||
&:not(:last-child) {
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
transition: background-color 0.2s;
|
||||
|
||||
&:active {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: var(--primary-color);
|
||||
font-weight: 600;
|
||||
background-color: var(--primary-color-light);
|
||||
}
|
||||
|
||||
.item-text {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -15,18 +15,20 @@
|
||||
<view v-if="selected.district">{{ selected.district.name }}</view>
|
||||
<view v-else>请选择</view>
|
||||
</view>
|
||||
<view class="flex-1 pr-[10rpx]" v-else></view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="h-[50vh]">
|
||||
<view class="flex p-[30rpx] pt-0 text-sm">
|
||||
<view v-if="areaList.province.length" v-show="currSelect == 'province'">
|
||||
<view class="flex p-[30rpx] pt-[0] text-sm font-500">
|
||||
<view v-if="areaList.province.length" class="flex-1 pr-[10rpx]" :style="{ opacity: currSelect == 'province' ? 1 : 0, pointerEvents: currSelect == 'province' ? 'auto' : 'none' }">
|
||||
<view v-for="item in areaList.province" class="h-[80rpx] flex items-center" :class="{'text-[var(--primary-color)]': selected.province && selected.province.id == item.id }" @click="selected.province = item">{{ item.name }}</view>
|
||||
</view>
|
||||
<view v-if="areaList.city.length" v-show="currSelect == 'city'">
|
||||
<view v-if="areaList.city.length" class="flex-1 pr-[10rpx]" :style="{ opacity: currSelect == 'city' ? 1 : 0, pointerEvents: currSelect == 'city' ? 'auto' : 'none' }">
|
||||
<view v-for="item in areaList.city" class="h-[80rpx] flex items-center" :class="{'text-[var(--primary-color)]': selected.city && selected.city.id == item.id }" @click="selected.city = item">{{ item.name }}</view>
|
||||
</view>
|
||||
<view v-if="areaList.district.length" v-show="currSelect == 'district'">
|
||||
<view v-if="areaList.district.length" class="flex-1 pr-[10rpx]" :style="{ opacity: currSelect == 'district' ? 1 : 0, pointerEvents: currSelect == 'district' ? 'auto' : 'none' }">
|
||||
<view v-for="item in areaList.district" class="h-[80rpx] flex items-center " :class="{'text-[var(--primary-color)]': selected.district && selected.district.id == item.id }" @click="selected.district = item">{{ item.name }}</view>
|
||||
</view>
|
||||
<view class="flex-1 pr-[10rpx]" v-else></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@ -68,10 +70,6 @@ watch(() => prop.areaId, (nval, oval) => {
|
||||
data.province && (selected.province = data.province)
|
||||
data.city && (selected.city = data.city)
|
||||
data.district && (selected.district = data.district)
|
||||
if (data.city == undefined && data.province && data.district) {
|
||||
selected.city = data.district
|
||||
selected.district=null
|
||||
}
|
||||
})
|
||||
}
|
||||
}, {
|
||||
@ -85,7 +83,7 @@ watch(() => selected.province, () => {
|
||||
getAreaListByPid(selected.province.id).then(({ data }) => {
|
||||
areaList.city = data
|
||||
currSelect.value = 'city'
|
||||
|
||||
|
||||
if (selected.city) {
|
||||
let isExist = false
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
@ -150,6 +148,9 @@ watch(() => selected.district, (nval) => {
|
||||
|
||||
const open = () => {
|
||||
show.value = true
|
||||
if(prop.areaId){
|
||||
currSelect.value = 'district'
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
||||
@ -128,7 +128,12 @@ const handleBind = () => {
|
||||
loading.value = true
|
||||
|
||||
const request = info.value ? bindMobile : mobileLogin;
|
||||
|
||||
if(uni.getStorageSync('avatar') && uni.getStorageSync('nickname') && uni.getStorageSync('openid') && uni.getStorageSync('unionid')){
|
||||
formData.avatar = uni.getStorageSync('avatar')
|
||||
formData.nickname = uni.getStorageSync('nickname')
|
||||
formData.openid = uni.getStorageSync('openid')
|
||||
formData.unionid = uni.getStorageSync('unionid')
|
||||
}
|
||||
request(formData).then((res: any) => {
|
||||
if (info.value) {
|
||||
memberStore.getMemberInfo()
|
||||
|
||||
83
uni-app/src/components/collect-tip/collect-tip.vue
Normal file
83
uni-app/src/components/collect-tip/collect-tip.vue
Normal file
@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<view v-if="visible" class="add-tip" :style="style">
|
||||
<view class="bubble">
|
||||
<view>
|
||||
点击 <span class="nc-iconfont nc-icon-xiaochengxu !text-[33rpx] !text-[#333] "></span>添加到我的小程序<br>微信首页下拉即可快速访问店铺
|
||||
</view>
|
||||
|
||||
<span class="nc-iconfont nc-icon-guanbiV6xx !text-[24rpx] !text-[#333] absolute top-[6rpx] right-[10rpx]" @click="hide"></span>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick } from 'vue'
|
||||
|
||||
const visible = ref(false)
|
||||
const style = ref({ top: '0px', right: '0px' })
|
||||
|
||||
const show = () => {
|
||||
const closed = uni.getStorageSync('addedTipClosed')
|
||||
if (!closed) {
|
||||
wx.checkIsAddedToMyMiniProgram({
|
||||
success(res) {
|
||||
if (!res.added) {
|
||||
const menuButton = wx.getMenuButtonBoundingClientRect()
|
||||
nextTick(() => {
|
||||
const top = menuButton.bottom + 10
|
||||
const right = wx.getSystemInfoSync().windowWidth - menuButton.right + 4
|
||||
// const right = menuButton.left - 10
|
||||
style.value = {
|
||||
top: `${top}px`,
|
||||
right: `${right}px`
|
||||
}
|
||||
visible.value = true
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const hide = () => {
|
||||
visible.value = false
|
||||
uni.setStorageSync('addedTipClosed', true)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.add-tip {
|
||||
position: fixed;
|
||||
z-index: 999999;
|
||||
}
|
||||
|
||||
.bubble {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
opacity: 0.9;
|
||||
color: #333;
|
||||
padding: 20rpx 28rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
width: 330rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.arrow {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: 28%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 12rpx solid transparent;
|
||||
border-right: 12rpx solid transparent;
|
||||
border-bottom: 12rpx solid rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
</style>
|
||||
175
uni-app/src/components/easy-image/easy-image.vue
Normal file
175
uni-app/src/components/easy-image/easy-image.vue
Normal file
@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<view class="easy-load-image" :style="imageStyle" :id="uid">
|
||||
<image class="origin-img" :src="img(imageSrc)" :mode="mode"
|
||||
v-if="loadImg && !isLoadError"
|
||||
v-show="showImg"
|
||||
:style="imageStyle"
|
||||
:class="[imageClass, !openTransition ? 'no-transition' : '', showTransition && openTransition ? 'show-transition' : '']"
|
||||
@load="handleImgLoad" @error="handleImgError">
|
||||
</image>
|
||||
<view class="load-fail-img" v-else-if="isLoadError"></view>
|
||||
<view :class="['loading-img','spin-circle',loadingMode]" v-show="!showImg && !isLoadError"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, onBeforeUnmount, nextTick, getCurrentInstance } from 'vue'
|
||||
import { img, debounce } from '@/utils/common'
|
||||
import useSystemStore from '@/stores/system'
|
||||
|
||||
// 生成全局唯一id
|
||||
const generateUUID = () => {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
let r = Math.random() * 16 | 0,
|
||||
v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
})
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
imageSrc: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
imageClass:{
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
imageStyle:{
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'aspectFill'
|
||||
},
|
||||
loadingMode: {
|
||||
type: String,
|
||||
default: 'looming-gray'
|
||||
},
|
||||
openTransition: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
viewHeight: {
|
||||
type: Number,
|
||||
default() {
|
||||
return useSystemStore().systemInfo.windowHeight
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const uid = ref('uid-' + generateUUID())
|
||||
const loadImg = ref(false)
|
||||
const showImg = ref(false)
|
||||
const isLoadError = ref(false)
|
||||
const showTransition = ref(false)
|
||||
const instance = getCurrentInstance();
|
||||
|
||||
const scrollFn = debounce(() => {
|
||||
// 加载img时才执行滚动监听判断是否可加载
|
||||
if (loadImg.value || isLoadError.value) return;
|
||||
const id = uid.value
|
||||
const query = uni.createSelectorQuery().in(instance);
|
||||
query.select('#' + id).boundingClientRect((data: any) => {
|
||||
if (!data) return;
|
||||
if (data.top - props.viewHeight < 0) {
|
||||
loadImg.value = !!props.imageSrc
|
||||
isLoadError.value = !loadImg.value
|
||||
}
|
||||
}).exec()
|
||||
}, 200)
|
||||
|
||||
const handleImgLoad = () => {
|
||||
showImg.value = true;
|
||||
setTimeout(() => {
|
||||
showTransition.value = true
|
||||
}, 50)
|
||||
}
|
||||
|
||||
const handleImgError = () => {
|
||||
isLoadError.value = true;
|
||||
}
|
||||
|
||||
const init = () => {
|
||||
nextTick(onScroll)
|
||||
}
|
||||
|
||||
const onScroll = () => {
|
||||
scrollFn();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
uni.$on('scroll', scrollFn)
|
||||
onScroll()
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
uni.$off('scroll', scrollFn)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.easy-load-image {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 官方优化图片tips */
|
||||
image {
|
||||
will-change: transform;
|
||||
/* 渐变过渡效果处理 */
|
||||
&.origin-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0.3;
|
||||
|
||||
&.show-transition {
|
||||
transition: opacity .5s;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&.no-transition {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 加载失败、加载中的占位图样式控制 */
|
||||
.load-fail-img {
|
||||
height: 100%;
|
||||
background: url('./fail.png') no-repeat center;
|
||||
background-size: 50%;
|
||||
}
|
||||
|
||||
.loading-img {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 转圈 */
|
||||
.spin-circle {
|
||||
background: url('./loading.png') no-repeat center;
|
||||
background-size: 60%;
|
||||
}
|
||||
|
||||
/* 动态灰色若隐若现 */
|
||||
.looming-gray {
|
||||
animation: looming-gray 1s infinite linear;
|
||||
background-color: #E3E3E3;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
@keyframes looming-gray {
|
||||
0% {
|
||||
background-color: #E3E3E3AA;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-color: #E3E3E3;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-color: #E3E3E3AA;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
uni-app/src/components/easy-image/fail.png
Normal file
BIN
uni-app/src/components/easy-image/fail.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
uni-app/src/components/easy-image/loading.png
Normal file
BIN
uni-app/src/components/easy-image/loading.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@ -3,7 +3,7 @@
|
||||
// https://uniapp.dcloud.io/frame?id=renderjs
|
||||
|
||||
// 与wxs的me实例一致
|
||||
var me = {}
|
||||
const me = {};
|
||||
|
||||
// 初始化window对象的touch事件 (仅初始化一次)
|
||||
if(window && !window.$mescrollRenderInit){
|
||||
@ -19,20 +19,20 @@ if(window && !window.$mescrollRenderInit){
|
||||
window.addEventListener('touchmove', function(e){
|
||||
if (me.disabled()) return;
|
||||
if (me.getScrollTop() > 0) return; // 需在顶部下拉,才禁止bounce
|
||||
|
||||
var curPoint = me.getPoint(e); // 当前点
|
||||
var moveY = curPoint.y - me.startPoint.y; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
|
||||
|
||||
const curPoint = me.getPoint(e); // 当前点
|
||||
const moveY = curPoint.y - me.startPoint.y; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
|
||||
// 向下拉
|
||||
if (moveY > 0) {
|
||||
// 可下拉的条件
|
||||
if (!me.isDownScrolling && !me.optDown.isLock && (!me.isUpScrolling || (me.isUpScrolling && me.isUpBoth))) {
|
||||
|
||||
// 只有touch在mescroll的view上面,才禁止bounce
|
||||
var el = e.target;
|
||||
var isMescrollTouch = false;
|
||||
while (el && el.tagName && el.tagName !== 'UNI-PAGE-BODY' && el.tagName != "BODY") {
|
||||
var cls = el.classList;
|
||||
if (cls && cls.contains('mescroll-render-touch')) {
|
||||
let el = e.target;
|
||||
let isMescrollTouch = false;
|
||||
while (el && el.tagName && el.tagName !== 'UNI-PAGE-BODY' && el.tagName != "BODY") {
|
||||
const cls = el.classList;
|
||||
if (cls && cls.contains('mescroll-render-touch')) {
|
||||
isMescrollTouch = true
|
||||
break;
|
||||
}
|
||||
|
||||
@ -44,6 +44,10 @@ const prop = defineProps({
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
reformat: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
@ -165,6 +169,7 @@ const confirmPay = () => {
|
||||
uni.$on('checkIsReturnAfterPayment', () => {
|
||||
const data = uni.getStorageSync('paymenting')
|
||||
if (uni.getStorageSync('paymenting')) {
|
||||
|
||||
redirect({
|
||||
url: '/app/pages/pay/result',
|
||||
param: {
|
||||
@ -220,8 +225,18 @@ const open = (tradeType: string, tradeId: number, payReturn: string = '', scene:
|
||||
}
|
||||
|
||||
const emits = defineEmits(['close', 'confirm'])
|
||||
|
||||
const toPayResult = () => {
|
||||
emits('confirm')
|
||||
// console.log(prop.reformat)
|
||||
if(prop.reformat){
|
||||
redirect({
|
||||
url: prop.reformat,
|
||||
mode: 'redirectTo'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
redirect({
|
||||
url: '/app/pages/pay/result',
|
||||
param: { trade_type: payInfo.value?.trade_type, trade_id: payInfo.value?.trade_id },
|
||||
@ -237,7 +252,8 @@ const handleClose = () => {
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
open,
|
||||
payInfo
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="share-footer" @click="sharePopupClose">
|
||||
<text>取消分享</text>
|
||||
<text class="text-[#333]">取消分享</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
@ -45,6 +45,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { img, copy } from '@/utils/common';
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
const props = defineProps({
|
||||
copyUrl: { // 例 "/wap/addon/shop_fenxiao/pages/goods"
|
||||
@ -93,12 +94,10 @@ const closeDialog = () => {
|
||||
|
||||
const shareTop: any = ref(0)
|
||||
/************ 获取微信头部-start ****************/
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo: any = {};
|
||||
const systemStore = useSystemStore()
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
shareTop.value = menuButtonInfo.top + menuButtonInfo.height + 'px';
|
||||
shareTop.value = systemStore.menuButtonInfo.top + systemStore.menuButtonInfo.height + 'px';
|
||||
// #endif
|
||||
/************ 获取微信头部-end ****************/
|
||||
|
||||
|
||||
@ -57,6 +57,7 @@
|
||||
import { ref } from 'vue';
|
||||
import { img, copy } from '@/utils/common';
|
||||
import { getPoster } from '@/app/api/system'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
const props = defineProps({
|
||||
posterId: {
|
||||
@ -200,12 +201,10 @@ const savePoster = () => {
|
||||
|
||||
const shareTop: any = ref(0)
|
||||
/************ 获取微信头部-start ****************/
|
||||
// 获取系统状态栏的高度
|
||||
let menuButtonInfo: any = {};
|
||||
const systemStore = useSystemStore()
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
shareTop.value = menuButtonInfo.top + menuButtonInfo.height + 'px';
|
||||
shareTop.value = systemStore.menuButtonInfo.top + systemStore.menuButtonInfo.height + 'px';
|
||||
// #endif
|
||||
/************ 获取微信头部-end ****************/
|
||||
|
||||
|
||||
@ -128,6 +128,16 @@ if (!props.addon) {
|
||||
)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => useConfigStore().tabbarList,
|
||||
(newValue, oldValue) => {
|
||||
if (newValue && newValue.length) {
|
||||
setTabbar()
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const value = computed(() => {
|
||||
let query: any = currShareRoute().params;
|
||||
let str = [];
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<view class="ns-navbar-wrap" v-if="diyStore.mode !='decorate' && topStatusBarData" :class="topStatusBarData.style">
|
||||
<view class="u-navbar" :class="{'fixed': props.scrollBool != -1, 'absolute': props.scrollBool == -1}" :style="{ backgroundColor: bgColor}">
|
||||
<view class="u-navbar z-100" :class="{'fixed': props.scrollBool != -1, 'absolute': props.scrollBool == -1}" :style="{ backgroundColor: bgColor}">
|
||||
<view class="navbar-inner" :style="{ width: '100%', height: placeholderHeight + 'px' }">
|
||||
<view v-if="topStatusBarData.style == 'style-1'" class="content-wrap" :class="[topStatusBarData.textAlign]" :style="navbarInnerStyle">
|
||||
<view v-if="isBack" class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack"></view>
|
||||
<view class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :class="{'!text-transparent': !isBackShow}" :style="{ color: titleTextColor }" @tap="goBack"></view>
|
||||
<view class="title-wrap" :style="styleOneFontSize">{{ data.title }}</view>
|
||||
</view>
|
||||
<view v-if="topStatusBarData.style == 'style-2'" class="content-wrap" :style="navbarInnerStyle" @click="diyStore.toRedirect(topStatusBarData.link)">
|
||||
<view v-if="isBack" class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack"></view>
|
||||
<view class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" :class="{'!text-transparent': !isBackShow}" @tap="goBack"></view>
|
||||
<view class="title-wrap" :style="{ color: topStatusBarData.textColor }">
|
||||
<view>
|
||||
<image :src="img(topStatusBarData.imgUrl)" mode="heightFix"/>
|
||||
@ -17,7 +17,7 @@
|
||||
</view>
|
||||
|
||||
<view v-if="topStatusBarData.style == 'style-3'" :style="navbarInnerStyle" class="content-wrap">
|
||||
<view v-if="isBack" class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack"></view>
|
||||
<view class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack" :class="{'!text-transparent': !isBackShow}"></view>
|
||||
<view class="title-wrap" @click="diyStore.toRedirect(topStatusBarData.link)">
|
||||
<image :src="img(topStatusBarData.imgUrl)" mode="heightFix"/>
|
||||
</view>
|
||||
@ -29,7 +29,7 @@
|
||||
</view>
|
||||
|
||||
<view v-if="topStatusBarData.style == 'style-4'" :style="navbarInnerStyle" class="content-wrap">
|
||||
<view v-if="isBack" class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack"></view>
|
||||
<view class="back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack" :class="{'!text-transparent': !isBackShow}"></view>
|
||||
<text class="nc-iconfont nc-icon-dizhiguanliV6xx text-[28rpx]" :style="{ color: topStatusBarData.textColor }"></text>
|
||||
<view class="title-wrap" @click.stop="locationVal.reposition()" :style="{ color: topStatusBarData.textColor }" v-if="systemStore.diyAddressInfo">{{ systemStore.diyAddressInfo.community }}</view>
|
||||
<view class="title-wrap" @click.stop="locationVal.reposition()" :style="{ color: topStatusBarData.textColor }" v-else>{{ systemStore.defaultPositionAddress }}</view>
|
||||
@ -50,10 +50,8 @@ import useSystemStore from '@/stores/system';
|
||||
import useDiyStore from '@/app/stores/diy';
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
|
||||
// 获取系统状态栏的高度
|
||||
let systemInfo = uni.getSystemInfoSync();
|
||||
let platform = systemInfo.platform;
|
||||
const systemStore = useSystemStore();
|
||||
const systemStore = useSystemStore()
|
||||
let platform = systemStore.systemInfo.platform;
|
||||
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
@ -90,7 +88,7 @@ const props = defineProps({
|
||||
// 控制-定位后是否对导航栏进行填充
|
||||
const isFill = computed(() => {
|
||||
let bool = true;
|
||||
if (imageAdsSameScreen.value) {
|
||||
if (diyStore.imageAdsSameScreen) {
|
||||
bool = false;
|
||||
} else {
|
||||
bool = props.isFill;
|
||||
@ -109,7 +107,6 @@ const topStatusBarData = computed(() => {
|
||||
// 导航栏内部盒子的样式
|
||||
const navbarInnerStyle = computed(() => {
|
||||
let style = '';
|
||||
|
||||
if (props.isBack) {
|
||||
style += 'padding-left: 30rpx;';//30=>右边留边 44=>箭头宽度 10=>箭头的右maring
|
||||
if (topStatusBarData.value.style == 'style-1') //样式一需要居中需要有右边padding辅助
|
||||
@ -188,40 +185,23 @@ if (componentsScrollVal) {
|
||||
/******************************* 存储滚动值-end ***********************/
|
||||
|
||||
/******************************* 返回按钮-start ***********************/
|
||||
// const isBackShow = ref(false);
|
||||
let pages = getCurrentPages();
|
||||
const isBackShow = computed(() => {
|
||||
let bool = false;
|
||||
if (props.isBack && pages.length > 1) {
|
||||
bool = true;
|
||||
}
|
||||
return bool;
|
||||
})
|
||||
|
||||
// 返回按钮的函数
|
||||
const goBack = () => {
|
||||
// 兼容小程序,未登录状态下点击某个功能跳转到登录页,不登录无法返回的情况
|
||||
if (pages.length === 1) {
|
||||
if (pages[0].route === 'app/pages/auth/index') {
|
||||
uni.getStorage({
|
||||
key: 'loginBack',
|
||||
success: (res: any) => {
|
||||
res ? redirect(
|
||||
{
|
||||
...res.data,
|
||||
mode: 'redirectTo'
|
||||
}
|
||||
) : redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||
},
|
||||
fail: (res) => {
|
||||
redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||
}
|
||||
});
|
||||
} else if (typeof props.customBack === 'function') {
|
||||
props.customBack();
|
||||
} else {
|
||||
redirect({ url: '/app/pages/index/index', mode: 'switchTab' });
|
||||
}
|
||||
if(!isBackShow.value) return;
|
||||
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
||||
if (typeof props.customBack === 'function') {
|
||||
props.customBack();
|
||||
} else {
|
||||
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
||||
if (typeof props.customBack === 'function') {
|
||||
props.customBack();
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
/******************************* 返回按钮-end ***********************/
|
||||
@ -238,12 +218,14 @@ const instance = getCurrentInstance();
|
||||
// #ifdef MP
|
||||
let statusBarHeight = systemStore.menuButtonInfo.height + systemStore.menuButtonInfo.top + 8;
|
||||
placeholderHeight.value = statusBarHeight || 0;
|
||||
systemStore.setTopTabbar({ height: placeholderHeight.value })
|
||||
// #endif
|
||||
const navbarPlaceholderHeight = () => {
|
||||
nextTick(() => {
|
||||
const query = uni.createSelectorQuery().in(instance);
|
||||
query.select('.ns-navbar-wrap .u-navbar .content-wrap').boundingClientRect(data => {
|
||||
placeholderHeight.value = data ? data.height : 0;
|
||||
systemStore.setTopTabbar({ height: placeholderHeight.value })
|
||||
diyStore.$patch((state) => {
|
||||
state.topTabarHeight = placeholderHeight.value
|
||||
})
|
||||
@ -261,20 +243,10 @@ const locationVal = useLocation(isOpenLocation);
|
||||
locationVal.onLoad();
|
||||
locationVal.init();
|
||||
/************** 定位-end ****************/
|
||||
let imageAdsSameScreen = ref(false);
|
||||
onMounted(() => {
|
||||
navbarPlaceholderHeight();
|
||||
// if (pages.length > 1) {
|
||||
// isBackShow.value = true;
|
||||
// // 兼容小程序,未登录状态下点击某个功能跳转到登录页,不登录无法返回的情况
|
||||
// }else if(pages.length == 1 && pages[0].route == 'app/pages/auth/index'){
|
||||
// isBackShow.value = true;
|
||||
// }
|
||||
// 刷新定位
|
||||
locationVal.refresh();
|
||||
|
||||
// 图文导航开启沉浸式且导航栏开启时,导航栏不占位
|
||||
imageAdsSameScreen.value = uni.getStorageSync('imageAdsSameScreen') || false;
|
||||
});
|
||||
|
||||
// 页面onShow调用时,也会触发改方法
|
||||
@ -387,8 +359,8 @@ defineExpose({
|
||||
&.style-3 {
|
||||
.content-wrap {
|
||||
.title-wrap {
|
||||
height: 60rpx;
|
||||
max-width: 170rpx;
|
||||
height: 46rpx;
|
||||
max-width: 300rpx;
|
||||
flex: initial;
|
||||
text-align: center;
|
||||
margin-right: 10rpx;
|
||||
|
||||
@ -65,12 +65,12 @@ const props = defineProps({
|
||||
// 骨架的背景色
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: '' // #EAEDF5
|
||||
default: '#EAEDF5' // #EAEDF5
|
||||
},
|
||||
// 骨架的动画高亮背景色
|
||||
highlightBgColor: {
|
||||
type: String,
|
||||
default: '' // #F9FAFF
|
||||
default: '#F9FAFF' // #F9FAFF
|
||||
},
|
||||
// 自定义配置
|
||||
config: {
|
||||
@ -220,7 +220,9 @@ const addUnit = (value = 'auto', unit = 'px') => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@mixin background {
|
||||
background: linear-gradient(90deg, var(--bgColor) 25%, var(--highlightBgColor) 37%, var(--bgColor) 50%);
|
||||
//background: linear-gradient(90deg, var(--bgColor) 25%, var(--highlightBgColor) 37%, var(--bgColor) 50%);
|
||||
background: linear-gradient(90deg, #EAEDF5 25%, #F9FAFF 37%, #EAEDF5 50%);
|
||||
|
||||
background-size: 400% 100%;
|
||||
}
|
||||
|
||||
@ -261,7 +263,8 @@ const addUnit = (value = 'auto', unit = 'px') => {
|
||||
|
||||
.fade-out {
|
||||
opacity: 0;
|
||||
animation: fadeOutAnim var(--fadeOutTime);
|
||||
//animation: fadeOutAnim var(--fadeOutTime);
|
||||
animation: fadeOutAnim 0.5s;
|
||||
}
|
||||
|
||||
@keyframes fadeOutAnim {
|
||||
@ -274,7 +277,8 @@ const addUnit = (value = 'auto', unit = 'px') => {
|
||||
}
|
||||
|
||||
.animate {
|
||||
animation: skeletonAnim var(--animateTime) ease infinite;
|
||||
//animation: skeletonAnim var(--animateTime) ease infinite;
|
||||
animation: skeletonAnim 1.8s ease infinite;
|
||||
}
|
||||
|
||||
@keyframes skeletonAnim {
|
||||
|
||||
@ -38,12 +38,12 @@ export function useDiy(params: any = {}) {
|
||||
const isShowTopTabbar = ref(false);
|
||||
|
||||
const pageStyle = () => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (data.value.global.pageStartBgColor) {
|
||||
if (data.value.global.pageStartBgColor && data.value.global.pageEndBgColor) style += `background:linear-gradient(${ data.value.global.pageGradientAngle },${ data.value.global.pageStartBgColor },${ data.value.global.pageEndBgColor });`;
|
||||
else style += 'background-color:' + data.value.global.pageStartBgColor + ';';
|
||||
}
|
||||
if (data.value.global.bottomTabBarSwitch) {
|
||||
if (data.value.global.bottomTabBar && data.value.global.bottomTabBar.isShow) {
|
||||
style += 'min-height:calc(100vh - 50px);';
|
||||
} else {
|
||||
style += 'min-height:calc(100vh);';
|
||||
@ -123,6 +123,7 @@ export function useDiy(params: any = {}) {
|
||||
diyData.value = sources.value;
|
||||
diyData.value.forEach((item: any, index) => {
|
||||
item.pageStyle = '';
|
||||
item.componentIsShow = true // 是否显示
|
||||
if (item.pageStartBgColor) {
|
||||
if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${ item.pageGradientAngle },${ item.pageStartBgColor },${ item.pageEndBgColor });`;
|
||||
else item.pageStyle += 'background-color:' + item.pageStartBgColor + ';';
|
||||
@ -201,6 +202,7 @@ export function useDiy(params: any = {}) {
|
||||
if (e.scrollTop > 0) {
|
||||
diyStore.scrollTop = e.scrollTop;
|
||||
}
|
||||
uni.$emit('scroll')
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -41,12 +41,12 @@ export function useDiyForm(params: any = {}) {
|
||||
const isShowTopTabbar = ref(false);
|
||||
|
||||
const pageStyle = () => {
|
||||
var style = '';
|
||||
let style = '';
|
||||
if (data.value.global.pageStartBgColor) {
|
||||
if (data.value.global.pageStartBgColor && data.value.global.pageEndBgColor) style += `background:linear-gradient(${ data.value.global.pageGradientAngle },${ data.value.global.pageStartBgColor },${ data.value.global.pageEndBgColor });`;
|
||||
else style += 'background-color:' + data.value.global.pageStartBgColor + ';';
|
||||
}
|
||||
if (data.value.global.bottomTabBarSwitch) {
|
||||
if (data.value.global.bottomTabBar && data.value.global.bottomTabBar.isShow) {
|
||||
style += 'min-height:calc(100vh - 50px);';
|
||||
} else {
|
||||
style += 'min-height:calc(100vh);';
|
||||
@ -146,7 +146,7 @@ export function useDiyForm(params: any = {}) {
|
||||
// 匹配缓存,赋值
|
||||
let diyFormStorage = uni.getStorageSync('diyFormStorage_' + diyStore.id)
|
||||
if (diyFormStorage) {
|
||||
var date = new Date();
|
||||
const date = new Date();
|
||||
let currentTime: any = parseInt(date.getTime() / 1000); // 存储信息 5分钟内有效,过期后将重新获取定位信息
|
||||
if (diyFormStorage.validTime > currentTime) {
|
||||
if (diyFormStorage.components) {
|
||||
@ -176,6 +176,7 @@ export function useDiyForm(params: any = {}) {
|
||||
diyData.global = sources.global;
|
||||
diyData.value = sources.value;
|
||||
diyData.value.forEach((item: any, index) => {
|
||||
item.componentIsShow = true // 是否显示
|
||||
if (item.isHidden) {
|
||||
// 隐藏组件
|
||||
diyData.value.splice(index, 1)
|
||||
|
||||
@ -184,7 +184,7 @@ export function useLocation(isOpenLocation: any) {
|
||||
const locationStorage = () => {
|
||||
let data = uni.getStorageSync('location_address');
|
||||
if (data) {
|
||||
var date = new Date();
|
||||
const date = new Date();
|
||||
if (systemStore.mapConfig.valid_time > 0) {
|
||||
data.is_expired = (date.getTime() / 1000) > data.valid_time; // 是否过期
|
||||
} else {
|
||||
|
||||
@ -4,7 +4,7 @@ import {
|
||||
updateWeappOpenid,
|
||||
updateWechatOpenid,
|
||||
wechatUser,
|
||||
wechatUserLogin
|
||||
wechatUserLogin, updateWechatOpenidByH5
|
||||
} from '@/app/api/auth'
|
||||
import { getWechatAuthCode } from '@/app/api/system'
|
||||
import useMemberStore from '@/stores/member'
|
||||
@ -37,11 +37,11 @@ export function useLogin() {
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
redirect({ url: '/app/pages/auth/login', param: { type: 'username' }, mode: 'redirectTo' })
|
||||
redirect({ url: '/app/pages/auth/login', param: { type: 'username' } })
|
||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
} else {
|
||||
redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
|
||||
redirect({ url: '/app/pages/auth/index' })
|
||||
}
|
||||
// #endif
|
||||
|
||||
@ -49,20 +49,20 @@ export function useLogin() {
|
||||
if (isWeixinBrowser()) {
|
||||
// 微信浏览器
|
||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
redirect({ url: '/app/pages/auth/login', param: { type: 'username' }, mode: 'redirectTo' })
|
||||
redirect({ url: '/app/pages/auth/login', param: { type: 'username' } })
|
||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
} else {
|
||||
redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
|
||||
redirect({ url: '/app/pages/auth/index' })
|
||||
}
|
||||
} else {
|
||||
// 普通浏览器
|
||||
if (config.login.is_username && !config.login.is_mobile) {
|
||||
redirect({ url: '/app/pages/auth/login', param: { type: 'username' }, mode: 'redirectTo' })
|
||||
redirect({ url: '/app/pages/auth/login', param: { type: 'username' } })
|
||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
} else {
|
||||
redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
|
||||
redirect({ url: '/app/pages/auth/index' })
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
@ -192,8 +192,12 @@ export function useLogin() {
|
||||
// 强制获取昵称和头像,先存储起来
|
||||
uni.setStorageSync('openid', res.data.openid)
|
||||
uni.setStorageSync('unionid', res.data.unionid)
|
||||
if (res.data.nickname) uni.setStorageSync('nickname', res.data.nickname)
|
||||
if (res.data.avatar) uni.setStorageSync('avatar', res.data.avatar)
|
||||
if(res.data.nickname){
|
||||
uni.setStorageSync('nickname', res.data.nickname)
|
||||
}
|
||||
if(res.data.avatar){
|
||||
uni.setStorageSync('avatar', res.data.avatar)
|
||||
}
|
||||
|
||||
// 开启绑定手机号标识
|
||||
if (uni.getStorageSync('isBindMobile')) {
|
||||
@ -317,24 +321,37 @@ export function useLogin() {
|
||||
query.code && (delete query.code)
|
||||
Object.keys(query).length && (url += uni.$u.queryParams(query))
|
||||
}
|
||||
|
||||
// // 强制授权加强制绑定手机号定义URL
|
||||
// if(uni.getStorageSync('mandatory_Mobile')){
|
||||
// url = `${ location.origin }${ location.pathname }`
|
||||
// }
|
||||
getWechatAuthCode({
|
||||
url,
|
||||
scopes: params.scopes
|
||||
}).then((res: any) => {
|
||||
uni.setStorageSync('wechat_login_back', true) // 微信公众号手动授权登录回调标识
|
||||
// location.replace(res.data.url);
|
||||
// uni.setStorageSync('mandatory_Mobile', true) // 微信授权登录+强制绑定手机号标识
|
||||
// location.replace(res.data.url);
|
||||
location.href = res.data.url
|
||||
})
|
||||
|
||||
// #endif
|
||||
}
|
||||
|
||||
const updateWechatOpenidForH5 = (wx_openid: any) => {
|
||||
if(!wx_openid) return;
|
||||
updateWechatOpenidByH5({ wx_openid }).then(res => {
|
||||
const memberInfo = useMemberStore().info
|
||||
memberInfo && memberInfo.wx_openid && uni.setStorageSync('openid', memberInfo.wx_openid)
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
setLoginBack,
|
||||
handleLoginBack,
|
||||
authLogin,
|
||||
updateOpenid,
|
||||
getAuthCode
|
||||
getAuthCode,
|
||||
updateWechatOpenidForH5
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,8 +8,8 @@ import wechat from '@/utils/wechat'
|
||||
// #endif
|
||||
|
||||
export const useShare = () => {
|
||||
var wechatOptions: any = {};
|
||||
var weappOptions: any = {};
|
||||
let wechatOptions: any = {};
|
||||
let weappOptions: any = {};
|
||||
|
||||
const wechatInit = () => {
|
||||
if (!isWeixinBrowser()) return;
|
||||
@ -60,7 +60,6 @@ export const useShare = () => {
|
||||
query: queryStr.join('&'),
|
||||
}
|
||||
// #endif
|
||||
|
||||
if (options && Object.keys(options).length) {
|
||||
|
||||
if (options.wechat) {
|
||||
@ -88,8 +87,8 @@ export const useShare = () => {
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
getShareInfo({
|
||||
}
|
||||
getShareInfo({
|
||||
route: '/' + currRoute(),
|
||||
params: JSON.stringify(currShareRoute().params)
|
||||
}).then((res: any) => {
|
||||
@ -116,10 +115,11 @@ export const useShare = () => {
|
||||
weappOptions.imageUrl = weapp.url ? img(weapp.url) : ''
|
||||
}
|
||||
// #endif
|
||||
|
||||
if(!weappOptions.title && !weappOptions.imageUrl){
|
||||
return;
|
||||
}
|
||||
uni.setStorageSync('weappOptions', weappOptions)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 小程序分享,分享给好友
|
||||
|
||||
@ -14,6 +14,7 @@ class Language {
|
||||
/**
|
||||
*
|
||||
* @param locale 设置语言
|
||||
* @param path
|
||||
*/
|
||||
public setI18nLanguage(locale: string, path: string = '') {
|
||||
if (this.i18n.global.locale == locale) return
|
||||
|
||||
@ -42,140 +42,5 @@
|
||||
"pages.verify.record": "核销记录",
|
||||
"pages.friendspay.share": "找朋友帮忙付",
|
||||
"pages.friendspay.money": "",
|
||||
"pages.webview.index": "",
|
||||
"tourism.pages.way.list": "线路列表",
|
||||
"tourism.pages.way.detail": "线路详情",
|
||||
"tourism.pages.way.order": "线路订单",
|
||||
"tourism.pages.hotel.list": "酒店列表",
|
||||
"tourism.pages.hotel.detail": "酒店详情",
|
||||
"tourism.pages.hotel.order": "酒店订单",
|
||||
"tourism.pages.scenic.list": "景点列表",
|
||||
"tourism.pages.scenic.detail": "景点详情",
|
||||
"tourism.pages.scenic.order": "景点订单",
|
||||
"tourism.pages.order.list": "旅游订单",
|
||||
"tourism.pages.order.detail": "订单详情",
|
||||
"tourism.pages.verify.index": "核销",
|
||||
"tourism.pages.verify.record": "核销记录",
|
||||
"tourism.pages.verify.detail": "核销详情",
|
||||
"vipcard.pages.verify.index": "核销",
|
||||
"vipcard.pages.verify.record": "核销记录",
|
||||
"vipcard.pages.verify.detail": "核销详情",
|
||||
"vipcard.pages.order.payment": "订单结算",
|
||||
"vipcard.pages.order.list": "订单列表",
|
||||
"vipcard.pages.order.my_reserved": "我的预约",
|
||||
"vipcard.pages.order.my_reserved_detail": "我的预约详情",
|
||||
"vipcard.pages.order.my_card": "我的卡项",
|
||||
"vipcard.pages.order.detail": "订单详情",
|
||||
"vipcard.pages.service.list": "项目列表",
|
||||
"vipcard.pages.card.list": "卡项列表",
|
||||
"vipcard.pages.card.detail": "卡项详情",
|
||||
"recharge.pages.recharge": "充值",
|
||||
"recharge.pages.recharge_record": "充值记录",
|
||||
"recharge.pages.recharge_record_detail": "充值记录详情",
|
||||
"shop.pages.goods.search": "搜索",
|
||||
"shop.pages.goods.cart": "购物车",
|
||||
"shop.pages.goods.collect": "商品收藏",
|
||||
"shop.pages.goods.browse": "我的足迹",
|
||||
"shop.pages.goods.category": "商品分类",
|
||||
"shop.pages.goods.detail": "商品详情",
|
||||
"shop.pages.goods.list": "商品列表",
|
||||
"shop.pages.goods.rank": "排行榜",
|
||||
"shop.pages.member.index": "个人中心",
|
||||
"shop.pages.member.my_coupon": "我的优惠券",
|
||||
"shop.pages.order.list": "订单列表",
|
||||
"shop.pages.order.detail": "订单详情",
|
||||
"shop.pages.order.payment": "待付款订单",
|
||||
"shop.pages.evaluate.order_evaluate": "商品评价",
|
||||
"shop.pages.evaluate.order_evaluate_view": "商品评价",
|
||||
"shop.pages.evaluate.list": "评价列表",
|
||||
"shop.pages.coupon.list": "优惠券列表",
|
||||
"shop.pages.coupon.detail": "优惠券详情",
|
||||
"shop.pages.discount.list": "限时折扣",
|
||||
"shop.pages.refund.list": "退款列表",
|
||||
"shop.pages.refund.detail": "退款详情",
|
||||
"shop.pages.refund.apply": "申请退款",
|
||||
"shop.pages.refund.edit_apply": "编辑退款信息",
|
||||
"shop.pages.refund.log": "协商记录",
|
||||
"shop.pages.point.index": "积分商城",
|
||||
"shop.pages.point.list": "积分商品列表",
|
||||
"shop.pages.point.detail": "积分商品详情",
|
||||
"shop.pages.point.payment": "待付款订单",
|
||||
"shop.pages.point.order_list": "积分兑换记录",
|
||||
"shop.pages.newcomer.list": "新人专享",
|
||||
"cms.pages.list": "资讯中心",
|
||||
"cms.pages.detail": "文章详情",
|
||||
"shop_fenxiao.pages.index": "分销中心",
|
||||
"shop_fenxiao.pages.zone": "分销专区",
|
||||
"shop_fenxiao.pages.level": "分销商等级",
|
||||
"shop_fenxiao.pages.child_fenxiao": "分销商",
|
||||
"shop_fenxiao.pages.goods": "分销商品",
|
||||
"shop_fenxiao.pages.team": "我的团队",
|
||||
"shop_fenxiao.pages.ranking_list": "排行榜",
|
||||
"shop_fenxiao.pages.agent_list": "渠道代理",
|
||||
"shop_fenxiao.pages.bill": "账单",
|
||||
"shop_fenxiao.pages.order": "分销订单",
|
||||
"shop_fenxiao.pages.order_detail": "订单详情",
|
||||
"shop_fenxiao.pages.apply": "分销商申请",
|
||||
"shop_fenxiao.pages.task_rewards": "任务奖励",
|
||||
"shop_fenxiao.pages.task_detail": "任务奖励详情",
|
||||
"shop_fenxiao.pages.task_rewards_detail": "任务奖励明细",
|
||||
"shop_fenxiao.pages.sale": "销售奖励",
|
||||
"shop_fenxiao.pages.sale_detail": "销售奖励详情",
|
||||
"shop_fenxiao.pages.sale_ranking": "销售奖励排行榜",
|
||||
"shop_fenxiao.pages.promote_code": "分享海报",
|
||||
"shop_giftcard.pages.index": "礼品卡首页",
|
||||
"shop_giftcard.pages.list": "礼品卡列表",
|
||||
"shop_giftcard.pages.detail": "加载中",
|
||||
"shop_giftcard.pages.order_list": "礼品卡订单列表",
|
||||
"shop_giftcard.pages.order_detail": "礼品卡订单详情",
|
||||
"shop_giftcard.pages.member": "我的",
|
||||
"shop_giftcard.pages.my_card_list": "我的卡包",
|
||||
"shop_giftcard.pages.card_bag": "我的卡包",
|
||||
"shop_giftcard.pages.activate": "卡密激活",
|
||||
"shop_giftcard.pages.receive_list": "收到的礼品卡",
|
||||
"shop_giftcard.pages.give_list": "送出的礼品卡",
|
||||
"shop_giftcard.pages.give_detail": "送出礼品卡详情",
|
||||
"shop_giftcard.pages.give": "礼品卡赠送",
|
||||
"shop_giftcard.pages.receive_info": "领取礼品卡",
|
||||
"shop_giftcard.pages.use_card": "礼品卡使用",
|
||||
"shop_giftcard.pages.use_goods_select": "选择兑换商品",
|
||||
"shop_giftcard.pages.payment": "待付款订单",
|
||||
"shop.pages.pay.index": "待支付",
|
||||
"shop.pages.pay.result": "",
|
||||
"shop_fenxiao.pages.promote": "邀请好友",
|
||||
"shop_fenxiao.pages.team_dividend": "团队分红",
|
||||
"o2o.pages.address.edit": "编辑地址",
|
||||
"o2o.pages.address.index": "地址",
|
||||
"o2o.pages.goods.category": "项目分类",
|
||||
"o2o.pages.goods.detail": "项目详情",
|
||||
"o2o.pages.goods.list": "项目列表",
|
||||
"o2o.pages.index": "首页",
|
||||
"o2o.pages.master.statistics.index": "技师中心",
|
||||
"o2o.pages.master.task.add": "师傅报单",
|
||||
"o2o.pages.master.task.detail": "任务详情",
|
||||
"o2o.pages.master.task.list": "任务列表",
|
||||
"o2o.pages.master.task.refund": "查看退款",
|
||||
"o2o.pages.master.task.show": "报单详情",
|
||||
"o2o.pages.member.index": "个人中心",
|
||||
"o2o.pages.order.detail": "订单详情",
|
||||
"o2o.pages.order.list": "订单列表",
|
||||
"o2o.pages.order.payment": "订单结算",
|
||||
"o2o.pages.refund.apply": "申请退款",
|
||||
"o2o.pages.refund.detail": "退款详情",
|
||||
"o2o.pages.refund.list": "退款列表",
|
||||
"o2o.pages.refund.log": "协商记录",
|
||||
"o2o.pages.technician.detail": "技师详情",
|
||||
"o2o.pages.technician.list": "技师列表",
|
||||
"shop_giftcard.pages.member_give_info": "送出礼品卡详情",
|
||||
"shop_giftcard.pages.give_info": "领取礼品卡",
|
||||
"sow_community.pages.index": "种草社区",
|
||||
"sow_community.pages.search": "搜索",
|
||||
"sow_community.pages.image.detail": "内容详情",
|
||||
"sow_community.pages.video.detail": "内容详情",
|
||||
"sow_community.pages.member": "个人主页",
|
||||
"sow_community.pages.create": "发布内容",
|
||||
"sow_community.pages.follow": "关注列表",
|
||||
"sow_community.pages.sow_show": "种草秀",
|
||||
"sow_community.pages.topic_list": "话题列表",
|
||||
"template_flower_industry.pages.goods.list": "商品列表"
|
||||
"pages.webview.index": ""
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "",
|
||||
"appid" : "__UNI__ED923AB",
|
||||
"appid" : "__UNI__9B03DBD",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { getConfig } from '@/app/api/auth'
|
||||
import { isWeixinBrowser } from "@/utils/common";
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
interface loginConfig {
|
||||
is_username: number | boolean,
|
||||
@ -54,7 +55,8 @@ const useConfigStore = defineStore('config', {
|
||||
let url = '';
|
||||
// #ifdef H5
|
||||
if (isWeixinBrowser()) {
|
||||
url = uni.getSystemInfoSync().platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||
const systemStore = useSystemStore()
|
||||
url = systemStore.systemInfo.platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||
}
|
||||
// #endif
|
||||
await getConfig({ url }).then((res: any) => {
|
||||
|
||||
@ -46,6 +46,16 @@ const useMemberStore = defineStore('member', {
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
if (this.info && this.info.wx_openid) {
|
||||
// 如果会员已存在则小程序端快捷登录时不再弹出授权弹框
|
||||
uni.setStorageSync('member_exist', 1)
|
||||
} else {
|
||||
const login = useLogin()
|
||||
login.updateWechatOpenidForH5(uni.getStorageSync('openid'));
|
||||
}
|
||||
// #endif
|
||||
|
||||
if (callback) callback();
|
||||
}).catch(() => {
|
||||
this.logout()
|
||||
@ -61,7 +71,7 @@ const useMemberStore = defineStore('member', {
|
||||
// if (useConfigStore().login.is_auth_register) {
|
||||
uni.setStorageSync('autoLoginLock', true) // todo 普通账号退出登录,在进行三方账号登录不会自动登录
|
||||
// }
|
||||
let clearStorage = () =>{
|
||||
let clearStorage = () => {
|
||||
removeToken()
|
||||
uni.removeStorageSync('wap_member_info');
|
||||
// uni.removeStorageSync('openid');
|
||||
@ -69,6 +79,10 @@ const useMemberStore = defineStore('member', {
|
||||
uni.removeStorageSync('isBindMobile');
|
||||
uni.removeStorageSync('nickname');
|
||||
uni.removeStorageSync('avatar');
|
||||
// 可能重复请求微信获取手机号接口
|
||||
uni.removeStorageSync('wap_member_mobile');
|
||||
uni.removeStorageSync('wap_member_id');
|
||||
uni.removeStorageSync('wap_member_not_control_mobile');
|
||||
isRedirect && redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||
}
|
||||
logout().then(() => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { getInitInfo, getSiteInfo } from '@/app/api/system'
|
||||
import { getInitInfo, getSiteInfo, getMemberMobileExist } from '@/app/api/system'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import { isWeixinBrowser } from '@/utils/common'
|
||||
@ -20,7 +20,11 @@ interface System {
|
||||
path: string,
|
||||
query: object
|
||||
},
|
||||
isAddCartRecommend: boolean // 是否添加购物车推荐
|
||||
systemInfo: any, // 系统设备信息
|
||||
topTabbarInfo: {
|
||||
height: number
|
||||
fullHeight: string
|
||||
}
|
||||
}
|
||||
|
||||
const useSystemStore = defineStore('system', {
|
||||
@ -36,10 +40,10 @@ const useSystemStore = defineStore('system', {
|
||||
},
|
||||
initStatus: 'wait',
|
||||
menuButtonInfo: {
|
||||
height: '',
|
||||
top: '',
|
||||
right: '',
|
||||
width: ''
|
||||
height: 0,
|
||||
top: 0,
|
||||
right: 0,
|
||||
width: 0
|
||||
},
|
||||
shareCallback: null,
|
||||
defaultPositionAddress: '定位中',
|
||||
@ -48,7 +52,11 @@ const useSystemStore = defineStore('system', {
|
||||
path: '',
|
||||
query: {}
|
||||
},
|
||||
isAddCartRecommend: false
|
||||
systemInfo: null,
|
||||
topTabbarInfo: {
|
||||
height: 0,
|
||||
fullHeight: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@ -58,7 +66,7 @@ const useSystemStore = defineStore('system', {
|
||||
let url = '';
|
||||
// #ifdef H5
|
||||
if (isWeixinBrowser()) {
|
||||
url = uni.getSystemInfoSync().platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||
url = this.systemInfo.platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||
}
|
||||
// #endif
|
||||
|
||||
@ -68,7 +76,6 @@ const useSystemStore = defineStore('system', {
|
||||
}).then((res: any) => {
|
||||
if (res.data) {
|
||||
let data = res.data;
|
||||
|
||||
// 底部导航
|
||||
const configStore = useConfigStore()
|
||||
configStore.tabbarList = data.tabbar_list;
|
||||
@ -108,6 +115,7 @@ const useSystemStore = defineStore('system', {
|
||||
// 如果会员已存在则小程序端快捷登录时不再弹出授权弹框
|
||||
uni.setStorageSync('member_exist', data.member_exist)
|
||||
|
||||
|
||||
this.initStatus = 'finish'; // 初始化完成
|
||||
|
||||
if (uni.getStorageSync('isBindMobile')) {
|
||||
@ -119,6 +127,14 @@ const useSystemStore = defineStore('system', {
|
||||
|
||||
this.getMenuButtonInfoFn();
|
||||
},
|
||||
// 如果已有手机号,就不弹出绑定手机号弹框
|
||||
getMemberMobileExistFn() {
|
||||
getMemberMobileExist({
|
||||
openid: uni.getStorageSync('openid')
|
||||
}).then((res: any) => {
|
||||
uni.setStorageSync('member_mobile_exist', res.data.member_mobile_exist)
|
||||
})
|
||||
},
|
||||
getMenuButtonInfoFn() {
|
||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||
@ -139,7 +155,7 @@ const useSystemStore = defineStore('system', {
|
||||
setAddressInfo(data: any = {}) {
|
||||
let addressInfo = cloneDeep(data);
|
||||
// 过期时间
|
||||
var date = new Date();
|
||||
const date = new Date();
|
||||
date.setSeconds(60 * this.mapConfig.valid_time);
|
||||
addressInfo.valid_time = date.getTime() / 1000; // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||
|
||||
@ -154,6 +170,11 @@ const useSystemStore = defineStore('system', {
|
||||
} else {
|
||||
uni.removeStorageSync('location_address');
|
||||
}
|
||||
},
|
||||
setTopTabbar(data: any = {}) {
|
||||
this.topTabbarInfo = Object.assign({}, this.topTabbarInfo, data);
|
||||
this.topTabbarInfo.height = this.topTabbarInfo.height || 0
|
||||
this.topTabbarInfo.fullHeight = this.topTabbarInfo.height ? this.topTabbarInfo.height+'px' : 0
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "nc-iconfont"; /* Project id 4567203 */
|
||||
src: url('//at.alicdn.com/t/c/font_4567203_90bek9j2oeh.woff2?t=1750242885299') format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_90bek9j2oeh.woff?t=1750242885299') format('woff'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_90bek9j2oeh.ttf?t=1750242885299') format('truetype');
|
||||
src: url('//at.alicdn.com/t/c/font_4567203_r3nkqy7l1w.woff2?t=1750327830437') format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_r3nkqy7l1w.woff?t=1750327830437') format('woff'),
|
||||
url('//at.alicdn.com/t/c/font_4567203_r3nkqy7l1w.ttf?t=1750327830437') format('truetype');
|
||||
}
|
||||
|
||||
.nc-iconfont {
|
||||
@ -13,6 +13,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.nc-icon-xiaochengxu:before {
|
||||
content: "\e8a8";
|
||||
}
|
||||
|
||||
.nc-icon-qianV6xx:before {
|
||||
content: "\e784";
|
||||
}
|
||||
|
||||
@ -1,2 +1 @@
|
||||
[
|
||||
]
|
||||
[]
|
||||
@ -132,9 +132,10 @@ export default {
|
||||
})
|
||||
},
|
||||
/**
|
||||
* ref 触发 动画分组
|
||||
* @param {Object} obj
|
||||
*/
|
||||
* ref 触发 动画分组
|
||||
* @param {Object} obj
|
||||
* @param config
|
||||
*/
|
||||
step(obj, config = {}) {
|
||||
if (!this.animation) return
|
||||
for (let i in obj) {
|
||||
|
||||
@ -26,14 +26,12 @@ export const redirect = (redirect: any) => {
|
||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
url = '/app/pages/auth/login'
|
||||
param = { type: 'username' }
|
||||
mode = 'redirectTo'
|
||||
newLogin = true
|
||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
return;
|
||||
} else {
|
||||
url = '/app/pages/auth/index'
|
||||
mode = 'redirectTo'
|
||||
newLogin = true
|
||||
}
|
||||
// #endif
|
||||
@ -44,14 +42,12 @@ export const redirect = (redirect: any) => {
|
||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
url = '/app/pages/auth/login'
|
||||
param = { type: 'username' }
|
||||
mode = 'redirectTo'
|
||||
newLogin = true
|
||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
return;
|
||||
} else {
|
||||
url = '/app/pages/auth/index'
|
||||
mode = 'redirectTo'
|
||||
newLogin = true
|
||||
}
|
||||
} else {
|
||||
@ -59,14 +55,12 @@ export const redirect = (redirect: any) => {
|
||||
if (config.login.is_username && !config.login.is_mobile) {
|
||||
url = '/app/pages/auth/login'
|
||||
param = { type: 'username' }
|
||||
mode = 'redirectTo'
|
||||
newLogin = true
|
||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile) {
|
||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||
return;
|
||||
} else {
|
||||
url = '/app/pages/auth/index'
|
||||
mode = 'redirectTo'
|
||||
newLogin = true
|
||||
}
|
||||
}
|
||||
@ -375,17 +369,17 @@ export function getSiteId(siteId: number | string) {
|
||||
*/
|
||||
export function timeStampTurnTime(timeStamp: any, type = "") {
|
||||
if (timeStamp != undefined && timeStamp != "" && timeStamp > 0) {
|
||||
var date = new Date();
|
||||
const date = new Date();
|
||||
date.setTime(timeStamp * 1000);
|
||||
var y = date.getFullYear();
|
||||
var m: any = date.getMonth() + 1;
|
||||
const y = date.getFullYear();
|
||||
let m: any = date.getMonth() + 1;
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
var d: any = date.getDate();
|
||||
let d: any = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
var h: any = date.getHours();
|
||||
let h: any = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
var minute: any = date.getMinutes();
|
||||
var 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) {
|
||||
@ -404,7 +398,7 @@ export function timeStampTurnTime(timeStamp: any, type = "") {
|
||||
|
||||
/**
|
||||
* 日期格式转时间戳
|
||||
* @param {Object} date
|
||||
* @param dateStr
|
||||
*/
|
||||
export function timeTurnTimeStamp(dateStr: string) {
|
||||
let timestamp;
|
||||
@ -461,7 +455,7 @@ export function timeTurnTimeStamp(dateStr: string) {
|
||||
*/
|
||||
export function copy(value: any, callback: any) {
|
||||
// #ifdef H5
|
||||
var oInput = document.createElement('input'); //创建一个隐藏input(重要!)
|
||||
const oInput = document.createElement('input'); //创建一个隐藏input(重要!)
|
||||
oInput.value = value; //赋值
|
||||
oInput.setAttribute("readonly", "readonly");
|
||||
document.body.appendChild(oInput);
|
||||
@ -511,7 +505,7 @@ export function handleOnloadParams(option: any) {
|
||||
|
||||
// 处理小程序扫码进入的场景值参数
|
||||
if (option.scene) {
|
||||
var sceneParams = decodeURIComponent(option.scene).split('&');
|
||||
const sceneParams = decodeURIComponent(option.scene).split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
let arr = item.split('-');
|
||||
@ -577,7 +571,8 @@ const isArray = (value: any) => {
|
||||
|
||||
// px转rpx
|
||||
export function pxToRpx(px: any) {
|
||||
const screenWidth = uni.getSystemInfoSync().screenWidth;
|
||||
const systemStore = useSystemStore()
|
||||
const screenWidth = systemStore.systemInfo.screenWidth;
|
||||
return (750 * Number.parseInt(px)) / screenWidth;
|
||||
}
|
||||
|
||||
@ -623,7 +618,7 @@ export function getWinxinOpenId() {
|
||||
|
||||
// 获取有效期
|
||||
export function getValidTime(minutes: any = 1) {
|
||||
var date = new Date();
|
||||
const date = new Date();
|
||||
date.setSeconds(60 * minutes);
|
||||
let validTime: any = parseInt(date.getTime() / 1000); // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||
return validTime;
|
||||
|
||||
@ -3,6 +3,7 @@ import wx from 'weixin-js-sdk'
|
||||
// #endif
|
||||
import { getWechatSdkConfig } from '@/app/api/system'
|
||||
import { isWeixinBrowser } from '@/utils/common'
|
||||
import useSystemStore from "@/stores/system";
|
||||
|
||||
class Wechat {
|
||||
constructor() {
|
||||
@ -12,8 +13,9 @@ class Wechat {
|
||||
}
|
||||
|
||||
public init(callback: any = null) {
|
||||
const systemStore = useSystemStore()
|
||||
getWechatSdkConfig({
|
||||
url: uni.getSystemInfoSync().platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||
url: systemStore.systemInfo.platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||
}).then((res: any) => {
|
||||
const { data } = res
|
||||
wx.config({
|
||||
@ -83,6 +85,7 @@ class Wechat {
|
||||
/**
|
||||
* 商家转账接口
|
||||
* @param {Object} options 转账参数
|
||||
* @param callback
|
||||
*/
|
||||
public transfer(options: any, callback: any) {
|
||||
// #ifdef MP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user