Commit 45ff8ad0 authored by Facius's avatar Facius

feat: 前台-订单管理

parent 2ecfd683
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false"> <u-navbar :is-back="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">我的</text> <text class="title-view">我的</text>
</u-navbar> </u-navbar>
<view class="mine-content"> <view class="header-view">
<view class="header-view">
<view class="header-left-view"> <view class="header-left-view">
<view class="head-image"> <view class="head-image">
<image :style="headImageStyle" :src="headImageUrl"></image> <image :style="headImageStyle" :src="headImageUrl"></image>
...@@ -17,28 +16,30 @@ ...@@ -17,28 +16,30 @@
<u-icon class="tel-arrow-icon" name="arrow-up-fill"></u-icon> <u-icon class="tel-arrow-icon" name="arrow-up-fill"></u-icon>
</view> </view>
</view> </view>
</view> </view>
<view class="header-right-view" @click="$u.throttle(handleClickSetting, 500)"> <view class="header-right-view" @click="$u.throttle(handleClickSetting, 500)">
<view class="setting-view"> <view class="setting-view">
<image :src="shezhiImage" class="right-image-view"></image> <image :src="shezhiImage" class="right-image-view"></image>
<text>设置</text> <text>设置</text>
</view> </view>
<view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view> <view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view> </view>
</view> </view>
<view class="ware-house-view"> <view class="mine-content">
<view class="ware-house-title">仓配功能</view>
<view class="ware-house-content"> <view class="ware-house-view">
<view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)"> <view class="ware-house-title">仓配功能</view>
<view class="ware-house-image"> <view class="ware-house-content">
<image :src="item.icon" :style="item.imageStyle"></image> <view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)">
</view> <view class="ware-house-image">
<view>{{item.title}}</view> <image :src="item.icon" :style="item.imageStyle"></image>
</view> </view>
</view> <view>{{item.title}}</view>
</view>
</view>
</view> </view>
<view class="list-view"> <view class="list-view">
<view v-for="(group, ind) in items" :key="ind" class="group-view"> <view v-for="(group, ind) in items" :key="ind" class="group-view">
<u-cell-group :border="false"> <u-cell-group :border="false">
<view v-for="(item, index) in group" :key="index"> <view v-for="(item, index) in group" :key="index">
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
<view slot="value" class="item-value">{{value}}</view> <view slot="value" class="item-value">{{value}}</view>
</u-cell-item> </u-cell-item>
</view> </view>
</u-cell-group> </u-cell-group>
</view> </view>
</view> </view>
</view> </view>
...@@ -87,6 +88,12 @@ ...@@ -87,6 +88,12 @@
items() { items() {
return [ return [
[{ [{
pathName: 'order/index',
title: '订单管理',
value: '',
icon: 'qianbao.png',
imageStyle: 'width:34rpx;height:32rpx'
},{
pathName: 'wallet/index', pathName: 'wallet/index',
title: '我的钱包', title: '我的钱包',
value: '', value: '',
...@@ -136,38 +143,38 @@ ...@@ -136,38 +143,38 @@
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}] }]
] ]
}, },
warehouseItems() { warehouseItems() {
return [ return [
{ {
pathName: 'warehouse/index', pathName: 'warehouse/index',
title: '备件订单', title: '备件订单',
value: '', value: '',
icon: process.uniEnv.qn_base_url + 'wodepeijian.png', icon: process.uniEnv.qn_base_url + 'wodepeijian.png',
imageStyle: 'width:60rpx;height:54rpx'
},
{
pathName: 'warehouse/spare',
title: '备件库',
value: '',
icon: process.uniEnv.qn_base_url + 'wodebeijian.png',
imageStyle: 'width:60rpx;height:54rpx' imageStyle: 'width:60rpx;height:54rpx'
}, },
{ {
pathName: 'warehouse/spare', pathName: 'warehouse/return',
title: '备件库', title: '返件信息',
value: '', value: '',
icon: process.uniEnv.qn_base_url + 'wodebeijian.png', icon: process.uniEnv.qn_base_url + 'fanjianxinxi.png',
imageStyle: 'width:60rpx;height:54rpx' imageStyle: 'width:56rpx;height:54rpx'
}, },
{ {
pathName: 'warehouse/return', pathName: 'warehouse/records',
title: '返件信息', title: '出库记录',
value: '', value: '',
icon: process.uniEnv.qn_base_url + 'fanjianxinxi.png', icon: process.uniEnv.qn_base_url + 'churuku.png',
imageStyle: 'width:56rpx;height:54rpx' imageStyle: 'width:50rpx;height:54rpx'
}, },
{ ]
pathName: 'warehouse/records',
title: '出库记录',
value: '',
icon: process.uniEnv.qn_base_url + 'churuku.png',
imageStyle: 'width:50rpx;height:54rpx'
},
]
}, },
telTip() { telTip() {
return this.mobile || '绑定手机号' return this.mobile || '绑定手机号'
...@@ -180,20 +187,20 @@ ...@@ -180,20 +187,20 @@
}, },
headSize() { headSize() {
return this.avatar ? 112 : 120 return this.avatar ? 112 : 120
}, },
shezhiImage() { shezhiImage() {
return process.uniEnv.qn_base_url + 'shezhi.png' return process.uniEnv.qn_base_url + 'shezhi.png'
}, },
isSuperuser() { isSuperuser() {
return this.vuex_superuser return this.vuex_superuser
} }
}, },
watch: { watch: {
vuex_token(val, oldVal) { vuex_token(val, oldVal) {
if (val && !this.isSuperuser) { if (val && !this.isSuperuser) {
this.allowLogin() this.allowLogin()
} }
}, },
}, },
onLoad() { onLoad() {
app.trackPage('我的首页') app.trackPage('我的首页')
...@@ -225,9 +232,9 @@ ...@@ -225,9 +232,9 @@
} else { } else {
this.$u.route({url: "pages/login/index"}) this.$u.route({url: "pages/login/index"})
} }
}, },
handleClickSetting() { handleClickSetting() {
this.$u.route({url: 'pages/mine/setting/index'}) this.$u.route({url: 'pages/mine/setting/index'})
}, },
handleClickName() { handleClickName() {
if(this.vuex_token && this.settled) { if(this.vuex_token && this.settled) {
...@@ -248,8 +255,8 @@ ...@@ -248,8 +255,8 @@
}, },
async allowLogin() { // 超级用户,显示登录按钮 async allowLogin() { // 超级用户,显示登录按钮
let res = await this.$u.api.allowLogin() let res = await this.$u.api.allowLogin()
if (res && res.code == 200) { if (res && res.code == 200) {
this.$u.vuex('vuex_superuser', res.data); this.$u.vuex('vuex_superuser', res.data);
} }
}, },
...@@ -264,9 +271,9 @@ ...@@ -264,9 +271,9 @@
.mine-view { .mine-view {
position: relative; position: relative;
height: 100vh; height: 100vh;
overflow: auto; display: flex;
background-color: #F4F5F7; background-color: #F4F5F7;
flex-direction: column;
.header-image { .header-image {
position: absolute; position: absolute;
width: 100%; width: 100%;
...@@ -279,148 +286,157 @@ ...@@ -279,148 +286,157 @@
font-size: 40rpx; font-size: 40rpx;
padding-left: 30rpx; padding-left: 30rpx;
} }
.mine-content {
position: relative;
padding: 26rpx 30rpx 30rpx 20rpx;
.header-view { .header-view {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
margin-bottom: 60rpx; // margin-bottom: 60rpx;
.header-left-view { padding: 26rpx 30rpx 60rpx 30rpx;
display: flex;
align-items: center; .header-left-view {
.head-image { display: flex;
width: 120rpx; align-items: center;
height: 120rpx; .head-image {
background-color: #FFFFFF; z-index: 1;
border-radius: 60rpx; width: 120rpx;
display: flex; height: 120rpx;
align-items: center; background-color: #FFFFFF;
justify-content: center; border-radius: 60rpx;
} display: flex;
align-items: center;
.header-content { justify-content: center;
color: #FFFFFF; }
z-index: 1;
margin-left: 24rpx; .header-content {
color: #FFFFFF;
.name-view { z-index: 1;
font-size: 40rpx; margin-left: 24rpx;
font-weight: bold;
margin-bottom: 6rpx; .name-view {
margin-top: -4rpx; font-size: 40rpx;
} font-weight: bold;
margin-bottom: 6rpx;
.tel-view { margin-top: -4rpx;
background-color: #FFFFFF; }
border-radius: 26rpx;
color: #2272FF; .tel-view {
width: 180rpx; background-color: #FFFFFF;
height: 52rpx; border-radius: 26rpx;
font-size: 20rpx; color: #2272FF;
display: flex; width: 180rpx;
align-items: center; height: 52rpx;
justify-content: center; font-size: 20rpx;
display: flex;
&.active { align-items: center;
color: #FFFFFF; justify-content: center;
border: 2rpx solid #FFFFFF;
background-color: #2272FF; &.active {
} color: #FFFFFF;
border: 2rpx solid #FFFFFF;
.tel-arrow-icon { background-color: #2272FF;
transform: rotate(90deg); }
margin-left: 6rpx;
} .tel-arrow-icon {
} transform: rotate(90deg);
} margin-left: 6rpx;
}
}
}
}
.header-right-view {
z-index: 1;
.setting-view {
display: flex;
justify-content: flex-end;
align-items: center;
color: #FFFFFF;
margin-right: 4rpx;
font-size: 26rpx;
margin-top: -24rpx;
.right-image-view {
width: 34rpx;
height: 32rpx;
margin-right: 10rpx;
}
}
.super-button {
margin-top: 20rpx;
}
} }
.header-right-view { }
.setting-view { .mine-content {
display: flex; height: 100%;
justify-content: flex-end; overflow: auto;
align-items: center; position: relative;
color: #FFFFFF; padding-bottom: 30rpx;
margin-right: 4rpx; margin: 0rpx 30rpx;
font-size: 26rpx; border-radius: 12rpx;
margin-top: -24rpx;
.right-image-view { .ware-house-view {
width: 34rpx; background-color: #FFFFFF;
height: 32rpx; border-radius: 12rpx;
margin-right: 10rpx; padding: 30rpx 30rpx 40rpx 30rpx;
} height: 240rpx;
} .ware-house-title {
color: #333333;
.super-button { font-weight: bold;
margin-top: 20rpx; font-size: 32rpx;
} margin-bottom: 30rpx;
} }
} .ware-house-content {
.ware-house-view { display: flex;
background-color: #FFFFFF; justify-content: space-around;
border-radius: 12rpx; align-items: center;
padding: 30rpx 30rpx 40rpx 30rpx; .ware-house-content-item {
height: 240rpx; color: #333333;
.ware-house-title { font-size: 26rpx;
color: #333333; display: flex;
font-weight: bold; justify-content: center;
font-size: 32rpx; flex-direction: column;
margin-bottom: 30rpx; align-items: center;
} .ware-house-image {
.ware-house-content { width: 60rpx;
display: flex; height: 60rpx;
justify-content: space-around; margin-bottom: 14rpx;
align-items: center; display: flex;
.ware-house-content-item { justify-content: center;
color: #333333; align-items: center;
font-size: 26rpx; }
display: flex; }
justify-content: center;
flex-direction: column; }
align-items: center;
.ware-house-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 14rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
} }
.list-view { .list-view {
.group-view { .group-view {
margin-top: 20rpx; margin-top: 20rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
overflow: hidden; overflow: hidden;
.item-title { .item-title {
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
margin-left: 16rpx; margin-left: 16rpx;
line-height: 32rpx; line-height: 32rpx;
} }
.item-value { .item-value {
font-size: 26rpx; font-size: 26rpx;
color: #999999; color: #999999;
} }
.line-view { .line-view {
height: 2rpx; height: 2rpx;
background-color: #F4F5F7; background-color: #F4F5F7;
margin: 30rpx; margin: 30rpx;
} }
} }
} }
} }
} }
......
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