Commit 63d3aa4de74fd40920d602167293d6add54058d1

Authored by xianghenggang
1 parent 987e602b36

登录输入框背景色改变

Showing 3 changed files with 52 additions and 9 deletions

littleApp_child/pages/home/home.js View file @ 63d3aa4
... ... @@ -27,7 +27,8 @@
27 27 pageType: 0,
28 28 time: '0s',
29 29 list:[],
30   - userInfo:''
  30 + userInfo:'',
  31 + inputFocus: { nameInput: false, phoneInput: false, codeInput: false },
31 32 },
32 33 /*---------生命周期--------*/
33 34 onLoad: function () {
... ... @@ -94,6 +95,48 @@
94 95 fail: function (res) {
95 96 console.log(res.errMsg)
96 97 }
  98 + })
  99 + },
  100 + getNameFocus:function(){
  101 + var self=this
  102 + var inputFocus = { nameInput: true, phoneInput: false, codeInput: false }
  103 + self.setData({
  104 + inputFocus: inputFocus
  105 + })
  106 + },
  107 + getPhoneFocus: function () {
  108 + var self = this
  109 + var inputFocus = { nameInput: false, phoneInput: true, codeInput: false }
  110 + self.setData({
  111 + inputFocus: inputFocus
  112 + })
  113 + },
  114 + getCodeFocus: function () {
  115 + var self = this
  116 + var inputFocus = { nameInput: false, phoneInput: false, codeInput: true }
  117 + self.setData({
  118 + inputFocus: inputFocus
  119 + })
  120 + },
  121 + loseNameFocus: function () {
  122 + var self = this
  123 + var inputFocus = { nameInput: false}
  124 + self.setData({
  125 + inputFocus: inputFocus
  126 + })
  127 + },
  128 + losePhoneFocus: function () {
  129 + var self = this
  130 + var inputFocus = { phoneInput: false, }
  131 + self.setData({
  132 + inputFocus: inputFocus
  133 + })
  134 + },
  135 + loseCodeFocus: function () {
  136 + var self = this
  137 + var inputFocus = { codeInput: false }
  138 + self.setData({
  139 + inputFocus: inputFocus
97 140 })
98 141 },
99 142 /*---------自定义函数--------*/
littleApp_child/pages/home/home.wxml View file @ 63d3aa4
... ... @@ -129,19 +129,19 @@
129 129 <form catchsubmit="formSubmit">
130 130  
131 131 <view class="record-input-constainer whiteColor">
132   - <view class="record-input_bg whiteColor" style="border-color:{{inputFocus.nameInput ? '#f4879b' : '#e8eae5'}}">
  132 + <view class="record-input_bg whiteColor" style="border-color:{{inputFocus.nameInput ? '#48C17B' : '#e8eae5'}}">
133 133 <label class="record-input_title">姓名</label>
134   - <input class="input" id="name" name="name" maxlength="12" placeholder="请输入建档姓名" value="" placeholder-class="input-placeholder" bindfocus="getFocus" bindinput="blurNameInput"/>
  134 + <input class="input" id="name" name="name" maxlength="12" placeholder="请输入建档姓名" value="" placeholder-class="input-placeholder" bindfocus="getNameFocus" bindblur="loseNameFocus" bindinput="blurNameInput"/>
135 135 </view>
136   - <view class="record-input_bg" style="margin-top:15px;border-color:{{inputFocus.phoneInput ? '#f4879b' : '#e8eae5'}}">
  136 + <view class="record-input_bg" style="margin-top:15px;border-color:{{inputFocus.phoneInput ? '#48C17B' : '#e8eae5'}}">
137 137 <label class="record-input_title">手机号</label>
138   - <input class="input" id="phone" name="phone" type="number" placeholder="请输入建档手机号" maxlength="11" placeholder-class="input-placeholder" bindfocus="getFocus" value="" bindinput="blurInput" />
  138 + <input class="input" id="phone" name="phone" type="number" placeholder="请输入建档手机号" maxlength="11" placeholder-class="input-placeholder" bindfocus="getPhoneFocus" value="" bindblur="losePhoneFocus" bindinput="blurInput" />
139 139 </view>
140 140  
141 141 <view class="code_view">
142   - <view class="code-input_bg" style="margin-top:15px;border-color:{{inputFocus.codeInput ? '#f4879b' : '#e8eae5'}}">
  142 + <view class="code-input_bg" style="margin-top:15px;border-color:{{inputFocus.codeInput ? '#48C17B' : '#e8eae5'}}">
143 143 <label class="record-input_title" >验证码</label>
144   - <input class="input" id="code" name="code" maxlength="12" placeholder="请输入验证码" value="" placeholder-class="input-placeholder" bindfocus="getFocus" />
  144 + <input class="input" id="code" name="code" maxlength="12" placeholder="请输入验证码" value="" placeholder-class="input-placeholder" bindblur="loseCodeFocus" bindfocus="getCodeFocus" />
145 145 </view>
146 146 <label class="record-time-text" bindtap="getVerifyCode">{{time == '0s' ? '点击获取' : time}}</label>
147 147  
littleApp_child/pages/system_notifacations/system_notifacations.js View file @ 63d3aa4
... ... @@ -46,12 +46,12 @@
46 46 // 加载更多
47 47 loadMore: function (e) {
48 48 if (!hasMore || isRefresh == true) {
49   - return
  49 + return
50 50 }
51 51 page++
52 52 networkUtil.showLoading()
53 53 this.requestData()
54   -
  54 +
55 55 },
56 56 refesh: function () {
57 57 page = 1;