mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-12 09:57:20 +00:00
up
This commit is contained in:
parent
70eae71e17
commit
4b78c8b6dd
@ -49,9 +49,9 @@
|
||||
<template v-if="component.componentName == 'CarouselSearch'">
|
||||
<diy-carousel-search :scrollBool="diyGroup.componentsScrollBool.CarouselSearch" :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'PictureShow'">
|
||||
<diy-picture-show :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" />
|
||||
</template>
|
||||
<template v-if="component.componentName == 'PictureShow'">
|
||||
<diy-picture-show :component="component" :global="data.global" :index="index" :pullDownRefreshCount="props.pullDownRefreshCount" />
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch">
|
||||
|
||||
@ -34,6 +34,9 @@ export function useDiyGroup(params: any = {}) {
|
||||
} else {
|
||||
obj['draggable-element'] = true;
|
||||
}
|
||||
if(component.componentName == 'ImageAds'){
|
||||
obj['overflow-hidden'] = true
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@ -249,4 +249,11 @@ export function getMemberAccountPointcount() {
|
||||
*/
|
||||
export function getTaskPoint() {
|
||||
return request.get(`task/point`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值配置
|
||||
*/
|
||||
export function rechargeConfig() {
|
||||
return request.get('recharge/config')
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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>
|
||||
<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">
|
||||
<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>
|
||||
</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 @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)">
|
||||
<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()">
|
||||
<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']);
|
||||
@ -166,7 +167,7 @@
|
||||
|
||||
const locationVal = useLocation(isOpenLocation);
|
||||
locationVal.onLoad();
|
||||
locationVal.initFn();
|
||||
locationVal.init();
|
||||
/************** 定位-end ****************/
|
||||
|
||||
const warpCss = computed(() => {
|
||||
@ -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,尚未兼容)
|
||||
@ -406,7 +432,7 @@
|
||||
const refresh = ()=> {
|
||||
setModuleLocation();
|
||||
// 刷新定位
|
||||
locationVal.refreshLocationFn();
|
||||
locationVal.refresh();
|
||||
|
||||
changeData({ source : 'home' },-1)
|
||||
diyComponent.value.swiper.list.forEach((item : any) => {
|
||||
@ -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;
|
||||
|
||||
@ -81,39 +81,37 @@
|
||||
</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 -->
|
||||
<view class="uni-scroll-view-content">
|
||||
<!-- #endif -->
|
||||
<view :style="horizontalSingleSlideStyle" >
|
||||
<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" >
|
||||
<scroll-view class="graphic-nav-wrap whitespace-nowrap" :scroll-x="diyComponent.showStyle == 'singleSlide'" v-for="(numItem, numIndex) in getSlideRowNum()">
|
||||
<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 class="graphic-img relative flex items-center justify-center w-10 h-10"
|
||||
v-if="diyComponent.mode != 'text'"
|
||||
:style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }">
|
||||
<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' }"/>
|
||||
<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' }"/>
|
||||
<text
|
||||
: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"
|
||||
:style="{ color: item.label.textColor, backgroundImage: 'linear-gradient(' + item.label.bgColorStart + ',' + item.label.bgColorEnd + ')' }">
|
||||
{{ 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 }}
|
||||
<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"
|
||||
v-if="diyComponent.mode != 'text'"
|
||||
:style="{ width: diyComponent.imageSize * 2 + 'rpx', height: diyComponent.imageSize * 2 + 'rpx' }">
|
||||
<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' }"/>
|
||||
<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' }"/>
|
||||
<text
|
||||
: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"
|
||||
:style="{ color: item.label.textColor, backgroundImage: 'linear-gradient(' + item.label.bgColorStart + ',' + item.label.bgColorEnd + ')' }">
|
||||
{{ item.label.text }}
|
||||
</text>
|
||||
</view>
|
||||
</template>
|
||||
</scroll-view>
|
||||
</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>
|
||||
</view>
|
||||
</template>
|
||||
</scroll-view>
|
||||
<!-- #ifdef MP -->
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@ -222,45 +220,9 @@
|
||||
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)=>{
|
||||
let style = {width: ""};
|
||||
if(parseInt(diyComponent.value.list.length / (diyComponent.value.rowCount*2)) >= (index+1)){
|
||||
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}%`; // 未满足了一行
|
||||
}
|
||||
}
|
||||
style.width = `${100 / diyComponent.value.rowCount}%`;
|
||||
return style;
|
||||
}
|
||||
|
||||
@ -332,6 +294,35 @@
|
||||
}).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>
|
||||
|
||||
<style>
|
||||
@ -340,11 +331,14 @@
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* 单行滑动 */
|
||||
.graphic-nav-singleSlide>>>.uni-scroll-view-content {
|
||||
display: flex;
|
||||
}
|
||||
/* 多行滑动 */
|
||||
.multiple-lines.graphic-nav-singleSlide>>>.uni-scroll-view-content {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.graphic-nav-indicator-dot{
|
||||
@ -357,11 +351,11 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
&.left{
|
||||
justify-content: left;
|
||||
justify-content: flex-start;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
&.right {
|
||||
justify-content: right;
|
||||
justify-content: flex-end;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
.dot{
|
||||
|
||||
@ -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,22 @@
|
||||
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(() => {
|
||||
var style = '';
|
||||
@ -65,23 +81,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 +113,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
const height = ref(0)
|
||||
|
||||
const refresh = () => {
|
||||
// 装修模式下设置默认图
|
||||
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>
|
||||
|
||||
|
||||
@ -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;
|
||||
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;
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
@ -115,7 +114,7 @@
|
||||
// #endif
|
||||
/********* 自定义头部 - start ***********/
|
||||
const topTabarObj = topTabar()
|
||||
let param = topTabarObj.setTopTabbarParam({title:''})
|
||||
let param = topTabarObj.setTopTabbarParam({title:'',topStatusBar:{textColor: '#333'}})
|
||||
/********* 自定义头部 - end ***********/
|
||||
const headerHeight = computed(()=>{
|
||||
return Object.keys(menuButtonInfo).length ? pxToRpx(Number(menuButtonInfo.height)) + pxToRpx(menuButtonInfo.top) + pxToRpx(8)+'rpx':'auto'
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -23,8 +23,7 @@
|
||||
</view>
|
||||
<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')">
|
||||
<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,尚未兼容)
|
||||
|
||||
@ -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
|
||||
})
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
<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>
|
||||
<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.repositionFn()" :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>
|
||||
<view class="title-wrap" @click.stop="locationVal.reposition()" :style="{ color: topStatusBarData.textColor }" v-if="systemStore.diyAddressInfo">{{ systemStore.diyAddressInfo.community }}</view>
|
||||
<view class="title-wrap" @click.stop="locationVal.reposition()" :style="{ color: topStatusBarData.textColor }" v-else>{{ systemStore.defaultPositionAddress }}</view>
|
||||
<text class="nc-iconfont nc-icon-youV6xx text-[26rpx]" @click.stop="locationVal.reposition()" :style="{ color: topStatusBarData.textColor }"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
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 useDiyStore from '@/app/stores/diy';
|
||||
import {useLocation} from '@/hooks/useLocation'
|
||||
@ -183,11 +183,29 @@ let pages = getCurrentPages();
|
||||
|
||||
// 返回按钮的函数
|
||||
const goBack = () => {
|
||||
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
||||
if (typeof props.customBack === 'function') {
|
||||
props.customBack();
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
// 兼容小程序,未登录状态下点击某个功能跳转到登录页,不登录无法返回的情况
|
||||
if(pages.length == 1 && pages[0].route == 'app/pages/auth/index'){
|
||||
uni.getStorage({
|
||||
key: 'loginBack',
|
||||
success: (res: any) => {
|
||||
res ? redirect(
|
||||
{
|
||||
...res.data,
|
||||
mode: 'redirectTo'
|
||||
}
|
||||
) : redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||
},
|
||||
fail: (res) => {
|
||||
redirect({ url: '/app/pages/index/index', mode: 'switchTab' })
|
||||
}
|
||||
})
|
||||
}else{
|
||||
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
||||
if (typeof props.customBack === 'function') {
|
||||
props.customBack();
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
/******************************* 返回按钮-end ***********************/
|
||||
@ -223,21 +241,24 @@ const navbarPlaceholderHeight = () => {
|
||||
|
||||
const locationVal = useLocation(isOpenLocation);
|
||||
locationVal.onLoad();
|
||||
locationVal.initFn();
|
||||
locationVal.init();
|
||||
/************** 定位-end ****************/
|
||||
onMounted(() => {
|
||||
navbarPlaceholderHeight();
|
||||
if (pages.length > 1) {
|
||||
isBackShow.value = true;
|
||||
// 兼容小程序,未登录状态下点击某个功能跳转到登录页,不登录无法返回的情况
|
||||
}else if(pages.length == 1 && pages[0].route == 'app/pages/auth/index'){
|
||||
isBackShow.value = true;
|
||||
}
|
||||
// 刷新定位
|
||||
locationVal.refreshLocationFn();
|
||||
locationVal.refresh();
|
||||
});
|
||||
|
||||
// 页面onShow调用时,也会触发改方法
|
||||
const refresh = ()=>{
|
||||
// 刷新定位
|
||||
locationVal.refreshLocationFn();
|
||||
locationVal.refresh();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
||||
@ -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) }');`;
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ import { onLoad } from '@dcloudio/uni-app';
|
||||
import { isWeixinBrowser } from '@/utils/common';
|
||||
import { getAddressByLatlng } from '@/app/api/system';
|
||||
import manifestJson from '@/manifest.json';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import wechat from '@/utils/wechat'
|
||||
import useSystemStore from '@/stores/system';
|
||||
|
||||
@ -19,18 +18,7 @@ export function useLocation(isOpenLocation: any) {
|
||||
const onLoadLifeCycle = (callback: any = '') => {
|
||||
onLoad((option: any) => {
|
||||
if (option && option.latng) {
|
||||
let obj = { latitude: '', longitude: '' };
|
||||
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('');
|
||||
}
|
||||
getAddressByLatlngFn(option.latng)
|
||||
}
|
||||
|
||||
uni.removeStorageSync('manually_select_location_from_map');
|
||||
@ -43,19 +31,19 @@ export function useLocation(isOpenLocation: any) {
|
||||
// 排除手动地图选择位置的情况
|
||||
if (!uni.getStorageSync('manually_select_location_from_map')) {
|
||||
// #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.getLocation(res => {
|
||||
let latlng = res.latitude + ',' + res.longitude; // 纬度(浮点数,范围为90 ~ -90),经度(浮点数,范围为180 ~ -180)
|
||||
getAddressByLatlngFn(latlng)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
if (systemStore.mapConfig.is_open && !uni.getStorageSync('curr_shipping_address')) {
|
||||
if (systemStore.mapConfig.is_open && !uni.getStorageSync('location_address')) {
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: res => {
|
||||
@ -91,13 +79,13 @@ export function useLocation(isOpenLocation: any) {
|
||||
// 刷新页面时需要调用的
|
||||
const refreshLocation = () => {
|
||||
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){
|
||||
systemStore.setCurrShippingAddress(uni.getStorageSync('curr_shipping_address'))
|
||||
systemStore.setAddressInfo(uni.getStorageSync('location_address'))
|
||||
}else{
|
||||
uni.removeStorageSync('curr_shipping_address');
|
||||
uni.removeStorageSync('location_address');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 定位信息过期后,重新获取定位
|
||||
@ -112,21 +100,17 @@ export function useLocation(isOpenLocation: any) {
|
||||
let data = { latlng: '' };
|
||||
if (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 {
|
||||
data.latlng = systemStore.location.latitude + ',' + systemStore.location.longitude;
|
||||
data.latlng = systemStore.diyAddressInfo.latitude + ',' + systemStore.diyAddressInfo.longitude;
|
||||
}
|
||||
getAddressByLatlng(data).then((res: any) => {
|
||||
if (res.data && Object.keys(res.data).length) {
|
||||
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.city != undefined ? res.data.city : '';
|
||||
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.community = res.data.community;
|
||||
obj.formatted_addresses = res.data.formatted_addresses;
|
||||
systemStore.setCurrShippingAddress(obj)
|
||||
systemStore.setAddressInfo(obj)
|
||||
} else {
|
||||
systemStore.setCurrShippingAddress("")
|
||||
systemStore.setAddressInfo()
|
||||
}
|
||||
|
||||
// 手动选择地图位置后,清除标识
|
||||
@ -158,8 +142,8 @@ export function useLocation(isOpenLocation: any) {
|
||||
const reposition = () => {
|
||||
if (!isOpen) return false;
|
||||
|
||||
let latitude = systemStore.location ? systemStore.location.latitude : '';
|
||||
let longitude = systemStore.location ? systemStore.location.longitude : '';
|
||||
let latitude = systemStore.diyAddressInfo ? systemStore.diyAddressInfo.latitude : '';
|
||||
let longitude = systemStore.diyAddressInfo ? systemStore.diyAddressInfo.longitude : '';
|
||||
|
||||
// #ifdef MP
|
||||
uni.chooseLocation({
|
||||
@ -167,14 +151,8 @@ export function useLocation(isOpenLocation: any) {
|
||||
longitude,
|
||||
success: (res) => {
|
||||
uni.setStorageSync('manually_select_location_from_map', true)
|
||||
var urlencode = cloneDeep(systemStore.location) || {};
|
||||
urlencode = Object.assign(urlencode, res)
|
||||
systemStore.setLocation(urlencode);
|
||||
if (urlencode && urlencode.latitude && urlencode.longitude) {
|
||||
getAddressByLatlngFn('')
|
||||
} else {
|
||||
systemStore.setCurrShippingAddress('');
|
||||
}
|
||||
let latng = res.latitude + ',' + res.longitude;
|
||||
getAddressByLatlngFn(latng)
|
||||
},
|
||||
fail: (res) => {
|
||||
// 在隐私协议中没有声明chooseLocation:fail api作用域
|
||||
@ -204,7 +182,7 @@ export function useLocation(isOpenLocation: any) {
|
||||
* 定位信息(缓存)
|
||||
*/
|
||||
const locationStorage = () => {
|
||||
let data = uni.getStorageSync('location');
|
||||
let data = uni.getStorageSync('location_address');
|
||||
if (data) {
|
||||
var date = new Date();
|
||||
if (systemStore.mapConfig.valid_time > 0) {
|
||||
@ -221,9 +199,9 @@ export function useLocation(isOpenLocation: any) {
|
||||
}
|
||||
|
||||
return {
|
||||
initFn: init,
|
||||
init: init,
|
||||
onLoad: onLoadLifeCycle,
|
||||
refreshLocationFn: refreshLocation,
|
||||
repositionFn: reposition
|
||||
refresh: refreshLocation,
|
||||
reposition: reposition
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,26 +61,33 @@ export const useShare = () => {
|
||||
}
|
||||
// #endif
|
||||
|
||||
if (options && options.wechat && options.weapp) {
|
||||
if (options) {
|
||||
|
||||
// #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(),
|
||||
|
||||
@ -36,100 +36,5 @@
|
||||
"pages.verify.verify": "核销",
|
||||
"pages.verify.detail": "核销详情",
|
||||
"pages.verify.record": "核销记录",
|
||||
"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": "待付款订单"
|
||||
"pages.webview.index": ""
|
||||
}
|
||||
|
||||
@ -3,19 +3,19 @@ import { getInitInfo, getSiteInfo } from '@/app/api/system'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import { isWeixinBrowser } from '@/utils/common'
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
interface System {
|
||||
site: AnyObject | null,
|
||||
siteApps: string[],
|
||||
siteAddons: string[],
|
||||
currRoute: string,
|
||||
location: Object | null, // 定位信息
|
||||
mapConfig: any,
|
||||
initStatus: any, // 初始化状态
|
||||
menuButtonInfo: any, // 如果是小程序,获取右上角胶囊的尺寸信息
|
||||
shareCallback: any, // 分享回调
|
||||
currShippingAddress: any,
|
||||
defaultPositionAddress:any
|
||||
defaultPositionAddress:any,
|
||||
diyAddressInfo: any // 定位信息
|
||||
}
|
||||
|
||||
const useSystemStore = defineStore('system', {
|
||||
@ -25,7 +25,6 @@ const useSystemStore = defineStore('system', {
|
||||
siteApps: [],
|
||||
siteAddons: [],
|
||||
currRoute: '',
|
||||
location: null,
|
||||
mapConfig: {
|
||||
is_open: 1,
|
||||
valid_time: 0
|
||||
@ -38,8 +37,8 @@ const useSystemStore = defineStore('system', {
|
||||
width: ''
|
||||
},
|
||||
shareCallback: null,
|
||||
currShippingAddress: null,
|
||||
defaultPositionAddress:'定位中'
|
||||
defaultPositionAddress:'定位中',
|
||||
diyAddressInfo: null
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@ -114,20 +113,24 @@ const useSystemStore = defineStore('system', {
|
||||
}).catch((err) => {
|
||||
})
|
||||
},
|
||||
setLocation(value: any) {
|
||||
var date = new Date();
|
||||
date.setSeconds(60 * this.mapConfig.valid_time);
|
||||
value.valid_time = date.getTime() / 1000; // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||
this.location = value;
|
||||
uni.setStorageSync('location', value); // 初始化数据调用
|
||||
},
|
||||
// 当前选择的收货地址信息
|
||||
setCurrShippingAddress(value:any) {
|
||||
this.currShippingAddress = value;
|
||||
if(value){
|
||||
uni.setStorageSync('curr_shipping_address', value);
|
||||
// 当前选择的收货地址信息[经纬度,当前定位地址,定位过期时间]
|
||||
setAddressInfo(data:any = {}) {
|
||||
let addressInfo = cloneDeep(data);
|
||||
// 过期时间
|
||||
var date = new Date();
|
||||
date.setSeconds(60 * this.mapConfig.valid_time);
|
||||
addressInfo.valid_time = date.getTime() / 1000; // 定位信息 5分钟内有效,过期后将重新获取定位信息
|
||||
|
||||
if(this.diyAddressInfo){
|
||||
this.diyAddressInfo = Object.assign(this.diyAddressInfo, addressInfo);
|
||||
}else{
|
||||
uni.removeStorageSync('curr_shipping_address');
|
||||
this.diyAddressInfo = addressInfo;
|
||||
}
|
||||
|
||||
if(Object.keys(data).length){
|
||||
uni.setStorageSync('location_address', addressInfo);
|
||||
}else{
|
||||
uni.removeStorageSync('location_address');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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";
|
||||
}
|
||||
|
||||
@ -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({
|
||||
@ -550,4 +562,4 @@ export function goback(data: any) {
|
||||
});
|
||||
}
|
||||
}, 600);
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,15 +123,18 @@ 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_giftcard/pages/detail',
|
||||
'addon/shop_giftcard/pages/give',
|
||||
'app/pages/index/diy',
|
||||
]
|
||||
if (currRoute()) {
|
||||
if (!shareWhiteList.includes(currRoute() || '')) setShare()
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,10 +69,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)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送上传请求
|
||||
*/
|
||||
@ -119,7 +118,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;
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user