WHY_branch
why 2 years ago
parent 48885ede37
commit 21c4f0550a

@ -1 +0,0 @@
1234__why

@ -1,31 +0,0 @@
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
ecmaFeatures: {
modules: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
rules: {},
}

@ -1,19 +0,0 @@
// 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
}
})

@ -1,15 +0,0 @@
{
"pages":[
"pages/ye1/ye1",
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#0094aa",
"navigationBarTextStyle":"black",
"enablePullDownRefresh":true
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

@ -1,10 +0,0 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}

@ -1,48 +0,0 @@
// 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
})
}
})

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

@ -1,23 +0,0 @@
<!--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 class="usermotto">
<text class="user-motto">{{motto}}</text>
</view>
</view>

@ -1,19 +0,0 @@
/**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;
}

@ -1,18 +0,0 @@
// logs.js
const util = require('../../utils/util.js')
Page({
data: {
logs: []
},
onLoad() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => {
return {
date: util.formatTime(new Date(log)),
timeStamp: log
}
})
})
}
})

@ -1,4 +0,0 @@
{
"navigationBarTitleText": "查看启动日志",
"usingComponents": {}
}

@ -1,6 +0,0 @@
<!--logs.wxml-->
<view class="container log-list">
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log.date}}</text>
</block>
</view>

@ -1,8 +0,0 @@
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}

@ -1,82 +0,0 @@
// pages/ye1/ye1.js
Page({
data: {
inSearch:true,
val:'',
hidd:true,
ma:"\n",
},
change:function()
{
this.setData({hidd:!this.data.hidd})
},
getInput:function(e){
this.setData({
val:e.detail.value
})
if(this.data.val.length>0){
this.setData({
isSearch:true,
})
}else{
this.setData({
isSearch:true,
})
}
},
clearTap:function(){
this.setData({
val:'',
isSearch:true,
})
},
onLoad(options) {
},
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,8 +0,0 @@
{
"usingComponents": {},
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#0094aa",
"navigationBarTitleText": "地图导航",
"navigationBarTextStyle":"black",
"enablePullDownRefresh":true
}

@ -1,24 +0,0 @@
<!--pages/ye1/ye1.wxml-->
<view style="border: ridge;" >
<button bindtap ="change">请选择目的地</button>
<radio-group bindtap ="change" hidden="{{hidd}}">
<view><radio>南五教学楼</radio></view>
<view><radio>南四教学楼</radio></view>
<view><radio>南三教学楼</radio></view>
<view><radio>南二教学楼</radio></view>
<view><radio>南一教学楼</radio></view>
<view><radio>南一食堂</radio></view>
<view><radio>南二食堂</radio></view>
<view><radio>南三食堂</radio></view>
</radio-group>
</view>
<view class="ditu" style="border: solid;">在这里放地图链接</view>
<view class="kongge"> </view>
<view class="searchdog">
<icon type="search" wx:if="{{inSearch}}"></icon>
<input placeholder="请输入目的地" bindinput="getInput"></input>
</view>
<view class="kongge"> </view>
<navigator class="kaishi">开始</navigator>
<view class="kongge"> </view>
<navigator class="tuichu">退出</navigator>

@ -1,60 +0,0 @@
navigator{
height: 85rpx;
width: 350rpx;
font-size: 50rpx;
display: flex;
color: rgb(252, 249, 247) ;
justify-content: center;
align-items: center;
background-color:rgb(5, 197, 156);
border-radius: 15rpx;
margin-top: 1%;
}
input{
background-color: rgb(255, 255, 255);
width:400rpx;
margin-left: 30rpx;
font-size: 40rpx;
margin-top: 2%;
margin:0 auto;
}
.searchdog{
display: flex;
flex-direction: row;
align-items: center;
border: 1px solid #069bd6;
border-radius: 300rpx;
width: 480rpx;
height: 110rpx;
justify-content: center;
vertical-align: center;
margin-top: 2%;
margin:0 auto;
}
page{
justify-content: center;
flex-direction: row;
align-items: center;
}
.ditu{
height: 400rpx;
}
.kaishi{
background-color: rgb(16, 206, 231);
justify-content: center;
flex-direction: row;
align-items: center;
margin-top: 2%;
margin:0 auto;
}
.tuichu{
background-color: rgb(220, 235, 15);
justify-content: center;
flex-direction: row;
align-items: center;
margin-top: 2%;
margin:0 auto;
}
.kongge{
margin-top: 2%;
}

@ -1,52 +0,0 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"bundle": false,
"userConfirmedBundleSwitch": false,
"urlCheck": true,
"scopeDataCheck": false,
"coverView": true,
"es6": true,
"postcss": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false,
"minified": true,
"autoAudits": false,
"newFeature": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"useIsolateContext": true,
"nodeModules": false,
"enhance": true,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true,
"packNpmManually": false,
"enableEngineNative": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"showES6CompileOption": false,
"minifyWXML": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.19.4",
"appid": "wx9b0e074a07323727",
"projectname": "miniprogram-92",
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"simulatorPluginLibVersion": {}
}

@ -1,7 +0,0 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "ye1why",
"setting": {
"compileHotReLoad": true
}
}

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

@ -1,19 +0,0 @@
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