添加船公司 + less全局变量

main
lilu 2 years ago
parent 4252ef397c
commit b59585071f

@ -41,9 +41,7 @@
} }
</script> </script>
<style lang="scss"> <style lang="less">
// @import "@/uni_modules/uview-ui/index.scss";
// @import "common/css/demo.scss";
@import "common/css/iconfont.css"; @import "common/css/iconfont.css";
// @import "common/css/common.less"; @import "common/css/common.less";
</style> </style>

@ -1,5 +1,8 @@
@import url("@/common/css/variables.less");
Page{ Page{
font-family: "PingFang-SC-Regular"; font-family: "PingFang-SC-Regular";
height: 100%; height: 100%;
@ -234,34 +237,52 @@ view{
color: #3f3f3f; color: #3f3f3f;
} }
.col-low-down{ .col-nor{
color: #898989; color: @uni-color-normal;
} }
.col-ye{ .col-ye{
color: #f58f13; color: @uni-color-yellow;
}
.col-ori{
color: @uni-color-origin;
} }
.col-red{ .col-red{
color: #E25153!important; color: @uni-color-red;
} }
.col-green{
.col-redNew{ color: @uni-color-green;
color: #db4e3c!important; }
.col-blue{
color: @uni-color-blue;
} }
.bg-nor{
background-color: @uni-color-normal;
}
.bg-ye{
background-color: @uni-color-yellow;
}
.bg-ori{
background-color: @uni-color-origin;
}
.bg-red{
background-color: @uni-color-red;
}
.bg-green{
background-color: @uni-color-green;
}
.bg-blue{
background-color: @uni-color-blue;
}
.bg-w{ .bg-w{
background-color: #fff; background-color: #fff;
} }
.bg-h{ .bg-h{
background-color: #2f2f2f; background-color: #2f2f2f;
} }
.bg-low{ .bg-low{
background-color: #3f3f3f; background-color: #3f3f3f;
} }
.bg-low-down{ .bg-low-down{
background-color: #898989; background-color: #898989;
} }
@ -269,35 +290,8 @@ view{
background-color: #d4d4d4; background-color: #d4d4d4;
} }
.bg-ye{
background-color: #f58f13;
}
.bg-red{
background-color: #fa2807!important;
}
.bg-green{
background-color: #00c45d;
}
.bg-normal{ .bg-normal{
background-color: rgba(243,244,245,1)!important; background-color: rgba(243,244,245,1) !important;
}
.grad {
background-image: linear-gradient(rgb(253,118,6),rgb(252,29,12));
}
.newGrad{
background-image: linear-gradient(to right, #ff933e , #ea5757)!important;
}
.saveNewGrad{
background-image: linear-gradient(to right, rgb(252,85,40) , rgb(243,50,71))!important;
}
.newGradStop{
background-image: linear-gradient(to right, #ffc67f , #ef6a72);
}
.blueGrad{
background-image: linear-gradient(to right, #7C98F7 , #4055EF);
} }
.centers{ .centers{
@ -308,10 +302,10 @@ view{
color:#333; color:#333;
} }
.fn-c-6{ .fn-c-6{
color:#333; color:#666;
} }
.fn-c-9{ .fn-c-9{
color:#333; color:#999;
} }
/deep/.uni-scroll-view ::-webkit-scrollbar { /deep/.uni-scroll-view ::-webkit-scrollbar {

@ -0,0 +1,6 @@
@uni-color-normal: #2c96fb;
@uni-color-yellow: #ffc827;
@uni-color-origin: #ff8213;
@uni-color-red: #ff4e20;
@uni-color-blue: #12c8fd;
@uni-color-green: #42bfac;

@ -9,7 +9,6 @@ import validate from '@/common/js/utils/ys-validate.js'
import util from '@/common/js/utils/utils.js' import util from '@/common/js/utils/utils.js'
// import '@/common/js/utils/navigateTo.js' // import '@/common/js/utils/navigateTo.js'
Vue.prototype.$store = store Vue.prototype.$store = store
Vue.prototype.$validate = validate Vue.prototype.$validate = validate
Vue.prototype.$util = util; Vue.prototype.$util = util;

@ -1,18 +1,9 @@
<template> <template>
<view class="container"> <view class="container">
<swiper class="main" :autoplay="false" :current="currentPage" :duration="duration" easing-function="linear" @change="changeSwiper"> <swiper class="main" :autoplay="false" :current="currentPage" :duration="duration" easing-function="linear" @change="changeSwiper">
<!-- <swiper-item>
<manifest></manifest>
</swiper-item>
<swiper-item>
<moveTrace></moveTrace>
</swiper-item> -->
<swiper-item> <swiper-item>
<index @changeTab="getChangeTab"></index> <index @changeTab="getChangeTab"></index>
</swiper-item> </swiper-item>
<!-- <swiper-item>
<vgm></vgm>
</swiper-item> -->
<swiper-item> <swiper-item>
<mine></mine> <mine></mine>
</swiper-item> </swiper-item>
@ -25,9 +16,6 @@
import tabBar from "@/components/tabBar/tabBar.vue" import tabBar from "@/components/tabBar/tabBar.vue"
import index from "@/pages/homePage/index/index.vue" import index from "@/pages/homePage/index/index.vue"
import mine from "@/pages/homePage/mine/mine.vue" import mine from "@/pages/homePage/mine/mine.vue"
// import manifest from "@/pages/homePage/manifest/manifest.vue" //
// import moveTrace from "@/pages/homePage/moveTrace/moveTrace.vue" //
// import vgm from "@/pages/homePage/vgm/vgm.vue"
import { import {
getUserInfo getUserInfo
@ -42,9 +30,6 @@
tabBar, tabBar,
index, index,
mine, mine,
// manifest,
// moveTrace,
// vgm
}, },
data() { data() {
return { return {

@ -1,6 +1,6 @@
<template> <template>
<view class="content"> <view class="content">
<!-- <view class="content-bg"></view> --> <view class="view-bg"></view>
<image class="content-bg" src="@/static/image/index_bg.png" mode=""></image> <image class="content-bg" src="@/static/image/index_bg.png" mode=""></image>
<view class="content-top"> <view class="content-top">
<view class="banner"> <view class="banner">
@ -96,7 +96,7 @@
width: 100%; width: 100%;
height: 240rpx; height: 240rpx;
margin-top: -4rpx; margin-top: -4rpx;
// background: #2c96fb; // background: @uni-color-normal;
// background: #7ec0ff; // background: #7ec0ff;
} }
.content-top{ .content-top{

@ -150,7 +150,8 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.Main { .Main {
background: #f2f2f2; background: #f2f2f2;
height: calc(100% - 175rpx); // height: calc(100% - 175rpx);
height: 100%;
padding: 1rem 1rem; padding: 1rem 1rem;
padding-bottom: 0; padding-bottom: 0;
box-sizing: border-box; box-sizing: border-box;
@ -330,7 +331,7 @@
.AddBox { .AddBox {
position: fixed; position: fixed;
left: 50%; left: 50%;
bottom: 165rpx; bottom: 100rpx;
transform: translate(-50%, 0); transform: translate(-50%, 0);
width: 30%; width: 30%;
height: 2.2rem; height: 2.2rem;

@ -91,7 +91,7 @@
watch:{ watch:{
fromData: { fromData: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
this.getHistory(); // this.getHistory();
}, },
deep: true, deep: true,
immediate: true immediate: true
@ -124,9 +124,9 @@
status: 'loading', status: 'loading',
}, },
'COSCO': { 'COSCO': {
name: '法国达飞', name: '中远',
code: 'CMA', code: 'COSCO',
image: '../../../static/image/logo/cma.png', image: '../../../static/image/logo/cosco.png',
list: [], list: [],
status: 'loading', status: 'loading',
}, },
@ -142,6 +142,13 @@
}, },
onLoad(op){ onLoad(op){
this.fromData = JSON.parse(op.data); this.fromData = JSON.parse(op.data);
this.getHistory();
},
onUnload(){
Object.keys(this.webCode).map((item,index)=>{
this.webCode[item].status = 'loading';
});
console.log('== 页面卸载 ==', this.webCode)
}, },
methods: { methods: {
reset(){ reset(){

@ -27,6 +27,15 @@
<text class="icon iconfont icon-daoda"></text> <text class="icon iconfont icon-daoda"></text>
</view> </view>
</view> </view>
<view class="choice-btn" @click="openInputSerch('webCode')">
<view class="left"><text class="iconfont icon-a-jizhuangxiang1"></text><text class="tip">船公司</text></view>
<view class="right">
<text class="gk" v-if="fromData.webCode">{{fromData.webCodeName }}</text>
<text class="gk" v-else></text>
<text class="icon iconfont icon-daoda"></text>
</view>
</view>
<view class="choice-btn"> <view class="choice-btn">
<view class="left"><text class="iconfont icon-shijian"></text><text class="tip">开始时间</text></view> <view class="left"><text class="iconfont icon-shijian"></text><text class="tip">开始时间</text></view>
@ -138,6 +147,8 @@
portArrival: '', portArrival: '',
portArrivalCode: '', portArrivalCode: '',
boxType: '', boxType: '',
webCode: '',
webCodeName: '',
// portArrival: 'GDANSK, POLAND', // portArrival: 'GDANSK, POLAND',
// portArrivalCode: 'PLGDN', // portArrivalCode: 'PLGDN',
// boxType: '22G1', // boxType: '22G1',
@ -154,6 +165,43 @@
history: null, history: null,
}, },
inputSearchRes: {}, inputSearchRes: {},
webCodeData:[
{
name: '马士基',
code: 'MSK',
image: '../../../static/image/logo/msk.png',
list: [],
status: 'loading',
},
{
name: 'MCC',
code: 'MCC',
image: '../../../static/image/logo/MCC.png',
list: [],
status: 'loading',
},
{
name: '法国达飞',
code: 'CMA',
image: '../../../static/image/logo/cma.png',
list: [],
status: 'loading',
},
{
name: '中远',
code: 'COSCO',
image: '../../../static/image/logo/cosco.png',
list: [],
status: 'loading',
},
{
name: 'OOCL',
code: 'OOCL',
image: '../../../static/image/logo/oocl.png',
list: [],
status: 'loading',
}
],
} }
}, },
watch: { watch: {
@ -279,6 +327,19 @@
} : null, } : null,
} }
this.$set(this, 'inputSearchData' , data) this.$set(this, 'inputSearchData' , data)
}else if(type == 'webCode'){
let data = {
placeholder: '请输入船公司',
dataList: [],
showName: 'name',
type: 'webCode',
history: this.fromData.webCode ? {
name: this.fromData.webCodeName,
code: this.fromData.webCode,
} : null,
}
this.$set(this, 'inputSearchData' , data)
this.$set(this.inputSearchData, 'dataList', this.webCodeData);
} }
}, },
@ -302,7 +363,7 @@
this.$set(this.inputSearchData, 'dataList', []); this.$set(this.inputSearchData, 'dataList', []);
this.$refs.inputView.$data.inLoading = false; this.$refs.inputView.$data.inLoading = false;
}) })
}else{ }else if(this.inputSearchData.type == 'boxType'){
realBox({ realBox({
name: key, name: key,
}).then(res =>{ }).then(res =>{
@ -319,6 +380,27 @@
this.$set(this.inputSearchData, 'dataList', []); this.$set(this.inputSearchData, 'dataList', []);
this.$refs.inputView.$data.inLoading = false; this.$refs.inputView.$data.inLoading = false;
}) })
}else if(this.inputSearchData.type == 'webCode'){
let newData = [];
this.webCodeData.map((item,index)=>{
if(item.name.includes(key)){
newData.push(item)
}
})
console.log(newData)
if(newData.length > 0){
setTimeout(()=>{
this.$set(this.inputSearchData, 'dataList', newData);
this.$refs.inputView.$data.inLoading = false;
this.$forceUpdate()
},300)
}else{
setTimeout(()=>{
this.$set(this.inputSearchData, 'dataList', []);
this.$refs.inputView.$data.inLoading = false;
this.$forceUpdate()
},300)
}
} }
}, },
@ -332,6 +414,9 @@
this.fromData.portArrivalCode = data.code; this.fromData.portArrivalCode = data.code;
}else if(this.inputSearchData.type == 'boxType'){ }else if(this.inputSearchData.type == 'boxType'){
this.fromData.boxType = data.Code; this.fromData.boxType = data.Code;
}else if(this.inputSearchData.type == 'webCode'){
this.fromData.webCode = data.code;
this.fromData.webCodeName = data.name;
} }
this.inputSearchShow = false; this.inputSearchShow = false;
this.inputSearchData = { this.inputSearchData = {

@ -0,0 +1,13 @@
const path = require("path");
module.exports = {
pluginOptions: {
"style-resources-loader": {
preProcessor: "less",
patterns: [
// 全局变量路径,不能使用路径别名
path.resolve(__dirname, "./common/css/variables.less"),
],
},
},
};
Loading…
Cancel
Save