小程序
小游戏
企业微信
微信支付
扫描小程序码分享
在微信公众号h5页面开发中使用wx-open-subscribe 时,订阅按钮不生效,打开调试器,button按钮并没有出现
在真机上也不能正常显示,iOS14.6,微信版本8.0.9
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,无法显示订阅标签的问题
1、请注意更新到最新版的开发者工具,下载地址:https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
2、请确认 wx.config 里有申请开放标签的权限,参考文档:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html
3、如仍未调试成功,请提供具体的appid、代码、报错信息和截图。
用户拉起订阅客户端版本支持:
图文:安卓7.0.15 & IOS 7.0.14及以上版本
服务号网页:安卓7.0.12 & IOS 7.0.12及以上版本
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
appid:wxf402bb1307e1ece4
<template> <!-- v-model="_waitOrderVisible" --> <van-popup v-model="_waitOrderVisible" safe-area-inset-bottom :close-on-click-overlay="false" :closeable="true" :close-on-popstate="true" class="waitOrderPopup" get-container="#app" > <p class="waitOrderPopup-title"></p> <div class="waitOrderPopup-content"> <div class="waitOrderPopup-item"> <label>是否接收通知,及时获取充值结果提醒</label> </div> </div> <div class="waitOrderPopup-button"> <!-- <button @click="closeWaitOrder">取 消</button> --> <wx-open-subscribe style="width: 100%; height: 100px" @success="success" @error="subError" :template="beachRechargeBol ? subTemplateIdBeach : subTemplateId" id="subscribe-btn" > <script type="text/wxtag-template" > <style> .btn2 { color: #108ee8; font-size: 15px; background-color: #fff; width:100%; height: 40px; line-height: 40px; outline: none; border: none; } </style> <Button class="btn2">确 认</Button> </script> </wx-open-subscribe> </div> </van-popup> </template> <script> import { Popup, Button } from "vant"; export default { name: "ZchSubscribe", components: { [Popup.name]: Popup, }, props: { subscribeVisible: Boolean, beachRechargeBol: Boolean, }, computed: { _waitOrderVisible: { set(value) { this.$emit("close", value); if (value === false) this.$emit("showOrder", true); }, get() { return true; }, }, }, data() { return { searchCountryKeyword: "", countryInvalidVisible: false, subTemplateId: process.env.VUE_APP_FILE_NOTICE, subTemplateIdBeach: process.env.VUE_APP_FILE_NOTICE_BACTH, }; }, methods: { // 错误提示 subError(e) { // this.$toast("subError"+e); console.log("subError" + e.errMsg); }, // 我这里判断是必须把复数模板全部订阅 success(e) { // this.$toast("success"+e); console.log("success" + e); this._waitOrderVisible = false; if (this.beachRechargeBol) { this.$router.push({ path: "/batch/recharge" }); } else { this.$router.push({ path: "/user/recharge-record" }); } console.log("参与成功"); }, async closeWaitOrder() { // await cancelOrder(this.waitOrderInfo.yqqNo) this._waitOrderVisible = false; if (this.beachRechargeBol) { this.$router.push({ path: "/batch/recharge" }); } else { this.$router.push({ path: "/user/recharge-record" }); } }, }, }; </script> <style lang="scss" scoped> .waitOrderPopup { border-radius: 5px; font-size: 12px; width: 80%; height: 400px; color: #414141; line-height: 1.5; &-title { font-size: 16px; color: #fff; padding: 18px 0; text-align: center; } &-content { padding: 23px 36px; } &-item { margin-bottom: 12px; display: flex; &-discount { color: #ff9a22; } &-payPrice { color: #ff3c3c; } label { color: #414141; font-size: 16px; text-align: center; } &:last-child { margin-bottom: 0; } } &-button { color: #108ee8; font-size: 16px; border-top: 1px solid #d9d9d9; position: relative; text-align: center; height: 40px; line-height: 40px; } #subscribe-btn { display: block; z-index: 10; width: 100%; height: 200rpx; text-align: center; line-height: 150rpx; font-size: 30rpx; font-weight: 500; color: #ffffff; background-color: green; position: relative; overflow: hidden; } .subscribe-btn { color: #fff; background-color: #07c160; width:100%; height: 40px; display:block;} } </style>
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,无法显示订阅标签的问题
1、请注意更新到最新版的开发者工具,下载地址:https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
2、请确认 wx.config 里有申请开放标签的权限,参考文档:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html
3、如仍未调试成功,请提供具体的appid、代码、报错信息和截图。
用户拉起订阅客户端版本支持:
图文:安卓7.0.15 & IOS 7.0.14及以上版本
服务号网页:安卓7.0.12 & IOS 7.0.12及以上版本
appid:wxf402bb1307e1ece4
<template> <!-- v-model="_waitOrderVisible" --> <van-popup v-model="_waitOrderVisible" safe-area-inset-bottom :close-on-click-overlay="false" :closeable="true" :close-on-popstate="true" class="waitOrderPopup" get-container="#app" > <p class="waitOrderPopup-title"></p> <div class="waitOrderPopup-content"> <div class="waitOrderPopup-item"> <label>是否接收通知,及时获取充值结果提醒</label> </div> </div> <div class="waitOrderPopup-button"> <!-- <button @click="closeWaitOrder">取 消</button> --> <wx-open-subscribe style="width: 100%; height: 100px" @success="success" @error="subError" :template="beachRechargeBol ? subTemplateIdBeach : subTemplateId" id="subscribe-btn" > <script type="text/wxtag-template" > <style> .btn2 { color: #108ee8; font-size: 15px; background-color: #fff; width:100%; height: 40px; line-height: 40px; outline: none; border: none; } </style> <Button class="btn2">确 认</Button> </script> </wx-open-subscribe> </div> </van-popup> </template> <script> import { Popup, Button } from "vant"; export default { name: "ZchSubscribe", components: { [Popup.name]: Popup, }, props: { subscribeVisible: Boolean, beachRechargeBol: Boolean, }, computed: { _waitOrderVisible: { set(value) { this.$emit("close", value); if (value === false) this.$emit("showOrder", true); }, get() { return true; }, }, }, data() { return { searchCountryKeyword: "", countryInvalidVisible: false, subTemplateId: process.env.VUE_APP_FILE_NOTICE, subTemplateIdBeach: process.env.VUE_APP_FILE_NOTICE_BACTH, }; }, methods: { // 错误提示 subError(e) { // this.$toast("subError"+e); console.log("subError" + e.errMsg); }, // 我这里判断是必须把复数模板全部订阅 success(e) { // this.$toast("success"+e); console.log("success" + e); this._waitOrderVisible = false; if (this.beachRechargeBol) { this.$router.push({ path: "/batch/recharge" }); } else { this.$router.push({ path: "/user/recharge-record" }); } console.log("参与成功"); }, async closeWaitOrder() { // await cancelOrder(this.waitOrderInfo.yqqNo) this._waitOrderVisible = false; if (this.beachRechargeBol) { this.$router.push({ path: "/batch/recharge" }); } else { this.$router.push({ path: "/user/recharge-record" }); } }, }, }; </script> <style lang="scss" scoped> .waitOrderPopup { border-radius: 5px; font-size: 12px; width: 80%; height: 400px; color: #414141; line-height: 1.5; &-title { font-size: 16px; color: #fff; padding: 18px 0; text-align: center; } &-content { padding: 23px 36px; } &-item { margin-bottom: 12px; display: flex; &-discount { color: #ff9a22; } &-payPrice { color: #ff3c3c; } label { color: #414141; font-size: 16px; text-align: center; } &:last-child { margin-bottom: 0; } } &-button { color: #108ee8; font-size: 16px; border-top: 1px solid #d9d9d9; position: relative; text-align: center; height: 40px; line-height: 40px; } #subscribe-btn { display: block; z-index: 10; width: 100%; height: 200rpx; text-align: center; line-height: 150rpx; font-size: 30rpx; font-weight: 500; color: #ffffff; background-color: green; position: relative; overflow: hidden; } .subscribe-btn { color: #fff; background-color: #07c160; width:100%; height: 40px; display:block;} } </style>