Browse Source

ui一比一还原/商户订单api

master
Enzo 4 years ago
parent
commit
2fee211480
  1. 10
      colorui/main.css
  2. 6
      common/api.js
  3. 4
      components/self-line/self-line.vue
  4. 7
      pages.json
  5. 50
      pages/order/apply-details.vue
  6. 48
      pages/order/apply-refund.vue
  7. 7
      pages/order/confirm-order.vue
  8. 37
      pages/order/index.vue
  9. 119
      pages/order/order-details.vue
  10. 314
      pages/shopOrder/index.vue

10
colorui/main.css

@ -2934,9 +2934,9 @@ scroll-view.cu-steps .cu-item {
} }
.grid.grid-square>view { .grid.grid-square>view {
margin-right: 20upx;
margin-bottom: 20upx;
border-radius: 6upx;
margin-right: 18rpx;
/* margin-bottom: 18rpx; */
border-radius: 10rpx;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
@ -3328,8 +3328,8 @@ scroll-view.cu-steps .cu-item {
} }
.padding-lr { .padding-lr {
padding-left: 30upx;
padding-right: 30upx;
padding-left: 32rpx;
padding-right: 32rpx;
} }
.padding-lr-lg { .padding-lr-lg {

6
common/api.js

@ -11,6 +11,9 @@ export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表
// 用户订单 // 用户订单
export const API_USERORDER = '/api/order/list'; export const API_USERORDER = '/api/order/list';
// 商户订单
export const API_SHOPORDER = '/api/order/listForStore';
//订单详情 //订单详情
export const API_ORDER_DETAILS = '/api/order/detail'; export const API_ORDER_DETAILS = '/api/order/detail';
@ -36,6 +39,9 @@ export const API_COLLECT_DEAL = '/api/collect/deal'; // 商品收藏
//订单预支付 //订单预支付
export const API_PRPAID = '/api/order/deal' export const API_PRPAID = '/api/order/deal'
//订单直接支付
export const API_PAYMENT_DIRECT = '/api/payment/direct'
/* 个人中心相关 */ /* 个人中心相关 */
export const API_USER_CENTER = '/api/user/center'; // 个人中心 export const API_USER_CENTER = '/api/user/center'; // 个人中心
export const API_COLLECT_LIST = '/api/collect/list'; // 我的收藏列表 export const API_COLLECT_LIST = '/api/collect/list'; // 我的收藏列表

4
components/self-line/self-line.vue

@ -7,10 +7,10 @@
<style> <style>
.h-20 { .h-20 {
height: 10px;
height: 20rpx;
} }
.bg-gray1 { .bg-gray1 {
background-color: #f7f7fb;
background-color: #F5F5F5;
color: #333333; color: #333333;
} }
</style> </style>

7
pages.json

@ -17,6 +17,13 @@
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{
"path": "pages/shopOrder/index",
"style": {
"navigationBarTitleText": "商户订单",
"enablePullDownRefresh": true
}
},
{ {
"path": "pages/order/order-details", "path": "pages/order/order-details",
"style": { "style": {

50
pages/order/apply-details.vue

@ -1,20 +1,19 @@
<template> <template>
<view> <view>
<!-- 商品信息 --> <!-- 商品信息 -->
<self-line/>
<view class="bg-white padding-tb-sm">
<view class="bg-white">
<skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true"> <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
<view class="flex justify-between align-start padding-top-sm padding-lr">
<image :src="orderDetails.order.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image>
<view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
<image v-if="orderDetails.order.goods.cover" :src="orderDetails.order.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm"> <view class="flex-sub padding-left-sm">
<view class="bref-box margin-top-xs lf-font-32 lf-font-bold">
<view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.order.goods.name">
{{orderDetails.order.goods.name}} {{orderDetails.order.goods.name}}
</view> </view>
<text class="block margin-top-sm text-gray lf-font-28">数量 <text class="margin-left text-gray">x {{orderDetails.order.number}}</text></text>
<text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.order.number}}</text>
<view class="flex justify-between margin-top-sm">
<view class="text-red text-price lf-font-42 lf-font-bold">
<view class="flex justify-between" style="margin-top: 28rpx;">
<view class="text-red text-price lf-font-42 lf-font-bold" style="display: flex;align-items: flex-end;">
{{orderDetails.order.selling_price}} {{orderDetails.order.selling_price}}
</view> </view>
<view> <view>
@ -62,37 +61,38 @@
<view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center"> <view class="cu-bar padding-lr solid-bottom flex justify-between align-center text-center">
<text class="text-gray lf-font-32">订单编号</text> <text class="text-gray lf-font-32">订单编号</text>
<view> <view>
<text class="margin-right lf-font-32">{{orderDetails.order_sn}}</text>
<text class="text-orange lf-font-28" @tap="copy(orderDetails.order_sn)">复制</text>
<text class="lf-font-32 text-black">{{orderDetails.order_sn}}</text>
<!-- <text class="text-orange lf-font-28" @tap="copy(orderDetails.order_sn)">复制</text> -->
</view>
</view>
<view class="padding-lr bg-white" style="padding-top: 30rpx;">
<view class="cu-self menu">
<view class="text-gray lf-font-28">
由于产品的特殊性在申请的过程中供应商会向您收取部分费用如有疑问可参与产品的<text class="text-orange">{{checkArea}}</text>或咨询客服
</view>
</view> </view>
</view> </view>
</view> </view>
</skeleton> </skeleton>
<self-line/>
<skeleton :loading="skeletonLoading" :row="6" :showAvatar="false" :showTitle="true"> <skeleton :loading="skeletonLoading" :row="6" :showAvatar="false" :showTitle="true">
<view class="padding-top padding-lr bg-white">
<view class="cu-self menu">
<view class="text-gray lf-font-28">
由于产品的特殊性在申请的过程中供应商会向您收取部分费用如有疑问可参与产品的<text class="text-orange">{{checkArea}}</text>或咨询客服
</view>
</view>
</view>
<view class="padding bg-white">
<view class="bg-white" style="padding: 40rpx 32rpx 20rpx 32rpx;">
<view class="cu-self menu"> <view class="cu-self menu">
<view class="lf-font-32 text-black1">退款说明</view> <view class="lf-font-32 text-black1">退款说明</view>
</view> </view>
<view class="cu-self menu margin-top">
<view class="cu-self menu" style="margin-top: 20rpx;">
<view class="text-gray lf-font-32">{{orderDetails.comment}}</view> <view class="text-gray lf-font-32">{{orderDetails.comment}}</view>
</view> </view>
</view> </view>
<view class="cu-form-group solid-bottom">
<view class="cu-form-group">
<view class="grid col-4 grid-square flex-sub"> <view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) of images" :key="index">
<image :src="item.path" @tap="showImg" mode="aspectFill"></image>
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) of images" :key="index">
<image :src="item.path" @tap="showImg(item.path)" style="width: 216rpx;height: 216rpx;" mode="aspectFill"></image>
</view> </view>
</view> </view>
</view> </view>
<view style="height: 82rpx;"></view>
</skeleton> </skeleton>
</view> </view>
@ -138,9 +138,9 @@
}); });
}, },
// //
showImg() {
showImg(image) {
uni.previewImage({ uni.previewImage({
urls: ['../../static/tu.png']
urls: [image],
}); });
}, },
// //

