jiuyiUniapp/jiuyi/unpackage/dist/dev/.nvue/pages/index/index.js

2360 lines
82 KiB
JavaScript
Raw Normal View History

2024-12-18 15:46:27 +08:00
import { r as requireNativePlugin, a as resolveEasycom, f as formatAppLog, o as onLoad, b as onReady, c as onShow, d as onHide, e as onUnload } from "../../uni-app.es.js";
import { openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, renderSlot, createCommentVNode, getCurrentInstance, computed, ref, onMounted, onUnmounted, resolveDynamicComponent, Fragment, renderList, toDisplayString, createVNode, withCtx, createBlock, reactive, resolveComponent, watch, withModifiers, nextTick } from "vue";
import { _ as _export_sfc } from "../../_plugin-vue_export-helper.js";
import { _ as __easycom_0$2, a as __easycom_1$1, u as util, b as api, v as video, s as statusBar, c as __easycom_1$2, d as collectAdd, i as indexVideo, e as commentAlt, f as collectAlt, g as shareFirendAlt } from "../../shareFirend.js";
const _style_0$9 = { "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" } } };
const _sfc_main$9 = {
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$9(_ctx, _cache, $props, $setup, $data, $options) {
return $data.width ? (openBlock(), createElementBlock(
"view",
{
key: 0,
style: normalizeStyle("width:" + $data.width + ";" + ($data.square ? "height:" + $data.width : "")),
class: "uni-grid-item",
renderWhole: true
},
[
createElementVNode(
"view",
{
class: 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: 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))
},
[
renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
)
],
4
/* STYLE */
)) : createCommentVNode("v-if", true);
}
const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["styles", [_style_0$9]], ["__file", "D:/document/九亿商城/jy/jiuyi/uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue"]]);
const _style_0$8 = { "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 } } };
const dom = requireNativePlugin("dom");
const _sfc_main$8 = {
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) {
dom.getComponentRect(this.$refs["uni-grid"], (ret) => {
this.width = parseInt((ret.size.width - 1) / this.column) + "px";
fn(this.width);
});
}
}
};
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("view", {
class: "uni-grid-wrap",
renderWhole: true
}, [
createElementVNode("view", {
id: $data.elId,
ref: "uni-grid",
class: normalizeClass(["uni-grid", { "uni-grid--border": $props.showBorder }]),
style: normalizeStyle({ "border-left-color": $props.borderColor })
}, [
renderSlot(_ctx.$slots, "default")
], 14, ["id"])
]);
}
const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["styles", [_style_0$8]], ["__file", "D:/document/九亿商城/jy/jiuyi/uni_modules/uni-grid/components/uni-grid/uni-grid.vue"]]);
const _imports_0$2 = "/static/footerMenuPlus.png";
const _imports_1$2 = "/static/footerMenuPlus1.png";
const _style_0$7 = { "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" } } };
const _sfc_main$7 = {
__name: "footerMenu",
props: {
page: {
type: String
},
// 主题 dark黑色 light白色的
subject: {
type: String,
default: "light"
}
},
setup(__props, { expose: __expose }) {
__expose();
const {
proxy
} = getCurrentInstance();
const props = __props;
const userinfo = computed(() => {
let resuilt = uni.$store.state.userinfo;
return resuilt;
});
const mode = computed(() => uni.$store.state.tabbarMode);
const menu = computed(() => {
let arr = [
{
page: "index",
type: "option",
name: "视频",
pagePath: "pages/index/index"
},
{
page: "",
type: "option",
name: "榴莲果",
pagePath: "pages/index/durian"
},
// {
// page: 'shop',
// type: 'option',
// name: '商城',
// pagePath: 'pages/shop/shop'
// },
{
type: "middle",
name: ""
},
{
page: "news",
type: "option",
name: "消息",
pagePath: "pages/news/news"
}
];
switch (mode.value) {
case "default":
arr[2].pagePath = "pages/release/video";
arr.push({
page: "mine",
type: "option",
name: "我的",
pagePath: "pages/mine/homepage"
});
break;
case "shop":
arr[2].pagePath = "pages/merchant/commodity-release/index";
arr.push({
page: "mine",
type: "option",
name: "个人中心",
pagePath: "pages/mine/mine"
});
break;
}
return arr;
});
let safeHeight = ref(0);
const showMenu = computed(() => {
let result = [];
if (userinfo.value.userId) {
result.push({
name: "发布视频",
img: "/static/footerMenu1.png",
url: "/pages/release/video"
});
}
return result;
});
onMounted(() => {
addListener();
uni.hideTabBar();
uni.getSystemInfo().then((rs) => {
safeHeight.value = rs.safeArea + "px";
});
});
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.isAuth({
success: (rs) => {
if (item.url) {
uni.navigateTo({
url: item.url
});
} else
util.alert("敬请期待");
}
});
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, computed, onMounted, onUnmounted, getCurrentInstance, reactive, get util() {
return util;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_grid_item = resolveEasycom(resolveDynamicComponent("uni-grid-item"), __easycom_0$1);
const _component_uni_grid = resolveEasycom(resolveDynamicComponent("uni-grid"), __easycom_1);
const _component_uni_icons = resolveEasycom(resolveDynamicComponent("uni-icons"), __easycom_0$2);
const _component_uni_popup = resolveEasycom(resolveDynamicComponent("uni-popup"), __easycom_1$1);
return openBlock(), createElementBlock(
Fragment,
null,
[
createCommentVNode(" 幽灵盒子 "),
createElementVNode(
"view",
{
class: "ghost",
style: normalizeStyle({ paddingBottom: $setup.safeHeight })
},
null,
4
/* STYLE */
),
createCommentVNode(" 底部导航 "),
createElementVNode(
"view",
{
class: normalizeClass(["menuBox", $props.subject])
},
[
createElementVNode("view", { class: "menu" }, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.menu, (item, index2) => {
return openBlock(), createElementBlock("view", {
class: "item",
key: index2,
onClick: ($event) => $setup.handleMenu(item)
}, [
item.type == "option" ? (openBlock(), createElementBlock(
"view",
{
key: 0,
class: normalizeClass(["option", { active: item.page === $props.page }])
},
[
createElementVNode(
"u-text",
{ class: "text" },
toDisplayString(item.name),
1
/* TEXT */
)
],
2
/* CLASS */
)) : item.type === "middle" ? (openBlock(), createElementBlock("view", {
key: 1,
class: "middle"
}, [
$props.subject == "dark" ? (openBlock(), createElementBlock("u-image", {
key: 0,
class: "img",
src: _imports_0$2,
mode: "aspectFit"
})) : $props.subject == "light" ? (openBlock(), createElementBlock("u-image", {
key: 1,
class: "img",
src: _imports_1$2,
mode: "aspectFit"
})) : createCommentVNode("v-if", true)
])) : createCommentVNode("v-if", true)
], 8, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
createElementVNode(
"view",
{
class: "safeArea",
style: normalizeStyle({ height: $setup.safeHeight })
},
null,
4
/* STYLE */
),
createCommentVNode(" 底部菜单 "),
createVNode(
_component_uni_popup,
{
ref: "alert",
type: "bottom"
},
{
default: withCtx(() => [
createElementVNode("view", { class: "alert mlr50 pt50 plr10 pb10" }, [
createElementVNode("scroll-view", {
scrollY: "true",
class: "scroll"
}, [
createVNode(_component_uni_grid, {
column: 4,
highlight: true,
showBorder: false,
onChange: $setup.handleAlert
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.showMenu, (item, index2) => {
return openBlock(), createBlock(_component_uni_grid_item, {
index: index2,
key: index2
}, {
default: withCtx(() => [
createElementVNode("view", { class: "itemBox ptb30 df fdc jcc aic tac" }, [
createCommentVNode(' <uni-icons type="image" :size="30" color="#777" /> '),
createElementVNode("u-image", {
class: "wh80",
src: item.img,
mode: "aspectFill"
}, null, 8, ["src"]),
createElementVNode("view", { class: "mt5" }, [
createElementVNode(
"u-text",
{ class: "text f28 c333" },
toDisplayString(item.name),
1
/* TEXT */
)
])
])
]),
_: 2
/* DYNAMIC */
}, 1032, ["index"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]),
createElementVNode("view", { class: "tac mt30" }, [
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 */
);
}
const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["styles", [_style_0$7]], ["__file", "D:/document/九亿商城/jy/jiuyi/components/footerMenu/footerMenu.vue"]]);
const _style_0$6 = { "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" } } };
const _sfc_main$6 = {
__name: "time",
setup(__props, { expose: __expose }) {
const {
proxy
} = getCurrentInstance();
const typeList = reactive([{
id: 3,
name: "青少年闹钟",
key: "countDown"
}, {
id: 1,
name: "倒计时闹钟",
key: "countDown"
}, {
id: 2,
name: "时间闹钟",
key: "time"
}]);
const typeIndex = ref(0);
const remark = ref("");
const hour = reactive([]);
const hourIndex = ref(0);
const minute = reactive([]);
const minuteIndex = ref(0);
const alarm = computed(() => {
let result = uni.$store.state.alarmTime;
return result;
});
const yMd = ref("");
const visible = ref(true);
const pickerViewStyle = ref("height: 60rpx;");
const userinfo = computed(() => {
let result = uni.$store.state.userinfo;
return result;
});
onMounted(() => {
const date = /* @__PURE__ */ new Date();
yMd.value = `${date.getFullYear()}-${util.toTwo(date.getMonth() + 1)}-${util.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(param) {
const currentTime = new Date(util.formatTime("yyyy-MM-dd HH:mm:ss")).valueOf();
const alarmTime = new Date(param.endTime).valueOf();
if (alarmTime < currentTime)
return;
setTimeout(() => {
util.alert({
content: param.txt || "闹钟提醒时间到",
showCancel: false
});
uni.$store.commit("setState", {
key: "alarmTime",
value: ""
});
}, alarmTime - currentTime);
uni.$store.commit("setState", {
key: "alarmTime",
value: param.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.alert({
content: "青少年模式下不允许自定义闹钟",
showCancel: false
});
return;
}
const type = typeList[typeIndex.value];
let endTime = yMd.value;
if (type.key == "countDown") {
if (hourIndex.value === 0 && minuteIndex.value === 0) {
util.alert("当前时间已到");
return;
}
endTime = util.strtotime(`+${hour[hourIndex.value]} hour`, (/* @__PURE__ */ new Date()).getTime());
endTime = util.strtotime(`+${minute[minuteIndex.value]} minute`, endTime);
endTime = new Date(endTime).setSeconds(0);
endTime = util.formatTime("yyyy-MM-dd HH:mm:ss", endTime);
} else if (type.key == "time") {
endTime += ` ${util.toTwo(hour[hourIndex.value])}:${util.toTwo(minute[minuteIndex.value])}:00`;
const currentTime = new Date(util.formatTime("yyyy-MM-dd HH:mm:ss")).valueOf();
const alarmTime = new Date(endTime).valueOf();
if (alarmTime < currentTime) {
util.alert("设置闹钟时间应大于当前时间");
return;
}
}
api.video.setAlarm({
query: {
//
endTime,
// 1倒计时闹钟 2时间闹钟 3青少年闹钟
type: typeList[typeIndex.value].id,
// 闹钟备注
txt: remark.value
}
}).then((rs) => {
if (rs.code == 200) {
util.alert("设置成功");
util.setAlarm({
endTime,
type: typeList[typeIndex.value].id,
txt: remark.value
});
close();
return;
}
util.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, ref, reactive, getCurrentInstance, watch, computed, get util() {
return util;
}, 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(resolveDynamicComponent("uni-icons"), __easycom_0$2);
const _component_picker = resolveComponent("picker");
const _component_picker_view_column = resolveComponent("picker-view-column");
const _component_picker_view = resolveComponent("picker-view");
const _component_uni_popup = resolveEasycom(resolveDynamicComponent("uni-popup"), __easycom_1$1);
return openBlock(), createBlock(
_component_uni_popup,
{
ref: "time",
type: "bottom"
},
{
default: withCtx(() => [
createElementVNode("view", { class: "popBot plr60 bfff" }, [
createElementVNode("view", {
class: "close",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.time.close())
}, [
createVNode(_component_uni_icons, {
type: "close",
size: "36rpx",
color: "#333"
})
]),
createCommentVNode(" 标题 "),
createElementVNode("view", { class: "title mtb40" }, [
createVNode(_component_picker, {
class: "df fdr jcc aic",
range: $setup.typeList,
onChange: $setup.handleType,
value: $setup.typeIndex,
"range-key": "name"
}, {
default: withCtx(() => [
createElementVNode(
"u-text",
{ class: "tac f40" },
toDisplayString($setup.typeList[$setup.typeIndex].name),
1
/* TEXT */
),
createVNode(_component_uni_icons, {
type: "right",
color: "#999",
size: "32rpx"
})
]),
_: 1
/* STABLE */
}, 8, ["range", "value"])
]),
createCommentVNode(" 副标题 "),
createElementVNode("view", { class: "" }, [
createElementVNode(
"u-text",
{ class: "f32" },
"闹钟提醒时间:" + toDisplayString($setup.alarm || "未设置"),
1
/* TEXT */
)
]),
createCommentVNode(" 操作台 "),
createElementVNode("view", { class: "oclockBox aic mtb25" }, [
createElementVNode("view", { class: "oclock" }, [
createCommentVNode(" 选择器 "),
createElementVNode("view", { class: "f1" }, [
createVNode(_component_picker_view, {
class: "select f1",
value: [$setup.hourIndex],
"indicator-class": "option active",
"indicator-style": $setup.pickerViewStyle,
onChange: $setup.handleHour
}, {
default: withCtx(() => [
createVNode(_component_picker_view_column, null, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.hour, (item, index2) => {
return openBlock(), createElementBlock("view", {
key: index2,
class: "option fdr aic jcc"
}, [
createElementVNode(
"u-text",
{ class: "text" },
toDisplayString(item),
1
/* TEXT */
),
index2 === $setup.hourIndex ? (openBlock(), createElementBlock("u-text", {
key: 0,
class: "text"
}, "时")) : createCommentVNode("v-if", true)
]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}, 8, ["value", "indicator-style"])
]),
createElementVNode("view", { class: "jcc" }, [
createElementVNode("u-text", null, ":")
]),
createElementVNode("view", { class: "f1" }, [
createVNode(_component_picker_view, {
class: "select f1",
value: [$setup.minuteIndex],
"indicator-class": "option active",
"indicator-style": $setup.pickerViewStyle,
onChange: $setup.handleMinute
}, {
default: withCtx(() => [
createVNode(_component_picker_view_column, null, {
default: withCtx(() => [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.minute, (item, index2) => {
return openBlock(), createElementBlock("view", {
key: index2,
class: "option fdr aic jcc"
}, [
createElementVNode(
"u-text",
{ class: "text" },
toDisplayString(item),
1
/* TEXT */
),
index2 === $setup.minuteIndex ? (openBlock(), createElementBlock("u-text", {
key: 0,
class: "text"
}, "分")) : createCommentVNode("v-if", true)
]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
}, 8, ["value", "indicator-style"])
])
]),
createCommentVNode(" 文字提示 "),
createElementVNode("view", { class: "mt10" }, [
createElementVNode("u-text", { class: "c666 f20" }, "预先设置观影时间,到时自动提醒")
]),
createElementVNode("view", { class: "remark mtb30 ptb10 plr10 br20" }, [
createElementVNode("u-input", {
type: "text",
modelValue: $setup.remark,
onInput: _cache[1] || (_cache[1] = ($event) => $setup.remark = $event.detail.value),
placeholder: "设置闹钟备注"
}, null, 40, ["modelValue"])
]),
createElementVNode("view", { class: "btns mtb25" }, [
createElementVNode("view", {
class: "button jcc confirm mtb10",
onClick: $setup.handleSubmit
}, [
createElementVNode("u-text", { class: "text" }, "确认")
]),
createElementVNode("view", {
class: "button jcc cancel mtb10",
onClick: _cache[2] || (_cache[2] = ($event) => $setup.close())
}, [
createElementVNode("u-text", { class: "text" }, "关闭")
])
])
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
);
}
const timeAlt = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["styles", [_style_0$6]], ["__file", "D:/document/九亿商城/jy/jiuyi/components/index/time.vue"]]);
const _imports_0$1 = "/static/leftMenu1.png";
const _imports_1$1 = "/static/leftMenu2.png";
const _imports_2$1 = "/static/leftMenu3.png";
const _imports_3 = "/static/leftMenu5.png";
const _imports_4 = "/static/leftMenu6.png";
const _style_0$5 = { "leftMenuAlt": { "": { "width": "600rpx", "backgroundColor": "#F4F4F4" } } };
const _sfc_main$5 = {
__name: "leftMenu",
setup(__props, { expose: __expose }) {
const {
proxy
} = getCurrentInstance();
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.scan();
}
function link(url) {
util.isAuth({
success: (rs) => {
uni.navigateTo({
url
});
}
});
}
__expose({
open,
close
});
const __returned__ = { proxy, open, close, getUserInfos, scanQRCode, link, onMounted, ref, reactive, getCurrentInstance, watch, get videoApi() {
return video;
}, statusBar, get util() {
return util;
} };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
const _component_uni_icons = resolveEasycom(resolveDynamicComponent("uni-icons"), __easycom_0$2);
const _component_navigator = resolveComponent("navigator");
const _component_uni_popup = resolveEasycom(resolveDynamicComponent("uni-popup"), __easycom_1$1);
return openBlock(), createBlock(
_component_uni_popup,
{
ref: "leftMenu",
type: "left"
},
{
default: withCtx(() => [
createElementVNode("view", { class: "leftMenuAlt f1 plr30" }, [
createCommentVNode(" 状态条 "),
createVNode($setup["statusBar"]),
createCommentVNode(" 扫一扫 "),
createElementVNode("view", { class: "df fdr jcr aic mtb30" }, [
createVNode(_component_uni_icons, {
type: "scan",
size: "40rpx"
}),
createElementVNode("u-text", {
class: "ml10 c333 f24",
onClick: $setup.scanQRCode
}, "扫一扫")
]),
createCommentVNode(" 菜单列表 "),
createElementVNode("view", { class: "menuList mtb30 f1" }, [
createElementVNode("scroll-view", {
scrollY: "true",
class: "scroll f1",
showScrollbar: false
}, [
createElementVNode("view", { class: "list" }, [
createVNode(_component_navigator, {
url: "/pages/index/wallet",
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20",
"hover-class": "none"
}, {
default: withCtx(() => [
createElementVNode("u-image", {
class: "wh80 mr25",
src: _imports_0$1,
mode: "aspectFit"
}),
createElementVNode("u-text", { class: "text f1 c333 f28" }, "我的钱包")
]),
_: 1
/* STABLE */
}),
createVNode(_component_navigator, {
url: "/pages/index/integralMall",
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20",
"hover-class": "none"
}, {
default: withCtx(() => [
createElementVNode("u-image", {
class: "wh80 mr25",
src: _imports_1$1,
mode: "aspectFit"
}),
createElementVNode("u-text", { class: "text f1 c333 f28" }, "卷轴积分")
]),
_: 1
/* STABLE */
}),
createVNode(_component_navigator, {
url: "/pages/index/durian",
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20",
"hover-class": "none"
}, {
default: withCtx(() => [
createElementVNode("u-image", {
class: "wh80 mr25",
src: _imports_2$1,
mode: "aspectFit"
}),
createElementVNode("u-text", { class: "text f1 c333 f28" }, "榴莲果树")
]),
_: 1
/* STABLE */
}),
createElementVNode("view", {
onClick: _cache[0] || (_cache[0] = ($event) => $setup.link("/pages/index/myTeam")),
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20"
}, [
createElementVNode("u-image", {
class: "wh80 mr25",
src: _imports_3,
mode: "aspectFit"
}),
createElementVNode("u-text", { class: "text f1 c333 f28" }, "我的团队")
]),
createElementVNode("view", {
onClick: _cache[1] || (_cache[1] = ($event) => $setup.link("/pages/index/myQrCode")),
class: "item df fdr aic mtb15 ptb40 plr30 bfff br20"
}, [
createElementVNode("u-image", {
class: "wh80 mr25",
src: _imports_4,
mode: "aspectFit"
}),
createElementVNode("u-text", { class: "text f1 c333 f28" }, "邀请好友分享APP")
]),
createCommentVNode(' <navigator url="/pages/shop/settle" class="item df fdr aic mtb15 ptb40 plr30 bfff br20">\r\n <image class="wh80 mr25" src="/static/leftMenu7.png" mode="aspectFit" />\r\n <text class="text f1 c333 f28">商家入驻</text>\r\n </navigator> '),
createCommentVNode(' <view class="item df fdr aic mtb15 ptb40 plr30 bfff br20">\r\n <image class="wh80 mr25" src="/static/leftMenu9.png" mode="aspectFit" />\r\n <text class="text f1 c333 f28">联系客服</text>\r\n </view>\r\n\r\n <view class="item df fdr aic mtb15 ptb40 plr30 bfff br20">\r\n <image class="wh80 mr25" src="/static/leftMenu8.png" mode="aspectFit" />\r\n <text class="text f1 c333 f28">九亿打车</text>\r\n </view> ')
])
])
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
);
}
const leftMenuAlt = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["styles", [_style_0$5]], ["__file", "D:/document/九亿商城/jy/jiuyi/components/index/leftMenu.vue"]]);
const _style_0$4 = { "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)" } } };
const _sfc_main$4 = {
__name: "disc",
setup(__props, { expose: __expose }) {
const rotate = ref(0);
const timer = ref(null);
const limitTime = ref(5);
const step = ref(0.05);
const playState = ref(false);
const discStyle = computed(() => {
let result = {
transform: `rotate(${rotate.value}deg)`
};
return result;
});
const userinfo = computed(() => {
let result = uni.$store.state.userinfo;
return result;
});
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, onMounted, reactive, ref };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock(
Fragment,
null,
[
createCommentVNode(" cd唱片 "),
createElementVNode("view", { class: "discBox" }, [
createElementVNode(
"view",
{
class: "disc fmid",
style: normalizeStyle($setup.discStyle),
onClick: $setup.handleDisc
},
[
createElementVNode("u-image", {
class: "image wh100 cir",
src: $setup.userinfo.userPortrait,
mode: "aspectFill"
}, null, 8, ["src"])
],
4
/* STYLE */
)
])
],
2112
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
);
}
const disc = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["styles", [_style_0$4]], ["__file", "D:/document/九亿商城/jy/jiuyi/components/index/disc.vue"]]);
const _style_0$3 = { "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 } } };
const _sfc_main$3 = {
__name: "moreMenu",
props: {
// 是否我自己 0不是 1是
isMine: {
type: [String, Number],
default: 0
}
},
emits: ["changeSpeed"],
setup(__props, { expose: __expose, emit: __emit }) {
const {
proxy
} = getCurrentInstance();
const props = __props;
const emit = __emit;
const speed = reactive([
{
name: "0.5",
value: 0.5
},
{
name: "正常",
value: 1
},
{
name: "1.25",
value: 1.25
},
{
name: "1.5",
value: 1.5
},
{
name: "2",
value: 2
}
]);
const speedIndex = ref(1);
const videoDetail = reactive({});
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.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, reactive, getCurrentInstance, ref, get util() {
return util;
} };
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(resolveDynamicComponent("uni-icons"), __easycom_0$2);
const _component_uni_popup = resolveEasycom(resolveDynamicComponent("uni-popup"), __easycom_1$1);
return openBlock(), createBlock(
_component_uni_popup,
{
ref: "menu",
type: "bottom"
},
{
default: withCtx(() => [
createCommentVNode(" "),
createElementVNode("view", { class: "menuAlt" }, [
createElementVNode("view", { class: "header df jcr fdr ptb10 plr10" }, [
createVNode(_component_uni_icons, {
type: "closeempty",
onClick: $setup.close
})
]),
createElementVNode("view", { class: "listArea mtb30 mlr30 plr30 bfff" }, [
createElementVNode("view", { class: "line rows fdr ptb30" }, [
createElementVNode("u-text", { class: "key f1 c111 f28" }, "倍速"),
createElementVNode("view", { class: "value speed df jcsb fdr f1 pl30" }, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.speed, (item, index2) => {
return openBlock(), createElementBlock("view", {
class: normalizeClass(["item", { "active": $setup.speedIndex == index2 }]),
key: index2,
onClick: ($event) => $setup.handleSpeed(item)
}, [
createElementVNode(
"u-text",
{ class: "text f28" },
toDisplayString(item.name),
1
/* TEXT */
)
], 10, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
])
]),
$props.isMine == 0 ? (openBlock(), 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 })))
}, [
createElementVNode("u-text", { class: "key f1 c111 f28" }, "举报作者"),
createElementVNode("view", { class: "value f1 ml30" })
])) : createCommentVNode("v-if", true)
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
);
}
const moreMenu = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["styles", [_style_0$3]], ["__file", "D:/document/九亿商城/jy/jiuyi/components/index/moreMenu.vue"]]);
const _style_0$2 = { "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 } } };
const _sfc_main$2 = {
__name: "fastCollect",
setup(__props, { expose: __expose }) {
const {
proxy
} = getCurrentInstance();
const detail = ref({});
const position = ref({});
const listProperty = reactive({
// 数据
data: [],
// 条数
pageSize: 10,
// 页码
pageNum: 1,
// 总数
total: 0
});
const active = ref(false);
onMounted(() => {
addListener();
util.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.format_url(item.pic, "img");
return item;
}));
listProperty.total = rs.total;
return;
}
util.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.alert({
content: rs.msg,
showCancel: false
});
});
}
__expose({
open,
close
});
const __returned__ = { proxy, detail, position, listProperty, active, addListener, refrshList, getMoreList, getList, open, close, handleCollect, onMounted, reactive, ref, getCurrentInstance, get api() {
return api;
}, get util() {
return util;
}, 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(resolveDynamicComponent("uni-icons"), __easycom_0$2);
const _component_uni_transition = resolveEasycom(resolveDynamicComponent("uni-transition"), __easycom_1$2);
const _component_uni_popup = resolveEasycom(resolveDynamicComponent("uni-popup"), __easycom_1$1);
return openBlock(), createElementBlock(
Fragment,
null,
[
createVNode(
_component_uni_popup,
{
ref: "fastCollect",
type: "center",
animation: false
},
{
default: withCtx(() => [
createElementVNode(
"view",
{
class: "collectListBox",
style: normalizeStyle({ top: $setup.position.y + "px", right: $setup.position.x + "px" })
},
[
createVNode(_component_uni_transition, {
"mode-class": "slide-right",
show: $setup.active
}, {
default: withCtx(() => [
createElementVNode(
"scroll-view",
{
scrollX: "true",
showScrollbar: false,
class: "scroll df fdr f1",
onScrolltolower: $setup.getMoreList
},
[
createElementVNode("view", { class: "list fdr plr15" }, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.listProperty.data, (item, index2) => {
return openBlock(), createElementBlock("view", {
class: "item wh70 br20",
key: index2,
onClick: ($event) => $setup.handleCollect(item)
}, [
createElementVNode("u-image", {
class: "wh70 br20",
src: item.formatPic,
mode: "aspectFill"
}, null, 8, ["src"])
], 8, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
)),
createElementVNode("view", {
class: "item create fmid ml15 wh70 br20",
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.collectAddRef.open())
}, [
createVNode(_component_uni_icons, {
type: "plusempty",
color: "#fff",
size: "40rpx"
})
])
])
],
32
/* NEED_HYDRATION */
)
]),
_: 1
/* STABLE */
}, 8, ["show"])
],
4
/* STYLE */
)
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
),
createCommentVNode(" 新增收藏 "),
createVNode(
$setup["collectAdd"],
{ ref: "collectAddRef" },
null,
512
/* NEED_PATCH */
)
],
64
/* STABLE_FRAGMENT */
);
}
const fastCollect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["styles", [_style_0$2]], ["__file", "D:/document/九亿商城/jy/jiuyi/components/index/fastCollect.vue"]]);
const _style_0$1 = { "close": { "": { "position": "absolute", "top": "20rpx", "left": "20rpx" } }, "main": { "": { "marginTop": "120rpx" } }, "txt": { ".main ": { "textAlign": "center" } }, "button": { "": { "marginTop": 0, "marginRight": "120rpx", "marginBottom": 0, "marginLeft": "120rpx" } } };
const _sfc_main$1 = {
__name: "teen",
emits: ["setting"],
setup(__props, { expose: __expose, emit: __emit }) {
const {
proxy
} = 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, getCurrentInstance };
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(resolveDynamicComponent("uni-icons"), __easycom_0$2);
const _component_uni_popup = resolveEasycom(resolveDynamicComponent("uni-popup"), __easycom_1$1);
return openBlock(), createElementBlock("view", { renderWhole: true }, [
createVNode(
_component_uni_popup,
{
ref: "teen",
type: "bottom"
},
{
default: withCtx(() => [
createElementVNode("view", { class: "teenAlt popBot ptb30 bfff" }, [
createElementVNode("view", { class: "close" }, [
createVNode(_component_uni_icons, {
type: "closeempty",
onClick: _cache[0] || (_cache[0] = ($event) => $setup.close()),
size: "40rpx"
})
]),
createElementVNode("view", { class: "main mlr30" }, [
createElementVNode("u-text", { class: "txt c333 f34" }, "为呵护未成年人健康成长,九亿推出青少年模式。该模式下设置闹铃限制观看时间,请监护人主动设置。")
]),
createElementVNode("view", { class: "button btn black mt60 mb30" }, [
createElementVNode("u-text", {
class: "txt tac cfff",
onClick: $setup.handleSetting
}, "设置")
])
])
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
]);
}
const teen = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["styles", [_style_0$1]], ["__file", "D:/document/九亿商城/jy/jiuyi/components/index/teen.vue"]]);
const _imports_0 = "/static/indexList.png";
const _imports_1 = "/static/indexSearch.png";
const _imports_2 = "/static/indexOclock.png";
const _style_0 = { "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" } } };
const _sfc_main = {
__name: "index",
setup(__props, { expose: __expose }) {
__expose();
const {
proxy
} = getCurrentInstance();
const dom2 = requireNativePlugin("dom");
const oclockWindow = ref(false);
const readSecond = reactive({
// 单个视频最大
max: 20,
// 累计
count: 0,
// 总数
total: 0,
// 总数最大
totalMax: 300,
// 定时器
timer: null
});
const tab = reactive([
// {
// name: '同城',
// },
{
name: "关注",
load: false,
listData: () => attList.data,
getList: () => getAttList(),
getMoreList: () => getMoreAttList(),
refreshList: () => refreshAttList()
},
{
name: "推荐",
load: false,
listData: () => recList.data,
getList: () => getRecList(),
getMoreList: () => getMoreRecList(),
refreshList: () => refreshRecList()
}
]);
const tabIndex = ref(1);
const startY = ref(0);
const currentLast = reactive([0, 0]);
const current = reactive([0, 0]);
const recList = reactive({
data: [],
pageNum: 1,
total: 0,
homePageSize: 7,
shopPageSize: 2,
otherPageSize: 1
});
const attList = reactive({
data: [],
pageSize: 10,
pageNum: 1,
total: 0,
timer: null
});
const viewHeight = ref(0);
const viewWidth = ref(0);
const discOffsetTop = ref(0);
const userinfo = computed(() => {
let result = uni.$store.state.userinfo || {};
return result;
});
const tabCurrent = computed(() => {
let result = tab[tabIndex.value];
return result;
});
const currentVideoRef = 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.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, {
...tabCurrent.value.listData()[findIndex],
...item
});
});
uni.$on("focusUser", (param) => {
if (!param.userId)
return;
refreshAttList();
for (var index2 = 0; index2 < recList.data.length; i++) {
const item = recList.data[index2];
if (item.userId == param.userId) {
item.isAttention = param.result;
recList.data.splice(index2, 1, item);
}
}
});
});
onReady(() => {
dom2.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.format_url(item.videoUrl, "video");
item.format_header = util.format_url(item.header, "img");
return item;
}));
attList.total = rs.total;
return;
}
util.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.format_url(item.videoUrl, "video");
item.format_imageUrl = util.format_url(item.imageUrl, "img");
item.format_header = util.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.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.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.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]];
dom2.scrollToElement(element, {
animated: true
});
if (current[tab_index] != currentLast[tab_index]) {
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 == "关注" && !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.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(param) {
const {
index: index2,
isLike
} = param;
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.alert({
content: rs.msg,
showCancel: false
});
});
}
function setAlarm() {
oclockWindow.value = false;
uni.setStorageSync("alarmAlt", true);
}
function showLeftMenu() {
util.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 = {
...event.videoTime,
videoCurrentTime: event.videoCurrentTime
};
}
function showAlarm() {
proxy.$refs.timeRef.open();
}
const __returned__ = { proxy, dom: dom2, 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, reactive, getCurrentInstance, computed, 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;
}, get api() {
return api;
}, statusBar, indexVideo, footerMneu: __easycom_0, timeAlt, commentAlt, collectAlt, shareFirendAlt, leftMenuAlt, disc, moreMenu, fastCollect, teen };
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
return __returned__;
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_navigator = resolveComponent("navigator");
const _component_footerMenu = resolveEasycom(resolveDynamicComponent("footerMenu"), __easycom_0);
return openBlock(), createElementBlock("scroll-view", {
scrollY: true,
showScrollbar: true,
enableBackToTop: true,
bubble: "true",
style: { flexDirection: "column" }
}, [
createCommentVNode(" 页面内容 "),
createElementVNode("view", { class: "page pr f1" }, [
createCommentVNode(" 顶部内容 "),
createElementVNode("view", { class: "top pf t0 l0 r0" }, [
createVNode($setup["statusBar"]),
createElementVNode("view", { class: "menu head fdr jcsa aic plr40" }, [
createElementVNode("view", {
class: "sider",
onClick: $setup.showLeftMenu
}, [
createElementVNode("u-image", {
class: "wh40",
src: _imports_0,
mode: "aspectFit"
})
]),
createElementVNode("view", { class: "f1" }, [
(openBlock(), createElementBlock("view", {
class: "tab fdr jcc",
key: $setup.tabIndex
}, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.tab, (item, index2) => {
return openBlock(), createElementBlock("view", {
class: normalizeClass(["list", [{ "active": index2 === $setup.tabIndex }]]),
key: index2,
onClick: withModifiers(($event) => $setup.handle_tab(index2), ["stop"])
}, [
createElementVNode("view", { class: "txt" }, [
createElementVNode(
"u-text",
{ class: "text" },
toDisplayString(item.name),
1
/* TEXT */
)
]),
createElementVNode("view", { class: "line" })
], 10, ["onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
]))
]),
createVNode(_component_navigator, {
url: "/pages/index/search",
class: "search"
}, {
default: withCtx(() => [
createElementVNode("u-image", {
class: "wh65",
src: _imports_1,
mode: "aspectFit"
})
]),
_: 1
/* STABLE */
})
])
]),
createCommentVNode(" 有效读秒唱片 "),
$setup.userinfo.userId ? (openBlock(), createElementBlock(
"view",
{
key: 0,
class: "disc pf r0",
style: normalizeStyle({ top: $setup.discOffsetTop + "px" })
},
[
createVNode(
$setup["disc"],
{ ref: "discRef" },
null,
512
/* NEED_PATCH */
)
],
4
/* STYLE */
)) : createCommentVNode("v-if", true),
(openBlock(true), createElementBlock(
Fragment,
null,
renderList($setup.tab, (item, index2) => {
return openBlock(), createElementBlock(
Fragment,
{ key: index2 },
[
$setup.tabIndex == index2 ? (openBlock(), createElementBlock(
"view",
{
key: 0,
class: "f1",
ref_for: true,
ref: "containerRef"
},
[
createCommentVNode(" 主要内容区域 "),
createElementVNode("list", {
class: "container f1",
showScrollbar: false,
onTouchstart: ($event) => $setup.onTouchstart($event, index2),
onTouchend: ($event) => $setup.onTouchend($event, index2),
onLoadmore: item.getMoreList
}, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(item.listData(), (secItem, secIndex) => {
return openBlock(), createElementBlock(
"cell",
{
class: "cell",
style: normalizeStyle([{ height: $setup.viewHeight + "px" }]),
ref_for: true,
ref: `cellRef` + index2,
key: secIndex,
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["stop"]))
},
[
createCommentVNode(" 视频 "),
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 */
)) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
);
}),
128
/* KEYED_FRAGMENT */
)),
createCommentVNode(" 计时提示 "),
$setup.oclockWindow ? (openBlock(), createElementBlock(
"view",
{
key: 1,
class: "oclockHint pa pfull fmid",
onTouchstart: _cache[1] || (_cache[1] = withModifiers(() => {
}, ["stop"])),
onClick: withModifiers($setup.setAlarm, ["stop"])
},
[
createElementVNode("u-image", {
class: "image",
src: _imports_2,
mode: "widthFix"
})
],
32
/* NEED_HYDRATION */
)) : createCommentVNode("v-if", true),
createCommentVNode(" 底部导航 "),
createVNode(
_component_footerMenu,
{
ref: "footerMenuRef",
page: "index",
subject: "dark"
},
null,
512
/* NEED_PATCH */
)
]),
createCommentVNode(" 快捷收藏 "),
createVNode(
$setup["fastCollect"],
{ ref: "fastCollectRef" },
null,
512
/* NEED_PATCH */
),
createCommentVNode(" 长按菜单 "),
createVNode(
$setup["moreMenu"],
{
ref: "moreMenuRef",
onChangeSpeed: $setup.handleSpeed
},
null,
512
/* NEED_PATCH */
),
createCommentVNode(" 闹钟弹窗 "),
createVNode(
$setup["timeAlt"],
{ ref: "timeRef" },
null,
512
/* NEED_PATCH */
),
createCommentVNode(" 评论弹窗 "),
createVNode(
$setup["commentAlt"],
{ ref: "commentRef" },
null,
512
/* NEED_PATCH */
),
createCommentVNode(" 收藏弹窗 "),
createVNode(
$setup["collectAlt"],
{ ref: "collectRef" },
null,
512
/* NEED_PATCH */
),
createCommentVNode(" 分享到好友弹窗 "),
createVNode(
$setup["shareFirendAlt"],
{ ref: "shareFirendRef" },
null,
512
/* NEED_PATCH */
),
createCommentVNode(" 左侧菜单弹窗 "),
createVNode(
$setup["leftMenuAlt"],
{ ref: "leftMenuRef" },
null,
512
/* NEED_PATCH */
),
createCommentVNode(" 青少年模式 "),
createVNode(
$setup["teen"],
{
ref: "teenRef",
onSetting: $setup.showAlarm
},
null,
512
/* NEED_PATCH */
)
]);
}
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/document/九亿商城/jy/jiuyi/pages/index/index.nvue"]]);
export {
index as default
};