ok
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
// pages/list/list.js
|
||||
|
||||
const request = require('../../utils/request')
|
||||
const ui = require('../../utils/ui')
|
||||
Page({
|
||||
|
||||
/**
|
||||
@@ -6,15 +9,25 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
searchName : "",
|
||||
title:"搜索",
|
||||
total_count: 0,
|
||||
total_pages: 0,
|
||||
has_next: false,
|
||||
has_next: false,
|
||||
current_page: 1,
|
||||
list: [],
|
||||
|
||||
scrollHeight:0
|
||||
},
|
||||
|
||||
|
||||
jumpPage(e) {
|
||||
let jumpType = e.currentTarget.dataset.jumptype;
|
||||
let aid = e.currentTarget.dataset.aid;
|
||||
console.log(jumpType == 2);
|
||||
if (jumpType == 2) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/details/details?id=1"
|
||||
url: "/pages/details/details?aid=" +aid
|
||||
})
|
||||
}
|
||||
// wx.navigateTo({
|
||||
@@ -23,13 +36,78 @@ Page({
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
GetList() {
|
||||
let that = this;
|
||||
request.request({
|
||||
method: "GET",
|
||||
url: "/api.php/doc/list?keyword=" + that.data.searchName + "&pageSize=16&page=" + that.data.current_page
|
||||
}).then(res => {
|
||||
if (res.data.code === 1) {
|
||||
that.setData({
|
||||
list: that.data.list.concat(res.data.data.data),
|
||||
current_page: res.data.data.current_page,
|
||||
has_next: res.data.data.has_next,
|
||||
has_prev: res.data.data.has_prev,
|
||||
total_count: res.data.data.total_count,
|
||||
total_pages: res.data.data.total_pages,
|
||||
})
|
||||
}
|
||||
// ui.showToast(res.data.errorMsg)
|
||||
}).catch(err => {
|
||||
console.log('ERROR')
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置列表高度
|
||||
*/
|
||||
setListHeight: function () {
|
||||
let that = this;
|
||||
const windowInfo = wx.getWindowInfo()
|
||||
that.setData({
|
||||
scrollHeight: windowInfo.windowHeight - 90,
|
||||
});
|
||||
// wx.getSystemInfo({
|
||||
// success: function (res) {
|
||||
// that.setData({
|
||||
// scrollHeight: res.windowHeight - 90,
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 下拉到底加载数据
|
||||
*/
|
||||
bindDownLoad() {
|
||||
let that = this;
|
||||
// 已经是最后一页
|
||||
if (that.data.has_next) {
|
||||
that.setData({
|
||||
current_page: that.data.current_page + 1
|
||||
});
|
||||
this.GetList();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let that = this;
|
||||
if (!options.search) {
|
||||
wx.navigateBack()
|
||||
this.triggerEvent('onBack')
|
||||
}
|
||||
console.log(options);
|
||||
that.setData({searchName:options.search})
|
||||
that.setListHeight()
|
||||
that.GetList()
|
||||
// that.data.searchName = options.search;
|
||||
// if (that.sea)
|
||||
// console.log(options);
|
||||
|
||||
@@ -1,22 +1,7 @@
|
||||
<!-- <list-nav-bar title="Weixin" back="{{false}}" color="black" background="#3c8bf6"></list-nav-bar> -->
|
||||
<!-- <navigation-bar title="Weixin" back="{{false}}" color="black" background="#3c8bf6"></navigation-bar> -->
|
||||
|
||||
<list-nav-bar title="WeixinWeixinWeixin" background="#3c8bf6" showNavBtn="{{true}}"></list-nav-bar>
|
||||
|
||||
|
||||
<!-- <view class="index-search-box dis-flex">
|
||||
|
||||
<view class="index-cont-search">
|
||||
<icon class="text-center" color="rgba(0,0,0,0.4)" size="15" type="search"></icon>
|
||||
<text>搜索商品</text>
|
||||
</view>
|
||||
</navigator>
|
||||
<view bindtap="onChangeShowState" class="list-right f-28">
|
||||
<text class="iconfont icon-tubiao_kuaizhuangpailie" wx:if="{{showView}}"></text>
|
||||
<text class="iconfont icon-tubiao_liebiaopailie" wx:else></text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<list-nav-bar title="{{title}}" background="#3c8bf6" showNavBtn="{{true}}"></list-nav-bar>
|
||||
|
||||
<view class="search-box">
|
||||
<navigator hover-class="none" openType="navigateBack" url="../search/index">
|
||||
@@ -30,149 +15,20 @@
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<scroll-view style="height: 100%;overflow:hidden;" scroll-y type="list">
|
||||
<scroll-view bindscrolltolower="bindDownLoad" style="height: {{scrollHeight}}px;overflow:hidden;" scroll-y type="list">
|
||||
<view class="container">
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
<block wx:for="{{list}}" wx:for-index="index" wx:for-item="itemArt">
|
||||
<view class="card" bind:tap="jumpPage" data-aid="{{itemArt.id}}" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">{{itemArt.title}}</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card" bind:tap="jumpPage" data-jumpType="2">
|
||||
<view class="card-header">
|
||||
<view class="dot"></view>
|
||||
<text class="title">超出焊接时间</text>
|
||||
</view>
|
||||
<view class="details">
|
||||
<!-- 查看详情 -->
|
||||
<text class="group-item-header-tip-txt">查看详情</text>
|
||||
<image class="details-icon" src="../../images/jt.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
Reference in New Issue
Block a user