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>
+5 -7
View File
@@ -323,14 +323,13 @@
}
}
}
}
}
}
</style>
<template>
<view class=root-demo>
<view class="root-demo">
<view class="xiaozizi">
<view class="div-left">
<view class="div-left-items div-left-items-1" :class="{'shake-element':shakeBoole}">
@@ -476,7 +475,8 @@
:closeOnClick="true" @clickModal="点击幕帘事件" @close="点击幕帘关闭按钮"
@error="幕帘图片加载报错事件" :showMenuByLongpress="true"
to="/subPackages/homeSubPages/用户积分页面/用户积分页面"
:closeOnClickModal="true"></wd-curtain>
:closeOnClickModal="true">
</wd-curtain>
</view>
</template>
@@ -528,7 +528,7 @@
defineOptions({options: {styleIsolation: "shared"}, name: "home-com-hong-meng"}); // 组件使用
const sendcoupon = async (e: Send发放优惠类回调类型): Promise<void> => {
await wx.vibrateShort({type: xiaoMain.vibrateShort震动效果.heavy});
console.log("这里是事件点击领券时触发", e);
console.log("是怎么触发了呀", e);
if (e.target.send_coupon_result.at(0)?.code === "SUCCESS") {
console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 onSendonSendonSendonSendonSendonSendonSend ",);
let data = await useRequest(卡券_领券后更新当前券的状态, {
@@ -545,7 +545,7 @@
await wx.vibrateShort({type: "heavy"});//medium heavy light
console.log("放到卡包后触发", params);
if (params.target.send_coupon_result.at(0)?.code === "SUCCESS") {
console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 onConfirmonConfirmonConfirmonConfirmonConfirmonConfirmonConfirm ",);
console.log("🍎 🍏 🍎 🍏 🍎 🍏 🍎 🍏 放到卡包后触发放到卡包后触发放到卡包后触发放到卡包后触发放到卡包后触发 ",);
}
};
const 震动效果 = async (): Promise<void> => {
@@ -554,7 +554,6 @@
const info = wx.getDeviceInfo();
wx.onWindowResize(res => {
const w = res.size.windowWidth;
console.log("-----------", w);
// 按窗口宽度切布局,而不是按 model
});
const 进入积分页面展示即时结算的功能 = async (): Promise<void> => {
@@ -635,7 +634,6 @@
console.log(xiaoMain.six_good);
uni.navigateTo({url: "/subPackages/homeSubPages/商品详情页面/商品详情页面"}).then().catch(() => wx.reLaunch({url: "/pageTabBar/Home/Home"}));
}
} catch (e) {
console.log("捕获错误❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍❌🙅🙅‍♀️", e);
}
@@ -192,7 +192,7 @@
</style>
<template>
<view class=home-com-chao-hua-shuai @click="进入商城页面">
<view class="home-com-chao-hua-shuai" @click="进入商城页面">
<view class="hua-shuai-title">
<view class="flex-container">
<view class="flex-container-item">
@@ -224,7 +224,7 @@
</template>
</wd-img>
</view>
<view class="goods-items-name">六果泡泡</view>
<view class="goods-items-name">{{ value.title }}</view>
<view class="goods-items-price">
<view class="name-text-1">
<text class="text-1">¥</text>
@@ -254,9 +254,12 @@
import {ref} from "vue";
const goods_list = ref([
{img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp.png"},
{img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp2.png"},
{img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/139bd00dec9c4e39d6c3cb17fc9a098a.jpg"},
{img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp.png", title: "通用装"},
{img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/sixcp2.png", title: "母婴装"},
{
img_url: "https://hudie.sixgou.com/%E5%85%AD%E6%9E%9C%E4%BA%A7%E5%93%81%E5%9B%BE/139bd00dec9c4e39d6c3cb17fc9a098a.jpg",
title: "强力去污"
},
]);
let theme = ref(uni.getAppBaseInfo().theme); // 返回值为 dark or linght
defineOptions({options: {styleIsolation: "shared"}, name: "home-com-chao-hua-shuai"}); // 组件使用