chache/pages/home/liuyan/liuyan.js
2024-01-22 18:48:00 +08:00

82 lines
2.3 KiB
JavaScript

var t;
(t = getApp()),
Page({
data: {
leftid: 1,
check_name: "",
carList: [],
show: !0,
name: "",
title: "暂无留言内容",
},
onLoad: function (t) {
this._list();
},
_list: function () {
var a = this;
console.log(wx.getStorageSync("uid")),
t.util.request({
url: "entry/wxapp/Api",
data: {
m: "monai_market",
r: "home.index.wordList",
car_uid: wx.getStorageSync("uid"),
leftid: this.data.leftid++,
},
cachetime: "0",
success: function (t) {
if ((console.log(t.data), t.data.data.length > 0)) {
var i;
(i = a.data.carList).push.apply(
i,
(function (t) {
if (Array.isArray(t)) {
for (var a = 0, i = Array(t.length); a < t.length; a++)
i[a] = t[a];
return i;
}
return Array.from(t);
})(t.data.data)
);
var r = !0,
e = !1,
n = void 0;
try {
for (
var s, o = a.data.carList[Symbol.iterator]();
!(r = (s = o.next()).done);
r = !0
) {
var c = s.value,
d = (28 * c.content.length) / 588;
d < 3 ? (c.length = 2) : d > 3 && (c.length = 3);
}
} catch (t) {
(e = !0), (n = t);
} finally {
try {
!r && o.return && o.return();
} finally {
if (e) throw n;
}
}
a.setData({ carList: a.data.carList });
} else a.data.show = !1;
},
});
},
onReachBottom: function () {
this.data.show && this._list();
},
clone: function (a) {
var i = t.getAttr(a, "index");
(this.data.carList[i].length = 3),
this.setData({ carList: this.data.carList });
},
open: function (a) {
var i = t.getAttr(a, "index");
(this.data.carList[i].length = 4),
this.setData({ carList: this.data.carList });
},
});