This commit is contained in:
全栈小学生 2023-05-31 11:34:01 +08:00
parent f0bb684b44
commit 89abab8153
29 changed files with 704 additions and 559 deletions

View File

@ -5,6 +5,7 @@
import { getToken, isWeixinBrowser, urlDeconstruction } from '@/utils/common' import { getToken, isWeixinBrowser, urlDeconstruction } from '@/utils/common'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import useConfigStore from '@/stores/config' import useConfigStore from '@/stores/config'
import useSystemStore from '@/stores/system'
import { useLogin } from '@/hooks/useLogin' import { useLogin } from '@/hooks/useLogin'
import { language } from '@/locale' import { language } from '@/locale'
@ -25,6 +26,8 @@
const configStore = useConfigStore() const configStore = useConfigStore()
configStore.getTabbarConfig() configStore.getTabbarConfig()
await configStore.getLoginConfig() await configStore.getLoginConfig()
useSystemStore().getSitenfo()
// tabbar // tabbar
uni.hideTabBar() uni.hideTabBar()

View File

@ -32,7 +32,7 @@ export function getAgreementInfo(key : string) {
* *
*/ */
export function resetPassword(data : AnyObject) { export function resetPassword(data : AnyObject) {
return request.post(`/password/reset`, data, { showErrorMessage: true }) return request.post(`password/reset`, data, { showErrorMessage: true })
} }
/** /**
@ -68,4 +68,11 @@ export function fetchImage(data : AnyObject) {
*/ */
export function fetchBase64Image(data : AnyObject) { export function fetchBase64Image(data : AnyObject) {
return request.post('file/image/base64', data) return request.post('file/image/base64', data)
}
/**
*
*/
export function getSiteInfo() {
return request.get('site')
} }

View File

@ -1,8 +1,8 @@
<template> <template>
<view> <view :style="warpCss">
<view v-for="(item,index) in articleList" :key="item.id" <view v-for="(item,index) in articleList" :key="item.id"
:class="['bg-white flex align-center p-[20rpx]',{'border-solid border-t-0 border-l-0 border-r-0 border-b border-gray-200': articleList.length-1 !== index}] " :class="['item flex align-center p-[20rpx]',{'border-solid border-t-0 border-l-0 border-r-0 border-b border-gray-200 mb-[20rpx]': articleList.length-1 !== index}] "
@click="toLink(item.id)"> @click="toLink(item.id)" :style="itemCss">
<u--image width="260rpx" height="200rpx" :src="img(item.image)" v-if="item.image" model="aspectFill"> <u--image width="260rpx" height="200rpx" :src="img(item.image)" v-if="item.image" model="aspectFill">
<template #error> <template #error>
<u-icon name="photo" color="#999" size="50"></u-icon> <u-icon name="photo" color="#999" size="50"></u-icon>
@ -10,9 +10,9 @@
</u--image> </u--image>
<view class="flex-1 flex flex-col justify-between ml-[20rpx]"> <view class="flex-1 flex flex-col justify-between ml-[20rpx]">
<view class="text-[32rpx] leading-[1.3] multi-hidden mt-[4rpx]">{{item.title}}</view> <view class="text-[32rpx] leading-[1.3] multi-hidden mt-[4rpx]">{{item.title}}</view>
<view class="text-[28rx] using-hidden mb-[auto] mt-[20rpx] text-gray-500">{{item.summary}}</view> <view class="text-[28rpx] using-hidden mb-[auto] mt-[20rpx] text-gray-500">{{item.summary}}</view>
<view class="text-[24rpx] text-gray-400 flex justify-between mb-[10rpx]"> <view class="text-[24rpx] text-gray-400 flex justify-between mt-[10rpx]">
<text class="">{{item.create_time}}</text> <text>{{item.create_time}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -38,6 +38,26 @@
} }
}) })
const warpCss = computed(() => {
var style = '';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
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;
})
const itemCss = computed(() => {
var style = '';
if (diyComponent.value.elementBgColor) style += 'background-color:' + diyComponent.value.elementBgColor + ';';
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;';
return style;
})
const getArticleListFn = () => { const getArticleListFn = () => {
interface dataStructure { interface dataStructure {
ids ?: Array<number>, ids ?: Array<number>,
@ -69,6 +89,7 @@
create_time: "2023-03-28 09:00:00" create_time: "2023-03-28 09:00:00"
}; };
articleList.value.push(obj); articleList.value.push(obj);
articleList.value.push(obj);
} else { } else {
getArticleListFn(); getArticleListFn();
} }

View File

@ -1,20 +0,0 @@
<template>
<view>
<!-- 扩展组件 -->
</view>
</template>
<script setup lang="ts">
//
import { computed } from 'vue';
import useDiyStore from '@/stores/diy';
const props = defineProps(['component', 'index']);
const diyStore = useDiyStore();
const diyComponent = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore.value[props.index];
} else {
return props.component;
}
})
</script>
<style lang="scss" scoped></style>

View File

@ -1,24 +0,0 @@
<template>
<view>
演示插件信息自定义组件
</view>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import useDiyStore from '@/stores/diy';
const props = defineProps(['component', 'index']);
const diyStore = useDiyStore();
const diyComponent = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore.value[props.index];
} else {
return props.component;
}
})
</script>
<style></style>

View File

@ -1,24 +0,0 @@
<template>
<view>
演示插件文本自定义组件
</view>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import useDiyStore from '@/stores/diy';
const props = defineProps(['component', 'index']);
const diyStore = useDiyStore();
const diyComponent = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore.value[props.index];
} else {
return props.component;
}
})
</script>
<style></style>

View File

@ -1,12 +1,11 @@
<template> <template>
<view class="bg-[#F5F6F8]"> <view :style="warpCss">
<view v-if="diyComponent.layout == 'vertical'" class="graphic-nav px-[32rpx] bg-white rounded-[20rpx] box-border relative m-[30rpx]"> <div v-if="diyComponent.navTitle" class="py-[30rpx] px-[32rpx] text-[30rpx]"
<!-- <div v-if="diyComponent.navTitle" :style="{fontWeight: diyComponent.font.weight,color:diyComponent.font.color}">
class="py-2 border-solid border-b border-t-0 border-l-0 border-r-0 border-gray-200"> {{diyComponent.navTitle}}
{{diyComponent.navTitle}} </div>
</div> --> <view v-if="diyComponent.layout == 'vertical'" class="graphic-nav">
<view <view class="graphic-nav-item flex items-center justify-between py-[30rpx] px-[32rpx]"
class="graphic-nav-item flex items-center justify-between py-2 border-gray-200"
v-for=" (item, index) in diyComponent.list" :key="item.id" v-for=" (item, index) in diyComponent.list" :key="item.id"
:class="[index == 0 ? 'border-t-0':'border-t']" @click="redirectTo(item.link)"> :class="[index == 0 ? 'border-t-0':'border-t']" @click="redirectTo(item.link)">
@ -27,7 +26,8 @@
:style="{ fontSize: diyComponent.font.size * 2 + 'rpx', fontWeight: diyComponent.font.weight, color: diyComponent.font.color }"> :style="{ fontSize: diyComponent.font.size * 2 + 'rpx', fontWeight: diyComponent.font.weight, color: diyComponent.font.color }">
{{ item.title }} {{ item.title }}
</text> </text>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right" color="#CACACA"></u-icon>
</view> </view>
</view> </view>
@ -134,6 +134,16 @@
} }
}) })
const warpCss = computed(() => {
var style = '';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
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;
})
const swiperIndex = ref(0); const swiperIndex = ref(0);
const swiperChange = e => { const swiperChange = e => {

View File

@ -0,0 +1,30 @@
.draggable-element {
&.decorate {
&:hover:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 4rpx solid $u-primary;
z-index: 10;
pointer-events: none;
cursor: move;
border-style: dotted;
}
&.selected:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 4rpx solid $u-primary;
z-index: 10;
pointer-events: none;
cursor: move;
}
}
}

