├── README.md ├── app.js ├── app.json ├── app.wxss ├── images ├── map │ ├── go.png │ └── map.png ├── nav │ └── left.png ├── tabbar │ ├── h.png │ ├── h1.png │ ├── t.png │ ├── t1.png │ ├── w.png │ ├── w1.png │ ├── y.png │ ├── y1.png │ ├── z.png │ └── z1.png └── type │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 产品介绍3_0002_discover--4.png │ ├── 产品介绍3_0003_me-2.png │ └── 产品介绍3_0005_利息.png ├── pages ├── car │ ├── appoint │ │ ├── appoint.js │ │ ├── appoint.json │ │ ├── appoint.wxml │ │ ├── appoint.wxss │ │ └── appointItem │ │ │ ├── appointItem.js │ │ │ ├── appointItem.json │ │ │ ├── appointItem.wxml │ │ │ └── appointItem.wxss │ ├── article │ │ ├── article.js │ │ ├── article.json │ │ ├── article.wxml │ │ ├── article.wxss │ │ └── articleD │ │ │ ├── articleD.js │ │ │ ├── articleD.json │ │ │ ├── articleD.wxml │ │ │ └── articleD.wxss │ ├── cartoon │ │ ├── cartoon.js │ │ ├── cartoon.json │ │ ├── cartoon.wxml │ │ ├── cartoon.wxss │ │ └── cartoonD │ │ │ ├── cartoonD.js │ │ │ ├── cartoonD.json │ │ │ ├── cartoonD.wxml │ │ │ └── cartoonD.wxss │ ├── galler │ │ ├── galler.js │ │ ├── galler.json │ │ ├── galler.wxml │ │ ├── galler.wxss │ │ ├── gallerD │ │ │ ├── gallerD.js │ │ │ ├── gallerD.json │ │ │ ├── gallerD.wxml │ │ │ └── gallerD.wxss │ │ └── gallerItem │ │ │ ├── gallerItem.js │ │ │ ├── gallerItem.json │ │ │ ├── gallerItem.wxml │ │ │ └── gallerItem.wxss │ ├── home │ │ ├── home.js │ │ ├── home.json │ │ ├── home.wxml │ │ ├── home.wxss │ │ └── video │ │ │ ├── video.js │ │ │ ├── video.json │ │ │ ├── video.wxml │ │ │ └── video.wxss │ ├── mine │ │ ├── mine.js │ │ ├── mine.json │ │ ├── mine.wxml │ │ └── mine.wxss │ └── news │ │ ├── news.js │ │ ├── news.json │ │ ├── news.wxml │ │ ├── news.wxss │ │ ├── newsD │ │ ├── newsD.js │ │ ├── newsD.json │ │ ├── newsD.wxml │ │ └── newsD.wxss │ │ └── newsItem │ │ ├── newsItem.js │ │ ├── newsItem.json │ │ ├── newsItem.wxml │ │ └── newsItem.wxss └── logs │ ├── logs.js │ ├── logs.json │ ├── logs.wxml │ └── logs.wxss ├── project.config.json ├── style └── swiper.wxss ├── tem └── swiper.wxml ├── utils ├── data.js ├── qqmap-wx-jssdk.min.js └── util.js └── wxParse ├── emojis ├── 00.gif ├── 01.gif ├── 02.gif ├── 03.gif ├── 04.gif ├── 05.gif ├── 06.gif ├── 07.gif ├── 08.gif ├── 09.gif ├── 10.gif ├── 100.gif ├── 101.gif ├── 102.gif ├── 103.gif ├── 104.gif ├── 105.gif ├── 106.gif ├── 107.gif ├── 108.gif ├── 109.gif ├── 11.gif ├── 110.gif ├── 111.gif ├── 112.gif ├── 113.gif ├── 114.gif ├── 115.gif ├── 116.gif ├── 117.gif ├── 118.gif ├── 119.gif ├── 12.gif ├── 120.gif ├── 121.gif ├── 122.gif ├── 123.gif ├── 124.gif ├── 125.gif ├── 126.gif ├── 127.gif ├── 128.gif ├── 129.gif ├── 13.gif ├── 130.gif ├── 131.gif ├── 132.gif ├── 133.gif ├── 134.gif ├── 14.gif ├── 15.gif ├── 16.gif ├── 17.gif ├── 18.gif ├── 19.gif ├── 20.gif ├── 21.gif ├── 22.gif ├── 23.gif ├── 24.gif ├── 25.gif ├── 26.gif ├── 27.gif ├── 28.gif ├── 29.gif ├── 30.gif ├── 31.gif ├── 32.gif ├── 33.gif ├── 34.gif ├── 35.gif ├── 36.gif ├── 37.gif ├── 38.gif ├── 39.gif ├── 40.gif ├── 41.gif ├── 42.gif ├── 43.gif ├── 44.gif ├── 45.gif ├── 46.gif ├── 47.gif ├── 48.gif ├── 49.gif ├── 50.gif ├── 51.gif ├── 52.gif ├── 53.gif ├── 54.gif ├── 55.gif ├── 56.gif ├── 57.gif ├── 58.gif ├── 59.gif ├── 60.gif ├── 61.gif ├── 62.gif ├── 63.gif ├── 64.gif ├── 65.gif ├── 66.gif ├── 67.gif ├── 68.gif ├── 69.gif ├── 70.gif ├── 71.gif ├── 72.gif ├── 73.gif ├── 74.gif ├── 75.gif ├── 76.gif ├── 77.gif ├── 78.gif ├── 79.gif ├── 80.gif ├── 81.gif ├── 82.gif ├── 83.gif ├── 84.gif ├── 85.gif ├── 86.gif ├── 87.gif ├── 88.gif ├── 89.gif ├── 90.gif ├── 91.gif ├── 92.gif ├── 93.gif ├── 94.gif ├── 95.gif ├── 96.gif ├── 97.gif ├── 98.gif └── 99.gif ├── html2json.js ├── htmlparser.js ├── showdown.js ├── wxDiscode.js ├── wxParse.js ├── wxParse.wxml └── wxParse.wxss /README.md: -------------------------------------------------------------------------------- 1 | 2 | # wxapp_simple_car 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | var con = require("utils/data.js"); 3 | App({ 4 | onLaunch: function() { 5 | //调用API从本地缓存中获取数据 6 | var logs = wx.getStorageSync('logs') || [] 7 | logs.unshift(Date.now()) 8 | wx.setStorageSync('logs', logs) 9 | }, 10 | 11 | getUserInfo: function(cb) { 12 | var that = this 13 | if (this.globalData.userInfo) { 14 | typeof cb == "function" && cb(this.globalData.userInfo) 15 | } else { 16 | //调用登录接口 17 | wx.login({ 18 | success:function(o){ 19 | wx.getUserInfo({ 20 | success:function(res){ 21 | console.log(res); 22 | wx.request({ 23 | url: con.index_slogin, 24 | data:{ 25 | code: o.code, 26 | nickname: res.userInfo, 27 | wxappid: con.wyy_user_wxappid, 28 | pic: res.userInfo.avatarUrl 29 | }, 30 | method: "POST", 31 | header:{ 32 | 'Content-Type': "application/x-www-form-urlencoded" 33 | }, 34 | success:function(res){ 35 | console.log(res.data.openid); 36 | wx.setStorage({ 37 | key: 'openid', 38 | data: res.data.openid, 39 | }) 40 | } 41 | }) 42 | } 43 | }) 44 | } 45 | }) 46 | } 47 | }, 48 | 49 | globalData: { 50 | userInfo: null 51 | } 52 | }) 53 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages":[ 3 | "pages/car/home/home", 4 | "pages/car/home/video/video", 5 | "pages/car/appoint/appoint", 6 | "pages/car/appoint/appointItem/appointItem", 7 | "pages/car/article/article", 8 | "pages/car/article/articleD/articleD", 9 | "pages/car/galler/galler", 10 | "pages/car/galler/gallerItem/gallerItem", 11 | "pages/car/galler/gallerD/gallerD", 12 | "pages/car/news/news", 13 | "pages/car/news/newsItem/newsItem", 14 | "pages/car/news/newsD/newsD", 15 | "pages/car/cartoon/cartoon", 16 | "pages/car/cartoon/cartoonD/cartoonD", 17 | "pages/car/mine/mine", 18 | "pages/logs/logs" 19 | ], 20 | "window":{ 21 | "backgroundTextStyle":"light", 22 | "navigationBarBackgroundColor": "#D83A88", 23 | "navigationBarTitleText": "第二次测试小程序0000", 24 | "navigationBarTextStyle":"white" 25 | }, 26 | "tabBar": { 27 | "backgroundColor": "white", 28 | "color": "gray", 29 | "selectedColor": "#D83A88", 30 | "borderStyle": "white", 31 | "list": [ 32 | { 33 | "pagePath": "pages/car/home/home", 34 | "text": "首页", 35 | "iconPath": "images/tabbar/h.png", 36 | "selectedIconPath": "images/tabbar/h1.png" 37 | }, 38 | { 39 | "pagePath": "pages/car/appoint/appoint", 40 | "text": "预约", 41 | "iconPath": "images/tabbar/y.png", 42 | "selectedIconPath": "images/tabbar/y1.png" 43 | }, 44 | { 45 | "pagePath": "pages/car/galler/galler", 46 | "text": "浏览", 47 | "iconPath": "images/tabbar/t.png", 48 | "selectedIconPath": "images/tabbar/t1.png" 49 | }, 50 | { 51 | "pagePath": "pages/car/news/news", 52 | "text": "资讯", 53 | "iconPath": "images/tabbar/z.png", 54 | "selectedIconPath": "images/tabbar/z1.png" 55 | }, 56 | { 57 | "pagePath": "pages/car/mine/mine", 58 | "text": "我的", 59 | "iconPath": "images/tabbar/w.png", 60 | "selectedIconPath": "images/tabbar/w1.png" 61 | } 62 | ] 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | .container { 3 | height: 100%; 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | justify-content: space-between; 8 | padding: 200rpx 0; 9 | box-sizing: border-box; 10 | } 11 | -------------------------------------------------------------------------------- /images/map/go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/map/go.png -------------------------------------------------------------------------------- /images/map/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/map/map.png -------------------------------------------------------------------------------- /images/nav/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/nav/left.png -------------------------------------------------------------------------------- /images/tabbar/h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/h.png -------------------------------------------------------------------------------- /images/tabbar/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/h1.png -------------------------------------------------------------------------------- /images/tabbar/t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/t.png -------------------------------------------------------------------------------- /images/tabbar/t1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/t1.png -------------------------------------------------------------------------------- /images/tabbar/w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/w.png -------------------------------------------------------------------------------- /images/tabbar/w1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/w1.png -------------------------------------------------------------------------------- /images/tabbar/y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/y.png -------------------------------------------------------------------------------- /images/tabbar/y1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/y1.png -------------------------------------------------------------------------------- /images/tabbar/z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/z.png -------------------------------------------------------------------------------- /images/tabbar/z1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/tabbar/z1.png -------------------------------------------------------------------------------- /images/type/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/1.png -------------------------------------------------------------------------------- /images/type/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/2.png -------------------------------------------------------------------------------- /images/type/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/3.png -------------------------------------------------------------------------------- /images/type/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/4.png -------------------------------------------------------------------------------- /images/type/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/5.png -------------------------------------------------------------------------------- /images/type/产品介绍3_0002_discover--4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/产品介绍3_0002_discover--4.png -------------------------------------------------------------------------------- /images/type/产品介绍3_0003_me-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/产品介绍3_0003_me-2.png -------------------------------------------------------------------------------- /images/type/产品介绍3_0005_利息.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/A13253565831/wxapp_car/68121914624b13784914d6b4252bae5780bf6d13/images/type/产品介绍3_0005_利息.png -------------------------------------------------------------------------------- /pages/car/appoint/appoint.js: -------------------------------------------------------------------------------- 1 | var con = require("../../../utils/data.js"); 2 | var app = getApp(); 3 | Page({ 4 | data: { 5 | }, 6 | onLoad: function () { 7 | var that = this; 8 | wx.request({ 9 | url: con.hospital_getprelist, 10 | data: { wxappid: con.wyy_user_wxappid }, 11 | method: 'GET', 12 | header: { 13 | "Content-Type": "application/json" 14 | }, 15 | success: function (res) { 16 | that.setData({ 17 | pre: res.data.info 18 | }) 19 | } 20 | }); 21 | 22 | }, 23 | bindPre: function (e) { 24 | var len = e.currentTarget.dataset.id; 25 | console.log(len); 26 | wx.navigateTo({ 27 | url: 'appointItem/appointItem?id=' + len, 28 | }) 29 | } 30 | }) -------------------------------------------------------------------------------- /pages/car/appoint/appoint.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "预约" 3 | } -------------------------------------------------------------------------------- /pages/car/appoint/appoint.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{item.title}} 7 | 8 | {{item.intro}} 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pages/car/appoint/appoint.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | background: #FFFAFA; 3 | } 4 | .title_form_cont { 5 | width: 100%; 6 | height: 500rpx; 7 | position: relative; 8 | } 9 | .filter { 10 | position: absolute; 11 | width: 100%; 12 | height: 500rpx; 13 | background: black; 14 | opacity: .5; 15 | } 16 | .title_form_cont>image{ 17 | width: 100%; 18 | height: 500rpx; 19 | } 20 | .title_name { 21 | position: absolute; 22 | width: 100%; 23 | top: 200rpx; 24 | color: white; 25 | } 26 | .title_name>text{ 27 | display: block; 28 | text-align: center; 29 | } 30 | .pre { 31 | letter-spacing: 2rpx; 32 | color: aqua; 33 | margin-top: 20rpx; 34 | text-align: center; 35 | font-size: 32rpx; 36 | } 37 | .button{ 38 | background-color: #FF4500; 39 | color: white; 40 | } -------------------------------------------------------------------------------- /pages/car/appoint/appointItem/appointItem.js: -------------------------------------------------------------------------------- 1 | var con = require("../../../../utils/data.js"); 2 | var app = getApp(); 3 | var id, openid, stat, arr, filName, arrName, isChose, dArr, mArr, more; 4 | Page({ 5 | data: { 6 | pre: '', 7 | picker: '', 8 | date: '2017-6-01', 9 | }, 10 | onLoad: function (options) { 11 | var that = this; 12 | id = options.id; 13 | console.log(options.id); 14 | wx.request({ 15 | url: con.hospital_getpre, 16 | method: 'GET', 17 | data: { wxappid: con.wyy_user_wxappid, preid: id }, 18 | header: { 19 | "Content-Type": "application/json" 20 | }, 21 | success: function (res) { 22 | console.log(res.data); 23 | //正则判断 24 | var zz = res.data.info.forms.text; 25 | 26 | arr = []; 27 | arrName = []; 28 | isChose; 29 | for (var i in zz) { 30 | var lz = zz[i].field_match; 31 | filName = zz[i].fieldname; 32 | // console.log(filName); 33 | isChose = zz[i].is_empty; 34 | arrName.push(filName); 35 | arr.push(lz); 36 | }; 37 | //多选框 38 | more = res.data.info.forms.checkbox; 39 | mArr = []; 40 | for (var i in more) { 41 | dArr = more[i].fieldname; 42 | mArr.push(dArr); 43 | console.log(mArr); 44 | } 45 | 46 | wx.getStorage({ 47 | key: 'openid', 48 | success: function (res) { 49 | // console.log(res.data); 50 | openid = res.data; 51 | }, 52 | }) 53 | that.setData({ 54 | pre: res.data.info.forms.text, 55 | picker: res.data.info.forms.date, 56 | radio: res.data.info.forms.radio, 57 | checkbox: res.data.info.forms.checkbox, 58 | textarea: res.data.info.forms.textarea, 59 | }) 60 | } 61 | }); 62 | }, 63 | 64 | bindFormSubmit: function (e) { 65 | 66 | // b = aArr[i].is_empty; 67 | // var cao = new RegExp(kArr[i]); 68 | // if (b == 1) { 69 | // if (!cao.test(e.detail.value[vArr[i]])) { 70 | // console.log(11111); 71 | // wx.showToast({ 72 | // title: '您的输入格式有误,请重新输入!', 73 | // mask: false, 74 | // success: function (res) { }, 75 | // }) 76 | // return false; 77 | // } 78 | 79 | 80 | for (var i in arr) { 81 | // console.log(arr[i]); 82 | var reg = new RegExp(arr[i]); 83 | for (var j in arrName) { 84 | // console.log(e.detail.value[arrName[j]]); 85 | 86 | if (i == j) { 87 | console.log(e.detail.value[arrName[j]]); 88 | console.log(reg); 89 | if (isChose == 1) { 90 | if (reg.test(e.detail.value[arrName[j]])) { 91 | 92 | } else { 93 | wx.showToast({ 94 | title: '输入内容不正确', 95 | mask: false, 96 | success: function () { 97 | 98 | } 99 | }) 100 | return false; 101 | } 102 | } 103 | } 104 | } 105 | }; 106 | //多选框 107 | var string = e.detail.value; 108 | for (var i in more) { 109 | console.log(mArr[i]); 110 | if (isChose == 1) { 111 | if (string[mArr[i]].length < 1) { 112 | console.log(22222); 113 | wx.showToast({ 114 | title: '多选请至少选择一个选项!', 115 | mask: false, 116 | success: function (res) { }, 117 | }) 118 | return false; 119 | } 120 | } 121 | } 122 | // var string = e.detail.value; 123 | // for (var i in string) { 124 | // if (!string.hasOwnProperty(i)) { 125 | // return; 126 | // } else if (string[i].length <= 0) { 127 | // ok = 0; 128 | // wx.showToast({ 129 | // title: '提交失败,请输入完整', 130 | // mask: false, 131 | // success: function (res) { }, 132 | // }); 133 | // return false; 134 | // } 135 | // } 136 | 137 | var ok = 1; 138 | 139 | if (ok == 1) { 140 | wx.request({ 141 | url: con.hospital_postprerecord, 142 | method: 'POST', 143 | data: { wxappid: con.wyy_user_wxappid, preid: id, openid: openid, record: JSON.stringify(e.detail.value) }, 144 | header: { 145 | "Content-Type": "application/x-www-form-urlencoded" 146 | }, 147 | success: function (res) { 148 | console.log(res.data); 149 | stat = res.data.status; 150 | if (stat == 1) { 151 | wx.showToast({ 152 | title: '提交成功!', 153 | mask: false, 154 | success: function (res) { }, 155 | }); 156 | } 157 | } 158 | }); 159 | } 160 | }, 161 | bindDateChange: function (e) { 162 | this.setData({ 163 | date: e.detail.value 164 | }) 165 | }, 166 | 167 | }) -------------------------------------------------------------------------------- /pages/car/appoint/appointItem/appointItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "汽车预约" 3 | } -------------------------------------------------------------------------------- /pages/car/appoint/appointItem/appointItem.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 汽车预约 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | {{item.name}}: 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | {{item.name}}:{{date}} 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {{item.name}}: 61 |