XSLu08042 2 months ago
parent
commit
650095138e

+ 10 - 1
App.vue

@@ -117,7 +117,8 @@
 	// @import 'animate.css';
 	@import "uview-ui/index.scss";
 	@import './assets/iconfont/iconfont.css';
-	@import './assets/css/common.less';
+	// @import './assets/css/common.less';
+	
 	page{
 		background-color: #f6f6f6;
 	}
@@ -127,6 +128,14 @@
 	    
 	}
 </style>
+<style lang="less">
+	@import './assets/css/common.less';
+	/*引入全局补充样式*/
+	@import './assets/css/czy/es.1.base.css';
+	@import './assets/css/czy/es.2.color.css';
+	@import './assets/css/czy/es.3.icon.css';
+	@import './assets/css/czy/es.4.view.css';
+</style>
 <style>
 	/*每个页面公共css */
 	/* 解决小程序和app滚动条的问题 */

+ 8 - 1
api/adv.js

@@ -3,4 +3,11 @@ let request = new Request().http
  export function getAdv(data) {
  	 return request('/app/adv/getAdv',data,'GET');
  }
- 
+// 课程adv
+  export function getAdvList(data) {
+ 	 return request('/app/adv/getAdvList',data,'GET');
+  }
+// 课程adv
+  export function getAppAdvList() {
+  	 return request('/app/adv/getAppAdvList',null,'GET');
+  }

+ 18 - 0
assets/css/common.less

@@ -260,3 +260,21 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
 		transform: translate(-50%,-50%);
 	}
 }
+
+.flex{
+	flex: 1;
+}
+
+.textOne {
+overflow: hidden;
+white-space: nowrap;
+text-overflow: ellipsis;
+}
+
+.textTwo {
+overflow: hidden;
+text-overflow: ellipsis;
+display: -webkit-box;
+-webkit-line-clamp: 2;
+-webkit-box-orient: vertical;
+}

+ 4 - 4
common/request.js