View File

@ -2,59 +2,40 @@
<view class="diy-group" id="componentList"> <view class="diy-group" id="componentList">
<view v-for="(component, index) in data.value" :key="component.id" <view v-for="(component, index) in data.value" :key="component.id"
@click="diyStore.changeCurrentIndex(index, component)" class="draggable-element relative cursor-move" @click="diyStore.changeCurrentIndex(index, component)" class="draggable-element relative cursor-move"
:class="{ selected: diyStore.currentIndex == index,decorate : diyStore.mode == 'decorate' }"> :class="{ selected: diyStore.currentIndex == index,decorate : diyStore.mode == 'decorate' }"
:style="component.pageStyle">
<!-- 标题 -->
<template v-if="component.componentName == 'Text'">
<diy-system-text :component="component" :index="index"></diy-system-text>
</template>
<!-- 图片广告 -->
<template v-if="component.componentName == 'ImageAds'">
<diy-system-image-ads :component="component" :index="index"></diy-system-image-ads>
</template>
<!-- 图文导航 -->
<template v-if="component.componentName == 'GraphicNav'">
<diy-system-graphic-nav :component="component" :index="index"></diy-system-graphic-nav>
</template>
<!-- 文章 -->
<template v-if="component.componentName == 'Article'"> <template v-if="component.componentName == 'Article'">
<diy-system-article :component="component" :index="index"></diy-system-article> <diy-article :component="component" :index="index"></diy-article>
</template>
<template v-if="component.componentName == 'GraphicNav'">
<diy-graphic-nav :component="component" :index="index"></diy-graphic-nav>
</template> </template>
<!-- 辅助空白 -->
<template v-if="component.componentName == 'HorzBlank'"> <template v-if="component.componentName == 'HorzBlank'">
<diy-system-horz-blank :component="component" :index="index"></diy-system-horz-blank> <diy-horz-blank :component="component" :index="index"></diy-horz-blank>
</template>
<template v-if="component.componentName == 'ImageAds'">
<diy-image-ads :component="component" :index="index"></diy-image-ads>
</template> </template>
<!-- 会员信息 -->
<template v-if="component.componentName == 'MemberInfo'"> <template v-if="component.componentName == 'MemberInfo'">
<diy-system-member-info :component="component" :index="index"></diy-system-member-info> <diy-member-info :component="component" :index="index"></diy-member-info>
</template> </template>
<template v-if="component.componentName == 'Text'">
<!-- 自定义扩展组件 --> <diy-text :component="component" :index="index"></diy-text>
<template v-if="systemComponent.indexOf(component.componentName) == -1">
<diy-comp-extend :component="component" :index="index"></diy-comp-extend>
</template> </template>
</view> </view>
<template v-if="diyStore.mode == ''"> <template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch">
<view class="pt-[20rpx]"></view> <view class="pt-[20rpx]"></view>
<tabbar /> <tabbar />
</template> </template>
</view> </view>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/stores/diy';
import { onMounted, nextTick, computed, ref } from 'vue'; import { onMounted, nextTick, computed, ref } from 'vue';
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
import { range } from 'lodash-es'; import { range } from 'lodash-es';
const props = defineProps(['data']); const props = defineProps(['data']);
const diyStore = useDiyStore(); const diyStore = useDiyStore();
const data = computed(() => { const data = computed(() => {
@ -65,9 +46,6 @@
} }
}) })
//
const systemComponent = ref(['Text', 'ImageAds', 'GraphicNav', 'Article', 'HorzBlank', 'MemberInfo'])
onMounted(() => { onMounted(() => {
// #ifdef H5 // #ifdef H5
if (diyStore.mode == 'decorate') { if (diyStore.mode == 'decorate') {
@ -96,36 +74,6 @@
// #endif // #endif
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.draggable-element { @import './index.scss';
&.decorate {
&:hover:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 4rpx solid $u-primary;
z-index: 10;
pointer-events: none;
cursor: move;
border-style: dotted;
}
&.selected:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 4rpx solid $u-primary;
z-index: 10;
pointer-events: none;
cursor: move;
}
}
}
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<view :style="horzBlankGaugeWrap"> <view :style="warpCss">
</view> </view>
</template> </template>
@ -20,9 +20,10 @@
} }
}) })
const horzBlankGaugeWrap = computed(() => { const warpCss = computed(() => {
var style = ''; var style = '';
style += 'height:' + diyComponent.value.height * 2 + 'rpx'; style += 'height:' + diyComponent.value.height * 2 + 'rpx;';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
return style; return style;
}) })
</script> </script>

View File

@ -1,16 +1,16 @@
<template> <template>
<view class="image-ads"> <view class="image-ads" :style="warpCss">
<view v-if="diyComponent.list.length == 1" class="simple-graph-wrap" <view v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden"
@click="diyRedirect(diyComponent.list[0].link)"> @click="diyRedirect(diyComponent.list[0].link)" :style="swiperWarpCss">
<image :src="img(diyComponent.list[0].imageUrl)" :style="{ height: diyComponent.list[0].height }" <image :src="img(diyComponent.list[0].imageUrl)" :style="{height: diyComponent.list[0].height}"
mode="widthFix" class="w-full" :show-menu-by-longpress="true"></image> mode="widthFix" class="w-full" :show-menu-by-longpress="true"></image>
</view> </view>
<swiper v-else class="swiper" :style="{ height: swiperHeight }" autoplay="true" circular="true" <swiper v-else class="swiper" :style="{ height: swiperHeight }" autoplay="true" circular="true"
@change="swiperChange"> @change="swiperChange">
<swiper-item class="swiper-item" v-for="(item) in diyComponent.list" :key="item.id" <swiper-item class="swiper-item" v-for="(item) in diyComponent.list" :key="item.id"
@click="diyRedirect(item.link)"> @click="diyRedirect(item.link)" :style="swiperWarpCss">
<view class="item" :style="{ height: item.height }"> <view class="item" :style="{height: item.height}">
<image :src="img(item.imageUrl)" mode="scaleToFill" class="w-full h-full"></image> <image :src="img(item.imageUrl)" mode="scaleToFill" class="w-full h-full"></image>
</view> </view>
</swiper-item> </swiper-item>
@ -35,6 +35,20 @@
return props.component; return props.component;
} }
}) })
const warpCss = computed(() => {
var style = '';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
return style;
})
const swiperWarpCss = computed(() => {
var style = '';
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;
})
const swiperIndex = ref(0); const swiperIndex = ref(0);

View File

