zhangyun пре 4 година
родитељ
комит
dcc381e35a

+ 0 - 64
MingGaoApp/App.vue

@@ -42,24 +42,6 @@
 					// console.log('没有登录成功')
 				}
 			})
-			uni.getStorage({
-				key: 'session_key',
-				success: (res) => {
-					console.log(res)
-					if (res.data != "") {
-						this.getlistinfo()
-					} else {
-						uni.navigateTo({
-							url: "../login/login"
-						})
-					}
-				},
-				fail: () => {
-					uni.navigateTo({
-						url: "../login/login"
-					})
-				}
-			})
 		},
 		onShow: function() {
 			// App展示在前台
@@ -71,52 +53,6 @@
 			this.close()
 		},
 		methods: {
-			async getlistinfo() {
-				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=sysmenage.usermanager.user_info',
-				})
-				if (this.globalData.app.length != 0) {
-					if (this.globalData.app[0].children[0].purview_name == "我的任务") {
-						uni.switchTab({
-							url: "../index/index"
-						})
-					} else if (this.app[0].children[0].purview_name == "监督") {
-						uni.switchTab({
-							url: "../supervise/index"
-						})
-						uni.setTabBarItem({
-							index: 0,
-							visible: false
-						});
-					} else {
-						uni.switchTab({
-							url: "../response/index"
-						})
-						uni.setTabBarItem({
-							index: 0,
-							visible: false
-						});
-						uni.setTabBarItem({
-							index: 1,
-							visible: false
-						});
-					}
-				} else {
-					uni.setTabBarItem({
-						index: 0,
-						visible: false
-					});
-					uni.setTabBarItem({
-						index: 1,
-						visible: false
-					});
-					uni.switchTab({
-						url: "../response/index"
-					})
-				}
-				// console.log(this.app)
-			},
-			
 			// 实时通信 - 初始化
 			msgInit() {
 				var that = this

+ 37 - 5
MingGaoApp/pages/index/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="content">
+	<view class="content" @touchstart="start" @touchend="end">
 		<view class="subsection">
 			<view class="division">
 				<u-search placeholder="请输入任务处理人" v-model="name" :showAction="false" @input="search"></u-search>
@@ -70,7 +70,11 @@
 				start_time: "",
 				end_time: "",
 				keyword: "",
-				name: ""
+				name: "",
+				startData:{
+					clientX:0,
+					clientY:0
+				}
 			}
 		},
 		onShow() {
@@ -78,8 +82,7 @@
 			this.tasklist = []
 			this.gettaskdata()
 		},
-		onLoad() {
-		},
+		onLoad() {},
 		onReachBottom() {
 			this.page++
 			this.gettaskdata()
@@ -119,7 +122,6 @@
 					});
 				}
 				this.gettaskdata()
-
 			},
 			colors(type) {
 				if (type == '未开始' || type == '未处理') {
@@ -174,6 +176,36 @@
 					this.page = 1
 					this.gettaskdata()
 				}, 1000)()
+			},
+			start(e) {
+				// console.log("滑动222")
+				this.startData.clientX = e.changedTouches[0].clientX;
+				this.startData.clientY = e.changedTouches[0].clientY;
+			},
+			end(e) {
+				// console.log("滑动")
+				const subX = e.changedTouches[0].clientX - this.startData.clientX;
+				const subY = e.changedTouches[0].clientY - this.startData.clientY;
+				if (subY > 50 || subY < -50) {
+					console.log('上下滑')
+				} else {
+					if (subX > 100) {
+						// console.log('右滑')
+						if(this.current!=0){
+							this.current--
+							this.sectionChange(this.current)
+						}
+						
+					} else if (subX < -100) {
+						// console.log('左滑')
+						if(this.current!=2){
+							this.current++
+							this.sectionChange(this.current)
+						}
+					} else {
+						console.log('无效')
+					}
+				}
 			}
 		}
 	}

Разлика између датотеке није приказан због своје велике величине
+ 7 - 3
MingGaoApp/unpackage/dist/dev/app-plus/app-service.js


+ 12 - 1
MingGaoApp/unpackage/dist/dev/app-plus/app-view.js

@@ -1549,7 +1549,18 @@ var render = function() {
   var _c = _vm._self._c || _h
   return _c(
     "v-uni-view",
-    { staticClass: _vm._$g(0, "sc"), attrs: { _i: 0 } },
+    {
+      staticClass: _vm._$g(0, "sc"),
+      attrs: { _i: 0 },
+      on: {
+        touchstart: function($event) {
+          return _vm.$handleViewEvent($event)
+        },
+        touchend: function($event) {
+          return _vm.$handleViewEvent($event)
+        }
+      }
+    },
     [
       _c(
         "v-uni-view",