gjy 2 年之前
父节点
当前提交
15fbf51232
共有 8 个文件被更改,包括 109 次插入13 次删除
  1. 1 0
      App.vue
  2. 2 2
      config/index.js
  3. 2 1
      main.js
  4. 40 6
      pages/goodSource/index.vue
  5. 12 0
      pages/mine/index.vue
  6. 12 0
      pages/news/index.vue
  7. 28 4
      pages/order/index.vue
  8. 12 0
      pages/riders/index.vue

+ 1 - 0
App.vue

@@ -37,6 +37,7 @@
 		onLaunch: function() {
 			var that = this
 			// #ifdef APP-PLUS
+			// this.$tabbarView.init()
 			// uni.getNetworkType({
 			// 	success: function (res) {
 			// 		if(res.networkType=='none'){

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 const dev = {
-	// baseUrlNew: 'https://apitest.eliangeyun.com',
-	baseUrlNew: 'http://192.168.110.9:8099',
+	baseUrlNew: 'https://apitest.eliangeyun.com',
+	// baseUrlNew: 'http://192.168.110.9:8099',
 	// baseUrlNew: 'http://192.168.110.82:8999',
 	// baseUrlNew: 'http://192.168.1.119:8999',
 	h5Appid: 'wxb66b599f7f61b46f',

+ 2 - 1
main.js

@@ -13,7 +13,8 @@ import utils from '@/util/util.js'
 import webim from 'webim.js';
 import helper from'@/common/helper.js'
 // import axios from 'axios'
-
+import TabbarView from "./common/TabBarView.js";
+Vue.prototype.$tabbarView = new TabbarView();
 Vue.prototype.$api = baseApi
 Vue.prototype.$request = request
 Vue.prototype.$utils = utils

+ 40 - 6
pages/goodSource/index.vue

@@ -1,6 +1,6 @@
 <!-- 货源 -->
 <template>
-	<view class="content">
+	<view  @touchend="end" @touchmove="move" :class="{popupShow:isShowAlert}" class="content">
 <!-- 		<fh-no-network></fh-no-network> -->
 		<view class="banner">
 			<image class="banner-img" src="@/static/images/goodSource/banner@2x.png" mode='widthFix'></image>
@@ -169,6 +169,7 @@
 				pickerSelect: '全部类型',
 				tabIndex: 0,
 				scrollTop: 0,
+				isdblclick:0,
 				count: 0,
 				lng: '',
 				lat: '',
@@ -177,11 +178,18 @@
 			}
 		},
 		onTabItemTap(e) {
+			this.isdblclick++
 			// tab 点击时执行,此处直接接收单击事件
-			uni.pageScrollTo({
-				scrollTop: 0,
-				duration: 300
-			});
+			if(this.scrollTop>1200){
+				if(this.isdblclick>1){
+					uni.pageScrollTo({
+						scrollTop: 0,
+						duration: 300
+					});
+				}
+				
+			}
+			
 		},
 		created() {
 
@@ -198,8 +206,24 @@
 		onLoad() {
 			this.checkOpenGPSServiceByAndroidIOS()
 		},
+		onHide() {
+			this.isdblclick=0
+		},
 		onShow() {
-			
+			if(this.scrollTop>1200){
+				uni.setTabBarItem({
+					index: 0,
+					text: '返回顶部',
+					iconPath: 's',
+					selectedIconPath: 'static/images/common/top@2x.png'
+				})
+			}
+			uni.setTabBarItem({
+				index: 2,
+				text: '订单',
+				iconPath: 'static/images/common/dingdan@2x(1).png',
+				selectedIconPath: 'static/images/common/dingdan@2x.png'
+			})
 			var that= this
 			setTimeout(()=>{
 				// var photol=await permision.checkSystemEnableLocation()
@@ -261,6 +285,7 @@
 		// 	// #endif
 
 		// },
+		
 		onPageScroll(res) {
 			this.scrollTop = res.scrollTop
 			// console.log("页面滚动了", res.scrollTop)
@@ -282,6 +307,9 @@
 
 		},
 		methods: {
+			stopRoll(){
+				
+			},
 			async get_localtion_permission() {
 				var photol=await permision.checkSystemEnableLocation()
 				if(photol == true){
@@ -915,6 +943,12 @@
 </script>
 
 <style scoped lang="scss">
+	.popupShow {
+		overflow: hidden;
+		position: fixed;
+		height: 100vh;
+		width: 100%;
+	}
 	.content {
 		background: #F2F4F7;
 	}

+ 12 - 0
pages/mine/index.vue

@@ -146,6 +146,18 @@
 			};
 		},
 		onShow() {
+			uni.setTabBarItem({
+				index: 0,
+				text: '货源',
+				iconPath: 'static/images/common/huoyuan@2x(1).png',
+				selectedIconPath: 'static/images/common/huoyuan@2x.png'
+			})
+			uni.setTabBarItem({
+				index: 2,
+				text: '订单',
+				iconPath: 'static/images/common/dingdan@2x(1).png',
+				selectedIconPath: 'static/images/common/dingdan@2x.png'
+			})
 			// console.log("111111111111111111111111111", this.firstAuthentication)
 			//获取认证状态
 			// console.log(userInfo)

+ 12 - 0
pages/news/index.vue

@@ -96,6 +96,18 @@
 
 		// },
 		onShow() {
+			uni.setTabBarItem({
+				index: 0,
+				text: '货源',
+				iconPath: 'static/images/common/huoyuan@2x(1).png',
+				selectedIconPath: 'static/images/common/huoyuan@2x.png'
+			})
+			uni.setTabBarItem({
+				index: 2,
+				text: '订单',
+				iconPath: 'static/images/common/dingdan@2x(1).png',
+				selectedIconPath: 'static/images/common/dingdan@2x.png'
+			})
 			this.newsNumber()
 			this.upCallback({
 				size: 10,

+ 28 - 4
pages/order/index.vue

@@ -284,6 +284,7 @@
 				isSearch: false,
 				startPlace: '齐齐哈尔齐齐哈尔',
 				endPlace: '全国',
+				isdblclick:0,
 				goods: [], // 数据列表
 				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
 				height: "", // 需要固定swiper的高度
@@ -313,11 +314,17 @@
 			...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
 		},
 		onTabItemTap(e) {
+			this.isdblclick++
 			// tab 点击时执行,此处直接接收单击事件
-			uni.pageScrollTo({
-				scrollTop: 0,
-				duration: 300
-			});
+			if(this.scrollTop>1200){
+				if(this.isdblclick>1){
+					uni.pageScrollTo({
+						scrollTop: 0,
+						duration: 300
+					});
+				}
+				
+			}
 		},
 		created() {
 			//#ifdef APP-PLUS
@@ -343,7 +350,24 @@
 		// 	// #endif
 
 		// },
+		onHide() {
+			this.isdblclick=0
+		},
 		onShow() {
+			if (this.scrollTop > 1200) {
+				uni.setTabBarItem({
+					index: 2,
+					text: '返回顶部',
+					iconPath: 'static/images/common/top@2x.png',
+					selectedIconPath: 'static/images/common/top@2x.png'
+				})
+			}
+			uni.setTabBarItem({
+				index: 0,
+				text: '货源',
+				iconPath: 'static/images/common/huoyuan@2x(1).png',
+				selectedIconPath: 'static/images/common/huoyuan@2x.png'
+			})
 			var that=this
 			that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 				reCommonId: this.userInfo.id,

+ 12 - 0
pages/riders/index.vue

@@ -189,6 +189,18 @@
 		},
 		created() {},
 		onShow() {
+			uni.setTabBarItem({
+				index: 0,
+				text: '货源',
+				iconPath: 'static/images/common/huoyuan@2x(1).png',
+				selectedIconPath: 'static/images/common/huoyuan@2x.png'
+			})
+			uni.setTabBarItem({
+				index: 2,
+				text: '订单',
+				iconPath: 'static/images/common/dingdan@2x(1).png',
+				selectedIconPath: 'static/images/common/dingdan@2x.png'
+			})
 			if (uni.getStorageSync("sendInfo")) { //从缓存中获取  上一次的装车地 卸车地
 				this.sendInfo = uni.getStorageSync("sendInfo")
 				this.title1 = this.sendInfo.sendProvince + this.sendInfo.sendCity + this.sendInfo.sendArea