WechatOwnerService/pages/circle/circle.js
2019-11-23 22:21:10 +08:00

113 lines
3.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// pages/CircleFriends/CircleFriends.js
var app = getApp()
var that
Page({
/**
* 页面的初始数据
*/
data: {
DataSource: [1, 1, 1, 1, 1],
icon: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3175633703,3855171020&fm=27&gp=0.jpg',
content: '我大学毕业到一家集团公司的办公室当文员。办公室主任有一特长,即文章写得好,很有思想,公司董事长很器重他,董事长的讲话稿和企业的年终总结等一系列重大文章都是出自他的手笔。',
resource: ['http://img2.imgtn.bdimg.com/it/u=2118739199,3378602431&fm=27&gp=0.jpg',
'http://img0.imgtn.bdimg.com/it/u=2277942808,1417432970&fm=27&gp=0.jpg',
'http://img5.imgtn.bdimg.com/it/u=1504812505,3480403568&fm=27&gp=0.jpg',
'http://img4.imgtn.bdimg.com/it/u=3456219059,4251129897&fm=27&gp=0.jpg',
'http://img3.imgtn.bdimg.com/it/u=3912316188,1981132393&fm=27&gp=0.jpg'
],
zanSource: ['张三', '李四', '王五', '找钱', '孙俪', '王宝'],
contnet: [{
'firstname': '张三',
'content': '你好漂亮呀!!'
},
{
'firstname': '李四',
'content': '纳尼!!'
},
{
'firstname': '王五',
'content': '鬼扯咧'
},
{
'firstname': '王宝',
'content': '昨晚11点左右一则郑爽胡彦斌疑似复合的消息刷爆各大论坛微博在深夜11点热度高达200万直接爆掉中国意难忘又开始了'
}
],
photoWidth: wx.getSystemInfoSync().windowWidth / 5,
popTop: 0, //弹出点赞评论框的位置
popWidth: 0, //弹出框宽度
isShow: true, //判断是否显示弹出框
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
that = this
},
// 点击图片进行大图查看
LookPhoto: function (e) {
wx.previewImage({
current: e.currentTarget.dataset.photurl,
urls: this.data.resource,
})
},
// 点击点赞的人
TouchZanUser: function (e) {
wx.showModal({
title: e.currentTarget.dataset.name,
showCancel: false
})
},
// 删除朋友圈
delete: function () {
wx.showToast({
title: '删除成功',
})
},
// 点击了点赞评论
TouchDiscuss: function (e) {
// this.data.isShow = !this.data.isShow
// 动画
var animation = wx.createAnimation({
duration: 300,
timingFunction: 'linear',
delay: 0,
})
if (that.data.isShow == false) {
that.setData({
popTop: e.target.offsetTop - (e.detail.y - e.target.offsetTop) / 2,
popWidth: 0,
isShow: true
})
// 0.3秒后滑动
setTimeout(function () {
animation.width(0).opacity(1).step()
that.setData({
animation: animation.export(),
})
}, 100)
} else {
// 0.3秒后滑动
setTimeout(function () {
animation.width(120).opacity(1).step()
that.setData({
animation: animation.export(),
})
}, 100)
that.setData({
popTop: e.target.offsetTop - (e.detail.y - e.target.offsetTop) / 2,
popWidth: 0,
isShow: false
})
}
}
})