Browse Source

first commit

master
corala 2 years ago
commit
6c41efefaa
40 changed files with 600 additions and 0 deletions
  1. +19
    -0
      app.js
  2. +17
    -0
      app.json
  3. +0
    -0
      app.wxss
  4. +48
    -0
      pages/index/index.js
  5. +3
    -0
      pages/index/index.json
  6. +20
    -0
      pages/index/index.wxml
  7. +19
    -0
      pages/index/index.wxss
  8. +11
    -0
      pages/login/index.js
  9. +4
    -0
      pages/login/index.json
  10. +17
    -0
      pages/login/index.wxml
  11. +95
    -0
      pages/login/index.wxss
  12. +10
    -0
      pages/open/index.js
  13. +4
    -0
      pages/open/index.json
  14. +12
    -0
      pages/open/index.wxml
  15. +59
    -0
      pages/open/index.wxss
  16. +19
    -0
      pages/rank/index.js
  17. +4
    -0
      pages/rank/index.json
  18. +28
    -0
      pages/rank/index.wxml
  19. +115
    -0
      pages/rank/index.wxss
  20. +70
    -0
      project.config.json
  21. +7
    -0
      sitemap.json
  22. BIN
      static/imgs/bg.png
  23. BIN
      static/imgs/checked.png
  24. BIN
      static/imgs/logo.png
  25. BIN
      static/imgs/name.png
  26. BIN
      static/imgs/row.png
  27. BIN
      static/imgs/sanjiao.png
  28. BIN
      static/imgs/title.png
  29. BIN
      ).png
  30. BIN
      static/imgs/形状结合.png
  31. BIN
      static/imgs/排行榜_slices.zip
  32. BIN
      static/imgs/排行榜_slices/位图(1).png
  33. BIN
      static/imgs/排行榜_slices/位图.png
  34. BIN
      static/imgs/排行榜_slices/位图备份.png
  35. BIN
      static/imgs/排行榜_slices/形状.png
  36. BIN
      png
  37. BIN
      static/imgs/矩形.png
  38. BIN
      png
  39. BIN
      .png
  40. +19
    -0
      utils/util.js

+ 19
- 0
app.js View File

@@ -0,0 +1,19 @@
// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)

// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
},
globalData: {
userInfo: null
}
})

+ 17
- 0
app.json View File

@@ -0,0 +1,17 @@
{
"pages": [
"pages/login/index",
"pages/rank/index",
"pages/open/index",
"pages/index/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle": "black"
},
"style": "v2",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
}

+ 0
- 0
app.wxss View File


+ 48
- 0
pages/index/index.js View File

@@ -0,0 +1,48 @@
// index.js
// 获取应用实例
const app = getApp()

Page({
data: {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
canIUseGetUserProfile: false,
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
},
// 事件处理函数
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
},
onLoad() {
if (wx.getUserProfile) {
this.setData({
canIUseGetUserProfile: true
})
}
},
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
},
getUserInfo(e) {
// 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
console.log(e)
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}
})

+ 3
- 0
pages/index/index.json View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

+ 20
- 0
pages/index/index.wxml View File

@@ -0,0 +1,20 @@
<!--index.wxml-->
<view class="container">
<view class="userinfo">
<block wx:if="{{canIUseOpenData}}">
<view class="userinfo-avatar" bindtap="bindViewTap">
<open-data type="userAvatarUrl"></open-data>
</view>
<open-data type="userNickName"></open-data>
</block>
<block wx:elif="{{!hasUserInfo}}">
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
<button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
<view wx:else> 请使用1.4.4及以上版本基础库 </view>
</block>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
</view>

+ 19
- 0
pages/index/index.wxss View File

@@ -0,0 +1,19 @@
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
color: #aaa;
}

.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}

.usermotto {
margin-top: 200px;
}

+ 11
- 0
pages/login/index.js View File

@@ -0,0 +1,11 @@
// index.js
// 获取应用实例
const app = getApp()

