当前位置:网站首页>Wechat applet sharing page, sharing to the circle of friends
Wechat applet sharing page, sharing to the circle of friends
2022-06-29 09:17:00 【swag_ Special actor】
You can go to Wechat development documents see
This wechat has been sealed 

Look at the code

<template>
<view>my</view>
<!-- Entry prompt -->
<view
class="sharetip"
wx:if="{
{shareTipShow}}"
style="height: {
{ !bottomNum ? mainHeight-30 : mainHeight}}px"
>
<view class="tip_content"> Click the menu in the upper right corner , You can share it with your friends to help fill in !</view>
<view class="tip_buttom" catchtap="closeShareTip"> I got it! </view>
</view>
</template>
<script>
import {
createPage } from '@mpxjs/core'
import store from '../store'
const app = getApp()
createPage({
data: {
mainHeight: app.globalData.mainHeight - 51,
shareTipShow: true
},
computed: {
bottomNum() {
return store.state.bottomNum
}
},
onLoad(options) {
// Judge from the parameters where it comes from , Return directly to the sharing page
if (options.from === 'timeline' || options.from === 'share') {
// This can directly close all pages and open any page
// wx.reLaunch({
// url: '/pages/my'
// })
// Because this is tab page , Handle tabActive problem
store.commit('CHANGE_TABER', 'my')
}
},
methods: {
// Forward to a friend
onShareAppMessage(res) {
console.log(res)
return {
title: ' Test forwarding ',
path: '/pages/my?from=share' // Configure the shared page path , You can also write other , You can write the home page
}
},
// Circle of friends
onShareTimeline(res) {
return {
title: ' Test forwarding to the circle of friends ',
query: 'test= test &from=timeline' // Parameters to carry , Cannot customize path , Only the current sharing page
}
},
closeShareTip() {
this.setData({
shareTipShow: false
})
}
}
})
</script>
<style lang="stylus" scoped>
.sharetip
position fixed
top 0
left 0
width 100%
background rgba(0, 0, 0, 0.6)
.tip_content
background #fff
border-radius 40px
width 80%
padding 6px 12px 6px 12px
position absolute
top 30%
right 10%
.tip_buttom
position absolute
top 50%
left 50%
transform translateX(-50%)
background #fff
border-radius 40px
padding 6px 12px 6px 12px
</style>
effect



边栏推荐
- Product manager certification enrollment brochure (NPDP) in July 2022
- Augfpn: improved multiscale feature learning for target detection
- Cdga | what is the core of digital transformation in the transportation industry?
- GPU训练云平台记录
- [to.Net] C data model, from Entity Framework core to LINQ
- MySQL的分库分表策略及应用场景
- General multiplier design, verilog code
- MT-yolov6训练及测试
- Multiplier design (pipeline) Verilog code
- Verilog data type
猜你喜欢
随机推荐
uni-app获取当前页面路由url
在 golang 中是如何对 epoll 进行封装的?
DevOps到底是什么意思?
July 2022 (advanced soft test) information system project manager certification enrollment Brochure
Working for many years, recalling life -- three years in high school
js轮播图观后重做(较长的完整版,可运行)
微信小程序底部导航栏中间突出
verilog 移位操作符
PointNet/Pointnet++训练及测试
Activemq消息组件发布订阅ReDelivery消息重新投递
Network learning of pointnet
Solutions to ineffective uniapp import components
MYSQL行转列例子
微信小程序分享页面,分享到朋友圈
手机开户一般哪个证券公司好?究竟网上开户是否安全么?
ServerApp. iopub
专业结构record
记微信小程序分享代码片段
乘法器设计(流水线)verilog code
Cdga | what is the core of digital transformation in the transportation industry?








