This commit is contained in:
全栈小学生 2024-12-04 14:37:20 +08:00
parent 70eae71e17
commit 4b78c8b6dd
25 changed files with 433 additions and 398 deletions

View File

@ -49,9 +49,9 @@
<template v-if="component.componentName == 'CarouselSearch'"> <template v-if="component.componentName == 'CarouselSearch'">
<diy-carousel-search :scrollBool="diyGroup.componentsScrollBool.CarouselSearch" :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" /> <diy-carousel-search :scrollBool="diyGroup.componentsScrollBool.CarouselSearch" :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" />
</template> </template>
<template v-if="component.componentName == 'PictureShow'"> <template v-if="component.componentName == 'PictureShow'">
<diy-picture-show :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" /> <diy-picture-show :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" />
</template> </template>
</view> </view>
</view> </view>
<template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch"> <template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch">

View File

@ -34,6 +34,9 @@ export function useDiyGroup(params: any = {}) {
} else { } else {
obj['draggable-element'] = true; obj['draggable-element'] = true;
} }
if(component.componentName == 'ImageAds'){
obj['overflow-hidden'] = true
}
return obj; return obj;
} }

View File

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

View File

@ -37,7 +37,7 @@
<view class="bd flex flex-wrap justify-between"> <view class="bd flex flex-wrap justify-between">
<template v-for="item in diyComponent.list" :key="item.id"> <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="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-[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> <view class="text-[22rpx] text-[#999] pb-[30rpx]">{{ item.subTitle.text }}</view>
@ -55,7 +55,7 @@
</view> </view>
</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="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-[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> <view class="text-[22rpx] text-gray-500 pb-[26rpx]">{{ item.subTitle.text }}</view>
@ -75,7 +75,7 @@
</view> </view>
<scroll-view :scroll-x="true" class="whitespace-nowrap" :id="'warpStyle3-'+diyComponent.id" v-if="diyComponent.blockStyle.value == 'style-3'"> <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 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"> <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" /> <image class="w-[141rpx] h-[141rpx]" :src="img(item.imageUrl)" mode="aspectFit" />
</view> </view>
@ -91,7 +91,7 @@
<scroll-view scroll-x="true" class="whitespace-nowrap" :id="'warpStyle4-'+diyComponent.id" v-if="diyComponent.blockStyle.value == 'style-4'"> <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 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-[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"> <view class="w-[112rpx] h-[102rpx]" v-if="item.imageUrl">
<image class="w-[112rpx] h-[102rpx]" :src="img(item.imageUrl)" mode="aspectFit" /> <image class="w-[112rpx] h-[102rpx]" :src="img(item.imageUrl)" mode="aspectFit" />
@ -205,6 +205,11 @@
}else{ }else{
style += `background:${data.listFrame.startColor || data.listFrame.endColor};`; 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; return style;
} }

View File

