feat:适配小程序
This commit is contained in:
1 parent
05f921349a
commit
c3a32a8e58
3 files changed
+72
-68
No files matched your search
+26
-8
@@ -89,6 +89,13 @@
|
||||
// "group": "商城"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/wechat-tabbar/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请福利",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/home/home",
|
||||
"style": {
|
||||
@@ -313,13 +320,6 @@
|
||||
{
|
||||
"root": "pages/wechat",
|
||||
"pages": [
|
||||
{
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请福利",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/gift/index",
|
||||
"style": {
|
||||
@@ -960,6 +960,23 @@
|
||||
"selectedColor": "#D29E52",
|
||||
"backgroundColor": "#222222",
|
||||
"borderStyle": "black",
|
||||
/* #ifdef MP-WEIXIN */
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/wechat-tabbar/index",
|
||||
"text": "邀请福利",
|
||||
"iconPath": "static/tabbar/moments.png",
|
||||
"selectedIconPath": "static/tabbar/moments-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/profile/profile",
|
||||
"text": "我的",
|
||||
"iconPath": "static/tabbar/profile.png",
|
||||
"selectedIconPath": "static/tabbar/profile-active.png"
|
||||
}
|
||||
],
|
||||
/* #endif MP-WEIXIN */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/home/home",
|
||||
@@ -986,5 +1003,6 @@
|
||||
"selectedIconPath": "static/tabbar/profile-active.png"
|
||||
}
|
||||
]
|
||||
/* #endif MP-WEIXIN */
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -1,75 +1,61 @@
|
||||
<template>
|
||||
<scroll-view
|
||||
scroll-y
|
||||
refresher-enabled
|
||||
enable-back-to-top
|
||||
refresher-background="#222"
|
||||
:refresher-triggered="refresherTriggered"
|
||||
:refresher-threshold="100"
|
||||
@refresherabort="onRefresherAbort"
|
||||
@refresherrefresh="onRefresherRefresh"
|
||||
@scrolltolower="onScrollToLower"
|
||||
@scroll="scroll"
|
||||
v-bind="attrs"
|
||||
>
|
||||
<scroll-view scroll-y refresher-enabled enable-back-to-top refresher-background="#222"
|
||||
:refresher-triggered="refresherTriggered" :refresher-threshold="100" @refresherabort="onRefresherAbort"
|
||||
@refresherrefresh="onRefresherRefresh" @scrolltolower="onScrollToLower" @scroll="scroll">
|
||||
<slot />
|
||||
<uni-load-more
|
||||
:status="loadMoreStatus"
|
||||
:content-text="loadMoreContent"
|
||||
@clickLoadMore="onScrollToLower"
|
||||
/>
|
||||
<uni-load-more :status="loadMoreStatus" :content-text="loadMoreContent" @clickLoadMore="onScrollToLower" />
|
||||
<view style="height: 100rpx"></view>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, useAttrs } from 'vue';
|
||||
import { reactive, ref, useAttrs } from 'vue';
|
||||
|
||||
const attrs = useAttrs();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
loadMoreStatus?: 'more' | 'loading' | 'noMore';
|
||||
}>(),
|
||||
{
|
||||
loadMoreStatus: 'noMore',
|
||||
},
|
||||
);
|
||||
const emit = defineEmits<{
|
||||
(e: 'refresh', done: () => void): void;
|
||||
(e: 'loadMore'): void;
|
||||
(e: 'scroll', event: any): void;
|
||||
}>();
|
||||
const attrs = useAttrs();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
loadMoreStatus?: 'more' | 'loading' | 'noMore';
|
||||
}>(),
|
||||
{
|
||||
loadMoreStatus: 'noMore',
|
||||
},
|
||||
);
|
||||
const emit = defineEmits<{
|
||||
(e: 'refresh', done: () => void): void;
|
||||
(e: 'loadMore'): void;
|
||||
(e: 'scroll', event: any): void;
|
||||
}>();
|
||||
|
||||
const refresherTriggered = ref(false);
|
||||
const refresherTriggered = ref(false);
|
||||
|
||||
const loadMoreContent = reactive({
|
||||
contentdown: '正在加载...',
|
||||
contentrefresh: '正在加载...',
|
||||
contentnomore: '没有更多数据了',
|
||||
});
|
||||
const loadMoreContent = reactive({
|
||||
contentdown: '正在加载...',
|
||||
contentrefresh: '正在加载...',
|
||||
contentnomore: '没有更多数据了',
|
||||
});
|
||||
|
||||
// 下拉刷新中止
|
||||
const onRefresherAbort = () => {
|
||||
// 下拉刷新中止
|
||||
const onRefresherAbort = () => {
|
||||
refresherTriggered.value = false;
|
||||
};
|
||||
|
||||
// 触发下拉刷新
|
||||
const onRefresherRefresh = () => {
|
||||
refresherTriggered.value = true;
|
||||
emit('refresh', () => {
|
||||
refresherTriggered.value = false;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
// 触发下拉刷新
|
||||
const onRefresherRefresh = () => {
|
||||
refresherTriggered.value = true;
|
||||
emit('refresh', () => {
|
||||
refresherTriggered.value = false;
|
||||
});
|
||||
};
|
||||
// 触发上拉加载
|
||||
const onScrollToLower = () => {
|
||||
if (props.loadMoreStatus === 'loading' || props.loadMoreStatus === 'noMore') {
|
||||
return;
|
||||
}
|
||||
emit('loadMore');
|
||||
};
|
||||
|
||||
// 触发上拉加载
|
||||
const onScrollToLower = () => {
|
||||
if (props.loadMoreStatus === 'loading' || props.loadMoreStatus === 'noMore') {
|
||||
return;
|
||||
}
|
||||
emit('loadMore');
|
||||
};
|
||||
|
||||
const scroll = (e: any) => {
|
||||
emit('scroll', e);
|
||||
};
|
||||
const scroll = (e: any) => {
|
||||
emit('scroll', e);
|
||||
};
|
||||
</script>
|
||||
Reference in new issue
Block a user