six_uniapp_0006

This commit is contained in:
doudou201703
2026-09-19 11:48:36 +08:00
parent 830f6ca2a2
commit d90e244633
17 changed files with 361 additions and 417 deletions
+103 -42
View File
@@ -2,7 +2,6 @@
//@import "@/assets/demo.scss";
.phone-screen {
box-sizing: border-box;
font-size: 28rpx;
font-family: "xiaoFont", sans-serif;
height: v-bind(pxScreenHeight);
//background-image: url("https://hudie.xiao.band/wechatbackimg.png");
@@ -84,57 +83,61 @@
}
</style>
<template>
<view class="phone-screen">
<wd-config-provider :theme="theme">
<view class="root-container">
<view class="status-wifi-nav">
<ChildComScroll v-model:pxScreenHeight="pxScreenHeight"
v-model:info_scroll_height="info_scroll_height"
v-model:pxWindowHeight="pxWindowHeight"
v-model:statusHeight="statusHeight"
:modelValue="modelValue" @homeLeft="homeLeft"
@homeRight="homeRight">
</ChildComScroll>
<page-meta class="page-meta" rootFontSize="32rpx" :pageStyle="`height: ${pxScreenHeight};`">
<view class="phone-screen">
<wd-config-provider :theme="theme">
<view class="root-container">
<view class="status-wifi-nav">
<ChildComScroll v-model:pxScreenHeight="pxScreenHeight"
v-model:info_scroll_height="info_scroll_height"
v-model:pxWindowHeight="pxWindowHeight"
v-model:statusHeight="statusHeight"
:modelValue="modelValue" @homeLeft="homeLeft"
@homeRight="homeRight">
</ChildComScroll>
</view>
<view class="scrollTopHeigh"><!--预留的空间高度--></view>
<scroll-view :enableBackToTop="true" :enhanced="true" :scroll-y="true" :showScrollbar="false"
class="scrollViewHeigh">
<view class="page_1_title">
<home-com-image></home-com-image>
</view>
<view class="line-widht-number" style="height: 20rpx"></view>
<view class="page_1_chao_hua_shuai">
<home-com-chao-hua-shuai></home-com-chao-hua-shuai>
</view>
<view class="line-widht-number" style="height: 10rpx"></view>
<view class="page_1_chao_hong">
<home-com-hong-meng :hong-height="info_scroll_height"
:css_com_height="css_com_height">
</home-com-hong-meng>
</view>
</scroll-view>
<view class="scrollBottomHeigh">
<!--底部预留区域-->
</view>
<!--滚动区域结束-->
</view>
<view class="scrollTopHeigh"><!--预留的空间高度--></view>
<scroll-view :enableBackToTop="true" :enhanced="true" :scroll-y="true" :showScrollbar="false"
class="scrollViewHeigh">
<view class="page_1_title">
<home-com-image></home-com-image>
</view>
<view class="line-widht-number" style="height: 20rpx"></view>
<view class="page_1_chao_hua_shuai">
<home-com-chao-hua-shuai></home-com-chao-hua-shuai>
</view>
<view class="line-widht-number" style="height: 10rpx"></view>
<view class="page_1_chao_hong">
</wd-config-provider>
<wd-toast selector="default-toast"/>
<wd-message-box selector="default-message-box"/>
</view>
<home-com-hong-meng :hong-height="info_scroll_height"
:css_com_height="css_com_height"></home-com-hong-meng>
</view>
</scroll-view>
<view class="scrollBottomHeigh">
<!--底部预留区域-->
</view>
<!--滚动区域结束-->
</view>
</wd-config-provider>
<wd-toast selector="default-toast"/>
<wd-message-box selector="default-message-box"/>
</view>
</page-meta>
</template>
<script lang="ts" setup>
import ChildComScroll from "@/components/ChildComScroll.vue";
import {ref} from "vue";
import type {GlobelsChildPropsType} from "@/types/通用类型";
import {onTabItemTap} from "@dcloudio/uni-app";
import type {ApiAxiosResponse, GlobelsChildPropsType} from "@/types/通用类型";
import {onLoad, onShareAppMessage, onShareTimeline, onTabItemTap} from "@dcloudio/uni-app";
import {useMessage, useToast} from "wot-design-uni";
import type {ConfigProviderTheme} from "wot-design-uni/components/wd-config-provider/types";
import {useMainXiaoStore} from "@/stores/piniaPro/miniChatStore";
import HomeComImage from "@/pageTabBar/Home/首页组件图片.vue";
import HomeComChaoHuaShuai from "@/pageTabBar/Home/首页组件超划算.vue";
import HomeComHongMeng from "@/pageTabBar/Home/首页组件红包.vue";
import {usePage, useRequest} from "@uni-helper/uni-use";
import {分享_HOME页面分享到朋友圈, 分享_HOME页面分享到群或者好友} from "@/hooks/接口API";
let xiaoMain = useMainXiaoStore();
defineOptions({options: {styleIsolation: "shared"}}); // 组件使用
@@ -166,13 +169,12 @@
isShowRight: {
showCom: "icon",
img: {imgRight: xiao_six_img},
iconTextRight: {classPrefix: "wd-icon", name: "app", size: 20},
iconTextRight: {classPrefix: "wd-icon", name: "app1", size: 20},
},
title_text: "六果泡泡", navIsShow: "default",
};
const homeLeft = () => {
wx.vibrateShort({type: "heavy"});//medium heavy light
uni.navigateBack({delta: 1}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"}));
};
const homeRight = () => {
@@ -187,4 +189,63 @@
console.log("🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 🍊 🍎 🍏 ");
wx.vibrateShort({type: "heavy"});//medium heavy light
});
onLoad((query) => {
let page_path = usePage().value.route;
const instance = getCurrentInstance();
uni.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"], // 关键!明确启用哪些功能 "shareTimeline"
});
onShareAppMessage((options: Page.ShareAppMessageOption) => {
return {
title: "",
path: page_path,
desc: "",
imageUrl: "",
promise: new Promise<Page.CustomShareContent>(async (resolve) => {
try {
let dataPostData = await useRequest<ApiAxiosResponse<Array<string>, Page.CustomShareContent>>(分享_HOME页面分享到群或者好友, {
method: "POST", data: {
self_mini_openid: xiaoMain.mini_openid, self_mini_unionid: xiaoMain.mini_unionid,
page_path: page_path,
}
});
resolve(dataPostData.data.value?.resData.dictData ?? {});
} catch (e) {
console.log("捕获错误❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍♀️", e);
}
}),
};
});
onShareTimeline(() => {
return {
title: "", //自定义标题,即朋友圈列表页上显示的标题默认值为小程序的名称
imageUrl: "",//imageUrl:自定义图片路径,可以是本地文件或者网络图片
query: "",
path: page_path,
promise: new Promise<Page.ShareTimelineContent>(async (resolve, reject) => {
try {
let dataPostData = await useRequest<ApiAxiosResponse<Array<string>, Page.CustomShareContent>>(分享_HOME页面分享到朋友圈, {
method: "POST", data: {
self_mini_openid: xiaoMain.mini_openid, self_mini_unionid: xiaoMain.mini_unionid,
page_path: page_path,
}
});
resolve(dataPostData.data.value?.resData.dictData ?? {});
} catch (e) {
console.log("捕获错误❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍♀️", e);
}
}),
};
});
wx.onCopyUrl(() => {
// return {query: `superior_unionid=${xiao_main.self_user_unionid}`};
return {query: "superior_unionid=" + xiaoMain.mini_unionid};
});
});
</script>