<view class="list">
<form bindsubmit="formSubmit">
<view class="item-addr flexa" bindtap="translate">
<view>所在城市:</view>
<view style='color:#666' wx:if="{{valuetext?'':true}}">请选择</view>
<view>{{valuetext}}</view>
<input style='display:none' name="valuetext" placeholder-style="color:#333" placeholder="请选择" class="animation-button" bindtap="translate" value="{{valuetext}}"></input>
</view>
</form>
<!-- 地址代码 -->
<view class="animation-element-wrapper" animation="{{animation}}" style="visibility:{{show ? 'visible':'hidden'}}" bindtap="hiddenFloatView" data-id="444">
<view class="animation-element">
<text class="left-bt" catchtap="hiddenFloatView" data-id="555">取消</text>
<text class="right-bt" catchtap="hiddenFloatView" data-id="666">确定</text>
<view class="line"></view>
<picker-view indicator-style="height: 50rpx;" indicator-class="ccc" value="{{value}}" bindchange="bindChange">
<!--省-->
<picker-view-column >
<view wx:for="{{provinces}}" wx:for-item="sheng" wx:key="">
{{sheng.name}}
</view>
</picker-view-column>
<!--地级市-->
<picker-view-column>
<view wx:for="{{citys}}" wx:key="">
{{item.name}}
</view>
</picker-view-column>
<!--区县-->
<picker-view-column>
<!-- <view class="picker-view" wx:key="months{{index}}" wx:for="{{picker_month}}" style="line-height: 50px">{{item}}月</view> -->
<view wx:for="{{countys}}" wx:key="">
{{item.name}}
</view>
</picker-view-column>
</picker-view>
</view>
</view>
</view>
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//获取应用实例
var app = getApp()
// 地址相关数据---------------------
// var area = require('../../utils/date.js')
var pickerViewT = 0;
var show = false;
var moveY = 200;
// 地址相关数据尾部---------------------
Page({
data: {
cur_year:'',
cur_month:'',
cur_days: '',
cur_value: [0, 0, 0],
days: '',
},
// 地址相关函数 -----------------
// 地址相关函数 尾部-----------------
onLoad: function (options) {
},
// ------------------- 分割线 --------------------
onReady: function () {
},
//移动按钮点击事件
translate: function (e) {
if (pickerViewT == 0) {
moveY = 0;
show = false;
pickerViewT= 1;
} else {
moveY = 200;
show = true;
pickerViewT = 0;
}
// this.animation.translate(arr[0], arr[1]).step();
animationEvents(this, moveY, show);
},
//隐藏弹窗浮层
hiddenFloatView(e) {
// console.log(e);
moveY = 200;
show = true;
pickerViewT = 0;
animationEvents(this, moveY, show);
},
//------------------------------------------------------------
})
//动画事件
function animationEvents(that, moveY, show) {
// console.log("moveY:" + moveY + "\nshow:" + show);
that.animation = wx.createAnimation({
transformOrigin: "50% 50%",
duration: 400,
timingFunction: "ease",
delay: 0
}
)
that.animation.translateY(moveY + 'vh').step()
that.setData({
animation: that.animation.export(),
show: show
})
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
.ccc{
border-top:2px solid #839AAF;
border-bottom:2px solid #839AAF;
}
picker-view-column{
margin: 0 20rpx;
}
/* 地址相关数据---------------------------------------------------- */
picker-view{
">white;
padding: 0;
width: 100%;
height: 380rpx;
bottom: 0;
position: fixed;
}
picker-view-column view{
vertical-align:middle;
font-size: 28rpx;
line-height: 28rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.animation-element-wrapper {
display: flex;
position: fixed;
left: 0;
top:0;
height: 100%;
width: 100%;
">rgba(0, 0, 0, 0.6);
overflow: hidden;
}
.animation-element {
display: flex;
position: fixed;
width: 100%;
height: 470rpx;
bottom: 0;
">rgba(255, 255, 255, 1);
}
.animation-element text{
color: #999999;
display: inline-flex;
position: fixed;
margin-top: 20rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
font-size: 34rpx;
font-family: Arial, Helvetica, sans-serif;
}
.animation-element .left-bt{
left: 30rpx;
}
.animation-element .right-bt {
right: 30rpx;
}
.animation-element .line{
display: block;
position: fixed;
height: 1rpx;
width: 100%;
margin-top: 89rpx;
">#eeeeee;
}
- 微信小程序 功能函数 openid本地和网络请求
本地-------------------------------------------------------------------------------------------------- ...
- 微信小程序 功能函数 支付接口
// 订单生成返回数据,弹出是否支付模态 wx.showModal({ title: '微信支付', content: '确定支付吗?', success: function (res) { if ( ...
- 微信小程序 功能函数 客服
<view> <view class='btn-img'> <image class='image-full' src='../../imgs/index/tab6.pn ...
- 微信小程序 功能函数 点击传参和页面
// 商品详情页跳转函数 detailInto: function (e) { // console.log() var change = e.currentTarget.dataset.id; wx ...
- 微信小程序 功能函数 touch触摸计时
shiFN:function(e){ // touchstart // touchend let that=this; let n=0; // 判断是开始还是结束的参数 let textTure = ...
- 微信小程序 功能函数 定时震动
ffn: function () { let nnn = this.data.nnn nnn += 1; this.setData({ nnn: nnn }); if (nnn > 10) { ...
- 微信小程序 功能函数 将对象的键添加到数组 (函数深入)
// 将对象的键添加到数组 var arr = Object.keys(site); //英文 https://developer.mozilla.org/en-US/docs/Web/JavaScr ...
- 微信小程序 功能函数 购物车商品删除
// 购物车删除 deleteList(e) { const index = e.currentTarget.dataset.index; let carts = this.data.carts; c ...
- 微信小程序 功能函数 替换字符串内的指定字符
var str = 'abcadeacf'; var str1 = str.replace('a', 'o'); alert(str1); // 打印结果: obcadeacf var st ...
随机推荐
- gabor变换人脸识别的python实现,att_faces数据集平均识别率99%
大家都说gabor做人脸识别是传统方法中效果最好的,这几天就折腾实现了下,网上的python实现实在太少,github上的某个版本还误导了我好几天,后来采用将C++代码封装成dll供python调用的 ...
- CF535E Tavas and Pashmaks
今天Fakehu考的T1. 大致意思就是有n个人每个人有两个速度\(v_1,v_2\),比赛有两个路程\(A,B\),最后时间是\(A/v_1+B/v_2\).求每个人是否可能成为冠军中的一个. 显然 ...
- 洛谷 P1337 [JSOI2004]平衡点 / 吊打XXX
洛谷 P1337 [JSOI2004]平衡点 / 吊打XXX 点击进入FakeHu的模拟退火博客 神仙模拟退火...去看fakehu的博客吧...懒得写了... 因为精度问题要在求得的最优解附近(大约 ...
- Linux下通过进程名查询占用的端口
1.首先根据名称用ps命令查看进程ID: ps -ef | grep zookeeper jim 10997 1959 0 12月14 pts/2 00:00:01 /usr/lib/jvm/java ...
- USACO Section1.3
section1.2主要包括5道题和1个编程知识介绍.下面对这6部分内容进行学习. Complete Search 这个翻译成枚举搜索或者穷举搜索.主要用于当写代码时间不够用而且不用考虑程序的效率问题 ...
- python并发编程之多进程理论知识
一 什么是进程 进程:正在进行的一个过程或者说一个任务.而负责执行任务则是cpu. 举例(单核+多道,实现多个进程的并发执行): egon在一个时间段内有很多任务要做:python备课的任务,写书的任 ...
- Json对象与Json字符串的转化、JSON字符串与Java对象的转换(转)
一.Json对象与Json字符串的转化 1.jQuery插件支持的转换方式: $.parseJSON( jsonstr ); //jQuery.parseJSON(jsonstr),可以将json字符 ...
- 基于Cocos2d-x-1.0.1的飞机大战游戏迁移到Cocos2d-x-3.0版本,并移植到Android平台成功运行
一.版本迁移中的问题 1.游戏元素Sprite.Label.Action等等的创建函数名都改为create. 2.函数的回调callfunc_selectorcallfuncN_selectorcal ...
- axios的简单使用
axios是一个通用的ajax请求库,vue 2.0以后,推荐使用axios Axios 是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中. 使用: 1.下载安装 n ...
- 经典笔试题:用C写一个函数测试当前机器大小端模式
“用C语言写一个函数测试当前机器的大小端模式”是一个经典的笔试题,如下使用两种方式进行解答: 1. 用union来测试机器的大小端 #include <stdio.h> union tes ...