@@ -2,9 +2,8 @@
 export default class Request {
 	http(router, data = {}, method,contentType) {
 		let that = this;
-		//let path = 'http://localhost:7014';
-		// let path = 'https://work.natappvip.cc'
-		let path = 'http://1.95.39.2:7005';
+		let path = 'http://admin.ylrztop.com:7005'
+		// let path = 'http://1.95.39.2:7005';
 		//云联融智
 		// let path = 'https://userapp.his.cdwjyyh.com';
 		// let path = 'https://userapp.zhengzefeng.com';
@@ -31,7 +30,7 @@ export default class Request {
 				data: data,
 				method: method,
 				success: (res) => {
-					console.log(res)
+					// console.log(res)
 					//收到开发者服务器成功返回的回调函数
 					if(res.data.code==401){//没有权限直接退出到登录界面
 						let pages = getCurrentPages();
@@ -68,6 +67,7 @@ export default class Request {
 					//接口调用失败的回调函数
 				},
 				complete:(res) =>{
+					console.log("complete=======",router,res,data)
 					//接口调用结束的回调函数(调用成功、失败都会执行)
 					if (res.code == 401) {
 						return false

+ 15 - 4
components/tabbar/tabbar.vue

@@ -2,7 +2,7 @@
 	<view class="tabbar align-center" >
 		<view v-for="(item, index) in tabbarList" :key="index" @click="switchTabs(item)" 
 		class="tablist" v-if="item.isshowed">
-			<view class=" tabbar-list"  >
+			<view class="tabbar-list"  >
 				<image :src="actindex==index?item.selectedIconPath:item.iconPath"></image>
 				<text class="fs24 base-textcol"
 				 :class="actindex==index?'actcolor':'morecolor'">{{item.Text}}</text>
@@ -72,6 +72,13 @@
 						url: '/pages/home/index',
 						isshowed:true
 					},
+					{
+						iconPath: "/static/images/ENCYCLOPEDIA.png",
+						selectedIconPath: "/static/images/ENCYCLOPEDIA_on.png",
+						Text: '学习',
+						url: '/pages/course/index',
+						isshowed:true
+					},
 					{
 						iconPath: "/static/images/ENCYCLOPEDIA.png",
 						selectedIconPath: "/static/images/ENCYCLOPEDIA_on.png",
@@ -109,8 +116,9 @@
 		right: 0;
 		background-color: #fff;
 		z-index: 1000;
-		height: 100rpx;
-		padding: 20rpx 0rpx;
+		height: 50px;
+		// padding: 20rpx 0rpx;
+		box-sizing: border-box;
 		image{
 			margin-bottom: 4rpx;
 			width: 48rpx;
@@ -128,9 +136,12 @@
 		color: #018C39;
 	}
 	.tabbar-list{
+		height: 100%;
 		display: flex;
 		flex-direction: column;
 		align-items: center;
-		font-size: 24rpx
+		justify-content: center;
+		font-size: 10px;
+		text-align: center;
 	}
 </style>

+ 15 - 12
main.js

@@ -1,26 +1,29 @@
 import Vue from 'vue'
 import App from './App'
 
-import { showLoginPage } from './utils/login.js'
+import {
+	showLoginPage
+} from './utils/login.js'
 Vue.config.productionTip = false
 
 import uView from 'uview-ui'
 Vue.use(uView)
 // uni.$u.config.unit = 'rpx'
-  
+
 import utils from './utils/common.js'
 Vue.prototype.utils = utils;
- 
-import {setData} from './utils/common.js'
+
+import {
+	setData
+} from './utils/common.js'
 Vue.prototype.setData = setData;
- Vue.prototype.$showLoginPage = showLoginPage;
- 
+Vue.prototype.$showLoginPage = showLoginPage;
+Vue.prototype.$navTo = utils.navTo;
+Vue.prototype.$checkToken = utils.checkToken;
+Vue.prototype.$isEmpty = utils.isEmpty
+
 App.mpType = 'app'
 const app = new Vue({
-    ...App
+	...App
 })
-app.$mount()
-
-
- 
- 
+app.$mount()

+ 1 - 0
manifest.json

@@ -5,6 +5,7 @@
     "versionName" : "1.0.1",
     "versionCode" : 101,
     "transformPx" : false,
+	"sassImplementationName": "node-sass",
     /* 5+App特有相关 */
     "app-plus" : {
         "usingComponents" : true,

+ 242 - 1
pages.json

@@ -35,6 +35,20 @@
 				}
 			}
 		},
+		{
+			"path": "pages/course/index",
+			"style": {
+				"navigationBarTitleText": "学习",
+		        "enablePullDownRefresh": false,
+		        "navigationStyle": "custom",
+				"app-plus": {
+					"titleNView": true
+				},
+				"tabBar": {
+				  "show": false  // 隐藏当前页面的TabBar
+				}
+			}
+		},
 		// {
   //           "path" : "pages/home/doctorCase",
   //           "style" :                                                                                    
@@ -1178,13 +1192,234 @@
 				 }
 				 
 			]
+		},
+		{
+			"root": "pages_course",
+			"pages": [
+				{
+				    "path" : "famousHall",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarBackgroundColor":"#018C39",
+				        "navigationBarTextStyle":"black",
+				        "scrollIndicator": "none",
+				        "bounce": "none",
+				        "titleNView": false,
+				        "navigationBarTitleText": "",
+				        "enablePullDownRefresh": false,
+				        "backgroundColor": "#f7f7f7",
+				        "backgroundColorTop":"#ffffff",
+				        "navigationStyle": "custom"
+				    }
+				},
+				{
+					"path" : "learning",
+					"style" : 
+					{
+						"navigationBarBackgroundColor":"#018C39",
+						"navigationBarTextStyle":"white",
+						"scrollIndicator": "none",
+						"bounce": "none",
+						"titleNView": false,
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": false,
+						"backgroundColor": "#f7f7f7",
+						"backgroundColorTop":"#ffffff",
+						"navigationStyle": "custom"
+					}
+				},
+				{
+					"path": "note",
+					"style": {
+						"navigationBarTitleText": "笔记",
+						"navigationStyle": "custom",
+						"scrollIndicator": "none",
+						"bounce": "none",
+						"titleNView": false,
+						"enablePullDownRefresh": false,
+						"backgroundColor": "#f7f7f7",
+						"backgroundColorTop":"#ffffff"
+					}
+				},
+				{
+					"path": "noteList",
+					"style": {
+						"navigationBarTitleText": "学习笔记",
+						"navigationBarTextStyle":"black",
+						"navigationStyle": "custom",
+						"scrollIndicator": "none",
+						"bounce": "none",
+						"titleNView": false,
+						"enablePullDownRefresh": false,
+						"backgroundColor": "#f7f7f7",
+						"backgroundColorTop":"#ffffff"
+					}
+				},
+				{
+					"path" : "myNote",
+					"style" : 
+					{
+						"navigationBarTitleText": "我的笔记",
+						"navigationStyle": "custom",
+						"scrollIndicator": "none",
+						"bounce": "none",
+						"titleNView": false,
+						"enablePullDownRefresh": false,
+						"backgroundColor": "#f7f7f7",
+						"backgroundColorTop":"#ffffff"
+					}
+				},
+				{
+					"path": "catalogue",
+					"style": {
+						"navigationBarTitleText": "目录",
+						"navigationStyle": "custom",
+						"scrollIndicator": "none",
+						"bounce": "none",
+						"titleNView": false,
+						"enablePullDownRefresh": false,
+						"backgroundColor": "#f7f7f7",
+						"backgroundColorTop":"#ffffff"
+					}
+				},
+				{
+					"path" : "studyCenter/courseCollect",
+					"style": {
+						"navigationBarTitleText": "课程收藏",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff",
+						"app-plus": {
+							"titleNView": {
+								"buttons": [
+									{
+										"fontSize": "15px",
+										"width": "60px",
+										"text": "管理"
+									}
+								]
+							}
+						}
+					}
+				},
+				{
+					"path" : "studyCenter/orderList",
+					"style" : 
+					{
+						"navigationBarTitleText" : "我的订单",
+						"navigationBarTextStyle": "black",
+						"navigationBarBackgroundColor": "#ffffff"
+						}
+				},
+				{
+					"path": "info",
+					"style": {
+						"navigationBarTitleText": "课程详情",
+						"navigationBarTextStyle":"black",
+						"navigationStyle": "custom",
+						"scrollIndicator": "none",
+						"bounce": "none",
+						"titleNView": false,
+						"enablePullDownRefresh": false,
+						"backgroundColor": "#f7f7f7",
+						"backgroundColorTop":"#ffffff",
+						"app-plus": {  
+							"titleNView": false,  //不启用系统导航
+							"screenOrientation" : [
+								//可选,字符串数组类型,应用支持的横竖屏
+								"portrait-primary", //可选,字符串类型,支持竖屏
+								"portrait-secondary", //可选,字符串类型,支持反向竖屏
+								"landscape-primary", //可选,字符串类型,支持横屏
+								"landscape-secondary" //可选,字符串类型,支持反向横屏
+							],
+							"subNVues":[{  
+								"id": "privilege", // 唯一标识  
+								"path":"privilege", // 页面路径  
+								"type":"popup",
+									"style": {  
+										"position": "absolute",
+										 "bottom": "0",
+										 "left": "0",
+										 "width": "100%",  
+										 "height": "100%",  
+										 "mask":"rgba(0,0,0,0.5)",
+										 "background": "transparent",
+										 "border-top-left-radius": "20px",
+										 "border-top-right-radius": "20px"
+									}  
+								}
+								,{
+									"id": "commentN", // 唯一标识  
+									"path":"commentN", // 页面路径  
+									"type":"popup",
+									"style": {  
+											"position": "absolute",
+											 "bottom": "0",
+											 "left": "0",
+											 "width": "100%",  
+											 "height": "85%",  
+											 "mask":"rgba(0,0,0,0.5)",
+											 "background": "transparent",
+											 "border-top-left-radius": "20px",
+											 "border-top-right-radius": "20px"
+									}  
+								  }
+								  ,{
+									"id": "catalogueN", // 唯一标识  
+									"path":"catalogueN", // 页面路径  
+									"type":"popup",
+									"style": {  
+											"position": "absolute",
+											 "bottom": "0",
+											 "left": "0",
+											 "width": "100%",  
+											 "height": "85%",  
+											 "mask":"rgba(0,0,0,0.5)",
+											 "background": "transparent",
+											 "border-top-left-radius": "20px",
+											 "border-top-right-radius": "20px"
+										}  
+									},
+									// {
+									// 	"id": "courseVideo",
+									// 	"path": "pages/course/courseVideo", // 课程详情视频
+									// 	"style": {
+									// 		"position": "absolute", 
+									// 		"width": "100%",
+									// 		"height": "422rpx",
+									// 		"left":"0",
+									// 		"top":"0"
+									// 	}
+									// },
+									{
+										"id": "videoPopup",
+										"path": "videoPopup", // 配置弹窗
+										"type":"popup",
+										"style": {
+											"position": "absolute",
+											"bottom": "0",
+											"left": "0",
+											"width": "100%",
+											"height": "100%",
+											"mask":"rgba(0,0,0,0.6)",
+											"background": "rgba(0,0,0,0.6)"
+										}
+									}
+							]  
+						} 
+						
+					}
+				}
+			]
 		}
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "云联商城",
 		"navigationBarBackgroundColor": "#FFFFFF",
-		"backgroundColor": "#FFFFFF"
+		"backgroundColor": "#FFFFFF",
+		"app-plus": {
+		   "bounce": "none" //关闭窗口回弹效果
+		 }
 	},
 	"tabBar": {
 		"color": "#666666",
@@ -1202,6 +1437,12 @@
 				"selectedIconPath": "/static/images/home_on.png",
 				"text": "首页"
 			},
