首次提交

This commit is contained in:
xk_guohonglei
2020-08-18 15:09:31 +08:00
commit 1f8b3e6e55
57 changed files with 9637 additions and 0 deletions

34
components/Empty.vue Normal file
View File

@@ -0,0 +1,34 @@
<template>
<!-- -->
<div class="img-box">
<div class="img">
<image :src="baseUrl+'static/img/w.png'"></image>
</div>
<p>这里没有相关记录哦~</p>
</div>
</template>
<script>
export default {
name: 'Empty',
data() {
return {
baseUrl: this.$baseURL
}
},
}
</script>
<style scoped>
/* 空 */
.img-box {
width: 100%;
text-align: center;
color: rgb(148, 147, 147);
font-size: 14px;
padding-bottom: 20%;
}
.img {
width: 30%;
margin: 30% auto 3%;
}
</style>

View File

@@ -0,0 +1,80 @@
<template>
<view class="flex" >
<view class="flex-sub">
</view>
<view class="flex-treble text-center">
<view class="strong font-16 oil-main-color">
5.81
</view>
<view class="radius text-center oil-card-price main-color-border">
<text class="oil-free">
</text>
<text class="free-money">
七毛
</text>
</view>
<view class="">
星油油价
</view>
</view>
<view class="flex-treble text-center">
<view class="strong font-16 oil-main-color">
5.81
</view>
<view class="radius text-center oil-card-price main-color-border">
<text class="oil-free">
</text>
<text class="free-money">
七毛
</text>
</view>
<view class="">
万金油价
</view>
</view>
<view class="flex-treble text-center">
<view class="strong font-16 oil-main-color">
5.81
</view>
<view class="radius oil-card-price main-color-border">
<text class="oil-free">
</text>
<text class="free-money">
七毛
</text>
</view>
<view class="">
老吕油价
</view>
</view>
</view>
</template>
<script>
export default{
name:'PriceList'
}
</script>
<style scoped>
.oil-card-price {
max-width: 4rem;
margin: auto;
}
.free-money {
color: #FE0505;
max-width: 3rem;
font-size: 12px;
line-height: 12px;
}
.navigation {
position: absolute;
right: 16px;
}
</style>

View File

@@ -0,0 +1,17 @@
## 简介
## 更新日志
**2019.12.30**
优化:
定位下拉内容
待实现:只同时展示一个下拉内容
**2019.12.27**
bug修复
支持H5、微信小程序
**2019.12.20**
第一次发布
支持H5下拉暂不支持小程序。
原因一些适配H5的方法是用vue来写的小程序不支持。
`this.$slots.`在小程序中不能用

View File

