feat: 设置分享转发
This commit is contained in:
@@ -18,6 +18,7 @@ export default defineConfig(async (merge, { command, mode }) => {
|
|||||||
640: 2.34 / 2,
|
640: 2.34 / 2,
|
||||||
750: 1,
|
750: 1,
|
||||||
375: 2,
|
375: 2,
|
||||||
|
// 375: 2/1,
|
||||||
828: 1.81 / 2
|
828: 1.81 / 2
|
||||||
},
|
},
|
||||||
sourceRoot: 'src',
|
sourceRoot: 'src',
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '首页'
|
navigationBarTitleText: '数字游民'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { View, Text, Image } from "@tarojs/components";
|
import { View, Text, Image } from "@tarojs/components";
|
||||||
import { useLoad } from "@tarojs/taro";
|
import { useLoad } from "@tarojs/taro";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
import { AtAvatar, AtTag, AtIcon, AtTabBar } from "taro-ui";
|
import { AtAvatar, AtTag, AtIcon, AtTabBar } from "taro-ui";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
import beijing from "@/images/city/beijing.jpg";
|
import beijing from "@/images/city/beijing.jpg";
|
||||||
import { VIEW } from "@tarojs/runtime";
|
import { VIEW } from "@tarojs/runtime";
|
||||||
|
import { useEffect } from "react";
|
||||||
// import beijing from "../../images/city/beijing.jpg";
|
// import beijing from "../../images/city/beijing.jpg";
|
||||||
|
|
||||||
export default function Index() {
|
export default function Index() {
|
||||||
@@ -12,6 +13,30 @@ export default function Index() {
|
|||||||
console.log("Page loaded.");
|
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 = () => {
|
const HomeCardItem = () => {
|
||||||
return [1, 2, 3].map((item, index) => {
|
return [1, 2, 3].map((item, index) => {
|
||||||
return (
|
return (
|
||||||
@@ -68,7 +93,6 @@ export default function Index() {
|
|||||||
<HomeCardItem />
|
<HomeCardItem />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
||||||
{/* 底部tabbar */}
|
{/* 底部tabbar */}
|
||||||
<View className="tabbbar">
|
<View className="tabbbar">
|
||||||
<AtTabBar
|
<AtTabBar
|
||||||
|
|||||||
Reference in New Issue
Block a user