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; } ; if (uni.restoreGlobal) { uni.restoreGlobal(Vue, weex, plus, setTimeout, clearTimeout, setInterval, clearInterval); } (function(vue) { "use strict"; function formatAppLog(type, filename, ...args) { if (uni.__log__) { uni.__log__(type, filename, ...args); } else { console[type].apply(console, [...args, filename]); } } const DEV_CONFIG = { BASE_URL: "https://www.w3cschool.cn", APP_ID: "python_harmony_dev", APP_TYPE: "development", CHANNEL: "dev_channel" }; const CONFIG$1 = DEV_CONFIG; const config = { ...CONFIG$1, // 超时时间 TIMEOUT: 3e4, // 版本号 VERSION: "1.0.0", // 其他全局配置 TOKEN_KEY: "auth_token", USER_INFO_KEY: "userInfo" }; const CONFIG = config; const getUserInfo = function(callback) { try { const userInfoStr = uni.getStorageSync("userInfo"); if (userInfoStr) { const userInfo = JSON.parse(userInfoStr); callback && callback({ status: true, data: userInfo }); } else { callback && callback({ status: false }); } } catch (e) { formatAppLog("error", "at utils/request.js:27", "获取用户信息失败", e); callback && callback({ status: false, error: e }); } }; const checkValue = function(value) { return value !== void 0 && value !== null ? value : ""; }; const requestInterceptor = function(options) { return options; }; const responseInterceptor = function(response, options) { return response; }; const request = function(url, headParam = {}, bodyParam = {}, callback) { getUserInfo(function(ret) { let userInfo = {}; if (ret && ret.status === true && ret.data) { userInfo = ret.data; } if (!(headParam instanceof Object)) { headParam = {}; } if (!(bodyParam instanceof Object)) { bodyParam = {}; } let systemInfo = {}; try { systemInfo = uni.getSystemInfoSync(); } catch (e) { formatAppLog("error", "at utils/request.js:90", "获取系统信息失败:", e); systemInfo = { platform: "unknown", deviceId: "" }; } let appVersion = ""; try { if (typeof plus !== "undefined" && plus.runtime) { appVersion = plus.runtime.version; } else { appVersion = CONFIG.VERSION || "1.0.0"; } } catch (e) { formatAppLog("error", "at utils/request.js:105", "获取应用版本失败:", e); appVersion = CONFIG.VERSION || "1.0.0"; } bodyParam.deviceId = systemInfo.deviceId || ""; bodyParam.platform = systemInfo.platform || "unknown"; bodyParam.appVersion = appVersion; bodyParam.systemType = systemInfo.platform || "unknown"; bodyParam.channel = CONFIG.CHANNEL || "default"; bodyParam.apikey = checkValue(userInfo.apikey); bodyParam.apiauth = checkValue(userInfo.apiauth); const requestOptions = { url: /^(http|https):\/\//.test(url) ? url : CONFIG.BASE_URL + url, method: headParam.method || "POST", header: headParam.header || { "Content-Type": "application/json;charset=UTF-8" }, data: bodyParam, timeout: headParam.timeout || 3e4 }; const finalOptions = requestInterceptor(requestOptions); uni.request({ ...finalOptions, success: (res) => { const processedRes = responseInterceptor(res, finalOptions); callback && callback(processedRes, null); }, fail: (err) => { formatAppLog("error", "at utils/request.js:143", "请求失败", err); callback && callback(null, err); } }); }); }; const get = function(url, data = {}, options = {}, callback) { const headParam = { ...options, method: "GET" }; request(url, headParam, data, callback); }; const post = function(url, data = {}, options = {}, callback) { const headParam = { ...options, method: "POST" }; request(url, headParam, data, callback); }; const requestPromise = function(url, headParam = {}, bodyParam = {}) { return new Promise((resolve, reject) => { request(url, headParam, bodyParam, (res, err) => { if (err) { reject(err); } else { resolve(res); } }); }); }; const getPromise = function(url, data = {}, options = {}) { return requestPromise(url, { ...options, method: "GET" }, data); }; const postPromise = function(url, data = {}, options = {}) { return requestPromise(url, { ...options, method: "POST" }, data); }; const requestModule = { request, get, post, requestPromise, getPromise, postPromise, getUserInfo, checkValue }; const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const _sfc_main$5 = { __name: "discover", setup(__props, { expose: __expose }) { __expose(); const swipeGroup = vue.ref([]); const functionList = vue.ref([ { name: "学练课", icon: "/static/icons/study.png", bgColor: "#FF6B6B", badge: "好课" }, { name: "视频课", icon: "/static/icons/video.png", bgColor: "#9B59B6" }, { name: "题库", icon: "/static/icons/question.png", bgColor: "#F39C12" }, { name: "教程", icon: "/static/icons/tutorial.png", bgColor: "#2ECC71" }, { name: "VIP会员", icon: "/static/icons/vip.png", bgColor: "#E74C3C", badge: "16周年" }, { name: "基础入门", icon: "/static/icons/basic.png", bgColor: "#3498DB" }, { name: "数据分析", icon: "/static/icons/data.png", bgColor: "#1ABC9C" }, { name: "人工智能", icon: "/static/icons/ai.png", bgColor: "#95A5A6" }, { name: "爬虫", icon: "/static/icons/spider.png", bgColor: "#34495E" }, { name: "办公自动化", icon: "/static/icons/office.png", bgColor: "#16A085" } ]); const courseCards = vue.ref([ { title: "Python高薪就业课", subtitle: "面向大学、职场就业提效", bgColor: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)", image: "/static/cards/job-card.png" }, { title: "Python少儿编程", subtitle: "面向小学、初高中学习", bgColor: "linear-gradient(135deg, #f093fb 0%, #f5576c 100%)", image: "/static/cards/kids-card.png" } ]); const courseList = vue.ref([ { cover: "/static/courses/python-basic.png", title: "Python3 入门课程", students: "5037", type: "学练课", description: "爬虫+机器学习? Python无所不能..." }, { cover: "/static/courses/python-zero.png", title: "零基础入门学Python", students: "619", type: "视频课", description: "通过Python入门到实战全套教程..." }, { cover: "/static/courses/python-guide.png", title: "Python3零基础入门先导课", students: "5847", type: "学练课", description: "0基础的python入门先导课程..." } ]); const getSwipe = () => { try { const cachedSwipe = uni.getStorageSync("swipeGroup"); if (cachedSwipe) { swipeGroup.value = JSON.parse(cachedSwipe); } } catch (e) { formatAppLog("error", "at pages/discover/discover.vue:159", "获取缓存轮播图失败:", e); } if (!requestModule || !config) { formatAppLog("error", "at pages/discover/discover.vue:164", "request或config模块未正确导入"); return; } try { const systemInfo = uni.getSystemInfoSync(); requestModule.request("/api/appapi/getSlide", {}, { apptype: config.APP_TYPE || "production", systemType: systemInfo.platform || "unknown" }, (ret, err) => { try { if (ret && ret.statusCode < 300 && ret.data) { swipeGroup.value = []; let dataArray = ret.data; if (typeof ret.data === "string") { try { dataArray = JSON.parse(ret.data); } catch (e) { formatAppLog("error", "at pages/discover/discover.vue:189", "解析轮播图数据失败:", e); dataArray = []; } } if (!Array.isArray(dataArray)) { if (dataArray && dataArray.list && Array.isArray(dataArray.list)) { dataArray = dataArray.list; } else if (dataArray && dataArray.data && Array.isArray(dataArray.data)) { dataArray = dataArray.data; } else { formatAppLog("error", "at pages/discover/discover.vue:201", "轮播图数据格式不正确:", dataArray); dataArray = []; } } if (Array.isArray(dataArray) && dataArray.length > 0) { dataArray.forEach((item) => { if (item && item.cover) { const swipeItem = { cover: config.BASE_URL + "/" + item.cover, link: item.link || "", title: item.title || "" }; swipeGroup.value.push(swipeItem); } }); } try { uni.setStorageSync("swipeGroup", JSON.stringify(swipeGroup.value)); } catch (e) { formatAppLog("error", "at pages/discover/discover.vue:224", "缓存轮播图失败:", e); } } else if (swipeGroup.value.length === 0) { swipeGroup.value = [{ cover: "/static/banner/default-slide.png", link: "", title: "默认轮播图" }]; } if (err) { formatAppLog("error", "at pages/discover/discover.vue:238", "获取轮播图失败:", err); } } catch (error) { formatAppLog("error", "at pages/discover/discover.vue:241", "处理轮播图数据时出错:", error); } }); } catch (error) { formatAppLog("error", "at pages/discover/discover.vue:245", "获取系统信息或发起请求时出错:", error); } }; const navigateToSwipeLink = (index) => { const item = swipeGroup.value[index]; if (!item || !item.link) return; formatAppLog("log", "at pages/discover/discover.vue:254", "点击轮播图:", item.title, item.link); if (item.link.startsWith("http")) { uni.navigateTo({ url: `/pages/webview/webview?url=${encodeURIComponent(item.link)}&title=${encodeURIComponent(item.title || "详情")}` }); } else if (item.link.includes("||")) { const linkParts = item.link.split("||"); if (linkParts.length >= 2) { const pagePath = linkParts[1]; const params = linkParts[2] || ""; let navigateUrl = `/pages/${pagePath}`; if (params) { navigateUrl += `?params=${encodeURIComponent(params)}`; } uni.navigateTo({ url: navigateUrl }); } } }; const handleFunctionClick = (item) => { formatAppLog("log", "at pages/discover/discover.vue:284", "点击功能:", item.name); }; const handleCourseClick = (course) => { formatAppLog("log", "at pages/discover/discover.vue:289", "点击课程:", course.title); }; vue.onMounted(() => { try { formatAppLog("log", "at pages/discover/discover.vue:295", "发现页面加载完成"); getSwipe(); } catch (error) { formatAppLog("error", "at pages/discover/discover.vue:299", "页面初始化时出错:", error); } }); const __returned__ = { swipeGroup, functionList, courseCards, courseList, getSwipe, navigateToSwipeLink, handleFunctionClick, handleCourseClick, ref: vue.ref, onMounted: vue.onMounted, get requestModule() { return requestModule; }, get config() { return config; } }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "discover-container" }, [ vue.createCommentVNode(" 自定义状态栏 "), vue.createElementVNode("view", { class: "status-bar" }), vue.createCommentVNode(" 搜索框 "), vue.createElementVNode("view", { class: "search-section" }, [ vue.createElementVNode("view", { class: "search-box" }, [ vue.createElementVNode("text", { class: "search-icon" }, "🔍"), vue.createElementVNode("input", { class: "search-input", placeholder: "python · html · java..." }) ]) ]), vue.createCommentVNode(" 轮播图 "), $setup.swipeGroup.length > 0 ? (vue.openBlock(), vue.createElementBlock("view", { key: 0, class: "banner-section" }, [ vue.createElementVNode("swiper", { class: "banner-swiper", "indicator-dots": true, autoplay: true, interval: 3e3, duration: 1e3 }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.swipeGroup, (item, index) => { return vue.openBlock(), vue.createElementBlock("swiper-item", { key: index }, [ vue.createElementVNode("image", { class: "swipe-image", src: item.cover, mode: "aspectFill", onClick: ($event) => $setup.navigateToSwipeLink(index) }, null, 8, ["src", "onClick"]) ]); }), 128 /* KEYED_FRAGMENT */ )) ]) ])) : vue.createCommentVNode("v-if", true), vue.createCommentVNode(" 功能模块 "), vue.createElementVNode("view", { class: "function-section" }, [ vue.createElementVNode("view", { class: "function-row" }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.functionList.slice(0, 5), (item, index) => { return vue.openBlock(), vue.createElementBlock("view", { class: "function-item", key: index, onClick: ($event) => $setup.handleFunctionClick(item) }, [ vue.createElementVNode("view", { class: "function-icon" }, [ vue.createElementVNode("image", { src: item.icon, mode: "aspectFit" }, null, 8, ["src"]) ]), vue.createElementVNode( "text", { class: "function-text" }, vue.toDisplayString(item.name), 1 /* TEXT */ ), item.badge ? (vue.openBlock(), vue.createElementBlock( "view", { key: 0, class: "function-badge" }, vue.toDisplayString(item.badge), 1 /* TEXT */ )) : vue.createCommentVNode("v-if", true) ], 8, ["onClick"]); }), 128 /* KEYED_FRAGMENT */ )) ]), vue.createElementVNode("view", { class: "function-row" }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.functionList.slice(5, 10), (item, index) => { return vue.openBlock(), vue.createElementBlock("view", { class: "function-item", key: index, onClick: ($event) => $setup.handleFunctionClick(item) }, [ vue.createElementVNode( "view", { class: "function-icon", style: vue.normalizeStyle({ backgroundColor: item.bgColor }) }, [ vue.createElementVNode("image", { src: item.icon, mode: "aspectFit" }, null, 8, ["src"]) ], 4 /* STYLE */ ), vue.createElementVNode( "text", { class: "function-text" }, vue.toDisplayString(item.name), 1 /* TEXT */ ) ], 8, ["onClick"]); }), 128 /* KEYED_FRAGMENT */ )) ]) ]), vue.createCommentVNode(" 课程推荐卡片 "), vue.createElementVNode("view", { class: "course-cards" }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.courseCards, (card, index) => { return vue.openBlock(), vue.createElementBlock( "view", { class: "course-card", key: index, style: vue.normalizeStyle({ backgroundColor: card.bgColor }) }, [ vue.createElementVNode("view", { class: "card-content" }, [ vue.createElementVNode( "text", { class: "card-title" }, vue.toDisplayString(card.title), 1 /* TEXT */ ), vue.createElementVNode( "text", { class: "card-subtitle" }, vue.toDisplayString(card.subtitle), 1 /* TEXT */ ) ]), vue.createElementVNode("image", { class: "card-image", src: card.image, mode: "aspectFit" }, null, 8, ["src"]) ], 4 /* STYLE */ ); }), 128 /* KEYED_FRAGMENT */ )) ]), vue.createCommentVNode(" 课程列表 "), vue.createElementVNode("view", { class: "course-section" }, [ vue.createElementVNode("view", { class: "section-header" }, [ vue.createElementVNode("text", { class: "section-title" }, "大家都在学"), vue.createElementVNode("view", { class: "more-btn" }, [ vue.createElementVNode("text", null, "更多课程"), vue.createElementVNode("text", { class: "arrow-icon" }, "›") ]) ]), vue.createElementVNode("view", { class: "course-list" }, [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList($setup.courseList, (course, index) => { return vue.openBlock(), vue.createElementBlock("view", { class: "course-item", key: index, onClick: ($event) => $setup.handleCourseClick(course) }, [ vue.createElementVNode("image", { class: "course-cover", src: course.cover, mode: "aspectFill" }, null, 8, ["src"]), vue.createElementVNode("view", { class: "course-info" }, [ vue.createElementVNode( "text", { class: "course-title" }, vue.toDisplayString(course.title), 1 /* TEXT */ ), vue.createElementVNode("view", { class: "course-stats" }, [ vue.createElementVNode( "text", { class: "course-students" }, vue.toDisplayString(course.students) + "人学习", 1 /* TEXT */ ), vue.createElementVNode( "text", { class: "course-type" }, vue.toDisplayString(course.type), 1 /* TEXT */ ) ]), vue.createElementVNode( "text", { class: "course-desc" }, vue.toDisplayString(course.description), 1 /* TEXT */ ) ]) ], 8, ["onClick"]); }), 128 /* KEYED_FRAGMENT */ )) ]) ]) ]); } const PagesDiscoverDiscover = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-7f6951af"], ["__file", "E:/work/python_Harmony/python_Harmony/pages/discover/discover.vue"]]); const _sfc_main$4 = { __name: "codebase", setup(__props, { expose: __expose }) { __expose(); vue.onMounted(() => { formatAppLog("log", "at pages/codebase/codebase.vue:14", "代码库页面加载完成"); }); const __returned__ = { onMounted: vue.onMounted }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "codebase-container" }, [ vue.createElementVNode("view", { class: "page-content" }, [ vue.createElementVNode("text", { class: "page-title" }, "代码库"), vue.createElementVNode("text", { class: "page-desc" }, "这里是代码库页面,功能开发中...") ]) ]); } const PagesCodebaseCodebase = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-c13aa6cc"], ["__file", "E:/work/python_Harmony/python_Harmony/pages/codebase/codebase.vue"]]); const _sfc_main$3 = { __name: "editor", setup(__props, { expose: __expose }) { __expose(); vue.onMounted(() => { formatAppLog("log", "at pages/editor/editor.vue:14", "编辑器页面加载完成"); }); const __returned__ = { onMounted: vue.onMounted }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "editor-container" }, [ vue.createElementVNode("view", { class: "page-content" }, [ vue.createElementVNode("text", { class: "page-title" }, "编辑器"), vue.createElementVNode("text", { class: "page-desc" }, "这里是编辑器页面,功能开发中...") ]) ]); } const PagesEditorEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-17f547cb"], ["__file", "E:/work/python_Harmony/python_Harmony/pages/editor/editor.vue"]]); const _sfc_main$2 = { __name: "study", setup(__props, { expose: __expose }) { __expose(); vue.onMounted(() => { formatAppLog("log", "at pages/study/study.vue:14", "学习页面加载完成"); }); const __returned__ = { onMounted: vue.onMounted }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "study-container" }, [ vue.createElementVNode("view", { class: "page-content" }, [ vue.createElementVNode("text", { class: "page-title" }, "学习"), vue.createElementVNode("text", { class: "page-desc" }, "这里是学习页面,功能开发中...") ]) ]); } const PagesStudyStudy = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-3f273c1e"], ["__file", "E:/work/python_Harmony/python_Harmony/pages/study/study.vue"]]); const _sfc_main$1 = { __name: "profile", setup(__props, { expose: __expose }) { __expose(); vue.onMounted(() => { formatAppLog("log", "at pages/profile/profile.vue:14", "账号页面加载完成"); }); const __returned__ = { onMounted: vue.onMounted }; Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); return __returned__; } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "profile-container" }, [ vue.createElementVNode("view", { class: "page-content" }, [ vue.createElementVNode("text", { class: "page-title" }, "账号"), vue.createElementVNode("text", { class: "page-desc" }, "这里是账号页面,功能开发中...") ]) ]); } const PagesProfileProfile = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-dd383ca2"], ["__file", "E:/work/python_Harmony/python_Harmony/pages/profile/profile.vue"]]); __definePage("pages/discover/discover", PagesDiscoverDiscover); __definePage("pages/codebase/codebase", PagesCodebaseCodebase); __definePage("pages/editor/editor", PagesEditorEditor); __definePage("pages/study/study", PagesStudyStudy); __definePage("pages/profile/profile", PagesProfileProfile); const _sfc_main = { onLaunch: function() { formatAppLog("log", "at App.vue:4", "App Launch"); }, onShow: function() { formatAppLog("log", "at App.vue:7", "App Show"); }, onHide: function() { formatAppLog("log", "at App.vue:10", "App Hide"); } }; const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:/work/python_Harmony/python_Harmony/App.vue"]]); function createApp() { const app = vue.createVueApp(App); return { app }; } const { app: __app__, Vuex: __Vuex__, Pinia: __Pinia__ } = createApp(); uni.Vuex = __Vuex__; uni.Pinia = __Pinia__; __app__.provide("__globalStyles", __uniConfig.styles); __app__._component.mpType = "app"; __app__._component.render = () => { }; __app__.mount("#app"); })(Vue);