xuhaolan 4 năm trước cách đây
mục cha
commit
abd0232d42
37 tập tin đã thay đổi với 2867 bổ sung665 xóa
  1. 9 3
      App.vue
  2. 115 30
      api/index.js
  3. 1 1
      components/introduce/introduce.vue
  4. 212 0
      components/uni-collapse-item/uni-collapse-item.vue
  5. 54 0
      components/uni-collapse/uni-collapse.vue
  6. 7 2
      main.js
  7. 4 3
      manifest.json
  8. 98 1
      package-lock.json
  9. 27 17
      pages.json
  10. 113 52
      pages/about/about.vue
  11. 161 127
      pages/case/case.vue
  12. 425 53
      pages/index/index.vue
  13. 211 35
      pages/news/news.vue
  14. 0 8
      pages/news/newsDetail.vue
  15. 595 118
      pages/test/test.vue
  16. 32 0
      public/index.html
  17. BIN
      static/images/info001.png
  18. BIN
      static/images/info002.png
  19. BIN
      static/images/info003.png
  20. BIN
      static/img/map.png
  21. 1 1
      store/index.js
  22. 8 0
      uni_modules/uni-load-more/changelog.md
  23. 21 0
      uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
  24. 82 0
      uni_modules/uni-load-more/package.json
  25. 70 0
      uni_modules/uni-load-more/readme.md
  26. 3 3
      unpackage/dist/dev/app-plus/app-service.js
  27. 467 142
      unpackage/dist/dev/app-plus/app-view.js
  28. BIN
      unpackage/dist/dev/app-plus/static/images/images001.png
  29. BIN
      unpackage/dist/dev/app-plus/static/images/images002.png
  30. BIN
      unpackage/dist/dev/app-plus/static/images/images003.png
  31. BIN
      unpackage/dist/dev/app-plus/static/images/info001.png
  32. BIN
      unpackage/dist/dev/app-plus/static/images/info002.png
  33. BIN
      unpackage/dist/dev/app-plus/static/images/info003.png
  34. 99 0
      utils/loginUtils.js
  35. 9 35
      utils/newRequest.js
  36. 11 34
      utils/request.js
  37. 32 0
      utils/time.js

+ 9 - 3
App.vue

