微信小程序开发手账

从今天起,打算记录一下自己从入门开发微信小程序到小程序上线的完整流程。
如果没有意外的话打算每周更新一次。20201231

准备工作

hbuilder、java环境(springboot)或者php环境(tp5,php7.3),数据库(暂定mysql,后期可能生成为oracle)、微信开发者客户端、微信小程序申请、微信支付申请、gitee申请(好吧版本管理十分重要,因为期间我不小心覆盖了一部分文件,导致大量返工。)

前端配置:

1、hbuilder、微信开发者客户端都直接用就行。
本次使用colorUI

2、安装git插件,并下载tortoisegit,安装后插件可装。
3、微信开发者工具》登录》设置》安全》服务端口

4、现在开始新建项目(由于原项目我没搞得懂怎么配置git,所以导入项目后,将colorUI复制进去,然后上传,注意.gitignore上传策略)

基础配置

首先看下目录结构

配置ignore

引入vant(下载也好直接引入后从dist复制也好)

引入步骤:


pages.json

"globalStyle": {"mp-alipay": {/* 支付宝小程序特有相关 */"transparentTitle": "always","allowsBounceVertical": "NO"},"navigationBarBackgroundColor": "#0081ff","navigationBarTitleText": "全局首页","navigationStyle": "custom","navigationBarTextStyle": "white",// 以下为引用的vant组件,看着自己改。"usingComponents": { //这里为方便,全局引入了所有组件,也可以在某个page下单独引用某个组件"demo-block": "/wxcomponents/vant/demo-block/index","van-action-sheet": "/wxcomponents/vant/action-sheet/index","van-area": "/wxcomponents/vant/area/index",// "van-badge": "/wxcomponents/vant/badge/index",// "van-badge-group": "/wxcomponents/vant/badge-group/index","van-button": "/wxcomponents/vant/button/index","van-card": "/wxcomponents/vant/card/index","van-cell": "/wxcomponents/vant/cell/index","van-cell-group": "/wxcomponents/vant/cell-group/index","van-checkbox": "/wxcomponents/vant/checkbox/index","van-checkbox-group": "/wxcomponents/vant/checkbox-group/index","van-col": "/wxcomponents/vant/col/index","van-dialog": "/wxcomponents/vant/dialog/index","van-field": "/wxcomponents/vant/field/index","van-goods-action": "/wxcomponents/vant/goods-action/index","van-goods-action-icon": "/wxcomponents/vant/goods-action-icon/index","van-goods-action-button": "/wxcomponents/vant/goods-action-button/index","van-icon": "/wxcomponents/vant/icon/index","van-loading": "/wxcomponents/vant/loading/index","van-nav-bar": "/wxcomponents/vant/nav-bar/index","van-notice-bar": "/wxcomponents/vant/notice-bar/index","van-notify": "/wxcomponents/vant/notify/index","van-panel": "/wxcomponents/vant/panel/index","van-popup": "/wxcomponents/vant/popup/index","van-progress": "/wxcomponents/vant/progress/index","van-radio": "/wxcomponents/vant/radio/index","van-radio-group": "/wxcomponents/vant/radio-group/index","van-row": "/wxcomponents/vant/row/index","van-search": "/wxcomponents/vant/search/index","van-slider": "/wxcomponents/vant/slider/index","van-stepper": "/wxcomponents/vant/stepper/index","van-steps": "/wxcomponents/vant/steps/index","van-submit-bar": "/wxcomponents/vant/submit-bar/index","van-swipe-cell": "/wxcomponents/vant/swipe-cell/index","van-switch": "/wxcomponents/vant/switch/index",// "van-switch-cell": "/wxcomponents/vant/switch-cell/index","van-tab": "/wxcomponents/vant/tab/index","van-tabs": "/wxcomponents/vant/tabs/index","van-tabbar": "/wxcomponents/vant/tabbar/index","van-tabbar-item": "/wxcomponents/vant/tabbar-item/index","van-tag": "/wxcomponents/vant/tag/index","van-toast": "/wxcomponents/vant/toast/index","van-transition": "/wxcomponents/vant/transition/index","van-tree-select": "/wxcomponents/vant/tree-select/index","van-datetime-picker": "/wxcomponents/vant/datetime-picker/index","van-rate": "/wxcomponents/vant/rate/index","van-collapse": "/wxcomponents/vant/collapse/index","van-collapse-item": "/wxcomponents/vant/collapse-item/index","van-picker": "/wxcomponents/vant/picker/index"}},"usingComponts": true,"condition": { //模式配置,仅开发期间生效"current": 0, //当前激活的模式(list 的索引项)"list": [{"name": "表单2", //模式名称"path": "pages/buyer/index", //启动页面"query": "" //启动参数}]}

测试即可使用vant

pages.json中,这句话意思是去除顶部标题栏

参考资料

修改默认首页

pages.json中,第一个为首页,最后一个为默认页(一般为404页)

vue中,可以使用模板进行套用。格式:

vue套用模板怎么配

//引入用户标准白板。
import BlankLayout from '@/components/layouts/BlankLayout'
{//这个是模板文件path: '/user',component: BlankLayout,// redirect: '/user/blank',hidden: true,//这个是模板下的文件children: [{path: 'index',name: 'index',component: () => import(/* webpackChunkName: "user" */ '@/views/user/Index')},// {//     path: 'register',//     name: 'register',//     component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')// },// {//     path: 'register-result',//     name: 'registerResult',//     component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')// },// {//     path: 'alteration',//     name: 'alteration',//     component: () => import(/* webpackChunkName: "user" */ '@/views/user/Alteration')// },]},

动态路由生成【未配】

由于使用了pages.json,所以对于app.addrouter不知道支持否,暂时开发没有用到相关技术。
没有暂时没有打算使用router.js,所以如果以后需要则再此记录。20210105

微信小程序开发手账从入门到部署【持续更新】相关推荐

  1. 微信小程序开发(四)入门之打卡功能开发

    相关文章 微信小程序开发(一)微信开发者工具以及小程序框架介绍 微信小程序开发(二)开发之日历打卡小程序发现页 微信小程序开发(三)入门之创建打卡活动 前言 本篇文章将介绍打卡小程序打卡页面相关功能的 ...

  2. 微信小程序开发(三)入门之创建打卡活动

    相关文章 微信小程序开发(一)微信开发者工具以及小程序框架介绍 微信小程序开发(二)开发之日历打卡小程序发现页 微信小程序开发(四)入门之打卡功能开发 前言 上篇介绍了日历打卡小程序发现页视图相关开发 ...

  3. 微信小程序开发纪实-菜鸟新手入门

    微信小程序开发纪实 第一天 开发背景 注册测试号,小程序号 页面跳转.登陆拦截 文件目录结构 题外技能 本人第一次尝试开发微信小程序,打算写一篇博客文章,尽可能的详细的把开发过程中的难点.思路.面向百 ...

  4. 微信小程序开发❤手摸手撸小程序一篇就够!

    手摸手撸小程序!!超简单,一篇就够! 微信小程序介绍 微信小程序,简称小程序,英文名Mini Program,是一种不需要下载安装即可使用的应用,它实现了应用"触手可及"的梦想,用 ...

  5. 【微信小程序开发小白零基础入门】微信小程序入门【建议收藏】

    微信小程序入门 文章目录 微信小程序入门 前言 一.小程序的概述 1.小程序简介 2.小程序诞生 3.小程序功能 4.小程序创建步骤 二.小程序的准备工作 1.注册开发者账号 2.小程序信息完善 3. ...

  6. 【微信小程序开发小白零基础入门】第一个入门级小程序【建议收藏】

    文章目录 一.第一个入门级小程序 1.新建项目 2.真机预览 3.代码上传 4.小程序版本 二.小程序目录结构 1.项目配置文件 2.主体文件 3.页面文件 4.其他文件 三.开发者工具功能介绍 1. ...

  7. 【微信小程序开发小白零基础入门】微信小程序框架【建议收藏】

    微信小程序框架 文章目录 微信小程序框架 一.逻辑层 1.注册程序 1.App()函数 2.onPageNotFound()函数 3.getApp()函数 2.注册页面 1.初始数据 2.生命周期回调 ...

  8. 【9】微信小程序开发

    以下为最近学习微信小程序的手账记录,目前还在学, 待整个学完做完一个项目后来整理全篇. 常用热键: 1.自动代码重置格式 shift+alt+F 2.同时编辑多行代码 shift+alt+上下方向键 ...

  9. 《微信小程序开发入门精要》——导读

    本节书摘来自异步社区<微信小程序开发入门精要>一书中的导读,作者 李宁,更多章节内容可以访问云栖社区"异步社区"公众号查看 目 录 第1章 微信小程序入门 第1章第1节 ...

最新文章

  1. 教学案例 计算机,计算机教学案例及反思
  2. 利用Reachability实现网络状态监听
  3. max导出fbx设置_真3D虚拟偶像制作教程——虚拟偶像人物模型导出前的处理
  4. mysql查询条件是小数 查不到6.28_28.mysql数据库之查询
  5. 诗与远方:无题(九十二)
  6. 华为机试HJ31:单词倒排
  7. 字符串拼接之+=和join()的比较
  8. PostgreSQ 存储过程 和 存储函数的区别
  9. 响应式web开发 许愿墙
  10. IMU(陀螺仪)角速度测量原理-科氏力测旋转角速度
  11. 手机--修改dns服务器地址,DNS怎么修改 电脑和手机设置DNS全攻略
  12. json编辑器插件 vue_基于vue平台的json schema 编辑器
  13. lisp 圆柱螺旋线_AutoCAD.Lisp等距3D螺旋线
  14. 在职场:每个人,都应该学会使用项目管理工具Tracup
  15. Android WebView 视频播放,全屏按钮不显示或灰显解决方案
  16. 连接手表_小米手表首批已到手 这些事儿你必须知道
  17. 1165.穹妹的求助
  18. 【Matlab】系统预定义变量——元胞数组与结构体
  19. USACO2013 island travels
  20. 软件开发 过程管理流程设计

热门文章

  1. Ubuntu windows双系统没有引导界面的解决办法
  2. WordPress手动开启WP错误调试
  3. 计算机思维 Computational Thinking(转载)
  4. 使用谷歌浏览器模拟发送http请求
  5. C++链表偶数在前,奇数在后的简单方法
  6. Managed DirectX中的DirectShow应用(简单Demo及源码)
  7. .输入一行字符串,含有数字和非数字字符以及空格等,如: df23adfd56 2343?23dgjop535 如果将其中所有连续出现的数字视为一个整数,要求统计在该字符串中共有多少个整数,并将这些数依
  8. 无线覆盖范围 测试软件,无线覆盖验收标准
  9. sql查询当天交易总额最大的用户信息_如何分析交易记录? 因为后面要分析“每种类型用户的总交易金额”,所以保留左表(用户交易记录表)中的全部用户数据。 【题目】 某商场为了分析用... - 雪球...
  10. [coreboot]coreboot porting for RISCV