@ -1,5 +1,5 @@
<template> <template>
<view> <view :style="warpCss">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<u-navbar :placeholder="true" bgColor="var(--primary-color)" titleStyle="color: #fff"> <u-navbar :placeholder="true" bgColor="var(--primary-color)" titleStyle="color: #fff">
<template #left> <template #left>
@ -8,86 +8,56 @@
<!-- #endif --> <!-- #endif -->
<view class="pt-[34rpx] member-info"> <view class="pt-[34rpx] member-info">
<view v-if="info" class="flex ml-[32rpx] mr-[52rpx] items-center relative"> <view v-if="info" class="flex ml-[32rpx] mr-[52rpx] items-center relative">
<!-- clickAvatar 唤起获取微信 --> <!-- 唤起获取微信 -->
<u-avatar :src="img(info.headimg)" size="60" leftIcon="none" @click="clickAvatar"></u-avatar> <u-avatar :src="img(info.headimg)" size="55" leftIcon="none" @click="clickAvatar"></u-avatar>
<view class="ml-[22rpx]"> <view class="ml-[22rpx]">
<view class="text-[#222222] truncate w-[430rpx] font-bold text-lg">{{ info.nickname }}</view> <view class="text-[#222222] truncate w-[430rpx] font-bold text-lg"
<view class="text-[#696B70] text-[24rpx] mt-[10rpx]">{{ t('memberLanguage') }}</view> :style="{ color : diyComponent.textColor }">{{ info.nickname }}</view>
<view class="text-[#696B70] text-[24rpx] mt-[10rpx]" :style="{ color : diyComponent.textColor }">
UID{{ info.member_no }}</view>
</view> </view>
<view class="set-icon flex items-center absolute right-0 top-2"> <view class="set-icon flex items-center absolute right-0 top-2">
<app-link url="/pages/setting/index"> <app-link url="/pages/setting/index">
<text class="iconfont iconshezhi text-[#000] text-[1.6rem] ml-[10rpx]"></text> <text class="iconfont iconshezhi text-[1.6rem] ml-[10rpx]"
:style="{ color : diyComponent.textColor }"></text>
</app-link> </app-link>
</view> </view>
</view> </view>
<view v-else class="flex ml-[32rpx] mr-[52rpx] items-center relative" @click="toLogin"> <view v-else class="flex ml-[32rpx] mr-[52rpx] items-center relative" @click="toLogin">
<u-avatar src="" size="60"></u-avatar> <u-avatar src="" size="55"></u-avatar>
<view class="ml-[22rpx]"> <view class="ml-[22rpx]">
<view class="text-[#222222] font-bold text-lg">{{ t('login') }}/{{ t('register') }}</view> <view class="text-[#222222] font-bold text-lg" :style="{ color : diyComponent.textColor }">
<view class="text-[#696B70] text-[24rpx] mt-[10rpx]">{{ t('memberLanguage') }}</view> {{ t('login') }}/{{ t('register') }}</view>
</view> </view>
<view class="set-icon flex items-center absolute right-0 top-2"> <view class="set-icon flex items-center absolute right-0 top-2">
<app-link url="/pages/setting/index"> <app-link url="/pages/setting/index">
<text class="iconfont iconshezhi text-[#000] text-[1.6rem] ml-[10rpx]"></text> <text class="iconfont iconshezhi text-[1.6rem] ml-[10rpx]"
:style="{ color : diyComponent.textColor }"></text>
</app-link> </app-link>
</view> </view>
</view> </view>
<view class="flex m-[30rpx] mb-0 py-[30rpx] "> <view class="flex m-[30rpx] mb-0 py-[30rpx] items-center">
<view class="flex-1 text-center"> <view class="flex-1 text-center">
<view class="font-bold"> <view class="font-bold">
<app-link :url="(info ? '/pages/member/point' : '')">{{ parseInt(info?.point) || 0 }}</app-link> <app-link :url="(info ? '/pages/member/balance' : '')" :style="{ color : diyComponent.textColor }">{{ money }}</app-link>
</view> </view>
<view class="text-sm mt-[10rpx]"> <view class="text-sm mt-[10rpx]">
<app-link :url="(info ? '/pages/member/point' : '')">{{ t('point') }}</app-link> <app-link :url="(info ? '/pages/member/balance' : '')" :style="{ color : diyComponent.textColor }">{{ t('balance') }}</app-link>
</view> </view>
</view> </view>
<view class="border-solid border-white border-l border-b-0 border-t-0 border-r-0 h-[60rpx]"></view>
<view class="flex-1 text-center"> <view class="flex-1 text-center">
<view class="font-bold"> <view class="font-bold">
<app-link :url="(info ? '/pages/member/balance' : '')">{{ money }}</app-link> <app-link :url="(info ? '/pages/member/point' : '')" :style="{ color : diyComponent.textColor }">{{ parseInt(info?.point) || 0 }}</app-link>
</view> </view>
<view class="text-sm mt-[10rpx]"> <view class="text-sm mt-[10rpx]">
<app-link :url="(info ? '/pages/member/balance' : '')">{{ t('balance') }}</app-link> <app-link :url="(info ? '/pages/member/point' : '')" :style="{ color : diyComponent.textColor }">{{ t('point') }}</app-link>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="m-[32rpx] flex justify-between p-[32rpx] bg-white rounded-[20rpx]">
<app-link url="/pages/member/personal">
<view>
<view class="w-[60rpx] h-[60rpx] mx-auto">
<image class="w-[60rpx]" :src="img('static/resource/images/diy/m_info.jpg')" mode="widthFix" />
</view>
<view class="text-[24rpx] text-[#333] mt-[18rpx] text-center">{{ t('memberCenter') }}</view>
</view>
</app-link>
<app-link url="/pages/member/balance">
<view>
<view class="w-[60rpx] h-[60rpx] mx-auto">
<image class="w-[60rpx]" :src="img('static/resource/images/diy/m_balance.jpg')"
mode="widthFix" />
</view>
<view class="text-[24rpx] text-[#333] mt-[18rpx] text-center">{{ t('myBalance') }}</view>
</view>
</app-link>
<app-link url="/pages/member/point">
<view>
<view class="w-[60rpx] h-[60rpx] mx-auto">
<image class="w-[60rpx]" :src="img('static/resource/images/diy/m_point.jpg')" mode="widthFix" />
</view>
<view class="text-[24rpx] text-[#333] mt-[18rpx] text-center">{{ t('myPoint') }}</view>
</view>
</app-link>
<app-link>
<view @click="servicePopup = true">
<view class="w-[60rpx] h-[60rpx] mx-auto">
<image class="w-[60rpx]" :src="img('static/resource/images/diy/m_service.jpg')"
mode="widthFix" />
</view>
<view class="text-[24rpx] text-[#333] mt-[18rpx] text-center">{{ t('customerService') }}</view>
</view>
</app-link>
</view>
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<information-filling ref="infoFill"></information-filling> <information-filling ref="infoFill"></information-filling>
<!-- #endif --> <!-- #endif -->
@ -115,6 +85,21 @@
} }
}) })
const warpCss = computed(() => {
var style = '';
if(diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
if (diyComponent.value.bgUrl) {
style += 'background-image:url(' + img(diyComponent.value.bgUrl) + ');';
style += 'background-size: 100%;';
style += 'background-repeat: no-repeat;';
}
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;
})
const memberStore = useMemberStore() const memberStore = useMemberStore()
const { query } = urlDeconstruction(location.href) const { query } = urlDeconstruction(location.href)
@ -131,7 +116,9 @@
headimg: '', headimg: '',
nickname: '昵称', nickname: '昵称',
balance: 0, balance: 0,
point: 0 point: 0,
money: 0,
member_no:'NIU0000021'
} }
} else { } else {
return memberStore.info; return memberStore.info;
@ -169,6 +156,6 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.member-info { .member-info {
background-image: linear-gradient(#E3F0FF, #F5F6F8) // background-image: linear-gradient(#E3F0FF, #F5F6F8)
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="diy-text bg-white" @click="redirect(diyComponent.link)"> <view class="diy-text" @click="redirect(diyComponent.link)" :style="warpCss">
<view v-if="diyComponent.style == 'style-1'" class="p-[20rpx]"> <view v-if="diyComponent.style == 'style-1'" class="p-[20rpx]">
<view class="" :style="{ <view class="" :style="{
@ -21,8 +21,8 @@
</view> </view>
<text class="ml-[16rpx] max-w-[300rpx] truncate" :style="{ color: diyComponent.subTitle.color, <text class="ml-[16rpx] max-w-[300rpx] truncate" :style="{ color: diyComponent.subTitle.color,
fontSize: diyComponent.subTitle.fontSize * 2 + 'rpx', }">{{ diyComponent.subTitle.text }}</text> fontSize: diyComponent.subTitle.fontSize * 2 + 'rpx', }">{{ diyComponent.subTitle.text }}</text>
<view class="ml-auto text-right flex items-center" v-if="diyComponent.more.isShow" :style="{ color: diyComponent.more.color }" <view class="ml-auto text-right flex items-center" v-if="diyComponent.more.isShow"
@click.stop="redirect(diyComponent.more.link)"> :style="{ color: diyComponent.more.color }" @click.stop="redirect(diyComponent.more.link)">
<text class="max-w-[200rpx] truncate text-[24rpx] mr-[8rpx]">{{ diyComponent.more.text }}</text> <text class="max-w-[200rpx] truncate text-[24rpx] mr-[8rpx]">{{ diyComponent.more.text }}</text>
<u-icon name="arrow-right" size="12" :style="{ color: diyComponent.more.color }"></u-icon> <u-icon name="arrow-right" size="12" :style="{ color: diyComponent.more.color }"></u-icon>
</view> </view>
@ -47,6 +47,15 @@
} }
}) })
const warpCss = computed(() => {
var style = '';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
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;
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -14,5 +14,7 @@
"pages.member.detailed_account": "流水明细", "pages.member.detailed_account": "流水明细",
"pages.member.apply_cash_out": "申请提现", "pages.member.apply_cash_out": "申请提现",
"pages.member.cash_out": "提现记录", "pages.member.cash_out": "提现记录",
"pages.member.cash_out_detail": "提现详情" "pages.member.cash_out_detail": "提现详情",
"pages.index.close": "站点已关闭",
"pages.index.nonexistence": "站点不存在"
} }

