Skip to content

Commit

Permalink
Merge pull request #60 from ripplek/master
Browse files Browse the repository at this point in the history
menu add miniprogram
  • Loading branch information
silenceper committed Sep 24, 2018
2 parents 6f77a6d + c1f886d commit 90aabb3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions menu/button.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ type Button struct {
Key string `json:"key,omitempty"`
URL string `json:"url,omitempty"`
MediaID string `json:"media_id,omitempty"`
AppID string `json:"appid,omitempty"`
PagePath string `json:"pagepath,omitempty"`
SubButtons []*Button `json:"sub_button,omitempty"`
}

Expand Down Expand Up @@ -126,3 +128,16 @@ func (btn *Button) SetViewLimitedButton(name, mediaID string) {
btn.URL = ""
btn.SubButtons = nil
}

//SetMiniprogramButton 设置 跳转小程序 类型按钮 (公众号后台必须已经关联小程序)
func (btn *Button) SetMiniprogramButton(name, url, appID, pagePath string) {
btn.Type = "miniprogram"
btn.Name = name
btn.URL = url
btn.AppID = appID
btn.PagePath = pagePath

btn.Key = ""
btn.MediaID = ""
btn.SubButtons = nil
}

0 comments on commit 90aabb3

Please sign in to comment.