+			{
+				"pagePath": "pages/course/index",
+				"iconPath": "/static/images/home.png",
+				"selectedIconPath": "/static/images/home_on.png",
+				"text": "学习"
+			},
 			{
 				"pagePath": "pages/healthy/index",
 				"iconPath": "/static/images/ENCYCLOPEDIA.png",

+ 1 - 1
pages/healthy/idea.vue

@@ -28,7 +28,7 @@
 		<view class="btn-box">
 			<view class="sub-btn" @click="addDoc">创建健康档案</view>
 		</view>
-		<tabbar actindex="2"></tabbar>
+		<tabbar actindex="3"></tabbar>
 	</view>
 </template>
 

+ 2 - 2
pages/healthy/index.vue

@@ -29,7 +29,7 @@
 			</view>
 		</view>
 		<!-- 知识列表 -->
-		<mescroll-body  :top="top"  ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
+		<mescroll-body  :top="top" bottom="50px"  ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
 			<view class="know-list">
 				<view class="item" v-for="(item,index) in dataList" :key="index" @click="showDetail(item)">
 					<view class="left">
@@ -55,7 +55,7 @@
 				</view>
 			</view>
 		</mescroll-body>
-		<tabbar :actindex="1"></tabbar>
+		<tabbar :actindex="2"></tabbar>
 	</view>
 </template>
 

+ 0 - 1
pages/home/new/test.vue

@@ -119,7 +119,6 @@
 			this.tempId=option.tempId;
 			var that=this;
 			uni.$on('refreshOrderPatient', (res) => {
-				console.log("qxj data:"+JSON.stringify(res))
 				that.patient=res;
 			})
 			

+ 2 - 2
pages/home/new/testDetails.vue

@@ -45,7 +45,7 @@
 		},
 		//发送给朋友
 		onShareAppMessage(res) {
-			if(this.$isLogin()){
+			if(this.$checkToken()){
 				return {
 					title: "健康自测",
 					path: '/pages_index/testDetails?tempId='+this.tempId,
@@ -75,7 +75,7 @@
 						url:'/pages/auth/login'
 					})
 				}
-				// this.$isLogin().then(
+				// this.$checkToken().then(
 				// 	res => {
 				// 		console.log(res)
 				// 		if(res){

+ 5 - 2
pages/shopping/confirmCreateOrder.vue

@@ -299,7 +299,7 @@
 					});
 					return;
 				}
