├── README.md
├── app.js
├── app.json
├── app.wxss
├── components
└── blackTip
│ └── blackTip.wxml
├── images
├── add.png
├── buycar.png
├── dianxin.png
├── feiji.jpg
├── gongshang.png
├── icon_info.png
├── jianshe.png
├── liantong.png
├── milk.jpg
├── nav.png
├── nbd.jpg
├── nongye.png
├── picc.png
├── right.png
├── shentong.png
├── shihua.png
├── shunfeng.png
├── wechat.png
├── yidong.png
├── zhengzhi.png
└── zhongtong.png
├── pages
├── addcar
│ ├── addcar.js
│ ├── addcar.json
│ ├── addcar.wxml
│ └── addcar.wxss
├── carQuery
│ ├── carQuery.js
│ ├── carQuery.json
│ ├── carQuery.wxml
│ └── carQuery.wxss
├── cardetail
│ ├── cardetail.js
│ ├── cardetail.json
│ ├── cardetail.wxml
│ └── cardetail.wxss
├── index
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── logs
│ ├── logs.js
│ ├── logs.json
│ ├── logs.wxml
│ └── logs.wxss
├── mapNav
│ ├── mapNav.js
│ ├── mapNav.json
│ ├── mapNav.wxml
│ └── mapNav.wxss
└── queryResult
│ ├── queryResult.js
│ ├── queryResult.json
│ ├── queryResult.wxml
│ └── queryResult.wxss
└── utils
├── qqmap-wx-jssdk.min.js
└── util.js
/README.md:
--------------------------------------------------------------------------------
1 | # 车辆违章查询的小程序,
2 | ### 进行车辆违章的查询,将数据存在本地,为优化资源,节省接口的调用
3 | ### 存储一辆车辆为怡,用户可自由的删除车辆信息后再添加
4 | ### 首页有些日常使用的小功能,为方便用户
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function () {
4 | //调用API从本地缓存中获取数据
5 | var logs = wx.getStorageSync('logs') || []
6 | logs.unshift(Date.now())
7 | wx.setStorageSync('logs', logs);
8 |
9 |
10 | // 获取本地车辆信息
11 | var carlist = wx.getStorageSync('carlist');
12 | this.globalData.carlist = carlist || [];
13 |
14 |
15 | wx.blackTip = function(str, duration = 2500, cb) {
16 | let pages = getCurrentPages();
17 | let curPage = pages[pages.length - 1];
18 | this.setData({
19 | "blackTip.show": true,
20 | "blackTip.str": str,
21 | });
22 | setTimeout(() => {
23 | this.setData({
24 | "blackTip.show": false,
25 | });
26 | typeof cb === "function" && cb();
27 | }, duration);
28 | }
29 | },
30 | getUserInfo:function(cb){
31 | var that = this
32 | if(this.globalData.userInfo){
33 | typeof cb == "function" && cb(this.globalData.userInfo)
34 | }else{
35 | //调用登录接口
36 | // wx.login({
37 | // success: function () {
38 | // wx.getUserInfo({
39 | // success: function (res) {console.log(res.userInfo);
40 | // that.globalData.userInfo = res.userInfo
41 | // typeof cb == "function" && cb(that.globalData.userInfo)
42 | // }
43 | // })
44 | // }
45 | // })
46 | }
47 | },
48 | setGlobalData:function(data){
49 | resultData:data
50 | },
51 | globalData:{
52 | userInfo:null,
53 | appKey:"949444c44b29aaa96b7e976dae276025",
54 | _appkey: '6153a559d2972c39',
55 | // appKey: " 6153a559d2972c39",
56 | mapkey: 'GPWBZ-X55WI-UXEGI-5OEAL-EFBSF-JUF4B',
57 | cphm : "",
58 | cjh : "",
59 | fdjh : "",
60 | lstype : "",
61 | lsprefix : "",
62 | carorg : "",
63 | resultData: [
64 | {
65 | "time": "2016-07-08 07:16:32",
66 | "address": "[西湖区]长江路_长江路竞舟北路口(长江路)",
67 | "content": "不按规定停放影响其他车辆和行人通行的",
68 | "legalnum": "7003",
69 | "price": "150",
70 | "score": "0",
71 | "number": "",
72 | "illegalid": "4821518"
73 | }
74 | ],
75 | hphm:null,
76 | carlist: []
77 |
78 | },
79 | testCarnumber: function (str) {
80 | var a = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Za-z]{1}[A-Za-z]{1}[A-Za-z0-9]{4}[A-Za-z0-9挂学警港澳]{1}$/
81 | if (a.test(str || '')) {
82 | return true;
83 | } else {
84 | return false;
85 | }
86 | },
87 | // 检测车架号和 发动机号
88 | testCode: function(str) {
89 | if (str.length === 6) {
90 | return true;
91 | } else {
92 | return false;
93 | }
94 | }
95 | })
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages":[
3 |
4 | "pages/index/index",
5 | "pages/cardetail/cardetail",
6 | "pages/queryResult/queryResult",
7 | "pages/mapNav/mapNav",
8 |
9 | "pages/carQuery/carQuery",
10 | "pages/addcar/addcar"
11 |
12 | ],
13 | "window":{
14 | "backgroundTextStyle":"light",
15 | "navigationBarBackgroundColor": "#fff100",
16 | "navigationBarTitleText": "WeChat",
17 | "navigationBarTextStyle":"black"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | page{
3 | color: #333;
4 | font-size: 32rpx;
5 | font-family: '微软雅黑';
6 | }
7 | .blackTip{
8 | z-index:2999;
9 | position:fixed;
10 | width:250rpx;
11 | background:#333;
12 | color:#fff;
13 | padding:36rpx;
14 | opacity:0.75;
15 | font-size:36rpx;
16 | top:30%;
17 | left:50%;
18 | border-radius:16rpx;
19 | text-align:center;
20 | word-break:break-all;
21 | -moz-transform:translateZ(0) translateX(-50%) translateY(-50%);
22 | -webkit-transform:translateZ(0) translateX(-50%) translateY(-50%);
23 | transform:translateZ(0) translateX(-50%) translateY(-50%);
24 | }
25 | .blackTip .info{
26 | width: 150rpx;
27 | height:150rpx;
28 | display: inline-block;
29 | background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAP6ElEQVR4Xu2dgbXVthJFNRUkqQCoIFABoQJIBUAFgQp+qCBQQUgFgQoCFQQq+FDB51Uwfx0/+eJ7r21J9kiWreO13oIEeWQfab+ZkWRJHK9sCqjqQ2/8F//nXeccfvqr//+hZ/gwKPDFOYcfXN3/F5GPIQP892UKyLLbeFevgKr+6Jz72TmHzt4DENvxrYUEMD1A+PtnEflmXUlL9ghIYmur6n3nHDwDIMDfhx4h0VqR4gDmk/c2H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PEmzDEy+eJF5jpDsxZP0qQfivrOhpmrq37PPkMeqWQ0gPuTiF3OxLXfcclnXVqXKVhUgHhKsAsaHRDw0JrU1910eS9afLNkeNOdrVweIhwTfQQASzrrnbP16bCMZBxz4Lqaqq0pAmLxX1UdyP0wVyfjUS1YNyCAvwZJ5hly5u2pZ+wipXoTOKS/7SNe1VQ8IQ66tu0iW+j86557VGFJdvu0uABmEXDyvPUt/LWp01WbSRZ90i8WKa1/Q7/SBiUUm8GvFLHs/EnF4jaT9wMo+4k5DrDGR/Im7L5ibbN2FgvUj13gtIvD+u7t2FWJdqquqGA6GN3m4O+XbeODd5Bq7HcWK6UeqislFgHInpjzLZFfgqw+nks8EzP5kiRXs2oOMeBS4cYZdiZ3AsPiuw6kxHQ4FCF7QnwILSAiKYc8PmOrA8LnGqlN8yz1yXE2HA6R/bYIS1wFWljosGL0uhwVkAAoSeawSpkdZScPg9sOD0QwgFx4Fx5chT2EyvwwWJN/Q712pbXeWPabdXYf3IGNS+XP+4FUe20l5aEvvMUoYe57JkZRoEpCR8Auw0Kuc92x4CwydA4zqlqGXgrBpQIYi+yUsAAVhWKuwAAp8hwModrUkJBcwBGRE2cZgIRQzdBGQwK8ev5wFXgWz9UfIWTAChRlu/CDZbjZ8ivE6BCRGpUEZ710AC35wTFrt4Rg8BGBAyIRz2hk6JbQ5AUkQa2JEDHsNA5T+B/MuWy2exOLA4XmHn1oZjl3ZjJO3E5Bcyt4ue+lPp+3/7GHqawVUoU+JERINf+vj7/1yjm4xYG07gWSUtLjp/wP6n1pML48TqwAAAABJRU5ErkJggg==") no-repeat center;
30 | background-size: 80%;
31 | }
--------------------------------------------------------------------------------
/components/blackTip/blackTip.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{str}}
5 |
6 |
--------------------------------------------------------------------------------
/images/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/add.png
--------------------------------------------------------------------------------
/images/buycar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/buycar.png
--------------------------------------------------------------------------------
/images/dianxin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/dianxin.png
--------------------------------------------------------------------------------
/images/feiji.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/feiji.jpg
--------------------------------------------------------------------------------
/images/gongshang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/gongshang.png
--------------------------------------------------------------------------------
/images/icon_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/icon_info.png
--------------------------------------------------------------------------------
/images/jianshe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/jianshe.png
--------------------------------------------------------------------------------
/images/liantong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/liantong.png
--------------------------------------------------------------------------------
/images/milk.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/milk.jpg
--------------------------------------------------------------------------------
/images/nav.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/nav.png
--------------------------------------------------------------------------------
/images/nbd.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/nbd.jpg
--------------------------------------------------------------------------------
/images/nongye.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/nongye.png
--------------------------------------------------------------------------------
/images/picc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/picc.png
--------------------------------------------------------------------------------
/images/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/right.png
--------------------------------------------------------------------------------
/images/shentong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/shentong.png
--------------------------------------------------------------------------------
/images/shihua.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/shihua.png
--------------------------------------------------------------------------------
/images/shunfeng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/shunfeng.png
--------------------------------------------------------------------------------
/images/wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/wechat.png
--------------------------------------------------------------------------------
/images/yidong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/yidong.png
--------------------------------------------------------------------------------
/images/zhengzhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/zhengzhi.png
--------------------------------------------------------------------------------
/images/zhongtong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yishibakaien/cardata-query-miniapp/3fe0adbaf7760fdb9427384fccbc747c45177c03/images/zhongtong.png
--------------------------------------------------------------------------------
/pages/addcar/addcar.js:
--------------------------------------------------------------------------------
1 | // pages/addcar/addcar.js
2 |
3 | var app = getApp();
4 | Page({
5 | data:{
6 | btn: {
7 | disabled: false,
8 | loading: false
9 | },
10 | carData: {
11 |
12 | }
13 | },
14 | onLoad:function(options){
15 | // 页面初始化 options为页面跳转所带来的参数
16 | var carlist = wx.getStorageSync('carlist');
17 | this.setData({
18 | carlist: carlist
19 | })
20 | },
21 | onReady:function(){
22 | // 页面渲染完成
23 | },
24 | onShow:function(){
25 | // 页面显示
26 | },
27 | onHide:function(){
28 | // 页面隐藏
29 | },
30 | onUnload:function(){
31 | // 页面关闭
32 |
33 | },
34 | onShareAppMessage: function () {
35 | return {
36 | title: '临沂plus',
37 | path: '/pages/addcar/addcar',
38 | success: function(res) {
39 | // 分享成功
40 | },
41 | fail: function(res) {
42 | // 分享失败
43 | }
44 | }
45 | },
46 | testcarnumber: function(e) {
47 | var val = e.detail.value
48 | if ( !app.testCarnumber(val) ) {
49 | wx.blackTip.call(this, "请输入正确的车牌号码");
50 | return;
51 | }
52 | },
53 | testcarcode: function(e) {
54 |
55 | var val = e.detail.value
56 | if ( !app.testCode(val) ) {
57 | wx.blackTip.call(this, "请输入正确的车架号");
58 | return;
59 | }
60 | },
61 | testcardrivenumber: function(e) {
62 | var val = e.detail.value
63 | if ( !app.testCode(val) ) {
64 | wx.blackTip.call(this, "请输入正确的发动机号");
65 | return;
66 | }
67 | },
68 |
69 |
70 | setCarnumber: function(e) {
71 | this.setData({
72 | 'carData.carnumber': e.detail.value.toUpperCase()
73 | });
74 | },
75 | setCarcode: function(e) {
76 | this.setData({
77 | 'carData.carcode': e.detail.value.toUpperCase()
78 | });
79 | },
80 | setCardrivenumber: function (e) {
81 | this.setData({
82 | 'carData.cardrivenumber': e.detail.value.toUpperCase()
83 | });
84 | },
85 |
86 | confirm: function() {
87 | var _this = this;
88 | var data = this.data.carData;
89 | var carnumber_flag = app.testCarnumber(data.carnumber);
90 | var carcode_flag = app.testCode(data.carcode);
91 | var cardrivenumber_flag = app.testCode(data.cardrivenumber);
92 |
93 | if (!carnumber_flag || !carnumber_flag || !carnumber_flag) {
94 | wx.blackTip.call(this, "请输入正确的车辆信息");
95 | return;
96 | }
97 | this.setData({
98 | 'btn.loading': true,
99 | 'btn.disabled': true
100 | });
101 |
102 | wx.request({
103 | url: 'https://comments.cx580.com/illegal/index?c=illegal&a=query',
104 | data: {
105 | appkey: app.globalData._appkey,
106 | carcode: data.carcode,
107 | carnumber: data.carnumber,
108 | cardrivenumber: data.cardrivenumber
109 | },
110 | header: {'content-type': 'application/json'},
111 | success: function(res) {
112 |
113 | if (res.data.status != 0 ) {
114 | switch (res.data.status) {
115 | case -1:
116 | wx.blackTip.call(_this, " 缺少必要的参数或找不到车牌前缀所匹配的城市");
117 | break;
118 | case -3:
119 | wx.blackTip.call(_this, "本系统暂不提供该城市违章查询请求 ");
120 | break;
121 | case -5:
122 | wx.blackTip.call(_this, "添加失败,服务器错误(超时,数据获取异常等)");
123 | break;
124 | case -10:
125 | wx.blackTip.call(_this, "添加失败,未被授权访问该服务或用户名密码不正确");
126 | break;
127 | case -20:
128 | wx.blackTip.call(_this, "未知错误请联系管理员");
129 | break;
130 | case -40:
131 | wx.blackTip.call(_this, "添加失败,未被授权查询此车牌信息");
132 | break;
133 | case -42:
134 | wx.blackTip.call(_this, "添加失败,数据源暂不可用");
135 | break;
136 | case -43:
137 | wx.blackTip.call(_this, "添加失败,当日查询数已达到授权数标准,无法继续查询");
138 | break;
139 | case -44:
140 | wx.blackTip.call(_this, "添加失败, 已达到查询上限");
141 | break;
142 | case -61:
143 | wx.blackTip.call(_this, "添加失败,输入车牌号有误");
144 | break;
145 | case -62:
146 | wx.blackTip.call(_this, "添加失败,输入车辆识别代码有误");
147 | break;
148 | case -63:
149 | wx.blackTip.call(_this, "添加失败,输入发动机号有误");
150 | break;
151 | case -66:
152 | wx.blackTip.call(_this, "添加失败,不支持的车辆类型");
153 | break;
154 | case -67:
155 | wx.blackTip.call(_this, "添加失败,该省(城市)份不支持异地车牌");
156 | break;
157 | default:
158 | wx.blackTip.call(_this, "添加失败,请检查您填写的信息是否正确");
159 | break;
160 | }
161 |
162 | this.setData({
163 | 'btn.loading': false,
164 | 'btn.disabled': false
165 | });
166 | return;
167 | }
168 | console.log("请求成功", res);
169 | var formatData = _this.data.carData;
170 | formatData.result = res.data.result;
171 |
172 | wx.setStorageSync('allCarData', formatData);
173 |
174 | wx.showToast({
175 | title: '添加成功',
176 | icon: 'success',
177 | duration: 1500
178 | });
179 | setTimeout(function(){
180 | wx.navigateBack({
181 | delta: 1
182 | });
183 | }, 1500);
184 | },
185 | error: function (res) {
186 | console.error("请求失败", res);
187 | wx.blackTip.call(_this, "添加失败,请检查网络");
188 | _this.setData({
189 | 'btn.loading': false,
190 | 'btn.disabled': false
191 | });
192 | }
193 | })
194 | }
195 | })
--------------------------------------------------------------------------------
/pages/addcar/addcar.json:
--------------------------------------------------------------------------------
1 | { "navigationBarTitleText": "添加车辆"}
--------------------------------------------------------------------------------
/pages/addcar/addcar.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 车牌号:
10 | 车架号:
11 | 发动机号:
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/pages/addcar/addcar.wxss:
--------------------------------------------------------------------------------
1 | /* pages/addcar/addcar.wxss */
2 | .container{
3 | padding: 32rpx;
4 | font-size: 36rpx;
5 | }
6 | .addcar-wrap{
7 | display: flex;
8 | display: -webkit-flex;
9 | margin-top: 50rpx;
10 | }
11 | .left{
12 | flex: 1;
13 | -webkit-flex: 1;
14 | -webkit-box-flex: 1;
15 | }
16 | .left text{
17 | display: block;
18 | height: 80rpx;
19 | line-height: 80rpx;
20 | text-align: right;
21 | }
22 | .right{
23 | flex: 2;
24 | -webkit-flex: 2;
25 | -webkit-box-flex: 2;
26 | margin-left: 30rpx;
27 | }
28 | .right input{
29 | display: block;
30 | height: 80rpx;
31 | line-height: 80rpx;
32 | }
33 | button{
34 | margin-top: 80rpx;
35 | }
36 | .title{
37 | font-size: 40rpx;
38 | text-align: center;
39 | padding: 32rpx 0;
40 | }
--------------------------------------------------------------------------------
/pages/carQuery/carQuery.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | var app = getApp()
4 | Page({
5 | data: {
6 | motto: 'Hello World',
7 | cjhDisplay:"none",
8 | fdjDisplay:"none",
9 | cjhInputTip:"请输入车架号",
10 | fdjInputTip:"请输入发动机号",
11 | hphm:"",//号牌号码
12 | cjh:"",//车架号
13 | cdjh:"",//发动机号
14 | lstype:"02",//车辆类型
15 | lstypeName:"小车",//车辆类型名
16 | errorTip:"",
17 | typeArray:["",],
18 | windowHeigh:0,
19 | queryCSUrl:"https://api.chinadatapay.com/government/traffic/167/1",//获取支持的城市的信息
20 | queryWZUrl:"https://api.chinadatapay.com/government/traffic/167/3",//获取违章记录url
21 | queryCPUrl:"https://api.chinadatapay.com/government/traffic/167/2",//获取车号牌信息
22 | myProvince:"",//ZH SC这种
23 | myProvinceZWJX:"",//省的中文简写
24 | myProvinceALL:"",//省的全称
25 | myCityPYJX:"",// 川A 的A
26 | myCityPY:"",//chengdu这种
27 | engine:"",//是否需要发动机号0:不需要 1:需要
28 | engineno:"",//需要几位发动机号0:全部 1-9 :需要发动机号后N位
29 | classa:"",//是否需要车架号0,不需要 1,需要
30 | classno:"",//需要几位车架号0:全部 1-9: 需要车架号后N位
31 | provinceAbbr:"",//省的缩写 比如京、川等
32 | cityAbbr:"",//市的缩写,比如A、B、C,
33 | supportCodes:[//支持的车号牌信息
34 | {"code": "02", "name": "小车"},
35 | {"code": "01","name": "大车"},
36 | {"name":"挂车","code":"15"},
37 | {"name":"教练车","code":"16"},
38 | {"name":"警车","code":"23"},
39 | {"name":"小型新能源车","code":"52"},
40 | {"name":"大型新能源车","code":"51"}
41 | ]
42 | },
43 | onLoad: function () {
44 | var that = this
45 | //调用应用实例的方法获取全局数据
46 | app.getUserInfo(function(userInfo){
47 | //更新数据
48 | that.setData({
49 | userInfo:userInfo
50 | })
51 | that.getIsSupportCity();
52 | // that.getChePai();//获取支持的车牌信息
53 | })
54 | wx.getSystemInfo({
55 | success: function(res) {
56 | that.setData({
57 | windowHeigh:res.windowHeight
58 | })
59 | }
60 | })
61 | //从缓存里面获取数据
62 | wx.getStorage({
63 | key: 'cphm',
64 | success: function(res) {
65 | that.setData({
66 | cphm:res.data
67 | })
68 | }
69 | })
70 | wx.getStorage({
71 | key: 'cjh',
72 | success: function(res) {
73 | that.setData({
74 | cjh:res.data
75 | })
76 | }
77 | })
78 | wx.getStorage({
79 | key: 'fdjh',
80 | success: function(res) {
81 | that.setData({
82 | fdjh:res.data
83 | })
84 | }
85 | })
86 | },
87 | getChePai:function(){
88 | var that = this;
89 | wx.request({
90 | url: this.data.queryCPUrl,
91 | data: {
92 | key: app.globalData.appKey
93 | },
94 | header: {
95 | 'content-type': 'application/json'
96 | },
97 | success: function(res) {console.log(res.data);
98 | if(res.data.code == "10000"){
99 | that.setData({
100 | supportCodes:res.data.data
101 | })
102 | }
103 | }
104 | })
105 | },
106 | getIsSupportCity:function(){
107 | var that = this;
108 | wx.request({
109 | url: this.data.queryCSUrl,
110 | data: {
111 | onlysupport: 1,
112 | key: app.globalData.appKey
113 | },
114 | header: {
115 | 'content-type': 'application/json'
116 | },
117 | success: function(res) {console.log(res.data);
118 | var myCityZhongWen = null;
119 | var myCityPYJX = null;
120 | var myCityPY = null;
121 | var myProvinceZWJX = null;
122 | var engineno = null;
123 | var classno = null;
124 | if(res.data.code == "10000"){
125 | for(var i=0;i
2 | 临沂plus
3 |
4 | 车牌号码:
5 | {{myProvinceZWJX}} {{myCityPYJX}}
6 |
7 |
8 |
9 | 车辆类型:
10 |
11 |
12 | {{lstypeName}}{{supportCodes[index]}}
13 |
14 |
15 |
16 |
17 | 车架号码:
18 |
19 |
20 |
21 | 发动机号:
22 |
23 |
24 |
25 | {{errorTip}}
26 |
27 |
28 | 技术支持QQ291883110
29 |
--------------------------------------------------------------------------------
/pages/carQuery/carQuery.wxss:
--------------------------------------------------------------------------------
1 | view{
2 | font-family:微软雅黑,-apple-system-font,Helvetica Neue,Helvetica,sans-serif;
3 | }
4 | .queryTip{
5 | width: 98%;
6 | font-size: 70rpx;
7 | height: 200rpx;
8 | line-height: 150rpx;
9 | color: #1AAD19;
10 | text-align: center;
11 | background-color: white;
12 | border-bottom: 1px solid #ccc;
13 | margin-left: 1%;
14 | }
15 | .queryView{
16 | width:690rpx;
17 | border-bottom: 1px solid #EFEFEF;
18 | background-color: white;
19 | height: 200rpx;
20 | line-height: 200rpx;
21 | margin-left: 30rpx;
22 | }
23 | .queryView .left{
24 | float:left;
25 | height:200rpx;
26 | line-height:200rpx;
27 | font-size: 40rpx;
28 | padding-left:30rpx;
29 | padding-right:30rpx;
30 | width: 25%;
31 | }
32 | .queryView .center{
33 | float:left;
34 | height:200rpx;
35 | line-height:200rpx;
36 | color: #48C23D;
37 | font-size: 40rpx;
38 | margin-left: 6rpx;
39 | }
40 | .queryView input{
41 | width:300rpx;
42 | float:left;
43 | height:200rpx;
44 | line-height:200rpx;
45 | font-size: 40rpx;
46 | padding-left: 10rpx;
47 | margin-top: 3rpx;
48 | }
49 | .errorTip{
50 | color:red;
51 | font-size: 30rpx;
52 | width: 100%;
53 | height: 70rpx;
54 | text-align: center;
55 |
56 | }
57 | .queryButton{
58 | height: 90rpx;
59 | margin-left: 30rpx;
60 | margin-right: 30rpx;
61 | line-height: 90rpx;
62 | font-size: 35rpx;
63 | margin-top: 50rpx;
64 | }
65 | .supportTip{
66 | position: absolute;
67 | bottom: 0rpx;
68 | width: 100%;
69 | text-align: center;
70 | font-size: 25rpx;
71 | }
--------------------------------------------------------------------------------
/pages/cardetail/cardetail.js:
--------------------------------------------------------------------------------
1 | // pages/cardetail/cardetail.js
2 | var app = getApp();
3 | Page({
4 | data:{},
5 | onLoad:function(options) {
6 | // 页面初始化 options为页面跳转所带来的参数
7 | },
8 | onReady:function() {
9 | // 页面渲染完成
10 | },
11 | onShow:function() {
12 | // 页面显示
13 | var carData = wx.getStorageSync('allCarData');
14 | this.setData({
15 | carData: carData
16 | });
17 | this.setData({
18 | '_carData.carcode': carData.carcode,
19 | '_carData.carnumber': carData.carnumber,
20 | '_carData.cardrivenumber': carData.cardrivenumber
21 | });
22 | },
23 | onShareAppMessage: function () {
24 | return {
25 | title: '临沂plus',
26 | path: '/pages/addcar/addcar',
27 | success: function(res) {
28 | // 分享成功
29 | },
30 | fail: function(res) {
31 | // 分享失败
32 | }
33 | }
34 | },
35 | onPullDownRefresh: function() {
36 | var _this = this;
37 | wx.request({
38 | url: 'https://comments.cx580.com/illegal/index?c=illegal&a=query',
39 | data: {
40 | appkey: app.globalData._appkey,
41 | carcode: _this.data.carData.carcode,
42 | carnumber: _this.data.carData.carnumber,
43 | cardrivenumber: _this.data.carData.cardrivenumber
44 | },
45 | header: {'content-type': 'application/json'},
46 | success: function(res) {
47 |
48 | if (res.data.status != 0 ) {
49 | switch (res.data.status) {
50 | case -1:
51 | wx.blackTip.call(_this, " 缺少必要的参数或找不到车牌前缀所匹配的城市");
52 | break;
53 | case -3:
54 | wx.blackTip.call(_this, "本系统暂不提供该城市违章查询请求 ");
55 | break;
56 | case -5:
57 | wx.blackTip.call(_this, "刷新失败,服务器错误(超时,数据获取异常等)");
58 | break;
59 | case -10:
60 | wx.blackTip.call(_this, "刷新失败,未被授权访问该服务或用户名密码不正确");
61 | break;
62 | case -20:
63 | wx.blackTip.call(_this, "未知错误请联系管理员");
64 | break;
65 | case -40:
66 | wx.blackTip.call(_this, "刷新失败,未被授权查询此车牌信息");
67 | break;
68 | case -42:
69 | wx.blackTip.call(_this, "刷新失败,数据源暂不可用");
70 | break;
71 | case -43:
72 | wx.blackTip.call(_this, "刷新失败,当日查询数已达到授权数标准,无法继续查询");
73 | break;
74 | case -44:
75 | wx.blackTip.call(_this, "刷新失败, 已达到查询上限");
76 | break;
77 | case -61:
78 | wx.blackTip.call(_this, "刷新失败,输入车牌号有误");
79 | break;
80 | case -62:
81 | wx.blackTip.call(_this, "刷新失败,输入车辆识别代码有误");
82 | break;
83 | case -63:
84 | wx.blackTip.call(_this, "刷新失败,输入发动机号有误");
85 | break;
86 | case -66:
87 | wx.blackTip.call(_this, "刷新失败,不支持的车辆类型");
88 | break;
89 | case -67:
90 | wx.blackTip.call(_this, "刷新失败,该省(城市)份不支持异地车牌");
91 | break;
92 | default:
93 | wx.blackTip.call(_this, "刷新失败,请检查您填写的信息是否正确");
94 | break;
95 | }
96 | return;
97 | }
98 |
99 | var formatData = _this.data._carData;
100 | formatData.result = res.data.result;
101 |
102 | wx.setStorageSync('allCarData', formatData);
103 | _this.setData({
104 | carData: formatData
105 | });
106 | wx.showToast({
107 | title: '已刷新车辆信息',
108 | icon: 'success',
109 | duration: 1000
110 | });
111 | },
112 | error: function (res) {
113 | console.error("请求失败", res);
114 | wx.blackTip.call(_this, "刷新失败,请检查网络");
115 | }
116 | });
117 | },
118 | onHide:function(){
119 | // 页面隐藏
120 | },
121 | onUnload:function(){
122 | // 页面关闭
123 | },
124 | makecall: function() {
125 | wx.makePhoneCall({
126 | phoneNumber: '15653986199',
127 | success: function(res) {
128 | // success
129 | }
130 | });
131 | },
132 | changeCar: function() {
133 | wx.navigateTo({
134 | url: '../addcar/addcar',
135 | success: function(res){
136 | // success
137 | },
138 | fail: function(res) {
139 | // fail
140 | },
141 | complete: function(res) {
142 | // complete
143 | }
144 | })
145 | },
146 | deleteCar: function() {
147 | wx.showActionSheet({
148 | itemList: ['删除此条车辆信息并更换'],
149 | itemColor: '#f53535',
150 | success: function(res){
151 | if( res.tapIndex == 0 ) {
152 | wx.setStorageSync('allCarData', '');
153 | wx.showToast({
154 | title: '删除成功!',
155 | icon: 'success'
156 | });
157 | setTimeout(function(){
158 | wx.navigateBack({
159 | delta: 1
160 | });
161 | }, 1500);
162 | }
163 | }
164 | });
165 |
166 | }
167 | })
--------------------------------------------------------------------------------
/pages/cardetail/cardetail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "车辆小历史",
3 | "enablePullDownRefresh": true
4 | }
--------------------------------------------------------------------------------
/pages/cardetail/cardetail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 | 我们都是有故事的人
12 |
13 | 但是
14 | {{carData.carnumber}}
15 | 你木有
16 |
17 |
18 |
19 | {{carData.carnumber}}
20 |
21 | 你有
22 |
23 | {{carData.result.length ? carData.result.length : "0"}} 段小历史
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {{index + 1}}、
34 | 时间:{{item.Time}}
35 | 地点:{{item.Location}}
36 | 原因:{{item.Reason}}
37 | 罚款:{{item.count}}元
38 | 扣分:{{item.Degree}}分
39 | 状态:{{item.status == 0 ? "未处理" : "已处理" }}
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/pages/cardetail/cardetail.wxss:
--------------------------------------------------------------------------------
1 | /* pages/cardetail/cardetail.wxss */
2 | .container{
3 | padding: 32rpx;
4 | }
5 |
6 | .car-wrap{
7 | }
8 | /*.left{
9 | flex: 1;
10 | -webkit-flex: 1;
11 | -webkit-box-flex: 1;
12 | }*/
13 | .left text{
14 | display: block;
15 | line-height: 70rpx;
16 | text-align: right;
17 | }
18 | .right{
19 | text-align: center;
20 | font-size: 38rpx;
21 | }
22 | .right .common{
23 | display: block;
24 | font-weight: 700;
25 | line-height: 70rpx;
26 | margin-bottom: 40rpx;
27 | }
28 |
29 | .car-record{
30 | padding: 0 32rpx 32rpx 32rpx;
31 | }
32 | .title{
33 | text-align: center;
34 | font-size: 30rpx;
35 | color: #666;
36 | padding: 32rpx;
37 | }
38 | .list{
39 | margin-top: 32rpx;
40 | }
41 | .list view {
42 | /*height: 50rpx;*/
43 | line-height: 50rpx;
44 | }
45 | button{
46 | margin-top: 32rpx;
47 | }
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | var app = getApp()
4 | Page({
5 | data: {
6 | motto: '',
7 | userInfo: {}
8 | },
9 | //事件处理函数
10 | goAddcar: function() {
11 | wx.navigateTo({
12 | url: '../addcar/addcar'
13 | })
14 | },
15 | onShow: function() {
16 | var carData = wx.getStorageSync('allCarData');
17 | this.setData({
18 | carData: carData
19 | });
20 | },
21 | goCardetail: function(e) {
22 | wx.navigateTo({
23 | url: '../cardetail/cardetail'
24 | })
25 | },
26 | phone: function(e) {
27 | var tel = e.target.dataset.tel;
28 | wx.makePhoneCall({
29 | phoneNumber: tel,
30 | success: function(res) {
31 | // success
32 | }
33 | })
34 | },
35 | mapNav: function() {
36 | wx.navigateTo({
37 | url: '../mapNav/mapNav'
38 | });
39 | },
40 | onLoad: function () {
41 | console.log('onLoad')
42 | var that = this
43 | //调用应用实例的方法获取全局数据
44 | app.getUserInfo(function(userInfo){
45 | //更新数据
46 | that.setData({
47 | userInfo:userInfo
48 | })
49 | })
50 | },
51 | onShareAppMessage: function () {
52 | return {
53 | title: '临沂plus',
54 | path: '/pages/index/index',
55 | success: function(res) {
56 | // 分享成功
57 | },
58 | fail: function(res) {
59 | // 分享失败
60 | }
61 | }
62 | }
63 | })
64 |
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {"navigationBarTitleText": "临沂"}
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 生活服务:
5 |
6 |
7 |
8 |
9 |
10 | 买车
11 |
12 |
13 |
14 | 查油价
15 |
16 |
17 |
18 | 买车险
19 |
20 |
21 |
22 |
23 |
24 |
25 | 学车
26 |
27 |
28 |
29 | 导航
30 |
31 |
32 |
33 | 道路救援
34 |
35 |
36 |
37 |
38 |
39 |
40 | 订奶
41 |
42 |
43 |
44 | 订机票
45 |
46 |
47 |
48 | 微信推广
49 |
50 |
51 |
52 |
53 | 我的车辆:
54 |
55 |
56 |
57 |
58 | {{carData.carnumber}}
59 |
60 |
61 |
62 |
63 |
64 | 添加车辆
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | page{
3 | background: #f9f9f9;
4 | }
5 | .container{
6 | padding: 32rpx;
7 | }
8 | .service-title{
9 | padding: 32rpx 0 30rpx 48rpx;
10 | font-size: 38rpx;
11 | }
12 | .service-title2{
13 | padding: 32rpx 0 30rpx 48rpx;
14 | font-size: 38rpx;
15 | }
16 | .services{
17 | display: flex;
18 | display: -webkit-flex;
19 | box-sizing: border-box;
20 | }
21 | .services view{
22 | box-sizing: border-box;
23 | /*border: 1rpx solid #ccc;*/
24 | flex: 1;
25 | -webkit-flex: 1;
26 |
27 | /*background: #f1f1f1;*/
28 | text-align: center;
29 | padding: 32rpx 0;
30 |
31 | }
32 | .services view image{
33 | width: 120rpx;
34 | height: 120rpx;
35 | }
36 | .services view text{
37 | display: block;
38 | }
39 |
40 |
41 | .car-list{
42 | background: #fff100;
43 | padding: 32rpx;
44 | font-size: 40rpx;
45 | line-height: 40rpx;
46 | font-family: "Microsoft YaHei";
47 | position: relative;
48 | text-align: center;
49 | border-radius: 10rpx;
50 | box-shadow: 0 0 20rpx rgba(255, 241, 0, .5);
51 | margin: 32rpx 52rpx;
52 | }
53 | .car-list .icon{
54 | width: 50rpx;
55 | height: 50rpx;
56 | position: absolute;
57 | right: 32rpx;
58 | top: 27rpx;
59 | }
60 |
61 | .button-add {
62 | margin: 50rpx 52rpx;
63 | text-align: center;
64 | position: relative;
65 | border: 1rpx solid #eee;
66 | padding: 16rpx;
67 | border-radius: 10rpx;
68 | background: #fff;
69 | box-shadow: 0 0 10rpx rgba(255, 241, 0, .8);
70 | }
71 | .button-add image{
72 | vertical-align: top;
73 | height: 80rpx;
74 | width: 80rpx;
75 | }
76 | .button-add text{
77 | line-height: 80rpx;
78 | vertical-align: top;
79 | font-size: 40rpx;
80 | margin-left: 20rpx;
81 | }
--------------------------------------------------------------------------------
/pages/logs/logs.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | var util = require('../../utils/util.js')
3 | Page({
4 | data: {
5 | logs: []
6 | },
7 | onLoad: function () {
8 | this.setData({
9 | logs: (wx.getStorageSync('logs') || []).map(function (log) {
10 | return util.formatTime(new Date(log))
11 | })
12 | })
13 | }
14 | })
15 |
--------------------------------------------------------------------------------
/pages/logs/logs.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "查看启动日志"
3 | }
--------------------------------------------------------------------------------
/pages/logs/logs.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{index + 1}}. {{log}}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/pages/logs/logs.wxss:
--------------------------------------------------------------------------------
1 | .log-list {
2 | display: flex;
3 | flex-direction: column;
4 | padding: 40rpx;
5 | }
6 | .log-item {
7 | margin: 10rpx;
8 | }
9 |
--------------------------------------------------------------------------------
/pages/mapNav/mapNav.js:
--------------------------------------------------------------------------------
1 | // pages/mapNav/mapNav.js
2 | var QQMapWX = require('../../utils/qqmap-wx-jssdk.min.js');
3 | // console.log(QQmapWX);
4 | var qqmapsdk;
5 | var app = getApp();
6 | var canbesearch = true;
7 | Page({
8 | data: {
9 | pos: [],
10 | hideList: true,
11 | choosePosData: {
12 | lng: '',
13 | lat: ''
14 | }
15 | },
16 | onLoad: function (options) {
17 | var _this = this;
18 | // 页面初始化 options为页面跳转所带来的参数
19 | qqmapsdk = new QQMapWX({
20 | key: app.globalData.mapkey
21 | });
22 | wx.getLocation({
23 | success: function(res) {
24 | console.log(res);
25 | _this.setData({
26 | longitude: res.longitude,
27 | latitude: res.latitude
28 | });
29 | },
30 | })
31 | },
32 | onReady: function () {
33 | // 页面渲染完成
34 |
35 |
36 | },
37 | onShow: function () {
38 | // 页面显示
39 |
40 | },
41 | onHide: function () {
42 | // 页面隐藏
43 | },
44 | onUnload: function () {
45 | // 页面关闭
46 | },
47 | search: function (e) {
48 | var value = e.detail.value;
49 | if (canbesearch === true) {
50 | canbesearch = false;
51 | this.searchTheMap(value);
52 | setTimeout(function () {
53 | canbesearch = true;
54 | }, 210);
55 | }
56 | },
57 | searchTheMap: function (value) {
58 | var _this = this;
59 | qqmapsdk.search({
60 | keyword: value,
61 | success: function (res) {
62 | console.log(res);
63 | _this.setData({
64 | pos: res.data
65 | });
66 | },
67 | fail: function (res) {
68 | console.log(res);
69 | },
70 | complete: function (res) {
71 | console.log(res);
72 | }
73 | })
74 | },
75 | inputFocus: function() {
76 | this.setData({
77 | hideList: false
78 | })
79 | },
80 | choosePosition: function(e) {
81 | console.log(e);
82 | this.setData({
83 | hideList: true,
84 | 'choosePosData.lng': e.currentTarget.dataset.lng,
85 | 'choosePosData.lat': e.currentTarget.dataset.lat
86 | })
87 | }
88 | })
--------------------------------------------------------------------------------
/pages/mapNav/mapNav.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/mapNav/mapNav.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.title}}
9 | {{item.address}}
10 |
11 |
12 |
--------------------------------------------------------------------------------
/pages/mapNav/mapNav.wxss:
--------------------------------------------------------------------------------
1 | /* pages/mapNav/mapNav.wxss */
2 | #map {
3 | width: 100%;
4 | height: 100vh;
5 | position: fixed;
6 | top: 0;
7 | left: 0;
8 | bottom: 0;
9 | right: 0;
10 | z-index: 1;
11 | }
12 | .search-wrapper {
13 | position: absolute;
14 | z-index: 3;
15 | top: 40rpx;
16 | padding: 16rpx;
17 | width: 80%;
18 | left: 50%;
19 | transform: translateX(-50%);
20 | -webkit-transform: translateX(-50%);
21 | background: #fff;
22 | box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.5);
23 | }
24 | .search-wrapper input {
25 | display: block;
26 | height: 40rpx;
27 | line-height: 40rpx;
28 | font-size: 32rpx;
29 | padding-left: 16rpx;
30 | }
31 | .address-list-wrapper {
32 | position: absolute;
33 | top: 80rpx;
34 | width: 100%;
35 | height: 500rpx;
36 | margin-left: -16rpx;
37 | overflow-y: scroll;
38 | overflow-x: hidden;
39 | }
40 | .address-list {
41 | width: 100%;
42 | overflow: hidden;
43 | text-overflow: ellipsis;
44 | white-space: nowrap;
45 | background: #fff;
46 | padding: 12rpx;
47 | border-bottom: 1rpx solid #f7f7f7;
48 | }
49 | .address-list .title {
50 | height: 50rpx;
51 | font-size: 32rpx;
52 | line-height: 50rpx;
53 | padding: 12rpx 0 0 12rpx;
54 | }
55 | .address-list .address {
56 | height: 40rpx;
57 | padding: 8rpx 0 0 12rpx;
58 | line-height: 40rpx;
59 | font-size: 28rpx;
60 | color: #999;
61 | }
--------------------------------------------------------------------------------
/pages/queryResult/queryResult.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | var app = getApp()
4 | Page({
5 | data: {
6 | windowHeigh:0,
7 | hphm:"",//号牌号码
8 | score:"",//违章扣分总数
9 | listCount:0,//未处理违章的总条数
10 | moneyCount:0,//总罚款
11 | queryWZUrl:"https://api.chinadatapay.com/government/traffic/167/3",//获取违章记录url
12 | resultData:[
13 | {
14 | "time": "2016-07-08 07:16:32",
15 | "address": "[西湖区]长江路_长江路竞舟北路口(长江路)11111111",
16 | "content": "不按规定停放影响其他车辆和行人通行的1111111111111",
17 | "legalnum": "7003",
18 | "price": "150",
19 | "score": "0",
20 | "number": "",
21 | "illegalid": "4821518"
22 | }
23 | ]//数据
24 | },
25 | onLoad: function () {
26 | console.log(app.globalData.resultData.lists)
27 | var that = this
28 | //调用应用实例的方法获取全局数据
29 | app.getUserInfo(function(userInfo){
30 | //更新数据
31 | that.setData({
32 | userInfo:userInfo
33 | })
34 | })
35 | wx.getSystemInfo({
36 | success: function(res) {
37 | that.setData({
38 | windowHeigh:res.windowHeight
39 | })
40 | }
41 | })
42 | if(app.globalData.resultData == null){
43 | that.queryData();
44 | }else{
45 | that.setResultData(app.globalData.resultData);
46 | }
47 | },
48 | queryData:function(){
49 | var that = this;
50 | var cphm = app.globalData.cphm;
51 | var cjh = app.globalData.cjh;
52 | var fdjh = app.globalData.fdjh;
53 | var lstype = app.globalData.lstype;
54 | var lsprefix = app.globalData.lsprefix;
55 | var carorg = app.globalData.carorg;
56 | wx.request({
57 | url: this.data.queryWZUrl,
58 | data: {
59 | key: app.globalData.appKey,
60 | lsprefix:lsprefix,
61 | lsnum:cphm,
62 | lstype:lstype,
63 | frameno:cjh,
64 | engineno:fdjh,
65 | carorg:carorg
66 | },
67 | header: {
68 | 'content-type': 'application/json'
69 | },
70 | success: function(res) {
71 | console.log(res.data);
72 | if(res.data.code == "10000"){
73 | that.setResultData(res.data.data.list);
74 | }else{
75 | that.setData({
76 | errorTip:res.data.message
77 | })
78 | }
79 | }
80 | })
81 | },
82 | setResultData:function(resultData){
83 | var that = this;
84 | console.log("resultData="+resultData);
85 | var hphm = null;
86 | var score = 0;
87 | var listCount = resultData.length;
88 | var moneyCount = 0;
89 | hphm = app.globalData.hphm;
90 | var myDate = new Date();
91 | for(var i=0;i
2 |
3 |
4 | {{hphm}}
5 |
6 |
7 | 未处理
8 | 共扣分
9 | 共罚款
10 |
11 |
12 | {{listCount}}
13 | {{score}}
14 | {{moneyCount}}
15 |
16 |
17 |
18 |
19 |
20 |
21 | {{item.time}}
22 | 扣分
23 | 罚款
24 |
25 |
26 | {{item.handled}}
27 | {{item.score}}分
28 | {{item.price}}元
29 |
30 |
31 | {{item.address}}
32 | {{item.content}}
33 |
34 |
35 |
36 |
37 |
38 |
39 | 违章代办
40 |
41 |
42 |
--------------------------------------------------------------------------------
/pages/queryResult/queryResult.wxss:
--------------------------------------------------------------------------------
1 | view{
2 | font-family:微软雅黑,-apple-system-font,Helvetica Neue,Helvetica,sans-serif;
3 | }
4 | .class1{
5 | background-color:#0ACB7C;
6 | height: 280rpx;
7 | width: 100%;
8 | }
9 | .class1_1{
10 | padding-left:50rpx;
11 | color: white;
12 | font-size:60rpx;
13 | height: 150rpx;
14 | line-height: 150rpx;
15 | width: 650rpx;
16 | }
17 | .class1_1 .left{
18 | float: left;
19 | }
20 | .class1_1 .right{
21 | float: right;
22 | }
23 | .class1_2{
24 | margin-top: 20rpx;
25 | color: white;
26 | height: 50rpx;
27 | line-height: 50rpx;
28 | width: 100%;
29 | font-size: 26rpx;
30 | }
31 | .class1_2 .left{
32 | float: left;
33 | margin-left: 30rpx;
34 | height: 100%;
35 | text-align: center;
36 | width: 150rpx;
37 | }
38 | .class1_2 .center{
39 | float: left;
40 | margin-left: 100rpx;
41 | height: 100%;
42 | width: 200rpx;
43 | text-align: center;
44 | }
45 | .class1_2 .right{
46 | float: right;
47 | margin-right: 30rpx;
48 | height: 100%;
49 | width: 150rpx;
50 | text-align: center;
51 | }
52 | .class1_3{
53 | color: white;
54 | height: 40rpx;
55 | line-height: 40rpx;
56 | width: 100%;
57 | font-size: 26rpx;
58 | }
59 | .class1_3 .left{
60 | float: left;
61 | margin-left: 30rpx;
62 | height: 100%;
63 | text-align: center;
64 | width: 150rpx;
65 | font-size: 35rpx;
66 | }
67 | .class1_3 .center{
68 | float: left;
69 | margin-left: 100rpx;
70 | height: 100%;
71 | width: 200rpx;
72 | text-align: center;
73 | font-size: 35rpx;
74 | }
75 | .class1_3 .right{
76 | float: right;
77 | margin-right: 30rpx;
78 | height: 100%;
79 | width: 150rpx;
80 | text-align: center;
81 | font-size: 35rpx;
82 | }
83 | .class2{
84 | background-color:#03AB01;
85 | color: white;
86 | height: 60rpx;
87 | line-height: 60rpx;
88 | font-size: 28rpx;
89 | padding-left: 30rpx;
90 | }
91 | .class3{
92 | width: 100%;
93 | }
94 | .contentArea{
95 | width: 100%;
96 | height: auto;
97 | background-color: white;
98 | margin-top:30rpx;
99 | }
100 | .class3_1{
101 | width: 720rpx;
102 | padding-top: 30rpx;
103 | margin-left: 30rpx;
104 | height: 30rpx;
105 | line-height: 30rpx;
106 | font-size: 26rpx;
107 | color: #ccc;
108 | }
109 | .class3_1 .left{
110 | float: left;
111 | width: 50%;
112 | height: 100%;
113 | text-align: left;
114 | }
115 | .class3_1 .center{
116 | float: left;
117 | height: 100%;
118 | width: 20%;
119 | text-align: center;
120 | }
121 | .class3_1 .right{
122 | float: right;
123 | height: 100%;
124 | width: 20%;
125 | text-align: center;
126 | }
127 | .class3_2{
128 | width: 720rpx;
129 | margin-top: 30rpx;
130 | margin-left: 30rpx;
131 | height: 30rpx;
132 | line-height: 30rpx;
133 | font-size: 35rpx;
134 | color: #FF6702;
135 | }
136 | .class3_2 .left{
137 | float: left;
138 | width: 50%;
139 | height: 100%;
140 | text-align: left;
141 | }
142 | .class3_2 .center{
143 | float: left;
144 | height: 100%;
145 | width: 20%;
146 | text-align: center;
147 | }
148 | .class3_2 .right{
149 | float: right;
150 | height: 100%;
151 | width: 20%;
152 | text-align: center;
153 | }
154 | .class3_3{
155 | width: 690rpx;
156 | margin-left: 30rpx;
157 | margin-right: 30rpx;
158 | border-top: 1rpx solid #ccc;
159 | height: auto;
160 | margin-top: 20rpx;
161 | overflow: auto;
162 | }
163 | .class3_3_1{
164 | font-size: 42rpx;
165 | line-height: 60rpx;
166 | padding-top: 10rpx;
167 | }
168 | .class3_3_2{
169 | color: #ccc;
170 | font-size: 32rpx;
171 | width: 100%;
172 | height: auto;
173 | line-height: 50rpx;
174 | padding-top: 20rpx;
175 | }
176 | .class3_4{
177 | width: 100%;
178 | height: 10rpx;
179 | }
180 | .contactButton{
181 | font-size: 40rpx;
182 | }
183 | .class4{
184 | width: 100%;
185 | height: 100rpx;
186 | background-color: white;
187 | text-align: center;
188 | margin-top: 30rpx;
189 | padding-top: 40rpx;
190 | color: red;
191 | font-weight: bold;
192 | }
--------------------------------------------------------------------------------
/utils/qqmap-wx-jssdk.min.js:
--------------------------------------------------------------------------------
1 | var _createClass=function(){function a(e,c){for(var b=0;b