add-luntan.js 3.8 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesC/add-luntan"],{"40ac":function(t,e,n){"use strict";n.r(e);var a=n("511c"),i=n("f9d6");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("687b");var u=n("f0c5"),s=Object(u["a"])(i["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);e["default"]=s.exports},"511c":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var a={uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,"3211"))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,"88c7"))}},i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.images.length);t._isMounted||(t.e0=function(e){t.quanzi={}},t.e1=function(e){t.show=!0},t.e2=function(e){t.show=!0},t.e3=function(e){t.show=!1},t.e4=function(e){t.show=!1},t.e5=function(e,n){var a=arguments[arguments.length-1].currentTarget.dataset,i=a.eventParams||a["event-params"];n=i.a;t.quanzi=n,t.show=!1}),t.$mp.data=Object.assign({},{$root:{g0:n}})},o=[]},"687b":function(t,e,n){"use strict";var a=n("6e0a"),i=n.n(a);i.a},"6e0a":function(t,e,n){},"6f07":function(t,e,n){"use strict";(function(t){var a=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("2eee")),o=a(n("c973")),u=n("2e9d"),s={data:function(){return{show:!1,left:0,page:1,list:[],total:0,textarea:"",quanzi:{},images:[],keywords1:"",keywords:""}},onLoad:function(t){t.quanzi&&(this.quanzi=JSON.parse(t.quanzi)),this.getquanzi()},methods:{todown:function(){this.total!=this.list.length&&(this.page++,this.getquanzi())},tosearch:function(){this.keywords=this.keywords1,this.page=1,this.list=[],this.getquanzi()},del:function(e){var n=this;t.showModal({title:"提示",content:"确定删除吗?",success:function(t){t.confirm&&n.images.splice(e,1)}})},upload:function(){var e=this;t.chooseImage({count:6-this.images.length,success:function(t){e.afterRead(t.tempFilePaths)},fail:function(t){console.log(t)}})},afterRead:function(e){var n=this;return(0,o.default)(i.default.mark((function a(){var o,u;return i.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:t.showLoading({mask:!0,title:"上传中"}),o=0;case 2:if(!(o<e.length)){a.next=10;break}return a.next=5,n.uploadFilePromise(e[o]);case 5:u=a.sent,1==u.code&&n.images.push(u.data.fullurl);case 7:o++,a.next=2;break;case 10:t.hideLoading();case 11:case"end":return a.stop()}}),a)})))()},uploadFilePromise:function(e){var n=this;return new Promise((function(a,i){t.uploadFile({url:n.$url+"/api/common/upload",filePath:e,name:"file",success:function(t){setTimeout((function(){a(JSON.parse(t.data))}),1e3)},fail:function(t){console.log(t)}})}))},getquanzi:function(){var t=this;(0,u.group_list)({page:this.page,keywords:this.keywords}).then((function(e){t.list=t.list.concat(e.data.data),t.total=e.data.total}))},toover:function(){var e=this;this.textarea?(t.showLoading({mask:!0,title:"请稍后"}),(0,u.create_article)({circle_id:this.quanzi.id,content:this.textarea,images:this.images.join(",")}).then((function(n){e.$u.toast(n.msg),1==n.code&&setTimeout((function(){t.redirectTo({url:"/pagesC/add-luntan-over"})}),800)}))):this.$u.toast("请输入内容")}}};e.default=s}).call(this,n("543d")["default"])},"79fa":function(t,e,n){"use strict";(function(t,e){var a=n("4ea4");n("9f7d");a(n("66fd"));var i=a(n("40ac"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},f9d6:function(t,e,n){"use strict";n.r(e);var a=n("6f07"),i=n.n(a);for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);e["default"]=i.a}},[["79fa","common/runtime","common/vendor"]]]);