Explorar el Código

根据类型切换状态

htc hace 10 meses
padre
commit
6939126273
Se han modificado 1 ficheros con 23 adiciones y 23 borrados
  1. 23 23
      pagesHouse/Mine/ordersList/index.vue

+ 23 - 23
pagesHouse/Mine/ordersList/index.vue

@@ -4,7 +4,7 @@
 		<view class="tb">
 			<view class="tabs">
 				<view v-for="(item,index) in tabList" :key="index" @tap="changeStatus(index)">
-					<text :class="index==current?'active':''">{{item.name}}</text>
+					<text :class="index===current?'active':''">{{item.name}}</text>
 				</view>
 			</view>
 		</view>
@@ -158,18 +158,18 @@
 			}
 		},
 		onLoad(option) {
-			if (option.typeTxt) {
-				const typeTxt = option.typeTxt;
+			if (option.index>=0) {
+				const index = option.index;
 				//其他页面入参
-				if (typeTxt =='待付款') {
+				if (index == 0) {
 					this.changeStatus(1)
-				} else if (typeTxt =='待使用') {
-					this.changeStatus(2)
-				} else if (typeTxt =='已完成') {
+				} else if (index == 1) {
+					this.changeStatus(2) 
+				} else if (index == 2) {
 					this.changeStatus(3)
-				} else if (typeTxt == '退款售后') {
-					this.changeStatus(4)
-				}else if (typeTxt == '已取消') {
+				} else if (index == 3) {
+					this.changeStatus(4) 
+				}else {
 					this.changeStatus(0)
 				}
 			} else {
@@ -237,20 +237,20 @@
 				}
 			},
 			changeStatus(index) {
-				this.current=index;
+				this.current=index;
 				if(this.merchantType==10){
-				if (index === 0) this.status = '';
-				else if (index === 1) this.status = '0'
-				else if (index === 2) this.status = '1';
-				else if (index === 3) this.status = '3,7';
-				else if (index === 4) this.status = '4,5';
-			}else{
-				if (index === 0) this.state = '';
-				else if (index === 1) this.state = '0'
-				else if (index === 2) this.state = '4';
-				else if (index === 3) this.state = '3';
-				else if (index === 4) this.state = '-3';
-			}
+					if (index === 0) this.status = '';
+					else if (index === 1) this.status = '0'
+					else if (index === 2) this.status = '1';
+					else if (index === 3) this.status = '3,7';
+					else if (index === 4) this.status = '4,5';
+				}else{
+					if (index === 0) this.state = '';
+					else if (index === 1) this.state = '0'
+					else if (index === 2) this.state = '4';
+					else if (index === 3) this.state = '3';
+					else if (index === 4) this.state = '-3';
+				}
 				this.init();
 			},
 			//渔家乐订单