Page({
data: {
ischecked: true
},
onLoad() {
}
})

+ 4
- 0
pages/login/index.json View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "登录"
}

+ 17
- 0
pages/login/index.wxml View File

@@ -0,0 +1,17 @@
<!--index.wxml-->
<view class="container">
<view class="cont">
<image class="sanjiao" src="https://static.quhouse.com/9781a47cb0464fa5bac93003b86ea901.png"></image>
<image class="title" src="https://static.quhouse.com/3696e957b05d4d45ae5ae623e525083a.png"></image>
<image class="search" src="https://static.quhouse.com/2d4207f23033420da62154bbdab565fb.png"></image>
<image class="logo" src="https://static.quhouse.com/36be11c7991c484cbf4853d108772137.png"></image>
<view class="agreement">
<image class="checked" wx:if="{{ischecked}}"src="https://static.quhouse.com/73be27af311b4a97b17e75dd5b984100.png"></image>
<view class="nocheck" wx:else></view>
<view class="text">勾选表示您已阅读并同意</view>
<view class="text text1">《隐私协议》</view>
</view>
<view class="btn" >微信一键登录</view>
<view class="btn btn1">返回游戏</view>
</view>
</view>

+ 95
- 0
pages/login/index.wxss View File

@@ -0,0 +1,95 @@
/**index.wxss**/
.container{
background: url('https://static.quhouse.com/11cb7c5d4d4242e29636e96f9bb20fa1.png') no-repeat;
width: 750rpx;
height: 1464rpx;
background-size: 750rpx 1464rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.cont {
width: 650rpx;
height: 998rpx;
background: #FFFFFF;
border-radius: 20rpx;
margin-top: 120rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 84rpx;
}
.sanjiao{
position: absolute;
bottom: -44rpx;
left: 279rpx;
width: 92rpx;
height: 44rpx;
}
.title{
width: 547rpx;
height: 200rpx;
margin-bottom: 38rpx;
}
.logo{
width: 542rpx;
height: 228rpx;
margin-bottom: 60rpx;
}
.search{
width: 538rpx;
height: 58rpx;
margin-bottom: 42rpx;
}
.agreement{
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 30rpx;
}
.checked{
width: 28rpx;
height: 28rpx;
padding: 2rpx 5rpx;
margin-right: 8rpx;
}
.nocheck{
width: 22rpx;
height: 22rpx;
padding: 2rpx;
margin-right: 8rpx;
border: 2rpx #55A28E solid;
border-radius: 5rpx;
}
.text{
height: 32rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
line-height: 32rpx;
}
.text1{
color: #55A28E;
}

.btn{
width: 510rpx;
height: 96rpx;
background: #55A28E;
border-radius: 48rpx;
line-height: 96rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
border: 2rpx solid #55A28E;
text-align: center;
}
.btn1{
color: #55A28E;
background:#FFFFFF;
border: 2rpx solid #55A28E;
margin-top: 30rpx;
}

+ 10
- 0
pages/open/index.js View File

@@ -0,0 +1,10 @@
// index.js
// 获取应用实例
const app = getApp()

Page({
data: {
},
onLoad() {
}
})

+ 4
- 0
pages/open/index.json View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle": "custom"
}

+ 12
- 0
pages/open/index.wxml View File

@@ -0,0 +1,12 @@
<!--index.wxml-->
<view class="container">
<image class="img" src="https://static.quhouse.com/66bb9733ddfe48bebc0fdd6d1bcaad11.png"></image>
<view class="control">
<view class="btn btn1">
点击参与<image class="row" src="https://static.quhouse.com/6541777e2745410eb7156244a675fd35.png"></image>
</view>
<image class="white" src="https://static.quhouse.com/783169705fe74e8190b144eb2f132591.png"></image>
<view class="btn btn2">扫码参与
<image class="row" src="https://static.quhouse.com/4066235dc1404b928a5e247f7b56274e.png"></image></view>
</view>
</view>

+ 59
- 0
pages/open/index.wxss View File

