手机版

微信小程序如何访问公众号文章

时间:2021-08-21 来源:互联网 编辑:宝哥软件园 浏览:

前言

随着小程序不断的发展,现在个人的小程序也开放了很多功能了,个人小程序直接打开公众号链接。在群里看到的一款小程序,点击可以直接阅读文章了,所以琢磨了一下,写了一些源码。

主要代码:

web-view src=' http :3359 MP。微信。QQ。com/s?_ _ biz=mzi2o duxmzg4nw==mid=2247485016 idx=1sn=e5f 60600 ea 30 f 669264 ddcf 5 db 4 FB 080 chk sm=eaef 2168 DD 98 a 87 EAD 60 eed 0 f 24 e 799 C1 bebf e95 e 341231216 af 72315 c 33 a 56839 f 92 e 69 ef为了达到效果,更加具体的演示

效果如下

开源代码库地址:https://github。com/王晓婷666/微信链接

weixin.wxml

导航器URL='/pages/search/search ' hover-class=' change style ' view class=' view-search ' input class=' input ' placeholder-class=' input-placeholder ' placeholder='输入文章和链接bind input=' BindSearchInput '/image class=' button ' src=' http :/images/search。png ' bind tap=' tapSearch '/view/navigator view class=' container ' view wx : for=' { { card teams } } ' wx : key=' { { card teams } '。视图id } } ' wx : for-item=' CardTeam ' class=' item ' bind tap=' BindView tap ' image class=' img ' src=' HTT。容器{ padding-top : 0;}.项目{宽度: 100%;高度: 220rpx相对位置:display : flex margin : 10 rpx 10 rpx border-bottom : 1px纯色rgb(197,199,199);} .项目:第一个子级{ margin-top : 0;}.项目。移除{ width: 60px高度: 100%;背景-颜色:红色;绝对位置:top : 0;右侧:-60px;display : flex justice-内容中心:align-items:居中;}.项目。数字包装器{身高: 100%;填充-top : 40 rpx;弯曲方向:柱;正义-内容:空格;}.项目ok { width: 60px高度: 100%;填充-右侧: 20 rpxdisplay : flex justice-内容中心:align-items:居中;背景-颜色: # 98f 5ff}.项目img { width: 150rpx高度: 150 rpxpadding: 20rpx }。数字包装器。名称{ margin : 10 rpx 10 rpx 10 rpx 10 rpx;font-size : 39 rpx飞越:隐藏;}.数字包装器计数包装器{ display : flexalign-items:居中;左边距left : 10 rpx font-size : 25 rpx;}.数字包装器。计数包装BTN}.数字包装器。计数包装。增加-BTN { font-size : 30 rpx;}.数字包装器。计数包装。计数{ margin : 0 1rpx 0 1rpx font-size : 30 rpx;}.数字包装器。价格包装people { margin-left : 250 rpx;font-size : 30 rpx}/* 搜索框样式*/.查看-搜索{ display : flex flex-direction : row;height : 70 rpxmargin : 20 rpxpadding : 5rpxborder : 1px # e4e 2e 2固体;边框宽度:薄;align-items:居中;}.输入{ flex : 1;高度: 60rpx}。输入占位符{ color: # 999}。按钮{ width : 60 rpx h8 : 60 rpx }微信。射流研究…

//index.js//获取应用程序实例var app=GetApp();var cardTeams页面({ data : { card teams 3360 [{ ' view id ' : ' 1 ',' img src' : '././images/win/1.jpg ',' price' :' 1245 ',' count' :) Name': '一个40岁农民的总结,奋斗',},{'viewid' :' 2 ',' img src' : '././images/win/2.jpg ',' price' :' 2345 ',名称' : '一家小公司做了三年杂工,意外拿下了beauty ',},{'viewid' :' 3 ',' img src' : '././images/win/3.jpg ',' price' :' 2345 ',' Name': '作为有追求的前端程序,元',},{'viewid' :' 4 ',' img src' : '././images/win/4.jpg ',' price' :' 2345 ',' count面试总结' name': '女节目:我在这里',},{'viewid' :' 5 ',' img src' : '././images/win/5.jpg ',' price' :' 2345 ',' name': '前端工作年限,如何避免',}]},//事件处理程序bindwiewtap : function(){ wx。navigateto ({url: './weixinlink/weixinlink'})},onload : FuncTion(){ console . log(' onload : ' app . global data . domain)} })文章界面

weixinlink.wxml

web-view src=' http :3359 MP . weixin . QQ.com/s?_ _ biz=mzi2o duxmzg4nw==mid=2247485427 idx=1sn=ebfb 8851 c 6 cbb 0d 40 c 93 F8 ebda 83687 cksm=eaef 20 C3 DD 98 a9 d5a 19 F5 ad 195888 c 603 c8 c 819021 Bab 602d 11 F9 aa 757 b

只有小程序与微信官方账号关联,才能打开链接。

以上就是本文的全部内容。希望对大家的学习有帮助,支持我们。

版权声明:微信小程序如何访问公众号文章是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。