木邻有你前端代码仓库
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.

0 lines
3.2 KiB

  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["subPages/community/publishPost"],{"5a32":function(t,n,e){"use strict";e.r(n);var o=e("f19c"),u=e("6430");for(var a in u)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return u[t]}))}(a);e("c63b9");var c=e("828b"),i=Object(c["a"])(u["default"],o["b"],o["c"],!1,null,"024215d0",null,!1,o["a"],void 0);n["default"]=i.exports},6430:function(t,n,e){"use strict";e.r(n);var o=e("6f6a"),u=e.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(a);n["default"]=u.a},"6f6a":function(t,n,e){"use strict";(function(t){var o=e("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u=o(e("7eb4")),a=o(e("ee10")),c={name:"PublishPost",data:function(){return{content:"",image:[],isPhoto:!1}},methods:{chooseImage:function(){var n=this;this.image.length;t.chooseImage({count:1,sourceType:["album","camera"],success:function(){var e=(0,a.default)(u.default.mark((function e(o){var a,c;return u.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a={path:o.tempFilePaths[0]},e.next=3,n.$utils.uploadImage(a);case 3:c=e.sent,n.image.push(c.url),t.showToast({title:"图片上传成功",icon:"success"});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fail:function(t){console.error("选择图片失败:",t)}})},removeImage:function(t){this.image.splice(t,1)},submitPost:function(){var n=this;return(0,a.default)(u.default.mark((function e(){var o;return u.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n.content.trim()){e.next=3;break}return t.showToast({title:"请输入留言内容",icon:"none"}),e.abrupt("return");case 3:return e.next=5,n.$api.community.addPost({content:n.content,image:n.image.toString(),type:n.isPhoto?1:0});case 5:o=e.sent,200===o.code?n.$refs.globalPopupRef.open({content:"您的随手拍内容已提交审核!",subContent:"审核通过后会自动展示在随手拍上!",titleType:"submit",popupType:"success",closefn:function(){setTimeout((function(){t.navigateBack()}),300)}}):t.showToast({title:"".concat(o.message),icon:"none"});case 7:case"end":return e.stop()}}),e)})))()}},onLoad:function(t){"photo"===t.page&&(this.isPhoto=!0)}};n.default=c}).call(this,e("df3c")["default"])},"8ec4":function(t,n,e){},a762:function(t,n,e){"use strict";(function(t,n){var o=e("47a9");e("a476");o(e("3240"));var u=o(e("5a32"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(u.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},c63b9:function(t,n,e){"use strict";var o=e("8ec4"),u=e.n(o);u.a},f19c:function(t,n,e){"use strict";e.d(n,"b",(function(){return u})),e.d(n,"c",(function(){return a})),e.d(n,"a",(function(){return o}));var o={uvIcon:function(){return Promise.all([e.e("common/vendor"),e.e("uni_modules/uv-icon/components/uv-icon/uv-icon")]).then(e.bind(null,"1509"))},uvButton:function(){return Promise.all([e.e("common/vendor"),e.e("uni_modules/uv-button/components/uv-button/uv-button")]).then(e.bind(null,"2f88"))}},u=function(){var t=this.$createElement,n=(this._self._c,this.content.length),e=this.image.length,o=this.content.trim();this.$mp.data=Object.assign({},{$root:{g0:n,g1:e,g2:o}})},a=[]}},[["a762","common/runtime","common/vendor"]]]);