View File

@ -1,4 +1,6 @@
{ {
"requestFail": "请求失败",
"notInDomainList": "不在request 合法域名列表中",
"currency": "¥", "currency": "¥",
"getSmsCode": "获取验证码", "getSmsCode": "获取验证码",
"smsCodeChangeText": "秒后重新获取", "smsCodeChangeText": "秒后重新获取",
@ -39,8 +41,9 @@
"incompletePay": "未完成支付", "incompletePay": "未完成支付",
"getting": "获取支付结果中" "getting": "获取支付结果中"
}, },
"memberLanguage": "与你分享我的观点,共享真实世界",
"myBalance": "我的余额", "myBalance": "我的余额",
"myPoint": "我的积分", "myPoint": "我的积分",
"customerService": "联系客服" "customerService": "联系客服",
"siteClose": "站点已关闭",
"siteNonexistence": "站点不存在"
} }

View File

@ -1,279 +1,291 @@
{ {
"pages": [ // pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ // pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "%pages.index.index%"
}
},
{
"path": "pages/article/list",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.article.list%"
}
},
{
"path": "pages/auth/agreement",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.agreement%"
}
},
{
"path": "pages/auth/bind",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.bind%"
}
},
{
"path": "pages/auth/login",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.login%"
}
},
{
"path": "pages/auth/register",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.register%"
}
},
{
"path": "pages/auth/resetpwd",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.resetpwd%"
}
},
{
"path": "pages/index/diy",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.index.diy%"
}
},
{
"path": "pages/article/detail",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.article.detail%"
}
},
{
"path": "pages/member/apply_cash_out",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.member.apply_cash_out%"
},
"needLogin": true
},
{ {
"path": "pages/member/commission", "path": "pages/index/index",
"style": { "style": {
// #ifdef H5 "navigationStyle": "custom",
"navigationStyle": "custom", "navigationBarTitleText": "%pages.index.index%"
// #endif }
"navigationBarTitleText": "%pages.member.commission%"
},
"needLogin": true
}, },
{ {
"path": "pages/member/balance", "path": "pages/article/list",
"style": { "style": {
// #ifdef H5 // #ifdef H5
"navigationStyle": "custom", "navigationStyle": "custom",
// #endif // #endif
"navigationBarTitleText": "%pages.member.balance%" "navigationBarTitleText": "%pages.article.list%"
}, }
"needLogin": true },
{
"path": "pages/auth/agreement",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.agreement%"
}
},
{
"path": "pages/auth/bind",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.bind%"
}
},
{
"path": "pages/auth/login",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.login%"
}
},
{
"path": "pages/auth/register",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.register%"
}
},
{
"path": "pages/auth/resetpwd",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.auth.resetpwd%"
}
},
{
"path": "pages/index/diy",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.index.diy%"
}
}, },
{ {
"path": "pages/member/recharge_record", "path": "pages/index/close",
"style": { "style": {
// #ifdef H5 "navigationStyle": "custom",
"navigationStyle": "custom", "navigationBarTitleText": "%pages.index.close%"
// #endif }
"navigationBarTitleText": "%pages.member.recharge_record%" },
}, {
"needLogin": true "path": "pages/index/nonexistence",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "%pages.index.nonexistence%"
}
}, },
{ {
"path": "pages/member/recharge_record_detail", "path": "pages/article/detail",
"style": { "style": {
// #ifdef H5 // #ifdef H5
"navigationStyle": "custom", "navigationStyle": "custom",
// #endif // #endif
"navigationBarTitleText": "%pages.member.recharge_record_detail%" "navigationBarTitleText": "%pages.article.detail%"
}, }
"needLogin": true
}, },
{ {
"path": "pages/member/detailed_account", "path": "pages/member/apply_cash_out",
"style": { "style": {
// #ifdef H5 // #ifdef H5
"navigationStyle": "custom", "navigationStyle": "custom",
// #endif // #endif
"navigationBarTitleText": "%pages.member.detailed_account%" "navigationBarTitleText": "%pages.member.apply_cash_out%"
} },
}, "needLogin": true
{
"path": "pages/member/cash_out",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.member.cash_out%"
}
}, },
{ {
"path": "pages/member/cash_out_detail", "path": "pages/member/commission",
"style": { "style": {
// #ifdef H5 // #ifdef H5
"navigationStyle": "custom", "navigationStyle": "custom",
// #endif // #endif
"navigationBarTitleText": "%pages.member.cash_out_detail%" "navigationBarTitleText": "%pages.member.commission%"
} },
}, "needLogin": true
{ },
"path": "pages/member/index", {
"style": { "path": "pages/member/balance",
"navigationStyle": "custom", "style": {
"navigationBarTitleText": "%pages.member.index%" // #ifdef H5
} "navigationStyle": "custom",
}, // #endif
{ "navigationBarTitleText": "%pages.member.balance%"
"path": "pages/member/info", },
"style": { "needLogin": true
// #ifdef H5 },
"navigationStyle": "custom", {
// #endif "path": "pages/member/recharge_record",
"navigationBarTitleText": "%pages.member.info%" "style": {
}, // #ifdef H5
"needLogin": true "navigationStyle": "custom",
}, // #endif
{ "navigationBarTitleText": "%pages.member.recharge_record%"
"path": "pages/member/personal", },
"style": { "needLogin": true
// #ifdef H5 },
"navigationStyle": "custom", {
// #endif "path": "pages/member/recharge_record_detail",
"navigationBarTitleText": "%pages.member.personal%" "style": {
}, // #ifdef H5
"needLogin": true "navigationStyle": "custom",
}, // #endif
{ "navigationBarTitleText": "%pages.member.recharge_record_detail%"
"path": "pages/member/point", },
"style": { "needLogin": true
// #ifdef H5 },
"navigationStyle": "custom", {
// #endif "path": "pages/member/detailed_account",
"navigationBarTitleText": "%pages.member.point%" "style": {
}, // #ifdef H5
"needLogin": true "navigationStyle": "custom",
}, // #endif
{ "navigationBarTitleText": "%pages.member.detailed_account%"
"path": "pages/member/account", }
"style": { },
// #ifdef H5 {
"navigationStyle": "custom", "path": "pages/member/cash_out",
// #endif "style": {
"navigationBarTitleText": "%pages.member.account%" // #ifdef H5
}, "navigationStyle": "custom",
"needLogin": true // #endif
}, "navigationBarTitleText": "%pages.member.cash_out%"
{ }
"path": "pages/member/account_edit", },
"style": { {
// #ifdef H5 "path": "pages/member/cash_out_detail",
"navigationStyle": "custom", "style": {
// #endif // #ifdef H5
"navigationBarTitleText": "%pages.member.account_edit%" "navigationStyle": "custom",
}, // #endif
"needLogin": true "navigationBarTitleText": "%pages.member.cash_out_detail%"
}, }
{ },
"path": "pages/pay/browser", {
"style": { "path": "pages/member/index",
"navigationStyle": "custom", "style": {
"navigationBarTitleText": "%pages.pay.browser%" "navigationStyle": "custom",
} "navigationBarTitleText": "%pages.member.index%"
}, }
{ },
"path": "pages/pay/result", {
"style": { "path": "pages/member/info",
"navigationStyle": "custom", "style": {
"navigationBarTitleText": "%pages.pay.result%" // #ifdef H5
} "navigationStyle": "custom",
}, // #endif
{ "navigationBarTitleText": "%pages.member.info%"
"path": "pages/setting/index", },
"style": { "needLogin": true
// #ifdef H5 },
"navigationStyle": "custom", {
// #endif "path": "pages/member/personal",
"navigationBarTitleText": "%pages.setting.index%" "style": {
}, // #ifdef H5
"needLogin": true "navigationStyle": "custom",
}, // #endif
{ "navigationBarTitleText": "%pages.member.personal%"
"path": "pages/webview/index", },
"style": { "needLogin": true
// #ifdef H5 },
"navigationStyle": "custom", {
// #endif "path": "pages/member/point",
"navigationBarTitleText": "%pages.webview.index%" "style": {
} // #ifdef H5
} "navigationStyle": "custom",
], // #endif
"globalStyle": { "navigationBarTitleText": "%pages.member.point%"
"navigationBarTextStyle": "black", },
"navigationBarTitleText": "", "needLogin": true
"navigationBarBackgroundColor": "#ffffff", },
"backgroundColor": "#F8F8F8", {
"backgroundColorTop": "#F8F8F8", "path": "pages/member/account",
"backgroundColorBottom": "#F8F8F8" "style": {
}, // #ifdef H5
"tabBar": { "navigationStyle": "custom",
"list": [{ // #endif
"pagePath": "pages/index/index" "navigationBarTitleText": "%pages.member.account%"
}, },
{ "needLogin": true
"pagePath": "pages/article/list" },
}, {
{ "path": "pages/member/account_edit",
"pagePath": "pages/member/index" "style": {
} // #ifdef H5
] "navigationStyle": "custom",
}, // #endif
"uniIdRouter": {}, "navigationBarTitleText": "%pages.member.account_edit%"
"easycom": { },
"custom": { "needLogin": true
"^u-(.*)": "uview-plus/components/u-$1/u-$1.vue", },
"diy-system-(\W.*)": "@/components/diy/system/$1/index.vue", {
"diy-extend-(\W.*)": "@/components/diy/extend/$1/index.vue", "path": "pages/pay/browser",
"diy-(\W.*)": "@/components/diy/$1/index.vue" "style": {
} "navigationStyle": "custom",
} "navigationBarTitleText": "%pages.pay.browser%"
}
},
{
"path": "pages/pay/result",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "%pages.pay.result%"
}
},
{
"path": "pages/setting/index",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.setting.index%"
},
"needLogin": true
},
{
"path": "pages/webview/index",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "%pages.webview.index%"
}
}// {{PAGE}}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#ffffff",
"backgroundColor": "#F8F8F8",
"backgroundColorTop": "#F8F8F8",
"backgroundColorBottom": "#F8F8F8"
},
"tabBar": {
"list": [{
"pagePath": "pages/index/index"
},
{
"pagePath": "pages/article/list"
},
{
"pagePath": "pages/member/index"
}
]
},
"uniIdRouter": {},
"easycom": {
"custom": {
"^u-(.*)": "uview-plus/components/u-$1/u-$1.vue",
"diy-(\W.*)": "@/components/diy/$1/index.vue"
}
}
} }

View File

@ -24,7 +24,7 @@
</u-input> </u-input>
</u-form-item> </u-form-item>
</view> </view>
<view class="flex items-start mt-[30rpx]" v-if="!info"> <view class="flex items-start mt-[30rpx]" v-if="!info && config.agreement_show">
<u-checkbox-group> <u-checkbox-group>
<u-checkbox :checked="isAgree" shape="shape" size="14" @change="agreeChange" <u-checkbox :checked="isAgree" shape="shape" size="14" @change="agreeChange"
:customStyle="{'marginTop': '4rpx'}" /> :customStyle="{'marginTop': '4rpx'}" />
@ -47,7 +47,8 @@
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view class="mt-[30rpx]"> <view class="mt-[30rpx]">
<u-button type="primary" :plain="true" :text="t('weixinUserAuth')" open-type="getPhoneNumber" <u-button type="primary" :plain="true" :text="t('weixinUserAuth')" open-type="getPhoneNumber"
@getphonenumber="mobileAuth"></u-button> @getphonenumber="mobileAuth" v-if="!info.value || !config.agreement_show || isAgree"></u-button>
<u-button type="primary" :plain="true" :text="t('weixinUserAuth')" v-else @click="agreeTips"></u-button>
</view> </view>
<!-- #endif --> <!-- #endif -->
</u-form> </u-form>
@ -62,11 +63,16 @@
import { bind } from '@/api/auth' import { bind } from '@/api/auth'
import { bindMobile } from '@/api/member' import { bindMobile } from '@/api/member'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import useConfigStore from '@/stores/config'
import { useLogin } from '@/hooks/useLogin' import { useLogin } from '@/hooks/useLogin'
import { redirect } from '@/utils/common' import { redirect } from '@/utils/common'
const memberStore = useMemberStore() const memberStore = useMemberStore()
const info = computed(() => memberStore.info) const info = computed(() => memberStore.info)
const config = computed(() => {
return useConfigStore().login
})
const loading = ref(false) const loading = ref(false)
const isAgree = ref(false) const isAgree = ref(false)
@ -106,16 +112,15 @@
const agreeChange = () => { const agreeChange = () => {
isAgree.value = !isAgree.value isAgree.value = !isAgree.value
} }
const agreeTips = () => {
uni.showToast({ title: `${t('pleaceAgree')}${t('userAgreement')}》《${t('privacyAgreement')}`, icon: 'none' })
}
const formRef = ref(null) const formRef = ref(null)
const handleBind = () => { const handleBind = () => {
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
if (!isAgree.value && !info.value) {
uni.showToast({ title: `${t('pleaceAgree')}${t('userAgreement')}》《${t('privacyAgreement')}`, icon: 'none' })
return
}
if (loading.value) return if (loading.value) return
loading.value = true loading.value = true
@ -135,8 +140,9 @@
}) })
} }
const mobileAuth = (e) => { const mobileAuth = (e) => {
if (!isAgree.value && !info.value) { if (!isAgree.value && !info.value && config.value.agreement_show) {
uni.showToast({ title: `${t('pleaceAgree')}${t('userAgreement')}》《${t('privacyAgreement')}`, icon: 'none' }) uni.showToast({ title: `${t('pleaceAgree')}${t('userAgreement')}》《${t('privacyAgreement')}`, icon: 'none' })
return return
} }

View File

@ -60,7 +60,7 @@
</u-form> </u-form>
</view> </view>
</view> </view>
<view class="text-xs py-[50rpx] flex justify-center w-full"> <view class="text-xs py-[50rpx] flex justify-center w-full" v-if="configStore.login.agreement_show">
{{ t('agreeTips') }} {{ t('agreeTips') }}
<app-link url="/pages/auth/agreement?key=service"> <app-link url="/pages/auth/agreement?key=service">
<text class="text-primary">{{ t('userAgreement') }}</text> <text class="text-primary">{{ t('userAgreement') }}</text>

View File

@ -78,7 +78,7 @@
</u-form> </u-form>
</view> </view>
</view> </view>
<view class="text-xs py-[50rpx] flex justify-center w-full"> <view class="text-xs py-[50rpx] flex justify-center w-full" v-if="configStore.login.agreement_show">
{{ t('registerAgreeTips') }} {{ t('registerAgreeTips') }}
<app-link url="/pages/auth/agreement?key=service"> <app-link url="/pages/auth/agreement?key=service">
<text class="text-primary">{{ t('userAgreement') }}</text> <text class="text-primary">{{ t('userAgreement') }}</text>

View File

@ -0,0 +1,16 @@
<template>
<view class="w-screen h-screen flex flex-col items-center justify-center">
<u-empty
:icon="img('static/resource/images/site/close.png')"
:text="t('siteClose')"
>
</u-empty>
</view>
</template>
<script setup lang="ts">
import { img } from '@/utils/common'
import { t } from '@/locale'
</script>
<style lang="scss" scoped></style>

View File

@ -1,7 +1,9 @@
<template> <template>
<view> <view>
<u-loading-page :loading="loading" loadingText=""></u-loading-page> <u-loading-page :loading="loading" loadingText=""></u-loading-page>
<view v-show="!loading" :style="{ backgroundColor: data.global.pageBgColor }"> <view v-show="!loading"
:style="{ backgroundColor: data.global.pageBgColor,minHeight: 'calc(100vh - 50px)',backgroundImage : data.global.bgUrl ? 'url(' + img(data.global.bgUrl) + ')' : '' }"
class="bg-index">
<diy-group :data="data"></diy-group> <diy-group :data="data"></diy-group>
</view> </view>
</view> </view>
@ -13,6 +15,7 @@
import { getDiyInfo } from '@/api/diy'; import { getDiyInfo } from '@/api/diy';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/stores/diy';
import { useShare } from '@/hooks/useShare' import { useShare } from '@/hooks/useShare'
import { img } from '@/utils/common';
const { setShare, onShareAppMessage, onShareTimeline } = useShare() const { setShare, onShareAppMessage, onShareTimeline } = useShare()
onShareAppMessage() onShareAppMessage()
@ -58,22 +61,39 @@
id: id.value, id: id.value,
name: name.value name: name.value
}).then((res : any) => { }).then((res : any) => {
if (res.data.value) { if (res.data.value) {
let sources = JSON.parse(res.data.value); let sources = JSON.parse(res.data.value);
diyData.global = sources.global; diyData.global = sources.global;
diyData.value = sources.value; diyData.value = sources.value;
uni.setNavigationBarTitle({ diyData.value.forEach((item, index) => {
title: diyData.global.title item.pageStyle = '';
}) if (item.pageBgColor) item.pageStyle += 'background-color:' + item.pageBgColor + ';';
} if (item.margin) {
item.pageStyle += 'padding-top:' + item.margin.top * 2 + 'rpx' + ';';
item.pageStyle += 'padding-bottom:' + item.margin.bottom * 2 + 'rpx' + ';';
item.pageStyle += 'padding-right:' + item.margin.both * 2 + 'rpx' + ';';
item.pageStyle += 'padding-left:' + item.margin.both * 2 + 'rpx' + ';';
}
});
uni.setNavigationBarTitle({
title: diyData.global.title
})
}
let share = res.data.share ? JSON.parse(res.data.share) : null; let share = res.data.share ? JSON.parse(res.data.share) : null;
setShare(share); setShare(share);
loading.value = false; loading.value = false;
}); });
} }
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bg-index {
width: 100%;
height: 100%;
box-sizing: border-box;
background-size: 100% !important;
background-repeat: no-repeat !important;
}
</style> </style>

