首页 > 编程语言 >微信公众号菜单添加医保电子凭证|微信小程序添加医保电子凭证链接

微信公众号菜单添加医保电子凭证|微信小程序添加医保电子凭证链接

时间:2022-12-28 11:00:51浏览次数:58  
标签:index 凭证 微信 医保 跳转 链接


【方法一:公众号菜单添加医保电子凭证】
微信公众号菜单添加医保电子凭证,直接使用链接

https://mp.weixin.qq.com/insurance/card/creditjump?cityid=431099#wechat_redirect
该链接通过浏览器打开会直接提示“请在微信中打开”

  我将链接发送到微信,在微信中打开可以直接看到直接跳转到“医保电子凭证”如下图

  

也许cityid=431099 代表不同的城市编码,可以修改不同的编码,具体这个需要测试

我修改为423000 看看效果.感觉也没有什么区别。反正都是打开一个链接。


【方法二:小程序】
然后微信小程序 添加医保电子凭证链接 。

这个首先得去获取 微信里面 官方 【我的医保凭证】的appid,

步骤,点击右上角... 弹出菜单 ,点击绿色图标 4.7分 ---点击更多资料

查看到 appid为  【wx7ec43a6a6c80544d】

在自己的公众号---发表新的图文消息--点击导航栏的小程序

输入查到的appid 【wx7ec43a6a6c80544d】

我直接复制了

pages/new_index/index/index.html

默认首页

pages/nhsa-code/index/index.html?channel=AAGYCx9OVG4gOuJJPPaZmysv

直接出示二维码

然后根据微信文档去做小程序内的跳转

可以跳转到"我的医保凭证"小程序,无需开通任何东西,

使用wx.navigateToMiniProgram即可,

https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.navigateToMiniProgram.html

或者使用navigator配置成跳转到小程序,

https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html

具体:

首先需要复制代码到app.js

wx.navigateToMiniProgram({     appId: 'wx7ec43a6a6c80544d',     path: 'pages/nhsa-code/index/index.html?channel=AAGYCx9OVG4gOuJJPPaZmysv',     extraData: {       foo: 'bar'     },     envVersion: 'develop',     success(res) {       // 打开成功     }   }) 然后。在使用
.navigator-hover { color:blue; } .other-navigator-hover { color:red; } 
<!-- sample.wxml --> <view class="btn-area"> <navigator url="/page/navigate/navigate?title=navigate" hover-class="navigator-hover">跳转到新页面</navigator> <navigator url="../../redirect/redirect/redirect?title=redirect" open-type="redirect" hover-class="other-navigator-hover">在当前页打开</navigator> <navigator url="/page/index/index" open-type="switchTab" hover-class="other-navigator-hover">切换 Tab</navigator> <navigator target="miniProgram" open-type="navigate" app-id="" path="" extra-data="" version="release">打开绑定的小程序</navigator> </view> 
<!-- navigator.wxml --> <view style="text-align:center"> {{title}} </view> <view> 点击左上角返回回到之前页面 </view> 
<!-- redirect.wxml --> <view style="text-align:center"> {{title}} </view> <view> 点击左上角返回回到上级页面 </view> 
Page({ onl oad: function(options) { this.setData({ title: options.title }) } })

主要是 

<navigator target="miniProgram" open-type="navigate" app-id="wx7ec43a6a6c80544d" path="pages/nhsa-code/index/index.html?channel=AAGYCx9OVG4gOuJJPPaZmysv" extra-data="" version="release" class="widget_more">

这一段了,需要指定好id和路径

最终

微信公众号菜单添加医保电子凭证|微信小程序添加医保电子凭证链接

最后我测试,如果设置跳转到指定页面,会一直空白

就是 

<navigator target="miniProgram" open-type="navigate" app-id="wx7ec43a6a6c80544d" path="pages/nhsa-code/index/index.html?channel=AAGYCx9OVG4gOuJJPPaZmysv" extra-data="" version="release" class="widget_more">

这一段了,需要指定好id和路径

这里面的path=

 

我不知道为什么呢!!!

最终只有设置为空,那么默认就是跳转到首页了

但是至少是可以工作了

 

2022年0618

app.js

wx.navigateToMiniProgram({     appId: "wx308bd2aeb83d3345",     path: "pages/jump/main?serviceId=1000836&path=https%3A%2F%2Fmp.weixin.qq.com%2Finsurance%2Fcard%2Fcreditjump%3Fcityid%3D99999%26%23wechat_redirect",     envVersion: "release"     })
.wxml

<navigator target="miniProgram" open-type="navigate" app-id="wx308bd2aeb83d3345" path="pages/jump/main?serviceId=1000836&path=https%3A%2F%2Fmp.weixin.qq.com%2Finsurance%2Fcard%2Fcreditjump%3Fcityid%3D99999%26%23wechat_redirect" extra-data="" version="release">我的医保电子凭证</navigator> 这个测试可以直接跳转到微信这个链接且不会提示

 

标签:index,凭证,微信,医保,跳转,链接
From: https://www.cnblogs.com/romanticcrystal/p/17009640.html

相关文章