调整项目框架
This commit is contained in:
parent
01ea333978
commit
2b8797a1ac
147
App.vue
147
App.vue
|
@ -21,43 +21,46 @@
|
||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
@import '@/uni_modules/uni-scss/index.scss';
|
@import '@/uni_modules/uni-scss/index.scss';
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
@import '@/static/customicons.css';
|
@import '@/static/customicons.css';
|
||||||
|
@import 'uni.scss';
|
||||||
|
/* #endif */
|
||||||
|
|
||||||
// 设置整个项目的背景色
|
// 设置整个项目的背景色
|
||||||
page {
|
page {
|
||||||
background-color: #060B26;
|
background-color: $uni-bg-color-default !important;
|
||||||
color: #fff;
|
color: $uni-text-color-inverse;
|
||||||
}
|
}
|
||||||
/* #endif */
|
|
||||||
.example-info {
|
.example-info {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #333;
|
color: $uni-text-color;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
.page_padding{padding: 14px;}
|
.page_padding{padding: 14px;}
|
||||||
.page_content{padding: 0 12px 10px;}
|
.page_content{padding: 0 12px 10px;}
|
||||||
//内容框
|
//内容框
|
||||||
.contentboxsty{border-radius: 8px;background: #1C2755;}
|
.contentboxsty{border-radius: 8px;background: $uni-bg-color-primary;}
|
||||||
//没有底部边框
|
//没有底部边框
|
||||||
.noborbot{border-bottom:none !important}
|
.noborbot{border-bottom:none !important}
|
||||||
|
|
||||||
.t-icon{background-repeat: no-repeat;}
|
.t-icon{background-repeat: no-repeat;}
|
||||||
.icon22{width: 22px;height: 22px;}
|
.icon22{width: 22px;height: 22px;}
|
||||||
|
|
||||||
//字体大小
|
//字体大小
|
||||||
.font12{font-size: $uni-font-size-sm;}
|
.font12{font-size: 12px;}
|
||||||
.font13{font-size:13px;}
|
.font13{font-size: 13px;}
|
||||||
.font14{font-size: $uni-font-size-base;}
|
.font14{font-size: 14px;}
|
||||||
.font15{font-size: 15px!important;}
|
.font15{font-size: 15px;}
|
||||||
.font20{font-size: 20px;}
|
.font20{font-size: 20px;}
|
||||||
.font22{font-size: 22px;}
|
.font22{font-size: 22px;}
|
||||||
.font24{font-size: 24px;}
|
.font24{font-size: 24px;}
|
||||||
.font35{font-size: 35px;}
|
.font35{font-size: 35px;}
|
||||||
.font_bold{font-weight: bold;}
|
.font_bold{font-weight: bold;}
|
||||||
|
|
||||||
//文字颜色
|
//文字颜色
|
||||||
.text_color_black{color: #000;}
|
.text_color_black{color: $uni-text-color-default;}
|
||||||
.theme_color{color: #009688 }//主题绿
|
.theme_color{color: $uni-text-color-primary } //主题绿
|
||||||
//按钮颜色
|
//按钮颜色
|
||||||
.but_color{background: #009688 !important;}
|
.but_color{background: $uni-color-primary !important;}
|
||||||
// .text_{color: #00B68D;}
|
|
||||||
|
|
||||||
//布局
|
//布局
|
||||||
.flex_layout{display: flex;}
|
.flex_layout{display: flex;}
|
||||||
|
@ -71,33 +74,121 @@
|
||||||
.padd_left12{padding-left:12px;}
|
.padd_left12{padding-left:12px;}
|
||||||
//margin
|
//margin
|
||||||
.mar_top12{margin-top: 12px;}
|
.mar_top12{margin-top: 12px;}
|
||||||
.page_list{margin-bottom: 12px;padding:0 12px;}
|
.page_list{margin-bottom: 12px;padding:0 12px;}
|
||||||
|
|
||||||
//有详情的列表
|
//有详情的列表
|
||||||
.detail_list{margin-bottom: 12px;
|
.detail_list{
|
||||||
|
margin-bottom: 12px;
|
||||||
.list_top{
|
.list_top{
|
||||||
display: flex;
|
display: flex;
|
||||||
padding:12px;
|
padding:12px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
border-radius: 8px 8px 0px 0px;
|
border-radius: 8px 8px 0px 0px;
|
||||||
background: linear-gradient(90deg, rgba(61, 84, 176, 0.70) 5.83%, rgba(58, 77, 158, 0.00) 73.76%);
|
background: linear-gradient(90deg, rgba(61, 84, 176, 0.70) 5.83%, rgba(58, 77, 158, 0.00) 73.76%);
|
||||||
.top_left{flex: 1;}
|
.top_left{flex: 1;display: flex;align-items: center; font-weight: bold;}
|
||||||
|
.top_right{display: flex;align-items: center;font-weight: bold;}
|
||||||
|
.top_right .arrow{margin-left: 5px;font-weight: normal;}
|
||||||
}
|
}
|
||||||
.list_content{padding:12px;}
|
.list_content{padding:12px;position: relative;}
|
||||||
|
.list_content .card_right{position: absolute;top: 12px;right: 12px;}
|
||||||
|
|
||||||
|
.card_right{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.status{
|
||||||
|
padding: 3px 10px;
|
||||||
|
background: $uni-bg-color-success-dark;
|
||||||
|
color: $uni-text-color-success;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.success{
|
||||||
|
background: $uni-bg-color-success-dark;
|
||||||
|
color: $uni-text-color-success;
|
||||||
|
}
|
||||||
|
.warning{
|
||||||
|
background: $uni-bg-color-warning-dark;
|
||||||
|
color: $uni-text-color-warning;
|
||||||
|
}
|
||||||
|
.error{
|
||||||
|
background: $uni-bg-color-error-dark;
|
||||||
|
color: $uni-text-color-danger;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.flexBox .detail_list:first-child{
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
// 检索固定
|
||||||
|
.headerViewFixed{
|
||||||
|
background: $uni-bg-color-default;
|
||||||
}
|
}
|
||||||
//页面固定按钮
|
//页面固定按钮
|
||||||
.bottom_but{
|
.bottom_but{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
background-color: #060B26;
|
background-color: #060B26;
|
||||||
border-top: 1px solid #2E3249;
|
border-top: 1px solid #2E3249;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
// bottom: 40px;bottom: 40px;position: fixed;width: calc(100% - 28px);
|
// bottom: 40px;bottom: 40px;position: fixed;width: calc(100% - 28px);
|
||||||
view{width: 50%;text-align: center;margin: 0 20px;border-radius: 19px;background: #DDD;line-height: 38px;height: 38px;margin-top: 6px;}
|
view{width: 50%;text-align: center;margin: 0 20px;border-radius: 19px;background: #DDD;line-height: 38px;height: 38px;margin-top: 6px;}
|
||||||
}
|
}
|
||||||
//底部固定添加按钮
|
//底部固定添加按钮
|
||||||
.page_bottom_button{width: 100%;position: fixed;bottom: 0px;background-color: #060B26;border-top: 1px solid #2E3249;height: 80px;
|
.page_bottom_button{
|
||||||
|
width: 100%;position: fixed;bottom: 0px;background-color: #060B26;border-top: 1px solid #2E3249;height: 80px;
|
||||||
.page_add{display: flex;justify-content: center;margin: 7px 20px;border-radius: 17.5px;background: #1C2755;line-height: 35px;}
|
.page_add{display: flex;justify-content: center;margin: 7px 20px;border-radius: 17.5px;background: #1C2755;line-height: 35px;}
|
||||||
}
|
}
|
||||||
.bot_padding{padding-bottom: 100px;}
|
.bot_padding{padding-bottom: 100px;}
|
||||||
|
|
||||||
|
.placeholderStyle{
|
||||||
|
color: $uni-text-color-placeholder;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 圆形进度条
|
||||||
|
.progressBg{
|
||||||
|
position: absolute;
|
||||||
|
left: 2px;
|
||||||
|
top: 2px;
|
||||||
|
z-index: 20;
|
||||||
|
background: $uni-bg-color-primary;
|
||||||
|
width: 98px;
|
||||||
|
height: 98px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.progressBox{
|
||||||
|
background: $uni-bg-color-default-dark;
|
||||||
|
width: 90px;
|
||||||
|
height: 90px;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.circle-progress {
|
||||||
|
width: 102px;
|
||||||
|
height: 102px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
background: $uni-bg-color-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-progress__bar {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-image: conic-gradient($uni-color-primary 0%, $uni-color-primary var(--progress), transparent 0);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<!-- 针对中间的导航栏 通过true来判断控制类名和样式 -->
|
<!-- 针对中间的导航栏 通过true来判断控制类名和样式 -->
|
||||||
<view class="tabbar-item" v-for="(item, index) in tabbarList" :class="[item.centerItem ? 'center-item' : '']" @click="changeItem(item)" :key="index">
|
<view class="tabbar-item" v-for="(item, index) in tabbarList" :class="[item.centerItem ? 'center-item' : '']" @click="changeItem(item)" :key="index">
|
||||||
<view class="item-top">
|
<view class="item-top">
|
||||||
<image :src="currentItem == item.id ? item.selectIcon:item.icon"></image>
|
<image class="img" :src="currentItem == item.id ? item.selectIcon:item.icon"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 通过三元判断控制类名 达到控制选中和未选中的样式 -->
|
<!-- 通过三元判断控制类名 达到控制选中和未选中的样式 -->
|
||||||
<view class="item-bottom" :class="[currentItem == item.id ? 'item-active' : '']">
|
<view class="item-bottom" :class="[currentItem == item.id ? 'item-active' : '']">
|
||||||
|
@ -38,9 +38,9 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
path: '/pages/person/person',
|
path: '',
|
||||||
// icon: '/static/logo.png',
|
icon: '/static/sweep.png',
|
||||||
// selectIcon: '/static/logo.png',
|
selectIcon: '',
|
||||||
text: '扫一扫',
|
text: '扫一扫',
|
||||||
// 通过类名class控制样式大小
|
// 通过类名class控制样式大小
|
||||||
centerItem: true
|
centerItem: true
|
||||||
|
@ -60,11 +60,34 @@ export default {
|
||||||
this.currentItem = this.currentPage
|
this.currentItem = this.currentPage
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeItem (item) {
|
changeItem (item) {
|
||||||
uni.switchTab({
|
if(item.centerItem){
|
||||||
url: item.path
|
this.scanQRCode();
|
||||||
})
|
return
|
||||||
}
|
}
|
||||||
|
uni.switchTab({
|
||||||
|
url: item.path
|
||||||
|
})
|
||||||
|
},
|
||||||
|
scanQRCode(){
|
||||||
|
uni.scanCode({
|
||||||
|
success: (res) => {
|
||||||
|
console.log('扫码结果:' + res.result);
|
||||||
|
uni.showModal({
|
||||||
|
title: '扫码结果',
|
||||||
|
content: res.result,
|
||||||
|
showCancel: false
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('扫码失败:' + err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '扫码失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -74,18 +97,32 @@ view {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
.tabbar-container::before{
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 10%;
|
||||||
|
top: 0;
|
||||||
|
z-index: 10;
|
||||||
|
height: 1px;
|
||||||
|
width: 80%;
|
||||||
|
background-image: linear-gradient(90deg, $uni-border-color-default, $uni-color-primary 50%, $uni-border-color-default);
|
||||||
|
background-size: 100% 1px;
|
||||||
|
background-repeat:no-repeat;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
.tabbar-container {
|
.tabbar-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0rpx;
|
bottom: 0rpx;
|
||||||
left: 0rpx;
|
left: 0rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 110rpx;
|
height: 110rpx;
|
||||||
box-shadow: 0 0 5px #999;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 5rpx 0;
|
padding: 5rpx 0;
|
||||||
color: #999999;
|
color: $uni-text-color-grey;
|
||||||
background: #131E3B;
|
background: $uni-border-color-default;
|
||||||
|
box-shadow: 0 2px 4px $uni-border-shadow-color-default;
|
||||||
|
|
||||||
/* 针对tabbar的统一处理 */
|
/* 针对tabbar的统一处理 */
|
||||||
.tabbar-item {
|
.tabbar-item {
|
||||||
width: 33.33%;
|
width: 33.33%;
|
||||||
|
@ -111,7 +148,7 @@ view {
|
||||||
}
|
}
|
||||||
// 被选中的导航栏字体
|
// 被选中的导航栏字体
|
||||||
.item-active {
|
.item-active {
|
||||||
color: #fff;
|
color: $uni-text-color-inverse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,15 +156,26 @@ view {
|
||||||
.center-item {
|
.center-item {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 20;
|
||||||
.item-top {
|
.item-top {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 100rpx;
|
width: 100rpx;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -50rpx;
|
top: -60rpx;
|
||||||
left: calc(50% - 50rpx);
|
left: calc(50% - 50rpx);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow: 0 0 5px #999;
|
box-shadow: 0 2px 4px $uni-border-shadow-color-default;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 2px solid $uni-text-color-inverse;
|
||||||
|
.img{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.item-bottom {
|
.item-bottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -136,7 +184,7 @@ view {
|
||||||
.item-active {
|
.item-active {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 5rpx;
|
bottom: 5rpx;
|
||||||
color: #1fff;
|
color: $uni-text-color-inverse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
<template>
|
||||||
|
<view class="loadMore">
|
||||||
|
<!-- 无数据 -->
|
||||||
|
<view class="noData" v-if="noData">
|
||||||
|
<view class="imgView">
|
||||||
|
<image class="img" src="https://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/noData.png" lazy-load="true"></image>
|
||||||
|
</view>
|
||||||
|
<view class="text font14">暂无数据...</view>
|
||||||
|
</view>
|
||||||
|
<view class="loadView" v-if="loading">
|
||||||
|
<view class="loadBox">
|
||||||
|
<text class="icon iconfont icon-loading"></text>
|
||||||
|
<text class="text font14">加载中...</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="loadCompleted" v-if="loadEnd && !loading">
|
||||||
|
<view class="loadBox">
|
||||||
|
<text class="iconfont icon-meiyougengduo"></text>
|
||||||
|
<text class="text font14">没有更多数据了!</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
noData:{
|
||||||
|
type:[Boolean],
|
||||||
|
default(){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loading:{
|
||||||
|
type:[Boolean],
|
||||||
|
default(){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadEnd:{
|
||||||
|
type:[Boolean],
|
||||||
|
default(){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.noData{
|
||||||
|
.text{
|
||||||
|
color: $uni-text-color-grey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.loadBox{
|
||||||
|
color: $uni-color-primary;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,19 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- style="height: 3.5rem; margin: 0 1em;" -->
|
|
||||||
<view>
|
<view>
|
||||||
<view class="line-total" :style="'width: ' + (val / total * 100) + '%'">
|
<view class="line-total" :style="'width: ' + (val / total * 100) + '%'">
|
||||||
<text class="line-data">
|
<text class="line-data">
|
||||||
{{val}}%
|
{{val}}%
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="position: relative;bottom: 10px;">
|
<view style="position: relative;bottom: 13px;">
|
||||||
<view class="line-base"></view>
|
<view class="line-base"></view>
|
||||||
<view class="line-blue" :style="'width: ' + (val / total * 100) + '%'"></view>
|
<view class="line-blue" :style="'width: ' + (val / total * 100) + '%'"></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="line-val">
|
|
||||||
<text>{{title}}</text>
|
|
||||||
<text>{{total}}</text>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -48,7 +43,7 @@ export default {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
.line-total {
|
.line-total {
|
||||||
color: #67C23A;
|
color: #67C23A;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
@ -61,12 +56,14 @@ export default {
|
||||||
|
|
||||||
}
|
}
|
||||||
.line-data{
|
.line-data{
|
||||||
color: #fff;
|
color: $uni-text-color-inverse;
|
||||||
padding: 1px 3px;
|
padding: 1px 5px;
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
border: 1px solid #FFF;
|
border: 1px solid $uni-text-color-inverse;
|
||||||
background: var(--color-warning, #67C23A);
|
background: var(--color-warning, #67C23A);
|
||||||
width: 30px;
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
.line-base {
|
.line-base {
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<template>
|
||||||
|
<view class="searchBox">
|
||||||
|
<view class="searchView">
|
||||||
|
<view class="searchInput">
|
||||||
|
<input class="input font14" confirm-type="search" placeholder-class="placeholderStyle placeholderClass iconfont icon-a-Vector6-copy" :placeholder="placeholder" />
|
||||||
|
<view class="filter">
|
||||||
|
<text class="iconfont icon-a-shaixuan2 font22"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
placeholder:{
|
||||||
|
type:[String],
|
||||||
|
default:' 请输入关键字'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.searchBox .searchInput .input{
|
||||||
|
background: $uni-bg-color-primary;
|
||||||
|
}
|
||||||
|
</style>
|
27
main.js
27
main.js
|
@ -1,11 +1,22 @@
|
||||||
|
|
||||||
import "./static/iconfont/iconfont.css"
|
import "./static/iconfont/iconfont.css"
|
||||||
import "./static/iconfont/iconfont-weapp/iconfont-weapp-icon.css"
|
import './static/css/app.css';
|
||||||
|
import "./static/iconfont/iconfont-weapp/iconfont-weapp-icon.css"
|
||||||
|
|
||||||
|
// 全局组件
|
||||||
|
import searchView from './components/searchView/index'
|
||||||
|
import loadMore from './components/loadMore/index'
|
||||||
|
import progressBar from './components/progressBar'
|
||||||
|
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import svg from './static/iconfont/svg.js'
|
import svg from './static/iconfont/svg.js'
|
||||||
|
|
||||||
|
Vue.component('search-view',searchView);
|
||||||
|
Vue.component('load-more',loadMore);
|
||||||
|
Vue.component('progress-bar',progressBar);
|
||||||
|
|
||||||
|
|
||||||
Vue.use(svg);
|
Vue.use(svg);
|
||||||
|
|
||||||
|
@ -25,7 +36,13 @@ import request from "./utils/api.js"
|
||||||
import publicMethods from "./utils/public.js"
|
import publicMethods from "./utils/public.js"
|
||||||
|
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App)
|
const app = createSSRApp(App)
|
||||||
|
|
||||||
|
// 全局注册组件
|
||||||
|
app.component('searchView', searchView);
|
||||||
|
app.component('loadMore', loadMore);
|
||||||
|
app.component('progressBar', progressBar);
|
||||||
|
|
||||||
app.config.globalProperties.$api = request;
|
app.config.globalProperties.$api = request;
|
||||||
app.config.globalProperties.$wf = publicMethods;
|
app.config.globalProperties.$wf = publicMethods;
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name" : "mes-mobile01",
|
"name" : "mes-mobile",
|
||||||
"appid" : "__UNI__41DB0F2",
|
"appid" : "__UNI__41DB0F2",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
|
@ -52,9 +52,14 @@
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"appid" : "wx38dc81b0eef130a3",
|
"appid" : "wx38dc81b0eef130a3",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false
|
"urlCheck" : false,
|
||||||
|
"postcss" : true,
|
||||||
|
"es6" : true,
|
||||||
|
"minified" : true
|
||||||
},
|
},
|
||||||
"usingComponents" : true
|
"usingComponents" : true,
|
||||||
|
"libVersion":"latest"
|
||||||
},
|
},
|
||||||
"vueVersion" : "3"
|
"vueVersion" : "3",
|
||||||
|
"locale" : "zh-Hans"
|
||||||
}
|
}
|
||||||
|
|
22
pages.json
22
pages.json
|
@ -35,7 +35,6 @@
|
||||||
"path" : "pages/login/login",
|
"path" : "pages/login/login",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
// "navigationBarTitleText" : "登录",
|
|
||||||
"enablePullDownRefresh" : false,
|
"enablePullDownRefresh" : false,
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
@ -45,7 +44,10 @@
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "生产工单管理",
|
"navigationBarTitleText" : "生产工单管理",
|
||||||
"enablePullDownRefresh" : false
|
"enablePullDownRefresh" : true,
|
||||||
|
"pullToRefresh":{
|
||||||
|
"color":"red"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -184,13 +186,21 @@
|
||||||
"enablePullDownRefresh" : false
|
"enablePullDownRefresh" : false
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarTitleText": "德木自动化系统",
|
"navigationBarTitleText": "德木自动化系统",
|
||||||
"navigationBarBackgroundColor": "#060B26",
|
"navigationBarBackgroundColor": "#060B26",
|
||||||
|
"backgroundColor":"#060B26",
|
||||||
|
"backgroundTextStyle":"light",
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"background": "#efeff4"
|
"background": "#060B26"
|
||||||
}
|
},
|
||||||
|
"mp-weixin":{
|
||||||
|
"background":"#060B26",
|
||||||
|
"pullToRefresh":{
|
||||||
|
"color":"#060B26"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"condition" : { //模式配置,仅开发期间生效
|
"condition" : { //模式配置,仅开发期间生效
|
||||||
"current": 0, //当前激活的模式(list 的索引项)
|
"current": 0, //当前激活的模式(list 的索引项)
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<view class="top">
|
<view class="top">
|
||||||
▴2.89%
|
▴2.89%
|
||||||
</view>
|
</view>
|
||||||
<view class="font22">
|
<view class="num font22">
|
||||||
1,567
|
1,567
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<view class="top">
|
<view class="top">
|
||||||
▴2.89%
|
▴2.89%
|
||||||
</view>
|
</view>
|
||||||
<view class="font22">
|
<view class="num font22">
|
||||||
1,567
|
1,567
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
<view class="top">
|
<view class="top">
|
||||||
▴2.89%
|
▴2.89%
|
||||||
</view>
|
</view>
|
||||||
<view class="font22">
|
<view class="num font22">
|
||||||
1,567
|
1,567
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
<view class="top">
|
<view class="top">
|
||||||
▴2.89%
|
▴2.89%
|
||||||
</view>
|
</view>
|
||||||
<view class="font22">
|
<view class="num font22">
|
||||||
1,567
|
1,567
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
<view class="top">
|
<view class="top">
|
||||||
▴2.89%
|
▴2.89%
|
||||||
</view>
|
</view>
|
||||||
<view class="font22">
|
<view class="num font22">
|
||||||
1,567
|
1,567
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
<view class="top">
|
<view class="top">
|
||||||
▴2.89%
|
▴2.89%
|
||||||
</view>
|
</view>
|
||||||
<view class="font22">
|
<view class="num font22">
|
||||||
1,567
|
1,567
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -166,14 +166,6 @@
|
||||||
<view class="t-icon t-icon-shengchangongdan contenticon"></view>
|
<view class="t-icon t-icon-shengchangongdan contenticon"></view>
|
||||||
<view class="contentname">生产工单</view>
|
<view class="contentname">生产工单</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_module" @click="toSchedule()">
|
|
||||||
<view class="t-icon t-icon-gongdanjindu contenticon"></view>
|
|
||||||
<view class="contentname">工单进度</view>
|
|
||||||
</view>
|
|
||||||
<view class="content_module" @click="toMaterialYield()">
|
|
||||||
<view class="t-icon t-icon-gongdanchucaishuai contenticon"></view>
|
|
||||||
<view class="contentname">工单出材率</view>
|
|
||||||
</view>
|
|
||||||
<view class="content_module">
|
<view class="content_module">
|
||||||
<view class="t-icon t-icon-shengchanbaobiao contenticon"></view>
|
<view class="t-icon t-icon-shengchanbaobiao contenticon"></view>
|
||||||
<view class="contentname">生产报表</view>
|
<view class="contentname">生产报表</view>
|
||||||
|
@ -187,11 +179,19 @@
|
||||||
<view class="content_module">
|
<view class="content_module">
|
||||||
<view class="t-icon t-icon-paichengguanli contenticon"></view>
|
<view class="t-icon t-icon-paichengguanli contenticon"></view>
|
||||||
<view class="contentname">排程管理</view>
|
<view class="contentname">排程管理</view>
|
||||||
|
</view>
|
||||||
|
<view class="content_module" @click="toSchedule()">
|
||||||
|
<view class="t-icon t-icon-gongdanjindu contenticon"></view>
|
||||||
|
<view class="contentname">工单进度</view>
|
||||||
|
</view>
|
||||||
|
<view class="content_module" @click="toMaterialYield()">
|
||||||
|
<view class="t-icon t-icon-gongdanchucaishuai contenticon"></view>
|
||||||
|
<view class="contentname">工单出材率</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_module">
|
<!-- <view class="content_module">
|
||||||
<view class="t-icon t-icon-paichengshichang contenticon"></view>
|
<view class="t-icon t-icon-paichengshichang contenticon"></view>
|
||||||
<view class="contentname">排程时长</view>
|
<view class="contentname">排程时长</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_box">
|
<view class="content_box">
|
||||||
|
@ -205,8 +205,8 @@
|
||||||
<view class="t-icon t-icon-shebeizhuangtai contenticon"></view>
|
<view class="t-icon t-icon-shebeizhuangtai contenticon"></view>
|
||||||
<view class="contentname">设备状态</view>
|
<view class="contentname">设备状态</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_module">
|
<view class="content_module" @click="toDeviceRepair()">
|
||||||
<view class="t-icon t-icon-shebeibaoxiu contenticon" @click="toDeviceRepair()"></view>
|
<view class="t-icon t-icon-shebeibaoxiu contenticon"></view>
|
||||||
<view class="contentname">设备报修</view>
|
<view class="contentname">设备报修</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -300,7 +300,7 @@
|
||||||
.name{flex:1;}
|
.name{flex:1;}
|
||||||
.accounticon{
|
.accounticon{
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
color: #fff;
|
color: $uni-text-color-inverse;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
.notifyicon{font-size: 20px;padding-right: 20px;}
|
.notifyicon{font-size: 20px;padding-right: 20px;}
|
||||||
|
@ -312,33 +312,43 @@
|
||||||
.content_title{line-height: 25px;font-size: 16px;padding: 15px 0;}
|
.content_title{line-height: 25px;font-size: 16px;padding: 15px 0;}
|
||||||
.device_data{display: flex;flex-wrap: wrap;
|
.device_data{display: flex;flex-wrap: wrap;
|
||||||
.device_module{
|
.device_module{
|
||||||
width: calc(50% - 12px); /* 计算每个块的宽度(根据需要调整)*/
|
width: calc(50% - 6px); /* 计算每个块的宽度(根据需要调整)*/
|
||||||
|
// background-color: #ccc; /* 设置背景色(根据需要调整)*/
|
||||||
|
background: $uni-bg-color-primary;
|
||||||
margin:6px;
|
margin:6px;
|
||||||
background-color: #ccc; /* 设置背景色(根据需要调整)*/
|
padding: 10px 14px;
|
||||||
padding: 10px;
|
|
||||||
background: #1C2755;
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
.module_left{width: 60%;
|
.module_left{width: 60%;
|
||||||
.icon_background{width: 32px;height: 32px;background: #6576B7;border-radius: 8px; display: flex;align-items: center;justify-content: center;margin-bottom: 4px;}
|
.icon_background{width: 32px;height: 32px;background: $uni-bg-color-info;border-radius: 8px; display: flex;align-items: center;justify-content: center;margin-bottom: 4px;}
|
||||||
}
|
}
|
||||||
.module_right{width: 40%;
|
.module_right{width: 40%;
|
||||||
.top{float: right;font-size: 10px;padding: 2px 4px;background: rgba(103,194,58,0.3);border-radius: 4px;color: #67C23A;}
|
.top{
|
||||||
|
display: flex;flex-direction: column; font-size: 10px;padding: 2px 4px;background: rgba(103,194,58,0.3);border-radius: 4px;color: $uni-text-color-success;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.device_module:nth-child(even){
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
.device_module:nth-child(odd){
|
||||||
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.energy_data{padding: 12px; height: 64px; display: flex;align-items: center;background: #1C2755;border-radius: 8px;
|
.energy_data{padding: 12px; height: 64px; display: flex;align-items: center;background: $uni-bg-color-primary;border-radius: 8px;
|
||||||
.energy_icon{color: #009688;font-size: 24px;margin-right: 8px;}
|
.energy_icon{color: $uni-text-color-primary;font-size: 24px;margin-right: 8px;}
|
||||||
.energy_image{flex: 1;text-align: center;
|
.energy_image{flex: 1;text-align: center;
|
||||||
image{width: 86px;height: 32px;}
|
image{width: 86px;height: 32px;}
|
||||||
}
|
}
|
||||||
.energy_number{color: #FA3758;}
|
.energy_number{color: $uni-text-color-danger;}
|
||||||
}
|
}
|
||||||
.content_data{
|
.content_data{
|
||||||
// view{display: inline-block;width: 25%;}
|
padding: 10px 0;display: flex;position: relative;align-items: center;justify-content:flex-start;height: 98px;
|
||||||
padding: 10px 0;display: flex;position: relative;align-items: center;text-align: center;height: 98px;
|
|
||||||
.content_module{
|
.content_module{
|
||||||
width: 25%;margin: 10px 1%;height: 98px;display: flex;align-items: center;justify-content: center;flex-direction: column;background-color: #009688;border-radius: 8px;
|
width: calc(25% - 7px);margin: 10px 4px;height: 98px;display: flex;align-items: center;justify-content: center;flex-direction: column;background-color: $uni-color-primary;border-radius: 8px;
|
||||||
.contenticon{font-size: 24px;width: 32px;height: 32px;background-repeat: no-repeat;}
|
.contenticon{font-size: 24px;width: 32px;height: 32px;background-repeat: no-repeat;}
|
||||||
.contentname{padding-top: 2px;font-size: 12px;}
|
.contentname{padding-top: 2px;font-size: 12px;}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,50 +1,49 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 工单出材率 -->
|
<!-- 工单出材率 -->
|
||||||
<view class="page_padding font13">
|
<view class="page_padding font13">
|
||||||
<view v-for="(item,index) in list" :key="index" class="detail_list contentboxsty">
|
<view v-for="(item,index) in list" :key="index" class="detail_list contentboxsty" @click="toDetail(498)">
|
||||||
<view class="list_top">
|
<view class="list_top">
|
||||||
<view class="top_left">
|
<view class="top_left">
|
||||||
工单号:{{item.name}}
|
工单号:{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="top_right">
|
<view class="top_right">
|
||||||
工单详情 <text class="iconfont icon-gengduo"></text>
|
工单详情 <text class="arrow iconfont icon-gengduo"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list_content font13">
|
<view class="list_content font13">
|
||||||
<view class="list_centre">
|
<view class="list_centre">
|
||||||
<view class="list_row">
|
<view class="list_row">
|
||||||
<view class="centre_left">
|
<view class="centre_left">
|
||||||
<text>加工规格</text>
|
<text class="name">加工规格</text>
|
||||||
<text>{{item.specs}}</text>
|
<text class="text">{{item.specs}}</text>
|
||||||
</view>
|
|
||||||
<view class="centre_right">
|
|
||||||
生产中
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list_row">
|
<view class="list_row">
|
||||||
<view class="centre_left">
|
<view class="centre_left">
|
||||||
<text>算法出材率</text>
|
<text class="name">算法出材率</text>
|
||||||
<text>{{item.algorithm}}%</text>
|
<text class="text">{{item.algorithm}}%</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list_below">
|
<view class="list_below">
|
||||||
<view class="below_left">
|
<view class="below_left">
|
||||||
<view class="">
|
<view class="circle-progress">
|
||||||
出材率
|
<view class="progressBg">
|
||||||
</view>
|
<view class="progressBox">
|
||||||
<view class="percentage font24">
|
<view class="percentage font22">
|
||||||
{{item.algorithm}}%
|
{{item.algorithm}}%
|
||||||
</view>
|
</view>
|
||||||
|
<view class="title font12">
|
||||||
|
出材率
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="circle-progress__bar" :style="'--progress:'+item.algorithm+'%'"></view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="below_left">
|
</view>
|
||||||
<view class="">
|
<view class="card_right">
|
||||||
算法出材率
|
<view class="status">生产中</view>
|
||||||
</view>
|
|
||||||
<view class="percentage font24">
|
|
||||||
{{item.reality}}%
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -57,7 +56,7 @@
|
||||||
return {
|
return {
|
||||||
list:[{
|
list:[{
|
||||||
name:'SO202401111004',
|
name:'SO202401111004',
|
||||||
algorithm:'81.5',
|
algorithm:'51.5',
|
||||||
reality:'81.4',
|
reality:'81.4',
|
||||||
state:'生产中',
|
state:'生产中',
|
||||||
specs:'4*9*3.66',
|
specs:'4*9*3.66',
|
||||||
|
@ -75,7 +74,7 @@
|
||||||
number:'12.66m³'
|
number:'12.66m³'
|
||||||
},{
|
},{
|
||||||
name:'SO202401111004',
|
name:'SO202401111004',
|
||||||
algorithm:'81.5',
|
algorithm:'61.5',
|
||||||
reality:'81.4',
|
reality:'81.4',
|
||||||
state:'生产中',
|
state:'生产中',
|
||||||
specs:'4*9*3.66',
|
specs:'4*9*3.66',
|
||||||
|
@ -95,27 +94,28 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toDetail(id){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/production/productionDetail?id='+id
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style scoped lang="scss">
|
||||||
.detail_list{
|
.detail_list{
|
||||||
// .list_top{display: flex;padding: 12px 0;border-bottom: 1px solid #2D3A6F;margin-bottom: 8px;
|
|
||||||
// .top_left{flex: 1;}
|
|
||||||
// }
|
|
||||||
.list_centre{
|
.list_centre{
|
||||||
.list_row{display: flex;padding-bottom: 12px;
|
.list_row{display: flex;padding-bottom: 12px;
|
||||||
.centre_left{flex: 1;display: flex;
|
.centre_left{
|
||||||
text:first-child{width:80px;}
|
flex: 1;
|
||||||
|
.name{width:80px;display: inline-block;font-weight: bold;}
|
||||||
}
|
}
|
||||||
.centre_right{background: rgba(230,162,60,0.2);border-radius: 4px 4px 4px 4px;height: 20px;padding: 0 6px;color: #E6A23C;}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.list_below{display: flex;text-align: center;padding: 20px 0;
|
.list_below{display: flex;text-align: center;padding: 20px 0;
|
||||||
view{flex: 1;}
|
.below_left{flex: 1;display: flex;align-items: center;justify-content: center;}
|
||||||
.percentage{color: #00B68D;}
|
.percentage{color: $uni-text-color-inverse;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,62 +1,77 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 工单进度管理 -->
|
<!-- 工单进度管理 -->
|
||||||
<view class="page_padding">
|
<view class="page_padding columnFlex">
|
||||||
<view class="detail_list contentboxsty font13">
|
<view class="headerView" :class="headerFixed?'headerViewFixed':''">
|
||||||
<view class="list_top">
|
<searchView placeholder=" 搜索工单" />
|
||||||
<view class="top_left">
|
</view>
|
||||||
工单号:
|
<view class="flexBox">
|
||||||
</view>
|
<view class="detail_list contentboxsty font13" v-for="(item,index) in list" :key="index">
|
||||||
<view class="top_right">
|
<view @click="toDetail(497)">
|
||||||
工单详情
|
<view class="list_top">
|
||||||
</view>
|
<view class="top_left">
|
||||||
</view>
|
工单号:{{item.sn}}
|
||||||
<view class="list_content">
|
</view>
|
||||||
<view class="list_row">
|
<view class="top_right">
|
||||||
<view class="row_left">
|
工单详情<text class="arrow iconfont icon-gengduo"></text>
|
||||||
<view class="">开始时间:</view>
|
</view>
|
||||||
<view class="">24-01-12 08:00</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="row_right">
|
<view class="list_content">
|
||||||
生产中
|
<view class="list_row">
|
||||||
|
<text class="name">开始时间</text>
|
||||||
|
<text class="text">24-01-12 08:00</text>
|
||||||
|
</view>
|
||||||
|
<view class="list_row padd_top12">
|
||||||
|
<text class="name">计划完成</text>
|
||||||
|
<text class="text">24-01-12 08:00</text>
|
||||||
|
</view>
|
||||||
|
<view class="padd_top12">
|
||||||
|
<progressBar :total="100" :val="item.num" title="" />
|
||||||
|
</view>
|
||||||
|
<view class="card_right">
|
||||||
|
<view class="status">生产中</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list_row padd_top12">
|
</view>
|
||||||
<view class="">计划完成:</view>
|
|
||||||
<view class="">24-01-12 08:00</view>
|
|
||||||
</view>
|
|
||||||
<view class="padd_top12">
|
|
||||||
<progressBar :total="100" :val="20" title="" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <annularProgressBar :progress_txt="20" :width="84" :height="69" title="出材率"/> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import progressBar from '/components/progressBar.vue'
|
|
||||||
import annularProgressBar from '/components/chocolate-progress-bar/chocolate-progress-bar.vue'
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"progressBar":progressBar,
|
|
||||||
"annularProgressBar":annularProgressBar,
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list:[{name:''}]
|
list:[
|
||||||
|
{name:'',sn:"SO20240422000002",num:20},{name:'',sn:"SO20240422000002",num:70},{name:'',sn:"SO20240422000002",num:90},
|
||||||
|
{name:'',sn:"SO20240422000002",num:20},{name:'',sn:"SO20240422000002",num:70},{name:'',sn:"SO20240422000002",num:90}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toDetail(id){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/production/productionDetail?id='+id
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.page_padding{
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
.detail_list{
|
.detail_list{
|
||||||
.list_content{
|
.list_content{
|
||||||
.list_row{display: flex;
|
.list_row{
|
||||||
.row_left{display: flex;}
|
.name{
|
||||||
|
width: 65px;
|
||||||
|
display: inline-block;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
<view class="iconfont icon-shouye" @click="toIndex()" style="height: 25px;position: absolute;top: 60px;width: 30px;"></view>
|
<view class="iconfont icon-shouye" @click="toIndex()" style="height: 25px;position: absolute;top: 60px;width: 30px;"></view>
|
||||||
<view class="login_top">
|
<view class="login_top">
|
||||||
<view class="login_logo">
|
<view class="login_logo">
|
||||||
<image src="https://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/meslogo.png" class="logopng"></image>
|
<image src="https://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/loginLogo.png" class="demupng"></image>
|
||||||
<image src="https://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/demu.png" class="demupng"></image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="name">
|
||||||
自动化MES管理系统
|
自动化MES管理系统
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -36,7 +35,7 @@
|
||||||
<view class="getCaptcha">{{codename}}</view>
|
<view class="getCaptcha">{{codename}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="tab==1" style="color: #C4C4C4;font-size: 11px; padding-top: 14px;">
|
<view class="" v-if="tab==1" style="color: #C4C4C4;font-size: 12px;padding-top: 14px;">
|
||||||
记住密码
|
记住密码
|
||||||
</view>
|
</view>
|
||||||
<view class="loginbut" @click="login()">
|
<view class="loginbut" @click="login()">
|
||||||
|
@ -80,13 +79,12 @@
|
||||||
this.$set(this,"tab",tab);
|
this.$set(this,"tab",tab);
|
||||||
},
|
},
|
||||||
toIndex(){
|
toIndex(){
|
||||||
uni.navigateBack({
|
uni.reLaunch({
|
||||||
delta: 2
|
url:'/pages/index/index'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
login(){
|
login(){
|
||||||
this.$api.postFuncLoading('/user.login',{login_name:this.accountValue,password:this.passValue}).then(res=>{
|
this.$api.postFuncLoading('/user.login',{login_name:this.accountValue,password:this.passValue}).then(res=>{
|
||||||
console.log(res)
|
|
||||||
let obj = new Object();
|
let obj = new Object();
|
||||||
obj.mes_user_name=res.data.user.name;
|
obj.mes_user_name=res.data.user.name;
|
||||||
obj.mes_token=res.data.token;
|
obj.mes_token=res.data.token;
|
||||||
|
@ -105,19 +103,21 @@
|
||||||
.login_page{
|
.login_page{
|
||||||
padding: 0 32px;
|
padding: 0 32px;
|
||||||
background: url('https://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/background.png') no-repeat;
|
background: url('https://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/background.png') no-repeat;
|
||||||
background-position: center center;
|
background-position: center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
.login_top{padding-top: 160px;padding-bottom: 32px;}
|
.login_top{padding-top: 160px;padding-bottom: 32px;}
|
||||||
|
.login_top .name{letter-spacing: 1.2px;background: linear-gradient(to right, #fff, rgba(255,255,255,0.1));
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
}
|
||||||
.login_logo{display: flex;align-items: center;margin-bottom: 17px;}
|
.login_logo{display: flex;align-items: center;margin-bottom: 17px;}
|
||||||
.logopng{width: 53px;height: 44px;}
|
.demupng{width: 117px;height: 43px;}
|
||||||
.demupng{width: 60px;height: 36px;}
|
|
||||||
.login_centre{border-radius: 16px;background: #FFF;padding: 20px 24px 40px;}
|
.login_centre{border-radius: 16px;background: #FFF;padding: 20px 24px 40px;}
|
||||||
.login_switch{display: flex;}
|
.login_switch{display: flex;}
|
||||||
.login_name{flex: 1;text-align: center;
|
.login_name{flex: 1;text-align: center;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
/* border-bottom: 1px solid #000; */
|
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.login_name:focus {
|
.login_name:focus {
|
||||||
|
@ -134,13 +134,13 @@
|
||||||
bottom: -4px;
|
bottom: -4px;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
border-bottom: 3px solid #009688 ;
|
border-bottom: 3px solid #009688;
|
||||||
}
|
}
|
||||||
.login_input{border-radius: 21.5px;background: #F3F5F9;margin-top: 12px;padding: 5px 15px;}
|
.login_input{border-radius: 21.5px;background: #F3F5F9;margin-top: 12px;padding: 9px 15px;font-size: 14px;}
|
||||||
.getCaptcha{border-radius: 21.5px;background: #009688;height: auto;color: white;display: flex;align-items: center;width: 40%;justify-content: center;}
|
.getCaptcha{border-radius: 21.5px;background: #009688;height: auto;color: white;display: flex;align-items: center;width: 40%;justify-content: center;}
|
||||||
.flex_layout{display: flex;margin-top: 12px;}
|
.flex_layout{display: flex;margin-top: 12px;}
|
||||||
.login_code{margin-top: unset;width:60%;margin-right: 12px;}
|
.login_code{margin-top: unset;width:60%;margin-right: 12px;}
|
||||||
.loginbut{background: #009688;text-align: center;margin-top: 60px;margin-bottom: 18px;padding: 9px;border-radius: 66rpx;}
|
.loginbut{background: #009688;text-align: center;margin-top: 40px;margin-bottom: 18px;padding: 9px;border-radius: 66rpx;}
|
||||||
.persontc{
|
.persontc{
|
||||||
border: none;
|
border: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
<view class="person_page ">
|
<view class="person_page ">
|
||||||
<view class="person_top">
|
<view class="person_top">
|
||||||
<view class="person_data">
|
<view class="person_data">
|
||||||
<!-- <view class="person_logo"> -->
|
<view class="person_logo">
|
||||||
<!-- <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"> -->
|
<!-- <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar"> -->
|
||||||
<image class="person_logo" :src="avatarUrl"></image>
|
<image class="img" :src="avatarUrl"></image>
|
||||||
<!-- </button> -->
|
<!-- </button> -->
|
||||||
<!-- </view> -->
|
</view>
|
||||||
<view class="person_name">
|
<view class="person_name">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
<text class="font15">肖银奎</text>
|
<text class="font15">肖银奎</text>
|
||||||
|
@ -75,6 +75,9 @@
|
||||||
<view class="con_set">
|
<view class="con_set">
|
||||||
<view class="t-icon t-icon-xitongshezhi-gerenzhongxin personicon"></view>
|
<view class="t-icon t-icon-xitongshezhi-gerenzhongxin personicon"></view>
|
||||||
<view class="font13">系统设置</view>
|
<view class="font13">系统设置</view>
|
||||||
|
</view>
|
||||||
|
<view class="login_out">
|
||||||
|
<view class="font13">退出登录</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<tab-bar :current-page="2"></tab-bar>
|
<tab-bar :current-page="2"></tab-bar>
|
||||||
|
@ -83,7 +86,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tabBar from "@/components/customTabBar/index";
|
import tabBar from "@/components/customTabBar/index";
|
||||||
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0';
|
const defaultAvatarUrl = 'https://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/avatar.png';
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
tabBar
|
tabBar
|
||||||
|
@ -137,7 +140,18 @@
|
||||||
.person_page{ padding: 14px;
|
.person_page{ padding: 14px;
|
||||||
.person_top{margin-bottom:33px ;
|
.person_top{margin-bottom:33px ;
|
||||||
.person_data{display: flex;align-items: center;
|
.person_data{display: flex;align-items: center;
|
||||||
.person_logo{border-radius: 50%;width: 54px;height: 54px;margin:0 6px 0 4px;}
|
.person_logo{
|
||||||
|
border-radius: 50%;width: 54px;height: 54px;margin:0 6px 0 4px;position: relative;
|
||||||
|
.img{
|
||||||
|
height: 100%;width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.person_logo::before{
|
||||||
|
content: '';position: absolute;right: 2px;bottom: 1px;z-index: 10;border: 1px solid $uni-bg-color-default; background: $uni-bg-color-whith;width: 10px;height: 10px;border-radius: 50%;
|
||||||
|
}
|
||||||
|
.person_logo::after{
|
||||||
|
content: '';position: absolute;right: 4px;bottom: 3px;z-index: 20;background: $uni-bg-color-success;width: 8px;height: 8px;border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
.person_name{
|
.person_name{
|
||||||
.name{display: flex;align-items: center;margin-bottom: 2px;
|
.name{display: flex;align-items: center;margin-bottom: 2px;
|
||||||
|
@ -147,20 +161,26 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.person_content{
|
.person_content{
|
||||||
.con_backlog{padding: 14px 10px 14px 15px;background: #1C2755;border-radius: 8px;margin-bottom: 12px;
|
padding-bottom: 100px;
|
||||||
.backlog_data{display: flex; flex-wrap: wrap;margin-top: 7px;
|
.con_backlog{padding: 14px 10px;background: $uni-bg-color-primary;border-radius: 8px;margin-bottom: 12px;
|
||||||
.backlog_module{width: 93px;height: 76px;display: flex;justify-content: center;flex-direction: column;align-items: center;border-radius: 8px;
|
.backlog_data{
|
||||||
background: #6576B7;margin: 5px 6px;}
|
display: flex;flex-wrap:wrap;margin-top:7px;
|
||||||
|
.backlog_module{
|
||||||
|
width: calc(33.33% - 12px);height: 76px;display: flex;justify-content: center;flex-direction: column;align-items: center;border-radius: 8px;
|
||||||
|
background: $uni-color-info;margin: 5px 6px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
.backlogicon{width: 32px;height: 32px;}
|
.backlogicon{width: 32px;height: 32px;}
|
||||||
.backlogname{
|
.backlogname{
|
||||||
font-size: $uni-font-size-sm;
|
font-size: $uni-font-size-sm;
|
||||||
padding-top: 5px;}
|
padding-top: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.con_account{
|
.con_account{
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: #1C2755;
|
background: $uni-bg-color-primary;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 52px;
|
height: 52px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -169,19 +189,32 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
.personicon{width: 24px;height: 24px;margin-right: 15px;}
|
.personicon{width: 24px;height: 24px;margin-right: 15px;}
|
||||||
.con_data{border-radius: 8px;
|
.con_data{
|
||||||
background: #1C2755;
|
border-radius: 8px;
|
||||||
|
background: $uni-bg-color-primary;
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
.con_module{display: flex;height: 49px;align-items: center;border-bottom: 1px solid #2D3A6F;}
|
.con_module{display: flex;height: 49px;align-items: center;border-bottom: 1px solid $uni-border-color-primary;}
|
||||||
}
|
}
|
||||||
.con_set{border-radius: 8px;
|
.con_set{
|
||||||
background: #1C2755;
|
border-radius: 8px;
|
||||||
|
background: $uni-bg-color-primary;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
}
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.login_out{
|
||||||
|
border-radius: 8px;
|
||||||
|
background: $uni-bg-color-primary;
|
||||||
|
display: flex;
|
||||||
|
height: 48px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0 14px;
|
||||||
|
color: $uni-text-color-danger;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -5,8 +5,8 @@
|
||||||
<view class="top_left">
|
<view class="top_left">
|
||||||
工单号 <text class="padd_left12">{{form.order_sn}}</text>
|
工单号 <text class="padd_left12">{{form.order_sn}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="top_right font13">
|
<view class="top_right font12">
|
||||||
{{form.review_status_label}}
|
{{form.active_status_label}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list_content">
|
<view class="list_content">
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="content_row">
|
<view class="content_row">
|
||||||
<text class="name">工单耗时</text>
|
<text class="name">工单耗时</text>
|
||||||
<text class="data">10h</text>
|
<text class="data">{{form.processing_time}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_row">
|
<view class="content_row">
|
||||||
<text class="name">加工规格</text>
|
<text class="name">加工规格</text>
|
||||||
|
@ -29,11 +29,11 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="content_row">
|
<view class="content_row">
|
||||||
<text class="name">规格料</text>
|
<text class="name">规格料</text>
|
||||||
<text class="data">13.01m³</text>
|
<text class="data">{{form.cube}}m³</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_row">
|
<view class="content_row">
|
||||||
<text class="name">生产负责</text>
|
<text class="name">生产负责</text>
|
||||||
<text class="data">张三</text>
|
<text class="data">{{form.creator_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_row">
|
<view class="content_row">
|
||||||
<text class="name">加工等级</text>
|
<text class="name">加工等级</text>
|
||||||
|
@ -49,7 +49,22 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content_right">
|
<view class="content_right">
|
||||||
|
<progressBar :total="100" :val="form.progress_rate" title="" />
|
||||||
|
</view>
|
||||||
|
<view class="progressView">
|
||||||
|
<view class="circle-progress">
|
||||||
|
<view class="progressBg">
|
||||||
|
<view class="progressBox">
|
||||||
|
<view class="percentage font22">
|
||||||
|
{{form.yield_rate}}%
|
||||||
|
</view>
|
||||||
|
<view class="title font12">
|
||||||
|
出材率
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="circle-progress__bar" :style="'--progress:'+form.yield_rate+'%'"></view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -64,16 +79,17 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option){
|
onLoad(option){
|
||||||
console.log(option)
|
|
||||||
this.detailData(option.id)
|
this.detailData(option.id)
|
||||||
},
|
},
|
||||||
onShow(){
|
onShow(){
|
||||||
// this.detailData()
|
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
detailData(id){
|
detailData(id){
|
||||||
this.$api.postFuncLoading('/order.info',{id:id}).then(res=>{
|
this.$api.postFuncLoading('/order.info',{id:id}).then(res=>{
|
||||||
console.log(res.data)
|
|
||||||
this.form = res.data
|
this.form = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -83,11 +99,18 @@
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.list_top{
|
.list_top{
|
||||||
.top_right{background: #243168;border-radius: 4px 4px 4px 4px;width: 46px;height: 20px;text-align: center;}
|
.top_right{background: #243168;border-radius: 4px;padding: 3px 10px; text-align: center;display: inline-block;}
|
||||||
}
|
}
|
||||||
.list_content{
|
.list_content{
|
||||||
.content_row{display: flex;padding:6px 0;
|
.content_row{display: flex;padding:6px 0;
|
||||||
.name{width: 90px;}
|
.name{width: 90px;font-weight: bold;}
|
||||||
|
}
|
||||||
|
.content_right{padding: 6px 0;}
|
||||||
|
.progressView{
|
||||||
|
position: absolute;
|
||||||
|
top: 12px;
|
||||||
|
right:12px;
|
||||||
|
z-index: 20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,87 +1,162 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 生产工单 -->
|
<!-- 生产工单 -->
|
||||||
<view class="page_padding">
|
<view class="page_padding columnFlex">
|
||||||
<view v-for="(item,index) in list" :key="index" class="detail_list contentboxsty font13">
|
<view class="headerView" :class="headerFixed?'headerViewFixed':''">
|
||||||
<view @click="toDetail(item.id)">
|
<searchView placeholder=" 搜索工单" />
|
||||||
<view class="list_top">
|
</view>
|
||||||
<view class="top_left">
|
<view class="flexBox">
|
||||||
工单号:{{item.order_sn}}
|
<!-- <scroll-view scroll-y="true" class="scrollView"> -->
|
||||||
|
<view v-for="(item,index) in list" :key="index" class="detail_list contentboxsty font13">
|
||||||
|
<view @click="toDetail(item.id)">
|
||||||
|
<view class="list_top">
|
||||||
|
<view class="top_left">
|
||||||
|
工单号:{{item.order_sn}}
|
||||||
|
</view>
|
||||||
|
<view class="top_right">
|
||||||
|
工单详情 <text class="arrow iconfont icon-gengduo"></text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="top_right">
|
<view class="list_content font13">
|
||||||
工单详情 <text class="iconfont icon-gengduo"></text>
|
<view class="list_centre">
|
||||||
</view>
|
<view class="centre_left">
|
||||||
</view>
|
<view class="name font_bold">
|
||||||
<view class="list_content font13">
|
算法出材率
|
||||||
<view class="list_centre">
|
</view>
|
||||||
<view class="centre_left">
|
<view class="percentage font24">
|
||||||
<view class="">
|
{{item.algorithm && item.algorithm!=''?item.algorithm+'':'0'}}%
|
||||||
算法出材率
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="percentage font24">
|
<view class="centre_left">
|
||||||
{{item.algorithm}}%
|
<view class="name font_bold">
|
||||||
|
实际出材率
|
||||||
|
</view>
|
||||||
|
<view class="percentage font24">
|
||||||
|
{{item.reality && item.reality!=''?item.reality:'0'}}%
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="centre_left">
|
<view class="list_below">
|
||||||
<view class="">
|
<view class="row">
|
||||||
实际出材率
|
<view class="row_left">
|
||||||
|
<text class="name">状态</text>
|
||||||
|
<text class="text status">{{item.active_status_label}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="row_right">
|
||||||
|
<text class="name">加工规格</text>
|
||||||
|
<text class="text">{{item.order_spec}}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="percentage font24">
|
<view class="row">
|
||||||
{{item.reality}}%
|
<view class="row_left">
|
||||||
|
<text class="name">生产开始</text>
|
||||||
|
<text class="text">{{item.plan_date}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="row_right">
|
||||||
|
<text class="name">工单耗时</text>
|
||||||
|
<text class="text">{{item.progress_rate}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="row_left">
|
||||||
|
<text class="name">工单数量</text>
|
||||||
|
<text class="text">{{item.order_number}}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list_below">
|
</view>
|
||||||
<view class="row">
|
</view>
|
||||||
<view class="row_left">
|
<loadMore :noData="loadParams.noData" :loading="loadParams.loading" :loadEnd="loadParams.loadEnd" />
|
||||||
<text>状态:</text>
|
<!-- </scroll-view> -->
|
||||||
<text>{{item.review_status_label}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="row_right">
|
|
||||||
<text>加工规格:</text>
|
|
||||||
<text>{{item.order_spec}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="row">
|
|
||||||
<view class="row_left">
|
|
||||||
<text>生产开始:</text>
|
|
||||||
<text>{{item.plan_date}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="row_right">
|
|
||||||
<text>工单耗时:</text>
|
|
||||||
<text>{{item.timeConsuming}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="row">
|
|
||||||
<view class="row_left">
|
|
||||||
<text>工单数量:</text>
|
|
||||||
<text>{{item.order_number}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
components:{
|
||||||
|
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list:[]
|
headerFixed:false,
|
||||||
|
list:[],
|
||||||
|
params:{
|
||||||
|
page:1,
|
||||||
|
pageSize:10,
|
||||||
|
},
|
||||||
|
loadParams:{
|
||||||
|
noData:false,
|
||||||
|
loading:false,
|
||||||
|
loadEnd:false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow(){
|
onShow(){
|
||||||
this.listData();
|
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
this.listData();
|
||||||
|
},
|
||||||
|
onPageScroll(e){
|
||||||
|
if(e.scrollTop>30){
|
||||||
|
this.headerFixed = true;
|
||||||
|
}else{
|
||||||
|
this.headerFixed = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 上拉刷新
|
||||||
|
onPullDownRefresh(){
|
||||||
|
this.params.page = 1;
|
||||||
|
this.listData(2);
|
||||||
|
},
|
||||||
|
// 加载下一页
|
||||||
|
onReachBottom(){
|
||||||
|
if(!(this.loadParams.loadEnd || this.loadParams.noData)){
|
||||||
|
this.loadParams.loading = true;
|
||||||
|
this.params.page ++;
|
||||||
|
this.listData();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
listData(){
|
listData(type=1){
|
||||||
this.$api.postFuncLoading('/order.list',{page: 1,pageSize: 15}).then(res=>{
|
if(this.params.page == 1){
|
||||||
this.list = res.data.rows
|
uni.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.$api.request('/order.list',this.params).then(res=>{
|
||||||
|
console.log(res,566)
|
||||||
|
if(type ==2){
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
}
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.hideLoading();
|
||||||
|
}, 200);
|
||||||
|
|
||||||
|
this.loadParams.loading = false;
|
||||||
|
if(res.data.rows.length ==0 && this.params.page == 1){
|
||||||
|
this.loadParams.noData = true;
|
||||||
|
}
|
||||||
|
if(res.data.rows.length>0 && res.data.rows.length < this.params.pageSize){
|
||||||
|
this.loadParams.loadEnd = true;
|
||||||
|
}
|
||||||
|
if(this.params.page == 1){
|
||||||
|
this.list = res.data.rows;
|
||||||
|
}else{
|
||||||
|
this.list = this.list.concat(res.data.rows);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(err=>{
|
||||||
|
console.log('err',err)
|
||||||
|
setTimeout(function () {
|
||||||
|
uni.hideLoading();
|
||||||
|
}, 200);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//跳转工单详情
|
//跳转工单详情
|
||||||
toDetail(id){
|
toDetail(id){
|
||||||
console.log(id)
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/production/productionDetail?id='+id
|
url:'/pages/production/productionDetail?id='+id
|
||||||
})
|
})
|
||||||
|
@ -90,16 +165,34 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style scoped lang="scss">
|
||||||
.detail_list{
|
.page_padding{
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
.detail_list{
|
||||||
.list_centre{display: flex;text-align: center;padding-bottom: 10px;
|
.list_centre{display: flex;text-align: center;padding-bottom: 10px;
|
||||||
view{flex: 1;}
|
view{flex: 1;}
|
||||||
.percentage{color: #00B68D;}
|
.percentage{color: $uni-text-color-primary;margin: 10px 0 0 0;}
|
||||||
}
|
}
|
||||||
.list_below{padding-bottom: 12px;
|
.list_below{padding-bottom: 12px;
|
||||||
.row{display: flex;padding-top: 10px;
|
.row{display: flex;padding-top: 10px;
|
||||||
.row_left{ white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
|
.row_left{
|
||||||
view{flex: 1;}
|
white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
|
||||||
|
padding-right: 4px;
|
||||||
|
}
|
||||||
|
.row_right{
|
||||||
|
white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
|
view{flex: 1;}
|
||||||
|
.row_left .name,.row_right .name{
|
||||||
|
display: inline-block;
|
||||||
|
width: 65px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.status{
|
||||||
|
color: $uni-text-color-warning;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,78 @@
|
||||||
|
/* 检索部分 */
|
||||||
|
.columnFlex{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.headerView{
|
||||||
|
padding: 10px 0;
|
||||||
|
flex-basis: 40px;
|
||||||
|
}
|
||||||
|
.searchBox .searchView{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.searchBox .searchInput{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
.searchBox .searchInput .input{
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 7px 13px 7px 13px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.searchBox .searchInput .filter{
|
||||||
|
flex-basis: 32px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.headerViewFixed{
|
||||||
|
position: fixed;
|
||||||
|
left: 14px;
|
||||||
|
top: 0;
|
||||||
|
z-index: 100;
|
||||||
|
width: calc(100% - 28px);
|
||||||
|
}
|
||||||
|
.flexBox{
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.scrollView{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 加载更多部分 */
|
||||||
|
.noData{
|
||||||
|
margin: 50% auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.noData .imgView .img{
|
||||||
|
width: 180px;
|
||||||
|
height: 138px;
|
||||||
|
}
|
||||||
|
.noData .text{
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.loadBox{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.loadBox .text{
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
.loadBox .icon{
|
||||||
|
animation: spin 0.6s linear infinite;
|
||||||
|
}
|
||||||
|
@keyframes spin {
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 4403683 */
|
font-family: "iconfont"; /* Project id 4403683 */
|
||||||
src: url('//at.alicdn.com/t/c/font_4403683_5b5i159cydc.woff2?t=1709604278213') format('woff2'),
|
src: url('//at.alicdn.com/t/c/font_4403683_4mp9v07pqat.woff2?t=1713756401049') format('woff2'),
|
||||||
url('//at.alicdn.com/t/c/font_4403683_5b5i159cydc.woff?t=1709604278213') format('woff'),
|
url('//at.alicdn.com/t/c/font_4403683_4mp9v07pqat.woff?t=1713756401049') format('woff'),
|
||||||
url('//at.alicdn.com/t/c/font_4403683_5b5i159cydc.ttf?t=1709604278213') format('truetype');
|
url('//at.alicdn.com/t/c/font_4403683_4mp9v07pqat.ttf?t=1713756401049') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
|
@ -13,6 +13,46 @@
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-meiyougengduo:before {
|
||||||
|
content: "\e638";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-loading:before {
|
||||||
|
content: "\e891";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-bianji1:before {
|
||||||
|
content: "\e601";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-bangding1:before {
|
||||||
|
content: "\e602";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-a-shaixuan2:before {
|
||||||
|
content: "\e636";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-a-Vector6:before {
|
||||||
|
content: "\e637";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-a-Vector6-copy:before {
|
||||||
|
content: "\e655";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-saoyisao:before {
|
||||||
|
content: "\e600";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-a-shengchanshijian1:before {
|
||||||
|
content: "\e63b";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-weixuanzhong:before {
|
||||||
|
content: "\e635";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-paizhao:before {
|
.icon-paizhao:before {
|
||||||
content: "\e633";
|
content: "\e633";
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
48
uni.scss
48
uni.scss
|
@ -1,10 +1,56 @@
|
||||||
@import '@/uni_modules/uni-scss/variables.scss';
|
@import '@/uni_modules/uni-scss/variables.scss';
|
||||||
|
|
||||||
|
/* 行为基本色 */
|
||||||
|
$uni-color-primary: #009688;
|
||||||
|
$uni-color-success: #67C23A;
|
||||||
|
$uni-color-warning: #F5AC3F;
|
||||||
|
$uni-color-error: #F84545;
|
||||||
|
$uni-color-info: #6576B7;
|
||||||
|
|
||||||
|
/* 文字基本色 */
|
||||||
|
$uni-text-color-primary: #009688;
|
||||||
|
$uni-text-color-success: #67C23A;
|
||||||
|
$uni-text-color-info: #909398;
|
||||||
|
$uni-text-color-warning: #F5AC3F;
|
||||||
|
$uni-text-color-danger: #FA3758;
|
||||||
|
$uni-text-color: #333;
|
||||||
|
$uni-text-color-tip: #6E6E6E;
|
||||||
|
$uni-text-color-inverse: #fff;
|
||||||
|
$uni-text-color-grey: #999999;
|
||||||
|
$uni-text-color-placeholder: rgba(255,255,255,0.7);
|
||||||
|
$uni-text-color-default: #000000;
|
||||||
|
|
||||||
/* 文字尺寸 */
|
/* 文字尺寸 */
|
||||||
$uni-font-size-sm:24rpx;
|
$uni-font-size-sm:24rpx;
|
||||||
$uni-font-size-base:28rpx;
|
$uni-font-size-base:28rpx;
|
||||||
$uni-font-size-lg:32rpx;
|
$uni-font-size-lg:32rpx;
|
||||||
|
|
||||||
|
/* 背景色 */
|
||||||
|
$uni-bg-color-default:#060B26;
|
||||||
|
$uni-bg-color-primary:#1C2755;
|
||||||
|
$uni-bg-color-success:#67C23A;
|
||||||
|
$uni-bg-color-warning:#F5AC3F;
|
||||||
|
$uni-bg-color-error:#F84545;
|
||||||
|
$uni-bg-color-info:#6576B7;
|
||||||
|
$uni-bg-color-grey:#CCCCCC;
|
||||||
|
$uni-bg-color-whith:#FFFFFF;
|
||||||
|
$uni-bg-color-default-dark:rgba(0, 150, 136, 0.5);
|
||||||
|
$uni-bg-color-success-dark:rgba(103, 194, 58, 0.25);
|
||||||
|
$uni-bg-color-warning-dark:rgba(230, 162, 60, 0.25);
|
||||||
|
$uni-bg-color-error-dark:rgba(248, 69, 69, 0.25);
|
||||||
|
|
||||||
|
|
||||||
|
/* 边框的颜色 */
|
||||||
|
$uni-border-color-primary:#2D3A6F;
|
||||||
|
$uni-border-color-default:#131E3B;
|
||||||
|
|
||||||
|
|
||||||
|
/* 边框阴影 */
|
||||||
|
$uni-border-shadow-color-default:#999999;
|
||||||
|
$uni-border-shadow-color-white:#ffffff;
|
||||||
|
$uni-border-shadow-color-black:#000000;
|
||||||
|
|
||||||
/* 透明度 */
|
/* 透明度 */
|
||||||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
|
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
|
||||||
|
|
||||||
|
|
||||||
|
|
95
utils/api.js
95
utils/api.js
|
@ -1,52 +1,54 @@
|
||||||
import config from './envConfig.js';
|
import config from './envConfig.js';
|
||||||
import wf from './public.js'
|
import wf from './public.js'
|
||||||
|
|
||||||
const request = (url = '', data = {}, header = { //这里这样封装是为了后续具体组件中使用时可以直接传参,需按此顺序传参;而不需要写url:xxx等键值对传参
|
const request = (url = '', data = {}, header = {
|
||||||
//具体的header和后端商同后再编写,这里以常见的token为例
|
|
||||||
'Authorization': 'Bearer '+uni.getStorageSync('mes_token') ? 'Bearer '+uni.getStorageSync('mes_token') : '',
|
'Authorization': 'Bearer '+uni.getStorageSync('mes_token') ? 'Bearer '+uni.getStorageSync('mes_token') : '',
|
||||||
}) => {
|
}) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// console.log(config,800)
|
|
||||||
uni.request({
|
uni.request({
|
||||||
url: config.dev.VITE_BASE_API + url, //接口地址:前缀+方法中传入的地址
|
url: config.dev.VITE_BASE_API + url,
|
||||||
method: "POST", //请求方法
|
method: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: data, //传递参数
|
data: data,
|
||||||
header: header, //自定义头部,和后端商同后编写
|
header: header,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// console.log('request.js文件的通用接口请求封装返回的结果数据',res);
|
if (res.data.code == 401){
|
||||||
//注:因为这里对请求成功的没有统一设置抛错提示,所以后续具体组件中使用接口请求的res除200(实际以后端同事定好的为准)成功外的其他code需要额外写抛错提示
|
setTimeout( ()=> {
|
||||||
if (res.data.code == 'xxx') { //自定请求失败的情况,这里以常见的token失效或过期为例
|
uni.hideLoading();
|
||||||
uni.removeStorageSync('token');
|
}, 200);
|
||||||
|
|
||||||
|
console.log(res.data.code,455)
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
title: '温馨提示',
|
title: '温馨提示',
|
||||||
content: res.data.msg,
|
confirmColor:'#009688',
|
||||||
// header: {
|
content: res.data.message,
|
||||||
// "Token": 'Bearer ' + uni.getStorageSync("mes_token")
|
success: (result)=> {
|
||||||
// },
|
|
||||||
success: function(result) {
|
|
||||||
if (result.confirm) {
|
if (result.confirm) {
|
||||||
// uni.reLaunch({
|
uni.reLaunch({
|
||||||
// url: '/pages/login/index' //这里需用绝对路径才可
|
url: '/pages/login/login'
|
||||||
// });
|
});
|
||||||
|
wf.removeLoginData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
console.log(res.data.code,888)
|
||||||
|
|
||||||
}
|
}
|
||||||
if(res.header.Authorization){
|
if(res.header.Authorization){
|
||||||
uni.removeStorageSync('mes_token');
|
uni.removeStorageSync('mes_token');
|
||||||
let obj = new Object();
|
let obj = new Object();
|
||||||
let str =String(res.header.Authorization)
|
let str = String(res.header.Authorization)
|
||||||
let newStr = str.slice(0, 0) + str.slice(7)
|
let newStr = str.slice(0, 0) + str.slice(7)
|
||||||
obj.mes_token=newStr;
|
obj.mes_token = newStr;
|
||||||
uni.setStorageSync("mes_token",obj.mes_token);
|
uni.setStorageSync("mes_token",obj.mes_token);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(res.data) //成功
|
// 成功的回调
|
||||||
|
if(res.data.code == 200){
|
||||||
|
resolve(res.data)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 这里的接口请求,如果出现问题就输出接口请求失败的msg;
|
|
||||||
//注:因为这里对于请求失败的设置统一抛错提示了,所以后续具体组件中使用接口请求的catch中不需要再写抛错提示
|
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "" + err.msg,
|
title: "" + err.msg,
|
||||||
|
@ -57,8 +59,7 @@ const request = (url = '', data = {}, header = { //这里这样封装是为了
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const postFuncLoading = (url = '', data = {}, header = { //这里这样封装是为了后续具体组件中使用时可以直接传参,需按此顺序传参;而不需要写url:xxx等键值对传参
|
const postFuncLoading = (url = '', data = {}, header = {
|
||||||
//具体的header和后端商同后再编写,这里以常见的token为例
|
|
||||||
'Authorization': 'Bearer '+uni.getStorageSync('mes_token') ? 'Bearer '+uni.getStorageSync('mes_token') : '',
|
'Authorization': 'Bearer '+uni.getStorageSync('mes_token') ? 'Bearer '+uni.getStorageSync('mes_token') : '',
|
||||||
}) => {
|
}) => {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
|
@ -66,7 +67,6 @@ const request = (url = '', data = {}, header = { //这里这样封装是为了
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// console.log(config,800)
|
|
||||||
uni.request({
|
uni.request({
|
||||||
url: config.dev.VITE_BASE_API + url, //接口地址:前缀+方法中传入的地址
|
url: config.dev.VITE_BASE_API + url, //接口地址:前缀+方法中传入的地址
|
||||||
method: "POST", //请求方法
|
method: "POST", //请求方法
|
||||||
|
@ -74,25 +74,21 @@ const request = (url = '', data = {}, header = { //这里这样封装是为了
|
||||||
data: data, //传递参数
|
data: data, //传递参数
|
||||||
header: header, //自定义头部,和后端商同后编写
|
header: header, //自定义头部,和后端商同后编写
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
setTimeout(function () {
|
setTimeout( ()=> {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
}, 200);
|
}, 200);
|
||||||
// console.log('request.js文件的通用接口请求封装返回的结果数据',res);
|
if (res.data.code == 401){
|
||||||
//注:因为这里对请求成功的没有统一设置抛错提示,所以后续具体组件中使用接口请求的res除200(实际以后端同事定好的为准)成功外的其他code需要额外写抛错提示
|
wf.removeLoginData();
|
||||||
if (res.data.code == 'xxx') { //自定请求失败的情况,这里以常见的token失效或过期为例
|
|
||||||
uni.removeStorageSync('token');
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
title: '温馨提示',
|
title: '温馨提示',
|
||||||
content: res.data.msg,
|
confirmColor:'#009688',
|
||||||
// header: {
|
content: res.data.message,
|
||||||
// "Token": 'Bearer ' + uni.getStorageSync("mes_token")
|
success: (result)=> {
|
||||||
// },
|
|
||||||
success: function(result) {
|
|
||||||
if (result.confirm) {
|
if (result.confirm) {
|
||||||
// uni.reLaunch({
|
uni.reLaunch({
|
||||||
// url: '/pages/login/index' //这里需用绝对路径才可
|
url: '/pages/login/login'
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -100,16 +96,16 @@ const request = (url = '', data = {}, header = { //这里这样封装是为了
|
||||||
if(res.header.Authorization){
|
if(res.header.Authorization){
|
||||||
uni.removeStorageSync('mes_token');
|
uni.removeStorageSync('mes_token');
|
||||||
let obj = new Object();
|
let obj = new Object();
|
||||||
let str =String(res.header.Authorization)
|
let str = String(res.header.Authorization)
|
||||||
let newStr = str.slice(0, 0) + str.slice(7)
|
let newStr = str.slice(0, 0) + str.slice(7)
|
||||||
obj.mes_token=newStr;
|
obj.mes_token = newStr;
|
||||||
uni.setStorageSync("mes_token",obj.mes_token);
|
uni.setStorageSync("mes_token",obj.mes_token);
|
||||||
}
|
}
|
||||||
|
// 成功的回调
|
||||||
resolve(res.data) //成功
|
if(res.data.code == 200){
|
||||||
|
resolve(res.data)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 这里的接口请求,如果出现问题就输出接口请求失败的msg;
|
|
||||||
//注:因为这里对于请求失败的设置统一抛错提示了,所以后续具体组件中使用接口请求的catch中不需要再写抛错提示
|
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "" + err.msg,
|
title: "" + err.msg,
|
||||||
|
@ -123,6 +119,5 @@ const request = (url = '', data = {}, header = { //这里这样封装是为了
|
||||||
export default {
|
export default {
|
||||||
request,
|
request,
|
||||||
postFuncLoading
|
postFuncLoading
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// 导出的环境请求地址
|
|
||||||
//本地环境
|
//本地环境
|
||||||
const dev = {
|
const dev = {
|
||||||
ENV: "dev",
|
ENV: "dev",
|
||||||
|
@ -9,13 +8,7 @@ const pro = {
|
||||||
ENV: "pro",
|
ENV: "pro",
|
||||||
VITE_BASE_API: "https://api.dev.dwoodauto.com",
|
VITE_BASE_API: "https://api.dev.dwoodauto.com",
|
||||||
};
|
};
|
||||||
// //测试环境
|
|
||||||
// const test = {
|
|
||||||
// ENV: "test",
|
|
||||||
// VITE_BASE_API: "https://api.dev.dwoodauto.com",
|
|
||||||
// };
|
|
||||||
export default {
|
export default {
|
||||||
dev,
|
dev,
|
||||||
// test,
|
|
||||||
pro,
|
pro,
|
||||||
};
|
};
|
|
@ -2,8 +2,14 @@
|
||||||
const setLoginData=function(obj){
|
const setLoginData=function(obj){
|
||||||
uni.setStorageSync("demu_mes_user_name",obj.mes_user_name);
|
uni.setStorageSync("demu_mes_user_name",obj.mes_user_name);
|
||||||
uni.setStorageSync("mes_token",obj.mes_token);
|
uni.setStorageSync("mes_token",obj.mes_token);
|
||||||
|
}
|
||||||
|
|
||||||
|
const removeLoginData=function(){
|
||||||
|
uni.removeStorageSync("demu_mes_user_name");
|
||||||
|
uni.removeStorageSync("mes_token");
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setLoginData
|
setLoginData,
|
||||||
|
removeLoginData
|
||||||
};
|
};
|
Loading…
Reference in New Issue