-				
+				// #ifdef MP-WEIXIN
 				uni.requestSubscribeMessage({
 					tmplIds: this.temps,
 					success(res) {
@@ -309,7 +309,10 @@
 						that.createOrder();
 					}
 				})
-				
+				// #endif
+				// #ifndef MP-WEIXIN
+				this.createOrder();
+				// #endif
 			},
 			createOrder(){
 				var that=this;

+ 5 - 1
pages/shopping/confirmOrder.vue

@@ -302,7 +302,7 @@
 					});
 					return;
 				}
-				
+				// #ifdef MP-WEIXIN
 				uni.requestSubscribeMessage({
 					tmplIds: this.temps,
 					success(res) {
@@ -312,6 +312,10 @@
 						that.createOrder();
 					}
 				})
+				// #endif
+				// #ifndef MP-WEIXIN
+				this.createOrder();
+				// #endif
 				
 			},
 			createOrder(){

+ 1 - 1
pages/shopping/index.vue

@@ -62,7 +62,7 @@
 				</view>
 			</view>
 		</view>
-		<tabbar :actindex="2"></tabbar>
+		<tabbar :actindex="3"></tabbar>
 	</view>
 </template>
 

+ 23 - 29
pages/shopping/prescribe.vue

@@ -345,42 +345,20 @@
 				 			 	title:res.msg,
 				 			 });
 							 var order =res.order;
+							 // #ifdef MP-WEIXIN
 							 uni.requestSubscribeMessage({
 							 	tmplIds: this.temps,
 							 	success(res) {
-									setTimeout(function(){
-										if(order.paid!=1){
-											uni.redirectTo({
-												url: './paymentOrder?orderId='+that.order.id
-											})
-										}
-										else{
-											uni.navigateBack({  
-												delta: 1
-											});
-											
-										}
-										
-									},500);
+									this.goPage(order)
 							 	},
 							 	fail(res) {
-							 		setTimeout(function(){
-										if(order.paid!=1){
-											uni.redirectTo({
-												url: './paymentOrder?orderId='+that.order.id
-											})
-										}
-										else{
-											uni.navigateBack({  
-												delta: 1
-											});
-											
-										}
-							 			 
-							 		},500);
+							 		this.goPage(order)
 							 	}
 							 })
