mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2026-04-03 03:20:07 +00:00
fix uni-app
This commit is contained in:
parent
34e68e2e70
commit
c763d20b6d
@ -71,12 +71,7 @@ const solve = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleWeappAddonComponents = (mode) => {
|
const handleWeappAddonComponents = (mode) => {
|
||||||
const files = [
|
const src = `./dist/${mode}/mp-weixin/addon/components/diy/group/index.json`
|
||||||
`./dist/${mode}/mp-weixin/addon/components/diy/group/index.json`,
|
|
||||||
`./dist/${mode}/mp-weixin/app/pages/index/tabbar.json`
|
|
||||||
]
|
|
||||||
|
|
||||||
files.forEach(src => {
|
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(fs.readFileSync(src, 'utf8'));
|
const data = JSON.parse(fs.readFileSync(src, 'utf8'));
|
||||||
data.componentPlaceholder = {};
|
data.componentPlaceholder = {};
|
||||||
@ -87,7 +82,6 @@ const handleWeappAddonComponents = (mode) => {
|
|||||||
fs.writeFileSync(src, JSON.stringify(data))
|
fs.writeFileSync(src, JSON.stringify(data))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleWeappLanguage = (mode) => {
|
const handleWeappLanguage = (mode) => {
|
||||||
|
|||||||
@ -12,9 +12,18 @@ onLaunch((data: any) => {
|
|||||||
|
|
||||||
// 添加初始化拦截器
|
// 添加初始化拦截器
|
||||||
launchInterceptor()
|
launchInterceptor()
|
||||||
|
const systemStore = useSystemStore()
|
||||||
|
|
||||||
|
// 初始化全局数据
|
||||||
|
const initGlobalData = () => {
|
||||||
|
systemStore.systemInfo = uni.getSystemInfoSync();
|
||||||
|
systemStore.getMenuButtonInfoFn()
|
||||||
|
}
|
||||||
|
|
||||||
|
initGlobalData()
|
||||||
|
|
||||||
// #ifdef H5
|
// #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({
|
window.parent.postMessage(JSON.stringify({
|
||||||
@ -38,6 +47,8 @@ onLaunch((data: any) => {
|
|||||||
type: 'appOnReady',
|
type: 'appOnReady',
|
||||||
message: '加载完成'
|
message: '加载完成'
|
||||||
}), '*');
|
}), '*');
|
||||||
|
// 更新全局数据
|
||||||
|
initGlobalData()
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('uni-app App.vue 接受数据错误', e)
|
console.log('uni-app App.vue 接受数据错误', e)
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import diyGroup from '@/addon/components/diy/group/index.vue'
|
import diyGroup from '@/addon/components/diy/group/index.vue'
|
||||||
import { getFormRecord } from '@/app/api/diy_form';
|
import { getFormRecord } from '@/app/api/diy_form';
|
||||||
|
import { deepClone } from '@/utils/common'
|
||||||
|
|
||||||
const props = defineProps(['record_id', 'completeLayout']);
|
const props = defineProps(['record_id', 'completeLayout']);
|
||||||
const emits = defineEmits(['callback'])
|
const emits = defineEmits(['callback'])
|
||||||
@ -17,20 +18,21 @@ const diyFormData: any = reactive({
|
|||||||
global: {},
|
global: {},
|
||||||
value: []
|
value: []
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getFormRecord({
|
getFormRecord({
|
||||||
record_id: props.record_id
|
record_id: props.record_id
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
diyFormData.global.completeLayout = props.completeLayout || 'style-1';
|
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 = {
|
let comp = {
|
||||||
id: item.field_key,
|
id: item.field_key,
|
||||||
componentName: item.field_type,
|
componentName: item.field_type,
|
||||||
pageStyle: '',
|
pageStyle: '',
|
||||||
viewFormDetail: true, // 查看表单详情标识
|
viewFormDetail: true, // 查看表单详情标识
|
||||||
|
componentIsShow: true,
|
||||||
field: {
|
field: {
|
||||||
name: item.field_name,
|
name: item.field_name,
|
||||||
value: item.handle_field_value,
|
value: item.handle_field_value,
|
||||||
@ -47,7 +49,7 @@ onMounted(() => {
|
|||||||
diyFormData.value.push(comp);
|
diyFormData.value.push(comp);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
emits('callback', res.data.recordsFieldList)
|
emits('callback', recordsFieldList)
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@ -1,9 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :style="themeColor()">
|
<view :style="themeColor()">
|
||||||
<!-- 自定义组件渲染 -->
|
<!-- 自定义组件渲染 -->
|
||||||
<view v-show="requestData.status == 1 && !diy.getLoading()" class="diy-template-wrap">
|
<view v-show="requestData.status == 1 && requestData.error && requestData.error.length === 0 && !diy.getLoading()" class="diy-template-wrap">
|
||||||
<diy-group ref="diyGroupRef" :data="diyFormData"/>
|
<diy-group ref="diyGroupRef" :data="diyFormData"/>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -30,12 +42,12 @@ const diyFormData: any = reactive({})
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
diy.getData(() => {
|
diy.getData(() => {
|
||||||
diyFormData.status = diy.data.status;
|
diyFormData.status = diy.data.status;
|
||||||
if (diyFormData.status) {
|
if (diyFormData.status && requestData.value.error.length == 0) {
|
||||||
diyFormData.title = diy.data.title;
|
diyFormData.title = diy.data.title;
|
||||||
diyFormData.global = diy.data.global;
|
diyFormData.global = diy.data.global;
|
||||||
if (diyFormData.global) {
|
if (diyFormData.global) {
|
||||||
diyFormData.global.topStatusBar.isShow = false; // 顶部导航栏强制隐藏
|
diyFormData.global.topStatusBar.isShow = false; // 顶部导航栏强制隐藏
|
||||||
diyFormData.global.bottomTabBarSwitch = false; // 底部导航强制隐藏
|
diyFormData.global.bottomTabBar.isShow = false; // 底部导航强制隐藏
|
||||||
}
|
}
|
||||||
let value: any = [];
|
let value: any = [];
|
||||||
if (props.form_border == 'none') {
|
if (props.form_border == 'none') {
|
||||||
@ -47,7 +59,7 @@ onMounted(() => {
|
|||||||
value.push(item);
|
value.push(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
diyFormData.value = value;
|
diyFormData.value = deepClone(value);
|
||||||
diyFormData.componentRefs = null;
|
diyFormData.componentRefs = null;
|
||||||
diyGroupRef.value?.refresh();
|
diyGroupRef.value?.refresh();
|
||||||
watchFormData();
|
watchFormData();
|
||||||
@ -95,6 +107,7 @@ const watchFormData = () => {
|
|||||||
const verify = () => {
|
const verify = () => {
|
||||||
if (!diyFormData.status) return true;
|
if (!diyFormData.status) return true;
|
||||||
if (!diyFormData.value) return true;
|
if (!diyFormData.value) return true;
|
||||||
|
if (!requestData.value || requestData.value.error?.length > 0) return true;
|
||||||
let allPass = true; // 是否全部通过验证
|
let allPass = true; // 是否全部通过验证
|
||||||
|
|
||||||
let componentRefs = diyGroupRef.value.getFormRef().componentRefs;
|
let componentRefs = diyGroupRef.value.getFormRef().componentRefs;
|
||||||
|
|||||||
@ -3,9 +3,12 @@
|
|||||||
<top-tabbar v-if="data.global && Object.keys(data.global).length && data.global.topStatusBar && data.global.topStatusBar.isShow"
|
<top-tabbar v-if="data.global && Object.keys(data.global).length && data.global.topStatusBar && data.global.topStatusBar.isShow"
|
||||||
:scrollBool="diyGroup.componentsScrollBool.TopTabbar" ref="topTabbarRef" :data="data.global" />
|
:scrollBool="diyGroup.componentsScrollBool.TopTabbar" ref="topTabbarRef" :data="data.global" />
|
||||||
<pop-ads v-if="data.global && Object.keys(data.global).length && data.global.popWindow && data.global.popWindow.show" ref="popAbsRef" :data="data.global" />
|
<pop-ads v-if="data.global && Object.keys(data.global).length && data.global.popWindow && data.global.popWindow.show" ref="popAbsRef" :data="data.global" />
|
||||||
<view v-for="(component, index) in data.value" :key="component.id"
|
<template v-for="(component, index) in data.value" :key="component.id">
|
||||||
|
<view
|
||||||
|
v-show="component.componentIsShow"
|
||||||
@click="diyStore.changeCurrentIndex(index, component)"
|
@click="diyStore.changeCurrentIndex(index, component)"
|
||||||
:class="diyGroup.getComponentClass(index,component)" :style="component.pageStyle">
|
:class="diyGroup.getComponentClass(index,component)" :style="component.pageStyle"
|
||||||
|
>
|
||||||
<view class="relative" :style="{ marginTop : component.margin.top < 0 ? (component.margin.top * 2) + 'rpx' : '0' }">
|
<view class="relative" :style="{ marginTop : component.margin.top < 0 ? (component.margin.top * 2) + 'rpx' : '0' }">
|
||||||
|
|
||||||
<!-- 装修模式下,设置负上边距后超出的内容,禁止选中设置 -->
|
<!-- 装修模式下,设置负上边距后超出的内容,禁止选中设置 -->
|
||||||
@ -121,7 +124,8 @@
|
|||||||
|
|
||||||
</view>
|
</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>
|
<view class="pt-[20rpx]"></view>
|
||||||
<tabbar />
|
<tabbar />
|
||||||
</template>
|
</template>
|
||||||
@ -130,7 +134,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import topTabbar from '@/components/top-tabbar/top-tabbar.vue'
|
import topTabbar from '@/components/top-tabbar/top-tabbar.vue'
|
||||||
import popAds from '@/components/pop-ads/pop-ads.vue'
|
import popAds from '@/components/pop-ads/pop-ads.vue'
|
||||||
|
|
||||||
import { useDiyGroup } from './useDiyGroup'
|
import { useDiyGroup } from './useDiyGroup'
|
||||||
import useDiyStore from '@/app/stores/diy';
|
import useDiyStore from '@/app/stores/diy';
|
||||||
import { ref, getCurrentInstance } from 'vue';
|
import { ref, getCurrentInstance } from 'vue';
|
||||||
|
|||||||
@ -67,7 +67,7 @@ export function useDiyGroup(params: any = {}) {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (diyStore.mode == 'decorate') {
|
if (diyStore.mode == 'decorate') {
|
||||||
var el: any = document.getElementById('componentList');
|
const el: any = document.getElementById('componentList');
|
||||||
const sortable = Sortable.create(el, {
|
const sortable = Sortable.create(el, {
|
||||||
draggable: '.draggable-element',
|
draggable: '.draggable-element',
|
||||||
animation: 200,
|
animation: 200,
|
||||||
@ -91,7 +91,6 @@ export function useDiyGroup(params: any = {}) {
|
|||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
// 初始化组件滚动值
|
// 初始化组件滚动值
|
||||||
scrollVal = uni.getStorageSync('componentsScrollValGroup');
|
scrollVal = uni.getStorageSync('componentsScrollValGroup');
|
||||||
if (scrollVal) {
|
if (scrollVal) {
|
||||||
|
|||||||
@ -90,6 +90,13 @@ export function updateWechatOpenid(data: AnyObject) {
|
|||||||
return request.put('wechat/update_openid', data, { showErrorMessage: false })
|
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 })
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序授权登录
|
* 微信小程序授权登录
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -151,3 +151,10 @@ export function getMsgJumpPath(params: Record<string, any>) {
|
|||||||
export function getInitInfo(params: Record<string, any>) {
|
export function getInitInfo(params: Record<string, any>) {
|
||||||
return request.get('init', params)
|
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(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const maskLayer = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentBgUrl) {
|
if (diyComponent.value.componentBgUrl) {
|
||||||
style += 'position:absolute;top:0;width:100%;';
|
style += 'position:absolute;top:0;width:100%;';
|
||||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||||
@ -213,7 +213,7 @@ const setItemStyle4 = () => {
|
|||||||
|
|
||||||
// 公共模块颜色
|
// 公共模块颜色
|
||||||
const commonTempCss = (data: any) => {
|
const commonTempCss = (data: any) => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (data.listFrame.startColor && data.listFrame.endColor) {
|
if (data.listFrame.startColor && data.listFrame.endColor) {
|
||||||
style += `background:linear-gradient(${ data.listFrame.startColor },${ data.listFrame.endColor });`;
|
style += `background:linear-gradient(${ data.listFrame.startColor },${ data.listFrame.endColor });`;
|
||||||
} else {
|
} else {
|
||||||
@ -228,7 +228,7 @@ const commonTempCss = (data: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const btnCss = (item: any) => {
|
const btnCss = (item: any) => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += `background:linear-gradient(90deg,${ item.startColor },${ item.endColor });`;
|
style += `background:linear-gradient(90deg,${ item.startColor },${ item.endColor });`;
|
||||||
return style;
|
return style;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,10 +11,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="fixed-wrap" :style="fixedStyle">
|
<view class="fixed-wrap" :style="fixedStyle">
|
||||||
<view v-if="diyComponent.search.style == 'style-1'" class="diy-search-wrap relative z-10"
|
<view v-if="diyComponent.search.style == 'style-1'" class="diy-search-wrap relative z-10"
|
||||||
@click="diyStore.toRedirect(diyComponent.search.link)" :style="navbarInnerStyle">
|
@click="diyStore.toRedirect(diyComponent.search.link)" :style="!props.global.topStatusBar.isShow ? navbarInnerStyle : ''">
|
||||||
<view class="img-wrap" v-if="diyComponent.search.logo">
|
<!-- <view class="img-wrap" v-if="diyComponent.search.logo">
|
||||||
<image :src="img(diyComponent.search.logo)" mode="aspectFit" />
|
<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)">
|
<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="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]"
|
<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>
|
</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 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="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>
|
<!-- <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 :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 class="truncate leading-[38rpx] h-[38rpx] px-[12rpx]">{{ diyComponent.search.subTitle.text }}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -124,7 +126,7 @@
|
|||||||
|
|
||||||
<!-- 分类展开 -->
|
<!-- 分类展开 -->
|
||||||
<u-popup :safeAreaInsetTop="true" :show="tabAllPopup" mode="top" @close="tabAllPopup = false">
|
<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 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>
|
<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>
|
<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';
|
import useSystemStore from '@/stores/system';
|
||||||
|
|
||||||
const systemStore = useSystemStore();
|
const systemStore = useSystemStore();
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
|
||||||
|
|
||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
const props = defineProps(['component', 'index', 'global', 'scrollBool']);
|
const props = defineProps(['component', 'index', 'global', 'scrollBool']);
|
||||||
const diyStore = useDiyStore();
|
const diyStore = useDiyStore();
|
||||||
@ -180,7 +180,7 @@ locationVal.init();
|
|||||||
/************** 定位-end ****************/
|
/************** 定位-end ****************/
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -210,7 +210,7 @@ const setModuleLocation = () => {
|
|||||||
|
|
||||||
const fixedStyleBg = ref(false);
|
const fixedStyleBg = ref(false);
|
||||||
const fixedStyle = computed(() => {
|
const fixedStyle = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
||||||
style += 'position: absolute;z-index: 99;left: 0;right: 0;';
|
style += 'position: absolute;z-index: 99;left: 0;right: 0;';
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ const fixedStyle = computed(() => {
|
|||||||
}
|
}
|
||||||
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
||||||
// h5,上移的像素,采取的是平均值
|
// h5,上移的像素,采取的是平均值
|
||||||
if (systemInfo.platform === 'ios') {
|
if (systemStore.systemInfo.platform === 'ios') {
|
||||||
style += 'top: 55px;';
|
style += 'top: 55px;';
|
||||||
} else {
|
} else {
|
||||||
style += 'top: 44.5px;';
|
style += 'top: 44.5px;';
|
||||||
@ -236,14 +236,12 @@ const fixedStyle = computed(() => {
|
|||||||
style += 'position: fixed;z-index: 99;top: 0;left: 0;right: 0;';
|
style += 'position: fixed;z-index: 99;top: 0;left: 0;right: 0;';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (props.scrollBool == 1 || props.scrollBool == 2) {
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
if (props.global.topStatusBar.isShow) {
|
if (props.global.topStatusBar.isShow) {
|
||||||
style += 'top:' + diyStore.topTabarHeight + 'px;';
|
style += 'top:' + diyStore.topTabarHeight + 'px;';
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
if (props.scrollBool == 1 || props.scrollBool == 2) {
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (props.global.topStatusBar.isShow && props.global.topStatusBar.style == 'style-4') {
|
if (props.global.topStatusBar.isShow && props.global.topStatusBar.style == 'style-4') {
|
||||||
style += 'top:' + diyStore.topTabarHeight + 'px;';
|
style += 'top:' + diyStore.topTabarHeight + 'px;';
|
||||||
@ -273,7 +271,7 @@ const carouselSwiperStyle = () => {
|
|||||||
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
if (diyComponent.value.swiper.swiperStyle == 'style-3') {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// h5,上移的像素,采取的是平均值
|
// h5,上移的像素,采取的是平均值
|
||||||
if (systemInfo.platform === 'ios') {
|
if (systemStore.systemInfo.platform === 'ios') {
|
||||||
style = 'margin-top: -55px;';
|
style = 'margin-top: -55px;';
|
||||||
} else {
|
} else {
|
||||||
style = 'margin-top: -44.5px;';
|
style = 'margin-top: -44.5px;';
|
||||||
@ -314,7 +312,7 @@ const isShowSearchPlaceholder = computed(() => {
|
|||||||
|
|
||||||
// 背景渐变
|
// 背景渐变
|
||||||
const bgImgBoxStyle = computed(() => {
|
const bgImgBoxStyle = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
let str = props.global.pageStartBgColor ? props.global.pageStartBgColor : 'rgba(255,255,255,1)';
|
let str = props.global.pageStartBgColor ? props.global.pageStartBgColor : 'rgba(255,255,255,1)';
|
||||||
if (str.indexOf('(') > -1) {
|
if (str.indexOf('(') > -1) {
|
||||||
let arr = str.split('(')[1].split(')')[0].split(',');
|
let arr = str.split('(')[1].split(')')[0].split(',');
|
||||||
@ -329,7 +327,7 @@ const bgImgBoxStyle = computed(() => {
|
|||||||
|
|
||||||
// 轮播样式二
|
// 轮播样式二
|
||||||
const swiperStyleBool = 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;
|
return style;
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -344,7 +342,7 @@ const swiperChange = e => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const swiperWarpCss = computed(() => {
|
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-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.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;';
|
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(() => {
|
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.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 });`;
|
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) + ';';
|
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);
|
const tabAllPopup = ref(false);
|
||||||
let menuButtonInfo: any = {};
|
|
||||||
const navbarInnerStyle = ref('')
|
const navbarInnerStyle = ref('')
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
// #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
|
// #endif
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
refresh();
|
refresh();
|
||||||
@ -418,14 +414,14 @@ onMounted(() => {
|
|||||||
if (diyComponent.value.positionWay == 'fixed') {
|
if (diyComponent.value.positionWay == 'fixed') {
|
||||||
if (props.global.topStatusBar.isShow == false) {
|
if (props.global.topStatusBar.isShow == false) {
|
||||||
navbarInnerStyle.value = ''
|
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-right:calc(' + rightButtonWidth + ' + 30rpx);';
|
||||||
navbarInnerStyle.value += 'padding-top:' + menuButtonInfo.top + 'px;';
|
navbarInnerStyle.value += 'padding-top:' + systemStore.menuButtonInfo.top + 'px;';
|
||||||
} else if (props.global.topStatusBar) {
|
} else if (props.global.topStatusBar) {
|
||||||
navbarInnerStyle.value = ''
|
navbarInnerStyle.value = ''
|
||||||
}
|
}
|
||||||
} else {
|
} 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);';
|
navbarInnerStyle.value += 'padding-right:calc(' + rightButtonWidth + ' + 30rpx);';
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@ -471,7 +467,7 @@ const getDiyInfoFn = (id: any) => {
|
|||||||
let sources = JSON.parse(data.value);
|
let sources = JSON.parse(data.value);
|
||||||
diyPageData.global = sources.global;
|
diyPageData.global = sources.global;
|
||||||
diyPageData.global.topStatusBar.isShow = false; // 子页面不需要展示顶部导航栏
|
diyPageData.global.topStatusBar.isShow = false; // 子页面不需要展示顶部导航栏
|
||||||
diyPageData.global.bottomTabBarSwitch = false; // 子页面不需要展示底部导航
|
diyPageData.global.bottomTabBar.isShow = false; // 子页面不需要展示底部导航
|
||||||
diyPageData.value = sources.value;
|
diyPageData.value = sources.value;
|
||||||
|
|
||||||
diyPageData.value.forEach((item: any, index) => {
|
diyPageData.value.forEach((item: any, index) => {
|
||||||
@ -811,8 +807,7 @@ if (componentsScrollVal && (typeof componentsScrollVal == "object")) {
|
|||||||
width: 10rpx;
|
width: 10rpx;
|
||||||
height: 10rpx;
|
height: 10rpx;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
margin: 0;
|
margin: 0 14rpx 0 0;
|
||||||
margin-right: 14rpx;
|
|
||||||
|
|
||||||
&.last-of-type {
|
&.last-of-type {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -59,7 +59,7 @@ const warpCss = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const floatBtnItemCss = computed(() => {
|
const floatBtnItemCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'width:' + diyComponent.value.imageSize * 2 + 'rpx;';
|
style += 'width:' + diyComponent.value.imageSize * 2 + 'rpx;';
|
||||||
style += 'height:' + diyComponent.value.imageSize * 2 + 'rpx;';
|
style += 'height:' + diyComponent.value.imageSize * 2 + 'rpx;';
|
||||||
style += 'border-radius:' + diyComponent.value.aroundRadius * 2 + 'rpx;';
|
style += 'border-radius:' + diyComponent.value.aroundRadius * 2 + 'rpx;';
|
||||||
@ -92,7 +92,7 @@ const floatBtnWrapCss = computed(() => {
|
|||||||
const styleTwoRepeat = ref(true)
|
const styleTwoRepeat = ref(true)
|
||||||
const styleTwoRepeatTime: any = ref(null)
|
const styleTwoRepeatTime: any = ref(null)
|
||||||
const styleTwoWarpCss = computed(() => {
|
const styleTwoWarpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -107,7 +107,7 @@ const styleTwoWarpCss = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const styleTwoSphere = 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;';
|
style += styleTwoRepeat.value ? '' : 'right:-32rpx !important;transition-delay: 0.25s;';
|
||||||
return style
|
return style
|
||||||
})
|
})
|
||||||
|
|||||||
@ -116,7 +116,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if(diyComponent.value.componentStartBgColor) {
|
if(diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
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">
|
<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 { img } from '@/utils/common';
|
||||||
import { t } from '@/locale'
|
import { t } from '@/locale'
|
||||||
import useDiyStore from '@/app/stores/diy';
|
import useDiyStore from '@/app/stores/diy';
|
||||||
@ -206,7 +206,7 @@ const eventFn = (type: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -237,17 +237,24 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
watch(
|
||||||
|
() => diyComponent.value.field.value,
|
||||||
|
(newValue, oldValue) => {
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const 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(() => {
|
const checkboxPlaceholder = computed(() => {
|
||||||
|
|||||||
@ -196,7 +196,7 @@ const defaultDate = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -132,7 +132,7 @@ const eventFn = (type: any) => {
|
|||||||
|
|
||||||
// 日期
|
// 日期
|
||||||
const startDate = computed(() => {
|
const startDate = computed(() => {
|
||||||
var date = '';
|
let date = '';
|
||||||
if (diyComponent.value.field.value.date) {
|
if (diyComponent.value.field.value.date) {
|
||||||
let timestamp = diyComponent.value.field.value.timestamp;
|
let timestamp = diyComponent.value.field.value.timestamp;
|
||||||
date = getDateFn(timestamp);
|
date = getDateFn(timestamp);
|
||||||
@ -158,7 +158,7 @@ const startDate = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -130,7 +130,7 @@ const eventFn = (type: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -61,7 +61,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if(diyComponent.value.componentStartBgColor) {
|
if(diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
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(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -207,7 +207,7 @@ onUnload(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -77,10 +77,8 @@
|
|||||||
import { img } from '@/utils/common';
|
import { img } from '@/utils/common';
|
||||||
import useDiyStore from '@/app/stores/diy';
|
import useDiyStore from '@/app/stores/diy';
|
||||||
import { useLocation } from '@/hooks/useLocation'
|
import { useLocation } from '@/hooks/useLocation'
|
||||||
import useSystemStore from '@/stores/system';
|
|
||||||
const errorInfo: any = ref(null);
|
const errorInfo: any = ref(null);
|
||||||
const systemStore = useSystemStore();
|
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
|
||||||
const props = defineProps(['component', 'index', 'global']);
|
const props = defineProps(['component', 'index', 'global']);
|
||||||
const diyStore = useDiyStore();
|
const diyStore = useDiyStore();
|
||||||
|
|
||||||
@ -108,7 +106,7 @@
|
|||||||
/************** 定位-end ****************/
|
/************** 定位-end ****************/
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||||
|
|||||||
@ -157,7 +157,7 @@ const viewPrivacy = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -134,7 +134,7 @@ const eventFn = (type: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<view class="detail-two-content">
|
<view class="detail-two-content">
|
||||||
<text class="detail-two-content-label">{{ diyComponent.field.name }}</text>
|
<text class="detail-two-content-label">{{ diyComponent.field.name }}</text>
|
||||||
<view class="flex items-center justify-end">
|
<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.field.value || !diyComponent.field.value.length">{{ t('notHave') }}</text>
|
||||||
<text v-if="diyComponent.isShowArrow" class="iconfont iconfanhui1 text-[#888] !text-[20rpx] ml-[10rpx]"></text>
|
<text v-if="diyComponent.isShowArrow" class="iconfont iconfanhui1 text-[#888] !text-[20rpx] ml-[10rpx]"></text>
|
||||||
</view>
|
</view>
|
||||||
@ -123,7 +123,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<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 { img } from '@/utils/common';
|
||||||
import { t } from '@/locale'
|
import { t } from '@/locale'
|
||||||
import useDiyStore from '@/app/stores/diy';
|
import useDiyStore from '@/app/stores/diy';
|
||||||
@ -192,7 +192,7 @@ const eventFn = (type: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -222,8 +222,19 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}else{
|
||||||
|
watch(
|
||||||
|
() => diyComponent.value.field.value,
|
||||||
|
(newValue, oldValue) => {
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
const refresh = () => {
|
||||||
|
nextTick(() => {
|
||||||
// 样式三,初始化下拉数据
|
// 样式三,初始化下拉数据
|
||||||
if (diyComponent.value.style == 'style-3' && diyComponent.value.field.value.length > 0) {
|
if (diyComponent.value.style == 'style-3' && diyComponent.value.field.value.length > 0) {
|
||||||
pullDownVal.value = diyComponent.value.field.value[0].id;
|
pullDownVal.value = diyComponent.value.field.value[0].id;
|
||||||
@ -231,11 +242,7 @@ onMounted(() => {
|
|||||||
if (diyComponent.value.field.value.length > 0) {
|
if (diyComponent.value.field.value.length > 0) {
|
||||||
selectedRadioId.value = diyComponent.value.field.value[0].id;
|
selectedRadioId.value = diyComponent.value.field.value[0].id;
|
||||||
}
|
}
|
||||||
|
})
|
||||||
});
|
|
||||||
|
|
||||||
const refresh = () => {
|
|
||||||
// console.log('diyComponent.value.field.value',diyComponent.value.field.value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const radioPlaceholder = computed(() => {
|
const radioPlaceholder = computed(() => {
|
||||||
@ -271,7 +278,7 @@ const pullDownCancelFn = () => {
|
|||||||
const pullDownConfirmFn = (item: any) => {
|
const pullDownConfirmFn = (item: any) => {
|
||||||
selectShow.value = false;
|
selectShow.value = false;
|
||||||
pullDownVal.value = item.id;
|
pullDownVal.value = item.id;
|
||||||
;
|
|
||||||
diyComponent.value.field.value = [{ id: item.id, text: item.text }];
|
diyComponent.value.field.value = [{ id: item.id, text: item.text }];
|
||||||
// diyComponent.value.field.value = pullDownVal.value;
|
// diyComponent.value.field.value = pullDownVal.value;
|
||||||
}
|
}
|
||||||
@ -311,7 +318,7 @@ const selectRadio = (item) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
selectedRadioId.value = item.id;
|
selectedRadioId.value = item.id;
|
||||||
;
|
|
||||||
diyComponent.value.field.value = [{ id: item.id, text: item.text }];
|
diyComponent.value.field.value = [{ id: item.id, text: item.text }];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ const diyGlobal = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
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') {
|
if (diyStore.mode != 'decorate' && diyComponent.value.btnPosition == 'hover_screen_bottom') {
|
||||||
style += "position: fixed !important;";
|
style += "position: fixed !important;";
|
||||||
var height = tabbarInfo.value ? tabbarInfo.value.height : 0;
|
const height = tabbarInfo.value ? tabbarInfo.value.height : 0;
|
||||||
style += `left: 0;`;
|
style += `left: 0;`;
|
||||||
style += `right: 0;`;
|
style += `right: 0;`;
|
||||||
if (height && diyGlobal.value.bottomTabBarSwitch) {
|
if (height && diyGlobal.value.bottomTabBar && diyGlobal.value.bottomTabBar.isShow) {
|
||||||
style += `bottom: ${ height }px;`;
|
style += `bottom: ${ height }px;`;
|
||||||
} else {
|
} else {
|
||||||
style += `bottom: 0;`;
|
style += `bottom: 0;`;
|
||||||
@ -79,7 +79,7 @@ const warpCss = computed(() => {
|
|||||||
if (diyComponent.value.margin.top > 0) {
|
if (diyComponent.value.margin.top > 0) {
|
||||||
style += 'padding-top:' + diyComponent.value.margin.top * 2 + 'rpx' + ';';
|
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' + ';';
|
style += 'padding-bottom:' + diyComponent.value.margin.bottom * 2 + 'rpx' + ';';
|
||||||
} else {
|
} else {
|
||||||
style += `padding-bottom: ${ (diyComponent.value.margin.bottom + iphoneSecureVal.value) * 2 }rpx;`;
|
style += `padding-bottom: ${ (diyComponent.value.margin.bottom + iphoneSecureVal.value) * 2 }rpx;`;
|
||||||
@ -100,7 +100,7 @@ const warpCss = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const boxCss = computed(() => {
|
const boxCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
|
|
||||||
if (diyComponent.value.btnPosition == 'hover_screen_bottom') {
|
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 });`;
|
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(() => {
|
const maskLayer = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentBgUrl) {
|
if (diyComponent.value.componentBgUrl) {
|
||||||
style += 'position:absolute;top:0;right:0;left:0;bottom:0;';
|
style += 'position:absolute;top:0;right:0;left:0;bottom:0;';
|
||||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||||
@ -128,7 +128,7 @@ const maskLayer = computed(() => {
|
|||||||
|
|
||||||
// 重置样式
|
// 重置样式
|
||||||
const resetItem = computed(() => {
|
const resetItem = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += `color: ${ diyComponent.value.resetBtn.color };`;
|
style += `color: ${ diyComponent.value.resetBtn.color };`;
|
||||||
style += `background-color: ${ diyComponent.value.resetBtn.bgColor };`;
|
style += `background-color: ${ diyComponent.value.resetBtn.bgColor };`;
|
||||||
if (diyComponent.value.topElementRounded) style += 'border-top-left-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
|
if (diyComponent.value.topElementRounded) style += 'border-top-left-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
|
||||||
@ -140,7 +140,7 @@ const resetItem = computed(() => {
|
|||||||
|
|
||||||
// 保存样式
|
// 保存样式
|
||||||
const submitItem = computed(() => {
|
const submitItem = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += `color: ${ diyComponent.value.submitBtn.color };`;
|
style += `color: ${ diyComponent.value.submitBtn.color };`;
|
||||||
style += `background-color: ${ diyComponent.value.submitBtn.bgColor };`;
|
style += `background-color: ${ diyComponent.value.submitBtn.bgColor };`;
|
||||||
if (diyComponent.value.topElementRounded) style += 'border-top-left-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
|
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(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -197,7 +197,7 @@ const endTime = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -117,7 +117,7 @@ const eventFn = (type: any) => {
|
|||||||
|
|
||||||
// 开始时间
|
// 开始时间
|
||||||
const startTime = computed(() => {
|
const startTime = computed(() => {
|
||||||
var time = '';
|
let time = '';
|
||||||
if (diyComponent.value.field.value) {
|
if (diyComponent.value.field.value) {
|
||||||
time = diyComponent.value.field.value;
|
time = diyComponent.value.field.value;
|
||||||
diyComponent.value.field.value = time;
|
diyComponent.value.field.value = time;
|
||||||
@ -138,7 +138,7 @@ const startTime = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else if (diyComponent.value.componentStartBgColor) style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
|
|||||||
@ -191,7 +191,7 @@
|
|||||||
return props.global;
|
return props.global;
|
||||||
})
|
})
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
||||||
|
|||||||
@ -142,7 +142,7 @@
|
|||||||
|
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if(diyComponent.value.componentStartBgColor) {
|
if(diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${diyComponent.value.componentGradientAngle},${diyComponent.value.componentStartBgColor},${diyComponent.value.componentEndBgColor});`;
|
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 // 如果总项数大于每页显示的项数,显示指示器
|
return totalItems > itemsPerPage // 如果总项数大于每页显示的项数,显示指示器
|
||||||
})
|
})
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const maskLayer = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentBgUrl) {
|
if (diyComponent.value.componentBgUrl) {
|
||||||
style += 'position:absolute;top:0;width:100%;';
|
style += 'position:absolute;top:0;width:100%;';
|
||||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||||
@ -217,7 +217,7 @@ const swiperHeight = ref(uni.getStorageSync(storageKey) || '');
|
|||||||
|
|
||||||
const handleData = () => {
|
const handleData = () => {
|
||||||
if (diyComponent.value.layout == 'horizontal' && diyComponent.value.showStyle == 'pageSlide') {
|
if (diyComponent.value.layout == 'horizontal' && diyComponent.value.showStyle == 'pageSlide') {
|
||||||
var height = 0;
|
let height = 0;
|
||||||
const query = uni.createSelectorQuery().in(instance);
|
const query = uni.createSelectorQuery().in(instance);
|
||||||
query.select('.graphic-nav-item').boundingClientRect((data: any) => {
|
query.select('.graphic-nav-item').boundingClientRect((data: any) => {
|
||||||
let len = 1;
|
let len = 1;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'height:' + diyComponent.value.height * 2 + 'rpx;';
|
style += 'height:' + diyComponent.value.height * 2 + 'rpx;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'border-top:' + (diyComponent.value.borderWidth * 2) + 'rpx ' + diyComponent.value.borderStyle + ' ' + diyComponent.value.borderColor + ';';
|
style += 'border-top:' + (diyComponent.value.borderWidth * 2) + 'rpx ' + diyComponent.value.borderStyle + ' ' + diyComponent.value.borderColor + ';';
|
||||||
return style;
|
return style;
|
||||||
})
|
})
|
||||||
|
|||||||
@ -31,7 +31,7 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -40,7 +40,7 @@ const warpCss = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const itemCss = computed(() => {
|
const itemCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'height:' + diyComponent.value.imgHeight + ';';
|
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-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||||
if (diyComponent.value.topRounded) style += 'border-top-right-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>
|
<template>
|
||||||
<view :style="warpCss">
|
<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 v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden" :style="swiperWarpCss">
|
||||||
<view @click="diyStore.toRedirect(diyComponent.list[0].link)">
|
<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" />
|
<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>
|
<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 useDiyStore from '@/app/stores/diy';
|
||||||
import { img } from '@/utils/common';
|
import { img } from '@/utils/common';
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
import { nextTick } from 'process';
|
||||||
|
|
||||||
const props = defineProps(['component', 'index']);
|
const props = defineProps(['component', 'index']);
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
const systemStore = useSystemStore()
|
||||||
|
|
||||||
const diyStore = useDiyStore();
|
const diyStore = useDiyStore();
|
||||||
|
|
||||||
@ -42,28 +44,23 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 兼容通屏样式
|
// 兼容通屏样式
|
||||||
const imageAdsTempStyle = () => {
|
const imageAdsTempStyle = computed(() => {
|
||||||
let style = "";
|
let style = "";
|
||||||
if (diyComponent.value.isSameScreen && props.index == 0) {
|
if (diyComponent.value.isSameScreen && props.index == 0) {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// h5,上移的像素,采取的是平均值
|
// h5,上移的像素,采取的是平均值
|
||||||
if (systemInfo.platform === 'ios') {
|
if (systemStore.systemInfo.platform === 'ios') {
|
||||||
style = 'margin-top: -55px;';
|
style = 'margin-top: -55px;';
|
||||||
} else {
|
} else {
|
||||||
style = 'margin-top: -44.5px;';
|
style = 'margin-top: -44.5px;';
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef MP
|
|
||||||
// 图文导航开启沉浸式且导航栏开启时,导航栏不占位
|
|
||||||
uni.setStorageSync('imageAdsSameScreen', true);
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
}
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
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-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||||
if (diyComponent.value.topRounded) style += 'border-top-right-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;';
|
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 = () => {
|
const refresh = () => {
|
||||||
// 装修模式下设置默认图
|
// 装修模式下设置默认图
|
||||||
if (diyStore.mode == 'decorate') {
|
if (diyStore.mode == 'decorate') {
|
||||||
@ -121,7 +122,12 @@ const refresh = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.removeStorageSync('imageAdsSameScreen');
|
// #ifdef MP
|
||||||
|
if (diyComponent.value.isSameScreen && props.index == 0) {
|
||||||
|
// 图文导航开启沉浸式且导航栏开启时,导航栏不占位
|
||||||
|
diyStore.imageAdsSameScreen = true;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -79,7 +79,7 @@ const diyComponent = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -194,11 +194,6 @@ const clickAvatar = () => {
|
|||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
let menuButtonInfo: any = {};
|
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -123,7 +123,7 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = 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-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
|
||||||
if (diyComponent.value.topRounded) style += 'border-top-right-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;';
|
if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
|
||||||
|
|||||||
@ -78,7 +78,7 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const maskLayer = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentBgUrl) {
|
if (diyComponent.value.componentBgUrl) {
|
||||||
style += 'position:absolute;top:0;width:100%;';
|
style += 'position:absolute;top:0;width:100%;';
|
||||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||||
|
|||||||
@ -55,7 +55,7 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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 + ';';
|
else style += 'background-color:' + diyComponent.value.componentStartBgColor + ';';
|
||||||
@ -68,7 +68,7 @@ const warpCss = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const moduleOneCss = computed(() => {
|
const moduleOneCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.moduleOne.listFrame) {
|
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 });`;
|
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(() => {
|
const moduleTwoCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.moduleTwo.listFrame) {
|
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 });`;
|
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) => {
|
const moduleBtnCss = (data: any) => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (data.btnTitle.color) {
|
if (data.btnTitle.color) {
|
||||||
style += 'color:' + data.btnTitle.color + ';';
|
style += 'color:' + data.btnTitle.color + ';';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ const diyComponent = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const maskLayer = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentBgUrl) {
|
if (diyComponent.value.componentBgUrl) {
|
||||||
style += 'position:absolute;top:0;width:100%;';
|
style += 'position:absolute;top:0;width:100%;';
|
||||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||||
|
|||||||
@ -72,6 +72,7 @@
|
|||||||
import { ref, onMounted, computed, watch, nextTick, getCurrentInstance } from 'vue';
|
import { ref, onMounted, computed, watch, nextTick, getCurrentInstance } from 'vue';
|
||||||
import useDiyStore from '@/app/stores/diy';
|
import useDiyStore from '@/app/stores/diy';
|
||||||
import { img } from '@/utils/common';
|
import { img } from '@/utils/common';
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
const props = defineProps(['component', 'index']);
|
const props = defineProps(['component', 'index']);
|
||||||
|
|
||||||
@ -85,6 +86,9 @@ const diyComponent = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const systemStore = useSystemStore()
|
||||||
|
systemStore.systemInfo = uni.getSystemInfoSync();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理rpx渲染之后变成rem存在小数的问题
|
* 处理rpx渲染之后变成rem存在小数的问题
|
||||||
* @param rpx
|
* @param rpx
|
||||||
@ -94,7 +98,7 @@ const upx2px = (rpx: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const maskLayer = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentBgUrl) {
|
if (diyComponent.value.componentBgUrl) {
|
||||||
style += 'position:absolute;top:0;width:100%;';
|
style += 'position:absolute;top:0;width:100%;';
|
||||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||||
@ -131,11 +135,11 @@ const maskLayer = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const countBorderRadius = (type: any, index: any) => {
|
const countBorderRadius = (type: any, index: any) => {
|
||||||
var obj = '';
|
let obj = '';
|
||||||
if (diyComponent.value.elementAngle == 'right') {
|
if (diyComponent.value.elementAngle == 'right') {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
var defaultData: any = {
|
const defaultData: any = {
|
||||||
'row1-lt-of2-rt': [
|
'row1-lt-of2-rt': [
|
||||||
['border-top-right-radius', 'border-bottom-right-radius'],
|
['border-top-right-radius', 'border-bottom-right-radius'],
|
||||||
['border-top-left-radius', 'border-bottom-left-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 = () => {
|
const handleData = () => {
|
||||||
var singleRow: any = {
|
const singleRow: any = {
|
||||||
'row1-of2': {
|
'row1-of2': {
|
||||||
ratio: 2,
|
ratio: 2,
|
||||||
width: 'calc((100% - ' + upx2px(diyComponent.value.imageGap * 2) + 'px) / 2)'
|
width: 'calc((100% - ' + upx2px(diyComponent.value.imageGap * 2) + 'px) / 2)'
|
||||||
@ -269,14 +273,11 @@ const handleData = () => {
|
|||||||
* 高度:宽度*比例,示例:187.5*0.46=86.25
|
* 高度:宽度*比例,示例:187.5*0.46=86.25
|
||||||
*/
|
*/
|
||||||
const calcSingleRow = (params: any) => {
|
const calcSingleRow = (params: any) => {
|
||||||
uni.getSystemInfo({
|
|
||||||
success: res => {
|
|
||||||
let maxHeight = 0;
|
let maxHeight = 0;
|
||||||
|
|
||||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||||
var ratio = item.imgHeight / item.imgWidth;
|
const ratio = item.imgHeight / item.imgWidth;
|
||||||
|
|
||||||
let width = res.windowWidth - upx2px(diyComponent.value.margin.both * 2); // 减去左右间距
|
let width = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 2); // 减去左右间距
|
||||||
if (diyComponent.value.imageGap > 0) {
|
if (diyComponent.value.imageGap > 0) {
|
||||||
width -= upx2px(params.ratio * diyComponent.value.imageGap * 2); // 减去间隙
|
width -= upx2px(params.ratio * diyComponent.value.imageGap * 2); // 减去间隙
|
||||||
}
|
}
|
||||||
@ -290,21 +291,17 @@ const calcSingleRow = (params: any) => {
|
|||||||
item.widthStyle = params.width;
|
item.widthStyle = params.width;
|
||||||
item.imgHeight = maxHeight;
|
item.imgHeight = maxHeight;
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 魔方:四方型,各占50%
|
* 魔方:四方型,各占50%
|
||||||
*/
|
*/
|
||||||
const calcFourSquare = () => {
|
const calcFourSquare = () => {
|
||||||
uni.getSystemInfo({
|
|
||||||
success: res => {
|
|
||||||
let maxHeightFirst = 0;
|
let maxHeightFirst = 0;
|
||||||
let maxHeightTwo = 0;
|
let maxHeightTwo = 0;
|
||||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||||
var ratio = item.imgHeight / item.imgWidth;
|
const ratio = item.imgHeight / item.imgWidth;
|
||||||
item.imgWidth = res.windowWidth;
|
item.imgWidth = systemStore.systemInfo.windowWidth;
|
||||||
item.imgWidth -= upx2px(diyComponent.value.margin.both * 4);
|
item.imgWidth -= upx2px(diyComponent.value.margin.both * 4);
|
||||||
if (diyComponent.value.imageGap > 0) {
|
if (diyComponent.value.imageGap > 0) {
|
||||||
item.imgWidth -= upx2px(diyComponent.value.imageGap * 2);
|
item.imgWidth -= upx2px(diyComponent.value.imageGap * 2);
|
||||||
@ -333,8 +330,6 @@ const calcFourSquare = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 魔方:1左2右
|
* 魔方:1左2右
|
||||||
@ -343,12 +338,10 @@ const calcRowOneLeftOfTwoRight = () => {
|
|||||||
let rightHeight = 0; // 右侧两图平分高度
|
let rightHeight = 0; // 右侧两图平分高度
|
||||||
let divide = 'left'; // 划分规则,left:左,right:右
|
let divide = 'left'; // 划分规则,left:左,right:右
|
||||||
if (diyComponent.value.list[1].imgWidth === diyComponent.value.list[2].imgWidth) divide = '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) => {
|
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
var ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
const ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||||
item.imgWidth = item.imgWidth / 2;
|
item.imgWidth = item.imgWidth / 2;
|
||||||
item.imgHeight = item.imgWidth * ratio;
|
item.imgHeight = item.imgWidth * ratio;
|
||||||
rightHeight = (item.imgHeight - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
rightHeight = (item.imgHeight - upx2px(diyComponent.value.imageGap * 2)) / 2;
|
||||||
@ -359,23 +352,19 @@ const calcRowOneLeftOfTwoRight = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 魔方:1上2下
|
* 魔方:1上2下
|
||||||
*/
|
*/
|
||||||
const calcRowOneTopOfTwoBottom = () => {
|
const calcRowOneTopOfTwoBottom = () => {
|
||||||
var maxHeight = 0;
|
let maxHeight = 0;
|
||||||
uni.getSystemInfo({
|
|
||||||
success: res => {
|
|
||||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||||
|
|
||||||
var ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
const ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4);
|
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4);
|
||||||
} else if (index > 0) {
|
} else if (index > 0) {
|
||||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||||
item.imgWidth = item.imgWidth / 2;
|
item.imgWidth = item.imgWidth / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,20 +380,16 @@ const calcRowOneTopOfTwoBottom = () => {
|
|||||||
if (index > 0) item.imgHeight = maxHeight;
|
if (index > 0) item.imgHeight = maxHeight;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 魔方:1左3右
|
* 魔方:1左3右
|
||||||
*/
|
*/
|
||||||
const calcRowOneLeftOfOneTopOfTwoBottom = () => {
|
const calcRowOneLeftOfOneTopOfTwoBottom = () => {
|
||||||
uni.getSystemInfo({
|
|
||||||
success: res => {
|
|
||||||
diyComponent.value.list.forEach((item: any, index: any) => {
|
diyComponent.value.list.forEach((item: any, index: any) => {
|
||||||
// 左图
|
// 左图
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
var ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
const ratio = item.imgHeight / item.imgWidth; // 获取左图的尺寸比例
|
||||||
item.imgWidth = res.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
item.imgWidth = systemStore.systemInfo.windowWidth - upx2px(diyComponent.value.margin.both * 4) - upx2px(diyComponent.value.imageGap * 2);
|
||||||
item.imgWidth = item.imgWidth / 2;
|
item.imgWidth = item.imgWidth / 2;
|
||||||
item.imgHeight = item.imgWidth * ratio;
|
item.imgHeight = item.imgWidth * ratio;
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
@ -420,8 +405,6 @@ const calcRowOneLeftOfOneTopOfTwoBottom = () => {
|
|||||||
item.imgWidth += 'px';
|
item.imgWidth += 'px';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@ -61,7 +61,7 @@ const textStyle2 = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const warpCss = computed(() => {
|
const warpCss = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
style += 'position:relative;';
|
style += 'position:relative;';
|
||||||
if (diyComponent.value.componentStartBgColor) {
|
if (diyComponent.value.componentStartBgColor) {
|
||||||
if (diyComponent.value.componentStartBgColor && diyComponent.value.componentEndBgColor) style += `background:linear-gradient(${ diyComponent.value.componentGradientAngle },${ diyComponent.value.componentStartBgColor },${ diyComponent.value.componentEndBgColor });`;
|
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(() => {
|
const maskLayer = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (diyComponent.value.componentBgUrl) {
|
if (diyComponent.value.componentBgUrl) {
|
||||||
style += 'position:absolute;top:0;width:100%;';
|
style += 'position:absolute;top:0;width:100%;';
|
||||||
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
style += `background: rgba(0,0,0,${ diyComponent.value.componentBgAlpha / 10 });`;
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="mx-[60rpx]">
|
<view class="mx-[60rpx]">
|
||||||
<view class="pt-[140rpx] text-[50rpx] text-[#333]">{{ t('bindMobile') }}</view>
|
<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">
|
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
|
||||||
<view
|
<view
|
||||||
class="h-[90rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6]">
|
class="h-[90rpx] flex w-full items-center px-[30rpx] rounded-[var(--goods-rounded-mid)] box-border bg-[#F6F6F6]">
|
||||||
@ -55,18 +55,15 @@ import { useLogin } from '@/hooks/useLogin'
|
|||||||
import { redirect, pxToRpx } from '@/utils/common'
|
import { redirect, pxToRpx } from '@/utils/common'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
let menuButtonInfo: any = {};
|
const systemStore = useSystemStore()
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
/********* 自定义头部 - start ***********/
|
/********* 自定义头部 - start ***********/
|
||||||
const topTabarObj = topTabar()
|
const topTabarObj = topTabar()
|
||||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
const headerHeight = computed(() => {
|
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()
|
const memberStore = useMemberStore()
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
</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]">
|
<view class="mt-[181rpx]">
|
||||||
|
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<!-- 微信公众号快捷登录,开启自动注册的情况下才能使用 -->
|
<!-- 微信公众号快捷登录,开启自动注册的情况下才能使用 -->
|
||||||
<view v-if="isWeixinBrowser() && loginConfig.is_auth_register" class="w-full flex items-center justify-center mb-[40rpx]">
|
<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 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">
|
<view class="flex items-center justify-center mt-[28rpx] py-[14rpx] px-[50rpx]" @click.stop="agreeChange">
|
||||||
<u-checkbox-group @change="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>
|
</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>{{ t('agreeTips') }}</text>
|
||||||
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=privacy' })" class="text-primary">《{{ t('privacyAgreement') }}》</text>
|
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=privacy' })" class="text-primary">《{{ t('privacyAgreement') }}》</text>
|
||||||
<text>{{ t('and') }}</text>
|
<text>{{ t('and') }}</text>
|
||||||
@ -89,11 +88,10 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="footer w-full" v-if="loginConfig.is_mobile && loginConfig.is_username">
|
<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="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>
|
||||||
<view class="text-[24rpx] leading-[36rpx] text-[var(--text-color-light9)] text-center font-400 mt-[30rpx]">{{ t('accountLogin') }}</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -139,17 +137,13 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
|
|||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
import useSystemStore from '@/stores/system'
|
import useSystemStore from '@/stores/system'
|
||||||
|
|
||||||
let menuButtonInfo: any = {};
|
const systemStore = useSystemStore()
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
/********* 自定义头部 - start ***********/
|
/********* 自定义头部 - start ***********/
|
||||||
const topTabarObj = topTabar()
|
const topTabarObj = topTabar()
|
||||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { textColor: '#333' } })
|
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { textColor: '#333' } })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
const headerHeight = computed(() => {
|
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 wapMemberMobile = ref('');
|
||||||
const isAgree = ref(false)
|
const isAgree = ref(false)
|
||||||
@ -164,7 +158,6 @@ const memberStore = useMemberStore()
|
|||||||
const memberInfo: any = computed(() => {
|
const memberInfo: any = computed(() => {
|
||||||
return useMemberStore().info;
|
return useMemberStore().info;
|
||||||
})
|
})
|
||||||
const systemStore = useSystemStore()
|
|
||||||
const openType: any = computed(() => {
|
const openType: any = computed(() => {
|
||||||
if (!isAgree.value && configStore.login.agreement_show) return '';
|
if (!isAgree.value && configStore.login.agreement_show) return '';
|
||||||
return 'getPhoneNumber';
|
return 'getPhoneNumber';
|
||||||
@ -198,6 +191,7 @@ const bindMobileFn = () => {
|
|||||||
|
|
||||||
onLoad(async() => {
|
onLoad(async() => {
|
||||||
await systemStore.getSiteInfoFn()
|
await systemStore.getSiteInfoFn()
|
||||||
|
await systemStore.getMemberMobileExistFn()
|
||||||
await configStore.getLoginConfig()
|
await configStore.getLoginConfig()
|
||||||
let normalLogin = !configStore.login.is_username && !configStore.login.is_mobile && !configStore.login.is_bind_mobile; // 未开启普通登录
|
let normalLogin = !configStore.login.is_username && !configStore.login.is_mobile && !configStore.login.is_bind_mobile; // 未开启普通登录
|
||||||
|
|
||||||
@ -230,10 +224,7 @@ onLoad(async() => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wapMemberMobile.value = uni.getStorageSync('wap_member_mobile');
|
wapMemberMobile.value = uni.getStorageSync('member_mobile_exist');
|
||||||
if (!wapMemberMobile.value) {
|
|
||||||
wapMemberMobile.value = uni.getStorageSync('wap_member_not_control_mobile'); // 老用户不控制强制绑定手机号
|
|
||||||
}
|
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (wxPrivacyPopupRef.value) wxPrivacyPopupRef.value.proactive();
|
if (wxPrivacyPopupRef.value) wxPrivacyPopupRef.value.proactive();
|
||||||
@ -247,7 +238,7 @@ onShow(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const warpStyle = computed(() => {
|
const warpStyle = computed(() => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (configStore.login.bg_url) {
|
if (configStore.login.bg_url) {
|
||||||
style += 'background-image:url(' + img(configStore.login.bg_url) + ');';
|
style += 'background-image:url(' + img(configStore.login.bg_url) + ');';
|
||||||
style += 'background-size: 100%;';
|
style += 'background-size: 100%;';
|
||||||
@ -276,11 +267,16 @@ const oneClickLogin = (callback: any = null, data: any = null) => {
|
|||||||
if (checkWxPrivacy()) return;
|
if (checkWxPrivacy()) return;
|
||||||
|
|
||||||
if (loginLoading.value) return
|
if (loginLoading.value) return
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在登录中',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
loginLoading.value = true
|
loginLoading.value = true
|
||||||
|
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
callback = () => {
|
callback = () => {
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,17 +306,27 @@ const wechatLogin = () => {
|
|||||||
}
|
}
|
||||||
if (loginConfig.wechat_error) {
|
if (loginConfig.wechat_error) {
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
|
uni.hideLoading();
|
||||||
uni.showToast({ title: loginConfig.wechat_error, icon: 'none' })
|
uni.showToast({ title: loginConfig.wechat_error, icon: 'none' })
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wapMemberMobile.value = uni.getStorageSync('wap_member_mobile');
|
wapMemberMobile.value = uni.getStorageSync('member_mobile_exist');
|
||||||
if (!wapMemberMobile.value) {
|
let member_exist = uni.getStorageSync('member_exist')
|
||||||
wapMemberMobile.value = uni.getStorageSync('wap_member_not_control_mobile'); // 老用户不控制强制绑定手机号
|
|
||||||
}
|
|
||||||
if (loginConfig.is_auth_register) {
|
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();
|
bindMobileFn();
|
||||||
} else if (loginConfig.is_force_access_user_info) {
|
} else if (loginConfig.is_force_access_user_info) {
|
||||||
// 开启强制获取用户信息
|
// 开启强制获取用户信息
|
||||||
@ -330,13 +336,14 @@ const wechatLogin = () => {
|
|||||||
login.getAuthCode({ scopes: 'snsapi_base' }) // 静默获取
|
login.getAuthCode({ scopes: 'snsapi_base' }) // 静默获取
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if (!wapMemberMobile.value && loginConfig.is_bind_mobile) {
|
if (!wapMemberMobile.value && loginConfig.is_bind_mobile && !member_exist) {
|
||||||
bindMobileFn();
|
bindMobileFn();
|
||||||
}else {
|
}else {
|
||||||
login.getAuthCode({ scopes: 'snsapi_base' }) // 静默获取
|
login.getAuthCode({ scopes: 'snsapi_base' }) // 静默获取
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loginLoading.value = false
|
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) {
|
if (loginConfig.is_auth_register && loginConfig.is_force_access_user_info && !member_exist) {
|
||||||
infoFill.value.show = true
|
infoFill.value.show = true
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
|
uni.hideLoading();
|
||||||
} else {
|
} else {
|
||||||
data = data || {};
|
data = data || {};
|
||||||
login.getAuthCode({ backFlag: true, successCallback, ...data })
|
login.getAuthCode({ backFlag: true, successCallback, ...data })
|
||||||
@ -366,6 +374,7 @@ const mobileAuth = (e: any) => {
|
|||||||
uni.setStorageSync('wap_member_mobile', memberInfo.value.mobile) // 存储会员手机号,防止重复请求微信获取手机号接口
|
uni.setStorageSync('wap_member_mobile', memberInfo.value.mobile) // 存储会员手机号,防止重复请求微信获取手机号接口
|
||||||
}
|
}
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
|
uni.hideLoading();
|
||||||
}, { mobile_code: e.detail.code });
|
}, { mobile_code: e.detail.code });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,7 +391,10 @@ const mobileAuth = (e: any) => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.footer {
|
.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 + constant(safe-area-inset-bottom));
|
||||||
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,23 +7,26 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="mx-[60rpx]">
|
<view class="mx-[60rpx]">
|
||||||
<view class="pt-[140rpx] text-[44rpx] font-500 text-[#333]">{{ type == 'username' ? t('accountLogin') : t('mobileLogin') }}</view>
|
<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">
|
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
|
||||||
<template v-if="type == 'username'">
|
<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-form-item label="" prop="username" :border-bottom="false">
|
||||||
<u-input v-model="formData.username" border="none" maxlength="40"
|
<u-input v-model="formData.username" border="none" maxlength="40"
|
||||||
:placeholder="t('usernamePlaceholder')" autocomplete="off" class="!bg-transparent"
|
:placeholder="t('usernamePlaceholder')" autocomplete="off" class="!bg-transparent"
|
||||||
:disabled="real_name_input" fontSize="26rpx"
|
: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>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="password" :border-bottom="false">
|
||||||
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
||||||
:placeholder="t('passwordPlaceholder')" autocomplete="new-password"
|
:placeholder="t('passwordPlaceholder')" autocomplete="new-password"
|
||||||
class="!bg-transparent" :disabled="real_name_input" fontSize="26rpx"
|
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>
|
<template #suffix>
|
||||||
<view @click="changePassword" v-if="formData.password">
|
<view @click="changePassword" v-if="formData.password">
|
||||||
<u-icon :name="isPassword?'eye-off':'eye-fill'" color="#b9b9b9" size="20"></u-icon>
|
<u-icon :name="isPassword?'eye-off':'eye-fill'" color="#b9b9b9" size="20"></u-icon>
|
||||||
@ -34,20 +37,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="type == 'mobile'">
|
<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-form-item label="" prop="mobile" :border-bottom="false">
|
||||||
<u-input v-model="formData.mobile" type="number" maxlength="11" border="none"
|
<u-input v-model="formData.mobile" type="number" maxlength="11" border="none"
|
||||||
:placeholder="t('mobilePlaceholder')" autocomplete="off" class="!bg-transparent"
|
:placeholder="t('mobilePlaceholder')" autocomplete="off" class="!bg-transparent"
|
||||||
:disabled="real_name_input" fontSize="26rpx"
|
: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>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="mobile_code" :border-bottom="false">
|
||||||
<u-input v-model="formData.mobile_code" type="number" maxlength="4" border="none"
|
<u-input v-model="formData.mobile_code" type="number" maxlength="4" border="none"
|
||||||
class="!bg-transparent" fontSize="26rpx" :disabled="real_name_input"
|
class="!bg-transparent" fontSize="26rpx" :disabled="real_name_input"
|
||||||
:placeholder="t('codePlaceholder')"
|
:placeholder="t('codePlaceholder')"
|
||||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]">
|
placeholderClass="!text-[var(--text-color-light6)] text-[26rpx]">
|
||||||
<template #suffix>
|
<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-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>
|
<sms-code v-else :mobile="formData.mobile" type="login" v-model="formData.mobile_key"></sms-code>
|
||||||
@ -57,11 +60,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-form>
|
</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="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-[160rpx]':type != 'username','mt-[106rpx]':type == 'username'}">
|
<view class="mt-[106rpx]">
|
||||||
<view v-if="configStore.login.agreement_show" class="flex items-center mb-[20rpx] py-[14rpx]" @click.stop="agreeChange">
|
<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-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>
|
</u-checkbox-group>
|
||||||
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap leading-[30rpx]">
|
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap leading-[30rpx]">
|
||||||
<text>{{ t('agreeTips') }}</text>
|
<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>
|
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=service' })" class="text-primary">《{{ t('userAgreement') }}》</text>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
||||||
</view>
|
</view>
|
||||||
<uni-popup ref="popupRef" type="dialog">
|
<uni-popup ref="popupRef" type="dialog">
|
||||||
@ -99,10 +95,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
<view class="footer w-full" v-if="isShowQuickLogin">
|
<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-[#333] text-center mb-[30rpx] font-400">{{ t('oneClicklogin') }}</view>
|
<view class="text-[26rpx] leading-[36rpx] text-[#666] text-center mb-[30rpx] font-400">其他登录方式</view>
|
||||||
<view class="flex justify-center">
|
<view class="flex justify-center gap-[40rpx]">
|
||||||
<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>
|
<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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -117,18 +115,15 @@ import { t } from '@/locale'
|
|||||||
import { redirect, getToken, pxToRpx, isWeixinBrowser } from '@/utils/common'
|
import { redirect, getToken, pxToRpx, isWeixinBrowser } from '@/utils/common'
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
let menuButtonInfo: any = {};
|
const systemStore = useSystemStore()
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
/********* 自定义头部 - start ***********/
|
/********* 自定义头部 - start ***********/
|
||||||
const topTabarObj = topTabar()
|
const topTabarObj = topTabar()
|
||||||
const param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
const param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
const headerHeight = computed(() => {
|
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 real_name_input = ref(true);
|
||||||
const memberStore = useMemberStore()
|
const memberStore = useMemberStore()
|
||||||
@ -161,6 +156,14 @@ onLoad(async(option: any) => {
|
|||||||
redirect({ url: '/app/pages/index/index', mode: 'reLaunch' })
|
redirect({ url: '/app/pages/index/index', mode: 'reLaunch' })
|
||||||
}, 100)
|
}, 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) {
|
||||||
if (option.type == 'mobile') {
|
if (option.type == 'mobile') {
|
||||||
if (configStore.login.is_mobile) {
|
if (configStore.login.is_mobile) {
|
||||||
@ -282,8 +285,8 @@ const handleLogin = () => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
||||||
const login = type.value == 'username' ? usernameLogin : mobileLogin
|
const login = type.value == 'username' ? usernameLogin : mobileLogin
|
||||||
|
|
||||||
login(formData).then((res: any) => {
|
login(formData).then((res: any) => {
|
||||||
|
|
||||||
memberStore.setToken(res.data.token)
|
memberStore.setToken(res.data.token)
|
||||||
// todo 已注册的会员不受影响
|
// todo 已注册的会员不受影响
|
||||||
// if (configStore.login.is_bind_mobile && !res.data.mobile) {
|
// 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>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.u-input) {
|
:deep(.u-input) {
|
||||||
@ -332,7 +341,12 @@ const toLink = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
|
// position: absolute;
|
||||||
|
// position: fixed;
|
||||||
margin-top: 200rpx;
|
margin-top: 200rpx;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
padding-bottom: calc(151rpx + constant(safe-area-inset-bottom));
|
padding-bottom: calc(151rpx + constant(safe-area-inset-bottom));
|
||||||
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,10 +7,15 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="mx-[60rpx]">
|
<view class="mx-[60rpx]">
|
||||||
<view class="pt-[140rpx] text-[44rpx] font-500 text-[#333]">{{ type == 'username' ? t('usernameRegister') : t('mobileRegister') }}</view>
|
<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">
|
<u-form labelPosition="left" :model="formData" errorType='toast' :rules="rules" ref="formRef">
|
||||||
<template v-if="type == 'username'">
|
<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-form-item label="" prop="username" :border-bottom="false">
|
||||||
<u-input v-model="formData.username" border="none" maxlength="40"
|
<u-input v-model="formData.username" border="none" maxlength="40"
|
||||||
:placeholder="t('usernamePlaceholder')" class="!bg-transparent"
|
:placeholder="t('usernamePlaceholder')" class="!bg-transparent"
|
||||||
@ -18,7 +23,7 @@
|
|||||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="password" :border-bottom="false">
|
||||||
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
||||||
:placeholder="t('passwordPlaceholder')" class="!bg-transparent"
|
:placeholder="t('passwordPlaceholder')" class="!bg-transparent"
|
||||||
@ -32,7 +37,7 @@
|
|||||||
</u-input>
|
</u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="confirm_password" :border-bottom="false">
|
||||||
<u-input v-model="formData.confirm_password" border="none" :password="isConfirmPassword"
|
<u-input v-model="formData.confirm_password" border="none" :password="isConfirmPassword"
|
||||||
maxlength="40" :placeholder="t('confirmPasswordPlaceholder')"
|
maxlength="40" :placeholder="t('confirmPasswordPlaceholder')"
|
||||||
@ -48,7 +53,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="type == 'mobile' || configStore.login.is_bind_mobile">
|
<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-form-item label="" prop="mobile" :border-bottom="false">
|
||||||
<u-input v-model="formData.mobile" border="none" maxlength="11"
|
<u-input v-model="formData.mobile" border="none" maxlength="11"
|
||||||
:placeholder="t('mobilePlaceholder')" class="!bg-transparent"
|
:placeholder="t('mobilePlaceholder')" class="!bg-transparent"
|
||||||
@ -56,7 +61,7 @@
|
|||||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="mobile_code" :border-bottom="false">
|
||||||
<u-input v-model="formData.mobile_code" border="none" maxlength="4"
|
<u-input v-model="formData.mobile_code" border="none" maxlength="4"
|
||||||
:placeholder="t('codePlaceholder')" class="!bg-transparent"
|
:placeholder="t('codePlaceholder')" class="!bg-transparent"
|
||||||
@ -71,7 +76,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="type == 'username'">
|
<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-form-item label="" prop="captcha_code" :border-bottom="false">
|
||||||
<u-input v-model="formData.captcha_code" border="none"
|
<u-input v-model="formData.captcha_code" border="none"
|
||||||
:placeholder="t('captchaPlaceholder')" class="!bg-transparent"
|
:placeholder="t('captchaPlaceholder')" class="!bg-transparent"
|
||||||
@ -85,25 +90,25 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-form>
|
</u-form>
|
||||||
<view class="mt-[160rpx]">
|
<view class="mt-[140rpx]">
|
||||||
<view v-if="configStore.login.agreement_show" class="flex items-center mb-[20rpx] py-[14rpx]" @click.stop="agreeChange">
|
<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-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>
|
</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>{{ t('agreeTips') }}</text>
|
||||||
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=privacy' })" class="text-primary">《{{ t('privacyAgreement') }}》</text>
|
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=privacy' })" class="text-primary">《{{ t('privacyAgreement') }}》</text>
|
||||||
<text>{{ t('and') }}</text>
|
<text>{{ t('and') }}</text>
|
||||||
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=service' })" class="text-primary">《{{ t('userAgreement') }}》</text>
|
<text @click.stop="redirect({ url: '/app/pages/auth/agreement?key=service' })" class="text-primary">《{{ t('userAgreement') }}》</text>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -140,18 +145,15 @@ import { t } from '@/locale'
|
|||||||
import { redirect, getToken, pxToRpx } from '@/utils/common'
|
import { redirect, getToken, pxToRpx } from '@/utils/common'
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
let menuButtonInfo: any = {};
|
const systemStore = useSystemStore()
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
/********* 自定义头部 - start ***********/
|
/********* 自定义头部 - start ***********/
|
||||||
const topTabarObj = topTabar()
|
const topTabarObj = topTabar()
|
||||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
const headerHeight = computed(() => {
|
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({
|
const formData = reactive({
|
||||||
username: '',
|
username: '',
|
||||||
@ -371,4 +373,8 @@ const toLink = () => {
|
|||||||
:deep(.u-checkbox) {
|
:deep(.u-checkbox) {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
.footer {
|
||||||
|
padding-bottom: calc(151rpx + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(151rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -7,9 +7,9 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="mx-[60rpx]">
|
<view class="mx-[60rpx]">
|
||||||
<view class="pt-[140rpx] text-[44rpx] font-500 text-[#333]">{{ t('findPassword') }}</view>
|
<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">
|
<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-form-item label="" prop="mobile" :border-bottom="false">
|
||||||
<u-input v-model="formData.mobile" type="number" maxlength="11" border="none"
|
<u-input v-model="formData.mobile" type="number" maxlength="11" border="none"
|
||||||
:placeholder="t('mobilePlaceholder')" class="!bg-transparent"
|
:placeholder="t('mobilePlaceholder')" class="!bg-transparent"
|
||||||
@ -17,7 +17,7 @@
|
|||||||
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
placeholderClass="!text-[var(--text-color-light9)] text-[26rpx]" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="code" :border-bottom="false">
|
||||||
<u-input v-model="formData.mobile_code" type="number" maxlength="4" border="none"
|
<u-input v-model="formData.mobile_code" type="number" maxlength="4" border="none"
|
||||||
:placeholder="t('codePlaceholder')" class="!bg-transparent" :disabled="real_name_input"
|
:placeholder="t('codePlaceholder')" class="!bg-transparent" :disabled="real_name_input"
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</u-input>
|
</u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="password" :border-bottom="false">
|
||||||
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
<u-input v-model="formData.password" border="none" :password="isPassword" maxlength="40"
|
||||||
:placeholder="t('passwordPlaceholder')" class="!bg-transparent"
|
:placeholder="t('passwordPlaceholder')" class="!bg-transparent"
|
||||||
@ -42,7 +42,7 @@
|
|||||||
</u-input>
|
</u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</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-form-item label="" prop="confirm_password" :border-bottom="false">
|
||||||
<u-input v-model="formData.confirm_password" border="none" :password="isConfirmPassword"
|
<u-input v-model="formData.confirm_password" border="none" :password="isConfirmPassword"
|
||||||
maxlength="40" :placeholder="t('confirmPasswordPlaceholder')" class="!bg-transparent"
|
maxlength="40" :placeholder="t('confirmPasswordPlaceholder')" class="!bg-transparent"
|
||||||
@ -70,18 +70,15 @@ import { t } from '@/locale'
|
|||||||
import { resetPassword } from '@/app/api/system'
|
import { resetPassword } from '@/app/api/system'
|
||||||
import { redirect, pxToRpx } from '@/utils/common'
|
import { redirect, pxToRpx } from '@/utils/common'
|
||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
let menuButtonInfo: any = {};
|
const systemStore = useSystemStore()
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
/********* 自定义头部 - start ***********/
|
/********* 自定义头部 - start ***********/
|
||||||
const topTabarObj = topTabar()
|
const topTabarObj = topTabar()
|
||||||
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
let param = topTabarObj.setTopTabbarParam({ title: '', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
const headerHeight = computed(() => {
|
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({
|
const formData = reactive({
|
||||||
mobile: '',
|
mobile: '',
|
||||||
|
|||||||
@ -34,7 +34,7 @@ const save = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var reg = /^[0-9]+$/;
|
const reg = /^[0-9]+$/;
|
||||||
if (!reg.test(formData.siteId)) {
|
if (!reg.test(formData.siteId)) {
|
||||||
uni.showToast({ title: t('pleaseEnterNumber'), icon: 'none' });
|
uni.showToast({ title: t('pleaseEnterNumber'), icon: 'none' });
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<collect-tip ref="collectTipRef" ></collect-tip>
|
||||||
<!-- 小程序隐私协议 -->
|
<!-- 小程序隐私协议 -->
|
||||||
<wx-privacy-popup ref="wxPrivacyPopupRef"></wx-privacy-popup>
|
<wx-privacy-popup ref="wxPrivacyPopupRef"></wx-privacy-popup>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
@ -40,7 +41,7 @@ const diy = useDiy({
|
|||||||
const diyGroupRef = ref(null)
|
const diyGroupRef = ref(null)
|
||||||
|
|
||||||
const wxPrivacyPopupRef: any = ref(null)
|
const wxPrivacyPopupRef: any = ref(null)
|
||||||
|
const collectTipRef: any = ref(null)
|
||||||
// 监听页面加载
|
// 监听页面加载
|
||||||
diy.onLoad();
|
diy.onLoad();
|
||||||
|
|
||||||
@ -57,9 +58,11 @@ diy.onShow((data: any) => {
|
|||||||
let share = data.share ? JSON.parse(data.share) : null;
|
let share = data.share ? JSON.parse(data.share) : null;
|
||||||
setShare(share);
|
setShare(share);
|
||||||
diyGroupRef.value?.refresh();
|
diyGroupRef.value?.refresh();
|
||||||
|
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (wxPrivacyPopupRef.value) wxPrivacyPopupRef.value.proactive();
|
if (wxPrivacyPopupRef.value) wxPrivacyPopupRef.value.proactive();
|
||||||
|
if (collectTipRef.value) collectTipRef.value.show();
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
});
|
});
|
||||||
|
|||||||
@ -44,15 +44,25 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<view class="w-full footer">
|
<view class="w-full footer">
|
||||||
|
|
||||||
<view
|
<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"
|
<button hover-class="none"
|
||||||
class="primary-btn-bg !text-[#fff] h-[80rpx] leading-[80rpx] rounded-[100rpx] text-[26rpx] font-500"
|
class="primary-btn-bg !text-[#fff] h-[80rpx] leading-[80rpx] rounded-[100rpx] text-[26rpx] font-500"
|
||||||
@click="save" :disabled="btnDisabled" :loading="operateLoading"
|
@click="save" :disabled="btnDisabled" :loading="operateLoading"
|
||||||
:class="{'opacity-50': btnDisabled}">{{ t('save') }}
|
:class="{'opacity-50': btnDisabled}">{{ t('save') }}
|
||||||
</button>
|
</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>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<area-select ref="areaRef" @complete="areaSelectComplete" :area-id="formData.district_id || formData.city_id" />
|
<area-select ref="areaRef" @complete="areaSelectComplete" :area-id="formData.district_id || formData.city_id" />
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
@ -115,7 +125,7 @@ onLoad((data: any) => {
|
|||||||
}
|
}
|
||||||
formData.value.address = data.name;
|
formData.value.address = data.name;
|
||||||
getAddress(data.latng);
|
getAddress(data.latng);
|
||||||
var tempArr = getQueryVariable('latng').split(',');
|
const tempArr = getQueryVariable('latng').split(',');
|
||||||
formData.value.lat = tempArr[0];
|
formData.value.lat = tempArr[0];
|
||||||
formData.value.lng = tempArr[1];
|
formData.value.lng = tempArr[1];
|
||||||
}
|
}
|
||||||
@ -277,7 +287,7 @@ const chooseLocation = () => {
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
var urlencode = formData.value;
|
const urlencode = formData.value;
|
||||||
uni.setStorageSync('addressInfo', urlencode);
|
uni.setStorageSync('addressInfo', urlencode);
|
||||||
let backurl = location.origin + location.pathname + '?source=' + source.value;
|
let backurl = location.origin + location.pathname + '?source=' + source.value;
|
||||||
if (isSelectMap.value) {
|
if (isSelectMap.value) {
|
||||||
@ -310,16 +320,36 @@ const getAddress = (latlng: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getQueryVariable = (variable: any) => {
|
const getQueryVariable = (variable: any) => {
|
||||||
var query = window.location.search.substring(1);
|
const query = window.location.search.substring(1);
|
||||||
var vars = query.split('&');
|
const vars = query.split('&');
|
||||||
for (var i = 0; i < vars.length; i++) {
|
for (let i = 0; i < vars.length; i++) {
|
||||||
var pair = vars[i].split('=');
|
const pair = vars[i].split('=');
|
||||||
if (pair[0] == variable) {
|
if (pair[0] == variable) {
|
||||||
return pair[1];
|
return pair[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<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) + constant(safe-area-inset-bottom)) !important;
|
||||||
height: calc(100rpx + var(--top-m) + var(--top-m) + env(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>
|
</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(() => {
|
const headerStyle = computed(() => {
|
||||||
return {
|
return {
|
||||||
backgroundImage: 'url(' + img('static/resource/images/member/balance_bg.png') + ') ',
|
backgroundImage: 'url(' + img('static/resource/images/member/balance_bg.png') + ') ',
|
||||||
@ -154,14 +147,14 @@ const headerStyle = computed(() => {
|
|||||||
|
|
||||||
const mescrollTop = computed(() => {
|
const mescrollTop = computed(() => {
|
||||||
if ((cashOutConfigObj.is_open == 1 || rechargeConfigObj.is_use == 1)) {
|
if ((cashOutConfigObj.is_open == 1 || rechargeConfigObj.is_use == 1)) {
|
||||||
if (Object.keys(menuButtonInfo).length) {
|
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||||
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 700) + 'rpx'
|
return (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 700) + 'rpx'
|
||||||
} else {
|
} else {
|
||||||
return '718rpx'
|
return '718rpx'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Object.keys(menuButtonInfo).length) {
|
if (Object.keys(systemStore.menuButtonInfo).length) {
|
||||||
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8) + 632) + 'rpx'
|
return (pxToRpx(Number(systemStore.menuButtonInfo.height)) + pxToRpx(systemStore.menuButtonInfo.top) + pxToRpx(8) + 632) + 'rpx'
|
||||||
} else {
|
} else {
|
||||||
return '650rpx'
|
return '650rpx'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,9 +77,11 @@ import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
|
|||||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app';
|
||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
import selectDate from '@/components/select-date/select-date.vue';
|
import selectDate from '@/components/select-date/select-date.vue';
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
const { downCallback, mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
|
const { downCallback, mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
|
||||||
const memberStore = useMemberStore();
|
const memberStore = useMemberStore();
|
||||||
|
const systemStore = useSystemStore()
|
||||||
const info = computed(() => memberStore.info)
|
const info = computed(() => memberStore.info)
|
||||||
// 提现
|
// 提现
|
||||||
const applyCashOut = () => {
|
const applyCashOut = () => {
|
||||||
@ -92,12 +94,6 @@ const topTabarObj = topTabar()
|
|||||||
let param = topTabarObj.setTopTabbarParam({ title: '我的佣金', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
let param = topTabarObj.setTopTabbarParam({ title: '我的佣金', topStatusBar: { bgColor: '#fff', textColor: '#333' } })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
|
|
||||||
// 获取系统状态栏的高度
|
|
||||||
let menuButtonInfo: any = {};
|
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
const headerStyle = computed(() => {
|
const headerStyle = computed(() => {
|
||||||
return {
|
return {
|
||||||
backgroundImage: 'url(' + img('static/resource/images/member/commission/commission_bg.png') + ') ',
|
backgroundImage: 'url(' + img('static/resource/images/member/commission/commission_bg.png') + ') ',
|
||||||
@ -108,7 +104,7 @@ const headerStyle = computed(() => {
|
|||||||
})
|
})
|
||||||
// 16为自定头部的padding-bottom
|
// 16为自定头部的padding-bottom
|
||||||
const mescrollTop = computed(() => {
|
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">
|
<style lang="scss">
|
||||||
.member-level {
|
.member-level {
|
||||||
background: linear-gradient(360deg, #F23621 11%, #FF7F71 100%), #D9D9D9;
|
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) {
|
:deep(.uni-scroll-view) {
|
||||||
|
|||||||
@ -22,6 +22,8 @@ onMounted(() => {
|
|||||||
|
|
||||||
props.data.formField.forEach((item: any) => {
|
props.data.formField.forEach((item: any) => {
|
||||||
let comp = {
|
let comp = {
|
||||||
|
|
||||||
|
componentIsShow: true, // 是否显示
|
||||||
id: item.field_key,
|
id: item.field_key,
|
||||||
componentName: item.field_type,
|
componentName: item.field_type,
|
||||||
pageStyle: '',
|
pageStyle: '',
|
||||||
|
|||||||
@ -110,7 +110,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="!loading && (!list || !list.length)">
|
<view v-if="!loading && (!list || !list.length)">
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
<top-tabbar :data="topTabbarDataEmpty" />
|
<top-tabbar :data="topTabbarDataEmpty" />
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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]">
|
<view class="my-[var(--top-m)] sidebar-margin overflow-hidden card-template py-[20rpx]">
|
||||||
<u-cell-group :border="false" class="cell-group">
|
<u-cell-group :border="false" class="cell-group">
|
||||||
<u-cell :title="t('headimg')" :titleStyle="{'font-size': '28rpx'}" :is-link="true">
|
<u-cell :title="t('headimg')" :titleStyle="{'font-size': '28rpx'}" :is-link="true">
|
||||||
@ -217,7 +217,7 @@ page {
|
|||||||
.u-cell {
|
.u-cell {
|
||||||
.u-cell__body {
|
.u-cell__body {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 90rpx;
|
height: 80rpx;
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.u-cell__title-text {
|
.u-cell__title-text {
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ page {
|
|||||||
|
|
||||||
.u-cell__value {
|
.u-cell__value {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
color: #333 !important;
|
color: #333 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.u-action-sheet__item-wrap__item__name {
|
.u-action-sheet__item-wrap__item__name {
|
||||||
font-size: 30rpx !important;
|
font-size: 26rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,8 +287,8 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.detail-two-content{
|
.detail-two-content{
|
||||||
padding-top: 32rpx !important;
|
padding-top: 30rpx !important;
|
||||||
padding-bottom: 32rpx !important;
|
padding-bottom: 30rpx !important;
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
& > view{
|
& > view{
|
||||||
width: 72% !important;
|
width: 72% !important;
|
||||||
@ -297,7 +297,11 @@ page {
|
|||||||
height: 136rpx !important;
|
height: 136rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& > view, .detail-two-content-label{
|
||||||
|
font-size: 26rpx!important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@ -106,29 +106,25 @@ import { t } from '@/locale'
|
|||||||
import { redirect, img, pxToRpx } from '@/utils/common';
|
import { redirect, img, pxToRpx } from '@/utils/common';
|
||||||
import { getMemberAccountPointcount, getTaskPoint } from '@/app/api/member';
|
import { getMemberAccountPointcount, getTaskPoint } from '@/app/api/member';
|
||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
/********* 自定义头部 - start ***********/
|
/********* 自定义头部 - start ***********/
|
||||||
const topTabarObj = topTabar()
|
const topTabarObj = topTabar()
|
||||||
let param = topTabarObj.setTopTabbarParam({ title: '我的积分' })
|
let param = topTabarObj.setTopTabbarParam({ title: '我的积分' })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
|
|
||||||
// 获取系统状态栏的高度
|
const systemStore = useSystemStore()
|
||||||
let menuButtonInfo: any = {};
|
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
const headerStyle = computed(() => {
|
const headerStyle = computed(() => {
|
||||||
return {
|
return {
|
||||||
backgroundImage: 'url(' + img('static/resource/images/member/point/point_bg.png') + ') ',
|
backgroundImage: 'url(' + img('static/resource/images/member/point/point_bg.png') + ') ',
|
||||||
backgroundSize: 'cover',
|
backgroundSize: 'cover',
|
||||||
backgroundRepeat: 'no-repeat',
|
backgroundRepeat: 'no-repeat',
|
||||||
backgroundPosition: 'bottom',
|
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(() => {
|
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
|
return style
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -247,6 +247,7 @@ import { onLoad } from '@dcloudio/uni-app'
|
|||||||
import { getSignInfo, getSignConfig, setSign, getDayPack } from '@/app/api/member'
|
import { getSignInfo, getSignConfig, setSign, getDayPack } from '@/app/api/member'
|
||||||
import useMemberStore from '@/stores/member'
|
import useMemberStore from '@/stores/member'
|
||||||
import { topTabar } from '@/utils/topTabbar'
|
import { topTabar } from '@/utils/topTabbar'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
dataCount: [], //当月所有天数
|
dataCount: [], //当月所有天数
|
||||||
@ -462,23 +463,18 @@ const filteredDate = (date: any) => {
|
|||||||
return date > 0 ? date : ''
|
return date > 0 ? date : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取系统状态栏的高度
|
const systemStore = useSystemStore()
|
||||||
let menuButtonInfo: any = {};
|
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
||||||
// #endif
|
|
||||||
/********* 自定义头部 - start ***********/
|
/********* 自定义头部 - start ***********/
|
||||||
const topTabarObj = topTabar()
|
const topTabarObj = topTabar()
|
||||||
let topTabbarData = topTabarObj.setTopTabbarParam({ title: '我的签到' })
|
let topTabbarData = topTabarObj.setTopTabbarParam({ title: '我的签到' })
|
||||||
/********* 自定义头部 - end ***********/
|
/********* 自定义头部 - end ***********/
|
||||||
|
|
||||||
const headStyle = computed(() => {
|
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
|
return style
|
||||||
})
|
})
|
||||||
const topStyle = computed(() => {
|
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
|
return style
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</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"
|
<u-action-sheet :actions="langList" :show="langSheetShow" :closeOnClickOverlay="true"
|
||||||
:safeAreaInsetBottom="true"
|
:safeAreaInsetBottom="true"
|
||||||
@ -63,7 +63,7 @@ page {
|
|||||||
.u-cell {
|
.u-cell {
|
||||||
.u-cell__body {
|
.u-cell__body {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 90rpx;
|
height: 80rpx;
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.u-cell__title-text {
|
.u-cell__title-text {
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ page {
|
|||||||
|
|
||||||
.u-cell__value {
|
.u-cell__value {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-line {
|
.u-line {
|
||||||
@ -104,7 +104,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.u-action-sheet__item-wrap__item__name {
|
.u-action-sheet__item-wrap__item__name {
|
||||||
font-size: 30rpx !important;
|
font-size: 26rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -156,7 +156,7 @@ const scanCode = () => {
|
|||||||
|
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
var reg = /[\S]+/;
|
const reg = /[\S]+/;
|
||||||
if (!reg.test(verify_code.value)) {
|
if (!reg.test(verify_code.value)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入核销码',
|
title: '请输入核销码',
|
||||||
|
|||||||
@ -12,7 +12,7 @@ interface Diy {
|
|||||||
title: string,
|
title: string,
|
||||||
pageStartBgColor: string, // 页面背景颜色(开始)
|
pageStartBgColor: string, // 页面背景颜色(开始)
|
||||||
pageEndBgColor: string, // 页面背景颜色(结束)
|
pageEndBgColor: string, // 页面背景颜色(结束)
|
||||||
bottomTabBarSwitch: boolean, // 底部导航开关
|
bottomTabBar: any, // 底部导航
|
||||||
bgUrl: string
|
bgUrl: string
|
||||||
},
|
},
|
||||||
// 组件集合
|
// 组件集合
|
||||||
@ -20,7 +20,8 @@ interface Diy {
|
|||||||
topFixedStatus: string, // 置顶组件的状态
|
topFixedStatus: string, // 置顶组件的状态
|
||||||
scrollTop: number,
|
scrollTop: number,
|
||||||
topTabarHeight: number,
|
topTabarHeight: number,
|
||||||
componentRefs: any
|
componentRefs: any,
|
||||||
|
imageAdsSameScreen: any // 图片广告, 是否设置沉浸式
|
||||||
}
|
}
|
||||||
|
|
||||||
const useDiyStore = defineStore('diy', {
|
const useDiyStore = defineStore('diy', {
|
||||||
@ -34,14 +35,18 @@ const useDiyStore = defineStore('diy', {
|
|||||||
title: "",
|
title: "",
|
||||||
pageStartBgColor: '', // 页面背景颜色(开始)
|
pageStartBgColor: '', // 页面背景颜色(开始)
|
||||||
pageEndBgColor: '', // 页面背景颜色(结束)
|
pageEndBgColor: '', // 页面背景颜色(结束)
|
||||||
bottomTabBarSwitch: true,
|
bottomTabBar: {
|
||||||
|
control: true, // 是否允许展示编辑
|
||||||
|
isShow: true, // 是否显示
|
||||||
|
},
|
||||||
bgUrl: ''
|
bgUrl: ''
|
||||||
},
|
},
|
||||||
value: [], // 组件集合
|
value: [], // 组件集合
|
||||||
topFixedStatus: 'home', // 顶部 置顶组件状态,home:展示首页数据、diy:展示置顶组件定义的子页面
|
topFixedStatus: 'home', // 顶部 置顶组件状态,home:展示首页数据、diy:展示置顶组件定义的子页面
|
||||||
scrollTop: 0, // 滚动位置
|
scrollTop: 0, // 滚动位置
|
||||||
topTabarHeight: 0,
|
topTabarHeight: 0,
|
||||||
componentRefs: null
|
componentRefs: null,
|
||||||
|
imageAdsSameScreen: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {},
|
getters: {},
|
||||||
@ -49,7 +54,7 @@ const useDiyStore = defineStore('diy', {
|
|||||||
// 初始化
|
// 初始化
|
||||||
init() {
|
init() {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
var data = JSON.stringify({
|
const data = JSON.stringify({
|
||||||
type: 'init',
|
type: 'init',
|
||||||
load: true
|
load: true
|
||||||
});
|
});
|
||||||
@ -68,6 +73,7 @@ const useDiyStore = defineStore('diy', {
|
|||||||
if (this.value) {
|
if (this.value) {
|
||||||
this.value.forEach((item, index) => {
|
this.value.forEach((item, index) => {
|
||||||
item.pageStyle = '';
|
item.pageStyle = '';
|
||||||
|
item.componentIsShow = true // 是否显示
|
||||||
if (item.pageStartBgColor) {
|
if (item.pageStartBgColor) {
|
||||||
if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${ item.pageGradientAngle },${ item.pageStartBgColor },${ item.pageEndBgColor });`;
|
if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${ item.pageGradientAngle },${ item.pageStartBgColor },${ item.pageEndBgColor });`;
|
||||||
else item.pageStyle += 'background-color:' + item.pageStartBgColor + ';';
|
else item.pageStyle += 'background-color:' + item.pageStartBgColor + ';';
|
||||||
@ -118,7 +124,7 @@ const useDiyStore = defineStore('diy', {
|
|||||||
// 减少重复请求
|
// 减少重复请求
|
||||||
if (this.currentIndex == index) return;
|
if (this.currentIndex == index) return;
|
||||||
this.currentIndex = index;
|
this.currentIndex = index;
|
||||||
var data = JSON.stringify({
|
const data = JSON.stringify({
|
||||||
type: 'change',
|
type: 'change',
|
||||||
index,
|
index,
|
||||||
component: toRaw(component)
|
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-if="selected.district">{{ selected.district.name }}</view>
|
||||||
<view v-else>请选择</view>
|
<view v-else>请选择</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="flex-1 pr-[10rpx]" v-else></view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y="true" class="h-[50vh]">
|
<scroll-view scroll-y="true" class="h-[50vh]">
|
||||||
<view class="flex p-[30rpx] pt-0 text-sm">
|
<view class="flex p-[30rpx] pt-[0] text-sm font-500">
|
||||||
<view v-if="areaList.province.length" v-show="currSelect == 'province'">
|
<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 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>
|
||||||
<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 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>
|
||||||
<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 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>
|
||||||
|
<view class="flex-1 pr-[10rpx]" v-else></view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
@ -68,10 +70,6 @@ watch(() => prop.areaId, (nval, oval) => {
|
|||||||
data.province && (selected.province = data.province)
|
data.province && (selected.province = data.province)
|
||||||
data.city && (selected.city = data.city)
|
data.city && (selected.city = data.city)
|
||||||
data.district && (selected.district = data.district)
|
data.district && (selected.district = data.district)
|
||||||
if (data.city == undefined && data.province && data.district) {
|
|
||||||
selected.city = data.district
|
|
||||||
selected.district=null
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -150,6 +148,9 @@ watch(() => selected.district, (nval) => {
|
|||||||
|
|
||||||
const open = () => {
|
const open = () => {
|
||||||
show.value = true
|
show.value = true
|
||||||
|
if(prop.areaId){
|
||||||
|
currSelect.value = 'district'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|||||||
@ -128,7 +128,12 @@ const handleBind = () => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
||||||
const request = info.value ? bindMobile : mobileLogin;
|
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) => {
|
request(formData).then((res: any) => {
|
||||||
if (info.value) {
|
if (info.value) {
|
||||||
memberStore.getMemberInfo()
|
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
|
// https://uniapp.dcloud.io/frame?id=renderjs
|
||||||
|
|
||||||
// 与wxs的me实例一致
|
// 与wxs的me实例一致
|
||||||
var me = {}
|
const me = {};
|
||||||
|
|
||||||
// 初始化window对象的touch事件 (仅初始化一次)
|
// 初始化window对象的touch事件 (仅初始化一次)
|
||||||
if(window && !window.$mescrollRenderInit){
|
if(window && !window.$mescrollRenderInit){
|
||||||
@ -20,18 +20,18 @@ if(window && !window.$mescrollRenderInit){
|
|||||||
if (me.disabled()) return;
|
if (me.disabled()) return;
|
||||||
if (me.getScrollTop() > 0) return; // 需在顶部下拉,才禁止bounce
|
if (me.getScrollTop() > 0) return; // 需在顶部下拉,才禁止bounce
|
||||||
|
|
||||||
var curPoint = me.getPoint(e); // 当前点
|
const curPoint = me.getPoint(e); // 当前点
|
||||||
var moveY = curPoint.y - me.startPoint.y; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
|
const moveY = curPoint.y - me.startPoint.y; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
|
||||||
// 向下拉
|
// 向下拉
|
||||||
if (moveY > 0) {
|
if (moveY > 0) {
|
||||||
// 可下拉的条件
|
// 可下拉的条件
|
||||||
if (!me.isDownScrolling && !me.optDown.isLock && (!me.isUpScrolling || (me.isUpScrolling && me.isUpBoth))) {
|
if (!me.isDownScrolling && !me.optDown.isLock && (!me.isUpScrolling || (me.isUpScrolling && me.isUpBoth))) {
|
||||||
|
|
||||||
// 只有touch在mescroll的view上面,才禁止bounce
|
// 只有touch在mescroll的view上面,才禁止bounce
|
||||||
var el = e.target;
|
let el = e.target;
|
||||||
var isMescrollTouch = false;
|
let isMescrollTouch = false;
|
||||||
while (el && el.tagName && el.tagName !== 'UNI-PAGE-BODY' && el.tagName != "BODY") {
|
while (el && el.tagName && el.tagName !== 'UNI-PAGE-BODY' && el.tagName != "BODY") {
|
||||||
var cls = el.classList;
|
const cls = el.classList;
|
||||||
if (cls && cls.contains('mescroll-render-touch')) {
|
if (cls && cls.contains('mescroll-render-touch')) {
|
||||||
isMescrollTouch = true
|
isMescrollTouch = true
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -44,6 +44,10 @@ const prop = defineProps({
|
|||||||
default () {
|
default () {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
reformat: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -165,6 +169,7 @@ const confirmPay = () => {
|
|||||||
uni.$on('checkIsReturnAfterPayment', () => {
|
uni.$on('checkIsReturnAfterPayment', () => {
|
||||||
const data = uni.getStorageSync('paymenting')
|
const data = uni.getStorageSync('paymenting')
|
||||||
if (uni.getStorageSync('paymenting')) {
|
if (uni.getStorageSync('paymenting')) {
|
||||||
|
|
||||||
redirect({
|
redirect({
|
||||||
url: '/app/pages/pay/result',
|
url: '/app/pages/pay/result',
|
||||||
param: {
|
param: {
|
||||||
@ -220,8 +225,18 @@ const open = (tradeType: string, tradeId: number, payReturn: string = '', scene:
|
|||||||
}
|
}
|
||||||
|
|
||||||
const emits = defineEmits(['close', 'confirm'])
|
const emits = defineEmits(['close', 'confirm'])
|
||||||
|
|
||||||
const toPayResult = () => {
|
const toPayResult = () => {
|
||||||
emits('confirm')
|
emits('confirm')
|
||||||
|
// console.log(prop.reformat)
|
||||||
|
if(prop.reformat){
|
||||||
|
redirect({
|
||||||
|
url: prop.reformat,
|
||||||
|
mode: 'redirectTo'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
redirect({
|
redirect({
|
||||||
url: '/app/pages/pay/result',
|
url: '/app/pages/pay/result',
|
||||||
param: { trade_type: payInfo.value?.trade_type, trade_id: payInfo.value?.trade_id },
|
param: { trade_type: payInfo.value?.trade_type, trade_id: payInfo.value?.trade_id },
|
||||||
@ -237,7 +252,8 @@ const handleClose = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open,
|
||||||
|
payInfo
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
<view class="share-footer" @click="sharePopupClose">
|
<view class="share-footer" @click="sharePopupClose">
|
||||||
<text>取消分享</text>
|
<text class="text-[#333]">取消分享</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@ -45,6 +45,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { img, copy } from '@/utils/common';
|
import { img, copy } from '@/utils/common';
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
copyUrl: { // 例 "/wap/addon/shop_fenxiao/pages/goods"
|
copyUrl: { // 例 "/wap/addon/shop_fenxiao/pages/goods"
|
||||||
@ -93,12 +94,10 @@ const closeDialog = () => {
|
|||||||
|
|
||||||
const shareTop: any = ref(0)
|
const shareTop: any = ref(0)
|
||||||
/************ 获取微信头部-start ****************/
|
/************ 获取微信头部-start ****************/
|
||||||
// 获取系统状态栏的高度
|
const systemStore = useSystemStore()
|
||||||
let menuButtonInfo: any = {};
|
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
shareTop.value = systemStore.menuButtonInfo.top + systemStore.menuButtonInfo.height + 'px';
|
||||||
shareTop.value = menuButtonInfo.top + menuButtonInfo.height + 'px';
|
|
||||||
// #endif
|
// #endif
|
||||||
/************ 获取微信头部-end ****************/
|
/************ 获取微信头部-end ****************/
|
||||||
|
|
||||||
|
|||||||
@ -57,6 +57,7 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { img, copy } from '@/utils/common';
|
import { img, copy } from '@/utils/common';
|
||||||
import { getPoster } from '@/app/api/system'
|
import { getPoster } from '@/app/api/system'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
posterId: {
|
posterId: {
|
||||||
@ -200,12 +201,10 @@ const savePoster = () => {
|
|||||||
|
|
||||||
const shareTop: any = ref(0)
|
const shareTop: any = ref(0)
|
||||||
/************ 获取微信头部-start ****************/
|
/************ 获取微信头部-start ****************/
|
||||||
// 获取系统状态栏的高度
|
const systemStore = useSystemStore()
|
||||||
let menuButtonInfo: any = {};
|
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||||
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
shareTop.value = systemStore.menuButtonInfo.top + systemStore.menuButtonInfo.height + 'px';
|
||||||
shareTop.value = menuButtonInfo.top + menuButtonInfo.height + 'px';
|
|
||||||
// #endif
|
// #endif
|
||||||
/************ 获取微信头部-end ****************/
|
/************ 获取微信头部-end ****************/
|
||||||
|
|
||||||
|
|||||||
@ -128,6 +128,16 @@ if (!props.addon) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => useConfigStore().tabbarList,
|
||||||
|
(newValue, oldValue) => {
|
||||||
|
if (newValue && newValue.length) {
|
||||||
|
setTabbar()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
)
|
||||||
|
|
||||||
const value = computed(() => {
|
const value = computed(() => {
|
||||||
let query: any = currShareRoute().params;
|
let query: any = currShareRoute().params;
|
||||||
let str = [];
|
let str = [];
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="ns-navbar-wrap" v-if="diyStore.mode !='decorate' && topStatusBarData" :class="topStatusBarData.style">
|
<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 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="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 class="title-wrap" :style="styleOneFontSize">{{ data.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="topStatusBarData.style == 'style-2'" class="content-wrap" :style="navbarInnerStyle" @click="diyStore.toRedirect(topStatusBarData.link)">
|
<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 class="title-wrap" :style="{ color: topStatusBarData.textColor }">
|
||||||
<view>
|
<view>
|
||||||
<image :src="img(topStatusBarData.imgUrl)" mode="heightFix"/>
|
<image :src="img(topStatusBarData.imgUrl)" mode="heightFix"/>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="topStatusBarData.style == 'style-3'" :style="navbarInnerStyle" class="content-wrap">
|
<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)">
|
<view class="title-wrap" @click="diyStore.toRedirect(topStatusBarData.link)">
|
||||||
<image :src="img(topStatusBarData.imgUrl)" mode="heightFix"/>
|
<image :src="img(topStatusBarData.imgUrl)" mode="heightFix"/>
|
||||||
</view>
|
</view>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="topStatusBarData.style == 'style-4'" :style="navbarInnerStyle" class="content-wrap">
|
<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>
|
<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-if="systemStore.diyAddressInfo">{{ systemStore.diyAddressInfo.community }}</view>
|
||||||
<view class="title-wrap" @click.stop="locationVal.reposition()" :style="{ color: topStatusBarData.textColor }" v-else>{{ systemStore.defaultPositionAddress }}</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 useDiyStore from '@/app/stores/diy';
|
||||||
import { useLocation } from '@/hooks/useLocation'
|
import { useLocation } from '@/hooks/useLocation'
|
||||||
|
|
||||||
// 获取系统状态栏的高度
|
const systemStore = useSystemStore()
|
||||||
let systemInfo = uni.getSystemInfoSync();
|
let platform = systemStore.systemInfo.platform;
|
||||||
let platform = systemInfo.platform;
|
|
||||||
const systemStore = useSystemStore();
|
|
||||||
|
|
||||||
const diyStore = useDiyStore();
|
const diyStore = useDiyStore();
|
||||||
|
|
||||||
@ -90,7 +88,7 @@ const props = defineProps({
|
|||||||
// 控制-定位后是否对导航栏进行填充
|
// 控制-定位后是否对导航栏进行填充
|
||||||
const isFill = computed(() => {
|
const isFill = computed(() => {
|
||||||
let bool = true;
|
let bool = true;
|
||||||
if (imageAdsSameScreen.value) {
|
if (diyStore.imageAdsSameScreen) {
|
||||||
bool = false;
|
bool = false;
|
||||||
} else {
|
} else {
|
||||||
bool = props.isFill;
|
bool = props.isFill;
|
||||||
@ -109,7 +107,6 @@ const topStatusBarData = computed(() => {
|
|||||||
// 导航栏内部盒子的样式
|
// 导航栏内部盒子的样式
|
||||||
const navbarInnerStyle = computed(() => {
|
const navbarInnerStyle = computed(() => {
|
||||||
let style = '';
|
let style = '';
|
||||||
|
|
||||||
if (props.isBack) {
|
if (props.isBack) {
|
||||||
style += 'padding-left: 30rpx;';//30=>右边留边 44=>箭头宽度 10=>箭头的右maring
|
style += 'padding-left: 30rpx;';//30=>右边留边 44=>箭头宽度 10=>箭头的右maring
|
||||||
if (topStatusBarData.value.style == 'style-1') //样式一需要居中需要有右边padding辅助
|
if (topStatusBarData.value.style == 'style-1') //样式一需要居中需要有右边padding辅助
|
||||||
@ -188,34 +185,18 @@ if (componentsScrollVal) {
|
|||||||
/******************************* 存储滚动值-end ***********************/
|
/******************************* 存储滚动值-end ***********************/
|
||||||
|
|
||||||
/******************************* 返回按钮-start ***********************/
|
/******************************* 返回按钮-start ***********************/
|
||||||
// const isBackShow = ref(false);
|
|
||||||
let pages = getCurrentPages();
|
let pages = getCurrentPages();
|
||||||
|
const isBackShow = computed(() => {
|
||||||
|
let bool = false;
|
||||||
|
if (props.isBack && pages.length > 1) {
|
||||||
|
bool = true;
|
||||||
|
}
|
||||||
|
return bool;
|
||||||
|
})
|
||||||
|
|
||||||
// 返回按钮的函数
|
// 返回按钮的函数
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
// 兼容小程序,未登录状态下点击某个功能跳转到登录页,不登录无法返回的情况
|
if(!isBackShow.value) return;
|
||||||
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' });
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
||||||
if (typeof props.customBack === 'function') {
|
if (typeof props.customBack === 'function') {
|
||||||
props.customBack();
|
props.customBack();
|
||||||
@ -223,7 +204,6 @@ const goBack = () => {
|
|||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/******************************* 返回按钮-end ***********************/
|
/******************************* 返回按钮-end ***********************/
|
||||||
|
|
||||||
// 微信胶囊宽度+right
|
// 微信胶囊宽度+right
|
||||||
@ -238,12 +218,14 @@ const instance = getCurrentInstance();
|
|||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
let statusBarHeight = systemStore.menuButtonInfo.height + systemStore.menuButtonInfo.top + 8;
|
let statusBarHeight = systemStore.menuButtonInfo.height + systemStore.menuButtonInfo.top + 8;
|
||||||
placeholderHeight.value = statusBarHeight || 0;
|
placeholderHeight.value = statusBarHeight || 0;
|
||||||
|
systemStore.setTopTabbar({ height: placeholderHeight.value })
|
||||||
// #endif
|
// #endif
|
||||||
const navbarPlaceholderHeight = () => {
|
const navbarPlaceholderHeight = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const query = uni.createSelectorQuery().in(instance);
|
const query = uni.createSelectorQuery().in(instance);
|
||||||
query.select('.ns-navbar-wrap .u-navbar .content-wrap').boundingClientRect(data => {
|
query.select('.ns-navbar-wrap .u-navbar .content-wrap').boundingClientRect(data => {
|
||||||
placeholderHeight.value = data ? data.height : 0;
|
placeholderHeight.value = data ? data.height : 0;
|
||||||
|
systemStore.setTopTabbar({ height: placeholderHeight.value })
|
||||||
diyStore.$patch((state) => {
|
diyStore.$patch((state) => {
|
||||||
state.topTabarHeight = placeholderHeight.value
|
state.topTabarHeight = placeholderHeight.value
|
||||||
})
|
})
|
||||||
@ -261,20 +243,10 @@ const locationVal = useLocation(isOpenLocation);
|
|||||||
locationVal.onLoad();
|
locationVal.onLoad();
|
||||||
locationVal.init();
|
locationVal.init();
|
||||||
/************** 定位-end ****************/
|
/************** 定位-end ****************/
|
||||||
let imageAdsSameScreen = ref(false);
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
navbarPlaceholderHeight();
|
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();
|
locationVal.refresh();
|
||||||
|
|
||||||
// 图文导航开启沉浸式且导航栏开启时,导航栏不占位
|
|
||||||
imageAdsSameScreen.value = uni.getStorageSync('imageAdsSameScreen') || false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 页面onShow调用时,也会触发改方法
|
// 页面onShow调用时,也会触发改方法
|
||||||
@ -387,8 +359,8 @@ defineExpose({
|
|||||||
&.style-3 {
|
&.style-3 {
|
||||||
.content-wrap {
|
.content-wrap {
|
||||||
.title-wrap {
|
.title-wrap {
|
||||||
height: 60rpx;
|
height: 46rpx;
|
||||||
max-width: 170rpx;
|
max-width: 300rpx;
|
||||||
flex: initial;
|
flex: initial;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
|
|||||||
@ -65,12 +65,12 @@ const props = defineProps({
|
|||||||
// 骨架的背景色
|
// 骨架的背景色
|
||||||
bgColor: {
|
bgColor: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '' // #EAEDF5
|
default: '#EAEDF5' // #EAEDF5
|
||||||
},
|
},
|
||||||
// 骨架的动画高亮背景色
|
// 骨架的动画高亮背景色
|
||||||
highlightBgColor: {
|
highlightBgColor: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '' // #F9FAFF
|
default: '#F9FAFF' // #F9FAFF
|
||||||
},
|
},
|
||||||
// 自定义配置
|
// 自定义配置
|
||||||
config: {
|
config: {
|
||||||
@ -220,7 +220,9 @@ const addUnit = (value = 'auto', unit = 'px') => {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@mixin background {
|
@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%;
|
background-size: 400% 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +263,8 @@ const addUnit = (value = 'auto', unit = 'px') => {
|
|||||||
|
|
||||||
.fade-out {
|
.fade-out {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
animation: fadeOutAnim var(--fadeOutTime);
|
//animation: fadeOutAnim var(--fadeOutTime);
|
||||||
|
animation: fadeOutAnim 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fadeOutAnim {
|
@keyframes fadeOutAnim {
|
||||||
@ -274,7 +277,8 @@ const addUnit = (value = 'auto', unit = 'px') => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.animate {
|
.animate {
|
||||||
animation: skeletonAnim var(--animateTime) ease infinite;
|
//animation: skeletonAnim var(--animateTime) ease infinite;
|
||||||
|
animation: skeletonAnim 1.8s ease infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes skeletonAnim {
|
@keyframes skeletonAnim {
|
||||||
|
|||||||
@ -38,12 +38,12 @@ export function useDiy(params: any = {}) {
|
|||||||
const isShowTopTabbar = ref(false);
|
const isShowTopTabbar = ref(false);
|
||||||
|
|
||||||
const pageStyle = () => {
|
const pageStyle = () => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (data.value.global.pageStartBgColor) {
|
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 });`;
|
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 + ';';
|
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);';
|
style += 'min-height:calc(100vh - 50px);';
|
||||||
} else {
|
} else {
|
||||||
style += 'min-height:calc(100vh);';
|
style += 'min-height:calc(100vh);';
|
||||||
@ -123,6 +123,7 @@ export function useDiy(params: any = {}) {
|
|||||||
diyData.value = sources.value;
|
diyData.value = sources.value;
|
||||||
diyData.value.forEach((item: any, index) => {
|
diyData.value.forEach((item: any, index) => {
|
||||||
item.pageStyle = '';
|
item.pageStyle = '';
|
||||||
|
item.componentIsShow = true // 是否显示
|
||||||
if (item.pageStartBgColor) {
|
if (item.pageStartBgColor) {
|
||||||
if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${ item.pageGradientAngle },${ item.pageStartBgColor },${ item.pageEndBgColor });`;
|
if (item.pageStartBgColor && item.pageEndBgColor) item.pageStyle += `background:linear-gradient(${ item.pageGradientAngle },${ item.pageStartBgColor },${ item.pageEndBgColor });`;
|
||||||
else item.pageStyle += 'background-color:' + item.pageStartBgColor + ';';
|
else item.pageStyle += 'background-color:' + item.pageStartBgColor + ';';
|
||||||
@ -201,6 +202,7 @@ export function useDiy(params: any = {}) {
|
|||||||
if (e.scrollTop > 0) {
|
if (e.scrollTop > 0) {
|
||||||
diyStore.scrollTop = e.scrollTop;
|
diyStore.scrollTop = e.scrollTop;
|
||||||
}
|
}
|
||||||
|
uni.$emit('scroll')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,12 +41,12 @@ export function useDiyForm(params: any = {}) {
|
|||||||
const isShowTopTabbar = ref(false);
|
const isShowTopTabbar = ref(false);
|
||||||
|
|
||||||
const pageStyle = () => {
|
const pageStyle = () => {
|
||||||
var style = '';
|
let style = '';
|
||||||
if (data.value.global.pageStartBgColor) {
|
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 });`;
|
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 + ';';
|
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);';
|
style += 'min-height:calc(100vh - 50px);';
|
||||||
} else {
|
} else {
|
||||||
style += 'min-height:calc(100vh);';
|
style += 'min-height:calc(100vh);';
|
||||||
@ -146,7 +146,7 @@ export function useDiyForm(params: any = {}) {
|
|||||||
// 匹配缓存,赋值
|
// 匹配缓存,赋值
|
||||||
let diyFormStorage = uni.getStorageSync('diyFormStorage_' + diyStore.id)
|
let diyFormStorage = uni.getStorageSync('diyFormStorage_' + diyStore.id)
|
||||||
if (diyFormStorage) {
|
if (diyFormStorage) {
|
||||||
var date = new Date();
|
const date = new Date();
|
||||||
let currentTime: any = parseInt(date.getTime() / 1000); // 存储信息 5分钟内有效,过期后将重新获取定位信息
|
let currentTime: any = parseInt(date.getTime() / 1000); // 存储信息 5分钟内有效,过期后将重新获取定位信息
|
||||||
if (diyFormStorage.validTime > currentTime) {
|
if (diyFormStorage.validTime > currentTime) {
|
||||||
if (diyFormStorage.components) {
|
if (diyFormStorage.components) {
|
||||||
@ -176,6 +176,7 @@ export function useDiyForm(params: any = {}) {
|
|||||||
diyData.global = sources.global;
|
diyData.global = sources.global;
|
||||||
diyData.value = sources.value;
|
diyData.value = sources.value;
|
||||||
diyData.value.forEach((item: any, index) => {
|
diyData.value.forEach((item: any, index) => {
|
||||||
|
item.componentIsShow = true // 是否显示
|
||||||
if (item.isHidden) {
|
if (item.isHidden) {
|
||||||
// 隐藏组件
|
// 隐藏组件
|
||||||
diyData.value.splice(index, 1)
|
diyData.value.splice(index, 1)
|
||||||
|
|||||||
@ -184,7 +184,7 @@ export function useLocation(isOpenLocation: any) {
|
|||||||
const locationStorage = () => {
|
const locationStorage = () => {
|
||||||
let data = uni.getStorageSync('location_address');
|
let data = uni.getStorageSync('location_address');
|
||||||
if (data) {
|
if (data) {
|
||||||
var date = new Date();
|
const date = new Date();
|
||||||
if (systemStore.mapConfig.valid_time > 0) {
|
if (systemStore.mapConfig.valid_time > 0) {
|
||||||
data.is_expired = (date.getTime() / 1000) > data.valid_time; // 是否过期
|
data.is_expired = (date.getTime() / 1000) > data.valid_time; // 是否过期
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
updateWeappOpenid,
|
updateWeappOpenid,
|
||||||
updateWechatOpenid,
|
updateWechatOpenid,
|
||||||
wechatUser,
|
wechatUser,
|
||||||
wechatUserLogin
|
wechatUserLogin, updateWechatOpenidByH5
|
||||||
} from '@/app/api/auth'
|
} from '@/app/api/auth'
|
||||||
import { getWechatAuthCode } from '@/app/api/system'
|
import { getWechatAuthCode } from '@/app/api/system'
|
||||||
import useMemberStore from '@/stores/member'
|
import useMemberStore from '@/stores/member'
|
||||||
@ -37,11 +37,11 @@ export function useLogin() {
|
|||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
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) {
|
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||||
} else {
|
} else {
|
||||||
redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
|
redirect({ url: '/app/pages/auth/index' })
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
@ -49,20 +49,20 @@ export function useLogin() {
|
|||||||
if (isWeixinBrowser()) {
|
if (isWeixinBrowser()) {
|
||||||
// 微信浏览器
|
// 微信浏览器
|
||||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
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) {
|
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||||
} else {
|
} else {
|
||||||
redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
|
redirect({ url: '/app/pages/auth/index' })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 普通浏览器
|
// 普通浏览器
|
||||||
if (config.login.is_username && !config.login.is_mobile) {
|
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) {
|
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile) {
|
||||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||||
} else {
|
} else {
|
||||||
redirect({ url: '/app/pages/auth/index', mode: 'redirectTo' })
|
redirect({ url: '/app/pages/auth/index' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@ -192,8 +192,12 @@ export function useLogin() {
|
|||||||
// 强制获取昵称和头像,先存储起来
|
// 强制获取昵称和头像,先存储起来
|
||||||
uni.setStorageSync('openid', res.data.openid)
|
uni.setStorageSync('openid', res.data.openid)
|
||||||
uni.setStorageSync('unionid', res.data.unionid)
|
uni.setStorageSync('unionid', res.data.unionid)
|
||||||
if (res.data.nickname) uni.setStorageSync('nickname', res.data.nickname)
|
if(res.data.nickname){
|
||||||
if (res.data.avatar) uni.setStorageSync('avatar', res.data.avatar)
|
uni.setStorageSync('nickname', res.data.nickname)
|
||||||
|
}
|
||||||
|
if(res.data.avatar){
|
||||||
|
uni.setStorageSync('avatar', res.data.avatar)
|
||||||
|
}
|
||||||
|
|
||||||
// 开启绑定手机号标识
|
// 开启绑定手机号标识
|
||||||
if (uni.getStorageSync('isBindMobile')) {
|
if (uni.getStorageSync('isBindMobile')) {
|
||||||
@ -317,12 +321,16 @@ export function useLogin() {
|
|||||||
query.code && (delete query.code)
|
query.code && (delete query.code)
|
||||||
Object.keys(query).length && (url += uni.$u.queryParams(query))
|
Object.keys(query).length && (url += uni.$u.queryParams(query))
|
||||||
}
|
}
|
||||||
|
// // 强制授权加强制绑定手机号定义URL
|
||||||
|
// if(uni.getStorageSync('mandatory_Mobile')){
|
||||||
|
// url = `${ location.origin }${ location.pathname }`
|
||||||
|
// }
|
||||||
getWechatAuthCode({
|
getWechatAuthCode({
|
||||||
url,
|
url,
|
||||||
scopes: params.scopes
|
scopes: params.scopes
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
uni.setStorageSync('wechat_login_back', true) // 微信公众号手动授权登录回调标识
|
uni.setStorageSync('wechat_login_back', true) // 微信公众号手动授权登录回调标识
|
||||||
|
// uni.setStorageSync('mandatory_Mobile', true) // 微信授权登录+强制绑定手机号标识
|
||||||
// location.replace(res.data.url);
|
// location.replace(res.data.url);
|
||||||
location.href = res.data.url
|
location.href = res.data.url
|
||||||
})
|
})
|
||||||
@ -330,11 +338,20 @@ export function useLogin() {
|
|||||||
// #endif
|
// #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 {
|
return {
|
||||||
setLoginBack,
|
setLoginBack,
|
||||||
handleLoginBack,
|
handleLoginBack,
|
||||||
authLogin,
|
authLogin,
|
||||||
updateOpenid,
|
updateOpenid,
|
||||||
getAuthCode
|
getAuthCode,
|
||||||
|
updateWechatOpenidForH5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,8 +8,8 @@ import wechat from '@/utils/wechat'
|
|||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
export const useShare = () => {
|
export const useShare = () => {
|
||||||
var wechatOptions: any = {};
|
let wechatOptions: any = {};
|
||||||
var weappOptions: any = {};
|
let weappOptions: any = {};
|
||||||
|
|
||||||
const wechatInit = () => {
|
const wechatInit = () => {
|
||||||
if (!isWeixinBrowser()) return;
|
if (!isWeixinBrowser()) return;
|
||||||
@ -60,7 +60,6 @@ export const useShare = () => {
|
|||||||
query: queryStr.join('&'),
|
query: queryStr.join('&'),
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
if (options && Object.keys(options).length) {
|
if (options && Object.keys(options).length) {
|
||||||
|
|
||||||
if (options.wechat) {
|
if (options.wechat) {
|
||||||
@ -88,7 +87,7 @@ export const useShare = () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
}
|
||||||
getShareInfo({
|
getShareInfo({
|
||||||
route: '/' + currRoute(),
|
route: '/' + currRoute(),
|
||||||
params: JSON.stringify(currShareRoute().params)
|
params: JSON.stringify(currShareRoute().params)
|
||||||
@ -116,11 +115,12 @@ export const useShare = () => {
|
|||||||
weappOptions.imageUrl = weapp.url ? img(weapp.url) : ''
|
weappOptions.imageUrl = weapp.url ? img(weapp.url) : ''
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
if(!weappOptions.title && !weappOptions.imageUrl){
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.setStorageSync('weappOptions', weappOptions)
|
uni.setStorageSync('weappOptions', weappOptions)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 小程序分享,分享给好友
|
// 小程序分享,分享给好友
|
||||||
const shareApp = (options = {}) => {
|
const shareApp = (options = {}) => {
|
||||||
|
|||||||
@ -14,6 +14,7 @@ class Language {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param locale 设置语言
|
* @param locale 设置语言
|
||||||
|
* @param path
|
||||||
*/
|
*/
|
||||||
public setI18nLanguage(locale: string, path: string = '') {
|
public setI18nLanguage(locale: string, path: string = '') {
|
||||||
if (this.i18n.global.locale == locale) return
|
if (this.i18n.global.locale == locale) return
|
||||||
|
|||||||
@ -42,140 +42,5 @@
|
|||||||
"pages.verify.record": "核销记录",
|
"pages.verify.record": "核销记录",
|
||||||
"pages.friendspay.share": "找朋友帮忙付",
|
"pages.friendspay.share": "找朋友帮忙付",
|
||||||
"pages.friendspay.money": "",
|
"pages.friendspay.money": "",
|
||||||
"pages.webview.index": "",
|
"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": "商品列表"
|
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "",
|
"name" : "",
|
||||||
"appid" : "__UNI__ED923AB",
|
"appid" : "__UNI__9B03DBD",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { getConfig } from '@/app/api/auth'
|
import { getConfig } from '@/app/api/auth'
|
||||||
import { isWeixinBrowser } from "@/utils/common";
|
import { isWeixinBrowser } from "@/utils/common";
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
interface loginConfig {
|
interface loginConfig {
|
||||||
is_username: number | boolean,
|
is_username: number | boolean,
|
||||||
@ -54,7 +55,8 @@ const useConfigStore = defineStore('config', {
|
|||||||
let url = '';
|
let url = '';
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (isWeixinBrowser()) {
|
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
|
// #endif
|
||||||
await getConfig({ url }).then((res: any) => {
|
await getConfig({ url }).then((res: any) => {
|
||||||
|
|||||||
@ -46,6 +46,16 @@ const useMemberStore = defineStore('member', {
|
|||||||
}
|
}
|
||||||
// #endif
|
// #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();
|
if (callback) callback();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.logout()
|
this.logout()
|
||||||
@ -69,6 +79,10 @@ const useMemberStore = defineStore('member', {
|
|||||||
uni.removeStorageSync('isBindMobile');
|
uni.removeStorageSync('isBindMobile');
|
||||||
uni.removeStorageSync('nickname');
|
uni.removeStorageSync('nickname');
|
||||||
uni.removeStorageSync('avatar');
|
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' })
|
isRedirect && redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||||
}
|
}
|
||||||
logout().then(() => {
|
logout().then(() => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
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 useConfigStore from '@/stores/config'
|
||||||
import useMemberStore from '@/stores/member'
|
import useMemberStore from '@/stores/member'
|
||||||
import { isWeixinBrowser } from '@/utils/common'
|
import { isWeixinBrowser } from '@/utils/common'
|
||||||
@ -20,7 +20,11 @@ interface System {
|
|||||||
path: string,
|
path: string,
|
||||||
query: object
|
query: object
|
||||||
},
|
},
|
||||||
isAddCartRecommend: boolean // 是否添加购物车推荐
|
systemInfo: any, // 系统设备信息
|
||||||
|
topTabbarInfo: {
|
||||||
|
height: number
|
||||||
|
fullHeight: string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const useSystemStore = defineStore('system', {
|
const useSystemStore = defineStore('system', {
|
||||||
@ -36,10 +40,10 @@ const useSystemStore = defineStore('system', {
|
|||||||
},
|
},
|
||||||
initStatus: 'wait',
|
initStatus: 'wait',
|
||||||
menuButtonInfo: {
|
menuButtonInfo: {
|
||||||
height: '',
|
height: 0,
|
||||||
top: '',
|
top: 0,
|
||||||
right: '',
|
right: 0,
|
||||||
width: ''
|
width: 0
|
||||||
},
|
},
|
||||||
shareCallback: null,
|
shareCallback: null,
|
||||||
defaultPositionAddress: '定位中',
|
defaultPositionAddress: '定位中',
|
||||||
@ -48,7 +52,11 @@ const useSystemStore = defineStore('system', {
|
|||||||
path: '',
|
path: '',
|
||||||
query: {}
|
query: {}
|
||||||
},
|
},
|
||||||
isAddCartRecommend: false
|
systemInfo: null,
|
||||||
|
topTabbarInfo: {
|
||||||
|
height: 0,
|
||||||
|
fullHeight: ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -58,7 +66,7 @@ const useSystemStore = defineStore('system', {
|
|||||||
let url = '';
|
let url = '';
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (isWeixinBrowser()) {
|
if (isWeixinBrowser()) {
|
||||||
url = uni.getSystemInfoSync().platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
url = this.systemInfo.platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
@ -68,7 +76,6 @@ const useSystemStore = defineStore('system', {
|
|||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
|
|
||||||
// 底部导航
|
// 底部导航
|
||||||
const configStore = useConfigStore()
|
const configStore = useConfigStore()
|
||||||
configStore.tabbarList = data.tabbar_list;
|
configStore.tabbarList = data.tabbar_list;
|
||||||
@ -108,6 +115,7 @@ const useSystemStore = defineStore('system', {
|
|||||||
// 如果会员已存在则小程序端快捷登录时不再弹出授权弹框
|
// 如果会员已存在则小程序端快捷登录时不再弹出授权弹框
|
||||||
uni.setStorageSync('member_exist', data.member_exist)
|
uni.setStorageSync('member_exist', data.member_exist)
|
||||||
|
|
||||||
|
|
||||||
this.initStatus = 'finish'; // 初始化完成
|
this.initStatus = 'finish'; // 初始化完成
|
||||||
|
|
||||||
if (uni.getStorageSync('isBindMobile')) {
|
if (uni.getStorageSync('isBindMobile')) {
|
||||||
@ -119,6 +127,14 @@ const useSystemStore = defineStore('system', {
|
|||||||
|
|
||||||
this.getMenuButtonInfoFn();
|
this.getMenuButtonInfoFn();
|
||||||
},
|
},
|
||||||
|
// 如果已有手机号,就不弹出绑定手机号弹框
|
||||||
|
getMemberMobileExistFn() {
|
||||||
|
getMemberMobileExist({
|
||||||
|
openid: uni.getStorageSync('openid')
|
||||||
|
}).then((res: any) => {
|
||||||
|
uni.setStorageSync('member_mobile_exist', res.data.member_mobile_exist)
|
||||||
|
})
|
||||||
|
},
|
||||||
getMenuButtonInfoFn() {
|
getMenuButtonInfoFn() {
|
||||||
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
|
||||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
|
||||||
@ -139,7 +155,7 @@ const useSystemStore = defineStore('system', {
|
|||||||
setAddressInfo(data: any = {}) {
|
setAddressInfo(data: any = {}) {
|
||||||
let addressInfo = cloneDeep(data);
|
let addressInfo = cloneDeep(data);
|
||||||
// 过期时间
|
// 过期时间
|
||||||
var date = new Date();
|
const date = new Date();
|
||||||
date.setSeconds(60 * this.mapConfig.valid_time);
|
date.setSeconds(60 * this.mapConfig.valid_time);
|
||||||
addressInfo.valid_time = date.getTime() / 1000; // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
addressInfo.valid_time = date.getTime() / 1000; // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||||
|
|
||||||
@ -154,6 +170,11 @@ const useSystemStore = defineStore('system', {
|
|||||||
} else {
|
} else {
|
||||||
uni.removeStorageSync('location_address');
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 3952239 */
|
font-family: "iconfont"; /* Project id 3952239 */
|
||||||
src: url('//at.alicdn.com/t/c/font_3952239_w9mu2hnz4eg.woff2?t=1731396621845') format('woff2'),
|
src: url('//at.alicdn.com/t/c/font_3952239_t8hxcgv9kup.woff2?t=1752303861239') format('woff2'),
|
||||||
url('//at.alicdn.com/t/c/font_3952239_w9mu2hnz4eg.woff?t=1731396621845') format('woff'),
|
url('//at.alicdn.com/t/c/font_3952239_t8hxcgv9kup.woff?t=1752303861239') format('woff'),
|
||||||
url('//at.alicdn.com/t/c/font_3952239_w9mu2hnz4eg.ttf?t=1731396621845') format('truetype');
|
url('//at.alicdn.com/t/c/font_3952239_t8hxcgv9kup.ttf?t=1752303861239') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
@ -13,6 +13,62 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.iconjishibenV6xx:before {
|
||||||
|
content: "\e6fa";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconweixinV6mm1:before {
|
||||||
|
content: "\e8b0";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconshouji6Vmm:before {
|
||||||
|
content: "\e8b1";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconmima6Vmm:before {
|
||||||
|
content: "\e8b3";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconxianshiV6mm:before {
|
||||||
|
content: "\e8ac";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconqianV6xx:before {
|
||||||
|
content: "\e79d";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconshouyev6mm:before {
|
||||||
|
content: "\e879";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconweixinV6mm:before {
|
||||||
|
content: "\e6d6";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icondianhua1:before {
|
||||||
|
content: "\e6b9";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconmofang-yizuoliangyou:before {
|
||||||
|
content: "\e6c7";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfenleiV6mm:before {
|
||||||
|
content: "\e66c";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icondaifahuoV6mm:before {
|
||||||
|
content: "\e69d";
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconzhixiang-youjiantouV6xx:before {
|
||||||
|
content: "\e649";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icona-gengduoV6xx-28:before {
|
||||||
|
content: "\e851";
|
||||||
|
}
|
||||||
|
|
||||||
.icona-paihangbangpc30:before {
|
.icona-paihangbangpc30:before {
|
||||||
content: "\e83a";
|
content: "\e83a";
|
||||||
}
|
}
|
||||||
@ -1140,3 +1196,4 @@
|
|||||||
.iconshouye-zhihui:before {
|
.iconshouye-zhihui:before {
|
||||||
content: "\e61d";
|
content: "\e61d";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "nc-iconfont"; /* Project id 4567203 */
|
font-family: "nc-iconfont"; /* Project id 4567203 */
|
||||||
src: url('//at.alicdn.com/t/c/font_4567203_90bek9j2oeh.woff2?t=1750242885299') format('woff2'),
|
src: url('//at.alicdn.com/t/c/font_4567203_r3nkqy7l1w.woff2?t=1750327830437') format('woff2'),
|
||||||
url('//at.alicdn.com/t/c/font_4567203_90bek9j2oeh.woff?t=1750242885299') format('woff'),
|
url('//at.alicdn.com/t/c/font_4567203_r3nkqy7l1w.woff?t=1750327830437') format('woff'),
|
||||||
url('//at.alicdn.com/t/c/font_4567203_90bek9j2oeh.ttf?t=1750242885299') format('truetype');
|
url('//at.alicdn.com/t/c/font_4567203_r3nkqy7l1w.ttf?t=1750327830437') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.nc-iconfont {
|
.nc-iconfont {
|
||||||
@ -13,6 +13,10 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nc-icon-xiaochengxu:before {
|
||||||
|
content: "\e8a8";
|
||||||
|
}
|
||||||
|
|
||||||
.nc-icon-qianV6xx:before {
|
.nc-icon-qianV6xx:before {
|
||||||
content: "\e784";
|
content: "\e784";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,2 +1 @@
|
|||||||
[
|
[]
|
||||||
]
|
|
||||||
@ -134,6 +134,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* ref 触发 动画分组
|
* ref 触发 动画分组
|
||||||
* @param {Object} obj
|
* @param {Object} obj
|
||||||
|
* @param config
|
||||||
*/
|
*/
|
||||||
step(obj, config = {}) {
|
step(obj, config = {}) {
|
||||||
if (!this.animation) return
|
if (!this.animation) return
|
||||||
|
|||||||
@ -26,14 +26,12 @@ export const redirect = (redirect: any) => {
|
|||||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||||
url = '/app/pages/auth/login'
|
url = '/app/pages/auth/login'
|
||||||
param = { type: 'username' }
|
param = { type: 'username' }
|
||||||
mode = 'redirectTo'
|
|
||||||
newLogin = true
|
newLogin = true
|
||||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
url = '/app/pages/auth/index'
|
url = '/app/pages/auth/index'
|
||||||
mode = 'redirectTo'
|
|
||||||
newLogin = true
|
newLogin = true
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@ -44,14 +42,12 @@ export const redirect = (redirect: any) => {
|
|||||||
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
if (config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||||
url = '/app/pages/auth/login'
|
url = '/app/pages/auth/login'
|
||||||
param = { type: 'username' }
|
param = { type: 'username' }
|
||||||
mode = 'redirectTo'
|
|
||||||
newLogin = true
|
newLogin = true
|
||||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
|
||||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
url = '/app/pages/auth/index'
|
url = '/app/pages/auth/index'
|
||||||
mode = 'redirectTo'
|
|
||||||
newLogin = true
|
newLogin = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -59,14 +55,12 @@ export const redirect = (redirect: any) => {
|
|||||||
if (config.login.is_username && !config.login.is_mobile) {
|
if (config.login.is_username && !config.login.is_mobile) {
|
||||||
url = '/app/pages/auth/login'
|
url = '/app/pages/auth/login'
|
||||||
param = { type: 'username' }
|
param = { type: 'username' }
|
||||||
mode = 'redirectTo'
|
|
||||||
newLogin = true
|
newLogin = true
|
||||||
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile) {
|
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile) {
|
||||||
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
url = '/app/pages/auth/index'
|
url = '/app/pages/auth/index'
|
||||||
mode = 'redirectTo'
|
|
||||||
newLogin = true
|
newLogin = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -375,17 +369,17 @@ export function getSiteId(siteId: number | string) {
|
|||||||
*/
|
*/
|
||||||
export function timeStampTurnTime(timeStamp: any, type = "") {
|
export function timeStampTurnTime(timeStamp: any, type = "") {
|
||||||
if (timeStamp != undefined && timeStamp != "" && timeStamp > 0) {
|
if (timeStamp != undefined && timeStamp != "" && timeStamp > 0) {
|
||||||
var date = new Date();
|
const date = new Date();
|
||||||
date.setTime(timeStamp * 1000);
|
date.setTime(timeStamp * 1000);
|
||||||
var y = date.getFullYear();
|
const y = date.getFullYear();
|
||||||
var m: any = date.getMonth() + 1;
|
let m: any = date.getMonth() + 1;
|
||||||
m = m < 10 ? ('0' + m) : m;
|
m = m < 10 ? ('0' + m) : m;
|
||||||
var d: any = date.getDate();
|
let d: any = date.getDate();
|
||||||
d = d < 10 ? ('0' + d) : d;
|
d = d < 10 ? ('0' + d) : d;
|
||||||
var h: any = date.getHours();
|
let h: any = date.getHours();
|
||||||
h = h < 10 ? ('0' + h) : h;
|
h = h < 10 ? ('0' + h) : h;
|
||||||
var minute: any = date.getMinutes();
|
let minute: any = date.getMinutes();
|
||||||
var second: any = date.getSeconds();
|
let second: any = date.getSeconds();
|
||||||
minute = minute < 10 ? ('0' + minute) : minute;
|
minute = minute < 10 ? ('0' + minute) : minute;
|
||||||
second = second < 10 ? ('0' + second) : second;
|
second = second < 10 ? ('0' + second) : second;
|
||||||
if (type) {
|
if (type) {
|
||||||
@ -404,7 +398,7 @@ export function timeStampTurnTime(timeStamp: any, type = "") {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期格式转时间戳
|
* 日期格式转时间戳
|
||||||
* @param {Object} date
|
* @param dateStr
|
||||||
*/
|
*/
|
||||||
export function timeTurnTimeStamp(dateStr: string) {
|
export function timeTurnTimeStamp(dateStr: string) {
|
||||||
let timestamp;
|
let timestamp;
|
||||||
@ -461,7 +455,7 @@ export function timeTurnTimeStamp(dateStr: string) {
|
|||||||
*/
|
*/
|
||||||
export function copy(value: any, callback: any) {
|
export function copy(value: any, callback: any) {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
var oInput = document.createElement('input'); //创建一个隐藏input(重要!)
|
const oInput = document.createElement('input'); //创建一个隐藏input(重要!)
|
||||||
oInput.value = value; //赋值
|
oInput.value = value; //赋值
|
||||||
oInput.setAttribute("readonly", "readonly");
|
oInput.setAttribute("readonly", "readonly");
|
||||||
document.body.appendChild(oInput);
|
document.body.appendChild(oInput);
|
||||||
@ -511,7 +505,7 @@ export function handleOnloadParams(option: any) {
|
|||||||
|
|
||||||
// 处理小程序扫码进入的场景值参数
|
// 处理小程序扫码进入的场景值参数
|
||||||
if (option.scene) {
|
if (option.scene) {
|
||||||
var sceneParams = decodeURIComponent(option.scene).split('&');
|
const sceneParams = decodeURIComponent(option.scene).split('&');
|
||||||
if (sceneParams.length) {
|
if (sceneParams.length) {
|
||||||
sceneParams.forEach(item => {
|
sceneParams.forEach(item => {
|
||||||
let arr = item.split('-');
|
let arr = item.split('-');
|
||||||
@ -577,7 +571,8 @@ const isArray = (value: any) => {
|
|||||||
|
|
||||||
// px转rpx
|
// px转rpx
|
||||||
export function pxToRpx(px: any) {
|
export function pxToRpx(px: any) {
|
||||||
const screenWidth = uni.getSystemInfoSync().screenWidth;
|
const systemStore = useSystemStore()
|
||||||
|
const screenWidth = systemStore.systemInfo.screenWidth;
|
||||||
return (750 * Number.parseInt(px)) / screenWidth;
|
return (750 * Number.parseInt(px)) / screenWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,7 +618,7 @@ export function getWinxinOpenId() {
|
|||||||
|
|
||||||
// 获取有效期
|
// 获取有效期
|
||||||
export function getValidTime(minutes: any = 1) {
|
export function getValidTime(minutes: any = 1) {
|
||||||
var date = new Date();
|
const date = new Date();
|
||||||
date.setSeconds(60 * minutes);
|
date.setSeconds(60 * minutes);
|
||||||
let validTime: any = parseInt(date.getTime() / 1000); // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
let validTime: any = parseInt(date.getTime() / 1000); // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||||
return validTime;
|
return validTime;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import wx from 'weixin-js-sdk'
|
|||||||
// #endif
|
// #endif
|
||||||
import { getWechatSdkConfig } from '@/app/api/system'
|
import { getWechatSdkConfig } from '@/app/api/system'
|
||||||
import { isWeixinBrowser } from '@/utils/common'
|
import { isWeixinBrowser } from '@/utils/common'
|
||||||
|
import useSystemStore from "@/stores/system";
|
||||||
|
|
||||||
class Wechat {
|
class Wechat {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -12,8 +13,9 @@ class Wechat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public init(callback: any = null) {
|
public init(callback: any = null) {
|
||||||
|
const systemStore = useSystemStore()
|
||||||
getWechatSdkConfig({
|
getWechatSdkConfig({
|
||||||
url: uni.getSystemInfoSync().platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
url: systemStore.systemInfo.platform == 'ios' ? uni.getStorageSync('initUrl') : location.href
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
wx.config({
|
wx.config({
|
||||||
@ -83,6 +85,7 @@ class Wechat {
|
|||||||
/**
|
/**
|
||||||
* 商家转账接口
|
* 商家转账接口
|
||||||
* @param {Object} options 转账参数
|
* @param {Object} options 转账参数
|
||||||
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public transfer(options: any, callback: any) {
|
public transfer(options: any, callback: any) {
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user