Compare commits
No commits in common. 'master' and 'main' have entirely different histories.
@ -0,0 +1,37 @@
|
||||
//app.js
|
||||
App({
|
||||
onLaunch: function () {
|
||||
console.log('App Launch')
|
||||
//调用API从本地缓存中获取数据
|
||||
var logs = wx.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
wx.setStorageSync('logs', logs)
|
||||
},
|
||||
getUserInfo: function (cb) {
|
||||
var that = this
|
||||
if (this.globalData.userInfo) {
|
||||
typeof cb == "function" && cb(this.globalData.userInfo)
|
||||
} else {
|
||||
//调用登录接口
|
||||
wx.login({
|
||||
success: function () {
|
||||
wx.getUserInfo({
|
||||
success: function (res) {
|
||||
that.globalData.userInfo = res.userInfo
|
||||
typeof cb == "function" && cb(that.globalData.userInfo)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow: function () {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide')
|
||||
},
|
||||
globalData: {
|
||||
userInfo: null
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,56 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/list/index",
|
||||
"pages/component/index",
|
||||
"pages/i/index",
|
||||
"pages/logs/logs"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "中医药小程序",
|
||||
"navigationBarBackgroundColor": "#000",
|
||||
"backgroundColor": "#fbf9fe",
|
||||
"enablePullDownRefresh": true
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#dddddd",
|
||||
"selectedColor": "#3cc51f",
|
||||
"borderStyle": "white",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "image/icon_component.png",
|
||||
"selectedIconPath": "image/icon_component_HL.png",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/list/index",
|
||||
"iconPath": "image/icon_API.png",
|
||||
"selectedIconPath": "image/icon_API_HL.png",
|
||||
"text": "所有产品"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/component/index",
|
||||
"iconPath": "image/icon_API.png",
|
||||
"selectedIconPath": "image/icon_API_HL.png",
|
||||
"text": "服务电话"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/i/index",
|
||||
"iconPath": "image/icon_API.png",
|
||||
"selectedIconPath": "image/icon_API_HL.png",
|
||||
"text": "关于我们"
|
||||
}
|
||||
]
|
||||
},
|
||||
"networkTimeout": {
|
||||
"request": 10000,
|
||||
"connectSocket": 10000,
|
||||
"uploadFile": 10000,
|
||||
"downloadFile": 10000
|
||||
},
|
||||
"debug": true
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/**app.wxss**/
|
||||
@import "./style/layout.wxss";
|
||||
|
||||
.container {
|
||||
font-family: Helvetica Neue,Helvetica,Arial,sans-serif;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #fbf9fe;
|
||||
}
|
||||
|
||||
.green{
|
||||
color: #09BB07;
|
||||
}
|
||||
.red{
|
||||
color: #F76260;
|
||||
}
|
||||
.blue{
|
||||
color: #10AEFF;
|
||||
}
|
||||
.yellow{
|
||||
color: #FFBE00;
|
||||
}
|
||||
.gray{
|
||||
color: #C9C9C9;
|
||||
}
|
||||
|
||||
.strong{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.bc_green{
|
||||
background-color: #09BB07;
|
||||
}
|
||||
.bc_red{
|
||||
background-color: #F76260;
|
||||
}
|
||||
.bc_blue{
|
||||
background-color: #10AEFF;
|
||||
}
|
||||
.bc_yellow{
|
||||
background-color: #FFBE00;
|
||||
}
|
||||
.bc_gray{
|
||||
background-color: #C9C9C9;
|
||||
}
|
||||
|
||||
.tc{
|
||||
text-align: center;
|
||||
}
|
||||
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 158 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 302 KiB |
|
After Width: | Height: | Size: 262 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 150 KiB |
|
After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 263 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 353 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 521 B |
|
After Width: | Height: | Size: 311 B |
|
After Width: | Height: | Size: 791 B |
|
After Width: | Height: | Size: 903 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 835 B |
|
After Width: | Height: | Size: 880 B |
|
After Width: | Height: | Size: 965 B |
|
After Width: | Height: | Size: 889 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 909 B |
|
After Width: | Height: | Size: 584 B |
|
After Width: | Height: | Size: 612 B |
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -0,0 +1,88 @@
|
||||
.index{
|
||||
background-color: #FBF9FE;
|
||||
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
|
||||
flex: 1;
|
||||
min-height: 100%;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.head{
|
||||
padding: 80rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
.body{
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.title{
|
||||
font-size: 52rpx;
|
||||
}
|
||||
.desc{
|
||||
margin-top: 10rpx;
|
||||
color: #888888;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.widgets__item{
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
overflow: hidden;
|
||||
border-radius: 4rpx;
|
||||
cursor: pointer;
|
||||
}
|
||||
.widgets__info{
|
||||
display: flex;
|
||||
padding: 40rpx;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
.widgets__info_show{
|
||||
}
|
||||
.widgets__info_show .widgets__info-img{
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
.widgets__info-name{
|
||||
flex: 1;
|
||||
}
|
||||
.widgets__info-img{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
transition: transform .4s;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.widgets__list{
|
||||
display: none;
|
||||
}
|
||||
.widgets__list_show{
|
||||
display: block;
|
||||
}
|
||||
.widget{
|
||||
position: relative;
|
||||
padding-top: 26rpx;
|
||||
padding-bottom: 26rpx;
|
||||
padding-left: 40rpx;
|
||||
padding-right: 40rpx;
|
||||
}
|
||||
.widget__arrow{
|
||||
position: absolute;
|
||||
top: 28rpx;
|
||||
right: 44rpx;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
.widget__line{
|
||||
content: " ";
|
||||
position: absolute;
|
||||
left: 40rpx;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 2rpx;
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
.widget__line_first{
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: #D8D8D8;
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
//index.js
|
||||
//获取应用实例
|
||||
var app = getApp()
|
||||
Page( {
|
||||
|
||||
//事件处理函数
|
||||
bindViewTap: function() {
|
||||
wx.navigateTo( {
|
||||
url: '../logs/logs'
|
||||
})
|
||||
},
|
||||
calling: function () {
|
||||
wx.makePhoneCall({
|
||||
phoneNumber: '1001000000000',
|
||||
success: function () {
|
||||
console.log("拨打电话成功!")
|
||||
},
|
||||
fail: function () {
|
||||
console.log("拨打电话失败!")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onLoad: function() {
|
||||
var that = this
|
||||
//调用应用实例的方法获取全局数据
|
||||
app.getUserInfo( function( userInfo ) {
|
||||
//更新数据
|
||||
that.setData( {
|
||||
userInfo: userInfo
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -0,0 +1,60 @@
|
||||
/**index.wxss**/
|
||||
.container {
|
||||
padding-top: 30px;
|
||||
}
|
||||
.userinfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.userinfo-avatar {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.userinfo-nickname {
|
||||
color: #aaa;
|
||||
}
|
||||
.info {
|
||||
margin-top: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
.line_y {
|
||||
width: 3px;
|
||||
height: 100%;
|
||||
height: 18px;
|
||||
display: inline-block;
|
||||
background-color: #09bb07;
|
||||
}
|
||||
view.text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 10px 10px 10px 12px;
|
||||
font-size: 15px;
|
||||
color: #656565;
|
||||
background-color: #ccc;
|
||||
}
|
||||
view.text text {
|
||||
margin-left: 10px;
|
||||
line-height: 18px;
|
||||
|
||||
}
|
||||
view.text2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 10px 10px 10px 12px;
|
||||
font-size: 15px;
|
||||
color: #656565;
|
||||
}
|
||||
|
||||
.gy image{
|
||||
width: 750rpx;
|
||||
height: 280rpx;
|
||||
}
|
||||
.gy1 image{
|
||||
width: 750rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
//index.js
|
||||
//获取应用实例
|
||||
var app = getApp()
|
||||
Page( {
|
||||
data: {
|
||||
//向模板传入数据
|
||||
// 轮播
|
||||
index_index_scroll_tmpl: {
|
||||
images: [
|
||||
'/images/1.jpg',
|
||||
'/images/2.jpeg',
|
||||
'/images/3.jpeg',
|
||||
],
|
||||
indicatorDots: true,
|
||||
vertical: false,
|
||||
autoplay: true,
|
||||
interval: 3000,
|
||||
duration: 1200
|
||||
},
|
||||
|
||||
|
||||
|
||||
// nav
|
||||
index_index_navs_tmpl: {
|
||||
navs: [
|
||||
{
|
||||
image: '/images/中药包装.png',
|
||||
text: '中药包装'
|
||||
}, {
|
||||
image: '/images/中药研磨.png',
|
||||
text: '重要研磨'
|
||||
}, {
|
||||
image: '/images/中药饮片.png',
|
||||
text: '中药饮品'
|
||||
}, {
|
||||
image: '/images/熬制中药.png',
|
||||
text: '熬制中药'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// item
|
||||
index_index_items_tmpl: {
|
||||
items: [
|
||||
{ image: '/image/a1.jpg'},
|
||||
{ image: '/image/a2.jpg'},
|
||||
{ image: '/image/a3.jpg'}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
//事件处理函数
|
||||
bindViewTap: function() {
|
||||
wx.navigateTo( {
|
||||
url: '../logs/logs'
|
||||
})
|
||||
},
|
||||
swiperchange: function(e) {
|
||||
//FIXME: 当前页码
|
||||
//console.log(e.detail.current)
|
||||
},
|
||||
|
||||
onLoad: function() {
|
||||
console.log( 'onLoad' )
|
||||
var that = this
|
||||
//调用应用实例的方法获取全局数据
|
||||
app.getUserInfo( function( userInfo ) {
|
||||
//更新数据
|
||||
that.setData( {
|
||||
userInfo: userInfo
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: 'XXXXX企业',
|
||||
desc: '企业的领军者!',
|
||||
path: '/page/user?id=123'
|
||||
}
|
||||
},
|
||||
|
||||
go: function(event) {
|
||||
wx.navigateTo({
|
||||
url: '../list/index?type=' + event.currentTarget.dataset.type
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -0,0 +1,29 @@
|
||||
<!--index.wxml-->
|
||||
<import src="../../template/item-template.wxml"/>
|
||||
<view class="container">
|
||||
|
||||
<view class="section section_gap swiper_box">
|
||||
<template is="index_index_scroll_tmpl" data="{{...index_index_scroll_tmpl}}"/>
|
||||
</view>
|
||||
|
||||
<view class="text">
|
||||
<view class="line_y"></view>
|
||||
<text>中药类型</text>
|
||||
</view>
|
||||
<view class="section index-nav">
|
||||
<template is="index_index_navs_tmpl" data="{{...index_index_navs_tmpl}}"/>
|
||||
</view>
|
||||
|
||||
<view class="text">
|
||||
<view class="line_y"></view>
|
||||
<text>药物展示</text>
|
||||
</view>
|
||||
|
||||
<view class="nr11">
|
||||
<image src="/images/13.webp"></image>
|
||||
</view>
|
||||
<view class="nr11">
|
||||
<image src="/images/15.jpg"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
.container {
|
||||
background-color: #F2f2f2;
|
||||
}
|
||||
|
||||
view.section {
|
||||
/*display: block;*/
|
||||
/*width: 100%;*/
|
||||
}
|
||||
|
||||
/*轮播*/
|
||||
.swiper_box {
|
||||
/*width: 100%;*/
|
||||
height: 157.5px;
|
||||
}
|
||||
swiper.swiper {
|
||||
height: 100%;
|
||||
}
|
||||
.swiper-item {
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
.slide-image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/*分类*/
|
||||
.index-nav {
|
||||
height: 80px;
|
||||
/*background: red;*/
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
/*align-items: center;*/
|
||||
background-color: #fff;
|
||||
color: #646464;
|
||||
}
|
||||
|
||||
.index-nav view {
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
border-right: 1px solid #F2f2f2;
|
||||
}
|
||||
.index-nav image {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
.index-nav text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
view.text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 10px 10px 10px 12px;
|
||||
font-size: 15px;
|
||||
color: #656565;
|
||||
}
|
||||
|
||||
view.text:before {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: ' ';
|
||||
left: -5px;
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
background-color: #09bb07;
|
||||
}
|
||||
.line_y {
|
||||
width: 3px;
|
||||
height: 100%;
|
||||
height: 18px;
|
||||
display: inline-block;
|
||||
background-color: #09bb07;
|
||||
}
|
||||
view.text text {
|
||||
margin-left: 10px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-bottom: 7px;
|
||||
height: 126px;
|
||||
}
|
||||
|
||||
.nr11{
|
||||
|
||||
}
|
||||
.nr11 image{
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
Page({
|
||||
data: {
|
||||
title: '',
|
||||
//向模板传入数据
|
||||
list_index_items_tmpl: {
|
||||
items: [{"mprice":0,"maxpacks":100,"price":12800,"subcate":210,"remains":998,"type":1,"freight":0,"title":"V7702","imgs":["../../image/V7702.jpg"],"unit":"只","id":302,"quantity":"1"},{"mprice":0,"maxpacks":14,"price":1600,"subcate":410,"remains":14,"type":4,"freight":1000,"title":"红糖粉","imgs":["https://81.jpg"],"unit":"g","id":93,"quantity":"400"},{"mprice":0,"maxpacks":100,"price":4800,"subcate":202,"remains":5,"type":1,"freight":1000,"title":"极致Q弹肉丸子","imgs":["https:/fe3.png"],"unit":"g","id":69,"quantity":"300"}]
|
||||
}
|
||||
},
|
||||
//事件处理函数
|
||||
onLoad: function (options) {
|
||||
this.title = options.type || 'VOC产品'
|
||||
},
|
||||
onReady: function () {
|
||||
wx.setNavigationBarTitle({
|
||||
title: this.title
|
||||
})
|
||||
},
|
||||
})
|
||||
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -0,0 +1,46 @@
|
||||
<!--index.wxml-->
|
||||
<!--<import src="../../template/item-template.wxml" />--》
|
||||
|
||||
<!--<view class="container">
|
||||
<template is="list_index_items_tmpl" data="{{...list_index_items_tmpl}}" />
|
||||
</view>-->
|
||||
|
||||
<view class="container">
|
||||
<image src="/images/drug/丁香.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/前胡.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/大黄.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/巴豆.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/胆矾.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/黎芦.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/通草.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/雄黄.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/雷丸.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/黄连.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/银花.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<image src="/images/drug/车前.webp"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<text class="daodi">到底了</text>
|
||||
</view>
|
||||
@ -0,0 +1,45 @@
|
||||
.container {
|
||||
padding: 8px 0;
|
||||
}
|
||||
.container image {
|
||||
display: block;
|
||||
ime-mode: widthFix;
|
||||
width: 750rpx;
|
||||
height: 600rpx;
|
||||
}
|
||||
.item {
|
||||
padding: 8px;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #e4e4e4;
|
||||
color: #787878;
|
||||
}
|
||||
|
||||
.item image {
|
||||
display: block;
|
||||
width: 129px;
|
||||
height: 114px;
|
||||
}
|
||||
|
||||
.item-right {
|
||||
margin-left: 11px;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.title text {
|
||||
font-size: 16px;
|
||||
color: #787878;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 15px;
|
||||
color: #444;
|
||||
}
|
||||
.c-1 {
|
||||
color: #09bb07;
|
||||
}
|
||||
.daodi{
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
//logs.js
|
||||
var util = require('../../utils/util.js')
|
||||
Page({
|
||||
data: {
|
||||
logs: []
|
||||
},
|
||||
onLoad: function () {
|
||||
this.setData({
|
||||
logs: (wx.getStorageSync('logs') || []).map(function (log) {
|
||||
return util.formatTime(new Date(log))
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "查看启动日志"
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
<!--logs.wxml-->
|
||||
<view class="container log-list">
|
||||
<block wx:for="{{logs}}" wx:for-item="log">
|
||||
<text class="log-item">{{index + 1}}. {{log}}</text>
|
||||
</block>
|
||||
</view>
|
||||
@ -0,0 +1,8 @@
|
||||
.log-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.log-item {
|
||||
margin: 10rpx;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
{
|
||||
"appid": "touristappid",
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.25.3",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"condition": false
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* layout
|
||||
*
|
||||
* 说明
|
||||
* l:layout
|
||||
* r:row
|
||||
* l:left
|
||||
* r:right
|
||||
* c:center
|
||||
*/
|
||||
|
||||
.l-r {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/*l_auto:占用剩下的*/
|
||||
.l_auto {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/*& > * {
|
||||
display: block;
|
||||
}
|
||||
|
||||
// 1行内元素平分
|
||||
// &[class^="l-r-auto"] {
|
||||
// flex: 1;
|
||||
// }
|
||||
|
||||
// 1行内元素平分
|
||||
&[class^="l-r-auto"] {
|
||||
& > * {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
// 主轴为水平方向,起点在右端
|
||||
&[class^="l-r-r"] {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
// 1行2列两边对齐
|
||||
&[class^="l-r-lr"] {
|
||||
justify-content: space-between;
|
||||
}
|
||||
*/
|
||||
|
||||
.l-c {
|
||||
display: flex;
|
||||
/*justify-content: center;*/
|
||||
align-items: center;
|
||||
}
|
||||
/*垂直水平居中对齐*/
|
||||
.l-c-c {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
<!--index_index_scroll-->
|
||||
<template name="index_index_scroll_tmpl">
|
||||
<swiper class="swiper" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}"
|
||||
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
|
||||
<block wx:for="{{images}}" wx:key="item.id">
|
||||
<swiper-item>
|
||||
<image src="{{item}}" class="slide-image"/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</template>
|
||||
|
||||
<!--index_index_navs-->
|
||||
<template name="index_index_navs_tmpl">
|
||||
<block wx:for="{{navs}}" wx:key="item.id">
|
||||
<view class="l-c-c" catchtap="go" data-type="{{item.text}}">
|
||||
<image src="{{item.image}}" class="slide-image"/>
|
||||
<text>{{item.text}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</template>
|
||||
|
||||
<!--index_index_items-->
|
||||
<template name="index_index_items_tmpl">
|
||||
<block wx:for="{{items}}" wx:key="item.id">
|
||||
<view class="item">
|
||||
<image src="{{item.image}}" class="slide-image"/>
|
||||
</view>
|
||||
</block>
|
||||
</template>
|
||||
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
function formatTime(date) {
|
||||
var year = date.getFullYear()
|
||||
var month = date.getMonth() + 1
|
||||
var day = date.getDate()
|
||||
|
||||
var hour = date.getHours()
|
||||
var minute = date.getMinutes()
|
||||
var second = date.getSeconds()
|
||||
|
||||
|
||||
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||
}
|
||||
|
||||
function formatNumber(n) {
|
||||
n = n.toString()
|
||||
return n[1] ? n : '0' + n
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime: formatTime
|
||||
}
|
||||