View File

@ -1,7 +1,9 @@
<template> <template>
<view> <view>
<u-loading-page :loading="loading" loadingText=""></u-loading-page> <u-loading-page :loading="loading" loadingText=""></u-loading-page>
<view v-show="!loading" :style="{ backgroundColor: data.global.pageBgColor,minHeight: 'calc(100vh - 50px)' }"> <view v-show="!loading"
:style="{ backgroundColor: data.global.pageBgColor,minHeight: 'calc(100vh - 50px)',backgroundImage : data.global.bgUrl ? 'url(' + img(data.global.bgUrl) + ')' : '' }"
class="bg-index">
<diy-group :data="data"></diy-group> <diy-group :data="data"></diy-group>
</view> </view>
</view> </view>
@ -13,6 +15,7 @@
import { getDiyInfo } from '@/api/diy'; import { getDiyInfo } from '@/api/diy';
import useDiyStore from '@/stores/diy'; import useDiyStore from '@/stores/diy';
import { useShare } from '@/hooks/useShare' import { useShare } from '@/hooks/useShare'
import { img } from '@/utils/common';
const { setShare, onShareAppMessage, onShareTimeline } = useShare() const { setShare, onShareAppMessage, onShareTimeline } = useShare()
setShare(); setShare();
@ -53,20 +56,37 @@
getDiyInfo({ getDiyInfo({
name: 'DIY_INDEX' name: 'DIY_INDEX'
}).then((res : any) => { }).then((res : any) => {
if (res.data.value) { if (res.data.value) {
let sources = JSON.parse(res.data.value); let sources = JSON.parse(res.data.value);
diyData.global = sources.global; diyData.global = sources.global;
diyData.value = sources.value; diyData.value = sources.value;
uni.setNavigationBarTitle({ diyData.value.forEach((item, index) => {
title: diyData.global.title item.pageStyle = '';
}) if (item.pageBgColor) item.pageStyle += 'background-color:' + item.pageBgColor + ';';
} if (item.margin) {
item.pageStyle += 'padding-top:' + item.margin.top * 2 + 'rpx' + ';';
item.pageStyle += 'padding-bottom:' + item.margin.bottom * 2 + 'rpx' + ';';
item.pageStyle += 'padding-right:' + item.margin.both * 2 + 'rpx' + ';';
item.pageStyle += 'padding-left:' + item.margin.both * 2 + 'rpx' + ';';
}
});
uni.setNavigationBarTitle({
title: diyData.global.title
})
}
loading.value = false; loading.value = false;
}); });
} }
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bg-index {
width: 100%;
height: 100%;
box-sizing: border-box;
background-size: 100% !important;
background-repeat: no-repeat !important;
}
</style> </style>

