diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..08aeb98 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.cursorindexingignore +.specstory/ +node_modules/ +uni_modules/ +unpackage/ diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..81f13f4 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "default" : + { + "launchtype" : "local" + }, + "mp-weixin" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..b300a1d --- /dev/null +++ b/App.vue @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 5579db7..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# 存客宝小程序 - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 83753fa..0000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# 存客宝小程序 - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/config.js b/config.js new file mode 100644 index 0000000..8fd78ce --- /dev/null +++ b/config.js @@ -0,0 +1,7 @@ +// config.js +export default { + apiUrl: 'https://api.ckb.quwanzhi.com', + apiUrl2: 'https://ckbapi.quwanzhi.com', + //apiUrl2: 'http://www.yishi.com', + // 其他全局配置项 +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..c3ff205 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..cf1c83a --- /dev/null +++ b/main.js @@ -0,0 +1,42 @@ +// #ifndef VUE3 +import Vue from 'vue' +import App from './App' +import config from './config.js' + + +import authMixin from './mixins/auth-mixin'; +Vue.mixin(authMixin); + +Vue.config.productionTip = false +Vue.prototype.$config = config + +//兼容旧版 +Vue.prototype.$wxAppId = 'wx789850448e26c91d'; +Vue.prototype.$wxApi = 'https://api.quwanzhi.com'; +Vue.prototype.$settingData = []; +Vue.prototype.$userInfo = {}; + + +import uView from "uview-ui"; +Vue.use(uView); + +App.mpType = 'app' + +const app = new Vue({ + ...App +}) +app.$mount() +// #endif + +// #ifdef VUE3 +import { + createSSRApp +} from 'vue' +import App from './App.vue' +export function createApp() { + const app = createSSRApp(App) + return { + app + } +} +// #endif \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..c97bf68 --- /dev/null +++ b/manifest.json @@ -0,0 +1,63 @@ +{ + "name" : "存客宝", + "appid" : "__UNI__505D381", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + "app-plus" : { + /* 5+App特有相关 */ + "usingComponents" : true, + "nvueCompiler" : "uni-app", + "nvueStyleCompiler" : "uni-app", + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + "modules" : {}, + /* 模块配置 */ + "distribute" : { + /* 应用发布信息 */ + "android" : { + /* android打包配置 */ + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ios" : {}, + /* ios打包配置 */ + "sdkConfigs" : {} + } + }, + /* SDK配置 */ + "quickapp" : {}, + /* 快应用特有相关 */ + "mp-weixin" : { + /* 小程序特有相关 */ + "appid" : "wx789850448e26c91d", + "setting" : { + "urlCheck" : false, + "minified" : true, + "postcss" : true, + "es6" : true + }, + "usingComponents" : true + }, + "vueVersion" : "2" +} diff --git a/mixins/auth-mixin.js b/mixins/auth-mixin.js new file mode 100644 index 0000000..983759e --- /dev/null +++ b/mixins/auth-mixin.js @@ -0,0 +1,69 @@ +export default { + methods: { + checkLogin() { + const pages = getCurrentPages(); + const currentPage = pages[pages.length - 1]; + let fullPath = ''; + let queryString = ''; + + // #ifdef H5 + fullPath = window.location.hash ? window.location.hash.substring(1) : window.location.pathname; + queryString = window.location.search; + // #endif + + // #ifdef MP + fullPath = `/${currentPage.route}`; // 在小程序中使用route + // Combine existing options with the scene parameter if it exists + const options = { + ...currentPage.options + }; + + queryString = this.objectToQueryString(options); + + if (this.$root.$mp.query.scene) { + queryString += "&" + decodeURIComponent(this.$root.$mp.query.scene) + } + + // #endif + + const redirectUrl = fullPath + "?" + queryString; + + + // 如果当前已经在登录页,则不进行跳转 + if ( + fullPath.includes('pages/login/login') || + fullPath.includes('pages/index/index') || + fullPath.includes('pages/index/site') || + fullPath.includes('pages/poster/index') || + fullPath.includes('pages/form/input')|| + fullPath.includes('pages/login/privatememo')|| + fullPath.includes('pages/login/usermemo') || + fullPath.includes('pages/channel/add')|| + fullPath.includes('pages/channel/login')|| + fullPath.includes('pages/channel/statistics') + ) { + return; + } + // 未登录则跳转到登录页 + else if (!this.isLoggedIn()) { + uni.redirectTo({ + url: '/pages/login/login?redirect=' + encodeURIComponent(redirectUrl), + }); + } + }, + + isLoggedIn() { + const token = uni.getStorageSync('token'); + return !!token; + }, + + // 将对象转换为查询字符串 + objectToQueryString(obj) { + return Object.keys(obj).map(key => `${key}=${encodeURIComponent(obj[key])}`).join('&'); + }, + }, + + onLoad() { + this.checkLogin(); + }, +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..659babf --- /dev/null +++ b/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "ckb_mini", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "uview-ui": "^2.0.36" + } + }, + "node_modules/uview-ui": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz", + "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==", + "engines": { + "HBuilderX": "^3.1.0" + } + } + }, + "dependencies": { + "uview-ui": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz", + "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..49fd105 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "uview-ui": "^2.0.36" + } +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..3ba4580 --- /dev/null +++ b/pages.json @@ -0,0 +1,181 @@ +{ + "pages": [ + { + "path": "pages/index/site", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "", + "enableShareAppMessage": true + } + }, + { + "path": "pages/poster/index", + "style": { + "navigationBarTitleText": "", + "enableShareAppMessage": true + } + }, + { + "path": "pages/poster/index2", + "style": { + "navigationBarTitleText": "", + "enableShareAppMessage": true + } + }, + { + "path": "pages/about/about", + "style": { + "navigationBarTitleText": "", + "enableShareAppMessage": true + } + }, { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, { + "path": "pages/home/home", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, { + "path": "pages/ucenter/ucenter", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, { + "path": "pages/form/input", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/form/input2", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/form/list", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/channel/list", + "style": { + "navigationBarTitleText": "渠道管理", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/channel/add", + "style": { + "navigationBarTitleText": "新增渠道", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/channel/login", + "style": { + "navigationBarTitleText": "渠道登录", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/channel/project-select", + "style": { + "navigationBarTitleText": "选择项目", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/channel/statistics", + "style": { + "navigationBarTitleText": "分销获客统计", + "enablePullDownRefresh": true + } + } + ], + // "tabBar": { + // "color": "#7A7E83", + // "selectedColor": "#007AFF", + // "borderStyle": "black", + // "backgroundColor": "#FFFFFF", + // "list": [{ + // "pagePath": "pages/home/home", + // "iconPath": "static/tabbar/list.png", + // "selectedIconPath": "static/tabbar/list_active.png", + // "text": "主页" + // }, { + // "pagePath": "pages/ucenter/ucenter", + // "iconPath": "static/tabbar/me.png", + // "selectedIconPath": "static/tabbar/me_active.png", + // "text": "我的" + // }] + // }, + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8", + "app-plus": { + "background": "#efeff4" + } + }, + "easycom": { + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" + }, + "condition": { //模式配置,仅开发期间生效 + "current": 1, //当前激活的模式(list 的索引项) + "list": [{ + "name": "首页", //模式名称 + "path": "pages/index/index", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }, + { + "name": "webview", //模式名称 + "path": "pages/index/site", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }, + { + "name": "旧版海报页", //模式名称 + "path": "pages/about/about", //启动页面,必选 + "query": "taskId=491" //启动参数,在页面的onLoad函数里面得到 + }, + { + "name": "新版海报页", //模式名称 + "path": "pages/poster/index", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }, + { + "name": "登录页", //模式名称 + "path": "pages/login/login", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }, + { + "name": "我的", //模式名称 + "path": "pages/ucenter/ucenter", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + }, + { + "name": "表单", //模式名称 + "path": "pages/form/input", //启动页面,必选 + "query": "id=505" //启动参数,在页面的onLoad函数里面得到 + } + ] + } +} \ No newline at end of file diff --git a/pages/about/about.vue b/pages/about/about.vue new file mode 100644 index 0000000..9739358 --- /dev/null +++ b/pages/about/about.vue @@ -0,0 +1,119 @@ + + + + + \ No newline at end of file diff --git a/pages/channel/add.vue b/pages/channel/add.vue new file mode 100644 index 0000000..5c3ffdd --- /dev/null +++ b/pages/channel/add.vue @@ -0,0 +1,801 @@ + + + + + diff --git a/pages/form/input2.vue b/pages/form/input2.vue new file mode 100644 index 0000000..881d5fc --- /dev/null +++ b/pages/form/input2.vue @@ -0,0 +1,424 @@ + + + + + \ No newline at end of file diff --git a/pages/form/list.vue b/pages/form/list.vue new file mode 100644 index 0000000..31b343a --- /dev/null +++ b/pages/form/list.vue @@ -0,0 +1,113 @@ + + + + + \ No newline at end of file diff --git a/pages/home/home.vue b/pages/home/home.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/pages/home/home.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..8086a30 --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,912 @@ + + + + + diff --git a/pages/index/site.vue b/pages/index/site.vue new file mode 100644 index 0000000..c2f2024 --- /dev/null +++ b/pages/index/site.vue @@ -0,0 +1,167 @@ + + + + + \ No newline at end of file diff --git a/pages/login/login-page.scss b/pages/login/login-page.scss new file mode 100644 index 0000000..5de6899 --- /dev/null +++ b/pages/login/login-page.scss @@ -0,0 +1,126 @@ +// 隐藏 edge 浏览器的密码查看按钮 + +/* #ifdef H5 */ +.input-box ::v-deep{ + .uni-input-input[type="password"] { + &::-ms-reveal { + display: none; + } + } +} +/* #endif */ + +.uni-content { + padding: 0 60rpx; +} + +.login-logo { + display: none; +} + +/* #ifndef APP-NVUE */ +@media screen and (min-width: 690px) { + .uni-content { + /* #ifndef H5 */ + padding: 0; + max-width: 300px; + margin-left: calc(50% - 200px); + /* #endif */ + /* #ifdef H5 */ + margin: 0 auto; + position: relative; + top: 100px; + padding: 30px 40px 80px 40px; + max-width: 450px; + max-height: 450px; + border-radius: 10px; + box-shadow: 0 0 20px #efefef; + background-color: #FFF; + /* #endif */ + } + /* #ifdef H5 */ + .login-logo { + display: flex; + justify-content: center; + } + + .login-logo image { + width: 60px; + height: 60px; + } + + .register-back{ + display: none; + } + + uni-button{ + padding-bottom: 1px; + } + + /* #endif */ +} + +.uni-content view { + box-sizing: border-box; +} +/* #endif */ + + + +.title { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + padding: 18px 0; + font-weight: 800; + flex-direction: column; +} + +.tip { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + color: #BDBDC0; + font-size: 11px; + margin: 6px 0; +} + + +/* #ifndef APP-NVUE */ +// 解决小程序端开启虚拟节点virtualHost引起的 class = input-box丢失的问题 [详情参考](https://uniapp.dcloud.net.cn/matter.html#%E5%90%84%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0%E6%9C%BA%E5%88%B6%E4%B8%8D%E5%90%8C-%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E7%9A%84%E5%B9%B3%E5%8F%B0%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98) +.uni-content ::v-deep .uni-easyinput__content, +/* #endif */ + +.input-box { + height: 44px; + background-color: #F8F8F8 !important; + border-radius: 0; + font-size: 14px; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex: 1; +} + +.link { + color: #04498c; + cursor: pointer; +} + +.uni-content ::v-deep .uni-forms-item__inner { + padding-bottom: 8px; +} + +.uni-btn { + text-align: center; + height: 40px; + line-height: 40px; + margin: 15px 0 10px 0; + color: #FFF !important; + border-radius: 5px; + font-size: 16px; +} + +.uni-body.uni_modules-uni-id-pages-pages-login-login-withoutpwd{ + height: auto !important; +} diff --git a/pages/login/login.vue b/pages/login/login.vue new file mode 100644 index 0000000..bc55125 --- /dev/null +++ b/pages/login/login.vue @@ -0,0 +1,197 @@ + + + + + \ No newline at end of file diff --git a/pages/poster/index.vue b/pages/poster/index.vue new file mode 100644 index 0000000..65be896 --- /dev/null +++ b/pages/poster/index.vue @@ -0,0 +1,134 @@ + + + + + \ No newline at end of file diff --git a/pages/poster/index2.vue b/pages/poster/index2.vue new file mode 100644 index 0000000..b3a94e0 --- /dev/null +++ b/pages/poster/index2.vue @@ -0,0 +1,193 @@ + + + + + \ No newline at end of file diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue new file mode 100644 index 0000000..aec8ffb --- /dev/null +++ b/pages/ucenter/ucenter.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..0f5f353 --- /dev/null +++ b/project.config.json @@ -0,0 +1,28 @@ +{ + "appid": "wx3724765328cccf03", + "compileType": "miniprogram", + "libVersion": "3.8.10", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + } +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..670c139 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,7 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "ckb_mini", + "setting": { + "compileHotReLoad": true + } +} \ No newline at end of file diff --git a/static/c1.png b/static/c1.png new file mode 100644 index 0000000..9d38fdc Binary files /dev/null and b/static/c1.png differ diff --git a/static/c2.png b/static/c2.png new file mode 100644 index 0000000..ce956d7 Binary files /dev/null and b/static/c2.png differ diff --git a/static/c3.png b/static/c3.png new file mode 100644 index 0000000..216202a Binary files /dev/null and b/static/c3.png differ diff --git a/static/c4.png b/static/c4.png new file mode 100644 index 0000000..fb8b477 Binary files /dev/null and b/static/c4.png differ diff --git a/static/c5.png b/static/c5.png new file mode 100644 index 0000000..310bfb1 Binary files /dev/null and b/static/c5.png differ diff --git a/static/c6.png b/static/c6.png new file mode 100644 index 0000000..c3c45d8 Binary files /dev/null and b/static/c6.png differ diff --git a/static/c7.png b/static/c7.png new file mode 100644 index 0000000..a1e7390 Binary files /dev/null and b/static/c7.png differ diff --git a/static/c8.png b/static/c8.png new file mode 100644 index 0000000..c32633c Binary files /dev/null and b/static/c8.png differ diff --git a/static/c9.png b/static/c9.png new file mode 100644 index 0000000..51bcf6a Binary files /dev/null and b/static/c9.png differ diff --git a/static/customicons.css b/static/customicons.css new file mode 100644 index 0000000..14ed5fa --- /dev/null +++ b/static/customicons.css @@ -0,0 +1,20 @@ +@font-face { + font-family: "customicons"; /* Project id 2878519 */ + src:url('/static/customicons.ttf') format('truetype'); +} + +.customicons { + font-family: "customicons" !important; +} + +.youxi:before { + content: "\e60e"; +} + +.wenjian:before { + content: "\e60f"; +} + +.zhuanfa:before { + content: "\e610"; +} diff --git a/static/customicons.ttf b/static/customicons.ttf new file mode 100644 index 0000000..a3c8ab9 Binary files /dev/null and b/static/customicons.ttf differ diff --git a/static/headers.png b/static/headers.png new file mode 100644 index 0000000..431356f Binary files /dev/null and b/static/headers.png differ diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..b5771e2 Binary files /dev/null and b/static/logo.png differ diff --git a/static/tabbar/grid.png b/static/tabbar/grid.png new file mode 100644 index 0000000..938b821 Binary files /dev/null and b/static/tabbar/grid.png differ diff --git a/static/tabbar/grid_active.png b/static/tabbar/grid_active.png new file mode 100644 index 0000000..807d9c7 Binary files /dev/null and b/static/tabbar/grid_active.png differ diff --git a/static/tabbar/list.png b/static/tabbar/list.png new file mode 100644 index 0000000..303bb4c Binary files /dev/null and b/static/tabbar/list.png differ diff --git a/static/tabbar/list_active.png b/static/tabbar/list_active.png new file mode 100644 index 0000000..0ff8c49 Binary files /dev/null and b/static/tabbar/list_active.png differ diff --git a/static/tabbar/me.png b/static/tabbar/me.png new file mode 100644 index 0000000..b54f39f Binary files /dev/null and b/static/tabbar/me.png differ diff --git a/static/tabbar/me_active.png b/static/tabbar/me_active.png new file mode 100644 index 0000000..e727614 Binary files /dev/null and b/static/tabbar/me_active.png differ diff --git a/static/uni.png b/static/uni.png new file mode 100644 index 0000000..8e3a80f Binary files /dev/null and b/static/uni.png differ diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..d461177 --- /dev/null +++ b/uni.scss @@ -0,0 +1,4 @@ +@import '@/uni_modules/uni-scss/variables.scss'; + +/* uni.scss */ +@import 'uview-ui/theme.scss'; \ No newline at end of file diff --git a/utils/request.js b/utils/request.js new file mode 100644 index 0000000..8e5f783 --- /dev/null +++ b/utils/request.js @@ -0,0 +1,50 @@ +// utils/request.js +import config from '@/config'; + +export function request(options) { + // 在请求发送前做一些处理,如添加 token + const token = uni.getStorageSync('token'); + + options.header = options.header || {}; + options.header['token'] = token; + options.header['content-type'] = 'application/x-www-form-urlencoded'; + + options.method = options.method || "POST"; + options.url = config.apiUrl + options.url; + + return new Promise((resolve, reject) => { + uni.request({ + ...options, + success: (response) => { + if (response.data.code == 10030) { + // 没有登录,跳转到登录页,并带上当前页面的URL + redirectToLoginWithRedirect(); + } else { + resolve(response); + } + }, + fail: (error) => { + reject(error); + }, + }); + }); +} + +function redirectToLoginWithRedirect() { + let currentRoute = ''; + // 获取当前页面路径和参数 + const pages = getCurrentPages(); + if (pages.length) { + const currentPage = pages[pages.length - 1]; + currentRoute = currentPage.route; + const query = Object.keys(currentPage.options) + .map(key => `${key}=${currentPage.options[key]}`) + .join('&'); + if (query) currentRoute += '?' + query; + } + + // 重定向到登录页面 + uni.redirectTo({ + url: `/pages/login/login?redirect=${encodeURIComponent(currentRoute)}`, + }); +} \ No newline at end of file