前端小程序
这个提交包含在:
@@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<view class="page_box">
|
||||
<view class="content_box">
|
||||
<scroll-view scroll-y="true" enable-back-to-top @scrolltolower="loadMore" class="scroll-box">
|
||||
<!-- 订单列表 -->
|
||||
<view class="order-list" v-for="(order, orderIndex) in orderList" :key="order.id">
|
||||
<view class="order-head u-flex u-row-between">
|
||||
<text class="no">活动标题:{{ order.title }}</text>
|
||||
<text class="state">
|
||||
{{order.status_text}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="goods-order">
|
||||
<view class="order-content">
|
||||
<shopro-mini-card :title="order.goods_title" :image="$IMG_URL + order.image">
|
||||
<template #cardBottom>
|
||||
<view class="order-price-box u-flex ">
|
||||
<text class="order-price font-OPPOSANS">¥{{ order.activity_price || 0 }}</text>
|
||||
<button class="u-reset-button status-btn">{{order.status_text}}</button>
|
||||
</view>
|
||||
</template>
|
||||
</shopro-mini-card>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-bottom">
|
||||
<!-- 按钮 -->
|
||||
<view class="btn-box u-flex">
|
||||
<button @tap.stop="jump('/pages/goods/detail', { id: order.goods_id })"
|
||||
class="u-reset-button obtn2">查看活动</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空白页 -->
|
||||
<shopro-empty v-if="isEmpty" :image="$IMG_URL + '/imgs/empty/empty_groupon.png'"
|
||||
tipText="暂无预约的抢购~"></shopro-empty>
|
||||
<!-- 更多 -->
|
||||
<u-loadmore v-show="orderList.length" height="80rpx" :status="loadStatus" icon-type="flower"
|
||||
color="#ccc" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isEmpty: false,
|
||||
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
orderList: [],
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.orderList = [];
|
||||
this.currentPage = 1;
|
||||
this.lastPage = 1;
|
||||
this.getOrderList();
|
||||
},
|
||||
methods: {
|
||||
jump(path, parmas) {
|
||||
this.$Router.push({
|
||||
path: path,
|
||||
query: parmas
|
||||
});
|
||||
},
|
||||
// 订单列表
|
||||
getOrderList() {
|
||||
let that = this;
|
||||
that.loadStatus = 'loading';
|
||||
that.$http('rob.index', {
|
||||
page: that.currentPage
|
||||
}, '加载中...').then(res => {
|
||||
if (res.code === 1) {
|
||||
that.orderList = [...that.orderList, ...res.data.list];
|
||||
that.isEmpty = !that.orderList.length;
|
||||
that.lastPage = res.data.totalSize;
|
||||
that.loadStatus = that.currentPage < res.data.totalSize ? 'loadmore' : 'nomore';
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 加载更多
|
||||
loadMore() {
|
||||
if (this.currentPage < this.lastPage) {
|
||||
this.currentPage += 1;
|
||||
this.getOrderList();
|
||||
}
|
||||
},
|
||||
// 立即购买
|
||||
onPay(id) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/payment/method?orderId=${id}&orderType=goods`
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.order-nav {
|
||||
background: #fff;
|
||||
height: 80rpx;
|
||||
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
|
||||
.item-title {
|
||||
font-size: 30rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
line-height: 76rpx;
|
||||
}
|
||||
|
||||
.nav-line {
|
||||
width: 100rpx;
|
||||
height: 4rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.line-active {
|
||||
background: rgba(230, 184, 115, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-list {
|
||||
background: #fff;
|
||||
margin: 20rpx 0;
|
||||
|
||||
.order-bottom {
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.btn-box {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.all-msg {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.all-unit {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.all-money {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
|
||||
&::before {
|
||||
content: '¥';
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.obtn1 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: rgba(238, 238, 238, 1);
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-right: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.obtn2 {
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
background: linear-gradient(90deg, #1677FF, #4096FF);
|
||||
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: #fff;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.obtn3 {
|
||||
background: #ffeeee;
|
||||
color: $brand-price;
|
||||
width: 160rpx;
|
||||
line-height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.order-head {
|
||||
padding: 0 25rpx;
|
||||
height: 77rpx;
|
||||
border-bottom: 1rpx solid #dfdfdf;
|
||||
|
||||
.no {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.state {
|
||||
font-size: 26rpx;
|
||||
color: $brand-price;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-order {
|
||||
border-bottom: 1px solid rgba(223, 223, 223, 0.5);
|
||||
padding: 20rpx 20rpx 0;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.order-content {
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.order-sku {
|
||||
font-size: 24rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: rgba(153, 153, 153, 1);
|
||||
width: 450rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.order-num {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-price-box {
|
||||
.status-btn {
|
||||
height: 32rpx;
|
||||
border: 1rpx solid rgba(207, 169, 114, 1);
|
||||
border-radius: 15rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(168, 112, 13, 1);
|
||||
padding: 0 10rpx;
|
||||
margin-left: 20rpx;
|
||||
background: rgba(233, 183, 102, 0.16);
|
||||
}
|
||||
|
||||
.order-price {
|
||||
font-size: 26rpx;
|
||||
|
||||
font-weight: 600;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
在新工单中引用
屏蔽一个用户