View File

@ -0,0 +1,16 @@
<template>
<view class="w-screen h-screen flex flex-col items-center justify-center">
<u-empty
:icon="img('static/resource/images/site/close.png')"
:text="t('siteNonexistence')"
>
</u-empty>
</view>
</template>
<script setup lang="ts">
import { img } from '@/utils/common'
import { t } from '@/locale'
</script>
<style lang="scss" scoped></style>

View File

@ -1,7 +1,9 @@
<template> <template>
<view> <view>
<u-loading-page :loading="loading" loadingText=""></u-loading-page> <u-loading-page :loading="loading" loadingText=""></u-loading-page>
<view v-show="!loading" :style="{ backgroundColor: data.global.pageBgColor,minHeight: 'calc(100vh - 50px)' }"> <view v-show="!loading"
:style="{ backgroundColor: data.global.pageBgColor,minHeight: 'calc(100vh - 50px)',backgroundImage : data.global.bgUrl ? 'url(' + img(data.global.bgUrl) + ')' : '' }"
class="bg-index">
<diy-group :data="data"></diy-group> <diy-group :data="data"></diy-group>
</view> </view>
</view> </view>
@ -13,6 +15,7 @@
import { getDiyInfo } from '@/api/diy' import { getDiyInfo } from '@/api/diy'
import useDiyStore from '@/stores/diy' import useDiyStore from '@/stores/diy'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import { img } from '@/utils/common';
const loading = ref(true); const loading = ref(true);
const diyStore = useDiyStore(); const diyStore = useDiyStore();
@ -48,19 +51,37 @@
getDiyInfo({ getDiyInfo({
name: 'DIY_MEMBER_INDEX' name: 'DIY_MEMBER_INDEX'
}).then((res : any) => { }).then((res : any) => {
if (res.data.value) { if (res.data.value) {
let sources = JSON.parse(res.data.value); let sources = JSON.parse(res.data.value);
diyData.global = sources.global; diyData.global = sources.global;
diyData.value = sources.value; diyData.value = sources.value;
uni.setNavigationBarTitle({ diyData.value.forEach((item, index) => {
title: diyData.global.title item.pageStyle = '';
}) if (item.pageBgColor) item.pageStyle += 'background-color:' + item.pageBgColor + ';';
} if (item.margin) {
loading.value = false; item.pageStyle += 'padding-top:' + item.margin.top * 2 + 'rpx' + ';';
item.pageStyle += 'padding-bottom:' + item.margin.bottom * 2 + 'rpx' + ';';
item.pageStyle += 'padding-right:' + item.margin.both * 2 + 'rpx' + ';';
item.pageStyle += 'padding-left:' + item.margin.both * 2 + 'rpx' + ';';
}
});
uni.setNavigationBarTitle({
title: diyData.global.title
})
}
loading.value = false;
}); });
} }
useMemberStore().getMemberInfo() useMemberStore().getMemberInfo()
}); });
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.bg-index {
width: 100%;
height: 100%;
box-sizing: border-box;
background-size: 100% !important;
background-repeat: no-repeat !important;
}
</style>

View File