@@ -0,0 +1,59 @@
/**index.wxss**/
.container{
background: url('https://static.quhouse.com/05115280a98346c89fa49890f1fcfcbc.png') no-repeat;
width: 750rpx;
height: 1624rpx;
background-size: 750rpx 1624rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.img{
width: 680rpx;
height: 1302rpx;
margin-top: 104rpx;
}
.control{
width: 680rpx;
margin-top: 0rpx;
position: relative;
}
.btn{
width: 320rpx;
height: 100rpx;
border: 2rpx solid #000000;
line-height: 100rpx;
font-size: 44rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
position: absolute;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.btn1{
color: #000000;
background: #FFC700;
top: 0;
left: 0;
}
.btn2{
background: #2845E0;
color: #FFFFFF;
right: 0;
top: 12rpx;
}
.btn .row{
width: 44rpx;
height: 44rpx;
display: inline-block;
margin-left: 18rpx;
}
.white{
width: 40rpx;
height: 116rpx;
position: absolute;
top: 1rpx;
left: 322rpx;
}

+ 19
- 0
pages/rank/index.js View File

@@ -0,0 +1,19 @@
// index.js
// 获取应用实例
const app = getApp()

Page({
data: {
isshow: true,
rankData: [{},{},{},{},{},{},{},{},{},{}]
},
onLoad() {
},
closeModal(){
console.log(34)
this.setData({
isshow:false
})
}
})

+ 4
- 0
pages/rank/index.json View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "排行榜"
}

+ 28
- 0
pages/rank/index.wxml View File

@@ -0,0 +1,28 @@
<!--index.wxml-->
<view class="container">
<view class="bg" wx:if="{{isshow}}">
<view class="cont">
<view class="data">
<view class="self">
<view class="sort">18</view>
<image class="avatar" src="https://static.quhouse.com/71cbeb430e6e4e1e99d95f02bc05fa9b.png"></image>
<view class="nick">今晚吃两碗饭今晚吃两碗饭今晚吃两碗饭今晚吃两碗饭</view>
<view class="score">144548</view>
</view>
<view class="top10">
<view class="top-item" wx:key="index" wx:for="{{rankData}}" wx:for-index="index" wx:for-item="item">
<image class="top123" wx:if="{{index==0}}" src="https://static.quhouse.com/1e934b34538c4962b949ffcb6a3f729e.png"></image>
<image class="top123" wx:elif="{{index==1}}" src="https://static.quhouse.com/14d0332c05944b21b873afba12410385.png"></image>
<image class="top123" wx:elif="{{index==2}}" src="https://static.quhouse.com/d4f28816b5db4de383243eb1f9f7aae4.png"></image>
<view class="sort" wx:else>{{index+1}}</view>
<image class="avatar" src="https://static.quhouse.com/71cbeb430e6e4e1e99d95f02bc05fa9b.png"></image>
<view class="nick">今晚吃两碗饭今晚吃两碗饭今晚吃两碗饭今晚吃两碗饭</view>
<view class="score">144548</view>
</view>
</view>
</view>
<view class="count">仅展示前10位用户排行</view>
</view>
<image class="close" bindtap="closeModal" src="https://static.quhouse.com/aa7441dc84b04e49b74f8114e96f7c88.png"></image>
</view>
</view>

+ 115
- 0
pages/rank/index.wxss View File

@@ -0,0 +1,115 @@
/**index.wxss**/
.container{
background: url('https://static.quhouse.com/11cb7c5d4d4242e29636e96f9bb20fa1.png') no-repeat;
width: 750rpx;
height: 1464rpx;
background-size: 750rpx 1464rpx;
display: flex;
flex-direction: column;
position: relative;
}
.bg{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.7);
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
.cont{
background: url('https://static.quhouse.com/6c0891742179421bbfc5496831740750.png') no-repeat;
width: 670rpx;
height: 1053rpx;
background-size: 670rpx 1053rpx;
}
.close{
width: 54rpx;
height: 54rpx;
margin-top: 40rpx;
}
.data{
margin: 140rpx 30rpx 20rpx;
width: 610rpx;
height: 817rpx;
background: #FFFFFF;
border-radius: 16rpx;
border: 4rpx solid #FFD36B;
}
.data .self{
height: 110rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 24rpx;
border-bottom: 1rpx solid #E0E0E0;
}
.data .sort{
width: 42rpx;
height: 64rpx;
font-size: 36rpx;
font-family: D-DINCondensed-Bold, D-DINCondensed;
font-weight: bold;
color: #42917C;
line-height: 64rpx;
margin-right: 30rpx;
}
.data .avatar{
width: 64rpx;
height: 64rpx;
border: 1rpx solid #E0E0E0;
margin-right: 12rpx;
border-radius: 50%;
}
.data .nick{
flex:1;
height: 64rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 64rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.data .score{
width: 110rpx;
height: 64rpx;
text-align: center;
line-height: 64rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #E51B1B;
margin-left: 10rpx;
}
.data .top10{
height: 700rpx;
overflow: auto;
}
.data .top10 .top-item{
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 24rpx;
}
.data .top10 .top-item .top123{
width: 34rpx;
height: 46rpx;
margin-right: 42rpx;
}
.count{
width: 100%;
height: 42rpx;
font-size: 30rpx;
text-align: center;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 42rpx;
}

+ 70
- 0
project.config.json View File

@@ -0,0 +1,70 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"enhance": false,
"postcss": true,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"preloadBackgroundData": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"compileHotReLoad": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"libVersion": "2.23.4",
"appid": "wx583af5cdd9358906",
"projectname": "biguiyuan",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}

+ 7
- 0
sitemap.json View File

@@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

BIN
static/imgs/bg.png View File

Before After
Width: 750  |  Height: 1464  |  Size: 316 KiB

BIN
static/imgs/checked.png View File

Before After
Width: 28  |  Height: 28  |  Size: 717 B

BIN
static/imgs/logo.png View File

Before After
Width: 542  |  Height: 228  |  Size: 44 KiB

BIN
static/imgs/name.png View File

Before After
Width: 538  |  Height: 58  |  Size: 9.9 KiB

BIN
static/imgs/row.png View File

Before After
Width: 100  |  Height: 58  |  Size: 1.3 KiB

BIN
static/imgs/sanjiao.png View File

Before After
Width: 92  |  Height: 44  |  Size: 1022 B

BIN
static/imgs/title.png View File

Before After
Width: 547  |  Height: 200  |  Size: 33 KiB

BIN
static/imgs/形状结合 → ).png View File


