├── pages ├── index │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── index.js ├── map │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── index.js ├── video │ ├── index.json │ ├── index.wxss │ ├── index.wxml │ └── index.js ├── invitation │ ├── index.json │ ├── index.wxml │ ├── index.js │ └── index.wxss └── chat │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── index.js ├── WxComment ├── libs │ ├── leancloud │ │ └── .gitignore │ └── scripts │ │ └── common.js ├── component │ └── WxComment │ │ ├── WxComment.json │ │ ├── images │ │ ├── views.png │ │ ├── zan.png │ │ ├── coffee.png │ │ ├── comment.png │ │ └── zan_self.png │ │ ├── WxComment.wxss │ │ ├── WxComment.wxml │ │ └── WxComment.js └── README.md ├── .DS_Store ├── images ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── he.jpg ├── t1.png ├── we.png ├── nav.png ├── she.jpg ├── lovemail.gif ├── music_icon.png ├── music_play.png ├── map_bottom_new.png └── save_the_date_pu.gif ├── README.md ├── .idea ├── misc.xml ├── vcs.xml ├── modules.xml ├── OnceLove-master.iml └── workspace.xml ├── app.wxss ├── utils └── util.js ├── project.config.json ├── app.js ├── components └── item │ ├── item-template.wxml │ └── item-template.wxss └── app.json /pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /WxComment/libs/leancloud/.gitignore: -------------------------------------------------------------------------------- 1 | rest_api_leancloud.js 2 | -------------------------------------------------------------------------------- /pages/map/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "地图" 3 | } -------------------------------------------------------------------------------- /WxComment/component/WxComment/WxComment.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /pages/video/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "爱情轨迹" 3 | 4 | } -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/.DS_Store -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/1.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/4.png -------------------------------------------------------------------------------- /images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/5.png -------------------------------------------------------------------------------- /images/he.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/he.jpg -------------------------------------------------------------------------------- /images/t1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/t1.png -------------------------------------------------------------------------------- /images/we.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/we.png -------------------------------------------------------------------------------- /images/nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/nav.png -------------------------------------------------------------------------------- /images/she.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/she.jpg -------------------------------------------------------------------------------- /pages/invitation/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "请柬" 3 | 4 | 5 | } 6 | 7 | -------------------------------------------------------------------------------- /images/lovemail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/lovemail.gif -------------------------------------------------------------------------------- /images/music_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/music_icon.png -------------------------------------------------------------------------------- /images/music_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/music_play.png -------------------------------------------------------------------------------- /images/map_bottom_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/map_bottom_new.png -------------------------------------------------------------------------------- /images/save_the_date_pu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/images/save_the_date_pu.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 婚礼请柬小程序 3 | 基于微信小程序做的一个婚礼请柬 4 | 5 | ## 有哪些功能? 6 | 7 | * 相册展示 8 | * 邀请函展示 9 | * 地图导航 10 | * 好友祝福 11 | * 留言评论 12 | 13 | -------------------------------------------------------------------------------- /WxComment/component/WxComment/images/views.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/WxComment/component/WxComment/images/views.png -------------------------------------------------------------------------------- /WxComment/component/WxComment/images/zan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/WxComment/component/WxComment/images/zan.png -------------------------------------------------------------------------------- /WxComment/component/WxComment/images/coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/WxComment/component/WxComment/images/coffee.png -------------------------------------------------------------------------------- /WxComment/component/WxComment/images/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/WxComment/component/WxComment/images/comment.png -------------------------------------------------------------------------------- /WxComment/component/WxComment/images/zan_self.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovehanyang/wedding_invitation/HEAD/WxComment/component/WxComment/images/zan_self.png -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /pages/chat/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "留言评论", 3 | "enablePullDownRefresh": true, 4 | "usingComponents": { 5 | "WxComment": "/WxComment/component/WxComment/WxComment" 6 | } 7 | } -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /pages/chat/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss**/ 2 | .container { 3 | font-family: Helvetica Neue, Helvetica, Arial, sans-serif; 4 | display: flex; 5 | flex-direction: column; 6 | justify-content: space-between; 7 | box-sizing: border-box; 8 | } 9 | 10 | page { 11 | background-color: #fff; 12 | } 13 | .fl { 14 | float: left; 15 | } 16 | .fr { 17 | float: right; 18 | } -------------------------------------------------------------------------------- /.idea/OnceLove-master.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : '0' + n 15 | } 16 | 17 | module.exports = { 18 | formatTime: formatTime 19 | } 20 | -------------------------------------------------------------------------------- /pages/video/index.wxss: -------------------------------------------------------------------------------- 1 | .movie-list { 2 | box-shadow: 0 8rpx 17rpx 0 rgba(7, 17, 27, 0.1); 3 | margin: 0 25rpx; 4 | overflow: hidden; 5 | border-radius: 10rpx; 6 | margin-bottom: 30rpx; 7 | background: #fff; 8 | } 9 | 10 | .video-des { 11 | padding: 10px; 12 | } 13 | 14 | .myVideo { 15 | 16 | width: 100%; 17 | } 18 | 19 | .video_title { 20 | display: block; 21 | font-size: 15px; 22 | overflow: hidden; 23 | white-space: nowrap; 24 | color: #333; 25 | text-overflow: ellipsis; 26 | } 27 | 28 | .video_time { 29 | font-size: 13px; 30 | color: #979797; 31 | } 32 | -------------------------------------------------------------------------------- /pages/invitation/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 呼叫新郎 12 | 13 | 14 | 15 | 16 | 17 | 呼叫新娘 18 | 19 | 20 | -------------------------------------------------------------------------------- /pages/video/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{item.title}} 11 | {{item.desc}} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "setting": { 4 | "urlCheck": true, 5 | "es6": true, 6 | "postcss": true, 7 | "minified": true, 8 | "newFeature": true 9 | }, 10 | "compileType": "miniprogram", 11 | "libVersion": "2.2.0", 12 | "appid": "wx81047ceffce4e095", 13 | "projectname": "%E9%9F%A9%E6%B4%8B%E4%B8%A8%E9%98%9A%E6%97%AD%E5%A9%9A%E7%A4%BC%E8%AF%B7%E6%9F%AC", 14 | "condition": { 15 | "search": { 16 | "current": -1, 17 | "list": [] 18 | }, 19 | "conversation": { 20 | "current": -1, 21 | "list": [] 22 | }, 23 | "miniprogram": { 24 | "current": -1, 25 | "list": [] 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | // app.js 2 | App({ 3 | onLaunch: function () { 4 | var that = this; 5 | if (this.globalData.userInfo) { 6 | typeof cb == "function" && cb(this.globalData.userInfo) 7 | } else { 8 | //调用登录接口 9 | wx.login({ 10 | success: function () { 11 | wx.getUserInfo({ 12 | success: function (res) { 13 | //console.info(res); 14 | that.globalData.userInfo = res.userInfo; 15 | typeof cb == "function" && cb(that.globalData.userInfo) 16 | } 17 | }) 18 | } 19 | }); 20 | } 21 | }, 22 | globalData: { 23 | userInfo: null, 24 | appid:'wx81047ceffce4e095', 25 | } 26 | }); 27 | 28 | -------------------------------------------------------------------------------- /components/item/item-template.wxml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pages/map/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 呼叫新郎 17 | 18 | 19 | 20 | 21 | 22 | 呼叫新娘 23 | 24 | 25 | MADE WITH ❤ BY 韩洋 & 阚旭 26 | ©2018.10.3 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/item/item-template.wxss: -------------------------------------------------------------------------------- 1 | /* 视频 */ 2 | 3 | .movie-list { 4 | box-shadow: 0 8rpx 16rpx 0 rgba(7, 17, 27, 0.1); 5 | margin: 0 20rpx; 6 | overflow: hidden; 7 | border-radius: 8rpx; 8 | margin-bottom: 30rpx; 9 | background: #fff; 10 | } 11 | 12 | .movie-list .wrap-img { 13 | height: 420rpx; 14 | background-color: #ccc; 15 | background-repeat: no-repeat; 16 | background-position: center; 17 | background-size: cover; 18 | display: flex; 19 | flex-direction: column; 20 | justify-content: center; 21 | align-items: center; 22 | } 23 | 24 | .movie-list .wrap-img .btn { 25 | width: 90rpx; 26 | height: 90rpx; 27 | background-image: url(http://i.gtimg.cn/qqlive/images/20150911/i1441959133_1.jpg); 28 | background-size: 90rpx; 29 | } 30 | 31 | .movie-list .video-des { 32 | padding: 10px; 33 | } 34 | 35 | .movie-list .video_title { 36 | display: block; 37 | font-size: 15px; 38 | overflow: hidden; 39 | white-space: nowrap; 40 | color: #333; 41 | text-overflow: ellipsis; 42 | } 43 | 44 | .movie-list .video-des .time { 45 | font-size: 13px; 46 | color: #979797; 47 | } 48 | -------------------------------------------------------------------------------- /pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /**index.wxss**/ 2 | 3 | 4 | .swiper { 5 | width: 750rpx; 6 | height: 100vh; 7 | } 8 | .swiper swiper{ 9 | width: 750rpx; 10 | height: 100vh; 11 | } 12 | .swiper swiper-item{ 13 | width: 750rpx; 14 | height: 100vh; 15 | } 16 | .swiper image{ 17 | width: 750rpx; 18 | height: 100vh; 19 | } 20 | 21 | .background_music{ 22 | position: fixed; 23 | top: 20rpx; 24 | right: 10rpx; 25 | z-index: 10001; 26 | width: 100rpx; 27 | } 28 | .musicImg{ 29 | width: 80rpx; 30 | height: 80rpx; 31 | } 32 | .music_icon{ 33 | animation:musicRotate 3s linear infinite; 34 | } 35 | .music_play{ 36 | width:28rpx; 37 | height: 80rpx; 38 | margin-left:-5px; 39 | transform-origin: top; 40 | -webkit-transform:rotate(20deg) 41 | } 42 | .playImg{ 43 | animation:musicStop 1s linear forwards ; 44 | } 45 | .pauseImg{ 46 | animation:musicStart 1s linear forwards ; 47 | } 48 | @-webkit-keyframes musicRotate{ 49 | from{-webkit-transform:rotate(0deg);} 50 | to{-webkit-transform:rotate(360deg);} 51 | } 52 | @-webkit-keyframes musicStop{ 53 | from{-webkit-transform:rotate(20deg);} 54 | to{-webkit-transform:rotate(0deg);} 55 | } 56 | @-webkit-keyframes musicStart{ 57 | from{-webkit-transform:rotate(0deg);} 58 | to{-webkit-transform:rotate(20deg);} 59 | } 60 | .music_stop{width:4em;display:none;} -------------------------------------------------------------------------------- /pages/map/index.wxss: -------------------------------------------------------------------------------- 1 | /* pages/bless/index.wxss */ 2 | 3 | .container { 4 | min-height: 100vh; 5 | background: url('http://oq8pu5sju.bkt.clouddn.com/bg2.jpg') no-repeat center; 6 | background-size: cover; 7 | } 8 | 9 | .t1 { 10 | width: 626rpx; 11 | height: 180rpx; 12 | margin: 0 auto; 13 | display: block; 14 | } 15 | 16 | /* pages/map/index.wxss */ 17 | 18 | #map { 19 | width: 694rpx; 20 | height: 694rpx; 21 | margin: 0 auto; 22 | margin-bottom: 30rpx; 23 | margin-top: 20rpx; 24 | border: 3rpx solid rgba(0, 0, 0, .3) 25 | } 26 | 27 | .bottomImg { 28 | width: 100%; 29 | min-height: 0; 30 | position: fixed; 31 | bottom: 0; 32 | } 33 | 34 | 35 | .tel { 36 | width: 500rpx; 37 | margin: 0 auto; 38 | min-height: 0; 39 | overflow: hidden; 40 | text-align: center; 41 | font-size: 24rpx; 42 | color: #684c4b; 43 | line-height: 50rpx; 44 | z-index: 99999; 45 | padding-bottom: 50rpx; 46 | } 47 | 48 | .tel_he { 49 | width: 200rpx; 50 | float: left; 51 | } 52 | 53 | .tel_she { 54 | width: 200rpx; 55 | float: right; 56 | } 57 | 58 | .call { 59 | width: 80rpx; 60 | height: 80rpx; 61 | display: block; 62 | margin: 0 auto; 63 | } 64 | 65 | .call image { 66 | width: 80rpx; 67 | height: 80rpx; 68 | margin-bottom: 10rpx; 69 | } 70 | 71 | .copyright { 72 | text-align: center; 73 | font-size: 20rpx; 74 | line-height: 25rpx; 75 | padding-bottom: 20rpx; 76 | color: #684c4b; 77 | } -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/invitation/index", 4 | "pages/index/index", 5 | "pages/video/index", 6 | "pages/map/index", 7 | "pages/chat/index" 8 | ], 9 | "window": { 10 | "backgroundTextStyle": "light", 11 | "navigationBarBackgroundColor": "#fff", 12 | "navigationBarTitleText": "韩洋❤阚旭 Married", 13 | "navigationBarTextStyle": "black", 14 | "enablePullDownRefresh": false 15 | }, 16 | "tabBar": { 17 | "color": "#ccc", 18 | "selectedColor": "#ff4c91", 19 | "borderStyle": "white", 20 | "backgroundColor": "#ffffff", 21 | "list": [ 22 | { 23 | "pagePath": "pages/invitation/index", 24 | "iconPath": "images/2.png", 25 | "selectedIconPath": "images/2.png", 26 | "text": "邀请函" 27 | }, 28 | { 29 | "pagePath": "pages/index/index", 30 | "iconPath": "images/1.png", 31 | "selectedIconPath": "images/1.png", 32 | "text": "婚纱照" 33 | }, 34 | { 35 | "pagePath": "pages/video/index", 36 | "iconPath": "images/3.png", 37 | "selectedIconPath": "images/3.png", 38 | "text": "爱的记录" 39 | }, 40 | { 41 | "pagePath": "pages/map/index", 42 | "iconPath": "images/4.png", 43 | "selectedIconPath": "images/4.png", 44 | "text": "地图" 45 | }, 46 | { 47 | "pagePath": "pages/chat/index", 48 | "iconPath": "images/5.png", 49 | "selectedIconPath": "images/5.png", 50 | "text": "留言评论" 51 | } 52 | ] 53 | } 54 | } -------------------------------------------------------------------------------- /pages/chat/index.wxss: -------------------------------------------------------------------------------- 1 | /* pages/chat/index.wxss */ 2 | 3 | page { 4 | background-color: #fde7e3; 5 | padding-bottom: 150rpx; 6 | } 7 | 8 | .chat_list { 9 | width: 630rpx; 10 | margin: 0 auto; 11 | margin-top: 30rpx; 12 | padding: 30rpx; 13 | min-height: 0; 14 | overflow: hidden; 15 | background-color: rgba(255, 255, 255, 0.9); 16 | border-radius: 5px; 17 | box-shadow: 0 0 20px rgba(190, 77, 43, 0.2); 18 | } 19 | 20 | .chat_face { 21 | width: 100rpx; 22 | height: 100rpx; 23 | float: left; 24 | margin-right: 30rpx; 25 | margin-top: 30rpx; 26 | } 27 | 28 | .chat_face image { 29 | width: 100rpx; 30 | height: 100rpx; 31 | border-radius: 50%; 32 | } 33 | 34 | .chat_words { 35 | width: 500rpx; 36 | float: left; 37 | font-size: 30rpx; 38 | line-height: 50rpx; 39 | color: #999; 40 | } 41 | 42 | .chat_meta { 43 | width: 100%; 44 | min-height: 0; 45 | overflow: hidden; 46 | margin-bottom: 10rpx; 47 | } 48 | 49 | .chat_user { 50 | display: inline-block; 51 | font-size: 30rpx; 52 | font-weight: 600; 53 | color: #666; 54 | float: left; 55 | } 56 | 57 | .chat_date { 58 | display: inline-block; 59 | font-size: 24rpx; 60 | color: #ccc; 61 | float: right; 62 | } 63 | 64 | .send_msg { 65 | width: 700rpx; 66 | padding: 25rpx; 67 | background-color: #fff; 68 | min-height: 0; 69 | position: fixed; 70 | bottom: 0; 71 | left: 0; 72 | border-top: 1px solid #f1f1f1; 73 | border-bottom: 1px solid #f1f1f1; 74 | } 75 | 76 | .send_ipt { 77 | width: 500rpx; 78 | padding: 10rpx; 79 | font-size: 30rpx; 80 | height: 60rpx; 81 | line-height: 60rpx; 82 | float: left; 83 | background-color: #f5f5f5; 84 | border-radius: 5px; 85 | } 86 | 87 | .send_btn { 88 | width: 150rpx; 89 | height: 80rpx; 90 | font-size: 36rpx; 91 | line-height: 80rpx; 92 | float: right; 93 | } 94 | 95 | -------------------------------------------------------------------------------- /pages/invitation/index.js: -------------------------------------------------------------------------------- 1 | // pages/invitation/index.js 2 | const app = getApp() 3 | var server = app.globalData.server; 4 | var appid = app.globalData.appid; 5 | var touchDot = 0;//触摸时的原点 6 | var time = 0;// 时间记录,用于滑动时且时间小于1s则执行左右滑动 7 | var interval = "";// 记录/清理时间记录 8 | Page({ 9 | 10 | /** 11 | * 页面的初始数据 12 | */ 13 | data: { 14 | userInfo: {}, 15 | }, 16 | 17 | /** 18 | * 生命周期函数--监听页面加载 19 | */ 20 | onLoad: function (options) { 21 | var that = this 22 | 23 | wx.getUserInfo({ 24 | success: function (res) { 25 | that.setData({ 26 | userInfo: res.userInfo 27 | }) 28 | } 29 | }) 30 | }, 31 | 32 | /** 33 | * 生命周期函数--监听页面初次渲染完成 34 | */ 35 | onReady: function () { 36 | 37 | }, 38 | 39 | /** 40 | * 生命周期函数--监听页面显示 41 | */ 42 | onShow: function () { 43 | 44 | }, 45 | 46 | /** 47 | * 生命周期函数--监听页面隐藏 48 | */ 49 | onHide: function () { 50 | 51 | }, 52 | 53 | /** 54 | * 生命周期函数--监听页面卸载 55 | */ 56 | onUnload: function () { 57 | 58 | }, 59 | 60 | /** 61 | * 页面相关事件处理函数--监听用户下拉动作 62 | */ 63 | onPullDownRefresh: function () { 64 | 65 | }, 66 | 67 | /** 68 | * 页面上拉触底事件的处理函数 69 | */ 70 | onReachBottom: function () { 71 | 72 | }, 73 | 74 | /** 75 | * 用户点击右上角分享 76 | */ 77 | onShareAppMessage: function () { 78 | var that = this; 79 | //console.log(that.data); 80 | return { 81 | title: that.data.mainInfo.share, 82 | imageUrl: that.data.mainInfo.thumb, 83 | path: 'pages/index/index', 84 | success: function (res) { 85 | wx.showToast({ 86 | title: '分享成功', 87 | }) 88 | }, 89 | fail: function (res) { 90 | // 转发失败 91 | wx.showToast({ 92 | title: '分享取消', 93 | }) 94 | } 95 | } 96 | }, 97 | callhe: function (event) { 98 | wx.makePhoneCall({ 99 | phoneNumber: '18612643487' 100 | }) 101 | }, 102 | callshe: function (event) { 103 | wx.makePhoneCall({ 104 | phoneNumber: '15041170858' 105 | }) 106 | } 107 | }) -------------------------------------------------------------------------------- /WxComment/libs/scripts/common.js: -------------------------------------------------------------------------------- 1 | const timeAgoWithTimeStr = (dateString) => { 2 | // ios: 2018/06/02 11:11:11 3 | // android: 2018-06-02 11:11:11 & 2018/06/02 11:11:11 4 | var date_time_arr = dateString.split(' '); 5 | var ios_date_arr = date_time_arr[0].split('-'); 6 | var ios_date_str = ios_date_arr[0] + '/' + ios_date_arr[1] + '/' + ios_date_arr[2]; 7 | var ios_datetime_str = ios_date_str + ' ' + date_time_arr[1]; 8 | 9 | var newDateString = dateString; 10 | newDateString = ios_datetime_str; 11 | 12 | var date = new Date(newDateString) 13 | 14 | try { 15 | var oldTime = date.getTime(); 16 | var currTime = new Date().getTime(); 17 | var diffValue = currTime - oldTime; 18 | 19 | var days = Math.floor(diffValue / (24 * 3600 * 1000)); 20 | 21 | if (days === 0) { 22 | //计算相差小时数 23 | var leave1 = diffValue % (24 * 3600 * 1000); //计算天数后剩余的毫秒数 24 | var hours = Math.floor(leave1 / (3600 * 1000)); 25 | if (hours === 0) { 26 | //计算相差分钟数 27 | var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数 28 | var minutes = Math.floor(leave2 / (60 * 1000)); 29 | if (minutes === 0) { 30 | //计算相差秒数 31 | var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数 32 | var seconds = Math.round(leave3 / 1000); 33 | return seconds + ' 秒前'; 34 | } 35 | return minutes + ' 分钟前'; 36 | } 37 | return hours + ' 小时前'; 38 | } 39 | if (days < 0) return '刚刚'; 40 | 41 | if (days < 3) { 42 | return days + ' 天前'; 43 | } else { 44 | return dateString 45 | } 46 | } catch (error) { 47 | console.log(error) 48 | } 49 | } 50 | 51 | function getTime() { 52 | //获取当前时间戳 53 | var timestamp = Date.parse(new Date()); 54 | var n = timestamp; 55 | var date = new Date(n); 56 | //年 57 | var Y = date.getFullYear(); 58 | //月 59 | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1); 60 | //日 61 | var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); 62 | //时 63 | var h = date.getHours(); 64 | //分 65 | var m = date.getMinutes(); 66 | //秒 67 | var s = date.getSeconds(); 68 | return Y + '-' + M + '-' + D + ' ' + h + ":" + m + ":" + s; 69 | } 70 | 71 | module.exports = { 72 | timeAgoWithTimeStr: timeAgoWithTimeStr, 73 | getTime: getTime 74 | } -------------------------------------------------------------------------------- /pages/invitation/index.wxss: -------------------------------------------------------------------------------- 1 | /* pages/invitation/index.wxss */ 2 | 3 | .container { 4 | background: url('http://pcgm4rcvg.bkt.clouddn.com/new_invite_page.jpg') no-repeat center; 5 | background-size: cover; 6 | width: 750rpx; 7 | height: 100vh; 8 | } 9 | 10 | .date { 11 | text-align: center; 12 | font-size: 30rpx; 13 | line-height: 50rpx; 14 | margin-top: 20rpx; 15 | } 16 | 17 | .name { 18 | width: 400rpx; 19 | margin: 0 auto; 20 | min-height: 0; 21 | overflow: hidden; 22 | margin-top: 20rpx; 23 | } 24 | 25 | .savethedate { 26 | width: 200rpx; 27 | height: 200rpx; 28 | margin: 0 auto; 29 | margin-top: 20rpx; 30 | margin-bottom: 20rpx; 31 | } 32 | 33 | .savethedate image { 34 | width: 200rpx; 35 | height: 200rpx; 36 | } 37 | 38 | .diamond { 39 | width: 400rpx; 40 | height: 59rpx; 41 | margin: 0 auto; 42 | margin-top: 20rpx; 43 | margin-bottom: 20rpx; 44 | } 45 | 46 | .diamond image { 47 | width: 400rpx; 48 | height: 59rpx; 49 | } 50 | 51 | .address { 52 | text-align: center; 53 | padding: 20rpx; 54 | font-size: 34rpx; 55 | line-height: 40rpx; 56 | } 57 | 58 | .s_icon { 59 | width: 60rpx; 60 | height: 60rpx; 61 | margin: 0 auto; 62 | margin-top: 30rpx; 63 | } 64 | 65 | .s_icon image { 66 | width: 60rpx; 67 | height: 60rpx; 68 | } 69 | 70 | .words { 71 | width: 400rpx; 72 | height: 96rpx; 73 | margin: 0 auto; 74 | margin-top: 20rpx; 75 | margin-bottom: 20rpx; 76 | } 77 | 78 | .words image { 79 | width: 400rpx; 80 | height: 96rpx; 81 | } 82 | 83 | .tel { 84 | position: fixed; 85 | bottom: 0; 86 | width: 750rpx; 87 | margin: 0 auto; 88 | min-height: 0; 89 | overflow: hidden; 90 | text-align: center; 91 | font-size: 20rpx; 92 | line-height: 50rpx; 93 | margin-top: 20rpx; 94 | margin-bottom: 40rpx; 95 | } 96 | 97 | /* display: flex; 98 | flex-flow: row; 99 | justify-content: center; */ 100 | 101 | .tel_he { 102 | width: 250rpx; 103 | float: left; 104 | } 105 | 106 | .tel_she { 107 | width: 250rpx; 108 | float: right; 109 | } 110 | 111 | .call { 112 | width: 80rpx; 113 | height: 80rpx; 114 | display: block; 115 | margin: 0 auto; 116 | } 117 | 118 | .call image { 119 | width: 80rpx; 120 | height: 80rpx; 121 | margin-bottom: 10rpx; 122 | } 123 | -------------------------------------------------------------------------------- /pages/map/index.js: -------------------------------------------------------------------------------- 1 | // pages/bless/index.js 2 | 3 | const app = getApp() 4 | var server = app.globalData.server; 5 | var appid = app.globalData.appid; 6 | Page({ 7 | 8 | /** 9 | * 页面的初始数据 10 | */ 11 | data: { 12 | userInfo: {}, 13 | }, 14 | 15 | markertap(e) { 16 | 17 | var lng = "114.842384" 18 | var lat = "38.023914" 19 | console.log(lat) 20 | wx.openLocation({ 21 | latitude: parseFloat(lat), 22 | longitude: parseFloat(lng), 23 | scale: 18, 24 | name: "渔人码头宴会厅", 25 | address: "河北省 石家庄市 藁城区 " 26 | }) 27 | }, 28 | 29 | /** 30 | * 生命周期函数--监听页面加载 31 | */ 32 | onLoad: function(options) { 33 | var that = this 34 | 35 | wx.getUserInfo({ 36 | success: function(res) { 37 | that.setData({ 38 | userInfo: res.userInfo 39 | }) 40 | } 41 | }) 42 | 43 | //地图信息 44 | var lng = "114.842384" 45 | var lat = "38.023914" 46 | 47 | // var lng = res.data.mainInfo.lng 48 | // var lat = res.data.mainInfo.lat 49 | that.setData({ 50 | lng: lng, // 全局属性,用来取定位坐标 51 | lat: lat, 52 | markers: [{ 53 | iconPath: "/images/nav.png", 54 | id: 0, 55 | latitude: lat, // 页面初始化 options为页面跳转所带来的参数 56 | longitude: lng, 57 | width: 50, 58 | height: 50 59 | }], 60 | }); 61 | }, 62 | 63 | /** 64 | * 生命周期函数--监听页面初次渲染完成 65 | */ 66 | onReady: function() { 67 | 68 | }, 69 | 70 | /** 71 | * 生命周期函数--监听页面显示 72 | */ 73 | onShow: function() { 74 | 75 | }, 76 | 77 | /** 78 | * 生命周期函数--监听页面隐藏 79 | */ 80 | onHide: function() { 81 | 82 | }, 83 | 84 | /** 85 | * 生命周期函数--监听页面卸载 86 | */ 87 | onUnload: function() { 88 | 89 | }, 90 | 91 | /** 92 | * 页面相关事件处理函数--监听用户下拉动作 93 | */ 94 | onPullDownRefresh: function() { 95 | 96 | 97 | }, 98 | /** 99 | * 页面上拉触底事件的处理函数 100 | */ 101 | onReachBottom: function() { 102 | 103 | }, 104 | 105 | /** 106 | * 用户点击右上角分享 107 | */ 108 | onShareAppMessage: function() { 109 | var that = this; 110 | //console.log(that.data); 111 | return { 112 | title: that.data.mainInfo.share, 113 | imageUrl: that.data.mainInfo.thumb, 114 | path: 'pages/index/index', 115 | success: function(res) { 116 | wx.showToast({ 117 | title: '分享成功', 118 | }) 119 | }, 120 | fail: function(res) { 121 | // 转发失败 122 | wx.showToast({ 123 | title: '分享取消', 124 | }) 125 | } 126 | } 127 | }, 128 | }) -------------------------------------------------------------------------------- /WxComment/README.md: -------------------------------------------------------------------------------- 1 | # WxComment 2 | 3 | `WxComment`[https://github.com/yicm/WxComment](https://github.com/yicm/WxComment)是一个微信小程序的评论插件,结合BaaS提供商[LeanCloud](https://leancloud.cn/),无需其他另外的个人或者云服务器,就可以免费使用。解决了需要个人去注册域名、备案、购买云服务器的繁杂问题。 4 | 5 | 6 | # 特色 7 | 8 | - 独立插件,独立放入小程序项目即可使用 9 | - 友好的UI界面和交互界面 10 | - 与微信用户信息绑定,显示微信用户头像和昵称 11 | - 支持插件内容修改,包括按钮文字,评论提示,评论字数最低限制等属性 12 | - 支持长按删除评论操作 13 | - 支持评论点赞功能 14 | - 支持评论回复功能,即子评论 15 | - 子评论支持点赞功能 16 | - 支持emoji表情显示😉 17 | - 支持文章阅读量统计功能 18 | - 支持light/dark两种样式设置 19 | - 支持点击头像关注用户功能 20 | - 对发布高质量文章的用户关注(见微信小程序`小白AI`) 21 | - 关注后,可通过在WxComment组件外对用户详细资料查看等操作(见微信小程序`小白AI`) 22 | - 支持评论消息订阅功能 23 | - 评论指定文章或页面后,会自动订阅该文章或页面的评论,当有新的评论则可以实现消息更新,提示已有新的评论。 24 | - 支持配置Admin用户删除其他用户的评论 25 | 26 | 27 | # 屏幕截图 28 | 29 | 下图为`WxComment`嵌入式到具体博客中显示的效果。 30 | 31 | ![](https://raw.githubusercontent.com/yicm/WxComment/master/screenshot/screenshot.png) 32 | 33 | # 快速入手 34 | 35 | 1. 注册LeanCloud账号,并创建过LeanCloud应用; 36 | 37 | 2. 登陆LeanCloud账号,打开链接[https://leancloud.cn/docs/weapp-domains.html](https://leancloud.cn/docs/weapp-domains.html),将显示域名配置到你的微信小程序服务器配置中; 38 | 39 | 3. 设置小程序的 AppID 与 AppSecret 40 | 3.1 登录 微信公众平台,在`设置` > `开发设置` 中获得 AppID 与 AppSecret 41 | 3.2 前往 LeanCloud `控制台` > `组件` > `社交`,保存「微信小程序」的 AppID 与 AppSecret 42 | 43 | 4. 克隆项目WxComment并将其放入小程序根目录 44 | 45 | ``` 46 | $ git clone https://github.com/yicm/WxComment.git 47 | ``` 48 | 49 | 5. 将LeanCloud自己的AppID和AppKey复制到WxComment.js对应位置; 50 | 51 | ``` 52 | AV.init({ 53 | appId: 'your leancloud appid', 54 | appKey: 'your leancloud appkey', 55 | }); 56 | ``` 57 | 58 | 6. 在小程序其他wxml文件中引入WxComment组件 59 | 60 | test.wxml 61 | 62 | ``` 63 | 64 | 65 | 66 | ``` 67 | 68 | test.json 69 | 70 | ``` 71 | "usingComponents": { 72 | "WxComment": "/component/WxComment/WxComment" 73 | } 74 | ``` 75 | 76 | 7. 配置Admin删除其他用户评论 77 | 78 | - 登陆LeanCloud,进入应用->`存储`->`数据`->`创建Class`->创建`Admin` Class: 79 | 80 | ![](https://raw.githubusercontent.com/yicm/WxComment/master/screenshot/admin.png) 81 | 82 | 83 | WxComment组件属性说明: 84 | 85 | ```bash 86 | tipOne: 颜色显示tip区域文字内容 87 | tipTwo: 无颜色显示tip区域文字内容 88 | submitBtnText:提交按钮文字内容,默认为“回复” 89 | textMaxLength: 评论最大文字长度限制,默认300 90 | articleID:文章或页面与WxComment绑定的唯一ID 91 | articleTitle: 文章或页面标题,默认值为空 92 | articleURL: 文章或页面的访问链接,默认值为空 93 | contentLen:评论内容至少为多长限制,默认为1 94 | theme: 评论组件样式,支持light/dark两种样式,默认值为light 95 | ``` 96 | 97 | # Demo 98 | 99 | 小程序`小白AI`博客引用WxComment组件示例,评论消息订阅可见`我的`->`消息`: 100 | 101 | ![](https://raw.githubusercontent.com/yicm/WxComment/master/screenshot/xiaobaiai.jpg) 102 | 103 | # TODO 104 | 105 | - 支持查看用户详细信息以及优化关注功能 106 | - 支持设置用户资料 107 | - 支持匿名群聊和私聊 108 | - 支持评论附加图片 109 | - ... 110 | 111 | # License 112 | 113 | [MIT](https://opensource.org/licenses/MIT) 114 | 115 | -------------------------------------------------------------------------------- /pages/chat/index.js: -------------------------------------------------------------------------------- 1 | // pages/chat/index.js 2 | const app = getApp() 3 | var appid = app.globalData.appid; 4 | 5 | Page({ 6 | 7 | /** 8 | * 页面的初始数据 9 | */ 10 | data: { 11 | userInfo: {}, 12 | inputValue:'', 13 | article_id:'1' 14 | }, 15 | 16 | /** 17 | * 生命周期函数--监听页面加载 18 | */ 19 | onLoad: function (options) { 20 | var that = this 21 | 22 | wx.getUserInfo({ 23 | success: function (res) { 24 | that.setData({ 25 | userInfo: res.userInfo 26 | }) 27 | } 28 | }) 29 | }, 30 | 31 | /** 32 | * 生命周期函数--监听页面初次渲染完成 33 | */ 34 | onReady: function () { 35 | 36 | }, 37 | 38 | /** 39 | * 生命周期函数--监听页面显示 40 | */ 41 | onShow: function () { 42 | 43 | }, 44 | 45 | /** 46 | * 生命周期函数--监听页面隐藏 47 | */ 48 | onHide: function () { 49 | 50 | }, 51 | 52 | /** 53 | * 生命周期函数--监听页面卸载 54 | */ 55 | onUnload: function () { 56 | 57 | }, 58 | 59 | /** 60 | * 页面相关事件处理函数--监听用户下拉动作 61 | */ 62 | onPullDownRefresh: function () { 63 | 64 | }, 65 | 66 | /** 67 | * 页面上拉触底事件的处理函数 68 | */ 69 | onReachBottom: function () { 70 | 71 | }, 72 | 73 | /** 74 | * 用户点击右上角分享 75 | */ 76 | onShareAppMessage: function () { 77 | var that = this; 78 | //console.log(that.data); 79 | return { 80 | title: that.data.mainInfo.share, 81 | imageUrl: that.data.mainInfo.thumb, 82 | path: 'pages/index/index', 83 | success: function (res) { 84 | wx.showToast({ 85 | title: '分享成功', 86 | }) 87 | }, 88 | fail: function (res) { 89 | // 转发失败 90 | wx.showToast({ 91 | title: '分享取消', 92 | }) 93 | } 94 | } 95 | }, 96 | bindKeyInput: function(e) { 97 | this.setData({ 98 | inputValue: e.detail.value 99 | }) 100 | }, 101 | foo:function(){ 102 | var that = this; 103 | if(that.data.inputValue){ 104 | //留言内容不是空值 105 | 106 | var userInfo = that.data.userInfo; 107 | var name = userInfo.nickName; 108 | var face = userInfo.avatarUrl; 109 | var words = that.data.inputValue; 110 | wx.request({ 111 | url: "", 112 | data: { 'c': 'send', 'appid': appid, 'nickname': name, 'face': face , 'words': words }, 113 | header: {}, 114 | method: "GET", 115 | dataType: "json", 116 | success: res => { 117 | // console.log(res.data); 118 | if (res.data.success) { 119 | that.setData({ 120 | chatList: res.data.chatList, 121 | chatNum: res.data.chatNum 122 | }); 123 | wx.showModal({ 124 | title: '提示', 125 | content: res.data.msg, 126 | showCancel: false 127 | }) 128 | } else { 129 | wx.showModal({ 130 | title: '提示', 131 | content: res.data.msg, 132 | showCancel: false 133 | }) 134 | } 135 | } 136 | }) 137 | } 138 | that.setData({ 139 | inputValue:''//将data的inputValue清空 140 | }); 141 | return; 142 | } 143 | }) -------------------------------------------------------------------------------- /pages/video/index.js: -------------------------------------------------------------------------------- 1 | // pages/map/index.js 2 | const app = getApp() 3 | var server = app.globalData.server; 4 | var appid = app.globalData.appid; 5 | 6 | const AV = require("../../WxComment/libs/leancloud/av-weapp-min.js"); 7 | var Common = require('../../WxComment/libs/scripts/common.js'); 8 | // LeanCloud 应用的 ID 和 Key 9 | // AV.init({ 10 | // appId: 'Q7y6ChsRaO66w6DLJ7XR0IF9-gzGzoHsz', 11 | // appKey: 'tO9g5jhd0ETAx2vrRtR1NLp5', 12 | // }); 13 | 14 | Page({ 15 | 16 | /** 17 | * 页面的初始数据 18 | */ 19 | data: { 20 | userInfo: {}, 21 | 22 | movieList: 23 | 24 | [{ 25 | img: "http://pcgm4rcvg.bkt.clouddn.com/marry/video1532782634171.mp4?vframe/jpg/offset/7/rotate/auto", 26 | desc: "缘分来得早或者迟,没有关系,遇见你,就是我最好的时光", 27 | time: 1532519734589, 28 | title: "海边", 29 | vid: "e0354z3cqjp", 30 | src: "http://pcgm4rcvg.bkt.clouddn.com/marry/video1532782634171.mp4" 31 | }, 32 | { 33 | img: "http://pcgm4rcvg.bkt.clouddn.com/marry/video1532871405425.mp4?vframe/jpg/offset/3/rotate/auto", 34 | desc: "阳光与你同在,就是我想要的未来", 35 | time: 1532519734589, 36 | title: "绿地", 37 | vid: "e0354z3cqjp", 38 | src: "http://pcgm4rcvg.bkt.clouddn.com/marry/video1532871405425.mp4" 39 | }, 40 | { 41 | img: "http://pcgm4rcvg.bkt.clouddn.com/marry/video1532963841560.mp4?vframe/jpg/offset/1/rotate/auto", 42 | desc: "大步大步地跑向你,像海洋歌颂旭日一样,歌颂我爱的你~", 43 | time: 1532519734589, 44 | title: "喷泉", 45 | vid: "e0354z3cqjp", 46 | src: "http://pcgm4rcvg.bkt.clouddn.com/marry/video1532963841560.mp4" 47 | } 48 | ] 49 | }, 50 | 51 | /** 52 | * 生命周期函数--监听页面加载 53 | */ 54 | onLoad: function(options) { 55 | var that = this 56 | 57 | wx.getUserInfo({ 58 | success: function(res) { 59 | that.setData({ 60 | userInfo: res.userInfo 61 | }) 62 | } 63 | }) 64 | 65 | var query = new AV.Query('VideoList'); 66 | query.include('src'); 67 | console.log('韩洋1'); 68 | query.find().then(function(videoList) { 69 | // 将返回结果返回到 data 数据中,以在 wxml 渲染 70 | 71 | 72 | console.log('韩洋4:' + videoList.length); 73 | 74 | for (var i = 0, len = videoList.length; i < len; i++) { 75 | 76 | var str = JSON.stringify(videoList[i]); 77 | var obj = JSON.parse(str); 78 | that.data.movieList.unshift(obj); 79 | console.log('韩洋9' + obj.name);//遍历输出 80 | } 81 | 82 | that.setData({ 83 | movieList: that.data.movieList 84 | }) 85 | 86 | }, function(err) { 87 | console.log(err); 88 | }); 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | }, 105 | 106 | /** 107 | * 生命周期函数--监听页面初次渲染完成 108 | */ 109 | onReady: function() { 110 | 111 | }, 112 | 113 | /** 114 | * 生命周期函数--监听页面显示 115 | */ 116 | onShow: function() { 117 | 118 | }, 119 | 120 | /** 121 | * 生命周期函数--监听页面隐藏 122 | */ 123 | onHide: function() { 124 | 125 | }, 126 | 127 | /** 128 | * 生命周期函数--监听页面卸载 129 | */ 130 | onUnload: function() { 131 | 132 | }, 133 | 134 | /** 135 | * 页面相关事件处理函数--监听用户下拉动作 136 | */ 137 | onPullDownRefresh: function() { 138 | 139 | }, 140 | 141 | /** 142 | * 页面上拉触底事件的处理函数 143 | */ 144 | onReachBottom: function() { 145 | 146 | }, 147 | 148 | /** 149 | * 用户点击右上角分享 150 | */ 151 | onShareAppMessage: function() { 152 | var that = this; 153 | //console.log(that.data); 154 | return { 155 | title: that.data.mainInfo.share, 156 | imageUrl: that.data.mainInfo.thumb, 157 | path: 'pages/index/index', 158 | success: function(res) { 159 | wx.showToast({ 160 | title: '分享成功', 161 | }) 162 | }, 163 | fail: function(res) { 164 | // 转发失败 165 | wx.showToast({ 166 | title: '分享取消', 167 | }) 168 | } 169 | } 170 | } 171 | }) -------------------------------------------------------------------------------- /pages/index/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | var appid = app.globalData.appid; 5 | const AV = require("../../WxComment/libs/leancloud/av-weapp-min.js"); 6 | var Common = require('../../WxComment/libs/scripts/common.js'); 7 | // LeanCloud 应用的 ID 和 Key 8 | // AV.init({ 9 | // appId: 'Q7y6ChsRaO66w6DLJ7XR0IF9-gzGzoHsz', 10 | // appKey: 'tO9g5jhd0ETAx2vrRtR1NLp5', 11 | // }); 12 | 13 | 14 | Page({ 15 | data: { 16 | userInfo: {}, 17 | music_url: 'http://pcgm4rcvg.bkt.clouddn.com/bgmusic_yudao.mp3', 18 | isPlayingMusic: true, 19 | title: '我们结婚啦', 20 | coverImgUrl: 'http://pcgm4rcvg.bkt.clouddn.com/marry/img/music_cover.jpg', 21 | 22 | 23 | testimgUrls: [ 24 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img16.jpg', 25 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img2.jpg', 26 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img3.jpg', 27 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img4.jpg', 28 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img5.jpg', 29 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img6.jpg', 30 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img17.jpg', 31 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img8.jpg', 32 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img9.jpg', 33 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img10.jpg', 34 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img11.jpg', 35 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img12.jpg', 36 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img13.jpg', 37 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img14.jpg', 38 | 'http://pcgm4rcvg.bkt.clouddn.com/marry/img15.jpg', 39 | 40 | ], 41 | 42 | 43 | }, 44 | 45 | onLoad: function() { 46 | var that = this 47 | 48 | wx.getUserInfo({ 49 | success: function(res) { 50 | that.setData({ 51 | userInfo: res.userInfo 52 | }) 53 | } 54 | }) 55 | 56 | var query = new AV.Query('ImageList'); 57 | query.include('src'); 58 | query.find().then(function(imageList) { 59 | // 将返回结果返回到 data 数据中,以在 wxml 渲染 60 | 61 | 62 | console.log('韩洋4:' + imageList.length); 63 | 64 | for (var i = 0, len = imageList.length; i < len; i++) { 65 | 66 | var str = JSON.stringify(imageList[i]); 67 | var obj = JSON.parse(str); 68 | that.data.testimgUrls.unshift(obj.src); 69 | console.log('韩洋9' + obj.src); //遍历输出 70 | } 71 | 72 | that.setData({ 73 | testimgUrls: that.data.testimgUrls 74 | }) 75 | 76 | }, function(err) { 77 | console.log(err); 78 | }); 79 | 80 | 81 | 82 | /** 83 | * 不支持aac格式 84 | */ 85 | const backgroundAudioManager = wx.getBackgroundAudioManager() 86 | player() 87 | 88 | function player() { 89 | backgroundAudioManager.title = that.data.title, 90 | backgroundAudioManager.src = that.data.music_url 91 | backgroundAudioManager.coverImgUrl = that.data.coverImgUrl 92 | backgroundAudioManager.play(); 93 | 94 | backgroundAudioManager.onEnded(() => { 95 | player() 96 | }) 97 | } 98 | 99 | // wx.playBackgroundAudio({ 100 | // dataUrl: this.data.music_url, 101 | // title: this.data.title, 102 | // coverImgUrl: this.data.coverImgUrl 103 | // }) 104 | 105 | 106 | 107 | }, 108 | onReady: function() { 109 | // 页面渲染完成 110 | }, 111 | onShow: function() { 112 | // 页面显示 113 | }, 114 | onHide: function() { 115 | // 页面隐藏 116 | }, 117 | onUnload: function() { 118 | // 页面关闭 119 | }, 120 | onShareAppMessage: function(res) { 121 | var that = this; 122 | //console.log(that.data); 123 | return { 124 | title: that.data.mainInfo.share, 125 | imageUrl: that.data.mainInfo.thumb, 126 | path: 'pages/index/index', 127 | success: function(res) { 128 | wx.showToast({ 129 | title: '分享成功', 130 | }) 131 | }, 132 | fail: function(res) { 133 | // 转发失败 134 | wx.showToast({ 135 | title: '分享取消', 136 | }) 137 | } 138 | } 139 | }, 140 | play: function(event) { 141 | if (this.data.isPlayingMusic) { 142 | wx.pauseBackgroundAudio(); 143 | this.setData({ 144 | isPlayingMusic: false 145 | }) 146 | } else { 147 | wx.playBackgroundAudio({ 148 | dataUrl: this.data.music_url, 149 | title: this.data.title, 150 | coverImgUrl: this.data.coverImgUrl 151 | }) 152 | this.setData({ 153 | isPlayingMusic: true 154 | }) 155 | } 156 | }, 157 | }) -------------------------------------------------------------------------------- /WxComment/component/WxComment/WxComment.wxss: -------------------------------------------------------------------------------- 1 | image, video { 2 | width: 100%; 3 | margin: 0 auto auto auto; 4 | } 5 | 6 | image { 7 | height: auto; 8 | } 9 | 10 | .theme_dark { 11 | background-color: black; 12 | color: white; 13 | } 14 | 15 | .title_box { 16 | display: flex; 17 | height: 70rpx; 18 | justify-content: center; 19 | margin-top: 20rpx; 20 | } 21 | 22 | .comment_list_box { 23 | display: flex; 24 | justify-content: center; 25 | } 26 | 27 | .comment_list { 28 | display: flex; 29 | width: 630rpx; 30 | margin: 0 auto; 31 | margin-top: 30rpx; 32 | padding: 30rpx; 33 | min-height: 0; 34 | background-color: rgba(255, 255, 255, 0.9); 35 | border-radius: 5px; 36 | box-shadow: 0 0 20px rgba(190, 77, 43, 0.2); 37 | } 38 | 39 | .comment_avatar { 40 | width: 90rpx; 41 | height: 90rpx; 42 | } 43 | 44 | .comment_avatar image { 45 | width: 90rpx; 46 | height: 90rpx; 47 | border-radius: 50%; 48 | } 49 | 50 | .avatar_button { 51 | background: none; 52 | border: none; 53 | padding: 1rpx 20rpx 1rpx 1rpx; 54 | margin: 1rpx 5rpx 0rpx 5rpx; 55 | } 56 | 57 | .avatar_button::after { 58 | border: none; 59 | outline: none; 60 | 61 | } 62 | 63 | .comment_total_box { 64 | width: 610rpx; 65 | display: flex; 66 | flex-direction: column; 67 | } 68 | 69 | .comment_content_box { 70 | display: flex; 71 | flex-direction: row; 72 | width: 100%; 73 | margin-bottom: 17rpx; 74 | } 75 | 76 | .comment_meta { 77 | display: flex; 78 | flex-direction: row; 79 | flex-wrap: wrap; 80 | justify-content: flex-start; 81 | width: 100%; 82 | margin-bottom: 8rpx; 83 | } 84 | 85 | .comment_nickname { 86 | display: flex; 87 | width: 100%; 88 | margin-right: 20rpx; 89 | margin-left: 20rpx; 90 | font-size: 26rpx; 91 | font-weight: 600; 92 | color: #3f9f94; 93 | } 94 | 95 | .comment_content { 96 | word-break:break-all; 97 | font-size: 32rpx; 98 | margin-left: 25rpx; 99 | width: 100%; 100 | color: #6f6f6f; 101 | } 102 | 103 | .commnet_date { 104 | margin-left: 10rpx; 105 | font-size: 24rpx; 106 | color: #8e8e8e; 107 | } 108 | 109 | .comment_zan { 110 | margin-left: 20rpx; 111 | display: flex; 112 | flex-direction: row; 113 | 114 | } 115 | 116 | .comment_zan image { 117 | width: 30rpx; 118 | height: 30rpx; 119 | } 120 | 121 | .comment_zan_num { 122 | color: #425888; 123 | font-size: 24rpx; 124 | height: 30rpx; 125 | 126 | } 127 | 128 | .no_comment { 129 | color: #dadada; 130 | } 131 | 132 | .title_display { 133 | width: 720rpx; 134 | display: flex; 135 | margin-left: 40rpx; 136 | flex-direction: row; 137 | padding-bottom: 2rpx; 138 | /*border-bottom: 1px solid #f1f1f1;*/ 139 | } 140 | 141 | .views_box { 142 | display: flex; 143 | height: 30rpx; 144 | justify-content: center; 145 | margin-top: 25rpx; 146 | margin-bottom: 10rpx; 147 | } 148 | 149 | .views_title_display { 150 | display: flex; 151 | flex-direction: row; 152 | width: 720rpx; 153 | padding-bottom: 2rpx; 154 | } 155 | 156 | .views_image { 157 | } 158 | 159 | .views_image image { 160 | width: 35rpx; 161 | height: 35rpx; 162 | } 163 | 164 | .views_text { 165 | width: 200rpx; 166 | height: 35rpx; 167 | color: #bfbfbf; 168 | font-size: 22rpx; 169 | line-height: 35rpx; 170 | margin-left: 10rpx; 171 | } 172 | 173 | .seg_line_box { 174 | display: flex; 175 | height: 5rpx; 176 | justify-content: center; 177 | margin-top: 5rpx; 178 | } 179 | 180 | .seg_line_left { 181 | width: 325rpx; 182 | border-bottom: 1rpx solid #e1e1e1; 183 | } 184 | 185 | .seg_line_dot { 186 | width: 50rpx; 187 | border-bottom: 5rpx dotted #dbdbdb; 188 | margin-left: 10rpx; 189 | margin-right: 10rpx; 190 | } 191 | 192 | .seg_line_right { 193 | width: 325rpx; 194 | border-bottom: 1rpx solid #e1e1e1; 195 | } 196 | 197 | .title_img image { 198 | width: 60rpx; 199 | height: 60rpx; 200 | } 201 | 202 | .title_text { 203 | display: flex; 204 | color: #3f9f94; 205 | font-size: 38rpx; 206 | line-height: 60rpx; 207 | margin-left: 10rpx; 208 | } 209 | 210 | .comment_submit_tip { 211 | width: 550rpx; 212 | font-size: 22rpx; 213 | height: 72rpx; 214 | line-height: 100rpx; 215 | margin: 2rpx auto 2rpx auto; 216 | } 217 | 218 | .markdown_tip { 219 | color: #ee9a49; 220 | } 221 | 222 | .sub_comment_list_box { 223 | margin-left: 70rpx; 224 | display: flex; 225 | flex-direction: column; 226 | 227 | } 228 | 229 | .sub_comment_display_box { 230 | display: flex; 231 | flex-direction: row; 232 | } 233 | 234 | .sub_comment_box { 235 | display: flex; 236 | flex-direction: column; 237 | width: 510rpx; 238 | } 239 | 240 | .hide { 241 | position: fixed; 242 | display: none; 243 | } 244 | 245 | .show { 246 | display: block; 247 | } 248 | 249 | .comment_submit_display { 250 | width: 150rpx; 251 | height: 80rpx; 252 | font-size: 36rpx; 253 | line-height: 80rpx; 254 | float: right; 255 | } 256 | 257 | .comment_display { 258 | display: flex; 259 | align-items: Center; 260 | justify-content: space-between; 261 | width: 700rpx; 262 | padding: 25rpx; 263 | background-color: #fff; 264 | min-height: 0; 265 | position: fixed; 266 | bottom: 0; 267 | left: 0; 268 | border-top: 1px solid #f1f1f1; 269 | border-bottom: 1px solid #f1f1f1; 270 | } 271 | 272 | .comment_textarea { 273 | width: 500rpx; 274 | padding: 10rpx; 275 | font-size: 30rpx; 276 | height: 65rpx; 277 | line-height: 1; 278 | float: left; 279 | background-color: #f5f5f5; 280 | border-radius: 5px; 281 | } 282 | 283 | .commit_submit_btn { 284 | width: 150rpx; 285 | height: 80rpx; 286 | font-size: 36rpx; 287 | line-height: 80rpx; 288 | float: right; 289 | } 290 | 291 | .befirst { 292 | width: 600rpx; 293 | height: 450rpx; 294 | margin: 0 auto; 295 | min-height: 0; 296 | overflow: hidden; 297 | margin-top: 200rpx; 298 | } 299 | 300 | .befirst image { 301 | width: 600rpx; 302 | height: 450rpx; 303 | } 304 | -------------------------------------------------------------------------------- /WxComment/component/WxComment/WxComment.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 阅读量:{{article_views}} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 评论列表 29 | 30 | ,共{{comment_num}}条评论 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | {{item.showNickName}} 62 | 63 | {{item.time}} 64 | 65 | 66 | 67 | 68 | 69 | {{item.zanNum}} 70 | 71 | 72 | 73 | 74 | 75 | {{item.zanNum}} 76 | 77 | 78 | 79 | 80 | 81 | {{item.content}} 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 103 | 104 | 105 | 106 | 107 | 108 | {{sub_item.showNickName}} 109 | 110 | {{sub_item.time}} 111 | 112 | 113 | 114 | 115 | 116 | {{sub_item.zanNum}} 117 | 118 | 119 | 120 | 121 | 122 | {{sub_item.zanNum}} 123 | 124 | 125 | 126 | 127 | 128 | {{sub_item.content}} 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 还没有人评论哦^_^ 150 | 151 | 152 | 153 | 154 | 155 | 165 | 166 | 167 |
168 | 169 | 170 |