From 9ec15c027209a776b430f11ce90494dee79a360b Mon Sep 17 00:00:00 2001 From: chen <2659004835@qq.com> Date: Thu, 7 Apr 2022 18:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Evuex=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- components/dates/yy-mm-dd-hh-ss.vue | 295 ++++++++++++++ components/list/list-one.vue | 75 ---- components/list/list-two.vue | 163 -------- components/lw-notice/iconFont.vue | 61 --- components/lw-notice/icons.js | 6 - components/lw-notice/lw-notice.vue | 373 ------------------ components/notices/notice-one/notice-one.vue | 292 ++++++++++++++ components/notices/notice-one/readme.md | 75 ++++ .../notices/notice-one/uni-icons/icons.js | 132 +++++++ .../notice-one/uni-icons/uni-icons.vue | 52 +++ .../notices/notice-one/uni-icons/uni.ttf | Bin 0 -> 26164 bytes components/{rate.vue => rates/rate-one.vue} | 0 components/shareAll.vue | 42 -- components/status-nav.vue | 188 --------- jsFile/tools.js | 254 ++++++++---- main.js | 7 +- pages/tabbar/pagehome/pagehome.vue | 81 +++- pages/tabbar/project-list/project-list.vue | 5 +- pagesB/i-want-evaluate/i-want-evaluate.vue | 8 +- store/actions.js | 1 + store/index.js | 16 + store/modules/moduleA.js | 88 +++++ store/modules/moduleB.js | 87 ++++ store/mutations.js | 1 + store/readme.md | 0 26 files changed, 1301 insertions(+), 1003 deletions(-) create mode 100644 components/dates/yy-mm-dd-hh-ss.vue delete mode 100644 components/list/list-one.vue delete mode 100644 components/list/list-two.vue delete mode 100644 components/lw-notice/iconFont.vue delete mode 100644 components/lw-notice/icons.js delete mode 100644 components/lw-notice/lw-notice.vue create mode 100644 components/notices/notice-one/notice-one.vue create mode 100644 components/notices/notice-one/readme.md create mode 100644 components/notices/notice-one/uni-icons/icons.js create mode 100644 components/notices/notice-one/uni-icons/uni-icons.vue create mode 100644 components/notices/notice-one/uni-icons/uni.ttf rename components/{rate.vue => rates/rate-one.vue} (100%) delete mode 100644 components/shareAll.vue delete mode 100644 components/status-nav.vue create mode 100644 store/actions.js create mode 100644 store/index.js create mode 100644 store/modules/moduleA.js create mode 100644 store/modules/moduleB.js create mode 100644 store/mutations.js create mode 100644 store/readme.md diff --git a/App.vue b/App.vue index 6523090..87d5562 100644 --- a/App.vue +++ b/App.vue @@ -20,7 +20,7 @@ // #endif }, onShow: function() { - if(uni.getStorageSync('phone_active')){ + if(uni.getStorageSync('token')){ // 刷新token this.$toolAll.tools.refreshToken(); } diff --git a/components/dates/yy-mm-dd-hh-ss.vue b/components/dates/yy-mm-dd-hh-ss.vue new file mode 100644 index 0000000..eab00e0 --- /dev/null +++ b/components/dates/yy-mm-dd-hh-ss.vue @@ -0,0 +1,295 @@ + + + + + diff --git a/components/list/list-one.vue b/components/list/list-one.vue deleted file mode 100644 index 1eb8ed7..0000000 --- a/components/list/list-one.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - diff --git a/components/list/list-two.vue b/components/list/list-two.vue deleted file mode 100644 index 7e24653..0000000 --- a/components/list/list-two.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/components/lw-notice/iconFont.vue b/components/lw-notice/iconFont.vue deleted file mode 100644 index 2a9093d..0000000 --- a/components/lw-notice/iconFont.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - diff --git a/components/lw-notice/icons.js b/components/lw-notice/icons.js deleted file mode 100644 index 67e17e3..0000000 --- a/components/lw-notice/icons.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - 'aixin':'\ue8ab', - 'rules':'\ue909', - 'sound':'\ue8ea', - 'arrowright':'\uee02' -} diff --git a/components/lw-notice/lw-notice.vue b/components/lw-notice/lw-notice.vue deleted file mode 100644 index 3e15a24..0000000 --- a/components/lw-notice/lw-notice.vue +++ /dev/null @@ -1,373 +0,0 @@ - - - - - diff --git a/components/notices/notice-one/notice-one.vue b/components/notices/notice-one/notice-one.vue new file mode 100644 index 0000000..e0cb02c --- /dev/null +++ b/components/notices/notice-one/notice-one.vue @@ -0,0 +1,292 @@ + + + + + diff --git a/components/notices/notice-one/readme.md b/components/notices/notice-one/readme.md new file mode 100644 index 0000000..0b1af96 --- /dev/null +++ b/components/notices/notice-one/readme.md @@ -0,0 +1,75 @@ +### 安装方式 + +本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 + +### 说明 +由于官方公告组件uni-notice-bar没有垂直滚动的功能, 所以利用swiper加入了垂直滚动, 加入了常用主题色, 可以自己去添加, 需要用到uni-icons + +```html + + +``` + +```javascript + export default { + data() { + return { + list:[{id:1,title:'公告1'},{id:2,title:'公告2'}] + list2:[{id:1,name:'公告3'},{id:2,name:'公告4'}] + } + }, + methods: { + goItem(item){ + uni.showToast({ + title:'你点击的公告id是'+item.id, + icon:'none' + }) + }, + goMore(){ + uni.showToast({ + title:'点击更多', + icon:'none' + }) + } + } + } +``` + + + +## API + +### Tag Props + +|属性名 |类型 |默认值 |说明 | +|:-: |:-: |:-: |:-: | +|list |Array | |公告数组 | +|theme |String |default |主题 | +|showIcon |Boolean |true |是否显示左侧icon | +|showMore |Boolean |true |是否显示更多 | +|theKey |String |title |公告数组的键名 | +|direction |String |column |滚动的方向 | + + +### Tag Events + +|事件称名 |说明 |返回值 | +|:-: |:-: |:-: | +|@goItem |点击公告 |- | +|@goMore |点击更多 |- | + diff --git a/components/notices/notice-one/uni-icons/icons.js b/components/notices/notice-one/uni-icons/icons.js new file mode 100644 index 0000000..60b7332 --- /dev/null +++ b/components/notices/notice-one/uni-icons/icons.js @@ -0,0 +1,132 @@ +export default { + "pulldown": "\ue588", + "refreshempty": "\ue461", + "back": "\ue471", + "forward": "\ue470", + "more": "\ue507", + "more-filled": "\ue537", + "scan": "\ue612", + "qq": "\ue264", + "weibo": "\ue260", + "weixin": "\ue261", + "pengyouquan": "\ue262", + "loop": "\ue565", + "refresh": "\ue407", + "refresh-filled": "\ue437", + "arrowthindown": "\ue585", + "arrowthinleft": "\ue586", + "arrowthinright": "\ue587", + "arrowthinup": "\ue584", + "undo-filled": "\ue7d6", + "undo": "\ue406", + "redo": "\ue405", + "redo-filled": "\ue7d9", + "bars": "\ue563", + "chatboxes": "\ue203", + "camera": "\ue301", + "chatboxes-filled": "\ue233", + "camera-filled": "\ue7ef", + "cart-filled": "\ue7f4", + "cart": "\ue7f5", + "checkbox-filled": "\ue442", + "checkbox": "\ue7fa", + "arrowleft": "\ue582", + "arrowdown": "\ue581", + "arrowright": "\ue583", + "smallcircle-filled": "\ue801", + "arrowup": "\ue580", + "circle": "\ue411", + "eye-filled": "\ue568", + "eye-slash-filled": "\ue822", + "eye-slash": "\ue823", + "eye": "\ue824", + "flag-filled": "\ue825", + "flag": "\ue508", + "gear-filled": "\ue532", + "reload": "\ue462", + "gear": "\ue502", + "hand-thumbsdown-filled": "\ue83b", + "hand-thumbsdown": "\ue83c", + "hand-thumbsup-filled": "\ue83d", + "heart-filled": "\ue83e", + "hand-thumbsup": "\ue83f", + "heart": "\ue840", + "home": "\ue500", + "info": "\ue504", + "home-filled": "\ue530", + "info-filled": "\ue534", + "circle-filled": "\ue441", + "chat-filled": "\ue847", + "chat": "\ue263", + "mail-open-filled": "\ue84d", + "email-filled": "\ue231", + "mail-open": "\ue84e", + "email": "\ue201", + "checkmarkempty": "\ue472", + "list": "\ue562", + "locked-filled": "\ue856", + "locked": "\ue506", + "map-filled": "\ue85c", + "map-pin": "\ue85e", + "map-pin-ellipse": "\ue864", + "map": "\ue364", + "minus-filled": "\ue440", + "mic-filled": "\ue332", + "minus": "\ue410", + "micoff": "\ue360", + "mic": "\ue302", + "clear": "\ue434", + "smallcircle": "\ue868", + "close": "\ue404", + "closeempty": "\ue460", + "paperclip": "\ue567", + "paperplane": "\ue503", + "paperplane-filled": "\ue86e", + "person-filled": "\ue131", + "contact-filled": "\ue130", + "person": "\ue101", + "contact": "\ue100", + "images-filled": "\ue87a", + "phone": "\ue200", + "images": "\ue87b", + "image": "\ue363", + "image-filled": "\ue877", + "location-filled": "\ue333", + "location": "\ue303", + "plus-filled": "\ue439", + "plus": "\ue409", + "plusempty": "\ue468", + "help-filled": "\ue535", + "help": "\ue505", + "navigate-filled": "\ue884", + "navigate": "\ue501", + "mic-slash-filled": "\ue892", + "search": "\ue466", + "settings": "\ue560", + "sound": "\ue590", + "sound-filled": "\ue8a1", + "spinner-cycle": "\ue465", + "download-filled": "\ue8a4", + "personadd-filled": "\ue132", + "videocam-filled": "\ue8af", + "personadd": "\ue102", + "upload": "\ue402", + "upload-filled": "\ue8b1", + "starhalf": "\ue463", + "star-filled": "\ue438", + "star": "\ue408", + "trash": "\ue401", + "phone-filled": "\ue230", + "compose": "\ue400", + "videocam": "\ue300", + "trash-filled": "\ue8dc", + "download": "\ue403", + "chatbubble-filled": "\ue232", + "chatbubble": "\ue202", + "cloud-download": "\ue8e4", + "cloud-upload-filled": "\ue8e5", + "cloud-upload": "\ue8e6", + "cloud-download-filled": "\ue8e9", + "headphones":"\ue8bf", + "shop":"\ue609" +} diff --git a/components/notices/notice-one/uni-icons/uni-icons.vue b/components/notices/notice-one/uni-icons/uni-icons.vue new file mode 100644 index 0000000..333cc78 --- /dev/null +++ b/components/notices/notice-one/uni-icons/uni-icons.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/components/notices/notice-one/uni-icons/uni.ttf b/components/notices/notice-one/uni-icons/uni.ttf new file mode 100644 index 0000000000000000000000000000000000000000..60a1968d08cc6056c70b5402b2effac43c6f96a3 GIT binary patch literal 26164 zcmd_TX?z^TwKv?SdZuUZ*{5e;H8a|*T^d=EEqULKckpgml5KgDk!);i2nH_%0>luO zfPriTxR4OC00t6b2;2t}2qA%7wj=~>Fd>kT3xQvPTF<|_N4Df(=f3y-@P2qDb$4}D zb=Rq?Q>V__5=amPo3K|9g_?5~R@W^Zx8lD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8G`sq4_L;4do zZL#TTyOu641xde=hfz?kB4de;7$KWB9mOI(799JFx5Ff$_-=ji>Ni&YZ&)zy883_9z*ya5A6Q}&m5Ln literal 0 HcmV?d00001 diff --git a/components/rate.vue b/components/rates/rate-one.vue similarity index 100% rename from components/rate.vue rename to components/rates/rate-one.vue diff --git a/components/shareAll.vue b/components/shareAll.vue deleted file mode 100644 index 7cbd813..0000000 --- a/components/shareAll.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - diff --git a/components/status-nav.vue b/components/status-nav.vue deleted file mode 100644 index b0ed12c..0000000 --- a/components/status-nav.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - - - diff --git a/jsFile/tools.js b/jsFile/tools.js index 531362d..2f5df27 100644 --- a/jsFile/tools.js +++ b/jsFile/tools.js @@ -1,6 +1,6 @@ +const app = getApp(); const tools = { timer:'', - timerNot:'', // 埋点倒计时 daoTime(){ let daoTime = uni.getStorageSync('daoTime') @@ -9,13 +9,10 @@ const tools = { daoTime = uni.getStorageSync('daoTime') this.timer = setInterval(()=>{ uni.setStorageSync('daoTime',daoTime--)//设置倒计时 - // console.log('埋点倒计时初次:',daoTime); - // console.log('埋点长度初次:',uni.getStorageSync('maiList').length); if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){ uni.removeStorageSync('daoTime')//清空倒计时 clearInterval(this.timer)//关闭倒计时 // console.log('上/报,埋点'); - // reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件 uni.removeStorageSync('maiList')//清空上报参数 this.daoTime()//重新倒计时 } @@ -23,13 +20,10 @@ const tools = { } else {//继续当前倒计时倒计 this.timer = setInterval(()=>{ uni.setStorageSync('daoTime',daoTime--)//设置倒计时 - // console.log('埋点倒计时:',daoTime); - // console.log('埋点长度:',uni.getStorageSync('maiList').length); if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){ uni.removeStorageSync('daoTime')//清空倒计时 clearInterval(this.timer)//关闭倒计时 // console.log('上报,埋点'); - // reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件 uni.removeStorageSync('maiList')//清空上报参数 this.daoTime()//重新倒计时 } @@ -39,15 +33,6 @@ const tools = { closeTimer(){ clearInterval(this.timer)//关闭倒计时 console.log('倒计时清空了'); - clearInterval(this.timerNot)//关闭倒计时 - }, - maiDian(data){//埋点事件 - let maiList = uni.getStorageSync('maiList') - // console.log(maiList); - if(maiList==''){ - maiList = [data] - } else maiList.push(data) - uni.setStorageSync('maiList',maiList) }, weekDate(){//获取未来七天星期几,几号 let date = new Date() @@ -63,10 +48,6 @@ const tools = { isPhone:function(phone){ // 手机号正则表达式 let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; - // if(!reg_tel.test(phone)){ - // return true - // } - // return false return !reg_tel.test(phone); }, // 电子邮箱验证 @@ -83,6 +64,21 @@ const tools = { hideMPhone(phone){ return `${phone.substr(0, 3)}****${phone.substr(7)}` }, + // 手机号中间加字符 + phoneAddChat(phone,startNum=3,endNum=7,character=' '){ + let phoneStr = phone; + phoneStr = phoneStr.replace(/\s*/g, ""); + var phoneArr = []; + for(var i = 0; i < phoneStr.length; i++){ + if (i==startNum||i==endNum){ + phoneArr.push(`${character}` + phoneStr.charAt(i)); + } else { + phoneArr.push(phoneStr.charAt(i)); + } + } + phone = phoneArr.join(""); + return phone; + }, // 昵称从第一个字开始,后面的都用"*"代替 hideName(name,num){ return `${name.substr(0, 1)}****${name.substr(name.length-1)}` @@ -113,7 +109,7 @@ const tools = { str = str.toFixed(2); str = str+''; } - return str.includes('.') ? str*1 : str = num + '.00'; + return str.includes('.') ? str : str = num + '.00'; }, // type:+加、-减、*乘、/除 // len:小数后保留几位 @@ -229,6 +225,65 @@ const tools = { // console.log(time2);//1398250549123 // console.log(time3);//1398250549000 }, + // 返回当前时间 + returnCurrentTime(format,type) { + let date = new Date(); + let year = date.getFullYear(); // 年 + let month = date.getMonth() + 1; // 月 + let day = date.getDate(); // 日 + let time = date.getHours(); // 时 + let minu = date.getSeconds(); // 分 + let second = date.getMinutes(); // 秒 + + let newTime = ''; + switch (type){ + case 0: + newTime = `${year}${format}${month < 10? '0' + month : month}${format}${day < 10 ? '0' + day : day} ${time < 10 ? '0' + time : time}:${minu < 10 ? '0' + minu : minu}`; // 2022-03-31 16:05 + break; + case 1: + newTime = `${year}${format}${month < 10? '0' + month : month}${format}${day < 10 ? '0' + day : day} ${time < 10 ? '0' + time : time}:${minu < 10 ? '0' + minu : minu}:${second < 10 ? '0' + second : second}`; // 2022-03-31 16:10:07 + break; + } + return newTime; + }, + // 返回时间xx天xx小时xx分钟 + returnTimeFormat(startTime,endTime){ + console.log(startTime,endTime); + let newTimeFormat = ''; + let currentTimestamp = this.timeToTimestamp(endTime) - this.timeToTimestamp(startTime); + return this.returnTimestampToTime(currentTimestamp); + }, + // 返回时间戳转时、分对象 + returnTimestampToTime(timestamp){ + let timeStr = ''; + var day = parseInt((timestamp % (1000 * 60 * 60 * 24 * 12)) / (1000 * 60 * 60 * 24)); + var hours = parseInt((timestamp % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var seconds = parseInt((timestamp % (1000 * 60 * 60)) / (1000 * 60)); + day = day < 10 ? ('0' + day) : day; + hours = hours < 10 ? ('0' + hours) : hours; + seconds = seconds < 10 ? ('0' + seconds) : seconds; + if(day*1==0) { + if(hours*1==0) { + seconds*1==0 ? timeStr = 0 : timeStr = `${seconds}分钟`; + } else { + timeStr = `${hours}小时${seconds}分钟`; + } + } else { + timeStr = `${day}天${hours}小时${seconds}分钟`; + } + return timeStr; + }, + // 时间戳转时分秒 00 : 00 : 00 + formatDuring: function(mss) { + // let dangTime = Math.round(new Date()/1000)//获取当前时间戳 + var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var seconds = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)); + var minutes = (mss % (1000 * 60)) / 1000; + hours = hours < 10 ? ('0' + hours) : hours; + seconds = seconds < 10 ? ('0' + seconds) : seconds; + minutes = minutes < 10 ? ('0' + minutes) : minutes; + return hours + ' : ' + seconds + ' : ' + minutes; + }, // 随机数生成 randomStr(){ var strData = ""; @@ -268,30 +323,18 @@ const tools = { return newObj }, // 提示方法 - showToast: function(msg, icon,time) { - // 弹框图标:none默认无图标、loading、success - var newIncon = 'none'; - if (icon) {newIncon = icon;} + showToast: function(msg, icon='none',time) { // 弹框显示时间:默认2秒 var newTime = 2000 if (time) {newTime = time;} return uni.showToast({ title: msg, - icon: newIncon, + icon: icon, duration:newTime }) }, - formatDuring: function(mss) { - // let dangTime = Math.round(new Date()/1000)//获取当前时间戳 - var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); - var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)); - var seconds = (mss % (1000 * 60)) / 1000; - hours = hours < 10 ? ('0' + hours) : hours; - minutes = minutes < 10 ? ('0' + minutes) : minutes; - seconds = seconds < 10 && seconds >= 1 ? ('0' + seconds) : seconds; - return hours + ' : ' + minutes + ' : ' + seconds; - }, - escape2Html(str) {//富文本 + // 富文本 + escape2Html(str) { var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' }; return str.replace(/&(lt|gt|nbsp|amp|quot|src);/ig, function (all, t) { return arrEntities[t]; @@ -300,39 +343,10 @@ const tools = { .replace(/\ { - if (res.confirm) { - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 - updateManager.applyUpdate() - } - } - }) - }) - updateManager.onUpdateFailed(function (res) { - // 新版本下载失败 - // console.log('新版本下载失败:',res); - }) - // #endif - }, - networkStatus(){//检查网络状态 + // 检查网络状态 + networkStatus(){ uni.getNetworkType({ - success: function (res) { + success: (res)=> { console.log('当前网络状态:',res.networkType);//none:当前无网络连接 if(res.networkType=='none'){ uni.setStorageSync('isNet',false) @@ -341,12 +355,84 @@ const tools = { // 微信小程序原生API性能优化 // #ifdef MP-WEIXIN // 连网下,检测小程序是否有更新 - tools.updaX(); + this.checkUpdate(); // #endif } } }); }, + // app、小程序的检测版本并更新 + checkUpdate(){ + // 检测app + // #ifdef APP-PLUS + + // #endif + //检测小程序 + // #ifdef MP-WEIXIN + var self = this; + // 获取小程序更新机制兼容 + if (wx.canIUse('getUpdateManager')) { + const updateManager = wx.getUpdateManager();//1. 检查小程序是否有新版本发布 + updateManager.onCheckForUpdate(function(res) {// 请求完新版本信息的回调 + if (res.hasUpdate) { + //检测到新版本,需要更新,给出提示 + wx.showModal({ + title: '更新提示', + content: '检测到新版本,是否下载新版本并重启小程序?', + success: function(res) { + if (res.confirm) { + //2. 用户确定下载更新小程序,小程序下载及更新静默进行 + self.downLoadAndUpdate(updateManager) + // 清除所有缓存 + uni.clearStorage(); + uni.clearStorageSync(); + } else if (res.cancel) { + //用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了 + wx.showModal({ + title: '温馨提示~', + content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~', + showCancel:false,//隐藏取消按钮 + confirmText:"确定更新",//只保留确定更新按钮 + success: function(res) { + if (res.confirm) { + //下载新版本,并重新应用 + self.downLoadAndUpdate(updateManager) + } + } + }) + } + } + }) + } + }) + } else { // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 + wx.showModal({ + title: '提示', + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' + }) + } + // #endif + }, + /** + * 下载小程序新版本并重启应用 + * */ + downLoadAndUpdate(updateManager){ + var self = this; + wx.showLoading(); //静默下载更新小程序新版本 + updateManager.onUpdateReady(function () { + wx.hideLoading(); //新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate(); + // 清除缓存 + uni.clearStorageSync(); + uni.clearStorage(); + }) + updateManager.onUpdateFailed(function () { // 新的版本下载失败 + wx.showModal({ + title: '已经有新版本了哟~', + content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~', + }) + }) + }, // 文本复制 clickCopy(data){ uni.setClipboardData({ @@ -405,7 +491,7 @@ const tools = { if (res.code) { var params = {code:res.code} uni.request({ - url: `${uni.getStorageSync('hostapi')}/api/user/login`, + url: `${app.globalData.hostapi}/api/user/login`, method: 'post', data: params, header: { @@ -430,16 +516,17 @@ const tools = { } }, // 判断是否授权,没授权,前往登录页面授权 + authTimer:null, judgeAuth(){ - let auth = true; - switch (uni.getStorageSync('phone_active')*1){ - case 0: // 未注册 - uni.navigateTo({url:'/pages/login/login'}); - auth = false - break; - case 1: // 已注册 - auth = true - break; + let auth = false; + clearTimeout(this.authTimer); + if(!uni.getStorageSync('token')) { + this.showToast('请登录'); + this.authTimer = setTimeout(()=>{ + uni.navigateTo({url:'/pages/login/login'}); + },2000) + } else { + auth = true; } return auth; }, @@ -456,13 +543,10 @@ const tools = { // console.log(hInfo.envVersion);//develop:开发版 trial:体验版 release:正式版 // if(hInfo.miniProgram.envVersion == "develop"){ if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){ - // (开发版,体验版)-配置全局域名 - // uni.setStorageSync('hostapi','https://hengmei.scdxtc.cn/api/'); + } else { // 清除所有输出日志 console.log = () =>{}; - // 正式版-配置全局域名 - // uni.setStorageSync('hostapi','https://hm.hmzfyy.cn/api/'); // 开启埋点倒计时 this.daoTime();//开启埋点倒计时 } @@ -523,7 +607,7 @@ const tools = { const res = uni.getSystemInfoSync(); if(res.platform=='ios'){ uni.makePhoneCall({ - phoneNumber:phone, + phoneNumber:phone*1, success: () => {}, fail: () => {} }) diff --git a/main.js b/main.js index e8eecc4..d6c7be2 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,7 @@ import Vue from 'vue'; import App from './App'; +import store from './store' +Vue.prototype.$store = store import nothingPage from './components/nothing/nothing-page.vue';//引入无内容组件 Vue.component('nothing-page',nothingPage);//全局注册无内容组件 @@ -10,10 +12,12 @@ Vue.component('status-nav',statusNav);//全局注册头部状态栏与导航栏 import containerSubgroupTwo from './components/containers/container-subgroup-two.vue';//引入头部状态栏与导航栏组件 Vue.component('container-subgroup',containerSubgroupTwo);//全局注册头部状态栏与导航栏组件 +// #ifdef MP-WEIXIN import share from './jsFile/share.js';// 全局注册分享事件 Vue.mixin(share); +// #endif -// 常用工具 +// 常用便捷式公共方法 import tools from '@/jsFile/tools.js'; Vue.prototype.$toolAll = tools; // 响应数据 @@ -23,6 +27,7 @@ Vue.prototype.$requst = requst; App.mpType = 'app'; const app = new Vue({ + store, ...App }) app.$mount() diff --git a/pages/tabbar/pagehome/pagehome.vue b/pages/tabbar/pagehome/pagehome.vue index 60465a1..257ae62 100644 --- a/pages/tabbar/pagehome/pagehome.vue +++ b/pages/tabbar/pagehome/pagehome.vue @@ -48,7 +48,6 @@ - @@ -228,14 +227,13 @@ // 暂无更多组件 import pitera from '@/components/nothing/pitera.vue'; // 公告 - import lwNotice from '@/components/lw-notice/lw-notice.vue'; import footTabOne from '@/components/foot-tabs/foot-tab-one.vue'; import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue'; + import { mapState,mapGetters,mapMutations } from 'vuex'//引入mapState export default { components:{ pitera, statusNavSlot, - lwNotice, 'foot-tab' :footTabOne, containerSubgroupTwo }, @@ -313,6 +311,62 @@ faultsList:[], } }, + // computed:{ + // tokenEv() { + // return this.$store.state.token; + // } + // }, + // computed:mapState({ + // // 从state中拿到数据 箭头函数可使代码更简练 + // token: state => state.token, + // }), + // computed:mapState(['token']), + // computed: { + // ...mapState({ + // token: function (state) { + // return '追加的' + state.token + // }, + // userInfo: state => state.userInfo, + // }) + // }, + // computed: { + // todos() { + // return this.$store.getters.doneTodos + // } + // }, + // computed: { + // doneTodosCount() { + // return this.$store.getters.doneTodosCount + // } + // }, + // computed: { + // getTodoById() { + // return this.$store.getters.getTodoById(1) + // } + // }, + // computed: { + // // 使用对象展开运算符将 getter 混入 computed 对象中 + // ...mapGetters([ + // 'doneTodos', + // 'doneTodosCount', + // 'getTodoById' + // // ... + // ]) + // }, + // computed:{ + // ...mapState([ + // 'token', + // 'userInfo', + // 'count', + // 'obj' + // ]) + // }, + computed: { + ...mapState({ + token: state => state.moduleA.token, + count: state => state.moduleB.count + }), + }, onLoad(options) { // 获取当前页面url this.$toolAll.tools.obtainUrl(); @@ -322,8 +376,29 @@ // this.getIncrementServiceType(); // 调用获取常见故障列表事件 this.getFaultsList(); + // this.$store.commit('setToken', 'token已改变'); + // this.$store.commit('updateUserInfo',{userInfo:'用户信息'}) + // this.$store.commit({ + // type: 'updateUserInfo', + // userInfo: '新方式更新用户信息' + // }) + // console.log(this.userInfo,374); + // this.add(); + // console.log(this.obj); + // this.$store.commit('newProp',{c:'吃火锅'}) + // console.log(this.obj,382); + // this.$store.dispatch('addCountAction') + // this.$store.dispatch('addCountAction2',{amount:10}) + // this.$store.dispatch('addCountAction3',{amount:30}) + // setTimeout(()=>{ + // console.log(this.count,388); + // },3000) + // console.log(this.count,390); + console.log(this.token,397); + console.log(this.count,398); }, methods: { + // ...mapMutations(['add']),//对象展开运算符直接拿到add // 工单跳转 goWorkOrder(index){ if(index==0){ diff --git a/pages/tabbar/project-list/project-list.vue b/pages/tabbar/project-list/project-list.vue index b693514..fef511d 100644 --- a/pages/tabbar/project-list/project-list.vue +++ b/pages/tabbar/project-list/project-list.vue @@ -1,16 +1,19 @@