<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 ...
随机推荐
- C++STL学习笔记_(2)deque双端数组知识
#include<iostream> using namespace std; #include "deque" #include "algorithm&qu ...
- 洛咕 P2463 [SDOI2008]Sandy的卡片
哈希水过. 首先这是一段delta相同的序列,按照套路差分一下,b[i]=a[i]-a[i-1],然后就是这些序列的最长公共子段 由于数据范围很小,就可以二分,枚举第一个序列的子段然后每个子序列暴力c ...
- c3p0 ComboPooledDataSource无法识别的问题
maven项目下,基本就是导错包了的问题. 下面那个才是连接池的.
- [VB.NET][C#]WAV格式文件头部解析
简介 WAV 为微软开发的一种声音文件格式,它符合 RIFF(Resource Interchange File Format)文件规范,用于保存 Windows 平台的音频信息资源. 第一节 文件头 ...
- 经典笔试题:用C写一个函数测试当前机器大小端模式
“用C语言写一个函数测试当前机器的大小端模式”是一个经典的笔试题,如下使用两种方式进行解答: 1. 用union来测试机器的大小端 #include <stdio.h> union tes ...
- python002
1.万恶的”+“号字符串拼接 字符串中的连接符+”会开辟一个新的空间,多一个“+“就会多开辟一个空间,影响性能 2.字符串格式化 ”%S“ :字符类型 ”%D“ ”数字类型 ...
- requests.get()解析
1.requests.get(url, params=None, headers=None, cookies=None, auth=None, timeout=None) Sends a GET re ...
- python爬虫之解析库正则表达式
上次说到了requests库的获取,然而这只是开始,你获取了网页的源代码,但是这并不是我们的目的,我们的目的是解析链接里面的信息,比如各种属性 @href @class span 抑或是p节点里 ...
- zabbix-agent报错:zabbix_agentd [5922]: cannot open log: cannot create semaphore set: [28] No space left on device
起因: 新添加完自定义监控项后重启zabbix-agent时失败,查看/var/log/zabbix/zabbix-agentd.log 发现系统提示zabbix共享内存报错 zabbix_agent ...
- 关于kafka的一些问题理解