mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2026-04-06 13:00:04 +00:00
同步uniapp
This commit is contained in:
parent
b984a4c81c
commit
9f9ed9a0e3
@ -8,6 +8,7 @@ import useSystemStore from '@/stores/system'
|
||||
import { useLogin } from '@/hooks/useLogin'
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
|
||||
const locationVal = useLocation(true);
|
||||
onLaunch((data: any) => {
|
||||
// 添加初始化拦截器
|
||||
|
||||
@ -1,162 +1,165 @@
|
||||
<template>
|
||||
<view class="diy-group" id="componentList">
|
||||
<top-tabbar
|
||||
v-if="data.global && Object.keys(data.global).length && data.global.topStatusBar && data.global.topStatusBar.isShow"
|
||||
: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" />
|
||||
<template v-for="(component, index) in data.value" :key="component.id">
|
||||
<view v-show="component.componentIsShow" @click="diyStore.changeCurrentIndex(index, component)"
|
||||
:class="diyGroup.getComponentClass(index,component)" :style="component.pageStyle">
|
||||
<view class="relative"
|
||||
:style="{ marginTop : component.margin.top < 0 ? (component.margin.top * 2) + 'rpx' : '0', marginBottom : component.margin.bottom < 0 ? (component.margin.bottom * 2) + 'rpx' : '0' }">
|
||||
<view class="diy-group" id="componentList">
|
||||
<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"/>
|
||||
<template v-for="(component, index) in data.value" :key="component.id">
|
||||
<view v-show="component.componentIsShow" @click="diyStore.changeCurrentIndex(index, component)"
|
||||
:class="diyGroup.getComponentClass(index,component)" :style="component.pageStyle">
|
||||
<view class="relative"
|
||||
:style="{ marginTop : component.margin.top < 0 ? (component.margin.top * 2) + 'rpx' : '0', marginBottom : component.margin.bottom < 0 ? (component.margin.bottom * 2) + 'rpx' : '0' }">
|
||||
|
||||
<!-- 装修模式下,设置负上边距后超出的内容,禁止选中设置 -->
|
||||
<view v-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>
|
||||
|
||||
|
||||
<!-- 以下是addon文件夹下的自定义组件 -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="data.global && diyGroup.showCopyright.value && data.global.copyright && data.global.copyright.isShow">
|
||||
<copy-right :textColor="data.global.copyright.textColor" />
|
||||
</template>
|
||||
<!-- 以下是addon文件夹下的自定义组件 -->
|
||||
|
||||
<template v-if="diyStore.mode == '' && data.global && data.global.bottomTabBar && data.global.bottomTabBar.isShow">
|
||||
<view class="pt-[20rpx]"></view>
|
||||
<tabbar :addon="data.global.bottomTabBar.designNav?.key" />
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template
|
||||
v-if="data.global && diyGroup.showCopyright.value && data.global.copyright && data.global.copyright.isShow">
|
||||
<copy-right :textColor="data.global.copyright.textColor"/>
|
||||
</template>
|
||||
|
||||
<template
|
||||
v-if="diyStore.mode == '' && data.global && data.global.bottomTabBar && data.global.bottomTabBar.isShow">
|
||||
<view class="pt-[20rpx]"></view>
|
||||
<tabbar :addon="data.global.bottomTabBar.designNav?.key"/>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
||||
@ -167,7 +170,7 @@ import useDiyStore from '@/app/stores/diy';
|
||||
import { ref, getCurrentInstance } from 'vue';
|
||||
|
||||
const props = defineProps(['data']);
|
||||
const instance : any = getCurrentInstance();
|
||||
const instance: any = getCurrentInstance();
|
||||
const getFormRef = () => {
|
||||
return {
|
||||
componentRefs: instance.refs
|
||||
@ -176,7 +179,6 @@ const getFormRef = () => {
|
||||
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
|
||||
const diyGroup = useDiyGroup({
|
||||
...props,
|
||||
getFormRef
|
||||
|
||||
@ -13,6 +13,3 @@ export function pay(data : AnyObject) {
|
||||
export function getPayInfo(tradeType : string, tradeId : number, params: Record<string, any>) {
|
||||
return request.get(`pay/info/${tradeType}/${tradeId}`, params, { showErrorMessage: true })
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ export function sendSms(data: AnyObject) {
|
||||
* 获取微信jssdk config
|
||||
*/
|
||||
export function getWechatSdkConfig(data: AnyObject) {
|
||||
return request.get('wechat/jssdkconfig', data, { showErrorMessage: false })
|
||||
return request.get('wechat/jssdkconfig', data, { showErrorMessage: true })
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,6 +76,15 @@ export function fetchBase64Image(data: AnyObject) {
|
||||
export function uploadVideo(data: AnyObject) {
|
||||
return request.upload('file/video', data, { showErrorMessage: true })
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取上传配置
|
||||
*/
|
||||
export function uploadConfig() {
|
||||
return request.get('file/config')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点信息
|
||||
*/
|
||||
@ -90,6 +99,14 @@ export function getWeappTemplateId(keys: string) {
|
||||
return request.get('weapp/subscribemsg', { keys })
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取微信小程序订阅消息模板id
|
||||
*/
|
||||
export function bindMerchant(data: AnyObject) {
|
||||
return request.post('weapp/bind/merchant', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下级地址列表
|
||||
* @param pid
|
||||
|
||||
@ -72,9 +72,9 @@
|
||||
</view>
|
||||
<view class="calendar-wrap">
|
||||
<u-calendar :show="calendarShow" mode="range" @confirm="confirm" @close="calendarShow=false"
|
||||
closeOnClickOverlay="true"
|
||||
closeOnClickOverlay="true" :min-date="calendarMinDate" monthNum="12"
|
||||
:defaultDate="defaultDate" startText="开始" endText="结束" confirmDisabledText="禁止选择"
|
||||
color="var(--primary-color)" ref="calendar" monthNum="2"></u-calendar>
|
||||
color="var(--primary-color)" ref="calendar"></u-calendar>
|
||||
</view>
|
||||
|
||||
<!-- 遮罩层,装修使用 -->
|
||||
@ -94,6 +94,8 @@ const diyStore = useDiyStore();
|
||||
const calendarShow = ref(false);
|
||||
|
||||
const errorInfo: any = ref(null);
|
||||
let currentDateTime = new Date();
|
||||
const calendarMinDate = ref(new Date(currentDateTime.getFullYear(), currentDateTime.getMonth() - 9, currentDateTime.getDate()));
|
||||
|
||||
const diyComponent = computed(() => {
|
||||
if (diyStore.mode == 'decorate') {
|
||||
|
||||
@ -61,8 +61,8 @@
|
||||
</view>
|
||||
<view class="calendar-wrap">
|
||||
<u-calendar :show="calendarShow" mode="single" @confirm="confirm" @close="calendarShow=false"
|
||||
closeOnClickOverlay="true"
|
||||
:formatter="formatter" confirmDisabledText="禁止选择" color="var(--primary-color)"
|
||||
closeOnClickOverlay="true" :min-date="calendarMinDate"
|
||||
:formatter="formatter" confirmDisabledText="禁止选择" color="var(--primary-color)" monthNum="12"
|
||||
ref="calendar" :maxDate="maxDate"></u-calendar>
|
||||
<u-datetime-picker :show="show" v-model="diyComponent.field.value.date" mode="datetime" @cancel="show=false"
|
||||
closeOnClickOverlay="true" @confirm="calendarConfirm" @close="show=false"
|
||||
@ -86,6 +86,7 @@ const maxDate = ref(currentDate.getTime());
|
||||
|
||||
let currentDateTime = new Date();
|
||||
const minDate = ref(currentDateTime.getTime());
|
||||
const calendarMinDate = ref(new Date(currentDateTime.getFullYear(), currentDateTime.getMonth() - 9, currentDateTime.getDate()));
|
||||
|
||||
const props = defineProps(['component', 'index', 'global']);
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
@ -32,7 +32,10 @@
|
||||
<view class="w-full flex items-center justify-center mb-[40rpx]" v-if="loginConfig.is_auth_register">
|
||||
|
||||
<!-- 开启强制绑定手机号或者手机号登录的情况,排除强制获取用户信息的情况(is_force_access_user_info为0) -->
|
||||
<button v-if="!wapMemberMobile && loginConfig.is_bind_mobile && !loginConfig.is_force_access_user_info" class="w-[630rpx] h-[88rpx] !bg-[var(--primary-color)] !mx-[0] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" :open-type="openType" @getphonenumber="mobileAuth" @click="checkWxPrivacy">{{ t('quickLoginOrLogout') }}</button>
|
||||
<template v-if="!wapMemberMobile && loginConfig.is_bind_mobile && !loginConfig.is_force_access_user_info">
|
||||
<button v-if="!privacyAgreed" class="w-[630rpx] h-[88rpx] !bg-[var(--primary-color)] !mx-[0] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" @click="callProtocolFn">{{ t('quickLoginOrLogout') }}</button>
|
||||
<button v-else class="w-[630rpx] h-[88rpx] !bg-[var(--primary-color)] !mx-[0] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" :open-type="openType" @getphonenumber="mobileAuth" @click="checkWxPrivacy">{{ t('quickLoginOrLogout') }}</button>
|
||||
</template>
|
||||
|
||||
<!-- 授权登录/注册 -->
|
||||
<button v-else class="w-[630rpx] h-[88rpx] !mx-[0] !bg-[var(--primary-color)] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" @click="oneClickLogin()">{{ t('quickLoginOrLogout') }}</button>
|
||||
@ -41,12 +44,15 @@
|
||||
|
||||
<!-- 未开启第三方登录/注册,但是开启了手机号登录,则一键手机号登录/注册 -->
|
||||
<view class="w-full flex items-center justify-center mb-[40rpx]" v-else-if="!loginConfig.is_auth_register && loginConfig.is_mobile">
|
||||
<button v-if="!wapMemberMobile" class="w-[630rpx] h-[88rpx] !bg-[var(--primary-color)] !mx-[0] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" :open-type="openType" @getphonenumber="mobileAuth" @click="checkWxPrivacy('mobileAuth')">{{ t('quickLoginOrLogout') }}</button>
|
||||
<template v-if="!wapMemberMobile">
|
||||
<button v-if="!privacyAgreed" class="w-[630rpx] h-[88rpx] !bg-[var(--primary-color)] !mx-[0] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" @click="callProtocolFn">{{ t('quickLoginOrLogout') }}</button>
|
||||
<button v-else class="w-[630rpx] h-[88rpx] !bg-[var(--primary-color)] !mx-[0] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" :open-type="openType" @getphonenumber="mobileAuth" @click="checkWxPrivacy('mobileAuth')">{{ t('quickLoginOrLogout') }}</button>
|
||||
</template>
|
||||
<button v-else class="w-[630rpx] h-[88rpx] !bg-[var(--primary-color)] !mx-[0] text-[26rpx] rounded-[44rpx] leading-[88rpx] font-500 !text-[#fff]" @click="oneClickLogin()">{{ t('quickLoginOrLogout') }}</button>
|
||||
</view>
|
||||
|
||||
<!-- 小程序隐私协议 -->
|
||||
<wx-privacy-popup ref="wxPrivacyPopupRef"></wx-privacy-popup>
|
||||
<wx-privacy-popup ref="wxPrivacyPopupRef" @disagree="checkPrivacyStatus" @agree="checkPrivacyStatus"></wx-privacy-popup>
|
||||
|
||||
<!-- #endif -->
|
||||
|
||||
@ -237,6 +243,20 @@ onShow(() => {
|
||||
loginLoading.value = false;
|
||||
})
|
||||
|
||||
// 是否同意隐私协议
|
||||
const privacyAgreed = ref(true)
|
||||
const checkPrivacyStatus = () => {
|
||||
// 微信小程序隐私协议校验(uniapp 兼容写法)
|
||||
wx.getPrivacySetting({
|
||||
success(res) {
|
||||
privacyAgreed.value = !res.needAuthorization;
|
||||
},
|
||||
fail(err) {
|
||||
console.error('检查隐私协议失败:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const warpStyle = computed(() => {
|
||||
let style = '';
|
||||
if (configStore.login.bg_url) {
|
||||
@ -249,6 +269,7 @@ const warpStyle = computed(() => {
|
||||
})
|
||||
|
||||
// 检测是否同意小程序隐私协议和登录政策协议
|
||||
|
||||
const checkWxPrivacy = (status: any = '') => {
|
||||
if (!isAgree.value && configStore.login.agreement_show) {
|
||||
// 针对微信小程序获取手机号特殊处理
|
||||
@ -262,6 +283,15 @@ const checkWxPrivacy = (status: any = '') => {
|
||||
return false;
|
||||
}
|
||||
|
||||
const callProtocolFn = ()=>{
|
||||
// #ifdef MP
|
||||
if (wxPrivacyPopupRef.value) {
|
||||
wxPrivacyPopupRef.value.proactive();
|
||||
return true
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
||||
// 一键登录
|
||||
const oneClickLogin = (callback: any = null, data: any = null) => {
|
||||
if (checkWxPrivacy()) return;
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, nextTick } from 'vue'
|
||||
import { ref, computed, nextTick, onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { deepClone, redirect } from '@/utils/common'
|
||||
import { t } from '@/locale'
|
||||
@ -82,6 +82,7 @@ import { addAddress, editAddress, getAddressInfo } from '@/app/api/member'
|
||||
import manifestJson from '@/manifest.json'
|
||||
import { getAddressByLatlng,getAreatree } from '@/app/api/system'
|
||||
import useSystemStore from '@/stores/system';
|
||||
import { useLocation } from '@/hooks/useLocation'
|
||||
|
||||
const systemStore = useSystemStore();
|
||||
const formData: any = ref({
|
||||
@ -362,6 +363,7 @@ const findIdByNameAndParentId = (list, name, parentId = 0) => {
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
const loadingchoosegAddress = ref(false)
|
||||
const choosegAddress = () =>{
|
||||
loadingchoosegAddress.value = true
|
||||
@ -386,6 +388,35 @@ const choosegAddress = () =>{
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
// #ifdef MP
|
||||
uni.authorize({
|
||||
scope: 'scope.userLocation',
|
||||
success: (res) => {},
|
||||
fail: () => {
|
||||
// 授权失败,引导到设置页
|
||||
uni.showModal({
|
||||
title: '位置授权',
|
||||
content: '需要位置授权才能快速选地址,是否前往设置?',
|
||||
confirmText: '去设置',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
success: (settingRes) => {
|
||||
if (settingRes.authSetting['scope.userLocation']) {
|
||||
const locationVal = useLocation(true);
|
||||
locationVal.init();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="min-h-[100vh] !bg-[var(--page-bg-color)]" :style="themeColor()" v-if="memberStore.info">
|
||||
<view class="fixed w-full z-2 !bg-[var(--page-bg-color)]">
|
||||
<view class="fixed w-full z-2 !bg-[var(--page-bg-color)] container">
|
||||
<view class="pb-[190rpx] text-[#fff] w-full" :style="headerStyle">
|
||||
<!-- #ifdef MP-WEIXIN || APP-PLUS -->
|
||||
<top-tabbar :data="param" class="top-header" />
|
||||
@ -125,7 +125,7 @@ onShow(() => {
|
||||
for (let key in res.data) {
|
||||
cashOutConfigObj[key] = res.data[key];
|
||||
}
|
||||
|
||||
setTimeout(() => calculateMescrollTop(), 200);
|
||||
})
|
||||
if (systemStore.siteAddons.includes('recharge')) {
|
||||
rechargeConfig().then((res: any) => {
|
||||
@ -145,24 +145,38 @@ const headerStyle = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const mescrollTop = computed(() => {
|
||||
if ((cashOutConfigObj.is_open == 1 || rechargeConfigObj.is_use == 1)) {
|
||||
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||
return (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 700) + 'rpx'
|
||||
// 定义ref指向头部容器
|
||||
const mescrollTop = ref('0rpx');
|
||||
|
||||
// 仅在页面渲染完成后计算一次高度
|
||||
const calculateMescrollTop = () => {
|
||||
const query = uni.createSelectorQuery()
|
||||
query.select('.container').boundingClientRect(rect => {
|
||||
if (rect) {
|
||||
// 直接用头部实际高度
|
||||
const topVal = pxToRpx(rect.height)
|
||||
mescrollTop.value = topVal + 'rpx';
|
||||
} else {
|
||||
return '718rpx'
|
||||
// 兜底用原有固定值
|
||||
if ((cashOutConfigObj.is_open == 1 || rechargeConfigObj.is_use == 1)) {
|
||||
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||
mescrollTop.value = (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 700) + 'rpx'
|
||||
} else {
|
||||
mescrollTop.value = '718rpx'
|
||||
}
|
||||
} else {
|
||||
// #ifdef APP-PLUS
|
||||
mescrollTop.value = (pxToRpx(Number(systemStore.systemInfo.statusBarHeight)) + pxToRpx(8) + 632) + 'rpx'
|
||||
// #endif
|
||||
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||
mescrollTop.value = (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 632) + 'rpx'
|
||||
} else {
|
||||
mescrollTop.value = '650rpx'
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// #ifdef APP-PLUS
|
||||
return (pxToRpx(Number(systemStore.systemInfo.statusBarHeight)) + pxToRpx(8) + 632) + 'rpx'
|
||||
// #endif
|
||||
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||
return (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 632) + 'rpx'
|
||||
} else {
|
||||
return '650rpx'
|
||||
}
|
||||
}
|
||||
})
|
||||
}).exec();
|
||||
};
|
||||
|
||||
//获取数据来源类型
|
||||
const accountTypeList = ref([
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="bg-[var(--page-bg-color)] min-h-[100vh]" :style="themeColor()">
|
||||
<view class="fixed left-0 right-0 top-0 z-10085">
|
||||
<view class="fixed left-0 right-0 top-0 z-10085 container">
|
||||
<view class="bg-[#f6f6f6] px-[30rpx] h-[88rpx] pt-[10rpx] flex-center relative z-10084">
|
||||
<view class="search-input bg-[#fff]">
|
||||
<view class="flex-1 text-[24rpx] leading-[60rpx] text-[var(--text-color-light9)]" :class="{'!text-[#333]':from_type}" @click="typePopup = true">{{ from_type_name || '请选择来源用途' }}</view>
|
||||
@ -31,7 +31,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="{ use: false }" @up="getPointListFn" top="185rpx">
|
||||
<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="{ use: false }" @up="getPointListFn" :top="mescrollTop">
|
||||
<view v-for="(item,index) in pointList" :key="index"
|
||||
class="sidebar-margin card-template mt-[var(--top-m)]">
|
||||
<view class="flex justify-between items-center">
|
||||
@ -73,7 +73,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { t } from '@/locale'
|
||||
import { redirect, img } from '@/utils/common';
|
||||
import { redirect, img ,pxToRpx} from '@/utils/common';
|
||||
import { getPointList, getPointType } from '@/app/api/member';
|
||||
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
|
||||
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
|
||||
@ -96,6 +96,21 @@ const typeList = ref([
|
||||
{ name: '支出', status: 'disburse' }
|
||||
])
|
||||
|
||||
const mescrollTop = ref('0rpx');
|
||||
// 仅在页面渲染完成后计算一次高度
|
||||
const calculateMescrollTop = () => {
|
||||
const query = uni.createSelectorQuery()
|
||||
query.select('.container').boundingClientRect(rect => {
|
||||
if (rect) {
|
||||
// 直接用头部实际高度
|
||||
const topVal = pxToRpx(rect.height)
|
||||
mescrollTop.value = topVal + 'rpx';
|
||||
} else {
|
||||
// 兜底用原有固定值
|
||||
mescrollTop.value = '185rpx';
|
||||
}
|
||||
}).exec();
|
||||
};
|
||||
const getPointListFn = (mescroll: any) => {
|
||||
let data = {
|
||||
page: mescroll.num,
|
||||
@ -129,6 +144,7 @@ const getPointTypeFn = () => {
|
||||
getPointType('point').then((res: any) => {
|
||||
pointType.value = res.data
|
||||
})
|
||||
setTimeout(() => calculateMescrollTop(), 200);
|
||||
}
|
||||
getPointTypeFn()
|
||||
// 关键词搜索条件搜索
|
||||
|
||||
38
uni-app/src/app/pages/setting/authorization.vue
Normal file
38
uni-app/src/app/pages/setting/authorization.vue
Normal file
@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<view :style="themeColor()">
|
||||
<view class="flex flex-col justify-center items-center gap-[20rpx] text-[#06c05d] w-full pt-[240rpx]" v-if="!loading">
|
||||
<text class="iconfont -mb-[4rpx] !text-[60rpx] iconxuanzhongduigou"></text>
|
||||
<text class="text-[50rpx] font-500">扫码成功</text>
|
||||
</view>
|
||||
<loading-page :loading="loading"></loading-page>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { t } from '@/locale'
|
||||
import { bindMerchant } from '@/app/api/system'
|
||||
import {handleOnloadParams} from "@/utils/common";
|
||||
|
||||
const loading = ref<boolean>(true);
|
||||
const type = ref('')
|
||||
onLoad((option: any) => {
|
||||
console.log("option",option)
|
||||
var params = handleOnloadParams(option)
|
||||
type.value = params.tp
|
||||
if(type.value == 'b_m'){
|
||||
submitAuthorizationFn()
|
||||
}
|
||||
})
|
||||
|
||||
const submitAuthorizationFn =()=>{
|
||||
bindMerchant({
|
||||
'type ': type.value,
|
||||
'openid': uni.getStorageSync('openid')
|
||||
}).then(res => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<template v-if="tabbar && Object.keys(tabbar).length">
|
||||
<u-tabbar :value="value" zIndex="9999" :fixed="true" :placeholder="true" :safeAreaInsetBottom="false" :inactive-color="tabbar.value.textColor" :active-color="tabbar.value.textHoverColor" :border="props.border" class="custom-tabbar">
|
||||
<view class="safe-area flex bg-white">
|
||||
<view class="safe-area flex bg-white" :style="{'background-color': tabbar.value.backgroundColor}">
|
||||
<template v-for="item in tabbar.value.list">
|
||||
<u-tabbar-item class="py-[5rpx]" :custom-style="{'background-color': tabbar.value.backgroundColor}" :text="item.text" :icon="img(value == item.link.url ? item.iconSelectPath : item.iconPath)" :name="item.link.url" v-if="tabbar.value.type == 1" @click="itemBtn(item.link.url)"></u-tabbar-item>
|
||||
<u-tabbar-item class="py-[5rpx]" :custom-style="{'background-color': tabbar.value.backgroundColor}" :icon="img(value == item.link.url ? item.iconSelectPath : item.iconPath)" :name="item.link.url" v-if="tabbar.value.type == 2" @click="itemBtn(item.link.url)"></u-tabbar-item>
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
"pages.pay.browser": "支付",
|
||||
"pages.pay.result": "",
|
||||
"pages.setting.index": "设置",
|
||||
"pages.setting.authorization": "授权",
|
||||
"pages.verify.index": "核销台",
|
||||
"pages.verify.verify": "核销",
|
||||
"pages.verify.detail": "核销详情",
|
||||
|
||||
@ -148,6 +148,13 @@
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "app/pages/setting/authorization",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%pages.setting.authorization%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "app/pages/webview/index",
|
||||
"style": {
|
||||
@ -216,7 +223,7 @@
|
||||
],
|
||||
"subPackages": [
|
||||
// {{ PAGE_BEGAIN }}
|
||||
// {{ PAGE_END }}
|
||||
// {{ PAGE_END }}
|
||||
{
|
||||
"root": "app/components",
|
||||
"pages": []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user