-							 
+							 // #endif
+							 // #ifndef MP-WEIXIN
+							 this.goPage(order)
+							 // #endif
 				 			
 				 		}else{
 				 			uni.showToast({
@@ -393,6 +371,22 @@
 				 );
 				
 			},
+			goPage(order) {
+				setTimeout(function(){
+					if(order.paid!=1){
+						uni.redirectTo({
+							url: './paymentOrder?orderId='+that.order.id
+						})
+					}
+					else{
+						uni.navigateBack({  
+							delta: 1
+						});
+						
+					}
+					 
+				},500);
+			},
 			getPatientList(){
 			 	uni.showLoading({
 			 		title:"正在加载中"

+ 5 - 3
pages/user/index.vue

@@ -179,7 +179,7 @@
 			</view>
 			
 		</view>
-		<tabbar :actindex="3"></tabbar>
+		<tabbar :actindex="4"></tabbar>
 	</view>
 </template>
 
@@ -224,7 +224,7 @@
 		},
 		onReachBottom() {
 			console.log("onReachBottom")
-			this.$refs.product.getGoodsProducts();
+			// this.$refs.product.getGoodsProducts();
 		},
 		methods: {
 			geticons(){
@@ -343,14 +343,16 @@
 			position: absolute;
 			top: 0;
 			left: 0;
+			z-index: -1;
 		}
 		.top-inner{
 			width: 100%;
-			height: 100%;
+			// height: 100%;
 			position: absolute;
 			top: 0;
 			left: 0;
 			z-index: 2;
+			padding-bottom: 24rpx;
 			.user-info{
 				padding: 88upx 30upx 0 30upx;
 				display: flex;

+ 0 - 1
pages_index/index/test.vue

@@ -119,7 +119,6 @@
 			this.tempId=option.tempId;
 			var that=this;
 			uni.$on('refreshOrderPatient', (res) => {
-				console.log("qxj data:"+JSON.stringify(res))
 				that.patient=res;
 			})
 			

+ 2 - 2
pages_index/index/testDetails.vue

@@ -45,7 +45,7 @@
 		},
 		//发送给朋友
 		onShareAppMessage(res) {
-			if(this.$isLogin()){
+			if(this.$checkToken()){
 				return {
 					title: "健康自测",
 					path: '/pages_index/testDetails?tempId='+this.tempId,
@@ -75,7 +75,7 @@
 						url:'/pages/auth/login'
 					})
 				}
-				// this.$isLogin().then(
+				// this.$checkToken().then(
 				// 	res => {
 				// 		console.log(res)
 				// 		if(res){

+ 5 - 2
pages_shopping/shopping/confirmPackageOrder.vue

@@ -256,7 +256,7 @@
 					});
 					return;
 				}
-				
+				// #ifdef MP-WEIXIN
 				uni.requestSubscribeMessage({
 					tmplIds: this.temps,
 					success(res) {
@@ -266,7 +266,10 @@
 						that.createPackageOrder();
 					}
 				})
-				
+				// #endif
+				// #ifndef MP-WEIXIN
+				that.createPackageOrder();
+				// #endif
 				
 			},
 			createPackageOrder(){

+ 245 - 228
utils/common.js

@@ -1,245 +1,244 @@
-import {checkLogin} from '@/api/user'
+import {
+	checkLogin
+} from '@/api/user'
 import dayjs from 'dayjs'
-var isEmpty =function(obj) {
+var isEmpty = function(obj) {
 	if (typeof obj == "undefined" || obj == null || obj == "") {
 		return true;
 	} else {
 		return false;
 	}
 }
- 
-var checkToken= function() {
+
+var checkToken = function() {
 	var token = uni.getStorageSync('AppToken');
-	if (token==null||token==undefined||token=="" ) {
+	if (token == null || token == undefined || token == "") {
 		return false;
-	} 
+	}
 	return true;
 }
 
-
-var isLogin=  function() {
+var isLogin = function() {
 	return new Promise((resolve, reject) => {
 		checkLogin().then(
 			res => {
-				if(res.code==200){
+				if (res.code == 200) {
 					resolve(true);
-				}else{
+				} else {
 					resolve(false);
 				}
 			},
-			rej => { }
+			rej => {}
 		);
 	});
-	 
+
 }
 
-var loginOut= function() {
-	  uni.setStorageSync('AppToken',null);
-	  uni.setStorageSync('userInfo',null);
+var loginOut = function() {
+	uni.setStorageSync('AppToken', null);
+	uni.setStorageSync('userInfo', null);
 }
-var checkLoginState= function() {
+var checkLoginState = function() {
 	var token = uni.getStorageSync('AppToken');
-	if (token ) {
+	if (token) {
 		return true
 	} else {
 		return false
 	}
 }
 
-var getDictLabelName= function(key,dictValue) {
-	if(dictValue==null){
+var getDictLabelName = function(key, dictValue) {
+	if (dictValue == null) {
 		return "";
 	}
 	var dicts = uni.getStorageSync('dicts');
-	dicts=JSON.parse(dicts);
-	var dict=dicts[key]
-	var name="";
+	dicts = JSON.parse(dicts);
+	var dict = dicts[key]
+	var name = "";
 	dict.forEach(function(item, index, array) {
-		 if(dictValue.toString()==item.dictValue.toString())
-		 {
-			 name=item.dictLabel
-		 }
+		if (dictValue.toString() == item.dictValue.toString()) {
+			name = item.dictLabel
+		}
 	});
 	return name;
 }
-var getDict= function(key) {
+var getDict = function(key) {
 	var dicts = uni.getStorageSync('dicts');
-	dicts=JSON.parse(dicts);
-	var dict=dicts[key]
+	dicts = JSON.parse(dicts);
+	var dict = dicts[key]
 	return dict;
 }
 
-var subString=function(str){
+var subString = function(str) {
 	if (str.length > 4) {
-	   return str.slice(0, 4)+"...";
+		return str.slice(0, 4) + "...";
 	}
-	console.log("qxj subString:"+str);
+	console.log("qxj subString:" + str);
 	return str;
 }
 
 
-var photosToArr= function(photoUrl) {
-	 var photos=[];
-	 if(photoUrl!=null&&photoUrl!=''){
-		 photos=photoUrl.split(',');
-	 }
-	 return photos
+var photosToArr = function(photoUrl) {
+	var photos = [];
+	if (photoUrl != null && photoUrl != '') {
+		photos = photoUrl.split(',');
+	}
+	return photos
 }
 
-var dateFormat=function dateFormat(fmt, date) {
-    let ret;
-    const opt = {
-        "Y+": date.getFullYear().toString(),        // 年
-        "m+": (date.getMonth() + 1).toString(),     // 月
-        "d+": date.getDate().toString(),            // 日
-        "H+": date.getHours().toString(),           // 时
-        "M+": date.getMinutes().toString(),         // 分
-        "S+": date.getSeconds().toString()          // 秒
-        // 有其他格式化字符需求可以继续添加,必须转化成字符串
-    };
-    for (let k in opt) {
-        ret = new RegExp("(" + k + ")").exec(fmt);
-        if (ret) {
-            fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
-        };
-    };
-    return fmt;
+var dateFormat = function dateFormat(fmt, date) {
+	let ret;
+	const opt = {
+		"Y+": date.getFullYear().toString(), // 年
+		"m+": (date.getMonth() + 1).toString(), // 月
+		"d+": date.getDate().toString(), // 日
+		"H+": date.getHours().toString(), // 时
+		"M+": date.getMinutes().toString(), // 分
+		"S+": date.getSeconds().toString() // 秒
+		// 有其他格式化字符需求可以继续添加,必须转化成字符串
+	};
+	for (let k in opt) {
+		ret = new RegExp("(" + k + ")").exec(fmt);
+		if (ret) {
+			fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
+		};
+	};
+	return fmt;
 }
 
 var getProvider = service => {
-  return new Promise((resolve, reject) => {
-    // 获取当前环境的服务商
-    uni.getProvider({
-      service: service || 'oauth',
-      success: function (res) {
-        // 此处可以排除h5
-        if (res.provider) {
-          resolve(res.provider[0])
-        }
-      },
-      fail() {
-        reject('获取环境服务商失败')
-      },
-    })
-  }).catch(error => {
-    console.log('167', error)
-  })
+	return new Promise((resolve, reject) => {
+		// 获取当前环境的服务商
+		uni.getProvider({
+			service: service || 'oauth',
+			success: function(res) {
+				// 此处可以排除h5
+				if (res.provider) {
+					resolve(res.provider[0])
+				}
+			},
+			fail() {
+				reject('获取环境服务商失败')
+			},
+		})
+	}).catch(error => {
+		console.log('167', error)
+	})
 }
- 
- var handleTree=function handleTree(data, id, parentId, rootId) {
- 	id = id || 'id'
- 	parentId = parentId || 'parentId'
- 	rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
- 	//对源数据深度克隆
- 	const cloneData = JSON.parse(JSON.stringify(data))
- 	//循环所有项
- 	const treeData = cloneData.filter(father => {
- 		let branchArr = cloneData.filter(child => {
- 			//返回每一项的子级数组
- 			return father[id] === child[parentId]
- 		});
- 		branchArr.length > 0 ? father.child = branchArr : '';
- 		//返回第一层
- 		return father[parentId] === rootId;
- 	});
- 	return treeData != '' ? treeData : data;
- }
-var parsePhone=function parsePhone(mobile) {
-    var str = mobile.substr(0,3)+"****"+mobile.substr(7);
-    return str;
+
+var handleTree = function handleTree(data, id, parentId, rootId) {
+	id = id || 'id'
+	parentId = parentId || 'parentId'
+	rootId = rootId || Math.min.apply(Math, data.map(item => {
+		return item[parentId]
+	})) || 0
+	//对源数据深度克隆
+	const cloneData = JSON.parse(JSON.stringify(data))
+	//循环所有项
+	const treeData = cloneData.filter(father => {
+		let branchArr = cloneData.filter(child => {
+			//返回每一项的子级数组
+			return father[id] === child[parentId]
+		});
+		branchArr.length > 0 ? father.child = branchArr : '';
+		//返回第一层
+		return father[parentId] === rootId;
+	});
+	return treeData != '' ? treeData : data;
 }
-var parseIdCard=function parseIdCard(idCard) {
-    var str = idCard.substr(0,4)+"****"+idCard.substr(8);
-    return str;
+var parsePhone = function parsePhone(mobile) {
+	var str = mobile.substr(0, 3) + "****" + mobile.substr(7);
+	return str;
 }
- 
+var parseIdCard = function parseIdCard(idCard) {
+	var str = idCard.substr(0, 4) + "****" + idCard.substr(8);
+	return str;
+}
+
 //格式为"1990-01-01"
-var getAge=function getAge(strBirthday){       
-    var returnAge,
-   		strBirthdayArr=strBirthday.split("-"),
-    	birthYear = strBirthdayArr[0],
-    	birthMonth = strBirthdayArr[1],
-    	birthDay = strBirthdayArr[2],  
-   	 	d = new Date(),
-    	nowYear = d.getFullYear(),
-    	nowMonth = d.getMonth() + 1,
-    	nowDay = d.getDate();   
-    if(nowYear == birthYear){
-        returnAge = 0;//同年 则为0周岁
-    }
-    else{
-        var ageDiff = nowYear - birthYear ; //年之差
-        if(ageDiff > 0){
-            if(nowMonth == birthMonth) {
-                var dayDiff = nowDay - birthDay;//日之差
-                if(dayDiff < 0) {
-                    returnAge = ageDiff - 1;
-                }else {
-                    returnAge = ageDiff;
-                }
-            }else {
-                var monthDiff = nowMonth - birthMonth;//月之差
-                if(monthDiff < 0) {
-                    returnAge = ageDiff - 1;
-                }
-                else {
-                    returnAge = ageDiff ;
-                }
-            }
-        }else {
-            returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天
-        }
-    } 
-    return returnAge;//返回周岁年龄
+var getAge = function getAge(strBirthday) {
+	var returnAge,
+		strBirthdayArr = strBirthday.split("-"),
+		birthYear = strBirthdayArr[0],
+		birthMonth = strBirthdayArr[1],
+		birthDay = strBirthdayArr[2],
+		d = new Date(),
+		nowYear = d.getFullYear(),
+		nowMonth = d.getMonth() + 1,
+		nowDay = d.getDate();
+	if (nowYear == birthYear) {
+		returnAge = 0; //同年 则为0周岁
+	} else {
+		var ageDiff = nowYear - birthYear; //年之差
+		if (ageDiff > 0) {
+			if (nowMonth == birthMonth) {
+				var dayDiff = nowDay - birthDay; //日之差
+				if (dayDiff < 0) {
+					returnAge = ageDiff - 1;
+				} else {
+					returnAge = ageDiff;
+				}
+			} else {
+				var monthDiff = nowMonth - birthMonth; //月之差
+				if (monthDiff < 0) {
+					returnAge = ageDiff - 1;
+				} else {
+					returnAge = ageDiff;
+				}
+			}
+		} else {
+			returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
+		}
+	}
+	return returnAge; //返回周岁年龄
 }
 
-var clearHisSearch= function() {
- 	var searchList=[];
- 	uni.setStorageSync("hisSearch",JSON.stringify(searchList));
- }
- var getHisSearch= function() {
- 	var search = uni.getStorageSync('hisSearch');
- 	if(search!=null&&search!=undefined&&search!=""){
- 		var search=JSON.parse(search);
- 		return search;
- 	}
-	else{
-		var data=[];
+var clearHisSearch = function() {
+	var searchList = [];
+	uni.setStorageSync("hisSearch", JSON.stringify(searchList));
+}
+var getHisSearch = function() {
+	var search = uni.getStorageSync('hisSearch');
+	if (search != null && search != undefined && search != "") {
+		var search = JSON.parse(search);
+		return search;
+	} else {
+		var data = [];
 		return data;
-	} 
- 	
- }
- var addHisSearch= function(searchVal) {
- 	var search = uni.getStorageSync('hisSearch');
-	var searchList=[];
-	if(search!=null&&search!=undefined&&search!=""){
-		searchList=JSON.parse(search);
-		
+	}
+
+}
+var addHisSearch = function(searchVal) {
+	var search = uni.getStorageSync('hisSearch');
+	var searchList = [];
+	if (search != null && search != undefined && search != "") {
+		searchList = JSON.parse(search);
+
 	}
 	searchList.push(searchVal);
 	//去复
 	const uniqueArr = [...new Set(searchList)];
-	uni.setStorageSync("hisSearch",JSON.stringify(uniqueArr));
- }
+	uni.setStorageSync("hisSearch", JSON.stringify(uniqueArr));
+}
 
 
-var parseTime= function(num){//时间戳数据处理
-         let date = new Date(num*1000);
-        //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-        let y = date.getFullYear();
-        let MM = date.getMonth() + 1;
-        MM = MM < 10 ? ('0' + MM) : MM;//月补0
-        let d = date.getDate();
-        d = d < 10 ? ('0' + d) : d;//天补0
-        let h = date.getHours();
-        h = h < 10 ? ('0' + h) : h;//小时补0
-        let m = date.getMinutes();
-        m = m < 10 ? ('0' + m) : m;//分钟补0
-        let s = date.getSeconds();
-        s = s < 10 ? ('0' + s) : s;//秒补0
-        return y + '-' + MM + '-' + d + ' ' + h + ':' + m+ ':' + s;
+var parseTime = function(num) { //时间戳数据处理
+	let date = new Date(num * 1000);
+	//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+	let y = date.getFullYear();
+	let MM = date.getMonth() + 1;
+	MM = MM < 10 ? ('0' + MM) : MM; //月补0
+	let d = date.getDate();
+	d = d < 10 ? ('0' + d) : d; //天补0
+	let h = date.getHours();
+	h = h < 10 ? ('0' + h) : h; //小时补0
+	let m = date.getMinutes();
+	m = m < 10 ? ('0' + m) : m; //分钟补0
+	let s = date.getSeconds();
+	s = s < 10 ? ('0' + s) : s; //秒补0
+	return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
 
-}   
+}
 // var setData= function(obj){
 // 	 let that = this;
 // 	 let keys = [];
@@ -260,7 +259,7 @@ var parseTime= function(num){//时间戳数据处理
 // 		 })
 // 	 });
 //  }
-var setData= function(obj){
+var setData = function(obj) {
 	let that = this;
 	const handleData = (tepData, tepKey, afterKey) => {
 		var tepData2 = tepData;
@@ -310,40 +309,39 @@ var setData= function(obj){
 	});
 
 }
- const urlToObj = function(url) {
-   let obj = {}
-   let str = url.slice(url.indexOf('?') + 1)
-   let arr = str.split('&')
-   for (let j = arr.length, i = 0; i < j; i++) {
-     let arr_temp = arr[i].split('=')
-     obj[arr_temp[0]] = arr_temp[1]
-   }
-   return obj
- }
- var checkCompanyUserLoginState= function() {
- 	var token = uni.getStorageSync('CompanyUserToken');
- 	if (token ) {
- 		return true
- 	} else {
- 		return false
- 	}
- }
- 
+const urlToObj = function(url) {
+	let obj = {}
+	let str = url.slice(url.indexOf('?') + 1)
+	let arr = str.split('&')
+	for (let j = arr.length, i = 0; i < j; i++) {
+		let arr_temp = arr[i].split('=')
+		obj[arr_temp[0]] = arr_temp[1]
+	}
+	return obj
+}
+var checkCompanyUserLoginState = function() {
+	var token = uni.getStorageSync('CompanyUserToken');
+	if (token) {
+		return true
+	} else {
+		return false
+	}
+}
+
 
 /**
  * 格式化时间
  * @param {Object} 时间字符串
  */
-var formatDate=function(dateStr) {
+var formatDate = function(dateStr) {
 
-	let date = dayjs(dateStr,'YYYY-MM-DD HH:mm:ss');
+	let date = dayjs(dateStr, 'YYYY-MM-DD HH:mm:ss');
 	let today = dayjs();
 
 	let formatStr = "";
 	if (date.year() != today.year()) {
 		formatDate = date.format('YYYY-MM-DD HH:mm');
-	} 
-	else if (date.month() === today.month()) {
+	} else if (date.month() === today.month()) {
 		switch (date.date() - today.date()) {
 			case 0:
 				formatDate = date.format('今天 HH:mm');
@@ -358,40 +356,59 @@ var formatDate=function(dateStr) {
 				formatDate = date.format('MM-DD HH:mm');
 				break;
 		}
-	} 
-	else if (date.month() - today.month() === 0 && date.date() === 1) {
+	} else if (date.month() - today.month() === 0 && date.date() === 1) {
 		formatDate = date.format('明天 HH:mm');
-	} 
-	else {
+	} else {
 		formatDate = date.format('MM-DD HH:mm');
 	}
 	return formatDate;
 }
 
+function navTo(url) {
+	console.log("跳转",url)
+	uni.navigateTo({
+		url: url
+	});
+}
+
+function formatSeconds(seconds) {  
+    const hours = Math.floor(seconds / 3600);
+	const minutes = Math.floor((seconds % 3600) / 60);
+	const secs = seconds % 60;
+	if(seconds<60){
+		return [minutes,secs].map(unit => String(unit).padStart(2, '0')).join(':');
+	}
+	else if(seconds>=60 && seconds<3600){
+		return [minutes, secs].map(unit => String(unit).padStart(2, '0')).join(':');
+	}else{
+		return [hours, minutes, secs].map(unit => String(unit).padStart(2, '0')).join(':');
+	}
+ };
+ 
 module.exports = {
-		formatDate:formatDate,
-        isEmpty : isEmpty,
-		checkLoginState : checkLoginState,
-		getDictLabelName:getDictLabelName,
-		photosToArr:photosToArr,
-		dateFormat:dateFormat,
-		getProvider:getProvider,
-		isLogin:isLogin,
-		checkToken:checkToken,
-		loginOut:loginOut,
-		handleTree:handleTree,
-		parsePhone:parsePhone,
-		getAge:getAge,
-		parseIdCard:parseIdCard,
-		getDict:getDict,
-		addHisSearch:addHisSearch,
-		clearHisSearch:clearHisSearch,
-		getHisSearch:getHisSearch,
-		parseTime:parseTime,
-		setData:setData,
-		urlToObj:urlToObj,
-		subString:subString,
-		checkCompanyUserLoginState:checkCompanyUserLoginState
-		
-		
+	formatDate: formatDate,
+	isEmpty: isEmpty,
+	checkLoginState: checkLoginState,
+	getDictLabelName: getDictLabelName,
+	photosToArr: photosToArr,
+	dateFormat: dateFormat,
+	getProvider: getProvider,
+	isLogin: isLogin,
+	checkToken: checkToken,
+	loginOut: loginOut,
+	handleTree: handleTree,
+	parsePhone: parsePhone,
+	getAge: getAge,
+	parseIdCard: parseIdCard,
+	getDict: getDict,
+	addHisSearch: addHisSearch,
+	clearHisSearch: clearHisSearch,
+	getHisSearch: getHisSearch,
+	parseTime: parseTime,
+	setData: setData,
+	urlToObj: urlToObj,
+	subString: subString,
+	checkCompanyUserLoginState: checkCompanyUserLoginState,
+	navTo:navTo,
+	formatSeconds
 };