2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
|
import{o as t,c as e,w as o,b as s,G as n,a as i,F as a,q as r,N as h,_ as l,e as c,y as u,x as d,i as p}from"./index-CH9-aFWw.js";import{_ as f}from"./_plugin-vue_export-helper.BCo6x5W8.js";let g={},m=null;m=function(){var t=navigator.userAgent,e=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],o=!0;for(let s=0;s<e.length-1;s++)if(t.indexOf(e[s])>0){o=!1;break}return o}(),g={data:()=>({is_show:"none"}),watch:{show(t){this.is_show=this.show}},created(){this.swipeaction=this.getSwipeAction(),this.swipeaction&&Array.isArray(this.swipeaction.children)&&this.swipeaction.children.push(this)},mounted(){this.is_show=this.show},methods:{closeSwipe(t){this.autoClose&&this.swipeaction&&this.swipeaction.closeOther(this)},change(t){this.$emit("change",t.open),this.is_show!==t.open&&(this.is_show=t.open)},appTouchStart(t){if(m)return;const{clientX:e}=t.changedTouches[0];this.clientX=e,this.timestamp=(new Date).getTime()},appTouchEnd(t,e,o,s){if(m)return;const{clientX:n}=t.changedTouches[0];let i=Math.abs(this.clientX-n),a=(new Date).getTime()-this.timestamp;i<40&&a<300&&this.$emit("click",{content:o,index:e,position:s})},onClickForPC(t,e,o){m&&this.$emit("click",{content:e,index:t,position:o})}}};const w=g;var b=!1;function v(t,e){var o=t.instance,s=o.getDataset().disabled,n=o.getState();T(o,e),(s=("string"==typeof s?JSON.parse(s):s)||!1)||(o.requestAnimationFrame((function(){o.removeClass("ani"),e.callMethod("closeSwipe")})),n.x=n.left||0,function(t){var e=t.instance,o=e.getState();C(e);var s=t.touches[0];b&&X()&&(s=t);o.startX=s.clientX,o.startY=s.clientY}(t))}function y(t,e){var o=t.instance,s=o.getDataset().disabled,n=o.getState();(s=("string"==typeof s?JSON.parse(s):s)||!1)||(!function(t){var e=t.instance,o=e.getState(),s=t.touches[0];b&&X()&&(s=t);o.deltaX=s.clientX-o.startX,o.deltaY=s.clientY-o.startY,o.offsetY=Math.abs(o.deltaY),o.offsetX=Math.abs(o.deltaX),o.direction=o.direction||function(t,e){if(t>e&&t>10)return"horizontal";if(e>t&&e>10)return"vertical";return""}(o.offsetX,o.offsetY)}(t),"horizontal"===n.direction&&(t.preventDefault&&t.preventDefault(),x(n.x+n.deltaX,o)))}function S(t,e){var o=t.instance,s=o.getDataset().disabled,n=o.getState();(s=("string"==typeof s?JSON.parse(s):s)||!1)||function(t,e,o){var s=e.getState(),n=s.threshold;s.position;var i=s.isopen||"none",a=s.leftWidth,r=s.rightWidth;if(0===s.deltaX)return void _("none",e,o);_("none"===i&&r>0&&-t>n||"none"!==i&&r>0&&r+t<n?"right":"none"===i&&a>0&&t>n||"none"!==i&&a>0&&a-t<n?"left":"none",e,o)}(n.left,o,e)}function x(t,e,o){t=t||0;var s,n,i,a=e.getState(),r=a.leftWidth,h=a.rightWidth;a.left=(s=t,n=-h,i=r,Math.min(Math.max(s,n),i)),e.requestAnimationFrame((function(){e.setStyle({transform:"translateX("+a.left+"px)","-webkit-transform":"translateX("+a.left+"px)"})}))}function T(t,e){var o,s,n=t.getState(),i=e.selectComponent(".button-group--left"),a=e.selectComponent(".button-group--right");o=i.getBoundingClientRect(),s=a.getBoundingClientRect(),n.leftWidth=o.width||0,n.rightWidth=s.width||0,n.threshold=t.getDataset().threshold}function _(t,e,o){var s=e.getState(),n=s.leftWidth,i=s.rightWidth,a="";switch(s.isopen=s.isopen?s.isopen:"none",t){case"left":a=n;break;case"right":a=-i;break;default:a=0}s.isopen!==t&&(s.throttle=!0,o.callMethod("change",{open:t})),s.isopen=t,e.requestAnimationFrame((function(){e.addClass("ani"),x(a,e)}))}function C(t){var e=t.getState();e.direction="",e.deltaX=0,e.deltaY=0,e.offsetX=0,e.offsetY=0}function X(){for(var t=navigator.userAgent,e=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],o=!0,s=0;s<e.length-1;s++)if(t.indexOf(e[s])>0){o=!1;break}return o}"object"==typeof window&&(b=!0);var k=!1;const D={showWatch:function(t,e,o,s){var n=s.getState();T(s,o),t&&"none"!==t?_(t,s,o):(n.left&&_("none",s,o),C(s))},touchstart:v,touchmove:y,touchend:S,mousedown:function(t,e){b&&X()&&(v(t,e),k=!0)},mousemove:function(t,e){b&&X()&&k&&y(t)},mouseup:function(t,e){b&&X()&&(S(t,e),k=!1)},mouseleave:function(t,e){b&&X()&&(k=!1)}},$=t=>{t.$wxs||(t.$wxs=[]),t.$wxs.push("wxsswipe"),t.mixins||(t.mixins=[]),t.mixins.push({be
|