48
pages/order/apply-refund.vue

@ -1,20 +1,19 @@
<template> <template>
<view> <view>
<!-- 商品信息 --> <!-- 商品信息 -->
<self-line/>
<view class="bg-white padding-tb-sm">
<view class="bg-white">
<skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true"> <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
<view class="flex justify-between align-start padding-top-sm padding-lr">
<image :src="applyDetails.order.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image>
<view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
<image v-if="applyDetails.order.goods.cover" :src="applyDetails.order.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm"> <view class="flex-sub padding-left-sm">
<view class="bref-box margin-top-xs lf-font-32 lf-font-bold">
<view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="applyDetails.order.goods.name">
{{applyDetails.order.goods.name}} {{applyDetails.order.goods.name}}
</view> </view>
<text class="block margin-top-sm text-gray lf-font-28">数量 <text class="margin-left text-gray">x{{applyDetails.order.number}}</text></text>
<text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{applyDetails.order.number}}</text>
<view class="flex justify-between margin-top-sm">
<view class="text-red text-price lf-font-42 lf-font-bold">
<view class="flex justify-between" style="margin-top: 44rpx;">
<view class="text-red text-price lf-font-42 lf-font-bold" style="display: flex;align-items: flex-end;">
{{applyDetails.order.selling_price}} {{applyDetails.order.selling_price}}
</view> </view>
</view> </view>
@ -74,27 +73,29 @@
</view> </view>
</view> </view>
</skeleton> </skeleton>
<self-line/>
<skeleton :loading="skeletonLoading" :row="6" :showAvatar="false" :showTitle="true"> <skeleton :loading="skeletonLoading" :row="6" :showAvatar="false" :showTitle="true">
<view class="cu-bar padding-lr solid-bottom">
<text class="lf-font-32 text-gray">退款说明</text>
<input type="text" v-model="applyInfo" class="text-right lf-font-32" style="color: #999999;" placeholder="请输入反馈信息" />
<view class="bg-white" style="padding: 40rpx 32rpx 30rpx 32rpx;">
<view class="cu-self menu">
<view class="lf-font-32 text-black1">退款说明</view>
</view>
<view class="cu-self menu" style="margin-top: 30rpx;">
<textarea type="text" v-model="applyInfo" class="text-left lf-font-32 area-self" placeholder="请输入反馈信息" />
</view>
</view> </view>
<!-- <view class="padding bg-white"> <!-- <view class="padding bg-white">
<view class="cu-self menu"> <view class="cu-self menu">
<view class="lf-font-32 text-gray">请上传退款凭证</view> <view class="lf-font-32 text-gray">请上传退款凭证</view>
</view> </view>
</view> --> </view> -->
<view class="cu-form-group solid-bottom">
<view class="cu-form-group">
<view class="grid col-4 grid-square flex-sub"> <view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(item)" :data-url="img_list[index]">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(item)" :data-url="img_list[index]">
<image :src="img_list[index]" mode="aspectFill"></image> <image :src="img_list[index]" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index"> <view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index">
<text class='cuIcon-close'></text> <text class='cuIcon-close'></text>
</view> </view>
</view> </view>
<view class="solids" @tap="ChooseImage" v-if="img_list.length<3">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="solids" @tap="ChooseImage" v-if="img_list.length<3">
<text class='cuIcon-cameraadd'></text> <text class='cuIcon-cameraadd'></text>
</view> </view>
</view> </view>
@ -108,12 +109,16 @@
</view> --> </view> -->
</view> </view>
<view class="padding-top-sm padding-lr-lg">
<button class="cu-btn block bg-orange lg margin-top round" @tap="subimitApply()">
<view class="padding-lr-lg" style="margin-top: 80rpx;">
<button class="cu-btn block bg-orange lg round" @tap="subimitApply()">
<text class="cuIcon-loading2 cuIconfont-spin margin-right-xs text-white" v-if="loading"></text> <text class="cuIcon-loading2 cuIconfont-spin margin-right-xs text-white" v-if="loading"></text>
<text class="text-df text-white">确认申请</text> <text class="text-df text-white">确认申请</text>
</button> </button>
</view> </view>
<view style="height: 100rpx;">
</view>
</skeleton> </skeleton>
</view> </view>
</template> </template>
@ -338,5 +343,12 @@
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.area-self {
width: 100%;
padding: 30rpx 0 0 30rpx;
color: #999999;
border: 1px solid #D0D0D0;
border-radius: 10rpx;
}
</style> </style>

