This commit is contained in:
全栈小学生 2025-05-30 09:50:14 +08:00
parent 568269b6a7
commit 680441cecc
19 changed files with 389 additions and 77 deletions

View File

@ -254,7 +254,7 @@ const refresh = () => {
handleData()
const query = uni.createSelectorQuery().in(instance);
query.select('.diy-graphic-nav').boundingClientRect((data: any) => {
height.value = data.height;
if(data) height.value = data.height;
}).exec();
})
}

View File

@ -1,33 +1,33 @@
{
"cashOutNow": "立即提现",
"balanceDetail": "余额明细",
"cashOutTo": "提现到",
"cashOutTypePlaceholder": "请选择提现方式",
"wechatpay": "微信默认钱包",
"cashOutMoneyTip": "提现金额",
"money": "可提现余额",
"allTx": "全部提现",
"minWithdrawal": "最小提现金额为",
"commissionTo": "手续费为",
"cashOutList": "提现记录",
"cashOutToWechat": "提现至微信零钱",
"cashOutToWechatTips": "提现至微信零钱",
"cashOutToAlipay": "提现至支付宝",
"cashOutToAlipayTips": "请先添加支付宝账号",
"cashOutToBank": "提现至银行卡",
"cashOutToBankTips": "请先添加银行卡",
"cashOutToWechatCode": "提现至微信",
"cashOutToWechatCodeTips": "请先添加微信号",
"alipayAccountNo": "支付宝账号",
"wechatCodeAccountNo": "微信号",
"debitCard": "储蓄卡",
"abnormalOperation": "异常操作",
"noAvailableCashOutType": "没有可用的提现方式",
"applyMoneyPlaceholder": "请输入提现金额",
"moneyformatError": "提现金额格式错误",
"applyMoneyExceed": "提现金额超出可提现金额",
"applyMoneyBelow": "提现金额小于最低提现金额",
"replace": "更换",
"isOpenApply": "提现设置未开启",
"toAdd": "添加"
"cashOutNow": "立即提现",
"balanceDetail": "余额明细",
"cashOutTo": "提现到",
"cashOutTypePlaceholder": "请选择提现方式",
"wechatpay": "微信默认钱包",
"cashOutMoneyTip": "提现金额",
"money": "可提现余额",
"allTx": "全部提现",
"minWithdrawal": "最小提现金额为",
"commissionTo": "手续费为",
"cashOutList": "提现记录",
"cashOutToWechat": "提现至微信零钱",
"cashOutToWechatTips": "提现至微信零钱",
"cashOutToAlipay": "提现至支付宝",
"cashOutToAlipayTips": "请先添加支付宝账号",
"cashOutToBank": "提现至银行卡",
"cashOutToBankTips": "请先添加银行卡",
"cashOutToWechatCode": "提现至微信",
"cashOutToWechatCodeTips": "请先添加微信号",
"alipayAccountNo": "支付宝账号",
"wechatCodeAccountNo": "微信号",
"debitCard": "储蓄卡",
"abnormalOperation": "异常操作",
"noAvailableCashOutType": "没有可用的提现方式",
"applyMoneyPlaceholder": "请输入提现金额",
"moneyformatError": "提现金额格式错误",
"applyMoneyExceed": "提现金额超出可提现金额",
"applyMoneyBelow": "提现金额小于最低提现金额",
"replace": "更换",
"isOpenApply": "提现设置未开启",
"toAdd": "添加"
}

View File

