Giter Club home page Giter Club logo

hiolabs's Introduction

手把手教你搭建一款开源的微信商城小程序:海风小店

准备工作

  • 申请小程序账号

申请小程序账号只需要按照官网文档说明操作即可,这里我就不展开说了,地址:https://developers.weixin.qq.com/miniprogram/introduction/

image-20210509222627644

  • 安装顺序:

    服务端 ==> 小程序 ==> 管理端

    server ==> miniprogram ==> admin

服务端 :本地开发环境配置

  • 创建数据库hiolabsDB(注意数据库字符编码为utf8mb4),并导入项目根目录下的hioshop.sql

    注意数据库版本一定要是 MySql 5.7 一定要是 MySql 5.7 一定要是 MySql 5.7

image-20210509223741438

  • 更改数据库配置 src/common/config/database.js

image-20210509224232810

  • 填写微信配置和其他设置,打开 src/common/config/config.js文件,如果微信支付、oss服务什么的你都还没申请,都可以先不填写,但是微信的appid 和secret 是必填的。

    image-20210509231024786

  • 微信的appid 和secret 在微信小程序官网登录以后,在控制台页面的开发->开发设置->开发者ID中

    image-20210509231238114

  • 填写七牛云地址 src/common/config/config.js

    image-20210509224442923

  • 安装依赖npm install

  • 启动 npm start

    没报错的话,会在控制台显示200

image-20210509224618728

​ 浏览器测试 http://127.0.0.1:8360/

image-20210509224551447


小程序端 :本地开发环境配置

  • 打开微信开发者工具

image-20210509230236475

  • 默认API改成本地地址

    image-20210509224825777

​ 小程序预览显示数据表示数据库连接成功


服务端 :本地开发环境配置

  • 安装依赖后启动后会出现一个问题,这个问题是Element-ui自带的。

  • 解决方法:在node_modules 搜索: div class="el-form-item__label-wrap"

image-20210505000052259

  • ​ 在语句中加上单引号就可以了

在这里插入图片描述

在这里插入图片描述

  • 启动 npm run dev

image-20210509225447399

  • build 打包成静态文件 npm run build:web

  • 此时代表项目启动成功,桌面上会出现下图这个程序界面,输入默认的管理员账号密码:

    用户名:hiolabs,密码:hiolabs

image-20210509225845170

参考:https://mp.weixin.qq.com/s/2lDVMnUJqfenO6MkiL132Q

https://blog.csdn.net/GZLEO77/article/details/108627277

https://www.bilibili.com/video/av89567916

hiolabs's People

Contributors

kuishou68 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar ggyy avatar  avatar  avatar peter avatar 南风知我意 avatar  avatar  avatar tiankong avatar  avatar 领秀58 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.