Giter VIP home page Giter VIP logo

wx-douban-trailer's Introduction

电影预告微信小程序


项目描述和演示

基本 koa2 搭建的电影数据服务开发的微信小程序。

真机上实际效果要好于模拟器。

基本功能

基本功能

详情页和历史记录

详情页

分类页面

分类页

分享功能

分享页

部分技术选型

  • 小程序端

    • 整个项目使用ES6的语法开发
    • 整体功能使用小程序提供的api实现
  • 服务端

    • 基于koa2搭建的服务api
    • 数据来源于豆瓣
    • 阿里云ssh证书

项目开发过程遇到的部分问题和解决方案

1 首页布局结构,如果使用全部浮动的方法,由于每个电影条目的高度不同,导致不能依此排开。

解决办法:

将数据进行分组,每两个一组,用一个 view 标签包裹。所以在处理数据的时候,需要将一维的数据转化为二维的,然后在分别遍历。

2 在获取数据的时候,控制台会警告域名安全问题。

解决办法:

在开发过程由于开始没有 ssl 证书,所以需要在小程序的 ide 中设置忽略验证请求的接口安全性。在拿到 ssl 证书之后,那么需要到小程序后台添加和设置信任的接口。注意每个月只能修改5次,所以一定要慎重设置。

3 很多页面都具有同样的列表样式,那么代码会有很多重复的,

解决办法:

使用小程序提供的模版功能,开发的过程也是学习的过程,发现这个模版功能尤为好用,可以复用大量的代码。同时css样式也可以分离出来,使用像是 scss 那样 import 的语法进行导入。

4 在获取小程序二维码的时候,小程序接口返回的是一个流对象,而不是一个图片的地址,导致服务端无法直接返回正常的数据。

解决办法:

实际上 ctx.body 可以直接 = 流对象,但是最后还是将获取的数据先建立一个完整的图片文件,然后直接使用nginx代理静态资源就可以了。

项目总结

这个项目完全有自己凭空想象出来的,也是个人制作的第一个较为完整的小程序项目,所以在制作过程中有很多地方较为粗糙,有很多代码其实可以进一步抽象和分离。

整体感觉小程序和vue很像,开发过程比较简单,不过对于一些高级的用法还有待研究。

wx-douban-trailer's People

Contributors

maxlasting avatar

Stargazers

 avatar Anyway avatar  avatar  avatar  avatar younger avatar Zzzzang avatar  avatar 阿健 avatar 随笔川迹 avatar Bob Zheng avatar  avatar  avatar  avatar Mark avatar Yuqirong avatar  avatar  avatar longzhan Lin avatar fishku avatar  avatar W.J avatar minis avatar  avatar project avatar duxiaobin avatar  avatar  avatar

Watchers

James Cloos avatar  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.