|
@@ -35,7 +35,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="r-r">
|
|
|
- <view class="r-item" @click.stop="handlerSkipComment(item, itm)">
|
|
|
+ <view class="r-item" @click.stop="handlerSkipComment(item, itm)" v-if="type == 3">
|
|
|
<u-icon name="chat" color="#000" size="28"></u-icon>
|
|
|
<span>评价</span>
|
|
|
</view>
|
|
@@ -48,8 +48,8 @@
|
|
|
<view class="item-allnumb-box">
|
|
|
<view class="allnumb-left"> {{ item.allNumb }}件商品 </view>
|
|
|
<view class="allnumb-right">
|
|
|
- <span class="r-text">共计</span>¥{{ item.allPrice }}</view
|
|
|
- >
|
|
|
+ <span class="r-text">共计</span>¥{{ item.allPrice }}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<view class="item-bottom">
|
|
@@ -65,250 +65,265 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { userOrdersApi, getUserOrderList, cancelOrder } from '@/api/client/order';
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- current: 0,
|
|
|
- type: 0,
|
|
|
- type_name: '',
|
|
|
- size: 20,
|
|
|
- // 订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
|
|
|
- list: [
|
|
|
- {
|
|
|
- name: '待付款',
|
|
|
- type: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '待发货',
|
|
|
- type: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '已发货',
|
|
|
- type: 2,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '已完成',
|
|
|
- type: 3,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '已关闭',
|
|
|
- type: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '无效订单',
|
|
|
- type: 5,
|
|
|
- },
|
|
|
- ],
|
|
|
- init_list: [],
|
|
|
- };
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // this.userOrdersPage();
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- let cur = this.$store.state.order.skip_order_type.type;
|
|
|
- switch (cur) {
|
|
|
- case 0:
|
|
|
- this.current = 0;
|
|
|
- this.userOrdersPage(cur);
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- this.current = 2;
|
|
|
- this.userOrdersPage(cur);
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- this.current = 3;
|
|
|
- this.userOrdersPage(cur);
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- allNumber() {
|
|
|
- this.init_list.map(rs => {
|
|
|
- let sum = 0;
|
|
|
- let price = 0;
|
|
|
- rs.goodsInfo.map(rc => {
|
|
|
- sum += rc.goodsQuantity;
|
|
|
- price += rc.goodsPrice;
|
|
|
- });
|
|
|
- rs.allNumb = sum;
|
|
|
- rs.allPrice = price;
|
|
|
- });
|
|
|
- return;
|
|
|
+ import {
|
|
|
+ userOrdersApi,
|
|
|
+ getUserOrderList,
|
|
|
+ cancelOrder
|
|
|
+ } from '@/api/client/order';
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ current: 0,
|
|
|
+ type: 0,
|
|
|
+ type_name: '',
|
|
|
+ size: 20,
|
|
|
+ // 订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
|
|
|
+ list: [{
|
|
|
+ name: '待付款',
|
|
|
+ type: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '待发货',
|
|
|
+ type: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '已发货',
|
|
|
+ type: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '已完成',
|
|
|
+ type: 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '已关闭',
|
|
|
+ type: 4,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '无效订单',
|
|
|
+ type: 5,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ init_list: [],
|
|
|
+ };
|
|
|
},
|
|
|
- },
|
|
|
- methods: {
|
|
|
- handlerChangeItem(data) {
|
|
|
- this.current = data.index;
|
|
|
- this.type = data.type;
|
|
|
- this.type_name = data.name;
|
|
|
- this.userOrdersPage(this.type);
|
|
|
+ mounted() {
|
|
|
+ // this.userOrdersPage();
|
|
|
},
|
|
|
-
|
|
|
- async userOrdersPage(type) {
|
|
|
- let orderStatus = type == undefined ? 0 : `${type}`;
|
|
|
- let res = await getUserOrderList({
|
|
|
- status: orderStatus,
|
|
|
- paging: '1,20',
|
|
|
- });
|
|
|
- if ((res.code = 200 && res.data)) {
|
|
|
- this.init_list = res.data.records;
|
|
|
+ onShow() {
|
|
|
+ let cur = this.$store.state.order.skip_order_type.type;
|
|
|
+ switch (cur) {
|
|
|
+ case 0:
|
|
|
+ this.current = 0;
|
|
|
+ this.userOrdersPage(cur);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ this.current = 2;
|
|
|
+ this.userOrdersPage(cur);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.current = 3;
|
|
|
+ this.userOrdersPage(cur);
|
|
|
+ break;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- // 跳转到订单详情
|
|
|
- handlerSkipDetail(e) {
|
|
|
- console.log('@@@@e', e);
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/client/clientPackage/orderDetail?orderList=${JSON.stringify(e)}`,
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消订单
|
|
|
- handlerCancelOrder(e) {
|
|
|
- cancelOrder(e.id).then(res => {
|
|
|
- console.log('###res', res);
|
|
|
- if (res.code == 200) {
|
|
|
- uni.showToast({
|
|
|
- title: '取消成功',
|
|
|
- icon: 'none',
|
|
|
+ computed: {
|
|
|
+ allNumber() {
|
|
|
+ this.init_list.map(rs => {
|
|
|
+ let sum = 0;
|
|
|
+ let price = 0;
|
|
|
+ rs.goodsInfo.map(rc => {
|
|
|
+ sum += rc.goodsQuantity;
|
|
|
+ price += rc.goodsPrice;
|
|
|
});
|
|
|
- this.userOrdersPage(this.type);
|
|
|
- } else {
|
|
|
- console.log('###res', res);
|
|
|
- }
|
|
|
- });
|
|
|
+ rs.allNumb = sum;
|
|
|
+ rs.allPrice = price;
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ },
|
|
|
},
|
|
|
- // 点击跳转到商品评价
|
|
|
- handlerSkipComment(item, itm) {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/client/clientPackage/goodsEstimation?orderList=${JSON.stringify(
|
|
|
+ methods: {
|
|
|
+ handlerChangeItem(data) {
|
|
|
+ this.current = data.index;
|
|
|
+ this.type = data.type;
|
|
|
+ this.type_name = data.name;
|
|
|
+ this.userOrdersPage(this.type);
|
|
|
+ },
|
|
|
+
|
|
|
+ async userOrdersPage(type) {
|
|
|
+ let orderStatus = type == undefined ? 0 : `${type}`;
|
|
|
+ let res = await getUserOrderList({
|
|
|
+ status: orderStatus,
|
|
|
+ paging: '1,20',
|
|
|
+ });
|
|
|
+ if ((res.code = 200 && res.data)) {
|
|
|
+ this.init_list = res.data.records;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 跳转到订单详情
|
|
|
+ handlerSkipDetail(e) {
|
|
|
+ console.log('@@@@e', e);
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/client/clientPackage/orderDetail?orderList=${JSON.stringify(e)}`,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消订单
|
|
|
+ handlerCancelOrder(e) {
|
|
|
+ cancelOrder(e.id).then(res => {
|
|
|
+ console.log('###res', res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '取消成功',
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ this.userOrdersPage(this.type);
|
|
|
+ } else {
|
|
|
+ console.log('###res', res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 点击跳转到商品评价
|
|
|
+ handlerSkipComment(item, itm) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/client/clientPackage/goodsEstimation?orderList=${JSON.stringify(
|
|
|
item,
|
|
|
)}&goodsList=${JSON.stringify(itm)}`,
|
|
|
- });
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.order {
|
|
|
- margin-top: 10px;
|
|
|
- padding: 10rpx 20rpx 20rpx;
|
|
|
- box-sizing: border-box;
|
|
|
+ .order {
|
|
|
+ margin-top: 10px;
|
|
|
+ padding: 10rpx 20rpx 20rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
|
- .order-box {
|
|
|
- .order-item {
|
|
|
- margin-bottom: 20rpx;
|
|
|
- background-color: #fff;
|
|
|
- border-radius: 20rpx;
|
|
|
- padding: 20rpx;
|
|
|
- box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
|
|
|
+ .order-box {
|
|
|
+ .order-item {
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 20rpx;
|
|
|
+ box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
|
|
|
|
|
|
- .item-top {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- margin-bottom: 10rpx;
|
|
|
- }
|
|
|
+ .item-top {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+ }
|
|
|
|
|
|
- .item-center {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 10rpx;
|
|
|
- .center-left {
|
|
|
- height: 160rpx;
|
|
|
+ .item-center {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
|
|
|
- .img {
|
|
|
- width: 160rpx;
|
|
|
+ .center-left {
|
|
|
height: 160rpx;
|
|
|
+
|
|
|
+ .img {
|
|
|
+ width: 160rpx;
|
|
|
+ height: 160rpx;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .center-right {
|
|
|
- width: 100%;
|
|
|
- height: 160rpx;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- margin-left: 20rpx;
|
|
|
- .r-l {
|
|
|
+ .center-right {
|
|
|
+ width: 100%;
|
|
|
+ height: 160rpx;
|
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-around;
|
|
|
- .right-name {
|
|
|
- color: #4d5671;
|
|
|
- font-size: 32rpx;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
- .right-descript {
|
|
|
- font-size: 28rpx;
|
|
|
- color: #858797;
|
|
|
- }
|
|
|
- .l-box {
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-left: 20rpx;
|
|
|
+
|
|
|
+ .r-l {
|
|
|
display: flex;
|
|
|
- font-size: 24rpx;
|
|
|
- align-items: center;
|
|
|
- font-style: italic;
|
|
|
- .right-price {
|
|
|
- margin-right: 20rpx;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+
|
|
|
+ .right-name {
|
|
|
+ color: #4d5671;
|
|
|
+ font-size: 32rpx;
|
|
|
font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-descript {
|
|
|
font-size: 28rpx;
|
|
|
- color: #f57f32;
|
|
|
+ color: #858797;
|
|
|
}
|
|
|
- .right-numb {
|
|
|
+
|
|
|
+ .l-box {
|
|
|
+ display: flex;
|
|
|
font-size: 24rpx;
|
|
|
- color: #858797;
|
|
|
+ align-items: center;
|
|
|
+ font-style: italic;
|
|
|
+
|
|
|
+ .right-price {
|
|
|
+ margin-right: 20rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #f57f32;
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-numb {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #858797;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .r-r {
|
|
|
- .r-item {
|
|
|
- align-items: center;
|
|
|
+
|
|
|
+ .r-r {
|
|
|
+ .r-item {
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .item-allnumb-box {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- font-weight: bold;
|
|
|
- .allnumb-left {
|
|
|
- font-size: 32rpx;
|
|
|
- }
|
|
|
- .allnumb-right {
|
|
|
- font-size: 26rpx;
|
|
|
- color: #f57f32;
|
|
|
- .r-text {
|
|
|
- color: #000;
|
|
|
+ .item-allnumb-box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ .allnumb-left {
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .allnumb-right {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #f57f32;
|
|
|
+
|
|
|
+ .r-text {
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .item-bottom {
|
|
|
- display: flex;
|
|
|
- width: 100%;
|
|
|
- margin-top: 20rpx;
|
|
|
- .btn {
|
|
|
- width: 80%;
|
|
|
- height: 70rpx;
|
|
|
- background-color: rgba(248, 213, 53, 0.8);
|
|
|
- color: #4e5059;
|
|
|
- font-size: 28rpx;
|
|
|
- text-align: center;
|
|
|
- line-height: 70rpx;
|
|
|
- border-radius: 20rpx;
|
|
|
+ .item-bottom {
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 20rpx;
|
|
|
+
|
|
|
+ .btn {
|
|
|
+ width: 80%;
|
|
|
+ height: 70rpx;
|
|
|
+ background-color: rgba(248, 213, 53, 0.8);
|
|
|
+ color: #4e5059;
|
|
|
+ font-size: 28rpx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 70rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-.gray-color {
|
|
|
- color: #858797;
|
|
|
-}
|
|
|
+ .gray-color {
|
|
|
+ color: #858797;
|
|
|
+ }
|
|
|
|
|
|
-::deep .u-tabs__wrapper__nav__item__text {
|
|
|
- font-size: 30px;
|
|
|
-}
|
|
|
+ ::deep .u-tabs__wrapper__nav__item__text {
|
|
|
+ font-size: 30px;
|
|
|
+ }
|
|
|
</style>
|