当前位置:网站首页>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



边栏推荐
猜你喜欢
随机推荐
ThinkPHP 6 使用 mongoDB
cokkie和session的区别
AugFPN:改進多尺度特征學習用於目標檢測
记微信小程序setData动态修改字段名
train_on_batch保存一下loss函数变化的图像
Wechat applet project: wechat applet page layout
Instance error iopub data rate exceeded
Let you know today that the passing rate of the PMP Exam is 97%, is it believable
MT yolov6 training and testing
pytorch总结—TENSOR ON GPU
Verilog equivalent operator
什么是超融合?与传统架构有什么区别?.
Heavyweight released "FISCO bcos application landing guide"
What is hyperfusion? What is the difference with traditional architecture
Summary of IO streams
laravel 8 实现 订单表按月份水平分表
Analysis of c voice endpoint detection (VAD) implementation process
微信小程序底部导航栏中间突出
修改exif信息
ServerApp. iopub