@@ -22,14 +22,16 @@ export default {
 </script>
 
 <style lang="scss">
+	/*全局公共样式和字体图标*/
+	@import "uview-ui/index.scss";
+	@import '/static/css/cmy.css';
 .uni-tabbar__item{
 	&.active{
 		background: #127FD5 !important;
 	}
 }
-/*全局公共样式和字体图标*/
-@import '/static/css/cmy.css';
-		@import "uview-ui/index.scss";
+
+		
 view,
 scroll-view,
 swiper,
@@ -62,6 +64,10 @@ video {
 	padding: 20rpx 0;
 	border-radius: 8rpx;
 }
+.botton-box{
+	
+	height: 132rpx;
+}
 
 /* 图片载入替代方案 */
 .image-wrapper {

+ 115 - 30
api/index.js

@@ -1,34 +1,119 @@
 import request from '@/utils/request'
 
-// //获取首页信息
-// export function banner(data) {
-// 	return request({
-// 		url: '/api/index',
-// 		method: 'get',
-// 		data
-// 	});
-// }
-// // 获取文章列表
-// export function category(data,cid) {
-// 	return request({
-// 		url: '/api/article/list/'+cid ,
-// 		method: 'get',
-// 		data
-// 	});
-// }
-// // 获取文章详情
-// export function details(data,id) {
-// 	return request({
-// 		url: '/api/article/details/' + id ,
-// 		method: 'get',
-// 		data
-// 	})
-// }
-//提交表单
-export function addForm(data){
-	return request({
-		url:'/apis/form',
-		method:'post',
+// 获取首页数据1
+export function loadIndexs(data) {
+	return request({
+		url: '/apis/index',
+		method: 'get',
+		data
+	});
+}
+// aboutlist
+export function aboutlist(data) {
+	return request({
+		url: '/apis/about',
+		method: 'get',
+		data
+	});
+}
+//提交表单1
+export function addForm(data) {
+	return request({
+		url: '/apis/form',
+		method: 'post',
 		data
 	})
-}
+}
+// articlelist公司介绍列表1
+export function articlelist(data) {
+	return request({
+		url: '/apis/article',
+		method: 'get',
+		data
+	});
+}
+//公司介绍详情1
+export function articleDetail(data, id) {
+	return request({
+		url: '/apis/article/' + id,
+		method: 'get',
+		data
+	});
+}
+
+// caseslist案例列表
+export function caseslist(data) {
+	return request({
+		url: '/apis/cases',
+		method: 'get',
+		data
+	});
+}
+
+export function newslist(data) {
+	return request({
+		url: '/apis/story',
+		method: 'get',
+		data
+	});
+}
+export function newsDetail(data,id) {
+	return request({
+		url: '/apis/story/'+id,
+		method: 'get',
+		data
+	});
+}
+
+export function casesDetail(data, id) {
+	return request({
+		url: '/apis/cases/' + id,
+		method: 'get',
+		data
+	});
+}
+export function storylist(data) {
+	return request({
+		url: '/apis/story',
+		method: 'get',
+		data
+	});
+}
+export function productlist(data) {
+	return request({
+		url: '/apis/product',
+		method: 'get',
+		data
+	});
+}
+export function productDetail(data,id) {
+	return request({
+		url: '/apis/product/'+ id,
+		method: 'get',
+		data
+	});
+}
+// 获取设备信息
+export function machine(data,id) {
+	return request({
+		url: '/apis/machine/'+id,
+		method: 'get',
+		data
+	});
+}
+// 获取设备信息数据展示
+export function machineId(data,id) {
+	return request({
+		url: '/apis/machine/'+id,
+		method: 'get',
+		data
+	});
+}
+// 获取公司列表
+export function companies(data) {
+	return request({
+		url: '/apis/companies',
+		method: 'get',
+		data
+	});
+}

+ 1 - 1
components/introduce/introduce.vue

@@ -27,7 +27,7 @@
 	//(是在用到这个组件时的页面这样做) 如果有data数据,封装,需要在上放html中声明一下  例:data{1,2,3,45}   html:<view :data = "data"></view>
 	}
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 	.aboutUs {
 		position: relative;
 		display: flex;

+ 212 - 0
components/uni-collapse-item/uni-collapse-item.vue

@@ -0,0 +1,212 @@
+<template>
+	<view :class="{ 'uni-collapse-cell--disabled': disabled,'uni-collapse-cell--notdisabled': !disabled, 'uni-collapse-cell--open': isOpen,'uni-collapse-cell--hide':!isOpen }"
+	 class="uni-collapse-cell">
+		<view class="uni-collapse-cell__title" @click="onClick">
+			<image v-if="thumb" :src="thumb" class="uni-collapse-cell__title-img" />
+			<text class="uni-collapse-cell__title-text">{{ title }}</text>
+			<!-- #ifdef MP-ALIPAY -->
+			<view :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }"
+			 class="uni-collapse-cell__title-arrow">
+				<uni-icons color="#bbb" size="20" type="arrowdown" />
+			</view>
+			<!-- #endif -->
+			<!-- #ifndef MP-ALIPAY -->
+			<uni-icons :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }"
+			 class="uni-collapse-cell__title-arrow" color="#bbb" size="20" type="arrowdown" />
+			<!-- #endif -->
+		</view>
+		<view :class="{'uni-collapse-cell__content--hide':!isOpen}" class="uni-collapse-cell__content">
+			<view :class="{ 'uni-collapse-cell--animation': showAnimation === true }" class="uni-collapse-cell__wrapper" :style="{'transform':isOpen?'translateY(0)':'translateY(-50%)','-webkit-transform':isOpen?'translateY(0)':'translateY(-50%)'}">
+				<slot />
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import uniIcons from '../uni-icons/uni-icons.vue'
+	export default {
+		name: 'UniCollapseItem',
+		components: {
+			uniIcons
+		},
+		props: {
+			title: {
+				// 列表标题
+				type: String,
+				default: ''
+			},
+			name: {
+				// 唯一标识符
+				type: [Number, String],
+				default: 0
+			},
+			disabled: {
+				// 是否禁用
+				type: Boolean,
+				default: false
+			},
+			showAnimation: {
+				// 是否显示动画
+				type: Boolean,
+				default: false
+			},
+			open: {
+				// 是否展开
+				type: Boolean,
+				default: false
+			},
+			thumb: {
+				// 缩略图
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				isOpen: false
+			}
+		},
+		watch: {
+			open(val) {
+				this.isOpen = val
+			}
+		},
+		inject: ['collapse'],
+		created() {
+			this.isOpen = this.open
+			this.nameSync = this.name ? this.name : this.collapse.childrens.length
+			this.collapse.childrens.push(this)
+			if (String(this.collapse.accordion) === 'true') {
+				if (this.isOpen) {
+					let lastEl = this.collapse.childrens[this.collapse.childrens.length - 2]
+					if (lastEl) {
+						this.collapse.childrens[this.collapse.childrens.length - 2].isOpen = false
+					}
+				}
+			}
+		},
+		methods: {
+			onClick() {
+				if (this.disabled) {
+					return
+				}
+				if (String(this.collapse.accordion) === 'true') {
+					this.collapse.childrens.forEach(vm => {
+						if (vm === this) {
+							return
+						}
+						vm.isOpen = false
+					})
+				}
+				this.isOpen = !this.isOpen
+				this.collapse.onChange && this.collapse.onChange()
+				this.$forceUpdate()
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import '@/uni.scss';
+
+	.uni-collapse-cell {
+		flex-direction: column;
+		border-color: $uni-border-color;
+		border-bottom-width: 1px;
+		border-bottom-style: solid;
+	}
+
+
+	.uni-collapse-cell--hover {
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-collapse-cell--open {
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-collapse-cell--disabled {
+		background-color: $uni-bg-color-hover;
+		// opacity: 0.3;
+	}
+
+
+	.uni-collapse-cell--hide {
+		height: 48px;
+	}
+
+	.uni-collapse-cell--animation {
+		// transition: transform 0.3s ease;
+		transition-property: transform;
+		transition-duration: 0.3s;
+		transition-timing-function: ease;
+	}
+
+	.uni-collapse-cell__title {
+		padding: 12px 12px;
+		position: relative;
+		/* #ifndef APP-NVUE */
+		display: flex;
+		width: 100%;
+		box-sizing: border-box;
+		/* #endif */
+		height: 48px;
+		line-height: 24px;
+		flex-direction: row;
+		justify-content: space-between;
+		align-items: center;
+	}
+
+	.uni-collapse-cell__title:active {
+		background-color: $uni-bg-color-hover;
+	}
+
+	.uni-collapse-cell__title-img {
+		height: $uni-img-size-base;
+		width: $uni-img-size-base;
+		margin-right: 10px;
+	}
+
+	.uni-collapse-cell__title-arrow {
+		width: 20px;
+		height: 20px;
+		transform: rotate(0deg);
+		transform-origin: center center;
+
+	}
+
+	.uni-collapse-cell__title-arrow-active {
+		transform: rotate(180deg);
+	}
+
+	.uni-collapse-cell__title-text {
+		flex: 1;
+		font-size: $uni-font-size-base;
+		/* #ifndef APP-NVUE */
+		white-space: nowrap;
+		color: inherit;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		lines: 1;
+		/* #endif */
+		overflow: hidden;
+		text-overflow: ellipsis;
+	}
+
+	.uni-collapse-cell__content {
+		overflow: hidden;
+	}
+
+	.uni-collapse-cell__wrapper {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+	}
+
+	.uni-collapse-cell__content--hide {
+		height: 0px;
+		line-height: 0px;
+	}
+</style>

+ 54 - 0
components/uni-collapse/uni-collapse.vue

@@ -0,0 +1,54 @@
+<template>
+	<view class="uni-collapse">
+		<slot />
+	</view>
+</template>
+<script>
+	export default {
+		name: 'UniCollapse',
+		props: {
+			accordion: {
+				// 是否开启手风琴效果
+				type: [Boolean, String],
+				default: false
+			}
+		},
+		data() {
+			return {}
+		},
+		provide() {
+			return {
+				collapse: this
+			}
+		},
+		created() {
+			this.childrens = []
+		},
+		methods: {
+			onChange() {
+				let activeItem = []
+				this.childrens.forEach((vm, index) => {
+					if (vm.isOpen) {
+						activeItem.push(vm.nameSync)
+					}
+				})
+				this.$emit('change', activeItem)
+			}
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	@import '@/uni.scss';
+
+	.uni-collapse {
+		/* #ifndef APP-NVUE */
+		width: 100%;
+		display: flex;
+		/* #endif */
+		/* #ifdef APP-NVUE */
+		flex: 1;
+		/* #endif */
+		flex-direction: column;
+		background-color: $uni-bg-color;
+	}
+</style>

+ 7 - 2
main.js

@@ -1,8 +1,13 @@
 import Vue from 'vue'
-import uView from "uview-ui";
-Vue.use(uView);
 import store from './store'
 import App from './App'
+import uView from "uview-ui";
+Vue.prototype.$store = store
+// import BaiduMap from 'vue-baidu-map'
+Vue.use(VueBaiduMap, {
+  ak: 'BPOdSO7lNQ45sOHr4veYGsqEkxYApB0x'    //这个地方是官方提供的ak密钥
+})
+Vue.use(uView);
 /**
  *  所有测试用数据均存放于根目录json.js
  *  

+ 4 - 3
manifest.json

@@ -72,13 +72,14 @@
             "proxy" : {
                 "/api" : {
                     // "target" : "http://js.frp.liuniu946.com/api",
-                    "target" : "http://www.babido.cn/api",
+                    "target" : "http://tianli.liuniu946.com/apis",
                     // "changeOrigin": true,
                     "pathRewrite" : {
-                        "/api" : "" // rewrite path
+                        "/apis" : "" // rewrite path
                     }
                 }
             }
-        }
+        },
+        "template" : "public/index.html"
     }
 }

+ 98 - 1
package-lock.json

@@ -1,3 +1,100 @@
 {
-  "lockfileVersion": 1
+  "requires": true,
+  "lockfileVersion": 1,
+  "dependencies": {
+    "argparse": {
+      "version": "1.0.10",
+      "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+      "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+      "requires": {
+        "sprintf-js": "~1.0.2"
+      }
+    },
+    "bmaplib.curveline": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/bmaplib.curveline/-/bmaplib.curveline-1.0.0.tgz",
+      "integrity": "sha512-9wcFMVhiYxNPqpvsLDAADn3qDhNzXp2mA6VyHSHg2XOAgSooC7ZiujdFhy0sp+0QYjTfJ/MjmLuNoUg2HHxH4Q=="
+    },
+    "bmaplib.heatmap": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/bmaplib.heatmap/-/bmaplib.heatmap-1.0.4.tgz",
+      "integrity": "sha512-rmhqUARBpUSJ9jXzUI2j7dIOqnc38bqubkx/8a349U2qtw/ulLUwyzRD535OrA8G7w5cz4aPKm6/rNvUAarg/Q=="
+    },
+    "bmaplib.lushu": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/bmaplib.lushu/-/bmaplib.lushu-1.0.7.tgz",
+      "integrity": "sha512-LVvgpESPii6xGxyjnQjq8u+ic4NjvhdCPV/RiSS/PGTUdZKeTDS7prSpleJLZH3ES0+oc0gYn8bw0LtPYUSz2w=="
+    },
+    "bmaplib.markerclusterer": {
+      "version": "1.0.13",
+      "resolved": "https://registry.npmjs.org/bmaplib.markerclusterer/-/bmaplib.markerclusterer-1.0.13.tgz",
+      "integrity": "sha512-VrLyWSiuDEVNi0yUfwOhFQ6z1oEEHS4w36GNu3iASu6p52QIx9uAXMUkuSCHReNR0bj2Cp9SA1dSx5RpojXajQ==",
+      "requires": {
+        "bmaplib.texticonoverlay": "^1.0.2"
+      }
+    },
+    "bmaplib.texticonoverlay": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/bmaplib.texticonoverlay/-/bmaplib.texticonoverlay-1.0.2.tgz",
+      "integrity": "sha512-4ZTWr4ZP3B6qEWput5Tut16CfZgII38YwM3bpyb4gFTQyORlKYryFp9WHWrwZZaHlOyYDAXG9SX0hka43jTADg=="
+    },
+    "entities": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+      "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
+    },
+    "linkify-it": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz",
+      "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==",
+      "requires": {
+        "uc.micro": "^1.0.1"
+      }
+    },
+    "markdown-it": {
+      "version": "8.4.2",
+      "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
+      "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==",
+      "requires": {
+        "argparse": "^1.0.7",
+        "entities": "~1.1.1",
+        "linkify-it": "^2.0.0",
+        "mdurl": "^1.0.1",
+        "uc.micro": "^1.0.5"
+      }
+    },
+    "mdurl": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
+      "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
+    },
+    "sprintf-js": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
+    },
+    "uc.micro": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
+      "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
+    },
+    "uview-ui": {
+      "version": "1.8.3",
+      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.3.tgz",
+      "integrity": "sha512-DqKc+qRrOZLPcyfWv4b0HspSS9n1Cd6BbgKiYEv9rjTAnWoqJV7rXsvWqZdr5iKGP5EMNbNS741GLNw4sIHbpw=="
+    },
+    "vue-baidu-map": {
+      "version": "0.21.22",
+      "resolved": "https://registry.npmjs.org/vue-baidu-map/-/vue-baidu-map-0.21.22.tgz",
+      "integrity": "sha512-WQMPCih4UTh0AZCKKH/OVOYnyAWjfRNeK6BIeoLmscyY5aF8zzlJhz/NOHLb3mdztIpB0Z6aohn4Jd9mfCSjQw==",
+      "requires": {
+        "bmaplib.curveline": "^1.0.0",
+        "bmaplib.heatmap": "^1.0.4",
+        "bmaplib.lushu": "^1.0.7",
+        "bmaplib.markerclusterer": "^1.0.13",
+        "markdown-it": "^8.4.0"
+      }
+    }
+  }
 }
+

+ 27 - 17
pages.json

@@ -7,7 +7,11 @@
 			"style": {
 				"navigationBarTitleText": "首页",
 				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTextStyle": "black",
+				"navigationStyle":"custom",
+				"app-plus":{
+				"titleView":false
+				}
 				//      "app-plus":{
 				// "titleNView":false  //去掉app+h5顶部导航
 				//      }
@@ -18,7 +22,11 @@
 			"style": {
 				"navigationBarTitleText": "新闻动态",
 				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTextStyle": "black",
+				"navigationStyle":"custom",
+				"app-plus":{
+				"titleView":false
+				}
 				//      "app-plus":{
 				// "titleNView":false  //去掉app+h5顶部导航
 				//      }
@@ -29,7 +37,11 @@
 			"style": {
 				"navigationBarTitleText": "案例展示",
 				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTextStyle": "black",
+				"navigationStyle":"custom",
+				"app-plus":{
+				"titleView":false
+				}
 				//      "app-plus":{
 				// "titleNView":false  //去掉app+h5顶部导航
 				//      }
@@ -40,7 +52,11 @@
 			"style": {
 				"navigationBarTitleText": "关于我们",
 				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTextStyle": "black",
+				"navigationStyle":"custom",
+				"app-plus":{
+				"titleView":false
+				}
 				//      "app-plus":{
 				// "titleNView":false  //去掉app+h5顶部导航
 				//      }
@@ -51,25 +67,19 @@
 			"style": {
 				"navigationBarTitleText": "节水测试",
 				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
+				"navigationBarTextStyle": "black",
+				"navigationStyle":"custom",
+				"app-plus":{
+				"titleView":false
+				}
 				//      "app-plus":{
 				// "titleNView":false  //去掉app+h5顶部导航
 				//      }
 			}
 
-		},
-		{
-			"path": "pages/news/newsDetail",
-			"style": {
-				"navigationBarTitleText": "新闻动态1",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
-				//      "app-plus":{
-				// "titleNView":false  //去掉app+h5顶部导航
-				//      }
-			}
-		
 		}
+		
+		
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 113 - 52
pages/about/about.vue

@@ -18,36 +18,45 @@
 			</view>
 
 		</view>
-		<swiper :current="currentIndex" :duration="500">
+		<swiper :current="currentIndex" :duration="1000" style="height: 1000rpx;">
 			<swiper-item>
-				<view class="swiper-item">
-					000000
+				<!-- v-html="gsjj.content" -->
+				<view class="swiper-item" v-html="gsjj.content">
+
 				</view>
 			</swiper-item>
 			<swiper-item>
-				<view class="swiper-item">
-					11111111111
+				<view class="swiper-item" v-html="products.content">
 				</view>
 			</swiper-item>
 			<swiper-item>
 				<view class="swiper-item swiperRight">
 
 					<view class="swiperRight-img">
-						<image src="../../static/img/introduce.png" mode=""></image>
-						<text>咨询电话:xxxxxxxx</text>
-						<text>报修电话:xxxxxxxx</text>
+						<image src="../../static/img/map.png" mode=""></image>
+					</view>
+					<view class="text">
+						<text>咨询热线:xxxxxxxxxx</text>
+						<text>报修电话:xxxxxxxxxx</text>
 					</view>
-
 				</view>
+
 			</swiper-item>
 		</swiper>
-		<aboutUs></aboutUs>
+
+		<aboutUs class="aboutUs"></aboutUs>
 	</view>
 </template>
 <script>
 	import {
-		changeTaber
+		changeTaber,
 	} from '@/utils/tarberChange.js'
+	import {
+		articleDetail,
+		articlelist,
+		productlist,
+		productDetail
+	} from '@/api/index.js'
 	import aboutUs from '@/components/introduce/introduce.vue'
 	export default {
 		components: {
@@ -64,12 +73,19 @@
 				page: 1,
 				limit: 10,
 				currentIndex: 0,
+				gsjj: {},
+				products: {}
 			}
 		},
 		onLoad() {
 			// this.loadData();
-			changeTaber(1)
+			this.$nextTick(function(){
+				changeTaber(1)
+			})
+			this.getGsjj(2)
+			this.getproducts(3)
 		},
+		
 		methods: {
 			async loadData() {
 				const obj = this;
@@ -82,12 +98,36 @@
 			qiehuan(index) {
 				console.log(index)
 				this.currentIndex = index * 1;
+			},
+			getGsjj(id) {
+				articleDetail({}, id).then(res => {
+					console.log(res, "111111")
+					this.gsjj = res.data
+				}).catch(err => {
+					this.gsjj = err.data
+
+					console.log(err, 'cuoww')
+				})
+			},
+			getproducts(id) {
+				productDetail({}, id).then(res => {
+					console.log(res, "111111")
+					this.products = res.data
+				}).catch(err => {
+					this.products = err.data
+
+					console.log(err, 'cuoww')
+				})
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
+	page {
+		height: 100%;
+	}
+
 	.img {
 		margin: 17rpx 0 17rpx 41rpx;
 		width: 208rpx;
@@ -98,6 +138,7 @@
 			height: 100%;
 		}
 	}
+
 	.test_title {
 		display: flex;
 		justify-content: center;
@@ -111,37 +152,38 @@
 		background-color: #0165B5;
 	}
 
-	.class-box {
-		background: #FFFFFF;
-		white-space: nowrap;
-		height: 78rpx;
-
-		.item {
-			text-align: center;
-			display: inline-block;
-			color: $font-color-base;
-			margin: 26rpx 34rpx 15rpx 29rpx;
-			background-color: #ffffff;
-			line-height: 1;
-
-			.time {
-				font-family: PingFang SC;
-				font-weight: bold;
-				font-size: 30rpx;
-				padding-bottom: 19rpx;
-
-				&.action {
-					color: #ff0000;
-					border-bottom: 4rpx solid #FF0000;
-				}
-			}
-		}
-	}
+	// .class-box {
+	// 	background: #FFFFFF;
+	// 	white-space: nowrap;
+	// 	height: 78rpx;
+
+	// .item {
+	// 	text-align: center;
+	// 	display: inline-block;
+	// 	color: $font-color-base;
+	// 	margin: 26rpx 34rpx 15rpx 29rpx;
+	// 	background-color: #ffffff;
+	// 	line-height: 1;
+
+	// 	.time {
+	// 		font-family: PingFang SC;
+	// 		font-weight: bold;
+	// 		font-size: 30rpx;
+	// 		padding-bottom: 19rpx;
+
+	// 		&.action {
+	// 			color: #ff0000;
+	// 			border-bottom: 4rpx solid #FF0000;
+	// 		}
+	// 	}
+	// }
+
 	.aboutBox {
 		display: flex;
 		justify-content: space-between;
 		width: 100%;
 		height: 60rpx;
+
 		.aboutBox-title {
 			display: flex;
 			justify-content: center;
@@ -155,27 +197,46 @@
 			line-height: 67rpx;
 		}
 	}
-	.swiperRight{
+
+	.swiper-item {}
+
+	.swiperRight {
+		margin-top: 140rpx;
 		display: flex;
 		flex-direction: column;
-		justify-content: center;
+
 		align-items: center;
-		.swiperRight-img{
-			margin-top:40rpx ;
+
+		.swiperRight-img {
+
 			width: 560rpx;
-			height: 270rpx;
-			image{
+			height: 266rpx;
+
+			image {
 				width: 100%;
 				height: 100%;
 			}
 		}
-		text{
-			font-size: 10rpx;
-			font-family: Adobe Heiti Std;
-			font-weight: normal;
-			color: #000000;
-			line-height: 40rpx;
-		}
+
+
+	}
+
+	.text {
+		margin-top: 80rpx;
+		display: flex;
+		flex-direction: column;
+		font-size: 10rpx;
+		font-family: Adobe Heiti Std;
+		font-weight: normal;
+		color: #000000;
+		line-height: 40rpx;
+	}
+
+	.aboutUs {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		margin-bottom: 100rpx;
 	}
-	
 </style>

+ 161 - 127
pages/case/case.vue

@@ -6,28 +6,30 @@
 		<view class="test_title">
 			案例展示
 		</view>
-		<view class="box">
-
-
-			<view class="caseBox" v-for="(item,index) in list">
+		<view class="box" v-if="isShow">
+			<view class="caseBox" v-for="(item,index) in caseList" @click="nav(item.id)">
 				<view class="caseBox-img">
-					<image :src="item.src" mode=""></image>
+					<image :src="imgUrl+item.coverimage" mode=""></image>
 				</view>
 				<view class="caseBox-right">
 					<view class="title">
 						{{item.title}}
 					</view>
 					<view class="date">
-						{{item.date}}
+						{{item.createtime}}
 					</view>
 					<view class="content">
-						{{item.content}}
+						{{item.synopsis}}
 					</view>
 				</view>
 			</view>
-		</view>
-		<view class="pagInation">
-			<!-- prevText	String	上一页	左侧按钮文字
+			<view class="tishi" v-if="isShowtishi">
+				已加载全部数据~~
+			</view>
+
+
+			<view class="pagInation">
+				<!-- prevText	String	上一页	左侧按钮文字
 			     nextText	String	下一页	右侧按钮文字
                  current	Number	1	当前页
                  total	Number	0	数据总量
@@ -35,10 +37,17 @@
                  showIcon	Boolean	false	是否以 icon 形式展示按钮 
 				 @change	点击页码按钮时触发	e={type,current} current为当前页,
 				 type值为:next/prev,表示点击的是上一页还是下一个-->
-			<!-- 	<uni-pagination title="标题文字" prevText="" nextText="" pageSize="10" total="20" @change="" ></uni-pagination> -->
-			<!-- <uni-pagination title="标题文字" show-icon="true" total="50" current="2"></uni-pagination> -->
-			<uni-pagination @change="handlePage" show-icon="true" :total="postCount" :current="pageNum"
-				:pageSize="pageSize"></uni-pagination>
+				<!-- 	<uni-pagination title="标题文字" prevText="" nextText="" pageSize="10" total="20" @change="" ></uni-pagination> -->
+				<!-- <uni-pagination title="标题文字" show-icon="true" total="50" current="2"></uni-pagination> -->
+				
+
+					<uni-pagination class="pagination" prevText="上一页" nextText="下一页" @change="handlePage"
+						show-icon="false" :total="total" :current="pageNum" :pageSize="pageSize"></uni-pagination>
+
+			
+			</view>
+		</view>
+		<view class="xianqingye" v-html="caseDetail.content" v-else>
 		</view>
 		<aboutUs class="aboutUs"></aboutUs>
 	</view>
@@ -48,6 +57,13 @@
 	import {
 		changeTaber
 	} from '@/utils/tarberChange.js'
+	import {
+		caseslist,
+		casesDetail
+	} from '@/api/index.js'
+	import {
+		getTime
+	} from '@/utils/time.js'
 	import aboutUs from '@/components/introduce/introduce.vue'
 	export default {
 		components: {
@@ -55,97 +71,85 @@
 		},
 		data() {
 			return {
-				// title: '',
-				// src: '',
-				// date: '',
-				// content: '',
-				postCount: 0,
-				pageSize: 1,
-				pageNum: 1,
-				list: [{
-					title: '1大家谁都',
-					src: "../../static/img/introduce.png",
-					date: '2021-06-08 16:26',
-					content: 'qwenanckajnckjsanjknscjkanskjcnaskjncakjsncjka1111111111111111111111111111111111111'
-				}, {
-					title: '1大家谁都',
-					src: "../../static/img/introduce.png",
-					date: '2021-06-08 16:26',
-					content: 'qwenanckajnckjsanjknscjkanskjcnaskjncakjsncjka'
-				}],
+				isShowtishi: false, //false不展示
+				isShow: true,
+				imgUrl: 'http://tianli.liuniu946.com',
+				caseList: [],
+				caseCid: 27,
+				// limit:,
+				// page:1,
+				total: '', //数据总量
+				pageSize: 5, //每页数据量
+				pageNum: 1, //当前页
+				caseDetail: {}
 			}
 		},
 
 		onLoad() {
 			// this.loadData();
+			// this.handlePage()
 			changeTaber(2)
+			this.getCaseList()
 		},
 		methods: {
 			async loadData() {
-				// uni.request({
-				// 	url: '',
-				// 	method: 'GET',
-				// 	data: {},
-				// 	success: res => {},
-				// 	fail: () => {},
-				// 	complete: () => {}
-				// });
 				const obj = this;
 			},
-			getPostListInfo(pageIndex) {
-				console.log('pageIndex:' + pageIndex);
-				uni.request({
-					url: common.website_url + '/cnblogs/getPersonalBlogPostList/' + pageIndex,
-					method: 'POST',
-					success: res => {
-						console.log('isSuccess');
-						console.log('getPostListInfo:' + JSON.stringify(res.data));
-						this.list = res.data;
-					},
-					fail: function(e) {
-						console.log('接口调用失败:' + JSON.stringify(e));
-					}
-				});
-			},
+			handlePage(params) {
+				console.log(params)
+				this.pageNum = params.current;
 
-			getPersonalBlogInfo() {
-				uni.request({
-					url: common.website_url + '/cnblogs/getPersonalBlogInfo',
-					method: 'POST',
-					success: res => {
-						//console.log('getPersonalBlogInfo:' + JSON.stringify(res.data));
-						this.postCount = res.data.postCount;
-						this.pageSize = res.data.pageSize;
-					},
-					fail: function(e) {
-						console.log('接口调用失败:' + JSON.stringify(e));
+				this.getCaseList()
+			},
+			//获取案例
+			getCaseList() {
+				let obj = this
+				caseslist({
+					category_id: obj.caseCid,
+					page: obj.pageNum,
+					limit: obj.pageSize
+				}).then(({
+					data
+				}) => {
+					data.list.forEach(e => {
+						e.createtime = getTime(e.createtime)
+					})
+					console.log(data, '111111')
+					obj.caseList = data.list
+					obj.total = data.count
+					if (data.list.length < 5) {
+						this.isShowtishi = true
+					} else {
+						this.isShowtishi = false
 					}
-				});
+				})
 			},
-			getDetail(Title, Id, Url) {
-				console.log('Title:' + Title + '  Id:' + Id);
-
-				uni.navigateTo({
-					url: '../post/post/post?Title=' + Title + '&Id=' + Id
-				});
+			//大概,
+			nav(id) {
+				this.isShow = false;
+				casesDetail({}, id).then(res => {
+					console.log(res, "111111")
+					this.caseDetail = res.data
+					// }).catch(err => {
+					// 	this.gsjj = err.data
+					// 	console.log("2222222222")
+					// 	console.log(err, 'cuoww')
+					// })
+				})
 			},
-			handlePage(params) {
-				var pageIndex = params.current;
-
-				console.log('this.pageNum:' + pageIndex);
-
-				this.getPostListInfo(pageIndex);
-			}
-
 
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
+	page {
+		height: 100%;
+
+	}
+
 	.center {
 		height: 100%;
-		
 	}
 
 	.img {
@@ -162,7 +166,17 @@
 	.aboutUs {
 		width: 100%;
 		position: fixed;
+		left: 0;
+		bottom: 0;
+		margin-bottom: 100rpx;
+	}
 
+	.tishi {
+		font-size: 16rpx;
+		font-family: Adobe Heiti Std;
+		font-weight: normal;
+		color: #C7C9D1;
+		line-height: 101px;
 	}
 
 	.test_title {
@@ -177,63 +191,83 @@
 		color: #FFFFFF;
 		background-color: #0165B5;
 	}
-.box{
-	display: flex;
-	flex-direction: column;
-	
-	align-items: center;
-	.caseBox {
-		margin-top: 20rpx;
+
+	.box {
 		display: flex;
-		
+		flex-direction: column;
 		align-items: center;
-		width: 90%;
-		height: 100%;
 
-		.caseBox-img {
-			width: 240rpx;
-			height: 160rpx;
 
-			image {
-				width: 100%;
-				height: 100%;
+			.pagination {
+				position: fixed;
+				bottom: 0;
+				left: 0;
+				bottom:232rpx;
 			}
-		}
+		
 
-		.caseBox-right {
-			margin-left: 40rpx;
+		.caseBox {
+			margin-top: 20rpx;
+			display: flex;
+			align-items: center;
+			width: 90%;
+			height: 100%;
 
-			.title {
-				margin-top: -40rpx;
-				font-size: 18rpx;
-				font-family: Adobe Heiti Std;
-				font-weight: normal;
-				color: #535962;
-			
-			}
+			.caseBox-img {
+				flex-shrink: 1;
+				width: 240rpx;
+				height: 160rpx;
 
-			.date {
-				font-size: 11rpx;
-				font-family: Adobe Heiti Std;
-				font-weight: normal;
-				color: #A1A1A1;
-				line-height: 20rpx;
+				image {
+					width: 100%;
+					height: 100%;
+				}
 			}
 
-			.content {
-				font-size: 15rpx;
-				font-family: Adobe Heiti Std;
-				font-weight: normal;
-				color: #A1A1A1;
-				line-height: 46rpx;
-				max-width: 400rpx;
-				overflow: hidden;
-				text-overflow: ellipsis;
-				white-space: nowrap;
+			.caseBox-right {
+				margin-left: 30rpx;
+				width: 440rpx;
+				display: flex;
+				flex-direction: column;
+
+
+				.title {
+					margin-top: -70rpx;
+					font-size: 18rpx;
+					font-family: Adobe Heiti Std;
+					font-weight: normal;
+					color: #535962;
+					max-width: 420rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+
+				}
+
+				.date {
+					margin-top: 10rpx;
+					font-size: 11rpx;
+					font-family: Adobe Heiti Std;
+					font-weight: normal;
+					color: #A1A1A1;
+					line-height: 20rpx;
+				}
+
+				.content {
+					font-size: 15rpx;
+					font-family: Adobe Heiti Std;
+					font-weight: normal;
+					color: #A1A1A1;
+					line-height: 46rpx;
+					max-width: 420rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+				}
 			}
 		}
 	}
-	}
+
 
 	// .uni-pagination__child-btn{
 

+ 425 - 53
pages/index/index.vue

@@ -7,13 +7,9 @@
 		<view class="carousel-section">
 			<view class="carousel-box">
 				<swiper class="carousel" autoplay="true" interval="5000" duration="500">
-					<swiper-item v-for="(item,index) in carouselList " class="carousel-item" :key="index"
-						@click="nav(item)">
-						<image :src="item.pic" />
+					<swiper-item v-for="(item,index) in carouselList " class="carousel-item" :key="index">
+						<image :src="item" />
 					</swiper-item>
-					
-					
-					
 				</swiper>
 			</view>
 		</view>
@@ -24,27 +20,104 @@
 				更多>>
 			</view>
 		</view>
-		<view class="teachingPrinciple">
-			<view class="teachingPrinciple_img">
-				<image src="../../static/img/introduce.png" mode=""></image>
+		<!-- <view class="teachingPrinciple" v-html="gsjj.content"> -->
+		<!-- <view class="teachingPrinciple_img">
+				<image :src='gsjj.coverimage'  mode=""></image>
 			</view>
-			<text>台州市添利节能科技有限公司是专注于电镀行业节能减排尖端设备研发和技术服务的企业多年来为国内多家电镀企业进行技术改造,截止2021年1月累计节水量达到200多万吨,节水经济效益1.17亿元平均节水效率45%。</text>
+			<text>{{gsjj.content}}</text> -->
+		<!-- </view> -->
+		<view class="gsjj" v-html="gsjj.content">
+			<!-- ooooooooooooooooooo -->
 		</view>
+		<!-- 节水实时数据 -->
 		<view class="introduce" @click="navto('/pages/test/test')">
 			节水实时数据
 			<view class="more">
 				物联网登录>>
 			</view>
 		</view>
+
+		<view class="swiper-item">
+			<!-- 数据看板 -->
+			<!-- <view class="title1"><text class="tit">数据看板</text></view> -->
+			<view class="map">
+				<view class="mapbox" v-if="mapLoding&&showMap">
+					<baidu-map @click="onAction" @zoomend="zoomendChange" @movestart="onAction(false)"
+						@moveend="onAction" class="map-mian" @ready="init" :min-zoom="0" :max-zoom="20">
+						<bm-navigation anchor="BMAP_ANCHOR_BOTTOM_RIGHT" class="bm-marker1"></bm-navigation>
+						<bm-marker class="bm-marker" v-for="item in companyList" :position="{
+								lng: item.longtitude,
+								lat: item.lattitude
+							}" animation="BMAP_ANIMATION_BOUNCE" @click="showData(item)">
+							<bm-label v-if="zoomActive >= 15" :content="item.name" :labelStyle="item.style"
+								:offset="item.textType" />
+						</bm-marker>
+					</baidu-map>
+					<view class="map-info">
+						<view class="map2">
+							<view class="map-icon">
+								<image src="../../static/images/info001.png" mode=""></image>
+							</view>
+							<view class="map-2">
+								<view class="info2">合作企业(家)</view>
+								<view class="num2">
+									<text class="tit1">{{ machineData.machine_company_num }}</text>
+								</view>
+							</view>
+						</view>
+						<view class="map2">
+							<view class="map-icon">
+								<image src="../../static/images/info002.png" mode=""></image>
+							</view>
+							<view class="map-2">
+								<view class="info2">用水总量(万吨)</view>
+								<view class="num2">
+									<!-- <text class="tit1">{{ machineData.machine_use_water}}</text> -->
+									<text
+										class="tit1">{{ parseFloat(machineData.machine_use_water / 10000).toFixed(2) }}</text>
+								</view>
+							</view>
+						</view>
+						<view class="map2">
+							<view class="map-icon">
+								<image src="../../static/images/info002.png" mode=""></image>
+							</view>
+							<view class="map-2">
+								<view class="info2">节水总量(万吨)</view>
+								<view class="num2">
+									<text
+										class="tit1">{{ parseFloat(machineData.machine_save_water / 10000).toFixed(2) }}</text>
+								</view>
+							</view>
+						</view>
+						<view class="map2">
+							<view class="map-icon">
+								<image src="../../static/images/info003.png" mode=""></image>
+							</view>
+							<view class="map-2">
+								<view class="info2">经济效益(万元)</view>
+								<view class="num2">
+									<!-- machineData.machine_save_money -->
+									<text
+										class="tit1">{{ parseFloat(machineData.machine_save_money / 10000).toFixed(2) }}</text>
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 案例展示 -->
 		<view class="introduce" @click="navto('/pages/case/case')">
 			案例展示
 			<view class="more">
 				更多>>
 			</view>
 		</view>
-		<view class="case" v-for="(item,index) in caseList">
+		<view class="case" v-for="(item,index) in caseList" @click="navId('/pages/case/case?id='+item.id)">
 			<view class="case_img">
-				<image :src="item.src" mode=""></image>
+				<image :src="baseUrl+item.coverimage" mode=""></image>
 			</view>
 			<view class="caseBox">
 				<view class="caseBox_top">
@@ -52,24 +125,26 @@
 				</view>
 				<view class="caseBox_bottom">
 					<view class="img">
+						<!-- 	<image :src="item.coverimage" mode=""></image> -->
 						<image src="../../static/tabBar/1.png" mode=""></image>
 					</view>
-					<text>发布时间:</text>
-					<view class="date">
-						{{item.date}}
-					</view>
+					<text>发布时间:{{item.fb}}</text>
+					<!-- <view class="date">
+						{{item.content}}
+					</view> -->
 				</view>
 			</view>
 		</view>
+		<!-- 新闻动态 -->
 		<view class="introduce" @click="navto('/pages/news/news')">
 			新闻动态
 			<view class="more">
 				更多>>
 			</view>
 		</view>
-		<view class="case" v-for="(item,index) in caseList">
+		<view class="case" v-for="(item,index) in newsList" @click="nav">
 			<view class="case_img">
-				<image :src="item.src" mode=""></image>
+				<image :src="baseUrl+item.coverimage" mode=""></image>
 			</view>
 			<view class="caseBox">
 				<view class="caseBox_top">
@@ -79,12 +154,15 @@
 					<view class="img">
 						<image src="../../static/tabBar/1.png" mode=""></image>
 					</view>
-					<text>发布时间:</text>
+					<text>发布时间:{{item.fb}}</text>
 					<view class="date">
 						{{item.date}}
 					</view>
 				</view>
 			</view>
+		</view>
+		<view class="botton-box">
+
 		</view>
 		<aboutUs></aboutUs>
 	</view>
@@ -93,43 +171,84 @@
 <script>
 	import {
 		banner,
-		category
+		category,
+		articleDetail,
+		articlelist,
+		loadIndexs,
+		caseslist,
+		newslist,
+		casesDetail
 	} from '@/api/index.js';
-	import {changeTaber} from '@/utils/tarberChange.js'
+	import {
+		getTime
+	} from '@/utils/time.js'
+	import {
+		changeTaber
+	} from '@/utils/tarberChange.js'
 	//调用完组件需要声明一下,在data()上声明
 	import aboutUs from "@/components/introduce/introduce.vue"
 	export default {
-		components:{
+		components: {
 			aboutUs
 		},
 		data() {
 			return {
-				caseList: [{
-					title: '1大家谁都i啊手机都i阿迪啊就能看见你空间空间帮',
-					src: "../../static/img/introduce.png",
-					date: '2021-06-08 16:26',
-				}, {
-					title: '2大家谁都i啊手机都i阿迪啊就能看见你空间空间帮',
-					src: "../../static/img/introduce.png",
-					date: '2021-06-08 16:26'
-				}, {
-					title: '3大家谁都i啊手机都i阿迪啊就能看见你空间空间帮',
-					src: "../../static/img/introduce.png",
-					date: '2021-06-08 16:26'
-				}],
+				isshow: true,
+				// 是否自动切换
+				autoPlay: true,
+				// 保存自动切换倒计时
+				outPlay: null,
+				// 设置动画时间间隔
+				setOutTime: 5000,
+				// 保存地图
+				map: null,
+				// 公司列表
+				companyList: [],
+				// 保存弹窗数据
+				itemData: {},
+				// 默认层级
+				zoomActive: 6,
+				// 默认未加载地图
+				mapLoding: false, //判断是否地图数据已经加载完毕
+				showMap: false, //判断是否到切换地图页面
+				list3: [],
+				machineid: '',
+				//
+
+				gsjj: {},
+				baseUrl: 'http://tianli.liuniu946.com',
+				newsList: [],
+				caseList: [
+					// 	{
+					// 	title: '1大家谁都i啊手机都i阿迪啊就能看见你空间空间帮',
+					// 	src: "../../static/img/introduce.png",
+					// 	date: '2021-06-08 16:26',
+					// }, {
+					// 	title: '2大家谁都i啊手机都i阿迪啊就能看见你空间空间帮',
+					// 	src: "../../static/img/introduce.png",
+					// 	date: '2021-06-08 16:26'
+					// }, {
+					// 	title: '3大家谁都i啊手机都i阿迪啊就能看见你空间空间帮',
+					// 	src: "../../static/img/introduce.png",
+					// 	date: '2021-06-08 16:26'
+					// }
+				],
+				newsCid: 30,
+				caseCid: 27,
 				swiperCurrent: 0,
-				carouselList: [{
-						pic: '../../static/img/logo.png'
-					},
-					{
-						pic: '../../static/img/logo.png'
-					},
-					{
-						pic: '../../static/img/logo.png'
-					},
-					{
-						pic: '../../static/tabBar/1.png'
-					}
+				carouselList: [
+					// {
+					// 	pic: '../../static/img/logo.png'
+					// },
+					// {
+					// 	pic: '../../static/img/logo.png'
+					// },
+					// {
+					// 	pic: '../../static/img/logo.png'
+					// },
+					// {
+					// 	pic: '../../static/tabBar/1.png'
+					// }
 				],
 				dataList: [],
 
@@ -137,9 +256,49 @@
 		},
 		onLoad() {
 			// this.loadData();
-			changeTaber(0)
+			this.loadIndexs();
+			this.$nextTick(function(){
+				changeTaber(0)
+			})
+			this.getGsjj(2)
+			this.getCaseList()
+			this.getNewsList()
 		},
 		methods: {
+			//方案案例列表
+			getCaseList() {
+				let obj = this
+				caseslist({
+					category_id: obj.caseCid,
+					page: 1,
+					limit: 4
+				}).then(({
+					data
+				}) => {
+					data.list.forEach(e => {
+						e.fb = getTime(e.createtime)
+					})
+					console.log(data, '1111111111111111')
+					this.caseList = data.list
+				})
+			},
+			//新闻动态
+			getNewsList() {
+				let obj = this
+				newslist({
+					category_id: obj.newsCid,
+					page: 1,
+					limit: 4
+				}).then(({
+					data
+				}) => {
+					data.list.forEach(e => {
+						e.fb = getTime(e.createtime)
+					})
+					console.log(data, '1111111111111111')
+					this.newsList = data.list
+				})
+			},
 			// nav(url) {
 			// 	uni.navigateTo({
 			// 		url: url
@@ -162,6 +321,14 @@
 					})
 				}
 			},
+			//跳转详情
+			navId(id) {
+				casesDetail({}, id).then(res => {
+					console.log(res, "111111")
+					this.caseDetail = res.data
+
+				})
+			},
 			//跳转
 			navto(url) {
 				uni.navigateTo({
@@ -173,6 +340,19 @@
 					}
 				});
 			},
+			loadIndexs() {
+				loadIndexs().then(({
+					data
+				}) => {
+					console.log(data, 'data000000000000')
+					console.log(data.loop, '2222')
+					let arr = data.loop.split(',')
+					this.carouselList = arr.map(xhr => {
+						console.log('http://tianli.liuniu946.com' + xhr)
+						return xhr = 'http://tianli.liuniu946.com' + xhr
+					})
+				})
+			},
 			async loadData() {
 				const obj = this;
 				// banner({}).then(e => {
@@ -193,7 +373,18 @@
 			swiperChange(e) {
 				const index = e.detail.current;
 				this.swiperCurrent = index;
+			},
+			getGsjj(id) {
+				articleDetail({}, id).then(res => {
+					console.log(res, "111111")
+					this.gsjj = res.data
+				}).catch(err => {
+					this.gsjj = err.data
+					console.log("2222222222")
+					console.log(err, 'cuoww')
+				})
 			}
+
 		}
 	};
 </script>
@@ -203,6 +394,13 @@
 		background-color: rgb(255, 255, 255);
 		height: 100%;
 	}
+	.aboutUs {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		margin-bottom: 100rpx;
+	}
 
 	.img {
 		margin: 17rpx 0 17rpx 41rpx;
@@ -215,6 +413,180 @@
 		}
 	}
 
+	.map {
+		margin-top: 44rpx;
+		width: 100%;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin-top: 24rpx;
+		padding-bottom: 288rpx;
+
+		.mapbox {
+			width: 94%;
+			border: 1rpx solid #c1c1c1;
+			height: 145vw;
+			// height: 1202rpx;
+			background-color: #f8f8f8;
+			// display: flex;
+			// justify-content: center;
+			// align-items: center;
+			position: relative;
+
+			.map-mian {
+				width: 100%;
+				height: 100%;
+			}
+
+			.bm-marker1 {
+				// height: calc(100vh - 280rpx);
+			}
+
+			.bm-marker {
+				// height: calc(100vh - 280rpx);
+			}
+
+			.map-info {
+				position: absolute;
+				top: 20rpx;
+				left: 15rpx;
+
+				.map1 {
+					padding: 8rpx 8rpx;
+					// width: 100%;
+					// height: 78rpx;
+					border-radius: 10rpx;
+					background-color: #ffffff;
+					display: flex;
+					align-items: center;
+
+					.map1-left {
+						// width: 50%;
+						padding-right: 18rpx;
+						border-right: 2rpx solid #f0f0f0;
+						display: flex;
+
+						.map-icon {
+							width: 68rpx;
+							height: 68rpx;
+
+							image {
+								width: 68rpx;
+								height: 68rpx;
+							}
+						}
+
+						.map-2 {
+							display: flex;
+							flex-direction: column;
+
+							.info2 {
+								color: #101010;
+								font-size: 16rpx;
+							}
+
+							.num2 {
+								display: flex;
+								align-items: center;
+
+								image {
+									margin: 0 6rpx;
+									width: 8rpx;
+									height: 11rpx;
+								}
+
+								.tit2 {
+									font-size: 4rpx;
+								}
+							}
+						}
+					}
+
+					.map1-right {
+						padding: 0 16rpx;
+						// width: 50%;
+						font-size: 8rpx;
+
+						.warn1 {
+							display: flex;
+							align-items: center;
+
+							.circle {
+								width: 8rpx;
+								height: 8rpx;
+								border-radius: 4rpx;
+								margin-right: 6px;
+								background-color: #448ef7;
+							}
+
+							.circle1 {
+								width: 8rpx;
+								height: 8rpx;
+								border-radius: 4rpx;
+								margin-right: 6px;
+								background-color: #d9d2be;
+							}
+
+							.circle2 {
+								width: 8rpx;
+								height: 8rpx;
+								border-radius: 4rpx;
+								margin-right: 6px;
+								background-color: #eeeeee;
+							}
+						}
+					}
+				}
+
+				.map2 {
+					margin-top: 12rpx;
+					// width: 260rpx;
+					border-radius: 8rpx;
+					background-color: #fff;
+					display: flex;
+					align-items: center;
+					padding: 12rpx 0 12rpx 6rpx;
+
+					.map-icon {
+						width: 72rpx;
+						height: 72rpx;
+						margin-right: 6rpx;
+
+						image {
+							width: 72rpx;
+							height: 72rpx;
+						}
+					}
+
+					.map-2 {
+						display: flex;
+						flex-direction: column;
+
+						.info2 {
+							color: #101010;
+							font-size: 16rpx;
+						}
+
+						.num2 {
+							display: flex;
+							align-items: center;
+
+							image {
+								margin: 0 6rpx;
+								width: 8rpx;
+								height: 11rpx;
+							}
+
+							.tit2 {
+								font-size: 4rpx;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
 	.carousel-section {
 		background-color: #FFFFFF;
 		width: 100%;
@@ -304,6 +676,7 @@
 		padding: 30rpx 0;
 
 		.case_img {
+			flex-shrink: 1;
 			width: 158rpx;
 			height: 124rpx;
 
@@ -314,10 +687,10 @@
 		}
 
 		.caseBox {
+			width: 460rpx;
 			display: flex;
 			flex-direction: column;
-			align-items: center;
-			justify-content: center;
+			justify-content: space-between;
 
 			.caseBox_top {
 				padding-left: 30rpx;
@@ -328,7 +701,7 @@
 			}
 
 			.caseBox_bottom {
-				margin-left: -50rpx;
+				margin-left: -10rpx;
 				display: flex;
 				align-items: center;
 
@@ -342,6 +715,7 @@
 						height: 100%;
 					}
 				}
+
 				text {
 					color: #9F9F9F;
 					font-size: 24rpx;
@@ -357,6 +731,4 @@
 			}
 		}
 	}
-
-	
 </style>

+ 211 - 35
pages/news/news.vue

@@ -6,63 +6,142 @@
 		<view class="test_title">
 			新闻动态
 		</view>
-		<view class="newBox" v-for="(item, index) in list" @click="nav('/pages/news/newsDetail?id='+item.id)">
-			<view class="newBox-left">
-				<image src="../../static/img/introduce.png" mode=""></image>
-			</view>
-			<view class="newBox-right">
-				<view class="title">
-					{{item.title}}
-				</view>
-				<view class="date">
-					{{item.date}}
+		<view class="box" v-if="isShow">
+			<view class="caseBox" v-for="(item,index) in newsList"  @click="nav(item.id)">
+				<view class="caseBox-img">
+					<image :src="imgUrl+item.coverimage" mode=""></image>
 				</view>
-				<view class="content">
-					{{item.content}}
-				</view>
-				<view class="more">
-					更多......
+				<view class="caseBox-right">
+					<view class="title">
+						{{item.title}}
+					</view>
+					<view class="date">
+						{{item.createtime}}
+					</view>
+					<view class="content">
+						{{item.synopsis}}
+					</view>
 				</view>
 			</view>
-		</view>
+			<view class="tishi" v-if="isShowtishi">
+				已加载全部数据~~
+			</view>
+			
 
+			<view class="pagInation">
+				<!-- prevText	String	上一页	左侧按钮文字
+			     nextText	String	下一页	右侧按钮文字
+                 current	Number	1	当前页
+                 total	Number	0	数据总量
+                 pageSize	Number	10	每页数据量
+                 showIcon	Boolean	false	是否以 icon 形式展示按钮 
+				 @change	点击页码按钮时触发	e={type,current} current为当前页,
+				 type值为:next/prev,表示点击的是上一页还是下一个-->
+				<!-- 	<uni-pagination title="标题文字" prevText="" nextText="" pageSize="10" total="20" @change="" ></uni-pagination> -->
+				<!-- <uni-pagination title="标题文字" show-icon="true" total="50" current="2"></uni-pagination> -->
+				<uni-pagination class="pagination" prevText="上一页" nextText="下一页" @change="handlePage" show-icon="false" :total="total" :current="pageNum" :pageSize="pageSize"></uni-pagination>
+			</view>
+		</view>
+		<view class="xianqingye" v-html="newsDetail.content" v-else>	
+		</view>
+		<aboutUs class="aboutUs"></aboutUs>
 	</view>
+
 </template>
 <script>
-	import {
-		changeTaber
-	} from '@/utils/tarberChange.js'
+	import {changeTaber} from '@/utils/tarberChange.js'
+	import {newslist,newsDetail} from '@/api/index.js'
+	import {getTime} from '@/utils/time.js'
+	
+	import aboutUs from '@/components/introduce/introduce.vue'
 	export default {
+		components: {
+			aboutUs
+		},
 		data() {
 			return {
-				list: [{
-					title: '111',
-					src: '111',
-					date: '111',
-					content: '111',
-
-				}]
+				isShowtishi:false,//false不展示
+				isShow:true,
+				imgUrl: 'http://tianli.liuniu946.com',
+				newsList: [],
+				newsCid:30,
+				// limit:,
+				// page:1,
+				total: '',//数据总量
+				pageSize: 5,//每页数据量
+				pageNum: 1,//当前页
+				newsDetail:{}
 			}
 		},
+
 		onLoad() {
-			// this,loadData();
-			this.loadData()
-			changeTaber(3)
+			// this.loadData();
+			// this.handlePage()
+			this.$nextTick(function(){
+				changeTaber(3)
+			})
+			this.getNewsList()
 		},
 		methods: {
-			async loadData() {
+			async loadData() {	
 				const obj = this;
 			},
-			nav(url) {
-				uni.navigateTo({
-					url: url
+			
+			//分页
+			handlePage(params) {
+				console.log(params)
+				this.pageNum = params.current;
+				this.getNewsList()
+			},
+			//获取案例
+			getNewsList() {
+				let obj = this
+				newslist({
+					category_id: obj.newsCid,
+					page: obj.pageNum,
+					limit: obj.pageSize
+				}).then(({data}) => {					
+					data.list.forEach(e => {
+						e.createtime = getTime(e.createtime)
+					})
+				console.log(data, '111111')
+				obj.newsList = data.list
+				obj.total = data.count
+				if(data.list.length < 5) {
+					this.isShowtishi = true
+				}else{
+					this.isShowtishi = false
+				}
 				})
-			}
+			},
+			//大概,
+		nav(id) {
+			this.isShow = false;
+			newsDetail({}, id).then(res => {
+					console.log(res, "111111")
+					this.newsDetail =res.data
+				// }).catch(err => {
+				// 	this.gsjj = err.data
+				// 	console.log("2222222222")
+				// 	console.log(err, 'cuoww')
+				// })
+			})
+		},
+		
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
+	page {
+		height: 100%;
+
+	}
+
+	.center {
+		height: 100%;
+	}
+
 	.img {
 		margin: 17rpx 0 17rpx 41rpx;
 		width: 208rpx;
@@ -73,6 +152,27 @@
 			height: 100%;
 		}
 	}
+.aboutUs {
+		width: 100%;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		margin-bottom: 100rpx;
+	}
+	.pagination {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		bottom:232rpx;
+	}
+			
+	.tishi{
+		font-size: 16rpx;
+		font-family: Adobe Heiti Std;
+		font-weight: normal;
+		color: #C7C9D1;
+		line-height: 101px;
+	}
 
 	.test_title {
 		display: flex;
@@ -86,4 +186,80 @@
 		color: #FFFFFF;
 		background-color: #0165B5;
 	}
+
+	.box {
+		display: flex;
+		flex-direction: column;
+
+		align-items: center;
+
+		.caseBox {
+			margin-top: 20rpx;
+			display: flex;
+			align-items: center;
+			width: 90%;
+			height: 100%;
+
+			.caseBox-img {
+				flex-shrink: 1;
+				width: 240rpx;
+				height: 160rpx;
+
+				image {
+					width: 100%;
+					height: 100%;
+				}
+			}
+
+			.caseBox-right {
+				margin-left: 30rpx;
+				width: 440rpx;
+				display: flex;
+				flex-direction: column;
+
+
+				.title {
+					margin-top: -70rpx;
+					font-size: 18rpx;
+					font-family: Adobe Heiti Std;
+					font-weight: normal;
+					color: #535962;
+					max-width: 420rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+
+				}
+
+				.date {
+					margin-top: 10rpx;
+					font-size: 11rpx;
+					font-family: Adobe Heiti Std;
+					font-weight: normal;
+					color: #A1A1A1;
+					line-height: 20rpx;
+				}
+
+				.content {
+					font-size: 15rpx;
+					font-family: Adobe Heiti Std;
+					font-weight: normal;
+					color: #A1A1A1;
+					line-height: 46rpx;
+					max-width: 420rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+				}
+			}
+		}
+	}
+
+
+	// .uni-pagination__child-btn{
+
+	// }
+	// 	.pagInation > .uni-pagination>.uni-pagination__btn > .uni-pagination__child-btn > span{
+
+	// }
 </style>

+ 0 - 8
pages/news/newsDetail.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 595 - 118
pages/test/test.vue

@@ -3,125 +3,152 @@
 		<view class="img">
 			<image src="../../static/img/logo.png" mode=""></image>
 		</view>
-			<view class="test_title">
-				节水测试
-			</view>
-			<view class="form">
-				<view class="form-item">
-					<view class="form-left">姓名:</view>
-					<text class="tip">*</text>
-					<view class="form-right">
-						<input type="text" @input="onAction" class="list-input" v-model="name" placeholder="请填写姓名" />
-					</view>
-				</view>
-				<view class="form-item">
-					<view class="form-left">地址:</view>
-					<text class="tip"></text>
-					<view class="form-right">
-						<input @input="onAction" type="text" class="list-input" v-model="address" placeholder="请填写地址" />
-					</view>
-				</view>
-				<view class="form-item">
-					<view class="form-left">
-						联系电话:
-					</view>
-					<text class="tip">*</text>
-					<view class="form-right">
-						<input @input="onAction" class="list-input" type="text" v-model="address"
-							placeholder="请填写联系方式" />
-					</view>
+		<view class="test_title">
+			节水测试
+		</view>
+		<view class="form">
+			<view class="form-item">
+				<view class="form-left">姓名:</view>
+				<text class="tip">*</text>
+				<view class="form-right">
+					<input type="text" @input="onAction" class="list-input" v-model="name" placeholder="请填写姓名" />
 				</view>
-				<view class="form-item">
-					<view class="form-left">
-						生产线类型:
-					</view>
-					<text class="tip">*</text>
-					<view class="form-right">
-						<picker :value="index" :range="array" @change="bindPickerType" class="list-input1">
-							<text style="color: #C7C9D1;">{{line_type || '请选择生产类型'}}</text>
-						</picker>
-					</view>
+			</view>
+		<view class="form-item">
+			<view class="form-left">地址:</view>
+			<text class="tip"></text>
+			<view class="form-right"><input @input="onAction" class="list-input" v-model="address" type="text" placeholder="请填写详细地址" /></view>
+		</view>
+		<view class="form-item">
+			<view class="form-left">联系电话:</view>
+			<text class="tip">*</text>
+			<view class="form-right"><input @input="onAction" class="list-input" v-model="telephone" type="number" placeholder="请填写联系电话" /></view>
+		</view>
+			<view class="form-item">
+				<view class="form-left">
+					生产线类型:
 				</view>
-				<view class="form-item">
-					<view class="form-left">
-						生产线数量:
-					</view>
-					<text class="tip">*</text>
-					<view class="form-right">
-						<input class="list-input" type="number" @input="onAction" v-model="line_num"
-							placeholder="请填写生产线数量" />
-					</view>
+				<text class="tip">*</text>
+				<view class="form-right">
+					<picker :value="index" :range="array" @change="bindPickerType" class="list-input1">
+						<text style="color: #C7C9D1;">{{line_type || '请选择生产类型'}}</text>
+					</picker>
 				</view>
-				<view class="form-item">
-					<view class="form-left">
-						目前用水量(吨/小时):
-					</view>
-					<text class="tip">*</text>
-					<view class="form-right">
-						<input class="list-input" type="number" @input="onAction" v-model="water_using"
-							placeholder="请填写目前用水量" />
-					</view>
+			</view>
+			<view class="form-item">
+				<view class="form-left">
+					生产线数量:
 				</view>
-				<view class="form-item">
-					<view class="form-left">工作时长(小时):</view>
-					<text class="tip"></text>
-					<view class="form-right">
-						<input @input="onAction" class="list-input" v-model="day_work_times" type="number"
-							placeholder="请填写每日工作时长,默认为12小时" />
-					</view>
+				<text class="tip">*</text>
+				<view class="form-right">
+					<input class="list-input" type="number" @input="onAction" v-model="line_num"
+						placeholder="请填写生产线数量" />
 				</view>
-				<view class="form-item">
-					<view class="form-left">年工作日数:</view>
-					<text class="tip"></text>
-					<view class="form-right">
-						<input @input="onAction" class="list-input" v-model="year_work_day" type="number"
-							placeholder="请填写每年工作日数,默认为330天" />
-					</view>
+			</view>
+			<view class="form-item">
+				<view class="form-left">
+					目前用水量(吨/小时):
 				</view>
-				<view class="form-item">
-					<view class="form-left">废水处理成本(元/吨):</view>
-					<text class="tip">*</text>
-					<view class="form-right">
-						<input @input="onAction" class="list-input" v-model="deal_cost" type="number"
-							placeholder="请填写废水处理成本" />
-					</view>
+				<text class="tip">*</text>
+				<view class="form-right">
+					<input class="list-input" type="number" @input="onAction" v-model="water_using"
+						placeholder="请填写目前用水量" />
 				</view>
 			</view>
-			<view class="btn" @click="next">
-				<view class="btn-left">
-					提交
+			<view class="form-item">
+				<view class="form-left">工作时长(小时):</view>
+				<text class="tip"></text>
+				<view class="form-right">
+					<input @input="onAction" class="list-input" v-model="day_work_times" type="number"
+						placeholder="请填写每日工作时长,默认为12小时" />
 				</view>
 			</view>
-			<view class="result">
-				<view class="result-title">
-					测试结果
+			<view class="form-item">
+				<view class="form-left">年工作日数:</view>
+				<text class="tip"></text>
+				<view class="form-right">
+					<input @input="onAction" class="list-input" v-model="year_work_day" type="number"
+						placeholder="请填写每年工作日数,默认为330天" />
 				</view>
-				<view class="border">
-
+			</view>
+			<view class="form-item">
+				<view class="form-left">废水处理成本(元/吨):</view>
+				<text class="tip">*</text>
+				<view class="form-right">
+					<input @input="onAction" class="list-input" v-model="deal_cost" type="number"
+						placeholder="请填写废水处理成本" />
 				</view>
-				<view class="result-box">
+			</view>
+		</view>
+		<view class="btn" @click="next" v-if="isShow">
+			<view class="btn-left">
+				提交
+			</view>
+		</view>
+		<view class="result" >
+			<view class="result-title">
+				测试结果
+			</view>
+			<view class="border">
 
-				</view>
 			</view>
-			<view class="tanchang">
-				
+			<view class="result-box"  >
+				<view class="swiper-item" v-if="num1">
+					<view class="effect">
+						<view class="title">改造后的数据</view>
+						<view class="information">
+							<view class="benefits">
+								<view class="unit">
+									<!-- {{ num1 }} -->
+									<view class="unit1">{{ num1 }}</view>
+									<view class="unit2">~</view>
+									<view class="unit3">{{ num2 }}</view>
+								</view>
+								<view class="info">改造后用水量(吨/小时)</view>
+							</view>
+							<view class="benefits">
+								<view class="unit">
+									<!-- {{ num1 }} -->
+									<view class="unit1">{{ num3 }}</view>
+									<view class="unit2">~</view>
+									<view class="unit3">{{ num4 }}</view>
+								</view>
+								<view class="info">年经济效益(万元)</view>
+							</view>
+						</view>
+						<view class="refresh" @click="refresh">重新测试</view>
+					</view>
+				</view>
 			</view>
+		</view>
+		<view class="tanchang">
+
+		</view>
+		<view class="botton-box">
+
+		</view>
 		<aboutUs class="aboutUs"></aboutUs>
 
 	</view>
 </template>
 <script>
 	import {
-		addForm
+		loadIndexs, cateList, aboutlist, storylist, caseslist, productlist, articlelist, addForm, companies, machine, machineId 
 	} from '@/api/index.js';
 	import aboutUs from "@/components/introduce/introduce.vue"
-	import {changeTaber} from "@/utils/tarberChange.js"
+	import {
+		
+		changeTaber
+	} from "@/utils/tarberChange.js"
 	export default {
 		components: {
+			
 			aboutUs
 		},
 		data() {
 			return {
+				isShow:true,
+				type: '',
 				name: '',
 				address: '',
 				telephone: '',
@@ -131,22 +158,161 @@
 				day_work_times: '',
 				year_work_day: '',
 				deal_cost: '',
+				array: ['塑料镀铬线', '五金镀铬线'],
+				index:'',
+				num4:'',
+				num3:'',
+				num2:'',
+				num1:''
 			}
 		},
 		onLoad() {
 			// this.loadData();
-			changeTaber(4);
+			this.$nextTick(function(){
+				changeTaber(4)
+			})
+			this.loadData();
+			
 		},
 		methods: {
-			//表单提交
+			alertChange(tab) {
+				if (tab.show) {
+					this.onAction(false);
+				} else {
+					this.onAction();
+				}
+			},
+			/* 设置弹窗 */
+			zoomendChange(type) {
+				this.zoomActive = type.target.getZoom();
+			},
+			// 显示数据
+			showData(item) {
+				this.autoPlay = false;
+				console.log('点击小点点------', item.name);
+				this.itemData = item;
+				this.machineid = item.id;
+
+				this.$refs.popupItem.open();
+				// machine({id: this.machineid}).then(e => {
+				machine({}, this.machineid)
+					.then(e => {
+						// this.machineData = e.data;
+						console.log('======>', e);
+						this.machineDataModal = e.data;
+						this.machineDataModal.machine_name = item.name;
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			toPre() {
+				console.log('this.checkid', this.checkid);
+				if (this.checkid > 0) {
+					this.checkid--;
+					console.log('this.checkid', this.checkid);
+				} else {
+					this.checkid = 2;
+				}
+			},
+			toNext() {
+				console.log('this.checkid', this.checkid);
+				if (this.checkid < 2) {
+					this.checkid++;
+					console.log('this.checkid', this.checkid);
+				} else {
+					this.checkid = 0;
+				}
+			},
+			// 获取设备信息
+			machine() {
+				machine({}, 0)
+					.then(e => {
+						// console.log('获取设备信息');
+						this.machineData = e.data;
+						// console.log(e);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			// 获取公司列表
+			getMapList() {
+				// zhong
+				companies()
+					.then(e => {
+						this.companyList = e.data.map(e => {
+							// 初始化弹窗显示隐藏
+							e.show = false;
+							// e.lattitude = 28.243198;
+							// e.longtitude = 121.279239;
+							// 设置文字样式
+							e.textType = {
+								width: -((e.name.length / 2) * 10),
+								height: 30
+							};
+							e.style = {
+								background: 'none',
+								color: '#333333',
+								fontSize: '10px',
+								border: 'none'
+							};
+							return e;
+						});
+						// 设置数据加载完毕
+						this.mapLoding = true;
+						// uni.showModal({
+						// 	title: '提示',
+						// 	content: '地图加载完毕',
+						// 	showCancel: false
+						// });
+						// console.log('公司列表', this.companyList);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			// 初始化地图/
+			init({
+				BMap,
+				map
+			}) {
+				this.map = map;
+				// 初始化地图,设置中心点坐标
+				var point = new BMap.Point(121.434817, 28.653649);
+				map.centerAndZoom(point, this.zoomActive);
+				// this.setMarker();
+				// 添加鼠标滚动缩放
+				// map.enableScrollWheelZoom();
+			},
+			//切换事件
+			onAction(start = true) {
+				console.log('触发点击');
+				this.autoPlay = false;
+				clearTimeout(this.outPlay);
+				if (start) {
+					this.outPlay = setTimeout(e => {
+						this.autoPlay = true;
+					}, this.setOutTime);
+				}
+			},
+			// 渲染首页数据
+			async loadData() {
+				loadIndexs({}).then(({
+					data
+				}) => {
+					this.carouselList = data.loopProduct.map(item => 'http://tianli.liuniu946.com/' + item
+						.coverimage);
+					this.list3 = data;
+				});
+			},
+
+			// 表单交互 提交
 			next() {
 				if (this.name == '') {
-					//消息提醒
 					uni.showToast({
 						title: '请输入您的姓名',
-						//是否展示图标
 						icon: 'none',
-						//显示时间
 						duration: 2000
 					});
 					this.$api.msg('');
@@ -158,14 +324,16 @@
 						icon: 'none',
 						duration: 2000
 					});
+					// this.$api.msg('请填写详细地址');
 					return;
 				}
-				if (this.address == '') {
+				if (this.telephone == '') {
 					uni.showToast({
 						title: '请填写联系电话',
 						icon: 'none',
 						duration: 2000
 					});
+					// this.$api.msg('请填写联系电话');
 					return;
 				}
 				const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
@@ -175,6 +343,7 @@
 						icon: 'none',
 						duration: 2000
 					});
+					// this.$api.msg('请输入您的手机号码');
 					return;
 				}
 				if (this.line_type == '') {
@@ -183,6 +352,7 @@
 						icon: 'none',
 						duration: 2000
 					});
+					// this.$api.msg('请输入生产线类型');
 					return;
 				}
 				if (this.line_num == '') {
@@ -191,6 +361,7 @@
 						icon: 'none',
 						duration: 2000
 					});
+					// this.$api.msg('请输入生产线数量');
 					return;
 				}
 				if (this.water_using == '') {
@@ -199,54 +370,279 @@
 						icon: 'none',
 						duration: 2000
 					});
+					// this.$api.msg('请填写目前用水量');
 					return;
 				}
+
 				if (this.deal_cost == '') {
 					uni.showToast({
 						title: '请填写废水处理成本',
 						icon: 'none',
 						duration: 2000
 					});
+					// this.$api.msg('请填写废水处理成本');
 					return;
 				}
+				addForm({
+					name: this.name,
+					address: this.address,
+					telephone: this.telephone,
+					line_type: this.line_type,
+					line_num: this.line_num,
+					water_using: this.water_using,
+					day_work_times: 12,
+					year_work_day: 330,
+					deal_cost: this.deal_cost
+				}).then(e => {
+					console.log('请求成功');
+					(this.isshow = false),
+					uni.pageScrollTo({
+						scrollTop: 0,
+						duration: 0
+					});
+					/** 
+								交互式表单公式
+									改造后用水量为:目前用水量的30%—70%
+									经济效益=节约的水量X年工作时长(小时)X废水处理成本
+									节约的水量=目前用水量—改造后的用水量
+									经济效益也是一个范围值
+							 **/
+					// 改造后用水量
+					// this.num1 = this.water_using * 0.3;
+					// this.num2 = this.water_using * 0.7;
+					this.num1 = parseFloat(this.water_using * 0.3).toFixed(2);
+					this.num2 = parseFloat(this.water_using * 0.7).toFixed(2);
+
+					console.log('this.num1', this.num1);
+
+					// 节约的水量=目前用水量—改造后的用水量
+					this.savaWater1 = this.water_using - this.num1;
+					this.savaWater2 = this.water_using - this.num2;
+
+					console.log('this.savaWater1', this.savaWater1);
+					console.log('this.day_work_times', this.day_work_times);
+					console.log('this.deal_cost', this.deal_cost);
+
+					// 经济效益=节约的水量X年工作时长(小时)X废水处理成本
+					this.num3 = parseFloat((this.savaWater1 * 3960 * this.deal_cost) / 10000).toFixed(2);
+					this.num4 = parseFloat((this.savaWater2 * 3960 * this.deal_cost) / 10000).toFixed(2);
+
+					// this.name = "";
+					// this.address = "";
+					// this.telephone = "";
+					// this.line_type = "";
+					// this.line_num = "";
+					// this.water_using = "";
+					// this.day_work_times = "";
+					// this.year_work_day = "";
+					// this.deal_cost = "";
+				});
 			},
-			//选择生产线类型
+			change(item) {
+				// console.log('-----this.checkid', item);
+				let id = item;
+				this.checkid = id;
+				this.onAction();
+			},
+
+			// 重新测试
+			refresh() {
+				this.isshow = true;
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 0
+				});
+			},
+			// 选择生产线类型
 			bindPickerType: function(e) {
-				console.log(this.array[e.target.value])
+				console.log(this.array[e.target.value]);
+				this.line_type = this.array[e.target.value];
+				this.index = e.target.value + 1;
+				this.onAction();
 			},
-			// async loadData() {
-			// 	const obj = this;
-			// 	// banner({}).then(e => {
-			// 	// 	obj.carouselList = obj.carouselList.concat(e.data.banner);
-			// 	// 	console.log(obj.carouselList)
-			// 	// // });
-			// 	// category({
-			// 	// 	page: 1,
-			// 	// 	limit: 1000
-			// 	// }, 2).then(({
-			// 	// 	data
-			// 	// }) => {
-			// 	// 	console.log(data)
-			// 	// 	obj.dataList = data
-			
-			// 	// });
-			// },
+			change1(item) {
+				console.log(123, item);
+				let id = item;
+				this.checkid1 = id;
+			},
+			// 监听切换事件
+			listChange(e) {
+				// 触发改变事件
+				this.onAction();
+				this.checkid = e.detail.current;
+				if (this.checkid == 1 && !this.showMap) {
+					this.showMap = true;
+				}
+				// uni.pageScrollTo({
+				// 	duration: 0, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
+				// 	scrollTop: 0 //滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
+				// });
+			},
+			listChange1(id) {
+				this.current = id;
+			},
+			// 点击更多 导航
+			toNavList() {
+				this.$refs.popup.open();
+			},
+
+			goBack(type) {
+				this.$refs[type][0].close();
+			},
+
+			cancel() {
+				this.$refs.popup.close();
+			},
+			cancelAll(type) {
+				this.$refs.popup.close();
+				this.$refs[type][0].close();
+			},
+			handlePop(index, type) {
+				this.type = type;
+				console.log('this.type', this.type);
+				this.$refs[type][0].open();
+				cateList({}, this.type).then(({
+					data
+				}) => {
+					this.productList = data;
+				});
+			},
+
+			// 获取子列表
+			navInfo(id, name, item) {
+				let obj = this;
+				obj.category_id = id;
+				obj.current = id;
+				console.log('进入', obj.type);
+				if (obj.type == 'about') {
+					aboutlist({
+						// title: obj.title,
+						category_id: obj.category_id,
+						page: obj.page,
+						limit: obj.limit
+					}).then(({
+						data
+					}) => {
+						obj.list1 = data.list.map(item => ({
+							title: item.title,
+							id: item.id
+						}));
+					});
+				}
+				if (obj.type == 'story') {
+					storylist({
+						// title: obj.title,
+						category_id: obj.category_id,
+						page: obj.page,
+						limit: obj.limit
+					}).then(({
+						data
+					}) => {
+						obj.list1 = data.list.map(item => ({
+							title: item.title,
+							id: item.id
+						}));
+					});
+				}
+				if (obj.type == 'cases') {
+					caseslist({
+						// title: obj.title,
+						category_id: obj.category_id,
+						page: obj.page,
+						limit: obj.limit
+					}).then(({
+						data
+					}) => {
+						obj.list1 = data.list.map(item => ({
+							title: item.title,
+							id: item.id
+						}));
+					});
+				}
+				if (obj.type == 'product') {
+					productlist({
+						// title: obj.title,
+						category_id: obj.category_id,
+						page: obj.page,
+						limit: obj.limit
+					}).then(({
+						data
+					}) => {
+						obj.list1 = data.list.map(item => ({
+							title: item.title,
+							id: item.id
+						}));
+					});
+				}
+				//
+				if (obj.type == 'article') {
+					articlelist({
+						// title: obj.title,
+						category_id: obj.category_id,
+						page: obj.page,
+						limit: obj.limit
+					}).then(({
+						data
+					}) => {
+						obj.list1 = data.list.map(item => ({
+							title: item.title,
+							id: item.id
+						}));
+					});
+				}
+			},
+			// 点击子列表
+			toproList(id) {
+				console.log('当前子列表id:', id);
+				// let id = id,
+
+				if (this.type == 'about') {
+					uni.navigateTo({
+						url: '/pages/about/about?id=' + id
+					});
+				}
+				if (this.type == 'story') {
+					uni.navigateTo({
+						url: '/pages/story/story?id=' + id
+					});
+				}
+				if (this.type == 'cases') {
+					uni.navigateTo({
+						url: '/pages/cases/cases?id=' + id
+					});
+				}
+				if (this.type == 'product') {
+					uni.navigateTo({
+						url: '/pages/product/product?id=' + id
+					});
+				}
+				if (this.type == 'article') {
+					uni.navigateTo({
+						url: '/pages/article/article?id=' + id
+					});
+				}
+			}
 		}
 	};
 </script>
 
 <style lang="scss">
+	page {
+		height: 100%;
+	}
+
 	.center {
 		height: 100%;
 		background: #FFFFFF;
-		position: relative;
+
 
 	}
+
 	.img {
 		margin: 17rpx 0 17rpx 41rpx;
 		width: 208rpx;
 		height: 52rpx;
-	
+
 		image {
 			width: 100%;
 			height: 100%;
@@ -371,6 +767,7 @@
 		flex-direction: column;
 		justify-content: center;
 		align-items: center;
+
 		.result-title {
 
 			margin-top: 50rpx;
@@ -402,15 +799,95 @@
 			height: 360rpx;
 			background: #0165B5;
 			margin-top: 24rpx;
+			.effect {
+				.title {
+					margin-top: 10rpx;
+					font-size: 32rpx;
+					color: #FFFFFF;
+					text-align: center;
+				}
+			
+				.information {
+					width: 100%;
+					// height: 200rpx;
+					display: flex;
+					justify-content: space-between;
+			
+					.benefits {
+						padding: 24rpx 0;
+						width: 50%;
+						display: flex;
+						flex-direction: column;
+						align-items: center;
+			
+						.unit {
+							width: 200rpx;
+							height: 200rpx;
+							background-color: #3874cb;
+							border-radius: 50%;
+							display: flex;
+							justify-content: center;
+							align-items: center;
+							color: #ffffff;
+							font-size: 64rpx;
+							display: flex;
+							flex-direction: column;
+			
+							.unit1 {
+								width: 100%;
+								font-size: 34rpx;
+								display: flex;
+								padding-left: 34rpx;
+								justify-content: flex-start;
+								// background-color: pink;
+							}
+			
+							.unit2 {
+								font-size: 34rpx;
+								margin: 0 12rpx;
+							}
+			
+							.unit3 {
+								width: 100%;
+								font-size: 34rpx;
+								display: flex;
+								justify-content: flex-end;
+								padding-right: 34rpx;
+							}
+						}
+			
+						.info {
+							font-size: 24rpx;
+							margin-top: 32rpx;
+						}
+					}
+				}
+			
+				.refresh {
+					width: 270rpx;
+					height: 60rpx;
+					background-color: #3874cb;
+					margin: 44rpx auto;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					color: #ffffff;
+					font-size: 24rpx;
+				}
+			}
 		}
 
 	}
+
 	.tanchang {
 		height: 132rpx;
 	}
+
 	.aboutUs {
 		width: 100%;
 		position: fixed;
-		bottom: 100rpx;
+		left: 0;
+		bottom: 0;
+		margin-bottom: 100rpx;
 	}
 </style>

+ 32 - 0
public/index.html

@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+	<head>
+		<meta charset="utf-8">
+		<meta http-equiv="X-UA-Compatible" content="IE=edge">
+		<title>
+			<%= htmlWebpackPlugin.options.title %>
+		</title>
+		<script src="https://unpkg.com/vue-baidu-map"></script>
+		<!-- Open Graph data -->
+		<!-- <meta property="og:title" content="Title Here" /> -->
+		<!-- <meta property="og:url" content="http://www.example.com/" /> -->
+		<!-- <meta property="og:image" content="http://example.com/image.jpg" /> -->
+		<!-- <meta property="og:description" content="Description Here" /> -->
+		<script>
+			var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS
+				.supports('top: constant(a)'))
+			document.write(
+				'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+				(coverSupport ? ', viewport-fit=cover' : '') + '" />')
+		</script>
+		<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
+	</head>
+	<body>
+		<noscript>
+			<strong>Please enable JavaScript to continue.</strong>
+		</noscript>
+		<div id="app"></div>
+		<!-- built files will be auto injected -->
+	</body>
+	
+</html>

BIN
static/images/info001.png


BIN
static/images/info002.png


BIN
static/images/info003.png


BIN
static/img/map.png


+ 1 - 1
store/index.js

@@ -5,7 +5,7 @@ Vue.use(Vuex)
 
 const store = new Vuex.Store({
 	state: {
-		baseURL: 'http://www.babido.cn'	,
+		baseURL: 'http://tianli.liuniu946.com'	,
 		// baseURL: 'https://zhibo.liuniu946.com', //请求地址配置
 		urlFile:'/index',//项目部署所在文件夹
 		hasLogin: false, //是否登录

+ 8 - 0
uni_modules/uni-load-more/changelog.md

@@ -0,0 +1,8 @@
+## 1.2.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.8(2021-05-12)
+- 新增 组件示例地址
+## 1.1.7(2021-03-30)
+- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
+## 1.1.6(2021-02-05)
+- 调整为uni_modules目录规范

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 21 - 0
uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue


+ 82 - 0
uni_modules/uni-load-more/package.json

@@ -0,0 +1,82 @@
+{
+  "id": "uni-load-more",
+  "displayName": "uni-load-more 加载更多",
+  "version": "1.2.0",
+  "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "加载更多",
+    "load-more"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 70 - 0
uni_modules/uni-load-more/readme.md

@@ -0,0 +1,70 @@
+
+
+### LoadMore 加载更多
+> **组件名:uni-load-more**
+> 代码块: `uLoadMore`
+
+
+用于列表中,做滚动加载使用,展示 loading 的各种状态。
+
+### 安装方式
+
+本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
+
+如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
+
+### 使用方式
+
+在 ``template`` 中使用组件
+
+```html
+<uni-load-more :status="more"></uni-load-more>
+```
+
+## API
+
+### LoadMore Props
+
+|属性名			|类型		|	可选值											|默认值	|说明	|
+|:-:				|:-:		|:-:												|:-:		|:-:														|
+|iconSize		|Number	|-													|24			|指定图标大小			|
+|status			|String	|more/loading/noMore				|more		|loading 的状态		|
+|showIcon		|Boolean|-													|true		|是否显示 loading 图标				|
+|iconType		|String	|snow/circle/auto						|auto		|指定图标样式|
+|color			|String	|-													|#777777	|图标和文字颜色		|
+|contentText|Object|-	|{contentdown: "上拉显示更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"}|各状态文字说明	|
+
+
+#### Status Options
+|参数名称	|说明				|
+|:-:		|:-:				|
+|more		|loading前		|
+|loading|loading前中	|
+|more		|没有更多数据	|
+
+#### IconType Options
+|参数名称	|说明									|
+|:-:		|:-:									|
+|snow		|ios雪花加载样式				|
+|circle	|安卓环形加载样式				|
+|auto		|根据平台自动选择加载样式	|
+
+
+
+
+> **说明**
+> `iconType`为`snow`时,在`APP-NVUE`平台不可设置大小,在非`APP-NVUE`平台不可设置颜色
+
+
+
+### 事件说明
+
+|事件名					|说明				|返回值						|
+|:-:						|:-:				|:-:						|
+|clickLoadMore	|点击加载更多时触发	|e.detail={status:'loading'}|
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/load-more/load-more](https://hellouniapp.dcloud.net.cn/pages/extUI/load-more/load-more)

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3 - 3
unpackage/dist/dev/app-plus/app-service.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 467 - 142
unpackage/dist/dev/app-plus/app-view.js


BIN
unpackage/dist/dev/app-plus/static/images/images001.png


BIN
unpackage/dist/dev/app-plus/static/images/images002.png


BIN
unpackage/dist/dev/app-plus/static/images/images003.png


BIN
unpackage/dist/dev/app-plus/static/images/info001.png


BIN
unpackage/dist/dev/app-plus/static/images/info002.png


BIN
unpackage/dist/dev/app-plus/static/images/info003.png


+ 99 - 0
utils/loginUtils.js

@@ -0,0 +1,99 @@
+// 获取当前页面
+export function getActionPage() {
+	let pages = getCurrentPages();
+	return pages[pages.length - 1]
+}
+
+
+// 处理分享链接地址
+export function getPageUrl(config) {
+	let page = getActionPage();
+	let path = '/' + page.route;
+	let url = '';
+	// 获取对象可枚举键值列表
+	let objKeys= Object.keys(page.options);
+	// 判断有无传值
+	if(objKeys.length>0){
+		// 循环赋值对象数据
+		for(let a in page.options) {
+			// 判断有无邀请人
+			if(a!='spread'){
+				url += a+"="+page.options[a]+"&"
+			}
+		}
+		path += '?' + url.substr(0,url.length-1);
+	}
+	// 返回处理邀请人后的邀请地址
+	return path
+}
+
+//登录拦截
+export function interceptor() {
+	let pages = getActionPage();
+	// 获取当前页面
+	let pageUrl = '/' + pages.route;
+	let url = '/pages/login/login'
+	// #ifdef H5
+	// 判断是否为公众号调用微信授权登录
+	let weichatBrowser = uni.getStorageSync('weichatBrowser');
+	if (weichatBrowser) {
+		url = '/pages/public/wxLogin';
+	}
+	// #endif
+	// #ifdef MP-WEIXIN
+	url = '/pages/public/wxLogin';
+	// #endif
+	if (pageUrl != url) {
+		uni.navigateTo({
+			url
+		})
+	}
+}
+
+// 保存页面
+export function saveUrl() {
+	// 获取当前页面
+	let page = getActionPage();
+	// 获取跳转前路由地址
+	let path = '/' + page.route;
+	let url = '';
+	// 获取对象可枚举键值列表
+	let objKeys= Object.keys(page.options);
+	// 判断有无传值
+	if(objKeys.length>0){
+		// 循环赋值对象数据
+		for(let a in page.options) {
+			url += a+"="+page.options[a]+"&"
+		}
+		path += '?' + url.substr(0,url.length-1);
+	}
+	// uni.showModal({
+	// 	title: '地址',
+	// 	content: path,
+	// 	fail: function (res) {
+	// 		console.log(res.errMsg);
+	// 		uni.showModal({
+	// 			title: 'error',
+	// 			content: res.errMsg
+	// 		})
+	// 	}
+	// })
+	uni.setStorageSync('present', path);
+	// // 获取当前页面
+	// let page = getActionPage();
+	// // 获取跳转前路由地址
+	// let path = '/' + page.route;
+	// let url = '';
+	// // 获取对象可枚举键值列表
+	// let objKeys = Object.keys(page.options);
+	// // 判断有无传值
+	// if (objKeys.length > 0) {
+	// 	// 循环赋值对象数据
+	// 	for (let a in page.options) {
+	// 		url += a + "=" + page.options[a] + "&"
+	// 	}
+	// 	path += '?' + url.substr(0, url.length - 1);
+	// }
+	// console.log(path,1)
+	// uni.setStorageSync('present', path);
+}

+ 9 - 35
utils/newRequest.js

@@ -1,7 +1,7 @@
 import store from '../store'
-import request from '@/utils/request'
 let service = {
-	baseURL: store.state.baseURL, // 请求头
+	// baseURL: store.state.baseURL, // 请求头
+	baseURL: '', // 请求头
 	header: {
 		'Content-Type': "application/x-www-form-urlencoded"
 	},
@@ -44,26 +44,13 @@ let service = {
 	open: async function(data) {
 		return await new Promise(function(resolve, reject) {
 			let requestData = ''; //保存处理完成后请求数据
-			let url =''//保存链接地址
 			//console.log(data);
 			// 请求前数据处理
 			requestData = service.request.success(data);
-			// #ifdef H5
-			
-			if(process.env.NODE_ENV === 'development'){
-				url= requestData.url;
-			    console.log('开发环境')
-			}else{
-				url=service.baseURL + requestData.url;
-			    console.log('生产环境')
-			}
-			// #endif
-			// #ifndef H5
-			url=service.baseURL + requestData.url;
-			// #endif
+			// console.log('requestData', requestData)
 			// 数据复制用于请求
 			uni.request({
-				url:url,
+				url: service.baseURL + requestData.url,
 				method: requestData.method || 'GET',
 				data: requestData.data,
 				header: data.header || service.header,
@@ -88,7 +75,6 @@ let service = {
 	upFilse: async function(data) {
 		return await new Promise(function(resolve, reject) {
 			let requestData = ''; //保存处理完成后请求数据
-			let url = '' //保存请求地址
 			try {
 				// 请求前数据处理
 				requestData = service.request.success(data);
@@ -96,30 +82,21 @@ let service = {
 				// 请求报错拦截
 				service.request.error(e);
 			}
-			// #ifdef H5
-			if(process.env.NODE_ENV === 'development'){
-				url= requestData.url;
-			    console.log('开发环境')
-			}else{
-				url=service.baseURL + requestData.url;
-			    console.log('生产环境')
-			}
-			// #endif
-			// #ifndef H5
-			url=service.baseURL + requestData.url;
-			// #endif
 			let config = {
 				// 上传图片的API
-				upload_img_url:url
+				upload_img_url: service.baseURL + requestData.url
 			}
+
 			let Uploader = {
 				// 选择图片
 				choose(num) {
 					return new Promise((resolve, reject) => {
 						uni.chooseImage({
 							count: num,
+							  sourceType: ['album'], //从相册选择
+							sizeType:'compressed',
 							success(res) {
-								console.log(res);
+								// console.log(res);
 								// 缓存文件路径
 								resolve(res.tempFilePaths)
 							},
@@ -129,7 +106,6 @@ let service = {
 							}
 						})
 					})
-
 				},
 				// 上传图片
 				upload_one(path) {
@@ -137,7 +113,6 @@ let service = {
 						uni.showLoading({
 							title: '上传中'
 						})
-						console.log(path);
 						uni.uploadFile({
 							url: config.upload_img_url, //仅为示例,非真实的接口地址
 							filePath: path,
@@ -175,7 +150,6 @@ let service = {
 					return new Promise(async (resolve, reject) => {
 						// 选择图片
 						let path_arr = await this.choose(num);
-						console.log(path_arr)
 						// 上传图片
 						await this.upload(path_arr).then((e) => {
 							resolve(e);

+ 11 - 34
utils/request.js

@@ -1,43 +1,18 @@
 import service from './newRequest.js'
 import store from '../store';
+import {
+	saveUrl,
+	interceptor
+} from '@/utils/loginUtils.js';
 // 请求完成后拦截
 service.interceptors.response(
 	response => {
 		try {
-			let res = response.data;
+			const res = response.data;
 			// 解析字符串为数字
-			if (res.status !== 200) {
-				console.log(res.status);
-				if (res.status == 410000) {
-					// 调用退出登录方法清空用户信息
-					store.commit('user/logout');
-					// 判断是否开启强制登录
-					uni.showModal({
-						title: "登陆",
-						content: '您未登录!是否马上登录?',
-						success: (e) => {
-							// 判断是否点击确认按钮
-							if (e.confirm) {
-								// 保存当前页面地址
-								saveUrl()
-								// 跳转页面
-								interceptor()
-							}
-						}
-					})
-				} else {
-					if (res.msg != '系统出现异常') {
-						uni.showToast({
-							title: res.msg,
-							duration: 1500,
-							mask: false,
-							icon: 'none',
-						})
-
-					}
-				}
-				return Promise.reject(res)
-			} else {
+			if (res.code !== 1) { // 请求失败
+				return Promise.reject(new Error(res.msg || 'Error'))
+			} else { // 成功
 				return res
 			}
 		} catch (e) {
@@ -58,8 +33,10 @@ service.interceptors.response(
 // 请求前拦截器
 service.interceptors.request(
 	config => {
-		let token = uni.getStorageSync('token') || '';
+		// config.data.token = getToken();
 		// console.log(config);
+		let token = uni.getStorageSync('token');
+		// console.log(token);
 		if (!config.header) {
 			config.header = {
 				"Authori-zation": 'Bearer ' + token,

+ 32 - 0
utils/time.js

@@ -0,0 +1,32 @@
+export function getTime(time) {
+	const num = 13 - (time + '').length;
+	let l = 1; //倍数
+	for (let i = 0; i < num; i++) {
+		l += '0';
+	}
+	// 重新解析为数字
+	l = parseInt(l)
+	const date = new Date(parseInt(time) * l);
+	const year = date.getFullYear();
+	let mon = date.getMonth() + 1;
+	let day = date.getDate();
+	let hours = date.getHours();
+	let minu = date.getMinutes();
+	let sec = date.getSeconds();
+	if (day < 10) {
+		day = '0' + day
+	}
+	if (hours < 10) {
+		hours = '0' + hours
+	}
+	if (minu < 10) {
+		minu = '0' + minu
+	}
+	if (mon < 10) {
+		mon = '0' + mon
+	}
+	if (sec < 10) {
+		sec = '0' + sec
+	}
+	return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
+}

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác