Commit 241cf99b authored by 华国豪's avatar 华国豪 🙄

1

parent c33a9b56
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
<img v-for="(item,index) in images" :src="item.img_url" :key="index+5000"> <img v-for="(item,index) in images" :src="item.img_url" :key="index+5000">
</viewer> </viewer>
</div> </div>
<div class="empty-data" v-else> <div class="empty-data" v-else >
<i class="iconfont icon-kong"></i> <i class="iconfont icon-kong"></i>
很抱歉,此商品已经下架了,客官看看别的吧~ 很抱歉,此商品已经下架了,客官看看别的吧~
</div> </div>
......
...@@ -667,13 +667,13 @@ ...@@ -667,13 +667,13 @@
:key="item.prod_no" :key="item.prod_no"
:label="item.prod_name" :label="item.prod_name"
:value="item"> :value="item">
<div v-if="item.type == 2"> <div v-if="item.type == 2 || item.type == 1">
<i style="padding-right: 15px" class="iconfont icon-lvseqizi"></i> <i style="padding-right: 15px" class="iconfont icon-lvseqizi"></i>
<span class="PingFangR">{{ item.prod_name.replace(/KKday/g, '印象之旅') }}</span> <span class="PingFangR">{{ item.prod_name}}</span>
</div> </div>
<div v-else> <div v-else>
<span style="float: left; width: 370px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.prod_name.replace(/KKday/g, '印象之旅') }}</span> <span style="float: left; width: 370px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.prod_name}}</span>&nbsp;&nbsp;
<span v-if="item.countries && item.countries.length > 0" style="float: right">{{ item.countries[0].name + item.countries[0].cities[0].name }}</span> <span v-if="item.countries && item.countries.length > 0" style="float: right">{{ item.countries[0].name }}&nbsp;&nbsp;{{item.countries[0].cities[0].name}}</span>
<i style="float: right;color: rgb(204, 204, 204)" class="iconfont icon-ico_dingwei"></i> <i style="float: right;color: rgb(204, 204, 204)" class="iconfont icon-ico_dingwei"></i>
</div> </div>
</el-option> </el-option>
...@@ -957,9 +957,9 @@ export default { ...@@ -957,9 +957,9 @@ export default {
}, },
methods: { methods: {
getSelect(e){ getSelect(e){
if (e.prod_no && e.type == 2) { if (e.prod_no && (e.type == 2 || e.type == 1)) {
let dom = document.querySelector("#blankLink") let dom = document.querySelector("#blankLink")
let fullPath = `/FreeList?id=${e.prod_no}&name=${e.prod_name}&CCListActive=${0}&type=${1}`; let fullPath = `/FreeList?id=${e.prod_no}&name=${e.prod_name}&CCListActive=${this.CCListActive}&type=${e.type}`;
dom.href=`http://${window.location.host}/#${fullPath}` dom.href=`http://${window.location.host}/#${fullPath}`
dom.click() dom.click()
} else if (e.prod_no && !e.type){ } else if (e.prod_no && !e.type){
...@@ -969,9 +969,55 @@ export default { ...@@ -969,9 +969,55 @@ export default {
this.queryStr = '' this.queryStr = ''
this.searchList = [] this.searchList = []
}, },
getIndex(query){
let ok = false
for(let i = 0; i < this.CCList.length; i++){
if (ok) break;
let ff = this.CCList[i]
if (ff.Country_Name == query) {
this.CCListActive = i
ok = true
break;
}
for(let y = 0; y < ff.Cities.length; y++){
let cc = ff.Cities[y]
if (cc.City_Name == query) {
this.CCListActive = i
ok = true
break;
}
}
}
},
searchKey(query){ searchKey(query){
this.queryStr2 = query this.queryStr2 = query
if (query !== '') { if (query !== '') {
let ct = null
for(let i = 0; i < this.CCList.length; i++){
let ff = this.CCList[i]
if (ff.Country_Name == query) {
this.CCListActive = i
ct = {
type: 1,
name: query,
id: ff.Country_Code
}
break
}
for(let y = 0; y < ff.Cities.length; y++){
let cc = ff.Cities[y]
if (cc.City_Name == query) {
this.CCListActive = i
ct = {
type: 2,
name: query,
id: cc.City_Code
}
break
}
}
}
console.log(this.CCListActive)
this.queryStr = query this.queryStr = query
this.loading2 = true; this.loading2 = true;
this.apiJavaPost( this.apiJavaPost(
...@@ -986,13 +1032,31 @@ export default { ...@@ -986,13 +1032,31 @@ export default {
res => { res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
let data = res.data.data.prods; let data = res.data.data.prods;
let no1 = data.length > 0 ? data[0].countries : '' // let no1 = data.length > 0 ? data[0].countries : ''
this.loading2 = false; this.loading2 = false;
if (no1){ if (!ct){
let cc = null, tt = null;
for(let i = 0; i < data.length; i++){
if (cc && tt) break;
cc = data[i].countries[0];
if (data[i].countries[0].cities[0].name !== '所有城市'){
tt = data[i].countries[0].cities[0];
}
}
console.log(cc, tt)
let obj = {
type: cc && tt ? 2 : 1,
prod_name: cc && tt ? tt.name : cc.name,
prod_no: cc && tt ? tt.id : cc.id,
}
let name = cc && tt ? tt.name : cc.name
this.getIndex(name)
data.unshift(obj)
} else if (ct){
let obj = { let obj = {
type: 2, type: ct.type,
prod_name: no1 ? no1[0].name : '', prod_name: ct.name,
prod_no: no1 ? no1[0].id : '', prod_no: ct.id
} }
data.unshift(obj) data.unshift(obj)
} }
......
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