|
@@ -91,6 +91,7 @@
|
|
import shareAlert from '@/components/module/modelAlert/shareAlert' //分享弹窗
|
|
import shareAlert from '@/components/module/modelAlert/shareAlert' //分享弹窗
|
|
import modelAlert from '@/components/module/modelAlert/modelAlert' //删除弹窗
|
|
import modelAlert from '@/components/module/modelAlert/modelAlert' //删除弹窗
|
|
import cancelAlert from '@/components/module/modelAlert/cancelAlert' //取消弹窗
|
|
import cancelAlert from '@/components/module/modelAlert/cancelAlert' //取消弹窗
|
|
|
|
+ import authorize from '@/config/authorize.js'
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
orSearch,
|
|
orSearch,
|
|
@@ -105,6 +106,7 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
themeClass: 'block',
|
|
themeClass: 'block',
|
|
|
|
+ searchInputVal:'',
|
|
isShowWrapper:false,
|
|
isShowWrapper:false,
|
|
isModallayer:false,
|
|
isModallayer:false,
|
|
isShowEmpty:false,
|
|
isShowEmpty:false,
|
|
@@ -144,8 +146,8 @@
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
getSearchText(e) {
|
|
getSearchText(e) {
|
|
- this.isShowWrapper = true
|
|
|
|
- this.getOrderDatainit(4)
|
|
|
|
|
|
+ this.searchInputVal = e
|
|
|
|
+ this.getOrderDatainit()
|
|
},
|
|
},
|
|
setScrollHeight() {
|
|
setScrollHeight() {
|
|
const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
|
|
const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
|
|
@@ -155,55 +157,60 @@
|
|
getOrderDatainit(index,source){
|
|
getOrderDatainit(index,source){
|
|
/**
|
|
/**
|
|
* @订单初始化加载 仅加载第一页码
|
|
* @订单初始化加载 仅加载第一页码
|
|
- * @param:orderState(订单状态:0全部,1待付款,2待发货,3已发货,4退货款)
|
|
|
|
|
|
+ * @param:code(微信返回的用户code)
|
|
|
|
+ * @param:searchWord(搜索关键词)
|
|
* @param:userID(用户ID)
|
|
* @param:userID(用户ID)
|
|
* @param:index(页码数)
|
|
* @param:index(页码数)
|
|
* @param:pageSize(每页条数)
|
|
* @param:pageSize(每页条数)
|
|
* @param:organizeID(全局变量组织ID)
|
|
* @param:organizeID(全局变量组织ID)
|
|
*/
|
|
*/
|
|
- this.$api.getStorage().then((resolve) =>{
|
|
|
|
- this.userID = resolve.userID
|
|
|
|
- let param = {orderState:index,userID:this.userID,index:1,pageSize:this.pageSize,organizeID:this.userOrganizeID};
|
|
|
|
- this.$api.lodingGet('/order/myOrder',param,
|
|
|
|
- response => {
|
|
|
|
- if(response.code === '1'){
|
|
|
|
- const _responseData = response.data.results
|
|
|
|
- if(_responseData && _responseData.length > 0){
|
|
|
|
- let filrerData = _responseData.filter(item=>{
|
|
|
|
- //添加不同状态下订单的表现形式
|
|
|
|
- item = Object.assign(item, this.orderStateExp(item.state));
|
|
|
|
- return item;
|
|
|
|
- });
|
|
|
|
- this.orderList =[];
|
|
|
|
- filrerData.forEach(item=>{
|
|
|
|
- this.orderList.push(item);
|
|
|
|
- })
|
|
|
|
- this.hasNextPage = response.data.hasNextPage;
|
|
|
|
- if(this.hasNextPage){
|
|
|
|
- this.pullUpOn = false
|
|
|
|
- this.nomoreText = '上拉显示更多'
|
|
|
|
- }else{
|
|
|
|
- if(this.orderList.length < 2){
|
|
|
|
- this.pullUpOn = true
|
|
|
|
- }else{
|
|
|
|
|
|
+ authorize.getCode('weixin').then(wechatcode =>{
|
|
|
|
+ this.$api.getStorage().then((resolve) =>{
|
|
|
|
+ this.userID = resolve.userID
|
|
|
|
+ let params = {code:wechatcode,searchWord:this.searchInputVal,userID:this.userID,index:1,pageSize:this.pageSize,organizeID:this.userOrganizeID};
|
|
|
|
+ this.$api.lodingGet('/search/order',params,
|
|
|
|
+ response => {
|
|
|
|
+ if(response.code === '1'){
|
|
|
|
+ this.isShowWrapper = true
|
|
|
|
+ const _responseData = response.data.results;
|
|
|
|
+ if(_responseData && _responseData.length > 0){
|
|
|
|
+ let filrerData = _responseData.filter(item=>{
|
|
|
|
+ //添加不同状态下订单的表现形式
|
|
|
|
+ item = Object.assign(item, this.orderStateExp(item.state));
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
|
|
+ this.orderList =[];
|
|
|
|
+ filrerData.forEach(item=>{
|
|
|
|
+ this.orderList.push(item);
|
|
|
|
+ })
|
|
|
|
+ this.hasNextPage = response.data.hasNextPage;
|
|
|
|
+ if(this.hasNextPage){
|
|
this.pullUpOn = false
|
|
this.pullUpOn = false
|
|
- this.nomoreText = '已至底部'
|
|
|
|
|
|
+ this.nomoreText = '上拉显示更多'
|
|
|
|
+ }else{
|
|
|
|
+ if(this.orderList.length < 2){
|
|
|
|
+ this.pullUpOn = true
|
|
|
|
+ }else{
|
|
|
|
+ this.pullUpOn = false
|
|
|
|
+ this.nomoreText = '已至底部'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ this.isShowEmpty = false
|
|
|
|
+ }else{
|
|
|
|
+ this.isShowEmpty = true
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- this.isShowEmpty = true
|
|
|
|
|
|
+ this.$util.msg(response.msg,2000);
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
- this.$util.msg(response.msg,2000);
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
- )
|
|
|
|
|
|
+ )
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getOnReachBottomData(index){//上拉加载
|
|
getOnReachBottomData(index){//上拉加载
|
|
this.pageNum+=1
|
|
this.pageNum+=1
|
|
- let param = {orderState:index,userID:this.userID,index:this.pageNum,pageSize:this.pageSize,organizeID:this.userOrganizeID}
|
|
|
|
- this.$api.get('/order/myOrder',param,
|
|
|
|
|
|
+ let params = {code:wechatcode,searchWord:this.searchInputVal,userID:this.userID,index:1,pageSize:this.pageSize,organizeID:this.userOrganizeID};
|
|
|
|
+ this.$api.get('/search/order',params,
|
|
response => {
|
|
response => {
|
|
if(response.code === '1'){
|
|
if(response.code === '1'){
|
|
let resData = response.data.results
|
|
let resData = response.data.results
|