14 changed files with 79 additions and 36 deletions
Split View
Diff Options
-
2app.js
-
41components/textarea/index.js
-
3components/textarea/index.json
-
4components/textarea/index.wxml
-
7components/textarea/index.wxss
-
22pages/agent/appointment/index.js
-
1pages/agent/appointment/index.json
-
4pages/agent/appointment/index.wxml
-
4pages/home/index/index.wxml
-
11pages/process/payment/index.js
-
1pages/process/payment/index.json
-
4pages/process/payment/index.wxml
-
10xtends/statics/index/index.wxml
-
1xtends/statics/index/index.wxss
@ -0,0 +1,41 @@ |
|||
Component({ |
|||
/** |
|||
* 组件样式隔离 |
|||
*/ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true // 支持多个slot
|
|||
}, |
|||
properties: { |
|||
value: { |
|||
type: String, |
|||
value: null |
|||
}, |
|||
placeholder: { |
|||
type: String, |
|||
value: '' |
|||
} |
|||
}, |
|||
/** |
|||
* 组件的初始数据 |
|||
*/ |
|||
data: { |
|||
editing: false |
|||
}, |
|||
|
|||
/** |
|||
* 组件的方法列表 |
|||
*/ |
|||
methods: { |
|||
onEdit: function(e) { |
|||
this.setData({ editing: true }) |
|||
}, |
|||
onBlur: function(e) { |
|||
this.setData({ editing: false }) |
|||
}, |
|||
bindInput: function(e) { |
|||
this.setData({ value: e.detail.value }) |
|||
this.triggerEvent('change', this.data.value) |
|||
} |
|||
} |
|||
}) |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
"component": true |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
<view class="textarea {{ value ? 'text-black' : 'text-gray' }}" bindtap="onEdit" wx:if="{{!editing}}">{{value || placeholder }}</view> |
|||
<textarea wx:else maxlength="100" value="{{value}}" style="padding-top:16rpx" class="textarea" |
|||
cursor-spacing="60" focus="{{editing}}" bindfocus="onEdit" bindblur="onBlur" show-confirm-bar="{{false}}" |
|||
bindinput="bindInput" placeholder-style="color:#aaa" placeholder="{{placeholder}}"></textarea> |
|||
@ -0,0 +1,7 @@ |
|||
.textarea{ |
|||
width:100%; |
|||
height:80px; |
|||
padding:12rpx; |
|||
font-size: 14px; |
|||
border: 1rpx solid #f3f3f3; |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save