小程序 swiper banner 图片 居中
var imgUrlApp = getApp().globalData.imgUrlApp;
Page({
/**
* 页面的初始数据
*/
data: {
indicatorDots: true,
vertical: false,
autoplay: false,
circular: false,
interval: 2000,
duration: 500,
previousMargin: 0,
nextMargin: 0,
imgUrlApp: imgUrlApp,
swiperimgUrls: ['http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg'
],
userinfo: {},
companyinfo: {}
}, /**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
var that = this;
console.log(
wx.getStorageSync("username")),
wx.request({
url: getApp().globalData.apiUrlApp + 'acc/get_userinfo/',
header: {
"Content-Type": "application/x-www-form-urlencoded",
'cookie': wx.getStorageSync("username"), //读取cookie,
'cookie': wx.getStorageSync("uid"), //读取cookie,
'cookie': wx.getStorageSync("gid") //读取cookie, },
method: "GET",
data: {
username: wx.getStorageSync("username")
},
success: function(res) {
console.log(res)
if (res.data.status == 1) {
wx.showToast({
// title: res.data.info,
title: "帐号详情",
icon: 'success',
duration: 1500
}),
that.setData({
userinfo: res.data.data
}),
wx.request({
url: getApp().globalData.apiUrlApp + 'common/get_orginfo/',
header: {
"Content-Type": "application/x-www-form-urlencoded",
'cookie': wx.getStorageSync("username"), //读取cookie,
'cookie': wx.getStorageSync("uid"), //读取cookie,
'cookie': wx.getStorageSync("gid") //读取cookie, },
method: "GET",
data: {
uid: wx.getStorageSync("uid")
},
success: function(res) {
console.log(res)
if (res.data.status == 1) {
wx.showToast({
// title: res.data.info,
title: "帐号详情",
icon: 'success',
duration: 1500
}),
that.setData({
companyinfo: res.data.data
})
} else if (res.data.status == 0) {
wx.showToast({
title: "无数据返回",
icon: 'success',
duration: 1500
})
} else if (res.data.status == -1) {
wx.showToast({
title: "请求异常,请检查重试",
icon: 'loading',
duration: 2000
})
}
}
})
} else if (res.data.status == 0) {
wx.showToast({
title: "无数据返回",
icon: 'success',
duration: 1500
})
} else if (res.data.status == -1) {
wx.showToast({
title: "请求异常,请检查重试",
icon: 'loading',
duration: 2000
})
}
}
})
}, /**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() { }, /**
* 生命周期函数--监听页面显示
*/
onShow: function() { }, /**
* 生命周期函数--监听页面隐藏
*/
onHide: function() { }, /**
* 生命周期函数--监听页面卸载
*/
onUnload: function() { }, /**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() { }, /**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() { }, /**
* 用户点击右上角分享
*/
onShareAppMessage: function() { }, onShow: function() {
// 页面显示
},
onHide: function() {
// 页面隐藏
},
onUnload: function() {
// 页面关闭
},
})
@import "../../style/weui.wxss";
<view class="mainpage">
<view class="banner">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" circular="{{circular}}" vertical="{{vertical}}" interval="{{interval}}" duration="{{duration}}" previous-margin="{{previousMargin}}px" next-margin="{{nextMargin}}px">
<block wx:for="{{swiperimgUrls}}" wx:key="*this">
<swiper-item>
<image src="{{item}}" class="slide-image" style="width:100%" />
</swiper-item>
</block>
</swiper> </view>
小程序 swiper banner 图片 居中的更多相关文章
- 微信小程序 swiper 显示图片计数 当前/总数
<view class="swiperContainer"> <swiper bindchange="swiperChange" autopl ...
- 微信小程序swiper实现 句子控app首页滑动卡片
微信小程序swiper实现 句子控app首页滑动卡片 引言:最近看到句子控APP首页的效果很清新,可是发现他的微信小程序端没有实现这个功能,我看了一下难度不大,于是尝试着去实现. 实现效果如下: 1. ...
- 微信小程序点击图片放大预览
微信小程序点击图片放大预览使用到 wx.previewImage 接口,可以放大.上/下一张 上代码 wxml代码 <view class='content-img' wx:if="{ ...
- 微信小程序swiper高度自适应,swiper的子元素高度不固定
小程序 swiper 组件默认高度150px,并且如果子元素过高,swiper不会自适应高度 解决方案一: (总体来说不够完美,适合满屏滑动) 如果不是满屏的状态,用scroll-view IOS滑动 ...
- Visual Studio 2017中使用正则修改部分内容 如何使用ILAsm与ILDasm修改.Net exe(dll)文件 C#学习-图解教程(1):格式化数字字符串 小程序开发之图片转Base64(C#、.Net) jquery遍历table为每一个单元格取值及赋值 。net加密解密相关方法 .net关于坐标之间一些简单操作
Visual Studio 2017中使用正则修改部分内容 最近在项目中想实现一个小工具,需要根据类的属性<summary>的内容加上相应的[Description]特性,需要实现的效 ...
- 小程序swiper实现订单页面
小程序swiper实现订单页面 myOrder.wxml <!--pages/myorder/myorder.wxml--> <view class="swiper-tab ...
- 微信小程序简单封装图片上传组件
微信小程序简单封装图片上传组件 希望自己 "day day up" -----小陶 我从哪里来 在写小程序的时候需要上传图片,个人觉得官方提供的 Uploader 组件不是太好用, ...
- 小程序 swiper 轮播图滚动图片 + 视频
直奔代码主题wxml: <view class="test_box"> <swiper indicator-dots="{{indicatorDots} ...
- 微信小程序swiper 前后边距的使用
小程序中有一个组件swiper 就是滑块视图容器 其中提供了两个属性 previous-margin:前边距,可用于露出前一项的一小部分 next-margin:后边距,可用于露出后一项的 ...
随机推荐
- 查询UNDO使用情况
查看UNDO事务占用情况 SELECT s.username, s.sid, pr.PID, s.OSUSER, s.MACHINE, s.PROGRAM, rs.segment_id, r.usn, ...
- VM上完美运行macos
VM上完美运行macos 作者:方辰昱 时间:十月三号 效果图 简要步骤 下载安装VM 下载镜像文件链接,darwin.iso,unlocker,beamoff.合集下载链接:https://pan. ...
- MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...
- AC日记——最大子段和 洛谷 P1115
题目描述 给出一段序列,选出其中连续且非空的一段使得这段和最大. 输入输出格式 输入格式: 输入文件maxsum1.in的第一行是一个正整数N,表示了序列的长度. 第2行包含N个绝对值不大于10000 ...
- ELK之收集Nginx、Tomcat的json格式日志
1.安装Nginx yum -y install nginx vim /etc/nginx/nginx.conf # 修改日志格式为json格式,并创建一个nginxweb的网站目录 log_form ...
- nginx原配置
#原配置 server { listen ; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main ...
- AbstractQueuedSynchronizer 队列同步器源码分析
AbstractQueuedSynchronizer 队列同步器(AQS) 队列同步器 (AQS), 是用来构建锁或其他同步组件的基础框架,它通过使用 int 变量表示同步状态,通过内置的 FIFO ...
- Maven实现多个项目关联自动化构建(maven-invoker-plugin插件的使用)
以下内容引用自https://ayayui.gitbooks.io/tutorialspoint-maven/content/book/maven_build_automation.html: 注意: ...
- 【mac】mac上安装JDK
安装步骤就是在Oracle官网下载你想要的JDK版本下载,下载的时候同意协议即可 这里就给出jdk安装的位置 还有一点要注意的是,在指定JVM的位置的时候,需要指定到home目录下
- Go -- go语言指针
package main import "fmt" type Test struct { Name string } func change2(t *Test) { t.Name ...