zs 1 рік тому
батько
коміт
6659b86f20

+ 26 - 11
pagesHome/ticket/index.vue

@@ -47,9 +47,10 @@
 					<text class="text" @tap="toOpen">指定日期<text class="iconfont icon-dayuhao"></text></text>
 				</view>
 				<view class="thr_3">
-					<view class="list" v-for="(item, index) in totalList" :key="index" @tap="toType(item)">
-						<text :class="[is_type==item._id||is_person==item._id?'text_1':'text']">{{item.label}}</text>
-					</view>
+					<scroll-view class="scroll-view_H" scroll-x="true">
+						<text v-for="(item, index) in totalList" :key="index" @tap="toType(item)"
+							:class="[is_type==item._id||is_person==item._id?'text_1':'text']">{{item.label}}</text>
+					</scroll-view>
 					<view @tap="toSelect">
 						筛选
 						<uni-icons v-if="is_select" type="top"></uni-icons>
@@ -264,11 +265,21 @@
 			toType(item) {
 				const that = this;
 				if (item.type == 'ticket_person') {
-					that.$set(that.searchInfo, `type`, '')
-					that.$set(that.searchInfo, `person`, item.value)
+					if (item._id == that.is_person) {
+						that.$set(that, `is_person`, '')
+						that.$set(that.searchInfo, `person`, '')
+					} else {
+						that.$set(that, `is_person`, item._id)
+						that.$set(that.searchInfo, `person`, item.value)
+					}
 				} else {
-					that.$set(that.searchInfo, `person`, '')
-					that.$set(that.searchInfo, `type`, item.value)
+					if (item._id == that.is_type) {
+						that.$set(that, `is_type`, '')
+						that.$set(that.searchInfo, `type`, '')
+					} else {
+						that.$set(that, `is_type`, item._id)
+						that.$set(that.searchInfo, `type`, item.value)
+					}
 				}
 				that.clearPage();
 				that.search();
@@ -349,7 +360,7 @@
 					is_use: '0',
 				})
 				if (res.errcode == '0') that.$set(that, `typeList`, res.data);
-				that.$set(that, `totalList`, [...that.personList, ...that.typeList].slice(0, 7));
+				that.$set(that, `totalList`, [...that.personList, ...that.typeList]);
 			},
 			// 分页
 			toPage(e) {
@@ -548,11 +559,14 @@
 					font-size: var(--font15Size);
 					margin: 1vw 0 0 0;
 
-					.list {
+					.scroll-view_H {
+						white-space: nowrap;
+						width: 80vw;
+						height: 5vh;
 
 						.text {
 							margin: 0 5px 0 0;
-							padding: 1vw;
+							padding: 1vw 2vw;
 							border-radius: 5px;
 							font-size: var(--font12Size);
 							color: var(--f69Color);
@@ -565,7 +579,7 @@
 
 						.text_1 {
 							margin: 0 5px 0 0;
-							padding: 1vw;
+							padding: 1vw 2vw;
 							border-radius: 5px;
 							font-size: var(--font12Size);
 							color: var(--mainColor);
@@ -576,6 +590,7 @@
 							}
 						}
 					}
+
 				}
 
 				.thr_4 {

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/ticket/index.js.map


+ 15 - 5
unpackage/dist/dev/mp-weixin/pagesHome/ticket/index.js

@@ -379,11 +379,21 @@ var _default = {
     toType: function toType(item) {
       var that = this;
       if (item.type == 'ticket_person') {
-        that.$set(that.searchInfo, "type", '');
-        that.$set(that.searchInfo, "person", item.value);
+        if (item._id == that.is_person) {
+          that.$set(that, "is_person", '');
+          that.$set(that.searchInfo, "person", '');
+        } else {
+          that.$set(that, "is_person", item._id);
+          that.$set(that.searchInfo, "person", item.value);
+        }
       } else {
-        that.$set(that.searchInfo, "person", '');
-        that.$set(that.searchInfo, "type", item.value);
+        if (item._id == that.is_type) {
+          that.$set(that, "is_type", '');
+          that.$set(that.searchInfo, "type", '');
+        } else {
+          that.$set(that, "is_type", item._id);
+          that.$set(that.searchInfo, "type", item.value);
+        }
       }
       that.clearPage();
       that.search();
@@ -481,7 +491,7 @@ var _default = {
               case 11:
                 res = _context3.sent;
                 if (res.errcode == '0') that.$set(that, "typeList", res.data);
-                that.$set(that, "totalList", [].concat((0, _toConsumableArray2.default)(that.personList), (0, _toConsumableArray2.default)(that.typeList)).slice(0, 7));
+                that.$set(that, "totalList", [].concat((0, _toConsumableArray2.default)(that.personList), (0, _toConsumableArray2.default)(that.typeList)));
               case 14:
               case "end":
                 return _context3.stop();

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/ticket/index.wxml


+ 11 - 6
unpackage/dist/dev/mp-weixin/pagesHome/ticket/index.wxss

@@ -130,26 +130,31 @@
   font-size: var(--font15Size);
   margin: 1vw 0 0 0;
 }
-.main .bottom .thr .thr_3 .list .text.data-v-1ae5c169 {
+.main .bottom .thr .thr_3 .scroll-view_H.data-v-1ae5c169 {
+  white-space: nowrap;
+  width: 80vw;
+  height: 5vh;
+}
+.main .bottom .thr .thr_3 .scroll-view_H .text.data-v-1ae5c169 {
   margin: 0 5px 0 0;
-  padding: 1vw;
+  padding: 1vw 2vw;
   border-radius: 5px;
   font-size: var(--font12Size);
   color: var(--f69Color);
   background-color: var(--mainColor);
 }
-.main .bottom .thr .thr_3 .list .text .iconfont.data-v-1ae5c169 {
+.main .bottom .thr .thr_3 .scroll-view_H .text .iconfont.data-v-1ae5c169 {
   font-size: 14px;
 }
-.main .bottom .thr .thr_3 .list .text_1.data-v-1ae5c169 {
+.main .bottom .thr .thr_3 .scroll-view_H .text_1.data-v-1ae5c169 {
   margin: 0 5px 0 0;
-  padding: 1vw;
+  padding: 1vw 2vw;
   border-radius: 5px;
   font-size: var(--font12Size);
   color: var(--mainColor);
   background-color: var(--f3CColor);
 }
-.main .bottom .thr .thr_3 .list .text_1 .iconfont.data-v-1ae5c169 {
+.main .bottom .thr .thr_3 .scroll-view_H .text_1 .iconfont.data-v-1ae5c169 {
   font-size: 14px;
 }
 .main .bottom .thr .thr_4.data-v-1ae5c169 {