小程序搜索框

搜索框
wxml
在这里插入图片描述
wxss

/* pages/tab/research/index.wxss */
page{
}
.research {
width: 100%;
height: 60rpx;
border-radius: 50rpx;
}

.content {
margin-top: 20rpx;
width: 90%;
margin-left: 5%;
}

.item {
width: 140rpx;
height: 60rpx;
color: #b1b1b1;
line-height: 60rpx;
margin-right: 30rpx;
background:white;
border:1rpx solid #eee;
margin-top: 15px;
box-sizing: border-box;
float: left;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}

.hop-research {
margin-top: 40rpx;
}

/* 修 */

.mar {
width: 80%;
height: 100%;
background: #eee;
}

.icon {
margin-left: 8px;
width: 50rpx;
height: 100%;
float: left;
}

.sou {
margin-left: 20rpx;
color: #fdb52e;
}
.title_One{
border-bottom:1rpx solid #eee;
padding-bottom:20rpx;
box-sizing:border-box;
}
.f{
border-bottom:1rpx solid #eee;
box-sizing:border-box;
}
.go{
width:25%;
border:1rpx solid #bbb;
text-align:center;
float:left;
margin:10rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.iconfont{
font-size: 50rpx;
}

js

// pages/tab/research/index.js
const app = getApp();
Page({

/**

  • 页面的初始数据
    */
    data: {
    statusBarHeight: app.globalData.statusBarHeight,
    recordList:[],
    inputVal:’’
    },
    // 返回上一页面
    goBack() {
    wx.navigateBack({
})

},
confirm(e){
wx.navigateTo({
url: ‘/pages/tab/research/bargainList/index?keyword=’+e.detail.value,
})
e.detail.value=’’;
},
bindKeyInput: function(e){
console.log(e);
this.setData({
inputVal:e.detail.value
})
},
conf(){
wx.navigateTo({
url: ‘/pages/tab/research/bargainList/index?keyword=’ + this.data.inputVal,
})
this.data.inputVal = ‘’;
},
goResearch(e){
const that=this;
console.log(e.currentTarget.id)
wx.navigateTo({
url: ‘/pages/tab/research/bargainList/index?keyword=’ + e.currentTarget.id,
})
},
getRecord(){
app.KaTeX parse error: Expected 'EOF', got '}' at position 199: …age); }) }̲, deleteRecor…api.request({
path: ‘index/deleteRecord’,
data: { ids: ids }
}).then(({ code,data }) => {
if(code==200){
that.setData({
recordList: []
})
}
}).catch(({ message }) => {
app.message(message);
})
}
}
})
},
/**

  • 生命周期函数–监听页面加载
    */
    onLoad: function (options) {

},
/**

  • 生命周期函数–监听页面初次渲染完成
    */
    onReady: function () {

},

/**

  • 生命周期函数–监听页面显示
    */
    onShow: function () {
    this.getRecord();
    },

/**

  • 生命周期函数–监听页面隐藏
    */
    onHide: function () {

},

/**

  • 生命周期函数–监听页面卸载
    */
    onUnload: function () {

},

/**

  • 页面相关事件处理函数–监听用户下拉动作
    */
    onPullDownRefresh: function () {

},

/**

  • 页面上拉触底事件的处理函数
    */
    onReachBottom: function () {

},

/**

  • 用户点击右上角分享
    */
    onShareAppMessage: function () {

}
})

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值