@@ -0,0 +1,213 @@
<template>
<div class="dropdown-item">
<!-- selected -->
<view class="dropdown-item__selected"
@click="changePopup">
<slot name="title" v-if="$slots.title"></slot>
<block v-else>
<view class="selected__name">{{title ? title : selectItem.text}}</view>
<view class="selected__icon"
:class="showClass === 'show'? 'up' : 'down'"
>
<span class="iconfont">&#xe851;</span>
</view>
</block>
</view>
<view class="dropdown-item__content" :style="{top: contentTop + 'px'}" v-if="showList">
<!-- dropdown -->
<view :class="['list', showClass]">
<slot v-if="$slots.default"></slot>
<block v-else>
<view class="list__option"
v-for="(item, index) in list"
:key="index"
@click="choose(item)">
<view>{{item.text}}</view>
<icon v-if="item.value === value" color="#FE0505" type="success_no_circle" size="26"/>
</view>
</block>
</view>
<!-- dropdown-mask -->
<view :class="['dropdown-mask', showClass]" v-if="showList" @click="closePopup"></view>
</view>
</div>
</template>
<script>
export default {
components: {
},
props: {
value: [Number, String, Object],
list: {
type: Array,
default: ()=> {
return []
}
},
title: [Number, String]
},
data() {
return {
showList: "",
showClass: '',
selectItem: {},
contentTop: 0
}
},
watch: {
},
mounted() {
this.showList = this.active;
this.selectItem = this.list[this.value];
// document.addEventListener('click', e => {
// //this.$el 可以获取当前组件的容器节点
// if (!this.$el.contains(e.target)) {
// console.log('change');
// this.close()
// }
// });
},
methods: {
choose(item) {
this.selectItem = item
this.$emit('input', item.value,item)
this.closePopup()
},
changePopup() {
if(this.showList) {
this.closePopup()
} else {
this.openPopup()
}
},
openPopup() {
// this.$parent -> dropdown-menu
this.$parent.$emit('close')
this.showList = true
this.$nextTick(() => {
this.getElementData('.dropdown-item__selected', (data)=>{
this.contentTop = data[0].bottom
this.showClass = 'show'
})
})
},
closePopup() {
this.showClass = ''
setTimeout(() => {
this.showList = false
}, 300)
},
close() {
this.showClass = ''
this.showList = false
},
getElementData(el, callback){
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
callback(data[0]);
});
}
}
}
</script>
<style lang="scss">
@font-face {
font-family: 'iconfont'; /* project id 1564327 */
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot');
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot?#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff2') format('woff2'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff') format('woff'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.ttf') format('truetype'),
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.svg#iconfont') format('svg');
}
.iconfont{
font-family:"iconfont" !important;
font-size:28rpx;
font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
.dropdown-item {
width: 100%;
flex:1;
position: relative;
&__selected {
position: relative;
display: flex;
align-items: center;
background: #fff;
padding: 30rpx;
box-sizing: border-box;
justify-content: center;
.selected__name {
font-size: 32rpx;
}
.selected__icon {
margin-left: 20rpx;
&.down {
transition: transform .3s;
transform: rotateZ(0);
}
&.up {
transition: transform .3s;
transform: rotateZ(-180deg);
}
}
}
&__content {
position: fixed;
left: 0;
right: 0;
overflow: hidden;
top: 0;
bottom: 0;
z-index: 1;
.list {
max-height: 400px;
overflow-y: auto;
position: absolute;
left: 0;
right: 0;
z-index: 3;
background: #fff;
transform: translateY(-100%);
transition: all .3s;
&.show {
transform: translateY(0);
}
&__option {
font-size:32rpx;
padding: 26rpx 28rpx;
display: flex;
justify-content: space-between;
&:not(:last-child) {
border-bottom: 1rpx solid #DDDDDD;
}
}
}
.dropdown-mask {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
transition: all .3s;
z-index: 2;
&.show {
background:rgba(0,0,0,0.5);
}
}
}
&:not(:last-child):after {
content: ' ';
position: absolute;
width: 2rpx;
top: 36rpx;
bottom: 36rpx;
right: 0;
background: $uni-border-color;
}
}
</style>

View File

@@ -0,0 +1,35 @@
<template>
<div class="dropdown-menu">
<slot></slot>
</div>
</template>
<script>
export default {
data() {
return {
}
},
mounted() {
this.$on('close', this.closeDropdown)
},
methods: {
closeDropdown() {
this.$children.forEach(item =>{
item.close();
})
}
}
}
</script>
<style lang="scss">
.dropdown-menu {
display: flex;
overflow: auto;
white-space: nowrap;
}
dropdown-item {
flex: 1;
}
</style>

156
components/order-item.vue Normal file
View File

@@ -0,0 +1,156 @@
// 可供选择的订单
// 开票列表
<template>
<view class="cu-item radius shadow">
<image class="pay-status" :src="baseURL+'static/img/oil-unfinished.png'" alt />
<view class="cu-avatar text-sl" :style="'background-image:url('+baseURL+'static/img/order-wjy.png)'"></view>
<view class="content">
<view class=" solid-bottom padding-bottom">
<view class="flex-treble">
{{item.orderID}}
</view>
<view class="flex-sub text-right cuIcon-right">
</view>
</view>
<view class=" text-content text-df">
{{item.oilSiteName}}
</view>
<view class="text-sm padding-top-sm">
<view class="flex">
<view class="details">
<view class="top1 text-left">
<image class="icon icon-desc " :src="baseURL+'static/img/oil-lf.png'" alt />
<text class="padding-left-xs" v-if="item.vol"> {{item.vol}}</text>
<text >
{{item.oilName}} {{item.oilCode}}
</text>
</view>
<view class="bottom text-left">
<image class="icon icon-desc " :src="baseURL+'static/img/oil-time.png'" alt />
<text class="padding-left-xs">
{{item.credateDatetime}}
</text>
</view>
<view class="bottom text-left">
<image class="icon icon-desc " :src="baseURL+'static/img/mini-car.png'" alt />
<text class="padding-left-xs">
加油车牌 {{item.carNo}}
</text>
</view>
</view>
</view>
</view>
<view class="margin-top-sm flex justify-between">
<view class="text-gray text-df">2018年12月4日</view>
<view>
<text class="color-000 total-money">{{item.realamount|numberFilter}}</text>
</view>
</view>
</view>
</view>
<!-- <xkempty v-else></xkempty> -->
<!-- 评价的弹出层 -->
</template>
<script>
import Empty from '@/components/Empty'
export default {
name: 'oilOrders',
components: {
xkempty: Empty
},
props: {
item: {
type: Object,
default () {}
}
},
data() {
return {
baseURL: this.global.baseURL
}
},
methods: {
toDetails(item) {
this.$store.commit('SET_ORDERDE', item)
console.log('item', item)
this.$router.push('/OrderDetail')
},
onSelect(item) {
console.log('触发', '')
this.$emit('onSelectItem')
}
},
filters: {
toT(value) {
if (value) {
return value / 1000
}
},
dateFormat(value) {
if (value) {
return value.substring(5, 16)
}
},
numberFilter(value) {
return value.toFixed(2)
}
}
}
</script>
<style scoped>
.cu-avatar {
background-color: rgba(255, 255, 255, 0);
}
.icon-car {
height: 41px;
background-size: contain;
float: left;
margin-top: -8px;
margin-left: -6px;
}
.car-position {
text-align: left;
}
.bottom {
color: #333;
}
.icon-desc {
display: inline-block;
width: 12px;
height: 12px;
position: relative;
top: 1px;
line-height: 25px;
}
.details {
position: relative;
}
.cu-item {
position: relative;
}
.pay-status {
position: absolute;
z-index: 1;
right: 100upx;
top: 50rpx;
width: 120rpx;
height: 120rpx;
}
</style>

View File

@@ -0,0 +1,352 @@
<template>
<view class="cu-modal bottom-modal" :class="modalName">
<view class="cu-dialog">
<view class="cu-bar bg-white">
<view class="action text-green" @tap="hideModal">确定</view>
<view class="action text-blue" @tap="deleteInput">删除</view>
</view>
<view class="padding-xs">
<view class="grid " v-if="showPlateList">
<view class="padding-sm margin-xs solid bg-white" v-for="item in ChineseList" @tap="select(item)" :key="item.id">
<text>
{{item.name}}
</text>
</view>
</view>
<view class="grid " v-if="showInputList">
<view class="padding-sm margin-xs solid bg-white" v-for="item in inputList" @tap="selectText(item)" :key="item.id">
<text>
{{item.name}}
</text>
</view>
<text @tap="onDeleteInput" class="cuIcon-close"></text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
// modalName: 'bottomModal',
modalName: {
type: String,
default: ''
},
showPlateList: {
type: Boolean,
default: true
},
showInputList: {
type: Boolean,
default: false
}
},
data() {
return {
carNumber: '',
plateNo: '',
plateText: '',
ChineseList: [{
name: '京',
id: 1
},
{
name: '津',
id: 2
},
{
name: '冀',
id: 3
},
{
name: '晋',
id: 4
},
{
name: '蒙',
id: 5
},
{
name: '辽',
id: 6
},
{
name: '吉',
id: 7
},
{
name: '黑',
id: 8
},
{
name: '沪',
id: 9
},
{
name: '苏',
id: 10
},
{
name: '浙',
id: 11
},
{
name: '皖',
id: 12
},
{
name: '闽',
id: 13
},
{
name: '赣',
id: 14
},
{
name: '鲁',
id: 15
},
{
name: '豫',
id: 16
},
{
name: '鄂',
id: 17
},
{
name: '湘',
id: 18
},
{
name: '粤',
id: 19
},
{
name: '桂',
id: 20
},
{
name: '琼',
id: 21
},
{
name: '渝',
id: 22
},
{
name: '川',
id: 23
},
{
name: '贵',
id: 24
},
{
name: '云',
id: 25
},
{
name: '藏',
id: 26
},
{
name: '陕',
id: 27
},
{
name: '甘',
id: 28
},
{
name: '青',
id: 29
},
{
name: '宁',
id: 30
},
{
name: '新',
id: 31
}
],
inputList: [{
name: '1',
id: 1
},
{
name: '2',
id: 2
},
{
name: '3',
id: 3
},
{
name: '4',
id: 4
},
{
name: '5',
id: 5
},
{
name: '6',
id: 6
},
{
name: '7',
id: 7
},
{
name: '8',
id: 8
},
{
name: '9',
id: 9
},
{
name: '0',
id: 10
},
{
name: 'A',
id: 11
},
{
name: 'B',
id: 12
},
{
name: 'C',
id: 13
},
{
name: 'D',
id: 14
},
{
name: 'E',
id: 15
},
{
name: 'F',
id: 16
},
{
name: 'G',
id: 17
},
{
name: 'H',
id: 18
},
{
name: 'I',
id: 19
},
{
name: 'J',
id: 20
},
{
name: 'K',
id: 21
},
{
name: 'L',
id: 22
},
{
name: 'M',
id: 23
},
{
name: 'N',
id: 24
},
{
name: 'O',
id: 25
},
{
name: 'P',
id: 26
},
{
name: 'Q',
id: 27
},
{
name: 'R',
id: 28
},
{
name: 'S',
id: 29
},
{
name: 'T',
id: 30
},
{
name: 'U',
id: 31
},
{
name: 'V',
id: 32
},
{
name: 'W',
id: 33
},
{
name: 'X',
id: 34
},
{
name: 'Y',
id: 35
},
{
name: 'Z',
id: 36
}
]
}
},
methods: {
select(item) {
this.$emit('selectName', item.name)
},
selectText(item) {
this.$emit('selectNo', item.name)
},
deleteInput() {
this.$emit('onDeleteInput')
},
hideModal() {
this.$emit('hideModal')
},
onDeleteInput() {
this.$emit('onDeleteInput')
}
}
}
</script>
<style scoped>
.cu-modal {
background: transparent;
}
</style>