├── 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 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/pages/car/appoint/appointItem/appointItem.wxss:
--------------------------------------------------------------------------------
1 | page{
2 | background: #9999CC;
3 | }
4 |
5 | .form_cont{
6 | text-align: center;
7 | padding-top: 10rpx;
8 | }
9 | .form_cont text{
10 | color: white;
11 | background: black;
12 | font-weight: bold;
13 | }
14 | .pre_view{
15 | padding: 10px 15px;
16 | }
17 |
18 | .rad{
19 | padding-top: 10rpx;
20 | padding-bottom:10rpx;
21 | font-size:30rpx;
22 | padding-left: 20rpx;
23 | }
24 | .chec{
25 | padding-top: 10rpx;
26 | padding-bottom: 10rpx;
27 | font-size: 30rpx;
28 | }
29 |
30 | .input_cont {
31 | width: 98%;
32 | height: 40px;
33 | border: 1px solid gray;
34 | margin-top: 15px;
35 | border-radius: 15rpx;
36 | padding-left: 2%;
37 | background-color: white;
38 | }
39 | .pre_for:nth-child(1) .input_cont{
40 | /* background:#C90000; */
41 | /* color: white; */
42 | border-radius: 15rpx;
43 |
44 | }
45 |
46 | .pre_for:nth-child(2) .input_cont{
47 | /* background:#F05600; */
48 | /* color: white; */
49 | border-radius: 15rpx;
50 | }
51 |
52 | .pre_for:nth-child(3) .input_cont{
53 | /* background:#0188FB; */
54 | /* color: white; */
55 | border-radius: 15rpx;
56 | }
57 | .pre_for:nth-child(4) .input_cont{
58 | /* background:#660000; */
59 | /* color: white; */
60 | border-radius: 15rpx;
61 | }
62 |
63 | .pre_for:nth-child(5) .input_cont{
64 | /* background:#990099; */
65 | /* color: white; */
66 | border-radius: 15rpx;
67 | }
68 | .button {
69 | margin-top: 40px;
70 | color: white;
71 | background: #0A1C71;
72 | margin-bottom: 20rpx;
73 | }
74 | .section {
75 | width: 98%;
76 | height: 35px;
77 | margin-top: 15px;
78 | color: black;
79 | border-radius: 15rpx;
80 | background: white;
81 | padding-left: 2%;
82 | }
83 |
84 | .section__title {
85 | line-height: 35px;
86 | color: black;
87 | }
88 |
89 | .appoint_radio_content{
90 | margin-top: 15px;
91 | color: black;
92 |
93 | }
94 | .appoint{
95 | padding: 10rpx 15px;
96 | }
97 | .appoint_radio {
98 | width: 100%;
99 | margin-top: 10px;
100 | background: white;
101 | border-radius: 15rpx;
102 | /*height: 120px;*/
103 | /*background: lightgoldenrodyellow;*/
104 | }
105 |
106 | .radio-group {
107 | width: 100%;
108 | }
109 | .radio {
110 | display: block;
111 | padding-top: 10px;
112 | padding-bottom: 10px;
113 | }
114 | .input_color_title{
115 | display: block;
116 | padding-bottom: 3px;
117 | }
118 | .checkbox{
119 | padding: 10px 15px;
120 | }
121 | .check-group {
122 | width: 100%;
123 | }
124 | .appoint_checkbox {
125 | width: 100%;
126 | height: 80px;
127 | padding-top: 10px;
128 | }
129 |
130 | .appoint_checkbox_content {
131 | display: flex;
132 | flex-direction: column;
133 | justify-content: space-between;
134 | }
135 | .check-group {
136 | width: 100%;
137 | padding-top: 20rpx;
138 | /*padding-left: 60rpx;*/
139 | background: white;
140 | padding-bottom: 10px;
141 | margin-top: 10px;
142 | color: black;
143 | border-radius: 15rpx;
144 | }
145 | .checkbox{
146 | display: block;
147 | padding-top: 10rpx;
148 | }
149 |
150 | .check-group text {
151 | padding-right: 25rpx;
152 | }
153 | .text_area {
154 | width: 100%;
155 | padding-top: 30rpx;
156 | color: #C90000;
157 | margin-top: 10rpx;
158 | }
159 | .text_area text {
160 | padding-bottom: 10rpx;
161 | display: block;
162 | color: seashell;
163 | }
164 | .toto{
165 | padding: 10px 15px;
166 | }
167 | .button{
168 | width: 94%;
169 | background: #6FB6F4;
170 | margin-bottom: 20rpx;
171 | }
--------------------------------------------------------------------------------
/pages/car/article/article.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../utils/data.js");
2 | var app = getApp();
3 | Page({
4 | data: {
5 | list: [],
6 | article: []
7 | },
8 | onLoad: function (options) {
9 | var that = this;
10 | var id = options.id;
11 |
12 | wx.request({
13 | url: con.gettarticallist,
14 | mthod: "GET",
15 | data: { wxappid: con.wyy_user_wxappid, typeid: id },
16 | header: {
17 | "Content-Type": "application/json"
18 | },
19 | success: function (res) {
20 | console.log(res.data.info);
21 | console.log(11111);
22 | that.setData({
23 | articleTwo: res.data.info
24 | })
25 | }
26 | })
27 | },
28 | bindViewD: function (e) {
29 | var len = e.currentTarget.dataset.id;
30 | wx.navigateTo({
31 | url: 'articleD/articleD?id=' + len,
32 | })
33 | }
34 | })
--------------------------------------------------------------------------------
/pages/car/article/article.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/article/article.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{item.title}}
7 |
8 | {{item.text}}
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/pages/car/article/article.wxss:
--------------------------------------------------------------------------------
1 | .newsItem_box{
2 | background: #f3eff1;
3 | }
4 | .newsItem_flex{
5 | display: flex;
6 | flex-direction: column;
7 | padding-top: 10rpx;
8 | padding-bottom: 10rpx;
9 | }
10 | .newsItem_for{
11 | padding: 10rpx 20rpx;
12 | display: flex;
13 | justify-content: flex-start;
14 | background: white;
15 | height: 320rpx;
16 | margin-top: 10rpx;
17 | }
18 | .newsItem_for>image{
19 | flex: 2;
20 | height: 300rpx;
21 | padding-top: 10rpx;
22 | margin-right: 20rpx;
23 | }
24 |
25 | .newsItem_cont{
26 | flex: 3;
27 | padding-top: 10rpx;
28 | display: flex;
29 | flex-direction: column;
30 | color: black;
31 | }
32 |
33 | .news_text{
34 | margin-top: 20rpx;
35 | font-size: 32rpx;
36 | line-height: 40rpx;
37 | }
--------------------------------------------------------------------------------
/pages/car/article/articleD/articleD.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../../utils/data.js");
2 | var WxParse = require
3 |
4 | ("../../../../wxParse/wxParse.js");
5 | var app = getApp();
6 | Page({
7 | data: {
8 | artD: {
9 |
10 | }
11 | },
12 | onLoad: function (options) {
13 | var that = this;
14 | var id = options.id;
15 | wx.request({
16 |
17 | url: con.getartical,
18 | data: { wxappid: con.wyy_user_wxappid, id: id },
19 |
20 | header: {
21 | "Content-Type": "application/json"
22 | },
23 | success: function (res) {
24 |
25 |
26 | console.log(res.data);
27 | WxParse.wxParse('arta', 'html', res.data.details, that,
28 |
29 | 0);
30 | that.setData({
31 | // artD: res.data
32 | text: res.data.text,
33 | title: res.data.title,
34 | img: res.data.img
35 | })
36 | }
37 | })
38 | },
39 |
40 | })
41 |
42 |
--------------------------------------------------------------------------------
/pages/car/article/articleD/articleD.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/article/articleD/articleD.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 | {{title}}
11 |
12 |
13 | {{text}}
14 |
15 |
16 |
17 |
18 |
21 | {{}}
22 |
23 |
24 |
--------------------------------------------------------------------------------
/pages/car/article/articleD/articleD.wxss:
--------------------------------------------------------------------------------
1 | .carbook_detail {
2 | width:100%;
3 | background: #f3eff1;
4 | }
5 | .carbook_for{
6 | display: flex;
7 | flex-direction: column;
8 | }
9 | .carbook_for image {
10 | width: 100%;
11 | height: 200px;
12 | }
13 | .carbook_title {
14 | margin-top: 10px;
15 | background: white;
16 | padding-left: 10px;
17 | text-align: center;
18 | padding-top: 10rpx;
19 | }
20 | .carbook_intro {
21 | background: white;
22 | /* height: 60px; */
23 | font-size: 32rpx;
24 | padding: 10px 10px 10rpx 10px;
25 | letter-spacing: 1px;
26 | }
27 | .carbook_cont {
28 | background: white;
29 | font-size: 32rpx;
30 | letter-spacing: 2px;
31 | margin-top: 10rpx;
32 | }
33 | .wxParse-p{
34 | padding: 10rpx 20rpx;
35 | line-height: 40rpx;
36 | }
37 | element.style{
38 | width: 95%;
39 | }
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoon.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../utils/data.js");
2 | var app = getApp();
3 | Page({
4 | data: {
5 |
6 | },
7 | onLoad: function (options) {
8 | var that = this;
9 | var id = options.id;
10 | wx.request({
11 | url: con.hospital_getphoto,
12 | method: 'GET',
13 | data: { wxappid: con.wyy_user_wxappid, id: id },
14 | header: {
15 | "Content-Type": "application/json"
16 | },
17 | success: function (res) {
18 | console.log(res.data.info);
19 | that.setData({
20 | gallerItem: res.data.info
21 | })
22 |
23 | },
24 | })
25 | },
26 | bindgallerD: function (e) {
27 | var len = e.currentTarget.dataset.id;
28 | wx.navigateTo({
29 | url: 'cartoonD/cartoonD?id=' + len,
30 | })
31 | }
32 | })
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoon.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoon.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{item.name}}
8 |
9 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoon.wxss:
--------------------------------------------------------------------------------
1 | .contain{
2 | background: lightgray;
3 | padding-top: 5px;
4 | }
5 | .contain_flex{
6 |
7 | background: white;
8 | padding: 10px 10px;
9 | }
10 | .galler_padding{
11 | display: flex;
12 | flex-direction: row;
13 | flex-wrap: wrap;
14 | justify-content: space-between;
15 |
16 | }
17 | .contain_for{
18 | width: 49%;
19 | height: 300rpx;
20 | padding-bottom: 5rpx;
21 | }
22 | .contain_for>image{
23 | width: 100%;
24 | height: 240rpx;
25 |
26 | }
27 | .galler_text{
28 | font-size: 15px;
29 | color: #696969;
30 | }
31 | .galler_intro{
32 | font-size: 15px;
33 | color: red;
34 | margin-top: 2rpx;
35 |
36 | }
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoonD/cartoonD.js:
--------------------------------------------------------------------------------
1 |
2 | var con = require("../../../../utils/data.js");
3 | var app = getApp();
4 | Page({
5 | data: {
6 | galler: {},
7 | height: {},
8 | width: {},
9 | },
10 | onLoad: function (options) {
11 | var that = this;
12 | var id = options.id;
13 | wx.request({
14 | url: con.getphotodetail,
15 | method: 'GET',
16 | data: { wxappid: con.wyy_user_wxappid, id: id },
17 | header: {
18 | "Content-Type": "application/json"
19 | },
20 | success: function (res) {
21 | that.setData({
22 | galler: res.data
23 | })
24 |
25 | },
26 | });
27 |
28 | wx.getSystemInfo({
29 | success: function (res) {
30 | that.setData({
31 | height: res.windowHeight,
32 | width: res.windowWidth
33 | })
34 | },
35 | })
36 | },
37 |
38 | })
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoonD/cartoonD.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoonD/cartoonD.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/pages/car/cartoon/cartoonD/cartoonD.wxss:
--------------------------------------------------------------------------------
1 | .gallery_container {
2 | width: 100%;
3 | display: flex;
4 | position: relative;
5 | flex-direction: row;
6 | align-items: center;
7 | }
8 | .galler_title {
9 | width: 100%;
10 | height: 500px;
11 | position: relative;
12 | }
13 |
14 |
15 | .galler_big_image{
16 | width: 100%;
17 | /*height: 100%;*/
18 | }
19 | .galler_footer {
20 | width: 100%;
21 | height: 380rpx;
22 | position: absolute;
23 | bottom: 0;
24 | background: #222222;
25 |
26 | }
27 | .galler_footer text {
28 | color: aliceblue;
29 |
30 | }
31 | .galler_intro{
32 | margin-top: 10rpx;
33 | padding: 0 20rpx;
34 |
35 | }
36 | .galler_name{
37 | line-height:40rpx;
38 | font-size: 30rpx;
39 | }
--------------------------------------------------------------------------------
/pages/car/galler/galler.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../utils/data.js");
2 | var app = getApp();
3 | Page({
4 | data: {
5 | carSystem: []
6 | },
7 | onLoad: function () {
8 | var that = this;
9 | wx.request({
10 | url: con.getserieslist,
11 | method: 'GET',
12 | data: { wxappid: con.wyy_user_wxappid },
13 | header: {
14 | "Content-Type": "application/json"
15 | },
16 | success: function (res) {
17 | // console.log(res.data);
18 | that.setData({
19 | carSystem: res.data
20 | })
21 | }
22 | });
23 | },
24 | bindTotal: function (e) {
25 | var len = e.currentTarget.dataset.id;
26 | wx.navigateTo({
27 | url: 'gallerItem/gallerItem?id=' + len
28 | })
29 | }
30 | })
31 |
--------------------------------------------------------------------------------
/pages/car/galler/galler.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | "navigationBarTitleText": "汽车浏览"
4 | }
--------------------------------------------------------------------------------
/pages/car/galler/galler.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{ind.name}}
11 |
12 |
13 | {{ind.info}}
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/pages/car/galler/galler.wxss:
--------------------------------------------------------------------------------
1 |
2 | .total_car{
3 | background: gainsboro;
4 | }
5 | .total_car_flex {
6 | display: flex;
7 | flex-direction: column;
8 | }
9 | .total_car_view {
10 | margin-top: 10px;
11 | width: 100%;
12 | background: white;
13 | }
14 | .backg_white {
15 | padding: 10px 20px;
16 | }
17 | .total_car_image {
18 | width: 100%;
19 | height: 200px;
20 | }
21 | .total_car_image image{
22 | width: 100%;
23 | height: 100%;
24 | }
25 | .total_car_title {
26 | margin-top: 5px;
27 | font-size: 15px;
28 | color: #696969;
29 | }
30 | .total_car_intro {
31 | margin-top: 5px;
32 | font-size: 13px;
33 | color: #696969;
34 | }
--------------------------------------------------------------------------------
/pages/car/galler/gallerD/gallerD.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../../utils/data.js");
2 | var WxParse = require("../../../../wxParse/wxParse.js");
3 | var app = getApp();
4 | Page({
5 | data: {
6 | artD: {
7 | // title: '我的内容',
8 | // img: '../../../../images/run_car/audi.png',
9 | // cont: '这款车好棒'
10 | }
11 | },
12 | onLoad: function (options) {
13 | var that = this;
14 | var id = options.id;
15 | wx.request({
16 | url: con.getmodeldetail,
17 | data: { wxappid: con.wyy_user_wxappid, id: id },
18 | method: 'GET',
19 | header: {
20 | 'Content-Type': 'application/json',
21 | },
22 | success: function (res) {
23 | console.log(res.data);
24 | WxParse.wxParse('arta', 'html', res.data.details, that, 0);
25 | that.setData({
26 | artD: res.data
27 | })
28 | }
29 | })
30 | }
31 | })
32 |
--------------------------------------------------------------------------------
/pages/car/galler/gallerD/gallerD.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/galler/gallerD/gallerD.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{artD.name}}
11 |
12 |
13 | {{artD.bmoney}}万 --
14 | {{artD.emoney}}万
15 |
16 |
17 |
18 | {{artD.details}}
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/pages/car/galler/gallerD/gallerD.wxss:
--------------------------------------------------------------------------------
1 | .cont {
2 | background: lightgray;
3 | }
4 | .article_detail_title {
5 | width: 100%;
6 | height: 450rpx;
7 | }
8 | .article_detail_title image{
9 | width: 100%;
10 | height: 100%;
11 | }
12 | .article_detail {
13 | width: 100%;
14 | }
15 | .article_main_cont {
16 | /* margin-top: 10px; */
17 | }
18 | .article_title {
19 | font-size: 16px;
20 | letter-spacing: 1px;
21 | padding: 15rpx 20rpx;
22 | background: white;
23 | }
24 | .article_intro{
25 | font-size: 14px;
26 | padding-bottom: 15px;
27 | letter-spacing: 2px;
28 | background: white;
29 | padding: 15rpx 20rpx;
30 | }
31 | .wxParse-p{
32 | font-size:32rpx;
33 | line-height: 45rpx;
34 | margin-top: 10rpx;
35 | background: white;
36 | padding: 10rpx 20rpx;
37 | }
--------------------------------------------------------------------------------
/pages/car/galler/gallerItem/gallerItem.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../../utils/data.js");
2 | var app = getApp();
3 | Page({
4 | data: {
5 | recommond: []
6 | },
7 | onLoad: function (options) {
8 | var that = this;
9 | var id = options.id;
10 | wx.request({
11 | url: con.getmodellist,
12 | method: "GET",
13 | data: { wxappid: con.wyy_user_wxappid, id: id },
14 | header: {
15 | "Content-Type": "application/json"
16 | },
17 | success: function (res) {
18 | // console.log(res.data);
19 | that.setData({
20 | recommond: res.data
21 | })
22 | }
23 | });
24 | },
25 | bindDetail: function (e) {
26 | var len = e.currentTarget.dataset.id;
27 | wx.navigateTo({
28 | url: '../gallerD/gallerD?id=' + len,
29 | })
30 | }
31 | })
--------------------------------------------------------------------------------
/pages/car/galler/gallerItem/gallerItem.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/galler/gallerItem/gallerItem.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 车型展示
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{item.name}}
16 |
17 |
18 | {{item.bmoney}}万 --
19 | {{item.emoney}}万
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/pages/car/galler/gallerItem/gallerItem.wxss:
--------------------------------------------------------------------------------
1 | .car_box{
2 | /*background: #DCDCDC;*/
3 | }
4 | .recommond_car {
5 | padding-top: 10px;
6 | background: #696969;
7 | padding-bottom: 10px;
8 | }
9 | .recommond_car image{
10 | float: left;
11 | margin-right: 10px;
12 | width: 4px;
13 | height: 25px;
14 | }
15 | .recommond_car_cont {
16 | font-size: 16px;
17 | color: #2FBAFD;
18 | font-weight: bolder;
19 | }
20 | .recommond_car_cont text {
21 | display: inline-block;
22 | height: 25px;
23 | line-height:25px;
24 | }
25 | .recommond_car_image{
26 | padding: 5px 10px;
27 | }
28 | .recommond_car_title {
29 | display: flex;
30 | flex-direction: row;
31 | flex-wrap: wrap;
32 | justify-content: space-between;
33 | padding-bottom: 20px;
34 | }
35 | .recommond_car_view{
36 | width: 350rpx;
37 | height: 355rpx;
38 | }
39 |
40 | .recommond_car_view image {
41 | width: 100%;
42 | height: 120px;
43 | }
44 | .recommond_car_text {
45 | font-size: 15px;
46 | text-align: center;
47 | color: #696969;
48 | }
49 | .recommond_car_text:nth-child(3){
50 | color: red;
51 | font-size: 13px;
52 |
53 | }
--------------------------------------------------------------------------------
/pages/car/home/home.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../utils/data.js");
2 | var app = getApp()
3 | Page({
4 | data: {
5 | type: [],
6 | list: [],
7 | galler: [],
8 | videoList: []
9 | },
10 | onLoad: function () {
11 | var that = this;
12 | app.getUserInfo();
13 | wx.request({
14 | url: con.hospital_getslide,
15 | method: 'GET',
16 | data: { wxappid: con.wyy_user_wxappid },
17 | header: {
18 | "Content-Type": "application/json"
19 | },
20 | success: function (res) {
21 | console.log(res.data.info);
22 | that.setData({
23 | list: res.data.info
24 | })
25 |
26 | }
27 |
28 | });
29 | wx.request({
30 | url: con.hospital_gettype,
31 | method: 'GET',
32 | data: { wxappid: con.wyy_user_wxappid, count: 6 },
33 | header: {
34 | "Content-Type": "application/json"
35 | },
36 | success: function (res) {
37 | console.log(res.data.info);
38 | that.setData({
39 | type: res.data.info
40 | })
41 | }
42 |
43 | });
44 | wx.request({
45 | url: con.hospital_getphotogroup,
46 | method: 'GET',
47 | data: { wxappid: con.wyy_user_wxappid, count: 2 },
48 | header: {
49 | "Content-Type": "application/json"
50 | },
51 | success: function (res) {
52 | // console.log(res.data.info);
53 | that.setData({
54 | galler: res.data.info
55 | })
56 | }
57 | });
58 | that.getVideoHttp()
59 |
60 | },
61 | // 视频列表页面
62 | goMoreVideo: function (e) {
63 | wx.navigateTo({
64 | url: 'video/video',
65 | })
66 | },
67 | getVideoHttp: function () {
68 | var that = this;
69 | wx.request({
70 | url: con.getvideo,
71 | data: { wxappid: con.wyy_user_wxappid, count: 4 },
72 | method: 'GET',
73 | header: {
74 | "Content-Type": 'application/json'
75 | },
76 | success: function (res) {
77 | // console.log(res.data.info);
78 | that.setData({
79 | videoList: res.data
80 | })
81 | console.log(111, res.data);
82 | }
83 | });
84 | },
85 | bindType: function (e) {
86 | // console.log(e.currentTarget.dataset.id);
87 | var len = e.currentTarget.dataset.id;
88 | wx.navigateTo({
89 | url: '../article/article?id=' + len,
90 | });
91 | },
92 | bindgaller: function (e) {
93 | var len = e.currentTarget.dataset.id;
94 | wx.navigateTo({
95 | url: '../cartoon/cartoon?id=' + len,
96 | })
97 | }
98 | })
99 |
100 |
--------------------------------------------------------------------------------
/pages/car/home/home.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "首页"
3 | }
--------------------------------------------------------------------------------
/pages/car/home/home.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 视频介绍
8 | 更多 >
9 |
10 |
11 |
12 |
13 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | {{item.name}}
31 |
32 |
33 |
34 |
35 |
36 | 推荐介绍
37 |
38 |
39 |
40 |
41 |
42 |
43 | {{item.name}}
44 |
45 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/pages/car/home/home.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/swiper.wxss";
2 |
3 | .contain{
4 | background: #f3eff1;
5 | }
6 |
7 | .type_cont {
8 | margin-top: 5rpx;
9 |
10 | }
11 | .type_flex{
12 | display: flex;
13 | flex-direction: row;
14 | flex-wrap: wrap;
15 | background: white;
16 | padding: 10px;
17 | justify-content: space-between;
18 | }
19 | .type_for {
20 | width: 160rpx;
21 | height: 105px;
22 | text-align: center;
23 | color: #696969;
24 |
25 | }
26 |
27 | .type_for image {
28 | width: 100%;
29 | height: 150rpx;
30 | border-radius: 50%;
31 | }
32 | .type_cont_text {
33 | font-size: 30rpx;
34 | padding-top: 5px;
35 | }
36 |
37 |
38 | .recommond_nav {
39 | margin-top: 7px;
40 | background: white;
41 | padding: 10px;
42 | font-size: 36rpx;
43 | }
44 |
45 | .recommond_cont{
46 | background: white;
47 | padding-bottom: 5rpx;
48 | }
49 | .recommond_flex {
50 | display: flex;
51 | flex-direction: row;
52 | justify-content: space-around;
53 | flex-wrap: wrap;
54 |
55 | }
56 | .recommond_for {
57 | width:45%;
58 | height: 240rpx;
59 | }
60 | .recommond_for:nth-child(3){
61 | padding-top: 60px;
62 | padding-bottom: 40px;
63 | }
64 | .recommond_for:nth-child(4){
65 | padding-top: 60px;
66 | padding-bottom: 40px;
67 | }
68 |
69 | .recommond_for>image {
70 | width: 100%;
71 | height: 100%;
72 | }
73 | .recommond_name {
74 | display: flex;
75 | flex-direction: row;
76 | justify-content: space-between;
77 | color: #696969;
78 | }
79 |
80 | .recommond_right {
81 | width: 80rpx;
82 | height: 30rpx;
83 | }
84 | .recommond_right image{
85 | width: 100%;
86 | height: 100%;
87 | }
88 | .recommond_left{
89 | font-size: 30rpx;
90 | }
91 |
92 | .rqxm {
93 | width: 95%;
94 | margin: 30rpx auto;
95 | font-size: 0;
96 | }
97 | .title {
98 | font-size: 14px;
99 | overflow:hidden;
100 | font-weight: bloder;
101 | }
102 | .xueyuan_top_left {
103 | float:left;
104 | color:gray;
105 | font-size:30rpx;
106 | font-weight:bloder;
107 | border-left:6rpx solid #D83A88;
108 |
109 | }
110 |
111 | .xueyuan_top_right {
112 | float:right;
113 | color:gray;
114 | font-size:30rpx;
115 | font-weight:bloder;
116 |
117 | }
118 | .video {
119 | width: 100%;
120 | }
121 | .myVideo {
122 | width: 100%;
123 | margin-top: 20rpx;
124 | }
125 | .headerRight {
126 | padding: 20rpx 0;
127 | }
128 | .headerName {
129 | font-size: 28rpx;
130 | line-height: 40rpx;
131 | }
132 | .headerTime {
133 | display: block;
134 | font-size: 24rpx;
135 | color: gray;
136 |
137 | }
138 | .border {
139 | margin-top: 10rpx;
140 | border-bottom:1px solid gray;
141 | }
142 |
143 |
144 |
--------------------------------------------------------------------------------
/pages/car/home/video/video.js:
--------------------------------------------------------------------------------
1 | // pages/weiyunyi/home/video/video.js
2 | var app = getApp();
3 | var con = require("../../../../utils/data.js");
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | videoList: []
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 | var that = this;
18 | that.getVideoHttp();
19 | },
20 | getVideoHttp: function () {
21 | var that = this;
22 | wx.request({
23 | url: con.getvideo,
24 | data: { wxappid: con.wyy_user_wxappid },
25 | method: 'GET',
26 | header: {
27 | "Content-Type": 'application/json'
28 | },
29 | success: function (res) {
30 | // console.log(res.data.info);
31 | that.setData({
32 | videoList: res.data
33 | })
34 | console.log(111, res.data);
35 | }
36 | });
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面初次渲染完成
41 | */
42 | onReady: function () {
43 | },
44 | onShareAppMessage: function () {
45 |
46 | }
47 | })
48 |
49 |
--------------------------------------------------------------------------------
/pages/car/home/video/video.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/home/video/video.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/pages/car/home/video/video.wxss:
--------------------------------------------------------------------------------
1 | /* pages/weiyunyi/home/video/video.wxss */
2 | .rqxm {
3 | width: 95%;
4 | margin: 30rpx auto;
5 | }
6 |
7 | .video {
8 | width: 100%;
9 | }
10 | .myVideo {
11 | width: 100%;
12 | margin-top: 20rpx;
13 | }
14 | .headerRight {
15 | padding: 20rpx 0;
16 | }
17 | .headerName {
18 | font-size: 28rpx;
19 | line-height: 40rpx;
20 | }
21 | .headerTime {
22 | display: block;
23 | font-size: 24rpx;
24 | color: gray;
25 |
26 | }
27 | .border {
28 | margin-top: 10rpx;
29 | border-bottom:1px solid gray;
30 | }
--------------------------------------------------------------------------------
/pages/car/mine/mine.js:
--------------------------------------------------------------------------------
1 | var con = require('../../../utils/data.js');
2 | var WxParse = require("../../../wxParse/wxParse.js");
3 | var QQMapWX = require('../../../utils/qqmap-wx-jssdk.min.js');
4 | var app = getApp();
5 | var lng, lat, name, address;
6 |
7 | Page({
8 | data: {
9 | longitude: {},
10 | latitude: {},
11 | markers: [],
12 |
13 | },
14 | onLoad: function () {
15 | var that = this;
16 | wx.request({
17 | url: con.hospital_getinfo,
18 | method: 'GET',
19 | data: { wxappid: con.wyy_user_wxappid },
20 | header: {
21 | "Content-Type": "application/json"
22 | },
23 | success: function (res) {
24 | // console.log(res.data.info);
25 | name = res.data.info.name;
26 | address = res.data.info.address;
27 | WxParse.wxParse('shoperIn', 'html', res.data.info.intro, that, 0)
28 | that.setData({
29 | address: res.data.info.address,
30 | name: res.data.info.name,
31 | tel: res.data.info.tel
32 | })
33 | }
34 |
35 | });
36 | var demo = new QQMapWX({
37 | key: 'QCDBZ-GZ3WI-BQDG7-5H24V-Y2HSO-I7BSG'
38 | });
39 | wx.request({
40 | url: con.getmap,
41 | method: 'GET',
42 | data: { wxappid: con.wyy_user_wxappid },
43 | header: {
44 | "Content-Type": "application/json",
45 | },
46 | success: function (res) {
47 | // console.log(name);
48 | lng = res.data.lng;
49 | lat = res.data.lat;
50 | that.setData({
51 | longitude: res.data.lng,
52 | latitude: res.data.lat,
53 | markers: [{
54 | longitude: res.data.lng,
55 | latitude: res.data.lat,
56 | iconPath: '../../../images/map/map.png',
57 | title: name,
58 | address: address,
59 | alpha: 1,
60 | width: 40,
61 | height: 40
62 | }],
63 | });
64 | }
65 | });
66 | // 获取域名接口
67 | wx.request({
68 | url: con.get_copyright,
69 | method: 'GET',
70 | data: { wxappid: con.wyy_user_wxappid },
71 | header: {
72 | "Content-Type": "application/json"
73 | },
74 | success: function (res) {
75 | that.setData({
76 | yname: res.data
77 | })
78 | console.log(res.data)
79 | }
80 |
81 | })
82 |
83 |
84 | },
85 | bindgothere: function (e) {
86 |
87 | wx.openLocation({
88 | latitude: lat,
89 | longitude: lng,
90 | name: name,
91 | address: address
92 | })
93 | }
94 | });
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/pages/car/mine/mine.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我的"
3 | }
--------------------------------------------------------------------------------
/pages/car/mine/mine.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 公司名称:{{name}}
9 |
10 |
11 | 公司地址:{{address}}
12 |
13 |
14 | 到这里去:
15 |
16 |
17 | 公司电话:{{tel}}
18 |
19 |
20 | 公司详情
21 |
22 |
23 |
24 | 公司简介:{{intro}}
25 |
26 |
27 |
28 |
29 |
30 |
31 | {{yname.errMsg.banquan}}提供技术支持
32 | {{yname.errMsg.url}}
33 |
34 |
--------------------------------------------------------------------------------
/pages/car/mine/mine.wxss:
--------------------------------------------------------------------------------
1 | .map_text {
2 | /*padding: 10px 20px;*/
3 | font-size: 16px;
4 | background: #f3eff1;
5 | }
6 | .map_center{
7 | display: flex;
8 | flex-direction: column;
9 | }
10 |
11 | .map_address {
12 | padding: 10px 20px;
13 | margin-top: 5px;
14 | background: white;
15 | /* height: 40px; */
16 | letter-spacing: 1px;
17 | }
18 | .shoper_name {
19 | padding: 10px 20px;
20 | margin-top: 5px;
21 | /*background: white;*/
22 | /* height: 20px; */
23 | /* line-height: 20px; */
24 | letter-spacing: 2px;
25 | text-align: center;
26 | color: black;
27 | }
28 | .contact_me{
29 | margin-top: 5px;
30 | padding: 10px 20px;
31 | background: white;
32 | height: 20px;
33 | line-height: 20px;
34 | letter-spacing: 2px;
35 | }
36 | .shoper_intor {
37 | margin-top: 5px;
38 | padding: 10px 20px;
39 | background: white;
40 | letter-spacing: 1px;
41 | font-size:32rpx;
42 | line-height: 40rpx;
43 | }
44 |
45 | .company_detail{
46 | margin-top: 5px;
47 | padding: 10px 20px;
48 | background: white;
49 | letter-spacing: 3px;
50 | }
51 | .go_there{
52 | background: white;
53 | height: 20px;
54 | padding: 5px 20px;
55 | margin-top: 5px;
56 | }
57 | .go_there>image{
58 | width: 20px;
59 | height: 20px;
60 | }
--------------------------------------------------------------------------------
/pages/car/news/news.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../utils/data.js");
2 | var app = getApp();
3 | Page({
4 | data: {
5 | list: [],
6 | articleTwo: []
7 | },
8 | onLoad: function () {
9 | var that = this;
10 | wx.request({
11 | url: con.hospital_getslide,
12 | method: 'GET',
13 | data: { wxappid: con.wyy_user_wxappid },
14 | header: {
15 | "Content-Type": "application/json"
16 | },
17 | success: function (res) {
18 | // console.log(res.data.info);
19 | that.setData({
20 | list: res.data.info
21 | })
22 | }
23 | });
24 |
25 |
26 | wx.request({
27 | url: con.hospital_gettype,
28 | method: 'GET',
29 | data: { wxappid: con.wyy_user_wxappid },
30 | header: {
31 | "Content-Type": "application/json"
32 | },
33 | success: function (res) {
34 | // console.log(res.data.info);
35 | that.setData({
36 | type: res.data.info
37 | })
38 | }
39 |
40 | });
41 | },
42 | bindType: function (e) {
43 | var len = e.currentTarget.dataset.id;
44 | wx.navigateTo({
45 | url: 'newsItem/newsItem?id=' + len,
46 | })
47 | }
48 | })
--------------------------------------------------------------------------------
/pages/car/news/news.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "资讯"
3 | }
--------------------------------------------------------------------------------
/pages/car/news/news.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{item.name}}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/pages/car/news/news.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../style/swiper.wxss";
2 | .box{
3 | padding-top: 10rpx;
4 | background: #f3eff1;
5 | }
6 | .contain{
7 | /*padding-top: 5px;*/
8 | background: white;
9 | }
10 | .shop_flex{
11 | display: flex;
12 | flex-direction: column;
13 | padding:20rpx 30rpx;
14 | }
15 | .shop_for{
16 | width: 100%;
17 | height: 400rpx;
18 | display: flex;
19 | flex-direction: column;
20 | align-content: space-between;
21 | padding-bottom:5rpx;
22 | margin-bottom: 10rpx;
23 | }
24 | .text{
25 |
26 | flex:1;
27 | text-align: center;
28 | font-size:16px;
29 | color: white;
30 | background: #FE4D10;
31 | padding-top: 10rpx;
32 | padding-bottom: 8rpx;
33 | }
34 | .shop_image{
35 | flex:6;
36 | width: 100%;
37 | }
38 | .shop_image>image{
39 | width: 100%;
40 | height: 100%;
41 | }
42 |
--------------------------------------------------------------------------------
/pages/car/news/newsD/newsD.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../../utils/data.js");
2 | var WxParse = require
3 |
4 | ("../../../../wxParse/wxParse.js");
5 | var app = getApp();
6 | Page({
7 | data: {
8 | artD: {
9 |
10 | }
11 | },
12 | onLoad: function (options) {
13 | var that = this;
14 | var id = options.id;
15 | wx.request({
16 |
17 | url: con.getartical,
18 | data: { wxappid: con.wyy_user_wxappid, id: id },
19 |
20 | header: {
21 | "Content-Type": "application/json"
22 | },
23 | success: function (res) {
24 |
25 |
26 | console.log(res.data);
27 | WxParse.wxParse('arta', 'html', res.data.details, that,
28 |
29 | 0);
30 | that.setData({
31 | // artD: res.data
32 | text: res.data.text,
33 | title: res.data.title,
34 | img: res.data.img
35 | })
36 | }
37 | })
38 | },
39 |
40 | })
41 |
42 |
--------------------------------------------------------------------------------
/pages/car/news/newsD/newsD.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/news/newsD/newsD.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 | {{title}}
11 |
12 |
13 | {{text}}
14 |
15 |
16 |
17 |
18 |
21 | {{}}
22 |
23 |
24 |
--------------------------------------------------------------------------------
/pages/car/news/newsD/newsD.wxss:
--------------------------------------------------------------------------------
1 | .carbook_detail {
2 | width:100%;
3 | background: #f3eff1;
4 | }
5 | .carbook_for{
6 | display: flex;
7 | flex-direction: column;
8 | }
9 | .carbook_for image {
10 | width: 100%;
11 | height: 440rpx;
12 | }
13 | .carbook_title {
14 | margin-top: 10px;
15 | background: white;
16 | padding-left: 10px;
17 | text-align: center;
18 | padding-top: 10rpx;
19 | }
20 | .carbook_intro {
21 | background: white;
22 | /* height: 60px; */
23 | font-size: 32rpx;
24 | padding: 10px 10px 10rpx 10px;
25 | letter-spacing: 1px;
26 | }
27 | .carbook_cont {
28 | background: white;
29 | font-size: 32rpx;
30 | letter-spacing: 2px;
31 | margin-top: 10rpx;
32 | }
33 | .wxParse-p{
34 | padding: 10px;
35 | }
--------------------------------------------------------------------------------
/pages/car/news/newsItem/newsItem.js:
--------------------------------------------------------------------------------
1 | var con = require("../../../../utils/data.js");
2 | var app = getApp();
3 | Page({
4 | data: {
5 | list: [],
6 | article: []
7 | },
8 | onLoad: function (options) {
9 | var that = this;
10 | var id = options.id;
11 |
12 | wx.request({
13 | url: con.gettarticallist,
14 | mthod: "GET",
15 | data: { wxappid: con.wyy_user_wxappid, typeid: id },
16 | header: {
17 | "Content-Type": "application/json"
18 | },
19 | success: function (res) {
20 | console.log(res.data.info);
21 | console.log(11111);
22 | that.setData({
23 | articleTwo: res.data.info
24 | })
25 | }
26 | })
27 | },
28 | bindViewD: function (e) {
29 | var len = e.currentTarget.dataset.id;
30 | wx.navigateTo({
31 | url: '../newsD/newsD?id=' + len,
32 | })
33 | }
34 | })
--------------------------------------------------------------------------------
/pages/car/news/newsItem/newsItem.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/car/news/newsItem/newsItem.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{item.title}}
7 |
8 | {{item.text}}
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/pages/car/news/newsItem/newsItem.wxss:
--------------------------------------------------------------------------------
1 | .newsItem_box{
2 | background: #f3eff1;
3 | }
4 | .newsItem_flex{
5 | display: flex;
6 | flex-direction: column;
7 | padding-top: 10rpx;
8 | padding-bottom: 10rpx;
9 | }
10 | .newsItem_for{
11 | padding: 10rpx 20rpx;
12 | display: flex;
13 | justify-content: flex-start;
14 | background: white;
15 | height: 320rpx;
16 | margin-top: 10rpx;
17 | }
18 | .newsItem_for>image{
19 | flex: 2;
20 | height: 300rpx;
21 | padding-top: 10rpx;
22 | margin-right: 20rpx;
23 | }
24 |
25 | .newsItem_cont{
26 | flex: 3;
27 | padding-top: 10rpx;
28 | display: flex;
29 | flex-direction: column;
30 | color: black;
31 | }
32 |
33 | .news_text{
34 | margin-top: 20rpx;
35 | font-size: 32rpx;
36 | line-height: 40rpx;
37 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "setting": {
4 | "urlCheck": true,
5 | "es6": true,
6 | "postcss": true,
7 | "minified": true
8 | },
9 | "compileType": "weapp",
10 | "libVersion": "1.5.4",
11 | "appid": "wx88b898264037d335",
12 | "projectname": "car",
13 | "condition": {
14 | "weapp": {
15 | "current": -1,
16 | "list": []
17 | },
18 | "search": {
19 | "current": -1,
20 | "list": []
21 | },
22 | "conversation": {
23 | "current": -1,
24 | "list": []
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/style/swiper.wxss:
--------------------------------------------------------------------------------
1 | .swiper {
2 | width: 100%;
3 | height: 440rpx;
4 | }
5 |
6 | .swiper image {
7 | width: 100%;
8 | height: 100%;
9 | display: inline-block;
10 | }
11 |
12 | .swiper-item{
13 | position: relative;
14 | }
15 | .filter{
16 | width: 100%;
17 | height: 80rpx;
18 | position: absolute;
19 | bottom: 0;
20 | background: black;
21 | opacity: .4;
22 | }
23 | .hos_text{
24 | position:absolute;
25 | padding: 5rpx 20rpx;
26 | color:white;
27 | font-size: 30rpx;
28 | bottom: 30rpx;
29 | }
--------------------------------------------------------------------------------
/tem/swiper.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{item.info}}
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/utils/data.js:
--------------------------------------------------------------------------------
1 | var WYY_HOST_URL = "https://wxapi.weiyunyi.com";
2 | var type = "Car";
3 | module.exports = {
4 | wyy_host_api_url:WYY_HOST_URL,
5 | wyy_user_wxappid: "6",
6 | wyy_share_info:'',
7 | wyy_config_version:'v',
8 | //命名规范 模块名_方法名
9 | //以下通用方法
10 | //用户登录slogin
11 | index_slogin:WYY_HOST_URL + "/Wap.php/Index/slogin",
12 | //错误日志errorLog
13 | index_errorLog :WYY_HOST_URL + "/Wap.php/Index/errorLog",
14 | //获取分享信息 getShareInfo
15 | index_getShareInfo:WYY_HOST_URL + "/Wap.php/Index/getShareInfo",
16 | //获取用户菜单列表 getUserMenuList
17 | Index_getUserMenuList:WYY_HOST_URL + "/Wap.php/Index/getUserMenuList",
18 | //获取用户信息 getUserInfo
19 | Index_getUserInfo:WYY_HOST_URL + "/Wap.php/Index/getUserInfo",
20 | //编辑用户信息 editUserInfo
21 | Index_editUserInfo:WYY_HOST_URL + "/Wap.php/Index/editUserInfo",
22 | //获取用户支付日志 getUserPaylog
23 | Index_getUserPaylog:WYY_HOST_URL + "/Wap.php/Index/getUserPaylog",
24 | //创建支付数据 makePayData
25 | Index_makePayData:WYY_HOST_URL + "/Wap.php/Index/makePayData",
26 | ////以下医疗行业方法
27 | //获取商家基本信息 getinfo
28 | hospital_getinfo:WYY_HOST_URL + "/Wap.php/"+type+"/getinfo",
29 | //获取商家首页幻灯片 getslide
30 | hospital_getslide:WYY_HOST_URL + "/Wap.php/"+type+"/getslide",
31 | //获取商家分类 gettype
32 | hospital_gettype: WYY_HOST_URL + "/Wap.php/" + type +"/gettype",
33 | //获取图库分组 getphotogroup
34 | hospital_getphotogroup: WYY_HOST_URL + "/Wap.php/" + type +"/getphotogroup",
35 | //获取图库图片 getphoto
36 | hospital_getphoto: WYY_HOST_URL + "/Wap.php/" + type +"/getphoto",
37 | //获取文章 getartical
38 | hospital_getartical: WYY_HOST_URL + "/Wap.php/" + type +"/getartical",
39 | //获取预约列表 getprelist
40 | hospital_getprelist: WYY_HOST_URL + "/Wap.php/" + type +"/getprelist",
41 | //获取预约详情 getpre
42 | hospital_getpre: WYY_HOST_URL + "/Wap.php/" + type +"/getpre",
43 | //提交预约信息 prerecord
44 | hospital_postprerecord: WYY_HOST_URL + "/Wap.php/" + type +"/postprerecord",
45 | //获取评价信息 getevaluation
46 | hospital_getevaluation: WYY_HOST_URL + "/Wap.php/" + type +"/getevaluation",
47 | // 获取首页文章列表
48 | homegetartical: WYY_HOST_URL + "/Wap.php/" + type +"/homegetartical",
49 | //文章列表
50 | gettarticallist: WYY_HOST_URL + "/Wap.php/" + type + "/gettarticallist",
51 | // 首页图库分组
52 | homegetphotogroup: WYY_HOST_URL + "/Wap.php/" + type + "/homegetphotogroup",
53 | // 首页预约列表
54 | homegetprelist: WYY_HOST_URL + "/Wap.php/" + type + "/homegetprelist",
55 | // 文章
56 | getartical: WYY_HOST_URL + "/Wap.php/" + type + "/getartical",
57 | // 图库详情
58 | getphotodetail: WYY_HOST_URL + "/Wap.php/" + type + "/getphotodetail",
59 | getmap: WYY_HOST_URL + "/Wap.php/" + type + "/getmap",
60 | //汽车车系
61 | getserieslist: WYY_HOST_URL + "/Wap.php/" + type + "/getserieslist",
62 | //获取车型
63 | getmodellist: WYY_HOST_URL + "/Wap.php/" + type + "/getmodellist",
64 | //车型详情
65 | getmodeldetail: WYY_HOST_URL + "/Wap.php/" + type + "/getmodeldetail",
66 | // 获取视频
67 | // http://wxapi.weiyunyi.com/Wap.php?c=Weeding&a=getvideo&wxappid=14
68 | getvideo: WYY_HOST_URL + "/Wap.php/" + type + "/getvideo",
69 | // 获取域名
70 | get_copyright: WYY_HOST_URL + "/Wap.php/" + type + "/get_copyright"
71 | }
--------------------------------------------------------------------------------
/utils/qqmap-wx-jssdk.min.js:
--------------------------------------------------------------------------------
1 | var _createClass=function(){function a(e,c){for(var b=0;b\n/, '')
52 | .replace(/<.*!doctype.*\>\n/, '')
53 | .replace(/<.*!DOCTYPE.*\>\n/, '');
54 | }
55 |
56 |
57 | function html2json(html, bindName) {
58 | //处理字符串
59 | html = removeDOCTYPE(html);
60 | html = wxDiscode.strDiscode(html);
61 | //生成node节点
62 | var bufArray = [];
63 | var results = {
64 | node: bindName,
65 | nodes: [],
66 | images:[],
67 | imageUrls:[]
68 | };
69 | var index = 0;
70 | HTMLParser(html, {
71 | start: function (tag, attrs, unary) {
72 | //debug(tag, attrs, unary);
73 | // node for this element
74 | var node = {
75 | node: 'element',
76 | tag: tag,
77 | };
78 |
79 | if (bufArray.length === 0) {
80 | node.index = index.toString()
81 | index += 1
82 | } else {
83 | var parent = bufArray[0];
84 | if (parent.nodes === undefined) {
85 | parent.nodes = [];
86 | }
87 | node.index = parent.index + '.' + parent.nodes.length
88 | }
89 |
90 | if (block[tag]) {
91 | node.tagType = "block";
92 | } else if (inline[tag]) {
93 | node.tagType = "inline";
94 | } else if (closeSelf[tag]) {
95 | node.tagType = "closeSelf";
96 | }
97 |
98 | if (attrs.length !== 0) {
99 | node.attr = attrs.reduce(function (pre, attr) {
100 | var name = attr.name;
101 | var value = attr.value;
102 | if (name == 'class') {
103 | console.dir(value);
104 | // value = value.join("")
105 | node.classStr = value;
106 | }
107 | // has multi attibutes
108 | // make it array of attribute
109 | if (name == 'style') {
110 | console.dir(value);
111 | // value = value.join("")
112 | node.styleStr = value;
113 | }
114 | if (value.match(/ /)) {
115 | value = value.split(' ');
116 | }
117 |
118 |
119 | // if attr already exists
120 | // merge it
121 | if (pre[name]) {
122 | if (Array.isArray(pre[name])) {
123 | // already array, push to last
124 | pre[name].push(value);
125 | } else {
126 | // single value, make it array
127 | pre[name] = [pre[name], value];
128 | }
129 | } else {
130 | // not exist, put it
131 | pre[name] = value;
132 | }
133 |
134 | return pre;
135 | }, {});
136 | }
137 |
138 | //对img添加额外数据
139 | if (node.tag === 'img') {
140 | node.imgIndex = results.images.length;
141 | var imgUrl = node.attr.src;
142 | if (imgUrl[0] == '') {
143 | imgUrl.splice(0, 1);
144 | }
145 | imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps);
146 | node.attr.src = imgUrl;
147 | node.from = bindName;
148 | results.images.push(node);
149 | results.imageUrls.push(imgUrl);
150 | }
151 |
152 | // 处理font标签样式属性
153 | if (node.tag === 'font') {
154 | var fontSize = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
155 | var styleAttrs = {
156 | 'color': 'color',
157 | 'face': 'font-family',
158 | 'size': 'font-size'
159 | };
160 | if (!node.attr.style) node.attr.style = [];
161 | if (!node.styleStr) node.styleStr = '';
162 | for (var key in styleAttrs) {
163 | if (node.attr[key]) {
164 | var value = key === 'size' ? fontSize[node.attr[key]-1] : node.attr[key];
165 | node.attr.style.push(styleAttrs[key]);
166 | node.attr.style.push(value);
167 | node.styleStr += styleAttrs[key] + ': ' + value + ';';
168 | }
169 | }
170 | }
171 |
172 | //临时记录source资源
173 | if(node.tag === 'source'){
174 | results.source = node.attr.src;
175 | }
176 |
177 | if (unary) {
178 | // if this tag dosen't have end tag
179 | // like
180 | // add to parents
181 | var parent = bufArray[0] || results;
182 | if (parent.nodes === undefined) {
183 | parent.nodes = [];
184 | }
185 | parent.nodes.push(node);
186 | } else {
187 | bufArray.unshift(node);
188 | }
189 | },
190 | end: function (tag) {
191 | //debug(tag);
192 | // merge into parent tag
193 | var node = bufArray.shift();
194 | if (node.tag !== tag) console.error('invalid state: mismatch end tag');
195 |
196 | //当有缓存source资源时于于video补上src资源
197 | if(node.tag === 'video' && results.source){
198 | node.attr.src = results.source;
199 | delete result.source;
200 | }
201 |
202 | if (bufArray.length === 0) {
203 | results.nodes.push(node);
204 | } else {
205 | var parent = bufArray[0];
206 | if (parent.nodes === undefined) {
207 | parent.nodes = [];
208 | }
209 | parent.nodes.push(node);
210 | }
211 | },
212 | chars: function (text) {
213 | //debug(text);
214 | var node = {
215 | node: 'text',
216 | text: text,
217 | textArray:transEmojiStr(text)
218 | };
219 |
220 | if (bufArray.length === 0) {
221 | results.nodes.push(node);
222 | } else {
223 | var parent = bufArray[0];
224 | if (parent.nodes === undefined) {
225 | parent.nodes = [];
226 | }
227 | node.index = parent.index + '.' + parent.nodes.length
228 | parent.nodes.push(node);
229 | }
230 | },
231 | comment: function (text) {
232 | //debug(text);
233 | // var node = {
234 | // node: 'comment',
235 | // text: text,
236 | // };
237 | // var parent = bufArray[0];
238 | // if (parent.nodes === undefined) {
239 | // parent.nodes = [];
240 | // }
241 | // parent.nodes.push(node);
242 | },
243 | });
244 | return results;
245 | };
246 |
247 | function transEmojiStr(str){
248 | // var eReg = new RegExp("["+__reg+' '+"]");
249 | // str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
250 |
251 | var emojiObjs = [];
252 | //如果正则表达式为空
253 | if(__emojisReg.length == 0 || !__emojis){
254 | var emojiObj = {}
255 | emojiObj.node = "text";
256 | emojiObj.text = str;
257 | array = [emojiObj];
258 | return array;
259 | }
260 | //这个地方需要调整
261 | str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
262 | var eReg = new RegExp("[:]");
263 | var array = str.split(eReg);
264 | for(var i = 0; i < array.length; i++){
265 | var ele = array[i];
266 | var emojiObj = {};
267 | if(__emojis[ele]){
268 | emojiObj.node = "element";
269 | emojiObj.tag = "emoji";
270 | emojiObj.text = __emojis[ele];
271 | emojiObj.baseSrc= __emojisBaseSrc;
272 | }else{
273 | emojiObj.node = "text";
274 | emojiObj.text = ele;
275 | }
276 | emojiObjs.push(emojiObj);
277 | }
278 |
279 | return emojiObjs;
280 | }
281 |
282 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
283 | __emojisReg = reg;
284 | __emojisBaseSrc=baseSrc;
285 | __emojis=emojis;
286 | }
287 |
288 | module.exports = {
289 | html2json: html2json,
290 | emojisInit:emojisInit
291 | };
292 |
293 |
--------------------------------------------------------------------------------
/wxParse/htmlparser.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
4 | *
5 | * author: Di (微信小程序开发工程师)
6 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
7 | * 垂直微信小程序开发交流社区
8 | *
9 | * github地址: https://github.com/icindy/wxParse
10 | *
11 | * for: 微信小程序富文本解析
12 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
13 | */
14 | // Regular Expressions for parsing tags and attributes
15 | var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
16 | endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
17 | attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
18 |
19 | // Empty Elements - HTML 5
20 | var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
21 |
22 | // Block Elements - HTML 5
23 | var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
24 |
25 | // Inline Elements - HTML 5
26 | var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
27 |
28 | // Elements that you can, intentionally, leave open
29 | // (and which close themselves)
30 | var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
31 |
32 | // Attributes that have their values filled in disabled="disabled"
33 | var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
34 |
35 | // Special Elements (can contain anything)
36 | var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
37 |
38 | function HTMLParser(html, handler) {
39 | var index, chars, match, stack = [], last = html;
40 | stack.last = function () {
41 | return this[this.length - 1];
42 | };
43 |
44 | while (html) {
45 | chars = true;
46 |
47 | // Make sure we're not in a script or style element
48 | if (!stack.last() || !special[stack.last()]) {
49 |
50 | // Comment
51 | if (html.indexOf("");
53 |
54 | if (index >= 0) {
55 | if (handler.comment)
56 | handler.comment(html.substring(4, index));
57 | html = html.substring(index + 3);
58 | chars = false;
59 | }
60 |
61 | // end tag
62 | } else if (html.indexOf("") == 0) {
63 | match = html.match(endTag);
64 |
65 | if (match) {
66 | html = html.substring(match[0].length);
67 | match[0].replace(endTag, parseEndTag);
68 | chars = false;
69 | }
70 |
71 | // start tag
72 | } else if (html.indexOf("<") == 0) {
73 | match = html.match(startTag);
74 |
75 | if (match) {
76 | html = html.substring(match[0].length);
77 | match[0].replace(startTag, parseStartTag);
78 | chars = false;
79 | }
80 | }
81 |
82 | if (chars) {
83 | index = html.indexOf("<");
84 | var text = ''
85 | while (index === 0) {
86 | text += "<";
87 | html = html.substring(1);
88 | index = html.indexOf("<");
89 | }
90 | text += index < 0 ? html : html.substring(0, index);
91 | html = index < 0 ? "" : html.substring(index);
92 |
93 | if (handler.chars)
94 | handler.chars(text);
95 | }
96 |
97 | } else {
98 |
99 | html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
100 | text = text.replace(/|/g, "$1$2");
101 | if (handler.chars)
102 | handler.chars(text);
103 |
104 | return "";
105 | });
106 |
107 |
108 | parseEndTag("", stack.last());
109 | }
110 |
111 | if (html == last)
112 | throw "Parse Error: " + html;
113 | last = html;
114 | }
115 |
116 | // Clean up any remaining tags
117 | parseEndTag();
118 |
119 | function parseStartTag(tag, tagName, rest, unary) {
120 | tagName = tagName.toLowerCase();
121 |
122 | if (block[tagName]) {
123 | while (stack.last() && inline[stack.last()]) {
124 | parseEndTag("", stack.last());
125 | }
126 | }
127 |
128 | if (closeSelf[tagName] && stack.last() == tagName) {
129 | parseEndTag("", tagName);
130 | }
131 |
132 | unary = empty[tagName] || !!unary;
133 |
134 | if (!unary)
135 | stack.push(tagName);
136 |
137 | if (handler.start) {
138 | var attrs = [];
139 |
140 | rest.replace(attr, function (match, name) {
141 | var value = arguments[2] ? arguments[2] :
142 | arguments[3] ? arguments[3] :
143 | arguments[4] ? arguments[4] :
144 | fillAttrs[name] ? name : "";
145 |
146 | attrs.push({
147 | name: name,
148 | value: value,
149 | escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
150 | });
151 | });
152 |
153 | if (handler.start) {
154 | handler.start(tagName, attrs, unary);
155 | }
156 |
157 | }
158 | }
159 |
160 | function parseEndTag(tag, tagName) {
161 | // If no tag name is provided, clean shop
162 | if (!tagName)
163 | var pos = 0;
164 |
165 | // Find the closest opened tag of the same type
166 | else {
167 | tagName = tagName.toLowerCase();
168 | for (var pos = stack.length - 1; pos >= 0; pos--)
169 | if (stack[pos] == tagName)
170 | break;
171 | }
172 | if (pos >= 0) {
173 | // Close all the open elements, up the stack
174 | for (var i = stack.length - 1; i >= pos; i--)
175 | if (handler.end)
176 | handler.end(stack[i]);
177 |
178 | // Remove the open elements from the stack
179 | stack.length = pos;
180 | }
181 | }
182 | };
183 |
184 |
185 | function makeMap(str) {
186 | var obj = {}, items = str.split(",");
187 | for (var i = 0; i < items.length; i++)
188 | obj[items[i]] = true;
189 | return obj;
190 | }
191 |
192 | module.exports = HTMLParser;
193 |
--------------------------------------------------------------------------------
/wxParse/wxDiscode.js:
--------------------------------------------------------------------------------
1 | // HTML 支持的数学符号
2 | function strNumDiscode(str){
3 | str = str.replace(/∀/g, '∀');
4 | str = str.replace(/∂/g, '∂');
5 | str = str.replace(/&exists;/g, '∃');
6 | str = str.replace(/∅/g, '∅');
7 | str = str.replace(/∇/g, '∇');
8 | str = str.replace(/∈/g, '∈');
9 | str = str.replace(/∉/g, '∉');
10 | str = str.replace(/∋/g, '∋');
11 | str = str.replace(/∏/g, '∏');
12 | str = str.replace(/∑/g, '∑');
13 | str = str.replace(/−/g, '−');
14 | str = str.replace(/∗/g, '∗');
15 | str = str.replace(/√/g, '√');
16 | str = str.replace(/∝/g, '∝');
17 | str = str.replace(/∞/g, '∞');
18 | str = str.replace(/∠/g, '∠');
19 | str = str.replace(/∧/g, '∧');
20 | str = str.replace(/∨/g, '∨');
21 | str = str.replace(/∩/g, '∩');
22 | str = str.replace(/∩/g, '∪');
23 | str = str.replace(/∫/g, '∫');
24 | str = str.replace(/∴/g, '∴');
25 | str = str.replace(/∼/g, '∼');
26 | str = str.replace(/≅/g, '≅');
27 | str = str.replace(/≈/g, '≈');
28 | str = str.replace(/≠/g, '≠');
29 | str = str.replace(/≤/g, '≤');
30 | str = str.replace(/≥/g, '≥');
31 | str = str.replace(/⊂/g, '⊂');
32 | str = str.replace(/⊃/g, '⊃');
33 | str = str.replace(/⊄/g, '⊄');
34 | str = str.replace(/⊆/g, '⊆');
35 | str = str.replace(/⊇/g, '⊇');
36 | str = str.replace(/⊕/g, '⊕');
37 | str = str.replace(/⊗/g, '⊗');
38 | str = str.replace(/⊥/g, '⊥');
39 | str = str.replace(/⋅/g, '⋅');
40 | return str;
41 | }
42 |
43 | //HTML 支持的希腊字母
44 | function strGreeceDiscode(str){
45 | str = str.replace(/Α/g, 'Α');
46 | str = str.replace(/Β/g, 'Β');
47 | str = str.replace(/Γ/g, 'Γ');
48 | str = str.replace(/Δ/g, 'Δ');
49 | str = str.replace(/Ε/g, 'Ε');
50 | str = str.replace(/Ζ/g, 'Ζ');
51 | str = str.replace(/Η/g, 'Η');
52 | str = str.replace(/Θ/g, 'Θ');
53 | str = str.replace(/Ι/g, 'Ι');
54 | str = str.replace(/Κ/g, 'Κ');
55 | str = str.replace(/Λ/g, 'Λ');
56 | str = str.replace(/Μ/g, 'Μ');
57 | str = str.replace(/Ν/g, 'Ν');
58 | str = str.replace(/Ξ/g, 'Ν');
59 | str = str.replace(/Ο/g, 'Ο');
60 | str = str.replace(/Π/g, 'Π');
61 | str = str.replace(/Ρ/g, 'Ρ');
62 | str = str.replace(/Σ/g, 'Σ');
63 | str = str.replace(/Τ/g, 'Τ');
64 | str = str.replace(/Υ/g, 'Υ');
65 | str = str.replace(/Φ/g, 'Φ');
66 | str = str.replace(/Χ/g, 'Χ');
67 | str = str.replace(/Ψ/g, 'Ψ');
68 | str = str.replace(/Ω/g, 'Ω');
69 |
70 | str = str.replace(/α/g, 'α');
71 | str = str.replace(/β/g, 'β');
72 | str = str.replace(/γ/g, 'γ');
73 | str = str.replace(/δ/g, 'δ');
74 | str = str.replace(/ε/g, 'ε');
75 | str = str.replace(/ζ/g, 'ζ');
76 | str = str.replace(/η/g, 'η');
77 | str = str.replace(/θ/g, 'θ');
78 | str = str.replace(/ι/g, 'ι');
79 | str = str.replace(/κ/g, 'κ');
80 | str = str.replace(/λ/g, 'λ');
81 | str = str.replace(/μ/g, 'μ');
82 | str = str.replace(/ν/g, 'ν');
83 | str = str.replace(/ξ/g, 'ξ');
84 | str = str.replace(/ο/g, 'ο');
85 | str = str.replace(/π/g, 'π');
86 | str = str.replace(/ρ/g, 'ρ');
87 | str = str.replace(/ς/g, 'ς');
88 | str = str.replace(/σ/g, 'σ');
89 | str = str.replace(/τ/g, 'τ');
90 | str = str.replace(/υ/g, 'υ');
91 | str = str.replace(/φ/g, 'φ');
92 | str = str.replace(/χ/g, 'χ');
93 | str = str.replace(/ψ/g, 'ψ');
94 | str = str.replace(/ω/g, 'ω');
95 | str = str.replace(/ϑ/g, 'ϑ');
96 | str = str.replace(/ϒ/g, 'ϒ');
97 | str = str.replace(/ϖ/g, 'ϖ');
98 | str = str.replace(/·/g, '·');
99 | return str;
100 | }
101 |
102 | //
103 |
104 | function strcharacterDiscode(str){
105 | // 加入常用解析
106 | str = str.replace(/ /g, ' ');
107 | str = str.replace(/"/g, "'");
108 | str = str.replace(/&/g, '&');
109 | // str = str.replace(/</g, '‹');
110 | // str = str.replace(/>/g, '›');
111 |
112 | str = str.replace(/</g, '<');
113 | str = str.replace(/>/g, '>');
114 |
115 | return str;
116 | }
117 |
118 | // HTML 支持的其他实体
119 | function strOtherDiscode(str){
120 | str = str.replace(/Œ/g, 'Œ');
121 | str = str.replace(/œ/g, 'œ');
122 | str = str.replace(/Š/g, 'Š');
123 | str = str.replace(/š/g, 'š');
124 | str = str.replace(/Ÿ/g, 'Ÿ');
125 | str = str.replace(/ƒ/g, 'ƒ');
126 | str = str.replace(/ˆ/g, 'ˆ');
127 | str = str.replace(/˜/g, '˜');
128 | str = str.replace(/ /g, '');
129 | str = str.replace(/ /g, '');
130 | str = str.replace(/ /g, '');
131 | str = str.replace(//g, '');
132 | str = str.replace(//g, '');
133 | str = str.replace(//g, '');
134 | str = str.replace(//g, '');
135 | str = str.replace(/–/g, '–');
136 | str = str.replace(/—/g, '—');
137 | str = str.replace(/‘/g, '‘');
138 | str = str.replace(/’/g, '’');
139 | str = str.replace(/‚/g, '‚');
140 | str = str.replace(/“/g, '“');
141 | str = str.replace(/”/g, '”');
142 | str = str.replace(/„/g, '„');
143 | str = str.replace(/†/g, '†');
144 | str = str.replace(/‡/g, '‡');
145 | str = str.replace(/•/g, '•');
146 | str = str.replace(/…/g, '…');
147 | str = str.replace(/‰/g, '‰');
148 | str = str.replace(/′/g, '′');
149 | str = str.replace(/″/g, '″');
150 | str = str.replace(/‹/g, '‹');
151 | str = str.replace(/›/g, '›');
152 | str = str.replace(/‾/g, '‾');
153 | str = str.replace(/€/g, '€');
154 | str = str.replace(/™/g, '™');
155 |
156 | str = str.replace(/←/g, '←');
157 | str = str.replace(/↑/g, '↑');
158 | str = str.replace(/→/g, '→');
159 | str = str.replace(/↓/g, '↓');
160 | str = str.replace(/↔/g, '↔');
161 | str = str.replace(/↵/g, '↵');
162 | str = str.replace(/⌈/g, '⌈');
163 | str = str.replace(/⌉/g, '⌉');
164 |
165 | str = str.replace(/⌊/g, '⌊');
166 | str = str.replace(/⌋/g, '⌋');
167 | str = str.replace(/◊/g, '◊');
168 | str = str.replace(/♠/g, '♠');
169 | str = str.replace(/♣/g, '♣');
170 | str = str.replace(/♥/g, '♥');
171 |
172 | str = str.replace(/♦/g, '♦');
173 | str = str.replace(/'/g, '\'');
174 | return str;
175 | }
176 |
177 | function strMoreDiscode(str){
178 | str = str.replace(/\r\n/g,"");
179 | str = str.replace(/\n/g,"");
180 |
181 | str = str.replace(/code/g,"wxxxcode-style");
182 | return str;
183 | }
184 |
185 | function strDiscode(str){
186 | str = strNumDiscode(str);
187 | str = strGreeceDiscode(str);
188 | str = strcharacterDiscode(str);
189 | str = strOtherDiscode(str);
190 | str = strMoreDiscode(str);
191 | return str;
192 | }
193 | function urlToHttpUrl(url,rep){
194 |
195 | var patt1 = new RegExp("^//");
196 | var result = patt1.test(url);
197 | if(result){
198 | url = rep+":"+url;
199 | }
200 | return url;
201 | }
202 |
203 | module.exports = {
204 | strDiscode:strDiscode,
205 | urlToHttpUrl:urlToHttpUrl
206 | }
--------------------------------------------------------------------------------
/wxParse/wxParse.js:
--------------------------------------------------------------------------------
1 | /**
2 | * author: Di (微信小程序开发工程师)
3 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
4 | * 垂直微信小程序开发交流社区
5 | *
6 | * github地址: https://github.com/icindy/wxParse
7 | *
8 | * for: 微信小程序富文本解析
9 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
10 | */
11 |
12 | /**
13 | * utils函数引入
14 | **/
15 | import showdown from './showdown.js';
16 | import HtmlToJson from './html2json.js';
17 | /**
18 | * 配置及公有属性
19 | **/
20 | var realWindowWidth = 0;
21 | var realWindowHeight = 0;
22 | wx.getSystemInfo({
23 | success: function (res) {
24 | realWindowWidth = res.windowWidth
25 | realWindowHeight = res.windowHeight
26 | }
27 | })
28 | /**
29 | * 主函数入口区
30 | **/
31 | function wxParse(bindName = 'wxParseData', type='html', data='数据不能为空
', target,imagePadding) {
32 | var that = target;
33 | var transData = {};//存放转化后的数据
34 | if (type == 'html') {
35 | transData = HtmlToJson.html2json(data, bindName);
36 | console.log(JSON.stringify(transData, ' ', ' '));
37 | } else if (type == 'md' || type == 'markdown') {
38 | var converter = new showdown.Converter();
39 | var html = converter.makeHtml(data);
40 | transData = HtmlToJson.html2json(html, bindName);
41 | console.log(JSON.stringify(transData, ' ', ' '));
42 | }
43 | transData.view = {};
44 | transData.view.imagePadding = 0;
45 | if(typeof(imagePadding) != 'undefined'){
46 | transData.view.imagePadding = imagePadding
47 | }
48 | var bindData = {};
49 | bindData[bindName] = transData;
50 | that.setData(bindData)
51 | that.wxParseImgLoad = wxParseImgLoad;
52 | that.wxParseImgTap = wxParseImgTap;
53 | }
54 | // 图片点击事件
55 | function wxParseImgTap(e) {
56 | var that = this;
57 | var nowImgUrl = e.target.dataset.src;
58 | var tagFrom = e.target.dataset.from;
59 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
60 | wx.previewImage({
61 | current: nowImgUrl, // 当前显示图片的http链接
62 | urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表
63 | })
64 | }
65 | }
66 |
67 | /**
68 | * 图片视觉宽高计算函数区
69 | **/
70 | function wxParseImgLoad(e) {
71 | var that = this;
72 | var tagFrom = e.target.dataset.from;
73 | var idx = e.target.dataset.idx;
74 | if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) {
75 | calMoreImageInfo(e, idx, that, tagFrom)
76 | }
77 | }
78 | // 假循环获取计算图片视觉最佳宽高
79 | function calMoreImageInfo(e, idx, that, bindName) {
80 | var temData = that.data[bindName];
81 | if (!temData || temData.images.length == 0) {
82 | return;
83 | }
84 | var temImages = temData.images;
85 | //因为无法获取view宽度 需要自定义padding进行计算,稍后处理
86 | var recal = wxAutoImageCal(e.detail.width, e.detail.height,that,bindName);
87 | // temImages[idx].width = recal.imageWidth;
88 | // temImages[idx].height = recal.imageheight;
89 | // temData.images = temImages;
90 | // var bindData = {};
91 | // bindData[bindName] = temData;
92 | // that.setData(bindData);
93 | var index = temImages[idx].index
94 | var key = `${bindName}`
95 | for (var i of index.split('.')) key+=`.nodes[${i}]`
96 | var keyW = key + '.width'
97 | var keyH = key + '.height'
98 | that.setData({
99 | [keyW]: recal.imageWidth,
100 | [keyH]: recal.imageheight,
101 | })
102 | }
103 |
104 | // 计算视觉优先的图片宽高
105 | function wxAutoImageCal(originalWidth, originalHeight,that,bindName) {
106 | //获取图片的原始长宽
107 | var windowWidth = 0, windowHeight = 0;
108 | var autoWidth = 0, autoHeight = 0;
109 | var results = {};
110 | var padding = that.data[bindName].view.imagePadding;
111 | windowWidth = realWindowWidth-2*padding;
112 | windowHeight = realWindowHeight;
113 | //判断按照那种方式进行缩放
114 | // console.log("windowWidth" + windowWidth);
115 | if (originalWidth > windowWidth) {//在图片width大于手机屏幕width时候
116 | autoWidth = windowWidth;
117 | // console.log("autoWidth" + autoWidth);
118 | autoHeight = (autoWidth * originalHeight) / originalWidth;
119 | // console.log("autoHeight" + autoHeight);
120 | results.imageWidth = autoWidth;
121 | results.imageheight = autoHeight;
122 | } else {//否则展示原来的数据
123 | results.imageWidth = originalWidth;
124 | results.imageheight = originalHeight;
125 | }
126 | return results;
127 | }
128 |
129 | function wxParseTemArray(temArrayName,bindNameReg,total,that){
130 | var array = [];
131 | var temData = that.data;
132 | var obj = null;
133 | for(var i = 0; i < total; i++){
134 | var simArr = temData[bindNameReg+i].nodes;
135 | array.push(simArr);
136 | }
137 |
138 | temArrayName = temArrayName || 'wxParseTemArray';
139 | obj = JSON.parse('{"'+ temArrayName +'":""}');
140 | obj[temArrayName] = array;
141 | that.setData(obj);
142 | }
143 |
144 | /**
145 | * 配置emojis
146 | *
147 | */
148 |
149 | function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
150 | HtmlToJson.emojisInit(reg,baseSrc,emojis);
151 | }
152 |
153 | module.exports = {
154 | wxParse: wxParse,
155 | wxParseTemArray:wxParseTemArray,
156 | emojisInit:emojisInit
157 | }
158 |
159 |
160 |
--------------------------------------------------------------------------------
/wxParse/wxParse.wxml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | {{item.text}}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
--------------------------------------------------------------------------------
/wxParse/wxParse.wxss:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * author: Di (微信小程序开发工程师)
4 | * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
5 | * 垂直微信小程序开发交流社区
6 | *
7 | * github地址: https://github.com/icindy/wxParse
8 | *
9 | * for: 微信小程序富文本解析
10 | * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
11 | */
12 |
13 | .wxParse{
14 | margin: 0 5px;
15 | font-family: Helvetica,sans-serif;
16 | font-size: 28rpx;
17 | color: #666;
18 | line-height: 1.8;
19 | }
20 | view{
21 | word-break:break-all; overflow:auto;
22 | }
23 | .wxParse-inline{
24 | display: inline;
25 | margin: 0;
26 | padding: 0;
27 | }
28 | /*//标题 */
29 | .wxParse-div{margin: 0;padding: 0;}
30 | .wxParse-h1{ font-size:2em; margin: .67em 0 }
31 | .wxParse-h2{ font-size:1.5em; margin: .75em 0 }
32 | .wxParse-h3{ font-size:1.17em; margin: .83em 0 }
33 | .wxParse-h4{ margin: 1.12em 0}
34 | .wxParse-h5 { font-size:.83em; margin: 1.5em 0 }
35 | .wxParse-h6{ font-size:.75em; margin: 1.67em 0 }
36 |
37 | .wxParse-h1 {
38 | font-size: 18px;
39 | font-weight: 400;
40 | margin-bottom: .9em;
41 | }
42 | .wxParse-h2 {
43 | font-size: 16px;
44 | font-weight: 400;
45 | margin-bottom: .34em;
46 | }
47 | .wxParse-h3 {
48 | font-weight: 400;
49 | font-size: 15px;
50 | margin-bottom: .34em;
51 | }
52 | .wxParse-h4 {
53 | font-weight: 400;
54 | font-size: 14px;
55 | margin-bottom: .24em;
56 | }
57 | .wxParse-h5 {
58 | font-weight: 400;
59 | font-size: 13px;
60 | margin-bottom: .14em;
61 | }
62 | .wxParse-h6 {
63 | font-weight: 400;
64 | font-size: 12px;
65 | margin-bottom: .04em;
66 | }
67 |
68 | .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
69 |
70 | .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
71 | .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
72 | .wxParse-pre{white-space:pre}
73 | .wxParse-big{font-size:1.17em}
74 | .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
75 | .wxParse-sub{vertical-align:sub}
76 | .wxParse-sup{vertical-align:super}
77 | .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
78 | /*wxparse-自定义个性化的css样式*/
79 | /*增加video的css样式*/
80 | .wxParse-strong,.wxParse-s{display: inline}
81 | .wxParse-a{
82 | color: deepskyblue;
83 | word-break:break-all;
84 | overflow:auto;
85 | }
86 |
87 | .wxParse-video{
88 | text-align: center;
89 | margin: 10px 0;
90 | }
91 |
92 | .wxParse-video-video{
93 | width:100%;
94 | }
95 |
96 | .wxParse-img{
97 | /*background-color: #efefef;*/
98 | overflow: hidden;
99 | }
100 |
101 | .wxParse-blockquote {
102 | margin: 0;
103 | padding:10px 0 10px 5px;
104 | font-family:Courier, Calibri,"宋体";
105 | background:#f5f5f5;
106 | border-left: 3px solid #dbdbdb;
107 | }
108 |
109 | .wxParse-code,.wxParse-wxxxcode-style{
110 | display: inline;
111 | background:#f5f5f5;
112 | }
113 | .wxParse-ul{
114 | margin: 20rpx 10rpx;
115 | }
116 |
117 | .wxParse-li,.wxParse-li-inner{
118 | display: flex;
119 | align-items: baseline;
120 | margin: 10rpx 0;
121 | }
122 | .wxParse-li-text{
123 |
124 | align-items: center;
125 | line-height: 20px;
126 | }
127 |
128 | .wxParse-li-circle{
129 | display: inline-flex;
130 | width: 5px;
131 | height: 5px;
132 | background-color: #333;
133 | margin-right: 5px;
134 | }
135 |
136 | .wxParse-li-square{
137 | display: inline-flex;
138 | width: 10rpx;
139 | height: 10rpx;
140 | background-color: #333;
141 | margin-right: 5px;
142 | }
143 | .wxParse-li-ring{
144 | display: inline-flex;
145 | width: 10rpx;
146 | height: 10rpx;
147 | border: 2rpx solid #333;
148 | border-radius: 50%;
149 | background-color: #fff;
150 | margin-right: 5px;
151 | }
152 |
153 | /*.wxParse-table{
154 | width: 100%;
155 | height: 400px;
156 | }
157 | .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
158 | display: flex;
159 | flex-direction: row;
160 | }
161 | .wxParse-th,.wxParse-td{
162 | display: flex;
163 | width: 580px;
164 | overflow: auto;
165 | }*/
166 |
167 | .wxParse-u {
168 | text-decoration: underline;
169 | }
170 | .wxParse-hide{
171 | display: none;
172 | }
173 | .WxEmojiView{
174 | align-items: center;
175 | }
176 | .wxEmoji{
177 | width: 16px;
178 | height:16px;
179 | }
180 | .wxParse-tr{
181 | display: flex;
182 | border-right:1px solid #e0e0e0;
183 | border-bottom:1px solid #e0e0e0;
184 | border-top:1px solid #e0e0e0;
185 | }
186 | .wxParse-th,
187 | .wxParse-td{
188 | flex:1;
189 | padding:5px;
190 | font-size:28rpx;
191 | border-left:1px solid #e0e0e0;
192 | word-break: break-all;
193 | }
194 | .wxParse-td:last{
195 | border-top:1px solid #e0e0e0;
196 | }
197 | .wxParse-th{
198 | background:#f0f0f0;
199 | border-top:1px solid #e0e0e0;
200 | }
201 | .wxParse-del{
202 | display: inline;
203 | }
204 |
--------------------------------------------------------------------------------