订单补充状态和手机号参数

main
xuechunyuan 2 years ago
parent c030abbe9a
commit a0c86d7dd7
  1. 33
      pages/pages_zhentou/order/order.vue

@ -1,11 +1,11 @@
<template> <template>
<view class="order_box"> <view class="order_box">
<view class="order_title"> <view class="order_title">
<p @click="handleTab(1)" class="tit" :class="active == 1 ? 'actived' : ''">全部</p> <p @click="handleTab(1)" class="tit" :class="active == '' ? 'actived' : ''">全部</p>
<p @click="handleTab(2)" class="tit" :class="active == 2 ? 'actived' : ''">待付款</p> <p @click="handleTab(2)" class="tit" :class="active == 1 ? 'actived' : ''">待付款</p>
<p @click="handleTab(3)" class="tit" :class="active == 3 ? 'actived' : ''">待发货</p> <p @click="handleTab(3)" class="tit" :class="active == 2 ? 'actived' : ''">待发货</p>
<p @click="handleTab(4)" class="tit" :class="active == 4 ? 'actived' : ''">待收货</p> <p @click="handleTab(4)" class="tit" :class="active == 3 ? 'actived' : ''">待收货</p>
<p @click="handleTab(5)" class="tit" :class="active == 5 ? 'actived' : ''">已完成</p> <p @click="handleTab(5)" class="tit" :class="active == 4 ? 'actived' : ''">已完成</p>
</view> </view>
<view class="order_content" v-for="(item,index) in orderData" :key="index"> <view class="order_content" v-for="(item,index) in orderData" :key="index">
<view class="order_item" @click="handleCheck(item)"> <view class="order_item" @click="handleCheck(item)">
@ -68,7 +68,7 @@
data() { data() {
return { return {
imgPrefix: getApp().globalData.imgPrefix, imgPrefix: getApp().globalData.imgPrefix,
active: 1, active: '',
orderData: [], orderData: [],
current: 0, current: 0,
size: 10, size: 10,
@ -78,11 +78,16 @@
contentdown: "点击查看更多", contentdown: "点击查看更多",
contentrefresh: "正在加载...", contentrefresh: "正在加载...",
contentnomore: "没有更多数据了", contentnomore: "没有更多数据了",
} },
userInfo: {}
} }
}, },
mounted() { onLoad() {
this.loadMore(); let userInfo = uni.getStorageSync('userInfo');
if(userInfo) {
this.userInfo = JSON.parse(userInfo);
this.loadMore();
}
}, },
methods: { methods: {
// //
@ -94,9 +99,9 @@
loadMore() { loadMore() {
if (this.hasMore) { if (this.hasMore) {
this.current = this.current + 1; this.current = this.current + 1;
this.staus = 'loading'; this.status = 'loading';
uni.request({ uni.request({
url: getApp().globalData.baseUrl + '/blade-desk/order/page?current=' + this.current + '&size=' + this url: getApp().globalData.baseUrl + '/blade-desk/order/page?buyerPhone=' + this.userInfo.phone + '&status=' + this.active + '&current=' + this.current + '&size=' + this
.size, .size,
method: 'GET', method: 'GET',
header: { header: {
@ -122,7 +127,11 @@
} }
}, },
handleTab(val) { handleTab(val) {
this.active = val this.active = val;
this.current = 0;
this.orderData = [];
this.hasMore = true;
this.loadMore();
}, },
handleCheck(row) { handleCheck(row) {
let item = encodeURIComponent(JSON.stringify(row)) let item = encodeURIComponent(JSON.stringify(row))

Loading…
Cancel
Save