main.js
13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
global.webpackJsonp([11],{
/***/ 303:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _vue = __webpack_require__(1);
var _vue2 = _interopRequireDefault(_vue);
var _index = __webpack_require__(304);
var _index2 = _interopRequireDefault(_index);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var app = new _vue2.default(_index2.default);
app.$mount();
exports.default = {
config: {
navigationBarTitleText: '咨询律师'
}
};
/***/ }),
/***/ 304:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__ = __webpack_require__(306);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_572e940a_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__ = __webpack_require__(307);
var disposed = false
function injectStyle (ssrContext) {
if (disposed) return
__webpack_require__(305)
}
var normalizeComponent = __webpack_require__(0)
/* script */
/* template */
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-572e940a"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default.a,
__WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_572e940a_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__["a" /* default */],
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
Component.options.__file = "src\\pages\\questiondetail\\index.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-572e940a", Component.options)
} else {
hotAPI.reload("data-v-572e940a", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
/***/ }),
/***/ 305:
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/***/ 306:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _promise = __webpack_require__(12);
var _promise2 = _interopRequireDefault(_promise);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
exports.default = {
data: function data() {
return {
cwxid: '',
sysNewsId: '',
text: '',
sequence: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'],
lists: [],
imgfiles: [],
imgLoaded: [],
tags: [],
wx_name: '',
commiting: false
};
},
methods: {
hideImg: function hideImg(i) {
this.$set(this.imgLoaded, i, false);
},
previewImg: function previewImg(i) {
wx.previewImage({
urls: this.imgfiles,
current: this.imgfiles[i]
});
},
getLawyerPic: function getLawyerPic(liid) {
var _this = this;
return new _promise2.default(function (resolve) {
wx.request({
url: _this.rootUrl + '/law/lawyer/' + liid,
success: function success(res) {
resolve(res.data[0].pic_Name);
}
});
});
},
Timer: function Timer(orginIndex, key) {
var _this2 = this;
return new _promise2.default(function (resolve) {
console.log('timer');
setTimeout(function () {
if (_this2.lists[orginIndex][key]) resolve(_this2.lists[orginIndex][key]);else _this2.Timer(orginIndex, key).then(function (e) {
return resolve(e);
});
}, 50);
});
},
loadConversations: function loadConversations() {
var _this3 = this;
wx.request({
url: this.rootUrl + '/conwx/singleqalaw/' + this.cwxid,
data: { sysNewsId: this.sysNewsId },
success: function success(res) {
_this3.lists = res.data.lists;
console.log(res.data.lists);
_this3.imgfiles = res.data.pics.map(function (v) {
return _this3.rootAvatar + v.pic_Name;
});
_this3.imgLoaded = new Array(_this3.imgfiles.length).fill(true);
var map = {};
_this3.lists.forEach(function (v, i) {
if (map[v.liid]) {
_this3.Timer(map[v.liid], 'pic').then(function (pic) {
return _this3.$set(_this3.lists[i], 'pic', pic);
});
} else if (v.liid) {
map[v.liid] = i.toString();
_this3.getLawyerPic(v.liid).then(function (pic) {
return _this3.$set(_this3.lists[i], 'pic', pic);
});
}
v.consultant_Date = _this3.service.correctTime(v.consultant_Date, 'full');
if (v.replay_Date) v.replay_Date = _this3.service.correctTime(v.replay_Date, 'full');
});
console.log(_this3.lists[0].cate_Name);
try {
_this3.tags = _this3.lists[0].cate_Name.split(',');
} catch (e) {
_this3.tags = _this3.lists[0].cate_Name;
}
_this3.text = '';
_this3.wx_name = _this3.lists[0].wx_name;
_this3.commiting = false;
},
fail: function fail(res) {
console.log(res);
}
});
},
commit: function commit(e) {
var _this4 = this;
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'first';
if (this.commiting) {
return;
}
var inputs = this.service.filter(e.mp.detail.value);
if (!inputs.allowed) {
return;
} else {
inputs = inputs.obj;
}
if (!this.service.checkEmptyInput([inputs.text], ['回答内容'])) {
return;
}
if (!this.service.checkBadWords([inputs.text], ['回答内容'])) {
return;
}
if (type == 'first') {
wx.showModal({
title: '',
content: '确定要发布吗?',
success: function success(res) {
if (res.confirm) {
_this4.execCommit(e, inputs);
}
}
});
} else {
this.execCommit(e, inputs);
}
},
execCommit: function execCommit(e, inputs) {
var _this5 = this;
wx.showLoading({ title: '正在上传' });
this.commiting = true;
wx.request({
url: this.rootUrl + '/qa/replyqa',
method: 'POST',
header: { 'content-type': 'application/x-www-form-urlencoded' },
data: {
QAID: this.lists[this.lists.length - 1].qaid,
Consultant_Reply: inputs.text,
sessionID: wx.getStorageSync('sessionID')
},
success: function success(res) {
if (res.statusCode == '500') {
_this5.service.getUnionId(_this5.rootAvatar, _this5.rootUrl).then(function (res) {
console.log(res);
_this5.commiting = false;
_this5.commit(e, 'again');
});
} else {
if (res.data == 1) {
wx.showToast({ title: '发送成功' });
_this5.loadConversations();
} else {
wx.hideLoading();
wx.showToast({ title: '上传失败 请检查上传内容', icon: 'none' });
_this5.commiting = false;
}
}
},
fail: function fail(res) {
console.log(res);
wx.hideLoading();
wx.showToast({ title: '上传失败', icon: 'none' });
_this5.commiting = false;
}
});
}
},
onLoad: function onLoad() {
this.cwxid = this.$root.$mp.query.cwxid;
if (this.$root.$mp.query.sysNewsId !== null && this.$root.$mp.query.sysNewsId !== '' && this.$root.$mp.query.sysNewsId !== undefined) {
this.sysNewsId = this.$root.$mp.query.sysNewsId;
}
this.loadConversations();
},
onUnload: function onUnload() {
this.cwxid = '';
this.sysNewsId = '';
this.text = '';
this.lists = [];
this.imgfiles = [];
this.imgLoaded = [];
this.tags = [];
this.wx_name = '';
}
};
/***/ }),
/***/ 307:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return (_vm.lists[0]) ? _c('div', {
staticClass: "questiondetail"
}, [_c('div', {
staticClass: "head-title"
}, [_vm._v("\n " + _vm._s(_vm.lists[0] ? _vm.lists[0].consultant_Title : '') + "\n "), (_vm.imgfiles.length > 0) ? _c('div', {
staticClass: "img-box",
staticStyle: {
"padding-top": "20rpx"
}
}, _vm._l((_vm.imgfiles), function(item, i) {
return _c('img', {
key: i,
attrs: {
"src": _vm.imgLoaded[i] ? item : '/static/imgs/img.png',
"mode": "aspectFill",
"eventid": '0-' + i
},
on: {
"tap": function($event) {
_vm.previewImg(i)
},
"error": function($event) {
_vm.hideImg(i)
}
}
})
})) : _vm._e(), _vm._v(" "), _c('div', {
staticClass: "foot"
}, [_c('span', [_vm._v("咨询者:" + _vm._s(_vm.wx_name))]), _vm._v(" "), _vm._l((_vm.tags), function(tag, j) {
return _c('div', {
key: j,
staticClass: "tags"
}, [_vm._v(_vm._s(tag ? tag : ''))])
})], 2)]), _vm._v(" "), _vm._l((_vm.lists), function(item, i) {
return _c('div', {
key: i,
staticClass: "list-item"
}, [_c('div', {
staticClass: "para-title"
}, [_c('div'), _vm._v(_vm._s('第' + _vm.sequence[i] + '次提问'))]), _vm._v(" "), _c('div', {
staticClass: "text",
staticStyle: {
"margin-top": "25rpx"
}
}, [_vm._v(_vm._s(item.consultant_Content))]), _vm._v(" "), _c('div', {
staticClass: "time"
}, [_vm._v(_vm._s(item.consultant_Date))]), _vm._v(" "), (item.is_Replay == 1) ? _c('div', [_c('div', {
staticClass: "head"
}, [_c('img', {
staticClass: "photo",
attrs: {
"src": _vm.rootAvatar + item.pic,
"mode": "aspectFill"
}
}), _vm._v(_vm._s(item.name) + "律师的回答\n ")]), _vm._v(" "), _c('div', {
staticClass: "text",
staticStyle: {
"margin-bottom": "25rpx"
}
}, [_vm._v(_vm._s(item.consultant_Reply))]), _vm._v(" "), _c('div', {
staticClass: "time"
}, [_vm._v(_vm._s(item.replay_Date))])]) : _vm._e(), _vm._v(" "), (i + 1 == _vm.lists.length && item.is_Replay != 1) ? _c('form', {
attrs: {
"eventid": '2-' + i
},
on: {
"submit": _vm.commit
}
}, [_c('div', {
staticClass: "textarea"
}, [_c('textarea', {
attrs: {
"placeholder": "请输入您要回答的内容",
"name": "text",
"value": _vm.text,
"maxlength": "10000",
"eventid": '1-' + i
},
on: {
"input": function($event) {
_vm.text = _vm.service.Input($event)
}
}
}), _vm._v(" "), _c('div', [_vm._v(_vm._s(_vm.text.length) + "/10000")])]), _vm._v(" "), _c('div', {
staticClass: "commit"
}, [_c('button', {
attrs: {
"form-type": "submit",
"hover-class": "fade",
"disabled": _vm.commiting
}
}, [_vm._v("提交")])], 1)]) : _vm._e()], 1)
})], 2) : _c('div', {
staticClass: "LoadingMask"
}, [_c('img', {
attrs: {
"src": "/static/imgs/loading.png"
}
})])
}
var staticRenderFns = []
render._withStripped = true
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ __webpack_exports__["a"] = (esExports);
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-572e940a", esExports)
}
}
/***/ })
},[303]);
//# sourceMappingURL=main.js.map