diff --git a/pages/order/index/onlineorder.vue b/pages/order/index/onlineorder.vue index 02b5763..bffa7df 100644 --- a/pages/order/index/onlineorder.vue +++ b/pages/order/index/onlineorder.vue @@ -2,8 +2,8 @@ - 线上订单 - 线下订单 + 线上订单 + 线下订单 @@ -18,29 +18,29 @@ - + - 订单编号783974398749328 + 订单编号{{item2.order_no}} - 精品超市 + {{item2.from}} - + - + - 爱他美较大婴儿配方奶粉较大婴儿配方奶粉较大婴儿配方奶粉2段 900g + {{i.item_name}} - 1件;900g - ¥385 + {{i.item_meta.specs_text}} + ¥{{item2.items_total_yuan}} - 订单关闭 - 删除订单 + {{item2.status_text}} + @@ -62,30 +62,26 @@ - - - - - - - -¥250 - 线上-商城内消费 - - - ¥374.38 - 2021-09-01 18:27:58 - - - - - {{tabItem.loadingText}} - - - - - - - + + + + + {{item.balance.balance}} + {{item.balance.note}} + + + ¥{{item.balance.current}} + {{item.created_at}} + + + + + {{loadingText}} + + + + + @@ -99,48 +95,8 @@ { id: 1, name: '全部', - list: [ - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - } - ], + type: '', + list: [], isRefresher: false, loadingClass: false, loadingText: '正在加载中', @@ -150,38 +106,8 @@ { id: 2, name: '代付款', - list: [ - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - } - ], + type: 1, + list: [], isRefresher: false, loadingClass: true, loadingText: '正在加载中', @@ -190,39 +116,9 @@ }, { id: 3, - name: '秒杀单', - list: [ - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - } - ], + name: '待发货', + type: 2, + list: [], isRefresher: false, loadingClass: true, loadingText: '正在加载中', @@ -231,39 +127,9 @@ }, { id: 4, - name: '待提货', - list: [ - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - } - ], + name: '待收货', + type: 3, + list: [], isRefresher: false, loadingClass: true, loadingText: '正在加载中', @@ -272,39 +138,9 @@ }, { id: 5, - name: '待发货', - list: [ - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - }, - { - id: 10, - original_price: "4111.00", - picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", - pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], - price: "2412.00", - product_id: 1008, - sale: 0, - title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" - } - ], + name: '已完成', + type: 4, + list: [], isRefresher: false, loadingClass: true, loadingText: '正在加载中', @@ -312,12 +148,15 @@ isPage: true } ], + list: [], current: 0, windowHeight: 0, loadingClass: false, loadingText: '没有更多数据啦~', scrollH: '', nav_height: '', + isRefresher: false, + page: 1 } }, computed: { @@ -331,27 +170,123 @@ onLoad(){ let info = uni.getSystemInfoSync(); this.scrollH = info.screenHeight; + this.getData() }, methods: { + changeTab(index) { + this.online_tab = index + if(this.online_tab == 0) { + this.getData(); + }else { + this.getUploadList(); + } + }, + getUploadList(options={}) { + this.$http + .post({ + api: 'api/offline/order', + data:{ + page:this.page + }, + header: { + Authorization: `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjVkYTY5YjM5NWFhYzM5NzVmMzI3ZTEwZDEyMzAzZjI5MzE4ZmU2OGE2Njg0MTU0MWVjMjQ2NWM4ZWJkYjRlMTUwMmY1NWM0NDlkOTcxZDdjIn0.eyJhdWQiOiIzIiwianRpIjoiNWRhNjliMzk1YWFjMzk3NWYzMjdlMTBkMTIzMDNmMjkzMThmZTY4YTY2ODQxNTQxZWMyNDY1YzhlYmRiNGUxNTAyZjU1YzQ0OWQ5NzFkN2MiLCJpYXQiOjE2MzIzODY3NDAsIm5iZiI6MTYzMjM4Njc0MCwiZXhwIjoxNjYzOTIyNzQwLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.am-szF_sZcjtyOnEJT1DHMnr1hjAZ90MJc1Pc3AD3FrcQU5xb-u43ddL70ZmM3OxxLTZlmrB8OA3XJYREMtcz26MzwOMfopB9A5AH1EjHiFCV_368cq4ZpXNFi_Sn_LrY9Wje0-WMvkznF8tbrdCNrZn5YyIV47cwEnUNQrrREX4OhcgrSfNvwnh8_O_fueBwws9yY3tTlvVB7-AvG2urFI5XCzygsE3llE0wxF5ZJO1T5QRYLDse2BQ3d9feFzO5_7FiVspKr8DrJUlZP-Zz02UgIDIA_PX0UO2M0KeBwqPYq2d5uEnXT8or7K9coSnHRqbbr4qn6iczxDu4ofM58oCcaPycbtI3RvP2SMZuWmX8fXw-T99XltK_uJEU_wlIkrjvabzyo3tkrxRrwmzJEb3Yf4Lbah_xtfi24Nsu9SRjdw8YoiF6YhuuU5YaOn-wLltgmugfYpkFpEOneVAxoMjkm5IxZAJYMXF-DeSpdOoiTmuIRZYX4GDa55s_31r0YMyF6IIQNUvOjHHk-sJSHG0kPd5QivLP7dxE5XndwyFKAOeM97X2TjdYMhJz0EBCyS4Y_pI6AFWsxJkKsa0aqvBAeJyOV9k8kbYwtPeeBhBNsDWSlGBEZYMcoAv-C-IBZzd7gu2Ceh_MJPItrnsvj8W43Cv1TwxD26bJyt9EUY` + }, + }) + .then(res => { + if (res.data.status) { + let isPage = res.data.per_page == 15?true:false; + this.isPage = isPage; + if(!isPage) { + this.loadingClass = false; + this.loadingText = '没有更多数据啦~'; + } + if(options.type == 'pageRefresh') { + uni.stopPullDownRefresh(); + }else if(options.type == 'scrollRefresh') { + this.isRefresher = false; + } + if(this.page == 1) { + this.list = res.data.data.data; + }else { + this.list.push(...res.data.data.data); + } + console.log('数组列表',this.list) + } else { + wx.showModal({ + content: res.message || '请下拉页面刷新重试', + showCancel: false + }); + } + wx.hideLoading(); + }) + .catch(() => { + wx.hideLoading(); + wx.showModal({ + content: '请求失败', + showCancel: false + }); + }); + }, tabChange(index){ this.current = index; - this.clearTabItem(); this.getData(); }, - getData() { + getData(options ={}) { let tab_item = this.tab_list[this.current]; - let isPage = false; - tab_item.isPage = isPage; - if(!isPage){ - tab_item.loadingClass = false; - tab_item.loadingText = '没有更多数据啦~'; - } - tab_item.isRefresher = false; + console.log('=====adada===',tab_item) + this.$http + .get({ + api: 'api/order/list', + data:{ + status: tab_item.type, + page: tab_item.page, + type: 0, + channel: '' + }, + header: { + Authorization: this.$cookieStorage.get('user_token') + }, + }) + .then(res => { + if (res.data.status) { + let isPage = tab_item.page < res.data.meta.pagination.total_pages?true:false; + tab_item.isPage = isPage; + if(!isPage) { + tab_item.loadingClass = false; + tab_item.loadingText = '没有更多数据啦~'; + } + if(options.type == 'pageRefresh') { + uni.stopPullDownRefresh(); + }else if(options.type == 'scrollRefresh') { + tab_item.isRefresher = false; + } + if(tab_item.page == 1) { + tab_item.list = res.data.data; + }else { + tab_item.list.push(...res.data.data); + } + console.log('数组列表',tab_item.list) + } else { + wx.showModal({ + content: res.message || '请下拉页面刷新重试', + showCancel: false + }); + } + wx.hideLoading(); + }) + .catch(() => { + wx.hideLoading(); + wx.showModal({ + content: '请求失败', + showCancel: false + }); + }); }, // 滑块下标值变化 swiperChange(event){ this.current = event.detail.current; if(event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理 + this.getData(); }, // 页面触底,加载下一页 onScrolltolower(){ @@ -360,25 +295,35 @@ tab_item.page = tab_item.page + 1; this.getData(); } + if(this.isPage) { + this.page = this.page + 1; + this.getUploadList() + } }, // scroll-view 下拉刷新 onRefresherrefresh(){ this.$u.throttle(() => { - this.clearTabItem(); - this.getData(); + this.refreshFn({type: 'scrollRefresh'}); }, 200); }, - clearTabItem(){ + // 下拉刷新处理 + refreshFn(options){ let tab_item = this.tab_list[this.current]; tab_item.page = 1; tab_item.isPage = true; - tab_item.isRefresher = true; tab_item.loadingClass = true; - tab_item.loadingText = '正在加载中'; tab_item.list = []; - this.$set(this.tab_list, this.current, tab_item); - // this.$refs.uWaterfallFather[this.current].clear(); - } + tab_item.isRefresher = true; + tab_item.loadingText = '正在加载中'; + this.getData(options); + this.page = 1; + this.isPage = true; + this.loadingClass = true; + this.list = []; + this.isRefresher = true; + this.loadingText = '正在加载中'; + this.getUploadList(options); + }, } } diff --git a/pages/order/newdetail/newdetail.vue b/pages/order/newdetail/newdetail.vue index f843e70..dfb6101 100644 --- a/pages/order/newdetail/newdetail.vue +++ b/pages/order/newdetail/newdetail.vue @@ -98,7 +98,7 @@ 留言 暂无留言 --> - + 订单状态 {{order_details.status_text}} @@ -107,15 +107,15 @@ 支付方式 {{order_details.payment_text}} - + 收货方式 - 邮寄 + 快递 收货方式 自提 - + 支付时间 {{order_details.pay_time}}