Commit ce68ca22 authored by 黄奎's avatar 黄奎

临时提交

parent c997b6dc
import Vue from 'vue'
import axios from 'axios'
import md5 from 'js-md5'
// import {eventBus} from './eventBus'
import VueCoreVideoPlayer from 'vue-core-video-players'
import 'viewerjs/dist/viewer.css'
import user from './user'
import message from './message'
import product from './product'
import VueViewer from 'v-viewer'
// import VueCoreVideoPlayer from 'vue-core-video-player'
Vue.prototype.$EventBus = new Vue()
Vue.use(VueCoreVideoPlayer)
Vue.use(VueViewer)
Vue.prototype.$md5 = md5;
Vue.prototype.$message = message
Vue.prototype.$product = product
//域名管理对象
Vue.prototype.domainManager = function() {
let domainUrl = '';
domainUrl = "http://192.168.2.214:8082";
domainUrl = "http://127.0.0.1";
let domainNameUrl = this.GetDomain();
domainNameUrl = "http://tmb2b.oytour.com/"
if (domainNameUrl.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
} else if (domainNameUrl.indexOf('oytour') !== -1) {
// domainUrl = "http://reborn.oytour.com";
domainUrl = 'http://192.168.10.226:8015' //'http://192.168.10.226:8015' ''http://192.168.10.9:8083' '
//域名管理对象
Vue.prototype.domainManager = function () {
let domainUrl = 'http://192.168.5.214';
domainUrl = "http://192.168.5.46:8501";
var domainNameUrl = window.location.hostname;
if (domainNameUrl.indexOf('oytour') !== -1) {
domainUrl = 'http://reborn.oytour.com'
}
var obj = {
//主地址
DomainUrl: domainUrl,
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
DomainUrl: domainUrl, //ERP接口地址
PostUrl: domainUrl + "/api/common/post", //常用提交数据URL
javaUrl: 'http://efficient.oytour.com'
};
return obj;
}
//获取当前域名
Vue.prototype.GetDomain = function() {
}
//获取当前域名
Vue.prototype.GetDomain = function () {
var domainNameUrl = window.location.hostname;
domainNameUrl = "www.oytour.com";
return domainNameUrl;
}
Vue.prototype.groupBy = function(array, f) {
Vue.prototype.groupBy = function (array, f) {
const groups = {};
array.forEach((item) => {
const group = JSON.stringify(f(item));
......@@ -58,7 +50,8 @@ Vue.prototype.groupBy = function(array, f) {
};
});
}
Vue.prototype.moneyFormat = function(num, decimal = 2, split = ',') {
Vue.prototype.moneyFormat = function (num, decimal = 2, split = ',') {
function thousandFormat(num) {
const len = num.length
return len <= 3 ? num : thousandFormat(num.substr(0, len - 3)) + split + num.substr(len - 3, 3)
......@@ -82,9 +75,9 @@ Vue.prototype.moneyFormat = function(num, decimal = 2, split = ',') {
} else {
return '--'
}
}
//HTTP提交数据
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
}
//HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -122,10 +115,12 @@ Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
}
})
.then(res => {
if(res.data.resultCode === 10000) {
if (res.data.resultCode === 10000) {
this.$router.replace({
path: '/login',
query: {path: path}
query: {
path: path
}
});
return
}
......@@ -134,7 +129,7 @@ Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
}, faildCall)
}
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -146,7 +141,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
var GroupId = 0;
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = '' //this.getLocalStorage().secretKey;
key = '';
}
if (localStorage.groupinfo && localStorage.groupinfo != 'undefined') {
var groupJson = JSON.parse(localStorage.groupinfo);
......@@ -175,7 +170,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
//获取缓存
Vue.prototype.getLocalStorage = function() {
Vue.prototype.getLocalStorage = function () {
try {
var localStorageData = window.localStorage["b2bUser"];
if (localStorageData !== undefined && localStorageData != 'undefined') {
......@@ -190,7 +185,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
}
//向外跳转
Vue.prototype.OpenNewUrl = function(URL) {
Vue.prototype.OpenNewUrl = function (URL) {
if (URL && URL != '') {
if (URL.indexOf("https") != -1) {
var str = 'http://' + URL.substring(8);
......@@ -205,8 +200,8 @@ Vue.prototype.OpenNewUrl = function(URL) {
}
//公用跳转
Vue.prototype.CommonJump = function(path, obj, type = 'push') {
let p = typeof(path) == 'string' ? path : this.$product.genernalUrl(path)
Vue.prototype.CommonJump = function (path, obj, type = 'push') {
let p = typeof (path) == 'string' ? path : this.$product.genernalUrl(path)
if (type === 'blank') { // 新窗口打开
let routeUrl = this.$router.resolve({
path: p,
......@@ -225,8 +220,9 @@ Vue.prototype.CommonJump = function(path, obj, type = 'push') {
});
}
}
Vue.prototype.$user = user
Vue.prototype.createCalendar = function(dateStr) {
Vue.prototype.createCalendar = function (dateStr) {
var days = [];
var date;
if (dateStr) {
......@@ -279,9 +275,9 @@ Vue.prototype.createCalendar = function(dateStr) {
CurrentYear: currentYear,
CurrentWeek: currentWeek
};
}
//格式化日期
Vue.prototype.formatDate = function(year, month, day) {
}
//格式化日期
Vue.prototype.formatDate = function (year, month, day) {
var y = year;
var m = month;
if (m < 10) m = "0" + m;
......@@ -291,7 +287,7 @@ Vue.prototype.formatDate = function(year, month, day) {
}
//格式化日期二
Vue.prototype.formatDate2 = function(dateStr) {
Vue.prototype.formatDate2 = function (dateStr) {
var date = new Date(dateStr);
return {
CYear: date.getFullYear(),
......@@ -301,7 +297,7 @@ Vue.prototype.formatDate2 = function(dateStr) {
}
//添加月份
Vue.prototype.AddMonth = function(dateStr, month) {
Vue.prototype.AddMonth = function (dateStr, month) {
var v = new Date(dateStr);
if (v) {
var t = new Date(v.getFullYear(), v.getMonth(), v.getDate(), v.getHours(), v.getMinutes(), v.getSeconds(), v.getMilliseconds());
......@@ -314,10 +310,10 @@ Vue.prototype.AddMonth = function(dateStr, month) {
}
//获取URL中参数
Vue.prototype.getUrlKey = function(name, url) {
Vue.prototype.getUrlKey = function (name, url) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(url) || [, ""])[1].replace(/\+/g, '%20')) || null
}
Vue.prototype.GetHtml = function(str) {
Vue.prototype.GetHtml = function (str) {
if (str && str != "") {
return str.replace(/&lt;/g, '<').replace(/&gt;/g, '>')
.replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&apos;/g, "'");
......
......@@ -158,7 +158,7 @@
.category-btn {
width: 100px;
}
.mobile-logo{
.mobile-logo {
max-height: 35px;
max-width: 120px;
object-fit: contain;
......@@ -178,8 +178,9 @@
class="zk_toolbar flex justify-between"
:class="{ 'q-px-none': $q.platform.is.desktop }"
>
<div class="flex"><div class="f24" v-if="$q.platform.is.mobile && isHome" @click="handleShowDialog">
<i class="iconfont iconmore1" style="font-size: 24px;"></i>
<div class="flex">
<div class="f24" v-if="$q.platform.is.mobile && isHome" @click="handleShowDialog">
<i class="iconfont iconmore1" style="font-size: 24px"></i>
</div>
<img
:src="baseData.logo"
......@@ -189,12 +190,13 @@
filter: drop-shadow(0px 0px var(--q-color-primary));
"
class="q-mr-lg q-ml-sm"
:class="{'mobile-logo':$q.platform.is.mobile}"
:class="{ 'mobile-logo': $q.platform.is.mobile }"
@click="CommonJump('/index', {})"
/></div>
<!-- <div style="transform:scale(0.6,0.6)"> -->
/>
</div>
<!--HK 2024-11-22 去掉 搜索接口有调整-->
<searchSf2 v-if="!isHome" :plugData="plugData"></searchSf2>
<!-- </div> -->
<!-- pc -->
<div v-if="$q.platform.is.desktop">
<q-btn label="繁體中文" flat>
......@@ -215,11 +217,7 @@
unelevated
>
<template v-slot:label>
<img
class="avatar"
v-if="LoginUser.photo"
:src="LoginUser.photo"
/>
<img class="avatar" v-if="LoginUser.photo" :src="LoginUser.photo" />
<img class="avatar" v-else src="../../assets/img/avatar.png" />
<!-- <span>{{LoginUser.name || LoginUser.mailbox}}</span> -->
......@@ -229,7 +227,7 @@
<q-list class="text-grey-8" dense>
<q-item clickable v-close-popup to="/setUserInfo">
<q-item-section avatar>
<q-avatar icon="iconfont iconpeople1"/>
<q-avatar icon="iconfont iconpeople1" />
</q-item-section>
<q-item-section>
<q-item-label>個人信息</q-item-label>
......@@ -237,7 +235,7 @@
</q-item>
<q-item clickable v-close-popup to="/coupon">
<q-item-section avatar>
<q-avatar icon="iconfont iconqianbao"/>
<q-avatar icon="iconfont iconqianbao" />
</q-item-section>
<q-item-section>
<q-item-label>優惠券</q-item-label>
......@@ -245,7 +243,7 @@
</q-item>
<q-item clickable v-close-popup to="/order">
<q-item-section avatar>
<q-avatar icon="iconfont iconorder"/>
<q-avatar icon="iconfont iconorder" />
</q-item-section>
<q-item-section>
<q-item-label>訂單</q-item-label>
......@@ -254,7 +252,7 @@
<q-separator inset class="q-mx-lg" />
<q-item clickable v-close-popup to="/setUsersList">
<q-item-section avatar>
<q-avatar icon="iconfont iconpeople"/>
<q-avatar icon="iconfont iconpeople" />
</q-item-section>
<q-item-section>
<q-item-label>出行人信息管理</q-item-label>
......@@ -262,7 +260,7 @@
</q-item>
<q-item clickable v-close-popup to="/setAddress">
<q-item-section avatar>
<q-avatar icon="iconfont iconemail"/>
<q-avatar icon="iconfont iconemail" />
</q-item-section>
<q-item-section>
<q-item-label>管理邮寄地址</q-item-label>
......@@ -270,7 +268,7 @@
</q-item>
<q-item clickable v-close-popup to="/setInfo">
<q-item-section avatar>
<q-avatar icon="iconfont iconset"/>
<q-avatar icon="iconfont iconset" />
</q-item-section>
<q-item-section>
<q-item-label>賬戶設置</q-item-label>
......@@ -278,7 +276,7 @@
</q-item>
<q-item clickable v-close-popup @click="loginOut">
<q-item-section avatar>
<q-avatar icon="iconfont iconlog-in"/>
<q-avatar icon="iconfont iconlog-in" />
</q-item-section>
<q-item-section>
<q-item-label>登出</q-item-label>
......@@ -337,8 +335,15 @@
:baseData="baseData"
:dataList="dataList"
></city-category>
<popup @mousemove.prevent id="city-category" v-model="showDialog" mode="bottom" @close="handleDialogClose">
<city-category-mobile @close="showDialog = false"
<popup
@mousemove.prevent
id="city-category"
v-model="showDialog"
mode="bottom"
@close="handleDialogClose"
>
<city-category-mobile
@close="showDialog = false"
:baseData="baseData"
:dataList="dataList"
></city-category-mobile
......@@ -350,9 +355,9 @@
import popup from "../props/index";
import CityCategoryMobile from "./city-category-mobile.vue";
import cityCategory from "./city-category.vue";
import searchSf2 from '../search_sf/search-top.vue'
import searchSf2 from "../search_sf/search-top.vue";
export default {
components: { cityCategory, CityCategoryMobile, popup,searchSf2 },
components: { cityCategory, CityCategoryMobile, popup, searchSf2 },
props: {
baseData: {
type: Object,
......@@ -369,7 +374,7 @@ export default {
},
data() {
return {
plugData: {details: [], Title: ''},
plugData: { details: [], Title: "" },
showDialog: false,
searchDate: "",
searchEndDate: "",
......@@ -401,7 +406,7 @@ export default {
},
$route: {
handler: function (val, oldVal) {
console.log('val', val, oldVal)
console.log("val", val, oldVal);
this.isHome = val.path === "/" || val.path === "/index";
// this.isSearch = val.path === "/search";
},
......@@ -448,19 +453,18 @@ export default {
// this.getCategoryList();
},
methods: {
handler(event) {event.preventDefault();},
handler(event) {
event.preventDefault();
},
handleShowDialog() {
this.showDialog = true;
this.scrollTop = document.querySelector('body').scrollTop;
document.querySelector(
"body"
).style = `position: fixed; top: -${this.scrollTop}px`;
this.scrollTop = document.querySelector("body").scrollTop;
document.querySelector("body").style = `position: fixed; top: -${this.scrollTop}px`;
},
handleDialogClose() {
document.querySelector(
"body"
).style = '';},
document.querySelector("body").style = "";
},
avatarClick() {
if (this.LoginUser.token) {
this.CommonJump("/userCenter");
......
......@@ -40,7 +40,7 @@
standout
placeholder="蒐索關鍵字"
class="q-ma-md"
@blur="changeAddrSearchHandler"
@blur="handleSearchKey"
/>
<!-- <q-tree
ref="area"
......@@ -505,8 +505,6 @@ export default {
},
created() {
this.msg = this.qMsg;
// this.msg.teamType = [];
//this.initAreaList();
this.initGoods();
this.msg.priceRange = {
min: 1,
......@@ -524,11 +522,11 @@ export default {
mounted() {
let LineIdList = [];
if (this.msg.LineIds && this.msg.LineIds.length > 0) {
LineIdList = this.msg.LineIds.split(";");
LineIdList = this.msg.LineIds.split(",");
}
let SeriesIdList = [];
if (this.msg.SeriesIds && this.msg.SeriesIds.length > 0) {
SeriesIdList = this.msg.SeriesIds.split(";");
SeriesIdList = this.msg.SeriesIds.split(",");
}
if (
(LineIdList && LineIdList.length > 0) ||
......@@ -536,7 +534,12 @@ export default {
) {
let arr = [];
this.goodsType.forEach((x) => {
let lineIdIndex = LineIdList.findIndex((yId) => x.Id.slice(2) == yId);
var tempLineId = 0;
var tempLineIdArray = x.Id.split("|");
if (tempLineIdArray && tempLineIdArray.length == 2) {
tempLineId = tempLineIdArray[0];
}
let lineIdIndex = LineIdList.findIndex((yId) => tempLineId == yId);
if (lineIdIndex != -1) {
arr.push(x.Id);
}
......@@ -544,8 +547,12 @@ export default {
if (lineIdIndex != -1) {
arr.push(y.Id);
} else {
let seriesIdIndex = SeriesIdList.findIndex((yId) => y.Id.slice(2) == yId);
var tempLtId = 0;
var tempLtIdArray = y.Id.split("|");
if (tempLtIdArray && tempLtIdArray.length == 2) {
tempLtId = tempLtIdArray[0];
}
let seriesIdIndex = SeriesIdList.findIndex((yId) => tempLtId == yId);
if (seriesIdIndex != -1) {
arr.push(y.Id);
}
......@@ -556,15 +563,11 @@ export default {
}
},
methods: {
handleSelected(target) {
console.log("handleSelected", target);
},
handleTicked(target) {
this.msg.pageIndex = 1;
this.ticked = target;
this.goSearchHandler();
},
handleSearchKey(target) {
this.msg.pageIndex = 1;
this.goSearchHandler();
......@@ -635,11 +638,11 @@ export default {
let arr = [];
let LineIdList = [];
if (this.msg.LineIds && this.msg.LineIds.length > 0) {
LineIdList = this.msg.LineIds.split(";");
LineIdList = this.msg.LineIds.split(",");
}
let SeriesIdList = [];
if (this.msg.SeriesIds && this.msg.SeriesIds.length > 0) {
SeriesIdList = this.msg.SeriesIds.split(";");
SeriesIdList = this.msg.SeriesIds.split(",");
}
this.apipost(
"b2c_get_GetB2CQueryCondition",
......@@ -652,7 +655,13 @@ export default {
x.explsed = false;
x.isShow = true;
x.children = x.SubList;
let lineIdIndex = LineIdList.findIndex((yId) => x.Id.slice(2) == yId);
var tempLineId = 0;
var tempLineIdArray = x.Id.split("|");
if (tempLineIdArray && tempLineIdArray.length == 2) {
tempLineId = tempLineIdArray[0];
}
let lineIdIndex = LineIdList.findIndex((yId) => tempLineId == yId);
x.children.forEach((y) => {
y.checked = false;
y.explsed = false;
......@@ -661,9 +670,12 @@ export default {
arr.push(y.Id);
this.ticked.push(y.Id);
} else {
let seriesIdIndex = SeriesIdList.findIndex(
(yId) => y.Id.slice(2) == yId
);
var tempLtId = 0;
var tempLtIdArray = y.Id.split("|");
if (tempLtIdArray && tempLtIdArray.length == 2) {
tempLtId = tempLtIdArray[0];
}
let seriesIdIndex = SeriesIdList.findIndex((yId) => tempLtId == yId);
if (seriesIdIndex != -1) {
arr.push(y.Id);
this.ticked.push(y.Id);
......@@ -758,7 +770,6 @@ export default {
this.msg,
(res) => {
this.$q.loading.hide();
console.log("b2c_get_GetB2C2024TravelProductPage", res);
if (res.data.resultCode == 1) {
this.PageCount = res.data.data.pageCount;
this.TotalCount = res.data.data.count;
......
This diff is collapsed.
......@@ -676,6 +676,7 @@ export default {
let arr = [];
let jObj = JSON.parse(window.localStorage.getItem("baseifo"));
jObj.CategoryList.forEach((x) => {
x.checked = false;
x.explsed = false;
x.isShow = true;
......
This diff is collapsed.
This diff is collapsed.
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