Commit 7dee6b67 authored by miko's avatar miko

aa

parent cb06428c
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<profile version="1.0"> <profile version="1.0">
<option name="myName" value="Project Default" /> <option name="myName" value="Project Default" />
<inspection_tool class="CssInvalidPropertyValue" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="CssInvalidPropertyValue" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="HtmlRequiredTitleAttribute" enabled="true" level="INFORMATION" enabled_by_default="true" /> <inspection_tool class="HtmlRequiredTitleAttribute" enabled="true" level="INFORMATION" enabled_by_default="true" />
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues"> <option name="myValues">
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
.pc{ .pc{
background: #FE991B!important; background: #FE991B!important;
} }
.mytabbar {
--tabbar-item-font-size: 32rpx;
//--tabbar-item-icon-size:61px;
--tabbar-height: 161rpx;
}
</style> </style>
<script> <script>
...@@ -83,7 +89,8 @@ wepy.app({ ...@@ -83,7 +89,8 @@ wepy.app({
<config> <config>
{ {
pages: [ pages: [
'pages/index' 'pages/index',
'pages/progress'
], ],
window: { window: {
navigationStyle: "custom", navigationStyle: "custom",
...@@ -91,5 +98,26 @@ wepy.app({ ...@@ -91,5 +98,26 @@ wepy.app({
navigationBarTitleText: 'WeChat', navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black' navigationBarTextStyle: 'black'
} }
,
"tabBar": {
"custom": true,
"selectedColor": "#A6C185",
"list": [
{
"pagePath": "pages/progress",
"text": "我的捎带",
"iconPath": "assets/close.png",
"selectedIconPath": "assets/close.png"
},
{
"pagePath": "pages/index",
"text": "捎带快递",
"iconPath": "assets/close.png",
"selectedIconPath": "assets/close.png"
},
]
}
} }
</config> </config>
src/assets/info.png

1.58 KB | W: | H:

src/assets/info.png

1.68 KB | W: | H:

src/assets/info.png
src/assets/info.png
src/assets/info.png
src/assets/info.png
  • 2-up
  • Swipe
  • Onion skin
import wepy from '@wepy/core'; import wepy from '@wepy/core'
let eventHub = new wepy(); let eventHub = new wepy()
export default eventHub; export default eventHub
module.exports = {
post,
get,
upload
}
// LOG控制
const isLog = false
// 网络请求超时
const timeOut = 30 * 1000
const prefix = 'http://127.0.0.1:8888/api'
// MARK 网络请求
function get(url, data) {
let token = wx.getStorageSync("token")
let header = {
'content-type': 'application/json',
}
if (token){
header.token = token
}
let schoolID = wx.getStorageSync("schoolID")
if(schoolID){
header.schoolID = schoolID
}
return new Promise((resolve, reject) => {
wx.request({
url: prefix+url,
data: data,
method: 'GET',
dataType: 'json',
timeout: timeOut,
responseType: 'text',
header: header,
success: function (res) {
let token = res.header.token
if(token){
wx.setStorageSync("token", token)
}
if(res.statusCode!==200){
wx.showToast({
title: '内部错误',
icon: 'none',
duration: 3000,
mask:true
})
reject(res.statusCode)
}
resolve(res.data)
},
fail: function (error) {
wx.showToast({
title: '内部错误',
icon: 'none',
duration: 3000,
mask:true
})
reject(error)
},
complete: (res) => {
wx.hideLoading()
wx.stopPullDownRefresh()
if (isLog) {
console.log('请求回调:', res)
}
},
})
})
}
// MARK 网络请求
function post(url, data) {
let token = wx.getStorageSync("token")
let header = {
'content-type': 'application/json',
}
if (token){
header.token = token
}
let schoolID = wx.getStorageSync("schoolID")
if(schoolID){
header.schoolID = schoolID
}
return new Promise((resolve, reject) => {
wx.request({
url: prefix+url,
data: data,
method: 'POST',
dataType: 'json',
timeout: timeOut,
responseType: 'text',
header: header,
success: function (res) {
let token = res.header.token
if(token){
wx.setStorageSync("token", token)
}
if(res.statusCode!==200){
wx.showToast({
title: '内部错误',
icon: 'none',
duration: 3000,
mask:true
})
reject(res.statusCode)
}
resolve(res.data)
},
fail: function (error) {
wx.showToast({
title: '内部错误',
icon: 'none',
duration: 3000,
mask:true
})
reject(error)
},
complete: (res) => {
wx.hideLoading()
wx.stopPullDownRefresh()
if (isLog) {
console.log('请求回调:', res)
}
},
})
})
}
// MARK 上传文件
function upload(event) {
var upTask = wx.uploadFile({
url: event.url,
filePath: event.filePath,
name: Date.parse(new Date()),
formData: event.formData,
complete: (res) => {
if (isLog) {
console.log('文件上传:', res)
}
},
})
// UploadTask.abort()
// 中断上传任务
// UploadTask.onProgressUpdate(function callback)
// 监听上传进度变化事件
// UploadTask.offProgressUpdate(function callback)
// 取消监听上传进度变化事件
return upTask
}
This diff is collapsed.
<style lang="less" type="text/less" scoped>
.list-item{
margin-top: 18rpx;
border-radius: 5rpx;
background: white;
box-sizing: border-box;
height: 266rpx;
width: 100%;
}
.main {
width: 716rpx;
flex: 1;
overflow-y: scroll;
}
</style>
<template>
<div class="container" style="align-items: center">
<header background="#FE991B " title_text="进度查询"/>
<div class="main">
<div class="list-item">
</div>
</div>
</div>
<!-- 自定义tabbar-->
<van-tabbar active="{{ active }}" @change="onTabChange" class="mytabbar">
<van-tabbar-item>
<image
slot="icon"
src="@/assets/close.png"
mode="aspectFit"
style="width: 30px; height: 18px;"
/>
<image
slot="icon-active"
src="@/assets/close.png"
mode="aspectFit"
style="width: 30px; height: 18px;"
/>
捎带快递
</van-tabbar-item>
<van-tabbar-item>
<image
slot="icon"
src="@/assets/close.png"
mode="aspectFit"
style="width: 30px; height: 18px;"
/>
<image
slot="icon-active"
src="@/assets/close.png"
mode="aspectFit"
style="width: 30px; height: 18px;"
/>
我的捎带
</van-tabbar-item>
</van-tabbar>
</template>
<script>
import wepy from '@wepy/core'
import { mapState } from '@wepy/x'
import store from '../store'
import testMixin from '../mixins/test'
import http from '../common/http.js'
const app = getApp().$wepy.$options
wepy.page({
data:{
active: 1
},
methods: {
onTabChange(event){
this.active = event.detail
if(this.active === 1){
}else{
wx.switchTab({
url: '/pages/index'
})
}
}
},
created() {
}
})
</script>
<config>
{
navigationBarTextStyle: "white",
navigationBarBackgroundColor: "#45C9C3",
navigationBarTitleText: '',
usingComponents: {
header: '~@/components/header',
"van-picker": "module:@vant/weapp/lib/picker/index",
"van-popup": "module:@vant/weapp/lib/popup/index",
'van-button': 'module:@vant/weapp/lib/button',
"van-tabbar": "module:@vant/weapp/lib/tabbar/index",
"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index",
"van-action-sheet": "module:@vant/weapp/lib/action-sheet/index"
}
}
</config>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment