You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

78 lines
1.5 KiB

// pages/component/TitleHeader.js
import commonApi from "../../../utils/https/common.js"
import util from '../../../utils/util'
var app = getApp()
Component({
options: {
styleIsolation: 'apply-shared',
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
title: {
type: String,
value: ""
},
transparent: {
type: String,
value: "0"
},
clickid: {
type: String,
value: ""
}
},
lifetimes: {
created() {
commonApi._post("product/get_product_by_type", {
offset: 0,
limit: 6,
rand: true,
type: "venue,post,line,ticket"
}).then(res => {
this.setData({
showLoading: false
})
try {
this.setData({
tjList: res.data.list
})
} catch (error) {
console.log(error);
}
})
}
},
/**
* 组件的初始数据
*/
data: {
tjList: [],
},
/**
* 组件的方法列表
*/
methods: {
gotoDetail: function (e) {
let item = e.currentTarget.dataset.item;
util.pagePoint({
event: 'recommend_click',
param: {
id: item.id,
type: item.type
}
}, 1)
if (item.type == 'travels') {
// 游记做特殊处理 其他都按照原来的来
wx.navigateTo({
url: '/pages/info/strategyInfo/index?id=' + item.s_id,
})
} else {
util.gotoDetail(item);
}
},
}
})