Commit 6773e1c6 by chenwq

样式

1 parent 987526c8
......@@ -3,6 +3,7 @@ import { scenceList } from '~/pages/tab/index/constant/data'
const busiOptSceneCode = ['-1', 'SC001', 'SC002']
import mineApi from '~/api/mineApi/index'
import { getNowMonth } from '~/utils/format'
import { IMG_URL } from '~/utils/constantData'
Component({
/**
* 组件的属性列表
......@@ -15,6 +16,7 @@ Component({
* 组件的初始数据
*/
data: {
IMG_URL,
busiOptSceneCode,
formData: {
// 0:全部-1;2:精品升级SC002;1:会员权益/升级SC001
......@@ -74,12 +76,13 @@ Component({
return params
},
// handleInputeClear(e) {
// this.setData({
// isInputClear: true,
// ['formData.userName']: ''
// })
// },
handleInputeClear(e) {
this.setData({
isInputClear: true,
['formData.userName']: ''
})
console.log(this.data.isInputClear, 'isInputClear---')
},
handleInput(e) {
let { attr } = e.currentTarget.dataset
......@@ -90,7 +93,13 @@ Component({
},
changeFold() {
let { isFold } = this.data
let { isInputClear } = this.data
if (isInputClear) {
this.setData({
isInputClear: false
})
return true
}
this.setData({
isFold: !this.data.isFold
})
......@@ -101,14 +110,6 @@ Component({
},
handleInputBlur() {
let { isInputClear } = this.data
console.log(isInputClear, 'eieieii')
if (isInputClear) {
this.setData({
isInputClear: false
})
return true
}
this.changeFold()
this.triggerEvent('staffSearch')
},
......
......@@ -51,20 +51,31 @@
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 128rpx;
width: 136rpx;
height: 60rpx;
background: #F8F9FC;
border-radius: 38rpx;
padding-left: 20rpx;
padding: 0 20rpx;
margin-left: 10rpx;
transition: width 0.2s ease-out;
}
.input-flex {
display: flex;
align-items: center;
}
.icon-delete {
position: absolute;
top: 6rpx;
right: 10rpx;
box-sizing: border-box;
width: 50rpx;
height: 60rpx;
text-align: center;
flex-shrink: 0;
.icon {
margin-top: 16rpx;
}
}
.long-input {
......
......@@ -20,9 +20,14 @@
</view>
</scroll-view>
<view class="right-box input {{ isFold ? 'long-input' : '' }}">
<glsx-image src="output/searchIcon.png" class="icon" />
<input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '姓名'}}" maxlength="30" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" />
<!-- <glsx-image wx:if="{{isFold}}" src="output/icon-delete.png" class="icon icon-delete" data-attr="userName" bindcatch="handleInputeClear" /> -->
<!-- <view class="right-box input long-input"> -->
<view class="input-flex">
<glsx-image src="output/searchIcon.png" class="icon" />
<input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '搜索'}}" maxlength="30" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" />
</view>
<view wx:if="{{isFold}}" class="icon-delete" bindtap="handleInputeClear" data-attr="userName">
<glsx-image src="output/icon-delete.png" class="icon" />
</view>
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleServiceChange" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ 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!