mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-11 17:42:47 +00:00
uni-app
This commit is contained in:
parent
f0bb684b44
commit
89abab8153
@ -5,6 +5,7 @@
|
||||
import { getToken, isWeixinBrowser, urlDeconstruction } from '@/utils/common'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import useSystemStore from '@/stores/system'
|
||||
import { useLogin } from '@/hooks/useLogin'
|
||||
import { language } from '@/locale'
|
||||
|
||||
@ -25,6 +26,8 @@
|
||||
const configStore = useConfigStore()
|
||||
configStore.getTabbarConfig()
|
||||
await configStore.getLoginConfig()
|
||||
|
||||
useSystemStore().getSitenfo()
|
||||
|
||||
// 隐藏tabbar
|
||||
uni.hideTabBar()
|
||||
|
||||
@ -32,7 +32,7 @@ export function getAgreementInfo(key : string) {
|
||||
* 重置密码
|
||||
*/
|
||||
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) {
|
||||
return request.post('file/image/base64', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点信息
|
||||
*/
|
||||
export function getSiteInfo() {
|
||||
return request.get('site')
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view>
|
||||
<view :style="warpCss">
|
||||
<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}] "
|
||||
@click="toLink(item.id)">
|
||||
: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)" :style="itemCss">
|
||||
<u--image width="260rpx" height="200rpx" :src="img(item.image)" v-if="item.image" model="aspectFill">
|
||||
<template #error>
|
||||
<u-icon name="photo" color="#999" size="50"></u-icon>
|
||||
@ -10,9 +10,9 @@
|
||||
</u--image>
|
||||
<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-[28rx] using-hidden mb-[auto] mt-[20rpx] text-gray-500">{{item.summary}}</view>
|
||||
<view class="text-[24rpx] text-gray-400 flex justify-between mb-[10rpx]">
|
||||
<text class="">{{item.create_time}}</text>
|
||||
<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 mt-[10rpx]">
|
||||
<text>{{item.create_time}}</text>
|
||||
</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 = () => {
|
||||
interface dataStructure {
|
||||
ids ?: Array<number>,
|
||||
@ -69,6 +89,7 @@
|
||||
create_time: "2023-03-28 09:00:00"
|
||||
};
|
||||
articleList.value.push(obj);
|
||||
articleList.value.push(obj);
|
||||
} else {
|
||||
getArticleListFn();
|
||||
}
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<view class="bg-[#F5F6F8]">
|
||||
<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-2 border-solid border-b border-t-0 border-l-0 border-r-0 border-gray-200">
|
||||
{{diyComponent.navTitle}}
|
||||
</div> -->
|
||||
<view
|
||||
class="graphic-nav-item flex items-center justify-between py-2 border-gray-200"
|
||||
<view :style="warpCss">
|
||||
<div v-if="diyComponent.navTitle" class="py-[30rpx] px-[32rpx] text-[30rpx]"
|
||||
:style="{fontWeight: diyComponent.font.weight,color:diyComponent.font.color}">
|
||||
{{diyComponent.navTitle}}
|
||||
</div>
|
||||
<view v-if="diyComponent.layout == 'vertical'" class="graphic-nav">
|
||||
<view class="graphic-nav-item flex items-center justify-between py-[30rpx] px-[32rpx]"
|
||||
v-for=" (item, index) in diyComponent.list" :key="item.id"
|
||||
: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 }">
|
||||
{{ item.title }}
|
||||
</text>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
<u-icon name="arrow-right" color="#CACACA"></u-icon>
|
||||
|
||||
</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 swiperChange = e => {
|
||||
30
uni-app/components/diy/group/index.scss
Normal file
30
uni-app/components/diy/group/index.scss
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,59 +2,40 @@
|
||||
<view class="diy-group" id="componentList">
|
||||
<view v-for="(component, index) in data.value" :key="component.id"
|
||||
@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'">
|
||||
<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 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 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 v-if="systemComponent.indexOf(component.componentName) == -1">
|
||||
<diy-comp-extend :component="component" :index="index"></diy-comp-extend>
|
||||
<template v-if="component.componentName == 'Text'">
|
||||
<diy-text :component="component" :index="index"></diy-text>
|
||||
</template>
|
||||
</view>
|
||||
<template v-if="diyStore.mode == ''">
|
||||
<template v-if="diyStore.mode == '' && data.global.bottomTabBarSwitch">
|
||||
<view class="pt-[20rpx]"></view>
|
||||
<tabbar />
|
||||
</template>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useDiyStore from '@/stores/diy';
|
||||
import { onMounted, nextTick, computed, ref } from 'vue';
|
||||
import Sortable from 'sortablejs';
|
||||
import { range } from 'lodash-es';
|
||||
|
||||
const props = defineProps(['data']);
|
||||
|
||||
const diyStore = useDiyStore();
|
||||
|
||||
const data = computed(() => {
|
||||
@ -65,9 +46,6 @@
|
||||
}
|
||||
})
|
||||
|
||||
// 系统组件
|
||||
const systemComponent = ref(['Text', 'ImageAds', 'GraphicNav', 'Article', 'HorzBlank', 'MemberInfo'])
|
||||
|
||||
onMounted(() => {
|
||||
// #ifdef H5
|
||||
if (diyStore.mode == 'decorate') {
|
||||
@ -96,36 +74,6 @@
|
||||
// #endif
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@import './index.scss';
|
||||
</style>
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view :style="horzBlankGaugeWrap">
|
||||
<view :style="warpCss">
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -20,9 +20,10 @@
|
||||
}
|
||||
})
|
||||
|
||||
const horzBlankGaugeWrap = computed(() => {
|
||||
const warpCss = computed(() => {
|
||||
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;
|
||||
})
|
||||
</script>
|
||||
@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<view class="image-ads">
|
||||
<view v-if="diyComponent.list.length == 1" class="simple-graph-wrap"
|
||||
@click="diyRedirect(diyComponent.list[0].link)">
|
||||
<image :src="img(diyComponent.list[0].imageUrl)" :style="{ height: diyComponent.list[0].height }"
|
||||
<view class="image-ads" :style="warpCss">
|
||||
<view v-if="diyComponent.list.length == 1" class="leading-0 overflow-hidden"
|
||||
@click="diyRedirect(diyComponent.list[0].link)" :style="swiperWarpCss">
|
||||
<image :src="img(diyComponent.list[0].imageUrl)" :style="{height: diyComponent.list[0].height}"
|
||||
mode="widthFix" class="w-full" :show-menu-by-longpress="true"></image>
|
||||
</view>
|
||||
|
||||
<swiper v-else class="swiper" :style="{ height: swiperHeight }" autoplay="true" circular="true"
|
||||
@change="swiperChange">
|
||||
<swiper-item class="swiper-item" v-for="(item) in diyComponent.list" :key="item.id"
|
||||
@click="diyRedirect(item.link)">
|
||||
<view class="item" :style="{ height: item.height }">
|
||||
@click="diyRedirect(item.link)" :style="swiperWarpCss">
|
||||
<view class="item" :style="{height: item.height}">
|
||||
<image :src="img(item.imageUrl)" mode="scaleToFill" class="w-full h-full"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
@ -35,6 +35,20 @@
|
||||
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);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view>
|
||||
<view :style="warpCss">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<u-navbar :placeholder="true" bgColor="var(--primary-color)" titleStyle="color: #fff">
|
||||
<template #left>
|
||||
@ -8,86 +8,56 @@
|
||||
<!-- #endif -->
|
||||
<view class="pt-[34rpx] member-info">
|
||||
<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="text-[#222222] truncate w-[430rpx] font-bold text-lg">{{ info.nickname }}</view>
|
||||
<view class="text-[#696B70] text-[24rpx] mt-[10rpx]">{{ t('memberLanguage') }}</view>
|
||||
<view class="text-[#222222] truncate w-[430rpx] font-bold text-lg"
|
||||
: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 class="set-icon flex items-center absolute right-0 top-2">
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
<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="text-[#222222] font-bold text-lg">{{ t('login') }}/{{ t('register') }}</view>
|
||||
<view class="text-[#696B70] text-[24rpx] mt-[10rpx]">{{ t('memberLanguage') }}</view>
|
||||
<view class="text-[#222222] font-bold text-lg" :style="{ color : diyComponent.textColor }">
|
||||
{{ t('login') }}/{{ t('register') }}</view>
|
||||
</view>
|
||||
<view class="set-icon flex items-center absolute right-0 top-2">
|
||||
<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>
|
||||
</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="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 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 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="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 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 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 -->
|
||||
<information-filling ref="infoFill"></information-filling>
|
||||
<!-- #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 { query } = urlDeconstruction(location.href)
|
||||
@ -131,7 +116,9 @@
|
||||
headimg: '',
|
||||
nickname: '昵称',
|
||||
balance: 0,
|
||||
point: 0
|
||||
point: 0,
|
||||
money: 0,
|
||||
member_no:'NIU0000021'
|
||||
}
|
||||
} else {
|
||||
return memberStore.info;
|
||||
@ -169,6 +156,6 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.member-info {
|
||||
background-image: linear-gradient(#E3F0FF, #F5F6F8)
|
||||
// background-image: linear-gradient(#E3F0FF, #F5F6F8)
|
||||
}
|
||||
</style>
|
||||
@ -1,5 +1,5 @@
|
||||
<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 class="" :style="{
|
||||
@ -21,8 +21,8 @@
|
||||
</view>
|
||||
<text class="ml-[16rpx] max-w-[300rpx] truncate" :style="{ color: diyComponent.subTitle.color,
|
||||
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 }"
|
||||
@click.stop="redirect(diyComponent.more.link)">
|
||||
<view class="ml-auto text-right flex items-center" v-if="diyComponent.more.isShow"
|
||||
: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>
|
||||
<u-icon name="arrow-right" size="12" :style="{ color: diyComponent.more.color }"></u-icon>
|
||||
</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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -14,5 +14,7 @@
|
||||
"pages.member.detailed_account": "流水明细",
|
||||
"pages.member.apply_cash_out": "申请提现",
|
||||
"pages.member.cash_out": "提现记录",
|
||||
"pages.member.cash_out_detail": "提现详情"
|
||||
"pages.member.cash_out_detail": "提现详情",
|
||||
"pages.index.close": "站点已关闭",
|
||||
"pages.index.nonexistence": "站点不存在"
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
{
|
||||
"requestFail": "请求失败",
|
||||
"notInDomainList": "不在request 合法域名列表中",
|
||||
"currency": "¥",
|
||||
"getSmsCode": "获取验证码",
|
||||
"smsCodeChangeText": "秒后重新获取",
|
||||
@ -39,8 +41,9 @@
|
||||
"incompletePay": "未完成支付",
|
||||
"getting": "获取支付结果中"
|
||||
},
|
||||
"memberLanguage": "与你分享我的观点,共享真实世界",
|
||||
"myBalance": "我的余额",
|
||||
"myPoint": "我的积分",
|
||||
"customerService": "联系客服"
|
||||
"customerService": "联系客服",
|
||||
"siteClose": "站点已关闭",
|
||||
"siteNonexistence": "站点不存在"
|
||||
}
|
||||
@ -1,279 +1,291 @@
|
||||
{
|
||||
"pages": [ // pages数组中第一项表示应用启动页,参考:https://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
|
||||
},
|
||||
"pages": [ // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/member/commission",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.commission%"
|
||||
},
|
||||
"needLogin": true
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "%pages.index.index%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/balance",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.balance%"
|
||||
},
|
||||
"needLogin": true
|
||||
"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/member/recharge_record",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.recharge_record%"
|
||||
},
|
||||
"needLogin": true
|
||||
"path": "pages/index/close",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "%pages.index.close%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/nonexistence",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "%pages.index.nonexistence%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/recharge_record_detail",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.recharge_record_detail%"
|
||||
},
|
||||
"needLogin": true
|
||||
"path": "pages/article/detail",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.article.detail%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/detailed_account",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.detailed_account%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/cash_out",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.cash_out%"
|
||||
}
|
||||
{
|
||||
"path": "pages/member/apply_cash_out",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.apply_cash_out%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/cash_out_detail",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.cash_out_detail%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "%pages.member.index%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/info",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.info%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/personal",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.personal%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/point",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.point%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/account",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.account%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/account_edit",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.account_edit%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/pay/browser",
|
||||
"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%"
|
||||
}
|
||||
}
|
||||
],
|
||||
"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-system-(\W.*)": "@/components/diy/system/$1/index.vue",
|
||||
"diy-extend-(\W.*)": "@/components/diy/extend/$1/index.vue",
|
||||
"diy-(\W.*)": "@/components/diy/$1/index.vue"
|
||||
}
|
||||
}
|
||||
{
|
||||
"path": "pages/member/commission",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.commission%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/balance",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.balance%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/recharge_record",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.recharge_record%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/recharge_record_detail",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.recharge_record_detail%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/detailed_account",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.detailed_account%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/cash_out",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.cash_out%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/cash_out_detail",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.cash_out_detail%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "%pages.member.index%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/info",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.info%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/personal",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.personal%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/point",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.point%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/account",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.account%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/member/account_edit",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "%pages.member.account_edit%"
|
||||
},
|
||||
"needLogin": true
|
||||
},
|
||||
{
|
||||
"path": "pages/pay/browser",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -24,7 +24,7 @@
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
</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 :checked="isAgree" shape="shape" size="14" @change="agreeChange"
|
||||
:customStyle="{'marginTop': '4rpx'}" />
|
||||
@ -47,7 +47,8 @@
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="mt-[30rpx]">
|
||||
<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>
|
||||
<!-- #endif -->
|
||||
</u-form>
|
||||
@ -62,11 +63,16 @@
|
||||
import { bind } from '@/api/auth'
|
||||
import { bindMobile } from '@/api/member'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import useConfigStore from '@/stores/config'
|
||||
import { useLogin } from '@/hooks/useLogin'
|
||||
import { redirect } from '@/utils/common'
|
||||
|
||||
const memberStore = useMemberStore()
|
||||
const info = computed(() => memberStore.info)
|
||||
|
||||
const config = computed(() => {
|
||||
return useConfigStore().login
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const isAgree = ref(false)
|
||||
@ -106,16 +112,15 @@
|
||||
const agreeChange = () => {
|
||||
isAgree.value = !isAgree.value
|
||||
}
|
||||
|
||||
const agreeTips = () => {
|
||||
uni.showToast({ title: `${t('pleaceAgree')}《${t('userAgreement')}》《${t('privacyAgreement')}》`, icon: 'none' })
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
|
||||
const handleBind = () => {
|
||||
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
|
||||
loading.value = true
|
||||
|
||||
@ -135,8 +140,9 @@
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
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' })
|
||||
return
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
</u-form>
|
||||
</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') }}
|
||||
<app-link url="/pages/auth/agreement?key=service">
|
||||
<text class="text-primary">{{ t('userAgreement') }}</text>
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
</u-form>
|
||||
</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') }}
|
||||
<app-link url="/pages/auth/agreement?key=service">
|
||||
<text class="text-primary">{{ t('userAgreement') }}</text>
|
||||
|
||||
16
uni-app/pages/index/close.vue
Normal file
16
uni-app/pages/index/close.vue
Normal 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>
|
||||
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
@ -13,6 +15,7 @@
|
||||
import { getDiyInfo } from '@/api/diy';
|
||||
import useDiyStore from '@/stores/diy';
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
import { img } from '@/utils/common';
|
||||
|
||||
const { setShare, onShareAppMessage, onShareTimeline } = useShare()
|
||||
onShareAppMessage()
|
||||
@ -58,22 +61,39 @@
|
||||
id: id.value,
|
||||
name: name.value
|
||||
}).then((res : any) => {
|
||||
if (res.data.value) {
|
||||
let sources = JSON.parse(res.data.value);
|
||||
diyData.global = sources.global;
|
||||
diyData.value = sources.value;
|
||||
uni.setNavigationBarTitle({
|
||||
title: diyData.global.title
|
||||
})
|
||||
}
|
||||
if (res.data.value) {
|
||||
let sources = JSON.parse(res.data.value);
|
||||
diyData.global = sources.global;
|
||||
diyData.value = sources.value;
|
||||
diyData.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' + ';';
|
||||
}
|
||||
});
|
||||
uni.setNavigationBarTitle({
|
||||
title: diyData.global.title
|
||||
})
|
||||
}
|
||||
|
||||
let share = res.data.share ? JSON.parse(res.data.share) : null;
|
||||
setShare(share);
|
||||
let share = res.data.share ? JSON.parse(res.data.share) : null;
|
||||
setShare(share);
|
||||
|
||||
loading.value = false;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.bg-index {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background-size: 100% !important;
|
||||
background-repeat: no-repeat !important;
|
||||
}
|
||||
</style>
|
||||
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
@ -13,6 +15,7 @@
|
||||
import { getDiyInfo } from '@/api/diy';
|
||||
import useDiyStore from '@/stores/diy';
|
||||
import { useShare } from '@/hooks/useShare'
|
||||
import { img } from '@/utils/common';
|
||||
|
||||
const { setShare, onShareAppMessage, onShareTimeline } = useShare()
|
||||
setShare();
|
||||
@ -53,20 +56,37 @@
|
||||
getDiyInfo({
|
||||
name: 'DIY_INDEX'
|
||||
}).then((res : any) => {
|
||||
if (res.data.value) {
|
||||
let sources = JSON.parse(res.data.value);
|
||||
diyData.global = sources.global;
|
||||
diyData.value = sources.value;
|
||||
uni.setNavigationBarTitle({
|
||||
title: diyData.global.title
|
||||
})
|
||||
}
|
||||
if (res.data.value) {
|
||||
let sources = JSON.parse(res.data.value);
|
||||
diyData.global = sources.global;
|
||||
diyData.value = sources.value;
|
||||
diyData.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' + ';';
|
||||
}
|
||||
});
|
||||
uni.setNavigationBarTitle({
|
||||
title: diyData.global.title
|
||||
})
|
||||
}
|
||||
|
||||
loading.value = false;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.bg-index {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background-size: 100% !important;
|
||||
background-repeat: no-repeat !important;
|
||||
}
|
||||
</style>
|
||||
16
uni-app/pages/index/nonexistence.vue
Normal file
16
uni-app/pages/index/nonexistence.vue
Normal 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>
|
||||
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
@ -13,6 +15,7 @@
|
||||
import { getDiyInfo } from '@/api/diy'
|
||||
import useDiyStore from '@/stores/diy'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import { img } from '@/utils/common';
|
||||
|
||||
const loading = ref(true);
|
||||
const diyStore = useDiyStore();
|
||||
@ -48,19 +51,37 @@
|
||||
getDiyInfo({
|
||||
name: 'DIY_MEMBER_INDEX'
|
||||
}).then((res : any) => {
|
||||
if (res.data.value) {
|
||||
let sources = JSON.parse(res.data.value);
|
||||
diyData.global = sources.global;
|
||||
diyData.value = sources.value;
|
||||
uni.setNavigationBarTitle({
|
||||
title: diyData.global.title
|
||||
})
|
||||
}
|
||||
loading.value = false;
|
||||
if (res.data.value) {
|
||||
let sources = JSON.parse(res.data.value);
|
||||
diyData.global = sources.global;
|
||||
diyData.value = sources.value;
|
||||
diyData.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' + ';';
|
||||
}
|
||||
});
|
||||
uni.setNavigationBarTitle({
|
||||
title: diyData.global.title
|
||||
})
|
||||
}
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
useMemberStore().getMemberInfo()
|
||||
});
|
||||
</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>
|
||||
@ -1,46 +1,46 @@
|
||||
<template>
|
||||
<view class="member-record-detail">
|
||||
<view class="money-wrap">
|
||||
<text>-{{ cashOutInfo.apply_money }}</text>
|
||||
<text>{{ cashOutInfo.status_name }}</text>
|
||||
<text>-{{ rechargeInfo.apply_money }}</text>
|
||||
<text>{{ rechargeInfo.status_name }}</text>
|
||||
</view>
|
||||
<!-- 状态0待审核1.待转账2已转账 -1拒绝' -->
|
||||
<view class="item">
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{t('cashOutNo')}}</text>
|
||||
<text class="value">{{ cashOutInfo.cash_out_no }}</text>
|
||||
<text class="value">{{ rechargeInfo.cash_out_no }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{t('serviceMoney')}}</text>
|
||||
<text class="value">¥{{ cashOutInfo.service_money }}</text>
|
||||
<text class="value">¥{{ rechargeInfo.service_money }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{t('createTime')}}</text>
|
||||
<text class="value">{{ cashOutInfo.create_time }}</text>
|
||||
<text class="value">{{ rechargeInfo.create_time }}</text>
|
||||
</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="value">{{ cashOutInfo.audit_time }}</text>
|
||||
<text class="value">{{ rechargeInfo.audit_time }}</text>
|
||||
</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="value">{{ cashOutInfo.transfer_bank }}</text>
|
||||
<text class="value">{{ rechargeInfo.transfer_bank }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{t('transferAccount')}}</text>
|
||||
<text class="value">{{ cashOutInfo.transfer_account }}</text>
|
||||
<text class="value">{{ rechargeInfo.transfer_account }}</text>
|
||||
</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="value">{{ cashOutInfo.refuse_reason }}</text>
|
||||
<text class="value">{{ rechargeInfo.refuse_reason }}</text>
|
||||
</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="value">{{ cashOutInfo.transfer_type_name }}</text>
|
||||
<text class="value">{{ rechargeInfo.transfer_type_name }}</text>
|
||||
</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="value">{{ cashOutInfo.transfer_time }}</text>
|
||||
<text class="value">{{ rechargeInfo.transfer_time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -53,18 +53,18 @@ import { t } from '@/locale'
|
||||
import { redirect, img } from '@/utils/common';
|
||||
import { getRechargeDetail } from '@/api/member';
|
||||
|
||||
let cashOutInfo = ref({});
|
||||
let rechargeInfo = ref({});
|
||||
let loading = ref<boolean>(false);
|
||||
onLoad((option) => {
|
||||
let id = option.id || "";
|
||||
getCashoutAccountListFn(id)
|
||||
getRechargeDetailFn(id)
|
||||
})
|
||||
|
||||
const getCashoutAccountListFn = (id) => {
|
||||
const getRechargeDetailFn = (id) => {
|
||||
loading.value = false;
|
||||
|
||||
getRechargeDetail(id).then((res) => {
|
||||
cashOutInfo.value = res.data;
|
||||
rechargeInfo.value = res.data;
|
||||
loading.value = true;
|
||||
}).catch(() => {
|
||||
loading.value = true;
|
||||
|
||||
@ -7,7 +7,8 @@ interface loginConfig {
|
||||
is_username: number | boolean,
|
||||
is_mobile: number | boolean,
|
||||
is_auth_register: number | boolean,
|
||||
is_bind_mobile: number | boolean
|
||||
is_bind_mobile: number | boolean,
|
||||
agreement_show: number | boolean
|
||||
}
|
||||
|
||||
interface tabbarConfig {
|
||||
@ -30,7 +31,8 @@ const useConfigStore = defineStore('config', {
|
||||
is_username: 0,
|
||||
is_mobile: 0,
|
||||
is_auth_register: 0,
|
||||
is_bind_mobile: 0
|
||||
is_bind_mobile: 0,
|
||||
agreement_show: 0
|
||||
},
|
||||
tabbar: null
|
||||
}
|
||||
@ -42,6 +44,7 @@ const useConfigStore = defineStore('config', {
|
||||
this.login.is_mobile = parseInt(res.data.is_mobile)
|
||||
this.login.is_auth_register = parseInt(res.data.is_auth_register)
|
||||
this.login.is_bind_mobile = parseInt(res.data.is_bind_mobile)
|
||||
this.login.agreement_show = parseInt(res.data.agreement_show)
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
|
||||
@ -7,7 +7,7 @@ interface Diy {
|
||||
global : {
|
||||
title : string,
|
||||
pageBgColor : string, // 页面背景颜色
|
||||
tabbarSwitch : boolean, // 底部导航开关
|
||||
bottomTabBarSwitch : boolean, // 底部导航开关
|
||||
},
|
||||
// 组件集合
|
||||
value : any[]
|
||||
@ -21,7 +21,8 @@ const useDiyStore = defineStore('diy', {
|
||||
global: {
|
||||
title: "",
|
||||
pageBgColor: "", // 页面背景颜色
|
||||
tabbarSwitch: true
|
||||
bottomTabBarSwitch: true,
|
||||
bgUrl: ''
|
||||
},
|
||||
// 组件集合
|
||||
value: []
|
||||
@ -45,13 +46,26 @@ const useDiyStore = defineStore('diy', {
|
||||
try {
|
||||
let data = JSON.parse(event.data);
|
||||
this.currentIndex = data.currentIndex;
|
||||
this.global = data.global;
|
||||
this.value = data.value;
|
||||
if(data.global) this.global = data.global;
|
||||
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);
|
||||
} catch (e) {
|
||||
console.log('uniapp接受数据错误', e)
|
||||
}
|
||||
});
|
||||
}, false);
|
||||
// #endif
|
||||
},
|
||||
// 将数据传输给后台
|
||||
@ -73,10 +87,10 @@ const useDiyStore = defineStore('diy', {
|
||||
// 选中正在编辑的组件
|
||||
changeCurrentIndex(index : number, component : any = null) {
|
||||
// #ifdef H5
|
||||
|
||||
|
||||
// 实际展示禁止编辑
|
||||
if (this.mode == '') return;
|
||||
|
||||
|
||||
// 减少重复请求
|
||||
if (this.currentIndex == index) return;
|
||||
this.currentIndex = index;
|
||||
|
||||
29
uni-app/stores/system.ts
Normal file
29
uni-app/stores/system.ts
Normal 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
|
||||
@ -1,5 +1,6 @@
|
||||
import { getToken, getAppChannel } from './common'
|
||||
import useMemberStore from '@/stores/member'
|
||||
import { t } from '@/locale'
|
||||
|
||||
interface RequestConfig {
|
||||
showErrorMessage ?: boolean
|
||||
@ -121,6 +122,9 @@ class Request {
|
||||
},
|
||||
fail: res => {
|
||||
reject(res)
|
||||
},
|
||||
complete: (res) => {
|
||||
this.handleRequestFail(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -133,6 +137,23 @@ class Request {
|
||||
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()
|
||||
Loading…
x
Reference in New Issue
Block a user