From f67fb8b6b348a313abe94cb0f9cdb804521c5817 Mon Sep 17 00:00:00 2001 From: MagicalKudzu Date: Wed, 17 Dec 2025 14:19:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 8 +- common.js | 4 +- hook.js | 414 +++-- pages/custom/detail.js | 534 ++++++ pages/custom/detail.json | 3 + pages/custom/detail.wxml | 91 + pages/custom/detail.wxss | 197 +++ pages/custom/index.js | 304 ++-- pages/custom/index.wxml | 2 - pages/custom/search.js | 105 ++ pages/custom/search.json | 3 + pages/custom/search.wxml | 49 + pages/custom/search.wxss | 173 ++ pages/search/index.js | 7 +- pages/webview/index.js | 687 +++++++- project.config.json | 26 +- project.private.config.json | 32 +- subPackages/order-pay/index.js | 16 +- subPackages/sku/index.js | 15 +- subPackages/video/index.js | 136 +- subPackages/video/wx-youkuplayer/index.js | 1945 ++++++++++++++++++++- 21 files changed, 4510 insertions(+), 241 deletions(-) create mode 100644 pages/custom/detail.js create mode 100644 pages/custom/detail.json create mode 100644 pages/custom/detail.wxml create mode 100644 pages/custom/detail.wxss create mode 100644 pages/custom/search.js create mode 100644 pages/custom/search.json create mode 100644 pages/custom/search.wxml create mode 100644 pages/custom/search.wxss diff --git a/app.json b/app.json index 11a7b32..1082ca1 100644 --- a/app.json +++ b/app.json @@ -56,8 +56,8 @@ "selectedIconPath": "images/icon_mine_selected.png" }, { - "pagePath": "pages/custom/index", - "text": "自定义", + "pagePath": "pages/custom/search", + "text": "科技", "iconPath": "images/icon_mine_normal.png", "selectedIconPath": "images/icon_mine_selected.png" } @@ -114,6 +114,8 @@ "pages/ticket/confirm-regift/index", "pages/others/orders/index", "pages/test", - "pages/custom/index" + "pages/custom/index", + "pages/custom/search", + "pages/custom/detail" ] } \ No newline at end of file diff --git a/common.js b/common.js index 928afc0..b7075e9 100644 --- a/common.js +++ b/common.js @@ -6460,7 +6460,6 @@ require("@babel/runtime/helpers/Arrayincludes"), (wx.webpackJsonp = wx.webpackJs console.log('s = ', s); console.log('i = ', i); console.log('t = ', t) - debugger return new p.p((0, r.A)((0, r.A)({}, i), {}, { data: t, ext_querys: s, @@ -6477,6 +6476,9 @@ require("@babel/runtime/helpers/Arrayincludes"), (wx.webpackJsonp = wx.webpackJs t = { ttid: "#t#ip##_h5_2014" }; + if (e.buyParam.split('_0_').length > 1) { + e.buyParam = e.buyParam.split('_0_')[0] + "_" + 1 + "_" + e.buyParam.split('_0_')[1] + } return new p.p((0, r.A)((0, r.A)((0, r.A)({}, o), e), {}, { ext_querys: t, headers: { diff --git a/hook.js b/hook.js index e54eb80..89b882f 100644 --- a/hook.js +++ b/hook.js @@ -1,136 +1,324 @@ function setup() { - hook(); + hook() } function hook() { - wx.version = { - updateTime: "2025.12.4 19:05:22", - version: "3.12.1" + updateTime: '2025.12.12 10:34:08', + version: '3.12.1', } - wx.getRendererUserAgent = function() { + wx.getRendererUserAgent = function () { return new Promise((resolve) => { - resolve("Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.66(0x1800422a) NetType/WIFI Language/zh_CN MiniProgramEnv/iOS") + resolve( + 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.66(0x1800422e) NetType/WIFI Language/zh_CN', + ) }) } - wx.getSystemInfoSync = function() { + wx.getBatteryInfo = function () { + return new Promise((resolve) => { + resolve({ errMsg: 'getBatteryInfo:ok', isCharging: true, level: 100, isLowPowerModeEnabled: false }) + }) + } + + wx.getSystemInfo = function () { + return new Promise((resolve) => { + resolve({ + errMsg: 'getSystemInfo:ok', + safeArea: { bottom: 810, height: 763, top: 47, width: 390, left: 0, right: 390 }, + fontSizeSetting: 16, + notificationAuthorized: true, + locationEnabled: true, + batteryLevel: 100, + bluetoothEnabled: true, + fontSizeScaleFactor: 0.9411764705882353, + version: '8.0.66', + screenWidth: 390, + system: 'iOS 18.7.1', + pixelRatio: 3, + locationAuthorized: true, + model: 'iPhone 13', + windowHeight: 753, + phoneCalendarAuthorized: false, + microphoneEnabled: true, + wifiEnabled: true, + bluetoothAuthorized: true, + locationReducedAccuracy: false, + memorySize: 3665, + screenHeight: 844, + statusBarHeight: 47, + windowWidth: 390, + translateLanguage: 'zh_CN', + albumAuthorized: true, + notificationAlertAuthorized: true, + benchmarkLevel: 39, + notificationBadgeAuthorized: true, + language: 'zh_CN', + screenTop: 91, + notificationSoundAuthorized: true, + microphoneAuthorized: true, + cameraAuthorized: true, + deviceOrientation: 'portrait', + brand: 'iPhone', + platform: 'ios', + SDKVersion: '3.12.1', + enableDebug: true, + host: { env: 'WeChat', appId: 'wx938b41d0d7e8def0', version: 402670126 }, + mode: 'default', + appName: 'weixin', + devicePixelRatio: 3, + }) + }) + } + + wx.getSystemInfoSync = function () { return { - SDKVersion: "3.12.1", - albumAuthorized: true, - appName: "weixin", - batteryLevel: 20, - benchmarkLevel: -1, - bluetoothAuthorized: true, - bluetoothEnabled: true, - brand: "iPhone", - cameraAuthorized: true, - deviceOrientation: "portrait", - devicePixelRation: 2, - enableDebug: false, - fontSizeScaleFactor: 0.9411764705882353, + safeArea: { bottom: 810, height: 763, top: 47, width: 390, left: 0, right: 390 }, fontSizeSetting: 16, - host: { - appId: "wx938b41d0d7e8def0", - env: "WeChat", - version: 402670122 - }, - language: "zh_CN", - locationAuthorized: true, - locationEnabled: true, - locationReducedAccuracy: false, - memorySize: 2940, - microphoneAuthorized: true, - microphoneEnable: true, - mode: "default", - model: "iPad (9th generation) Wi-Fi", - notificationAlertAuthorized: true, notificationAuthorized: true, - notificationBadgeAuthorized: true, - notificationSoundAuthorized: true, - phoneCalendarAuthorized: false, - pixelRation: 2, - platform: "ios", - safeArea: { - bottom: 1080, - height: 1060, - left: 0, - right: 810, - top: 20, - width: 810 - }, - screenHeight: 1080, - screenTop: 0, - screenWidth: 810, - statusBarHeight: 20, - system: "iOS 18.5", - translateLanguage: "zh_CN", - version: "8.0.66", - wifiEnabled: true, - windowHeight: 1014, - windowWidth: 810 - } - } - - wx.getDeviceInfo = function() { - return { - benchmarkLevel: -1, - brand: "iPhone", - memorySize: 2940, - model: "iPad (9th generation) Wi-Fi", - platform: "ios", - system: "iOS 18.5" - } - } - - wx.getWindowInfo = function() { - return { - pixelRation: 2, - safeArea: { - bottom: 1080, - height: 1060, - left: 0, - right: 810, - top: 20, - width: 810 - }, - screenHeight: 1080, - screenWidth: 810, - statusBarHeight: 20, - windowHeight: 1014, - windowWidth: 810 - } - } - - wx.getAppBaseInfo = function() { - return { - SDKVersion: "3.12.1", - appName: "weixin", - enableDebug: false, + locationEnabled: true, + batteryLevel: 100, + bluetoothEnabled: true, fontSizeScaleFactor: 0.9411764705882353, - fontSizeSetting: 16, - host: { - appId: "wx938b41d0d7e8def0", - env: "WeChat", - version: 402670122 - }, - language: "zh_CN", - mode: "default", - translateLanguage: "zh_CN", - version: "8.0.66", + version: '8.0.66', + screenWidth: 390, + system: 'iOS 18.7.1', + pixelRatio: 3, + locationAuthorized: true, + model: 'iPhone 13', + windowHeight: 753, + phoneCalendarAuthorized: false, + microphoneEnabled: true, + wifiEnabled: true, + bluetoothAuthorized: true, + locationReducedAccuracy: false, + memorySize: 3665, + screenHeight: 844, + statusBarHeight: 47, + windowWidth: 390, + translateLanguage: 'zh_CN', + albumAuthorized: true, + notificationAlertAuthorized: true, + benchmarkLevel: 39, + notificationBadgeAuthorized: true, + language: 'zh_CN', + screenTop: 91, + notificationSoundAuthorized: true, + microphoneAuthorized: true, + cameraAuthorized: true, + deviceOrientation: 'portrait', + brand: 'iPhone', + platform: 'ios', + SDKVersion: '3.12.1', + enableDebug: true, + host: { env: 'WeChat', appId: 'wx938b41d0d7e8def0', version: 402670126 }, + mode: 'default', + appName: 'weixin', + devicePixelRatio: 3, } } - wx.getAccountInfoSync = function() { + wx.getDeviceInfo = function () { return { - miniProgram: { - appId: "wx938b41d0d7e8def0", - envVersion: "release", - version: "" - } + memorySize: 3665, + system: 'iOS 18.7.1', + model: 'iPhone 13', + benchmarkLevel: 39, + brand: 'iPhone', + platform: 'ios', } } + + wx.getWindowInfo = function () { + return { + screenTop: 91, + pixelRatio: 3, + safeArea: { bottom: 810, height: 763, top: 47, width: 390, left: 0, right: 390 }, + screenWidth: 390, + screenHeight: 844, + windowWidth: 390, + windowHeight: 753, + statusBarHeight: 47, + } + } + + wx.getAppBaseInfo = function () { + return { + fontSizeSetting: 16, + language: 'zh_CN', + fontSizeScaleFactor: 0.9411764705882353, + translateLanguage: 'zh_CN', + version: '8.0.66', + SDKVersion: '3.12.1', + enableDebug: true, + host: { env: 'WeChat', appId: 'wx938b41d0d7e8def0', version: 402670126 }, + mode: 'default', + appName: 'weixin', + } + } + + wx.getAccountInfoSync = function () { + return { miniProgram: { appId: 'wx938b41d0d7e8def0', envVersion: 'release', version: '5.2.23' } } + } } -setup(); \ No newline at end of file +function hook1() { + wx.version = { updateTime: '2025.12.12 10:34:08', version: '3.12.1' } + + wx.getRendererUserAgent = function () { + return new Promise((resolve) => { + resolve( + 'Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.66(0x1800422b) NetType/WIFI Language/zh_CN MiniProgramEnv/iOS', + ) + }) + } + + wx.getBatteryInfo = function () { + return new Promise((resolve) => { + resolve({ errMsg: 'getBatteryInfo:ok', isCharging: true, level: 100, isLowPowerModeEnabled: false }) + }) + } + + wx.getSystemInfo = function () { + return new Promise((resolve) => { + resolve({ + errMsg: 'getSystemInfo:ok', + safeArea: { bottom: 1080, height: 1060, top: 20, width: 810, left: 0, right: 810 }, + fontSizeSetting: 16, + notificationAuthorized: true, + locationEnabled: true, + batteryLevel: 100, + bluetoothEnabled: true, + fontSizeScaleFactor: 0.9411764705882353, + version: '8.0.66', + screenWidth: 810, + system: 'iOS 18.5', + pixelRatio: 2, + locationAuthorized: true, + model: 'iPad (9th generation) Wi-Fi', + windowHeight: 1003.3333333333334, + phoneCalendarAuthorized: false, + microphoneEnabled: true, + wifiEnabled: true, + bluetoothAuthorized: true, + locationReducedAccuracy: false, + memorySize: 2940, + screenHeight: 1080, + statusBarHeight: 20, + windowWidth: 810, + translateLanguage: 'zh_CN', + albumAuthorized: true, + notificationAlertAuthorized: true, + benchmarkLevel: -1, + notificationBadgeAuthorized: true, + language: 'zh_CN', + screenTop: 76.66666666666669, + notificationSoundAuthorized: true, + microphoneAuthorized: true, + cameraAuthorized: true, + deviceOrientation: 'portrait', + brand: 'iPhone', + platform: 'ios', + SDKVersion: '3.12.1', + enableDebug: true, + host: { env: 'WeChat', appId: 'wx938b41d0d7e8def0', version: 402670123 }, + mode: 'default', + appName: 'weixin', + devicePixelRatio: 2, + }) + }) + } + + wx.getSystemInfoSync = function () { + return { + safeArea: { bottom: 1080, height: 1060, top: 20, width: 810, left: 0, right: 810 }, + fontSizeSetting: 16, + notificationAuthorized: true, + locationEnabled: true, + batteryLevel: 85, + bluetoothEnabled: true, + fontSizeScaleFactor: 0.9411764705882353, + version: '8.0.66', + screenWidth: 810, + system: 'iOS 18.5', + pixelRatio: 2, + locationAuthorized: true, + model: 'iPad (9th generation) Wi-Fi', + windowHeight: 1003.3333333333334, + phoneCalendarAuthorized: false, + microphoneEnabled: true, + wifiEnabled: true, + bluetoothAuthorized: true, + locationReducedAccuracy: false, + memorySize: 2940, + screenHeight: 1080, + statusBarHeight: 20, + windowWidth: 810, + translateLanguage: 'zh_CN', + albumAuthorized: true, + notificationAlertAuthorized: true, + benchmarkLevel: -1, + notificationBadgeAuthorized: true, + language: 'zh_CN', + screenTop: 76.66666666666669, + notificationSoundAuthorized: true, + microphoneAuthorized: true, + cameraAuthorized: true, + deviceOrientation: 'portrait', + brand: 'iPhone', + platform: 'ios', + SDKVersion: '3.12.1', + enableDebug: true, + host: { env: 'WeChat', appId: 'wx938b41d0d7e8def0', version: 402670123 }, + mode: 'default', + appName: 'weixin', + devicePixelRatio: 2, + } + } + + wx.getDeviceInfo = function () { + return { + memorySize: 2940, + system: 'iOS 18.5', + model: 'iPad (9th generation) Wi-Fi', + benchmarkLevel: -1, + brand: 'iPhone', + platform: 'ios', + } + } + + wx.getWindowInfo = function () { + return { + screenTop: 76.66666666666669, + pixelRatio: 2, + safeArea: { bottom: 1080, height: 1060, top: 20, width: 810, left: 0, right: 810 }, + screenWidth: 810, + screenHeight: 1080, + windowWidth: 810, + windowHeight: 1003.3333333333334, + statusBarHeight: 20, + } + } + + wx.getAppBaseInfo = function () { + return { + fontSizeSetting: 16, + language: 'zh_CN', + fontSizeScaleFactor: 0.9411764705882353, + translateLanguage: 'zh_CN', + version: '8.0.66', + SDKVersion: '3.12.1', + enableDebug: true, + host: { env: 'WeChat', appId: 'wx938b41d0d7e8def0', version: 402670123 }, + mode: 'default', + appName: 'weixin', + } + } + + wx.getAccountInfoSync = function () { + return { miniProgram: { appId: 'wx938b41d0d7e8def0', envVersion: 'release', version: '5.2.23' } } + } +} + +setup() diff --git a/pages/custom/detail.js b/pages/custom/detail.js new file mode 100644 index 0000000..792e393 --- /dev/null +++ b/pages/custom/detail.js @@ -0,0 +1,534 @@ +const requireCustom = wx.requireCustom +const customRequest = requireCustom(9887) +// S.Jv 生成 returnUrl +const S = requireCustom(2012) +// ko.A.getOpenId 获取 openid +const ko = requireCustom(3816) +// Uo.JV 获取 dmChannel +const Uo = requireCustom(5059) +// 生成 s1-s7 的参数 +const Oo = requireCustom(3716) + +Page({ + data: { + id: '', + globalCode: 'ali.china.damai', + ttid: '#t#ip##_h5_2014', + getDetailParam: { + api: 'mtop.alibaba.detail.subpage.getdetail', + v: '2.0', + data: {}, + }, + detailResult: {}, + getCustomerListParam: { + api: 'mtop.damai.wireless.user.customerlist.get', + v: '2.0', + data: {}, + }, + customerListResult: [], + orderBuildParam: { + api: 'mtop.damai.trade.order.build.h5', + v: '1.0', + data: {}, + timeout: 15e3, + method: 'POST', + }, + orderBuildResult: {}, + orderCreateParam: { + api: 'mtop.damai.trade.order.create.h5', + v: '1.0', + data: {}, + timeout: 15e3, + method: 'POST', + }, + orderCreateResult: {}, + dataTags: {}, + viewDetail: { + mainImg: '', + status: '', + title: '', + time: '', + location: '', + price: '', + skuList: [], + }, + selectedSku: '', + selectedCustomer: [], + customerList: [], + cd: { + days: '0', + hours: '00', + minutes: '00', + seconds: '00', + }, + sellStartTime: '', + reBuildOrderCount: 0, + }, + onLoad(options) { + if (!options.id) { + this.showToast('没有项目 ID') + return + } + + this.setData({ + id: options.id, + }) + }, + + async onShow() { + if (!this.data.id) { + return + } + + // 获取演出详情 + let result = await this.getDetail() + + if (result[0]) { + this.showToast(result[0].message) + return + } + + let resultData = result[1] + this.setData({ + detailResult: resultData, + }) + + const { itemBasicInfo, itemBuyBtn, perform } = resultData + + // 获取观演人 + result = await this.getCustomerList() + + if (result[0]) { + this.showToast(result[0].message) + return + } + + resultData = result[1] + this.setData({ + customerListResult: resultData, + }) + + const viewDetail = { + mainImg: itemBasicInfo.mainImageUrl, + status: itemBuyBtn.btnText, + title: itemBasicInfo.itemTitle, + time: perform.performName, + location: itemBasicInfo.venueName, + price: itemBasicInfo.priceRange, + skuList: perform.skuList, + } + + this.setData({ + viewDetail, + selectedSku: perform.skuList[0].skuId, + customerList: resultData, + sellStartTime: itemBuyBtn.sellStartTime || '', + }) + + this.startCountdown(this.data.sellStartTime) + }, + onUnload() { + this.stopCountdown() + }, + onHide() { + this.stopCountdown() + }, + getDetail() { + const param = { + bizCode: 'ali.china.damai', + scenario: 'itemsku', + itemId: this.data.id, + exParams: JSON.stringify({ + dataType: 4, + dataId: '', + activityId: '', + }), + } + + return new customRequest.p({ + ...this.data.getDetailParam, + ...param, + }).create() + }, + getCustomerList() { + const param = { + customerType: 'default', + platform: '42', + comboChannel: '4', + } + + return new customRequest.p({ + ...this.data.getCustomerListParam, + ...param, + }).create() + }, + buildOrder() { + const { itemBasicInfo, actionControl } = this.data.detailResult + const { reBuildOrderCount, selectedCustomer, selectedSku, ttid, orderBuildParam, globalCode } = this.data + + if (!itemBasicInfo.t) { + return [ + { + message: '没有t', + }, + ] + } + if (selectedCustomer.length == 0) { + return [ + { + message: '请选择观演人', + }, + ] + } + + const { tradeControl } = actionControl + const exParams = { + channel: 'damai_app', + damai: '1', + umpChannel: '100031002', + subChannel: 'damai@weixin_weapp', + atomSplit: 1, + signKey: itemBasicInfo.t, + rtc: tradeControl.rtc ? 1 : 0, + } + + const personCount = selectedCustomer.length + const param = { + buyNow: true, + exParams: JSON.stringify({ + ...exParams, + serviceVersion: '2.0.0', + customerType: 'default', + }), + buyParam: itemBasicInfo.itemId + '_' + personCount + '_' + selectedSku, + } + + this.setData({ + dataTags: param, + }) + + const currentPages = getCurrentPages() + const lastE = currentPages.length - 1 + currentPages[lastE].options = { + ...param, + exParams: JSON.stringify({ + ...exParams, + subChannel: 'weapp@damai_h5', + }), + spm: 'a2obt.project.bottom.dbuy', + } + + return new customRequest.p({ + ...orderBuildParam, + ...param, + ext_querys: { + ttid: ttid, + }, + headers: { + globalCode: globalCode, + }, + ext_headers: { + globalCode: globalCode, + }, + }).create() + }, + async createOrder() { + const { detailResult, orderBuildResult, dataTags, selectedCustomer, customerList, selectedSku } = this.data + const { itemBasicInfo, perform } = detailResult + const { global, hierarchy, data, linkage } = orderBuildResult + + const step1 = { + subChannel: Uo.JV(), + returnUrl: S.Jv({ + page: 'shows_pay_result', + query: { + itemId: itemBasicInfo.itemId, + }, + }), + serviceVersion: '2.0.0', + wxOpenId: ko.A.getOpenId(), + } + + const quantity = selectedCustomer.length + const step2 = { + $taroTimestamp: Date.now(), + ...dataTags, + isQuickBuy: false, + isSpliceOrder: false, + itemId: itemBasicInfo.itemId, + quantity: quantity, + skuId: selectedSku, + spm: 'a2obt.project.buttom.dbuy', + } + + const step2DataTags = this.genDataTags(step2) + if (step2DataTags) { + step1.dataTags = step2DataTags + } + + const { structure } = hierarchy + const blocks = structure.dmViewerBlock_DmViewerBlock + const compName = blocks[blocks.length - 1] + data[compName]['componentDataName'] = compName + data[compName]['componentType'] = 'dmviewer' + data[compName]['inParentIndex'] = 1 + data[compName]['isInParentLastIndex'] = true + data[compName]['parentComponentName'] = 'dmViewerBlock_DmViewerBlock' + data[compName]['submit'] = true + data[compName].fields.selectedNum = quantity + + const indices = selectedCustomer.map((id) => customerList.findIndex((obj) => obj.identityHash == id)) + + for (let i = 0; i < indices.length; i++) { + const index = indices[i] + data[compName].fields.viewerList[index].isUsed = true + } + + const requestData = { + params: JSON.stringify({ + data: JSON.stringify(data), + linkage: JSON.stringify({ + common: linkage.common, + signature: linkage.signature, + }), + hierarchy: JSON.stringify({ + structure: hierarchy.structure, + }), + }), + feature: JSON.stringify(step1), + } + + requestData[global.secretKey] = global.secretValue + + const s17 = await Oo.A.getWasmHeader(itemBasicInfo.itemId) + + const h = JSON.stringify({ + ...s17, + ...JSON.parse(requestData.feature), + }) + + const v = { + ...requestData, + feature: h, + } + + const param = { + ...this.data.orderCreateParam, + } + + const querys = { + isSec: 1, + AntiCreep: true, + ttid: this.data.ttid, + tb_eagleeyex_scm_project: '20190509-aone2-join-test', + } + + querys[global.secretKey] = global.secretValue + + return new customRequest.p({ + ...this.data.orderBuildParam, + ...param, + data: v, + ext_querys: querys, + headers: { + globalCode: this.data.globalCode, + }, + ext_headers: { + globalCode: this.data.globalCode, + }, + }).create() + }, + async goPay() { + const { itemBasicInfo } = this.data.detailResult + + const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); + + if (!itemBasicInfo.t) { + console.log('没有t') + + // 获取演出详情 + let result = await this.getDetail() + + if (result[0]) { + this.showToast(result[0].message) + return + } + + let resultData = result[1] + this.setData({ + detailResult: resultData, + }) + + await sleep(200); + console.log('重试') + await this.goPay(); + + return; + } + + let buildOrderResult = await this.buildOrder() + + if (buildOrderResult[0]) { + this.showToast(buildOrderResult[0].message) + await sleep(200); + console.log('重试') + await this.goPay(); + return + } + + this.setData({ + orderBuildResult: buildOrderResult[1], + }) + + let createOrderResult = await this.createOrder() + + if (createOrderResult[0]) { + this.showToast(createOrderResult[0].message) + return + } + + this.setData({ + orderCreateResult: createOrderResult[1], + }) + + const payInfo = JSON.parse(decodeURIComponent(createOrderResult[1].alipayWapCashierUrl)) + + wx.requestPayment({ + signType: 'MD5', + timeStamp: payInfo.timeStamp + '', + nonceStr: payInfo.nonceStr, + package: payInfo.package, + paySign: payInfo.paySign, + success: function (e) { + if ('requestPayment:ok' === e.errMsg) { + wx.showToast({ title: '支付成功', icon: 'none' }) + } else { + wx.showToast({ title: '支付失败', icon: 'none' }) + } + }, + fail: function () { + wx.showToast({ title: '拉起支付失败', icon: 'none' }) + }, + }) + }, + showToast(msg) { + wx.showToast({ + title: msg, + icon: 'none', + }) + }, + onSelectSku(e) { + const id = e.currentTarget.dataset.id + this.setData({ + selectedSku: id, + }) + }, + // 点击整行切换选中 + onToggleSelect(e) { + const index = e.currentTarget.dataset.index + const options = this.data.customerList.slice() + const item = options[index] + + item['checked'] = item.checked == undefined ? false : item.checked + item['checked'] = !item['checked'] + options[index] = item + + const selectedIds = options.filter((x) => x.checked).map((x) => x.identityHash) + + this.setData({ + customerList: options, + selectedCustomer: selectedIds, + }) + }, + startCountdown(rawTs) { + this.stopCountdown() + + const target = this.normalizeTimestamp(rawTs) + if (!target) return + + // 先立刻刷新一次,避免首次渲染延迟 1s + this.tickCountdown(target) + + this._cdTimer = setInterval(() => { + this.tickCountdown(target) + }, 1000) + }, + stopCountdown() { + if (this._cdTimer) { + clearInterval(this._cdTimer) + this._cdTimer = null + } + }, + tickCountdown(targetMs) { + const now = Date.now() + let diff = targetMs - now + + if (diff <= 0) { + // 归零并触发结束回调 + this.setData({ + cd: { days: '0', hours: '00', minutes: '00', seconds: '00' }, + }) + this.stopCountdown() + this.onCountdownFinish() // 自动执行方法 + return + } + + const totalSeconds = Math.floor(diff / 1000) + + const days = Math.floor(totalSeconds / (24 * 3600)) + const remain1 = totalSeconds % (24 * 3600) + const hours = Math.floor(remain1 / 3600) + const remain2 = remain1 % 3600 + const minutes = Math.floor(remain2 / 60) + const seconds = remain2 % 60 + + this.setData({ + cd: { + days: String(days), + hours: this.pad2(hours), + minutes: this.pad2(minutes), + seconds: this.pad2(seconds), + }, + }) + }, + normalizeTimestamp(ts) { + const n = Number(ts) + if (!Number.isFinite(n) || n <= 0) return null + + // 10位通常是秒级;13位通常是毫秒级 + // 这里用阈值判断:小于 1e12 认为是秒 + return n < 1e12 ? n * 1000 : n + }, + pad2(n) { + return n < 10 ? '0' + n : String(n) + }, + // 倒计时结束后自动执行的方法(你把业务逻辑写这里) + onCountdownFinish() { + // 示例:倒计时结束后执行你的动作 + // 1) 变更状态 + // 2) 刷新票档/库存 + // 3) 弹窗提示 + this.showToast('倒计时结束') + + // TODO:你自己的逻辑 + // this.refreshSkus(); + this.setData({ + sellStartTime: '', + }) + + // this.goPay() + }, + genDataTags(param) { + const result = [] + + if (param.utm) { + result.push('utm:'.concat(param.utm)) + } + + if (param.sqm) { + result.push('sqm:'.concat(param.sqm)) + } + + return result.length > 0 ? result.join(';') : '' + }, +}) diff --git a/pages/custom/detail.json b/pages/custom/detail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/custom/detail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/custom/detail.wxml b/pages/custom/detail.wxml new file mode 100644 index 0000000..b479807 --- /dev/null +++ b/pages/custom/detail.wxml @@ -0,0 +1,91 @@ + + + + + {{viewDetail.status}} + + + + + {{viewDetail.title}} + {{viewDetail.time}} + {{viewDetail.location}} + + + + + {{viewDetail.price}} + + + + + + + + 距离开售 + 倒计时 + + + + + {{cd.days}} + + + + + {{cd.hours}} + + + + + {{cd.minutes}} + + + + + {{cd.seconds}} + + + + + + + + + + + + + + + {{item.priceName}} {{ item.otherTag ? '(' + item.otherTag.tagDesc + ')' : '' }} + + + + + + + + 请选择 + 已选 {{selectedCustomer.length}} 项 + + + + + + + {{item.maskedName}} + {{item.identityNo}} + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/custom/detail.wxss b/pages/custom/detail.wxss new file mode 100644 index 0000000..310da64 --- /dev/null +++ b/pages/custom/detail.wxss @@ -0,0 +1,197 @@ +.page { + min-height: 100vh; + background: #eee; +} + +.card { + padding: 32rpx; + background: #fff; + + margin-top: 32rpx; +} + +.section { + display: flex; + gap: 16rpx; +} + +.card .img-wrapper { + position: relative; +} + +.card .status-tag { + position: absolute; + top: 8rpx; + right: 8rpx; + + padding: 4rpx 10rpx; + font-size: 22rpx; + line-height: 1.2; + + color: #fff; + background: rgba(0, 0, 0, 0.65); + + border-radius: 6rpx; + white-space: nowrap; +} + +.card .img-wrapper image { + width: 180rpx; + height: 220rpx; + border-radius: 12rpx; + background: #eaeaea; + flex-shrink: 0; +} + +.card .right { + display: flex; + flex-direction: column; + + justify-content: space-around; +} + +.card .right .top { + display: flex; + flex-direction: column; + gap: 4rpx; +} + +.card .right .top .title { + font-weight: 700; +} + +.card .right .top .meta { + font-size: 24rpx; +} + +.card .right .bottom .price { + font-size: 30rpx; + color: #ff4d4f; +} + +.type-group { + margin-top: 16rpx; + display: flex; + flex-wrap: wrap; + gap: 14rpx; +} + +.type-btn { + padding: 16rpx 22rpx; + border-radius: 999rpx; + background: #f3f4f6; + color: #333; + font-size: 26rpx; + line-height: 1; + border: 2rpx solid transparent; + box-sizing: border-box; +} + +.type-btn-active { + background: #fff0f0; + border-color: #ff4d4f; + color: #ff4d4f; + font-weight: 700; +} + +.multi-list { + margin-top: 12rpx; + display: flex; + flex-direction: column; +} + +.multi-item { + padding: 18rpx 6rpx; + display: flex; + align-items: center; + justify-content: space-between; + border-top: 1rpx solid #f0f0f0; +} + +.multi-item:first-child { + border-top: none; +} + +.multi-left { + flex: 1; + display: flex; + flex-direction: column; + gap: 8rpx; + padding-right: 16rpx; + box-sizing: border-box; +} + +.multi-title { + font-size: 30rpx; + font-weight: 700; + color: #111; + line-height: 1.4; +} + +.multi-sub { + font-size: 24rpx; + color: #666; + line-height: 1.4; +} + +.multi-right { + width: 76rpx; + display: flex; + justify-content: flex-end; +} + +.check { + width: 44rpx; + height: 44rpx; + border-radius: 999rpx; + border: 2rpx solid #cfcfcf; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; +} + +.check-on { + border-color: #ff4d4f; + background: #fff0f0; +} + +.check-mark { + font-size: 28rpx; + line-height: 1; + color: #ff4d4f; + font-weight: 800; +} + +.multi-disabled { + opacity: 0.5; +} + +.countdown { + margin-top: 16rpx; + display: flex; + gap: 18rpx; + align-items: center; +} + +.cd-block { + display: flex; + align-items: baseline; + gap: 8rpx; + padding: 14rpx 16rpx; + background: #f3f4f6; + border-radius: 16rpx; +} + +.cd-num { + font-size: 36rpx; + font-weight: 900; + color: #111; + min-width: 40rpx; + text-align: center; +} + +.cd-unit { + font-size: 24rpx; + color: #666; +} \ No newline at end of file diff --git a/pages/custom/index.js b/pages/custom/index.js index 13fbd0c..8875d06 100644 --- a/pages/custom/index.js +++ b/pages/custom/index.js @@ -1,40 +1,17 @@ -const requireCustom = wx.requireCustom; -const customRequest = requireCustom(9887); -const Ay = requireCustom(4752).Ay; +const requireCustom = wx.requireCustom +const customRequest = requireCustom(9887) +// S.Jv 生成 returnUrl +const S = requireCustom(2012) +// ko.A.getOpenId 获取 openid +const ko = requireCustom(3816) +// Uo.JV 获取 dmChannel +const Uo = requireCustom(5059) +// 生成 s1-s7 的参数 +const Oo = requireCustom(3716) Page({ data: { - globalCode: 'ali.china.damai', - ttid: '#t#ip##_h5_2014', - getDetailParam: { - api: 'mtop.alibaba.detail.subpage.getdetail', - v: '2.0', - data: {} - }, - detailResult: {}, - ticketPriceParam: { - api: 'mtop.damai.item.calcTicketPrice', - v: '2.0', - method: 'GET', - data: {} - }, - ticketPriceResult: {}, - orderBuildParam: { - api: 'mtop.damai.trade.order.build.h5', - v: '1.0', - data: {}, - timeout: 15e3, - method: 'POST' - }, - orderBuildResult: {}, - orderCreateParam: { - api: 'mtop.damai.trade.order.create.h5', - v: '1.0', - data: {}, - timeout: 15e3, - method: 'POST' - }, - orderCreateResult: {} + }, async onLoad(options) { let detailResult = await this.getDetail('1001240724661') @@ -45,21 +22,21 @@ Page({ } this.setData({ - detailResult: detailResult[1] + detailResult: detailResult[1], }) - let ticketPrice = await this.calcTicketPrice(); + // let ticketPrice = await this.calcTicketPrice() - if (ticketPrice[0]) { - this.showToast(ticketPrice[0].message) - return - } + // if (ticketPrice[0]) { + // this.showToast(ticketPrice[0].message) + // return + // } - this.setData({ - ticketPriceResult: ticketPrice[1] - }) + // this.setData({ + // ticketPriceResult: ticketPrice[1], + // }) - let orderBuildResult = await this.buildOrder(); + let orderBuildResult = await this.buildOrder() if (orderBuildResult[0]) { this.showToast(orderBuildResult[0].message) @@ -67,23 +44,46 @@ Page({ } this.setData({ - orderBuildResult: orderBuildResult[1] + orderBuildResult: orderBuildResult[1], }) - console.log(this.data.orderBuildResult) + let createOrderResult = await this.createOrder() + + if (createOrderResult[0]) { + this.showToast(createOrderResult[0].message) + return + } + + this.setData({ + orderCreateResult: createOrderResult[1], + }) + + const payInfo = JSON.parse(decodeURIComponent(createOrderResult[1].alipayWapCashierUrl)) + + wx.requestPayment({ + signType: 'MD5', + timeStamp: payInfo.timeStamp + '', + nonceStr: payInfo.nonceStr, + package: payInfo.package, + paySign: payInfo.paySign, + success: function (e) { + if ('requestPayment:ok' === e.errMsg) { + wx.showToast({ title: '支付成功', icon: 'none' }) + } else { + wx.showToast({ title: '支付失败', icon: 'none' }) + } + }, + fail: function () { + wx.showToast({ title: '拉起支付失败', icon: 'none' }) + }, + }) }, - onReady() { + onReady() {}, - }, + onShow() {}, - onShow() { - - }, - - onHide() { - - }, + onHide() {}, showToast(msg) { wx.showToast({ title: msg, @@ -98,101 +98,205 @@ Page({ exParams: JSON.stringify({ dataType: 4, dataId: '', - activityId: '' - }) + activityId: '', + }), } return new customRequest.p({ ...this.data.getDetailParam, - ...param - }).create(); + ...param, + }).create() }, calcTicketPrice() { - const calculatePriceControl = this.data.detailResult.actionControl.calculatePriceControl; - const itemBasicInfo = this.data.detailResult.itemBasicInfo; - const perform = this.data.detailResult.perform; - const sku = perform.skuList[perform.skuList.length - 1]; - + const calculatePriceControl = this.data.detailResult.actionControl.calculatePriceControl + const itemBasicInfo = this.data.detailResult.itemBasicInfo + const perform = this.data.detailResult.perform + const sku = perform.skuList[perform.skuList.length - 1] const param = { itemId: itemBasicInfo.itemId, performId: perform.performId, calculateTag: calculatePriceControl.calculateTag, - skuParamListJson: JSON.stringify([{ - priceId: sku.priceId, - price: Number(sku.price), - count: 1, - }]), - exParams: {} + skuParamListJson: JSON.stringify([ + { + priceId: sku.priceId, + price: Number(sku.price), + count: 1, + }, + ]), + exParams: {}, } return new customRequest.p({ ...this.data.ticketPriceParam, - ...param - }).create(); + ...param, + }).create() }, buildOrder() { - const itemBasicInfo = this.data.detailResult.itemBasicInfo; - const perform = this.data.detailResult.perform; + const itemBasicInfo = this.data.detailResult.itemBasicInfo + const perform = this.data.detailResult.perform + const exParams = { + channel: 'damai_app', + damai: '1', + umpChannel: '100031002', + subChannel: 'damai@weixin_weapp', + atomSplit: 1, + signKey: itemBasicInfo.t, + rtc: this.data.detailResult.actionControl.tradeControl.rtc ? 1 : 0, + } const param = { buyNow: true, exParams: JSON.stringify({ - channel: 'damai_app', - damai: '1', - umpChannel: '100031002', - subChannel: 'damai@weixin_weapp', - atomSplit: 1, - signKey: itemBasicInfo.t, - rtc: this.data.detailResult.actionControl.tradeControl.rtc ? 1 : 0, + ...exParams, serviceVersion: '2.0.0', customerType: 'default', }), - buyParam: itemBasicInfo.itemId + '_' + 1 + '_' + perform.skuList[0].skuId + buyParam: itemBasicInfo.itemId + '_' + 1 + '_' + perform.skuList[0].skuId, + } + + this.setData({ + dataTags: param, + }) + + const currentPages = getCurrentPages() + const lastE = currentPages.length - 1 + currentPages[lastE].options = { + ...param, + exParams: JSON.stringify({ + ...exParams, + subChannel: 'weapp@damai_h5', + }), + spm: 'a2obt.project.bottom.dbuy', } return new customRequest.p({ ...this.data.orderBuildParam, ...param, ext_querys: { - ttid: this.data.ttid + ttid: this.data.ttid, }, headers: { globalCode: this.data.globalCode, }, ext_headers: { globalCode: this.data.globalCode, - } - }).create(); + }, + }).create() }, - createOrder() { - const global = this.data.orderBuildResult.global; - const param = { + async createOrder() { + const itemBasicInfo = this.data.detailResult.itemBasicInfo + const perform = this.data.detailResult.perform + const buildResult = this.data.orderBuildResult + const global = buildResult.global + const step1 = { + subChannel: Uo.JV(), + returnUrl: S.Jv({ + page: 'shows_pay_result', + query: { + itemId: itemBasicInfo.itemId, + }, + }), + serviceVersion: '2.0.0', + wxOpenId: ko.A.getOpenId(), + } + + const step2 = { + $taroTimestamp: Date.now(), + ...this.data.dataTags, + isQuickBuy: false, + isSpliceOrder: false, + itemId: itemBasicInfo.itemId, + quantity: '1', + skuId: perform.skuList[0].skuId, + spm: 'a2obt.project.buttom.dbuy', + } + + const dataTags = this.genDataTags(step2) + if (dataTags) { + step1.dataTags = dataTags + } + + const blocks = buildResult.hierarchy.structure.dmViewerBlock_DmViewerBlock + const compName = blocks[blocks.length - 1] + const data = buildResult.data + data[compName]['componentDataName'] = compName + data[compName]['componentType'] = 'dmviewer' + data[compName]['inParentIndex'] = 1 + data[compName]['isInParentLastIndex'] = true + data[compName]['parentComponentName'] = 'dmViewerBlock_DmViewerBlock' + data[compName]['submit'] = true + data[compName].fields.selectedNum = 1 + data[compName].fields.viewerList[6].isUsed = true + + const requestData = { + params: JSON.stringify({ + data: JSON.stringify(data), + linkage: JSON.stringify({ + common: buildResult.linkage.common, + signature: buildResult.linkage.signature, + }), + hierarchy: JSON.stringify({ + structure: buildResult.hierarchy.structure, + }), + }), + feature: JSON.stringify(step1), + } + + requestData[global.secretKey] = global.secretValue + + const s17 = await Oo.A.getWasmHeader(itemBasicInfo.itemId) + + const h = JSON.stringify({ + ...s17, + ...JSON.parse(requestData.feature), + }) + + console.log('h', h) + + const v = { + ...requestData, + feature: h, + } + + const param = { + ...this.data.orderCreateParam, } const querys = { isSec: 1, AntiCreep: true, ttid: this.data.ttid, - tb_eagleeyex_scm_project: '20190509-aone2-join-test' + tb_eagleeyex_scm_project: '20190509-aone2-join-test', } - querys[global.secretKey] = global.secretValue; + querys[global.secretKey] = global.secretValue return new customRequest.p({ ...this.data.orderBuildParam, ...param, - data: {}, - ext_querys: { - ttid - }, + data: v, + ext_querys: querys, headers: { - globalCode, + globalCode: this.data.globalCode, }, ext_headers: { - globalCode - } - }).create(); - } -}) \ No newline at end of file + globalCode: this.data.globalCode, + }, + }).create() + }, + genDataTags(param) { + const result = [] + + if (param.utm) { + result.push('utm:'.concat(param.utm)) + } + + if (param.sqm) { + result.push('sqm:'.concat(param.sqm)) + } + + return result.length > 0 ? result.join(';') : '' + }, +}) diff --git a/pages/custom/index.wxml b/pages/custom/index.wxml index 8652952..e69de29 100644 --- a/pages/custom/index.wxml +++ b/pages/custom/index.wxml @@ -1,2 +0,0 @@ - -pages/custom/index.wxml \ No newline at end of file diff --git a/pages/custom/search.js b/pages/custom/search.js new file mode 100644 index 0000000..d1805a6 --- /dev/null +++ b/pages/custom/search.js @@ -0,0 +1,105 @@ +const requireCustom = wx.requireCustom +const customRequest = requireCustom(9887) +const utils = requireCustom(1395); + +Page({ + data: { + keyword: '', + searched: false, + results: [], + searchParam: { + api: 'mtop.damai.mec.aristotle.get', + v: '3.0', + data: {}, + }, + }, + + onKeywordInput(e) { + this.setData({ keyword: e.detail.value }) + }, + + async onSearch() { + const keyword = (this.data.keyword || '').trim() + this.setData({ searched: true }) + + const param = { + args: JSON.stringify({ + pageNo: 1, + keyword: keyword, + comboDamaiCityId: 852, + comboChannel: 4, + }), + patternName: 'searchHome', + patternVersion: '5.3' + } + + const config = { + downgradeOpt: { + reqParam: { + pageIndex: 1, + patternName: 'searchHome', + patternVersion: '5.3', + urlElements: ['searchHome', '5.3', 'bak', 4, '3.0', keyword], + useCdnWhenNodesNull: false + } + } + } + + const result = await this.buildSearchRequest(param, config) + + if (result[0]) { + wx.showToast({ + title: result[0].message, + icon: 'none' + }) + return; + } + + const data = result[1]; + const nodes = data.nodes; + const nodesLevel1 = nodes[0] + const nodesLevel2 = nodesLevel1.nodes + + if (!nodesLevel2[0].nodes) { + this.setData({ + results: [] + }) + wx.showToast({ + title: '没有搜到对应的演出~', + icon: 'none' + }) + return + } + + const nodesLevel3 = nodesLevel2[0].nodes; + const resultNodes = []; + + for (let i = 0; i < nodesLevel3.length; i++) { + const nodeData = nodesLevel3[i].data; + resultNodes.push({ + id: nodeData.id, + imageUrl: nodeData.verticalPic, + title: nodeData.cityName + '|' + nodeData.name, + time: nodeData.showTime, + location: nodeData.cityName + ' ' + nodeData.venueName, + price: nodeData.priceStr, + statusText: nodeData.showStatus.desc + }); + } + + this.setData({ + results: resultNodes + }) + }, + onItemTap(e) { + const id = e.currentTarget.dataset.id + wx.navigateTo({ url: `/pages/custom/detail?id=${id}` }); + }, + buildSearchRequest(param, config) { + return new customRequest.p({ + ...this.data.searchParam, + ...param, + downgradeConfig: config + }).create(); + } +}) diff --git a/pages/custom/search.json b/pages/custom/search.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/custom/search.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/custom/search.wxml b/pages/custom/search.wxml new file mode 100644 index 0000000..5a70743 --- /dev/null +++ b/pages/custom/search.wxml @@ -0,0 +1,49 @@ + + + + + + + + + + + + 没有相关项目 + + + + + + + + + + + + {{item.statusText}} + + + + + + + + {{item.title}} + {{item.time}} + {{item.location}} + + + + + ¥{{item.price}} + + + + + + + + + \ No newline at end of file diff --git a/pages/custom/search.wxss b/pages/custom/search.wxss new file mode 100644 index 0000000..7870fd2 --- /dev/null +++ b/pages/custom/search.wxss @@ -0,0 +1,173 @@ +.page { + height: 100vh; + display: flex; + flex-direction: column; + background: #f7f7f7; +} + +/* 上部分:搜索栏 */ +.top { + padding: 16rpx; + background: #ffffff; + display: flex; + gap: 16rpx; + align-items: center; + box-sizing: border-box; + border-bottom: 1rpx solid #eeeeee; +} + +.search-input { + flex: 1; + height: 72rpx; + padding: 0 20rpx; + background: #f3f4f6; + border-radius: 12rpx; + box-sizing: border-box; + font-size: 28rpx; +} + +.search-btn { + height: 72rpx; + line-height: 72rpx; + padding: 0 28rpx; + border-radius: 12rpx; + font-size: 28rpx; +} + +/* 下部分:结果区 */ +.bottom { + flex: 1; + position: relative; + padding: 16rpx; + box-sizing: border-box; +} + +.list { + height: 100%; +} + +/* 无结果:正中央 */ +.empty { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + color: #999999; + font-size: 28rpx; +} + +/* 列表项 */ +.item { + background: #ffffff; + border-radius: 16rpx; + + /* 原来是 16rpx,这里加大 */ + padding: 24rpx; + + display: flex; + gap: 20rpx; + margin-bottom: 20rpx; + box-sizing: border-box; +} + +/* 左边图片 */ +.item-img { + width: 180rpx; + height: 180rpx; + border-radius: 12rpx; + background: #eaeaea; + flex-shrink: 0; +} + +/* 右边区域:上下两部分 */ +.item-right { + flex: 1; + display: flex; + flex-direction: column; + + /* 原来是 space-between,这里保留 */ + justify-content: space-between; + + /* 增加最小高度,跟随图片 */ + min-height: 200rpx; +} + +.item-top { + display: flex; + flex-direction: column; + + /* 原来 gap: 8rpx,稍微拉开 */ + gap: 12rpx; +} + +.title { + font-size: 32rpx; + font-weight: 600; + color: #222222; + line-height: 1.5; + + /* 多行换行显示 */ + white-space: normal; + word-break: break-all; + + /* 限制最多显示 2 行(可按需改为 3 行) */ + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + + overflow: hidden; + +} + +.meta { + font-size: 26rpx; + color: #666666; + line-height: 1.4; +} + +/* 右下:价格 */ +.item-bottom { + padding-top: 12rpx; + display: flex; + justify-content: flex-end; + align-items: flex-end; +} + +.price { + font-size: 36rpx; + font-weight: 700; + color: #ff4d4f; +} + +/* 图片包裹层,用于绝对定位 */ +.img-wrapper { + position: relative; + width: 200rpx; + height: 200rpx; + flex-shrink: 0; +} + +/* 保持图片原样 */ +.item-img { + width: 100%; + height: 100%; + border-radius: 12rpx; + background: #eaeaea; +} + +/* 右上角状态矩形 */ +.status-tag { + position: absolute; + top: 8rpx; + right: 8rpx; + + padding: 4rpx 10rpx; + font-size: 22rpx; + line-height: 1.2; + + color: #ffffff; + background: rgba(0, 0, 0, 0.65); + + border-radius: 6rpx; + white-space: nowrap; +} diff --git a/pages/search/index.js b/pages/search/index.js index bfea0a0..0ae25ad 100644 --- a/pages/search/index.js +++ b/pages/search/index.js @@ -3057,7 +3057,12 @@ var e = require("../../@babel/runtime/helpers/slicedToArray"), case 2: Jn = e.v; case 3: - return c = (r = Jn || {}).longitude, d = r.latitude, u = f === p.ALL ? "5.3" : "5.0", m = f === p.TRAVEL ? "1.0" : u, e.n = 4, En({ + c = (r = Jn || {}).longitude + d = r.latitude + u = f === p.ALL ? "5.3" : "5.0" + m = f === p.TRAVEL ? "1.0" : u + e.n = 4 + return En({ args: JSON.stringify({ pageNo: lt[f], pageSize: f === p.ALL ? void 0 : 15, diff --git a/pages/webview/index.js b/pages/webview/index.js index 9d4168b..9dcd42f 100644 --- a/pages/webview/index.js +++ b/pages/webview/index.js @@ -1 +1,686 @@ -require("../../@babel/runtime/helpers/Arrayincludes"),(wx.webpackJsonp=wx.webpackJsonp||[]).push([[4396],{7702:function(e,n,r){var a=r(4160),t=r(5652),i=r(2555),o=r(4576),s=r(3523),c=r(469),u=r(29),l=(0,r(5517).A)((function e(){(0,u.A)(this,e),this.messages=[],this.actionList=[]}),[{key:"handleMessages",value:function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=(0,c.A)(n);try{for(r.s();!(e=r.n()).done;){var a=e.value;if("share"===a.type)this.messages.push(a);else{var t,i=(0,c.A)(this.actionList);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.type===a.type&&o.handle(a.data)}}catch(e){i.e(e)}finally{i.f()}}}}catch(e){r.e(e)}finally{r.f()}}},{key:"getShareMessageData",value:function(e){for(var n=null,r=this.messages.length-1;r>=0;r--){var a=this.messages[r];if(e===a.data.originUrl){n=a;break}}return n?n.data:null}},{key:"addAction",value:function(e){this.actionList.push(e)}}]),d=r(3816),f=r(4911),m=r(7422),v=r(3150),h=r(104),p=r(9148),g=r(2658),w=r(6432),A=function(e){if(e){var n=((0,w.Jt)("cdnGlobalConfig")||{}).shareConfigList,r=void 0===n?[]:n,a=r.findLastIndex((function(n){var r=n.channel,a=n.path,t=new RegExp(a,"g");return"damai_wechat"===r&&t.test(e)}));return-1!==a?r[a]:void 0}},y=r(4269),b=r(758),U=r(2573),k=r.n(U),x=r(5765),J=r(6516),V=r(9294),L=r(9933),S=function(){var e=(0,i.A)((0,t.A)().m((function e(){var n,r,a,i,s,c,u,l,d;return(0,t.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,V.A.getEncryptUserInfo();case 1:if(n=e.v,r=(0,o.A)(n,2),a=r[0],i=r[1],!a){e.n=2;break}return k().showToast({title:"获取用户信息异常,请稍后再试",icon:"none"}),e.a(2,null);case 2:return c=(s=i||{}).encryptUserNick,u=s.encryptUserId,l=s.headImgUrl,d=s.domainId,e.a(2,{nickName:k().arrayBufferToBase64((0,p.UG)(c)),openId:u,avatar:(0,L.zp)({url:l}),applicationId:d});case 3:return e.p=3,e.v,e.a(2,null)}}),e,null,[[0,3]])})));return function(){return e.apply(this,arguments)}}(),W=r(7884),O="",Z=["/shows/orders.html","/shows/ticket/list.html","/shows/ticket/detail.html","/shows/pages/my-comment.html","/shows/pages/save-comment.html","/movies/coupons/list.html","/shows/mine/certificate.html","/shows/mine/audience.html","/shows/pages/address-list.html","/shows/mine/feedback.html","/shows/mine/follow.html","/damai/activity/waitcomment/index.html","/moviemine/pages/coupon-list/index.html","/damai/mine/certificate/index.html","/damai/activity/savecomment/index.html"],R=["/shows/pages/show-calendar.html"],I=function(e){try{var n=new x.g(e),r=null==n?void 0:n.pathname,a=null==n?void 0:n.hostname,t=null==n?void 0:n.params,i="yes"===(null==t?void 0:t.has_login),o=Z.indexOf(r)>-1||"yes"===(null==t?void 0:t.free_login),s=R.indexOf(r)>-1,c=g.aS.some((function(n){return"string"==typeof e&&e.includes(n)})),u=/ai-alimebot\.lydaas\.com/.test(a);return{url:e,path:r,hostname:a,hasLogin:i,isXiaomi:u,needFreeLogin:o,isOuterDomain:c,shouldFreeLoginAfterLogin:s}}catch(e){return{}}},C=function(){var e=(0,i.A)((0,t.A)().m((function e(){var n,r,a;return(0,t.A)().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,d.A.isLogin();case 1:if(n=e.v){e.n=3;break}return e.n=2,d.A.login();case 2:r=e.v,a=r.success,n=a;case 3:return e.a(2,n)}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=(0,i.A)((0,t.A)().m((function e(){var n,r,a,i;return(0,t.A)().w((function(e){for(;;)switch(e.n){case 0:if(!O){e.n=1;break}return e.a(2,O);case 1:return e.n=2,W.X.getMxmAccessToken({sid:d.A.getSid()});case 2:return n=e.v,r=(0,o.A)(n,2),a=r[0],i=r[1],!a&&i&&(O=i),e.a(2,O)}}),e)})));return function(){return e.apply(this,arguments)}}(),j=function(e){var n=e.uri,r=e.params,a=new x.g(n),t=(null==a?void 0:a.params)||{},i=r?Object.keys(r):[];if(i.length){var o,s=(0,c.A)(i);try{for(s.s();!(o=s.n()).done;){var u=o.value;t[u]=null==r?void 0:r[u]}}catch(e){s.e(e)}finally{s.f()}}return a.toString()},X=function(){var e=(0,i.A)((0,t.A)().m((function e(n){var r,a;return(0,t.A)().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,G();case 1:return(a=e.v)?(J.A.show("登录成功"),r=j({uri:n,params:{_user_access_token:a}})):J.A.show("登录失败,请稍后重试"),e.a(2,r)}}),e)})));return function(n){return e.apply(this,arguments)}}(),_=function(e){var n=(0,w.Jt)("utm_value"),r=(0,w.Jt)("sqm_value"),a={};return n&&(a.utm=n),r&&(a.sqm=r),j({uri:e,params:a})},F=function(){var e=(0,i.A)((0,t.A)().m((function e(n){var r,a,i,o,c,u,l,f,m,v,h;return(0,t.A)().w((function(e){for(;;)switch(e.n){case 0:if(r=n,a=I(n),i=a.url,o=a.hasLogin,c=a.isXiaomi,u=a.needFreeLogin,l=a.isOuterDomain,f=a.shouldFreeLoginAfterLogin,!(l||c||u)){e.n=9;break}if(o){e.n=2;break}return e.n=1,C();case 1:if(e.v){e.n=2;break}return J.A.show("请登录后再试~"),(m=(0,U.getCurrentPages)())&&m.length>=2&&k().navigateBack(),e.a(2,"");case 2:if(r=s.A.getWeappParamsUrl(r),!l){e.n=4;break}return e.n=3,S();case 3:(v=e.v)&&(r=j({uri:i,params:v}));case 4:if(!c){e.n=6;break}return e.n=5,X(r);case 5:r=e.v;case 6:if(!u){e.n=8;break}return e.n=7,d.A.getH5LoginUrl(r);case 7:r=e.v;case 8:e.n=15;break;case 9:if(!f){e.n=14;break}if(r=s.A.getWeappParamsUrl(r),h=o){e.n=11;break}return e.n=10,d.A.isLogin();case 10:h=e.v;case 11:if(!h){e.n=13;break}return e.n=12,d.A.getH5LoginUrl(r);case 12:r=e.v;case 13:e.n=15;break;case 14:r=s.A.getWeappParamsUrl(r);case 15:return e.a(2,r)}}),e)})));return function(n){return e.apply(this,arguments)}}(),M=r(6070),T=function(){var e,n,r=new l,a=(0,U.useRouter)(),c=(null==a?void 0:a.params)||{},u=(0,b.useState)({showWebView:!1,src:"",originUrl:""}),x=(0,o.A)(u,2),J=x[0],V=x[1],L=(0,b.useRef)();(0,U.useLoad)((function(){m.A.sendPageEvent("".concat(m.A.spmA,".webview.0.0"),c),S();var e=(null==c?void 0:c.url)||(null==c?void 0:c.q);if(n="true"===c.isRedirect,e=decodeURIComponent(e),(0,p.tp)(e))k().switchTab({url:"/pages/home/index"});else{k().onCopyUrl((function(){var e=(0,w.Jt)("currentUrl")||"",n=A(e),r=n||{},a=r.path,t=r.url;if(n&&t){var i=new RegExp(a,"g"),o=e.replace(i,t);return{query:"action=".concat(encodeURIComponent(JSON.stringify({type:"jump",payload:{jumpUrl:o}})))}}return{query:"url=".concat(encodeURIComponent(e))}}));try{var r=decodeURIComponent(c.action||"");if(r){var a=r=JSON.parse(r),t=a.type,i=a.payload;switch(t){case"jump":var o=(i||{}).jumpUrl;o&&f.A.navTo(o,{},{redirect:!0})}}}catch(e){}W(e,n)}})),(0,U.useUnload)((function(){try{k().offCopyUrl((function(){})),e||d.A.miniLogin&&d.A.miniLogin.webViewSync()}catch(e){}}));var S=function(){var e=0;r.addAction({type:"login",handle:function(){var n=(0,i.A)((0,t.A)().m((function n(r){var a;return(0,t.A)().w((function(n){for(;;)switch(n.n){case 0:if(!((a=(new Date).getTime())-e<300)){n.n=1;break}return n.a(2);case 1:e=a,d.A.setWebviewLoginValid(!1),r&&r.callbackUrl&&f.A.navTo("/pages/login/index",{returnUrl:r.callbackUrl});case 2:return n.a(2)}}),n)})));return function(e){return n.apply(this,arguments)}}()})};(0,U.useError)((function(e){}));var W=function(){var e=(0,i.A)((0,t.A)().m((function e(r,a){var i,o,c,u,l,d,f,m,h,p,A,y,b;return(0,t.A)().w((function(e){for(;;)switch(e.p=e.n){case 0:if(r){e.n=1;break}return e.a(2);case 1:if(o=r,"m"===(0,w.Jt)("currentEnv")&&(null===(i=o)||void 0===i?void 0:i.indexOf("wapa"))>-1&&((0,v.Ay)({code:1e3,msg:"miniapp_link_env_err",m1:1,c1:o}),o=o.replace("market.wapa.damai.cn","m.damai.cn").replace("m.wapa.taopiaopiao.com","m.taopiaopiao.com")),c=!0,e.p=2,!(y="function"==typeof wx[(0,w.Jt)("decode")("Z2V0UmVuZGVyZXJVc2VyQWdlbnQ=")])){e.n=4;break}return e.n=3,wx[(0,w.Jt)("decode")("Z2V0UmVuZGVyZXJVc2VyQWdlbnQ=")]();case 3:y=e.v;case 4:if(A=y){e.n=5;break}A="";case 5:u=A,(![(0,w.Jt)("decode")("aW9z"),(0,w.Jt)("decode")("YW5kcm9pZA=="),(0,w.Jt)("decode")("b2hvcw==")].includes(wx[(0,w.Jt)("decode")("Z2V0RGV2aWNlSW5mbw==")]()[(0,w.Jt)("decode")("cGxhdGZvcm0=")])||(0,w.Jt)((0,w.Jt)("decode")("ZW52VmVyc2lvbg=="))===(0,w.Jt)("decode")("cmVsZWFzZQ==")&&!0===wx[(0,w.Jt)("decode")("Z2V0QXBwQmFzZUluZm8=")]()[(0,w.Jt)("decode")("ZW5hYmxlRGVidWc=")]||u.indexOf((0,w.Jt)("decode")("d2VjaGF0ZGV2dG9vbHM="))>-1||u.indexOf((0,w.Jt)("decode")("TWluaVByb2dyYW1FbnYvTWFj"))>-1||u.indexOf((0,w.Jt)("decode")("TWluaVByb2dyYW1FbnYvV2luZG93cw=="))>-1)&&(c=!1),e.n=7;break;case 6:e.p=6,b=e.v,"function"==typeof v.Ay&&(0,v.Ay)({code:1e3,msg:(0,w.Jt)("decode")("aW50ZXJjZXB0LXBj"),m1:1,c1:JSON.stringify(b.message)});case 7:if(!1!==c){e.n=8;break}return e.a(2,!1);case 8:if(l=_(o),n=a,d={},(f=g.Xw.some((function(e){return(null==l?void 0:l.indexOf(e))>-1})))&&(n=!0),!n){e.n=11;break}if(m=l,f){e.n=10;break}return e.n=9,F(l);case 9:m=e.v;case 10:d={src:m,originUrl:l,showWebView:!0},e.n=13;break;case 11:return h=s.A.getOriginUrl(l),e.n=12,F(h);case 12:p=e.v,d={src:p,originUrl:l,showWebView:!0};case 13:V(d);case 14:return e.a(2)}}),e,null,[[2,6]])})));return function(n,r){return e.apply(this,arguments)}}();(0,U.useDidShow)((function(){var e=k().getStorageSync("redirectUrl");e&&(W(e,!0),k().removeStorageSync("redirectUrl"))}));return(0,U.useShareAppMessage)((function(e){var n=e.webViewUrl;n||(n=(0,w.Jt)("currentUrl")),g.Xw.some((function(e){var r;return(null===(r=n||"")||void 0===r?void 0:r.indexOf(e))>-1}))&&(n=J.originUrl);var a=r.getShareMessageData(n);a||(a={title:"好友推荐",shareUrl:s.A.getOriginUrl(n)}),a.shareUrl||(a.shareUrl=n);var t=s.A.getOriginUrl(a.shareUrl),i=A(n);if(i){var o,c=i.path,u=i.title,l=i.imageUrl,d=i.url,f=new RegExp(c,"g");return{title:u||a.title||g.b8,imageUrl:l||a.imageUrl,path:d?null===(o=n)||void 0===o?void 0:o.replace(f,d):"/pages/home/index?type=share&url=".concat(encodeURIComponent(t))}}if(g.aS.some((function(e){var r;return null===(r=n)||void 0===r?void 0:r.includes(e)}))&&L.current){var m=L.current||{},v=m.title,y=m.imgUrl,b=m.linkUrl,U=(0,p.x3)(decodeURIComponent(b));return{title:v||g.b8,imageUrl:y||g.wB,path:"/pages/home/index?type=share&url=".concat(encodeURIComponent(U))}}return h.A.createShareObject(a.title,a.imageUrl,t)})),(null==J?void 0:J.showWebView)&&(0,M.jsx)(y.SC,{src:null==J?void 0:J.src,onMessage:function(n){var a,t=(null==n||null===(a=n.detail)||void 0===a?void 0:a.data)||[];if(t.length>0){try{L.current=JSON.parse(t[t.length-1]||"{}")}catch(e){}r.handleMessages(n.detail.data)}e=!0,d.A.miniLogin&&d.A.miniLogin.webViewSync(n.detail.data[0])},onLoad:function(e){e.detail&&e.detail.src&&(0,w.hZ)("currentUrl",e.detail.src)}})};T.enableShareAppMessage=!0,Page((0,a.eU)(T,"pages/webview/index",{root:{cn:[]}},{enableShareAppMessage:!0}||{}))}},function(e){e.O(0,[6907,8096,2076],(function(){return n=7702,e(e.s=n);var n})),e.O()}]); \ No newline at end of file +require('../../@babel/runtime/helpers/Arrayincludes'), + (wx.webpackJsonp = wx.webpackJsonp || []).push([ + [4396], + { + 7702: function (e, n, r) { + var a = r(4160), + t = r(5652), + i = r(2555), + o = r(4576), + s = r(3523), + c = r(469), + u = r(29), + l = (0, r(5517).A)( + function e() { + ;(0, u.A)(this, e), (this.messages = []), (this.actionList = []) + }, + [ + { + key: 'handleMessages', + value: function () { + var e, + n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], + r = (0, c.A)(n) + try { + for (r.s(); !(e = r.n()).done; ) { + var a = e.value + if ('share' === a.type) this.messages.push(a) + else { + var t, + i = (0, c.A)(this.actionList) + try { + for (i.s(); !(t = i.n()).done; ) { + var o = t.value + o.type === a.type && o.handle(a.data) + } + } catch (e) { + i.e(e) + } finally { + i.f() + } + } + } + } catch (e) { + r.e(e) + } finally { + r.f() + } + }, + }, + { + key: 'getShareMessageData', + value: function (e) { + for (var n = null, r = this.messages.length - 1; r >= 0; r--) { + var a = this.messages[r] + if (e === a.data.originUrl) { + n = a + break + } + } + return n ? n.data : null + }, + }, + { + key: 'addAction', + value: function (e) { + this.actionList.push(e) + }, + }, + ], + ), + d = r(3816), + f = r(4911), + m = r(7422), + v = r(3150), + h = r(104), + p = r(9148), + g = r(2658), + w = r(6432), + A = function (e) { + if (e) { + var n = ((0, w.Jt)('cdnGlobalConfig') || {}).shareConfigList, + r = void 0 === n ? [] : n, + a = r.findLastIndex(function (n) { + var r = n.channel, + a = n.path, + t = new RegExp(a, 'g') + return 'damai_wechat' === r && t.test(e) + }) + return -1 !== a ? r[a] : void 0 + } + }, + y = r(4269), + b = r(758), + U = r(2573), + k = r.n(U), + x = r(5765), + J = r(6516), + V = r(9294), + L = r(9933), + S = (function () { + var e = (0, i.A)( + (0, t.A)().m(function e() { + var n, r, a, i, s, c, u, l, d + return (0, t.A)().w( + function (e) { + for (;;) + switch ((e.p = e.n)) { + case 0: + return (e.p = 0), (e.n = 1), V.A.getEncryptUserInfo() + case 1: + if (((n = e.v), (r = (0, o.A)(n, 2)), (a = r[0]), (i = r[1]), !a)) { + e.n = 2 + break + } + return k().showToast({ title: '获取用户信息异常,请稍后再试', icon: 'none' }), e.a(2, null) + case 2: + return ( + (c = (s = i || {}).encryptUserNick), + (u = s.encryptUserId), + (l = s.headImgUrl), + (d = s.domainId), + e.a(2, { + nickName: k().arrayBufferToBase64((0, p.UG)(c)), + openId: u, + avatar: (0, L.zp)({ url: l }), + applicationId: d, + }) + ) + case 3: + return (e.p = 3), e.v, e.a(2, null) + } + }, + e, + null, + [[0, 3]], + ) + }), + ) + return function () { + return e.apply(this, arguments) + } + })(), + W = r(7884), + O = '', + Z = [ + '/shows/orders.html', + '/shows/ticket/list.html', + '/shows/ticket/detail.html', + '/shows/pages/my-comment.html', + '/shows/pages/save-comment.html', + '/movies/coupons/list.html', + '/shows/mine/certificate.html', + '/shows/mine/audience.html', + '/shows/pages/address-list.html', + '/shows/mine/feedback.html', + '/shows/mine/follow.html', + '/damai/activity/waitcomment/index.html', + '/moviemine/pages/coupon-list/index.html', + '/damai/mine/certificate/index.html', + '/damai/activity/savecomment/index.html', + ], + R = ['/shows/pages/show-calendar.html'], + I = function (e) { + try { + var n = new x.g(e), + r = null == n ? void 0 : n.pathname, + a = null == n ? void 0 : n.hostname, + t = null == n ? void 0 : n.params, + i = 'yes' === (null == t ? void 0 : t.has_login), + o = Z.indexOf(r) > -1 || 'yes' === (null == t ? void 0 : t.free_login), + s = R.indexOf(r) > -1, + c = g.aS.some(function (n) { + return 'string' == typeof e && e.includes(n) + }), + u = /ai-alimebot\.lydaas\.com/.test(a) + return { + url: e, + path: r, + hostname: a, + hasLogin: i, + isXiaomi: u, + needFreeLogin: o, + isOuterDomain: c, + shouldFreeLoginAfterLogin: s, + } + } catch (e) { + return {} + } + }, + C = (function () { + var e = (0, i.A)( + (0, t.A)().m(function e() { + var n, r, a + return (0, t.A)().w(function (e) { + for (;;) + switch (e.n) { + case 0: + return (e.n = 1), d.A.isLogin() + case 1: + if ((n = e.v)) { + e.n = 3 + break + } + return (e.n = 2), d.A.login() + case 2: + ;(r = e.v), (a = r.success), (n = a) + case 3: + return e.a(2, n) + } + }, e) + }), + ) + return function () { + return e.apply(this, arguments) + } + })(), + G = (function () { + var e = (0, i.A)( + (0, t.A)().m(function e() { + var n, r, a, i + return (0, t.A)().w(function (e) { + for (;;) + switch (e.n) { + case 0: + if (!O) { + e.n = 1 + break + } + return e.a(2, O) + case 1: + return (e.n = 2), W.X.getMxmAccessToken({ sid: d.A.getSid() }) + case 2: + return (n = e.v), (r = (0, o.A)(n, 2)), (a = r[0]), (i = r[1]), !a && i && (O = i), e.a(2, O) + } + }, e) + }), + ) + return function () { + return e.apply(this, arguments) + } + })(), + j = function (e) { + var n = e.uri, + r = e.params, + a = new x.g(n), + t = (null == a ? void 0 : a.params) || {}, + i = r ? Object.keys(r) : [] + if (i.length) { + var o, + s = (0, c.A)(i) + try { + for (s.s(); !(o = s.n()).done; ) { + var u = o.value + t[u] = null == r ? void 0 : r[u] + } + } catch (e) { + s.e(e) + } finally { + s.f() + } + } + return a.toString() + }, + X = (function () { + var e = (0, i.A)( + (0, t.A)().m(function e(n) { + var r, a + return (0, t.A)().w(function (e) { + for (;;) + switch (e.n) { + case 0: + return (r = n), (e.n = 1), G() + case 1: + return ( + (a = e.v) + ? (J.A.show('登录成功'), (r = j({ uri: n, params: { _user_access_token: a } }))) + : J.A.show('登录失败,请稍后重试'), + e.a(2, r) + ) + } + }, e) + }), + ) + return function (n) { + return e.apply(this, arguments) + } + })(), + _ = function (e) { + var n = (0, w.Jt)('utm_value'), + r = (0, w.Jt)('sqm_value'), + a = {} + return n && (a.utm = n), r && (a.sqm = r), j({ uri: e, params: a }) + }, + F = (function () { + var e = (0, i.A)( + (0, t.A)().m(function e(n) { + var r, a, i, o, c, u, l, f, m, v, h + return (0, t.A)().w(function (e) { + for (;;) + switch (e.n) { + case 0: + if ( + ((r = n), + (a = I(n)), + (i = a.url), + (o = a.hasLogin), + (c = a.isXiaomi), + (u = a.needFreeLogin), + (l = a.isOuterDomain), + (f = a.shouldFreeLoginAfterLogin), + !(l || c || u)) + ) { + e.n = 9 + break + } + if (o) { + e.n = 2 + break + } + return (e.n = 1), C() + case 1: + if (e.v) { + e.n = 2 + break + } + return ( + J.A.show('请登录后再试~'), + (m = (0, U.getCurrentPages)()) && m.length >= 2 && k().navigateBack(), + e.a(2, '') + ) + case 2: + if (((r = s.A.getWeappParamsUrl(r)), !l)) { + e.n = 4 + break + } + return (e.n = 3), S() + case 3: + ;(v = e.v) && (r = j({ uri: i, params: v })) + case 4: + if (!c) { + e.n = 6 + break + } + return (e.n = 5), X(r) + case 5: + r = e.v + case 6: + if (!u) { + e.n = 8 + break + } + return (e.n = 7), d.A.getH5LoginUrl(r) + case 7: + r = e.v + case 8: + e.n = 15 + break + case 9: + if (!f) { + e.n = 14 + break + } + if (((r = s.A.getWeappParamsUrl(r)), (h = o))) { + e.n = 11 + break + } + return (e.n = 10), d.A.isLogin() + case 10: + h = e.v + case 11: + if (!h) { + e.n = 13 + break + } + return (e.n = 12), d.A.getH5LoginUrl(r) + case 12: + r = e.v + case 13: + e.n = 15 + break + case 14: + r = s.A.getWeappParamsUrl(r) + case 15: + return e.a(2, r) + } + }, e) + }), + ) + return function (n) { + return e.apply(this, arguments) + } + })(), + M = r(6070), + T = function () { + var e, + n, + r = new l(), + a = (0, U.useRouter)(), + c = (null == a ? void 0 : a.params) || {}, + u = (0, b.useState)({ showWebView: !1, src: '', originUrl: '' }), + x = (0, o.A)(u, 2), + J = x[0], + V = x[1], + L = (0, b.useRef)() + ;(0, U.useLoad)(function () { + m.A.sendPageEvent(''.concat(m.A.spmA, '.webview.0.0'), c), S() + var e = (null == c ? void 0 : c.url) || (null == c ? void 0 : c.q) + if (((n = 'true' === c.isRedirect), (e = decodeURIComponent(e)), (0, p.tp)(e))) + k().switchTab({ url: '/pages/home/index' }) + else { + k().onCopyUrl(function () { + var e = (0, w.Jt)('currentUrl') || '', + n = A(e), + r = n || {}, + a = r.path, + t = r.url + if (n && t) { + var i = new RegExp(a, 'g'), + o = e.replace(i, t) + return { + query: 'action='.concat( + encodeURIComponent(JSON.stringify({ type: 'jump', payload: { jumpUrl: o } })), + ), + } + } + return { query: 'url='.concat(encodeURIComponent(e)) } + }) + try { + var r = decodeURIComponent(c.action || '') + if (r) { + var a = (r = JSON.parse(r)), + t = a.type, + i = a.payload + switch (t) { + case 'jump': + var o = (i || {}).jumpUrl + o && f.A.navTo(o, {}, { redirect: !0 }) + } + } + } catch (e) {} + W(e, n) + } + }), + (0, U.useUnload)(function () { + try { + k().offCopyUrl(function () {}), e || (d.A.miniLogin && d.A.miniLogin.webViewSync()) + } catch (e) {} + }) + var S = function () { + var e = 0 + r.addAction({ + type: 'login', + handle: (function () { + var n = (0, i.A)( + (0, t.A)().m(function n(r) { + var a + return (0, t.A)().w(function (n) { + for (;;) + switch (n.n) { + case 0: + if (!((a = new Date().getTime()) - e < 300)) { + n.n = 1 + break + } + return n.a(2) + case 1: + ;(e = a), + d.A.setWebviewLoginValid(!1), + r && r.callbackUrl && f.A.navTo('/pages/login/index', { returnUrl: r.callbackUrl }) + case 2: + return n.a(2) + } + }, n) + }), + ) + return function (e) { + return n.apply(this, arguments) + } + })(), + }) + } + ;(0, U.useError)(function (e) {}) + var W = (function () { + var e = (0, i.A)( + (0, t.A)().m(function e(r, a) { + var i, o, c, u, l, d, f, m, h, p, A, y, b + return (0, t.A)().w( + function (e) { + for (;;) + switch ((e.p = e.n)) { + case 0: + if (r) { + e.n = 1 + break + } + return e.a(2) + case 1: + if ( + ((o = r), + 'm' === (0, w.Jt)('currentEnv') && + (null === (i = o) || void 0 === i ? void 0 : i.indexOf('wapa')) > -1 && + ((0, v.Ay)({ code: 1e3, msg: 'miniapp_link_env_err', m1: 1, c1: o }), + (o = o + .replace('market.wapa.damai.cn', 'm.damai.cn') + .replace('m.wapa.taopiaopiao.com', 'm.taopiaopiao.com'))), + (c = !0), + (e.p = 2), + !(y = 'function' == typeof wx[(0, w.Jt)('decode')('Z2V0UmVuZGVyZXJVc2VyQWdlbnQ=')])) + ) { + e.n = 4 + break + } + return (e.n = 3), wx[(0, w.Jt)('decode')('Z2V0UmVuZGVyZXJVc2VyQWdlbnQ=')]() + case 3: + y = e.v + case 4: + if ((A = y)) { + e.n = 5 + break + } + A = '' + case 5: + ;(u = A), + (![ + (0, w.Jt)('decode')('aW9z'), + (0, w.Jt)('decode')('YW5kcm9pZA=='), + (0, w.Jt)('decode')('b2hvcw=='), + ].includes( + wx[(0, w.Jt)('decode')('Z2V0RGV2aWNlSW5mbw==')]()[(0, w.Jt)('decode')('cGxhdGZvcm0=')], + ) || + ((0, w.Jt)((0, w.Jt)('decode')('ZW52VmVyc2lvbg==')) === + (0, w.Jt)('decode')('cmVsZWFzZQ==') && + !0 === + wx[(0, w.Jt)('decode')('Z2V0QXBwQmFzZUluZm8=')]()[ + (0, w.Jt)('decode')('ZW5hYmxlRGVidWc=') + ]) || + u.indexOf((0, w.Jt)('decode')('d2VjaGF0ZGV2dG9vbHM=')) > -1 || + u.indexOf((0, w.Jt)('decode')('TWluaVByb2dyYW1FbnYvTWFj')) > -1 || + u.indexOf((0, w.Jt)('decode')('TWluaVByb2dyYW1FbnYvV2luZG93cw==')) > -1) && + (c = !1), + (e.n = 7) + break + case 6: + ;(e.p = 6), + (b = e.v), + 'function' == typeof v.Ay && + (0, v.Ay)({ + code: 1e3, + msg: (0, w.Jt)('decode')('aW50ZXJjZXB0LXBj'), + m1: 1, + c1: JSON.stringify(b.message), + }) + case 7: + if (!1 !== c) { + e.n = 8 + break + } + return e.a(2, !1) + case 8: + if ( + ((l = _(o)), + (n = a), + (d = {}), + (f = g.Xw.some(function (e) { + return (null == l ? void 0 : l.indexOf(e)) > -1 + })) && (n = !0), + !n) + ) { + e.n = 11 + break + } + if (((m = l), f)) { + e.n = 10 + break + } + return (e.n = 9), F(l) + case 9: + m = e.v + case 10: + ;(d = { src: m, originUrl: l, showWebView: !0 }), (e.n = 13) + break + case 11: + return (h = s.A.getOriginUrl(l)), (e.n = 12), F(h) + case 12: + ;(p = e.v), (d = { src: p, originUrl: l, showWebView: !0 }) + case 13: + V(d) + case 14: + return e.a(2) + } + }, + e, + null, + [[2, 6]], + ) + }), + ) + return function (n, r) { + return e.apply(this, arguments) + } + })() + ;(0, U.useDidShow)(function () { + var e = k().getStorageSync('redirectUrl') + e && (W(e, !0), k().removeStorageSync('redirectUrl')) + }) + return ( + (0, U.useShareAppMessage)(function (e) { + var n = e.webViewUrl + n || (n = (0, w.Jt)('currentUrl')), + g.Xw.some(function (e) { + var r + return (null === (r = n || '') || void 0 === r ? void 0 : r.indexOf(e)) > -1 + }) && (n = J.originUrl) + var a = r.getShareMessageData(n) + a || (a = { title: '好友推荐', shareUrl: s.A.getOriginUrl(n) }), a.shareUrl || (a.shareUrl = n) + var t = s.A.getOriginUrl(a.shareUrl), + i = A(n) + if (i) { + var o, + c = i.path, + u = i.title, + l = i.imageUrl, + d = i.url, + f = new RegExp(c, 'g') + return { + title: u || a.title || g.b8, + imageUrl: l || a.imageUrl, + path: d + ? null === (o = n) || void 0 === o + ? void 0 + : o.replace(f, d) + : '/pages/home/index?type=share&url='.concat(encodeURIComponent(t)), + } + } + if ( + g.aS.some(function (e) { + var r + return null === (r = n) || void 0 === r ? void 0 : r.includes(e) + }) && + L.current + ) { + var m = L.current || {}, + v = m.title, + y = m.imgUrl, + b = m.linkUrl, + U = (0, p.x3)(decodeURIComponent(b)) + return { + title: v || g.b8, + imageUrl: y || g.wB, + path: '/pages/home/index?type=share&url='.concat(encodeURIComponent(U)), + } + } + return h.A.createShareObject(a.title, a.imageUrl, t) + }), + (null == J ? void 0 : J.showWebView) && + (0, M.jsx)(y.SC, { + src: null == J ? void 0 : J.src, + onMessage: function (n) { + var a, + t = (null == n || null === (a = n.detail) || void 0 === a ? void 0 : a.data) || [] + if (t.length > 0) { + try { + L.current = JSON.parse(t[t.length - 1] || '{}') + } catch (e) {} + r.handleMessages(n.detail.data) + } + ;(e = !0), d.A.miniLogin && d.A.miniLogin.webViewSync(n.detail.data[0]) + }, + onLoad: function (e) { + e.detail && e.detail.src && (0, w.hZ)('currentUrl', e.detail.src) + }, + }) + ) + } + ;(T.enableShareAppMessage = !0), + Page((0, a.eU)(T, 'pages/webview/index', { root: { cn: [] } }, { enableShareAppMessage: !0 } || {})) + }, + }, + function (e) { + e.O(0, [6907, 8096, 2076], function () { + return (n = 7702), e((e.s = n)) + var n + }), + e.O() + }, + ]) diff --git a/project.config.json b/project.config.json index cf5b9df..c70f76a 100644 --- a/project.config.json +++ b/project.config.json @@ -7,6 +7,28 @@ "minified": true, "compileWorklet": true, "swc": true, - "disableSWC": false - } + "disableSWC": false, + "postcss": false, + "uglifyFileName": false, + "uploadWithSourceMap": true, + "packNpmManually": false, + "packNpmRelationList": [], + "localPlugins": false, + "disableUseStrict": false, + "useCompilerPlugins": false, + "condition": false, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "appid": "wxe868394c5f163ae2", + "compileType": "miniprogram", + "simulatorPluginLibVersion": {}, + "packOptions": { + "ignore": [], + "include": [] + }, + "editorSetting": {} } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index fa96d8d..142cad5 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,18 +1,22 @@ { "setting": { - "urlCheck": false + "urlCheck": false, + "coverView": false, + "lazyloadPlaceholderEnable": false, + "skylineRenderEnable": false, + "preloadBackgroundData": false, + "autoAudits": false, + "useApiHook": true, + "showShadowRootInWxmlPanel": false, + "useStaticServer": false, + "useLanDebug": false, + "showES6CompileOption": false, + "compileHotReLoad": true, + "checkInvalidKey": true, + "ignoreDevUnusedFiles": true, + "bigPackageSizeSupport": false }, - "condition": { - "miniprogram": { - "list": [ - { - "name": "pages/pay/index", - "pathName": "subPackages/sku/index", - "query": "id=978819766155", - "scene": null, - "launchMode": "default" - } - ] - } - } + "condition": {}, + "libVersion": "3.12.1", + "projectname": "damai-wx" } \ No newline at end of file diff --git a/subPackages/order-pay/index.js b/subPackages/order-pay/index.js index b342c70..bf3355a 100644 --- a/subPackages/order-pay/index.js +++ b/subPackages/order-pay/index.js @@ -6391,6 +6391,11 @@ require('../sub-vendors.js'), wxOpenId: v, }), (f = yi(p)) && (s.dataTags = f), + (console.log('u = ', u)), + (console.log('n = ', n)), + (console.log('r = ', r)), + (console.log('i = ', i)), + (console.log('a = ', a)), (l.params = JSON.stringify({ data: JSON.stringify(null == u ? void 0 : u.data), linkage: JSON.stringify({ @@ -6930,7 +6935,6 @@ require('../sub-vendors.js'), }, Mi = 'bui-ultron', qi = function (e) { - var t = e.data, r = e.handleUpdateData, i = e.setNeedRefreshPage, @@ -7025,7 +7029,12 @@ require('../sub-vendors.js'), }) return r })(f, h)) + var d = hi(t, 'fields', { viewerList: f, selectedNum: s }) + console.log('t = ', t); + console.log('viewerList = ', f); + console.log('selectedNum = ', s) + console.log('d = ', d) r(t.componentDataName, d) } }, @@ -9407,14 +9416,19 @@ require('../sub-vendors.js'), e.n = 6 break } + Oo.A.getWasmHeader(a).then(res => console.log('Oo.A.getWasmHeader(a) = ', res)) return (e.p = 1), (e.n = 2), Oo.A.getWasmHeader(a) case 2: return ( (p = e.v), + (console.log('e = ', e)), + (console.log('e.v = ', e.v)), (h = JSON.stringify( (0, f.A)((0, f.A)({}, p), JSON.parse((null == v ? void 0 : v.feature) || '{}')), )), + (console.log('h = ', h)), (e.n = 3), + (console.log('data = ', (0, f.A)((0, f.A)({}, v), {}, { feature: h }))), Lo( { from: 'buy', diff --git a/subPackages/sku/index.js b/subPackages/sku/index.js index 4d9d2f4..1a6228d 100644 --- a/subPackages/sku/index.js +++ b/subPackages/sku/index.js @@ -1828,6 +1828,7 @@ require('../sub-vendors.js'), return E.createElement( 'div', (function (e, t) { + console.log(e, t); for (var a in t || (t = {})) It.call(t, a) && kt(e, a, t[a]) if (Et) { var i, @@ -2422,6 +2423,14 @@ require('../sub-vendors.js'), ], }), ), + (console.log(G, W, E.createElement(St, { + theme: v, + selectedTimes: I, + selectedSku: N, + toast: C, + handleTotalChange: D, + onClickServiceFee: P, + }))), G && !W && E.createElement(St, { @@ -4827,6 +4836,7 @@ require('../sub-vendors.js'), return new bi.p((0, u.A)((0, u.A)({}, fi), e)).create() }, Ii = function () { + debugger var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} return new bi.p((0, u.A)((0, u.A)({}, yi), e)).create() }, @@ -4875,6 +4885,7 @@ require('../sub-vendors.js'), s = { buyParam: ''.concat(e.itemId, '_').concat(e.buyNum, '_').concat(e.skuId), buyNow: !0, exParams: c } e.privilegeActId && (s.privilegeActId = e.privilegeActId) var u = ''.concat(Oi.A.spmA, '.project.bottom.dbuy') + console.log(s) ;(s.spm = u), Oi.A.sendClickEvent(u, { clicktitle: '立即购买', item_id: e.itemId, sku_id: e.skuId, buy_num: e.buyNum }), Ka.A.navTo('subPackages/order-pay/index', s, { needLogin: !0 }) @@ -6275,6 +6286,7 @@ require('../sub-vendors.js'), })(), ue = N()( function (e) { + console.log('这里可以了') ;(function (e) { f.Ay.sendGoldLog( 'CLK', @@ -6282,7 +6294,8 @@ require('../sub-vendors.js'), (0, u.A)((0, u.A)({}, e), {}, { spmC: 'bottom', spmD: 'wanttoseeok' }), ) })(re), - B ? i && _(ai.WILL_BUY) : oe ? _(ai.SALE_TIP) : O(e) + // B ? i && _(ai.WILL_BUY) : oe ? _(ai.SALE_TIP) : O(e) + O(e) }, 500, { leading: !0, trailing: !1 }, diff --git a/subPackages/video/index.js b/subPackages/video/index.js index eab40e3..0a93bdf 100644 --- a/subPackages/video/index.js +++ b/subPackages/video/index.js @@ -1 +1,135 @@ -require("../sub-vendors.js"),(wx.webpackJsonp=wx.webpackJsonp||[]).push([[3357],{5990:function(e,o,i){var n=i(4160),t=i(4107),d=i(4576),r=i(758),a=i(2573),c=i(4269),l=i(3816),s=i(7422),u=i(6070),p=l.A.getUtdid();Page((0,n.eU)((function(){var e=(0,r.useState)({spm_b:"item",vid:"",title:"",ccode:"",pid:"",videoUrl:"",picUrl:""}),o=(0,d.A)(e,2),i=o[0],n=o[1],l=i.videoUrl,v=i.picUrl,m=i.title,y=i.ccode,k=i.vid,g=i.pid;return(0,a.useLoad)((function(){var e,o=null===(e=(0,a.getCurrentInstance)().router)||void 0===e?void 0:e.params;if(o){var d=o.vid,r=void 0===d?"":d,c=o.title,l=void 0===c?"":c,s=o.pid,u=void 0===s?"":s,p=o.videoUrl,v=void 0===p?"":p,m=o.picUrl,y=void 0===m?"":m,k=(0,a.getDeviceInfo)().system.match(/android/i)?"01010122":"02010120";n(v?(0,t.A)((0,t.A)({},i),{},{videoUrl:decodeURIComponent(v),picUrl:decodeURIComponent(y)}):(0,t.A)((0,t.A)({},i),{},{ccode:k,vid:decodeURIComponent(r),title:decodeURIComponent(l),pid:decodeURIComponent(u)}))}})),(0,a.useReady)((function(){(0,a.onNetworkStatusChange)((function(e){"wifi"!==e.networkType&&(0,a.showToast)({title:"您正在使用非wifi网络",icon:"none"})}))})),(0,u.jsxs)(c.Ss,{className:"video",children:[(0,u.jsx)(c.Ss,{className:"video-container",children:l?(0,u.jsx)(c.Ce,{id:"video-normal",src:l,controls:!0,"show-center-play-btn":!1,"show-play-btn":!0,poster:v}):(0,u.jsx)("youkuplayer",{ccode:y,allowRecord:!1,utid:p,id:"youkuplayer",bindYoukuPlayerEvent:function(e){"Player.Play.Start"===e.detail.code&&s.A.sendClickEvent("".concat(s.A.spmA,".item.info.dvideoclk"),{item_id:g})},playerId:"player",vid:k})}),!l&&(0,u.jsx)(c.Ss,{className:"video-title",children:m})]})}),"subPackages/video/index",{root:{cn:[]}},{component:!0,navigationBarBackgroundColor:"#000000",navigationBarTitleText:"",backgroundColor:"#000000",backgroundColorContent:"#000000",backgroundColorTop:"#000000",backgroundColorBottom:"#000000",backgroundTextStyle:"light",navigationBarTextStyle:"white",usingComponents:{youkuplayer:"./wx-youkuplayer/index"}}||{}))}},function(e){e.O(0,[6907,8096,2076],(function(){return o=5990,e(e.s=o);var o})),e.O()}]); \ No newline at end of file +require('../sub-vendors.js'), + (wx.webpackJsonp = wx.webpackJsonp || []).push([ + [3357], + { + 5990: function (e, o, i) { + var n = i(4160), + t = i(4107), + d = i(4576), + r = i(758), + a = i(2573), + c = i(4269), + l = i(3816), + s = i(7422), + u = i(6070), + p = l.A.getUtdid() + Page( + (0, n.eU)( + function () { + var e = (0, r.useState)({ + spm_b: 'item', + vid: '', + title: '', + ccode: '', + pid: '', + videoUrl: '', + picUrl: '', + }), + o = (0, d.A)(e, 2), + i = o[0], + n = o[1], + l = i.videoUrl, + v = i.picUrl, + m = i.title, + y = i.ccode, + k = i.vid, + g = i.pid + return ( + (0, a.useLoad)(function () { + var e, + o = null === (e = (0, a.getCurrentInstance)().router) || void 0 === e ? void 0 : e.params + if (o) { + var d = o.vid, + r = void 0 === d ? '' : d, + c = o.title, + l = void 0 === c ? '' : c, + s = o.pid, + u = void 0 === s ? '' : s, + p = o.videoUrl, + v = void 0 === p ? '' : p, + m = o.picUrl, + y = void 0 === m ? '' : m, + k = (0, a.getDeviceInfo)().system.match(/android/i) ? '01010122' : '02010120' + n( + v + ? (0, t.A)( + (0, t.A)({}, i), + {}, + { videoUrl: decodeURIComponent(v), picUrl: decodeURIComponent(y) }, + ) + : (0, t.A)( + (0, t.A)({}, i), + {}, + { + ccode: k, + vid: decodeURIComponent(r), + title: decodeURIComponent(l), + pid: decodeURIComponent(u), + }, + ), + ) + } + }), + (0, a.useReady)(function () { + ;(0, a.onNetworkStatusChange)(function (e) { + 'wifi' !== e.networkType && (0, a.showToast)({ title: '您正在使用非wifi网络', icon: 'none' }) + }) + }), + (0, u.jsxs)(c.Ss, { + className: 'video', + children: [ + (0, u.jsx)(c.Ss, { + className: 'video-container', + children: l + ? (0, u.jsx)(c.Ce, { + id: 'video-normal', + src: l, + controls: !0, + 'show-center-play-btn': !1, + 'show-play-btn': !0, + poster: v, + }) + : (0, u.jsx)('youkuplayer', { + ccode: y, + allowRecord: !1, + utid: p, + id: 'youkuplayer', + bindYoukuPlayerEvent: function (e) { + 'Player.Play.Start' === e.detail.code && + s.A.sendClickEvent(''.concat(s.A.spmA, '.item.info.dvideoclk'), { item_id: g }) + }, + playerId: 'player', + vid: k, + }), + }), + !l && (0, u.jsx)(c.Ss, { className: 'video-title', children: m }), + ], + }) + ) + }, + 'subPackages/video/index', + { root: { cn: [] } }, + { + component: !0, + navigationBarBackgroundColor: '#000000', + navigationBarTitleText: '', + backgroundColor: '#000000', + backgroundColorContent: '#000000', + backgroundColorTop: '#000000', + backgroundColorBottom: '#000000', + backgroundTextStyle: 'light', + navigationBarTextStyle: 'white', + usingComponents: { youkuplayer: './wx-youkuplayer/index' }, + } || {}, + ), + ) + }, + }, + function (e) { + e.O(0, [6907, 8096, 2076], function () { + return (o = 5990), e((e.s = o)) + var o + }), + e.O() + }, + ]) diff --git a/subPackages/video/wx-youkuplayer/index.js b/subPackages/video/wx-youkuplayer/index.js index 3511221..1a36724 100644 --- a/subPackages/video/wx-youkuplayer/index.js +++ b/subPackages/video/wx-youkuplayer/index.js @@ -1 +1,1944 @@ -require("../../sub-vendors.js"),(wx.webpackJsonp=wx.webpackJsonp||[]).push([[9818],{3609:function(t,e,i){var r=i(9476),a=i(2573),s=i.n(a),n=i(3919).window;!function(t){var e={};function i(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"===(0,r.A)(t)&&t&&t.__esModule)return t;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(a,s,function(e){return t[e]}.bind(null,s));return a},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=6)}([function(t,e,i){e.__esModule=!0;e.DefaultVideoData={id:0,encodeId:"",title:"",duration:0,videoType:"",isShareAd:!1,isDanmaku:!1,isPanorama:!1,isFee:!1,isChannelVip:!1,isSubscribe:!1,isRtmp:!1,isTrial:!1,isVertical:!1,categoryId:0,categoryLetterId:"",categoryString:"",tags:[],coverURL:""},e.DefaultWaterMark={logo:{},license:{},register:{}},e.DefaultTrialData={type:"",time:0,note:""},e.DefaultSegmentData={seconds:0,index:-1,size:0,src:"",backupURL:""},e.DefaultPlayListData={upsData:null,userData:null,errorData:null,videoData:null,watermark:null,showData:null,trialData:null,nextVideo:null,isError:!1}},function(t,e,i){e.__esModule=!0;var r={defineGetter:function(t,e){Object.defineProperty(t,e,{get:function(){return t["_"+e]}})}};e.default=r},function(t,e,i){e.__esModule=!0;e.PlayerStatusEvent={PLAYER_IS_READY:"Player.Is.Ready",PLAYER_IS_PAUSED:"Player.Is.Paused",PLAYER_IS_PLAYING:"Player.Is.Playing",PLAYER_PLAY_START:"Player.Play.Start",PLAYER_BUFFER_EMPTY:"Player.Buffer.Empty",PLAYER_PLAY_END:"Player.Play.End",PLAYER_PLAY_STOP:"Player.Play.Stop",PLAYER_DESTORY:"Player.Destory",PLAYER_PLAY_FAILED:"Player.Play.Failed",SERVICE_IS_DONE:"Service.Is.Done",PLAYER_FULL_SCREEN:"Player.Full.Screen",PLAYER_GOTO_LOGIN:"Player.Goto.Login"},e.PlayerCommandEvent={START:"start",PLAY:"play",PAUSE:"pause",SEEK:"seek",REPLAY:"replay",RELOAD:"reload",RESTART:"restart"}},function(t,e,i){var a,s="function"==typeof Symbol&&"symbol"===(0,r.A)(Symbol.iterator)?function(t){return(0,r.A)(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":(0,r.A)(t)},n="object"===("undefined"==typeof Reflect?"undefined":s(Reflect))?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};a=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var l=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var h=10;function c(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function p(t,e,i,r){var a,n,o;if("function"!=typeof i)throw new TypeError('The "listener" argument must be of type Function. Received type '+(void 0===i?"undefined":s(i)));if(void 0===(n=t._events)?(n=t._events=Object.create(null),t._eventsCount=0):(void 0!==n.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),n=t._events),o=n[e]),void 0===o)o=n[e]=i,++t._eventsCount;else if("function"==typeof o?o=n[e]=r?[i,o]:[o,i]:r?o.unshift(i):o.push(i),(a=c(t))>0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,console&&console.warn}return t}function d(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var n=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw n.context=s,n}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,h=m(l,u);for(i=0;i=0;n--)if(i[n]===e||i[n].listener===e){o=i[n].listener,a=n;break}if(a<0)return this;0===a?i.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return y(this,t,!0)},u.prototype.rawListeners=function(t){return y(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):_.call(t,e)},u.prototype.listenerCount=_,u.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(t,e,i){e.__esModule=!0;var r=function(){function t(t,e){for(var i=0;ithis.playlistData.videoData.duration-10&&(this.startTime=this.playlistData.videoData.duration-10)):this.historyService.addHistory(t)}var r=this.playlistData.getMediaStreamData("mp4");r&&r[0]&&(this.currectStream=this.playlistData.getStreamByQuality(r[0].id,"480p"),this.currectStream&&this.currectStream.streamURL||(this.currectStream=r[0].qualityList[0]),this.currectStream&&(!this.currectStream.hasLogo&&this.playlistData.watermark.logo&&this.playlistData.watermark.logo.logo&&this.setData({logo:this.playlistData.watermark.logo.logo,logoStyle:this.playlistData.watermark.logo.logoStyle,fullLogo:this.playlistData.watermark.logo.fullLogo,fullLogoStyle:this.playlistData.watermark.logo.fullLogoStyle}),"hls"===this.data.supportType&&this.currectStream.streamURL?e=this.currectStream.streamURL:this.currectStream.segs&&this.currectStream.segs[0]&&this.currectStream.segs[0].src&&(e=this.currectStream.segs[0].src))),e?this.setData({streamURL:e,coverURL:t.videoData.coverURL,isVertical:t.videoData.isVertical}):(this.setData({coverURL:t.videoData.coverURL}),this.showError())},showError:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"error",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"视频暂时无法播放,小酷正全力修复中,非常抱歉";"4g"===t||"init"===t||"loading"===t?this.isError=!1:(this.isError=!0,"none"!==this.networkType&&this.triggerEvent("YoukuPlayerEvent",{code:n.PlayerStatusEvent.PLAYER_PLAY_FAILED,data:{playerId:this.data.playerId,message:e}})),this.setData({isShowLayer:!0,panelName:t,errorMessage:e})},reset:function(){var t="loading";switch(this.videoContext&&this.videoContext.pause(),this.playTimer&&clearTimeout(this.playTimer),this.networkType){case"none":t="nonetwork";break;case"wifi":this.autoplay||(t="init");break;default:this.autoplay||(t="4g")}this.isFirstUpdate=!1,this.retryCount=0,this.setData({streamURL:"",logo:"",logoStyle:"",fullLogo:"",fullLogoStyle:""}),this.showError(t),this.historyService&&this.historyService.reset(),(this.data.vid||this.data.showid)&&(this.historyService&&this.historyService.getHistoryList(),this._requestUps())},replay:function(){var t=this;this._log&&this._log.onNetStatus({code:n.PlayerCommandEvent.REPLAY}),this.startTime=0,this.isFirstUpdate=!1,this.setData({initialTime:this.startTime}),this.videoContext&&this.videoContext.seek(0),this.playTimer&&clearTimeout(this.playTimer),this.data.isShowLayer&&this.setData({isShowLayer:!1}),this.playTimer=setTimeout((function(){t.videoContext&&t.videoContext.play()}),1500)},play:function(){var t=this;this.playTimer&&clearTimeout(this.playTimer),this.data.isShowLayer&&this.setData({isShowLayer:!1}),this.playTimer=setTimeout((function(){t.videoContext.play()}),1e3)},pause:function(){this._log&&this._log.onNetStatus({code:n.PlayerStatusEvent.PLAYER_IS_PAUSED}),this.videoContext&&this.videoContext.pause()},stop:function(){this.data.isShowLayer||(this._log.onNetStatus({code:n.PlayerStatusEvent.PLAYER_PLAY_STOP}),this.triggerEvent("YoukuPlayerEvent",{code:n.PlayerStatusEvent.PLAYER_PLAY_STOP,data:{playerId:this.data.playerId}}),this.videoContext&&this.videoContext.pause(),this.playTimer&&clearTimeout(this.playTimer),this.startTime=this.currentTime,this.isFirstUpdate=!1,this.setData({initialTime:this.startTime}),this.showError("init"))},destory:function(){this.currectStream=null,this.playlistData=null,this.setData({vid:"",streamURL:"",panelName:""}),this.videoContext&&this.videoContext.pause(),this.playTimer&&clearTimeout(this.playTimer),this.triggerEvent("YoukuPlayerEvent",{code:n.PlayerStatusEvent.PLAYER_DESTORY,data:{playerId:this.data.playerId}}),this._log&&this._log.onNetStatus({code:n.PlayerStatusEvent.PLAYER_DESTORY})}}})},function(t,e,i){e.__esModule=!0;var a=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:1/0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];a(this,e);var o=s(this,t.call(this));return o.listeners={},o.milliseconds=0,o.interval=i,o.repeat=o.repeatTracker=r,o.useTimeout=n,o.timeoutDelay=Math.round(i/20),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(0,r.A)(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getCurrentCount=function(){return this.repeat-this.repeatTracker},e.prototype.getInterval=function(){return this.interval},e.prototype.getMilliseconds=function(){return this.milliseconds},e.prototype.getRepeatCount=function(){return this.repeat},e.prototype.getRunning=function(){return void 0!==this.timer},e.prototype.addEventListener=function(t,e){this.addListener(t,e)},e.prototype.requestFrame=function(t){this.useTimeout?this.timeoutId=setTimeout(t,this.timeoutDelay):n.requestAnimationFrame(t)},e.prototype.animationFrame=function(){var t=this;if(void 0!==this.timer)if(this.repeatTracker>0){var e=(new Date).getTime()-this.timer;e>=this.interval&&(this.milliseconds+=this.interval,this.timer=(new Date).getTime()-(e-this.interval),this.repeatTracker--,this.update()),this.requestFrame((function(){t.animationFrame()}))}else this.complete()},e.prototype.complete=function(){this.pause(),this.emit(e.TIMER_COMPLETE,{timer:this,timeRemaining:this.repeatTracker})},e.prototype.pause=function(){this.useTimeout&&clearTimeout(this.timeoutId),this.timer=void 0},e.prototype.reset=function(){this.milliseconds=0,this.repeatTracker=this.repeat,this.emit(e.TIMER_RESET,{timer:this,timeRemaining:this.repeatTracker,running:this.getRunning()})},e.prototype.removeEventListener=function(t,e){this.removeListener(t,e)},e.prototype.start=function(){var t=this;void 0===this.timer&&(this.timer=(new Date).getTime(),this.requestFrame((function(){t.animationFrame()})))},e.prototype.update=function(){this.emit(e.TIMER,{timer:this,timeRemaining:this.repeatTracker})},e}(i(3).EventEmitter);o.TIMER="timer",o.TIMER_COMPLETE="timer-complete",o.TIMER_RESET="timer-reset",e.default=o},function(t,e,i){e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(13));var a=["该视频小程序暂不支持。","出错啦,视频不存在,请看看其他视频吧","该视频小程序暂不支持。","抱歉,因版权原因无法观看此视频!"],n=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.vid="",this._retryCount=4}return t.prototype.start=function(t,e){(t.vid||t.showid)&&(this.callbacks=e,this.vid=t.vid||"",this.ccode=t.ccode||"0517",this.utid=t.utid||"eWrCEmi2cFsCAWoLI41wnWhW",this.showid=t.showid||"",this._retryCount=4,this.requestData())},t.prototype.requestData=function(){var t=this,e={url:"https://ups.youku.com/ups/get.json"};e.data=this.getServieceParam(),e.success=function(e){e.data&&t.onComplete(e.data)},e.fail=function(){t.dispatchError()},s().request(e)},t.prototype.getServieceParam=function(){var t={};return t.vid=this.vid,this.showid&&(t.showid=this.showid),t.ccode=this.ccode,t.client_ip="192.168.1.1",t.utid=this.utid,t.client_ts=parseInt((new Date).getTime()/1e3),t},t.prototype.onComplete=function(t){if(!t.hasOwnProperty("e")||!t.e.hasOwnProperty("code")||0!==t.e.code||!t.data)return this._retryCount--,void(this._retryCount<1||1111===t.status?this._playListDataError({errorCode:"22501"}):this.requestData());if(t.data.error&&t.data.error.code<0){var e="",i=[["-1000","-1001","-1002","-1003"," -1004"],["-2001","-2002","-2003","-2004","-2005","-3001","-3002","-3003","-3004","-3005","-3006","-3007","-3008","-3009","-4002","-4003","-4007"],["-4001"]];-1!==["-3006","-4003","-4004","-4005","-4006","-5001","-6001","-6003","-6004","-6005","-6006"].indexOf(String(t.data.error.code))&&(e="23"+(e=String(t.data.error.code)).slice(1,2)+e.slice(3,5));for(var s=0,n=0;n0&&void 0!==arguments[0]?arguments[0]:"flv";return this._streamsData.getMediaStreamData(t)},t.prototype.getStreamByQuality=function(t,e){return this._streamsData.getStreamByQuality(t,e)},r(t,[{key:"playlistData",get:function(){return this._playlistData}},{key:"streamsData",get:function(){return this._streamsData.streamData}}]),t}();e.default=c},function(t,e,i){e.__esModule=!0;var r=i(0),a=function(t){return t&&t.__esModule?t:{default:t}}(i(1));var s=function(){function t(e,i,s){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.DefaultVideoData)this["_"+n]=r.DefaultVideoData[n],a.default.defineGetter(this,n);e&&this._resetVideoData(e,i,s)}return t.prototype._resetVideoData=function(t,e,i){if(t.hasOwnProperty("id")&&(this._id=t.id),t.hasOwnProperty("encodeid")&&(this._encodeId=t.encodeid),t.hasOwnProperty("title")&&(this._title=t.title),t.hasOwnProperty("seconds")&&(this._duration=t.seconds),t.hasOwnProperty("ctype")&&(this._videoType=t.ctype),t.hasOwnProperty("logo")&&(this._coverURL=t.logo),t.hasOwnProperty("category_id")&&(this._categoryId=t.category_id),t.hasOwnProperty("category_letter_id")&&(this._categoryLetterId=t.category_letter_id),t.hasOwnProperty("subcategories")){var r=[],a=void 0;for(a=0;a-1,t.hasOwnProperty("share_type"))s.indexOf("share")>-1&&"ad"===t.share_type&&(this._isShareAd=!0);this._isPanorama=s.indexOf("panorama")>-1,this._isFee=s.indexOf("fee")>-1,this._isChannelVip=s.indexOf("channel_vip")>-1}},t}();e.default=s},function(t,e,i){e.__esModule=!0;var r=i(0),a=function(t){return t&&t.__esModule?t:{default:t}}(i(1));var s=function(){function t(e){for(var i in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.DefaultTrialData)this["_"+i]=r.DefaultTrialData[i],a.default.defineGetter(this,i);e&&this._resetTrialData(e)}return t.prototype._resetTrialData=function(t){var e=0;switch(t.hasOwnProperty("type")&&(this._type=t.type),t.hasOwnProperty("note")&&(this._note=t.note),this._type){case"episodes":case"cannot":e=0;break;case"time":case"subscribe":case"h5":case"zhuanti":t.hasOwnProperty("time")&&(e=t.time);break;default:e=0}this._time=e},t}();e.default=s},function(t,e,i){e.__esModule=!0;var r=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"mp4",i=[];return this._streamsData.forEach((function(r,a){var s=t.getQualityList(a,e);if(s.length>0){var n={};n.id=a,n.name=t.getLangCodeToCN(a),n.qualityList=s,i.push(n)}})),i},t.prototype.getQualityList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mp4",i=[];if(this._streamsData.has(t)){var r=this._streamsData.get(t);if("mp4"!==e){for(var a in n)if(r.has(a)){var o=this.getStreamByQuality(t,a);i.push(o)}}else for(var l in n)if(r.has(l)){var u=this.getStreamByQuality(t,l),h=s[l].indexOf(u.streamType);0===h&&i.push(u)}}return i},t.prototype.buildStreamData=function(t,e){var i={};return i.id=t,i.name=n[t],i.width=e.width,i.height=e.height,i.duration=e.videoMilliSeconds/1e3,i.segs=e.segs,i.streamURL=e.streamURL,i.hasLogo=e.hasLogo,i.streamType=e.stream_type,i},t.prototype._resetStreamData=function(t){var e=0,i=0,r=0,s=void 0,n=[],o=void 0,l="",u="";for(e=0;e0&&(this._backupURL=t.cdn_backup[0])},t}();e.default=s},function(t,e,i){e.__esModule=!0;var r=i(0),a=function(t){return t&&t.__esModule?t:{default:t}}(i(1));var s=function(){function t(e){for(var i in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.DefaultWaterMark)this["_"+i]=Object.assign({},r.DefaultWaterMark[i]),a.default.defineGetter(this,i);e&&this._resetData(e)}return t.prototype.getLogoStyle=function(t){var e="";if(t){var i=t;switch(i.refCoord){case 0:e="left:"+2*i.posX+"rpx;top:"+2*i.posY+"rpx;";break;case 1:e="right:"+2*i.posX+"rpx;top:"+2*i.posY+"rpx;";break;case 2:e="right:"+2*i.posX+"rpx;bottom:"+2*i.posY+"rpx;";break;case 3:e="left:"+2*i.posX+"rpx;bottom:"+2*i.posY+"rpx;"}0===i.width&&(i.width=50),e+="position:absolute;width:"+2*i.width+"rpx;height:auto;opacity:"+i.alpha+";"}return e},t.prototype._resetData=function(t){for(var e=0,i=t.length;e49&&this.historyList.pop();var e={};e.duration=t.videoData.duration,e.id=t.videoData.encodeId,e.idNum=t.videoData.id,e.title=t.videoData.title,e.thumbnail=t.videoData.coverURL,e.timestamp=(new Date).getTime(),e.currentTime=0,e.playProcess=0,this.historyList.splice(0,0,e),this.setHistoryList()},t.prototype.getCurrectVideo=function(t){for(var e=null,i=0;i5||t100&&(a=100),r.playProcess=parseInt(a),r.timestamp=(new Date).getTime(),this.historyList.splice(0,0,r),this.setHistoryList()}}},t}();e.default=r}])}},function(t){t.O(0,[6907,8096],(function(){return e=3609,t(t.s=e);var e})),t.O()}]); \ No newline at end of file +require('../../sub-vendors.js'), + (wx.webpackJsonp = wx.webpackJsonp || []).push([ + [9818], + { + 3609: function (t, e, i) { + var r = i(9476), + a = i(2573), + s = i.n(a), + n = i(3919).window + !(function (t) { + var e = {} + function i(r) { + if (e[r]) return e[r].exports + var a = (e[r] = { i: r, l: !1, exports: {} }) + return t[r].call(a.exports, a, a.exports, i), (a.l = !0), a.exports + } + ;(i.m = t), + (i.c = e), + (i.d = function (t, e, r) { + i.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }) + }), + (i.r = function (t) { + 'undefined' != typeof Symbol && + Symbol.toStringTag && + Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }), + Object.defineProperty(t, '__esModule', { value: !0 }) + }), + (i.t = function (t, e) { + if ((1 & e && (t = i(t)), 8 & e)) return t + if (4 & e && 'object' === (0, r.A)(t) && t && t.__esModule) return t + var a = Object.create(null) + if ( + (i.r(a), + Object.defineProperty(a, 'default', { enumerable: !0, value: t }), + 2 & e && 'string' != typeof t) + ) + for (var s in t) + i.d( + a, + s, + function (e) { + return t[e] + }.bind(null, s), + ) + return a + }), + (i.n = function (t) { + var e = + t && t.__esModule + ? function () { + return t.default + } + : function () { + return t + } + return i.d(e, 'a', e), e + }), + (i.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e) + }), + (i.p = ''), + i((i.s = 6)) + })([ + function (t, e, i) { + e.__esModule = !0 + ;(e.DefaultVideoData = { + id: 0, + encodeId: '', + title: '', + duration: 0, + videoType: '', + isShareAd: !1, + isDanmaku: !1, + isPanorama: !1, + isFee: !1, + isChannelVip: !1, + isSubscribe: !1, + isRtmp: !1, + isTrial: !1, + isVertical: !1, + categoryId: 0, + categoryLetterId: '', + categoryString: '', + tags: [], + coverURL: '', + }), + (e.DefaultWaterMark = { logo: {}, license: {}, register: {} }), + (e.DefaultTrialData = { type: '', time: 0, note: '' }), + (e.DefaultSegmentData = { seconds: 0, index: -1, size: 0, src: '', backupURL: '' }), + (e.DefaultPlayListData = { + upsData: null, + userData: null, + errorData: null, + videoData: null, + watermark: null, + showData: null, + trialData: null, + nextVideo: null, + isError: !1, + }) + }, + function (t, e, i) { + e.__esModule = !0 + var r = { + defineGetter: function (t, e) { + Object.defineProperty(t, e, { + get: function () { + return t['_' + e] + }, + }) + }, + } + e.default = r + }, + function (t, e, i) { + e.__esModule = !0 + ;(e.PlayerStatusEvent = { + PLAYER_IS_READY: 'Player.Is.Ready', + PLAYER_IS_PAUSED: 'Player.Is.Paused', + PLAYER_IS_PLAYING: 'Player.Is.Playing', + PLAYER_PLAY_START: 'Player.Play.Start', + PLAYER_BUFFER_EMPTY: 'Player.Buffer.Empty', + PLAYER_PLAY_END: 'Player.Play.End', + PLAYER_PLAY_STOP: 'Player.Play.Stop', + PLAYER_DESTORY: 'Player.Destory', + PLAYER_PLAY_FAILED: 'Player.Play.Failed', + SERVICE_IS_DONE: 'Service.Is.Done', + PLAYER_FULL_SCREEN: 'Player.Full.Screen', + PLAYER_GOTO_LOGIN: 'Player.Goto.Login', + }), + (e.PlayerCommandEvent = { + START: 'start', + PLAY: 'play', + PAUSE: 'pause', + SEEK: 'seek', + REPLAY: 'replay', + RELOAD: 'reload', + RESTART: 'restart', + }) + }, + function (t, e, i) { + var a, + s = + 'function' == typeof Symbol && 'symbol' === (0, r.A)(Symbol.iterator) + ? function (t) { + return (0, r.A)(t) + } + : function (t) { + return t && 'function' == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype + ? 'symbol' + : (0, r.A)(t) + }, + n = 'object' === ('undefined' == typeof Reflect ? 'undefined' : s(Reflect)) ? Reflect : null, + o = + n && 'function' == typeof n.apply + ? n.apply + : function (t, e, i) { + return Function.prototype.apply.call(t, e, i) + } + a = + n && 'function' == typeof n.ownKeys + ? n.ownKeys + : Object.getOwnPropertySymbols + ? function (t) { + return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)) + } + : function (t) { + return Object.getOwnPropertyNames(t) + } + var l = + Number.isNaN || + function (t) { + return t != t + } + function u() { + u.init.call(this) + } + ;(t.exports = u), + (u.EventEmitter = u), + (u.prototype._events = void 0), + (u.prototype._eventsCount = 0), + (u.prototype._maxListeners = void 0) + var h = 10 + function c(t) { + return void 0 === t._maxListeners ? u.defaultMaxListeners : t._maxListeners + } + function p(t, e, i, r) { + var a, n, o + if ('function' != typeof i) + throw new TypeError( + 'The "listener" argument must be of type Function. Received type ' + + (void 0 === i ? 'undefined' : s(i)), + ) + if ( + (void 0 === (n = t._events) + ? ((n = t._events = Object.create(null)), (t._eventsCount = 0)) + : (void 0 !== n.newListener && + (t.emit('newListener', e, i.listener ? i.listener : i), (n = t._events)), + (o = n[e])), + void 0 === o) + ) + (o = n[e] = i), ++t._eventsCount + else if ( + ('function' == typeof o ? (o = n[e] = r ? [i, o] : [o, i]) : r ? o.unshift(i) : o.push(i), + (a = c(t)) > 0 && o.length > a && !o.warned) + ) { + o.warned = !0 + var l = new Error( + 'Possible EventEmitter memory leak detected. ' + + o.length + + ' ' + + String(e) + + ' listeners added. Use emitter.setMaxListeners() to increase limit', + ) + ;(l.name = 'MaxListenersExceededWarning'), + (l.emitter = t), + (l.type = e), + (l.count = o.length), + console && console.warn + } + return t + } + function d() { + for (var t = [], e = 0; e < arguments.length; e++) t.push(arguments[e]) + this.fired || + (this.target.removeListener(this.type, this.wrapFn), + (this.fired = !0), + o(this.listener, this.target, t)) + } + function f(t, e, i) { + var r = { fired: !1, wrapFn: void 0, target: t, type: e, listener: i }, + a = d.bind(r) + return (a.listener = i), (r.wrapFn = a), a + } + function y(t, e, i) { + var r = t._events + if (void 0 === r) return [] + var a = r[e] + return void 0 === a + ? [] + : 'function' == typeof a + ? i + ? [a.listener || a] + : [a] + : i + ? (function (t) { + for (var e = new Array(t.length), i = 0; i < e.length; ++i) e[i] = t[i].listener || t[i] + return e + })(a) + : m(a, a.length) + } + function _(t) { + var e = this._events + if (void 0 !== e) { + var i = e[t] + if ('function' == typeof i) return 1 + if (void 0 !== i) return i.length + } + return 0 + } + function m(t, e) { + for (var i = new Array(e), r = 0; r < e; ++r) i[r] = t[r] + return i + } + Object.defineProperty(u, 'defaultMaxListeners', { + enumerable: !0, + get: function () { + return h + }, + set: function (t) { + if ('number' != typeof t || t < 0 || l(t)) + throw new RangeError( + 'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + + t + + '.', + ) + h = t + }, + }), + (u.init = function () { + ;(void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events) || + ((this._events = Object.create(null)), (this._eventsCount = 0)), + (this._maxListeners = this._maxListeners || void 0) + }), + (u.prototype.setMaxListeners = function (t) { + if ('number' != typeof t || t < 0 || l(t)) + throw new RangeError( + 'The value of "n" is out of range. It must be a non-negative number. Received ' + t + '.', + ) + return (this._maxListeners = t), this + }), + (u.prototype.getMaxListeners = function () { + return c(this) + }), + (u.prototype.emit = function (t) { + for (var e = [], i = 1; i < arguments.length; i++) e.push(arguments[i]) + var r = 'error' === t, + a = this._events + if (void 0 !== a) r = r && void 0 === a.error + else if (!r) return !1 + if (r) { + var s + if ((e.length > 0 && (s = e[0]), s instanceof Error)) throw s + var n = new Error('Unhandled error.' + (s ? ' (' + s.message + ')' : '')) + throw ((n.context = s), n) + } + var l = a[t] + if (void 0 === l) return !1 + if ('function' == typeof l) o(l, this, e) + else { + var u = l.length, + h = m(l, u) + for (i = 0; i < u; ++i) o(h[i], this, e) + } + return !0 + }), + (u.prototype.addListener = function (t, e) { + return p(this, t, e, !1) + }), + (u.prototype.on = u.prototype.addListener), + (u.prototype.prependListener = function (t, e) { + return p(this, t, e, !0) + }), + (u.prototype.once = function (t, e) { + if ('function' != typeof e) + throw new TypeError( + 'The "listener" argument must be of type Function. Received type ' + + (void 0 === e ? 'undefined' : s(e)), + ) + return this.on(t, f(this, t, e)), this + }), + (u.prototype.prependOnceListener = function (t, e) { + if ('function' != typeof e) + throw new TypeError( + 'The "listener" argument must be of type Function. Received type ' + + (void 0 === e ? 'undefined' : s(e)), + ) + return this.prependListener(t, f(this, t, e)), this + }), + (u.prototype.removeListener = function (t, e) { + var i, r, a, n, o + if ('function' != typeof e) + throw new TypeError( + 'The "listener" argument must be of type Function. Received type ' + + (void 0 === e ? 'undefined' : s(e)), + ) + if (void 0 === (r = this._events)) return this + if (void 0 === (i = r[t])) return this + if (i === e || i.listener === e) + 0 == --this._eventsCount + ? (this._events = Object.create(null)) + : (delete r[t], r.removeListener && this.emit('removeListener', t, i.listener || e)) + else if ('function' != typeof i) { + for (a = -1, n = i.length - 1; n >= 0; n--) + if (i[n] === e || i[n].listener === e) { + ;(o = i[n].listener), (a = n) + break + } + if (a < 0) return this + 0 === a + ? i.shift() + : (function (t, e) { + for (; e + 1 < t.length; e++) t[e] = t[e + 1] + t.pop() + })(i, a), + 1 === i.length && (r[t] = i[0]), + void 0 !== r.removeListener && this.emit('removeListener', t, o || e) + } + return this + }), + (u.prototype.off = u.prototype.removeListener), + (u.prototype.removeAllListeners = function (t) { + var e, i, r + if (void 0 === (i = this._events)) return this + if (void 0 === i.removeListener) + return ( + 0 === arguments.length + ? ((this._events = Object.create(null)), (this._eventsCount = 0)) + : void 0 !== i[t] && + (0 == --this._eventsCount ? (this._events = Object.create(null)) : delete i[t]), + this + ) + if (0 === arguments.length) { + var a, + s = Object.keys(i) + for (r = 0; r < s.length; ++r) 'removeListener' !== (a = s[r]) && this.removeAllListeners(a) + return ( + this.removeAllListeners('removeListener'), + (this._events = Object.create(null)), + (this._eventsCount = 0), + this + ) + } + if ('function' == typeof (e = i[t])) this.removeListener(t, e) + else if (void 0 !== e) for (r = e.length - 1; r >= 0; r--) this.removeListener(t, e[r]) + return this + }), + (u.prototype.listeners = function (t) { + return y(this, t, !0) + }), + (u.prototype.rawListeners = function (t) { + return y(this, t, !1) + }), + (u.listenerCount = function (t, e) { + return 'function' == typeof t.listenerCount ? t.listenerCount(e) : _.call(t, e) + }), + (u.prototype.listenerCount = _), + (u.prototype.eventNames = function () { + return this._eventsCount > 0 ? a(this._events) : [] + }) + }, + function (t, e, i) { + e.__esModule = !0 + var r = (function () { + function t(t, e) { + for (var i = 0; i < e.length; i++) { + var r = e[i] + ;(r.enumerable = r.enumerable || !1), + (r.configurable = !0), + 'value' in r && (r.writable = !0), + Object.defineProperty(t, r.key, r) + } + } + return function (e, i, r) { + return i && t(e.prototype, i), r && t(e, r), e + } + })() + !(function (t) { + t && t.__esModule + })(i(9)) + var a = (function () { + function t(e) { + ;(function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + (this.config = e), + (this._logHost = 'https://gm.mmstat.com/yt/vx/'), + (this._logName = ''), + (this._id = 'youkulog'), + (this._enabled = !0) + } + return ( + (t.prototype.formatParams = function (t) { + var e = [] + for (var i in t) 'aplus' === i ? e.push(i) : e.push(i + '=' + encodeURIComponent(t[i])) + return e.join('&') + }), + (t.prototype.onNetStatus = function (t) { + if (!this.enabled) return !1 + }), + (t.prototype.getParams = function () { + return {} + }), + (t.prototype.processEnabledChange = function () {}), + (t.prototype.report = function () { + if (this._enabled) { + var t = this.getParams() + this._config && Object.assign(t, this._config) + var e = this._logHost + this._logName + '?' + this.formatParams(t) + s().request({ url: e }) + } + }), + r(t, [ + { + key: 'id', + get: function () { + return this._id + }, + set: function (t) { + this._id = t + }, + }, + { + key: 'config', + set: function (t) { + this._config = t + }, + }, + { + key: 'enabled', + get: function () { + return this._enabled + }, + set: function (t) { + ;(this._enabled = t), this.processEnabledChange() + }, + }, + ]), + t + ) + })() + e.default = a + }, + , + function (t, e, i) { + var r = l(i(7)), + a = l(i(12)), + n = i(2), + o = l(i(19)) + function l(t) { + return t && t.__esModule ? t : { default: t } + } + Component({ + properties: { + ccode: { type: String, value: '0517' }, + utid: { type: String, value: 'eWrCEmi2cFsCAWoLI41wnWhW' }, + playerId: { type: String, value: 'youku-player' }, + vid: { + type: String, + observer: function (t) { + this.setVid(t) + }, + }, + showid: { + type: String, + observer: function (t) { + this.setShowid(t) + }, + }, + allowRecord: { type: Boolean, value: !0 }, + supportType: { type: String, value: 'hls' }, + coverURL: { type: String }, + streamURL: { + type: String, + value: '', + observer: function (t) { + this.setStreamURL(t) + }, + }, + isLogin: { type: Boolean, value: !1 }, + }, + data: { + isShowLayer: !1, + panelName: '', + isError: !1, + errorMessage: '', + openAppParam: '', + isVertical: !1, + logo: '', + logoStyle: '', + fullLogo: '', + fullLogoStyle: '', + initialTime: 0, + }, + attached: function () { + var t = this + ;(this.currectStream = {}), + (this.autoplay = !0), + (this.retryCount = 0), + (this.playlistData = null), + (this.playTimer = null), + (this.isFirstUpdate = !1), + (this.vidNum = 0), + (this.startTime = 0), + (this.networkType = ''), + (this.historyService = new o.default()), + (this._log = new r.default({ ccode: this.data.ccode, utid: this.data.utid })), + (this._service = new a.default()), + (this.videoContext = s().createVideoContext(this.data.playerId, this)), + s().getNetworkType({ + complete: function (e) { + e.networkType ? (t.networkType = e.networkType) : (t.networkType = 'none'), + (t.autoplay = !0), + 'none' !== t.networkType && 'wifi' !== t.networkType && (t.autoplay = !1), + (t.isReady = !0), + t.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_IS_READY, + data: { playerId: t.data.playerId }, + }), + t.reset() + }, + }), + s().onNetworkStatusChange(function (e) { + t.networkType = e.networkType + }) + }, + pageLifetimes: { show: function () {}, hide: function () {} }, + methods: { + onLayerEvent: function (t) { + switch (t.detail) { + case 'GOTO_LOGIN': + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_GOTO_LOGIN, + data: { playerId: this.data.playerId }, + }) + break + case 'PLAYER_REPLAY': + this.replay() + break + case 'PLAYER_REFRASH': + this.isError + ? this.vid || this.showid + ? this.reset() + : this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_PLAY_FAILED, + data: { playerId: this.data.playerId, message: 'player no vid OR showid' }, + }) + : this.replay() + break + case 'PLAYER_PLAY': + ;(this.autoplay = !0), this.data.streamURL && this.play() + } + }, + onPlayHandler: function () {}, + onPauseHandler: function () { + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_IS_PAUSED, + data: { playerId: this.data.playerId }, + }), + this._log.onNetStatus({ + code: n.PlayerStatusEvent.PLAYER_IS_PAUSED, + data: { playerId: this.data.playerId }, + }) + }, + onBufferHandler: function () { + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_BUFFER_EMPTY, + data: { playerId: this.data.playerId }, + }), + this._log.onNetStatus({ + code: n.PlayerStatusEvent.PLAYER_BUFFER_EMPTY, + data: { playerId: this.data.playerId }, + }) + }, + onErrorHandler: function (t) { + var e = this + wx.getSystemInfo({ + success: function (t) { + if (-1 === t.system.indexOf('iOS')) { + if (!e.data.streamURL) return + e.playTimer && clearTimeout(e.playTimer), + e.videoContext && e.videoContext.pause(), + e.retryCount++, + e.retryCount < 2 && 'hls' === e.data.supportType + ? e.currectStream && + e.currectStream.segs && + e.currectStream.segs[0] && + e.currectStream.segs[0].src && + e.setData({ streamURL: e.currectStream.segs[0].src }) + : (e.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_PLAY_FAILED, + data: { playerId: e.data.playerId }, + }), + e._log.onNetStatus({ + code: n.PlayerStatusEvent.PLAYER_PLAY_FAILED, + data: { playerId: e.data.playerId }, + }), + e.showError()) + } + }, + }) + }, + onTimerHandler: function (t) { + this.data.streamURL && + (this.isFirstUpdate + ? (this.currentTime = t.detail.currentTime) + : ((this.isFirstUpdate = !0), + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_PLAY_START, + data: { playerId: this.data.playerId }, + }), + this._log.onNetStatus({ + code: n.PlayerStatusEvent.PLAYER_PLAY_START, + data: { playerId: this.data.playerId }, + })), + this.data.allowRecord && this.historyService.updataRecodeTime(t.detail.currentTime, this.vidNum), + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_IS_PLAYING, + data: { time: t.detail.currentTime, playerId: this.data.playerId }, + }), + this._log.onNetStatus({ + code: n.PlayerStatusEvent.PLAYER_IS_PLAYING, + data: { time: t.detail.currentTime, playerId: this.data.playerId }, + })) + }, + onFullHandler: function (t) { + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_FULL_SCREEN, + data: { full: t.detail.fullScreen, playerId: this.data.playerId }, + }) + }, + onEndHandler: function (t) { + var e = 'end' + this.playlistData && + this.playlistData.videoData.isTrial && + (e = + this.playlistData.videoData.isFee || this.playlistData.videoData.isChannelVip ? 'vip' : 'login'), + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_PLAY_END, + data: { status: e, playerId: this.data.playerId }, + }), + this._log.onNetStatus({ + code: n.PlayerStatusEvent.PLAYER_PLAY_END, + data: { status: e, playerId: this.data.playerId }, + }), + this.setData({ panelName: e, isShowLayer: !0 }) + }, + setVid: function (t) { + '' !== t && + this.isReady && + (this.setData({ showid: '' }), + this._log.onNetStatus({ code: n.PlayerCommandEvent.RESTART }), + this.reset()) + }, + setShowid: function (t) { + '' !== t && + this.isReady && + (this.setData({ vid: '' }), + this._log.onNetStatus({ code: n.PlayerCommandEvent.RESTART }), + this.reset()) + }, + setStreamURL: function (t) { + this.autoplay && t && this.play(), this.setData({ initialTime: this.startTime }) + }, + _requestUps: function () { + var t = {} + ;(t.ccode = this.data.ccode), + (t.utid = this.data.utid), + this.data.showid ? (t.showid = this.data.showid) : (t.vid = this.data.vid) + var e = { onSuccess: this.parseMeidaData.bind(this), onError: this.loadError.bind(this) } + this._service.start(t, e) + }, + loadError: function (t) { + t.playlistData && + ((this.currectStream = null), + (this.playlistData = t.playlistData), + (this.vidNum = this.playlistData.videoData.id), + (this.coverURL = this.playlistData.videoData.coverURL)), + this.showError('error', t.errorMessage) + }, + parseMeidaData: function (t) { + t.userData && t.userData.uid && !this.data.isLogin && this.setData({ isLogin: !0 }), + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.SERVICE_IS_DONE, + data: { playerId: this.data.playerId, upsdata: t }, + }), + this._log.onNetStatus({ code: n.PlayerStatusEvent.SERVICE_IS_DONE, data: t }), + (this.playlistData = t), + (this.vidNum = this.playlistData.videoData.id), + (this.startTime = 0) + var e = void 0 + if (this.data.allowRecord) { + var i = this.historyService.getCurrectVideo(this.playlistData.videoData.id) + i + ? ((this.startTime = Number(i.currentTime)), + this.startTime > this.playlistData.videoData.duration - 10 && + (this.startTime = this.playlistData.videoData.duration - 10)) + : this.historyService.addHistory(t) + } + var r = this.playlistData.getMediaStreamData('mp4') + r && + r[0] && + ((this.currectStream = this.playlistData.getStreamByQuality(r[0].id, '480p')), + (this.currectStream && this.currectStream.streamURL) || (this.currectStream = r[0].qualityList[0]), + this.currectStream && + (!this.currectStream.hasLogo && + this.playlistData.watermark.logo && + this.playlistData.watermark.logo.logo && + this.setData({ + logo: this.playlistData.watermark.logo.logo, + logoStyle: this.playlistData.watermark.logo.logoStyle, + fullLogo: this.playlistData.watermark.logo.fullLogo, + fullLogoStyle: this.playlistData.watermark.logo.fullLogoStyle, + }), + 'hls' === this.data.supportType && this.currectStream.streamURL + ? (e = this.currectStream.streamURL) + : this.currectStream.segs && + this.currectStream.segs[0] && + this.currectStream.segs[0].src && + (e = this.currectStream.segs[0].src))), + e + ? this.setData({ + streamURL: e, + coverURL: t.videoData.coverURL, + isVertical: t.videoData.isVertical, + }) + : (this.setData({ coverURL: t.videoData.coverURL }), this.showError()) + }, + showError: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 'error', + e = + arguments.length > 1 && void 0 !== arguments[1] + ? arguments[1] + : '视频暂时无法播放,小酷正全力修复中,非常抱歉' + '4g' === t || 'init' === t || 'loading' === t + ? (this.isError = !1) + : ((this.isError = !0), + 'none' !== this.networkType && + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_PLAY_FAILED, + data: { playerId: this.data.playerId, message: e }, + })), + this.setData({ isShowLayer: !0, panelName: t, errorMessage: e }) + }, + reset: function () { + var t = 'loading' + switch ( + (this.videoContext && this.videoContext.pause(), + this.playTimer && clearTimeout(this.playTimer), + this.networkType) + ) { + case 'none': + t = 'nonetwork' + break + case 'wifi': + this.autoplay || (t = 'init') + break + default: + this.autoplay || (t = '4g') + } + ;(this.isFirstUpdate = !1), + (this.retryCount = 0), + this.setData({ streamURL: '', logo: '', logoStyle: '', fullLogo: '', fullLogoStyle: '' }), + this.showError(t), + this.historyService && this.historyService.reset(), + (this.data.vid || this.data.showid) && + (this.historyService && this.historyService.getHistoryList(), this._requestUps()) + }, + replay: function () { + var t = this + this._log && this._log.onNetStatus({ code: n.PlayerCommandEvent.REPLAY }), + (this.startTime = 0), + (this.isFirstUpdate = !1), + this.setData({ initialTime: this.startTime }), + this.videoContext && this.videoContext.seek(0), + this.playTimer && clearTimeout(this.playTimer), + this.data.isShowLayer && this.setData({ isShowLayer: !1 }), + (this.playTimer = setTimeout(function () { + t.videoContext && t.videoContext.play() + }, 1500)) + }, + play: function () { + var t = this + this.playTimer && clearTimeout(this.playTimer), + this.data.isShowLayer && this.setData({ isShowLayer: !1 }), + (this.playTimer = setTimeout(function () { + t.videoContext.play() + }, 1e3)) + }, + pause: function () { + this._log && this._log.onNetStatus({ code: n.PlayerStatusEvent.PLAYER_IS_PAUSED }), + this.videoContext && this.videoContext.pause() + }, + stop: function () { + this.data.isShowLayer || + (this._log.onNetStatus({ code: n.PlayerStatusEvent.PLAYER_PLAY_STOP }), + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_PLAY_STOP, + data: { playerId: this.data.playerId }, + }), + this.videoContext && this.videoContext.pause(), + this.playTimer && clearTimeout(this.playTimer), + (this.startTime = this.currentTime), + (this.isFirstUpdate = !1), + this.setData({ initialTime: this.startTime }), + this.showError('init')) + }, + destory: function () { + ;(this.currectStream = null), + (this.playlistData = null), + this.setData({ vid: '', streamURL: '', panelName: '' }), + this.videoContext && this.videoContext.pause(), + this.playTimer && clearTimeout(this.playTimer), + this.triggerEvent('YoukuPlayerEvent', { + code: n.PlayerStatusEvent.PLAYER_DESTORY, + data: { playerId: this.data.playerId }, + }), + this._log && this._log.onNetStatus({ code: n.PlayerStatusEvent.PLAYER_DESTORY }) + }, + }, + }) + }, + function (t, e, i) { + e.__esModule = !0 + var a = (function () { + function t(t, e) { + for (var i = 0; i < e.length; i++) { + var r = e[i] + ;(r.enumerable = r.enumerable || !1), + (r.configurable = !0), + 'value' in r && (r.writable = !0), + Object.defineProperty(t, r.key, r) + } + } + return function (e, i, r) { + return i && t(e.prototype, i), r && t(e, r), e + } + })(), + s = i(3), + n = l(i(8)), + o = l(i(10)) + function l(t) { + return t && t.__esModule ? t : { default: t } + } + function u(t, e) { + if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called") + return !e || ('object' !== (0, r.A)(e) && 'function' != typeof e) ? t : e + } + var h = (function (t) { + function e(i) { + !(function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, e) + var r = u(this, t.call(this)) + return (r._config = i), r._initialize(), r + } + return ( + (function (t, e) { + if ('function' != typeof e && null !== e) + throw new TypeError('Super expression must either be null or a function, not ' + (0, r.A)(e)) + ;(t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 }, + })), + e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e)) + })(e, t), + (e.prototype.put = function (t) { + t && this._loggers.set(t.id, t) + }), + (e.prototype.remove = function (t) { + t && this._loggers.has(t.id) && this._loggers.delete(t.id) + }), + (e.prototype.onNetStatus = function (t) { + var e = this + this._loggers.forEach(function (i) { + 'function' == typeof i.onNetStatus ? i.onNetStatus(t) : e._loggers.delete(i.id) + }) + }), + (e.prototype._initialize = function () { + ;(this._loggers = new Map()), this.init() + }), + (e.prototype.init = function () { + this.put(new n.default(this._config)), this.put(new o.default(this._config)) + }), + (e.prototype.destory = function () { + t.prototype.destroy.call(this), this._loggers.clear() + }), + a(e, [ + { + key: 'config', + set: function (t) { + ;(this._config = t), + this._loggers.forEach(function (e) { + e.config = t + }) + }, + }, + ]), + e + ) + })(s.EventEmitter) + e.default = h + }, + function (t, e, i) { + e.__esModule = !0 + var a = (function (t) { + return t && t.__esModule ? t : { default: t } + })(i(4)), + s = i(2) + function n(t, e) { + if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called") + return !e || ('object' !== (0, r.A)(e) && 'function' != typeof e) ? t : e + } + var o = (function (t) { + function e(i) { + !(function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, e) + var r = n(this, t.call(this, i)) + return (r.id = 'vvlog'), (r._logName = 'youkuweixin.player.vdoview'), r._reset(), r + } + return ( + (function (t, e) { + if ('function' != typeof e && null !== e) + throw new TypeError('Super expression must either be null or a function, not ' + (0, r.A)(e)) + ;(t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 }, + })), + e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e)) + })(e, t), + (e.prototype._resetParams = function () { + this._playlistData + ? ((this._param.encodeId = this._playlistData.videoData.encodeId), + (this._param.vid = this._playlistData.videoData.id), + (this._param.vvid = this._playlistData.upsData.psid || ''), + (this._param.videotype = this._playlistData.videoData.videoType || ''), + (this._param.showcategory = this._playlistData.showData.showcategory || ''), + this._playlistData.userData.ytid + ? (this._param.user_id = this._playlistData.userData.ytid) + : (this._param.user_id = this._playlistData.userData.uid)) + : ((this._param.vid = ''), + (this._param.encodeId = ''), + (this._param.vvid = ''), + (this._param.user_id = 0)) + }), + (e.prototype.onNetStatus = function (t) { + switch (t.code) { + case s.PlayerStatusEvent.PLAYER_PLAY_START: + if (!this._playlistData) return + this.report(), (this.enabled = !1) + break + case s.PlayerCommandEvent.RESTART: + case s.PlayerStatusEvent.PLAYER_DESTORY: + ;(this._playlistData = null), this._reset() + break + case s.PlayerCommandEvent.REPLAY: + this._reset() + break + case s.PlayerStatusEvent.SERVICE_IS_DONE: + ;(this._playlistData = t.data), this._resetParams() + } + }), + (e.prototype.getParams = function () { + return this._param + }), + (e.prototype._reset = function () { + ;(this.enabled = !0), (this._param = {}), this._resetParams() + }), + e + ) + })(a.default) + e.default = o + }, + function (t, e, i) { + e.__esModule = !0 + var r = { + rand: function (t, e) { + var i, + r = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''), + a = [], + s = 0 + if (((e = e || r.length), t)) for (s = 0; s < t; s++) a[s] = r[0 | (Math.random() * e)] + else + for (a[8] = a[13] = a[18] = a[23] = '-', a[14] = '4', s = 0; s < 36; s++) + a[s] || ((i = 0 | (16 * Math.random())), (a[s] = r[19 === s ? (3 & i) | 8 : i])) + return a.join('') + }, + } + e.default = r + }, + function (t, e, i) { + e.__esModule = !0 + var a = o(i(4)), + s = i(2), + n = o(i(11)) + function o(t) { + return t && t.__esModule ? t : { default: t } + } + function l(t, e) { + if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called") + return !e || ('object' !== (0, r.A)(e) && 'function' != typeof e) ? t : e + } + var u = (function (t) { + function e(i) { + !(function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, e) + var r = l(this, t.call(this, i)) + return (r.id = 'tslog'), (r._logName = 'youkuweixin.player.vtslog'), r.reset(), r + } + return ( + (function (t, e) { + if ('function' != typeof e && null !== e) + throw new TypeError('Super expression must either be null or a function, not ' + (0, r.A)(e)) + ;(t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 }, + })), + e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e)) + })(e, t), + (e.prototype.onNetStatus = function (t) { + if (!this._enabled) return !1 + switch (t.code) { + case s.PlayerStatusEvent.PLAYER_IS_PLAYING: + if (!this._playlistData) return + this._timer.getRunning() || this._timer.start() + break + case s.PlayerStatusEvent.PLAYER_PLAY_END: + if ((this._timer.getRunning() && this._timer.pause(), !this._playlistData)) return + ;(this._param.playcomplete = '1'), this.report() + break + case s.PlayerCommandEvent.RESTART: + case s.PlayerStatusEvent.PLAYER_DESTORY: + ;(this._playlistData = null), this.reset() + break + case s.PlayerCommandEvent.REPLAY: + this.reset() + break + case s.PlayerStatusEvent.SERVICE_IS_DONE: + ;(this._playlistData = t.data), this._resetParams() + break + case s.PlayerStatusEvent.PLAYER_IS_PAUSED: + case s.PlayerStatusEvent.PLAYER_PLAY_STOP: + case s.PlayerStatusEvent.PLAYER_PLAY_FAILED: + this._timer.getRunning() && this._timer.pause() + } + }), + (e.prototype.reset = function () { + ;(this._enabled = !0), + (this._param = {}), + (this._param.playcomplete = '0'), + (this._param.serialnumber = 0), + (this._param.playtime = 0), + (this._param.heartbeatInterval = 5), + (this._num = 0), + this._timer + ? this._timer.reset() + : ((this._timer = new n.default(5e3)), + this._timer.addEventListener(n.default.TIMER, this._onTimer.bind(this))), + this._timer.pause(), + this._resetParams() + }), + (e.prototype.getParams = function () { + return this._param + }), + (e.prototype._resetParams = function () { + this._playlistData + ? ((this._param.vid = this._playlistData.videoData.id), + (this._param.vvid = this._playlistData.upsData.psid || ''), + (this._param.videotype = this._playlistData.videoData.videoType || ''), + (this._param.showcategory = this._playlistData.showData.showcategory || ''), + this._playlistData.userData.ytid + ? (this._param.user_id = this._playlistData.userData.ytid) + : (this._param.user_id = this._playlistData.userData.uid)) + : ((this._param.vid = ''), (this._param.vvid = ''), (this._param.user_id = 0)) + }), + (e.prototype._onTimer = function () { + this._checkTSLogTimes() && this.report() + }), + (e.prototype._signTS = function (t) { + if (!t) return 0 + var e = 0, + i = void 0, + r = t.length + for (i = 0; i < r; i++) (e = 43 * e + t.charCodeAt(i)), (e %= 1e10) + return e + }), + (e.prototype._checkTSLogTimes = function () { + var t + return ( + this._num++, + (this._param.playtime = 5 * this._num), + this._num <= 12 + ? (this._param.heartbeatInterval = 5) + : this._num <= 36 + ? (this._param.heartbeatInterval = 10) + : (this._param.heartbeatInterval = 20), + (t = this._param.playtime % this._param.heartbeatInterval == 0) && this._param.serialnumber++, + t + ) + }), + e + ) + })(a.default) + e.default = u + }, + function (t, e, i) { + function a(t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + } + function s(t, e) { + if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called") + return !e || ('object' !== (0, r.A)(e) && 'function' != typeof e) ? t : e + } + e.__esModule = !0 + var o = (function (t) { + function e(i) { + var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 / 0, + n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2] + a(this, e) + var o = s(this, t.call(this)) + return ( + (o.listeners = {}), + (o.milliseconds = 0), + (o.interval = i), + (o.repeat = o.repeatTracker = r), + (o.useTimeout = n), + (o.timeoutDelay = Math.round(i / 20)), + o + ) + } + return ( + (function (t, e) { + if ('function' != typeof e && null !== e) + throw new TypeError('Super expression must either be null or a function, not ' + (0, r.A)(e)) + ;(t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 }, + })), + e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : (t.__proto__ = e)) + })(e, t), + (e.prototype.getCurrentCount = function () { + return this.repeat - this.repeatTracker + }), + (e.prototype.getInterval = function () { + return this.interval + }), + (e.prototype.getMilliseconds = function () { + return this.milliseconds + }), + (e.prototype.getRepeatCount = function () { + return this.repeat + }), + (e.prototype.getRunning = function () { + return void 0 !== this.timer + }), + (e.prototype.addEventListener = function (t, e) { + this.addListener(t, e) + }), + (e.prototype.requestFrame = function (t) { + this.useTimeout ? (this.timeoutId = setTimeout(t, this.timeoutDelay)) : n.requestAnimationFrame(t) + }), + (e.prototype.animationFrame = function () { + var t = this + if (void 0 !== this.timer) + if (this.repeatTracker > 0) { + var e = new Date().getTime() - this.timer + e >= this.interval && + ((this.milliseconds += this.interval), + (this.timer = new Date().getTime() - (e - this.interval)), + this.repeatTracker--, + this.update()), + this.requestFrame(function () { + t.animationFrame() + }) + } else this.complete() + }), + (e.prototype.complete = function () { + this.pause(), this.emit(e.TIMER_COMPLETE, { timer: this, timeRemaining: this.repeatTracker }) + }), + (e.prototype.pause = function () { + this.useTimeout && clearTimeout(this.timeoutId), (this.timer = void 0) + }), + (e.prototype.reset = function () { + ;(this.milliseconds = 0), + (this.repeatTracker = this.repeat), + this.emit(e.TIMER_RESET, { + timer: this, + timeRemaining: this.repeatTracker, + running: this.getRunning(), + }) + }), + (e.prototype.removeEventListener = function (t, e) { + this.removeListener(t, e) + }), + (e.prototype.start = function () { + var t = this + void 0 === this.timer && + ((this.timer = new Date().getTime()), + this.requestFrame(function () { + t.animationFrame() + })) + }), + (e.prototype.update = function () { + this.emit(e.TIMER, { timer: this, timeRemaining: this.repeatTracker }) + }), + e + ) + })(i(3).EventEmitter) + ;(o.TIMER = 'timer'), + (o.TIMER_COMPLETE = 'timer-complete'), + (o.TIMER_RESET = 'timer-reset'), + (e.default = o) + }, + function (t, e, i) { + e.__esModule = !0 + var r = (function (t) { + return t && t.__esModule ? t : { default: t } + })(i(13)) + var a = [ + '该视频小程序暂不支持。', + '出错啦,视频不存在,请看看其他视频吧', + '该视频小程序暂不支持。', + '抱歉,因版权原因无法观看此视频!', + ], + n = (function () { + function t() { + ;(function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + (this.vid = ''), + (this._retryCount = 4) + } + return ( + (t.prototype.start = function (t, e) { + ;(t.vid || t.showid) && + ((this.callbacks = e), + (this.vid = t.vid || ''), + (this.ccode = t.ccode || '0517'), + (this.utid = t.utid || 'eWrCEmi2cFsCAWoLI41wnWhW'), + (this.showid = t.showid || ''), + (this._retryCount = 4), + this.requestData()) + }), + (t.prototype.requestData = function () { + var t = this, + e = { url: 'https://ups.youku.com/ups/get.json' } + ;(e.data = this.getServieceParam()), + (e.success = function (e) { + e.data && t.onComplete(e.data) + }), + (e.fail = function () { + t.dispatchError() + }), + s().request(e) + }), + (t.prototype.getServieceParam = function () { + var t = {} + return ( + (t.vid = this.vid), + this.showid && (t.showid = this.showid), + (t.ccode = this.ccode), + (t.client_ip = '192.168.1.1'), + (t.utid = this.utid), + (t.client_ts = parseInt(new Date().getTime() / 1e3)), + t + ) + }), + (t.prototype.onComplete = function (t) { + if (!t.hasOwnProperty('e') || !t.e.hasOwnProperty('code') || 0 !== t.e.code || !t.data) + return ( + this._retryCount--, + void (this._retryCount < 1 || 1111 === t.status + ? this._playListDataError({ errorCode: '22501' }) + : this.requestData()) + ) + if (t.data.error && t.data.error.code < 0) { + var e = '', + i = [ + ['-1000', '-1001', '-1002', '-1003', ' -1004'], + [ + '-2001', + '-2002', + '-2003', + '-2004', + '-2005', + '-3001', + '-3002', + '-3003', + '-3004', + '-3005', + '-3006', + '-3007', + '-3008', + '-3009', + '-4002', + '-4003', + '-4007', + ], + ['-4001'], + ] + ;-1 !== + [ + '-3006', + '-4003', + '-4004', + '-4005', + '-4006', + '-5001', + '-6001', + '-6003', + '-6004', + '-6005', + '-6006', + ].indexOf(String(t.data.error.code)) && + (e = '23' + (e = String(t.data.error.code)).slice(1, 2) + e.slice(3, 5)) + for (var s = 0, n = 0; n < i.length; n++) + -1 !== i[n].indexOf(String(t.data.error.code)) && (s = n + 1) + var o = new r.default(t.data), + l = a[s] + this._playListDataError({ + playlistData: o, + errorCode: e, + errorMessage: l, + originCode: String(t.data.error.code), + }) + } else { + var u = new r.default(t.data) + this.callbacks.onSuccess(u) + } + }), + (t.prototype._playListDataError = function (t) { + t.errorCode, t.errorMessage || (t.errorMessage = a[0]), this.callbacks.onError(t) + }), + (t.prototype.dispatchError = function () { + this._retryCount--, + this._retryCount < 1 ? this._playListDataError({ errorCode: '20404' }) : this.requestData() + }), + t + ) + })() + e.default = n + }, + function (t, e, i) { + e.__esModule = !0 + var r = (function () { + function t(t, e) { + for (var i = 0; i < e.length; i++) { + var r = e[i] + ;(r.enumerable = r.enumerable || !1), + (r.configurable = !0), + 'value' in r && (r.writable = !0), + Object.defineProperty(t, r.key, r) + } + } + return function (e, i, r) { + return i && t(e.prototype, i), r && t(e, r), e + } + })(), + a = h(i(14)), + s = h(i(15)), + n = h(i(16)), + o = h(i(18)), + l = i(0), + u = h(i(1)) + function h(t) { + return t && t.__esModule ? t : { default: t } + } + var c = (function () { + function t(e) { + if ( + ((function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + !e) + ) + return null + for (var i in ((this._playlistData = e), + (this._upsData = e.ups || {}), + (this._userData = e.user || {}), + e.error && (this._isError = !0), + (this._errorData = e.error || {}), + (this._watermark = new o.default(e.watermark)), + (this._videoData = new a.default(e.video, e.trial, e.controller)), + e.videos && e.videos.next ? (this._nextVideo = e.videos.next) : (this._nextVideo = {}), + (this._showData = e.show || {}), + (this._trialData = new s.default(e.trial)), + (this._streamsData = new n.default(e.stream, e.dvd)), + l.DefaultPlayListData)) + u.default.defineGetter(this, i) + } + return ( + (t.prototype.getMediaStreamData = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 'flv' + return this._streamsData.getMediaStreamData(t) + }), + (t.prototype.getStreamByQuality = function (t, e) { + return this._streamsData.getStreamByQuality(t, e) + }), + r(t, [ + { + key: 'playlistData', + get: function () { + return this._playlistData + }, + }, + { + key: 'streamsData', + get: function () { + return this._streamsData.streamData + }, + }, + ]), + t + ) + })() + e.default = c + }, + function (t, e, i) { + e.__esModule = !0 + var r = i(0), + a = (function (t) { + return t && t.__esModule ? t : { default: t } + })(i(1)) + var s = (function () { + function t(e, i, s) { + for (var n in ((function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + r.DefaultVideoData)) + (this['_' + n] = r.DefaultVideoData[n]), a.default.defineGetter(this, n) + e && this._resetVideoData(e, i, s) + } + return ( + (t.prototype._resetVideoData = function (t, e, i) { + if ( + (t.hasOwnProperty('id') && (this._id = t.id), + t.hasOwnProperty('encodeid') && (this._encodeId = t.encodeid), + t.hasOwnProperty('title') && (this._title = t.title), + t.hasOwnProperty('seconds') && (this._duration = t.seconds), + t.hasOwnProperty('ctype') && (this._videoType = t.ctype), + t.hasOwnProperty('logo') && (this._coverURL = t.logo), + t.hasOwnProperty('category_id') && (this._categoryId = t.category_id), + t.hasOwnProperty('category_letter_id') && (this._categoryLetterId = t.category_letter_id), + t.hasOwnProperty('subcategories')) + ) { + var r = [], + a = void 0 + for (a = 0; a < t.subcategories.length; a++) + t.subcategories[a].hasOwnProperty('id') && r.push(t.subcategories[a].id) + this._categoryString = r.join('|') + } + t.hasOwnProperty('tags') && (this._tags = t.tags), this._resetVideoTypeData(t, e, i) + }), + (t.prototype._resetVideoTypeData = function (t, e, i) { + if ((e && (this._isTrial = !0), e && t.hasOwnProperty('privacy'))) { + var r = 'subscribe' === e.type, + a = 'follower' === t.privacy + r && a && (this._isSubscribe = !1) + } + if ( + (t.hasOwnProperty('transfer_mode') && (this._isRtmp = 'rtmp' === t.transfer_mode), + i.hasOwnProperty('is_phone_stream') && (this._isVertical = 1 === parseInt(i.is_phone_stream)), + t.hasOwnProperty('type')) + ) { + var s = t.type + if (((this._isDanmaku = s.indexOf('bullet') > -1), t.hasOwnProperty('share_type'))) + s.indexOf('share') > -1 && 'ad' === t.share_type && (this._isShareAd = !0) + ;(this._isPanorama = s.indexOf('panorama') > -1), + (this._isFee = s.indexOf('fee') > -1), + (this._isChannelVip = s.indexOf('channel_vip') > -1) + } + }), + t + ) + })() + e.default = s + }, + function (t, e, i) { + e.__esModule = !0 + var r = i(0), + a = (function (t) { + return t && t.__esModule ? t : { default: t } + })(i(1)) + var s = (function () { + function t(e) { + for (var i in ((function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + r.DefaultTrialData)) + (this['_' + i] = r.DefaultTrialData[i]), a.default.defineGetter(this, i) + e && this._resetTrialData(e) + } + return ( + (t.prototype._resetTrialData = function (t) { + var e = 0 + switch ( + (t.hasOwnProperty('type') && (this._type = t.type), + t.hasOwnProperty('note') && (this._note = t.note), + this._type) + ) { + case 'episodes': + case 'cannot': + e = 0 + break + case 'time': + case 'subscribe': + case 'h5': + case 'zhuanti': + t.hasOwnProperty('time') && (e = t.time) + break + default: + e = 0 + } + this._time = e + }), + t + ) + })() + e.default = s + }, + function (t, e, i) { + e.__esModule = !0 + var r = (function () { + function t(t, e) { + for (var i = 0; i < e.length; i++) { + var r = e[i] + ;(r.enumerable = r.enumerable || !1), + (r.configurable = !0), + 'value' in r && (r.writable = !0), + Object.defineProperty(t, r.key, r) + } + } + return function (e, i, r) { + return i && t(e.prototype, i), r && t(e, r), e + } + })(), + a = (function (t) { + return t && t.__esModule ? t : { default: t } + })(i(17)) + var s = { + '270p': ['3gphd'], + '320p': ['mp4sd', 'flvhd'], + '480p': ['mp4hd'], + '720p': ['mp4hd2v2', 'mp4hd2'], + '1080p': ['mp4hd3v2', 'mp4hd3'], + }, + n = { '270p': '省流', '320p': '标清', '480p': '高清', '720p': '超清' }, + o = (function () { + function t(e, i) { + ;(function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + (this._streamsData = new Map()), + (this._languageData = []), + i && i.audiolang && (this._languageData = i.audiolang), + e && this._resetStreamData(e) + } + return ( + (t.prototype.getMediaStreamData = function () { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 'mp4', + i = [] + return ( + this._streamsData.forEach(function (r, a) { + var s = t.getQualityList(a, e) + if (s.length > 0) { + var n = {} + ;(n.id = a), (n.name = t.getLangCodeToCN(a)), (n.qualityList = s), i.push(n) + } + }), + i + ) + }), + (t.prototype.getQualityList = function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'mp4', + i = [] + if (this._streamsData.has(t)) { + var r = this._streamsData.get(t) + if ('mp4' !== e) { + for (var a in n) + if (r.has(a)) { + var o = this.getStreamByQuality(t, a) + i.push(o) + } + } else + for (var l in n) + if (r.has(l)) { + var u = this.getStreamByQuality(t, l), + h = s[l].indexOf(u.streamType) + 0 === h && i.push(u) + } + } + return i + }), + (t.prototype.buildStreamData = function (t, e) { + var i = {} + return ( + (i.id = t), + (i.name = n[t]), + (i.width = e.width), + (i.height = e.height), + (i.duration = e.videoMilliSeconds / 1e3), + (i.segs = e.segs), + (i.streamURL = e.streamURL), + (i.hasLogo = e.hasLogo), + (i.streamType = e.stream_type), + i + ) + }), + (t.prototype._resetStreamData = function (t) { + var e = 0, + i = 0, + r = 0, + s = void 0, + n = [], + o = void 0, + l = '', + u = '' + for (e = 0; e < t.length; e++) (o = (s = t[e]).audio_lang), -1 === n.indexOf(o) && n.push(o) + for (e = 0; e < n.length; e++) { + var h = new Map() + for (i = 0; i < t.length; i++) { + var c = new Map() + if (((l = (s = t[i]).audio_lang), (o = n[e]) === l && ((u = s.stream_type), s.segs))) { + var p = [], + d = 0, + f = 0, + y = 0, + _ = !0, + m = this.getIdByStreamType(u) + if ('0' !== m) { + for ( + h.has(m) && (c = h.get(m)), + c.has(u) && + ((p = c.get(u).segs), + (d = c.get(u).size), + (f = c.get(u).milliseconds_audio), + (y = c.get(u).milliseconds_video)), + s.size && (d += s.size), + s.milliseconds_audio && (f += s.milliseconds_audio), + s.milliseconds_video && (y += s.milliseconds_video), + s.logo && 'none' === s.logo && (_ = !1), + s.stream_ext && 'none' === s.stream_ext.hls_logo && (_ = !1), + r = p.length; + r < s.segs.length; + r++ + ) { + var v = s.segs[r] + if (!v) break + var g = new a.default(r, v) + g.src && p.push(g) + } + s.m3u8_url && (s.streamURL = s.m3u8_url.replace('http://', 'https://')), + (s.segs = p), + (s.size = d), + (s.audioMilliSeconds = f), + (s.videoMilliSeconds = y), + (s.hasLogo = _), + c.set(u, s), + h.set(m, c) + } + } + } + this._streamsData.set(n[e], h) + } + }), + (t.prototype.getIdByStreamType = function (t) { + var e = void 0 + for (e in s) { + if (-1 !== s[e].indexOf(t)) return e + } + return '0' + }), + (t.prototype.getLangCodeToCN = function (t) { + for (var e = t, i = 0; i < this._languageData.length; i++) + this._languageData[i].langcode === t && (e = this._languageData[i].lang) + return e + }), + (t.prototype.getStreamByQuality = function (t, e) { + if (this._streamsData.has(t)) { + var i = this._streamsData.get(t) + if (i.has(e)) + for (var r = i.get(e), a = 0; a < s[e].length; a++) + if (r.has(s[e][a])) { + var n = r.get(s[e][a]) + return this.buildStreamData(e, n) + } + } + return {} + }), + r(t, [ + { + key: 'streamData', + get: function () { + return this._streamsData + }, + }, + ]), + t + ) + })() + e.default = o + }, + function (t, e, i) { + e.__esModule = !0 + var r = i(0), + a = (function (t) { + return t && t.__esModule ? t : { default: t } + })(i(1)) + var s = (function () { + function t(e, i) { + for (var s in ((function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + r.DefaultSegmentData)) + (this['_' + s] = r.DefaultSegmentData[s]), a.default.defineGetter(this, s) + ;(this._index = e), i && this._resetSegmentData(i) + } + return ( + (t.prototype._resetSegmentData = function (t) { + if ( + (t.hasOwnProperty('size') && (this._size = t.size), + t.hasOwnProperty('total_milliseconds_video') && + (this._seconds = parseInt(t.total_milliseconds_video) / 1e3), + t.hasOwnProperty('cdn_url')) + ) + if (((this._src = t.cdn_url), -1 === t.cdn_url.indexOf('wxapp.cp31.ott.cibntv.net'))) { + var e = t.cdn_url.split('/') + ;(e = e.splice(3, e.length - 3)), (this._src = 'https://wxapp.cp31.ott.cibntv.net/' + e.join('/')) + } else 0 === t.cdn_url.indexOf('http://') && (this._src = t.cdn_url.replace('http://', 'https://')) + t.hasOwnProperty('cdn_backup') && + t.cdn_backup instanceof Array && + t.cdn_backup.length > 0 && + (this._backupURL = t.cdn_backup[0]) + }), + t + ) + })() + e.default = s + }, + function (t, e, i) { + e.__esModule = !0 + var r = i(0), + a = (function (t) { + return t && t.__esModule ? t : { default: t } + })(i(1)) + var s = (function () { + function t(e) { + for (var i in ((function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + r.DefaultWaterMark)) + (this['_' + i] = Object.assign({}, r.DefaultWaterMark[i])), a.default.defineGetter(this, i) + e && this._resetData(e) + } + return ( + (t.prototype.getLogoStyle = function (t) { + var e = '' + if (t) { + var i = t + switch (i.refCoord) { + case 0: + e = 'left:' + 2 * i.posX + 'rpx;top:' + 2 * i.posY + 'rpx;' + break + case 1: + e = 'right:' + 2 * i.posX + 'rpx;top:' + 2 * i.posY + 'rpx;' + break + case 2: + e = 'right:' + 2 * i.posX + 'rpx;bottom:' + 2 * i.posY + 'rpx;' + break + case 3: + e = 'left:' + 2 * i.posX + 'rpx;bottom:' + 2 * i.posY + 'rpx;' + } + 0 === i.width && (i.width = 50), + (e += 'position:absolute;width:' + 2 * i.width + 'rpx;height:auto;opacity:' + i.alpha + ';') + } + return e + }), + (t.prototype._resetData = function (t) { + for (var e = 0, i = t.length; e < i; e++) { + var r = parseInt(t[e].type), + a = t[e].displayMode, + s = t[e].displayDTOS[0] + for (var n in s) t[e][n] = s[n] + if ( + (delete t[e].displayDTOS, + (1 === r || 0 === r || 4 === r || 5 === r || 6 === r || 7 === r) && + (1 === a ? (this._logo.fullscreen = t[e]) : (0 !== a && 3 !== a) || (this._logo.normal = t[e]), + this._logo.normal && this._logo.normal.rsUrl)) + ) { + var o = this._logo.normal.rsUrl, + l = this.getLogoStyle(this._logo.normal), + u = this._logo.normal.rsUrl, + h = this.getLogoStyle(this._logo.normal) + this._logo.fullscreen && + this._logo.fullscreen.rsUrl && + ((u = this._logo.fullscreen.rsUrl), (h = this.getLogoStyle(this._logo.fullscreen))), + (this._logo.logo = o), + (this._logo.logoStyle = l), + (this._logo.fullLogo = u), + (this._logo.fullLogoStyle = h) + } + 3 === r && + (1 === a + ? (this._license.fullscreen = t[e]) + : (0 !== a && 3 !== a) || (this._license.normal = t[e])), + 2 === r && + (1 === a + ? (this._register.fullscreen = t[e]) + : (0 !== a && 3 !== a) || (this._register.normal = t[e])) + } + }), + t + ) + })() + e.default = s + }, + function (t, e, i) { + e.__esModule = !0 + var r = (function () { + function t() { + ;(function (t, e) { + if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function') + })(this, t), + (this.historyList = []), + (this.recodeVideoTime = 0) + } + return ( + (t.prototype.reset = function () { + ;(this.historyList = []), (this.recodeVideoTime = 0) + }), + (t.prototype.setHistoryList = function () { + s().setStorage({ key: 'youku-historyList', data: this.historyList }) + }), + (t.prototype.getHistoryList = function () { + ;(this.historyList = []), + s().getStorageSync('youku-historyList') && + (this.historyList = s().getStorageSync('youku-historyList')) + }), + (t.prototype.addHistory = function (t) { + ;(this.historyList && Array.isArray(this.historyList)) || (this.historyList = []), + this.historyList.length > 49 && this.historyList.pop() + var e = {} + ;(e.duration = t.videoData.duration), + (e.id = t.videoData.encodeId), + (e.idNum = t.videoData.id), + (e.title = t.videoData.title), + (e.thumbnail = t.videoData.coverURL), + (e.timestamp = new Date().getTime()), + (e.currentTime = 0), + (e.playProcess = 0), + this.historyList.splice(0, 0, e), + this.setHistoryList() + }), + (t.prototype.getCurrectVideo = function (t) { + for (var e = null, i = 0; i < this.historyList.length; i++) + if (this.historyList[i].idNum === t) { + ;((e = this.historyList.splice(i, 1)[0]).timestamp = new Date().getTime()), + this.historyList.splice(0, 0, e), + this.setHistoryList() + break + } + return e + }), + (t.prototype.updataRecodeTime = function (t, e) { + if (t && e && (t - this.recodeVideoTime > 5 || t < this.recodeVideoTime)) { + this.recodeVideoTime = Number(t).toFixed(2) + for (var i = 0; i < this.historyList.length; i++) + if (this.historyList[i].idNum === e) { + var r = this.historyList.splice(i, 1)[0] + r.currentTime = this.recodeVideoTime + var a = (r.currentTime / r.duration) * 100 + a > 100 && (a = 100), + (r.playProcess = parseInt(a)), + (r.timestamp = new Date().getTime()), + this.historyList.splice(0, 0, r), + this.setHistoryList() + } + } + }), + t + ) + })() + e.default = r + }, + ]) + }, + }, + function (t) { + t.O(0, [6907, 8096], function () { + return (e = 3609), t((t.s = e)) + var e + }), + t.O() + }, + ])