@ -0,0 +1,221 @@
<template>
<view class="w-screen h-screen flex flex-col">
<top-tabbar v-if="navbar" :data="navbar.data" :is-back="false"/>
<view class="hidden">{{ tag }}</view>
<template v-if="tabbar && Object.keys(tabbar).length">
<u-tabbar :value="page" zIndex="9999" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true"
:inactive-color="tabbar.value.textColor" :active-color="tabbar.value.textHoverColor">
<block v-for="item in tabbar.value.list">
<u-tabbar-item class="py-[5rpx]" :style="{'background-color': tabbar.value.backgroundColor}" :text="item.text"
:icon="img(page == item.link.url ? item.iconSelectPath : item.iconPath)" :name="item.link"
v-if="tabbar.value.type == 1" @click="itemBtn(item.link.url)"></u-tabbar-item>
<u-tabbar-item class="py-[5rpx]" :style="{'background-color': tabbar.value.backgroundColor}"
:icon="img(page == item.link.url ? item.iconSelectPath : item.iconPath)" :name="item.link"
v-if="tabbar.value.type == 2" @click="itemBtn(item.link.url)"></u-tabbar-item>
<u-tabbar-item class="py-[5rpx]" :style="{'background-color': tabbar.value.backgroundColor}" :text="item.text" :name="item.link.url"
v-if="tabbar.value.type == 3" @click="itemBtn(item.link.url)"></u-tabbar-item>
</block>
</u-tabbar>
<view class="tab-bar-placeholder"></view>
</template>
</view>
</template>
<script setup lang="ts">
import { ref, reactive, watch, computed } from 'vue'
import { img, redirect, urlDeconstruction } from '@/utils/common'
import { getCustomNavigationPages } from '@/utils/pages'
import useConfigStore from '@/stores/config'
import { cloneDeep } from 'lodash-es'
import useSystemStore from '@/stores/system'
import tabbarJson from '@/tabbar.json'
import zh from '@/locale/zh-Hans.json'
import en from '@/locale/en.json'
import {onPageScroll} from "@dcloudio/uni-app";
import TopTabbar from "@/components/top-tabbar/top-tabbar.vue";
import { language } from '@/locale'
uni.hideTabBar()
const customNavigationPages = getCustomNavigationPages()
const tag = ref(0)
const scrollTop = ref({})
const scrollRecord = ref({})
const systemStore = useSystemStore()
const page = computed(() => {
return systemStore.currTabbar.path
})
const tabbar:any = reactive({})
const addon = computed(() => {
if (systemStore.currTabbar.path) {
let pathArr = systemStore.currTabbar.path.split('/')
let index = !pathArr[0] ? 1 : 0;
let app = pathArr[index] == 'addon' ? pathArr[(index+1)] : 'app';
return app
}
return ''
})
const pagesRefs = ref({})
const navbar = ref(null)
const loadRecord = ref([])
const setTabbar = ()=> {
let list = cloneDeep(useConfigStore().tabbarList);
if (list.length == 1) {
Object.assign(tabbar, list[0]);
} else {
let isExist = false;
for (let i = 0; i < list.length; i++) {
if (list[i].key == addon.value) {
Object.assign(tabbar, list[i]);
isExist = true;
break;
}
}
if (!isExist) {
//
let count = 0;
let singleTabbar = {}
try {
if (list) {
list.forEach((item: any) => {
if (item.info.type == 'app') {
count++;
singleTabbar = item;
}
})
}
if (count == 1) {
Object.assign(tabbar, singleTabbar);
}
} catch (e) {
}
}
}
}
const pagesLoad = () => {
if (systemStore.currTabbar.path) {
if (!loadRecord.value.includes(systemStore.currTabbar.path)) loadRecord.value.push(systemStore.currTabbar.path)
if (pagesRefs.value[systemStore.currTabbar.path] && pagesRefs.value[systemStore.currTabbar.path].$) {
// #ifdef MP
systemStore.currTabbar.path.indexOf('addon') != -1 && language.loadAllLocaleMessages('addon', uni.getLocale())
// #endif
// onshow onload
pagesRefs.value[systemStore.currTabbar.path].$.root.onLoad.forEach(el => {
el(systemStore.currTabbar.query || {})
})
pagesRefs.value[systemStore.currTabbar.path].$.root.onShow.forEach(el => {
el()
})
//
scrollTop.value[systemStore.currTabbar.path] = scrollRecord.value[systemStore.currTabbar.path] || 0
// navbar
// navbar
if (!customNavigationPages[systemStore.currTabbar.path]) {
let key = systemStore.currTabbar.path.replace('/app/', '').replace('/addon/', '').replaceAll('/', '.')
switch (uni.getLocale()) {
case 'zh-Hans':
zh[key] && (key = zh[key])
break;
case 'en':
en[key] && (key = en[key])
break;
}
navbar.value = {
data: {
title: key,
topStatusBar: {
"bgColor": "#ffffff",
"rollBgColor": "#ffffff",
"style": "style-1",
"textColor": "#333333",
"rollTextColor": "#333333",
"textAlign": "center",
"imgUrl": "",
"link": {
"name": ""
}
}
}
}
} else {
navbar.value = null
}
} else {
setTimeout(() => {
tag.value++
pagesLoad()
}, 300)
}
}
}
watch(
() => useConfigStore().tabbarList,
(newValue, oldValue) => {
if (newValue) {
setTabbar()
}
}
, { deep: true, immediate: true }
)
watch(() => addon, (newValue, oldValue) => {
if (newValue) {
setTabbar()
}
},
{ deep: true, immediate: true }
)
const setPagesRefs = (el, key) => {
if (!pagesRefs.value[key]) {
pagesRefs.value[key] = el
}
}
const itemBtn = (url: string)=>{
const route = urlDeconstruction(url)
if (tabbarJson.includes(route.path)) {
useSystemStore().$patch((state) => {
state.currTabbar = route
})
} else {
redirect({ url, mode: 'navigateTo' })
}
}
watch(() => systemStore.currTabbar, (newValue, oldValue) => {
pagesLoad()
}, { deep: true, immediate: true })
const scrollListen = (e: any, key: string) => {
scrollRecord.value[key] = e.detail.scrollTop
try {
pagesRefs.value[systemStore.currTabbar.path].$.root.onPageScroll.forEach(el => {
el(e.detail)
})
} catch (e) {
}
}
</script>
<style lang="scss" scoped>
:deep(.u-tabbar) {
flex: unset!important;
}
</style>

