├── src
├── styles
│ ├── base
│ │ ├── fn.wxss
│ │ ├── mixin
│ │ │ ├── text.wxss
│ │ │ ├── setArrow.wxss
│ │ │ └── setOnepx.wxss
│ │ ├── variable
│ │ │ ├── color.wxss
│ │ │ ├── global.wxss
│ │ │ ├── weui-msg.wxss
│ │ │ ├── weui-button.wxss
│ │ │ ├── weui-cell.wxss
│ │ │ ├── weui-dialog.wxss
│ │ │ ├── weui-grid.wxss
│ │ │ └── weui-progress.wxss
│ │ └── reset.wxss
│ ├── widget
│ │ ├── weui-cell
│ │ │ ├── weui-switch.wxss
│ │ │ ├── weui-check.wxss
│ │ │ ├── weui-form
│ │ │ │ ├── weui-vcode.wxss
│ │ │ │ ├── weui-select.wxss
│ │ │ │ ├── weui-form_common.wxss
│ │ │ │ └── weui-form-preview.wxss
│ │ │ ├── weui-access.wxss
│ │ │ ├── weui-cell.wxss
│ │ │ ├── weui-uploader.wxss
│ │ │ └── weui-form.wxss
│ │ ├── weui-button
│ │ │ └── weui-button.wxss
│ │ ├── weui-flex
│ │ │ └── weui-flex.wxss
│ │ ├── weui-tips
│ │ │ ├── weui-badge.wxss
│ │ │ └── weui-loadmore.wxss
│ │ ├── weui-progress
│ │ │ └── weui-progress.wxss
│ │ ├── weui-page
│ │ │ ├── weui-article.wxss
│ │ │ └── weui-msg.wxss
│ │ ├── weui-agree
│ │ │ └── weui-agree.wxss
│ │ ├── weui-grid
│ │ │ └── weui-grid.wxss
│ │ ├── weui-footer
│ │ │ └── weui-footer.wxss
│ │ ├── weui-panel
│ │ │ └── weui-panel.wxss
│ │ ├── weui-tab
│ │ │ ├── weui-navbar.wxss
│ │ │ └── weui-tab.wxss
│ │ ├── weui-searchbar
│ │ │ └── weui-searchbar.wxss
│ │ ├── weui-animate
│ │ │ └── weui-animate.wxss
│ │ ├── weui-media-box
│ │ │ └── weui-media-box.wxss
│ │ └── weui-loading
│ │ │ └── weui-loading.wxss
│ └── ezui.wxss
├── pages
│ ├── index
│ │ ├── index.json
│ │ ├── index.wxss
│ │ ├── index.wxml
│ │ └── index.js
│ ├── my
│ │ ├── userotherinfo.json
│ │ ├── donate.json
│ │ ├── index.json
│ │ ├── wallet.json
│ │ ├── myaward.json
│ │ ├── myjoin.json
│ │ ├── mypost.json
│ │ ├── donate.wxml
│ │ ├── myaward.wxss
│ │ ├── myjoin.wxss
│ │ ├── wallet.wxss
│ │ ├── donate.wxss
│ │ ├── userotherinfo.wxss
│ │ ├── index.wxss
│ │ ├── myjoin.wxml
│ │ ├── mypost.wxss
│ │ ├── donate.js
│ │ ├── mypost.wxml
│ │ ├── userotherinfo.wxml
│ │ ├── myaward.wxml
│ │ ├── myjoin.js
│ │ ├── userotherinfo.js
│ │ ├── wallet.wxml
│ │ ├── index.js
│ │ ├── mypost.js
│ │ ├── index.wxml
│ │ ├── myaward.js
│ │ └── wallet.js
│ ├── webview
│ │ ├── index.json
│ │ ├── index.wxss
│ │ ├── index.wxml
│ │ └── index.js
│ ├── luckydraw
│ │ ├── map.wxss
│ │ ├── map.json
│ │ ├── detail.json
│ │ ├── list.json
│ │ ├── alljoiner.json
│ │ ├── awardsaddress.json
│ │ ├── shareimage.wxss
│ │ ├── awardsaddress.wxss
│ │ ├── shareimage.json
│ │ ├── shareimage.wxml
│ │ ├── detail.wxss
│ │ ├── list.wxml
│ │ ├── list.wxss
│ │ ├── alljoiner.wxss
│ │ ├── map.wxml
│ │ ├── alljoiner.wxml
│ │ ├── alljoiner.js
│ │ ├── list.js
│ │ ├── awardsaddress.wxml
│ │ ├── map.js
│ │ └── awardsaddress.js
│ └── create
│ │ ├── create.json
│ │ └── create.wxss
├── images
│ ├── coin.png
│ ├── digger.gif
│ ├── emoji_lose.gif
│ ├── emoji_win.gif
│ ├── mapmarker.png
│ ├── defaultawardimage.jpg
│ └── mapmarker_sponser.png
├── app.json
├── project.config.json
├── app.wxss
└── utils
│ └── util.js
├── donate.jpg
├── thumb.jpg
├── h5
├── express
│ ├── getkuaidi.php
│ ├── index.html
│ └── js
│ │ └── utils.js
├── helpcenter
│ ├── cooperation.html
│ └── qna.html
├── rank
│ ├── js
│ │ └── utils.js
│ └── index.html
└── livetv
│ ├── js
│ └── utils.js
│ └── index.html
├── api
├── updateotiondetail.php
├── getuserheadimg.php
├── wallet.php
├── poststats.php
├── listcomment.php
├── openluckydraw.php
├── getopenid.php
├── mysql.php
├── postexpressno.php
├── getluckymanlist.php
├── postcomment.php
├── reportformid.php
├── earncoin.php
├── coinhistorylist.php
├── postexpressaddress.php
├── sendgetawardnotice.php
├── autoopenluckydraw.php
├── appqrcode.php
├── getluckydrawdetail.php
├── getluckydrawjoins.php
├── login.php
├── joinluckydraw.php
├── homeindex.php
├── listluckydraw.php
├── uploadpic.php
├── functions.php
└── postluckdraw.php
├── README.md
└── LICENSE
/src/styles/base/fn.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/src/pages/my/userotherinfo.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/src/pages/webview/index.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/src/styles/base/mixin/text.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/mixin/setArrow.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/mixin/setOnepx.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/color.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/global.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/weui-msg.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/weui-button.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/weui-cell.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/weui-dialog.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/weui-grid.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/base/variable/weui-progress.wxss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/luckydraw/map.wxss:
--------------------------------------------------------------------------------
1 | /* pages/map/index.wxss */
--------------------------------------------------------------------------------
/src/pages/webview/index.wxss:
--------------------------------------------------------------------------------
1 | /* pages/webview/index.wxss */
--------------------------------------------------------------------------------
/src/pages/my/donate.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "捐赠"
3 | }
--------------------------------------------------------------------------------
/src/pages/my/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我的"
3 | }
--------------------------------------------------------------------------------
/src/pages/my/wallet.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "RP币"
3 | }
--------------------------------------------------------------------------------
/src/pages/luckydraw/map.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "身边抽奖"
3 | }
--------------------------------------------------------------------------------
/src/pages/my/myaward.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "众奖记录"
3 | }
--------------------------------------------------------------------------------
/src/pages/my/myjoin.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我参与的"
3 | }
--------------------------------------------------------------------------------
/src/pages/my/mypost.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我发起的"
3 | }
--------------------------------------------------------------------------------
/donate.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/donate.jpg
--------------------------------------------------------------------------------
/src/pages/create/create.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "发起新抽奖"
3 | }
--------------------------------------------------------------------------------
/src/pages/luckydraw/detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "抽奖详情"
3 | }
--------------------------------------------------------------------------------
/src/pages/luckydraw/list.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "全部抽奖"
3 | }
--------------------------------------------------------------------------------
/thumb.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/thumb.jpg
--------------------------------------------------------------------------------
/src/pages/luckydraw/alljoiner.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "抽奖名单"
3 | }
--------------------------------------------------------------------------------
/src/pages/luckydraw/awardsaddress.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "中奖者信息"
3 | }
--------------------------------------------------------------------------------
/src/images/coin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/src/images/coin.png
--------------------------------------------------------------------------------
/src/images/digger.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/src/images/digger.gif
--------------------------------------------------------------------------------
/src/pages/my/donate.wxml:
--------------------------------------------------------------------------------
1 |
2 | 捐赠
3 |
--------------------------------------------------------------------------------
/src/pages/my/myaward.wxss:
--------------------------------------------------------------------------------
1 | /* pages/my/mypost.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
--------------------------------------------------------------------------------
/src/pages/my/myjoin.wxss:
--------------------------------------------------------------------------------
1 | /* pages/my/mypost.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
--------------------------------------------------------------------------------
/src/pages/my/wallet.wxss:
--------------------------------------------------------------------------------
1 | /* pages/my/wallet.wxss */
2 | page
3 | {
4 | background: #76b6e3;
5 | }
--------------------------------------------------------------------------------
/src/images/emoji_lose.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/src/images/emoji_lose.gif
--------------------------------------------------------------------------------
/src/images/emoji_win.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/src/images/emoji_win.gif
--------------------------------------------------------------------------------
/src/images/mapmarker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/src/images/mapmarker.png
--------------------------------------------------------------------------------
/src/pages/create/create.wxss:
--------------------------------------------------------------------------------
1 | /* pages/create/create.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
--------------------------------------------------------------------------------
/src/pages/my/donate.wxss:
--------------------------------------------------------------------------------
1 | /* pages/my/donate.wxss */
2 | page
3 | {
4 | background-color: #f2f2f2;
5 | }
--------------------------------------------------------------------------------
/src/pages/luckydraw/shareimage.wxss:
--------------------------------------------------------------------------------
1 | /* pages/book/shelfimage.wxss */
2 | page
3 | {
4 | background: #fff;
5 | }
--------------------------------------------------------------------------------
/src/pages/my/userotherinfo.wxss:
--------------------------------------------------------------------------------
1 | /* pages/my/userotherinfo.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
--------------------------------------------------------------------------------
/src/images/defaultawardimage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/src/images/defaultawardimage.jpg
--------------------------------------------------------------------------------
/src/images/mapmarker_sponser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ezshine/mp_luckydraw/HEAD/src/images/mapmarker_sponser.png
--------------------------------------------------------------------------------
/src/pages/luckydraw/awardsaddress.wxss:
--------------------------------------------------------------------------------
1 | /* pages/luckydraw/awardsaddress.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
--------------------------------------------------------------------------------
/src/pages/my/index.wxss:
--------------------------------------------------------------------------------
1 | /* pages/my/index.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | padding-bottom: 60px;
6 | }
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-switch.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_switch {
2 | padding-top: 6px;
3 | padding-bottom: 6px;
4 | }
5 |
--------------------------------------------------------------------------------
/src/pages/webview/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/pages/luckydraw/shareimage.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "生成分享图",
3 | "navigationBarBackgroundColor": "#000000",
4 | "navigationBarTextStyle": "white"
5 | }
--------------------------------------------------------------------------------
/src/styles/base/reset.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | line-height: 1.6;
3 | font-family: -apple-system-font, "Helvetica Neue", sans-serif;
4 | }
5 | icon {
6 | vertical-align: middle;
7 | }
8 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-button/weui-button.wxss:
--------------------------------------------------------------------------------
1 | .weui-btn {
2 | margin-top: 15px;
3 | }
4 | .weui-btn:first-child {
5 | margin-top: 0;
6 | }
7 | .weui-btn-area {
8 | margin: 1.17647059em 15px 0.3em;
9 | }
10 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-flex/weui-flex.wxss:
--------------------------------------------------------------------------------
1 | .weui-flex {
2 | display: -webkit-box;
3 | display: -webkit-flex;
4 | display: flex;
5 | }
6 | .weui-flex__item {
7 | -webkit-box-flex: 1;
8 | -webkit-flex: 1;
9 | flex: 1;
10 | }
11 |
--------------------------------------------------------------------------------
/src/pages/luckydraw/shareimage.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 保存到相册
5 |
--------------------------------------------------------------------------------
/h5/express/getkuaidi.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-tips/weui-badge.wxss:
--------------------------------------------------------------------------------
1 | .weui-badge {
2 | display: inline-block;
3 | padding: .15em .4em;
4 | min-width: 8px;
5 | border-radius: 18px;
6 | background-color: #E64340;
7 | color: #FFFFFF;
8 | line-height: 1.2;
9 | text-align: center;
10 | font-size: 12px;
11 | vertical-align: middle;
12 | }
13 | .weui-badge_dot {
14 | padding: .4em;
15 | min-width: 0;
16 | }
17 |
--------------------------------------------------------------------------------
/src/pages/luckydraw/detail.wxss:
--------------------------------------------------------------------------------
1 | /* pages/luckydraw/detail.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | padding-bottom: 60px;
6 | }
7 | .ezasheet
8 | {
9 | background: #f2f2f2;
10 | position:fixed;
11 | bottom: 0px;
12 | width: 100%;
13 | z-index: 9999;
14 | }
15 | .ezasheetitem
16 | {
17 | background: #fff;
18 | height:50px;
19 | line-height: 50px;
20 | text-align: center;
21 | color:#000;
22 | font-size: 14px;
23 | }
--------------------------------------------------------------------------------
/src/styles/widget/weui-progress/weui-progress.wxss:
--------------------------------------------------------------------------------
1 | .weui-progress {
2 | display: -webkit-box;
3 | display: -webkit-flex;
4 | display: flex;
5 | -webkit-box-align: center;
6 | -webkit-align-items: center;
7 | align-items: center;
8 | }
9 | .weui-progress__bar {
10 | -webkit-box-flex: 1;
11 | -webkit-flex: 1;
12 | flex: 1;
13 | }
14 | .weui-progress__opr {
15 | margin-left: 15px;
16 | font-size: 0;
17 | }
18 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-check.wxss:
--------------------------------------------------------------------------------
1 | .weui-icon-radio {
2 | margin-left: 3.2px;
3 | margin-right: 3.2px;
4 | }
5 | .weui-icon-checkbox_circle,
6 | .weui-icon-checkbox_success {
7 | margin-left: 4.6px;
8 | margin-right: 4.6px;
9 | }
10 | .weui-check__label:active {
11 | background-color: #ECECEC;
12 | }
13 | .weui-check {
14 | position: absolute;
15 | left: -9999px;
16 | }
17 | .weui-check__hd_in-checkbox {
18 | padding-right: 0.35em;
19 | }
20 | .weui-cell__ft_in-radio {
21 | padding-left: 0.35em;
22 | }
23 |
--------------------------------------------------------------------------------
/src/pages/my/myjoin.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 点击加载更多
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-page/weui-article.wxss:
--------------------------------------------------------------------------------
1 | .weui-article {
2 | padding: 20px 15px;
3 | font-size: 15px;
4 | }
5 | .weui-article__section {
6 | margin-bottom: 1.5em;
7 | }
8 | .weui-article__h1 {
9 | font-size: 18px;
10 | font-weight: 400;
11 | margin-bottom: .9em;
12 | }
13 | .weui-article__h2 {
14 | font-size: 16px;
15 | font-weight: 400;
16 | margin-bottom: .34em;
17 | }
18 | .weui-article__h3 {
19 | font-weight: 400;
20 | font-size: 15px;
21 | margin-bottom: .34em;
22 | }
23 | .weui-article__p {
24 | margin: 0 0 .8em;
25 | }
26 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-form/weui-vcode.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_vcode {
2 | padding-right: 0;
3 | }
4 | .weui-vcode-img {
5 | margin-left: 5px;
6 | height: 2.58823529em;
7 | vertical-align: middle;
8 | }
9 | .weui-vcode-btn {
10 | display: inline-block;
11 | height: 2.58823529em;
12 | margin-left: 5px;
13 | padding: 0 0.6em 0 0.7em;
14 | border-left: 1px solid #E5E5E5;
15 | line-height: 2.58823529em;
16 | vertical-align: middle;
17 | font-size: 17px;
18 | color: #3CC51F;
19 | white-space: nowrap;
20 | }
21 | .weui-vcode-btn:active {
22 | color: #52a341;
23 | }
24 |
--------------------------------------------------------------------------------
/api/updateotiondetail.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-agree/weui-agree.wxss:
--------------------------------------------------------------------------------
1 | .weui-agree {
2 | display: block;
3 | padding: .5em 15px;
4 | font-size: 13px;
5 | }
6 | .weui-agree__text {
7 | color: #999999;
8 | }
9 | .weui-agree__link {
10 | display: inline;
11 | color: #586C94;
12 | }
13 | .weui-agree__checkbox {
14 | position: absolute;
15 | left: -9999px;
16 | }
17 | .weui-agree__checkbox-icon {
18 | position: relative;
19 | top: 2px;
20 | display: inline-block;
21 | border: 1px solid #D1D1D1;
22 | background-color: #FFFFFF;
23 | border-radius: 3px;
24 | width: 11px;
25 | height: 11px;
26 | }
27 | .weui-agree__checkbox-icon-check {
28 | position: absolute;
29 | top: 1px;
30 | left: 1px;
31 | }
32 |
--------------------------------------------------------------------------------
/api/getuserheadimg.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/my/index",
5 | "pages/my/userotherinfo",
6 | "pages/create/create",
7 | "pages/luckydraw/detail",
8 | "pages/my/mypost",
9 | "pages/my/myjoin",
10 | "pages/my/myaward",
11 | "pages/my/wallet",
12 | "pages/luckydraw/map",
13 | "pages/webview/index",
14 | "pages/luckydraw/list",
15 | "pages/luckydraw/alljoiner",
16 | "pages/luckydraw/shareimage",
17 | "pages/luckydraw/awardsaddress",
18 | "pages/my/donate"
19 | ],
20 | "window": {
21 | "backgroundTextStyle": "light",
22 | "navigationBarBackgroundColor": "#fff",
23 | "navigationBarTitleText": "众奖",
24 | "navigationBarTextStyle": "black"
25 | }
26 | }
--------------------------------------------------------------------------------
/src/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": "1.9.94",
12 | "appid": "wx8bda751c6e3e9174",
13 | "projectname": "众奖·免费抽奖工具",
14 | "isGameTourist": false,
15 | "condition": {
16 | "search": {
17 | "current": -1,
18 | "list": []
19 | },
20 | "conversation": {
21 | "current": -1,
22 | "list": []
23 | },
24 | "plugin": {
25 | "current": -1,
26 | "list": []
27 | },
28 | "game": {
29 | "currentL": -1,
30 | "list": []
31 | },
32 | "miniprogram": {
33 | "current": -1,
34 | "list": []
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/src/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | page{
2 | background: #f2f2f2;
3 | padding-bottom: 60px;
4 | }
5 | @keyframes kf-marque-animation{ 0% { transform: translateX(0); } 100% { transform: translateX(-33.3%); } }
6 | .marquee{
7 | width: 100%;
8 | height: 30px;
9 | line-height: 30px;
10 | /* background: #fff; */
11 | color:#999;
12 | border: none;
13 | display: block;
14 | margin: 0 auto;
15 | overflow: hidden;
16 | white-space: nowrap;
17 | text-overflow: clip;
18 | position: relative;
19 | font-size: 12px;
20 | }
21 | .marquee .content{
22 | display: inline-block;
23 | position: relative;
24 | padding-right: 0px;
25 | animation: kf-marque-animation 120s linear infinite;
26 | white-space: nowrap;
27 | }
--------------------------------------------------------------------------------
/src/pages/luckydraw/list.wxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | 点击加载更多
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/pages/my/mypost.wxss:
--------------------------------------------------------------------------------
1 | /* pages/my/mypost.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
6 | .tab{
7 | font-size:12px;
8 | text-align: center;
9 | color:#0099ee;
10 | border: 1px solid #0099ee;
11 | height:30px;
12 | line-height: 30px;
13 | flex:1;
14 | }
15 | .tab.active{
16 | background: #0099ee;
17 | color:#fff;
18 | }
19 | .tabmenu
20 | {
21 | display: flex;
22 | justify-content: space-between;
23 | background: #fff;
24 | }
25 | .tab.left
26 | {
27 | border-radius: 15px;
28 | border-right: none;
29 | border-top-right-radius: 0;
30 | border-bottom-right-radius: 0;
31 | }
32 | .tab.center
33 | {
34 | border-radius: 0px;
35 | }
36 | .tab.right
37 | {
38 | border-radius: 15px;
39 | border-left: none;
40 | border-top-left-radius: 0;
41 | border-bottom-left-radius: 0;
42 | }
--------------------------------------------------------------------------------
/api/wallet.php:
--------------------------------------------------------------------------------
1 | =3600){
25 | $canearn=true;
26 | }
27 |
28 | exitJson(0,"",array("totalcoin"=>$row['coin'],"canearncoin"=>$canearn,"distancetime"=>$distancetime));
29 |
30 |
31 |
32 | ?>
--------------------------------------------------------------------------------
/src/pages/luckydraw/list.wxss:
--------------------------------------------------------------------------------
1 | /* pages/luckydraw/list.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
6 | .tab{
7 | font-size:12px;
8 | text-align: center;
9 | color:#0099ee;
10 | border: 1px solid #0099ee;
11 | height:30px;
12 | line-height: 30px;
13 | flex:1;
14 | }
15 | .tab.active{
16 | background: #0099ee;
17 | color:#fff;
18 | }
19 | .tabmenu
20 | {
21 | display: flex;
22 | justify-content: space-between;
23 | background: #fff;
24 | }
25 | .tab.left
26 | {
27 | border-radius: 15px;
28 | border-right: none;
29 | border-top-right-radius: 0;
30 | border-bottom-right-radius: 0;
31 | }
32 | .tab.center
33 | {
34 | border-radius: 0px;
35 | }
36 | .tab.right
37 | {
38 | border-radius: 15px;
39 | border-left: none;
40 | border-top-left-radius: 0;
41 | border-bottom-left-radius: 0;
42 | }
--------------------------------------------------------------------------------
/api/poststats.php:
--------------------------------------------------------------------------------
1 | scene;
11 | if(!$scene){
12 | exitJson(1,"缺少必要的参数");
13 | }
14 |
15 | session_start();
16 | $openid=$_SESSION['openid'];
17 |
18 | $db=getDb();
19 |
20 | $luckydrawid=$jsondata->luckydrawid;
21 | if($scene=="clicksponser" && $luckydrawid!=''){
22 | //sponserclickcount
23 | $sql="update ".getTablePrefix()."_luckydraws set sponserclickcount=sponserclickcount+1 where id='$luckydrawid' LIMIT 1";
24 | mysql_query($sql,$db) or die(mysql_error());
25 | }
26 |
27 |
28 |
29 | exitJson(0,"统计已提交");
30 |
31 |
32 | ?>
--------------------------------------------------------------------------------
/src/styles/widget/weui-grid/weui-grid.wxss:
--------------------------------------------------------------------------------
1 | .weui-grids {
2 | border-top: 1rpx solid #D9D9D9;
3 | border-left: 1rpx solid #D9D9D9;
4 | overflow: hidden;
5 | }
6 | .weui-grid {
7 | position: relative;
8 | float: left;
9 | padding: 20px 10px;
10 | width: 33.33333333%;
11 | box-sizing: border-box;
12 | border-right: 1rpx solid #D9D9D9;
13 | border-bottom: 1rpx solid #D9D9D9;
14 | }
15 | .weui-grid_active {
16 | background-color: #ECECEC;
17 | }
18 | .weui-grid__icon {
19 | display: block;
20 | width: 28px;
21 | height: 28px;
22 | margin: 0 auto;
23 | }
24 | .weui-grid__label {
25 | margin-top: 5px;
26 | display: block;
27 | text-align: center;
28 | color: #000000;
29 | font-size: 14px;
30 | white-space: nowrap;
31 | text-overflow: ellipsis;
32 | overflow: hidden;
33 | }
34 |
--------------------------------------------------------------------------------
/src/pages/luckydraw/alljoiner.wxss:
--------------------------------------------------------------------------------
1 | /* pages/luckydraw/alljoiner.wxss */
2 | page
3 | {
4 | background: #f2f2f2;
5 | }
6 | .tab{
7 | font-size:12px;
8 | text-align: center;
9 | color:#0099ee;
10 | border: 1px solid #0099ee;
11 | height:30px;
12 | line-height: 30px;
13 | flex:1;
14 | }
15 | .tab.active{
16 | background: #0099ee;
17 | color:#fff;
18 | }
19 | .tabmenu
20 | {
21 | display: flex;
22 | justify-content: space-between;
23 | background: #fff;
24 | }
25 | .tab.left
26 | {
27 | border-radius: 15px;
28 | border-right: none;
29 | border-top-right-radius: 0;
30 | border-bottom-right-radius: 0;
31 | }
32 | .tab.center
33 | {
34 | border-radius: 0px;
35 | }
36 | .tab.right
37 | {
38 | border-radius: 15px;
39 | border-left: none;
40 | border-top-left-radius: 0;
41 | border-bottom-left-radius: 0;
42 | }
--------------------------------------------------------------------------------
/api/listcomment.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api/openluckydraw.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api/getopenid.php:
--------------------------------------------------------------------------------
1 | code;
14 |
15 | if($code!=''){
16 | $contents = file_get_contents('https://api.weixin.qq.com/sns/jscode2session?appid='.getAppId().'&secret='.getAppSecret().'&js_code='.$code.'&grant_type=authorization_code');
17 | $jsondecode = json_decode($contents);
18 | $openid = $jsondecode->openid;//输出openid
19 | $session_key=$jsondecode->session_key;
20 | exitJson(0,'',array('openid'=>$openid,'session_key'=>$session_key));
21 | }else{
22 | exitJson(1,'缺少code参数');
23 | }
24 |
25 | ?>
--------------------------------------------------------------------------------
/api/mysql.php:
--------------------------------------------------------------------------------
1 | '数据库地址',
19 | 'user' => '数据库用户名',
20 | 'pass' => '数据库密码',
21 | 'DB_CHARSET'=> 'utf8mb4'
22 | );
23 |
24 | $db = connDB($db1);
25 |
26 | mysql_select_db('数据库名称', $db);
27 |
28 | mysql_query('set names \'utf8mb4\'', $db);
29 |
30 | return $db;
31 | }
32 |
33 | function getTablePrefix(){
34 | return '表前缀';
35 | }
36 |
37 | function getAppId(){
38 | return '微信小程序ID';
39 | }
40 |
41 | function getAppSecret(){
42 | return '微信小程序secret';
43 | }
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-access.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_access {
2 | color: inherit;
3 | }
4 | .weui-cell__ft_in-access {
5 | padding-right: 13px;
6 | position: relative;
7 | }
8 | .weui-cell__ft_in-access:after {
9 | content: " ";
10 | display: inline-block;
11 | height: 6px;
12 | width: 6px;
13 | border-width: 2px 2px 0 0;
14 | border-color: #C8C8CD;
15 | border-style: solid;
16 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
17 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
18 | position: relative;
19 | top: -2px;
20 | position: absolute;
21 | top: 50%;
22 | margin-top: -4px;
23 | right: 2px;
24 | }
25 | .weui-cell_link {
26 | color: #586C94;
27 | font-size: 14px;
28 | }
29 | .weui-cell_link:active {
30 | background-color: #ECECEC;
31 | }
32 | .weui-cell_link:first-child:before {
33 | display: block;
34 | }
35 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-page/weui-msg.wxss:
--------------------------------------------------------------------------------
1 | .weui-msg {
2 | padding-top: 36px;
3 | text-align: center;
4 | }
5 | .weui-msg__link {
6 | display: inline;
7 | color: #586C94;
8 | }
9 | .weui-msg__icon-area {
10 | margin-bottom: 30px;
11 | }
12 | .weui-msg__text-area {
13 | margin-bottom: 25px;
14 | padding: 0 20px;
15 | }
16 | .weui-msg__title {
17 | margin-bottom: 5px;
18 | font-weight: 400;
19 | font-size: 20px;
20 | }
21 | .weui-msg__desc {
22 | font-size: 14px;
23 | color: #999999;
24 | }
25 | .weui-msg__opr-area {
26 | margin-bottom: 25px;
27 | }
28 | .weui-msg__extra-area {
29 | margin-bottom: 15px;
30 | font-size: 14px;
31 | color: #999999;
32 | }
33 | @media screen and (min-height: 438px) {
34 | .weui-msg__extra-area {
35 | position: fixed;
36 | left: 0;
37 | bottom: 0;
38 | width: 100%;
39 | text-align: center;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/api/postexpressno.php:
--------------------------------------------------------------------------------
1 | id;
12 | $expressno=$jsondata->expressno;
13 | $expressremark=$jsondata->expressremark;
14 |
15 | $db=getDb();
16 | $sql = "update `".getTablePrefix()."_joins` set expressno='$expressno',expressremark='$expressremark' where id='$id' and getaward=1 LIMIT 1";
17 | mysql_query($sql, $db) or die(mysql_error());
18 |
19 | $sql="select ownerid from `".getTablePrefix()."_joins` where id='$id' LIMIT 1";
20 | $res=mysql_query($sql, $db) or die(mysql_error());
21 | $row = mysql_fetch_assoc($res);
22 |
23 | if($expressno!=""){
24 | sendExpressNotice($expressno,$row['ownerid']);
25 | }
26 |
27 |
28 | exitJson(0,"快递信息已保存");
29 |
30 |
31 | ?>
--------------------------------------------------------------------------------
/src/styles/widget/weui-footer/weui-footer.wxss:
--------------------------------------------------------------------------------
1 | .weui-footer {
2 | color: #999999;
3 | font-size: 14px;
4 | text-align: center;
5 | }
6 | .weui-footer_fixed-bottom {
7 | position: fixed;
8 | bottom: .52em;
9 | left: 0;
10 | right: 0;
11 | }
12 | .weui-footer__links {
13 | font-size: 0;
14 | }
15 | .weui-footer__link {
16 | display: inline-block;
17 | vertical-align: top;
18 | margin: 0 .62em;
19 | position: relative;
20 | font-size: 14px;
21 | color: #586C94;
22 | }
23 | .weui-footer__link:before {
24 | content: " ";
25 | position: absolute;
26 | left: 0;
27 | top: 0;
28 | width: 1px;
29 | bottom: 0;
30 | border-left: 1rpx solid #C7C7C7;
31 | color: #C7C7C7;
32 | left: -0.65em;
33 | top: .36em;
34 | bottom: .36em;
35 | }
36 | .weui-footer__link:first-child:before {
37 | display: none;
38 | }
39 | .weui-footer__text {
40 | padding: 0 .34em;
41 | font-size: 12px;
42 | }
43 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-tips/weui-loadmore.wxss:
--------------------------------------------------------------------------------
1 | .weui-loadmore {
2 | width: 65%;
3 | margin: 1.5em auto;
4 | line-height: 1.6em;
5 | font-size: 14px;
6 | text-align: center;
7 | }
8 | .weui-loadmore__tips {
9 | display: inline-block;
10 | vertical-align: middle;
11 | }
12 | .weui-loadmore_line {
13 | border-top: 1px solid #E5E5E5;
14 | margin-top: 2.4em;
15 | }
16 | .weui-loadmore__tips_in-line {
17 | position: relative;
18 | top: -0.9em;
19 | padding: 0 .55em;
20 | background-color: #FFFFFF;
21 | color: #999999;
22 | }
23 | .weui-loadmore__tips_in-dot {
24 | position: relative;
25 | padding: 0 .16em;
26 | width: 4px;
27 | height: 1.6em;
28 | }
29 | .weui-loadmore__tips_in-dot:before {
30 | content: " ";
31 | position: absolute;
32 | top: 50%;
33 | left: 50%;
34 | margin-top: -1px;
35 | margin-left: -2px;
36 | width: 4px;
37 | height: 4px;
38 | border-radius: 50%;
39 | background-color: #E5E5E5;
40 | }
41 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-form/weui-select.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_select {
2 | padding: 0;
3 | }
4 | .weui-select {
5 | position: relative;
6 | padding-left: 15px;
7 | padding-right: 30px;
8 | height: 2.58823529em;
9 | min-height: 2.58823529em;
10 | line-height: 2.58823529em;
11 | border-right: 1rpx solid #D9D9D9;
12 | }
13 | .weui-select:before {
14 | content: " ";
15 | display: inline-block;
16 | height: 6px;
17 | width: 6px;
18 | border-width: 2px 2px 0 0;
19 | border-color: #C8C8CD;
20 | border-style: solid;
21 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
22 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
23 | position: relative;
24 | top: -2px;
25 | position: absolute;
26 | top: 50%;
27 | right: 15px;
28 | margin-top: -4px;
29 | }
30 | .weui-select_in-select-after {
31 | padding-left: 0;
32 | }
33 | .weui-cell__hd_in-select-after,
34 | .weui-cell__bd_in-select-before {
35 | padding-left: 15px;
36 | }
37 |
--------------------------------------------------------------------------------
/api/getluckymanlist.php:
--------------------------------------------------------------------------------
1 | provinceName.$address->cityName.$address->countyName."▓▓▓▓▓▓▓▓▓▓";
26 | $row['expressaddress']="";
27 |
28 | $list[]=$row;
29 | }
30 |
31 | exitJson(0,"",$list);
32 |
33 | ?>
--------------------------------------------------------------------------------
/src/pages/my/donate.js:
--------------------------------------------------------------------------------
1 | // pages/my/donate.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 | btnDonate:function(){
11 |
12 | },
13 | /**
14 | * 生命周期函数--监听页面加载
15 | */
16 | onLoad: function (options) {
17 |
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面初次渲染完成
22 | */
23 | onReady: function () {
24 |
25 | },
26 |
27 | /**
28 | * 生命周期函数--监听页面显示
29 | */
30 | onShow: function () {
31 |
32 | },
33 |
34 | /**
35 | * 生命周期函数--监听页面隐藏
36 | */
37 | onHide: function () {
38 |
39 | },
40 |
41 | /**
42 | * 生命周期函数--监听页面卸载
43 | */
44 | onUnload: function () {
45 |
46 | },
47 |
48 | /**
49 | * 页面相关事件处理函数--监听用户下拉动作
50 | */
51 | onPullDownRefresh: function () {
52 |
53 | },
54 |
55 | /**
56 | * 页面上拉触底事件的处理函数
57 | */
58 | onReachBottom: function () {
59 |
60 | },
61 |
62 | /**
63 | * 用户点击右上角分享
64 | */
65 | onShareAppMessage: function () {
66 |
67 | }
68 | })
--------------------------------------------------------------------------------
/api/postcomment.php:
--------------------------------------------------------------------------------
1 | luckydrawid;
11 | $uid=$jsondata->uid;
12 | $content=textFilter($jsondata->content);
13 |
14 | if($uid=="" || $luckydrawid=="" || $content==""){
15 | exitJson(1,"缺少必要的参数");
16 | }
17 |
18 | $openid=getUserOpenIdById($uid)['openid'];
19 | $userInfo=getUserSimpleInfo($openid);
20 |
21 | $ownernickname=$userInfo["nickname"];
22 | $ownerheadimg=$userInfo["headimg"];
23 |
24 | $now=time();
25 | $db=getDb();
26 |
27 | $sql="insert into `".getTablePrefix()."_comments` (luckydrawid,ownerid,ownernickname,ownerheadimg,content,createdate) values('$luckydrawid','$openid','$ownernickname','$ownerheadimg','$content','$now')";
28 | $res=mysql_query($sql,$db) or die(mysql_error());
29 |
30 | exitJson(0,"留言已发布");
31 |
32 |
33 | ?>
--------------------------------------------------------------------------------
/src/styles/widget/weui-panel/weui-panel.wxss:
--------------------------------------------------------------------------------
1 | .weui-panel {
2 | background-color: #FFFFFF;
3 | margin-top: 10px;
4 | position: relative;
5 | overflow: hidden;
6 | }
7 | .weui-panel:first-child {
8 | margin-top: 0;
9 | }
10 | .weui-panel:before {
11 | content: " ";
12 | position: absolute;
13 | left: 0;
14 | top: 0;
15 | right: 0;
16 | height: 1px;
17 | border-top: 1rpx solid #E5E5E5;
18 | color: #E5E5E5;
19 | }
20 | .weui-panel:after {
21 | content: " ";
22 | position: absolute;
23 | left: 0;
24 | bottom: 0;
25 | right: 0;
26 | height: 1px;
27 | border-bottom: 1rpx solid #E5E5E5;
28 | color: #E5E5E5;
29 | }
30 | .weui-panel__hd {
31 | padding: 14px 15px 10px;
32 | color: #999999;
33 | font-size: 13px;
34 | position: relative;
35 | }
36 | .weui-panel__hd:after {
37 | content: " ";
38 | position: absolute;
39 | left: 0;
40 | bottom: 0;
41 | right: 0;
42 | height: 1px;
43 | border-bottom: 1rpx solid #E5E5E5;
44 | color: #E5E5E5;
45 | left: 15px;
46 | }
47 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-form/weui-form_common.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_input {
2 | padding-top: 0;
3 | padding-bottom: 0;
4 | }
5 | .weui-label {
6 | width: 105px;
7 | word-wrap: break-word;
8 | word-break: break-all;
9 | }
10 | .weui-input {
11 | height: 2.58823529em;
12 | min-height: 2.58823529em;
13 | line-height: 2.58823529em;
14 | }
15 | .weui-toptips {
16 | position: fixed;
17 | -webkit-transform: translateZ(0);
18 | transform: translateZ(0);
19 | top: 0;
20 | left: 0;
21 | right: 0;
22 | padding: 5px;
23 | font-size: 14px;
24 | text-align: center;
25 | color: #FFFFFF;
26 | z-index: 5000;
27 | word-wrap: break-word;
28 | word-break: break-all;
29 | }
30 | .weui-toptips_warn {
31 | background-color: #E64340;
32 | }
33 | .weui-textarea {
34 | display: block;
35 | width: 100%;
36 | }
37 | .weui-textarea-counter {
38 | color: #B2B2B2;
39 | text-align: right;
40 | }
41 | .weui-textarea-counter_warn {
42 | color: #E64340;
43 | }
44 | .weui-cell_warn {
45 | color: #E64340;
46 | }
47 |
--------------------------------------------------------------------------------
/api/reportformid.php:
--------------------------------------------------------------------------------
1 | formid;
15 | $token=$jsondata->token;
16 |
17 | session_start();
18 |
19 | if($_SESSION['token']!=$token){
20 | exitJson(1,'非法请求,请重新登录');
21 | }
22 |
23 |
24 | $uid=$_SESSION['openid'];
25 | if($formid!="" && $uid!=""){
26 | if(trim($formid)=="the formId is a mock one"){
27 | exitJson(1,'formid 错误');
28 | }
29 |
30 | $db = getDb();
31 | $now=time();
32 | $sql="insert into ".getTablePrefix()."_formids (ownerid,formid,createdate) values('$uid','$formid','$now')";
33 | mysql_query($sql, $db) or die(mysql_error());
34 |
35 | exitJson(0,'提交成功');
36 | }else{
37 | exitJson(1,'缺少必要的参数');
38 | }
39 |
40 |
41 | ?>
--------------------------------------------------------------------------------
/src/styles/ezui.wxss:
--------------------------------------------------------------------------------
1 |
2 | .blockbutton
3 | {
4 | border-radius:22px;
5 | width:100%;
6 | height:44px;
7 | line-height:44px;
8 | font-size:16px;
9 | text-align:center;
10 | background:#ccc;
11 | color:#fff;
12 | border-top:none;
13 | border-left:none;
14 | border-right:none;
15 | border-bottom:rgba(0,0,0,.1) 2px solid;
16 | }
17 | .blockbutton:active{
18 | opacity: .8;
19 | }
20 | .blockbutton.gray
21 | {
22 | background:#ccc;
23 | color:#fff;
24 | box-shadow:0px 10px 50px rgba(204,204,204,.5);
25 | }
26 | .blockbutton.red
27 | {
28 | background:#FF5500;
29 | color:#fff;
30 | box-shadow:0px 10px 50px rgba(255,85,0,.5);
31 | }
32 | .blockbutton.blue
33 | {
34 | background:#0099ee;
35 | color:#fff;
36 | box-shadow:0px 10px 50px rgba(0,153,238,.5);
37 | }
38 | .blockbutton.yellow
39 | {
40 | background:#FFcc55;
41 | color:#fff;
42 | box-shadow:0px 10px 50px rgba(255,204,85,.5);
43 | }
44 | .blockbutton.black
45 | {
46 | background:#333333;
47 | color:#fff;
48 | box-shadow:0px 10px 50px rgba(51,51,51,.5);
49 | }
--------------------------------------------------------------------------------
/api/earncoin.php:
--------------------------------------------------------------------------------
1 | =3600){
26 | $coin=$row['coin']+1;
27 | $sql = "update `".getTablePrefix()."_members` set coin='$coin',lastearncoin='$now' where openid='$openid' LIMIT 1";
28 | $res=mysql_query($sql, $db) or die(mysql_error());
29 |
30 | if($res==true)addCoinHistory(1,1,"钱包产出领取");
31 | else exitJson(1,"非法请求");
32 |
33 | exitJson(0,"已领取");
34 | }else{
35 | exitJson(1,'不可领取');
36 | }
37 |
38 |
39 |
40 |
41 |
42 | ?>
--------------------------------------------------------------------------------
/api/coinhistorylist.php:
--------------------------------------------------------------------------------
1 | token;
15 |
16 | session_start();
17 |
18 | if($_SESSION['token']!=$token){
19 | exitJson(1,'非法请求,请重新登录');
20 | }
21 |
22 | $uid=$_SESSION['openid'];
23 |
24 | $page=0;
25 | if($jsondata->page!=""){
26 | $page=$jsondata->page;
27 | }
28 | $limit=10;
29 |
30 | $db = getDb();
31 | $sql = "select * from ".getTablePrefix()."_coinhistory where `ownerid` = '$uid' order by createdate desc LIMIT ".$limit*$page.",$limit";
32 | $res=mysql_query($sql,$db) or die(mysql_error());
33 |
34 | $list = array();
35 | while ($row = mysql_fetch_assoc($res)) {
36 | $row['createdate']=date('Y-m-d H:i:s', $row['createdate']);
37 | $list[]=$row;
38 | }
39 |
40 | exitJson(0,"",$list);
41 |
42 |
43 | ?>
--------------------------------------------------------------------------------
/api/postexpressaddress.php:
--------------------------------------------------------------------------------
1 | id;
12 | $expressaddress=$jsondata->expressaddress;
13 |
14 | session_start();
15 | $openid=$_SESSION['openid'];
16 | if(!$openid){
17 | exitJson(1,'非法请求,请重新登录');
18 | }
19 |
20 | $db=getDb();
21 |
22 |
23 | $sql="select * from `".getTablePrefix()."_joins` where luckydrawid='$id' and ownerid='$openid' and getaward=1 LIMIT 1";
24 | $res=mysql_query($sql,$db) or die(mysql_error());
25 | $row=mysql_fetch_assoc($res);
26 |
27 | $now=time();
28 | if($row['awarddate']!=0 && $now>intval($row['awarddate'])+86400*7){
29 | exitJson(1,"仅限中奖后7天内填写收货地址");
30 | }
31 |
32 | $sql = "update `".getTablePrefix()."_joins` set expressaddress='$expressaddress' where luckydrawid='$id' and ownerid='$openid' and getaward=1 LIMIT 1";
33 | mysql_query($sql, $db) or die(mysql_error());
34 |
35 |
36 | exitJson(0,"地址提交成功,请等待发货");
37 |
38 |
39 | ?>
--------------------------------------------------------------------------------
/src/pages/my/mypost.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 发起新抽奖
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 点击加载更多
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-tab/weui-navbar.wxss:
--------------------------------------------------------------------------------
1 | .weui-navbar {
2 | display: -webkit-box;
3 | display: -webkit-flex;
4 | display: flex;
5 | position: absolute;
6 | z-index: 500;
7 | top: 0;
8 | width: 100%;
9 | border-bottom: 1rpx solid #CCCCCC;
10 | }
11 | .weui-navbar__item {
12 | position: relative;
13 | display: block;
14 | -webkit-box-flex: 1;
15 | -webkit-flex: 1;
16 | flex: 1;
17 | padding: 13px 0;
18 | text-align: center;
19 | font-size: 0;
20 | }
21 | .weui-navbar__item.weui-bar__item_on {
22 | color: #1AAD19;
23 | }
24 | .weui-navbar__slider {
25 | position: absolute;
26 | content: " ";
27 | left: 0;
28 | bottom: 0;
29 | width: 6em;
30 | height: 3px;
31 | background-color: #1AAD19;
32 | -webkit-transition: -webkit-transform .3s;
33 | transition: -webkit-transform .3s;
34 | transition: transform .3s;
35 | transition: transform .3s, -webkit-transform .3s;
36 | }
37 | .weui-navbar__title {
38 | display: inline-block;
39 | font-size: 15px;
40 | max-width: 8em;
41 | width: auto;
42 | overflow: hidden;
43 | text-overflow: ellipsis;
44 | white-space: nowrap;
45 | word-wrap: normal;
46 | }
47 |
--------------------------------------------------------------------------------
/api/sendgetawardnotice.php:
--------------------------------------------------------------------------------
1 | openid;
12 | $luckydrawid=$jsondata->id;
13 |
14 | $luckydrawInfo=getLuckyDrawById($luckydrawid);
15 |
16 | session_start();
17 | $operatorid=$_SESSION['openid'];
18 | if(!$operatorid){
19 | exitJson(1,'非法请求');
20 | }else if(!getIsLuckyMan($luckydrawid,$openid)){
21 | exitJson(2,'该用户未中奖');
22 | }
23 |
24 | $db=getDb();
25 | $sql="select awardnoticed from ".getTablePrefix()."_joins where luckydrawid='$luckydrawid' and ownerid='$openid' LIMIT 1";
26 | $res=mysql_query($sql,$db) or die(mysql_error());
27 | $row=mysql_fetch_assoc($res);
28 |
29 | if($row['awardnoticed']==1){
30 | exitJson(4,'已发送通知');
31 | }
32 |
33 | // $openid="odROK5VJQYsiep18KV1_0hATRtpo";
34 | sendGetAwardNotice($luckydrawInfo['awardname'],$luckydrawid,$openid);
35 |
36 | $sql="update ".getTablePrefix()."_joins set awardnoticed=1 where luckydrawid='$luckydrawid' and ownerid='$openid' LIMIT 1";
37 | $res=mysql_query($sql,$db) or die(mysql_error());
38 |
39 | exitJson(0,'发送成功');
40 |
41 | ?>
--------------------------------------------------------------------------------
/api/autoopenluckydraw.php:
--------------------------------------------------------------------------------
1 | ".($now-86400);
22 |
23 | $res=mysql_query($sql,$db) or die(mysql_error());
24 |
25 | outputLog(date('Y-m-d H:i:s',$now)."====检查自动开奖");
26 | while ($row = mysql_fetch_assoc($res)) {
27 | // trace($row["id"]);
28 | if(openAward($row["id"])){
29 | outputLog(date('Y-m-d H:i:s',$now)." id:".$row['id']." name:".$row['awardname']." opendate:".date('Y-m-d H:i:s',$row['opendate'])." 已自动开奖");
30 | }else{
31 | outputLog(date('Y-m-d H:i:s',$now)." id:".$row['id']." name:".$row['awardname']." opendate:".date('Y-m-d H:i:s',$row['opendate'])." 0人参与,已过期");
32 | };
33 | }
34 | outputLog(date('Y-m-d H:i:s',$now)."====检查自动开奖完成");
35 |
36 | ?>
--------------------------------------------------------------------------------
/src/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | @import "styles/weui.wxss";
3 | @import "styles/iconfont.wxss";
4 | @import "styles/ezui.wxss";
5 |
6 | .container {
7 | height: 100%;
8 | display: flex;
9 | flex-direction: column;
10 | align-items: center;
11 | justify-content: space-between;
12 | padding: 200rpx 0;
13 | box-sizing: border-box;
14 | }
15 | view{box-sizing: border-box;}
16 |
17 | .cell{
18 | padding:5px 10px;
19 | background:#fff;
20 | line-height:40px;
21 | }
22 | .cell.clickable:active{
23 | background:#eee;
24 | }
25 | .cell>.celllabel
26 | {
27 | font-size:14px;
28 | height:40px;
29 | }
30 | .cell>.celllabel>input
31 | {
32 | height:40px;
33 | line-height:40px;
34 | box-sizing: border-box;
35 | }
36 | .cell>.cellcontent
37 | {
38 | font-size:14px;
39 | height:40px;
40 | margin-left:10px;
41 | text-align:right;
42 | text-overflow: ellipsis;
43 | white-space: nowrap;
44 | overflow: hidden;
45 | }
46 | .cell>.cellcontent>input
47 | {
48 | height:40px;
49 | line-height:40px;
50 | box-sizing: border-box;
51 | }
52 | .celllabel>.iconfont
53 | {
54 | margin-right:5px;
55 | }
56 | .cell>.cellsuffix
57 | {
58 | font-size:14px;
59 | height:40px;
60 | margin-left:5px;
61 | text-align:right;
62 | }
63 | .cellsuffix>.iconfont
64 | {
65 | color:#ccc;
66 | }
--------------------------------------------------------------------------------
/src/styles/widget/weui-tab/weui-tab.wxss:
--------------------------------------------------------------------------------
1 | .weui-navbar {
2 | display: -webkit-box;
3 | display: -webkit-flex;
4 | display: flex;
5 | position: absolute;
6 | z-index: 500;
7 | top: 0;
8 | width: 100%;
9 | border-bottom: 1rpx solid #CCCCCC;
10 | }
11 | .weui-navbar__item {
12 | position: relative;
13 | display: block;
14 | -webkit-box-flex: 1;
15 | -webkit-flex: 1;
16 | flex: 1;
17 | padding: 13px 0;
18 | text-align: center;
19 | font-size: 0;
20 | }
21 | .weui-navbar__item.weui-bar__item_on {
22 | color: #1AAD19;
23 | }
24 | .weui-navbar__slider {
25 | position: absolute;
26 | content: " ";
27 | left: 0;
28 | bottom: 0;
29 | width: 6em;
30 | height: 3px;
31 | background-color: #1AAD19;
32 | -webkit-transition: -webkit-transform .3s;
33 | transition: -webkit-transform .3s;
34 | transition: transform .3s;
35 | transition: transform .3s, -webkit-transform .3s;
36 | }
37 | .weui-navbar__title {
38 | display: inline-block;
39 | font-size: 15px;
40 | max-width: 8em;
41 | width: auto;
42 | overflow: hidden;
43 | text-overflow: ellipsis;
44 | white-space: nowrap;
45 | word-wrap: normal;
46 | }
47 | .weui-tab {
48 | position: relative;
49 | height: 100%;
50 | }
51 | .weui-tab__panel {
52 | box-sizing: border-box;
53 | height: 100%;
54 | padding-top: 50px;
55 | overflow: auto;
56 | -webkit-overflow-scrolling: touch;
57 | }
58 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 微信小程序——众奖
2 | =============
3 | ##### 一套微信小程序抽奖平台(包含全部前后端源码)
4 | ##### 开发者:[大帅(ezshine)](https://www.zhihu.com/people/ezshine)
5 |
6 | [](https://github.com/996icu/996.ICU/blob/master/LICENSE)
7 | [](https://996.icu/#/zh_CN)
8 |
9 | 
10 |
11 | ### 我有一篇专栏专门讲过这个小程序的开发过程,可以先看看那篇文章:https://zhuanlan.zhihu.com/p/37061517
12 |
13 | ### 功能介绍
14 |
15 | #### 1、口令抽奖:
16 | #### 大家都知道小程序的限制颇多,不能引导回公众号,即使关联跳转小程序,也有数量限制。口令抽奖一来可以限制参与抽奖的人,二来可以通过口令提示引导回公众号下发口令,带动关注。
17 |
18 |
19 | #### 2、限定地点:
20 | #### 我希望这个小程序未来也可以帮助线下的商户发起抽奖活动,那么做一个参与的位置电子围栏是很有必要的。
21 |
22 |
23 | #### 3、限定性别:
24 | #### 不多解释
25 |
26 |
27 | #### 4、条码解锁:
28 | #### 这个的思路也很好玩,让抽奖活动需要触发扫描特定的条形码方可参与。那么自然特别适合快速消费品品牌来玩。
29 |
30 |
31 | #### 5、RP币
32 |
33 | 如果你觉得这份源码对您有些帮助,可以通过以下方式请作者吃顿饭,抽包烟,喝杯咖啡等。
34 | 
35 |
36 |
37 | ### 部署说明
38 | 对懂技术的朋友而言,看了部署说明肯定可以正常跑起来,我也会在微信中提供免费的咨询和指导。
39 | 但如果你真的一点技术都不懂,免费咨询和指导你也听不懂看不明白,
40 | 那么可以支付一些报酬,我将为你提供一条龙的部署服务或更个性化的修改。
41 |
42 | * src/app.js中更改相关的URL路径
43 | * src为全部前端源码,api为全部后端php源码
44 | * h5中是一些简单的附属页面,比如获奖快递查询
45 |
46 | * 在微信小程序管理后台配置域名,并将api目录上传至指定域名内
47 | * 在API文件夹中的mysql.php中配置自己的数据库地址,用户名,微信小程序appid,secret等
48 | * 将“数据库表.sql”导入到自己的数据库中
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/pages/webview/index.js:
--------------------------------------------------------------------------------
1 | // pages/webview/index.js
2 | var app = getApp();
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | urlsrc:""
10 | },
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: function (options) {
16 | var url = unescape(options.url);
17 | if (app.globalData.userInfo){
18 | if (url.lastIndexOf("?") >= 0)url = url+"&uid="+app.globalData.userInfo.id;
19 | else url = url + "?uid=" + app.globalData.userInfo.id;
20 | }
21 | console.log(url);
22 | this.setData({
23 | urlsrc: url
24 | });
25 | },
26 |
27 | /**
28 | * 生命周期函数--监听页面初次渲染完成
29 | */
30 | onReady: function () {
31 |
32 | },
33 |
34 | /**
35 | * 生命周期函数--监听页面显示
36 | */
37 | onShow: function () {
38 |
39 | },
40 |
41 | /**
42 | * 生命周期函数--监听页面隐藏
43 | */
44 | onHide: function () {
45 |
46 | },
47 |
48 | /**
49 | * 生命周期函数--监听页面卸载
50 | */
51 | onUnload: function () {
52 |
53 | },
54 |
55 | /**
56 | * 页面相关事件处理函数--监听用户下拉动作
57 | */
58 | onPullDownRefresh: function () {
59 |
60 | },
61 |
62 | /**
63 | * 页面上拉触底事件的处理函数
64 | */
65 | onReachBottom: function () {
66 |
67 | },
68 | onShareAppMessage: function (options) {
69 | var that = this;
70 | return {
71 | title: app.getAppName(),
72 | path: '/pages/webview/index?url=' + options.webViewUrl,
73 | success: function (res) {
74 | // 转发成功
75 | },
76 | fail: function (res) {
77 | // 转发失败
78 | }
79 | }
80 | }
81 | })
--------------------------------------------------------------------------------
/src/pages/luckydraw/map.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 发起新抽奖
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
19 | 取消
20 |
21 |
22 |
--------------------------------------------------------------------------------
/h5/helpcenter/cooperation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 成为赞助商
5 |
6 |
7 |
8 |
34 |
45 |
46 |
47 |
51 |
52 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-searchbar/weui-searchbar.wxss:
--------------------------------------------------------------------------------
1 | .weui-search-bar {
2 | position: relative;
3 | padding: 8px 10px;
4 | display: -webkit-box;
5 | display: -webkit-flex;
6 | display: flex;
7 | box-sizing: border-box;
8 | background-color: #EFEFF4;
9 | border-top: 1rpx solid #D7D6DC;
10 | border-bottom: 1rpx solid #D7D6DC;
11 | }
12 | .weui-icon-search {
13 | margin-right: 8px;
14 | font-size: inherit;
15 | }
16 | .weui-icon-search_in-box {
17 | position: absolute;
18 | left: 10px;
19 | top: 7px;
20 | }
21 | .weui-search-bar__text {
22 | display: inline-block;
23 | font-size: 14px;
24 | vertical-align: middle;
25 | }
26 | .weui-search-bar__form {
27 | position: relative;
28 | -webkit-box-flex: 1;
29 | -webkit-flex: auto;
30 | flex: auto;
31 | border-radius: 5px;
32 | background: #FFFFFF;
33 | border: 1rpx solid #E6E6EA;
34 | }
35 | .weui-search-bar__box {
36 | position: relative;
37 | padding-left: 30px;
38 | padding-right: 30px;
39 | width: 100%;
40 | box-sizing: border-box;
41 | z-index: 1;
42 | }
43 | .weui-search-bar__input {
44 | height: 28px;
45 | line-height: 28px;
46 | font-size: 14px;
47 | }
48 | .weui-icon-clear {
49 | position: absolute;
50 | top: 0;
51 | right: 0;
52 | padding: 7px 8px;
53 | font-size: 0;
54 | }
55 | .weui-search-bar__label {
56 | position: absolute;
57 | top: 0;
58 | right: 0;
59 | bottom: 0;
60 | left: 0;
61 | z-index: 2;
62 | border-radius: 3px;
63 | text-align: center;
64 | color: #9B9B9B;
65 | background: #FFFFFF;
66 | line-height: 28px;
67 | }
68 | .weui-search-bar__cancel-btn {
69 | margin-left: 10px;
70 | line-height: 28px;
71 | color: #09BB07;
72 | white-space: nowrap;
73 | }
74 |
--------------------------------------------------------------------------------
/src/pages/my/userotherinfo.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 部分抽奖可能需要您提供一些其他信息,不填写可能导致无法领奖,请根据抽奖的说明填写添加。
5 |
6 |
7 |
8 |
9 |
10 |
11 | 删除
12 |
13 |
14 |
15 |
16 |
17 | 添加
18 |
19 |
20 |
21 | 保存
22 |
--------------------------------------------------------------------------------
/api/appqrcode.php:
--------------------------------------------------------------------------------
1 | '','1'=>file_get_contents('qr.jpg'));
13 | $ch = curl_init();
14 | curl_setopt($ch, CURLOPT_POST, 1);
15 | curl_setopt($ch, CURLOPT_URL, $url);
16 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
17 | curl_setopt($ch, CURLOPT_HTTPHEADER, array(
18 | 'Content-Type: application/json; charset=utf-8',
19 | 'Content-Length: ' . strlen($data_string))
20 | );
21 | ob_start();
22 | curl_exec($ch);
23 | $return_content = ob_get_contents();
24 | ob_end_clean();
25 |
26 | $return_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
27 | return array($return_code, $return_content);
28 | }
29 |
30 | $page=getGet("page");
31 | $path=getGet("path");
32 | $scene=getGet("scene");
33 | $type=getGet("type");
34 |
35 | $accesstoken=getAccessToken();
36 | if(strtoupper($type)=="A"){
37 | $post_data=array(
38 | "path"=>$path,
39 | );
40 | $qrcode_req=http_post_data("https://api.weixin.qq.com/wxa/getwxacode?access_token=".$accesstoken,json_encode($post_data));
41 | }else{
42 | $post_data=array(
43 | "scene"=>$scene,
44 | "page"=>$page
45 | );
46 | $qrcode_req=http_post_data("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=".$accesstoken,json_encode($post_data));
47 | }
48 | // print_r($qrcode_req);
49 | header("Content-type: image/jpeg");
50 | echo $qrcode_req[1];
51 |
52 | ?>
--------------------------------------------------------------------------------
/api/getluckydrawdetail.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-cell.wxss:
--------------------------------------------------------------------------------
1 | .weui-cells {
2 | position: relative;
3 | margin-top: 1.17647059em;
4 | background-color: #FFFFFF;
5 | line-height: 1.41176471;
6 | font-size: 17px;
7 | }
8 | .weui-cells:before {
9 | content: " ";
10 | position: absolute;
11 | left: 0;
12 | top: 0;
13 | right: 0;
14 | height: 1px;
15 | border-top: 1rpx solid #D9D9D9;
16 | color: #D9D9D9;
17 | }
18 | .weui-cells:after {
19 | content: " ";
20 | position: absolute;
21 | left: 0;
22 | bottom: 0;
23 | right: 0;
24 | height: 1px;
25 | border-bottom: 1rpx solid #D9D9D9;
26 | color: #D9D9D9;
27 | }
28 | .weui-cells__title {
29 | margin-top: .77em;
30 | margin-bottom: .3em;
31 | padding-left: 15px;
32 | padding-right: 15px;
33 | color: #999999;
34 | font-size: 14px;
35 | }
36 | .weui-cells_after-title {
37 | margin-top: 0;
38 | }
39 | .weui-cells__tips {
40 | margin-top: .3em;
41 | color: #999999;
42 | padding-left: 15px;
43 | padding-right: 15px;
44 | font-size: 14px;
45 | }
46 | .weui-cell {
47 | padding: 10px 15px;
48 | position: relative;
49 | display: -webkit-box;
50 | display: -webkit-flex;
51 | display: flex;
52 | -webkit-box-align: center;
53 | -webkit-align-items: center;
54 | align-items: center;
55 | }
56 | .weui-cell:before {
57 | content: " ";
58 | position: absolute;
59 | left: 0;
60 | top: 0;
61 | right: 0;
62 | height: 1px;
63 | border-top: 1rpx solid #D9D9D9;
64 | color: #D9D9D9;
65 | left: 15px;
66 | }
67 | .weui-cell:first-child:before {
68 | display: none;
69 | }
70 | .weui-cell_active {
71 | background-color: #ECECEC;
72 | }
73 | .weui-cell_primary {
74 | -webkit-box-align: start;
75 | -webkit-align-items: flex-start;
76 | align-items: flex-start;
77 | }
78 | .weui-cell__bd {
79 | -webkit-box-flex: 1;
80 | -webkit-flex: 1;
81 | flex: 1;
82 | }
83 | .weui-cell__ft {
84 | text-align: right;
85 | color: #999999;
86 | }
87 |
--------------------------------------------------------------------------------
/api/getluckydrawjoins.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api/login.php:
--------------------------------------------------------------------------------
1 | avatarUrl;
16 | $city=$jsondata->city;
17 | $country=$jsondata->country;
18 | $gender=$jsondata->gender;
19 | $language=$jsondata->language;
20 | $nickname=$jsondata->nickName;
21 | $openid=$jsondata->openid;
22 | $province=$jsondata->province;
23 |
24 | if($jsondata->token!=""&&$jsondata->sessionid!=""&&$openid!=""){
25 | exitJson(0, '已登录',array('token'=>$jsondata->token,'sessionid'=>$jsondata->sessionid)+getUserInfo($openid));
26 | }
27 |
28 |
29 | $db = getDb();
30 |
31 | if($headimg!="" && $openid!="" && $nickname!=""){
32 | $token = getToken();
33 | session_start();
34 | $_SESSION['token'] = $token;
35 | $_SESSION['openid'] = $openid;
36 |
37 | $sql = "select * from ".getTablePrefix()."_members where openid = '$openid' LIMIT 1";
38 | $res=mysql_query($sql,$db) or die(mysql_error());
39 |
40 | $now = time();
41 | if(mysql_num_rows($res)<=0){
42 | $sql = "insert into `".getTablePrefix()."_members` (openid, nickname, headimg, gender, city,province,country,joindate,lastlogin) values('$openid', '$nickname', '$headimg' ,'$gender' ,'$city' ,'$province', '$country','$now','$now')";
43 | mysql_query($sql, $db) or die(mysql_error());
44 |
45 | addCoinHistory(4,10,"初次授权登录奖励");
46 | }else{
47 | $row = mysql_fetch_assoc($res);
48 | if($row['baned']){
49 | exitJson(1, '您已被关小黑屋');
50 | }
51 | $sql = "update `".getTablePrefix()."_members` set nickname='$nickname', headimg='$headimg',lastlogin='$now' where openid='$openid' ";
52 | mysql_query($sql, $db) or die(mysql_error());
53 | }
54 |
55 | exitJson(0, '',array('token'=>$_SESSION['token'],'sessionid'=>session_id())+getUserInfo($openid));
56 | }else{
57 | exitJson(2, '登录失败,请授权获得昵称和头像');
58 | }
59 | ?>
--------------------------------------------------------------------------------
/src/pages/my/myaward.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 收货地址:{{item.expressaddress.provinceName}}{{item.expressaddress.cityName}}{{item.expressaddress.countyName}}{{item.expressaddress.detailInfo}}
13 | 收货人:{{item.expressaddress.userName}}({{item.expressaddress.telNumber}})
14 | 备注:{{item.expressremark}}
15 | 状态:已发货 跟踪物流信息待发货 更改收货地址
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 还没有众奖记录
31 | 积极参加抽奖,下一次一定RP爆发
32 |
33 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-animate/weui-animate.wxss:
--------------------------------------------------------------------------------
1 | @-webkit-keyframes slideUp {
2 | from {
3 | -webkit-transform: translate3d(0, 100%, 0);
4 | transform: translate3d(0, 100%, 0);
5 | }
6 | to {
7 | -webkit-transform: translate3d(0, 0, 0);
8 | transform: translate3d(0, 0, 0);
9 | }
10 | }
11 | @keyframes slideUp {
12 | from {
13 | -webkit-transform: translate3d(0, 100%, 0);
14 | transform: translate3d(0, 100%, 0);
15 | }
16 | to {
17 | -webkit-transform: translate3d(0, 0, 0);
18 | transform: translate3d(0, 0, 0);
19 | }
20 | }
21 | .weui-animate-slide-up {
22 | -webkit-animation: slideUp ease .3s forwards;
23 | animation: slideUp ease .3s forwards;
24 | }
25 | @-webkit-keyframes slideDown {
26 | from {
27 | -webkit-transform: translate3d(0, 0, 0);
28 | transform: translate3d(0, 0, 0);
29 | }
30 | to {
31 | -webkit-transform: translate3d(0, 100%, 0);
32 | transform: translate3d(0, 100%, 0);
33 | }
34 | }
35 | @keyframes slideDown {
36 | from {
37 | -webkit-transform: translate3d(0, 0, 0);
38 | transform: translate3d(0, 0, 0);
39 | }
40 | to {
41 | -webkit-transform: translate3d(0, 100%, 0);
42 | transform: translate3d(0, 100%, 0);
43 | }
44 | }
45 | .weui-animate-slide-down {
46 | -webkit-animation: slideDown ease .3s forwards;
47 | animation: slideDown ease .3s forwards;
48 | }
49 | @-webkit-keyframes fadeIn {
50 | from {
51 | opacity: 0;
52 | }
53 | to {
54 | opacity: 1;
55 | }
56 | }
57 | @keyframes fadeIn {
58 | from {
59 | opacity: 0;
60 | }
61 | to {
62 | opacity: 1;
63 | }
64 | }
65 | .weui-animate-fade-in {
66 | -webkit-animation: fadeIn ease .3s forwards;
67 | animation: fadeIn ease .3s forwards;
68 | }
69 | @-webkit-keyframes fadeOut {
70 | from {
71 | opacity: 1;
72 | }
73 | to {
74 | opacity: 0;
75 | }
76 | }
77 | @keyframes fadeOut {
78 | from {
79 | opacity: 1;
80 | }
81 | to {
82 | opacity: 0;
83 | }
84 | }
85 | .weui-animate-fade-out {
86 | -webkit-animation: fadeOut ease .3s forwards;
87 | animation: fadeOut ease .3s forwards;
88 | }
89 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-media-box/weui-media-box.wxss:
--------------------------------------------------------------------------------
1 | .weui-media-box {
2 | padding: 15px;
3 | position: relative;
4 | }
5 | .weui-media-box:before {
6 | content: " ";
7 | position: absolute;
8 | left: 0;
9 | top: 0;
10 | right: 0;
11 | height: 1px;
12 | border-top: 1rpx solid #E5E5E5;
13 | color: #E5E5E5;
14 | left: 15px;
15 | }
16 | .weui-media-box:first-child:before {
17 | display: none;
18 | }
19 | .weui-media-box__title {
20 | font-weight: 400;
21 | font-size: 17px;
22 | width: auto;
23 | overflow: hidden;
24 | text-overflow: ellipsis;
25 | white-space: nowrap;
26 | word-wrap: normal;
27 | word-wrap: break-word;
28 | word-break: break-all;
29 | }
30 | .weui-media-box__desc {
31 | color: #999999;
32 | font-size: 13px;
33 | line-height: 1.2;
34 | overflow: hidden;
35 | text-overflow: ellipsis;
36 | display: -webkit-box;
37 | -webkit-box-orient: vertical;
38 | -webkit-line-clamp: 2;
39 | }
40 | .weui-media-box__info {
41 | margin-top: 15px;
42 | padding-bottom: 5px;
43 | font-size: 13px;
44 | color: #CECECE;
45 | line-height: 1em;
46 | list-style: none;
47 | overflow: hidden;
48 | }
49 | .weui-media-box__info__meta {
50 | float: left;
51 | padding-right: 1em;
52 | }
53 | .weui-media-box__info__meta_extra {
54 | padding-left: 1em;
55 | border-left: 1px solid #CECECE;
56 | }
57 | .weui-media-box__title_in-text {
58 | margin-bottom: 8px;
59 | }
60 | .weui-media-box_appmsg {
61 | display: -webkit-box;
62 | display: -webkit-flex;
63 | display: flex;
64 | -webkit-box-align: center;
65 | -webkit-align-items: center;
66 | align-items: center;
67 | }
68 | .weui-media-box__thumb {
69 | width: 100%;
70 | height: 100%;
71 | vertical-align: top;
72 | }
73 | .weui-media-box__hd_in-appmsg {
74 | margin-right: .8em;
75 | width: 60px;
76 | height: 60px;
77 | line-height: 60px;
78 | text-align: center;
79 | }
80 | .weui-media-box__bd_in-appmsg {
81 | -webkit-box-flex: 1;
82 | -webkit-flex: 1;
83 | flex: 1;
84 | min-width: 0;
85 | }
86 | .weui-media-box_small-appmsg {
87 | padding: 0;
88 | }
89 | .weui-cells_in-small-appmsg {
90 | margin-top: 0;
91 | }
92 | .weui-cells_in-small-appmsg:before {
93 | display: none;
94 | }
95 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-uploader.wxss:
--------------------------------------------------------------------------------
1 | .weui-uploader__hd {
2 | display: -webkit-box;
3 | display: -webkit-flex;
4 | display: flex;
5 | padding-bottom: 10px;
6 | -webkit-box-align: center;
7 | -webkit-align-items: center;
8 | align-items: center;
9 | }
10 | .weui-uploader__title {
11 | -webkit-box-flex: 1;
12 | -webkit-flex: 1;
13 | flex: 1;
14 | }
15 | .weui-uploader__info {
16 | color: #B2B2B2;
17 | }
18 | .weui-uploader__bd {
19 | margin-bottom: -4px;
20 | margin-right: -9px;
21 | overflow: hidden;
22 | }
23 | .weui-uploader__file {
24 | float: left;
25 | margin-right: 9px;
26 | margin-bottom: 9px;
27 | }
28 | .weui-uploader__img {
29 | display: block;
30 | width: 79px;
31 | height: 79px;
32 | }
33 | .weui-uploader__file_status {
34 | position: relative;
35 | }
36 | .weui-uploader__file_status:before {
37 | content: " ";
38 | position: absolute;
39 | top: 0;
40 | right: 0;
41 | bottom: 0;
42 | left: 0;
43 | background-color: rgba(0, 0, 0, 0.5);
44 | }
45 | .weui-uploader__file-content {
46 | position: absolute;
47 | top: 50%;
48 | left: 50%;
49 | -webkit-transform: translate(-50%, -50%);
50 | transform: translate(-50%, -50%);
51 | color: #FFFFFF;
52 | }
53 | .weui-uploader__input-box {
54 | float: left;
55 | position: relative;
56 | margin-right: 9px;
57 | margin-bottom: 9px;
58 | width: 77px;
59 | height: 77px;
60 | border: 1px solid #D9D9D9;
61 | }
62 | .weui-uploader__input-box:before,
63 | .weui-uploader__input-box:after {
64 | content: " ";
65 | position: absolute;
66 | top: 50%;
67 | left: 50%;
68 | -webkit-transform: translate(-50%, -50%);
69 | transform: translate(-50%, -50%);
70 | background-color: #D9D9D9;
71 | }
72 | .weui-uploader__input-box:before {
73 | width: 2px;
74 | height: 39.5px;
75 | }
76 | .weui-uploader__input-box:after {
77 | width: 39.5px;
78 | height: 2px;
79 | }
80 | .weui-uploader__input-box:active {
81 | border-color: #999999;
82 | }
83 | .weui-uploader__input-box:active:before,
84 | .weui-uploader__input-box:active:after {
85 | background-color: #999999;
86 | }
87 | .weui-uploader__input {
88 | position: absolute;
89 | z-index: 1;
90 | top: 0;
91 | left: 0;
92 | width: 100%;
93 | height: 100%;
94 | opacity: 0;
95 | }
96 |
--------------------------------------------------------------------------------
/api/joinluckydraw.php:
--------------------------------------------------------------------------------
1 | id;
11 |
12 | session_start();
13 | $openid=$_SESSION['openid'];
14 | if(!$openid){
15 | exitJson(1,'非法请求,请重新登录');
16 | }
17 |
18 | if(userIsBaned($openid)){
19 | exitJson(2,'因用户举报,您已被禁止参与和发起抽奖!');
20 | }
21 |
22 | $db = getDb();
23 |
24 | $sql = "select * from ".getTablePrefix()."_luckydraws where id = '$id' LIMIT 1";
25 | $res=mysql_query($sql,$db) or die(mysql_error());
26 | $row = mysql_fetch_assoc($res);
27 | $luckydrawInfo=parseLuckyDraw($row);
28 |
29 |
30 |
31 | $now=time();
32 |
33 | if($now>$luckydrawInfo['opendate']){
34 | exitJson(1,"参与失败,抽奖活动已过期");
35 | }else if($now<$luckydrawInfo['startdate']){
36 | exitJson(4,"抽奖活动尚未开始");
37 | }else if($luckydrawInfo['isopened']==1){
38 | exitJson(2,"已开奖");
39 | }else if(getIsJoined($id,$openid)){
40 | exitJson(3,"您已经参与过了");
41 | }
42 |
43 | $userInfo=getUserSimpleInfo($openid);
44 | $nickname=$userInfo['nickname'];
45 |
46 | if(addCoinHistory(2,-1,"参与抽奖")){
47 |
48 | $sql = "insert into `".getTablePrefix()."_joins` (luckydrawid,ownerid,ownernickname,createdate) values('$id','$openid','$nickname','$now')";
49 | $res=mysql_query($sql, $db) or die(mysql_error());
50 |
51 | $inviterid=$jsondata->inviterid;
52 | if($inviterid && $luckydrawInfo['advshare']==1){
53 | $inviter=getUserOpenIdById($inviterid);
54 |
55 | $inviterOpenId=$inviter['openid'];
56 | if($inviterOpenId!=$openid){
57 | $inviterNickname=$inviter['nickname'];
58 |
59 | $sql = "insert into `".getTablePrefix()."_joins` (luckydrawid,ownerid,ownernickname,createdate,msg) values('$id','$inviterOpenId','$inviterNickname','".($now+1)."','分享+1')";
60 | $res=mysql_query($sql, $db) or die(mysql_error());
61 | }
62 | }
63 |
64 | $totalusers=getTotalJoinNumber($id);
65 | if($luckydrawInfo['opentype']==1 && intval($totalusers)>=intval($luckydrawInfo['openneedusers'])){
66 | if(openAward($id)){
67 | exitJson(0,"开奖啦");
68 | };
69 | }
70 |
71 | exitJson(0,"已参加");
72 | }else{
73 | exitJson(1,"RP币余额不足");
74 | }
75 |
76 |
77 | ?>
--------------------------------------------------------------------------------
/api/homeindex.php:
--------------------------------------------------------------------------------
1 | ='".($now-86400)."' and isdelete=0 order by opendate desc";
11 | $res=mysql_query($sql,$db) or die(mysql_error());
12 |
13 | $recommendlist = array();
14 | while ($row = mysql_fetch_assoc($res)) {
15 | $recommendlist[]=parseLuckyDraw($row);
16 | }
17 |
18 | //即将开奖
19 | $sql = "select * from ".getTablePrefix()."_luckydraws where isrecommend = 0 and homeindex=1 and opendate>='".($now-86400)."' and isdelete=0 order by createdate desc LIMIT 6";
20 | $res=mysql_query($sql,$db) or die(mysql_error());
21 |
22 | $soonlist = array();
23 | while ($row = mysql_fetch_assoc($res)) {
24 | $soonlist[]=parseLuckyDraw($row);
25 | }
26 |
27 | //方块菜单
28 | $squaremenus=array();
29 |
30 | $squaremenus[]=array("name"=>"","url"=>"xcxid://wxd35321d304ffabfc","backgroundImage"=>"http://jnsii.com/zj/images/wanwubanner.jpg");
31 | $squaremenus[]=array("name"=>"领取RP币","url"=>"/pages/my/wallet","background"=>"#e6c033");
32 | $squaremenus[]=array("name"=>"中奖历史","url"=>"/pages/webview/index?url=https://jnsii.com/zj/h5/rank/","background"=>"#0099ee");
33 | $squaremenus[]=array("name"=>"常见问题","url"=>"/pages/webview/index?url=https://jnsii.com/zj/helpcenter/qna.html","background"=>"#44615e");
34 | $squaremenus[]=array("name"=>"附近抽奖","url"=>"/pages/luckydraw/map","background"=>"#FF5500");
35 | $squaremenus[]=array("name"=>"全部抽奖","url"=>"/pages/luckydraw/list","background"=>"#33cc33");
36 | // $squaremenus[]=array("name"=>"小程序跳转","url"=>"xcxid://wxa1d88bc6efa45d7b","backgroundImage"=>"http://jnsii.com/zj/images/defaultawardimage.jpg");
37 |
38 | //超级广告位
39 | $superbanner;//=array("image"=>"http://jnsii.com/zj/images/longxiabanner.jpg","url"=>"/pages/luckydraw/detail?id=160");
40 |
41 | $shareapptext=["你用用看这个小程序,一分钱不花,试试运气呗!",
42 | "你今天红光满面,八成有好事找上门!",
43 | "平时攒够了人品,来试试运气好不好!",
44 | "古话说,多分享多参与,好运自然来~",
45 | "你长得这么好看,我猜运气一定好!",
46 | "爱笑的女孩儿,运气不会差哦~"];
47 |
48 | $shareimagetext=["送你一个免费抽奖的机会,看咱谁运气好~",
49 | "人长得好看,运气一般不会差~",
50 | "你是我最好的朋友,这种好事我只告诉你!"];
51 | $shareimageslogan="免费抽奖,信不信由你";
52 |
53 |
54 | exitJson(0,"",array("totalawards"=>getTotalAwards(),"shareimageslogan"=>$shareimageslogan,"shareimagetext"=>$shareimagetext,"shareapptext"=>$shareapptext,"superbanner"=>$superbanner,"squaremenus"=>$squaremenus,"recommends"=>$recommendlist,"opensoons"=>$soonlist));
55 |
56 | ?>
--------------------------------------------------------------------------------
/api/listluckydraw.php:
--------------------------------------------------------------------------------
1 | ='$now' and isopened=0 and isdelete=0 and advispublic=1 order by opendate asc LIMIT ".$limit*$page.",$limit";
46 | }else if($type==4){//已过期
47 | $sql = "select * from ".getTablePrefix()."_luckydraws where opendate<'$now' or isopened=1 and isdelete=0 and advispublic=1 order by opendate desc LIMIT ".$limit*$page.",$limit";
48 | }else if($type=="city"){//按城市名取
49 | $city=getGet('city');
50 | $sql = "select * from ".getTablePrefix()."_luckydraws where advgpscity = '$city' and opendate>='$now' and isopened=0 and isdelete=0 and advispublic=1 order by opendate desc";
51 | }
52 |
53 | $res=mysql_query($sql,$db) or die(mysql_error());
54 |
55 | $list = array();
56 | while ($row = mysql_fetch_assoc($res)) {
57 | if($type==2){
58 | $list[]=getLuckyDrawById($row['luckydrawid']);
59 | }else if($type==22){
60 | $row['luckydrawInfo']=getLuckyDrawById($row['luckydrawid']);
61 | $row['expressaddress']=json_decode($row['expressaddress']);
62 | $list[]=$row;
63 | }else{
64 | $list[]=parseLuckyDraw($row);
65 | }
66 | }
67 |
68 | exitJson(0,"",$list);
69 |
70 | ?>
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c)
2 |
3 | Anti 996 License Version 1.0 (Draft)
4 |
5 | Permission is hereby granted to any individual or legal entity
6 | obtaining a copy of this licensed work (including the source code,
7 | documentation and/or related items, hereinafter collectively referred
8 | to as the "licensed work"), free of charge, to deal with the licensed
9 | work for any purpose, including without limitation, the rights to use,
10 | reproduce, modify, prepare derivative works of, distribute, publish
11 | and sublicense the licensed work, subject to the following conditions:
12 |
13 | 1. The individual or the legal entity must conspicuously display,
14 | without modification, this License and the notice on each redistributed
15 | or derivative copy of the Licensed Work.
16 |
17 | 2. The individual or the legal entity must strictly comply with all
18 | applicable laws, regulations, rules and standards of the jurisdiction
19 | relating to labor and employment where the individual is physically
20 | located or where the individual was born or naturalized; or where the
21 | legal entity is registered or is operating (whichever is stricter). In
22 | case that the jurisdiction has no such laws, regulations, rules and
23 | standards or its laws, regulations, rules and standards are
24 | unenforceable, the individual or the legal entity are required to
25 | comply with Core International Labor Standards.
26 |
27 | 3. The individual or the legal entity shall not induce or force its
28 | employee(s), whether full-time or part-time, or its independent
29 | contractor(s), in any methods, to agree in oral or written form, to
30 | directly or indirectly restrict, weaken or relinquish his or her
31 | rights or remedies under such laws, regulations, rules and standards
32 | relating to labor and employment as mentioned above, no matter whether
33 | such written or oral agreement are enforceable under the laws of the
34 | said jurisdiction, nor shall such individual or the legal entity
35 | limit, in any methods, the rights of its employee(s) or independent
36 | contractor(s) from reporting or complaining to the copyright holder or
37 | relevant authorities monitoring the compliance of the license about
38 | its violation(s) of the said license.
39 |
40 | THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
41 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
42 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
43 | IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
44 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
45 | OTHERWISE, ARISING FROM, OUT OF OR IN ANY WAY CONNECTION WITH THE
46 | LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK.
--------------------------------------------------------------------------------
/src/pages/my/myjoin.js:
--------------------------------------------------------------------------------
1 | // pages/my/mypost.js
2 | const app=getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | list:[],
11 | page:0,
12 | canloadmore:false
13 | },
14 | btnLoadMore: function () {
15 | if (this.data.canloadmore) {
16 | this.data.page += 1;
17 | this.updateList(this.data.page);
18 | }
19 | },
20 | btnGoDetail:function(e){
21 | wx.navigateTo({
22 | url: '/pages/luckydraw/detail?id='+e.currentTarget.dataset.id,
23 | })
24 | },
25 | updateList: function (page=0) {
26 | var that = this;
27 | wx.request({
28 | url: app.ServerUrl() + '/api/listluckydraw.php',
29 | method: 'GET',
30 | header: {
31 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
32 | },
33 | data:{
34 | type:2,
35 | page:page,
36 | limit:10
37 | },
38 | success: function (res) {
39 | if(parseInt(res.data.err)==0){
40 | var newlist = res.data.result;
41 |
42 | for (var i = 0; i < newlist.length; i++) {
43 | var item = newlist[i];
44 | if (item["awardimage"] != "") {
45 | item["awardimage"] = app.CDNUrl() + "/upload/" + item["awardimage"];
46 | } else {
47 | item["awardimage"] = "../../images/defaultawardimage.jpg";
48 | }
49 | item["opendatestr"] = util.formatDate(new Date(item["opendate"] * 1000), "MM月dd日 hh:mm");
50 | item["opentypestr"] = ["自动开奖", "参与者达到 " + item['openneedusers'] + " 人时自动开奖", "发起人手动开奖"][item['opentype']];
51 | }
52 |
53 | var list = [];
54 | if (page <= 0) {
55 | list = newlist;
56 | } else {
57 | list = that.data.list.concat(newlist);
58 | }
59 |
60 | that.setData({
61 | list: list,
62 | page:page,
63 | canloadmore: newlist.length >= 10
64 | });
65 | }
66 | }
67 | });
68 | },
69 | /**
70 | * 生命周期函数--监听页面加载
71 | */
72 | onLoad: function (options) {
73 | this.updateList();
74 | },
75 |
76 | /**
77 | * 生命周期函数--监听页面初次渲染完成
78 | */
79 | onReady: function () {
80 |
81 | },
82 |
83 | /**
84 | * 生命周期函数--监听页面显示
85 | */
86 | onShow: function () {
87 |
88 | },
89 |
90 | /**
91 | * 生命周期函数--监听页面隐藏
92 | */
93 | onHide: function () {
94 |
95 | },
96 |
97 | /**
98 | * 生命周期函数--监听页面卸载
99 | */
100 | onUnload: function () {
101 |
102 | },
103 |
104 | /**
105 | * 页面相关事件处理函数--监听用户下拉动作
106 | */
107 | onPullDownRefresh: function () {
108 |
109 | },
110 |
111 | /**
112 | * 页面上拉触底事件的处理函数
113 | */
114 | onReachBottom: function () {
115 |
116 | },
117 |
118 | /**
119 | * 用户点击右上角分享
120 | */
121 | onShareAppMessage: function () {
122 | return app.getMainAppShare();
123 | }
124 | })
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-form/weui-form-preview.wxss:
--------------------------------------------------------------------------------
1 | .weui-form-preview {
2 | position: relative;
3 | background-color: #FFFFFF;
4 | }
5 | .weui-form-preview:before {
6 | content: " ";
7 | position: absolute;
8 | left: 0;
9 | top: 0;
10 | right: 0;
11 | height: 1px;
12 | border-top: 1rpx solid #D9D9D9;
13 | color: #D9D9D9;
14 | }
15 | .weui-form-preview:after {
16 | content: " ";
17 | position: absolute;
18 | left: 0;
19 | bottom: 0;
20 | right: 0;
21 | height: 1px;
22 | border-bottom: 1rpx solid #D9D9D9;
23 | color: #D9D9D9;
24 | }
25 | .weui-form-preview__value {
26 | font-size: 14px;
27 | }
28 | .weui-form-preview__value_in-hd {
29 | font-size: 26px;
30 | }
31 | .weui-form-preview__hd {
32 | position: relative;
33 | padding: 10px 15px;
34 | text-align: right;
35 | line-height: 2.5em;
36 | }
37 | .weui-form-preview__hd:after {
38 | content: " ";
39 | position: absolute;
40 | left: 0;
41 | bottom: 0;
42 | right: 0;
43 | height: 1px;
44 | border-bottom: 1rpx solid #D9D9D9;
45 | color: #D9D9D9;
46 | left: 15px;
47 | }
48 | .weui-form-preview__bd {
49 | padding: 10px 15px;
50 | font-size: .9em;
51 | text-align: right;
52 | color: #999999;
53 | line-height: 2;
54 | }
55 | .weui-form-preview__ft {
56 | position: relative;
57 | line-height: 50px;
58 | display: -webkit-box;
59 | display: -webkit-flex;
60 | display: flex;
61 | }
62 | .weui-form-preview__ft:after {
63 | content: " ";
64 | position: absolute;
65 | left: 0;
66 | top: 0;
67 | right: 0;
68 | height: 1px;
69 | border-top: 1rpx solid #D5D5D6;
70 | color: #D5D5D6;
71 | }
72 | .weui-form-preview__item {
73 | overflow: hidden;
74 | }
75 | .weui-form-preview__label {
76 | float: left;
77 | margin-right: 1em;
78 | min-width: 4em;
79 | color: #999999;
80 | text-align: justify;
81 | text-align-last: justify;
82 | }
83 | .weui-form-preview__value {
84 | display: block;
85 | overflow: hidden;
86 | word-break: normal;
87 | word-wrap: break-word;
88 | }
89 | .weui-form-preview__btn {
90 | position: relative;
91 | display: block;
92 | -webkit-box-flex: 1;
93 | -webkit-flex: 1;
94 | flex: 1;
95 | color: #3CC51F;
96 | text-align: center;
97 | }
98 | .weui-form-preview__btn:after {
99 | content: " ";
100 | position: absolute;
101 | left: 0;
102 | top: 0;
103 | width: 1px;
104 | bottom: 0;
105 | border-left: 1rpx solid #D5D5D6;
106 | color: #D5D5D6;
107 | }
108 | .weui-form-preview__btn:first-child:after {
109 | display: none;
110 | }
111 | .weui-form-preview__btn_active {
112 | background-color: #EEEEEE;
113 | }
114 | .weui-form-preview__btn_default {
115 | color: #999999;
116 | }
117 | .weui-form-preview__btn_primary {
118 | color: #0BB20C;
119 | }
120 |
--------------------------------------------------------------------------------
/src/pages/my/userotherinfo.js:
--------------------------------------------------------------------------------
1 | // pages/my/userotherinfo.js
2 | const app=getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | optiondetail: [],
11 | tempKey:"",
12 | tempValue:"",
13 | },
14 | keyInput:function(e){
15 | this.setData({
16 | tempKey: e.detail.value.toUpperCase()
17 | });
18 | },
19 | valueInput: function (e) {
20 | this.setData({
21 | tempValue: e.detail.value
22 | });
23 | },
24 | btnSave:function(){
25 | var that = this;
26 |
27 | this.btnAddOption();
28 |
29 | wx.request({
30 | url: app.ServerUrl() + '/api/updateotiondetail.php',
31 | method: 'POST',
32 | header: {
33 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
34 | },
35 | data: that.data.optiondetail,
36 | success: function (res) {
37 | if (parseInt(res.data.err) == 0) {
38 | app.globalData.userInfo.optiondetail = that.data.optiondetail;
39 | wx.navigateBack({
40 |
41 | })
42 | } else {
43 | wx.showModal({
44 | title: '',
45 | content: res.data.msg
46 | })
47 | }
48 | }
49 | })
50 | },
51 | btnRemove:function(e){
52 | var that=this;
53 | var index = e.currentTarget.id;
54 |
55 | that.data.optiondetail.splice(index, 1);
56 |
57 | that.setData({
58 | optiondetail: that.data.optiondetail
59 | });
60 | },
61 | btnAddOption:function(e){
62 | if (util.trimStr(this.data.tempKey) != "" && util.trimStr(this.data.tempValue) != ""){
63 | this.data.optiondetail.push({ key: util.trimStr(this.data.tempKey).toUpperCase(), value: util.trimStr(this.data.tempValue)});
64 | this.setData({
65 | optiondetail: this.data.optiondetail,
66 | tempKey:"",
67 | tempValue:""
68 | });
69 |
70 | }
71 | },
72 | /**
73 | * 生命周期函数--监听页面加载
74 | */
75 | onLoad: function (options) {
76 | this.setData({
77 | optiondetail: app.globalData.userInfo.optiondetail ? app.globalData.userInfo.optiondetail:[]
78 | });
79 | },
80 |
81 | /**
82 | * 生命周期函数--监听页面初次渲染完成
83 | */
84 | onReady: function () {
85 |
86 | },
87 |
88 | /**
89 | * 生命周期函数--监听页面显示
90 | */
91 | onShow: function () {
92 |
93 | },
94 |
95 | /**
96 | * 生命周期函数--监听页面隐藏
97 | */
98 | onHide: function () {
99 |
100 | },
101 |
102 | /**
103 | * 生命周期函数--监听页面卸载
104 | */
105 | onUnload: function () {
106 |
107 | },
108 |
109 | /**
110 | * 页面相关事件处理函数--监听用户下拉动作
111 | */
112 | onPullDownRefresh: function () {
113 |
114 | },
115 |
116 | /**
117 | * 页面上拉触底事件的处理函数
118 | */
119 | onReachBottom: function () {
120 |
121 | },
122 |
123 | /**
124 | * 用户点击右上角分享
125 | */
126 | onShareAppMessage: function () {
127 | return app.getMainAppShare();
128 | }
129 | })
--------------------------------------------------------------------------------
/src/pages/luckydraw/alljoiner.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 | 取消
18 |
19 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | {{item.userInfo.nickname}}
33 | {{item.msg}}
34 |
35 |
36 | 恭喜中奖
37 | {{item.createdate}}
38 |
39 |
40 |
41 |
42 |
43 |
44 | 点击加载更多
45 |
46 |
--------------------------------------------------------------------------------
/src/pages/my/wallet.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | RP币余额:{{result.totalcoin}}
6 |
7 |
13 | 点击即可领取
14 |
15 | 下次领取还需等待
16 | {{distancetimestr}}
17 |
18 |
19 |
20 |
21 |
22 |
23 | RP币主要用于检验用户活跃,拒绝羊毛党,保证抽奖的公平公正。
24 |
25 |
26 | 生产机制: 每个用户的RP币钱包每1小时会产生1枚RP币,如不领取,也不会累积。
27 |
28 |
29 |
30 | 消耗机制: 用户在参与抽奖时将消耗1枚RP币,RP币为0时无法参与抽奖。
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | {{item.msg}}
42 | {{item.createdate}}
43 |
44 |
45 | {{item.value>0?"+":""}}{{item.value}}
46 |
47 |
48 |
49 |
50 |
51 | 点击加载更多
52 |
53 |
54 |
55 |
56 |
57 | 点击登录领取RP币
58 |
59 |
--------------------------------------------------------------------------------
/api/uploadpic.php:
--------------------------------------------------------------------------------
1 | ($target_w / $target_h));
41 | $resize_w = $judge ? ($source_w * $target_h) / $source_h : $target_w;
42 | $resize_h = !$judge ? ($source_h * $target_w) / $source_w : $target_h;
43 | $start_x = $judge ? ($resize_w - $target_w) / 2 : 0;
44 | $start_y = !$judge ? ($resize_h - $target_h) / 2 : 0;
45 | /* 绘制居中缩放图像 */
46 | $resize_img = imagecreatetruecolor($resize_w, $resize_h);
47 | imagecopyresampled($resize_img, $image, 0, 0, 0, 0, $resize_w, $resize_h, $source_w, $source_h);
48 | $target_img = imagecreatetruecolor($target_w, $target_h);
49 | imagecopy($target_img, $resize_img, 0, 0, $start_x, $start_y, $resize_w, $resize_h);
50 | /* 将图片保存至文件 */
51 | if (!file_exists(dirname($target))) mkdir(dirname($target), 0777, true);
52 | switch (exif_imagetype($source)) {
53 | case IMAGETYPE_JPEG:
54 | imagejpeg($target_img, $target);
55 | break;
56 | case IMAGETYPE_PNG:
57 | imagepng($target_img, $target);
58 | break;
59 | case IMAGETYPE_GIF:
60 | imagegif($target_img, $target);
61 | break;
62 | }
63 | return boolval(file_exists($target));
64 | }
65 |
66 | session_start();
67 | if($_SESSION['token']!=$token){
68 | exitJson(2,'非法请求,请重新登录');
69 | }
70 |
71 | $now=time();
72 | $dirPath="../upload/".date('Y', $now)."/".date('m-d', $now);
73 |
74 | $fileName=getMillisecond();
75 | $filePath=$dirPath."/".$fileName.".jpg";
76 |
77 | if (!is_dir($dirPath)){
78 | $res=mkdir(iconv("UTF-8", "GBK", $dirPath),0777,true);
79 | }
80 |
81 | if(move_uploaded_file($_FILES["picture"]["tmp_name"],$filePath)){
82 | if($a!=""){
83 | image_center_crop($filePath, '980', '600',$filePath);
84 | }
85 | exitJson(0,"",array("filename"=>$fileName));
86 | }else{
87 | exitJson(1,'上传失败');
88 | }
89 |
90 |
91 | ?>
--------------------------------------------------------------------------------
/src/pages/my/index.js:
--------------------------------------------------------------------------------
1 | // pages/my/index.js
2 | const app = getApp();
3 |
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | userInfo: null,
11 | shortVersion:app.ShortVersion()
12 | },
13 | btnSettings:function(){
14 | wx.openSetting({
15 | success: function (res) {
16 | console.log(res);
17 | }
18 | });
19 | },
20 | btnOtherInfo:function(e){
21 | wx.navigateTo({
22 | url: '/pages/my/userotherinfo',
23 | })
24 | },
25 | goCreate: function (e) {
26 | wx.navigateTo({
27 | url: '/pages/create/create',
28 | })
29 | },
30 | changeTabIndex: function (e) {
31 | app.setTabIndex(e.currentTarget.dataset.index);
32 | },
33 | /**
34 | * 生命周期函数--监听页面加载
35 | */
36 | bindGetUserInfo:function(e){
37 | var that=this;
38 | wx.getUserInfo({
39 | success: function (res) {
40 | app.login(function () {
41 | that.setData({ userInfo: app.globalData.userInfo });
42 | });
43 | }
44 | })
45 | },
46 | btnDonate:function(){
47 | wx.navigateTo({
48 | url: '/pages/my/donate',
49 | })
50 | },
51 | btnMyWallet:function(){
52 | wx.navigateTo({
53 | url: '/pages/my/wallet',
54 | })
55 | },
56 | btnMyJoin:function(){
57 | wx.navigateTo({
58 | url: '/pages/my/myjoin',
59 | })
60 | },
61 | btnMyAward:function(){
62 | wx.navigateTo({
63 | url: '/pages/my/myaward',
64 | })
65 | },
66 | btnMyPost:function(){
67 | wx.navigateTo({
68 | url: '/pages/my/mypost',
69 | })
70 | },
71 | btnQNA:function(){
72 | wx.navigateTo({
73 | url: '/pages/webview/index?url='+"https://jnsii.com/zj/helpcenter/qna.html",
74 | })
75 | },
76 | btnCooperation: function () {
77 | wx.navigateTo({
78 | url: '/pages/webview/index?url=' + "https://jnsii.com/zj/helpcenter/cooperation.html",
79 | })
80 | },
81 | onLoad: function (options) {
82 |
83 | },
84 |
85 | /**
86 | * 生命周期函数--监听页面初次渲染完成
87 | */
88 | onReady: function () {
89 |
90 | },
91 |
92 | /**
93 | * 生命周期函数--监听页面显示
94 | */
95 | onShow: function () {
96 | var that = this;
97 |
98 | if (app.globalData.userInfo == null) {
99 | wx.getSetting({
100 | success: function (res) {
101 | if (res.authSetting['scope.userInfo']) {
102 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
103 | wx.getUserInfo({
104 | success: function (res) {
105 | app.login(function () {
106 | that.setData({ userInfo: app.globalData.userInfo });
107 | });
108 | }
109 | })
110 | }
111 | }
112 | })
113 | } else {
114 | that.setData({ userInfo: app.globalData.userInfo });
115 | console.log(app.globalData.userInfo);
116 | }
117 | },
118 |
119 | /**
120 | * 生命周期函数--监听页面隐藏
121 | */
122 | onHide: function () {
123 |
124 | },
125 |
126 | /**
127 | * 生命周期函数--监听页面卸载
128 | */
129 | onUnload: function () {
130 |
131 | },
132 |
133 | /**
134 | * 页面相关事件处理函数--监听用户下拉动作
135 | */
136 | onPullDownRefresh: function () {
137 |
138 | },
139 |
140 | /**
141 | * 页面上拉触底事件的处理函数
142 | */
143 | onReachBottom: function () {
144 |
145 | },
146 |
147 | /**
148 | * 用户点击右上角分享
149 | */
150 | onShareAppMessage: function () {
151 | return app.getMainAppShare();
152 | }
153 | })
--------------------------------------------------------------------------------
/h5/express/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 物流信息
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
查询此运单状态
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/pages/luckydraw/alljoiner.js:
--------------------------------------------------------------------------------
1 | // pages/luckydraw/alljoiner.js
2 | const app = getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | list: [],
11 | page: 0,
12 | canloadmore: false,
13 | inputShowed: false,
14 | inputVal: "",
15 | searchResult: [],
16 | type:0
17 | },
18 | showMsgTips:function(e){
19 | wx.showModal({
20 | title: '',
21 | content: e.currentTarget.dataset.msgtips,
22 | showCancel:false
23 | })
24 | },
25 | btnLoadMore: function () {
26 | if (this.data.canloadmore) {
27 | this.data.page += 1;
28 | this.updateJoins(this.data.page);
29 | }
30 | },
31 | btnChangeTab:function(e){
32 | this.setData({
33 | type:e.currentTarget.dataset.type
34 | });
35 | this.updateJoins();
36 | },
37 | showInput: function () {
38 | this.setData({
39 | inputShowed: true
40 | });
41 | },
42 | hideInput: function () {
43 | this.setData({
44 | inputVal: "",
45 | inputShowed: false
46 | });
47 | this.updateJoins(0,this.data.inputVal);
48 | },
49 | clearInput: function () {
50 | this.setData({
51 | inputVal: ""
52 | });
53 | this.updateJoins(0,this.data.inputVal);
54 | },
55 | inputTyping: function (e) {
56 | if (util.trimStr(e.detail.value) != "") {
57 | this.setData({
58 | inputVal: util.trimStr(e.detail.value)
59 | });
60 | this.updateJoins(0,util.trimStr(e.detail.value));
61 | } else {
62 | this.clearInput();
63 | }
64 | },
65 | updateJoins:function(page=0,kw=""){
66 | var that = this;
67 | wx.request({
68 | url: app.ServerUrl() + '/api/getluckydrawjoins.php',
69 | method: 'GET',
70 | header: {
71 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
72 | },
73 | data:{
74 | id: that.data.id,
75 | keyword: that.data.inputVal,
76 | type:that.data.type,
77 | page:page
78 | },
79 | success: function (res) {
80 | if (parseInt(res.data.err) == 0) {
81 | var newlist = res.data.result;
82 |
83 | var list = [];
84 | if (page <= 0) {
85 | list = newlist;
86 | } else {
87 | list = that.data.list.concat(newlist);
88 | }
89 |
90 | that.setData({
91 | list: list,
92 | page: page,
93 | canloadmore: newlist.length >= 10
94 | });
95 | }
96 | }
97 | });
98 | },
99 | /**
100 | * 生命周期函数--监听页面加载
101 | */
102 | onLoad: function (options) {
103 | this.setData({
104 | id:options.id,
105 | type: options.type ? options.type:0
106 | });
107 | this.updateJoins();
108 | },
109 |
110 | /**
111 | * 生命周期函数--监听页面初次渲染完成
112 | */
113 | onReady: function () {
114 |
115 | },
116 |
117 | /**
118 | * 生命周期函数--监听页面显示
119 | */
120 | onShow: function () {
121 |
122 | },
123 |
124 | /**
125 | * 生命周期函数--监听页面隐藏
126 | */
127 | onHide: function () {
128 |
129 | },
130 |
131 | /**
132 | * 生命周期函数--监听页面卸载
133 | */
134 | onUnload: function () {
135 |
136 | },
137 |
138 | /**
139 | * 页面相关事件处理函数--监听用户下拉动作
140 | */
141 | onPullDownRefresh: function () {
142 |
143 | },
144 |
145 | /**
146 | * 页面上拉触底事件的处理函数
147 | */
148 | onReachBottom: function () {
149 |
150 | },
151 |
152 | /**
153 | * 用户点击右上角分享
154 | */
155 | onShareAppMessage: function () {
156 | return app.getMainAppShare();
157 | }
158 | })
--------------------------------------------------------------------------------
/src/pages/luckydraw/list.js:
--------------------------------------------------------------------------------
1 | // pages/luckydraw/list.js
2 | var app = getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | orderTypeStr:["即将开奖","过期的抽奖"],
11 | list: [],
12 | canloadmore: false,
13 | page: 0,
14 | type:3
15 | },
16 | btnChangeTab: function (e) {
17 | var that = this;
18 | that.setData({
19 | type: e.currentTarget.dataset.type
20 | });
21 | that.updateList();
22 | },
23 | btnChangeOrder: function () {
24 | var that = this;
25 | wx.showActionSheet({
26 | itemList: that.data.orderTypeStr,
27 | success: function (res) {
28 | if (res.tapIndex < that.data.orderTypeStr.length) {
29 | that.setData({
30 | type: res.tapIndex+3
31 | });
32 | that.updateList();
33 | }
34 | }
35 | })
36 | },
37 | btnLoadMore: function () {
38 | if (this.data.canloadmore) {
39 | this.data.page += 1;
40 | this.updateList(this.data.page);
41 | }
42 | },
43 | updateList: function (page = 0) {
44 | var that = this;
45 | wx.showLoading({
46 | title: '请求中',
47 | mask: true
48 | })
49 | wx.request({
50 | url: app.ServerUrl() + '/api/listluckydraw.php',
51 | method: 'GET',
52 | header: {
53 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
54 | },
55 | data: {
56 | page: page,
57 | type:that.data.type,
58 | limit:10,
59 | token: app.globalData.token
60 | },
61 | complete: function (res) {
62 | wx.hideLoading();
63 | wx.stopPullDownRefresh();
64 | },
65 | success: function (res) {
66 | if (parseInt(res.data.err) == 0) {
67 | var newlist = res.data.result;
68 |
69 | for (var i = 0; i < newlist.length; i++) {
70 | var item = newlist[i];
71 | if (item["awardimage"] != "") {
72 | item["awardimage"] = app.CDNUrl() + "/upload/" + item["awardimage"];
73 | } else {
74 | item["awardimage"] = "../../images/defaultawardimage.jpg";
75 | }
76 | item["opendatestr"] = util.formatDate(new Date(item["opendate"] * 1000), "MM月dd日 hh:mm");
77 | item["opentypestr"] = ["自动开奖", "参与者达到 " + item['openneedusers'] + " 人时自动开奖", "发起人手动开奖"][item['opentype']];
78 | }
79 |
80 | var list = [];
81 | if (page <= 0) {
82 | list = newlist;
83 | } else {
84 | list = that.data.list.concat(newlist);
85 | }
86 |
87 | that.setData({
88 | list: list,
89 | page: page,
90 | canloadmore: newlist.length >= 10
91 | });
92 | }
93 | }
94 | });
95 | },
96 | /**
97 | * 生命周期函数--监听页面加载
98 | */
99 | onLoad: function (options) {
100 | this.updateList();
101 | },
102 |
103 | /**
104 | * 生命周期函数--监听页面初次渲染完成
105 | */
106 | onReady: function () {
107 |
108 | },
109 |
110 | /**
111 | * 生命周期函数--监听页面显示
112 | */
113 | onShow: function () {
114 |
115 | },
116 |
117 | /**
118 | * 生命周期函数--监听页面隐藏
119 | */
120 | onHide: function () {
121 |
122 | },
123 |
124 | /**
125 | * 生命周期函数--监听页面卸载
126 | */
127 | onUnload: function () {
128 |
129 | },
130 |
131 | /**
132 | * 页面相关事件处理函数--监听用户下拉动作
133 | */
134 | onPullDownRefresh: function () {
135 |
136 | },
137 |
138 | /**
139 | * 页面上拉触底事件的处理函数
140 | */
141 | onReachBottom: function () {
142 |
143 | },
144 |
145 | /**
146 | * 用户点击右上角分享
147 | */
148 | onShareAppMessage: function () {
149 | return app.getMainAppShare();
150 | }
151 | })
--------------------------------------------------------------------------------
/src/pages/my/mypost.js:
--------------------------------------------------------------------------------
1 | // pages/my/mypost.js
2 | const app=getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | orderTypeStr:["按开奖时间","按发布时间"],
11 | orderType:0,
12 | list:[],
13 | page:0,
14 | canloadmore:false
15 | },
16 | goCreate: function (e) {
17 | wx.navigateTo({
18 | url: '/pages/create/create',
19 | })
20 | },
21 | btnLoadMore: function () {
22 | if (this.data.canloadmore) {
23 | this.data.page += 1;
24 | this.updateList(this.data.page);
25 | }
26 | },
27 | btnChangeTab:function(e){
28 | var that=this;
29 | that.setData({
30 | orderType: e.currentTarget.dataset.type
31 | });
32 | that.updateList(0, e.currentTarget.dataset.type);
33 | },
34 | btnChangeOrder:function(){
35 | var that=this;
36 | wx.showActionSheet({
37 | itemList: that.data.orderTypeStr,
38 | success:function(res){
39 | if (res.tapIndex < that.data.orderTypeStr.length){
40 | that.setData({
41 | orderType:res.tapIndex
42 | });
43 | that.updateList(0, res.tapIndex);
44 | }
45 | }
46 | })
47 | },
48 | btnGoDetail:function(e){
49 | wx.navigateTo({
50 | url: '/pages/luckydraw/detail?id='+e.currentTarget.dataset.id,
51 | })
52 | },
53 | updateList: function (page=0,ordertype=0) {
54 | var that = this;
55 | wx.request({
56 | url: app.ServerUrl() + '/api/listluckydraw.php',
57 | method: 'GET',
58 | header: {
59 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
60 | },
61 | data:{
62 | type:1,
63 | page:page,
64 | limit:10,
65 | ordertype: ordertype
66 | },
67 | success: function (res) {
68 | if(parseInt(res.data.err)==0){
69 | var newlist = res.data.result;
70 |
71 | for (var i = 0; i < newlist.length; i++) {
72 | var item = newlist[i];
73 | if (item["awardimage"] != "") {
74 | item["awardimage"] = app.CDNUrl() + "/upload/" + item["awardimage"];
75 | } else {
76 | item["awardimage"] = "../../images/defaultawardimage.jpg";
77 | }
78 | item["opendatestr"] = util.formatDate(new Date(item["opendate"] * 1000), "MM月dd日 hh:mm");
79 | item["opentypestr"] = ["自动开奖", "参与者达到 " + item['openneedusers'] + " 人时自动开奖", "发起人手动开奖"][item['opentype']];
80 | }
81 |
82 | var list = [];
83 | if (page <= 0) {
84 | list = newlist;
85 | } else {
86 | list = that.data.list.concat(newlist);
87 | }
88 |
89 | that.setData({
90 | list: list,
91 | page:page,
92 | canloadmore: newlist.length >= 10
93 | });
94 | }
95 | }
96 | });
97 | },
98 | /**
99 | * 生命周期函数--监听页面加载
100 | */
101 | onLoad: function (options) {
102 | this.updateList();
103 | },
104 |
105 | /**
106 | * 生命周期函数--监听页面初次渲染完成
107 | */
108 | onReady: function () {
109 |
110 | },
111 |
112 | /**
113 | * 生命周期函数--监听页面显示
114 | */
115 | onShow: function () {
116 |
117 | },
118 |
119 | /**
120 | * 生命周期函数--监听页面隐藏
121 | */
122 | onHide: function () {
123 |
124 | },
125 |
126 | /**
127 | * 生命周期函数--监听页面卸载
128 | */
129 | onUnload: function () {
130 |
131 | },
132 |
133 | /**
134 | * 页面相关事件处理函数--监听用户下拉动作
135 | */
136 | onPullDownRefresh: function () {
137 |
138 | },
139 |
140 | /**
141 | * 页面上拉触底事件的处理函数
142 | */
143 | onReachBottom: function () {
144 |
145 | },
146 |
147 | /**
148 | * 用户点击右上角分享
149 | */
150 | onShareAppMessage: function () {
151 | return app.getMainAppShare();
152 | }
153 | })
--------------------------------------------------------------------------------
/api/functions.php:
--------------------------------------------------------------------------------
1 | $err, 'msg'=>$msg , 'result'=>$result));
20 | exit();
21 | }
22 | function guid(){
23 | if (function_exists('com_create_guid')){
24 | return com_create_guid();
25 | }else{
26 | mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
27 | $charid = strtoupper(md5(uniqid(rand(), true)));
28 | $hyphen = chr(45);// "-"
29 | $uuid = ""//chr(123)// "{"
30 | .substr($charid, 0, 8).$hyphen
31 | .substr($charid, 8, 4).$hyphen
32 | .substr($charid,12, 4).$hyphen
33 | .substr($charid,16, 4).$hyphen
34 | .substr($charid,20,12);
35 | //.chr(125);// "}"
36 | return $uuid;
37 | }
38 | }
39 | function getToken($len = 32, $md5 = true) {
40 | # Seed random number generator
41 | # Only needed for PHP versions prior to 4.2
42 | mt_srand((double) microtime() * 1000000);
43 | # Array of characters, adjust as desired
44 | $chars = array (
45 | 'Q',
46 | '@',
47 | '8',
48 | 'y',
49 | '%',
50 | '^',
51 | '5',
52 | 'Z',
53 | '(',
54 | 'G',
55 | '_',
56 | 'O',
57 | '`',
58 | 'S',
59 | '-',
60 | 'N',
61 | '<',
62 | 'D',
63 | '{',
64 | '}',
65 | '[',
66 | ']',
67 | 'h',
68 | ';',
69 | 'W',
70 | '.',
71 | '/',
72 | '|',
73 | ':',
74 | '1',
75 | 'E',
76 | 'L',
77 | '4',
78 | '&',
79 | '6',
80 | '7',
81 | '#',
82 | '9',
83 | 'a',
84 | 'A',
85 | 'b',
86 | 'B',
87 | '~',
88 | 'C',
89 | 'd',
90 | '>',
91 | 'e',
92 | '2',
93 | 'f',
94 | 'P',
95 | 'g',
96 | ')',
97 | '?',
98 | 'H',
99 | 'i',
100 | 'X',
101 | 'U',
102 | 'J',
103 | 'k',
104 | 'r',
105 | 'l',
106 | '3',
107 | 't',
108 | 'M',
109 | 'n',
110 | '=',
111 | 'o',
112 | '+',
113 | 'p',
114 | 'F',
115 | 'q',
116 | '!',
117 | 'K',
118 | 'R',
119 | 's',
120 | 'c',
121 | 'm',
122 | 'T',
123 | 'v',
124 | 'j',
125 | 'u',
126 | 'V',
127 | 'w',
128 | ',',
129 | 'x',
130 | 'I',
131 | '$',
132 | 'Y',
133 | 'z',
134 | '*'
135 | );
136 | # Array indice friendly number of chars;
137 | $numChars = count($chars) - 1;
138 | $token = '';
139 | # Create random token at the specified length
140 | for ($i = 0; $i < $len; $i++)
141 | $token .= $chars[mt_rand(0, $numChars)];
142 | # Should token be run through md5?
143 | if ($md5) {
144 | # Number of 32 char chunks
145 | $chunks = ceil(strlen($token) / 32);
146 | $md5token = '';
147 | # Run each chunk through md5
148 | for ($i = 1; $i <= $chunks; $i++)
149 | $md5token .= md5(substr($token, $i * 32 - 32, 32));
150 | # Trim the token
151 | $token = substr($md5token, 0, $len);
152 | }
153 | return $token;
154 | }
155 |
156 | function request_post($url = '', $param = '') {
157 | if (empty($url) || empty($param)) {
158 | return false;
159 | }
160 |
161 | $postUrl = $url;
162 | $curlPost = $param;
163 | $ch = curl_init();//初始化curl
164 | curl_setopt($ch, CURLOPT_URL,$postUrl);//抓取指定网页
165 | curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
166 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
167 | curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
168 | curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
169 | $data = curl_exec($ch);//运行curl
170 | curl_close($ch);
171 |
172 | return $data;
173 | }
174 |
175 | ?>
--------------------------------------------------------------------------------
/src/pages/luckydraw/awardsaddress.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{list[detailIndex].luckydrawInfo.advneedinfokey}}:{{list[detailIndex].userInfo.optiondetail[list[detailIndex].luckydrawInfo.advneedinfokey]}}
8 |
9 |
10 | 收货地址:{{list[detailIndex].expressaddress.provinceName}}{{list[detailIndex].expressaddress.cityName}}{{list[detailIndex].expressaddress.countyName}}{{list[detailIndex].expressaddress.detailInfo}}
11 | 收货人:{{list[detailIndex].expressaddress.userName}}({{list[detailIndex].expressaddress.telNumber}})
12 | 点击复制到剪贴板
13 |
14 |
15 | 快递单号:
16 |
17 | 备注:
18 |
19 |
20 |
21 | 返回
22 | 保存
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
38 |
39 | 取消
40 |
41 |
42 |
43 |
44 | {{item.userInfo.nickname}}
45 | {{item.expressaddress?(item.expressno!=''?'已发货':'已填写'):'未填写'}}
46 |
47 |
48 |
49 |
50 |
51 | 点击加载更多
52 |
53 |
--------------------------------------------------------------------------------
/src/pages/my/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{userInfo.nickname}}
8 | 编辑资料
9 |
10 |
11 | RP币
12 | {{userInfo.coin}}
13 |
14 |
15 |
16 | 众奖记录
17 | {{userInfo.totallucky>0?userInfo.totallucky:''}}
18 |
19 |
20 |
21 |
22 | 我参与的
23 | {{userInfo.totaljoin>0?userInfo.totaljoin:''}}
24 |
25 |
26 |
27 |
28 | 我发起的
29 | {{userInfo.totalsend>0?userInfo.totalsend:''}}
30 |
31 |
32 |
37 |
38 | 常见问题
39 |
40 |
41 |
42 |
43 |
50 |
51 | 设置
52 |
53 |
54 |
55 |
56 | {{shortVersion}}
57 |
58 |
59 |
60 | 点击登录参与抽奖
61 |
62 |
63 |
--------------------------------------------------------------------------------
/src/styles/widget/weui-loading/weui-loading.wxss:
--------------------------------------------------------------------------------
1 | .weui-loading {
2 | margin: 0 5px;
3 | width: 20px;
4 | height: 20px;
5 | display: inline-block;
6 | vertical-align: middle;
7 | -webkit-animation: weuiLoading 1s steps(12, end) infinite;
8 | animation: weuiLoading 1s steps(12, end) infinite;
9 | background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
10 | background-size: 100%;
11 | }
12 | .weui-loading.weui-loading_transparent {
13 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E");
14 | }
15 | @-webkit-keyframes weuiLoading {
16 | 0% {
17 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
18 | transform: rotate3d(0, 0, 1, 0deg);
19 | }
20 | 100% {
21 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
22 | transform: rotate3d(0, 0, 1, 360deg);
23 | }
24 | }
25 | @keyframes weuiLoading {
26 | 0% {
27 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
28 | transform: rotate3d(0, 0, 1, 0deg);
29 | }
30 | 100% {
31 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
32 | transform: rotate3d(0, 0, 1, 360deg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/pages/my/myaward.js:
--------------------------------------------------------------------------------
1 | // pages/my/mypost.js
2 | const app=getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | list:[],
11 | page:0,
12 | canLoadMore:false
13 | },
14 | btnGoDetail:function(e){
15 | wx.navigateTo({
16 | url: '/pages/luckydraw/detail?id='+e.currentTarget.dataset.id,
17 | })
18 | },
19 | btnSubmitExpressAddress:function(e){
20 | var that = this;
21 | app.postFormId(e.detail.formId);
22 |
23 | wx.chooseAddress({
24 | success: function (res) {
25 | // console.log(res.userName)
26 | // console.log(res.postalCode)
27 | // console.log(res.provinceName)
28 | // console.log(res.cityName)
29 | // console.log(res.countyName)
30 | // console.log(res.detailInfo)
31 | // console.log(res.nationalCode)
32 | // console.log(res.telNumber)
33 | that.postExpressAddress(e.currentTarget.dataset.id,{
34 | provinceName: res.provinceName,
35 | cityName: res.cityName,
36 | countyName: res.countyName,
37 | detailInfo: res.detailInfo,
38 | postalCode: res.postalCode,
39 | userName: res.userName,
40 | telNumber: res.telNumber
41 | });
42 | },
43 | fail:function(res){
44 | console.log(res);
45 | wx.openSetting({});
46 | }
47 | })
48 | },
49 | btnCheckExpress:function(e){
50 | var that=this;
51 | console.log(e.currentTarget.dataset.expressno);
52 | wx.navigateTo({
53 | url: '/pages/webview/index?url=' + escape("https://jnsii.com/zj/h5/express/index.html?nu="+e.currentTarget.dataset.expressno),
54 | })
55 | },
56 | postExpressAddress:function(id,expressaddress){
57 | var that=this;
58 | wx.request({
59 | url: app.ServerUrl() + '/api/postexpressaddress.php',
60 | method: 'POST',
61 | header: {
62 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
63 | },
64 | data: {
65 | id:id,
66 | expressaddress: JSON.stringify(expressaddress)
67 | },
68 | success: function (res) {
69 | wx.hideLoading();
70 | wx.showModal({
71 | title: '',
72 | content: res.data.msg,
73 | showCancel:false
74 | })
75 | if (parseInt(res.data.err) == 0) {
76 | var obj = res.data;
77 |
78 | that.updateList();
79 | }
80 | }
81 | });
82 | },
83 | updateList: function (page=0) {
84 | var that = this;
85 | wx.request({
86 | url: app.ServerUrl() + '/api/listluckydraw.php',
87 | method: 'GET',
88 | header: {
89 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
90 | },
91 | data:{
92 | type:22,
93 | page:page,
94 | limit:10
95 | },
96 | success: function (res) {
97 | if(parseInt(res.data.err)==0){
98 | var newlist = res.data.result;
99 |
100 | for (var i = 0; i < newlist.length; i++) {
101 | var item = newlist[i].luckydrawInfo;
102 | if (item["awardimage"] != "") {
103 | item["awardimage"] = app.CDNUrl() + "/upload/" + item["awardimage"];
104 | } else {
105 | item["awardimage"] = "../../images/defaultawardimage.jpg";
106 | }
107 | item["opendatestr"] = util.formatDate(new Date(item["opendate"] * 1000), "MM月dd日 hh:mm");
108 | item["opentypestr"] = ["自动开奖", "参与者达到 " + item['openneedusers'] + " 人时自动开奖", "发起人手动开奖"][item['opentype']];
109 | }
110 |
111 | var list = [];
112 | if (page <= 0) {
113 | list = newlist;
114 | } else {
115 | list = that.data.list.concat(newlist);
116 | }
117 |
118 | that.setData({
119 | list: list,
120 | page:page,
121 | canloadmore: newlist.length >= 10
122 | });
123 | }
124 | }
125 | });
126 | },
127 | /**
128 | * 生命周期函数--监听页面加载
129 | */
130 | onLoad: function (options) {
131 | this.updateList();
132 | },
133 |
134 | /**
135 | * 生命周期函数--监听页面初次渲染完成
136 | */
137 | onReady: function () {
138 |
139 | },
140 |
141 | /**
142 | * 生命周期函数--监听页面显示
143 | */
144 | onShow: function () {
145 |
146 | },
147 |
148 | /**
149 | * 生命周期函数--监听页面隐藏
150 | */
151 | onHide: function () {
152 |
153 | },
154 |
155 | /**
156 | * 生命周期函数--监听页面卸载
157 | */
158 | onUnload: function () {
159 |
160 | },
161 |
162 | /**
163 | * 页面相关事件处理函数--监听用户下拉动作
164 | */
165 | onPullDownRefresh: function () {
166 |
167 | },
168 |
169 | /**
170 | * 页面上拉触底事件的处理函数
171 | */
172 | onReachBottom: function () {
173 |
174 | },
175 |
176 | /**
177 | * 用户点击右上角分享
178 | */
179 | onShareAppMessage: function () {
180 | return app.getMainAppShare();
181 | }
182 | })
--------------------------------------------------------------------------------
/h5/rank/js/utils.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | window.Utils = {};
3 | function dateFormat(timestamp, formats) {
4 | // formats格式包括
5 | // 1. Y-m-d
6 | // 2. Y-m-d H:i:s
7 | // 3. Y年m月d日
8 | // 4. Y年m月d日 H时i分
9 | formats = formats || 'Y-m-d';
10 |
11 | var zero = function (value) {
12 | if (value < 10) {
13 | return '0' + value;
14 | }
15 | return value;
16 | };
17 |
18 | var myDate = timestamp? new Date(timestamp): new Date();
19 |
20 | var year = myDate.getFullYear();
21 | var month = zero(myDate.getMonth() + 1);
22 | var day = zero(myDate.getDate());
23 |
24 | var hour = zero(myDate.getHours());
25 | var minite = zero(myDate.getMinutes());
26 | var second = zero(myDate.getSeconds());
27 |
28 | return formats.replace(/Y|m|d|H|i|s/ig, function (matches) {
29 | return ({
30 | Y: year,
31 | m: month,
32 | d: day,
33 | H: hour,
34 | i: minite,
35 | s: second
36 | })[matches];
37 | });
38 | };
39 |
40 | function getDaysDistance(datestr){
41 | //距今多少天,2014-10-29 or 2014年10月29日 or 2014.10.29
42 | var dateArr=datestr.match(/([0-9]{2,4})[\x{5E74}|\-|\.|\\|\/]{1}([0-9]{1,2})[\x{6708}|\-|\.|\\|\/]{1}([0-9]{1,2})[\x{65E5}|\-|\.|\\|\/]{0,1}\s*/);
43 | if(!dateArr)return "error";
44 | if(dateArr.length<3)return "error";
45 | var i_time=new Date().getTime()-new Date(dateArr[1]+"/"+dateArr[2]+"/"+dateArr[3]).getTime(); //两时间的毫秒差
46 |
47 | return Math.floor(i_time/86400000);
48 | }
49 | function getTimeDistance(str){
50 | //2014-10-29 18:00:00
51 | var ymd=str.split(" ")[0];
52 | var ymd_arr=ymd.split("-");
53 | var hms=str.split(" ")[1];
54 | var hms_arr=hms.split(":");
55 |
56 | var date1=new Date(ymd_arr[0],ymd_arr[1]-1,ymd_arr[2],hms_arr[0],hms_arr[1],hms_arr[2]);
57 | var date2=new Date(); //结束时间
58 | var date3=date2.getTime()-date1.getTime(); //时间差的毫秒数
59 | //计算出相差天数
60 | var days=Math.floor(date3/(24*3600*1000));
61 |
62 | //计算出小时数
63 |
64 | var leave1=date3%(24*3600*1000); //计算天数后剩余的毫秒数
65 | var hours=Math.abs(Math.floor(leave1/(3600*1000)));
66 | //计算相差分钟数
67 | var leave2=leave1%(3600*1000); //计算小时数后剩余的毫秒数
68 | var minutes=Math.floor(leave2/(60*1000))
69 | //计算相差秒数
70 | var leave3=leave2%(60*1000); //计算分钟数后剩余的毫秒数
71 | var seconds=Math.round(leave3/1000);
72 | //alert(" 相差 "+days+"天 "+hours+"小时 "+minutes+" 分钟"+seconds+" 秒");
73 |
74 | if(days>0){
75 | if(days/365>=1){
76 | return Math.floor(days/365)+"年前";
77 | }else{
78 | return days+"天前";
79 | }
80 | }else{
81 | if(hours>0){
82 | return hours+"小时前";
83 | }else{
84 | if(minutes<=3){
85 | return "刚刚";
86 | }else{
87 | return minutes+"分钟前";
88 | }
89 | }
90 | }
91 |
92 | return "刚刚";
93 | }
94 |
95 | function isMobile(){
96 | return (navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))|| (navigator.userAgent.match(/Android/i));
97 | }
98 | function isIOS(){
99 | return (navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i));
100 | }
101 | function isAndroid(){
102 | return (navigator.userAgent.match(/Android/i));
103 | }
104 | function isInWeixn(){
105 | var ua = navigator.userAgent.toLowerCase();
106 | if(ua.match(/MicroMessenger/i)=="micromessenger") {
107 | return true;
108 | } else {
109 | return false;
110 | }
111 | }
112 |
113 | function URLParams(name) {
114 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
115 | var r = window.location.search.substr(1).match(reg);
116 | if (r != null)
117 | return unescape(r[2]);
118 | return null;
119 | }
120 | function zero(value) {
121 | if (value < 10) {
122 | return '0' + value;
123 | }
124 | return value;
125 | };
126 | Utils.getTimeDistance=getTimeDistance;
127 | Utils.dateFormat=dateFormat;
128 | Utils.getURLParams=URLParams;
129 | Utils.zero=zero;
130 | })();
--------------------------------------------------------------------------------
/h5/express/js/utils.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | window.Utils = {};
3 | function dateFormat(timestamp, formats) {
4 | // formats格式包括
5 | // 1. Y-m-d
6 | // 2. Y-m-d H:i:s
7 | // 3. Y年m月d日
8 | // 4. Y年m月d日 H时i分
9 | formats = formats || 'Y-m-d';
10 |
11 | var zero = function (value) {
12 | if (value < 10) {
13 | return '0' + value;
14 | }
15 | return value;
16 | };
17 |
18 | var myDate = timestamp? new Date(timestamp): new Date();
19 |
20 | var year = myDate.getFullYear();
21 | var month = zero(myDate.getMonth() + 1);
22 | var day = zero(myDate.getDate());
23 |
24 | var hour = zero(myDate.getHours());
25 | var minite = zero(myDate.getMinutes());
26 | var second = zero(myDate.getSeconds());
27 |
28 | return formats.replace(/Y|m|d|H|i|s/ig, function (matches) {
29 | return ({
30 | Y: year,
31 | m: month,
32 | d: day,
33 | H: hour,
34 | i: minite,
35 | s: second
36 | })[matches];
37 | });
38 | };
39 |
40 | function getDaysDistance(datestr){
41 | //距今多少天,2014-10-29 or 2014年10月29日 or 2014.10.29
42 | var dateArr=datestr.match(/([0-9]{2,4})[\x{5E74}|\-|\.|\\|\/]{1}([0-9]{1,2})[\x{6708}|\-|\.|\\|\/]{1}([0-9]{1,2})[\x{65E5}|\-|\.|\\|\/]{0,1}\s*/);
43 | if(!dateArr)return "error";
44 | if(dateArr.length<3)return "error";
45 | var i_time=new Date().getTime()-new Date(dateArr[1]+"/"+dateArr[2]+"/"+dateArr[3]).getTime(); //两时间的毫秒差
46 |
47 | return Math.floor(i_time/86400000);
48 | }
49 | function getTimeDistance(str){
50 | //2014-10-29 18:00:00
51 | var ymd=str.split(" ")[0];
52 | var ymd_arr=ymd.split("-");
53 | var hms=str.split(" ")[1];
54 | var hms_arr=hms.split(":");
55 |
56 | var date1=new Date(ymd_arr[0],ymd_arr[1]-1,ymd_arr[2],hms_arr[0],hms_arr[1],hms_arr[2]);
57 | var date2=new Date(); //结束时间
58 | var date3=date2.getTime()-date1.getTime(); //时间差的毫秒数
59 | //计算出相差天数
60 | var days=Math.floor(date3/(24*3600*1000));
61 |
62 | //计算出小时数
63 |
64 | var leave1=date3%(24*3600*1000); //计算天数后剩余的毫秒数
65 | var hours=Math.abs(Math.floor(leave1/(3600*1000)));
66 | //计算相差分钟数
67 | var leave2=leave1%(3600*1000); //计算小时数后剩余的毫秒数
68 | var minutes=Math.floor(leave2/(60*1000))
69 | //计算相差秒数
70 | var leave3=leave2%(60*1000); //计算分钟数后剩余的毫秒数
71 | var seconds=Math.round(leave3/1000);
72 | //alert(" 相差 "+days+"天 "+hours+"小时 "+minutes+" 分钟"+seconds+" 秒");
73 |
74 | if(days>0){
75 | if(days/365>=1){
76 | return Math.floor(days/365)+"年前";
77 | }else{
78 | return days+"天前";
79 | }
80 | }else{
81 | if(hours>0){
82 | return hours+"小时前";
83 | }else{
84 | if(minutes<=3){
85 | return "刚刚";
86 | }else{
87 | return minutes+"分钟前";
88 | }
89 | }
90 | }
91 |
92 | return "刚刚";
93 | }
94 |
95 | function isMobile(){
96 | return (navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))|| (navigator.userAgent.match(/Android/i));
97 | }
98 | function isIOS(){
99 | return (navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i));
100 | }
101 | function isAndroid(){
102 | return (navigator.userAgent.match(/Android/i));
103 | }
104 | function isInWeixn(){
105 | var ua = navigator.userAgent.toLowerCase();
106 | if(ua.match(/MicroMessenger/i)=="micromessenger") {
107 | return true;
108 | } else {
109 | return false;
110 | }
111 | }
112 |
113 | function URLParams(name) {
114 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
115 | var r = window.location.search.substr(1).match(reg);
116 | if (r != null)
117 | return unescape(r[2]);
118 | return null;
119 | }
120 | function zero(value) {
121 | if (value < 10) {
122 | return '0' + value;
123 | }
124 | return value;
125 | };
126 | Utils.getTimeDistance=getTimeDistance;
127 | Utils.dateFormat=dateFormat;
128 | Utils.getURLParams=URLParams;
129 | Utils.zero=zero;
130 | })();
--------------------------------------------------------------------------------
/h5/livetv/js/utils.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | window.Utils = {};
3 | function dateFormat(timestamp, formats) {
4 | // formats格式包括
5 | // 1. Y-m-d
6 | // 2. Y-m-d H:i:s
7 | // 3. Y年m月d日
8 | // 4. Y年m月d日 H时i分
9 | formats = formats || 'Y-m-d';
10 |
11 | var zero = function (value) {
12 | if (value < 10) {
13 | return '0' + value;
14 | }
15 | return value;
16 | };
17 |
18 | var myDate = timestamp? new Date(timestamp): new Date();
19 |
20 | var year = myDate.getFullYear();
21 | var month = zero(myDate.getMonth() + 1);
22 | var day = zero(myDate.getDate());
23 |
24 | var hour = zero(myDate.getHours());
25 | var minite = zero(myDate.getMinutes());
26 | var second = zero(myDate.getSeconds());
27 |
28 | return formats.replace(/Y|m|d|H|i|s/ig, function (matches) {
29 | return ({
30 | Y: year,
31 | m: month,
32 | d: day,
33 | H: hour,
34 | i: minite,
35 | s: second
36 | })[matches];
37 | });
38 | };
39 |
40 | function getDaysDistance(datestr){
41 | //距今多少天,2014-10-29 or 2014年10月29日 or 2014.10.29
42 | var dateArr=datestr.match(/([0-9]{2,4})[\x{5E74}|\-|\.|\\|\/]{1}([0-9]{1,2})[\x{6708}|\-|\.|\\|\/]{1}([0-9]{1,2})[\x{65E5}|\-|\.|\\|\/]{0,1}\s*/);
43 | if(!dateArr)return "error";
44 | if(dateArr.length<3)return "error";
45 | var i_time=new Date().getTime()-new Date(dateArr[1]+"/"+dateArr[2]+"/"+dateArr[3]).getTime(); //两时间的毫秒差
46 |
47 | return Math.floor(i_time/86400000);
48 | }
49 | function getTimeDistance(str){
50 | //2014-10-29 18:00:00
51 | var ymd=str.split(" ")[0];
52 | var ymd_arr=ymd.split("-");
53 | var hms=str.split(" ")[1];
54 | var hms_arr=hms.split(":");
55 |
56 | var date1=new Date(ymd_arr[0],ymd_arr[1]-1,ymd_arr[2],hms_arr[0],hms_arr[1],hms_arr[2]);
57 | var date2=new Date(); //结束时间
58 | var date3=date2.getTime()-date1.getTime(); //时间差的毫秒数
59 | //计算出相差天数
60 | var days=Math.floor(date3/(24*3600*1000));
61 |
62 | //计算出小时数
63 |
64 | var leave1=date3%(24*3600*1000); //计算天数后剩余的毫秒数
65 | var hours=Math.abs(Math.floor(leave1/(3600*1000)));
66 | //计算相差分钟数
67 | var leave2=leave1%(3600*1000); //计算小时数后剩余的毫秒数
68 | var minutes=Math.floor(leave2/(60*1000))
69 | //计算相差秒数
70 | var leave3=leave2%(60*1000); //计算分钟数后剩余的毫秒数
71 | var seconds=Math.round(leave3/1000);
72 | //alert(" 相差 "+days+"天 "+hours+"小时 "+minutes+" 分钟"+seconds+" 秒");
73 |
74 | if(days>0){
75 | if(days/365>=1){
76 | return Math.floor(days/365)+"年前";
77 | }else{
78 | return days+"天前";
79 | }
80 | }else{
81 | if(hours>0){
82 | return hours+"小时前";
83 | }else{
84 | if(minutes<=3){
85 | return "刚刚";
86 | }else{
87 | return minutes+"分钟前";
88 | }
89 | }
90 | }
91 |
92 | return "刚刚";
93 | }
94 |
95 | function isMobile(){
96 | return (navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))|| (navigator.userAgent.match(/Android/i));
97 | }
98 | function isIOS(){
99 | return (navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i));
100 | }
101 | function isAndroid(){
102 | return (navigator.userAgent.match(/Android/i));
103 | }
104 | function isInWeixn(){
105 | var ua = navigator.userAgent.toLowerCase();
106 | if(ua.match(/MicroMessenger/i)=="micromessenger") {
107 | return true;
108 | } else {
109 | return false;
110 | }
111 | }
112 |
113 | function URLParams(name) {
114 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
115 | var r = window.location.search.substr(1).match(reg);
116 | if (r != null)
117 | return unescape(r[2]);
118 | return null;
119 | }
120 | function zero(value) {
121 | if (value < 10) {
122 | return '0' + value;
123 | }
124 | return value;
125 | };
126 | Utils.getTimeDistance=getTimeDistance;
127 | Utils.dateFormat=dateFormat;
128 | Utils.getURLParams=URLParams;
129 | Utils.zero=zero;
130 | })();
--------------------------------------------------------------------------------
/src/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | 精品大奖
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | 已送出奖品
29 | {{showtotalawards}}份
30 |
31 |
32 |
34 |
35 |
38 |
39 |
40 |
44 |
45 |
46 | 即将开奖
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 成为赞助商
59 | |
60 | 常见问题
61 |
--------------------------------------------------------------------------------
/src/utils/util.js:
--------------------------------------------------------------------------------
1 | function formatTime(date) {
2 | var year = date.getFullYear()
3 | var month = date.getMonth() + 1
4 | var day = date.getDate()
5 |
6 | var hour = date.getHours()
7 | var minute = date.getMinutes()
8 | var second = date.getSeconds()
9 |
10 |
11 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
12 | }
13 | function formatDateToWeek(date){
14 | var weekStr=["周日","周一","周二","周三","周四","周五","周六"];
15 |
16 | return weekStr[date.getDay()];
17 | }
18 | function formatDate(date,fmt){
19 | var o = {
20 | "M+" : date.getMonth()+1, //月份
21 | "d+" : date.getDate(), //日
22 | "h+" : date.getHours(), //小时
23 | "m+" : date.getMinutes(), //分
24 | "s+" : date.getSeconds(), //秒
25 | "q+" : Math.floor((date.getMonth()+3)/3), //季度
26 | "S" : date.getMilliseconds() //毫秒
27 | };
28 | if(/(y+)/.test(fmt))
29 | fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
30 | for(var k in o)
31 | if(new RegExp("("+ k +")").test(fmt))
32 | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
33 | return fmt;
34 | }
35 |
36 | function formatNumber(n) {
37 | n = n.toString()
38 | return n[1] ? n : '0' + n
39 | }
40 |
41 | function trimStr(str) {
42 | var s = str.replace(/(^\s*)|(\s*$)/g, "");
43 | return s;
44 | }
45 |
46 | function getTimeDistance(str) {
47 | //2014-10-29 18:00:00
48 | var ymd = str.split(" ")[0];
49 | var ymd_arr = ymd.split("-");
50 | var hms = str.split(" ")[1];
51 | var hms_arr = hms.split(":");
52 |
53 | var date1 = new Date(ymd_arr[0], ymd_arr[1] - 1, ymd_arr[2], hms_arr[0], hms_arr[1], hms_arr[2]);
54 | var date2 = new Date(); //结束时间
55 | var date3 = date2.getTime() - date1.getTime(); //时间差的毫秒数
56 | //计算出相差天数
57 | var days = Math.floor(date3 / (24 * 3600 * 1000));
58 |
59 | //计算出小时数
60 |
61 | var leave1 = date3 % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
62 | var hours = Math.abs(Math.floor(leave1 / (3600 * 1000)));
63 | //计算相差分钟数
64 | var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
65 | var minutes = Math.floor(leave2 / (60 * 1000))
66 | //计算相差秒数
67 | var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
68 | var seconds = Math.round(leave3 / 1000);
69 | //alert(" 相差 "+days+"天 "+hours+"小时 "+minutes+" 分钟"+seconds+" 秒");
70 |
71 | if (days > 0) {
72 | if (days / 365 >= 1) {
73 | return Math.floor(days / 365) + "年前";
74 | } else {
75 | return days + "天前";
76 | }
77 | } else {
78 | if (hours > 0) {
79 | return hours + "小时前";
80 | } else {
81 | if (minutes <= 3) {
82 | return "刚刚";
83 | } else {
84 | return minutes + "分钟前";
85 | }
86 | }
87 | }
88 |
89 | return "刚刚";
90 | }
91 |
92 | function getCityFromLocation(gps,cb) {
93 | wx.request({
94 | url: 'https://api.map.baidu.com/geocoder/v2/?coordtype=gcj02ll&location='+gps+'&output=json&pois=1&ak=PCgWIW1cx4YkYcY7UIYyufosUkVCf9k4',
95 | method: "GET",
96 | success: function (res) {
97 | if (cb) cb(res.data.result);
98 | }
99 | })
100 | }
101 | function getLocationFromCity(city, cb) {
102 | wx.request({
103 | url: 'https://api.map.baidu.com/geocoder/v2/?address=' + city + '&output=json&ret_coordtype=GCJ02&ak=PCgWIW1cx4YkYcY7UIYyufosUkVCf9k4',
104 | method: "GET",
105 | success: function (res) {
106 | if (cb) cb(res.data.result);
107 | }
108 | })
109 | }
110 |
111 | function getCityFromStr(str){
112 | var shiIndex = str.indexOf('市');
113 | var city = str;
114 | console.log(city);
115 | if (shiIndex>=0){
116 | city = city.substr(0, shiIndex);
117 | console.log(city);
118 | var provinceIndex = city.indexOf('省');
119 | if (provinceIndex>=0){
120 | city = city.substr(provinceIndex+1, city.length);
121 | console.log(city);
122 | } else if (city.indexOf('自治区')>=0){
123 | city = city.substr(city.indexOf('自治区')+3, city.length);
124 | console.log(city);
125 | }
126 | }else{
127 | city = city.substr(0, str.indexOf('特别行政区'));
128 | console.log(city);
129 | }
130 |
131 | return city;
132 |
133 | }
134 |
135 | module.exports = {
136 | formatDateToWeek: formatDateToWeek,
137 | formatTime: formatTime,
138 | formatDate:formatDate,
139 | formatNumber:formatNumber,
140 | getCityFromStr: getCityFromStr,
141 | getCityFromLocation: getCityFromLocation,
142 | getLocationFromCity: getLocationFromCity,
143 | getTimeDistance: getTimeDistance,
144 | trimStr: trimStr
145 | }
146 |
147 |
--------------------------------------------------------------------------------
/api/postluckdraw.php:
--------------------------------------------------------------------------------
1 | awardimage;
14 | $awardname=$jsondata->awardname;
15 | $awardnum=$jsondata->awardnum;
16 | $awardpics=$jsondata->awardpics;
17 | $opentype=$jsondata->opentype;
18 | $opendate=$jsondata->opendate;
19 | $openneedusers=$jsondata->openneedusers;
20 |
21 | $advdistancetype=$jsondata->advdistancetype;
22 | $advgendertype=$jsondata->advgendertype;
23 | $advcoinbottom=$jsondata->advcoinbottom;
24 | $advbarcode=$jsondata->advbarcode;
25 | $advpassword=$jsondata->advpassword;
26 | $advpasswordtips=$jsondata->advpasswordtips;
27 | $advgpscity=$jsondata->advgpscity;
28 | $advgps=$jsondata->advgps;
29 | $advgpsaddr=$jsondata->advgpsaddr;
30 | $advneedinfokey=$jsondata->advneedinfokey;
31 | $advshare=$jsondata->advshare;
32 | $advispublic=$jsondata->advispublic;
33 |
34 |
35 | session_start();
36 | $openid=$_SESSION['openid'];
37 | if(!$openid){
38 | exitJson(1,'非法请求,请重新登录');
39 | }
40 |
41 | $userInfo=getUserSimpleInfo($openid);
42 | if(userIsBaned($openid)){
43 | exitJson(2,'因用户举报,您已被禁止参与和发起抽奖!');
44 | }
45 |
46 | if($awardname=="" || $awardnum<=0){
47 | exitJson(1,'缺少必要的参数');
48 | }else if($awardnum>10 && $userInfo['type']<100 && $advispublic==1){
49 | exitJson(4,'超过10个中奖名额的抽奖活动请先咨询客服。');
50 | }else if($openneedusers>100 && $advispublic==1){
51 | exitJson(5,'超过100人才开奖的抽奖活动请先咨询客服。');
52 | }
53 |
54 | $db = getDb();
55 |
56 | $now=time();
57 |
58 | if($opentype!=0){
59 | $opendate=$now+86400*7;
60 | }else{
61 | if($opendate==0){
62 | exitJson(1,'自动开奖时间有误,请重试');
63 | }
64 | }
65 | $lockKey = 'lockpostluckydraw_'.$openid;
66 | $memc = new Redis();
67 | $memc->connect('127.0.0.1',6379);
68 | $addLock = $memc->setnx($lockKey,5);// 写入锁,说明这个$id目前有进程在参与抽奖。
69 | if (!$addLock) {
70 | $sql="select `id`,createdate from ".getTablePrefix()."_luckydraws where ownerid='$openid' order by createdate DESC LIMIT 1";
71 | $res=mysql_query($sql,$db) or die(mysql_error());
72 | $row=mysql_fetch_assoc($res);
73 | exitJson(0,"抽奖发布成功,请勿重复操作",array("id"=>$row['id']));// 或当前参与人数太多,请重试
74 | }
75 | $memc->expire($lockKey,10); // 设置10秒自动过期该锁,如果某人崩溃,则10秒后其他人也可以自动参与
76 |
77 | // if($advgps!='' || $advcoinbottom!='' || $advbarcode!='' || $advpassword!='' || $advshare==1 || $advneedinfokey!=''){
78 | // $coinresult=addCoinHistory(2,-10,"发起高级抽奖");
79 | // if(!$coinresult){
80 | // $memc->del($lockKey); // 删除锁
81 | // exitJson(1,"RP币余额不足,使用高级设置发起需消费10RP币");
82 | // }
83 | // }else{
84 | // $coinresult=addCoinHistory(2,-1,"发起抽奖");
85 | // if(!$coinresult){
86 | // $memc->del($lockKey); // 删除锁
87 | // exitJson(1,"RP币余额不足,发起抽奖需消费1RP币");
88 | // }
89 | // }
90 |
91 | if($jsondata->id){
92 | $id=$jsondata->id;
93 | $sql = "update `".getTablePrefix()."_luckydraws` set ownerid='$openid',createdate='$now',awardimage='$awardimage',awardname='$awardname',awardnum='$awardnum',awardpics='$awardpics',opentype='$opentype',opendate='$opendate',openneedusers='$openneedusers',advdistancetype='$advdistancetype',advgendertype='$advgendertype',advcoinbottom='$advcoinbottom',advbarcode='$advbarcode',advpassword='$advpassword',advpasswordtips='$advpasswordtips',advgpscity='$advgpscity',advgps='$advgps',advgpsaddr='$advgpsaddr',advneedinfokey='$advneedinfokey',advshare='$advshare',advispublic='$advispublic' where id='$id' LIMIT 1";
94 | $res=mysql_query($sql, $db) or die(mysql_error());
95 |
96 | // $memc->del($lockKey);// 删除锁
97 | exitJson(0,"抽奖已更新",array("id"=>$id));
98 | }else{
99 | $coinresult=addCoinHistory(2,-5,"发起抽奖");
100 | if(!$coinresult){
101 | $memc->del($lockKey); // 删除锁
102 | exitJson(1,"RP币余额不足,发起抽奖需消费5RP币");
103 | }
104 | $query=mysql_query("show table status where name ='".getTablePrefix()."_luckydraws'",$db);
105 | $row = mysql_fetch_assoc($query);
106 | $insertid = $row['Auto_increment'];
107 |
108 | $sql = "insert into `".getTablePrefix()."_luckydraws` (ownerid,createdate,awardimage,awardname,awardnum,awardpics,opentype,opendate,openneedusers,advdistancetype,advgendertype,advcoinbottom,advbarcode,advpassword,advpasswordtips,advgpscity,advgps,advgpsaddr,advneedinfokey,advshare,advispublic) values('$openid','$now','$awardimage','$awardname','$awardnum','$awardpics','$opentype','$opendate','$openneedusers','$advdistancetype','$advgendertype','$advcoinbottom','$advbarcode','$advpassword','$advpasswordtips','$advgpscity','$advgps','$advgpsaddr','$advneedinfokey','$advshare','$advispublic')";
109 | $res=mysql_query($sql, $db) or die(mysql_error());
110 |
111 | // $memc->del($lockKey);// 删除锁
112 | exitJson(0,"抽奖发布成功",array("id"=>$insertid));
113 | }
114 |
115 |
116 | ?>
--------------------------------------------------------------------------------
/h5/helpcenter/qna.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 常见问题
5 |
6 |
7 |
8 |
34 |
45 |
46 |
47 |
48 |
“众奖”是如何设计公平公正的抽奖规则的?
49 |
1、众奖的抽奖算法是完全公开透明的,简单说就是摇号,随机从抽奖名单里取。2、抽奖名单里会显示参与时间等信息,随时可以公开查阅、检索。
50 |
51 |
52 |
我中奖了,但发起人没有给我发奖怎么办?
53 |
标明了【赞助商】的抽奖活动,都是官方合作的抽奖活动,只要地球还转,发奖就有保证。但“众奖”也允许任何人免费发起抽奖活动,如果发起人无法兑现发奖,请通过联系客服进行举报,我们将对发起人进行处罚。
54 |
55 |
56 |
中奖后在哪里填写收货地址?
57 |
中奖时会收到通知,请在24小时内在我的中奖记录里填写收货地址。也有特殊情况导致无法收到通知,经常打开“众奖”看看吧。如果逾期不填写收货地址而导致无法发奖,后果自付。
58 |
59 |
60 |
61 |
为什么有人在抽奖名单中出现多个名字?
62 |
参与者每邀请好友成功参加时,该参与者的名字都会在抽奖名单中再出现一次。以此类推,抽奖名单中的名字数量越多中奖几率就越大。
63 |
64 |
65 |
发起时高级设置里的“参与口令”是什么意思?
66 |
设置参与口令,那么没有口令的人就无法参加了。您可以通过参与口令进行提示,引导到公众号关注,或者是玩一个猜谜小游戏呢。
67 |
68 |
69 |
发起时高级设置里的“限定地点”是什么意思?
70 |
设置限定地点,抽奖就会在‘附近抽奖’的地图中显示,还可以设置在多少范围内方可参与抽奖,特别适合商家和指定范围内的消费者互动。
71 |
72 |
73 |
发起时高级设置里的“条码解锁”是什么意思?
74 |
所有合法上市的商品都有条形码,设定条码解锁后只有扫描到指定的条形码方可参与抽奖,特别适合品牌新品上市做抽奖活动,可以让参与者关注到这个商品。
75 |
76 |
77 |
发起时高级设置里的“RP币余额”是什么意思?
78 |
RP是“众奖”里一个检验活跃度的机制,初次登录,系统会赠送10个RP币。设置了RP币余额时,参与者的RP币余额如果不够则无法参与抽奖。这个使用场景不多,不建议设置。
79 |
80 |
81 |
RP币是什么鬼?
82 |
RP币是“众奖”里的积分代币,初次登录系统会赠送10个RP币,参与抽奖、发起抽奖都需要消耗RP币。未来也可能直接兑换奖品哦,请多多领取吧。
83 |
84 |
85 |
RP币怎么获得?
86 |
钱包每小时会产生出一枚RP币,需要用户主动点击领取,不领取的话也不会累积哦,记得按时收取RP币吧。
87 |
88 |
89 |
抽奖过期是什么鬼?
90 |
目前有三种抽奖模式,按时间自动、满人数自动、发起人手动。满人数自动和发起人手动的有效期只有三天,没有满人数或发起人没有开奖,则此抽奖活动显示为过期。
91 |
92 |
93 |
已发起的抽奖可以再编辑吗?
94 |
只要还没有人参与,随时都可以再次编辑。
95 |
96 |
97 |
发起人可以参与抽奖吗?
98 |
可以,不过即使是发起人参与,也是一视同仁考验人品哦。
99 |
100 |
101 |
可以开一二三等奖这种形式吗?
102 |
目前不可以,如果需要开一二三等奖的话,可以发起三个不同奖品的抽奖即可。
103 |
104 |
105 |
--------------------------------------------------------------------------------
/h5/rank/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 中奖榜单
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
59 |
106 |
107 |
108 | 所有数据真实,没有物流信息可能正在发货或用其他方式已领取
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/src/pages/luckydraw/map.js:
--------------------------------------------------------------------------------
1 | // pages/map/index.js
2 | var app = getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | mapHeight: 0,
11 | markers: [],
12 | centerLat: 0,
13 | centerLng: 0,
14 | curUserLat: 0,
15 | curUserLng: 0,
16 | inputShowed: false,
17 | inputVal: "",
18 | searchResult: []
19 | },
20 | goCreate: function (e) {
21 | wx.navigateTo({
22 | url: '/pages/create/create',
23 | })
24 | },
25 | showInput: function () {
26 | this.setData({
27 | inputShowed: true
28 | });
29 | },
30 | hideInput: function () {
31 | this.setData({
32 | inputVal: "",
33 | inputShowed: false
34 | });
35 | this.searchShelfBy(this.data.city);
36 | },
37 | clearInput: function () {
38 | this.setData({
39 | inputVal: ""
40 | });
41 | this.searchShelfBy(this.data.city);
42 | },
43 | inputTyping: function (e) {
44 | if (util.trimStr(e.detail.value) != "") {
45 | this.setData({
46 | inputVal: util.trimStr(e.detail.value)
47 | });
48 | this.searchShelfBy(util.trimStr(e.detail.value));
49 | } else {
50 | this.clearInput();
51 | }
52 | },
53 | regionchange(e) {
54 | console.log(e);
55 | var map = wx.createMapContext('map');
56 | map.getCenterLocation({
57 | success: function (res) {
58 | console.log(res);
59 | }
60 | });
61 | },
62 | markertap(e) {
63 | console.log(e.markerId);
64 | var id = e.markerId.substr(3, e.markerId.length);
65 |
66 | wx.navigateTo({
67 | url: '/pages/luckydraw/detail?id=' + id,
68 | })
69 | },
70 | /**
71 | * 生命周期函数--监听页面加载
72 | */
73 | searchShelfBy:function(kw){
74 | var that = this;
75 | wx.request({
76 | url: app.ServerUrl() + '/api/listluckydraw.php',
77 | method: 'GET',
78 | header: {
79 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
80 | },
81 | data: {
82 | city: kw,
83 | type:"city",
84 | token: app.globalData.token
85 | },
86 | success: function (res) {
87 | if (parseInt(res.data.err) == 0) {
88 | var markers = [];
89 |
90 | for (var name in res.data.result) {
91 | var marker = {};
92 |
93 | var item = res.data.result[name];
94 |
95 | marker.id = "li_" + item.id;
96 |
97 | marker.iconPath = "/images/mapmarker.png";
98 |
99 | item.gps=item.advgps.split(",");
100 |
101 | marker.latitude = parseFloat(item.gps[0]);
102 | marker.longitude = parseFloat(item.gps[1]);
103 |
104 | marker.width = 55;
105 | marker.height = 60;
106 |
107 | markers.push(marker);
108 | };
109 |
110 | that.setData({
111 | markers: markers
112 | });
113 |
114 | var mapCtx = wx.createMapContext('map');
115 | mapCtx.includePoints({
116 | padding: [10, 10, 10, 10],
117 | points: markers.concat({ latitude: that.data.curUserLat, longitude: that.data.curUserLng})
118 | })
119 | }
120 | }
121 | })
122 | },
123 | onLoad: function (options) {
124 | var that = this;
125 | wx.getSystemInfo({
126 | success: function (res) {
127 | that.setData({
128 | mapHeight: res.windowHeight-46
129 | });
130 | console.log(res);
131 | }
132 | });
133 | wx.getLocation({
134 | success: function (res) {
135 | that.setData({
136 | centerLat: res.latitude,
137 | centerLng: res.longitude,
138 | curUserLat: res.latitude,
139 | curUserLng: res.longitude
140 | });
141 | util.getCityFromLocation(res.latitude + "," + res.longitude, function (obj) {
142 | var city = obj.addressComponent.city;
143 | var shiIndex = city.lastIndexOf("市");
144 | if (shiIndex>=0){
145 | city = city.substr(0, shiIndex);
146 | }
147 | that.setData({
148 | city:city
149 | });
150 | that.searchShelfBy(city);
151 | });
152 | },
153 | });
154 | },
155 |
156 | /**
157 | * 生命周期函数--监听页面初次渲染完成
158 | */
159 | onReady: function () {
160 |
161 | },
162 |
163 | /**
164 | * 生命周期函数--监听页面显示
165 | */
166 | onShow: function () {
167 |
168 | },
169 |
170 | /**
171 | * 生命周期函数--监听页面隐藏
172 | */
173 | onHide: function () {
174 |
175 | },
176 |
177 | /**
178 | * 生命周期函数--监听页面卸载
179 | */
180 | onUnload: function () {
181 |
182 | },
183 |
184 | /**
185 | * 页面相关事件处理函数--监听用户下拉动作
186 | */
187 | onPullDownRefresh: function () {
188 |
189 | },
190 |
191 | /**
192 | * 页面上拉触底事件的处理函数
193 | */
194 | onReachBottom: function () {
195 |
196 | },
197 |
198 | /**
199 | * 用户点击右上角分享
200 | */
201 | onShareAppMessage: function () {
202 | return app.getMainAppShare();
203 | }
204 | })
--------------------------------------------------------------------------------
/src/styles/widget/weui-cell/weui-form.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_input {
2 | padding-top: 0;
3 | padding-bottom: 0;
4 | }
5 | .weui-label {
6 | width: 105px;
7 | word-wrap: break-word;
8 | word-break: break-all;
9 | }
10 | .weui-input {
11 | height: 2.58823529em;
12 | min-height: 2.58823529em;
13 | line-height: 2.58823529em;
14 | }
15 | .weui-toptips {
16 | position: fixed;
17 | -webkit-transform: translateZ(0);
18 | transform: translateZ(0);
19 | top: 0;
20 | left: 0;
21 | right: 0;
22 | padding: 5px;
23 | font-size: 14px;
24 | text-align: center;
25 | color: #FFFFFF;
26 | z-index: 5000;
27 | word-wrap: break-word;
28 | word-break: break-all;
29 | }
30 | .weui-toptips_warn {
31 | background-color: #E64340;
32 | }
33 | .weui-textarea {
34 | display: block;
35 | width: 100%;
36 | }
37 | .weui-textarea-counter {
38 | color: #B2B2B2;
39 | text-align: right;
40 | }
41 | .weui-textarea-counter_warn {
42 | color: #E64340;
43 | }
44 | .weui-cell_warn {
45 | color: #E64340;
46 | }
47 | .weui-form-preview {
48 | position: relative;
49 | background-color: #FFFFFF;
50 | }
51 | .weui-form-preview:before {
52 | content: " ";
53 | position: absolute;
54 | left: 0;
55 | top: 0;
56 | right: 0;
57 | height: 1px;
58 | border-top: 1rpx solid #D9D9D9;
59 | color: #D9D9D9;
60 | }
61 | .weui-form-preview:after {
62 | content: " ";
63 | position: absolute;
64 | left: 0;
65 | bottom: 0;
66 | right: 0;
67 | height: 1px;
68 | border-bottom: 1rpx solid #D9D9D9;
69 | color: #D9D9D9;
70 | }
71 | .weui-form-preview__value {
72 | font-size: 14px;
73 | }
74 | .weui-form-preview__value_in-hd {
75 | font-size: 26px;
76 | }
77 | .weui-form-preview__hd {
78 | position: relative;
79 | padding: 10px 15px;
80 | text-align: right;
81 | line-height: 2.5em;
82 | }
83 | .weui-form-preview__hd:after {
84 | content: " ";
85 | position: absolute;
86 | left: 0;
87 | bottom: 0;
88 | right: 0;
89 | height: 1px;
90 | border-bottom: 1rpx solid #D9D9D9;
91 | color: #D9D9D9;
92 | left: 15px;
93 | }
94 | .weui-form-preview__bd {
95 | padding: 10px 15px;
96 | font-size: .9em;
97 | text-align: right;
98 | color: #999999;
99 | line-height: 2;
100 | }
101 | .weui-form-preview__ft {
102 | position: relative;
103 | line-height: 50px;
104 | display: -webkit-box;
105 | display: -webkit-flex;
106 | display: flex;
107 | }
108 | .weui-form-preview__ft:after {
109 | content: " ";
110 | position: absolute;
111 | left: 0;
112 | top: 0;
113 | right: 0;
114 | height: 1px;
115 | border-top: 1rpx solid #D5D5D6;
116 | color: #D5D5D6;
117 | }
118 | .weui-form-preview__item {
119 | overflow: hidden;
120 | }
121 | .weui-form-preview__label {
122 | float: left;
123 | margin-right: 1em;
124 | min-width: 4em;
125 | color: #999999;
126 | text-align: justify;
127 | text-align-last: justify;
128 | }
129 | .weui-form-preview__value {
130 | display: block;
131 | overflow: hidden;
132 | word-break: normal;
133 | word-wrap: break-word;
134 | }
135 | .weui-form-preview__btn {
136 | position: relative;
137 | display: block;
138 | -webkit-box-flex: 1;
139 | -webkit-flex: 1;
140 | flex: 1;
141 | color: #3CC51F;
142 | text-align: center;
143 | }
144 | .weui-form-preview__btn:after {
145 | content: " ";
146 | position: absolute;
147 | left: 0;
148 | top: 0;
149 | width: 1px;
150 | bottom: 0;
151 | border-left: 1rpx solid #D5D5D6;
152 | color: #D5D5D6;
153 | }
154 | .weui-form-preview__btn:first-child:after {
155 | display: none;
156 | }
157 | .weui-form-preview__btn_active {
158 | background-color: #EEEEEE;
159 | }
160 | .weui-form-preview__btn_default {
161 | color: #999999;
162 | }
163 | .weui-form-preview__btn_primary {
164 | color: #0BB20C;
165 | }
166 | .weui-cell_select {
167 | padding: 0;
168 | }
169 | .weui-select {
170 | position: relative;
171 | padding-left: 15px;
172 | padding-right: 30px;
173 | height: 2.58823529em;
174 | min-height: 2.58823529em;
175 | line-height: 2.58823529em;
176 | border-right: 1rpx solid #D9D9D9;
177 | }
178 | .weui-select:before {
179 | content: " ";
180 | display: inline-block;
181 | height: 6px;
182 | width: 6px;
183 | border-width: 2px 2px 0 0;
184 | border-color: #C8C8CD;
185 | border-style: solid;
186 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
187 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
188 | position: relative;
189 | top: -2px;
190 | position: absolute;
191 | top: 50%;
192 | right: 15px;
193 | margin-top: -4px;
194 | }
195 | .weui-select_in-select-after {
196 | padding-left: 0;
197 | }
198 | .weui-cell__hd_in-select-after,
199 | .weui-cell__bd_in-select-before {
200 | padding-left: 15px;
201 | }
202 | .weui-cell_vcode {
203 | padding-right: 0;
204 | }
205 | .weui-vcode-img {
206 | margin-left: 5px;
207 | height: 2.58823529em;
208 | vertical-align: middle;
209 | }
210 | .weui-vcode-btn {
211 | display: inline-block;
212 | height: 2.58823529em;
213 | margin-left: 5px;
214 | padding: 0 0.6em 0 0.7em;
215 | border-left: 1px solid #E5E5E5;
216 | line-height: 2.58823529em;
217 | vertical-align: middle;
218 | font-size: 17px;
219 | color: #3CC51F;
220 | white-space: nowrap;
221 | }
222 | .weui-vcode-btn:active {
223 | color: #52a341;
224 | }
225 |
--------------------------------------------------------------------------------
/src/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | const app = getApp();
4 | var util = require('../../utils/util.js');
5 | var timer;
6 | Page({
7 | data: {
8 | result:null,
9 | marqueeText:"",
10 | showtotalawards:0
11 | },
12 | btnJump:function(e){
13 | app.postFormId(e.detail.formId);
14 |
15 | var url=e.currentTarget.dataset.url;
16 |
17 | if(url.indexOf("xcxid://")>=0){
18 | var urls=url.split("xcxid://");
19 | wx.navigateToMiniProgram({
20 | appId: urls[1],
21 | path: "",
22 | success(res) {
23 |
24 | }
25 | })
26 | }else{
27 | wx.navigateTo({
28 | url: e.currentTarget.dataset.url,
29 | })
30 | }
31 | },
32 | btnMyWallet:function(){
33 | wx.navigateTo({
34 | url: '/pages/my/wallet',
35 | })
36 | },
37 | btnList:function(){
38 | wx.navigateTo({
39 | url: '/pages/luckydraw/list',
40 | })
41 | },
42 | btnMap:function(){
43 | wx.navigateTo({
44 | url: '/pages/luckydraw/map',
45 | })
46 | },
47 | goCreate:function(e){
48 | wx.navigateTo({
49 | url: '/pages/create/create',
50 | })
51 | },
52 | changeTabIndex: function (e) {
53 | app.setTabIndex(e.currentTarget.dataset.index);
54 | },
55 | //事件处理函数
56 | bindViewTap: function() {
57 |
58 | },
59 | startTimer:function(){
60 | var that=this;
61 | var showtotalawards=that.data.result.totalawards-Math.floor(Math.random()*50+50);
62 | function updateTotalAwards(){
63 | if (showtotalawards=0){
148 | var scene_params = options.scene.split("_");
149 | var luckydrawid = scene_params[0].substr(11, scene_params[0].length);
150 | var url = '/pages/luckydraw/detail?id=' + luckydrawid;
151 | if (scene_params.length>1){
152 | var inviterid = scene_params[1].substr(9, scene_params[1].length);
153 | url = '/pages/luckydraw/detail?id=' + luckydrawid + "&inviterid=" + inviterid;
154 | }
155 | console.log("option url:"+url);
156 | wx.navigateTo({
157 | url: url
158 | });
159 | return;
160 | }
161 | }
162 | if (luckydrawid) {
163 | var url='/pages/luckydraw/detail?id=' + luckydrawid;
164 | if(options.inviterid){
165 | url=url+"&inviterid="+options.inviterid;
166 | }
167 | console.log("option url:"+url);
168 | wx.navigateTo({
169 | url: url,
170 | })
171 | }
172 | },
173 | onUnload:function(){
174 | clearInterval(timer);
175 | },
176 | onShow:function(){
177 |
178 | },
179 | onShareAppMessage: function () {
180 | return app.getMainAppShare();
181 | }
182 | })
183 |
--------------------------------------------------------------------------------
/h5/livetv/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | 苹果2018WWDC直播
4 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
109 |
110 |
111 |
112 |
114 |
参与口令:乔布斯生日 19550224
请留言参与讨论,没留言的话可能会失去抽奖资格
115 |
最新评论刷新
116 |
117 |
118 |
119 |
120 |
121 |
122 |
{{item.ownernickname}}
123 |
{{datedis(item.createdate)}}发布
124 |
{{item.content}}
125 |
126 |
127 |
128 |
加载更多
129 |
130 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/src/pages/my/wallet.js:
--------------------------------------------------------------------------------
1 | // pages/my/wallet.js
2 | const app=getApp();
3 | var timer;
4 | const audioGetCoin = wx.createInnerAudioContext();
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | result:null,
12 | list: [],
13 | canloadmore: false,
14 | page: 0
15 | },
16 | bindGetUserInfo: function (e) {
17 | var that = this;
18 | wx.getUserInfo({
19 | success: function (res) {
20 | app.login(function () {
21 | that.setData({ userInfo: app.globalData.userInfo });
22 | that.updateWallet();
23 | that.updateHistory();
24 | });
25 | }
26 | })
27 | },
28 | btnLoadMore: function () {
29 | if (this.data.canloadmore) {
30 | this.data.page += 1;
31 | this.updateHistory(this.data.page);
32 | }
33 | },
34 | btnEarnCoin:function(e){
35 | var that=this;
36 | if(that.data.result.canearncoin){
37 | var that = this;
38 | console.log('submit form id', e.detail.formId);
39 | app.postFormId(e.detail.formId);
40 |
41 | audioGetCoin.src = app.ServerUrl()+'/images/9654.mp3';
42 | audioGetCoin.play();
43 |
44 | wx.request({
45 | url: app.ServerUrl() + '/api/earncoin.php',
46 | method: 'GET',
47 | header: {
48 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
49 | },
50 | success: function (res) {
51 | if (parseInt(res.data.err) == 0) {
52 |
53 | var result=that.data.result;
54 |
55 | result.totalcoin = parseInt(result.totalcoin)+1;
56 | app.globalData.userInfo.coin = result.totalcoin;
57 |
58 | result.canearncoin=false;
59 |
60 | that.setData({
61 | result: result
62 | });
63 |
64 | that.updateWallet();
65 | that.updateHistory();
66 | }else{
67 | wx.showModal({
68 | title: '',
69 | content: res.data.msg,
70 | showCancel: false
71 | })
72 | }
73 | }
74 | });
75 | }
76 | },
77 | /**
78 | * 生命周期函数--监听页面加载
79 | */
80 | updateWallet:function(){
81 | var that = this;
82 | wx.request({
83 | url: app.ServerUrl() + '/api/wallet.php',
84 | method: 'GET',
85 | header: {
86 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
87 | },
88 | success: function (res) {
89 | if (parseInt(res.data.err) == 0) {
90 |
91 | that.setData({
92 | result: res.data.result
93 | });
94 | if(!res.data.canearncoin)that.startTimer();
95 | }else{
96 | wx.showModal({
97 | title: '',
98 | content: res.data.msg,
99 | showCancel:false
100 | })
101 | }
102 | }
103 | });
104 | },
105 | startTimer:function(){
106 | var that=this;
107 |
108 | function updateCountDown(){
109 | var totalSec = 3600 - that.data.result.distancetime;
110 | if (totalSec<0){
111 | console.log("倒计时结束");
112 | result=that.data.result;
113 | result.canearncoin=true;
114 | that.setData({
115 | result: result
116 | });
117 | clearInterval(timer);
118 | return;
119 | }
120 | var disminute = Math.floor(totalSec / 60);
121 | var dissec = (totalSec % 60);
122 | var distancetimestr = disminute + "分" + dissec + "秒";
123 | if (disminute<=0){
124 | distancetimestr = dissec + "秒";
125 | }
126 |
127 | var result = that.data.result;
128 | result.distancetime = parseInt(result.distancetime)+1;
129 | that.setData({
130 | distancetimestr: distancetimestr,
131 | result: result
132 | });
133 | }
134 | updateCountDown();
135 | if (timer) clearInterval(timer);
136 | timer = setInterval(updateCountDown,1000);
137 | },
138 | updateHistory:function(page=0){
139 | var that = this;
140 | wx.showLoading({
141 | title: '请求中',
142 | mask: true
143 | })
144 | wx.request({
145 | url: app.ServerUrl() + '/api/coinhistorylist.php',
146 | method: 'POST',
147 | header: {
148 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
149 | },
150 | data: {
151 | page: page,
152 | token: app.globalData.token
153 | },
154 | complete: function (res) {
155 | wx.hideLoading();
156 | wx.stopPullDownRefresh();
157 | },
158 | success: function (res) {
159 | if (parseInt(res.data.err) == 0) {
160 | var newlist = res.data.result;
161 | var list = [];
162 | if (page <= 0) {
163 | list = newlist;
164 | } else {
165 | list = that.data.list.concat(newlist);
166 | }
167 |
168 | that.setData({
169 | list: list,
170 | page: page,
171 | canloadmore: newlist.length >= 10
172 | });
173 | }
174 | }
175 | });
176 | },
177 | onLoad: function (options) {
178 | var that = this;
179 |
180 | if (app.globalData.userInfo == null) {
181 | wx.getSetting({
182 | success: function (res) {
183 | if (res.authSetting['scope.userInfo']) {
184 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称
185 | wx.getUserInfo({
186 | success: function (res) {
187 | app.login(function () {
188 | that.setData({ userInfo: app.globalData.userInfo });
189 | that.updateWallet();
190 | that.updateHistory();
191 | });
192 | }
193 | })
194 | }
195 | }
196 | })
197 | } else {
198 | that.setData({ userInfo: app.globalData.userInfo });
199 | that.updateWallet();
200 | that.updateHistory();
201 | console.log(app.globalData.userInfo);
202 | }
203 | },
204 |
205 | /**
206 | * 生命周期函数--监听页面初次渲染完成
207 | */
208 | onReady: function () {
209 |
210 | },
211 |
212 | /**
213 | * 生命周期函数--监听页面显示
214 | */
215 | onShow: function () {
216 |
217 | },
218 |
219 | /**
220 | * 生命周期函数--监听页面隐藏
221 | */
222 | onHide: function () {
223 |
224 | },
225 |
226 | /**
227 | * 生命周期函数--监听页面卸载
228 | */
229 | onUnload: function () {
230 | clearInterval(timer);
231 | },
232 |
233 | /**
234 | * 页面相关事件处理函数--监听用户下拉动作
235 | */
236 | onPullDownRefresh: function () {
237 |
238 | },
239 |
240 | /**
241 | * 页面上拉触底事件的处理函数
242 | */
243 | onReachBottom: function () {
244 |
245 | },
246 |
247 | /**
248 | * 用户点击右上角分享
249 | */
250 | onShareAppMessage: function () {
251 | return app.getMainAppShare();
252 | }
253 | })
--------------------------------------------------------------------------------
/src/pages/luckydraw/awardsaddress.js:
--------------------------------------------------------------------------------
1 | // pages/luckydraw/alljoiner.js
2 | const app = getApp();
3 | var util = require('../../utils/util.js');
4 | Page({
5 |
6 | /**
7 | * 页面的初始数据
8 | */
9 | data: {
10 | list: [],
11 | page: 0,
12 | canloadmore: false,
13 | inputShowed: false,
14 | inputVal: "",
15 | searchResult: [],
16 | showDetail:false,
17 | detailIndex:0,
18 | },
19 | btnLoadMore: function () {
20 | if (this.data.canloadmore) {
21 | this.data.page += 1;
22 | this.updateJoins(this.data.page);
23 | }
24 | },
25 | inputExpressNo:function(e){
26 | var that=this;
27 |
28 | var list=that.data.list;
29 | var item = list[that.data.detailIndex];
30 | item.expressno=e.detail.value
31 | that.setData({
32 | list: list
33 | });
34 | },
35 | inputExpressRemark:function(e){
36 | var that = this;
37 |
38 | var list = that.data.list;
39 | var item = list[that.data.detailIndex];
40 | item.expressremark = e.detail.value
41 | that.setData({
42 | list: list
43 | });
44 | },
45 | btnBack:function(){
46 | var that=this;
47 | that.setData({
48 | showDetail:false
49 | });
50 | },
51 | btnCopyAddress:function(){
52 | var that=this;
53 |
54 | var item = that.data.list[that.data.detailIndex];
55 |
56 | var copyinfo = item.expressaddress.provinceName + item.expressaddress.cityName + item.expressaddress.countyName + item.expressaddress.detailInfo + ",收件人:" + item.expressaddress.userName + ",电话:" + item.expressaddress.telNumber;
57 | wx.setClipboardData({
58 | data: copyinfo,
59 | });
60 | wx.showToast({
61 | title: '已复制到剪贴板',
62 | })
63 | },
64 | btnSaveExpressInfo:function(){
65 | var that=this;
66 | var item = that.data.list[that.data.detailIndex];
67 |
68 | wx.showModal({
69 | title: '',
70 | content: '保存后会给中奖者发送快递信息,确认保存吗?',
71 | success:function(res){
72 | if(res.confirm){
73 | readySave();
74 | }
75 | }
76 | })
77 |
78 | function readySave(){
79 | wx.request({
80 | url: app.ServerUrl() + '/api/postexpressno.php',
81 | method: 'POST',
82 | header: {
83 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
84 | },
85 | data: {
86 | id: item.id,
87 | expressno: item.expressno,
88 | expressremark: item.expressremark
89 | },
90 | success: function (res) {
91 | wx.hideLoading();
92 | if (parseInt(res.data.err) == 0) {
93 | wx.showToast({
94 | title: res.data.msg,
95 | })
96 | that.setData({
97 | showDetail: false
98 | });
99 | } else {
100 | wx.showModal({
101 | title: '',
102 | content: res.data.msg,
103 | showCancel: false
104 | })
105 | }
106 | }
107 | });
108 | }
109 | },
110 | sendGetAwardNotice:function(openid){
111 | var that=this;
112 | wx.request({
113 | url: app.ServerUrl() + '/api/sendgetawardnotice.php',
114 | method: 'POST',
115 | header: {
116 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
117 | },
118 | data: {
119 | id: that.data.id,
120 | openid: openid
121 | },
122 | success: function (res) {
123 | wx.showToast({
124 | title:res.data.msg
125 | })
126 | }
127 | });
128 | },
129 | btnShowAddress:function(e){
130 | var that=this;
131 | var item = that.data.list[e.currentTarget.dataset.index];
132 | if (item.expressaddress){
133 | this.setData({
134 | showDetail: true,
135 | detailIndex: e.currentTarget.dataset.index
136 | });
137 | }else{
138 | wx.showModal({
139 | title: '',
140 | content: '是否给该用户发送中奖通知?',
141 | success:function(res){
142 | if(res.confirm){
143 | that.sendGetAwardNotice(item.ownerid);
144 | }
145 | }
146 | })
147 | }
148 | },
149 | showInput: function () {
150 | this.setData({
151 | inputShowed: true
152 | });
153 | },
154 | hideInput: function () {
155 | this.setData({
156 | inputVal: "",
157 | inputShowed: false
158 | });
159 | this.updateJoins(0, this.data.type, this.data.inputVal);
160 | },
161 | clearInput: function () {
162 | this.setData({
163 | inputVal: ""
164 | });
165 | this.updateJoins(0, this.data.type, this.data.inputVal);
166 | },
167 | inputTyping: function (e) {
168 | if (util.trimStr(e.detail.value) != "") {
169 | this.setData({
170 | inputVal: util.trimStr(e.detail.value)
171 | });
172 | this.updateJoins(0, this.data.type, util.trimStr(e.detail.value));
173 | } else {
174 | this.clearInput();
175 | }
176 | },
177 | updateJoins: function (page = 0, type = 0, kw = "") {
178 | var that = this;
179 | wx.request({
180 | url: app.ServerUrl() + '/api/getluckydrawjoins.php',
181 | method: 'GET',
182 | header: {
183 | 'Cookie': 'PHPSESSID=' + app.globalData.sessionid
184 | },
185 | data: {
186 | id: that.data.id,
187 | keyword: that.data.inputVal,
188 | type: 2,
189 | page: page
190 | },
191 | success: function (res) {
192 | if (parseInt(res.data.err) == 0) {
193 | var newlist = res.data.result;
194 |
195 | var list = [];
196 | if (page <= 0) {
197 | list = newlist;
198 | } else {
199 | list = that.data.list.concat(newlist);
200 | }
201 |
202 | that.setData({
203 | list: list,
204 | page: page,
205 | canloadmore: newlist.length >= 10
206 | });
207 | }
208 | }
209 | });
210 | },
211 | /**
212 | * 生命周期函数--监听页面加载
213 | */
214 | onLoad: function (options) {
215 | this.setData({
216 | id: options.id
217 | });
218 | this.updateJoins();
219 | },
220 |
221 | /**
222 | * 生命周期函数--监听页面初次渲染完成
223 | */
224 | onReady: function () {
225 |
226 | },
227 |
228 | /**
229 | * 生命周期函数--监听页面显示
230 | */
231 | onShow: function () {
232 |
233 | },
234 |
235 | /**
236 | * 生命周期函数--监听页面隐藏
237 | */
238 | onHide: function () {
239 |
240 | },
241 |
242 | /**
243 | * 生命周期函数--监听页面卸载
244 | */
245 | onUnload: function () {
246 |
247 | },
248 |
249 | /**
250 | * 页面相关事件处理函数--监听用户下拉动作
251 | */
252 | onPullDownRefresh: function () {
253 |
254 | },
255 |
256 | /**
257 | * 页面上拉触底事件的处理函数
258 | */
259 | onReachBottom: function () {
260 |
261 | },
262 |
263 | /**
264 | * 用户点击右上角分享
265 | */
266 | onShareAppMessage: function () {
267 | return app.getMainAppShare();
268 | }
269 | })
--------------------------------------------------------------------------------