Commit 3be35591 authored by Smile's avatar Smile Committed by wux

任务88:客户端改造,首页添加查询框,新字典添加展示

parent d03aafff
...@@ -81,6 +81,24 @@ ...@@ -81,6 +81,24 @@
</view> </view>
</view> </view>
</view> </view>
<view class="order-tabs">
<view class="order-tabs-v2">
<view class="order-tabs-v2s">
<image class="search" src="../../static/img/search.png" mode=""></image>
<input type="text" v-model="searchKey" autocomplete="off" :placeholder="$lang.lang.notices.moreKey" placeholder-style="color: #666666">
<view class="" @click="changeIndex()">{{$lang.lang.order.search}}</view>
</view>
</view>
</view>
<view class="order-control-status">
<text>{{$lang.lang.exception.orderStatus}}</text>
<view class="control-item">
<picker class="control-status" :value="config.status.index" :range="config.status.label" data-config="status" data-key="status" @change="configChange">
<view>{{config.status.label[config.status.index]}}</view>
</picker>
<image class="rgt" src="../../static/img/rgt.png"></image>
</view>
</view>
<view class="actions"> <view class="actions">
<view class="title"> <view class="title">
<image src="../../static/img/dongtai.png" mode=""></image> <image src="../../static/img/dongtai.png" mode=""></image>
...@@ -262,7 +280,19 @@ export default { ...@@ -262,7 +280,19 @@ export default {
totalSize: 0, //下载总量 totalSize: 0, //下载总量
transType: [], transType: [],
preLoginPage: false, preLoginPage: false,
searchKey: '' //搜索关键词 searchKey: '', //搜索关键词
config:{
status:{
index: 0,
label: [this.$lang.lang.order.allStatus],
value: [''],
},
},
status:{
index: 0,
label: [this.$lang.lang.order.allStatus],
value: [''],
},
} }
}, },
created() { created() {
...@@ -287,6 +317,16 @@ export default { ...@@ -287,6 +317,16 @@ export default {
} }
}, },
methods: { methods: {
changeIndex(){
this.page = 1
this.getOrderData()
},
configChange (e){
if (e.target.dataset.key == 'status') {
this.config.status.index = e.detail.value
this.changeIndex()
}
},
//获取等级列表 //获取等级列表
getMembershipLevels () { getMembershipLevels () {
this.$request.getConfig('membership_levels').then(res => { this.$request.getConfig('membership_levels').then(res => {
...@@ -493,12 +533,14 @@ export default { ...@@ -493,12 +533,14 @@ export default {
var statusName = '' var statusName = ''
let that = this let that = this
if (that.statusData.length > 0) { if (that.statusData.length > 0) {
var name = that.statusData.filter((item) => item.value == status) || [] var name = that.statusData.filter((item) => item.value.split(',').map(Number).includes(status)) || []
if (name.length > 0) { if (name.length > 0) {
if (that.$lang.locale == 'zh') { if (that.$lang.locale == 'zh') {
statusName = name[0].label statusName = name[0].label
} else { } else if (that.$lang.locale == 'en'){
statusName = name[0].labelEn statusName = name[0].labelEn
}else {
statusName = name[0].labelFr
} }
} }
} }
...@@ -541,9 +583,9 @@ export default { ...@@ -541,9 +583,9 @@ export default {
}, },
getOrderData() { getOrderData() {
this.$request this.$request
.get('/app-api/my/order/dynamic/page', { page: this.page, rows: 6 }) .get('/app-api/my/order/dynamic/page', { page: this.page, rows: 6 , searchKey: this.searchKey,statusList:this.config.status.value[this.config.status.index] })
.then((res) => { .then((res) => {
if (res.code == 0 && res.data && res.data.list && res.data.list.length > 0) { if (res.code == 0 && res.data) {
this.orderData = res.data.list this.orderData = res.data.list
} }
}) })
...@@ -607,9 +649,20 @@ export default { ...@@ -607,9 +649,20 @@ export default {
}) })
}, },
getStatusData() { getStatusData() {
this.$request.getConfig('order_status').then((res) => { let that = this
this.$request.getConfig('app_order_status').then((res) => {
if (res.code == 0 && res.data && res.data.list && res.data.list.length > 0) { if (res.code == 0 && res.data && res.data.list && res.data.list.length > 0) {
this.statusData = res.data.list this.statusData = res.data.list
res.data.list.forEach(item=>{
if(that.$lang.locale=='zh'){
that.config.status.label.push(item.label)
}else if(that.$lang.locale=='en'){
that.config.status.label.push(item.labelEn)
}else {
that.config.status.label.push(item.labelFr)
}
that.config.status.value.push(item.value)
})
} }
}) })
}, },
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<view class="order-list-it-v"> <view class="order-list-it-v">
<view class="fa-v"> <view class="fa-v">
<text>{{$lang.lang.order.orderNo}}:{{item.orderNo}}</text> <text>{{$lang.lang.order.orderNo}}:{{item.orderNo}}</text>
<text>{{item.statusMsg}}</text> <text>{{formatMsg(item.status)}}</text>
<!-- <text>{{getStatusName(item.status)}}</text> --> <!-- <text>{{getStatusName(item.status)}}</text> -->
</view> </view>
</view> </view>
...@@ -597,6 +597,12 @@ ...@@ -597,6 +597,12 @@
} }
}, },
methods: { methods: {
formatMsg(val){
const index=this.config.status.value.findIndex(item=>{
return item.split(',').map(Number).includes(val);
})
return this.config.status.label[index];
},
changeImage() { changeImage() {
if (this.$lang.locale=='zh'){ if (this.$lang.locale=='zh'){
this.shippingImg="../../static/img/fa.png" this.shippingImg="../../static/img/fa.png"
...@@ -612,13 +618,15 @@ ...@@ -612,13 +618,15 @@
//获取状态 //获取状态
getStatusData () { getStatusData () {
let that = this let that = this
this.$request.getConfig('order_status').then(res => { this.$request.getConfig('app_order_status').then(res => {
if(res.code==0&&res.data&&res.data.list.length > 0){ if(res.code==0&&res.data&&res.data.list.length > 0){
res.data.list.forEach(item=>{ res.data.list.forEach(item=>{
if(that.$lang.locale=='zh'){ if(that.$lang.locale=='zh'){
that.config.status.label.push(item.label) that.config.status.label.push(item.label)
}else{ }else if(that.$lang.locale=='en'){
that.config.status.label.push(item.labelEn) that.config.status.label.push(item.labelEn)
}else {
that.config.status.label.push(item.labelFr)
} }
that.config.status.value.push(item.value) that.config.status.value.push(item.value)
}) })
...@@ -923,9 +931,12 @@ ...@@ -923,9 +931,12 @@
if(e.target.dataset.key == 'dialCode'){ if(e.target.dataset.key == 'dialCode'){
this.transferFrom[e.target.dataset.key] = this.config[e.target.dataset.config].value[e.detail.value] this.transferFrom[e.target.dataset.key] = this.config[e.target.dataset.config].value[e.detail.value]
this.config[e.target.dataset.config].indexs = e.detail.value this.config[e.target.dataset.config].indexs = e.detail.value
}else if(e.target.dataset.key == 'cargoControlStatus'||e.target.dataset.key == 'status'){ }else if(e.target.dataset.key == 'cargoControlStatus'){
this.config[e.target.dataset.config].index = e.detail.value this.config[e.target.dataset.config].index = e.detail.value
this.changeIndex(this.selectIndex) this.changeIndex(this.selectIndex)
}else if(e.target.dataset.key == 'status'){
this.config.status.index = e.detail.value
this.changeIndex(this.selectIndex)
}else{ }else{
this.config[e.target.dataset.config].index = e.detail.value this.config[e.target.dataset.config].index = e.detail.value
this.lendingFrom[e.target.dataset.key] = this.config[e.target.dataset.config].value[e.detail.value] this.lendingFrom[e.target.dataset.key] = this.config[e.target.dataset.config].value[e.detail.value]
...@@ -1099,7 +1110,7 @@ ...@@ -1099,7 +1110,7 @@
}) })
}, },
getIssued(){ getIssued(){
this.$request.get('/app-api/my/order/issued/page',{page:this.page,rows:6,searchKey:this.searchKey}).then(res=>{ this.$request.get('/app-api/my/order/issued/page',{page:this.page,rows:6,searchKey:this.searchKey,statusList:this.config.status.value[this.config.status.index]}).then(res=>{
if(res.code==0&&res.data&&res.data.list&&res.data.list.length>0){ if(res.code==0&&res.data&&res.data.list&&res.data.list.length>0){
if(this.page == 1){ if(this.page == 1){
if(this.selectIndex==1){ if(this.selectIndex==1){
...@@ -1116,7 +1127,7 @@ ...@@ -1116,7 +1127,7 @@
}) })
}, },
getReceiver(){ getReceiver(){
this.$request.get('/app-api/my/order/received/page',{page:this.page,rows:6,searchKey:this.searchKey,status:this.config.status.value[this.config.status.index]}).then(res=>{ this.$request.get('/app-api/my/order/received/page',{page:this.page,rows:6,searchKey:this.searchKey,statusList:this.config.status.value[this.config.status.index]}).then(res=>{
if(res.code==0&&res.data&&res.data.list&&res.data.list.length>0){ if(res.code==0&&res.data&&res.data.list&&res.data.list.length>0){
if(this.page == 1){ if(this.page == 1){
if(this.selectIndex==2){ if(this.selectIndex==2){
...@@ -1162,7 +1173,7 @@ ...@@ -1162,7 +1173,7 @@
} }
}, },
getData(){ getData(){
this.$request.get('/app-api/my/order/all/order',{page:this.page,rows:6,searchKey:this.searchKey,status:this.config.status.value[this.config.status.index]}).then(res=>{ this.$request.get('/app-api/my/order/all/order',{page:this.page,rows:6,searchKey:this.searchKey,statusList:this.config.status.value[this.config.status.index]}).then(res=>{
if(res.code==0&&res.data&&res.data.list&&res.data.list.length>0){ if(res.code==0&&res.data&&res.data.list&&res.data.list.length>0){
if(this.page == 1){ if(this.page == 1){
if(this.selectIndex==0){ if(this.selectIndex==0){
......
...@@ -100,12 +100,6 @@ page{ ...@@ -100,12 +100,6 @@ page{
display: flex; display: flex;
align-items: center; align-items: center;
} }
.rgt{
width: 50upx;
position: absolute;
right: 10upx;
top: 44upx;
}
.mssgv-v-1{ .mssgv-v-1{
width: 130upx; width: 130upx;
height: 120upx; height: 120upx;
...@@ -486,3 +480,97 @@ page{ ...@@ -486,3 +480,97 @@ page{
.type4{ .type4{
background-image: url(../../static/img/type-2.png); background-image: url(../../static/img/type-2.png);
} }
.order-tabs{
width: 90%;
margin: 20upx auto 40upx;
display: flex;
}
.order-tabs .order-tabs-v1{
width: 40%;
}
.order-tabs .order-tabs-v1 view{
width: 90%;
height: 100upx;
background-color: var(--c0);
display: flex;
align-items: center;
justify-content: center;
border-radius: 12upx;
}
.order-tabs .sn{
width: 40upx;
height: 40upx;
margin-right: 10upx;
}
.order-tabs .order-tabs-v2{
width: 100%;
background-color: var(--c0);
border-radius: 12upx;
}
.order-tabs .order-tabs-v2 .order-tabs-v2s{
display: flex;
align-items: center;
position: relative;
height: 100upx;
}
.order-tabs-v2 .search{
width: 40upx;
height: 40upx;
margin: 0upx 20upx;
}
.order-tabs-v2 input{
width: 70%;
font-size: var(--f24);
}
.order-tabs-v2 .order-tabs-v2s view{
position: absolute;
right: 20upx;
color: var(--c427);
border: 1px solid var(--c427);
padding: 8upx 36upx;
border-radius: 30upx;
}
.order-control-status{
width: 86%;
display: flex;
align-items: center;
margin: 0 auto;
background-color: #fff;
border-radius: 6px;
padding: 2%;
margin-bottom: 12upx;
}
.v-picker{
position: relative;
font-weight: 500;
font-size: var(--f26);
margin-left: 20upx;
border: 1px solid var(--cdf);
padding: 20upx;
width: 62%;
border-radius: 12upx;
}
.control-item{
position: relative;
width:50%;
}
.control-status{
border: 1px solid var(--cdf);
padding:12upx 8px;
font-size: 26upx;
border-radius: 4px;
font-weight: normal;
margin-left: 12px;
}
.rgt{
width: 32upx;
height: 36upx;
margin-left: 10upx;
margin-top: 4upx;
}
.control-item .rgt{
top: 16upx;
position: absolute;
right: 6px;
margin: 0;
}
\ No newline at end of file
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