@ -29,14 +29,14 @@
<view :style="searchSubTitleCss" class="text-[24rpx] h-[38rpx] flex items-center px-[12rpx] rounded-r-[20rpx] rounded-t-[20rpx] rounded-bl-[2rpx]">{{diyComponent.search.subTitle.text}}</view> <view :style="searchSubTitleCss" class="text-[24rpx] h-[38rpx] flex items-center px-[12rpx] rounded-r-[20rpx] rounded-t-[20rpx] rounded-bl-[2rpx]">{{diyComponent.search.subTitle.text}}</view>
</view> </view>
<view class="flex items-center w-full mt-[16rpx]"> <view class="flex items-center w-full mt-[16rpx]">
<view @click.stop="locationVal.repositionFn()" v-if="systemStore.currShippingAddress" :style="{color: diyComponent.search.positionColor}" class="mr-[30rpx]"> <view @click.stop="locationVal.reposition()" v-if="systemStore.diyAddressInfo" :style="{color: diyComponent.search.positionColor}" class="mr-[30rpx]">
<view class="flex items-baseline font-500"> <view class="flex items-baseline font-500">
<text class="text-[24rpx] mr-[2rpx]">{{systemStore.currShippingAddress.city}}</text> <text class="text-[24rpx] mr-[2rpx]">{{systemStore.diyAddressInfo.city}}</text>
<text class="iconfont iconxiaV6xx !text-[24rpx]"></text> <text class="iconfont iconxiaV6xx !text-[24rpx]"></text>
</view> </view>
<view class="text-[18rpx] mt-[10rpx] truncate max-w-[160rpx]" v-if="systemStore.currShippingAddress.community">{{systemStore.currShippingAddress.community}}</view> <view class="text-[18rpx] mt-[10rpx] truncate max-w-[160rpx]" v-if="systemStore.diyAddressInfo.community">{{systemStore.diyAddressInfo.community}}</view>
</view> </view>
<view @click.stop="locationVal.repositionFn()" class="text-[24rpx] mr-[30rpx] truncate max-w-[160rpx]" :style="{color: diyComponent.search.positionColor}" v-else>{{ systemStore.defaultPositionAddress }}</view> <view @click.stop="locationVal.reposition()" class="text-[24rpx] mr-[30rpx] truncate max-w-[160rpx]" :style="{color: diyComponent.search.positionColor}" v-else>{{ systemStore.defaultPositionAddress }}</view>
<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>
@ -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()"> <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="{ :class="{
'swiper-left': diyComponent.swiper.indicatorAlign == 'left', 'swiper-left': diyComponent.swiper.indicatorAlign == 'left',
'swiper-right': diyComponent.swiper.indicatorAlign == 'right', 'swiper-right': diyComponent.swiper.indicatorAlign == 'right',
@ -146,6 +146,7 @@
import {useLocation} from '@/hooks/useLocation' 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', 'pullDownRefreshCount', 'global', 'scrollBool']); const props = defineProps(['component', 'index', 'pullDownRefreshCount', 'global', 'scrollBool']);
@ -166,7 +167,7 @@
const locationVal = useLocation(isOpenLocation); const locationVal = useLocation(isOpenLocation);
locationVal.onLoad(); locationVal.onLoad();
locationVal.initFn(); locationVal.init();
/************** 定位-end ****************/ /************** 定位-end ****************/
const warpCss = computed(() => { const warpCss = computed(() => {
@ -210,19 +211,28 @@
const fixedStyle = computed(()=>{ const fixedStyle = computed(()=>{
var style = ''; var style = '';
if(diyComponent.value.swiper.swiperStyle == 'style-3'){ 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 // #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;';
} }
if(diyComponent.value.swiper.swiperStyle == 'style-3'){
// h5,
if (systemInfo.platform === 'ios') {
style += 'top: 55px;';
}else{
style += 'top: 44.5px;';
}
}
// #endif // #endif
if (diyStore.mode == 'decorate') return style;
if(diyComponent.value.positionWay == 'fixed') { if(diyComponent.value.positionWay == 'fixed') {
if (props.scrollBool != undefined && props.scrollBool != -1) { 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 // #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
@ -231,6 +241,15 @@
style += 'top:' + diyStore.topTabarHeight + 'px;'; style += 'top:' + diyStore.topTabarHeight + 'px;';
} }
// #endif // #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; fixedStyleBg.value = false;
if (props.scrollBool == 1) { if (props.scrollBool == 1) {
@ -252,8 +271,13 @@
const carouselSwiperStyle = ()=> { const carouselSwiperStyle = ()=> {
let style = ""; let style = "";
if(diyComponent.value.swiper.swiperStyle == 'style-3'){ if(diyComponent.value.swiper.swiperStyle == 'style-3'){
// #ifdef MP // #ifdef H5
style = 'padding-top:' + menuButtonInfo.top + 'px;'; // h5,
if (systemInfo.platform === 'ios') {
style = 'margin-top: -55px;';
}else{
style = 'margin-top: -44.5px;';
}
// #endif // #endif
} }
return style; return style;
@ -384,7 +408,9 @@
} }
// //
// #ifdef H5 // #ifdef H5
isShowDots.value = diyComponent.value.swiper.list.length > 1 ? true : false; isShowDots = computed(() => {
return diyComponent.value?.swiper?.list?.length > 1;
});
// #endif // #endif
// (API) // (API)
@ -406,7 +432,7 @@
const refresh = ()=> { const refresh = ()=> {
setModuleLocation(); setModuleLocation();
// //
locationVal.refreshLocationFn(); locationVal.refresh();
changeData({ source : 'home' },-1) changeData({ source : 'home' },-1)
diyComponent.value.swiper.list.forEach((item : any) => { diyComponent.value.swiper.list.forEach((item : any) => {
@ -474,7 +500,7 @@
// #ifdef H5 // #ifdef H5
isShowDots.value = true; isShowDots.value = true;
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
isShowDots.value = false; isShowDots.value = false;
// #endif // #endif
@ -511,6 +537,12 @@
-webkit-transform: scale(2) translateY(15%); -webkit-transform: scale(2) translateY(15%);
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{ .bg-img-box{
position: absolute; position: absolute;
top: 0; top: 0;

View File

@ -81,39 +81,37 @@
</view> </view>
</view> </view>
<view :style="{width: '98%', margin: '0 auto' }" v-else-if="diyComponent.layout == 'horizontal' && diyComponent.pageCount == 2 && diyComponent.showStyle == 'singleSlide'" :class="['graphic-nav','graphic-nav-' + diyComponent.showStyle]" class="py-[10rpx]"> <view :style="{width: '98%', margin: '0 auto' }" v-else-if="diyComponent.layout == 'horizontal' && diyComponent.pageCount == 2 && diyComponent.showStyle == 'singleSlide'" :class="['graphic-nav multiple-lines','graphic-nav-' + diyComponent.showStyle]" class="py-[10rpx]">
<!-- #ifdef MP --> <!-- #ifdef MP -->
<view class="uni-scroll-view-content"> <view class="uni-scroll-view-content">
<!-- #endif --> <!-- #endif -->
<view :style="horizontalSingleSlideStyle" > <scroll-view class="graphic-nav-wrap whitespace-nowrap" :scroll-x="diyComponent.showStyle == 'singleSlide'" v-for="(numItem, numIndex) in getSlideRowNum()">
<scroll-view class="graphic-nav-wrap flex " :scroll-x="diyComponent.showStyle == 'singleSlide'" :style="horizontalSingleSlideBoxStyle(numIndex)" v-for="(numItem, numIndex) in Math.ceil(diyComponent.list.length / (diyComponent.pageCount * diyComponent.rowCount))"> <template v-for="(item, index) in diyComponent.list" >
<template v-for="(item, index) in diyComponent.list" >
<view v-if="swiperCondition(index,numItem)" @click="diyStore.toRedirect(item.link)" :style="horizontalSingleSlideItemStyle(numIndex)" class="graphic-nav-item flex flex-col items-center box-border py-2 px-[25rpx]"> <view v-if="isShowslideTemp(index,numItem)" @click="diyStore.toRedirect(item.link)" :style="horizontalSingleSlideItemStyle(numIndex)" class="graphic-nav-item inline-flex flex-col items-center box-border py-2">
<view class="graphic-img relative flex items-center justify-center w-10 h-10" <view class="graphic-img relative flex items-center justify-center w-10 h-10"
v-if="diyComponent.mode != 'text'" v-if="diyComponent.mode != 'text'"
:style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }"> :style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }">
<image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="aspectFill" <image v-if="item.imageUrl" :src="img(item.imageUrl)" mode="aspectFill"
:style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }"/> :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }"/>
<image v-else :src="img('static/resource/images/diy/figure.png')" mode="aspectFill" <image v-else :src="img('static/resource/images/diy/figure.png')" mode="aspectFill"
:style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }"/> :style="{ maxWidth: diyComponent.imageSize * 2 + 'rpx', maxHeight: diyComponent.imageSize * 2 + 'rpx', borderRadius: diyComponent.aroundRadius * 2 + 'rpx' }"/>
<text <text
:class="['tag absolute -top-[10rpx] -right-[24rpx] text-white rounded-[24rpx] rounded-bl-none transform scale-80 py-1 px-2 text-xs']" :class="['tag absolute -top-[10rpx] -right-[24rpx] text-white rounded-[24rpx] rounded-bl-none transform scale-80 py-1 px-2 text-xs']"
v-if="item.label.control" v-if="item.label.control"
:style="{ color: item.label.textColor, backgroundImage: 'linear-gradient(' + item.label.bgColorStart + ',' + item.label.bgColorEnd + ')' }"> :style="{ color: item.label.textColor, backgroundImage: 'linear-gradient(' + item.label.bgColorStart + ',' + item.label.bgColorEnd + ')' }">
{{ item.label.text }} {{ item.label.text }}
</text>
</view>
<text v-if="diyComponent.mode != 'img'"
class="graphic-text w-full text-center truncate leading-normal"
:class="{ 'pt-[16rpx]' : diyComponent.mode != 'text' }"
:style="{ fontSize: diyComponent.font.size * 2 + 'rpx', fontWeight: diyComponent.font.weight, color: diyComponent.font.color }">
{{ item.title }}
</text> </text>
</view> </view>
</template> <text v-if="diyComponent.mode != 'img'"
</scroll-view> class="graphic-text w-full text-center truncate leading-normal"
</view> :class="{ 'pt-[16rpx]' : diyComponent.mode != 'text' }"
:style="{ fontSize: diyComponent.font.size * 2 + 'rpx', fontWeight: diyComponent.font.weight, color: diyComponent.font.color }">
{{ item.title }}
</text>
</view>
</template>
</scroll-view>
<!-- #ifdef MP --> <!-- #ifdef MP -->
</view> </view>
<!-- #endif --> <!-- #endif -->
@ -222,45 +220,9 @@
return style; return style;
}); });
//
const horizontalSingleSlideStyle = computed(()=>{
let style = {width: ""};
let widthStr = 100 / diyComponent.value.rowCount; //
let itemLen = (parseInt(diyComponent.value.list.length / (diyComponent.value.rowCount*2))*diyComponent.value.rowCount) + (diyComponent.value.list.length%(diyComponent.value.rowCount*2)); //
let marginLen = diyComponent.value.margin.both*4
style.width = `calc(${widthStr * itemLen}vw - ${marginLen}rpx)`;
return style;
})
const horizontalSingleSlideBoxStyle = (index: any)=>{
let style = {width: ""};
let widthStr = 100 / diyComponent.value.rowCount; //
let marginLen = diyComponent.value.margin.both * 4 / diyComponent.value.rowCount;
if(parseInt(diyComponent.value.list.length / (diyComponent.value.rowCount*2)) >= (index+1)){
style.width = `calc(${widthStr * diyComponent.value.rowCount}vw - ${marginLen*diyComponent.value.rowCount}rpx)`;
}else{
let len = diyComponent.value.list.length%(diyComponent.value.rowCount*2);
if(len > diyComponent.value.rowCount){ //
style.width = `calc(${widthStr * diyComponent.value.rowCount}vw - ${marginLen*diyComponent.value.rowCount}rpx)`;
}else{
style.width = `calc(${widthStr * len}vw - ${marginLen * len}rpx)`; //
}
}
return style;
}
const horizontalSingleSlideItemStyle = (index: any)=>{ const horizontalSingleSlideItemStyle = (index: any)=>{
let style = {width: ""}; let style = {width: ""};
if(parseInt(diyComponent.value.list.length / (diyComponent.value.rowCount*2)) >= (index+1)){ style.width = `${100 / diyComponent.value.rowCount}%`;
style.width = `${100 / diyComponent.value.rowCount}%`;
}else{
let len = diyComponent.value.list.length%(diyComponent.value.rowCount*2);
if(len > diyComponent.value.rowCount){ //
style.width = `${100 / diyComponent.value.rowCount}%`;
}else{
style.width = `${100 / len}%`; //
}
}
return style; return style;
} }
@ -332,6 +294,35 @@
}).exec(); }).exec();
}) })
} }
//
const getSlideRowNum = ()=>{
let num = 1;
if(diyComponent.value.pageCount == 2){
num = diyComponent.value.list.length > diyComponent.value.rowCount ? 2 : 1;
}
return num;
}
const isShowslideTemp = (index, numItem) => {
let result = true;
let indent = index+1;
if(diyComponent.value.pageCount == 2){
let num = Math.ceil(diyComponent.value.list.length / diyComponent.value.rowCount)
for(let i = 1; i <= num; i++){
if(numItem == 1 && (i % 2) != 0){
if(indent > ((i-1)*diyComponent.value.rowCount) && indent <= (i*diyComponent.value.rowCount)){
return true;
}
}
if(numItem == 2 && (i % 2) == 0){
if(indent > ((i-1)*diyComponent.value.rowCount) && indent <= (i*diyComponent.value.rowCount)){
return true;
}
}
}
}
return false;
}
</script> </script>
<style> <style>
@ -340,11 +331,14 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
/* 单行滑动 */ /* 单行滑动 */
.graphic-nav-singleSlide>>>.uni-scroll-view-content { .graphic-nav-singleSlide>>>.uni-scroll-view-content {
display: flex; display: flex;
} }
/* 多行滑动 */
.multiple-lines.graphic-nav-singleSlide>>>.uni-scroll-view-content {
display: block;
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.graphic-nav-indicator-dot{ .graphic-nav-indicator-dot{
@ -357,11 +351,11 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&.left{ &.left{
justify-content: left; justify-content: flex-start;
padding-left: 30rpx; padding-left: 30rpx;
} }
&.right { &.right {
justify-content: right; justify-content: flex-end;
padding-right: 30rpx; padding-right: 30rpx;
} }
.dot{ .dot{

View File

@ -1,7 +1,6 @@
<template> <template>
<view :style="warpCss"> <view :style="warpCss">
<view :style="maskLayer"></view> <view class="diy-image-ads" :style="imageAdsTempStyle()">
<view class="diy-image-ads">
<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"/>
@ -30,6 +29,7 @@
import { img } from '@/utils/common'; import { img } from '@/utils/common';
const props = defineProps(['component', 'index', 'pullDownRefreshCount']); const props = defineProps(['component', 'index', 'pullDownRefreshCount']);
const systemInfo = uni.getSystemInfoSync();
const diyStore = useDiyStore(); const diyStore = useDiyStore();
@ -40,6 +40,22 @@
return props.component; 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
}
return style;
}
const warpCss = computed(() => { const warpCss = computed(() => {
var style = ''; var style = '';
@ -65,23 +81,6 @@
return style; 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( watch(
() => props.pullDownRefreshCount, () => props.pullDownRefreshCount,
(newValue, oldValue) => { (newValue, oldValue) => {
@ -114,9 +113,6 @@
} }
}); });
const instance = getCurrentInstance();
const height = ref(0)
const refresh = () => { const refresh = () => {
// //
if (diyStore.mode == 'decorate') { if (diyStore.mode == 'decorate') {
@ -127,12 +123,6 @@
} }
}); });
} }
nextTick(() => {
const query = uni.createSelectorQuery().in(instance);
query.select('.diy-image-ads').boundingClientRect((data: any) => {
height.value = data.height;
}).exec();
})
} }
</script> </script>

View File

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

View File

@ -1,5 +1,5 @@
<template> <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="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"> <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> <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"> <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> <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>
<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-[10rpx]" @click.stop="agreeChange"> <view class="flex items-center justify-center mt-[28rpx] py-[10rpx]" @click.stop="agreeChange">
<u-checkbox-group @change="agreeChange"> <u-checkbox-group @change="agreeChange">
<u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="24rpx" :customStyle="{ 'marginTop': '4rpx' }" /> <u-checkbox activeColor="var(--primary-color)" :checked="isAgree" shape="circle" size="26rpx" :customStyle="{ 'marginTop': '5rpx !important' }" />
</u-checkbox-group> </u-checkbox-group>
<view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap"> <view class="text-[24rpx] text-[var(--text-color-light6)] flex items-center flex-wrap">
<text>{{ t('agreeTips') }}</text> <text>{{ t('agreeTips') }}</text>
@ -115,7 +114,7 @@
// #endif // #endif
/********* 自定义头部 - start ***********/ /********* 自定义头部 - start ***********/
const topTabarObj = topTabar() const topTabarObj = topTabar()
let param = topTabarObj.setTopTabbarParam({title:''}) 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(menuButtonInfo).length ? pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8)+'rpx':'auto'

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 class="mt-[16rpx] text-[26rpx] line-feed text-[var(--text-color-light9)] leading-[1.4]">{{ item.full_address }}</view>
</view> </view>
<view class="flex justify-between pt-[26rpx]"> <view class="flex justify-between pt-[26rpx]">
<view class="flex items-center text-[28rpx] leading-none" @click.stop="setDefault(index)"> <view class="flex items-center text-[26rpx] 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> <text class="iconfont !text-[26rpx] mr-[10rpx]" :class="{ 'iconduigou text-primary': item.is_default, 'iconcheckbox_nol': !item.is_default }"></text>
设为默认 设为默认
</view> </view>
<view class="flex"> <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 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-[28rpx]"><text class="nc-iconfont nc-icon-shanchu-yuangaizhiV6xx shrink-0 text-[28rpx] 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>
</view> </view>

