当前位置:网站首页>Applet setting button sharing function
Applet setting button sharing function
2022-06-26 17:47:00 【My hair is still there.】
General applet sharing can be done through the sharing function in the upper right corner , If you want to set the button in the page . It can be set like this :
design sketch :

WXML in :
Definition button Button to trigger the sharing event , stay button The label says open-type='share’ attribute
<button open-type='share'> Share with friends </button>WXCSS in :
Need to get rid of it. button Some styles of
button::after {
border: none;
}
button {
background-color: #fff;
}JS in :
onShareAppMessage() {
return {
title: ' The sharing title displayed when sharing pops up '
path: '/page/user?id=123' // route , Pass parameters to the specified page .
imgUrl: '', // Custom image path , It can be a local file path 、 Code package file path or network image path , the
a PNG And JPG, Don't pass in imageUrl Use the default screenshot . The aspect ratio of the display image is 5:4
}
},Share with friends
example :
// Users click on the upper right corner to share an example of a circle of friends
// onShareTimeline: function () {
// return {
// title: '',
// query: {
// key: value
// },
// imageUrl: ''
// }
// },Page({
// Custom function
// Users click on the upper right corner to share with friends , First set it up in the sharing friends menus Two parameters of , To share a circle of friends
onShareAppMessage: function() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
},
// Share with friends
onShareTimeline () {
return {
title: this.current_viewing.name,
query: '/pages/home/view/artdetail?storeId=' + this.storeId + '&id=' +
this.current_viewing.id + '&customerId=' + this.customerId + '&genre=' +
this.current_viewing.genre,
}
}
// Life cycle function -- Monitor page loading
onLoad: function(options) {
},
})边栏推荐
- vue--vuerouter缓存路由组件
- Platform management background and merchant menu resource management: merchant registration management design
- Live broadcast preview | how can programmers improve R & D efficiency? On the evening of June 21, the video number and station B will broadcast live at the same time. See you or leave!
- [ten thousand words summary] starting from the end, analyze in detail how to fill in the college entrance examination volunteers
- Troubleshooting ideas that can solve 80% of faults!
- [npoi] C copy sheet template across workbooks to export Excel
- 类型多样的石膏PBR多通道贴图素材,速来收藏!
- Platform management background and merchant menu resource management: Design of platform management background data service
- Play with Linux and easily install and configure MySQL
- 玩轉Linux,輕松安裝配置MySQL
猜你喜欢

Necessary decorator mode for 3 years' work

Microservice architecture practice: user login and account switching design, order query design of the mall

Leetcode HOT100 (22--- bracket generation)
![[C language] static modifies local variables](/img/bf/9084d2e924c3e1e244568562a83d74.jpg)
[C language] static modifies local variables

MySql 导出数据库中的全部表索引

【推荐系统学习】推荐系统架构

Which low code platform is more friendly to Xiaobai? Here comes the professional evaluation!

The latest masterpiece of Alibaba, which took 182 days to produce 1015 pages of distributed full stack manual, is so delicious

背包问题求方案数

VSCode使用 - Remote-SSH 配置说明
随机推荐
量化合约系统开发分析案例丨合约量化系统开发方案详解
Microservice architecture practice: user login and account switching design, order query design of the mall
wechat_微信小程序中解决navigator进行页面跳转并传递参数问题
Live broadcast preview | how can programmers improve R & D efficiency? On the evening of June 21, the video number and station B will broadcast live at the same time. See you or leave!
国信证券怎么开户?通过链接办理股票开户安全吗
Tencent qianzhiming: Exploration and application of pre training methods in information flow business
【QNX】命令
Jouer avec Linux et installer et configurer MySQL facilement
Halcon's region: features of multiple regions (5)
Here comes the hero League full skin Downloader
牛客网:设计LRU缓存结构 设计LFU缓存结构
vutils.make_grid()与黑白图像有关的一个小体会
halcon之区域:多种区域(Region)特征(5)
手写promise.all
Prometeus 2.34.0 new features
Quantitative contract system development analysis case - detailed explanation of contract quantitative system development scheme
【推荐系统学习】推荐系统的技术栈
小程序设置按钮分享功能
Leetcode HOT100 (22--- bracket generation)
如何将应用加入到deviceidle 白名单?