123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- // pages/zclb/zclb.js
- import {
- voPage
- } from "../../../pages/api/gzw-api"
- import {
- js_date_time
- } from "../../../utils/util"
- import {
- imgUrl
- } from "../../../pages/api/request"
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- imgUrl,
- index: 1,
- totalPage: 0,
- visible: false,
- rentOut: [],
- gzwImgUrl: "http://219.152.50.209:81/api",
- type: 1,
- date: new Date().getTime(), // 支持时间戳传入
- dateText: '',
- start: '2017-01-01 00:00:00',
- end: '2047-12-30 00:00:00',
- // dateVisible:
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- let type = options.type
- if (type == 1) {
- wx.setNavigationBarTitle({
- title: '资产租赁'
- })
- } else {
- wx.setNavigationBarTitle({
- title: '资产处置'
- })
- }
- this.setData({
- type
- })
- let param = {
- displayState: 2,
- page: 1,
- size: 10,
- publishTimeSort: 1,
- type: this.data.type
- }
- this.loadData(param);
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- },
- show() {
- this.setData({
- visible: !this.data.visible
- })
- },
- onVisibleChange(e) {
- this.setData({
- visible: e.detail.visible,
- });
- },
- gotoInfo(e) {
- console.log(e);
- wx.navigateTo({
- url: '/pagesPublic/pages/zcinfo/zcinfo?id=' + e.currentTarget.dataset.id,
- })
- },
- loadData(param) {
- voPage(param).then(res => {
- if (res.success) {
- if (res.data.size > 0) {
- let records = res.data.records
- for (let i = 0; i < records.length; i++) {
- const element = records[i];
- const photoUrl = element.photoUrl.split(",")
- records[i].photoUrl = photoUrl;
- records[i].reviewTime = js_date_time(element.reviewTime);
- }
- console.log(records);
- let a = this.data.rentOut
- let b = [].concat(a, records)
- console.log(res.data.pages);
- this.setData({
- rentOut: [].concat(a, records),
- totalPage: res.data.pages
- })
- }
- }
- })
- },
- more() {
- this.setData({
- index: this.data.index + 1
- })
- let param = {
- displayState: 2,
- page: this.data.index,
- size: 10,
- publishTimeSort: 1,
- type: this.data.type
- }
- this.loadData(param)
- },
- onConfirm(e) {
- const { value } = e.detail;
-
- // console.log('confirm', value);
- // let a = new Date(value).getTime()
- // console.log(a);
- this.setData({
- index: 1,
- totalPage:0,
- rentOut:[]
- })
- let param = {
- displayState: 2,
- page: this.data.index,
- size: 10,
- publishTime:value,
- publishTimeSort: 1,
- type: this.data.type
- }
- this.loadData(param)
- this.show();
- }
- })
|