|
|
|
@ -34,7 +34,7 @@ __webpack_require__.r(__webpack_exports__); |
|
|
|
/* harmony import */ var _activity_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./activity.vue?vue&type=script&lang=js& */ 73); |
|
|
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _activity_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _activity_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); |
|
|
|
/* harmony import */ var _activity_vue_vue_type_style_index_0_id_13e34265_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./activity.vue?vue&type=style&index=0&id=13e34265&lang=scss&scoped=true& */ 75); |
|
|
|
/* harmony import */ var _D_HBuilderX_4_29_2024093009_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 32); |
|
|
|
/* harmony import */ var _D_HBuilderX_4_29_2024093009_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 35); |
|
|
|
|
|
|
|
var renderjs |
|
|
|
|
|
|
|
@ -100,17 +100,17 @@ __webpack_require__.r(__webpack_exports__); |
|
|
|
var components |
|
|
|
try { |
|
|
|
components = { |
|
|
|
uvIcon: function () { |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-icon/components/uv-icon/uv-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-icon/components/uv-icon/uv-icon")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-icon/components/uv-icon/uv-icon.vue */ 311)) |
|
|
|
uvSearch: function () { |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-search/components/uv-search/uv-search */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-search/components/uv-search/uv-search")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-search/components/uv-search/uv-search.vue */ 311)) |
|
|
|
}, |
|
|
|
uvTabs: function () { |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-tabs/components/uv-tabs/uv-tabs */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-tabs/components/uv-tabs/uv-tabs")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-tabs/components/uv-tabs/uv-tabs.vue */ 329)) |
|
|
|
uvIcon: function () { |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-icon/components/uv-icon/uv-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-icon/components/uv-icon/uv-icon")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-icon/components/uv-icon/uv-icon.vue */ 328)) |
|
|
|
}, |
|
|
|
uvButton: function () { |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-button/components/uv-button/uv-button */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-button/components/uv-button/uv-button")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-button/components/uv-button/uv-button.vue */ 338)) |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-button/components/uv-button/uv-button */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-button/components/uv-button/uv-button")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-button/components/uv-button/uv-button.vue */ 337)) |
|
|
|
}, |
|
|
|
uvEmpty: function () { |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-empty/components/uv-empty/uv-empty */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-empty/components/uv-empty/uv-empty")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-empty/components/uv-empty/uv-empty.vue */ 348)) |
|
|
|
return Promise.all(/*! import() | uni_modules/uv-empty/components/uv-empty/uv-empty */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uv-empty/components/uv-empty/uv-empty")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uv-empty/components/uv-empty/uv-empty.vue */ 347)) |
|
|
|
}, |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
@ -134,7 +134,7 @@ var render = function () { |
|
|
|
var _vm = this |
|
|
|
var _h = _vm.$createElement |
|
|
|
var _c = _vm._self._c || _h |
|
|
|
var g0 = _vm.filteredActivities.length |
|
|
|
var g0 = _vm.activities.length |
|
|
|
_vm.$mp.data = Object.assign( |
|
|
|
{}, |
|
|
|
{ |
|
|
|
@ -178,10 +178,32 @@ __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 */ 30)); |
|
|
|
var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18)); |
|
|
|
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32)); |
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
@ -281,115 +303,74 @@ var _default = { |
|
|
|
searchKeyword: '', |
|
|
|
primaryActiveTab: 'current', |
|
|
|
// current: 当前活动, past: 往期活动
|
|
|
|
params: { |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 10, |
|
|
|
title: '', |
|
|
|
// 搜索关键字
|
|
|
|
// categoryId: null, // 分类的id
|
|
|
|
status: 0 // 活动的状态 0是当前 1是往期
|
|
|
|
}, |
|
|
|
|
|
|
|
secondaryActiveIndex: 0, |
|
|
|
secondaryTabs: [{ |
|
|
|
name: '全部' |
|
|
|
}, { |
|
|
|
name: '品牌项目' |
|
|
|
}, { |
|
|
|
name: '公益活动' |
|
|
|
}, { |
|
|
|
name: '培训活动' |
|
|
|
}], |
|
|
|
// 模拟活动数据
|
|
|
|
activities: [{ |
|
|
|
id: 1, |
|
|
|
title: '关爱自闭症儿童活动', |
|
|
|
location: '长沙市雨花区时代阳光大道国际人才2145', |
|
|
|
time: '2025/08/1-2025/09/01', |
|
|
|
participants: 12, |
|
|
|
maxParticipants: 30, |
|
|
|
image: '/static/bannerImage.png', |
|
|
|
tag: '30分', |
|
|
|
tagColor: '#007AFF', |
|
|
|
category: 'charity', |
|
|
|
// all, brand, charity, training
|
|
|
|
status: 'current', |
|
|
|
// current, past
|
|
|
|
isFullOrExpired: false |
|
|
|
}, { |
|
|
|
id: 2, |
|
|
|
title: '社区环保志愿服务', |
|
|
|
location: '长沙市岳麓区梅溪湖国际新城', |
|
|
|
time: '2025/07/15-2025/07/20', |
|
|
|
participants: 25, |
|
|
|
maxParticipants: 40, |
|
|
|
image: '/static/bannerImage.png', |
|
|
|
tag: '20分', |
|
|
|
tagColor: '#52C41A', |
|
|
|
category: 'charity', |
|
|
|
status: 'current', |
|
|
|
isFullOrExpired: false |
|
|
|
}, { |
|
|
|
id: 3, |
|
|
|
title: '青少年编程培训', |
|
|
|
location: '长沙市开福区万达广场', |
|
|
|
time: '2025/06/01-2025/06/30', |
|
|
|
participants: 30, |
|
|
|
maxParticipants: 30, |
|
|
|
image: '/static/bannerImage.png', |
|
|
|
tag: '50分', |
|
|
|
tagColor: '#FF6B35', |
|
|
|
category: 'training', |
|
|
|
status: 'past', |
|
|
|
isFullOrExpired: true |
|
|
|
}, { |
|
|
|
id: 4, |
|
|
|
title: '品牌推广活动', |
|
|
|
location: '长沙市天心区IFS国金中心', |
|
|
|
time: '2025/05/10-2025/05/15', |
|
|
|
participants: 18, |
|
|
|
maxParticipants: 25, |
|
|
|
image: '/static/bannerImage.png', |
|
|
|
tag: '40分', |
|
|
|
tagColor: '#722ED1', |
|
|
|
category: 'brand', |
|
|
|
status: 'past', |
|
|
|
isFullOrExpired: true |
|
|
|
}] |
|
|
|
activities: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
filteredActivities: function filteredActivities() { |
|
|
|
var _this = this; |
|
|
|
var filtered = this.activities; |
|
|
|
|
|
|
|
// 根据一级tab筛选
|
|
|
|
filtered = filtered.filter(function (item) { |
|
|
|
return item.status === _this.primaryActiveTab; |
|
|
|
}); |
|
|
|
|
|
|
|
// 根据二级tab筛选
|
|
|
|
var categoryMap = { |
|
|
|
0: 'all', |
|
|
|
1: 'brand', |
|
|
|
2: 'charity', |
|
|
|
3: 'training' |
|
|
|
}; |
|
|
|
var selectedCategory = categoryMap[this.secondaryActiveIndex]; |
|
|
|
if (selectedCategory !== 'all') { |
|
|
|
filtered = filtered.filter(function (item) { |
|
|
|
return item.category === selectedCategory; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 根据搜索关键词筛选
|
|
|
|
if (this.searchKeyword.trim()) { |
|
|
|
filtered = filtered.filter(function (item) { |
|
|
|
return item.title.toLowerCase().includes(_this.searchKeyword.toLowerCase()); |
|
|
|
}); |
|
|
|
} |
|
|
|
return filtered; |
|
|
|
// 从store获取活动分类列表
|
|
|
|
categoryActivityList: function categoryActivityList() { |
|
|
|
return this.$store.state.categoryActivityList || []; |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleSearch: function handleSearch(value) { |
|
|
|
if (value) { |
|
|
|
this.params['title'] = value; |
|
|
|
} |
|
|
|
this.initData(); |
|
|
|
this.getActivityList(); |
|
|
|
}, |
|
|
|
// 切换一级tab
|
|
|
|
switchPrimaryTab: function switchPrimaryTab(tab) { |
|
|
|
this.primaryActiveTab = tab; |
|
|
|
this.initData(); |
|
|
|
delete this.params['categoryId']; |
|
|
|
// 标签回到全部
|
|
|
|
this.secondaryActiveIndex = 0; |
|
|
|
this.params['status'] = tab === 'current' ? 0 : 1; |
|
|
|
this.getActivityList(); |
|
|
|
}, |
|
|
|
// 切换二级tab
|
|
|
|
switchSecondaryTab: function switchSecondaryTab(index) { |
|
|
|
this.secondaryActiveIndex = index; |
|
|
|
switchSecondaryTab: function switchSecondaryTab(index, tabName) { |
|
|
|
var _arguments = arguments, |
|
|
|
_this = this; |
|
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { |
|
|
|
var categoryId; |
|
|
|
return _regenerator.default.wrap(function _callee$(_context) { |
|
|
|
while (1) { |
|
|
|
switch (_context.prev = _context.next) { |
|
|
|
case 0: |
|
|
|
categoryId = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : null; |
|
|
|
_this.initData(); |
|
|
|
_this.secondaryActiveIndex = index; |
|
|
|
delete _this.params['categoryId']; |
|
|
|
if (index === 0) { |
|
|
|
// 全部Tab
|
|
|
|
console.log('点击了全部Tab'); |
|
|
|
} else { |
|
|
|
// 活动分类Tab
|
|
|
|
_this.params['categoryId'] = categoryId; |
|
|
|
} |
|
|
|
_context.next = 7; |
|
|
|
return _this.getActivityList(); |
|
|
|
case 7: |
|
|
|
case "end": |
|
|
|
return _context.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee); |
|
|
|
}))(); |
|
|
|
}, |
|
|
|
// 跳转到活动详情
|
|
|
|
goToActivityDetail: function goToActivityDetail(activity) { |
|
|
|
@ -409,11 +390,90 @@ var _default = { |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/subPages/index/activityDetail?id=".concat(item.id) |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 获取活动列表
|
|
|
|
getActivityList: function getActivityList() { |
|
|
|
var _this2 = this; |
|
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { |
|
|
|
var res, _this2$activities; |
|
|
|
return _regenerator.default.wrap(function _callee2$(_context2) { |
|
|
|
while (1) { |
|
|
|
switch (_context2.prev = _context2.next) { |
|
|
|
case 0: |
|
|
|
_context2.next = 2; |
|
|
|
return _this2.$api.activity.queryActivityList(_this2.params); |
|
|
|
case 2: |
|
|
|
res = _context2.sent; |
|
|
|
if (res.result.records.length) { |
|
|
|
(_this2$activities = _this2.activities).push.apply(_this2$activities, (0, _toConsumableArray2.default)(res.result.records)); |
|
|
|
_this2.params.pageNo++; |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: '暂无活动数据', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
} |
|
|
|
case 4: |
|
|
|
case "end": |
|
|
|
return _context2.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee2); |
|
|
|
}))(); |
|
|
|
}, |
|
|
|
initData: function initData() { |
|
|
|
this.params['pageNo'] = 1; |
|
|
|
this.activities = []; |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad: function onLoad() { |
|
|
|
// 页面加载时的初始化逻辑
|
|
|
|
console.log('活动页面加载完成'); |
|
|
|
onShow: function onShow() { |
|
|
|
var _this3 = this; |
|
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() { |
|
|
|
return _regenerator.default.wrap(function _callee3$(_context3) { |
|
|
|
while (1) { |
|
|
|
switch (_context3.prev = _context3.next) { |
|
|
|
case 0: |
|
|
|
if (!(_this3.categoryActivityList.length === 0)) { |
|
|
|
_context3.next = 3; |
|
|
|
break; |
|
|
|
} |
|
|
|
_context3.next = 3; |
|
|
|
return _this3.$store.dispatch('getCategoryActivityList'); |
|
|
|
case 3: |
|
|
|
_this3.initData(); |
|
|
|
_this3.params['title'] = ''; |
|
|
|
_context3.next = 7; |
|
|
|
return _this3.getActivityList(); |
|
|
|
case 7: |
|
|
|
case "end": |
|
|
|
return _context3.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee3); |
|
|
|
}))(); |
|
|
|
}, |
|
|
|
onReachBottom: function onReachBottom() { |
|
|
|
this.getActivityList(); |
|
|
|
}, |
|
|
|
onPullDownRefresh: function onPullDownRefresh() { |
|
|
|
var _this4 = this; |
|
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() { |
|
|
|
return _regenerator.default.wrap(function _callee4$(_context4) { |
|
|
|
while (1) { |
|
|
|
switch (_context4.prev = _context4.next) { |
|
|
|
case 0: |
|
|
|
_this4.initData(); |
|
|
|
_context4.next = 3; |
|
|
|
return _this4.getActivityList(); |
|
|
|
case 3: |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
case 4: |
|
|
|
case "end": |
|
|
|
return _context4.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee4); |
|
|
|
}))(); |
|
|
|
} |
|
|
|
}; |
|
|
|
exports.default = _default; |
|
|
|
|