BIN
static/imgs/形状结合.png View File

Before After
Width: 44  |  Height: 44  |  Size: 855 B

BIN
static/imgs/排行榜_slices.zip View File


BIN
static/imgs/排行榜_slices/位图(1).png View File

Before After
Width: 34  |  Height: 46  |  Size: 3.3 KiB

BIN
static/imgs/排行榜_slices/位图.png View File

Before After
Width: 34  |  Height: 46  |  Size: 3.1 KiB

BIN
static/imgs/排行榜_slices/位图备份.png View File

Before After
Width: 34  |  Height: 46  |  Size: 3.1 KiB

BIN
static/imgs/排行榜_slices/形状.png View File

Before After
Width: 54  |  Height: 54  |  Size: 1.6 KiB

BIN
static/imgs/排行榜_slices/编组 → png View File


BIN
static/imgs/矩形.png View File

Before After
Width: 750  |  Height: 1624  |  Size: 32 KiB

BIN
static/imgs/矩形备份 → png View File


BIN
static/imgs/编组 → .png View File


+ 19
- 0
utils/util.js View File

@@ -0,0 +1,19 @@
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()

return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}

const formatNumber = n => {
n = n.toString()
return n[1] ? n : `0${n}`
}

module.exports = {
formatTime
}

Loading…
Cancel
Save