Commit 3cae8679 by zhangquan

吸顶效果

1 parent fdb1bb4f
const navStyle = "background-color: transparent;";
import USERAPI from '~/api/usersApi/index'
import WxValidate from '~/utils/WxValidate'
import {
selectAccountLogin,
setLoginInfo
......@@ -18,7 +19,8 @@ Page({
phone:'',
code:''
},
authorized: false
authorized: false,
phoneReady: false
},
navbarReady(e) {
let {
......@@ -33,6 +35,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.validate = new WxValidate()
},
onReady() {
this.init()
......@@ -154,8 +157,11 @@ Page({
this.setData({
[`formData.${name}`] : value
})
let a = this.validate.methods.tel(formData.phone)
console.log(a)
if(this.validate.methods.tel(this.data.formData.phone)){
this.setData({
phoneReady: true
})
}
},
/**获取验证码 */
getSmsCode() {
......@@ -165,7 +171,7 @@ Page({
count
} = this.data,
countDown = 60
if (count) return
if (count || !this.data.phoneReady) return
// this.setData({
// smsLoading: true
// })
......
......@@ -26,7 +26,7 @@
<view class="login-btn code">
<input maxlength="4" adjust-position="{{false}}" placeholder-class="placeholder" placeholder="请输入验证码"
bindinput="input" value="{{formData.code}}" data-name="code"/>
<button disabled="{{phoneReady}}" class="code-btn" bindtap="getSmsCode">{{count? count + 's':'获取验证码'}}</button>
<button disabled="{{!phoneReady}}" class="code-btn" bindtap="getSmsCode">{{count? count + 's':'获取验证码'}}</button>
</view>
<view class="login-btn wx-btn" bindtap="handleLogin">登录</view>
<view class="other">或 <text bindtap="switchLoginMethod" data-type="0">微信登录</text></view>
......
......@@ -6,6 +6,7 @@ Component({
* 组件的属性列表
*/
properties: {
headerHeight: Number
},
/**
......
......@@ -146,7 +146,6 @@
}
.project-img{
height: 500rpx;
white-space: nowrap;
.img-item{
height: 300rpx;
......
......@@ -35,14 +35,16 @@
</view>
</view>
<view class="project-wrap">
<tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab>
<view style="position: sticky;top: {{headerHeight}}px ;z-index: 1;">
<tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab>
</view>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
<block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item">
{{item}}
</view>
</block>
</scroll-view>
<block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item">
{{item}}
</view>
</block>
</scroll-view>
</view>
<!-- 测算按钮 -->
<view class="calculate" bindtap="showCalculate">
......
......@@ -5,6 +5,6 @@
</navigation-bar>
<view style="padding-top: {{headerHeight}}px;">
<product></product>
<product headerHeight="{{headerHeight}}"></product>
</view>
</view>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!