Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cg_approveApp_2023
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
cg_approveApp_2023
Commits
7dee6b67
Commit
7dee6b67
authored
Oct 12, 2020
by
miko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aa
parent
cb06428c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
848 additions
and
73 deletions
+848
-73
.idea/inspectionProfiles/Project_Default.xml
.idea/inspectionProfiles/Project_Default.xml
+0
-1
src/app.wpy
src/app.wpy
+29
-1
src/assets/info.png
src/assets/info.png
+0
-0
src/assets/question.png
src/assets/question.png
+0
-0
src/common/eventHub.js
src/common/eventHub.js
+3
-3
src/common/http.js
src/common/http.js
+165
-0
src/pages/index.wpy
src/pages/index.wpy
+537
-68
src/pages/progress.wpy
src/pages/progress.wpy
+114
-0
No files found.
.idea/inspectionProfiles/Project_Default.xml
View file @
7dee6b67
...
...
@@ -2,7 +2,6 @@
<profile
version=
"1.0"
>
<option
name=
"myName"
value=
"Project Default"
/>
<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=
"HtmlUnknownAttribute"
enabled=
"true"
level=
"WARNING"
enabled_by_default=
"true"
>
<option
name=
"myValues"
>
...
...
src/app.wpy
View file @
7dee6b67
...
...
@@ -14,6 +14,12 @@
.pc{
background: #FE991B!important;
}
.mytabbar {
--tabbar-item-font-size: 32rpx;
//--tabbar-item-icon-size:61px;
--tabbar-height: 161rpx;
}
</style>
<script>
...
...
@@ -83,7 +89,8 @@ wepy.app({
<config>
{
pages: [
'pages/index'
'pages/index',
'pages/progress'
],
window: {
navigationStyle: "custom",
...
...
@@ -91,5 +98,26 @@ wepy.app({
navigationBarTitleText: 'WeChat',
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>
src/assets/info.png
View replaced file @
cb06428c
View file @
7dee6b67
1.58 KB
|
W:
|
H:
1.68 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/question.png
0 → 100644
View file @
7dee6b67
1.42 KB
src/common/eventHub.js
View file @
7dee6b67
import
wepy
from
'
@wepy/core
'
;
import
wepy
from
'
@wepy/core
'
let
eventHub
=
new
wepy
()
;
let
eventHub
=
new
wepy
()
export
default
eventHub
;
export
default
eventHub
src/common/http.js
0 → 100644
View file @
7dee6b67
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
}
src/pages/index.wpy
View file @
7dee6b67
...
...
@@ -3,12 +3,14 @@
font-size: 36rpx;
color: black;
}
.main{
.main {
box-sizing: border-box;
flex: 1;
overflow-y: scroll;
width: 100%;
}
.header {
width: 100%;
height: 170rpx;
...
...
@@ -54,7 +56,6 @@
width: 678rpx;
margin-left: 36rpx;
margin-top: -80rpx;
max-height: 366rpx;
.inner {
border-radius: 7px;
...
...
@@ -65,14 +66,15 @@
flex-direction: column;
min-height: 148rpx;
.inner-top{
.inner-top
{
min-height: 148rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding-right: 24rpx;
.scroll-container{
.scroll-container {
display: flex;
flex-direction: row;
align-items: center;
...
...
@@ -82,7 +84,7 @@
}
}
.parse-result{
.parse-result
{
box-sizing: border-box;
justify-content: space-between;
border-top: 1px solid #EBEBEB;
...
...
@@ -98,31 +100,55 @@
width: 36rpx
}
}
.input-null{
.input-null {
font-size: 33rpx;
margin-left:25rpx;
width: 553rpx;border: none
margin-left: 25rpx;
width: 553rpx;
border: none
}
.placeholder{
color: black!important;
.placeholder {
color: black !important;
}
.input-notnull{
.input-notnull {
min-height: 148rpx;
max-height: 170rpx;
padding: 15rpx 13rpx;
align-self: flex-start;
font-size: 28rpx;
height: 33rpx;
width: 553rpx;border: none
width: 553rpx;
border: none
}
}
.bt-submit{
.bt-submit {
margin-bottom: 40rpx;
margin-left: 214rpx;
color: white!important;
color: white
!important;
margin-top: 43rpx;
height: 91rpx!important;
height: 91rpx
!important;
width: 322rpx;
}
.bt-submit-d {
margin-left: 214rpx;
color: white !important;
margin-top: 13rpx;
margin-bottom: 30rpx;
height: 91rpx !important;
width: 322rpx;
}
.bt-update {
color: white !important;
margin-top: 13rpx;
height: 91rpx !important;
width: 322rpx;
}
.address {
margin-left: 36rpx;
...
...
@@ -165,7 +191,6 @@
.remark {
margin-left: 36rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
...
...
@@ -182,16 +207,17 @@
height: 65rpx;
}
.middle{
.middle
{
padding-top: 17rpx;
display: flex;
align-content:flex-start;
align-content:
flex-start;
flex-direction: row;
flex-wrap: wrap;
box-sizing: border-box;
height: 203rpx;
width: 100%;
.tag-uncheck{
.tag-uncheck {
border: 1px solid #EBEBEB;
margin: 12rpx 24rpx 10rpx 0;
box-sizing: border-box;
...
...
@@ -202,6 +228,18 @@
border-radius: 34rpx;
background: #F7F7F7;
}
.tag-checked {
border: 1px solid #FE991B;
margin: 12rpx 24rpx 10rpx 0;
box-sizing: border-box;
height: 72rpx;
padding: 16rpx 31rpx;
font-size: 29rpx;
color: #FE991B;
border-radius: 34rpx;
background: #F7F7F7;
}
}
.bottom {
...
...
@@ -225,18 +263,104 @@
}
}
</style>
<wxs module="m1" lang="babel">
const getTime = (time) => {
let date = getDate(time);
let hour = date.getHours();
let mins = date.getMinutes();
let sec = date.getSeconds();
let milli = date.getMilliseconds();
return `${hour}:${mins}:${sec}.${milli}`;
.address-sheet {
--action-sheet-header-font-size: 36rpx;
--action-sheet-header-height: 108rpx;
--font-weight-bold: 400;
--popup-round-border-radius: 15rpx;
.container {
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
background: white;
height: 820rpx;
width: 100%;
}
.item-container {
margin-top: 42rpx;
margin-bottom: 22rpx;
box-sizing: border-box;
width: 100%;
display: flex;
flex-direction: column;
height: 132rpx;
padding: 0rpx 44rpx;
.top {
display: flex;
flex-direction: row;
width: 100%;
height: 66rpx;
align-items: flex-end;
display: flex;
flex-direction: row;
label {
font-weight: 600;
font-size: 34rpx
}
.right {
align-items: flex-end;
margin-left: 46rpx;
flex: 1;
display: flex;
flex-direction: row;
input {
margin-bottom: 2rpx;
font-size: 33rpx;
width: 83rpx;
margin-right: 10rpx;
}
label {
margin-right: 30rpx;
font-weight: 600;
font-size: 34rpx
}
}
}
.bottom {
color: #858585;
display: flex;
flex-direction: row;
width: 100%;
height: 66rpx;
display: flex;
align-items: flex-end;
flex-direction: row;
label {
font-size: 26rpx;
margin-left: 26rpx
}
}
}
}
module.exports.getTime = getTime;
</wxs>
</style>
<!--<wxs module="m1" lang="babel">-->
<!--const getTime = (time) => {-->
<!--let date = getDate(time);-->
<!--let hour = date.getHours();-->
<!--let mins = date.getMinutes();-->
<!--let sec = date.getSeconds();-->
<!--let milli = date.getMilliseconds();-->
<!--return `${hour}:${mins}:${sec}.${milli}`;-->
<!--}-->
<!--module.exports.getTime = getTime;-->
<!--</wxs>-->
<template>
<div class="container" style="align-items: center">
<header background="#FE991B" title_text="捎带"/>
...
...
@@ -253,12 +377,16 @@ module.exports.getTime = getTime;
<div class="inner">
<div class="inner-top">
<div class="scroll-container">
<div v-if="!messageText" style="width: 9rpx;height: 40rpx;margin-top: -3rpx;align-self: center;margin-left: 24rpx" class="pc"/>
<div v-if="!messageText"
style="width: 9rpx;height: 40rpx;margin-top: -3rpx;align-self: center;margin-left: 24rpx"
class="pc"/>
<textarea contenteditable="true" placeholder="粘贴短信或者识别截图"
auto-height="true"
@input="messageInput"
placeholder-class="placeholder"
v-bind:value="messageText" @input="messageInputChange" class="{{messageText? 'input-notnull':'input-null'}}"/>
v-model="messageText"
class="{{messageText? 'input-notnull':'input-null'}}"/>
</div>
<img v-if="!messageText" src="@/assets/pic.png"/>
...
...
@@ -268,23 +396,31 @@ module.exports.getTime = getTime;
<div class="parse-result" v-if="messageText">
<span style="font-size: 28rpx">识别结果</span>
<div>
<span>百事</span>
<span>213213</span>
<span v-if="messageComp">{{ messageComp }}</span>
<span v-else>未知快递公司</span>
<span v-if="messagePacketCode" style="margin-left: 25rpx">{{ messagePacketCode }}</span>
<span v-else style="margin-left: 25rpx">无取件码</span>
</div>
<van-button round type="primary" size="small">确认</van-button>
<van-button icon="success" round type="primary" size="small" @tap="confirmMessage"
v-bind:disabled="messageConfirmed">确认
</van-button>
</div>
<div v-if="messageText" class="parse-result" style="font-size: 24rpx;color: #BABABA;border: none">
识别仅供参考,若与实际意思不一致,请自行输入快递公司和取件码,例如:"顺丰123"即可
</div>
</div>
</div>
<div class="address">
<div class="address"
@tap="showAddressSheet = !showAddressSheet"
>
<div class="top">
<span class="panel-title">送达宿舍</span>
</div>
<div class="bottom">
<div class="address-text">一号楼01层01号邹德宏邹德宏 15891396443</div>
<div class="address-text" v-if="address">{{ address.dormitoryName }}楼{{address.floor}}层{{address.room}} {{address.name}} {{address.phone}}</div>
<div class="address-text" v-else>1号楼1层101 姓名 13300000000</div>
<img src="@/assets/edit.png"/>
</div>
</div>
...
...
@@ -295,39 +431,138 @@ module.exports.getTime = getTime;
</div>
<div class="middle">
<div class="tag-uncheck">晚上再送</div>
<div class="tag-uncheck">我很着急</div>
<div class="tag-uncheck">请敲门</div>
<div class="tag-uncheck">易碎物品</div>
<div class="tag-uncheck">冷藏物品 请勿暴晒</div>
<div class="{{item.checked?'tag-checked':'tag-uncheck'}}" @tap="remarkCheck(index)"
v-for="(item,index) in remarkList">{{ item.label }}
</div>
</div>
<div class="bottom">
<img src="@/assets/info.png"/>
<input placeholder="也可以填写其他留言"/>
<input
v-model="remarkText"
placeholder="也可以填写其他留言"/>
</div>
</div>
<van-button
round
custom-class="bt-submit pc">提 交</van-button>
<van-button
@tap="taskSubmit" round
custom-class="bt-submit pc">提 交</van-button>
</div>
<!-- <button class="bt-submit pc">提 交</button>-->
<van-action-sheet
@close="closeAddressSheet"
class="address-sheet"
@click-overlay="closeAddressSheet"
v-bind:show="showAddressSheet" title="更新地址">
<div class="container">
<div class="item-container">
<div class="top">
<span>收件人</span>
<input v-model="addressSheet_Name" style="font-size: 34rpx;margin-left: 46rpx" placeholder="姓名"/>
</div>
<div class="bottom">
<image style="height: 32rpx;width: 32rpx" src="@/assets/info.png"></image>
<span>请注意, 是快递收件人的姓名</span>
</div>
</div>
<div class="item-container">
<div class="top">
<div style="width: 80%;display: flex;flex-direction: row;align-items: flex-end">
<span>手机号</span>
<input maxlength="11" v-model="addressSheet_Phone"
style="width: 220rpx;font-size: 34rpx;margin-left: 46rpx;"
placeholder="13000000000"/>
</div>
<div style="width: 20%;color: #FE991B" @tap="getPhone">
自动获取
</div>
</div>
<div class="bottom">
<image style="height: 32rpx;width: 32rpx" src="@/assets/info.png"></image>
<span>请注意, 是快递的收件联系方式</span>
</div>
</div>
<div class="item-container">
<div class="top">
<span>宿舍号</span>
<div class="right">
<input v-model="addressSheet_Dormitory" disabled="true" @tap="domi_input_tap" placeholder="其他"/>
<span>楼</span>
<input v-model="addressSheet_Floor" maxlength="5" placeholder="其他"/>
<span>层</span>
<input v-model="addressSheet_Room" maxlength="5" placeholder="其他"/>
<span>号</span>
</div>
</div>
</div>
<van-button @tap="updateAddress" round custom-class="bt-update pc">更 新</van-button>
</div>
</van-action-sheet>
<van-action-sheet
title="选择宿舍楼"
@close="closeDormitorySheet"
@click-overlay="closeDormitorySheet"
v-bind:show="showDormitorySheet"
>
<van-picker
default-index="{{ 0 }}"
@change="onDormitorySelect"
columns="{{ dormitoryList }}"
/>
<van-button @tap="DormitoryConfirm" round custom-class="bt-submit-d pc" style="margin-bottom: 30rpx">确认
</van-button>
</van-action-sheet>
<!-- 自定义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>
</div>
</template>
<script>
import wepy from '@wepy/core'
import eventHub from '../common/eventHub'
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({
store,
config: {
navigationBarTitleText: 'test'
},
hooks: {
// // Page 级别 hook, 只对当前 Page 的 setData 生效。
...
...
@@ -344,40 +579,269 @@ wepy.page({
mixins: [testMixin],
data: {
active: 0,
messageComp: '',
messagePacketCode: '',
messageConfirmed: false,
carrierCoList: ['德邦', 'EMS',
'百世', '国通', '汇通', '联邦', '申通', '顺丰', '天天', '菜鸟', '韵达', '圆通', '邮政', '中铁', '中通', '宅急送', '中邮', '中环'],
dormitoryList: [],
showDormitorySheet: false,
showAddressSheet: false,
addressSheet_Name: '',
addressSheet_Phone: '',
addressSheet_Dormitory: '',
addressSheet_Floor: '',
addressSheet_Room: '',
address: '',
messageText: '',
remarkText: '',
remarkList: [{
label: '晚上再送', checked: false
}, {
label: '我很着急', checked: false
}, {
label: '请敲门', checked: false
}, {
label: '易碎物品', checked: false
}, {
label: '冷藏物品 请勿暴晒', checked: false
}],
showMessageParse: true
},
computed: {
...mapState(['counter']),
testcomputed() {
return 'computed - ' + this.mynum
}
},
computed: {},
methods: {
onTabChange(event){
this.active = event.detail
if(this.active === 0){
}else{
wx.switchTab({
url: '/pages/progress'
})
}
},
taskSubmit(){
//TODO 学校是否开启的判断
if (!this.messageComp || !this.messagePacketCode) {
wx.showToast({
title: '未识别成功,请自行输入快递公司以及取货码',
icon: 'none',
duration: 4000
})
return
}
this.messageConfirmed = true
if(!this.address){
if (!this.messageComp || !this.messagePacketCode) {
wx.showToast({
title: '请填写正确的收货地址',
icon: 'none',
duration: 4000
})
return
}
this.messageConfirmed = true
}
let remark = this.remarkText
this.remarkList.forEach(item=>{
if(item.checked){
remark+= item.label
}
})
let param = {
remark: remark,
phone: this.address.phone,
addressID: this.address.addressID,
parcelInfo: this.messageText,
courierCompany: this.messageComp,
pickupCode: this.messagePacketCode
}
http.post('/task/submit',param).then(data => {
wx.showToast({
title: '提交成功!',
icon: 'success',
duration: 4000
})
return
})
},
updateAddress() {
if (!this.addressSheet_Name) {
wx.showToast({
title: '请输入收件人姓名',
icon: 'none',
duration: 4000
})
return
}
if (!this.addressSheet_Phone) {
wx.showToast({
title: '请输入收件人电话',
icon: 'none',
duration: 4000
})
return
}
if (!this.addressSheet_Dormitory || this.addressSheet_Dormitory === '其他') {
wx.showToast({
title: '请选择宿舍楼',
icon: 'none',
duration: 4000
})
return
}
if (!this.addressSheet_Floor) {
wx.showToast({
title: '请输入楼层',
icon: 'none',
duration: 4000
})
return
}
if (!this.addressSheet_Room) {
wx.showToast({
title: '请输入房间号',
icon: 'none',
duration: 4000
})
return
}
http.post('/address/updateAddress', {
dormitoryName: this.addressSheet_Dormitory,
floor: this.addressSheet_Floor,
room: this.addressSheet_Room,
name: this.addressSheet_Name,
phone: this.addressSheet_Phone
}).then(res => {
if(res.code === 200){
this.address = res.data
this.showAddressSheet = false
}
})
},
confirmMessage() {
if (!this.messageComp || !this.messagePacketCode) {
wx.showToast({
title: '未识别成功,请自行输入快递公司以及取货码',
icon: 'none',
duration: 4000
})
return
}
this.messageConfirmed = true
},
messageInput() {
this.messageConfirmed = false
this.messageComp = ''
this.messagePacketCode = ''
for (var idx in this.carrierCoList) {
let item = this.carrierCoList[idx]
if (this.messageText.indexOf(item) !== -1) {
this.messageComp = item
break
}
}
this.messagePacketCode = this.parsePaketCode(this.messageText)
},
remarkCheck(e, item) {
this.remarkList[e].checked = !this.remarkList[e].checked
},
DormitoryConfirm() {
this.showDormitorySheet = false
},
onDormitorySelect(event) {
const { picker, value, index } = event.$wx.detail
this.addressSheet_Dormitory = value
},
closeDormitorySheet() {
this.showDormitorySheet = false
},
domi_input_tap() {
this.showDormitorySheet = true
},
closeAddressSheet() {
this.showAddressSheet = false
},
cleanMessage() {
this.messageText = ''
},
messageInputChange({$wx}) {
this.messageText = $wx.detail.value
parsePaketCode(str) {
let result = ''
var pattern = /\d(\-|\/|.)\d{1,}\1\d{1,}/
var arr = str.match(pattern)
if (arr && arr.length > 0) {
result = arr[0]
}
pattern = /\d{3,}/
arr = str.match(pattern)
if (arr && arr.length > 0 && !result) {
result = arr[0]
}
return result
},
getPhone() {
}
},
created() {
let self = this
self.currentTime = +new Date()
self.setTimeoutTitle = '标题三秒后会被修改'
setTimeout(() => {
self.setTimeoutTitle = '到三秒了'
}, 3000)
//TODO 初始化学校 id
wx.setStorageSync('schoolID', 2)
const _that = this
wx.
getUserInfo
({
wx.
login
({
success(res) {
self.userInfo = res.userInfo
var code = res.code
http.post('/wxLogin', { code: code }).then(data => {
let customerID = data.data.customerID
if (customerID) {
wx.setStorageSync('customerID', customerID)
}
http.post('/address/getAddressByUser').then(data => {
data = data.data
if (data) {
_that.address = data
_that.addressSheet_Dormitory = data.dormitoryName
_that.addressSheet_Floor = data.floor
_that.addressSheet_Name = data.name
_that.addressSheet_Phone = data.phone
_that.addressSheet_Room = data.room
} else {
_that.address = null
}
})
})
}
})
http.post('/dormitory/getDormitoryBySchool', { pageIndex: 1, pageSize: 100 }).then(res => {
this.dormitoryList = res.data.records.map(v => {
return v.name
})
this.dormitoryList.unshift('其他')
})
}
})
</script>
...
...
@@ -388,7 +852,12 @@ navigationBarBackgroundColor: "#45C9C3",
navigationBarTitleText: '小树懒捎带',
usingComponents: {
header: '~@/components/header',
'van-button': 'module:@vant/weapp/lib/button'
"van-picker": "module:@vant/weapp/lib/picker/index",
"van-popup": "module:@vant/weapp/lib/popup/index",
'van-button': 'module:@vant/weapp/lib/button',
"van-action-sheet": "module:@vant/weapp/lib/action-sheet/index",
"van-tabbar": "module:@vant/weapp/lib/tabbar/index",
"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index"
}
}
</config>
src/pages/progress.wpy
0 → 100644
View file @
7dee6b67
<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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment