├── .idea ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── modules.xml ├── watcherTasks.xml ├── workspace.xml └── 答题.iml ├── app.js ├── app.json ├── app.wxss ├── pages ├── answer │ ├── answer.js │ ├── answer.wxml │ └── answer.wxss ├── answerResult │ ├── answerResult.js │ ├── answerResult.wxml │ └── answerResult.wxss ├── challenge │ ├── challenge.js │ ├── challenge.wxml │ └── challenge.wxss ├── friend │ ├── friend.js │ ├── friend.wxml │ └── friend.wxss ├── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── info │ ├── info.js │ ├── info.wxml │ └── info.wxss ├── jackpot │ ├── jackpot.js │ ├── jackpot.wxml │ └── jackpot.wxss ├── jackpotTime │ ├── jackpotTime.js │ ├── jackpotTime.wxml │ └── jackpotTime.wxss ├── prize │ ├── prize.js │ ├── prize.wxml │ └── prize.wxss ├── recharge │ ├── recharge.js │ ├── recharge.wxml │ └── recharge.wxss ├── store │ ├── store.js │ ├── store.wxml │ └── store.wxss ├── storeRecord │ ├── storeRecord.js │ ├── storeRecord.wxml │ └── storeRecord.wxss └── succeed │ ├── succeed.js │ ├── succeed.wxml │ └── succeed.wxss ├── project.config.json └── utils ├── citys.js └── util.js /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 39 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/watcherTasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | 73 | sub 74 | myGrade 75 | record 76 | console 77 | this 78 | @ 79 | 0 80 | 81 | 82 | 83 | 129 | 130 | 131 | 132 | 133 | true 134 | 135 | false 136 | true 137 | true 138 | 139 | 140 | true 141 | DEFINITION_ORDER 142 | 143 | 144 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 6 | 7 | 8 | 电话 9 | 10 | 11 | 12 | 所在地 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 取消 22 | 确定 23 | 24 | 25 | {{item}} 26 | 27 | 28 | {{item}} 29 | 30 | 31 | {{item}} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /pages/info/info.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | background-image: none; 3 | padding: 0; 4 | } 5 | .container{ 6 | padding: 0; 7 | color: #111; 8 | } 9 | 10 | 11 | .item{ 12 | height: 99rpx; 13 | line-height: 99rpx; 14 | width: 100%; 15 | position: relative; 16 | border-bottom: 1rpx solid rgb(153,153,153); 17 | } 18 | .item text{ 19 | position: absolute; 20 | left: 20rpx; 21 | } 22 | .item input{ 23 | display: block; 24 | line-height: 99rpx; 25 | height: 99rpx; 26 | position: absolute; 27 | left: 0; 28 | margin-left: 150rpx; 29 | } 30 | .item .itemAdd{ 31 | width: 100%; 32 | position: absolute; 33 | right: 20rpx; 34 | top: 50%; 35 | transform: translateY(-50%); 36 | } 37 | .item .itemAdd input{ 38 | display: block; 39 | color: rgb(153,153,153); 40 | position: absolute; 41 | top: 50%; 42 | right: 30rpx; 43 | transform: translateY(-50%); 44 | text-align: right; 45 | } 46 | .item .itemAdd image{ 47 | width: 16rpx; 48 | height: 31rpx; 49 | position: absolute; 50 | right: 0; 51 | top: 50%; 52 | transform: translateY(-50%); 53 | } 54 | .citypicker{ 55 | width: 100%; 56 | height: 500rpx; 57 | position: fixed; 58 | bottom: 0; 59 | left: 0; 60 | } 61 | .city-cancel,.city-true{ 62 | position: absolute; 63 | z-index: 999; 64 | top: 80rpx; 65 | } 66 | .city-cancel{ 67 | left: 50rpx; 68 | } 69 | .city-true{ 70 | right: 50rpx; 71 | } 72 | picker-view{ 73 | background-color: #fff; 74 | width: 100%; 75 | height: 380rpx; 76 | bottom: 0; 77 | position:fixed; 78 | } 79 | 80 | picker-view-column view{ 81 | width: 100%; 82 | vertical-align:middle; 83 | line-height: 28rpx; 84 | height: 100%; 85 | display: flex; 86 | align-items: center; 87 | justify-content: center; 88 | } 89 | 90 | .item:nth-last-child(2){ 91 | border-bottom: none; 92 | } 93 | .item:nth-last-child(2) input{ 94 | 95 | width: 98%; 96 | display: block; 97 | margin-left: 20rpx; 98 | } 99 | 100 | button{ 101 | box-sizing: border-box; 102 | display: block; 103 | width: 690rpx; 104 | height: 80rpx; 105 | line-height: 80rpx; 106 | background-color: rgb(253,137,0); 107 | color: #fff; 108 | font-size: 36rpx; 109 | margin-top: 70rpx; 110 | } 111 | 112 | /*弹框*/ 113 | .mode{ 114 | width: 100%; 115 | height: 100%; 116 | background-color: rgba(0,0,0,.2); 117 | position: fixed; 118 | top: 50%; 119 | left: 50%; 120 | transform: translate(-50%,-50%); 121 | z-index: 9; 122 | } 123 | .mode .modeBox{ 124 | width: 550rpx; 125 | height: 250rpx; 126 | background-color: #fff; 127 | margin: 400rpx auto; 128 | color: #666; 129 | padding: 40rpx 0; 130 | box-sizing: border-box; 131 | text-align: center; 132 | border-radius: 10rpx; 133 | } 134 | .mode .modeBox text{ 135 | display: block; 136 | margin-bottom: 20rpx; 137 | } 138 | .mode .modeBox>view{ 139 | margin: auto; 140 | width: 100rpx; 141 | height: 50rpx; 142 | margin-top: 40rpx; 143 | background-color: rgb(253,137,0); 144 | border-radius: 10rpx; 145 | color: #fff; 146 | line-height: 50rpx; 147 | } -------------------------------------------------------------------------------- /pages/jackpot/jackpot.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | 3 | Page({ 4 | data: { 5 | hidden:false, 6 | nav:["他们都来了,你呢?","你敢来智商比试么,谁输就真心话大冒险","智慧担当在此,你能超过我吗?","点识成金,答题赢奖,点击进入,和我一起..."], 7 | user_id:"", 8 | user_money:"" 9 | }, 10 | onLoad: function (options) { 11 | // 获取用户id 12 | this.setData({ 13 | user_id:options.user_id, 14 | user_money:options.user_money 15 | }); 16 | 17 | 18 | wx.setNavigationBarTitle({ 19 | title: '奖池赛' 20 | }); 21 | 22 | 23 | }, 24 | toGame:function () { 25 | if(this.data.user_money >= 200){ 26 | //一开始进入页面获取用户id 27 | wx.navigateTo({ 28 | url: '../prize/prize?user_id='+this.data.user_id 29 | }) 30 | }else { 31 | wx.showToast({ 32 | title:"您的金币不足", 33 | duration: 2000 34 | }) 35 | } 36 | 37 | }, 38 | 39 | modalHide:function () { 40 | this.setData({ 41 | hidden:true 42 | }) 43 | }, 44 | 45 | onShareAppMessage: function (res) { 46 | let num = Math.round(Math.random(0,1)*3); 47 | return{ 48 | title:this.data.nav[num], 49 | path:"/pages/index/index" 50 | } 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /pages/jackpot/jackpot.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 手速快 知识广 就能赢大奖 4 | 5 | 8 | 9 | 奖池已累积: 10 | 90,000 11 | 12 | 13 | 14 | 参赛消耗200智币 15 | 16 | 17 | 18 | 立即参赛 19 | 20 | 21 | 22 | 23 | 30 | -------------------------------------------------------------------------------- /pages/jackpot/jackpot.wxss: -------------------------------------------------------------------------------- 1 | .container{ 2 | position: relative; 3 | } 4 | .head{ 5 | font-family:"PingFang-SC-Regular"; 6 | font-size: 30rpx; 7 | color: white; 8 | margin-top: 30rpx; 9 | text-align: center; 10 | } 11 | .banner{ 12 | text-align: center; 13 | margin-top: 50rpx; 14 | } 15 | .accumulate{ 16 | font-family:"PingFang-SC-Regular"; 17 | font-size: 30rpx; 18 | color: white; 19 | text-align: center; 20 | width: 276rpx; 21 | height: 30rpx; 22 | margin: 30rpx auto; 23 | margin-bottom: 13rpx; 24 | } 25 | .news { 26 | text-align: center; 27 | font-size: 20rpx; 28 | color: rgb(255,125,46); 29 | font-family: "PingFang-SC-Light"; 30 | } 31 | .news image{ 32 | height: 20rpx; 33 | width: 20rpx; 34 | vertical-align: middle; 35 | } 36 | .news text{ 37 | padding-left: 13rpx; 38 | } 39 | .game{ 40 | width: 240rpx; 41 | height: 240rpx; 42 | margin: 50rpx auto; 43 | margin-bottom: 15rpx; 44 | position: relative; 45 | line-height: 240rpx; 46 | text-align: center; 47 | color: #4d44a3; 48 | font-size: 34rpx; 49 | 50 | } 51 | .game image{ 52 | width: 100%; 53 | height: 100%; 54 | position: absolute; 55 | top: 0; 56 | left: 0; 57 | z-index: -1; 58 | } 59 | .invite button{ 60 | background-color: #fb6c4a; 61 | width: 280rpx; 62 | height: 80rpx; 63 | border-radius: 10rpx; 64 | margin: 0 auto; 65 | text-align: center; 66 | line-height: 80rpx; 67 | color: white; 68 | margin-bottom: 10rpx; 69 | font-size: 34rpx; 70 | } 71 | .good{ 72 | font-family: "PingFang-SC-Regular"; 73 | font-size: 24rpx; 74 | margin: 0 auto; 75 | width: 280rpx; 76 | height: 50rpx; 77 | color: white; 78 | text-align: center; 79 | margin-bottom: 50rpx; 80 | } 81 | .modal{ 82 | width: 574rpx; 83 | height: 320rpx; 84 | background-color: white; 85 | font-size: 24rpx; 86 | color: rgb(251,108,74); 87 | box-sizing: border-box; 88 | padding-left: 50rpx; 89 | padding-top: 30rpx; 90 | border-radius: 10rpx; 91 | position: absolute; 92 | top: 50%; 93 | left: 50%; 94 | transform: translateX(-50%) translateY(-50%); 95 | padding-right: 30rpx; 96 | } 97 | .modal text{ 98 | display: block; 99 | line-height: 40rpx; 100 | } 101 | .modal .title{ 102 | font-size: 30rpx; 103 | font-weight: 700; 104 | } -------------------------------------------------------------------------------- /pages/jackpotTime/jackpotTime.js: -------------------------------------------------------------------------------- 1 | const app = getApp() 2 | 3 | Page({ 4 | data: { 5 | time: 5, 6 | userName: "",//用户名 7 | userPic: "" ,//头像链接 8 | user_id:'' 9 | }, 10 | onLoad:function (options) { 11 | this.setData({ 12 | user_id:options.user_id 13 | }) 14 | }, 15 | 16 | onShow: function () { 17 | // 获取用户信息 18 | let that = this; 19 | wx.getUserInfo({ 20 | success: function (res) { 21 | let userInfo = res.userInfo; 22 | let nickName = userInfo.nickName; //用户名 23 | let avatarUrl = userInfo.avatarUrl; //头像链接 24 | that.setData({ 25 | userName: nickName, 26 | userPic: avatarUrl 27 | }) 28 | } 29 | }); 30 | 31 | wx.setNavigationBarTitle({ 32 | title: '答题' 33 | }); 34 | 35 | let num = 0; 36 | let context = wx.createContext(); 37 | let timer = setInterval(_ => { 38 | context.setLineWidth(6); 39 | num = num + 0.004; 40 | context.setStrokeStyle("#DB0EE2"); 41 | context.beginPath(); 42 | context.arc(36, 36, 32, -2 * Math.PI, num * Math.PI, true); 43 | context.stroke(); 44 | wx.drawCanvas({ 45 | canvasId: 'wxCanvasTest1', 46 | actions: context.getActions() 47 | }); 48 | context.setLineWidth(6); 49 | if (num > 2) { 50 | clearInterval(timer); 51 | this.setData({ 52 | time: 0 53 | }); 54 | context.beginPath(); 55 | context.arc(36, 36, 32, 0, 0, false); 56 | context.stroke(); 57 | wx.drawCanvas({ 58 | canvasId: 'wxCanvasTest1', 59 | actions: context.getActions() 60 | }); 61 | } 62 | }, 9); 63 | let time = setInterval(_ => { 64 | this.setData({ 65 | time: this.data.time - 1 66 | }); 67 | if (this.data.time <=1) { 68 | clearInterval(time); 69 | } 70 | }, 999); 71 | setTimeout(_ => { 72 | wx.navigateTo({ 73 | url: '../prize/prize?user_id='+this.data.user_id 74 | }); 75 | setTimeout(_=>{ 76 | this.setData({ 77 | time: 5 78 | }); 79 | },5000) 80 | }, 5000) 81 | 82 | }, 83 | onShareAppMessage: function (res) { 84 | return{ 85 | title:"发起挑战,你一定会错,不信你试试", 86 | path:"/pages/index/index" 87 | } 88 | } 89 | 90 | }); 91 | -------------------------------------------------------------------------------- /pages/jackpotTime/jackpotTime.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{userName}} 5 | 6 | 7 | 100.000 8 | 9 | 唾手可得!撸起柚子开始答题(共10题) 10 | 11 | 12 | {{time}} 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /pages/jackpotTime/jackpotTime.wxss: -------------------------------------------------------------------------------- 1 | 2 | .portrait{ 3 | width: 189rpx; 4 | height: 188rpx; 5 | margin:170rpx auto; 6 | text-align: center; 7 | margin-bottom:100rpx; 8 | } 9 | .portrait image{ 10 | width: 100%; 11 | height: 100%; 12 | border-radius: 50%; 13 | border: 8rpx solid #fff; 14 | } 15 | .portrait .name{ 16 | display: inline-block; 17 | width: 120rpx; 18 | height: 75rpx; 19 | overflow: hidden; 20 | font-size: 30rpx; 21 | color: rgb(251,108,74); 22 | font-family: "PingFang-SC-Regular"; 23 | } 24 | .money{ 25 | width: 750rpx; 26 | height: 35rpx; 27 | font-size: 32rpx; 28 | color:rgb(254,254,254); 29 | line-height: 35rpx; 30 | } 31 | .money image{ 32 | height: 30rpx; 33 | width: 30rpx; 34 | vertical-align: middle; 35 | } 36 | .box{ 37 | margin: 130rpx auto; 38 | width: 56px; 39 | height: 56px; 40 | position: relative; 41 | font-size: 30px; 42 | font-family: "PingFang-SC-Medium"; 43 | color: white; 44 | text-align: center; 45 | line-height: 56px; 46 | border: 8px solid #ffffff; 47 | border-radius: 50%; 48 | } 49 | .box canvas{ 50 | width: 75px; 51 | height: 75px; 52 | position: absolute; 53 | top: -8px; 54 | left:-8px; 55 | } 56 | -------------------------------------------------------------------------------- /pages/prize/prize.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | 3 | 4 | let timer; 5 | Page({ 6 | data: { 7 | userName:"",//用户名 8 | userPic:"", //头像链接 9 | items: "", //题目数据 10 | subject: "", 11 | errorIcon: false, 12 | result: true, /*结果*/ 13 | answer: true, /*全部选项*/ 14 | choose: "", /*选择项*/ 15 | right: "", /*正确选项*/ 16 | count: '', 17 | bg: 'error', /*背景颜色*/ 18 | falg: true, /*节流阀*/ 19 | record: "", /*遍历题目*/ 20 | number: 0, /*题目*/ 21 | titleShow: false, 22 | title: "第一题", 23 | hours: '00', 24 | minutes: '00', 25 | seconds: "00", 26 | success: true, 27 | defeated: true, 28 | user_id:'', 29 | match_id:"", 30 | error:"",//正确或失败的控制 31 | ranking:"",//全答对时名次 32 | prize:"",//用户所省余的金额 33 | navT:["无敌是多么寂寞,轻轻松松拿金币,你敢来挑战我么?","搏一搏,单车变摩托,摩托变汽车~","点识成金,答题赢奖,点击进入,和我一起..."],//成功时分享的内容 34 | navF:["哎呀,宝宝输了,求求你帮我赢金币,给你一个","我都金币都去哪了,还给我...","点识成金,答题赢奖,点击进入,和我一起..."],//失败时分享的内容 35 | }, 36 | onLoad: function (options) { 37 | this.setData({ 38 | user_id:options.user_id, 39 | }); 40 | 41 | let that = this; 42 | wx.request({ 43 | url:"https://dati.51laiding.com/?r=rank/start", 44 | method:"GET", 45 | data:{ 46 | user_id:that.data.user_id 47 | }, 48 | success:function (res) { 49 | that.setData({ 50 | items:res.data.问题, 51 | match_id:res.data.奖池ID 52 | }); 53 | that.setData({ 54 | subject: that.data.items[that.data.number][0].content, 55 | record: that.data.items[that.data.number][1] 56 | }); 57 | } 58 | }); 59 | 60 | //获取用户实时金额 61 | wx.login({ 62 | success: function (e) { 63 | wx.request({ 64 | url: "https://dati.51laiding.com/?r=index/index", 65 | data: { 66 | username: that.data.userName, 67 | photo: that.data.userPic, 68 | code: e.code, 69 | }, 70 | method: "GET", 71 | success: function (res) { 72 | that.setData({ 73 | prize:res.data.用户金币 74 | }) 75 | } 76 | }); 77 | } 78 | }); 79 | 80 | 81 | // 获取用户信息 82 | wx.getUserInfo({ 83 | success: function(res) { 84 | let userInfo = res.userInfo; 85 | let nickName = userInfo.nickName; //用户名 86 | let avatarUrl = userInfo.avatarUrl; //头像链接 87 | that.setData({ 88 | userName: nickName, 89 | userPic:avatarUrl 90 | }) 91 | } 92 | }); 93 | 94 | wx.setNavigationBarTitle({ 95 | title: '奖池赛' 96 | }); 97 | // 初始渲染题目 98 | let second = 0; 99 | let minute = 0; 100 | let hour = 0; 101 | 102 | setTimeout(_ => { 103 | this.setData({ 104 | answer: false, 105 | titleShow: true 106 | }); 107 | // 计时 108 | timer = setInterval(_ => { 109 | second = +second + 1; 110 | second = second > 9 ? second : '0' + second; 111 | this.setData({ 112 | seconds: second 113 | }); 114 | 115 | if (second > 99) { 116 | second = '00'; 117 | this.setData({ 118 | seconds: second 119 | }); 120 | minute = +minute + 1; 121 | minute = minute > 9 ? minute : '0' + minute; 122 | this.setData({ 123 | minutes: minute 124 | }); 125 | } 126 | if (minute > 59) { 127 | minute = "00"; 128 | this.setData({ 129 | minutes: minute 130 | }); 131 | 132 | hour = +hour + 1; 133 | hour = hour > 9 ? hour : '0' + hour; 134 | this.setData({ 135 | hours: hour 136 | }); 137 | } 138 | if (this.data.success === false || this.data.defeated === false) { 139 | clearInterval(timer) 140 | } 141 | }, 10); 142 | }, 1000); 143 | 144 | }, 145 | // 答题 146 | affirm: function (e) { 147 | let that = this; 148 | 149 | if (this.data.falg) { 150 | // 节流阀 151 | this.setData({ 152 | falg: false 153 | }); 154 | 155 | let id = e.currentTarget.dataset.id; 156 | this.setData({ 157 | count: id 158 | }); 159 | for (let i = 0; i < this.data.record.length; i++) { 160 | if (this.data.record[i].name === 'shh') { 161 | this.setData({ 162 | right: this.data.record[i].value, 163 | }); 164 | 165 | if (this.data.count === i) { 166 | this.setData({ 167 | bg: 'correct' 168 | }) 169 | } 170 | if (this.data.count !== i) { 171 | this.setData({ 172 | bg: 'error' 173 | }); 174 | this.setData({ 175 | error:this.data.bg 176 | }) 177 | } 178 | } 179 | } 180 | 181 | setTimeout(_ => { 182 | this.setData({ 183 | result: false, 184 | answer: true, 185 | choose: this.data.record[id].value 186 | }); 187 | if (this.data.choose === this.data.right) { 188 | this.setData({ 189 | errorIcon: true 190 | }) 191 | } 192 | if (this.data.number < that.data.items.length-1) { 193 | // 新一题开始 194 | setTimeout(_ => { 195 | this.setData({ 196 | number: this.data.number + 1, 197 | result: true, 198 | titleShow: false, 199 | errorIcon: false 200 | }); 201 | // 题号对应的中文 202 | switch (this.data.number) { 203 | case 1: 204 | this.setData({ 205 | title: "第二题", 206 | }); 207 | break; 208 | case 2: 209 | this.setData({ 210 | title: "第三题", 211 | }); 212 | break; 213 | case 3: 214 | this.setData({ 215 | title: "第四题", 216 | }); 217 | break; 218 | case 4: 219 | this.setData({ 220 | title: "第五题", 221 | }); 222 | break; 223 | case 5: 224 | this.setData({ 225 | title: "第六题", 226 | }); 227 | break; 228 | case 6: 229 | this.setData({ 230 | title: "第七题", 231 | }); 232 | break; 233 | case 7: 234 | this.setData({ 235 | title: "第八题", 236 | }); 237 | break; 238 | case 8: 239 | this.setData({ 240 | title: "第九题", 241 | }); 242 | break; 243 | case 9: 244 | this.setData({ 245 | title: "最后一题", 246 | }); 247 | break; 248 | } 249 | // 题号对应的中文 250 | this.setData({ 251 | subject: this.data.items[this.data.number][0].content, 252 | record: this.data.items[this.data.number][1], 253 | bg: '', 254 | falg: true 255 | }); 256 | // 题目出现 257 | setTimeout(_ => { 258 | this.setData({ 259 | answer: false, 260 | titleShow: true 261 | }); 262 | }, 1000) 263 | 264 | }, 2000); 265 | } else { 266 | setTimeout(_=>{ 267 | if (this.data.error === 'error') { 268 | //失败时 269 | this.setData({ 270 | defeated: false 271 | }); 272 | 273 | } else { 274 | //成功时 275 | this.setData({ 276 | success: false 277 | }); 278 | wx.request({ 279 | url: "https://dati.51laiding.com/?r=rank/end", 280 | data: { 281 | user_id:that.data.user_id, 282 | use_time: that.data.hours + that.data.minutes + that.data.seconds, 283 | match_id:that.data.match_id 284 | }, 285 | method: "GET", 286 | success: function (res) { 287 | that.setData({ 288 | ranking:res.data 289 | }) 290 | } 291 | }); 292 | } 293 | },1000) 294 | 295 | } 296 | }, 1000) 297 | } 298 | }, 299 | 300 | again:function () { 301 | if(this.data.prize >= 200){ 302 | wx.navigateTo({ 303 | url: '../prize/prize?user_id='+this.data.user_id 304 | }) 305 | }else { 306 | wx.showToast({ 307 | title:"您的金币不足", 308 | duration: 2000 309 | }) 310 | } 311 | }, 312 | close:function () { 313 | wx.navigateTo({ 314 | url: '../index/index' 315 | }) 316 | }, 317 | onShareAppMessage: function (res) { 318 | let num = Math.round(Math.random(0,1)*2); 319 | if (this.data.error === 'error'){ 320 | return{ 321 | title:this.data.navF[num], 322 | path:"/pages/index/index" 323 | } 324 | }else { 325 | return{ 326 | title:this.data.navT[num], 327 | path:"/pages/index/index" 328 | } 329 | } 330 | } 331 | }); 332 | 333 | 334 | 335 | -------------------------------------------------------------------------------- /pages/prize/prize.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{hours}} 6 | : 7 | {{minutes}} 8 | : 9 | {{seconds}} 10 | 11 | 12 | {{userName}} 13 | 14 | 15 | 19 | 29 | 82 | 119 | -------------------------------------------------------------------------------- /pages/prize/prize.wxss: -------------------------------------------------------------------------------- 1 | .head{ 2 | width: 257rpx; 3 | height: 124rpx; 4 | background-color: rgb(211,70,133); 5 | border-radius: 54rpx; 6 | margin: 55rpx auto; 7 | position: relative; 8 | padding-left: 120rpx; 9 | box-sizing: border-box; 10 | line-height: 124rpx; 11 | } 12 | .head image{ 13 | position: absolute; 14 | width: 125rpx; 15 | height: 125rpx; 16 | border-radius: 50%; 17 | border: 8rpx solid #fff; 18 | top: -7rpx; 19 | left: -40rpx; 20 | } 21 | .head .name{ 22 | position: absolute; 23 | font-family: "PingFang-SC-Medium"; 24 | font-size: 30rpx; 25 | color: white; 26 | width: 150rpx; 27 | height: 120rpx; 28 | overflow: hidden; 29 | top: 50%; 30 | transform: translateY(-50%); 31 | } 32 | .head image .time{ 33 | position: absolute; 34 | width: 125rpx; 35 | height: 125rpx; 36 | border-radius: 50%; 37 | top: 0rpx; 38 | left: 0rpx; 39 | background: rgba(0,0,0,.4); 40 | box-sizing: border-box; 41 | text-align: center; 42 | } 43 | .head .time text{ 44 | font-family: "PingFang-SC-Regular"; 45 | font-size: 24rpx; 46 | color: white; 47 | } 48 | .number{ 49 | font-size: 40rpx; 50 | color: white; 51 | font-family: "PingFang-SC-Regular"; 52 | text-align: center; 53 | } 54 | 55 | .answer{ 56 | margin: 0 auto; 57 | margin-top: 69rpx; 58 | width: 500rpx; 59 | position: relative; 60 | } 61 | .answer .problem{ 62 | width: 680rpx; 63 | margin-left: -80rpx; 64 | margin-bottom: 100rpx; 65 | font-size: 36rpx; 66 | color: white; 67 | font-family: "PingFang-SC-Regular"; 68 | text-align:center; 69 | } 70 | .answer button{ 71 | margin-bottom: 20rpx; 72 | color: white; 73 | border: 1px solid #fff; 74 | border-radius: 10rpx; 75 | } 76 | .bg{ 77 | background-color:transparent; 78 | } 79 | .result{ 80 | margin: 0 auto; 81 | margin-top: 100rpx; 82 | width: 500rpx; 83 | } 84 | .result button{ 85 | margin-bottom: 20rpx; 86 | color: white; 87 | position: relative; 88 | border-radius: 10rpx; 89 | } 90 | .result button image{ 91 | width: 45rpx; 92 | height: 45rpx; 93 | position: absolute; 94 | left: 20rpx; 95 | top:20rpx 96 | } 97 | /*正确*/ 98 | .correct{ 99 | background-color: #a3d238; 100 | } 101 | /*错误*/ 102 | .error{ 103 | background-color:#fb6c4a ; 104 | } 105 | 106 | /*挑战成功*/ 107 | .success{ 108 | position: absolute; 109 | top: 0; 110 | left: 50%; 111 | transform: translateX(-50%); 112 | height: 100%; 113 | width: 100%; 114 | background-color: rgba(0,0,0,.7); 115 | } 116 | .success .box{ 117 | margin-top: 180rpx; 118 | } 119 | .success .top{ 120 | margin: 0 auto; 121 | width: 398rpx; 122 | height: 640rpx; 123 | background-color: white; 124 | border-radius: 10rpx; 125 | } 126 | .success .s_head{ 127 | width: 120rpx; 128 | height: 120rpx; 129 | margin-left: 50%; 130 | transform: translateX(-50%) translateY(-50%); 131 | position: relative; 132 | } 133 | .success .s_head image{ 134 | width: 100%; 135 | height: 100%; 136 | position: absolute; 137 | top: 0rpx; 138 | left:0rpx; 139 | z-index: -1; 140 | } 141 | .success .s_head text{ 142 | display: inline-block; 143 | width: 60rpx; 144 | color: white; 145 | font-family: "PingFang-SC-Bold"; 146 | font-size: 30rpx; 147 | margin-left: 50%; 148 | margin-top: 50%; 149 | transform: translateX(-50%) translateY(-50%); 150 | } 151 | .success .s_number{ 152 | margin: 0 auto; 153 | width: 109rpx; 154 | font-family: "PingFang-SC-Regular"; 155 | font-size: 28rpx; 156 | color: rgb(51,51,51); 157 | text-align: center; 158 | } 159 | .red{ 160 | font-family: "PingFang-SC-Medium"; 161 | font-size: 34rpx; 162 | color: rgb(251,108,74); 163 | } 164 | .success .s_time{ 165 | margin:20rpx auto; 166 | text-align: center; 167 | font-family: "PingFang-SC-Regular"; 168 | font-size: 28rpx; 169 | color: rgb(51,51,51); 170 | } 171 | .success .s_ranking{ 172 | margin: 0 auto; 173 | width: 115rpx; 174 | font-family: "PingFang-SC-Regular"; 175 | font-size: 28rpx; 176 | color: rgb(51,51,51); 177 | text-align: center; 178 | } 179 | .success .s_info{ 180 | margin-top: 50rpx; 181 | } 182 | .success .s_info view{ 183 | margin: 0 auto; 184 | height: 30rpx; 185 | font-family: "PingFang-SC-Regular"; 186 | font-size: 24rpx; 187 | color: rgb(153,153,153); 188 | line-height: 30rpx; 189 | text-align: center; 190 | } 191 | .success .s_info view image{ 192 | height: 20rpx; 193 | width: 20rpx; 194 | } 195 | .success .continue{ 196 | width: 239rpx; 197 | height: 239rpx; 198 | margin: 12rpx auto; 199 | position: relative; 200 | } 201 | .success .continue image{ 202 | width: 100%; 203 | height: 100%; 204 | position: absolute; 205 | top: 0; 206 | left: 0; 207 | z-index: -1; 208 | } 209 | .success .continue text{ 210 | width: 180rpx; 211 | position: absolute; 212 | top:50%; 213 | left: 57%; 214 | transform: translateX(-50%) translateY(-50%); 215 | font-size: 36rpx; 216 | color: #615995; 217 | } 218 | .success .button{ 219 | width: 600rpx; 220 | height: 80rpx; 221 | margin: 0 auto; 222 | } 223 | .success .button button{ 224 | width: 278rpx; 225 | height: 80rpx; 226 | color: white; 227 | font-size: 50rpx; 228 | line-height: 80rpx; 229 | } 230 | .success .button button:first-child{ 231 | float: left; 232 | background-color: #f4ac00; 233 | } 234 | .success .button button:last-child{ 235 | float: right; 236 | background-color: #a5cf25; 237 | } 238 | 239 | .last{ 240 | padding-top: 20rpx; 241 | } 242 | 243 | /*挑战失败*/ 244 | .defeated{ 245 | position: absolute; 246 | top: 0; 247 | left: 50%; 248 | transform: translateX(-50%); 249 | height: 100%; 250 | width: 100%; 251 | background-color: rgba(0,0,0,.7); 252 | } 253 | .defeated .box{ 254 | margin-top: 200rpx; 255 | } 256 | .defeated .top{ 257 | margin: 0 auto; 258 | width: 398rpx; 259 | height: 330rpx; 260 | background-color: white; 261 | border-radius: 10rpx; 262 | } 263 | .defeated .s_head{ 264 | width: 120rpx; 265 | height: 120rpx; 266 | margin-left: 50%; 267 | transform: translateX(-50%) translateY(-50%); 268 | position: relative; 269 | } 270 | .defeated .s_head image{ 271 | width: 100%; 272 | height: 100%; 273 | position: absolute; 274 | top: 0rpx; 275 | left:0rpx; 276 | z-index: -1; 277 | } 278 | .defeated .s_head text{ 279 | display: inline-block; 280 | width: 60rpx; 281 | color: white; 282 | font-family: "PingFang-SC-Bold"; 283 | font-size: 30rpx; 284 | margin-left: 50%; 285 | margin-top: 50%; 286 | transform: translateX(-50%) translateY(-50%); 287 | } 288 | 289 | .defeated .s_info view{ 290 | margin: 0 auto; 291 | height: 30rpx; 292 | font-family: "PingFang-SC-Regular"; 293 | font-size: 24rpx; 294 | color: rgb(153,153,153); 295 | line-height: 30rpx; 296 | text-align: center; 297 | } 298 | .defeated .s_info view image{ 299 | height: 20rpx; 300 | width: 20rpx; 301 | } 302 | .defeated .continue{ 303 | width: 239rpx; 304 | height: 239rpx; 305 | margin: 12rpx auto; 306 | position: relative; 307 | box-sizing: border-box; 308 | } 309 | .defeated .continue image{ 310 | width: 100%; 311 | height: 100%; 312 | position: absolute; 313 | top: 0; 314 | left: 0; 315 | z-index: -1; 316 | } 317 | .defeated .continue text{ 318 | width: 180rpx; 319 | position: absolute; 320 | top:50%; 321 | left: 57%; 322 | font-size: 36rpx; 323 | color: #615995; 324 | transform: translateX(-50%) translateY(-50%); 325 | } 326 | .defeated .button{ 327 | width: 600rpx; 328 | height: 80rpx; 329 | margin: 0 auto; 330 | } 331 | .defeated .button button{ 332 | width: 278rpx; 333 | height: 80rpx; 334 | color: white; 335 | font-size: 50rpx; 336 | line-height: 80rpx; 337 | } 338 | .defeated .button button:first-child{ 339 | float: left; 340 | background-color: #f4ac00; 341 | } 342 | .defeated .button button:last-child{ 343 | float: right; 344 | background-color: #a5cf25; 345 | } 346 | .defeated .sorry{ 347 | font-family: "PingFang-SC-Regular"; 348 | font-size: 22rpx; 349 | color: rgb(51,51,51); 350 | text-align: center; 351 | margin-top: 30rpx; 352 | } -------------------------------------------------------------------------------- /pages/recharge/recharge.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data:{ 3 | hidden:true, 4 | jinbi:"", 5 | money:"", 6 | open_id:"", 7 | user_id:"" 8 | }, 9 | onLoad: function (options) { 10 | //获取用户OPEN_ID 11 | this.setData({ 12 | open_id:options.OPEN_ID, 13 | user_id:options.user_id 14 | }); 15 | 16 | wx.setNavigationBarTitle({ 17 | title: '充值礼包' 18 | }) 19 | }, 20 | //点击对应的充值弹出对应的模态框 21 | getModule:function (e) { 22 | this.setData({ 23 | hidden: false, 24 | jinbi:e.target.dataset.jb, 25 | money:e.target.dataset.money 26 | }); 27 | }, 28 | //点击关闭充值的模态框 29 | getClose:function () { 30 | this.setData({ 31 | hidden: true 32 | }); 33 | }, 34 | //支付功能 35 | getShopping:function () { 36 | let that = this; 37 | wx.request({ 38 | url:"https://dati.51laiding.com/?r=recharge/zhifu&openid="+that.data.open_id+"&total_fee="+that.data.money,//后台地址 39 | method:"POST", 40 | success:function (res) { 41 | if(res.data){ 42 | wx.requestPayment({ 43 | 'timeStamp': res.data.timeStamp, //时间戳 44 | 'nonceStr': res.data.nonceStr, //商户号(随机数,长度为32位以下,字符串) 45 | 'package': res.data.package, //后台返回的prepay_id 46 | 'signType': res.data.signType, //写死MD5,现只支持这个 47 | 'paySign': res.data.sign, //签名 48 | 'success':function(res){ 49 | //支付成功时的回调 50 | wx.request({ 51 | url:"https://dati.51laiding.com/?r=recharge/payok", 52 | data:{ 53 | jinbi:that.data.jinbi, 54 | user_id:that.data.user_id 55 | }, 56 | method:"GET", 57 | success:function () { 58 | //充值成功后关闭模态框 59 | that.setData({ 60 | hidden:true 61 | }); 62 | //微信自带的模态框,告诉用户充值成功 63 | wx.showToast({ 64 | title:"充值成功", 65 | duration:2000 66 | }); 67 | //充值成功后重定向到首页 68 | setTimeout(function () { 69 | wx.redirectTo({ 70 | url:"../index/index" 71 | }) 72 | },2000) 73 | } 74 | }); 75 | }, 76 | 'fail':function(res){ 77 | //失败时的回调 78 | wx.showToast({ 79 | title:"您已取消充值", 80 | duration:2000 81 | }) 82 | } 83 | }) 84 | } 85 | } 86 | }) 87 | } 88 | }); -------------------------------------------------------------------------------- /pages/recharge/recharge.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 39 | -------------------------------------------------------------------------------- /pages/recharge/recharge.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | padding: 0 20rpx; 3 | padding-bottom: 100rpx; 4 | } 5 | .container{ 6 | background-color: #fff; 7 | padding:5rpx 10rpx; 8 | border-radius: 10rpx; 9 | } 10 | /*顶部*/ 11 | .head{ 12 | width: 690rpx; 13 | height: 280rpx; 14 | box-sizing: border-box; 15 | } 16 | .head>image{ 17 | width: 690rpx; 18 | height: 280rpx; 19 | border-radius: 10rpx; 20 | } 21 | 22 | /*内容*/ 23 | .main{ 24 | width: 100%; 25 | margin-top: 24rpx; 26 | text-align: center; 27 | } 28 | .main .firstMain image{ 29 | width: 210rpx; 30 | height: 255rpx; 31 | } 32 | .main .firstMain image:nth-child(2) { 33 | margin: 0 28rpx; 34 | } 35 | .main .secondMain image{ 36 | width: 232rpx; 37 | height: 293rpx; 38 | margin-top: 28rpx; 39 | } 40 | .main .secondMain image:first-child{ 41 | margin-right: 28rpx; 42 | } 43 | .main .lastMain image{ 44 | width: 277rpx; 45 | height: 350rpx; 46 | margin-top: 25rpx; 47 | margin-bottom: 30rpx; 48 | } 49 | 50 | /*模态框*/ 51 | .module{ 52 | position: fixed; 53 | top: 0; 54 | left: 0; 55 | width: 100%; 56 | height: 100%; 57 | background-color: rgba(251,251,251,0.2); 58 | } 59 | .module .mode{ 60 | position: absolute; 61 | top:50%; 62 | left: 50%; 63 | transform: translate(-50%,-50%); 64 | width: 397rpx; 65 | height: 467rpx; 66 | background-color: #fff; 67 | border-radius: 10rpx; 68 | } 69 | .module .mode .ball{ 70 | width: 120rpx; 71 | height: 120rpx; 72 | position: absolute; 73 | left: 50%; 74 | transform: translateX(-50%); 75 | top: -60rpx; 76 | } 77 | .module .mode .close{ 78 | width: 24rpx; 79 | height: 24rpx; 80 | position: absolute; 81 | top:18rpx; 82 | right: 17rpx; 83 | } 84 | .module .mode .money{ 85 | text-align: center; 86 | width: 100%; 87 | position: absolute; 88 | top:50%; 89 | left: 50%; 90 | transform: translate(-50%,-50%); 91 | } 92 | .module .mode .money image{ 93 | width: 38rpx; 94 | height: 38rpx; 95 | margin-right:22rpx; 96 | } 97 | .module .mode .money text{ 98 | color: rgb(255,168,0); 99 | font-size: 50rpx; 100 | font-weight: 700; 101 | } 102 | .module .mode .btn{ 103 | position: absolute; 104 | left: 50rpx; 105 | bottom: 42rpx; 106 | width: 300rpx; 107 | height: 60rpx; 108 | background-color: rgb(255,168,0); 109 | font-size: 36rpx; 110 | border-radius: 10rpx; 111 | text-align: center; 112 | line-height: 60rpx; 113 | } -------------------------------------------------------------------------------- /pages/store/store.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data:{ 3 | list:"", 4 | user_id:"", 5 | total_money:"" 6 | }, 7 | onLoad: function (options) { 8 | // 获取用户id 9 | this.setData({ 10 | user_id:options.user_id, 11 | total_money:options.total_money 12 | }); 13 | 14 | wx.setNavigationBarTitle({ 15 | title: '积分商城' 16 | }); 17 | let that = this; 18 | wx.request({ 19 | url:"https://dati.51laiding.com/?r=goods", 20 | method:"GET", 21 | success:function (res) { 22 | that.setData({ 23 | list:res.data 24 | }); 25 | } 26 | }); 27 | }, 28 | //点击兑换 29 | getInfo:function (e) { 30 | if(this.data.total_money > e.target.dataset.prize){ 31 | wx.navigateTo({ 32 | url:'../info/info?goods_id='+e.currentTarget.id+"&user_id="+this.data.user_id+"&prize="+e.target.dataset.prize 33 | }) 34 | }else { 35 | wx.showToast({ 36 | title:"您的智币不足", 37 | duration:2000 38 | }) 39 | } 40 | 41 | }, 42 | //我所兑换的商品 43 | getRecord:function () { 44 | wx.navigateTo({ 45 | url:'../storeRecord/storeRecord?user_id='+this.data.user_id 46 | }) 47 | } 48 | }); -------------------------------------------------------------------------------- /pages/store/store.wxml: -------------------------------------------------------------------------------- 1 | 2 | 我的兑换 3 | 4 | 5 | 6 | 7 | 8 | {{list[index].goods_name}} 9 | 10 | 智币:{{list[index].goods_price}} 11 | 兑换 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /pages/store/store.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | background-image: none; 3 | padding: 0; 4 | } 5 | .container{ 6 | padding: 0; 7 | } 8 | .exchange{ 9 | color: #111; 10 | position: absolute; 11 | top: 0; 12 | right: 20rpx; 13 | } 14 | /*商品*/ 15 | .goods{ 16 | margin-top: 60rpx; 17 | } 18 | .goods .item{ 19 | box-sizing: border-box; 20 | padding-left: 6rpx; 21 | } 22 | .goods .itemInfo image{ 23 | width: 275rpx; 24 | height: 273rpx; 25 | } 26 | .goods .item .itemInfo:nth-child(even){ 27 | border-left: none; 28 | } 29 | .goods .item .itemInfo{ 30 | float: left; 31 | border: 1rpx solid #eee; 32 | /*border-top: none;*/ 33 | width: 370rpx; 34 | height: 550rpx; 35 | box-sizing: border-box; 36 | position: relative; 37 | text-align: center; 38 | padding: 30rpx 20rpx; 39 | } 40 | .goods .itemInfo .title{ 41 | margin-top: 30rpx; 42 | width: 100%; 43 | color: #333; 44 | display: -webkit-box; 45 | -webkit-box-orient: vertical; 46 | -webkit-line-clamp: 3; 47 | overflow: hidden; 48 | } 49 | .goods .itemInfo .money{ 50 | width: 100%; 51 | color: #ff0000; 52 | position: absolute; 53 | bottom: 70rpx; 54 | left: 50%; 55 | transform: translateX(-50%); 56 | } 57 | .goods .itemInfo .money .zb{ 58 | position: absolute; 59 | left: 10rpx; 60 | 61 | } 62 | .goods .money .zb text{ 63 | font-size: 32rpx; 64 | } 65 | .goods .itemInfo .money .exBtn{ 66 | width: 115rpx; 67 | height: 50rpx; 68 | background-color: #ff0000; 69 | border-radius: 50rpx; 70 | position: absolute; 71 | right: 10rpx; 72 | line-height: 50rpx; 73 | color: #fff; 74 | } 75 | -------------------------------------------------------------------------------- /pages/storeRecord/storeRecord.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data:{ 3 | infoList:"", 4 | count:"" 5 | }, 6 | onLoad: function (options) { 7 | 8 | wx.setNavigationBarTitle({ 9 | title: '我的兑换' 10 | }); 11 | 12 | let that = this; 13 | wx.request({ 14 | url: "https://dati.51laiding.com/?r=goods/order", 15 | data: { 16 | user_id:options.user_id 17 | }, 18 | method: "GET", 19 | success: function (res) { 20 | that.setData({ 21 | infoList:res.data 22 | }) 23 | } 24 | }); 25 | }, 26 | getUser:function (e) { 27 | let id = e.currentTarget.dataset.id; 28 | this.setData({ 29 | count:id 30 | }) 31 | } 32 | }); -------------------------------------------------------------------------------- /pages/storeRecord/storeRecord.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{infoList[index].goods_name}} 8 | {{infoList[index].order_time}} 9 | 10 | {{infoList[index].goods_price}}智币 11 | {{infoList[index].msg}} 12 | 13 | 14 | 15 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /pages/storeRecord/storeRecord.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | background-image: none; 3 | padding: 0; 4 | background-color: #eee; 5 | } 6 | .container{ 7 | padding: 0; 8 | } 9 | 10 | .item{ 11 | background-color: #fff; 12 | border-top: 1rpx solid #eee; 13 | margin-bottom: 5rpx; 14 | } 15 | .item .goods{ 16 | width: 100%; 17 | height: 180rpx; 18 | position: relative; 19 | color: #111; 20 | } 21 | .item .goods image{ 22 | width: 145rpx; 23 | height: 145rpx; 24 | position: absolute; 25 | left: 15rpx; 26 | top: 50%; 27 | transform: translateY(-50%); 28 | } 29 | .item .goods>view{ 30 | width: 530rpx; 31 | position: absolute; 32 | left: 200rpx; 33 | margin-top: 15rpx; 34 | } 35 | .item .time{ 36 | float: left; 37 | } 38 | .item .time:first-child{ 39 | width: 370rpx; 40 | } 41 | .item .time:last-child{ 42 | color: #eee; 43 | } 44 | .item .money{ 45 | position: absolute; 46 | right: 0; 47 | color: rgb(153,153,153); 48 | } 49 | .item .user{ 50 | margin-top: 20rpx; 51 | background-color: #fff; 52 | color: rgb(153,153,153); 53 | margin-left: 200rpx; 54 | padding-bottom: 10rpx; 55 | } 56 | .item .state{ 57 | position: absolute; 58 | right: 0; 59 | top: 40rpx; 60 | color:red; 61 | } 62 | .none{ 63 | display: none; 64 | } -------------------------------------------------------------------------------- /pages/succeed/succeed.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data:{ 3 | nav:["更多意想不到【礼品】,尽在点识成金!","重磅消息!一筐金币,一箱金币,一车金币,带回家~","哇!我的知识竟然能换到大礼品","点识成金,答题赢奖,点击进入,和我一起..."] 4 | }, 5 | onShareAppMessage: function (res) { 6 | let num = Math.round(Math.random(0,1)*3); 7 | return{ 8 | title:this.data.nav[num], 9 | path:"/pages/index/index" 10 | } 11 | }, 12 | getClose:function () { 13 | wx.navigateTo({ 14 | url:'../index/index' 15 | }) 16 | } 17 | }) -------------------------------------------------------------------------------- /pages/succeed/succeed.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 商品兑换成功 5 | 6 | 7 | 春节期间,2月12日到2月26日,暂停发货,兑换成功的宝宝,我们将在节假日之后与您联系,第一时间给您寄出礼品 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /pages/succeed/succeed.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | background-image: none; 3 | } 4 | .container{ 5 | padding: 0; 6 | } 7 | 8 | .pic image{ 9 | width: 82rpx; 10 | height: 82rpx; 11 | margin:auto; 12 | margin-top: 118rpx; 13 | display: block; 14 | } 15 | .pic view{ 16 | color: rgb(102,102,102); 17 | font-size: 33rpx; 18 | text-align: center; 19 | margin-top: 18rpx; 20 | } 21 | 22 | .tex{ 23 | margin-top: 63rpx; 24 | color: rgb(153,153,153); 25 | padding: 20rpx; 26 | } 27 | 28 | .btn{ 29 | padding: 0 100rpx; 30 | margin-top: 108rpx; 31 | } 32 | .btn .share,.close{ 33 | width: 250rpx; 34 | height: 70rpx; 35 | float: left; 36 | line-height: 70rpx; 37 | text-align: center; 38 | border-radius: 10rpx; 39 | color: #fff; 40 | } 41 | .btn .share{ 42 | background-color: #fb6c4a; 43 | margin-right: 45rpx; 44 | } 45 | .btn .close{ 46 | background-color: #a3b238; 47 | } 48 | -------------------------------------------------------------------------------- /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.6.6", 12 | "appid": "wxf5da491cbf99e1e4", 13 | "projectname": "%E7%AD%94%E9%A2%98%E7%A8%8B%E5%BA%8F", 14 | "condition": { 15 | "search": { 16 | "current": -1, 17 | "list": [] 18 | }, 19 | "conversation": { 20 | "current": -1, 21 | "list": [] 22 | }, 23 | "miniprogram": { 24 | "current": -1, 25 | "list": [] 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : '0' + n 15 | } 16 | 17 | module.exports = { 18 | formatTime: formatTime 19 | } 20 | --------------------------------------------------------------------------------