index.js 6.4 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/page-component/goods/index"],{"0369":function(t,i,e){"use strict";e.r(i);var n=e("381d"),o=e.n(n);for(var c in n)"default"!==c&&function(t){e.d(i,t,(function(){return n[t]}))}(c);i["default"]=o.a},"381d":function(t,i,e){"use strict";(function(t){function n(t,i){var e;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=o(t))||i&&t&&"number"===typeof t.length){e&&(t=e);var n=0,c=function(){};return{s:c,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==e.return||e.return()}finally{if(a)throw s}}}}function o(t,i){if(t){if("string"===typeof t)return c(t,i);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(t,i):void 0}}function c(t,i){(null==i||i>t.length)&&(i=t.length);for(var e=0,n=new Array(i);e<i;e++)n[e]=t[e];return n}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var s=function(){e.e("components/page-component/goods/app-goods-video").then(function(){return resolve(e("7459"))}.bind(null,e)).catch(e.oe)},r={components:{videoNew:s},data:function(){return{video_type:"recommend",translateX:"10",height:"667px",cur_index:null,width:"",sysheight:0,containerStyle:"",distance:0,listTouchStartY:0,listTouchDirection:null,scroll:!1,videoList:[],clicktime:0}},onLoad:function(){var i=t.getSystemInfoSync();this.height="".concat(i.windowHeight,"px"),this.width="".concat(i.windowWidth,"px"),this.sysheight=i.windowHeight,console.log(i),this.getVideoList()},onHide:function(){console.log("界面隐藏,暂停播放","video_".concat(this.videoList[this.cur_index].video_id)),this.videoCtx=t.createVideoContext("video_".concat(this.videoList[this.cur_index].video_id),this),this.videoCtx.pause()},onShow:function(){console.log("界面显示"),null!==this.cur_index&&this.videoList[this.cur_index].flag&&(console.log("开启播放","video_".concat(this.videoList[this.cur_index].video_id)),this.videoCtx=t.createVideoContext("video_".concat(this.videoList[this.cur_index].video_id),this),this.videoCtx.play())},onReady:function(){},methods:{switchTtype:function(t){console.log(t),this.video_type=t,this.getVideoList(!0)},getVideoList:function(i){var e=this;t.request({url:"https://api.52170.xin/video",dataType:"json",success:function(o){console.log(o),i&&(e.videoList=[]);var c,s=n(o.data.data.list);try{for(s.s();!(c=s.n()).done;){var r=c.value;e.videoList.push({video_id:r.video_id,nickname:r.nickname,video_describe:r.video_describe,cover_url:r.cover_url,video_url:r.video_url,dianzan:r.dianzan,pinglun:r.pinglun,zhuanfa:r.zhuanfa,is_dianzan:r.is_dianzan,flag:!1})}}catch(a){s.e(a)}finally{s.f()}try{null==e.cur_index&&(e.cur_index=0),e.videoList[e.cur_index].flag=!0,setTimeout((function(i){e.videoCtx=t.createVideoContext("video_".concat(e.videoList[e.cur_index].video_id),e),e.videoCtx.play()}),100)}catch(l){console.log(l)}}})},clickVideo:function(t){if(this.clicktime>0&&t.timeStamp-this.clicktime<200)clearInterval(this.han),this.videoList[this.cur_index].is_dianzan||(this.videoList[this.cur_index].is_dianzan=!0);else{var i=this;this.han=setTimeout((function(){i.videoList[i.cur_index].flag=!i.videoList[i.cur_index].flag}),200)}this.clicktime=t.timeStamp},ListTouchStart:function(t){console.log(1,t),this.listTouchStartY=t.changedTouches[0].pageY,this.moverOnoff=!1},ListTouchMove:function(t){console.log(2,t),this.listTouchDirection=this.listTouchStartY-t.changedTouches[0].pageY>10?-1:0,this.listTouchDirection=t.changedTouches[0].pageY-this.listTouchStartY>10?1:this.listTouchDirection;var i=this.distance+t.changedTouches[0].pageY-this.listTouchStartY;i>0||Math.abs(this.listTouchStartY-t.changedTouches[0].pageY)<2&&(this.listTouchDirection=null)},ListTouchEnd:function(t){console.log(3,t),this.handelVideo(t)},handelVideo:function(t){if(0==this.cur_index&&1==this.listTouchDirection)return console.log("刷新视频"),void this.getVideoList(!0);try{this.translateX=10}catch(t){console.log("错误"),console.log(t)}if(!this.scroll&&this.listTouchDirection){var i=this.listTouchDirection*this.sysheight+this.distance;if(!(i>0||i<-this.sysheight*(this.videoList.length-1))){var e,o=n(this.videoList);try{for(o.s();!(e=o.n()).done;){var c=e.value;c.flag=!1}}catch(s){o.e(s)}finally{o.f()}this.animate(i,this.listTouchDirection),this.cur_index=this.cur_index-this.listTouchDirection,this.videoList[this.cur_index].flag=!0,console.log("切换第"+this.cur_index+"个"),this.videoList.length==this.cur_index+1&&this.getVideoList(),this.listTouchDirection=null}}},animate:function(t,i){var e=this;console.log(34534,t,i);var n=this.distance,o=new Promise((function(o,c){e.scroll=!0;var s=setInterval((function(){-1===i&&t<n||1===i&&t>n?(n+=100*i,e.containerStyle="transform:translateY(".concat(n,"px)")):(clearInterval(s),n=t,e.distance=t,e.containerStyle="transform:translateY(".concat(n,"px)"),e.scroll=!1,o())}),20)}));return o},tapMsg:function(t){console.log(5,t)},tapShare:function(t){console.log(6,t)},tapLove:function(t){console.log(7,t)}}};i.default=r}).call(this,e("543d")["default"])},"43de":function(t,i,e){},a2a1:function(t,i,e){"use strict";e.r(i);var n=e("cd97"),o=e("0369");for(var c in o)"default"!==c&&function(t){e.d(i,t,(function(){return o[t]}))}(c);e("e2fd");var s,r=e("f0c5"),a=Object(r["a"])(o["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],s);i["default"]=a.exports},cd97:function(t,i,e){"use strict";var n;e.d(i,"b",(function(){return o})),e.d(i,"c",(function(){return c})),e.d(i,"a",(function(){return n}));var o=function(){var t=this,i=t.$createElement;t._self._c},c=[]},e2fd:function(t,i,e){"use strict";var n=e("43de"),o=e.n(n);o.a}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/page-component/goods/index-create-component',
  4. {
  5. 'components/page-component/goods/index-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("a2a1"))
  7. })
  8. },
  9. [['components/page-component/goods/index-create-component']]
  10. ]);