main.js
13.2 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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
global.webpackJsonp([9],{
/***/ 313:
/***/ (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__(314);
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: '讲座汇报'
}
};
/***/ }),
/***/ 314:
/***/ (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__(316);
/* 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_7b308fc6_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__(317);
var disposed = false
function injectStyle (ssrContext) {
if (disposed) return
__webpack_require__(315)
}
var normalizeComponent = __webpack_require__(0)
/* script */
/* template */
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-7b308fc6"
/* 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_7b308fc6_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\\releaselecture\\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-7b308fc6", Component.options)
} else {
hotAPI.reload("data-v-7b308fc6", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
/***/ }),
/***/ 315:
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/***/ 316:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
exports.default = {
data: function data() {
return {
street: {
columnOne: [],
index: 0,
arrStruct: [],
label: '点击选择街道'
},
community: {
columnOne: [],
index: 0,
arrStruct: [],
label: '点击选择社区'
},
name: '',
content: '',
date: '',
time: '',
commiting: false
};
},
methods: {
commit: function commit(e) {
var _this = this;
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'first';
if (this.commiting) {
return;
}
console.log(e);
var inputs = this.service.filter(e.mp.detail.value);
if (!inputs.allowed) {
return;
} else {
inputs = inputs.obj;
}
var street = this.street.label.replace('点击选择街道', '');
var community = this.community.label.replace('点击选择社区', '');
if (!this.service.checkEmptyInput([inputs.name, street, community, this.date, this.time, inputs.content], ['讲座标题', '街道', '社区', '讲座日期', '讲座时间', '讲座内容'])) {
return;
}
if (!this.service.checkBadWords([inputs.name, inputs.content], ['标题', '内容'])) {
return;
}
if (type == 'first') {
wx.showModal({
title: '',
content: '确定要发布吗?',
success: function success(res) {
if (res.confirm) {
_this.execCommit(e, inputs);
}
}
});
} else {
this.execCommit(e, inputs);
}
},
execCommit: function execCommit(e, inputs) {
var _this2 = this;
wx.showLoading({ title: '正在上传' });
this.commiting = true;
wx.request({
url: this.rootUrl + '/lecture/addlect',
header: { 'content-type': 'application/x-www-form-urlencoded' },
method: 'POST',
data: {
scid: this.community.arrStruct[this.community.index].value,
sessionID: wx.getStorageSync('sessionID'),
lecture_title: inputs.name,
lecture_content: inputs.content,
lecture_date: this.date + ' ' + this.time + ':00'
},
success: function success(res) {
if (res.statusCode == '500') {
console.log('eeee');
_this2.service.getUnionId(_this2.rootAvatar, _this2.rootUrl).then(function (res) {
console.log(res);
_this2.commiting = false;
_this2.commit(e, 'again');
});
} else {
console.log(res);
if (res.data === 1) {
wx.hideLoading();
wx.showModal({
title: '发布成功',
content: '请在我的讲座中查看',
showCancel: false,
success: function success(res) {
if (res.confirm) {
_this2.name = '';
_this2.date = '';
_this2.time = '';
_this2.content = '';
_this2.$set(_this2.street, 'index', 0);
_this2.$set(_this2.street, 'label', '点击选择街道');
_this2.$set(_this2.community, 'label', '点击选择社区');
_this2.commiting = false;
}
}
});
} else {
wx.hideLoading();
wx.showToast({ title: '上传失败 请检查上传内容', icon: 'none' });
_this2.commiting = false;
}
}
},
fail: function fail(res) {
wx.hideLoading();
wx.showToast({ title: '上传失败', icon: 'none' });
_this2.commiting = false;
}
});
},
warning: function warning() {
if (this.street.label == '点击选择街道') {
wx.showToast({
title: '请先选择街道',
icon: 'none'
});
}
},
pickerConfirm: function pickerConfirm(e, s) {
switch (s) {
case 'time':
this.time = e.mp.detail.value;break;
case 'date':
this.date = e.mp.detail.value;break;
case 'street':
{
var oldLabel = this.street.label;
this.street.index = e.mp.detail.value;
this.street.label = this.street.columnOne[this.street.index];
if (oldLabel != this.street.label) {
this.getCommunity();
}
break;
}
case 'community':
{
this.community.index = e.mp.detail.value;
this.community.label = this.community.columnOne[this.community.index];
break;
}
}
},
getCommunity: function getCommunity() {
var _this3 = this;
wx.showLoading({ title: '加载社区列表' });
wx.request({
url: this.rootUrl + '/comm/getbyid/' + this.street.arrStruct[this.street.index].value,
success: function success(res) {
_this3.community.columnOne = res.data.map(function (v) {
return v.comm_Name;
});
_this3.community.arrStruct = res.data.map(function (v) {
return { label: v.comm_Name, value: v.scid };
});
_this3.community.index = 0;
_this3.community.label = _this3.community.columnOne[0];
wx.hideLoading();
}
});
}
},
onLoad: function onLoad() {
var _this4 = this;
wx.request({
url: this.rootUrl + '/street/all',
success: function success(res) {
_this4.street.columnOne = res.data.map(function (v) {
return v.street_Name;
});
_this4.street.arrStruct = res.data.map(function (v) {
return { label: v.street_Name, value: v.ssid };
});
}
});
}
};
/***/ }),
/***/ 317:
/***/ (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 _c('div', {
staticClass: "baseinfo"
}, [_c('form', {
staticClass: "baseinfo-box",
attrs: {
"eventid": '6'
},
on: {
"submit": _vm.commit
}
}, [_c('div', {
staticClass: "list-input"
}, [_c('span', [_vm._v("讲座标题")]), _vm._v(" "), _c('input', {
attrs: {
"placeholder": "请输入讲座标题",
"name": "name",
"value": _vm.name,
"placeholder-style": "color:#9B9B9B",
"eventid": '0'
},
on: {
"input": function($event) {
_vm.name = _vm.service.Input($event)
}
}
})]), _vm._v(" "), _c('div', {
staticClass: "list-input between"
}, [_c('span', [_vm._v("讲座街道")]), _vm._v(" "), _c('picker', {
attrs: {
"value": _vm.street.index,
"range": _vm.street.columnOne,
"eventid": '1'
},
on: {
"change": function($event) {
_vm.pickerConfirm($event, 'street')
}
}
}, [_c('div', {
attrs: {
"hover-class": "hover"
}
}, [_vm._v(_vm._s(_vm.street.label))])])], 1), _vm._v(" "), _c('div', {
staticClass: "list-input between"
}, [_c('span', [_vm._v("讲座社区")]), _vm._v(" "), _c('picker', {
attrs: {
"disabled": _vm.street.label == '点击选择街道',
"value": _vm.community.index,
"range": _vm.community.columnOne,
"eventid": '2'
},
on: {
"tap": _vm.warning,
"change": function($event) {
_vm.pickerConfirm($event, 'community')
}
}
}, [_c('div', {
attrs: {
"hover-class": "hover"
}
}, [_vm._v(_vm._s(_vm.community.label))])])], 1), _vm._v(" "), _c('div', {
staticClass: "list-input between"
}, [_c('span', [_vm._v("讲座日期")]), _vm._v(" "), _c('picker', {
attrs: {
"mode": "date",
"value": _vm.date,
"eventid": '3'
},
on: {
"change": function($event) {
_vm.pickerConfirm($event, 'date')
}
}
}, [_c('div', {
class: {
unset: _vm.date == ''
},
attrs: {
"hover-class": "hover"
}
}, [_vm._v(_vm._s(_vm.date || '点击选择'))])])], 1), _vm._v(" "), _c('div', {
staticClass: "list-input between"
}, [_c('span', [_vm._v("讲座时间")]), _vm._v(" "), _c('picker', {
attrs: {
"mode": "time",
"value": _vm.time,
"eventid": '4'
},
on: {
"change": function($event) {
_vm.pickerConfirm($event, 'time')
}
}
}, [_c('div', {
class: {
unset: _vm.time == ''
},
attrs: {
"hover-class": "hover"
}
}, [_vm._v(_vm._s(_vm.time || '点击选择'))])])], 1), _vm._v(" "), _c('div', {
staticClass: "greytitle"
}, [_vm._v("讲座内容")]), _vm._v(" "), _c('div', {
staticClass: "textarea"
}, [_c('textarea', {
attrs: {
"placeholder": "请输入讲座内容",
"name": "content",
"value": _vm.content,
"maxlength": "10000",
"eventid": '5'
},
on: {
"input": function($event) {
_vm.content = _vm.service.Input($event)
}
}
}), _vm._v(" "), _c('div', [_vm._v(_vm._s(_vm.content.length) + "/10000")])]), _vm._v(" "), _c('div', {
staticClass: "commit"
}, [_c('button', {
attrs: {
"form-type": "submit",
"hover-class": "fade",
"disabled": _vm.commiting
}
}, [_vm._v("提交")])], 1)])], 1)
}
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-7b308fc6", esExports)
}
}
/***/ })
},[313]);
//# sourceMappingURL=main.js.map