小程序直接调用网站的URL

发布时间 2023-10-16 03:34:20作者: article

条件

  • 域名备案
  • HTTPS
  • 企业认证小程序

步骤

  1. 在小程序后台(https://mp.weixin.qq.com/wxamp/devprofile/getprofile)配置新增的域名;

  2. 打开微信开发者工具;

  3. 创建小程序;

  4. 打开「index.wxml」文件,清空其内容,填写以下内容;

    <web-view src="https://此处填写域名/"></web-view>

  1. 打开「index.js」文件,以便增加支持「分享」的代码;
    可增加至约13行(},字符)之后。
      /**
      * 用户点击右上角分享
      */
     onShareAppMessage: function () {
    },
  1. 在小程序后台,提交审核,审核通过后发布。

参考

  • https://www.zhuatou.cn/newsinfo-222.html
  • https://www.bilibili.com/video/BV1m14y1972C/