Skip to content

feat: 增加openOfficialAccountArticle,openOfficialAccountProfile #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion miniprogram/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"pages/api/get-user-info/get-user-info",
"pages/api/request-payment/request-payment",
"pages/api/jump/jump",
"pages/api/official-account/official-account",
"pages/api/share/share",
"pages/api/share-button/share-button",
"pages/api/custom-message/custom-message",
Expand Down Expand Up @@ -523,7 +524,9 @@
],
"multiSelectSupportedMaterials": [
{
"materialType": ["image/*"],
"materialType": [
"image/*"
],
"desc": "聊天内容长按多选打开",
"path": "packageAPI/pages/chattool/material_open/material_open",
"scopes": []
Expand Down
3 changes: 1 addition & 2 deletions miniprogram/packageAPI/pages/api/jump/jump.wxml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<import src="../../../../common/head.wxml" />
<import src="../../../../common/foot.wxml" />

<view class="container page" data-weui-theme="{{theme}}">
<template is="head" />
<template is="head" data="{{title: 'jumpApi'}}" />
<view class="page-body">
<!-- 暂时下架 -->
<!-- <view class="btn-area">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Page({
onShareAppMessage() {
return {
title: '公众号',
path: 'packageAPI/pages/api/official-account/official-account'
}
},

data: {
theme: 'light',
setting: {}
},
// 打开公众号主页
openofficialaccountprofile() {
wx.openOfficialAccountProfile({
username: 'gh_56fc3b00cc4f',
success: (res) => {
},
fail: (res) => {
}
})
},
// 打开公众号文章
openofficialaccountarticle() {
wx.openOfficialAccountArticle({
url: 'https://mp.weixin.qq.com/s/vTt8sZ_tTkTEVYgcydKqew', // 此处填写公众号文章连接
success: (res) => {
},
fail: (res) => {
}
})
},
onUnload() {
if (wx.offThemeChange) {
wx.offThemeChange()
}
},
onLoad() {
this.setData({
theme: getApp().globalData.theme || 'light'
})

if (wx.onThemeChange) {
wx.onThemeChange(({ theme }) => {
this.setData({ theme })
})
}
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "公众号",
"renderer": "webview"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<import src="../../../../common/head.wxml" />
<import src="../../../../common/foot.wxml" />
<view class="container page" data-weui-theme="{{theme}}">
<template is="head" data="{{title: 'officialAccount'}}" />
<view class="page-body">
<view class="btn-area">
<button type="primary" data-mode="fingerPrint" bindtap="openofficialaccountprofile">打开公众号主页</button>
</view>
<view class="btn-area">
<button type="primary" data-mode="fingerPrint" bindtap="openofficialaccountarticle">打开公众号文章</button>
</view>
</view>
<template is="foot" />
</view>
Empty file.
3 changes: 3 additions & 0 deletions miniprogram/page/API/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Page({
}, {
zh: '跳转',
url: 'jump/jump'
}, {
zh: '公众号',
url: 'official-account/official-account'
}, {
zh: '转发',
url: 'share/share'
Expand Down
Loading