From 1a61a7323726aefac3bf1358c69f3be3973d6ab5 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Fri, 11 Aug 2023 13:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- store/modules/config.js | 40 +++++++++++++++++++++++++++--- store/modules/index.js | 2 +- subpkg/companySign/companySign.vue | 2 +- subpkg/contract/contract.vue | 9 +++++-- utils/oahttp.js | 2 +- 5 files changed, 47 insertions(+), 8 deletions(-) diff --git a/store/modules/config.js b/store/modules/config.js index c2dd6b7..a94dd75 100644 --- a/store/modules/config.js +++ b/store/modules/config.js @@ -1,7 +1,12 @@ import Cache from '@/utils/cache'; const state = { - eyeType: Cache.get('eyeType') || true, - request: Cache.get('request') || true, + eyeType: Cache.get('eyeType') || true, // 小眼睛 + request: Cache.get('request') || true, // 网络请求 + timer: [{ + id: -1, + time: 60, + timer: null + }], // }; const mutations = { @@ -12,11 +17,40 @@ const mutations = { SET_REQUEST(state, data=true){ state.request = data; Cache.set('request', state.request); + }, + clearTimer(state, id){ + let time = state.timer.find(item=>item.id==id); + clearInterval(time.timer); + time.timer = null; + time.time = 0; } }; const actions = { - + startTimer({state, commit}, data){ + let time = state.timer.find(item=>item.id==data.id); + if(time){ + time.timer = setInterval(() => { + time.time--; + if (time.time <= 0) { + commit('clearTimer', data.id); + } + }) + }else { + state.timer.push({ + id: data.id, + time: data.time, + timer: null + }) + let new_time = state.timer.find(item=>item.id==data.id); + new_time.timer = setInterval(() => { + new_time.time--; + if (new_time.time <= 0) { + commit('clearTimer', data.id); + } + }, 1000) + } + } }; export default { diff --git a/store/modules/index.js b/store/modules/index.js index 1963883..4a6214d 100644 --- a/store/modules/index.js +++ b/store/modules/index.js @@ -8,7 +8,7 @@ // | Author: CRMEB Team // +---------------------------------------------------------------------- import app from "./app"; -import config from "./config" +import config from "./config"; export default { app, config diff --git a/subpkg/companySign/companySign.vue b/subpkg/companySign/companySign.vue index 37d6b28..e515017 100644 --- a/subpkg/companySign/companySign.vue +++ b/subpkg/companySign/companySign.vue @@ -143,7 +143,7 @@ this.navTo('/subpkg/submit/submit'); }catch(e){ uni.hideLoading(); - Toast('发送失败'); + Toast(e.msg||'合同发送失败'); } }, // 发送短信 diff --git a/subpkg/contract/contract.vue b/subpkg/contract/contract.vue index b40e1cf..0ea4faa 100644 --- a/subpkg/contract/contract.vue +++ b/subpkg/contract/contract.vue @@ -38,8 +38,9 @@ - 已签订 - + 已签订 + 签订中 + 未签订 @@ -235,6 +236,10 @@ font-weight: 400; color: #34A853; } + + .yellow { + color: #F9AA32; + } .red { color: #F02828FF; diff --git a/utils/oahttp.js b/utils/oahttp.js index 7525585..d0ca0ab 100644 --- a/utils/oahttp.js +++ b/utils/oahttp.js @@ -63,7 +63,7 @@ function baseRequestTwo(url, method, data, { // uni.hideLoading(); uni.showToast({ title: res.data.msg || '请检查网络', - icon: 'none' + icon: 'none', }) reject(res.data); } else if (res.data.code == 1){