123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473 |
- <template>
- <view class="myTask">
- <view class="tui-tabs">
- <scroll-view id="tab-bar" scroll-with-animation class="tui-scroll-h" :scroll-x="true"
- :show-scrollbar="false" style="border-bottom: 2upx solid #F8F8F8;">
- <view style="display: flex;">
- <view v-for="(tab, index) in tabBars" :id="tab.id" :data-current="index" @tap='tabSlect(tab)'>
- <view class="tui-tab-item-title"
- style="margin-left: 50upx;margin-right: 15upx;background: #FFFFFF;"
- :class="{ 'tui-tab-item-title-active': tabIndex == tab.id }">
- {{ tab.name }}{{tab.count != 0 ? '('+tab.count+')' : ''}}</view>
- </view>
- </view>
- </scroll-view>
- </view>
- <!-- #ifdef H5 -->
- <view style="margin-top: 100upx;" v-if="newsList.length > 0">
- <!-- #endif -->
- <!-- #ifndef H5 -->
- <view style="margin-top: 20upx;padding-top: 60rpx;" v-if="newsList.length > 0">
- <!-- #endif -->
- <view
- style="border-radius: 20upx;background: #FFFFFF;width: 710upx;height: max-content;margin: 20upx 20upx 20upx 20upx;"
- v-for="(item,index) in newsList" :key='index'>
- <view style="display: flex;">
- <view
- style="padding: 20upx 0 0upx 30upx;width: 75%;text-align: left;color: #000;font-size: 28upx;">
- {{item.createAt}}</view>
- <view
- style="padding: 20upx 0 0upx 0upx;width: 20%;text-align: right;color: #05C25C;font-size: 28upx;">
- {{item.status}}</view>
- </view>
- <view style="display: flex;padding: 20upx 10upx;" @tap='goOrderDetail(item.id)'>
- <image :src="item.img" style="width: 30%;height: 190upx;margin-left: 20upx;"></image>
- <view style="margin-left: 20upx;width: 68%;">
- <view
- style="font-size: 30upx;color: #333333;width: 90%;height: 80upx;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;">
- {{item.title}}</view>
- <view style="display: flex;height: 50upx;margin-top: 70upx;">
- <view style="display: flex;width: 45%;">
- <view
- style="font-size: 26upx;color: #333333;padding-bottom:10rpx;text-align: left;">
- 实付款: ¥{{item.payMoney}}</view>
- </view>
- <!-- <view v-if="item.relationList && item.relationList.length > 0"
- style="font-size: 26upx;color: #909399;padding-bottom:10rpx;width: 50%;text-align: right;">
- 佣金:
- ¥{{item.relationList[0].commissionPrice}}</view> -->
- </view>
- </view>
- </view>
- <!-- <view v-if="item.relationList && item.relationList.length > 1"
- style="margin-left: 35%;font-size: 26upx;color: #909399;">
- 直属【{{item.relationList[1].userName}}】佣金:
- ¥{{item.relationList[1].commissionPrice}}</view>
- <view v-if="item.relationList && item.relationList.length > 2"
- style="margin-left: 35%;font-size: 26upx;color: #909399;margin-top: 10rpx;margin-bottom: 20rpx;">
- 非直属【{{item.relationList[2].userName}}】佣金:
- ¥{{item.relationList[2].commissionPrice}}</view> -->
- <view style="height: 1upx;margin-left: 20upx;margin-right: 20upx;background: #E6E6E6;"></view>
- <view style="overflow: hidden;">
- <view style="display: flex;text-align: center;width: max-content;float: right;">
- <view v-if="item.status == '已发货'" class='view_button'
- style="color: #05C25C;border: 3upx solid #05C25C;" @tap='goconfirm(item)'>确认收货</view>
- <view v-if="item.status == '已退款' || item.status == '已收货' || item.status == '已取消'"
- class='view_button' @tap='deleteOder(item.id)'>删除订单</view>
- <view v-if="item.status == '待发货'" class='view_button' @tap='goRemind(item)'>提醒发货</view>
- <view v-if="item.status == '待付款'" class='view_button' @tap='gocancle(item)'>取消订单</view>
- <view v-if="item.status == '待付款'" class='view_button'
- style="color: #05C25C;border: 3upx solid #05C25C;" @tap='goPay(item)'>去支付</view>
- </view>
- </view>
- </view>
- <!-- 悬浮上拉 -->
- <view class="scroll_top" @tap="topScrollTap" v-bind:class="[scrollTop ? 'active' : '', '']"
- style="bottom: 56px;"><text class="iconfont icon-shangla"></text></view>
- <!-- 加载更多提示 -->
- <view class="s-col is-col-24" v-if="newsList.length > 0">
- <load-more :loadingType="loadingType" :contentText="contentText"></load-more>
- </view>
- </view>
- <!-- 加载更多提示 -->
- <!-- #ifdef H5 -->
- <empty v-if="newsList.length === 0" des="暂无数据" show="false"></empty>
- <!-- #endif -->
- <!-- #ifndef H5 -->
- <empty style="margin-top:78upx;" v-if="newsList.length === 0" des="暂无数据" show="false"></empty>
- <!-- #endif -->
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- //0全部 1待支付 2已支付 3已完成 4已取消
- tabIndex: '0',
- tabBars: [{
- name: '全部',
- count: 0,
- id: '0'
- },
- {
- name: '待付款',
- count: 0,
- id: '1'
- },
- {
- name: '待发货',
- count: 0,
- id: '2'
- },
- {
- name: '待收货',
- count: 0,
- id: '3'
- },
- {
- name: '已收货',
- count: 0,
- id: '4'
- },
- {
- name: '已取消',
- count: 0,
- id: '5'
- },
- {
- name: '退款中',
- count: 0,
- id: '6'
- },
- {
- name: '已退款',
- count: 0,
- id: '7'
- }
- ],
- page: 0,
- state: 0,
- isExpress: 0,
- size: 10,
- newsList: [],
- loadingType: 0,
- type: 1,
- scrollTop: false,
- contentText: {
- contentdown: '上拉显示更多',
- contentrefresh: '正在加载...',
- contentnomore: '没有更多数据了'
- }
- }
- },
- onShow() {
- let userId = this.$queue.getData('userId');
- if (userId) {
- this.getSelectOrderList('', this.tabIndex);
- }
- },
- methods: {
- getDingDanCount() {
- let userId = this.$queue.getData('userId');
- this.$Request.getT('/app/orders/count?userId=' + userId).then(res => {
- if (res.status === 0) {
- this.tabBars[1].count = res.data.count1;
- this.tabBars[2].count = res.data.count2;
- this.tabBars[3].count = res.data.count3;
- this.tabBars[4].count = res.data.count4;
- this.tabBars[5].count = res.data.count5;
- this.tabBars[6].count = res.data.count6;
- this.tabBars[7].count = res.data.count7;
- // this.tabBars[8].count = res.data.count8;
- }
- });
- },
- goRemind(item) {
- this.$Request.getT('/app/orders/remind?ordersId=' + item.id).then(res => {
- if (res.status === 0) {
- this.$queue.showToast('已提醒商家及时发货,请注意查收');
- } else {
- this.$queue.showToast(res.msg);
- }
- });
- },
- gocancle(list) {
- uni.showModal({
- title: '温馨提示',
- content: '确定要取消此订单吗?',
- showCancel: true,
- cancelText: '取消',
- confirmText: '确认',
- success: res => {
- if (res.confirm) {
- this.$Request.getT('/app/orders/cancel?id=' + list.id).then(res => {
- if (res.status === 0) {
- this.getSelectOrderList('', this.tabIndex);
- } else {
- this.$queue.showToast(res.msg);
- }
- });
- }
- }
- });
- },
- goconfirm(list) {
- uni.showModal({
- title: '温馨提示',
- content: '确定收到货物了吗?',
- showCancel: true,
- cancelText: '取消',
- confirmText: '确认',
- success: res => {
- if (res.confirm) {
- this.$Request.getT('/app/orders/confirm?id=' + list.id).then(res => {
- if (res.status === 0) {
- this.getSelectOrderList('', this.tabIndex);
- } else {
- this.$queue.showToast(res.msg);
- }
- });
- }
- }
- });
- },
- goPay(list) {
- this.$queue.setData('href', '/pages/my/myList')
- uni.redirectTo({
- url: '../my/payment?money=' + list.payMoney + '&title=' + list.title + '&img=' + list.img +
- '&id=' + list.id
- });
- },
- goOrderDetail(id) {
- uni.navigateTo({
- url: '../member/orderdetail?id=' + id
- });
- },
- deleteOder(id) {
- uni.showModal({
- title: '温馨提示',
- content: '确定要删除此订单吗?',
- showCancel: true,
- cancelText: '取消',
- confirmText: '确认',
- success: res => {
- if (res.confirm) {
- this.$Request.getT('/app/orders/delete?id=' + id).then(res => {
- if (res.status === 0) {
- this.getSelectOrderList('', this.tabIndex);
- } else {
- this.$queue.showToast(res.msg);
- }
- });
- }
- }
- });
- },
- getSelectOrderList(type, status) {
- this.getDingDanCount();
- this.loadingType = 1;
- uni.showLoading({
- title: '加载中...'
- });
- let userId = this.$queue.getData('userId');
- this.$Request.getT('/app/orders/findMyList?page=' + this.page + '&size=' + this.size + '&userId=' +
- userId + '&status=' +
- status).then(res => {
- if (res.status === 0) {
- if (this.page === 0 || res.status) {
- this.newsList = [];
- }
- res.data.content.forEach(d => {
- if (d.status === 1) {
- d.status = '待付款'
- } else if (d.status === 2) {
- d.status = '待发货'
- } else if (d.status === 3) {
- d.status = '已发货'
- } else if (d.status === 4) {
- d.status = '已收货'
- } else if (d.status === 5) {
- d.status = '已取消'
- } else if (d.status === 6) {
- d.status = '退款中'
- } else if (d.status === 7) {
- d.status = '已退款'
- } else if (d.status === 8) {
- d.status = '拒绝退款'
- } else if (d.status === 10) {
- d.status = '已评价'
- }
- this.newsList.push(d);
- });
- if (res.data.content.length === this.size) {
- this.loadingType = 0;
- } else {
- this.loadingType = 3;
- }
- } else {
- this.loadingType = 2;
- }
- uni.hideLoading();
- if (type === 'Refresh') {
- uni.stopPullDownRefresh(); // 停止刷新
- }
- });
- },
- tabSlect(item) {
- this.switchTab(item.id);
- },
- switchTab(index) {
- this.page = 0;
- this.tabIndex = index;
- this.newsList = [];
- this.getSelectOrderList('switch', this.tabIndex);
- },
- topScrollTap: function() {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 300
- });
- }
- },
- //统一登录跳转
- goLoginInfo() {
- this.$queue.setData('href', '/pages/zysc/my/myList');
- //#ifdef H5
- uni.navigateTo({
- url: '/pages/public/login'
- });
- //#endif
- //#ifndef H5
- uni.navigateTo({
- url: '/pages/public/login'
- });
- //#endif
- },
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- navTo(url) {
- let token = this.$queue.getData('token');
- if (token) {
- uni.navigateTo({
- url
- });
- } else {
- this.goLoginInfo();
- }
- },
- onPageScroll: function(e) {
- this.scrollTop = e.scrollTop > 200;
- },
- onReachBottom: function() {
- this.page = this.page + 1;
- this.getSelectOrderList('', this.tabIndex);
- },
- onPullDownRefresh: function() {
- this.page = 0;
- this.getSelectOrderList('Refresh', this.tabIndex);
- }
- }
- </script>
- <style lang="less">
- @import '../../../../static/less/index.less';
- @import '../../../../static/css/index.css';
- page {
- background: #F2F2F2;
- }
- .view_button {
- margin: 15upx 20upx 10upx 30upx;
- line-height: 55upx;
- font-size: 24upx;
- color: #333333;
- width: 150upx;
- height: 55upx;
- border-radius: 100upx;
- border: 3upx solid #bababa;
- }
- .tui-tabs {
- flex: 1;
- flex-direction: column;
- overflow: hidden;
- background-color: #fafafa;
- /* #ifdef MP-ALIPAY || MP-BAIDU */
- height: 100vh;
- /* #endif */
- }
- .tui-scroll-h {
- width: 750rpx;
- height: 80rpx;
- background-color: #ffffff;
- flex-direction: row;
- /* #ifndef APP-PLUS */
- white-space: nowrap;
- /* #endif */
- /* #ifdef APP-PLUS */
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- /* #endif */
- /* #ifdef H5 */
- position: fixed;
- top: 44px;
- left: 0;
- z-index: 999;
- /* #endif */
- /* #ifdef MP-WEIXIN */
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- /* #endif */
- }
- .tui-line-h {
- /* #ifdef APP-PLUS */
- height: 1rpx;
- background-color: #cccccc;
- /* #endif */
- position: relative;
- }
- /* #ifndef APP-PLUS*/
- .tui-line-h::after {
- content: '';
- position: absolute;
- border-bottom: 1rpx solid #cccccc;
- -webkit-transform: scaleY(0.5);
- transform: scaleY(0.5);
- bottom: 0;
- right: 0;
- left: 0;
- }
- /* #endif */
- .tui-tab-item {
- /* #ifndef APP-PLUS */
- display: flex;
- /* #endif */
- }
- .tui-tab-item-title {
- color: #555;
- font-size: 30rpx;
- /* #ifdef APP-PLUS */
- height: 80rpx;
- /* #endif */
- /* #ifndef APP-PLUS */
- height: 82rpx;
- /* #endif */
- line-height: 80rpx;
- flex-wrap: nowrap;
- white-space: nowrap;
- }
- .tui-tab-item-title-active {
- color: #05C25C;
- font-size: 32upx;
- font-weight: bold;
- border-bottom-width: 6upx;
- text-align: center;
- }
- </style>
|