123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <template>
- <view>
- <scroll-view scroll-x class="bg-white nav text-center solid-bottom echo-fixed-top">
- <view class="cu-item flex-sub" data-status="0" :class="status=='0'?'text-orange cur':''" @tap="tabSelect">全部</view>
- <view class="cu-item flex-sub" data-status="2" :class="status=='2'?'text-orange cur':''" @tap="tabSelect">待支付</view>
- <view class="cu-item flex-sub" data-status="3" :class="status=='3'?'text-orange cur':''" @tap="tabSelect">已支付</view>
- <view class="cu-item flex-sub" data-status="4" :class="status=='4'?'text-orange cur':''" @tap="tabSelect">已完成</view>
- <view class="cu-item flex-sub" data-status="5" :class="status=='5'?'text-orange cur':''" @tap="tabSelect">已退单</view>
- <view class="cu-item flex-sub" data-status="1" :class="status=='1'?'text-orange cur':''" @tap="tabSelect">已取消</view>
- </scroll-view>
- <view class="echo-fixed-top-empty"></view>
- <block v-for="(item,index) in plist" :key="item.id">
- <view class="cu-item bg-white margin-top-sm">
- <view class="cu-list menu-avatar">
- <view class="cu-item">
- <view class="cu-avatar lg" :style="'background-image:url('+ item.tilpic +');'"></view>
- <view class="content echo-order-venue">
- <view class="text-grey">
- <text class="text-cut">{{item.title}}</text>
- </view>
- <view class="text-gray text-sm flex">
- <view class="text-cut">
- 订单号:{{item.ordersn}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="cu-list menu sm-border solid-bottom" style="margin-top: 0rpx;">
- <view class="cu-item">
- <view class="content">
- <text class="text-grey">订单状态</text>
- </view>
- <view class="action">
- <text class="text-lg text-right basis-sm text-grey" v-if="item.status==1">已取消</text>
- <text class="text-lg text-right basis-sm text-red" v-if="item.status==2">待支付</text>
- <text class="text-lg text-right basis-sm text-green" v-if="item.status==3">已支付</text>
- <text class="text-lg text-right basis-sm text-green" v-if="item.status==4">已完成</text>
- <text class="text-lg text-right basis-sm text-orange" v-if="item.status==5">已退单</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="text-grey">兑购数量</text>
- </view>
- <view class="action">
- <text class="text-lg">{{item.buynumber}} 件</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="text-grey">积分&金额</text>
- </view>
- <view class="action">
- <text class="text-lg">{{item.integral}}积分 + ¥{{item.paymoney}}</text>
- </view>
- </view>
- </view>
- <view class="solid-top grid text-center col-2" v-if="item.status==1">
- <view class="padding-tb text-grey solid-right" @tap="deleteOrder(item.id)">删除订单</view>
- <view class="padding-tb" @tap="goPage('/pages/mall/order?orderid='+item.id)">订单详情</view>
- </view>
- <view class="solid-top grid text-center col-2" v-else-if="item.status==2">
- <view class="padding-tb text-grey solid-right" @tap="closeOrder(item.id)">取消订单</view>
- <view class="padding-tb text-red" @tap="goPage('/pages/mall/order?orderid='+item.id)">立即支付</view>
- </view>
- <view class="solid-top grid text-center col-1" v-else>
- <view class="padding-tb" @tap="goPage('/pages/mall/order?orderid='+item.id)">订单详情</view>
- </view>
- </view>
- </block>
- <uni-load-more :status="pstatus"></uni-load-more>
- </view>
- </template>
- <script>
- import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
- var _this;
- export default {
- components: {
- uniLoadMore
- },
- data() {
- return {
- userinfo: false,
- status: 0,
- pstatus: 'more',
- ppage: 1,
- psize: 20,
- plist: []
- };
- },
- onLoad: function(option) {
- _this = this;
- var userinfo = uni.getStorageSync('userinfo') || false;
- if (userinfo == false) {
- uni.redirectTo({
- url: '/pages/login/login'
- });
- return false;
- }
- _this.userinfo = userinfo;
- _this.getMore();
- },
- onPullDownRefresh: function() {
- _this.ppage = 1;
- _this.pstatus = 'more';
- _this.plist = [];
- _this.getMore();
- },
- onReachBottom: function() {
- if (_this.pstatus !== 'more') {
- return;
- }
- _this.getMore();
- },
- methods: {
- closeOrder: function(orderid) {
- _this.$req.ajax({
- path: "mall/closeorder",
- data: {
- orderid: orderid,
- userid: _this.userinfo.id
- }
- }).then((data) => {
- uni.showModal({
- title: '信息提示',
- content: '订单取消成功。',
- showCancel: false,
- success: function(res) {
- _this.pageRefresh();
- }
- });
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
- deleteOrder: function(orderid) {
- _this.$req.ajax({
- path: "mall/deleteorder",
- data: {
- orderid: orderid,
- userid: _this.userinfo.id
- }
- }).then((data) => {
- uni.showModal({
- title: '信息提示',
- content: '订单删除成功。',
- showCancel: false,
- success: function(res) {
- _this.pageRefresh();
- }
- });
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
- getMore: function() {
- _this.$req.ajax({
- path: "mall/listorder",
- data: {
- ppage: _this.ppage,
- psize: _this.psize,
- userid: _this.userinfo.id,
- status: _this.status
- }
- }).then((data) => {
- _this.pstatus = data.pstatus;
- _this.plist = _this.plist.concat(data.plist);
- _this.ppage += 1;
- uni.stopPullDownRefresh();
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
- tabSelect: function(e) {
- _this.status = e.currentTarget.dataset.status;
- _this.pageRefresh();
- },
- pageRefresh: function() {
- _this.pstatus = 'more';
- _this.ppage = 1;
- _this.plist = [];
- _this.getMore();
- },
- goPage: function(pageurl) {
- uni.navigateTo({
- url: pageurl
- });
- }
- }
- }
- </script>
- <style>
- .cu-list.menu-avatar>.cu-item .content {
- width: calc(100% - 96rpx - 60rpx - 20rpx) !important;
- }
- </style>
|