java-mall-app/unpackage/dist/build/mp-weixin/community/nvueSwiper/nvueSwiper.js
2024-11-01 16:35:40 +08:00

1 line
10 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["community/nvueSwiper/nvueSwiper"],{"2d8e":function(t,i,e){},3412:function(t,i,e){"use strict";var o=e("7814"),s=e.n(o);s.a},"4aef":function(t,i,e){"use strict";(function(t,i){var o=e("47a9");e("90c2");o(e("3240"));var s=o(e("653d"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(s.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},"593c":function(t,i,e){"use strict";(function(t,o){var s=e("47a9");Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n=s(e("7ca3")),a=e("8f59");function r(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);i&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),e.push.apply(e,o)}return e}function u(t){for(var i=1;i<arguments.length;i++){var e=null!=arguments[i]?arguments[i]:{};i%2?r(Object(e),!0).forEach((function(i){(0,n.default)(t,i,e[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}))}return t}var d={data:function(){var t;return t={windowWidth:0,windowHeight:0,platform:"",deleteHeight:0,dataList:[],k:0,oldVideo:"",voice:"",timeout:"",current:0,story_id:0,user_id:0,boxStyle:{height:0,width:0},page:1,index:0,isDouyin:!1,pinlunNum:0},(0,n.default)(t,"deleteHeight",0),(0,n.default)(t,"heightNum",1.18),(0,n.default)(t,"touchNum",0),(0,n.default)(t,"aixinLeft",0),(0,n.default)(t,"aixinTop",0),(0,n.default)(t,"isShowAixin",!1),(0,n.default)(t,"Rotate",0),(0,n.default)(t,"uid",0),t},components:{douyinScrollview:function(){Promise.all([e.e("community/common/vendor"),e.e("community/components/douyin-scrollview/douyin-H-scrollview")]).then(function(){return resolve(e("febe"))}.bind(null,e)).catch(e.oe)},uniPopup:function(){e.e("components/uni-popup/uni-popup").then(function(){return resolve(e("6ea8"))}.bind(null,e)).catch(e.oe)}},computed:(0,a.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin","__","$","sprintf"]),watch:{k:function(i,e){var o=this;console.log(i),this.dataList[e].playIng=!1,this.dataList[e].isplay=!0,this.dataList[e].state="pause",this.user_id=this.dataList[e].user_id,this.story_id=this.dataList[i].story_id,this.pinlunNum=this.dataList[e].story_comment_count,console.log("预留第"+(e+1)+"个视频:"+this.dataList[e].story_id+e),t.createVideoContext(this.dataList[e].story_id+""+e,this).stop(),console.log("已经暂停 --\x3e 第"+(e+1)+"个视频~"),this.dataList[i].state="play",setTimeout((function(){t.createVideoContext(o.dataList[i].story_id+""+i,o).play(),setTimeout((function(){o.dataList[i].isplay=!1,o.dataList[i].playIng=!0}),50)}),250);var s=i+1;console.log("预加载第"+(s+1)+"个视频:"+this.dataList[s].story_id+s)}},onLoad:function(i){i.uid&&(this.uid=i.uid),this.platform=t.getSystemInfoSync().platform;var e=t.getSystemInfoSync().model;"ios"!=this.platform||"iPhone6"===e&&"iPhone6s"===e&&"iPhone7"===e&&"iPhone8"===e?(this.deleteHeight=0,this.heightNum=1.25):(this.deleteHeight=0,this.heightNum=1.27),this.story_id=i.id?i.id:0,this.windowWidth=t.getSystemInfoSync().windowWidth,this.windowHeight=t.getSystemInfoSync().windowHeight,this.boxStyle.width=this.windowWidth+"px",this.boxStyle.height=this.windowHeight-this.deleteHeight,this.get()},onShow:function(){console.log("回到前台"),0!==this.dataList.length&&(this.dataList[this.k].state="play",t.createVideoContext(this.dataList[this.k].story_id+""+this.k,this).play())},onHide:function(){this.dataList[this.k].state="pause",t.createVideoContext(this.dataList[this.k].story_id+""+this.k,this).pause(),console.log("到后台")},onShareAppMessage:function(){return o.showShareMenu({withShareTicket:!0,menus:["shareAppMessage","shareTimeline"]}),{imageUrl:this.dataList[0]["story_file"][0],title:this.pname,path:"/community/nvueSwiper/nvueSwiper?id="+this.story_id+"&uid="+this.userInfo.user_id}},onShareTimeline:function(){return{title:this.dataList[0].story_title,query:{uid:this.userInfo.user_id,pid:this.story_id},imageUrl:this.dataList[0]["story_file"][0]}},methods:u(u({},(0,a.mapMutations)(["logout","getPlantformInfo","forceUserInfo","getStoreInfo"])),{},{ended:function(){},onProduct:function(t){this.$.gopage("/pages/product/detail?pid="+t)},onUnCollection:function(t){var i=this,e={story_id:t.currentTarget.dataset.story_id};i.forceUserInfo((function(o){i.index=t.currentTarget.dataset.index,i.$.request({url:i.Config.URL.sns.story_collection_remove,data:e,success:function(t,e,o,s){200==e?(i.dataList[i.index].IsCollection=!1,i.dataList[i.index].story_collection_count--,i.$forceUpdate()):i.$.confirm(o)}})}))},onCollection:function(t){var i=this,e={story_id:t.currentTarget.dataset.story_id};i.forceUserInfo((function(o){i.index=t.currentTarget.dataset.index,i.$.request({url:i.Config.URL.sns.story_collection_add,data:e,success:function(t,e,o,s){200==e?(i.dataList[i.index].IsCollection=!0,i.dataList[i.index].story_collection_count++,i.$forceUpdate()):i.$.confirm(o)}})}))},report:function(){this.$.gotopage("/member/member/feedback")},closeScrollview:function(){this.$refs.pinglun.close()},onUnLike:function(t){var i=this;i.forceUserInfo((function(e){i.canceldianzan(t.currentTarget.dataset.story_id),i.index=t.currentTarget.dataset.index}))},canceldianzan:function(t){var i=this,e={story_id:t};i.$.request({url:this.Config.URL.sns.story_like_remove,data:e,success:function(t,e,o,s){200==e&&(i.dataList[i.index].IsFabulous=!1,i.dataList[i.index].story_like_count--)}})},onLike:function(t){var i=this;i.forceUserInfo((function(e){i.doLike(t.currentTarget.dataset.story_id),i.index=t.currentTarget.dataset.index}))},doLike:function(t){var i=this,e={story_id:t};i.$.request({url:this.Config.URL.sns.story_like_add,data:e,success:function(t,e,o,s){200==e&&(i.dataList[i.index].IsFabulous=!0,i.dataList[i.index].story_like_count++)}})},touchstartHover:function(t){var i=this;if(this.touchNum>=1){this.aixinLeft=t.touches[0].screenX-50,this.aixinTop=t.touches[0].screenY-50,this.isShowAixin=!0;this.Rotate=Math.floor(81*Math.random())+-40,setTimeout((function(){i.isShowAixin=!1}),700)}},tapVideoHover:function(i,e){var o=this;this.dataList[this.k].isShowimage=!1,this.dataList[this.k].isShowProgressBarTime=!1,this.ProgressBarOpacity=.5,this.dotWidth=0,console.log("state--",i),this.touchNum++,setTimeout((function(){1==o.touchNum&&(o.dataList[o.k].state="play"==i||"continue"==i?"pause":"continue","continue"==o.dataList[o.k].state&&t.createVideoContext(o.dataList[o.k].story_id+""+o.k,o).play(),"pause"==o.dataList[o.k].state&&t.createVideoContext(o.dataList[o.k].story_id+""+o.k,o).pause()),o.touchNum>=2&&o.doubleLike(),o.touchNum=0,o.$set(o.dataList,o.k,o.dataList[o.k])}),200)},doubleLike:function(){0==this.dataList[this.k].like&&(this.dataList[this.k].like_n+=1,this.dataList[this.k].like=!0)},change:function(t){this.k=t.detail.current},tozuozhe:function(i){t.navigateTo({url:"/community/community/userspace?uid="+i})},animationfinish:function(t){this.k==this.dataList.length-1&&(this.page=parseInt(this.page)+1,this.GET())},GET:function(){var t=this,i={page:this.page,story_type:4,uid:this.uid};console.log(i),this.$.request({url:this.Config.URL.sns.story_lists,data:i,success:function(i,e,o,s){o=i.items;for(var n=0;n<o.length;n++)o[n].story_id=o[n].story_id+"k",o[n].state="pause",o[n].playIng=!1,o[n].isplay=!0,o[n].isShowimage=!1,o[n].isShowProgressBarTime=!1,t.dataList.push(o[n])}})},get:function(){var i=this,e={page:this.page,story_type:4};console.log(e),e["story_id"]=this.story_id,this.$.request({url:this.Config.URL.sns.story_lists,data:e,success:function(e,o,s,n){s=e.items;i.user_id=s[0].user_id,i.story_id=s[0].story_id,i.pinlunNum=s[0].story_comment_count;for(var a=0;a<s.length;a++)s[a].story_id=s[a].story_id+"k",s[a].state="pause",s[a].playIng=!1,s[a].isplay=!0,s[a].isShowimage=!1,s[a].isShowProgressBarTime=!1,i.dataList.push(s[a]);setTimeout((function(){i.dataList[i.k].isplay=!1,i.dataList[i.k].state="play",t.createVideoContext(i.dataList[i.k].story_id+""+i.k,i).play(),i.dataList[i.k].playIng=!0,i.$set(i.dataList,i.k,i.dataList[i.k])}),200);var r=i.k;++r,"undefined"!=typeof i.dataList[r]&&(setTimeout((function(){t.createVideoContext(i.dataList[r].story_id+""+i.k,i).play()}),20),clearTimeout(i.timeout),i.timeout=setTimeout((function(){t.createVideoContext(i.dataList[r].story_id+""+i.k,i).seek(0),t.createVideoContext(i.dataList[r].story_id+""+i.k,i).pause(),console.log("预加载第"+(r+1)+"个视频:"+i.dataList[r].story_id+r)}),1500))}})},share:function(){t.showToast({title:"分享",icon:"none"})},onFollow:function(t,i){var e=this;e.forceUserInfo((function(o){e.AddFollow(t,i)}))},AddFollow:function(t,i){var e=this,o={user_id:t,OperateId:t,friend_id:t},s=e.dataList;e.$.request({url:this.Config.URL.user.friend_agree,data:o,success:function(t,o,n,a){200==o&&(s[i].IsFollow=1,e.$set(e.dataList,i,s[i]),e.$forceUpdate(),e.$.alert("关注成功"))}})},toComment:function(i){t.showToast({title:"加载中...",icon:"none",position:"bottom",duration:300}),t.setStorageSync("videoID",this.dataList[i].story_id),this.isDouyin=!0,console.log(8888),this.$refs.pinglun.open("bottom"),t.hideLoading()},cLike:function(t){this.dataList[this.k].like=!this.dataList[this.k].like;var i=this.dataList[this.k];t?i.like_n-=1:i.like_n+=1}})};i.default=d}).call(this,e("df3c")["default"],e("3223")["default"])},"653d":function(t,i,e){"use strict";e.r(i);var o=e("8004"),s=e("b725");for(var n in s)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return s[t]}))}(n);e("bbc4"),e("3412");var a=e("828b"),r=Object(a["a"])(s["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);i["default"]=r.exports},7814:function(t,i,e){},8004:function(t,i,e){"use strict";e.d(i,"b",(function(){return s})),e.d(i,"c",(function(){return n})),e.d(i,"a",(function(){return o}));var o={uniPopup:function(){return e.e("components/uni-popup/uni-popup").then(e.bind(null,"6ea8"))}},s=function(){var t=this,i=t.$createElement,e=(t._self._c,t.__("举报")),o=t.__map(t.dataList,(function(i,e){var o=t.__get_orig(i),s=Math.abs(t.k-e),n=i.item_id.length>0&&i.product_item_name,a=n?t.sprintf(t.__("价格:%s"),i.item_unit_price):null;return{$orig:o,g0:s,g1:n,m1:a}}));t.$mp.data=Object.assign({},{$root:{m0:e,l0:o}})},n=[]},b725:function(t,i,e){"use strict";e.r(i);var o=e("593c"),s=e.n(o);for(var n in o)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return o[t]}))}(n);i["default"]=s.a},bbc4:function(t,i,e){"use strict";var o=e("2d8e"),s=e.n(o);s.a}},[["4aef","common/runtime","common/vendor"]]]);