This commit is contained in:
全栈小学生 2024-12-12 18:31:33 +08:00
parent de48812edf
commit d46c0352a9
23 changed files with 321 additions and 181 deletions

View File

@ -249,4 +249,11 @@ export function getMemberAccountPointcount() {
*/
export function getTaskPoint() {
return request.get(`task/point`)
}
/**
*
*/
export function rechargeConfig() {
return request.get('recharge/config')
}

View File

@ -24,8 +24,8 @@ export function getCheckVerifier() {
/**
*
*/
export function getVerifierInfo(code: string) {
return request.get(`get_verify_by_code/${ code }`)
export function getVerifierInfo(params: Record<string, any>) {
return request.get(`get_verify_by_code`,params)
}
/**
@ -40,4 +40,4 @@ export function verify(code: string) {
*/
export function getVerifyDetail(code: string) {
return request.get(`verify_detail/${ code }`, {}, { showErrorMessage: true })
}
}

View File

@ -37,7 +37,7 @@
<view class="bd flex flex-wrap justify-between">
<template v-for="item in diyComponent.list" :key="item.id">
<view v-if="diyComponent.blockStyle.value == 'style-1'" @click="diyStore.toRedirect(item.link)" class="item flex justify-between px-[20rpx] py-[30rpx] bg-white mt-[20rpx] rounded-[var(--rounded-mid)]" :style="commonTempCss(item)">
<view v-if="diyComponent.blockStyle.value == 'style-1'" @click="diyStore.toRedirect(item.link)" class="item flex justify-between px-[20rpx] py-[30rpx] bg-white mt-[20rpx]" :style="commonTempCss(item)">
<view class="flex-1 flex items-baseline flex-col">
<view class="text-[28rpx] pb-[10rpx] text-[#333]" :style="{ fontWeight : diyComponent.blockStyle.fontWeight }">{{ item.title.text }}</view>
<view class="text-[22rpx] text-[#999] pb-[30rpx]">{{ item.subTitle.text }}</view>
@ -55,7 +55,7 @@
</view>
</view>
<view v-if="diyComponent.blockStyle.value == 'style-2'" @click="diyStore.toRedirect(item.link)" class="item h-[150rpx] flex justify-between p-[20rpx] bg-white mt-[20rpx] rounded-[var(--rounded-mid)]" :style="commonTempCss(item)">
<view v-if="diyComponent.blockStyle.value == 'style-2'" @click="diyStore.toRedirect(item.link)" class="item h-[150rpx] flex justify-between p-[20rpx] bg-white mt-[20rpx]" :style="commonTempCss(item)">
<view class="flex-1 flex items-baseline flex-col">
<view class="text-[26rpx] mt-[10rpx] pb-[16rpx]" :style="{ fontWeight : diyComponent.blockStyle.fontWeight }">{{ item.title.text }}</view>
<view class="text-[22rpx] text-gray-500 pb-[26rpx]">{{ item.subTitle.text }}</view>
@ -75,7 +75,7 @@
</view>
<scroll-view :scroll-x="true" class="whitespace-nowrap" :id="'warpStyle3-'+diyComponent.id" v-if="diyComponent.blockStyle.value == 'style-3'">
<view v-for="(item,index) in diyComponent.list" :key="item.id" class="inline-flex">
<view :id="'item'+index+diyComponent.id" @click="diyStore.toRedirect(item.link)" class="flex flex-col items-center justify-between p-[10rpx] bg-white mt-[20rpx] w-[157rpx] h-[200rpx] rounded-[var(--rounded-mid)] box-border" :style="itemStyle3 + commonTempCss(item)" :class="{'!mr-[0rpx]': index+1 === diyComponent.list.length}">
<view :id="'item'+index+diyComponent.id" @click="diyStore.toRedirect(item.link)" class="flex flex-col items-center justify-between p-[10rpx] bg-white mt-[20rpx] w-[157rpx] h-[200rpx] box-border" :style="itemStyle3 + commonTempCss(item)" :class="{'!mr-[0rpx]': index+1 === diyComponent.list.length}">
<view class="w-[141rpx] h-[141rpx] rounded-[var(--rounded-small)] overflow-hidden" v-if="item.imageUrl">
<image class="w-[141rpx] h-[141rpx]" :src="img(item.imageUrl)" mode="aspectFit" />
</view>
@ -91,7 +91,7 @@
<scroll-view scroll-x="true" class="whitespace-nowrap" :id="'warpStyle4-'+diyComponent.id" v-if="diyComponent.blockStyle.value == 'style-4'">
<view v-for="(item,index) in diyComponent.list" :key="item.id" class="inline-flex">
<view :id="'item'+index+diyComponent.id" @click="diyStore.toRedirect(item.link)" class="flex flex-col items-center justify-between p-[4rpx] bg-[#F93D02] mt-[20rpx] rounded-[var(--rounded-mid)] box-border" :class="{'!mr-[0rpx]': index+1 === diyComponent.list.length}" :style="commonTempCss(item) + itemStyle4">
<view :id="'item'+index+diyComponent.id" @click="diyStore.toRedirect(item.link)" class="flex flex-col items-center justify-between p-[4rpx] bg-[#F93D02] mt-[20rpx] box-border" :class="{'!mr-[0rpx]': index+1 === diyComponent.list.length}" :style="commonTempCss(item) + itemStyle4">
<view class="w-[149rpx] h-[149rpx] box-border px-[18rpx] pt-[16rpx] pb-[6rpx] bg-[#fff] flex flex-col items-center rounded-[var(--rounded-small)]">
<view class="w-[112rpx] h-[102rpx]" v-if="item.imageUrl">
<image class="w-[112rpx] h-[102rpx]" :src="img(item.imageUrl)" mode="aspectFit" />
@ -205,6 +205,11 @@
}else{
style += `background:${data.listFrame.startColor || data.listFrame.endColor};`;
}
if (diyComponent.value.topElementRounded) style += 'border-top-left-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
if (diyComponent.value.topElementRounded) style += 'border-top-right-radius:' + diyComponent.value.topElementRounded * 2 + 'rpx;';
if (diyComponent.value.bottomElementRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomElementRounded * 2 + 'rpx;';
if (diyComponent.value.bottomElementRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomElementRounded * 2 + 'rpx;';
style += 'overflow: hidden';
return style;
}

View File

@ -77,7 +77,7 @@
<!-- 轮播图 -->
<view class="relative" :class="{'mx-[20rpx]': swiperStyleBool && diyComponent.swiper.swiperStyle != 'style-3', 'swiper-style-3': diyComponent.swiper.swiperStyle == 'style-3'}" :style="carouselSwiperStyle()">
<swiper v-if="diyComponent.swiper.control" class="swiper" :style="{ height: imgHeight }" autoplay="true" circular="true" @change="swiperChange"
<swiper v-if="diyComponent.swiper.control" class="swiper" :style="{ height: imgHeight }" autoplay="true" circular="true" @change="swiperChange"
:class="{
'swiper-left': diyComponent.swiper.indicatorAlign == 'left',
'swiper-right': diyComponent.swiper.indicatorAlign == 'right',
@ -146,6 +146,7 @@
import {useLocation} from '@/hooks/useLocation'
import useSystemStore from '@/stores/system';
const systemStore = useSystemStore();
const systemInfo = uni.getSystemInfoSync();
const instance = getCurrentInstance();
const props = defineProps(['component', 'index', 'pullDownRefreshCount', 'global', 'scrollBool']);
@ -210,19 +211,28 @@
const fixedStyle = computed(()=>{
var style = '';
if(diyComponent.value.swiper.swiperStyle == 'style-3'){
style += 'position: absolute;z-index: 10;left: 0;right: 0;';
style += 'position: absolute;z-index: 99;left: 0;right: 0;';
}
if (diyStore.mode == 'decorate') return style;
// #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;';
}
if(diyComponent.value.swiper.swiperStyle == 'style-3'){
// h5,
if (systemInfo.platform === 'ios') {
style += 'top: 55px;';
}else{
style += 'top: 44.5px;';
}
}
// #endif
if (diyStore.mode == 'decorate') return style;
if(diyComponent.value.positionWay == 'fixed') {
if (props.scrollBool != undefined && props.scrollBool != -1) {
style += 'position: fixed;z-index: 10;left: 0;right: 0;';
style += 'position: fixed;z-index: 99;top: 0;left: 0;right: 0;';
}
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
@ -231,6 +241,15 @@
style += 'top:' + diyStore.topTabarHeight + 'px;';
}
// #endif
if (props.scrollBool == 1 || props.scrollBool == 2) {
// #ifdef H5
if(props.global.topStatusBar.isShow && props.global.topStatusBar.style == 'style-4') {
style += 'top:' + diyStore.topTabarHeight + 'px;';
}
// #endif
}
fixedStyleBg.value = false;
if (props.scrollBool == 1) {
@ -252,8 +271,13 @@
const carouselSwiperStyle = ()=> {
let style = "";
if(diyComponent.value.swiper.swiperStyle == 'style-3'){
// #ifdef MP
style = 'padding-top:' + menuButtonInfo.top + 'px;';
// #ifdef H5
// h5,
if (systemInfo.platform === 'ios') {
style = 'margin-top: -55px;';
}else{
style = 'margin-top: -44.5px;';
}
// #endif
}
return style;
@ -384,7 +408,9 @@
}
//
// #ifdef H5
isShowDots.value = diyComponent.value.swiper.list.length > 1 ? true : false;
isShowDots = computed(() => {
return diyComponent.value?.swiper?.list?.length > 1;
});
// #endif
// (API)
@ -474,7 +500,7 @@
// #ifdef H5
isShowDots.value = true;
// #endif
// #ifdef MP-WEIXIN
isShowDots.value = false;
// #endif
@ -511,6 +537,12 @@
-webkit-transform: scale(2) translateY(15%);
transform: scale(2) translateY(15%);
}
&.no-filter{
uni-image, image{
-webkit-filter: blur(0);
filter: blur(0);
}
}
.bg-img-box{
position: absolute;
top: 0;

View File

@ -1,7 +1,6 @@
<template>
<view :style="warpCss">
<view :style="maskLayer"></view>
<view class="diy-image-ads">
<view class="diy-image-ads" :style="imageAdsTempStyle()">
<view v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden" :style="swiperWarpCss">
<view @click="diyStore.toRedirect(diyComponent.list[0].link)">
<image v-if="diyComponent.list[0].imageUrl" :src="img(diyComponent.list[0].imageUrl)" :style="{height: imgHeight}" mode="heightFix" class="!w-full" :show-menu-by-longpress="true"/>
@ -30,6 +29,7 @@
import { img } from '@/utils/common';
const props = defineProps(['component', 'index', 'pullDownRefreshCount']);
const systemInfo = uni.getSystemInfoSync();
const diyStore = useDiyStore();
@ -40,6 +40,27 @@
return props.component;
}
})
//
const imageAdsTempStyle = ()=> {
let style = "";
if(diyComponent.value.isSameScreen && props.index == 0){
// #ifdef H5
// h5,
if (systemInfo.platform === 'ios') {
style = 'margin-top: -55px;';
}else{
style = 'margin-top: -44.5px;';
}
// #endif
// #ifdef MP
//
uni.setStorageSync('imageAdsSameScreen', true);
// #endif
}
return style;
}
const warpCss = computed(() => {
var style = '';
@ -65,23 +86,6 @@
return style;
})
//
const maskLayer = computed(()=>{
var style = '';
if(diyComponent.value.componentBgUrl) {
style += 'position:absolute;top:0;width:100%;';
style += `background: rgba(0,0,0,${diyComponent.value.componentBgAlpha / 10});`;
style += `height:${height.value}px;`;
if (diyComponent.value.topRounded) style += 'border-top-left-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
if (diyComponent.value.topRounded) style += 'border-top-right-radius:' + diyComponent.value.topRounded * 2 + 'rpx;';
if (diyComponent.value.bottomRounded) style += 'border-bottom-left-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
if (diyComponent.value.bottomRounded) style += 'border-bottom-right-radius:' + diyComponent.value.bottomRounded * 2 + 'rpx;';
}
return style;
});
watch(
() => props.pullDownRefreshCount,
(newValue, oldValue) => {
@ -114,9 +118,6 @@
}
});
const instance = getCurrentInstance();
const height = ref(0)
const refresh = () => {
//
if (diyStore.mode == 'decorate') {
@ -126,13 +127,9 @@
item.imgHeight = 330;
}
});
}else{
uni.removeStorageSync('imageAdsSameScreen');
}
nextTick(() => {
const query = uni.createSelectorQuery().in(instance);
query.select('.diy-image-ads').boundingClientRect((data: any) => {
height.value = data.height;
}).exec();
})
}
</script>

