diff --git a/.env.production b/.env.production
index 543d7d1..2f2afbc 100644
--- a/.env.production
+++ b/.env.production
@@ -3,5 +3,5 @@ ENV = 'production'
# base api
#VUE_APP_BASE_API = '/prod-api'
-VUE_APP_BASE_API = '/prov-api'
+VUE_APP_BASE_API = 'http://test.renniting.cn/bcp/'
diff --git a/package.json b/package.json
index d3b980a..9fd592b 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"normalize.css": "7.0.0",
"nprogress": "^0.2.0",
"path-to-regexp": "2.4.0",
+ "qrcodejs2": "^0.0.2",
"vue": "2.6.10",
"vue-router": "3.0.6",
"vuex": "3.1.0"
diff --git a/src/api/account.js b/src/api/account.js
new file mode 100644
index 0000000..ea2b7ab
--- /dev/null
+++ b/src/api/account.js
@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+/**
+ * 获取车主账户
+ * @param param
+ */
+export function getAcctPersonGroupByAcctType(param) {
+ return request({
+ url: '/personPc/acct/getAcctPersonGroupByAcctType',
+ method: 'post',
+ data:param
+ })
+}
+/**
+ * 分页查询车主支出详情
+ * @param param
+ */
+export function queryAcctPayOutForPage(param) {
+ return request({
+ url: '/personPc/acct/queryAcctPayOutForPage',
+ method: 'post',
+ data:param
+ })
+}
+/**
+ * 分页查询车主收费端充值的收入详情"
+ * @param param
+ */
+export function queryCustRechargeFeeStaticMsg(param) {
+ return request({
+ url: '/personPc/acct/queryCustRechargeFeeStaticMsg',
+ method: 'post',
+ data:param
+ })
+}
diff --git a/src/api/cardticket.js b/src/api/cardticket.js
new file mode 100644
index 0000000..60cd3b1
--- /dev/null
+++ b/src/api/cardticket.js
@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+/**
+ * 车主查询自己的卡券信息
+ */
+export function getCouponPerson() {
+ return request({
+ url: '/personCouponPc/getCouponPerson',
+ method: 'post'
+ })
+}
diff --git a/src/api/index.js b/src/api/index.js
new file mode 100644
index 0000000..30ba837
--- /dev/null
+++ b/src/api/index.js
@@ -0,0 +1,68 @@
+import request from '@/utils/request'
+
+/**
+ * 获取车主首页卡片信息
+ * @param param
+ */
+export function getCustIndexBaseInfo(param) {
+ return request({
+ url: '/personPc/index/getCustIndexBaseInfo',
+ method: 'post',
+ data:param
+ })
+}
+/**
+ * 获取车主月支出
+ * @param param
+ */
+export function queryOwnerPayOutByMonth(param) {
+ return request({
+ url: '/personPc/index/queryOwnerPayOutByMonth',
+ method: 'post',
+ data:param
+ })
+}
+/**
+ * 获取车主停车记录
+ * @param param
+ */
+export function queryOwnerParkRecord(param) {
+ return request({
+ url: '/personPc/index/queryOwnerParkRecord',
+ method: 'post',
+ data:param
+ })
+}
+/**
+ * 分页查询车主欠费记录
+ * @param param
+ */
+export function pageQueryArrearRecordByCondition(param) {
+ return request({
+ url: '/personPc/index/pageQueryArrearRecordByCondition',
+ method: 'post',
+ data:param
+ })
+}
+/**
+ * 补缴获取二维码
+ * @param param
+ */
+export function personOrderBackWxPay(param) {
+ return request({
+ url: '/personPc/wxPay/personOrderBackWxPay',
+ method: 'post',
+ data:param
+ })
+}
+/**
+ * 获取所有组织下拉框
+ * @param param
+ */
+export function selectAllAppOrg(param) {
+ return request({
+ url: '/personPc/index/selectAllAppOrg',
+ method: 'post',
+ data:param
+ })
+}
diff --git a/src/api/mycar.js b/src/api/mycar.js
new file mode 100644
index 0000000..c8bc5c9
--- /dev/null
+++ b/src/api/mycar.js
@@ -0,0 +1,36 @@
+import request from '@/utils/request'
+
+/**
+ * 车主查询自己的车牌信息
+ */
+export function getPersonCarNumPC() {
+ return request({
+ url: '/personCarNumPc/getPersonCarNumPC',
+ method: 'post'
+ })
+}
+
+/**
+ * 绑定车牌
+ * @param params
+ */
+export function boundCarNum(params) {
+ return request({
+ url: '/personCarNumPc/boundCarNum',
+ method: 'post',
+ params
+ })
+}
+
+/**
+ * 解绑车牌
+ * @param params
+ */
+export function unboundCarNum() {
+ return request({
+ url: '/personCarNumPc/unboundCarNum',
+ method: 'post'
+ })
+}
+
+
diff --git a/src/api/mysuggest.js b/src/api/mysuggest.js
new file mode 100644
index 0000000..7010636
--- /dev/null
+++ b/src/api/mysuggest.js
@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+
+/**
+ * 分页查询-投诉建议
+ * @param params
+ */
+export function queryFeedbackAndSuggestForPage(params){
+ return request({
+ url: '/personPc/suggest/queryFeedbackAndSuggestForPage',
+ method: 'post',
+ data:params
+ })
+}
+
+
+/**
+ * 问题类型
+ * @param params
+ */
+export function getFeedbackType(params){
+ return request({
+ url: '/personPc/suggest/getFeedbackType',
+ method: 'post',
+ data:params
+ })
+}
+
+
+/**
+ * 问题类型
+ * @param params
+ */
+export function saveFeedbackAndSuggest(params){
+ return request({
+ url: '/personPc/suggest/saveFeedbackAndSuggest',
+ method: 'post',
+ data:params
+ })
+}
+
+
+
+
+
+
diff --git a/src/api/user.js b/src/api/user.js
index cfa4a42..debf308 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -9,7 +9,6 @@ export function login(data) {
}
export function getInfo(token) {
- debugger
return request({
url: '/personPc/getUserInfo',
method: 'post',
@@ -35,3 +34,25 @@ export function logout() {
method: 'post'
})
}
+
+export function uploadUserPic(file){
+ debugger
+ return request({
+ url: '/personPc/uploadUserPic',
+ method: 'post',
+ data:file
+ })
+}
+
+/**
+ * 更新个人客户信息
+ * @param params
+ */
+export function updatePersonByCustId(params){
+ return request({
+ url: '/personPc/updatePersonBycustId',
+ method: 'post',
+ data:params
+ })
+}
+
diff --git a/src/filters/index.js b/src/filters/index.js
new file mode 100644
index 0000000..346dff8
--- /dev/null
+++ b/src/filters/index.js
@@ -0,0 +1,349 @@
+// import parseTime, formatTime and set to filter
+export { parseTime, formatTime } from '@/utils'
+let moment = require("moment");
+/**
+ * Show plural label if time is plural number
+ * @param {number} time
+ * @param {string} label
+ * @return {string}
+ */
+function pluralize(time, label) {
+ if (time === 1) {
+ return time + label
+ }
+ return time + label + 's'
+}
+
+/**
+ * @param {number} time
+ */
+export function timeAgo(time) {
+ const between = Date.now() / 1000 - Number(time)
+ if (between < 3600) {
+ return pluralize(~~(between / 60), ' minute')
+ } else if (between < 86400) {
+ return pluralize(~~(between / 3600), ' hour')
+ } else {
+ return pluralize(~~(between / 86400), ' day')
+ }
+}
+
+/**
+ * Number formatting
+ * like 10000 => 10k
+ * @param {number} num
+ * @param {number} digits
+ */
+export function numberFormatter(num, digits) {
+ const si = [
+ { value: 1E18, symbol: 'E' },
+ { value: 1E15, symbol: 'P' },
+ { value: 1E12, symbol: 'T' },
+ { value: 1E9, symbol: 'G' },
+ { value: 1E6, symbol: 'M' },
+ { value: 1E3, symbol: 'k' }
+ ]
+ for (let i = 0; i < si.length; i++) {
+ if (num >= si[i].value) {
+ return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
+ }
+ }
+ return num.toString()
+}
+
+/**
+ * 10000 => "10,000"
+ * @param {number} num
+ */
+export function toThousandFilter(num) {
+ return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
+}
+
+/**
+ * 分转元
+ * @param {number} num
+ */
+export function fen2Yuan(num) {
+ if(num == undefined || num == null){
+ return 0;
+ }
+ num = num / 100;
+ return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
+}
+
+/**
+ * Upper case first char
+ * @param {String} string
+ */
+export function uppercaseFirst(string) {
+ return string.charAt(0).toUpperCase() + string.slice(1)
+}
+
+/**
+ * 将制定格式的时间字符串转换成long
+ *
0-yyyyMMdd
+ * 1-yyyy-MM-dd
+ * 2-HHmmss
+ * 3-HH:mm:ss
+ * 4-HHmmssSSS
+ * 5-HH:mm:ss.SSS
+ * 6-yyyyMMddHHmmss
+ * 7-yyyy-MM-dd HH:mm:ss
+ * 8-yyyyMMddHHmmssSSS
+ * 9-yyyy-MM-dd HH:mm:ss.SSS
+ * 10-yyyy/MM/dd HH:mm
+ * 11-yyyy/MM/dd HH:mm:ss
+ *
+ */
+export function string2Long(str, format) {
+ if (str == null || str == "") {
+ return "";
+ }
+ return date2Long(string2Date(str, format));
+}
+
+export function date2Long (date) {
+ return date.getTime();
+}
+
+/**
+ * 将字符串转化为相应时间
+ *
+ * @param {}
+ * dateStr 时间字符串
+ * @param {}
+ * formatType 指定格式:
+ *
+ * - 0-yyyyMMdd
+ * - 1-yyyy-MM-dd
+ * - 2-HHmmss
+ * - 3-HH:mm:ss
+ * - 4-HHmmssSSS
+ * - 5-HH:mm:ss.SSS
+ * - 6-yyyyMMddHHmmss
+ * - 7-yyyy-MM-dd HH:mm:ss
+ * - 8-yyyyMMddHHmmssSSS
+ * - 9-yyyy-MM-dd HH:mm:ss.SSS
+ * - 10-yyyy/MM/dd HH:mm
+ * - 11-yyyy/MM/dd HH:mm:ss
+
+ *
+ * @return 解析后的Date对象
+ */
+export function string2Date(date,formatType) {
+ if(date == null || date == undefined){
+ return "";
+ }
+ let dateTime;
+ switch (formatType) {
+ case 0 :
+ dateTime= moment(date).format("YYYYMMDD");
+ break;
+ case 1 :
+ dateTime= moment(date).format("YYYY-MM-DD");
+ break;
+ case 2 :
+ dateTime= moment(date).format("HHmmss");
+ break;
+ case 3 :
+ dateTime= moment(date).format("HH:mm:ss");
+ break;
+ case 4 :
+ dateTime= moment(date).format("HHmmssSSS");
+ break;
+ case 5 :
+ dateTime= moment(date).format("HH:mm:ss.SSS");
+ break;
+ case 6 :
+ dateTime= moment(date).format("YYYY-MM-DDHHmmss");
+ break;
+ case 7 :
+ dateTime= moment(date).format("YYYY-MM-DD HH:mm:ss");
+
+ break;
+ case 8 :
+ dateTime= moment(date).format("yyyyMMddHHmmssSSS");
+ break;
+ case 9 :
+ dateTime= moment(date).format("yyyy-MM-dd HH:mm:ss.SSS");
+ break;
+ case 10 ://yyyy/MM/dd HH:mm
+ dateTime= moment(date).format("yyyy/MM/dd HH:mm");
+ break;
+ case 11 ://yyyy/MM/dd HH:mm:ss
+ dateTime= moment(date).format("yyyy/MM/dd HH:mm:ss");
+ break;
+ }
+ return dateTime;
+}
+
+/**类型转换*/
+export function busTypeFomatter(value){
+ //业务类型: 1:收入 2:退款 3:支出
+ if(value == 1){
+ return '交易';
+ }else if(value == 2){
+ return '退款';
+ }else if(value == 3){
+ return '支出';
+ }else{
+ return '未知';
+ }
+};
+export function payTypeFomatter(value){
+ //业务类型: 1:收入 2:退款 3:支出
+ if(value == 1){
+ return '支付宝';
+ }else if(value == 2){
+ return '微信';
+ }else if(value == 3){
+ return '银联';
+ }else if(value == 4){
+ return '服务号';
+ }else{
+ return '未知';
+ }
+};
+export function payOrderTypeFomatter(row,value){
+ //101:停车付款单,102:停车预付单,103:停车补缴单,104:共享车位;201:余额充值单,202:押金充值;301:会员卡购买单,302:会员卡续费
+ if(value == 101){
+ return '交易-临停支付';
+ }else if(value == 102){
+ return '交易-停车预付';
+ }else if(value == 103){
+ return '交易-停车补缴';
+ }else if(value == 104){
+ return '交易-共享车位预定';
+ }else if(value == 201){
+ if(row.terminalSource!='' ||row.terminalSource!=null ||row.terminalSource!=undefined||row.terminalSource!='null'){
+ if(row.terminalSource == 1){
+ return '交易-余额充值';
+ } else if(row.terminalSource == 2){
+ return '交易-收费员充值';
+ }else {
+ return '交易-余额充值';
+ }
+ }
+ else{
+ return '交易-余额充值';
+ }
+
+ }else if(value == 202){
+ return '交易-押金充值';
+ }else if(value == 301){
+ return '交易-会员卡购买';
+ }else if(value == 302){
+ return '交易-会员卡续费';
+ }else{
+ return '未知';
+ }
+};
+
+/**
+ * 订单状态
+ * @param row
+ * @param value
+ * @returns {string}
+ */
+export function inOutStateFormatter(row, value) {
+
+ let orderState = row.orderState;
+ //停车状态 10:在场 ,20:离场,30:预订
+ let parkState = row.parkState;
+ if (null == parkState) {
+ if (null != row.parkOutTime) {
+ parkState = 20;
+ } else {
+ parkState = 10;
+ }
+ }
+
+ if (parkState == 10) {
+ return "在场";
+ }
+
+ if (parkState == 20) {
+
+ if (orderState == 52) {
+ return "欠费";
+ }else if (orderState == 53) {
+ return "欠费已补缴";
+ } else {
+ return "离场";
+ }
+ }
+};
+
+/**
+ * 停车时长
+ * @param row
+ * @param value
+ * @returns {*}
+ */
+export function parkingDurationFormatter (row, value) {
+ //
+ let parkState = row.parkState;
+ if (null == parkState) {
+ if (null != row.parkOutTime) {
+ parkState = 20;
+ } else {
+ parkState = 10;
+ }
+ }
+
+ let inTime = row.parkInTime;
+ if (parkState == 10) {
+ let thisTime = new Date().getTime();
+ let parkDuration = (thisTime - inTime) / 1000;
+ return formatSeconds(parkDuration);
+ }
+
+
+ if (value == null) {
+ return "";
+ } else {
+ return formatSeconds(value);
+ }
+};
+function formatSeconds(value) {
+ let theTime = parseInt(value);// 秒
+ let theTime1 = 0;// 分
+ let theTime2 = 0;// 小时
+ let theTime3 = 0;//天
+ if (theTime < 60) {
+ return theTime + '秒';
+ }
+ if (theTime > 60) {
+ theTime1 = parseInt(theTime / 60);
+ theTime = parseInt(theTime % 60);
+
+
+ }
+
+ if (theTime1 > 60) {
+ theTime2 = parseInt(theTime1 / 60);
+ theTime1 = parseInt(theTime1 % 60);
+ }
+
+ if (theTime2 > 24) {
+ theTime3 = parseInt(theTime2 / 24);
+ theTime2 = parseInt(theTime2 % 24);
+ }
+
+ let result = '';
+ if (theTime1 == 0 && theTime2 == 0 && theTime3 == 0) {
+ result = parseInt(theTime) + "秒"
+ }
+
+ if (theTime1 > 0) {
+ result = "" + parseInt(theTime1) + "分钟" + result;
+ }
+ if (theTime2 > 0) {
+ result = "" + parseInt(theTime2) + "小时" + result;
+ }
+
+ if (theTime3 > 0) {
+ result = "" + parseInt(theTime3) + "天" + result;
+ }
+ return result;
+};
diff --git a/src/main.js b/src/main.js
index 611654e..4bca80f 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,6 +11,7 @@ import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
+import * as filters from './filters' // global filters
import '@/icons' // icon
import '@/permission' // permission control
@@ -28,6 +29,10 @@ import '@/permission' // permission control
// mockXHR()
// }
+// register global utility filters
+Object.keys(filters).forEach(key => {
+ Vue.filter(key, filters[key])
+})
// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
diff --git a/src/router/index.js b/src/router/index.js
index d1aa32b..919ddf9 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -123,11 +123,6 @@ export const constantRoutes = [
meta: { title: '个人资料' }
},
{
- path: 'settings',
- component: () => import('@/views/settings/index'),
- meta: { title: '账户设置' },
- },
- {
path: 'myevaluate',
component: () => import('@/views/myevaluate/index'),
meta: { title: '我的评价' }
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index cbdfac6..91cc65b 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -32,7 +32,6 @@ const actions = {
return new Promise((resolve, reject) => {
login({ userPhone: phone.trim(), validatorCode: password }).then(response => {
const { data } = response
- debugger;
commit('SET_TOKEN', data.token)
setToken(data.token)
resolve()
@@ -45,14 +44,11 @@ const actions = {
// get user info
getInfo({ commit, state }) {
return new Promise((resolve, reject) => {
- debugger
getInfo(state.token).then(response => {
const { data } = response
-
if (!data) {
reject('Verification failed, please Login again.')
}
-
const { custName, headPicUrl } = data
commit('SET_NAME', custName)
diff --git a/src/utils/DateUtils.js b/src/utils/DateUtils.js
new file mode 100755
index 0000000..8d5c547
--- /dev/null
+++ b/src/utils/DateUtils.js
@@ -0,0 +1,494 @@
+/**
+ * 时间处理工具
+ *
+ * @type
+ * @author miaofc
+ */
+export default {
+
+ /**
+ * 日期对象转换为毫秒数
+ */
+
+ date2Long: function (date) {
+ return date.getTime();
+ },
+ /**
+ * 毫秒转换为日期对象
+ * @param dateVal number 日期的毫秒数
+ */
+ long2Date: function (dateVal) {
+ return new Date(dateVal);
+ },
+
+ /**
+ * 将制定格式的时间字符串转换成long
+ * 0-yyyyMMdd
+ * 1-yyyy-MM-dd
+ * 2-HHmmss
+ * 3-HH:mm:ss
+ * 4-HHmmssSSS
+ * 5-HH:mm:ss.SSS
+ * 6-yyyyMMddHHmmss
+ * 7-yyyy-MM-dd HH:mm:ss
+ * 8-yyyyMMddHHmmssSSS
+ * 9-yyyy-MM-dd HH:mm:ss.SSS
+ * 10-yyyy/MM/dd HH:mm
+ * 11-yyyy/MM/dd HH:mm:ss
+ *
+ */
+ string2Long: function (str, format) {
+ if (str == null || str == "") {
+ return "";
+ }
+ return this.date2Long(this.string2Date(str, format));
+ },
+
+
+ /**
+ * 毫秒转换为日期对象
+ *
+ * @param dateVal
+ *
+
+ */
+ long2String: function (dateVal, formatType) {
+ if (dateVal == undefined || dateVal == null) {
+ return '-'
+ }
+ return this.date2String(new Date(dateVal), formatType);
+ },
+
+
+ /**
+ * 将时间转化为相应字符串
+ *
+ * @param {}
+ * date 待格式化的Date对象
+ * @param {}
+ * formatType 指定格式:
+ *
+ * - 0-yyyyMMdd
+ * - 1-yyyy-MM-dd
+ * - 2-HHmmss
+ * - 3-HH:mm:ss
+ * - 4-HHmmssSSS
+ * - 5-HH:mm:ss.SSS
+ * - 6-yyyyMMddHHmmss
+ * - 7-yyyy-MM-dd HH:mm:ss
+ * - 8-yyyyMMddHHmmssSSS
+ * - 9-yyyy-MM-dd HH:mm:ss.SSS
+ * - 10-yyyy/MM/dd HH:mm
+ *
+ * @return string 格式化后的字符串
+ */
+ date2String: function (date, formatType) {
+ if (undefined == date || null == date) {
+ return '-';
+ }
+ // 格式化字符串数组
+ var patterns = ["yyyyMMdd", "yyyy-MM-dd", "HHmmss", "HH:mm:ss", "HHmmssSSS", "HH:mm:ss.SSS", "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss", "yyyyMMddHHmmssSSS", "yyyy-MM-dd HH:mm:ss.SSS", "yyyy/MM/dd HH:mm", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd", "yyyy-MM", "HH:mm"];
+ return this.formatDate(date, patterns[formatType]);
+ },
+
+ /**
+ * 将字符串转化为相应时间
+ *
+ * @param {}
+ * dateStr 时间字符串
+ * @param {}
+ * formatType 指定格式:
+ *
+ * - 0-yyyyMMdd
+ * - 1-yyyy-MM-dd
+ * - 2-HHmmss
+ * - 3-HH:mm:ss
+ * - 4-HHmmssSSS
+ * - 5-HH:mm:ss.SSS
+ * - 6-yyyyMMddHHmmss
+ * - 7-yyyy-MM-dd HH:mm:ss
+ * - 8-yyyyMMddHHmmssSSS
+ * - 9-yyyy-MM-dd HH:mm:ss.SSS
+ * - 10-yyyy/MM/dd HH:mm
+ * - 11-yyyy/MM/dd HH:mm:ss
+
+ *
+ * @return 解析后的Date对象
+ */
+ string2Date:function (date,formatType) {
+ let dateTime;
+ switch (formatType) {
+ case 0 :
+ dateTime= moment(date).format("YYYYMMDD");
+ break;
+ case 1 :
+ dateTime= moment(date).format("YYYY-MM-DD");
+ break;
+ case 2 :
+ dateTime= moment(date).format("HHmmss");
+ break;
+ case 3 :
+ dateTime= moment(date).format("HH:mm:ss");
+ break;
+ case 4 :
+ dateTime= moment(date).format("HHmmssSSS");
+ break;
+ case 5 :
+ dateTime= moment(date).format("HH:mm:ss.SSS");
+ break;
+ case 6 :
+ dateTime= moment(date).format("YYYY-MM-DDHHmmss");
+ break;
+ case 7 :
+ dateTime= moment(date).format("YYYY-MM-DD HH:mm:ss");
+
+ break;
+ case 8 :
+ dateTime= moment(date).format("yyyyMMddHHmmssSSS");
+ break;
+ case 9 :
+ dateTime= moment(date).format("yyyy-MM-dd HH:mm:ss.SSS");
+ break;
+ case 10 ://yyyy/MM/dd HH:mm
+ dateTime= moment(date).format("yyyy/MM/dd HH:mm");
+ break;
+ case 11 ://yyyy/MM/dd HH:mm:ss
+ dateTime= moment(date).format("yyyy/MM/dd HH:mm:ss");
+ break;
+ }
+ return dateTime;
+ },
+ /**
+ * 格式化时间
+ *
+ * @param {}
+ * date 待格式化的Date对象
+ * @param {}
+ * pattern 格式化模式,可能包含下列字母
+ *
+ * - G 公元前/后 "G":"BC"/"AD"
+ * - y 年份 "yyyy":"1996";"yy":"96"
+ * - M 月份 "MMMM":July;"MMM":Jul;"MM":07
+ * - d 在某月中的日期 "dd":"10"
+ * - a Am/pm "a":"AM"/"PM"
+ * - H 在某天中的小时(0-23) "HH":"13"
+ * - K 在上午或下午中的小时(0-11) "KK":"03"
+ * - m 分钟 "mm":"10"
+ * - s 秒钟 "ss":"09"
+ * - S 毫秒 "SSS":"978"
+ *
+ * @return 格式化后的字符串
+ */
+ formatDate: function (date, pattern) {
+ var dateStr = new String(pattern);
+ // 格式化公元信息
+ dateStr = dateStr.replace("G", date.getFullYear() >= 0 ? "AD" : "BC");
+ // 格式化年份信息
+ var year = new String(date.getFullYear());
+ dateStr = dateStr.replace("yyyy", year);
+ dateStr = dateStr.replace("yy", year.substring(year.length - 2, year.length));
+ // 格式化月份信息
+ var month = date.getMonth();
+ var monthFullNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
+ var monthShortNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
+ dateStr = dateStr.replace("MMMM", monthFullNames[month]);
+ dateStr = dateStr.replace("MMM", monthShortNames[month]);
+ dateStr = dateStr.replace("MM", month < 9 ? "0" + (month + 1) : month + 1);
+ // 格式化月份中的日期
+ var day = date.getDate();
+ dateStr = dateStr.replace("dd", day < 10 ? "0" + day : day);
+ // 格式化上下午
+ dateStr = dateStr.replace("a", date.getHours() < 12 ? "AM" : "PM");
+ // 格式化小时
+ var hour = date.getHours();
+ dateStr = dateStr.replace("HH", hour < 10 ? "0" + hour : hour);
+ var khour = hour > 11 ? hour - 12 : hour;
+ dateStr = dateStr.replace("KK", khour < 10 ? "0" + khour : khour);
+ // 格式化分钟
+ var minute = date.getMinutes();
+ dateStr = dateStr.replace("mm", minute < 10 ? "0" + minute : minute);
+ // 格式化秒钟
+ var second = date.getSeconds();
+ dateStr = dateStr.replace("ss", second < 10 ? "0" + second : second);
+ // 格式化毫秒
+ var millisecond = date.getMilliseconds();
+ dateStr = dateStr.replace("SSS", millisecond < 10 ? "00" + millisecond : (millisecond < 100 ? "0" + millisecond : millisecond));
+ return dateStr;
+ },
+
+ /**
+ * 取得date在域field上偏移amount后的值
+ *
+ * @param {}
+ * date 原始时间
+ * @param {}
+ * field 偏移域,可能的取值:
+ *
+ * - "year"/"y":年
+ * - "month"/"M":月
+ * - "day"/"d":日
+ * - "hour"/"h":时
+ * - "minute"/"m":分
+ * - "second"/"s":秒
+ * - "millisecond"/"ms"/"S":毫秒
+ *
+ * @param {}
+ * amount 偏移量
+ * @return 偏移后的时间
+ */
+ dateOffset: function (date, field, amount) {
+ var mount = 0;
+ switch (field) {
+ // 以年为单位位移
+ case "year", "y":
+ mount = 31536000 * 1000;
+ // newDate.setFullYear(date.getFullYear()+amount);
+ break;
+ // 以月份为单位位移
+ case "month", "M":
+ mount = 30 * 24 * 60 * 60 * 1000;
+ // newDate.setMonth(date.getMonth()+amount);
+ break;
+ // 以天为单位位移
+ case "day", "d":
+ mount = 24 * 60 * 60 * 1000;
+ // newDate.setDate(date.getDate()+amount);
+ break;
+ // 以小时为单位位移
+ case "hour", "h":
+ mount = 60 * 60 * 1000;
+ // newDate.setHours(date.getHours()+amount);
+ break;
+ // 以分钟为单位位移
+ case "minute", "m":
+ mount = 60 * 1000;
+ // newDate.setMinutes(date.getMinutes()+amount);
+ break;
+ // 以秒为单位位移
+ case "second", "s":
+ mount = 1000;
+ // newDate.setSeconds(date.getSeconds+amount);
+ break;
+ // 以毫秒为单位位移
+ case "millisecond", "ms", "S":
+ mount = 1;
+ // newDate.setMilliseconds(date.getMilliseconds+amount);
+ break;
+ }
+ var newDate = new Date(date.getTime() + Number(mount) * Number(amount));
+ return newDate;
+ },
+
+ /**
+ * 求两个日期间相差的毫秒数
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的毫秒数
+ */
+ getDiffMillis: function (date1, date2) {
+ return date1.getTime() - date2.getTime();
+ },
+
+ /**
+ * 求两个日期间相差的秒数
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的秒数
+ */
+ getDiffSeconds: function (date1, date2) {
+ return Math.floor(this.getDiffMillis(date1, date2) / 1000);
+ },
+
+ /**
+ * 求两个日期间相差的分钟数目
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的分钟数
+ */
+ getDiffMinutes: function (date1, date2) {
+ return Math.floor(this.getDiffSeconds(date1, date2) / 60);
+ },
+
+ /**
+ * 求两个日期间相差的小时数目
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的小时数
+ */
+ getDiffHours: function (date1, date2) {
+ return Math.floor(this.getDiffMinutes(date1, date2) / 60);
+ },
+
+ /**
+ * 求两个日期间相差的天数
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的天数
+ */
+ getDiffDays: function (date1, date2) {
+ return Math.floor(this.getDiffHours(date1, date2) / 24);
+ },
+
+ /**
+ * 求两个日期间相差的月数目。认为每个月均为30天。
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的月树
+ */
+ getDiffMonths: function (date1, date2) {
+ return Math.floor(this.getDiffDays(date1, date2) / 30);
+ },
+
+ /**
+ * 求两个日期间相差的自然月数目
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的自然月数
+ */
+ getDiffNaturalMonth: function (date1, date2) {
+ var month1 = date1.getMonth();
+ var month2 = date2.getMonth();
+ return this.getDiffYears(date1, date2) * 12 - (month2 - month1);
+ },
+
+ /**
+ * 求两个日期间相差的年数目
+ *
+ * @param {}
+ * date1 时间1
+ * @param {}
+ * date2 时间2
+ * @return 两个时间相差的年数
+ */
+ getDiffYears: function (date1, date2) {
+ return date1.getFullYear() - date2.getFullYear();
+ },
+
+ /**
+ * 求日期为其所在月份的第几天
+ *
+ * @param {}
+ * day 目标日
+ * @return 目标日是第几天。天数从1开始
+ */
+ getOrinalOfDayInYear: function (day) {
+ // 得到一年中的第一天
+ var firstDay = new Date(day.getFullYear, 0, 1);
+ // 计算与第一天的差值
+ return this.getDiffDays(day, firstDay) + 1;
+ },
+
+ /**
+ * 求日期为其所在月份的第几天
+ *
+ * @param {}
+ * day 目标日
+ * @return 目标日是第几天。天数从1开始
+ */
+ getOrinalOfDayInMonth: function (day) {
+ // 得到一个月中的第一天
+ var firstDay = new Date(day.getFullYear, day.getMonth(), 1);
+ // 计算与第一天的差值
+ return this.getDiffDays(day, firstDay) + 1;
+ },
+
+ /**
+ * 求日期为其所在周的第几天
+ *
+ * @param {}
+ * day 目标日
+ * @return 目标日是第几天。天数从1开始
+ */
+ getOrinalOfDayInWeek: function (day) {
+ return day.getDay() + 1;
+ },
+
+ /**
+ * 求某年共有多少天
+ *
+ * @param {}
+ * year 年份
+ * @return 该年份共有多少天
+ */
+ getNumberOfDaysInYear: function (year) {
+ // 若该年份为闰年,返回366
+ if ((year % 100 != 0 && year % 4 == 0) || (year % 400 == 0)) {
+ return 366;
+ }
+ // 普通年份返回365
+ return 365;
+ },
+
+ /**
+ * 求某月共有多少天
+ *
+ * @param {}
+ * year 年份
+ * @param {}
+ * month 月份
+ * @return 该月内共有多少天
+ */
+ getNumberOfDaysInMonth: function (year, month) {
+ // 得到该月份的第一天
+ var date1 = new Date(year, month - 1, 1);
+ // 得到后一个月份的第一天
+ var date2 = "";
+ if (month != 11) {
+ date2 = new Date(year, month, 1);
+ } else {
+ date2 = new Date(year - 1, 0, 1);
+ }
+ return this.getDiffDays(date1, date2);
+ },
+
+ /**
+ * 得到当前年份一共有多少天
+ *
+ * @return 当前年份共有多少天
+ */
+ getNumberOfDaysInCurrentYear: function () {
+ var date = new Date();
+ return this.getNumberOfDaysInYear(date.getYear());
+ },
+
+ /**
+ * 得到当前月份一共有多少天
+ *
+ * @return 当前月份共有多少天
+ */
+ getNumberOfDaysInCurrentMonth: function () {
+ var date = new Date();
+ return this.getNumberOfDaysInMonth(date.getYear(), date.getMonth() + 1);
+ },
+
+// 金钱格式处理
+ moneyFormatter: function (value) {
+ if (value == '0' || value == undefined || value == null || value === '') {
+ return '0.00';
+ } else {
+ return (value / 100).toFixed(2);
+ }
+ }
+
+};
diff --git a/src/utils/request.js b/src/utils/request.js
index 54d8a77..3d392d7 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -58,7 +58,6 @@ service.interceptors.response.use(
}
},
error => {
- debugger
console.log('err' + error) // for debug
Message({
message: error.message,
diff --git a/src/utils/utils.js b/src/utils/utils.js
new file mode 100644
index 0000000..253b5b1
--- /dev/null
+++ b/src/utils/utils.js
@@ -0,0 +1,81 @@
+import DateUtils from './DateUtils.js';
+
+/**
+ * 将制定格式的时间字符串转换成long
+ * 0-yyyyMMdd
+ * 1-yyyy-MM-dd
+ * 2-HHmmss
+ * 3-HH:mm:ss
+ * 4-HHmmssSSS
+ * 5-HH:mm:ss.SSS
+ * 6-yyyyMMddHHmmss
+ * 7-yyyy-MM-dd HH:mm:ss
+ * 8-yyyyMMddHHmmssSSS
+ * 9-yyyy-MM-dd HH:mm:ss.SSS
+ * 10-yyyy/MM/dd HH:mm
+ * 11-yyyy/MM/dd HH:mm:ss
+ */
+// 日期格式处理 精确到时分秒 如:2018-10-24 08:41:33
+export function timeFormatter(value, row, index) {
+ if (value == null || value == undefined || value == '') {
+ return "-";
+ } else {
+ return DateUtils.long2String(value, 7);
+ }
+}
+
+// 日期格式处理 精确到年月日 如:2018-10-24
+export function timeOneFormatter(value, row, index) {
+ if (value == null || value == undefined || value == '') {
+ return "-";
+ } else {
+ return DateUtils.long2String(value, 1);
+ }
+}
+
+// 时间处理,获取日期的当天开始时间:'2019-06-01 00:00:00'
+export function getBeginOfTheDay(value) {
+ if (value == null || value == undefined || value == '') {
+ return new Date(new Date(new Date().toLocaleDateString()).getTime());
+ } else {
+ return new Date(new Date(value.toLocaleDateString()).getTime());
+ }
+}
+
+// 时间处理,获取日期的当天开始时间:'2019-06-01 23:59:59
+export function getEndOfTheDay(value) {
+ if (value == null || value == undefined || value == '') {
+ return new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60*1000-1);
+ } else {
+ return new Date(new Date(value.toLocaleDateString()).getTime()+24*60*60*1000-1);
+ }
+}
+
+// 日期格式处理 精确到年月 如:2018-10
+export function yearMonthFormatter(value, row, index) {
+ if (value == null || value == undefined || value == '') {
+ return "-";
+ } else {
+ var str = DateUtils.long2String(value, 1);
+ return str.substr(0, 7);
+ }
+}
+
+// 金钱格式处理
+export function moneyFormatter(value) {
+ if (value == '0' || value == undefined || value == null || value === '') {
+ return '0.00';
+ } else {
+ return (value / 100).toFixed(2);
+ }
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/account/index.vue b/src/views/account/index.vue
index c6e2ae8..eaa7bbc 100644
--- a/src/views/account/index.vue
+++ b/src/views/account/index.vue
@@ -10,7 +10,7 @@
充值账户(元)
- 240.0
+ {{rechargeBalance|fen2Yuan}}
@@ -23,7 +23,7 @@
赠送账户(元)
- 140.0
+ {{presentBalance|fen2Yuan}}
@@ -34,70 +34,114 @@
+
+ 账户余额
+ 充值赠送
+
+
+ {{(scope.row.rechargeFee) |fen2Yuan}}
+
+
+ {{(scope.row.rechargeBalance) |fen2Yuan}}
+
+
+ {{(scope.row.rechargeTime) |string2Date(7)}}
+
+ :total="total"
+ @size-change="handleSizeChange"
+ @current-change="handleSizeChange"
+ @prev-click="handleSizeChange"
+ @next-click="handleSizeChange">
+
+ 账户余额
+ 充值赠送
+
+
+ {{(scope.row.tradeFee) |fen2Yuan}}
+
+
+ {{(scope.row.tradeBalance) |fen2Yuan}}
+
+
+ 停车支付
+ 停车预付
+ 停车补缴
+ 共享车位
+ 余额充值
+ 押金充值
+ 会员卡购买
+ 会员卡续费
+
+
+ {{(scope.row.tradeTime) |string2Date(7)}}
+
+ :total="total2"
+ @size-change="handleSizeChange2"
+ @current-change="handleSizeChange2"
+ @prev-click="handleSizeChange2"
+ @next-click="handleSizeChange2">
@@ -111,7 +155,8 @@
import pagination from '@/components/Pagination/index.vue';
import LoadingBar from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
-
+import {getAcctPersonGroupByAcctType,queryCustRechargeFeeStaticMsg,queryAcctPayOutForPage} from '@/api/account';
+import {fen2Yuan,string2Date} from '@/filters/index';
export default {
components:{
'i-pagination': pagination
@@ -121,101 +166,140 @@ export default {
},
data() {
return {
+ rechargeBalance:0,
+ presentBalance:0,
list: null,
tabPosition:'top',
listLoading: true,
btnLoading:false,
loading:false,
- paytableData: [
- {
- parkName: '个人账户',
- license: '21',
- money: '31',
- inTime: '2019-06-02 09:00:00',
- },
- {
- parkName: '个人账户',
- license: '10',
- money: '31',
- inTime: '2019-06-02 00:23:00',
- },
- {
- parkName: '个人账户',
- license: '21',
- money: '31',
- inTime: '2019-06-02 09:00:00',
- },
- {
- parkName: '个人账户',
- license: '10',
- money: '31',
- inTime: '2019-06-02 00:23:00',
- },{
- parkName: '个人账户',
- license: '10',
- money: '31',
- inTime: '2019-06-02 00:23:00',
- },
+ rechargeTableData: [
],
- outtableData: [
- {
- parkName: '个人账户',
- license: '21',
- money: '31',
- outtype: '停车支付',
- inTime: '2019-06-02 09:00:00',
- },
- {
- parkName: '个人账户',
- license: '10',
- money: '31',
- outtype: '停车支付',
- inTime: '2019-06-02 00:23:00',
- },
- {
- parkName: '个人账户',
- license: '21',
- money: '31',
- outtype: '停车支付',
- inTime: '2019-06-02 09:00:00',
- },
- {
- parkName: '个人账户',
- license: '10',
- money: '31',
- outtype: '停车支付',
- inTime: '2019-06-02 00:23:00',
- },
+ payOutTableData: [
],
/** 分页*/
- total: 32,
+ total: 0,
currentPage: 1,
pageSize: 10,
+ total2: 0,
+ currentPage2: 1,
+ pageSize2: 10,
}
},
- computed: {
+ mounted: function() {
+ this.getAcctPersonGroupByAcctType();
+ this.queryCustRechargeFeeStaticMsg();
+ this.queryAcctPayOutForPage();
},
- created() {
- },
- mounted:function () {
- },
methods: {
- queryBtn:function () {
- LoadingBar.start();
- this.btnLoading=true;
- this.loading = true;
+ /**
+ * 获取查询参数
+ */
+ getQueryParams: function() {
+ let userInfo = this.$store.state.user.userInfo;
+ let beginTime = new Date();
+ let endTime = new Date();
+ beginTime.setFullYear(2017);
+
+ let req = {
+ beginTime:beginTime,
+ endTime:endTime,
+ sysCode:'10003',
+ custId:userInfo.custId,
+ // custId:'501519113641649119232',//账户支出
+ //custId:'501522943145292840960',//账户充值
+
+ }
+ return req;
+ },
+ /**
+ * 查询车主账户信息
+ */
+ getAcctPersonGroupByAcctType: function() {
+ let req = this.getQueryParams();
+ getAcctPersonGroupByAcctType(req).then(response =>{
+ if(response.code=='8888'){
+ let data = response.data;
+ let rechargeBalance = 0;
+ let presentBalance = 0;
+ data.forEach(item=>{
+ if(item.acctType == 1){
+ rechargeBalance += item.acctBalance;
+ }
+ if(item.acctType == 7){
+ presentBalance += item.acctBalance;
+ }
+ });
+ this.rechargeBalance = rechargeBalance;
+ this.presentBalance = presentBalance;
+ }else{
+ console.log(response);
+ }
+ });
},
- /**获取子组件页码方法*/
- handleSizeChange: function(pages) {
- this.currentPage = pages.page;
- this.pageSize = pages.limit;
+ /**
+ * 查询车主充值记录
+ */
+ queryCustRechargeFeeStaticMsg: function() {
+ let req = this.getQueryParams();
+ req.baseRequest={
+ pageNum:this.currentPage,
+ pageSize:this.pageSize,
+ },
+ queryCustRechargeFeeStaticMsg(req).then(response =>{
+ if(response.code=='8888'){
+ this.rechargeTableData = response.data.rows;
+ this.total = response.data.total;
+ }else{
+ console.log(response);
+ }
+
+ });
+ },
+
+ /**
+ * 查询车主支出记录
+ */
+ queryAcctPayOutForPage: function() {
+ let req = this.getQueryParams();
+
+ req.baseRequest={
+ pageNum:this.currentPage2,
+ pageSize:this.pageSize2,
+ },
+ queryAcctPayOutForPage (req).then(response =>{
+ if(response.code=='8888'){
+ this.payOutTableData = response.data.rows;
+ this.total2 = response.data.total;
+ }else{
+ console.log(response);
+ }
+
+ });
+ },
+ // 获取子组件页码方法
+ handleSizeChange: function(page) {
+ console.log(page)
+ this.currentPage = page;
/** 调用表格数据.*/
- this.queryBtn();
+ this.queryCustRechargeFeeStaticMsg();
+
},
+ // 获取子组件页码方法
+ handleSizeChange2: function(page) {
+ console.log(page)
+ this.currentPage2 = page;
+ /** 调用表格数据.*/
+ this.queryAcctPayOutForPage();
+
+ },
+
+ },
+
+
- }
}
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 0c60727..79d90e1 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -109,14 +109,16 @@ export default {
//获取验证码
else {
sendValidatorCode(phone).then(response =>{
- if(response.code=='8888'){
+ let data = response.data;
+ if(data.code=='8888'){
this.$message({
type: 'success',
message: '验证码发送成功!'
});
}
});
- this.validateBtn();
+ //this.validateBtn();
+
}
},
validateBtn(){
@@ -136,7 +138,6 @@ export default {
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
- debugger
if (valid) {
this.loading = true
this.$store.dispatch('user/login', this.loginForm).then(() => {
diff --git a/src/views/mycar/index.vue b/src/views/mycar/index.vue
index 5648780..fab6962 100644
--- a/src/views/mycar/index.vue
+++ b/src/views/mycar/index.vue
@@ -5,113 +5,208 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 车牌绑定
+
+
+
+
+
+
+
+
+
+ 绑定车牌
+
+
+
+
+
+
+
+
+
+
+ 解绑车牌
+
+
+
+
+
+
+
+
+
+ 解绑车牌
+
+
+
+
+
+
+
+
+
-
-
- 我的车牌
- 绑定车牌
-
-
-
-
-
-
-
-
-
-
-
- 解绑
-
-
-
-
-
-
-
-
-
-
-
-
-
-