Giter Site home page Giter Site logo

bookshelf's Introduction

书架小程序(小程序因违规已经关闭,请勿访问。)

  • 预览

    微信小程序

注册微信小程序

  • 微信公众平台 注册一个小程序,得到小程序的appid。
  • 下载微信开发者工具
  • 参考文档:微信开发文档
  • 打开微信开发者工具,创建小程序,输入appid,选择使用云开发,创建小程序。
  • 删除demo中的代码,创建一个云环境并使用。

我的页面

登录

  • 使用<button open-type="getUserInfo" bindgetuserinfo="onGetUserInfo">登录</button>获取个人信息,
  • 使用ogin云函数获取openid.
  • 使用wx.setStorage()把信息存在本地
  • 使用wx:if/else做登录判断

添加图书

  • 使用wx.scanCode扫码功能,扫描图书背后的条形,获取isbn号。
  • 调用getBookInfo云函数,爬取这本书在豆瓣的简介和评论。
  • 获得简介和评论后存添加到云数据库,添加成功后再把数据返回给前端。

书架页

书架列表

  • 获取云函数的书架列表,使用field限制返回字段。
  • 下拉刷新,在当前页面的json文件中配置"enablePullDownRefresh": true,并在js中触发onPullDownRefresh事件
  • 滚动加载

图书详情

获取图书详情

  • 点击书籍拿到id,跳转到详情页。
  • 根据id获取云数据库中对应的书籍详情并展示

云函数

login

  • 默认自带的云函数,调用就返回openid

getBookInfo

  • 接收isbn码,收到后会去豆瓣爬取图书的书名、作者、出版社、评论等

依赖

axios

  • 一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中。
  • axios文档

cheerio

bookshelf's People

Contributors

ansonznl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bookshelf's Issues

一个潜在的兼容性Bug

在项目中,发现没有使用wx.getSystemInfo这个API去获取使用机型的系统信息。
然后通过windowWidth,windowHeight和safeArea来调整小程序的布局设置。

没有通过wx.getSystemInfo的适配,在部分机型上可能会出现一些样式问题。

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.