From 4bc02948293dd6d1712c173a12438dffaafce31d Mon Sep 17 00:00:00 2001 From: sx <2427911852@qq.com> Date: Sun, 5 Jan 2025 15:43:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jiuyi2/App.vue | 8 +- jiuyi2/api/durian.js | 22 +++ jiuyi2/api/index.js | 6 +- jiuyi2/common/js/util.js | 4 +- jiuyi2/components/index/task.vue | 13 +- jiuyi2/components/login/notice.vue | 2 +- jiuyi2/pages/index/article.vue | 10 +- jiuyi2/pages/index/durainActivation.vue | 62 ++++++-- jiuyi2/pages/index/durian.vue | 27 ++-- jiuyi2/pages/index/durianLog.vue | 16 ++- jiuyi2/pages/index/index.nvue | 10 +- jiuyi2/pages/mine/setting/secondPwd.vue | 100 +++++++------ jiuyi2/pages/mine/setting/setting.vue | 13 +- jiuyi2/readme.md | 23 ++- jiuyi2/store/index.js | 7 + .../cc-defineKeyboard/cc-defineKeyboard.vue | 135 ++++++++---------- jiuyi2/vite.config.js | 6 +- 17 files changed, 268 insertions(+), 196 deletions(-) diff --git a/jiuyi2/App.vue b/jiuyi2/App.vue index e95bd8ef..f3d30422 100644 --- a/jiuyi2/App.vue +++ b/jiuyi2/App.vue @@ -44,7 +44,13 @@ // 获取系统配置 getConfig() { api.getConfig().then(rs => { - + if(rs.code == 200) { + store.commit('setState', { + key: 'config', + value: rs.data + }) + return + } }) } } diff --git a/jiuyi2/api/durian.js b/jiuyi2/api/durian.js index 30e3dfa9..03011083 100644 --- a/jiuyi2/api/durian.js +++ b/jiuyi2/api/durian.js @@ -3,6 +3,28 @@ import util from '@/common/js/util.js' // 卷轴积分 export const durian = { + /** + * 果树列表 + * @param {Object} param + */ + durianList(param) { + return util.request({ + url: `/coreplay/duriantreeinfo/tree-list`, + method: 'GET', + query: param.query, + }) + }, + /** + * 榴莲果释放明细 + * @param {Object} param + */ + getLog(param) { + return util.request({ + url: `/coreplay/durianfruitdetail/getDetailInfoByTreeId`, + method: 'GET', + query: param.query, + }) + }, /** * 果树列表 * @param {Object} param diff --git a/jiuyi2/api/index.js b/jiuyi2/api/index.js index 9f8eb52f..8365bcc8 100644 --- a/jiuyi2/api/index.js +++ b/jiuyi2/api/index.js @@ -46,9 +46,9 @@ const api = { */ getArticle(param) { return util.request({ - url: '/home/getArticle', - query: param.query, - method: 'POST', + url: '/user/protocol/inquire', + path: param.path, + method: 'GET', }) }, diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js index a093f6e5..bacce249 100644 --- a/jiuyi2/common/js/util.js +++ b/jiuyi2/common/js/util.js @@ -1728,9 +1728,7 @@ const util = { uni.setClipboardData({ data: text, success: () => { - util.alert({ - title: '文本已复制到剪贴板', - }) + util.alert('文本已复制到剪贴板') } }); }, diff --git a/jiuyi2/components/index/task.vue b/jiuyi2/components/index/task.vue index da96d48c..bef20ecb 100644 --- a/jiuyi2/components/index/task.vue +++ b/jiuyi2/components/index/task.vue @@ -19,10 +19,21 @@ const task = computed(() => { return store.state.task }) + // 系统配置 + const config = computed(() => { + return store.state.config + }) // 进度条 const progress = computed(() => { let result = task.value.viewingDuration - result = (Number(result) % 300) / 3 + // 选项 + const option = { + // 优先任务转换 + 0: config.value.TASK_READING_SECOND, + // 有效读秒转换 + 1: config.value.EFFECTIVE_SECONDS, + } + result = (Number(result) % Number(option[task.value.taskType])) / 3 return result }) diff --git a/jiuyi2/components/login/notice.vue b/jiuyi2/components/login/notice.vue index 79b36a83..12f998d6 100644 --- a/jiuyi2/components/login/notice.vue +++ b/jiuyi2/components/login/notice.vue @@ -37,7 +37,7 @@ 已阅读并同意 - 服务协议 + 用户协议 隐私政策 diff --git a/jiuyi2/pages/index/article.vue b/jiuyi2/pages/index/article.vue index 59d1dd7d..3ff9662c 100644 --- a/jiuyi2/pages/index/article.vue +++ b/jiuyi2/pages/index/article.vue @@ -15,7 +15,9 @@ import api from '@/api'; // 内容 - const wrap = reactive({}) + const wrap = reactive({ + content: `` + }) // 对应内容id const wrapId = ref('') @@ -28,9 +30,7 @@ // 获取详情 function getDetail() { api.getArticle({ - query: { - id: wrapId.value - } + path: [wrapId.value] }).then(rs => { if (rs.code == 200) { Object.assign(wrap, rs.data) @@ -50,7 +50,7 @@ {{wrap.name}} - + diff --git a/jiuyi2/pages/index/durainActivation.vue b/jiuyi2/pages/index/durainActivation.vue index 5ed9e0aa..3d72bc78 100644 --- a/jiuyi2/pages/index/durainActivation.vue +++ b/jiuyi2/pages/index/durainActivation.vue @@ -14,7 +14,10 @@ import { onLoad } from '@dcloudio/uni-app' - import durianlApi from '@/api/durian.js'; + // 工具库 + import util from '@/common/js/util'; + // + import api from '@/api/index.js'; const treeData = ref([]) const store = useStore() const userinfo = computed(() => { @@ -29,30 +32,69 @@ // 我的榴莲果树 function buyDurianList() { - durianlApi.buyDurianList({}).then(rs => { + api.durian.buyDurianList({}).then(rs => { if (rs.code == 200) { - treeData.value = rs.data.dataList + treeData.value = rs.data.dataList.map(item => { + item.formatHash = formatStr(item.treeHash) + return item + }) return } - util.alert({ content: rs.msg, showCancel: false }) }) } + + /** + * 处理字符串 + * @param {Object} str + */ + function formatStr(str) { + // 如果字符串长度小于等于6,直接返回原字符串 + if (str.length <= 6) return str + return str.slice(0, 3) + '***' + str.slice(-3); // 拼接结果 + } + + + /** + * 跳转详情 + * @param {Object} item + */ + function handleDetail(item) { + uni.navigateTo({ + url: util.setUrl('/pages/index/durianLog', { + id: item.durianTreeId, + }) + }) + } + + /** + * 复制 + * @param {Object} ev 需要复制的码 + */ + function handleCopy(ev) { + util.copyText(ev) + } diff --git a/jiuyi2/pages/index/index.nvue b/jiuyi2/pages/index/index.nvue index 5f7cac6a..3e829907 100644 --- a/jiuyi2/pages/index/index.nvue +++ b/jiuyi2/pages/index/index.nvue @@ -54,10 +54,6 @@ const oclockWindow = ref(false) // 有效读秒 const readSecond = reactive({ - // 单个视频最大 - max: 20, - // 总数最大 - totalMax: 300, // 定时器 timer: null, }) @@ -144,6 +140,10 @@ const currentVideoRef = computed(() => { return proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]] }) + // 系统配置 + const config = computed(() => { + return uni.$store.state.config + }) // 加载完成之后 onLoad(() => { @@ -411,7 +411,7 @@ // 开启计时器 readSecond.timer = setInterval(() => { // 当前视频有效读秒 小于等于 最大有效读秒限制(视频最大时长-2s,设置的有效读秒上限) - if (item.readSecond < Math.min(Math.floor(item.videoDuration) - 2, 20)) { + if (item.readSecond < Math.min(Math.floor(item.videoDuration) - 2, config.value.EFFECTIVE_VIDEO_TIME)) { // 增加这条视频的有效读秒 item.readSecond++ } else { diff --git a/jiuyi2/pages/mine/setting/secondPwd.vue b/jiuyi2/pages/mine/setting/secondPwd.vue index da5e3095..a7af100b 100644 --- a/jiuyi2/pages/mine/setting/secondPwd.vue +++ b/jiuyi2/pages/mine/setting/secondPwd.vue @@ -9,27 +9,31 @@ import { useStore } from 'vuex' + import { + onReady, + } from '@dcloudio/uni-app' // api import api from '@/api/index.js' // util import util from '@/common/js/util.js' // 加密 import CryptoJS from 'crypto-js'; + // + import codeInput from '@/components/mine/codeInput.vue' const { proxy } = getCurrentInstance() // const store = useStore() - // 模式 set设置密码 check验证密码 + // 模式 set设置密码 rePwd确认密码 check验证密码 const mode = ref('set') // 表单 const form = reactive({ pwd: '', rePwd: '', }) - // - const passwordArr = reactive([]) - const AffirmStatus = ref(1) + // 当前输入表单键 + const formKey = reactive('pwd') // 用户信息 const userinfo = computed(() => { let result = store.state.userinfo @@ -37,18 +41,42 @@ return result }) + onReady(() => { + proxy.$refs.CodeKeyboard.show(); + }) + + // 下一步 + function handleNext() { + const data = { + ...form + } + // 验证必填项 + if (!form.pwd) { + util.alert('二级密码不能为空') + } + mode.value = 'rePwd' + } + // 确认输入密码 function handleSubmit() { const data = { ...form } + console.log('data', data) + return // 验证必填项 if (!data.pwd) { util.alert('二级密码不能为空') + return } if (data.pwd !== data.rePwd) { - util.alert('两次输入密码不一致') + util.alert({ + content: '两次输入密码不一致', + showCancel: false + }) + mode.value = 'set' + return } // data.pwd = CryptoJS.MD5(data.pwd).toString() @@ -68,7 +96,7 @@ } util.alert({ content: rs.msg, - showCanecl: false, + showCancel: false, }) }) } @@ -100,44 +128,29 @@ } util.alert({ content: rs.msg, - showCanecl: false, + showCancel: false, }) }) } - /** - * 唤起键盘 - */ - function onPayUp() { - proxy.$refs.CodeKeyboard.show(); - } - /** * 支付键盘回调 * @param {Object} val */ function KeyInfo(val) { - console.log('val', val) - if (val.index >= 6) { - return - } - + if (form[formKey.value].length >= 6) return // 判断是否输入的是删除键 if (val.keyCode === 8) { // 删除最后一位 - passwordArr.splice(val.index + 1, 1) + form[formKey.value] = form[formKey.value].slice(0, -1) + // passwordArr.splice(val.index + 1, 1) } // 判断是否输入的是. else if (val.keyCode == 190) { // 输入.无效 } else { - passwordArr.push(val.key); - } - - // 判断是否等于6 - if (passwordArr.length === 6) { - passwordArr = []; - AffirmStatus.value = AffirmStatus.value + 1; + form[formKey.value] += val.key + // passwordArr.push(val.key); } } @@ -147,18 +160,21 @@ 设置二级密码 请设置六位数字的二级密码 - - - - - + + + - + 下一步 + + + + 确认二级密码 + 请再次输入刚才设置的二级密码 + + + + 确认 @@ -178,14 +194,4 @@ \ No newline at end of file diff --git a/jiuyi2/pages/mine/setting/setting.vue b/jiuyi2/pages/mine/setting/setting.vue index b06ae3a3..65f15d05 100644 --- a/jiuyi2/pages/mine/setting/setting.vue +++ b/jiuyi2/pages/mine/setting/setting.vue @@ -208,17 +208,17 @@ - + 意见反馈 - + 关于我们 - + 用户协议 @@ -238,12 +238,7 @@ - - 切换账号 - - - 退出登录 - + 退出登录 diff --git a/jiuyi2/readme.md b/jiuyi2/readme.md index d2ed3e2a..56dd8a11 100644 --- a/jiuyi2/readme.md +++ b/jiuyi2/readme.md @@ -161,6 +161,17 @@ reset_password //注册 register +榴莲果交易类型id +1 兑换榴莲果树 +2 商城评论 +3 查看他人评论 +4 查看视频分析 +5 兑换视频展播量 +6 推广他人视频 +7 申请完播量 +8 挂卖榴莲果 +9 挂买榴莲果 +10 用户互转 区分商家认证 isShop @@ -355,15 +366,3 @@ call_type 通话类型 2为视频,1是音频 选择视频截帧 -榴莲果交易类型id -1 兑换榴莲果树 -2 商城评论 -3 查看他人评论 -4 查看视频分析 -5 兑换视频展播量 -6 推广他人视频 -7 申请完播量 -8 挂卖榴莲果 -9 挂买榴莲果 -10 用户互转 - diff --git a/jiuyi2/store/index.js b/jiuyi2/store/index.js index 18270135..9a9011ee 100644 --- a/jiuyi2/store/index.js +++ b/jiuyi2/store/index.js @@ -24,6 +24,13 @@ export default createStore({ //有效时长 viewingDuration: 0, }, + // 各种变量配置 + config: { + "DAY_POINTS_RELEASE": 0.3, //每日积分释放 + "TASK_READING_SECOND": 300, //任务读秒 + "EFFECTIVE_SECONDS": 300, //有效读秒 + "EFFECTIVE_VIDEO_TIME": 20 //有效视频时间 + }, }, mutations: { diff --git a/jiuyi2/uni_modules/cc-defineKeyboard/components/cc-defineKeyboard/cc-defineKeyboard.vue b/jiuyi2/uni_modules/cc-defineKeyboard/components/cc-defineKeyboard/cc-defineKeyboard.vue index ac190f6b..4fc41489 100644 --- a/jiuyi2/uni_modules/cc-defineKeyboard/components/cc-defineKeyboard/cc-defineKeyboard.vue +++ b/jiuyi2/uni_modules/cc-defineKeyboard/components/cc-defineKeyboard/cc-defineKeyboard.vue @@ -1,10 +1,8 @@