diff --git a/config/index.js b/config/index.js index 6a8e4e5..56d1e1c 100644 --- a/config/index.js +++ b/config/index.js @@ -18,6 +18,7 @@ export default defineConfig(async (merge, { command, mode }) => { 640: 2.34 / 2, 750: 1, 375: 2, + // 375: 2/1, 828: 1.81 / 2 }, sourceRoot: 'src', diff --git a/src/pages/index/index.config.js b/src/pages/index/index.config.js index 12abc5f..cb08b7b 100644 --- a/src/pages/index/index.config.js +++ b/src/pages/index/index.config.js @@ -1,3 +1,3 @@ export default definePageConfig({ - navigationBarTitleText: '首页' + navigationBarTitleText: '数字游民' }) diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index ec13409..e1e385d 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -1,10 +1,11 @@ import { View, Text, Image } from "@tarojs/components"; import { useLoad } from "@tarojs/taro"; - +import Taro from "@tarojs/taro"; import { AtAvatar, AtTag, AtIcon, AtTabBar } from "taro-ui"; import "./index.scss"; import beijing from "@/images/city/beijing.jpg"; import { VIEW } from "@tarojs/runtime"; +import { useEffect } from "react"; // import beijing from "../../images/city/beijing.jpg"; export default function Index() { @@ -12,6 +13,30 @@ export default function Index() { console.log("Page loaded."); }); + useEffect(() => { + // 更新分享 + Taro.updateShareMenu({ + withShareTicket: true, + success() {}, + }); + + // 显示分享按钮 + Taro.showShareMenu({ + withShareTicket: true, + // showShareItems:true, + }); + + // 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 + Taro.downloadFile({ + url: "https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg", + success: (res) => { + Taro.showShareImageMenu({ + path: res.tempFilePath, + }); + }, + }); + }, []); + const HomeCardItem = () => { return [1, 2, 3].map((item, index) => { return ( @@ -68,7 +93,6 @@ export default function Index() { - {/* 底部tabbar */}