diff --git a/Pages/yishi/case/index.js b/Pages/yishi/case/index.js index 7453198..05f5261 100644 --- a/Pages/yishi/case/index.js +++ b/Pages/yishi/case/index.js @@ -1,4 +1,5 @@ import { API } from './../../../utils/network/api' +import debounce from './../../../utils/debounce' let api = new API() const app = getApp() Page({ @@ -19,7 +20,11 @@ Page({ }) }, - goReport(event){ + goReport:debounce(function(event){ + wx.showLoading({ + mask:true, + title: '正在打开文件...', + }) const url=event.currentTarget.dataset.url; const randfile = new Date().getTime() + '检测报告'; const newPath = `${wx.env.USER_DATA_PATH}/${randfile}`; @@ -34,9 +39,11 @@ Page({ showMenu:true, filePath: newPath, success: function (res) { - console.log('打开文档成功') + console.log('打开文档成功'); + wx.hideLoading() }, fail:function(error){ + wx.hideLoading() wx.showToast({ title:res, icon:"none" @@ -52,7 +59,7 @@ Page({ } }) - }, + }), formatImgList(){ let diagnose_images = this.data.case_detail.diagnose_images?this.data.case_detail.diagnose_images:[]; let img_list = []; diff --git a/Pages/yishi/service_notice/index.wxml b/Pages/yishi/service_notice/index.wxml index 9c93255..de4389e 100644 --- a/Pages/yishi/service_notice/index.wxml +++ b/Pages/yishi/service_notice/index.wxml @@ -21,7 +21,7 @@ 糖组检测 - + {{item.notice_send_time}} diff --git a/Pages/yishi/wenzhen_v2/wenzhen.js b/Pages/yishi/wenzhen_v2/wenzhen.js index cad0aa1..6dbefb8 100644 --- a/Pages/yishi/wenzhen_v2/wenzhen.js +++ b/Pages/yishi/wenzhen_v2/wenzhen.js @@ -95,7 +95,7 @@ Page({ // console.log("app.globalData.unreadnnum_inter: ", app.globalData.unreadnnum_inter); }, onShow: function () { - // console.log("onShow from wenzhen V2") + //console.log("onShow from wenzhen V2") if(this.data.hasOnShow){ wx.stopPullDownRefresh() return; @@ -120,12 +120,16 @@ Page({ if(wx.$TUIKit){ - wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); + console.log("1111"); + wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady); wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady, this); + wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); }else{ + console.log("222") app.imInit().then(res => { // console.log("wenzhen onload imInit"); + wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady, this); wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this); }); } @@ -170,7 +174,8 @@ Page({ }) }, onSDKReady(){ - console.log("onSDKReady from wenzhen") + console.log("onSDKReady from wenzhen"); + this.getConversationList(); }, getConversationList(){ // console.log("getConversationListgetConversationListgetConversationList"); diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js index 294bb38..862f845 100644 --- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js +++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js @@ -1,5 +1,6 @@ import formateTime from '../../../../../utils/formate-time'; import constant from '../../../../../utils/constant'; +import debounce from '../../../../../../utils/debounce'; const app = getApp() // eslint-disable-next-line no-undef Component({ @@ -189,6 +190,7 @@ Component({ const renderDom = [{ type: 'sugar_check', title:customMessage.title, + detection_link:data.detection_link, disease_class_names:data.disease_class_names }]; return renderDom; @@ -253,7 +255,11 @@ Component({ } catch (error) { } }, - goReport(event){ + goReport:debounce(function(event){ + wx.showLoading({ + mask:true, + title: '正在打开文件...' + }) const url=event.currentTarget.dataset.url; const randfile = new Date().getTime() + '检测报告'; const newPath = `${wx.env.USER_DATA_PATH}/${randfile}`; @@ -268,9 +274,11 @@ Component({ showMenu:true, filePath: newPath, success: function (res) { + wx.hideLoading(); console.log('打开文档成功') }, fail:function(error){ + wx.hideLoading(); wx.showToast({ title:res, icon:"none" @@ -286,7 +294,7 @@ Component({ } }) - }, + }), goSick(event){ const url=event.currentTarget.dataset.url; console.log(url); diff --git a/TUIKit/components/TUIChat/index.wxml b/TUIKit/components/TUIChat/index.wxml index f29e289..09fdfdd 100644 --- a/TUIKit/components/TUIChat/index.wxml +++ b/TUIKit/components/TUIChat/index.wxml @@ -37,7 +37,7 @@ {{conversationName}} --> - + +