Giter Club home page Giter Club logo

wedding's Introduction

婚礼互动,让你们的婚礼飞起来

缘起

这个项目就是在我婚礼前一个月左右,心血来潮,想在婚礼上搞点事情,给大家留个深刻的印象。最终婚礼上的反响还不错,近期想着与其让这个项目尘封,倒不如开源出来,祝愿所有的 forker 有情人终成眷属。

介绍

项目分为微信端和大屏端。微信端可以作为电子请柬提前分享给大家,部署的服务器域名最好有备案,不然容易被屏蔽。大屏端是放在婚礼现场的大屏幕上,现场的宾客可以刷弹幕上墙,并且有照片播放页,迎宾页,抽奖页面。另外微信端也作为现场互动的入口,扫码签到可参与抽奖,发弹幕送祝福上大屏幕。

微信端 /

微信端

大屏端 /wall (上下方向键切换不同屏):

大屏端欢迎页

安装

下载本项目

> git clone https://github.com/iammapping/wedding

到项目根目录初始化:npm install

安装 sails

> npm install sails -g

启动:sails lift,生产环境加上 --prod 参数。

配置

配置微信公众号

> vi config/weixin.js
module.exports.weixin = {
  // 微信公众号相关设置
  appid: 'xxx',
  secret: 'xxx',
  // 微信公众号设置的回调地址
  redirectUri: 'http://xxx/home/resolve'
};

配置数据库

导入表结构

mysql> create database wedding;
mysql> source wedding.sql;

修改连接参数(使用 Sequelize 替代了 Sails 框架中默认的 Waterline)

> vi config/connections.js
sequelizeServer: {
  user: 'xxx',
  password: 'xxx',
  database: 'wedding',
  options: {
  dialect: 'mysql',
  dialectOptions: {
    charset: 'utf8mb4'
  },
  host: '127.0.0.1',
  port: 3306,
  logging: true,
  timezone: "+08:00",
  }
}

修改图片素材

微信端在 views/homepage.ejs 中修改,公告也在此文件修改

<img class="disable-tilt" src="/images/1-740.jpg" data-width="1500" data-height="1000" data-center-offset="740" />
...
  • data-width:图片宽度
  • data-height:图片高度
  • data-center-offset:图片主体中线 x 轴位置

大屏端在 assets/styles/wall.css 中修改

#slide1 {
  background-image: url(/images/1-740.jpg);
}
...

修改背景音乐

assets/js/home.js 中修改

PM.bgm = new PM.BGM($('#bgm-audio'), {
  src: '/audios/pm_bgm2.mp3',
  autoplay: false
});

修改地图位置

assets/js/pm.js 中修改

var map = new AMap.Map('pnl-map',{
  zoom: 17,
  center: [115.977634, 29.709759]
});
var marker = new AMap.Marker({
  position: map.getCenter()
});
marker.setMap(map);

// 设置label标签
marker.setLabel({
  offset: new AMap.Pixel(-75, -30),
  content: "PM Infinity婚礼于10月5日晚"
});

center 修改中心坐标,content 修改坐标说明的文字。

修改婚礼日期

assets/js/home.js 中修改

var remainDays = Math.floor((new Date(2016, 9, 5) - new Date())/(24*3600*1000));

彩蛋

在链接中加上 ?state=present 可以直接签到在现场,可用于婚礼现场扫码签到。

微信调试

1. 申请开发测试号

不管公众号账号主体是个人还是企业,都可以通过接口测试号申请,申请好后可以拿到测试的 appIDappsecret

扫码关注测试公众号,只有加入了测试用户列表才有相关的接口权限。

2. 设置网页服务授权的回调域名

体验接口权限表 > 网页服务 > 网页帐号 >网页授权获取用户基本信息,修改授权页面回调域名,如:127.0.0.1:1337

3. 修改项目中的配置文件

