global.webpackJsonp([10],{ /***/ 308: /***/ (function(module, exports, __webpack_require__) { "use strict"; var _vue = __webpack_require__(1); var _vue2 = _interopRequireDefault(_vue); var _index = __webpack_require__(309); var _index2 = _interopRequireDefault(_index); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var app = new _vue2.default(_index2.default); app.$mount(); /***/ }), /***/ 309: /***/ (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__(311); /* 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_0c1c7d16_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__(312); var disposed = false function injectStyle (ssrContext) { if (disposed) return __webpack_require__(310) } var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-0c1c7d16" /* 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_0c1c7d16_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\\releaseArticle\\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-0c1c7d16", Component.options) } else { hotAPI.reload("data-v-0c1c7d16", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 310: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ 311: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // exports.default = { data: function data() { return { sort: ['婚姻家庭', '交通事故', '刑事辩护', '劳动工伤', '房产纠纷', '债权债务', '合同事务', '医疗纠纷', '知识产权', '损害赔偿', '征地拆迁', '其它'], selectedTags: [], styleTags: [], imgs: ['', '', '', '', '', '', '', '', '', '', '', ''], classes: ['p0', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9', 'p10', 'p11'], text: '', imgfiles: [], title: '', canIclear: false, type: '' }; }, methods: { cancelImg: function cancelImg(i) { var _this = this; wx.showModal({ title: '', content: '放弃上传这张照片吗?', success: function success(res) { if (res.confirm) { _this.imgfiles.splice(i, 1); } } }); }, previewImg: function previewImg(i) { wx.previewImage({ urls: this.imgfiles, current: this.imgfiles[i] }); }, selectTags: function selectTags(i) { if (this.selectedTags.indexOf(i) > -1) { //我点击的类型已经被选择 this.selectedTags.splice(this.selectedTags.indexOf(i), 1); //删除该类型的选择态(从已选择列表中移除) this.styleTags[i] = this.imgs[i] = ''; //删除该类型的选择态(去除背景色样式,切换图片) } else if (this.selectedTags.length < 3) { //我点击的类型没有被选择且当前已选择数目小于3 this.selectedTags.push(i); //激活该类型的选择态(添加到已选择列表) this.styleTags[i] = 'background:#AA001A;color:white;'; //添加背景色样式 this.imgs[i] = '_select'; //切换图片 } }, commit: function commit() { var _this2 = this; var errTitle = '提交失败'; if (this.title == '') { if (!wx.showModal({ title: errTitle, content: '标题不能为空', showCancel: false, success: function success(res) { if (res.confirm) return false; } })) return; } if (this.selectedTags.length == 0) { if (!wx.showModal({ title: errTitle, content: '类别不能为空', showCancel: false, success: function success(res) { if (res.confirm) return false; } })) return; } if (this.text == '') { if (!wx.showModal({ title: errTitle, content: '正文不能为空', showCancel: false, success: function success(res) { if (res.confirm) return false; } })) return; } wx.showLoading({ title: '正在上传文本' }); wx.request({ url: this.rootUrl + '/pub/addpub', method: 'POST', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { Info_Title: this.title, Info_Content: this.text, Info_Tag: this.selectedTags.map(function (v) { return ++v; }).join('.'), Info_Type: this.type, sessionID: wx.getStorageSync('sessionID') }, success: function success(res) { if (res.statusCode == '500') { _this2.service.getUnionId(_this2.rootAvatar, _this2.rootUrl).then(function (res) { console.log(res); _this2.commit(); }); } else { if (_this2.imgfiles.length > 0) { _this2.upLoadImgs(res.data); } else if (res.data == 1) { wx.hideLoading(); wx.navigateBack({ delta: 1 }); _this2.canIclear = true; console.log(res); } } }, fail: function fail(res) { console.log(res); } }); }, upLoadImgs: function upLoadImgs(CWXID) { var _this3 = this; wx.showLoading({ title: '正在上传图片' }); var time = this.imgfiles.length; var counter = time; var _loop = function _loop(i) { wx.uploadFile({ url: _this3.rootUrl + '/conwx/addpic', filePath: _this3.imgfiles[i], formData: { CWXID: CWXID }, name: 'file', header: { 'content-type': 'application/x-www-form-urlencoded' }, success: function success(res) { console.log(res); if (res.data === '1') { wx.showLoading({ title: '\u56FE\u7247' + (i + 1) + '\u4E0A\u4F20\u6210\u529F' }); } else { wx.showLoading({ title: '\u56FE\u7247' + (i + 1) + '\u4E0A\u4F20\u5931\u8D25' }); } if (--counter == 0) { wx.showToast({ title: '问题上传成功' }); var url = '../similar/main?title=' + _this3.title + '&text=' + _this3.text + '&tags=' + _this3.selectedTags.join(',') + '&imgs=' + _this3.imgfiles.join(','); wx.navigateTo({ url: url }); _this3.canIclear = true; } }, fail: function fail(res) { console.log(res); } }); }; for (var i = 0; i < time; i++) { _loop(i); } }, clearData: function clearData() { this.title = this.text = ''; this.selectedTags = []; this.styleTags = []; this.imgfiles = []; this.imgs = new Array(12).fill(''); this.canIclear = false; }, chooseImage: function chooseImage(e) { var _this4 = this; var count = 9 - this.imgfiles.length; if (count == 0) { if (!wx.showModal({ title: '上传限制', content: '图片数量上限为9张\n请删除部分图片后再上传新图片', showCancel: false, success: function success(res) { if (res.confirm) { return false; } } })) { return; } } wx.chooseImage({ count: count, sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 success: function success(res) { // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 console.log('图片路径'); console.log(res.tempFilePaths); _this4.imgfiles = _this4.imgfiles.concat(res.tempFilePaths); } }); } }, onLoad: function onLoad() { this.type = this.$root.$mp.query.type; }, onShow: function onShow() { if (this.canIclear) { this.clearData(); } } }; /***/ }), /***/ 312: /***/ (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: "consult" }, [_c('div', { staticClass: "search-bar" }, [_c('div', [_vm._v("标题:")]), _vm._v(" "), _c('input', { directives: [{ name: "model", rawName: "v-model", value: (_vm.title), expression: "title" }], attrs: { "placeholder": "请输入15字以内的标题", "maxlength": "15", "eventid": '0' }, domProps: { "value": (_vm.title) }, on: { "input": function($event) { if ($event.target.composing) { return; } _vm.title = $event.target.value } } })]), _vm._v(" "), _c('div', { staticClass: "subtitle" }, [_vm._v("类别(最多选3个)")]), _vm._v(" "), _c('div', { staticClass: "select-grid" }, _vm._l((_vm.sort), function(item, i) { return _c('div', { key: i, staticClass: "grid-item", style: (_vm.styleTags[i]), attrs: { "eventid": '1-' + i }, on: { "tap": function($event) { _vm.selectTags(i) } } }, [_c('img', { class: _vm.classes[i], attrs: { "src": '/static/imgs/1/' + i + _vm.imgs[i] + '.png' } }), _vm._v(" "), _c('div', [_vm._v(_vm._s(item))])]) })), _vm._v(" "), _c('div', { staticClass: "subtitle" }, [_vm._v("正文")]), _vm._v(" "), _c('div', { staticClass: "textarea" }, [_c('textarea', { directives: [{ name: "model", rawName: "v-model", value: (_vm.text), expression: "text" }], attrs: { "placeholder": '请输入' + _vm.type + '的正文', "maxlength": "200", "eventid": '2' }, domProps: { "value": (_vm.text) }, on: { "input": function($event) { if ($event.target.composing) { return; } _vm.text = $event.target.value } } })]), _vm._v(" "), _c('div', { staticClass: "subtitle" }, [_vm._v("添加图片")]), _vm._v(" "), _c('div', { staticClass: "img-box", staticStyle: { "background": "white" } }, [_vm._l((_vm.imgfiles), function(item, i) { return _c('div', { key: i, attrs: { "eventid": '4-' + i }, on: { "tap": function($event) { _vm.previewImg(i) } } }, [_c('img', { attrs: { "src": item } }), _c('div', { attrs: { "eventid": '3-' + i }, on: { "tap": function($event) { $event.stopPropagation(); _vm.cancelImg(i) } } }, [_c('img', { attrs: { "src": "/static/imgs/cancel.png" } })])]) }), _vm._v(" "), _c('img', { attrs: { "src": "/static/imgs/upload.png", "eventid": '5' }, on: { "tap": _vm.chooseImage } })], 2), _vm._v(" "), _c('div', { staticClass: "commit" }, [_c('div', { attrs: { "eventid": '6' }, on: { "tap": _vm.commit } }, [_vm._v("提交")])])]) } 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-0c1c7d16", esExports) } } /***/ }) },[308]); //# sourceMappingURL=main.js.map