123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- // pages/zl_detail/index.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- testImg: '../../../imgs/testImg/thumbSmallImg2.jpg',
- avatar: '../../../imgs/testImg/1.jpg',
- icon_quanping:'../../../imgs/quanping.png',
- active: false,
- isLike:false,
- likeNum:526,
- animationData:{},
- readActive: false,
- longitude: 113.324520,
- latitude: 23.099994,
- tour_info_data:[{
- title:'地址:',
- txt:'北京市朝阳区崔各乡庄各庄村顺白马路马嘻路口100米路北'
- }, {
- title: '开放时间',
- txt: '周二到周日10:00-18:00 (每周一闭馆)'
- }, {
- title: '电话:',
- txt: '+86 10 8456654654'
- }]
-
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- var animation = wx.createAnimation({
- duration: 400,
- timingFunction: 'ease-in-out',
- })
- this.animation = animation
- animation.scale(1.5, 1.5).step();
- animation.scale(1, 1).step();
- this.setData({
- animationData: animation
- })
- },
- clickCell: function () {
- console.log(this.data.active);
- this.setData({
- active: !this.data.active
- })
- },
- readMore: function () {
- this.setData({
- readActive: !this.data.readActive
- })
- },
- navigateToLocation: function () {
- let { latitude, longitude } = this.data;
- wx.openLocation({
- latitude: latitude,
- longitude: longitude,
- scale: 28,
- success: function (res) { },
- fail: function (res) { },
- complete: function (res) { }
- });
- },
- addLike: function () {
- if (this.data.isLike) {
- this.setData({
- isLike: !this.data.isLike,
- likeNum: this.data.likeNum - 1
- })
- } else {
- this.setData({
- isLike: !this.data.isLike,
- likeNum: this.data.likeNum + 1
- })
- }
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
-
- }
- })
|