[微信小程序]点击切换卡片动画效果
微信小程序开发交流qq群 173683895
承接微信小程序开发。扫码加微信。
正文:
先上效果图, GIF:
<!--pages/roll/roll.wxml-->
<!-- 单身 -->
<block wx:if="{{danshen}}"><view class="card_wrap"><view animation="{{animationData}}" class="card_item"><span class="change_icon" bindtap="slidethis" data-src='{{img_list[0]}}'><image src="../../image/changeicon.png"></image></span><view class="card_info"><navigator url='../user/my_info/my_info'><view class='info'><view class='name'>{{danshen_data.name}}</view><view class='site font_30'>{{danshen_data.address}} ` {{danshen_data.age}}岁 ` {{danshen_data.constellation}} ` {{danshen_data.work_industry}}</view></view><image class='aaa' src='{{img+danshen_data.headimg}}'></image></navigator><view class='site'>TA的媒婆</view><navigator url="../detail/detail?productId={{danshen_data.meipo_info.id}}" wx:if="{{danshen_data.meipo_info.id}}"><view class='page_row recommend_list'><image class='' src='{{img+danshen_data.meipo_info.headimg}}'></image><view class='page_clu user_title'><view>{{danshen_data.meipo_info.name}}</view><text style='color:#999'>{{danshen_data.meipo_info.qinaming}}</text></view></view></navigator><view wx:if="{{!danshen_data.meipo_info.id}}">它暂时没有媒婆</view></view><image class='bg_image1' bindtouchend="slidethis" data-src='{{img_list[0]}}' src="{{img_list[0]}}"></image></view></view><image class='bg_image2' src="{{img_list[1]}}"></image><image class='bg_image3' src="{{img_list[2]}}"></image>
</block>
<!-- 媒婆 -->
<block wx:if="{{meipo}}"><view class='meipo'><view class='top'><image class='add' src='../../image/分享.png'></image><view class='top_txt'>招募我的单身团</view></view><navigator url="../user/relation_list/relation_list"><view class="qbdd mt10"><span class="font_14 c3">单身团申请</span><image src='../../image/arrowright.png' class='store_icon' style="width:40rpx; height: 40rpx;"></image></view></navigator><navigator url="detail/detail"><view class="qbdd mt10"><span class="font_14 c3">单身团动态</span><image src='../../image/arrowright.png' class='store_icon' style="width:40rpx; height: 40rpx;"></image></view></navigator><!-- <navigator url=""><view class="qbdd mt10"><span class="font_14 c3">单身悬赏求推荐</span><image src='../../image/arrowright.png' class='store_icon' style="width:40rpx; height: 40rpx;"></image></view></navigator> --><view class='xxx'></view><!-- 推荐 --><view class="qbdd mt10 "><span class="font_14 c3">我现有的单身团成员</span><text class='store_icon shen {{shenfen==2?"on":""}}' data-id='2' bindtap='shenfen_click'>女神 {{meipo_data.k2}}</text><text class='store_icon shen {{shenfen==1?"on":""}}' data-id='1' bindtap='shenfen_click'>男神 {{meipo_data.k1}}</text></view><view class='txt'><block wx:if="{{shenfen==1}}"><view wx:if="{{nanshen_card}}"><import src="../index/card/card.wxml" /><template is="nanshen_card" data="{{nanshen_card,img}}" /></view><view wx:else><image class='hade' src='../../image/add.png'></image><view style='color:#d0d0d0' class='top_40'>暂无男生单身团成员</view><view class='add_roll'>招募我的单身团</view></view></block><block wx:else><view wx:if="{{nvshen_card}}"><import src="../index/card/card.wxml" /><template is="nvshen_card" data="{{nvshen_card,img}}" /></view><view wx:else><image class='hade' src='../../image/add.png'></image><view style='color:#d0d0d0' class='top_40'>暂无女生单身团成员</view><view class='add_roll'>招募我的单身团</view></view></block></view></view>
</block>
/* pages/roll/roll.wxss */
@import '../index/card/card';
/* 单身 */
page{background:#E0E0E0;margin: 0 auto
}
.aaa{ text-align: center;width: 85%;margin: 40rpx;height: 250rpx;display: inline-block;}
.card_wrap .card_item {position: absolute;width: 80%;
}
.card_wrap .card_item span.change_icon image {position: absolute;width: 70rpx;height: 21rpx;top: 128rpx;left: 305rpx;box-shadow:none;
}
.card_wrap .card_item .card_info {position: absolute;margin-top: 220rpx;left: 128rpx;
}.card_wrap .card_item.card1 {transform: translateY(90rpx) translateX(50rpx);z-index: 3
}
.card_wrap .card_item.card2 {z-index: 2;transform: translateY(60rpx) translateX(82rpx);
}.card_wrap .card_item.card3 {transform: translateY(30rpx) translateX(100rpx);z-index: 1;
} .bg_image2 {left: 80rpx;top: 80rpx;position: absolute;z-index: -2;display: block;width: 600rpx;height: 950rpx;border-radius: 6rpx;box-shadow: 6rpx 23rpx 20rpx 10rpx #ccc;
}.bg_image1 {display: block;width: 600rpx;height: 950rpx;margin-left: 50rpx;margin-top: 110rpx;border-radius: 6rpx;box-shadow: 6rpx 23rpx 20rpx 10rpx #ccc;
} .bg_image3 {left: 110rpx;position: absolute;top: 50rpx;z-index: -3;display: block;width: 600rpx;height: 950rpx;border-radius: 6rpx;box-shadow: 6rpx 23rpx 20rpx 10rpx #ccc;
}
.info{border: 1px #E3E3E3 solid;padding: 20rpx;width: 400rpx;margin: 15rpx auto;color: white;background-color:rgba(0,0,0,0.2);
}
.name{font-size: 50rpx;
}
.recommend_list image{width:100rpx;height:100rpx;margin-top: 35rpx;border-radius: 50%;
}
.user_title{margin-top: 45rpx;margin-left: 40rpx;font-size: 30rpx;
}/* 媒婆 */
.meipo{margin: 0 auto;
}
.txt{text-align: center}
.top{height: 200rpx;width: 100%;background: #01A89E;color: white
}
.top_txt{position: absolute;top: 50rpx;left: 60rpx;font-size: 50rpx;width: 250rpx;letter-spacing: 5rpx;
}
.add{width: 80rpx;height: 80rpx;float: right;right: 120rpx;position: absolute;top: 80rpx;
}
/* LIST */
.qbdd {
background: #fff;
width: 92%;
font-size: 12px;
color: #666;
padding: 4%;
border-bottom: 1px solid #eee;
}
.c33 {
float: left;
color: #000;
}.store_icon {
float: right;
}
.shen{width: 120rpx;padding: 16rpx;text-align: center;
}
.hade{margin-top: 50rpx;position: relative;left: 170rpx;width: 170rpx;height: 150rpx;
}
.add_roll{position: relative;top: 60rpx;bottom: 60rpx;padding: 20rpx;border-radius: 50rpx;background: #01A89E;width: 50%;margin: 0 auto;color: white
}
// pages/roll/roll.js
var app = getApp();
var util = require("../../utils/util.js")
Page({data: {shenfen: 1,nanshen_card: {},nvshen_card: {},img_list: ['http://dev.wemart.cn/console/images/card/card1.png', 'http://dev.wemart.cn/console/images/card/card2.png','http://dev.wemart.cn/console/images/card/card3.png'],danshen_data: {},meipo_data: {},meipo: true,danshen: false,img: 'http://sz800800.cn/Uploads/',animationData: {},},// 男神女神推荐shenfen_click: function (e) {var shen_click_val = e.currentTarget.dataset.idconsole.log(shen_click_val)this.setData({shenfen: shen_click_val})},onShow: function (options) {if (wx.getStorageSync('btn') == 1) {wx.setNavigationBarTitle({ title: '快速组团' })this.setData({meipo: true,danshen: false})} else {wx.setNavigationBarTitle({ title: '智能推荐' })this.setData({meipo: false,danshen: true})}this.show_data()},show_data: function () {var that = thisvar data = {program_id: app.program_id,openid: app.openid,}if (this.data.danshen) {util.request('', 'get', data, '正在加载数据', function (res) {that.setData({danshen_data: res.data,img_length: res.data.length})})} else {util.request('', 'get', data, '正在加载数据', function (res) {console.log(res.data)that.setData({meipo_data: res.data,nanshen_card: res.data.k3,nvshen_card: res.data.k4})})}}, //单身事件处理函数slidethis: function (e) {var that = this;var img_list = this.data.img_list;var img_1 = this.data.img_list[0];img_list.splice(0, 1)img_list.push(img_1)this.setData({img_list: img_list})var animation = wx.createAnimation({duration: 300,timingFunction: 'cubic-bezier(.8,.2,.1,0.8)',});this.animation = animation;this.animation.translateY(-420).rotate(-5).translateX(0).step();this.animation.translateY(0).translateX(0).rotate(0).step();this.setData({animationData: this.animation.export()});setTimeout(function () {that.setData({animationData: {}});}, 350);this.show_data()},/*** 用户点击右上角分享*/onShareAppMessage: function () {}
})
相关文章:

redis学习之——Redis事务(transactions)
Redis事务:可以一次执行多个命令,本质是一组命令的集合。一个事务中的,所有命令都会序列化,按顺序地串行化执行而不会被其它命令插入,不许加塞。 常用命令:MULTI 开启事务 EXEC 提交事务、 DISCARD 放弃…

WordPress页面Page和文章Post的相互转换
1. 进入phpMyAdmin; 2. 进入WordPress对应的数据库; 3. 浏览wp_posts数据表; 4. 找到相应的 页面Page 并编辑(找到相应的 文章Post 并编辑); 5. 修改 post_type 为 post(page)&#…

airbnb_我如何在一个晚上建立音乐工作室的Airbnb
airbnbby Mike Williams由Mike Williams 我如何在一个晚上建立音乐工作室的Airbnb (How I built the Airbnb of music studios in a single evening) Sometimes you come up with an idea that you just know has to be built. That was the case I came up with Studiotime, …

QT学习第8课:QT计算器界面实现
声明:此文章仅是个人在学习狄泰QT课程所做的笔记,文章中包含狄泰资料的,一切版权归狄泰软件所有! 第8课是来做一个计算器界面,只是一个界面显示。不过也是挺兴奋的,以前一直对着黑框框,现在…
C# 实现对接电信交费易自动缴费 续(winio/winring0 自动填密码)
自动填密码大家可能都不莫生,最有名的应该是 按键精灵 只要是一个可以输入的地方都可以能过按键精灵来完成输入.我今天要讲的是使用 winio/winring0来完成类似的功能 如果要自动填充密码方式基本上有 消息级的模拟 和 驱动级的模拟, 消息级的模拟如 C# 直接使用 SendKeys 就可以…

[微信小程序]js动态改变数组对象列表中的样式
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 这里我用微信小程序商城开发中选择商品规格选择做示例: 先把效果图让大家看看, 默认情况下是这样的 当点击了规格11以后: 该商品规格的颜色变成红色,并且显示该规格商品的图片和…

ios snapkit m_如何使用自动布局和SnapKit在iOS上创建漂亮的拉伸布局
ios snapkit mby Enabled Solutions由Enabled Solutions 如何使用自动布局和SnapKit在iOS上创建漂亮的拉伸布局 (How to create beautiful Stretchy Layouts on iOS using Auto Layout and SnapKit) Check the image below. This is a cool effect.检查下面的图像。 这是一个很…

谷歌 notification 测试 页面
1 <button onclick"notifyMe(master wei,http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png,我在测试谷歌通知功能,http://www.mi.com/)">通知!</button>2 <script>3 var sum 0;4 document.addEventListener(DOMContentLoaded, fun…

[转]如果我有jQuery背景,我应该如何切换到AngularJS的思维模式?
导言 stackoverflow上有一个人问了一个问题:如果我有jQuery背景,我应该如何切换到AngularJS的思维模式? 有一个回复非常经典,获得了两千多票。 为了让国内开发者也能领略到其中的核心思想,现把这个问题和答案翻译出来供…

[微信小程序]实现一个自定义遮罩层组件(完整示例代码附效果图)
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 先上效果图: 点击按钮Show显示遮罩层,再次点击屏幕任何地方隐藏遮罩层; <button bindtap"showview">Show</button> <view class"bg" bindtaphide…

网红快餐店_在一家快餐店工作解释了AJAX基础知识
网红快餐店by Kevin Kononenko凯文科诺年科(Kevin Kononenko) 在一家快餐店工作解释了AJAX基础知识 (AJAX Basics Explained By Working At A Fast Food Restaurant) AJAX (Asynchronous JavaScript And XML) can be pretty confusing if you do not have a firm understandin…

ThinkPHP 3.2 中获取所有函数方法名,以及注释,完整可运行
<?phpnamespace Home\Controller;use Common\Controller\BaseController;class AuthController extends BaseController{/*** cc index主页面*/public function index(){$modules array(Home); //模块名称$i 0;foreach ($modules as $module) {$all_controller $this-…

减少Building 'Xxx' Gradle project info等待时间
转载请注明出处:http://www.cnblogs.com/cnwutianhao/p/6640279.html 从Github上看到好的Demo想要Download下来学习。导入到Android Stduio的时候经常会碰到这样的事情。。。 等了半天没反应还是这个界面,老子要报警了!!…

js表单验证,如果不为空时自动改变提交按钮的背景色
<!DOCTYPE html><head><title>js验证表单,如果表单都不为空,则按钮颜色自变,某为空时恢复原本背景色</title><script language"javascript" type"text/javascript">var a ;var b ;function chadnge(e) {a e;if(a ! &…

ux可以去哪些公司_忽略UX会如何伤害您的API以及您可以如何做
ux可以去哪些公司by Ifeoluwa Arowosegbe通过Ifeoluwa Arowosegbe 忽略UX会如何伤害您的API以及您可以如何做 (How ignoring UX hurts your API and what you can do about it) Creating experiences that users love is crucial to the success of any product. Companies in…

初识java类的接口实现
初识java类的接口实现 如果两个类之间不存在继承关系,且两个类都想实现同一个接口,两个类都必须实现接口中全部方法,否则报语法错误如果两个类之间存在继承关系也想实现同一个接口,父类如果实现了某个接口的全部方法,从…

KMP的next[]数组
KMP是众多字符串问题的基础 理解next数组尤为重要 next又称前缀数组 是 它所处位置的前一个位置的元素 与 该链 链首开始 几个元素相匹配(即相同) 举个实例来说明: next对应的是该位置的前一个元素, 即next[i]对应a[i-1] 因为-1头指针的存在 next均对应…
[微信小程序]手指触摸动画效果(完整代码附效果图)
微信小程序开发交流qq群 173683895 本文共有两个示例,先上图 示例一: 示例二: 示例一代码(微信小程序): // pages/test/test.js Page({containerTap: function (res) {var that thisvar x res.touches[0].pageX;var y res.touches[0].pageY 85;this.setData({rippleS…

webpack 占位符_通过示例学习Webpack:占位符图像模糊
webpack 占位符by Kalalau Cantrell通过Kalalau Cantrell 通过示例了解Webpack:占位符图像模糊 (Learn Webpack by Example: Blurred placeholder images) The repo that goes along with this post uses webpack 3. If you are interested in learning webpack 4,…

UIImage 各种处理(分类)
1 interface UIImage (conversion)2 3 //压缩图片到宽度10244 (UIImage *)imageCompressSizeToMin1024Width:(UIImage *)image;5 6 7 //修改图片size8 (UIImage *)image:(UIImage *)image byScalingToSize:(CGSize)targetSize;9 10 //UIColor 转UIImage 11 (UIImage *)…

Matlab随笔之矩阵入门知识
直接输入法创建矩阵 – 矩阵的所有元素必须放在方括号“[ ]”内; – 矩阵列元素之间必须用逗号“,”或空格隔开,每行必须用“;”隔开 – 矩阵元素可以是任何不含未定义变量的表达式。可以是实数,或者是复数。 – 例a[1,2;3,4] 或 …

[微信小程序]提交表单返回成功后自动清空表单的值
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 实现思路: 给每一个input绑定相同的value对象,提交成功后把这个对象赋值为空. 下面看代码: <form bindsubmitformsubmit><view><span>* </span>公司名称:&l…

xebium周末启动_我如何在周末建立和启动聊天机器人
xebium周末启动by Mike Williams由Mike Williams 我如何在周末建立和启动聊天机器人 (How I Built And Launched A Chatbot Over The Weekend) 在数小时内将您的想法带入功能性bot,获得真实的用户反馈,并在周末结束前启动! ? (Ta…

transition属性值
一、transition-property: transition-property是用来指定当元素其中一个属性改变时执行transition效果,其主要有以下几个值:none(没有属性改变);all(所有属性改变)这个也是其默认值;indent(元素…

[微信小程序]下拉菜单
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 动画效果是使用CSS3 keyframes 规则(使 div 元素匀速向下移动) <view class page_row><view class"nav" wx:for{{nav_title}} wx:key"index"><vi…

文件解析库doctotext源码分析
doctotext中没有make install选项,make后生成可执行文件在buile目录下面有.so动态库和头文件,需要的可以从这里面拷贝build/doctotext就是可执行程序。doctotext内置了两种检测文件类型方法:1、以后缀为依据检测文件类型2、以内容为依据检测文…

tmux系统剪切板_实践中的tmux:与系统剪贴板集成
tmux系统剪切板by Alexey Samoshkin通过阿列克谢萨莫什金(Alexey Samoshkin) 在实践中使用tmux:与系统剪贴板集成 (tmux in practice: integration with the system clipboard) 如何在tmux复制缓冲区和系统剪贴板之间建立桥梁,以及如何在OSX或Linux系统…

【Java面试题】54 去掉一个Vector集合中重复的元素
在Java中去掉一个 Vector 集合中重复的元素 1)通过Vector.contains()方法判断是否包含该元素,如果没有包含就添加到新的集合当中,适用于数据较小的情况下。 import java.util.Vector; public class DeleteVector {public static v…

tornado+nginx上传视频文件
[http://arloz.me/tornado/2014/06/27/uploadvideotornado.html] [NGINX REFRER: Nginx upload module] 由于tornado通过表达上传的数据最大限制在100M,所以如果需要上传视屏文件的情况在需要通过其他方式实现, 此处采用nginx的nginx-upload-module和jQu…

微信小程序swiper组件宽高自适应方法
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 我把 swiper 的 width 设定成了屏幕的95%宽度, 如果想宽度也自适应的话请改成 width:{{width*2}}rpx <swiper classadvertising2 indicator-dots"true" styleheight:{{…