"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/jiuyi/unpackage/dist/dev/.nvue/uni-app.es.js
var import_vue = __toESM(require_vue());
var ON_SHOW = "onShow";
var ON_HIDE = "onHide";
var ON_LOAD = "onLoad";
var ON_READY = "onReady";
var ON_UNLOAD = "onUnload";
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 onShow = /* @__PURE__ */ createHook(ON_SHOW);
var onHide = /* @__PURE__ */ createHook(ON_HIDE);
var onLoad = /* @__PURE__ */ createHook(ON_LOAD);
var onReady = /* @__PURE__ */ createHook(ON_READY);
var onUnload = /* @__PURE__ */ createHook(ON_UNLOAD);
// ../../../../document/九亿商城/jy/jiuyi/unpackage/dist/dev/.nvue/pages/index/index.js
var import_vue3 = __toESM(require_vue());
// ../../../../document/九亿商城/jy/jiuyi/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/jiuyi/unpackage/dist/dev/.nvue/shareFirend.js
var import_vue2 = __toESM(require_vue());
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/jiuyi/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 i2 in styles) {
let line = this.toLine(i2);
transform += line + ":" + styles[i2] + ";";
}
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 i2 in obj) {
try {
if (typeof obj[i2] === "object") {
this.animation[i2](...obj[i2]);
} else {
this.animation[i2](obj[i2]);
}
} catch (e) {
formatAppLog("error", "at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:148", `\u65B9\u6CD5 ${i2} \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/jiuyi/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/jiuyi/uni_modules/uni-popup/components/uni-popup/uni-popup.vue"]]);
var store = (0, import_vuex.createStore)({
state: {
// 用户信息
userinfo: {},
// tabbar当前的模式 default视频端 shop商城端
tabbarMode: "default",
// 闹钟时间
alarmTime: ""
},
mutations: {
// 获取内容
setState(state, option) {
const key = option.key;
const value = option.value;
state[key] = value;
},
// 设置用户信息
setUserInfo(state, payload) {
state.userinfo = payload;
},
// 设置 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://91f.store/api",
// 上传文件二级路径
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(param2) {
return util$1.request({
url: `/user/login/userRegister`,
data: param2.data,
path: param2.path
});
},
/**
* 获取验证码
* @param {Object} param
*/
getCaptcha(param2) {
return util$1.request({
url: "/user/Captcha/getCaptcha",
data: param2.data,
path: param2.path,
method: "GET"
});
},
/**
* 用户密码登录接口
* @param {Object} param
*/
userLoginByPassword(param2) {
return util$1.request({
url: "/user/login/userLoginByPassword",
data: param2.data
});
},
/**
* 修改用户密码
* @param {Object} param
*/
resetPassword(param2) {
return util$1.request({
url: "/user/login/resetPassword",
data: param2.data,
path: param2.path,
method: "POST"
});
},
/**
* 获取IMtoken
* @param {Object} param
*/
getIMToken(param2) {
return util$1.request({
url: "/im/token/getUserAppToken",
query: param2.query,
method: "GET"
});
},
/**
* 密码验证
* @param {Object} param
*/
validateUserPassWord(param2) {
return util$1.request({
url: "/user/login/userLoginByCache/validateUserPassWord",
data: param2.data,
method: "POST",
load: true
});
}
};
var mine = {
/**
* 获取用户信息
* @param {Object} param
*/
getUserinfo(param2) {
return util$1.request({
url: `/getAppInfo`,
method: "GET"
});
},
/**
* 修改用户信息
* @param {Object} param
*/
updateUserInfo(param2) {
return util$1.request({
url: `/user/info/updateUserInfo`,
data: param2.data,
method: "POST",
load: true
});
},
// 实名认证
certification(param2) {
return util$1.request({
url: `/user/info/certification`,
query: param2.query,
data: param2.data,
method: "POST"
});
},
/**
* 支付
* @param {Object} param
*/
pay(param2) {
return util$1.request({
url: "/home/pay",
query: param2.query,
method: "POST"
});
},
/**
* 获取余额记录
* @param {Object} param
*/
getBalanceLog(param2) {
return util$1.request({
url: "/home/getBalanceLog",
query: param2.query,
method: "POST"
});
},
/**
* 获取冻结
* @param {Object} param
*/
myfreeze(param2) {
return util$1.request({
url: "/home/myfreeze",
method: "POST"
});
}
};
var video = {
/**
* 申请完播量
* @param {Object} param
*/
applyVideo(param2) {
return util$1.request({
url: `/homecommon/applyVideo`,
query: param2.query,
data: param2.data,
method: "POST",
load: true
});
},
/**
* 展播量推送
* @param {Object} param
*/
pushVideo(param2) {
return util$1.request({
url: `/homecommon/pushVideo`,
query: param2.query,
method: "POST",
load: true
});
},
/**
* 他人用户主页
* @param {Object} param
*/
getUserInfo(param2) {
return util$1.request({
url: `/home/getUserInfo`,
query: param2.query,
method: "POST",
load: true
});
},
/**
* 用户视频列表
* @param {Object} param
*/
myVideoList(param2) {
return util$1.request({
url: `/home/myVideoList`,
query: param2.query,
method: "POST",
load: true
});
},
/**
* 我的收藏列表
* @param {Object} param
*/
getCollectList(param2) {
return util$1.request({
url: `/collect/getCollectList`,
query: param2.query,
method: "POST"
});
},
/**
* 新建收藏夹
* @param {Object} param
*/
saveCollectList(param2) {
return util$1.request({
url: `/collect/saveCollectList`,
query: param2.query,
method: "POST",
load: true
});
},
/**
* 编辑收藏夹
* @param {Object} param
*/
updateCollectList(param2) {
return util$1.request({
url: `/collect/updateCollectList`,
query: param2.query,
method: "POST",
load: true
});
},
/**
* 删除收藏夹
* @param {Object} param
*/
deleteCollect(param2) {
return util$1.request({
url: `/collect/deleteCollect`,
query: param2.query,
load: true,
method: "POST"
});
},
/**
* 我的收藏视频列表
* @param {Object} param
*/
getCollectVideoList(param2) {
return util$1.request({
url: `/collect/getCollectVideoList`,
query: param2.query,
load: true,
method: "POST"
});
},
/**
* 收藏视频
* @param {Object} param
*/
collectVideo(param2) {
return util$1.request({
url: `/collect/collectVideo`,
query: param2.query,
method: "POST",
load: true
});
},
/**
* 取消收藏
* @param {Object} param
*/
cancelCollect(param2) {
return util$1.request({
url: `/collect/cancelCollect`,
query: param2.query,
method: "POST",
load: true
});
},
/**
* 首页视频分页接口
* @param {Object} param
*/
homeVideo(param2) {
return util$1.request({
url: `/homecommon/homeVideo`,
query: param2.query,
method: "POST"
});
},
/**
* 商家视频分页
* @param {Object} param
*/
businessHomeVideo(param2) {
return util$1.request({
url: `/homecommon/businessHomeVideo`,
query: param2.query,
method: "POST"
});
},
/**
* 其它类型视频接口
* @param {Object} param
*/
otherHomeVideo(param2) {
return util$1.request({
url: `/homecommon/otherHomeVideo`,
query: param2.query,
method: "POST"
});
},
/**
* 我的关注视频列表
* @param {Object} param
*/
followVideo(param2) {
return util$1.request({
url: `/homecommon/followVideo`,
query: param2.query,
method: "POST"
});
},
/**
* 查看标签分类
* @param {Object} param
*/
getLabel(param2) {
return util$1.request({
url: `/home/getLabel`,
query: param2.query,
method: "POST"
});
},
/**
* 新增或编辑标签
* @param {Object} param
*/
setLabel(param2) {
return util$1.request({
url: `/home/setLabel`,
data: param2.data,
method: "POST",
load: true
});
},
/**
* 发布作品
* @param {Object} param
*/
publishVideo(param2) {
return util$1.request({
url: `/homecommon/publishVideo`,
data: param2.data,
method: "POST"
});
},
/**
* 修改视频信息接口
* @param {Object} param
*/
updateVideo(param2) {
return util$1.request({
url: `/homecommon/updateVideo`,
data: param2.data,
method: "POST"
});
},
/**
* 视频评论列表
* @param {Object} param
*/
commentList(param2) {
return util$1.request({
url: `/home/commentList`,
query: param2.query,
method: "POST"
});
},
/**
* 下级评论列表
* @param {Object} param
*/
levelCommentList(param2) {
return util$1.request({
url: `/home/levelCommentList`,
query: param2.query,
method: "POST"
});
},
/**
* 点赞/取消点赞接口 0取消 1点赞
* @param {Object} param
*/
thumbsUp(param2) {
return util$1.request({
url: `/home/thumbsUp`,
query: param2.query,
method: "POST"
});
},
/**
* 发表评论
* @param {Object} param
*/
comment(param2) {
return util$1.request({
url: `/home/comment`,
query: param2.query,
method: "POST"
});
},
/**
* 视频 点赞取消赞
* @param {Object} param
*/
videoLike(param2) {
return util$1.request({
url: `/home/videoLike`,
query: param2.query,
method: "POST"
});
},
/**
* 观看视频记录接口
* @param {Object} param
*/
browseLog(param2) {
return util$1.request({
url: `/home/browseLog`,
query: param2.query,
method: "POST"
});
},
/**
* 热点视频
* @param {Object} param
*/
hotVideos(param2) {
return util$1.request({
url: `/home/hotVideos`,
// query: param.query,
method: "POST"
});
},
/**
* 视频搜索记录
* @param {Object} param
*/
videoSearchLog(param2) {
return util$1.request({
url: `/home/videoSearchLog`,
// query: param.query,
method: "POST"
});
},
/**
* 视频模糊搜索
* @param {Object} param
*/
videoSearch(param2) {
return util$1.request({
url: `/home/videoSearch`,
query: param2.query,
method: "POST"
});
},
/**
* 同意好友申请
* @param {Object} param
*/
agreeFriend(param2) {
return util$1.request({
url: `/user/friend/agreeFriend`,
path: param2.path,
query: param2.query,
method: "POST"
});
},
/**
* 拒绝好友申请
* @param {Object} param
*/
refuseFriend(param2) {
return util$1.request({
url: `/user/friend/refuseFriend`,
path: param2.path,
query: param2.query,
method: "POST"
});
},
/**
* 好友列表
* @param {Object} param
*/
getFriendList(param2) {
return util$1.request({
url: `/user/friend/getFriendList`,
path: param2.path,
query: param2.query,
method: "GET"
});
},
/**
* 关注列表
* @param {Object} param
*/
getFansList(param2) {
return util$1.request({
url: `/user/attention/getFansList`,
path: param2.path,
query: param2.query,
method: "GET"
});
},
/**
* 关注列表
* @param {Object} param
*/
getAttentionList(param2) {
return util$1.request({
url: `/user/attention/getAttentionList`,
path: param2.path,
query: param2.query,
method: "GET"
});
},
/**
* 关注用户 关注状态 0:取关 1:关注
* @param {Object} param
*/
attention(param2) {
return util$1.request({
url: `/user/attention`,
path: param2.path,
data: param2.data,
method: "POST"
});
},
/**
* 视频观看权限 (不看他) 0拉黑 1放出
* @param {Object} param
*/
videoBlock(param2) {
return util$1.request({
url: `/home/videoBlock`,
query: param2.query,
load: true,
method: "POST"
});
},
/**
* 举报视频
* @param {Object} param
*/
reportVideo(param2) {
return util$1.request({
url: `/report/reportVideo`,
data: param2.data,
method: "POST"
});
},
/**
* 我的喜欢视频列表 分页
* @param {Object} param
*/
myLikeVideoList(param2) {
return util$1.request({
url: `/home/myLikeVideoList`,
query: param2.query,
method: "POST"
});
},
/**
* 视频详情
* @param {Object} param
*/
getVideoById(param2) {
return util$1.request({
url: `/homecommon/getVideoById`,
query: param2.query,
method: "POST"
});
},
/**
* 视频分享
* @param {Object} param
*/
videoShare(param2) {
return util$1.request({
url: `/home/videoShare`,
query: param2.query,
method: "POST"
});
},
/**
* 设置闹铃
* @param {Object} param
*/
setAlarm(param2) {
return util$1.request({
url: `/home/setAlarm`,
query: param2.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
*/
setNotes(param2) {
return util$1.request({
url: `/user/friend/setNotes`,
method: "POST",
query: param2.query
});
},
/**
* 删除好友
* @param {Object} param
*/
deleteFriend(param2) {
return util$1.request({
url: `/user/friend/deleteFriend`,
method: "POST",
path: param2.path
});
},
/**
* 添加好友
* @param {Object} param
*/
addFriend(param2) {
return util$1.request({
url: `/user/friend/addFriend`,
method: "POST",
path: param2.path
});
},
/**
* 好友申请列表-分页
* @param {Object} param
*/
getFriendListPage(param2) {
return util$1.request({
url: `/user/friend/getFriendListPage`,
path: param2.path,
query: param2.query,
method: "GET"
});
},
/**
* 根据用户名模糊搜索好友-分页
* @param {Object} param
*/
searchFriendByName(param2) {
return util$1.request({
url: `/user/friend/searchFriendByName`,
path: param2.path,
query: param2.query,
method: "GET"
});
},
/**
* 商品列表
* @param {Object} param
*/
getImToken(param2) {
return util$1.request({
url: `/im/token/getUserAppToken`,
method: "get",
query: param2
});
},
/**
* 商品列表
* @param {Object} param
*/
sendRedBag(param2) {
return util$1.request({
url: `/home/sendRedBag`,
method: "POST",
data: param2.data
});
},
// 抢红包
grabred(param2) {
return util$1.request({
url: `/home/grabred`,
method: "POST",
data: param2.data
});
},
// 红包详情
getRedbag(param2) {
return util$1.request({
url: `/home/getRedbag`,
method: "POST",
query: param2.data
});
},
grabredLog(param2) {
return util$1.request({
url: `/home/grabredLog`,
method: "POST",
query: param2
});
}
};
var api = {
// 登录
login,
// 我的
mine,
// 视频模块
video,
// 消息
news,
// 上传图片地址
uploadImg: "/homecommon/upload",
// 上传视频地址
uploadVideo: "/homecommon/uploadVideo",
// 公共模块可以放在这里 比如获取各种文章
/**
* 获取文章
* @param {Object} param
*/
getArticle(param2) {
return util$1.request({
url: "/home/getArticle",
query: param2.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 : api[{
img: "uploadImg",
video: "uploadVideo"
}[obj.mode]];
formatAppLog("log", "at common/js/util.js:98", "obj.url", obj.url);
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({
"ngrok-skip-browser-warning": true,
"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": "*"
}, 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",
// 请求成功返回
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(/
/ig, '
').replace(/
{
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(param2) {
return param2 < 0 ? 0 : param2;
},
/**
* 对二补齐
* @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) {
if (obj.type == 2) {
obj.value.push(util.format_url(res.msg, "img"));
} else if (obj.type == 1) {
obj.value = util.format_url(res.msg, "img");
}
formatAppLog("log", "at common/js/util.js:629", "obj", obj, obj.value);
obj.success && obj.success({
result: res.msg,
value: obj.value
});
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) {
const fullUrl = util.format_url(res.msg, "video");
obj.success && obj.success({
result: res.msg,
value: fullUrl,
width: rs.width,
height: rs.height
});
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:720", "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:772", "chooseFile");
chooseFile((rs) => {
formatAppLog("log", "at common/js/util.js:774", "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:857", "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:904", "Unsupported suffix", suffix);
return;
}
uni.downloadFile({
url,
success: (res) => {
uni.openDocument({
filePath: res.tempFilePath,
fail: (rs) => {
formatAppLog("log", "at common/js/util.js:913", "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:994", "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:1023", "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:1049",
"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:1072", "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:1097", "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:1117", "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:1279", "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 i2 = 0; i2 < resultObj.granted.length; i2++) {
let grantedPermission = resultObj.granted[i2];
formatAppLog("log", "at common/js/util.js:1311", "\u5DF2\u83B7\u53D6\u7684\u6743\u9650\uFF1A" + grantedPermission);
}
for (let i2 = 0; i2 < resultObj.deniedPresent.length; i2++) {
let deniedPresentPermission = resultObj.deniedPresent[i2];
formatAppLog("log", "at common/js/util.js:1318", "\u62D2\u7EDD\u672C\u6B21\u7533\u8BF7\u7684\u6743\u9650\uFF1A" + deniedPresentPermission);
}
for (let i2 = 0; i2 < resultObj.deniedAlways.length; i2++) {
let deniedAlwaysPermission = resultObj.deniedAlways[i2];
formatAppLog("log", "at common/js/util.js:1324", "\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:1354", "\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(param2, cb) {
const token = param2.data;
uni.setStorageSync("token", token);
uni.showLoading({
mask: true
});
util.getUserinfo((userinfo) => {
uni.$emit("login");
util.loginTencent(userinfo);
util.loginAccountManagement(userinfo);
setTimeout(() => {
uni.switchTab({
url: "/pages/index/index"
});
}, 500);
cb ? cb() : "";
});
},
// 登录账号管理
loginAccountManagement(userInfo) {
let userList = uni.getStorageSync("userInfoList") || [];
const index2 = userList.findIndex((item) => item.userId === userInfo.userId);
if (index2 !== -1) {
userList.splice(index2, 1);
}
userList.push(userInfo);
uni.setStorageSync("userInfoList", userList);
},
// 登录腾讯聊天
loginTencent(userinfo) {
api.login.getIMToken({
query: {
userId: userinfo.userId
}
}).then((rs) => {
const loginParams = {
SDKAppID: util.config.TChat.SDKAppID,
userID: userinfo.userId + "",
userSig: rs
};
uni.$TUICallKit.login(loginParams, (res) => {
if (res.code === 0) {
formatAppLog("log", "at common/js/util.js:1481", "[TUICallKit] login success.");
} else {
formatAppLog("error", "at common/js/util.js:1483", "[TUICallKit] login failed, failed message = ", res.msg, params);
}
});
uni.$chat.login({
userID: userinfo.userId + "",
userSig: rs
}).then((rs2) => {
formatAppLog("log", "at common/js/util.js:1492", "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.user;
userinfo.userPortrait = util.format_url(userinfo.userPortrait, "img");
userinfo.background = util.format_url(userinfo.background, "img");
reslove(userinfo);
store.commit("setState", {
key: "userinfo",
value: userinfo
});
uni.setStorageSync("userinfo", userinfo);
cb ? cb(userinfo) : "";
if (userinfo.youth == 1) {
const hour = Number.parseInt(util.formatTime("H"));
Number.parseInt(util.formatTime("m"));
Number.parseInt(util.formatTime("m", param.endTime));
if (hour > 20 || hour < 6)
util.lockApp();
}
}
}).finally(() => {
uni.hideLoading();
});
});
},
/**
* 验证登录
* @param {Object} cb 回调函数
*/
isLogin(cb) {
let userinfo = uni.$store.state.userinfo;
return new Promise((resolve, reject) => {
if (!userinfo.userId) {
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:1575", "tim logout rs");
}).catch((rs) => {
formatAppLog("log", "at common/js/util.js:1577", "tim logout error:", rs);
});
}
store.commit("setState", {
key: "userinfo",
value: {}
});
uni.removeStorageSync("userinfo");
uni.removeStorageSync("token");
cb ? cb() : "";
},
// 是否实名
isAuth(param2) {
util.isLogin(() => {
const userinfo = uni.$store.state.userinfo;
formatAppLog("log", "at common/js/util.js:1599", "userinfo.userIdCard", userinfo.userIdCard);
if (userinfo.userIdCard) {
param2.success ? param2.success(userinfo) : "";
return;
}
if (!param2.noLink)
uni.navigateTo({
url: "/pages/mine/real-name-authentication/index"
});
param2.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:1621", "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 i2 = 0; i2 < n.length; i2++) {
s += cnum[parseInt(n.charAt(i2))];
}
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/question-answer/index", {
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) => {
formatAppLog("log", "at common/js/util.js:1798", "scanCode err", err);
}
});
},
// 设置扫描闹铃
setAlarm(param2) {
const userinfo = uni.$store.state.userinfo;
const currentTime = new Date(util.formatTime("yyyy-MM-dd HH:mm:ss")).valueOf();
const alarmTime = new Date(param2.endTime).valueOf();
if (currentTime > alarmTime) {
if (userinfo.youth == 1)
;
return;
}
uni.$store.commit("setState", {
key: "alarmTime",
value: param2.endTime
});
setTimeout(() => {
if (userinfo.youth == 1)
;
else {
util.alert({
content: param2.txt || "\u95F9\u949F\u63D0\u9192\u65F6\u95F4\u5230",
showCancel: false
});
uni.$store.commit("setState", {
key: "alarmTime",
value: ""
});
}
}, alarmTime - currentTime);
},
// 锁住app
lockApp() {
uni.navigateTo({
url: "/pages/login/lock"
});
}
};
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/jiuyi/components/header/statusBar.vue"]]);
var _style_0$7 = { "timeBox": { "": { "position": "fixed", "left": 0, "right": 0, "bottom": "300rpx", "textAlign": "center", "zIndex": 9 } }, "time": { ".timeBox ": { "width": "400rpx", "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;
const emit = __emit;
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
const trigger = (0, import_vue2.ref)(false);
const videoTime2 = (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 = videoTime2.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));
videoTime2.value = target;
videoProgress2.value = time2;
}
function onEnd(ev) {
trigger.value = false;
emit("change", {
time: videoTime2.value
});
}
const __returned__ = { props, emit, proxy, trigger, videoTime: videoTime2, 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 };
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)(' '),
(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/jiuyi/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 } }, "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)" } }, "@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
},
viewWidth: {
type: Number
}
},
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 videoTime2 = (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 collectBtnActive = (0, import_vue2.ref)(false);
const alarmTime = (0, import_vue2.computed)(() => {
let result = uni.$store.state.alarmTime;
return result;
});
(0, import_vue2.onMounted)(() => {
videoCtx.value = uni.createVideoContext(`video${props.tabIndex}${props.index}`);
});
(0, import_vue2.watch)(() => props.current, (nV) => {
if (nV == props.index)
play();
else
pause();
});
function onTouchStart() {
if (isTap.value) {
tapList.length = 0;
changeVideoPlay();
} else {
isTap.value = true;
let time2 = (/* @__PURE__ */ new Date()).getTime();
tapList.push(time2);
}
clearTimeout(tapTimer.value);
}
function onTouchEnd() {
if (!isTap.value)
return;
isTap.value = false;
let time2 = (/* @__PURE__ */ new Date()).getTime();
let diff = time2 - tapList[tapList.length - 1];
if (diff > 350)
return;
tapTimer.value = setTimeout(() => {
const isLike = 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:142", "\u516C\u5F00\u8D5E");
emit("like", {
index: props.index,
isLike: isLike == 0 ? 0 : 1
});
break;
case 3:
formatAppLog("log", "at components/index/indexVideo.vue:149", "\u9690\u79C1\u8D5E");
emit("like", {
index: props.index,
isLike: isLike == 0 ? 3 : 1
});
break;
}
}, 200);
}
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.viewWidth) - 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(index2, isLike) {
util$1.isLogin().then((rs) => {
emit("like", {
index: index2,
isLike
});
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handlePrivateLike(index2) {
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: index2,
isLike: 3
});
else
emit("like", {
index: index2,
isLike: 0
});
});
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handleDetailMenu(item) {
emit("detailMenu");
}
function handleTimeupdate(ev) {
videoTime2.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) {
emit("longtap");
}
__expose({
play,
pause,
videoTime: videoTime2,
item: props.item,
playState,
videoCtx: () => videoCtx.value
});
const __returned__ = { proxy, props, emit, videoCtx, playState, collectFirst, videoTime: videoTime2, tapList, tapTimer, isTap, collectBtnActive, alarmTime, onTouchStart, onTouchEnd, 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",
onLongpress: $setup.longtap,
onTouchmove: _cache[0] || (_cache[0] = (0, import_vue2.withModifiers)(() => {
}, ["stop"])),
onTouchstart: $setup.onTouchStart,
onTouchend: $setup.onTouchEnd,
onTouchcancel: $setup.onTouchEnd
},
[
(0, import_vue2.createVNode)($setup["statusBar"]),
(0, import_vue2.createElementVNode)("u-video", {
class: "video f1",
id: "video" + $props.tabIndex + $props.index,
src: $props.item.format_videoUrl,
poster: $props.item.format_imageUrl,
httpCache: false,
showFullscreenBtn: false,
enableProgressGesture: false,
controls: false,
onPlay: $setup.onVideoPlay,
onPause: $setup.onVideoPause,
showCenterPlayBtn: false,
onTimeupdate: $setup.handleTimeupdate,
onWaiting: $setup.handleWaiting,
playStrategy: 2,
initialTime: 0,
loop: true
}, null, 40, ["id", "src", "poster"])
],
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.viewWidth
}, null, 8, ["time", "viewWidth"])
],
32
/* NEED_HYDRATION */
)
]),
(0, import_vue2.createCommentVNode)(" \u6682\u505C\u8499\u7248 "),
!$setup.playState ? ((0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: 0,
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.format_header,
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.userName),
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/jiuyi/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 showLoad2 = (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) => {
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(() => {
showLoad2.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, index2) {
if (item.childShow == false) {
item.childShow = true;
return;
}
if (item.child.length >= item.num && item.childShow) {
item.childShow = false;
return;
}
item.pageNum++;
getLevelCommentList(item, index2);
}
function getLevelCommentList(item, index2) {
api.video.levelCommentList({
query: {
commentId: item.id,
pageSize: item.pageSize,
pageNum: item.pageNum
}
}).then((rs) => {
if (rs.code == 200) {
listProperty.data[index2].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: showLoad2, 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, index2) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
class: "item mtb20",
key: index2
}, [
(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, index2)
}, [
(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/jiuyi/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(index2, item, position) {
this.$emit("click", {
content: item,
index: index2,
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, index2) => {
if (item === this) {
this.swipeaction.children.splice(index2, 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, index2) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: index2,
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(index2, 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, index2) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
key: index2,
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(index2, 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/jiuyi/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/jiuyi/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 paddingHeight = (0, import_vue2.ref)(0);
const form = (0, import_vue2.reactive)(new Form());
(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:49", "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);
data.pic = util$1.replace_url(data.pic);
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, paddingHeight, form, 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.createElementVNode)("view", { class: "rows fdr mtb30" }, [
(0, import_vue2.createElementVNode)("view", { class: "df fdr aic" }, [
(0, import_vue2.createElementVNode)("u-text", null, "\u662F\u5426\u5FEB\u6377\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 == 1,
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/jiuyi/components/index/collectAdd.vue"]]);
var _style_0$2 = { "item": { ".collect ": { "borderBottomWidth": "2rpx", "borderBottomStyle": "solid", "borderBottomColor": "#D8D8D8" } } };
var _sfc_main$2 = {
__name: "collectList",
props: {
pageSize: {
type: [String, Number],
default: 10
}
},
emits: ["handleItem"],
setup(__props, { expose: __expose, emit: __emit }) {
const {
proxy
} = (0, import_vue2.getCurrentInstance)();
const props = __props;
const showLoad2 = (0, import_vue2.ref)(true);
const listProperty = (0, import_vue2.reactive)({
// 数据
data: [],
// 页码
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: props.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(() => {
showLoad2.value = false;
});
}
function delectList(item, index2) {
api.video.deleteCollect({
query: {
jyCollectId: item.id
}
}).then((rs) => {
if (rs.code === 200) {
listProperty.total--;
listProperty.data.splice(index2, 1);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function handleActionItem(ev, target) {
const index2 = ev.index;
const item = listProperty.data[target];
switch (index2) {
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, props, showLoad: showLoad2, 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, index2) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createBlock)(_component_uni_swipe_action_item, {
"right-options": $setup.options,
key: index2,
onClick: ($event) => $setup.handleActionItem($event, index2)
}, {
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/jiuyi/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
});
});
}
function scrollLower() {
proxy.$refs.collectListRef.getMoreList();
}
__expose({
open,
close,
collectResult
});
const __returned__ = { proxy, collectResult, detail, handleCollect, open, handleItem, close, collectVideo, cancelCollect, scrollLower, 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",
onScrolltolower: $setup.scrollLower
},
[
(0, import_vue2.createVNode)(
$setup["collectList"],
{
ref: "collectListRef",
onHandleItem: $setup.handleItem
},
null,
512
/* NEED_PATCH */
)
],
32
/* NEED_HYDRATION */
),
(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/jiuyi/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, index2) => {
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("view", {
class: "item aic",
key: index2,
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/jiuyi/components/index/shareFirend.vue"]]);
// ../../../../document/九亿商城/jy/jiuyi/unpackage/dist/dev/.nvue/pages/index/index.js
var _style_0$92 = { "uni-grid-item__box": { "": { "position": "relative", "flex": 1, "flexDirection": "column" } }, "uni-grid-item--border": { "": { "position": "relative", "borderBottomColor": "#D2D2D2", "borderBottomStyle": "solid", "borderBottomWidth": 0.5, "borderRightColor": "#D2D2D2", "borderRightStyle": "solid", "borderRightWidth": 0.5 } }, "uni-grid-item--border-top": { "": { "position": "relative", "borderTopColor": "#D2D2D2", "borderTopStyle": "solid", "borderTopWidth": 0.5 } }, "uni-highlight": { "": { "backgroundColor:active": "#f1f1f1" } } };
var _sfc_main$92 = {
name: "UniGridItem",
inject: ["grid"],
props: {
index: {
type: Number,
default: 0
}
},
data() {
return {
column: 0,
showBorder: true,
square: true,
highlight: true,
left: 0,
top: 0,
openNum: 2,
width: 0,
borderColor: "#e5e5e5"
};
},
created() {
this.column = this.grid.column;
this.showBorder = this.grid.showBorder;
this.square = this.grid.square;
this.highlight = this.grid.highlight;
this.top = this.hor === 0 ? this.grid.hor : this.hor;
this.left = this.ver === 0 ? this.grid.ver : this.ver;
this.borderColor = this.grid.borderColor;
this.grid.children.push(this);
this.width = this.grid.width;
},
beforeDestroy() {
this.grid.children.forEach((item, index2) => {
if (item === this) {
this.grid.children.splice(index2, 1);
}
});
},
methods: {
_onClick() {
this.grid.change({
detail: {
index: this.index
}
});
}
}
};
function _sfc_render$92(_ctx, _cache, $props, $setup, $data, $options) {
return $data.width ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
"view",
{
key: 0,
style: (0, import_vue3.normalizeStyle)("width:" + $data.width + ";" + ($data.square ? "height:" + $data.width : "")),
class: "uni-grid-item",
renderWhole: true
},
[
(0, import_vue3.createElementVNode)(
"view",
{
class: (0, import_vue3.normalizeClass)([{ "uni-grid-item--border": $data.showBorder, "uni-grid-item--border-top": $data.showBorder && $props.index < $data.column, "uni-highlight": $data.highlight }, "uni-grid-item__box"]),
style: (0, import_vue3.normalizeStyle)({ "border-right-color": $data.borderColor, "border-bottom-color": $data.borderColor, "border-top-color": $data.borderColor }),
onClick: _cache[0] || (_cache[0] = (...args) => $options._onClick && $options._onClick(...args))
},
[
(0, import_vue3.renderSlot)(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
)
],
4
/* STYLE */
)) : (0, import_vue3.createCommentVNode)("v-if", true);
}
var __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$92, [["render", _sfc_render$92], ["styles", [_style_0$92]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue"]]);
var _style_0$82 = { "uni-grid-wrap": { "": { "flex": 1, "flexDirection": "column" } }, "uni-grid": { "": { "flexDirection": "row", "flexWrap": "wrap" } }, "uni-grid--border": { "": { "position": "relative", "borderLeftColor": "#D2D2D2", "borderLeftStyle": "solid", "borderLeftWidth": 0.5 } } };
var dom2 = requireNativePlugin("dom");
var _sfc_main$82 = {
name: "UniGrid",
emits: ["change"],
props: {
// 每列显示个数
column: {
type: Number,
default: 3
},
// 是否显示边框
showBorder: {
type: Boolean,
default: true
},
// 边框颜色
borderColor: {
type: String,
default: "#D2D2D2"
},
// 是否正方形显示,默认为 true
square: {
type: Boolean,
default: true
},
highlight: {
type: Boolean,
default: true
}
},
provide() {
return {
grid: this
};
},
data() {
const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
return {
elId,
width: 0
};
},
created() {
this.children = [];
},
mounted() {
this.$nextTick(() => {
this.init();
});
},
methods: {
init() {
setTimeout(() => {
this._getSize((width) => {
this.children.forEach((item, index2) => {
item.width = width;
});
});
}, 50);
},
change(e) {
this.$emit("change", e);
},
_getSize(fn) {
dom2.getComponentRect(this.$refs["uni-grid"], (ret) => {
this.width = parseInt((ret.size.width - 1) / this.column) + "px";
fn(this.width);
});
}
}
};
function _sfc_render$82(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
class: "uni-grid-wrap",
renderWhole: true
}, [
(0, import_vue3.createElementVNode)("view", {
id: $data.elId,
ref: "uni-grid",
class: (0, import_vue3.normalizeClass)(["uni-grid", { "uni-grid--border": $props.showBorder }]),
style: (0, import_vue3.normalizeStyle)({ "border-left-color": $props.borderColor })
}, [
(0, import_vue3.renderSlot)(_ctx.$slots, "default")
], 14, ["id"])
]);
}
var __easycom_12 = /* @__PURE__ */ _export_sfc(_sfc_main$82, [["render", _sfc_render$82], ["styles", [_style_0$82]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/uni_modules/uni-grid/components/uni-grid/uni-grid.vue"]]);
var _imports_0$22 = "/static/footerMenuPlus.png";
var _imports_1$2 = "/static/footerMenuPlus1.png";
var _style_0$72 = { "ghost": { "": { "height": "120rpx" } }, "menuBox": { "": { "position": "fixed", "left": 0, "right": 0, "bottom": 0 }, ".dark": { "borderTopWidth": "1rpx", "borderTopStyle": "solid", "borderTopColor": "#999999", "backgroundColor": "#161616" }, ".light": { "boxShadow": "0px 8px 20px rgba(0, 0, 0, 0.3)", "backgroundColor": "#ffffff" } }, "menu": { ".menuBox ": { "justifyContent": "space-between", "paddingTop": "20rpx", "paddingRight": 0, "paddingBottom": "20rpx", "paddingLeft": 0, "flexDirection": "row" } }, "item": { ".menuBox ": { "alignItems": "center", "justifyContent": "center", "flex": 1 } }, "text": { ".menuBox.dark .active ": { "color": "#ffffff" }, ".menuBox.dark ": { "color": "#999999" }, ".menuBox.light .active ": { "color": "#333333" }, ".menuBox.light ": { "color": "#999999" } }, "img": { ".menuBox .middle ": { "width": "80rpx", "height": "80rpx" } }, "alert": { "": { "marginBottom": "120rpx", "backgroundColor": "#f8f8f8", "borderRadius": "30rpx" } }, "scroll": { ".alert ": { "height": "350rpx" } } };
var _sfc_main$72 = {
__name: "footerMenu",
props: {
page: {
type: String
},
// 主题 dark黑色 light白色的
subject: {
type: String,
default: "light"
}
},
setup(__props, { expose: __expose }) {
__expose();
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
const props = __props;
const userinfo = (0, import_vue3.computed)(() => {
let resuilt = uni.$store.state.userinfo;
return resuilt;
});
const mode = (0, import_vue3.computed)(() => uni.$store.state.tabbarMode);
const menu = (0, import_vue3.computed)(() => {
let arr = [
{
page: "index",
type: "option",
name: "\u89C6\u9891",
pagePath: "pages/index/index"
},
{
page: "",
type: "option",
name: "\u69B4\u83B2\u679C",
pagePath: "pages/index/durian"
},
// {
// page: 'shop',
// type: 'option',
// name: '商城',
// pagePath: 'pages/shop/shop'
// },
{
type: "middle",
name: ""
},
{
page: "news",
type: "option",
name: "\u6D88\u606F",
pagePath: "pages/news/news"
}
];
switch (mode.value) {
case "default":
arr[2].pagePath = "pages/release/video";
arr.push({
page: "mine",
type: "option",
name: "\u6211\u7684",
pagePath: "pages/mine/homepage"
});
break;
case "shop":
arr[2].pagePath = "pages/merchant/commodity-release/index";
arr.push({
page: "mine",
type: "option",
name: "\u4E2A\u4EBA\u4E2D\u5FC3",
pagePath: "pages/mine/mine"
});
break;
}
return arr;
});
let safeHeight = (0, import_vue3.ref)(0);
const showMenu = (0, import_vue3.computed)(() => {
let result = [];
if (userinfo.value.userId) {
result.push({
name: "\u53D1\u5E03\u89C6\u9891",
img: "/static/footerMenu1.png",
url: "/pages/release/video"
});
}
return result;
});
(0, import_vue3.onMounted)(() => {
addListener();
uni.hideTabBar();
uni.getSystemInfo().then((rs) => {
safeHeight.value = rs.safeArea + "px";
});
});
(0, import_vue3.onUnmounted)(() => {
uni.$off("changeMine");
});
function addListener() {
uni.$on("changeMine", (value) => {
uni.$store.commit("setState", {
key: "tabbarMode",
value
});
});
}
function handleMenu(item) {
if (item.type != "middle") {
if (item.page)
uni.switchTab({
url: `/${item.pagePath}`
});
else
uni.navigateTo({
url: `/${item.pagePath}`
});
return;
}
proxy.$refs.alert.open();
}
function handleAlert(ev) {
const index2 = ev.detail.index;
const item = showMenu.value[index2];
util$1.isAuth({
success: (rs) => {
if (item.url) {
uni.navigateTo({
url: item.url
});
} else
util$1.alert("\u656C\u8BF7\u671F\u5F85");
}
});
proxy.$refs.alert.close();
}
const __returned__ = { proxy, props, userinfo, mode, menu, get safeHeight() {
return safeHeight;
}, set safeHeight(v) {
safeHeight = v;
}, showMenu, addListener, handleMenu, handleAlert, ref: import_vue3.ref, computed: import_vue3.computed, onMounted: import_vue3.onMounted, onUnmounted: import_vue3.onUnmounted, getCurrentInstance: import_vue3.getCurrentInstance, reactive: import_vue3.reactive, get util() {
return util$1;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$72(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_grid_item = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-grid-item"), __easycom_0$1);
const _component_uni_grid = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-grid"), __easycom_12);
const _component_uni_icons = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_uni_popup = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
[
(0, import_vue3.createCommentVNode)(" \u5E7D\u7075\u76D2\u5B50 "),
(0, import_vue3.createElementVNode)(
"view",
{
class: "ghost",
style: (0, import_vue3.normalizeStyle)({ paddingBottom: $setup.safeHeight })
},
null,
4
/* STYLE */
),
(0, import_vue3.createCommentVNode)(" \u5E95\u90E8\u5BFC\u822A "),
(0, import_vue3.createElementVNode)(
"view",
{
class: (0, import_vue3.normalizeClass)(["menuBox", $props.subject])
},
[
(0, import_vue3.createElementVNode)("view", { class: "menu" }, [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.menu, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
class: "item",
key: index2,
onClick: ($event) => $setup.handleMenu(item)
}, [
item.type == "option" ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
"view",
{
key: 0,
class: (0, import_vue3.normalizeClass)(["option", { active: item.page === $props.page }])
},
[
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "text" },
(0, import_vue3.toDisplayString)(item.name),
1
/* TEXT */
)
],
2
/* CLASS */
)) : item.type === "middle" ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
key: 1,
class: "middle"
}, [
$props.subject == "dark" ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("u-image", {
key: 0,
class: "img",
src: _imports_0$22,
mode: "aspectFit"
})) : $props.subject == "light" ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("u-image", {
key: 1,
class: "img",
src: _imports_1$2,
mode: "aspectFit"
})) : (0, import_vue3.createCommentVNode)("v-if", true)
])) : (0, import_vue3.createCommentVNode)("v-if", true)
], 8, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
(0, import_vue3.createElementVNode)(
"view",
{
class: "safeArea",
style: (0, import_vue3.normalizeStyle)({ height: $setup.safeHeight })
},
null,
4
/* STYLE */
),
(0, import_vue3.createCommentVNode)(" \u5E95\u90E8\u83DC\u5355 "),
(0, import_vue3.createVNode)(
_component_uni_popup,
{
ref: "alert",
type: "bottom"
},
{
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("view", { class: "alert mlr50 pt50 plr10 pb10" }, [
(0, import_vue3.createElementVNode)("scroll-view", {
scrollY: "true",
class: "scroll"
}, [
(0, import_vue3.createVNode)(_component_uni_grid, {
column: 4,
highlight: true,
showBorder: false,
onChange: $setup.handleAlert
}, {
default: (0, import_vue3.withCtx)(() => [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.showMenu, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createBlock)(_component_uni_grid_item, {
index: index2,
key: index2
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("view", { class: "itemBox ptb30 df fdc jcc aic tac" }, [
(0, import_vue3.createCommentVNode)(' '),
(0, import_vue3.createElementVNode)("u-image", {
class: "wh80",
src: item.img,
mode: "aspectFill"
}, null, 8, ["src"]),
(0, import_vue3.createElementVNode)("view", { class: "mt5" }, [
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "text f28 c333" },
(0, import_vue3.toDisplayString)(item.name),
1
/* TEXT */
)
])
])
]),
_: 2
/* DYNAMIC */
}, 1032, ["index"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]),
(0, import_vue3.createElementVNode)("view", { class: "tac mt30" }, [
(0, import_vue3.createVNode)(_component_uni_icons, {
type: "bottom",
size: "50rpx",
color: "#999",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.alert.close())
})
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
],
2
/* CLASS */
)
],
64
/* STABLE_FRAGMENT */
);
}
var __easycom_02 = /* @__PURE__ */ _export_sfc(_sfc_main$72, [["render", _sfc_render$72], ["styles", [_style_0$72]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/components/footerMenu/footerMenu.vue"]]);
var _style_0$62 = { "close": { "": { "position": "absolute", "right": "20rpx", "top": "5rpx" } }, "oclock": { "": { "flexDirection": "row", "width": "460rpx", "height": "210rpx", "paddingTop": "5rpx", "paddingRight": "5rpx", "paddingBottom": "5rpx", "paddingLeft": "5rpx", "boxShadow": "0 0 8rpx rgba(0, 0, 0, 0.3)", "borderRadius": "25rpx" } }, "option": { ".oclock .select ": { "height": "60rpx" } }, "text": { ".oclock .select ": { "fontSize": "48rpx", "color": "#333333" }, ".btns .button.confirm ": { "color": "#ffffff" }, ".btns .button.cancel ": { "color": "#333333" }, ".btns .button ": { "textAlign": "center" } }, "remark": { "": { "backgroundColor": "#eeeeee" } }, "button": { ".btns ": { "width": "460rpx", "height": "72rpx", "borderRadius": "10rpx" }, ".btns .confirm": { "backgroundColor": "#111111" }, ".btns .cancel": { "backgroundColor": "#dcdcdc" } } };
var _sfc_main$62 = {
__name: "time",
setup(__props, { expose: __expose }) {
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
const typeList = (0, import_vue3.reactive)([{
id: 3,
name: "\u9752\u5C11\u5E74\u95F9\u949F",
key: "countDown"
}, {
id: 1,
name: "\u5012\u8BA1\u65F6\u95F9\u949F",
key: "countDown"
}, {
id: 2,
name: "\u65F6\u95F4\u95F9\u949F",
key: "time"
}]);
const typeIndex = (0, import_vue3.ref)(0);
const remark = (0, import_vue3.ref)("");
const hour = (0, import_vue3.reactive)([]);
const hourIndex = (0, import_vue3.ref)(0);
const minute = (0, import_vue3.reactive)([]);
const minuteIndex = (0, import_vue3.ref)(0);
const alarm = (0, import_vue3.computed)(() => {
let result = uni.$store.state.alarmTime;
return result;
});
const yMd = (0, import_vue3.ref)("");
const visible = (0, import_vue3.ref)(true);
const pickerViewStyle = (0, import_vue3.ref)("height: 60rpx;");
const userinfo = (0, import_vue3.computed)(() => {
let result = uni.$store.state.userinfo;
return result;
});
(0, import_vue3.onMounted)(() => {
const date = /* @__PURE__ */ new Date();
yMd.value = `${date.getFullYear()}-${util$1.toTwo(date.getMonth() + 1)}-${util$1.toTwo(date.getDate())}`;
init();
uni.$on("logout", () => {
uni.$store.commit("setState", {
key: "alarmTime",
value: ""
});
});
});
function getAlarm() {
api.video.getAlarm().then((rs) => {
if (rs.code == 200) {
const result = rs.data;
if (!result)
return;
const item = result[result.length - 1];
let currentTime = (/* @__PURE__ */ new Date()).getTime();
let endTime = new Date(item.endTime).getTime();
if (currentTime > endTime)
return;
setTime(item);
return;
}
});
}
function handleType(ev) {
const index2 = ev.detail.value;
if (typeIndex.value === index2)
return;
typeIndex.value = index2;
if (typeList[index2].key == "time") {
const date = /* @__PURE__ */ new Date();
hourIndex.value = hour.findIndex((node) => node == date.getHours());
minuteIndex.value = minute.findIndex((node) => node == date.getMinutes());
} else if (typeList[index2].key == "countDown") {
hourIndex.value = 0;
minuteIndex.value = 0;
}
}
function init() {
for (let i2 = 0; i2 < 24; i2++) {
hour.push(i2);
}
for (let i2 = 0; i2 < 60; i2++) {
minute.push(i2);
}
}
function setTime(param2) {
const currentTime = new Date(util$1.formatTime("yyyy-MM-dd HH:mm:ss")).valueOf();
const alarmTime = new Date(param2.endTime).valueOf();
if (alarmTime < currentTime)
return;
setTimeout(() => {
util$1.alert({
content: param2.txt || "\u95F9\u949F\u63D0\u9192\u65F6\u95F4\u5230",
showCancel: false
});
uni.$store.commit("setState", {
key: "alarmTime",
value: ""
});
}, alarmTime - currentTime);
uni.$store.commit("setState", {
key: "alarmTime",
value: param2.endTime
});
}
function handleHour(ev) {
const index2 = ev.detail.value[0];
if (hourIndex.value === index2)
return;
hourIndex.value = index2;
}
function handleMinute(ev) {
const index2 = ev.detail.value[0];
if (minuteIndex.value === index2)
return;
minuteIndex.value = index2;
}
function open() {
proxy.$refs.time.open();
}
function close() {
proxy.$refs.time.close();
}
function handleSubmit() {
if (userinfo.value.youth == 1) {
util$1.alert({
content: "\u9752\u5C11\u5E74\u6A21\u5F0F\u4E0B\u4E0D\u5141\u8BB8\u81EA\u5B9A\u4E49\u95F9\u949F",
showCancel: false
});
return;
}
const type = typeList[typeIndex.value];
let endTime = yMd.value;
if (type.key == "countDown") {
if (hourIndex.value === 0 && minuteIndex.value === 0) {
util$1.alert("\u5F53\u524D\u65F6\u95F4\u5DF2\u5230");
return;
}
endTime = util$1.strtotime(`+${hour[hourIndex.value]} hour`, (/* @__PURE__ */ new Date()).getTime());
endTime = util$1.strtotime(`+${minute[minuteIndex.value]} minute`, endTime);
endTime = new Date(endTime).setSeconds(0);
endTime = util$1.formatTime("yyyy-MM-dd HH:mm:ss", endTime);
} else if (type.key == "time") {
endTime += ` ${util$1.toTwo(hour[hourIndex.value])}:${util$1.toTwo(minute[minuteIndex.value])}:00`;
const currentTime = new Date(util$1.formatTime("yyyy-MM-dd HH:mm:ss")).valueOf();
const alarmTime = new Date(endTime).valueOf();
if (alarmTime < currentTime) {
util$1.alert("\u8BBE\u7F6E\u95F9\u949F\u65F6\u95F4\u5E94\u5927\u4E8E\u5F53\u524D\u65F6\u95F4");
return;
}
}
api.video.setAlarm({
query: {
//
endTime,
// 1倒计时闹钟 2时间闹钟 3青少年闹钟
type: typeList[typeIndex.value].id,
// 闹钟备注
txt: remark.value
}
}).then((rs) => {
if (rs.code == 200) {
util$1.alert("\u8BBE\u7F6E\u6210\u529F");
util$1.setAlarm({
endTime,
type: typeList[typeIndex.value].id,
txt: remark.value
});
close();
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
__expose({
open,
close
});
const __returned__ = { proxy, typeList, typeIndex, remark, hour, hourIndex, minute, minuteIndex, alarm, yMd, visible, pickerViewStyle, userinfo, getAlarm, handleType, init, setTime, handleHour, handleMinute, open, close, handleSubmit, onMounted: import_vue3.onMounted, ref: import_vue3.ref, reactive: import_vue3.reactive, getCurrentInstance: import_vue3.getCurrentInstance, watch: import_vue3.watch, computed: import_vue3.computed, get util() {
return util$1;
}, get api() {
return api;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$62(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_picker = (0, import_vue3.resolveComponent)("picker");
const _component_picker_view_column = (0, import_vue3.resolveComponent)("picker-view-column");
const _component_picker_view = (0, import_vue3.resolveComponent)("picker-view");
const _component_uni_popup = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue3.openBlock)(), (0, import_vue3.createBlock)(
_component_uni_popup,
{
ref: "time",
type: "bottom"
},
{
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("view", { class: "popBot plr60 bfff" }, [
(0, import_vue3.createElementVNode)("view", {
class: "close",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.time.close())
}, [
(0, import_vue3.createVNode)(_component_uni_icons, {
type: "close",
size: "36rpx",
color: "#333"
})
]),
(0, import_vue3.createCommentVNode)(" \u6807\u9898 "),
(0, import_vue3.createElementVNode)("view", { class: "title mtb40" }, [
(0, import_vue3.createVNode)(_component_picker, {
class: "df fdr jcc aic",
range: $setup.typeList,
onChange: $setup.handleType,
value: $setup.typeIndex,
"range-key": "name"
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "tac f40" },
(0, import_vue3.toDisplayString)($setup.typeList[$setup.typeIndex].name),
1
/* TEXT */
),
(0, import_vue3.createVNode)(_component_uni_icons, {
type: "right",
color: "#999",
size: "32rpx"
})
]),
_: 1
/* STABLE */
}, 8, ["range", "value"])
]),
(0, import_vue3.createCommentVNode)(" \u526F\u6807\u9898 "),
(0, import_vue3.createElementVNode)("view", { class: "" }, [
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "f32" },
"\u95F9\u949F\u63D0\u9192\u65F6\u95F4\uFF1A" + (0, import_vue3.toDisplayString)($setup.alarm || "\u672A\u8BBE\u7F6E"),
1
/* TEXT */
)
]),
(0, import_vue3.createCommentVNode)(" \u64CD\u4F5C\u53F0 "),
(0, import_vue3.createElementVNode)("view", { class: "oclockBox aic mtb25" }, [
(0, import_vue3.createElementVNode)("view", { class: "oclock" }, [
(0, import_vue3.createCommentVNode)(" \u9009\u62E9\u5668 "),
(0, import_vue3.createElementVNode)("view", { class: "f1" }, [
(0, import_vue3.createVNode)(_component_picker_view, {
class: "select f1",
value: [$setup.hourIndex],
"indicator-class": "option active",
"indicator-style": $setup.pickerViewStyle,
onChange: $setup.handleHour
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createVNode)(_component_picker_view_column, null, {
default: (0, import_vue3.withCtx)(() => [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.hour, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
key: index2,
class: "option fdr aic jcc"
}, [
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "text" },
(0, import_vue3.toDisplayString)(item),
1
/* TEXT */
),
index2 === $setup.hourIndex ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("u-text", {
key: 0,
class: "text"
}, "\u65F6")) : (0, import_vue3.createCommentVNode)("v-if", true)
]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}, 8, ["value", "indicator-style"])
]),
(0, import_vue3.createElementVNode)("view", { class: "jcc" }, [
(0, import_vue3.createElementVNode)("u-text", null, ":")
]),
(0, import_vue3.createElementVNode)("view", { class: "f1" }, [
(0, import_vue3.createVNode)(_component_picker_view, {
class: "select f1",
value: [$setup.minuteIndex],
"indicator-class": "option active",
"indicator-style": $setup.pickerViewStyle,
onChange: $setup.handleMinute
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createVNode)(_component_picker_view_column, null, {
default: (0, import_vue3.withCtx)(() => [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.minute, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
key: index2,
class: "option fdr aic jcc"
}, [
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "text" },
(0, import_vue3.toDisplayString)(item),
1
/* TEXT */
),
index2 === $setup.minuteIndex ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("u-text", {
key: 0,
class: "text"
}, "\u5206")) : (0, import_vue3.createCommentVNode)("v-if", true)
]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}, 8, ["value", "indicator-style"])
])
]),
(0, import_vue3.createCommentVNode)(" \u6587\u5B57\u63D0\u793A "),
(0, import_vue3.createElementVNode)("view", { class: "mt10" }, [
(0, import_vue3.createElementVNode)("u-text", { class: "c666 f20" }, "\u9884\u5148\u8BBE\u7F6E\u89C2\u5F71\u65F6\u95F4\uFF0C\u5230\u65F6\u81EA\u52A8\u63D0\u9192")
]),
(0, import_vue3.createElementVNode)("view", { class: "remark mtb30 ptb10 plr10 br20" }, [
(0, import_vue3.createElementVNode)("u-input", {
type: "text",
modelValue: $setup.remark,
onInput: _cache[1] || (_cache[1] = ($event) => $setup.remark = $event.detail.value),
placeholder: "\u8BBE\u7F6E\u95F9\u949F\u5907\u6CE8"
}, null, 40, ["modelValue"])
]),
(0, import_vue3.createElementVNode)("view", { class: "btns mtb25" }, [
(0, import_vue3.createElementVNode)("view", {
class: "button jcc confirm mtb10",
onClick: $setup.handleSubmit
}, [
(0, import_vue3.createElementVNode)("u-text", { class: "text" }, "\u786E\u8BA4")
]),
(0, import_vue3.createElementVNode)("view", {
class: "button jcc cancel mtb10",
onClick: _cache[2] || (_cache[2] = ($event) => $setup.close())
}, [
(0, import_vue3.createElementVNode)("u-text", { class: "text" }, "\u5173\u95ED")
])
])
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
);
}
var timeAlt = /* @__PURE__ */ _export_sfc(_sfc_main$62, [["render", _sfc_render$62], ["styles", [_style_0$62]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/components/index/time.vue"]]);
var _imports_0$12 = "/static/leftMenu1.png";
var _imports_1$1 = "/static/leftMenu2.png";
var _imports_2$1 = "/static/leftMenu3.png";
var _imports_32 = "/static/leftMenu5.png";
var _imports_42 = "/static/leftMenu6.png";
var _style_0$52 = { "leftMenuAlt": { "": { "width": "600rpx", "backgroundColor": "#F4F4F4" } } };
var _sfc_main$52 = {
__name: "leftMenu",
setup(__props, { expose: __expose }) {
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
(0, import_vue3.onMounted)(() => {
});
function open() {
proxy.$refs.leftMenu.open();
}
function close() {
proxy.$refs.leftMenu.close();
}
function getUserInfos(userRecommend) {
video.getUserInfo({
query: {
userRecommend
}
}).then((rs) => {
formatAppLog("log", "at components/index/leftMenu.vue:42", rs);
if (rs.data !== null) {
uni.navigateTo({
url: "/pages/index/beInvited?header=" + rs.data.userPortrait + "&userId=" + rs.data.userId + "&userNickname=" + rs.data.userNickname
});
}
});
}
function scanQRCode() {
util$1.scan();
}
function link(url) {
util$1.isAuth({
success: (rs) => {
uni.navigateTo({
url
});
}
});
}
__expose({
open,
close
});
const __returned__ = { proxy, open, close, getUserInfos, scanQRCode, link, onMounted: import_vue3.onMounted, ref: import_vue3.ref, reactive: import_vue3.reactive, getCurrentInstance: import_vue3.getCurrentInstance, watch: import_vue3.watch, get videoApi() {
return video;
}, statusBar, get util() {
return util$1;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$52(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_navigator = (0, import_vue3.resolveComponent)("navigator");
const _component_uni_popup = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue3.openBlock)(), (0, import_vue3.createBlock)(
_component_uni_popup,
{
ref: "leftMenu",
type: "left"
},
{
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("view", { class: "leftMenuAlt f1 plr30" }, [
(0, import_vue3.createCommentVNode)(" \u72B6\u6001\u6761 "),
(0, import_vue3.createVNode)($setup["statusBar"]),
(0, import_vue3.createCommentVNode)(" \u626B\u4E00\u626B "),
(0, import_vue3.createElementVNode)("view", { class: "df fdr jcr aic mtb30" }, [
(0, import_vue3.createVNode)(_component_uni_icons, {
type: "scan",
size: "40rpx"
}),
(0, import_vue3.createElementVNode)("u-text", {
class: "ml10 c333 f24",
onClick: $setup.scanQRCode
}, "\u626B\u4E00\u626B")
]),
(0, import_vue3.createCommentVNode)(" \u83DC\u5355\u5217\u8868 "),
(0, import_vue3.createElementVNode)("view", { class: "menuList mtb30 f1" }, [
(0, import_vue3.createElementVNode)("scroll-view", {
scrollY: "true",
class: "scroll f1",
showScrollbar: false
}, [
(0, import_vue3.createElementVNode)("view", { class: "list" }, [
(0, import_vue3.createVNode)(_component_navigator, {
url: "/pages/index/wallet",
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20",
"hover-class": "none"
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh80 mr25",
src: _imports_0$12,
mode: "aspectFit"
}),
(0, import_vue3.createElementVNode)("u-text", { class: "text f1 c333 f28" }, "\u6211\u7684\u94B1\u5305")
]),
_: 1
/* STABLE */
}),
(0, import_vue3.createVNode)(_component_navigator, {
url: "/pages/index/integralMall",
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20",
"hover-class": "none"
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh80 mr25",
src: _imports_1$1,
mode: "aspectFit"
}),
(0, import_vue3.createElementVNode)("u-text", { class: "text f1 c333 f28" }, "\u5377\u8F74\u79EF\u5206")
]),
_: 1
/* STABLE */
}),
(0, import_vue3.createVNode)(_component_navigator, {
url: "/pages/index/durian",
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20",
"hover-class": "none"
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh80 mr25",
src: _imports_2$1,
mode: "aspectFit"
}),
(0, import_vue3.createElementVNode)("u-text", { class: "text f1 c333 f28" }, "\u69B4\u83B2\u679C\u6811")
]),
_: 1
/* STABLE */
}),
(0, import_vue3.createElementVNode)("view", {
onClick: _cache[0] || (_cache[0] = ($event) => $setup.link("/pages/index/myTeam")),
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20"
}, [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh80 mr25",
src: _imports_32,
mode: "aspectFit"
}),
(0, import_vue3.createElementVNode)("u-text", { class: "text f1 c333 f28" }, "\u6211\u7684\u56E2\u961F")
]),
(0, import_vue3.createElementVNode)("view", {
onClick: _cache[1] || (_cache[1] = ($event) => $setup.link("/pages/index/myQrCode")),
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20"
}, [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh80 mr25",
src: _imports_42,
mode: "aspectFit"
}),
(0, import_vue3.createElementVNode)("u-text", { class: "text f1 c333 f28" }, "\u9080\u8BF7\u597D\u53CB\u5206\u4EABAPP")
]),
(0, import_vue3.createCommentVNode)(' \r\n \r\n \u5546\u5BB6\u5165\u9A7B\r\n '),
(0, import_vue3.createCommentVNode)(' \r\n \r\n \u8054\u7CFB\u5BA2\u670D\r\n \r\n\r\n \r\n \r\n \u4E5D\u4EBF\u6253\u8F66\r\n ')
])
])
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
);
}
var leftMenuAlt = /* @__PURE__ */ _export_sfc(_sfc_main$52, [["render", _sfc_render$52], ["styles", [_style_0$52]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/components/index/leftMenu.vue"]]);
var _style_0$42 = { "discBox": { "": { "alignItems": "flex-end", "justifyContent": "flex-end" } }, "disc": { ".discBox ": { "width": "110rpx", "height": "110rpx" } }, "image": { ".discBox .disc ": { "width": "90rpx", "height": "90rpx", "borderRadius": 50, "boxShadow": "0 0 10rpx rgba(255, 255, 0, 0.8)" } } };
var _sfc_main$42 = {
__name: "disc",
setup(__props, { expose: __expose }) {
const rotate = (0, import_vue3.ref)(0);
const timer = (0, import_vue3.ref)(null);
const limitTime = (0, import_vue3.ref)(5);
const step = (0, import_vue3.ref)(0.05);
const playState = (0, import_vue3.ref)(false);
const discStyle = (0, import_vue3.computed)(() => {
let result = {
transform: `rotate(${rotate.value}deg)`
};
return result;
});
const userinfo = (0, import_vue3.computed)(() => {
let result = uni.$store.state.userinfo;
return result;
});
(0, import_vue3.onMounted)(() => {
});
function play() {
if (playState.value)
return;
timer.value = setInterval(() => {
if (rotate.value >= 360) {
rotate.value = 0;
}
rotate.value += 360 / limitTime.value * (step.value / 1);
}, step.value * 1e3);
playState.value = true;
}
function pause() {
if (!playState.value)
return;
clearInterval(timer.value);
timer.value = null;
playState.value = false;
}
function handleDisc() {
uni.navigateTo({
url: "/pages/index/durian"
});
}
__expose({
play,
pause
});
const __returned__ = { rotate, timer, limitTime, step, playState, discStyle, userinfo, play, pause, handleDisc, computed: import_vue3.computed, onMounted: import_vue3.onMounted, reactive: import_vue3.reactive, ref: import_vue3.ref };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$42(_ctx, _cache, $props, $setup, $data, $options) {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
[
(0, import_vue3.createCommentVNode)(" cd\u5531\u7247 "),
(0, import_vue3.createElementVNode)("view", { class: "discBox" }, [
(0, import_vue3.createElementVNode)(
"view",
{
class: "disc fmid",
style: (0, import_vue3.normalizeStyle)($setup.discStyle),
onClick: $setup.handleDisc
},
[
(0, import_vue3.createElementVNode)("u-image", {
class: "image wh100 cir",
src: $setup.userinfo.userPortrait,
mode: "aspectFill"
}, null, 8, ["src"])
],
4
/* STYLE */
)
])
],
2112
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
);
}
var disc = /* @__PURE__ */ _export_sfc(_sfc_main$42, [["render", _sfc_render$42], ["styles", [_style_0$42]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/components/index/disc.vue"]]);
var _style_0$32 = { "menuAlt": { "": { "backgroundColor": "#f2f2f2", "borderTopLeftRadius": "30rpx", "borderTopRightRadius": "30rpx", "borderBottomRightRadius": 0, "borderBottomLeftRadius": 0 } }, "line": { ".menuAlt .listArea .line+": { "borderTopWidth": "2rpx", "borderTopStyle": "solid", "borderTopColor": "#eeeeee" } }, "text": { ".speed .item ": { "color": "#999999", "transitionDuration": 300 }, ".speed .item.active ": { "color": "#1c1c1c" } }, "@TRANSITION": { "text": { "duration": 300 } } };
var _sfc_main$32 = {
__name: "moreMenu",
props: {
// 是否我自己 0不是 1是
isMine: {
type: [String, Number],
default: 0
}
},
emits: ["changeSpeed"],
setup(__props, { expose: __expose, emit: __emit }) {
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
const props = __props;
const emit = __emit;
const speed = (0, import_vue3.reactive)([
{
name: "0.5",
value: 0.5
},
{
name: "\u6B63\u5E38",
value: 1
},
{
name: "1.25",
value: 1.25
},
{
name: "1.5",
value: 1.5
},
{
name: "2",
value: 2
}
]);
const speedIndex = (0, import_vue3.ref)(1);
const videoDetail = (0, import_vue3.reactive)({});
(0, import_vue3.onMounted)(() => {
});
function open(item) {
Object.assign(videoDetail, {}, item);
speedIndex.value = speed.findIndex((node) => node.value == item.speed);
proxy.$refs.menu.open();
}
function close() {
Object.assign(videoDetail, {});
proxy.$refs.menu.close();
}
function link(url) {
util$1.isLogin().then((rs) => {
uni.navigateTo({
url
});
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
close();
}
function handleSpeed(item) {
emit("changeSpeed", item);
close();
}
__expose({
open,
close
});
const __returned__ = { proxy, props, emit, speed, speedIndex, videoDetail, open, close, link, handleSpeed, onMounted: import_vue3.onMounted, reactive: import_vue3.reactive, getCurrentInstance: import_vue3.getCurrentInstance, ref: import_vue3.ref, get util() {
return util$1;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$32(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_uni_popup = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue3.openBlock)(), (0, import_vue3.createBlock)(
_component_uni_popup,
{
ref: "menu",
type: "bottom"
},
{
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createCommentVNode)(" "),
(0, import_vue3.createElementVNode)("view", { class: "menuAlt" }, [
(0, import_vue3.createElementVNode)("view", { class: "header df jcr fdr ptb10 plr10" }, [
(0, import_vue3.createVNode)(_component_uni_icons, {
type: "closeempty",
onClick: $setup.close
})
]),
(0, import_vue3.createElementVNode)("view", { class: "listArea mtb30 mlr30 plr30 bfff" }, [
(0, import_vue3.createElementVNode)("view", { class: "line rows fdr ptb30" }, [
(0, import_vue3.createElementVNode)("u-text", { class: "key f1 c111 f28" }, "\u500D\u901F"),
(0, import_vue3.createElementVNode)("view", { class: "value speed df jcsb fdr f1 pl30" }, [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.speed, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
class: (0, import_vue3.normalizeClass)(["item", { "active": $setup.speedIndex == index2 }]),
key: index2,
onClick: ($event) => $setup.handleSpeed(item)
}, [
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "text f28" },
(0, import_vue3.toDisplayString)(item.name),
1
/* TEXT */
)
], 10, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
])
]),
$props.isMine == 0 ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
key: 0,
class: "line rows fdr ptb30",
onClick: _cache[0] || (_cache[0] = ($event) => $setup.link($setup.util.setUrl("/pages/index/report", { userId: $setup.videoDetail.userId })))
}, [
(0, import_vue3.createElementVNode)("u-text", { class: "key f1 c111 f28" }, "\u4E3E\u62A5\u4F5C\u8005"),
(0, import_vue3.createElementVNode)("view", { class: "value f1 ml30" })
])) : (0, import_vue3.createCommentVNode)("v-if", true)
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
);
}
var moreMenu = /* @__PURE__ */ _export_sfc(_sfc_main$32, [["render", _sfc_render$32], ["styles", [_style_0$32]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/components/index/moreMenu.vue"]]);
var _style_0$22 = { "collectListBox": { "": { "position": "fixed", "width": "300rpx", "paddingTop": "10rpx", "paddingRight": "10rpx", "paddingBottom": "10rpx", "paddingLeft": "10rpx", "backgroundColor": "rgba(51,51,51,0.5)", "borderRadius": "25rpx", "transitionProperty": "width", "transitionDuration": 500 }, ".active": { "width": "300rpx" } }, "create": { ".collectListBox ": { "backgroundColor": "rgba(255,255,255,0.5)" } }, "item": { ".collectListBox .item+": { "marginLeft": "15rpx" } }, "@TRANSITION": { "collectListBox": { "property": "width", "duration": 500 } } };
var _sfc_main$22 = {
__name: "fastCollect",
setup(__props, { expose: __expose }) {
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
const detail = (0, import_vue3.ref)({});
const position = (0, import_vue3.ref)({});
const listProperty = (0, import_vue3.reactive)({
// 数据
data: [],
// 条数
pageSize: 10,
// 页码
pageNum: 1,
// 总数
total: 0
});
const active = (0, import_vue3.ref)(false);
(0, import_vue3.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: {
// 私密
isPrivate: 1,
// 页码
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 open(ev) {
position.value = ev.position;
active.value = true;
detail.value = ev.item;
proxy.$refs.fastCollect.open();
}
function close() {
active.value = false;
proxy.$refs.fastCollect.close();
}
function handleCollect(item) {
api.video.collectVideo({
query: {
// 视频id
videoId: detail.value.videoId,
// 收藏夹id
collectId: item.id,
isPrivate: item.isPrivate
}
}).then((rs) => {
if (rs.code == 200) {
proxy.$refs.fastCollect.close();
detail.value.isCollect = true;
detail.value.collect++;
uni.$emit("updateVideo", detail.value);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
__expose({
open,
close
});
const __returned__ = { proxy, detail, position, listProperty, active, addListener, refrshList, getMoreList, getList, open, close, handleCollect, onMounted: import_vue3.onMounted, reactive: import_vue3.reactive, ref: import_vue3.ref, getCurrentInstance: import_vue3.getCurrentInstance, get api() {
return api;
}, get util() {
return util$1;
}, collectAdd };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$22(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_uni_transition = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-transition"), __easycom_1$2);
const _component_uni_popup = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
[
(0, import_vue3.createVNode)(
_component_uni_popup,
{
ref: "fastCollect",
type: "center",
animation: false
},
{
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)(
"view",
{
class: "collectListBox",
style: (0, import_vue3.normalizeStyle)({ top: $setup.position.y + "px", right: $setup.position.x + "px" })
},
[
(0, import_vue3.createVNode)(_component_uni_transition, {
"mode-class": "slide-right",
show: $setup.active
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)(
"scroll-view",
{
scrollX: "true",
showScrollbar: false,
class: "scroll df fdr f1",
onScrolltolower: $setup.getMoreList
},
[
(0, import_vue3.createElementVNode)("view", { class: "list fdr plr15" }, [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.listProperty.data, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
class: "item wh70 br20",
key: index2,
onClick: ($event) => $setup.handleCollect(item)
}, [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh70 br20",
src: item.formatPic,
mode: "aspectFill"
}, null, 8, ["src"])
], 8, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
)),
(0, import_vue3.createElementVNode)("view", {
class: "item create fmid ml15 wh70 br20",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.collectAddRef.open())
}, [
(0, import_vue3.createVNode)(_component_uni_icons, {
type: "plusempty",
color: "#fff",
size: "40rpx"
})
])
])
],
32
/* NEED_HYDRATION */
)
]),
_: 1
/* STABLE */
}, 8, ["show"])
],
4
/* STYLE */
)
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
),
(0, import_vue3.createCommentVNode)(" \u65B0\u589E\u6536\u85CF "),
(0, import_vue3.createVNode)(
$setup["collectAdd"],
{ ref: "collectAddRef" },
null,
512
/* NEED_PATCH */
)
],
64
/* STABLE_FRAGMENT */
);
}
var fastCollect = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["render", _sfc_render$22], ["styles", [_style_0$22]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/components/index/fastCollect.vue"]]);
var _style_0$12 = { "close": { "": { "position": "absolute", "top": "20rpx", "left": "20rpx" } }, "main": { "": { "marginTop": "120rpx" } }, "txt": { ".main ": { "textAlign": "center" } }, "button": { "": { "marginTop": 0, "marginRight": "120rpx", "marginBottom": 0, "marginLeft": "120rpx" } } };
var _sfc_main$12 = {
__name: "teen",
emits: ["setting"],
setup(__props, { expose: __expose, emit: __emit }) {
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
const emit = __emit;
function open() {
proxy.$refs.teen.open();
}
function close() {
proxy.$refs.teen.close();
}
function handleSetting() {
proxy.$refs.teen.close();
emit("setting");
}
__expose({
open,
close
});
const __returned__ = { proxy, emit, open, close, handleSetting, ref: import_vue3.ref, getCurrentInstance: import_vue3.getCurrentInstance };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-icons"), __easycom_0);
const _component_uni_popup = resolveEasycom((0, import_vue3.resolveDynamicComponent)("uni-popup"), __easycom_1$1);
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", { renderWhole: true }, [
(0, import_vue3.createVNode)(
_component_uni_popup,
{
ref: "teen",
type: "bottom"
},
{
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("view", { class: "teenAlt popBot ptb30 bfff" }, [
(0, import_vue3.createElementVNode)("view", { class: "close" }, [
(0, import_vue3.createVNode)(_component_uni_icons, {
type: "closeempty",
onClick: _cache[0] || (_cache[0] = ($event) => $setup.close()),
size: "40rpx"
})
]),
(0, import_vue3.createElementVNode)("view", { class: "main mlr30" }, [
(0, import_vue3.createElementVNode)("u-text", { class: "txt c333 f34" }, "\u4E3A\u5475\u62A4\u672A\u6210\u5E74\u4EBA\u5065\u5EB7\u6210\u957F\uFF0C\u4E5D\u4EBF\u63A8\u51FA\u9752\u5C11\u5E74\u6A21\u5F0F\u3002\u8BE5\u6A21\u5F0F\u4E0B\u8BBE\u7F6E\u95F9\u94C3\u9650\u5236\u89C2\u770B\u65F6\u95F4\uFF0C\u8BF7\u76D1\u62A4\u4EBA\u4E3B\u52A8\u8BBE\u7F6E\u3002")
]),
(0, import_vue3.createElementVNode)("view", { class: "button btn black mt60 mb30" }, [
(0, import_vue3.createElementVNode)("u-text", {
class: "txt tac cfff",
onClick: $setup.handleSetting
}, "\u8BBE\u7F6E")
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
]);
}
var teen = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$12], ["styles", [_style_0$12]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/components/index/teen.vue"]]);
var _imports_02 = "/static/indexList.png";
var _imports_12 = "/static/indexSearch.png";
var _imports_22 = "/static/indexOclock.png";
var _style_02 = { "page": { "": { "backgroundColor": "#161616" } }, "top": { "": { "zIndex": 10 } }, "list": { ".tab ": { "marginTop": 0, "marginRight": "20rpx", "marginBottom": 0, "marginLeft": "20rpx" } }, "text": { ".tab .list.active ": { "color": "#ffffff" }, ".tab .list ": { "color": "rgba(255,255,255,0.7)" } }, "line": { ".tab .list.active ": { "opacity": 1 }, ".tab .list ": { "marginTop": 0, "marginRight": "10rpx", "marginBottom": 0, "marginLeft": "10rpx", "height": "5rpx", "backgroundColor": "#ffffff", "opacity": 0 } }, "oclockHint": { "": { "backgroundColor": "rgba(0,0,0,0.3)" } }, "image": { ".oclockHint ": { "marginTop": "300rpx", "width": "750rpx" } }, "disc": { "": { "marginRight": "20rpx" } } };
var _sfc_main2 = {
__name: "index",
setup(__props, { expose: __expose }) {
__expose();
const {
proxy
} = (0, import_vue3.getCurrentInstance)();
const dom22 = requireNativePlugin("dom");
const oclockWindow = (0, import_vue3.ref)(false);
const readSecond = (0, import_vue3.reactive)({
// 单个视频最大
max: 20,
// 累计
count: 0,
// 总数
total: 0,
// 总数最大
totalMax: 300,
// 定时器
timer: null
});
const tab = (0, import_vue3.reactive)([
// {
// name: '同城',
// },
{
name: "\u5173\u6CE8",
load: false,
listData: () => attList.data,
getList: () => getAttList(),
getMoreList: () => getMoreAttList(),
refreshList: () => refreshAttList()
},
{
name: "\u63A8\u8350",
load: false,
listData: () => recList.data,
getList: () => getRecList(),
getMoreList: () => getMoreRecList(),
refreshList: () => refreshRecList()
}
]);
const tabIndex = (0, import_vue3.ref)(1);
const startY = (0, import_vue3.ref)(0);
const currentLast = (0, import_vue3.reactive)([0, 0]);
const current = (0, import_vue3.reactive)([0, 0]);
const recList = (0, import_vue3.reactive)({
data: [],
pageNum: 1,
total: 0,
homePageSize: 7,
shopPageSize: 2,
otherPageSize: 1
});
const attList = (0, import_vue3.reactive)({
data: [],
pageSize: 10,
pageNum: 1,
total: 0,
timer: null
});
const viewHeight = (0, import_vue3.ref)(0);
const viewWidth = (0, import_vue3.ref)(0);
const discOffsetTop = (0, import_vue3.ref)(0);
const userinfo = (0, import_vue3.computed)(() => {
let result = uni.$store.state.userinfo || {};
return result;
});
const tabCurrent = (0, import_vue3.computed)(() => {
let result = tab[tabIndex.value];
return result;
});
const currentVideoRef = (0, import_vue3.computed)(() => {
let result = proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]];
return result;
});
onLoad(() => {
const systemInfo = uni.getSystemInfoSync();
discOffsetTop.value = systemInfo.safeAreaInsets.top + 44 + 10;
if (!uni.getStorageSync("alarmAlt")) {
setTimeout(() => {
oclockWindow.value = true;
}, 1e3);
}
tabCurrent.value.getList();
util$1.isLogin().then((rs) => {
getTask();
if (userinfo.value.youth != 1) {
setTimeout(() => {
proxy.$refs.teenRef.open();
}, 2e3);
}
});
uni.$on("login", () => {
tabCurrent.value.refreshList();
getTask();
});
uni.$on("logout", () => {
tabCurrent.value.refreshList();
});
uni.$on("updateVideo", (item) => {
if (!item && !item.videoId)
return;
const list = tabCurrent.value.listData();
const findIndex = list.findIndex((node) => node.videoId == item.videoId);
if (findIndex >= 0)
list.splice(findIndex, 1, __spreadValues(__spreadValues({}, tabCurrent.value.listData()[findIndex]), item));
});
uni.$on("focusUser", (param2) => {
if (!param2.userId)
return;
refreshAttList();
for (var index2 = 0; index2 < recList.data.length; i++) {
const item = recList.data[index2];
if (item.userId == param2.userId) {
item.isAttention = param2.result;
recList.data.splice(index2, 1, item);
}
}
});
});
onReady(() => {
dom22.getComponentRect(proxy.$refs.containerRef[0], (option) => {
viewHeight.value = option.size.height;
viewWidth.value = option.size.width;
});
});
onShow(() => {
uni.$emit("changeMine", "default");
});
onHide(() => {
proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause();
});
onUnload(() => {
uni.$off("login");
uni.$off("logout");
uni.$off("updateVideo");
uni.$off("focusUser");
});
function getTask() {
api.video.viewingTasks().then((rs) => {
if (rs.code == 200) {
const result = rs.data;
if (!result)
return;
if (result)
readSecond.total = Number(result.seconds) || 0;
return;
}
});
}
function readSecondAdd() {
clearInterval(readSecond.timer);
if (readSecond.total >= readSecond.totalMax)
return;
readSecond.timer = setInterval(() => {
if (readSecond.count > readSecond.max) {
readSecond.total += readSecond.count;
readSecond.count = 0;
if (readSecond.total >= readSecond.totalMax) {
return;
}
clearInterval(readSecond.timer);
} else
readSecond.count++;
}, 1e3);
}
function readSecondPause() {
clearInterval(readSecond.timer);
}
function refreshAttList() {
attList.pageNum = 1;
attList.total = 0;
getAttList();
}
function getMoreAttList() {
if (attList.total <= attList.data.length)
return;
attList.pageNum++;
getAttList();
}
function getAttList() {
api.video.followVideo({
query: {
pageSize: attList.pageSize,
pageNum: attList.pageNum
}
}).then((rs) => {
if (rs.code == 200) {
attList.data.push(...rs.rows.map((item) => {
item.format_videoUrl = util$1.format_url(item.videoUrl, "video");
item.format_header = util$1.format_url(item.header, "img");
return item;
}));
attList.total = rs.total;
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function refreshRecList() {
recList.pageNum = 1;
recList.total = 0;
getRecList();
}
function getMoreRecList() {
if (recList.total <= recList.data.length)
return;
recList.pageNum++;
getRecList();
}
function getRecList() {
Promise.all([getHomeVideo(), getShopVideo(), getOtherVideo()]).then((rs) => {
const list = rs.reduce((last, now) => last.concat(now.rows), []).sort(() => Math.random() - 0.5);
recList.total = rs.reduce((last, now) => last + now.total, 0);
if (recList.pageNum == 1)
recList.data.length = 0;
recList.data.push(...list.map((item) => {
item.format_videoUrl = util$1.format_url(item.videoUrl, "video");
item.format_imageUrl = util$1.format_url(item.imageUrl, "img");
item.format_header = util$1.format_url(item.header, "img");
item.speed = 1;
return item;
}));
formatAppLog("log", "at pages/index/index.nvue:346", "result", recList.data, rs);
if (recList.total > 1 && recList.data.length <= 1)
getMoreRecList();
setTimeout(() => {
const pages = getCurrentPages();
if (pages[pages.length - 1].route == "pages/index/index") {
proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].playState.value = true;
proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].play();
}
}, 50);
}).catch((rs) => {
formatAppLog("log", "at pages/index/index.nvue:360", "index catch", rs);
});
}
function getHomeVideo() {
return new Promise((resolve, reject) => {
api.video.homeVideo({
query: {
userId: userinfo.value.userId || "",
pageNum: recList.pageNum,
pageSize: recList.homePageSize
}
}).then((rs) => {
if (rs.code == 200) {
resolve(rs);
return;
}
reject(rs);
util$1.alert({
content: rs.msg,
showCancel: false
});
});
});
}
function getShopVideo() {
return new Promise((resolve, reject) => {
api.video.businessHomeVideo({
query: {
userId: userinfo.value.userId || "",
pageNum: recList.pageNum,
pageSize: recList.shopPageSize
}
}).then((rs) => {
if (rs.code == 200) {
resolve(rs);
return;
}
reject(rs);
util$1.alert({
content: rs.msg,
showCancel: false
});
});
});
}
function getOtherVideo() {
return new Promise((resolve, reject) => {
api.video.otherHomeVideo({
query: {
userId: userinfo.value.userId || "",
pageNum: recList.pageNum,
pageSize: recList.otherPageSize
}
}).then((rs) => {
if (rs.code == 200) {
resolve(rs);
return;
}
reject(rs);
util$1.alert({
content: rs.msg,
showCancel: false
});
});
});
}
function scrollTo(target) {
const tab_index = tabIndex.value;
const element = proxy.$refs[`cellRef${tab_index}`][target];
const lastVideoRef = proxy.$refs[`videoRef${tab_index}`][currentLast[tab_index]];
dom22.scrollToElement(element, {
animated: true
});
if (current[tab_index] != currentLast[tab_index]) {
(0, import_vue3.nextTick)(() => {
lastVideoRef.playState.value = false;
lastVideoRef.pause();
proxy.$refs[`videoRef${tab_index}`][current[tab_index]].playState.value = true;
proxy.$refs[`videoRef${tab_index}`][current[tab_index]].play();
});
readSecondPause();
browseLog(lastVideoRef);
readSecond.total += readSecond.count;
if (readSecond.total < readSecond.totalMax)
readSecondAdd();
}
}
function onTouchstart(ev, index2) {
Object.assign(currentLast, current);
startY.value = ev.changedTouches[0].screenY;
}
function onTouchend(ev, index2) {
const endY = ev.changedTouches[0].screenY;
const list = tabCurrent.value.listData();
if (!list[0])
return;
if (endY - startY.value < -50) {
if (current[index2] < list.length - 1)
current[index2]++;
scrollTo(current[index2]);
} else if (endY - startY.value > 50) {
if (current[index2] > 0)
current[index2]--;
scrollTo(current[index2]);
} else if (endY - startY.value == 0)
;
else {
scrollTo(current[index2]);
}
}
function handle_tab(index2) {
if (tabIndex.value === index2)
return;
if (tab[index2].name == "\u5173\u6CE8" && !userinfo.value.userId) {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
return;
}
if (proxy.$refs[`videoRef${tabIndex.value}`]) {
const lastVideoRef = proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]];
lastVideoRef.pause();
readSecondPause();
browseLog(lastVideoRef);
readSecond.total += readSecond.count;
if (readSecond.total < readSecond.totalMax)
readSecondAdd();
}
tabIndex.value = index2;
if (tabCurrent.value.load && proxy.$refs[`videoRef${index2}`])
proxy.$refs[`videoRef${index2}`][current[index2]].play();
else
tabCurrent.value.getList();
tab[tabIndex.value].load = true;
}
function handleShowTime() {
proxy.$refs.timeRef.open();
}
function handleShowCommentAlt(item) {
proxy.$refs.commentRef.open(item);
currentVideoRef.value.pause();
}
function handleShowCollectAlt(item) {
proxy.$refs.collectRef.open(item);
}
function handleShowFastCollect(ev) {
proxy.$refs.fastCollectRef.open(ev);
}
function handleShowShareFirend(item) {
proxy.$refs.shareFirendRef.open(item);
}
function handleVideoOnPlay() {
if (proxy.$refs.discRef)
proxy.$refs.discRef.play();
if (readSecond.total < readSecond.totalMax)
readSecondAdd();
}
function handleVideoOnPause() {
if (proxy.$refs.discRef)
proxy.$refs.discRef.pause();
readSecondPause();
}
function browseLog(element) {
util$1.isLogin().then((rs) => {
if (readSecond.count == 0)
return;
api.video.browseLog({
query: {
videoId: element.item.videoId,
seconds: readSecond.count
}
}).then((rs2) => {
if (rs2.code != 200) {
formatAppLog("log", "at pages/index/index.nvue:615", "browseLog err", rs2);
}
});
});
}
function videoLike(param2) {
const {
index: index2,
isLike
} = param2;
const item = tabCurrent.value.listData()[index2];
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++;
uni.$emit("updateVideo", item);
return;
}
util$1.alert({
content: rs.msg,
showCancel: false
});
});
}
function setAlarm() {
oclockWindow.value = false;
uni.setStorageSync("alarmAlt", true);
}
function showLeftMenu() {
util$1.isLogin().then((rs) => {
proxy.$refs.leftMenuRef.open();
}).catch(() => {
uni.navigateTo({
url: "/pages/login/loginPhone"
});
});
}
function handleSpeed(item) {
const speed = item.value;
const tab_index = tabIndex.value;
proxy.$refs[`videoRef${tab_index}`][current[tab_index]].videoCtx().playbackRate(speed);
tabCurrent.value.listData()[current[tab_index]].speed = speed;
}
function onTimeUpdate(event) {
videoTime.value = __spreadProps(__spreadValues({}, event.videoTime), {
videoCurrentTime: event.videoCurrentTime
});
}
function showAlarm() {
proxy.$refs.timeRef.open();
}
const __returned__ = { proxy, dom: dom22, oclockWindow, readSecond, tab, tabIndex, startY, currentLast, current, recList, attList, viewHeight, viewWidth, discOffsetTop, userinfo, tabCurrent, currentVideoRef, getTask, readSecondAdd, readSecondPause, refreshAttList, getMoreAttList, getAttList, refreshRecList, getMoreRecList, getRecList, getHomeVideo, getShopVideo, getOtherVideo, scrollTo, onTouchstart, onTouchend, handle_tab, handleShowTime, handleShowCommentAlt, handleShowCollectAlt, handleShowFastCollect, handleShowShareFirend, handleVideoOnPlay, handleVideoOnPause, browseLog, videoLike, setAlarm, showLeftMenu, handleSpeed, onTimeUpdate, showAlarm, ref: import_vue3.ref, reactive: import_vue3.reactive, getCurrentInstance: import_vue3.getCurrentInstance, computed: import_vue3.computed, nextTick: import_vue3.nextTick, get onLoad() {
return onLoad;
}, get onReady() {
return onReady;
}, get onHide() {
return onHide;
}, get onShow() {
return onShow;
}, get onUnload() {
return onUnload;
}, get util() {
return util$1;
}, get api() {
return api;
}, statusBar, indexVideo, footerMneu: __easycom_02, timeAlt, commentAlt, collectAlt, shareFirendAlt, leftMenuAlt, disc, moreMenu, fastCollect, teen };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render2(_ctx, _cache, $props, $setup, $data, $options) {
const _component_navigator = (0, import_vue3.resolveComponent)("navigator");
const _component_footerMenu = resolveEasycom((0, import_vue3.resolveDynamicComponent)("footerMenu"), __easycom_02);
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.createCommentVNode)(" \u9875\u9762\u5185\u5BB9 "),
(0, import_vue3.createElementVNode)("view", { class: "page pr f1" }, [
(0, import_vue3.createCommentVNode)(" \u9876\u90E8\u5185\u5BB9 "),
(0, import_vue3.createElementVNode)("view", { class: "top pf t0 l0 r0" }, [
(0, import_vue3.createVNode)($setup["statusBar"]),
(0, import_vue3.createElementVNode)("view", { class: "menu head fdr jcsa aic plr40" }, [
(0, import_vue3.createElementVNode)("view", {
class: "sider",
onClick: $setup.showLeftMenu
}, [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh40",
src: _imports_02,
mode: "aspectFit"
})
]),
(0, import_vue3.createElementVNode)("view", { class: "f1" }, [
((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
class: "tab fdr jcc",
key: $setup.tabIndex
}, [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.tab, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("view", {
class: (0, import_vue3.normalizeClass)(["list", [{ "active": index2 === $setup.tabIndex }]]),
key: index2,
onClick: (0, import_vue3.withModifiers)(($event) => $setup.handle_tab(index2), ["stop"])
}, [
(0, import_vue3.createElementVNode)("view", { class: "txt" }, [
(0, import_vue3.createElementVNode)(
"u-text",
{ class: "text" },
(0, import_vue3.toDisplayString)(item.name),
1
/* TEXT */
)
]),
(0, import_vue3.createElementVNode)("view", { class: "line" })
], 10, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
]))
]),
(0, import_vue3.createVNode)(_component_navigator, {
url: "/pages/index/search",
class: "search"
}, {
default: (0, import_vue3.withCtx)(() => [
(0, import_vue3.createElementVNode)("u-image", {
class: "wh65",
src: _imports_12,
mode: "aspectFit"
})
]),
_: 1
/* STABLE */
})
])
]),
(0, import_vue3.createCommentVNode)(" \u6709\u6548\u8BFB\u79D2\u5531\u7247 "),
$setup.userinfo.userId ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
"view",
{
key: 0,
class: "disc pf r0",
style: (0, import_vue3.normalizeStyle)({ top: $setup.discOffsetTop + "px" })
},
[
(0, import_vue3.createVNode)(
$setup["disc"],
{ ref: "discRef" },
null,
512
/* NEED_PATCH */
)
],
4
/* STYLE */
)) : (0, import_vue3.createCommentVNode)("v-if", true),
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)($setup.tab, (item, index2) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
{ key: index2 },
[
$setup.tabIndex == index2 ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
"view",
{
key: 0,
class: "f1",
ref_for: true,
ref: "containerRef"
},
[
(0, import_vue3.createCommentVNode)(" \u4E3B\u8981\u5185\u5BB9\u533A\u57DF "),
(0, import_vue3.createElementVNode)("list", {
class: "container f1",
showScrollbar: false,
onTouchstart: ($event) => $setup.onTouchstart($event, index2),
onTouchend: ($event) => $setup.onTouchend($event, index2),
onLoadmore: item.getMoreList
}, [
((0, import_vue3.openBlock)(true), (0, import_vue3.createElementBlock)(
import_vue3.Fragment,
null,
(0, import_vue3.renderList)(item.listData(), (secItem, secIndex) => {
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
"cell",
{
class: "cell",
style: (0, import_vue3.normalizeStyle)([{ height: $setup.viewHeight + "px" }]),
ref_for: true,
ref: `cellRef` + index2,
key: secIndex,
onClick: _cache[0] || (_cache[0] = (0, import_vue3.withModifiers)(() => {
}, ["stop"]))
},
[
(0, import_vue3.createCommentVNode)(" \u89C6\u9891 "),
(0, import_vue3.createVNode)($setup["indexVideo"], {
ref_for: true,
ref: "videoRef" + index2,
tabIndex: index2,
current: $setup.current[index2],
item: secItem,
index: secIndex,
onShowTime: $setup.handleShowTime,
onShowComment: $setup.handleShowCommentAlt,
onShowCollect: $setup.handleShowCollectAlt,
onShowShareFirend: $setup.handleShowShareFirend,
onOnPlay: $setup.handleVideoOnPlay,
onOnPause: $setup.handleVideoOnPause,
onLike: $setup.videoLike,
onLongtap: ($event) => _ctx.$refs.moreMenuRef.open(secItem),
onShowFastCollect: $setup.handleShowFastCollect,
viewWidth: $setup.viewWidth
}, null, 8, ["tabIndex", "current", "item", "index", "onLongtap", "viewWidth"])
],
4
/* STYLE */
);
}),
128
/* KEYED_FRAGMENT */
))
], 40, ["onTouchstart", "onTouchend", "onLoadmore"])
],
512
/* NEED_PATCH */
)) : (0, import_vue3.createCommentVNode)("v-if", true)
],
64
/* STABLE_FRAGMENT */
);
}),
128
/* KEYED_FRAGMENT */
)),
(0, import_vue3.createCommentVNode)(" \u8BA1\u65F6\u63D0\u793A "),
$setup.oclockWindow ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
"view",
{
key: 1,
class: "oclockHint pa pfull fmid",
onTouchstart: _cache[1] || (_cache[1] = (0, import_vue3.withModifiers)(() => {
}, ["stop"])),
onClick: (0, import_vue3.withModifiers)($setup.setAlarm, ["stop"])
},
[
(0, import_vue3.createElementVNode)("u-image", {
class: "image",
src: _imports_22,
mode: "widthFix"
})
],
32
/* NEED_HYDRATION */
)) : (0, import_vue3.createCommentVNode)("v-if", true),
(0, import_vue3.createCommentVNode)(" \u5E95\u90E8\u5BFC\u822A "),
(0, import_vue3.createVNode)(
_component_footerMenu,
{
ref: "footerMenuRef",
page: "index",
subject: "dark"
},
null,
512
/* NEED_PATCH */
)
]),
(0, import_vue3.createCommentVNode)(" \u5FEB\u6377\u6536\u85CF "),
(0, import_vue3.createVNode)(
$setup["fastCollect"],
{ ref: "fastCollectRef" },
null,
512
/* NEED_PATCH */
),
(0, import_vue3.createCommentVNode)(" \u957F\u6309\u83DC\u5355 "),
(0, import_vue3.createVNode)(
$setup["moreMenu"],
{
ref: "moreMenuRef",
onChangeSpeed: $setup.handleSpeed
},
null,
512
/* NEED_PATCH */
),
(0, import_vue3.createCommentVNode)(" \u95F9\u949F\u5F39\u7A97 "),
(0, import_vue3.createVNode)(
$setup["timeAlt"],
{ ref: "timeRef" },
null,
512
/* NEED_PATCH */
),
(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 */
),
(0, import_vue3.createCommentVNode)(" \u5DE6\u4FA7\u83DC\u5355\u5F39\u7A97 "),
(0, import_vue3.createVNode)(
$setup["leftMenuAlt"],
{ ref: "leftMenuRef" },
null,
512
/* NEED_PATCH */
),
(0, import_vue3.createCommentVNode)(" \u9752\u5C11\u5E74\u6A21\u5F0F "),
(0, import_vue3.createVNode)(
$setup["teen"],
{
ref: "teenRef",
onSetting: $setup.showAlarm
},
null,
512
/* NEED_PATCH */
)
]);
}
var index = /* @__PURE__ */ _export_sfc(_sfc_main2, [["render", _sfc_render2], ["styles", [_style_02]], ["__file", "D:/document/\u4E5D\u4EBF\u5546\u57CE/jy/jiuyi/pages/index/index.nvue"]]);
//
var webview = plus.webview.currentWebview();
if (webview) {
const __pageId = parseInt(webview.id);
const __pagePath = "pages/index/index";
let __pageQuery = {};
try {
__pageQuery = JSON.parse(webview.__query__);
} catch (e) {
}
index.mpType = "page";
const app = Vue.createPageApp(index, { $store: getApp({ allowDefault: true }).$store, __pageId, __pagePath, __pageQuery });
app.provide("__globalStyles", Vue.useCssStyles([...__uniConfig.styles, ...index.styles || []]));
app.mount("#root");
}
})();