[外链图片转存失败(img-STw401rR-1565101469846)(https://upload-images.jianshu.io/upload_images/11158618-52efd0adc4d95b06.png?imageMogr2/auto-orient/strip|imageView2/2/w/1240)]

[外链图片转存失败(img-u4QekWfY-1565101469848)(https://upload-images.jianshu.io/upload_images/11158618-59cbfbb72f12db5b.png?imageMogr2/auto-orient/strip|imageView2/2/w/1240)]

{
"pages": [
"pages/movie/movie",
"pages/profile/profile",
"pages/comment/comment"
],
"window": {
"backgroundColor": "#F6F6F6",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#E54847",
"navigationBarTitleText": "最新电影",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#000",
"selectedColor": "#E54847",
"list": [
{
"pagePath": "pages/movie/movie",
"text": "电影",
"iconPath": "images/film.png",
"selectedIconPath": "images/film-actived.png"
},
{
"pagePath": "pages/profile/profile",
"text": "我的",
"iconPath": "images/profile.png",
"selectedIconPath": "images/profile-actived.png"
}
]
},
"sitemapLocation": "sitemap.json"
}

Vant组件库

Vant Weapp

UI库使用Vant Weapp

地址:

https://youzan.github.io/vant-weapp

轻量,可靠的小程序UI组件库

小程序端电影列表

发送请求方式

小程序端发送wx.request()

协议支持,只支持https

是否备案,经过icp备案

域名个数限制20个

云函数

第三方库(request,got)

根据第三方库决定

可以不备案

无限制

request-promise

Vant Weapp

轻量,可靠的小程序UI组件库

通过npm安装

通过npm安装

npm i vant-app -S --production

通过 yarn 安装

yarn add vant-weapp --production

通过git下载Vant Weapp源代码

将dist或lib目录拷贝到自己的项目中

git clone https://github.com/youzan/vant-weapp.git

引入组件

app.json或index.json中配置按钮对应的路径即可

ES6
"usingComponents": {
"van-button": "/path/to/vant-weapp/dist/button/index"
}
ES5
"usingComponents": {
"van-button": "/path/to/vant-weapp/lib/button/index"
}

使用组件

引入组件后,可以在wxml中直接使用组件

<van-button type="primary">按钮</van-button>

在开发者工具中预览示例小程序

安装项目依赖

npm install

执行组件编译

npm run dev

引入

在 app.wxss 中引入内置样式

@import "path/to/vant-weapp/dist/common/index.wxss";

当文本内容长度超过容器最大宽度时,自动省略多余的文本。

文字省略

当文本内容长度超过容器最大宽度时,自动省略多余的文本。

<view class="van-ellipsis">这是一段宽度限制 250px 的文字,后面的内容会省略</view>

<!-- 最多显示两行 -->
<view class="van-multi-ellipsis--l2">这是一段最多显示两行的文字,后面的内容会省略</view> <!-- 最多显示三行 -->
<view class="van-multi-ellipsis--l3">这是一段最多显示三行的文字,后面的内容会省略</view>
<!-- 上边框 -->
<view class="van-hairline--top"></view> <!-- 下边框 -->
<view class="van-hairline--bottom"></view> <!-- 左边框 -->
<view class="van-hairline--left"></view> <!-- 右边框 -->
<view class="van-hairline--right"></view> <!-- 上下边框 -->
<view class="van-hairline--top-bottom"></view> <!-- 全边框 -->
<view class="van-hairline--surround"></view>

https://youzan.github.io/vant-weapp/#/intro

request

npm install --save request

npm install --save request-promise

[外链图片转存失败(img-P2eJEhFH-1565101469851)(https://upload-images.jianshu.io/upload_images/11158618-1da1454cde2974c1.png?imageMogr2/auto-orient/strip|imageView2/2/w/1240)]

var rp = require('request-promise');
npm install --save request

npm install -g npm

npm install --save request-promise
{
"name": "movielist",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"request": "^2.88.0",
"request-promise": "^4.2.4",
"wx-server-sdk": "latest"
}
}

电影列表的接口:

http://api.douban.com/v2/movie/in_theaters

电影详情:

http://api.douban.com/v2/movie/subject/id

// 监听用户下拉动作
onPullDownRefresh: function() { }
// 页面上拉触底事件的处理函数
onReachBottom: function() {
}
onShareAppMessage: function() {
}

JSON.parse

submit: function() {
console.log(this.data.content, this.data.score);
// 上传图片到云存储
let promiseArr = [];
for(let i=0; i<this.data.images.length;i++){
promiseArr.push(new Promise((reslovie, reject) => { }));
}
}

若本号内容有做得不到位的地方(比如:涉及版权或其他问题),请及时联系我们进行整改即可,会在第一时间进行处理。


请点赞!因为你们的赞同/鼓励是我写作的最大动力!

欢迎关注达叔小生的简书!

这是一个有质量,有态度的博客

[外链图片转存失败(img-P7dv3l63-1565101469856)(https://upload-images.jianshu.io/upload_images/11158618-9ab0d3fef85d80ce?imageMogr2/auto-orient/strip|imageView2/2/w/1240)]

微信小程序电影模板的更多相关文章

  1. 微信小程序 template模板使用

    参考文章: 微信小程序-template模板使用

  2. 微信小程序发送模板消息

    微信小程序发送模板消息 标签(空格分隔): php 看小程序文档 [模板消息文档总览]:https://developers.weixin.qq.com/miniprogram/dev/framewo ...

  3. 微信小程序开发模板消息的时候 出现 errcode: 41028, errmsg: "invalid form id hint:

    小程序开发模板消息的时候  出现 errcode: 41028, errmsg: "invalid form id hint: 我是使用的微信支付发送模板消息,提示的formid无效的 大家 ...

  4. 微信小程序template模板与component组件的区别和使用

    前言: 除了component,微信小程序中还有另一种组件化你的方式template模板,这两者之间的区别是,template主要是展示,方法则需要在调用的页面中定义.而component组件则有自己 ...

  5. 微信小程序开发——模板中加载html代码

    最新方法可以使用微信小程序提供的 rich-text (富文本)组件直接写解析html,详见 rich-text: <rich-text class='f13 c_9' nodes=" ...

  6. 微信小程序开发--模板(template)使用,数据加载,点击交互

    微信小程序视图层提供了 模板(template),可以在模板中定义代码片段,然后在不同的地方调用.结果在数据渲染那懵逼了.按照官网上对模板的说明和对数据的加载. 1.定义模板 使用name属性,作为模 ...

  7. 前端微信小程序电影类仿淘票票微信小程序

    需求描述及交互分析设计思路和相关知识点电影界面顶部页签切换效果设计正在热映界面布局设计即将上映界面布局设计电影详情页设计我的界面列表导航设计登录设计 相关知识点(1)swiper滑块视图容器组件,可以 ...

  8. 微信小程序之模板消息推送

    最近在用sanic框架写微信小程序,其中写了一个微信消息推送,还挺有意思的,写了个小demo 具体见官方文档:https://developers.weixin.qq.com/miniprogram/ ...

  9. 微信小程序 发送模板消息的功能实现

    背景 - 小程序开发的过程中,绝大多数会满足微信支付 - 那么,作为友好交互的体现,自然就会考虑到支付后的消息通知咯 - 所以,我的小程序项目也要求完成这个效果,so.分享一下自己的实现步骤,以方便道 ...

随机推荐

  1. java枚举enum总结大全

    1.注意点 (1)枚举中的构造方法必须是private的. (2)枚举中可以定义抽象方法和一般方法,但枚举对象必须实现所有抽象方法. (3)枚举对象必须放在第一行. package classTwo0 ...

  2. Vue 项目 VSCode 调试

    调试Vue搭建的前端项目 在项目根目录下的vue.config.js中添加: module.exports = { lintOnSave: false, //关闭eslint语法校验 //填写这部分 ...

  3. redhat7.2下VNC没法显示图像

    1,Symptom /root/.vnc/HR-ECC-PRD-02:1.log内容有信息如下: VNCSconnST: Server default pixel fromat depth 24 (3 ...

  4. mybatis批量更新报错 org.mybatis.spring.MyBatisSystemException

    具体报错信息: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Bin ...

  5. RocketMQ-c#代码

    导入包: https://github.com/gaufung/rocketmq-client-dotnet/tree/master using org.apache.rocketmq.client. ...

  6. SpringBoot项目打成jar在linux后台运行

    --关闭客户端依然进程存在 nohup java -jar spring-boot-hello-1.0.jar 1>/dev/null 2>&1 & --Ctrl+C后不会 ...

  7. wpscan 更新超时报错

    wpscan更新超时报错 本人亲测方法2 https://data.wpscan.org/plugins.json https://data.wpscan.org/plugins.json.sha51 ...

  8. docker学习6-docker-compose容器集群编排

    前言 实际工作中我们部署一个应用,一般不仅仅只有一个容器,可能会涉及到多个,比如用到数据库,中间件MQ,web前端和后端服务,等多个容器. 我们如果一个个去启动应用,当项目非常多时,就很难记住了,所有 ...

  9. 删除线性表中所有值为x的元素

    时间复杂度O(n),空间复杂度O(1). 简单的问题两种不同的思路. 代码: #include <stdio.h> #define MAX 100 struct sqlist{ int d ...

  10. 项目Alpha冲刺--8/10

    项目Alpha冲刺--8/10 作业要求 这个作业属于哪个课程 软件工程1916-W(福州大学) 这个作业要求在哪里 项目Alpha冲刺 团队名称 基于云的胜利冲锋队 项目名称 云评:高校学生成绩综合 ...