Authored by yyq

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

... ... @@ -170,7 +170,7 @@
}
})();
window.appBaseLogs = {events: [{}]};
window.appBaseLogs = {events: [{}], device: {ak: '', udid: ''}, status: [{av: '', udid: '', sid: ''}]};
</script>
</body>
</html>
... ...
... ... @@ -88,7 +88,7 @@ export default {
let DATA = [];
list.map((value, i) => {
DATA.push({...this.yasParams, I_INDEX: i + index, PRD_ID: value.id});
DATA.push({...this.yasParams, I_INDEX: i + index + 1, PRD_ID: value.id});
});
this.$store.dispatch('reportYas', {
params: {
... ...
... ... @@ -238,6 +238,7 @@ export default {
this.yasTab();
},
goSearch() {
this.yasGoSearch();
this.$router.push({
name: 'Search',
});
... ... @@ -247,6 +248,7 @@ export default {
this.priceDesc ? 'desc-arrow' : 'asc-arrow';
},
goFilter() {
this.yasTab(true);
this.$refs.filtrate.show();
},
setYasParam: function({param, tab}) {
... ... @@ -285,6 +287,14 @@ export default {
this.yasParams.TAB_NAME = tab.name;
}
},
yasGoSearch() {
this.$store.dispatch('reportYas', {
params: {
param: {SEARCH_POS: 3},
appop: 'XY_UFO_SEARCH_CLICK'
}
});
},
yasShowPage() {
let {total, list} = this.productList;
let PRD_LIST = [];
... ... @@ -300,10 +310,16 @@ export default {
}
});
},
yasTab() {
yasTab(isFilter = false) {
let param = {...this.yasParams};
if (isFilter) {
param.TAB_ID = 4;
param.TAB_NAME = '筛选';
}
this.$store.dispatch('reportYas', {
params: {
param: {...this.yasParams},
param,
appop: 'XY_UFO_PRD_LIST_TAB_C'
}
});
... ...
... ... @@ -3,7 +3,7 @@
<form action="javascript:void(0)">
<div class="search-header middle">
<div class="search-img"></div>
<input class="search-input" type="search" v-model="query" placeholder="Search" @input="suggest" @focus="yasFocus"
<input class="search-input" type="search" v-model="query" placeholder="Search" @input="suggest"
@keyup.13="searchGoods"/>
<div class="search-clear" :class="query && 'search-clear-img'" @click="clear()"></div>
</div>
... ... @@ -11,7 +11,7 @@
<Scroll v-show="!query.length" :options="scrollOptions">
<div class="recent title middle" v-if="searchWord && searchWord.length">热门推荐</div>
<div class="content middle">
<div class="item" v-if="searchWord && searchWord.length" v-for="item of searchWord" @click="goSearch({query : item.search_word} ,2)">
<div class="item" v-if="searchWord && searchWord.length" v-for="(item, index) of searchWord" @click="goSearch({query : item.search_word} ,{type: 2, index})">
{{item.search_word}}
</div>
</div>
... ... @@ -20,12 +20,12 @@
<div class="search-clear search-clear-img" @click="clearLocalHistory()"></div>
</div>
<div class="content middle">
<div class="item" v-if="localHistory && localHistory.length" v-for="item of localHistory" @click="goSearch({query : item} ,1)">{{item}}
<div class="item" v-if="localHistory && localHistory.length" v-for="(item, index) of localHistory" @click="goSearch({query : item} ,{type: 1, index})">{{item}}
</div>
</div>
</Scroll>
<Scroll v-show="query.length" :options="scrollOptions" :data="searchSuggestList">
<div class="item-line middle" v-if="searchSuggestList.length" v-for="item of searchSuggestList" @click="goSearch({query : item.item} ,0)">
<div class="item-line middle" v-if="searchSuggestList.length" v-for="(item, index) of searchSuggestList" @click="goSearch({query : item.item} ,{type: 3, index})">
{{item.item}}
</div>
</Scroll>
... ... @@ -50,7 +50,8 @@ export default {
}
},
query: '',
localHistory: []
localHistory: [],
SEARCH_POS: 1
};
},
activated() {
... ... @@ -70,7 +71,7 @@ export default {
},
searchGoods: function() {
this.addLocalWord();
this.yasInput(0);
this.yasInput({type: 0, index: 0});
this.$router.push({
name: 'List',
query: {
... ... @@ -82,10 +83,10 @@ export default {
suggest: function() {
this.fetchSearchSuggest(this.query);
},
goSearch: function(parameters, type) {
goSearch: function(parameters, param) {
let query = parameters.query;
this.yasInput(type);
this.yasInput(param);
this.$router.push({
name: 'List',
query: {
... ... @@ -106,6 +107,11 @@ export default {
}
this.localHistory = localHistory;
},
beforeRouteEnter: function(to, from, next) {
if (from.name !== 'List') {
this.SEARCH_POS = 3;
}
},
addLocalWord: function() {
if (this.query) {
let localHistory = localStorage.getItem('@YohoUFOStore:searchHistory');
... ... @@ -121,23 +127,15 @@ export default {
}
}
},
yasFocus() {
this.$store.dispatch('reportYas', {
params: {
param: {SEARCH_POS: 3},
appop: 'XY_UFO_SEARCH_CLICK'
}
});
},
yasInput: function(type) {
yasInput: function(param) {
this.$store.dispatch('reportYas', {
params: {
param: {
SEARCH_POS: 3,
SEARCH_POS: this.SEARCH_POS,
KEYWORD: this.query,
POS_ID: type,
TYPE_ID: type,
FLR_INDEX: type,
POS_ID: param.type,
TYPE_ID: 1,
FLR_INDEX: param.index + 1,
},
appop: 'XY_UFO_HOME_KEYWORD_SEARCH_C'
}
... ...
... ... @@ -160,6 +160,9 @@ export default {
activated() {
this.isActive = true;
if (this.inputPrice) {
this.computePrice();
}
},
deactivated() {
this.isActive = false;
... ... @@ -316,10 +319,18 @@ export default {
this.showBuyDialog();
return;
}
if (!this.addressInfo) {
this.$createToast({
time: 1000,
type: 'txt',
txt: '请选择地址',
}).show();
return;
}
this.buyerPrePublish({
price: this.inputPrice,
storage_id: this.storageId,
address_id: this.addressInfo.address_id
address_id: this.addressInfo ? this.addressInfo.address_id : ''
})
.then((res) => {
if (res && res.code == 200) {
... ... @@ -333,7 +344,7 @@ export default {
this.buyerPublish({
price: this.inputPrice,
storage_id: this.storageId,
address_id: this.addressInfo.address_id,
address_id: this.addressInfo ? this.addressInfo.address_id : '',
time_limit_id: this.chooseDayId
}).then((res) => {
if (res && res.code == 200) {
... ... @@ -351,7 +362,7 @@ export default {
this.buyerCompute({
price: this.inputPrice,
storage_id: this.storageId,
address_id: this.addressInfo.address_id || ''
address_id: this.addressInfo ? this.addressInfo.address_id || '' : ''
});
},
... ...
... ... @@ -122,7 +122,7 @@
})();
}());
window.appBaseLogs = {events: [{}]};
window.appBaseLogs = {events: [{}], device: {ak: '', udid: ''}, status: [{av: '', udid: '', sid: ''}]};
}, 500);
</script>
... ...