View File

@ -54,7 +54,7 @@
</button>
</view>
</view>
<area-select ref="areaRef" @complete="areaSelectComplete" :area-id="formData.district_id" />
<area-select ref="areaRef" @complete="areaSelectComplete" :area-id="formData.district_id || formData.city_id" />
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<wx-privacy-popup ref="wxPrivacyPopupRef"></wx-privacy-popup>
@ -181,14 +181,14 @@ const selectArea = () => {
}
const areaSelectComplete = (event: any) => {
if (isSelectAddress.value && (formData.value.province_id == event.province.id || formData.value.city_id != event.city.id || formData.value.district_id != event.district.id)) {
if (isSelectAddress.value && (formData.value.province_id == event.province?.id || formData.value.city_id != event.city?.id || formData.value.district_id != event.district?.id)) {
formData.value.lat = '';
formData.value.lng = '';
}
formData.value.province_id = event.province.id || 0
formData.value.city_id = event.city.id || 0
formData.value.district_id = event.district.id || 0
formData.value.area = `${ event.province.name || '' }${ event.city.name || '' }${ event.district.name || '' }`
formData.value.province_id = event.province?.id || 0
formData.value.city_id = event.city?.id || 0
formData.value.district_id = event.district?.id || 0
formData.value.area = `${ event.province?.name || '' }${ event.city?.name || '' }${ event.district?.name || '' }`
isSelectAddress.value = false;
}

View File

@ -3,12 +3,12 @@
<scroll-view :scroll-y="true" class="w-screen h-screen bg-[var(--page-bg-color)]" v-if="!pageLoading && config.is_open == 1">
<view class="sidebar-margin pt-[var(--top-m)]">
<view class="card-template">
<view class="font-500 text-[30rpx] text-[#333] leading-[42rpx]">{{ t('cashOutMoneyTip') }}</view>
<view class="font-500 text-[30rpx] text-[#333] leading-[42rpx]">最小提现金额为</view>
<view class="flex pt-[30rpx] pb-[8rpx] items-center border-0 border-b-[2rpx] border-solid border-[#F1F2F5]">
<text class="pt-[4rpx] text-[44rpx] text-[#333] iconfont iconrenminbiV6xx price-font "></text>
<input type="digit" class="h-[76rpx] leading-[76rpx] pl-[10rpx] flex-1 font-500 text-[54rpx] bg-[#fff]"
v-model="applyData.apply_money" maxlength="7"
:placeholder="applyData.apply_money?'':(t('minWithdrawal') + t('currency') + moneyFormat(config.min))"
:placeholder="applyData.apply_money?'':('最小提现金额为' + t('currency') + moneyFormat(config.min))"
placeholder-class="apply-price" :adjust-position="false" />
<text v-if="Number(serviceMoney)" class="text-[24rpx] text-[var(--text-color-light6)] mr-[20rpx]">手续费{{ serviceMoney }}
</text>
@ -16,10 +16,10 @@
</view>
<view class="pt-[16rpx] flex items-center justify-between px-[4rpx]">
<view class="text-[24rpx] text-[var(--text-color-light6)] leading-[36rpx]">
<text>{{ t('money') }}{{ t('currency') }}{{ moneyFormat(cashOutMoney) }}</text>
<text>{{ t('commissionTo') }}{{ config.rate + '%' }}</text>
<text>可提现余额{{ t('currency') }}{{ moneyFormat(cashOutMoney) }}</text>
<text>手续费为{{ config.rate + '%' }}</text>
</view>
<view class="text-[24rpx] text-primary leading-[36rpx]" @click="allMoney">{{ t('allTx') }}</view>
<view class="text-[24rpx] text-primary leading-[36rpx]" @click="allMoney">全部提现</view>
</view>
</view>
@ -34,8 +34,8 @@
<image class="h-[60rpx] w-[60rpx] align-middle" :src="img('static/resource/images/member/apply_withdrawal/wechat.png')" mode="widthFix" />
</view>
<view class="flex-1 px-[20rpx]">
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">{{ t('cashOutToWechat') }}</view>
<view class="text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]">{{ t('cashOutToWechatTips') }}</view>
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">提现至微信零钱</view>
<view class="text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]">提现至微信零钱</view>
</view>
</view>
@ -47,19 +47,19 @@
<image class="h-[60rpx] w-[60rpx] align-middle" :src="img('static/resource/images/member/apply_withdrawal/wechat_code.png')" mode="widthFix" />
</view>
<view class="flex-1 px-[22rpx]" @click="transferWechatCode">
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">{{ t('cashOutToWechatCode') }}</view>
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">提现至微信</view>
<view class="text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]">
<view v-if="wechatCodeInfo" class="truncate max-w-[440rpx]">
<text>{{ t('cashOutTo') }}{{ t('wechatCodeAccountNo') }}</text>
<text>提现到微信号</text>
<text class="text-[#333]">{{ wechatCodeInfo.account_no }}</text>
</view>
<view v-else>{{ t('cashOutToWechatCodeTips') }}</view>
<view v-else>请先添加微信号</view>
</view>
</view>
<view class="flex items-center">
<button v-if="!wechatCodeInfo && !wechatCodeLoading" hover-class="none"
class="w-[110rpx] h-[54rpx] flex-center rounded-full p-[0] text-[var(--primary-color)] bg-transparent border-[2rpx] border-solid border-[var(--primary-color)] text-[22rpx]"
@click="redirect({ url: '/app/pages/member/account', param: { type: 'wechat_code', mode: 'select' } , mode: 'redirectTo'})">{{ t('toAdd') }}</button>
@click="redirect({ url: '/app/pages/member/account', param: { type: 'wechat_code', mode: 'select' } , mode: 'redirectTo'})">添加</button>
<text v-else class="nc-iconfont nc-icon-youV6xx text-[28rpx] text-[var(--text-color-light9)] p-[10rpx]"
@click.stop="redirect({ url: '/app/pages/member/account', param: { type: 'wechat_code', mode: 'select' } , mode: 'redirectTo'})"></text>
</view>
@ -73,19 +73,19 @@
<image class="h-[60rpx] w-[60rpx] align-middle" :src="img('static/resource/images/member/apply_withdrawal/alipay-icon.png')" mode="widthFix" />
</view>
<view class="flex-1 px-[22rpx]" @click="transferAlipay">
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">{{ t('cashOutToAlipay') }}</view>
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">提现至支付宝</view>
<view class="text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]">
<view v-if="alipayAccountInfo" class="truncate max-w-[440rpx]">
<text>{{ t('cashOutTo') }}{{ t('alipayAccountNo') }}</text>
<text>提现到支付宝账号</text>
<text class="text-[#333]">{{ alipayAccountInfo.account_no }}</text>
</view>
<view v-else>{{ t('cashOutToAlipayTips') }}</view>
<view v-else>请先添加支付宝账号</view>
</view>
</view>
<view class="flex items-center">
<button v-if="!alipayAccountInfo && !alipayLoading" hover-class="none"
class="w-[110rpx] h-[54rpx] flex-center rounded-full p-[0] text-[var(--primary-color)] bg-transparent border-[2rpx] border-solid border-[var(--primary-color)] text-[22rpx]"
@click="redirect({ url: '/app/pages/member/account', param: { type: 'alipay', mode: 'select' } , mode: 'redirectTo'})">{{ t('toAdd') }}</button>
@click="redirect({ url: '/app/pages/member/account', param: { type: 'alipay', mode: 'select' } , mode: 'redirectTo'})">添加</button>
<text v-else class="nc-iconfont nc-icon-youV6xx text-[28rpx] text-[var(--text-color-light9)] p-[10rpx]"
@click.stop="redirect({ url: '/app/pages/member/account', param: { type: 'alipay', mode: 'select' } , mode: 'redirectTo'})"></text>
</view>
@ -99,19 +99,19 @@
<image class="h-[42rpx] w-[60rpx] align-middle" :src="img('static/resource/images/member/apply_withdrawal/bank-icon.png')" mode="widthFix" />
</view>
<view class="flex-1 px-[20rpx]" @click="transferBank">
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">{{ t('cashOutToBank') }}</view>
<view class="text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]">提现至银行卡</view>
<view class="text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]">
<view v-if="bankAccountInfo" class="truncate max-w-[440rpx]">
<text>{{ t('cashOutTo') }}{{ bankAccountInfo.bank_name }}{{ t('debitCard') }}</text>
<text>提现到{{ bankAccountInfo.bank_name }}储蓄卡</text>
<text class="text-[#333]">{{ bankAccountInfo.account_no.substring(bankAccountInfo.account_no.length - 4) }}</text>
</view>
<view v-else>{{ t('cashOutToBankTips') }}</view>
<view v-else>请先添加银行卡</view>
</view>
</view>
<view class="flex items-center">
<button hover-class="none" class="h-[54rpx] flex-center rounded-full p-[0] w-[110rpx] text-[var(--primary-color)] bg-transparent border-[2rpx] border-solid border-[var(--primary-color)] text-[22rpx]"
v-if="!bankAccountInfo && !bankLoading"
@click="redirect({ url: '/app/pages/member/account', param: { type: 'bank', mode: 'select' }, mode: 'redirectTo' })">{{ t('toAdd') }}</button>
@click="redirect({ url: '/app/pages/member/account', param: { type: 'bank', mode: 'select' }, mode: 'redirectTo' })">添加</button>
<text v-else class="nc-iconfont nc-icon-youV6xx text-[28rpx] text-[var(--text-color-light9)] p-[10rpx]"
@click.stop="redirect({ url: '/app/pages/member/account', param: { type: 'bank', mode: 'select' }, mode: 'redirectTo' })"></text>
</view>
@ -120,9 +120,9 @@
<view class="tab-bar-placeholder"></view>
<view class="fixed bottom-[0] tab-bar left-0 right-0 px-[var(--sidebar-m)] bg-[var(--page-bg-color)]">
<button class="h-[80rpx] !text-[#fff] leading-[80rpx] primary-btn-bg rounded-[50rpx] text-[26rpx]" :disabled="applyData.apply_money == '' || applyData.apply_money == 0" :loading="loading" @click="cashOut">{{ t('cashOutNow') }}</button>
<button class="h-[80rpx] !text-[#fff] leading-[80rpx] primary-btn-bg rounded-[50rpx] text-[26rpx]" :disabled="applyData.apply_money == '' || applyData.apply_money == 0" :loading="loading" @click="cashOut">立即提现</button>
<view class="mt-[30rpx] text-center text-[26rpx] text-primary"
@click.stop="redirect({ url: '/app/pages/member/cash_out'})">{{ t('cashOutList') }}</view>
@click.stop="redirect({ url: '/app/pages/member/cash_out'})">提现记录</view>
</view>
</view>
@ -130,7 +130,7 @@
<view class="h-[100vh] w-[100vw] bg-[var(--page-bg-color)] overflow-hidden" v-if="config.is_open == 0 && !pageLoading">
<view class="empty-page">
<image class="img" :src="img('addon/shop/cart-empty.png')" model="aspectFit" />
<view class="desc">{{ t('isOpenApply') }}</view>
<view class="desc">提现设置未开启</view>
</view>
</view>
<loading-page :loading="pageLoading"></loading-page>
@ -200,7 +200,7 @@ onLoad(async(data) => {
if (!['money', 'commission'].includes(applyData.account_type)) {
uni.showToast({
title: t('abnormalOperation'),
title: '异常操作',
icon: 'none',
success() {
setTimeout(() => {
@ -267,23 +267,23 @@ const clearMoney = () => {
const verify = () => {
if (!applyData.transfer_type) {
uni.showToast({ title: t('noAvailableCashOutType'), icon: 'none' })
uni.showToast({ title: '没有可用的提现方式', icon: 'none' })
return false
}
if (uni.$u.test.isEmpty(applyData.apply_money)) {
uni.showToast({ title: t('applyMoneyPlaceholder'), icon: 'none' })
uni.showToast({ title: '请输入提现金额', icon: 'none' })
return false
}
if (!uni.$u.test.amount(applyData.apply_money)) {
uni.showToast({ title: t('moneyformatError'), icon: 'none' })
uni.showToast({ title: '提现金额格式错误', icon: 'none' })
return false
}
if (parseFloat(applyData.apply_money) > parseFloat(cashOutMoney.value)) {
uni.showToast({ title: t('applyMoneyExceed'), icon: 'none' })
uni.showToast({ title: '提现金额超出可提现金额', icon: 'none' })
return false
}
if (parseFloat(applyData.apply_money) < parseFloat(config.min)) {
uni.showToast({ title: t('applyMoneyBelow'), icon: 'none' })
uni.showToast({ title: '提现金额小于最低提现金额', icon: 'none' })
return false
}
return true;
@ -391,7 +391,7 @@ const cashOut = () => {
//
const transferAlipay = () => {
if (!alipayAccountInfo.value) {
uni.showToast({ title: t('cashOutToAlipayTips'), icon: 'none' })
uni.showToast({ title: '请先添加支付宝账号', icon: 'none' })
return false
}
applyData.transfer_type = 'alipay'
@ -399,7 +399,7 @@ const transferAlipay = () => {
//
const transferBank = () => {
if (!bankAccountInfo.value) {
uni.showToast({ title: t('cashOutToBankTips'), icon: 'none' })
uni.showToast({ title: '请先添加银行卡', icon: 'none' })
return false
}
applyData.transfer_type = 'bank'
@ -417,7 +417,7 @@ const transferWeixin = () => {
//
const transferWechatCode = () => {
if (!wechatCodeInfo.value) {
uni.showToast({ title: t('cashOutToWechatCodeTips'), icon: 'none' })
uni.showToast({ title: '请先添加微信号', icon: 'none' })
return false
}
applyData.transfer_type = 'wechat_code'

View File

@ -137,7 +137,7 @@
</view>
<view class="flex-1 mx-[20rpx]">
<view class="font-400 text-[28rpx] text-[#303133] leading-[38rpx] mb-[10rpx]">连续签到{{ item.continue_sign }}</view>
<view class="flex flex-wrap" v-if="item.gift">
<view class="flex flex-wrap" v-if="item.gift && item.gift.total">
<view class="flex">
<image :src="img(item.gift.total.icon)" class="w-[30rpx] h-[30rpx] flex-shrink-0"/>
<view class="text-[24rpx] ml-[8rpx] text-[#FF9000] leading-[34rpx] max-w-[330rpx]">{{ item.gift.total.text }}</view>

View File

@ -118,6 +118,11 @@ watch(() => selected.city, (nval) => {
selected.district = null
}
}
if (!data.length) {
emits('complete', selected)
show.value = false
}
}).catch()
} else {
areaList.district = []

View File

@ -1,5 +1,5 @@
<template>
<template v-if="tabbar && Object.keys(tabbar).length">
<template v-if="tabbarShow && tabbar && Object.keys(tabbar).length">
<u-tabbar :value="value" zIndex="9999" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" :inactive-color="tabbar.value.textColor" :active-color="tabbar.value.textHoverColor" :border="props.border" class="custom-tabbar">
<template v-for="item in tabbar.value.list">
<u-tabbar-item class="py-[5rpx]" :custom-style="{'background-color': tabbar.value.backgroundColor}" :text="item.text" :icon="img(value == item.link.url ? item.iconSelectPath : item.iconPath)" :name="item.link.url" v-if="tabbar.value.type == 1" @click="itemBtn(item.link.url)"></u-tabbar-item>
@ -15,6 +15,7 @@
import { reactive, computed, watch, nextTick, getCurrentInstance } from 'vue'
import { redirect, currRoute, currShareRoute, img } from '@/utils/common'
import useConfigStore from '@/stores/config'
import useSystemStore from '@/stores/system'
import { cloneDeep } from 'lodash-es'
const props = defineProps({
@ -47,6 +48,10 @@ if (!addon && configStore.addon) {
const tabbar: any = reactive({})
const tabbarShow = computed(() => {
return currRoute() != '/app/pages/index/tabbar'
})
const setTabbar = () => {
let list = cloneDeep(useConfigStore().tabbarList);
if (list.length == 1) {

View File

@ -244,7 +244,9 @@ const navbarPlaceholderHeight = () => {
const query = uni.createSelectorQuery().in(instance);
query.select('.ns-navbar-wrap .u-navbar .content-wrap').boundingClientRect(data => {
placeholderHeight.value = data ? data.height : 0;
diyStore.topTabarHeight = placeholderHeight.value;
diyStore.$patch((state) => {
state.topTabarHeight = placeholderHeight.value
})
}).exec();
})
}

View File

@ -1,7 +1,7 @@
<template>
<view @touchmove.prevent.stop>
<u-popup :show="showPop" type="bottom" @close="disPopUp">
<view>
<view class="privacy-popup-wrap">
<view class="p-[30rpx]">
<view class="privacy-title">用户隐私保护提示</view>
<view class="privacy-desc">感谢您使用本小程序在使用前您应当阅读并同意<text class="privacy-link" @tap="openPrivacyContract">{{ privacyContractName }}</text> 当点击同意并继续时即表示您已理解并同意该条款内容该条款将对您产生法律约束力如您不同意将无法继续使用小程序相关功能</view>
@ -235,4 +235,10 @@ defineExpose({
.bg-agree {
margin-right: 0rpx;
}
.privacy-popup-wrap {
padding-bottom: constant(safe-area-inset-bottom);
/*兼容 IOS<11.2*/
padding-bottom: env(safe-area-inset-bottom);
}
</style>

View File

@ -144,7 +144,7 @@ export function useDiyForm(params: any = {}) {
let diyFormStorage = uni.getStorageSync('diyFormStorage_' + diyStore.id)
if (diyFormStorage) {
var 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.components) {
diyFormStorage.components.forEach((item: any) => {

View File

@ -9,6 +9,9 @@ const t = (message: string) => {
// #endif
// #ifdef MP
route = '/' + (getCurrentInstance()?.root.ctx.$scope.__route__ || useSystemStore().currRoute)
if (route == '/app/pages/index/tabbar' && useSystemStore().currTabbar && useSystemStore().currTabbar.path) {
route = useSystemStore().currTabbar.path
}
// #endif
const file = language.getFileKey(route)
const key = `${ file.fileKey }.${ message }`

View File

@ -44,7 +44,6 @@ class Language {
this.setI18nLanguage(locale, file)
return nextTick()
}
this.loadLocale.push(`${fileKey}.${locale}`)
// 引入语言包文件
const messages = await import(route == 'app' ? `../${route}/locale/${locale}/${file}.json` : `../addon/${route}/locale/${locale}/${file}.json`)
@ -56,6 +55,8 @@ class Language {
this.i18n.global.mergeLocaleMessage(locale, data)
this.setI18nLanguage(locale, file)
this.loadLocale.push(`${fileKey}.${locale}`)
return nextTick()
} catch (e) {
// console.log(e)

View File

@ -42,4 +42,4 @@
"pages.friendspay.share": "找朋友帮忙付",
"pages.friendspay.money": "",
"pages.webview.index": ""
}
}

View File

@ -16,6 +16,12 @@
}
}
},
{
"path": "app/pages/index/tabbar",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "app/pages/auth/index",
"style": {
@ -379,6 +385,9 @@
},
{
"pagePath": "app/pages/index/nosite"
},
{
"pagePath": "app/pages/index/tabbar"
}
]
},

View File

@ -16,6 +16,10 @@ interface System {
shareCallback: any, // 分享回调
defaultPositionAddress: any,
diyAddressInfo: any // 定位信息
currTabbar: {
path: string,
query: object
}
}
const useSystemStore = defineStore('system', {
@ -38,7 +42,11 @@ const useSystemStore = defineStore('system', {
},
shareCallback: null,
defaultPositionAddress: '定位中',
diyAddressInfo: null
diyAddressInfo: null,
currTabbar: {
path: '/app/pages/index/index',
query: {}
}
}
},
actions: {

2
uni-app/src/tabbar.json Normal file
View File

@ -0,0 +1,2 @@
[
]

View File

@ -4,6 +4,8 @@ import { redirect, getToken, getSiteId,currRoute, setThemeColor } from '@/utils/
import { memberLog } from '@/app/api/auth'
import useConfigStore from "@/stores/config";
import { useShare } from '@/hooks/useShare'
import tabbarJson from '@/tabbar.json'
import useSystemStore from '@/stores/system'
/**
*
@ -39,6 +41,10 @@ export const redirectInterceptor = (route: { path: string, query: object }) => {
params: JSON.stringify(route.query),
pre_route: getCurrentPages()[0]?.route
})
// #ifdef MP
toTabbar(route)
// #endif
}
/**
@ -88,6 +94,10 @@ export const launchInterceptor = () => {
// 添加会员访问日志
if (getToken()) memberLog({ route: launch.path, params: JSON.stringify(launch.query || {}), pre_route: '' })
// #ifdef MP
toTabbar(launch)
// #endif
}
@ -113,3 +123,17 @@ const loadShare = () => {
if (!shareWhiteList.includes(currRoute() || '')) setShare()
}
}
/**
* tabbar
*/
const toTabbar = (route: { path: string, query: object }) => {
if (tabbarJson.includes(route.path)) {
useSystemStore().$patch((state) => {
state.currTabbar = route
})
uni.switchTab({
url: '/app/pages/index/tabbar'
})
}
}

View File

@ -64,3 +64,29 @@ export function getTabbarPages() {
export function getFirstPage() {
return '/' + pagesJson.pages[0].path
}
/**
* navbar的页面
*/
export function getCustomNavigationPages() {
const pages: any = {}
// 获取主包中的
pagesJson.pages.forEach(item => {
if (item.style && item.style.navigationStyle && item.style.navigationStyle == 'custom') {
pages[`/${ item.path }`] = item
}
})
// 获取分包中的
if (pagesJson.subPackages) {
pagesJson.subPackages.forEach(subPackages => {
if(subPackages.pages) {
subPackages.pages.forEach(item => {
if (item.style && item.style.navigationStyle && item.style.navigationStyle == 'custom') {
pages[`/${ subPackages.root }/${ item.path }`] = item
}
})
}
})
}
return pages
}