界面样式优化
This commit is contained in:
parent
50440ca8fc
commit
1caae06d1e
@ -20,8 +20,8 @@
|
||||
|
||||
<slot/>
|
||||
<view class="btns" wx:if="{{isShowCancel||isShowOk}}">
|
||||
<button class="button cancel" plain wx:if="{{isShowCancel}}" bind:tap="cancelButtonTap">{{cancelButtonText}}</button>
|
||||
<button class="button confirm" wx:if="{{isShowOk}}" type="primary" bind:tap="okButtonTap">{{okButtonText}}</button>
|
||||
<button class="cmv-button cancel" plain wx:if="{{isShowCancel}}" bind:tap="cancelButtonTap">{{cancelButtonText}}</button>
|
||||
<button class="cmv-button confirm" wx:if="{{isShowOk}}" type="primary" bind:tap="okButtonTap">{{okButtonText}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</page-container>
|
||||
@ -84,7 +84,7 @@
|
||||
display: flex;
|
||||
gap: 18rpx;
|
||||
}
|
||||
.modal-view-main .btns .button{
|
||||
.modal-view-main .btns .cmv-button{
|
||||
flex:1;
|
||||
font-size: 16px;
|
||||
padding:16px;
|
||||
@ -93,12 +93,12 @@
|
||||
border-width: 2rpx;/* 边框显示不完整 bug */
|
||||
}
|
||||
|
||||
.modal-view-main .btns .button.cancel{
|
||||
.modal-view-main .btns .cmv-button.cancel{
|
||||
border-color:rgba(153, 153, 153, 0.5);
|
||||
background-color: rgba(153, 153, 153, 0.1);
|
||||
color:var(--main-font-color);
|
||||
}
|
||||
|
||||
.modal-view-main .btns .button.confirm{
|
||||
.modal-view-main .btns .cmv-button.confirm{
|
||||
font-weight: bold;
|
||||
}
|
||||
@ -33,12 +33,10 @@ Page({
|
||||
if(item.pickup_codes.length>0&&item.pickup_codes[0]!=''){
|
||||
//倒着找相同的索引 因为需要从后往前找
|
||||
const codes = item.pickup_codes.join(',').split(',').reverse();
|
||||
let sameValue = '';
|
||||
let findIndex = codes.findIndex((_item)=>{
|
||||
let sames = codes.filter((__item)=>_item==__item);
|
||||
//找到了相同的
|
||||
if(sames.length>1){
|
||||
sameValue = _item;
|
||||
hasSame = true;
|
||||
return true;
|
||||
}
|
||||
@ -48,7 +46,6 @@ Page({
|
||||
findIndex = item.pickup_codes.length - findIndex - 1;
|
||||
this.data.choosedStationList[index].focus = true;
|
||||
this.data.choosedStationList[index].focusIndex = findIndex;
|
||||
console.log(findIndex,sameValue);
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title: '取件码重复',
|
||||
@ -68,7 +65,6 @@ Page({
|
||||
});
|
||||
}
|
||||
})
|
||||
console.log(hasSame,'----');
|
||||
if(hasSame)return;
|
||||
//录入了有效取件码 或者 上传了取件图片||this.data.tempImgs.length>0
|
||||
if(data.length>0){
|
||||
@ -243,10 +239,32 @@ Page({
|
||||
this.setData({
|
||||
choosedStationList:this.data.choosedStationList
|
||||
})
|
||||
// this.addAnimation(0);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
addAnimation(index){
|
||||
const duration = 2000;
|
||||
//
|
||||
let animation = wx.createAnimation({
|
||||
duration:duration
|
||||
});
|
||||
animation.opacity(1).height('390rpx').step();
|
||||
|
||||
wx.nextTick(()=>{
|
||||
console.log(this.data.choosedStationList[index]);
|
||||
this.setData({
|
||||
[`choosedStationList[${index}].animation`]:animation.export()
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.setData({
|
||||
[`choosedStationList[${index}].animationOver`]:true,
|
||||
[`choosedStationList[${index}].animation`]:null
|
||||
})
|
||||
}, duration);
|
||||
})
|
||||
},
|
||||
chooseImage(){
|
||||
if(this.data.imgUploading||this.data.recogniting)return;
|
||||
wx.chooseMedia({
|
||||
|
||||
@ -21,7 +21,9 @@
|
||||
<image src="/assets/icon/help/plus2.png" class="icon"/>手动录入取件码
|
||||
</view>
|
||||
|
||||
<view class="page-container station" wx:for="{{choosedStationList}}" wx:key="index">
|
||||
<view class="page-container station {{item.animationOver?'animation-over':''}}"
|
||||
wx:for="{{choosedStationList}}" wx:key="index"
|
||||
animation="{{item.animation}}">
|
||||
<view class="head">
|
||||
<view class="title">
|
||||
<view class="icon ai" wx:if="{{item.imgUrl}}">AI识别</view>
|
||||
@ -30,8 +32,8 @@
|
||||
<image data-index="{{index}}" bind:tap="showStationName" class="edit"
|
||||
src="/assets/icon/help/edit.png" wx:if="{{item.imgUrl}}"/>
|
||||
<view class="right">
|
||||
<image class="view-image" src="/assets/icon/help/images.png"
|
||||
data-url="{{item.imgUrl}}" bind:tap="viewImage"/>
|
||||
<image wx:if="{{item.imgUrl}}" class="view-image" data-url="{{item.imgUrl}}"
|
||||
src="/assets/icon/help/images.png" bind:tap="viewImage"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sub-title" wx:if="{{!item.imgUrl}}">
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
.station{
|
||||
padding-top:16rpx;
|
||||
/* opacity: 0;
|
||||
height:0;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box; */
|
||||
}
|
||||
.station.animation-over{
|
||||
opacity: 1;
|
||||
height: auto;
|
||||
}
|
||||
.station .head{
|
||||
white-space: nowrap;
|
||||
@ -43,6 +51,7 @@
|
||||
.station .head .title .name{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 68rpx;
|
||||
}
|
||||
.station .head .sub-title{
|
||||
font-size:26rpx;
|
||||
|
||||
@ -66,10 +66,6 @@ Page({
|
||||
skip:this.data.pager[tabName].limit*this.data.pager[tabName].pageIndex,
|
||||
limit:this.data.pager[tabName].limit
|
||||
}).then((data)=>{
|
||||
data.map((item)=>{
|
||||
item.expire_time = item.expire_time.substr(0,10).replaceAll('-','.');
|
||||
})
|
||||
console.log('tabname',tabName);
|
||||
if(this.data.pager[tabName].pageIndex==0){
|
||||
this.data[tabName+'List'] = data;
|
||||
}else{
|
||||
|
||||
@ -23,15 +23,6 @@ Page({
|
||||
this.setData({
|
||||
activityId:options.id||2
|
||||
});
|
||||
this.getActivityDetail();
|
||||
userApi.coupon.check(options.id||2).then((data)=>{
|
||||
if(!data.can_receive){
|
||||
this.setData({
|
||||
isShowModal:true,
|
||||
errorMsg:data.message
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getActivityDetail(){
|
||||
this.setData({
|
||||
@ -89,7 +80,15 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
this.getActivityDetail();
|
||||
userApi.coupon.check(this.data.activityId).then((data)=>{
|
||||
if(!data.can_receive){
|
||||
this.setData({
|
||||
isShowModal:true,
|
||||
errorMsg:data.message
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<view class="left">{{item.name}} <block wx:if="{{item.count>1}}">x {{item.count}}</block></view>
|
||||
<view class="right money money-normal" wx:if="{{item.amount>0}}">{{item.amount}}</view>
|
||||
</view>
|
||||
<view class="tips">先领券,再下单,免费配送</view>
|
||||
<view class="tips">使用有效期:{{item.available_days}} 天</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <button class="button diabled" disabled type="primary"
|
||||
@ -24,7 +24,7 @@
|
||||
}}
|
||||
</button> -->
|
||||
<button disabled="{{getting}}" loading="{{getting}}" type="primary"
|
||||
class="button" bind:tap="getActivity">一键领取</button>
|
||||
class="button get" bind:tap="getActivity">一键领取</button>
|
||||
</view>
|
||||
<image src="/assets/imgs/login/main.png" class="bottom-img"/>
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ page{
|
||||
color: #999999;
|
||||
margin-top:44rpx;
|
||||
}
|
||||
.button{
|
||||
.button.get{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top:60rpx;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user