group buy 8.8

This commit is contained in:
2020-08-08 12:07:50 +08:00
parent 1ee0dd4b25
commit 02702bc447
16 changed files with 110 additions and 93 deletions

View File

@@ -1,9 +1,10 @@
<template>
<view class="coupon-swiper">
<scroll-view scroll-x="true" class="classify-coupon">
<!-- <scroll-view scroll-x="true" class="classify-coupon">
<view v-for="(classify, index) in couponGroupList" :key="index" class="classify-item" :class="{ 'active': couponCurrent == index }" @click="couponTabsChange(index)">{{ classify.gc_name }}</view>
</scroll-view>
<!-- <swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{ height: swiperHeight }">
</scroll-view> -->
<u-tabs :list="couponGroupList" name="gc_name" :is-scroll="true" :current="couponCurrent" @change="couponTabsChange" active-color="#FF780F" :show-bar="false" height="88" font-size="24" inactive-color="#333333"></u-tabs>
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{ height: swiperHeight }">
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom" class="coupon-scroll">
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
@@ -13,14 +14,14 @@
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
</scroll-view>
</swiper-item>
</swiper> -->
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom" class="coupon-scroll" :style="{ height: swiperHeight }">
</swiper>
<!-- <scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom" class="coupon-scroll" :style="{ height: swiperHeight }">
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
<Coupon :couponInfo="coupon" :status='0' :type="0" @exchange="exchangeCoupon($event)"></Coupon>
</view>
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="couponList.length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
</scroll-view>
</scroll-view> -->
</view>
</template>
<script>

View File

