Commit ed8cfdad authored by 黄奎's avatar 黄奎

11

parent 237c87d7
...@@ -9,48 +9,39 @@ import message from './message' ...@@ -9,48 +9,39 @@ import message from './message'
import product from './product' import product from './product'
import VueViewer from 'v-viewer' import VueViewer from 'v-viewer'
// import VueCoreVideoPlayer from 'vue-core-video-player' // import VueCoreVideoPlayer from 'vue-core-video-player'
import 'animate.css'; // import 'animate.css';
// 或者只引入需要的动画类 // 或者只引入需要的动画类
import 'animate.css/source/attention_seekers/bounce.css'; // import 'animate.css/source/attention_seekers/bounce.css';
Vue.prototype.$EventBus = new Vue() Vue.prototype.$EventBus = new Vue()
Vue.use(VueCoreVideoPlayer) Vue.use(VueCoreVideoPlayer)
Vue.use(VueViewer) Vue.use(VueViewer)
Vue.prototype.$md5 = md5; Vue.prototype.$md5 = md5;
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$product = product Vue.prototype.$product = product
//域名管理对象 //域名管理对象
Vue.prototype.domainManager = function() { Vue.prototype.domainManager = function () {
let domainUrl = ''; let domainUrl = "http://192.168.5.214";
domainUrl = "http://192.168.2.214:8082"; let domainNameUrl = this.GetDomain();
domainUrl = "http://192.168.5.46"; if (domainNameUrl.indexOf('oytour') !== -1) {
// domainUrl = "http://reborn.oytour.com";
let domainNameUrl = '';
domainNameUrl = this.GetDomain();
// domainNameUrl = "http://tmb2b.oytour.com/"
domainNameUrl = window.location.hostname
if (domainNameUrl.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
} else if (domainNameUrl.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com"; domainUrl = "http://reborn.oytour.com";
// domainUrl = 'http://192.168.10.68' //'http://192.168.10.226:8015' ''http://192.168.10.9:8083' '
} }
//domainUrl = "http://192.168.5.46:8501";
var obj = { var obj = {
//主地址 //主地址
DomainUrl: domainUrl, DomainUrl: domainUrl,
//常用提交数据URL //常用提交数据URL
PostUrl: domainUrl + "/api/common/post", PostUrl: domainUrl + "/api/common/post",
javaUrl: 'http://efficient.oytour.com' javaUrl: 'http://efficient.oytour.com'
}; };
return obj; return obj;
} }
//获取当前域名 //获取当前域名
Vue.prototype.GetDomain = function() { Vue.prototype.GetDomain = function () {
var domainNameUrl = window.location.hostname; var domainNameUrl = window.location.hostname;
domainNameUrl = "www.oytour.com"; domainNameUrl = "www.oytour.com";
return domainNameUrl; return domainNameUrl;
} }
Vue.prototype.groupBy = function(array, f) { Vue.prototype.groupBy = function (array, f) {
const groups = {}; const groups = {};
array.forEach((item) => { array.forEach((item) => {
const group = JSON.stringify(f(item)); const group = JSON.stringify(f(item));
...@@ -64,7 +55,7 @@ Vue.prototype.groupBy = function(array, f) { ...@@ -64,7 +55,7 @@ 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) { function thousandFormat(num) {
const len = num.length const len = num.length
return len <= 3 ? num : thousandFormat(num.substr(0, len - 3)) + split + num.substr(len - 3, 3) return len <= 3 ? num : thousandFormat(num.substr(0, len - 3)) + split + num.substr(len - 3, 3)
...@@ -88,9 +79,9 @@ Vue.prototype.moneyFormat = function(num, decimal = 2, split = ',') { ...@@ -88,9 +79,9 @@ Vue.prototype.moneyFormat = function(num, decimal = 2, split = ',') {
} else { } else {
return '--' return '--'
} }
} }
//HTTP提交数据 //HTTP提交数据
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) { Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
...@@ -128,10 +119,12 @@ Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) { ...@@ -128,10 +119,12 @@ Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
} }
}) })
.then(res => { .then(res => {
if(res.data.resultCode === 10000) { if (res.data.resultCode === 10000) {
this.$router.replace({ this.$router.replace({
path: '/login', path: '/login',
query: {path: path} query: {
path: path
}
}); });
return return
} }
...@@ -140,7 +133,7 @@ Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) { ...@@ -140,7 +133,7 @@ Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
}, faildCall) }, faildCall)
} }
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) { Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
...@@ -181,7 +174,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) { ...@@ -181,7 +174,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
//获取缓存 //获取缓存
Vue.prototype.getLocalStorage = function() { Vue.prototype.getLocalStorage = function () {
try { try {
var localStorageData = window.localStorage["b2bUser"]; var localStorageData = window.localStorage["b2bUser"];
if (localStorageData !== undefined && localStorageData != 'undefined') { if (localStorageData !== undefined && localStorageData != 'undefined') {
...@@ -196,7 +189,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) { ...@@ -196,7 +189,7 @@ Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
} }
//向外跳转 //向外跳转
Vue.prototype.OpenNewUrl = function(URL) { Vue.prototype.OpenNewUrl = function (URL) {
if (URL && URL != '') { if (URL && URL != '') {
if (URL.indexOf("https") != -1) { if (URL.indexOf("https") != -1) {
var str = 'http://' + URL.substring(8); var str = 'http://' + URL.substring(8);
...@@ -211,8 +204,8 @@ Vue.prototype.OpenNewUrl = function(URL) { ...@@ -211,8 +204,8 @@ Vue.prototype.OpenNewUrl = function(URL) {
} }
//公用跳转 //公用跳转
Vue.prototype.CommonJump = function(path, obj, type = 'push') { Vue.prototype.CommonJump = function (path, obj, type = 'push') {
let p = typeof(path) == 'string' ? path : this.$product.genernalUrl(path) let p = typeof (path) == 'string' ? path : this.$product.genernalUrl(path)
if (type === 'blank') { // 新窗口打开 if (type === 'blank') { // 新窗口打开
let routeUrl = this.$router.resolve({ let routeUrl = this.$router.resolve({
path: p, path: p,
...@@ -232,7 +225,7 @@ Vue.prototype.CommonJump = function(path, obj, type = 'push') { ...@@ -232,7 +225,7 @@ Vue.prototype.CommonJump = function(path, obj, type = 'push') {
} }
} }
Vue.prototype.$user = user Vue.prototype.$user = user
Vue.prototype.createCalendar = function(dateStr) { Vue.prototype.createCalendar = function (dateStr) {
var days = []; var days = [];
var date; var date;
if (dateStr) { if (dateStr) {
...@@ -285,9 +278,9 @@ Vue.prototype.createCalendar = function(dateStr) { ...@@ -285,9 +278,9 @@ Vue.prototype.createCalendar = function(dateStr) {
CurrentYear: currentYear, CurrentYear: currentYear,
CurrentWeek: currentWeek CurrentWeek: currentWeek
}; };
} }
//格式化日期 //格式化日期
Vue.prototype.formatDate = function(year, month, day) { Vue.prototype.formatDate = function (year, month, day) {
var y = year; var y = year;
var m = month; var m = month;
if (m < 10) m = "0" + m; if (m < 10) m = "0" + m;
...@@ -297,7 +290,7 @@ Vue.prototype.formatDate = function(year, month, day) { ...@@ -297,7 +290,7 @@ Vue.prototype.formatDate = function(year, month, day) {
} }
//格式化日期二 //格式化日期二
Vue.prototype.formatDate2 = function(dateStr) { Vue.prototype.formatDate2 = function (dateStr) {
var date = new Date(dateStr); var date = new Date(dateStr);
return { return {
CYear: date.getFullYear(), CYear: date.getFullYear(),
...@@ -307,7 +300,7 @@ Vue.prototype.formatDate2 = function(dateStr) { ...@@ -307,7 +300,7 @@ Vue.prototype.formatDate2 = function(dateStr) {
} }
//添加月份 //添加月份
Vue.prototype.AddMonth = function(dateStr, month) { Vue.prototype.AddMonth = function (dateStr, month) {
var v = new Date(dateStr); var v = new Date(dateStr);
if (v) { if (v) {
var t = new Date(v.getFullYear(), v.getMonth(), v.getDate(), v.getHours(), v.getMinutes(), v.getSeconds(), v.getMilliseconds()); var t = new Date(v.getFullYear(), v.getMonth(), v.getDate(), v.getHours(), v.getMinutes(), v.getSeconds(), v.getMilliseconds());
...@@ -320,10 +313,10 @@ Vue.prototype.AddMonth = function(dateStr, month) { ...@@ -320,10 +313,10 @@ Vue.prototype.AddMonth = function(dateStr, month) {
} }
//获取URL中参数 //获取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 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 != "") { if (str && str != "") {
return str.replace(/&lt;/g, '<').replace(/&gt;/g, '>') return str.replace(/&lt;/g, '<').replace(/&gt;/g, '>')
.replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&apos;/g, "'"); .replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&apos;/g, "'");
......
...@@ -565,8 +565,11 @@ export default { ...@@ -565,8 +565,11 @@ export default {
}, },
created() { created() {
this.msg = this.qMsg; this.msg = this.qMsg;
// this.msg.teamType = []; if(this.qMsg&&this.qMsg.TeamType==1)
//this.initAreaList(); {
this.msg.TeamType=1;
}
this.initGoods(); this.initGoods();
this.msg.priceRange = { this.msg.priceRange = {
min: 1, min: 1,
......
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