diff --git a/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.js b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.js new file mode 100644 index 0000000..b1bec89 --- /dev/null +++ b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.js @@ -0,0 +1,254 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true, + pureDataPattern: /^_/ + }, + properties: { + duration: { + type: Number, + value: 500 + }, + easingFunction: { + type: String, + value: 'default' + }, + loop: { + type: Boolean, + value: true + }, + videoList: { + type: Array, + value: [], + observer: function observer() { + var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + this._videoListChanged(newVal); + } + } + }, + data: { + nextQueue: [], + prevQueue: [], + curQueue: [], + circular: false, + _last: 1, + _change: -1, + _invalidUp: 0, + _invalidDown: 0, + _videoContexts: [] + }, + lifetimes: { + attached: function attached() { + this.data._videoContexts = [wx.createVideoContext('video_0', this), wx.createVideoContext('video_1', this), wx.createVideoContext('video_2', this)]; + } + }, + methods: { + _videoListChanged: function _videoListChanged(newVal) { + var _this = this; + + var data = this.data; + newVal.forEach(function (item) { + data.nextQueue.push(item); + }); + if (data.curQueue.length === 0) { + this.setData({ + curQueue: data.nextQueue.splice(0, 3) + }, function () { + _this.playCurrent(1); + }); + } + }, + animationfinish: function animationfinish(e) { + var _data = this.data, + _last = _data._last, + _change = _data._change, + curQueue = _data.curQueue, + prevQueue = _data.prevQueue, + nextQueue = _data.nextQueue; + + var current = e.detail.current; + var diff = current - _last; + if (diff === 0) return; + this.data._last = current; + this.playCurrent(current); + this.triggerEvent('change', { activeId: curQueue[current].id }); + var direction = diff === 1 || diff === -2 ? 'up' : 'down'; + if (direction === 'up') { + if (this.data._invalidDown === 0) { + var change = (_change + 1) % 3; + var add = nextQueue.shift(); + var remove = curQueue[change]; + if (add) { + prevQueue.push(remove); + curQueue[change] = add; + this.data._change = change; + } else { + this.data._invalidUp += 1; + } + } else { + this.data._invalidDown -= 1; + } + } + if (direction === 'down') { + if (this.data._invalidUp === 0) { + var _change2 = _change; + var _remove = curQueue[_change2]; + var _add = prevQueue.pop(); + if (_add) { + curQueue[_change2] = _add; + nextQueue.unshift(_remove); + this.data._change = (_change2 - 1 + 3) % 3; + } else { + this.data._invalidDown += 1; + } + } else { + this.data._invalidUp -= 1; + } + } + var circular = true; + if (nextQueue.length === 0 && current !== 0) { + circular = false; + } + if (prevQueue.length === 0 && current !== 2) { + circular = false; + } + this.setData({ + curQueue: curQueue, + circular: circular + }); + }, + playCurrent: function playCurrent(current) { + this.data._videoContexts.forEach(function (ctx, index) { + index !== current ? ctx.pause() : ctx.play(); + }); + }, + onPlay: function onPlay(e) { + this.trigger(e, 'play'); + }, + onPause: function onPause(e) { + this.trigger(e, 'pause'); + }, + onEnded: function onEnded(e) { + this.trigger(e, 'ended'); + }, + onError: function onError(e) { + this.trigger(e, 'error'); + }, + onTimeUpdate: function onTimeUpdate(e) { + this.trigger(e, 'timeupdate'); + }, + onWaiting: function onWaiting(e) { + this.trigger(e, 'wait'); + }, + onProgress: function onProgress(e) { + this.trigger(e, 'progress'); + }, + onLoadedMetaData: function onLoadedMetaData(e) { + this.trigger(e, 'loadedmetadata'); + }, + trigger: function trigger(e, type) { + var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var detail = e.detail; + var activeId = e.target.dataset.id; + this.triggerEvent(type, Object.assign(Object.assign(Object.assign({}, detail), { activeId: activeId }), ext)); + } + } +}); + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.json b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.json new file mode 100644 index 0000000..b18bd46 --- /dev/null +++ b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxml b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxml new file mode 100644 index 0000000..f028095 --- /dev/null +++ b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxml @@ -0,0 +1,37 @@ + + + + + + + + + diff --git a/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxss b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxss new file mode 100644 index 0000000..ea7f6f2 --- /dev/null +++ b/miniprogram_npm/@miniprogram-component-plus/video-swiper/index.wxss @@ -0,0 +1 @@ +.container{width:100%;height:100%}.video-swiper{width:100%;height:100%}.video_item{height:100%;width:100%} \ No newline at end of file diff --git a/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.js b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.js new file mode 100644 index 0000000..b1bec89 --- /dev/null +++ b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.js @@ -0,0 +1,254 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true, + pureDataPattern: /^_/ + }, + properties: { + duration: { + type: Number, + value: 500 + }, + easingFunction: { + type: String, + value: 'default' + }, + loop: { + type: Boolean, + value: true + }, + videoList: { + type: Array, + value: [], + observer: function observer() { + var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + this._videoListChanged(newVal); + } + } + }, + data: { + nextQueue: [], + prevQueue: [], + curQueue: [], + circular: false, + _last: 1, + _change: -1, + _invalidUp: 0, + _invalidDown: 0, + _videoContexts: [] + }, + lifetimes: { + attached: function attached() { + this.data._videoContexts = [wx.createVideoContext('video_0', this), wx.createVideoContext('video_1', this), wx.createVideoContext('video_2', this)]; + } + }, + methods: { + _videoListChanged: function _videoListChanged(newVal) { + var _this = this; + + var data = this.data; + newVal.forEach(function (item) { + data.nextQueue.push(item); + }); + if (data.curQueue.length === 0) { + this.setData({ + curQueue: data.nextQueue.splice(0, 3) + }, function () { + _this.playCurrent(1); + }); + } + }, + animationfinish: function animationfinish(e) { + var _data = this.data, + _last = _data._last, + _change = _data._change, + curQueue = _data.curQueue, + prevQueue = _data.prevQueue, + nextQueue = _data.nextQueue; + + var current = e.detail.current; + var diff = current - _last; + if (diff === 0) return; + this.data._last = current; + this.playCurrent(current); + this.triggerEvent('change', { activeId: curQueue[current].id }); + var direction = diff === 1 || diff === -2 ? 'up' : 'down'; + if (direction === 'up') { + if (this.data._invalidDown === 0) { + var change = (_change + 1) % 3; + var add = nextQueue.shift(); + var remove = curQueue[change]; + if (add) { + prevQueue.push(remove); + curQueue[change] = add; + this.data._change = change; + } else { + this.data._invalidUp += 1; + } + } else { + this.data._invalidDown -= 1; + } + } + if (direction === 'down') { + if (this.data._invalidUp === 0) { + var _change2 = _change; + var _remove = curQueue[_change2]; + var _add = prevQueue.pop(); + if (_add) { + curQueue[_change2] = _add; + nextQueue.unshift(_remove); + this.data._change = (_change2 - 1 + 3) % 3; + } else { + this.data._invalidDown += 1; + } + } else { + this.data._invalidUp -= 1; + } + } + var circular = true; + if (nextQueue.length === 0 && current !== 0) { + circular = false; + } + if (prevQueue.length === 0 && current !== 2) { + circular = false; + } + this.setData({ + curQueue: curQueue, + circular: circular + }); + }, + playCurrent: function playCurrent(current) { + this.data._videoContexts.forEach(function (ctx, index) { + index !== current ? ctx.pause() : ctx.play(); + }); + }, + onPlay: function onPlay(e) { + this.trigger(e, 'play'); + }, + onPause: function onPause(e) { + this.trigger(e, 'pause'); + }, + onEnded: function onEnded(e) { + this.trigger(e, 'ended'); + }, + onError: function onError(e) { + this.trigger(e, 'error'); + }, + onTimeUpdate: function onTimeUpdate(e) { + this.trigger(e, 'timeupdate'); + }, + onWaiting: function onWaiting(e) { + this.trigger(e, 'wait'); + }, + onProgress: function onProgress(e) { + this.trigger(e, 'progress'); + }, + onLoadedMetaData: function onLoadedMetaData(e) { + this.trigger(e, 'loadedmetadata'); + }, + trigger: function trigger(e, type) { + var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var detail = e.detail; + var activeId = e.target.dataset.id; + this.triggerEvent(type, Object.assign(Object.assign(Object.assign({}, detail), { activeId: activeId }), ext)); + } + } +}); + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.json b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.json new file mode 100644 index 0000000..b18bd46 --- /dev/null +++ b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.wxml b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.wxml new file mode 100644 index 0000000..f028095 --- /dev/null +++ b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.wxml @@ -0,0 +1,37 @@ + + + + + + + + + diff --git a/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.wxss b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.wxss new file mode 100644 index 0000000..ea7f6f2 --- /dev/null +++ b/node_modules/@miniprogram-component-plus/video-swiper/miniprogram_dist/index.wxss @@ -0,0 +1 @@ +.container{width:100%;height:100%}.video-swiper{width:100%;height:100%}.video_item{height:100%;width:100%} \ No newline at end of file diff --git a/node_modules/@miniprogram-component-plus/video-swiper/package.json b/node_modules/@miniprogram-component-plus/video-swiper/package.json new file mode 100644 index 0000000..874f32e --- /dev/null +++ b/node_modules/@miniprogram-component-plus/video-swiper/package.json @@ -0,0 +1,45 @@ +{ + "_from": "@miniprogram-component-plus/video-swiper", + "_id": "@miniprogram-component-plus/video-swiper@1.0.1", + "_inBundle": false, + "_integrity": "sha512-1rlmsS3/TR0Zu0nZHwEwb9UCQWY/ofPv73zU56FLfZh72Xw+BcIzfohrDxrGs5QpoL4KCLl9G7UB5w+3ZRSZzQ==", + "_location": "/@miniprogram-component-plus/video-swiper", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "@miniprogram-component-plus/video-swiper", + "name": "@miniprogram-component-plus/video-swiper", + "escapedName": "@miniprogram-component-plus%2fvideo-swiper", + "scope": "@miniprogram-component-plus", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/@miniprogram-component-plus/video-swiper/-/video-swiper-1.0.1.tgz", + "_shasum": "cf54697c6466fc017fe0c4cd15f9dd15bc7626a5", + "_spec": "@miniprogram-component-plus/video-swiper", + "_where": "/Users/WebTmm/Desktop/AGuestSaas", + "author": { + "name": "sanfordsun" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "", + "keywords": [ + "video", + "swiper", + "miniprogram" + ], + "license": "ISC", + "main": "miniprogram_dist/index.js", + "name": "@miniprogram-component-plus/video-swiper", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.1" +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..83cfb72 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "aguestsaas", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@miniprogram-component-plus/video-swiper": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@miniprogram-component-plus/video-swiper/-/video-swiper-1.0.1.tgz", + "integrity": "sha512-1rlmsS3/TR0Zu0nZHwEwb9UCQWY/ofPv73zU56FLfZh72Xw+BcIzfohrDxrGs5QpoL4KCLl9G7UB5w+3ZRSZzQ==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..8b6ff59 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "aguestsaas", + "version": "1.0.0", + "description": "***Author: TMOCT5***", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "http://git.yuzhankeji.cn/TmOct5/AGuestSaas.git" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@miniprogram-component-plus/video-swiper": "^1.0.1" + } +} diff --git a/project.config.json b/project.config.json index 38f4d8a..b1d2603 100644 --- a/project.config.json +++ b/project.config.json @@ -12,7 +12,7 @@ "minified": true, "newFeature": false, "coverView": true, - "nodeModules": false, + "nodeModules": true, "autoAudits": false, "showShadowRootInWxmlPanel": true, "scopeDataCheck": false,