小程序安装和配置

配置思路

(一) 开发工具

 小程序开发工具下载地址:

https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html

(二) 构建项目

  1. 可以新建,也可以导入原有项目
  2. 需要去注册一个小程序以获得AppId, 当然也可以使用测试号

 (三) 小程序配

       3.1 app.json全局配置#

       小程序根目录下的 app.json 文件用来对微信小程序进行全局配置

https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html

        3.2 app.json 配置文件详解 

{
  // 页面路径
  "pages": [
    "pages/index/index",
    "pages/cart/cart",
    "pages/detail/detail",
    "pages/my/my",
    "pages/demo/demo"
  ],
   // 导航栏配置
  "window": {
    // 导航栏颜色
    "navigationBarBackgroundColor": "#f8f8f8",
      // 导航栏文字
    "navigationBarTitleText": "花间",
      // 导航文字样式
    "navigationBarTextStyle": "black",
      // 背景文字样式
    "backgroundTextStyle": "dark",
      // 背景颜色
    "backgroundColor": "#f8f8f8"
  },
    // 底部tab栏
  "tabBar": {
     // tab文字和图片默认颜色
    "color": "#797d82",
    // 选中的tab的字体和图片颜色
    "selectedColor": "#c03131",
    
      // tab列表配置
    "list": [
      {
         // tab图片地址
        "iconPath": "./img/home.png",
        // tab被选中时的图片地址
        "selectedIconPath": "./img/homeing.png",
        "pagePath": "pages/index/index",
        "text": "首页"
      }, 
      {
        "iconPath": "./img/cart.png",
        "selectedIconPath": "./img/carting.png",
        "pagePath": "pages/cart/cart",
        "text": "购物车"
      },
      {
        "iconPath": "./img/my.png",
        "selectedIconPath": "./img/mying.png",
        "pagePath": "pages/my/my",
        "text": "个人中心"
      },
      {
        "iconPath": "./img/my.png",
        "selectedIconPath": "./img/mying.png",
        "pagePath": "pages/demo/demo",
        "text": "demo"
      }
    ]
  },
    // 使用的组件放在这里
  "usingComponents": { 
   
  },
  "sitemapLocation": "sitemap.json"
}

         3.3 详情配置:基本信息配置,本地配置

(四) 小程序控制台配置 

 登录小程序: 微信公众平台

4.1 版本管理 

  1. 上传代码获得体验版, 体验版需要添加权限才可以访问
  2. 体验版转正式版
  3. 腾讯审核通过后就变正式版, 所有人都可以访问

4.2 成员管理

4.3开发管理

  1. 开发者id和密钥
  2. 服务器域名配置

(五) 小程序使用nodejs模块 

  1. 初始化package.json npm init
  2. npm i 安装依赖
  3. 构建项目

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

超级小丑_Supclown

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值