"use strict"; const common_vendor = require("../../common/vendor.js"); const core_config_index = require("../config/index.js"); const share = { data() { return { share: { // 转发的标题 (默认标题) title: core_config_index.config.get("name"), // 默认是当前页面,必须是以‘/’开头的完整路径 path: `/pages/home/index`, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径, //支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 imageUrl: core_config_index.config.getResource("logo.png") } }; }, // 发送给朋友 onShareAppMessage(res) { let shareInfo = common_vendor.index.getStorageSync("shareInfo"); return { title: shareInfo.title || this.share.title, imageUrl: shareInfo.imgUrl || this.share.imageUrl, path: shareInfo.path || this.share.path }; }, //分享到朋友圈 onShareTimeline(res) { let shareInfo = common_vendor.index.getStorageSync("shareInfo"); return { title: shareInfo.title || this.share.title, imageUrl: shareInfo.imgUrl || this.share.imageUrl, path: shareInfo.path || this.share.path }; } }; exports.share = share;