View File

@ -23,7 +23,7 @@
<text class="iconfont iconxiayibu1 ml-[4rpx] -mb-[2rpx] !text-[14rpx] text-[#333]"></text>
</view>
</view>
<view v-if="diyComponent.style == 'style-3'" class="rounded-[var(--rounded-big)] style-bg-3 py-[var(--pad-top-m)] px-[var(--pad-sidebar-m)]">
<view v-if="diyComponent.style == 'style-3'" class="style-bg-3 py-[var(--pad-top-m)] px-[var(--pad-sidebar-m)]">
<view class="flex items-center justify-between style-border-3 mb-[30rpx] pb-[40rpx]">
<view class="flex flex-col flex-1">
<view class="flex items-center justify-between">
@ -43,7 +43,7 @@
</view>
<text class="text-[24rpx] text-[#794200] mt-[10rpx]">购物或邀请好友可以提升等级</text>
</view>
</view>
<view class="flex items-center justify-between">
<view class="flex flex-col flex-1 mt-[2rpx]">
@ -74,7 +74,7 @@
<image :src="img('static/resource/images/diy/member/style4_arrow.png')" mode="aspectFit" class="w-[26rpx] h-[26rpx] pt-[2rpx]" />
</view>
</view>
<view v-if="diyComponent.style == 'style-5'" class="rounded-[var(--rounded-big)] style-5" :style="{'backgroundImage': 'url('+img('static/resource/images/diy/member/style5_bg.jpg')+')'}">
<view v-if="diyComponent.style == 'style-5'" class="style-5" :style="{'backgroundImage': 'url('+img('static/resource/images/diy/member/style5_bg.jpg')+')'}">
<view class="content-head pt-[16rpx] pb-[10rpx] px-[24rpx] flex items-center justify-between">
<view class="flex items-center">
<image :src="img('static/resource/images/diy/member/style5_vip.png')" mode="aspectFit" class="w-[40rpx] h-[40rpx]" />
@ -168,49 +168,49 @@
getMemberLevelFn(memberStore.levelList)
return memberStore.levelList
}
})
const getMemberLevelFn = (list:any)=> {
if(!list||!list.length) return false;
let isSet = false;
//
if (info.value && list && list.length) {
list.forEach((item: any, index: any) => {
if (item.level_id == info.value.member_level) {
currIndex.value = index + 1;
//
if (item.level_benefits) {
Object.values(item.level_benefits).forEach((bItem: any) => {
if (bItem.content) {
benefits_arr.value.push(bItem.content)
}
})
}
}
if (!list || !list.length) return false;
let isSet = false;
//
if (info.value && list && list.length) {
list.forEach((item: any, index: any) => {
if (item.level_id == info.value.member_level) {
currIndex.value = index + 1;
//
if (item.level_benefits) {
Object.values(item.level_benefits).forEach((bItem: any) => {
if (bItem.content) {
benefits_arr.value.push(bItem.content)
}
})
}
}
if (item.growth > info.value.growth && !isSet) {
afterCurrIndex.value = index;
isSet = true;
}
})
}
if (item.growth > info.value.growth && item.level_id != info.value.member_level && !isSet) {
afterCurrIndex.value = index;
isSet = true;
}
})
}
if (info.value.member_level) {
if(afterCurrIndex.value == -1){
afterCurrIndex.value = list.length - 1;
}
if (info.value.member_level) {
if (afterCurrIndex.value == -1) {
afterCurrIndex.value = list.length - 1;
}
if (list[afterCurrIndex.value] && list[afterCurrIndex.value].growth) {
upgradeGrowth.value = list[afterCurrIndex.value].growth - info.value.growth;
}
}else{
//
info.value.member_level_name = list[0].level_name;
upgradeGrowth.value = list[0].growth - info.value.growth;
afterCurrIndex.value = 0;
currIndex.value = 1;
}
}
if (list[afterCurrIndex.value] && list[afterCurrIndex.value].growth) {
upgradeGrowth.value = list[afterCurrIndex.value].growth - info.value.growth;
}
} else {
//
info.value.member_level_name = list[0].level_name;
upgradeGrowth.value = list[0].growth - info.value.growth;
afterCurrIndex.value = 0;
currIndex.value = 1;
}
}
//
let progress = () => {
@ -266,7 +266,7 @@
background: linear-gradient(#FFF3C1, #FFEFB0);
}
}
.style-5{
background-size: cover;
background-repeat: no-repeat;

View File

@ -1,5 +1,5 @@
<template>
<view :style="warpCss" class="flex justify-between">
<view :style="warpCss" class="flex justify-between overflow-hidden">
<view class="p-[20rpx] box-border overflow-hidden" :style="moduleOneCss">
<view class="flex items-center pb-[30rpx] pt-[6rpx]" v-if="diyComponent.moduleOne.head.textImg || diyComponent.moduleOne.head.subText">
<image class="h-[28rpx]" v-if="diyComponent.moduleOne.head.textImg" :src="img(diyComponent.moduleOne.head.textImg)" mode="heightFix"></image>

View File

@ -68,11 +68,10 @@
<view v-else-if="!loginConfig.is_mobile && loginConfig.is_username" class="w-full flex items-center justify-center">
<button class="w-[630rpx] h-[88rpx] !mx-[0] !bg-[#fff] !border-[var(--primary-color)] border-solid border-[2rpx] text-[26rpx] rounded-[44rpx] leading-[84rpx] !text-[var(--primary-color)]" @click="redirect({ url: '/app/pages/auth/login',param:{type:'username'}})">{{t('accountLogin')}}</button>
</view>
<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-[10rpx]" @click.stop="agreeChange">
<u-checkbox-group @change="agreeChange">
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="24rpx" :customStyle="{ 'marginTop': '4rpx' }" />
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="26rpx" :customStyle="{ 'marginTop': '5rpx !important' }" />
</u-checkbox-group>
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap">
<text>{{ t('agreeTips') }}</text>

View File

@ -12,13 +12,13 @@
<view class="mt-[16rpx] text-[26rpx] line-feed text-[var(--text-color-light9)] leading-[1.4]">{{ item.full_address }}</view>
</view>
<view class="flex justify-between pt-[26rpx]">
<view class="flex items-center text-[28rpx] leading-none" @click.stop="setDefault(index)">
<text class="iconfont !text-[28rpx] mr-[10rpx]" :class="{ 'iconduigou text-primary': item.is_default, 'iconcheckbox_nol': !item.is_default }"></text>
<view class="flex items-center text-[26rpx] leading-none" @click.stop="setDefault(index)">
<text class="iconfont !text-[26rpx] mr-[10rpx]" :class="{ 'iconduigou text-primary': item.is_default, 'iconcheckbox_nol': !item.is_default }"></text>
设为默认
</view>
<view class="flex">
<view class="text-[28rpx]" @click.stop="editAddressFn(item.id)"><text class="nc-iconfont nc-icon-xiugaiV6xx shrink-0 text-[28rpx] mr-[4rpx]"></text>编辑</view>
<view @click.stop="deleteAddressFn(index)" class="ml-[40rpx] text-[28rpx]"><text class="nc-iconfont nc-icon-shanchu-yuangaizhiV6xx shrink-0 text-[28rpx] mr-[4rpx]"></text>删除</view>
<view class="text-[26rpx]" @click.stop="editAddressFn(item.id)"><text class="nc-iconfont nc-icon-xiugaiV6xx shrink-0 text-[26rpx] mr-[4rpx]"></text>编辑</view>
<view @click.stop="deleteAddressFn(index)" class="ml-[40rpx] text-[26rpx]"><text class="nc-iconfont nc-icon-shanchu-yuangaizhiV6xx shrink-0 text-[26rpx] mr-[4rpx]"></text>删除</view>
</view>
</view>
</view>

View File

@ -21,10 +21,9 @@
<text class="text-[36rpx] font-500 price-font">{{ moneyFormat(memberStore.info?.money).split('.')[1] }}</text>
</view>
</view>
<view class="mt-[60rpx] flex justify-around" v-if="Object.keys(cashOutConfigObj).length && (systemStore.siteAddons.includes('recharge') || cashOutConfigObj.is_open == 1)">
<view class="mt-[60rpx] flex justify-around" v-if="Object.keys(cashOutConfigObj).length && (systemStore.siteAddons.includes('recharge') || cashOutConfigObj.is_open == 1 || rechargeConfigObj.is_use == 1)">
<block v-if="systemStore.siteAddons.includes('recharge')">
<button v-if="cashOutConfigObj.is_open != 1" class="!w-[340rpx] h-[70rpx] font-500 rounded-full text-[26rpx] primary-btn-bg !text-[#fff] flex-center !m-0" hover-class="none" shape="circle" @click="redirect({url: '/addon/recharge/pages/recharge'})">充值</button>
<button v-else class="w-[250rpx] h-[70rpx] rounded-[40rpx] text-[26rpx] font-500 !bg-[#fff] !text-[var(--primary-color)] flex-center !m-0 border-[2rpx] border-[var(--primary-color)] border-solid box-border" hover-class="none" shape="circle" @click="redirect({url: '/addon/recharge/pages/recharge'})">充值</button>
<button v-if="rechargeConfigObj.is_use == 1" class="w-[250rpx] h-[70rpx] rounded-[40rpx] text-[26rpx] font-500 !bg-[#fff] !text-[var(--primary-color)] flex-center !m-0 border-[2rpx] border-[var(--primary-color)] border-solid box-border" hover-class="none" shape="circle" @click="redirect({url: '/addon/recharge/pages/recharge'})">充值</button>
</block>
<view v-if="cashOutConfigObj.is_open == 1" :class="{'!w-[340rpx]': !systemStore.siteAddons.includes('recharge')}" class="text-center w-[250rpx] h-[70rpx] rounded-[40rpx] text-[26rpx] !text-[#fff] flex-center font-500 !m-0"
style="background: linear-gradient( 94deg, #FB7939 0%, #FE120E 99%), #EF000C;" @click="applyCashOut">{{t('cashOut')}}</view>
@ -70,10 +69,10 @@
</template>
<script setup lang="ts">
import { ref, reactive,computed } from 'vue'
import { ref, reactive,computed ,watch} from 'vue'
import { t } from '@/locale'
import { moneyFormat, redirect, img,pxToRpx } from '@/utils/common';
import { cashOutConfig,getBalanceListAll } from '@/app/api/member';
import { cashOutConfig,getBalanceListAll,rechargeConfig} from '@/app/api/member';
import MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
@ -86,13 +85,30 @@
const { downCallback,mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
const memberStore = useMemberStore()
const systemStore = useSystemStore()
/********* 自定义头部 - start ***********/
const topTabarObj = topTabar()
let param = topTabarObj.setTopTabbarParam({title:'我的余额'})
/********* 自定义头部 - end ***********/
const cashOutConfigObj: any = reactive({})
const rechargeConfigObj: any = reactive({})
// siteAddons
watch(
() => systemStore.siteAddons,
(newAddons, oldAddons) => {
if (newAddons !== oldAddons) {
systemStore.siteAddons = newAddons
if(systemStore.siteAddons.includes('recharge')) {
rechargeConfig().then((res: any) => {
for (let key in res.data) {
rechargeConfigObj[key] = res.data[key];
}
})
}
}
}
);
onShow(() => {
cashOutConfig().then((res: any) => {
for (let key in res.data) {
@ -100,8 +116,16 @@
}
})
if(systemStore.siteAddons.includes('recharge')) {
rechargeConfig().then((res: any) => {
for (let key in res.data) {
rechargeConfigObj[key] = res.data[key];
}
})
}
})
//
let menuButtonInfo: any = {};
// (API)
@ -118,17 +142,17 @@
})
const mescrollTop = computed(()=>{
if(Object.keys(cashOutConfigObj).length && (systemStore.siteAddons.includes('recharge') || cashOutConfigObj.is_open == 1)){
if((cashOutConfigObj.is_open == 1 || rechargeConfigObj.is_use == 1)){
if(Object.keys(menuButtonInfo).length){
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) +pxToRpx(8)+708)+'rpx'
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) +pxToRpx(8)+700)+'rpx'
}else{
return '708rpx'
return '718rpx'
}
}else {
if(Object.keys(menuButtonInfo).length){
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) +pxToRpx(8)+590.39)+'rpx'
return (pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) +pxToRpx(8)+632)+'rpx'
}else{
return '590.39rpx'
return '650rpx'
}
}
})