module.exports.weixin = {
  // 微信公众号相关设置
  appid: '第 1 步拿到的 appID',
  secret: '第 1 步拿到的 appsecret',
  // 微信公众号设置的回调地址
  redirectUri: 'http://第 2 步设置的回调域名/home/resolve'
};

4. 使用微信 web 开发者工具测试

下载微信web开发者工具,微信(账号需已关注测试公众号)扫码登录该工具,然后在地址栏打开 http://127.0.0.1:1337,如果能正常授权并打开微信端首页,那就大功告成啦。👏

微信手机端实测(前提是手机电脑在同一局域网),将第 2 - 4 步中的本地 ip 修改为你电脑的局域网 ip,然后在微信手机端访问这个 ip,如:http://192.168.13.14:1337

致谢

感谢媳妇的支持,感谢大家的祝福。

感谢项目中使用的所有开源项目和服务:

  • Mysql、Nodejs、Sails、Sequelize、Bluebird、wechat-oauth
  • WeUI、jQuery、jquery.fullPage、slick、CommentCoreLibrary(CCL弹幕)、高德地图、iconfont

License

Copyright 2017 iammapping

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

wedding's People

Contributors

iammapping avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wedding's Issues

新婚快乐

你好,我想问一下你这个部署到服务器是需要有自己的服务器对吗?

我也写了个

hello,无意中看到你写的这个,感觉非常有创意。我自己也非常想做一个,所以用react express也写了一个,但没看你写的代码。因为自己没有界面设计能力,所以界面上还是照搬了你的,不知道这样是否合适......==

求指导

mac 上跑了一下,没成功,马上结婚了,希望牛逼的楼主指点指点!

微信端访问不存在:Not Found

后台返回代码:报错的部分已加黑

Requested :: GET /
Requested :: GET /home/wedding-master?code=001fFXta2vqpZO0Tcwwa2Y1Gta2fFXt0&state=
verbose: Sending 404 ("Not Found") response
Requested :: GET /styles/weui.min.css
Requested :: GET /styles/home.css
Requested :: GET /styles/jquery.fullpage.min.css
Requested :: GET /styles/slick.css
Requested :: GET /styles/wall.css
Requested :: GET /js/dependencies/jquery.min.js
Requested :: GET /js/dependencies/comment.js
Requested :: GET /js/dependencies/slick.min.js
Requested :: GET /js/dependencies/jquery.fullpage.min.js
Requested :: GET /js/pm.js
Requested :: GET /js/home.js
Requested :: GET /js/wall.js
Requested :: GET /styles/jquery.fullpage.min.css.map
verbose: Sending 404 ("Not Found") response

Requested :: GET /js/dependencies/jquery.min.map
verbose: Sending 404 ("Not Found") response
Requested :: GET /js/dependencies/jquery.fullpage.min.js.map
verbose: Sending 404 ("Not Found") response

sails lift ,执行后,报错

qq 20181016180136

执行命令:sails lift

info: Starting app...

info: No local Sails install detected; using globally-installed Sails.
debug: Warning: Grunt functionality may not work properly with your current configuration.
debug: Run npm install sails-hook-grunt --save to continue using Grunt with your app.
debug:
error: A hook (userconfig) failed to load!
error:
error: As of Sails v1, sails.config.globals._ must be either false or a locally-installed version of Lodash (typically require('lodash')). For more info, see http://sailsjs.com/config/globals