@ -1,46 +1,46 @@
<template> <template>
<view class="member-record-detail"> <view class="member-record-detail">
<view class="money-wrap"> <view class="money-wrap">
<text>-{{ cashOutInfo.apply_money }}</text> <text>-{{ rechargeInfo.apply_money }}</text>
<text>{{ cashOutInfo.status_name }}</text> <text>{{ rechargeInfo.status_name }}</text>
</view> </view>
<!-- 状态0待审核1.待转账2已转账 -1拒绝' --> <!-- 状态0待审核1.待转账2已转账 -1拒绝' -->
<view class="item"> <view class="item">
<view class="line-wrap"> <view class="line-wrap">
<text class="label">{{t('cashOutNo')}}</text> <text class="label">{{t('cashOutNo')}}</text>
<text class="value">{{ cashOutInfo.cash_out_no }}</text> <text class="value">{{ rechargeInfo.cash_out_no }}</text>
</view> </view>
<view class="line-wrap"> <view class="line-wrap">
<text class="label">{{t('serviceMoney')}}</text> <text class="label">{{t('serviceMoney')}}</text>
<text class="value">{{ cashOutInfo.service_money }}</text> <text class="value">{{ rechargeInfo.service_money }}</text>
</view> </view>
<view class="line-wrap"> <view class="line-wrap">
<text class="label">{{t('createTime')}}</text> <text class="label">{{t('createTime')}}</text>
<text class="value">{{ cashOutInfo.create_time }}</text> <text class="value">{{ rechargeInfo.create_time }}</text>
</view> </view>
<view class="line-wrap" v-if="cashOutInfo.status"> <view class="line-wrap" v-if="rechargeInfo.status">
<text class="label">{{t('auditTime')}}</text> <text class="label">{{t('auditTime')}}</text>
<text class="value">{{ cashOutInfo.audit_time }}</text> <text class="value">{{ rechargeInfo.audit_time }}</text>
</view> </view>
<view class="line-wrap" v-if="cashOutInfo.transfer_bank"> <view class="line-wrap" v-if="rechargeInfo.transfer_bank">
<text class="label">{{t('transferBank')}}</text> <text class="label">{{t('transferBank')}}</text>
<text class="value">{{ cashOutInfo.transfer_bank }}</text> <text class="value">{{ rechargeInfo.transfer_bank }}</text>
</view> </view>
<view class="line-wrap"> <view class="line-wrap">
<text class="label">{{t('transferAccount')}}</text> <text class="label">{{t('transferAccount')}}</text>
<text class="value">{{ cashOutInfo.transfer_account }}</text> <text class="value">{{ rechargeInfo.transfer_account }}</text>
</view> </view>
<view class="line-wrap" v-if="cashOutInfo.status == -1 && cashOutInfo.refuse_reason"> <view class="line-wrap" v-if="rechargeInfo.status == -1 && rechargeInfo.refuse_reason">
<text class="label">{{t('refuseReason')}}</text> <text class="label">{{t('refuseReason')}}</text>
<text class="value">{{ cashOutInfo.refuse_reason }}</text> <text class="value">{{ rechargeInfo.refuse_reason }}</text>
</view> </view>
<view class="line-wrap" v-if="cashOutInfo.status == 2"> <view class="line-wrap" v-if="rechargeInfo.status == 2">
<text class="label">{{t('transferTypeName')}}</text> <text class="label">{{t('transferTypeName')}}</text>
<text class="value">{{ cashOutInfo.transfer_type_name }}</text> <text class="value">{{ rechargeInfo.transfer_type_name }}</text>
</view> </view>
<view class="line-wrap" v-if="cashOutInfo.status == 2"> <view class="line-wrap" v-if="rechargeInfo.status == 2">
<text class="label">{{t('transferTime')}}</text> <text class="label">{{t('transferTime')}}</text>
<text class="value">{{ cashOutInfo.transfer_time }}</text> <text class="value">{{ rechargeInfo.transfer_time }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -53,18 +53,18 @@ import { t } from '@/locale'
import { redirect, img } from '@/utils/common'; import { redirect, img } from '@/utils/common';
import { getRechargeDetail } from '@/api/member'; import { getRechargeDetail } from '@/api/member';
let cashOutInfo = ref({}); let rechargeInfo = ref({});
let loading = ref<boolean>(false); let loading = ref<boolean>(false);
onLoad((option) => { onLoad((option) => {
let id = option.id || ""; let id = option.id || "";
getCashoutAccountListFn(id) getRechargeDetailFn(id)
}) })
const getCashoutAccountListFn = (id) => { const getRechargeDetailFn = (id) => {
loading.value = false; loading.value = false;
getRechargeDetail(id).then((res) => { getRechargeDetail(id).then((res) => {
cashOutInfo.value = res.data; rechargeInfo.value = res.data;
loading.value = true; loading.value = true;
}).catch(() => { }).catch(() => {
loading.value = true; loading.value = true;

View File

@ -7,7 +7,8 @@ interface loginConfig {
is_username: number | boolean, is_username: number | boolean,
is_mobile: number | boolean, is_mobile: number | boolean,
is_auth_register: number | boolean, is_auth_register: number | boolean,
is_bind_mobile: number | boolean is_bind_mobile: number | boolean,
agreement_show: number | boolean
} }
interface tabbarConfig { interface tabbarConfig {
@ -30,7 +31,8 @@ const useConfigStore = defineStore('config', {
is_username: 0, is_username: 0,
is_mobile: 0, is_mobile: 0,
is_auth_register: 0, is_auth_register: 0,
is_bind_mobile: 0 is_bind_mobile: 0,
agreement_show: 0
}, },
tabbar: null tabbar: null
} }
@ -42,6 +44,7 @@ const useConfigStore = defineStore('config', {
this.login.is_mobile = parseInt(res.data.is_mobile) this.login.is_mobile = parseInt(res.data.is_mobile)
this.login.is_auth_register = parseInt(res.data.is_auth_register) this.login.is_auth_register = parseInt(res.data.is_auth_register)
this.login.is_bind_mobile = parseInt(res.data.is_bind_mobile) this.login.is_bind_mobile = parseInt(res.data.is_bind_mobile)
this.login.agreement_show = parseInt(res.data.agreement_show)
}).catch(() => { }).catch(() => {
}) })

View File

@ -7,7 +7,7 @@ interface Diy {
global : { global : {
title : string, title : string,
pageBgColor : string, // 页面背景颜色 pageBgColor : string, // 页面背景颜色
tabbarSwitch : boolean, // 底部导航开关 bottomTabBarSwitch : boolean, // 底部导航开关
}, },
// 组件集合 // 组件集合
value : any[] value : any[]
@ -21,7 +21,8 @@ const useDiyStore = defineStore('diy', {
global: { global: {
title: "", title: "",
pageBgColor: "", // 页面背景颜色 pageBgColor: "", // 页面背景颜色
tabbarSwitch: true bottomTabBarSwitch: true,
bgUrl: ''
}, },
// 组件集合 // 组件集合
value: [] value: []
@ -45,13 +46,26 @@ const useDiyStore = defineStore('diy', {
try { try {
let data = JSON.parse(event.data); let data = JSON.parse(event.data);
this.currentIndex = data.currentIndex; this.currentIndex = data.currentIndex;
this.global = data.global; if(data.global) this.global = data.global;
this.value = data.value; if(data.value) this.value = data.value;
if (this.value) {
this.value.forEach((item, index) => {
item.pageStyle = '';
if (item.pageBgColor) item.pageStyle += 'background-color:' + item.pageBgColor + ';';
if (item.margin) {
item.pageStyle += 'padding-top:' + item.margin.top * 2 + 'rpx' + ';';
item.pageStyle += 'padding-bottom:' + item.margin.bottom * 2 + 'rpx' + ';';
item.pageStyle += 'padding-right:' + item.margin.both * 2 + 'rpx' + ';';
item.pageStyle += 'padding-left:' + item.margin.both * 2 + 'rpx' + ';';
}
});
}
// console.log('uniapp 接受后台装修返回的组件数据', data); // console.log('uniapp 接受后台装修返回的组件数据', data);
} catch (e) { } catch (e) {
console.log('uniapp接受数据错误', e) console.log('uniapp接受数据错误', e)
} }
}); }, false);
// #endif // #endif
}, },
// 将数据传输给后台 // 将数据传输给后台
@ -73,10 +87,10 @@ const useDiyStore = defineStore('diy', {
// 选中正在编辑的组件 // 选中正在编辑的组件
changeCurrentIndex(index : number, component : any = null) { changeCurrentIndex(index : number, component : any = null) {
// #ifdef H5 // #ifdef H5
// 实际展示禁止编辑 // 实际展示禁止编辑
if (this.mode == '') return; if (this.mode == '') return;
// 减少重复请求 // 减少重复请求
if (this.currentIndex == index) return; if (this.currentIndex == index) return;
this.currentIndex = index; this.currentIndex = index;

29
uni-app/stores/system.ts Normal file
View File

@ -0,0 +1,29 @@
import { defineStore } from 'pinia'
import { getSiteInfo } from '@/api/system'
import { redirect } from '@/utils/common'
interface System {
site: AnyObject | null
}
const useSystemStore = defineStore('system', {
state: () : System => {
return {
site: null
}
},
actions: {
async getSitenfo() {
await getSiteInfo()
.then((res: any) => {
this.site = res.data
if (this.site.status == 3) redirect({ url: '/pages/index/close', mode: 'reLaunch' })
})
.catch((err) => {
redirect({ url: '/pages/index/nonexistence', mode: 'reLaunch' })
})
}
}
})
export default useSystemStore

View File

@ -1,5 +1,6 @@
import { getToken, getAppChannel } from './common' import { getToken, getAppChannel } from './common'
import useMemberStore from '@/stores/member' import useMemberStore from '@/stores/member'
import { t } from '@/locale'
interface RequestConfig { interface RequestConfig {
showErrorMessage ?: boolean showErrorMessage ?: boolean
@ -121,6 +122,9 @@ class Request {
}, },
fail: res => { fail: res => {
reject(res) reject(res)
},
complete: (res) => {
this.handleRequestFail(res)
} }
}) })
}) })
@ -133,6 +137,23 @@ class Request {
break; break;
} }
} }
private handleRequestFail(res) {
if (res.errMsg && res.errMsg == "request:ok") {
if (typeof res.data == 'string') {
uni.showToast({ icon: 'none', title: this.baseUrl + t('requestFail') })
return
}
}
if (res.errMsg == 'request:fail') {
uni.showToast({ icon: 'none', title: this.baseUrl + t('requestFail') })
return
}
if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
uni.showToast({ icon: 'none', title: this.baseUrl + t('notInDomainList') });
return
}
}
} }
export default new Request() export default new Request()