jiuyiUniapp/jiuyi2/unpackage/dist/dev/app-plus/pages/index/videoDetail.js

6918 lines
220 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// vue-ns:vue
var require_vue = __commonJS({
"vue-ns:vue"(exports, module) {
module.exports = Vue;
}
});
// vuex-ns:vuex
var require_vuex = __commonJS({
"vuex-ns:vuex"(exports, module) {
module.exports = uni.Vuex;
}
});
// ../../../../document/九亿商城/jy/jiuyi2/unpackage/dist/dev/.nvue/pages/index/videoDetail.js
var import_vue3 = __toESM(require_vue());
// ../../../../document/九亿商城/jy/jiuyi2/unpackage/dist/dev/.nvue/uni-app.es.js
var import_vue = __toESM(require_vue());
var ON_HIDE = "onHide";
var ON_LOAD = "onLoad";
function requireNativePlugin(name) {
return weex.requireModule(name);
}
function formatAppLog(type, filename, ...args) {
if (uni.__log__) {
uni.__log__(type, filename, ...args);
} else {
console[type].apply(console, [...args, filename]);
}
}
function resolveEasycom(component, easycom) {
return typeof component === "string" ? easycom : component;
}
var createHook = (lifecycle) => (hook, target = (0, import_vue.getCurrentInstance)()) => {
!import_vue.isInSSRComponentSetup && (0, import_vue.injectHook)(lifecycle, hook, target);
};
var onHide = /* @__PURE__ */ createHook(ON_HIDE);
var onLoad = /* @__PURE__ */ createHook(ON_LOAD);
// ../../../../document/九亿商城/jy/jiuyi2/unpackage/dist/dev/.nvue/shareFirend.js
var import_vue2 = __toESM(require_vue());
// ../../../../document/九亿商城/jy/jiuyi2/unpackage/dist/dev/.nvue/_plugin-vue_export-helper.js
var _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
// ../../../../document/九亿商城/jy/jiuyi2/unpackage/dist/dev/.nvue/shareFirend.js
var import_vuex = __toESM(require_vuex());
var __defProp2 = Object.defineProperty;
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var fontData = [
{
"font_class": "arrow-down",
"unicode": "\uE6BE"
},
{
"font_class": "arrow-left",
"unicode": "\uE6BC"
},
{
"font_class": "arrow-right",
"unicode": "\uE6BB"
},
{
"font_class": "arrow-up",
"unicode": "\uE6BD"
},
{
"font_class": "auth",
"unicode": "\uE6AB"
},
{
"font_class": "auth-filled",
"unicode": "\uE6CC"
},
{
"font_class": "back",
"unicode": "\uE6B9"
},
{
"font_class": "bars",
"unicode": "\uE627"
},
{
"font_class": "calendar",
"unicode": "\uE6A0"
},
{
"font_class": "calendar-filled",
"unicode": "\uE6C0"
},
{
"font_class": "camera",
"unicode": "\uE65A"
},
{
"font_class": "camera-filled",
"unicode": "\uE658"
},
{
"font_class": "cart",
"unicode": "\uE631"
},
{
"font_class": "cart-filled",
"unicode": "\uE6D0"
},
{
"font_class": "chat",
"unicode": "\uE65D"
},
{
"font_class": "chat-filled",
"unicode": "\uE659"
},
{
"font_class": "chatboxes",
"unicode": "\uE696"
},
{
"font_class": "chatboxes-filled",
"unicode": "\uE692"
},
{
"font_class": "chatbubble",
"unicode": "\uE697"
},
{
"font_class": "chatbubble-filled",
"unicode": "\uE694"
},
{
"font_class": "checkbox",
"unicode": "\uE62B"
},
{
"font_class": "checkbox-filled",
"unicode": "\uE62C"
},
{
"font_class": "checkmarkempty",
"unicode": "\uE65C"
},
{
"font_class": "circle",
"unicode": "\uE65B"
},
{
"font_class": "circle-filled",
"unicode": "\uE65E"
},
{
"font_class": "clear",
"unicode": "\uE66D"
},
{
"font_class": "close",
"unicode": "\uE673"
},
{
"font_class": "closeempty",
"unicode": "\uE66C"
},
{
"font_class": "cloud-download",
"unicode": "\uE647"
},
{
"font_class": "cloud-download-filled",
"unicode": "\uE646"
},
{
"font_class": "cloud-upload",
"unicode": "\uE645"
},
{
"font_class": "cloud-upload-filled",
"unicode": "\uE648"
},
{
"font_class": "color",
"unicode": "\uE6CF"
},
{
"font_class": "color-filled",
"unicode": "\uE6C9"
},
{
"font_class": "compose",
"unicode": "\uE67F"
},
{
"font_class": "contact",
"unicode": "\uE693"
},
{
"font_class": "contact-filled",
"unicode": "\uE695"
},
{
"font_class": "down",
"unicode": "\uE6B8"
},
{
"font_class": "bottom",
"unicode": "\uE6B8"
},
{
"font_class": "download",
"unicode": "\uE68D"
},
{
"font_class": "download-filled",
"unicode": "\uE681"
},
{
"font_class": "email",
"unicode": "\uE69E"
},
{
"font_class": "email-filled",
"unicode": "\uE69A"
},
{
"font_class": "eye",
"unicode": "\uE651"
},
{
"font_class": "eye-filled",
"unicode": "\uE66A"
},
{
"font_class": "eye-slash",
"unicode": "\uE6B3"
},
{
"font_class": "eye-slash-filled",
"unicode": "\uE6B4"
},
{
"font_class": "fire",
"unicode": "\uE6A1"
},
{
"font_class": "fire-filled",
"unicode": "\uE6C5"
},
{
"font_class": "flag",
"unicode": "\uE65F"
},
{
"font_class": "flag-filled",
"unicode": "\uE660"
},
{
"font_class": "folder-add",
"unicode": "\uE6A9"
},
{
"font_class": "folder-add-filled",
"unicode": "\uE6C8"
},
{
"font_class": "font",
"unicode": "\uE6A3"
},
{
"font_class": "forward",
"unicode": "\uE6BA"
},
{
"font_class": "gear",
"unicode": "\uE664"
},
{
"font_class": "gear-filled",
"unicode": "\uE661"
},
{
"font_class": "gift",
"unicode": "\uE6A4"
},
{
"font_class": "gift-filled",
"unicode": "\uE6C4"
},
{
"font_class": "hand-down",
"unicode": "\uE63D"
},
{
"font_class": "hand-down-filled",
"unicode": "\uE63C"
},
{
"font_class": "hand-up",
"unicode": "\uE63F"
},
{
"font_class": "hand-up-filled",
"unicode": "\uE63E"
},
{
"font_class": "headphones",
"unicode": "\uE630"
},
{
"font_class": "heart",
"unicode": "\uE639"
},
{
"font_class": "heart-filled",
"unicode": "\uE641"
},
{
"font_class": "help",
"unicode": "\uE679"
},
{
"font_class": "help-filled",
"unicode": "\uE674"
},
{
"font_class": "home",
"unicode": "\uE662"
},
{
"font_class": "home-filled",
"unicode": "\uE663"
},
{
"font_class": "image",
"unicode": "\uE670"
},
{
"font_class": "image-filled",
"unicode": "\uE678"
},
{
"font_class": "images",
"unicode": "\uE650"
},
{
"font_class": "images-filled",
"unicode": "\uE64B"
},
{
"font_class": "info",
"unicode": "\uE669"
},
{
"font_class": "info-filled",
"unicode": "\uE649"
},
{
"font_class": "left",
"unicode": "\uE6B7"
},
{
"font_class": "link",
"unicode": "\uE6A5"
},
{
"font_class": "list",
"unicode": "\uE644"
},
{
"font_class": "location",
"unicode": "\uE6AE"
},
{
"font_class": "location-filled",
"unicode": "\uE6AF"
},
{
"font_class": "locked",
"unicode": "\uE66B"
},
{
"font_class": "locked-filled",
"unicode": "\uE668"
},
{
"font_class": "loop",
"unicode": "\uE633"
},
{
"font_class": "mail-open",
"unicode": "\uE643"
},
{
"font_class": "mail-open-filled",
"unicode": "\uE63A"
},
{
"font_class": "map",
"unicode": "\uE667"
},
{
"font_class": "map-filled",
"unicode": "\uE666"
},
{
"font_class": "map-pin",
"unicode": "\uE6AD"
},
{
"font_class": "map-pin-ellipse",
"unicode": "\uE6AC"
},
{
"font_class": "medal",
"unicode": "\uE6A2"
},
{
"font_class": "medal-filled",
"unicode": "\uE6C3"
},
{
"font_class": "mic",
"unicode": "\uE671"
},
{
"font_class": "mic-filled",
"unicode": "\uE677"
},
{
"font_class": "micoff",
"unicode": "\uE67E"
},
{
"font_class": "micoff-filled",
"unicode": "\uE6B0"
},
{
"font_class": "minus",
"unicode": "\uE66F"
},
{
"font_class": "minus-filled",
"unicode": "\uE67D"
},
{
"font_class": "more",
"unicode": "\uE64D"
},
{
"font_class": "more-filled",
"unicode": "\uE64E"
},
{
"font_class": "navigate",
"unicode": "\uE66E"
},
{
"font_class": "navigate-filled",
"unicode": "\uE67A"
},
{
"font_class": "notification",
"unicode": "\uE6A6"
},
{
"font_class": "notification-filled",
"unicode": "\uE6C1"
},
{
"font_class": "paperclip",
"unicode": "\uE652"
},
{
"font_class": "paperplane",
"unicode": "\uE672"
},
{
"font_class": "paperplane-filled",
"unicode": "\uE675"
},
{
"font_class": "person",
"unicode": "\uE699"
},
{
"font_class": "person-filled",
"unicode": "\uE69D"
},
{
"font_class": "personadd",
"unicode": "\uE69F"
},
{
"font_class": "personadd-filled",
"unicode": "\uE698"
},
{
"font_class": "personadd-filled-copy",
"unicode": "\uE6D1"
},
{
"font_class": "phone",
"unicode": "\uE69C"
},
{
"font_class": "phone-filled",
"unicode": "\uE69B"
},
{
"font_class": "plus",
"unicode": "\uE676"
},
{
"font_class": "plus-filled",
"unicode": "\uE6C7"
},
{
"font_class": "plusempty",
"unicode": "\uE67B"
},
{
"font_class": "pulldown",
"unicode": "\uE632"
},
{
"font_class": "pyq",
"unicode": "\uE682"
},
{
"font_class": "qq",
"unicode": "\uE680"
},
{
"font_class": "redo",
"unicode": "\uE64A"
},
{
"font_class": "redo-filled",
"unicode": "\uE655"
},
{
"font_class": "refresh",
"unicode": "\uE657"
},
{
"font_class": "refresh-filled",
"unicode": "\uE656"
},
{
"font_class": "refreshempty",
"unicode": "\uE6BF"
},
{
"font_class": "reload",
"unicode": "\uE6B2"
},
{
"font_class": "right",
"unicode": "\uE6B5"
},
{
"font_class": "scan",
"unicode": "\uE62A"
},
{
"font_class": "search",
"unicode": "\uE654"
},
{
"font_class": "settings",
"unicode": "\uE653"
},
{
"font_class": "settings-filled",
"unicode": "\uE6CE"
},
{
"font_class": "shop",
"unicode": "\uE62F"
},
{
"font_class": "shop-filled",
"unicode": "\uE6CD"
},
{
"font_class": "smallcircle",
"unicode": "\uE67C"
},
{
"font_class": "smallcircle-filled",
"unicode": "\uE665"
},
{
"font_class": "sound",
"unicode": "\uE684"
},
{
"font_class": "sound-filled",
"unicode": "\uE686"
},
{
"font_class": "spinner-cycle",
"unicode": "\uE68A"
},
{
"font_class": "staff",
"unicode": "\uE6A7"
},
{
"font_class": "staff-filled",
"unicode": "\uE6CB"
},
{
"font_class": "star",
"unicode": "\uE688"
},
{
"font_class": "star-filled",
"unicode": "\uE68F"
},
{
"font_class": "starhalf",
"unicode": "\uE683"
},
{
"font_class": "trash",
"unicode": "\uE687"
},
{
"font_class": "trash-filled",
"unicode": "\uE685"
},
{
"font_class": "tune",
"unicode": "\uE6AA"
},
{
"font_class": "tune-filled",
"unicode": "\uE6CA"
},
{
"font_class": "undo",
"unicode": "\uE64F"
},
{
"font_class": "undo-filled",
"unicode": "\uE64C"
},
{
"font_class": "up",
"unicode": "\uE6B6"
},
{
"font_class": "top",
"unicode": "\uE6B6"
},
{
"font_class": "upload",
"unicode": "\uE690"
},
{
"font_class": "upload-filled",
"unicode": "\uE68E"
},
{
"font_class": "videocam",
"unicode": "\uE68C"
},
{
"font_class": "videocam-filled",
"unicode": "\uE689"
},
{
"font_class": "vip",
"unicode": "\uE6A8"
},
{
"font_class": "vip-filled",
"unicode": "\uE6C6"
},
{
"font_class": "wallet",
"unicode": "\uE6B1"
},
{
"font_class": "wallet-filled",
"unicode": "\uE6C2"
},
{
"font_class": "weibo",
"unicode": "\uE68B"
},
{
"font_class": "weixin",
"unicode": "\uE691"
}
];
var iconUrl = "/assets/uniicons.32e978a5.ttf";
var _style_0$a = { "uni-icons": { "": { "fontFamily": "uniicons", "textDecoration": "none", "textAlign": "center" } } };
var getVal = (val) => {
const reg = /^[0-9]*$/g;
return typeof val === "number" || reg.test(val) ? val + "px" : val;
};
var domModule = weex.requireModule("dom");
domModule.addRule("fontFace", {
"fontFamily": "uniicons",
"src": "url('" + iconUrl + "')"
});
var _sfc_main$c = {
name: "UniIcons",
emits: ["click"],
props: {
type: {
type: String,
default: ""
},
color: {
type: String,
default: "#333333"
},
size: {
type: [Number, String],
default: 16
},
customPrefix: {
type: String,
default: ""
},
fontFamily: {
type: String,
default: ""
}
},
data() {
return {
icons: fontData
};
},
computed: {
unicode() {
let code = this.icons.find((v) => v.font_class === this.type);
if (code) {
return code.unicode;
}
return "";
},
iconSize() {
return getVal(this.size);
},
styleObj() {
if (this.fontFamily !== "") {
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
}
return `color: ${this.color}; font-size: ${this.iconSize};`;
}
},
methods: {
_onClick() {
this.$emit("click");
}
}
};
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
"u-text",
{
style: (0, import_vue2.normalizeStyle)($options.styleObj),
class: "uni-icons",
onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
},
(0, import_vue2.toDisplayString)($options.unicode),
5
/* TEXT, STYLE */
);
}
var __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["styles", [_style_0$a]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/uni_modules/uni-icons/components/uni-icons/uni-icons.vue"]]);
var nvueAnimation = requireNativePlugin("animation");
var MPAnimation = class {
constructor(options, _this) {
this.options = options;
this.animation = uni.createAnimation(__spreadValues({}, options));
this.currentStepAnimates = {};
this.next = 0;
this.$ = _this;
}
_nvuePushAnimates(type, args) {
let aniObj = this.currentStepAnimates[this.next];
let styles = {};
if (!aniObj) {
styles = {
styles: {},
config: {}
};
} else {
styles = aniObj;
}
if (animateTypes1.includes(type)) {
if (!styles.styles.transform) {
styles.styles.transform = "";
}
let unit = "";
if (type === "rotate") {
unit = "deg";
}
styles.styles.transform += `${type}(${args + unit}) `;
} else {
styles.styles[type] = `${args}`;
}
this.currentStepAnimates[this.next] = styles;
}
_animateRun(styles = {}, config2 = {}) {
let ref22 = this.$.$refs["ani"].ref;
if (!ref22)
return;
return new Promise((resolve, reject) => {
nvueAnimation.transition(ref22, __spreadValues({
styles
}, config2), (res) => {
resolve();
});
});
}
_nvueNextAnimate(animates, step = 0, fn) {
let obj = animates[step];
if (obj) {
let {
styles,
config: config2
} = obj;
this._animateRun(styles, config2).then(() => {
step += 1;
this._nvueNextAnimate(animates, step, fn);
});
} else {
this.currentStepAnimates = {};
typeof fn === "function" && fn();
this.isEnd = true;
}
}
step(config2 = {}) {
this.currentStepAnimates[this.next].config = Object.assign({}, this.options, config2);
this.currentStepAnimates[this.next].styles.transformOrigin = this.currentStepAnimates[this.next].config.transformOrigin;
this.next++;
return this;
}
run(fn) {
this.isEnd = false;
let ref22 = this.$.$refs["ani"] && this.$.$refs["ani"].ref;
if (!ref22)
return;
this._nvueNextAnimate(this.currentStepAnimates, 0, fn);
this.next = 0;
}
};
var animateTypes1 = [
"matrix",
"matrix3d",
"rotate",
"rotate3d",
"rotateX",
"rotateY",
"rotateZ",
"scale",
"scale3d",
"scaleX",
"scaleY",
"scaleZ",
"skew",
"skewX",
"skewY",
"translate",
"translate3d",
"translateX",
"translateY",
"translateZ"
];
var animateTypes2 = ["opacity", "backgroundColor"];
var animateTypes3 = ["width", "height", "left", "right", "top", "bottom"];
animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => {
MPAnimation.prototype[type] = function(...args) {
this._nvuePushAnimates(type, args);
return this;
};
});
function createAnimation(option, _this) {
if (!_this)
return;
clearTimeout(_this.timer);
return new MPAnimation(option, _this);
}
var _sfc_main$b = {
name: "uniTransition",
emits: ["click", "change"],
props: {
show: {
type: Boolean,
default: false
},
modeClass: {
type: [Array, String],
default() {
return "fade";
}
},
duration: {
type: Number,
default: 300
},
styles: {
type: Object,
default() {
return {};
}
},
customClass: {
type: String,
default: ""
},
onceRender: {
type: Boolean,
default: false
}
},
data() {
return {
isShow: false,
transform: "",
opacity: 1,
animationData: {},
durationTime: 300,
config: {}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open();
} else {
if (this.isShow) {
this.close();
}
}
},
immediate: true
}
},
computed: {
// 生成样式数据
stylesObject() {
let styles = __spreadProps(__spreadValues({}, this.styles), {
"transition-duration": this.duration / 1e3 + "s"
});
let transform = "";
for (let i in styles) {
let line = this.toLine(i);
transform += line + ":" + styles[i] + ";";
}
return transform;
},
// 初始化动画条件
transformStyles() {
return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject;
}
},
created() {
this.config = {
duration: this.duration,
timingFunction: "ease",
transformOrigin: "50% 50%",
delay: 0
};
this.durationTime = this.duration;
},
methods: {
/**
* ref 触发 初始化动画
*/
init(obj = {}) {
if (obj.duration) {
this.durationTime = obj.duration;
}
this.animation = createAnimation(Object.assign(this.config, obj), this);
},
/**
* 点击组件触发回调
*/
onClick() {
this.$emit("click", {
detail: this.isShow
});
},
/**
* ref 触发 动画分组
* @param {Object} obj
*/
step(obj, config2 = {}) {
if (!this.animation)
return;
for (let i in obj) {
try {
if (typeof obj[i] === "object") {
this.animation[i](...obj[i]);
} else {
this.animation[i](obj[i]);
}
} catch (e) {
formatAppLog("error", "at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148", `\u65B9\u6CD5 ${i} \u4E0D\u5B58\u5728`);
}
}
this.animation.step(config2);
return this;
},
/**
* ref 触发 执行动画
*/
run(fn) {
if (!this.animation)
return;
this.animation.run(fn);
},
// 开始过度动画
open() {
clearTimeout(this.timer);
this.transform = "";
this.isShow = true;
let { opacity, transform } = this.styleInit(false);
if (typeof opacity !== "undefined") {
this.opacity = opacity;
}
this.transform = transform;
this.$nextTick(() => {
this.timer = setTimeout(() => {
this.animation = createAnimation(this.config, this);
this.tranfromInit(false).step();
this.animation.run();
this.$emit("change", {
detail: this.isShow
});
}, 20);
});
},
// 关闭过度动画
close(type) {
if (!this.animation)
return;
this.tranfromInit(true).step().run(() => {
this.isShow = false;
this.animationData = null;
this.animation = null;
let { opacity, transform } = this.styleInit(false);
this.opacity = opacity || 1;
this.transform = transform;
this.$emit("change", {
detail: this.isShow
});
});
},
// 处理动画开始前的默认样式
styleInit(type) {
let styles = {
transform: ""
};
let buildStyle = (type2, mode) => {
if (mode === "fade") {
styles.opacity = this.animationType(type2)[mode];
} else {
styles.transform += this.animationType(type2)[mode] + " ";
}
};
if (typeof this.modeClass === "string") {
buildStyle(type, this.modeClass);
} else {
this.modeClass.forEach((mode) => {
buildStyle(type, mode);
});
}
return styles;
},
// 处理内置组合动画
tranfromInit(type) {
let buildTranfrom = (type2, mode) => {
let aniNum = null;
if (mode === "fade") {
aniNum = type2 ? 0 : 1;
} else {
aniNum = type2 ? "-100%" : "0";
if (mode === "zoom-in") {
aniNum = type2 ? 0.8 : 1;
}
if (mode === "zoom-out") {
aniNum = type2 ? 1.2 : 1;
}
if (mode === "slide-right") {
aniNum = type2 ? "100%" : "0";
}
if (mode === "slide-bottom") {
aniNum = type2 ? "100%" : "0";
}
}
this.animation[this.animationMode()[mode]](aniNum);
};
if (typeof this.modeClass === "string") {
buildTranfrom(type, this.modeClass);
} else {
this.modeClass.forEach((mode) => {
buildTranfrom(type, mode);
});
}
return this.animation;
},
animationType(type) {
return {
fade: type ? 0 : 1,
"slide-top": `translateY(${type ? "0" : "-100%"})`,
"slide-right": `translateX(${type ? "0" : "100%"})`,
"slide-bottom": `translateY(${type ? "0" : "100%"})`,
"slide-left": `translateX(${type ? "0" : "-100%"})`,
"zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
"zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
};
},
// 内置动画类型与实际动画对应字典
animationMode() {
return {
fade: "opacity",
"slide-top": "translateY",
"slide-right": "translateX",
"slide-bottom": "translateY",
"slide-left": "translateX",
"zoom-in": "scale",
"zoom-out": "scale"
};
},
// 驼峰转中横线
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
};
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
return $data.isShow ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
ref: "ani",
animation: $data.animationData,
class: (0, import_vue2.normalizeClass)($props.customClass),
style: (0, import_vue2.normalizeStyle)($options.transformStyles),
onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args)),
renderWhole: true
}, [
(0, import_vue2.renderSlot)(_ctx.$slots, "default")
], 14, ["animation"])) : (0, import_vue2.createCommentVNode)("v-if", true);
}
var __easycom_1$2 = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/uni_modules/uni-transition/components/uni-transition/uni-transition.vue"]]);
var _style_0$9 = { "uni-popup": { "": { "position": "fixed" }, ".top": { "top": 0 }, ".left": { "top": 0 }, ".right": { "top": 0 } }, "uni-popup__wrapper": { ".uni-popup ": { "position": "relative" }, ".uni-popup .left": { "paddingTop": 0, "flex": 1 }, ".uni-popup .right": { "paddingTop": 0, "flex": 1 } }, "fixforpc-top": { "": { "top": 0 } } };
var _sfc_main$a = {
name: "uniPopup",
components: {},
emits: ["change", "maskClick"],
props: {
// 开启动画
animation: {
type: Boolean,
default: true
},
// 弹出层类型可选值top: 顶部弹出层bottom底部弹出层center全屏弹出层
// message: 消息提示 ; dialog : 对话框
type: {
type: String,
default: "center"
},
// maskClick
isMaskClick: {
type: Boolean,
default: null
},
// TODO 2 个版本后废弃属性 ,使用 isMaskClick
maskClick: {
type: Boolean,
default: null
},
backgroundColor: {
type: String,
default: "none"
},
safeArea: {
type: Boolean,
default: true
},
maskBackgroundColor: {
type: String,
default: "rgba(0, 0, 0, 0.4)"
},
borderRadius: {
type: String
}
},
watch: {
/**
* 监听type类型
*/
type: {
handler: function(type) {
if (!this.config[type])
return;
this[this.config[type]](true);
},
immediate: true
},
isDesktop: {
handler: function(newVal) {
if (!this.config[newVal])
return;
this[this.config[this.type]](true);
},
immediate: true
},
/**
* 监听遮罩是否可点击
* @param {Object} val
*/
maskClick: {
handler: function(val) {
this.mkclick = val;
},
immediate: true
},
isMaskClick: {
handler: function(val) {
this.mkclick = val;
},
immediate: true
},
// H5 下禁止底部滚动
showPopup(show) {
}
},
data() {
return {
duration: 300,
ani: [],
showPopup: false,
showTrans: false,
popupWidth: 0,
popupHeight: 0,
config: {
top: "top",
bottom: "bottom",
center: "center",
left: "left",
right: "right",
message: "top",
dialog: "center",
share: "bottom"
},
maskClass: {
position: "fixed",
bottom: 0,
top: 0,
left: 0,
right: 0,
backgroundColor: "rgba(0, 0, 0, 0.4)"
},
transClass: {
backgroundColor: "transparent",
borderRadius: this.borderRadius || "0",
position: "fixed",
left: 0,
right: 0
},
maskShow: true,
mkclick: true,
popupstyle: "top"
};
},
computed: {
getStyles() {
let res = { backgroundColor: this.bg };
if (this.borderRadius || "0") {
res = Object.assign(res, { borderRadius: this.borderRadius });
}
return res;
},
isDesktop() {
return this.popupWidth >= 500 && this.popupHeight >= 500;
},
bg() {
if (this.backgroundColor === "" || this.backgroundColor === "none") {
return "transparent";
}
return this.backgroundColor;
}
},
mounted() {
const fixSize = () => {
const {
windowWidth,
windowHeight,
windowTop,
safeArea,
screenHeight,
safeAreaInsets
} = uni.getSystemInfoSync();
this.popupWidth = windowWidth;
this.popupHeight = windowHeight + (windowTop || 0);
if (safeArea && this.safeArea) {
this.safeAreaInsets = safeAreaInsets.bottom;
} else {
this.safeAreaInsets = 0;
}
};
fixSize();
},
// TODO vue3
unmounted() {
this.setH5Visible();
},
activated() {
this.setH5Visible(!this.showPopup);
},
deactivated() {
this.setH5Visible(true);
},
created() {
if (this.isMaskClick === null && this.maskClick === null) {
this.mkclick = true;
} else {
this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
}
if (this.animation) {
this.duration = 300;
} else {
this.duration = 0;
}
this.messageChild = null;
this.clearPropagation = false;
this.maskClass.backgroundColor = this.maskBackgroundColor;
},
methods: {
setH5Visible(visible = true) {
},
/**
* 公用方法,不显示遮罩层
*/
closeMask() {
this.maskShow = false;
},
/**
* 公用方法,遮罩层禁止点击
*/
disableMask() {
this.mkclick = false;
},
// TODO nvue 取消冒泡
clear(e) {
this.clearPropagation = true;
},
open(direction) {
if (this.showPopup) {
return;
}
let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
if (!(direction && innerType.indexOf(direction) !== -1)) {
direction = this.type;
}
if (!this.config[direction]) {
formatAppLog("error", "at uni_modules/uni-popup/components/uni-popup/uni-popup.vue:298", "\u7F3A\u5C11\u7C7B\u578B\uFF1A", direction);
return;
}
this[this.config[direction]]();
this.$emit("change", {
show: true,
type: direction
});
},
close(type) {
this.showTrans = false;
this.$emit("change", {
show: false,
type: this.type
});
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.showPopup = false;
}, 300);
},
// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
touchstart() {
this.clearPropagation = false;
},
onTap() {
if (this.clearPropagation) {
this.clearPropagation = false;
return;
}
this.$emit("maskClick");
if (!this.mkclick)
return;
this.close();
},
/**
* 顶部弹出样式处理
*/
top(type) {
this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
this.ani = ["slide-top"];
this.transClass = {
position: "fixed",
left: 0,
right: 0,
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPopup = true;
this.showTrans = true;
this.$nextTick(() => {
if (this.messageChild && this.type === "message") {
this.messageChild.timerClose();
}
});
},
/**
* 底部弹出样式处理
*/
bottom(type) {
this.popupstyle = "bottom";
this.ani = ["slide-bottom"];
this.transClass = {
position: "fixed",
left: 0,
right: 0,
bottom: 0,
paddingBottom: this.safeAreaInsets + "px",
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPopup = true;
this.showTrans = true;
},
/**
* 中间弹出样式处理
*/
center(type) {
this.popupstyle = "center";
this.ani = ["zoom-out", "fade"];
this.transClass = {
position: "fixed",
bottom: 0,
left: 0,
right: 0,
top: 0,
justifyContent: "center",
alignItems: "center",
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPopup = true;
this.showTrans = true;
},
left(type) {
this.popupstyle = "left";
this.ani = ["slide-left"];
this.transClass = {
position: "fixed",
left: 0,
bottom: 0,
top: 0,
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPopup = true;
this.showTrans = true;
},
right(type) {
this.popupstyle = "right";
this.ani = ["slide-right"];
this.transClass = {
position: "fixed",
bottom: 0,
right: 0,
top: 0,
backgroundColor: this.bg,
borderRadius: this.borderRadius || "0"
};
if (type)
return;
this.showPopup = true;
this.showTrans = true;
}
}
};
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_transition = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-transition"), __easycom_1$2);
return $data.showPopup ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
"view",
{
key: 0,
class: (0, import_vue2.normalizeClass)(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]]),
renderWhole: true
},
[
(0, import_vue2.createElementVNode)(
"view",
{
onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args))
},
[
$data.maskShow ? ((0, import_vue2.openBlock)(), (0, import_vue2.createBlock)(_component_uni_transition, {
key: "1",
name: "mask",
"mode-class": "fade",
styles: $data.maskClass,
duration: $data.duration,
show: $data.showTrans,
onClick: $options.onTap
}, null, 8, ["styles", "duration", "show", "onClick"])) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createVNode)(_component_uni_transition, {
key: "2",
"mode-class": $data.ani,
name: "content",
styles: $data.transClass,
duration: $data.duration,
show: $data.showTrans,
onClick: $options.onTap
}, {
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)(
"view",
{
class: (0, import_vue2.normalizeClass)(["uni-popup__wrapper", [$data.popupstyle]]),
style: (0, import_vue2.normalizeStyle)($options.getStyles),
onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args))
},
[
(0, import_vue2.renderSlot)(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
)
]),
_: 3
/* FORWARDED */
}, 8, ["mode-class", "styles", "duration", "show", "onClick"])
],
32
/* NEED_HYDRATION */
)
],
2
/* CLASS */
)) : (0, import_vue2.createCommentVNode)("v-if", true);
}
var __easycom_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["styles", [_style_0$9]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/uni_modules/uni-popup/components/uni-popup/uni-popup.vue"]]);
var store = (0, import_vuex.createStore)({
state: {
// 用户信息
userinfo: {},
// tabbar当前的模式 default视频端 shop商城端
tabbarMode: "default",
// 闹钟时间
alarmTime: "",
// 资产
purse: {
balance: 0,
fruit: 0,
score: 0,
seed: 0
},
// 任务
task: {
//任务类型 0.任务读秒 1.流量点(种子)读秒
taskType: 0,
//有效时长
viewingDuration: 0
}
},
mutations: {
// 获取内容
setState(state, option) {
const key = option.key;
const value = option.value;
state[key] = value;
},
// 设置用户信息
setUserInfo(state, value) {
state.userinfo = value;
},
// 设置 tabbar 模式
setTabbarMode(state, mode) {
state.tabbarMode = mode;
}
},
getters: {
getUserInfo(state) {
return state.userinfo;
},
getTabbarMode(state) {
return state.tabbarMode;
}
},
actions: {
updateUserInfo({
commit
}, payload) {
commit("setUserInfo", payload);
},
changeTabbarMode({
commit
}, mode) {
commit("setTabbarMode", mode);
}
}
});
var config = {
// 接口域名
host: "http://192.168.1.235:8080",
// host: 'http://192.168.1.236:8080',
// 上传文件二级路径
uploadFilePath: "/homecommon/file/preview?fileName=",
// 上传视频二级路径
uploadVideoPath: "/homecommon/file/play?fileName=",
// 图片大小 单位m
img_size: 5,
// 视频限制大小 单位m
video_size: 300,
// h5路径
h5: "",
// 腾讯im聊天
TChat: {
// appid
SDKAppID: "1600057470",
// 验签
secretKey: "7d016821bf27a846739e209534abe4c4bba131559b3318e19f8ccf9294e08b29",
//
userSig: ""
}
};
var login = {
/**
* 用户注册
* @param {Object} param
*/
userRegister(param) {
return util$1.request({
url: `/user/register`,
data: param.data,
load: true
});
},
/**
* 获取验证码
* @param {Object} param
*/
getCaptcha(param) {
return util$1.request({
url: "/user/sendVerifyCode",
query: param.query,
method: "GET"
});
},
/**
* 用户密码登录接口
* @param {Object} param
*/
userLoginByPassword(param) {
return util$1.request({
url: "/user/login",
data: param.data,
load: true
});
},
/**
* 修改用户密码
* @param {Object} param
*/
resetPassword(param) {
return util$1.request({
url: "/user/login/resetPassword",
data: param.data,
path: param.path,
method: "POST"
});
},
/**
* 获取IMtoken
* @param {Object} param
*/
getIMToken(param) {
return util$1.request({
url: "/user/chat/getUserSig",
query: param.query,
method: "GET"
});
}
};
var mine = {
/**
* 获取用户信息
* @param {Object} param
*/
getUserinfo(param) {
return util$1.request({
url: `/user/getUserData`,
method: "GET"
});
},
/**
* 修改用户信息
* @param {Object} param
*/
updateUserInfo(param) {
return util$1.request({
url: `/user/updateUserData`,
data: param.data,
method: "PUT",
load: 1
});
},
/**
* 获取我的评论
* @param {Object} param
*/
myComment(param) {
return util$1.request({
url: `/user/home/myComment`,
query: param.query,
method: "POST"
});
},
// 实名认证
certification(param) {
return util$1.request({
url: `/user/info/certification`,
data: param.data,
method: "POST",
load: true
});
},
/**
* 支付
* @param {Object} param
*/
pay(param) {
return util$1.request({
url: "/home/pay",
query: param.query,
method: "POST"
});
},
/**
* 获取余额记录
* @param {Object} param
*/
getBalanceLog(param) {
return util$1.request({
url: "/home/getBalanceLog",
query: param.query,
method: "POST"
});
},
/**
* 查询我的钱包接口
* @param {Object} param
*/
selectPurse(param) {
return util$1.request({
url: "/user/selectPurse",
method: "GET"
});
},
/**
* 获取待释放列表
* @param {Object} param
*/
releasedList(param) {
return util$1.request({
url: "/user/released/list",
query: param.query,
method: "GET"
});
}
};
var video = {
/**
* 申请完播量
* @param {Object} param
*/
applyVideo(param) {
return util$1.request({
url: `/homecommon/applyVideo`,
query: param.query,
data: param.data,
method: "POST",
load: true
});
},
/**
* 展播量推送
* @param {Object} param
*/
pushVideo(param) {
return util$1.request({
url: `/homecommon/pushVideo`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 他人用户主页
* @param {Object} param
*/
getUserInfo(param) {
return util$1.request({
url: `/home/getUserInfo`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 用户视频列表
* @param {Object} param
*/
myVideoList(param) {
return util$1.request({
url: `/home/myVideoList`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 我的收藏列表
* @param {Object} param
*/
getCollectList(param) {
return util$1.request({
url: `/collect/getCollectList`,
query: param.query,
method: "POST"
});
},
/**
* 新建收藏夹
* @param {Object} param
*/
saveCollectList(param) {
return util$1.request({
url: `/collect/saveCollectList`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 编辑收藏夹
* @param {Object} param
*/
updateCollectList(param) {
return util$1.request({
url: `/collect/updateCollectList`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 删除收藏夹
* @param {Object} param
*/
deleteCollect(param) {
return util$1.request({
url: `/collect/deleteCollect`,
query: param.query,
load: true,
method: "POST"
});
},
/**
* 我的收藏视频列表
* @param {Object} param
*/
getCollectVideoList(param) {
return util$1.request({
url: `/collect/getCollectVideoList`,
query: param.query,
load: true,
method: "POST"
});
},
/**
* 收藏视频
* @param {Object} param
*/
collectVideo(param) {
return util$1.request({
url: `/collect/collectVideo`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 取消收藏
* @param {Object} param
*/
cancelCollect(param) {
return util$1.request({
url: `/collect/cancelCollect`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 首页视频分页接口
* @param {Object} param
*/
homeVideo(param) {
return util$1.request({
url: `/video/video/list`,
query: param.query,
method: "GET"
});
},
/**
* 我的关注视频列表
* @param {Object} param
*/
followVideo(param) {
return util$1.request({
url: `/homecommon/followVideo`,
query: param.query,
method: "POST"
});
},
/**
* 查看标签分类
* @param {Object} param
*/
getLabel(param) {
return util$1.request({
url: `/video/tag/list`,
query: param.query,
method: "GET",
load: true
});
},
/**
* 新增或编辑标签
* @param {Object} param
*/
setLabel(param) {
return util$1.request({
url: `/video/tag/add`,
query: param.query,
method: "POST",
load: true
});
},
/**
* 发布作品
* @param {Object} param
*/
publishVideo(param) {
return util$1.request({
url: `/video/video/add`,
data: param.data,
method: "POST"
});
},
/**
* 修改视频信息接口
* @param {Object} param
*/
updateVideo(param) {
return util$1.request({
url: `/homecommon/updateVideo`,
data: param.data,
method: "POST"
});
},
/**
* 视频评论列表
* @param {Object} param
*/
commentList(param) {
return util$1.request({
url: `/home/commentList`,
query: param.query,
method: "POST"
});
},
/**
* 下级评论列表
* @param {Object} param
*/
levelCommentList(param) {
return util$1.request({
url: `/home/levelCommentList`,
query: param.query,
method: "POST"
});
},
/**
* 点赞/取消点赞接口 0取消 1点赞
* @param {Object} param
*/
thumbsUp(param) {
return util$1.request({
url: `/home/thumbsUp`,
query: param.query,
method: "POST"
});
},
/**
* 发表评论
* @param {Object} param
*/
comment(param) {
return util$1.request({
url: `/home/comment`,
query: param.query,
method: "POST"
});
},
/**
* 视频 点赞取消赞
* @param {Object} param
*/
videoLike(param) {
return util$1.request({
url: `/home/videoLike`,
query: param.query,
method: "POST"
});
},
/**
* 观看视频记录接口
* @param {Object} param
*/
browseLog(param) {
return util$1.request({
url: `/video/Effective/second`,
data: param.data,
method: "POST"
});
},
/**
* 热点视频
* @param {Object} param
*/
hotVideos(param) {
return util$1.request({
url: `/home/hotVideos`,
// query: param.query,
method: "POST"
});
},
/**
* 视频搜索记录
* @param {Object} param
*/
videoSearchLog(param) {
return util$1.request({
url: `/home/videoSearchLog`,
// query: param.query,
method: "POST"
});
},
/**
* 视频模糊搜索
* @param {Object} param
*/
videoSearch(param) {
return util$1.request({
url: `/home/videoSearch`,
query: param.query,
method: "POST"
});
},
/**
* 同意好友申请
* @param {Object} param
*/
agreeFriend(param) {
return util$1.request({
url: `/user/friend/agreeFriend`,
path: param.path,
query: param.query,
method: "POST"
});
},
/**
* 拒绝好友申请
* @param {Object} param
*/
refuseFriend(param) {
return util$1.request({
url: `/user/friend/refuseFriend`,
path: param.path,
query: param.query,
method: "POST"
});
},
/**
* 好友列表
* @param {Object} param
*/
getFriendList(param) {
return util$1.request({
url: `/user/friend/getFriendList`,
path: param.path,
query: param.query,
method: "GET"
});
},
/**
* 关注列表
* @param {Object} param
*/
getFansList(param) {
return util$1.request({
url: `/user/attention/getFansList`,
path: param.path,
query: param.query,
method: "GET"
});
},
/**
* 关注列表
* @param {Object} param
*/
getAttentionList(param) {
return util$1.request({
url: `/user/attention/getAttentionList`,
path: param.path,
query: param.query,
method: "GET"
});
},
/**
* 关注用户 关注状态 0:取关 1:关注
* @param {Object} param
*/
attention(param) {
return util$1.request({
url: `/user/attention`,
path: param.path,
data: param.data,
method: "POST"
});
},
/**
* 视频观看权限 (不看他) 0拉黑 1放出
* @param {Object} param
*/
videoBlock(param) {
return util$1.request({
url: `/home/videoBlock`,
query: param.query,
load: true,
method: "POST"
});
},
/**
* 举报视频
* @param {Object} param
*/
reportVideo(param) {
return util$1.request({
url: `/report/reportVideo`,
data: param.data,
method: "POST"
});
},
/**
* 我的喜欢视频列表 分页
* @param {Object} param
*/
myLikeVideoList(param) {
return util$1.request({
url: `/home/myLikeVideoList`,
query: param.query,
method: "POST"
});
},
/**
* 视频详情
* @param {Object} param
*/
getVideoById(param) {
return util$1.request({
url: `/homecommon/getVideoById`,
query: param.query,
method: "POST"
});
},
/**
* 视频分享
* @param {Object} param
*/
videoShare(param) {
return util$1.request({
url: `/home/videoShare`,
query: param.query,
method: "POST"
});
},
/**
* 设置闹铃
* @param {Object} param
*/
setAlarm(param) {
return util$1.request({
url: `/home/setAlarm`,
query: param.query,
method: "POST"
});
},
/**
* 查看自己的闹铃
*/
getAlarm() {
return util$1.request({
url: `/home/getAlarm`,
method: "POST"
});
},
/**
* 查看我的今日观看任务
*/
viewingTasks() {
return util$1.request({
url: `/home/viewingTasks`,
method: "POST"
});
}
};
var news = {
/**
* 获取腾讯云用户签名
* @param {Object} param
*/
getUserSig(param) {
return util$1.request({
url: `/user/chat/getUserSig`,
method: "GET",
query: param.query
});
},
/**
* 设置好友备注
* @param {Object} param
*/
setNotes(param) {
return util$1.request({
url: `/user/friend/setNotes`,
method: "POST",
query: param.query
});
},
/**
* 删除好友
* @param {Object} param
*/
deleteFriend(param) {
return util$1.request({
url: `/user/friend/deleteFriend`,
method: "POST",
path: param.path
});
},
/**
* 添加好友
* @param {Object} param
*/
addFriend(param) {
return util$1.request({
url: `/user/friend/addFriend`,
method: "POST",
path: param.path
});
},
/**
* 好友申请列表-分页
* @param {Object} param
*/
getFriendListPage(param) {
return util$1.request({
url: `/user/friend/getFriendListPage`,
path: param.path,
query: param.query,
method: "GET"
});
},
/**
* 根据用户名模糊搜索好友-分页
* @param {Object} param
*/
searchFriendByName(param) {
return util$1.request({
url: `/user/friend/searchFriendByName`,
path: param.path,
query: param.query,
method: "GET"
});
},
/**
* 商品列表
* @param {Object} param
*/
getImToken(param) {
return util$1.request({
url: `/im/token/getUserAppToken`,
method: "get",
query: param
});
},
/**
* 商品列表
* @param {Object} param
*/
sendRedBag(param) {
return util$1.request({
url: `/home/sendRedBag`,
method: "POST",
data: param.data
});
},
// 抢红包
grabred(param) {
return util$1.request({
url: `/home/grabred`,
method: "POST",
data: param.data
});
},
// 红包详情
getRedbag(param) {
return util$1.request({
url: `/home/getRedbag`,
method: "POST",
query: param.data
});
},
grabredLog(param) {
return util$1.request({
url: `/home/grabredLog`,
method: "POST",
query: param
});
}
};
var team = {
/**
* 我的团队
* @param {Object} param
*/
myTeam(param = {}) {
return util$1.request({
url: `/user/team/get`,
query: param,
method: "GET"
});
},
lowTeam(param) {
return util$1.request({
url: `/home/lowTeam`,
method: "post",
query: param.query
});
}
};
var intergral = {
/**
* 卷轴列表
* @param {Object} param
*/
scrollList(param) {
return util$1.request({
url: `/coreplay/app/scrollinfo/scroll-list`,
method: "GET",
query: param.query,
load: true
});
},
/**
* 我购买的卷轴列表
* @param {Object} param
*/
buyScrollList(param) {
return util$1.request({
url: `/coreplay/app/scrollinfo/boughtListByUser`,
method: "GET",
load: true
});
},
/**
* 查看卷轴按id
* @param {Object} param
*/
scrollinfo(param) {
return util$1.request({
url: `/coreplay/app/scrollinfo`,
method: "GET",
path: param.path,
load: true
});
},
/**
* 按用户id按日期查卷轴积分明细
* @param {Object} param
*/
getDetailInfoByDate(param) {
return util$1.request({
url: `/coreplay/app/scrollinfo/getDetailInfoByDate`,
method: "GET",
query: param.query
});
},
/**
* 按卷轴id查卷轴积分明细
* @param {Object} param
*/
getDetailInfoByScrollId(param) {
return util$1.request({
url: `/coreplay/app/scrollinfo/getDetailInfoByScrollId`,
method: "GET",
path: param.path,
query: param.query
});
},
/**
* 按用户id查卷轴积分明细
* @param {Object} param
*/
getDetailInfoByUserId(param) {
return util$1.request({
url: `/coreplay/app/scrollinfo/getDetailInfoByUserId`,
method: "GET",
query: param.query
});
},
/**
* 今日任务读秒记录
* @param {Object} param
*/
viewingTasks(param) {
return util$1.request({
url: `/video/Effective/return`,
method: "GET",
query: param.query
});
},
/**
* 购买卷轴
* @param {Object} param
*/
buyScroll(param) {
return util$1.request({
url: `/coreplay/app/scrollinfo/buyScroll`,
method: "G",
data: param.data
});
},
/**
* 验证码生成
* @param {Object} param
*/
myQrcode(param) {
return util$1.request({
url: `/user/team/getH5Link`,
method: "GET",
query: param.query,
responseType: "arraybuffer"
});
},
/**
* 隐藏/公开 个人昵称
* @param {Object} param
*/
nickname(param) {
return util$1.request({
url: `/home/nickname`,
method: "post",
query: param.query
});
}
};
var shop = {
/**
* 商品列表
* @param {Object} param
*/
getProduct(param) {
return util$1.request({
url: `/appProductionApi/getProductionList`,
method: "GET",
data: param.data
});
},
/**
* 商品列表
* @param {Object} param
*/
getCategory(param) {
return util$1.request({
url: `/appProductionApi/getProductCategory`,
method: "GET",
query: param.query
});
},
/**
* 根据商品主键获取商品详情
* @param {Object} param
*/
productDetail(param) {
return util$1.request({
url: `/appProductionApi/getProductionDetail`,
method: "GET",
query: param.query
});
}
};
var api = {
// 登录
login,
// 我的
mine,
// 视频模块
video,
// 消息
news,
// 我的团队
team,
// 积分
intergral,
// 商城模块
shop,
// 上传图片地址
uploadImg: "/homecommon/upload",
// 上传视频地址
uploadVideo: "/homecommon/uploadVideo",
// 公共模块可以放在这里 比如获取各种文章
/**
* 获取文章
* @param {Object} param
*/
getArticle(param) {
return util$1.request({
url: "/home/getArticle",
query: param.query,
method: "POST"
});
}
};
var util = {
// 配置参数
config,
// 正则
reg: {
// 手机号
tel: /^1[3-9]\d{9}$/,
// 身份证
idCard: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
},
/**
* 弹窗
* @param {Object|String} obj String类型只是弹出文字 object如下
* @param {String} obj.title 弹窗的标题
* @param {String} obj.content 弹窗的内容
* @param {String} obj.confirmText 确定的文本
* @param {String} obj.showCancel 是否显示取消
* @param {String} obj.cancelText 取消的文本
* @param {Function} params.success 请求成功回调 可通过promise.then捕获
* @param {Function} params.fail 请求失败回调 可通过promise.catch捕获
* @param {Function} params.complete 请求结束回调 无论是否成功失败都会执行
* @return {Object} string返回null object返回返回promis对象 执行成功返回resolve 执行失败返回reject
*/
alert(obj) {
if (obj == null || obj == void 0)
return;
if (typeof obj == "string" || typeof obj == "number") {
uni.showToast({
"title": "" + obj,
"icon": "none",
duration: 3e3
});
return null;
}
obj.title = obj.title ? obj.title : "";
obj.content = obj.content ? obj.content : "";
obj.confirmText = obj.confirmText ? obj.confirmText : "\u786E\u5B9A";
obj.showCancel = obj.showCancel === false ? false : true;
obj.cancelText = obj.cancelText ? obj.cancelText : "\u53D6\u6D88";
return new Promise((resolve, reject) => {
uni.showModal({
title: obj.title,
content: obj.content,
confirmText: obj.confirmText,
showCancel: obj.showCancel,
cancelText: obj.cancelText,
success: (res) => {
obj.success ? obj.success(res) : () => {
};
resolve(res);
},
fail: (err) => {
obj.fail ? obj.fail(err) : () => {
};
reject(err);
},
complete: (res) => {
}
});
});
},
/**
* 上传文件
* @param {Object} obj
* @param {String} obj.mode img图片 video视频
*/
upload(obj) {
return new Promise((resolve, reject) => {
let token = uni.getStorageSync("token") || "";
obj.url = obj.url ? obj.url : "/file/upload";
obj.file = obj.file ? obj.file : "";
obj.data = obj.data ? obj.data : {};
obj.header = __spreadValues({
// 'Content-Type': 'multipart/form-data; ',
// 'Content-Type': 'application/json;charset=UTF-8',
"Access-Control-Allow-Origin": "*"
}, obj.header);
if (token)
obj.header["Authorization"] = `Bearer ${token}`;
uni.showLoading({
title: "\u6B63\u5728\u4E0A\u4F20"
});
uni.uploadFile({
url: util.config.host + obj.url,
filePath: obj.file,
header: obj.header,
formData: obj.data,
dataType: "json",
name: "file",
success: (res) => {
uni.hideLoading();
obj.success ? obj.success(JSON.parse(res.data)) : "";
resolve(JSON.parse(res.data));
},
fail: (res) => {
uni.hideLoading();
obj.fail ? obj.fail(res.data) : "";
reject(res);
}
});
});
},
/**
* 发送网络请求
* @param {Object} params 传参
* @param {String} params.url 请求地址 一般用于后台请求接口
* @param {Array} params.query 请求地址拼接参数 用于后台请求地址拼接补全
* @param {String} params.fullurl 全请求地址 一般用于第三方请求地址
* @param {Boolean} params.load 是否显示加载动画 默认不显示
* @param {Object} params.data 请求入参 没有则不传
* @param {Object} params.header 请求头 默认不传
* @param {String} params.method 请求方式 默认值POST
* @param {Function} params.success 请求成功回调 可通过promise.then捕获
* @param {Function} params.fail 请求失败回调 可通过promise.catch捕获
* @param {Function} params.complete 请求结束回调 无论是否成功失败都会执行
* @return {Object} 返回promis对象 执行成功返回resolve 执行失败返回reject
*/
request(params2) {
let token = uni.getStorageSync("token") || "";
return new Promise((resolve, reject) => {
let url = util.config.host + (params2.url ? params2.url : "/api/index/index");
if (params2.path && params2.path instanceof Array)
params2.path.forEach((item) => {
url += `/${item}`;
});
if (params2.query) {
url = util.setUrl(url, params2.query);
}
if (params2.load) {
uni.showLoading({
title: "\u52A0\u8F7D\u4E2D",
mask: true
});
}
params2.header = __spreadValues({
"Content-Type": "application/json;charset=UTF-8",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
// token: uni.getStorageSync('token'),
"Access-Control-Allow-Origin": "*",
"IS_APP_REQ": "APP_REQ"
}, params2.header);
if (token)
params2.header["Authorization"] = `Bearer ${token}`;
uni.request({
// 请求地址
url,
// 请求方式 get/post
method: params2.method ? params2.method : "POST",
// 是否开启SSL验证
sslVerify: false,
// 请求参数
data: params2.data,
// header请求头
header: params2.header,
// 数据类型
dataType: "json",
responseType: params2.responseType || "text",
// 请求成功返回
success: (res) => {
if (params2.load) {
uni.hideLoading();
}
if (res.data.code == 401) {
util.logout(() => {
util.alert("\u8BF7\u5148\u767B\u5F55");
reject(res.data);
});
}
params2.success ? params2.success(res.data) : "";
resolve(res.data);
},
// 请求失败返回
fail: (res) => {
if (params2.load) {
uni.hideLoading();
}
params2.fail ? params2.fail(res) : "";
reject(res);
},
complete(res) {
params2.complete ? params2.complete(res) : "";
}
});
});
},
// 替换图片的宽度为最大宽度100% (移动端解析html富文本专用)
imgReplace(value, th) {
if (!th) {
value = value.replace(/<img src="/ig, '<img src="' + util.config.host);
}
return value.replace(/<p([\s\w"=\/\.:;]+)((?:(style="[^"]+")))/ig, "<p").replace(/<p>/ig, '<p style="font-size: 15px; line-height: 25px;">').replace(/<img([\s\w"-=\/\.:;]+)((?:(height="[^"]+")))/ig, "<img$1").replace(/<img([\s\w"-=\/\.:;]+)((?:(width="[^"]+")))/ig, "<img$1").replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, "<img$1").replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, "<img$1").replace(/<img([\s\w"-=\/\.:;]+)/ig, '<img style="width: 100%;" $1');
},
/**
* 路由跳转方法
* @param {string} url 跳转的目标页面路径
* @param {Object} params 要传递的参数对象
* @param {string} method 跳转方法,默认为 navigateTo
*/
routeWithParams(url, params2 = {}, method = "navigateTo") {
const fullUrl = util.setUrl("url", params2);
switch (method) {
case "navigateTo":
uni.navigateTo({
url: fullUrl
});
break;
case "redirectTo":
uni.redirectTo({
url: fullUrl
});
break;
case "reLaunch":
uni.reLaunch({
url: fullUrl
});
break;
case "switchTab":
uni.switchTab({
url: fullUrl
});
break;
default:
throw new Error(`Unsupported method: ${method}`);
}
},
/**
* get参数拼接
* @param {Object} data 需要转化的对象
*/
set_param(data) {
let url = "";
if (!data)
data = [];
for (let [key, value] of Object.entries(data)) {
url += `${key}=${value}&`;
}
url = url.substring(url.length - 1) == "&" ? url.substring(0, url.length - 1) : url;
return url ? url : url.substring(1);
},
/**
* get参数拼接url
* @param {String} url 需要处理的url
* @param {Object} data 需要转化的Object对象
*/
setUrl(url, data) {
let result = url += (url.indexOf("?") < 0 ? "?" : "&") + util.set_param(data);
return result;
},
/**
* query字符串转对象
* @param {Object} str query字符串
*/
query_to_param(str) {
let obj = {};
decodeURIComponent(str).split("&").forEach((item) => {
let [key, val] = item.split("=");
obj[key] = val;
});
return obj;
},
/**
* 倒计时
* @param {String} endtime 结束时间
*/
countDownd(endtime) {
if (!endtime) {
return;
}
endtime = Number(endtime);
let day = util.timeFormin(parseInt(time / (60 * 60 * 24)));
let hou = util.timeFormin(parseInt(time % (60 * 60 * 24) / 3600));
let min = util.timeFormin(parseInt(time % (60 * 60 * 24) % 3600 / 60));
let sec = util.timeFormin(parseInt(time % (60 * 60 * 24) % 3600 % 60));
let str = "";
if (day) {
str += day + "\u5929";
}
if (hou || hou == 0) {
if (hou > 9) {
str += hou + ":";
} else {
str += "0" + hou + ":";
}
} else {
str += "00:";
}
if (min || min == 0) {
if (min > 9) {
str += min + ":";
} else {
str += "0" + min + ":";
}
} else {
str += "00:";
}
if (sec) {
if (sec > 9) {
str += sec;
} else {
str += "0" + sec;
}
} else {
str += "00";
}
return str;
},
// 格式化时间
timeFormin(param) {
return param < 0 ? 0 : param;
},
/**
* 对二补齐
* @param {String} str 数字或数字字符串
*/
toTwo(str) {
let num = String(Number(str));
if (num.length < 2) {
num = "0" + num;
}
return num;
},
/**
* 时间戳处理成时间
* @param {Object} str
* 时间格式 月、日、时、分、秒 单个字母不补0
* yyyy 年
* MM 月
* dd 日
* WW 周
* HH 小时 24小时制
* hh 小时 12小时制
* mm 分钟
* ss 秒
* a am/pm
* 比如 'yyyy-MM-dd HH:mm:ss 周w a' 返回2023-02-06 11:19:19 周一 pm
* @param {Number} timestamp 需要处理时间戳
*/
formatTime(str, timestamp) {
const nowDate = /* @__PURE__ */ new Date();
let weekList = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
if (!str || typeof str != "string") {
str = "yyyy-MM-dd HH:mm:ss";
}
if (!timestamp) {
timestamp = nowDate.valueOf();
} else if (String(timestamp).length <= 10) {
timestamp = timestamp * 1e3;
}
const date = new Date(timestamp);
let year = date.getFullYear(), moth = date.getMonth() + 1, day = date.getDate(), week = date.getDay(), hour = date.getHours(), minute = date.getMinutes(), second = date.getSeconds();
str = str.replace("yyyy", year);
str = str.replace("MM", this.toTwo(moth));
str = str.replace("M", moth);
str = str.replace("dd", this.toTwo(day));
str = str.replace("d", day);
str = str.replace("w", weekList[week]);
if (str.match("h")) {
hour = hour > 12 ? hour - 12 : hour;
str = str.replace("hh", this.toTwo(hour));
str = str.replace("h", hour);
} else if (str.match("H")) {
str = str.replace("HH", this.toTwo(hour));
str = str.replace("H", hour);
}
str = str.replace("mm", this.toTwo(minute));
str = str.replace("m", minute);
str = str.replace("ss", this.toTwo(second));
str = str.replace("s", second);
let a = hour > 12 ? "am" : "pm";
str = str.replace("a", a);
return str;
},
/**
* 时间计算
* @param {String} format 格式化 规则
* format '+1 month' 往后一个月
* @param {Number} value 需要处理的时间戳 单位秒
*/
strtotime(format, value) {
if (value && format.indexOf(" ") > -1) {
let unit = format.split(" ");
let pre = unit[0];
let next = unit[1];
if (!value)
value = nowDate2.valueOf();
else if (String(value).length <= 10)
value = value * 1e3;
let nowDate2 = new Date(value);
switch (next) {
case "year":
nowDate2.setYear(nowDate2.getFullYear() + parseInt(pre));
break;
case "month":
nowDate2.setMonth(nowDate2.getMonth() + parseInt(pre));
break;
case "day":
nowDate2.setDate(nowDate2.getDate() + parseInt(pre));
break;
case "week":
nowDate2.setDate(nowDate2.getDate() + parseInt(pre) * 7);
break;
case "hour":
nowDate2.setHours(nowDate2.getHours() + parseInt(pre));
break;
case "minute":
nowDate2.setMinutes(nowDate2.getMinutes() + parseInt(pre));
break;
}
return nowDate2.getTime();
} else {
var nowDate = new Date(value);
return nowDate.getTime();
}
},
/**
* 上传图片
* @param {Object} obj 对象类型
* @param {Array} obj.value 操作的对象
* @param {Boolean} obj.unlimited 不限制
* @param {Number} obj.count 图片计数
* @param {Number} obj.type 1单张 2多张
* @param {Array} obj.sourceType ['album', 'camera']
* @param {Function} obj.success 执行成功返回的方法return修改的对象
*/
upload_image(obj) {
const count = obj.count ? obj.count : 8;
if (!obj.type)
obj.type = 2;
if (obj.value != "" && obj.value == void 0 && obj.value == null)
obj.value = obj.type == 1 ? "" : [];
if (obj.value.length >= count && obj.type == 2) {
util.alert("\u4E0A\u4F20\u56FE\u7247\u5DF2\u8FBE\u4E0A\u9650");
return;
}
let sourceType = ["album", "camera"];
uni.chooseImage({
// 限制图片
count: obj.type == 1 ? 1 : count - obj.value.length,
sourceType: obj.sourceType || sourceType,
success: (rs) => {
rs.tempFiles.forEach((item) => {
let size = 1024 * 1024 * util.config.img_size;
if (item.size > size && !obj.unlimited) {
util.alert(`\u5927\u5C0F\u8D85\u8FC7${util.config.img_size}m`);
return;
}
util.upload({
file: item.path,
mode: "img",
success(res) {
if (res.code === 200) {
const result = res.data.url;
if (obj.type == 2) {
obj.value.push(result);
} else if (obj.type == 1) {
obj.value = result;
}
obj.success && obj.success({
value: result
});
return;
}
util.alert(rs.msg);
}
});
});
},
fail(rs) {
if (rs.errMsg == "chooseImage:fail cancel")
;
}
});
},
/**
* 上传视频
* @param {Object} obj 对象类型
* @param {Array} obj.value 操作的对象
* @param {Object} obj.unlimited 不限制
* @param {Object} obj.count 计数
* @param {Object} obj.success 执行成功返回的方法return修改的对象
*/
upload_video(obj) {
obj.count ? obj.count : 1;
uni.chooseVideo({
compressed: false,
success(rs) {
util.upload({
file: rs.tempFilePath,
mode: "video",
success(res) {
if (res.code == 200) {
obj.success && obj.success({
value: res.data.url,
width: rs.width,
height: rs.height,
size: rs.size,
duration: rs.duration
// value: fullUrl,
});
return;
} else {
util.alert(res.msg);
}
}
});
},
fail(rs) {
if (rs.errMsg == "chooseImage:fail cancel")
;
}
});
},
/**
* 上传文件
* @param {Object} obj 对象类型
* @param {Array} obj.value 操作的对象
* @param {Object} obj.count 计数
* @param {Object} obj.success 执行成功返回的方法return修改的对象
*/
upload_files(obj) {
const value = obj.value;
const file_suffix = util.config.file_suffix;
const count = obj.count ? obj.count : 1;
if (value.length >= count) {
util.alert("\u4E0A\u4F20\u6570\u91CF\u5DF2\u8FBE\u4E0A\u9650");
return;
}
formatAppLog("log", "at common/js/util.js:719", "upload_files", obj);
function result_fn(path) {
let str = path.split(".").pop().toLowerCase();
let reult = file_suffix.find((node) => node.id == str);
if (!reult) {
util.alert(`\u4E0D\u80FD\u4E0A\u4F20${str}\u683C\u5F0F\u6587\u4EF6`);
return;
}
util.upload({
file: path,
success(res) {
if (res.code == 200) {
value.push(res.data);
obj.success && obj.success(__spreadProps(__spreadValues({}, res.data), {
value
}));
} else {
util.alert(res.msg);
}
}
});
}
if (uni.getSystemInfoSync().platform == "android") {
formatAppLog("log", "at common/js/util.js:771", "chooseFile");
chooseFile((rs) => {
formatAppLog("log", "at common/js/util.js:773", "rs", rs);
result_fn(rs);
});
} else {
util.alert("\u56E0\u6743\u9650\u95EE\u9898\uFF0C\u6682\u4E0D\u652F\u6301\u975Eandroid\u5E73\u53F0");
}
return;
},
/**
* 上传音频
* @param {Object} obj 对象类型
* @param {Array} obj.value 操作的对象
* @param {Object} obj.count 计数
* @param {Object} obj.success 执行成功返回的方法return修改的对象
*/
upload_audio(obj) {
const value = obj.value;
const audio_suffix = util.config.audio_suffix;
const count = obj.count ? obj.count : 1;
if (value.length >= count) {
util.alert("\u4E0A\u4F20\u6570\u91CF\u5DF2\u8FBE\u4E0A\u9650");
return;
}
function result_fn(path) {
let str = path.split(".").pop().toLowerCase();
let reult = audio_suffix.find((node) => node.id == str);
if (!reult) {
util.alert(`\u4E0D\u80FD\u4E0A\u4F20${str}\u683C\u5F0F\u6587\u4EF6`);
return;
}
util.upload({
file: path,
success(res) {
if (res.code == 200) {
value.push(res.data);
obj.success && obj.success(__spreadProps(__spreadValues({}, res.data), {
value
}));
} else {
util.alert(res.msg);
}
}
});
}
if (uni.getSystemInfoSync().platform == "android") {
chooseFile((rs) => {
formatAppLog("log", "at common/js/util.js:856", "chooseFile", rs);
result_fn(rs);
});
} else {
util.alert("\u56E0\u6743\u9650\u95EE\u9898\uFF0C\u6682\u4E0D\u652F\u6301\u975Eandroid\u5E73\u53F0");
}
return;
},
/**
* 视频转封面 oss特有
* @param {Object} url 视频路径
*/
video_coverImage(url) {
let result = `${url}?x-oss-process=video/snapshot,t_1,m_fast`;
return result;
},
/**
* 预览图片
* @param {Array} urls 图片列表
* @param {Number} current 当前预览的下标
*/
view_imgs(urls, current) {
if (!urls || urls.length == 0) {
util.alert("\u6682\u65E0");
return;
}
uni.previewImage({
urls,
current
});
},
/**
* 预览文件
* @param {String} url 文件路径
*/
view_file(url) {
let suffix = util.get_file_suffix(url).id;
if (!["doc", "xls", "ppt", "pdf", "docx", "xlsx", "pptx"].includes(suffix)) {
util.alert("\u64CD\u4F5C\u9700\u8981\u5728web\u7AEF");
formatAppLog("log", "at common/js/util.js:903", "Unsupported suffix", suffix);
return;
}
uni.downloadFile({
url,
success: (res) => {
uni.openDocument({
filePath: res.tempFilePath,
fail: (rs) => {
formatAppLog("log", "at common/js/util.js:912", "rs", rs);
}
});
}
});
},
/**
* 通过路径获取文件后缀
* @param {Object} url 需要获取的文件路径
* @param {Object} type file文件 audio音频
* @return {Object} 返回后缀列表对象 util.config.file_suffix
*/
get_file_suffix(url, type) {
if (!type)
type = "file";
const file_suffix = util.config[{
"file": "file_suffix",
"audio": "audio_suffix"
}[type]];
let result = "";
if (url)
result = file_suffix.find((item) => item.id === url.split(".").pop().toLowerCase());
return result;
},
/**
* 通过路径获取音频后缀
* @param {Object} url 需要获取的文件路径
* @return {Object} 返回后缀列表对象 util.config.file_suffix
*/
get_audio_suffix(url) {
const audio_suffix = util.config.audio_suffix;
let result = "";
if (url)
result = audio_suffix.find((item) => item.id === url.split(".").pop().toLowerCase());
return result;
},
/**
* 调起支付
* @param {Object} obj 操作对象
* @param {String} obj.payType 支付方式 WeChat微信 AliPay支付宝 4钱包
* @param {String} obj.method 支付环境 app手机应用 mp小程序
* @param {String} obj.debug 调试模式
* @param {Boolean|Object} obj.cb 支付结果跳转 false为不跳转 跳转需携带object定义对象
* @param {String} obj.cb.styles 风格 style1蓝色 style2绿色 style3橙色
* @param {String} obj.cb.result 结果 success成功 fail失败
* @param {String} obj.cb.price 价格
* @param {String} obj.cb.url 跳转的详情路径
* @param {Function} obj.fn 请求接口函数
* @param {Function} obj.success 成功方法
* @param {Function} obj.fail 失败方法
* @param {Function} obj.complete 结束方法
*/
payment(obj) {
obj = obj ? obj : {};
obj.data = obj.data ? obj.data : {};
obj.method = "app";
util.payment_request(obj);
},
// 支付请求
payment_request(obj) {
obj.debug ? formatAppLog("log", "at common/js/util.js:993", "params", obj) : "";
if (!obj.fn) {
throw "no function";
}
function result_goto(result) {
const cb = obj.cb;
if (!cb)
return;
uni.redirectTo({
url: util.setUrl("/index/pay_result", {
orderNumber: cb.orderNumbers || "",
result,
styles: cb.styles || "",
price: cb.price || "",
url: cb.url || ""
})
});
}
obj.fn(obj.data).then((rs) => {
obj.debug ? formatAppLog("log", "at common/js/util.js:1022", "request success result", rs) : "";
if (rs.code == 200) {
switch (obj.data.payType) {
case "1":
switch (obj.method) {
case "mp":
if (rs.data && rs.data.paySign) {
uni.requestPayment({
provider: "wxpay",
timeStamp: rs.data.timeStamp,
package: rs.data.package,
nonceStr: rs.data.nonceStr,
paySign: rs.data.paySign,
signType: rs.data.signType,
success(result) {
obj.success ? obj.success(rs) : "";
result_goto("success");
},
fail(result) {
obj.fail ? obj.fail(result) : "";
result_goto("fail");
},
complete(result) {
obj.debug ? formatAppLog(
"log",
"at common/js/util.js:1048",
"requestPayment complete",
result
) : "";
obj.complete ? obj.complete(result) : "";
}
});
} else {
obj.fail ? obj.fail("no data") : "";
}
break;
case "app":
uni.requestPayment({
provider: "wxpay",
orderInfo: rs.data,
success(result) {
obj.success ? obj.success(rs) : "";
result_goto("success");
},
fail(result) {
obj.fail ? obj.fail(result) : "";
result_goto("fail");
},
complete(result) {
obj.debug ? formatAppLog("log", "at common/js/util.js:1071", "requestPayment complete", result) : "";
obj.complete ? obj.complete(result) : "";
}
});
break;
}
break;
case "2":
switch (obj.method) {
case "app":
uni.requestPayment({
provider: "alipay",
orderInfo: rs.msg,
success(result) {
obj.success ? obj.success(rs) : "";
result_goto("success");
},
fail(result) {
obj.fail ? obj.fail(result) : "";
result_goto("fail");
},
complete(result) {
obj.debug ? formatAppLog("log", "at common/js/util.js:1096", "requestPayment complete", result) : "";
obj.complete ? obj.complete(result) : "";
}
});
break;
}
break;
case "4":
obj.success ? obj.success(rs) : "";
result_goto("success");
break;
}
} else {
util.alert(rs.msg);
obj.fail ? obj.fail(rs) : "";
}
}).catch((rs) => {
formatAppLog("log", "at common/js/util.js:1116", "request catch result", rs);
});
},
// 微信小程序登录
weChatLogin(obj) {
obj = obj ? obj : {};
const parent_id = uni.getStorageSync("parent_id");
const admin_id = uni.getStorageSync("admin_id");
uni.getUserProfile({
desc: "weixin",
success: (e) => {
const userInfo = e.userInfo;
let data = {
nickName: userInfo.nickName,
avatarUrl: userInfo.avatarUrl
};
uni.login({
provider: "weixin",
success: (rs) => {
data.code = rs.code;
data.platform = "wechatMini";
if (parent_id)
data.parent_id = parent_id;
if (admin_id)
data.admin_id = admin_id;
if (rs.errMsg == "login:ok") {
util.request({
url: "/api/user/third",
data,
load: 1
}).then((res) => {
if (res.code == 200) {
obj.success ? obj.success(res) : "";
}
});
}
}
});
},
fail(res) {
util.alert("\u60A8\u62D2\u7EDD\u4E86\u6388\u6743");
obj.fail ? obj.fail(res) : (res2) => {
};
},
complete() {
obj.complete ? obj.complete() : "";
}
});
},
/**
* 拉起授权请求: 微信小程序、app
*/
authorize(obj) {
return new Promise((resolve, reject) => {
obj ? obj : obj = {};
let isAgreePrivacy = plus.runtime.isAgreePrivacy();
if (!isAgreePrivacy) {
resolve("\u672A\u540C\u610F\u7528\u6237\u534F\u8BAE\u9690\u79C1\u653F\u7B56");
return;
}
const menu = {
// 定位
location: {
name: "\u5B9A\u4F4D\u670D\u52A1",
scope: "scope.userLocation",
txt: "\u9700\u8981\u83B7\u53D6\u60A8\u7684\u5730\u7406\u4F4D\u7F6E"
},
// 相册
photosAlbum: {
name: "\u76F8\u518C",
scope: "scope.writePhotosAlbum",
txt: "\u9700\u8981\u8BBF\u95EE\u60A8\u7684\u76F8\u518C"
},
// 相机
camera: {
name: "\u6444\u50CF\u5934",
scope: "scope.camera",
txt: "\u9700\u8981\u8BBF\u95EE\u60A8\u7684\u6444\u50CF\u5934"
}
};
if (obj.key) {
obj = __spreadValues(__spreadValues({}, obj), menu[obj.key]);
}
let fnName = "";
fnName = "appAuthorize";
this[fnName](obj).then((rs) => {
obj.success ? obj.success(rs) : "";
resolve(rs);
}).catch((err) => {
obj.fail ? obj.fail(err) : "";
reject(err);
});
});
},
// app授权
appAuthorize(obj) {
return new Promise((resolve, reject) => {
const systemSetting = uni.getSystemSetting();
if (systemSetting.locationEnabled === false) {
this.alert(obj.txt);
reject({
msg: "\u672A\u6388\u6743\u5BF9\u5E94\u529F\u80FD"
});
return;
}
const authorized = uni.getAppAuthorizeSetting().locationAuthorized;
formatAppLog("log", "at common/js/util.js:1278", "locationAuthorized", authorized);
if (authorized === "config error") {
reject({
msg: "\u5F00\u53D1\u8005\u672A\u52FE\u9009\u5B9A\u4F4D\u670D\u52A1\u6A21\u5757"
});
return;
} else if (authorized === "denied")
;
else if (authorized === "authorized") {
resolve(obj);
return;
}
if (uni.getSystemInfoSync().platform == "android") {
plus.android.requestPermissions(
// 对应权限
["android.permission.ACCESS_FINE_LOCATION"],
// 成功
(resultObj) => {
let result = null;
for (let i = 0; i < resultObj.granted.length; i++) {
let grantedPermission = resultObj.granted[i];
formatAppLog("log", "at common/js/util.js:1310", "\u5DF2\u83B7\u53D6\u7684\u6743\u9650\uFF1A" + grantedPermission);
}
for (let i = 0; i < resultObj.deniedPresent.length; i++) {
let deniedPresentPermission = resultObj.deniedPresent[i];
formatAppLog("log", "at common/js/util.js:1317", "\u62D2\u7EDD\u672C\u6B21\u7533\u8BF7\u7684\u6743\u9650\uFF1A" + deniedPresentPermission);
}
for (let i = 0; i < resultObj.deniedAlways.length; i++) {
let deniedAlwaysPermission = resultObj.deniedAlways[i];
formatAppLog("log", "at common/js/util.js:1323", "\u6C38\u4E45\u62D2\u7EDD\u7533\u8BF7\u7684\u6743\u9650\uFF1A" + deniedAlwaysPermission);
}
if ([-1].includes(result)) {
uni.openAppAuthorizeSetting({
success: (rs) => {
reject({
msg: "\u5F15\u5BFC\u7528\u6237\u6253\u5F00\u8BBE\u7F6E\u9875\u9762",
info: rs
});
},
fail: (err) => {
reject({
msg: "\u7528\u6237\u8BBE\u7F6E\u9875\u9762\u6253\u5F00\u5931\u8D25",
info: err
});
}
});
}
},
// 失败
(error) => {
formatAppLog("log", "at common/js/util.js:1353", "\u7533\u8BF7\u6743\u9650\u9519\u8BEF\uFF1A" + error.code + " = " + error.message);
resolve({
code: error.code,
message: error.message
});
}
);
} else {
this.alert("\u8BF7\u5728\u8BBE\u7F6E\u91CC\u5141\u8BB8\u6253\u5F00\u5B9A\u4F4D\u4FE1\u606F");
resolve({
msg: "\u7528\u6237\u672A\u5F00\u542F\u5B9A\u4F4D\u6743\u9650"
});
return;
}
});
},
// 微信小程序授权
weChatAuthorize(obj) {
return new Promise((resolve, reject) => {
if (![
"scope.userInfo",
"scope.userLocation",
"scope.userLocationBackground",
"scope.address",
"scope.record",
"scope.writePhotosAlbum",
"scope.camera",
"scope.invoice",
"scope.invoiceTitle",
"scope.werun"
].includes(obj.scope)) {
resolve({
msg: "\u4E0D\u5728\u9650\u5236\u8303\u56F4\u5185"
});
return;
}
uni.authorize({
scope: obj.scope,
success: (rs) => {
resolve(rs);
},
fail: (err) => {
reject(err);
util.alert({
title: "\u7CFB\u7EDF\u63D0\u793A",
value: obj.txt,
success: (rs) => {
if (rs.confirm) {
uni.openSetting();
}
}
});
}
});
});
},
/**
* 最终登录 用于请求登录接口后统一调用的登录方法
* @param {Object} param 数据对象
* @param {Function} cb 回调函数
*/
finalLogin(param, cb) {
const token = param.data;
uni.setStorageSync("token", token);
uni.showLoading({
mask: true
});
util.getUserinfo((userinfo) => {
uni.$emit("login");
util.loginTencent(userinfo);
setTimeout(() => {
uni.switchTab({
url: "/pages/index/index"
});
}, 500);
cb ? cb() : "";
});
},
// 登录账号管理
loginAccountManagement(userInfo) {
let userList = uni.getStorageSync("userInfoList") || [];
const index = userList.findIndex((item) => item.userId === userInfo.userId);
if (index !== -1) {
userList.splice(index, 1);
}
userList.push(userInfo);
uni.setStorageSync("userInfoList", userList);
},
// 登录腾讯聊天
loginTencent(userinfo) {
api.login.getIMToken({}).then((rs) => {
const loginParams = {
SDKAppID: util.config.TChat.SDKAppID,
userID: userinfo.id + "",
userSig: rs.msg
};
uni.$TUICallKit.login(loginParams, (res) => {
if (res.code === 0) {
formatAppLog("log", "at common/js/util.js:1476", "[TUICallKit] login success.");
} else {
formatAppLog("error", "at common/js/util.js:1478", "[TUICallKit] login failed, failed message = ", res.msg, params);
}
});
uni.$chat.login({
userID: userinfo.id + "",
userSig: rs.msg
}).then((rs2) => {
formatAppLog("log", "at common/js/util.js:1487", "im login success", rs2);
});
});
return;
},
/**
* 获取用户信息
* @param {Function} cb 回调函数
*/
getUserinfo(cb) {
return new Promise((reslove) => {
api.mine.getUserinfo().then((rs) => {
if (rs.code === 200) {
const userinfo = rs.data;
reslove(userinfo);
store.commit("setState", {
key: "userinfo",
value: userinfo
});
uni.setStorageSync("userinfo", userinfo);
cb ? cb(userinfo) : "";
}
}).finally(() => {
uni.hideLoading();
});
});
},
/**
* 验证登录
* @param {Object} cb 回调函数
*/
isLogin(cb) {
let userinfo = uni.$store.state.userinfo;
return new Promise((resolve, reject) => {
if (!userinfo.id) {
reject();
return;
}
resolve();
cb ? cb() : "";
});
},
/**
* 清除登录状态
* @param {Function} cb 回调函数
*/
logout(cb) {
const userinfo = store.state.userinfo;
if (userinfo.userId) {
uni.$emit("logout");
uni.$chat.logout().then((rs) => {
formatAppLog("log", "at common/js/util.js:1562", "tim logout rs");
}).catch((rs) => {
formatAppLog("log", "at common/js/util.js:1564", "tim logout error:", rs);
});
}
store.commit("setState", {
key: "userinfo",
value: {}
});
uni.removeStorageSync("userinfo");
uni.removeStorageSync("token");
cb ? cb() : "";
},
// 是否实名
isAuth(param) {
util.isLogin(() => {
const userinfo = uni.$store.state.userinfo;
formatAppLog("log", "at common/js/util.js:1586", "userinfo.userIdCard", userinfo.userIdCard);
if (userinfo.userIdCard) {
param.success ? param.success(userinfo) : "";
return;
}
if (!param.noLink)
uni.navigateTo({
url: "/pages/mine/realname"
});
param.fail ? pararm.fail(userinfo) : "";
});
},
// 拨打电话
makePhone(phoneNumber) {
if (!phoneNumber) {
util.alert("\u6682\u65E0\u624B\u673A\u53F7");
}
uni.makePhoneCall({
phoneNumber,
fail(err) {
formatAppLog("log", "at common/js/util.js:1608", "err", err);
}
});
},
/**
* 处理路径添加host或这默认图片地址
* @param {String} ev 需要处理的字符串
* @param {String} mode img图片 video视频
* @return {String} 返回的路径
*/
format_url(ev, mode) {
if (!ev)
return "";
if (ev.match(/^http/))
return ev;
return "https://9yvideo.oss-cn-beijing.aliyuncs.com/" + ev;
},
/**
* 去除路径里的host
* @param {Object} ev 需要处理的字符串
* @return {String} 处理之后的路径
*/
replace_url(ev) {
if (!ev || typeof ev != "string")
throw `${ev} is not String`;
let result = ev.slice(ev.indexOf("/images") + 1);
return result;
},
/**
* 格式化经纬度
* @param {String} num 数字或数字字符串
*/
formart_lnglat(num) {
if (!num)
return num;
num = parseFloat(Number(num).toFixed(6));
return num;
},
/**
* 检查跳转
* @param {String} route 路径
* @param {String} type 跳转
*/
checkLink(route, type = "navigateTo") {
const currentPages = getCurrentPages();
const find_route = route;
const find_index = currentPages.findIndex((node) => {
return node.route == find_route;
});
if (find_index < 0) {
uni[type]({
url: `/${find_route}`
});
} else {
uni.navigateBack({
delta: currentPages.length - find_index - 1
});
}
},
/**
* 数字转化
*/
rp(n) {
var cnum = ["\u96F6", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D", "\u4E03", "\u516B", "\u4E5D", "\u5341"];
var s = "";
n = "" + n;
for (var i = 0; i < n.length; i++) {
s += cnum[parseInt(n.charAt(i))];
}
if (s.length == 2) {
if (s.charAt(1) == cnum[0]) {
s = s.charAt(0) + cnum[10];
if (s == cnum[1] + cnum[10]) {
s = cnum[10];
}
} else if (s.charAt(0) == cnum[1]) {
s = cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[2]) {
s = cnum[2] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[3]) {
s = cnum[3] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[4]) {
s = cnum[4] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[5]) {
s = cnum[5] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[6]) {
s = cnum[6] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[7]) {
s = cnum[7] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[8]) {
s = cnum[8] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[9]) {
s = cnum[9] + cnum[10] + s.charAt(1);
} else if (s.charAt(0) == cnum[10]) {
s = cnum[10] + cnum[10] + s.charAt(1);
}
}
return s;
},
/**
* 复制文本
* @param {String} text 需要复制的文本
*/
copyText(text) {
uni.setClipboardData({
data: text,
success: () => {
util.alert({
title: "\u6587\u672C\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"
});
}
});
},
showToastAndRedirect(title, icon = "none", fun = () => {
}) {
uni.showToast({
title,
icon,
duration: 2e3,
// 显示两秒
complete: () => {
fun();
uni.hideLoading();
}
});
},
/**
* 去聊天
* @param {Object} option
* @param {Object} option.name 标题昵称
* @param {Object} option.msgId 聊天对象id
* @param {Object} option.type 聊天类型
*/
toChat(option) {
uni.navigateTo({
url: util.setUrl("/pages/news/chat/chat", {
name: option.name,
msgId: option.msgId,
type: option.type
})
});
},
// 扫码
scan() {
uni.scanCode({
success: (res) => {
if (res && res.result) {
let result = JSON.parse(res.result);
if (result.key == "user") {
uni.navigateTo({
url: util.setUrl("/pages/news/applyFriend", {
userId: result.userId,
nickname: result.userNickname
})
});
}
}
},
fail: (err) => {
util.alert("\u4E8C\u7EF4\u7801\u626B\u63CF\u5931\u8D25");
}
});
},
// 获取我的钱包
getPurse() {
api.mine.selectPurse().then((rs) => {
if (rs.code == 200) {
uni.$store.commit("setState", {
key: "purse",
value: rs.data
});
return;
}
util.alert({
content: rs.msg,
showCancel: false
});
});
},
// 获取我的任务
getMyTask() {
util.isLogin().then(() => {
api.intergral.viewingTasks({}).then((rs) => {
if (rs.code == 200) {
uni.$store.commit("setState", {
key: "task",
value: rs.data
});
return;
}
});
}).catch(() => {
uni.$store.commit("setState", {
key: "task",
value: {
//任务类型 0.任务读秒 1.流量点(种子)读秒
taskType: 0,
//有效时长
viewingDuration: 0
}
});
});
}
};
var util$1 = util;
var _style_0$8 = {};
var _sfc_main$9 = {
__name: "statusBar",
setup(__props, { expose: __expose }) {
__expose();
const height = (0, import_vue2.ref)(0);
onLoad(() => {
uni.getSystemInfo().then((rs) => {
height.value = rs.statusBarHeight + "px";
});
});
const __returned__ = { height, get onLoad() {
return onLoad;
}, ref: import_vue2.ref };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
"view",
{
style: (0, import_vue2.normalizeStyle)({ height: $setup.height }),
renderWhole: true
},
null,
4
/* STYLE */
);
}
var statusBar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["styles", [_style_0$8]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/header/statusBar.vue"]]);
var _style_0$7 = { "timeBox": { "": { "position": "fixed", "left": 0, "right": 0, "bottom": "300rpx", "textAlign": "center", "zIndex": 9 } }, "time": { ".timeBox ": { "width": "450rpx", "paddingTop": 0, "paddingRight": "20rpx", "paddingBottom": 0, "paddingLeft": "20rpx", "backgroundColor": "rgba(0,0,0,0.6)", "borderRadius": "10rpx" } }, "text": { ".timeBox ": { "marginTop": "10rpx", "marginRight": "20rpx", "marginBottom": "10rpx", "marginLeft": "20rpx", "fontSize": "50rpx", "color": "#ffffff" } }, "durationBox": { "": { "paddingTop": "60rpx" } }, "duration": { ".durationBox ": { "width": "750rpx", "backgroundColor": "rgba(255,255,255,0.3)" } }, "line": { ".durationBox .duration ": { "width": 0, "height": "2rpx", "backgroundColor": "rgba(255,255,255,0.8)", "transitionDuration": 250 } }, "@TRANSITION": { "line": { "duration": 250 } } };
var _sfc_main$8 = {
__name: "videoProgress",
props: {
time: {
type: Object,
default: {
duration: 0,
currentTime: 0
}
},
// 组件宽度
viewWidth: {
type: Number
}
},
emits: ["change", "end"],
setup(__props, { expose: __expose, emit: __emit }) {
__expose();
const props = __props;
(0, import_vue2.watch)(props.time, (nV, oV) => {
formatAppLog("log", "at components/index/videoProgress.vue:29", "time", nV, oV);
}, {
deep: true
});
const emit = __emit;
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
const trigger = (0, import_vue2.ref)(false);
const videoTime = (0, import_vue2.ref)(0);
const videoProgress2 = (0, import_vue2.ref)(0);
const videoCurrent = (0, import_vue2.computed)(() => {
let result = formatNum(props.time.currentTime);
if (trigger.value)
result = videoTime.value;
return result;
});
const progress = (0, import_vue2.computed)(() => {
let result = 0;
if (!trigger.value) {
const duration = formatNum(props.time.duration);
if (duration != 0)
result = formatNum(props.time.currentTime) / duration * props.viewWidth;
result = formatNum(result);
} else {
result = videoProgress2.value;
}
return result;
});
const formatDuration = (0, import_vue2.computed)(() => {
let result = formatNum(props.time.duration).toFixed(2);
return result;
});
function formatNum(num) {
let result = Number.parseFloat(num).toFixed(2);
return Number.parseFloat(result);
}
function onStart() {
trigger.value = true;
}
function onMove(ev) {
const time2 = formatNum(ev.changedTouches[0].screenX);
let target = formatNum(formatNum(time2 / props.viewWidth) * Number(formatDuration.value));
videoTime.value = target;
videoProgress2.value = time2;
}
function onEnd(ev) {
trigger.value = false;
emit("change", {
time: videoTime.value
});
}
const __returned__ = { props, emit, proxy, trigger, videoTime, videoProgress: videoProgress2, videoCurrent, progress, formatDuration, formatNum, onStart, onMove, onEnd, ref: import_vue2.ref, computed: import_vue2.computed, onMounted: import_vue2.onMounted, getCurrentInstance: import_vue2.getCurrentInstance, watch: import_vue2.watch };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
[
$setup.trigger ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "timeBox fdr jcc"
}, [
(0, import_vue2.createElementVNode)("view", { class: "time fdr jcc" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "text f1" },
(0, import_vue2.toDisplayString)($setup.videoCurrent),
1
/* TEXT */
),
(0, import_vue2.createElementVNode)("u-text", { class: "text" }, "/"),
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "text f1" },
(0, import_vue2.toDisplayString)($setup.formatDuration),
1
/* TEXT */
)
])
])) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createElementVNode)(
"view",
{
class: "durationBox",
ref: "durationBoxRef",
onTouchstart: (0, import_vue2.withModifiers)($setup.onStart, ["stop"]),
onTouchmove: (0, import_vue2.withModifiers)($setup.onMove, ["stop"]),
onTouchcancel: $setup.onEnd,
onTouchend: (0, import_vue2.withModifiers)($setup.onEnd, ["stop"])
},
[
(0, import_vue2.createCommentVNode)(' <slider :min="0" :max="formatDuration" @change="change" /> '),
(0, import_vue2.createElementVNode)("view", { class: "duration" }, [
(0, import_vue2.createElementVNode)(
"view",
{
class: "line",
style: (0, import_vue2.normalizeStyle)({ width: $setup.progress + "px" })
},
null,
4
/* STYLE */
)
])
],
544
/* NEED_HYDRATION, NEED_PATCH */
)
],
64
/* STABLE_FRAGMENT */
);
}
var videoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["styles", [_style_0$7]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/index/videoProgress.vue"]]);
var _imports_0$2 = "/static/pause.png";
var _imports_1 = "/static/indexAtt.png";
var _imports_2 = "/static/indexLike.png";
var _imports_3 = "/static/indexLike1.png";
var _imports_4 = "/static/privateLike.png";
var _imports_5 = "/static/indexMsg.png";
var _imports_6 = "/static/indexCollect1.png";
var _imports_7 = "/static/indexCollect.png";
var _imports_8 = "/static/indexShare.png";
var _imports_9 = "/static/indexMoney1.png";
var _imports_10 = "/static/indexMoney.png";
var _style_0$6 = { "container": { "": { "backgroundColor": "#000000" } }, "duration": { "": { "marginTop": "120rpx", "width": "750rpx", "backgroundColor": "rgba(255,255,255,0.3)" } }, "line": { ".duration ": { "width": 0, "height": "2rpx", "backgroundColor": "rgba(255,255,255,0.8)", "transitionDuration": 250 } }, "speedBox": { "": { "position": "absolute", "top": "200rpx", "left": 0, "right": 0, "alignItems": "center" } }, "speed": { ".speedBox ": { "backgroundColor": "rgba(0,0,0,0.8)", "borderRadius": "5rpx", "opacity": 0.6 } }, "pausePanel": { "": { "backgroundColor": "rgba(0,0,0,0.5)" } }, "pauseImg": { ".pausePanel ": { "width": "140rpx", "height": "140rpx" } }, "panelRight": { "": { "alignItems": "flex-end" } }, "text": { ".panelRight ": { "textAlign": "center", "color": "#ffffff", "fontSize": "24rpx" } }, "operate": { ".panelRight ": { "flex": 1, "justifyContent": "flex-end", "alignItems": "flex-end", "textAlign": "center", "paddingBottom": "130rpx" } }, "item": { ".panelRight .operate ": { "marginTop": "5rpx", "marginRight": 0, "marginBottom": "5rpx", "marginLeft": 0, "paddingTop": "10rpx", "paddingRight": "5rpx", "paddingBottom": "10rpx", "paddingLeft": "5rpx" }, ".panelRight .operate .money": { "paddingTop": 0, "paddingRight": 0, "paddingBottom": 0, "paddingLeft": 0 } }, "col": { ".panelRight .operate .item ": { "alignItems": "center", "justifyContent": "center", "width": "80rpx" } }, "focus": { ".panelRight ": { "alignItems": "center", "left": 0, "right": 0, "bottom": 0 } }, "panelBottom": { "": { "paddingRight": "150rpx" } }, "goods": { ".panelBottom ": { "paddingTop": "10rpx", "paddingRight": "10rpx", "paddingBottom": "10rpx", "paddingLeft": "10rpx", "width": "480rpx", "marginBottom": "20rpx", "backgroundColor": "rgba(0,0,0,0.3)" } }, "videoProgress": { "": { "position": "absolute", "left": 0, "right": 0, "bottom": 0 } }, "@TRANSITION": { "line": { "duration": 250 } } };
var _sfc_main$7 = {
__name: "indexVideo",
props: {
// 当前视频对象
item: {
type: Object
},
// 列表中的视频下标
index: {
type: Number
},
// 当前列表的index
current: {
type: Number
},
// 当前tab的index
tabIndex: {
type: Number
},
// 模式 list列表 detail详情
mode: {
type: String,
default: "list"
},
// 是否我自己 0不是 1是
isMine: {
type: [String, Number],
default: 0
},
width: {
type: Number,
default: 0
},
height: {
type: Number,
default: 0
}
},
emits: [
"showTime",
"showComment",
"showCollect",
"showFastCollect",
"showShareFirend",
"onPlay",
"onPause",
"like",
"detailMenu",
"onEnd",
"longtap"
],
setup(__props, { expose: __expose, emit: __emit }) {
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
const props = __props;
const emit = __emit;
const videoCtx = (0, import_vue2.ref)(null);
const playState = (0, import_vue2.ref)(true);
const collectFirst = (0, import_vue2.ref)(false);
const videoTime = (0, import_vue2.ref)({
// 总长
duration: 0,
// 当前时间
currentTime: 0
});
const tapList = (0, import_vue2.reactive)([]);
const tapTimer = (0, import_vue2.ref)(null);
const isTap = (0, import_vue2.ref)(false);
const isLong = (0, import_vue2.ref)(false);
const collectBtnActive = (0, import_vue2.ref)(false);
const alarmTime = (0, import_vue2.computed)(() => {
let result = uni.$store.state.alarmTime;
return result;
});
const fit = (0, import_vue2.computed)(() => {
const ratio1 = parseInt(props.width) / parseInt(props.height);
const ratio2 = props.item.breadth / props.item.height;
let result = "contain";
if (Math.abs(formatNumber(ratio2) - formatNumber(ratio1)) < 1)
result = "cover";
return result;
});
(0, import_vue2.watch)(() => props.current, (nV) => {
if (nV == props.index)
play();
else
pause();
});
(0, import_vue2.onMounted)(() => {
videoCtx.value = uni.createVideoContext(`video${props.tabIndex}${props.index}`);
});
function formatNumber(result) {
result = parseFloat(result) * 10;
return result;
}
function onTouchStart() {
if (isTap.value) {
return;
} else {
isTap.value = true;
let time2 = (/* @__PURE__ */ new Date()).getTime();
tapList.push(time2);
}
clearTimeout(tapTimer.value);
}
function onTouchEnd() {
if (isTap.value) {
isTap.value = false;
let time2 = (/* @__PURE__ */ new Date()).getTime();
let diff = time2 - tapList[tapList.length - 1];
if (diff > 350) {
if (isLong.value) {
isLong.value = false;
videoCtx.value.playbackRate(1);
}
tapList.length = 0;
return;
}
tapTimer.value = setTimeout(() => {
props.item.isLike;
let a = tapList.length;
tapList.length = 0;
switch (a) {
case 1:
changeVideoPlay();
break;
case 2:
formatAppLog("log", "at components/index/indexVideo.vue:176", "\u516C\u5F00\u8D5E");
return;
case 3:
formatAppLog("log", "at components/index/indexVideo.vue:184", "\u9690\u79C1\u8D5E");
return;
}
}, 200);
}
}
function onTouchCancel() {
isTap.value = false;
tapList.length = 0;
clearTimeout(tapTimer.value);
}
function changeVideoPlay() {
if (playState.value)
pause();
else
play();
}
function play() {
let pages = getCurrentPages();
let page = pages[pages.length - 1];
if (props.index != props.current || !["pages/index/index", "pages/index/videoDetail"].includes(page.route))
return;
videoCtx.value.play();
}
function pause() {
videoCtx.value.pause();
}
function onVideoPlay() {
playState.value = true;
emit("onPlay");
}
function onVideoPause() {
playState.value = false;
emit("onPause");
}
function handleComment() {
emit("showComment", props.item);
}
function handleTime() {
emit("showTime");
}
function showCollect() {
util$1.isLogin().then((rs) => {
emit("showCollect", props.item);
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handleCollectFirst(ev) {
const changedTouches = ev.changedTouches[0];
let x = getNumber(props.width) - getNumber(changedTouches.screenX) + getNumber(changedTouches.pageX);
let y = getNumber(changedTouches.screenY) - getNumber(changedTouches.pageY);
emit("showFastCollect", {
item: props.item,
position: {
x,
y
}
});
return;
}
function handleCollectStar(ev) {
collectBtnActive.value = true;
util$1.isLogin().then((rs) => {
setTimeout(() => {
if (!collectBtnActive.value) {
if (!props.item.isCollect) {
handleCollectFirst(ev);
return;
} else
cancelCollect();
} else {
setTimeout(() => {
showCollect();
}, 350);
}
}, 350);
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handleCollectEnd() {
collectBtnActive.value = false;
}
function getNumber(str) {
let result = Math.floor(Number(str));
return result;
}
function cancelCollect() {
const detail = __spreadValues({}, props.item);
api.video.cancelCollect({
query: {
// 视频id
videoId: detail.videoId
}
}).then((rs) => {
if (rs.code == 200) {
detail.isCollect = false;
detail.collect--;
uni.$emit("updateVideo", detail);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function handleShareFirend() {
util$1.isLogin().then((rs) => {
emit("showShareFirend", props.item);
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handleLike(index, isLike) {
util$1.isLogin().then((rs) => {
emit("like", {
index,
isLike
});
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handlePrivateLike(index) {
util$1.isLogin().then((rs) => {
util$1.alert({
title: "\u63D0\u793A",
content: "\u8BF7\u786E\u8BA4\uFF0C\u662F\u5426\u4E3A\u9690\u79C1\u8D5E(\u9690\u79C1\u8D5E\u4EC5\u81EA\u5DF1\u548C\u4F5C\u8005\u53EF\u89C1)?",
confirmText: "\u9690\u79C1\u8D5E",
cancelText: "\u516C\u5F00\u8D5E"
}).then((rs2) => {
if (rs2.confirm)
emit("like", {
index,
isLike: 3
});
else
emit("like", {
index,
isLike: 0
});
});
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handleDetailMenu(item) {
emit("detailMenu");
}
function handleTimeupdate(ev) {
videoTime.value = ev.detail;
}
function onProgressEnd(ev) {
videoCtx.value.seek(parseInt(ev.time));
}
function handleUser(item) {
uni.navigateTo({
url: util$1.setUrl("/pages/index/videoHome", {
userId: item.userId
})
});
}
function handleWaiting(ev) {
if (props.index == props.current)
play();
else
pause();
}
function longtap(ev) {
if (isLong.value)
return;
play();
isLong.value = true;
videoCtx.value.playbackRate(2);
}
__expose({
play,
pause,
videoTime,
item: props.item,
playState,
videoCtx: () => videoCtx.value
});
const __returned__ = { proxy, props, emit, videoCtx, playState, collectFirst, videoTime, tapList, tapTimer, isTap, isLong, collectBtnActive, alarmTime, fit, formatNumber, onTouchStart, onTouchEnd, onTouchCancel, changeVideoPlay, play, pause, onVideoPlay, onVideoPause, handleComment, handleTime, showCollect, handleCollectFirst, handleCollectStar, handleCollectEnd, getNumber, cancelCollect, handleShareFirend, handleLike, handlePrivateLike, handleDetailMenu, handleTimeupdate, onProgressEnd, handleUser, handleWaiting, longtap, onMounted: import_vue2.onMounted, ref: import_vue2.ref, reactive: import_vue2.reactive, getCurrentInstance: import_vue2.getCurrentInstance, watch: import_vue2.watch, computed: import_vue2.computed, nextTick: import_vue2.nextTick, statusBar, get util() {
return util$1;
}, get api() {
return api;
}, get videoProgress() {
return videoProgress;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
const _component_navigator = (0, import_vue2.resolveComponent)("navigator");
const _component_uni_icons = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-icons"), __easycom_0);
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
"view",
{
class: "container f1 pr",
ref: "videoBoxRef",
renderWhole: true
},
[
(0, import_vue2.createCommentVNode)(" \u89C6\u9891\u5C42 "),
(0, import_vue2.createElementVNode)("view", { class: "main f1" }, [
(0, import_vue2.createElementVNode)(
"view",
{
class: "videoBox f1",
onTouchmove: _cache[0] || (_cache[0] = (0, import_vue2.withModifiers)(() => {
}, ["stop"])),
onTouchstart: $setup.onTouchStart,
onTouchend: $setup.onTouchEnd,
onTouchcancel: $setup.onTouchCancel,
onLongpress: $setup.longtap
},
[
(0, import_vue2.createVNode)($setup["statusBar"]),
(0, import_vue2.createCommentVNode)(" \u89C6\u9891 \u589E\u52A0\u5224\u65AD\u9632\u6B62\u91CD\u590D\u52A0\u8F7D "),
$props.item.videoUrl ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-video", {
key: 0,
class: "video f1",
id: "video" + $props.tabIndex + $props.index,
src: $props.item.videoUrl,
poster: $props.item.coverUrl,
httpCache: true,
showFullscreenBtn: false,
enableProgressGesture: false,
controls: false,
onPlay: $setup.onVideoPlay,
onPause: $setup.onVideoPause,
showCenterPlayBtn: false,
onTimeupdate: $setup.handleTimeupdate,
onWaiting: $setup.handleWaiting,
playStrategy: 2,
loop: true,
objectFit: $setup.fit
}, null, 40, ["id", "src", "poster", "objectFit"])) : (0, import_vue2.createCommentVNode)("v-if", true)
],
32
/* NEED_HYDRATION */
),
(0, import_vue2.createCommentVNode)(" \u89C6\u9891\u8FDB\u5EA6\u6761 "),
(0, import_vue2.createElementVNode)(
"view",
{
class: "videoProgress",
onTouchmove: _cache[1] || (_cache[1] = (0, import_vue2.withModifiers)(() => {
}, ["stop"])),
onTouchstart: _cache[2] || (_cache[2] = (0, import_vue2.withModifiers)(() => {
}, ["stop"])),
onTouchend: _cache[3] || (_cache[3] = (0, import_vue2.withModifiers)(() => {
}, ["stop"]))
},
[
(0, import_vue2.createVNode)($setup["videoProgress"], {
time: $setup.videoTime,
onChange: $setup.onProgressEnd,
viewWidth: $props.width
}, null, 8, ["time", "viewWidth"])
],
32
/* NEED_HYDRATION */
)
]),
(0, import_vue2.createCommentVNode)(" \u500D\u901F\u64AD\u653E\u63D0\u793A "),
$setup.isLong ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "speedBox"
}, [
(0, import_vue2.createElementVNode)("view", { class: "speed ptb5 plr10" }, [
(0, import_vue2.createElementVNode)("u-text", { class: "f22 cfff" }, "2\u500D\u901F\u64AD\u653E\u4E2D...")
])
])) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createCommentVNode)(" \u6682\u505C\u8499\u7248 "),
!$setup.playState ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 1,
class: "pausePanel pfull fmid"
}, [
(0, import_vue2.createCommentVNode)(" \u6682\u505C\u6309\u94AE "),
(0, import_vue2.createElementVNode)("u-image", {
class: "pauseImg",
src: _imports_0$2,
mode: "aspectFit"
})
])) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createCommentVNode)(" \u53F3\u4FA7\u64CD\u4F5C\u533A "),
(0, import_vue2.createElementVNode)("view", { class: "panelRight pa t0 b0 r0" }, [
(0, import_vue2.createVNode)($setup["statusBar"]),
(0, import_vue2.createElementVNode)("view", { class: "head" }),
(0, import_vue2.createElementVNode)("view", { class: "f1 jcr pl5 pt40 pr20" }, [
(0, import_vue2.createCommentVNode)(" \u64CD\u4F5C\u53F0 "),
(0, import_vue2.createElementVNode)("view", { class: "operate f1" }, [
(0, import_vue2.createCommentVNode)(" \u7528\u6237\u5934\u50CF "),
(0, import_vue2.createVNode)(_component_navigator, {
url: $setup.util.setUrl("/pages/index/videoHome", { userId: $props.item.userId }),
class: "item pr mb10"
}, {
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "col" }, [
(0, import_vue2.createElementVNode)("u-image", {
class: "wh80 cir",
src: $props.item.avatar,
mode: "aspectFill"
}, null, 8, ["src"]),
!$props.item.isAttention ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "focus pa"
}, [
(0, import_vue2.createElementVNode)("u-image", {
class: "wh40",
src: _imports_1,
mode: "aspectFit"
})
])) : (0, import_vue2.createCommentVNode)("v-if", true)
])
]),
_: 1
/* STABLE */
}, 8, ["url"]),
(0, import_vue2.createCommentVNode)(" \u70B9\u8D5E "),
(0, import_vue2.createElementVNode)("view", { class: "item" }, [
(0, import_vue2.createElementVNode)("view", { class: "col" }, [
(0, import_vue2.createElementVNode)("view", { class: "pr" }, [
$props.item.isLike == 0 ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
"u-image",
{
key: 0,
class: "wh50",
src: _imports_2,
mode: "aspectFit",
onClick: _cache[4] || (_cache[4] = ($event) => $setup.handleLike($props.index, 0)),
onLongpress: _cache[5] || (_cache[5] = ($event) => $setup.handlePrivateLike($props.index))
},
null,
32
/* NEED_HYDRATION */
)) : $props.item.isLike == 1 ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-image", {
key: 1,
class: "wh50",
src: _imports_3,
mode: "aspectFit",
onClick: _cache[6] || (_cache[6] = ($event) => $setup.handleLike($props.index, 1))
})) : $props.item.isLike == 3 ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
{ key: 2 },
[
(0, import_vue2.createCommentVNode)(" \u79C1\u5BC6\u8D5E\u7684\u56FE\u6807 "),
(0, import_vue2.createElementVNode)("u-image", {
class: "wh50",
src: _imports_4,
mode: "aspectFit",
onClick: _cache[7] || (_cache[7] = ($event) => $setup.handleLike($props.index, 1))
})
],
2112
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
)) : (0, import_vue2.createCommentVNode)("v-if", true)
]),
(0, import_vue2.createElementVNode)("view", { class: "txt mt10" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "text" },
(0, import_vue2.toDisplayString)($props.item.likes),
1
/* TEXT */
)
])
])
]),
(0, import_vue2.createCommentVNode)(" \u7559\u8A00 "),
(0, import_vue2.createElementVNode)("view", {
class: "item",
onClick: $setup.handleComment
}, [
(0, import_vue2.createElementVNode)("view", { class: "col" }, [
(0, import_vue2.createElementVNode)("u-image", {
class: "wh50",
src: _imports_5,
mode: "aspectFit"
}),
(0, import_vue2.createElementVNode)("view", { class: "txt mt10" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "text" },
(0, import_vue2.toDisplayString)($props.item.comment),
1
/* TEXT */
)
])
])
]),
(0, import_vue2.createCommentVNode)(" \u6536\u85CF "),
(0, import_vue2.createElementVNode)("view", { class: "item df fdr" }, [
(0, import_vue2.createElementVNode)(
"view",
{
class: "col",
onTouchstart: $setup.handleCollectStar,
onTouchend: $setup.handleCollectEnd,
ref: "collectBtn"
},
[
$props.item.isCollect ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-image", {
key: 0,
class: "wh50",
src: _imports_6,
mode: "aspectFit"
})) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-image", {
key: 1,
class: "wh50",
src: _imports_7,
mode: "aspectFit"
})),
(0, import_vue2.createElementVNode)("view", { class: "txt mt10" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "text" },
(0, import_vue2.toDisplayString)($props.item.collect),
1
/* TEXT */
)
])
],
544
/* NEED_HYDRATION, NEED_PATCH */
)
]),
(0, import_vue2.createCommentVNode)(" \u5206\u4EAB "),
(0, import_vue2.createElementVNode)("view", {
class: "item",
onClick: $setup.handleShareFirend
}, [
(0, import_vue2.createElementVNode)("view", { class: "col" }, [
(0, import_vue2.createElementVNode)("u-image", {
class: "wh50",
src: _imports_8,
mode: "aspectFit"
}),
(0, import_vue2.createElementVNode)("view", { class: "txt mt10" }, [
(0, import_vue2.createElementVNode)("u-text", { class: "text" }, "\u5206\u4EAB")
])
])
]),
(0, import_vue2.createCommentVNode)(" \u95F9\u949F "),
$props.mode == "list" ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "item money",
onClick: $setup.handleTime
}, [
(0, import_vue2.createElementVNode)("view", { class: "col" }, [
$setup.alarmTime ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-image", {
key: 0,
class: "wh80",
src: _imports_9,
mode: "aspectFit"
})) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-image", {
key: 1,
class: "wh80",
src: _imports_10,
mode: "aspectFit"
}))
])
])) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createCommentVNode)(" \u8BE6\u60C5\u83DC\u5355 "),
$props.mode == "detail" && $props.isMine == 1 ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 1,
class: "item money",
onClick: $setup.handleTime
}, [
(0, import_vue2.createElementVNode)("view", {
class: "col wh90 fmid tac",
onClick: $setup.handleDetailMenu
}, [
(0, import_vue2.createVNode)(_component_uni_icons, {
type: "more-filled",
color: "#d8d8d8",
size: "70rpx"
})
])
])) : (0, import_vue2.createCommentVNode)("v-if", true)
])
])
]),
(0, import_vue2.createCommentVNode)(" \u5E95\u90E8\u7528\u6237\u4FE1\u606F "),
(0, import_vue2.createElementVNode)("view", { class: "panelBottom pa l0 r0 b0 pl40 pb30" }, [
(0, import_vue2.createCommentVNode)(" \u5546\u54C1\u4FE1\u606F "),
(0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createCommentVNode)(" \u7528\u6237 "),
(0, import_vue2.createElementVNode)("view", {
class: "user",
onClick: _cache[8] || (_cache[8] = ($event) => $setup.handleUser($props.item))
}, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "cfff f36" },
"@" + (0, import_vue2.toDisplayString)($props.item.userNickname),
1
/* TEXT */
)
]),
(0, import_vue2.createCommentVNode)(" \u7B80\u4ECB "),
(0, import_vue2.createElementVNode)("view", { class: "desc mt5" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "t2hd cfff f28" },
(0, import_vue2.toDisplayString)($props.item.title),
1
/* TEXT */
)
])
])
],
512
/* NEED_PATCH */
);
}
var indexVideo = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["styles", [_style_0$6]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/index/indexVideo.vue"]]);
var _style_0$5 = { "scroll": { ".commentAreaAlt .listBox ": { "height": "1000rpx" } }, "line": { ".commentAreaAlt ": { "width": 40, "borderBottomWidth": "2rpx", "borderBottomStyle": "solid", "borderBottomColor": "#D8D8D8" } }, "inputArea": { ".commentAreaAlt ": { "boxShadow": "0px 8px 20px 0px rgba(0, 0, 0, 0.3)" } } };
var _sfc_main$6 = {
__name: "commentArea",
setup(__props, { expose: __expose }) {
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
let detail = (0, import_vue2.reactive)({});
let content = (0, import_vue2.ref)("");
const showLoad = (0, import_vue2.ref)(true);
let listProperty = (0, import_vue2.reactive)({
data: [],
pageSize: 10,
pageNum: 1,
total: 0
});
const reply = (0, import_vue2.reactive)({});
const placeholder = (0, import_vue2.computed)(() => {
let result = "\u8BC4\u8BBA\u4E00\u4E0B\u5427~";
if (reply.id)
result = `\u56DE\u590D @${reply.userNickname}`;
return result;
});
const paddingHeight = (0, import_vue2.ref)(0);
(0, import_vue2.onMounted)(() => {
uni.onKeyboardHeightChange((rs) => {
paddingHeight.value = rs.height;
});
});
(0, import_vue2.onBeforeUnmount)(() => {
uni.offKeyboardHeightChange((rs) => {
formatAppLog("log", "at components/index/commentArea.vue:56", "rs", rs);
});
});
function refreshList() {
listProperty.total = 0;
listProperty.pageNum = 1;
getList();
}
function getList() {
api.video.commentList({
query: {
videoId: detail.videoId,
pageSize: listProperty.pageSize,
pageNume: listProperty.pageNum
}
}).then((rs) => {
formatAppLog("log", "at components/index/commentArea.vue:77", "commentList", rs);
if (rs.code == 200) {
if (listProperty.pageNum == 1)
listProperty.data.length = 0;
listProperty.data.push(...rs.rows.map((item) => {
item.pageSize = 10;
item.pageNum = 0;
item.child = [];
item.formatUserPortrait = util$1.format_url(item.userPortrait, "img");
item.childShow = true;
return item;
}));
listProperty.total = rs.total;
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
}).finally(() => {
showLoad.value = false;
});
}
function handleSubmit() {
if (!content.value) {
util$1.alert("\u8BF7\u8F93\u5165\u8BC4\u8BBA\u7684\u5185\u5BB9");
return;
}
api.video.comment({
query: {
partentId: reply.id ? reply.id : 0,
videoId: detail.videoId,
context: content.value
}
}).then((rs) => {
if (rs.code == 200) {
proxy.$refs.comment.close();
detail.comment++;
refreshList();
setTimeout(() => {
content.value = "";
}, 500);
uni.$emit("updateVideo", detail);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function open(item) {
if (detail.videoId != item.videoId) {
Object.assign(detail, {}, item);
refreshList();
}
proxy.$refs.commentArea.open();
}
function close() {
proxy.$refs.commentArea.close();
}
function handleReply(item) {
Object.assign(reply, item);
proxy.$refs.comment.open();
}
function showComment() {
reply.id = "";
proxy.$refs.comment.open();
}
function handleExpansion(item, index) {
if (item.childShow == false) {
item.childShow = true;
return;
}
if (item.child.length >= item.num && item.childShow) {
item.childShow = false;
return;
}
item.pageNum++;
getLevelCommentList(item, index);
}
function getLevelCommentList(item, index) {
api.video.levelCommentList({
query: {
commentId: item.id,
pageSize: item.pageSize,
pageNum: item.pageNum
}
}).then((rs) => {
if (rs.code == 200) {
listProperty.data[index].child.push(...rs.rows.map((node) => {
node.formatUserPortrait = util$1.format_url(node.userPortrait, "img");
return node;
}));
item.childShow = true;
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function handleLike(item) {
util$1.isLogin().then((rs) => {
api.video.thumbsUp({
query: {
// 0取消 1点赞
type: item.isLike ? 0 : 1,
// 评论id
commentId: item.id
}
}).then((rs2) => {
if (rs2.code == 200) {
if (item.isLike)
item.likes--;
else
item.likes++;
item.isLike = !item.isLike;
listProperty.data = JSON.parse(JSON.stringify(listProperty.data));
return;
}
util$1.alert({
content: rs2.msg,
showCancel: false
});
});
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function toUser(user) {
uni.navigateTo({
url: util$1.setUrl("/pages/index/videoHome", {
userId: user.userId
})
});
}
__expose({
open,
close
});
const __returned__ = { proxy, get detail() {
return detail;
}, set detail(v) {
detail = v;
}, get content() {
return content;
}, set content(v) {
content = v;
}, showLoad, get listProperty() {
return listProperty;
}, set listProperty(v) {
listProperty = v;
}, reply, placeholder, paddingHeight, refreshList, getList, handleSubmit, open, close, handleReply, showComment, handleExpansion, getLevelCommentList, handleLike, toUser, onMounted: import_vue2.onMounted, ref: import_vue2.ref, reactive: import_vue2.reactive, getCurrentInstance: import_vue2.getCurrentInstance, watch: import_vue2.watch, computed: import_vue2.computed, onBeforeUnmount: import_vue2.onBeforeUnmount, get util() {
return util$1;
}, get api() {
return api;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_rich_text = (0, import_vue2.resolveComponent)("rich-text");
const _component_uni_popup = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
[
(0, import_vue2.createCommentVNode)(" \u8BC4\u8BBA\u533A "),
(0, import_vue2.createVNode)(
_component_uni_popup,
{
ref: "commentArea",
type: "bottom"
},
{
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "commentAreaAlt popBot bfff" }, [
$setup.showLoad ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "showLoad fmid ptb30"
}, [
(0, import_vue2.createVNode)(_component_uni_icons, { type: "spinner-cycle" }),
(0, import_vue2.createElementVNode)("u-text", { class: "c666 f28" }, "\u52A0\u8F7D\u4E2D...")
])) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 1,
class: "listBox"
}, [
(0, import_vue2.createElementVNode)("scroll-view", {
scrollY: "",
class: "scroll plr20",
showScrollbar: false
}, [
(0, import_vue2.createElementVNode)("view", { class: "list ptb40" }, [
((0, import_vue2.openBlock)(true), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
(0, import_vue2.renderList)($setup.listProperty.data, (item, index) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
class: "item mtb20",
key: index
}, [
(0, import_vue2.createElementVNode)("view", { class: "df fdr" }, [
(0, import_vue2.createCommentVNode)(" \u5934\u50CF "),
(0, import_vue2.createElementVNode)("u-image", {
class: "wh70 cir",
src: item.formatUserPortrait,
mode: "aspectFill",
onClick: ($event) => $setup.toUser(item)
}, null, 8, ["src", "onClick"]),
(0, import_vue2.createElementVNode)("view", { class: "col ml20 f1" }, [
(0, import_vue2.createCommentVNode)(" \u7528\u6237\u4FE1\u606F\u548C\u70B9\u8D5E "),
(0, import_vue2.createElementVNode)("view", { class: "df fdr" }, [
(0, import_vue2.createElementVNode)("view", { class: "f1" }, [
(0, import_vue2.createElementVNode)("u-text", {
class: "c666 f24",
onClick: ($event) => $setup.toUser(item)
}, (0, import_vue2.toDisplayString)(item.userNickname), 9, ["onClick"]),
(0, import_vue2.createVNode)(_component_rich_text, {
class: "mt5 c333 f28",
nodes: item.context
}, null, 8, ["nodes"])
]),
(0, import_vue2.createElementVNode)("view", {
class: "like oh aic pl20",
onClick: ($event) => $setup.handleLike(item)
}, [
(0, import_vue2.createVNode)(_component_uni_icons, {
type: "heart-filled",
color: item.isLike ? "#F84259" : "#b3b3b3",
size: "32rpx"
}, null, 8, ["color"]),
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c333 f24" },
(0, import_vue2.toDisplayString)(item.likes),
1
/* TEXT */
)
], 8, ["onClick"])
]),
(0, import_vue2.createCommentVNode)(" \u53D1\u5E03\u65F6\u95F4\u548C\u56DE\u590D "),
(0, import_vue2.createElementVNode)("view", { class: "df fdr mt10" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c999 f24" },
(0, import_vue2.toDisplayString)(item.createTime),
1
/* TEXT */
),
(0, import_vue2.createElementVNode)("view", {
class: "ml100",
onClick: ($event) => $setup.handleReply(item)
}, [
(0, import_vue2.createElementVNode)("u-text", { class: "c666 f24" }, "\u56DE\u590D")
], 8, ["onClick"])
]),
item.num != 0 ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
{ key: 0 },
[
(0, import_vue2.createCommentVNode)(" \u5B50\u8BC4\u8BBA "),
item.childShow ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "child"
}, [
((0, import_vue2.openBlock)(true), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
(0, import_vue2.renderList)(item.child, (secItem, secIndex) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
class: "df fdr mt15",
key: secItem.id
}, [
(0, import_vue2.createCommentVNode)(" \u5934\u50CF "),
(0, import_vue2.createElementVNode)("u-image", {
class: "wh40 cir",
src: secItem.formatUserPortrait,
mode: "aspectFill",
onClick: ($event) => $setup.toUser(secItem)
}, null, 8, ["src", "onClick"]),
(0, import_vue2.createElementVNode)("view", { class: "col pl20 f1" }, [
(0, import_vue2.createCommentVNode)(" \u7528\u6237\u4FE1\u606F\u548C\u70B9\u8D5E "),
(0, import_vue2.createElementVNode)("view", { class: "df fdr" }, [
(0, import_vue2.createElementVNode)("view", { class: "f1" }, [
(0, import_vue2.createElementVNode)("u-text", {
class: "c333 f24",
onClick: ($event) => $setup.toUser(secItem)
}, (0, import_vue2.toDisplayString)(secItem.userNickname), 9, ["onClick"]),
(0, import_vue2.createVNode)(_component_rich_text, {
class: "mt5 c333 f28",
nodes: secItem.context
}, null, 8, ["nodes"])
]),
(0, import_vue2.createElementVNode)("view", {
class: "like oh aic pl20",
onClick: ($event) => $setup.handleLike(secItem)
}, [
(0, import_vue2.createVNode)(_component_uni_icons, {
type: "heart-filled",
color: secItem.isLike ? "#F84259" : "#b3b3b3",
size: "32rpx"
}, null, 8, ["color"]),
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c333 f24" },
(0, import_vue2.toDisplayString)(secItem.likes),
1
/* TEXT */
)
], 8, ["onClick"])
]),
(0, import_vue2.createCommentVNode)(" \u53D1\u5E03\u65F6\u95F4\u548C\u56DE\u590D "),
(0, import_vue2.createElementVNode)("view", { class: "df fdr mt10" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c999 f24" },
(0, import_vue2.toDisplayString)(secItem.createTime),
1
/* TEXT */
),
(0, import_vue2.createCommentVNode)("v-if", true)
])
])
]);
}),
128
/* KEYED_FRAGMENT */
))
])) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createElementVNode)("view", {
class: "df fdr aic mt20",
onClick: ($event) => $setup.handleExpansion(item, index)
}, [
(0, import_vue2.createElementVNode)("view", { class: "line mr10" }),
item.childShow ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
{ key: 0 },
[
item.num == item.child.length ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
{ key: 0 },
[
(0, import_vue2.createElementVNode)("u-text", { class: "c666 f24" }, "\u6536\u8D77"),
(0, import_vue2.createVNode)(_component_uni_icons, { type: "top" })
],
64
/* STABLE_FRAGMENT */
)) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
{ key: 1 },
[
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c666 f24" },
"\u5C55\u5F00" + (0, import_vue2.toDisplayString)(item.num - item.child.length) + "\u6761\u56DE\u590D",
1
/* TEXT */
),
(0, import_vue2.createVNode)(_component_uni_icons, { type: "bottom" })
],
64
/* STABLE_FRAGMENT */
))
],
64
/* STABLE_FRAGMENT */
)) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
{ key: 1 },
[
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c666 f24" },
"\u5C55\u5F00" + (0, import_vue2.toDisplayString)(item.num) + "\u6761\u56DE\u590D",
1
/* TEXT */
),
(0, import_vue2.createVNode)(_component_uni_icons, { type: "bottom" })
],
64
/* STABLE_FRAGMENT */
))
], 8, ["onClick"])
],
64
/* STABLE_FRAGMENT */
)) : (0, import_vue2.createCommentVNode)("v-if", true)
])
])
]);
}),
128
/* KEYED_FRAGMENT */
))
]),
!$setup.listProperty.data[0] ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "fmid fdr"
}, [
(0, import_vue2.createElementVNode)("u-text", { class: "nomore f32" }, "\u6682\u65E0\u8BC4\u8BBA\uFF0C\u5FEB\u6765\u62A2\u6C99\u53D1\u5427~")
])) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 1,
class: "fmid fdr"
}, [
(0, import_vue2.createElementVNode)("u-text", { class: "nomore" }, "\u6682\u65E0\u66F4\u591A")
]))
])
])),
(0, import_vue2.createElementVNode)("view", {
class: "inputArea ptb20 plr20",
onClick: $setup.showComment
}, [
(0, import_vue2.createElementVNode)("view", { class: "inputBox ptb10 plr10" }, [
(0, import_vue2.createElementVNode)("u-text", { class: "placeholderStyle f28" }, "\u8BC4\u8BBA\u4E00\u4E0B\u5427~")
])
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
),
(0, import_vue2.createCommentVNode)(" \u56DE\u590D\u5F39\u7A97 "),
(0, import_vue2.createVNode)(
_component_uni_popup,
{
ref: "comment",
type: "bottom"
},
{
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "popBot ptb30 plr30 bfff" }, [
(0, import_vue2.createElementVNode)("u-textarea", {
modelValue: $setup.content,
onInput: _cache[0] || (_cache[0] = ($event) => $setup.content = $event.detail.value),
adjustPosition: false,
class: "textarea",
placeholder: $setup.placeholder
}, null, 40, ["modelValue", "placeholder"]),
(0, import_vue2.createElementVNode)("view", { class: "df fdr jcr" }, [
(0, import_vue2.createElementVNode)("view", {
class: "btn sm black plr20",
onClick: $setup.handleSubmit
}, [
(0, import_vue2.createElementVNode)("u-text", { class: "cfff f28" }, "\u53D1\u9001")
])
]),
(0, import_vue2.createElementVNode)(
"view",
{
style: (0, import_vue2.normalizeStyle)({ height: $setup.paddingHeight + "px" })
},
null,
4
/* STYLE */
)
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
],
64
/* STABLE_FRAGMENT */
);
}
var commentAlt = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["styles", [_style_0$5]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/index/commentArea.vue"]]);
var mpMixins = {};
var bindIngXMixins = {};
var BindingX = requireNativePlugin("bindingx");
var dom = requireNativePlugin("dom");
var animation = requireNativePlugin("animation");
bindIngXMixins = {
data() {
return {};
},
watch: {
show(newVal) {
if (this.autoClose)
return;
if (this.stop)
return;
this.stop = true;
if (newVal) {
this.open(newVal);
} else {
this.close();
}
},
leftOptions() {
this.getSelectorQuery();
this.init();
},
rightOptions(newVal) {
this.init();
}
},
created() {
this.swipeaction = this.getSwipeAction();
if (this.swipeaction && Array.isArray(this.swipeaction.children)) {
this.swipeaction.children.push(this);
}
},
mounted() {
this.box = this.getEl(this.$refs["selector-box--hock"]);
this.selector = this.getEl(this.$refs["selector-content--hock"]);
this.leftButton = this.getEl(this.$refs["selector-left-button--hock"]);
this.rightButton = this.getEl(this.$refs["selector-right-button--hock"]);
this.init();
},
// beforeDestroy() {
// this.swipeaction.children.forEach((item, index) => {
// if (item === this) {
// this.swipeaction.children.splice(index, 1)
// }
// })
// },
methods: {
init() {
this.$nextTick(() => {
this.x = 0;
this.button = {
show: false
};
setTimeout(() => {
this.getSelectorQuery();
}, 200);
});
},
onClick(index, item, position) {
this.$emit("click", {
content: item,
index,
position
});
},
touchstart(e) {
if (this.disabled)
return;
if (this.stop)
return;
this.stop = true;
if (this.autoClose && this.swipeaction) {
this.swipeaction.closeOther(this);
}
const leftWidth = this.button.left.width;
const rightWidth = this.button.right.width;
let expression = this.range(this.x, -rightWidth, leftWidth);
let leftExpression = this.range(this.x - leftWidth, -leftWidth, 0);
let rightExpression = this.range(this.x + rightWidth, 0, rightWidth);
this.eventpan = BindingX.bind({
anchor: this.box,
eventType: "pan",
props: [{
element: this.selector,
property: "transform.translateX",
expression
}, {
element: this.leftButton,
property: "transform.translateX",
expression: leftExpression
}, {
element: this.rightButton,
property: "transform.translateX",
expression: rightExpression
}]
}, (e2) => {
if (e2.state === "end") {
this.x = e2.deltaX + this.x;
this.isclick = true;
this.bindTiming(e2.deltaX);
}
});
},
touchend(e) {
if (this.isopen !== "none" && !this.isclick) {
this.open("none");
}
},
bindTiming(x) {
const left = this.x;
const leftWidth = this.button.left.width;
const rightWidth = this.button.right.width;
const threshold = this.threshold;
if (!this.isopen || this.isopen === "none") {
if (left > threshold) {
this.open("left");
} else if (left < -threshold) {
this.open("right");
} else {
this.open("none");
}
} else {
if (x > -leftWidth && x < 0 || x > rightWidth) {
if (x > -threshold && x < 0 || x - rightWidth > threshold) {
this.open("left");
} else {
this.open("none");
}
} else {
if (x < threshold && x > 0 || x + leftWidth < -threshold) {
this.open("right");
} else {
this.open("none");
}
}
}
},
/**
* 移动范围
* @param {Object} num
* @param {Object} mix
* @param {Object} max
*/
range(num, mix, max) {
return `min(max(x+${num}, ${mix}), ${max})`;
},
/**
* 开启swipe
*/
open(type) {
this.animation(type);
},
/**
* 关闭swipe
*/
close() {
this.animation("none");
},
/**
* 开启关闭动画
* @param {Object} type
*/
animation(type) {
const leftWidth = this.button.left.width;
const rightWidth = this.button.right.width;
if (this.eventpan && this.eventpan.token) {
BindingX.unbind({
token: this.eventpan.token,
eventType: "pan"
});
}
switch (type) {
case "left":
Promise.all([
this.move(this.selector, leftWidth),
this.move(this.leftButton, 0),
this.move(this.rightButton, rightWidth * 2)
]).then(() => {
this.setEmit(leftWidth, type);
});
break;
case "right":
Promise.all([
this.move(this.selector, -rightWidth),
this.move(this.leftButton, -leftWidth * 2),
this.move(this.rightButton, 0)
]).then(() => {
this.setEmit(-rightWidth, type);
});
break;
default:
Promise.all([
this.move(this.selector, 0),
this.move(this.leftButton, -leftWidth),
this.move(this.rightButton, rightWidth)
]).then(() => {
this.setEmit(0, type);
});
}
},
setEmit(x, type) {
const leftWidth = this.button.left.width;
const rightWidth = this.button.right.width;
this.isopen = this.isopen || "none";
this.stop = false;
this.isclick = false;
if (this.isopen !== type && this.x !== x) {
if (type === "left" && leftWidth > 0) {
this.$emit("change", "left");
}
if (type === "right" && rightWidth > 0) {
this.$emit("change", "right");
}
if (type === "none") {
this.$emit("change", "none");
}
}
this.x = x;
this.isopen = type;
},
move(ref22, value) {
return new Promise((resolve, reject) => {
animation.transition(ref22, {
styles: {
transform: `translateX(${value})`
},
duration: 150,
//ms
timingFunction: "linear",
needLayout: false,
delay: 0
//ms
}, function(res) {
resolve(res);
});
});
},
/**
* 获取ref
* @param {Object} el
*/
getEl(el) {
return el.ref;
},
/**
* 获取节点信息
*/
getSelectorQuery() {
Promise.all([
this.getDom("left"),
this.getDom("right")
]).then((data) => {
let show = "none";
if (this.autoClose) {
show = "none";
} else {
show = this.show;
}
if (show === "none")
;
else {
this.open(show);
}
});
},
getDom(str) {
return new Promise((resolve, reject) => {
dom.getComponentRect(this.$refs[`selector-${str}-button--hock`], (data) => {
if (data) {
this.button[str] = data.size;
resolve(data);
} else {
reject();
}
});
});
}
}
};
var bindingx = bindIngXMixins;
var otherMixins = {};
var _style_0$4 = { "uni-swipe": { "": { "position": "relative" } }, "uni-swipe_box": { "": { "position": "relative" } }, "uni-swipe_text--center": { "": { "width": 100 } }, "uni-swipe_button-group": { "": { "flexDirection": "row", "position": "absolute", "top": 0, "bottom": 0 } }, "button-group--left": { "": { "left": 0, "transform": "translateX(-100%)" } }, "button-group--right": { "": { "right": 0, "transform": "translateX(100%)" } }, "uni-swipe_button": { "": { "flex": 1, "flexDirection": "row", "justifyContent": "center", "alignItems": "center", "paddingTop": 0, "paddingRight": 20, "paddingBottom": 0, "paddingLeft": 20 } }, "uni-swipe_button-text": { "": { "fontSize": 14 } }, "ani": { "": { "transitionProperty": "transform", "transitionDuration": 300, "transitionTimingFunction": "cubic-bezier(0.165,0.84,0.44,1)" } }, "@TRANSITION": { "ani": { "property": "transform", "duration": 300, "timingFunction": "cubic-bezier(0.165,0.84,0.44,1)" } } };
var block0 = {};
var block1 = {};
var _sfc_main$5 = {
mixins: [mpMixins, bindingx, otherMixins],
emits: ["click", "change"],
props: {
// 控制开关
show: {
type: String,
default: "none"
},
// 禁用
disabled: {
type: Boolean,
default: false
},
// 是否自动关闭
autoClose: {
type: Boolean,
default: true
},
// 滑动缺省距离
threshold: {
type: Number,
default: 20
},
// 左侧按钮内容
leftOptions: {
type: Array,
default() {
return [];
}
},
// 右侧按钮内容
rightOptions: {
type: Array,
default() {
return [];
}
}
},
// TODO vue3
unmounted() {
this.__isUnmounted = true;
this.uninstall();
},
methods: {
uninstall() {
if (this.swipeaction) {
this.swipeaction.children.forEach((item, index) => {
if (item === this) {
this.swipeaction.children.splice(index, 1);
}
});
}
},
/**
* 获取父元素实例
*/
getSwipeAction(name = "uniSwipeAction") {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent)
return false;
parentName = parent.$options.name;
}
return parent;
}
}
};
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
[
(0, import_vue2.createCommentVNode)(" \u5728\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F app vue\u7AEF h5 \u4F7F\u7528wxs \u5B9E\u73B0"),
(0, import_vue2.createCommentVNode)(" app nvue\u7AEF \u4F7F\u7528 bindingx "),
(0, import_vue2.createElementVNode)(
"view",
{
ref: "selector-box--hock",
class: "uni-swipe",
onHorizontalpan: _cache[0] || (_cache[0] = (...args) => _ctx.touchstart && _ctx.touchstart(...args)),
onTouchend: _cache[1] || (_cache[1] = (...args) => _ctx.touchend && _ctx.touchend(...args))
},
[
(0, import_vue2.createElementVNode)(
"view",
{
ref: "selector-left-button--hock",
class: "uni-swipe_button-group button-group--left"
},
[
(0, import_vue2.renderSlot)(_ctx.$slots, "left", {}, () => [
((0, import_vue2.openBlock)(true), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
(0, import_vue2.renderList)($props.leftOptions, (item, index) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: index,
style: (0, import_vue2.normalizeStyle)({
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD"
}),
class: "uni-swipe_button button-hock",
onClick: (0, import_vue2.withModifiers)(($event) => _ctx.onClick(index, item, "left"), ["stop"])
}, [
(0, import_vue2.createElementVNode)(
"u-text",
{
class: "uni-swipe_button-text",
style: (0, import_vue2.normalizeStyle)({ color: item.style && item.style.color ? item.style.color : "#FFFFFF", fontSize: item.style && item.style.fontSize ? item.style.fontSize : "16px" })
},
(0, import_vue2.toDisplayString)(item.text),
5
/* TEXT, STYLE */
)
], 12, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
])
],
512
/* NEED_PATCH */
),
(0, import_vue2.createElementVNode)(
"view",
{
ref: "selector-right-button--hock",
class: "uni-swipe_button-group button-group--right"
},
[
(0, import_vue2.renderSlot)(_ctx.$slots, "right", {}, () => [
((0, import_vue2.openBlock)(true), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
(0, import_vue2.renderList)($props.rightOptions, (item, index) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: index,
style: (0, import_vue2.normalizeStyle)({
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : "#C7C6CD"
}),
class: "uni-swipe_button button-hock",
onClick: (0, import_vue2.withModifiers)(($event) => _ctx.onClick(index, item, "right"), ["stop"])
}, [
(0, import_vue2.createElementVNode)(
"u-text",
{
class: "uni-swipe_button-text",
style: (0, import_vue2.normalizeStyle)({ color: item.style && item.style.color ? item.style.color : "#FFFFFF", fontSize: item.style && item.style.fontSize ? item.style.fontSize : "16px" })
},
(0, import_vue2.toDisplayString)(item.text),
5
/* TEXT, STYLE */
)
], 12, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
])
],
512
/* NEED_PATCH */
),
(0, import_vue2.createElementVNode)(
"view",
{
ref: "selector-content--hock",
class: "uni-swipe_box"
},
[
(0, import_vue2.renderSlot)(_ctx.$slots, "default")
],
512
/* NEED_PATCH */
)
],
544
/* NEED_HYDRATION, NEED_PATCH */
),
(0, import_vue2.createCommentVNode)(" \u5176\u4ED6\u5E73\u53F0\u4F7F\u7528 js \uFF0C\u957F\u5217\u8868\u6027\u80FD\u53EF\u80FD\u4F1A\u6709\u5F71\u54CD")
],
2112
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
);
}
if (typeof block0 === "function")
block0(_sfc_main$5);
if (typeof block1 === "function")
block1(_sfc_main$5);
var __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["styles", [_style_0$4]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.vue"]]);
var _sfc_main$4 = {
name: "uniSwipeAction",
data() {
return {};
},
created() {
this.children = [];
},
methods: {
// 公开给用户使用,重制组件样式
resize() {
this.children.forEach((vm) => {
vm.init();
});
},
// 公开给用户使用,关闭全部 已经打开的组件
closeAll() {
this.children.forEach((vm) => {
vm.close();
});
},
closeOther(vm) {
if (this.openItem && this.openItem !== vm) {
this.openItem.close();
}
this.openItem = vm;
}
}
};
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", { renderWhole: true }, [
(0, import_vue2.renderSlot)(_ctx.$slots, "default")
]);
}
var __easycom_2 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.vue"]]);
var _imports_0$1 = "/static/lock.png";
var _style_0$3 = { "switch": { "": { "transform": "scale(0.7)" } } };
var _sfc_main$3 = {
__name: "collectAdd",
setup(__props, { expose: __expose }) {
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
class Form {
constructor() {
__publicField(this, "collectName", "");
__publicField(this, "isPrivate", 0);
__publicField(this, "pic", "");
__publicField(this, "collectId", "");
}
}
const form = (0, import_vue2.reactive)(new Form());
const paddingHeight = (0, import_vue2.ref)(0);
(0, import_vue2.onMounted)(() => {
uni.onKeyboardHeightChange((rs) => {
paddingHeight.value = rs.height;
});
});
(0, import_vue2.onBeforeUnmount)(() => {
uni.offKeyboardHeightChange((rs) => {
formatAppLog("log", "at components/index/collectAdd.vue:46", "rs", rs);
});
});
function open(value) {
if (value) {
form.collectName = value.collectName;
form.isPrivate = value.isPrivate;
form.collectId = value.id;
form.pic = value.formatPic;
}
proxy.$refs.addCollectRef.open();
}
function close() {
proxy.$refs.addCollectRef.close();
}
function upImage() {
util$1.upload_image({
value: form.pic,
type: 1,
success: (rs) => {
form.pic = rs.value;
}
});
}
function handlePrivate() {
form.isPrivate = form.isPrivate == 0 ? 1 : 0;
}
function handleSubmit() {
const data = __spreadValues({}, form);
if (!form.collectName) {
util$1.alert("\u8BF7\u8F93\u5165\u6536\u85CF\u5939\u540D\u79F0");
return;
}
if (!form.pic) {
util$1.alert("\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE");
return;
}
data.pic = util$1.replace_url(data.pic);
let requestApi = "saveCollectList";
if (form.collectId)
requestApi = "updateCollectList";
api.video[requestApi]({
query: data
}).then((rs) => {
if (rs.code == 200) {
uni.$emit("collectsVideo");
close();
Object.assign(form, new Form());
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
__expose({
open,
close
});
const __returned__ = { proxy, Form, form, paddingHeight, open, close, upImage, handlePrivate, handleSubmit, ref: import_vue2.ref, getCurrentInstance: import_vue2.getCurrentInstance, reactive: import_vue2.reactive, onMounted: import_vue2.onMounted, onBeforeUnmount: import_vue2.onBeforeUnmount, get util() {
return util$1;
}, get api() {
return api;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_switch = (0, import_vue2.resolveComponent)("switch");
const _component_uni_popup = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue2.openBlock)(), (0, import_vue2.createBlock)(
_component_uni_popup,
{
ref: "addCollectRef",
type: "bottom"
},
{
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "addCollect popBot ptb20 plr20 bfff" }, [
(0, import_vue2.createElementVNode)("view", { class: "header fdr rows" }, [
(0, import_vue2.createElementVNode)("view", { class: "w120" }, [
(0, import_vue2.createVNode)(_component_uni_icons, {
type: "closeempty",
onClick: $setup.close
})
]),
(0, import_vue2.createElementVNode)("view", { class: "title" }, [
(0, import_vue2.createElementVNode)("u-text", { class: "c333 f28" }, "\u7F16\u8F91\u6536\u85CF\u5939")
]),
(0, import_vue2.createElementVNode)("view", { class: "w120 tar" }, [
(0, import_vue2.createElementVNode)("u-text", {
class: "cFF9B27 f24",
onClick: $setup.handleSubmit
}, "\u786E\u8BA4")
])
]),
(0, import_vue2.createCommentVNode)(" \u6536\u85CF\u5939\u4FE1\u606F "),
(0, import_vue2.createElementVNode)("view", { class: "rows fdr mtb30" }, [
(0, import_vue2.createElementVNode)("view", {
class: "pic fmid wh80 beee br10",
onClick: $setup.upImage
}, [
$setup.form.pic ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-image", {
key: 0,
class: "wh80 br10",
src: $setup.form.pic,
mode: "aspectFill"
}, null, 8, ["src"])) : ((0, import_vue2.openBlock)(), (0, import_vue2.createBlock)(_component_uni_icons, {
key: 1,
type: "plusempty",
size: "40rpx"
}))
]),
(0, import_vue2.createElementVNode)("view", { class: "edit f1 ml20" }, [
(0, import_vue2.createElementVNode)("u-input", {
type: "text",
adjustPosition: false,
modelValue: $setup.form.collectName,
onInput: _cache[0] || (_cache[0] = ($event) => $setup.form.collectName = $event.detail.value),
placeholder: "\u8F93\u5165\u6536\u85CF\u5939\u540D\u79F0"
}, null, 40, ["modelValue"])
])
]),
(0, import_vue2.createCommentVNode)(" \u516C\u5F00\u6536\u85CF\u5939 "),
(0, import_vue2.createElementVNode)("view", { class: "rows fdr mtb30" }, [
(0, import_vue2.createElementVNode)("view", { class: "df fdr aic" }, [
(0, import_vue2.createElementVNode)("u-text", null, "\u662F\u5426\u516C\u5F00\u6536\u85CF\u5939"),
(0, import_vue2.createElementVNode)("u-image", {
src: _imports_0$1,
mode: "aspectFit",
class: "wh24 ml10"
})
]),
(0, import_vue2.createVNode)(_component_switch, {
class: "switch",
checked: $setup.form.isPrivate == 0,
color: "#F85050",
onChange: $setup.handlePrivate
}, null, 8, ["checked"])
]),
(0, import_vue2.createElementVNode)(
"view",
{
style: (0, import_vue2.normalizeStyle)({ height: $setup.paddingHeight + "px" })
},
null,
4
/* STYLE */
)
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
);
}
var collectAdd = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["styles", [_style_0$3]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/index/collectAdd.vue"]]);
var _style_0$2 = { "item": { ".collect ": { "borderBottomWidth": "2rpx", "borderBottomStyle": "solid", "borderBottomColor": "#D8D8D8" } } };
var _sfc_main$2 = {
__name: "collectList",
emits: ["handleItem"],
setup(__props, { expose: __expose, emit: __emit }) {
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
const showLoad = (0, import_vue2.ref)(true);
const listProperty = (0, import_vue2.reactive)({
// 数据
data: [],
// 条数
pageSize: 10,
// 页码
pageNum: 1,
// 总数
total: 0
});
const options = [{
text: "\u5220\u9664",
style: {
backgroundColor: "#F85050"
}
}, {
text: "\u7F16\u8F91",
style: {
backgroundColor: "#00ADEE"
}
}];
const emit = __emit;
(0, import_vue2.onMounted)(() => {
addListener();
util$1.isLogin().then(() => {
setTimeout(() => {
getList();
}, 1e3);
});
});
function addListener() {
uni.$on("collectsVideo", () => {
refrshList();
});
uni.$on("login", () => {
refrshList();
});
}
function refrshList() {
listProperty.pageNum = 1;
getList();
}
function getMoreList() {
if (listProperty.total <= listProperty.data.length)
return;
listProperty.pageNum++;
getList();
}
function getList() {
api.video.getCollectList({
query: {
pageNum: listProperty.pageNum,
pageSize: listProperty.pageSize
}
}).then((rs) => {
if (rs.code === 200) {
const result = rs.rows;
if (listProperty.pageNum == 1)
listProperty.data.length = 0;
listProperty.data.push(...result.map((item) => {
item.formatPic = util$1.format_url(item.pic, "img");
return item;
}));
listProperty.total = rs.total;
return;
}
util$1.alert(rs.msg);
}).finally(() => {
showLoad.value = false;
});
}
function delectList(item, index) {
api.video.deleteCollect({
query: {
jyCollectId: item.id
}
}).then((rs) => {
if (rs.code === 200) {
listProperty.total--;
listProperty.data.splice(index, 1);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function handleActionItem(ev, target) {
const index = ev.index;
const item = listProperty.data[target];
switch (index) {
case 0:
util$1.alert({
content: "\u786E\u8BA4\u5220\u9664\u6536\u85CF\u5939\uFF1F"
}).then((rs) => {
if (rs.confirm)
delectList(item, target);
});
break;
case 1:
proxy.$refs.collectAddRef.open(item);
break;
}
proxy.$refs.swipeActionRef.closeAll();
}
function handleItem(item) {
emit("handleItem", item);
}
__expose({
getList,
getMoreList,
refrshList
});
const __returned__ = { proxy, showLoad, listProperty, options, emit, addListener, refrshList, getMoreList, getList, delectList, handleActionItem, handleItem, onMounted: import_vue2.onMounted, reactive: import_vue2.reactive, ref: import_vue2.ref, getCurrentInstance: import_vue2.getCurrentInstance, get api() {
return api;
}, get util() {
return util$1;
}, collectAdd };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_uni_swipe_action_item = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-swipe-action-item"), __easycom_1);
const _component_uni_swipe_action = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-swipe-action"), __easycom_2);
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
[
$setup.showLoad ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "showLoad fmid ptb30"
}, [
(0, import_vue2.createVNode)(_component_uni_icons, { type: "spinner-cycle" }),
(0, import_vue2.createElementVNode)("u-text", { class: "c666 f28" }, "\u52A0\u8F7D\u4E2D...")
])) : ((0, import_vue2.openBlock)(), (0, import_vue2.createBlock)(
_component_uni_swipe_action,
{
key: 1,
ref: "swipeActionRef"
},
{
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "collect" }, [
((0, import_vue2.openBlock)(true), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
(0, import_vue2.renderList)($setup.listProperty.data, (item, index) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createBlock)(_component_uni_swipe_action_item, {
"right-options": $setup.options,
key: index,
onClick: ($event) => $setup.handleActionItem($event, index)
}, {
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", {
class: "item rows fdr mlr20 ptb20",
onClick: (0, import_vue2.withModifiers)(($event) => $setup.handleItem(item), ["stop"])
}, [
(0, import_vue2.createElementVNode)("view", { class: "poster" }, [
(0, import_vue2.createElementVNode)("u-image", {
class: "wh80 br20",
src: item.formatPic,
mode: "aspectFill"
}, null, 8, ["src"])
]),
(0, import_vue2.createElementVNode)("view", { class: "oh pl20" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c333 f28" },
(0, import_vue2.toDisplayString)(item.collectName),
1
/* TEXT */
)
]),
item.isPrivate == 1 ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-image", {
key: 0,
class: "wh24 ml10",
src: _imports_0$1,
mode: "aspectFit"
})) : (0, import_vue2.createCommentVNode)("v-if", true),
(0, import_vue2.createElementVNode)("view", { class: "f1" })
], 8, ["onClick"])
]),
_: 2
/* DYNAMIC */
}, 1032, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
)),
(0, import_vue2.createElementVNode)("view", { class: "nomore mtb20" }, [
(0, import_vue2.createElementVNode)("u-text", { class: "nomore" }, "\u6682\u65E0\u66F4\u591A")
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)),
(0, import_vue2.createCommentVNode)(" \u6536\u85CF\u6DFB\u52A0 "),
(0, import_vue2.createVNode)(
$setup["collectAdd"],
{ ref: "collectAddRef" },
null,
512
/* NEED_PATCH */
)
],
64
/* STABLE_FRAGMENT */
);
}
var collectList = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["styles", [_style_0$2]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/index/collectList.vue"]]);
var _imports_0 = "/static/circle.png";
var _style_0$1 = { "close": { "": { "position": "absolute", "right": "20rpx", "top": "5rpx" } }, "scroll": { "": { "height": "550rpx" } }, "add": { "": { "boxShadow": "0 8rpx 20rpx rgba(0, 0, 0, 0.3)" } }, "icon": { ".add ": { "borderWidth": "5rpx", "borderStyle": "solid", "borderColor": "#333333", "borderRadius": "5rpx" } }, "resultAlt": { "": { "marginBottom": "150rpx" } }, "circle": { ".resultAlt ": { "backgroundColor": "#FF008C" } } };
var _sfc_main$1 = {
__name: "collect",
setup(__props, { expose: __expose }) {
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
const collectResult = (0, import_vue2.ref)(false);
const detail = (0, import_vue2.ref)({});
function handleCollect(item) {
close();
open("result");
}
function open(item) {
detail.value = item;
if (!item.isCollect) {
proxy.$refs.collect.open();
return;
}
cancelCollect();
}
function handleItem(item) {
collectVideo(item);
}
function close(key) {
if (!key)
key = "collect";
proxy.$refs[key].close();
}
function collectVideo(collects) {
api.video.collectVideo({
query: {
// 视频id
videoId: detail.value.videoId,
// 收藏夹id
collectId: collects.id,
isPrivate: collects.isPrivate
}
}).then((rs) => {
if (rs.code == 200) {
proxy.$refs.collect.close();
detail.value.isCollect = true;
detail.value.collect++;
uni.$emit("updateVideo", detail.value);
collectResult.value = true;
proxy.$refs.result.open();
setTimeout(() => {
proxy.$refs.result.close();
}, 3e3);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function cancelCollect() {
api.video.cancelCollect({
query: {
// 视频id
videoId: detail.value.videoId
}
}).then((rs) => {
if (rs.code == 200) {
detail.value.isCollect = false;
detail.value.collect--;
uni.$emit("updateVideo", detail.value);
collectResult.value = false;
proxy.$refs.result.open();
setTimeout(() => {
proxy.$refs.result.close();
}, 3e3);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
__expose({
open,
close,
collectResult
});
const __returned__ = { proxy, collectResult, detail, handleCollect, open, handleItem, close, collectVideo, cancelCollect, onMounted: import_vue2.onMounted, ref: import_vue2.ref, reactive: import_vue2.reactive, getCurrentInstance: import_vue2.getCurrentInstance, watch: import_vue2.watch, collectList, get api() {
return api;
}, get util() {
return util$1;
}, collectAdd };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_uni_popup = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
[
(0, import_vue2.createCommentVNode)(" \u6536\u85CF\u5217\u8868 "),
(0, import_vue2.createVNode)(
_component_uni_popup,
{
ref: "collect",
type: "bottom"
},
{
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "popBot bfff" }, [
(0, import_vue2.createElementVNode)("view", {
class: "close",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.collect.close())
}, [
(0, import_vue2.createVNode)(_component_uni_icons, {
type: "close",
size: "36rpx",
color: "#333"
})
]),
(0, import_vue2.createCommentVNode)(" \u6807\u9898 "),
(0, import_vue2.createElementVNode)("view", { class: "title mt40" }, [
(0, import_vue2.createElementVNode)("u-text", { class: "tac f40" }, "\u9009\u62E9\u6536\u85CF\u5939")
]),
(0, import_vue2.createElementVNode)("scroll-view", {
scrollY: "",
class: "scroll"
}, [
(0, import_vue2.createVNode)($setup["collectList"], { onHandleItem: $setup.handleItem })
]),
(0, import_vue2.createElementVNode)("view", {
class: "add df fdr aic ptb30 plr30",
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$refs.collectAddRef.open())
}, [
(0, import_vue2.createElementVNode)("view", { class: "icon fmid wh70" }, [
(0, import_vue2.createVNode)(_component_uni_icons, {
type: "plusempty",
color: "#333"
})
]),
(0, import_vue2.createElementVNode)("u-text", { class: "ml20 c333 f28" }, "\u65B0\u5EFA\u6536\u85CF\u5939")
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
),
(0, import_vue2.createCommentVNode)(" \u6536\u85CF\u7ED3\u679C "),
(0, import_vue2.createVNode)(
_component_uni_popup,
{
ref: "result",
type: "bottom",
"mask-background-color": "rgba(0,0,0,0)"
},
{
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "resultAlt mlr30 df fdr aic ptb30 plr30 bfff br20" }, [
(0, import_vue2.createElementVNode)("view", { class: "circle cir" }, [
(0, import_vue2.createElementVNode)("u-image", {
class: "wh30",
src: _imports_0,
mode: "aspectFill"
})
]),
$setup.collectResult ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
{ key: 0 },
[
(0, import_vue2.createElementVNode)("u-text", { class: "f1 ml30 c333 f28" }, "\u6536\u85CF\u6210\u529F"),
(0, import_vue2.createCommentVNode)("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("u-text", {
key: 1,
class: "f1 ml30 c333 f28"
}, "\u5DF2\u53D6\u6D88\u6536\u85CF"))
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
),
(0, import_vue2.createCommentVNode)(" \u65B0\u589E\u6536\u85CF "),
(0, import_vue2.createVNode)(
$setup["collectAdd"],
{ ref: "collectAddRef" },
null,
512
/* NEED_PATCH */
)
],
64
/* STABLE_FRAGMENT */
);
}
var collectAlt = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["styles", [_style_0$1]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/index/collect.vue"]]);
var _style_0 = { "shareBox": { "": { "height": "600rpx" } }, "firendBox": { ".shareBox ": { "height": 100 } }, "scroll": { ".shareBox .firendBox ": { "height": "500rpx" } }, "list": { ".shareBox .firendBox .scroll ": { "flexWrap": "wrap" } }, "item": { ".shareBox .firendBox .scroll .list ": { "width": "140rpx", "marginTop": "40rpx", "marginRight": 0, "marginBottom": "40rpx", "marginLeft": 0 } } };
var _sfc_main = {
__name: "shareFirend",
setup(__props, { expose: __expose }) {
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
const userList = (0, import_vue2.reactive)([]);
const videoItem = (0, import_vue2.reactive)({});
const userinfo = (0, import_vue2.computed)(() => {
let result = uni.$store.state.userinfo;
return result;
});
(0, import_vue2.onMounted)(() => {
util$1.isLogin(() => {
getFriendList();
});
uni.$on("login", () => {
getFriendList();
});
uni.$on("logout", () => {
userList.length = 0;
});
});
(0, import_vue2.onBeforeUnmount)(() => {
uni.$off("login");
uni.$off("logout");
});
function getFriendList() {
let isReady = uni.$chat.isReady();
if (!isReady) {
setTimeout(function() {
getFriendList();
}, 200);
return;
}
uni.$chat.getFriendList().then((rs) => {
if (rs.code == 0) {
const result = rs.data;
userList.push(...result);
}
});
}
function open(item) {
Object.assign(videoItem, item);
proxy.$refs.firend.open();
}
function close() {
proxy.$refs.firend.close();
}
function handleShare(item) {
api.video.videoShare({
query: {
// 视频id
videoId: videoItem.videoId,
// 分享人id
sharedUserIds: item.userID
}
}).then((rs) => {
if (rs.code == 200) {
util$1.alert("\u5206\u4EAB\u6210\u529F");
close();
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
__expose({
open,
close
});
const __returned__ = { proxy, userList, videoItem, userinfo, getFriendList, open, close, handleShare, onMounted: import_vue2.onMounted, ref: import_vue2.ref, reactive: import_vue2.reactive, getCurrentInstance: import_vue2.getCurrentInstance, watch: import_vue2.watch, computed: import_vue2.computed, onBeforeUnmount: import_vue2.onBeforeUnmount, get util() {
return util$1;
}, get api() {
return api;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_uni_popup = resolveEasycom((0, import_vue2.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
[
(0, import_vue2.createCommentVNode)(" \u5206\u4EAB\u7ED9\u670B\u53CB "),
(0, import_vue2.createVNode)(
_component_uni_popup,
{
ref: "firend",
type: "bottom"
},
{
default: (0, import_vue2.withCtx)(() => [
(0, import_vue2.createElementVNode)("view", { class: "shareBox popBot df fdc plr20 bfff" }, [
(0, import_vue2.createElementVNode)("view", { class: "header rows fdr" }, [
(0, import_vue2.createElementVNode)("view", { class: "title mt40" }, [
(0, import_vue2.createElementVNode)("u-text", { class: "f40" }, "\u5206\u4EAB\u7ED9\u670B\u53CB")
]),
(0, import_vue2.createElementVNode)("view", {
class: "close",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.firend.close())
}, [
(0, import_vue2.createVNode)(_component_uni_icons, {
type: "close",
size: "36rpx",
color: "#333"
})
])
]),
(0, import_vue2.createElementVNode)("view", { class: "firendBox f1 df fdc mb30" }, [
(0, import_vue2.createElementVNode)("scroll-view", {
scrollY: "true",
class: "scroll f1",
showScrollbar: false
}, [
$setup.userList[0] ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
class: "list df fdr"
}, [
((0, import_vue2.openBlock)(true), (0, import_vue2.createElementBlock)(
import_vue2.Fragment,
null,
(0, import_vue2.renderList)($setup.userList, (item, index) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
class: "item aic",
key: index,
onClick: ($event) => $setup.handleShare(item)
}, [
(0, import_vue2.createElementVNode)("u-image", {
class: "wh100 cir",
src: item.profile.avatar,
mode: "aspectFill"
}, null, 8, ["src"]),
(0, import_vue2.createElementVNode)("view", { class: "txt mt10" }, [
(0, import_vue2.createElementVNode)(
"u-text",
{ class: "c111 f24" },
(0, import_vue2.toDisplayString)(item.profile.nick),
1
/* TEXT */
)
])
], 8, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
])) : ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 1,
class: "nomore"
}, [
(0, import_vue2.createElementVNode)("u-text", { class: "nomore" }, "\u6682\u65E0\u597D\u53CB~")
]))
])
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
],
2112
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
);
}
var shareFirendAlt = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/components/index/shareFirend.vue"]]);
// ../../../../document/九亿商城/jy/jiuyi2/unpackage/dist/dev/.nvue/pages/index/videoDetail.js
var _style_02 = {};
var _sfc_main2 = {
__name: "videoDetail",
setup(__props, { expose: __expose }) {
__expose();
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
const videoId = (0, import_vue3.ref)("");
const detail = (0, import_vue3.reactive)({});
const isMine = (0, import_vue3.ref)(false);
onLoad((option) => {
if (option.videoId)
videoId.value = option.videoId;
if (option.isMine && option.isMine != "false")
isMine.value = option.isMine;
getVideoDetail();
uni.$on("updateVideo", (item) => {
if (!item && !item.videoId)
return;
if (item.videoId == detail.videoId)
Object.assign(detail, item);
});
});
onHide(() => {
proxy.$refs.indexVideo.pause();
});
function getVideoDetail() {
api.video.getVideoById({
query: {
videoId: videoId.value
}
}).then((rs) => {
if (rs.code == 200) {
const result = rs.data;
result.format_videoUrl = util$1.format_url(result.videoUrl, "video");
result.format_header = util$1.format_url(result.header, "img");
Object.assign(detail, result);
proxy.$refs.indexVideo.play();
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function handleShowCommentAlt(item) {
proxy.$refs.commentRef.open(item);
proxy.$refs.indexVideo.pause();
}
function handleShowCollectAlt(item) {
proxy.$refs.collectRef.open(item);
}
function handleShowShareFirend() {
proxy.$refs.shareFirendRef.open();
}
function videoLike(param) {
const {
index,
isLike
} = param;
const item = detail;
let type = 1;
if (item.isLike == 0)
type = isLike;
api.video.videoLike({
query: {
// 0赞1取消赞 3私密赞
type,
// 视频id
videoId: item.videoId
}
}).then((rs) => {
if (rs.code == 200) {
item.isLike = {
0: 1,
1: 0,
3: 3
}[type];
type == 1 ? item.likes-- : item.likes++;
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function detailMenu(item) {
let menu = [
{
name: "\u7F16\u8F91",
fn: function() {
uni.navigateTo({
url: util$1.setUrl("/pages/release/video", {
videoId: detail.videoId
})
});
}
},
{
name: "\u5220\u9664",
fn: () => {
util$1.alert({
content: "\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\u3002\u786E\u8BA4\u5220\u9664\uFF1F"
}).then((rs) => {
if (rs.confirm)
api.video.updateVideo({
data: {
videoId: detail.videoId,
isDeleted: 1
}
}).then((rs2) => {
if (rs2.code == 200) {
uni.$emit("deleteVideo", detail.videoId);
uni.navigateBack();
return;
}
util$1.alert({
content: rs2.msg,
showCancel: false
});
});
});
}
}
];
uni.showActionSheet({
itemList: menu.map((node) => node.name),
success: (rs) => {
menu[rs.tapIndex].fn();
}
});
}
const __returned__ = { proxy, videoId, detail, isMine, getVideoDetail, handleShowCommentAlt, handleShowCollectAlt, handleShowShareFirend, videoLike, detailMenu, ref: import_vue3.ref, getCurrentInstance: import_vue3.getCurrentInstance, reactive: import_vue3.reactive, get onLoad() {
return onLoad;
}, get onHide() {
return onHide;
}, get util() {
return util$1;
}, get api() {
return api;
}, indexVideo, commentAlt, collectAlt, shareFirendAlt };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render2(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("scroll-view", {
scrollY: true,
showScrollbar: true,
enableBackToTop: true,
bubble: "true",
style: { flexDirection: "column" }
}, [
(0, import_vue3.createElementVNode)("view", { class: "page f1" }, [
(0, import_vue3.createCommentVNode)(" "),
(0, import_vue3.createVNode)($setup["indexVideo"], {
ref: "indexVideo",
item: $setup.detail,
tabIndex: 0,
isMine: $setup.isMine,
index: 0,
current: 0,
mode: "detail",
onShowComment: $setup.handleShowCommentAlt,
onShowCollect: $setup.handleShowCollectAlt,
onShowShareFirend: $setup.handleShowShareFirend,
onLike: $setup.videoLike,
onDetailMenu: $setup.detailMenu
}, null, 8, ["item", "isMine"]),
(0, import_vue3.createCommentVNode)(" \u8BC4\u8BBA\u5F39\u7A97 "),
(0, import_vue3.createVNode)(
$setup["commentAlt"],
{ ref: "commentRef" },
null,
512
/* NEED_PATCH */
),
(0, import_vue3.createCommentVNode)(" \u6536\u85CF\u5F39\u7A97 "),
(0, import_vue3.createVNode)(
$setup["collectAlt"],
{ ref: "collectRef" },
null,
512
/* NEED_PATCH */
),
(0, import_vue3.createCommentVNode)(" \u5206\u4EAB\u5230\u597D\u53CB\u5F39\u7A97 "),
(0, import_vue3.createVNode)(
$setup["shareFirendAlt"],
{ ref: "shareFirendRef" },
null,
512
/* NEED_PATCH */
)
])
]);
}
var videoDetail = /* @__PURE__ */ _export_sfc(_sfc_main2, [["render", _sfc_render2], ["styles", [_style_02]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi2/pages/index/videoDetail.nvue"]]);
// <stdin>
var webview = plus.webview.currentWebview();
if (webview) {
const __pageId = parseInt(webview.id);
const __pagePath = "pages/index/videoDetail";
let __pageQuery = {};
try {
__pageQuery = JSON.parse(webview.__query__);
} catch (e) {
}
videoDetail.mpType = "page";
const app = Vue.createPageApp(videoDetail, { $store: getApp({ allowDefault: true }).$store, __pageId, __pagePath, __pageQuery });
app.provide("__globalStyles", Vue.useCssStyles([...__uniConfig.styles, ...videoDetail.styles || []]));
app.mount("#root");
}
})();