231f1f81 by 华明祺

no message

1 parent fade3bf0
# 忽略build目录下类型为js的文件的语法检查
build/*.js
# 忽略src/assets目录下文件的语法检查
# src/assets
# 忽略public目录下文件的语法检查
public
# 忽略当前目录下为js的文件的语法检查
# *.js
# 忽略当前目录下为vue的文件的语法检查
# *.vue
// Eslint 检查配置
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
'vue/setup-compiler-macros': true
},
extends: [
// 'eslint:recommended',
// 'plugin:vue/vue3-essential',
'plugin:vue/vue3-recommended'
],
plugins: [
'vue',
'html'
],
// add your custom rules here
// it is base on https://github.com/vuejs/eslint-config-vue
rules: {
// vue 中 script 的缩进
// 'vue/script-indent': [
// 'error',
// 2,
// {
// baseIndent: 0,
// switchCase: 1,
// ignores: []
// }
// ],
// vue 中 template 的空格
'vue/html-indent': [
'error',
2,
{
attribute: 1,
baseIndent: 1,
closeBracket: 0,
alignAttributesVertically: true,
ignores: []
}
],
'vue/max-attributes-per-line': [2, {
singleline: { max: 5 },
multiline: { max: 5 }
}], // 一行5个属性
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/name-property-casing': ['error', 'PascalCase'],
'vue/no-v-html': 'off',
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [1, 'never'], // 对象的最后一个元素是否加逗号
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ['off'],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 1,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2, // 不能空格与tab混用
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 2
}], // 空行最多不能超过2行
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 0, // 一行结束后面不要有空格
'no-undef': 2, // 未定义
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, {
'vars': 'all',
'args': 'none'
}],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}], // 连续声明
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'], // 块语句内行首行尾是否要空行
'quotes': [1, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}], // 单引号
'semi': [1, 'never'], // 语句强制分号结尾 always
'semi-spacing': [2, {
'before': false,
'after': true
}], // 分号前后空格
'space-after-keywords': [0, 'always'], // 关键字后面是否要空一格
'space-before-blocks': [2, 'always'], // 不以新行开始的块{前面要不要有空格
'space-before-function-paren': [2, 'never'], // 函数定义时括号前面要不要有空格
'space-in-parens': [2, 'never'], // 小括号里面要不要有空格
'space-infix-ops': 2, // 中缀操作符周围要不要有空格
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',', '#region', '#endregion']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never'],
'vue/multi-word-component-names': 'off'
},
globals: {
// 'defineEmits': 'readonly'
'__DEV__': true,
'If': true,
'For': true,
'POBrowser': true
}
}
......@@ -18,6 +18,7 @@
"@vueuse/core": "^10.1.2",
"axios": "0.27.2",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.13",
"echarts": "5.4.0",
"echarts-wordcloud": "^2.1.0",
"element-plus": "2.6.1",
......
......@@ -14,82 +14,38 @@
</div>
</div>
<div v-loading="loading" class="box">
<el-collapse v-model="activeName" accordion style="--el-collapse-header-height:'auto'">
<el-collapse-item v-for="(h,index) in list" :name="index" class="hotel">
<template #title>
<div v-for="(h,index) in list" :key="index">
<el-row :gutter="20" align="middle" class="w100">
<el-col :span="4">
<div class="index">{{ language == 0 ? '路线' : 'Route' }}{{ index + 1 }}
<img src="@/assets/booking/arrow.png"/>
</div>
</el-col>
<el-col :span="7">
<el-col :span="6">
<p class="esp">{{ h.checkIn }}</p>
</el-col>
<el-col :span="4" class="text-center">
<img class="mauto w40px" src="@/assets/booking/wf.png"/>
</el-col>
<el-col :span="7">
<el-col :span="6">
<p class="esp ">{{ h.checkOut }}</p>
</el-col>
</el-row>
</template>
<!-- <div class="plr20">-->
<!-- <div v-for="(r,index) in h.carVoList" :key="index" class="room">-->
<!-- <el-row :gutter="30" align="middle">-->
<!-- <el-col :span="4">-->
<!-- <div class="roomImg">-->
<!-- <img :src="fillImgUrl(r.photos?.split(',')[0])">-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="14">-->
<!-- <h3 class="name flex">{{ r.carType }}-->
<!-- <div class="tagbox">-->
<!-- <span class="tag">{{ r.carColor }}</span>-->
<!-- <span v-show="r.checkOut==1" class="tag">{{ language == 0 ? '可送车' : 'drop-off' }}</span>-->
<!-- <span v-show="r.checkIn==1" class="tag">{{ language == 0 ? '可接车' : 'pick-up' }}</span>-->
<!-- </div>-->
<!-- </h3>-->
<!-- <div class="text-gray mt20">-->
<!-- <span class="mr20">{{ language == 0 ? '座位数' : 'Seats' }}: {{ r.carSeat }}</span>-->
<!-- <span class="mr20">|</span>-->
<!-- <span :span="8">{{-->
<!-- language == 0 ? '运营时间' : 'Servers Time'-->
<!-- }}: {{ r.operStart }} ~ {{ r.operEnd }}</span>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="3">-->
<!-- <div v-if="language==0" class="price">¥-->
<!-- <span-->
<!-- v-if="r.outPrice&&r.inPrice">{{ Number(r.inPrice) > Number(r.outPrice) ? r.outPrice : r.inPrice }}</span>-->
<!-- <span v-else-if="r.inPrice>0">{{ r.inPrice }}</span>-->
<!-- <span v-else>{{ r.outPrice }}</span>-->
<!-- 起-->
<!-- </div>-->
<!-- <div v-else class="price">-->
<!-- €-->
<!-- <span-->
<!-- v-if="r.outPriceEn&&r.inPriceEn">{{ (Number(r.inPriceEn) || 0) > Number(r.outPriceEn) ? r.outPriceEn : r.inPriceEn }}</span>-->
<!-- <span v-else-if="r.inPriceEn>0">{{ r.inPriceEn }}</span>-->
<!-- <span v-else>{{ r.outPriceEn }}</span>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="3">-->
<!-- <el-button class="btn-lineG w100" round type="primary" @click="goOrder(h,r)">-->
<!-- {{ language == 0 ? '我要预订' : 'Select' }}-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!-- <el-empty v-if="h.carVoList.length == 0" :image="`/img/order_no.png`" :image-size="228" description=""/>-->
<!-- </div>-->
</el-collapse-item>
</el-collapse>
<el-col :span="2">
<div v-if="language==0" class="price">¥
<span>{{h.upPrice}}</span>
</div>
<div v-else class="price">
<span>{{h.upPriceEn}}</span>
</div>
</el-col>
<el-col :span="2">
<el-button class="btn-lineG w100" round type="primary" @click="goOrder(h)">
{{ language == 0 ? '我要预订' : 'Select' }}
</el-button>
</el-col>
</el-row>
</div>
<el-empty v-show="!loading&&list.length==0" :image="`/img/order_no.png`" :image-size="228" description=""/>
<div style="height: 50px"></div>
......@@ -144,8 +100,7 @@ function goOrder(item, car) {
id: item.id,
},
query: {
item: encodeURIComponent(JSON.stringify(item)),
car: encodeURIComponent(JSON.stringify(car)),
item: encodeURIComponent(JSON.stringify(item))
}
})
}
......
<template>
<div>
<div class="banner">
<img v-if="language==0" src="@/assets/booking/cl_text_c.png">
<img v-else src="@/assets/booking/cl_text_e.png">
</div>
<div class="box">
<div class="searchBar">
<el-input v-model="query.name" :placeholder="language==0?'请输入关键字搜索':'Search'" class="no-border">
</el-input>
<el-button class="btn-lineG" icon="search" size="large" type="primary" @click="getList">
{{ language == 0 ? '搜索' : 'Search' }}
</el-button>
</div>
</div>
<div v-loading="loading" class="box">
<el-collapse v-model="activeName" accordion style="--el-collapse-header-height:'auto'">
<el-collapse-item v-for="(h,index) in list" :name="index" class="hotel">
<template #title>
<el-row :gutter="20" align="middle" class="w100">
<el-col :span="4">
<div class="index">{{ language == 0 ? '路线' : 'Route' }}{{ index + 1 }}
<img src="@/assets/booking/arrow.png"/>
</div>
</el-col>
<el-col :span="7">
<p class="esp">{{ h.checkIn }}</p>
</el-col>
<el-col :span="4" class="text-center">
<img class="mauto w40px" src="@/assets/booking/wf.png"/>
</el-col>
<el-col :span="7">
<p class="esp ">{{ h.checkOut }}</p>
</el-col>
</el-row>
</template>
<div class="plr20">
<div v-for="(r,index) in h.carVoList" :key="index" class="room">
<el-row :gutter="30" align="middle">
<el-col :span="4">
<div class="roomImg">
<img :src="fillImgUrl(r.photos?.split(',')[0])">
</div>
</el-col>
<el-col :span="14">
<h3 class="name flex">{{ r.carType }}
<div class="tagbox">
<span class="tag">{{ r.carColor }}</span>
<span v-show="r.checkOut==1" class="tag">{{ language == 0 ? '可送车' : 'drop-off' }}</span>
<span v-show="r.checkIn==1" class="tag">{{ language == 0 ? '可接车' : 'pick-up' }}</span>
</div>
</h3>
<div class="text-gray mt20">
<span class="mr20">{{ language == 0 ? '座位数' : 'Seats' }}: {{ r.carSeat }}</span>
<span class="mr20">|</span>
<span :span="8">{{
language == 0 ? '运营时间' : 'Servers Time'
}}: {{ r.operStart }} ~ {{ r.operEnd }}</span>
</div>
</el-col>
<el-col :span="3">
<div v-if="language==0" class="price">¥
<span
v-if="r.outPrice&&r.inPrice">{{ Number(r.inPrice) > Number(r.outPrice) ? r.outPrice : r.inPrice }}</span>
<span v-else-if="r.inPrice>0">{{ r.inPrice }}</span>
<span v-else>{{ r.outPrice }}</span>
</div>
<div v-else class="price">
<span
v-if="r.outPriceEn&&r.inPriceEn">{{ (Number(r.inPriceEn) || 0) > Number(r.outPriceEn) ? r.outPriceEn : r.inPriceEn }}</span>
<span v-else-if="r.inPriceEn>0">{{ r.inPriceEn }}</span>
<span v-else>{{ r.outPriceEn }}</span>
</div>
</el-col>
<el-col :span="3">
<el-button class="btn-lineG w100" round type="primary" @click="goOrder(h,r)">
{{ language == 0 ? '我要预订' : 'Select' }}
</el-button>
</el-col>
</el-row>
</div>
<el-empty v-if="h.carVoList.length == 0" :image="`/img/order_no.png`" :image-size="228" description=""/>
</div>
</el-collapse-item>
</el-collapse>
<el-empty v-show="!loading&&list.length==0" :image="`/img/order_no.png`" :image-size="228" description=""/>
<div style="height: 50px"></div>
</div>
</div>
</template>
<script setup>
import {onMounted} from "@vue/runtime-core"
import * as booking from "@/apiPc/booking"
import {useRouter, useRoute} from "vue-router";
import {useStorage} from "@vueuse/core/index";
import useUserStore from "@/store/modules/user";
const user = useUserStore().user
const router = useRouter()
const route = useRoute()
const language = useStorage('language', 0)
const query = ref({
name: ''
})
const activeName = ref(0)
const cptId = ref('')
const list = ref([])
const loading = ref(false)
onMounted(() => {
query.value.activityId = route.params.cptId
// if (language.value==0)
getList()
})
function getList() {
// if (language.value!=0)return
loading.value = true
booking.getActivityCarList(query.value).then(res => {
list.value = res.rows
loading.value = false
}).catch(e => {
loading.value = false
})
}
function goOrder(item, car) {
if (!user) {
useUserStore().setReLogin()
return
}
router.push({
name: 'carOrder',
params: {
id: item.id,
},
query: {
item: encodeURIComponent(JSON.stringify(item)),
car: encodeURIComponent(JSON.stringify(car)),
}
})
}
</script>
<style lang="scss" scoped>
.hotel {
margin-bottom: 20px;
cursor: pointer;
.index {
display: flex;
font-weight: 500;
padding-left: 20px;
font-size: 18px;
align-items: center;
img {
margin-left: 15px;
}
}
p {
font-weight: 500;
font-size: 24px;
color: #000000;
}
&:hover .el-card {
box-shadow: 0 0 10px #aaa;
}
}
.hotel:nth-child(7n) .index {
color: #009E96;
}
.hotel:nth-child(7n+1) .index {
color: #FF8124;
}
.hotel:nth-child(7n+2) .index {
color: #E4007F;
}
.hotel:nth-child(7n+3) .index {
color: #0068B7;
}
.hotel:nth-child(7n+4) .index {
color: #32B16C;
}
.hotel:nth-child(7n+5) .index {
color: #920783;
}
.hotel:nth-child(7n+6) .index {
color: #00B7EE;
}
.banner {
height: 140px;
background-size: cover;
text-align: center;
background: url("@/assets/booking/cl_bg.png") center;
display: flex;
align-items: center;
justify-content: center;
img {
display: block;
margin: -30px auto 0;
width: auto;
}
}
.searchBar {
position: relative;
top: -30px;
background: #FFFFFF;
display: flex;
padding: 20px;
border-radius: 10px;
}
.no-border {
border: none;
background: #F5F7F9;
:deep(.el-input__wrapper) {
border: none;
box-shadow: none;
background: #F5F7F9;
}
}
.starBox {
img {
display: inline-block;
margin-right: 4px
}
}
.tagbox {
margin: 15px 0;
a {
color: #AFB5B9;
font-size: 12px;
}
span {
border-radius: 13px;
font-size: 12px;
padding: 4px 10px;
margin-right: 10px;
font-weight: 400;
}
span:nth-child(4n) {
background: rgba(50, 177, 108, 0.2);
color: rgba(50, 177, 108, 1);
}
span:nth-child(4n+1) {
background: rgba(243, 152, 0, 0.2);
color: rgba(243, 152, 0, 1);
}
span:nth-child(4n+2) {
background: rgba(0, 160, 233, 0.2);
color: rgba(0, 160, 233, 1);
}
span:nth-child(4n+3) {
background: rgba(247, 64, 166, 0.2);
color: rgba(247, 64, 166, 1);
}
}
.name.flex {
align-items: center;
}
.name .tagbox {
margin: 0 0 0 15px;
}
.room {
background: #FAFBFD;
margin: 20px 0 0;
padding: 20px;
border: 1px solid #E5E5E5;
.name {
font-size: 20px;
margin: 0 0 10px;
}
.roomImg {
aspect-ratio: 16/9;
border-radius: 10px;
overflow: hidden;
img {
width: 100%;
object-fit: cover;
object-position: center;
height: 100%;
}
}
.price {
color: #FF8124;
font-size: 24px;
span {
font-size: 36px;
font-family: "DIN Alternate"
}
}
.bg-lineg {
margin: auto;
border-radius: 10px;
text-align: center;
padding: 7px 2px 2px;
font-size: 24px;
width: 66px;
cursor: pointer;
div {
background: #fff;
font-size: 13px;
border-radius: 20px;
padding: 0 10px;
color: #453DEA;
font-weight: 500;
}
}
}
</style>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!