pages-push-circle-send.45599ec6.js 17 KB

123
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-push-circle-send"],{"1da1":function(t,e,n){"use strict";function i(t,e,n,i,a,r,o){try{var u=t[r](o),c=u.value}catch(s){return void n(s)}u.done?e(c):Promise.resolve(c).then(i,a)}n("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){var e=this,n=arguments;return new Promise((function(a,r){var o=t.apply(e,n);function u(t){i(o,a,r,u,c,"next",t)}function c(t){i(o,a,r,u,c,"throw",t)}u(void 0)}))}},n("d3b7")},6189:function(t,e,n){var i=n("9d06");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("52019942",i,!0,{sourceMap:!1,shadowMode:!1})},"7b24":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("c7eb")),r=i(n("1da1"));n("14d9"),n("e9c4"),n("a434"),n("99af"),n("d3b7");var o=i(n("1552")),u=i(n("a620")),c=i(n("8854")),s=[["camera"],["album"],["camera","album"]],l=[["compressed"],["original"],["compressed","original"]],d={data:function(){return{pay_amount:"",input_content:"",imageList:[],videoList:[],sourceTypeIndex:2,sizeTypeIndex:2,sizeType:["压缩","原图","压缩或原图"],countIndex:8,count:[1,2,3,4,5,6,7,8,9],sourceType:["拍摄","相册","拍摄或相册"],VideoOfImagesShow:!0,cameraList:[{value:"back",name:"后置摄像头",checked:"true"},{value:"front",name:"前置摄像头"}],cameraIndex:0,startX:0,movedX:0,endX:0,send_status:!1,can_pay:0}},onLoad:function(t){this.type=t.type,this.user_id=t.user_id,console.log(this.type)},onShow:function(){u.default.routeSonHook()},onUnload:function(){this.imageList=[],this.sourceTypeIndex=2,this.sourceType=["拍照","相册","拍照或相册"],this.sizeTypeIndex=2,this.sizeType=["压缩","原图","压缩或原图"],this.countIndex=8},methods:{canPay:function(t){t.target.value?this.can_pay=1:this.can_pay=0},publish:function(){var t=this;if(this.input_content){if(!this.send_status){this.send_status=!0;var e=this;uni.showLoading({title:"发布中"}),function(n){var i={text:t.input_content,value:[]},a=[];if(a="image"===t.type?t.imageList:t.videoList,a.length)for(var r=0,o=a.length;r<o;r++)e.$httpSendFile({type:2,local_url:a[r],data:{len:o},success:function(t){i.value.push(t.save_name),i.value.length>=o&&(i.pay_amount=e.pay_amount,i.can_pay=e.can_pay,i.video_path=t.video_path,n(i))},fail:function(){e.$httpSend({path:"/im/upload/deleteCircleFile"})}});else n(i)}((function(t){e.$httpSend({path:"/im/circle/sendMsg",data:{content:JSON.stringify(t)},success_action:!0,success:function(t){if(uni.hideLoading(),e.send_status=!1,t.err)return uni.showModal({content:"发布失败"}),void e.$httpSend({path:"/im/upload/deleteCircleFile"});(e.imageList.length||e.videoList.length)&&e.$httpSend({path:"/im/upload/circleFileAction",data:{circle_id:t.data.circle_id}}),uni.showToast({icon:"success",title:"发布成功",success:function(){var t="";console.log("data.user_id",e.user_id),e.user_id>0&&(t="_user");var n=c.default.localData("circle_data"+t);o.default.getCircleList({time:n.length?n[0].time:0,type:0,user_id:e.user_id,update:1}),uni.navigateBack()}})},fail:function(t){uni.hideLoading(),uni.showModal({content:"发布失败"}),e.$httpSend({path:"/im/upload/deleteCircleFile"})}})}))}}else uni.showModal({content:"内容不能为空",showCancel:!1})},close:function(t){this.imageList.splice(t,1)},closeVideo:function(){this.videoList=[]},chooseVideo:function(){var t=(0,r.default)((0,a.default)().mark((function t(){var e=this;return(0,a.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:this,uni.chooseVideo({maxDuration:60,count:1,camera:this.cameraList[this.cameraIndex].value,sourceType:["album"],success:function(t){var n=t.tempFilePath;e.videoList=e.videoList.concat(n)}});case 2:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),chooseImage:function(){var t=(0,r.default)((0,a.default)().mark((function t(){var e,n=this;return(0,a.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(9!==this.imageList.length){t.next=7;break}return t.next=3,this.isFullImg();case 3:if(e=t.sent,console.log("是否继续?",e),e){t.next=7;break}return t.abrupt("return");case 7:uni.chooseImage({sourceType:s[this.sourceTypeIndex],sizeType:l[this.sizeTypeIndex],count:this.imageList.length+this.count[this.countIndex]>9?9-this.imageList.length:this.count[this.countIndex],success:function(t){console.log(t),n.imageList=n.imageList.concat(t.tempFilePaths)}});case 8:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),isFullImg:function(){var t=this;return new Promise((function(e){uni.showModal({content:"已经有9张图片了,是否清空现有图片?",success:function(n){n.confirm?(t.imageList=[],e(!0)):e(!1)},fail:function(){e(!1)}})}))},previewImage:function(t){var e=t.target.dataset.src;console.log(e),console.log(this.imageList),uni.previewImage({current:e,urls:this.imageList})},touchStart:function(t){this.startX=t.mp.changedTouches[0].pageX},touchEnd:function(t){this.endX=t.mp.changedTouches[0].pageX,this.endX-this.startX>200&&uni.navigateBack()}},onNavigationBarButtonTap:function(t){0==t.index&&this.publish()}};e.default=d},"829a":function(t,e,n){"use strict";var i=n("6189"),a=n.n(i);a.a},"9d06":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,".showVedio[data-v-fc93f3ca]{width:100%;height:100%;position:absolute;left:0;right:0;top:0;bottom:0;z-index:300}.cloneBut[data-v-fc93f3ca]{position:relative;text-align:right;font-size:24px;color:red;margin-left:10px;margin-top:10px;height:30px;width:30px}.cloneBut-img[data-v-fc93f3ca]{position:absolute;width:30px}.list_view[data-v-fc93f3ca]{padding:%?40?%;background:#fff}.item_view[data-v-fc93f3ca]{display:flex;height:%?60?%;align-items:center;padding:%?20?% 0;justify-content:space-between}.cell-pd[data-v-fc93f3ca]{padding:%?20?% %?30?%}.uni-textarea[data-v-fc93f3ca]{width:auto;padding:%?20?% %?25?%;line-height:1.6;height:%?150?%}.uni-list[data-v-fc93f3ca]::before{height:0!important}.uni-list[data-v-fc93f3ca]:after{height:0}.list-pd[data-v-fc93f3ca]{margin-top:0}.close-view[data-v-fc93f3ca]{text-align:center;line-height:%?22?%;height:%?24?%;width:%?24?%;border-radius:10px;background:#ef5350;color:#fff;position:absolute;top:%?6?%;right:%?8?%;font-size:%?24?%}.page[data-v-fc93f3ca]{width:%?750?%;height:100%}",""]),t.exports=e},a620:function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("c44c")),r={routeTabBarHook:function(){a.default.routeTool(),a.default.setStatusTips(),a.default.getWebUrl()},routeSonHook:function(){a.default.routeTool()}};e.default=r},be9b:function(t,e,n){"use strict";n.r(e);var i=n("7b24"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},bf00:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"page",on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.touchStart.apply(void 0,arguments)},touchend:function(e){arguments[0]=e=t.$handleEvent(e),t.touchEnd.apply(void 0,arguments)}}},[n("v-uni-form",[n("v-uni-view",{staticClass:"uni-textarea"},[n("v-uni-textarea",{attrs:{placeholder:"这一刻的想法..."},model:{value:t.input_content,callback:function(e){t.input_content=e},expression:"input_content"}})],1),"image"===t.type?n("v-uni-view",{staticClass:"uni-list list-pd"},[n("v-uni-view",{staticClass:" cell-pd"},[n("v-uni-view",{staticClass:"uni-uploader"},[n("v-uni-view",{staticClass:"uni-uploader-head"},[n("v-uni-view",{staticClass:"uni-uploader-title"}),n("v-uni-view",{staticClass:"uni-uploader-info"},[t._v(t._s(t.imageList.length)+"/9")])],1),n("v-uni-view",{staticClass:"uni-uploader-body"},[n("v-uni-view",{staticClass:"uni-uploader__files"},[t._l(t.imageList,(function(e,i){return[n("v-uni-view",{key:i+"_0",staticClass:"uni-uploader__file",staticStyle:{position:"relative"}},[n("v-uni-image",{staticClass:"uni-uploader__img",attrs:{mode:"aspectFill",src:e,"data-src":e},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.previewImage.apply(void 0,arguments)}}}),n("v-uni-view",{staticClass:"close-view",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.close(i)}}},[t._v("x")])],1)]})),n("v-uni-view",{directives:[{name:"show",rawName:"v-show",value:t.imageList.length<9,expression:"imageList.length < 9"}],staticClass:"uni-uploader__input-box"},[n("v-uni-view",{staticClass:"uni-uploader__input",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.chooseImage.apply(void 0,arguments)}}})],1)],2)],1)],1)],1)],1):t._e(),"video"===t.type?n("v-uni-view",{staticClass:"uni-list list-pd"},[n("v-uni-view",{staticClass:" cell-pd"},[n("v-uni-view",{staticClass:"uni-uploader"},[n("v-uni-view",{staticClass:"uni-uploader-head"},[n("v-uni-view",{staticClass:"uni-uploader-title"}),n("v-uni-view",{staticClass:"uni-uploader-info"},[t._v("请选择上传视频")])],1),n("v-uni-view",{staticClass:"uni-uploader-body"},[n("v-uni-view",{staticClass:"uni-uploader__files"},[t._l(t.videoList,(function(e,i){return[n("v-uni-view",{key:i+"_0",staticClass:"uni-uploader__file",staticStyle:{position:"relative"}},[n("v-uni-video",{staticClass:"uni-uploader__img",attrs:{mode:"aspectFill",src:e,"data-src":e},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.previewImage.apply(void 0,arguments)}}}),n("v-uni-view",{staticClass:"close-view",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.closeVideo()}}},[t._v("x")])],1)]})),n("v-uni-view",{directives:[{name:"show",rawName:"v-show",value:0===t.videoList.length,expression:"videoList.length === 0"}],staticClass:"uni-uploader__input-box"},[n("v-uni-view",{staticClass:"uni-uploader__input",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.chooseVideo.apply(void 0,arguments)}}})],1)],2)],1)],1)],1)],1):t._e(),n("v-uni-view",{staticClass:"list_view"})],1)],1)},a=[]},c7eb:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){
  2. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  3. e.default=function(){return t};var t={},n=Object.prototype,a=n.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(S){l=function(t,e,n){return t[e]=n}}function d(t,e,n,i){var a=e&&e.prototype instanceof p?e:p,o=Object.create(a.prototype),u=new T(i||[]);return r(o,"_invoke",{value:L(t,n,u)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(S){return{type:"throw",arg:S}}}t.wrap=d;var h={};function p(){}function v(){}function g(){}var m={};l(m,u,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(I([])));w&&w!==n&&a.call(w,u)&&(m=w);var _=g.prototype=p.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){var n;r(this,"_invoke",{value:function(r,o){function u(){return new e((function(n,u){(function n(r,o,u,c){var s=f(t[r],t,o);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==(0,i.default)(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(d).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)})(r,o,n,u)}))}return n=n?n.then(u,u):u()}})}function L(t,e,n){var i="suspendedStart";return function(a,r){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===a)throw r;return O()}for(n.method=a,n.arg=r;;){var o=n.delegate;if(o){var u=C(o,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var c=f(t,e,n);if("normal"===c.type){if(i=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i="completed",n.method="throw",n.arg=c.arg)}}}function C(t,e){var n=e.method,i=t.iterator[n];if(void 0===i)return e.delegate=null,"throw"===n&&t.iterator["return"]&&(e.method="return",e.arg=void 0,C(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=f(i,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,h;var r=a.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function I(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(a.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return v.prototype=g,r(_,"constructor",{value:g,configurable:!0}),r(g,"constructor",{value:v,configurable:!0}),v.displayName=l(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},b(x.prototype),l(x.prototype,c,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,i,a,r){void 0===r&&(r=Promise);var o=new x(d(e,n,i,a),r);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},b(_),l(_,s,"Generator"),l(_,u,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},t.values=I,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return o.type="throw",o.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],o=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var u=a.call(r,"catchLoc"),c=a.call(r,"finallyLoc");if(u&&c){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(u){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&a.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?(this.method="next",this.next=r.finallyLoc,h):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var a=i.arg;k(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t},n("7a82"),n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("d9e2"),n("d401"),n("14d9"),n("159b"),n("131a"),n("26e9"),n("fb6a");var i=function(t){return t&&t.__esModule?t:{default:t}}(n("53ca"))},eb77:function(t,e,n){"use strict";n.r(e);var i=n("bf00"),a=n("be9b");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("829a");var o=n("f0c5"),u=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"fc93f3ca",null,!1,i["a"],void 0);e["default"]=u.exports}}]);