first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
const app = getApp()
Page({
data: {
height: 0,
SearchKeyword: "",
showView: true,
searchList: [],
inputValue: '',
tagList: [
{ text: "小米" },
{ text: "华为" },
{ text: "16t" },
{ text: "11Pro" },
{ text: "锤子" },
{ text: "三星" }
]
},
onLoad: function () {
this.getSearch();
this.setData({
height: app.globalData.statusBarHeight
})
},
//显示,隐藏
onChangeShowState: function () {
this.setData({
showView: (!this.data.showView)
})
},
//获取input里的值
getitems: function (e) {
this.setData({
inputValue: e.detail.value
})
// this.getSearch(this.data.inputValue);
console.log(e.detail.value)
},
// getSear: function (data) {
// this.getitems()
// },
//上下联动
getitem: function(data) {
// var a = data.currentTarget.dataset.hi
// console.log(a)
this.setData({
SearchKeyword: "",
SearchKeyword: data.currentTarget.dataset.hi
})
this.getSearch(this.data.SearchKeyword);
console.log(this.data.SearchKeyword)
},
async getSearch(datas) {
console.log(datas)
var data = await global.$api.post({
url: "/home/search",
data: {
keyword: datas
}
});
console.log(data)
this.searchList = data;
data.result.forEach((val) => {
val.wares_info = val.wares_info.substring(0, 10) + '..';
val.wares_masterimg = JSON.parse(val.wares_masterimg)[0]
})
this.setData({
searchList: data.result
})
},
cliekss(){
this.getSearch(this.data.inputValue)
},
enterInfo(item) {
console.log("item: ", item.currentTarget.dataset.list.wares_id)
wx.navigateTo({
url: `/pages/info/info?id=${item.currentTarget.dataset.list.wares_id}`
})
}
});