error: Could not load Sails app.
error:
error: Tips:
error: • First, take a look at the error message above.
error: • Make sure you've installed dependencies with npm install.
error: • Check that this app was built for a compatible version of Sails.
error: • Have a question or need help? (http://sailsjs.com/support)

关于抽奖

首先感谢作者开源的这个项目,正好我最近结婚可以使用到😂
然后问一个问题,关于抽奖,请问是如何使用的

去除微信公众号

你好,想请问下,如果我想去掉这个微信公众号的呢?
因为我没有微信公众号,所以打算以游客的形式就行了

抽奖按钮,无法点击。

是要在哪里配置下吗?
还是说用户数量太少了,我就一个微信号,测试的。
手机端没啥问题,大屏端 抽奖页面,点不动【开始】

求教

`修改连接参数(使用 Sequelize 替代了 Sails 框架中默认的 Waterline)

vi config/connections.js
sequelizeServer: {
user: 'xxx',
password: 'xxx',
database: 'wedding',
options: {
dialect: 'mysql',
dialectOptions: {
charset: 'utf8mb4'
},
host: '127.0.0.1',
port: 3306,
logging: true,
timezone: "+08:00",
}
}`

新手不太了解这一段不是太了解啊……我这边sails运行起来了,能够从网页端进去,微信的测试号各项也输完了,但是到了微信开发者工具发现根本登不进去,提示授权失败。

求救,sails lift启动报错

1629816404282
info: Starting app...

node[57773]: ../src/node_contextify.cc:681:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfov8::Value &): Assertion `args[1]->IsString()' failed.
1: 0x101306bb5 node::Abort() (.cold.1) [/usr/local/bin/node]
2: 0x1000ad6c9 node::Abort() [/usr/local/bin/node]
3: 0x1000ad531 node::Assert(node::AssertionInfo const&) [/usr/local/bin/node]
4: 0x1000a0d14 node::contextify::ContextifyScript::New(v8::FunctionCallbackInfov8::Value const&) [/usr/local/bin/node]
5: 0x1002624a8 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/usr/local/bin/node]
6: 0x10026175c v8::internal::MaybeHandlev8::internal::Object v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::FunctionTemplateInfo, v8::internal::Handlev8::internal::Object, v8::internal::BuiltinArguments) [/usr/local/bin/node]
7: 0x10026117f v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
8: 0x100a7c4d9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/usr/local/bin/node]
[1] 57773 abort sails lift

MAC系统,node版本v14.17.5

怎么部署?

你好,你这个项目用sails搭框架的,那后面是怎么部署的呢,能稍微说下嘛?

redirect_uri 参数错误

我按教程修改了config/weixin.js

module.exports.weixin = {
  // 微信公众号相关设置
  appid: 'xxx',
  secret: 'xxx',
  redirectUri: 'http://47.94.21.xxx:1337/home/resolve'
};

微信公众平台里也设置了授权回调页面域名:47.94.21.xxx:1337/home/resolve

然后开发者工具里打开47.94.21.xxx:1337

页面显示redirect_uri 参数错误


然后再问一个问题,是否一定要使用域名?直接用ip是否可以?(感觉域名备案好麻烦

问一个部署的问题,当前域名在用,微信授权只能是一个域名

当前的a域名在用,demo默认开启1337.而微信授权只能是一个域名额。

我尝试配置a.bb.com:1337/home/resolve,微信那边不支持1337这种带端口的回调。会报错

尝试配置另一个二级域名x,配置nginx转发本地1337端口到x的二级域名上
x.bb.com/home/resolve 结果微信只能设置一个回调。

额,不知道大家有没有什么好的办法.

怎么增加大屏端图片数量?

我在wall.css里面增加了两张图片,为什么刷新以后还只是显示五个图呢?
#slide1 {
background-image: url(/images/1-700.jpg);
}

#slide2 {
background-image: url(/images/2-950.jpg);
}

#slide3 {
background-image: url(/images/3-800.jpg);
}

#slide4 {
background-image: url(/images/4-634.jpg);
}

#slide5 {
background-image: url(/images/5-600.jpg);
}

#slide6 {
background-image: url(/images/6-793.jpg);
}

#slide7 {
background-image: url(/images/7-440.jpg);
}

手机端访问不显示

嘿嘿,感觉很有趣,想研究一下,在微信开发工具上能显示,在手机端用微信访问打不开,请求显示如下图,谢谢。
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.