Commit 6773e1c6 by chenwq

样式

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