123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <view class="container">
- <topNavBar title="全部订单" />
- <!-- 订单状态区 -->
- <view class="state-area dflex navbar-area bg-main">
- <view class="nav-item dflex-c pos-r fs h-full" :class="{ active: tabCurrentIndex === index }"
- v-for="(item, index) in navList" :key="index" @click="tabClick(index)">
- {{ item.state }}
- </view>
- </view>
- <!-- </scroll-view> -->
- <!-- 订单轮播区 -->
- <swiper class="swiper-area w-full" :duration="0" :current="tabCurrentIndex" @change="changeTab">
- <!-- 轮播项对应订单状态 -->
- <swiper-item class="tab-content wh-full" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
- <!-- 滚动区 -->
- <scroll-view class="h-full" scroll-y @scrolltolower="loadData">
- <!-- 空白页 -->
- <use-empty v-if="tabItem.orderList.length === 0 && tabItem.loaded" e-style="round" e-type="cart"
- tip="订单数据为空" height="93vh"></use-empty>
- <!-- 订单列表区 -->
- <view class="margin-bottom-sm" :class="index === 0 ? 'padding-top-sm' : ''" v-for="(item, index) in tabItem.orderList" :key="index">
- <!-- 订单项 -->
- <view class="order-item padding bg-main border-radius">
- <view @click="todetail(item.order)">
- <view class="dflex-b padding-bottom-sm">
- <view class="fs fwb dflex">
- <u-tag text="自提" size="mini" bgColor="#FFF4E4" color="#F5821F" shape="circle" borderColor="#FFF4E4"></u-tag>
- 订单编号:M000003332
- </view>
- <text class="fs active">等待付款</text>
- </view>
- <!-- 订单商品明细 -->
- <view class="goods-area dflex-b">
- <view class="pic-list dflex">
- <view class="pic"></view>
- <view class="pic"></view>
- <view class="pic"></view>
- </view>
- <view class="next-detail">
- <text>共3件</text>
- <u-icon name="arrow-right" size="20"></u-icon>
- </view>
-
- </view>
- <!-- 实付款 -->
- <view class="dflex-e padding-top-sm">
- <text class="fs-xs margin-right-xs">共3件</text>
- <text class="fs-xs margin-right-xs">共6份商品</text>
- <text class="fs-xs margin-right-xs">实付</text>
- <text class="price ft-main">{{ item.order.order_actural_paid}}</text>
- </view>
- </view>
- <!-- 订单操作区 -->
- <view class="dflex-b margin-top-sm">
- <view>
- <text class="ft-dark" >更多</text>
- </view>
- <view class="dflex-e">
- <view class="dflex">
- <button class="action-btn border-radius-big bg-main">取消订单</button>
- <button class="action-btn border-radius-big bg-main">订单详情</button>
- <button class="action-btn border-radius-big bg-main main-btn">去支付</button>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 上拉加载更多 -->
- <use-loadmore v-if="tabItem.orderList.length > 0 && tabItem.loaded && tabItem.hasmore"
- :type="tabItem.loadingType"></use-loadmore>
- </scroll-view>
- </swiper-item>
- </swiper>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- tabCurrentIndex: 0,
- navData: {},
- navList: [{
- id: 0,
- state: '全部',
- loadingType: 'more',
- orderList: [
- {
- order_detail:[
- {
- goods_img:'../../../static/x2.jpg',
- goods_name:'商品1',
- goods_name_pw:'小标题',
- goods_num:1,
- goods_sku_name:60,
- goods_price:10
- }
- ],
- order:{
- order_actural_paid:10,
- order_refund_state:'处理中',
- state:'待发货'
- }
- },
- {
- order_detail:[
- {
- goods_img:'../../../static/x2.jpg',
- goods_name:'商品1',
- goods_name_pw:'小标题',
- goods_num:1,
- goods_sku_name:60,
- goods_price:10
- }
- ],
- order:{
- order_actural_paid:10,
- state:'待发货'
- }
- }
- ]
- },
- {
- id: 1,
- state: '待付款',
- loadingType: 'more',
- orderList: []
- },
- {
- id: 2,
- state: '待收货',
- loadingType: 'more',
- orderList: []
- },
- {
- id: 3,
- state: '待自提',
- loadingType: 'more',
- orderList: []
- },
- {
- id: 4,
- state: '已完成',
- loadingType: 'more',
- orderList: []
- },
- {
- id: 5,
- state: '已关闭',
- loadingType: 'more',
- orderList: []
- }
- ],
- reqdata: {
- page: 1,
- rows: 10
- },
- scrollLeft: 0,
- title: '全部'
- }
- },
- methods: {
- loadData(){},
- // swiper 切换
- changeTab(e) {
- this.tabCurrentIndex = e.target.current;
-
- },
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- },
-
- // 点击跳转详情页面
- todetail(order) {
- // uni.navigateTo({
- // url: `/pages/user/order/order-detail?order_id=${order.order_id}`
- // });
- uni.navigateTo({
- url: `/pages/order/orderDetail/orderDetail`
- });
- },
- // 立即支付
- payment(order) {
- },
- // 删除订单
- delOrder(item) {
- let _this = this;
-
- uni.showModal({
- title: '提示',
- content: '删除订单',
- success: function(res) {
- if (res.confirm) {
- uni.showLoading({
- title: '请稍后'
- });
-
- } else if (res.cancel) {
- console.log('点击取消');
- }
- },
- complete() {
- uni.hideLoading();
- }
- });
- },
- // 取消订单
- cancelOrder(item) {
- let _this = this;
-
- uni.showModal({
- title: '提示',
- content: '取消订单',
- success: function(res) {
- if (res.confirm) {
- uni.showLoading({
- title: '请稍后'
- });
-
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- },
- complete() {
- uni.hideLoading();
- }
- });
- },
- // 查看物流
- toexpress(item) {
- // uni.navigateTo({
- // url: `/pages/user/order/order-express?order_id=${item.order.order_id}`
- // });
- },
- // 已发货
- toreceipt(item) {
- let _this = this;
-
- uni.showModal({
- title: '提示',
- content: '确认收货',
- success: function(res) {
- if (res.confirm) {
-
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- },
- complete() {
- uni.hideLoading();
- }
- });
- },
- // 申请退款
- torefund(data) {
-
- },
- // 评价
- toevaluate(item) {
-
- }
- }
- }
- </script>
- <style lang="scss">
- page,.container {
- min-height: 100%;
- background: $page-color-base;
- }
- /* 订单状态区 */
- .navbar-area {
- white-space: nowrap;
- }
- .state-area {
- height: 7vh;
- box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
- z-index: 10;
- top: 0;
- }
- .nav-item {
- flex: 1;
- &.active {
- &:after {
- content: '';
- position: absolute;
- left: 50%;
- transform: translate(-50%);
- bottom: 0;
- width: 44px;
- height: 0;
- border-bottom: 2px solid $base-color;
- }
- }
- }
- /* 订单轮播区 */
- .swiper-area {
- height: 93vh;
- }
- /* 订单区 */
- .order-area {}
- /* 订单项 */
- .order-item {
- /* 订单商品明细区 */
- .goods-area {
- display: flex;
- image {
- width: 180rpx;
- height: 180rpx;
- }
- .right {
- padding: 0 30upx 0 24upx;
- overflow: hidden;
- .attr-box {
- font-size: $font-sm + 2upx;
- color: $font-color-light;
- padding: 10upx 12upx;
- }
- }
- }
- /* 操作按钮 */
- .action-btn {
- width: 156rpx;
- height: inherit;
- line-height: inherit;
- margin: 0;
- margin-left: 20rpx;
- padding: 12rpx 0;
- font-size: $font-sm + 2upx;
- color: $font-color-dark;
- /* #ifdef MP-QQ || MP-ALIPAY */
- border: 1px solid;
- /* #endif */
- &:after {
- border-radius: 100px;
- }
- &.main-btn {
- background: #fff9f9;
- color: $base-color;
- &:after {
- border-color: #f7bcc8;
- }
- }
- }
- }
- .pic-list{
- width: calc(100% - 130upx);
- .pic{
- margin-right: 20upx;
- height: 160rpx;
- width: 160rpx;
- background-color: #EEE;
- }
- .pic:last-child{
- margin: 0;
- }
- }
- .next-detail{
- width: 130upx;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- }
- </style>
|