订单相关修改提测
This commit is contained in:
@@ -17,36 +17,53 @@
|
||||
<view class="containertopbox">
|
||||
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
|
||||
<view class="containertopboxitemleft flex-colum"
|
||||
:class="item.status == 0?'':'containertopboxitemlefts'">
|
||||
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': item.status != 0,}" v-if="item.type == 2">
|
||||
<view class="containertopboxitemleft_one"
|
||||
:class="item.status == 0?'':'containertopboxitemleft_ones'">
|
||||
<text style="font-size: 28rpx;">¥</text>
|
||||
<text>{{item.couponsAmount || 0}}</text>
|
||||
<block v-if="item.type == 2">
|
||||
<text>{{item.num || 0}}</text>
|
||||
<text style="font-size: 28rpx;margin-left: 6rpx;">张</text>
|
||||
</block>
|
||||
<block v-else >
|
||||
<text style="font-size: 28rpx;margin-right: 6rpx;">¥</text>
|
||||
<text>{{item.couponsAmount || 0}}</text>
|
||||
</block>
|
||||
|
||||
</view>
|
||||
<view class="containertopboxitemleft_tow"
|
||||
:class="item.status == 0?'':'containertopboxitemleft_tows'">
|
||||
优惠券(元)
|
||||
:class="{
|
||||
'containertopboxitemleft_tows': item.status != 0,
|
||||
'containertopboxitemleft_nameVip': item.type == 2,
|
||||
}">
|
||||
{{ item.type == 2 ? item.detail : '优惠券(元)'}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="containertopboxitemright">
|
||||
<view class="containertopboxitemright_one">
|
||||
无门槛使用
|
||||
<view class="flex-start">
|
||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png" mode="aspectFill">
|
||||
<text class="title">{{ item.shopName }}</text>
|
||||
</view>
|
||||
<text>无门槛使用</text>
|
||||
</view>
|
||||
<view class="containertopboxitemright_tow">
|
||||
<view>通用红包券</view>
|
||||
<view> {{ item.type == 2 ? '会员商品券' : '通用红包券'}}</view>
|
||||
<view
|
||||
@click="navigatorGo(item)"
|
||||
:class="item.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
||||
{{item.status == 0 ? '去使用':'已过期'}}
|
||||
{{item.status == 0 ? '去使用':'已使用'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="containertopboxitemright_there">
|
||||
<!-- <view class="containertopboxitemright_there">
|
||||
有效期至:{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||
v-if="is_end" mode="aspectFill"></image>
|
||||
|
||||
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||
v-if="list.length <= 0" mode="aspectFill"></image>
|
||||
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
||||
</view>
|
||||
</view>
|
||||
@@ -66,82 +83,59 @@
|
||||
type: '0'
|
||||
},
|
||||
{
|
||||
name: '已过期',
|
||||
name: '已使用',
|
||||
type: '1'
|
||||
}
|
||||
],
|
||||
towcontentclickindex: 0,
|
||||
list: [],
|
||||
is_end:false,
|
||||
form: {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
statuses: ''
|
||||
},
|
||||
status: "",
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.ordermineCouponsthis()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.ordermineCouponsthis()
|
||||
},
|
||||
|
||||
methods: {
|
||||
init_fn(e) {
|
||||
this.list = []
|
||||
this.form = {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
statuses: ''
|
||||
}
|
||||
try {
|
||||
if (e) {
|
||||
this.form.statuses = e
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换类型
|
||||
* @param {Object} index
|
||||
* @param {Object} item
|
||||
*/
|
||||
towcontentclick(index, item) {
|
||||
this.towcontentclickindex = index;
|
||||
this.status = item.type;
|
||||
this.ordermineCouponsthis()
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取优惠券数据
|
||||
*/
|
||||
async ordermineCouponsthis() {
|
||||
try {
|
||||
let res = await this.api.ordermineCoupons({
|
||||
let res = await this.api.getUserConpons({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
status: this.form.statuses,
|
||||
page: this.form.page,
|
||||
size: this.form.size,
|
||||
orderId:""
|
||||
shopId: uni.cache.get('shopId'),
|
||||
status: this.status
|
||||
})
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
if (this.form.page == 1 && res.data.list == 0) {
|
||||
this.is_end = true
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
this.form.status = 'loading';
|
||||
if (res.data.pageNum == res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
if (res.code == 0) {
|
||||
this.list = res.data;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
towcontentclick(index, item) {
|
||||
this.towcontentclickindex = index
|
||||
this.form.statuses = item.type
|
||||
this.init_fn(item.type)
|
||||
}
|
||||
|
||||
/**
|
||||
* 去使用优惠券
|
||||
*/
|
||||
navigatorGo ( item ) {
|
||||
if ( item.type == 2 ) {
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -210,44 +204,33 @@
|
||||
margin-bottom: 32rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
border-radius: 18rpx;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
.containertopboxitemleft {
|
||||
position: relative;
|
||||
width: 182rpx;
|
||||
height: 192rpx;
|
||||
background: #E3AD7F;
|
||||
border-radius: 18rpx 0rpx 0rpx 18rpx;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
|
||||
::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
left: 166rpx;
|
||||
background: #f9f9f9;
|
||||
display: inline-block;
|
||||
width: 32rpx;
|
||||
height: 16rpx;
|
||||
border-radius: 0 0 32rpx 32rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
|
||||
::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
left: 166rpx;
|
||||
background: #f9f9f9;
|
||||
display: inline-block;
|
||||
width: 32rpx;
|
||||
height: 16rpx;
|
||||
line-height: 32rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
|
||||
z-index: 999;
|
||||
|
||||
}
|
||||
// ::before {
|
||||
// content: '';
|
||||
// position: absolute;
|
||||
// bottom: 0rpx;
|
||||
// left: 166rpx;
|
||||
// background: #fff;
|
||||
// display: inline-block;
|
||||
// width: 32rpx;
|
||||
// height: 16rpx;
|
||||
// line-height: 32rpx;
|
||||
// border-radius: 32rpx 32rpx 0 0;
|
||||
// box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
|
||||
// z-index: 999;
|
||||
|
||||
// }
|
||||
|
||||
.containertopboxitemleft_one {
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
@@ -269,12 +252,44 @@
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.containertopboxitemleft_nameVip{
|
||||
color: #967152;
|
||||
}
|
||||
|
||||
.containertopboxitemleft_tows {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.containertopboxitemleft::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -20rpx;
|
||||
left: 166rpx;
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
box-shadow: inset 0rpx -13rpx 7rpx -6rpx rgba(0, 0, 0, 0.1);
|
||||
z-index: 999;
|
||||
}
|
||||
.containertopboxitemleft::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -20rpx;
|
||||
left: 166rpx;
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
box-shadow: inset 0rpx 25rpx 15rpx -4rpx rgba(0, 0, 0, 0.1);
|
||||
z-index: 999;
|
||||
|
||||
}
|
||||
.containertopboxitemleft_vip{
|
||||
background-color: #E1D4B2;
|
||||
}
|
||||
.containertopboxitemlefts {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
@@ -285,26 +300,39 @@
|
||||
flex: auto;
|
||||
height: 192rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
border-radius: 0rpx 18rpx 18rpx 0rpx;
|
||||
|
||||
.containertopboxitemright_one {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
padding: 16rpx 0 16rpx 0;
|
||||
border-bottom: 1rpx dotted #707070;
|
||||
padding: 16rpx 0 20rpx 0;
|
||||
border-bottom: 1rpx dashed #707070;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.icon{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
margin-right: 14rpx;
|
||||
}
|
||||
text{
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.title{
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.containertopboxitemright_tow {
|
||||
margin-top: 18rpx;
|
||||
margin-top: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.containertopboxitemright_there {
|
||||
@@ -318,13 +346,13 @@
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.containertopboxitemright_four {
|
||||
color: #FFFFFF;
|
||||
background: #333;
|
||||
background: #967152;
|
||||
}
|
||||
|
||||
.containertopboxitemright_fours {
|
||||
|
||||
Reference in New Issue
Block a user