View File

@ -13,7 +13,7 @@
<view class="mt-[40rpx] text-[30rpx]">点击扫描二维码</view>
<view class="mt-[20rpx] text-[var(--text-color-light9)] text-[26rpx] font-400 pb-[142rpx]">扫描二维码进行核销</view>
</view>
<view v-show="operationType == 'manualInput'">
<view class="flex pt-[126rpx] items-center justify-center">
<view class="flex justify-center items-center flex-col pr-[30rpx] min-w-[130rpx]">
@ -35,7 +35,7 @@
</view>
</view>
</view>
<view class="w-[630rpx] h-[100rpx] bg-[#fff] mx-[auto] mt-[220rpx] rounded-[90rpx] flex relative action-type-wrap">
<view class="relative w-[51%] pr-[50rpx] box-border rounded-[50rpx] z-0 flex flex-col items-center justify-center" @click="changeOperationType('sweepCode')" :class="{'xuanZhong1': operationType == 'sweepCode'}">
<text class="nc-iconfont nc-icon-saoyisaoV6xx !text-[40rpx]"></text>
@ -50,7 +50,7 @@
<view class="ml-[20rpx] text-[24rpx] leading-[1] mt-[10rpx]" @click="focus">手动输入</view>
</view>
</view>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
@ -73,7 +73,7 @@
import { getVerifierInfo, getCheckVerifier } from '@/app/api/verify'
import { t } from '@/locale'
import wechat from '@/utils/wechat'
const operationType = ref('manualInput'); //
// #ifdef H5
operationType.value = 'manualInput';
@ -81,7 +81,7 @@
// #ifndef H5
operationType.value = 'sweepCode';
// #endif
const isFocus = ref(false)
const verify_code = ref('');
const loading = ref(true)
@ -89,7 +89,7 @@
onShow(() => {
if(getToken()) checkIsVerifier();
})
//
const checkIsVerifier = () => {
getCheckVerifier().then((res:any) =>{
@ -118,7 +118,7 @@
}
})
}
const scanCode = () => {
// #ifdef MP
uni.scanCode({
@ -136,7 +136,7 @@
}
});
// #endif
// #ifdef H5
if (isWeixinBrowser()) {
wechat.init();
@ -149,7 +149,7 @@
}
// #endif
}
let isLoading = false;
const confirm = () => {
var reg = /[\S]+/;
@ -160,22 +160,22 @@
});
return false;
}
if(isLoading) return false;
isLoading = true;
getVerifierInfo(verify_code.value).then((res:any) =>{
getVerifierInfo({ code : verify_code.value }).then((res:any) =>{
isLoading = false;
redirect({ url: '/app/pages/verify/verify', param: { code: verify_code.value} })
}).catch(() => {
isLoading = false;
})
}
const focus = () => {
isFocus.value = !isFocus.value;
}
const changeOperationType = (type: string) => {
// #ifdef H5
// if (type == 'sweepCode' && !isWeixinBrowser()) {

View File

@ -33,7 +33,7 @@
</view>
</view>
</view>
<view class="card-template mt-[var(--top-m)] sidebar-margin">
<view class="title">核销信息</view>
<view class="card-template-item justify-between">
@ -45,7 +45,7 @@
<view class="text-[28rpx] text-[#333]">{{item.value}}</view>
</view>
</view>
<view v-for="(item,index) in verifyInfo.value.content.diy" :key="index" class="card-template mt-[var(--top-m)] sidebar-margin">
<view class="title">{{item.title}}</view>
<view class="card-template-item justify-between" v-for="(subItem,subIndex) in item.list" :key="subIndex">
@ -53,7 +53,7 @@
<text class="text-[28rpx] text-[#333]">{{ subItem.value }}</text>
</view>
</view>
<view class="fixed bottom-[30rpx] primary-btn-bg text-[#fff] flex-center !text-[26rpx] rounded-[50rpx] h-[80rpx] left-[20rpx] right-[20rpx] font-500" @click="verifyFn">确定</view>
</block>
<loading-page :loading="loading"></loading-page>
@ -81,14 +81,14 @@
}
}
})
onShow(() => {
if(getToken()){
checkIsVerifier();
getVerifierInfoFn();
}
})
//
const checkIsVerifier = () => {
getCheckVerifier().then((res:any) =>{
@ -114,11 +114,11 @@
}
})
}
const verifyInfo = ref({})
const getVerifierInfoFn = ()=>{
loading.value = true;
getVerifierInfo(code.value).then((res:any) =>{
getVerifierInfo({ code : code.value }).then((res:any) =>{
verifyInfo.value = res.data;
loading.value = false;
}).catch(() => {
@ -132,7 +132,7 @@
const verifyFn = ()=>{
if(isLoading) return false;
isLoading = true;
verify(code.value).then((res:any) =>{
uni.showToast({
title: '核销成功',
@ -149,4 +149,4 @@
</script>
<style lang="scss" scoped>
</style>
</style>

View File

@ -1,7 +1,8 @@
<template>
<u-popup :show="show" @close="show = false" mode="bottom" :round="10" zIndex="10090">
<view class="popup-common">
<view class="popup-common relative">
<view class="title">选择时间</view>
<view class="absolute top-[36rpx] right-[36rpx] text-[24rpx] text-[var(--text-color-light6)] leading-[30rpx] z-10" @click="clearDate">清除</view>
<view class="px-[var(--popup-sidebar-m)] mb-[20rpx] mt-[10rpx]">
<view class="flex items-center justify-between mb-[30rpx]">
<view class="w-[160rpx] h-[66rpx] box-border flex-center rounded-[33rpx] bg-[var(--temp-bg)] text-center text-[26rpx] text-[var(--text-color-light6)] border-[2rpx] border-solid border-[var(--temp-bg)]" v-for="(item,index) in curselectDate" :key="'a'+index" :class="{'text-primary !border-[var(--primary-color)] !bg-[rgba(239,0,12,0.04)]': currentValue.type == item.type}" @click="loadDateFn(item)">{{item.name}}</view>
@ -177,6 +178,10 @@ const reset = () =>{
dateList.nowDate = [init().nowDateStart,init().nowDateEnd]
}
const clearDate = () =>{
emits('confirm',[])
show.value = false
}
defineExpose({
show
})

View File

@ -1,7 +1,7 @@
<template>
<!-- 分享弹窗 -->
<view @touchmove.prevent.stop class="share-popup">
<u-popup :show="sharePopupShow" type="bottom" @close="sharePopuClose" overlayOpacity="0.8">
<u-popup :show="sharePopupShow" type="bottom" @close="sharePopupClose" overlayOpacity="0.8">
<view @touchmove.prevent.stop>
<view class="poster-img-wrap" :style="{'top': shareTop}">
<image v-if="isPosterAnimation" class="poster-animation" :src="img('addon/shop/poster_animation.gif')" mode="aspectFit"></image>
@ -15,7 +15,7 @@
<text>分享给好友</text>
</button>
</view>
<view class="share-box">
<button class="share-btn" :plain="true" @click="saveGoodsPoster()">
<view class="text-[#07c160] iconfont iconpengyouquan"></view>
@ -23,7 +23,7 @@
</button>
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="share-box" @click="copyUrl">
<button class="share-btn" :plain="true">
@ -33,7 +33,7 @@
</view>
<!-- #endif -->
</view>
<view class="share-footer" @click="sharePopuClose"><text>取消分享</text></view>
<view class="share-footer" @click="sharePopupClose"><text>取消分享</text></view>
</view>
</u-popup>
<u-popup :show="show" mode="center" :round="10" :closeable="true" @close="show = false" :safe-area-inset-bottom="false">
@ -79,6 +79,8 @@ const props = defineProps({
}
})
const emits = defineEmits(['close'])
const sharePopupShow = ref(false);
//
@ -104,7 +106,7 @@ const copyUrl = () => {
const openShare = ()=>{
sharePopupShow.value = true
goodsPosterShowFn();
}
}
//
const isPosterAnimation = ref(false)
@ -122,7 +124,7 @@ const goodsPosterShowFn = () => {
let startTime = Date.parse(new Date());
getPoster(obj).then((res:any) => {
poster.value = res.data && img(res.data) || '';
let endTime = Date.parse(new Date());
let time = endTime-startTime;
let periodTime = 2200;
@ -136,7 +138,7 @@ const goodsPosterShowFn = () => {
isPosterImg.value = true;
}
}).catch(() => {
sharePopuClose();
sharePopupClose();
})
}
const show = ref(false);
@ -199,11 +201,13 @@ shareTop.value = menuButtonInfo.top + menuButtonInfo.height + 'px';
// #endif
/************ 获取微信头部-end ****************/
const sharePopuClose = ()=>{
const sharePopupClose = ()=>{
sharePopupShow.value = false;
isPosterAnimation.value = false;
isPosterImg.value = false;
}
console.log('sharePopupClose 取消分享');
emits('close');
}
defineExpose({
openShare
@ -239,7 +243,7 @@ defineExpose({
line-height: 1;
height: auto;
background: none;
text {
margin-top: 20rpx;
font-size: 24rpx;
@ -269,7 +273,7 @@ defineExpose({
text-align: center;
font-size: 26rpx;
}
}
.poster-img-wrap{
@ -348,4 +352,4 @@ defineExpose({
border-radius: 0;
}
}
</style>
</style>

View File

@ -43,8 +43,11 @@ export function useDiy(params: any = {}) {
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 + ';';
}
style += 'min-height:calc(100vh - 50px);';
if(data.value.global.bottomTabBarSwitch){
style += 'min-height:calc(100vh - 50px);';
}else{
style += 'min-height:calc(100vh);';
}
if (data.value.global.bgUrl) {
style += `background-image:url('${ img(data.value.global.bgUrl) }');`;
}

View File

@ -61,26 +61,33 @@ export const useShare = () => {
}
// #endif
if (options && options.wechat && options.weapp) {
if (options && Object.keys(options).length) {
// #ifdef H5
wechatOptions.title = options.wechat.title || ''
wechatOptions.link = options.wechat.link || h5Link
wechatOptions.desc = options.wechat.desc || ''
wechatOptions.imgUrl = options.wechat.url ? img(options.wechat.url) : ''
// wechatOptions.success = options.wechat.callback || null;
// useSystemStore().shareCallback = options.wechat.callback || null;
wechatShare()
// #endif
if (options.wechat) {
// #ifdef MP-WEIXIN
weappOptions.title = options.weapp.title || ''
if (options.weapp.path) weappOptions.path = options.weapp.path
weappOptions.imageUrl = options.weapp.url ? img(options.weapp.url) : ''
useSystemStore().shareCallback = options.weapp.callback || null;
// #endif
// #ifdef H5
wechatOptions.title = options.wechat.title || ''
wechatOptions.link = options.wechat.link || h5Link
wechatOptions.desc = options.wechat.desc || ''
wechatOptions.imgUrl = options.wechat.url ? img(options.wechat.url) : ''
// wechatOptions.success = options.wechat.callback || null;
// useSystemStore().shareCallback = options.wechat.callback || null;
wechatShare()
// #endif
}
if (options.weapp) {
// #ifdef MP-WEIXIN
weappOptions.title = options.weapp.title || ''
if (options.weapp.path) weappOptions.path = options.weapp.path
weappOptions.imageUrl = options.weapp.url ? img(options.weapp.url) : ''
useSystemStore().shareCallback = options.weapp.callback || null;
uni.setStorageSync('weappOptions', weappOptions)
// #endif
}
uni.setStorageSync('weappOptions', weappOptions)
} else {
getShareInfo({
route: '/' + currRoute(),
@ -125,7 +132,6 @@ export const useShare = () => {
...options
}
})
}
// 小程序分享,分享到朋友圈

View File

@ -68,6 +68,8 @@
"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": "商品列表",

View File

@ -95,4 +95,4 @@
}
},
"fallbackLocale": "zh-Hans"
}
}

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "nc-iconfont"; /* Project id 4567203 */
src: url('//at.alicdn.com/t/c/font_4567203_upzww1i5qjn.woff2?t=1731549702579') format('woff2'),
url('//at.alicdn.com/t/c/font_4567203_upzww1i5qjn.woff?t=1731549702579') format('woff'),
url('//at.alicdn.com/t/c/font_4567203_upzww1i5qjn.ttf?t=1731549702579') format('truetype');
src: url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.woff2?t=1732704100572') format('woff2'),
url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.woff?t=1732704100572') format('woff'),
url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.ttf?t=1732704100572') format('truetype');
}
.nc-iconfont {
@ -13,6 +13,46 @@
-moz-osx-font-smoothing: grayscale;
}
.nc-icon-gouwucheV6xx6:before {
content: "\e835";
}
.nc-icon-gouwucheV6xx-11:before {
content: "\e770";
}
.nc-icon-a-zuji34:before {
content: "\e803";
}
.nc-icon-zhifujianshu:before {
content: "\e831";
}
.nc-icon-tuikuanjianshu:before {
content: "\e830";
}
.nc-icon-xiadanjianshu:before {
content: "\e82f";
}
.nc-icon-zhifuzhuanhuashuai:before {
content: "\e82e";
}
.nc-icon-chengbenjine:before {
content: "\e834";
}
.nc-icon-tuikuanjine:before {
content: "\e833";
}
.nc-icon-zhifujine:before {
content: "\e832";
}
.nc-icon-gouwuche1:before {
content: "\e76e";
}

View File

@ -13,6 +13,8 @@ export const redirect = (redirect: any) => {
if (useDiyStore().mode == 'decorate') return
let { url, mode, param, success, fail, complete } = redirect
let originalUrl = url; // 原始地址
let newLogin = false; // 是否需要登录
// 如果未开启普通账号登录注册,则不展示登录注册页面,如果只开启了账号密码登录,就不需要跳转到登录中间页了,直接进入普通账号密码登录页面
if (!getToken() && getNeedLoginPages().indexOf(url) != -1) {
@ -25,12 +27,14 @@ export const redirect = (redirect: any) => {
url = '/app/pages/auth/login'
param = { type: 'username' }
mode = 'redirectTo'
newLogin = true
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
return;
} else {
url = '/app/pages/auth/index'
mode = 'redirectTo'
newLogin = true
}
// #endif
@ -41,12 +45,14 @@ export const redirect = (redirect: any) => {
url = '/app/pages/auth/login'
param = { type: 'username' }
mode = 'redirectTo'
newLogin = true
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile && !config.login.is_auth_register) {
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
return;
} else {
url = '/app/pages/auth/index'
mode = 'redirectTo'
newLogin = true
}
} else {
// 普通浏览器
@ -54,12 +60,14 @@ export const redirect = (redirect: any) => {
url = '/app/pages/auth/login'
param = { type: 'username' }
mode = 'redirectTo'
newLogin = true
} else if (systemStore.initStatus == 'finish' && !config.login.is_username && !config.login.is_mobile) {
uni.showToast({ title: '商家未开启登录注册', icon: 'none' })
return;
} else {
url = '/app/pages/auth/index'
mode = 'redirectTo'
newLogin = true
}
}
// #endif
@ -71,6 +79,10 @@ export const redirect = (redirect: any) => {
mode != 'switchTab' && param && Object.keys(param).length && (url += uni.$u.queryParams(param))
if (newLogin) {
uni.setStorage({ key: 'loginBack', data: { url: originalUrl } });
}
switch (mode) {
case 'switchTab':
uni.switchTab({

View File

@ -95,15 +95,19 @@ const setAddonName = async(path: string) => {
// 加载分享
const loadShare = () => {
const { setShare } = useShare()
// 分享其它页面时,需要设置当前页面为白名单
const shareWhiteList = [
'addon/cms/pages/detail',
'addon/shop/pages/goods/detail',
'addon/shop/pages/point/detail',
'addon/shop_fenxiao/pages/promote_code',
'addon/shop_giftcard/pages/detail',
'addon/shop_giftcard/pages/give',
'app/pages/index/diy',
]
if(!shareWhiteList.includes(currRoute()||'')) setShare()
}
// 分享其它页面时,需要设置当前页面为白名单
const shareWhiteList = [
'addon/cms/pages/detail',
'addon/shop/pages/goods/detail',
'addon/shop/pages/point/detail',
'addon/shop_fenxiao/pages/promote_code',
'addon/shop_fenxiao/pages/goods',
'addon/shop_fenxiao/pages/zone',
'addon/shop_giftcard/pages/detail',
'addon/shop_giftcard/pages/give',
'app/pages/index/diy',
]
if (currRoute()) {
if (!shareWhiteList.includes(currRoute() || '')) setShare()
}
}

View File

@ -59,10 +59,9 @@ class Request {
return this.request('PUT', url, data, config)
}
public delete(url: string, config: RequestConfig = {}) {
return this.request('DELETE', url, {}, config)
public delete(url: string, data: AnyObject = {}, config: RequestConfig = {}) {
return this.request('DELETE', url, data, config)
}
/**
*
*/
@ -109,7 +108,7 @@ class Request {
method
})
if (params.method.toUpperCase() == 'GET') {
if (params.method.toUpperCase() == 'GET' || params.method.toUpperCase() == 'DELETE') {
params.url += '?' + qs.stringify(data);
} else {
params.data = data;

View File

@ -1,5 +1,6 @@
import { ref } from 'vue';
import { onPageScroll } from '@dcloudio/uni-app';
import { deepClone } from '@/utils/common';
export function topTabar() {
@ -31,7 +32,7 @@ export function topTabar() {
param.value[key] = data[key]
}
}
return param.value;
return deepClone(param.value);
}
onPageScroll((e) => {