You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
678 lines
69 KiB
678 lines
69 KiB
5 years ago
|
"use strict";
|
||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
|
});
|
||
|
};
|
||
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
||
|
function step(op) {
|
||
|
if (f) throw new TypeError("Generator is already executing.");
|
||
|
while (_) try {
|
||
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
||
|
switch (op[0]) {
|
||
|
case 0: case 1: t = op; break;
|
||
|
case 4: _.label++; return { value: op[1], done: false };
|
||
|
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||
|
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||
|
default:
|
||
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||
|
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||
|
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||
|
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||
|
if (t[2]) _.ops.pop();
|
||
|
_.trys.pop(); continue;
|
||
|
}
|
||
|
op = body.call(thisArg, _);
|
||
|
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||
|
}
|
||
|
};
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
var clerkOnline_1 = require("../../../../api/clerkOnline");
|
||
|
Page({
|
||
|
data: {
|
||
|
detailObj: {},
|
||
|
remarkObj: {
|
||
|
statementNum: 0,
|
||
|
commentsList: []
|
||
|
},
|
||
|
pageIndex: 1,
|
||
|
pageSize: 10,
|
||
|
remarkType: 'new',
|
||
|
topicId: '',
|
||
|
topList: [],
|
||
|
manageFlag: '',
|
||
|
TopFlag: '',
|
||
|
topType: '',
|
||
|
selfPublishFlag: '',
|
||
|
attitude: '',
|
||
|
userLike: '',
|
||
|
userDislike: '',
|
||
|
likesTotal: '',
|
||
|
opposeLTotal: '',
|
||
|
orderType: '0',
|
||
|
commentList: [],
|
||
|
commentUserLike: '',
|
||
|
commentUserDislike: "",
|
||
|
commentUlikesTotal: '',
|
||
|
commentUopposeLTotal: '',
|
||
|
commentAttitude: '',
|
||
|
commentId: '',
|
||
|
commentIndex: 0,
|
||
|
loadVisible: false,
|
||
|
loadType: 'more',
|
||
|
isShowDetailContent: false,
|
||
|
isShowDetailRemark: false,
|
||
|
commentListLength: 0,
|
||
|
isShow: false,
|
||
|
iscommentStatement: false,
|
||
|
remarkTypeLoading: false,
|
||
|
isBackOpenTopic: true,
|
||
|
},
|
||
|
onShow: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
this.setData({
|
||
|
isBackOpenTopic: wx.getStorageSync('isBackOpenTopic')
|
||
|
});
|
||
|
if (!this.data.isBackOpenTopic) {
|
||
|
return [2];
|
||
|
}
|
||
|
this.setData({
|
||
|
isShowDetailContent: false,
|
||
|
isShowDetailRemark: false,
|
||
|
topicId: wx.getStorageSync('topicId'),
|
||
|
isShow: false,
|
||
|
loadVisible: true,
|
||
|
loadType: 'more',
|
||
|
remarkTypeLoading: true
|
||
|
});
|
||
|
return [4, this.getTopicDetail()];
|
||
|
case 1:
|
||
|
_a.sent();
|
||
|
return [4, this.getCommentList()];
|
||
|
case 2:
|
||
|
_a.sent();
|
||
|
this.setData({
|
||
|
isShowDetailContent: true,
|
||
|
isShowDetailRemark: true,
|
||
|
remarkTypeLoading: false
|
||
|
});
|
||
|
return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
onHide: function () {
|
||
|
console.log('hide');
|
||
|
},
|
||
|
onLoad: function (options) {
|
||
|
wx.setStorageSync('topicId', options.id);
|
||
|
console.log('onLoad');
|
||
|
},
|
||
|
supportIssueOrProject: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
var obj, res;
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
if (!(this.data.userLike == '0' && this.data.userDislike == '0')) return [3, 2];
|
||
|
this.setData({
|
||
|
attitude: "0",
|
||
|
});
|
||
|
obj = {
|
||
|
topicId: this.data.topicId,
|
||
|
attitude: this.data.attitude
|
||
|
};
|
||
|
if (this.data.userLike == '0') {
|
||
|
this.setData({
|
||
|
'topList.likesTotal': this.data.likesTotal += 1,
|
||
|
'topList.userLike': '1',
|
||
|
userLike: '1'
|
||
|
});
|
||
|
}
|
||
|
return [4, clerkOnline_1.topicStatement(obj)];
|
||
|
case 1:
|
||
|
res = _a.sent();
|
||
|
console.log('赞', res);
|
||
|
return [3, 3];
|
||
|
case 2:
|
||
|
if (this.data.userLike == '1' || this.data.userDislike == '1') {
|
||
|
wx.showModal({
|
||
|
title: '',
|
||
|
content: '已表达过态度,不可以更改哦!',
|
||
|
showCancel: false,
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#3CC51F',
|
||
|
success: function (res) {
|
||
|
if (res.confirm) {
|
||
|
console.log('用户点击确定');
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
_a.label = 3;
|
||
|
case 3: return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
dispportIssueOrProject: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
var obj, res;
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
if (!(this.data.userLike == '0' && this.data.userDislike == '0')) return [3, 2];
|
||
|
this.setData({
|
||
|
attitude: "1",
|
||
|
});
|
||
|
obj = {
|
||
|
topicId: this.data.topicId,
|
||
|
attitude: this.data.attitude
|
||
|
};
|
||
|
if (this.data.userDislike == '0') {
|
||
|
this.setData({
|
||
|
'topList.opposeLTotal': this.data.opposeLTotal += 1,
|
||
|
'topList.userDislike': '1',
|
||
|
userDislike: '1'
|
||
|
});
|
||
|
}
|
||
|
return [4, clerkOnline_1.topicStatement(obj)];
|
||
|
case 1:
|
||
|
res = _a.sent();
|
||
|
console.log('赞', res);
|
||
|
return [3, 3];
|
||
|
case 2:
|
||
|
if (this.data.userLike == '1' || this.data.userDislike == '1') {
|
||
|
wx.showModal({
|
||
|
title: '',
|
||
|
content: '已表达过态度,不可以更改哦!',
|
||
|
showCancel: false,
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#3CC51F',
|
||
|
success: function (res) {
|
||
|
if (res.confirm) {
|
||
|
console.log('用户点击确定');
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
_a.label = 3;
|
||
|
case 3: return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
debounceSupportRemark: function (e) {
|
||
|
var _a;
|
||
|
var _this = this;
|
||
|
this.setData({
|
||
|
commentId: e.detail.commentId
|
||
|
});
|
||
|
this.data.commentList.forEach(function (element, index) {
|
||
|
if (e.detail.commentId == element.commentId) {
|
||
|
_this.setData({
|
||
|
commentUserLike: element.userLike,
|
||
|
commentUserDislike: element.userDislike,
|
||
|
commentUlikesTotal: parseInt(element.approveNum),
|
||
|
commentUopposeLTotal: element.opposeNum,
|
||
|
commentIndex: index
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
if (this.data.commentUserLike == '0' && this.data.commentUserDislike == '0') {
|
||
|
if (this.data.commentUserLike == '0') {
|
||
|
this.setData({
|
||
|
commentAttitude: '0',
|
||
|
});
|
||
|
console.log('commentAttitude', this.data.commentAttitude);
|
||
|
this.setData((_a = {},
|
||
|
_a["commentList[" + this.data.commentIndex + "].approveNum"] = this.data.commentUlikesTotal += 1,
|
||
|
_a["commentList[" + this.data.commentIndex + "].userLike"] = '1',
|
||
|
_a.commentUserLike = '1',
|
||
|
_a));
|
||
|
}
|
||
|
this.commentStatement();
|
||
|
}
|
||
|
else if (this.data.commentUserLike == '1' || this.data.commentUserDislike == '1') {
|
||
|
wx.showModal({
|
||
|
title: '',
|
||
|
content: '已表达过态度,不可以更改哦!',
|
||
|
showCancel: false,
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#3CC51F',
|
||
|
success: function (res) {
|
||
|
if (res.confirm) {
|
||
|
console.log('用户点击确定');
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
debounceDispportRemark: function (e) {
|
||
|
var _a;
|
||
|
var _this = this;
|
||
|
this.setData({
|
||
|
commentId: e.detail.commentId
|
||
|
});
|
||
|
this.data.commentList.forEach(function (element, index) {
|
||
|
if (e.detail.commentId == element.commentId) {
|
||
|
_this.setData({
|
||
|
commentUserLike: element.userLike,
|
||
|
commentUserDislike: element.userDislike,
|
||
|
commentUlikesTotal: parseInt(element.approveNum),
|
||
|
commentUopposeLTotal: parseInt(element.opposeNum),
|
||
|
commentIndex: index
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
if (this.data.commentUserLike == '0' && this.data.commentUserDislike == '0') {
|
||
|
this.setData({
|
||
|
commentAttitude: "1",
|
||
|
});
|
||
|
if (this.data.commentUserDislike == '0') {
|
||
|
this.setData((_a = {},
|
||
|
_a["commentList[" + this.data.commentIndex + "].opposeNum"] = this.data.commentUopposeLTotal += 1,
|
||
|
_a["commentList[" + this.data.commentIndex + "].userDislike"] = '1',
|
||
|
_a.commentUserDislike = '1',
|
||
|
_a));
|
||
|
}
|
||
|
this.commentStatement();
|
||
|
}
|
||
|
else if (this.data.commentUserLike == '1' || this.data.commentUserDislike == '1') {
|
||
|
wx.showModal({
|
||
|
title: '',
|
||
|
content: '已表达过态度,不可以更改哦!',
|
||
|
showCancel: false,
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#3CC51F',
|
||
|
success: function (res) {
|
||
|
if (res.confirm) {
|
||
|
console.log('用户点击确定');
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
changeRemarkType: function (e) {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
if (this.data.iscommentStatement) {
|
||
|
return [2, wx.showModal({
|
||
|
title: '',
|
||
|
content: '表态正在生成,请稍等切换',
|
||
|
showCancel: false,
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#3CC51F',
|
||
|
})];
|
||
|
}
|
||
|
this.setData({
|
||
|
remarkType: e.detail.type,
|
||
|
isShow: false,
|
||
|
loadVisible: true,
|
||
|
loadType: 'more',
|
||
|
remarkTypeLoading: true,
|
||
|
});
|
||
|
if (!(e.detail.type == "hot")) return [3, 2];
|
||
|
this.setData({
|
||
|
commentList: [],
|
||
|
pageIndex: 1,
|
||
|
orderType: '1',
|
||
|
});
|
||
|
return [4, this.getCommentList()];
|
||
|
case 1:
|
||
|
_a.sent();
|
||
|
this.setData({
|
||
|
remarkTypeLoading: false
|
||
|
});
|
||
|
return [3, 4];
|
||
|
case 2:
|
||
|
if (!(e.detail.type == "new")) return [3, 4];
|
||
|
this.setData({
|
||
|
commentList: [],
|
||
|
pageIndex: 1,
|
||
|
orderType: '0',
|
||
|
});
|
||
|
return [4, this.getCommentList()];
|
||
|
case 3:
|
||
|
_a.sent();
|
||
|
this.setData({
|
||
|
remarkTypeLoading: false
|
||
|
});
|
||
|
_a.label = 4;
|
||
|
case 4: return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
closeContent: function () {
|
||
|
var _this = this;
|
||
|
wx.showModal({
|
||
|
title: '确认要将本条内容关闭吗?',
|
||
|
content: '关闭后,在群内不显示话题内容,管理后台保留数据,可以查看',
|
||
|
showCancel: true,
|
||
|
cancelText: '取消',
|
||
|
cancelColor: '#000000',
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#04BCA0',
|
||
|
success: function (res) {
|
||
|
if (res.confirm) {
|
||
|
_this.closeTopic();
|
||
|
wx.showToast({
|
||
|
title: '关闭话题成功',
|
||
|
icon: 'success',
|
||
|
duration: 2000,
|
||
|
mask: true,
|
||
|
success: function (res) { }
|
||
|
});
|
||
|
wx.setStorageSync('isBackOpen', false);
|
||
|
wx.navigateTo({ url: '/subpages/clerkOnline/pages/myGroup/myGroup' });
|
||
|
}
|
||
|
else if (res.cancel) {
|
||
|
console.log('用户点击取消');
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
fixedTop: function () {
|
||
|
var _this = this;
|
||
|
if (this.data.TopFlag == '1') {
|
||
|
this.setData({
|
||
|
topType: '2'
|
||
|
});
|
||
|
wx.showModal({
|
||
|
title: '确认要将本条内容取消置顶吗?',
|
||
|
content: '取消置顶后,话题会按照发布时间排序需要在群内滑动查找内容',
|
||
|
showCancel: true,
|
||
|
cancelText: '取消',
|
||
|
cancelColor: '#000000',
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#04BCA0',
|
||
|
success: function (res) { return __awaiter(_this, void 0, void 0, function () {
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
if (!res.confirm) return [3, 2];
|
||
|
return [4, this.SetTopTopic()];
|
||
|
case 1:
|
||
|
_a.sent();
|
||
|
wx.showToast({
|
||
|
title: '取消置顶成功',
|
||
|
icon: 'success',
|
||
|
duration: 2000,
|
||
|
mask: true,
|
||
|
success: function (res) { }
|
||
|
});
|
||
|
this.setData({
|
||
|
TopFlag: '0'
|
||
|
});
|
||
|
wx.setStorageSync('isBackOpen', false);
|
||
|
return [3, 3];
|
||
|
case 2:
|
||
|
if (res.cancel) {
|
||
|
}
|
||
|
_a.label = 3;
|
||
|
case 3: return [2];
|
||
|
}
|
||
|
});
|
||
|
}); }
|
||
|
});
|
||
|
}
|
||
|
else if (this.data.TopFlag == '0') {
|
||
|
this.setData({
|
||
|
topType: '1'
|
||
|
});
|
||
|
wx.showModal({
|
||
|
title: '确认要将本条内容置顶吗?',
|
||
|
content: '置顶后,话题会被群成员优先看到查看内容',
|
||
|
showCancel: true,
|
||
|
cancelText: '取消',
|
||
|
cancelColor: '#000000',
|
||
|
confirmText: '确定',
|
||
|
confirmColor: '#04BCA0',
|
||
|
success: function (res) { return __awaiter(_this, void 0, void 0, function () {
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
if (!res.confirm) return [3, 2];
|
||
|
return [4, this.SetTopTopic()];
|
||
|
case 1:
|
||
|
_a.sent();
|
||
|
wx.showToast({
|
||
|
title: '置顶成功',
|
||
|
icon: 'success',
|
||
|
duration: 2000,
|
||
|
mask: true,
|
||
|
success: function (res) { }
|
||
|
});
|
||
|
this.setData({
|
||
|
TopFlag: '1'
|
||
|
});
|
||
|
wx.setStorageSync('isBackOpen', false);
|
||
|
return [3, 3];
|
||
|
case 2:
|
||
|
if (res.cancel) {
|
||
|
}
|
||
|
_a.label = 3;
|
||
|
case 3: return [2];
|
||
|
}
|
||
|
});
|
||
|
}); }
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
SetTopTopic: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
var obj, res;
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
obj = {
|
||
|
topicId: this.data.topicId,
|
||
|
topType: this.data.topType
|
||
|
};
|
||
|
return [4, clerkOnline_1.SetTopTopic(obj)];
|
||
|
case 1:
|
||
|
res = _a.sent();
|
||
|
return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
closeTopic: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
var res, _a;
|
||
|
return __generator(this, function (_b) {
|
||
|
switch (_b.label) {
|
||
|
case 0:
|
||
|
_b.trys.push([0, 2, , 3]);
|
||
|
return [4, clerkOnline_1.closeTopic(this.data.topicId)];
|
||
|
case 1:
|
||
|
res = _b.sent();
|
||
|
console.log('关闭', res);
|
||
|
return [3, 3];
|
||
|
case 2:
|
||
|
_a = _b.sent();
|
||
|
return [3, 3];
|
||
|
case 3: return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
replyRemark: function (e) {
|
||
|
wx.setStorageSync('isBackOpenTopic', false);
|
||
|
wx.navigateTo({
|
||
|
url: "/subpages/clerkOnline/pages/remarkOrReply/remarkOrReply?type=" + e.detail.type + "&topicId=" + e.detail.topicId + "&faCommentId=" + e.detail.commentId
|
||
|
});
|
||
|
},
|
||
|
commentsIndex: function (e) {
|
||
|
wx.setStorageSync('isBackOpenTopic', false);
|
||
|
console.log('e.currentTarget.dataset.topicid', e.currentTarget.dataset);
|
||
|
wx.navigateTo({
|
||
|
url: "/subpages/clerkOnline/pages/remarkOrReply/remarkOrReply?type=" + e.currentTarget.dataset.type + "&topicId=" + e.currentTarget.dataset.topicid
|
||
|
});
|
||
|
},
|
||
|
getTopicDetail: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
var res, _a;
|
||
|
return __generator(this, function (_b) {
|
||
|
switch (_b.label) {
|
||
|
case 0:
|
||
|
_b.trys.push([0, 2, , 3]);
|
||
|
return [4, clerkOnline_1.getTopicDetail(this.data.topicId)];
|
||
|
case 1:
|
||
|
res = _b.sent();
|
||
|
this.setData({
|
||
|
topList: res.data,
|
||
|
manageFlag: res.data.manageFlag,
|
||
|
selfPublishFlag: res.data.selfPublishFlag,
|
||
|
TopFlag: res.data.topFlag,
|
||
|
userLike: res.data.userLike,
|
||
|
userDislike: res.data.userDislike,
|
||
|
likesTotal: res.data.likesTotal - 0,
|
||
|
opposeLTotal: res.data.opposeLTotal - 0
|
||
|
});
|
||
|
console.log('res话题详情', res);
|
||
|
return [3, 3];
|
||
|
case 2:
|
||
|
_a = _b.sent();
|
||
|
return [3, 3];
|
||
|
case 3: return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
getCommentList: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
var obj, res, _a;
|
||
|
return __generator(this, function (_b) {
|
||
|
switch (_b.label) {
|
||
|
case 0:
|
||
|
this.setData({
|
||
|
loadVisible: true,
|
||
|
loadType: 'more',
|
||
|
isShow: false,
|
||
|
});
|
||
|
obj = {
|
||
|
pageIndex: this.data.pageIndex,
|
||
|
pageSize: this.data.pageSize,
|
||
|
topicId: this.data.topicId,
|
||
|
orderType: this.data.orderType
|
||
|
};
|
||
|
_b.label = 1;
|
||
|
case 1:
|
||
|
_b.trys.push([1, 3, , 4]);
|
||
|
return [4, clerkOnline_1.getCommentList(obj)];
|
||
|
case 2:
|
||
|
res = _b.sent();
|
||
|
if (this.data.pageIndex == 1) {
|
||
|
this.setData({
|
||
|
commentList: res.data,
|
||
|
commentListLength: res.data.length,
|
||
|
loadVisible: false,
|
||
|
});
|
||
|
}
|
||
|
else {
|
||
|
this.setData({
|
||
|
commentList: this.data.commentList.concat(res.data),
|
||
|
commentListLength: res.data.length,
|
||
|
loadVisible: false,
|
||
|
});
|
||
|
}
|
||
|
if (this.data.commentListLength < this.data.pageSize) {
|
||
|
console.log('6666666666666666666');
|
||
|
this.setData({
|
||
|
loadVisible: true,
|
||
|
loadType: 'none'
|
||
|
});
|
||
|
}
|
||
|
if (this.data.pageIndex == 1 && this.data.commentListLength == 0) {
|
||
|
this.setData({
|
||
|
isShow: true,
|
||
|
loadVisible: false,
|
||
|
});
|
||
|
}
|
||
|
return [3, 4];
|
||
|
case 3:
|
||
|
_a = _b.sent();
|
||
|
this.setData({
|
||
|
loadVisible: false
|
||
|
});
|
||
|
return [3, 4];
|
||
|
case 4: return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
commentStatement: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
var obj, res, _a;
|
||
|
return __generator(this, function (_b) {
|
||
|
switch (_b.label) {
|
||
|
case 0:
|
||
|
this.setData({
|
||
|
iscommentStatement: true
|
||
|
});
|
||
|
obj = {
|
||
|
attitude: this.data.commentAttitude,
|
||
|
topicId: this.data.topicId,
|
||
|
commentId: this.data.commentId
|
||
|
};
|
||
|
_b.label = 1;
|
||
|
case 1:
|
||
|
_b.trys.push([1, 3, , 4]);
|
||
|
return [4, clerkOnline_1.commentStatement(obj)];
|
||
|
case 2:
|
||
|
res = _b.sent();
|
||
|
this.setData({
|
||
|
iscommentStatement: false
|
||
|
});
|
||
|
return [3, 4];
|
||
|
case 3:
|
||
|
_a = _b.sent();
|
||
|
this.setData({
|
||
|
iscommentStatement: false
|
||
|
});
|
||
|
return [3, 4];
|
||
|
case 4: return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
onReachBottom: function () {
|
||
|
return __awaiter(this, void 0, void 0, function () {
|
||
|
return __generator(this, function (_a) {
|
||
|
switch (_a.label) {
|
||
|
case 0:
|
||
|
if (this.data.remarkTypeLoading) {
|
||
|
return [2];
|
||
|
}
|
||
|
if (this.data.commentListLength < this.data.pageSize) {
|
||
|
return [2];
|
||
|
}
|
||
|
this.setData({
|
||
|
pageIndex: ++this.data.pageIndex,
|
||
|
});
|
||
|
return [4, this.getCommentList()];
|
||
|
case 1:
|
||
|
_a.sent();
|
||
|
return [2];
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWNEZXRhaWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ0b3BpY0RldGFpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDJEQUF1STtBQUN2SSxJQUFJLENBQUM7SUFDSCxJQUFJLEVBQUU7UUFDSixTQUFTLEVBQUUsRUFBRTtRQUNiLFNBQVMsRUFBRTtZQUNULFlBQVksRUFBRSxDQUFDO1lBQ2YsWUFBWSxFQUFFLEVBQUU7U0FDakI7UUFDRCxTQUFTLEVBQUUsQ0FBQztRQUNaLFFBQVEsRUFBRSxFQUFFO1FBQ1osVUFBVSxFQUFFLEtBQUs7UUFDakIsT0FBTyxFQUFFLEVBQUU7UUFDWCxPQUFPLEVBQUUsRUFBRTtRQUNYLFVBQVUsRUFBRSxFQUFFO1FBQ2QsT0FBTyxFQUFFLEVBQUU7UUFDWCxPQUFPLEVBQUUsRUFBRTtRQUNYLGVBQWUsRUFBRSxFQUFFO1FBQ25CLFFBQVEsRUFBRSxFQUFFO1FBQ1osUUFBUSxFQUFFLEVBQUU7UUFDWixXQUFXLEVBQUUsRUFBRTtRQUNmLFVBQVUsRUFBRSxFQUFFO1FBQ2QsWUFBWSxFQUFFLEVBQUU7UUFDaEIsU0FBUyxFQUFFLEdBQUc7UUFDZCxXQUFXLEVBQUUsRUFBRTtRQUNmLGVBQWUsRUFBRSxFQUFFO1FBQ25CLGtCQUFrQixFQUFFLEVBQUU7UUFDdEI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