@@ -67,13 +67,14 @@
<view>创建时间{{ orderInfo.add_time | date}}</view>
</view>
</view>
<view class="btn" v-if="['1', '2', '4', '6'].indexOf(orderstate) >= 0">
<view class="btn" v-if="['1', '2', '4', '6', '8'].indexOf(orderstate) >= 0">
<view class="cancel" v-if="(orderstate == '4' || orderstate == '1') && orderInfo.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="orderstate == '1'" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="orderstate == '1'" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view>
<view class="cancel" v-if="orderstate == '6'" @click="cancelOrder">取消支付</view>
<view class="payment" v-if="orderstate == '6'" @click="payNow">立即支付</view>
<view class="cancel" v-if="orderstate == '8'" @click="cancelOrder">取消订单</view>
<view class="payment" v-if="orderstate == '6' || orderstate == '8'" @click="payNow">立即支付</view>
<view class="service" v-if="orderstate == '7'">联系官方客服</view>
<view class="submit" v-if="orderstate == '7'">提交官方审核</view>
</view>
@@ -83,7 +84,7 @@
export default {
data() {
return {
orderstate: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付 7: 待退款 8: 已退款
orderstate: '',
s_object: {
'1': {
text: '待收货',

View File

@@ -1,19 +1,20 @@
<template>
<view class="order">
<view>
<u-tabs-swiper ref="tabs" :list="list" active-color="#FF780F" :current="current" font-size="26" @change="tabsChange" height="88" :gutter="30"></u-tabs-swiper>
<!-- <u-tabs-swiper ref="tabs" :list="list" active-color="#FF780F" :current="current" font-size="26" @change="tabsChange" height="88" :gutter="30"></u-tabs-swiper> -->
<u-tabs :list="list" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="88" font-size="26" :gutter="20" inactive-color="#333333"></u-tabs>
</view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
<swiper-item class="swiper-item" v-for="(item, index) in list" :key="index">
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom" class="order-scroll">
<view>
<view class="item-container" v-for="order in orderList" :key="order.order_id">
<view v-if="orderList[index]">
<view class="item-container" v-for="order in orderList[index]" :key="order.order_id">
<OrderItem :order="order" @refreshOrderList="refreshOrderList" v-if="current != 4"></OrderItem>
<TryOrderItem :order="order" @refreshOrderList="refreshOrderList" v-else></TryOrderItem>
</view>
</view>
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
<u-loadmore :status="loadStatus[index]" bgColor="#ECECEC" margin-bottom="20" v-if="current != 4 && orderList.length>3" class="order-loadmore"></u-loadmore>
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList[index] || !orderList[index].length"></u-empty>
<u-loadmore :status="loadStatus[index]" bgColor="#ECECEC" margin-bottom="20" v-if="current != 4 && (!orderList[index] || orderList[index].length>3)" class="order-loadmore"></u-loadmore>
</scroll-view>
</swiper-item>
</swiper>
@@ -57,9 +58,7 @@ export default {
},
watch: {
current(value, origin) {
if((origin == 4 && value != 4) || (value == 4 && origin != 4)) {
this.orderList = [];
}
// this.orderList = [];
this.page = 0;
// reload 重新请求列表 loadmore 往列表里添加
if(value == 4) {
@@ -69,6 +68,9 @@ export default {
}
},
},
onShow() {
this.refreshOrderList();
},
onLoad(option) {
const current = option.current ? Number(option.current) : 0;
this.current = current;
@@ -131,23 +133,25 @@ export default {
this.timer = true;
uni.stopPullDownRefresh(); // 结束刷新
if(res.errCode == 0) {
if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data);
}
return res.data.length;
},
// 售后
async getAfterSaleList({ load = 'loadmore' } = {}) {
const res = await this.$u.api.getAfterSaleList({
page: this.page,
})
this.timer = true;
if(res.errCode == 0) {
if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data);
if(load == 'reload') this.orderList[this.current] = res.data;
else if(load == 'loadmore') this.orderList[this.current].push(...res.data);
}
this.$forceUpdate();
// console.log(this.orderList);
return res.data.length;
},
// 售后 废弃
// async getAfterSaleList({ load = 'loadmore' } = {}) {
// const res = await this.$u.api.getAfterSaleList({
// page: this.page,
// })
// this.timer = true;
// if(res.errCode == 0) {
// if(load == 'reload') this.orderList[this.current] = res.data;
// else if(load == 'loadmore') this.orderList[this.current].push(...res.data);
// }
// return res.data.length;
// },
// 试穿
async goodsTryOrderList({ load = 'loadmore' } = {}) {
const res = await this.$u.api.goodsTryOrderList({
@@ -156,9 +160,10 @@ export default {
uni.stopPullDownRefresh(); // 结束刷新
this.timer = true;
if(res.errCode == 0) {
if(load == 'reload') this.orderList = res.data.list;
else if(load == 'loadmore') this.orderList.push(...res.data.list);
if(load == 'reload') this.orderList[this.current] = res.data.list;
else if(load == 'loadmore') this.orderList[this.current].push(...res.data.list);
}
this.$forceUpdate();
return res.data.list.length;
},
reachBottom() {

View File

@@ -4,10 +4,12 @@
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
<swiper-item class="swiper-item" v-for="(_, index) in list" :key="index">
<scroll-view scroll-y class="scroll-coupon">
<view class="coupon-item" v-for="(coupon, c_index) in couponList" :key="c_index">
<Coupon :couponInfo="coupon" :status='index' :type="1" @use="useCoupon($event)" :goodsClass="goodsClass"></Coupon>
<view v-if="couponList[index]">
<view class="coupon-item" v-for="(coupon, c_index) in couponList[index]" :key="c_index">
<Coupon :couponInfo="coupon" :status='index' :type="1" @use="useCoupon($event)" :goodsClass="goodsClass"></Coupon>
</view>
</view>
<u-empty text="暂无优惠券" mode="coupon" v-if="!couponList.length"></u-empty>
<u-empty text="暂无优惠券" mode="coupon" v-if="!couponList[index] || !couponList[index].length"></u-empty>
</scroll-view>
</swiper-item>
</swiper>
@@ -59,10 +61,11 @@ export default {
status: current
}).then(res => {
if(res.errCode == 0) {
this.couponList = res.data;
this.couponList[this.current] = res.data;
} else {
this.couponList = [];
this.couponList[this.current] = [];
}
this.$forceUpdate();
})
},
useCoupon(id) {