|
@@ -3,7 +3,8 @@
|
|
|
<view class="order-title">
|
|
<view class="order-title">
|
|
|
<text>我的订单</text>
|
|
<text>我的订单</text>
|
|
|
<view class="roder-content">
|
|
<view class="roder-content">
|
|
|
- <view class="left" :class="{current:currentIndex===0}" v-for="(item,index) in maiList" @click="navGo(index)">
|
|
|
|
|
|
|
+ <view class="left" :class="{current:currentIndex===index}" :key='index' v-for="(item,index) in maiList"
|
|
|
|
|
+ @click="navGo(index)">
|
|
|
{{item.title}}
|
|
{{item.title}}
|
|
|
</view>
|
|
</view>
|
|
|
<!-- <view class="left">
|
|
<!-- <view class="left">
|
|
@@ -11,13 +12,88 @@
|
|
|
</view> -->
|
|
</view> -->
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="navbar">
|
|
|
|
|
|
|
+ <view class="navbar" v-show="currentIndex==0">
|
|
|
<view v-for="(item, index) in navList" :key="index" class="nav-item"
|
|
<view v-for="(item, index) in navList" :key="index" class="nav-item"
|
|
|
:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
|
|
:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="navbar" v-show="currentIndex==1">
|
|
|
|
|
+ <view v-for="(item, index) in navList1" :key="index" class="nav-item"
|
|
|
|
|
+ :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
- <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
|
|
|
|
|
- <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
|
|
|
|
|
|
+ <swiper :current="tabCurrentIndex" class="swiper-box-one" duration="300" @change="changeTab"
|
|
|
|
|
+ :style="{'height': height}">
|
|
|
|
|
+ <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"
|
|
|
|
|
+ :style="{'height': height}" v-if="currentIndex==0">
|
|
|
|
|
+ <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
|
|
|
|
+ <!-- 空白页 -->
|
|
|
|
|
+ <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 订单列表 -->
|
|
|
|
|
+ <view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index"
|
|
|
|
|
+ class="order-item">
|
|
|
|
|
+ <view class="i-top b-b">
|
|
|
|
|
+ <text class="time">{{ item._add_time }}</text>
|
|
|
|
|
+ <text class="state" :style="{ color: item.stateTipColor }">{{ item._status._title }}</text>
|
|
|
|
|
+ <text v-if="item.status === 4" class="del-btn iconfont icondelete"
|
|
|
|
|
+ @click="deleteOrder(index)"></text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <scroll-view v-if="item.cartInfo.length > 1" class="goods-box" scroll-x>
|
|
|
|
|
+ <view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
|
|
|
|
|
+ <image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ <!-- <view v-if="item.cartInfo.length === 1" class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
|
|
|
|
|
+ <image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
|
|
|
|
|
+ <view class="right">
|
|
|
|
|
+ <text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
|
|
|
|
|
+ <text class="attr-box">{{ goodsItem.attrInfo ? goodsItem.attrInfo.suk : '' }} x {{ goodsItem.cart_num }}</text>
|
|
|
|
|
+ <text class="price">{{ moneyNum(goodsItem.productInfo.price)}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view> -->
|
|
|
|
|
+ <view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo"
|
|
|
|
|
+ :key="goodsIndex">
|
|
|
|
|
+ <image class="goods-img" :src="goodsItem.productInfo.image" mode="scaleToFill"></image>
|
|
|
|
|
+ <view class="right">
|
|
|
|
|
+ <view class="flex-start">
|
|
|
|
|
+ <text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
|
|
|
|
|
+ <text class="price">{{ goodsItem.productInfo.price|moneyNum }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="row flex">
|
|
|
|
|
+ <text
|
|
|
|
|
+ class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
|
|
|
|
|
+ <text class="attr-box"> x {{ goodsItem.cart_num }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="price-box">
|
|
|
|
|
+ 共
|
|
|
|
|
+ <text class="num">{{ item.cartInfo.length }}</text>
|
|
|
|
|
+ 件商品 邮费
|
|
|
|
|
+ <text class="price">{{ moneyNum(item.pay_postage)}}</text>
|
|
|
|
|
+ 实付款
|
|
|
|
|
+ <text class="price">{{ moneyNum(item.pay_price)}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="action-box b-t" v-if="item.status != 5">
|
|
|
|
|
+ <button v-if="item._status._title == '未支付'" class="action-btn"
|
|
|
|
|
+ @click.stop="cancelOrder(item)">取消订单</button>
|
|
|
|
|
+ <button v-if="item._status._title == '未支付'" @click.stop="orderPay(item)"
|
|
|
|
|
+ class="action-btn recom">立即支付</button>
|
|
|
|
|
+ <button v-if="item._status._title == '待评价'" class="action-btn">评价</button>
|
|
|
|
|
+ <button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)"
|
|
|
|
|
+ class="action-btn">确认收货</button>
|
|
|
|
|
+ <button v-if="item._status._title == '未发货'" class="action-btn"
|
|
|
|
|
+ @click.stop="orderRefund(item)">申请退款</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <uni-load-more :status="tabItem.loadingType"></uni-load-more>
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ </swiper-item>
|
|
|
|
|
+ <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"
|
|
|
|
|
+ :style="{'height': height}" v-if="currentIndex==1">
|
|
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
|
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
|
|
<!-- 空白页 -->
|
|
<!-- 空白页 -->
|
|
|
<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
|
|
<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
|
|
@@ -86,6 +162,7 @@
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</swiper-item>
|
|
</swiper-item>
|
|
|
</swiper>
|
|
</swiper>
|
|
|
|
|
+
|
|
|
<u-tabbar activeColor="#375AFE" v-model="current" :list="tabbar" :mid-button="true"></u-tabbar>
|
|
<u-tabbar activeColor="#375AFE" v-model="current" :list="tabbar" :mid-button="true"></u-tabbar>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -109,13 +186,17 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ height: '', //第一层swiper高度
|
|
|
tabbar: tabbar,
|
|
tabbar: tabbar,
|
|
|
current: 1,
|
|
current: 1,
|
|
|
- currentIndex:0,
|
|
|
|
|
|
|
+ currentIndex: 0,
|
|
|
tabCurrentIndex: 0,
|
|
tabCurrentIndex: 0,
|
|
|
- maiList:[
|
|
|
|
|
- {title:'我的买单'},
|
|
|
|
|
- {title:'我的卖单'}
|
|
|
|
|
|
|
+ maiList: [{
|
|
|
|
|
+ title: '我的买单'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '我的卖单'
|
|
|
|
|
+ }
|
|
|
],
|
|
],
|
|
|
navList: [{
|
|
navList: [{
|
|
|
state: 0,
|
|
state: 0,
|
|
@@ -157,7 +238,49 @@
|
|
|
page: 1, //当前页数
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
limit: 10 //每次信息条数
|
|
|
}
|
|
}
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ navList1: [{
|
|
|
|
|
+ state: 0,
|
|
|
|
|
+ text: '全部',
|
|
|
|
|
+ loadingType: 'more',
|
|
|
|
|
+ orderList: [],
|
|
|
|
|
+ page: 1, //当前页数
|
|
|
|
|
+ limit: 10 //每次信息条数
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ state: 1,
|
|
|
|
|
+ text: '售卖中',
|
|
|
|
|
+ loadingType: 'more',
|
|
|
|
|
+ orderList: [],
|
|
|
|
|
+ page: 1, //当前页数
|
|
|
|
|
+ limit: 10 //每次信息条数
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ state: 2,
|
|
|
|
|
+ text: '待支付',
|
|
|
|
|
+ loadingType: 'more',
|
|
|
|
|
+ orderList: [],
|
|
|
|
|
+ page: 1, //当前页数
|
|
|
|
|
+ limit: 10 //每次信息条数
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ state: 3,
|
|
|
|
|
+ text: '待放货',
|
|
|
|
|
+ loadingType: 'more',
|
|
|
|
|
+ orderList: [],
|
|
|
|
|
+ page: 1, //当前页数
|
|
|
|
|
+ limit: 10 //每次信息条数
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ state: 4,
|
|
|
|
|
+ text: '已完成',
|
|
|
|
|
+ loadingType: 'more',
|
|
|
|
|
+ orderList: [],
|
|
|
|
|
+ page: 1, //当前页数
|
|
|
|
|
+ limit: 10 //每次信息条数
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -189,9 +312,26 @@
|
|
|
return +value;
|
|
return +value;
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ // 页面加载完获取swiper高度
|
|
|
|
|
+ onReady(res) {
|
|
|
|
|
+ var obj = this;
|
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
|
+ success: resu => {
|
|
|
|
|
+ const query = uni.createSelectorQuery();
|
|
|
|
|
+ query.select('.swiper-box-one').boundingClientRect();
|
|
|
|
|
+ query.exec(function(res) {
|
|
|
|
|
+ console.log(res, 'ddddddddddddd');
|
|
|
|
|
+ obj.height = resu.windowHeight - res[0].top + 'px';
|
|
|
|
|
+ console.log('打印页面的剩余高度', obj.height);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: res => {}
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
- navGo(index){
|
|
|
|
|
|
|
+ navGo(index) {
|
|
|
this.currentIndex = index
|
|
this.currentIndex = index
|
|
|
|
|
+ console.log(this.currentIndex, '点击');
|
|
|
},
|
|
},
|
|
|
// 转换金额为数字
|
|
// 转换金额为数字
|
|
|
moneyNum(value) {
|
|
moneyNum(value) {
|
|
@@ -272,6 +412,8 @@
|
|
|
return e;
|
|
return e;
|
|
|
});
|
|
});
|
|
|
navItem.orderList = navItem.orderList.concat(arr);
|
|
navItem.orderList = navItem.orderList.concat(arr);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// console.log(navItem.orderList);
|
|
// console.log(navItem.orderList);
|
|
|
navItem.page++;
|
|
navItem.page++;
|
|
|
if (navItem.limit == data.length) {
|
|
if (navItem.limit == data.length) {
|
|
@@ -281,6 +423,7 @@
|
|
|
} else {
|
|
} else {
|
|
|
//判断是否还有数据, 有改为 more, 没有改为noMore
|
|
//判断是否还有数据, 有改为 more, 没有改为noMore
|
|
|
navItem.loadingType = 'noMore';
|
|
navItem.loadingType = 'noMore';
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
this.$set(navItem, 'loaded', true);
|
|
this.$set(navItem, 'loaded', true);
|
|
@@ -295,10 +438,7 @@
|
|
|
this.tabCurrentIndex = e.target.current;
|
|
this.tabCurrentIndex = e.target.current;
|
|
|
this.loadData('tabChange');
|
|
this.loadData('tabChange');
|
|
|
},
|
|
},
|
|
|
- //顶部tab点击
|
|
|
|
|
- tabClick(index) {
|
|
|
|
|
- this.tabCurrentIndex = index;
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
//删除订单
|
|
//删除订单
|
|
|
deleteOrder(index) {
|
|
deleteOrder(index) {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
@@ -387,11 +527,12 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.order-title {
|
|
.order-title {
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
width: 750rpx;
|
|
width: 750rpx;
|
|
|
height: 262rpx;
|
|
height: 262rpx;
|
|
|
- background: linear-gradient(-41deg, rgba(60, 237, 237, 0.99), #04B8FF, #375AFE);
|
|
|
|
|
|
|
+ // background: linear-gradient(-41deg, rgba(60, 237, 237, 0.99), #04B8FF, #375AFE);
|
|
|
|
|
+ background: url(../../static/img/order99.png) repeat-x 0;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
// padding: 50rpx 0;
|
|
// padding: 50rpx 0;
|
|
@@ -406,8 +547,8 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.roder-content {
|
|
.roder-content {
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
|
|
|
|
|
@@ -422,31 +563,29 @@
|
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
color: #FFFFFF;
|
|
color: #FFFFFF;
|
|
|
|
|
+ background: #DC262b;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- &.current {
|
|
|
|
|
- width: 336rpx;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- height: 81rpx;
|
|
|
|
|
|
|
+ .current {
|
|
|
|
|
+ color: #DC262B;
|
|
|
background: #FFFFFF;
|
|
background: #FFFFFF;
|
|
|
- border-radius: 10rpx;
|
|
|
|
|
- font-size: 30rpx;
|
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- color: #4166FC;
|
|
|
|
|
- line-height: 81rpx;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.swiper-box {
|
|
.swiper-box {
|
|
|
- height: calc(100% - 40px);
|
|
|
|
|
|
|
+ background: red;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.list-scroll-content {
|
|
.list-scroll-content {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .uni-swiper-item {
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.navbar {
|
|
.navbar {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
@@ -467,7 +606,7 @@
|
|
|
position: relative;
|
|
position: relative;
|
|
|
|
|
|
|
|
&.current {
|
|
&.current {
|
|
|
- color: #4166FC;
|
|
|
|
|
|
|
+ color: $base-color;
|
|
|
|
|
|
|
|
&:after {
|
|
&:after {
|
|
|
content: '';
|
|
content: '';
|
|
@@ -477,16 +616,12 @@
|
|
|
transform: translateX(-50%);
|
|
transform: translateX(-50%);
|
|
|
width: 44px;
|
|
width: 44px;
|
|
|
height: 0;
|
|
height: 0;
|
|
|
- border-bottom: 2px solid #4166FC;
|
|
|
|
|
|
|
+ border-bottom: 2px solid $base-color;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .uni-swiper-item {
|
|
|
|
|
- height: auto;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
.order-item {
|
|
.order-item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
@@ -808,4 +943,8 @@
|
|
|
opacity: 0.2;
|
|
opacity: 0.2;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .swiper-box-one {
|
|
|
|
|
+ background-color: #bfa;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|