|
@@ -162,10 +162,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
"use strict";
|
|
|
/* WEBPACK VAR INJECTION */(function(uni) {
|
|
|
|
|
|
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
value: true
|
|
|
});
|
|
|
exports.default = void 0;
|
|
|
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
|
|
|
+var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
|
|
|
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
|
|
|
var homeFrame = function homeFrame() {
|
|
|
__webpack_require__.e(/*! require.ensure | pagesHome/components/home-frame */ "pagesHome/components/home-frame").then((function () {
|
|
|
return resolve(__webpack_require__(/*! ../components/home-frame.vue */ 156));
|
|
@@ -177,113 +181,164 @@ var _default = {
|
|
|
},
|
|
|
data: function data() {
|
|
|
return {
|
|
|
- typeList: [
|
|
|
- // 类型信息
|
|
|
- {
|
|
|
- name: '平台'
|
|
|
- }, {
|
|
|
- name: '演员'
|
|
|
- }],
|
|
|
+ typeList: [],
|
|
|
tActive: 0,
|
|
|
- recomList: [
|
|
|
- //
|
|
|
- {
|
|
|
- name: '推荐信息',
|
|
|
- img_url: [
|
|
|
- //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- name: '推荐信息',
|
|
|
- img_url: [
|
|
|
- //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- name: '推荐信息',
|
|
|
- img_url: [
|
|
|
- //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- name: '推荐信息',
|
|
|
- img_url: [
|
|
|
- //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- name: '推荐信息',
|
|
|
- img_url: [
|
|
|
- //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- name: '推荐信息',
|
|
|
- img_url: [
|
|
|
- //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }]
|
|
|
- }],
|
|
|
- list: [
|
|
|
- //
|
|
|
- {
|
|
|
- name: '推荐信息',
|
|
|
- img_url: [
|
|
|
- //
|
|
|
- {
|
|
|
- id: "20230216100918",
|
|
|
- name: "头像.jpg",
|
|
|
- status: "success",
|
|
|
- uid: 1676513358695,
|
|
|
- uri: "/files/projectadmin/imgurl/20230216100918.jpg",
|
|
|
- url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
|
|
|
- }]
|
|
|
- }]
|
|
|
+ type_id: '',
|
|
|
+ recomList: [],
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ page: 0,
|
|
|
+ skip: 0,
|
|
|
+ limit: 20,
|
|
|
+ // 数据是否触底
|
|
|
+ is_bottom: false,
|
|
|
+ scrollTop: 0
|
|
|
};
|
|
|
},
|
|
|
onLoad: function onLoad() {},
|
|
|
- onShow: function onShow() {},
|
|
|
+ onShow: function onShow() {
|
|
|
+ var that = this;
|
|
|
+ that.search();
|
|
|
+ },
|
|
|
+ onHide: function onHide() {
|
|
|
+ var that = this;
|
|
|
+ that.clearPage();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ search: function search() {
|
|
|
+ var _this = this;
|
|
|
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
|
+ var that, res;
|
|
|
+ return _regenerator.default.wrap(function _callee$(_context) {
|
|
|
+ while (1) {
|
|
|
+ switch (_context.prev = _context.next) {
|
|
|
+ case 0:
|
|
|
+ that = _this;
|
|
|
+ _context.next = 3;
|
|
|
+ return that.$api('scenetype', 'GET', {
|
|
|
+ is_use: '0'
|
|
|
+ });
|
|
|
+ case 3:
|
|
|
+ res = _context.sent;
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, "typeList", res.data);
|
|
|
+ if (res.total > 0) {
|
|
|
+ that.$set(that, "type_id", res.data[0]._id);
|
|
|
+ that.searchScene();
|
|
|
+ that.searchData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case 5:
|
|
|
+ case "end":
|
|
|
+ return _context.stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, _callee);
|
|
|
+ }))();
|
|
|
+ },
|
|
|
// 类型选择
|
|
|
typeChange: function typeChange(e, index) {
|
|
|
var that = this;
|
|
|
that.$set(that, "tActive", index);
|
|
|
+ that.$set(that, "type_id", e._id);
|
|
|
+ that.clearPage();
|
|
|
+ that.searchScene();
|
|
|
+ that.searchData();
|
|
|
+ },
|
|
|
+ // 查询推荐
|
|
|
+ searchScene: function searchScene() {
|
|
|
+ var _this2 = this;
|
|
|
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
|
+ var that, res;
|
|
|
+ return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
|
+ while (1) {
|
|
|
+ switch (_context2.prev = _context2.next) {
|
|
|
+ case 0:
|
|
|
+ that = _this2;
|
|
|
+ _context2.next = 3;
|
|
|
+ return that.$api('scenedata', 'GET', {
|
|
|
+ skip: 0,
|
|
|
+ limit: 6,
|
|
|
+ type_id: that.type_id,
|
|
|
+ is_scene: '1',
|
|
|
+ is_use: '0'
|
|
|
+ });
|
|
|
+ case 3:
|
|
|
+ res = _context2.sent;
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ that.$set(that, "recomList", res.data);
|
|
|
+ }
|
|
|
+ case 5:
|
|
|
+ case "end":
|
|
|
+ return _context2.stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, _callee2);
|
|
|
+ }))();
|
|
|
+ },
|
|
|
+ // 查询数据
|
|
|
+ searchData: function searchData() {
|
|
|
+ var _this3 = this;
|
|
|
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
|
+ var that, res, list;
|
|
|
+ return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
|
+ while (1) {
|
|
|
+ switch (_context3.prev = _context3.next) {
|
|
|
+ case 0:
|
|
|
+ that = _this3;
|
|
|
+ _context3.next = 3;
|
|
|
+ return that.$api('scenedata', 'GET', {
|
|
|
+ skip: that.skip,
|
|
|
+ limit: that.limit,
|
|
|
+ type_id: that.type_id,
|
|
|
+ is_use: '0'
|
|
|
+ });
|
|
|
+ case 3:
|
|
|
+ res = _context3.sent;
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ list = [].concat((0, _toConsumableArray2.default)(that.list), (0, _toConsumableArray2.default)(res.data));
|
|
|
+ that.$set(that, "list", list);
|
|
|
+ that.$set(that, "total", res.total);
|
|
|
+ }
|
|
|
+ case 5:
|
|
|
+ case "end":
|
|
|
+ return _context3.stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, _callee3);
|
|
|
+ }))();
|
|
|
+ },
|
|
|
+ toPage: function toPage() {
|
|
|
+ var that = this;
|
|
|
+ var list = that.list;
|
|
|
+ var limit = that.limit;
|
|
|
+ if (that.total > list.length) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ var page = that.page + 1;
|
|
|
+ that.$set(that, "page", page);
|
|
|
+ var skip = page * limit;
|
|
|
+ that.$set(that, "skip", skip);
|
|
|
+ that.searchData();
|
|
|
+ uni.hideLoading();
|
|
|
+ } else that.$set(that, "is_bottom", true);
|
|
|
+ },
|
|
|
+ toScroll: function toScroll(e) {
|
|
|
+ var that = this;
|
|
|
+ var up = that.scrollTop;
|
|
|
+ that.$set(that, "scrollTop", e.detail.scrollTop);
|
|
|
+ var num = Math.sign(up - e.detail.scrollTop);
|
|
|
+ if (num == 1) that.$set(that, "is_bottom", false);
|
|
|
+ },
|
|
|
+ // 清空列表
|
|
|
+ clearPage: function clearPage() {
|
|
|
+ var that = this;
|
|
|
+ that.$set(that, "list", []);
|
|
|
+ that.$set(that, "skip", 0);
|
|
|
+ that.$set(that, "limit", 20);
|
|
|
+ that.$set(that, "page", 0);
|
|
|
},
|
|
|
// 跳转页面
|
|
|
toPath: function toPath(e) {
|