Authored by 肖亚东

搜索以及跳转规则等修改 — review by 黄义

... ... @@ -8,6 +8,8 @@ Component({
},
methods: {
jumpByRule: function(event) {
this.triggerEvent('jumpByRule', event);
}
}
})
\ No newline at end of file
... ...
... ... @@ -8,6 +8,8 @@ Component({
},
methods: {
jumpByRule: function(event) {
this.triggerEvent('jumpByRule', event);
}
}
})
\ No newline at end of file
... ...
... ... @@ -166,15 +166,15 @@ Page({
var currentPage = pages[pages.length - 1]
var url = currentPage.route
let params = {
PAGE_NAME: this.data.current_page_name,
PAGE_PARAM: this.data.current_page_param,
FROM_PAGE_NAME: this.data.from_page_name,
FROM_PAGE_PARAM: this.data.from_page_param,
PV_ID: PV_ID,
PAGE_PATH: url,
};
logEvent(YB_PAGE_OPEN_L, params);
// let params = {
// PAGE_NAME: this.data.current_page_name,
// PAGE_PARAM: this.data.current_page_param,
// FROM_PAGE_NAME: this.data.from_page_name,
// FROM_PAGE_PARAM: this.data.from_page_param,
// PV_ID: PV_ID,
// PAGE_PATH: url,
// };
// logEvent(YB_PAGE_OPEN_L, params);
this.fetchBrandInfo();
this.fetchBanner();
... ... @@ -208,15 +208,15 @@ Page({
},
onPullDownRefresh: function() {
// 页面相关事件处理函数--监听用户下拉动作
var that = this
let params = {
PAGE_NAME: that.data.current_page_name,
PAGE_PARAM: that.data.current_page_param,
FROM_PAGE_NAME: that.data.from_page_name,
FROM_PAGE_PARAM: that.data.from_page_param,
PV_ID: PV_ID,
};
logEvent(YB_PAGE_OPEN_L, params);
// var that = this
// let params = {
// PAGE_NAME: that.data.current_page_name,
// PAGE_PARAM: that.data.current_page_param,
// FROM_PAGE_NAME: that.data.from_page_name,
// FROM_PAGE_PARAM: that.data.from_page_param,
// PV_ID: PV_ID,
// };
// logEvent(YB_PAGE_OPEN_L, params);
},
loadMore: function() {
... ...
... ... @@ -332,12 +332,12 @@ Page({
let shop_id = brandItem.shop_id;
if (shop_id) {
tt.navigateTo({
url: '../brandStore/brandStore?shop_id=' + shop_id + '&shop_name' + brandItem.brand_name + '&page_name=' + 'brands' + '&page_param=' + ''
url: '../goodsList/brandStore?shop_id=' + shop_id + '&shop_name' + brandItem.brand_name + '&page_name=' + 'brands' + '&page_param=' + ''
});
}else{
shop_id = brandItem.id;
tt.navigateTo({
url: '../brandStore/brand?brandId=' + shop_id + '&brandName=' + brandItem.brand_name + '&page_name=' + 'brands' + '&page_param=' + ''
url: '../goodsList/brand?brandId=' + shop_id + '&brandName=' + brandItem.brand_name + '&page_name=' + 'brands' + '&page_param=' + ''
});
}
... ... @@ -350,7 +350,7 @@ Page({
// F_INDEX,
// I_INDEX,
// BRD_CATE: this.data.currentBrandFliter,
// F_URL: '../brandStore/brandStore?shop_id=' + shop_id + '&shop_name' + brandItem.brand_name,
// F_URL: '../goodsList/brandStore?shop_id=' + shop_id + '&shop_name' + brandItem.brand_name,
// SHOP_ID: shop_id,
// };
// logEvent(YB_BRAND_FLR_C, params);
... ... @@ -358,17 +358,10 @@ Page({
handlerAlphaTap(e) {
console.log('====================================');
console.log(e);
console.log('====================================');
let ap = e.target.dataset.ap;
this.setData({ scrollToView: ap });
},
handlerMove() {
},
dismissSearchView(e) {
this.setData({ searching: false });
},
... ...
... ... @@ -450,9 +450,11 @@ Page({
jumpByRuleEvent(event) {
let url = event.detail.currentTarget.dataset.jump_rule;
console.log('==========jumpByRuleEvent===========');
console.log(event.detail);
console.log(url);
console.log('====================================');
router.goUrl(url);
},
... ...
... ... @@ -350,11 +350,6 @@ Page(extend({}, Actionsheet,{
let params = Object.assign({method: 'app.search.category.filter'},this.data.origin_param);
let storageKey = this.data.filterStorageKey;
let paramString = JSON.stringify(params);
console.log('====================================');
console.log(paramString);
console.log('../productListFilter/productListFilterPage?storageKey=' + storageKey + '&params=' + paramString);
console.log('====================================');
tt.navigateTo({
url: '../productListFilter/productListFilterPage?storageKey=' + storageKey + '&params=' + paramString
})
... ...
... ... @@ -29,9 +29,6 @@ Page({
onLoad: function (options) {
let key = options.storageKey;
console.log('====================================');
console.log(key);
console.log('====================================');
let start = options.index;
let that = this;
wx.getStorage({
... ...
... ... @@ -27,7 +27,9 @@ Page({
*/
onLoad: function (options) {
var params = options.params ? options.params : {};
params = JSON.parse(params);
if (params) {
params = JSON.parse(params);
}
var storageKey = options.storageKey ? options.storageKey : '';
this.setData({
storageKey,
... ... @@ -124,7 +126,9 @@ Page({
})
if(json.code&&json.code==200){
var filter = json.data.filter ? json.data.filter : [];
filter = that.praseFilterData(filter);
if (filter) {
filter = that.praseFilterData(filter);
}
that.setData({
filterData: filter
})
... ...
... ... @@ -328,6 +328,11 @@ Page(extend({}, Actionsheet,{
hotKeywordItemTapped: function(event) {
let keyword = event.currentTarget.dataset.keyword;
console.log('====================================');
console.log(event);
console.log(keyword);
console.log('====================================');
let newList = Object.assign(this.data.list, {currentPage: 0, pageCount: 0, total: 0, endReached: false,});
addSearchHistory(keyword);
... ... @@ -551,15 +556,21 @@ Page(extend({}, Actionsheet,{
updateProductList: function (event) {
let order = event.detail.order;
let param = {}
if (order !== undefined) {
if (typeof(order) !== 'undefined') {
param = {'order':order}
}
this.updateProductListWithFilterParam(param);
},
jumpToFilterPage: function () {
tt.navigateTo({
url: '../productListFilter/filter?storageKey=' + this.data.filterStorageKey + '&method=' + 'miniapp.search.fuzzy.filter' + '&query=' + this.data.keyword
let params = Object.assign({ method: 'miniapp.search.fuzzy.filter' }, this.data.keyword_param);
let storageKey = this.data.filterStorageKey;
let paramString = JSON.stringify(params);
console.log('====================================');
console.log(params);
console.log('====================================');
wx.navigateTo({
url: '../productListFilter/productListFilterPage?storageKey=' + storageKey + '&params=' + paramString
})
},
... ...
... ... @@ -8,6 +8,7 @@ const ACTION_TYPE = {
h5: 'go.h5',
productList: 'go.list',
brandStore: 'go.shop',
brand: 'go.brand'
}
const OPEN_BY_TYPE = {
... ... @@ -81,58 +82,17 @@ export default {
this.go('brandStore', yohobuy);
break;
}
case ACTION_TYPE.ufo: {
this.handleUFOJumpPage(yoho);
break;
}
default:
break;
}
},
handleUFOJumpPage(yoho) {
const params = yoho.params
switch(params.pagename) {
case OPEN_BY_TYPE.GO_LIST: {
console.log(yoho);
this.go(OPEN_BY_TYPE.GO_LIST, params);
break;
}
case OPEN_BY_TYPE.GO_HOME: {
this.go(OPEN_BY_TYPE.GO_HOME);
break;
}
case OPEN_BY_TYPE.GO_DETAIL: {
this.go(OPEN_BY_TYPE.GO_DETAIL, params);
break;
}
case OPEN_BY_TYPE.GO_ORDER_DETAIL: {
let userInfo = tt.getStorageSync('userInfo');
if (userInfo && userInfo.uid && userInfo.session_key) {
this.go('orderDetail', params);
} else {
this.go('nativeLogin');
case ACTION_TYPE.brand: {
let yohobuy = {
...yoho.params,
url: yoho.params.url,
action: yoho.action
}
this.go('brand', yohobuy);
break;
}
case OPEN_BY_TYPE.GO_ORDER_LIST: {
let userInfo = tt.getStorageSync('userInfo');
if (userInfo && userInfo.uid && userInfo.session_key) {
this.go(OPEN_BY_TYPE.GO_ORDER_LIST, params);
} else {
this.go('nativeLogin');
}
default:
break;
}
case OPEN_BY_TYPE.GO_YOLUCK: {
let userInfo = tt.getStorageSync('userInfo');
if (userInfo && userInfo.uid && userInfo.session_key) {
this.go('yoLuck', params);
} else {
this.go('nativeLogin');
}
}
break;
default: break;
}
}
}
... ...
... ... @@ -8,6 +8,9 @@ export default {
brandStore: {
path: '../brandStore/brandStore'
},
brand: {
path: '../brandStore/brand'
},
webview: {
path: '../webview/webview'
},
... ... @@ -17,4 +20,5 @@ export default {
statements: {
path: '../statements/statements'
}
}
... ...