// miniprogram/pages/testSAS/testSAS.js
// const db = wx.cloud.database()
const baseUrl = "https://fare.somnisix.top/";
const authorization = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijk5YzI3MjI2LTdkOWQtNDhiOC1hYjlhLWM4YjVjYWZiZGNkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.zITQOINFkHs19_1RAgHS4I9YMaVxVq0Dsn3t6r_K7rv3rXvJy0sMtodejIMi_PNa_m4uQYxnU-6k3wC2LZht_Q";
const api = "system/questionInvest";
const qnaire = require("./data.js")
var ans = new Array(24)
var ansJson = []

const homeApi = "https://fare.somnisix.top";
const homeApiTest = "http://localhost:8080";
const token = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijk5YzI3MjI2LTdkOWQtNDhiOC1hYjlhLWM4YjVjYWZiZGNkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.zITQOINFkHs19_1RAgHS4I9YMaVxVq0Dsn3t6r_K7rv3rXvJy0sMtodejIMi_PNa_m4uQYxnU-6k3wC2LZht_Q";

Page({
	data: {
		qnaire: [],
		activeIcon: "/subpages/icons/ic_selected_radio.svg",
		normalIcon: "/subpages/icons/ic_radio.svg",
		activeColor: "color:#0BC3AA;",
		normalColor: "color:#666666;",
		showDateDialog: false,
		currentDate: "",
		currentDateItem: null,
		answerJson: [],
		columns: [[], []],
		BMI: null,
		mInputScrollId: null,
		weight: 0,
		height: 0,
		promptTextMessageFlag: false,//结果弹窗
		isPrivacyAgreed: false, // 隐私条款是否勾选  
		privacyDetailShow: false,// 隐私条款弹出页是否显示  
		changeValue: '',//
		comScore: 0,
		comScoreStatus: '',
		comScoreIndex: 0,
		comScoreDesc: "如果你在这一级别内，那么你的睡眠质量可就亮起红灯了。你必须警惕，因为你的睡眠质量确实比较糟糕，健康状况明显受损。饮食起居会受到一定影响，甚至部分工作你都开始感觉吃力。",
		ratingResultsList: [{
			title: "非常好",
			icon: "/subpages/icons/ic_triangle_down_1.svg",
			color: "#70B3FE"
		}, {
			title: "良好",
			icon: "/subpages/icons/ic_triangle_down_2.svg",
			color: "#68D89E"
		}, {
			title: "一般",
			icon: "/subpages/icons/ic_triangle_down_3.svg",
			color: "#FFA95A"
		}, {
			title: "差",
			icon: "/subpages/icons/ic_triangle_down_4.svg",
			color: "#FC726E"
		}],
		formatter(type, value) {
			if (type === 'hour') {
				return `${value}时`;
			}
			if (type === 'minute') {
				return `${value}分`;
			}
			return value;
		},
		hotel: '',//酒店
		room: '',//房间
		intervalId1: null,
		intervalId2: null,//解除授权
		oldJsonList: null,
	},
	onOpenDateDialog(event) {
		const item = event.currentTarget.dataset.item;
		const value = item.value || "";
		this.setData({ currentDateItem: item, currentDate: value, showDateDialog: true });
	},
	onCloseDateDialog() {
		this.setData({ showDateDialog: false, currentDateItem: null });
	},
	onCloseResultsDialog() {
		this.setData({ promptTextMessageFlag: false });
	},
	onDateInput(event) {
		const item = this.data.currentDateItem;
		if (!item) {
			return
		}
		let oldJsonList = this.data.qnaire;

		for (let i = 0; i < oldJsonList.length; i++) {
			const element = oldJsonList[i];
			if (element.num == item.num) {
				element['value'] = event.detail;
				break;
			}
		}

		this.setData({
			qnaire: oldJsonList
		});
		this.onCloseDateDialog()
	},
	onChangeInput(event) {
		const item = event.currentTarget.dataset.item
		// console.log(item);

		let oldJsonList = this.data.qnaire;

		for (let i = 0; i < oldJsonList.length; i++) {
			const element = oldJsonList[i];
			if (element.num == item.num) {
				element['questionValue'] = event.detail.value;
				break;
			}
		}

		this.setData({
			qnaire: oldJsonList
		});
	},
	onChangeFocus(event) {
		const item = event.currentTarget.dataset.item
		const that = this;
		setTimeout(() => {
			that.setData({
				mInputScrollId: "item" + item.num
			});
		}, 200);
	},
	onChangePrivacy(event) {
		const check = event.detail;

		this.setData({
			checkedPrivacy: check
		});

	},
	onChangeRadio(event) {
		const item = event.currentTarget.dataset.item
		// console.log(item);

		let oldJsonList = this.data.qnaire;

		for (let i = 0; i < oldJsonList.length; i++) {
			const element = oldJsonList[i];
			if (element.num == item.num) {
				element['value'] = event.detail;
				break;
			}
		}

		this.setData({
			qnaire: oldJsonList
		});

	},
	handleTouchMove: function () {
		return false; // 阻止手动滑动  
	},
	hideModal: function () {
		this.setData({
			privacyDetailShow: false
		});
	},

	showPrivacyDetail: function () {
		this.setData({
			privacyDetailShow: true
		});
		// 这里可以添加代码来显示隐私条款弹出页，比如使用 wx.showModal 或自定义组件  
	},
	hidePrivacyPolicy() {
		this.setData({
			privacyDetailShow: false
		});
	},
	handleInputChange: function (e) {
		this.setData({
			height: e.detail.value
		});
		if (this.data.id == 1) {
			this.setData({
				weight: e.detail.value
			});
		}
		if (this.data.id == 3) {
			this.setData({
				weight: e.detail.value
			});
			if (this.data.weight >= 0 || this.data.height >= 0) {
				var bmi = this.data.weight / (this.data.height * this.data.height);
				this.setData({
					BMI: bmi
				});
			}
		}
	},
	radioChange: function (e) {
		console.log(e.detail.value)
		this.setData({
			changeValue: e.detail.value
		});
	},

	calculateTotalHours: function (hoursInput, minutesInput) {

		// 获取小时和分钟的值，如果为空或不是数字，则设置为0  
		let hours = parseFloat(hoursInput.value) || 0;
		let minutes = parseFloat(minutesInput.value) || 0;

		// 将分钟转换为小时的小数部分  
		// let minutesInHours = minutes / 60;  

		// 计算总时间（小时）  
		// let totalHours = hours + minutesInHours;  

		// 显示结果  
		// document.getElementById('result').textContent = `总时间: ${totalHours.toFixed(2)} 小时`;  
		// return totalHours.toFixed(2);
		return hours * 60 + minutes;
	},

	formSubmit: function () {
		if (!this.data.checkedPrivacy) {
			wx.showToast({
				icon: "none",
				title: "请先阅读并同意《舒眠调查问卷隐私条款》"
			})
			return;
		}
		var finish = true;
		var _this = this;
		let oldJsonList = _this.data.qnaire;
		var mInputScrollId = null;
		for (let i = 0; i < oldJsonList.length; i++) {
			const element = oldJsonList[i];
			if (!element.value) {
				finish = false;
				console.log("未完成的：", element.num);
				mInputScrollId = "item" + element.num;
				wx.showModal({
					title: '无法提交',
					content: '您还有部分题目未完成，请检查后重新提交',
					showCancel: false,
					confirmColor: '#0BC3AA',
					confirmText: "好的",
					success(res) {
						_this.setData({
							mInputScrollId: mInputScrollId
						})
					}
				})
				return;
			} else {
				// if (element.type == "radio&input" && !element.questionValue) {
				// 	finish = false;
				// }
			}

		}
		console.log('oldJsonList==' + JSON.stringify(oldJsonList));
		if (finish == false) {
			wx.showModal({
				title: '无法提交',
				content: '您还有部分题目未完成，请检查后重新提交',
				showCancel: false,
				confirmColor: '#0BC3AA',
				confirmText: "好的",
				success(res) {
					_this.setData({
						mInputScrollId: mInputScrollId
					})
				}
			})
		} else {
			wx.showLoading({
				title: '加载中',
			})
			this.setData({
				oldJsonList: oldJsonList,
			});
			setTimeout(function () {
				wx.hideLoading({
					success(res) {
						_this.submitDB();
					}
				})
			}, 2000)
		}
	},

	answer2db: function () {
		// db.collection('SAS').add({
		//   data: {
		//     answer: this.data.answer
		//   },
		//   success (res) {
		//     console.log(res._id);
		//   },
		//   fail (res) {
		//     wx.showToast({
		//       icon: 'none',
		//       title: '新增记录失败'
		//     })
		//     console.error('[数据库] [新增记录] 失败：', err)
		//   }
		// })
		const answerJson = this.data.oldJsonList;
		console.log('answerJson=' + JSON.stringify(answerJson))
		let totalAllTemp = 0;
		let value1 = answerJson[0].value;
		let value2 = answerJson[1].value;
		let value3 = answerJson[2].value;
		let value4 = answerJson[3].value;
		let value5a = answerJson[4].value;
		let value5b = answerJson[5].value;
		let value5c = answerJson[6].value;
		let value5d = answerJson[7].value;
		let value5e = answerJson[8].value;
		let value5f = answerJson[9].value;
		let value5g = answerJson[10].value;
		let value5h = answerJson[11].value;
		let value5i = answerJson[12].value;
		let value5j = answerJson[13].value;
		let value5jDes = '';//这个值没有算
		let value6 = answerJson[14].value;
		let value7 = answerJson[15].value;
		let value8 = answerJson[16].value;
		let value9 = answerJson[17].value;
		let value10 = answerJson[18].value;
		let value11 = answerJson[19].value;
		let value12 = answerJson[20].value;
		let value13 = answerJson[21].value;
		let value14 = answerJson[22].value;
		let value15 = answerJson[23].value;
		let value15Des = '';//这个值没有算

		//计算规则  https://mp.weixin.qq.com/s/QyTzuPoNErMjc2KcA1M61g
		let comA = 0;//条目6
		let comB = 0;
		let comB1 = 0;
		let comC = 0;
		let comD = 0;
		let comE = 0;
		let comF = 0;
		let comG = 0;

		comA = this.resultABCD(value6);
		comB1 = this.resultABCD(value2) + this.resultABCD(value5a);
		console.log("comB1=" + comB1);
		if (comB1 == 0) {
			comB = 0;
		} else if (comB1 >= 1 && comB1 <= 2) {
			comB = 1;
		} else if (comB1 >= 3 && comB1 <= 4) {
			comB = 2;
		} else if (comB1 >= 5 && comB1 <= 6) {
			comB = 3;
		}
		let value41 = parseInt((value4.split(':')[0]), 10) || 0;
		let value42 = parseInt((value4.split(':')[1]), 10) || 0;
		let value43 = value41 * 60 + value42
		console.log("value43=" + value43);
		if (value43 > 420) {
			comC = 0;
		} else if (value43 >= 360 && value43 <= 420) {
			comC = 1;
		} else if (value43 >= 300 && value43 < 360) {
			comC = 2;
		} else if (value43 < 300) {
			comC = 3;
		}


		let datediff = this.calculateTimeDifference(value1, value3);
		console.log("datediff=" + datediff);
		let sleepRate = datediff ? ((value43 / datediff) * 100) : 0;
		console.log("sleepRate=" + sleepRate);
		if (sleepRate >= 85) {
			comD = 0;
		} else if (sleepRate >= 75 && sleepRate <= 84) {
			comD = 1;
		} else if (sleepRate >= 65 && sleepRate < 74) {
			comD = 2;
		} else if (sleepRate < 65) {
			comD = 3;
		}

		let value5All = this.resultABCD(value5b)
			+ this.resultABCD(value5c)
			+ this.resultABCD(value5d)
			+ this.resultABCD(value5e)
			+ this.resultABCD(value5f)
			+ this.resultABCD(value5g)
			+ this.resultABCD(value5h)
			+ this.resultABCD(value5i)
			+ this.resultABCD(value5j);
		console.log("value5All=" + value5All);
		if (value5All == 0) {
			comE = 0;
		} else if (value5All >= 1 && value5All <= 9) {
			comE = 1;
		} else if (value5All >= 10 && value5All <= 18) {
			comE = 2;
		} else if (value5All >= 19 && value5All <= 27) {
			comE = 3;
		}

		comF = this.resultABCD(value7);
		console.log("comF=" + comF);
		let valueGAll = this.resultABCD(value8) + this.resultABCD(value9);
		console.log("valueGAll=" + valueGAll);
		if (valueGAll == 0) {
			comG = 0;
		} else if (valueGAll >= 1 && valueGAll <= 2) {
			comG = 1;
		} else if (valueGAll >= 3 && valueGAll <= 4) {
			comG = 2;
		} else if (valueGAll >= 5 && valueGAll <= 6) {
			comG = 3;
		}

		console.log('comA=' + comA);
		console.log('comB=' + comB);
		console.log('comC=' + comC);
		console.log('comD=' + comD);
		console.log('comE=' + comE);
		console.log('comF=' + comF);
		console.log('comG=' + comG);

		let comAll = comA + comB + comC + comD + comE + comF + comG;
		let comScoreIndex = 0;
		let _comScoreStatus = "";
		let _comScoreDesc = "";
		if (comAll >= 0 && comAll <= 5) {
			_comScoreStatus = "非常好";
		} else if (comAll >= 6 && comAll <= 10) {
			_comScoreStatus = "良好";
			comScoreIndex = 1;
		} else if (comAll >= 11 && comAll <= 15) {
			_comScoreStatus = "一般";
			comScoreIndex = 2;
		} else {
			// if (comAll >= 16 && comAll <= 21) 
			_comScoreStatus = "差";
			comScoreIndex = 3;
		}

		if (this.judgmentScoreRange(comAll,0,5)) {
			_comScoreDesc = "你目前的睡眠质量非常高，而且健康状况良好，这一切应该继续保持下去。"
		} else if (this.judgmentScoreRange(comAll, 6, 10)) {
			_comScoreDesc = "你的睡眠质量平平，健康状况也受到影响， 如果再不引起你对睡眠质量的足够重视， 那么你的睡眠质量很可能会迅速下降，向下一级别发展。"
		} else if (this.judgmentScoreRange(comAll, 11, 15)) {
			_comScoreDesc = "如果你在这一级别内，那么你的睡眠质量可 就亮起红灯了。你必须警惕，因为你的睡眠质量确实比较糟糕，健康状况明显受损。饮食起居会受到一定影响，甚至部分工作你都开始感觉吃力。"
		} else {
			_comScoreDesc = "天啊！你的睡眠质量已经到了令人发指的地 步—长期睡眠不足导致了你的健康状况严重恶化，这就是你工作力不从心，情绪起伏不定的原因。"
		}

		console.log('comAll=' + comAll + ',comScoreStatus=' + _comScoreStatus);
		this.setData({
			comScore: comAll,
			comScoreStatus: _comScoreStatus,
			comScoreIndex,
			comScoreDesc: _comScoreDesc,
			promptTextMessageFlag: true,
		})

		var that = this;
		const { nickName } = wx.getStorageSync('userInfo');
		const unionid = wx.getStorageSync('unionid');
		console.log('nickName==' + nickName);
		console.log('unionid==' + unionid);
		let surveyData = {
			hotel: this.data.hotel,
			room: this.data.room,
			userId: nickName,
			id2: unionid,
			value1: value1,
			value2: value2,
			value3: value3,
			value4: value4,
			value5a: value5a,
			value5b: value5b,
			value5c: value5c,
			value5d: value5d,
			value5e: value5e,
			value5f: value5f,
			value5g: value5g,
			value5h: value5h,
			value5i: value5i,
			value5j: value5j,
			value5jDes: value5jDes,
			value6: value6,
			value7: value7,
			value8: value8,
			value9: value9,
			value10: value10,
			value11: value11,
			value12: value12,
			value13: value13,
			value14: value14,
			value15: value15,
			value15Des: value15Des,
			value16: comAll,//备用16(评分)
			value17: _comScoreStatus,//备用17(评分说明)
			value18: _comScoreDesc,
			value18: comA + ',' + comB + ',' + comC + ',' + comD + ',' + comE + ',' + comF + ',' + comG //备用18(comA、comB、comC、comD、comE、comF、comG)
		};

		// 将surveyData发送到服务器  
		console.log('提交的问卷数据：', surveyData);

		//提交到数据库
		wx.request({
			url: `${homeApi}/system/questionInvest`, //
			method: 'POST',
			header: {
				'content-type': 'application/json', // 默认值
				'Authorization': 'Bearer ' + token // 在头部设置认证信息，例如使用Bearer Token
			},
			data: surveyData,
			success(res) {
				console.log('res===' + JSON.stringify(res));
				console.log('res.code===' + res.data.code);
				if (res && res.data && res.data.code == 200) {
					wx.showToast({
						title: '问卷提交成功',
						icon: 'success',
						duration: 2000
					});
					if (that.data.intervalId1) {
						clearInterval(that.data.intervalId1);
						that.data.intervalId1 = null;
					}
				}
			},
			fail: function (error) {
				console.error('error', error);
			},
			complete: function (e) {
			}
		});

	},
	judgmentScoreRange(scoreValue, startScore, endScore) {
		return scoreValue >= startScore && scoreValue <= endScore;
	},
	resultABCD: function (a) {
		if (a == 'a') {
			return 0;
		} else if (a == 'b') {
			return 1;
		} else if (a == 'c') {
			return 2;
		} else if (a == 'd') {
			return 3;
		}
	},
	sleepState: function (a, b) {
		console.log('a=' + a + ',b=' + b);
		if (a == 'A') {
			if (b >= 1 && b <= 9) {
				return '不足';
			} else if (b >= 10 && b <= 12) {
				return '适中';
			} else if (b >= 13) {
				return '过长';
			} else {
				return '未知';
			}
		} else if (a == 'B') {
			if (b >= 1 && b <= 9) {
				return '不足';
			} else if (b >= 10 && b <= 12) {
				return '适中';
			} else if (b >= 13) {
				return '过长';
			} else {
				return '未知';
			}
		} else if (a == 'C') {
			if (b >= 1 && b <= 9) {
				return '不足';
			} else if (b >= 10 && b <= 12) {
				return '适中';
			} else if (b >= 13) {
				return '过长';
			} else {
				return '未知';
			}
		} else if (a == 'D') {
			if (b >= 1 && b <= 9) {
				return '不足';
			} else if (b >= 10 && b <= 12) {
				return '适中';
			} else if (b >= 13) {
				return '过长';
			} else {
				return '未知';
			}
		} else {
			return '未知';
		}
	},
	// 将时间字符串转换为分钟数  
	timeStringToMinutes: function (timeStr) {
		var parts = timeStr.split(":");
		return parseInt(parts[0], 10) * 60 + parseInt(parts[1], 10);
	},

	// 将分钟数转换回时间字符串格式 HH:mm  
	minutesToTimeString: function (minutes) {
		var hours = Math.floor(minutes / 60);
		var mins = minutes % 60;
		var minsStr = mins < 10 ? "0" + mins : mins.toString();
		return hours.toString() + ":" + minsStr;
	},

	// 计算时间差（分钟）  
	calculateTimeDifference: function (sleepTimeStr, wakeUpTimeStr) {
		// 将时间字符串转换为分钟  
		var sleepTimeMinutes = this.timeStringToMinutes(sleepTimeStr);
		var wakeUpTimeMinutes = this.timeStringToMinutes("24:00") + this.timeStringToMinutes(wakeUpTimeStr); // 加上第二天的0点到起床时间的分钟数  

		// 计算时间差  
		var diffInMinutes = wakeUpTimeMinutes - sleepTimeMinutes;

		// 将分钟数转换回时间字符串格式 HH:mm  
		var diffInHours = Math.floor(diffInMinutes / 60);
		var diffInMins = diffInMinutes % 60;

		// 返回时间差字符串  
		console.log("diffInMinutes==" + diffInMinutes)
		return diffInMinutes;
	},
	// startInterval: function () {
	// 	 var that = this;
	// 	 if (!that.data.intervalId1) {
	// 	 	that.data.intervalId1 = setInterval(() => {
	// 	 		that.answer2db();
	// 	 	}, 1000);
	// 	 }  
	// },
	// clearInterval: function () {
	// 	   var that = this;
	//   	   if (that.data.intervalId1) {
	//   		 clearInterval(that.data.intervalId1);  
	//   		 that.data.intervalId1 = null;
	//   	   }
	//   },
	submitDB: function () {
		var that = this;
		if (!that.data.intervalId1) {
			that.data.intervalId1 = setInterval(() => {
				that.answer2db();
			}, 1000);
		}
	},
	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function (options) {


		let oldJsonList = qnaire.qnaire
		oldJsonList.forEach(element => {

			let mapArray = [];
			if (element.type == "radio" || element.type == "radio&input") {
				for (let key in element.option) {
					mapArray.push({ key: key, value: element.option[key] });
				}
				element['options'] = mapArray;
			}
		});


		// console.log(oldJsonList);

		let columns = [[], []];

		for (let i = 0; i < 24; i++) {
			if (i < 10) {
				columns[0].push("0" + i);
			} else {
				columns[0].push("" + i);
			}
		}


		for (let i = 0; i < 60; i++) {
			if (i < 10) {
				columns[1].push("0" + i);
			} else {
				columns[1].push("" + i);
			}
		}
		console.log(columns);



		this.setData({
			privacyDetailShow: false,
			qnaire: oldJsonList,
			columns
		});
		console.log('option.res=' + JSON.stringify(wx.getStorageSync('res')));
		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
			wx.showModal({
				title: '提示',
				content: '请先扫描房间二维码',
				showCancel: false
			});

			setTimeout(function () {
				wx.reLaunch({
					url: '/pages/scan/scan',
				})
			}, 2000) // 设置延时时间，单位为毫秒
		} else if (wx.getStorageSync('res').result.split('|').length != 2) {
			wx.showModal({
				title: '提示',
				content: '房间二维码不正确，请重新扫码',
				showCancel: false
			});

			setTimeout(function () {
				wx.reLaunch({
					url: '/pages/scan/scan',
				})
			}, 2000) // 设置延时时间，单位为毫秒
		} else {
			// const expiresAt = wx.getStorageSync('scanResultExpiresAt');
			// const now = Date.now() 
			// if (expiresAt || expiresAt < now) {
			//   // 扫码结果已过期  
			//   wx.showToast({  
			//     title: '扫码结果失效或已过期，请重新扫码',  
			//     icon: 'none'  
			//   });  
			//   // 清除过期的扫码结果  
			//   wx.removeStorageSync('scanResultExpiresAt');  
			//   setTimeout(function() {
			//       wx.reLaunch({
			//       		url: '/pages/scan/scan',
			//       })
			//     }, 2000) // 设置延时时间，单位为毫秒

			// }else{
			// 	//续期
			// 	wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000)
			// }

			let hotelTemp = '';
			let roomTemp = '';

			hotelTemp = wx.getStorageSync('res').result.split('|')[0];
			roomTemp = wx.getStorageSync('res').result.split('|')[1];
			this.setData({
				hotel: hotelTemp,
				room: roomTemp,
			});
		}
	},

	/**
	 * 生命周期函数--监听页面初次渲染完成
	 */
	onReady: function () {

	},

	/**
	 * 生命周期函数--监听页面显示
	 */
	onShow: function (options) {
		// var that = this;
		// if (!that.data.intervalId2) {
		// 	that.data.intervalId2 = setInterval(() => {
		// 		// 这里执行你的代码  
		// 		console.log('sleepQualityIndexAssessment页面：'+Date.now());
		// 	}, 10000);
		// }
	},

	/**
	 * 生命周期函数--监听页面隐藏
	 */
	onHide: function () {
		var that = this;
		if (that.data.intervalId1) {
			clearInterval(that.data.intervalId1);
			that.data.intervalId1 = null;
		}
		// if (that.data.intervalId2) {
		//   clearInterval(that.data.intervalId2);  
		//   that.data.intervalId2 = null;
		// }
	},

	/**
	 * 生命周期函数--监听页面卸载
	 */
	onUnload: function () {
		var that = this;
		if (that.data.intervalId1) {
			clearInterval(that.data.intervalId1);
			that.data.intervalId1 = null;
		}
		// if (that.data.intervalId2) {
		//   clearInterval(that.data.intervalId2);  
		//   that.data.intervalId2 = null;
		// }
	},

	/**
	 * 页面相关事件处理函数--监听用户下拉动作
	 */
	onPullDownRefresh: function () {

	},

	/**
	 * 页面上拉触底事件的处理函数
	 */
	onReachBottom: function () {

	},

	/**
	 * 用户点击右上角分享
	 */
	onShareAppMessage: function () {

	}
})