commit f2e1454a834f04bc9a042dbe65574a37773da362 Author: zhangjing Date: Wed Jun 21 17:04:42 2023 +0800 [盘债计算器] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..38adffa --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..fa1d212 --- /dev/null +++ b/App.vue @@ -0,0 +1,78 @@ + + + diff --git a/apis/index.js b/apis/index.js new file mode 100644 index 0000000..8c2dd13 --- /dev/null +++ b/apis/index.js @@ -0,0 +1,159 @@ + +/** + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import store from '@/store' + +// 基础配置 +const config = { + apiUrl : 'http://debt.douhuofalv.com/api/', // 正式环境 + timeout : 60000 +} + +let loginHintState = false + +// 网络请求 +const request = (parameter, hideLoding) => { + // 检查url配置 + if(parameter.url === 'undefined' || parameter.url === ''){ + uni.showToast({ + title: '请求地址不能为空', + icon : 'none' + }) + return + } + // 注入header + config.header = { + 'Accept': 'application/json', + 'Authorization': store.getters.getToken || '' + } + + // 加载提示 + if(!hideLoding) uni.showLoading({ + title: '加载中', + mask : true + }); + + // 请求实例 + return new Promise((resolve, reject) => { + uni.request({ + url : config.apiUrl + parameter.url, + timeout : config.timeout, + header : config.header || {}, + data : parameter.data || {}, + method : parameter.method || 'GET', + success : res => { + if (res.header.Authorization){ + updateToken('token', res.header.Authorization) + } + if(res.statusCode === 200){ + uni.hideLoading() + const resolveData = res.data + if(resolveData.status_code === 200) { + resolve(resolveData.data) + return + } + if(resolveData.status_code === 401) { + loginHint() + return + } + reject(resolveData) + return + } + errToast(res.statusCode) + } + }) + }) +} + +// 文件上传 +const uploading = (paths, driver) => { + + uni.showLoading({ + title: '上传中', + mask : true + }); + // 注入header + config.header = { + 'Accept': 'application/json', + 'Authorization': store.getters.getToken || '' + } + // 上传图片 + return new Promise((resolve, reject) => { + uni.uploadFile({ + url : config.apiUrl + 'storage/uploads', + files : paths, + header : config.header || {}, + formData: driver || {}, + success : res=>{ + if(res.statusCode === 200){ + uni.hideLoading() + let updData = JSON.parse(res.data) + if(updData.status_code === 200){ + resolve(updData.data) + return + } + reject(updData) + return + } + errToast(res.statusCode) + } + }) + }) +} + +// 处理一些http请求错误提示 +const errToast = (code) => { + switch (code){ + case 404: + uni.showToast({ + title: code + '接口不存在,请联系系统管理员', + icon : 'none' + }) + break; + case 405: + uni.showToast({ + title: code + '请检查接口请求方式错误', + icon : 'none' + }) + break; + case 500: + uni.showToast({ + title: code + '服务端错误,请检查服务器信息', + icon : 'none' + }) + break; + } +} + +// 更新token +const updateToken = (token) => { + store.commit('setToken', token) +} + +// 处理登录提示 +const loginHint = () => { + if( loginHintState ) return + if(!loginHintState) loginHintState = true + updateToken('') + uni.showModal({ + title: '登录提示', + content: '您的登录信息已过期,请重新登录', + confirmColor: '#8b64fd', + showCancel:false, + success: res=> { + loginHintState = false + if (res.confirm) uni.reLaunch({ + url:'/pages/index/index' + }) + } + }) +} + +export { + request, + uploading, + config +} diff --git a/apis/interfaces/authUrl.js b/apis/interfaces/authUrl.js new file mode 100644 index 0000000..af06d20 --- /dev/null +++ b/apis/interfaces/authUrl.js @@ -0,0 +1,29 @@ +/** + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import { request } from '../index' + +// 微信授权登录(获取跳转地址) +const authFollow = (data) => { + return request({ + url : 'user/auth/official/url', + data: data + }) +} + +// 微信登录(传入code) +const wechatCode = (data) => { + return request({ + url : 'user/auth/official/openid', + method: 'POST', + data: data + }) +} + + +export { + authFollow, + wechatCode +} diff --git a/apis/interfaces/index.js b/apis/interfaces/index.js new file mode 100644 index 0000000..b645055 --- /dev/null +++ b/apis/interfaces/index.js @@ -0,0 +1,67 @@ +/** + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import { request } from '../index' + +// 计算前置接口 +const Init = (data) => { + return request({ + url : 'init', + data: data + }) +} + + +// 开始计算 +const Debt = (data) => { + return request({ + url : 'debt', + method: 'POST', + data: data + }) +} + +// 完善用户信息 +const Info = (data) => { + return request({ + url : 'userinfo', + method: 'POST', + data: data + }) +} + +// 查看结果 +const Lists = (data) => { + return request({ + url : 'lists', + data: data + }) +} + +// 客户管理 +const Clients = (data) => { + return request({ + url : 'clients', + data: data + }) +} + +// 删除结果 +const logDel = (log_id) => { + return request({ + url : 'debt/' + log_id, + method: 'DELETE' + }) +} + + +export { + Init, + Debt, + Info, + Lists, + Clients, + logDel +} diff --git a/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js b/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js new file mode 100644 index 0000000..91fff37 --- /dev/null +++ b/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js @@ -0,0 +1,18 @@ +export default function h5Copy(content) { + + if (!document.queryCommandSupported('copy')) { + // 不支持 + return false + } + + let textarea = document.createElement("textarea") + textarea.value = content + textarea.readOnly = "readOnly" + document.body.appendChild(textarea) + textarea.select() // 选择对象 + textarea.setSelectionRange(0, content.length) //核心 + let result = document.execCommand("copy") // 执行浏览器复制命令 + textarea.remove() + return result + +} \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..36aa2bc --- /dev/null +++ b/main.js @@ -0,0 +1,18 @@ +import Vue from 'vue' +import App from './App' +import store from './store' + +// 导入组件库-海报 +import VueCanvasPoster from 'vue-canvas-poster' +// 注册组件库-海报 +Vue.use(VueCanvasPoster) + +Vue.prototype.$store = store +App.mpType = 'app' + + +const app = new Vue({ + ...App +}) +app.$mount() + diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..8eaf1c0 --- /dev/null +++ b/manifest.json @@ -0,0 +1,82 @@ +{ + "name" : "盘债计算器", + "appid" : "__UNI__59922A2", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : {}, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios" : {}, + /* SDK配置 */ + "sdkConfigs" : {} + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "", + "setting" : { + "urlCheck" : false + }, + "usingComponents" : true + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "2", + "h5" : { + "router" : { + "mode" : "history", + "base" : "/" + }, + "title" : "盘债计算器", + "devServer" : { + "https" : false + } + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..833762e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,79 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@babel/parser": { + "version": "7.22.5", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.5.tgz", + "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==" + }, + "@vue/compiler-sfc": { + "version": "2.7.14", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz", + "integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==", + "requires": { + "@babel/parser": "^7.18.4", + "postcss": "^8.4.14", + "source-map": "^0.6.1" + } + }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + }, + "csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + }, + "nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==" + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "postcss": { + "version": "8.4.24", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.24.tgz", + "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", + "requires": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" + }, + "vue": { + "version": "2.7.14", + "resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.14.tgz", + "integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==", + "requires": { + "@vue/compiler-sfc": "2.7.14", + "csstype": "^3.1.0" + } + }, + "vue-canvas-poster": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/vue-canvas-poster/-/vue-canvas-poster-1.2.1.tgz", + "integrity": "sha512-YY5ygbeQSqhiJyj6QXYgSRZ6Ywhvi1gVsfcvBIoCx4Yq9E/gAV32uOhnZz45qsklP86uGc9ypKJAXiX6Dzrdxw==", + "requires": { + "core-js": "^2.6.5", + "vue": "^2.6.10" + } + } + } +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..11a69dd --- /dev/null +++ b/pages.json @@ -0,0 +1,61 @@ +{ + "pages": [ + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "盘债计算器" + } + }, + { + "path": "pages/index/perfect", + "style": { + "navigationBarTitleText": "完善个人信息" + } + }, + { + "path": "pages/index/clients", + "style": { + "navigationBarTitleText": "客户管理" + } + }, + { + "path": "pages/index/custom", + "style": { + "navigationBarTitleText": "客户管理" + } + }, + { + "path": "pages/result/result", + "style": { + "navigationBarTitleText": "盘债计算器" + } + }, + { + "path": "pages/result/other", + "style": { + "navigationBarTitleText": "盘债计算器" + } + }, + + { + "path": "pages/result/history", + "style": { + "navigationBarTitleText": "历史记录" + } + }, + { + "path": "pages/webview/webview", + "style": { + "navigationBarTitleText": "微信授权" + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "盘债计算器", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8", + "navigationStyle":"custom" + }, + "uniIdRouter": {} +} diff --git a/pages/index/clients.vue b/pages/index/clients.vue new file mode 100644 index 0000000..2d1599e --- /dev/null +++ b/pages/index/clients.vue @@ -0,0 +1,565 @@ + + + + + \ No newline at end of file diff --git a/pages/index/custom.vue b/pages/index/custom.vue new file mode 100644 index 0000000..d701273 --- /dev/null +++ b/pages/index/custom.vue @@ -0,0 +1,114 @@ + + + + + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..003a09a --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,931 @@ + + + + + diff --git a/pages/index/perfect.vue b/pages/index/perfect.vue new file mode 100644 index 0000000..f69db69 --- /dev/null +++ b/pages/index/perfect.vue @@ -0,0 +1,180 @@ + + + + + \ No newline at end of file diff --git a/pages/result/history.vue b/pages/result/history.vue new file mode 100644 index 0000000..fe0eb0f --- /dev/null +++ b/pages/result/history.vue @@ -0,0 +1,708 @@ + + + + + \ No newline at end of file diff --git a/pages/result/other.vue b/pages/result/other.vue new file mode 100644 index 0000000..8f447ca --- /dev/null +++ b/pages/result/other.vue @@ -0,0 +1,251 @@ + + + + + \ No newline at end of file diff --git a/pages/result/result.vue b/pages/result/result.vue new file mode 100644 index 0000000..2422771 --- /dev/null +++ b/pages/result/result.vue @@ -0,0 +1,614 @@ + + + + + \ No newline at end of file diff --git a/pages/webview/webview.vue b/pages/webview/webview.vue new file mode 100644 index 0000000..47ea8da --- /dev/null +++ b/pages/webview/webview.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/static/add.png b/static/add.png new file mode 100644 index 0000000..3dfbbbd Binary files /dev/null and b/static/add.png differ diff --git a/static/arrow.png b/static/arrow.png new file mode 100644 index 0000000..fe22690 Binary files /dev/null and b/static/arrow.png differ diff --git a/static/basic_down.png b/static/basic_down.png new file mode 100644 index 0000000..2880fe5 Binary files /dev/null and b/static/basic_down.png differ diff --git a/static/close.png b/static/close.png new file mode 100644 index 0000000..5408c97 Binary files /dev/null and b/static/close.png differ diff --git a/static/hand.png b/static/hand.png new file mode 100644 index 0000000..02d35b6 Binary files /dev/null and b/static/hand.png differ diff --git a/static/index_top.png b/static/index_top.png new file mode 100644 index 0000000..abc7e29 Binary files /dev/null and b/static/index_top.png differ diff --git a/static/loadingGif.gif b/static/loadingGif.gif new file mode 100644 index 0000000..d08d4e3 Binary files /dev/null and b/static/loadingGif.gif differ diff --git a/static/lock.png b/static/lock.png new file mode 100644 index 0000000..bc923e6 Binary files /dev/null and b/static/lock.png differ diff --git a/static/record.png b/static/record.png new file mode 100644 index 0000000..ae5a247 Binary files /dev/null and b/static/record.png differ diff --git a/static/removeIcon.png b/static/removeIcon.png new file mode 100644 index 0000000..fa4396c Binary files /dev/null and b/static/removeIcon.png differ diff --git a/static/share.png b/static/share.png new file mode 100644 index 0000000..e5c2a66 Binary files /dev/null and b/static/share.png differ diff --git a/static/share_back.png b/static/share_back.png new file mode 100644 index 0000000..0d378e7 Binary files /dev/null and b/static/share_back.png differ diff --git a/static/share_downback.png b/static/share_downback.png new file mode 100644 index 0000000..4caa7de Binary files /dev/null and b/static/share_downback.png differ diff --git a/static/tel.png b/static/tel.png new file mode 100644 index 0000000..d7bebe8 Binary files /dev/null and b/static/tel.png differ diff --git a/static/tips.png b/static/tips.png new file mode 100644 index 0000000..89063da Binary files /dev/null and b/static/tips.png differ diff --git a/static/user_default.png b/static/user_default.png new file mode 100644 index 0000000..711de9b Binary files /dev/null and b/static/user_default.png differ diff --git a/static/warm.png b/static/warm.png new file mode 100644 index 0000000..926971b Binary files /dev/null and b/static/warm.png differ diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..66cfaf5 --- /dev/null +++ b/store/index.js @@ -0,0 +1,59 @@ + +/** + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +import Vue from 'vue' +import Vuex from 'vuex' + +Vue.use(Vuex) + +export default new Vuex.Store({ + state: { + token : uni.getStorageSync('token') || '', + invite : uni.getStorageSync('invite') || '', + shareUser : uni.getStorageSync('shareUser') || '', + lockId : uni.getStorageSync('lockId') || '', + passinfo : uni.getStorageSync('passinfo') || '' + }, + getters: { + getToken: state => { + return state.token + }, + getInvite: state => { + return state.invite + }, + getShareUser: state => { + return state.shareUser + }, + getLockId: state => { + return state.lockId + }, + getPassInfo: state => { + return state.passinfo + } + }, + mutations: { + setToken(state, tokenString) { + state.token = tokenString + uni.setStorageSync('token', tokenString) + }, + setInvite(state, inviteString) { + state.invite = inviteString + uni.setStorageSync('invite', inviteString) + }, + setShareUser(state, shareString) { + state.shareUser = shareString + uni.setStorageSync('shareUser', shareString) + }, + setLockId(state, lockIdString) { + state.lockId = lockIdString + uni.setStorageSync('lockId', lockIdString) + }, + setPassInfo(state, passString) { + state.passinfo = passString + uni.setStorageSync('passinfo', JSON.stringify(passString)) + } + } +}) diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..a05adb4 --- /dev/null +++ b/uni.scss @@ -0,0 +1,76 @@ +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ + +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ + +/* 颜色变量 */ + +/* 行为相关颜色 */ +$uni-color-primary: #007aff; +$uni-color-success: #4cd964; +$uni-color-warning: #f0ad4e; +$uni-color-error: #dd524d; + +/* 文字基本颜色 */ +$uni-text-color:#333;//基本色 +$uni-text-color-inverse:#fff;//反色 +$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 +$uni-text-color-placeholder: #808080; +$uni-text-color-disable:#c0c0c0; + +/* 背景颜色 */ +$uni-bg-color:#ffffff; +$uni-bg-color-grey:#f8f8f8; +$uni-bg-color-hover:#f1f1f1;//点击状态颜色 +$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 + +/* 边框颜色 */ +$uni-border-color:#c8c7cc; + +/* 尺寸变量 */ + +/* 文字尺寸 */ +$uni-font-size-sm:12px; +$uni-font-size-base:14px; +$uni-font-size-lg:16; + +/* 图片尺寸 */ +$uni-img-size-sm:20px; +$uni-img-size-base:26px; +$uni-img-size-lg:40px; + +/* Border Radius */ +$uni-border-radius-sm: 2px; +$uni-border-radius-base: 3px; +$uni-border-radius-lg: 6px; +$uni-border-radius-circle: 50%; + +/* 水平间距 */ +$uni-spacing-row-sm: 5px; +$uni-spacing-row-base: 10px; +$uni-spacing-row-lg: 15px; + +/* 垂直间距 */ +$uni-spacing-col-sm: 4px; +$uni-spacing-col-base: 8px; +$uni-spacing-col-lg: 12px; + +/* 透明度 */ +$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 + +/* 文章场景相关 */ +$uni-color-title: #2C405A; // 文章标题颜色 +$uni-font-size-title:20px; +$uni-color-subtitle: #555555; // 二级标题颜色 +$uni-font-size-subtitle:26px; +$uni-color-paragraph: #3F536E; // 文章段落颜色 +$uni-font-size-paragraph:15px;