瀏覽代碼

初始化

zhengkaixin 3 年之前
當前提交
d39f630007
共有 59 個文件被更改,包括 5981 次插入0 次删除
  1. 14 0
      .env.dev.js
  2. 35 0
      .env.js
  3. 10 0
      .env.prod.js
  4. 19 0
      .env.test.js
  5. 49 0
      App.vue
  6. 70 0
      README.md
  7. 184 0
      apis/common.js
  8. 114 0
      apis/index.js
  9. 50 0
      apis/login.js
  10. 70 0
      apis/my.js
  11. 36 0
      apis/weixin.js
  12. 0 0
      assets/css/style.css
  13. 78 0
      assets/font/iconfont.css
  14. 7 0
      assets/font/jptime.css
  15. 二進制
      assets/font/jptime.otf
  16. 二進制
      assets/img/blankpage.png
  17. 二進制
      assets/img/charge-0.png
  18. 二進制
      assets/img/charge-1.png
  19. 二進制
      assets/img/charge-2.png
  20. 二進制
      assets/img/charge-3.png
  21. 二進制
      assets/img/ddc.png
  22. 二進制
      assets/img/head.png
  23. 二進制
      assets/img/logo_xiaopengguanjia.png
  24. 二進制
      assets/img/min_button_select.png
  25. 二進制
      assets/img/shenhe.png
  26. 二進制
      assets/img/tongguo.png
  27. 153 0
      bobo-router/README.md
  28. 362 0
      bobo-router/bobo-router.js
  29. 68 0
      bobo-router/index.js
  30. 84 0
      components/Tabbar.vue
  31. 472 0
      console.js
  32. 25 0
      font.js
  33. 49 0
      main.js
  34. 87 0
      manifest.json
  35. 56 0
      package.json
  36. 99 0
      pages.json
  37. 106 0
      pages/charge/chargeDetails.vue
  38. 176 0
      pages/charge/chargeList.vue
  39. 494 0
      pages/charge/index.vue
  40. 141 0
      pages/charge/switchCharge.vue
  41. 519 0
      pages/index/index.vue
  42. 87 0
      pages/index/none.vue
  43. 278 0
      pages/login/index.vue
  44. 251 0
      pages/user/index.vue
  45. 274 0
      pages/user/recharge.vue
  46. 92 0
      pages/user/rechargeDeatils.vue
  47. 182 0
      pages/user/rechargeList.vue
  48. 二進制
      static/img/min_button_select.png
  49. 77 0
      uni.scss
  50. 386 0
      utils/index.js
  51. 60 0
      utils/init.js
  52. 34 0
      utils/mixin.js
  53. 76 0
      utils/request.js
  54. 59 0
      utils/requestNum.js
  55. 71 0
      utils/requestSon.js
  56. 69 0
      utils/requestWhite.js
  57. 209 0
      utils/wxJsApi.js
  58. 60 0
      utils/wxpay.js
  59. 89 0
      vue.config.js

+ 14 - 0
.env.dev.js

@@ -0,0 +1,14 @@
+const UNI_APP = {  
+	
+    BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
+	NODE_ENV :"dev",
+	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
+	//openId:"oHjCawsxTJkxixR74OVp7aCKahj8",//测试用openId  
+	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
+	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
+	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
+	//小鹏管家appid
+	VUE_APP_WXAPPID:"wx7e70eb62a8459869"
+}  
+
+module.exports = UNI_APP;

+ 35 - 0
.env.js

@@ -0,0 +1,35 @@
+(function() {  
+    const NODE_ENV = 'test'; // dev:开发环境 | test:测试环境  
+    let ENV_VAR = null;  
+	 
+	var NODE_NAME=  process.env['NODE_NAME']
+	console.log(NODE_NAME)
+    if (process.env.NODE_ENV === "development") {  
+
+        if (NODE_ENV === 'dev') {  
+            ENV_VAR = require('.env.dev.js');  
+        } else if (NODE_ENV === 'test') {  
+			ENV_VAR = require('.env.test.js'); 
+        } else{
+			 ENV_VAR = require('.env.dev.js');  
+		}
+		
+    } else if (process.env.NODE_ENV === "production") {  
+		
+		if(NODE_NAME=="test"){
+			ENV_VAR = require('.env.test.js'); 
+		}else if(NODE_NAME=="production"){
+			ENV_VAR = require('.env.prod.js');
+		} else  {  
+			ENV_VAR = require('.env.prod.js');  
+		} 
+      
+    }  
+
+    if (ENV_VAR) {  
+		process.car = {};  
+        for (let key in ENV_VAR) {  
+			process.car[key] = ENV_VAR[key];			
+        }  
+    }  
+})();

+ 10 - 0
.env.prod.js

@@ -0,0 +1,10 @@
+const UNI_APP = {  	
+    BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
+	NODE_ENV :"prod",
+	SIMPLE_RUN:false,
+	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",//测试用openId
+	//小鹏管家appid
+	VUE_APP_WXAPPID:"wx7e70eb62a8459869"
+}  
+
+module.exports = UNI_APP;

+ 19 - 0
.env.test.js

@@ -0,0 +1,19 @@
+const UNI_APP = {  
+    // BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
+	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+    BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
+   
+
+	NODE_ENV :"test",
+	SIMPLE_RUN:false,
+	//openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",//测试用openId
+	//openId:"oHjCawmHqG44pqUW54iBlenaHYB8",
+	//小鹏管家appid
+	VUE_APP_WXAPPID:"wx7e70eb62a8459869",
+	//zkx的测试openId
+	//openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
+	//zq的测试openId oHjCawsxTJkxixR74OVp7aCKahj8
+	openId:"oHjCawqzNFywmsRzC7L_OCzk3hwc",
+}  
+
+module.exports = UNI_APP;

+ 49 - 0
App.vue

@@ -0,0 +1,49 @@
+<script>
+	import '.env.js'
+	import 'font.js'
+	export default {
+		onLaunch: function() {
+			
+			
+		},
+		onShow: function() {
+			
+		
+		},
+		onReady: function() {
+			console.log("aaa")
+		},
+		onHide: function() {
+			
+		},
+		methods:{
+			
+		} 
+	}
+</script>
+<style lang="scss">
+	/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
+	@import "uview-ui/index.scss";
+	//
+	/*每个页面公共css */
+	//@import 'static/css/style.css';
+	
+	@import '@/assets/font/iconfont.css';
+	.uni-icon-success-no-circle:before {
+	    content: "" !important ;
+		display: none;
+	}
+	.uni-toast .uni-toast__content{
+		margin: -10px 1px 10px 1px;
+	}
+	.uni-modal .uni-modal__btn{
+			  flex: 1;
+			  height: 43px;
+			  line-height: 43px !important;;
+			  font-size: 13px !important;
+			  box-sizing: border-box;
+			  cursor: pointer;
+			  text-align: center;
+			  border-radius: 1px;
+	}
+</style>

+ 70 - 0
README.md

@@ -0,0 +1,70 @@
+#   智能充电系统
+发行方式, uniapp  点击”发行“ -”自定义发行“   prod 正式环境| test 测试环境
+
+运行方式  uniapp正常运行方式
+
+
+## 运行与安装
+建议使用uniapp的官方推荐开发工具HBuilder最新版本
+
+## 目录结构
+~~~
+www  WEB部署目录(或者子目录)
+├─apis             接口目录
+├─components       组件目录
+├─config           配置目录
+├─pages            页面目录
+├─static           静态文件目录
+├─utils            工具模块目录
+├─App.vue          主入口组件
+├─main.js          主入口模块
+├─mainifest.json   项目配置
+├─pages.json       页面及其他公共配置
+├─uni.scss         控制应用的风格样式文件
+├─vue.config.js    vue配置,多不可用,具体参见文档https://uniapp.dcloud.io/collocation/vue-config
+~~~
+
+## 编码风格
+- 文件命名建议使用驼峰命名,其中首字母小写,名字要语义清晰
+- data内参数或者函数参数使用驼峰命名,关键参数或者有歧义的参数应该有参考备注
+- 页面的命名使用驼峰命名,而组件的命名则使用中划线命名,将两者能够更好的分别
+- 在页面内定义函数和参数需要有备注,定义此方法的含义及其使用, 生命周期函数推荐使用uni-app的内置自带函数,不推荐使用vue的生命函数
+- 在页面中使用this 推荐在全局置顶设置_this 这样会保持风格统一 且节省代码
+- 在页面头部起一行注释,表明这个页面是什么页面 
+- 以前的html标签改了很多,请参照官方文档使用
+`div 改成 view`
+`span、font 改成 text`
+`a 改成 navigator`
+`img 改成 image`
+`input 还在,但type属性改成了confirmtype`
+`form、button、checkbox、radio、label、textarea、canvas、video 这些还在。`
+`select 改成 picker`
+`iframe 改成 web-view`
+`ul、li没有了,都用view替代`
+
+##插件引用
+#控制台
+yarn add vconsole
+###uniapp 路由站
+npm install uni-simple-router uni-read-pages(取消使用, 存在h5 刷新白屏问题)
+//双路由   uni-crazy-router 直接链接访问, 无法触发前置占点
+[uni-crazy-router](https://ext.dcloud.net.cn/plugin?id=1658)
+[bobo-router ](https://ext.dcloud.net.cn/plugin?id=904)
+
+
+
+[vue-router-uni ](https://ext.dcloud.net.cn/plugin?id=605)
+[mac80端口问题无法使用](https://blog.csdn.net/weixin_41047933/article/details/97765502)
+sudo pfctl -ef /etc/pf-tomcat.conf
+
+
+redirectTo
+
+
+u-loadmore//加载更多
+
+[在线示例 uview](https://h5.uviewui.com/)
+
+	uni.showLoading({
+					    title: '加载中'
+					});

+ 184 - 0
apis/common.js

@@ -0,0 +1,184 @@
+import request from '@/utils/request'
+ 
+import Qs from 'qs';
+
+
+export function getBannerInfo(formData) {
+	return request({
+		url: '/mobile/bannerInfo/getBannerInfo',
+		data: formData,
+		method: 'post',
+		
+	})
+}
+export function readMessageNum() {
+	return request({
+		url: '/mobile/messageApi/readMessageNum',
+		//data: formData,
+		method: 'post',
+		
+	})
+}
+
+export function getScreenList(formData) {
+	return request({
+		url: '/mobile/recruitmentApi/getScreenList',
+		data: formData,
+		method: 'post',
+		
+	})
+}
+
+//字典表
+export function getData(id) {
+	return request({
+		url: '/sys/dataDictionary/queryChildrenApi',
+		data: {
+			parentId:id
+		},
+		method: 'post',
+		timeout: 60000,
+	})
+}
+//上传图片
+export function upload(formData) {
+	return request({
+		url: '/mobile/jobUserApi/upload',
+		data: formData,
+		method: 'post',
+		
+	})
+}
+
+//上传图片
+export function uploadBase64(formData) {
+	var localData = formData.photoFile?formData.photoFile:formData.photoBase64Data;
+	
+	if (localData.indexOf('data:image') != 0) {
+	    //判断是否有这样的头部
+	    localData = 'data:image/jpeg;base64,' + localData
+	}
+	formData.photoBase64Data = localData.replace(/\r|\n/g, '').replace('data:image/jgp', 'data:image/jpeg')
+	
+	
+	return request({
+		url: '/mobile/jobUserApi/uploadBase64',
+		data: formData,
+		method: 'post',
+		timeout: 60000,
+	})
+}
+
+
+export function getSchoolServeList(params) {
+	return request({
+		url: '/mobile/companyInfoApi/schoolServeList',
+		data: Qs.stringify(params),
+		method: 'post',
+	})
+}
+
+
+
+//综合订单
+export function mergeInfo(id) {
+	return request({
+		url: '/mobile/passengerApi/mergeInfo',
+		data: Qs.stringify({
+			outOrderNo: id
+		}),
+		method: 'post',
+	})
+}
+//发送短信
+export function sendMsg(params) {
+	return request({
+		url: '/mobile/personInfoApi/getVerifyCode',
+		data: Qs.stringify(params),
+		method: 'post',
+	})
+}
+
+//验证验证码并登录
+export function validateCode(params) {
+	return request({
+		url: '/mobile/personInfoApi/validateCode',
+		data: Qs.stringify(params),
+		method: 'post',
+	})
+}
+
+//验证验证码并登录
+export function submitAuthentication(params) {
+	return request({
+		url: '/mobile/jobUserApi/submitAuthentication',
+		data: Qs.stringify(params),
+		method: 'post',
+	})
+}
+
+
+export function messageClassify(formData) {
+	return request({
+		url: '/mobile/messageApi/messageClassify',
+		data: formData,
+		method: 'post',
+		
+	})
+}
+
+export function messageList(formData) {
+	return request({
+		url: '/mobile/messageApi/messageList',
+		data: formData,
+		method: 'post',
+		
+	})
+}
+
+
+export function messageDetail(id) {
+	return request({
+		url: '/mobile/messageApi/messageDetail',
+		data: Qs.stringify({
+			messageId: id
+		}),
+		method: 'post',
+	})
+}
+
+export function messageClassifyHR(formData) {
+	return request({
+		url: '/mobile/messageApi/messageClassifyHR',
+		data:formData,
+		method: 'post',
+	})
+}
+
+
+export function changeAgree(formData) {
+	return request({
+		url: '/mobile/messageApi/changeAgree',
+		data:formData,
+		method: 'post',
+	})
+}
+
+
+//推荐简历
+export function positionResumeList(formData) {
+	return request({
+		url: '/mobile/resumeApi/positionResumeList',
+		data:formData,
+		method: 'post',
+	})
+}
+
+//推荐职位
+export function positionRecruitmentList(formData) {
+	return request({
+		url: '/mobile/recruitmentApi/positionRecruitmentList',
+		data:formData,
+		method: 'post',
+	})
+}

+ 114 - 0
apis/index.js

@@ -0,0 +1,114 @@
+import request from '../utils/request.js';
+import Qs from 'qs';
+
+
+export function test(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/test/post'
+	})
+}
+
+
+export function chargingData(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/charging/chargingData'
+	})
+}
+
+export function marketingData(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/charging/marketingData'
+	})
+}
+export function findChargeData(data) {
+	return request({
+		method: 'get',
+		data: data,
+		url: '/mobile/regUser/findChargeData'
+	})
+}
+
+
+export function personalCenter(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/regUser/personalCenter'
+	})
+}
+export function logout(data) {
+	return request({
+		method: 'get',
+		data: data,
+		url: '/mobile/regUser/logout'
+	})
+}
+
+
+export function stopCharging(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/command/stopCharging'
+	})
+}
+export function startCharging(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/command/startCharging'
+	})
+}
+export function accountRecordData(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/accountRecord/accountRecordData'
+	})
+}
+export function accountDetail(id) {
+	return request({
+		method: 'get',
+		 
+		url: '/mobile/accountRecord/accountDetail?id='+id
+	})
+}
+
+
+export function chargingRecordData(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/chargingRecord/chargingRecordData'
+	})
+}
+export function chargingDetail(id) {
+	return request({
+		method: 'get',
+		 
+		url: '/mobile/chargingRecord/chargingDetail?id='+id
+	})
+}
+
+export function passengerMessageNoReadNum(data) {
+	
+	return request({
+		url: '/mobile/passengerApi/passengerMessageNoReadNum',
+		data:data,
+		method: 'post',
+	})
+}
+  
+  export function chargingDeviceData(data) {
+  	return request({
+  		method: 'post',
+  		data: data,
+  		url: '/mobile/charging/chargingDeviceData'
+  	})
+  }

+ 50 - 0
apis/login.js

@@ -0,0 +1,50 @@
+ import requestWhite from '../utils/requestWhite.js';
+import Qs from 'qs';
+
+ 
+export function findByOpenId(data) {
+	var url='/mobile/regUser/findByOpenId';
+	return requestWhite({
+		method: 'get',
+		data: data,
+		url: url
+	})
+}
+
+export function validateCode(data) {
+	 
+	return requestWhite({
+		method: 'post',
+		data:data ,
+		url: '/mobile/regUser/validateCode'
+	})
+} 
+
+export function getVerifyCode(tel) {
+	 
+	return requestWhite({
+		method: 'post',
+		data:{
+			telephone:tel
+		} ,
+		url: '/mobile/regUser/getVerifyCode'
+	})
+} 
+
+export function passwordLogin(data) {
+	 
+	 var url=""
+	 if(data.form=="job"){
+	 	url='/mobile/jobUserApi/passwordLogin';
+	 }else if(data.form=="hr"){
+	 	url='/mobile/sysUserApi/passwordLogin';
+	 }else{
+	 	return 
+	 }
+	 
+	return requestWhite({
+		method: 'post',
+		data:data ,
+		url: url
+	})
+} 

+ 70 - 0
apis/my.js

@@ -0,0 +1,70 @@
+import request from '../utils/request.js';
+import Qs from 'qs';
+
+export function passengerRecordList(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/passengerApi/passengerRecordList'
+	})
+}
+
+export function updateUserInfo(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/passengerApi/updateUserInfo'
+	})
+}
+
+
+export function problemFeedback(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/passengerApi/problemFeedback'
+		
+	})
+}
+
+export function userPhone(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/passengerApi/userPhone'
+		
+	})
+}
+
+export function userUpdatePhone(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/passengerApi/userUpdatePhone'
+		
+	})
+}
+
+
+
+export function passengerRecordDetail(id) {
+	return request({
+		method: 'post',
+		data: {
+			id:id
+		},
+		url: '/mobile/passengerApi/passengerRecordDetail'
+		
+	})
+}
+
+
+
+export function helpCenterList() {
+	return request({
+		method: 'post',
+	
+		url: '/mobile/passengerApi/helpCenterList'
+	})
+}
+

+ 36 - 0
apis/weixin.js

@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+ 
+import Qs from 'qs';
+
+//微信支付
+export function wxpay(orderId) {
+	return request({
+		url: '/wxPay/wxJsapiPay',
+		data: {
+			chargingMarketingId: orderId
+		},
+		method: 'post',
+	})
+}
+//根据code换取openid
+export function getDataByCode(code) {
+	return request({
+		url: '/wechat/findUserInfo/' + code,
+		params: {},
+		method: 'get',
+	})
+}
+
+
+
+//获得配置
+export function getConfig() {
+	
+	return request({
+		url: '/wechat/getConfig',
+		data: {
+			url: window.location.href.split('#')[0]
+		},
+		method: 'get',
+	})
+}

+ 0 - 0
assets/css/style.css


+ 78 - 0
assets/font/iconfont.css

@@ -0,0 +1,78 @@
+@font-face {
+	font-family: "custom-icon";
+	src:url('//at.alicdn.com/t/font_3140991_jqlw2xxtdk.woff2?t=1642217797275') format('woff2');
+}
+
+.custom-icon {
+  font-family: "custom-icon" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+.custom-icon-xiayiye:before {
+  content: "\e77c";
+}
+.custom-icon-jiagebaohu:before {
+  content: "\e603";
+}
+
+.custom-icon-iconfontscan:before {
+  content: "\e600";
+}
+
+.custom-icon-31wode:before {
+  content: "\e601";
+}
+
+.custom-icon-weixinzhifu:before {
+  content: "\e62a";
+}
+
+.custom-icon-kefu:before {
+  content: "\e604";
+}
+
+.custom-icon-dian:before {
+  content: "\e64d";
+}
+
+.custom-icon-tikuan:before {
+  content: "\e606";
+}
+
+.custom-icon-bofangjilu:before {
+  content: "\e8ad";
+}
+
+.custom-icon-shuaxin:before {
+  content: "\e8b9";
+}
+
+.custom-icon-tuichu:before {
+  content: "\e60d";
+}
+
+.custom-icon-dizhi:before {
+  content: "\e67e";
+}
+
+.custom-icon-chongdianzhuang:before {
+  content: "\e653";
+}
+
+.custom-icon-qichexiangguan-chongdianzhan:before {
+  content: "\e637";
+}
+
+.custom-icon-shoujichongdian:before {
+  content: "\e60e";
+}
+
+.custom-icon-juli:before {
+  content: "\e607";
+}
+
+.custom-icon-motuoche-diandongche:before {
+  content: "\e617";
+}

+ 7 - 0
assets/font/jptime.css

@@ -0,0 +1,7 @@
+@font-face {
+	font-family: "JPTIME";
+	src:url("@/assets/font/jptime.otf");
+}
+.JPTIME {
+    font-family: JPTIME
+}

二進制
assets/font/jptime.otf


二進制
assets/img/blankpage.png


二進制
assets/img/charge-0.png


二進制
assets/img/charge-1.png


二進制
assets/img/charge-2.png


二進制
assets/img/charge-3.png


二進制
assets/img/ddc.png


二進制
assets/img/head.png


二進制
assets/img/logo_xiaopengguanjia.png


二進制
assets/img/min_button_select.png


二進制
assets/img/shenhe.png


二進制
assets/img/tongguo.png


+ 153 - 0
bobo-router/README.md

@@ -0,0 +1,153 @@
+# bobo-router
+
+bobo-router 是一个基于uni-app框架的路由拦截插件,本项目借鉴了[uni-simple-router](https://github.com/SilurianYang/uni-simple-router)的思路,并对其进行简化,简化的原因是因为自己比较懒,不想每次新增页面就定义两遍路由表,所以`bobo-router`的特点就是纯粹的路由拦截,不再**定义两遍路由表**。
+
+当然,由于不再定义路由表,也损失了一些能力,比如不能使用命名路由,不能在路由表中自定义路由元信息等。
+
+> 本人不是大神,插件可能会存在各种各样的问题,望大家谨慎使用,并多多担待。
+
+## 安装
+
+下载插件后,在`main.js`中导入即可。
+
+```js
+// main.js
+
+import router from './utils/bobo-router'
+```
+
+## 基本使用
+
+同`uni-simple-router`一样,项目中的路由跳转要全部弃用`uni.navigateTo()`这样的系统跳转方法,转而使用插件提供的`this.$Router.push()`这样的方法。
+
+```js
+// *.vue
+
+// 跳转页面,保留当前页到页面栈,等同于 uni.navigateTo()
+this.$Router.push({
+	page: '/pages/index/index',
+	params: {}
+})
+
+// 跳转页面,替换当前页到页面栈,等同于 uni.redirectTo()
+this.$Router.replace({
+	page: '/pages/index/index',
+	params: {}
+})
+
+// 跳转页面,清空页面栈,等同于 uni.reLaunch()
+this.$Router.replaceAll({
+	page: '/pages/index/index',
+	params: {}
+})
+
+// 跳转 Tabbar,等同于 uni.switchTab()
+this.$Router.pushTab({
+	page: '/pages/index/index',
+	params: {}
+})
+```
+
+> Tips: 
+> 如果不需要传递参数,可以直接使用 this.$Router.push('/pages/index/index')
+
+> 注意:
+> pushTab传递的参数可通过this.$Route.params获取,但h5页面刷新之后就会丢失数据
+
+## 路由拦截
+
+支持路由前置守卫和路由后置守卫,并且提供一个路由跳转失败的回调,可以重写以实现自己的逻辑。
+
+在`bobo-router/index.js`中添加自己的拦截逻辑。
+
+```js
+// ./utils/bobo-router/index.js
+
+// 路由全局拦截器 在这里处理登录、授权等相关操作
+router.beforeEach(function(to, from, next) {
+	console.log('前置守卫')
+	// to.page不存在表示此次路由跳转仅为了执行路由守卫,若不需处理则直接放行,就不会执行任何路由操作了
+	if (from.page === '/pages/plugin/routers/r3' && !to.page) {
+	// 测试小程序跳转
+	// if (from.page === '/pages/index/index' && !to.page) {
+		next({page: '/pages/plugin/routers/r4', params: {
+			message: '我是从路由3刷新跳过来的'
+		}, method: 'redirectTo'})
+	} else {
+		next()
+	}
+})
+
+// 路由后置拦截器 在这里处理用户高频操作信息
+router.afterEach(function (to, from) {
+	console.log('后置守卫')
+})
+
+// 路由跳转出错处理
+router.onError(function(e) {
+	console.log('错误:', e.message || '路由跳转失败')
+})
+```
+
+参数解释:
+
+**to**:目标路由信息,包含`method`路由跳转方式、`page`页面地址和`params`页面参数
+
+> 注:在进入应用的第一个页面或h5刷新页面后会执行路由前置守卫,此时 to 中的属性均为 undefined
+
+**from**:当前路由信息,包含`page`页面地址和`params`页面参数
+
+**next**:下一步操作
+
+- `next(false)` 中断路由跳转
+- `next('/pages/index/index')` 执行指定页面的路由前置守卫,若当前操作指定过跳转方式,则使用该跳转方式,否则使用默认的push进行跳转
+- `next({page:'/pages/index/index',params:{},method:''})` 执行指定页面的路由前置守卫,method传入跳转方式,也可以不指定,效果同直接传入页面地址
+- `next()` 放行 执行跳转操作
+
+## 参数解析
+
+使用本插件的方法去跳转路由,会将对象的第一级属性转换到URL中,深层对象则转为json串放在对应的属性中。
+
+例如:
+
+```js
+// 转换前对象
+{
+	num: 19,
+	numStr: '19',
+	testParams: true,
+	deepObj: {
+		str: 'hahaha'
+	},
+	ignoreFun: function() {
+		console.log('i\'m hide.')
+	},
+	testUndefined: undefined,
+	testNull: null
+}
+
+// 转换后URL
+?num=19&numStr=19&testParams=true&deepObj=%7B"str"%3A"hahaha"%7D&testUndefined=&testNull=
+```
+
+如果要获取当前路由信息,可通过`this.$Route`获取。
+
+```js
+{
+    "path": "/pages/plugin/router?num=19&numStr=19&testParams=true&deepObj={\"str\":\"hahaha\"}&testUndefined=&testNull=",
+    "params": {
+        "num": 19,
+        "numStr": "19",
+        "testParams": true,
+        "deepObj": {
+            "str": "hahaha"
+        },
+        "testNull": null
+    },
+    "page": "/pages/plugin/router",
+    "pageTitle": "路由拦截插件"
+}
+```
+
+> 页面标题 pageTitle 是在页面中的 data(){}代码块中定义了之后才能正常显示,且只能在onload生命周期之后使用。
+> h5端则不需要定义pageTitle,插件可直接获取当前网页标题。

+ 362 - 0
bobo-router/bobo-router.js

@@ -0,0 +1,362 @@
+class Router {
+	constructor(arg) {
+		if (arg && arg.constructor !== Object) {
+			return console.error(`Routing configuration must be an Object`)
+		}
+		Router.$root = this;
+	}
+
+	// 路由跳转方法映射
+	routeMap = {
+		push: 'navigateTo',
+		replace: 'redirectTo',
+		replaceAll: 'reLaunch',
+		pushTab: 'switchTab'
+	}
+
+	/**
+	 * 执行路由跳转
+	 */
+	_pushTo() {
+		return new Promise((resolve, reject) => {
+			let {
+				page,
+				params,
+				method
+			} = this.tempRoute
+			// 对首次进入页面执行路由守卫时如果放行,method page params都为空 此时应该直接中断流程,无需抛出异常
+			if (!method && !page && !params) {
+				return
+			}
+
+			let urlParams = '?'
+			if (!page) {
+				reject(new Error('参数page未填写'))
+				return
+			} else if (params && typeof(params) === 'object') {
+				// 处理参数,转换为url字符串
+				Object.keys(params).forEach(k => {
+					// 深度对象转为json字符串(包含数组)
+					if (typeof(params[k]) === 'object') {
+						if (params[k]) {
+							const json = JSON.stringify(params[k])
+							urlParams += `${k}=${json}&`
+						} else {
+							urlParams += `${k}=&`
+						}
+					} else if (typeof(params[k]) === 'number' || typeof(params[k]) === 'string' || typeof(params[k]) ===
+						'boolean') {
+						// 基础值直接写入
+						urlParams += `${k}=${params[k]}&`
+					} else if (typeof(params[k]) === 'undefined') {
+						urlParams += `${k}=&`
+					}
+				})
+			}
+
+			// 参数组装
+			if (urlParams.length === 1) {
+				urlParams = ''
+			} else {
+				urlParams = urlParams.substr(0, urlParams.length - 1)
+			}
+
+			// 设置路由跳转方式
+			if (!method) {
+				method = 'navigateTo'
+			}
+			if (this.routeMap[method]) {
+				method = this.routeMap[method]
+			}
+
+			// 调用系统跳转方法
+			uni[method]({
+				url: page + urlParams,
+				success: () => {
+					// 执行路由后置守卫
+					if (this._afterEach && typeof(this._afterEach) === 'function') {
+						this._afterEach.call(this, this.tempRoute, this.route)
+					}
+
+					// 更新路由信息
+					this.route = {
+						path: page + urlParams,
+						params: params || {},
+						page
+					}
+					this.tempRoute = null
+					resolve()
+				},
+				fail: (e) => {
+					reject(new Error('路由跳转失败!'))
+				}
+			})
+		})
+	}
+
+	/**动态的导航到一个新 URL 保留浏览历史
+	 * navigateTo
+	 * @param {Object} rule
+	 */
+	push(arg) {
+		const rule = {
+			method: 'navigateTo'
+		}
+		if (typeof(arg) === 'string') {
+			rule.page = arg
+		} else if (typeof(arg) === 'object') {
+			rule.page = arg.page
+			rule.params = arg.params
+		}
+		this.next(rule)
+	}
+
+	/**动态的导航到一个新 URL 关闭当前页面,跳转到的某个页面。
+	 * redirectTo
+	 * @param {Object} rule
+	 */
+	replace(arg) {
+		const rule = {
+			method: 'redirectTo'
+		}
+		if (typeof(arg) === 'string') {
+			rule.page = arg
+		} else if (typeof(arg) === 'object') {
+			rule.page = arg.page
+			rule.params = arg.params
+		}
+		this.next(rule)
+	}
+
+	/**动态的导航到一个新 URL 关闭所有页面,打开到应用内的某个页面
+	 * 	reLaunch
+	 * @param {Object} rule
+	 */
+	replaceAll(arg) {
+		const rule = {
+			method: 'reLaunch'
+		}
+		if (typeof(arg) === 'string') {
+			rule.page = arg
+		} else if (typeof(arg) === 'object') {
+			rule.page = arg.page
+			rule.params = arg.params
+		}
+		this.next(rule)
+	}
+
+	/** 跳转Tabbar
+	 * 	switchTab
+	 * @param {Object} rule
+	 */
+	pushTab(arg) {
+		const rule = {
+			method: 'switchTab'
+		}
+		if (typeof(arg) === 'string') {
+			rule.page = arg
+		} else if (typeof(arg) === 'object') {
+			rule.page = arg.page
+			rule.params = arg.params
+		}
+		this.next(rule)
+	}
+
+
+	/**
+	 * 返回到指定层级页面上
+	 */
+	back(delta = 1) {
+		// 返回上级
+		if (delta.constructor != Number) {
+			this._errorHandler(new Error('返回层级参数必须是一个Number类型且必须大于0:'))
+			return
+		}
+		uni.navigateBack({
+			delta
+		})
+	}
+
+	/**
+	 * 分发路由
+	 * @param {Object} args
+	 */
+	_next() {
+		return new Promise((resolve, reject) => {
+			if (this._beforeEach && typeof(this._beforeEach) === 'function') {
+				// 需要传给守卫 to from next
+				this._beforeEach.call(this, this.tempRoute, this.route, resolve)
+			} else {
+				this._pushTo().catch(e => {
+					reject(e)
+				})
+			}
+		})
+	}
+
+	next(args) {
+		if (args) {
+			// 保存临时数据
+			if (typeof(args) === 'object') {
+				this.tempRoute = {
+					// 第一次调用next一定存在method,后续循环调用可能不会存在,不存在时使用上次缓存的method
+					method: args.method || this.tempRoute.method,
+					page: args.page,
+					params: args.params
+				}
+			} else if (typeof(args) === 'string') {
+				this.tempRoute = {
+					page: args
+				}
+			} else if (!args) {
+				// 中断路由 args = false
+				this.tempRoute = null
+				return
+			}
+
+			if (!this.route) {
+				this.route = {
+					page: '/' + getCurrentPages()[0].route
+				}
+			}
+
+			this._next().then(args => {
+				this.next(args)
+			}).catch(e => {
+				this.tempRoute = null
+				this._errorHandler(e)
+			})
+		} else {
+			this._pushTo().catch(e => {
+				this.tempRoute = null
+				this._errorHandler(e)
+			})
+		}
+	}
+
+	/**
+	 * 应用启动时执行一次路由检查(前置守卫,若通过则不做事情)
+	 */
+	doBeforeHooks() {
+		this.tempRoute = {}
+		this.next({})
+	}
+
+	// 设置路由前置/后置守卫
+	beforeEach(fn) {
+		this._beforeEach = fn
+	}
+	afterEach(fn) {
+		this._afterEach = fn
+	}
+	// 设置路由跳转错误处理
+	onError(fn) {
+		if (fn && typeof(fn) === 'function') {
+			this._errorHandler = fn
+		}
+	}
+
+	// 获取当前路由信息
+	getCurrentRoute() {
+		return this.route
+	}
+
+}
+
+// 路由对象属性定义
+Router.$root = null
+// 当前路由内容
+Router.route = null
+// 临时路由信息
+Router.tempRoute = null
+// 路由前置后置守卫
+Router._beforeEach = null
+Router._afterEach = null
+// 路由跳转错误处理
+Router._errorHandler = function(e) {
+	console.error(e)
+}
+
+Router.install = function(Vue) {
+	Vue.mixin({
+		onLaunch: function() {},
+		onLoad: function(props) {
+			// 首次进入页面时,缓存中不存在当前路由信息,需要初始化路由信息
+			if (!Router.$root.getCurrentRoute()) {
+				const rt = {
+					params: {},
+					page: '/' + getCurrentPages()[0].route
+				}
+				if (props) {
+					Object.keys(props).forEach(k => {
+						// url转的对象全部都是字符串,需要识别其中的对象和基本数据类型
+						try {
+							const obj = JSON.parse(props[k])
+							if (typeof(obj) === 'string') {
+								// 只有字符串还会是字符串,数字、布尔、数组均会转换为正常类型
+								rt.params[k] = props[k]
+							} else {
+								rt.params[k] = obj
+							}
+						} catch (e) {
+							rt.params[k] = props[k]
+						}
+					})
+				}
+				Router.$root.route = rt
+
+				// 执行路由前置守卫
+				Router.$root.doBeforeHooks()
+			}
+
+			// 自动获取页面标题(app端可能获取不到)
+			const pages = getCurrentPages()
+			let pageTitle = pages[pages.length - 1].pageTitle
+			// #ifdef H5
+			if (!pageTitle) {
+				pageTitle = document.title
+			}
+			// #endif
+			Router.$root.route.pageTitle = pageTitle
+		},
+
+		onShow() {
+			if (!getCurrentPages().length) {
+				return
+			}
+			// 获取当前路由信息
+			const pages = getCurrentPages()
+			const page = pages[pages.length - 1]
+			let pageTitle = page.pageTitle
+			const rt = {
+				params: {},
+				page: '/' + page.route,
+			}
+			if (!pageTitle) {
+				// #ifdef H5
+				rt.pageTitle = document.title
+				// #endif
+			} else {
+				rt.pageTitle = pageTitle
+			}
+			
+			const route = Router.$root.route
+			// 若当前页面地址不等于缓存中地址,则更新缓存路由信息
+			if (!route || route.page !== rt.page) {
+				Router.$root.route = rt
+			}
+		}
+	})
+	Object.defineProperty(Vue.prototype, "$Router", {
+		get: function() {
+			return Router.$root
+		}
+	})
+	Object.defineProperty(Vue.prototype, "$Route", {
+		get: function() {
+			return Router.$root.getCurrentRoute()
+		}
+	})
+}
+
+export default Router

+ 68 - 0
bobo-router/index.js

@@ -0,0 +1,68 @@
+ 
+// import  carhelp from '@/utils/mixin.js'
+
+import Vue from 'vue'
+import uniCrazyRouter from "uni-crazy-router";
+Vue.use(uniCrazyRouter)
+//** 有bug, 第一次直接敲链接访问, 是访问bobo-router 前置守卫
+//**  后续操作,访问的是 uniCrazyRouter的前置守卫
+
+
+uniCrazyRouter.beforeEach(async (to, from, next) => {
+
+
+	routerBeforeEach(to, from, next);
+	
+})
+
+uniCrazyRouter.afterEach((to, from) => {
+	// 逻辑代码
+	console.log("afterEach")
+	if(process.car.NODE_ENV=='dev'||process.car.NODE_ENV=='test'){
+		    uni.setNavigationBarTitle({
+		       		title:'智能充电系统('+process.car.NODE_ENV+')',
+		    						
+		    }) 
+		}
+	
+})
+
+uniCrazyRouter['on' + 'Error']((to, from) => {
+	// 逻辑代码
+	console.log("Error+start")
+	console.log(to)
+	console.log(from)
+	console.log("Error+end")
+	
+})
+
+import Router from './bobo-router'
+
+Vue.use(Router)
+
+// 路由配置 页面中全部使用this.$Router来操作路由,以实现路由的全局管理
+const router = new Router()
+
+// 路由全局拦截器 在这里处理登录、授权等相关操作
+router.beforeEach(function(to, from, next) {
+	
+	console.log('前置守卫')
+	routerBeforeEach(to, from, next);
+
+})
+ 
+
+function routerBeforeEach(to, from, next) {
+	next();
+}
+// 路由后置拦截器
+router.afterEach(function(to, from) {
+	console.log('后置守卫')
+})
+
+// 路由跳转出错处理
+router.onError(function(e) {
+	console.log('错误:', e.message || '路由跳转失败')
+})
+
+export default router

+ 84 - 0
components/Tabbar.vue

@@ -0,0 +1,84 @@
+<template >
+	<view>
+		<u-tabbar v-model="myCurrent" :list="tabbarList" 
+		:before-switch="beforeSwitch"
+		:mid-button="true" active-color="#1677ff"></u-tabbar>
+		
+	</view>
+</template>
+
+<script>
+ 	
+ 	export default {
+		name:"tabbarJob",
+		props:{
+			current: 0
+			
+		},
+		data() {
+			return {
+				activeColor:"#5098FF",
+				oldindex:this.current,
+				 myCurrent:this.current,
+				 tabbarList: [{
+				 		iconPath: "motuoche-diandongche",
+				 		selectedIconPath: "motuoche-diandongche",
+				 		text: '充电中',
+				 		count: 0,
+				 		isDot: true,
+				 		customIcon: true,
+						pagePath2:"/pages/index/index?k=1",
+						
+				 	},
+				 	{
+				 		iconPath: "/static/img/min_button_select.png",
+				 		selectedIconPath: "/static/img/min_button_select.png",
+				 		text: '充电',
+				 		midButton: true,
+				 		customIcon: true,
+						pagePath2:"/pages/charge/index",
+				 	},
+				 	{
+				 		iconPath: "31wode",
+				 		selectedIconPath: "31wode",
+				 		text: '我的',
+				 		count: 0,
+				 		isDot: false,
+				 		customIcon: true,
+						pagePath2:"/pages/user/index",
+				 	},
+				 ],
+			};
+			
+		},methods:{
+			beforeSwitch(index){
+			
+				
+				if(index==this.current){
+					return false
+				}
+				var url =this.tabbarList[index].pagePath2;
+				
+				uni.navigateTo({
+					url: url
+				})
+				if(index==1){
+					this.myCurrent=this.oldindex;
+					return false;
+				}else{
+					return true;
+				}
+				
+			},
+			
+		},mounted(){
+			
+		},destroyed(){
+		}
+		
+	}
+</script>
+
+<style>
+	 
+</style>

+ 472 - 0
console.js

@@ -0,0 +1,472 @@
+ var list =[ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages	
+		
+		{
+			"name":"IndexIndex",
+			"path": "pages/index/index",
+			"style": {
+	
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		}
+
+      
+        ,{//微信登录
+            "path" : "pages/login/wxLogin/wxLogin",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "微信登录",
+                
+            }
+            
+        }
+        ,{//手机号登录
+            "path" : "pages/login/phoneLogin/phoneLogin",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "手机号登录",
+                
+            }
+            
+        }
+        ,{//填写验证码
+            "path" : "pages/login/vCode/vCode",
+            "style" :                                                                                    
+            {           
+                "navigationBarTitleText": "填写验证码",
+                
+            }
+            
+        }
+        ,{//密码登录
+            "path" : "pages/login/passwordLogin/passwordLogin",
+            "style" :                                                                                    
+            {              
+                "navigationBarTitleText": "密码登录",
+                
+            }
+            
+        }
+      
+        ,{
+            "path" : "pages/job/index/index",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "求职主页",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/index/recruitInfo/recruitInfo",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "招聘详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/index/companyInfo/companyInfo",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "企业详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/query/query",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "搜索",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/query/queryResult/queryResult",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "搜索结果",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/newsIndex/newsIndex",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "分类消息",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/newsIndex/newsList/newsList",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "消息列表",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/newsIndex/newsRecommend/newsRecommend",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "推荐职位",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/newsIndex/newsInvitationPhone/newsInvitationPhone",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "沟通邀请通知",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/newsIndex/newsInvitationBefore/newsInvitationBefore",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "面试邀请通知",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/newsIndex/newsEntry/newsEntry",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "录用意向书详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/personal",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "个人中心",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/my/my",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "我的",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+     
+        ,{
+            "path" : "pages/job/personal/my/resumeMy/resumeMy",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "我的简历",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/my/resumeAdd/resumeAdd",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "创建简历",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+		,{
+		    "path" : "pages/job/personal/my/resumeAdd/resumeSelect/resumeSelect",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "选择职位输入",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+		,{
+		    "path" : "pages/job/personal/my/resumeAdd/resumeEdit/resumeEdit",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "编辑自我介绍",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+		,{
+		    "path" : "pages/job/personal/my/resumeAdd/resumeSucc/resumeSucc",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "简历提交成功",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+        ,{
+            "path" : "pages/job/personal/my/resumeList/resumeList",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "投递记录",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/my/resumeLook/resumeLook",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "看过的职位",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/my/resumeCollect/resumeCollect",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "职位收藏",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/my/resumeAuth/resumeAuth",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "个人认证",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+		,{
+		    "path" : "pages/job/personal/install/install",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "设置",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+        ,{
+            "path" : "pages/job/personal/install/myInfo/myInfo",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "个人信息",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/install/account/account",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "账号管理",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/install/account/passwordA/passwordA",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "忘记密码",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/install/account/passwordB/passwordB",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "验证码找回",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/install/account/passwordC/passwordC",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "重设密码",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/install/account/phoneA/phoneA",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "填写验证码",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/install/account/phoneB/phoneB",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "绑定手机号",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/install/account/phoneC/phoneC",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "绑定验证码 Copy",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/job/personal/about/about",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "关于我们",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/index/index",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "招聘主页",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/index/resumeInfo/resumeInfo",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "简历详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/query/query",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "搜索",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/query/queryResult/queryResult",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "搜索结果",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/newsIndex/newsIndex",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "消息分类",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/newsIndex/newsList/newsList",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "消息列表",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/newsIndex/newsRecommend/newsRecommend",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "推荐简历",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+       
+        ,{
+            "path" : "pages/hr/newsIndex/servicesList/servicesList",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "劳务对接列表",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/newsIndex/servicesInfo/servicesInfo",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "劳务对接详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/my/my",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "我的",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/my/position/position",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "职位管理",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/my/follow/follow",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "对您感兴趣",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/my/enroll/enroll",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "求职管理",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/hr/my/collection/collection",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "收藏简历",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ];
+	var my=[];
+	for(var i in list){
+		var obj=list[i];
+		my.push(obj.style.navigationBarTitleText);
+	}
+	console.log(my);

+ 25 - 0
font.js

@@ -0,0 +1,25 @@
+(function() {
+				if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
+					handleFontSize();
+				} else {
+					if (document.addEventListener) {
+						document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
+					} else if (document.attachEvent) {
+						document.attachEvent("WeixinJSBridgeReady", handleFontSize);
+						document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
+					}
+				}
+
+				function handleFontSize() {
+					/*设置网页字体为默认大小*/
+					WeixinJSBridge.invoke('setFontSizeCallback', {
+						'fontSize': 0
+					});
+					/*重写设置网页字体大小的事件*/
+					WeixinJSBridge.on('menu:setfont', function() {
+						WeixinJSBridge.invoke('setFontSizeCallback', {
+							'fontSize': 0
+						});
+					});
+				}
+			})();

+ 49 - 0
main.js

@@ -0,0 +1,49 @@
+import Vue from 'vue'
+import App from './App'
+//import MyCommon from '@/components/Common.vue'
+//import CarLoading from '@/components/Loading.vue'
+import  getOpenId from './utils/init.js'
+getOpenId.init()
+
+import  mixin from './utils/mixin.js'
+
+Vue.config.ignoredElements.push("wx-open-subscribe") ;
+Vue.prototype.carhelp=mixin
+
+import Vconsole from 'vconsole'
+ //import './router' // 引入路由
+import router from './bobo-router'
+
+
+// main.js
+import uView from "uview-ui";
+Vue.use(uView);
+
+Vue.config.productionTip = false
+App.mpType = 'app'
+
+const app = new Vue({
+
+    ...App
+})
+//Vue.component('my-common',MyCommon)
+//Vue.component('car-loading',CarLoading)
+//Vue.use(mixin)
+Vue.mixin({ 
+    onLoad( option){  
+        if (option.test == 'test') {
+        	let vConsole = new Vconsole()
+        }
+		
+    } ,methods:{
+	
+		gotoUrl(url){
+			uni.navigateTo({
+				url:"/"+url
+			})
+		}
+	}
+})
+
+
+app.$mount()

+ 87 - 0
manifest.json

@@ -0,0 +1,87 @@
+{
+    "name" : "jp-xqjy",
+    "appid" : "__UNI__ECBC506",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    /* 5+App特有相关 */
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        /* 模块配置 */
+        "modules" : {},
+        /* 应用发布信息 */
+        "distribute" : {
+            /* android打包配置 */
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios" : {},
+            /* SDK配置 */
+            "sdkConfigs" : {}
+        }
+    },
+    /* 快应用特有相关 */
+    "quickapp" : {},
+    /* 小程序特有相关 */
+    "mp-weixin" : {
+        "appid" : "wxa8954f417fa7c32f",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "usingComponents" : true
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
+    },
+    "mp-baidu" : {
+        "usingComponents" : true
+    },
+    "mp-toutiao" : {
+        "usingComponents" : true
+    },
+    "uniStatistics" : {
+        "enable" : false
+    },
+    "h5" : {
+        "devServer" : {
+            "port" : 8080,
+            "https" : false,
+            "disableHostCheck" : true
+        },
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : true
+            }
+        },
+        "title" : "智能充电系统",
+        "router" : {
+            "base" : "./"
+        }
+    }
+}

+ 56 - 0
package.json

@@ -0,0 +1,56 @@
+{
+ "scripts": {
+  "test:h5": "cross-env UNI_PLATFORM=h5 jest -i",
+  "serve": "vue-cli-service serve",
+  "build": "vue-cli-service build",
+  "test": "vue-cli-service build --mode test"
+ },
+ "dependencies": {
+  "compression-webpack-plugin": "^8.0.1",
+  "uni-crazy-router": "0.0.31",
+  "uni-simple-router": "^2.0.1",
+  "uview-ui": "^1.8.4",
+  "vconsole": "^3.4.0",
+  "vue-cli": "^2.9.6",
+  "vue-cropper": "^0.5.6",
+  "vuex": "^3.6.2",
+  "weixin-js-sdk": "^1.6.0"
+ },
+ "devDependencies": {
+  "node-sass": "^5.0.0",
+  "sass-loader": "^11.0.1",
+  "@vue/cli-plugin-babel": "^4.0.0",
+  "@vue/cli-plugin-eslint": "^4.0.0",
+  "@vue/cli-service": "^4.0.0",
+  "babel-eslint": "^10.0.3",
+  "eslint": "^5.16.0",
+  "eslint-plugin-vue": "^5.0.0",
+  "vue-template-compiler": "^2.6.10"
+ },
+   "uni-app": {
+         "scripts": {
+             "test-platform": { 
+                 "title":"test", 
+                 "BROWSER":"Chrome", 
+                 "env": {
+                     "UNI_PLATFORM": "h5",  
+                     "NODE_NAME": "test"
+                  },
+                 "define": { 
+                     "CUSTOM-CONST": true 
+                 }
+             },
+			 "production-platform": {
+			     "title":"production", 
+			     "BROWSER":"Chrome", 
+			     "env": {
+			         "UNI_PLATFORM": "h5",  
+			         "NODE_NAME": "production"
+			      },
+			     "define": { 
+			         "CUSTOM-CONST": true 
+			     }
+			 }
+         }    
+     }
+}

+ 99 - 0
pages.json

@@ -0,0 +1,99 @@
+{
+	"easycom": {
+			"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+		},
+	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages	
+		
+		
+		{
+			"name":"充电中",
+			"path": "pages/index/index",
+			"style": {
+			
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"充电",
+			"path": "pages/charge/index",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		
+		
+		{
+			"name":"切换充电桩",
+			"path": "pages/charge/switchCharge",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"充电记录",
+			"path": "pages/charge/chargeList",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"充电详情",
+			"path": "pages/charge/chargeDetails",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"我的",
+			"path": "pages/user/index",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"余额充值",
+			"path": "pages/user/recharge",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"充值记录",
+			"path": "pages/user/rechargeList",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},{
+			"name":"充值详情",
+			"path": "pages/user/rechargeDeatils",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"登录",
+			"path": "pages/index/none",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name":"登录",
+			"path": "pages/login/index",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		}
+		
+
+      
+    ],
+ 
+	"globalStyle": {
+			"navigationStyle": "custom", // 隐藏系统导航栏
+			"navigationBarTitleText": "智能充电系统",
+			"enablePullDownRefresh": false
+			
+	}
+  
+}

+ 106 - 0
pages/charge/chargeDetails.vue

@@ -0,0 +1,106 @@
+<template>
+	<view>
+		<u-navbar title="充电详情">
+		</u-navbar>
+		<view class="chargeDetails">
+			<view class="chargeDetails-item">
+				<span>金额</span>
+				<p class="price">{{isnull(detail.actualFee!=null?detail.actualFee:detail.estimateFee)}}元</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>桩名</span>
+				<p>{{detail.deviceName}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>桩号</span>
+				<p>{{detail.deviceNo}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>充电通道</span>
+				<p>{{detail.channelNo}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>结束原因</span>
+				<p>{{detail.remark}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>开始时间</span>
+				<p>{{detail.startTime}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>结束时间</span>
+				<p>{{detail.endTime}}</p>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/index.js'
+	
+	export default {
+		data() {
+			return {
+				id:'',
+				detail:{
+					
+				}
+			}
+		},
+		onLoad(op){
+			this.id=op.id;
+			this.getInfo()
+		},
+		methods: {
+			isnull(str){
+				if(!str){
+					return 0
+				}else{
+					return str
+				}
+			},
+			getInfo(){
+				uni.showLoading({
+					title:"加载中",mask:true,
+				})
+				API.chargingDetail(this.id).then((res) => {
+					this.detail=res.data.chargingRecord	 
+					
+					uni.hideLoading()
+					 
+				}).catch(error => {
+						uni.showToast({
+							
+							title:error
+						})
+				})
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.chargeDetails{
+		background-color: #FFFFFF;
+		.chargeDetails-item{
+			margin:0 10px;
+			border-bottom: 1px solid #F7F7F7;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 15px;
+		}
+		span{
+			color:#999;
+		}
+		.price{
+			font-size: 20px;
+			color:#FF3D00;
+			font-weight: bold;
+		}
+	}
+</style>

+ 176 - 0
pages/charge/chargeList.vue

@@ -0,0 +1,176 @@
+<template>
+	<view>
+		<u-navbar title="充电记录">
+		</u-navbar>
+		<view class="chargeScreen">
+			<view class="chargeScreen-item">
+				<p>
+				 <picker mode="date" :value="startDate"  :end="endDate"   @change="bindDateChange0">
+				            <view class="uni-input">{{startDate}}</view>
+				     </picker>
+				</p>
+				<u-icon name="arrow-down-fill" color="#999" size="24"></u-icon>
+			</view>
+			<span>至</span>
+			<view class="chargeScreen-item">
+				<p>
+				<picker mode="date" :value="endDate" :start="startDate"   @change="bindDateChange1">
+				           <view class="uni-input">{{endDate}}</view>
+				    </picker>
+				
+				</p>
+				<u-icon name="arrow-down-fill" color="#999" size="24"></u-icon>
+			</view>
+		</view>
+		<view class="chargeList">
+			<view v-for="(item ,index) in list" :key="item.id"
+			 @click="gotoUrl('pages/charge/chargeDetails?id='+item.id)"
+			 class="chargeList-item" 
+			 >
+				<view class="chargeList-text">
+					<p>{{item.createTime}}</p>
+					<h4>{{item.deviceName}} 通道:{{item.channelNo}}</h4>
+				</view>
+				<span>{{isnull(item.actualFee!=null?item.actualFee:item.estimateFee)}}元</span>
+			</view>
+		
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/index.js'
+	import {parseUnixTime,beforeTimeStamp} from  '@/utils/index.js'
+	
+	export default {
+		data() {
+			return {
+				form:{
+					
+				},
+				startDate:'',
+				endDate:'',
+				pageIndex: 1,
+				recordsTotal: 0,
+				list: [],
+			}
+		},
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
+		methods: {
+			isnull(str){
+				if(!str){
+					return 0
+				}else{
+					return str
+				}
+			},
+			  bindDateChange0: function(e) {
+			            this.startDate= e.target.value
+			            
+						
+						this.getList(true)
+			  },
+			  bindDateChange1: function(e) {
+			          this.endDate= e.target.value
+			          
+			  						this.getList(true)
+			  },
+			myLoadmore() {
+		
+				this.pageIndex += 1;
+				this.getList()
+			},
+			getList(bl) {
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if (bl) {
+					this.list = [];
+					this.pageIndex = 1;
+				}
+				var data = {
+					startDate:this.startDate,
+					endDate:this.endDate,
+					pageIndex: this.pageIndex
+				};
+				API.chargingRecordData(data).then((res) => {
+		
+					this.list = [
+						...this.list,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal
+					uni.hideLoading()
+		
+				}).catch(error => {
+					uni.showToast({
+		
+						title: error
+					})
+				})
+			},
+			onReady() {
+				this.startDate=parseUnixTime(beforeTimeStamp(5),"{y}-{m}-{d}")
+				this.endDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
+				
+				this.getList()
+				
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.chargeScreen{
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 10px 0;
+		background-color: #fff;
+		span{
+			color:#777;
+		}
+	}
+	.chargeScreen-item{
+		display: flex;
+		align-items: center;
+		flex: 1;
+		justify-content: center;
+		p{
+			color:#777;
+			margin-right: 5px;
+		}		
+	}
+	.chargeList{
+		margin-top: 10px;
+	}
+	.chargeList-item{
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 15px;
+		background-color: #fff;
+		border-bottom: 1px solid #f7f7f7;
+		h4{
+			font-weight: normal;
+			color:#999;
+			margin-top: 3px;
+			font-size: 12px;
+		}
+		span{
+			font-size: 20px;
+			color:#1677FF;
+			font-weight: bold;
+		}
+	}
+</style>

+ 494 - 0
pages/charge/index.vue

@@ -0,0 +1,494 @@
+<template>
+	<view>
+		<u-navbar title="充电">
+			<view class="slot-wrap">
+				<view class="navbar-left"></view>				
+<!-- 				<view class="navbar-right"><u-icon name="iconfontscan" custom-prefix="custom-icon" color="#1677ff" size="40"></u-icon></view>
+ -->			</view>
+		</u-navbar>
+		<view class="charge">
+			<view class="chargeInfo">
+				<view class="chargeInfo-row">
+					<view class="u-flex"><p>桩号:</p><h4>{{detail.deviceNo}}</h4></view>
+					<view class="u-flex" @click="switchCharge">
+						<span>切换充电桩</span>
+						<u-icon name="arrow-right" color="#999" size="24"></u-icon>
+					</view>
+				</view>
+				<view class="chargeInfo-row">
+					<view class="u-flex"><p>桩名:</p><h4>{{detail.name}}</h4></view>
+					<view class="u-flex" @click="showTips()">
+						<span>费用说明</span>
+						<u-icon name="error-circle" color="#1677ff" size="32" ></u-icon>
+					</view>
+				</view>
+			
+			</view>
+			<view class="chargeMain">
+				<template v-for="(item,i) in list">
+					
+					<view :key="i" class="chargeMain-item "
+					@click="selectItem(item)"
+					:class="{
+						'active':item.channelNo==submitForm.channelNo,
+						'occupy':item.status==1,
+						'fault':item.status==2,
+					}"
+					
+					><p>{{i+1}}</p>
+					<p >{{item.statusStr}}</p>
+					
+					</view>
+					
+				</template>
+				<h2 v-if="isReady&&list.length==0">无可用通道<br/>请联系客服人员</h2>
+				 
+			</view>
+		</view>
+		<view class="charge">
+			<view class="chargeTime">
+				
+				<view v-for="(item,i) in timelist" 
+					class="chargeTime-item " :key="i"
+					@click="submitForm.hour=item.id"
+					:class="{
+						'chargeTime-active':submitForm.hour==item.id,
+						
+						'chargeTime-first':i==0
+					}"
+					>
+					<template v-if="i==0">
+						<p>充满</p><p>自停</p>
+					</template>
+						<template v-else>
+							{{item.name}}
+						</template>
+				</view>
+					
+			</view>
+			<view class="chargeTime-text">
+				<p>充电时长</p>
+				<span>{{timelist[submitForm.hour].name}}</span>
+			</view>
+		</view>
+		<view style="padding-bottom: 100px;">
+			<view class="charge">
+				<view class="chargeRadio">
+					<view class="u-flex">
+						<u-icon name="rmb-circle-fill"  color="#ff9502" size="90"></u-icon>
+						<view class="chargeRadio-text">
+							<p>余额支付</p>
+							<p>现有余额¥{{user.accountBalance}} </p>
+						</view>
+					</view>
+					<u-button type="warning"  style="    height: 34px;"
+						@click='gotoUrl("pages/user/recharge")'
+					>我要充值</u-button>
+				</view>
+			</view>
+		</view>
+	
+		<view class="foot-btn">
+			<u-button type="primary" :custom-style="customStyle" 
+				@click="submit"
+			shape="square">开始充电</u-button>
+		</view>
+		
+		<u-modal v-model="showPriceList" title="费用说明" >
+			
+			<p v-for="(item,i) in detail.priceList" class="showPriceList" :key="i">{{item.minPower}}W-{{item.maxPower}}W <span>{{item.price}}元每小时</span></p>
+			
+			<p style="    padding: 15px;" v-if="detail.roundingMinute!=null&&detail.roundingMinute!=-1">超过{{detail.roundingMinute}}分钟,按1小时记,不足{{detail.roundingMinute}}分钟,不计费</p>
+			<p style="    padding: 15px;" v-if="detail.priceList.length==0">无费用说明或为免费充电模式</p>
+		</u-modal>
+		
+		<u-modal v-model="showmodel" @confirm="confirm" :showCancelButton="true" title="订单信息" >
+			<div class="showmodel" ><p  >桩号</p>{{detail.deviceNo}}</div>
+			<div class="showmodel" ><p  >充电通道</p>{{submitForm.channelNo}}</div>
+			<div class="showmodel" ><p  >支付方式</p>余额支付</div>
+			<div class="showmodel" ><p  >充电时间</p>{{timelist[submitForm.hour].name}}</div>
+			
+			<p class="showmodel" style="color: red;" v-if="submitForm.hour==0" >充满自停模式,设备充满后会自动停止计费,剩余费用会原路返还</p>
+			
+		</u-modal>
+		
+	</view>
+</template>
+	
+<script>
+	import * as API  from '@/apis/index.js'
+	
+	export default {
+		data() {
+			return {
+				id:"",
+				showPriceList:false,
+				showmodel:false,
+				//充电桩信息
+				detail:{
+					roundingMinute:-1,
+					priceList:[],
+				},
+				user:{},
+				//充电位子list
+				list:[
+					 
+				],
+				timelist:[
+					{
+						id:'0',
+						name:'充满自停'
+					},
+					{
+						id:'1',
+						name:'1小时'
+					},
+					{
+						id:'2',
+						name:'2小时'
+					},
+					{
+						id:'3',
+						name:'3小时'
+					},
+					{
+						id:'4',
+						name:'4小时'
+					},
+					{
+						id:'5',
+						name:'5小时'
+					},
+					{
+						id:'6',
+						name:'6小时'
+					},
+					{
+						id:'7',
+						name:'7小时'
+					},
+					{
+						id:'8',
+						name:'8小时'
+					},
+				],
+				//提交信息
+				submitForm:{
+					deviceNo:'',
+					channelNo:'',
+					hour:'0',
+					//paytype:'YE',
+				},
+				
+				isReady:false,
+				customStyle: {
+					background: '#1677ff'
+				}
+			}
+		},
+		onLoad(op) {
+			
+			if (op.id) {
+				this.id = op.id;
+				this.carhelp.set("qr-default-id",op.id);
+			}else{
+				//用于支付后返回系统  -- 点金计划
+				this.id =this.carhelp.get("qr-default-id");
+			}
+			
+			
+			this.init()
+			
+			
+		},
+		methods: {
+			switchCharge(){
+			
+				uni.redirectTo({
+					url:'/pages/charge/switchCharge?id='+this.detail.id
+				})
+			},
+			init(){
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var data = {
+					
+				};
+				if(this.id){
+					data.deviceId=this.id
+				}
+				API.chargingData(data).then((res) => {
+					
+					this.carhelp.set("qr-default-id",this.id);
+					this.detail = res.data.chargingDevice;
+					this.user = res.data.userAccount;
+					this.list=this.detail.chargeStatusArray
+					this.isReady=true;
+					uni.hideLoading()
+					
+				}).catch(error => {
+					this.isReady=true;
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			selectItem(row){
+				if(row.status==0){
+					this.submitForm.channelNo=row.channelNo
+				}else{
+					uni.showToast({
+						title:'当前设备不可选'
+					})
+				}
+			},
+			confirm(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				this.submitForm.deviceNo=this.detail.deviceNo;
+				API.startCharging(this.submitForm).then((res) => {
+				
+					 this.gotoUrl("pages/index/index");
+					// uni.showModal({
+					//     title: '提示',
+					// 	showCancel:false,
+					//     content: '启动成功',
+					//     success: res=> {
+					//         if (res.confirm) {
+					//            //付钱  改为组件
+					//            this.gotoUrl("pages/index/index");
+					           
+					//         } else if (res.cancel) {
+					//             console.log('用户点击取消');
+					//         }
+					//     }
+					// });
+					// uni.showToast({
+					// 	title: '启动中..'
+					// })
+					// setTimeout(()=>{
+						
+					// },3000)
+					// uni.hideLoading()
+					
+				}).catch(error => {
+					if(error=='用户账户余额不足!'){
+						uni.showModal({
+						    title: '支付',
+						    content: '用户账户余额不足,是否充值?',
+						    success: res=> {
+						        if (res.confirm) {
+						           //付钱  改为组件
+						           this.gotoUrl("pages/user/recharge");
+						           
+						        } else if (res.cancel) {
+						            console.log('用户点击取消');
+						        }
+						    }
+						});
+					}else{
+						uni.showToast({
+							title: error
+						})
+					}
+					
+				})
+			},
+			submit(){
+				
+				if(!this.submitForm.channelNo){
+					uni.showToast({
+						title:'请先选择充电通道'
+					})
+					return
+				}
+				var obj=this.list.find(item=>{
+					return item.channelNo==this.submitForm.channelNo
+				})
+				
+				if(!obj||obj.status!=0){
+					uni.showToast({
+						title:'当前设备不可选'
+					})
+					return
+				}
+				if(this.submitForm.hour==0&&this.user.accountBalance<5){
+					uni.showModal({
+					    title: '支付',
+					    content: '余额不足5元无法开启充满自停,是否充值?',
+					    success: res=> {
+					        if (res.confirm) {
+					           //付钱  改为组件
+					           this.gotoUrl("pages/user/recharge");
+					           
+					        } else if (res.cancel) {
+					            console.log('用户点击取消');
+					        }
+					    }
+					});
+				}else{
+					
+					this.showmodel=true;
+				}
+				 
+				
+			},
+			showTips(){
+				this.showPriceList=true
+			}
+		},onShow() {
+			if(this.isReady){
+				if (this.id) {
+					this.carhelp.set("qr-default-id",this.id);
+				}else{
+					//用于支付后返回系统  -- 点金计划
+					this.id =this.carhelp.get("qr-default-id");
+				}
+				this.init()
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	
+	.showmodel{
+		  margin-left: 20px;
+		   margin-right: 20px;
+		  p{
+			     display: inline-block;
+		  	 width: 100px;
+		  }
+	}
+	.showPriceList{
+		  margin-left: 20px;
+		   margin-right: 20px;
+		  span{
+		  	 float: right;
+		  }
+	}
+	.slot-wrap {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		flex: 1;
+	}
+	.navbar-right {
+		display: flex;
+		margin-right: 20rpx;
+		align-items: center;
+	}
+	.charge{
+		padding: 15px;
+		background-color: #fff;
+		margin-bottom: 10px;
+	}
+	.chargeRadio{
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		width: 100%;
+		.chargeRadio-text{
+			margin-left: 5px;
+		}
+	}
+	.chargeTime{
+		display: flex;
+		overflow: scroll;
+		padding-bottom: 15px;
+	
+		.chargeTime-item{
+			border: 1px solid #1677ff;
+			border-radius: 50%;
+			min-width: 56px;
+			height: 56px;
+			text-align: center;
+			line-height: 56px;
+			margin-right: 20px;
+		}
+		.chargeTime-first{
+			line-height: 20px !important;
+			
+			padding-top: 6px;
+			margin-right: 20px;
+		}
+		.chargeTime-active{
+			color:#fff;
+			background-color: #1677ff;
+		}
+	}
+	.chargeTime-text{
+		border-top: 1px solid #f7f7f7;
+		padding-top: 15px;
+		display: flex;
+		align-items: center;
+		span{
+			margin-left: 20px;
+			color:#1677ff;
+		}
+	}
+	.chargeInfo{
+		.chargeInfo-row{
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			margin-bottom: 10px;
+			p{
+				color:#999;
+			}
+			h4{
+				font-weight: normal;
+			}
+			span{
+				color:#1677ff;
+				margin-right: 5px;
+			}
+		}
+	}
+	.chargeMain{
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: space-between;
+		margin-top: 20px;
+		.chargeMain-item{
+			width: 18%;
+			text-align: center;
+			padding: 10px;
+			border: 1px solid #1677ff;
+			margin-bottom: 10px;
+			border-radius: 10px;
+			color:#1677ff;
+		}
+		.active{
+			background-color:#1677ff;
+			color:#fff;
+		}
+		.fault{
+			background-color:#e1e1e1;
+			color:#666;
+			border: 1px solid #ccc;
+		}
+		.occupy{
+			color:#FF4F3F;
+			border: 1px solid #FF4F3F;
+		}
+	}
+	.foot-btn{
+		padding: 10px;
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		background-color: #fff;
+	}
+</style>

+ 141 - 0
pages/charge/switchCharge.vue

@@ -0,0 +1,141 @@
+<template>
+	<view>
+		<u-navbar title="切换充电桩"
+		    :autoBack="false"
+			:custom-back="selectBtn">
+			<view class="slot-wrap">
+				<view class="navbar-left"></view>				
+				<view class="navbar-right" @click="selectBtn"><span>确定</span></view>
+			</view>
+		</u-navbar>
+		<view class="chargeList">
+			<template v-for="(item,i) in list">
+			
+			<view class="chargeList-item " 
+			@click="select=item.id"
+			:class="{
+				'active':item.id==select,
+			}"
+			
+			:key="i">
+				<view class="chargeList-item-row">
+					<u-icon name="qichexiangguan-chongdianzhan" custom-prefix="custom-icon" color="#1677ff" size="40"></u-icon>
+					<p>名称</p>
+					<span>{{item.name}}</span>
+				</view>
+				<view class="chargeList-item-row">
+					<u-icon name="shoujichongdian" custom-prefix="custom-icon" color="#1677ff" size="40"></u-icon>
+					<p>空闲</p>
+					<span>{{item.availableNumOfChannel}}</span>
+				</view>
+			<!-- 	<view class="chargeList-item-row">
+					<u-icon name="juli" custom-prefix="custom-icon" color="#1677ff" size="40"></u-icon>
+					<p>距离</p>
+					<span>荆鹏软件园1号充电桩</span>
+				</view>
+				<view class="chargeList-item-row">
+					<u-icon name="dizhi" custom-prefix="custom-icon" color="#1677ff" size="40"></u-icon>
+					<p>地址</p>
+					<span>荆鹏软件园1号充电桩</span>
+				</view> -->
+			</view>
+				</template>
+				
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/index.js'
+	
+	export default {
+		data() {
+			return {
+				list:[
+					
+				],
+				select:'',
+			}
+		},
+		onLoad(op) {
+			this.select=op.id;
+		},
+		methods: {
+			
+			selectBtn(){
+				
+				//uni.navigateBack()
+				uni.redirectTo({
+					url:'/pages/charge/index?id='+this.select
+				})
+			},
+			getList(){
+				uni.showLoading({
+					title:"加载中",mask:true,
+				})
+				
+				var data={
+				 
+				};
+				API.chargingDeviceData(data).then((res) => {
+						 
+					this.list=[
+						...this.list,
+						...res.data.data
+					];
+					this.recordsTotal=res.data.recordsTotal
+					uni.hideLoading()
+					 
+				}).catch(error => {
+						uni.showToast({
+							
+							title:error
+						})
+				})
+			}
+		},onReady(){
+			
+			 this.getList()
+		},
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.slot-wrap {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		flex: 1;
+	}
+	.navbar-right {
+		display: flex;
+		margin-right: 20rpx;
+		align-items: center;
+		color:#1677ff;
+	}
+	.chargeList-item{
+		background-color: #fff;
+		padding: 15px;
+		margin: 10px;
+		border-radius: 10px;
+		.chargeList-item-row{
+			display: flex;
+			align-items: center;
+			margin-bottom: 10px;
+			&:last-child{
+				margin-bottom: 0;
+			}
+			p{
+				color:#999;
+				margin: 0 10px;
+			}
+		}
+	}
+	.chargeList-item.active{
+		border: 1px solid #1677ff;
+	}
+</style>

+ 519 - 0
pages/index/index.vue

@@ -0,0 +1,519 @@
+<template>
+	<view>
+		<u-navbar title="充电中" :is-back="false">
+			<view class="slot-wrap">
+				<view class="navbar-left"></view>
+				<view class="navbar-right" @click="f5(true)" style="    color: #1d7cff;">
+					<u-icon name="shuaxin" custom-prefix="custom-icon" color="#1677ff" size="40"></u-icon>刷新
+				</view>
+			</view>
+		</u-navbar>
+		<view class="chargeInfoNull" v-if="list.length==0">
+			<img height="80" width="80" src="@/assets/img/ddc.png" alt="">
+			<p>暂无充电车辆</p>
+		</view>
+
+
+		<swiper class="swiper" :current="current" @change="changeswiper" style="    height: 700px;"
+			v-if="list.length!=0">
+			<swiper-item v-for="(item,i) in list" :key="i">
+				<view class="chargeInfo">
+					<view class="chargeInfo-text">
+						<p>桩名:{{item.deviceName}}</p>
+						<p>桩号:{{item.deviceNo}}</p>
+					</view>
+					<view class="chargeInfo-btn">
+						通道:{{item.channelNo}}
+					</view>
+				</view>
+				<view class="chargeImg">
+					<img v-if="item.status==0" src="@/assets/img/charge-0.png" alt="">
+					<img v-if="item.status==1" src="@/assets/img/charge-1.png" alt="">
+					<img v-if="item.status==2" src="@/assets/img/charge-2.png" alt="">
+					<img v-if="item.status==3" src="@/assets/img/charge-3.png" alt="">
+					<div class="JPTIME JPTIME1" v-if="item.status==0||item.status==3" v-text="showtime[i]"></div>
+
+				</view>
+				<view class="chargeTime" v-if="item.status==3">
+					<h1>关闭中...</h1>
+
+				</view>
+				<view class="chargeTime" v-if="item.status==0">
+					<h1>启动中...</h1>
+					请在2分钟内接入电源!
+				</view>
+				<view class="chargeTime" v-if="item.status==2">
+					<h1>充电结束</h1>
+					{{item.updateTime}}:{{item.remark}}
+				</view>
+				<view class="chargeTime" v-if="item.status==1">
+					<p>剩余时长</p>
+					<u-line-progress active-color="#ececec" height="48" :percent="getPercent(item).percent">
+						<div style="     
+						border-radius: 100px;
+						 min-width: 70px;  width: 100%;background-color: rgba(51, 136, 255, 100);height: 8px;">
+							&nbsp;
+							<div class="" style="float: right;
+										
+										padding: 0 8px;
+										border-radius: 100px;
+										background-color: rgba(51, 136, 255, 100);
+										color: rgb(255, 255, 255);
+										font-size: 12px;
+										text-align: center;
+										font-family: -apple-system;
+										top: -5px;
+										position: relative;							
+							">{{getPercent(item).value}}</div>
+						</div>
+
+
+					</u-line-progress>
+				</view>
+				<view class="chargeData">
+					<view class="chargeData-item">
+						<u-icon name="jiagebaohu" custom-prefix="custom-icon" color="#1677ff" size="56"></u-icon>
+						<h2>{{item.actualFee?item.actualFee:(item.estimateFee?item.estimateFee:0)}}元</h2>
+						<p>消费金额</p>
+					</view>
+					<view class="chargeData-item">
+						<u-icon name="dian" custom-prefix="custom-icon" color="#1677ff" size="56"></u-icon>
+						<h2>{{item.chargingPower?item.chargingPower:0}}W</h2>
+						<p>充电功率</p>
+					</view>
+				</view>
+				<view class="chargeBtn">
+					<view class="chargeBtn-item" v-if="item.status==1||item.status==0" @click="returnMoney(item)">终止并退款
+					</view>
+					<view class="chargeBtn-item" v-if="item.status==2" @click="f5(true)">刷新</view>
+					<view class="chargeBtn-item" @click="showTips(item)">费用说明</view>
+				</view>
+
+				<view class="chargeNext">{{i+1}}/{{list.length}}</view>
+			</swiper-item>
+
+
+
+
+		</swiper>
+		<u-modal v-model="showmodel" title="费用说明">
+			<p v-if="showitem.length==0">当前为免费充电桩</p>
+			<p v-for="(item,i) in showitem" class="showmodel" :key="i">{{item.minPower}}W-{{item.maxPower}}W
+				<span>{{item.price}}元每小时</span></p>
+
+
+		<p style="    padding: 15px;" v-if="roundingMinute!=null&&roundingMinute!=-1">超过{{roundingMinute}}分钟,按1小时记,不足{{roundingMinute}}分钟,不计费</p>
+			<p style="    padding: 15px;" v-if="showitem.length==0">无费用说明或为免费充电模式</p>
+	
+
+		</u-modal>
+		<Tabbar :current="0"></Tabbar>
+	</view>
+</template>
+
+<script>
+	import Tabbar from '@/components/Tabbar.vue'
+	import * as API from '@/apis/index.js'
+	import {
+		secondsDistance,
+		hourDistanceArr
+	} from '@/utils'
+	export default {
+		data() {
+			return {
+				k: 0,
+				id: "",
+				current: "0",
+				showmodel: false,
+				showitem: [],
+				percent: 0,
+				list: [],
+				showtime: {},
+				isReady: false,
+				isCharge: false,
+				roundingMinute:-1,
+				detail: {
+
+				},
+				detailIng: {
+
+				},
+				setTimeoutId: ""
+			}
+		},
+		onLoad(op) {
+			if (op.k) {
+				this.k = op.k;
+				//如果是扫码 ,或者登陆进来的, 并且没有充电,就跳转到充电页面  k= null
+				//如果是在系统内部访问的,  k=1  不跳转;
+			}
+
+			if (op.id) {
+				this.id = op.id;
+				this.carhelp.set("qr-default-id",op.id);
+			}else{
+				//用于支付后返回系统  -- 点金计划
+				this.id =this.carhelp.get("qr-default-id");
+			}
+			uni.showLoading({
+				title: "加载中",
+				mask: true,
+			})
+			this.init(op.phone)
+			setInterval(this.formatDate, 500);
+
+		},
+		beforeDestroy() {
+			if (this.formatDate) {
+				clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器
+			}
+		},
+		methods: {
+			
+			changeswiper(e) {
+				this.current = e.detail.current;
+			},
+			formatDate() {
+				for (var i in this.list) {
+					var obj = this.list[i];
+					var second = 0;
+
+					if (obj.status == 0) {
+						second = secondsDistance(obj.createTime);
+					}
+					if (obj.status == 3) {
+						second = secondsDistance(obj.updateTime);
+					}
+					//obj.showtime=this.getShowTime(obj);
+					var ms = 60 * 2 - second;
+					if (ms > 0) {
+						var Hour = parseInt(Math.floor(ms / (60)));
+						var Fen = parseInt(Math.floor(ms % 60));
+						this.showtime[i] = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen
+
+					} else {
+						this.showtime[i] = "00:00";
+					}
+
+					this.$forceUpdate()
+
+				}
+			},
+
+			getPercent(item) {
+				var obj = {
+
+				}
+				if (item.status == 1) {
+
+					var second = secondsDistance(item.startTime);
+					if (second > 0) {
+
+						obj.percent = (second / 60) / item.estimateMinute * 100;
+						var ms = item.estimateMinute * 60 - second
+						if (ms > 0) {
+							var Hour = parseInt(Math.floor(ms / (60 * 60)));
+							var Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
+							obj.value = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen
+						}
+
+					}
+				}
+				if (item.status == 0) {
+					obj.value = "启动中"
+					obj.percent = "50";
+				}
+				if (item.status == 2) {
+					obj.value = "关闭中"
+					obj.percent = "50";
+				}
+				//特殊情况默认值
+				if (!obj.value) {
+					obj.value = "00:00"
+				}
+				if (!obj.percent) {
+					obj.percent = "100";
+				}
+
+				return obj;
+			},
+			showTips(item) {
+				this.showmodel = true;
+				this.roundingMinute=item.roundingMinute;
+				if(this.roundingMinute==null){
+					this.roundingMinute=5;
+				}
+				this.showitem = item.chargingPriceList;
+				
+			},
+			returnMoney(item) {
+
+				uni.showModal({
+					title: '停止充电确认',
+					showCancel: true,
+					content: '您确定要停止充电吗?停止后将不再充电并退款到余额',
+					success: res => {
+						if (res.confirm) {
+							this.stopCharging(item)
+
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				});
+			},
+			stopCharging(item) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var data = {
+					chargingRecordId: item.id,
+					channelNo: item.channelNo,
+					deviceNo: item.deviceNo,
+				};
+				API.stopCharging(data).then((res) => {
+					this.f5(true)
+				}).catch(error => {
+
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			init(phone) {
+				if (!phone) {
+					phone = ""
+				}
+				// uni.showLoading({
+				// 	title: "加载中",
+				// 	mask: true,
+				// })
+				var data = {
+					phone: phone
+				};
+				API.findChargeData(data).then((res) => {
+
+					if (res.data.chargingRecordList.length != this.list.length) {
+						this.current = 0;
+					}
+
+					this.list = res.data.chargingRecordList;
+					this.isCharge = res.data.isCharge;
+					this.isReady = true;
+					if (!this.isCharge && this.k != 1) {
+						this.gotoUrl("pages/charge/index?id=" + this.id)
+					} else {
+						uni.hideLoading()
+					}
+					if (this.list.length > 0) {
+						//防止定时器重复调用
+						if (this.setTimeoutId == "") {
+							for (var i in this.list) {
+								var item = this.list[i];
+
+								if (item.status == 0 || item.status == 3) {
+									this.setTimeoutId = setTimeout(() => {
+										this.setTimeoutId = "";
+										this.f5()
+									}, 5 * 1000)
+								} else if (item.status == 1 && item.startTime) {
+									var second = secondsDistance(item.startTime);
+									var ms = item.estimateMinute * 60 - second
+									if (ms < 60 * 10) {
+										this.setTimeoutId = setTimeout(() => {
+											this.setTimeoutId = "";
+											this.f5()
+										}, 5 * 1000)
+									}
+								}
+							}
+						}
+					} else {
+						this.setTimeoutId = ""
+					}
+
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			f5(bl) {
+
+				if (bl) {
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+				}
+				this.k = 1;
+				this.init()
+			},
+		},
+		components: {
+			Tabbar
+
+		},
+		onShow() {
+			if (this.isReady) {
+				this.f5(true)
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import '@/assets/font/jptime.css';
+
+	.JPTIME1 {
+		position: relative;
+		bottom: 170px;
+		font-size: 40px;
+		text-align: center;
+		color: #eee;
+	}
+
+	.showmodel {
+		margin-left: 20px;
+		margin-right: 20px;
+
+		span {
+			float: right;
+		}
+	}
+
+	.slot-wrap {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		flex: 1;
+	}
+
+	.chargeNext {
+		background: rgba(0, 0, 0, 0.5);
+		color: #fff;
+		float: right;
+		padding: 5px 15px;
+		border-radius: 15px;
+		font-size: 12px;
+		margin-bottom: 10px;
+		margin-right: 10px;
+	}
+
+	.navbar-right {
+		display: flex;
+		margin-right: 20rpx;
+		align-items: center;
+	}
+
+	.chargeInfoNull {
+		text-align: center;
+		padding: 100px 0 50px;
+
+		p {
+			color: #999;
+			font-size: 20px;
+			margin-top: 10px;
+		}
+	}
+
+	.chargeInfo {
+		padding: 10px;
+		position: relative;
+
+		.chargeInfo-text {
+			p {
+				color: #777;
+				margin-bottom: 5px;
+			}
+		}
+
+		.chargeInfo-btn {
+			background-color: #E0EDFF;
+			width: 72px;
+			height: 32px;
+			border-radius: 16px 0 0 16px;
+			line-height: 32px;
+			text-align: center;
+			position: absolute;
+			right: 0;
+			top: 16px;
+			color: #1677FF;
+		}
+	}
+
+	.chargeImg {
+		height: 300px;
+		width: 300px;
+		margin: 10px auto 0;
+
+		img {
+			height: 100%;
+			width: 100%;
+		}
+	}
+
+	.chargeTime {
+		padding: 20px 30px;
+		text-align: center;
+
+		p {
+			color: #999;
+			margin-bottom: 10px;
+		}
+	}
+
+	.chargeBtn {
+		display: flex;
+		justify-content: space-around;
+		padding: 20px 50px;
+
+		.chargeBtn-item {
+			width: 80px;
+			height: 32px;
+			background-color: #1677FF;
+			line-height: 32px;
+			color: #fff;
+			text-align: center;
+			border-radius: 16px;
+		}
+
+	}
+
+	.chargeData {
+		display: flex;
+		justify-content: space-around;
+
+		.chargeData-item {
+			text-align: center;
+
+			h2 {
+				font-size: 24px;
+				font-weight: normal;
+				color: #1677FF;
+				margin: 10px 0;
+			}
+
+			.chargeData-power {
+				display: flex;
+				align-items: center;
+				display: flex;
+				width: 120px;
+				text-align: center;
+				height: 31px;
+				margin: 10px 0;
+
+				span {
+					font-size: 14px;
+					color: #1677FF;
+					margin: 0 5px;
+				}
+			}
+
+			p {
+				color: #999;
+			}
+		}
+	}
+</style>

+ 87 - 0
pages/index/none.vue

@@ -0,0 +1,87 @@
+<template>
+	<view>
+		<u-navbar title="充电中" :is-back="false">
+			<view class="slot-wrap">
+				<view class="navbar-left"></view>				
+				<view class="navbar-right">
+					<u-icon name="shuaxin" custom-prefix="custom-icon" color="#1677ff" size="40"></u-icon>
+				</view>
+			</view>
+		</u-navbar>
+		<view class="chargeInfo">
+ 			<p>暂无充电车辆</p>
+		</view>
+		<view class="chargeBtn">
+			查看附近充电桩
+		</view>
+		<u-tabbar v-model="current" :list="tabbarList" :mid-button="true" active-color="#1677ff"></u-tabbar>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tabbarList: [{
+						iconPath: "motuoche-diandongche",
+						selectedIconPath: "motuoche-diandongche",
+						text: '充电',
+						count: 0,
+						isDot: true,
+						customIcon: true,
+					},
+					{
+						iconPath: "/@/assets/img/min_button_select.png",
+						selectedIconPath: "/@/assets/img/min_button_select.png",
+						text: '充电中',
+						midButton: true,
+						customIcon: true,
+					},
+					{
+						iconPath: "31wode",
+						selectedIconPath: "31wode",
+						text: '我的',
+						count: 0,
+						isDot: false,
+						customIcon: true,
+					},
+				],
+				current: 0
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.slot-wrap {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		flex: 1;
+	}
+	.navbar-right {
+		display: flex;
+		margin-right: 20rpx;
+		align-items: center;
+	}
+	.chargeInfo{
+		text-align: center;
+		padding:100px 0 50px;
+		p{
+			color:#999;
+			font-size: 20px;
+			margin-top: 10px;
+		}
+	}
+	.chargeBtn{
+		padding: 10px 20px;
+		border-radius:22px ;
+		width: 150px;
+		border: 2px solid #1677FF;
+		color:#1677FF;
+		margin: 0 auto;
+	}
+</style>

+ 278 - 0
pages/login/index.vue

@@ -0,0 +1,278 @@
+<template>
+	<view>
+
+		<div class="vongi-login-logo" style="
+			text-align: center;
+			margin-top: 40px;">
+			<img src="@/assets/img/logo_xiaopengguanjia.png" style="
+			   width: 72px;
+			   height: 72px;
+			   border-radius: 15px;
+			" />
+			<div style="
+				color: rgba(16, 16, 16, 100);
+				font-size: 18px;
+				text-align: center;
+				font-family: PingFangSC-regular;
+			">小鹏管家</div>
+		</div>
+		<view class="login-title">
+			<u-icon name="qichexiangguan-chongdianzhan" custom-prefix="custom-icon" color="#1677ff" size="56"></u-icon>
+			<h3>电动自行车智能充电系统</h3>
+		</view>
+		<view class="login-main">
+			<u-form :model="form" ref="uForm">
+				<u-form-item label="手机号码" prop="phone" label-width="150" label-position="top">
+					<u-input placeholder="请输入手机号" v-model="form.phone" type="number"></u-input>
+				</u-form-item>
+				<u-form-item label="验证码" prop="code" label-width="150" label-position="top">
+					<u-input placeholder="请输入验证码" v-model="form.code" type="text"></u-input>
+					<view class="login-code" @click="getCode">
+						{{codeTips}}
+					</view>
+				</u-form-item>
+			</u-form>
+		</view>
+		<view class="login-btn">
+			<u-button type="primary" :custom-style="customStyle" @click="finish" shape="square">登录</u-button>
+		</view>
+		<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start">
+		</u-verification-code>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/login.js'
+
+	import {
+		checkPhone
+	} from '@/utils'
+	export default {
+		data() {
+			return {
+				form: {
+					phone: '',
+					code: '',
+				},
+				backUrl: "",
+				message: "",
+				codeTips: '',
+				isSendMsgIng: false,
+				sendMsgSecond: 60 * 2,
+				customStyle: {
+					background: '#1677ff'
+				}
+			}
+		},
+		onLoad(op) {
+
+			this.message = op.message;
+			this.backUrl = op.back;
+			if (op.phone) {
+				this.form.phone = op.phone;
+			}
+
+		},
+		methods: {
+			codeChange(text) {
+				this.codeTips = text;
+			},
+			//倒计时
+
+			end() {
+				this.sendMsgSecond = 2 * 60;
+				this.isSendMsgIng = false;
+			},
+			finish() {
+
+				if (!this.carhelp.getOpenId()) {
+					uni.showToast({
+						title: "请使用“微信”访问本系统登录"
+					})
+					return
+				}
+				if (!this.form.phone) {
+					uni.showToast({
+						title: "请输入手机号"
+					})
+					return
+				}
+				if (!this.form.code) {
+					uni.showToast({
+						title: "请输入验证码"
+					})
+					return
+				}
+
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var headImg = "";
+				var userInfo = this.carhelp.get("xpgj_wx_user_info")
+				if (userInfo) {
+
+					headImg = userInfo.headimgurl;
+				}
+
+
+				API.validateCode({
+					verifyCode: this.form.code,
+					telephone: this.form.phone,
+					openId: this.carhelp.getOpenId(),
+					headImg: headImg
+				}).then((response) => {
+					var token = response ? response.data.token : '';
+					this.carhelp.setToken(token);
+					this.carhelp.setPersonInfo(response.data.regUser);
+					//this.gotoUrl("pages/user/index")
+					uni.redirectTo({
+						url: '/pages/index/index'
+					})
+
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			start() {
+				if (!this.isSendMsgIng) {
+
+
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+					API.getVerifyCode(this.form.phone).then((response) => {
+
+
+						uni.hideLoading();
+						this.carhelp.set("getvcodetime", new Date().getTime());
+
+						if (!"") {
+							//倒计时
+							uni.showToast({
+								title: "发送成功"
+							})
+						} else {
+							uni.showToast({
+								title: "您的验证码已经发送[5分钟有效],请勿重复点击"
+							})
+						}
+					}).catch(error => {
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
+					})
+
+
+				}
+			},
+			// 获取验证码
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+
+				} else {
+
+					uni.showToast({
+						title: '倒计时结束后再发送',
+						icon: "none"
+					})
+					return
+				}
+
+				var checkPhoneResult = checkPhone(this.form.phone);
+
+				if (false && checkPhoneResult !== true) {
+					uni.showToast({
+						title: checkPhoneResult,
+
+					})
+					return;
+				}
+				this.$refs.uCode.start();
+			},
+			query(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.findByOpenId({
+					
+					openId: this.carhelp.getOpenId(),
+					
+				}).then((response) => {
+					
+					var token = response ? response.data.token : '';
+					this.carhelp.setToken(token);
+					this.carhelp.setPersonInfo(response.data.regUser);
+					//this.gotoUrl("pages/user/index")
+					uni.redirectTo({
+						url: '/pages/index/index'
+					})
+				
+				}).catch(error => {
+					uni.hideLoading();
+					if (!this.carhelp.getOpenId()) {
+						uni.showToast({
+							title: "请使用“微信”访问本系统登录"
+						})
+						return
+					} else if (this.message) {
+						uni.showToast({
+							title: this.message.split(",")[0],
+							icon: "none"
+						})
+					}
+					var time = this.carhelp.get("getvcodetime");
+					if (time) {
+						//this.$refs.uCode.start();
+						var nowtime = new Date().getTime()
+						var differ = (nowtime - time) / 1000
+						if (differ < 2 * 60) {
+							this.sendMsgSecond = 2 * 60 - parseInt(differ)
+							this.isSendMsgIng = true;
+							this.$refs.uCode.start();
+						}
+					}
+					
+				})
+			}
+		},
+		onReady() {
+			this.query()
+			
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.login-title {
+		display: flex;
+		align-items: center;
+		margin: 25px 30px;
+
+		h3 {
+			font-size: 20px;
+			margin-left: 10rpx;
+			color: #1677ff;
+			font-weight: normal;
+		}
+	}
+
+	.login-main {
+		margin: 0 30px;
+	}
+
+	.login-btn {
+		margin: 30px;
+	}
+
+	.login-code {
+		color: #1677ff;
+	}
+</style>

+ 251 - 0
pages/user/index.vue

@@ -0,0 +1,251 @@
+<template>
+	<view>
+		<u-navbar title="个人中心" :is-back="false"  :background="background" title-color="#fff" :border-bottom="false"></u-navbar>
+		<view class="userHead">
+			<view class="userHead-top">
+				<view class="userHead-data">
+					<p>余额(元)</p>
+					<h2>{{detail.balance}}</h2>
+				</view>
+				<view class="userHead-img">
+					<u-avatar class="userHead-head" :src="src" size="144"></u-avatar>
+				</view>
+				<view class="userHead-btn" 
+				 @click="gotoUrl('pages/user/recharge')" >
+					<u-icon name="jiagebaohu" custom-prefix="custom-icon" color="#1677ff" size="32"></u-icon>
+					<span>充值</span>
+				</view>
+			</view>
+			<view class="userHead-bot">
+				<view class="userHead-bot-item">
+					<p>充电度数</p>
+					<h2>{{detail.electricQuantity}}</h2>
+				</view>
+				<view class="userHead-bot-item">
+					<p>充电次数</p>
+					<h2>{{detail.chargingTimes}}</h2>
+				</view>
+			</view>
+			<view class="user-cell">
+				<view 
+				@click="gotoUrl('pages/user/rechargeList')"
+				
+				class="user-cell-item">
+					<view class="user-cell-title">
+						<u-icon name="jiagebaohu" custom-prefix="custom-icon" color="#1677ff" size="32"></u-icon>
+						<span>充值记录</span>
+					</view>
+					<view class="user-cell-value"></view>
+				</view>
+				<view 
+				@click="gotoUrl('pages/charge/chargeList')"
+				class="user-cell-item">
+					<view class="user-cell-title">
+						<u-icon name="shoujichongdian" custom-prefix="custom-icon" color="#1677ff" size="32"></u-icon>
+						<span>充电记录</span>
+					</view>
+					<view class="user-cell-value"></view>
+				</view>
+				<view class="user-cell-item" @click="phone()">
+					<view class="user-cell-title">
+						<u-icon name="kefu" custom-prefix="custom-icon" color="#1677ff" size="32"></u-icon>
+						<span>我的客服</span>
+					</view>
+					<view class="user-cell-value">{{tel}}</view>
+				</view>
+				<view class="user-cell-item" @click="logout">
+					<view class="user-cell-title">
+						<u-icon name="tuichu" custom-prefix="custom-icon" color="#1677ff" size="32"></u-icon>
+						<span>退出账户</span>
+					</view>
+					<view class="user-cell-value"></view>
+				</view>
+			</view>
+		</view>
+			<Tabbar :current="2" ></Tabbar>
+ 	</view>
+</template>
+
+<script>
+	import Tabbar from '@/components/Tabbar.vue'
+	import * as API from '@/apis/index.js'
+	
+	export default {
+		data() {
+			return {
+				src:'',
+				isReady:false,
+				tel:'400-8899-619',
+				detail:{},
+				background: {
+					backgroundColor: '#1677ff',
+				},
+				
+			}
+		},onLoad(op){
+			this.init();
+		},
+		methods: {
+			init(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+			
+				API.personalCenter().then((res) => {
+					this.detail = res.data
+					this.src= res.data.regUser.headImg
+					this.isReady=true;
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			logoutApi(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var data = {
+					
+				};
+				 
+				API.logout(data).then((res) => {
+					this.carhelp.setToken("");
+					this.carhelp.set("token_tdate","")
+					this.carhelp.setPersonInfo("");
+					uni.reLaunch({
+						url:"/pages/login/index?phone="+this.detail.regUser.phone
+					})
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			logout(){
+				uni.showModal({
+				    title: '提示',
+				    content: '确认是否退出?',
+				    success: res=> {
+				        if (res.confirm) {
+				           //付钱  改为组件
+				           this.logoutApi();
+				           
+				        } else if (res.cancel) {
+				            console.log('用户点击取消');
+				        }
+				    }
+				});
+			},
+			phone(){
+				uni.makePhoneCall({
+				    phoneNumber:this.tel //仅为示例
+				});
+			}
+		},onShow() {
+			if(this.isReady){
+				this.init()
+			}
+		
+		},
+		components: {
+			Tabbar
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.user-cell-item{
+		padding: 13px 15px;
+		position: relative;
+		border-bottom: 1px solid #f7f7f7;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		.user-cell-value{
+			flex: 1;
+			text-align: right;
+			padding-right: 25px;
+			color:#999;
+		}
+		&:after{
+			content:'\e77c';
+			font-family: "custom-icon" !important;
+			font-size: 16px;
+			position: absolute;
+			right: 15px;
+			top: 15px;
+			color:#999;
+		}
+		.user-cell-title{
+			span{
+				margin-left: 5px;
+			}
+		}
+	}
+	.userHead{
+		.userHead-top{
+			background-color: #1677ff;
+			height: 120px;
+			position: relative;
+			padding: 0 30px;
+			.userHead-data{
+				color:#fff;
+				text-align: center;
+				position: absolute;
+				top: 35px;
+				left: 30px;
+				p{
+					margin-bottom: 5px;
+				}
+				h2{
+					font-weight: normal;
+				}
+			}
+			.userHead-img{
+				position: absolute;
+				left: 50%;
+				margin-left: -36px;
+				top:24px ;
+				.userHead-head{
+					border:4px solid  #5ca0ff;
+				}
+			}
+			.userHead-btn{
+				position: absolute;
+				top: 46px;
+				right: 20px;
+				width: 80px;
+				height: 28px;
+				border-radius: 14px;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				background-color: #FFFFFF;
+				span{
+					margin-left: 5px;
+					color:#1677ff;
+				}
+			}
+		}
+		.userHead-bot{
+			background-color: #125fcc;
+			height: 60px;
+			display: flex;
+			justify-content: space-around;
+			align-items: center;
+			.userHead-bot-item{
+				text-align: center;
+				color:#fff;
+				h2{
+					font-weight: normal;
+				}
+			}
+		}
+	}
+</style>

+ 274 - 0
pages/user/recharge.vue

@@ -0,0 +1,274 @@
+<template>
+	<view>
+		<u-navbar title="充值">
+		</u-navbar>
+		<view class="recharge">
+			<view class="recharge-text">
+				<p>账单余额(元)</p>
+				<h1>{{detail.balance}}</h1>
+			</view>
+			<view 
+			 @click="gotoUrl('pages/user/rechargeList')"
+			class="recharge-btn">
+				账单
+			</view>
+		</view>
+		<view class="charge">
+			<view class="chargeTit">
+				选择充值金额
+			</view>
+			<view class="chargeMain">
+				<template v-for="(item,i) in list">
+				
+				<view  :key="i" :class="{
+					'active':chargingMarketingId==item.id
+				}"  @click="chargingMarketingId=item.id,selectItem=item"
+				class="chargeMain-item "><p>{{item.rechargeAmount}}元</p> <span v-if="item.giftAmount">赠{{item.giftAmount}}元</span></view>
+				
+				
+				</template>
+			</view>
+		</view>
+		<view style=" padding-bottom: 120px; ">
+			<view class="charge">
+			<view class="chargeRadio">
+				<view class="u-flex">
+					<u-icon name="weixinzhifu" custom-prefix="custom-icon" color="#22ac38" size="80"></u-icon>
+					<view class="chargeRadio-text">
+						<h4>微信支付</h4>
+						<p>推荐微信支付</p>
+					</view>
+				</view>
+				<u-radio-group>
+					<u-radio></u-radio>
+				</u-radio-group>
+			</view>
+		</view>
+			
+		</view>
+		
+		<view class="foot-btn">
+			<view class="foot-pirce">
+				<u-icon name="tikuan" custom-prefix="custom-icon" color="#FF9502" size="48"></u-icon>
+				<span>支付 ¥{{selectItem.rechargeAmount}}</span>
+			</view>
+			<u-button type="primary" @click="submit" :custom-style="customStyle" shape="square">确定充值</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as Pay from '@/apis/weixin.js'
+	import {
+		wxPayJs
+	} from '@/utils/wxpay'
+	import * as API from '@/apis/index.js'
+	
+	export default {
+		data() {
+			return {
+				isReady:false,
+				customStyle: {
+					background: '#1677ff'
+				},
+				detail:{},
+				chargingMarketingId:'',
+				selectItem:{},
+				list:[],
+			}
+		},
+		onReady() {
+			this.init();
+		},
+		methods: {
+			submit(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				Pay.wxpay(this.chargingMarketingId).then((response) => {
+					if(!response.result){		
+						uni.showToast({
+							title:  response.message
+						})
+						return
+					}
+					var data = response.data
+					uni.hideLoading()
+					console.log("Pay+"+new Date().getTime())		
+					wxPayJs(data);
+						
+				}).catch(error => {
+					this.$refs.common.showLoading(false, error);
+						
+				})
+			},
+			init1(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+			
+				API.personalCenter().then((res) => {
+					this.detail = res.data
+						this.isReady=true;
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			init(){
+				
+				
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var data = {
+					
+				};
+				
+				
+				API.marketingData(data).then((res) => {
+						
+					this.list = res.data.chargingMarketingList
+					if(this.list.length>0){
+						this.selectItem=this.list[0];
+						this.chargingMarketingId=this.list[0].id
+					}
+					uni.hideLoading()
+					this.init1()
+				}).catch(error => {
+					uni.showToast({
+						
+						title: error
+					})
+				})
+			}
+		},onShow(){
+			if(this.isReady){
+				this.init1()
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.recharge{
+		padding: 15px;
+		background-color: #1677FF;
+		margin-bottom: 10px;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		.recharge-text{
+			color:#fff;
+		}
+		.recharge-btn{
+			width: 60px;
+			height: 30px;
+			text-align: center;
+			line-height: 30px;
+			background-color: #589EFF;
+			color:#fff;
+			border-radius: 15px;
+		}
+	}
+	.charge{
+		padding: 15px;
+		background-color: #fff;
+		margin-bottom: 10px;
+	}
+	.chargeRadio{
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		width: 100%;
+		.chargeRadio-text{
+			margin-left: 5px;
+			h4{
+				font-weight: normal;
+				font-size: 15px;
+			}
+			p{
+				font-size: 12px;
+				color:#999;
+				margin-top: 5px;
+			}
+		}
+	}
+	.chargeTit{
+		border-bottom: 1px solid #f7f7f7;
+		padding-bottom: 10px;
+		font-size: 15px;
+	}
+	.chargeMain{
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: space-between;
+		margin-top: 20px;
+		.chargeMain-item{
+			width: 48%;
+			text-align: center;
+			padding: 25px 10px;
+			border: 2px solid #cacaca;
+			margin-bottom: 10px;
+			border-radius: 10px;
+			color:#333;
+			position: relative;
+			p{
+				font-size: 20px;
+			}
+			span{
+				background-color: #ff8d00;
+				color:#fff;
+				padding: 2px 10px;
+				border-radius:0 10px 0 10px;
+				position: absolute;
+				font-size: 12px;
+				right: -2px;
+				top: -2px;
+			}
+		}
+		.active{
+			border-color:#ff8d00;
+			color:#ff8d00;
+		}
+		.fault{
+			background-color:#e1e1e1;
+			color:#666;
+			border: 1px solid #ccc;
+		}
+		.occupy{
+			color:#FF4F3F;
+			border: 1px solid #FF4F3F;
+		}
+	}
+	.foot-btn{
+		padding: 10px;
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		background-color: #fff;
+		.foot-pirce{
+			display: flex;
+			align-items: center;
+			span{
+				margin-left: 5px;
+				font-size: 16px;
+			}
+			padding-bottom: 10px;
+			border-bottom: 1px solid #f7f7f7;
+			margin-bottom: 10px;
+		}
+	}
+</style>

+ 92 - 0
pages/user/rechargeDeatils.vue

@@ -0,0 +1,92 @@
+<template>
+	<view>
+		<u-navbar title="充值详情">
+		</u-navbar>
+		<view class="chargeDetails">
+			<view class="chargeDetails-item">
+				<span>金额</span>
+				<p class="price">{{detail.orderInfo.totalFee}}元</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>类型</span>
+				<p>{{detail.orderInfo.payNameStr}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>时间</span>
+				<p>{{detail.orderInfo.createTime}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>订单号</span>
+				<p>{{detail.orderInfo.outOrderNo}}</p>
+			</view>
+			<view class="chargeDetails-item">
+				<span>交易号</span>
+				<p>{{detail.orderInfo.transactionId}}</p>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/index.js'
+	
+	export default {
+		data() {
+			return {
+				id:'',
+				detail:{
+					accountRecord:{},
+					orderInfo:{},
+				}
+			}
+		},
+		onLoad(op){
+			this.id=op.id;
+			this.getInfo()
+		},
+		methods: {
+			getInfo(){
+				uni.showLoading({
+					title:"加载中",mask:true,
+				})
+				API.accountDetail(this.id).then((res) => {
+					this.detail=res.data	 
+					
+					uni.hideLoading()
+					 
+				}).catch(error => {
+						uni.showToast({
+							
+							title:error
+						})
+				})
+			}
+		}
+	}
+</script>
+<style>
+	page{
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.chargeDetails{
+		background-color: #FFFFFF;
+		.chargeDetails-item{
+			margin:0 10px;
+			border-bottom: 1px solid #F7F7F7;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 15px;
+			span{
+				color:#999;
+			}
+		}
+		.price{
+			font-size: 20px;
+			color:#FF3D00;
+			font-weight: bold;
+		}
+	}
+</style>

+ 182 - 0
pages/user/rechargeList.vue

@@ -0,0 +1,182 @@
+<template>
+	<view>
+		<u-navbar title="充值记录">
+		</u-navbar>
+		<view class="chargeScreen">
+			<view class="chargeScreen-item">
+				<p>
+				 <picker mode="date" :value="startDate"  :end="endDate"   @change="bindDateChange0">
+				            <view class="uni-input">{{startDate}}</view>
+				     </picker>
+				</p>
+				<u-icon name="arrow-down-fill" color="#999" size="24"></u-icon>
+			</view>
+			<span>至</span>
+			<view class="chargeScreen-item">
+				<p>
+				<picker mode="date" :value="endDate" :start="startDate"   @change="bindDateChange1">
+				           <view class="uni-input">{{endDate}}</view>
+				    </picker>
+				
+				</p>
+				<u-icon name="arrow-down-fill" color="#999" size="24"></u-icon>
+			</view>
+		</view>
+		<view class="chargeList">
+			<view v-for="(item ,index) in list" :key="item.id"
+			 @click="gotoUrl('pages/user/rechargeDeatils?id='+item.id)"
+			 class="chargeList-item" 
+			 >
+				<view class="chargeList-text">
+					<p>余额充值</p>
+					<h4>{{item.payNameStr}}</h4>
+				</view>
+				<view class="chargeList-right">
+					<span>{{item.amount}}元</span>
+					<h4>{{item.createTime}}</h4>
+				</view>
+			</view> 
+			
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/index.js'
+	import {parseUnixTime,beforeTimeStamp} from  '@/utils/index.js'
+	export default {
+		data() {
+			return {
+				form: {
+
+				},
+				startDate:'',
+				endDate:'',
+				pageIndex: 1,
+				recordsTotal: 0,
+				list: [],
+			}
+		},
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
+		methods: {
+			  bindDateChange0: function(e) {
+			            this.startDate= e.target.value
+			            
+						
+						this.getList(true)
+			  },
+			  bindDateChange1: function(e) {
+			          this.endDate= e.target.value
+			          
+			  						this.getList(true)
+			  },
+			myLoadmore() {
+
+				this.pageIndex += 1;
+				this.getList()
+			},
+			getList(bl) {
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if (bl) {
+					this.list = [];
+					this.pageIndex = 1;
+				}
+				var data = {
+					startDate:this.startDate,
+					endDate:this.endDate,
+					pageIndex: this.pageIndex
+				};
+				API.accountRecordData(data).then((res) => {
+
+					this.list = [
+						...this.list,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal
+					uni.hideLoading()
+
+				}).catch(error => {
+					uni.showToast({
+
+						title: error
+					})
+				})
+			},
+			onReady() {
+				this.startDate=parseUnixTime(beforeTimeStamp(5),"{y}-{m}-{d}")
+				this.endDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
+				
+				this.getList()
+				
+			}
+		}
+	}
+</script>
+<style>
+	page {
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	.chargeScreen {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 10px 0;
+		background-color: #fff;
+
+		span {
+			color: #777;
+		}
+	}
+
+	.chargeScreen-item {
+		display: flex;
+		align-items: center;
+		flex: 1;
+		justify-content: center;
+
+		p {
+			color: #777;
+			margin-right: 5px;
+		}
+	}
+
+	.chargeList {
+		margin-top: 10px;
+	}
+
+	.chargeList-item {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 15px;
+		background-color: #fff;
+		border-bottom: 1px solid #f7f7f7;
+
+		h4 {
+			font-weight: normal;
+			color: #999;
+			margin-top: 3px;
+			font-size: 12px;
+		}
+
+		span {
+			font-size: 14px;
+			color: #1677FF;
+			font-weight: bold;
+		}
+	}
+
+	.chargeList-right {
+		text-align: right;
+	}
+</style>

二進制
static/img/min_button_select.png


+ 77 - 0
uni.scss

@@ -0,0 +1,77 @@
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+@import 'uview-ui/theme.scss';
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color:#333;//基本色
+$uni-text-color-inverse:#fff;//反色
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable:#c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color:#ffffff;
+$uni-bg-color-grey:#f8f8f8;
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color:#c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm:24rpx;
+$uni-font-size-base:28rpx;
+$uni-font-size-lg:32rpx;
+
+/* 图片尺寸 */
+$uni-img-size-sm:40rpx;
+$uni-img-size-base:52rpx;
+$uni-img-size-lg:80rpx;
+
+/* Border Radius */
+$uni-border-radius-sm: 4rpx;
+$uni-border-radius-base: 6rpx;
+$uni-border-radius-lg: 12rpx;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 10px;
+$uni-spacing-row-base: 20rpx;
+$uni-spacing-row-lg: 30rpx;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 8rpx;
+$uni-spacing-col-base: 16rpx;
+$uni-spacing-col-lg: 24rpx;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title:40rpx;
+$uni-color-subtitle: #555555; // 二级标题颜色
+$uni-font-size-subtitle:36rpx;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph:30rpx;

+ 386 - 0
utils/index.js

@@ -0,0 +1,386 @@
+export const currentTimeStamp = () => new Date().getTime()
+
+export const unixTimeStamp = (val) => new Date(val).getTime()
+
+//今天多少天之前的时间
+export const beforeTimeStamp = (dayCount,date) => {
+	
+	if (date) {
+		var dd = new Date(date);
+	} else {
+		var dd = new Date();
+	}
+	dd.setDate(dd.getDate() - dayCount)
+	let time = dd.getTime()
+	return time
+}
+
+//今天多少天之后的时间
+export const afterTimeStamp = (dayCount, date) => {
+	if (date) {
+		var dd = new Date(date);
+	} else {
+		var dd = new Date();
+	}
+	dd.setDate(dd.getDate() + dayCount)
+	let time = dd.getTime()
+	return time
+}
+
+//今天多少年之后的时间
+export const afterYearTimeStamp = (yearCount, date) => {
+	if (date) {
+		var dd = new Date(date);
+	} else {
+		var dd = new Date();
+	}
+	dd.setFullYear(dd.getFullYear() + yearCount)
+	let time = dd.getTime()
+	return time
+}
+
+//计算某日期距当前的时间秒数
+export const secondsDistance = (date) => {
+	var now = new Date().getTime();
+	date = new Date(date).getTime();
+	var seconds = parseInt((now - date) / 1000);
+	return seconds;
+}
+
+//计算两个时间的相差天数
+export const daysDistance = (date1, date2) => {
+	date1 = Date.parse(date1);
+	date2 = Date.parse(date2);
+	var ms = date2 - date1;
+	ms = ms < 0 ? 0 : ms;
+	var days = parseInt(Math.floor(ms / (24 * 3600 * 1000)));
+	return days;
+}
+//计算两个时间的相差小时数
+export const hourDistanceArr = (date1, date2) => {
+	if (!date1 || !date2) {
+		return '-';
+	}
+	date1 = Date.parse(date1);
+	date2 = Date.parse(date2);
+	var ms = date2 - date1;
+	ms = ms < 0 ? 0 : ms;
+	ms = ms / 1000; //s
+	var Hour = parseInt(Math.floor(ms / (60 * 60)));
+	var Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
+	var s = parseInt(Math.floor(ms % (60)));
+	//600000
+	return [Hour, Fen, s]
+}
+//计算两个时间的相差小时数
+export const hourDistance = (date1, date2) => {
+	if (!date1 || !date2) {
+		return '-';
+	}
+	date1 = Date.parse(date1);
+	date2 = Date.parse(date2);
+	var ms = date2 - date1;
+	ms = ms < 0 ? 0 : ms;
+	ms = ms / 1000; //s
+	var Hour = parseInt(Math.floor(ms / (60 * 60)));
+	var Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
+	var s = parseInt(Math.floor(ms % (60)));
+	//600000
+	return Hour + '小时' + Fen + '分钟' + s + '秒';
+}
+
+export const parseUnixTime = (time, cFormat) => {
+	if (arguments.length === 0) {
+		return null
+	}
+	const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
+	let date
+	if (typeof time === 'object') {
+		date = time
+	} else {
+		if (('' + time).length === 10) time = parseInt(time) * 1000
+		date = new Date(time)
+	}
+	const formatObj = {
+		y: date.getFullYear(),
+		m: date.getMonth() + 1,
+		d: date.getDate(),
+		h: date.getHours(),
+		i: date.getMinutes(),
+		s: date.getSeconds(),
+		a: date.getDay()
+	}
+	const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
+		let value = formatObj[key]
+		if (key === 'a') return ['一', '二', '三', '四', '五', '六', '日'][value - 1]
+		if (result.length > 0 && value < 10) {
+			value = '0' + value
+		}
+		return value || 0
+	})
+
+	return time_str
+}
+
+//微信获取code
+export const getWeixinRedirectURI = (appid, url) =>
+	`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(url)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
+
+ 
+
+//支付宝获取code
+export const getAlipayRedirectURI = (appid, url) =>
+	`https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=${appid}&scope=auth_base&redirect_uri=${encodeURIComponent(url)}`
+
+
+//获取链接的?参数
+export const getUrlParam = (name) => {
+	var reg = new RegExp(name + "=([^&]*)(&|$)");
+	var r = window.location.href.match(reg);
+	var strValue = "";
+	if (r != null) {
+		strValue = unescape(r[1]);
+	}
+	return strValue;
+}
+
+
+//将base64图片码转file
+export const dataUrlToFile = (dataurl, filename) => {
+	var arr = dataurl.split(','),
+		mime = arr[0].match(/:(.*?);/)[1],
+		bstr = atob(arr[1]),
+		n = bstr.length,
+		u8arr = new Uint8Array(n);
+	while (n--) {
+		u8arr[n] = bstr.charCodeAt(n);
+	}
+	return new File([u8arr], filename, {
+		type: mime
+	});
+}
+
+//将canvas转换为image的src
+export const convertCanvasToImage = (canvas) => {
+	return canvas.toDataURL("image/png");;
+}
+
+//验证身份证
+export const checkIdCard = (value) => {
+	var identNumber = value;
+
+	if (identNumber != null) {
+		identNumber = (identNumber + "").toUpperCase();
+	}
+
+	if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identNumber))) {
+		return '身份证格式错误';
+	}
+	//身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X。  
+	if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(identNumber))) {
+		return '身份证格式错误';
+	}
+	//校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
+	//下面分别分析出生日期和校验位
+	var len, re;
+	len = identNumber.length;
+	//判断18位身份证号码,现在在国家统一身份证为18位。
+	if (len == 18) {
+		re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/);
+		var arrSplit = identNumber.match(re);
+
+
+		//检查生日日期是否正确
+		var dtmBirth = new Date(arrSplit[2] + "/" + arrSplit[3] + "/" + arrSplit[4]);
+		var bGoodDay;
+		bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) &&
+			(dtmBirth.getDate() == Number(arrSplit[4]));
+		if (!bGoodDay) {
+			return '身份证号码日期不匹配';
+		} else {
+			//检验18位身份证的校验码是否正确。
+			//校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
+			var valnum;
+			var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
+			var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
+			var nTemp = 0,
+				i;
+			for (i = 0; i < 17; i++) {
+				nTemp += identNumber.substr(i, 1) * arrInt[i];
+			}
+			valnum = arrCh[nTemp % 11];
+			if (valnum != identNumber.substr(17, 1)) {
+				return '身份证号码校验位不正确';
+			}
+			return true;
+		}
+	} else {
+		return '身份证号码位数不足';
+	}
+}
+
+// 字符串截取 包含对中文处理,str需截取字符串,start开始截取位置,n截取长度
+export const substrMb = (str, start, n) => {
+	if (str.replace(/[\u4e00-\u9fa5]/g, '**').length <= n) {
+		return str;
+	}
+	let len = 0;
+	let tmpStr = '';
+	for (let i = start; i < str.length; i++) { // 遍历字符串
+		if (/[\u4e00-\u9fa5]/.test(str[i])) { // 中文 长度为两字节
+			len += 2;
+		} else {
+			len += 1;
+		}
+		if (len > n) {
+			break;
+		} else {
+			tmpStr += str[i];
+		}
+	}
+	return tmpStr;
+}
+
+//验证手机号
+export const checkPhone = (value) => {
+	if (!value) {
+		return '手机号不能为空';
+	} else {
+		const reg = /^1[3-9]\d{9}$/
+		var result = reg.test(value);
+
+		if (result) {
+			return true;
+		} else {
+			return '请输入正确的手机号';
+		}
+	}
+};
+
+//验证社会信用代码
+export const checkCreditCode = (value) => {
+	if (!value) {
+		return '社会信用代码不能为空';
+	} else {
+		const reg = /^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g
+		var result = reg.test(value);
+
+		if (result) {
+			return true;
+		} else {
+			return '不是有效的统一社会信用编码';
+		}
+	}
+};
+
+//是否为微信浏览器
+export const isWeiXin = () => {
+	return /MicroMessenger/.test(window.navigator.userAgent)
+}
+
+//获取当前根链接
+export const getBaseUrl = () => {
+	return window.location.href.split("#")[0]
+}
+
+//获取指定日期是否在指定时间之间
+export const inDateBetwen = (d, d1, d2) => {
+	//如果时间格式是正确的,那下面这一步转化时间格式就可以不用了
+	var dateBegin = new Date(d1.replace(/-/g, "/")); //将-转化为/,使用new Date
+	var dateEnd = new Date(d2.replace(/-/g, "/")); //将-转化为/,使用new Date
+	//var dateBegin = new Date(d1);//将-转化为/,使用new Date
+	//var dateEnd = new Date(d2);//将-转化为/,使用new Date
+	var dateNow = new Date(d.replace(/-/g, "/")); //获取当前时间
+
+	var beginDiff = dateNow.getTime() - dateBegin.getTime(); //时间差的毫秒数       
+	var beginDayDiff = Math.floor(beginDiff / (24 * 3600 * 1000)); //计算出相差天数
+
+	var endDiff = dateEnd.getTime() - dateNow.getTime(); //时间差的毫秒数
+	var endDayDiff = Math.floor(endDiff / (24 * 3600 * 1000)); //计算出相差天数       
+	if (endDayDiff < 0) {
+		//已过期
+		return false
+	}
+	if (beginDayDiff < 0) {
+		//没到开始时间
+		return false;
+	}
+	return true;
+}
+
+//type为字符串类型,有两种选择,"s"代表开始,"e"代表结束,dates为数字类型,不传或0代表本周,-1代表上周,1代表下周
+export const getWeekTime = (type, dates) => {
+	var now = new Date();
+	var nowTime = now.getTime();
+	var day = now.getDay();
+	var longTime = 24 * 60 * 60 * 1000;
+	var n = longTime * 7 * (dates || 0);
+	if (type == "s") {
+		var dd = nowTime - (day) * longTime + n;
+	};
+	if (type == "e") {
+		var dd = nowTime + (7 - day - 1) * longTime + n;
+	};
+	dd = new Date(dd);
+	var y = dd.getFullYear();
+	var m = dd.getMonth() + 1;
+	var d = dd.getDate();
+	m = m < 10 ? "0" + m : m;
+	d = d < 10 ? "0" + d : d;
+	var day = y + "-" + m + "-" + d;
+	return day;
+}
+
+export const getDiffDate = (stime, etime) => {
+	//初始化日期列表,数组
+	var diffdate = new Array();
+	var i = 0;
+	//开始日期小于等于结束日期,并循环
+	while (stime <= etime) {
+		diffdate[i] = stime;
+
+		//获取开始日期时间戳
+		var stime_ts = new Date(stime).getTime();
+ 
+		//增加一天时间戳后的日期
+		var next_date = stime_ts + (24 * 60 * 60 * 1000);
+
+		//拼接年月日,这里的月份会返回(0-11),所以要+1
+		var next_dates_y = new Date(next_date).getFullYear() + '-';
+		var next_dates_m = (new Date(next_date).getMonth() + 1 < 10) ? '0' + (new Date(next_date).getMonth() + 1) + '-' : (
+			new Date(next_date).getMonth() + 1) + '-';
+		var next_dates_d = (new Date(next_date).getDate() < 10) ? '0' + new Date(next_date).getDate() : new Date(next_date).getDate();
+
+		stime = next_dates_y + next_dates_m + next_dates_d;
+
+		//增加数组key
+		i++;
+	}
+	return diffdate;
+}
+
+export const isJSON = (str) => {
+	if (typeof str == 'string') {
+		try {
+			var obj = JSON.parse(str);
+			if (typeof obj == 'object' && obj) {
+				return true;
+			} else {
+				return false;
+			}
+		} catch (e) {
+			console.log('error:' + str + '!!!' + e);
+			return false;
+		}
+	}
+}
+
+
+const prefix = 'jp-employment-kfq_'+process.car.NODE_ENV;
+ 
+export const get = key => uni.getStorageInfoSync(prefix+key) 
+
+export const set = (key, value) => uni.setStorageInfoSync(prefix+key, value) 
+
+
+

+ 60 - 0
utils/init.js

@@ -0,0 +1,60 @@
+import carhelp from '@/utils/mixin.js'
+import * as API_WeiXin from '@/apis/weixin.js'
+
+import {
+	getUrlParam,
+	getWeixinRedirectURI,
+	isWeiXin
+} from '@/utils'
+var checkOpenId = true; //是否需要获取openId
+var openId = carhelp.getOpenId();
+
+var app = {
+	init: function() {
+		 
+		if(isWeiXin()|| !(process.env.NODE_ENV === "development") ){
+			if (isWeiXin()) {
+				if (checkOpenId) {
+					if (!openId) {
+						this.getOpenId();
+					} else {
+					 
+					}
+				}
+			} else{
+				alert("请使用微信打开本页面")
+			}
+		}else{
+			carhelp.setOpenId(process.car.openId)
+		}
+		
+		
+	},
+	 
+	getOpenId() {
+		
+		const code = getUrlParam('code');
+		var openId = carhelp.getOpenId()
+		if (!openId) {
+			if (!code) {
+				var url = document.URL;
+				var getUrl= getWeixinRedirectURI(process.car.VUE_APP_WXAPPID, url);
+				 
+				window.location.href = getUrl;
+			} else {
+				
+				API_WeiXin.getDataByCode(code).then(response => {
+					
+					carhelp.setOpenId(response.data.openid)
+					openId = response.data.openid;
+					carhelp.set("xpgj_wx_user_info",response.data)
+					
+					 location.reload();
+				}).catch(error => {
+					console.log(error);
+				});
+			}
+		}
+	}
+}
+module.exports = app

+ 34 - 0
utils/mixin.js

@@ -0,0 +1,34 @@
+var prefix = 'jp_charging_' + process.car.NODE_ENV + '_';
+
+var app = {
+	
+	getPrefix:()=> prefix,
+	get : key =>  uni.getStorageSync(prefix + key),
+
+	set : (key, value) => uni.setStorageSync(prefix + key, value),
+	remove: key =>  uni.removeStorageSync(prefix + key),
+	
+	getPersonInfo : () => {
+		 return uni.getStorageSync(prefix + 'personInfo')
+	},
+	signOut:()=>  uni.removeStorageSync(prefix  + 'personInfo'),
+	getOpenId : () =>   uni.getStorageSync(prefix + 'wx_openId'),
+
+	setOpenId : (value) => uni.setStorageSync(prefix + 'wx_openId', value),
+	setPersonInfo : (value) => uni.setStorageSync(prefix + 'personInfo', value),
+	
+	getToken : () =>  uni.getStorageSync(prefix + 'token'),
+	setToken : (value) => {
+		uni.setStorageSync(prefix + 'token', value)
+		
+		if(value){
+			var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
+			uni.setStorageSync(prefix + 'token_tdate', tdate)
+		}
+	}
+	,
+	
+	
+}
+
+module.exports = app

+ 76 - 0
utils/request.js

@@ -0,0 +1,76 @@
+import  carhelp from '@/utils/mixin.js'
+import requestSon from './requestSon.js';
+import requestNum from './requestNum.js';
+
+
+const request = (options) => {
+	//记录请求次数和响应次数
+	var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
+	var token_tdate=carhelp.get("token_tdate");//每10分钟存储一次token
+	
+	var token=carhelp.getToken();
+	
+	 if(token_tdate&&token_tdate==tdate){
+	 	return requestSon(options);
+	 }
+	 var openId=carhelp.getOpenId()
+	var  urlindex="/wechat/findUserInfo"
+	var k=options.url.indexOf(urlindex)==-1;
+	
+	 if(!openId&&k){
+		 return
+	 }
+	if(!k){
+		return requestSon(options);
+	}
+	
+	return new Promise((resolve, reject) => {
+		 
+		 
+		uni.request({
+			method:'get',
+			url: process.car.BASE_URL + "/mobile/regUser/findByOpenId",
+			data: {
+				openId:openId,
+			
+			},
+			
+			header: {
+				'Content-Type': 'application/x-www-form-urlencoded',
+				'X-Requested-With': 'XMLHttpRequest',
+				//'Authorization':token
+			}
+		}).then((response) => {
+ 			let [error, res] = response;
+ 		  
+			if (res.data.code == 200&&res.data.result) {
+				
+				var token = res ? res.data.data.token : '';
+				carhelp.setPersonInfo(res.data.data.regUser );
+				
+				carhelp.setToken(token);
+				
+				options.token=token
+				
+				var isson= requestSon(options)
+				//requestNum(options);
+				resolve(isson);
+				 
+			} else  if(res.data.code == 415||(res.data.code == 200&&!res.data.result)||res.data.code == 400){
+				
+				var url=window.location.href.split("#")[1]
+				window.location.href="#/pages/login/index?message=请登录&back="+ url+"&phone="+options.data.phone
+				
+			 
+				
+			}else{
+				reject(res.data.message)
+			}
+		}).catch(error => {
+			
+			let [err, res] = error;
+			reject(err)
+		})
+	});
+}
+export default request

+ 59 - 0
utils/requestNum.js

@@ -0,0 +1,59 @@
+import  carhelp from '@/utils/mixin.js'
+
+//记录请求次数和响应次数
+let reqCount = 0,
+	resCount = 0;
+var baseUrl=process.car.BASE_URL;
+const request = (options) => {
+	var token=carhelp.getToken();
+	
+	reqCount++;
+	 
+	return new Promise((resolve, reject) => {
+		//如果特殊链接需要传入token
+		if(options&&options.token){
+			token=options.token;
+		}
+		uni.request({
+			method: 'post',
+			url: baseUrl + '/mobile/messageApi/readMessageNum',
+			//data: options.data?options.data:{},
+			
+			header: {
+				'Content-Type': 'application/x-www-form-urlencoded',
+				'X-Requested-With': 'XMLHttpRequest',
+				'Authorization':token
+			}
+		}).then((response) => {
+			//for(var t = Date.now(); Date.now() - t <= 2000;);
+			
+			resCount++
+			//防止连续请求多个接口时loading闪现
+			let [error, res] = response;
+			
+			
+			if (res.data.code != 200) {
+				reject(res.data.message)
+			} else {
+				if(!res.data.result){
+					uni.showToast({
+						title: res.data.message,
+						position:'bottom'
+					})
+					reject(res.data.message);
+				}else{
+					
+					carhelp.set("tabbar_show_num",res.data.data);
+					resolve(res.data);
+				}
+			
+			}
+		}).catch(error => {
+			resCount++
+		
+			let [err, res] = error;
+			reject(err)
+		})
+	});
+}
+export default request

+ 71 - 0
utils/requestSon.js

@@ -0,0 +1,71 @@
+import  carhelp from '@/utils/mixin.js'
+
+//记录请求次数和响应次数
+let reqCount = 0,
+	resCount = 0;
+var baseUrl=process.car.BASE_URL;
+
+if (process.env.NODE_ENV === "development") {
+	//baseUrl="http://192.168.33.230:8086/jp-employment-server";
+}
+const request = (options) => {
+	var token=carhelp.getToken();
+	
+	reqCount++;
+	 
+	return new Promise((resolve, reject) => {
+		//如果特殊链接需要传入token
+		if(options&&options.token){
+			token=options.token;
+		}
+		uni.request({
+			method: options.method?options.method:'get',
+			url: baseUrl + options.url,
+			data: options.data?options.data:{},
+			
+			header: options.header?{
+				...options.header,
+				'Authorization':token
+			}:{
+				'Content-Type': 'application/x-www-form-urlencoded',
+				'X-Requested-With': 'XMLHttpRequest',
+				'Authorization':token
+			}
+		}).then((response) => {
+			//for(var t = Date.now(); Date.now() - t <= 2000;);
+			
+			resCount++
+			//防止连续请求多个接口时loading闪现
+			let [error, res] = response;
+			
+			if (res.data.code == 415&&res.data.message=='请先注册信息') {
+				carhelp.signOut()
+				uni.redirectTo({
+					url: 'pages/login/index'
+				})
+				return;
+			}
+			
+			if (res.data.code != 200) {
+				reject(res.data.message)
+			} else {
+				if(!res.data.result){
+					uni.showToast({
+						title: res.data.message,
+						position:'bottom'
+					})
+					reject(res.data.message);
+				}else{
+					resolve(res.data);
+				}
+			
+			}
+		}).catch(error => {
+			resCount++
+		
+			let [err, res] = error;
+			reject(err)
+		})
+	});
+}
+export default request

+ 69 - 0
utils/requestWhite.js

@@ -0,0 +1,69 @@
+import  carhelp from '@/utils/mixin.js'
+
+//记录请求次数和响应次数
+let reqCount = 0,
+	resCount = 0;
+//var token=carhelp.getToken();
+var baseUrl=process.car.BASE_URL;
+
+if (process.env.NODE_ENV === "development") {
+	//baseUrl="http://192.168.33.90:8086/jp-employment-server";
+}
+const request = (options) => {
+	var token=carhelp.getToken();
+	
+	reqCount++;
+	 
+	return new Promise((resolve, reject) => {
+		//如果特殊链接需要传入token
+		if(options&&options.token){
+			token=options.token;
+		}
+		uni.request({
+			method: options.method?options.method:'get',
+			url: baseUrl + options.url,
+			data: options.data?options.data:{},
+			
+			header: options.header?{
+				...options.header,
+				'Authorization':token
+			}:{
+				'Content-Type': 'application/x-www-form-urlencoded',
+				'X-Requested-With': 'XMLHttpRequest',
+				'Authorization':token
+			}
+		}).then((response) => {
+			//for(var t = Date.now(); Date.now() - t <= 2000;);
+			
+			resCount++
+			//防止连续请求多个接口时loading闪现
+			let [error, res] = response;
+			
+			if (res.data.code == 415&&res.data.message=='请先注册信息') {
+				carhelp.signOut()
+				uni.redirectTo({
+					url: '/pages/login/index'
+				})
+				return;
+			}
+			
+			if (res.data.code != 200) {
+				reject(res.data.message)
+			} else {
+				if(!res.data.result){
+					uni.showToast({
+						title: res.data.message,
+						position:'bottom'
+					})
+				}
+				resolve(res.data);
+			}
+		}).catch(error => {
+			resCount++
+		
+			let [err, res] = error;
+			reject(err)
+		})
+	});
+}
+export default request

+ 209 - 0
utils/wxJsApi.js

@@ -0,0 +1,209 @@
+import wx from 'weixin-js-sdk'
+import * as API_WeiXin from '@/apis/weixin.js'
+import * as API_Common from '@/apis/common.js'
+
+import Qs from 'qs';
+import request from './request.js'
+export function addSysLog(message) {
+
+	return request({
+		url: '/mobile/sysLogApi/submit',
+		data: Qs.stringify({
+			message: JSON.stringify(message)
+		}),
+		method: 'post',
+	})
+}
+//获取微信配置
+export function getWxConfig(jsApiList) {
+	var jsApiList = jsApiList || ['chooseImage', 'getLocalImgData', 'scanQRCode'];
+	 
+	let promise = (jsApiList => {
+		return new Promise((resolve, reject) => {
+			console.log(jsApiList);
+			API_WeiXin.getConfig().then(response => {
+				var wxconfig = response.data.wxConfig;
+			
+				wx.config({
+					debug: false, // 开启调试模式,
+					appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
+					timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
+					nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
+					signature: wxconfig.signature, // 必填,签名,见附录1
+					jsApiList: jsApiList, // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+					openTagList:['wx-open-subscribe']
+				});
+				wx.ready(function() {
+					resolve(response.data);
+				})
+				wx.error(function(res) {
+					reject('微信api配置出错');
+				});
+			}).catch(error => {
+				//mui.toast(error);
+				reject(error);
+			})
+		})
+	})(jsApiList)
+
+	return promise;
+}
+
+//选择图片,多图上传和单图上传的回调处理不一样
+export function chooseImage(count,islocalId) {
+	var count = count || 1;
+	let promise = new Promise((resolve, reject) => {
+		wx.chooseImage({
+			count: count,
+			sizeType: ['compressed'],
+			sourceType: ['album', 'camera'],
+			success: function(res) {
+				 
+				var localIds = res.localIds;
+				
+				if(islocalId){
+					
+					resolve(localIds);
+				}else{
+					if (count == 1) {
+						wx.getLocalImgData({
+							localId: localIds[0],
+							success: function(res) {
+								resolve(res);
+							}
+						});
+					} else {
+						resolve(localIds);
+					}
+				}
+				
+			}
+		});
+	});
+	return promise;
+}
+
+
+
+
+//获取图片,用于多图上传时的递归处理
+export function getLocalImgData(localId, fun) {
+	wx.getLocalImgData({
+		localId: localId,
+		success: function(res) {
+			fun(res);
+		}
+	});
+}
+
+//上传图片
+export function uploadPic(imgBase64) {
+	let promise = new Promise((resolve, reject) => {
+		var formData = new FormData();
+		formData.append('photoName', '1.jpg');
+		formData.append('photoBase64Data', imgBase64);
+
+	
+		API_Common.uploadBase64(formData).then(response => {
+			resolve(response);
+		}).catch(error => {
+			//mui.toast(error);
+			reject(error);
+		})
+	});
+	return promise;
+}
+
+//获取坐标
+export function getLocation() {
+	let promise = new Promise((resolve, reject) => {
+		wx.ready(function() {
+			wx.getLocation({
+				type: 'gcj02', // 默认为wgs84的gps坐标,可传入'gcj02'
+				success: function(res) {
+					resolve(res);
+				},
+				faile: function(res) {
+					reject(res);
+				},
+				fail: function(res) {
+					if (res.errMsg == 'getLocation:timeout') {
+						
+						res="定位超时,请检查是否开启'定位'"
+					} else if (res.errMsg == 'getLocation:ERROR_NETWORK') {
+						//mui.alert("网络异常");
+						res="定位超时,请检查是否开启'定位'"
+					} else if (res.errMsg == 'getLocation:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF') {
+						res="没开启系统定位"
+						//mui.alert("没开启系统定位");
+					} else if (res.errMsg == 'getLocation:system permission denied') {
+						res="未给微信位置授权"
+						//mui.alert("未给微信位置授权");
+					} else if (res.errMsg == 'getLocation:location permission') {
+						res="未给微信位置授权"
+						//mui.alert("未给微信位置授权");
+					} else if (res.errMsg == 'getLocation:auth denied') {
+						res="用户在小程序中未授权"
+						//mui.alert("用户在小程序中未授权");
+					} else if (res.errMsg == 'getLocation:fail authorize no response') {
+						res="用户在小程序中未授权"
+						//mui.alert("用户在小程序中未授权");
+					}
+					reject(res);
+				},
+				complete() {}
+			})
+		})
+	})
+	return promise;
+}
+
+//扫描二维码
+export function scanQRCode(needResult,obj) {
+	var needResult = needResult || 1;
+	let promise = new Promise((resolve, reject) => {
+		wx.scanQRCode({
+			needResult: needResult,
+			scanType: ["qrCode"],
+			success: function(res) {
+				var url = res.resultStr;
+				resolve(url);
+			},
+			faile: function(res) {
+				reject(res);
+			},
+			
+			fail: function(res) {
+
+				reject(res);
+			},
+			complete() {
+				if(obj){
+					obj.showLoading(false)	
+				}
+			}
+		})
+	});
+	return promise;
+}
+
+export function requestSubscribeMessage(sz) {
+	 
+	let promise = new Promise((resolve, reject) => {
+		wx.ready(function() {
+			wx.requestSubscribeMessage({
+			
+			tmplIds: sz,
+			
+				success(res) { 
+						resolve(res);
+				}
+				
+			})
+		})
+		
+
+	});
+	return promise;
+}
+

+ 60 - 0
utils/wxpay.js

@@ -0,0 +1,60 @@
+ 
+function onBridgeReady(params) {
+	console.log("onBridgeReady+"+new Date().getTime())
+	
+	uni.showLoading({
+		mask:true,title:'加载中...'
+	})
+	//记录要回跳的url
+	window.WeixinJSBridge.invoke(
+		'getBrandWCPayRequest', {
+			'appId': params.appId, // 公众号名称,由商户传入
+			'timeStamp': params.timeStamp, // 时间戳,自1970年以来的秒数
+			'nonceStr': params.nonceStr, // 随机串
+			'package': params.package,
+			'signType': params.signType, // 微信签名方式:
+			'paySign': params.paySign // 微信签名
+		},
+		(res) => {
+			//alert(JSON.stringify(res)); // 支付取消会执行 支付成功不会
+			if (res.err_msg == 'get_brand_wcpay_request:ok') {
+				//alert("支付成功") // 不会执行
+				//window.location.href = params.url
+			} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
+				//alert("支付取消") // 会执行
+				 uni.hideLoading();
+			} else {
+				alert("支付失败")
+				 uni.hideLoading();
+			}
+		}
+	)
+}
+
+export const wxPayJs = (params) => {
+	console.log("wxPayJs+"+new Date().getTime())
+	
+	uni.showLoading({
+		mask:true,title:'加载中...'
+	})
+	if (!params.url) {
+		params.url = window.location.href.split("#")[0] + "/#/";
+	}
+
+	if (typeof window.WeixinJSBridge === 'undefined') {
+		if (document.addEventListener) {
+			document.addEventListener('WeixinJSBridgeReady', function() {
+				onBridgeReady(params)
+			}, false)
+		} else if (document.attachEvent) {
+			document.attachEvent('WeixinJSBridgeReady', function() {
+				onBridgeReady(params)
+			})
+			document.attachEvent('onWeixinJSBridgeReady', function() {
+				onBridgeReady(params)
+			})
+		}
+	} else {
+		onBridgeReady(params)
+	}
+}

+ 89 - 0
vue.config.js

@@ -0,0 +1,89 @@
+const path = require('path');
+const webpack = require('webpack')
+
+const CompressionWebpackPlugin = require("compression-webpack-plugin")
+const productionGzipExtensions = ['js', 'css']
+
+function resolve(dir) {
+	return path.join(__dirname, dir)
+}
+
+const Timestamp = new Date().getTime();
+module.exports = {
+	publicPath: './',
+	outputDir: 'dist/' ,
+	assetsDir: 'static',
+	lintOnSave: false,
+	devServer: {
+		host: 'localhost',
+		port: 8080,
+		//解析缓存
+		disableHostCheck: true,
+		//支持gzip
+		compress: true,
+	},
+	//不输出map
+	productionSourceMap: false,
+	chainWebpack: (config) => {
+		config.entry.app = ['babel-polyfill', './src/main.js']
+		config.resolve.alias
+			.set('@', resolve('./static/'))
+
+		config.plugins.delete('preload-index');
+		config.plugins.delete('prefetch-index');
+		
+		config.module.rule('images')
+		           .test(/\.(png|jpe?g|gif|webp)(\?.*)?$/)
+		           .use('url-loader')
+		           .loader('file-loader')
+		           .options({
+		               name: 'static/img/[name].[hash:8].[ext]'
+		           })
+				
+		config.optimization.minimize(true);
+	},
+	configureWebpack: config => {
+		/* //开启gzip压缩,需要配置Nginx服务器gzip选项开启
+		config.plugins.push(
+			new CompressionWebpackPlugin({
+				filename: '[path].gz[query]',
+				algorithm: 'gzip',
+				test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
+				threshold: 10240,
+				minRatio: 0.8
+			})
+		); */
+
+			config.plugins.push(new webpack.ProgressPlugin(percentage => {
+				percentage === 1 ? console.log('编译完成:100.00%') : console.log(`编译进度:${(percentage * 100).toFixed(2)}%`)
+			}));
+		config.output.filename = `./static/js/[name].${Timestamp}.js`
+		config.output.chunkFilename = `./static/js/[name].${Timestamp}.js`
+
+		config.performance = {
+			hints: 'warning',
+			//入口起点的最大体积 整数类型(以字节为单位)
+			maxEntrypointSize: 50000000,
+			//生成文件的最大体积 整数类型(以字节为单位 300k)
+			maxAssetSize: 30000000,
+			//只给出 js 文件的性能提示
+			assetFilter: function(assetFilename) {
+				return assetFilename.endsWith('.js');
+			}
+		}
+	},
+	css: {
+		extract: {
+			filename: `./static/css/[name].${Timestamp}.css`,
+			chunkFilename: `./static/css/[name].${Timestamp}.css`
+		},
+		sourceMap: false,
+		loaderOptions: {
+			// 给 sass-loader 传递选项
+			sass: {
+				// @/ 是 src/ 的别名
+				// prependData: `@import "@/assets/scss/base.scss";`
+			}
+		}
+	}
+};