├── .idea
├── hotel自己.iml
├── modules.xml
└── vcs.xml
├── README.md
├── app.js
├── app.json
├── app.wxss
├── images
├── book.png
├── book1.png
├── home.png
├── home1.png
├── map.png
├── mine.png
└── mine1.png
├── pages
├── hotel
│ ├── book
│ │ ├── book.js
│ │ ├── book.json
│ │ ├── book.wxml
│ │ ├── book.wxss
│ │ └── detail
│ │ │ └── roomdetail
│ │ │ ├── roomdetail.js
│ │ │ ├── roomdetail.json
│ │ │ ├── roomdetail.wxml
│ │ │ └── roomdetail.wxss
│ ├── home
│ │ ├── detail
│ │ │ └── roomdetail
│ │ │ │ ├── roomdetail.js
│ │ │ │ ├── roomdetail.json
│ │ │ │ ├── roomdetail.wxml
│ │ │ │ └── roomdetail.wxss
│ │ ├── home.js
│ │ ├── home.json
│ │ ├── home.wxml
│ │ └── home.wxss
│ └── mine
│ │ ├── mine.js
│ │ ├── mine.json
│ │ ├── mine.wxml
│ │ ├── mine.wxss
│ │ └── orderdetail
│ │ ├── orderdetail.js
│ │ ├── orderdetail.json
│ │ ├── orderdetail.wxml
│ │ └── orderdetail.wxss
└── logs
│ ├── logs.js
│ ├── logs.json
│ ├── logs.wxml
│ └── logs.wxss
├── 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
└── 效果图预览
├── 微信截图_20171011164947.png
├── 微信截图_20171011165019.png
├── 微信截图_20171011165033.png
├── 微信截图_20171011165053.png
├── 微信截图_20171011165124.png
└── 微信截图_20171011175601.png
/.idea/hotel自己.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # hellohotel
2 | 这是一个酒店预订的小程序,支持在线下订单,在线支付,订单查看
3 | 
4 | 
5 | 
6 | 
7 | 
8 | 
9 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | var con = require("utils/data.js");
2 | App({
3 | onLaunch: function () {
4 | //调用API从本地缓存中获取数据
5 | var logs = wx.getStorageSync('logs') || []
6 | logs.unshift(Date.now())
7 | wx.setStorageSync('logs', logs)
8 | },
9 | getUserInfo: function (cb) {
10 | var that = this
11 | if (this.globalData.userInfo) {
12 | typeof cb == "function" && cb(this.globalData.userInfo)
13 | } else {
14 | //调用登录接口
15 | wx.login({
16 | success: function (o) {
17 | // console.log(o);
18 | wx.getUserInfo({
19 | success: function (res) {
20 | wx.request({
21 | url: con.index_slogin,
22 | method: "POST",
23 | header: {
24 | 'content-type': 'application/x-www-form-urlencoded'
25 | },
26 | data: {
27 | code: o.code,
28 | wxappid: con.wyy_user_wxappid,
29 | nickname: res.userInfo.nickName,
30 | pic: res.userInfo.avatarUrl
31 | },
32 | success: function (res) {
33 | console.log(res.data)
34 | console.log(res.data.openid);
35 | wx.setStorage({
36 | key: 'openid',
37 | data: res.data.openid,
38 | })
39 | that.globalData.openid = res.data.openid
40 | }
41 | })
42 |
43 | that.globalData.userInfo = res.userInfo
44 |
45 | }
46 | })
47 | }
48 | })
49 | }
50 | },
51 | globalData: {
52 | userInfo: null
53 | }
54 | })
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/hotel/home/home",
4 | "pages/hotel/book/book",
5 | "pages/hotel/mine/mine",
6 | "pages/hotel/home/detail/roomdetail/roomdetail",
7 | "pages/hotel/book/detail/roomdetail/roomdetail",
8 | "pages/hotel/mine/orderdetail/orderdetail",
9 | "pages/logs/logs"
10 | ],
11 | "window": {
12 | "backgroundTextStyle": "light",
13 | "navigationBarBackgroundColor": "#fe3131",
14 | "navigationBarTitleText": "酒店",
15 | "navigationBarTextStyle": "white"
16 | },
17 | "tabBar": {
18 | "list": [
19 | {
20 | "pagePath": "pages/hotel/home/home",
21 | "text": "首页",
22 | "iconPath": "images/home.png",
23 | "selectedIconPath": "images/home1.png"
24 | },
25 | {
26 | "pagePath": "pages/hotel/book/book",
27 | "text": "预订",
28 | "iconPath": "images/book.png",
29 | "selectedIconPath": "images/book1.png"
30 | },
31 | {
32 | "pagePath": "pages/hotel/mine/mine",
33 | "text": "我的",
34 | "iconPath": "images/mine.png",
35 | "selectedIconPath": "images/mine1.png"
36 | }
37 | ],
38 | "color": "#bfbfbf",
39 | "selectedColor": "#fe3131",
40 | "backgroundColor": "white"
41 | },
42 | "networkTimeout": {
43 | "request": 10000,
44 | "downloadFile": 10000
45 | },
46 | "debug": true
47 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | .container {
2 | width: 100%;
3 | }
--------------------------------------------------------------------------------
/images/book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/images/book.png
--------------------------------------------------------------------------------
/images/book1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/images/book1.png
--------------------------------------------------------------------------------
/images/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/images/home.png
--------------------------------------------------------------------------------
/images/home1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/images/home1.png
--------------------------------------------------------------------------------
/images/map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/images/map.png
--------------------------------------------------------------------------------
/images/mine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/images/mine.png
--------------------------------------------------------------------------------
/images/mine1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/images/mine1.png
--------------------------------------------------------------------------------
/pages/hotel/book/book.js:
--------------------------------------------------------------------------------
1 | // book.js
2 | var app = getApp();
3 | var con = require("../../../utils/data.js");
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | housefenlei: []
11 | },
12 |
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 | var that = this;
18 | app.getUserInfo();
19 | wx.request({
20 | url: con.index,
21 | data: { wxappid: con.wyy_user_wxappid},
22 | method: 'GET',
23 | header: {
24 | "Content-Type": 'application/json'
25 | },
26 | success: function (res) {
27 | that.setData({
28 | // 房间信息
29 | housefenlei: res.data.house,
30 | })
31 | console.log(res.data.house);
32 | }
33 | });
34 | },
35 | // 跳转订房详情
36 | go_roomdetail: function (e) {
37 | var id = e.currentTarget.dataset.id
38 | wx.navigateTo({
39 | url: 'detail/roomdetail/roomdetail?id=' + id,
40 | })
41 | },
42 | /**
43 | * 用户点击右上角分享
44 | */
45 | onShareAppMessage: function () {
46 |
47 | }
48 | })
--------------------------------------------------------------------------------
/pages/hotel/book/book.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "房间预订"
3 | }
--------------------------------------------------------------------------------
/pages/hotel/book/book.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.guest_id}}
9 |
10 | {{item.is_tj == 1 ? "推荐" : ""}}
11 | {{item.is_state == 1 ? "正常营业" : ""}}
12 | {{item.is_wifi == 1 ? "无线" : ""}}
13 | {{item.is_window == 1 ? "有窗" : ""}}
14 |
15 |
16 |
17 | {{item.price}}元
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/pages/hotel/book/book.wxss:
--------------------------------------------------------------------------------
1 | .room {
2 | width: 96%;
3 | margin: 0 auto;
4 | display: flex;
5 | justify-content: space-around;
6 | height: 200rpx;
7 | margin-top: 30rpx;
8 | border-bottom: 5rpx solid gainsboro;
9 | }
10 | .room_img {
11 | width: 24%;
12 | vertical-align: middle;
13 | }
14 | image {
15 | width: 100%;
16 | height: 80%;
17 | }
18 | .room_info {
19 | width: 31%;
20 | vertical-align: middle;
21 | text-align: center;
22 | }
23 | .room_info1 {
24 | width: 45%;
25 | vertical-align: middle;
26 | text-align: center;
27 | }
28 | button {
29 | background: #fe3131;
30 | width: 150rpx;
31 | height: 50rpx;
32 | line-height: 50rpx;
33 | font-size: 30rpx;
34 | color: white;
35 | margin-top: 30rpx;
36 | }
37 | .room_infoname {
38 | font-weight: bold;
39 | margin-top: 20rpx;
40 | }
41 | .room_infolabel {
42 | color: gray;
43 | font-size: 25rpx;
44 | margin: 40rpx 8rpx 0;
45 | display: inline-block;
46 | }
47 | .price {
48 | color: #fe3131;
49 | margin-top: 20rpx;
50 | }
51 |
--------------------------------------------------------------------------------
/pages/hotel/book/detail/roomdetail/roomdetail.js:
--------------------------------------------------------------------------------
1 | // roomdetail.js
2 | var app = getApp();
3 | var con = require("../../../../../utils/data.js");
4 | var openid, stat, b, c, d, stime, etime, snum, msg;
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | housefenlei: [],
12 | date: '2017-06-10',
13 | date1: '2017-06-11',
14 | array: [1, 2, 3, 4, 5, 6, 7, 8],
15 | index: 0,
16 | openid: "",
17 | showView: true,
18 | showMine: false
19 | },
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: function (options) {
24 | var that = this;
25 | app.getUserInfo();
26 | // 房间详情
27 | wx.request({
28 | url: con.gethousebyid,
29 | data: { wxappid: con.wyy_user_wxappid, id: options.id },
30 | method: 'GET',
31 | header: {
32 | "Content-Type": 'application/json'
33 | },
34 | success: function (res) {
35 | b = res.data.info.guest_id,
36 | c = res.data.info.price,
37 | d = res.data.info.id,
38 | snum = res.data.info.else_num,
39 | console.log(res.data.info.guest_id)
40 | wx.getStorage({
41 | key: 'openid',
42 | success: function (res) {
43 |
44 | // console.log(res.data);
45 | openid = res.data;
46 | that.setData({
47 | openid: res.data
48 | })
49 | },
50 | })
51 | that.setData({
52 | // 房间信息
53 | housefenlei: res.data.info,
54 | })
55 | console.log(res.data.info);
56 | }
57 | });
58 | // 显示隐藏
59 | showView: (options.showView == "true" ? true : false)
60 | showMine: (options.showMine == "false" ? false : true)
61 | },
62 | // 改变表单状态
63 | onChangeShowState: function () {
64 | var that = this;
65 | that.setData({
66 | showView: (!that.data.showView)
67 | })
68 | },
69 | // 改变按钮状态
70 | changeMine: function () {
71 | var that = this;
72 | that.setData({
73 | showMine: (!that.data.showMine)
74 | })
75 | that.onChangeShowState()
76 | },
77 | // 改变日期
78 | bindDateChange: function (e) {
79 | console.log('picker发送选择改变,携带值为', e.detail.value)
80 | this.setData({
81 | date: e.detail.value
82 | })
83 | },
84 | bindDateChange1: function (e) {
85 | console.log('picker发送选择改变,携带值为', e.detail.value)
86 | this.setData({
87 | date1: e.detail.value
88 | })
89 | },
90 | // 改变数量
91 | bindPickerChange: function (e) {
92 | console.log('picker发送选择改变,携带值为', e.detail.value)
93 | this.setData({
94 | index: e.detail.value
95 | })
96 | },
97 | // 底部弹窗
98 | showModal: function () {
99 | // 显示遮罩层
100 | var animation = wx.createAnimation({
101 | duration: 200,
102 | timingFunction: "linear",
103 | delay: 0
104 | })
105 | this.animation = animation
106 | animation.translateY(300).step()
107 | this.setData({
108 | animationData: animation.export(),
109 | showModalStatus: true
110 | })
111 | setTimeout(function () {
112 | animation.translateY(0).step()
113 | this.setData({
114 | animationData: animation.export()
115 | })
116 | }.bind(this), 200)
117 | },
118 | hideModal: function () {
119 | // 隐藏遮罩层
120 | var animation = wx.createAnimation({
121 | duration: 200,
122 | timingFunction: "linear",
123 | delay: 0
124 | })
125 | this.animation = animation
126 | animation.translateY(300).step()
127 | this.setData({
128 | animationData: animation.export(),
129 | })
130 | setTimeout(function () {
131 | animation.translateY(0).step()
132 | this.setData({
133 | animationData: animation.export(),
134 | showModalStatus: false
135 | })
136 | }.bind(this), 200)
137 | },
138 | // 提交预订信息
139 | formSubmit: function (e) {
140 | var that = this;
141 | app.getUserInfo();
142 | console.log(b)
143 | var a = e.detail.value;
144 | // 判断输入项是否为空
145 | console.log(a.num);
146 | console.log(snum);
147 | // var nima = parseInt(a.num);
148 | if (a.name != "" && a.phone != "" && a.num <= snum) {
149 | wx.request({
150 | url: con.set_order,
151 | data: {
152 | wxappid: con.wyy_user_wxappid,
153 | // preid: id,
154 | name: a.name,
155 | openid: app.globalData.openid,
156 | phone: a.phone,
157 | startdate: a.kdate,
158 | enddate: a.jdate,
159 | roomnum: a.num,
160 | roomname: b,
161 | price: c,
162 | id: d
163 | },
164 | method: 'POST',
165 | header: {
166 | "Content-Type": "application/x-www-form-urlencoded"
167 | },
168 | success(res) {
169 | var zhifu = res.data;
170 | console.log(res.data);
171 | stat = res.data.status;
172 | msg = res.data.errMsg;
173 | console.log(msg)
174 | // 计算天数差
175 | var date1 = a.kdate;
176 | var date2 = a.jdate;
177 | var Num = a.num;
178 | var aDate, oDate1, oDate2, iDays
179 | aDate = date1.split("-")
180 | oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式
181 | aDate = date2.split("-")
182 | oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
183 | iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
184 | // return iDays
185 | console.log(iDays);
186 | var totalNum = iDays * Num;
187 | console.log(totalNum)
188 | // 总价钱
189 | var totalPrice = totalNum * c;
190 | console.log(totalPrice)
191 | that.setData({
192 | totalPrice: totalPrice
193 | })
194 | if (stat == 1) {
195 | // 调用支付
196 | wx.requestPayment({
197 | 'timeStamp': zhifu.timeStamp,
198 | 'nonceStr': zhifu.nonceStr,
199 | 'package': zhifu.package,
200 | 'signType': zhifu.signType,
201 | 'paySign': zhifu.paySign,
202 | 'success': function (res1) {
203 | console.log(zhifu.out_trade_no)
204 | console.log(res1)
205 | if (res1.errMsg == "requestPayment:ok") {
206 | console.log(con.wyy_user_wxappid)
207 | wx.request({
208 | url: con.order_success,
209 | data: {
210 | wxappid: con.wyy_user_wxappid,
211 | out_trade_no: zhifu.out_trade_no,
212 | id: d,
213 | orderNum: a.num
214 | },
215 | method: 'GET',
216 | header: {
217 | "Content-Type": 'application/json'
218 | },
219 | success: function (res1) {
220 | console.log(zhifu.out_trade_no)
221 | console.log(res1)
222 | that.setData({
223 |
224 | })
225 | console.log(res1.data);
226 | if (res1.data.status == 1) {
227 | wx.showToast({
228 | title: res1.data.errMsg,
229 | icon: 'success',
230 | duration: 1000,
231 | mask: true
232 | })
233 | setTimeout(function () {
234 | wx.switchTab({
235 | url: '../../../mine/mine'
236 | })
237 | }, 2000)
238 | } else {
239 | wx.showToast({
240 | title: res1.data.errMsg,
241 | icon: 'loading',
242 | duration: 2000,
243 | mask: true
244 | })
245 | }
246 | }
247 | });
248 | } else {
249 | wx.showToast({
250 | title: '支付失败',
251 | icon: 'loading',
252 | duration: 2000,
253 | mask: true
254 | })
255 | }
256 |
257 | },
258 | 'fail': function (res) {
259 | console.log(res)
260 | wx.showToast({
261 | title: '支付失败',
262 | icon: 'loading',
263 | duration: 1000,
264 | mask: true
265 | })
266 | },
267 | 'complete': function (res) {
268 |
269 | }
270 | })
271 | }
272 |
273 | else {
274 | wx.showToast({
275 | title: msg,
276 | icon: 'loading',
277 | duration: 2000,
278 | mask: true
279 | })
280 | }
281 | }
282 | })
283 | that.showModal();
284 | } else {
285 | wx.showToast({
286 | title: '提交失败,您的信息不全或房间数超出!',
287 | icon: 'loading',
288 | duration: 2000,
289 | mask: true
290 | })
291 | }
292 |
293 | console.log(a.kdate);
294 | console.log(a.jdate);
295 |
296 |
297 | },
298 | /**
299 | * 用户点击右上角分享
300 | */
301 | onShareAppMessage: function () {
302 |
303 | }
304 | })
--------------------------------------------------------------------------------
/pages/hotel/book/detail/roomdetail/roomdetail.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/hotel/book/detail/roomdetail/roomdetail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{housefenlei.guest_id}}
14 |
15 |
16 | ¥{{housefenlei.price}}
17 |
18 |
19 |
20 |
21 | 推荐{{housefenlei.is_tj == 1 ? "是" : "否"}}
22 | 营业{{housefenlei.is_state == 1 ? "是" : "否"}}
23 |
24 |
25 | wifi{{housefenlei.is_wifi == 1 ? "有" : "否"}}
26 | 窗户{{housefenlei.is_window == 1 ? "有" : "否"}}
27 |
28 |
29 | 面积{{housefenlei.area}}㎡
30 | 楼层{{housefenlei.floor}}
31 |
32 |
33 | 剩余数量{{housefenlei.else_num}}
34 | 可住人数{{housefenlei.live}}
35 |
36 |
37 | 房间总数{{housefenlei.number}}
38 |
39 |
40 |
41 | {{showView?'立即预定':'立即预定'}}
42 |
43 |
44 |
88 |
89 |
90 |
91 |
92 |
93 | 总价钱:¥{{totalPrice}}
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/pages/hotel/book/detail/roomdetail/roomdetail.wxss:
--------------------------------------------------------------------------------
1 | /* roomdetail.wxss */
2 | .swiper {
3 | height: 400rpx;
4 | }
5 | .container1 {
6 | width: 96%;
7 | margin: 0 auto;
8 | }
9 | image {
10 | width: 100%;
11 | }
12 | .info {
13 | width: 100%;
14 | overflow: hidden;
15 | }
16 | .left {
17 | float: left;
18 | }
19 | .right {
20 | float: right;
21 | }
22 | .left_name {
23 | font-size: 35rpx;
24 | font-weight: bolder;
25 | padding: 10rpx 0;
26 | }
27 | .left_label {
28 | font-size: 30rpx;
29 | color: #fe3131;
30 | padding: 8rpx 0;
31 | }
32 | .right_price {
33 | color: #fe3131;
34 | font-weight: bolder;
35 | }
36 | button {
37 | background: #fe3131;
38 | color: white;
39 | }
40 | /*-----*/
41 | .commodity_screen {
42 | width: 100%;
43 | height: 100%;
44 | position: fixed;
45 | top: 0;
46 | left: 0;
47 | background: #000;
48 | opacity: 0.4;
49 | overflow: hidden;
50 | z-index: 1000;
51 | color: #fff;
52 | }
53 |
54 | .commodity_attr_box {
55 | width: 100%;
56 | overflow: hidden;
57 | position: fixed;
58 | bottom: 0;
59 | left: 0;
60 | z-index: 2000;
61 | padding-top: 20rpx;
62 | background: #fff;
63 | }
64 | .predetail {
65 | margin: 30rpx auto;
66 | border:1rpx solid lightgray;
67 | color:gray;
68 | border-radius:10rpx;
69 | }
70 | .pre_input {
71 | width: 100%;
72 | color:gray;
73 | }
74 | .name {
75 | width: 96%;
76 | margin: 0 auto;
77 | font-weight: bolder;
78 | }
79 | .bottom {
80 | width: 96%;
81 | margin: 0 auto;
82 | overflow: hidden;
83 | }
84 | .bottom_price {
85 | float: left;
86 | color: #fe3131;
87 | font-size: 60rpx;
88 | margin-top:10rpx;
89 |
90 | }
91 | .button_bottom {
92 | float: right;
93 | margin-bottom: 10rpx;
94 | }
95 | .font_style {
96 | font-size: 35rpx;
97 | font-weight: bolder;
98 | }
99 | .xueyuan_top_left {
100 | float: left;
101 | }
102 | .xueyuan_top_right {
103 | float: right;
104 | }
105 | .title {
106 | overflow: hidden;
107 | width: 96%;
108 | margin: 0 auto;
109 | }
110 | .tx {
111 | padding: 20rpx 0;
112 | margin: 0 auto;
113 | color: #fe3131;
114 | font-size: 30rpx;
115 | font-weight: bolder;
116 | }
117 | input {
118 | font-size:30rpx;
119 | margin-left:10rpx;
120 | }
121 | /*弹窗*/
122 | .total_price {
123 | color: #fe3131;
124 | font-size: 40rpx;
125 | text-align: center;
126 | padding: 20rpx 0;
127 | font-weight:bolder;
128 | }
129 | .button_pay {
130 | background: #fe3131;
131 | color: white;
132 | }
133 | .hotel_bq {
134 | margin: 20rpx auto;
135 | font-size: 30rpx;
136 | }
137 | .spaninfo {
138 | color: #fe3131;
139 | margin-left: 10rpx;
140 | font-weight: bolder;
141 | }
142 | .clean {
143 | overflow: hidden;
144 | }
145 | .inlineblock {
146 | display: inline-block;
147 | width: 48%;
148 | padding: 10rpx 0;
149 | }
150 | picker {
151 | margin:10rpx;
152 | font-size:30rpx;
153 | }
154 | /*显示隐藏*/
155 | .bright789_view_hide{
156 | display: none;
157 | }
158 | .bright789_view_show{
159 | display: block;
160 | }
161 | .enblock {
162 | font-size:30rpx;
163 | color:white;
164 | background:#fe3131;
165 | text-align:center;
166 | padding:20rpx 0;
167 | border-radius:10rpx;
168 | }
169 | .Mine_hide {
170 | display: none;
171 | }
172 | .Mine_block {
173 | display: block;
174 | }
--------------------------------------------------------------------------------
/pages/hotel/home/detail/roomdetail/roomdetail.js:
--------------------------------------------------------------------------------
1 | // roomdetail.js
2 | var app = getApp();
3 | var con = require("../../../../../utils/data.js");
4 | var openid, stat, b, c, d, stime, etime, snum, msg;
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | housefenlei: [],
12 | date: '2017-06-10',
13 | date1: '2017-06-11',
14 | array: [1, 2, 3, 4, 5, 6, 7, 8],
15 | index: 0,
16 | openid: "",
17 | showView: true,
18 | showMine: false
19 | },
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: function (options) {
24 | var that = this;
25 | app.getUserInfo();
26 | // 房间详情
27 | wx.request({
28 | url: con.gethousebyid,
29 | data: { wxappid: con.wyy_user_wxappid, id: options.id },
30 | method: 'GET',
31 | header: {
32 | "Content-Type": 'application/json'
33 | },
34 | success: function (res) {
35 | b = res.data.info.guest_id,
36 | c = res.data.info.price,
37 | d = res.data.info.id,
38 | snum = res.data.info.else_num,
39 | console.log(res.data.info.guest_id)
40 | wx.getStorage({
41 | key: 'openid',
42 | success: function (res) {
43 |
44 | // console.log(res.data);
45 | openid = res.data;
46 | that.setData({
47 | openid: res.data
48 | })
49 | },
50 | })
51 | that.setData({
52 | // 房间信息
53 | housefenlei: res.data.info,
54 | })
55 | console.log(res.data.info);
56 | }
57 | });
58 | // 显示隐藏
59 | showView: (options.showView == "true" ? true : false)
60 | showMine: (options.showMine == "false" ? false : true)
61 | },
62 | // 改变表单状态
63 | onChangeShowState: function () {
64 | var that = this;
65 | that.setData({
66 | showView: (!that.data.showView)
67 | })
68 | },
69 | // 改变按钮状态
70 | changeMine: function () {
71 | var that = this;
72 | that.setData({
73 | showMine: (!that.data.showMine)
74 | })
75 | that.onChangeShowState()
76 | },
77 | // 改变日期
78 | bindDateChange: function (e) {
79 | console.log('picker发送选择改变,携带值为', e.detail.value)
80 | this.setData({
81 | date: e.detail.value
82 | })
83 | },
84 | bindDateChange1: function (e) {
85 | console.log('picker发送选择改变,携带值为', e.detail.value)
86 | this.setData({
87 | date1: e.detail.value
88 | })
89 | },
90 | // 改变数量
91 | bindPickerChange: function (e) {
92 | console.log('picker发送选择改变,携带值为', e.detail.value)
93 | this.setData({
94 | index: e.detail.value
95 | })
96 | },
97 | // 底部弹窗
98 | showModal: function () {
99 | // 显示遮罩层
100 | var animation = wx.createAnimation({
101 | duration: 200,
102 | timingFunction: "linear",
103 | delay: 0
104 | })
105 | this.animation = animation
106 | animation.translateY(300).step()
107 | this.setData({
108 | animationData: animation.export(),
109 | showModalStatus: true
110 | })
111 | setTimeout(function () {
112 | animation.translateY(0).step()
113 | this.setData({
114 | animationData: animation.export()
115 | })
116 | }.bind(this), 200)
117 | },
118 | hideModal: function () {
119 | // 隐藏遮罩层
120 | var animation = wx.createAnimation({
121 | duration: 200,
122 | timingFunction: "linear",
123 | delay: 0
124 | })
125 | this.animation = animation
126 | animation.translateY(300).step()
127 | this.setData({
128 | animationData: animation.export(),
129 | })
130 | setTimeout(function () {
131 | animation.translateY(0).step()
132 | this.setData({
133 | animationData: animation.export(),
134 | showModalStatus: false
135 | })
136 | }.bind(this), 200)
137 | },
138 | // 提交预订信息
139 | formSubmit: function(e) {
140 | var that = this;
141 | app.getUserInfo();
142 | console.log(b)
143 | var a = e.detail.value;
144 | // 判断输入项是否为空
145 | console.log(a.num);
146 | console.log(snum);
147 | // var nima = parseInt(a.num);
148 | if (a.name != "" && a.phone != "" && a.num<=snum) {
149 | wx.request({
150 | url: con.set_order,
151 | data: {
152 | wxappid: con.wyy_user_wxappid,
153 | // preid: id,
154 | name: a.name,
155 | openid: app.globalData.openid,
156 | phone: a.phone,
157 | startdate: a.kdate,
158 | enddate: a.jdate,
159 | roomnum: a.num,
160 | roomname: b,
161 | price: c,
162 | id: d
163 | },
164 | method: 'POST',
165 | header: {
166 | "Content-Type": "application/x-www-form-urlencoded"
167 | },
168 | success(res) {
169 | var zhifu = res.data;
170 | console.log(res.data);
171 | stat = res.data.status;
172 | msg = res.data.errMsg;
173 | console.log(msg)
174 | // 计算天数差
175 | var date1 = a.kdate;
176 | var date2 = a.jdate;
177 | var Num = a.num;
178 | var aDate, oDate1, oDate2, iDays
179 | aDate = date1.split("-")
180 | oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式
181 | aDate = date2.split("-")
182 | oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
183 | iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
184 | // return iDays
185 | console.log(iDays);
186 | var totalNum = iDays * Num;
187 | console.log(totalNum)
188 | // 总价钱
189 | var totalPrice = totalNum * c;
190 | console.log(totalPrice)
191 | that.setData({
192 | totalPrice: totalPrice
193 | })
194 | if (stat == 1) {
195 | // 调用支付
196 | wx.requestPayment({
197 | 'timeStamp': zhifu.timeStamp,
198 | 'nonceStr': zhifu.nonceStr,
199 | 'package': zhifu.package,
200 | 'signType': zhifu.signType,
201 | 'paySign': zhifu.paySign,
202 | 'success': function (res1) {
203 | console.log(zhifu.out_trade_no)
204 | console.log(res1)
205 | if (res1.errMsg == "requestPayment:ok") {
206 | console.log(con.wyy_user_wxappid)
207 | wx.request({
208 | url: con.order_success,
209 | data: {
210 | wxappid: con.wyy_user_wxappid,
211 | out_trade_no: zhifu.out_trade_no,
212 | id: d,
213 | orderNum: a.num
214 | },
215 | method: 'GET',
216 | header: {
217 | "Content-Type": 'application/json'
218 | },
219 | success: function (res1) {
220 | console.log(zhifu.out_trade_no)
221 | console.log(res1)
222 | that.setData({
223 |
224 | })
225 | console.log(res1.data);
226 | if (res1.data.status == 1) {
227 | wx.showToast({
228 | title: res1.data.errMsg,
229 | icon: 'success',
230 | duration: 1000,
231 | mask: true
232 | })
233 | setTimeout(function () {
234 | wx.switchTab({
235 | url: '../../../mine/mine'
236 | })
237 | }, 2000)
238 | } else {
239 | wx.showToast({
240 | title: '支付失败',
241 | icon: 'loading',
242 | duration: 2000,
243 | mask: true
244 | })
245 | }
246 | }
247 | });
248 | } else {
249 | wx.showToast({
250 | title: '支付失败',
251 | icon: 'loading',
252 | duration: 2000,
253 | mask: true
254 | })
255 | }
256 |
257 | },
258 | 'fail': function (res) {
259 | console.log(res)
260 | wx.showToast({
261 | title: '支付失败',
262 | icon: 'loading',
263 | duration: 1000,
264 | mask: true
265 | })
266 | },
267 | 'complete': function (res) {
268 |
269 | }
270 | })
271 | }
272 |
273 | else {
274 | wx.showToast({
275 | title: msg,
276 | icon: 'loading',
277 | duration: 2000,
278 | mask: true
279 | })
280 | }
281 | }
282 | })
283 | that.showModal();
284 | } else {
285 | wx.showToast({
286 | title: '提交失败,您的信息不全或房间数超出!',
287 | icon: 'loading',
288 | duration: 2000,
289 | mask: true
290 | })
291 | }
292 |
293 | console.log(a.kdate);
294 | console.log(a.jdate);
295 |
296 |
297 | },
298 | /**
299 | * 用户点击右上角分享
300 | */
301 | onShareAppMessage: function () {
302 |
303 | }
304 | })
--------------------------------------------------------------------------------
/pages/hotel/home/detail/roomdetail/roomdetail.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/hotel/home/detail/roomdetail/roomdetail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{housefenlei.guest_id}}
14 |
15 |
16 | ¥{{housefenlei.price}}
17 |
18 |
19 |
20 |
21 | 推荐{{housefenlei.is_tj == 1 ? "是" : "否"}}
22 | 营业{{housefenlei.is_state == 1 ? "是" : "否"}}
23 |
24 |
25 | wifi{{housefenlei.is_wifi == 1 ? "有" : "否"}}
26 | 窗户{{housefenlei.is_window == 1 ? "有" : "否"}}
27 |
28 |
29 | 面积{{housefenlei.area}}㎡
30 | 楼层{{housefenlei.floor}}
31 |
32 |
33 | 剩余数量{{housefenlei.else_num}}
34 | 可住人数{{housefenlei.live}}
35 |
36 |
37 | 房间总数{{housefenlei.number}}
38 |
39 |
40 |
41 | {{showView?'立即预定':'立即预定'}}
42 |
43 |
44 |
88 |
89 |
90 |
91 |
92 |
93 | 总价钱:¥{{totalPrice}}
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/pages/hotel/home/detail/roomdetail/roomdetail.wxss:
--------------------------------------------------------------------------------
1 | /* roomdetail.wxss */
2 | .swiper {
3 | height: 400rpx;
4 | }
5 | .container1 {
6 | width: 96%;
7 | margin: 0 auto;
8 | }
9 | image {
10 | width: 100%;
11 | }
12 | .info {
13 | width: 100%;
14 | overflow: hidden;
15 | }
16 | .left {
17 | float: left;
18 | }
19 | .right {
20 | float: right;
21 | }
22 | .left_name {
23 | font-size: 35rpx;
24 | font-weight: bolder;
25 | padding: 10rpx 0;
26 | }
27 | .left_label {
28 | font-size: 30rpx;
29 | color: #fe3131;
30 | padding: 8rpx 0;
31 | }
32 | .right_price {
33 | color: #fe3131;
34 | font-weight: bolder;
35 | }
36 | button {
37 | background: #fe3131;
38 | color: white;
39 | }
40 | /*-----*/
41 | .commodity_screen {
42 | width: 100%;
43 | height: 100%;
44 | position: fixed;
45 | top: 0;
46 | left: 0;
47 | background: #000;
48 | opacity: 0.4;
49 | overflow: hidden;
50 | z-index: 1000;
51 | color: #fff;
52 | }
53 |
54 | .commodity_attr_box {
55 | width: 100%;
56 | overflow: hidden;
57 | position: fixed;
58 | bottom: 0;
59 | left: 0;
60 | z-index: 2000;
61 | padding-top: 20rpx;
62 | background: #fff;
63 | }
64 | .predetail {
65 | margin: 30rpx auto;
66 | border:1rpx solid lightgray;
67 | color:gray;
68 | border-radius:10rpx;
69 | }
70 | .pre_input {
71 | width: 100%;
72 | color:gray;
73 | }
74 | .name {
75 | width: 96%;
76 | margin: 0 auto;
77 | font-weight: bolder;
78 | }
79 | .bottom {
80 | width: 96%;
81 | margin: 0 auto;
82 | overflow: hidden;
83 | }
84 | .bottom_price {
85 | float: left;
86 | color: #fe3131;
87 | font-size: 60rpx;
88 | margin-top:10rpx;
89 |
90 | }
91 | .button_bottom {
92 | float: right;
93 | margin-bottom: 10rpx;
94 | }
95 | .font_style {
96 | font-size: 35rpx;
97 | font-weight: bolder;
98 | }
99 | .xueyuan_top_left {
100 | float: left;
101 | }
102 | .xueyuan_top_right {
103 | float: right;
104 | }
105 | .title {
106 | overflow: hidden;
107 | width: 96%;
108 | margin: 0 auto;
109 | }
110 | .tx {
111 | padding: 20rpx 0;
112 | margin: 0 auto;
113 | color: #fe3131;
114 | font-size: 30rpx;
115 | font-weight: bolder;
116 | }
117 | input {
118 | font-size:30rpx;
119 | margin-left:10rpx;
120 | }
121 | /*弹窗*/
122 | .total_price {
123 | color: #fe3131;
124 | font-size: 40rpx;
125 | text-align: center;
126 | padding: 20rpx 0;
127 | font-weight:bolder;
128 | }
129 | .button_pay {
130 | background: #fe3131;
131 | color: white;
132 | }
133 | .hotel_bq {
134 | margin: 20rpx auto;
135 | font-size: 30rpx;
136 | }
137 | .spaninfo {
138 | color: #fe3131;
139 | margin-left: 10rpx;
140 | font-weight: bolder;
141 | }
142 | .clean {
143 | overflow: hidden;
144 | }
145 | .inlineblock {
146 | display: inline-block;
147 | width: 48%;
148 | padding: 10rpx 0;
149 | }
150 | picker {
151 | margin:10rpx;
152 | font-size:30rpx;
153 | }
154 | /*显示隐藏*/
155 | .bright789_view_hide{
156 | display: none;
157 | }
158 | .bright789_view_show{
159 | display: block;
160 | }
161 | .enblock {
162 | font-size:30rpx;
163 | color:white;
164 | background:#fe3131;
165 | text-align:center;
166 | padding:20rpx 0;
167 | border-radius:10rpx;
168 | }
169 | .Mine_hide {
170 | display: none;
171 | }
172 | .Mine_block {
173 | display: block;
174 | }
--------------------------------------------------------------------------------
/pages/hotel/home/home.js:
--------------------------------------------------------------------------------
1 | // home.js
2 | var WxParse = require("../../../wxParse/wxParse.js");
3 | var QQMapWX = require('../../../utils/qqmap-wx-jssdk.min.js');
4 | var app = getApp();
5 | var con = require("../../../utils/data.js");
6 | var lng, lat, name, address, showModalStatus;
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 | navbar: ['酒店简介', '评价'],
14 | currentTab: 0,
15 | // 轮播图数据
16 | lunbolist: [],
17 | // 精彩推荐客房
18 | housefenlei: [],
19 | hotelinfo: [],
20 | evalue: [],
21 | manyi: [
22 | { value: '一般' ,num: 1 },
23 | { value: '满意', num: 2, checked: "true" },
24 | { value: '非常满意', num: 3 }
25 | ],
26 | // 评价列表
27 | evalue_list: [],
28 | // 评价满意状态
29 | pj: "",
30 | opentime: "",
31 | detime: ""
32 | },
33 | // 菜单切换
34 | navbarTap: function (e) {
35 | this.setData({
36 | currentTab: e.currentTarget.dataset.idx
37 | })
38 | },
39 | /**
40 | * 生命周期函数--监听页面加载
41 | */
42 | onLoad: function (options) {
43 | this.requestjiekou();
44 | },
45 | requestjiekou: function () {
46 | var demo = new QQMapWX({
47 | key: 'QCDBZ-GZ3WI-BQDG7-5H24V-Y2HSO-I7BSG'
48 | });
49 | var that = this;
50 | app.getUserInfo();
51 | // 首页接口
52 | wx.request({
53 | url: con.index,
54 | data: { wxappid: con.wyy_user_wxappid, count: 4 },
55 | method: 'GET',
56 | header: {
57 | "Content-Type": 'application/json'
58 | },
59 | success: function (res) {
60 | lat = res.data.hotel.latitude;
61 | lng = res.data.hotel.longitude;
62 | name = res.data.hotel.name;
63 | address = res.data.hotel.province + res.data.hotel.city + res.data.hotel.district + res.data.hotel.address;
64 | WxParse.wxParse('arta', 'html', res.data.hotel.intro, that, 0);
65 | // 时间戳转化
66 | var opentime = new Date(parseInt(res.data.hotel.opening) * 1000).toJSON().slice(0, 10);
67 | var detime = new Date(parseInt(res.data.hotel.decorate) * 1000).toJSON().slice(0, 10);
68 | that.setData({
69 | // 轮播图数据
70 | lunbolist: res.data.photo,
71 | // 酒店信息
72 | hotelinfo: res.data.hotel,
73 | // 房间信息;
74 | housefenlei: res.data.house,
75 | // 评价信息
76 | evalue: res.data.evalue,
77 | lat: res.data.hotel.latitude,
78 | lng: res.data.hotel.longitude,
79 | // 开业时间
80 | opentime: opentime,
81 | detime: detime,
82 | markers: [{
83 | iconPath: "../../../images/map.png",
84 | id: 0,
85 | latitude: res.data.hotel.latitude,
86 | longitude: res.data.hotel.longitude,
87 | title: res.data.hotel.name,
88 | width: 30,
89 | height: 30
90 | }]
91 | })
92 | console.log(res.data);
93 | }
94 | });
95 | // 评价列表接口
96 | wx.request({
97 | url: con.evalue_list,
98 | data: { wxappid: con.wyy_user_wxappid },
99 | method: 'GET',
100 | header: {
101 | "Content-Type": 'application/json'
102 | },
103 | success: function (res) {
104 | // WxParse.wxParse('arta', 'html', res.data.hotel.intro, that, 0);
105 | that.setData({
106 | evalue_list: res.data.msg
107 | })
108 | var a = res.data.msg;
109 | console.log(res.data.msg);
110 | }
111 | });
112 | },
113 | // 地图导航
114 | bindgothere: function (e) {
115 | console.log(lat);
116 | console.log(lng);
117 | wx.openLocation({
118 | latitude: parseFloat(lat),
119 | longitude: parseFloat(lng),
120 | name: name,
121 | address: address
122 | })
123 | },
124 | // 跳转预订页面
125 | go_book: function (e) {
126 | wx.switchTab({
127 | url: '../book/book'
128 | })
129 | },
130 | // 跳转订房详情
131 | go_roomdetail: function (e) {
132 | var id = e.currentTarget.dataset.id
133 | wx.navigateTo({
134 | url: 'detail/roomdetail/roomdetail?id=' + id,
135 | })
136 | },
137 | formSubmit: function (e) {
138 | var that = this;
139 | app.getUserInfo();
140 | var a = e.detail.value;
141 | console.log(a);
142 | console.log(a.satisfied)
143 | // 如果评论信息不为空就提交到评论接口
144 | if (a.comment != "") {
145 | // 提交评价信息到接口
146 | wx.request({
147 | url: con.evalue_add,
148 | data: {
149 | wxappid: con.wyy_user_wxappid,
150 | openid: app.globalData.openid,
151 | info: a.comment,
152 | satisfaction: a.satisfied
153 | },
154 | method: 'GET',
155 | header: {
156 | "Content-Type": 'application/json'
157 | },
158 | success: function (res) {
159 | that.requestjiekou();
160 | that.setData({
161 |
162 | })
163 | console.log(res.data);
164 | if (res.data.status == 1) {
165 | wx.showToast({
166 | title: '发表成功',
167 | icon: 'success',
168 | duration: 2000
169 | })
170 |
171 | }
172 | if (res.data.status == 0) {
173 | wx.showToast({
174 | title: '对不起,尚未查询到您在本酒店的订单,无法评价!',
175 | icon: 'fail',
176 | duration: 2000
177 | })
178 | }
179 | // else {
180 | // wx.showToast({
181 | // title: '发表失败1',
182 | // icon: 'fail',
183 | // duration: 2000
184 | // })
185 | // }
186 | }
187 | });
188 | } else {
189 | wx.showToast({
190 | title: '发表失败',
191 | icon: 'fail',
192 | duration: 2000
193 | })
194 | }
195 | },
196 | /**
197 | * 用户点击右上角分享
198 | */
199 | onShareAppMessage: function () {
200 |
201 | }
202 | })
--------------------------------------------------------------------------------
/pages/hotel/home/home.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/hotel/home/home.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 | {{hotelinfo.name}}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | 精选推荐
17 | 更多 >
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | {{item.guest_id}}
26 |
27 |
28 |
29 |
30 |
31 |
32 | {{item}}
33 |
34 |
35 |
36 |
51 |
52 |
53 | 评价信息
54 |
55 | {{index + 1}}.{{item.name}}:
56 | {{item.satisfaction == 1 ? "一般" : item.satisfaction == 2 ? "满意" : item.satisfaction == 3 ? "非常满意" : ""}}
57 |
58 | {{item.info}}
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | {{hotelinfo.name}}
67 |
68 | {{hotelinfo.intro}}
69 |
70 |
71 |
72 | {{hotelinfo.is_show == 1 ? "正常营业" : ""}}
73 | {{hotelinfo.is_luggage == 1 ? "可寄放行李" : ""}}
74 | {{hotelinfo.is_parking == 1 ? "提供停车服务" : ""}}
75 |
76 |
77 | {{hotelinfo.is_restaurant == 1 ? "提供餐厅" : ""}}
78 | {{hotelinfo.is_wifi == 1 ? "无线服务" : ""}}
79 |
80 | 开业时间:{{opentime}}
81 | 装修时间:{{detime}}
82 | 地址:{{hotelinfo.province}}{{hotelinfo.city}}{{hotelinfo.district}}{{hotelinfo.address}}
83 | 订房热线:{{hotelinfo.phone}}
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/pages/hotel/home/home.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../wxParse/wxParse.wxss";
2 | /*轮播图*/
3 | .swiper {
4 | width: 100%;
5 | height: 200px;
6 | }
7 | .swiper image {
8 | width: 100%;
9 | height: 100%;
10 | display: inline-block;
11 | }
12 | /*精选推荐*/
13 | .font_style {
14 | color: gray;
15 | font-size: 30rpx;
16 | font-weight: bolder;
17 | }
18 | .xueyuan_top_left {
19 | float: left;
20 | color: gray;
21 | font-size: 30rpx;
22 | font-weight: bloder;
23 | border-left: 6rpx solid #d81e06;
24 | }
25 | .xueyuan_top_right {
26 | float: right;
27 | color: gray;
28 | font-size: 30rpx;
29 | font-weight: bloder;
30 | }
31 | .rqxm {
32 | width: 95%;
33 | margin: 40rpx auto;
34 | font-size: 0;
35 | }
36 | .title {
37 | overflow: hidden;
38 | }
39 | .rqxm_list {
40 | width: 48%;
41 | display: inline-block;
42 | margin: 10rpx 1%;
43 | }
44 | .img {
45 | width: 100%;
46 | margin-top: 20rpx;
47 | }
48 | image {
49 | height: 220rpx;
50 | width: 100%;
51 | }
52 | .introduce {
53 | width: 100%;
54 | text-align: center;
55 | font-size: 30rpx;
56 | background: #d81e06;
57 | color: white;
58 | padding: 15rpx 0;
59 | }
60 | /*选项卡*/
61 | .navbar{
62 | flex: none;
63 | display: flex;
64 | background: #fff;
65 | }
66 | .navbar .item{
67 | position: relative;
68 | flex: auto;
69 | text-align: center;
70 | line-height: 80rpx;
71 | color: #fe3131;
72 | font-size: 30rpx;
73 | font-weight: bolder;
74 | }
75 | .navbar .item.active{
76 | color: #fe3131;
77 | }
78 | .navbar .item.active:after{
79 | content: "";
80 | display: block;
81 | position: absolute;
82 | bottom: 0;
83 | left: 0;
84 | right: 0;
85 | height: 4rpx;
86 | background: #FFCC00;
87 | }
88 | /*酒店简介功能介绍*/
89 | .nav_children image {
90 | width: 140rpx;
91 | height: 140rpx;
92 | border-radius: 50%;
93 | }
94 | .nav_children text {
95 | font-size: 30rpx;
96 | }
97 | .nav_list {
98 | display: flex;
99 | flex-direction: row;
100 | justify-content: space-around;
101 | flex-wrap: wrap;
102 | margin: 50rpx 0 40rpx;
103 | border-bottom: 2rpx solid #e5e5e5;
104 | }
105 | .nav_children {
106 | text-align: center;
107 | width: 22%;
108 | margin-bottom: 20rpx;
109 | }
110 | /*酒店信息简介*/
111 | .hotel_introduce {
112 | width: 95%;
113 | margin: 0 auto;
114 | padding-bottom: 50rpx;
115 | }
116 | .hotel_name {
117 | font-size: 38rpx;
118 | font-weight: bolder;
119 | text-align: center;
120 | padding: 25rpx 0;
121 | }
122 | .hotel_address {
123 | padding: 20rpx 0;
124 | font-size: 30rpx;
125 | font-weight: bolder;
126 | }
127 | .hotel_phone {
128 | font-size: 30rpx;
129 | font-weight: bolder;
130 | }
131 | .hotel_bq {
132 | width: 100%;
133 | margin: 20rpx auto;
134 | }
135 | .smallbq {
136 | color:#fe3131;
137 | font-weight: bolder;
138 | padding-right: 8rpx;
139 | font-size: 30rpx;
140 | }
141 | .time {
142 | font-size: 30rpx;
143 | font-weight: bolder;
144 | }
145 | .time1 {
146 | margin-bottom: 20rpx;
147 | }
148 | /*评价*/
149 | .predetail {
150 | width: 96%;
151 | margin: 30rpx auto;
152 | border: 1rpx solid lightgray;
153 | color:gray;
154 | font-size:30rpx;
155 | border-radius:10rpx;
156 | }
157 | textarea {
158 | margin: 10rpx;
159 | }
160 | .pre_input {
161 | width: 100%;
162 | color:gray;
163 | padding: 20rpx 0;
164 | }
165 | .predetail1 {
166 | width: 96%;
167 | margin: 30rpx auto;
168 | font-size:30rpx;
169 | }
170 | .evalue {
171 | width: 96%;
172 | margin: 0 auto;
173 | }
174 | .info_list {
175 | padding: 10rpx 0;
176 | font-size: 30rpx;
177 | font-weight:bolder;
178 | }
179 | .pj {
180 | color: #fe3131;
181 | font-weight: bolder;
182 | padding: 0 20rpx;
183 | }
184 | .info_info {
185 | font-size: 30rpx;
186 | color: gray;
187 | }
188 | .evalueinfo {
189 | padding:10rpx 0;
190 | border-bottom:1rpx solid lightgray;
191 | }
192 |
--------------------------------------------------------------------------------
/pages/hotel/mine/mine.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | var app = getApp();
4 | var con = require("../../../utils/data.js");
5 | Page({
6 | data: {
7 | navbar: ['未支付订单', '已支付订单'],
8 | currentTab: 0,
9 | userInfo: {},
10 | orderlist: [],
11 | orderlistNo: [],
12 | orderlistYes: [],
13 | showView: true,
14 | yname: {}
15 | },
16 | // 菜单切换
17 | navbarTap: function (e) {
18 | this.setData({
19 | currentTab: e.currentTarget.dataset.idx
20 | })
21 | },
22 | //事件处理函数
23 | bindViewTap: function () {
24 | wx.navigateTo({
25 | url: '../logs/logs'
26 | })
27 | },
28 | onLoad: function (options) {
29 | var that = this
30 | //调用应用实例的方法获取全局数据
31 | app.getUserInfo(function (userInfo) {
32 | //更新数据
33 | that.setData({
34 | userInfo: userInfo
35 | })
36 | console.log(userInfo)
37 | })
38 | // 订单列表
39 | wx.request({
40 | url: con.order_list,
41 | data: {
42 | wxappid: con.wyy_user_wxappid,
43 | openid: app.globalData.openid
44 | },
45 | method: 'GET',
46 | header: {
47 | "Content-Type": 'application/json'
48 | },
49 | success: function (res) {
50 | // console.log(openid);
51 | that.setData({
52 | // 未支付订单
53 | orderlistNo: res.data.no,
54 | // 已支付订单
55 | orderlistYes: res.data.yes
56 |
57 | })
58 | console.log(res.data)
59 | }
60 | })
61 | // 获取域名接口
62 | wx.request({
63 | url: con.get_copyright,
64 | method: 'GET',
65 | data: { wxappid: con.wyy_user_wxappid },
66 | header: {
67 | "Content-Type": "application/json"
68 | },
69 | success: function (res) {
70 | that.setData({
71 | yname: res.data
72 | })
73 | console.log(res.data)
74 | }
75 |
76 | })
77 | // 显示隐藏
78 | showView: (options.showView == "true" ? true : false)
79 | },
80 | onChangeShowState: function () {
81 | var that = this;
82 | that.setData({
83 | showView: (!that.data.showView)
84 | })
85 | },
86 | // 跳转订单详情
87 | go_orderdetail: function (e) {
88 | var id = e.currentTarget.dataset.id
89 | wx.navigateTo({
90 | url: 'orderdetail/orderdetail?id=' + id,
91 | })
92 | },
93 | // 下拉刷新
94 | onPullDownRefresh: function (options) {
95 | var that = this
96 | //调用应用实例的方法获取全局数据
97 | app.getUserInfo(function (userInfo) {
98 | //更新数据
99 | that.setData({
100 | userInfo: userInfo
101 | })
102 | })
103 | // 订单列表
104 | wx.request({
105 | url: con.order_list,
106 | data: {
107 | wxappid: con.wyy_user_wxappid,
108 | openid: app.globalData.openid
109 | },
110 | method: 'GET',
111 | header: {
112 | "Content-Type": 'application/json'
113 | },
114 | success: function (res) {
115 | // console.log(openid);
116 | that.setData({
117 | // 未支付订单
118 | orderlistNo: res.data.no,
119 | // 已支付订单
120 | orderlistYes: res.data.yes
121 |
122 | })
123 | console.log(res.data)
124 | }
125 | })
126 | wx.stopPullDownRefresh()
127 | wx.showToast({
128 | title: '刷新成功',
129 | icon: 'success',
130 | duration: 1000
131 | })
132 | }
133 | })
134 |
--------------------------------------------------------------------------------
/pages/hotel/mine/mine.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "个人中心",
3 | "enablePullDownRefresh": "true"
4 | }
--------------------------------------------------------------------------------
/pages/hotel/mine/mine.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{userInfo.nickName}}
8 |
9 |
10 | {{showView?'我的订单':'我的订单'}}
11 | >
12 |
13 |
14 |
15 |
16 |
17 | {{item}}
18 |
19 |
20 |
21 |
22 |
23 |
24 | {{index + 1}}.{{item.guest_id}}
25 | {{item.order_time}}
26 |
27 |
28 | ¥{{item.pay_price}}
29 | 未支付
30 |
31 |
32 |
33 | 姓名:{{item.name}}
34 | 联系方式:{{item.phone}}
35 |
36 | >
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | {{index + 1}}.{{item.guest_id}}
45 | {{item.order_time}}
46 |
47 |
48 | ¥{{item.pay_price}}
49 | 已支付
50 |
51 |
52 |
53 | 姓名:{{item.name}}
54 | 电话:{{item.phone}}
55 |
56 | >
57 |
58 |
59 |
60 |
61 | {{yname.errMsg.banquan}}提供技术支持
62 | {{yname.errMsg.url}}
63 |
64 |
--------------------------------------------------------------------------------
/pages/hotel/mine/mine.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | .userinfo {
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | height: 400rpx;
7 | background: #fe3131;
8 | }
9 |
10 | .userinfo-avatar {
11 | width: 100%;
12 | text-align: center;
13 | margin-top: 50rpx;
14 | }
15 | .userinfo-image {
16 | width: 128rpx;
17 | height: 128rpx;
18 | border-radius: 50%;
19 | }
20 | .userinfo-nickname {
21 | color: white;
22 | }
23 | .font_style {
24 | font-size: 35rpx;
25 | font-weight: bolder;
26 | }
27 | .xueyuan_top_left {
28 | float: left;
29 | border-left: 6rpx solid #d81e06;
30 | }
31 | .xueyuan_top_right {
32 | float: right;
33 | transform: rotate(90deg) translateY(20rpx);
34 | }
35 | .title {
36 | width: 95%;
37 | margin: 0 auto;
38 | padding: 20rpx 0;
39 | overflow: hidden;
40 | border-bottom: 2rpx solid gray;
41 | }
42 | /*选项卡*/
43 | .navbar{
44 | flex: none;
45 | display: flex;
46 | width: 96%;
47 | margin: 0 auto;
48 | }
49 | .navbar .item{
50 | position: relative;
51 | flex: auto;
52 | text-align: center;
53 | line-height: 80rpx;
54 | font-size: 30rpx;
55 | font-weight: bolder;
56 | }
57 | .navbar .item.active{
58 | color: #fe3131;
59 | }
60 | .navbar .item.active:after{
61 | content: "";
62 | display: block;
63 | position: absolute;
64 | bottom: 0;
65 | left: 0;
66 | right: 0;
67 | height: 4rpx;
68 | background: #FFCC00;
69 | }
70 | /**/
71 | .ordername {
72 | font-weight: bolder;
73 | font-size: 30rpx;
74 | padding: 10rpx 0;
75 | }
76 | .orderinfo {
77 | color: gray;
78 | padding-right: 20rpx;
79 | font-size: 30rpx;
80 | }
81 | .orderinfo1 {
82 | color: #fe3131;
83 | padding-right: 20rpx;
84 | font-size: 30rpx;
85 | }
86 | .orderlist {
87 | width:94%;
88 | margin:0 auto;
89 | position:relative;
90 | border-bottom:1rpx solid lightgray;
91 | background:white;
92 | border-radius:10rpx;
93 | padding:10rpx 15rpx;
94 | margin-bottom:5rpx;
95 | }
96 | .xq {
97 | position: absolute;
98 | color: gray;
99 | font-weight: bolder;
100 | top: 40%;
101 | right: 2%;
102 | }
103 | .order_info {
104 | float: left;
105 | }
106 | .pay_info {
107 | float: right;
108 | margin-right:20rpx;
109 | }
110 | .personinfo {
111 | padding-right:20rpx;
112 | font-size:30rpx;
113 | }
114 | page {
115 | background: #F5F5F5;
116 | }
117 | /*显示隐藏*/
118 | .bright789_view_hide{
119 | display: block;
120 | }
121 | .bright789_view_show{
122 | display: none;
123 | }
--------------------------------------------------------------------------------
/pages/hotel/mine/orderdetail/orderdetail.js:
--------------------------------------------------------------------------------
1 | // orderlist.js
2 | var app = getApp();
3 | var con = require("../../../../utils/data.js");
4 | // var openid;
5 | var order_detail, stat;
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 | orderdetail: [],
13 | roomdetail: []
14 | },
15 | /**
16 | * 生命周期函数--监听页面加载
17 | */
18 | onLoad: function (options) {
19 | var that = this;
20 | app.getUserInfo();
21 | wx.request({
22 | url: con.getorderbyid,
23 | data: {
24 | wxappid: con.wyy_user_wxappid,
25 | id: options.id
26 | },
27 | method: 'GET',
28 | header: {
29 | "Content-Type": 'application/json'
30 | },
31 | success: function (res) {
32 | that.setData({
33 | orderdetail: res.data.info,
34 | roomdetail: res.data.info.good
35 | })
36 | console.log(res.data.info)
37 | order_detail = res.data.info
38 | }
39 | })
40 | },
41 | // 提交支付
42 | formSubmit: function (e) {
43 | console.log(order_detail)
44 | var that = this;
45 | app.getUserInfo();
46 | // console.log(b)
47 | var a = e.detail.value;
48 | // 判断输入项是否为空
49 | wx.request({
50 | url: con.again_order,
51 | data: {
52 | wxappid: con.wyy_user_wxappid,
53 | name: order_detail.name,
54 | openid: app.globalData.openid,
55 | phone: order_detail.phone,
56 | startdate: order_detail.kdate,
57 | enddate: order_detail.jdate,
58 | roomnum: order_detail.num,
59 | roomname: order_detail.guest_id,
60 | price: order_detail.pay_price,
61 | id: order_detail.id,
62 | out_trade_no: order_detail.out_trade_no
63 | },
64 | method: 'POST',
65 | header: {
66 | "Content-Type": "application/x-www-form-urlencoded"
67 | },
68 | success(res) {
69 | var zhifu = res.data;
70 | console.log(res.data);
71 | stat = res.data.status;
72 | if (stat == 1) {
73 | // 调用支付
74 | wx.requestPayment({
75 | 'timeStamp': zhifu.timeStamp,
76 | 'nonceStr': zhifu.nonceStr,
77 | 'package': zhifu.package,
78 | 'signType': zhifu.signType,
79 | 'paySign': zhifu.paySign,
80 | 'success': function (res1) {
81 | console.log(zhifu.out_trade_no)
82 | console.log(res1)
83 | if (res1.errMsg == "requestPayment:ok") {
84 | console.log(con.wyy_user_wxappid)
85 | // 更改支付状态
86 | wx.request({
87 | url: con.order_success,
88 | data: {
89 | wxappid: con.wyy_user_wxappid,
90 | out_trade_no: zhifu.out_trade_no,
91 | id: order_detail.goods_id,
92 | orderNum: order_detail.room_num
93 | },
94 | method: 'GET',
95 | header: {
96 | "Content-Type": 'application/json'
97 | },
98 | success: function (res1) {
99 | console.log(zhifu.out_trade_no)
100 | console.log(res1)
101 | that.setData({
102 |
103 | })
104 | console.log(res1.data);
105 | if (res1.data.status == 1) {
106 | wx.showToast({
107 | title: res1.data.errMsg,
108 | icon: 'success',
109 | duration: 1000,
110 | mask: true
111 | })
112 | that.showModal()
113 | setTimeout(function () {
114 | wx.switchTab({
115 | url: '../mine'
116 | })
117 | }, 2000)
118 | } else {
119 | wx.showToast({
120 | title: res1.data.errMsg,
121 | icon: 'loading',
122 | duration: 2000,
123 | mask: true
124 | })
125 | }
126 | }
127 | });
128 | } else {
129 | wx.showToast({
130 | title: '支付失败',
131 | icon: 'loading',
132 | duration: 2000,
133 | mask: true
134 | })
135 | }
136 |
137 | },
138 | 'fail': function (res) {
139 | console.log(res)
140 | wx.showToast({
141 | title: '支付失败',
142 | icon: 'loading',
143 | duration: 2000,
144 | mask: true
145 | })
146 | },
147 | 'complete': function (res) {
148 |
149 | }
150 | })
151 | } else {
152 | wx.showToast({
153 | title: res.data.errMsg,
154 | icon: 'loading',
155 | duration: 2000,
156 | mask: true
157 | })
158 | }
159 | }
160 | })
161 | },
162 | /**
163 | * 用户点击右上角分享
164 | */
165 | onShareAppMessage: function () {
166 |
167 | },
168 | // 底部弹窗
169 | showModal: function () {
170 | // 显示遮罩层
171 | var animation = wx.createAnimation({
172 | duration: 200,
173 | timingFunction: "linear",
174 | delay: 0
175 | })
176 | this.animation = animation
177 | animation.translateY(300).step()
178 | this.setData({
179 | animationData: animation.export(),
180 | showModalStatus: true
181 | })
182 | setTimeout(function () {
183 | animation.translateY(0).step()
184 | this.setData({
185 | animationData: animation.export()
186 | })
187 | }.bind(this), 200)
188 | },
189 | })
--------------------------------------------------------------------------------
/pages/hotel/mine/orderdetail/orderdetail.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/hotel/mine/orderdetail/orderdetail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 订单信息
5 | 总金额¥{{orderdetail.pay_price}}
6 |
7 | 订单状态:{{orderdetail.state == 0 ? "未支付" : "已支付"}}
8 | 订单号:{{orderdetail.out_trade_no}}
9 | 订单创建时间:{{orderdetail.order_time}}
10 | 姓名:{{orderdetail.name}}
11 | 联系方式:{{orderdetail.phone}}
12 |
13 |
14 |
15 | 房间信息
16 | {{roomdetail.guest_id}}{{orderdetail.room_num}}间
17 |
18 |
19 | {{roomdetail.is_tj == 1 ? "推荐" : ""}}
20 | {{roomdetail.is_wifi == 1 ? "无线上网" : ""}}
21 | {{roomdetail.is_window == 1 ? "有窗" : ""}}
22 |
23 | 房间大小:{{roomdetail.area}}m²
24 | 楼层:{{roomdetail.floor}}楼
25 | 剩余数量:{{roomdetail.else_num}}间
26 | 入住时间:{{orderdetail.check_in}}至{{orderdetail.leave_out}}
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/pages/hotel/mine/orderdetail/orderdetail.wxss:
--------------------------------------------------------------------------------
1 | .container {
2 | width: 96%;
3 | margin: 20rpx auto 0;
4 | }
5 | .title {
6 | overflow: hidden;
7 | }
8 | .font_style {
9 | font-size: 30rpx;
10 | font-weight: bolder;
11 | }
12 | .xueyuan_top_left {
13 | float: left;
14 | }
15 | .xueyuan_top_right {
16 | float: right;
17 | }
18 | .orderstate {
19 | color: gray;
20 | font-size: 30rpx;
21 | margin-top: 20rpx;
22 | font-weight: bolder;
23 | }
24 | page {
25 | background: #F8F8FF;
26 | }
27 | .sspan {
28 | font-weight: bolder;
29 | }
30 | .order {
31 | background: white;
32 | border: 1rpx solid lightgray;
33 | padding: 20rpx 10rpx;
34 | border-radius:10rpx;
35 | }
36 | .commodity_screen {
37 | width: 100%;
38 | height: 100%;
39 | position: fixed;
40 | top: 0;
41 | left: 0;
42 | background: #000;
43 | opacity: 0.4;
44 | overflow: hidden;
45 | z-index: 1000;
46 | color: #fff;
47 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/utils/data.js:
--------------------------------------------------------------------------------
1 | var WYY_HOST_URL = "https://wxapi.weiyunyi.com";
2 | var type = "Hotel";
3 | module.exports = {
4 | wyy_host_api_url:WYY_HOST_URL,
5 | wyy_user_wxappid: "13",
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 | homegetartical: WYY_HOST_URL + "/Wap.php/" + type +"/homegetartical",
48 | homegetphotogroup: WYY_HOST_URL + "/Wap.php/" + type + "/homegetphotogroup",
49 | homegetprelist: WYY_HOST_URL + "/Wap.php/" + type + "/homegetprelist",
50 | gettarticallist: WYY_HOST_URL + "/Wap.php/" + type + "/gettarticallist",
51 | getartical: WYY_HOST_URL + "/Wap.php/" + type + "/getartical",
52 | getphotodetail: WYY_HOST_URL + "/Wap.php/" + type + "/getphotodetail",
53 | getmap: WYY_HOST_URL + "/Wap.php/" + type + "/getmap",
54 |
55 | // 酒店首页接口
56 | index: WYY_HOST_URL + "/Wap.php/" + type + "/index",
57 | // 房间详情
58 | gethousebyid: WYY_HOST_URL + "/Wap.php/" + type + "/gethousebyid",
59 | // 订单
60 | set_order: WYY_HOST_URL + "/Wap.php/" + type + "/set_order",
61 | // 个人中心
62 | get_center: WYY_HOST_URL + "/Wap.php/" + type + "/get_center",
63 | // 订单列表
64 | order_list: WYY_HOST_URL + "/Wap.php/" + type + "/order_list",
65 | // 订单详情
66 | getorderbyid: WYY_HOST_URL + "/Wap.php/" + type + "/getorderbyid",
67 | // 改变订单状态
68 | order_success: WYY_HOST_URL + "/Wap.php/" + type + "/order_success",
69 | // 再支付
70 | again_order: WYY_HOST_URL + "/Wap.php/" + type + "/again_order",
71 | // 提交评论
72 | evalue_add: WYY_HOST_URL + "/Wap.php/" + type + "/evalue_add",
73 | // 评论列表
74 | evalue_list: WYY_HOST_URL + "/Wap.php/" + type + "/evalue_list",
75 | // 获取域名
76 | get_copyright: WYY_HOST_URL + "/Wap.php/" + type + "/get_copyright"
77 | }
--------------------------------------------------------------------------------
/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 | color:gray;
28 | font-size:30rpx;
29 | font-weight: bolder;
30 | text-indent: 2em;
31 | }
32 | /*//标题 */
33 | .wxParse-div{margin: 0;padding: 0;}
34 | .wxParse-h1{ font-size:2em; margin: .67em 0 }
35 | .wxParse-h2{ font-size:1.5em; margin: .75em 0 }
36 | .wxParse-h3{ font-size:1.17em; margin: .83em 0 }
37 | .wxParse-h4{ margin: 1.12em 0}
38 | .wxParse-h5 { font-size:.83em; margin: 1.5em 0 }
39 | .wxParse-h6{ font-size:.75em; margin: 1.67em 0 }
40 |
41 | .wxParse-h1 {
42 | font-size: 18px;
43 | font-weight: 400;
44 | margin-bottom: .9em;
45 | }
46 | .wxParse-h2 {
47 | font-size: 16px;
48 | font-weight: 400;
49 | margin-bottom: .34em;
50 | }
51 | .wxParse-h3 {
52 | font-weight: 400;
53 | font-size: 15px;
54 | margin-bottom: .34em;
55 | }
56 | .wxParse-h4 {
57 | font-weight: 400;
58 | font-size: 14px;
59 | margin-bottom: .24em;
60 | }
61 | .wxParse-h5 {
62 | font-weight: 400;
63 | font-size: 13px;
64 | margin-bottom: .14em;
65 | }
66 | .wxParse-h6 {
67 | font-weight: 400;
68 | font-size: 12px;
69 | margin-bottom: .04em;
70 | }
71 |
72 | .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
73 |
74 | .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
75 | .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
76 | .wxParse-pre{white-space:pre}
77 | .wxParse-big{font-size:1.17em}
78 | .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
79 | .wxParse-sub{vertical-align:sub}
80 | .wxParse-sup{vertical-align:super}
81 | .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
82 | /*wxparse-自定义个性化的css样式*/
83 | /*增加video的css样式*/
84 | .wxParse-strong,.wxParse-s{display: inline}
85 | .wxParse-a{
86 | color: deepskyblue;
87 | word-break:break-all;
88 | overflow:auto;
89 | }
90 |
91 | .wxParse-video{
92 | text-align: center;
93 | margin: 10px 0;
94 | }
95 |
96 | .wxParse-video-video{
97 | width:100%;
98 | }
99 |
100 | .wxParse-img{
101 | /*background-color: #efefef;*/
102 | overflow: hidden;
103 | }
104 |
105 | .wxParse-blockquote {
106 | margin: 0;
107 | padding:10px 0 10px 5px;
108 | font-family:Courier, Calibri,"宋体";
109 | background:#f5f5f5;
110 | border-left: 3px solid #dbdbdb;
111 | }
112 |
113 | .wxParse-code,.wxParse-wxxxcode-style{
114 | display: inline;
115 | background:#f5f5f5;
116 | }
117 | .wxParse-ul{
118 | margin: 20rpx 10rpx;
119 | }
120 |
121 | .wxParse-li,.wxParse-li-inner{
122 | display: flex;
123 | align-items: baseline;
124 | margin: 10rpx 0;
125 | }
126 | .wxParse-li-text{
127 |
128 | align-items: center;
129 | line-height: 20px;
130 | }
131 |
132 | .wxParse-li-circle{
133 | display: inline-flex;
134 | width: 5px;
135 | height: 5px;
136 | background-color: #333;
137 | margin-right: 5px;
138 | }
139 |
140 | .wxParse-li-square{
141 | display: inline-flex;
142 | width: 10rpx;
143 | height: 10rpx;
144 | background-color: #333;
145 | margin-right: 5px;
146 | }
147 | .wxParse-li-ring{
148 | display: inline-flex;
149 | width: 10rpx;
150 | height: 10rpx;
151 | border: 2rpx solid #333;
152 | border-radius: 50%;
153 | background-color: #fff;
154 | margin-right: 5px;
155 | }
156 |
157 | /*.wxParse-table{
158 | width: 100%;
159 | height: 400px;
160 | }
161 | .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
162 | display: flex;
163 | flex-direction: row;
164 | }
165 | .wxParse-th,.wxParse-td{
166 | display: flex;
167 | width: 580px;
168 | overflow: auto;
169 | }*/
170 |
171 | .wxParse-u {
172 | text-decoration: underline;
173 | }
174 | .wxParse-hide{
175 | display: none;
176 | }
177 | .WxEmojiView{
178 | align-items: center;
179 | }
180 | .wxEmoji{
181 | width: 16px;
182 | height:16px;
183 | }
184 | .wxParse-tr{
185 | display: flex;
186 | border-right:1px solid #e0e0e0;
187 | border-bottom:1px solid #e0e0e0;
188 | border-top:1px solid #e0e0e0;
189 | }
190 | .wxParse-th,
191 | .wxParse-td{
192 | flex:1;
193 | padding:5px;
194 | font-size:28rpx;
195 | border-left:1px solid #e0e0e0;
196 | word-break: break-all;
197 | }
198 | .wxParse-td:last{
199 | border-top:1px solid #e0e0e0;
200 | }
201 | .wxParse-th{
202 | background:#f0f0f0;
203 | border-top:1px solid #e0e0e0;
204 | }
205 | .wxParse-del{
206 | display: inline;
207 | }
208 |
--------------------------------------------------------------------------------
/效果图预览/微信截图_20171011164947.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/效果图预览/微信截图_20171011164947.png
--------------------------------------------------------------------------------
/效果图预览/微信截图_20171011165019.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/效果图预览/微信截图_20171011165019.png
--------------------------------------------------------------------------------
/效果图预览/微信截图_20171011165033.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/效果图预览/微信截图_20171011165033.png
--------------------------------------------------------------------------------
/效果图预览/微信截图_20171011165053.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/效果图预览/微信截图_20171011165053.png
--------------------------------------------------------------------------------
/效果图预览/微信截图_20171011165124.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/效果图预览/微信截图_20171011165124.png
--------------------------------------------------------------------------------
/效果图预览/微信截图_20171011175601.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhoujiae/hellohotel/58d5107f59b513139dc2150afd46d9f50ada7be8/效果图预览/微信截图_20171011175601.png
--------------------------------------------------------------------------------