View File

@ -23,8 +23,7 @@
</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)">
<block v-if="systemStore.siteAddons.includes('recharge')"> <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-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>
<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>
</block> </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" <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> style="background: linear-gradient( 94deg, #FB7939 0%, #FE120E 99%), #EF000C;" @click="applyCashOut">{{t('cashOut')}}</view>
@ -70,10 +69,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive,computed } from 'vue' import { ref, reactive,computed ,watch} from 'vue'
import { t } from '@/locale' import { t } from '@/locale'
import { moneyFormat, redirect, img,pxToRpx } from '@/utils/common'; 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 MescrollBody from '@/components/mescroll/mescroll-body/mescroll-body.vue';
import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue'; import MescrollEmpty from '@/components/mescroll/mescroll-empty/mescroll-empty.vue';
import useMescroll from '@/components/mescroll/hooks/useMescroll.js'; import useMescroll from '@/components/mescroll/hooks/useMescroll.js';
@ -86,13 +85,30 @@
const { downCallback,mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom); const { downCallback,mescrollInit, getMescroll } = useMescroll(onPageScroll, onReachBottom);
const memberStore = useMemberStore() const memberStore = useMemberStore()
const systemStore = useSystemStore() const systemStore = useSystemStore()
/********* 自定义头部 - start ***********/ /********* 自定义头部 - start ***********/
const topTabarObj = topTabar() const topTabarObj = topTabar()
let param = topTabarObj.setTopTabbarParam({title:'我的余额'}) let param = topTabarObj.setTopTabbarParam({title:'我的余额'})
/********* 自定义头部 - end ***********/ /********* 自定义头部 - end ***********/
const cashOutConfigObj: any = reactive({}) 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(() => { onShow(() => {
cashOutConfig().then((res: any) => { cashOutConfig().then((res: any) => {
for (let key in res.data) { 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 = {}; let menuButtonInfo: any = {};
// (API) // (API)

View File

@ -1,7 +1,8 @@
<template> <template>
<u-popup :show="show" @close="show = false" mode="bottom" :round="10" zIndex="10090"> <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="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="px-[var(--popup-sidebar-m)] mb-[20rpx] mt-[10rpx]">
<view class="flex items-center justify-between mb-[30rpx]"> <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> <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] dateList.nowDate = [init().nowDateStart,init().nowDateEnd]
} }
const clearDate = () =>{
emits('confirm',[])
show.value = false
}
defineExpose({ defineExpose({
show show
}) })

View File

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

View File

@ -33,9 +33,9 @@
<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 && isBackShow" class="back-wrap -ml-[16rpx] text-[27px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack"></view> <view v-if="isBack && isBackShow" class="back-wrap -ml-[16rpx] text-[27px] nc-iconfont nc-icon-zuoV6xx" :style="{ color: titleTextColor }" @tap="goBack"></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.repositionFn()" :style="{ color: topStatusBarData.textColor }" v-if="systemStore.currShippingAddress">{{ systemStore.currShippingAddress.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.repositionFn()" :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>
<text class="nc-iconfont nc-icon-youV6xx text-[26rpx]" @click.stop="locationVal.repositionFn()" :style="{ color: topStatusBarData.textColor }"></text> <text class="nc-iconfont nc-icon-youV6xx text-[26rpx]" @click.stop="locationVal.reposition()" :style="{ color: topStatusBarData.textColor }"></text>
</view> </view>
</view> </view>
</view> </view>
@ -47,7 +47,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, getCurrentInstance, nextTick } from 'vue'; import { ref, computed, onMounted, getCurrentInstance, nextTick } from 'vue';
import { img } from '@/utils/common'; import { redirect, img } from '@/utils/common';
import useSystemStore from '@/stores/system'; 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'
@ -183,11 +183,29 @@ let pages = getCurrentPages();
// //
const goBack = () => { const goBack = () => {
// //
if (typeof props.customBack === 'function') { if(pages.length == 1 && pages[0].route == 'app/pages/auth/index'){
props.customBack(); uni.getStorage({
} else { key: 'loginBack',
uni.navigateBack(); 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 {
uni.navigateBack();
}
} }
} }
/******************************* 返回按钮-end ***********************/ /******************************* 返回按钮-end ***********************/
@ -223,21 +241,24 @@ const navbarPlaceholderHeight = () => {
const locationVal = useLocation(isOpenLocation); const locationVal = useLocation(isOpenLocation);
locationVal.onLoad(); locationVal.onLoad();
locationVal.initFn(); locationVal.init();
/************** 定位-end ****************/ /************** 定位-end ****************/
onMounted(() => { onMounted(() => {
navbarPlaceholderHeight(); navbarPlaceholderHeight();
if (pages.length > 1) { if (pages.length > 1) {
isBackShow.value = true; isBackShow.value = true;
//
}else if(pages.length == 1 && pages[0].route == 'app/pages/auth/index'){
isBackShow.value = true;
} }
// //
locationVal.refreshLocationFn(); locationVal.refresh();
}); });
// onShow // onShow
const refresh = ()=>{ const refresh = ()=>{
// //
locationVal.refreshLocationFn(); locationVal.refresh();
} }
defineExpose({ defineExpose({

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 });`; 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){
style += 'min-height:calc(100vh - 50px);'; style += 'min-height:calc(100vh - 50px);';
}else{
style += 'min-height:calc(100vh);';
}
if (data.value.global.bgUrl) { if (data.value.global.bgUrl) {
style += `background-image:url('${ img(data.value.global.bgUrl) }');`; style += `background-image:url('${ img(data.value.global.bgUrl) }');`;
} }

View File

@ -2,7 +2,6 @@ import { onLoad } from '@dcloudio/uni-app';
import { isWeixinBrowser } from '@/utils/common'; import { isWeixinBrowser } from '@/utils/common';
import { getAddressByLatlng } from '@/app/api/system'; import { getAddressByLatlng } from '@/app/api/system';
import manifestJson from '@/manifest.json'; import manifestJson from '@/manifest.json';
import { cloneDeep } from 'lodash-es';
import wechat from '@/utils/wechat' import wechat from '@/utils/wechat'
import useSystemStore from '@/stores/system'; import useSystemStore from '@/stores/system';
@ -19,18 +18,7 @@ export function useLocation(isOpenLocation: any) {
const onLoadLifeCycle = (callback: any = '') => { const onLoadLifeCycle = (callback: any = '') => {
onLoad((option: any) => { onLoad((option: any) => {
if (option && option.latng) { if (option && option.latng) {
let obj = { latitude: '', longitude: '' }; getAddressByLatlngFn(option.latng)
obj.latitude = option.latng.split(',')[0]
obj.longitude = option.latng.split(',')[1]
var urlencode = cloneDeep(systemStore.location) || {};
urlencode = Object.assign(urlencode, obj)
systemStore.setLocation(urlencode);
if (urlencode && urlencode.latitude && urlencode.longitude) {
getAddressByLatlngFn('')
} else {
systemStore.setCurrShippingAddress('');
}
} }
uni.removeStorageSync('manually_select_location_from_map'); uni.removeStorageSync('manually_select_location_from_map');
@ -43,19 +31,19 @@ export function useLocation(isOpenLocation: any) {
// 排除手动地图选择位置的情况 // 排除手动地图选择位置的情况
if (!uni.getStorageSync('manually_select_location_from_map')) { if (!uni.getStorageSync('manually_select_location_from_map')) {
// #ifdef H5 // #ifdef H5
if (isWeixinBrowser() && systemStore.mapConfig.is_open&& !uni.getStorageSync('curr_shipping_address')) { if (isWeixinBrowser() && systemStore.mapConfig.is_open && !uni.getStorageSync('location_address')) {
wechat.init(()=>{ wechat.init(()=>{
wechat.getLocation(res => { wechat.getLocation(res => {
let latlng = res.latitude + ',' + res.longitude; // 纬度浮点数范围为90 ~ -90经度浮点数范围为180 ~ -180 let latlng = res.latitude + ',' + res.longitude; // 纬度浮点数范围为90 ~ -90经度浮点数范围为180 ~ -180
getAddressByLatlngFn(latlng) getAddressByLatlngFn(latlng)
}) })
}); });
} }
// #endif // #endif
// #ifdef MP // #ifdef MP
if (systemStore.mapConfig.is_open && !uni.getStorageSync('curr_shipping_address')) { if (systemStore.mapConfig.is_open && !uni.getStorageSync('location_address')) {
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: res => { success: res => {
@ -91,13 +79,13 @@ export function useLocation(isOpenLocation: any) {
// 刷新页面时需要调用的 // 刷新页面时需要调用的
const refreshLocation = () => { const refreshLocation = () => {
if (!isOpen) return false; if (!isOpen) return false;
if (!uni.getStorageSync('manually_select_location_from_map') && uni.getStorageSync('curr_shipping_address')) { if (!uni.getStorageSync('manually_select_location_from_map') && uni.getStorageSync('location_address')) {
if(locationStorage() && !locationStorage().is_expired){ if(locationStorage() && !locationStorage().is_expired){
systemStore.setCurrShippingAddress(uni.getStorageSync('curr_shipping_address')) systemStore.setAddressInfo(uni.getStorageSync('location_address'))
}else{ }else{
uni.removeStorageSync('curr_shipping_address'); uni.removeStorageSync('location_address');
} }
} }
// 定位信息过期后,重新获取定位 // 定位信息过期后,重新获取定位
@ -112,21 +100,17 @@ export function useLocation(isOpenLocation: any) {
let data = { latlng: '' }; let data = { latlng: '' };
if (latlng) { if (latlng) {
data.latlng = latlng; data.latlng = latlng;
let obj = { latitude: '', longitude: '' };
obj.latitude = data.latlng.split(',')[0]
obj.longitude = data.latlng.split(',')[1]
var urlencode = cloneDeep(systemStore.location) || {};
urlencode = Object.assign(urlencode, obj)
systemStore.setLocation(urlencode);
} else { } else {
data.latlng = systemStore.location.latitude + ',' + systemStore.location.longitude; data.latlng = systemStore.diyAddressInfo.latitude + ',' + systemStore.diyAddressInfo.longitude;
} }
getAddressByLatlng(data).then((res: any) => { getAddressByLatlng(data).then((res: any) => {
if (res.data && Object.keys(res.data).length) { if (res.data && Object.keys(res.data).length) {
let obj: any = {}; let obj: any = {};
obj.latitude = res.latitude;
obj.longitude = res.longitude; let latlngArr = data.latlng.split(',');
obj.latitude = latlngArr[0];
obj.longitude = latlngArr[1];
obj.full_address = res.data.province != undefined ? res.data.province : ''; obj.full_address = res.data.province != undefined ? res.data.province : '';
obj.full_address += res.data.city != undefined ? res.data.city : ''; obj.full_address += res.data.city != undefined ? res.data.city : '';
obj.full_address += res.data.district != undefined ? res.data.district : ''; obj.full_address += res.data.district != undefined ? res.data.district : '';
@ -140,9 +124,9 @@ export function useLocation(isOpenLocation: any) {
obj.district = res.data.district; obj.district = res.data.district;
obj.community = res.data.community; obj.community = res.data.community;
obj.formatted_addresses = res.data.formatted_addresses; obj.formatted_addresses = res.data.formatted_addresses;
systemStore.setCurrShippingAddress(obj) systemStore.setAddressInfo(obj)
} else { } else {
systemStore.setCurrShippingAddress("") systemStore.setAddressInfo()
} }
// 手动选择地图位置后,清除标识 // 手动选择地图位置后,清除标识
@ -158,8 +142,8 @@ export function useLocation(isOpenLocation: any) {
const reposition = () => { const reposition = () => {
if (!isOpen) return false; if (!isOpen) return false;
let latitude = systemStore.location ? systemStore.location.latitude : ''; let latitude = systemStore.diyAddressInfo ? systemStore.diyAddressInfo.latitude : '';
let longitude = systemStore.location ? systemStore.location.longitude : ''; let longitude = systemStore.diyAddressInfo ? systemStore.diyAddressInfo.longitude : '';
// #ifdef MP // #ifdef MP
uni.chooseLocation({ uni.chooseLocation({
@ -167,14 +151,8 @@ export function useLocation(isOpenLocation: any) {
longitude, longitude,
success: (res) => { success: (res) => {
uni.setStorageSync('manually_select_location_from_map', true) uni.setStorageSync('manually_select_location_from_map', true)
var urlencode = cloneDeep(systemStore.location) || {}; let latng = res.latitude + ',' + res.longitude;
urlencode = Object.assign(urlencode, res) getAddressByLatlngFn(latng)
systemStore.setLocation(urlencode);
if (urlencode && urlencode.latitude && urlencode.longitude) {
getAddressByLatlngFn('')
} else {
systemStore.setCurrShippingAddress('');
}
}, },
fail: (res) => { fail: (res) => {
// 在隐私协议中没有声明chooseLocation:fail api作用域 // 在隐私协议中没有声明chooseLocation:fail api作用域
@ -204,7 +182,7 @@ export function useLocation(isOpenLocation: any) {
* *
*/ */
const locationStorage = () => { const locationStorage = () => {
let data = uni.getStorageSync('location'); let data = uni.getStorageSync('location_address');
if (data) { if (data) {
var date = new Date(); var date = new Date();
if (systemStore.mapConfig.valid_time > 0) { if (systemStore.mapConfig.valid_time > 0) {
@ -221,9 +199,9 @@ export function useLocation(isOpenLocation: any) {
} }
return { return {
initFn: init, init: init,
onLoad: onLoadLifeCycle, onLoad: onLoadLifeCycle,
refreshLocationFn: refreshLocation, refresh: refreshLocation,
repositionFn: reposition reposition: reposition
} }
} }

View File

@ -61,26 +61,33 @@ export const useShare = () => {
} }
// #endif // #endif
if (options && options.wechat && options.weapp) { if (options) {
// #ifdef H5 if (options.wechat) {
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
// #ifdef MP-WEIXIN // #ifdef H5
weappOptions.title = options.weapp.title || '' wechatOptions.title = options.wechat.title || ''
if (options.weapp.path) weappOptions.path = options.weapp.path wechatOptions.link = options.wechat.link || h5Link
weappOptions.imageUrl = options.weapp.url ? img(options.weapp.url) : '' wechatOptions.desc = options.wechat.desc || ''
useSystemStore().shareCallback = options.weapp.callback || null; wechatOptions.imgUrl = options.wechat.url ? img(options.wechat.url) : ''
// #endif // 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 { } else {
getShareInfo({ getShareInfo({
route: '/' + currRoute(), route: '/' + currRoute(),

View File

@ -36,100 +36,5 @@
"pages.verify.verify": "核销", "pages.verify.verify": "核销",
"pages.verify.detail": "核销详情", "pages.verify.detail": "核销详情",
"pages.verify.record": "核销记录", "pages.verify.record": "核销记录",
"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.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": "待付款订单"
} }

View File

@ -3,19 +3,19 @@ import { getInitInfo, getSiteInfo } 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'
import { cloneDeep } from 'lodash-es';
interface System { interface System {
site: AnyObject | null, site: AnyObject | null,
siteApps: string[], siteApps: string[],
siteAddons: string[], siteAddons: string[],
currRoute: string, currRoute: string,
location: Object | null, // 定位信息
mapConfig: any, mapConfig: any,
initStatus: any, // 初始化状态 initStatus: any, // 初始化状态
menuButtonInfo: any, // 如果是小程序,获取右上角胶囊的尺寸信息 menuButtonInfo: any, // 如果是小程序,获取右上角胶囊的尺寸信息
shareCallback: any, // 分享回调 shareCallback: any, // 分享回调
currShippingAddress: any, defaultPositionAddress:any,
defaultPositionAddress:any diyAddressInfo: any // 定位信息
} }
const useSystemStore = defineStore('system', { const useSystemStore = defineStore('system', {
@ -25,7 +25,6 @@ const useSystemStore = defineStore('system', {
siteApps: [], siteApps: [],
siteAddons: [], siteAddons: [],
currRoute: '', currRoute: '',
location: null,
mapConfig: { mapConfig: {
is_open: 1, is_open: 1,
valid_time: 0 valid_time: 0
@ -38,8 +37,8 @@ const useSystemStore = defineStore('system', {
width: '' width: ''
}, },
shareCallback: null, shareCallback: null,
currShippingAddress: null, defaultPositionAddress:'定位中',
defaultPositionAddress:'定位中' diyAddressInfo: null
} }
}, },
actions: { actions: {
@ -114,20 +113,24 @@ const useSystemStore = defineStore('system', {
}).catch((err) => { }).catch((err) => {
}) })
}, },
setLocation(value: any) { // 当前选择的收货地址信息[经纬度,当前定位地址,定位过期时间]
var date = new Date(); setAddressInfo(data:any = {}) {
date.setSeconds(60 * this.mapConfig.valid_time); let addressInfo = cloneDeep(data);
value.valid_time = date.getTime() / 1000; // 定位信息 5分钟内有效过期后将重新获取定位信息 // 过期时间
this.location = value; var date = new Date();
uni.setStorageSync('location', value); // 初始化数据调用 date.setSeconds(60 * this.mapConfig.valid_time);
}, addressInfo.valid_time = date.getTime() / 1000; // 定位信息 5分钟内有效过期后将重新获取定位信息
// 当前选择的收货地址信息
setCurrShippingAddress(value:any) { if(this.diyAddressInfo){
this.currShippingAddress = value; this.diyAddressInfo = Object.assign(this.diyAddressInfo, addressInfo);
if(value){
uni.setStorageSync('curr_shipping_address', value);
}else{ }else{
uni.removeStorageSync('curr_shipping_address'); this.diyAddressInfo = addressInfo;
}
if(Object.keys(data).length){
uni.setStorageSync('location_address', addressInfo);
}else{
uni.removeStorageSync('location_address');
} }
} }
} }

View File

@ -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_upzww1i5qjn.woff2?t=1731549702579') format('woff2'), src: url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.woff2?t=1732704100572') format('woff2'),
url('//at.alicdn.com/t/c/font_4567203_upzww1i5qjn.woff?t=1731549702579') format('woff'), url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.woff?t=1732704100572') format('woff'),
url('//at.alicdn.com/t/c/font_4567203_upzww1i5qjn.ttf?t=1731549702579') format('truetype'); url('//at.alicdn.com/t/c/font_4567203_unxj5bqsj6o.ttf?t=1732704100572') format('truetype');
} }
.nc-iconfont { .nc-iconfont {
@ -13,6 +13,46 @@
-moz-osx-font-smoothing: grayscale; -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 { .nc-icon-gouwuche1:before {
content: "\e76e"; content: "\e76e";
} }

View File

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

View File

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

View File

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

View File

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