Skip to content

Commit 4ecaa9f

Browse files
author
v_guanglwen
committed
feat: 增加openOfficialAccountArticle,openOfficialAccountProfile
1 parent 543439e commit 4ecaa9f

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

miniprogram/packageAPI/pages/api/jump/jump.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ Page({
5555
}
5656
})
5757
},
58+
// 打开公众号主页
59+
openofficialaccountprofile() {
60+
wx.openOfficialAccountProfile({
61+
username: 'gh_56fc3b00cc4f',
62+
success: (res) => {
63+
},
64+
fail: (res) => {
65+
}
66+
})
67+
},
68+
// 打开公众号文章
69+
openofficialaccountarticle() {
70+
wx.openOfficialAccountArticle({
71+
url: 'https://mp.weixin.qq.com/s/vTt8sZ_tTkTEVYgcydKqew', // 此处填写公众号文章连接
72+
success: (res) => {
73+
},
74+
fail: (res) => {
75+
}
76+
})
77+
},
5878
onUnload() {
5979
if (wx.offThemeChange) {
6080
wx.offThemeChange()

miniprogram/packageAPI/pages/api/jump/jump.wxml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<import src="../../../../common/head.wxml" />
22
<import src="../../../../common/foot.wxml" />
3-
43
<view class="container page" data-weui-theme="{{theme}}">
5-
<template is="head" />
4+
<template is="head" data="{{title: 'jumpApi'}}" />
65
<view class="page-body">
76
<!-- 暂时下架 -->
87
<!-- <view class="btn-area">
@@ -17,6 +16,12 @@
1716
<view class="btn-area">
1817
<button type="primary" data-mode="fingerPrint" bindtap="exitminiprogram">退出当前小程序</button>
1918
</view>
19+
<view class="btn-area">
20+
<button type="primary" data-mode="fingerPrint" bindtap="openofficialaccountprofile">打开公众号主页</button>
21+
</view>
22+
<view class="btn-area">
23+
<button type="primary" data-mode="fingerPrint" bindtap="openofficialaccountarticle">打开公众号文章</button>
24+
</view>
2025
</view>
2126
<template is="foot" />
2227
</view>

0 commit comments

Comments
 (0)