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

1

parent c33a9b56
......@@ -239,7 +239,7 @@
<img v-for="(item,index) in images" :src="item.img_url" :key="index+5000">
</viewer>
</div>
<div class="empty-data" v-else>
<div class="empty-data" v-else >
<i class="iconfont icon-kong"></i>
很抱歉,此商品已经下架了,客官看看别的吧~
</div>
......
......@@ -667,13 +667,13 @@
:key="item.prod_no"
:label="item.prod_name"
: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>
<span class="PingFangR">{{ item.prod_name.replace(/KKday/g, '印象之旅') }}</span>
<span class="PingFangR">{{ item.prod_name}}</span>
</div>
<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 v-if="item.countries && item.countries.length > 0" style="float: right">{{ item.countries[0].name + item.countries[0].cities[0].name }}</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 }}&nbsp;&nbsp;{{item.countries[0].cities[0].name}}</span>
<i style="float: right;color: rgb(204, 204, 204)" class="iconfont icon-ico_dingwei"></i>
</div>
</el-option>
......@@ -957,9 +957,9 @@ export default {
},
methods: {
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 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.click()
} else if (e.prod_no && !e.type){
......@@ -969,9 +969,55 @@ export default {
this.queryStr = ''
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){
this.queryStr2 = 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.loading2 = true;
this.apiJavaPost(
......@@ -986,13 +1032,31 @@ export default {
res => {
if (res.data.resultCode === 1) {
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;
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 = {
type: 2,
prod_name: no1 ? no1[0].name : '',
prod_no: no1 ? no1[0].id : '',
type: ct.type,
prod_name: ct.name,
prod_no: ct.id
}
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