提交 deda72c3 authored 作者: 青骑士's avatar 青骑士

老婆

上级
流水线 #269 已失败 于阶段
in 10 seconds
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
globalData: {
userInfo: null
}
})
\ No newline at end of file
{
"pages":[
"pages/home/home",
"pages/index/index"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#685256",
"navigationBarTitleText": "崩坏三",
"navigationBarTextStyle":"white"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
// pages//home/home.js
Page({
/**
* 页面的初始数据
*/
data: {
show:0,
show1:false,
show2:false,
show3:true,
show4:0,
show5:0,
// 控制导航栏菜单隐藏显示
nav_height:0,
// 控制图标旋转角度
rotate:0,
background:[
'../../images/index/2020052215545211628.png',
'../../images/index/2020052215545685020.png',
'../../images/index/2020052215545930565.png',
'../../images/index/2020052215550368214.png'
],
list:[
{tabs:'最新',info:[
{
title:'11111',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
}
]},
{tabs:'动态',info:[
{
title:'12222',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
}
]},
{tabs:'公告',info:[
{
title:'13333',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
}
]},
{tabs:'活动',info:[
{
title:'14444',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
}
]},
{tabs:'补给',info:[
{
title:'15555',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
},
{
title:'12222',times:'2020-05-28',classes:'公告'
}
]}
],
goods:[
{name:"官网首页",name_title:'HOME'},
{name:"官网首页",name_title:'HOME'},
{name:"官网首页",name_title:'HOME'},
{name:"官网首页",name_title:'HOME'},
{name:"官网首页",name_title:'HOME'},
{name:"官网首页",name_title:'HOME'},
],
num:200
},
fn: function(event){
var index = event.currentTarget.dataset.index
this.setData({
show:index
})
},
navFn: function(event){
var indexs = event.currentTarget.dataset.index
this.setData({
show4:indexs
})
},
swiper_nav: function(event){
var indexs = event.currentTarget.dataset.index
this.setData({
show5:indexs
})
},swiper_nav2: function(event){
this.setData({
show5: event.detail.current
})
},
//视频的显示与隐藏
videoShow: function(){
this.setData({
show1: !this.data.show1
})
},
videoShow2: function(){
this.setData({
show2: !this.data.show2
})
},
videoShow3: function(){
this.setData({
show3: !this.data.show3
})
if(this.data.num==200){
this.setData({
num:750
})
}else{
this.setData({
num:200
})
}
if(this.data.rotate==0){
this.setData({
rotate:180
})
}else{
this.setData({
rotate:0
})
}
},
videoShow4: function(){
if(this.data.nav_height==1000){
this.setData({
nav_height:0
})
}else{
this.setData({
nav_height:1000
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
差异被折叠。
差异被折叠。
// pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/index/index.wxml-->
<text>pages/index/index.wxml</text>
/* pages/index/index.wxss */
\ No newline at end of file
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"autoAudits": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"libVersion": "2.11.3",
"appid": "wxfb32007f9c78335b",
"projectname": "%E5%B4%A9%E5%9D%8F%E4%B8%89%E5%B0%8F%E7%A8%8B%E5%BA%8F",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": [
{
"id": -1,
"name": "pages/home/home",
"pathName": "pages/home/home",
"scene": null
}
]
}
}
}
\ No newline at end of file
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
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: formatTime
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论