7
pages/order/confirm-order.vue

@ -187,7 +187,6 @@
}, },
fail: (err) => { fail: (err) => {
this.$url('/pages/order/pay-success?ifSuccess='+2,{type: 'redirect'}) this.$url('/pages/order/pay-success?ifSuccess='+2,{type: 'redirect'})
}, },
}) })
@ -211,11 +210,11 @@
signType: res.data.signType, signType: res.data.signType,
paySign: res.data.paySign, paySign: res.data.paySign,
success: (res) => { success: (res) => {
this.$routerGo('/pages/order/pay-success?ifSuccess='+1)
this.$url('/pages/order/pay-success?ifSuccess='+1,{type: 'redirect'})
}, },
fail: (err) => { fail: (err) => {
this.$routerGo('/pages/order/pay-success?ifSuccess='+2)
}
this.$url('/pages/order/pay-success?ifSuccess='+2,{type: 'redirect'})
},
}) })
}) })
}, },

37
pages/order/index.vue

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<!-- 当设置tab-width,指定每个tab宽度时,则不使用flex布局,改用水平滑动 --> <!-- 当设置tab-width,指定每个tab宽度时,则不使用flex布局,改用水平滑动 -->
<view class="padding-lr margin-bottom">
<view class="padding-lr" style="margin-bottom: 10rpx;margin-top: 20rpx;">
<me-tabs v-model="current" :tabs="tab_list" :fixed="true" @change="change"></me-tabs> <me-tabs v-model="current" :tabs="tab_list" :fixed="true" @change="change"></me-tabs>
<!-- <u-tabs :list="tab_list" :is-scroll="true" :show-bar="false" :current="current" @change="change"></u-tabs> --> <!-- <u-tabs :list="tab_list" :is-scroll="true" :show-bar="false" :current="current" @change="change"></u-tabs> -->
</view> </view>
@ -13,8 +13,8 @@
<view class="cu-tag badge tag-self lf-font-28" :style="{'background-color':item.state_text.bg_color,'color':item.state_text.color}">{{item.state_text.text}}</view> <view class="cu-tag badge tag-self lf-font-28" :style="{'background-color':item.state_text.bg_color,'color':item.state_text.color}">{{item.state_text.text}}</view>
</view> </view>
<view class="right"> <view class="right">
<view class="lf-line-2 title">{{item.goods.name}}</view>
<view class="lf-flex tips">
<view class="lf-line-2 title" style="line-height: 40rpx;">网红辣椒棒 魔鬼辣椒挑战全网第一辣 网红优惠季 </view>
<view class="lf-flex tips" style="margin: 0!important;">
<text class="progress margin-right-xs">数量</text> <text class="progress margin-right-xs">数量</text>
<text class="bought">x {{item.number}}</text> <text class="bought">x {{item.number}}</text>
</view> </view>
@ -28,12 +28,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="padding-bottom padding-lr padding-top-sm">
<view>
<view class="u-border-top flex justify-between align-center text-center"> <view class="u-border-top flex justify-between align-center text-center">
<view class="padding-top text-gray lf-font-28">
<view class="text-gray lf-font-28" style="padding: 20rpx;">
{{item.created_at_text}} {{item.created_at_text}}
</view> </view>
<view class="text-orange padding-top" v-if="item.state==1">
<view class="text-orange" v-if="item.state==1" style="padding: 20rpx;">
{{item.comment_text}} {{item.comment_text}}
</view> </view>
</view> </view>
@ -109,6 +109,14 @@
this.assetsType = e.type this.assetsType = e.type
this.getUserOrder() this.getUserOrder()
}, },
onShow() {
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder();
},
methods: { methods: {
// tab // tab
change(index) { change(index) {
@ -207,18 +215,18 @@
} }
</script> </script>
<style lang="scss">
<style lang="scss" scoped>
.tag-self { .tag-self {
position: absolute!important; position: absolute!important;
top: 0!important; top: 0!important;
border-radius: 17px 0 10px 0!important;
border-radius: 20rpx 0 20rpx 0!important;
width: max-content; width: max-content;
height: 24px!important;
height: 32rpx!important;
} }
.title { .title {
font-size: 28rpx; font-size: 28rpx;
color: $u-content-color; color: $u-content-color;
height: 88rpx;
height: 80rpx;
} }
// tab // tab
@ -246,8 +254,8 @@
overflow: hidden; overflow: hidden;
image { image {
width: 204rpx;
height: 204rpx;
width: 186rpx;
height: 186rpx;
margin: 20rpx; margin: 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
@ -258,7 +266,7 @@
width: 64%; width: 64%;
.title { .title {
margin: 18rpx 20rpx 0 0;
margin: 0rpx 20rpx 10rpx 0;
color: #222222; color: #222222;
font-size: 32rpx; font-size: 32rpx;
} }
@ -288,8 +296,9 @@
.price { .price {
overflow: hidden; overflow: hidden;
color: #FF0000; color: #FF0000;
margin-top: 10rpx;
button { button {
width: 160rpx;
width: 176rpx;
height: 60rpx; height: 60rpx;
background: #FE9903; background: #FE9903;
border-radius: 15px; border-radius: 15px;

119
pages/order/order-details.vue

@ -2,20 +2,19 @@
<view> <view>
<!-- 商品信息 --> <!-- 商品信息 -->
<block v-if="isRight(orderDetails)"> <block v-if="isRight(orderDetails)">
<self-line/>
<view class="bg-white padding-tb-sm">
<view class="bg-white">
<skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true"> <skeleton :loading="skeletonLoading" :row="2" :showAvatar="false" :showTitle="true">
<view class="flex justify-between align-start padding-top-sm padding-lr">
<image v-if="orderDetails.goods.cover" :src="orderDetails.goods.cover" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image>
<view class="flex justify-between align-start" style="padding: 32rpx 32rpx 30rpx 32rpx;">
<image v-if="orderDetails.goods.cover" :src="orderDetails.goods.cover" mode="aspectFill" style="width: 240rpx; height: 240rpx;border-radius: 10rpx;"></image>
<view class="flex-sub padding-left-sm"> <view class="flex-sub padding-left-sm">
<view class="bref-box margin-top-xs lf-font-32 lf-font-bold" v-if="orderDetails.goods.name">
<view class="bref-box text-black1 lf-font-32 lf-font-bold" style="height: 88rpx;line-height: 44rpx;" v-if="orderDetails.goods.name">
{{orderDetails.goods.name}} {{orderDetails.goods.name}}
</view> </view>
<text class="block margin-top-sm text-gray lf-font-28">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>
<text class="block text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量 <text class="margin-left margin-right-xs text-gray">x</text>{{orderDetails.number}}</text>
<view class="flex justify-between margin-top-sm">
<view class="text-red text-price lf-font-42 lf-font-bold">
<view class="flex justify-between" style="margin-top: 28rpx;">
<view class="text-red text-price lf-font-42 lf-font-bold" style="display: flex;align-items: flex-end;">
{{Number(orderDetails.selling_price || 0)}} {{Number(orderDetails.selling_price || 0)}}
</view> </view>
<view> <view>
@ -69,23 +68,23 @@
pdground="#000" :onval="true" :loadMake="true" /> pdground="#000" :onval="true" :loadMake="true" />
<!-- :icon="require('@/static/images/system/user-default.jpg')" --> <!-- :icon="require('@/static/images/system/user-default.jpg')" -->
</view> </view>
<view class="flex justify-around align-center text-center margin-top-sm">
<view class="flex justify-around align-center text-center" style="margin-top: 10rpx;">
<view @tap="refreshCode()" v-if="orderDetails.state==2"> <view @tap="refreshCode()" v-if="orderDetails.state==2">
<image class="margin-right" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image> <image class="margin-right" src="@/static/images/system/refresh.png" mode="widthFix" style="width: 20px;height: 20px;"></image>
</view> </view>
<view class="lf-font-32 text-black1">{{checkArea}}</view> <view class="lf-font-32 text-black1">{{checkArea}}</view>
<view class="text-orange lf-font-28 margin-left" @tap="copy(checkArea)">复制</view>
<view v-if="orderDetails.state == 2" class="text-orange lf-font-28 margin-left" @tap="copy(checkArea)">复制</view>
</view> </view>
<view class="margin-top-sm text-gray lf-font-28" v-if="orderDetails.refund_text">
<view style="margin-top: 10rpx;" class="text-gray lf-font-28" v-if="orderDetails.refund_text">
{{orderDetails.refund_text}} {{orderDetails.refund_text}}
</view> </view>
<view class="margin-top-sm text-green lf-font-32" v-if="orderDetails.state == 2">
<view style="margin-top: 10rpx;" class="text-green lf-font-32" v-if="orderDetails.state == 2">
{{orderDetails.confirm_code_text}} {{orderDetails.confirm_code_text}}
</view> </view>
</view> </view>
<view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top"> <view class="padding-lr padding-tb-sm bg-white flex justify-between align-center solid-top">
<view class="flex align-center"> <view class="flex align-center">
<text class="text-gray lf-font-28">实付款</text>
<text class="text-gray lf-font-28" style="margin-right: 20rpx;">实付款</text>
<view class="text-red text-price lf-font-42 lf-font-bold"> <view class="text-red text-price lf-font-42 lf-font-bold">
{{Number(orderDetails.amount || 0)}} {{Number(orderDetails.amount || 0)}}
</view> </view>
@ -169,5 +168,99 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tag-self {
position: absolute!important;
top: 0!important;
border-radius: 20rpx 0 20rpx 0!important;
width: max-content;
height: 32rpx!important;
}
.title {
font-size: 28rpx;
color: $u-content-color;
height: 80rpx;
}
// tab
.ctab {
width: 100%;
margin: 20rpx 0 0rpx 0rpx;
padding: 0 22rpx;
}
//
.com {
width: 100%;
overflow: hidden;
.list {
border-radius: 10rpx;
overflow: hidden;
margin: 20rpx 32rpx;
background-color: #FFFFFF;
// box-shadow: 0 0 10px 5px #e5e5e5;
box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
align-items: flex-start;
.left {
overflow: hidden;
image {
width: 186rpx;
height: 186rpx;
margin: 20rpx;
border-radius: 10rpx;
}
}
.right {
overflow: hidden;
width: 64%;
.title {
margin: 0rpx 20rpx 10rpx 0;
color: #222222;
font-size: 32rpx;
}
.tips {
margin: 16rpx 0;
overflow: hidden;
.u-line-progress {
width: 112rpx;
overflow: hidden;
margin-right: 20rpx;
}
.progress {
color: #777777;
font-size: 24rpx;
}
.bought {
color: #777777;
font-size: 24rpx;
margin-right: 20rpx;
}
}
.price {
overflow: hidden;
color: #FF0000;
margin-top: 10rpx;
button {
width: 176rpx;
height: 60rpx;
background: #FE9903;
border-radius: 15px;
font-size: 24rpx;
color: #FFFFFF;
margin: 0rpx 20rpx 0rpx 20rpx;
border: none;
}
}
}
}
}
</style> </style>

314
pages/shopOrder/index.vue

@ -0,0 +1,314 @@
<template>
<view>
<!-- 当设置tab-width,指定每个tab宽度时,则不使用flex布局,改用水平滑动 -->
<view class="padding-lr" style="margin-bottom: 10rpx;margin-top: 20rpx;">
<me-tabs v-model="current" :tabs="tab_list" :fixed="true" @change="change"></me-tabs>
<!-- <u-tabs :list="tab_list" :is-scroll="true" :show-bar="false" :current="current" @change="change"></u-tabs> -->
</view>
<view class="com" v-for="(tab, tabIndex) in tab_list" v-if="tabIndex == current" :key="tab.id">
<view class="flex-direction justify-around list" v-for="(item, index) in tab.list" :key="item.id" @tap="goDetails(tabIndex,index)">
<view class="lf-row-between">
<view class="left" style="position: relative;">
<image :src="item.goods.cover" mode=""></image>
<view class="cu-tag badge tag-self lf-font-28" :style="{'background-color':item.state_text.bg_color,'color':item.state_text.color}">{{item.state_text.text}}</view>
</view>
<view class="right">
<view class="lf-line-2 title" style="line-height: 40rpx;">网红辣椒棒 魔鬼辣椒挑战全网第一辣 网红优惠季 </view>
<view class="lf-flex tips" style="margin: 0!important;">
<text class="progress margin-right-xs">数量</text>
<text class="bought">x {{item.number}}</text>
</view>
<view class="lf-row-between price">
<text class="lf-font-bold">
<text class="lf-font-24"></text>
<text class="lf-font-42">{{item.selling_price}}</text>
</text>
<button v-if="item.state==1" @tap.stop="$routerGo('/pages/order/confirm-order?type=1&goods_id='+item.goods_id+'&goods_specs_id='+item.goods_specs_id +'&order_id='+ item.id)">立即付款</button>
<button v-if="item.state==2" class="cu-btn bg-green round margin-left-sm" @tap="$routerGo('/pages/order/order-details?orderid='+item.id)">立即使用</button>
</view>
</view>
</view>
<view>
<view class="u-border-top flex justify-between align-center text-center">
<view class="text-gray lf-font-28" style="padding: 20rpx;">
{{item.created_at_text}}
</view>
<view class="text-orange" v-if="item.state==1" style="padding: 20rpx;">
{{item.comment_text}}
</view>
</view>
</view>
</view>
<!-- 加载 -->
<view class="loading-more">
<text v-if="tab.list.length"
:class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
<my-nocontent v-else></my-nocontent>
</view>
<!-- 回到顶部 -->
<u-back-top :scroll-top="pageScrollTop"></u-back-top>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tab_list: [{
name: '全部',
type: 'all',
list: [],
loadingClass: true,
loadingText: '正在加载中',
page: 1,
isPage: true
}, {
name: '待付款',
type: 'unpaid',
list: [],
loadingClass: true,
loadingText: '正在加载中',
page: 1,
isPage: true
}, {
name: '待使用',
type: 'paid',
list: [],
loadingClass: true,
loadingText: '正在加载中',
page: 1,
isPage: true
},
{
name: '已完成',
type: 'complete',
list: [],
loadingClass: true,
loadingText: '正在加载中',
page: 1,
isPage: true
},
{
name: '售后',
type: 'after_sales',
list: [],
loadingClass: true,
loadingText: '正在加载中',
page: 1,
isPage: true
}
],
current: 0, // tab
pageSize: 10,
assetsType: '', //
orderType: []
}
},
onLoad(e) {
this.assetsType = e.type
this.getUserOrder()
},
onShow() {
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder();
},
methods: {
// tab
change(index) {
this.current = index;
this.getUserOrder();
},
goDetails(tabIndex,index) {
// this.$routerGo('/pages/order/order-details?orderid=55')
console.log(tabIndex,index)
let item = this.tab_list[tabIndex].list[index]
if (item.state == 1) {
this.$routerGo('/pages/order/unpay-details?orderid=' + item.id)
} else if(item.state == 4){
this.$routerGo('/pages/order/apply-details?orderid=' + item.id)
}else {
this.$routerGo('/pages/order/order-details?orderid=' + item.id)
}
},
onReachBottom() {
let tab_item = this.tab_list[this.current];
if (tab_item.isPage) {
tab_item.page = tab_item.page + 1;
this.getUserOrder();
}
},
onPullDownRefresh() {
let tab_item = this.tab_list[this.current];
tab_item.page = 1;
tab_item.isPage = true;
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
this.getUserOrder();
uni.stopPullDownRefresh()
},
getUserOrder() {
let per_page = this.pageSize;
let tab_item = this.tab_list[this.current];
this.$http(this.API.API_SHOPORDER, {
state: this.tab_list[this.current].type,
page: tab_item.page,
per_page
}).then(res => {
if (res.code == 0) {
console.log(res)
if( Object.keys(res.metal_data).length != 0 ) {
this.$routerGo('/pages/login/index?type=userinfo')
}else {
let isPage = res.data.has_more_page;
tab_item.isPage = isPage;
if (isPage) {
tab_item.loadingClass = true;
tab_item.loadingText = '正在加载中';
} else {
tab_item.loadingClass = false;
tab_item.loadingText = '没有更多数据啦~';
}
if (tab_item.page == 1) {
tab_item.list = res.data.items;
} else {
tab_item.list.push(...res.data.items);
}
}
}
}).catch(err => {
});
},
//
back() {
if (this.assetsType === 'all2') {
// #ifdef H5
window.history.go(-2)
// #endif
// #ifndef H5
uni.navigateBack({
delta: 2
});
// #endif
} else {
// #ifdef H5
window.history.go(-1)
// #endif
// #ifndef H5
uni.navigateBack({
delta: 1
});
// #endif
}
}
},
}
</script>
<style lang="scss" scoped>
.tag-self {
position: absolute!important;
top: 0!important;
border-radius: 20rpx 0 20rpx 0!important;
width: max-content;
height: 32rpx!important;
}
.title {
font-size: 28rpx;
color: $u-content-color;
height: 80rpx;
}
// tab
.ctab {
width: 100%;
margin: 20rpx 0 0rpx 0rpx;
padding: 0 22rpx;
}
//
.com {
width: 100%;
overflow: hidden;
.list {
border-radius: 10rpx;
overflow: hidden;
margin: 20rpx 32rpx;
background-color: #FFFFFF;
// box-shadow: 0 0 10px 5px #e5e5e5;
box-shadow: 0 10rpx 20rpx 0 rgba(0, 0, 0, 0.1);
align-items: flex-start;
.left {
overflow: hidden;
image {
width: 186rpx;
height: 186rpx;
margin: 20rpx;
border-radius: 10rpx;
}
}
.right {
overflow: hidden;
width: 64%;
.title {
margin: 0rpx 20rpx 10rpx 0;
color: #222222;
font-size: 32rpx;
}
.tips {
margin: 16rpx 0;
overflow: hidden;
.u-line-progress {
width: 112rpx;
overflow: hidden;
margin-right: 20rpx;
}
.progress {
color: #777777;
font-size: 24rpx;
}
.bought {
color: #777777;
font-size: 24rpx;
margin-right: 20rpx;
}
}
.price {
overflow: hidden;
color: #FF0000;
margin-top: 10rpx;
button {
width: 176rpx;
height: 60rpx;
background: #FE9903;
border-radius: 15px;
font-size: 24rpx;
color: #FFFFFF;
margin: 0rpx 20rpx 0rpx 20rpx;
border: none;
}
}
}
}
}
</style>
Loading…
Cancel
Save