优化+bug
This commit is contained in:
parent
9008626d3d
commit
041d7ab614
2
app.js
2
app.js
@ -65,7 +65,7 @@ App({
|
||||
}
|
||||
//非空
|
||||
if(item.required){
|
||||
if(value==''){
|
||||
if(!value){
|
||||
valid = false;
|
||||
}
|
||||
}else if(item.length){
|
||||
|
||||
@ -115,7 +115,7 @@ Component({
|
||||
},
|
||||
setUploadedImgs(imgs){
|
||||
this.setData({
|
||||
tempImgs:imgs.concat(this.data.tempImgs)
|
||||
tempImgs:imgs
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@ -52,6 +52,14 @@ Component({
|
||||
show:{
|
||||
type:Boolean,
|
||||
value:false
|
||||
},
|
||||
overlayClose:{
|
||||
type:Boolean,
|
||||
value:true
|
||||
},
|
||||
showCloseButton:{
|
||||
type:Boolean,
|
||||
value:false
|
||||
}
|
||||
},
|
||||
/**
|
||||
@ -59,16 +67,20 @@ Component({
|
||||
*/
|
||||
data: {
|
||||
dynamicsStyle:'',
|
||||
textareaHeight:124
|
||||
textareaHeight:124,
|
||||
_show:false
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
abc(event){
|
||||
console.log(event);
|
||||
},
|
||||
cancelButtonTap(){
|
||||
this.setData({
|
||||
show:false
|
||||
_show:false
|
||||
});
|
||||
this.triggerEvent('cancel');
|
||||
},
|
||||
@ -88,21 +100,23 @@ Component({
|
||||
show:false
|
||||
});
|
||||
this.triggerEvent('ok',this.properties.content);
|
||||
},
|
||||
afterLeave(event){
|
||||
this.setData({
|
||||
show:false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
lifetimes:{
|
||||
attached(){
|
||||
|
||||
console.log('init model view');
|
||||
}
|
||||
},
|
||||
observers:{
|
||||
"show"(show){
|
||||
if(show){
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
// this.setData({
|
||||
// textareaHeight:this.properties.row*25+24,
|
||||
// })
|
||||
this.createSelectorQuery().select('#modalViewMain').boundingClientRect((res)=>{
|
||||
const viewHeight = res.height;
|
||||
this.setData({
|
||||
@ -110,6 +124,9 @@ Component({
|
||||
})
|
||||
}).exec();
|
||||
}
|
||||
this.setData({
|
||||
_show:show
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1,9 +1,16 @@
|
||||
|
||||
<page-container model:show="{{show}}" position="center" class="custom-modal-view"
|
||||
|
||||
<page-container model:show="{{_show}}" wx:if="{{show}}" position="center"
|
||||
class="custom-modal-view" bind:afterleave="afterLeave"
|
||||
custom-style="background-color:transparent;left:27px;width:calc(100vw - 54px);height:200px;{{dynamicsStyle}}">
|
||||
<view class="custom-modal-view-overlay" wx:if="{{!overlayClose}}"></view>
|
||||
<view class="modal-view-main" id="modalViewMain">
|
||||
<view class="title {{titleTextCenter?'center':''}}">{{titleText}}</view>
|
||||
|
||||
<view class="title {{titleTextCenter?'center':''}}">
|
||||
<view class="text">{{titleText}}</view>
|
||||
<view class="close-btn-area">
|
||||
<view class="close-btn" bind:tap="cancelButtonTap" wx:if="{{showCloseButton}}"></view>
|
||||
</view>
|
||||
</view>
|
||||
<textarea class="textarea {{contentMessage?'error':''}}" model:value="{{content}}" row="3" wx:if="{{editable}}"
|
||||
placeholder="{{contentPlaceholder}}" focus="{{contentFocus}}" animation="{{contentAnimation}}" cursor-spacing="200rpx"></textarea>
|
||||
<view class="text" wx:else>{{content}}</view>
|
||||
|
||||
@ -1,18 +1,56 @@
|
||||
.custom-modal-view{
|
||||
border-radius: 20px;
|
||||
}
|
||||
.custom-modal-view-overlay{
|
||||
position: fixed;
|
||||
top:0;left:0;right:0;
|
||||
height:100vh;
|
||||
opacity: 0;
|
||||
}
|
||||
.custom-modal-view .title{
|
||||
font-size: 34rpx;
|
||||
font-weight: 500;
|
||||
line-height: 50rpx;
|
||||
position: relative;
|
||||
}
|
||||
.custom-modal-view .title.center{
|
||||
text-align: center;
|
||||
}
|
||||
.close-btn-area{
|
||||
position: absolute;
|
||||
right:-32rpx;top:-32rpx;
|
||||
width:100rpx;height:82rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
}
|
||||
.custom-modal-view .title .close-btn{
|
||||
position: relative;
|
||||
width:50rpx;height:50rpx;
|
||||
}
|
||||
.custom-modal-view .title .close-btn::before,.custom-modal-view .title .close-btn::after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
width:80%;
|
||||
height:4rpx;
|
||||
left:10%;top:50%;
|
||||
margin-top:-2rpx;
|
||||
background-color: #999999;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.custom-modal-view .title .close-btn::after{
|
||||
width:4rpx;
|
||||
height:80%;
|
||||
left:50%;top:10%;
|
||||
margin-top:0;
|
||||
margin-left: -2rpx;
|
||||
}
|
||||
.modal-view-main{
|
||||
border-radius: 24rpx;
|
||||
background-color: #fff;
|
||||
padding:32rpx;
|
||||
position: relative;
|
||||
z-index: 111;
|
||||
}
|
||||
.custom-modal-view .textarea{
|
||||
border: 1.2px solid rgba(85, 85, 85, 0.3);
|
||||
|
||||
@ -206,7 +206,7 @@
|
||||
</movable-area>
|
||||
|
||||
|
||||
<modal-view titleText="取消订单需联系客户说明原因" editable content-placeholder="请输入退单原因" bind:ok="refund" model:show="{{isShowRefundConfirm}}" wx:if="{{isShowRefundConfirm}}" titleTextCenter="{{false}}" editRequired/>
|
||||
<modal-view titleText="取消订单需联系客户说明原因" editable content-placeholder="请输入退单原因" bind:ok="refund" model:show="{{isShowRefundConfirm}}" titleTextCenter="{{false}}" editRequired/>
|
||||
|
||||
<mark-up id="markupView" class="mark-up"/>
|
||||
|
||||
|
||||
@ -33,8 +33,7 @@ Component({
|
||||
*/
|
||||
methods: {
|
||||
async apply(){
|
||||
const imgUploader = this.selectComponent('#imgUploader');
|
||||
const urls = await imgUploader.getUploadedUrl();
|
||||
const urls = await this.imgUploader.getUploadedUrl();
|
||||
const valid = app.validateForm({
|
||||
reason:{required:true,autoFocus:true,shake:true},
|
||||
money:{min:1,shake:true}
|
||||
@ -52,10 +51,9 @@ Component({
|
||||
this.setData({
|
||||
reason:'',
|
||||
money:0,
|
||||
});
|
||||
this.setData({
|
||||
isShowMarkup:false
|
||||
})
|
||||
});
|
||||
this.imgUploader.setUploadedImgs([]);
|
||||
wx.showToast({
|
||||
title: '保存成功',
|
||||
})
|
||||
@ -70,10 +68,9 @@ Component({
|
||||
this.setData({
|
||||
reason:'',
|
||||
money:0,
|
||||
});
|
||||
this.setData({
|
||||
isShowMarkup:false
|
||||
})
|
||||
});
|
||||
this.imgUploader.setUploadedImgs([]);
|
||||
wx.showToast({
|
||||
title: '保存成功',
|
||||
})
|
||||
@ -98,19 +95,21 @@ Component({
|
||||
money:data.additional_fee_amount,
|
||||
requestId:data.id
|
||||
})
|
||||
this.selectComponent('#imgUploader').setUploadedImgs(imgs);
|
||||
this.imgUploader.setUploadedImgs(imgs);
|
||||
}).catch((error)=>{
|
||||
this.setData({
|
||||
reason:'',
|
||||
requestId:'',
|
||||
money:0,
|
||||
});
|
||||
this.imgUploader.setUploadedImgs([]);
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
lifetimes:{
|
||||
attached(){
|
||||
|
||||
this.imgUploader = this.selectComponent('#imgUploader')
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
<modal-view titleText="申请加价" isShowOk="{{false}}" isShowCancel="{{false}}"
|
||||
okButtonText="提交申请" model:show="{{isShowMarkup}}" wx:if="{{isShowMarkup}}"
|
||||
class="mark-up-view" titleTextCenter="{{false}}">
|
||||
okButtonText="提交申请" model:show="{{isShowMarkup}}" show-close-button
|
||||
class="mark-up-view" titleTextCenter="{{false}}" overlay-close="{{false}}">
|
||||
<view class="input-area">
|
||||
<textarea model:value="{{reason}}" focus="{{reasonFocus}}" class="textarea"
|
||||
placeholder="请输入加价原因" animation="{{reasonAnimation}}"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user