1、效果,注意,在開發(fā)工具中并不顯示公眾號信息,只有在體驗版和正式版中才能看到!
文章來源地址http://www.zghlxwxcb.cn/news/detail-552277.html
?2、wxml代碼實現(xiàn)
<!-- 關(guān)注公眾號彈出 -->
<view wx:if="{{isCloseDown==1}}" class="pop_down">
<view class="panel">
<view class="row_1">
關(guān)注公眾號,馬上參與活動!
</view>
<view class="row_2">
<official-account>
</official-account>
</view>
<view class="row_3" bindtap="closePop">
我已關(guān)注
</view>
</view>
</view>
3、wxss代碼
/* #region ==== 底部彈出【關(guān)注公眾號】 */
.pop_down {
width: 100%;
height: 100%;
position: fixed;
z-index: 1000;
background-color: rgba(36, 36, 36, 0.7);
text-align: center;
}
.panel {
width: 100%;
height: 177px;
position: absolute;
bottom: 0;
left: 0;
background-color: rgb(255, 255, 255);
text-align: center;
}
.row_1 {
height: 45px;
width: 100%;
text-align: center;
margin: 0 auto;
background-color: rgb(250, 250, 250);
font-size: 1;
line-height: 45px;
color: rgb(202, 202, 202);
}
.row_3 {
height: 45px;
width: 100%;
text-align: center;
margin: 0 auto;
font-size: 15px;
line-height: 45px;
font-weight: bold;
color: rgb(72, 182, 84);
background-color: rgb(245, 245, 245);
margin-bottom: 40px;
}
/* #endregion */
4、js代碼
data: {
isCloseDown: 1, // 0-關(guān)閉 1-顯示 [關(guān)注公眾號]彈窗
// 關(guān)閉[關(guān)注公眾號]彈窗
closePop: function () {
this.setData({
isCloseDown: 0
})
},
文章來源:http://www.zghlxwxcb.cn/news/detail-552277.html
到了這里,關(guān)于【小程序】微信小程序中實現(xiàn)【關(guān)注公眾號】彈窗的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!