diff --git a/Pages/agreement_page/index.js b/Pages/agreement_page/index.js
new file mode 100644
index 0000000..109118e
--- /dev/null
+++ b/Pages/agreement_page/index.js
@@ -0,0 +1,22 @@
+// Pages/webpage/index.js
+import { API } from './../../utils/network/api'
+const api = new API()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ src: "",
+ static_host: api.getStaticHost()
+ },
+
+ onLoad(options) {
+ console.log(options.agreement_id)
+ console.log(this.data.static_host+"/basic/file/agreement.htm?id="+options.agreement_id)
+ this.setData({
+ src: this.data.static_host+"/basic/file/agreement.htm?id="+options.agreement_id
+ })
+ },
+
+})
\ No newline at end of file
diff --git a/Pages/agreement_page/index.json b/Pages/agreement_page/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/Pages/agreement_page/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/Pages/agreement_page/index.wxml b/Pages/agreement_page/index.wxml
new file mode 100644
index 0000000..22a9b46
--- /dev/null
+++ b/Pages/agreement_page/index.wxml
@@ -0,0 +1,2 @@
+
+
diff --git a/Pages/agreement_page/index.wxss b/Pages/agreement_page/index.wxss
new file mode 100644
index 0000000..12b229e
--- /dev/null
+++ b/Pages/agreement_page/index.wxss
@@ -0,0 +1 @@
+/* Pages/webpage/index.wxss */
\ No newline at end of file
diff --git a/Pages/index/index.js b/Pages/index/index.js
index af9f44f..f6259dd 100644
--- a/Pages/index/index.js
+++ b/Pages/index/index.js
@@ -1,8 +1,67 @@
// Pages/index/index.js
+import { API } from './../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
data: {
- loading: true
+ loading: true,
+ showEntryTip:false,
+ showEntryTip_second:false,
+ beforeClose(action){
+ return new Promise((resolve) => {
+ if (action === 'confirm') {
+ resolve(true);
+ } else {
+ // 拦截取消操作
+ resolve(false);
+ }
+ })
+ },
+ static_host: api.getStaticHost()
+ },
+ onConfirmEntry(){
+ //wx.setStorageSync('hasEntry', true);
+ },
+ onCloseEntry(){
+ this.setData({
+ showEntryTip_second:true,
+ showEntryTip:true
+ })
+ },
+ onConfirmEntry_second(){
+ this.setData({
+ showEntryTip_second:false,
+ //showEntryTip:false,
+ });
+ //wx.setStorageSync('hasEntry', true);
+
+ },
+ onCloseEntry_second(){
+
+ this.setData({
+ showEntryTip_second:false,
+ showEntryTip:false,
+ });
+ wx.exitMiniProgram({success: (res) => {}})
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ app.go(url);
+ },
+ onLoad(option){
+ let from = option.from;
+ let usertype = wx.getStorageSync('usertype');
+ console.log("index onload: ", from, usertype)
+ this.setData({
+ beforeClose: this.data.beforeClose.bind(this),
+ })
+ if(from === "navbar"){
+ //切换身份
+ }else{
+ if(usertype == 2 || usertype == 3){
+ this.guideTo(usertype)
+ }
+ }
},
/**
* 生命周期函数--监听页面显示
@@ -13,80 +72,72 @@ Page({
tabBarShow:false, //true/false
})
}
+ wx.getPrivacySetting({
+ success: res => {
+ console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
+ if (res.needAuthorization) {
+ // 需要弹出隐私协议
+ this.setData({
+ showEntryTip:true
+ })
+ } else {
+ this.setData({
+ showEntryTip:false
+ })
+ // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私
+ }
+ },
+ fail: () => {},
+ complete: () => {}
+ })
this.setData({ loading: false });
+ if(app.globalData.isLogin){
+ let usertype = wx.getStorageSync('usertype');
+ this.guideTo(usertype)
+ }
+ // let isEntry=wx.getStorageSync('hasEntry');
+ // console.log("onshow:"+isEntry)
+ // if(!isEntry){
+ // this.setData({
+ // showEntryTip:true
+ // });
+
+ // }else{
+ // this.setData({
+ // showEntryTip:false
+ // });
+ // }
},
+
goCheck(e){
console.log(e);
let usertype = e.currentTarget.dataset.usertype;
let url = e.currentTarget.dataset.url;
wx.setStorageSync('usertype', usertype);
wx.setStorageSync('next_url', url);
- let user_uuid = wx.getStorageSync('user_id');
- console.log(user_uuid);
- if(user_uuid){
+ this.guideTo(usertype);
+ },
+ guideTo(usertype){
+ let url;
+ if(usertype == 2){
+ if(!wx.$TUIKit){
+ app.imInit();
+ }
+ url = "/Pages/yishi/index/index";
+ }else{
+ app.imLogout();
+ url = "/Pages/yaoshi/home/home";
+ }
+ let token = wx.getStorageSync('AUTH_TOKEN_'+usertype);
+ console.log(token);
+ console.log(url);
+ if(token){
wx.switchTab({
url: url
})
}else{
app.go(app.globalData.login_url);
}
- },
- bindGetUserInfo(){
- wx.getUserInfo({
- success: function(res) {
- var userInfo = res.userInfo
- var nickName = userInfo.nickName
- var avatarUrl = userInfo.avatarUrl
- var gender = userInfo.gender //性别 0:未知、1:男、2:女
- var province = userInfo.province
- var city = userInfo.city
- var country = userInfo.country
- console.log(res.userInfo)
- }
- })
- },
- shenfang(){
- wx.requestSubscribeMessage({
- tmplIds: [
- "5Tl-xmaWXrKP5BB8E6b3oTdPHbHa7WYWbmvZiuz4TLs",
- "kUy70xHlr7ADo4aIHiictM4Te7MSec3E5kHsYvFQu40"
- ],
- success(res){
- console.log(res)
- },
- fail(res){
- console.log(res)
- },
- complete(res){
- console.log(res)
- }
- })
- },
- yici(){
- wx.requestSubscribeMessage({
- tmplIds: [
- "jhYUf91ULCTX_f69hazqAYwImdFf8ELasRAwB6X-MTM",
- "JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc"
- ],
- success(res){
- console.log(res)
- },
- fail(res){
- console.log(res)
- },
- complete(res){
- console.log(res)
- }
- })
- },
- check(){
- wx.getSetting({
- withSubscriptions: true,
- success (res) {
- console.log(res.authSetting)
- console.log(res.subscriptionsSetting)
- }
- })
+ //test git
}
-
-})
\ No newline at end of file
+})
diff --git a/Pages/index/index.json b/Pages/index/index.json
index 6ffda42..40f6b9e 100644
--- a/Pages/index/index.json
+++ b/Pages/index/index.json
@@ -1,6 +1,7 @@
{
"component": true,
"usingComponents": {
- "t-image": "tdesign-miniprogram/image/image"
+ "t-image": "tdesign-miniprogram/image/image",
+ "van-dialog": "@vant/weapp/dialog/index"
}
}
\ No newline at end of file
diff --git a/Pages/index/index.wxml b/Pages/index/index.wxml
index 57ad1f6..5954550 100644
--- a/Pages/index/index.wxml
+++ b/Pages/index/index.wxml
@@ -1,12 +1,10 @@
-
-
请选择您的身份
-
-
-
-
+
+
+ 亲爱的用户,感谢您信任并使用肝胆相照互联网医院医师端!我们依据最新法律法规的要求,制定了《隐私协议》。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。
+如您同意《隐私协议》,请点击“同意”开始使用我们的产品和服务。
+
+
+
+
+
diff --git a/Pages/index/index.wxss b/Pages/index/index.wxss
index 8f99577..44d680b 100644
--- a/Pages/index/index.wxss
+++ b/Pages/index/index.wxss
@@ -4,7 +4,7 @@
margin-left: 50rpx;
margin-bottom: 100rpx;
font-size: 50rpx;
- font-family: "AlibabaPuHuiTi-2-75-SemiBold";
+ /* font-family: "AlibabaPuHuiTi-2-75-SemiBold"; */
color: #333;
}
.item{
@@ -19,3 +19,15 @@
display: flex;
justify-content: center;
}
+.entrymsg{
+ -webkit-overflow-scrolling: touch;
+ font-size: 28rpx;
+ line-height: 40rpx;
+ max-height: 60vh;
+ overflow-y: auto;
+ padding: 48rpx;
+ text-align: left;
+}
+.navigator{
+ color:#3CC7C0
+}
\ No newline at end of file
diff --git a/Pages/kickedout/index.js b/Pages/kickedout/index.js
new file mode 100644
index 0000000..765d8c4
--- /dev/null
+++ b/Pages/kickedout/index.js
@@ -0,0 +1,9 @@
+const app = getApp()
+Page({
+ data: {
+
+ },
+ confirmJieSuanDialog(){
+ app.go("/Pages/index/index");
+ }
+})
\ No newline at end of file
diff --git a/Pages/kickedout/index.json b/Pages/kickedout/index.json
new file mode 100644
index 0000000..84ea31a
--- /dev/null
+++ b/Pages/kickedout/index.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
+ }
+}
\ No newline at end of file
diff --git a/Pages/kickedout/index.wxml b/Pages/kickedout/index.wxml
new file mode 100644
index 0000000..189be3e
--- /dev/null
+++ b/Pages/kickedout/index.wxml
@@ -0,0 +1,9 @@
+
+
+ 好的
+
+
\ No newline at end of file
diff --git a/Pages/kickedout/index.wxss b/Pages/kickedout/index.wxss
new file mode 100644
index 0000000..73af96f
--- /dev/null
+++ b/Pages/kickedout/index.wxss
@@ -0,0 +1,11 @@
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+ width: 100%;
+}
\ No newline at end of file
diff --git a/Pages/login/index.js b/Pages/login/index.js
index 97f11c1..1f2505f 100644
--- a/Pages/login/index.js
+++ b/Pages/login/index.js
@@ -3,22 +3,115 @@ import { API } from './../../utils/network/api'
const api = new API()
const app = getApp()
Page({
-
data: {
+ showEntryTip:false,
+ showEntryTip_second:false,
+ beforeClose(action){
+ return new Promise((resolve) => {
+ if (action === 'confirm') {
+ resolve(true);
+ } else {
+ // 拦截取消操作
+ resolve(false);
+ }
+ })
+ },
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '登录', //导航栏 中间的标题
},
- checked: true
+ checked: false,
+ static_host: api.getStaticHost()
+ },
+ onShow(){
+ let usertype = wx.getStorageSync('usertype');
+ this.setData({
+ beforeClose: this.data.beforeClose.bind(this),
+ })
+ if(!usertype){
+ wx.navigateTo({
+ url: "/Pages/index/index"
+ })
+ };
+ },
+ onLoad(){
+ let usertype = wx.getStorageSync('usertype');
+ this.setData({
+ beforeClose: this.data.beforeClose.bind(this),
+ })
+ if(!usertype){
+ wx.navigateTo({
+ url: "/Pages/index/index"
+ })
+ };
+ wx.getPrivacySetting({
+ success: res => {
+ console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
+ if (res.needAuthorization) {
+ // 需要弹出隐私协议
+ this.setData({
+ showEntryTip:true
+ })
+ } else {
+ this.setData({
+ showEntryTip:false
+ })
+ // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私
+ }
+ },
+ fail: () => {},
+ complete: () => {}
+ })
+ // let isEntry=wx.getStorageSync('hasEntry');
+ // if(!isEntry){
+ // this.setData({
+ // showEntryTip:true,
+ // });
+ // }else{
+ // this.setData({
+ // showEntryTip:false
+ // });
+ // }
},
onChange(event) {
this.setData({
checked: event.detail,
});
},
+ changeCheck(){
+ let checked = this.data.checked
+ this.setData({
+ checked: !checked
+ })
+ },
_navback() {
wx.navigateBack()
},
+ onConfirmEntry(){
+ // wx.setStorageSync('hasEntry', true);
+ },
+ onCloseEntry(){
+ this.setData({
+ showEntryTip_second:true,
+ showEntryTip:true
+ })
+ },
+ onConfirmEntry_second(){
+ this.setData({
+ showEntryTip_second:false,
+ // showEntryTip:false,
+ });
+ //wx.setStorageSync('hasEntry', true);
+
+ },
+ onCloseEntry_second(){
+
+ this.setData({
+ showEntryTip_second:false,
+ showEntryTip:false,
+ });
+ wx.exitMiniProgram({success: (res) => {}})
+ },
go(e){
let url = e.currentTarget.dataset.url;
app.go(url);
@@ -26,6 +119,14 @@ Page({
getPhoneNumber (e) {
console.log(e);
console.log(e.detail.code);
+ if(!this.data.checked){
+ wx.showToast({
+ title: '请同意协议',
+ icon: "error"
+ })
+ return;
+ }
+ let THIS=this;
let usertype = wx.getStorageSync('usertype');
let next_url = wx.getStorageSync('next_url');
wx.login({
@@ -39,13 +140,19 @@ Page({
}
api.wechatMobileLogin(params).then(response => {
console.log(response);
- wx.setStorageSync('AUTH_TOKEN', response.data.token);
- wx.setStorageSync('user_id', response.data.user_id);
- wx.setStorageSync('client_user_id', response.data.client_user_id);
+ wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token);
+ wx.setStorageSync('user_id_'+usertype, response.data.user_id);
+ wx.setStorageSync('client_user_id_'+usertype, response.data.client_user_id);
+ app.globalData.config.userID = response.data.user_id;
+ app.globalData.isLogin=true;
+ let handleGo=function(){
+ wx.switchTab({
+ url: next_url
+ })
+ }
+ app.imInit({path:'Pages/login/index'},1,handleGo);
//跳转页面
- wx.switchTab({
- url: next_url
- })
+
}).catch(errors => {
console.error(errors);
})
diff --git a/Pages/login/index.json b/Pages/login/index.json
index be41440..41e6df9 100644
--- a/Pages/login/index.json
+++ b/Pages/login/index.json
@@ -3,6 +3,7 @@
"van-button": "@vant/weapp/button/index",
"van-image": "@vant/weapp/image/index",
"van-checkbox": "@vant/weapp/checkbox/index",
+ "van-dialog": "@vant/weapp/dialog/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index"
}
}
\ No newline at end of file
diff --git a/Pages/login/index.wxml b/Pages/login/index.wxml
index 2292bab..8c29100 100644
--- a/Pages/login/index.wxml
+++ b/Pages/login/index.wxml
@@ -1,12 +1,12 @@
-
+
{{ navbarData.title }}
-
+
@@ -15,14 +15,59 @@
微信授权手机号登录
- 我已阅读并同意协议《肝胆相照用户服务协议》
+ 微信授权手机号登录
+
+
+
+
+ 我已阅读并同意协议
+ 《肝胆相照用户注册及服务协议》
+ 《隐私协议》
+ 《劳务协议》
+
+
输入手机号登录/注册
-
\ No newline at end of file
+
+
+
+ 亲爱的用户,感谢您信任并使用肝胆相照互联网医院医师端!我们依据最新法律法规的要求,制定了《隐私协议》。请您仔细阅《隐私协议》,并确认了解我们对您的个人信息处理原则。
+如您同意《隐私协议》,请点击“同意”开始使用我们的产品和服务。
+
+
+
+
+
\ No newline at end of file
diff --git a/Pages/login/index.wxss b/Pages/login/index.wxss
index 01c5e71..326efc0 100644
--- a/Pages/login/index.wxss
+++ b/Pages/login/index.wxss
@@ -7,7 +7,7 @@
top: 0;
width: 750rpx;
height: 170rpx;
- background-color: #bae46b;
+ background-color: #ffffff;
z-index: 99;
}
.tui-navigatorbar-back{
@@ -23,7 +23,7 @@
height: 88rpx;
line-height: 56rpx;
font-size: 36rpx;
- color: #e68080;
+ color: #000000;
bottom: 0;
left: 200rpx;
display: flex;
@@ -75,5 +75,18 @@
color: #333333;
margin-bottom: 60rpx;
}
-
-
+.van-checkbox {
+ padding-top: 6rpx !important;
+}
+.entrymsg{
+ -webkit-overflow-scrolling: touch;
+ font-size: 28rpx;
+ line-height: 40rpx;
+ max-height: 60vh;
+ overflow-y: auto;
+ padding: 48rpx;
+ text-align: left;
+}
+.navigator{
+ color:#3CC7C0
+}
diff --git a/Pages/mobile_login/index.js b/Pages/mobile_login/index.js
index 8f9d448..89be844 100644
--- a/Pages/mobile_login/index.js
+++ b/Pages/mobile_login/index.js
@@ -1,24 +1,77 @@
import { API } from './../../utils/network/api'
const api = new API()
+const app = getApp()
Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '手机号登录', //导航栏 中间的标题
},
- checked: true,
+ checked: false,
phone: "",
sms: "",
btn_msg: "获取验证码",
btn_disabled: false,
- login_disabled: true,
+ login_disabled: false,
+ btn_color: "#ccc",
+ static_host: api.getStaticHost()
+ },
+ onLoad(){
+ let usertype = wx.getStorageSync('usertype');
+ if(!usertype){
+ wx.navigateTo({
+ url: "/Pages/index/index"
+ })
+ }
+ },
+ onShow(){
+ let usertype = wx.getStorageSync('usertype');
+ if(!usertype){
+ wx.navigateTo({
+ url: "/Pages/index/index"
+ })
+ }
},
onChange(event) {
this.setData({
checked: event.detail,
});
},
+ changeCheck(){
+ let checked = this.data.checked
+ this.setData({
+ checked: !checked
+ })
+ },
+ phone_change(e){
+ let phone = e.detail.value;
+ this.setData({
+ phone: e.detail.value
+ })
+ let phone_reg = /^1[3-9]\d{9}$/;
+ if(phone_reg.test(phone)){
+ this.setData({
+ btn_color: "#3CC7C0"
+ })
+ }else{
+ this.setData({
+ btn_color: "#ccc"
+ })
+ }
+ },
+
getCodePhone(e){
+ let phone_reg = /^1[3-9]\d{9}$/;
+ let phone = this.data.phone;
+ //判断用户输入的真实姓名是否为空
+ if(phone.length == 0){
+ wx.showToast({title: '手机号不能为空', icon:'error'})
+ return false;
+ }else if(!phone_reg.test(phone)){//检测姓名的格式是否匹配
+ wx.showToast({title: '手机号输入有误', icon:'error'})
+ return false;
+ }
+
if(!this.data.checked){
wx.showToast({
title: '请同意协议',
@@ -47,6 +100,24 @@ Page({
})
},
mobileLogin(e){
+ let THIS=this;
+ let phone_reg = /^1[3-9]\d{9}$/;
+ let phone = this.data.phone;
+ let sms = this.data.sms;
+ //判断用户输入的真实姓名是否为空
+ if(phone.length == 0){
+ wx.showToast({title: '手机号不能为空', icon:'error'})
+ return false;
+ }else if(!phone_reg.test(phone)){//检测姓名的格式是否匹配
+ wx.showToast({title: '手机号输入有误', icon:'error'})
+ return false;
+ }
+
+ if(sms.length == 0){
+ wx.showToast({title: '验证码不能为空', icon:'error'})
+ return false;
+ }
+
if(!this.data.checked){
wx.showToast({
title: '请同意协议',
@@ -54,20 +125,41 @@ Page({
})
return;
}
- var params = {};
- params.phone = this.data.phone;
- params.code = this.data.sms;
- params.user_type = wx.getStorageSync('usertype');
-
- api.mobileLogin(params).then(response => {
- console.log(response);
- wx.setStorageSync('AUTH_TOKEN', response.data.token);
- wx.setStorageSync('user_id', response.data.user_id);
- wx.setStorageSync('client_user_id', response.data.client_user_id);
- wx.switchTab({
- url: wx.getStorageSync('next_url')
- })
- }).catch(errors => {console.error(errors);})
+ let usertype = wx.getStorageSync('usertype');
+ wx.login({
+ success: (res) => {
+ console.log(res)
+ if (res.code) {
+ var params = {};
+ params.phone = this.data.phone;
+ params.code = this.data.sms;
+ params.user_type = usertype;
+ params.wx_code = res.code;
+
+ api.mobileLogin(params).then(response => {
+ app.globalData.isLogin=true;
+ console.log(response);
+ wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token);
+ wx.setStorageSync('user_id_'+usertype, response.data.user_id);
+ wx.setStorageSync('client_user_id_'+usertype, response.data.client_user_id);
+ app.globalData.config.userID = response.data.user_id;
+ let handleGo=function(){
+ wx.switchTab({
+ url: wx.getStorageSync('next_url')
+ })
+ }
+ app.imInit({path:'Pages/mobile_login/index'},1,handleGo);
+
+ }).catch(errors => {console.error(errors);})
+ } else {
+ wx.showToast({
+ title: '登录失败',
+ icon: "error"
+ })
+ }
+ },
+ })
+
},
beginDaoJiShi(){
console.log("开始倒计时")
@@ -83,14 +175,16 @@ Page({
})
}else{
_this.setData({
- btn_msg: "获取验证码",
+ btn_msg: "重新获取验证码",
btn_disabled: false
})
clearInterval(time_index);
}
},1000)
-
-
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ app.go(url);
}
})
\ No newline at end of file
diff --git a/Pages/mobile_login/index.json b/Pages/mobile_login/index.json
index 57d5f40..aeeb6c8 100644
--- a/Pages/mobile_login/index.json
+++ b/Pages/mobile_login/index.json
@@ -5,6 +5,7 @@
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index",
"van-checkbox": "@vant/weapp/checkbox/index",
- "van-checkbox-group": "@vant/weapp/checkbox-group/index"
+ "van-checkbox-group": "@vant/weapp/checkbox-group/index",
+ "van-image": "@vant/weapp/image/index"
}
}
\ No newline at end of file
diff --git a/Pages/mobile_login/index.wxml b/Pages/mobile_login/index.wxml
index 7e1d9d8..2b15655 100644
--- a/Pages/mobile_login/index.wxml
+++ b/Pages/mobile_login/index.wxml
@@ -1,30 +1,41 @@
-
+
-
-
-
- {{btn_msg}}
-
-
+
+ +86
+
+
+
+
+
+
+ {{btn_msg}}
+
+
登录
- 我已阅读并同意协议《肝胆相照用户服务协议》
+
+
+
+
+ 我已阅读并同意协议
+ 《肝胆相照用户注册及服务协议》
+ 《隐私协议》
+ 《劳务协议》
+
+
\ No newline at end of file
diff --git a/Pages/mobile_login/index.wxss b/Pages/mobile_login/index.wxss
index 2dee842..162f63f 100644
--- a/Pages/mobile_login/index.wxss
+++ b/Pages/mobile_login/index.wxss
@@ -1,5 +1,5 @@
.logo{
- height: 500rpx;
+ margin-top: 150rpx;
display: flex;
align-items: center;
justify-content: center;
@@ -10,4 +10,47 @@
.btn{
font-size: 28rpx;
color: #666666;
+}
+.van-cell {
+ padding: 32rpx !important;
+ font-size: 34rpx !important;
+}
+.mylabel{
+ background-color: red;
+ width: 100rpx !important;
+}
+.label-class{
+ background-color: royalblue !important;
+}
+.phone_box{
+ display: flex;
+ padding: 32rpx;
+ position: relative;
+}
+.country{
+ flex: 1;
+ height: 24px;
+ line-height: 24px;
+}
+.phone{
+ flex: 7;
+ height: 24px;
+}
+.phone_box:after {
+ border-bottom: 1px solid #ebedf0;
+ bottom: 0;
+ box-sizing: border-box;
+ content: " ";
+ left: 16px;
+ pointer-events: none;
+ position: absolute;
+ right: 16px;
+ transform: scaleY(.5);
+ transform-origin: center;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-bottom-color: rgb(235, 237, 240);
+}
+.van-checkbox {
+ padding-top: 6rpx !important;
}
\ No newline at end of file
diff --git a/Pages/webpage/index.js b/Pages/webpage/index.js
new file mode 100644
index 0000000..9422bb5
--- /dev/null
+++ b/Pages/webpage/index.js
@@ -0,0 +1,18 @@
+// Pages/webpage/index.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ src: ""
+ },
+
+ onLoad(options) {
+ console.log(options.src)
+ this.setData({
+ src: options.src
+ })
+ },
+
+})
\ No newline at end of file
diff --git a/Pages/webpage/index.json b/Pages/webpage/index.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/Pages/webpage/index.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/Pages/webpage/index.wxml b/Pages/webpage/index.wxml
new file mode 100644
index 0000000..22a9b46
--- /dev/null
+++ b/Pages/webpage/index.wxml
@@ -0,0 +1,2 @@
+
+
diff --git a/Pages/webpage/index.wxss b/Pages/webpage/index.wxss
new file mode 100644
index 0000000..12b229e
--- /dev/null
+++ b/Pages/webpage/index.wxss
@@ -0,0 +1 @@
+/* Pages/webpage/index.wxss */
\ No newline at end of file
diff --git a/Pages/yaoshi/authentication/authentication.js b/Pages/yaoshi/authentication/authentication.js
index 9f2ffdf..1e25c6b 100644
--- a/Pages/yaoshi/authentication/authentication.js
+++ b/Pages/yaoshi/authentication/authentication.js
@@ -1,4 +1,5 @@
-// Pages/authentication/authentication.js
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
data: {
@@ -8,9 +9,8 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '实名认证', //导航栏 中间的标题
},
-
- // 此页面 页面内容距最顶部的距离
- height: app.globalData.height,
+ height: app.globalData.height,
+ info: {}
},
onLoad() {
console.log(this.data.height)
@@ -19,5 +19,14 @@ Page({
this.setData({
nbLoading: false,
})
+
+ api.getPharmacistInfo().then(response => {
+ console.log(response.data);
+ this.setData({
+ info: response.data
+ })
+ }).catch(errors => {
+ console.error(errors);
+ })
}
})
\ No newline at end of file
diff --git a/Pages/yaoshi/authentication/authentication.wxml b/Pages/yaoshi/authentication/authentication.wxml
index 10e9244..51a5e6f 100644
--- a/Pages/yaoshi/authentication/authentication.wxml
+++ b/Pages/yaoshi/authentication/authentication.wxml
@@ -1,18 +1,18 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
- 下一步
+ 下一步(去干啥?)
\ No newline at end of file
diff --git a/Pages/yaoshi/home/home.js b/Pages/yaoshi/home/home.js
index c86eab1..6be686b 100644
--- a/Pages/yaoshi/home/home.js
+++ b/Pages/yaoshi/home/home.js
@@ -1,4 +1,5 @@
-// Pages/home.js
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
/**
@@ -12,21 +13,132 @@ Page({
title: '药师端', //导航栏 中间的标题
},
// 此页面 页面内容距最顶部的距离
- height: app.globalData.height
+ height: app.globalData.height,
+ pharmacist: {},
+ audit_number: 0,
+ data_list_0: [],
+ data_list_1: [],
+ data_list_2: [],
+ data_list_3: [],
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
},
- onLoad() {
- console.log(this.data.height)
+ onShow() {
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().setData({
+ active: 0, //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
+ })
+ }
+
+ this.getPharmacistPrescription(this.data.active);
},
/**
* 生命周期函数--监听页面显示
*/
- onShow: function () {
- if (typeof this.getTabBar === 'function' && this.getTabBar()) {
- this.getTabBar().setData({
- currentTab: 0 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
+ onLoad: function () {
+
+ api.getPharmacistIndex().then(response => {
+ this.setData({
+ pharmacist: response.data.pharmacist,
+ audit_number: response.data.audit_number
})
+ }).catch(errors => {
+ console.error(errors);
+ })
+
+
+ },
+ getPharmacistPrescription(active){
+ let params = {};
+ let page = this.data.current_page + 1;
+ let pharmacist_audit_status = 0;
+ let platform_audit_status = 1;
+
+ if(active == 0){
+ pharmacist_audit_status = 0;
+ platform_audit_status = 0;
}
+ if(active == 1){
+ pharmacist_audit_status = 1;
+ platform_audit_status = 1;
+ }
+ if(active == 2){
+ pharmacist_audit_status = 2;
+ platform_audit_status = 0;
+ }
+ if(active == 3){
+ pharmacist_audit_status = 1;
+ platform_audit_status = 2;
+ }
+ params.pharmacist_audit_status = pharmacist_audit_status;
+ params.platform_audit_status = platform_audit_status;
+ params.page = page;
+ let data_name = "data_list_"+active;
+ let list = this.data[data_name];
+ api.getPharmacistPrescription(params).then(response => {
+ this.setData({
+ [data_name]: list.concat(response.data.data),
+ current_page: response.data.current_page,
+ total: response.data.total,
+ per_page: response.data.per_page,
+ last_page: response.data.last_page,
+ })
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ onHide(){
+ this.setData({
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
+ data_list_0: [],
+ data_list_1: [],
+ data_list_2: [],
+ data_list_3: [],
+ })
+ },
+ onChange(e){
+ console.log(e)
+ let data_name = "data_list_"+e.detail.index;
+ this.setData({
+ active: e.detail.index,
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
+ [data_name]: []
+ })
+ this.getPharmacistPrescription(e.detail.index);
+ },
+ onReachBottom() {
+ console.log('===触底了!!===');
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getPharmacistPrescription(this.data.active)
+ }
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ app.go(url)
+ },
+ switchStatus(){
+ let is_online = this.data.pharmacist.is_online;
+ if(is_online == 0){
+ is_online = 1
+ }else if(is_online == 1){
+ is_online = 0
+ }
+ api.putPharmacistOnOff({is_online: is_online}).then(response => {
+ this.setData({
+ "pharmacist.is_online": is_online
+ })
+ }).catch(errors => {console.error(errors);})
}
+
+
})
\ No newline at end of file
diff --git a/Pages/yaoshi/home/home.json b/Pages/yaoshi/home/home.json
index 648cc19..1ec3886 100644
--- a/Pages/yaoshi/home/home.json
+++ b/Pages/yaoshi/home/home.json
@@ -5,6 +5,8 @@
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"t-avatar": "tdesign-miniprogram/avatar/avatar",
- "van-button": "@vant/weapp/button/index"
+ "van-button": "@vant/weapp/button/index",
+ "van-empty": "@vant/weapp/empty/index",
+ "van-divider": "@vant/weapp/divider/index"
}
}
\ No newline at end of file
diff --git a/Pages/yaoshi/home/home.wxml b/Pages/yaoshi/home/home.wxml
index 0487f1d..b3e7aec 100644
--- a/Pages/yaoshi/home/home.wxml
+++ b/Pages/yaoshi/home/home.wxml
@@ -2,100 +2,135 @@
-
+
- 李四
- 今日审方 9
+ {{pharmacist.user_name}}
+ 今日审方 {{audit_number}}
-
- 离线
+
+ {{pharmacist.is_online==1?'在线':'离线'}}
-
+
-
-
- 处方订单号:2023010510324649
-
-
- 查看病例
-
+
+
+
+ 处方订单号:{{item.prescription_code}}
+
+
+
-
-
- 开方时间:2023-01-16 08:52
-
-
- 查看病例
-
+
+ 开方时间:{{item.created_at}}
+
+ 查看病例
+
-
-
- 张三/男/45岁
-
- 去审方
+
+ {{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁
+
+ 去审方
+
+ 到底了~
-
-
-
- 处方订单号:2023010510324649
-
- 查看病例
-
-
-
-
- 开方时间:2023-01-16 08:52
-
- 查看病例
-
-
-
-
- 张三/男/45岁
-
- 去审方
-
-
-
-
+
-
-
- 处方订单号 2023010510324649
+
+
+
+ 处方订单号:{{item.prescription_code}}
+
+ 查看病例
+
-
- 迷你按钮
+
+
+ 开方时间:{{item.created_at}}
+ 通过
+
+
+
+ {{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁
+
+
+
+ 到底了~
+
+
-
-
- 处方订单号 2023010510324649
+
+
+
+ 处方订单号:{{item.prescription_code}}
+
+ 查看病例
+
-
- 迷你按钮
+
+
+ 开方时间:{{item.created_at}}
+ 驳回
+
+
+
+ {{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁
+
+
+
+
+
+ 驳回时间:{{item.pharmacist_verify_time}}
+
+
+ 驳回理由:{{item.pharmacist_fail_reason}}
+ 到底了~
+
+
-
-
- 处方订单号 2023010510324649
+
+
+
+ 处方订单号:{{item.prescription_code}}
+
+ 查看病例
+
-
- 迷你按钮
+
+
+ 开方时间:{{item.created_at}}
+ 驳回
+
+
+
+ {{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁
+
+
+
+ 到底了~
+
+
+
+
+
\ No newline at end of file
diff --git a/Pages/yaoshi/home/home.wxss b/Pages/yaoshi/home/home.wxss
index 028c6bc..5203b44 100644
--- a/Pages/yaoshi/home/home.wxss
+++ b/Pages/yaoshi/home/home.wxss
@@ -1,7 +1,8 @@
-.container{
+page{
background-color: #F4F5F7;
+}
+.container{
width: 100vw;
- height: 100vh;
}
.main{
width: 90vw;
@@ -39,15 +40,18 @@
.status_offline{
background-color: #BFBFBF;
}
+.status_online{
+ background-color: rgb(124, 231, 124);
+}
.status_text{
- display: inline-block;
padding: 10rpx 20rpx;
border-radius: 20rpx;
- word-spacing: 10rpx;
- letter-spacing: 10rpx;
float: right;
margin-right: 25rpx;
font-size: 20rpx;
+ display: flex;
+ width: 50rpx;
+ justify-content: space-evenly;
}
.custom-tabs {
margin-bottom: 32rpx;
@@ -65,10 +69,24 @@
.avatar-example--medium:not(:last-child) {
margin-right: 96rpx;
}
+.van-tabs__nav{
+ border-radius: 20rpx !important;
+}
+.item_list{
+ padding-bottom: 100rpx;
+ background-color: #F4F5F7;
+ border-radius: 20rpx;
+}
+.item:last-child{
+ border-bottom-left-radius: 20rpx;
+ border-bottom-right-radius: 20rpx;
+}
.item{
border-top: solid rgb(187, 185, 185) 1rpx;
- width: 95%;
- margin: 10rpx auto;
+ width: 100%;
+ margin: 0 auto;
+ background-color: #fff;
+ padding: 20rpx 0;
}
.item_txt{
display: flex;
diff --git a/Pages/yaoshi/index/index.js b/Pages/yaoshi/index/index.js
index 439882c..2034790 100644
--- a/Pages/yaoshi/index/index.js
+++ b/Pages/yaoshi/index/index.js
@@ -1,8 +1,10 @@
// Pages/index/index.js
+import { API } from './../../../utils/network/api'
+const api = new API()
Page({
- /**
- * 生命周期函数--监听页面显示
- */
+ data: {
+ static_host: api.getStaticHost()
+ },
onShow() {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
diff --git a/Pages/yaoshi/index/index.wxml b/Pages/yaoshi/index/index.wxml
index 73e329d..de825d5 100644
--- a/Pages/yaoshi/index/index.wxml
+++ b/Pages/yaoshi/index/index.wxml
@@ -4,7 +4,7 @@
{
+ console.log(response.data);
+ this.setData({
+ info: response.data
+ })
+ }).catch(errors => {
+ console.error(errors);
+ })
}
})
diff --git a/Pages/yaoshi/info/info.wxml b/Pages/yaoshi/info/info.wxml
index ab98404..531713a 100644
--- a/Pages/yaoshi/info/info.wxml
+++ b/Pages/yaoshi/info/info.wxml
@@ -1,19 +1,19 @@
-
- 李四
+
+ {{info.user_name}}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Pages/yaoshi/info/info.wxss b/Pages/yaoshi/info/info.wxss
index f40053f..9149bd9 100644
--- a/Pages/yaoshi/info/info.wxss
+++ b/Pages/yaoshi/info/info.wxss
@@ -1,12 +1,16 @@
+page{
+ background-color: #F4F4F4;
+}
.top{
width: 100vw;
- background-color: cornflowerblue;
+ background-color: rgb(255, 255, 255);
height: 370rpx;
display: flex;
justify-content: center;
align-items: center;
align-content: center;
flex-direction: column;
+ margin-bottom: 20rpx;
}
.name{
color: white;
@@ -14,6 +18,6 @@
text-align: justify;
text-justify:distribute-all-lines;
text-align-last: justify;
- width: 60rpx;
font-size: 28rpx;
+ width: 180rpx;
}
diff --git a/Pages/yaoshi/medicalrecord/medicalrecord.js b/Pages/yaoshi/medicalrecord/medicalrecord.js
index 70ad975..94e656e 100644
--- a/Pages/yaoshi/medicalrecord/medicalrecord.js
+++ b/Pages/yaoshi/medicalrecord/medicalrecord.js
@@ -1,7 +1,6 @@
-//index.js
-//获取应用实例
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
-
Page({
data: {
// 组件所需的参数
@@ -9,11 +8,37 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '患者病历', //导航栏 中间的标题
},
-
// 此页面 页面内容距最顶部的距离
- height: app.globalData.height ,
+ height: app.globalData.height,
+ order_inquiry_id: "",
+ order_prescription_id: "",
+ case_detail: {},
+ from: ""
+ },
+ onLoad(options) {
+ let order_inquiry_id = options.order_inquiry_id;
+ let order_prescription_id = options.order_prescription_id;
+ let from = options.from;
+ console.log("order_inquiry_id: ", order_inquiry_id);
+ this.setData({
+ order_inquiry_id: order_inquiry_id,
+ order_prescription_id: order_prescription_id,
+ from: from,
+ })
+ },
+ onShow(){
+
+ api.getCase({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
+ console.log(response.data);
+ this.setData({
+ case_detail: response.data
+ })
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ app.go(url)
},
- onLoad() {
- console.log(this.data.height)
- }
})
diff --git a/Pages/yaoshi/medicalrecord/medicalrecord.wxml b/Pages/yaoshi/medicalrecord/medicalrecord.wxml
index e1a0a73..8829e62 100644
--- a/Pages/yaoshi/medicalrecord/medicalrecord.wxml
+++ b/Pages/yaoshi/medicalrecord/medicalrecord.wxml
@@ -3,27 +3,26 @@
患者信息
- 姓名:张三
- 性别:男
- 年龄:30岁
+ 姓名:{{case_detail.name}}
+ 性别:{{case_detail.sex==1?'男':'女'}}
+ 年龄:{{case_detail.age}}岁
疾病资料
- 病情主要述:我问问
- 用药意向:【未匹配】连花清瘟胶囊*1
- 体重:56KG
- 本次用药已相关确认病症:无
- 是否服用过您想购买的药品且无相关禁忌症:是
- 是否有药物过敏史:否
- 您的肝功能、肾功能是否存在异常:否
- 您是否处于备孕、妊娠、哺乳期:否
+ 病情主要述:{{case_detail.disease_desc}}
+
+ 用药意向:
+ {{item}}
+
+ 体重:{{case_detail.weight}}KG
+ 是否服用过您想购买的药品且无相关禁忌症:{{case_detail.is_taboo==0?'否':'是'}}
+ 是否有药物过敏史:{{case_detail.is_allergy_history==0?'否':'是'}}
+ 您是否处于备孕、妊娠、哺乳期:{{case_detail.is_pregnant==0?'否':'是'}}
复诊凭证
-
-
- 前往审方
-
+
+ 前往审方
- 肝胆相照提供技术支持
+
\ No newline at end of file
diff --git a/Pages/yaoshi/medicalrecord/medicalrecord.wxss b/Pages/yaoshi/medicalrecord/medicalrecord.wxss
index aa32373..4e53343 100644
--- a/Pages/yaoshi/medicalrecord/medicalrecord.wxss
+++ b/Pages/yaoshi/medicalrecord/medicalrecord.wxss
@@ -1,7 +1,8 @@
+page{
+ background-color: #F3F5F7;
+}
.container{
letter-spacing: 3rpx;
- background-color: #F3F5F7;
- height: 100vh;
}
.user_info{
background-color: #fff;
diff --git a/Pages/yaoshi/my/my.js b/Pages/yaoshi/my/my.js
index 6284fd5..0f2c357 100644
--- a/Pages/yaoshi/my/my.js
+++ b/Pages/yaoshi/my/my.js
@@ -1,31 +1,56 @@
-// Pages/my/my.js
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
-
- /**
- * 页面的初始数据
- */
data: {
navbarData: {
- showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示
title: '个人中心', //导航栏 中间的标题
},
-
- // 此页面 页面内容距最顶部的距离
- height: app.globalData.height,
+ height: app.globalData.height,
+ info:{}
},
- onLoad() {
- console.log(this.data.height)
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
onShow() {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
- currentTab: 1 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
+ active: 1, //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
})
}
+
+ api.getPharmacistInfo().then(response => {
+ console.log(response.data);
+ this.setData({
+ info: response.data
+ })
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ logOut(){
+ console.log("退出登录");
+ let usertype = wx.getStorageSync('usertype');
+ wx.showModal({
+ title: '确认退出登录',
+ content: '退出登录后您需要重新登录',
+ success (res) {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ wx.setStorageSync('AUTH_TOKEN_'+usertype, "");
+ wx.setStorageSync('user_id_'+usertype, "");
+ wx.setStorageSync('client_user_id_'+usertype, "");
+ app.globalData.isLogin=false;
+ wx.setStorageSync('usertype','')
+ app.go("/Pages/index/index");
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ },
+ go(e){
+ console.log(e)
+ let url = e.currentTarget.dataset.url;
+ app.go(url);
}
+
})
\ No newline at end of file
diff --git a/Pages/yaoshi/my/my.json b/Pages/yaoshi/my/my.json
index bc00c53..35d8a0c 100644
--- a/Pages/yaoshi/my/my.json
+++ b/Pages/yaoshi/my/my.json
@@ -1,9 +1,10 @@
{
"component": true,
"usingComponents": {
- "te-nav-bar": "/commpents/te_navbar",
"t-avatar": "tdesign-miniprogram/avatar/avatar",
- "van-icon": "@vant/weapp/icon/index"
+ "van-icon": "@vant/weapp/icon/index",
+ "van-button": "@vant/weapp/button/index",
+ "te-nav-bar": "/commpents/te_navbar"
},
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
diff --git a/Pages/yaoshi/my/my.wxml b/Pages/yaoshi/my/my.wxml
index de38384..66155ea 100644
--- a/Pages/yaoshi/my/my.wxml
+++ b/Pages/yaoshi/my/my.wxml
@@ -1,20 +1,18 @@
-
- 李四
+
+ {{info.user_name}}
-
- 个人中心
-
+ 个人中心
-
-
-
- 实名认证
-
+
+
+ 实名认证
+
+ 退出登录
\ No newline at end of file
diff --git a/Pages/yaoshi/my/my.wxss b/Pages/yaoshi/my/my.wxss
index 2f0075c..b182a9f 100644
--- a/Pages/yaoshi/my/my.wxss
+++ b/Pages/yaoshi/my/my.wxss
@@ -12,10 +12,10 @@
color: white;
margin-top: 30rpx;
text-align: justify;
- text-justify:distribute-all-lines;
+ text-justify: inter-word;
text-align-last: justify;
- width: 60rpx;
font-size: 28rpx;
+ width: 180rpx;
}
.my{
display: flex;
diff --git a/Pages/yaoshi/prescription/prescription.js b/Pages/yaoshi/prescription/prescription.js
index dd73300..fce659a 100644
--- a/Pages/yaoshi/prescription/prescription.js
+++ b/Pages/yaoshi/prescription/prescription.js
@@ -1,4 +1,6 @@
-import Toast from '@vant/weapp/toast/toast';
+import Toast from '@vant/weapp/toast/toast'
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
data: {
@@ -10,12 +12,18 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '处方详情', //导航栏 中间的标题
},
-
// 此页面 页面内容距最顶部的距离
- height: app.globalData.height,
+ height: app.globalData.height,
+ order_prescription_id: "",
+ prescription_img_oss_path: "",
+ doctor_sign_image: ""
},
- onLoad() {
- console.log(this.data.height)
+ onLoad(options) {
+ let order_prescription_id = options.order_prescription_id;
+ console.log("order_prescription_id: ", order_prescription_id)
+ this.setData({
+ order_prescription_id: order_prescription_id
+ })
},
onConfirmReason(event) {
@@ -27,7 +35,6 @@ Page({
},
onCancelReason() {
- Toast('取消');
this.setData({ reasonshow: false });
},
@@ -53,21 +60,38 @@ Page({
this.setData({ bohuishow: false });
},
- submitBohui() {
+ submitBohui(e) {
console.log(444);
- Toast.loading({
- message: '加载中...',
- forbidClick: true,
- onClose: () => {
- console.log('执行OnClose函数');
- this.setData({ bohuishow: false });
- },
- });
-
+ this.putPharmacistPrescriptionVerify(e);
},
submit(){
console.log(555);
+ },
+ onShow(){
+ api.getPharmacistPrescriptioninfo({order_prescription_id: this.data.order_prescription_id}).then(response => {
+ console.log(response.data);
+ this.setData({
+ prescription_img_oss_path: response.data.prescription_img_oss_path,
+ doctor_sign_image: response.data.doctor_sign_image
+ })
+ }).catch(errors => {console.error(errors);})
+ },
+ putPharmacistPrescriptionVerify(e){
+ console.log(e)
+ let params = {};
+ params.pharmacist_audit_status = e.currentTarget.dataset.pharmacist_audit_status;
+ if(params.pharmacist_audit_status == 2){
+ params.pharmacist_fail_reason = this.data.resonText;
+ }
+ params.order_prescription_id = this.data.order_prescription_id;
+ api.putPharmacistPrescriptionVerify(params).then(response => {
+ console.log(response.data);
+ Toast.success("处理成功");
+ setTimeout(() => {
+ wx.navigateBack();
+ }, 1000);
+ }).catch(errors => {console.error(errors);})
}
})
\ No newline at end of file
diff --git a/Pages/yaoshi/prescription/prescription.wxml b/Pages/yaoshi/prescription/prescription.wxml
index b1af226..8c6b132 100644
--- a/Pages/yaoshi/prescription/prescription.wxml
+++ b/Pages/yaoshi/prescription/prescription.wxml
@@ -1,32 +1,43 @@
-
+
+
+
+
+
+
驳回
-
+
通过
+
+
+
-
+
取消
- 确认驳回
+ 确认驳回
diff --git a/Pages/yaoshi/prescription/prescription.wxss b/Pages/yaoshi/prescription/prescription.wxss
index 314155b..a4446ba 100644
--- a/Pages/yaoshi/prescription/prescription.wxss
+++ b/Pages/yaoshi/prescription/prescription.wxss
@@ -1,6 +1,7 @@
-.container{
+page{
background-color: #F3F5F7;
}
+
.img_box{
width: 90vw;
margin: 20rpx auto;
@@ -10,7 +11,7 @@
width: 100%;
}
.img_content{
- background-color: #F1F1F3;
+ background-color: #F3F5F7;
padding: 20rpx;
border-radius: 10rpx;
}
@@ -23,7 +24,7 @@
display:inline-block;
}
.pop{
- width: 80vw;
+ width: 90vw;
margin-bottom: 30rpx;
}
.pop_button{
@@ -33,4 +34,27 @@
}
.pop_button_txt{
color: red;
+}
+.imgbox{
+ width:100%;
+ height:0;
+ position:relative;
+ padding-bottom:141%;
+}
+.prescription{
+ position:absolute;
+ top:0px;
+ height:100%;
+ bottom:0px;
+ width:100%;
+}
+.doctorSign{
+ position:absolute;
+ width:100rpx;
+ height:53rpx;
+ left:125rpx;
+ bottom:126rpx;
+}
+.van-cell__value{
+ flex: 1.2 !important;
}
\ No newline at end of file
diff --git a/Pages/yishi/agreement_detail/index.js b/Pages/yishi/agreement_detail/index.js
new file mode 100644
index 0000000..9593e2d
--- /dev/null
+++ b/Pages/yishi/agreement_detail/index.js
@@ -0,0 +1,30 @@
+import { API } from './../../../utils/network/api'
+let api = new API()
+Page({
+
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '协议详情', //导航栏 中间的标题
+ },
+ agreement_id: "",
+ agreement_content: ""
+ },
+
+ onLoad(option){
+ this.setData({
+ agreement_id: option.agreement_id
+ })
+ },
+
+ onShow(){
+ //获取医生我的账户数据
+ api.getBasicAgreement({agreement_id: this.data.agreement_id}).then(response => {
+ console.log(response);
+ this.setData({
+ agreement_content: response.data.agreement_content,
+ "navbarData.title": response.data.agreement_name,
+ })
+ }).catch(errors => {console.error(errors);})
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/agreement_detail/index.json b/Pages/yishi/agreement_detail/index.json
new file mode 100644
index 0000000..3b3b8cc
--- /dev/null
+++ b/Pages/yishi/agreement_detail/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar"
+ }
+}
\ No newline at end of file
diff --git a/Pages/yishi/agreement_detail/index.wxml b/Pages/yishi/agreement_detail/index.wxml
new file mode 100644
index 0000000..8e9cd5f
--- /dev/null
+++ b/Pages/yishi/agreement_detail/index.wxml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/Pages/yishi/agreement_detail/index.wxss b/Pages/yishi/agreement_detail/index.wxss
new file mode 100644
index 0000000..893b247
--- /dev/null
+++ b/Pages/yishi/agreement_detail/index.wxss
@@ -0,0 +1,8 @@
+/* Pages/yishi/manual_detail/index.wxss */
+page{
+ background-color: #F6F6F6;
+}
+.container{
+ width: 92vw;
+ margin: 20rpx auto;
+}
\ No newline at end of file
diff --git a/Pages/yishi/appraise/index.js b/Pages/yishi/appraise/index.js
index 9e058c1..47c86e5 100644
--- a/Pages/yishi/appraise/index.js
+++ b/Pages/yishi/appraise/index.js
@@ -36,7 +36,7 @@ Page({
onReachBottom() {
console.log('===触底了!!===');
if(this.data.current_page < this.data.last_page){//最后一页时停止分页
- this.getDoctorEvaluationList()
+ this.getDoctorEvaluationList(this.data.evaluation_type)
}
},
onLoad(option){
@@ -44,38 +44,32 @@ Page({
this.setData({
doctor_id: option.doctor_id
})
+
},
onShow(){
console.log("onShow");
- this.getDoctorEvaluationList();
+ this.getDoctorEvaluationList(1);
},
onTabsChange(e){
console.log(e);
- let list_name = "appraise_list_" + this.data.evaluation_type;
+ let list_name = "appraise_list_" + e.detail.name;
this.setData({
- evaluation_type: e.detail.value,
+ evaluation_type: e.detail.name,
current_page: 0,
last_page: 0,
[list_name]: []
})
- this.getDoctorEvaluationList()
+ this.getDoctorEvaluationList(e.detail.name)
},
- onTabsClick(e){
- console.log(e);
- },
- onStickyScroll(e){
- return 1;
- },
- getDoctorEvaluationList(){
+ getDoctorEvaluationList(evaluation_type){
//获取评价列表
let params = {};
params.page = this.data.current_page + 1;
params.doctor_id = this.data.doctor_id;
- params.evaluation_type = this.data.evaluation_type;
+ params.evaluation_type = evaluation_type;
api.getDoctorEvaluation(params).then(response => {
- console.log(response);
if(response.data.total > 0){
- let list_name = "appraise_list_" + this.data.evaluation_type;
+ let list_name = "appraise_list_" + evaluation_type;
console.log(list_name);
let apprise_list = this.data[list_name];
this.setData({
diff --git a/Pages/yishi/appraise/index.json b/Pages/yishi/appraise/index.json
index d2a16c5..34bf6ab 100644
--- a/Pages/yishi/appraise/index.json
+++ b/Pages/yishi/appraise/index.json
@@ -3,9 +3,11 @@
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"appraise-data": "/commpents/appraise_data/index",
- "t-tabs": "tdesign-miniprogram/tabs/tabs",
- "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel"
+ "van-empty": "@vant/weapp/empty/index",
+ "van-tab": "@vant/weapp/tab/index",
+ "van-tabs": "@vant/weapp/tabs/index",
+ "t-rate": "tdesign-miniprogram/rate/rate",
+ "van-divider": "@vant/weapp/divider/index"
},
- "enablePullDownRefresh": true,
"onReachBottomDistance": 100
}
\ No newline at end of file
diff --git a/Pages/yishi/appraise/index.wxml b/Pages/yishi/appraise/index.wxml
index 6a5cb41..39259e5 100644
--- a/Pages/yishi/appraise/index.wxml
+++ b/Pages/yishi/appraise/index.wxml
@@ -1,6 +1,64 @@
+
-
-
+
+
+
+
+
+
+ {{item.name_mask}}
+
+
+
+
+ {{item.content}}
+ {{dateSubstr.substring(item.created_at,0,16)}}
+
+
+
+ 到底了~
+
+
+
+
+
+ {{item.name_mask}}
+
+
+
+
+ {{item.content}}
+ {{dateSubstr.substring(item.created_at,0,16)}}
+
+
+
+ 到底了~
+
+
+
+
+
+ {{item.name_mask}}
+
+
+
+
+ {{item.content}}
+ {{dateSubstr.substring(item.created_at,0,16)}}
+
+
+
+ 到底了~
+
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/appraise/index.wxss b/Pages/yishi/appraise/index.wxss
index 9316094..112832e 100644
--- a/Pages/yishi/appraise/index.wxss
+++ b/Pages/yishi/appraise/index.wxss
@@ -1,20 +1,8 @@
+page{
+ background-color: #F6F6F6;
+}
.container{
width: 100vw;
- height: 100vh;
- background-color: #F6F6F6;
-}
-.t-tab-panel,.t-tabs__content {
- background-color: #F6F6F6;
-}
-.t-tabs__item--active{
- color: #49B9AD !important;
- font-size: 32rpx !important;
-}
-.t-tabs__item-inner--line{
- font-size: 28rpx !important;
-}
-.t-tabs__track{
- background-color: var(--td-tab-track-color, var(--td-primary-color, #49B9AD)) !important;
}
.item_list{
width: 92vw;
@@ -22,3 +10,41 @@
background-color: #fff;
border-radius: 20rpx;
}
+
+
+
+.item{
+ display: flex;
+ padding: 20rpx;
+ flex-direction: column;
+}
+.item:not(:last-child){
+ border-bottom: 1px solid #E7E7E7;
+}
+.top{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ flex: 1;
+}
+.name{
+ flex: 1;
+ font-size: 30rpx;
+ color: #666666;
+}
+.start{
+ flex: 1;
+ display: flex;
+ justify-content: flex-end;
+}
+.content{
+ flex: 2;
+ font-size: 34rpx;
+ color: #333333;
+ margin: 20rpx 0;
+}
+.date{
+ flex: 1;
+ font-size: 28rpx;
+ color: #666666;
+}
\ No newline at end of file
diff --git a/Pages/yishi/attestation/index.wxml b/Pages/yishi/attestation/index.wxml
index 80c7612..5b7f341 100644
--- a/Pages/yishi/attestation/index.wxml
+++ b/Pages/yishi/attestation/index.wxml
@@ -1,6 +1,6 @@
-
-
+
+
\ No newline at end of file
diff --git a/Pages/yishi/bankcard/index.js b/Pages/yishi/bankcard/index.js
index bc1aca1..39f53b8 100644
--- a/Pages/yishi/bankcard/index.js
+++ b/Pages/yishi/bankcard/index.js
@@ -12,12 +12,13 @@ Page({
bank_card_id: "",
bank_img_path: "",
bank_name: "",
- bank_card_code_mask: ""
+ bank_card_code_mask: "",
+ static_host: api.getStaticHost()
},
onShow(){
api.getDoctorBank().then(response => {
- if(response.data.total > 0){
+ if(response.data.bank_card_id){
this.setData({
banklist_empty: false,
bank_card_code_mask: response.data.bank_card_code_mask,
diff --git a/Pages/yishi/bankcard/index.json b/Pages/yishi/bankcard/index.json
index 02f0ecb..e4c1b31 100644
--- a/Pages/yishi/bankcard/index.json
+++ b/Pages/yishi/bankcard/index.json
@@ -2,7 +2,7 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
- "t-image": "tdesign-miniprogram/image/image",
+ "van-image": "@vant/weapp/image/index",
"t-icon": "tdesign-miniprogram/icon/icon",
"van-button": "@vant/weapp/button/index"
}
diff --git a/Pages/yishi/bankcard/index.wxml b/Pages/yishi/bankcard/index.wxml
index bcde031..9882fc1 100644
--- a/Pages/yishi/bankcard/index.wxml
+++ b/Pages/yishi/bankcard/index.wxml
@@ -1,37 +1,27 @@
-
+
我的银行卡
-
+
操作手册-银行卡
-
+
添加结算银行卡
提示:每人只能绑定一张银行卡,银行卡绑定成功后每月只能修改结算银行卡一次,请谨慎绑定。
-
+
{{bank_name}}
{{bank_card_code_mask}}
-
-
更换银行卡
diff --git a/Pages/yishi/bankcard/index.wxss b/Pages/yishi/bankcard/index.wxss
index 0b61e2c..a1f2acf 100644
--- a/Pages/yishi/bankcard/index.wxss
+++ b/Pages/yishi/bankcard/index.wxss
@@ -1,7 +1,8 @@
+page{
+ background-color: #F4F4F4;
+}
.container{
width: 100vw;
- height: 100vh;
- background-color: #F4F4F4;
}
.help{
display: flex;
@@ -31,7 +32,7 @@
font-size: 28rpx;
color: #999999;
width: 92vw;
- margin: 0 auto;
+ margin: -20rpx auto;
line-height: 50rpx;
}
.bankcard_list{
diff --git a/Pages/yishi/bindcard/index.js b/Pages/yishi/bindcard/index.js
index 20aa6b1..769c472 100644
--- a/Pages/yishi/bindcard/index.js
+++ b/Pages/yishi/bindcard/index.js
@@ -27,13 +27,14 @@ Page({
area_sub_titles: ["省份","市区","区县"],
areaprovince_data_ready: false,
banklist_data_ready: false,
- bank_card_id: ""
+ bank_card_id: "",
+ static_host: api.getStaticHost()
},
onLoad(options){
console.log("options: ", options);
let bank_card_id = options.bank_card_id;
- console.log("options bank_card_id: ", bank_card_id);
- if(bank_card_id){
+ if(bank_card_id && bank_card_id != "undefined"){
+ console.log("options bank_card_id: ", bank_card_id);
this.setData({
bank_card_id: bank_card_id
})
@@ -67,8 +68,8 @@ Page({
console.log(response);
if(response.data){
this.setData({
- realname:response.data.card_name,
- idcard:response.data.card_num
+ realname:response.data.card_name_mask,
+ idcard:response.data.card_num_mask
});
}
}).catch(errors => {
@@ -81,6 +82,13 @@ Page({
},
onBankShow(e) {
console.log("onBankShow");
+ if(this.data.select_county_id == ""){
+ wx.showToast({
+ title: '请选择城市',
+ icon: "error"
+ })
+ return;
+ }
this.setData({ bank_show: true });
},
onBankClose(e) {
@@ -200,6 +208,8 @@ Page({
},
addBank(e){
console.log("addbank, ", e);
+
+
//绑定医生银行卡
let params = {};
params.county_id = this.data.select_county_id;
@@ -207,6 +217,14 @@ Page({
params.province_id = this.data.select_province_id;
params.bank_card_code = this.data.bankcard;
params.bank_id = this.data.select_bank_id;
+ console.log("params.county_id: ", params.county_id)
+ if(params.county_id == ""){
+ wx.showToast({
+ title: '请选择城市',
+ icon: "error"
+ })
+ return;
+ }
console.log(params);
let bank_card_id = this.data.bank_card_id;
if(bank_card_id){
@@ -218,6 +236,7 @@ Page({
title: '更换成功',
icon: "success"
})
+ wx.navigateBack();
}).catch(errors => {console.error(errors); })
}else{
//绑定医生银行卡
@@ -227,6 +246,7 @@ Page({
title: '绑定成功',
icon: "success"
})
+ wx.navigateBack();
}).catch(errors => {console.error(errors); })
}
}
diff --git a/Pages/yishi/bindcard/index.json b/Pages/yishi/bindcard/index.json
index aaf5106..99aed26 100644
--- a/Pages/yishi/bindcard/index.json
+++ b/Pages/yishi/bindcard/index.json
@@ -9,6 +9,7 @@
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-toast": "@vant/weapp/toast/index",
+ "van-image": "@vant/weapp/image/index",
"t-cascader": "tdesign-miniprogram/cascader/cascader"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/bindcard/index.wxml b/Pages/yishi/bindcard/index.wxml
index c2c3859..69fce33 100644
--- a/Pages/yishi/bindcard/index.wxml
+++ b/Pages/yishi/bindcard/index.wxml
@@ -2,25 +2,30 @@
- 请确定开户人姓名与账户医生的姓名一致
+
+ 请确定开户人姓名与账户医生的姓名一致
-
-
+
+
-
-
+
+
+ type="number"
+ clearable
+ placeholder-style="font-size: 16px;"
+ >
+ 银行卡号
+
diff --git a/Pages/yishi/bindcard/index.wxss b/Pages/yishi/bindcard/index.wxss
index 47c8a6c..b2a7dfc 100644
--- a/Pages/yishi/bindcard/index.wxss
+++ b/Pages/yishi/bindcard/index.wxss
@@ -10,14 +10,35 @@
color: #3CC7C0;
background-color: #F0FFFB;
font-size: 30rpx;
+ display: flex;
+ align-items: center;
}
.bankcard{
- margin-top: 50rpx;
+ margin-top: 20rpx;
}
.note{
font-size: 28rpx;
color: #999999;
width: 92vw;
- margin: 50rpx auto;
+ margin: 20rpx auto;
line-height: 50rpx;
+}
+.t-tabs__item--active{
+ color: #49B9AD !important;
+}
+.t-tabs__track{
+ background-color: #49B9AD !important;
+}
+.t-icon-check{
+ color: #49B9AD !important;
+}
+.van-picker__confirm{
+ color: #3cc7c0 !important;
+}
+.van-cell {
+ padding: 32rpx !important;
+}
+
+.bankcard input{
+ font-size: 16px !important;
}
\ No newline at end of file
diff --git a/Pages/yishi/case copy/index.js b/Pages/yishi/case copy/index.js
new file mode 100644
index 0000000..a456036
--- /dev/null
+++ b/Pages/yishi/case copy/index.js
@@ -0,0 +1,88 @@
+import { API } from './../../../utils/network/api'
+import debounce from './../../../utils/debounce'
+let api = new API()
+const app = getApp()
+Page({
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '病历信息', //导航栏 中间的标题
+ },
+ height: app.globalData.height,
+ order_inquiry_id: "",
+ case_detail: {},
+ imglist: []
+ },
+ onLoad(options){
+ console.log("onLoad", options)
+ this.setData({
+ order_inquiry_id: options.order_inquiry_id
+ })
+
+ },
+ 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}`;
+ wx.downloadFile({
+ // 示例 url,并非真实存在
+ url:url,
+ filePath: newPath,
+ success: function (res) {
+ //const filePath = res.tempFilePath
+ wx.openDocument({
+ fileType:"pdf",
+ showMenu:true,
+ filePath: newPath,
+ success: function (res) {
+ console.log('打开文档成功');
+ wx.hideLoading()
+ },
+ fail:function(error){
+ wx.hideLoading()
+ wx.showToast({
+ title:res,
+ icon:"none"
+ })
+ }
+ })
+ },
+ fail:function(error){
+ wx.showToast({
+ title:error,
+ icon:"none"
+ })
+ }
+
+ })
+ }),
+ formatImgList(){
+ let diagnose_images = this.data.case_detail.diagnose_images?this.data.case_detail.diagnose_images:[];
+ let img_list = [];
+ diagnose_images.forEach(item => {
+ let img = {};
+ img.isImage = true;
+ img.url = item;
+ img_list.push(img);
+ })
+ this.setData({
+ imglist: img_list
+ })
+ },
+ onShow(){
+ //获取患者问诊病例
+ api.getInquiryDetail({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
+ console.log(response);
+ this.setData({
+ case_detail: response.data
+ })
+ }).then(res => {
+ this.formatImgList();
+ }).catch(errors => {console.error(errors);})
+ },
+
+})
\ No newline at end of file
diff --git a/Pages/yishi/case copy/index.json b/Pages/yishi/case copy/index.json
new file mode 100644
index 0000000..a00e82d
--- /dev/null
+++ b/Pages/yishi/case copy/index.json
@@ -0,0 +1,8 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-icon": "@vant/weapp/icon/index",
+ "van-uploader": "@vant/weapp/uploader/index"
+ }
+}
\ No newline at end of file
diff --git a/Pages/yishi/case copy/index.wxml b/Pages/yishi/case copy/index.wxml
new file mode 100644
index 0000000..be3cbc5
--- /dev/null
+++ b/Pages/yishi/case copy/index.wxml
@@ -0,0 +1,114 @@
+
+
+
+ 基础信息
+
+
+ {{case_detail.name}}
+ {{case_detail.sex==1?'男':case_detail.sex==2?'女':'未知'}}|{{case_detail.age}}岁
+
+
+ 身高:{{case_detail.height==null?'未知':case_detail.height + 'CM'}}
+ 体重:{{case_detail.weight==null?'未知':case_detail.weight + 'KG'}}
+ 民族:{{case_detail.nation_name==''?'未知':case_detail.nation_name}}
+ 职业:{{case_detail.job_name==''?'未知':case_detail.job_name}}
+ 婚姻:{{case_detail.marital_status==0?'未婚':case_detail.marital_status==1?'已婚':case_detail.marital_status==2?'离异':'未知'}}
+
+
+
+ 所患疾病:
+ {{case_detail.disease_class_name}}
+
+
+ 确诊日期:
+ {{dateSubstr.substring(case_detail.diagnosis_date,0,10)}}
+
+
+
+ 确诊医院:
+ {{case_detail.diagnosis_hospital}}
+
+
+ 正在服用的药品信息:
+ {{case_detail.drugs_name==''?'无':''}}
+
+
+ 详细描述:{{case_detail.drugs_name}}
+
+
+ 病情描述:
+ {{case_detail.disease_desc}}
+
+
+ 用药意向:
+
+ {{item}};
+
+
+
+ 复诊凭证(病例/处方单/检查报告/住院单):
+ 无
+
+
+
+
+
+
+
+
+ {{case_detail.detection_project_name}}
+
+
+ 糖组检测
+ {{case_detail.detection_project.detection_time}}
+
+
+
+
+ 其他信息
+
+
+
+ 是否服用过您想购买的药品且无相关禁忌:
+ {{case_detail.is_taboo==0?'否':'是'}}
+
+
+ 过敏史:
+ {{case_detail.is_allergy_history==0?'否':case_detail.allergy_history}}
+
+
+ 家族史:
+ {{case_detail.is_family_history==0?'否':case_detail.family_history}}
+
+
+ 是否备孕、妊娠或者哺乳期:
+ {{case_detail.is_pregnant==0?'否':case_detail.pregnant}}
+
+
+ 饮酒史:
+ {{case_detail.drink_wine_status==1?'从不':case_detail.drink_wine_status==2?'偶尔':case_detail.drink_wine_status==3?'经常':case_detail.drink_wine_status==4?'每天':case_detail.drink_wine_status==5?'已戒酒':'其他'}}
+
+
+ 吸烟史:
+ {{case_detail.smoke_status==1?'从不':case_detail.smoke_status==2?'偶尔':case_detail.smoke_status==3?'经常':case_detail.smoke_status==4?'每天':case_detail.smoke_status==5?'已戒烟':'其他'}}
+
+
+ 手术史:
+ {{case_detail.is_operation==0?'否':case_detail.operation}}
+
+
+ 接触化学物:
+ {{case_detail.chemical_compound_status==1?'从不':case_detail.chemical_compound_status==2?'偶尔':case_detail.chemical_compound_status==3?'经常':case_detail.chemical_compound_status==4?'每天':'其他'}}
+
+
+ 详细描述:{{case_detail.chemical_compound_describe}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/case copy/index.wxss b/Pages/yishi/case copy/index.wxss
new file mode 100644
index 0000000..992f24c
--- /dev/null
+++ b/Pages/yishi/case copy/index.wxss
@@ -0,0 +1,127 @@
+page{
+ background-color: #F6F6F6;
+}
+.container{
+ /* width: 100vw; */
+ padding: 0 4vw;
+}
+.main_title{
+ font-size: 16px;
+ color: #000000;
+ margin: 30rpx 0;
+}
+.data_box{
+ margin-top: 20rpx;
+ width: calc(92vw - 40rpx);
+ background-color: #fff;
+ border-radius: 20rpx;
+ padding: 20rpx;
+}
+.data_box_top{
+ display: flex;
+}
+.name{
+ font-size: 34rpx;
+ color: #3CC7C0;
+ margin-right: 20rpx;
+}
+.sex{
+ font-size: 34rpx;
+ color: #666666;
+}
+.info{
+ background: #FAFAFA;
+ border-radius: 10rpx;
+ padding-top: 10rpx;
+ display: flex;
+ flex-wrap: wrap;
+ margin: 20rpx 0 0;
+ padding-bottom: 20rpx;
+}
+.info_item{
+ text-align: left;
+ /* width: 190rpx; */
+ /* height: 60rpx; */
+ margin-top: 10rpx;
+ display: flex;
+ align-items: center;
+ margin-left: 20rpx;
+ align-items: flex-start;
+}
+.info_title{
+ font-size: 28rpx;
+ color: #333333;
+}
+.info_val{
+ font-size: 28rpx;
+ flex: 1;
+ color: #666666;
+}
+.disease_box{
+
+}
+.disease_box_item{
+ margin-bottom: 30rpx;
+ display: flex;
+}
+.data_box .disease_box_item:first-child{
+ margin-top: 20rpx;
+}
+.orther .disease_box_item:first-child{
+ margin-top: 0rpx;
+}
+.title{
+ font-size: 30rpx;
+ color: #333333;
+}
+.conent{
+ flex: 1;
+ font-size: 28rpx;
+ color: #666666;
+ word-wrap:break-word;
+ word-break:break-all;
+}
+.disease_info{
+ background: #FAFAFA;
+ border-radius: 10rpx;
+ padding: 10rpx;
+ font-size: 26rpx;
+ color: #999999;
+ margin-bottom: 20rpx;
+}
+.img_box{
+ display: flex;
+ flex-wrap: wrap;
+}
+.van-uploader__wrapper{
+ display: flex !important;
+}
+.van-uploader__preview{
+ padding: 20rpx 15rpx !important;
+ background-color: #E4E4E4 !important;
+ border-radius: 15rpx;
+ width: 150rpx;
+ display: flex;
+ justify-content: center;
+}
+.orther{
+ margin-bottom: 50rpx;
+}
+
+.sugar{
+ display: flex;
+ align-items: center;
+ justify-content:space-between ;
+}
+.sugar .name{
+ color:#333;
+
+ font-size: 30rpx;
+}
+.sugar .date{
+ margin-top: 12rpx;
+ font-size: 24rpx;
+ font-weight: 400;
+ color: rgba(0,0,0,0.45);
+
+}
\ No newline at end of file
diff --git a/Pages/yishi/case/index.js b/Pages/yishi/case/index.js
index 49cc377..0883819 100644
--- a/Pages/yishi/case/index.js
+++ b/Pages/yishi/case/index.js
@@ -1,3 +1,6 @@
+import { API } from '../../../utils/network/api'
+import debounce from '../../../utils/debounce'
+let api = new API()
const app = getApp()
Page({
data: {
@@ -5,6 +8,101 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '病历信息', //导航栏 中间的标题
},
+ pathography_id:'',
height: app.globalData.height,
- }
+ order_inquiry_id:"",
+ case_detail: {},
+ imglist: []
+ },
+ onLoad(options){
+ console.log("onLoad", options)
+
+ if(options.order_inquiry_id){
+ this.setData({
+ order_inquiry_id: options.order_inquiry_id
+ })
+
+ //获取患者问诊病例
+ api.getInquiryDetail({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
+ console.log(response);
+ this.setData({
+ case_detail: response.data
+ })
+ }).then(res => {
+ this.formatImgList();
+ }).catch(errors => {console.error(errors);})
+ }
+ if(options.pathography_id){
+ this.setData({
+ pathography_id: options.pathography_id
+ })
+ //获取患者问诊病例
+ api.getPathographyDetail(options.pathography_id).then(response => {
+ this.setData({
+ case_detail: response.data
+ })
+ }).then(res => {
+ this.formatImgList();
+ }).catch(errors => {console.error(errors);})
+ }
+
+
+ },
+ 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}`;
+ wx.downloadFile({
+ // 示例 url,并非真实存在
+ url:url,
+ filePath: newPath,
+ success: function (res) {
+ //const filePath = res.tempFilePath
+ wx.openDocument({
+ fileType:"pdf",
+ showMenu:true,
+ filePath: newPath,
+ success: function (res) {
+ console.log('打开文档成功');
+ wx.hideLoading()
+ },
+ fail:function(error){
+ wx.hideLoading()
+ wx.showToast({
+ title:res,
+ icon:"none"
+ })
+ }
+ })
+ },
+ fail:function(error){
+ wx.showToast({
+ title:error,
+ icon:"none"
+ })
+ }
+
+ })
+ }),
+ formatImgList(){
+ let diagnose_images = this.data.case_detail.diagnose_images?this.data.case_detail.diagnose_images:[];
+ let img_list = [];
+ diagnose_images.forEach(item => {
+ let img = {};
+ img.isImage = true;
+ img.url = item;
+ img_list.push(img);
+ })
+ this.setData({
+ imglist: img_list
+ })
+ },
+ onShow(){
+
+ },
+
})
\ No newline at end of file
diff --git a/Pages/yishi/case/index.json b/Pages/yishi/case/index.json
index ee34b87..a00e82d 100644
--- a/Pages/yishi/case/index.json
+++ b/Pages/yishi/case/index.json
@@ -2,6 +2,7 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
- "t-image": "tdesign-miniprogram/image/image"
+ "van-icon": "@vant/weapp/icon/index",
+ "van-uploader": "@vant/weapp/uploader/index"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/case/index.wxml b/Pages/yishi/case/index.wxml
index 187c8ff..3b5d4d8 100644
--- a/Pages/yishi/case/index.wxml
+++ b/Pages/yishi/case/index.wxml
@@ -1,93 +1,139 @@
+
-
+
+
基础信息
- 张三三
- 男|30岁
+ {{case_detail.name}}
+ {{case_detail.sex==1?'男':case_detail.sex==2?'女':'未知'}}|{{case_detail.age}}岁
- 身高:182cm
- 体重:98KG
- 民族:汉族
- 职业:学生
- 婚姻:已婚
+ 身高:{{case_detail.height==null?'未知':case_detail.height + 'CM'}}
+ 体重:{{case_detail.weight==null?'未知':case_detail.weight + 'KG'}}
+ 民族:{{case_detail.nation_name?case_detail.nation_name:'未知'}}
+ 职业:{{case_detail.job_name?case_detail.job_name:'未知'}}
+ 婚姻:{{case_detail.marital_status==0?'未婚':case_detail.marital_status==1?'已婚':case_detail.marital_status==2?'离异':'未知'}}
-
+
所患疾病:
- 肝炎
+ {{case_detail.disease_class_name}}
-
+
确诊日期:
- 2022年8月29日 10:23
+ {{dateSubstr.substring(case_detail.diagnosis_date,0,10)}}
-
+
+
确诊医院:
- 首都医科大学附属北京佑安医院
+ {{case_detail.diagnosis_hospital}}
-
+
正在服用的药品信息:
- 无/有
+ {{case_detail.drugs_name==''?'无':''}}
-
- 详细描述:阿托伐他汀钙片8片 (用法用量:常用的起始剂量为10mg每日一次
+
+ 详细描述:{{case_detail.drugs_name}}
-
+
病情描述:
- 过度劳累,失眠不足导致可以多休息几天,没有好转的话可以去医院看看先吧...
+ {{case_detail.disease_desc}}
-
- 用药意向::
- 阿托伐他汀钙片8片(用法用量:常用的起始剂量为10mg每日一次剂量调整时间为4周或更长。阿托伐他汀每日用量可在一天内的任何时间一次服用,并不受进餐影响。)
+
+ 用药意向:
+
+ {{item}};
+
-
- 问诊本人复诊凭证(病例/处方单/检查报告/住院单可任选其一):
- 无
+
+ 复诊凭证(病例/处方单/检查报告/住院单):
+ 无
-
-
+
+
+
+
+
+
+
+ {{case_detail.detection_project_name}}
+
+
+ 糖组检测
+ {{case_detail.detection_project.detection_time}}
+
+
+
+
+ 其他信息
+
+
+
+ 是否服用过您想购买的药品且无相关禁忌:
+ {{case_detail.is_taboo==0?'否':'是'}}
+
+
+ 过敏史:
+ {{case_detail.is_allergy_history==0?'否':case_detail.allergy_history}}
+
+
+ 家族史:
+ {{case_detail.is_family_history==0?'否':case_detail.family_history}}
+
+
+ 是否备孕、妊娠或者哺乳期:
+ {{case_detail.is_pregnant==0?'否':case_detail.pregnant}}
+
+
+ 饮酒史:
+ {{case_detail.drink_wine_status==1?'从不':case_detail.drink_wine_status==2?'偶尔':case_detail.drink_wine_status==3?'经常':case_detail.drink_wine_status==4?'每天':case_detail.drink_wine_status==5?'已戒酒':'其他'}}
+
+
+ 吸烟史:
+ {{case_detail.smoke_status==1?'从不':case_detail.smoke_status==2?'偶尔':case_detail.smoke_status==3?'经常':case_detail.smoke_status==4?'每天':case_detail.smoke_status==5?'已戒烟':'其他'}}
+
+
+ 手术史:
+ {{case_detail.is_operation==0?'否':case_detail.operation}}
+
+
+ 接触化学物:
+ {{case_detail.chemical_compound_status==1?'从不':case_detail.chemical_compound_status==2?'偶尔':case_detail.chemical_compound_status==3?'经常':case_detail.chemical_compound_status==4?'每天':'其他'}}
+
+
+ 详细描述:{{case_detail.chemical_compound_describe}}
- 其他信息
-
-
-
- 过敏史:
- 无/有(显示内容)
+
+
+ 处方信息
+
+
+
+ 诊断:
+ {{case_detail.order_prescription.icd_name}}
-
- 家族史:
- 无/有(显示内容)
+
+ 时间:
+ {{case_detail.order_prescription.doctor_created_time}}
-
- 是否备孕、妊娠或者哺乳期:
- 不是/是(显示内容)
+
+ 药品:
+
+ {{itemName.product_name}};
+
-
- 饮酒史:
- 从不、偶尔、经常、每天、已解酒
-
-
- 吸烟史:
- 从不、偶尔、经常、每天、已解酒
-
-
- 手术史:
- 无/有(手术名称)
-
-
- 接触化学物:
- 从不、偶尔、经常、每天
-
-
- 详细描述:如经常染发、接触油漆或者甲醛等
+
+ 用法:
+ {{case_detail.order_prescription.doctor_advice}}
+
+
\ No newline at end of file
diff --git a/Pages/yishi/case/index.wxss b/Pages/yishi/case/index.wxss
index 566f2a5..ebd1ea4 100644
--- a/Pages/yishi/case/index.wxss
+++ b/Pages/yishi/case/index.wxss
@@ -1,10 +1,12 @@
-.container{
- width: 100vw;
+page{
background-color: #F6F6F6;
+}
+.container{
+ /* width: 100vw; */
padding: 0 4vw;
}
.main_title{
- font-size: 30rpx;
+ font-size: 16px;
color: #000000;
margin: 30rpx 0;
}
@@ -28,26 +30,38 @@
color: #666666;
}
.info{
+
background: #FAFAFA;
border-radius: 10rpx;
+
+
display: flex;
flex-wrap: wrap;
- margin: 20rpx 0;
+ margin: 20rpx 0 0;
+ padding:10rpx 20rpx 20rpx;
}
.info_item{
- text-align: center;
- width: 180rpx;
- height: 60rpx;
+ text-align: left;
+ width: 33.3%;
+ margin-right: -1rpx;
+ /* height: 60rpx; */
+ margin-top: 10rpx;
+
display: flex;
align-items: center;
- margin-left: 20rpx;
+
+ align-items: flex-start;
}
+.info_item:nth-child(3n){
+ margin-right: 0rpx;
+}
.info_title{
- font-size: 30rpx;
+ font-size: 28rpx;
color: #333333;
}
.info_val{
font-size: 28rpx;
+ flex: 1;
color: #666666;
}
.disease_box{
@@ -57,6 +71,12 @@
margin-bottom: 30rpx;
display: flex;
}
+.data_box .disease_box_item:first-child{
+ margin-top: 20rpx;
+}
+.orther .disease_box_item:first-child{
+ margin-top: 0rpx;
+}
.title{
font-size: 30rpx;
color: #333333;
@@ -65,6 +85,8 @@
flex: 1;
font-size: 28rpx;
color: #666666;
+ word-wrap:break-word;
+ word-break:break-all;
}
.disease_info{
background: #FAFAFA;
@@ -75,9 +97,38 @@
margin-bottom: 20rpx;
}
.img_box{
-
+ display: flex;
+ flex-wrap: wrap;
+}
+.van-uploader__wrapper{
+ display: flex !important;
+}
+.van-uploader__preview{
+ padding: 20rpx 15rpx !important;
+ background-color: #E4E4E4 !important;
+ border-radius: 15rpx;
+ width: 150rpx;
+ display: flex;
+ justify-content: center;
}
.orther{
margin-bottom: 50rpx;
}
+.sugar{
+ display: flex;
+ align-items: center;
+ justify-content:space-between ;
+}
+.sugar .name{
+ color:#333;
+
+ font-size: 30rpx;
+}
+.sugar .date{
+ margin-top: 12rpx;
+ font-size: 24rpx;
+ font-weight: 400;
+ color: rgba(0,0,0,0.45);
+
+}
\ No newline at end of file
diff --git a/Pages/yishi/cash/index.js b/Pages/yishi/cash/index.js
index dcc5f22..5b366f9 100644
--- a/Pages/yishi/cash/index.js
+++ b/Pages/yishi/cash/index.js
@@ -1,4 +1,5 @@
import { API } from './../../../utils/network/api'
+import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
const api = new API()
const app = getApp()
@@ -10,31 +11,123 @@ Page({
},
height: app.globalData.height,
bank_card_id: "",
- bank_icon_path: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/bankcard/js_icon.png",
- realname: "默认姓名",
- bank_name : "招商银行",
- bank_card_code_mask: "2233 9988 9989 9900",
- withdrawal_amount: "987",
- income_tax: "12"
+ static_host: api.getStaticHost(),
+ bank_icon_path: api.getStaticHost()+"/applet/doctor/static/images/yishi/bankcard/js_icon.png",
+ bank_card_name: "默认姓名",
+ bank_name : "xx银行",
+ bank_card_code_mask: "888 xxxx xxxx 888",
+ withdrawal_amount: "xxxx",
+ amount_total:'',
+ income_tax: "xx",
+ contactKeFu: false,
+ sub_visible: false,
+ skeleton_loading: true,
+ order_inquiry_ids: [],
+ sub_btn_disabled: false
},
- onLoad(options){
-
-
- //获取提现数据
- api.getDoctorWithdrawal().then(response => {
- console.log(response);
- if(response.data.bank_card_id){
+ onLoad(option){
+ let order_inquiry_ids = option.order_inquiry_ids;
+ let params = {};
+ if(order_inquiry_ids){
+ params.order_inquiry_ids = order_inquiry_ids;
+ this.setData({
+ "navbarData.back_url": "/Pages/yishi/my/index",
+ "navbarData.back_url_type": 1,
+ })
+ }
+ this.postDoctorWithdrawalInfo(params);
+ },
+ onShow(){
+ this.setData({
+ sub_btn_disabled: false
+ })
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ app.go(url);
+ },
+ contactKeFu(e){
+ console.log("concatKeFu");
+ let tmplIds = ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+ this.setData({
+ contactKeFu: true
+ })
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
this.setData({
- bank_card_id: response.data.bank_card_id,
- bank_icon_path: response.data.bank_icon_path,
- bank_name : response.data.bank_name,
- bank_card_code_mask: response.data.bank_card_code_mask,
+ sub_visible: true,
+ })
+ }
+ })
+ },
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ console.log(res.authSetting)
+ }
+ })
+ },
+ postDoctorWithdrawalInfo(params){
+
+ //获取提现数据
+ api.postDoctorWithdrawalInfo(params).then(response => {
+ console.log(response);
+ if(response.data.bank.bank_card_id){
+ this.setData({
+ bank_card_id: response.data.bank.bank_card_id,
+ bank_icon_path: response.data.bank.bank_icon_path,
+ bank_name : response.data.bank.bank_name,
+ bank_card_code_mask: response.data.bank.bank_card_code_mask,
withdrawal_amount: response.data.withdrawal_amount,
+ amount_total:response.data.amount_total,
+ order_inquiry_ids: response.data.order_inquiry_ids,
+ bank_card_name: response.data.bank.bank_card_name_mask,
income_tax: response.data.income_tax,
+ skeleton_loading: false
})
}
}).catch(errors => {
console.error(errors);
+
+ })
+ },
+ postDoctorWithdrawal(){
+ this.setData({
+ sub_btn_disabled: true
+ })
+ let params = {};
+ params.order_inquiry_id = this.data.order_inquiry_ids.join(",");
+ params.withdrawal_amount_total = this.data.withdrawal_amount;
+ params.bank_card_id = this.data.bank_card_id;
+ //获取提现数据
+ api.postDoctorWithdrawal(params).then(response => {
+ console.log(response);
+ this.setData({
+ withdrawal_amount: 0,
+ income_tax: 0
+ })
+ wx.showToast({
+ title: '提现申请成功',
+ icon: "success"
+ })
+ }).catch(errors => {
+ console.error(errors);
+ this.setData({
+ sub_btn_disabled: false
+ })
})
}
})
\ No newline at end of file
diff --git a/Pages/yishi/cash/index.json b/Pages/yishi/cash/index.json
index c77fddd..de018e6 100644
--- a/Pages/yishi/cash/index.json
+++ b/Pages/yishi/cash/index.json
@@ -2,7 +2,11 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
- "t-image": "tdesign-miniprogram/image/image",
- "van-button": "@vant/weapp/button/index"
+ "van-image": "@vant/weapp/image/index",
+ "van-icon": "@vant/weapp/icon/index",
+ "van-button": "@vant/weapp/button/index",
+ "van-dialog": "@vant/weapp/dialog/index",
+ "t-skeleton": "tdesign-miniprogram/skeleton/skeleton",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/cash/index.wxml b/Pages/yishi/cash/index.wxml
index c920702..866db00 100644
--- a/Pages/yishi/cash/index.wxml
+++ b/Pages/yishi/cash/index.wxml
@@ -1,58 +1,102 @@
-
+
结算银行卡
- 提现规则
+ 提现规则
-
+
-
+
- {{realname}}{{bank_name}}
+ {{bank_card_name}}{{bank_name}}
{{bank_card_code_mask}}
+
+
+
-
+
- 提现金额(元)
+
- ¥{{withdrawal_amount}}
+ 账户余额:¥{{amount_total}}
- 扣除个人所得税: {{income_tax}}元
+ 扣除个人所得税:
+ {{income_tax}}元
+
-
-
+
-
- 提现记录 >
-
+
+ 实际到账(元)
+
+
+ ¥{{withdrawal_amount}}
+
+
+ 查看订单
+
+
+
+
+
+
+ 提现记录
+
+
+
+
+
-
+
- 提取
-
+ 提取
+
联系客服
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
diff --git a/Pages/yishi/cash/index.wxss b/Pages/yishi/cash/index.wxss
index cce587b..f02535e 100644
--- a/Pages/yishi/cash/index.wxss
+++ b/Pages/yishi/cash/index.wxss
@@ -1,12 +1,14 @@
-.container{
+page{
background-color: #F4F4F4;
+}
+.container{
+ margin-top: 20rpx;
width: 100vw;
- height: 100vh;
}
.top{
display: flex;
width: 92vw;
- margin: 30rpx auto;
+ margin: 0 auto 20rpx auto;
justify-content: space-between;
}
.txt_title{
@@ -16,6 +18,13 @@
font-size: 30rpx;
color: #333333;
}
+.bankcard_loading{
+ width: calc(92vw - 40rpx);
+ margin: 0 auto;
+ background-color: #fff;
+ border-radius: 20rpx;
+ padding: 20rpx 20rpx;
+}
.bankcard{
width: 92vw;
margin: 0 auto;
@@ -46,9 +55,18 @@
color: #333333;
margin-top: 10rpx;
}
+.cash_loading{
+ padding: 20rpx 20rpx;
+ width: calc(92vw - 40rpx);
+ margin: 20rpx auto;
+ background-color: #fff;
+ border-radius: 20rpx;
+ display: flex;
+ flex-direction: column;
+}
.cash{
width: 92vw;
- height: 300rpx;
+
margin: 20rpx auto;
background-color: #fff;
border-radius: 20rpx;
@@ -56,19 +74,26 @@
flex-direction: column;
}
.cash_top{
+ margin-top:30rpx;
display: flex;
flex: 3;
}
.cash_bottom{
+ padding:20rpx 20rpx 30rpx;
border-top: 1px solid #E5E5E5;
- flex: 1;
- color: #3CC7C0;
+
font-size: 32rpx;
display: flex;
- align-items: center;
- justify-content: flex-end;
+
+ flex-direction: column;
padding-right: 20rpx;
}
+.cash_bottom .title{
+ margin-top: 10rpx;
+ font-size: 30rpx;
+
+ color: #000000;
+}
.cash_left{
flex: 3;
display: flex;
@@ -85,10 +110,12 @@
flex: 2;
display: flex;
align-items: center;
- font-size: 64rpx;
+ font-size: 34rpx;
}
.shui{
flex: 1;
+ margin-top: 20rpx;
+ margin-bottom: 30rpx;
display: flex;
align-items: center;
font-size: 28rpx;
@@ -120,5 +147,46 @@
color: #3CC7C0;
margin: 30rpx;
}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
+.moneybox{
+ display: flex;
+}
+.moneybox{
+ display: flex;
+ margin-top: 20rpx;
+ align-items: center;
+ justify-content: space-between;
+}
+.money .mark{
+ font-size: 42rpx;
+font-weight: 400;
+color: #333333;
+}
+.moneyNum{
+ font-size: 64rpx;
+font-family: ArialMT;
+color: #333333;
+}
+.tixian{
+ display: flex;
+ margin:0 30rpx;
+ color: #3CC7C0;
+ font-size: 32rpx;
+ align-items: center;
+ justify-content: flex-end;
+}
\ No newline at end of file
diff --git a/Pages/yishi/cashrecord/index.js b/Pages/yishi/cashrecord/index.js
index d02f6ca..0133009 100644
--- a/Pages/yishi/cashrecord/index.js
+++ b/Pages/yishi/cashrecord/index.js
@@ -13,11 +13,35 @@ Page({
current_page: 0,
total: 0,
per_page: 0,
- last_page: 0
+ last_page: 0,
+ dateVisible: false,
+ select_date: '',
+ years: [],
+ static_host: api.getStaticHost()
},
onLoad(){
+ let now_year = (new Date()).Format("yyyy");
+ let begin_year = 2023;
+ let years = [];
+ for(let i=begin_year;i<=now_year;i++){
+ years.push({label: i+"年", value: i+""})
+ }
+ this.setData({
+ years: years,
+ select_date: now_year+""
+ })
+ },
+ onShow(){
+ let year = this.data.select_date;
+ year = Number(year);
+ this.getDoctorWithdrawalRecord(year);
+ },
+ getDoctorWithdrawalRecord(year){
+ this.setData({
+ record_list: []
+ })
//获取提现数据
- api.getDoctorWithdrawalRecord({year:'2023'}).then(response => {
+ api.getDoctorWithdrawalRecord({year: year}).then(response => {
console.log(response);
if(response.data.total > 0){
this.setData({
@@ -28,8 +52,30 @@ Page({
last_page: response.data.last_page,
})
}
- }).catch(errors => {
- console.error(errors);
+ }).catch(errors => { console.error(errors); })
+ },
+ onDatePicker() {
+ this.setData({ dateVisible: true });
+ },
+ onPickerChange(e) {
+ const { key } = e.currentTarget.dataset;
+ const { value } = e.detail;
+ console.log('picker change:', e.detail);
+ this.setData({
+ select_date: value
})
+ let year = this.data.select_date;
+ year = Number(year);
+ this.getDoctorWithdrawalRecord(year);
+ },
+ onColumnChange(e) {
+ const { key } = e.currentTarget.dataset;
+ const { value } = e.detail;
+ console.log('Column change:', e.detail);
+ },
+ onPickerCancel(e) {
+ const { key } = e.currentTarget.dataset;
+ const { value } = e.detail;
+ console.log('picker Cancel:', e.detail);
}
})
\ No newline at end of file
diff --git a/Pages/yishi/cashrecord/index.json b/Pages/yishi/cashrecord/index.json
index 0439bb9..69e4702 100644
--- a/Pages/yishi/cashrecord/index.json
+++ b/Pages/yishi/cashrecord/index.json
@@ -3,6 +3,9 @@
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"van-icon": "@vant/weapp/icon/index",
- "t-image": "tdesign-miniprogram/image/image"
+ "van-empty": "@vant/weapp/empty/index",
+ "van-image": "@vant/weapp/image/index",
+ "t-picker": "tdesign-miniprogram/picker/picker",
+ "t-picker-item": "tdesign-miniprogram/picker-item/picker-item"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/cashrecord/index.wxml b/Pages/yishi/cashrecord/index.wxml
index 5e3234d..dc40839 100644
--- a/Pages/yishi/cashrecord/index.wxml
+++ b/Pages/yishi/cashrecord/index.wxml
@@ -1,71 +1,55 @@
-
+
+
-
- 2022年
+
+ {{select_date}}年
-
-
-
+
- {{item.account_name}}(尾号{{item.bank_card_code_four}})
- {{item.examine_time}}
+
+
+
+
+ {{item.account_name}}(尾号{{item.bank_card_code_four}})
+
+
+
+ {{item.examine_status==1?'结算中':item.examine_status==2?'结算成功':item.examine_status==3?'结算失败':'未知'}}
+
+
- ¥{{item.applied_withdrawal_amount}}
-
-
- {{item.examine_status}}
-
+ {{moduleFilter.transforDay(item.created_at,"noyear")}}
+ 实际到账金额:¥{{item.actual_withdrawal_amount}}
+
个人所得税:¥{{item.income_tax}}
-
-
-
-
-
-
-
- 张三三(尾号9900)
- 12.09 13:23
-
-
- ¥123.00
-
- 结算成功
-
-
-
- 个人所得税:¥12.00
-
-
-
-
-
-
-
-
- 张三三(尾号9900)
- 12.09 13:23
-
-
- ¥123.00
-
- 结算中
-
-
-
- 个人所得税:¥12.00
-
-
+
+
+
+
+
+
+
diff --git a/Pages/yishi/cashrecord/index.wxss b/Pages/yishi/cashrecord/index.wxss
index 1bd1276..f7f7b1a 100644
--- a/Pages/yishi/cashrecord/index.wxss
+++ b/Pages/yishi/cashrecord/index.wxss
@@ -1,11 +1,12 @@
-.container{
+page{
background-color: #F4F4F4;
+}
+.container{
width: 100vw;
- height: 100vh;
}
.top{
width: 92vw;
- margin: 50rpx auto 0 auto;
+ margin: 20rpx auto 0 auto;
background-color: #3CC7C0;
height: 150rpx;
border-radius: 20rpx;
@@ -24,46 +25,57 @@
.data_item{
display: flex;
flex-direction: column;
- margin-bottom: 50rpx;
- height: 200rpx;
+ margin-bottom: 20rpx;
background-color: #ffffff;
border-radius: 20rpx;
- padding: 20rpx 0 0 0;
+ padding: 30rpx 0 0 0;
}
.data_item_top{
- flex: 2;
- display: flex;
+ margin:0 30rpx;
border-bottom: 1px solid #E7E7E7;
}
.data_item_top_icon{
- flex: 1;
+
text-align: center;
- height: 70%;
- align-self: start;
+
}
.data_item_top_content{
- flex: 3;
+
+ justify-content: space-between;
display: flex;
- flex-direction: column;
}
.name{
+ margin-left: 10rpx;
font-size: 32rpx;
color: #333333;
- flex: 1;
+
}
.date{
- flex: 1;
font-size: 28rpx;
+ display: flex;
+ margin-left: 28rpx;
color: #999999;
+ white-space: nowrap;
}
.data_item_top_num{
- flex: 2;
- display: flex;
- flex-direction: column;
justify-content: space-between;
+ display: flex;
+ align-items: center;
+ margin:0 30rpx 25rpx;
+
text-align: center;
}
+.jinename{
+ font-size: 30rpx;
+ font-weight: 400;
+ color: #666666;
+}
+.namebox{
+ display: flex;
+}
.jine{
+ display: flex;
+ align-items: center;
color: #FF0000;
font-size: 34rpx;
}
@@ -72,24 +84,39 @@
justify-content: center;
}
.status{
- border-radius: 10px;
- font-size: 24rpx;
- padding: 10rpx 40rpx;
+ width: 125rpx;
+ height: 50rpx;
+ background: #FFF2E8;
+ border-radius: 10rpx;
margin-bottom: 20rpx;
+ font-size: 24rpx;
+ font-weight: 400;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #FFFFFF;
}
-.status_ing{
- background-color: #FFF2E8;
+.status.paying{
+ background: #FFF2E8;
color: #FA541C;
}
-.status_end{
+.status.paysuccess{
+ background: #E2FFFE;
+ color: #3CC7C0;
+}
+.status.payfail{
background-color: #C5C5C5;
color: #FFFFFF;
}
.data_item_bottom{
- flex: 1;
+ padding:20rpx 30rpx 26rpx;
display: flex;
align-items: center;
justify-content: flex-end;
margin-right: 20rpx;
color: #666;
+ font-size: 28rpx;
+}
+.t-picker__confirm{
+ color: #3CC7C0 !important;
}
\ No newline at end of file
diff --git a/Pages/yishi/chat/index.js b/Pages/yishi/chat/index.js
index 37dc475..fa2efc9 100644
--- a/Pages/yishi/chat/index.js
+++ b/Pages/yishi/chat/index.js
@@ -1,63 +1,64 @@
-// index.js
-import TIM from '../../../TUIKit/lib/tim-wx-sdk';
-import { genTestUserSig } from '../../../TUIKit/debug/GenerateTestUserSig';
-import TIMUploadPlugin from '../../../TUIKit/lib/tim-upload-plugin';
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
data: {
- config: {
- userID: "xiaobeibei", //User ID
- SDKAPPID: 1400793692, // Your SDKAppID
- SECRETKEY: "44d97cf741fc758be98cdad100015582b6ad1dc5a3b6676c1997a57279eecfa9", // Your secretKey
- EXPIRETIME: 604800,
- },
- patient_account: "ayu",
- title: '患者姓名',
- height: app.globalData.height,
+ title: '',
+ height: app.globalData.height,
+ order_inquiry_id: "",
+ from:'',
+ baseInfo: {}
},
- onLoad() {
- console.log("chat onload");
- let sign = genTestUserSig(this.data.config);
- console.log("sign: ", sign);
- const userSig = sign.userSig;
- console.log("userSig: ", userSig);
- wx.$TUIKit = TIM.create({
- SDKAppID: this.data.config.SDKAPPID
- });
-
- wx.$chat_SDKAppID = this.data.config.SDKAPPID;
- wx.$chat_userID = this.data.config.userID;
- wx.$chat_userSig = userSig;
- wx.$TUIKitTIM = TIM;
- wx.$TUIKit.registerPlugin({ 'tim-upload-plugin': TIMUploadPlugin });
- wx.$TUIKit.login({
- userID: this.data.config.userID,
- userSig
- });
- wx.$TUIKit.setLogLevel(3);//设置日志级别
- wx.setStorage({
- key: 'currentUserID',
- data: [],
- });
- wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady,this);
+ onLoad(option) {
+ // console.log("chat onload", option);
+ let order_inquiry_id = option.order_inquiry_id;
+ let from=option.from;
+ this.setData({
+ order_inquiry_id: order_inquiry_id,
+ from:from?from:''
+ })
+ this.getInquiryMessageBasic();
},
onUnload() {
- console.log("chat onUnload");
- wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady,this);
+ // console.log("chat onUnload");
},
onShow(){
+ // console.log("chat onShow");
+ // console.log("app.globalData.scene from chat: ", app.globalData.scene);
+ },
+ $onMessageReceived(value) {
+ const message = value.data[0];
+ // console.log("message from chat: ",message)
+ },
+ initChat(){
let _this = this;
+ let count = 0;
let interval = setInterval(() => {
+ // console.log("chat init count: ", count);
+ // console.log("app.globalData.chat_sdk_ready: ", app.globalData.chat_sdk_ready);
if(app.globalData.chat_sdk_ready){
- _this.onSDKReady();
+ const TUIChat = _this.selectComponent('#TUIChat');
+ TUIChat.init();
+ // wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, _this.$onMessageReceived, _this);
clearInterval(interval);
}
- }, 100);
+ count = count + 1;
+ if(count > 5){//如果尝试5次不成功就去主动调用IM初始化
+ app.imInit();
+ count = 0;
+ }
+ }, 1000);
+ },
+ //获取问诊订单消息内页基础数据
+ getInquiryMessageBasic() {
+ // console.log("order_inquiry_id: ", this.data.order_inquiry_id);
+ api.getInquiryMessageBasic({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
+ // console.log(response);
+ this.setData({
+ baseInfo: response.data
+ })
+ }).then(res => {
+ this.initChat();
+ }).catch(errors => {console.error(errors);})
},
- onSDKReady() {
- console.error("chat js: onSDKReady")
- const TUIChat = this.selectComponent('#TUIChat');
- TUIChat.init();
- app.globalData.chat_sdk_ready = true
- }
})
diff --git a/Pages/yishi/chat/index.json b/Pages/yishi/chat/index.json
index cc86b23..adfc67f 100644
--- a/Pages/yishi/chat/index.json
+++ b/Pages/yishi/chat/index.json
@@ -2,5 +2,6 @@
"usingComponents": {
"TUIChat": "../../../TUIKit/components/TUIChat/index"
},
- "navigationStyle": "custom"
+ "navigationStyle": "custom",
+ "disableScroll":true
}
\ No newline at end of file
diff --git a/Pages/yishi/chat/index.wxml b/Pages/yishi/chat/index.wxml
index 43ee0d6..c7f201e 100644
--- a/Pages/yishi/chat/index.wxml
+++ b/Pages/yishi/chat/index.wxml
@@ -1,7 +1,5 @@
-
+
-
-
\ No newline at end of file
+
+
diff --git a/Pages/yishi/chat/index.wxss b/Pages/yishi/chat/index.wxss
index 7642336..c44f761 100644
--- a/Pages/yishi/chat/index.wxss
+++ b/Pages/yishi/chat/index.wxss
@@ -2,7 +2,4 @@
background-color: #F4F4F4;
width: 100vw;
height: 100vh;
-}
-.top{
-
}
\ No newline at end of file
diff --git a/Pages/yishi/chat_session/index.js b/Pages/yishi/chat_session/index.js
index 86de744..250c643 100644
--- a/Pages/yishi/chat_session/index.js
+++ b/Pages/yishi/chat_session/index.js
@@ -1,50 +1,24 @@
// index.js
-import TIM from '../../../TUIKit/lib/tim-wx-sdk';
-import { genTestUserSig } from '../../../TUIKit/debug/GenerateTestUserSig';
-import TIMUploadPlugin from '../../../TUIKit/lib/tim-upload-plugin';
const app = getApp()
Page({
data: {
- config: {
- userID: "xiaobeibei", //User ID
- SDKAPPID: 1400793692, // Your SDKAppID
- SECRETKEY: "44d97cf741fc758be98cdad100015582b6ad1dc5a3b6676c1997a57279eecfa9", // Your secretKey
- EXPIRETIME: 604800,
- },
title: '患者姓名',
height: app.globalData.height,
},
onLoad() {
- let sign = genTestUserSig(this.data.config);
- console.log("sign: ", sign);
- const userSig = sign.userSig;
- console.log("userSig: ", userSig);
- wx.$TUIKit = TIM.create({
- SDKAppID: this.data.config.SDKAPPID
- });
-
- wx.$chat_SDKAppID = this.data.config.SDKAPPID;
- wx.$chat_userID = this.data.config.userID;
- wx.$chat_userSig = userSig;
- wx.$TUIKitTIM = TIM;
- wx.$TUIKit.registerPlugin({ 'tim-upload-plugin': TIMUploadPlugin });
- wx.$TUIKit.login({
- userID: this.data.config.userID,
- userSig
- });
- wx.$TUIKit.setLogLevel(3);//设置日志级别
- wx.setStorage({
- key: 'currentUserID',
- data: [],
- });
- wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady,this);
+ console.log("onLoad chat_session")
},
onUnload() {
- wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady,this);
+
},
- onSDKReady() {
- console.warn("chat js: onSDKReady")
- const TUIKit = this.selectComponent('#TUIKit');
- TUIKit.init();
+ onShow(){
+ let _this = this;
+ let interval = setInterval(() => {
+ if(app.globalData.chat_sdk_ready){
+ const TUIKit = _this.selectComponent('#TUIKit');
+ TUIKit.init();
+ clearInterval(interval);
+ }
+ }, 100);
}
})
diff --git a/Pages/yishi/chufangsetup/index.js b/Pages/yishi/chufangsetup/index.js
index 9e70719..faec7f1 100644
--- a/Pages/yishi/chufangsetup/index.js
+++ b/Pages/yishi/chufangsetup/index.js
@@ -1,5 +1,4 @@
import { API } from './../../../utils/network/api'
-
const api = new API()
const app = getApp()
Page({
@@ -15,6 +14,7 @@ Page({
},
prescription_status: 0,
chufang_list_0: [],
+ chufang_list_1: [],
chufang_list_2: [],
current_page: 0,
total: 0,
@@ -22,13 +22,23 @@ Page({
last_page: 0,
},
+ onLoad(options){
+ console.log(options.status)
+ if(options.status){
+ this.setData({
+ pharmacist_audit_status:options.status,
+ prescription_status:options.status
+ })
+ }
+ },
onShow(){
+
this.getList();
},
onTabsChange(e) {
- console.log(e);
+ // console.log(e);
let list_name = "chufang_list_" + e.detail.value;
- console.log(list_name)
+ //console.log(list_name)
this.setData({
prescription_status: e.detail.value,
current_page: 0,
@@ -61,13 +71,13 @@ Page({
getList(){
//获取处方列表
let params = {};
- params.prescription_status = this.data.prescription_status;//处方审核状态(0:审核中 2:审核驳回)
+ params.pharmacist_audit_status = this.data.prescription_status;//处方审核状态(0:审核中 2:审核驳回)
params.page = this.data.current_page + 1;
api.getDoctorPrescription(params).then(response => {
- console.log(response);
+ //console.log(response);
if(response.data.total > 0){
let list_name = "chufang_list_" + this.data.prescription_status;
- console.log(list_name);
+ //console.log(list_name);
let apprise_list = this.data[list_name];
this.setData({
[list_name]: apprise_list.concat(response.data.data),
@@ -78,5 +88,31 @@ Page({
})
}
}).catch(errors => {console.error(errors);})
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ //console.log(url);
+ app.go(url);
+ },
+ handlegetLastInquiry(patient_id,doctor_id,order_inquiry_id){
+ api.getLastInquiry({
+ patient_id:patient_id,
+ doctor_id:doctor_id
+ }).then(data=>{
+ let result=data.data;
+ let url='';
+ if(result){
+ url = "/Pages/yishi/chat/index?order_inquiry_id="+result+"&from=prescription";
+ }else{
+ url = "/Pages/yishi/chat/index?order_inquiry_id="+order_inquiry_id+"&from=prescription";
+
+ }
+ app.go(url);
+ })
+ },
+ gochat(e){
+ let {order_inquiry_id,patient_id,doctor_id} = e.currentTarget.dataset;
+ this.handlegetLastInquiry(patient_id,doctor_id,order_inquiry_id);
+
}
})
\ No newline at end of file
diff --git a/Pages/yishi/chufangsetup/index.json b/Pages/yishi/chufangsetup/index.json
index 3bfe750..203ffc8 100644
--- a/Pages/yishi/chufangsetup/index.json
+++ b/Pages/yishi/chufangsetup/index.json
@@ -3,6 +3,7 @@
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"t-tabs": "tdesign-miniprogram/tabs/tabs",
- "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel"
+ "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
+ "van-empty": "@vant/weapp/empty/index"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/chufangsetup/index.wxml b/Pages/yishi/chufangsetup/index.wxml
index ff2804c..33ec2bf 100644
--- a/Pages/yishi/chufangsetup/index.wxml
+++ b/Pages/yishi/chufangsetup/index.wxml
@@ -1,23 +1,24 @@
-
+
-
+
+
+
{{item.patient_name}}
{{item.patient_sex==1?'男':'女'}} | {{item.patient_age}}岁
+
@@ -35,9 +36,9 @@
病情描述:
{{item.disease_desc}}
-
+
确诊日期:
- {{item.diagnosis_date}}
+ {{item.diagnosis_date}}
病情诊断:
@@ -47,26 +48,28 @@
-
- 问诊记录
+
+ 问诊记录
+
-
-
-
-
-
-
+
+
+
+
+
+
{{item.patient_name}}
{{item.patient_sex==1?'男':'女'}} | {{item.patient_age}}岁
+
-
+
{{item.pharmacist_audit_status==0?'审核中':item.pharmacist_audit_status==1?'审核成功':'审核驳回'}}
@@ -81,7 +84,55 @@
病情描述:
{{item.disease_desc}}
+
+ 确诊日期:
+ {{item.diagnosis_date}}
+
+ 病情诊断:
+
+ {{icd.icd_name}};
+
+
+
+
+
+ 问诊记录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.patient_name}}
+ {{item.patient_sex==1?'男':'女'}} | {{item.patient_age}}岁
+
+
+
+
+ {{item.pharmacist_audit_status==0?'审核中':item.pharmacist_audit_status==1?'审核成功':'驳回'}}
+
+
+
+
+
+
+ 开方时间:
+ {{item.created_at}}
+
+
+ 病情描述:
+ {{item.disease_desc}}
+
+
确诊日期:
{{item.diagnosis_date}}
@@ -91,63 +142,20 @@
驳回原因:
- {{item.platform_fail_reason}}
+ {{item.pharmacist_fail_reason}}
- 问诊记录
-
-
+ 问诊记录
+
重开处方
-
-
-
-
-
-
-
-
- 张三三4
- 男 | 30岁
-
- 驳回
-
-
-
-
-
- 病情诊断:
- 4年
-
-
- 病情诊断:
- 头疼,腰疼、肩膀酸、等症状已经困
-
-
- 病情诊断:
- 新冠病毒
-
-
- 处方时间:
- 2022年12月23日 12:45
-
-
- 驳回原因:
- 图片不清晰
-
-
-
-
- 问诊记录
-
-
- 重开处方
-
+
+
diff --git a/Pages/yishi/chufangsetup/index.wxss b/Pages/yishi/chufangsetup/index.wxss
index 1713f28..4038cff 100644
--- a/Pages/yishi/chufangsetup/index.wxss
+++ b/Pages/yishi/chufangsetup/index.wxss
@@ -1,7 +1,8 @@
+page{
+ background-color: #F6F6F6;
+}
.container{
width: 100vw;
- height: 100vh;
- background-color: #F6F6F6;
}
.t-tabs__content{
background-color: #F6F6F6;
@@ -22,10 +23,14 @@
background-color: #fff;
margin: 20rpx 0;
}
+.namebox{
+ display: flex;
+}
.item_top{
position: relative;
height: 100rpx;
display: flex;
+ justify-content:space-between;
align-items: center;
padding: 0 32rpx;
}
@@ -41,17 +46,17 @@
transform: scaleY(0.5);
}
.item_top_name{
- flex: 1;
+
color: #3CC7C0;
font-size: 34rpx;
}
.item_top_sex{
- flex: 3;
+ margin-left: 30rpx;
font-size: 34rpx;
color: #666;
}
.item_top_status_box{
- flex: 1;
+
}
.item_top_status{
padding: 10rpx;
@@ -78,6 +83,7 @@
.item_content_li_txt{
margin-left: 10rpx;
flex: 1;
+ word-break: break-all;
color: #666666;
font-size: 28rpx;
}
diff --git a/Pages/yishi/identity/index.js b/Pages/yishi/identity/index.js
index 52443e9..f470d13 100644
--- a/Pages/yishi/identity/index.js
+++ b/Pages/yishi/identity/index.js
@@ -1,5 +1,4 @@
// Pages/yishi/identity/index.js
-import Toast from '@vant/weapp/toast/toast';
import { API } from './../../../utils/network/api'
import { FileUtil } from './../../../utils/fileutil'
@@ -11,89 +10,64 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '医师身份认证', //导航栏 中间的标题
},
+ navHeight: 0,
+ stateHeight: 0,
height: app.globalData.height,
//选项卡
stickyProps: {
- zIndex: 2,
+ zIndex: 9,
+ offsetTop: (app.globalData.height * 2)
},
- realname:"",
- idcard:"",
- avatar: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/default_photo.png",
- is_avatar: false,
- city_show: false,
- keshi_show: false,
- yiyuan_show: false,
- zhuanchang_show: false,
- zhiye_show: false,
- zige_show: false,
- zhicheng_show: false,
- zhicheng_img_show: false,
- next_btn_txt: "下一步",
+ selected_tab: 0,
+ panel_2_disabled: true,
next_btn_disabled: false,
- office_phone: "",
- keshi_note: "请选择科室",
- keshi_columns: [],
- select_keshi_id: "",
- select_keshi_index: "",
- custom_keshi: "",
- zhicheng_note: "请选择职称",
- zhicheng_columns: [
- {
- text: "执业医师",
- value: 1
- },
- {
- text: "主治医师",
- value: 2
- },
- {
- text: "副主任医师",
- value: 3
- },
- {
- text: "主任医师",
- value: 4
- }
- ],
- select_zhicheng_id: "",
- select_zhicheng_index: "",
- select_yiyuan_index: "",
- yiyuan_columns: [],
- zhuanchang_columns: [],
- zhuanchang_selected_columns: [],
- select_province_id: "",
- select_city_id: "",
- select_county_id: "",
- city_note: "请选择城市",
- yiyuan_note: "请选择医院",
- select_yiyuan_id: "",
- area_sub_titles: ["省份","市区","区县"],
- areaList: [],
- textarea_jianjie: "",
- textarea_shanchang: "",
- zhiye_file_list:[],
- zige_file_list:[],
- zhicheng_file_list:[],
- doctorauthiden_data_ready: false,
- basicdepartment_data_ready: false,
- areaprovince_data_ready: false,
- iden_auth_status: 0,
- iden_auth_disabled: 0,
- iden_auth_status_txt: "未认证",
+ next_btn_txt: "下一步",
+ realname: "",
+ idcard: "",
+ page_meta_show: false
},
- onLoad(){
+ getMenuButtonBound() {
+ let stateHeight = 0; // 接收状态栏高度
+ const navHeight = wx.getMenuButtonBoundingClientRect().height; // 获取胶囊高度
+ let top = 0;
+ wx.getSystemInfo({
+ success(res) {
+ stateHeight = res.statusBarHeight;
+ },
+ });
+ top = wx.getMenuButtonBoundingClientRect().top - stateHeight; // 获取top值
+ console.log('navHeight', navHeight);
+ console.log('top', top);
+ this.setData({
+ // navHeight: navHeight + top * 2, // 导航栏高度
+ navHeight, // 导航栏高度
+ stateHeight: stateHeight + top, // 状态栏高度
+ });
+ this.setData({
+ "stickyProps.offsetTop": this.data.stateHeight + this.data.navHeight + 10
+ })
+ },
+ onLoad(options){
+ let selected_tab = options.selected_tab;
+ if(selected_tab){
+ this.setData({
+ selected_tab: selected_tab
+ })
+ }
let _this = this;
//获取实名认证信息
api.getDoctorAuthReal().then(response => {
console.log(response);
- if(response.data){
- this.setData({
- realname:response.data.card_name,
- idcard:response.data.card_num,
- next_btn_txt: "已认证,不可修改",
- next_btn_disabled: true,
- });
+ if(response.data.length == 0){
+ return;
}
+ this.setData({
+ realname:response.data.card_name_mask,
+ idcard:response.data.card_num_mask,
+ next_btn_txt: "已认证,不可修改",
+ next_btn_disabled: true,
+ panel_2_disabled: false,
+ });
}).catch(errors => {
console.error(errors);
})
@@ -293,7 +267,7 @@ Page({
},
onShow(){
console.log("onshow()....");
-
+ this.getMenuButtonBound();
},
doUploadFile(event) {
console.log("index douploadFIle: ", event);
@@ -371,12 +345,14 @@ Page({
},
//新增实名认证信息
postDoctorAuthReal(){
- const realname = this.data.realname.trim();
+
+ let _this = this;
+ let realname = this.data.realname.trim();
const idcard = this.data.idcard.trim();
console.log("realname: ",realname);
console.log("idcard: ", idcard);
-
+ realname = realname.replace(/•/g,"·");
var realname_reg= /^(([a-zA-Z+\.?\·?a-zA-Z+]{2,30}$)|([\u4e00-\u9fa5+\·?\u4e00-\u9fa5+]{2,30}$))/;
var idcard_reg=/^(^[1-9]\d{5}[1-9]\d{3}(((0[2])([0|1|2][0-8])|(([0-1][1|4|6|9])([0|1|2][0-9]|[3][0]))|(((0[1|3|5|7|8])|(1[0|2]))(([0|1|2]\d)|3[0-1]))))((\d{4})|\d{3}[Xx])$)$/;
@@ -397,19 +373,35 @@ Page({
wx.showToast({title: '身份证输入有误', icon:'error'})
return false;
}
-
+
var params = {
card_name: realname,
card_num: idcard,
}
api.postDoctorAuthReal(params).then(response => {
console.log(response);
+ wx.showToast({
+ title: '认证成功',
+ icon: 'none',
+ duration: 2000
+ })
+ _this.setData({
+ panel_2_disabled: false,
+ selected_tab: 1,
+ next_btn_disabled: true,
+ next_btn_txt: '已认证,不可修改'
+ })
}).catch(errors => {
console.error(errors);
})
+
},
onTabsChange(event) {
console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
+ this.setData({
+ selected_tab: event.detail.value
+ })
+
},
onTabsClick(event) {
console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
@@ -738,4 +730,16 @@ Page({
// }).catch(errors => {console.error(errors);})
// }
+ showPageMeta(){
+ console.log("showPageMeta from indenity");
+ this.setData({
+ page_meta_show: true
+ })
+ },
+ hidePageMeta(){
+ console.log("hidePageMeta from indenity");
+ this.setData({
+ page_meta_show: false
+ })
+ }
})
\ No newline at end of file
diff --git a/Pages/yishi/identity/index.wxml b/Pages/yishi/identity/index.wxml
index f1597b7..880bb2b 100644
--- a/Pages/yishi/identity/index.wxml
+++ b/Pages/yishi/identity/index.wxml
@@ -1,10 +1,13 @@
+
+
-
+
-
+
+ type="text"
+ size="large"
+ custom-style="font-size:16px;"
+ disabled="{{next_btn_disabled}}"
+ >
+ 真实姓名 *
+
+ size="large"
+ custom-style="font-size:16px;"
+ disabled="{{next_btn_disabled}}"
+ >
+ 身份证号 *
+
- 说明:因互联网医院实行实名制要求,需要您的身份信息,包括姓名,身份证号码。如您不能提供上述信息,将无法完成医师身份认证。
+ 说明:因互联网医院诊疗实名制法规要求,为顺利完成医师身份认证,请您如实提供姓名及身份证等身份信息
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Pages/yishi/identity/index.wxss b/Pages/yishi/identity/index.wxss
index 1569fc4..add0acc 100644
--- a/Pages/yishi/identity/index.wxss
+++ b/Pages/yishi/identity/index.wxss
@@ -1,27 +1,7 @@
.required{
color: #e34d59;
}
-.photo{
- position: relative;
- padding: 32rpx;
- display: flex;
- justify-content: space-between;
- font-size: 32rpx;
- font-weight: 400;
- align-items: center;
-}
-.photo::after {
- position: absolute;
- box-sizing: border-box;
- content: ' ';
- pointer-events: none;
- right: 0;
- left: 32rpx;
- bottom: 0;
- border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
- transform: scaleY(0.5);
- left: 32rpx;
-}
+
.title{
font-size: 30rpx;
color: #1C2023;
@@ -81,14 +61,17 @@
color: #49B9AD !important;
}
.t-tabs__track{
- background-color: var(--td-tab-track-color, var(--td-primary-color, #49B9AD)) !important;
+ background-color: #49B9AD !important;
+}
+.t-icon-check{
+ color: #49B9AD !important;
}
.t-cell__note {
font-size: 25rpx !important;
letter-spacing: 2rpx;
}
.t-cell__title-text{
- font-size: 30rpx !important;
+ font-size: 16px !important;
}
.t-input__wrap--suffix-icon{
padding-left: var(--td-spacer-1, 8rpx) !important;
@@ -105,34 +88,20 @@
}
.bottom_next{
width: 95vw;
- margin: 530rpx auto;
+ margin: 530rpx auto 0 auto;
}
.sub_button{
width: 95vw;
margin: 0 auto 30rpx auto;
}
-.zhiye_popup{
- display: flex;
- flex-direction: column;
- align-items: center;
- height: 600rpx;
-}
+
.zhiye_popup_title{
margin-top: 16px;
font-size: 32rpx;
font-weight: 600;
letter-spacing: 5rpx;
}
-.zhiye_popup_img{
- margin-top: 30rpx;
- width: 300rpx;
- height: 300rpx;
- background-color: cadetblue;
-}
-/* 自定义 vant required 小红点位置 */
-.van-cell--required::before {
- left: 4.7rem !important;
-}
+
.zhuanchang_box{
display: flex;
flex-wrap: wrap;
@@ -152,7 +121,6 @@
}
.zhuanchang_block {
width: 100vw;
- height: 240px;
background: #fff;
border-top-left-radius: 16rpx;
border-top-right-radius: 16rpx;
@@ -187,4 +155,60 @@
.zhuanchang_btn--confirm {
color: #3cc7c0;
+}
+
+/* 自定义医院搜索框样式 */
+.van-search__field .van-cell{
+ padding: 10rpx !important;
+}
+.van-picker__columns {
+ height: 264px !important;
+ top: 40px !important;
+}
+.van-search {
+ top: -270px !important;
+ position: relative !important;
+}
+
+.van-picker__confirm{
+ color: #3cc7c0 !important;
+}
+.van-cell:after {
+ border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
+ bottom: 0;
+ box-sizing: border-box;
+ content: " ";
+ pointer-events: none;
+ position: absolute;
+ width: calc(100vw - 32rpx);
+ transform: scaleY(.5);
+ transform-origin: center;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-bottom-color: var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
+}
+.t-cell__note,.t-class-note,.note{
+ font-size: 30rpx !important;
+}
+.van-cell {
+ padding: 32rpx !important;
+}
+.van-picker__cancel{
+ font-size: 32rpx !important;
+}
+.van-picker__confirm{
+ color: #3cc7c0 !important;
+ font-size: 32rpx !important;
+}
+.van-picker__title {
+ font-size: 34rpx !important;
+}
+.van-empty{
+ position: absolute;
+ width: 100%;
+ left: 50%;
+ top: 180rpx;
+ transform: translateX(-50%);
+ z-index: 9999999;
+ background: rgb(255, 255, 255);
}
\ No newline at end of file
diff --git a/Pages/yishi/index/index.js b/Pages/yishi/index/index.js
index 8c40bef..b81ea3e 100644
--- a/Pages/yishi/index/index.js
+++ b/Pages/yishi/index/index.js
@@ -1,5 +1,8 @@
// Pages/yishi/index/index.js
import { API } from './../../../utils/network/api'
+import { pxTorpx } from './../../../utils/util'
+import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
+
const api = new API()
const app = getApp()
Page({
@@ -7,34 +10,34 @@ Page({
title: "肝胆相照互联网医院",
navHeight: 0,
stateHeight: 0,
+ doctor_inquiry_config:null,
info:{
- user_name: "手机号后四位",
- not_accepted_inquiry_num: 6,
- accepting_inquiry_num: 12,
+ user_name: "医师姓名",
+ not_accepted_inquiry_num: 0,
+ accepting_inquiry_num: 0,
info_shiming_status_txt: "未认证",
info_shiming_status: "info_shiming_status_no",
show_info_note: false,
- praise_rate: "99%",
- avg_response_time: 125,
- number_of_fans: 9254,
- avatar: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/default_photo.png",
+ praise_rate: "100%",
+ avg_response_time: 0,
+ number_of_fans: 0,
+ avatar: api.getStaticHost()+"/applet/doctor/static/images/default_photo.png",
reject_prescription_number: false,//处方管理小红点
},
+ static_host: api.getStaticHost(),
iden_auth_status_txt: "未认证",
multi_point_status_txt: "未认证",
+ shiming_status_url: "",
iden_auth_status_url: "/Pages/yishi/identity/index",
multi_point_status_url: "/Pages/yishi/zhiye_identity/index",
- current: 0,
- autoplay: true,
duration: 500,
interval: 5000,
- swiperList: [
- `https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/ad1.jpg`,
- `https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/ad2.jpg`,
- `https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/ad3.jpg`,
- ],
+ swiperList: [],
+ banner: [],
+ default_dialog_show: false,//只弹框一次
dialog_visible: false,
- dialog_content: "请您先实名认证",
+ dialog_content: "请您先完成实名认证",
+ dialog_url: "",
/*
case_module取值
新问诊 0
@@ -59,27 +62,32 @@ Page({
{
case_status: 0,
case_module: [0,1,2,3,4,5,6,7,8],
- case_text: "未实名认证"
+ case_text: "请您先完成实名认证",
+ case_url: "/Pages/yishi/identity/index"
},
{
case_status: 1,
case_module: [0,1,2,3,4,5,6,7,8],
- case_text: "未医师身份认证"
+ case_text: "请您先医师身份认证",
+ case_url: "/Pages/yishi/identity/index?selected_tab=1"
},
{
case_status: 2,
- case_module: [0,1,4,5,6],
- case_text: "未绑定结算银行卡"
+ case_module: [0,1,2,3,4,5,6,7,8],
+ case_text: "请您先绑定结算银行卡",
+ case_url: "/Pages/yishi/bankcard/index"
},
{
case_status: 3,
- case_module: [0,1,5,6,7],
- case_text: "请您先设置在线问诊价格"
+ case_module: [7],
+ case_text: "请您先进行多点执业认证",
+ case_url: "/Pages/yishi/zhiye_identity/index"
},
{
case_status: 4,
case_module: [7],
- case_text: "请您先进行多点执业认证证"
+ case_text: "请您先进行多点执业认证",
+ case_url: "/Pages/yishi/zhiye_identity/index"
},
{
case_status: 5,
@@ -87,31 +95,153 @@ Page({
case_text: "已全部通过"
},
],
- skeleton_loading: true
+ contactKeFu: false,
+ sub_visible: false,
+ jiesuan_dialog_show: false,
+ jiesuan_dialog_visible: false,
+ funbox_height: 100,
+ skeleton_loading: true,
+ confirmBtn: {
+ "openType": "contact",
+ "content": "确认",
+ },
+ overlay_show: false
},
// 获取状态栏信息
getMenuButtonBound() {
+
let stateHeight = 0; // 接收状态栏高度
const navHeight = wx.getMenuButtonBoundingClientRect().height; // 获取胶囊高度
let top = 0;
- wx.getSystemInfo({
- success(res) {
- stateHeight = res.statusBarHeight;
- },
- });
+
top = wx.getMenuButtonBoundingClientRect().top - stateHeight; // 获取top值
- console.log('navHeight', navHeight);
- console.log('top', top);
+ // console.log('navHeight', navHeight);
+ // console.log('top', top);
+
this.setData({
// navHeight: navHeight + top * 2, // 导航栏高度
navHeight, // 导航栏高度
stateHeight: stateHeight + top, // 状态栏高度
});
},
+ getFunboxHeight(){
+ // console.log("109: ", rpxTopx(109))
+ // console.log("113: ", rpxTopx(113))
+ const { statusBarHeight } = wx.getSystemInfoSync();
+ // console.log("statusBarHeight: ", rpxTopx(statusBarHeight));
+ let funbox_height = wx.getSystemInfoSync().windowHeight - (this.data.stateHeight + this.data.navHeight + 10) - 55;//减去底部空白
+ funbox_height = pxTorpx(funbox_height);
+ // 147 userinfo的高度
+ // 80 info_note
+ // 155 认证部分的高度
+ // 168 广告部分的高度
+ // 40 自定义适配
+ funbox_height = funbox_height - 147 - 20 - 30 - 20 - 155 - 30 - 168 - 20 - 30 - 30 - 30 - 30 - 40;
+ // 50 info_note
+ if(this.data.info.show_info_note){
+ funbox_height = funbox_height - 50;
+ }
+ funbox_height = funbox_height / 3;
+ if(funbox_height > 150) funbox_height = 150
+ this.setData({
+ funbox_height: funbox_height
+ })
+ },
+ confirmJieSuanDialog(){
+ this.setData({
+ jiesuan_dialog_visible: false,
+ })
+ const overlay_show = wx.getStorageSync('overlay_show')
+ if(!overlay_show){
+ this.setData({
+ overlay_show: true
+ })
+ wx.setStorageSync('overlay_show', "1")
+ }
+ app.go("/Pages/yishi/manual_detail/index?manual_id=1")
+ },
+ cancelJieSuanDialog(){
+ this.setData({
+ jiesuan_dialog_visible: false,
+ })
+ const overlay_show = wx.getStorageSync('overlay_show')
+ if(!overlay_show){
+ this.setData({
+ overlay_show: true
+ })
+ wx.setStorageSync('overlay_show', "1")
+ }
+ },
+ confirmContactDialog(){
+ this.setData({
+ contactKeFu: false
+ })
+ },
+ cancelContactDialog(){
+ // console.log("cancelContactDialogcancelContactDialogcancelContactDialog");
+ this.setData({
+ contactKeFu: false
+ })
+ },
+ onPullDownRefresh(){
+ // console.log("用户下拉动作")
+ this.onShow();
+ },
onLoad(){
+
+ },
+ onUnload(){
+ // console.log("index onUnload() onUnload() ");
+ this.setData({
+ swiperList: []
+ })
+ },
+ onHide(){
+ // console.log("index onHide() onHide() ");
+
+ // wx.offCopyUrl(this.Copylistener) // 需传入与监听时同一个的函数对象
+
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().stopInterval()
+ }
+
+ this.setData({
+ contactKeFu: false
+ })
+ },
+ Copylistener(res){
+ setTimeout(()=>{
+ wx.setClipboardData({
+ data: '暂不支持分享',
+ success (res) {
+
+ },
+ complete(){
+ wx.hideToast()
+ }
+ })
+ },1000)
+ return
+ },
+ onShow: function () {
+
+ //初始化默认值
+ this.setData({
+ skeleton_loading: true,
+ });
+
+ // wx.onCopyUrl(this.Copylistener);
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().setData({
+ active: 0, //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
+ })
+ this.getTabBar().startInterval()
+ }
+ this.getMenuButtonBound();
+
api.yiShiIndex().then(response => {
- console.log(response);
+ // console.log(response);
let avatar = response.data.info.avatar;
this.setData({
"info.user_name": response.data.info.user_name,
@@ -120,13 +250,13 @@ Page({
"info.praise_rate": response.data.info.praise_rate,
"info.avg_response_time": response.data.info.avg_response_time,
"info.number_of_fans": response.data.info.number_of_fans,
+ doctor_inquiry_config:response.data.doctor_inquiry_config
})
- if(avatar && (avatar.indexOf("http") == -1)){
- avatar = api.getStaticHost() + avatar;
+ if(avatar){
+ this.setData({
+ "info.avatar": avatar
+ })
}
- this.setData({
- "info.avatar": avatar
- })
//实名认证
let idcard_status = response.data.info.idcard_status;
@@ -136,26 +266,32 @@ Page({
let multi_point_status = response.data.info.multi_point_status;
//绑定结算银行卡
let is_bind_bank = response.data.info.is_bind_bank;
- //是否参加专家图文接诊(0:否 1:是)
- let is_img_expert_reception = response.data.info.is_img_expert_reception;
+ // //是否参加专家图文接诊(0:否 1:是)
+ // let is_img_expert_reception = response.data.info.is_img_expert_reception;
+ // //是否参加专家快速接诊(0:否 1:是)
+ // let is_img_quick_reception = response.data.info.is_img_quick_reception;
+ // //是否参加专家公益接诊(0:否 1:是)
+ // let is_img_welfare_reception = response.data.info.is_img_welfare_reception;
this.setData({
"info.idcard_status": idcard_status,
"info.iden_auth_status": iden_auth_status,
"info.multi_point_status": multi_point_status,
"info.is_bind_bank": is_bind_bank,
- "info.is_img_expert_reception": is_img_expert_reception,
+ // "info.is_img_expert_reception": is_img_expert_reception,
+ // "info.is_img_quick_reception": is_img_quick_reception,
+ // "info.is_img_welfare_reception": is_img_welfare_reception,
});
//iden_auth_status 0:未认证 1:认证通过 2:审核中 3:认证失败
if(iden_auth_status == 0) this.setData({iden_auth_status_txt: "未认证"});
- if(iden_auth_status == 1) this.setData({iden_auth_status_txt: "认证通过", iden_auth_status_url: "/Pages/yishi/attestation/index"});
+ if(iden_auth_status == 1) this.setData({iden_auth_status_txt: "已认证", iden_auth_status_url: "/Pages/yishi/attestation/index"});
if(iden_auth_status == 2) this.setData({iden_auth_status_txt: "审核中"});
if(iden_auth_status == 3) this.setData({iden_auth_status_txt: "认证失败"});
//multi_point_status 0:未认证 1:认证通过 2:审核中 3:认证失败
if(multi_point_status == 0) this.setData({multi_point_status_txt: "未认证"});
- if(multi_point_status == 1) this.setData({multi_point_status_txt: "认证通过", multi_point_status_url: "/Pages/yishi/practicing/index"});
+ if(multi_point_status == 1) this.setData({multi_point_status_txt: "已认证", multi_point_status_url: "/Pages/yishi/practicing/index"});
if(multi_point_status == 2) this.setData({multi_point_status_txt: "审核中"});
if(multi_point_status == 3) this.setData({multi_point_status_txt: "认证失败"});
@@ -169,92 +305,98 @@ Page({
if(reject_prescription_number){
this.setData({"info.reject_prescription_number": reject_prescription_number});
}
-
+ //格式化广告轮播
+ this.formatAD(response.data.banner);
this.checkStatus();
this.setData({
skeleton_loading: false
})
+ }).then(res => {
+ wx.stopPullDownRefresh()
+ }).then(res =>{
+ this.getFunboxHeight();
}).catch(errors => {
console.error(errors);
})
},
-
- onShow: function () {
- if (typeof this.getTabBar === 'function' && this.getTabBar()) {
- this.getTabBar().setData({
- currentTab: 0 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
- })
+ formatAD(banner){
+ let swiperList = [];
+ banner.forEach(item => {
+ swiperList.push(item.banner_path);
+ })
+ this.setData({
+ banner: banner,
+ swiperList: swiperList
+ })
+ },
+ onTapAD(e) {
+ let item = e.currentTarget.dataset.item;
+ // console.log(item);
+ let open_with = item.open_with;
+ let banner_link = item.banner_link;
+ if(open_with == 1){//小程序页面
+ app.go(banner_link);
+ }else if(open_with == 2){//webview 页面
+ app.go("/Pages/webpage/index?src="+banner_link);
}
- this.getMenuButtonBound();
},
-
- onADChange(){
- // console.log("onADChange");
+ onChangeAD(e) {
+ // const { current, source } = e.detail;
+ // console.log(current, source);
},
-
go(e){
- //实名认证
- let idcard_status = this.data.info.idcard_status;
- //医师身份认证
- let iden_auth_status = this.data.info.iden_auth_status;
- //多点执业认证
- let multi_point_status = this.data.info.multi_point_status;
- //绑定结算银行卡
- let is_bind_bank = this.data.info.is_bind_bank;
- //是否参加专家图文接诊(0:否 1:是)
- let is_img_expert_reception = this.data.info.is_img_expert_reception;
- let status = 0;
-
- // 未实名认证和医师身份认证 0
- // 已实名认证,未医师身份认证 1
- // 已实名认证和医师身份认证,未绑定结算银行卡 2
- // 已实名认证和医生身份认证,已绑定结算银行卡 没开通了在线问诊3
- // 已实名认证和医师身份认证且绑定结算银行卡,开通了在线问诊,未开通多点执业认证 4
- // 已实名认证和医师身份认证且绑定结算银行卡,开通了在线问诊,已开通多点执业认证 5
- if(idcard_status == 0 && iden_auth_status == 0){
- status = 0;
- }else if(idcard_status == 1 && iden_auth_status == 0){
- status = 1;
- }else if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 0){
- status = 2;
- }else if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && is_img_expert_reception == 0){
- status = 3;
- }else if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && is_img_expert_reception == 1 && multi_point_status == 0){
- status = 4;
- }else{
- status = 5;
- }
-
- let now_case = this.data.mycase.find(item => {
- return item.case_status == status;
- });
-
- console.log("now_case: ", now_case);
- //所属模块
- let moudle = e.currentTarget.dataset.moudle;
- console.log("moudle: ", moudle);
- if(now_case){
- let now_moudle = now_case.case_module.find(item => {
- return item == moudle;
- })
- console.log("now_moudle: ", now_moudle);
- if(now_moudle != undefined){
- this.setData({
- dialog_content: now_case.case_text,
- dialog_visible: true
- });
- return;
+ let checkDialog = this.checkDialog(e);
+ // console.log("checkDialog: ", checkDialog);
+ if(checkDialog){
+ let url = e.currentTarget.dataset.url;
+ // console.log(url);
+ if(url.indexOf("wenzhen") > -1){
+ wx.switchTab({
+ url: url,
+ })
}
+ app.go(e.currentTarget.dataset.url)
}
-
- app.go(e.currentTarget.dataset.url)
-
},
- confirmDialog(){
+ gozhiye(e){
+ let idcard_status = this.data.info.idcard_status;
+ let iden_auth_status = this.data.info.iden_auth_status;
+ let is_bind_bank = this.data.info.is_bind_bank;
+ if(idcard_status != 1){
+ this.setData({
+ dialog_content: "请您先完成实名认证",
+ shiming_status_url: "/Pages/yishi/identity/index",
+ dialog_visible: true,
+ });
+ return;
+ }
+ if(iden_auth_status != 1){
+ this.setData({
+ dialog_content: "请您先医师身份认证",
+ shiming_status_url: "/Pages/yishi/identity/index?selected_tab=1",
+ dialog_visible: true,
+ });
+ return;
+ }
+ if(is_bind_bank != 1){
+ this.setData({
+ dialog_content: "请您先绑定结算银行卡",
+ shiming_status_url: "/Pages/yishi/bankcard/index",
+ dialog_visible: true,
+ });
+ return;
+ }
+ app.go(e.currentTarget.dataset.url);
+ },
+ confirmDialog(e){
+ // console.log(e)
+ let url = e.currentTarget.dataset.url;
+ // console.log("confirmDialog: ", url)
this.setData({
dialog_visible: false
})
+ app.go(url);
},
cancelDialog(){
this.setData({
@@ -268,110 +410,361 @@ Page({
let iden_auth_status = this.data.info.iden_auth_status;
//多点执业认证
let multi_point_status = this.data.info.multi_point_status;
+ //绑定结算银行卡
+ var is_bind_bank = this.data.info.is_bind_bank;
+ //是否参加专家图文接诊(0:否 1:是)
+
+ // let is_img_expert_reception = this.data.info.is_img_expert_reception;
+ // //是否参加专家快速接诊(0:否 1:是)
+ // let is_img_quick_reception = this.data.info.is_img_quick_reception;
+ // //是否参加专家公益接诊(0:否 1:是)
+ // let is_img_welfare_reception = this.data.info.is_img_welfare_reception;
+
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ wx.setStorageSync(userID+'_idcard_status', idcard_status);
+ wx.setStorageSync(userID+'_iden_auth_status', iden_auth_status);
+ wx.setStorageSync(userID+'_multi_point_status', multi_point_status);
+ wx.setStorageSync(userID+'_is_bind_bank', is_bind_bank);
if(idcard_status == 0){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ dialog_visible: true,
+ });
+ }
this.setData({
- dialog_content: "请您先实名认证",
- dialog_visible: true
+ "info.info_shiming_status_txt": "未认证",
+ "info.info_shiming_status": "info_shiming_status_no",
+ dialog_content: "请您先完成实名认证",
+ shiming_status_url: "/Pages/yishi/identity/index",
+ dialog_url: "/Pages/yishi/identity/index",
+ default_dialog_show: true
});
return false;
}
if(idcard_status == 2){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ dialog_visible: true,
+ });
+ }
this.setData({
"info.info_shiming_status_txt": "认证失败",
"info.info_shiming_status": "info_shiming_status_yes",
+ shiming_status_url: "/Pages/yishi/identity/index",
+ dialog_url: "/Pages/yishi/identity/index",
dialog_content: "实名认证失败",
- dialog_visible: true
- });
- this.setData({
+ default_dialog_show: true
});
return false;;
}
if(iden_auth_status == 0){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ dialog_visible: true,
+ });
+ }
this.setData({
"info.info_shiming_status_txt": "前往医师身份认证",
"info.info_shiming_status": "info_shiming_status_yes",
- dialog_content: "请您前往医师身份认证",
- dialog_visible: true
+ shiming_status_url: "/Pages/yishi/identity/index?selected_tab=1",
+ dialog_url: "/Pages/yishi/identity/index?selected_tab=1",
+ dialog_content: "请您先医师身份认证",
+ default_dialog_show: true
});
return false;
}
if(iden_auth_status == 2){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ // dialog_visible: true,
+ });
+ }
this.setData({
"info.info_shiming_status_txt": "审核中",
"info.info_shiming_status": "info_shiming_status_yes",
- dialog_content: "您的医师身份认证正在审核中",
- dialog_visible: true
- });
- return false;
- }
- if(iden_auth_status == 3){
- this.setData({
- "info.info_shiming_status_txt": "认证失败",
- "info.info_shiming_status": "info_shiming_status_yes",
- dialog_content: "您的医师身份认证失败",
- dialog_visible: true
- });
- return false;
- }
-
- //多点执业认证
- if(multi_point_status == 0){
- this.setData({
- "info.info_shiming_status_txt": "前往多点执业认证",
- "info.info_shiming_status": "info_shiming_status_yes",
- dialog_content: "请您先进行多点执业认证",
- dialog_visible: true
+ shiming_status_url: "/Pages/yishi/identity/index?selected_tab=1",
+ dialog_url: "/Pages/yishi/identity/index?selected_tab=1",
+ // dialog_content: "您的医师身份认证正在审核中",
+ // default_dialog_show: true
});
return false;
}
- if(multi_point_status == 2){
- this.setData({
- "info.info_shiming_status_txt": "审核中",
- "info.info_shiming_status": "info_shiming_status_yes",
- dialog_content: "您的多点执业认证正在审核中",
- dialog_visible: true
- });
- return false;
- }
- if(multi_point_status == 3){
+ if(iden_auth_status == 3){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ // dialog_visible: true,
+ });
+ }
this.setData({
"info.info_shiming_status_txt": "认证失败",
"info.info_shiming_status": "info_shiming_status_yes",
- dialog_content: "您的多点执业认证失败",
- dialog_visible: true
- });
+ shiming_status_url: "/Pages/yishi/identity/index?selected_tab=1",
+ dialog_url: "/Pages/yishi/identity/index?selected_tab=1",
+ dialog_content: "您的医师身份认证失败",
+ // default_dialog_show: true
+ });
return false;
}
-
- //绑定结算银行卡
- var is_bind_bank = this.data.info.is_bind_bank;
+
if(is_bind_bank == 0){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ dialog_visible: true,
+ });
+ }
this.setData({
"info.info_shiming_status_txt": "绑定结算银行卡",
"info.info_shiming_status": "info_shiming_status_yes",
+ shiming_status_url: "/Pages/yishi/bankcard/index",
+ dialog_url: "/Pages/yishi/bankcard/index",
dialog_content: "请您先绑定结算银行卡",
- dialog_visible: true
- });
+ default_dialog_show: true
+ });
return false;
}
- //开启在线问诊
- var is_img_expert_reception = this.data.info.is_img_expert_reception;
- if(is_img_expert_reception == 0){
+
+ //多点执业认证
+ if(multi_point_status == 0){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ // dialog_visible: true,
+ });
+ }
+ this.setData({
+ "info.info_shiming_status_txt": "前往多点执业认证",
+ "info.info_shiming_status": "info_shiming_status_yes",
+ shiming_status_url: "/Pages/yishi/zhiye_identity/index",
+ dialog_content: "请您先进行多点执业认证",
+ // default_dialog_show: true
+ });
+ // return false;
+ }
+
+ if(multi_point_status == 2){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ // dialog_visible: true,
+ });
+ }
+ this.setData({
+ "info.info_shiming_status_txt": "审核中",
+ "info.info_shiming_status": "info_shiming_status_yes",
+ shiming_status_url: "/Pages/yishi/zhiye_identity/index",
+ dialog_content: "您的多点执业认证正在审核中",
+ // default_dialog_show: true
+ });
+ // return false;
+ }
+
+ if(multi_point_status == 3){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ // dialog_visible: true,
+ });
+ }
+ this.setData({
+ "info.info_shiming_status_txt": "认证失败",
+ "info.info_shiming_status": "info_shiming_status_yes",
+ shiming_status_url: "/Pages/yishi/zhiye_identity/index",
+ dialog_content: "您的多点执业认证失败",
+ // default_dialog_show: true
+ });
+ // return false;
+ }
+
+ const jiesuan_dialog_show = wx.getStorageSync('jiesuan_dialog_show');
+ if(!jiesuan_dialog_show){
+ this.setData({
+ jiesuan_dialog_visible: true,
+ });
+ wx.setStorageSync('jiesuan_dialog_show', true);
+ }
+ // (is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) == 0
+ let flag=false;
+ if(this.data.doctor_inquiry_config){
+ flag=this.data.doctor_inquiry_config.every((item)=>{
+ return item.is_enable==0
+ })
+ };
+ if(!this.data.doctor_inquiry_config || flag){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ // dialog_visible: true,
+ });
+ }
this.setData({
"info.info_shiming_status_txt": "开启在线问诊",
"info.info_shiming_status": "info_shiming_status_yes",
- multi_point_status_url: "/Pages/yishi/onlinesetup/index",
- dialog_content: "请您先前往在线问诊管理中开通在线问诊",
- dialog_visible: true
- });
+ shiming_status_url: "/Pages/yishi/onlinesetup/index",
+ // default_dialog_show: true
+ });
return false;
}
- this.setData({"info.info_shiming_status_txt": "去接诊"});
+ //(is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) > 0
+ if(this.data.doctor_inquiry_config && !flag){
+ if(!this.data.default_dialog_show){
+ this.setData({
+ // dialog_visible: true,
+ });
+ }
+ this.setData({
+ "info.info_shiming_status_txt": "去接诊",
+ "info.info_shiming_status": "info_shiming_status_yes",
+ shiming_status_url: "/Pages/yishi/wenzhen_v2/wenzhen",
+ // default_dialog_show: true
+ });
+ return false;
+ }
+
+
+
+ //开启在线问诊
+ // var is_img_expert_reception = this.data.info.is_img_expert_reception;
+ // if(is_img_expert_reception == 0 ){
+ // if(!this.data.default_dialog_show){
+ // this.setData({
+ // // dialog_visible: true,
+ // });
+ // }
+ // this.setData({
+ // "info.info_shiming_status_txt": "开启在线问诊",
+ // "info.info_shiming_status": "info_shiming_status_yes",
+ // shiming_status_url: "/Pages/yishi/onlinesetup/index",
+ // dialog_content: "请您先前往在线问诊管理中,开通在线问诊",
+ // default_dialog_show: true
+ // })
+ // return false;
+ // }
+
+
+
+ this.setData({
+ "info.info_shiming_status_txt": "去接诊",
+ shiming_status_url: "/Pages/yishi/wenzhen_v2/wenzhen",
+ });
this.setData({"info.info_shiming_status": "info_shiming_status_yes"});
return true;
+ },
+ contactKeFu(e){
+ let _this = this;
+
+ let checkDialog = this.checkDialog(e);
+ if(checkDialog){
+
+ let tmplIds = ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+ this.setData({
+ contactKeFu: true
+ })
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
+ this.setData({
+ sub_visible: true,
+ })
+ }
+ })
+ }
+ },
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false,
+ contactKeFu: true
+ })
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ console.log(res.authSetting)
+ }
+ })
+ },
+ checkDialog(e){
+ //实名认证
+ let idcard_status = this.data.info.idcard_status;
+ //医师身份认证
+ let iden_auth_status = this.data.info.iden_auth_status;
+ //多点执业认证
+ let multi_point_status = this.data.info.multi_point_status;
+ //绑定结算银行卡
+ let is_bind_bank = this.data.info.is_bind_bank;
+ //是否参加专家图文接诊(0:否 1:是)
+ let is_img_expert_reception = this.data.info.is_img_expert_reception;
+ //是否参加专家快速接诊(0:否 1:是)
+ let is_img_quick_reception = this.data.info.is_img_quick_reception;
+ //是否参加专家公益接诊(0:否 1:是)
+ let is_img_welfare_reception = this.data.info.is_img_welfare_reception;
+ let statusArr = [];
+
+ // 未实名认证和医师身份认证 0
+ // 已实名认证,未医师身份认证 1
+ // 已实名认证和医师身份认证,未绑定结算银行卡 2
+ // 已实名认证和医生身份认证,已绑定结算银行卡 未开通多点执业认证3
+ // 已实名认证和医师身份认证且绑定结算银行卡,开通了在线问诊,未开通多点执业认证 4
+ // 已实名认证和医师身份认证且绑定结算银行卡,开通了在线问诊,已开通多点执业认证 5
+ if(idcard_status == 0 && iden_auth_status == 0){
+ statusArr.push(0);
+ }
+ if(idcard_status == 1 && iden_auth_status != 1){
+ statusArr.push(1);
+ }
+ if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank != 1){
+ statusArr.push(2);
+ }
+ if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && multi_point_status != 1 &&
+ (is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) == 0){
+ statusArr.push(3);
+ }
+ if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && multi_point_status != 1 &&
+ (is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) > 0){
+ statusArr.push(4);
+ }
+ if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && multi_point_status == 1){
+ statusArr.push(5);
+ }
+
+ let retult = true;
+ statusArr.forEach(status => {
+ let now_case = this.data.mycase.find(item => {
+ return item.case_status == status;
+ });
+ // console.log("now_case: ", now_case);
+ //所属模块
+ let moudle = e.currentTarget.dataset.moudle;
+ // console.log("moudle: ", moudle);
+ if(now_case){
+ let now_moudle = now_case.case_module.find(item => {
+ return item == moudle;
+ })
+ // console.log("now_moudle: ", now_moudle);
+ if(now_moudle != undefined){
+ this.setData({
+ dialog_content: now_case.case_text,
+ dialog_visible: true,
+ dialog_url: now_case.case_url
+ });
+ retult = false;
+ return;
+ }
+ }
+ })
+
+ return retult;
+ },
+ onClickHideOverlay(){
+ this.setData({
+ overlay_show: false
+ })
}
})
\ No newline at end of file
diff --git a/Pages/yishi/index/index.json b/Pages/yishi/index/index.json
index 1df70e4..9f2b365 100644
--- a/Pages/yishi/index/index.json
+++ b/Pages/yishi/index/index.json
@@ -2,11 +2,14 @@
"component": true,
"usingComponents": {
"t-avatar": "tdesign-miniprogram/avatar/avatar",
- "van-image": "@vant/weapp/image/index",
"van-button": "@vant/weapp/button/index",
"t-swiper": "tdesign-miniprogram/swiper/swiper",
- "t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav",
"t-badge": "tdesign-miniprogram/badge/badge",
- "t-dialog": "tdesign-miniprogram/dialog/dialog"
- }
+ "t-dialog": "tdesign-miniprogram/dialog/dialog",
+ "van-image": "@vant/weapp/image/index",
+ "t-skeleton": "tdesign-miniprogram/skeleton/skeleton",
+ "van-overlay": "@vant/weapp/overlay/index"
+ },
+ "enablePullDownRefresh": false,
+ "backgroundTextStyle":"dark"
}
\ No newline at end of file
diff --git a/Pages/yishi/index/index.wxml b/Pages/yishi/index/index.wxml
index 9db1c61..0fc69b1 100644
--- a/Pages/yishi/index/index.wxml
+++ b/Pages/yishi/index/index.wxml
@@ -1,144 +1,177 @@
-
-
-
+
+
{{ title }}
+ style="top:0;padding-top: {{stateHeight}}px;height: {{navHeight + 10}}px;line-height: {{navHeight}}px;position: relative;">{{ title }}
-
+
+
-
-
-
-
-
-
-
- {{info.user_name}}
-
- 新问诊:{{info.not_accepted_inquiry_num}}
- 接诊中:{{info.accepting_inquiry_num}}
+
+
+
+
+
+
+
+
+ {{info.user_name}}
+
+
+
+ {{info.info_shiming_status_txt}}
+
-
-
- {{info.info_shiming_status_txt}}
+
+
+
+
+
+ 待接诊:{{info.not_accepted_inquiry_num}}
+
+
+ 接诊中:{{info.accepting_inquiry_num}}
-
+
+
+
+
好评率 {{info.praise_rate}}%
-
+
响应时间 {{info.avg_response_time}} 分钟
-
+
关注数 {{info.number_of_fans}}
-
+
+
+
+
医师身份认证
- {{ iden_auth_status_txt }}>
-
-
-
+
+
+
+
多点执业认证
- {{ multi_point_status_txt }}>
-
-
-
+ -->
+
+
+
+
+
+
+
+
+
-
-
+
- 我的简介
+ 个人简介管理
-
-
+
- 在线问诊
+ 在线问诊管理
-
-
+
- 快速问诊
+ 快速问诊管理
-
-
+
- 公益问诊
+ 公益问诊管理
-
-
+
-
+
-
-
+
联系客服
+
+
+
取消
-
+
确定
-
\ No newline at end of file
+
+
+
+ 已了解
+
+
+ 不了解
+
+
+
+
+
+
+ 取消
+
+
+
+
+
+
+
+
+ 我知道了
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
diff --git a/Pages/yishi/index/index.wxss b/Pages/yishi/index/index.wxss
index 6f403f4..e42c8a8 100644
--- a/Pages/yishi/index/index.wxss
+++ b/Pages/yishi/index/index.wxss
@@ -1,3 +1,6 @@
+page{
+ background-color: #FAFAFA;
+}
.container{
width: 100vw;
}
@@ -15,54 +18,71 @@
.title{
position: fixed;
letter-spacing: 3rpx;
- margin-left: 5vw;
+ padding-left: 5vw;
font-size: 35rpx;
color: #fff;
background-color: #3CC7C0;
- width: 100%;
z-index: 999;
}
.info_box{
width: 90vw;
- margin: 30rpx auto;
+ margin: 0 auto;
display: flex;
padding: 20rpx 0;
flex-direction: column;
background-color: rgb(255, 255, 255);
border-radius: 10rpx;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.06);
+ z-index: 999;
}
.info{
+ display: flex;
+ flex-direction: column;
+ z-index: 999;
+}
+.info_top{
display: flex;
align-items: center;
justify-content: space-around;
+ z-index: 999;
}
.info_photo{
margin-left: 20rpx;
flex: 1;
+ z-index: 999;
}
.info_content{
color: #000;
- flex: 4;
+ flex: 2;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-left: 20rpx;
+ z-index: 999;
}
.info_mobile{
font-size: 36rpx;
letter-spacing: 3rpx;
+ z-index: 999;
}
.info_wenzhen{
- margin-top: 10rpx;
+ margin: 20rpx 0 0 30rpx;
font-size: 28rpx;
color: #666666;
display: flex;
+ z-index: 999;
+}
+.info_wenzhen_new{
+ flex: 1;
+}
+.info_wenzhen_ing{
+ flex: 3;
}
.info_shiming{
- flex: 2;
+ flex: 3;
display: flex;
- justify-content: center;
+ justify-content: flex-end;
+ margin-right: 20rpx;
}
.info_shiming_status{
padding: 15rpx 20rpx 15rpx 20rpx;
@@ -84,6 +104,8 @@
align-items: center;
text-align: center;
margin-top: 20rpx;
+ margin-left: 20rpx;
+ height: 50rpx;
}
.info_note_txt{
font-size: 28rpx;
@@ -139,51 +161,54 @@
.renzheng_content_right_img{
width: 100%;
}
-.ad{
- padding: 20rpx 20rpx 0 20rpx;
- width: calc(90vw - 40rpx);
- height: 150rpx;
- margin: 0 auto;
- box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1);
+.ad {
+ width: calc(92vw - 40rpx);
border-radius: 10rpx;
- background-color: rgb(255, 255, 255);
-
+ margin: 0 auto;
+ background-color: #fff;
+ padding: 20rpx 20rpx 0 20rpx;
+ box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1);
}
-.t-swiper-nav--bottom {
- bottom: -24rpx !important;
+.swiper{
+ height:168rpx;
}
-.t-swiper-nav__dots-item {
- background: var(--td-swiper-nav-dot-color, var(--td-font-white-2, rgb(107, 106, 106))) !important;
-}
-.t-swiper-nav__dots-item--active {
- background-color: var(--td-swiper-nav-dot-active-color, var(--td-font-white-1, #3CC7C0)) !important;
+.swiper-item .swiperimg{
+ width:100%;
+ border-radius: 10rpx;
+ height:110rpx;
}
.fun_box{
width: 90vw;
margin: 30rpx auto 0 auto;
- padding: 20rpx 0;
+ padding: 30rpx 0;
box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1);
display: flex;
flex-wrap: wrap;
- justify-content: space-around;
+ justify-content: space-evenly;
+ border-radius: 10rpx;
+ background-color: #fff;
}
.fun_box_item{
width: 40vw;
- height: 150rpx;
+ height: 110rpx;
background-color: #FAFAFA;
border-radius: 10rpx;
margin: 10rpx 0;
display: flex;
align-items: center;
- padding-left: 20rpx;
}
.fun_box_item_img{
flex: 1;
+ display: flex;
+ justify-content: center;
}
.fun_box_item_txt{
- flex: 2;
- font-size: 30rpx;
+ flex: 2.5;
+ font-size: 34rpx;
color: #333333;
+ height: 70rpx;
+ line-height: 70rpx;
+ display: flex;
}
.t-class-cancel{
color: #3CC7C0 !important;
@@ -195,10 +220,38 @@
line-height: 100rpx;
}
.dialog_cancel_btn{
- border-top: 1px solid #E9E9E9;
- border-right: 1px solid #E9E9E9;
+ position: relative;
+}
+.dialog_cancel_btn::before {
+ content: ' ';
+ position: absolute;
+ box-sizing: border-box;
+ top: 0;
+ left: 0;
+ border-top: 2px solid var(--td-border-color, #e7e7e7);
+ border-right: 2px solid var(--td-border-color, #e7e7e7);
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ width: 200%;
+ height: 200%;
+ border-radius: 0;
+ border-top-left-radius: 0px;
+ border-top-right-radius: 0px;
+ border-bottom-right-radius: 0px;
+ border-bottom-left-radius: 0px;
}
.dialog_confirm_btn{
border-top: 1px solid #E9E9E9;
color: #3CC7C0;
+}
+.t-button__content{
+ color: #3CC7C0 !important;
+}
+.t-dialog__button--text:before {
+ border-top: 2px solid #E9E9E9 !important;
+ border-left: 2px solid var(--td-border-color, #E9E9E9);
+ border-top-color: #E9E9E9 !important;
+}
+.overlay_show{
+
}
\ No newline at end of file
diff --git a/Pages/yishi/kuaisusetup/index.js b/Pages/yishi/kuaisusetup/index.js
index f8c3e6f..ab60e35 100644
--- a/Pages/yishi/kuaisusetup/index.js
+++ b/Pages/yishi/kuaisusetup/index.js
@@ -1,5 +1,6 @@
import { API } from './../../../utils/network/api'
-import Toast from '@vant/weapp/toast/toast';
+import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
+
let api = new API()
const app = getApp()
Page({
@@ -10,8 +11,8 @@ Page({
},
height: app.globalData.height,
checked: true,
- open_note: "已开启,可在问诊消息中选择订单接诊",
- close_note: "已关闭,暂不接收快速图文订单",
+ open_note: "已开启,可在问诊消息中进行接诊",
+ close_note: "已关闭,暂不接收快速问诊",
note: "",
inquiry_type: 2,
inquiry_mode: 1,
@@ -32,11 +33,12 @@ Page({
"5",
"10"
]
- }
+ },
+ sub_visible: false,
},
onLoad(){
- this.setData({ note: this.data.open_note });
+
},
onShow(){
let params = {};
@@ -49,16 +51,45 @@ Page({
info: response.data.info,
config: response.data.config,
})
+ }).then(re => {
+ let is_open = this.data.info.is_open;
+ let note = this.data.note;
+ if(is_open == 1) note = this.data.open_note;
+ if(is_open == 0) note = this.data.close_note;
+ this.setData({
+ note: note
+ })
+
}).catch(errors => {console.error(errors);})
},
+ changeON(){
+ let is_open = this.data.info.is_open
+ console.log("changeON:", is_open)
+ let detail = false
+ if(is_open == 0){
+ detail = true
+ }else{
+ detail = false
+ }
+ this.doChange(detail)
+ },
onChange({ detail }) {
console.log("onChange: ", detail);
+ this.doChange(detail)
+ },
+ doChange(detail){
+ let is_open = 0;
if(detail){
this.setData({ note: this.data.open_note });
+ wx.vibrateShort({
+ "type": "heavy"
+ })
+ is_open = 1
}else{
this.setData({ note: this.data.close_note });
+ is_open = 0
}
- this.setData({ "info.is_open": detail });
+ this.setData({ "info.is_open": is_open });
//修改开关
let params = {};
@@ -67,37 +98,48 @@ Page({
params.is_open = detail?1:0;
api.putDoctorInquiryOpen(params).then(response => {
console.log(response);
+ }).then(()=>{
+ if(detail){
+
+ let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
+ this.setData({
+ sub_visible: true,
+ })
+ }
+ })
+
+ }
}).catch(errors => {console.error(errors);})
},
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ console.log(res.authSetting)
+ }
+ })
+ },
putDoctorInquiryConfig(){
wx.switchTab({
- url: "/Pages/yishi/wenzhen/wenzhen"
+ url: "/Pages/yishi/wenzhen_v2/wenzhen"
})
},
- onStepperChange(event) {
- console.log(event.detail);
- this.setData({
- "info.work_num_day": event.detail
- });
- },
- onPriceChange(e){
- console.log(e.detail);
- let value = e.detail.value;
- let min = this.data.config.min_inquiry_price;
- let max = this.data.config.max_inquiry_price;
- if(value < min){
- value = min;
- Toast.fail('价格不能低于' + min + '元');
- }else if(value >= min && value <=max ){
- value = value;
- }else{
- value = max;
- Toast.fail('价格不能高于' + max + '元');
- }
- this.setData({
- "info.inquiry_price": value
- })
- }
+
})
\ No newline at end of file
diff --git a/Pages/yishi/kuaisusetup/index.json b/Pages/yishi/kuaisusetup/index.json
index 71178ef..cc9281e 100644
--- a/Pages/yishi/kuaisusetup/index.json
+++ b/Pages/yishi/kuaisusetup/index.json
@@ -7,6 +7,7 @@
"van-stepper": "@vant/weapp/stepper/index",
"van-switch": "@vant/weapp/switch/index",
"van-button": "@vant/weapp/button/index",
- "van-toast": "@vant/weapp/toast/index"
+ "van-toast": "@vant/weapp/toast/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/kuaisusetup/index.wxml b/Pages/yishi/kuaisusetup/index.wxml
index 8f3be2b..de6c3d4 100644
--- a/Pages/yishi/kuaisusetup/index.wxml
+++ b/Pages/yishi/kuaisusetup/index.wxml
@@ -1,33 +1,33 @@
-
+
-
+
接诊开关
+ checked="{{ info.is_open==1 }}"
+ />
{{ note }}
-
+
-
+
价格设置
- 问诊单价(元)
+ 问诊单价
- 元
+ 元
@@ -35,15 +35,28 @@
- 提示:服务开通后,患者可以通过快速问诊找到您,增加您的曝光度。
- 1、快速问诊价格为平台统一定价;
- 2、接诊后{{config.duration}}分钟内和患者{{config.times_number==0?'无限':config.times_number}}次沟通。
+ 提示:服务开启后,您将有机会接收到平台自动分配的在线患者快速问诊订单
+ 1、快速问诊价格为平台统一设定
+ 2、快速问诊服务时间为{{config.duration}}分钟,期间不限制交流次数
-
- 去接诊
+
+ 去接诊
+
+
+
+ 取消
+
+
+ 确定
+
+
\ No newline at end of file
diff --git a/Pages/yishi/kuaisusetup/index.wxss b/Pages/yishi/kuaisusetup/index.wxss
index 0af51b2..968391c 100644
--- a/Pages/yishi/kuaisusetup/index.wxss
+++ b/Pages/yishi/kuaisusetup/index.wxss
@@ -1,7 +1,8 @@
+page{
+ background-color: #F6F6F6;
+}
.container{
width: 100vw;
- height: 100vh;
- background-color: #F6F6F6;
}
.switch_box{
display: flex;
@@ -37,7 +38,7 @@
}
.switch_box_item_name{
flex: 1;
- font-size: 32rpx;
+ font-size: 16px;
}
.switch_box_item_btn{
flex: 1;
@@ -69,7 +70,7 @@
position: relative;
display: flex;
justify-content: space-between;
- margin: 20rpx;
+ margin: 20rpx 20rpx 20rpx 30rpx;
align-items: center;
}
.price_steup_box_bottom_num{
@@ -79,7 +80,7 @@
}
.price_steup_box_top_title, .price_steup_box_bottom_title{
flex: 1;
- font-size: 32rpx;
+ font-size: 16px;
color: #333;
}
.price_steup_box_top::after{
@@ -100,7 +101,7 @@
}
.bottom{
width: 90vw;
- margin: 0 auto;
+ margin: -20rpx auto;
color: #999;
letter-spacing: 2rpx;
font-size: 28rpx;
@@ -122,4 +123,18 @@
.price{
text-align: center;
flex: 1;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
}
\ No newline at end of file
diff --git a/Pages/yishi/linkPage/linkPage.js b/Pages/yishi/linkPage/linkPage.js
new file mode 100644
index 0000000..c7f9a88
--- /dev/null
+++ b/Pages/yishi/linkPage/linkPage.js
@@ -0,0 +1,68 @@
+// pages/linkPage/linkPage.js
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ url:''
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ if(options.url){
+ this.setData({
+ url:decodeURIComponent(options.url)
+ });
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+
+})
\ No newline at end of file
diff --git a/Pages/yishi/linkPage/linkPage.json b/Pages/yishi/linkPage/linkPage.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/Pages/yishi/linkPage/linkPage.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/Pages/yishi/linkPage/linkPage.wxml b/Pages/yishi/linkPage/linkPage.wxml
new file mode 100644
index 0000000..4df1dbb
--- /dev/null
+++ b/Pages/yishi/linkPage/linkPage.wxml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/Pages/yishi/linkPage/linkPage.wxss b/Pages/yishi/linkPage/linkPage.wxss
new file mode 100644
index 0000000..cdd32c4
--- /dev/null
+++ b/Pages/yishi/linkPage/linkPage.wxss
@@ -0,0 +1 @@
+/* pages/linkPage/linkPage.wxss */
\ No newline at end of file
diff --git a/Pages/yishi/manual/index.wxml b/Pages/yishi/manual/index.wxml
index 1125938..54875a3 100644
--- a/Pages/yishi/manual/index.wxml
+++ b/Pages/yishi/manual/index.wxml
@@ -1,7 +1,7 @@
-
+
-
+
diff --git a/Pages/yishi/manual/index.wxss b/Pages/yishi/manual/index.wxss
index fd15078..7787fa6 100644
--- a/Pages/yishi/manual/index.wxss
+++ b/Pages/yishi/manual/index.wxss
@@ -1,9 +1,11 @@
-.container{
- width: 100vw;
- height: 100vh;
+page{
background-color: #F6F6F6;
}
+.container{
+ margin-top: 20rpx;
+ width: 100vw;
+}
.item_list{
width: 92vw;
- margin: 20rpx auto;
+ margin: 0 auto;
}
\ No newline at end of file
diff --git a/Pages/yishi/manual_detail/index.js b/Pages/yishi/manual_detail/index.js
index 75fe20d..b6a984f 100644
--- a/Pages/yishi/manual_detail/index.js
+++ b/Pages/yishi/manual_detail/index.js
@@ -18,7 +18,7 @@ Page({
},
onShow(){
- //获取医生我的账户数据
+ //获取操作手册详情
api.getBasicOperationManualID({manual_id: this.data.manual_id}).then(response => {
console.log(response);
this.setData({
diff --git a/Pages/yishi/manual_detail/index.json b/Pages/yishi/manual_detail/index.json
index c977da1..3b3b8cc 100644
--- a/Pages/yishi/manual_detail/index.json
+++ b/Pages/yishi/manual_detail/index.json
@@ -1,6 +1,6 @@
{
"component": true,
"usingComponents": {
- "m-nav-bar": "/commpents/mynavbar/index"
+ "te-nav-bar": "/commpents/te_navbar"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/manual_detail/index.wxml b/Pages/yishi/manual_detail/index.wxml
index 9bed7f9..2ee6c78 100644
--- a/Pages/yishi/manual_detail/index.wxml
+++ b/Pages/yishi/manual_detail/index.wxml
@@ -1,4 +1,5 @@
-
+
+
-
+
diff --git a/Pages/yishi/manual_detail/index.wxss b/Pages/yishi/manual_detail/index.wxss
index d4dbc33..893b247 100644
--- a/Pages/yishi/manual_detail/index.wxss
+++ b/Pages/yishi/manual_detail/index.wxss
@@ -1 +1,8 @@
-/* Pages/yishi/manual_detail/index.wxss */
\ No newline at end of file
+/* Pages/yishi/manual_detail/index.wxss */
+page{
+ background-color: #F6F6F6;
+}
+.container{
+ width: 92vw;
+ margin: 20rpx auto;
+}
\ No newline at end of file
diff --git a/Pages/yishi/medince_list/index.js b/Pages/yishi/medince_list/index.js
new file mode 100644
index 0000000..93b04c2
--- /dev/null
+++ b/Pages/yishi/medince_list/index.js
@@ -0,0 +1,144 @@
+// Pages/yishi/medince_list/index.js
+import { API } from './../../../utils/network/api'
+import debounce from "./../../../utils/debounce"
+let api = new API()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navbarData: {
+
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '药品清单', //导航栏 中间的标题
+ },
+ page:1,
+ isLoding:false,
+ list:[],
+ isLock:false,
+ per_page:10,
+ keyword:'',
+ },
+ changeInput:debounce(function(event){
+ const { value }= event.detail;
+ this.setData({
+ isLock:false,
+ page:1,
+ list:[],
+ keyword:value
+ })
+ this.handleGetList();
+ },600),
+ goSearch(){
+ this.setData({
+ isLock:false,
+ list:[],
+ page:1
+ })
+ this.handleGetList();
+ },
+ confirmSearch(event){
+ const { value }= event.detail;
+ this.setData({
+ isLock:false,
+ list:[],
+ page:1,
+ keyword:value
+ })
+ this.handleGetList();
+ },
+ lower(){
+ console.log('===触底了!!===');
+ let {page,isLock}=this.data;
+ if(!isLock){
+ page++;
+ this.setData({
+ page:page
+ });
+ this.handleGetList();
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ handleGetList(){
+ const {page,per_page,keyword,isLoding}=this.data;
+ if(isLoding)return false;
+ this.setData({
+ isLoding:true
+ })
+ api.getMedinceList({
+ page,
+ per_page,
+ keyword,
+
+ }).then(data=>{
+ this.setData({
+ isLoding:false
+ })
+ let result=data.data.data;
+ if(result.length==0){
+ this.setData({
+ isLock:true
+ });
+ return false;
+ }
+ this.setData({
+ list:this.data.list.concat(result)
+ });
+ }).catch(errors => {console.error(errors);})
+ },
+ onLoad(options) {
+ this.handleGetList();
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/medince_list/index.json b/Pages/yishi/medince_list/index.json
new file mode 100644
index 0000000..152dd7f
--- /dev/null
+++ b/Pages/yishi/medince_list/index.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-image": "@vant/weapp/image/index",
+ "van-divider": "@vant/weapp/divider/index",
+ "van-empty": "@vant/weapp/empty/index"
+ }
+}
\ No newline at end of file
diff --git a/Pages/yishi/medince_list/index.wxml b/Pages/yishi/medince_list/index.wxml
new file mode 100644
index 0000000..20ca023
--- /dev/null
+++ b/Pages/yishi/medince_list/index.wxml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 处方药品
+ 依据法规不展示包装
+
+
+
+
+
+
+ {{item.product_name}}/{{item.packaging_unit}}
+ {{item.manufacturer}}
+
+
+ ¥ {{item.product_price}}
+ 库存:{{item.stock}}
+
+
+
+ 到底了~
+
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/medince_list/index.wxss b/Pages/yishi/medince_list/index.wxss
new file mode 100644
index 0000000..2721dde
--- /dev/null
+++ b/Pages/yishi/medince_list/index.wxss
@@ -0,0 +1,122 @@
+/* Pages/yishi/medince_list/index.wxss */
+page{
+ height:100vh;
+ background-color: #F6F6F6;
+}
+.page{
+ height:100vh;
+ display: flex;
+ flex-direction: column;
+}
+ .container{
+ /* height:calc(100vh - 135rpx); */
+ display: flex;
+ overflow: hidden;
+ /* overflow-y: scroll; */
+ /* -webkit-overflow-scrolling: touch; */
+ flex-direction: column;
+}
+.searchCon{
+ width:100%;
+
+ background:#fff;
+}
+.searchbox{
+ display: flex;
+ margin:32rpx;
+ align-items: center;
+ height: 80rpx;
+background: #FFFFFF;
+border-radius: 40rpx;
+border: 2rpx solid #3CC7C0;
+
+}
+.searchIpt{
+ flex:1;
+ margin-left: 32px;
+}
+.searchImg{
+ width: 40rpx;
+ height:40rpx;
+ padding:30rpx;
+}
+.tips{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ position: absolute;
+ width: 200rpx;
+ height:200rpx;
+ font-size: 22rpx;
+font-weight: 400;
+color: #666666;
+}
+.desc{
+ text-align: center;
+}
+.medimgbox{
+ position: relative;
+ width: 200rpx;
+ height:200rpx;
+ margin-left: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius:5rpx;
+}
+.medImg{
+ width:120rpx;
+ height:128rpx;
+
+}
+.cell{
+ padding:20rpx 0;
+ background: #FFFFFF;
+box-shadow: 0rpx 2rpx 16rpx 2rpx rgba(0,0,0,0.02);
+border-radius: 12rpx;
+ margin:0 32rpx 20rpx;
+ display: flex;
+}
+.rightbox{
+ flex:1;
+ margin-left: 24rpx;
+ margin-right: 20rpx;
+}
+.scrollbox{
+ margin-top: 20rpx;
+ flex:1;
+ overflow-y: scroll;
+ -webkit-overflow-scrolling: touch;
+}
+.bottombox{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.info .name{
+ word-break: break-all;
+font-size: 32rpx;
+ font-weight: 600;
+color: rgba(0,0,0,0.85);
+}
+.company{
+ margin-top: 5rpx;
+ font-size: 26rpx;
+font-weight: 400;
+color: rgba(0,0,0,0.45);
+}
+.price{
+ font-size: 28rpx;
+color: #EF4F20;
+}
+.rightbox{
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+
+}
+.num{
+ font-size: 28rpx;
+font-weight: 400;
+color: rgba(0,0,0,0.65);
+}
\ No newline at end of file
diff --git a/Pages/yishi/my/index.js b/Pages/yishi/my/index.js
index b14c5ef..312aa72 100644
--- a/Pages/yishi/my/index.js
+++ b/Pages/yishi/my/index.js
@@ -3,19 +3,24 @@ let api = new API()
const app = getApp();
Page({
data: {
- title: "个人中心",
+ title: "我的",
navHeight: 0,
stateHeight: 0,
- user_name: "",
- iden_auth_status: "",
- idcard_status: "",
- multi_point_status: "",
- avatar: "",
- balance_account: "",
- estimate_income: "",
+ doctor_title:'',
+ user_name: "医师姓名",
+ iden_auth_status: "0",
+ idcard_status: "0",
+ multi_point_status: "0",
+ static_host: api.getStaticHost(),
+ avatar: api.getStaticHost()+"/applet/doctor/static/images/default_photo.png",
+ balance_account: "0",
+ estimate_income: "0",
doctor_id: ""
},
-
+ onPullDownRefresh(){
+ console.log("用户下拉动作")
+ this.onShow();
+ },
// 获取状态栏信息
getMenuButtonBound() {
let stateHeight = 0; // 接收状态栏高度
@@ -27,29 +32,35 @@ Page({
},
});
top = wx.getMenuButtonBoundingClientRect().top - stateHeight; // 获取top值
- console.log('navHeight', navHeight);
- console.log('top', top);
+ // console.log('navHeight', navHeight);
+ // console.log('top', top);
this.setData({
// navHeight: navHeight + top * 2, // 导航栏高度
navHeight, // 导航栏高度
stateHeight: stateHeight + top, // 状态栏高度
});
},
-
+ onLoad(){
+ //console.log("onLoad ");
+ },
onShow: function () {
- console.log("onshow ");
+ // console.log("onshow ");
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
active: 2 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
})
+
+ this.getTabBar().startInterval()
+
}
this.getMenuButtonBound();
- },
- onLoad(){
+
+ // console.log("my onLoad");
//获取个人中心数据
api.getDoctorCenter().then(response => {
this.setData({
user_name: response.data.user_name,
+ doctor_title:response.data.doctor_title,
iden_auth_status: response.data.iden_auth_status,
idcard_status: response.data.idcard_status,
multi_point_status: response.data.multi_point_status,
@@ -65,10 +76,17 @@ Page({
this.setData({
"avatar": avatar
})
+ }).then(res => {
+ wx.stopPullDownRefresh()
}).catch(errors => {
console.error(errors);
})
},
+ onHide(){
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().stopInterval()
+ }
+ },
go(e){
let url = e.currentTarget.dataset.url;
app.go(url)
diff --git a/Pages/yishi/my/index.json b/Pages/yishi/my/index.json
index ddabca8..9f87f0f 100644
--- a/Pages/yishi/my/index.json
+++ b/Pages/yishi/my/index.json
@@ -6,5 +6,7 @@
"van-icon": "@vant/weapp/icon/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index"
- }
+ },
+ "enablePullDownRefresh":true,
+ "backgroundTextStyle":"dark"
}
\ No newline at end of file
diff --git a/Pages/yishi/my/index.wxml b/Pages/yishi/my/index.wxml
index 6e85b58..42a6c50 100644
--- a/Pages/yishi/my/index.wxml
+++ b/Pages/yishi/my/index.wxml
@@ -1,41 +1,47 @@
{{ title }}
-
+
-
+
- {{user_name}}
+
+
+ {{user_name}} {{doctor_title}}
+
+ 设置
+
+
+
+
- 已医师认证>
- 未多点执业认证>
+ {{iden_auth_status==1?'已医师认证':'未医师认证'}}>
+ {{multi_point_status==1?'已多点执业认证':'未多点执业认证'}}>
-
-
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/my/index.wxss b/Pages/yishi/my/index.wxss
index 50b3661..656ac6f 100644
--- a/Pages/yishi/my/index.wxss
+++ b/Pages/yishi/my/index.wxss
@@ -1,21 +1,28 @@
-.container{
- height: 100vh;
- width: 100vw;
+page{
background-color: #F5F5F5;
+}
+.container{
+ background: linear-gradient(180deg, #3CC7C0 0%, rgba(60,199,192,0) 50%);
+
+ padding-bottom: 120rpx;
+ min-height:100vh;
+ width: 100vw;
color: #fff;
position: relative;
}
.top{
width: 100%;
height: 500rpx;
- background-color: #3CC7C0;
+ /* background-color: #3CC7C0; */
position: absolute;
}
.title{
+ color: #000000;
position:relative;
text-align: center;
}
.info_box{
+ margin-top: 110rpx;
width: 100%;
height: 200rpx;
position: relative;
@@ -28,7 +35,8 @@
}
.name{
height: 50rpx;
- font-size: 36rpx;
+ font-size: 34rpx;
+ color: rgba(0,0,0,0.85);
line-height: 50rpx;
}
.renzheng{
@@ -37,13 +45,19 @@
margin-top: 15rpx;
}
.yishi,.zhiye{
- background-color: #00A59D;
+ background: #999999;
border-radius: 20rpx;
height: 44rpx;
line-height: 44rpx;
padding: 0 20rpx;
margin-right: 20rpx;
}
+.zhiye.active{
+ background: #FAAD14;
+}
+.yishi.active{
+ background: #FAAD14;
+}
.photo{
flex: 3;
text-align: center;
@@ -56,11 +70,27 @@
text-align: right;
padding-right: 20rpx;
}
+.namebox{
+ justify-content: space-between;
+ display: flex;
+}
+.iconbox{
+ align-items: center;
+ font-size: 30rpx;
+ color: rgba(0,0,0,0.65);
+ margin-right: 24rpx;
+ display: flex;
+}
+.iconbox .arrow{
+ margin-top: 4rpx;
+ margin-left: 4px;
+}
.account{
background-color: rgb(255, 255, 255);
width: 92vw;
margin: 0 auto;
- height: 272rpx;
+ height: 280rpx;
+ margin-top: 24rpx;
position: relative;
border-radius: 20rpx;
display: flex;
@@ -69,29 +99,37 @@
.account_top{
flex: 2;
display: flex;
+ align-items: stretch;
}
.account_top_left{
flex: 3;
display: flex;
flex-direction: column;
+ justify-content: space-between;
color: black;
margin-left: 20rpx;
}
.account_title{
- flex: 9;
+ margin-top: 32rpx;
display: flex;
+ font-size: 30rpx;
+font-weight: 400;
+color: rgba(0,0,0,0.65);
align-items: center;
}
.account_num{
- flex: 10;
+ margin-bottom: 10rpx;
+ font-weight: bold;
display: flex;
align-items: center;
}
.account_top_right{
+
flex: 2;
display: flex;
justify-content: center;
- align-items: center;
+ align-items:flex-end;
+
}
.account_bottom{
flex: 1;
@@ -103,15 +141,20 @@
.content{
width: 92vw;
background-color: #fff;
- margin: 0 auto;
- position: relative;
+ margin: 24rpx auto 0;
+ position: static;
+ overflow: hidden;
border-radius: 20rpx;
- padding: 20rpx 0;
+ padding: 0rpx 0 20rpx;
+}
+.t-badge__content-text {
+ line-height: 70rpx !important;
+}
+.van-cell {
+ padding: 32rpx !important;
}
-
-
diff --git a/Pages/yishi/myaccount/index.js b/Pages/yishi/myaccount/index.js
index d4c810a..96c3dd4 100644
--- a/Pages/yishi/myaccount/index.js
+++ b/Pages/yishi/myaccount/index.js
@@ -12,15 +12,16 @@ Page({
dateVisible: false,
dateText: "",
dateValue: ['2023','3'],
+ dialog_visible:false,
select_date: "",
balance_account: "",
amount_total_month: "",
+ doctor_today_inquiry_total:'',
+ doctor_day_completed_amount_total:'',
withdrawal_amount_month: "",
+ static_host: api.getStaticHost(),
bill: [],
- years: [
- { label: '2023年', value: '2023' },
- { label: '2024年', value: '2024' },
- ],
+ years: [],
seasons: [
{ label: '1月', value: '1' },
{ label: '2月', value: '2' },
@@ -36,6 +37,17 @@ Page({
{ label: '12月', value: '12' },
]
},
+ onLoad(){
+ let now_year = (new Date()).Format("yyyy");
+ let begin_year = 2023;
+ let years = [];
+ for(let i=begin_year;i<=now_year;i++){
+ years.push({label: i+"年", value: i+""})
+ }
+ this.setData({
+ years: years
+ })
+ },
onShow(){
let now_date = new Date();
let now_datearr = util.getDateArr(now_date);
@@ -45,7 +57,7 @@ Page({
let mmdateValue = [''+year+'',''+month+''];
this.setData({
dateValue: mmdateValue,
- dateText: month+"月"
+ dateText: year+"年"
})
let date = this.data.dateValue.join("-");
@@ -54,7 +66,16 @@ Page({
onColumnChange(e) {
console.log('picker onColumnChange:', e);
},
-
+ confirmDialog(){
+ this.setData({
+ dialog_visible:false
+ })
+ },
+ showDialog(){
+ this.setData({
+ dialog_visible:true
+ })
+ },
onPickerChange(e) {
const { key } = e.currentTarget.dataset;
const { value } = e.detail;
@@ -63,7 +84,7 @@ Page({
this.setData({
[`${key}Visible`]: false,
[`${key}Value`]: value,
- [`${key}Text`]: value[1]+"月",
+ [`${key}Text`]: value[0]+"年",
});
let date = value.join("-");
@@ -97,16 +118,25 @@ Page({
this.setData({
balance_account: response.data.balance_account,
amount_total_month: response.data.amount_total_month,
+ doctor_today_inquiry_total:response.data.doctor_today_inquiry_total,
+ doctor_day_completed_amount_total:response.data.doctor_day_completed_amount_total,
withdrawal_amount_month: response.data.withdrawal_amount_month,
bill: response.data.bill,
})
}).catch(errors => {console.error(errors);})
},
+ goTixian(){
+ app.go('/Pages/yishi/cash/index')
+ },
goDetail(e){
let url = e.currentTarget.dataset.url;
let md = e.currentTarget.dataset.md;
let date = this.data.dateValue[0]+"-"+md;
console.log(date);
app.go(url+"?date="+date);
- }
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ app.go(url);
+ },
})
\ No newline at end of file
diff --git a/Pages/yishi/myaccount/index.json b/Pages/yishi/myaccount/index.json
index da4c903..09bf0e3 100644
--- a/Pages/yishi/myaccount/index.json
+++ b/Pages/yishi/myaccount/index.json
@@ -2,11 +2,13 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
- "t-image": "tdesign-miniprogram/image/image",
+ "van-image": "@vant/weapp/image/index",
"t-picker": "tdesign-miniprogram/picker/picker",
"t-picker-item": "tdesign-miniprogram/picker-item/picker-item",
"van-icon": "@vant/weapp/icon/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog",
"van-cell": "@vant/weapp/cell/index",
- "van-cell-group": "@vant/weapp/cell-group/index"
+ "van-cell-group": "@vant/weapp/cell-group/index",
+ "van-empty": "@vant/weapp/empty/index"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/myaccount/index.wxml b/Pages/yishi/myaccount/index.wxml
index e5df2b9..c3ec3fa 100644
--- a/Pages/yishi/myaccount/index.wxml
+++ b/Pages/yishi/myaccount/index.wxml
@@ -1,28 +1,50 @@
-
-
+
+
- {{dateText}}
-
- 预计收入:¥{{amount_total_month}}
- 当月已提取:¥{{withdrawal_amount_month}}
+
+ 账户余额(元)
+
+
+ ¥{{balance_account}}
+ 提现
+
+
+
+
+ 今日接诊收入
+ ¥{{doctor_today_inquiry_total}}
+
+
+ 已完成待入账
+ ¥{{doctor_day_completed_amount_total}}
+
+
+
+
+
+ {{dateText}}
- 账单
-
+
+
-
+
-
+
+
\ No newline at end of file
+ >
+
+ 1、账户余额表示未提现的所有已经结束的订单金额总和
+ 2、今日接诊收入表示今日已经接诊的订单金额总和
+ 3、已完成待入账表示近期已完成未结束的订单金额总和
+
+
+ 确定
+
+
+
diff --git a/Pages/yishi/myaccount/index.wxss b/Pages/yishi/myaccount/index.wxss
index 3360f3c..b48ebee 100644
--- a/Pages/yishi/myaccount/index.wxss
+++ b/Pages/yishi/myaccount/index.wxss
@@ -1,11 +1,12 @@
-.container{
+page{
background-color: #F4F4F4;
+}
+.container{
width: 100vw;
- height: 100vh;
}
.top{
width: 92vw;
- margin: 50rpx auto 0 auto;
+ margin: 20rpx auto 0 auto;
background-color: #3CC7C0;
height: 150rpx;
border-radius: 20rpx;
@@ -19,9 +20,9 @@
}
.monthbox{
width: 92vw;
- margin: -40rpx auto 0 auto;
+ margin: 20rpx auto 0 auto;
background-color: #ffffff;
- height: 200rpx;
+ padding:26rpx 0 20rpx;
border-radius: 20rpx;
display: flex;
flex-direction: column;
@@ -43,24 +44,147 @@
.account_left{
flex: 1;
text-align: center;
+ text-align: left;
+ margin-left: 20rpx;
}
.account_right{
flex: 1;
text-align: center;
+ text-align: left;
}
.txt_title{
- font-size: 30rpx;
+ font-size: 34rpx;
margin: 20rpx 0;
position: relative;
left: 4vw;
+ width: 20vw;
}
.content{
width: 92vw;
background-color: #fff;
margin: 0 auto;
border-radius: 20rpx;
- padding: 20rpx 0;
+ overflow: hidden;
}
-
-
-
+.t-picker__confirm{
+ color: #3CC7C0 !important;
+}
+.titlebox{
+ margin:0 30rpx;
+ display: flex;
+}
+.titlebox .name{
+ color: #000000;
+}
+.question{
+ color:rgba(0,0,0,0.6);
+}
+.tixian{
+ width: 200rpx;
+height: 70rpx;
+background: linear-gradient(310deg, #FF931A 0%, #FF931A 0%, #FCB75D 100%);
+border-radius: 10rpx;
+font-size: 32rpx;
+display: flex;
+align-items: center;
+justify-content: center;
+font-weight: 400;
+color: #FFFFFF;
+}
+.accoutbox{
+ margin:20rpx 30rpx 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding-bottom: 26rpx;
+
+}
+.line{
+ width:100%;
+ height:1rpx;
+ background-color:#E5E5E5;
+}
+.mark{
+ font-size: 42rpx;
+font-weight: 400;
+color: #333333;
+}
+.cashbox{
+ margin:20rpx 30rpx 0;
+ display: flex;
+ justify-content: space-between;
+}
+.accountNum{
+ font-size: 64rpx;
+font-family: ArialMT;
+color: #333333;
+}
+.titlename{
+ font-size: 28rpx;
+font-weight: 400;
+color: #999999;
+}
+.today,.finish{
+ /* flex:1; */
+}
+.money{
+ margin-top: 16rpx;
+ font-size: 36rpx;
+font-weight: 400;
+color: #000000;
+}
+.van-cell:after{
+ left:0rpx!important;
+ right:0rpx!important;
+}
+.van-cell{
+ padding:35rpx 16rpx!important;
+}
+.dialog{
+ width: 100%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ position: relative;
+}
+.dialog_cancel_btn::before {
+ content: ' ';
+ position: absolute;
+ box-sizing: border-box;
+ top: 0;
+ left: 0;
+ border-top: 2px solid var(--td-border-color, #e7e7e7);
+ border-right: 2px solid var(--td-border-color, #e7e7e7);
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ width: 200%;
+ height: 200%;
+ border-radius: 0;
+ border-top-left-radius: 0px;
+ border-top-right-radius: 0px;
+ border-bottom-right-radius: 0px;
+ border-bottom-left-radius: 0px;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
+.t-button__content{
+ color: #3CC7C0 !important;
+}
+.t-dialog__button--text:before {
+ border-top: 2px solid #E9E9E9 !important;
+ border-left: 2px solid var(--td-border-color, #E9E9E9);
+ border-top-color: #E9E9E9 !important;
+}
+.slotcontent{
+ margin-top: 20rpx;
+}
+.slotcontent .msg{
+ font-size: 34rpx;
+font-weight: 400;
+color: #666;
+line-height: 48rpx;
+}
\ No newline at end of file
diff --git a/Pages/yishi/mycard/index.js b/Pages/yishi/mycard/index.js
index eb13f40..c733b4b 100644
--- a/Pages/yishi/mycard/index.js
+++ b/Pages/yishi/mycard/index.js
@@ -1,5 +1,4 @@
import { API } from './../../../utils/network/api'
-const util = require('./../../../utils/util')
let api = new API()
const app = getApp()
Page({
@@ -13,7 +12,8 @@ Page({
showText: false,
saveImgPath: "",
info: {},
- //https://github.com/Kujiale-Mobile/Painter
+ codeImg:'',
+ // https://github.com/Kujiale-Mobile/Painter
template: {
width: '750px',
height: '1200px',
@@ -53,7 +53,7 @@ Page({
},
{
type: 'image',//医生二维码图片 3
- url: 'https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/qrcode.png',
+ url: '',
css: {
left: '215px',
top: '458px',
@@ -63,7 +63,7 @@ Page({
},
{
type: 'image',//医生头像图片 4
- url: 'https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/default_photo.png',
+ url: '',
css: {
top: '40px',
left: '327px',
@@ -152,14 +152,16 @@ Page({
},
},
],
- }
+ },
+ painter_ready: false
},
- onShow(){
+ onLoad(){
//获取医生名片
api.getDoctorInfoCard().then(response => {
console.log(response);
this.setData({
info: response.data,
+ codeImg:response.data.qr_code_url+"?v=3.0",
"template.views[3].url" : response.data.qr_code_url,
"template.views[4].url" : response.data.avatar,
"template.views[5].text" : response.data.user_name,
@@ -167,6 +169,10 @@ Page({
"template.views[8].text" : response.data.department_custom_name,
"template.views[9].text" : response.data.hospital_name,
})
+ }).then(res => {
+ this.setData({
+ painter_ready: true
+ })
}).catch(errors => {console.error(errors);})
},
onImgOK(e){
@@ -231,10 +237,15 @@ Page({
visible: e.detail.visible,
});
},
-
showVisible(){
this.setData({
visible: !this.data.visible,
});
- }
+ },
+ // onShareAppMessage(e) {
+ // return {
+ // title: '自定义转发标题',
+ // path: '/Pages/yishi/mycard/index',
+ // }
+ // }
})
\ No newline at end of file
diff --git a/Pages/yishi/mycard/index.json b/Pages/yishi/mycard/index.json
index 8782e70..203cb1b 100644
--- a/Pages/yishi/mycard/index.json
+++ b/Pages/yishi/mycard/index.json
@@ -4,7 +4,7 @@
"te-nav-bar": "/commpents/te_navbar",
"painter":"/commpents/painter/painter",
"t-avatar": "tdesign-miniprogram/avatar/avatar",
- "t-image": "tdesign-miniprogram/image/image",
+ "van-image": "@vant/weapp/image/index",
"t-icon": "tdesign-miniprogram/icon/icon",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
diff --git a/Pages/yishi/mycard/index.wxml b/Pages/yishi/mycard/index.wxml
index 5c75851..e04e41c 100644
--- a/Pages/yishi/mycard/index.wxml
+++ b/Pages/yishi/mycard/index.wxml
@@ -14,34 +14,21 @@
-
- 微信长按或扫描二维码查看我的更多信息
+
+ 让您的患者微信扫码,线上复诊更便捷
-
+
-
-
- 保存至相册
+ 保存到相册,分享到朋友圈
@@ -56,4 +43,4 @@
/>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/Pages/yishi/mycard/index.wxss b/Pages/yishi/mycard/index.wxss
index 08ff85e..1ed2838 100644
--- a/Pages/yishi/mycard/index.wxss
+++ b/Pages/yishi/mycard/index.wxss
@@ -93,7 +93,7 @@
.header {
display: flex;
align-items: center;
- height: 116rpx;
+ padding: 20rpx ;
}
.title {
@@ -127,6 +127,6 @@
}
.t_icon{
background-color: #3B83FF;
- padding: 40rpx;
+ padding: 30rpx;
border-radius: 50%;
}
diff --git a/Pages/yishi/myinfo/index.js b/Pages/yishi/myinfo/index.js
index b31a021..9c80c64 100644
--- a/Pages/yishi/myinfo/index.js
+++ b/Pages/yishi/myinfo/index.js
@@ -7,14 +7,18 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '我的信息', //导航栏 中间的标题
},
- height: app.globalData.height,
+ height: app.globalData.height,
card_name: "",
card_num_mask: "",
doctor_id: "",
idcard_status: 0,
iden_auth_status: 0,
+ is_bind_bank: 0,
user_name: "",
- brief_introduction: "点击编辑"
+ brief_introduction: "点击编辑",
+ v_show: false,
+ v_message: "",
+ next_url: "/Pages/yishi/identity/index"
},
onLoad(){
//获取医生我的账户数据
@@ -22,7 +26,7 @@ Page({
console.log(response);
this.setData({
doctor_id: response.data.doctor_id,
- brief_introduction:response.data.brief_introduction,
+ brief_introduction: response.data.brief_introduction==null?this.data.brief_introduction:response.data.brief_introduction,
idcard_status:response.data.idcard_status,
iden_auth_status:response.data.iden_auth_status,
card_name:response.data.card_name,
@@ -30,6 +34,14 @@ Page({
})
}).catch(errors => {console.error(errors);})
},
+ onShow(){
+ let usertype = wx.getStorageSync('usertype');
+ let user_id = wx.getStorageSync("user_id_"+usertype);
+ let is_bind_bank = wx.getStorageSync(user_id+'_is_bind_bank');
+ this.setData({
+ is_bind_bank: is_bind_bank
+ })
+ },
logOut(){
console.log("退出登录");
wx.showModal({
@@ -38,15 +50,89 @@ Page({
success (res) {
if (res.confirm) {
console.log('用户点击确定')
- wx.setStorageSync('AUTH_TOKEN', "");
- wx.setStorageSync('user_id', "");
- wx.setStorageSync('client_user_id', "");
+ let usertype = wx.getStorageSync('usertype');
+ wx.setStorageSync('AUTH_TOKEN_'+usertype, "");
+ wx.setStorageSync('user_id_'+usertype, "");
+
+ wx.setStorageSync('client_user_id_'+usertype, "");
+ app.imLogout();
+ app.globalData.isLogin=false;
+ wx.setStorageSync('usertype','')
app.go("/Pages/index/index");
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
+ },
+ go(e){
+ console.log(2222)
+ if(this.data.idcard_status != 1){
+ this.setData({
+ v_show: true,
+ v_message: "请先进行实名认证",
+ next_url: "/Pages/yishi/identity/index"
+ })
+ return;
+ }
+ if(this.data.iden_auth_status != 1){
+ this.setData({
+ v_show: true,
+ v_message: "请先进行医师身份认证",
+ next_url: "/Pages/yishi/identity/index?selected_tab=1",
+ })
+ return;
+ }
+ if(this.data.is_bind_bank != 1){
+ this.setData({
+ v_show: true,
+ v_message: "请您先绑定结算银行卡",
+ next_url: "/Pages/yishi/bankcard/index",
+ })
+ return;
+ }
+ app.go(e.currentTarget.dataset.url)
+ },
+ go1(e){
+ if(this.data.idcard_status != 1){
+ this.setData({
+ v_show: true,
+ v_message: "请先进行实名认证",
+ next_url: "/Pages/yishi/identity/index"
+ })
+ return;
+ }
+ app.go(e.currentTarget.dataset.url)
+ },
+ go2(e){
+ if(this.data.idcard_status != 1){
+ this.setData({
+ v_show: true,
+ v_message: "请先进行实名认证",
+ next_url: "/Pages/yishi/identity/index"
+ })
+ return;
+ }
+ if(this.data.iden_auth_status != 1){
+ this.setData({
+ v_show: true,
+ v_message: "请先进行医师身份认证",
+ next_url: "/Pages/yishi/identity/index?selected_tab=1",
+ })
+ return;
+ }
+ app.go(e.currentTarget.dataset.url)
+ },
+ goIn(){
+ this.setData({
+ v_show: false
+ })
+ app.go(this.data.next_url)
+ },
+ cancelDialog(){
+ this.setData({
+ v_show: false
+ })
}
})
\ No newline at end of file
diff --git a/Pages/yishi/myinfo/index.json b/Pages/yishi/myinfo/index.json
index c97fb39..50f4f38 100644
--- a/Pages/yishi/myinfo/index.json
+++ b/Pages/yishi/myinfo/index.json
@@ -4,6 +4,7 @@
"te-nav-bar": "/commpents/te_navbar",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
- "van-button": "@vant/weapp/button/index"
+ "van-button": "@vant/weapp/button/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/myinfo/index.wxml b/Pages/yishi/myinfo/index.wxml
index 4e7d9a7..f2b65cf 100644
--- a/Pages/yishi/myinfo/index.wxml
+++ b/Pages/yishi/myinfo/index.wxml
@@ -1,13 +1,38 @@
-
-
-
-
+
+
+
+
+
退出登录
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/myinfo/index.wxss b/Pages/yishi/myinfo/index.wxss
index e69de29..da60a2d 100644
--- a/Pages/yishi/myinfo/index.wxss
+++ b/Pages/yishi/myinfo/index.wxss
@@ -0,0 +1,22 @@
+.van-cell__value {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
+.van-cell {
+ padding: 32rpx !important;
+}
\ No newline at end of file
diff --git a/Pages/yishi/myprofile/index.js b/Pages/yishi/myprofile/index.js
index a296466..d64b7a4 100644
--- a/Pages/yishi/myprofile/index.js
+++ b/Pages/yishi/myprofile/index.js
@@ -5,9 +5,21 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '我的简介', //导航栏 中间的标题
},
+ page_meta_show: false
},
goBack(){
wx.navigateBack();
+ },
+ showPageMeta(){
+ console.log("showPageMeta from indenity");
+ this.setData({
+ page_meta_show: true
+ })
+ },
+ hidePageMeta(){
+ console.log("hidePageMeta from indenity");
+ this.setData({
+ page_meta_show: false
+ })
}
-
})
\ No newline at end of file
diff --git a/Pages/yishi/myprofile/index.wxml b/Pages/yishi/myprofile/index.wxml
index 7b691fc..8956852 100644
--- a/Pages/yishi/myprofile/index.wxml
+++ b/Pages/yishi/myprofile/index.wxml
@@ -1,5 +1,10 @@
+
+
-
-
+
+
\ No newline at end of file
diff --git a/Pages/yishi/myprofile/index.wxss b/Pages/yishi/myprofile/index.wxss
index 093c13b..dc3ba9f 100644
--- a/Pages/yishi/myprofile/index.wxss
+++ b/Pages/yishi/myprofile/index.wxss
@@ -1,46 +1,50 @@
-/* .container{
- padding-bottom: 50rpx;
-} */
-.t-cell__note {
- font-size: 25rpx !important;
- letter-spacing: 2rpx;
+.t-cell__note,.t-class-note,.note{
+ font-size: 16px !important;
}
-.t-cell__title-text{
- font-size: 30rpx !important;
+.t-tabs__item--active{
+ color: #49B9AD !important;
}
-.t-input__wrap--suffix-icon{
- padding-left: var(--td-spacer-1, 8rpx) !important;
+.t-tabs__track{
+ background-color: #49B9AD !important;
+}
+.t-icon-check{
+ color: #49B9AD !important;
+}
+.zhuanchang_btn--confirm {
+ color: #3cc7c0;
+}
+.van-picker__cancel{
+ font-size: 32rpx !important;
+}
+.van-picker__confirm{
+ color: #3cc7c0 !important;
+ font-size: 32rpx !important;
+}
+.van-picker__title {
+ font-size: 34rpx !important;
+}
+.van-cell {
+ padding: 32rpx !important;
}
-.container {
- width: 100vw;
- background-color: #ffffff;
+/* 自定义医院搜索框样式 */
+.van-search__field .van-cell{
+ padding: 10rpx !important;
}
-.tui-navigatorbar{
- position: fixed;
- top: 0;
- width: 750rpx;
- height: 170rpx;
- background-color: #bae46b;
- z-index: 99;
+.van-picker__columns {
+ height: 264px !important;
+ top: 40px !important;
}
-.tui-navigatorbar-back{
+.van-search {
+ top: -270px !important;
+ position: relative !important;
+}
+.van-empty{
position: absolute;
- width: 48rpx;
- height: 48rpx;
- left: 40rpx;
- bottom: 20rpx;
-}
-.conversation-title {
- position:absolute;
- width: 350rpx;
- height: 88rpx;
- line-height: 56rpx;
- font-size: 36rpx;
- color: #e68080;
- bottom: 0;
- left: 200rpx;
- display: flex;
- justify-content: center;
- align-items: center;
-}
+ width: 100%;
+ left: 50%;
+ top: 180rpx;
+ transform: translateX(-50%);
+ z-index: 9999999;
+ background: rgb(255, 255, 255);
+}
\ No newline at end of file
diff --git a/Pages/yishi/notice_deatil/index.js b/Pages/yishi/notice_deatil/index.js
index efef67f..e73a51c 100644
--- a/Pages/yishi/notice_deatil/index.js
+++ b/Pages/yishi/notice_deatil/index.js
@@ -1,3 +1,5 @@
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
data: {
@@ -5,7 +7,25 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '公告详情', //导航栏 中间的标题
},
- height: app.globalData.height,
+ height: app.globalData.height,
+ notice: {}
+ },
+ onLoad(options){
+ let notice_id = options.notice_id;
+ api.getDoctorMessageSystemDetail({notice_id: notice_id}).then(response => {
+ console.log(response);
+ this.setData({
+ notice: response.data
+ })
+ }).catch(errors => {console.error(errors);})
+ },
+ go(e){
+ let link_type = this.data.notice.link_type;
+ let link_params = this.data.notice.link_params;
+ wx.showToast({
+ title: '无数据,不能调试',
+ icon: "error"
+ })
}
})
\ No newline at end of file
diff --git a/Pages/yishi/notice_deatil/index.wxml b/Pages/yishi/notice_deatil/index.wxml
index f0020fe..7000760 100644
--- a/Pages/yishi/notice_deatil/index.wxml
+++ b/Pages/yishi/notice_deatil/index.wxml
@@ -3,20 +3,24 @@
发信人:
- 肝胆小秘书
+ {{notice.from_name}}
标题:
- 9月份的服务费结算
+ {{notice.notice_title}}
时间:
- 2022-11-02 12:22:11
+ {{notice.notice_send_time}}
内容:
- XX医生您好,您9月份的服务费已结算至您的银行卡,请注意查收。
+ {{notice.notice_content}}
- 我的账户
+ 我的账户
+ 联系客服
+ 查看协议
+ 订单详情
+ 查看处方
\ No newline at end of file
diff --git a/Pages/yishi/notice_deatil/index.wxss b/Pages/yishi/notice_deatil/index.wxss
index 866e79d..87657d4 100644
--- a/Pages/yishi/notice_deatil/index.wxss
+++ b/Pages/yishi/notice_deatil/index.wxss
@@ -1,6 +1,7 @@
-.container{
+page{
background-color: #F4F4F4;
- height: 100vh;
+}
+.container{
width: 100vw;
}
.data{
@@ -10,7 +11,7 @@
}
.item{
display: flex;
- margin-bottom: 30rpx;
+ margin-bottom: 40rpx;
}
.title{
flex: 1;
diff --git a/Pages/yishi/notify/notify.js b/Pages/yishi/notify/notify.js
new file mode 100644
index 0000000..91460c9
--- /dev/null
+++ b/Pages/yishi/notify/notify.js
@@ -0,0 +1,93 @@
+// pages/notify/notigy.js
+import { API } from './../../../utils/network/api'
+let api = new API()
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '消息通知', //导航栏 中间的标题
+ },
+ checked:true,
+ },
+ onChangeSwitch({ detail }){
+ this.setData({ checked: detail });
+ this.handleEditConfig(detail);
+ },
+ handleEditConfig(detail){
+ let is_accept_im_message_push=detail?1:0;
+ api.editConfig({is_accept_im_message_push:is_accept_im_message_push}).then(data=>{
+ wx.showToast({
+ title: '设置成功',
+ icon:"none"
+ })
+ })
+ },
+ handleGetConfig(){
+ api.getConfig().then(data=>{
+ let result=data.data;
+ this.setData({
+ checked:result.is_accept_im_message_push==1?true:false
+ })
+ })
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.handleGetConfig();
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/notify/notify.json b/Pages/yishi/notify/notify.json
new file mode 100644
index 0000000..4085181
--- /dev/null
+++ b/Pages/yishi/notify/notify.json
@@ -0,0 +1,9 @@
+{
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-cell": "@vant/weapp/cell/index",
+ "van-cell-group": "@vant/weapp/cell-group/index",
+ "van-switch": "@vant/weapp/switch/index"
+ },
+ "navigationStyle":"custom"
+}
\ No newline at end of file
diff --git a/Pages/yishi/notify/notify.wxml b/Pages/yishi/notify/notify.wxml
new file mode 100644
index 0000000..d7c38b7
--- /dev/null
+++ b/Pages/yishi/notify/notify.wxml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Pages/yishi/notify/notify.wxss b/Pages/yishi/notify/notify.wxss
new file mode 100644
index 0000000..1109b94
--- /dev/null
+++ b/Pages/yishi/notify/notify.wxss
@@ -0,0 +1,10 @@
+/* pages/notify/notigy.wxss */
+.page{
+ position: relative;
+ overflow: hidden;
+ background: #F2F2F2;
+}
+.right,.title-class{
+
+ margin-top: 10rpx;
+}
diff --git a/Pages/yishi/onlinechufang/index.js b/Pages/yishi/onlinechufang/index.js
index 3e455d7..ee84032 100644
--- a/Pages/yishi/onlinechufang/index.js
+++ b/Pages/yishi/onlinechufang/index.js
@@ -1,5 +1,6 @@
import Toast from '@vant/weapp/toast/toast';
import { API } from './../../../utils/network/api'
+import Dialog from '@vant/weapp/dialog/dialog';
const api = new API()
const app = getApp()
@@ -9,6 +10,8 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '在线开方', //导航栏 中间的标题
},
+ autoHeight:{ minHeight: 100},
+ add_disease_desc:'',//医生填写的病情主诉
height: app.globalData.height,
zhenduan_popshow: false,
drugs_popshow: false,
@@ -21,7 +24,7 @@ Page({
drug_content_show: false,
search_drug_list_empty: true,
search_drug_list: [],
- select_drug_name: "",
+ product_name: "",
select_drug_id: "",
save_durg_product_id: "",
save_durg_prescription_product_num: "",
@@ -29,15 +32,69 @@ Page({
save_durg_single_use: "",
save_durg_packaging_unit: "",
save_durg_frequency_use: "",
- save_durg_available_days: ""
+ save_durg_available_days: "",
+ order_inquiry_id: "",
+ order_prescription_id: "",
+ doctor_advice: "",
+ prescription_num:0,
+ doctors_advice_focus: false,
+ case_detail: {},
+ sub_disabled: false,
+ from: "",
+ now_filed_focus: 'save_durg_prescription_product_num',
+ page_meta_show: true,
+ static_host: api.getStaticHost()
+ },
+ changeFocus(e){
+ let next_filed_focus = e.currentTarget.dataset.next_filed_focus;
+ this.setData({
+ now_filed_focus: next_filed_focus
+ })
+ },
+ onDoctorsAdviceFocus(){
+ this.setData({
+ doctors_advice_focus: true
+ })
+ },
+ onLoad(options){
+ let from = options.from;
+ let order_inquiry_id = options.order_inquiry_id;
+ let order_prescription_id = options.order_prescription_id ;
+ //获取患者问诊病例
+ api.getInquiryDetail({order_inquiry_id: order_inquiry_id}).then(response => {
+ console.log(response);
+ this.setData({
+ case_detail: response.data
+ })
+ }).then(res => {
+ //有处方id,才去请求详情
+ if(order_prescription_id){
+ this.getDoctorPrescriptionInfo(order_inquiry_id, order_prescription_id);
+ }
+ }).catch(errors => {console.error(errors);})
+ this.setData({
+ order_inquiry_id: order_inquiry_id,
+ order_prescription_id: order_prescription_id,
+ from: from
+ })
+ if(from == 'chat'){
+ this.setData({
+ "navbarData.title": '处方详情'
+ })
+ }
},
-
select_drug(e){
this.setData({
drug_content_show: true,
- select_drug_name: e.currentTarget.dataset.product_name,
+ prescription_num:e.currentTarget.dataset.prescription_num,
+ product_name: e.currentTarget.dataset.product_name,
select_drug_id: e.currentTarget.dataset.product_id,
- save_durg_product_id: e.currentTarget.dataset.product_id
+ save_durg_product_id: e.currentTarget.dataset.product_id,
+ save_durg_single_use: e.currentTarget.dataset.single_use,
+ save_durg_frequency_use: e.currentTarget.dataset.frequency_use,
+ save_durg_single_unit: e.currentTarget.dataset.single_unit,
+ save_durg_available_days: e.currentTarget.dataset.available_days,
+ save_durg_packaging_unit: e.currentTarget.dataset.packaging_unit,
});
},
showPopup() {
@@ -88,11 +145,34 @@ Page({
let product_id = this.data.save_durg_product_id;
this.delDrugBox(product_id);
+ let save_durg_prescription_product_num = this.data.save_durg_prescription_product_num;
+ if(!save_durg_prescription_product_num || save_durg_prescription_product_num <0){
+ Dialog.alert({
+ message: '请输入药品数量',
+ }).then(() => {
+ this.setData({
+ save_durg_prescription_product_num: ""
+ })
+ });
+ return
+ };
+ let prescription_num=this.data.prescription_num?this.data.prescription_num:5
+ if(save_durg_prescription_product_num>prescription_num){
+ Dialog.alert({
+ message: '药品数量不能超过'+this.data.prescription_num+"个",
+ }).then(() => {
+ this.setData({
+ save_durg_prescription_product_num:''
+ })
+ });
+ return
+ };
let save_durg = {};
- save_durg.select_drug_name = this.data.select_drug_name;
+ save_durg.product_name = this.data.product_name;
save_durg.product_id = this.data.save_durg_product_id;
save_durg.prescription_product_num = this.data.save_durg_prescription_product_num;
+
save_durg.single_unit = this.data.save_durg_single_unit;
save_durg.single_use = this.data.save_durg_single_use;
save_durg.packaging_unit = this.data.save_durg_packaging_unit;
@@ -103,7 +183,7 @@ Page({
this.setData({
drugs_box_item_list: list,
drugs_popshow: false,
- select_drug_name: "",
+ product_name: "",
drug_content_show: false,
search_drug_list: [],
save_durg_product_id: "",
@@ -134,8 +214,8 @@ Page({
search(){
//搜索诊断
let params = {};
- params.disease_class_name = this.data.disease_class_name;
- api.getBasicDiseaseSearch(params).then(response => {
+ params.icd_keyword = this.data.disease_class_name;
+ api.getBasicIcdSearch(params).then(response => {
console.log(response);
this.setData({
zhenduan_search_list: response.data
@@ -147,9 +227,12 @@ Page({
searchDrug(){
//搜索药品
let params = {};
- params.product_keyword = this.data.select_drug_name;
+ params.product_keyword = this.data.product_name;
api.getBasicProductSearch(params).then(response => {
console.log(response);
+ this.setData({
+ drug_content_show: false
+ })
if(response.data.length > 0){
this.setData({
search_drug_list_empty: false,
@@ -177,17 +260,17 @@ Page({
})
},
addZhenDuan(e){
- let disease_class_name = e.currentTarget.dataset.disease_class_name;
- let disease_class_id = e.currentTarget.dataset.disease_class_id;
- console.log("disease_class_name: ", disease_class_name);
- console.log("disease_class_id: ", disease_class_id);
+ let icd_name = e.currentTarget.dataset.icd_name;
+ let icd_id = e.currentTarget.dataset.icd_id;
+ console.log("icd_name: ", icd_name);
+ console.log("icd_id: ", icd_id);
let disease_obj = {};
- disease_obj.disease_class_name = disease_class_name;
- disease_obj.disease_class_id = disease_class_id;
+ disease_obj.icd_name = icd_name;
+ disease_obj.icd_id = icd_id;
let list = this.data.zhenduan_list;
let find_index = list.findIndex(item => {
- return item.disease_class_id == disease_class_id
+ return item.icd_id == icd_id
});
if(find_index == -1){
list.push(disease_obj);
@@ -202,7 +285,7 @@ Page({
console.log("disease_class_id: ", disease_class_id);
let list = this.data.zhenduan_list;
let find_index = list.findIndex(item => {
- return item.disease_class_id == disease_class_id
+ return item.icd_id == disease_class_id
});
console.log("find_idex: ", find_index)
list.splice(find_index, 1);
@@ -225,7 +308,7 @@ Page({
console.log(drug);
this.setData({
drugs_popshow: true,
- select_drug_name: drug.select_drug_name,
+ product_name: drug.product_name,
drug_content_show: true,
save_durg_product_id: drug.product_id,
save_durg_prescription_product_num: drug.prescription_product_num,
@@ -253,5 +336,233 @@ Page({
drugs_box_item_list: list
})
}
+ },
+ onChangeTextAraa(event){
+ this.setData({
+ add_disease_desc:event.detail
+ })
+ },
+ getAdvice(e){
+ console.log(e.detail.value)
+ this.setData({
+ doctor_advice: e.detail.value
+ })
+ },
+ postDoctorPrescription(e){//新增处方
+
+ let sub_disabled = this.data.sub_disabled;
+ if(sub_disabled) return
+
+ console.log("postDoctorPrescription postDoctorPrescription");
+ //先置灰,避免重复提交
+ this.setData({
+ sub_disabled: true
+ })
+
+ let params = {};
+ params.order_inquiry_id = this.data.order_inquiry_id;
+ params.doctor_advice = this.data.doctor_advice;
+ let prescription_icd = [];
+ this.data.zhenduan_list.forEach(item => {
+ prescription_icd.push(item.icd_id);
+ })
+ params.prescription_icd = prescription_icd;
+ params.prescription_product = this.data.drugs_box_item_list;
+
+ console.log(params);
+ //糖组检测需要填病情主诉;
+ let disease_desc=this.data.case_detail.disease_desc;
+ params.disease_desc=disease_desc?disease_desc:this.data.add_disease_desc;
+ if(!params.disease_desc){
+ wx.showToast({
+ title: '请填写病情主诉',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+ if(prescription_icd.length == 0){
+ wx.showToast({
+ title: '请选择诊断',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+ if(params.prescription_product.length == 0){
+ wx.showToast({
+ title: '请选择药品',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+ if(this.data.doctor_advice == ""){
+ wx.showToast({
+ title: '请填写医嘱',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+ if(this.data.doctor_advice.length < 5 || this.data.doctor_advice.length > 200){
+ wx.showToast({
+ title: '医嘱字数5-20',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+
+
+ api.postDoctorPrescription(params).then(response => {
+ console.log(response);
+ wx.showToast({
+ title: '提交成功',
+ icon: "success"
+ })
+ setTimeout(() => {
+ wx.navigateBack();
+ }, 1000);
+ }).catch(errors => {
+ console.error(errors);
+ this.setData({
+ sub_disabled: false
+ })
+ })
+ },
+ get_save_durg_prescription_product_num(e){
+ console.log("get_save_durg_prescription_product_num")
+ let save_durg_prescription_product_num = e.detail
+ console.log(typeof save_durg_prescription_product_num)
+ save_durg_prescription_product_num = Number.parseInt(save_durg_prescription_product_num)
+ console.log(save_durg_prescription_product_num)
+ if(isNaN(save_durg_prescription_product_num)){
+ Dialog.alert({
+ message: '请输入正确数字',
+ }).then(() => {
+ this.setData({
+ save_durg_prescription_product_num: ""
+ })
+ });
+ return
+ }
+ let prescription_num=this.data.prescription_num?this.data.prescription_num:5
+ if(save_durg_prescription_product_num > prescription_num){
+ Dialog.alert({
+ message: '药品数量不允许添加超过'+prescription_num+'个',
+ }).then(() => {
+ this.setData({
+ save_durg_prescription_product_num:''
+ })
+ });
+ return
+ }
+ this.setData({
+ save_durg_prescription_product_num: save_durg_prescription_product_num
+ })
+ },
+ putDoctorPrescription(){//修改处方
+ let sub_disabled = this.data.sub_disabled;
+ if(sub_disabled) return
+
+ console.log("putDoctorPrescription putDoctorPrescription");
+ //先置灰,避免重复提交
+ this.setData({
+ sub_disabled: true
+ })
+
+ let params = {};
+ params.order_prescription_id = this.data.order_prescription_id;
+ params.doctor_advice = this.data.doctor_advice;
+ let prescription_icd = [];
+ this.data.zhenduan_list.forEach(item => {
+ prescription_icd.push(item.icd_id);
+ })
+ params.prescription_icd = prescription_icd;
+ params.prescription_product = this.data.drugs_box_item_list;
+
+ console.log(params);
+
+ if(prescription_icd.length == 0){
+ wx.showToast({
+ title: '请选择诊断',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+ if(params.prescription_product.length == 0){
+ wx.showToast({
+ title: '请选择药品',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+ if(this.data.doctor_advice == ""){
+ wx.showToast({
+ title: '请填写医嘱',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+ if(this.data.doctor_advice.length < 5 || this.data.doctor_advice.length > 200){
+ wx.showToast({
+ title: '医嘱字数5-20',
+ icon: "error"
+ })
+ this.setData({
+ sub_disabled: false
+ })
+ return;
+ }
+
+ api.putDoctorPrescription(params).then(response => {
+ console.log(response);
+ wx.showToast({
+ title: '提交成功',
+ icon: "success"
+ })
+ setTimeout(() => {
+ wx.navigateBack();
+ }, 1000);
+ }).catch(errors => {
+ console.error(errors);
+ this.setData({
+ sub_disabled: false
+ })
+ })
+ },
+ getDoctorPrescriptionInfo(order_inquiry_id, order_prescription_id){//获取处方详情
+ let params = {};
+ params.order_inquiry_id = order_inquiry_id;
+ params.order_prescription_id = order_prescription_id;
+ api.getDoctorPrescriptionInfo(params).then(response => {
+ console.log(response);
+ this.setData({
+ doctor_advice: response.data.prescription.doctor_advice,
+ pharmacist_audit_status: response.data.prescription.pharmacist_audit_status,
+ zhenduan_list: response.data.prescription_icd,
+ drugs_box_item_list: response.data.prescription_product
+ })
+ }).catch(errors => {console.error(errors);})
}
})
\ No newline at end of file
diff --git a/Pages/yishi/onlinechufang/index.json b/Pages/yishi/onlinechufang/index.json
index 705f3c9..03447a9 100644
--- a/Pages/yishi/onlinechufang/index.json
+++ b/Pages/yishi/onlinechufang/index.json
@@ -11,6 +11,7 @@
"van-search": "@vant/weapp/search/index",
"van-image": "@vant/weapp/image/index",
"van-toast": "@vant/weapp/toast/index",
- "van-icon": "@vant/weapp/icon/index"
+ "van-icon": "@vant/weapp/icon/index",
+ "van-dialog": "@vant/weapp/dialog/index"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/onlinechufang/index.wxml b/Pages/yishi/onlinechufang/index.wxml
index 64ecba7..3678521 100644
--- a/Pages/yishi/onlinechufang/index.wxml
+++ b/Pages/yishi/onlinechufang/index.wxml
@@ -1,21 +1,23 @@
-
-
+
+
+
- 张三三
- 男 | 30岁
- 查看病历
+ {{case_detail.name}}
+ {{case_detail.sex==1?'男':case_detail.sex==2?'女':'未知'}}|{{case_detail.age}}岁
+ 查看病历
-
+
病情主诉:
- 头疼,腰疼、肩膀酸、等症状已经困,头疼,腰疼、肩膀酸、等症状已经困
+
+ {{case_detail.disease_desc}}
-
+
用药意向:
- 肝功能异常
+ {{item}};
-
+
编辑
删除
-
- +添加药品
+
+ +添加药品
+
-
- 提交审核
-
-
+
添加药品
药品名称
-
+
-
+
-
- {{item.product_name}}
- {{item.manufacturer}}
+
+ {{item.product_name}}
+ {{item.manufacturer}}
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
保存
@@ -170,40 +117,22 @@
-
-
+
+
-
- 诊断
-
+
+ 诊断
+
-
- {{item.disease_class_name}}
+
+ {{item.icd_name}}
+
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/onlinechufang/index.wxss b/Pages/yishi/onlinechufang/index.wxss
index acd0f86..31d3ad7 100644
--- a/Pages/yishi/onlinechufang/index.wxss
+++ b/Pages/yishi/onlinechufang/index.wxss
@@ -2,9 +2,6 @@ page{
background-color: #F6F6F6;
}
.container{
- width: 100vw;
- height: 100vh;
- background-color: #F6F6F6;
letter-spacing: 3rpx;
}
.item{
@@ -15,10 +12,9 @@ page{
}
.item_top{
position: relative;
- height: 100rpx;
display: flex;
align-items: center;
- padding: 0 32rpx;
+ padding: 20rpx 32rpx;
}
.item_top::after {
position: absolute;
@@ -33,12 +29,12 @@ page{
}
.item_top_name{
- flex: 1;
color: #3CC7C0;
font-size: 34rpx;
+ margin-right: 20rpx;
}
.item_top_sex{
- flex: 3;
+ flex: 1;
font-size: 34rpx;
color: #666;
}
@@ -56,6 +52,9 @@ page{
display: flex;
padding-bottom: 20rpx;
}
+.item_content_li.active{
+ flex-direction: column;
+}
.item_content_li_title{
font-size: 30rpx;
color: #333333;
@@ -65,13 +64,16 @@ page{
flex: 1;
color: #666666;
font-size: 28rpx;
+ word-wrap:break-word;
+ word-break:break-all;
}
.txt_title{
- font-size: 30rpx;
+ font-size: 16px;
margin: 20rpx 0;
position: relative;
left: 4vw;
+ width: 50vw;
}
.drugs_box{
width: 92vw;
@@ -80,9 +82,11 @@ page{
border-radius: 20rpx;
}
.drugs_box_item{
- border-bottom: 1px solid red;
padding: 20rpx 20rpx 20rpx 20rpx;
}
+.drugs_box_item:not(:first-child){
+ border-top: 1px solid #E7E7E7;
+}
.drugs_name{
color: #333333;
font-size: 32rpx;
@@ -104,7 +108,7 @@ page{
.doctors_advice{
position: relative;
width: calc(92vw - 40rpx);
- height: 100rpx;
+ min-height: 100rpx;
margin: 20rpx auto;
background-color: rgb(255, 255, 255);
border-radius: 20rpx;
@@ -196,6 +200,10 @@ page{
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #E7E7E7;
+ width: 90%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
.label_item{
display: flex;
diff --git a/Pages/yishi/onlinesetup/index.js b/Pages/yishi/onlinesetup/index.js
index fe21f1a..8e22fd0 100644
--- a/Pages/yishi/onlinesetup/index.js
+++ b/Pages/yishi/onlinesetup/index.js
@@ -1,5 +1,7 @@
import { API } from './../../../utils/network/api'
-import Toast from '@vant/weapp/toast/toast';
+import Toast from 'tdesign-miniprogram/toast/index';
+import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
+
let api = new API()
const app = getApp()
Page({
@@ -19,6 +21,7 @@ Page({
inquiry_price: 0,
work_num_day: 0
},
+ myprice: "",
config:{
"max_work_num_day": 30,
"min_inquiry_price": 0,
@@ -31,10 +34,11 @@ Page({
"5",
"10"
]
- }
+ },
+ sub_visible: false,
},
onLoad(){
- this.setData({ note: this.data.open_note });
+
},
onShow(){
let params = {};
@@ -46,65 +50,131 @@ Page({
this.setData({
info: response.data.info,
config: response.data.config,
+ note: response.data.info.is_open == 1? this.data.open_note : this.data.close_note
})
}).catch(errors => {console.error(errors);})
},
+ changeON(){
+ let is_open = this.data.info.is_open
+ console.log("changeON:", is_open)
+ let detail = false
+ if(is_open == 0){
+ detail = true
+ }else{
+ detail = false
+ }
+ this.doChange(detail)
+ },
onChange({ detail }) {
+ this.doChange(detail)
+ },
+ doChange(detail){
console.log("onChange: ", detail);
+ let is_open = 0;
if(detail){
+ let inquiry_price = this.data.info.inquiry_price;
+ let check = this.checkPrice(inquiry_price);
+ if(!check) return;
this.setData({ note: this.data.open_note });
+ wx.vibrateShort({
+ "type": "heavy"
+ })
+ is_open = 1
}else{
this.setData({ note: this.data.close_note });
+ is_open = 0
}
- this.setData({ "info.is_open": detail });
+ this.setData({ "info.is_open": is_open });
//修改开关
let params = {};
params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
- params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
params.is_open = detail?1:0;
api.putDoctorInquiryOpen(params).then(response => {
console.log(response);
+ }).then(()=>{
+ if(detail){
+
+ let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
+ this.setData({
+ sub_visible: true,
+ })
+ }
+ })
+
+ }
}).catch(errors => {console.error(errors);})
},
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ console.log(res.authSetting)
+ }
+ })
+ },
putDoctorInquiryConfig(){
//修改医生问诊配置
- let params = {};
- params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
- params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
- params.inquiry_price = this.data.info.inquiry_price;
- params.work_num_day = this.data.info.work_num_day;
- api.putDoctorInquiryConfig(params).then(response => {
- console.log(response);
- Toast.success("修改成功");
- wx.switchTab({
- url: "/Pages/yishi/wenzhen/wenzhen"
- })
- }).catch(errors => {console.error(errors);})
+ // let params = {};
+ // params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
+ // params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ // params.inquiry_price = this.data.info.inquiry_price;
+ // params.work_num_day = this.data.info.work_num_day;
+ // api.putDoctorInquiryConfig(params).then(response => {
+ // console.log(response);
+ // Toast.success("修改成功");
+ // wx.switchTab({
+ // url: "/Pages/yishi/wenzhen_v2/wenzhen"
+ // })
+ // }).catch(errors => {console.error(errors);})
+
+ wx.switchTab({
+ url: "/Pages/yishi/wenzhen_v2/wenzhen"
+ })
+
},
- onStepperChange(event) {
- console.log(event.detail);
- this.setData({
- "info.work_num_day": event.detail
+ myToast(message){
+ Toast({
+ context: this,
+ selector: '#t-toast',
+ message: message,
+ theme: 'error',
+ direction: 'column',
});
},
- onPriceChange(e){
- console.log(e.detail);
- let value = e.detail.value;
- let min = this.data.config.min_inquiry_price;
- let max = this.data.config.max_inquiry_price;
+ checkPrice(price){
+ let value = Number(price);
+ let min = Number(this.data.config.min_inquiry_price);
+ let max = Number(this.data.config.max_inquiry_price);
if(value < min){
value = min;
- Toast.fail('价格不能低于' + min + '元');
+ let message = '价格不能低于' + min + '元';
+ this.myToast(message);
+ return false;
}else if(value >= min && value <=max ){
- value = value;
+ return true;
}else{
value = max;
- Toast.fail('价格不能高于' + max + '元');
+ let message = '价格不能高于' + max + '元';
+ this.myToast(message);
+ return false;
}
- this.setData({
- "info.inquiry_price": value
- })
- }
+ },
})
\ No newline at end of file
diff --git a/Pages/yishi/onlinesetup/index.json b/Pages/yishi/onlinesetup/index.json
index 71178ef..932d65d 100644
--- a/Pages/yishi/onlinesetup/index.json
+++ b/Pages/yishi/onlinesetup/index.json
@@ -7,6 +7,7 @@
"van-stepper": "@vant/weapp/stepper/index",
"van-switch": "@vant/weapp/switch/index",
"van-button": "@vant/weapp/button/index",
- "van-toast": "@vant/weapp/toast/index"
+ "t-toast": "tdesign-miniprogram/toast/toast",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/onlinesetup/index.wxml b/Pages/yishi/onlinesetup/index.wxml
index 86b7b3d..a3f2bd4 100644
--- a/Pages/yishi/onlinesetup/index.wxml
+++ b/Pages/yishi/onlinesetup/index.wxml
@@ -1,57 +1,67 @@
-
+
-
+
接诊开关
+ checked="{{ info.is_open==1 }}" />
{{ note }}
-
+
-
+
价格设置
-
- 每日接诊数量
-
-
+
+
+ {{info.work_num_day}}
-
-
- 问诊单价(元)
-
-
- 元
+
+
+
+ {{info.inquiry_price}}
+ 元
-
+
- 提示:服务开通后,患者可以向您购买图文问诊进行问诊,接诊后需要与患者进行图文沟通
- 1、问诊价格每日仅限调整1次,每自然月仅限调整5次
- 2、单价修改后立即生效,不影响当日已生成的问诊订单
- 3、接诊后,患者可与您在{{config.duration/60}}小时内进行{{config.times_number}}个回合沟通
- 4、如有参加公益问诊活动,患者问诊订单价格以参加的公益问诊单价为准
+ 提示:服务开启后,患者按照所设置的价格向您购买图文问诊服务
+ 1、接诊后,患者可与您在{{config.duration/60}}小时内进行{{config.times_number}}回合沟通
+ 2、若开启公益问诊,图文问诊价格以公益问诊价格为准
+ 3、每日接诊数量和问诊价格每日仅限调整1次,每月仅限调整5次
+ 4、价格修改后立即生效,不影响修改之前已生成的问诊订单
-
- 去接诊
+
+ 去接诊
-
+
+
+
+
+ 取消
+
+
+ 确定
+
+
\ No newline at end of file
diff --git a/Pages/yishi/onlinesetup/index.wxss b/Pages/yishi/onlinesetup/index.wxss
index c71917e..826b82a 100644
--- a/Pages/yishi/onlinesetup/index.wxss
+++ b/Pages/yishi/onlinesetup/index.wxss
@@ -1,6 +1,8 @@
+page{
+ background-color: #F6F6F6;
+}
.container{
width: 100vw;
- background-color: #F6F6F6;
padding-top: 30rpx;
}
.switch_box{
@@ -37,7 +39,7 @@
}
.switch_box_item_name{
flex: 1;
- font-size: 32rpx;
+ font-size: 16px;
}
.switch_box_item_btn{
flex: 1;
@@ -52,13 +54,14 @@
}
.price_title{
width: 90vw;
- margin: 0 auto;
+ margin: 20rpx auto 0 auto;
font-size: 32rpx;
margin-bottom: 20rpx;
- font-family: "AlibabaPuHuiTi-2-55-Regular";
+ /* font-family: "AlibabaPuHuiTi-2-55-Regular"; */
color: #333333;
}
.price_steup_box{
+ padding-top: 10rpx;
display: flex;
width: 90vw;
height: 180rpx;
@@ -71,7 +74,7 @@
position: relative;
display: flex;
justify-content: space-between;
- margin: 20rpx;
+ margin: 20rpx 20rpx 20rpx 30rpx;
align-items: center;
padding-bottom: 20rpx;
}
@@ -79,7 +82,7 @@
position: relative;
display: flex;
justify-content: space-between;
- margin: 0rpx 20rpx 0rpx 20rpx;
+ margin: 0rpx 20rpx 0rpx 30rpx;
align-items: center;
}
.price_steup_box_top_title, .price_steup_box_bottom_title{
@@ -110,7 +113,7 @@
}
.bottom{
width: 90vw;
- margin: 0 auto;
+ margin: -20rpx auto;
color: #999;
letter-spacing: 2rpx;
font-size: 28rpx;
@@ -131,4 +134,21 @@
.price{
text-align: center;
flex: 1;
+}
+.cell_value{
+ color: #000;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
}
\ No newline at end of file
diff --git a/Pages/yishi/onlinesetupprice/index.js b/Pages/yishi/onlinesetupprice/index.js
new file mode 100644
index 0000000..5918caa
--- /dev/null
+++ b/Pages/yishi/onlinesetupprice/index.js
@@ -0,0 +1,121 @@
+import { API } from './../../../utils/network/api'
+import Toast from 'tdesign-miniprogram/toast/index';
+let api = new API()
+const app = getApp()
+Page({
+
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '价格设置', //导航栏 中间的标题
+ },
+ inquiry_type: 1,
+ inquiry_mode: 1,
+ info:{
+ is_open: false,
+ inquiry_price: 0,
+ work_num_day: 0
+ },
+ myprice: "",
+ config:{
+ "max_work_num_day": 30,
+ "min_inquiry_price": 0,
+ "max_inquiry_price": 0,
+ "default_inquiry_price": 0,
+ "times_number": 10,
+ "duration": 1440,
+ "system_inquiry_price": [
+ "0",
+ "5",
+ "10"
+ ]
+ }
+ },
+ onShow(){
+ let params = {};
+ params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
+ params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ //获取医生我的账户数据
+ api.getDoctorInquiryConfig(params).then(response => {
+ console.log(response);
+ this.setData({
+ info: response.data.info,
+ config: response.data.config,
+ note: response.data.info.is_open == 1? this.data.open_note : this.data.close_note
+ })
+ }).catch(errors => {console.error(errors);})
+ },
+ onStepperChange(event) {
+ console.log(event.detail);
+ wx.vibrateShort({
+ "type": "heavy"
+ })
+ this.setData({
+ "info.work_num_day": event.detail
+ });
+ },
+ onPriceChange(e){
+ console.log(e.detail);
+ let price = e.detail.value;
+ this.setData({
+ "info.inquiry_price": price
+ })
+
+ },
+ myToast(message){
+ Toast({
+ context: this,
+ selector: '#t-toast',
+ message: message,
+ theme: 'error',
+ direction: 'column',
+ });
+ },
+ checkPrice(price){
+ let value = Number(price);
+ let min = Number(this.data.config.min_inquiry_price);
+ let max = Number(this.data.config.max_inquiry_price);
+ if(value < min){
+ value = min;
+ let message = '价格不能低于' + min + '元';
+ this.myToast(message);
+ return false;
+ }else if(value >= min && value <=max ){
+ return true;
+ }else{
+ value = max;
+ let message = '价格不能高于' + max + '元';
+ this.myToast(message);
+ return false;
+ }
+ },
+ async updateConfig(){
+ let check = this.checkPrice(this.data.info.inquiry_price);
+ console.log("checkcheckcheck:", check);
+ if(!check){
+ return;
+ }
+ //修改医生问诊配置
+ let params = {};
+ params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
+ params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ params.inquiry_price = this.data.info.inquiry_price;
+ params.work_num_day = this.data.info.work_num_day;
+ const result = await api.putDoctorInquiryConfig(params).then(response => {
+ console.log(response);
+ this.myToast("修改成功");
+ return true;
+ }).then(res => {
+ setTimeout(() => {
+ wx.navigateBack();
+
+ }, 1000);
+ }).catch(errors => {
+ console.error(errors);
+ return false;
+ })
+
+ console.log("updateConfig result result: ", result);
+ return result;
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/onlinesetupprice/index.json b/Pages/yishi/onlinesetupprice/index.json
new file mode 100644
index 0000000..5c24cfc
--- /dev/null
+++ b/Pages/yishi/onlinesetupprice/index.json
@@ -0,0 +1,8 @@
+{
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-stepper": "@vant/weapp/stepper/index",
+ "van-button": "@vant/weapp/button/index",
+ "t-toast": "tdesign-miniprogram/toast/toast"
+ }
+}
\ No newline at end of file
diff --git a/Pages/yishi/onlinesetupprice/index.wxml b/Pages/yishi/onlinesetupprice/index.wxml
new file mode 100644
index 0000000..ae9c138
--- /dev/null
+++ b/Pages/yishi/onlinesetupprice/index.wxml
@@ -0,0 +1,34 @@
+
+
+
+
+ 每日接诊数量
+
+
+
+
+
+ 问诊单价
+
+
+ 元
+
+
+
+
+
+
+
+ 提示:服务开启后,患者按照所设置的价格向您购买图文问诊服务
+ 1、接诊后,患者可与您在{{config.duration/60}}小时内进行{{config.times_number}}回合沟通
+ 2、若开启公益问诊,图文问诊价格以公益问诊价格为准
+ 3、每日接诊数量和问诊价格每日仅限调整1次,每月仅限调整5次
+ 4、价格修改后立即生效,不影响修改之前已生成的问诊订单
+
+
+
+
+ 确定
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/onlinesetupprice/index.wxss b/Pages/yishi/onlinesetupprice/index.wxss
new file mode 100644
index 0000000..abac331
--- /dev/null
+++ b/Pages/yishi/onlinesetupprice/index.wxss
@@ -0,0 +1,88 @@
+page{
+ background-color: #F6F6F6;
+}
+.checked_box{
+ margin-top: 30rpx;
+}
+.price_title{
+ width: 90vw;
+ margin: 20rpx auto 0 auto;
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+ /* font-family: "AlibabaPuHuiTi-2-55-Regular"; */
+ color: #333333;
+}
+.price_steup_box{
+ display: flex;
+ width: 90vw;
+ height: 180rpx;
+ margin: 0 auto;
+ border-radius: 20rpx;
+ flex-direction: column;
+ background-color: rgb(255, 255, 255);
+}
+.price_steup_box_top{
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ margin: 20rpx 20rpx 20rpx 30rpx;
+ align-items: center;
+ padding-bottom: 20rpx;
+}
+.price_steup_box_bottom{
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ margin: 0rpx 20rpx 0rpx 30rpx;
+ align-items: center;
+}
+.price_steup_box_top_title, .price_steup_box_bottom_title{
+ flex: 1;
+ font-size: 32rpx;
+ color: #333;
+}
+.price_steup_box_bottom_num{
+ flex: 1.5;
+ display: flex;
+ align-items: center;
+}
+.price_steup_box_top::after{
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
+ transform: scaleY(0.5);
+}
+.price_steup_box_top_stepper{
+ flex: 1;
+ text-align: right;
+ align-items: center;
+}
+.bottom{
+ width: 90vw;
+ margin: -20rpx auto;
+ color: #999;
+ letter-spacing: 2rpx;
+ font-size: 28rpx;
+ line-height: 40rpx;
+}
+.go{
+ position: fixed;
+ left: 50%;
+ transform: translateX(-50%);
+ bottom: 100rpx;
+ width: 90vw;
+}
+.weui-input{
+ color: red;
+ display: inline-block;
+ text-align: right;
+}
+.price{
+ text-align: center;
+ flex: 1;
+}
\ No newline at end of file
diff --git a/Pages/yishi/orderdetail/index.js b/Pages/yishi/orderdetail/index.js
index 9434029..2215c1c 100644
--- a/Pages/yishi/orderdetail/index.js
+++ b/Pages/yishi/orderdetail/index.js
@@ -6,23 +6,56 @@ Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
- title: '问诊详情 ', //导航栏 中间的标题
+ title: '收益明细 ', //导航栏 中间的标题
},
height: app.globalData.height,
- current_page: 1,
+ list: [],
+ date: "",
+ current_page: 0,
total: 0,
per_page: 0,
last_page: 0
},
-
+ onReachBottom() {
+ console.log('===触底了!!===');
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getDoctorAccountInfo()
+ }
+ },
onLoad(option){
let date = option.date;
console.log(date);
-
- //获取我的账户日账单明细数据
- api.getDoctorAccountInfo({date:date}).then(response => {
+ this.setData({
+ date: date
+ })
+ },
+ onHide(){
+ this.setData({
+ list: [],
+ date: "",
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0
+ })
+ },
+ onShow(){
+ this.getDoctorAccountInfo();
+ },
+ getDoctorAccountInfo(){
+ let list = this.data.list
+ let params = {};
+ params.page = this.data.current_page + 1;
+ params.date = this.data.date;
+ api.getDoctorAccountInfo(params).then(response => {
console.log(response);
- //暂没数据
+ this.setData({
+ list: list.concat(response.data.data),
+ current_page: response.data.current_page,
+ total: response.data.total,
+ per_page: response.data.per_page,
+ last_page: response.data.last_page,
+ })
}).catch(errors => {console.error(errors);})
}
})
\ No newline at end of file
diff --git a/Pages/yishi/orderdetail/index.json b/Pages/yishi/orderdetail/index.json
index 3b3b8cc..7767c10 100644
--- a/Pages/yishi/orderdetail/index.json
+++ b/Pages/yishi/orderdetail/index.json
@@ -1,6 +1,8 @@
{
"component": true,
"usingComponents": {
- "te-nav-bar": "/commpents/te_navbar"
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-empty": "@vant/weapp/empty/index",
+ "van-divider": "@vant/weapp/divider/index"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/orderdetail/index.wxml b/Pages/yishi/orderdetail/index.wxml
index a7bb161..bbd0f5d 100644
--- a/Pages/yishi/orderdetail/index.wxml
+++ b/Pages/yishi/orderdetail/index.wxml
@@ -1,37 +1,25 @@
-
+
-
+
- 快速问诊
- 接诊中
+ {{ item.inquiry_type==1?'专家问诊':item.inquiry_type==2?'快速问诊':item.inquiry_type==3?'公益问诊':item.inquiry_type==4?'问诊购药':'其他' }}
+
+ {{ item.entry_status==1?'入账中':item.entry_status==2?'入账成功':item.entry_status==3?'入账失败':'未知' }}
- 订单编号:2131231xxxx
- 就诊患者:张三三(女,25岁)
- 接诊时间:2022-12-30 11:23:23
- 结束时间:2022-12-12 11:23:23
- 订单金额:¥1212.00元
- 预计收入:¥112.00元
+ 订单编号:{{item.inquiry_no}}
+ 就诊患者:{{item.patient_name}}({{item.patient_sex==1?'男':'女'}},{{item.patient_age}}岁)
+ 接诊时间:{{item.reception_time}}
+ 结束时间:{{item.finish_time}}
+ 订单金额:¥{{item.amount_total}}
+ 预计收入:¥{{item.estimate_income}}
-
-
-
-
- 快速问诊
- 已取消
-
-
- 就诊患者:张三三/18/男
- 订单编号:2131231xxxx
- 订单金额:¥1212.00元
- 完成时间:2022.12.30
-
-
-
-
+
+ 到底了~
+
diff --git a/Pages/yishi/orderdetail/index.wxss b/Pages/yishi/orderdetail/index.wxss
index 60ec399..03df119 100644
--- a/Pages/yishi/orderdetail/index.wxss
+++ b/Pages/yishi/orderdetail/index.wxss
@@ -1,27 +1,29 @@
-.container{
+page{
background-color: #F4F4F4;
+}
+.container{
width: 100vw;
- height: 100vh;
}
.order_list{
display: flex;
width: 92vw;
margin: 0 auto;
flex-direction: column;
+ padding-bottom: 50rpx;
}
.order_item{
display: flex;
width: 100%;
margin-top: 30rpx;
+ height: 500rpx;
}
.order_item_content{
- flex: 10;
+ flex: 5;
background-color: #fff;
border-radius: 20rpx;
display: flex;
flex-direction: column;
padding: 20rpx;
- height: 600rpx;
}
.order_item_content_top{
flex: 1;
@@ -44,8 +46,20 @@
background-color: #C5C5C5;
color: #fff;
}
+.order_status.entrying{
+ background: #FFF2E8;
+ color: #FA541C;
+}
+.order_status.entrysuccess{
+ background: #E2FFFE;
+ color: #3CC7C0;
+}
+.order_status.entryfail{
+ background-color: #C5C5C5;
+ color: #fff;
+}
.order_item_content_data{
- flex: 3;
+ flex: 5;
display: flex;
flex-direction: column;
}
diff --git a/Pages/yishi/patient_sick/index.js b/Pages/yishi/patient_sick/index.js
new file mode 100644
index 0000000..85e1d3b
--- /dev/null
+++ b/Pages/yishi/patient_sick/index.js
@@ -0,0 +1,172 @@
+// Pages/yishi/medince_list/index.js
+import { API } from './../../../utils/network/api'
+import debounce from "./../../../utils/debounce"
+let api = new API()
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navbarData: {
+
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '患者病例', //导航栏 中间的标题
+ },
+ page:1,
+ family_id:'',
+ currentSick:null,
+ isLoding:false,
+ list:[],
+ isLock:false,
+ per_page:10,
+ keyword:'',
+ },
+ goDetail:debounce(function(event){
+ console.log(event)
+ let id=event.currentTarget.dataset.id;
+ app.go("/Pages/yishi/case/index?order_inquiry_id="+id);
+ }),
+ goDetailbefore:debounce(function(event){
+ let id=event.currentTarget.dataset.id;
+ app.go("/Pages/yishi/case/index?pathography_id="+id);
+ },600),
+ changeInput:debounce(function(event){
+ const { value }= event.detail;
+ this.setData({
+ isLock:false,
+ page:1,
+ list:[],
+ keyword:value
+ })
+ this.handleGetList();
+ },600),
+ goSearch(){
+ this.setData({
+ isLock:false,
+ list:[],
+ page:1
+ })
+ this.handleGetList();
+ },
+ confirmSearch(event){
+ const { value }= event.detail;
+ this.setData({
+ isLock:false,
+ list:[],
+ page:1,
+ keyword:value
+ })
+ this.handleGetList();
+ },
+ lower(){
+ console.log('===触底了!!===');
+ let {page,isLock}=this.data;
+ if(!isLock){
+ page++;
+ this.setData({
+ page:page
+ });
+ this.handleGetList();
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ handleGetCurrent(){
+ const {order_inquiry_id}=this.data;
+ api.getSimpleInquiry({
+ order_inquiry_id
+ }).then(data=>{
+ this.setData({
+ currentSick:data.data
+ })
+ console.log(data);
+ })
+ },
+ handleGetList(){
+ const {page,per_page,family_id,isLoding}=this.data;
+ if(isLoding)return false;
+ this.setData({
+ isLoding:true
+ })
+ api.getPathography({
+ page,
+ per_page,
+ family_id,
+
+ }).then(data=>{
+ this.setData({
+ isLoding:false
+ })
+ let result=data.data.data;
+ if(result.length==0){
+ this.setData({
+ isLock:true
+ });
+ return false;
+ }
+ this.setData({
+ list:this.data.list.concat(result)
+ });
+ }).catch(errors => {console.error(errors);})
+ },
+ onLoad(options) {
+ this.setData({
+ family_id:options.family_id,
+ order_inquiry_id:options.order_inquiry_id
+ })
+ this.handleGetCurrent();
+ this.handleGetList();
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/patient_sick/index.json b/Pages/yishi/patient_sick/index.json
new file mode 100644
index 0000000..7c7df28
--- /dev/null
+++ b/Pages/yishi/patient_sick/index.json
@@ -0,0 +1,9 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-empty": "@vant/weapp/empty/index",
+ "van-icon": "@vant/weapp/icon/index",
+ "van-divider": "@vant/weapp/divider/index"
+ }
+}
\ No newline at end of file
diff --git a/Pages/yishi/patient_sick/index.wxml b/Pages/yishi/patient_sick/index.wxml
new file mode 100644
index 0000000..9bfae37
--- /dev/null
+++ b/Pages/yishi/patient_sick/index.wxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+ {{currentSick.patient_name}}
+ {{currentSick.patient_sex==1?'男':'女'}}|{{currentSick.patient_age}}岁
+
+
+
+
+ 病情描述:
+ {{currentSick.disease_desc}}
+
+ 您于{{currentSick.reception_time}}接诊
+ 本次问诊
+
+
+
+
+
+ {{item.name}}
+ {{item.sex==1?'男':'女'}}|{{item.age}}岁
+
+
+
+
+ 病情描述:
+ {{item.disease_desc}}
+
+ 您与{{item.reception_time}}接诊
+
+
+
+ 到底了~
+
+
+
+
diff --git a/Pages/yishi/patient_sick/index.wxss b/Pages/yishi/patient_sick/index.wxss
new file mode 100644
index 0000000..a1846a5
--- /dev/null
+++ b/Pages/yishi/patient_sick/index.wxss
@@ -0,0 +1,160 @@
+/* Pages/yishi/patient_sick/index.wxss *//* Pages/yishi/medince_list/index.wxss */
+page{
+ height:100vh;
+ background-color: #F6F6F6;
+}
+.page{
+ height:100vh;
+ display: flex;
+ flex-direction: column;
+}
+ .container{
+ /* height:calc(100vh - 135rpx); */
+ display: flex;
+ overflow: hidden;
+ /* overflow-y: scroll; */
+ /* -webkit-overflow-scrolling: touch; */
+ flex-direction: column;
+}
+.searchCon{
+ width:100%;
+
+ background:#fff;
+}
+.searchbox{
+ display: flex;
+ margin:32rpx;
+ align-items: center;
+ height: 80rpx;
+background: #FFFFFF;
+border-radius: 40rpx;
+border: 2rpx solid #3CC7C0;
+
+}
+.searchIpt{
+ flex:1;
+ margin-left: 32px;
+}
+.searchImg{
+ width: 40rpx;
+ height:40rpx;
+ padding:30rpx;
+}
+.tips{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ position: absolute;
+ width: 200rpx;
+ height:200rpx;
+ font-size: 22rpx;
+font-weight: 400;
+color: #666666;
+}
+.desc{
+ text-align: center;
+}
+.medimgbox{
+ position: relative;
+ width: 200rpx;
+ height:200rpx;
+ margin-left: 30rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius:5rpx;
+}
+.medImg{
+ width:120rpx;
+ height:128rpx;
+
+}
+.titlebox{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.cell{
+ position: relative;
+ padding:20rpx 0;
+ background: #FFFFFF;
+box-shadow: 0rpx 2rpx 16rpx 2rpx rgba(0,0,0,0.02);
+border-radius: 12rpx;
+ margin:0 32rpx 20rpx;
+
+}
+.rightbox{
+ flex:1;
+ margin-left: 24rpx;
+ margin-right: 20rpx;
+}
+.scrollbox{
+ margin-top: 20rpx;
+ flex:1;
+ overflow-y: scroll;
+ -webkit-overflow-scrolling: touch;
+}
+.bottombox{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.info .name{
+ word-break: break-all;
+font-size: 32rpx;
+ font-weight: 600;
+color: rgba(0,0,0,0.85);
+}
+.company{
+ margin-top: 5rpx;
+ font-size: 26rpx;
+font-weight: 400;
+color: rgba(0,0,0,0.45);
+}
+.cell .title{
+display: flex;
+font-size: 34rpx;
+color: #333333;
+}
+.cell{
+ padding:20rpx;
+}
+.cell .name{
+margin-right: 20rpx;
+}
+.row{
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-line-clamp: 2; /* 设置最大显示行数 */
+ -webkit-box-orient: vertical;
+ text-overflow: ellipsis;
+ word-break: break-all;
+ margin-top: 20rpx;
+ font-size: 30rpx;
+ line-height: 42rpx;
+color: #666666;
+}
+.date{
+margin-top: 20rpx;
+font-size: 26rpx;
+font-weight: 400;
+color: #999999;
+}
+.mark{
+ position: absolute;
+ bottom:0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ right:0px;
+ font-size: 24rpx;
+font-weight: 400;
+color: #3CC7C0;
+ width: 126rpx;
+height: 54rpx;
+background: #E9FFFE;
+border-radius: 10rpx 0rpx 0rpx 10rpx;
+}
+.icon{
+ color:#c3c3c3;
+}
\ No newline at end of file
diff --git a/Pages/yishi/practicing/index.js b/Pages/yishi/practicing/index.js
index ba8a0ba..14b694c 100644
--- a/Pages/yishi/practicing/index.js
+++ b/Pages/yishi/practicing/index.js
@@ -11,10 +11,9 @@ Page({
height: app.globalData.height,
license_cert: [],
qualification_cert: [],
- work_cert: []
+ work_cert: [],
},
onLoad(){
-
api.getDoctorCret().then(response => {
console.log(response);
this.setData({
@@ -23,7 +22,14 @@ Page({
work_cert: response.data.work_cert,
})
}).catch(errors => {console.error(errors);})
- }
+ },
+ previewImage(e){
+ let name = e.currentTarget.dataset.name;
+ let name_date = this.data[name]
-
+ wx.previewImage({
+ current: name_date[0], // 当前显示图片的http链接
+ urls: name_date // 需要预览的图片http链接列表
+ })
+ }
})
\ No newline at end of file
diff --git a/Pages/yishi/practicing/index.wxml b/Pages/yishi/practicing/index.wxml
index e568bbc..cb612c2 100644
--- a/Pages/yishi/practicing/index.wxml
+++ b/Pages/yishi/practicing/index.wxml
@@ -11,7 +11,9 @@
mode="heightFix"
style="margin: 0 50rpx 0 20rpx;"
width="220rpx" height="220rpx"
- aria-label="img" wx:for="{{license_cert}}" />
+ aria-label="img" wx:for="{{license_cert}}"
+ data-name="license_cert"
+ bindtap="previewImage" />
@@ -24,7 +26,9 @@
mode="heightFix"
style="margin: 0 50rpx 0 20rpx;"
width="220rpx" height="220rpx"
- aria-label="img" wx:for="{{qualification_cert}}" />
+ aria-label="img" wx:for="{{qualification_cert}}"
+ data-name="qualification_cert"
+ bindtap="previewImage"/>
@@ -34,9 +38,11 @@
id="loading-img"
shape="round" src="{{item}}"
mode="heightFix"
- style="margin: 0 50rpx 0 20rpx;"
+ style="margin: 0 50rpx 20rpx 20rpx;"
width="220rpx" height="220rpx"
- aria-label="img" wx:for="{{work_cert}}" />
+ aria-label="img" wx:for="{{work_cert}}"
+ data-name="work_cert"
+ bindtap="previewImage"/>
diff --git a/Pages/yishi/practicing/index.wxss b/Pages/yishi/practicing/index.wxss
index b024d33..306c8df 100644
--- a/Pages/yishi/practicing/index.wxss
+++ b/Pages/yishi/practicing/index.wxss
@@ -10,10 +10,11 @@
}
.imgbox{
display: flex;
+ flex-wrap: wrap;
}
.imgbox_title{
padding: 20rpx;
- font-size: 30rpx;
+ font-size: 20px;
}
.imgbox_item{
position: relative;
diff --git a/Pages/yishi/quickreply/index.js b/Pages/yishi/quickreply/index.js
index 98a2dcc..67a264e 100644
--- a/Pages/yishi/quickreply/index.js
+++ b/Pages/yishi/quickreply/index.js
@@ -1,4 +1,5 @@
import { API } from './../../../utils/network/api'
+import Toast from 'tdesign-miniprogram/toast/index';
const api = new API()
const app = getApp()
Page({
@@ -10,14 +11,26 @@ Page({
},
height: app.globalData.height,
stickyProps: {
- offsetTop: app.globalData.height*2 + 20,
+ offsetTop: (app.globalData.height * 2),
zIndex: 99
},
list_1: [],
list_2: [],
show: false,
add_message: "",
- current_words_type: 1
+ current_words_type: 1,
+ focus: false,
+ words_css: "border-radius: 20rpx;margin-bottom: 20rpx;",
+ from: "",
+ open: false
+ },
+ onLoad(options){
+ let from = options.from;
+ if(from) {
+ this.setData({
+ from: from
+ })
+ }
},
onTabChange(e){
this.setData({
@@ -44,17 +57,35 @@ Page({
api.postDoctorWords({words_type: words_type, words: words}).then(response => {
console.log(response);
- let list_name = "list_" + words_type;
- let list = this.data[list_name];
- let obj = {};
- obj.words = words;
- list.push(obj);
- console.log(list_name);
this.setData({
- [list_name]: list,
add_message: "",
show: false
})
+ }).then(()=>{
+ this.getList(words_type)
+ }).catch(errors => {console.error(errors);})
+ },
+ delWords(e){
+ console.log(e);
+ let words_type = this.data.current_words_type;
+ let doctor_words_id = e.currentTarget.dataset.doctor_words_id;
+ if(doctor_words_id == ""){
+ Toast({
+ context: this,
+ selector: '#t-toast',
+ message: '系统常用语,无法删除',
+ theme: 'warning',
+ direction: 'column',
+ });
+ return
+ }
+ api.delDoctorWords({doctor_words_id: doctor_words_id}).then(response => {
+ console.log(response);
+ this.setData({
+ open: false
+ })
+ }).then(()=>{
+ this.getList(words_type)
}).catch(errors => {console.error(errors);})
},
showAdd(){
@@ -62,11 +93,53 @@ Page({
show: true,
});
},
-
onClose() {
this.setData({
show: false,
});
},
-
+ onInput(){
+ this.setData({
+ focus: true
+ })
+ },
+ wordsClose(e){
+ console.log(e);
+ const { position, instance } = e.detail;
+ console.log(position)
+ console.log(instance)
+ switch (position) {
+ case 'left':
+ case 'cell':
+ instance.close();
+ break;
+ case 'right':
+ Dialog.confirm({
+ message: '确定删除吗?',
+ }).then(() => {
+ instance.close();
+ });
+ break;
+ }
+ },
+ wordsOpen(e){
+ console.log("open")
+ console.log(e);
+ this.setData({
+ open: true
+ })
+ },
+ wordsClick(e){
+ console.log("click")
+ console.log(e);
+ if(this.data.open){
+ return
+ }
+ let words = e.currentTarget.dataset.words;
+ let from = this.data.from;
+ if(from){
+ wx.setStorageSync('words', words);
+ wx.navigateBack()
+ }
+ }
})
\ No newline at end of file
diff --git a/Pages/yishi/quickreply/index.json b/Pages/yishi/quickreply/index.json
index 41f9533..cfe5079 100644
--- a/Pages/yishi/quickreply/index.json
+++ b/Pages/yishi/quickreply/index.json
@@ -7,6 +7,8 @@
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
"van-button": "@vant/weapp/button/index",
"van-popup": "@vant/weapp/popup/index",
- "van-field": "@vant/weapp/field/index"
+ "van-field": "@vant/weapp/field/index",
+ "van-swipe-cell": "@vant/weapp/swipe-cell/index",
+ "t-toast": "tdesign-miniprogram/toast/toast"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/quickreply/index.wxml b/Pages/yishi/quickreply/index.wxml
index 0cf49fe..06f9500 100644
--- a/Pages/yishi/quickreply/index.wxml
+++ b/Pages/yishi/quickreply/index.wxml
@@ -1,32 +1,48 @@
-
+
-
-
+
+
+
+
+
+ 删除
+
- 添加常用语
+ 添加常用语
-
-
-
-
-
+
+
+
+
+
+ 删除
+
- 添加常用语
+ 添加常用语
@@ -44,8 +60,13 @@
model:value="{{ add_message }}"
type="textarea"
placeholder="请输入文字"
+ placeholder-style="font-size: 32rpx;font-weight: 400;"
autosize
+ maxlength="500"
+ custom-style="height: 100%;"
border="{{ false }}"
+ focus="{{focus}}"
+ bindtap="onInput"
/>
@@ -55,4 +76,5 @@
-->
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/Pages/yishi/quickreply/index.wxss b/Pages/yishi/quickreply/index.wxss
index 9477ccb..c09a494 100644
--- a/Pages/yishi/quickreply/index.wxss
+++ b/Pages/yishi/quickreply/index.wxss
@@ -1,9 +1,14 @@
-.container{
- width: 100vw;
- height: 100vh;
+page{
background-color: #F6F6F6;
}
-.item_list{
+.container{
+ width: 100vw;
+}
+.item_list1{
+ width: 92vw;
+ margin: 40rpx auto 180rpx auto;
+}
+.item_list2{
width: 92vw;
margin: 40rpx auto;
}
@@ -12,10 +17,10 @@
}
.t-tabs__item--active{
color: #49B9AD !important;
- font-size: 32rpx !important;
+ font-size: 36rpx !important;
}
.t-tabs__item-inner--line{
- font-size: 28rpx !important;
+ font-size: 32rpx !important;
}
.t-tabs__track{
background-color: var(--td-tab-track-color, var(--td-primary-color, #49B9AD)) !important;
@@ -26,6 +31,7 @@
position: fixed;
bottom: 0;
width: 100%;
+ padding-bottom: 30rpx;
}
.popup_box{
height: 500rpx;
@@ -36,22 +42,54 @@
.popup_box_title{
flex: 1;
display: flex;
- align-items: center;
- justify-content: space-around;
border-bottom: 1px solid #E7E7E7;
+ align-items: center;
+ justify-content: center;
}
.cancle{
font-size: 32rpx;
color: rgba(0,0,0,0.6);
+ flex: 1;
+ height: 100rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
.title{
font-size: 32rpx;
color: rgba(0,0,0,0.9);
+ flex: 1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100rpx;
}
.confirm{
font-size: 32rpx;
color: #3CC7C0;
+ flex: 1;
+ height: 100rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
.popup_box_content{
flex: 5;
+}
+.delWords{
+ background-color: red;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ width: 65px;
+ justify-content: center;
+ color: #fff;
+}
+.van-cell {
+ padding: 32rpx !important;
+ font-size: 34rpx !important;
+ color: #333 !important;
+ word-wrap: break-word;
+ word-break: normal;
+ word-break:break-all;
}
\ No newline at end of file
diff --git a/Pages/yishi/quickreply_data/index.wxml b/Pages/yishi/quickreply_data/index.wxml
index 902aed2..07d3fac 100644
--- a/Pages/yishi/quickreply_data/index.wxml
+++ b/Pages/yishi/quickreply_data/index.wxml
@@ -1,9 +1,9 @@
-
-
-
+
+
+
{
+ console.log(response);
+ this.setData({
+ list: list.concat(response.data.data),
+ current_page: response.data.current_page,
+ total: response.data.total,
+ per_page: response.data.per_page,
+ last_page: response.data.last_page,
+ })
+ }).catch(errors => {console.error(errors);})
+ },
+ onReachBottom() {
+ console.log('===触底了!!===');
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getList()
+ }
+ },
+ putMessageReadNoticeAll(){
+ api.putMessageReadNoticeAll({notice_type: 1}).then(response => {
+ console.log(response);
+ let new_list = [];
+ this.data.list.forEach(item => {
+ item.read_status = 1;
+ new_list.push(item)
+ })
+ this.setData({
+ list: new_list
+ })
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ wx.setStorageSync( userID+"_service_notice_unreadnnum", "");
+ wx.showToast({
+ title: '操作成功',
+ icon: "success"
+ })
+ }).catch(errors => {console.error(errors);})
+ },
+ putMessageReadNotice(notice_id,index){
+ api.putMessageReadNotice({notice_id: notice_id}).then(response => {
+ if(response.code==200){
+ let currentItem=`list[${index}].read_status`
+ this.setData({
+ [currentItem]:1
+ })
+ }
+ console.log(response);
+
+ }).catch(errors => {console.error(errors);})
+ },
+ go(e){
+ let item = e.currentTarget.dataset.item;
+ let index=e.currentTarget.dataset.index;
+ this.putMessageReadNotice(item.notice_id,index);
+ let link_type = item.link_type;
+ link_type = Number(link_type);
+ // 跳转页面类型(1:聊天详情页 2:问诊结束列表页 3:问诊消息列表页 4:我的名片 5:我的简介 6:我的账户 7:我的福利 8:药品订单详情页 9:物流详情 10:问诊订单详情 11:联系客服 12:协议详情 13:处方详情)
+ switch (link_type) {
+ case 1:
+ let from_account = item.link_params.from_account;
+ let order_inquiry_id = item.link_params.order_inquiry_id;
+ let inquiry_type = item.link_params.inquiry_type;
+ let url = "/Pages/yishi/chat/index?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type;
+ app.go(url);
+ break;
+ case 2:
+ wx.showToast({
+ title: '暂无页面',
+ icon: 'error'
+ })
+ break;
+ case 3:
+ wx.switchTab({
+ url: "/Pages/yishi/wenzhen_v2/wenzhen",
+ })
+ break;
+ case 4:
+ app.go("/Pages/yishi/mycard/index")
+ break;
+ case 5:
+ app.go("/Pages/yishi/myprofile/index")
+ break;
+ case 6:
+ app.go("/Pages/yishi/myaccount/index")
+ break;
+ case 7:
+ wx.showToast({
+ title: '暂无页面',
+ icon: 'error'
+ })
+ break;
+ case 8:
+ wx.showToast({
+ title: '暂无页面',
+ icon: 'error'
+ })
+ break;
+ case 9:
+ wx.showToast({
+ title: '暂无页面',
+ icon: 'error'
+ })
+ break;
+ case 10:
+ wx.showToast({
+ title: '暂无页面',
+ icon: 'error'
+ })
+ break;
+ case 11:
+ this.setData({
+ contactKeFu: true
+ })
+ break;
+ case 12:
+ wx.showToast({
+ title: '暂无页面',
+ icon: 'error'
+ })
+ break;
+ case 13:
+ let url1 = "/Pages/yishi/onlinechufang/index?order_inquiry_id="+item.link_params.order_inquiry_id+"&order_prescription_id="+item.link_params.order_prescription_id+"&from=chat";
+ app.go(url1);
+ break;
+ default:
+ break;
+ }
+ },
+ cancelContactDialog(){
+ console.log("cancelContactDialogcancelContactDialogcancelContactDialog");
+ this.setData({
+ contactKeFu: false
+ })
+ },
})
\ No newline at end of file
diff --git a/Pages/yishi/service_notice/index.json b/Pages/yishi/service_notice/index.json
index ee34b87..627b877 100644
--- a/Pages/yishi/service_notice/index.json
+++ b/Pages/yishi/service_notice/index.json
@@ -2,6 +2,11 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
- "t-image": "tdesign-miniprogram/image/image"
- }
+ "van-image": "@vant/weapp/image/index",
+ "van-divider": "@vant/weapp/divider/index",
+ "van-empty": "@vant/weapp/empty/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
+ },
+ "enablePullDownRefresh": false,
+ "onReachBottomDistance": 50
}
\ No newline at end of file
diff --git a/Pages/yishi/service_notice/index.wxml b/Pages/yishi/service_notice/index.wxml
index a811f45..a367fc9 100644
--- a/Pages/yishi/service_notice/index.wxml
+++ b/Pages/yishi/service_notice/index.wxml
@@ -1,51 +1,56 @@
-
+
-
-
+
-
- 快速问诊
-
-
- 2023-1-02 12:22
-
- 您有新的图文问诊咨询,请注意查看。
-
-
-
-
-
+
在线问诊
-
+
- 2023-1-02 12:22
-
- 您有新的图文问诊咨询,请注意查看。
-
-
-
-
-
- 义诊
-
+
+ 快速问诊
+
- 2023-1-02 12:22
-
- 您有新的图文问诊咨询,请注意查看。
-
-
-
-
-
+
+ 公益问诊
+
+
+
问诊购药
-
+
- 2023-1-02 12:22
+
+ 糖组检测
+
+
+ {{item.notice_send_time}}
+
+
+ {{item.notice_brief_title}}
+
+
+
- 您有新的图文问诊咨询,请注意查看。
-
-
+
+ 到底了~
+
+
+
+
+
+ 取消
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/service_notice/index.wxss b/Pages/yishi/service_notice/index.wxss
index 466c0e7..23172e5 100644
--- a/Pages/yishi/service_notice/index.wxss
+++ b/Pages/yishi/service_notice/index.wxss
@@ -1,11 +1,13 @@
-.container{
+page{
background-color: #F4F4F4;
- height: 100vh;
+}
+.container{
width: 100vw;
+ padding-top: 20rpx;
}
.list{
width: 92vw;
- margin: 20rpx auto;
+ margin: 0 auto;
}
.item{
display: flex;
@@ -33,6 +35,37 @@
}
.item_content{
margin-top: 20rpx;
- font-size: 24rpx;
+ font-size: 30rpx;
color: #666666;
+ display: flex;
+ align-items: center;
+}
+.van_img{
+ display: flex;
+ justify-content: center;
+}
+.hongdian{
+ height: 50rpx;
+ display: flex;
+ align-items: center;
+ flex: 1;
+ display: flex;
+ justify-content: flex-end;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
+.t-button__content{
+ color: #3CC7C0 !important;
}
\ No newline at end of file
diff --git a/Pages/yishi/sickform/index.js b/Pages/yishi/sickform/index.js
new file mode 100644
index 0000000..58fb5c6
--- /dev/null
+++ b/Pages/yishi/sickform/index.js
@@ -0,0 +1,661 @@
+// pages/inquiryForm/inquiryForm.js
+const app = getApp()
+import { API } from './../../../utils/network/api'
+const api = new API()
+
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '问诊表', //导航栏 中间的标题
+ },
+ obj:{
+ height:'身高',
+ weight:'体重',
+ marital_status:'婚姻状态',
+ nation_id:'民族',
+ job_id:'职业',
+ allergy_history:'是否有过敏史?',
+ family_history:'是否有家族病史?',
+ is_pregnant:'是否处于备孕、妊娠、哺乳期?',
+ is_operation:'是否做过手术?',
+ drink_wine_status:'是否有饮酒史?',
+ smoke_status:'是否有吸烟史?',
+ chemical_compound_status:'是否有接触过化学物?',
+ diagnosis_hospital:'确诊医院是?',
+ is_take_medicine:'服用药品是?'
+
+ },
+ showNation:false,
+ showJob:false,
+ showMarital:false,
+ nationname:'',
+ order_inquiry_id:'',
+ jobname:'',
+ hideGuomin:false,
+ hideFamilysick:false,
+ hidePregnant:false,
+ hideOperation:false,
+ hideChemical:false,
+ hideHospital:false,
+ hideDrug:false,
+ personInfo:{},
+ showBtn:true,
+ maritalColumn: [{
+ text: '未婚',
+ value: 0
+ }, {
+ text: '已婚 ',
+ value: 1
+ }, {
+ text: '离异 ',
+ value: 2
+ }],
+ nationcolumns:[],
+ jobcolumns:[],
+ list1:[],
+ list2:[],
+ startIndex1:1,
+ showList:[{
+ isHas:false,
+ index:1
+ },{
+ isHas:false,
+ index:2
+ },{
+ isHas:false,
+ index:3
+ },{
+ isHas:false,
+ index:4
+ },{
+ isHas:false,
+ index:5
+ },{
+ isHas:false,
+ index:6
+ },{
+ isHas:false,
+ index:7
+ },{
+ isHas:false,
+ index:8
+ },{
+ isHas:false,
+ index:9
+ }],
+ static_host: ''
+
+
+ },
+ handleSendFields(){
+ const {order_inquiry_id,personInfo,list1,list2,marital_name,jobname,nationname}=this.data;
+ console.log(personInfo)
+ const fields=[];
+ for (let i = 0; i {
+ wx.showToast({
+ title: '发送成功',
+ icon:'none'
+ }),
+ wx.navigateBack()
+
+ })
+ },
+ handleIpt(e){
+ let key = e.target.dataset.id;
+ let obj="personInfo."+key;
+ if(key=='height' || key=="weight"){
+ this.setData({
+ [obj]:e.detail.value
+ })
+ }else{
+ this.setData({
+ [obj]: e.detail.value
+ })
+ }
+
+ },
+ openMaritalPicker() {
+ this.setData({
+ showMarital: true
+ })
+ },
+ closeMaritalPicker() {
+ this.setData({
+ showMarital: false
+ })
+ },
+ onConfirmMaritalPicker(event) {
+ const {
+ value
+ } = event.detail;
+
+ this.setData({
+ showMarital: false,
+ marital_name:value.text,
+ 'personInfo.marital_status':value.value
+ })
+ },
+ onChangeRadio(event) {
+ let key = event.target.dataset.id;
+ let obj= "personInfo."+key;
+ this.setData({
+ [obj]:Number(event.detail)
+ });
+ if(key=="chemical_compound_status" && event.detail==1){
+ this.setData({
+ "personInfo.chemical_compound_describe":''
+ })
+ }else if(event.detail==0){
+ if(key=="is_allergy_history"){
+ this.setData({
+ "personInfo.allergy_history":'',
+ hideGuomin:false
+ })
+ };
+ if(key=="is_pregnant"){
+ this.setData({
+ "personInfo.pregnant":'',
+ hidePregnant:false
+ })
+ }
+ if(key=="is_family_history"){
+ this.setData({
+ "personInfo.family_history":'',
+ hideFamilysick:false
+ })
+ }
+ }
+ },
+ handelFocus(e) {
+ let key = e.target.dataset.id;
+ let value = e.target.dataset.value;
+ let obj="personInfo."+value;
+ if (!e.detail.value) {
+ this.setData({
+ [key]: false,
+ [obj]: e.detail.value
+ })
+ } else {
+ this.setData({
+ [key]: true,
+ [obj]: e.detail.value
+ })
+ }
+ },
+ onConfirmNation(event) {
+ const {
+ value
+ } = event.detail;
+ this.setData({
+ "nationname": `${value.nation_name}`,
+ "personInfo.nation_id": `${value.nation_id}`,
+ showNation: false
+ })
+ },
+ showNation() {
+
+ this.setData({
+ showNation: true
+ })
+
+ },
+ onCancelNation() {
+ this.setData({
+ showNation: false
+ })
+ },
+ onConfirmJob(event) {
+ const {
+ value
+ } = event.detail;
+ this.setData({
+ "jobname": `${value.job_name}`,
+ "personInfo.job_id": `${value.job_id}`,
+ showJob: false
+ })
+ },
+ showJob() {
+ this.setData({
+ showJob: true
+ })
+ },
+ onCancelJob() {
+ this.setData({
+ showJob: false
+ })
+ },
+ commonMethods(arr1,arr2){
+ this.setData({
+ list1:arr1,
+ list2:arr2
+ });
+ let count=0;
+ arr2.forEach((item)=>{
+ if(item=="allergy_history"){
+ count++;
+ this.setData({
+ 'showList[0].isHas':true,
+ 'showList[0].index':1
+ })
+ }else if(item=="family_history"){
+ count++;
+ this.setData({
+ 'showList[1].isHas':true,
+ 'showList[1].index':count
+ })
+ }else if(item=="is_pregnant"){
+ count++;
+ this.setData({
+ 'showList[2].isHas':true,
+ 'showList[2].index':count
+ })
+ }else if(item=="is_operation"){
+ count++;
+ this.setData({
+ 'showList[3].isHas':true,
+ 'showList[3].index':count
+ })
+ }else if(item=="drink_wine_status"){
+ count++;
+ this.setData({
+ 'showList[4].isHas':true,
+ 'showList[4].index':count
+ })
+ }else if(item=="smoke_status"){
+ count++;
+ this.setData({
+ 'showList[5].isHas':true,
+ 'showList[5].index':count
+ })
+ }else if(item=="chemical_compound_status"){
+ count++;
+ this.setData({
+ 'showList[6].isHas':true,
+ 'showList[6].index':count
+ })
+ }else if(item=="diagnosis_hospital"){
+ count++;
+ this.setData({
+ 'showList[7].isHas':true,
+ 'showList[7].index':count
+ })
+ }else if(item=="is_take_medicine"){
+ count++;
+ this.setData({
+ 'showList[8].isHas':true,
+ 'showList[8].index':count
+ })
+ }
+ })
+
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.getNation();
+ this.getJob();
+ if(options.order_inquiry_id){
+ this.setData({
+ order_inquiry_id:options.order_inquiry_id
+ })
+ }
+ if(options.case_filled_fields){
+
+ let data=JSON.parse(options.case_filled_fields);
+ let arr1=[];
+ let arr2=[];
+ console.log('----------加载');
+ console.log(data);
+ this.setData({
+ personInfo:data,
+ showBtn:false
+ });
+ if(data.is_allergy_history==1){
+ this.setData({
+ hideGuomin:true
+ })
+ }
+ if(data.is_family_history==1){
+ this.setData({
+ hideFamilysick:true
+ })
+ }
+ if(data.is_operation==1){
+ this.setData({
+ hideOperation:true
+ })
+ }
+ if(data.is_pregnant==1){
+ this.setData({
+ hidePregnant:true
+ })
+ }
+ if(data.chemical_compound_status && data.chemical_compound_status!=1){
+ this.setData({
+ hideChemical:true
+ })
+ }
+ if(data.diagnosis_hospital){
+ this.setData({
+ hideHospital:true
+ })
+ }
+ if(data.is_take_medicine==1){
+ this.setData({
+ hideDrug:true
+ })
+ }
+ let {maritalColumn,jobcolumns,nationcolumns}=this.data;
+ if(data.marital_status==0 || data.marital_status){
+ let select=maritalColumn.filter(item=>{return item.value==data.marital_status});
+ this.setData({
+ 'marital_name':select[0].text
+ })
+ };
+
+
+
+ Object.keys(data).forEach(function(key){
+ if(key=="weight" || key=="height" || key=="marital_status" || key=="nation_id" || key=="job_id"){
+ arr1.push(key);
+ }else{
+ arr2.push(key);
+ }
+ })
+ this.commonMethods(arr1,arr2);
+
+
+
+ }
+ if(options.params){
+ let data=JSON.parse(options.params);
+
+ let {obj}=this.data;
+ let arr1=[];
+ let arr2=[];
+ data.forEach(item => {
+ if(item=="weight" || item=="height" || item=="marital_status" || item=="nation_id" || item=="job_id"){
+ arr1.push(item);
+ }else{
+ arr2.push(item);
+ }
+
+ })
+ this.commonMethods(arr1,arr2);
+
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+ getNation(){
+ api.getNation().then(data=>{
+ let result=data.data;
+ this.setData({
+ nationcolumns:result
+ })
+ let {personInfo}=this.data;
+ if(personInfo.nation_id || personInfo.nation_id==0){
+ let select=result.filter(item=>{return item.nation_id==personInfo.nation_id});
+ this.setData({
+ 'nationname':select[0].nation_name
+ })
+ }
+ })
+ },
+ getJob(){
+ api.getJob().then(data=>{
+ let result=data.data;
+ this.setData({
+ jobcolumns: result
+ })
+ let {personInfo}=this.data;
+ if(personInfo.job_id || personInfo.job_id==0){
+ let select=result.filter(item=>{return item.job_id==personInfo.job_id});
+ this.setData({
+ 'jobname':select[0].job_name
+ })
+ }
+ })
+ },
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+ console.log(api.getStaticHost())
+ this.setData({
+ static_host:api.getStaticHost()
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/sickform/index.json b/Pages/yishi/sickform/index.json
new file mode 100644
index 0000000..6a36619
--- /dev/null
+++ b/Pages/yishi/sickform/index.json
@@ -0,0 +1,8 @@
+{
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-radio": "@vant/weapp/radio/index",
+ "van-radio-group": "@vant/weapp/radio-group/index"
+
+ }
+}
\ No newline at end of file
diff --git a/Pages/yishi/sickform/index.wxml b/Pages/yishi/sickform/index.wxml
new file mode 100644
index 0000000..e2cbec0
--- /dev/null
+++ b/Pages/yishi/sickform/index.wxml
@@ -0,0 +1,231 @@
+
+
+
+
+
+
+ 基本信息
+
+
+
+ {{filter.formatwenzhenList(list1,'height').NUMBER}}、身高(CM)
+
+
+
+
+
+
+
+
+
+
+ {{filter.formatwenzhenList(list1,'weight').NUMBER}}、体重(KG)
+
+
+
+
+
+
+
+
+
+
+ {{filter.formatwenzhenList(list1,'marital_status').NUMBER}}、婚姻状况
+
+
+
+
+
+
+
+
+
+
+
+ {{filter.formatwenzhenList(list1,'nation_id').NUMBER}}、民族
+
+
+
+
+
+
+
+
+
+
+ {{filter.formatwenzhenList(list1,'job_id').NUMBER}}、职业
+
+
+
+
+
+
+
+
+
+
+ 个人情况
+
+
+
+ {{showList[0].index}}、
+
+ 您是否有过敏史?
+
+
+ 是
+ 否
+
+
+
+
+
+
+ 过敏史:请填写过敏源,如药物,请写出药名;如食物,请写具体如鸡蛋、牛奶等(限制50个字)
+
+
+
+
+
+ {{showList[1].index}}、
+
+ 您是否有家族病史?
+
+
+ 是
+ 否
+
+
+
+
+
+ 家族病史:请详细填写相关家族病史(限制50个字)
+
+
+
+
+
+ {{showList[2].index}}、
+
+ 您是否处于备孕、妊娠、哺乳期?
+
+
+ 是
+ 否
+
+
+
+
+
+ 请描述您目前所处阶段,如备孕中、哺乳期中、妊娠月份。(限制50个字)
+
+
+
+
+
+ {{showList[3].index}}、
+
+ 是否做过手术
+
+
+ 是
+ 否
+
+
+
+
+
+ 请描述具体手术名称和做手术医院
+
+
+
+
+
+ {{showList[4].index}}、
+
+ 是否有饮酒史
+
+
+ 从不
+ 偶尔
+ 经常
+ 每天
+ 已戒酒
+
+
+
+
+
+ {{showList[5].index}}、
+
+ 是否有吸烟史
+
+
+ 从不
+ 偶尔
+ 经常
+ 每天
+ 已戒烟
+
+
+
+
+
+ {{showList[6].index}}、
+
+ 是否有接触过化学物
+
+
+ 从不
+ 偶尔
+ 经常
+ 每天
+
+
+
+
+
+
+ 化学物:请详细填写接触过的相关化学物(限制50个字)
+
+
+
+
+
+
+ {{showList[7].index}}、
+
+ 确诊医院是?
+
+
+
+ 请填写确诊医院名称
+
+
+
+
+
+ {{showList[8].index}}、
+
+ 是否正在服药?
+
+
+ 是
+ 否
+
+
+
+
+
+ 请详细填写所服药物(限制50个字)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Pages/yishi/sickform/index.wxss b/Pages/yishi/sickform/index.wxss
new file mode 100644
index 0000000..6095399
--- /dev/null
+++ b/Pages/yishi/sickform/index.wxss
@@ -0,0 +1,162 @@
+page{
+ display: flex;
+ flex-direction: column;
+}
+.container{
+
+ flex:1;
+ overflow-y: scroll;
+ -webkit-overflow-scrolling: touch;
+ background-color: #F6F6F6;
+}
+.cellbox{
+ background-color: #fff;
+}
+.questionbox{
+
+
+}
+.cellbox .cell{
+ background-color: #fff;
+ align-items: center;
+ display: flex;
+ padding:0 32rpx;
+ }
+ .cellrow{
+ height:105rpx;
+ width:100%;
+ justify-content: space-between;
+ align-items: center;
+ display: flex;
+ border-bottom:1rpx solid #E3E4E5;
+ }
+ .cell:last-child .cellrow{
+ border-bottom: none;
+ }
+ .iptbox{
+ display: flex;
+ flex:1;
+ margin-top:4rpx;
+ justify-content: flex-end;
+ }
+ .righticon{
+ width:24rpx;
+ height: 48rpx;
+ }
+ .name{
+ display: flex;
+ align-items: center;
+ }
+ .name .red{
+ margin-top: 20rpx;
+ color:#E34D59;
+ }
+ .placeholder{
+ text-align: right;
+ font-size: 28rpx;
+ font-weight: 400;
+
+ color: #C5C8CB;
+ }
+ .ipt{
+ width:100%;
+ text-align: right;
+ color: #666666;
+ line-height: 48rpx;
+ font-size: 28rpx;
+
+ margin-left: 160rpx;
+ }
+ .basictitle{
+ margin-top: 30rpx;
+ font-size: 34rpx;
+ padding:30rpx 32rpx 10rpx;
+ font-family: PingFangSC, PingFang SC;
+ font-weight: 500;
+ color: #1C2023;
+ }
+ .sickHis{
+ background-color: #fff;
+ /* margin-top: 20rpx; */
+ padding:1rpx 52rpx 40rpx;
+
+}
+.list .qa{
+ display: flex;
+ margin-top: 30rpx;
+ border-bottom:1rpx solid #E3E4E5;
+}
+.titlebox{
+ flex:1;
+
+}
+textarea{
+ position: relative;
+ z-index:1;
+ width:100%;
+ color:#333;
+ height:132rpx;
+}
+.radio{
+ margin: 30rpx 0rpx 30rpx 0;
+}
+.group .van-radio--horizontal{
+ margin-right: 11rpx;
+}
+.singlegroup .van-radio--horizontal{
+ margin-right:44rpx;
+}
+.singlegroup .van-radio--horizontal:nth-child(2n){
+ margin-right: 0rpx;
+}
+.group .van-radio--horizontal:nth-child(3n){
+ margin-right: 0;
+}
+.radiotip{
+ position: relative;
+ padding:24rpx 20rpx;
+ justify-content: center;
+ margin-top: 20rpx;
+ line-height: 42rpx;
+background: #F2F2F2;
+border-radius: 10rpx;
+font-size: 28rpx;
+color:#999;
+margin-bottom: 20rpx;
+}
+.radiotip .textbox{
+ top:20rpx;
+ left:20rpx;
+ margin-top: 0;
+ width:auto;
+ height: 100rpx;
+ font-weight: normal;
+ z-index: 0;
+ position: absolute;
+ right:20rpx;
+}
+
+.radiotip text{
+ white-space: nowrap;
+ color:#333;
+}
+.van-radio__label{
+ padding-right:40rpx!important;
+}
+/* .van-radio__label:nth-child(3){
+ padding-right:0rpx!important;
+} */
+.van-radio{
+ margin-bottom: 10rpx!important;
+}
+.van-radio__icon--disabled{
+ background-color: #fff!important;
+}
+.van-radio__icon--disabled.van-radio__icon--checked{
+ color:#fff!important;
+ background-color: #3cc7c0!important;
+ border-color:#3cc7c0 ;
+}
+.van-radio__label--disabled{
+ color:#000!important;
+}
\ No newline at end of file
diff --git a/Pages/yishi/signcanvas/index.js b/Pages/yishi/signcanvas/index.js
index 0fa1b90..44f6f4b 100644
--- a/Pages/yishi/signcanvas/index.js
+++ b/Pages/yishi/signcanvas/index.js
@@ -11,7 +11,14 @@ Page({
height: app.globalData.height,
ctx: null,
canvas: null,
- txt_show: true
+ txt_show: true,
+ template:{
+ width: '676rpx',
+ height: '414rpx',
+ views: [
+ {}
+ ],
+ },
},
onReady() {
@@ -33,35 +40,43 @@ Page({
canvas: canvas
});
+ console.log("onReady onReady start")
+ console.log(ctx)
+ console.log(canvas)
+ console.log("onReady onReady end")
})
},
-
ontouchmove(e){
+ console.log("ontouchmove ontouchmove ontouchmove");
+ console.log(e);
this.data.ctx.lineWidth = 5;
this.data.ctx.lineCap="round";
this.data.ctx.lineJoin ="round";
- this.data.ctx.lineTo(e.changedTouches[0].pageX,e.changedTouches[0].pageY);
+ this.data.ctx.lineTo(e.touches[0].x,e.touches[0].y);
this.data.ctx.stroke();
},
ontouchstart(e){
+ console.log("ontouchstart ontouchstart ontouchstart")
this.setData({
txt_show: false
});
console.log(this.data.ctx);
this.data.ctx.beginPath();
- this.data.ctx.moveTo(e.changedTouches[0].pageX,e.changedTouches[0].pageY);
+ this.data.ctx.moveTo(e.touches[0].x,e.touches[0].y);
},
-
toClear() {
this.setData({
txt_show: true
});
this.data.ctx.clearRect(0,0,this.data.canvas.width,this.data.canvas.height)
},
-
+ rotate(){
+ let ctx = this.data.ctx;
+ ctx.rotate(90);
+ },
toSave(event) {
let _this = this;
- let base64Img = _this.data.canvas.toDataURL()
+ let base64Img = _this.data.canvas.toDataURL();
console.log("sign: ", base64Img);
wx.canvasToTempFilePath({
canvasId: "sign_panels",
@@ -71,11 +86,32 @@ Page({
success(res) {
console.log(res.tempFilePath)
let filePath = res.tempFilePath;
- _this.doUploadFile(event, 2, filePath);
+ console.log(_this.data.canvas)
+ console.log(_this.data.canvas.width)
+ console.log(_this.data.canvas.height)
+ let cs = (_this.data.canvas.height - _this.data.canvas.width)/2;
+ _this.setData({
+ "template.width": _this.data.canvas.height+"rpx",
+ "template.height": _this.data.canvas.width+"rpx",
+ "template.views[0].css.width": _this.data.canvas.width+"rpx",
+ "template.views[0].css.left": cs+"rpx",
+ "template.views[0].css.top": "-"+cs+"rpx",
+ "template.views[0].url": filePath,
+ "template.views[0].type": "image",
+ "template.views[0].css.rotate": "-90",
+ })
+ // _this.doUploadFile(event, 2, filePath);
}
})
},
-
+ onImgOK(e){
+ console.log("onImgOK onImgOK onImgOK onImgOK");
+ console.log(e.detail.path);
+ let txt_show = this.data.txt_show;
+ if(!txt_show){
+ this.doUploadFile(e, 2, e.detail.path);
+ }
+ },
doUploadFile(event, scene, filePath) {
console.log("index douploadFIle: ", event);
console.log("scene: ", scene);
@@ -121,5 +157,4 @@ Page({
console.error(errors);
})
}
-
-})
\ No newline at end of file
+})
diff --git a/Pages/yishi/signcanvas/index.json b/Pages/yishi/signcanvas/index.json
index dd1d0fe..ddc82d0 100644
--- a/Pages/yishi/signcanvas/index.json
+++ b/Pages/yishi/signcanvas/index.json
@@ -2,6 +2,8 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
- "van-button": "@vant/weapp/button/index"
- }
+ "van-button": "@vant/weapp/button/index",
+ "painter":"/commpents/painter/painter"
+ },
+ "disableScroll": true
}
\ No newline at end of file
diff --git a/Pages/yishi/signcanvas/index.wxml b/Pages/yishi/signcanvas/index.wxml
index adf2a30..33d7d12 100644
--- a/Pages/yishi/signcanvas/index.wxml
+++ b/Pages/yishi/signcanvas/index.wxml
@@ -7,4 +7,5 @@
清空
确认
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/Pages/yishi/system_notice/index.js b/Pages/yishi/system_notice/index.js
index b362c1a..6db00a2 100644
--- a/Pages/yishi/system_notice/index.js
+++ b/Pages/yishi/system_notice/index.js
@@ -1,3 +1,5 @@
+import { API } from './../../../utils/network/api'
+const api = new API()
const app = getApp()
Page({
data: {
@@ -7,23 +9,93 @@ Page({
},
height: app.globalData.height,
visible: false,
+ list: [],
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
+ static_host: api.getStaticHost()
},
go(e){
- wx.navigateTo({
- url: e.currentTarget.dataset.url,
- events: {
- // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
- acceptDataFromOpenedPage: function(data) {
- console.log(data)
- },
- someEvent: function(data) {
- console.log(data)
- }
- },
- success: function(res) {
- // 通过 eventChannel 向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
- }
+ this.putMessageReadNotice(e);
+ app.go(e.currentTarget.dataset.url);
+ },
+ onShow(){
+ this.setData({
+ list: [],
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
})
+ let ap = this.getList();
+ ap.then(res => {
+ this.check()
+ })
+ },
+ check(){
+ // 不满一页自动加载下一页
+ wx.createSelectorQuery().select('#list').boundingClientRect(res2 => {
+ console.log(res2.height)
+ console.log(wx.getSystemInfoSync().windowHeight)
+ if (res2.height < wx.getSystemInfoSync().windowHeight) {
+ this.getList().then(res => {
+ if(this.data.current_page < this.data.last_page){
+ this.check()
+ }
+ });
+ }
+ }).exec()
+ },
+ getList(){
+ let current_page = this.data.current_page;
+ current_page = current_page + 1;
+ this.setData({
+ current_page: current_page
+ })
+ let list = this.data.list;
+ return api.getDoctorMessageSystem({page: current_page}).then(response => {
+ console.log(response);
+ this.setData({
+ list: list.concat(response.data.data),
+ current_page: response.data.current_page,
+ total: response.data.total,
+ per_page: response.data.per_page,
+ last_page: response.data.last_page,
+ })
+ }).catch(errors => {console.error(errors);})
+ },
+ onReachBottom() {
+ console.log('===触底了!!===');
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getList()
+ }
+ },
+ putMessageReadNotice(e){
+ let notice_id = e.currentTarget.dataset.notice_id;
+ api.putMessageReadNotice({notice_id: notice_id}).then(response => {
+ console.log(response);
+
+ }).catch(errors => {console.error(errors);})
+ },
+ putMessageReadNoticeAll(){
+ api.putMessageReadNoticeAll({notice_type: 2}).then(response => {
+ console.log(response);
+ let new_list = [];
+ this.data.list.forEach(item => {
+ item.read_status = 1;
+ new_list.push(item)
+ })
+ this.setData({
+ list: new_list
+ })
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ wx.setStorageSync( userID+"_system_notice_unreadnnum", "");
+ wx.showToast({
+ title: '操作成功',
+ icon: "success"
+ })
+ }).catch(errors => {console.error(errors);})
}
})
\ No newline at end of file
diff --git a/Pages/yishi/system_notice/index.json b/Pages/yishi/system_notice/index.json
index ee34b87..c57d952 100644
--- a/Pages/yishi/system_notice/index.json
+++ b/Pages/yishi/system_notice/index.json
@@ -2,6 +2,10 @@
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
- "t-image": "tdesign-miniprogram/image/image"
- }
+ "van-image": "@vant/weapp/image/index",
+ "van-divider": "@vant/weapp/divider/index",
+ "van-empty": "@vant/weapp/empty/index"
+ },
+ "enablePullDownRefresh": false,
+ "onReachBottomDistance": 50
}
\ No newline at end of file
diff --git a/Pages/yishi/system_notice/index.wxml b/Pages/yishi/system_notice/index.wxml
index 2702ba0..1e8e45b 100644
--- a/Pages/yishi/system_notice/index.wxml
+++ b/Pages/yishi/system_notice/index.wxml
@@ -1,45 +1,22 @@
-
-
-
-
+
+
+
-
+
- 9月份的服务费结算通知
+ {{item.notice_brief_title}}
-
-
+
+
-
-
-
-
-
-
- 8月份的服务费结算通知
-
-
-
-
-
-
-
-
- 7月份的服务费结算通知
-
-
-
-
-
-
-
-
- 6月份的服务费结算通知
-
-
-
+
+
+ 到底了~
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/system_notice/index.wxss b/Pages/yishi/system_notice/index.wxss
index 4b11f53..4a648bf 100644
--- a/Pages/yishi/system_notice/index.wxss
+++ b/Pages/yishi/system_notice/index.wxss
@@ -1,11 +1,13 @@
-.container{
+page{
background-color: #F4F4F4;
- height: 100vh;
+}
+.container{
width: 100vw;
+ padding-top: 20rpx;
}
.list{
width: 92vw;
- margin: 20rpx auto;
+ margin: 0 auto;
}
.item{
display: flex;
@@ -21,6 +23,10 @@
display: flex;
align-items: center;
}
+.van_img{
+ display: flex;
+ justify-content: center;
+}
.item_content{
font-size: 34rpx;
color: #333333;
diff --git a/Pages/yishi/wenzhen/wenzhen.js b/Pages/yishi/wenzhen/wenzhen.js
index 9585f20..f3fe8b9 100644
--- a/Pages/yishi/wenzhen/wenzhen.js
+++ b/Pages/yishi/wenzhen/wenzhen.js
@@ -1,3 +1,7 @@
+import { API } from './../../../utils/network/api'
+import { getTimeAgo } from './../../../utils/util'
+import TIM from '../../../TUIKit/lib/tim-wx-sdk';
+const api = new API()
const app = getApp()
Page({
data: {
@@ -6,17 +10,47 @@ Page({
title: '问诊消息', //导航栏 中间的标题
},
height: app.globalData.height,
- has_data: true
+ has_data: true,
+ data_list_1: [],
+ data_list_2: [],
+ data_list_3: [],
+ data_list_4: [],
+ data_list_5: [],
+ message_inquiry_type: 2,
+ static_host: api.getStaticHost()
+ },
+ onLoad() {
+ console.log("wenzhen onload");
+
},
-
onShow: function () {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
active: 1 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
})
}
- },
+ let session_data_list_1 = wx.getStorageSync('session_data_list_1');
+ let session_data_list_2 = wx.getStorageSync('session_data_list_2');
+ let session_data_list_3 = wx.getStorageSync('session_data_list_3');
+ let session_data_list_4 = wx.getStorageSync('session_data_list_4');
+ if(!session_data_list_1) wx.setStorageSync('session_data_list_1', []);
+ if(!session_data_list_2) wx.setStorageSync('session_data_list_2', []);
+ if(!session_data_list_3) wx.setStorageSync('session_data_list_3', []);
+ if(!session_data_list_4) wx.setStorageSync('session_data_list_4', []);
+ this.setData({"data_list_1": session_data_list_1});
+ this.setData({"data_list_2": session_data_list_2});
+ this.setData({"data_list_3": session_data_list_3});
+ this.setData({"data_list_4": session_data_list_4});
+ if(session_data_list_1.length == 0) this.getDoctorInquiryMessage(1);
+ if(session_data_list_2.length == 0) this.getDoctorInquiryMessage(2);
+ if(session_data_list_3.length == 0) this.getDoctorInquiryMessage(3);
+ if(session_data_list_4.length == 0) this.getDoctorInquiryMessage(4);
+
+
+ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
+
+ },
go(e){
wx.navigateTo({
url: e.currentTarget.dataset.url,
@@ -34,5 +68,129 @@ Page({
res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
}
})
+ },
+
+ $onMessageReceived(value) {
+ const message = value.data[0];
+ console.log("message from wenzhen: ",message)
+ let cloudCustomData = JSON.parse(message.cloudCustomData);
+ let inquiry_type = cloudCustomData.inquiry_type;
+ let order_inquiry_id = cloudCustomData.order_inquiry_id;
+ let type = message.type;
+ let message_txt = "新消息";
+ console.log(type)
+ switch (type) {
+ case TIM.TYPES.MSG_TEXT:
+ console.log("文本消息");
+ message_txt = message.payload.text;
+ break;
+ case TIM.TYPES.MSG_IMAGE:
+ console.log("图片消息");
+ message_txt = "[图片]";
+ break;
+ case TIM.TYPES.MSG_AUDIO:
+ console.log("音频消息")
+ message_txt = "[语言]";
+ break;
+ case TIM.TYPES.MSG_VIDEO:
+ console.log("视频消息");
+ message_txt = "[视频]";
+ break;
+ case TIM.TYPES.MSG_FILE:
+ console.log("文件消息")
+ message_txt = "[文件]";
+ break;
+ case TIM.TYPES.MSG_CUSTOM:
+ console.log("自定义消息")
+ break;
+ case TIM.TYPES.MSG_MERGER:
+ console.log("合并消息")
+ break;
+ case TIM.TYPES.MSG_LOCATION:
+ console.log("位置消息")
+ message_txt = "[位置]";
+ break;
+ case TIM.TYPES.MSG_FACE:
+ console.log("表情消息")
+ message_txt = "[表情]";
+ break;
+ default:
+ break;
+ }
+ let list_name = "data_list_" + inquiry_type;
+ let _index = this.data[list_name].findIndex(item => {
+ return item.order_inquiry_id == order_inquiry_id;
+ })
+
+ let new_list = [];
+ //没有当前会话
+ if(_index > -1){
+ let target = list_name + "[" + _index + "].last_message_content.Text";
+ let target_dot = list_name + "[" + _index + "].message_dot";
+ console.log("target: ",target);
+ this.setData({
+ [target]: message_txt,
+ [target_dot]: true
+ })
+ new_list.push(this.data[list_name][_index]);//先放入目标
+ }else{
+ let item = {};
+ item.inquiry_status = message.inquiry_status;
+ let txt = {};
+ txt.Text= message_txt;
+ item.last_message_content = txt;
+ item.message_send_time = message.message_send_time;
+ item.message_seq = message.message_seq;
+ item.message_type = message.message_type;
+ item.order_inquiry_id = message.order_inquiry_id;
+ item.patient_age = message.patient_age;
+ item.patient_name = message.patient_name;
+ item.patient_sex = message.patient_sex;
+ item.to_user_id = message.to_user_id;
+ item.message_dot = true;
+ new_list.push(item);
+ }
+
+ //置顶
+ this.data[list_name].forEach((item, index) => {
+ if(index != _index){
+ new_list.push(item)
+ }
+ })
+
+ this.setData({
+ [list_name]: new_list
+ })
+
+ wx.setStorageSync('session_'+list_name, new_list);
+ },
+ getDoctorInquiryMessage(message_inquiry_type){
+ let list_name = "data_list_" + message_inquiry_type;
+ this.setData({
+ [list_name]: []
+ })
+ //获取医生问诊消息列表
+ api.getDoctorInquiryMessage({message_inquiry_type: message_inquiry_type}).then(response => {
+ console.log(response);
+ if(response.data){
+ console.log(list_name);
+ let data_list = this.data[list_name];
+ response.data.forEach((item) => {
+ item.message_send_time = getTimeAgo(item.message_send_time);
+ data_list.push(item);
+ })
+ this.setData({
+ [list_name]: data_list,
+ })
+ wx.setStorageSync('session_'+list_name, data_list);
+ }
+ }).catch(errors => {console.error(errors);})
+ },
+ onTabsChange(e){
+ console.log(e);
+ this.setData({
+ message_inquiry_type: e.detail.value,
+ })
+ this.getDoctorInquiryMessage(e.detail.value)
}
})
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen/wenzhen.json b/Pages/yishi/wenzhen/wenzhen.json
index 53dfaec..f31787c 100644
--- a/Pages/yishi/wenzhen/wenzhen.json
+++ b/Pages/yishi/wenzhen/wenzhen.json
@@ -3,9 +3,11 @@
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"wenzhen-data": "/commpents/wenzhen_data/index",
- "t-image": "tdesign-miniprogram/image/image",
+ "van-image": "@vant/weapp/image/index",
"t-tabs": "tdesign-miniprogram/tabs/tabs",
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
- "van-button": "@vant/weapp/button/index"
+ "t-badge": "tdesign-miniprogram/badge/badge",
+ "van-button": "@vant/weapp/button/index",
+ "van-empty": "@vant/weapp/empty/index"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen/wenzhen.wxml b/Pages/yishi/wenzhen/wenzhen.wxml
index 1b273e4..b9be12b 100644
--- a/Pages/yishi/wenzhen/wenzhen.wxml
+++ b/Pages/yishi/wenzhen/wenzhen.wxml
@@ -3,38 +3,41 @@
-
+
+
+
服务通知
-
+
+
+
系统公告
-
+
您还未设置在线问诊价格
开通图文问诊
-
+
+
+
+
+
-
+
+
+
+
+
-
-
+
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
diff --git a/Pages/yishi/wenzhen/wenzhen.wxss b/Pages/yishi/wenzhen/wenzhen.wxss
index 95dbf9b..933153a 100644
--- a/Pages/yishi/wenzhen/wenzhen.wxss
+++ b/Pages/yishi/wenzhen/wenzhen.wxss
@@ -1,10 +1,12 @@
-.container{
+page{
background-color: #F4F4F4;
+}
+.container{
width: 100vw;
- height: 100vh;
+ padding-top: 20rpx;
}
.top{
- margin: 30rpx auto;
+ margin: 0 auto 30rpx auto;
display: flex;
padding: 20rpx 20rpx;
background-color: rgb(255, 255, 255);
diff --git a/Pages/yishi/wenzhen_v2/substr.wxs b/Pages/yishi/wenzhen_v2/substr.wxs
new file mode 100644
index 0000000..7a50e2c
--- /dev/null
+++ b/Pages/yishi/wenzhen_v2/substr.wxs
@@ -0,0 +1,12 @@
+var filters = {//截取字符串返回
+ substring:function(str,start,end){
+ if(!str){
+ return
+ }
+ //也可做一些判断 //我不需要所以没做其他处理,直接返回的
+ return str.substring(start,end);
+ }
+}
+module.exports = {
+ substring:filters.substring
+}
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v2/wenzhen.js b/Pages/yishi/wenzhen_v2/wenzhen.js
new file mode 100644
index 0000000..2897e4a
--- /dev/null
+++ b/Pages/yishi/wenzhen_v2/wenzhen.js
@@ -0,0 +1,632 @@
+import { API } from './../../../utils/network/api'
+import { getTimeAgo } from './../../../utils/util'
+// import TIM from '../../../TUIKit/lib/tim-wx-sdk';
+const api = new API()
+const app = getApp()
+Page({
+ data: {
+ navbarData: {
+ showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '问诊消息', //导航栏 中间的标题
+ },
+ height: app.globalData.height,
+ static_host: api.getStaticHost(),
+ has_data: false,
+ data_list_1: [],//在线问诊
+ data_list_2: [],//快速问诊
+ data_list_3: [],//公益问诊
+ data_list_4: [], //问诊购药
+ data_list_5: [],//糖组检测
+ data_list_6: [],//问诊结束
+ data_list_6_loading: false,
+ conversationList: [],
+ message_inquiry_type: 99999,
+ now_message_inquiry_type: 6,
+ system_notice_unreadnnum: "",
+ service_notice_unreadnnum: "",
+ hasOnShow: false,
+ show: false,
+ show_dialog_from_account: "",
+ show_dialog_order_inquiry_id: "",
+ show_dialog_inquiry_type: "",
+ unreadnnum_inter: 0,
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
+ dot_1: false,
+ dot_2: false,
+ dot_3: false,
+ dot_4: false,
+ dot_5: false,
+ },
+ onLoad() {
+ // if(wx.$TUIKit){
+ // wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
+ // }else{
+ // app.imInit().then(res => {
+ // // console.log("wenzhen onload imInit");
+ // wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
+ // });
+ // }
+
+ //监听网络状态变化事件
+ wx.onNetworkStatusChange(function (res) {
+ // console.log("onNetworkStatusChange from wenzhen: ")
+ // console.log(res.isConnected)
+ // console.log(res.networkType)
+ // wx.showToast({
+ // title: '网络类型'+res.networkType,
+ // })
+ })
+
+ },
+ initInterval(){
+ let _this = this;
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let unreadnnum_inter = setInterval(() => {
+ let system_notice_unreadnnum = wx.getStorageSync(userID+"_system_notice_unreadnnum");
+ let service_notice_unreadnnum = wx.getStorageSync(userID+"_service_notice_unreadnnum");
+ this.setData({
+ system_notice_unreadnnum: system_notice_unreadnnum,
+ service_notice_unreadnnum: service_notice_unreadnnum,
+ })
+
+ if(_this.data.data_list_1.length > 0 || _this.data.data_list_2.length > 0 || _this.data.data_list_3.length > 0 || _this.data.data_list_4.length > 0 || _this.data.data_list_5.length > 0 || _this.data.data_list_6.length > 0){
+ _this.setData({
+ has_data: true
+ })
+ _this.selectComponent('#tabs').resize();
+ let getCurrentName = _this.selectComponent('#tabs').getCurrentName();
+ let now_message_inquiry_type = _this.data.now_message_inquiry_type;
+ if(getCurrentName != now_message_inquiry_type){
+ _this.setData({
+ now_message_inquiry_type: getCurrentName
+ })
+ }
+ }
+ }, 100);
+ this.setData({
+ unreadnnum_inter: unreadnnum_inter
+ })
+ // console.log("app.globalData.unreadnnum_inter: ", app.globalData.unreadnnum_inter);
+ },
+ onShow: function () {
+ //console.log("onShow from wenzhen V2")
+ if(this.data.hasOnShow){
+ wx.stopPullDownRefresh()
+ return;
+ }
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().setData({
+ active: 1 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
+ })
+
+ this.getTabBar().startInterval()
+ }
+ this.getDoctorInquiryFinishMessage();
+ this.getDoctorMessageNotice();
+ this.getConversationList();
+ if(this.data.unreadnnum_inter == 0){
+ this.initInterval();
+ }
+ //避免onshow加载多次
+ this.setData({
+ hasOnShow: true
+ })
+
+
+ if(wx.$TUIKit){
+ 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{
+ 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);
+ });
+ }
+ },
+ onHide(){
+ // console.log("onHideonHide from wenzhen")
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().stopInterval()
+ }
+ clearInterval(this.data.unreadnnum_inter)
+ this.setData({
+ hasOnShow: false,
+ data_list_1: [],
+ data_list_2: [],
+ data_list_3: [],
+ data_list_4: [],
+ data_list_5: [],
+ data_list_6: [],
+ message_inquiry_type: 9999,
+ now_message_inquiry_type: 5,
+ unreadnnum_inter: 0,
+ has_data: false,
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
+ dot_1: false,
+ dot_2: false,
+ dot_3: false,
+ dot_4: false,
+ dot_5: false,
+ })
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived);
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady);
+ },
+ onUnload(){
+ // console.log("onUnload from wenzhen")
+ this.setData({
+ hasOnShow: false,
+ message_inquiry_type: 9999,
+ now_message_inquiry_type: 6,
+ })
+ },
+ onSDKReady(){
+ console.log("onSDKReady from wenzhen");
+ this.getConversationList();
+ },
+ getConversationList(){
+ // console.log("getConversationListgetConversationListgetConversationList");
+ app.imInit().then(res => {
+ // console.log("wenzhen onload imInit: ", res);
+
+ wx.$TUIKit.getConversationList().then((imResponse) => {
+ // console.log("imResponse.data.conversationList from wenzhen_v2: ", imResponse.data.conversationList);
+ //console.log("监听会话接口列表")
+ console.log(imResponse.data.conversationList)
+ this.setData({
+ conversationList: imResponse.data.conversationList,
+ });
+ }).then(() => {
+ // console.log("开始查询订单状态")
+ this.formatStatus();
+ }).catch(error => {
+ console.error(error)
+ });
+ });
+ },
+ go(e){
+ this.setData({
+ show: false
+ })
+ let url = e.currentTarget.dataset.url;
+ let name = e.currentTarget.dataset.name;
+ wx.setStorageSync(name, 0);
+ app.go(url);
+ },
+ $onMessageReceived(value) {
+ const message = value.data[0];
+ // console.log("message from wenzhen: ",message)
+ this.getConversationList();
+ // let cloudCustomData = JSON.parse(message.cloudCustomData);
+ // let inquiry_type = cloudCustomData.inquiry_type;
+ // let order_inquiry_id = cloudCustomData.order_inquiry_id;
+ // let type = message.type;
+ // let message_txt = "新消息";
+ // console.log(type)
+ // switch (type) {
+ // case TIM.TYPES.MSG_TEXT:
+ // console.log("文本消息");
+ // message_txt = message.payload.text;
+ // break;
+ // case TIM.TYPES.MSG_IMAGE:
+ // console.log("图片消息");
+ // message_txt = "[图片]";
+ // break;
+ // case TIM.TYPES.MSG_AUDIO:
+ // console.log("音频消息")
+ // message_txt = "[语言]";
+ // break;
+ // case TIM.TYPES.MSG_VIDEO:
+ // console.log("视频消息");
+ // message_txt = "[视频]";
+ // break;
+ // case TIM.TYPES.MSG_FILE:
+ // console.log("文件消息")
+ // message_txt = "[文件]";
+ // break;
+ // case TIM.TYPES.MSG_CUSTOM:
+ // console.log("自定义消息")
+ // break;
+ // case TIM.TYPES.MSG_MERGER:
+ // console.log("合并消息")
+ // break;
+ // case TIM.TYPES.MSG_LOCATION:
+ // console.log("位置消息")
+ // message_txt = "[位置]";
+ // break;
+ // case TIM.TYPES.MSG_FACE:
+ // console.log("表情消息")
+ // message_txt = "[表情]";
+ // break;
+ // default:
+ // break;
+ // }
+ // let list_name = "data_list_" + inquiry_type;
+ // let _index = this.data[list_name].findIndex(item => {
+ // return item.order_inquiry_id == order_inquiry_id;
+ // })
+
+ // let new_list = [];
+ // //没有当前会话
+ // if(_index > -1){
+ // let target = list_name + "[" + _index + "].last_message_content.Text";
+ // let target_dot = list_name + "[" + _index + "].message_dot";
+ // console.log("target: ",target);
+ // this.setData({
+ // [target]: message_txt,
+ // [target_dot]: true
+ // })
+ // new_list.push(this.data[list_name][_index]);//先放入目标
+ // }else{
+ // let item = {};
+ // item.inquiry_status = message.inquiry_status;
+ // let txt = {};
+ // txt.Text= message_txt;
+ // item.last_message_content = txt;
+ // item.message_send_time = message.message_send_time;
+ // item.message_seq = message.message_seq;
+ // item.message_type = message.message_type;
+ // item.order_inquiry_id = message.order_inquiry_id;
+ // item.patient_age = message.patient_age;
+ // item.patient_name = message.patient_name;
+ // item.patient_sex = message.patient_sex;
+ // item.to_user_id = message.to_user_id;
+ // item.message_dot = true;
+ // new_list.push(item);
+ // }
+
+ // //置顶
+ // this.data[list_name].forEach((item, index) => {
+ // if(index != _index){
+ // new_list.push(item)
+ // }
+ // })
+
+ // this.setData({
+ // [list_name]: new_list
+ // })
+
+ },
+ formatStatus(){
+ let order_inquiry_id_list = [];
+ order_inquiry_id_list.push("");//初始化一个,防止失败
+ console.log(this.data.conversationList.length)
+ let arr=this.data.conversationList.filter(item => item.conversationID != 'C2Cadministrator');
+
+ arr.forEach(item => {
+ let conversationID = item.conversationID;
+ console.warn("conversationID: ", conversationID)
+ // if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson;
+ try {
+ if(!cloudCustomData){
+ return
+ }
+ cloudCustomDataJson = JSON.parse(cloudCustomData);
+ } catch (error) {
+ // console.log(error);
+ return;
+ }
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ order_inquiry_id_list.push(order_inquiry_id);//准备去请求后端那订单状态
+ })
+ let conversationList = arr; //this.data.conversationList;
+ //获取医生问诊消息用户属性
+ api.getDoctorInquiryMessageAttr({order_inquiry_ids: order_inquiry_id_list.join(",")}).then(response => {
+ let new_conversationList = [];
+ if(response.data.length > 0){
+ conversationList.forEach(item => {
+ let conversationID = item.conversationID;
+ //if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson;
+ try {
+ if(!item.lastMessage.cloudCustomData){
+ return
+ }
+ cloudCustomDataJson = JSON.parse(item.lastMessage.cloudCustomData);
+ } catch (error) {
+ return;
+ }
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ let order = response.data.find(attr_item => {
+ return attr_item.order_inquiry_id == order_inquiry_id;
+ })
+ if(!order) return;
+
+ let inquiry_status = order.inquiry_status;
+ //inquiry_status 状态
+ if(inquiry_status !=3 && inquiry_status != 4){
+ return;
+ }
+ item.inquiry_status = inquiry_status;
+ item.patient_age = order.patient_age;
+ item.patient_name = order.patient_name;
+ item.patient_sex = order.patient_sex;
+ new_conversationList.push(item);
+ })
+ };
+ console.log(new_conversationList);
+ this.setData({
+ conversationList: new_conversationList
+ })
+ }).then(() => {
+ // console.log("开始格式化formatConversationList")
+ this.formatConversationList();
+ }).catch(errors => {console.error(errors);})
+ },
+ formatConversationList(){
+ let session_list = [];
+
+ let session_data_list_1 = [];
+ let session_data_list_2 = [];
+ let session_data_list_3 = [];
+ let session_data_list_4 = [];
+ let session_data_list_5 = [];
+ let session_data_list_6 = [];
+ session_list.push(session_data_list_1);
+ session_list.push(session_data_list_2);
+ session_list.push(session_data_list_3);
+ session_list.push(session_data_list_4);
+ session_list.push(session_data_list_5);
+ session_list.push(session_data_list_6);
+
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let totalUnreadCount = 0;
+ let message_inquiry_type = this.data.message_inquiry_type;
+ console.log(this.data.conversationList);
+ this.data.conversationList.forEach(item => {
+ let conversationID = item.conversationID;
+ if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ let type = lastMessage.type;
+ let userProfile = item.userProfile;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson = JSON.parse(cloudCustomData);
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ if(!order_inquiry_id) return;
+ let inquiry_type = cloudCustomDataJson.inquiry_type;
+ if(!inquiry_type) return;
+ if(inquiry_type > 5) return;
+ if(inquiry_type < message_inquiry_type){
+ message_inquiry_type = inquiry_type;
+ }
+ //去重order_inquiry_id
+ let index = this.checkOrderInquiryId(session_list[inquiry_type - 1], order_inquiry_id);
+ if(index > -1) return;
+ let patient_family_data = cloudCustomDataJson.patient_family_data;
+ if(patient_family_data == undefined) return;
+ // console.log("patient_family_data: ", patient_family_data);
+ let session_item = {};
+ session_item.inquiry_status = item.inquiry_status;//订单状态暂无
+ let txt = {};
+ if(lastMessage.messageForShow == "[自定义消息]"){
+ let text = "系统消息";
+ let payload = lastMessage.payload;
+ if(payload && payload.data) {
+ // console.log("payload: ",payload.data);
+ let payloadJson = JSON.parse(payload.data);
+ text = payloadJson.title.replaceAll(/—/g, "");
+ }
+ lastMessage.messageForShow = text;
+ }
+ if(lastMessage.isRevoked){
+ if(lastMessage.fromAccount == app.globalData.config.userID){
+ lastMessage.messageForShow = "你撤回了一条消息";
+ }else{
+ lastMessage.messageForShow = "对方撤回了一条消息";
+ }
+ }
+ txt.Text= lastMessage.messageForShow;
+ session_item.last_message_content = txt;
+ session_item.message_send_time = getTimeAgo(lastMessage.lastTime);
+ session_item.message_type = type;
+ session_item.order_inquiry_id = order_inquiry_id;
+ session_item.inquiry_type = inquiry_type;
+ session_item.patient_age = patient_family_data.patient_age;
+ session_item.patient_name = patient_family_data.patient_name;
+ session_item.patient_sex = patient_family_data.patient_sex;
+ session_item.from_account = userProfile.userID;
+ let unreadCount = item.unreadCount;
+ if(unreadCount > 0){
+ totalUnreadCount = totalUnreadCount + unreadCount;
+ session_item.message_dot = true;
+ let dot_name = "dot_"+inquiry_type
+ this.setData({
+ [dot_name]: true
+ })
+ }else{
+ if(item.inquiry_status == 3){
+ totalUnreadCount = totalUnreadCount + 1;
+ session_item.message_dot = true;
+ let dot_name = "dot_"+inquiry_type
+ this.setData({
+ [dot_name]: true
+ })
+ }else{
+ session_item.message_dot = false;
+ }
+ }
+ session_list[inquiry_type - 1].push(session_item);
+ console.log("--------------------")
+ console.log(session_list)
+ })
+
+
+ wx.setStorageSync(userID+'_wenzhen_info', totalUnreadCount);
+
+ console.log(session_data_list_3)
+ this.setData({
+ data_list_1: session_data_list_1,
+ data_list_2: session_data_list_2,
+ data_list_3: session_data_list_3,
+ data_list_4: session_data_list_4,
+ data_list_5: session_data_list_5,
+ message_inquiry_type: message_inquiry_type
+ })
+ wx.stopPullDownRefresh()
+ // this.selectComponent('#tabs').resize();
+
+ },
+ checkOrderInquiryId(list, order_inquiry_id){
+ let index = list.findIndex(item => {
+ return item.order_inquiry_id == order_inquiry_id;
+ })
+ return index;
+ },
+ onTabsChange(e){
+ // console.log(e);
+ },
+ goChat(e){
+ this.setData({
+ show: false
+ })
+
+ // console.log("开始订阅消息");
+ // wx.requestSubscribeMessage({
+ // tmplIds: ['jhYUf91ULCTX_f69hazqAYwImdFf8ELasRAwB6X-MTM'],
+ // success (res) {
+ // console.log(res);
+ // }
+ // })
+
+ let from_account = e.currentTarget.dataset.from_account;
+ let order_inquiry_id = e.currentTarget.dataset.order_inquiry_id;
+ let from= e.currentTarget.dataset.from;
+ let inquiry_type = e.currentTarget.dataset.inquiry_type;
+ let url='';
+
+ //from=end代表从问诊接触过来,from=prescription 代表从处方管理进来
+ //主要处理有新的问诊还停留在老的聊天问诊里的bug。
+ if(from){
+ url = e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type+"&from="+from;
+ }else{
+ url = e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type;
+ }
+
+ app.go(url);
+ },
+ postDoctorInquiry(e){
+ this.setData({
+ show: false
+ })
+ // console.log("order_inquiry_id: ", e.currentTarget.dataset.order_inquiry_id);
+ let params = {};
+ params.order_inquiry_id = e.currentTarget.dataset.order_inquiry_id;
+ // console.log("params: ",params)
+ api.postDoctorInquiry(params).then(response => {
+ // console.log("开始接诊");
+ // console.log(response);
+ }).then(() => {
+ this.goChat(e);
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ //获取上方角标
+ getDoctorMessageNotice(e){
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ api.getDoctorMessageNotice().then(response => {
+ let service_message_notice = response.data.service_message_notice;
+ let system_message_notice = response.data.system_message_notice;
+ wx.setStorageSync(userID+"_service_notice_unreadnnum", service_message_notice==true?1:"");//3、医生端系统通知
+ wx.setStorageSync(userID+"_system_notice_unreadnnum", system_message_notice);//4、医生端服务通知
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ tabShow(e){
+ let show_dialog_from_account = e.currentTarget.dataset.show_dialog_from_account;
+ let show_dialog_order_inquiry_id = e.currentTarget.dataset.show_dialog_order_inquiry_id;
+ let show_dialog_inquiry_type = e.currentTarget.dataset.show_dialog_inquiry_type;
+ // console.log("tabShowtabShowtabShowtabShow");
+ this.setData({
+ show_dialog_from_account: show_dialog_from_account,
+ show_dialog_order_inquiry_id: show_dialog_order_inquiry_id,
+ show_dialog_inquiry_type: show_dialog_inquiry_type,
+ show: true
+ })
+ },
+ onClose(){
+ // console.log("onCloseonCloseonCloseonClose")
+ this.setData({
+ show: false
+ })
+ },
+ onTabClick(e){
+ if(e.detail.name==6){
+ this.setData({
+ current_page:0,
+ data_list_6:[]
+ })
+ //点击请求数据为0,则重新渲染页面
+ this.getDoctorInquiryFinishMessage('end');
+ }
+ },
+ vanTabsChange(e){
+ //console.log(e)
+ this.setData({
+ now_message_inquiry_type: e.detail.name
+ });
+
+ },
+ onPullDownRefresh(){
+ // console.log("用户下拉动作")
+ this.onHide();
+ this.onShow();
+ },
+ onReachBottom() {
+ // console.log('===触底了!!===');
+ let now_message_inquiry_type = this.data.now_message_inquiry_type;
+ if(now_message_inquiry_type == 6){
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getDoctorInquiryFinishMessage()
+ }
+ }
+ },
+ getDoctorInquiryFinishMessage(from=''){
+ let data_list_6= this.data.data_list_6;
+ let params = {};
+ params.page = this.data.current_page + 1;
+ this.setData({data_list_6_loading: true})
+ api.getDoctorInquiryFinishMessage(params).then(response => {
+ // console.log(response);
+
+ this.setData({
+ "data_list_6": data_list_6.concat(response.data.data),
+ current_page: response.data.current_page,
+ total: response.data.total,
+ per_page: response.data.per_page,
+ last_page: response.data.last_page
+ })
+ if(from && response.data.data.length==0){
+ this.formatStatus();
+ }
+ // this.selectComponent('#tabs').resize();
+ }).then(res =>{
+ this.setData({ data_list_6_loading: false})
+ }).catch(errors => {
+ this.setData({ data_list_6_loading: false})
+ console.error(errors);
+ })
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v2/wenzhen.json b/Pages/yishi/wenzhen_v2/wenzhen.json
new file mode 100644
index 0000000..f52e3e5
--- /dev/null
+++ b/Pages/yishi/wenzhen_v2/wenzhen.json
@@ -0,0 +1,21 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "wenzhen-data": "/commpents/wenzhen_data/index",
+ "t-tabs": "tdesign-miniprogram/tabs/tabs",
+ "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
+ "t-badge": "tdesign-miniprogram/badge/badge",
+ "van-button": "@vant/weapp/button/index",
+ "van-empty": "@vant/weapp/empty/index",
+ "van-image": "@vant/weapp/image/index",
+ "van-tab": "@vant/weapp/tab/index",
+ "van-tabs": "@vant/weapp/tabs/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog",
+ "van-divider": "@vant/weapp/divider/index",
+ "van-loading": "@vant/weapp/loading/index",
+ "van-dialog": "@vant/weapp/dialog/index"
+ },
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 100
+}
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v2/wenzhen.wxml b/Pages/yishi/wenzhen_v2/wenzhen.wxml
new file mode 100644
index 0000000..e4fe8fa
--- /dev/null
+++ b/Pages/yishi/wenzhen_v2/wenzhen.wxml
@@ -0,0 +1,434 @@
+
+
+
+
+
+
+
+
+
+
+ 服务通知
+
+
+
+
+
+
+
+
+
+ 系统公告
+
+
+
+
+
+
+ 未收到任何消息
+
+ 加载中...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+
+ 不接诊5分钟后自动取消
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+
+ 不接诊5分钟后自动取消
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+
+ 不接诊5分钟后自动取消
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+
+ 不接诊5分钟后自动取消
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+ 不接诊72小时后自动取消
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{dateSubstr.substring(item.complete_time,0,10)}}
+
+ 问诊已结束
+
+ {{ item.inquiry_type==1?'专家问诊':item.inquiry_type==2?'快速问诊':item.inquiry_type==3?'公益问诊':item.inquiry_type==4?'问诊购药':item.inquiry_type==5?'糖组检测':'其他' }}
+
+ 不接诊24小时后自动取消
+
+
+
+ 加载中...
+
+
+ 到底了~
+
+
+
+
+
+
+
+
+ 去查看
+ 去接诊
+
+
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v2/wenzhen.wxss b/Pages/yishi/wenzhen_v2/wenzhen.wxss
new file mode 100644
index 0000000..ddfbe73
--- /dev/null
+++ b/Pages/yishi/wenzhen_v2/wenzhen.wxss
@@ -0,0 +1,144 @@
+page{
+ background-color: #F4F4F4;
+}
+.container{
+ width: 100vw;
+ padding-top: 20rpx;
+}
+.top{
+ margin: 0 auto 30rpx auto;
+ display: flex;
+ padding: 20rpx 20rpx;
+ background-color: rgb(255, 255, 255);
+}
+.top_left, .top_right{
+ flex: 1;
+ text-align: center;
+ display: flex;
+ flex-direction: column;
+ color: #666666;
+ font-size: 28rpx;
+}
+.top_left{
+ border-right: 1px solid #F4F4F4;
+}
+.t-tab-panel,.t-tabs__content {
+ background-color: #F4F4F4 !important;
+}
+.t-tabs__item--active{
+ color: #49B9AD !important;
+ font-size: 32rpx !important;
+}
+.t-tabs__item-inner--line{
+ font-size: 28rpx !important;
+}
+.t-tabs__track{
+ background-color: var(--td-tab-track-color, var(--td-primary-color, #49B9AD)) !important;
+}
+.empty{
+ width: 92vw;
+ margin: 0 auto;
+ height: 500rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+}
+.empty_note{
+ font-size: 24rpx;
+ color: #999999;
+ margin-top: 30rpx;
+}
+.badge--t-badge {
+ vertical-align: baseline !important;
+}
+
+
+
+
+
+
+.content{
+ background-color: #fff;
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 20rpx;
+}
+.content_1,.content_3,.content_2{
+ display: flex;
+ justify-content: space-between;
+ margin: 20rpx 30rpx;
+ align-items: center;
+}
+.content_1,.content_3{
+ flex: 5;
+}
+.name{
+ font-size: 30rpx;
+ color: #666666;
+ height: 50rpx;
+ line-height: 50rpx;
+ display: flex;
+}
+.date{
+ font-size: 30rpx;
+ color: #999;
+}
+.content_2{
+ background-color: #FAFAFA;
+ font-size: 26rpx;
+ color: #999999;
+ min-height: 70rpx;
+ padding: 10rpx 20rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display: block;
+ line-height: 70rpx;
+}
+.status{
+ font-size: 26rpx;
+ color: #FA541C;
+ flex: 1;
+}
+.status_end{
+ color: #666666;
+}
+.btn{
+ flex: 2;
+ display: flex;
+ justify-content: flex-end;
+}
+.content_4{
+ flex: 5;
+ font-size: 24rpx;
+ color: #E34D59;
+ justify-self:flex-end;
+ text-align:right;
+ display: flex;
+ justify-content: flex-end;
+ border-top: 1px solid #E3E4E5;
+ align-items: center;
+ margin: 0 30rpx;
+ min-height: 70rpx;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
+.empty_box{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
diff --git a/Pages/yishi/wenzhen_v3/substr.wxs b/Pages/yishi/wenzhen_v3/substr.wxs
new file mode 100644
index 0000000..7a50e2c
--- /dev/null
+++ b/Pages/yishi/wenzhen_v3/substr.wxs
@@ -0,0 +1,12 @@
+var filters = {//截取字符串返回
+ substring:function(str,start,end){
+ if(!str){
+ return
+ }
+ //也可做一些判断 //我不需要所以没做其他处理,直接返回的
+ return str.substring(start,end);
+ }
+}
+module.exports = {
+ substring:filters.substring
+}
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v3/wenzhen.js b/Pages/yishi/wenzhen_v3/wenzhen.js
new file mode 100644
index 0000000..126379e
--- /dev/null
+++ b/Pages/yishi/wenzhen_v3/wenzhen.js
@@ -0,0 +1,576 @@
+import { API } from './../../../utils/network/api'
+import { getTimeAgo } from './../../../utils/util'
+// import TIM from '../../../TUIKit/lib/tim-wx-sdk';
+const api = new API()
+const app = getApp()
+Page({
+ data: {
+ navbarData: {
+ showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '问诊消息', //导航栏 中间的标题
+ },
+ height: app.globalData.height,
+ has_data: false,
+ data_list_1: [],
+ data_list_2: [],
+ data_list_3: [],
+ data_list_4: [],
+ data_list_5: [],
+ data_list_5_loading: false,
+ static_host: api.getStaticHost(),
+ conversationList: [],
+ message_inquiry_type: 99999,
+ now_message_inquiry_type: 5,
+ system_notice_unreadnnum: "",
+ service_notice_unreadnnum: "",
+ hasOnShow: false,
+ show: false,
+ show_dialog_from_account: "",
+ show_dialog_order_inquiry_id: "",
+ show_dialog_inquiry_type: "",
+ unreadnnum_inter: 0,
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
+ dot_1: false,
+ dot_2: false,
+ dot_3: false,
+ dot_4: false,
+ },
+ onLoad() {
+ console.log("wenzhen onloadddd");
+
+ // if(wx.$TUIKit){
+ // wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
+ // }else{
+ // app.imInit().then(res => {
+ // console.log("wenzhen onload imInit");
+ // wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
+ // });
+ // }
+
+ //监听网络状态变化事件
+ wx.onNetworkStatusChange(function (res) {
+ console.log("onNetworkStatusChange from wenzhen: ")
+ console.log(res.isConnected)
+ console.log(res.networkType)
+ // wx.showToast({
+ // title: '网络类型'+res.networkType,
+ // })
+ })
+
+ },
+ initInterval(){
+ let _this = this;
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let unreadnnum_inter = setInterval(() => {
+ let system_notice_unreadnnum = wx.getStorageSync(userID+"_system_notice_unreadnnum");
+ let service_notice_unreadnnum = wx.getStorageSync(userID+"_service_notice_unreadnnum");
+ this.setData({
+ system_notice_unreadnnum: system_notice_unreadnnum,
+ service_notice_unreadnnum: service_notice_unreadnnum,
+ })
+
+ if(_this.data.data_list_1.length > 0 || _this.data.data_list_2.length > 0 || _this.data.data_list_3.length > 0 || _this.data.data_list_4.length > 0 || _this.data.data_list_5.length > 0){
+ _this.setData({
+ has_data: true
+ })
+ _this.selectComponent('#tabs').resize();
+ let getCurrentName = _this.selectComponent('#tabs').getCurrentName();
+ let now_message_inquiry_type = _this.data.now_message_inquiry_type;
+ if(getCurrentName != now_message_inquiry_type){
+ _this.setData({
+ now_message_inquiry_type: getCurrentName
+ })
+ }
+ }
+ }, 100);
+ this.setData({
+ unreadnnum_inter: unreadnnum_inter
+ })
+ console.log("app.globalData.unreadnnum_inter: ", app.globalData.unreadnnum_inter);
+ },
+ onShow: function () {
+ console.log("onShow from wenzhen V2")
+ if(this.data.hasOnShow){
+ wx.stopPullDownRefresh()
+ return;
+ }
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().setData({
+ active: 1 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
+ })
+
+ this.getTabBar().startInterval()
+ }
+ this.getDoctorInquiryFinishMessage();
+ this.getDoctorMessageNotice();
+ this.getConversationList();
+ if(this.data.unreadnnum_inter == 0){
+ this.initInterval();
+ }
+ //避免onshow加载多次
+ this.setData({
+ hasOnShow: true
+ })
+
+
+ if(wx.$TUIKit){
+ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
+ }else{
+ app.imInit().then(res => {
+ console.log("wenzhen onload imInit");
+ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived, this);
+ });
+ }
+ },
+ onHide(){
+ console.log("onHideonHide from wenzhen")
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().stopInterval()
+ }
+ clearInterval(this.data.unreadnnum_inter)
+ this.setData({
+ hasOnShow: false,
+ data_list_1: [],
+ data_list_2: [],
+ data_list_3: [],
+ data_list_4: [],
+ data_list_5: [],
+ message_inquiry_type: 9999,
+ now_message_inquiry_type: 5,
+ unreadnnum_inter: 0,
+ has_data: false,
+ current_page: 0,
+ total: 0,
+ per_page: 0,
+ last_page: 0,
+ dot_1: false,
+ dot_2: false,
+ dot_3: false,
+ dot_4: false,
+ })
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onMessageReceived);
+ },
+ onUnload(){
+ console.log("onUnload from wenzhen")
+ this.setData({
+ hasOnShow: false,
+ message_inquiry_type: 9999,
+ now_message_inquiry_type: 5,
+ })
+ },
+ getConversationList(){
+ console.log("getConversationListgetConversationListgetConversationList");
+ app.imInit().then(res => {
+ console.log("wenzhen onload imInit: ", res);
+ wx.$TUIKit.getConversationList().then((imResponse) => {
+ console.log("imResponse.data.conversationList from wenzhen_v2: ", imResponse.data.conversationList);
+ this.setData({
+ conversationList: imResponse.data.conversationList,
+ });
+ }).then(() => {
+ console.log("开始查询订单状态")
+ this.formatStatus();
+ }).catch(error => {
+ console.log(error)
+ });
+ });
+ },
+ go(e){
+ this.setData({
+ show: false
+ })
+ let url = e.currentTarget.dataset.url;
+ let name = e.currentTarget.dataset.name;
+ wx.setStorageSync(name, 0);
+ app.go(url);
+ },
+ $onMessageReceived(value) {
+ const message = value.data[0];
+ console.log("message from wenzhen: ",message)
+ this.getConversationList();
+ // let cloudCustomData = JSON.parse(message.cloudCustomData);
+ // let inquiry_type = cloudCustomData.inquiry_type;
+ // let order_inquiry_id = cloudCustomData.order_inquiry_id;
+ // let type = message.type;
+ // let message_txt = "新消息";
+ // console.log(type)
+ // switch (type) {
+ // case TIM.TYPES.MSG_TEXT:
+ // console.log("文本消息");
+ // message_txt = message.payload.text;
+ // break;
+ // case TIM.TYPES.MSG_IMAGE:
+ // console.log("图片消息");
+ // message_txt = "[图片]";
+ // break;
+ // case TIM.TYPES.MSG_AUDIO:
+ // console.log("音频消息")
+ // message_txt = "[语言]";
+ // break;
+ // case TIM.TYPES.MSG_VIDEO:
+ // console.log("视频消息");
+ // message_txt = "[视频]";
+ // break;
+ // case TIM.TYPES.MSG_FILE:
+ // console.log("文件消息")
+ // message_txt = "[文件]";
+ // break;
+ // case TIM.TYPES.MSG_CUSTOM:
+ // console.log("自定义消息")
+ // break;
+ // case TIM.TYPES.MSG_MERGER:
+ // console.log("合并消息")
+ // break;
+ // case TIM.TYPES.MSG_LOCATION:
+ // console.log("位置消息")
+ // message_txt = "[位置]";
+ // break;
+ // case TIM.TYPES.MSG_FACE:
+ // console.log("表情消息")
+ // message_txt = "[表情]";
+ // break;
+ // default:
+ // break;
+ // }
+ // let list_name = "data_list_" + inquiry_type;
+ // let _index = this.data[list_name].findIndex(item => {
+ // return item.order_inquiry_id == order_inquiry_id;
+ // })
+
+ // let new_list = [];
+ // //没有当前会话
+ // if(_index > -1){
+ // let target = list_name + "[" + _index + "].last_message_content.Text";
+ // let target_dot = list_name + "[" + _index + "].message_dot";
+ // console.log("target: ",target);
+ // this.setData({
+ // [target]: message_txt,
+ // [target_dot]: true
+ // })
+ // new_list.push(this.data[list_name][_index]);//先放入目标
+ // }else{
+ // let item = {};
+ // item.inquiry_status = message.inquiry_status;
+ // let txt = {};
+ // txt.Text= message_txt;
+ // item.last_message_content = txt;
+ // item.message_send_time = message.message_send_time;
+ // item.message_seq = message.message_seq;
+ // item.message_type = message.message_type;
+ // item.order_inquiry_id = message.order_inquiry_id;
+ // item.patient_age = message.patient_age;
+ // item.patient_name = message.patient_name;
+ // item.patient_sex = message.patient_sex;
+ // item.to_user_id = message.to_user_id;
+ // item.message_dot = true;
+ // new_list.push(item);
+ // }
+
+ // //置顶
+ // this.data[list_name].forEach((item, index) => {
+ // if(index != _index){
+ // new_list.push(item)
+ // }
+ // })
+
+ // this.setData({
+ // [list_name]: new_list
+ // })
+
+ },
+ formatStatus(){
+ let order_inquiry_id_list = [];
+ order_inquiry_id_list.push("");//初始化一个,防止失败
+ this.data.conversationList.forEach(item => {
+ let conversationID = item.conversationID;
+ if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson;
+ try {
+ cloudCustomDataJson = JSON.parse(cloudCustomData);
+ } catch (error) {
+ console.log(error);
+ return;
+ }
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ order_inquiry_id_list.push(order_inquiry_id);//准备去请求后端那订单状态
+ })
+ let conversationList = this.data.conversationList;
+ //获取医生问诊消息用户属性
+ api.getDoctorInquiryMessageAttr({order_inquiry_ids: order_inquiry_id_list.join(",")}).then(response => {
+ let new_conversationList = [];
+ if(response.data.length > 0){
+ conversationList.forEach(item => {
+ let conversationID = item.conversationID;
+ if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson;
+ try {
+ cloudCustomDataJson = JSON.parse(item.lastMessage.cloudCustomData);
+ } catch (error) {
+ return;
+ }
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ let order = response.data.find(attr_item => {
+ return attr_item.order_inquiry_id == order_inquiry_id;
+ })
+ if(!order) return;
+
+ let inquiry_status = order.inquiry_status;
+ //inquiry_status 状态
+ if(inquiry_status !=3 && inquiry_status != 4){
+ return;
+ }
+ item.inquiry_status = inquiry_status;
+ item.patient_age = order.patient_age;
+ item.patient_name = order.patient_name;
+ item.patient_sex = order.patient_sex;
+ new_conversationList.push(item);
+ })
+ }
+ this.setData({
+ conversationList: new_conversationList
+ })
+ }).then(() => {
+ console.log("开始格式化formatConversationList")
+ this.formatConversationList();
+ }).catch(errors => {console.error(errors);})
+ },
+ formatConversationList(){
+ let session_list = [];
+ let session_data_list_1 = [];
+ let session_data_list_2 = [];
+ let session_data_list_3 = [];
+ let session_data_list_4 = [];
+ let session_data_list_5 = [];
+ session_list.push(session_data_list_1);
+ session_list.push(session_data_list_2);
+ session_list.push(session_data_list_3);
+ session_list.push(session_data_list_4);
+ session_list.push(session_data_list_5);
+
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let totalUnreadCount = 0;
+ let message_inquiry_type = this.data.message_inquiry_type;
+
+ this.data.conversationList.forEach(item => {
+ let conversationID = item.conversationID;
+ if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ let type = lastMessage.type;
+ let userProfile = item.userProfile;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson = JSON.parse(cloudCustomData);
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ if(!order_inquiry_id) return;
+ let inquiry_type = cloudCustomDataJson.inquiry_type;
+ if(!inquiry_type) return;
+ if(inquiry_type > 4) return;
+ if(inquiry_type < message_inquiry_type){
+ message_inquiry_type = inquiry_type;
+ }
+ //去重order_inquiry_id
+ let index = this.checkOrderInquiryId(session_list[inquiry_type - 1], order_inquiry_id);
+ if(index > -1) return;
+ let patient_family_data = cloudCustomDataJson.patient_family_data;
+ if(patient_family_data == undefined) return;
+ console.log("patient_family_data: ", patient_family_data);
+ let session_item = {};
+ session_item.inquiry_status = item.inquiry_status;//订单状态暂无
+ let txt = {};
+ if(lastMessage.messageForShow == "[自定义消息]"){
+ let text = "自定义消息";
+ let payload = lastMessage.payload;
+ if(payload) {
+ console.log("payload: ",payload.data);
+ let payloadJson = JSON.parse(payload.data);
+ text = payloadJson.title.replaceAll(/—/g, "");
+ }
+ lastMessage.messageForShow = text;
+ }
+ if(lastMessage.isRevoked){
+ if(lastMessage.fromAccount == app.globalData.config.userID){
+ lastMessage.messageForShow = "你撤回了一条消息";
+ }else{
+ lastMessage.messageForShow = "对方撤回了一条消息";
+ }
+ }
+ txt.Text= lastMessage.messageForShow;
+ session_item.last_message_content = txt;
+ session_item.message_send_time = getTimeAgo(lastMessage.lastTime);
+ session_item.message_type = type;
+ session_item.order_inquiry_id = order_inquiry_id;
+ session_item.inquiry_type = inquiry_type;
+ session_item.patient_age = patient_family_data.patient_age;
+ session_item.patient_name = patient_family_data.patient_name;
+ session_item.patient_sex = patient_family_data.patient_sex;
+ session_item.from_account = userProfile.userID;
+ let unreadCount = item.unreadCount;
+ if(unreadCount > 0){
+ totalUnreadCount = totalUnreadCount + unreadCount;
+ session_item.message_dot = true;
+ let dot_name = "dot_"+inquiry_type
+ this.setData({
+ [dot_name]: true
+ })
+ }else{
+ if(item.inquiry_status == 3){
+ totalUnreadCount = totalUnreadCount + 1;
+ session_item.message_dot = true;
+ let dot_name = "dot_"+inquiry_type
+ this.setData({
+ [dot_name]: true
+ })
+ }else{
+ session_item.message_dot = false;
+ }
+ }
+ session_list[inquiry_type - 1].push(session_item);
+ })
+
+
+ wx.setStorageSync(userID+'_wenzhen_info', totalUnreadCount);
+
+
+ this.setData({
+ data_list_1: session_data_list_1,
+ data_list_2: session_data_list_2,
+ data_list_3: session_data_list_3,
+ data_list_4: session_data_list_4,
+ message_inquiry_type: message_inquiry_type
+ })
+ wx.stopPullDownRefresh()
+ // this.selectComponent('#tabs').resize();
+
+ },
+ checkOrderInquiryId(list, order_inquiry_id){
+ let index = list.findIndex(item => {
+ return item.order_inquiry_id == order_inquiry_id;
+ })
+ return index;
+ },
+ onTabsChange(e){
+ console.log(e);
+ },
+ goChat(e){
+ this.setData({
+ show: false
+ })
+
+ // console.log("开始订阅消息");
+ // wx.requestSubscribeMessage({
+ // tmplIds: ['jhYUf91ULCTX_f69hazqAYwImdFf8ELasRAwB6X-MTM'],
+ // success (res) {
+ // console.log(res);
+ // }
+ // })
+ let from_account = e.currentTarget.dataset.from_account;
+ let order_inquiry_id = e.currentTarget.dataset.order_inquiry_id;
+ let inquiry_type = e.currentTarget.dataset.inquiry_type;
+ let url = e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type;
+ app.go(url);
+ },
+ postDoctorInquiry(e){
+ this.setData({
+ show: false
+ })
+ console.log("order_inquiry_id: ", e.currentTarget.dataset.order_inquiry_id);
+ let params = {};
+ params.order_inquiry_id = e.currentTarget.dataset.order_inquiry_id;
+ console.log("params: ",params)
+ api.postDoctorInquiry(params).then(response => {
+ console.log("开始接诊");
+ console.log(response);
+ }).then(() => {
+ this.goChat(e);
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ //获取上方角标
+ getDoctorMessageNotice(e){
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ api.getDoctorMessageNotice().then(response => {
+ let service_message_notice = response.data.service_message_notice;
+ let system_message_notice = response.data.system_message_notice;
+ wx.setStorageSync(userID+"_service_notice_unreadnnum", service_message_notice==true?1:"");//3、医生端系统通知
+ wx.setStorageSync(userID+"_system_notice_unreadnnum", system_message_notice);//4、医生端服务通知
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ tabShow(e){
+ let show_dialog_from_account = e.currentTarget.dataset.show_dialog_from_account;
+ let show_dialog_order_inquiry_id = e.currentTarget.dataset.show_dialog_order_inquiry_id;
+ let show_dialog_inquiry_type = e.currentTarget.dataset.show_dialog_inquiry_type;
+ console.log("tabShowtabShowtabShowtabShow");
+ this.setData({
+ show_dialog_from_account: show_dialog_from_account,
+ show_dialog_order_inquiry_id: show_dialog_order_inquiry_id,
+ show_dialog_inquiry_type: show_dialog_inquiry_type,
+ show: true
+ })
+ },
+ onClose(){
+ console.log("onCloseonCloseonCloseonClose")
+ this.setData({
+ show: false
+ })
+ },
+ vanTabsChange(e){
+ console.log(e)
+ this.setData({
+ now_message_inquiry_type: e.detail.name
+ })
+ },
+ onPullDownRefresh(){
+ console.log("用户下拉动作")
+ this.onHide();
+ this.onShow();
+ },
+ onReachBottom() {
+ console.log('===触底了!!===');
+ let now_message_inquiry_type = this.data.now_message_inquiry_type;
+ if(now_message_inquiry_type == 5){
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getDoctorInquiryFinishMessage()
+ }
+ }
+ },
+ getDoctorInquiryFinishMessage(){
+ let data_list_5 = this.data.data_list_5;
+ let params = {};
+ params.page = this.data.current_page + 1;
+ this.setData({data_list_5_loading: true})
+ api.getDoctorInquiryFinishMessage(params).then(response => {
+ console.log(response);
+ this.setData({
+ "data_list_5": data_list_5.concat(response.data.data),
+ current_page: response.data.current_page,
+ total: response.data.total,
+ per_page: response.data.per_page,
+ last_page: response.data.last_page
+ })
+ // this.selectComponent('#tabs').resize();
+ }).then(res =>{
+ this.setData({ data_list_5_loading: false})
+ }).catch(errors => {
+ this.setData({ data_list_5_loading: false})
+ console.error(errors);
+ })
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v3/wenzhen.json b/Pages/yishi/wenzhen_v3/wenzhen.json
new file mode 100644
index 0000000..e566533
--- /dev/null
+++ b/Pages/yishi/wenzhen_v3/wenzhen.json
@@ -0,0 +1,20 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "wenzhen-data": "/commpents/wenzhen_data/index",
+ "t-tabs": "tdesign-miniprogram/tabs/tabs",
+ "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
+ "t-badge": "tdesign-miniprogram/badge/badge",
+ "van-button": "@vant/weapp/button/index",
+ "van-empty": "@vant/weapp/empty/index",
+ "van-image": "@vant/weapp/image/index",
+ "van-tab": "@vant/weapp/tab/index",
+ "van-tabs": "@vant/weapp/tabs/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog",
+ "van-divider": "@vant/weapp/divider/index",
+ "van-loading": "@vant/weapp/loading/index"
+ },
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 100
+}
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v3/wenzhen.wxml b/Pages/yishi/wenzhen_v3/wenzhen.wxml
new file mode 100644
index 0000000..4cfe4d1
--- /dev/null
+++ b/Pages/yishi/wenzhen_v3/wenzhen.wxml
@@ -0,0 +1,378 @@
+
+
+
+
+
+
+
+
+
+
+ 服务通知
+
+
+
+
+
+
+
+
+
+ 系统公告
+
+
+
+
+
+
+ 未收到任何消息
+
+ 加载中...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{item.message_send_time}}
+
+ {{item.last_message_content.Text}}
+
+ {{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'接诊中':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}
+
+ 查看病历
+ 去接诊
+
+
+ 问诊详情
+
+
+
+ 不接诊24小时后自动取消
+
+
+
+
+
+
+
+ 就诊人:
+ {{item.patient_name}} {{item.patient_sex==1?'男':'女'}}|{{item.patient_age}}
+
+ {{dateSubstr.substring(item.complete_time,0,10)}}
+
+ 问诊已结束
+
+ {{ item.inquiry_type==1?'专家问诊':item.inquiry_type==2?'快速问诊':item.inquiry_type==3?'公益问诊':item.inquiry_type==4?'问诊购药':'其他' }}
+
+ 不接诊24小时后自动取消
+
+
+
+ 加载中...
+
+
+ 到底了~
+
+
+
+
+
+
+
+ 去查看
+ 去接诊
+
+
\ No newline at end of file
diff --git a/Pages/yishi/wenzhen_v3/wenzhen.wxss b/Pages/yishi/wenzhen_v3/wenzhen.wxss
new file mode 100644
index 0000000..0be5bc4
--- /dev/null
+++ b/Pages/yishi/wenzhen_v3/wenzhen.wxss
@@ -0,0 +1,139 @@
+page{
+ background-color: #F4F4F4;
+}
+.container{
+ width: 100vw;
+ padding-top: 20rpx;
+}
+.top{
+ margin: 0 auto 30rpx auto;
+ display: flex;
+ padding: 20rpx 20rpx;
+ background-color: rgb(255, 255, 255);
+}
+.top_left, .top_right{
+ flex: 1;
+ text-align: center;
+ display: flex;
+ flex-direction: column;
+ color: #666666;
+ font-size: 28rpx;
+}
+.top_left{
+ border-right: 1px solid #F4F4F4;
+}
+.t-tab-panel,.t-tabs__content {
+ background-color: #F4F4F4 !important;
+}
+.t-tabs__item--active{
+ color: #49B9AD !important;
+ font-size: 32rpx !important;
+}
+.t-tabs__item-inner--line{
+ font-size: 28rpx !important;
+}
+.t-tabs__track{
+ background-color: var(--td-tab-track-color, var(--td-primary-color, #49B9AD)) !important;
+}
+.empty{
+ width: 92vw;
+ margin: 0 auto;
+ height: 500rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+}
+.empty_note{
+ font-size: 24rpx;
+ color: #999999;
+ margin-top: 30rpx;
+}
+.badge--t-badge {
+ vertical-align: baseline !important;
+}
+
+
+
+
+
+
+.content{
+ background-color: #fff;
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 20rpx;
+}
+.content_1,.content_3,.content_2{
+ display: flex;
+ justify-content: space-between;
+ margin: 20rpx 30rpx;
+ align-items: center;
+}
+.content_1,.content_3{
+ flex: 5;
+}
+.name{
+ font-size: 30rpx;
+ color: #666666;
+ height: 50rpx;
+ line-height: 50rpx;
+ display: flex;
+}
+.date{
+ font-size: 30rpx;
+ color: #999;
+}
+.content_2{
+ background-color: #FAFAFA;
+ font-size: 26rpx;
+ color: #999999;
+ min-height: 70rpx;
+ padding: 10rpx 20rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display: block;
+ line-height: 70rpx;
+}
+.status{
+ font-size: 26rpx;
+ color: #FA541C;
+ flex: 1;
+}
+.status_end{
+ color: #666666;
+}
+.btn{
+ flex: 2;
+ display: flex;
+ justify-content: flex-end;
+}
+.content_4{
+ flex: 5;
+ font-size: 24rpx;
+ color: #E34D59;
+ justify-self:flex-end;
+ text-align:right;
+ display: flex;
+ justify-content: flex-end;
+ border-top: 1px solid #E3E4E5;
+ align-items: center;
+ margin: 0 30rpx;
+ min-height: 70rpx;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
+
diff --git a/Pages/yishi/wenzhenorder/index.js b/Pages/yishi/wenzhenorder/index.js
index 5b76265..9106a80 100644
--- a/Pages/yishi/wenzhenorder/index.js
+++ b/Pages/yishi/wenzhenorder/index.js
@@ -9,23 +9,71 @@ Page({
title: '问诊订单', //导航栏 中间的标题
},
height: app.globalData.height,
- result: ['a'],
- page: 1,
+ result: [],
+ order_list:[],
+ current_page: 0,
+ total: 0,
per_page: 10,
- order_list: [],
- total: 0
+ last_page: 0,
+ allchecked: false,
+ select_order_length: 0,
+ select_order_amount: 0,
+ select_order_inquiry_id: []
},
-
onChange(event) {
+ console.log("onChange: ",event)
this.setData({
result: event.detail,
});
+ this.resetSelectOrder();
+ this.setData({
+ allchecked: this.data.result.length == this.data.order_list.length
+ })
},
- onLoad(){
+ onAllChange(event) {
+ console.log("onAllChange: ",event)
+ this.setData({
+ allchecked: event.detail
+ })
+ if(event.detail == true){
+ this.data.order_list.forEach((item,index) => {
+ this.data.result.push(""+index);
+ })
+ this.setData({
+ result: this.data.result
+ })
+ }
+ if(event.detail == false){
+ this.setData({
+ result: []
+ })
+ }
+ this.resetSelectOrder();
+ },
+ resetSelectOrder(e){
+ let result = this.data.result;
+ let select_order_amount = 0;
+ let select_order_inquiry_id = [];
+ result.forEach(item => {
+ select_order_amount = Number(select_order_amount) + Number(this.data.order_list[item].expected_amount_total);
+ select_order_inquiry_id.push(this.data.order_list[item].order_inquiry_id);
+ })
+ this.setData({
+ select_order_length: result.length,
+ select_order_amount: select_order_amount,
+ select_order_inquiry_id: select_order_inquiry_id
+ })
+ },
+ selectOrder(e){
+ const { index } = e.currentTarget.dataset;
+ const checkbox = this.selectComponent(`.checkboxes-${index}`);
+ checkbox.toggle();
+ },
+ getDoctorWithdrawalOrder(){
//可提现问诊订单列表
let params = {};
- params.page = page;
- params.per_page = per_page;
+ params.page = this.data.current_page + 1;
+ params.per_page = this.data.per_page;
api.getDoctorWithdrawalOrder(params).then(response => {
console.log(response);
if(response.data.total > 0){
@@ -37,6 +85,21 @@ Page({
})
}
}).catch(errors => {console.error(errors);})
-
+ },
+ onShow(){
+ this.getDoctorWithdrawalOrder();
+ this.resetSelectOrder();
+ },
+ onReachBottom() {
+ console.log('===触底了!!===');
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getDoctorWithdrawalOrder()
+ }
+ },
+ confirmOrder(){
+ const select_order_inquiry_id = this.data.select_order_inquiry_id;
+ console.log(select_order_inquiry_id);
+ let order_inquiry_ids = select_order_inquiry_id.join(",");
+ app.go("/Pages/yishi/cash/index?order_inquiry_ids="+order_inquiry_ids);
}
})
\ No newline at end of file
diff --git a/Pages/yishi/wenzhenorder/index.json b/Pages/yishi/wenzhenorder/index.json
index 8d4e19e..cca90c7 100644
--- a/Pages/yishi/wenzhenorder/index.json
+++ b/Pages/yishi/wenzhenorder/index.json
@@ -4,6 +4,8 @@
"te-nav-bar": "/commpents/te_navbar",
"van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
- "van-button": "@vant/weapp/button/index"
- }
+ "van-button": "@vant/weapp/button/index",
+ "van-empty": "@vant/weapp/empty/index"
+ },
+ "onReachBottomDistance": 100
}
\ No newline at end of file
diff --git a/Pages/yishi/wenzhenorder/index.wxml b/Pages/yishi/wenzhenorder/index.wxml
index a289885..0613fe0 100644
--- a/Pages/yishi/wenzhenorder/index.wxml
+++ b/Pages/yishi/wenzhenorder/index.wxml
@@ -1,54 +1,40 @@
-
+
-
+
-
+
-
- 快速问诊
-
- 订单编号:2131231xxxx
- 就诊患者:张三三(女,25岁)
- 接诊时间:2022-12-30 11:23:23
- 结束时间:2022-12-12 11:23:23
- 订单金额:¥1212.00元
- 预计收入:¥112.00元
-
-
-
-
-
-
-
-
-
+
- {{item.inquiry_type}}
+ {{item.inquiry_type==1?'专家问诊':item.inquiry_type==2?'快速问诊':item.inquiry_type==3?'公益问诊':item.inquiry_type==4?'问诊购药':'未知'}}
- 订单编号:{{item.inquiry_no }}
- 就诊患者:{{item.patient_name}}({{item.patient_sex}},{{item.patient_age}}岁)
+ 订单编号:{{item.order_inquiry_id }}
+ 就诊患者:{{item.patient_name}}({{item.patient_sex==1?'男':'女'}},{{item.patient_age}}岁)
接诊时间:{{item.reception_time}}
结束时间:{{item.finish_time}}
- 订单金额:¥{{item.amount_total}}元
- 预计收入:¥{{item.payment_amount_total}}元
+ 订单金额:¥{{item.amount_total}}
+ 预计收入:¥{{item.expected_amount_total}}
-
-
+
- 全选
+ 全{{allchecked?'不':''}}选
- 共10个订单,金额: ¥302元
+ 共{{select_order_length}}个订单,金额: ¥{{select_order_amount}}
-
+
确定
diff --git a/Pages/yishi/wenzhenorder/index.wxss b/Pages/yishi/wenzhenorder/index.wxss
index 9c2a7c5..8c2a298 100644
--- a/Pages/yishi/wenzhenorder/index.wxss
+++ b/Pages/yishi/wenzhenorder/index.wxss
@@ -1,13 +1,15 @@
-.container{
+page{
background-color: #F4F4F4;
+}
+.container{
width: 100vw;
- height: 100vh;
}
.order_list{
display: flex;
width: 92vw;
margin: 0 auto;
flex-direction: column;
+ padding-bottom: 180rpx;
}
.order_item{
display: flex;
@@ -50,13 +52,18 @@
bottom: 0;
width: 100vw;
display: flex;
- background-color: #fff;
+ background-color: rgb(255, 255, 255);
align-items: center;
z-index: 99;
+ padding-bottom: 50rpx;
+ height: 100rpx;
}
.bottom_checkbox{
- flex: 2;
+ flex: 2.2;
font-size: 30rpx;
+ display: flex;
+ justify-content: left;
+ padding-left: 4vw;
}
.bottom_content{
flex: 6;
@@ -68,7 +75,6 @@
flex: 2;
justify-content: flex-end;
font-size: 34rpx;
- background-color: limegreen;
}
diff --git a/Pages/yishi/wenzhenorderV2/index.js b/Pages/yishi/wenzhenorderV2/index.js
new file mode 100644
index 0000000..8616685
--- /dev/null
+++ b/Pages/yishi/wenzhenorderV2/index.js
@@ -0,0 +1,106 @@
+import { API } from './../../../utils/network/api'
+
+const api = new API()
+const app = getApp()
+Page({
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '问诊订单', //导航栏 中间的标题
+ },
+ height: app.globalData.height,
+ result: [],
+ order_list:[],
+ current_page: 0,
+ total: 0,
+ per_page: 10,
+ last_page: 0,
+ allchecked: false,
+ select_order_length: 0,
+ select_order_amount: 0,
+ select_order_inquiry_id: []
+ },
+ onChange(event) {
+ console.log("onChange: ",event)
+ this.setData({
+ result: event.detail,
+ });
+ this.resetSelectOrder();
+ this.setData({
+ allchecked: this.data.result.length == this.data.order_list.length
+ })
+ },
+ onAllChange(event) {
+ console.log("onAllChange: ",event)
+ this.setData({
+ allchecked: event.detail
+ })
+ if(event.detail == true){
+ this.data.order_list.forEach((item,index) => {
+ this.data.result.push(""+index);
+ })
+ this.setData({
+ result: this.data.result
+ })
+ }
+ if(event.detail == false){
+ this.setData({
+ result: []
+ })
+ }
+ this.resetSelectOrder();
+ },
+ resetSelectOrder(e){
+ let result = this.data.result;
+ let select_order_amount = 0;
+ let select_order_inquiry_id = [];
+ result.forEach(item => {
+ select_order_amount = Number(select_order_amount) + Number(this.data.order_list[item].expected_amount_total);
+ select_order_inquiry_id.push(this.data.order_list[item].order_inquiry_id);
+ })
+ this.setData({
+ select_order_length: result.length,
+ select_order_amount: select_order_amount,
+ select_order_inquiry_id: select_order_inquiry_id
+ })
+ },
+ selectOrder(e){
+ const { index } = e.currentTarget.dataset;
+ const checkbox = this.selectComponent(`.checkboxes-${index}`);
+ checkbox.toggle();
+ },
+ getDoctorWithdrawalOrder(){
+ //可提现问诊订单列表
+ let params = {};
+ params.page = this.data.current_page + 1;
+ params.per_page = this.data.per_page;
+ api.getDoctorWithdrawalOrder(params).then(response => {
+ console.log(response);
+ let list = this.data.order_list
+ if(response.data.total > 0){
+ this.setData({
+ order_list: list.concat(response.data.data),
+ current_page: response.data.current_page,
+ per_page: response.data.per_page,
+ last_page: response.data.last_page
+ })
+ }
+ }).catch(errors => {console.error(errors);})
+ },
+ onShow(){
+ this.getDoctorWithdrawalOrder();
+ this.resetSelectOrder();
+ },
+ onReachBottom() {
+ console.log('===触底了!!===');
+ if(this.data.current_page < this.data.last_page){//最后一页时停止分页
+ this.getDoctorWithdrawalOrder()
+ }
+ },
+ confirmOrder(){
+ const select_order_inquiry_id = this.data.select_order_inquiry_id;
+ console.log(select_order_inquiry_id);
+ let order_inquiry_ids = select_order_inquiry_id.join(",");
+ app.go("/Pages/yishi/cash/index?order_inquiry_ids="+order_inquiry_ids);
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/wenzhenorderV2/index.json b/Pages/yishi/wenzhenorderV2/index.json
new file mode 100644
index 0000000..441ea01
--- /dev/null
+++ b/Pages/yishi/wenzhenorderV2/index.json
@@ -0,0 +1,12 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-checkbox": "@vant/weapp/checkbox/index",
+ "van-checkbox-group": "@vant/weapp/checkbox-group/index",
+ "van-button": "@vant/weapp/button/index",
+ "van-empty": "@vant/weapp/empty/index",
+ "van-divider": "@vant/weapp/divider/index"
+ },
+ "onReachBottomDistance": 100
+}
\ No newline at end of file
diff --git a/Pages/yishi/wenzhenorderV2/index.wxml b/Pages/yishi/wenzhenorderV2/index.wxml
new file mode 100644
index 0000000..36d44e5
--- /dev/null
+++ b/Pages/yishi/wenzhenorderV2/index.wxml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+ {{item.inquiry_type==1?'专家问诊':item.inquiry_type==2?'快速问诊':item.inquiry_type==3?'公益问诊':item.inquiry_type==4?'问诊购药':item.inquiry_type==5?'糖组检测':'未知'}}
+
+ 订单编号:{{item.inquiry_no }}
+ 就诊患者:{{item.patient_name}}({{item.patient_sex==1?'男':'女'}},{{item.patient_age}}岁)
+ 接诊时间:{{item.reception_time}}
+ 结束时间:{{item.finish_time}}
+ 订单金额:¥{{item.amount_total}}
+ 预计收入:¥{{item.expected_amount_total}}
+
+
+
+
+
+ 到底了~
+
+
\ No newline at end of file
diff --git a/Pages/yishi/wenzhenorderV2/index.wxss b/Pages/yishi/wenzhenorderV2/index.wxss
new file mode 100644
index 0000000..3c1bba1
--- /dev/null
+++ b/Pages/yishi/wenzhenorderV2/index.wxss
@@ -0,0 +1,81 @@
+page{
+ background-color: #F4F4F4;
+}
+.container{
+ width: 100vw;
+ padding-bottom: 50rpx;
+}
+.order_list{
+ display: flex;
+ width: 92vw;
+ margin: 0 auto;
+ flex-direction: column;
+
+}
+.order_item{
+ display: flex;
+ width: 100%;
+ margin-top: 30rpx;
+}
+.order_item_checkbox{
+ flex: 1;
+ align-self: center;
+}
+.order_item_content{
+ flex: 10;
+ background-color: #fff;
+ border-radius: 20rpx;
+ display: flex;
+ flex-direction: column;
+ padding: 20rpx;
+ height: 400rpx;
+}
+.order_item_content_top{
+ flex: 1;
+ border-bottom: 1px solid #E5E5E5;
+ display: flex;
+ align-items: center;
+ font-size: 36rpx;
+}
+.order_item_content_data{
+ flex: 3;
+ display: flex;
+ flex-direction: column;
+}
+.order_id{
+ flex: 1;
+ display: flex;
+ align-items: center;
+ font-size: 30rpx;
+}
+.bottom{
+ position: fixed;
+ bottom: 0;
+ width: 100vw;
+ display: flex;
+ background-color: rgb(255, 255, 255);
+ align-items: center;
+ z-index: 99;
+ padding-bottom: 50rpx;
+ height: 100rpx;
+}
+.bottom_checkbox{
+ flex: 2.2;
+ font-size: 30rpx;
+ display: flex;
+ justify-content: left;
+ padding-left: 4vw;
+}
+.bottom_content{
+ flex: 6;
+ text-align: center;
+ font-size: 28rpx;
+ color: #666666;
+}
+.bottom_btn{
+ flex: 2;
+ justify-content: flex-end;
+ font-size: 34rpx;
+}
+
+
diff --git a/Pages/yishi/write_sickform/index.js b/Pages/yishi/write_sickform/index.js
new file mode 100644
index 0000000..6263f9e
--- /dev/null
+++ b/Pages/yishi/write_sickform/index.js
@@ -0,0 +1,160 @@
+// Pages/yishi/write_sickform/index.js
+import { API } from './../../../utils/network/api'
+import debounce from "./../../../utils/debounce"
+let api = new API()
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '问诊表', //导航栏 中间的标题
+ },
+ obj:{
+ height:'身高(CM)',
+ weight:'体重(KG)',
+ marital_status:'婚姻状态',
+ nation_id:'民族',
+ job_id:'职业',
+ allergy_history:'是否有过敏史?',
+ family_history:'是否有家族病史?',
+ is_pregnant:'是否处于备孕、妊娠、哺乳期?',
+ is_operation:'是否做过手术?',
+ drink_wine_status:'是否有饮酒史?',
+ smoke_status:'是否有吸烟史?',
+ chemical_compound_status:'是否有接触过化学物?',
+ diagnosis_hospital:'确诊医院是?',
+ is_take_medicine:'服用药品是?'
+
+ },
+ order_inquiry_id:'',
+ list1: [],
+ list2: [],
+ result: [],
+ },
+ onChange(event) {
+ this.setData({
+ result: event.detail,
+ });
+ console.log(event.detail);
+ },
+
+ toggle(event) {
+ const { item } = event.currentTarget.dataset;
+ const checkbox = this.selectComponent(`.checkboxes-${item}`);
+ checkbox.toggle();
+ },
+ handleList(order_inquiry_id){
+ api.getUnfilled({
+ order_inquiry_id
+ }).then(data=>{
+ let result=data.data;
+ let {obj}=this.data;
+
+ let arr1=[];
+ let arr2=[];
+ result.forEach(item => {
+ if(item=="weight" || item=="height" || item=="marital_status" || item=="nation_id" || item=="job_id"){
+ if(obj[item]){
+ arr1.push(item);
+ }
+ }else{
+ if(obj[item]){
+ arr2.push(item);
+ }
+ }
+
+ })
+ this.setData({
+ list1:arr1,
+ list2:arr2,
+ })
+ })
+ },
+ handleSend:debounce(function(){
+ let {order_inquiry_id,result,obj}=this.data;
+ if(result.length==0){
+ wx.showToast({
+ title: '请至少选择一项',
+ icon:'none'
+ })
+ return false;
+ }
+ let fields=[];
+ for (const key in obj) {
+ if(result.indexOf(key)!=-1){
+ fields.push(key)
+ }
+ }
+ api.doctorSendUnfilled({
+ order_inquiry_id,
+ fields:fields
+ }).then(data=>{
+ if(data.code==200){
+ wx.navigateBack();
+ }
+ })
+ }),
+ noop() {},
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.setData({
+ order_inquiry_id:options.order_inquiry_id,
+ })
+ this.handleList(options.order_inquiry_id);
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/write_sickform/index.json b/Pages/yishi/write_sickform/index.json
new file mode 100644
index 0000000..3c0475a
--- /dev/null
+++ b/Pages/yishi/write_sickform/index.json
@@ -0,0 +1,10 @@
+{
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "van-checkbox": "@vant/weapp/checkbox/index",
+ "van-cell": "@vant/weapp/cell/index",
+ "van-cell-group": "@vant/weapp/cell-group/index",
+ "van-checkbox-group": "@vant/weapp/checkbox-group/index"
+ },
+ "disableScroll": true
+}
\ No newline at end of file
diff --git a/Pages/yishi/write_sickform/index.wxml b/Pages/yishi/write_sickform/index.wxml
new file mode 100644
index 0000000..199fcad
--- /dev/null
+++ b/Pages/yishi/write_sickform/index.wxml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+ 基本信息
+
+
+
+
+
+
+
+
+ 个人情况
+
+
+
+
+
+
+
+
+
+
+
+ 发送给患者
+
+
+
+
+
+ 暂无可询问内容
+
\ No newline at end of file
diff --git a/Pages/yishi/write_sickform/index.wxss b/Pages/yishi/write_sickform/index.wxss
new file mode 100644
index 0000000..1586434
--- /dev/null
+++ b/Pages/yishi/write_sickform/index.wxss
@@ -0,0 +1,76 @@
+/* Pages/yishi/write_sickform/index.wxss */
+page{
+ overflow: hidden;
+ background-color: #F6F6F6;
+}
+.van-hairline--top-bottom:after {
+ border-top-width: 0px!important;
+}
+.van-hairline--bottom:after {
+ border-top-width: 0px!important;
+}
+.listbox{
+ flex:1;
+ -webkit-overflow-scrolling: touch;
+ overflow-y: scroll;
+}
+.container{
+ width: 100vw;
+
+ height:calc(100vh - 136rpx);
+ display:flex;
+ flex-direction: column;
+}
+.value-class {
+ order:-1!important;
+ flex: none !important;
+}
+.title-class{
+ order:2!important;
+}
+.box .title{
+ padding: 25rpx 30rpx 10rpx;
+ margin-top: 20rpx;
+font-size: 34rpx;
+font-weight: 500;
+color: #1C2023;
+background:#fff;
+}
+.bottom{
+ background-color: #FFFFFF;
+ height:160rpx;
+ width:100%;
+}
+.bottom .btn{
+margin:20rpx 30rpx 0rpx;
+height: 80rpx;
+font-size: 30rpx;
+color: #FFFFFF;
+display: flex;
+align-items: center;
+justify-content: center;
+background: #3CC7C0;
+border-radius: 8rpx;
+}
+.empty{
+ margin-top: 400rpx;
+ width:161rpx;
+ height:162rpx;
+}
+.nocontainer{
+ margin-top: 20rpx;
+ background-color: #fff;
+ height:100vh;
+ display: flex;
+ font-size: 24rpx;
+ color: #999999;
+ align-items: center;
+ flex-direction: column;
+}
+.van-cell{
+ align-items: center;
+}
+.van-cell__title{
+ font-size: 34rpx!important;
+ color:#000;
+}
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetup/index.js b/Pages/yishi/yizhensetup/index.js
index e75881d..667090b 100644
--- a/Pages/yishi/yizhensetup/index.js
+++ b/Pages/yishi/yizhensetup/index.js
@@ -1,5 +1,6 @@
import { API } from './../../../utils/network/api'
import Toast from '@vant/weapp/toast/toast';
+import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
let api = new API()
const app = getApp()
Page({
@@ -10,8 +11,8 @@ Page({
},
height: app.globalData.height,
checked: true,
- open_note: "已开启,患者可以向您发起图文问诊",
- close_note: "已关闭,暂不接收义诊订单",
+ open_note: "已开启,可在问诊消息中进行接诊",
+ close_note: "已关闭,暂不接收公益问诊",
note: "",
amountText: "选择金额(元)",
amountValue: "",
@@ -35,11 +36,12 @@ Page({
"5",
"10"
]
- }
+ },
+ sub_visible: false,
},
onLoad(){
- this.setData({ note: this.data.open_note });
+
},
onShow(){
let params = {};
@@ -54,6 +56,14 @@ Page({
})
this.formatAmounts();
this.formatAmountValue();
+ }).then(re =>{
+ let is_open = this.data.info.is_open;
+ let note = this.data.note;
+ if(is_open == 1) note = this.data.open_note;
+ if(is_open == 0) note = this.data.close_note;
+ this.setData({
+ note: note
+ })
}).catch(errors => {console.error(errors);})
},
formatAmounts(){
@@ -72,28 +82,83 @@ Page({
let valarr = [''+val+'']
this.setData({
amountValue: valarr,
- amountText: val+" 元"
+ amountText: val
})
},
+ changeON(){
+ let is_open = this.data.info.is_open
+ console.log("changeON:", is_open)
+ let detail = false
+ if(is_open == 0){
+ detail = true
+ }else{
+ detail = false
+ }
+ this.doChange(detail)
+ },
onChange({ detail }) {
console.log("onChange: ", detail);
- if(detail){
- this.setData({ note: this.data.open_note });
- }else{
- this.setData({ note: this.data.close_note });
- }
- this.setData({ "info.is_open": detail });
-
- //修改开关
- let params = {};
- params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
- params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
- params.is_open = detail?1:0;
- api.putDoctorInquiryOpen(params).then(response => {
- console.log(response);
- }).catch(errors => {console.error(errors);})
+ this.doChange(detail)
+ },
+ doChange(detail){
+ let is_open = 0;
+ if(detail){
+ wx.vibrateShort({
+ "type": "heavy"
+ })
+ is_open = 1;
+ }else{
+ is_open = 0
+ }
+ //修改开关
+ let params = {};
+ params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
+ params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ params.is_open = detail?1:0;
+ api.putDoctorInquiryOpen(params).then(response => {
+ console.log(response);
+ }).then(()=>{
+ if(detail){
+ let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
+ this.setData({
+ sub_visible: true,
+ })
+ }
+ })
+ }
+ }).then(()=>{
+ if(detail){
+ this.setData({ note: this.data.open_note });
+ }else{
+ this.setData({ note: this.data.close_note });
+ }
+ this.setData({ "info.is_open": is_open });
+ }).catch(errors => {console.error(errors);})
+
+ },
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ console.log(res.authSetting)
+ }
+ })
},
-
putDoctorInquiryConfig(){
//修改医生问诊配置
let params = {};
@@ -104,20 +169,14 @@ Page({
api.putDoctorInquiryConfig(params).then(response => {
console.log(response);
Toast.success("修改成功");
- wx.switchTab({
- url: "/Pages/yishi/wenzhen/wenzhen"
- })
}).catch(errors => {console.error(errors);})
-
-
-
-
},
onStepperChange(event) {
console.log(event.detail);
this.setData({
"info.work_num_day": event.detail
});
+ this.putDoctorInquiryConfig()
},
onAmountPicker() {
@@ -139,6 +198,8 @@ Page({
[`${key}Text`]: value+' 元',
"info.inquiry_price": value[0]
});
+
+ this.putDoctorInquiryConfig()
},
onPickerCancel(e) {
@@ -149,5 +210,10 @@ Page({
[`${key}Visible`]: false,
});
},
-
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ wx.switchTab({
+ url: url
+ })
+ }
})
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetup/index.json b/Pages/yishi/yizhensetup/index.json
index 24c14a6..8291c87 100644
--- a/Pages/yishi/yizhensetup/index.json
+++ b/Pages/yishi/yizhensetup/index.json
@@ -9,6 +9,7 @@
"van-stepper": "@vant/weapp/stepper/index",
"van-switch": "@vant/weapp/switch/index",
"van-button": "@vant/weapp/button/index",
- "van-toast": "@vant/weapp/toast/index"
+ "van-toast": "@vant/weapp/toast/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetup/index.wxml b/Pages/yishi/yizhensetup/index.wxml
index 1e3cd4e..79e7df9 100644
--- a/Pages/yishi/yizhensetup/index.wxml
+++ b/Pages/yishi/yizhensetup/index.wxml
@@ -1,55 +1,63 @@
-
+
-
+
接诊开关
+ checked="{{ info.is_open==1 }}"
+ />
{{ note }}
-
+
-
+
价格设置
-
- 每日接诊数量
-
-
+
+
+ {{ info.work_num_day }}
-
+
-
+ url="/Pages/yishi/yizhensetupprice/index"
+ >
+
+ {{ amountText }}
+ 元
+
+
+
- 提示:服务开通后,患者可以通过公益问诊找到您,增加您的接诊量。
- 1、公益问诊价格为平台统一设定的几个,需要您自己选择单价;
- 2、接诊后{{config.duration/60}}小时内和患者{{config.times_number}}个回合沟通。
+ 提示:服务开启后,您将参与到平台爱心公益问诊活动中
+ 1、从平台统一设定的多种公益问诊价格中选择您的公益问诊价格
+ 2、接诊后,患者可与您在{{config.duration/60}}小时内进行{{config.times_number}}回合沟通
-
- 去接诊
+
+ 去接诊
+
+
+
+ 取消
+
+
+ 确定
+
+
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetup/index.wxss b/Pages/yishi/yizhensetup/index.wxss
index 0cfbc64..5c845f9 100644
--- a/Pages/yishi/yizhensetup/index.wxss
+++ b/Pages/yishi/yizhensetup/index.wxss
@@ -1,7 +1,8 @@
+page{
+ background-color: #F6F6F6;
+}
.container{
width: 100vw;
- height: 100vh;
- background-color: #F6F6F6;
}
.switch_box{
display: flex;
@@ -37,7 +38,7 @@
}
.switch_box_item_name{
flex: 1;
- font-size: 32rpx;
+ font-size: 16px;
}
.switch_box_item_btn{
flex: 1;
@@ -55,7 +56,7 @@
margin: 0 auto;
font-size: 32rpx;
margin-bottom: 20rpx;
- font-family: "AlibabaPuHuiTi-2-55-Regular";
+ /* font-family: "AlibabaPuHuiTi-2-55-Regular"; */
color: #333333;
}
.price_steup_box{
@@ -97,7 +98,7 @@
}
.bottom{
width: 90vw;
- margin: 0 auto;
+ margin: -20rpx auto;
color: #999;
letter-spacing: 2rpx;
font-size: 28rpx;
@@ -110,4 +111,28 @@
transform: translateX(-50%);
bottom: 100rpx;
width: 90vw;
+}
+
+.t-picker__confirm,.t-class-confirm{
+ color: #49B9AD !important;
+}
+.num{
+ color: #000;
+}
+.price{
+ color: red;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
}
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetupprice/index.js b/Pages/yishi/yizhensetupprice/index.js
new file mode 100644
index 0000000..f0a7622
--- /dev/null
+++ b/Pages/yishi/yizhensetupprice/index.js
@@ -0,0 +1,200 @@
+import { API } from './../../../utils/network/api'
+import Toast from '@vant/weapp/toast/toast';
+import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
+let api = new API()
+const app = getApp()
+Page({
+ data: {
+ navbarData: {
+ showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '设置价格', //导航栏 中间的标题
+ },
+ height: app.globalData.height,
+ checked: true,
+ open_note: "已开启,可在问诊消息中进行接诊",
+ close_note: "已关闭,暂不接收公益问诊",
+ note: "",
+ amountText: "选择金额(元)",
+ amountValue: "",
+ inquiry_type: 3,
+ inquiry_mode: 1,
+ amounts: [],
+ info:{
+ is_open: false,
+ inquiry_price: 0,
+ work_num_day: 0
+ },
+ config:{
+ "max_work_num_day": 30,
+ "min_inquiry_price": 0,
+ "max_inquiry_price": 0,
+ "default_inquiry_price": 0,
+ "times_number": 10,
+ "duration": 1440,
+ "system_inquiry_price": [
+ "0",
+ "5",
+ "10"
+ ]
+ },
+ sub_visible: false,
+ },
+
+ onShow(){
+ let params = {};
+ params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
+ params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ //获取医生我的账户数据
+ api.getDoctorInquiryConfig(params).then(response => {
+ console.log(response);
+ this.setData({
+ info: response.data.info,
+ config: response.data.config,
+ })
+ this.formatAmounts();
+ this.formatAmountValue();
+ }).then(re =>{
+ let is_open = this.data.info.is_open;
+ let note = this.data.note;
+ if(is_open == 1) note = this.data.open_note;
+ if(is_open == 0) note = this.data.close_note;
+ this.setData({
+ note: note
+ })
+ }).catch(errors => {console.error(errors);})
+ },
+ formatAmounts(){
+ let list = this.data.config.system_inquiry_price.map(item => {
+ let it = {};
+ it.label = item+" 元";
+ it.value = item;
+ return it;
+ });
+ this.setData({
+ amounts: list
+ })
+ },
+ formatAmountValue(){
+ let val = Math.trunc(this.data.info.inquiry_price);
+ let valarr = [''+val+'']
+ this.setData({
+ amountValue: valarr,
+ amountText: val
+ })
+ },
+ onChange({ detail }) {
+ console.log("onChange: ", detail);
+ if(detail){
+ this.setData({ note: this.data.open_note });
+ }else{
+ this.setData({ note: this.data.close_note });
+ }
+ this.setData({ "info.is_open": detail });
+
+ //修改开关
+ let params = {};
+ params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
+ params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ params.is_open = detail?1:0;
+ api.putDoctorInquiryOpen(params).then(response => {
+ console.log(response);
+ }).then(()=>{
+ if(detail){
+
+ let tmplIds = ['G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
+ this.setData({
+ sub_visible: true,
+ })
+ }
+ })
+ }
+ }).catch(errors => {console.error(errors);})
+ },
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ console.log(res.authSetting)
+ }
+ })
+ },
+ putDoctorInquiryConfig(){
+ //修改医生问诊配置
+ let params = {};
+ params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
+ params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
+ params.inquiry_price = this.data.info.inquiry_price;
+ params.work_num_day = this.data.info.work_num_day;
+ api.putDoctorInquiryConfig(params).then(response => {
+ console.log(response);
+ Toast.success("修改成功");
+ setTimeout(() => {
+ wx.navigateBack();
+ }, 1000);
+ }).catch(errors => {console.error(errors);})
+ },
+ onStepperChange(event) {
+ console.log(event.detail);
+ wx.vibrateShort({
+ "type": "heavy"
+ })
+ this.setData({
+ "info.work_num_day": event.detail
+ });
+ },
+
+ onAmountPicker() {
+ this.setData({ amountVisible: true });
+ },
+
+ onColumnChange(e) {
+ wx.vibrateShort({
+ "type": "heavy"
+ })
+ console.log('picker pick:', e);
+ },
+
+ onPickerChange(e) {
+ console.log(e);
+ const { key } = e.currentTarget.dataset;
+ const { value } = e.detail;
+ console.log('picker change:', e.detail);
+ this.setData({
+ [`${key}Visible`]: false,
+ [`${key}Value`]: value,
+ [`${key}Text`]: value,
+ "info.inquiry_price": value[0]
+ });
+
+ },
+
+ onPickerCancel(e) {
+ const { key } = e.currentTarget.dataset;
+ console.log(e, '取消');
+ console.log('picker1 cancel:');
+ this.setData({
+ [`${key}Visible`]: false,
+ });
+ },
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ wx.switchTab({
+ url: url
+ })
+ }
+})
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetupprice/index.json b/Pages/yishi/yizhensetupprice/index.json
new file mode 100644
index 0000000..e57194f
--- /dev/null
+++ b/Pages/yishi/yizhensetupprice/index.json
@@ -0,0 +1,14 @@
+{
+ "component": true,
+ "usingComponents": {
+ "te-nav-bar": "/commpents/te_navbar",
+ "t-picker": "tdesign-miniprogram/picker/picker",
+ "t-picker-item": "tdesign-miniprogram/picker-item/picker-item",
+ "van-cell": "@vant/weapp/cell/index",
+ "van-cell-group": "@vant/weapp/cell-group/index",
+ "van-stepper": "@vant/weapp/stepper/index",
+ "van-button": "@vant/weapp/button/index",
+ "van-toast": "@vant/weapp/toast/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
+ }
+}
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetupprice/index.wxml b/Pages/yishi/yizhensetupprice/index.wxml
new file mode 100644
index 0000000..0aa7c5f
--- /dev/null
+++ b/Pages/yishi/yizhensetupprice/index.wxml
@@ -0,0 +1,66 @@
+
+
+
+
+
+ 每日接诊数量
+
+
+
+
+
+
+
+ {{ amountText }}
+ 元
+
+
+
+
+
+
+
+
+ 提示:服务开启后,您将参与到平台爱心公益问诊活动中
+ 1、从平台统一设定的多种公益问诊价格中选择您的公益问诊价格
+ 2、接诊后,患者可与您在{{config.duration/60}}小时内进行{{config.times_number}}回合沟通
+
+
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/yizhensetupprice/index.wxss b/Pages/yishi/yizhensetupprice/index.wxss
new file mode 100644
index 0000000..d41f1c7
--- /dev/null
+++ b/Pages/yishi/yizhensetupprice/index.wxss
@@ -0,0 +1,137 @@
+page{
+ background-color: #F6F6F6;
+}
+.container{
+ width: 100vw;
+ padding-top: 30rpx;
+}
+.switch_box{
+ display: flex;
+ flex-direction: column;
+ width: 90vw;
+ /* height: 500rpx; */
+ border-radius: 20rpx;
+ margin: 30rpx auto;
+ background-color: rgb(255, 255, 255);
+}
+.switch_box_top{
+ position: relative;
+ display: flex;
+ /* height: 300rpx; */
+ flex-direction: column;
+ padding: 30rpx 30rpx 20rpx 30rpx;
+}
+.switch_box_top::after{
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 32rpx;
+ bottom: 0;
+ border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
+ transform: scaleY(0.5);
+}
+.switch_box_item{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.switch_box_item_name{
+ flex: 1;
+ font-size: 32rpx;
+}
+.switch_box_item_btn{
+ flex: 1;
+ text-align: right;
+}
+.switch_box_note{
+ color: #999999;
+ font-size: 24rpx;
+}
+.help{
+ margin-bottom: 20rpx;
+}
+.price_title{
+ width: 90vw;
+ margin: 0 auto;
+ font-size: 32rpx;
+ margin-bottom: 20rpx;
+ /* font-family: "AlibabaPuHuiTi-2-55-Regular"; */
+ color: #333333;
+}
+.price_steup_box{
+ display: flex;
+ width: 90vw;
+ margin: 0 auto;
+ border-radius: 20rpx;
+ flex-direction: column;
+ background-color: rgb(255, 255, 255);
+}
+.price_steup_box_top{
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: var(--cell-vertical-padding,20rpx) var(--cell-horizontal-padding,32rpx);
+}
+
+.price_steup_box_top_title, .price_steup_box_bottom_title{
+ flex: 1;
+ font-size: 32rpx;
+ color: #333;
+}
+.price_steup_box_top::after{
+ position: absolute;
+ box-sizing: border-box;
+ content: ' ';
+ pointer-events: none;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
+ transform: scaleY(0.5);
+}
+.price_steup_box_top_stepper{
+ flex: 1;
+ text-align: right;
+ align-items: center;
+}
+.bottom{
+ width: 90vw;
+ margin: -20rpx auto;
+ color: #999;
+ letter-spacing: 2rpx;
+ font-size: 28rpx;
+ line-height: 40rpx;
+}
+
+.go{
+ position: fixed;
+ left: 50%;
+ transform: translateX(-50%);
+ bottom: 100rpx;
+ width: 90vw;
+}
+
+.t-picker__confirm,.t-class-confirm{
+ color: #49B9AD !important;
+}
+.van-cell__value{
+ font-size: 32rpx !important;
+ color: red !important;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
\ No newline at end of file
diff --git a/Pages/yishi/zhiye_identity/index.js b/Pages/yishi/zhiye_identity/index.js
index 13ec417..d237f62 100644
--- a/Pages/yishi/zhiye_identity/index.js
+++ b/Pages/yishi/zhiye_identity/index.js
@@ -1,5 +1,6 @@
import { API } from './../../../utils/network/api'
import { FileUtil } from './../../../utils/fileutil'
+import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
const api = new API()
const app = getApp()
Page({
@@ -11,15 +12,45 @@ Page({
height: app.globalData.height,
id_card_front: [],
id_card_back: [],
- sign_image: ""
+ sign_image: [],
+ btn_txt: "提交",
+ multi_point_status: "",
+ btn_disabled: true,
+ sfz_show: false,
+ sub_visible: false,
+ static_host: api.getStaticHost()
},
onLoad(){
-
console.log("onlosd");
//获得多点执业信息
api.getDoctorAuthMulti().then(response => {
console.log("getDoctorAuthMulti: ",response);
+ let multi_point_status = Number(response.data.multi_point_status);
+ let btn_txt = this.data.btn_txt;
+ let btn_disabled = this.data.btn_disabled;
+ switch (multi_point_status) {
+ case 0:
+ btn_txt = "提交";
+ btn_disabled = false;
+ break;
+ case 1:
+ btn_txt = "审核通过";
+ btn_disabled = true;
+ break;
+ case 2:
+ btn_txt = "审核中";
+ btn_disabled = true;
+ break;
+ case 3:
+ btn_txt = "认证失败,再次提交";
+ btn_disabled = false;
+ break;
+ default:
+ btn_txt = "提交";
+ btn_disabled = false;
+ break;
+ }
if(response.data.id_card_front){
let id_card_front_img = {};
id_card_front_img.url = response.data.id_card_front;
@@ -35,57 +66,103 @@ Page({
}
let sign_image = response.data.sign_image;
+
if(sign_image){
+ let arr = [];
+ let item = {};
+ item.isImg = true;
+ item.url = sign_image;
+ arr.push(item);
this.setData({
- sign_image: sign_image
+ sign_image: arr
})
}
this.setData({
id_card_front: this.data.id_card_front,
id_card_back: this.data.id_card_back,
+ btn_disabled: btn_disabled,
+ btn_txt: btn_txt
})
-
- }).catch(errors => {
- console.error(errors);
- })
-
+ }).catch(errors => {console.error(errors);})
},
onShow(){
console.log("onshow")
let sign_image = wx.getStorageSync("sign_image");
console.log("sign_image: ",sign_image);
if(sign_image){
+ let arr = [];
+ let item = {};
+ item.isImg = true;
+ item.url = sign_image;
+ arr.push(item);
this.setData({
- sign_image: sign_image
+ sign_image: arr
})
}
},
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ this.goadd()
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ console.log(res.authSetting)
+ }
+ })
+ },
add(){
- let id_card_front = this.data.id_card_front[0].url;
+ let tmplIds = ['XWfEQYtb8_ubz8pCs3GoCG6TFxpDz9jn52895yvDm3s','bGGoKtDZC23GZtrrxuy6i5V7OhHgRgwXWx4yoDO1tlA']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+ this.goadd()
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
+ this.setData({
+ sub_visible: true,
+ })
+ }
+ })
+ },
+ goadd(){
+ let _this = this;
+ console.log(_this.data.id_card_front);
+ console.log(_this.data.id_card_back);
+
+ if(_this.data.id_card_front.length == 0){
+ wx.showToast({
+ title: '身份证正面为空',
+ icon: "error"
+ })
+ return;
+ }
+
+ if(_this.data.id_card_back.length == 0){
+ wx.showToast({
+ title: '身份证反面为空',
+ icon: "error"
+ })
+ return;
+ }
+ let id_card_front = _this.data.id_card_front[0].url;
+ let id_card_back = _this.data.id_card_back[0].url;
+ let sign_image = _this.data.sign_image[0].url;
console.log("id_card_front: ", id_card_front);
- if(id_card_front == ""){
- wx.showToast({
- title: '请上传身份证',
- icon: "error"
- })
- return;
- }
- let id_card_back = this.data.id_card_back[0].url;
console.log("id_card_back: ", id_card_back);
- if(id_card_back == ""){
- wx.showToast({
- title: '请上传身份证',
- icon: "error"
- })
- return;
- }
- let sign_image = this.data.sign_image;
console.log("sign_image: ", sign_image);
if(sign_image == ""){
wx.showToast({
- title: '请上传签名',
+ title: '手写签名为空',
icon: "error"
})
return;
@@ -100,6 +177,10 @@ Page({
title: '提交成功',
icon: "success"
})
+ _this.setData({
+ btn_txt: "审核中",
+ btn_disabled: true
+ })
}).catch(errors => {
console.error(errors);
})
@@ -144,7 +225,7 @@ Page({
img.isImg = true;
- let img_list = _this.data[field_name];
+ let img_list = [];
console.log("img_list: ", img_list);
img_list.push(img);
@@ -167,6 +248,13 @@ Page({
})
},
doDeleteFile(event){
+ if(this.data.btn_disabled){
+ wx.showToast({
+ title: '不能修改',
+ icon: "error"
+ })
+ return;
+ }
console.log(event);
let url = event.detail.file.url;
let file_name = event.currentTarget.dataset.field_name;
@@ -177,8 +265,31 @@ Page({
},
onshowIdCardFrontNote(){
console.log("onshowIdCardFrontNote");
+ this.setData({
+ sfz_show: true
+ })
},
onshowIdCardBackNote(){
console.log("onshowIdCardBackNote");
+ this.setData({
+ sfz_show: true
+ })
+ },
+ onsfzClose(){
+ console.log("onsfzClose");
+ this.setData({
+ sfz_show: false
+ })
+ },
+ go(e){
+ // if(this.data.btn_disabled){
+ // wx.showToast({
+ // title: '不能修改',
+ // icon: "error"
+ // })
+ // return;
+ // }
+ let url = e.currentTarget.dataset.url;
+ app.go(url)
}
})
\ No newline at end of file
diff --git a/Pages/yishi/zhiye_identity/index.json b/Pages/yishi/zhiye_identity/index.json
index 375d8bb..0e9bd46 100644
--- a/Pages/yishi/zhiye_identity/index.json
+++ b/Pages/yishi/zhiye_identity/index.json
@@ -7,6 +7,9 @@
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-divider": "@vant/weapp/divider/index",
- "van-button": "@vant/weapp/button/index"
+ "van-button": "@vant/weapp/button/index",
+ "van-popup": "@vant/weapp/popup/index",
+ "van-image": "@vant/weapp/image/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/Pages/yishi/zhiye_identity/index.wxml b/Pages/yishi/zhiye_identity/index.wxml
index ad5240b..a1fa8ad 100644
--- a/Pages/yishi/zhiye_identity/index.wxml
+++ b/Pages/yishi/zhiye_identity/index.wxml
@@ -1,62 +1,116 @@
+ upload_cell_name="上传身份证正面照片"
+ t_icon_name="view-module"
+ bind:showNote="onshowIdCardFrontNote"
+ upload_cell_desc=""
+ upload_cell_note="查看示例"
+ fileList="{{ id_card_front }}"
+ deletable="{{!btn_disabled}}"
+ max_count="1"
+ data-scene="2"
+ data-field_name="id_card_front"
+ data-file_multiple="true"
+ bindUploadFile="doUploadFile"
+ bindDeleteFile="doDeleteFile"
+ static_host="{{static_host}}"
+ />
+ upload_cell_name="上传身份证反面照片"
+ t_icon_name="view-module"
+ bind:showNote="onshowIdCardBackNote"
+ upload_cell_desc=""
+ upload_cell_note="查看示例"
+ fileList="{{ id_card_back }}"
+ deletable="{{!btn_disabled}}"
+ max_count="1"
+ data-scene="2"
+ data-field_name="id_card_back"
+ data-file_multiple="true"
+ bindUploadFile="doUploadFile"
+ bindDeleteFile="doDeleteFile"
+ static_host="{{static_host}}"
+ />
-
- 注:请先了解多点执业认证流程,在提交审核
+ 注:请先了解多点执业认证流程,再提交审核
- 医生手写签名 *
-
-
- 点击签名
-
+ 医生手写签名 *
+
+ 点击签名
+
+
+
-
-
-
-
-
- 提示:平台会在1~3天内审核您提交的资料,审核结果会第一时间通知您。
-
-
- 提交
+
+
+
+ 提示:平台会在1~3个工作日内审核您提交的资料,审核结果会第一时间通知您。
+ {{btn_txt}}
+
+
+
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
\ No newline at end of file
diff --git a/Pages/yishi/zhiye_identity/index.wxss b/Pages/yishi/zhiye_identity/index.wxss
index 3c2740e..07fd1d8 100644
--- a/Pages/yishi/zhiye_identity/index.wxss
+++ b/Pages/yishi/zhiye_identity/index.wxss
@@ -7,7 +7,7 @@
line-height: 80rpx;
height: 80rpx;
color: #ED7B2F;
- font-size: 20rpx;
+ font-size: 28rpx;
padding-left: 20rpx;
}
.notice::after{
@@ -27,7 +27,8 @@
margin: 0 auto;
}
.sign_title{
- font-size: 30rpx;
+ font-size: 16px;
+ color: #323233;
}
.sign_note{
margin: 20rpx 0;
@@ -38,4 +39,34 @@
display: flex;
justify-content: center;
align-items: center;
+}
+.zhiye_popup{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding-bottom: 20rpx;
+ min-height: 550rpx;
+}
+.zhiye_popup_title{
+ margin-top: 16px;
+ font-size: 32rpx;
+ font-weight: 600;
+ letter-spacing: 5rpx;
+}
+.zhiye_popup_img{
+ margin-top: 30rpx;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.js b/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.js
index 30ae25a..f783cbd 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.js
+++ b/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.js
@@ -77,9 +77,10 @@ Component({
// 音频播放
audioPlay(e) {
+
const { id } = e.currentTarget.dataset;
const { audioSave } = this.data;
-
+ this.triggerEvent("closeAudio",false)
// 设置状态
audioSave.forEach((message, index) => {
message.isPlaying = false;
@@ -132,6 +133,7 @@ Component({
audioStop(e) {
const { key } = e.currentTarget.dataset;
const { audioSave } = this.data;
+ console.log(audioSave);
// 设置状态
audioSave.forEach((message, index) => {
message.isPlaying = false;
diff --git a/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml
index a9764ea..e93714a 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml
+++ b/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxml
@@ -1,12 +1,12 @@
-
+
-
- {{renderDom[0].second}}s
+
+ {{renderDom[0].second}}"
-
- {{renderDom[0].second}}s
+
+ {{renderDom[0].second}}"
diff --git a/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss b/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss
index 4bfe7d2..3c2ecba 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss
+++ b/TUIKit/components/TUIChat/components/MessageElements/AudioMessage/index.wxss
@@ -2,13 +2,48 @@
padding: 10rpx 18rpx;
border-radius: 2px 10px 10px 10px;
border: 1px solid #D9D9D9;
+ position: relative;
}
+
.my-audio {
- border-radius: 10px 2px 10px 10px;
- background: rgba(0,110,255,0.10);
- border: 1px solid rgba(0,110,255,0.30);
+ position: relative;
+ border-radius: 10px 10px 10px 10px;
+ background: rgb(212, 239, 241);
+ border: 1rpx solid #1ACAD3;
+}
+
+.my-audio::after{
+ content:'';
+ position: absolute;
+ top: 35rpx;
+ right: -19rpx;
+ transform: translate(-50%,-50%) rotate(-135deg);
+ width: 16rpx;
+ height: 16rpx;
+ background: rgb(212, 239, 241);
+ border: 1rpx solid #1ACAD3;
+ border-style: none none solid solid
+}
+.your-audio {
+ position: relative;
+ border-radius: 10px 10px 10px 10px;
+ background: rgb(255, 255, 255);
+ border: 1rpx solid #D8D8D8;
+}
+.your-audio::after{
+ content:'';
+ position: absolute;
+ top: 35rpx;
+ left: 0;
+ transform: translate(-50%,-50%) rotate(45deg);
+ width: 16rpx;
+ height: 16rpx;
+ background: rgb(255, 255, 255);
+ border: 1rpx solid #D8D8D8;
+ border-style: none none solid solid
}
.audio {
+ width:200rpx;
/*border-radius: 2px 10px 10px 10px;*/
height: 60rpx;
font-family: PingFangSC-Medium;
@@ -17,7 +52,10 @@
line-height: 28rpx;
display: flex;
align-items: center;
- justify-content: flex-end;
+ justify-content: flex-start;
+}
+.my-audio .audio{
+ flex-direction: row-reverse;
}
.image{
width: 16px;
@@ -29,4 +67,12 @@
width: 16px;
height: 16px;
transform:rotate(180deg)
+}
+.dot{
+ top:10rpx;
+ position: absolute;
+ width:15rpx;
+ height:15rpx;
+ background-color: red;
+ border-radius: 50%;
}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.js b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.js
new file mode 100644
index 0000000..0def034
--- /dev/null
+++ b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.js
@@ -0,0 +1,23 @@
+// TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.js
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+
+ }
+})
diff --git a/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.json b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.json
new file mode 100644
index 0000000..e9b6ca8
--- /dev/null
+++ b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-message": "tdesign-miniprogram/message/message"
+ }
+}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxml
new file mode 100644
index 0000000..c117292
--- /dev/null
+++ b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxss b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxss
new file mode 100644
index 0000000..40474e3
--- /dev/null
+++ b/TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxss
@@ -0,0 +1 @@
+/* TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxss */
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js
index ec64037..739b6ac 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js
+++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.js
@@ -1,5 +1,7 @@
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({
/**
@@ -16,6 +18,15 @@ Component({
});
},
},
+ patient_family_data:{
+ type: Object,
+ value: {},
+ observer(newVal) {
+ this.setData({
+ patient_family_data: newVal,
+ });
+ }
+ },
isMine: {
type: Boolean,
value: true,
@@ -77,7 +88,9 @@ Component({
}
},
parseCustom(message) {
+
const { BUSINESS_ID_TEXT } = constant;
+ const { GDXZ_CUSTOM_MSEEAGE } = constant;
// 群消息解析
if (message.payload.data === BUSINESS_ID_TEXT.CREATE_GROUP) {
const renderDom = [{
@@ -118,6 +131,96 @@ Component({
}];
return renderDom;
}
+ // 1:消息内页横条(医生->患者)
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.TRABECULA) {
+ const renderDom = [{
+ type: 'trabecula',
+ title: customMessage.title,
+ desc: customMessage.desc,
+ }];
+ return renderDom;
+ }
+ //8:消息内页横条(患者->医生)
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.BANNER_MESSAGE) {
+ const renderDom = [{
+ type: 'banner_message',
+ title: customMessage.title,
+ desc: customMessage.desc,
+ }];
+ return renderDom;
+ }
+ // 2:订单结束评价弹出
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.ORDER_EVALUATION) {
+ let data = customMessage.data;
+ const renderDom = [{
+ type: 'order_evaluation',
+ order_inquiry_id: data.order_inquiry_id
+ }];
+ return renderDom;
+ }
+ // 6:处方开具成功
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.PRESCRIBE) {
+ let data = customMessage.data;
+ const renderDom = [{
+ type: 'prescribe',
+ product_name: data.product_name,
+ title: customMessage.title,
+ order_inquiry_id: data.order_inquiry_id,
+ order_prescription_id: data.order_prescription_id,
+ pharmacist_verify_time: data.pharmacist_verify_time.substring(0,10),
+ }];
+ return renderDom;
+ }
+ // 7:处方开具成功
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.PRESCRIBE_VERIFY) {
+ let data = customMessage.data;
+ const renderDom = [{
+ type: 'prescribe_verify',
+ product_name: data.product_name,
+ title: customMessage.title,
+ order_inquiry_id: data.order_inquiry_id,
+ order_prescription_id: data.order_prescription_id,
+ pharmacist_verify_time: data.pharmacist_verify_time.substring(0,10),
+ }];
+ return renderDom;
+ }
+ // 10:糖组检测
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.SUGAR_CHECK) {
+ let data = customMessage.data;
+ const renderDom = [{
+ type: 'sugar_check',
+ title:customMessage.title,
+ detection_link:data.detection_link,
+ disease_class_names:data.disease_class_names
+ }];
+ return renderDom;
+ }
+ // 11:患者信息
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.PATIENT_INFO) {
+ let data = customMessage.data;
+ const renderDom = [{
+ type: 'patient_info',
+ disease_desc:data.disease_desc,
+ path:data.message_path,
+ detection_link:data.detection_link
+ }];
+ return renderDom;
+ }
+
+ //12:问诊表
+ if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.WENZHEN_FORM) {
+ let data = customMessage.data;
+ console.log(data)
+ const renderDom = [{
+ type: 'wenzhen_form',
+ order_inquiry_id:data.order_inquiry_id,
+ message_path:data.message_path,
+ case_patient_message_path:data.case_patient_message_path,
+ case_filled_fields:data.case_filled_fields,
+ case_not_fill_fields:data. case_not_fill_fields
+ }];
+ return renderDom;
+ }
} catch (error) {
}
// 客服咨询
@@ -167,6 +270,51 @@ Component({
} catch (error) {
}
},
+ 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}`;
+ wx.downloadFile({
+ // 示例 url,并非真实存在
+ url:url,
+ filePath: newPath,
+ success: function (res) {
+ //const filePath = res.tempFilePath
+ wx.openDocument({
+ fileType:"pdf",
+ showMenu:true,
+ filePath: newPath,
+ success: function (res) {
+ wx.hideLoading();
+ console.log('打开文档成功')
+ },
+ fail:function(error){
+ wx.hideLoading();
+ wx.showToast({
+ title:res,
+ icon:"none"
+ })
+ }
+ })
+ },
+ fail:function(error){
+ wx.showToast({
+ title:error,
+ icon:"none"
+ })
+ }
+
+ })
+ }),
+ goSick(event){
+ const url=event.currentTarget.dataset.url;
+ app.go(url);
+ },
+
openLink(e) {
if (e.currentTarget.dataset.value.key === '立即前往') {
wx.navigateTo({
@@ -178,5 +326,18 @@ Component({
});
}
},
+ go(e){
+ let url = e.currentTarget.dataset.url;
+ app.go(url);
+ },
+ goList(event){
+ console.log(event);
+ const {ismine,params}=event.currentTarget.dataset;
+ console.log(params);
+ if(!ismine){
+ app.go('/Pages/yishi/sickform/index?case_filled_fields='+params)
+ }
+ // app.go(url);
+ }
},
});
diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json
index e8cfaaf..769c6ad 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json
+++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.json
@@ -1,4 +1,7 @@
{
"component": true,
- "usingComponents": {}
+ "usingComponents": {
+ "van-rate": "@vant/weapp/rate/index",
+ "van-icon": "@vant/weapp/icon/index"
+ }
}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml
index 383a5c5..24e350a 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml
+++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxml
@@ -1,4 +1,4 @@
-
+
@@ -37,8 +37,111 @@
{{renderDom[0].text}}
-
+
+
+
+ {{renderDom[0].title}}
+ {{renderDom[0].desc}}
+
+
+
+
+
+
+
+ {{renderDom[0].title}}
+
+
+
+ RP:{{renderDom[0].product_name}}
+ 开方日期: {{renderDom[0].pharmacist_verify_time}}
+
+
+ 去查看
+
+
+
+
+
+ {{renderDom[0].title}}
+
+
+
+ RP:{{renderDom[0].product_name}}
+ 开方日期: {{renderDom[0].pharmacist_verify_time}}
+
+
+ 去查看
+
+
+
+
+
+
+ {{renderDom[0].title}}报告
+
+
+ 就诊人:{{patient_family_data.patient_name}}(男女未知|{{patient_family_data.patient_age}}岁)
+ 所患疾病:{{renderDom[0].disease_class_names}}
+
+
+
+ 查看报告
+
+
+
+
+
+ 患者信息
+
+ {{patient_family_data.patient_name}}(男女未知|{{patient_family_data.patient_age}}岁)
+
+ 病情描述:{{renderDom[0].disease_desc}}
+
+
+ 查看详情
+
+
+
+
+ {{patient_family_data.patient_name}}(男女未知|{{patient_family_data.patient_age}}岁)
+
+
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+ 问诊表
+
+
+
+ 问诊表-已填写
+
+
+ 等待填写
+
+
+ 点击查看
+
diff --git a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss
index 135fe44..a9afbe1 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss
+++ b/TUIKit/components/TUIChat/components/MessageElements/CustomMessage/index.wxss
@@ -120,3 +120,303 @@ line-height: 42rpx;
letter-spacing: 0;
margin-bottom: 12rpx;
}
+
+/* 自定义样式 */
+/* 横条样式 */
+.gdxz_custom_trabecula_message{
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ width: calc(100vw - 40rpx);
+ text-align: center;
+}
+.gdxz_custom_message_title{
+ flex: 1;
+ display: flex;
+ max-width: 95vw;
+ justify-content: center;
+ background-color: #E1E1E1;
+ padding: 5rpx 40rpx;
+ font-size: 28rpx;
+ border-radius: 5rpx;
+}
+.gdxz_custom_message_desc{
+ margin-top: 30rpx;
+ display: flex;
+ max-width: 95vw;
+ letter-spacing: 2rpx;
+ justify-content: center;
+ color: #666666;
+ font-size: 24rpx;
+}
+/* 评价样式 */
+.gdxz_custom_order_evaluation_message{
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+ width: 80vw;
+ margin-right: 10vw;
+ border-radius: 10px;
+ background-color: #ffffff;
+ height: 250rpx;
+ overflow: hidden;
+ box-shadow: 0 0 10px 10px rgba(143, 142, 142, 0.2);
+}
+.evaluation_title{
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 28rpx;
+}
+.evaluation_ratebox{
+ flex: 1;
+ display: flex;
+ justify-content: center;
+ align-items:baseline;
+}
+.evaluation_button{
+ flex: 1;
+ background-color: rgb(226, 247, 247);
+ color: #3CC7C0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 34rpx;
+}
+/* 开具处方样式 */
+.gdxz_custom_order_prescribe_message{
+ width: 60vw;
+ position: relative;
+ border-radius: 10px 10px 10px 10px;
+ background: rgb(212, 239, 241);
+ border: 1rpx solid #1ACAD3;
+ /* background: rgb(255, 255, 255);
+ border: 1rpx solid #E7E7E7; */
+}
+.gdxz_custom_order_prescribe_message::after{
+ content:'';
+ position: absolute;
+ top: 35rpx;
+ right: -19rpx;
+ transform: translate(-50%,-50%) rotate(-135deg);
+ width: 16rpx;
+ height: 16rpx;
+ background: rgb(212, 239, 241);
+ border: 1rpx solid #1ACAD3;
+ /* background: rgb(255, 255, 255);
+ border: 1rpx solid #E7E7E7; */
+ border-style: none none solid solid;
+}
+.prescribe_title{
+ font-size: 34rpx;
+ border-bottom: 1px solid #E7E7E7;
+ margin: 0 20rpx;
+ padding: 20rpx 0;
+}
+.prescribe_box{
+ margin: 0 20rpx;
+ padding: 20rpx 0;
+ font-size: 28rpx;
+}
+.prescribe_box_top_pharmacist_verify_time{
+ margin-top: 20rpx;
+}
+.prescribe_box_bottom{
+ display: flex;
+ justify-content: center;
+}
+.prescribe_box_buy{
+ margin: 20rpx 20rpx 0 20rpx;
+ background-color: #3CC7C0;
+ color: #fff;
+ padding: 15rpx 30rpx;
+ border-radius: 40rpx;
+ font-size: 30rpx;
+}
+/* 糖组检测 */
+
+.back{
+ width:24rpx;
+ height:48rpx;
+ transform: rotate(180deg);
+}
+.sugarbox{
+ position: relative;
+ width: 420rpx;
+ background: rgb(255, 255, 255);
+ border: 1rpx solid #D8D8D8;
+ border-radius: 12rpx;
+}
+.sugarbox::after{
+ content:'';
+ position: absolute;
+ top: 35rpx;
+ left: 0;
+ transform: translate(-50%,-50%) rotate(45deg);
+ width: 16rpx;
+ height: 16rpx;
+ background: rgb(255, 255, 255);
+ border: 1rpx solid #D8D8D8;
+ border-style: none none solid solid;
+}
+.sugarcon{
+ margin:0rpx 24rpx 0;
+
+}
+.patient_info{
+ font-size: 28rpx;
+font-weight: 400;
+color: rgba(0,0,0,0.65);
+line-height: 40rpx;
+}
+.sugarcon{
+ border-bottom: 1rpx solid rgba(0,0,0,0.12);
+ padding-bottom: 24rpx;
+}
+.sugarcon .title{
+ margin:24rpx 0 20rpx;
+ font-size: 32rpx;
+ font-weight: 500;
+color: #3CC7C0;
+}
+.sugarbox .detail{
+ display: flex;
+ margin:0 24rpx;
+ height:88rpx;
+ font-size: 32rpx;
+font-weight: 400;
+color: rgba(0,0,0,0.85);
+ justify-content: space-between;
+ align-items: center;
+}
+/* 患者信息 */
+.patientbox{
+ display: flex;
+ flex-direction: column;
+ width: calc(100vw - 40rpx);
+ text-align: center;
+ background-color: #fff;
+ border-radius: 12rpx;
+ overflow: hidden;
+ position: relative;
+ box-shadow: 0 0 6rpx 0 #ccc;
+}
+.patientbox .title{
+ position: relative;
+ text-align: left;
+ padding:0 24rpx;
+ height: 90rpx;
+font-size: 32rpx;
+border-bottom: 1rpx solid rgba(0,0,0,0.12);
+font-weight: 550;
+color: rgba(0,0,0,0.85);
+line-height: 90rpx;
+}
+.patientbox .name{
+ color: rgba(0,0,0,0.85);
+ font-size: 32rpx;
+}
+.bg{
+ position: absolute;
+ z-index:0;
+ width:100%;
+ height:90rpx;
+}
+.patientbox .patient_info{
+ padding:40rpx 0;
+ margin:0 24rpx;
+display: flex;
+justify-content:space-between;
+}
+.look{
+ display: flex;
+ color:rgba(0,0,0,0.45);
+ align-items: center;
+}
+.sick_desc{
+ font-size: 28rpx;
+ margin:20rpx 32rpx 0;
+ text-align: left;
+
+ border-bottom: 1rpx solid rgba(0,0,0,0.12);
+ padding-bottom: 30rpx;
+
+}
+.sickname{
+ font-size: 28rpx;
+font-weight: 400;
+color: rgba(0,0,0,0.45);
+}
+.sicklook{
+ justify-content: space-between;
+ margin:0 32rpx;
+ align-items: center;
+ height: 100rpx;
+}
+.sickinfo .name{
+ margin: 20rpx 32rpx 0;
+
+ text-align: left;
+}
+.sicklook .see{
+
+ font-size: 32rpx;
+}
+.wenzhen_form{
+ width: 60vw;
+ position: relative;
+ z-index:2;
+ border-radius: 10px 10px 10px 10px;
+ border: 1rpx solid #1ACAD3;
+}
+.wenzhen_form .title{
+ border-radius: 16rpx 16rpx 0 0;
+ padding:20rpx;
+ display: flex;
+ align-items: center;
+ font-size: 30rpx;
+color: #FFFFFF;
+ background-color: #3CC7C0;
+}
+.wzicon{
+ margin-right: 10rpx;
+ width:42rpx;
+ height:46rpx;
+}
+.my-custom .wenzhen_form{
+ background: rgb(212, 239, 241);
+}
+.wenzhen_form .descform{
+ padding:15rpx 20rpx;
+ background-color: #ffff;
+ font-size: 28rpx;
+color: #666666;
+ border-radius: 0 0 16rpx 16rpx;
+}
+.wenzhen_form.my-custom::after{
+ content:'';
+ position: absolute;
+ top: 35rpx;
+ right: -19rpx;
+ transform: translate(-50%,-50%) rotate(-135deg);
+ width: 16rpx;
+ height: 16rpx;
+ background: #3CC7C0;
+ border: 1rpx solid #1ACAD3;
+ /* background: rgb(255, 255, 255);
+ border: 1rpx solid #E7E7E7; */
+ border-style: none none solid solid;
+}
+.wenzhen_form.your-custom::after{
+ content:'';
+ position: absolute;
+ top: 35rpx;
+ left: 0;
+ transform: translate(-50%,-50%) rotate(45deg);
+ width: 16rpx;
+ height: 16rpx;
+ background: #3CC7C0;
+ border: 1rpx solid #1ACAD3;
+ border-style: none none solid solid
+}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.json b/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.json
index e8cfaaf..2d67c18 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.json
+++ b/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.json
@@ -1,4 +1,8 @@
{
"component": true,
- "usingComponents": {}
+ "usingComponents": {
+ "van-image": "@vant/weapp/image/index",
+ "van-loading": "@vant/weapp/loading/index"
+
+ }
}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.wxml
index a2e9964..7d57c93 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.wxml
+++ b/TUIKit/components/TUIChat/components/MessageElements/ImageMessage/index.wxml
@@ -1,5 +1,12 @@
-
-
+
+
+
+
+
+
+
+
+
diff --git a/TUIKit/components/TUIChat/components/MessageElements/RevokeMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/RevokeMessage/index.wxml
index c4a31f8..5e14218 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/RevokeMessage/index.wxml
+++ b/TUIKit/components/TUIChat/components/MessageElements/RevokeMessage/index.wxml
@@ -1,5 +1,6 @@
-
-
+
+
+
撤回了一条消息
重新编辑
diff --git a/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.js b/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.js
index 5fbe6ec..3fa6dfc 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.js
+++ b/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.js
@@ -9,6 +9,7 @@ Component({
type: Object,
value: {},
observer(newVal) {
+ // console.log(newVal)
this.setData({
renderDom: parseText(newVal),
});
diff --git a/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxml b/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxml
index 1365c7e..8ef8cb9 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxml
+++ b/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxml
@@ -1,4 +1,4 @@
-
+
{{item.text}}
diff --git a/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxss b/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxss
index 5809238..6695cd5 100644
--- a/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxss
+++ b/TUIKit/components/TUIChat/components/MessageElements/TextMessage/index.wxss
@@ -1,7 +1,7 @@
.text-message {
max-width: 60vw;
- min-height: 80rpx;
- line-height: 80rpx;
+ min-height: 50rpx;
+ line-height: 50rpx;
padding: 10rpx 24rpx;
background: #F8F8F8;
border: 1rpx solid #D9D9D9;
@@ -20,7 +20,7 @@
.my-text::after{
content:'';
position: absolute;
- top: 45rpx;
+ top: 35rpx;
right: -19rpx;
transform: translate(-50%,-50%) rotate(-135deg);
width: 16rpx;
@@ -29,6 +29,24 @@
border: 1rpx solid #1ACAD3;
border-style: none none solid solid
}
+.your-text {
+ position: relative;
+ border-radius: 10px 10px 10px 10px;
+ background: rgb(255, 255, 255);
+ border: 1rpx solid #D8D8D8;
+}
+.your-text::after{
+ content:'';
+ position: absolute;
+ top: 35rpx;
+ left: 0;
+ transform: translate(-50%,-50%) rotate(45deg);
+ width: 16rpx;
+ height: 16rpx;
+ background: rgb(255, 255, 255);
+ border: 1rpx solid #D8D8D8;
+ border-style: none none solid solid
+}
.message-body-span {
display: flex;
justify-content: center;
@@ -36,7 +54,7 @@
/*justify-content: flex-start;*/
flex-wrap: wrap;
outline: none;
- font-size: 28rpx;
+ font-size: 34rpx;
color: #333333;
position: relative;
max-width: 60vw;
@@ -47,7 +65,9 @@
color: #000000;
letter-spacing: 0;
line-height: 40rpx;
- font-size: 28rpx;
+ /* font-size: 28rpx; */
+ word-wrap: break-word;
+ word-break: break-all;
}
.message-body-span-image {
display: inline-block;
diff --git a/TUIKit/components/TUIChat/components/MessageInput/index.js b/TUIKit/components/TUIChat/components/MessageInput/index.js
index e3ce880..2e1a81d 100644
--- a/TUIKit/components/TUIChat/components/MessageInput/index.js
+++ b/TUIKit/components/TUIChat/components/MessageInput/index.js
@@ -1,5 +1,8 @@
import logger from '../../../../utils/logger';
import constant from '../../../../utils/constant';
+import { API } from '../../../../../utils/network/api';
+import { requestSubscribeMessage } from '../../../../../utils/requestSubscribeUtil';
+const api = new API()
let app = getApp()
// eslint-disable-next-line no-undef
Component({
@@ -16,6 +19,23 @@ Component({
});
},
},
+ order_inquiry_id: {
+ type: String,
+ value: {},
+ },
+ from:{
+ type: String,
+ value: '',
+ observer(from) {
+ this.setData({
+ from: from,
+ });
+ }
+ },
+ inquiry_type: {
+ type: String,
+ value: {},
+ },
hasCallKit: {
type: Boolean,
value: false,
@@ -32,6 +52,24 @@ Component({
has_emoji:{
type: Boolean,
value: false,
+ },
+ baseInfo: {
+ type: Object,
+ value: {},
+ observer(newVal) {
+ this.setData({
+ family_id: newVal.family_id,
+ });
+ },
+ },
+ message_rounds:{
+ type: Number,
+ value: 0,
+ observer(newVal) {
+ this.setData({
+ message_rounds: newVal,
+ });
+ },
}
},
@@ -41,6 +79,7 @@ Component({
data: {
conversation: {},
message: '',
+ family_id:'',
extensionArea: false,
sendMessageBtn: false,
displayFlag: '',
@@ -55,8 +94,8 @@ Component({
notShow: false,
isShow: true,
commonFunction: [
- { name: '查看病例', key: '10' },
- { name: '开处方', key: '11' },
+ { name: '查看完整病历', key: '10' },
+ { name: '在线开处方', key: '11' },
],
displayServiceEvaluation: false,
showErrorImageFlag: 0,
@@ -64,33 +103,110 @@ Component({
isFirstSendTyping: true,
time: 0,
focus: false,
+ my_focus: false,
isEmoji: false,
fileList: [],
hasCallKit: false,
+ showChangYongYu: false,
+ ChangYongYu: [],
+ dialog_visible: false,
+ sub_visible: false,
+ timer:null,
+ recordtime:0,
+ dialog_message: "在线开处方需先进行多点执业认证",
+ message_rounds: 0,
+ networkstatus: "wifi",
+ static_host: api.getStaticHost()
},
lifetimes: {
attached() {
+ let _this = this;
// 加载声音录制管理器
this.recorderManager = wx.getRecorderManager();
- this.recorderManager.onStop((res) => {
+ this.recorderManager.onStop(async(resData) => {
wx.hideLoading();
if (this.data.canSend) {
- if (res.duration < 1000) {
+ if (resData.duration < 1000) {
wx.showToast({
title: '录音时间太短',
icon: 'none',
});
} else {
+ if(resData.duration >= 60000){
+ wx.showToast({
+ title: '录音时间不能超过60s',
+ duration:2000,
+ icon: 'none',
+ });
+ }
+ let {from}=this.data;
// res.tempFilePath 存储录音文件的临时路径
- const message = wx.$TUIKit.createAudioMessage({
- to: this.getToAccount(),
- conversationType: this.data.conversation.type,
- payload: {
- file: res,
- },
+ if(from){
+ await this.handlegetLastInquiry();
+ }
+
+ let conversationID = this.data.conversation.conversationID
+ let promise = wx.$TUIKit.getConversationProfile(conversationID);
+ promise.then((imResponse)=> {
+ // console.log("getConversationProfile 正在执行")
+ // 获取成功
+ // console.log(imResponse.data.conversation); // 会话资料
+ _this.setData({
+ conversation: imResponse.data.conversation
+ })
+ }).catch(function(imError) {
+ console.warn('getConversationProfile error:', imError); // 获取会话资料失败的相关信息
});
- this.$sendTIMMessage(message);
+
+ Promise.all([promise]).then(res => {
+ // 获取最后一条消息
+ let last_message = this.data.conversation.lastMessage;
+ // console.log("last_message: ", last_message);
+ let cloudCustomData = "";
+ let cloudCustomDataJson = "";
+ if(last_message.cloudCustomData){
+ cloudCustomData = last_message.cloudCustomData;
+ }
+ if(cloudCustomData){
+ cloudCustomDataJson = JSON.parse(cloudCustomData);
+ }
+ let message_rounds = 0;
+ let patient_family_data = {};
+ patient_family_data.patient_name = this.data.baseInfo.patient_family_name;
+ patient_family_data.patient_sex = this.data.baseInfo.patient_family_sex;
+ patient_family_data.patient_age = this.data.baseInfo.patient_family_age;
+ if(cloudCustomDataJson){
+ message_rounds = cloudCustomDataJson.message_rounds;
+ }
+
+ let cach_message_rounds = this.data.message_rounds
+ message_rounds = cach_message_rounds>message_rounds?cach_message_rounds:message_rounds
+
+ const mycloudCustomData = JSON.stringify({
+ order_inquiry_id: this.data.order_inquiry_id,
+ inquiry_type: this.data.inquiry_type,
+ message_type: 0,
+ is_system: 0,
+ message_rounds: message_rounds,
+ patient_family_data: patient_family_data
+ });
+
+ const message = wx.$TUIKit.createAudioMessage({
+ to: this.getToAccount(),
+ conversationType: this.data.conversation.type,
+ payload: {
+ file: resData,
+ },
+ cloudCustomData:mycloudCustomData
+ });
+
+ _this.$sendTIMMessage(message);
+
+ }).catch(err=>{
+
+ console.log(err)
+ })
}
}
this.setData({
@@ -102,7 +218,61 @@ Component({
text: '按住说话',
});
});
+ wx.onNetworkStatusChange(function (res) {
+ // console.log("onNetworkStatusChange from wenzhen: ")
+ // console.log(res.isConnected)
+ // console.log(res.networkType)
+ // wx.showToast({
+ // title: '网络类型:'+res.networkType,
+ // })
+
+ _this.setData({
+ networkstatus: res.networkType
+ })
+ })
+ console.log("pageLifetimes show")
+ wx.getNetworkType({
+ success (res) {
+ const networkType = res.networkType
+ _this.setData({
+ networkstatus: networkType
+ })
+ }
+ })
},
+
+ },
+ pageLifetimes:{
+ show(){
+ //获得常用语
+ let words = wx.getStorageSync('words');
+ // console.log("words from chat: ", words);
+ if(words){
+ this.setData({
+ message: words,
+ sendMessageBtn: true
+ })
+ wx.setStorageSync('words', "");
+ }
+
+ // console.log("pageLifetimes show")
+ let _this = this
+ wx.getNetworkType({
+ success (res) {
+ const networkType = res.networkType
+ _this.setData({
+ networkstatus: networkType
+ })
+ }
+ })
+
+ },
+ hide: function () {
+ let THIS=this;
+ if(THIS.data.isRecording){
+ THIS.handleTouchEnd()
+ }
+ },
},
/**
@@ -125,30 +295,99 @@ Component({
// 打开录音开关
switchAudio() {
+ wx.hideKeyboard();
+ if(!this.data.isAudio){
+ wx.getSetting({
+ success(res) {
+ if (!res.authSetting['scope.record']) {
+ wx.authorize({
+ scope: 'scope.record',
+ success () {
+
+ }
+ })
+ }
+ }
+ })
+ }
this.setData({
isAudio: !this.data.isAudio,
isEmoji: false,
text: '按住说话',
focus: false,
+ message:'',
+ sendMessageBtn:false
+ });
+ this.setData({
+ displayFlag: '',
});
},
+ openRecord(e,callback){
+ let THIS=this;
+ return new Promise((resolve, reject) => {
+ wx.getSetting({
+ success(res) {
+ if(!(res.authSetting['scope.record'])) { // 关闭订阅消息主按钮
+ return wx.showModal({
+ title: '提示',
+ content: '您已关闭麦克风权限,请点击“确认”按钮在设置中打开麦克风权限。',
+ success: function (res) {
+ if (res.confirm) {
+ wx.openSetting({
+ success(res) {
+
+ }
+ });
+ }
+ },
+ complete(){
+
+ }
+ });
+ } else { // 开放订阅消息主按钮
+ callback(e,THIS);
+ resolve()
+ }
+ },
+ complete(){
+ wx.hideLoading();
+ }
+ })
+ })
+ },
// 长按录音
handleLongPress(e) {
+ this.openRecord(e,this.recording)
+ },
+ recording(e,THIS){
wx.aegis.reportEvent({
name: 'messageType',
ext1: 'messageType-audio',
ext2: wx.$chat_reportType,
ext3: wx.$chat_SDKAppID,
});
- this.recorderManager.start({
- duration: 60000, // 录音的时长,单位 ms,最大值 600000(10 分钟)
+ THIS.recorderManager.start({
+ duration: 61000, // 录音的时长,单位 ms,最大值 600000(10 分钟)
sampleRate: 44100, // 采样率
numberOfChannels: 1, // 录音通道数
encodeBitRate: 192000, // 编码码率
format: 'aac', // 音频格式,选择此格式创建的音频消息,可以在即时通信 IM 全平台(Android、iOS、微信小程序和Web)互通
});
- this.setData({
+
+ THIS.timer=setInterval(()=>{
+ if(THIS.data.recordtime>=60){
+ THIS.handleTouchEnd();
+ clearInterval(THIS.timer);
+
+ };
+ THIS.setData({
+ recordtime:THIS.data.recordtime+1
+ });
+
+ },1000)
+ console.log("handleLongPress")
+ THIS.setData({
startPoint: e.touches[0],
title: '正在录音',
// isRecording : true,
@@ -162,6 +401,7 @@ Component({
// 录音时的手势上划移动距离对应文案变化
handleTouchMove(e) {
+ console.log("handleTouchMove")
if (this.data.isRecording) {
if (this.data.startPoint.clientY - e.touches[e.touches.length - 1].clientY > 100) {
this.setData({
@@ -187,13 +427,35 @@ Component({
// 手指离开页面滑动
handleTouchEnd() {
+ wx.nextTick(() => {
+ this.setData({
+ isRecording: false,
+ popupToggle: false,
+
+ });
+ console.log("handleTouchEnd")
+ wx.hideLoading();
+ this.recorderManager.stop();
+ clearInterval(this.timer);
+ this.setData({
+ recordtime:0
+ })
+ })
+
+ },
+ handleTouchCancel(){
this.setData({
isRecording: false,
popupToggle: false,
});
+ console.log("handleTouchCancel")
wx.hideLoading();
this.recorderManager.stop();
+ clearInterval(this.timer);
+ this.setData({
+ recordtime:0
+ })
},
// 选中表情消息
handleEmoji() {
@@ -211,6 +473,7 @@ Component({
// 选自定义消息
handleExtensions() {
+
console.warn("wx.aegis: ", wx.aegis);
wx.aegis.reportEvent({
name: 'chooseExtensions',
@@ -218,13 +481,19 @@ Component({
ext2: wx.$chat_reportType,
ext3: wx.$chat_SDKAppID,
});
+
let targetFlag = 'extension';
if (this.data.displayFlag === 'extension') {
targetFlag = '';
}
this.setData({
displayFlag: targetFlag,
+ isAudio:false
});
+ var myEventDetail = {} // detail对象,提供给事件监听函数
+ myEventDetail.displayFlag = targetFlag;
+ var myEventOption = {} // 触发事件的选项
+ this.triggerEvent('myhandleExtensions', myEventDetail, myEventOption)
},
error(e) {
@@ -270,19 +539,83 @@ Component({
},
// 发送图片消息
- handleSendImageMessage(file) {
- const message = wx.$TUIKit.createImageMessage({
- to: this.getToAccount(),
- conversationType: this.data.conversation.type,
- payload: {
- file,
- },
- onProgress: (percent) => {
- message.percent = percent;
- },
+ async handleSendImageMessage(file) {
+
+ let networkstatus = this.data.networkstatus
+ let {from}=this.data;
+ // console.log("networkstatus: ", networkstatus)
+ if(networkstatus === 'none'){
+ wx.showToast({
+ title: '请检查您的网络',
+ icon: 'error'
+ })
+ return
+ }
+ if(from){
+ await this.handlegetLastInquiry();
+ }
+ let _this = this;
+ let conversationID = this.data.conversation.conversationID
+ let promise = wx.$TUIKit.getConversationProfile(conversationID);
+ promise.then(function(imResponse) {
+ // console.log("getConversationProfile 正在执行")
+ // 获取成功
+ // console.log(imResponse.data.conversation); // 会话资料
+ _this.setData({
+ conversation: imResponse.data.conversation
+ })
+ }).catch(function(imError) {
+ console.warn('getConversationProfile error:', imError); // 获取会话资料失败的相关信息
});
- this.$sendTIMMessage(message);
+
+ Promise.all([promise]).then(res => {
+ // 获取最后一条消息
+ let last_message = this.data.conversation.lastMessage;
+ // console.log("last_message: ", last_message);
+ let cloudCustomData = "";
+ let cloudCustomDataJson = "";
+ if(last_message.cloudCustomData){
+ cloudCustomData = last_message.cloudCustomData;
+ }
+ if(cloudCustomData){
+ cloudCustomDataJson = JSON.parse(cloudCustomData);
+ }
+ let message_rounds = 0;
+ let patient_family_data = {};
+ patient_family_data.patient_name = this.data.baseInfo.patient_family_name;
+ patient_family_data.patient_sex = this.data.baseInfo.patient_family_sex;
+ patient_family_data.patient_age = this.data.baseInfo.patient_family_age;
+ if(cloudCustomDataJson){
+ message_rounds = cloudCustomDataJson.message_rounds;
+ }
+
+ let cach_message_rounds = this.data.message_rounds
+ message_rounds = cach_message_rounds>message_rounds?cach_message_rounds:message_rounds
+
+ const mycloudCustomData = JSON.stringify({
+ order_inquiry_id: this.data.order_inquiry_id,
+ inquiry_type: this.data.inquiry_type,
+ message_type: 0,
+ is_system: 0,
+ message_rounds: message_rounds,
+ patient_family_data: patient_family_data
+ });
+
+ const message = wx.$TUIKit.createImageMessage({
+ to: this.getToAccount(),
+ conversationType: this.data.conversation.type,
+ payload: {
+ file,
+ },
+ cloudCustomData: mycloudCustomData,
+ onProgress: (percent) => {
+ message.percent = percent;
+ },
+ });
+ this.$sendTIMMessage(message);
+ })
},
+
// 发送视频消息
handleSendVideoMessage(file) {
@@ -314,7 +647,8 @@ Component({
},
handleCommonFunctions(e) {
- switch (e.target.dataset.function.key) {
+ // console.log("handleCommonFunctions: ", e)
+ switch (e.target.dataset.key) {
case '0':
this.setData({
displayCommonWords: true,
@@ -331,16 +665,122 @@ Component({
});
break;
case '10'://查看完整病历
- app.go("/Pages/yishi/case/index")
+ // app.go("/Pages/yishi/case/index?order_inquiry_id="+this.data.order_inquiry_id)
+ app.go("/Pages/yishi/patient_sick/index?order_inquiry_id="+this.data.order_inquiry_id+"&family_id="+this.data.family_id)
break;
case '11'://在线开方
- app.go("/Pages/yishi/onlinechufang/index")
+ let _this = this;
+ console.log("开始订阅消息");
+ let tmplIds = ['kUy70xHlr7ADo4aIHiictM4Te7MSec3E5kHsYvFQu40']
+ let sub_promise = requestSubscribeMessage(tmplIds)
+ sub_promise.then(res => {
+ console.log("订阅成功")
+ this.goCase()
+ }).catch(err => {
+ console.log(err)
+ let errCode = err.errCode
+ if(errCode == 20004){
+ _this.setData({
+ sub_visible: true,
+ })
+ }
+ })
break;
default:
break;
}
},
+ goCase(){
+ let order_inquiry_id = this.data.order_inquiry_id
+ api.getDoctorPrescriptionCheck({order_inquiry_id: order_inquiry_id}).then(response => {
+ let status = response.data.status
+ if(status == 1){
+ app.go("/Pages/yishi/onlinechufang/index?order_inquiry_id="+order_inquiry_id)
+ }else{
+ this.setData({
+ dialog_visible: true,
+ dialog_message: response.data.message
+ })
+ }
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ cancelDialog(){
+ this.setData({
+ dialog_visible: false
+ })
+ },
+ //获取问诊订单状态
+ async getInquiryMessageBasic(order_inquiry_id) {
+ // console.log("order_inquiry_id: ", this.data.order_inquiry_id);
+ await api.getInquiryMessageBasic({order_inquiry_id:order_inquiry_id}).then(response => {
+ let result=response.data;
+ console.log(result.inquiry_status)
+ if(result.inquiry_status==3){
+ wx.showToast({
+ title: '暂时不能发送消息',
+ });
+ return false;
+ }
+ }).then(res => {
+
+ }).catch(errors => {console.error(errors);})
+ },
+ //获取最新问诊id;
+ async handlegetLastInquiry(){
+ let {baseInfo,order_inquiry_id}=this.data;
+ const {data} =await api.getLastInquiry({
+ patient_id:baseInfo.patient_id,
+ doctor_id:baseInfo.doctor_id
+ })
+ if(data){
+ if(data!=order_inquiry_id){
+ const result=await api.getInquiryMessageBasic({order_inquiry_id:data});
+ if(result.data.inquiry_status==3){
+ wx.showToast({
+ title: '暂时不能发送消息',
+ });
+ return false;
+ }
+ //this.getInquiryMessageBasic(data);
+ }
+ }
+ // .then(data=>{
+
+ // let result=data.data;
+ // console.log(result,order_inquiry_id)
+ // if(result){
+ // if(result!=order_inquiry_id){
+ // this.getInquiryMessageBasic(result);
+ // }
+ // }
+
+ // })
+ },
+ confirmDialog(){
+ // app.go("/Pages/yishi/zhiye_identity/index")
+ this.setData({
+ dialog_visible: false
+ })
+ },
+ subcancelDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ this.goCase()
+ },
+ subconfirmDialog(){
+ this.setData({
+ sub_visible: false
+ })
+ wx.openSetting({
+ success (res) {
+ // console.log(res.authSetting)
+ }
+ })
+ },
handleSendOrder() {
this.setData({
displayOrderList: true,
@@ -472,34 +912,94 @@ Component({
});
},
- sendTextMessage(msg, flag) {
+ async sendTextMessage(msg, flag) {
+ let networkstatus = this.data.networkstatus
+ let {from}=this.data;
+ // console.log("networkstatus: ", networkstatus)
+ if(networkstatus === 'none'){
+ wx.showToast({
+ title: '请检查您的网络',
+ icon: 'error'
+ })
+ return
+ }
+ if(from){
+ await this.handlegetLastInquiry();
+ };
wx.aegis.reportEvent({
name: 'messageType',
ext1: 'messageType-text',
ext2: wx.$chat_reportType,
ext3: wx.$chat_SDKAppID,
});
- const to = this.getToAccount();
- const text = flag ? msg : this.data.message;
- const { FEAT_NATIVE_CODE } = constant;
- const message = wx.$TUIKit.createTextMessage({
- to,
- conversationType: this.data.conversation.type,
- payload: {
- text,
- },
- cloudCustomData: JSON.stringify({ messageFeature:
- {
- needTyping: FEAT_NATIVE_CODE.FEAT_TYPING,
- version: FEAT_NATIVE_CODE.NATIVE_VERSION,
- },
- }),
+ let _this = this;
+ let conversationID = this.data.conversation.conversationID
+ let promise = wx.$TUIKit.getConversationProfile(conversationID);
+ promise.then(function(imResponse) {
+ // console.log("getConversationProfile 正在执行")
+ // 获取成功
+ // console.log(imResponse.data.conversation); // 会话资料
+ _this.setData({
+ conversation: imResponse.data.conversation
+ })
+ }).catch(function(imError) {
+ console.warn('getConversationProfile error:', imError); // 获取会话资料失败的相关信息
});
- this.setData({
- message: '',
- sendMessageBtn: false,
- });
- this.$sendTIMMessage(message);
+
+ Promise.all([promise]).then(res => {
+ // console.log("getConversationProfile 执行完毕")
+ //获取最后一条消息
+ let last_message = this.data.conversation.lastMessage;
+ // console.log("last_message: ", last_message);
+ let cloudCustomData = "";
+ let cloudCustomDataJson = "";
+ if(last_message.cloudCustomData){
+ cloudCustomData = last_message.cloudCustomData;
+ }
+ if(cloudCustomData){
+ cloudCustomDataJson = JSON.parse(cloudCustomData);
+ }
+ let message_rounds = 0;
+ let patient_family_data = {};
+ patient_family_data.patient_name = this.data.baseInfo.patient_family_name;
+ patient_family_data.patient_sex = this.data.baseInfo.patient_family_sex;
+ patient_family_data.patient_age = this.data.baseInfo.patient_family_age;
+ if(cloudCustomDataJson){
+ message_rounds = cloudCustomDataJson.message_rounds;
+ }
+
+ let cach_message_rounds = this.data.message_rounds
+ message_rounds = cach_message_rounds>message_rounds?cach_message_rounds:message_rounds
+
+ const to = this.getToAccount();
+ const text = flag ? msg : this.data.message;
+
+ const { FEAT_NATIVE_CODE } = constant;
+ const mycloudCustomData = JSON.stringify({
+ order_inquiry_id: this.data.order_inquiry_id,
+ inquiry_type: this.data.inquiry_type,
+ message_type: 0,
+ is_system: 0,
+ message_rounds: message_rounds,
+ patient_family_data: patient_family_data
+ });
+
+ // console.log("mycloudCustomData: ", mycloudCustomData);
+ // console.log("text: ", text);
+ const message = wx.$TUIKit.createTextMessage({
+ to,
+ conversationType: this.data.conversation.type,
+ payload: {
+ text,
+ },
+ cloudCustomData: mycloudCustomData
+ });
+ this.setData({
+ message: '',
+ sendMessageBtn: false,
+ });
+ this.$sendTIMMessage(message);
+ })
},
// 监听输入框value值变化
@@ -514,11 +1014,12 @@ Component({
sendMessageBtn: false,
});
}
- event.detail.value && this.sendTypingStatusMessage();
+ // event.detail.value && this.sendTypingStatusMessage();
},
// 发送正在输入状态消息
sendTypingStatusMessage() {
+
const { BUSINESS_ID_TEXT, FEAT_NATIVE_CODE } = constant;
// 创建正在输入状态消息, "typingStatus":1,正在输入中1, 输入结束0, "version": 1 兼容老版本,userAction:0, // 14表示正在输入,actionParam:"EIMAMSG_InputStatus_Ing" //"EIMAMSG_InputStatus_Ing" 表示正在输入, "EIMAMSG_InputStatus_End" 表示输入结束
const typingMessage = wx.$TUIKit.createCustomMessage({
@@ -577,7 +1078,7 @@ Component({
this.setData({
focus: true,
});
- this.getMessageList(this.data.conversation);
+ // this.getMessageList(this.data.conversation);
this.triggerEvent('pullKeysBoards', {
event,
});
@@ -618,7 +1119,11 @@ Component({
event,
});
},
-
+ inputBindLinechange(event){
+ this.triggerEvent('inputBindLinechange', {
+ event,
+ });
+ },
$handleSendTextMessage(event) {
this.sendTextMessage(event.detail.message, true);
this.setData({
@@ -668,12 +1173,21 @@ Component({
},
// 发送正在输入消息
$sendTypingMessage(message) {
- wx.$TUIKit.sendMessage(message, {
- onlineUserOnly: true,
- });
+ // wx.$TUIKit.sendMessage(message, {
+ // onlineUserOnly: true,
+ // });
},
$sendTIMMessage(message) {
+ console.log("$sendTIMMessage: ",message)
+ let networkstatus = this.data.networkstatus
+ if(networkstatus === 'none'){
+ wx.showToast({
+ title: '请检查您的网络',
+ icon: 'error'
+ })
+ return
+ }
this.triggerEvent('sendMessage', {
message,
});
@@ -681,7 +1195,14 @@ Component({
offlinePushInfo: {
disablePush: true,
},
- }).then(() => {
+ }).then((res) => {
+
+ console.log("sendMessage:", res)
+ if(res.code === 0){
+ this.triggerEvent('refreshMessageStatus', {
+ message,
+ });
+ }
const firstSendMessage = wx.getStorageSync('isFirstSendMessage');
if (firstSendMessage) {
wx.aegis.reportEvent({
@@ -691,8 +1212,7 @@ Component({
ext3: wx.$chat_SDKAppID,
});
}
- })
- .catch((error) => {
+ }).catch((error) => {
logger.log(`| TUI-chat | message-input | sendMessageError: ${error.code} `);
wx.aegis.reportEvent({
name: 'sendMessage',
@@ -713,6 +1233,7 @@ Component({
handleClose() {
this.setData({
displayFlag: '',
+ my_focus: false
});
},
@@ -721,5 +1242,13 @@ Component({
displayServiceEvaluation: true,
});
},
+ //常用语
+ showChangYongYu(){
+ app.go("/Pages/yishi/quickreply/index?from=chat")
+ },
+ showWenZhenBiao(){
+ app.go("/Pages/yishi/write_sickform/index?order_inquiry_id="+this.data.order_inquiry_id)
+ },
+
},
});
diff --git a/TUIKit/components/TUIChat/components/MessageInput/index.json b/TUIKit/components/TUIChat/components/MessageInput/index.json
index 10d10cc..9e27a6f 100644
--- a/TUIKit/components/TUIChat/components/MessageInput/index.json
+++ b/TUIKit/components/TUIChat/components/MessageInput/index.json
@@ -4,6 +4,7 @@
"Emoji": "../MessageElements/Emoji/index",
"CommonWords": "../MessagePrivate/CommonWords/index",
"OrderList": "../MessagePrivate/OrderList/index",
- "ServiceEvaluation": "../MessagePrivate/ServiceEvaluation/index"
+ "ServiceEvaluation": "../MessagePrivate/ServiceEvaluation/index",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
diff --git a/TUIKit/components/TUIChat/components/MessageInput/index.wxml b/TUIKit/components/TUIChat/components/MessageInput/index.wxml
index 0d03825..1b9ac44 100644
--- a/TUIKit/components/TUIChat/components/MessageInput/index.wxml
+++ b/TUIKit/components/TUIChat/components/MessageInput/index.wxml
@@ -1,22 +1,27 @@
- {{item.name}}
+ 查看完整病历
+ 在线开处方
-
-
+ bindconfirm="sendTextMessage"
+ bindlinechange="inputBindLinechange"
+ />
{{text}}
@@ -25,12 +30,14 @@
+
-
-
-
- 发送
-
+
+
+
+ 发送
+
+
@@ -38,17 +45,21 @@
-
+
相机
-
+
照片
-
-
+
+
常用语
+
+
+ 问诊表
+
-
-
-
+
+
+
+
+
+
@@ -55,13 +54,14 @@
-
-
+
+
-
+
+
@@ -69,22 +69,31 @@
+
-
+
{{showNewMessageCount.length}}条新消息
-
-
- 99+条未读
- {{unreadCount}}条未读
-
+
+
+ 99+条未读
+ {{unreadCount}}条未读
+
+
+
+ {{message_title}}
+ {{message_desc}}
+
+
+
+
diff --git a/TUIKit/components/TUIChat/components/MessageList/index.wxss b/TUIKit/components/TUIChat/components/MessageList/index.wxss
index c6a7137..2aa17b1 100644
--- a/TUIKit/components/TUIChat/components/MessageList/index.wxss
+++ b/TUIKit/components/TUIChat/components/MessageList/index.wxss
@@ -1,11 +1,13 @@
.container{
width: 100%;
height: 100%;
+ position: relative;
background-color: #F4F4F4;
}
.message-list-container {
+ /* margin-top: 20rpx; */
width: 100%;
- height: calc(100% - 120rpx);
+ height: calc(100%);
background-color: #F4F4F4;
}
.t-message-item {
@@ -13,7 +15,10 @@
padding: 14rpx 0;
}
.t-message{
- position: relative
+ position: relative;
+ z-index: -9;
+ width: calc(100vw - 40rpx);
+ padding: 10rpx 20rpx 20rpx 20rpx;
}
.t-recieve-message {
display: flex;
@@ -24,7 +29,7 @@
.t-message-avatar {
margin-left: 20rpx;
margin-right: 12rpx;
- border-radius: 10rpx;
+ border-radius: 50%;
width: 80rpx;
height: 80rpx;
}
@@ -33,7 +38,6 @@
display: flex;
flex-direction: row;
justify-content: flex-end;
- width: 100vw;
word-break: break-all;
}
.t-self-message-body {
@@ -59,6 +63,13 @@
color: #6e7981;
margin-right: 10px
}
+.message_send_status {
+ line-height: 42px;
+ height: 42px;
+ font-size: 12px;
+ color: #6e7981;
+ margin-right: 10px
+}
.no-message {
text-align: center;
position: fixed;
@@ -137,7 +148,7 @@
border-width: 20px;
position: absolute;
bottom: -27px;
- left: 55px;
+ left: 0px;
border-style: solid dashed dashed;
border-color: black transparent transparent;
font-size: 0;
@@ -250,45 +261,18 @@
padding-left: 5px;
color: blue;
}
-.info{
- height: 100rpx;
- background-color: #fff;
- display: flex;
- justify-content: space-around;
- align-items: center;
- box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
+.content_title{
+ font-size: 32rpx;
+ color: #000;
}
-.left{
- display: flex;
- justify-content: space-around;
- align-items: center;
- flex: 2;
-}
-.right{
- flex: 1;
- text-align: right;
+.content_desc{
font-size: 28rpx;
- color: #FFFFFF;
- padding-right: 20rpx;
+ color: rgb(146, 144, 144);
}
-.right_txt{
- background: #3CC7C0;
- border-radius: 29rpx;
- padding: 10rpx 20rpx;
-}
-.name{
- font-size: 34rpx;
- color: #3CC7C0;
-}
-.age{
- font-size: 34rpx;
- color: #666666;
-}
-.status{
- background: #FFF2E8;
- box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
- border-radius: 10rpx;
- font-size: 24rpx;
- color: #FA541C;
- padding: 10rpx 20rpx;
+.medList{
+ position: absolute;
+ left:0;
+ bottom:10rpx;
+ width:153rpx;
+ height: 159rpx;
}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/index.js b/TUIKit/components/TUIChat/index.js
index 3cd4945..5d1ac3e 100644
--- a/TUIKit/components/TUIChat/index.js
+++ b/TUIKit/components/TUIChat/index.js
@@ -1,15 +1,20 @@
// TUIKit-WChat/Chat/index.js
import logger from '../../utils/logger';
import constant from '../../utils/constant';
+import { API } from './../../../utils/network/api'
+import { rpxTopx } from './../../../utils/util'
+const dayjs = require("../../utils/dayjs.js");
+const api = new API()
// eslint-disable-next-line no-undef
const app = getApp();
const inputStyle = `
- --padding: 25px
+ --padding: 0px;
`;
let newInputStyle = `
---padding: 0px
+--padding: 0px;
+position: absolute;
`;
const setNewInputStyle = (number) => {
@@ -31,6 +36,23 @@ Component({
});
},
},
+ order_inquiry_id: {
+ type: String,
+ value: ''
+ },
+ from:{
+ type: String,
+ value: '',
+ observer(from) {
+ this.setData({
+ from: from,
+ });
+ },
+ },
+ inquiry_type: {
+ type: String,
+ value: ''
+ },
unreadCount: {
type: Number,
value: '',
@@ -49,6 +71,16 @@ Component({
});
},
},
+ baseInfo: {
+ type: Object,
+ value: {},
+ observer(baseInfo) {
+ this.dealBasic(baseInfo);
+ this.setData({
+ "navbarData.title": baseInfo.patient_family_name
+ });
+ },
+ }
},
lifetimes: {
@@ -56,14 +88,66 @@ Component({
if (app?.globalData?.reportType === constant.OPERATING_ENVIRONMENT) {
this.setData({
showTips: true,
+ message_rounds: 0
});
}
+ //console.log("000")
+ this.getNavbarHeight()
+
+ // let _this = this
+ // wx.onKeyboardHeightChange(res => {
+ // let kb_height = res.height
+ // console.log("键盘高度:", kb_height)
+ // _this.setData({
+ // kb_height: kb_height
+ // })
+ // console.log("111")
+ // _this.getNavbarHeight();
+ // })
},
+
+ ready() {
+ //修改为组件传值
+ // this.getInquiryMessageBasic()
+ // console.log("app.globalData.scene from TUIchat ready: ", app.globalData.scene);
+ let pages = getCurrentPages();
+ // console.log("pages:", pages)
+ // console.log("pages.length:", pages.length)
+ // console.log("pages:", pages[0])
+ if(pages.length == 1){
+ // console.log("navbarData.showCapsule");
+ this.setData({
+ "navbarData.showCapsule": 3
+ })
+ }
+ this.setData({
+ finsh_btn: false
+ })
+
+ wx.onNetworkStatusChange((res) => {
+ let msg = ''
+ if (!res.isConnected) {
+ msg = '当前网络不可用,请检查你的网络设置'
+ } else if (res.networkType === 'none') {
+ msg = '网络开小差了,请在网络良好后重试'
+ }
+ if (msg) {
+ wx.showToast({
+ title: msg,
+ icon: 'none',
+ })
+ }
+ })
+
+ }
},
/**
* 组件的初始数据
*/
data: {
+ rest_time:0,
+ total_rounds:0,
+ timeData:{},
conversationName: '',
conversation: {},
messageList: [],
@@ -83,20 +167,211 @@ Component({
viewData: {
style: inputStyle,
},
+ input_area_style:"",
KeyboardHeight: 0,
showTips: false,
showGroupTips: false,
showAll: false,
+ navbarData: {
+ showCapsule: 2, //是否显示左上角图标 1表示显示 0表示不显示
+ title: '', //导航栏 中间的标题
+ },
+ navbar_height: 120,
+ dialog_visible: false,
+ finsh_btn: false,
+ KeysBoardsStatus: "down",
+ message_rounds: 0,
+ keysboards_height: 0,
+ kb_height: 0,
+ change_kb: false
},
/**
* 组件的方法列表
*/
methods: {
+ refreshMessageRounds(e){
+ // console.log("TUIchat refreshMessageRounds", e)
+ let message_rounds = e.detail.message_rounds
+ // console.log("TUIchat refreshMessageRounds message_rounds:", message_rounds)
+ this.setData({
+ message_rounds: message_rounds
+ })
+ //let total_rounds=this.data.total_rounds;
+ // if(total_rounds>=0){
+ // if(total_rounds-message_rounds<=0 && this.data.baseInfo.inquiry_status==4){
+ // wx.showToast({
+ // title: '沟通已达到限制的'+total_rounds+'个回合',
+ // icon:"none"
+ // })
+ // this.finishConsult();
+ // }
+ // }
+
+ },
+ onChangeTime(e) {
+ this.setData({
+ 'timeData': e.detail,
+ });
+ },
+ getNavbarHeight(addHeight){
+
+ try {
+ //console.log("getNavbarHeight: ", new Date().getTime())
+ let rect = null;
+ if (wx.getMenuButtonBoundingClientRect) {
+ rect = wx.getMenuButtonBoundingClientRect();
+ }
+ // console.log("rect: ", rect)
+ wx.getSystemInfo({
+ success: (res) => {
+ // const { statusBarHeight } = wx.getSystemInfoSync();
+ // console.log("statusBarHeight: ", statusBarHeight);
+ // console.log("${rect.height}px: ", `${rect.height}`);
+ let height = Number.parseInt(res.statusBarHeight) + Number.parseInt(`${rect.height}`);
+
+ let KeysBoardsStatus = this.data.KeysBoardsStatus
+ if(KeysBoardsStatus == 'pull'){
+ height = height + rpxTopx(35)
+ }else{
+ height = height + rpxTopx(70)
+ }
+ if(addHeight > 0){
+ height = height + addHeight
+ }
+ let kb_height = Number.parseInt(this.data.kb_height)
+ let textarea_height = Number.parseInt(this.data.textarea_height)
+ //console.log("getNavbarHeight 键盘高度:", kb_height)
+ if(kb_height > 0){
+ //console.log("height 1: ", height)
+ height = height + kb_height
+ //console.log("height 2: ", height)
+ }
+ if(textarea_height > 0){
+ //console.log("height 1: ", height)
+ height = height + textarea_height
+ //console.log("height 2: ", height)
+ }
+
+ this.setData({
+ navbar_height: height
+ })
+ //console.log(444)
+ },
+ fail: (err) => {
+ console.error('navbar 获取系统信息失败', err);
+ },
+ });
+ } catch (error) {
+ console.error(error)
+ }
+
+
+ },
+ //结束问诊
+ putDoctorInquiryFinish() {
+ this.setData({
+ dialog_visible: true
+ })
+ wx.hideKeyboard()
+ },
+ cancelDialog(){
+ this.setData({
+ dialog_visible: false
+ })
+ },
+ finishConsult(){
+ this.setData({
+ finsh_btn: true
+ })
+ api.putDoctorInquiryFinish({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
+ // console.log(response);
+ // this.getInquiryMessageBasic();
+ //调用子组件中的跳到最新消息
+ this.getNavbarHeight()
+ this.selectComponent('#MessageList').handleJumpNewMessage();
+ }).catch(errors => {
+ console.error(errors);
+ this.setData({
+ message_rounds:this.data.total_rounds,
+ finsh_btn: false
+ })
+ })
+ },
+ confirmDialog(){
+ let finsh_btn = this.data.finsh_btn
+ if(finsh_btn){
+ return
+ }
+ this.finishConsult();
+ this.setData({
+ dialog_visible: false
+ })
+ },
+ dealBasic(obj){
+ let data=obj;
+ console.log(data.duration)
+ if(data.inquiry_status==4){
+ if(data.times_number==0){
+ this.setData({
+ total_rounds:-1,//无线沟通
+ })
+ }else{
+ this.setData({
+ total_rounds:data.times_number,//无线沟通
+ })
+ }
+
+ if (data.duration != 0) {
+ if (data.reception_time){
+ let endtime = dayjs(data.reception_time).add(data.duration, 'minute').format('YYYY-MM-DD HH:mm:ss');
+ let nowtime = dayjs().format('YYYY-MM-DD HH:mm:ss');
+ let countdown = dayjs(endtime).diff(nowtime, "millisecond");
+ let countdownTime = countdown > 0 ? countdown : 0;
+ console.log("countdownTime--------");
+ console.log(countdownTime);
+ this.setData({
+ "rest_time": countdownTime
+ });
+ //if(countdownTime==0){
+ // wx.showToast({
+ // title: '沟通时长已超过限制时间',
+ // icon:"none"
+ // })
+ // this.finishConsult();
+ // }
+ } else {
+
+ this.setData({
+ "rest_time": 0
+ })
+ }
+ } else {
+ console.log("wwww")
+ this.setData({
+ "rest_time": -1 //接诊不限时间
+ })
+ }
+ }
+
+ },
+ //获取问诊订单消息内页基础数据
+ getInquiryMessageBasic() {
+ // console.log("order_inquiry_id: ", this.data.order_inquiry_id);
+ api.getInquiryMessageBasic({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
+ console.log("11111111111111111111111111111111111111")
+ // console.log(response);
+ this.setData({
+ baseInfo: response.data,
+ })
+ if(response.data.inquiry_status > 4){
+ wx.hideKeyboard()
+ this.getNavbarHeight()
+ }
+ }).catch(errors => {console.error(errors);})
+ },
init() {
-
console.warn("TUIChat js: init", this.data.conversationID)
-
wx.$TUIKit.setMessageRead({ conversationID: this.data.conversationID }).then(() => {
logger.log('| TUI-chat | setMessageRead | ok');
});
@@ -136,12 +411,22 @@ Component({
sendMessage(event) {
// 将自己发送的消息写进消息列表里面
this.selectComponent('#MessageList').updateMessageList(event.detail.message);
+ this.getNavbarHeight();
+ },
+ refreshMessageStatus(message) {
+ //console.log("TUIchat refreshMessageStatus", message)
+ this.selectComponent('#MessageList').refreshMessageStatus(message);
},
showMessageErrorImage(event) {
this.selectComponent('#MessageList').sendMessageError(event);
},
triggerClose() {
- this.selectComponent('#MessageInput').handleClose();
+ //console.log("message-list triggerClose")
+ if(this.data.baseInfo.inquiry_status == 4){
+ this.selectComponent('#MessageInput').handleClose();
+ }
+ wx.hideKeyboard()
+ this.getNavbarHeight()
},
handleCall(event) {
if (event.detail.conversationType === wx.$TUIKitTIM.TYPES.CONV_GROUP) {
@@ -172,18 +457,83 @@ Component({
resendMessage(event) {
this.selectComponent('#MessageInput').onInputValueChange(event);
},
+ myhandleExtensions(e){
+ //console.log("myhandleExtensionsmyhandleExtensions: ", e);
+ wx.hideKeyboard()
+ let displayFlag = e.detail.displayFlag;
+ // setTimeout(() => {
+ if(displayFlag){
+ this.setData({
+ input_area_style: "position: absolute; bottom: 20px;"
+ })
+ this.getNavbarHeight(100);
+ this.selectComponent('#MessageList').handleJumpNewMessage();
+ }else{
+ this.setData({
+ input_area_style: "",
+ })
+ this.getNavbarHeight();
+ }
+ // }, 100);
+ },
// 监听键盘,获取焦点时将输入框推到键盘上方
pullKeysBoards(event) {
- setNewInputStyle(event.detail.event.detail.height);
+ //console.log("pullKeysBoardspullKeysBoards")
+ let value = event.detail.event.detail.value;
+ let height = event.detail.event.detail.height;
+
+ //console.log("pullKeysBoards value: ", height)
+ setNewInputStyle(height);
+ if(height){
+ this.setData({
+ kb_height: height
+ })
+ }
+ //console.log("333")
this.setData({
'viewData.style': newInputStyle,
+ // input_area_style: "position: absolute; bottom: 52rpx;",
+ KeysBoardsStatus: "pull"
});
+ this.getNavbarHeight();
+ this.selectComponent('#MessageList').handleJumpNewMessage();
+
},
// 监听键盘,失去焦点时收起键盘
downKeysBoards(event) {
+ //console.log("downKeysBoardsdownKeysBoards")
+ // //console.log(event)
+ let value = event.detail.event.detail.value;
+ //console.log("downKeysBoards value: ", value)
+ if(value){
+ this.setData({
+ 'viewData.style': inputStyle,
+ KeysBoardsStatus: "down",
+ kb_height: 0
+ });
+ }else{
+ this.setData({
+ 'viewData.style': inputStyle,
+ input_area_style: "",
+ KeysBoardsStatus: "down",
+ kb_height: 0
+ });
+ }
+ //console.log("444")
+ this.getNavbarHeight();
+ },
+ inputBindLinechange(event){
+ console.log(event)
+ let lineCount = event.detail.event.detail.lineCount;
+ let height = event.detail.event.detail.height;
+ if(height > 100){
+ return
+ }
+ let lineHeight = height / lineCount;
this.setData({
- 'viewData.style': inputStyle,
- });
+ textarea_height: lineHeight * (lineCount - 1)
+ })
+ this.getNavbarHeight();
},
typing(event) {
const { STRING_TEXT, FEAT_NATIVE_CODE } = constant;
diff --git a/TUIKit/components/TUIChat/index.json b/TUIKit/components/TUIChat/index.json
index c0873f0..617f126 100644
--- a/TUIKit/components/TUIChat/index.json
+++ b/TUIKit/components/TUIChat/index.json
@@ -3,6 +3,10 @@
"usingComponents": {
"MessageList": "./components/MessageList/index",
"MessageInput": "./components/MessageInput/index",
- "TUIGroup": "../TUIGroup/index"
- }
+ "TUIGroup": "../TUIGroup/index",
+ "van-count-down": "@vant/weapp/count-down/index",
+ "te-nav-bar": "/commpents/te_navbar",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
+ },
+ "disableScroll":true
}
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/index.wxml b/TUIKit/components/TUIChat/index.wxml
index e558cea..86b13ce 100644
--- a/TUIKit/components/TUIChat/index.wxml
+++ b/TUIKit/components/TUIChat/index.wxml
@@ -1,27 +1,84 @@
+
-
-
- {{conversationName}}-患者姓名
+
+
+
+ {{baseInfo.patient_family_name}}
+{{baseInfo.patient_family_sex==1?'男':'女'}} | {{baseInfo.patient_family_age}}岁
+
+
+
+ 问诊中|不限时间
+
+ 剩余
+
+
+ {{(timeData.days*24)+timeData.hours }}小时
+ {{timeData.minutes }}分
+ {{ timeData.seconds }}秒
+
+
+
+ 不限沟通次数
+
+ {{total_rounds-message_rounds}}
+ 0个沟通回合
+
+
-
-
+
+ 结束问诊
+ {{baseInfo.inquiry_status==1?'待支付':baseInfo.inquiry_status==2?'待分配':baseInfo.inquiry_status==3?'待接诊':baseInfo.inquiry_status==4?'接诊中':baseInfo.inquiry_status==5?'问诊完成':baseInfo.inquiry_status==6?'已结束':baseInfo.inquiry_status==7?'已取消':'未知'}}
+
+
+
+
+
+
-
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/index.wxss b/TUIKit/components/TUIChat/index.wxss
index 098291a..ac0f562 100644
--- a/TUIKit/components/TUIChat/index.wxss
+++ b/TUIKit/components/TUIChat/index.wxss
@@ -1,7 +1,8 @@
.container {
width: 100vw;
- /* height: 100vh; */
- background-color: #dcaceb;
+ height: 100vh;
+ background-color: #F4F4F4;
+ z-index: 0;
}
.safetytips-box{
background: rgba(255, 149, 0, 0.1);
@@ -25,7 +26,7 @@
top: 0;
width: 750rpx;
height: 172rpx;
- background-color: #bae46b;
+ background-color: #ffffff;
}
.tui-navigatorbar-back{
@@ -80,10 +81,9 @@
align-items: center;
}
.list-box {
- position: absolute;
+ /* position: absolute; */
width: 100vw;
- height: calc(100vh - 210px);
- top: 172rpx;
+ /* position: fixed; */
}
.list-box-notips {
height: calc(100vh - 284px);
@@ -97,9 +97,12 @@
top: 246rpx;
}
.input-area {
- position: absolute;
- bottom: 0;
- }
+ position: relative;
+ z-index: 2;
+ /* z-index: 999999; */
+ /* position: absolute;
+ bottom: 20px; */
+}
.message-list {
width: 100%;
height: 100%;
@@ -110,6 +113,7 @@
width: 100%;
padding-bottom: var(--padding);
background-color: #ffffff;
+ /* z-index: 999999; */
}
.calling {
position: fixed;
@@ -124,3 +128,102 @@
z-index: 8;
position: absolute;
}
+.info{
+ /* position: relative; */
+ z-index: 9;
+ height: 100rpx;
+ background-color: rgb(255, 255, 255);
+ display: flex;
+ padding:0 10rpx;
+ justify-content: space-between;
+ align-items: center;
+ box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
+}
+.left{
+ display: flex;
+ justify-content:space-between;
+ align-items: center;
+
+}
+.right{
+
+ font-size: 28rpx;
+ color: #FFFFFF;
+ /* padding-right: 20rpx; */
+}
+.time_desc{
+ color:#E34D59;
+ display: flex;
+ font-size: 32rpx;
+ white-space: nowrap;
+ align-items: center;
+}
+.control-count-down{
+ display: flex;
+}
+.time_desc .item{
+ color:#E34D59;
+ margin-top:3rpx;
+ display:inline-flex;
+ white-space: nowrap;
+ align-items: center;
+ font-size: 32rpx;
+}
+.count_time{
+ font-size: 32rpx;
+ display: flex;
+ height:100rpx;
+ align-items: center;
+}
+.circle_top{
+ width: 10rpx;
+ height: 10rpx;
+ margin-right: 10rpx;
+ background: #3CC7C0;
+ border-radius: 50%;
+}
+.right_txt{
+ background: #3CC7C0;
+ border-radius: 29rpx;
+ padding: 10rpx 20rpx;
+}
+.name{
+ font-size: 34rpx;
+ color: #3CC7C0;
+ text-align: center;
+}
+.age{
+ display: flex;
+ align-items: center;
+ margin-left: 20rpx;
+ font-size: 34rpx;
+ color: #666666;
+}
+.status{
+ display: flex;
+ justify-content: center;
+ background: #FFF2E8;
+ box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
+ border-radius: 10rpx;
+ font-size: 24rpx;
+ color: #FA541C;
+ padding: 10rpx 20rpx;
+}
+.status_complete{
+ color: #ffffff;
+ background-color: #c5c5c5;
+}
+.dialog{
+ width: 50%;
+ text-align: center;
+ height: 100rpx;
+ line-height: 100rpx;
+}
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
+}
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
+}
\ No newline at end of file
diff --git a/TUIKit/components/TUIConversation/index.js b/TUIKit/components/TUIConversation/index.js
index c8584b4..e3f7d26 100644
--- a/TUIKit/components/TUIConversation/index.js
+++ b/TUIKit/components/TUIConversation/index.js
@@ -116,6 +116,7 @@ Component({
},
getConversationList() {
wx.$TUIKit.getConversationList().then((imResponse) => {
+ console.log("imResponse.data.conversationList: ", imResponse.data.conversationList);
this.setData({
conversationList: imResponse.data.conversationList,
});
diff --git a/TUIKit/lib/tim-wx-sdk.2.27.0.js b/TUIKit/lib/tim-wx-sdk.2.27.0.js
new file mode 100644
index 0000000..8639a34
--- /dev/null
+++ b/TUIKit/lib/tim-wx-sdk.2.27.0.js
@@ -0,0 +1 @@
+'use strict';!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).TIM=t()}(this,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function f(e){var t=l();return function(){var n,o=u(e);if(t){var s=u(this).constructor;n=Reflect.construct(o,arguments,s)}else n=o.apply(this,arguments);return _(this,n)}}function v(e,t){return M(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var o,s,a=[],r=!0,i=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(u){i=!0,s=u}finally{try{r||null==n.return||n.return()}finally{if(i)throw s}}return a}(e,t)||I(e,t)||T()}function m(e){return function(e){if(Array.isArray(e))return C(e)}(e)||y(e)||I(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e){if(Array.isArray(e))return e}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function I(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){i=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(i)throw a}}}}var k={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_SYSTEM_NOTICE_RECEIVED:"receiveGroupSystemNotice",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",SDK_RELOAD:"sdkReload"},S={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},L=function(){function e(){o(this,e),this.cache=[],this.options=null}return a(e,[{key:"use",value:function(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),e}(),E=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n}return a(e,[{key:"equal",value:function(e){return null!==e&&(this.low===e.low&&this.high===e.high)}},{key:"toString",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t="0"+t,n--;return e+t}}]),e}(),A={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT:"wss://wsssgp.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com"},KOREA:{DEFAULT:"wss://wsskr.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",STAT:"https://apikr.my-imcloud.com"},GERMANY:{DEFAULT:"wss://wssger.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",STAT:"https://apiger.my-imcloud.com"},IND:{DEFAULT:"wss://wssind.my-imcloud.com",BACKUP:"wss://wssind.im.qcloud.com",STAT:"https://apiind.my-imcloud.com"},JPN:{DEFAULT:"wss://wssjpn.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT:"wss://wssusa.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",STAT:"https://apiusa.my-imcloud.com"}}},R={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15},N="1.7.3",O=537048168,G="CHINA",P="OVERSEA",U="SINGAPORE",b="KOREA",w="GERMANY",q="IND",F="JPN",x="USA",V={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G;this.CURRENT=A.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GROUP:"group_open_http_svc",GROUP_AVCHATROOM:"group_open_avchatroom_http_svc",GROUP_COMMUNITY:"million_group_open_http_svc",GROUP_ATTR:"group_open_attr_http_svc",FRIEND:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GROUP_NO_AUTH:"group_open_http_noauth_svc",BIG_GROUP_LONG_POLLING:"group_open_long_polling_http_svc",BIG_GROUP_LONG_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MESSAGE:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate"},CMD:{LOGIN:"wslogin",LOGOUT_LONG_POLL:"longpollinglogout",LOGOUT:"wslogout",HELLO:"wshello",STAT_BACKGROUND:"ws_stat_background",STAT_FOREGROUND:"ws_stat_foreground",SET_TOKEN:"ws_stat_settoken",PORTRAIT_GET:"portrait_get_all",PORTRAIT_SET:"portrait_set",GET_LONG_POLL_ID:"getlongpollingid",LONG_POLL:"longpolling",AVCHATROOM_LONG_POLL:"get_msg",ADD_FRIEND:"friend_add",UPDATE_FRIEND:"friend_update",GET_FRIEND_LIST:"friend_get",GET_FRIEND_PROFILE:"friend_get_specified",DELETE_FRIEND:"friend_delete",CHECK_FRIEND:"friend_check",GET_FRIEND_GROUP_LIST:"group_get",RESPOND_FRIEND_APPLICATION:"friend_response",GET_FRIEND_APPLICATION_LIST:"pendency_get",DELETE_FRIEND_APPLICATION:"pendency_delete",REPORT_FRIEND_APPLICATION:"pendency_report",GET_GROUP_APPLICATION:"get_pendency",CREATE_FRIEND_GROUP:"group_add",DELETE_FRIEND_GROUP:"group_delete",UPDATE_FRIEND_GROUP:"group_update",GET_BLACKLIST:"black_list_get",ADD_BLACKLIST:"black_list_add",DELETE_BLACKLIST:"black_list_delete",CREATE_GROUP:"create_group",GET_JOINED_GROUPS:"get_joined_group_list",SET_GROUP_ATTRIBUTES:"set_group_attr",MODIFY_GROUP_ATTRIBUTES:"modify_group_attr",DELETE_GROUP_ATTRIBUTES:"delete_group_attr",CLEAR_GROUP_ATTRIBUTES:"clear_group_attr",GET_GROUP_ATTRIBUTES:"get_group_attr",SEND_MESSAGE:"sendmsg",REVOKE_C2C_MESSAGE:"msgwithdraw",DELETE_C2C_MESSAGE:"delete_c2c_msg_ramble",MODIFY_C2C_MESSAGE:"modify_c2c_msg",MODIFY_C2C_MESSAGE_EXTENSIONS:"set_key_values",GET_C2C_MESSAGE_EXTENSIONS:"get_key_values",SEND_GROUP_MESSAGE:"send_group_msg",REVOKE_GROUP_MESSAGE:"group_msg_recall",DELETE_GROUP_MESSAGE:"delete_group_ramble_msg_by_seq",MODIFY_GROUP_MESSAGE:"modify_group_msg",MODIFY_GROUP_MESSAGE_EXTENSIONS:"group_set_key_values",GET_GROUP_MESSAGE_EXTENSIONS:"group_get_key_values",GET_GROUP_INFO:"get_group_self_member_info",GET_GROUP_MEMBER_INFO:"get_specified_group_member_info",GET_GROUP_MEMBER_LIST:"get_group_member_info",GET_AVCHATROOM_MEMBER_LIST:"get_members",MARK_AVCHATROOM_MEMBER_INFO:"modify_user_info",QUIT_GROUP:"quit_group",CHANGE_GROUP_OWNER:"change_group_owner",DESTROY_GROUP:"destroy_group",ADD_GROUP_MEMBER:"add_group_member",DELETE_GROUP_MEMBER:"delete_group_member",BAN_AVCHATROOM_MEMBER:"ban_group_member",SEARCH_GROUP_BY_ID:"get_group_public_info",APPLY_JOIN_GROUP:"apply_join_group",HANDLE_APPLY_JOIN_GROUP:"handle_apply_join_group",HANDLE_INVITE_JOIN_GROUP:"handle_invite_join_permission_group",HANDLE_GROUP_INVITATION:"handle_invite_join_group",MODIFY_GROUP_INFO:"modify_group_base_info",MODIFY_GROUP_MEMBER_INFO:"modify_group_member_info",DELETE_GROUP_SYSTEM_MESSAGE:"deletemsg",DELETE_GROUP_AT_TIPS:"deletemsg",GET_GROUP_NOTIFY:"get_group_notify",GET_CONVERSATION_LIST:"get",PAGING_GET_CONVERSATION_LIST:"page_get",DELETE_CONVERSATION:"batch_delete",CLEAR_HISTORY_MESSAGE:"clear_msg",PIN_CONVERSATION:"top",SET_CONVERSATION_CUSTOM_DATA:"mark_contact",MARK_CONVERSATION:"mark_contact",CREATE_CONVERSATION_GROUP:"create_contact_group",DELETE_CONVERSATION_GROUP:"del_contact_group",UPDATE_CONVERSATION_GROUP:"update_contact_group",GET_CONVERSATION_GROUP_LIST:"get_contact_group",GET_MESSAGES:"getmsg",GET_C2C_ROAM_MESSAGES:"getroammsg",SET_C2C_PEER_MUTE_NOTIFICATIONS:"set_c2c_peer_mute_notifications",GET_C2C_PEER_MUTE_NOTIFICATIONS:"get_c2c_peer_mute_notifications",GET_GROUP_ROAM_MESSAGES:"group_msg_get",GET_READ_RECEIPT:"get_group_msg_receipt",GET_READ_RECEIPT_DETAIL:"get_group_msg_receipt_detail",SEND_READ_RECEIPT:"group_msg_receipt",SEND_C2C_READ_RECEIPT:"c2c_msg_read_receipt",SET_C2C_MESSAGE_READ:"msgreaded",GET_PEER_READ_TIME:"get_peer_read_time",SET_GROUP_MESSAGE_READ:"msg_read_report",FILE_READ_AND_WRITE_AUTHKEY:"authkey",FILE_UPLOAD:"pic_up",COS_SIGN:"cos",COS_PRE_SIG:"pre_sig",VIDEO_COVER:"video_cover",TIM_WEB_REPORT_V2:"tim_web_report_v2",BIG_DATA_HALLWAY_AUTH_KEY:"authkey",GET_ONLINE_MEMBER_NUM:"get_online_member_num",ALIVE:"alive",MESSAGE_PUSH:"msg_push",MULTI_MESSAGE_PUSH:"multi_msg_push_ws",MESSAGE_PUSH_ACK:"ws_msg_push_ack",STATUS_FORCE_OFFLINE:"stat_forceoffline",DOWNLOAD_MERGER_MESSAGE:"get_relay_json_msg",UPLOAD_MERGER_MESSAGE:"save_relay_json_msg",FETCH_CLOUD_CONTROL_CONFIG:"fetch_config",PUSHED_CLOUD_CONTROL_CONFIG:"push_configv2",FETCH_COMMERCIAL_CONFIG:"fetch_imsdk_purchase_bitsv2",PUSHED_COMMERCIAL_CONFIG:"push_imsdk_purchase_bitsv2",KICK_OTHER:"KickOther",OVERLOAD_NOTIFY:"notify2",SET_ALL_MESSAGE_READ:"read_all_unread_msg",CREATE_TOPIC:"create_topic",DELETE_TOPIC:"destroy_topic",UPDATE_TOPIC_PROFILE:"modify_topic",GET_TOPIC_LIST:"get_topic",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUBSCRIBE_USER_STATUS:"ws_status_subscribe",UNSUBSCRIBE_USER_STATUS:"ws_status_unsubscribe",GET_RPOFANITY_LIST:"get_local_words",TRANSLATE_TEXT:"ws_batch_trans_text",UPDATE_GROUP_COUNTER:"update_group_counter",GET_GROUP_COUNTER:"get_group_counter"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:"v4",group_open_http_svc:"v4",sns:"v4",profile:"v4",recentcontact:"v4",openpic:"v4",group_open_http_noauth_svc:"v4",group_open_long_polling_http_svc:"v4",group_open_long_polling_http_noauth_svc:"v4",imopenstat:"v4",im_cos_sign_svr:"v4",im_cos_msg:"v4",webim:"v4",im_open_push:"v4",im_open_status:"v4"}},B={SEARCH_MSG:new E(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new E(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new E(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new E(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new E(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new E(0,Math.pow(2,6)).toString(),USER_STATUS:new E(0,Math.pow(2,7)).toString(),CONV_MARK:new E(0,Math.pow(2,9)).toString(),CONV_GROUP:new E(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new E(0,Math.pow(2,11)).toString(),MSG_EXT:new E(0,Math.pow(2,13)).toString(),GRP_COUNTER:new E(0,Math.pow(2,15)).toString()},H="c2c_text_message",K="c2c_custom_message",W="group_text_message",j="group_custom_message",Y="user_profile",z="group_profile",J="group_member_profile";V.HOST.setCurrent(G);var X,Q,Z,$,ee="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),te="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),ne="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),oe="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),se="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),ae="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,re="undefined"!=typeof uni&&"undefined"==typeof window,ie="undefined"!=typeof uni,ue=ee||te||ne||oe||se||re||ae,ce=("undefined"!=typeof uni||"undefined"!=typeof window)&&!ue,le=te?qq:ne?tt:oe?swan:se?my:ee?wx:re?uni:ae?jd:{},pe=ce&&window&&window.navigator&&window.navigator.userAgent||"",de=/(micromessenger|webbrowser)/i.test(pe),ge=/AppleWebKit\/([\d.]+)/i.exec(pe),he=(ge&&parseFloat(ge.pop()),X="WEB",de?X="WEB":te?X="QQ_MP":ne?X="TT_MP":oe?X="BAIDU_MP":se?X="ALI_MP":ee?X="WX_MP":re&&(X="UNI_NATIVE_APP"),R[X]),_e=/iPad/i.test(pe),fe=/iPhone/i.test(pe)&&!_e,ve=/iPod/i.test(pe),me=fe||_e||ve,Me=(Q=pe.match(/OS (\d+)_/i))&&Q[1]?Q[1]:null,ye=/Android/i.test(pe),Ie=function(){var e=pe.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Ce=(ye&&/webkit/i.test(pe),/Firefox/i.test(pe),/Edge/i.test(pe)),Te=!Ce&&/Chrome/i.test(pe),De=(function(){var e=pe.match(/Chrome\/(\d+)/);e&&e[1]&&parseFloat(e[1])}(),/MSIE/.test(pe)||pe.indexOf("Trident")>-1&&pe.indexOf("rv:11.0")>-1),ke=(/MSIE\s8\.0/.test(pe),function(){var e=/MSIE\s(\d+)\.\d/.exec(pe),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(pe)&&/rv:11.0/.test(pe)&&(t=11),t}()),Se=(/Safari/i.test(pe),/TBS\/\d+/i.test(pe)),Le=(function(){var e=pe.match(/TBS\/(\d+)/i);if(e&&e[1])e[1]}(),!Se&&/MQQBrowser\/\d+/i.test(pe),!Se&&/ QQBrowser\/\d+/i.test(pe),/Windows/i.test(pe)),Ee=/MAC OS X/i.test(pe),Ae=(/MicroMessenger/i.test(pe),ce&&"undefined"!=typeof Worker&&!De),Re=ye||me,Ne=ce&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy;Z="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Oe=function(){},Ge=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Pe=Ge.length;Pe--;)$=Ge[Pe],console[$]||(Z[$]=Oe);var Ue=Z,be=0,we=function(){return(new Date).getTime()+be},qe=function(){be=0},Fe=function(){return Math.floor(we()/1e3)},xe=0;function Ve(){return zt()?"%c TIM %c":"TIM"}function Be(){var e,t=((e=new Date).setTime(we()),e);return t.toLocaleTimeString("en-US",{hour12:!1})+"."+function(e){var t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}(t.getMilliseconds())}var He={arguments2String:function(e){var t="";if(1===e.length)t=e[0];else for(var n=0,o=e.length;n4294967295?(ht+=4294967295,Date.now()-ht):e},ft=function e(t,n,o,s){if(!ct(t)||!ct(n))return 0;for(var a,r=0,i=Object.keys(n),u=0,c=i.length;u=0?o[a]=t[a]:o[a]=e(t[a])):o[a]=void 0:o[a]=null;return o};function St(e,t){it(e)&&it(t)&&t.forEach((function(t){var n=t.key,o=t.value,s=e.find((function(e){return e.key===n}));s?s.value=o:e.push({key:n,value:o})}))}var Lt=function(e){return e===S.GRP_AVCHATROOM},Et=function(e){var t=e.type,n=e.groupID;return t===S.GRP_COMMUNITY||"".concat(n).startsWith(Qe)&&!"".concat(n).includes(Ze)},At=function(e){return"".concat(e).startsWith(Qe)&&"".concat(e).includes(Ze)},Rt=function(e){return st(e)&&e.slice(0,3)===S.CONV_C2C},Nt=function(e){return st(e)&&e.slice(0,5)===S.CONV_GROUP},Ot=function(e){return st(e)&&e===S.CONV_SYSTEM};function Gt(e,t){var n={};return Object.keys(e).forEach((function(o){n[o]=t(e[o],o)})),n}function Pt(e){return ue?new Promise((function(t,n){le.getImageInfo({src:e,success:function(e){t({width:e.width,height:e.height})},fail:function(){t({width:0,height:0})}})})):De&&9===ke?Promise.resolve({width:0,height:0}):new Promise((function(t,n){var o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e}))}function Ut(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function bt(){var e="unknown";if(Ee&&(e="mac"),Le&&(e="windows"),me&&(e="ios"),ye&&(e="android"),ue)try{var t=le.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(n){}return e}function wt(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengtha)return 1;if(s-1?"".concat(n,"&"):"".concat(n,"?");c.url="".concat(l,198===r?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")}return ut(n)?g(c,$e):c}function Ft(e){var t=e[2];e[2]=e[1],e[1]=t;for(var n=0;n=0;o--)"1"===e[o]&&t.push(Math.pow(2,n-o-1));return t}function zt(){return!De&&!ue}function Jt(e){return"the length of userIDList cannot exceed ".concat(e)}function Xt(e,t){if(e){var n=e;return t&&(e.startsWith("http://")?n=e.replace(/^http:\/\/[^/]+/,t):e.startsWith("https://")&&(n=e.replace(/^https:\/\/[^/]+/,t))),n}}var Qt=Object.prototype.hasOwnProperty;function Zt(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(rt(e)){for(var t in e)if(Qt.call(e,t))return!1;return!0}return!(!et(e)&&(n=e,"set"!==dt(n))&&!nt(e))&&0===e.size;var n}function $t(e,t,n){if(void 0===t)return!0;var o=!0;if(rt(t))Object.keys(t).forEach((function(s){var a=1===e.length?e[0][s]:void 0;o=!!en(a,t[s],n,s)&&o}));else if(it(t))for(var s=0;s256)||(an({api:"setConversationCustomData",param:"customData",desc:vn("customData",256)}),!1):(an({api:"setConversationCustomData",param:"customData",desc:rn()}),!1)}}},markConversation:{conversationIDList:t({},Ln),markType:{type:"number",validator:function(e){return ot(e)?e<=0?(an({api:"markConversation",param:"markType",desc:(t="markType",n=0,Nn("NumberGreaterThanLog",t,n))}),!1):!(e>=Math.pow(2,64))||(an({api:"markConversation",param:"markType",desc:mn("markType","Math.pow(2,64)")}),!1):(an({api:"markConversation",param:"markType",desc:cn()}),!1);var t,n}},enableMark:t({},An)},createConversationGroup:{conversationIDList:t({},Ln),groupName:t(t({},Sn),{},{validator:function(e){return!!e&&(!(e.length>32)||(an({api:"createConversationGroup",param:"groupName",desc:vn("groupName",32)}),!1))}})},deleteConversationGroup:[t({name:"groupName"},Sn)],renameConversationGroup:{oldName:t({},Sn),newName:t(t({},Sn),{},{validator:function(e){return!!e&&(!(e.length>32)||(an({api:"renameConversationGroup",param:"newName",desc:vn("newName",32)}),!1))}})},addConversationsToGroup:{conversationIDList:t({},Ln),groupName:t({},Sn)},deleteConversationsFromGroup:{conversationIDList:t({},Ln),groupName:t({},Sn)},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:Sn,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Ln},createGroup:{name:Sn},joinGroup:{groupID:Sn,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[t({name:"groupID"},Sn)],handleApplication:{message:En,handleAction:Sn,handleMessage:{type:"String"}},changeGroupOwner:{groupID:Sn,newOwnerID:Sn},updateGroupProfile:{groupID:Sn,muteAllMembers:{type:"Boolean"}},dismissGroup:[t({name:"groupID"},Sn)],searchGroupByID:[t({name:"groupID"},Sn)],initGroupAttributes:{groupID:Sn,groupAttributes:t(t({},En),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!st(e[n]))return an({api:"initGroupAttributes",param:"groupAttributes",desc:Mn("value")}),t=!1})),t}})},setGroupAttributes:{groupID:Sn,groupAttributes:t(t({},En),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!st(e[n]))return an({api:"setGroupAttributes",param:"groupAttributes",desc:Mn("value")}),t=!1})),t}})},deleteGroupAttributes:{groupID:Sn,keyList:{type:"Array",validator:function(e){if(ut(e)||!it(e))return an({api:"deleteGroupAttributes",param:"keyList",desc:gn()}),!1;if(!Zt(e)){var t=!0;return e.forEach((function(e){if(!st(e))return an({api:"deleteGroupAttributes",param:"keyList",desc:Nn("StringArrayRequiredLog")}),t=!1})),t}return!0}}},getGroupAttributes:{groupID:Sn,keyList:{type:"Array",validator:function(e){if(ut(e)||!it(e))return an({api:"getGroupAttributes",param:"keyList",desc:gn()}),!1;if(!Zt(e)){var t=!0;return e.forEach((function(e){if(!st(e))return an({api:"getGroupAttributes",param:"keyList",desc:Mn("key")}),t=!1})),t}return!0}}},setGroupCounters:{groupID:Sn,counters:En},increaseGroupCounter:{groupID:Sn,key:Sn,value:Rn},decreaseGroupCounter:{groupID:Sn,key:Sn,value:Rn},getGroupCounters:{groupID:Sn},getGroupMemberList:{groupID:Sn,count:{type:"Number"}},getGroupMemberProfile:{groupID:Sn,userIDList:Ln,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:Sn,userIDList:Ln},setGroupMemberRole:{groupID:Sn,userID:Sn,role:Sn},setGroupMemberMuteTime:{groupID:Sn,userID:Sn,muteTime:{type:"Number",validator:function(e){return e>=0}}},setGroupMemberNameCard:{groupID:Sn,userID:{type:"String"},nameCard:{type:"String",validator:function(e){return st(e)?(e.length,!0):(an({api:"setGroupMemberNameCard",param:"nameCard",desc:rn()}),!1)}}},setGroupMemberCustomField:{groupID:Sn,userID:{type:"String"},memberCustomField:Ln},deleteGroupMember:{groupID:Sn},markGroupMemberList:{groupID:Sn,markType:{type:"number",validator:function(e){return ot(e)?!(e<1e3)||(an({api:"markGroupMemberList",param:"markType",desc:(t="markType",n=1e3,Nn("NumberGreaterOrEqualLog",t,n))}),!1):(an({api:"markGroupMemberList",param:"markType",desc:cn()}),!1);var t,n}},userIDList:t({},Ln),enableMark:t({},An)},createTextMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){return rt(e)?st(e.text)?0!==e.text.length||(an({api:"createTextMessage",param:"payload.text",desc:In()}),!1):(an({api:"createTextMessage",param:"payload.text",desc:rn()}),!1):(an({api:"createTextMessage",param:"payload",desc:yn()}),!1)}})},createTextAtMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){return rt(e)?st(e.text)?0===e.text.length?(an({api:"createTextAtMessage",param:"payload.text",desc:In()}),!1):!(e.atUserList&&!it(e.atUserList))||(an({api:"createTextAtMessage",param:"payload.atUserList",desc:gn()}),!1):(an({api:"createTextAtMessage",param:"payload.text",desc:rn()}),!1):(an({api:"createTextAtMessage",param:"payload",desc:yn()}),!1)}})},createCustomMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){return rt(e)?e.data&&!st(e.data)?(an({api:"createCustomMessage",param:"payload.data",desc:rn()}),!1):e.description&&!st(e.description)?(an({api:"createCustomMessage",param:"payload.description",desc:rn()}),!1):!(e.extension&&!st(e.extension))||(an({api:"createCustomMessage",param:"payload.extension",desc:rn()}),!1):(an({api:"createCustomMessage",param:"payload",desc:yn()}),!1)}})},createImageMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){if(!rt(e))return an({api:"createImageMessage",param:"payload",desc:yn()}),!1;if(ut(e.file))return an({api:"createImageMessage",param:"payload.file",desc:ln()}),!1;if(ce){if(!(e.file instanceof HTMLInputElement||nt(e.file)))return rt(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(an({api:"createImageMessage",param:"payload.file",desc:Cn()}),!1):(an({api:"createImageMessage",param:"payload.file",desc:pn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return an({api:"createImageMessage",param:"payload.file",desc:Cn()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:function(e){return ut(e)&&an({api:"createImageMessage",param:"onProgress",desc:_n()}),!0}}})},createAudioMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){return!!rt(e)||(an({api:"createAudioMessage",param:"payload",desc:yn()}),!1)}}),onProgress:{type:"Function",required:!1,validator:function(e){return ut(e)&&an({api:"createAudioMessage",param:"onProgress",desc:_n()}),!0}}},createVideoMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){if(!rt(e))return an({api:"createVideoMessage",param:"payload",desc:yn()}),!1;if(ut(e.file))return an({api:"createVideoMessage",param:"payload.file",desc:ln()}),!1;if(ce){if(!(e.file instanceof HTMLInputElement||nt(e.file)))return rt(e.file)&&"undefined"!=typeof uni?!!nt(e.file.tempFile)||(an({api:"createVideoMessage",param:"payload.file",desc:Cn()}),!1):(an({api:"createVideoMessage",param:"payload.file",desc:pn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return an({api:"createVideoMessage",param:"payload.file",desc:Cn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e){return ut(e)&&an({api:"createVideoMessage",param:"onProgress",desc:_n()}),!0}}},createFaceMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){return rt(e)?ot(e.index)?!!st(e.data)||(an({api:"createFaceMessage",param:"payload.data",desc:rn()}),!1):(an({api:"createFaceMessage",param:"payload.index",desc:cn()}),!1):(an({api:"createFaceMessage",param:"payload",desc:yn()}),!1)}})},createFileMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){if(!rt(e))return an({api:"createFileMessage",param:"payload",desc:yn()}),!1;if(ut(e.file))return an({api:"createFileMessage",param:"payload.file",desc:ln()}),!1;if(ce){if(!(e.file instanceof HTMLInputElement||nt(e.file)))return rt(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(an({api:"createFileMessage",param:"payload.file",desc:Cn()}),!1):(an({api:"createFileMessage",param:"payload.file",desc:pn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return an({api:"createFileMessage",param:"payload.file",desc:Cn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e){return ut(e)&&an({api:"createFileMessage",param:"onProgress",desc:_n()}),!0}}},createLocationMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){return rt(e)?st(e.description)?ot(e.longitude)?!!ot(e.latitude)||(an({api:"createLocationMessage",param:"payload.latitude",desc:cn()}),!1):(an({api:"createLocationMessage",param:"payload.longitude",desc:cn()}),!1):(an({api:"createLocationMessage",param:"payload.description",desc:rn()}),!1):(an({api:"createLocationMessage",param:"payload",desc:yn()}),!1)}})},createMergerMessage:{to:Sn,conversationType:Sn,payload:t(t({},En),{},{validator:function(e){if(Zt(e.messageList))return an({api:"createMergerMessage",param:"payload.messageList",desc:hn()}),!1;if(Zt(e.compatibleText))return an({api:"createMergerMessage",param:"payload.compatibleText",desc:un("compatibleText")}),!1;var t=!1;return e.messageList.forEach((function(e){e.status===nn.FAIL&&(t=!0)})),!t||(an({api:"createMergerMessage",param:"payload.messageList",desc:Nn("MergeFailedMessageLog")}),!1)}})},revokeMessage:[t(t({name:"message"},En),{},{validator:function(e){return Zt(e)?(an({api:"revokeMessage",param:"message",desc:Tn()}),!1):e.conversationType===S.CONV_SYSTEM?(an({api:"revokeMessage",param:"message",desc:Nn("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(an({api:"revokeMessage",param:"message",desc:Nn("MessageRevokedLog")}),!1)}})],deleteMessage:[t(t({name:"messageList"},Ln),{},{validator:function(e){return!Zt(e)||(an({api:"deleteMessage",param:"messageList",desc:hn()}),!1)}})],translateText:{sourceTextList:Ln,sourceLanguage:Sn,targetLanguage:Sn},modifyMessage:[t(t({name:"message"},En),{},{validator:function(e){return Zt(e)?(an({api:"modifyMessage",param:"message",desc:Tn()}),!1):e.conversationType===S.CONV_SYSTEM?(an({api:"modifyMessage",param:"message",desc:Nn("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(an({api:"modifyMessage",param:"message",desc:Nn("OnlineMessageNotSupportLog")}),!1)}})],getUserProfile:{userIDList:{type:"Array",validator:function(e){return it(e)?(0===e.length&&an({api:"getUserProfile",param:"userIDList",desc:hn()}),!0):(an({api:"getUserProfile",param:"userIDList",desc:gn()}),!1)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(e){return!!ut(e)||(!!it(e)||(an({api:"updateMyProfile",param:"profileCustomField",desc:gn()}),!1))}}},setSelfStatus:{customStatus:{type:"String",validator:function(e){return!!st(e)||(an({api:"setSelfStatus",param:"customStatus",desc:rn()}),!1)}}},getUserStatus:{userIDList:{type:"Array",validator:function(e){return it(e)?0!==e.length||(an({api:"getUserStatus",param:"userIDList",desc:hn()}),!1):(an({api:"getUserStatus",param:"userIDList",desc:gn()}),!1)}}},subscribeUserStatus:{userIDList:{type:"Array",validator:function(e){return it(e)?0!==e.length||(an({api:"subscribeUserStatus",param:"userIDList",desc:hn()}),!1):(an({api:"subscribeUserStatus",param:"userIDList",desc:gn()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(e){return!e||(!!it(e)||(an({api:"subscribeUserStatus",param:"userIDList",desc:gn()}),!1))}}},addFriend:{to:Sn,source:{type:"String",required:!0,validator:function(e){return!!e&&(e.startsWith("AddSource_Type_")?!(e.replace("AddSource_Type_","").length>8)||(an({api:"addFriend",param:"source",desc:vn("keyword",8)}),!1):(an({api:"addFriend",param:"source",desc:Nn("SourcePrefixLog")}),!1))}},remark:{type:"String",required:!1,validator:function(e){return!(st(e)&&e.length>96)||(an({api:"addFriend",param:"remark",desc:vn("remark",96)}),!1)}}},deleteFriend:{userIDList:Ln},checkFriend:{userIDList:Ln},getFriendProfile:{userIDList:Ln},updateFriend:{userID:Sn,remark:{type:"String",required:!1,validator:function(e){return!(st(e)&&e.length>96)||(an({api:"updateFriend",param:"remark",desc:vn("remark",96)}),!1)}},friendCustomField:{type:"Array",required:!1,validator:function(e){if(e){if(!it(e))return an({api:"updateFriend",param:"friendCustomField",desc:gn()}),!1;var t=!0;return e.forEach((function(e){return st(e.key)&&-1!==e.key.indexOf("Tag_SNS_Custom")?st(e.value)?e.key.replace("Tag_SNS_Custom_","").length>8?(an({api:"updateFriend",param:"friendCustomField",desc:vn("keyword",8)}),t=!1):void 0:(an({api:"updateFriend",param:"friendCustomField",desc:Mn("value")}),t=!1):(an({api:"updateFriend",param:"friendCustomField",desc:Nn("FriendCustomFieldPrefixLog")}),t=!1)})),t}return!0}}},acceptFriendApplication:{userID:Sn},refuseFriendApplication:{userID:Sn},deleteFriendApplication:{userID:Sn},createFriendGroup:{name:Sn},deleteFriendGroup:{name:Sn},addToFriendGroup:{name:Sn,userIDList:Ln},removeFromFriendGroup:{name:Sn,userIDList:Ln},renameFriendGroup:{oldName:Sn,newName:Sn},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:function(e){return it(e)?0!==e.length||(an({api:"sendMessageReadReceipt",param:"messageList",desc:hn()}),!1):(an({api:"sendMessageReadReceipt",param:"messageList",desc:gn()}),!1)}}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:function(e){return it(e)?0!==e.length||(an({api:"getMessageReadReceiptList",param:"messageList",desc:hn()}),!1):(an({api:"getMessageReadReceiptList",param:"messageList",desc:gn()}),!1)}}],createTopicInCommunity:{groupID:Sn,topicName:Sn},deleteTopicFromCommunity:{groupID:Sn,topicIDList:{type:"Array",validator:function(e){return!e||(!!it(e)||(an({api:"deleteTopicFromCommunity",param:"topicIDList",desc:gn()}),!1))}}},updateTopicProfile:{groupID:Sn,topicID:Sn},getTopicList:{groupID:Sn,topicIDList:{type:"Array",validator:function(e){return!e||(!!it(e)||(an({api:"getTopicList",param:"topicIDList",desc:gn()}),!1))}}}},Gn={login:1,logout:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,modifyMessage:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,setMessageRemindType:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,callExperimentalAPI:1},Pn=1,Un=2,bn=3,wn=4,qn=6,Fn=7,xn=8,Vn=9,Bn=10,Hn=11,Kn=12,Wn=13,jn=14,Yn=15,zn=16,Jn=17,Xn=18,Qn=19,Zn=20,$n=21,eo=22,to=23,no=24,oo=25,so=26,ao=27,ro=28,io=29,uo=30,co=31,lo=32,po=function(){function e(t){o(this,e),this._m=t,this._n=""}return a(e,[{key:"isLoggedIn",value:function(){return this._m.getModule(Kn).isLoggedIn()}},{key:"isOversea",value:function(){return this._m.getModule(Kn).isOversea()}},{key:"isPrivateNetWork",value:function(){return this._m.getModule(Kn).isPrivateNetWork()}},{key:"getFileDownloadProxy",value:function(){return this._m.getModule(Kn).getFileDownloadProxy()}},{key:"getMyUserID",value:function(){return this._m.getModule(Kn).getUserID()}},{key:"getMyTinyID",value:function(){return this._m.getModule(Kn).getTinyID()}},{key:"getSDKAppID",value:function(){return this._m.getModule(Kn).getSDKAppID()}},{key:"isIntl",value:function(){return this._m.getModule(Kn).isIntl()}},{key:"isDevMode",value:function(){return this._m.getModule(Kn).isDevMode()}},{key:"getModule",value:function(e){return this._m.getModule(e)}},{key:"getPlatform",value:function(){return he}},{key:"getNetworkType",value:function(){return this._m.getModule(Yn).getNetworkType()}},{key:"probeNetwork",value:function(e){return this._m.getModule(Yn).probe(e)}},{key:"getCloudConfig",value:function(e){return this._m.getModule(to).getCloudConfig(e)}},{key:"emitOuterEvent",value:function(e,t){this._m.getOuterEmitterInstance().emit(e,t)}},{key:"emitInnerEvent",value:function(e,t){this._m.getInnerEmitterInstance().emit(e,t)}},{key:"getInnerEmitterInstance",value:function(){return this._m.getInnerEmitterInstance()}},{key:"generateTjgID",value:function(e){return this._m.getModule(Kn).getTinyID()+"-"+e.random}},{key:"filterModifiedMessage",value:function(e){if(!Zt(e)){var t=e.filter((function(e){return!0===e.isModified}));t.length>0&&this.emitOuterEvent(k.MESSAGE_MODIFIED,t)}}},{key:"filterUnmodifiedMessage",value:function(e){return Zt(e)?[]:e.filter((function(e){return!1===e.isModified}))}},{key:"request",value:function(e){return this._m.getModule(Zn).request(e)}},{key:"canIUse",value:function(e){return this._m.getModule(ao).canIUse(e)}},{key:"getErrorMessage",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:"outputWarning",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&He.w(o)}}]),e}(),go="wslogin",ho="wslogout",_o="wshello",fo="KickOther",vo="getmsg",mo="authkey",Mo="sendmsg",yo="send_group_msg",Io="portrait_get_all",Co="portrait_set",To="black_list_get",Do="black_list_add",ko="black_list_delete",So="msgwithdraw",Lo="msgreaded",Eo="set_c2c_peer_mute_notifications",Ao="get_c2c_peer_mute_notifications",Ro="getroammsg",No="get_peer_read_time",Oo="delete_c2c_msg_ramble",Go="modify_c2c_msg",Po="set_key_values",Uo="get_key_values",bo="page_get",wo="get",qo="batch_delete",Fo="clear_msg",xo="top",Vo="deletemsg",Bo="set_conv_custom_data",Ho="mark_contact",Ko="create_contact_group",Wo="del_contact_group",jo="update_contact_group",Yo="add_conv_to_group",zo="del_conv_from_group",Jo="get_contact_group",Xo="get_joined_group_list",Qo="get_group_self_member_info",Zo="create_group",$o="destroy_group",es="modify_group_base_info",ts="apply_join_group",ns="apply_join_group_noauth",os="quit_group",ss="get_group_public_info",as="change_group_owner",rs="handle_apply_join_group",is="handle_invite_join_permission_group",us="handle_invite_join_group",cs="group_msg_recall",ls="msg_read_report",ps="read_all_unread_msg",ds="group_msg_get",gs="get_group_msg_receipt",hs="group_msg_receipt",_s="c2c_msg_read_receipt",fs="get_group_msg_receipt_detail",vs="get_pendency",ms="deletemsg",Ms="get_msg",ys="get_msg_noauth",Is="get_online_member_num",Cs="delete_group_ramble_msg_by_seq",Ts="modify_group_msg",Ds="set_group_attr",ks="modify_group_attr",Ss="delete_group_attr",Ls="clear_group_attr",Es="get_group_attr",As="group_set_key_values",Rs="group_get_key_values",Ns="get_group_notify",Os="update_group_counter",Gs="get_group_counter",Ps="get_group_member_info",Us="get_members",bs="get_specified_group_member_info",ws="add_group_member",qs="delete_group_member",Fs="ban_group_member",xs="modify_group_member_info",Vs="modify_user_info",Bs="cos",Hs="pre_sig",Ks="video_cover",Ws="tim_web_report_v2",js="alive",Ys="msg_push",zs="multi_msg_push_ws",Js="ws_msg_push_ack",Xs="stat_forceoffline",Qs="save_relay_json_msg",Zs="get_relay_json_msg",$s="fetch_config",ea="push_configv2",ta="fetch_imsdk_purchase_bitsv2",na="push_imsdk_purchase_bitsv2",oa="notify2",sa="create_topic",aa="destroy_topic",ra="modify_topic",ia="get_topic",ua="ws_set_custom_status",ca="ws_get_user_status",la="ws_status_subscribe",pa="ws_status_unsubscribe",da="ws_stat_background",ga="ws_stat_foreground",ha="ws_stat_settoken",_a="get_local_words",fa="ws_batch_trans_text",va=2e3,ma=2002,Ma=2003,ya=2022,Ia=2023,Ca=2024,Ta=2025,Da=2040,ka=2041,Sa=2100,La=2101,Ea=2105,Aa=2106,Ra=2108,Na=2109,Oa=2110,Ga=2111,Pa=2112,Ua=2114,ba=2115,wa=2116,qa=2117,Fa=2251,xa=2252,Va=2253,Ba=2300,Ha=2301,Ka=2350,Wa=2351,ja=2352,Ya=2400,za=2401,Ja=2402,Xa=2403,Qa=2450,Za=2451,$a=2452,er=2453,tr=2480,nr=2481,or=2500,sr=2501,ar=2502,rr=2503,ir=2600,ur=2601,cr=2602,lr=2603,pr=2620,dr=2621,gr=2622,hr=2623,_r=2660,fr=2661,vr=2662,mr=2681,Mr=2682,yr=2683,Ir=2684,Cr=2685,Tr=2686,Dr=2721,kr=2722,Sr=2742,Lr=2800,Er=2801,Ar=2805,Rr=2903,Nr=2905,Or=2996,Gr=2997,Pr=2998,Ur=2999,br=3e3,wr=3001,qr=3002,Fr=3003,xr=3004,Vr=3005,Br=3006,Hr=3021,Kr=3122,Wr=3123,jr=20002,Yr=70001,zr=1002,Jr=60022,Xr="networkRTT",Qr="messageE2EDelay",Zr="sendMessageC2C",$r="sendMessageGroup",ei="sendMessageGroupAV",ti="sendMessageRichMedia",ni="cosUpload",oi="messageReceivedGroup",si="messageReceivedGroupAVPush",ai="messageReceivedGroupAVPull",ri=(r(tn={},Xr,2),r(tn,Qr,3),r(tn,Zr,4),r(tn,$r,5),r(tn,ei,6),r(tn,ti,7),r(tn,oi,8),r(tn,si,9),r(tn,ai,10),r(tn,ni,11),tn),ii={info:4,warning:5,error:6},ui={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},ci={login:4},li=function(){function e(t){o(this,e),this._n="SSOLogData",this.eventType=ci[t]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=t,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=we()}return a(e,[{key:"updateTimeStamp",value:function(){this.timestamp=we()}},{key:"start",value:function(e){return this._startts=e,this}},{key:"end",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._sentFlag){var n=we();0===this.costTime&&(this.costTime=n-this._startts),this.setMoreMessage("startts:".concat(this._startts," endts:").concat(n)),t?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){e._sentFlag=!0,e._eventStatModule&&e._eventStatModule.pushIn(e)}),0)}}},{key:"setError",value:function(e,t,n){if(!(e instanceof Error))return He.w("".concat(this._n,".setError value not instanceof Error, please check!")),this;if(this._sentFlag)return this;if(this.setNetworkType(n),t)e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message);else{var o=Ar;this.setCode(o)}return this.setLevel("error"),this}},{key:"setCode",value:function(e){return ut(e)||this._sentFlag||("ECONNABORTED"===e&&(this.code=103),ot(e)?this.code=e:He.w("".concat(this._n,".setCode value not a number, please check!"),e,n(e))),this}},{key:"setMessage",value:function(e){return ut(e)||this._sentFlag||(ot(e)&&(this.message=e.toString()),st(e)&&(this.message=e)),this}},{key:"setCostTime",value:function(e){return this.costTime=e,this}},{key:"setLevel",value:function(e){return ut(e)||this._sentFlag||(this.level=ii[e]),this}},{key:"setMoreMessage",value:function(e){return Zt(this.moreMessage)?this.moreMessage="".concat(e):this.moreMessage+=" ".concat(e),this}},{key:"setNetworkType",value:function(e){if(ut(e))He.w("".concat(this._n,".setNetworkType value is undefined, please check!"));else{var t=ui[e.toLowerCase()];ut(t)||(this.networkType=t)}return this}},{key:"getStartTs",value:function(){return this._startts}},{key:"setUIPlatform",value:function(e){this.uiPlatform=e}}],[{key:"bindEventStatModule",value:function(t){e.prototype._eventStatModule=t}}]),e}(),pi=function(){function e(t){o(this,e),this.type=S.MSG_TEXT,this.content={text:t.text||""}}return a(e,[{key:"setText",value:function(e){this.content.text=e}},{key:"sendable",value:function(){return 0!==this.content.text.length}}]),e}(),di=function(){function e(t,n){o(this,e),this._imageMemoryURL="",this._fileDownloadProxy=n,ue?this.createImageDataASURLInWXMiniApp(t.file):this.createImageDataASURLInWeb(t.file),this._initImageInfoModel(),this.type=S.MSG_IMAGE,this._percent=0,this.content={imageFormat:t.imageFormat||Ke.UNKNOWN,uuid:t.uuid,imageInfoArray:[]},this.initImageInfoArray(t.imageInfoArray),this._autoFixUrl()}return a(e,[{key:"_initImageInfoModel",value:function(){var e=this;this._ImageInfoModel=function(t){this.instanceID=Mt(9999999),this.sizeType=t.type||0,this.type=0,this.size=t.size||0,this.width=t.width||0,this.height=t.height||0,this.imageUrl=t.url||"",this.url=Xt(t.url||e._imageMemoryURL,e._fileDownloadProxy)},this._ImageInfoModel.prototype={setSizeType:function(e){this.sizeType=e},setType:function(e){this.type=e},setImageUrl:function(e){e&&(this.imageUrl=e)},getImageUrl:function(){return this.imageUrl}}}},{key:"initImageInfoArray",value:function(e){for(var t=0,n=null,o=null;t<=2;)o=ut(e)||ut(e[t])?{type:0,size:0,width:0,height:0,url:""}:e[t],(n=new this._ImageInfoModel(o)).setSizeType(t+1),n.setType(t),this.addImageInfo(n),t++;this.updateAccessSideImageInfoArray()}},{key:"updateImageInfoArray",value:function(e){for(var t,n=this.content.imageInfoArray.length,o=0;o1&&(this._percent=1)}},{key:"updateImageFormat",value:function(e){this.content.imageFormat=Ke[e.toUpperCase()]||Ke.UNKNOWN}},{key:"createImageDataASURLInWeb",value:function(e){void 0!==e&&e.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:"createImageDataASURLInWXMiniApp",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:"replaceImageInfo",value:function(e,t){this.content.imageInfoArray[t]instanceof this._ImageInfoModel||(this.content.imageInfoArray[t]=e)}},{key:"addImageInfo",value:function(e){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(e)}},{key:"updateAccessSideImageInfoArray",value:function(){var e=this.content.imageInfoArray,t=e[0],n=t.width,o=void 0===n?0:n,s=t.height,a=void 0===s?0:s;0!==o&&0!==a&&(Ft(e),Object.assign(e[2],qt({originWidth:o,originHeight:a,min:720})))}},{key:"sendable",value:function(){return 0!==this.content.imageInfoArray.length&&(""!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size)}}]),e}(),gi=function(){function e(t){o(this,e),this.type=S.MSG_FACE,this.content=t||null}return a(e,[{key:"sendable",value:function(){return null!==this.content}}]),e}(),hi=function(){function e(t,n){o(this,e),this.type=S.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:t.second,size:t.size,url:Xt(t.url,n),remoteAudioUrl:t.url||"",uuid:t.uuid}}return a(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateAudioUrl",value:function(e){this.content.remoteAudioUrl=e}},{key:"sendable",value:function(){return""!==this.content.remoteAudioUrl}}]),e}(),_i={from:!0,groupID:!0,groupName:!0,to:!0},fi=function(){function e(t){o(this,e),this.type=S.MSG_GRP_TIP,this.content={},this._initContent(t)}return a(e,[{key:"_initContent",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"remarkInfo":break;case"groupProfile":t.content.groupProfile={},t._initGroupProfile(e[n]);break;case"operatorInfo":break;case"memberInfoList":case"msgMemberInfo":t._updateMemberList(e[n]);break;case"memberExtraInfo":case"onlineMemberInfo":break;case"memberNum":t.content[n]=e[n],t.content.memberCount=e[n];break;case"newGroupProfile":t.content.newGroupProfile={},t._initNewGroupProfile(e[n]);break;default:t.content[n]=e[n]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:"_initGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n1&&(this._percent=1)}},{key:"updateFileUrl",value:function(e){this.content.fileUrl=e}},{key:"sendable",value:function(){return""!==this.content.fileUrl&&(""!==this.content.fileName&&0!==this.content.fileSize)}}]),e}(),yi=function(){function e(t){o(this,e),this.type=S.MSG_CUSTOM,this.content={data:t.data||"",description:t.description||"",extension:t.extension||""}}return a(e,[{key:"setData",value:function(e){return this.content.data=e,this}},{key:"setDescription",value:function(e){return this.content.description=e,this}},{key:"setExtension",value:function(e){return this.content.extension=e,this}},{key:"sendable",value:function(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),e}(),Ii=function(){function e(t,n){o(this,e),this.type=S.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:t.remoteVideoUrl||t.videoUrl||"",videoFormat:t.videoFormat,videoSecond:parseInt(t.videoSecond,10),videoSize:t.videoSize,videoUrl:Xt(t.videoUrl,n),videoDownloadFlag:2,videoUUID:t.videoUUID,thumbUUID:t.thumbUUID,thumbFormat:t.thumbFormat,thumbWidth:t.thumbWidth,snapshotWidth:t.thumbWidth,thumbHeight:t.thumbHeight,snapshotHeight:t.thumbHeight,thumbSize:t.thumbSize,snapshotSize:t.thumbSize,thumbDownloadFlag:2,thumbUrl:Xt(t.thumbUrl,n),snapshotUrl:Xt(t.thumbUrl,n)}}return a(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateVideoUrl",value:function(e){e&&(this.content.remoteVideoUrl=e)}},{key:"updateSnapshotInfo",value:function(e){var t=e.snapshotUrl,n=e.snapshotWidth,o=e.snapshotHeight;Zt(t)||(this.content.thumbUrl=this.content.snapshotUrl=t),Zt(n)||(this.content.thumbWidth=this.content.snapshotWidth=Number(n)),Zt(o)||(this.content.thumbHeight=this.content.snapshotHeight=Number(o))}},{key:"sendable",value:function(){return""!==this.content.remoteVideoUrl}}]),e}(),Ci=function(){function e(t){o(this,e),this.type=S.MSG_LOCATION;var n=t.description,s=t.longitude,a=t.latitude;this.content={description:n,longitude:s,latitude:a}}return a(e,[{key:"sendable",value:function(){return!0}}]),e}(),Ti=function(){function e(t,n){if(o(this,e),this.from=t.from,this.messageSender=t.from,this.time=t.time,this.messageSequence=t.sequence,this.clientSequence=t.clientSequence||t.sequence,this.messageRandom=t.random,this.cloudCustomData=t.cloudCustomData||"",this.clientTime=t.clientTime||void 0,t.ID)this.ID=t.ID||"",this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[{type:t.type,payload:t.payload}],t.conversationType.startsWith(S.CONV_C2C)?this.receiverUserID=t.to:t.conversationType.startsWith(S.CONV_GROUP)&&(this.receiverGroupID=t.to),this.messageReceiver=t.to;else{this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[];var s=t.elements[0].type,a=t.elements[0].content;this._patchRichMediaPayload(s,a),this._updateRichMediaDownloadUrl(s,a,n),s===S.MSG_MERGER?this.messageBody.push({type:s,payload:new Di(a).content}):this.messageBody.push({type:s,payload:a}),t.groupID&&(this.receiverGroupID=t.groupID,this.messageReceiver=t.groupID),t.to&&(this.receiverUserID=t.to,this.messageReceiver=t.to),this.ID="".concat(t.tinyID,"-").concat(t.clientTime,"-").concat(t.random)}}return a(e,[{key:"_patchRichMediaPayload",value:function(e,t){e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){!e.imageUrl&&e.url&&(e.imageUrl=e.url,e.sizeType=e.type,1===e.type?e.type=0:3===e.type&&(e.type=1))})):e===S.MSG_VIDEO?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===S.MSG_AUDIO?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===S.MSG_FILE&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}},{key:"_updateRichMediaDownloadUrl",value:function(e,t,n){n&&(e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){e.url=Xt(e.url,n)})):e===S.MSG_VIDEO?(t.videoUrl=Xt(t.videoUrl,n),t.snapshotUrl=Xt(t.thumbUrl,n),t.snapshotHeight=t.thumbHeight,t.snapshotWidth=t.thumbWidth):e===S.MSG_AUDIO?t.url=Xt(t.url,n):e===S.MSG_FILE&&(t.fileUrl=Xt(t.fileUrl,n)))}}]),e}(),Di=function(){function e(t,n){if(o(this,e),this.type=S.MSG_MERGER,this.content={downloadKey:"",pbDownloadKey:"",messageList:[],title:"",abstractList:[],compatibleText:"",version:0,layersOverLimit:!1},t.downloadKey){var s=t.downloadKey,a=t.pbDownloadKey,r=t.title,i=t.abstractList,u=t.compatibleText,c=t.version;this.content.downloadKey=s,this.content.pbDownloadKey=a,this.content.title=r,this.content.abstractList=i,this.content.compatibleText=u,this.content.version=c||0}else if(Zt(t.messageList))1===t.layersOverLimit&&(this.content.layersOverLimit=!0);else{var l=t.messageList,p=t.title,d=t.abstractList,g=t.compatibleText,h=t.version,_=[];l.forEach((function(e){if(!Zt(e)){var t=new Ti(e,n);_.push(t)}})),this.content.messageList=_,this.content.title=p,this.content.abstractList=d,this.content.compatibleText=g,this.content.version=h||0}}return a(e,[{key:"sendable",value:function(){return!Zt(this.content.messageList)||!Zt(this.content.downloadKey)}}]),e}(),ki={1:S.MSG_PRIORITY_HIGH,2:S.MSG_PRIORITY_NORMAL,3:S.MSG_PRIORITY_LOW,4:S.MSG_PRIORITY_LOWEST},Si=function(){function e(t){o(this,e),this.ID="",this.conversationID=t.conversationID||null,this.conversationType=t.conversationType||S.CONV_C2C,this.conversationSubType=t.conversationSubType,this.time=t.time||Math.ceil(Date.now()/1e3),this.sequence=t.sequence||0,this.clientSequence=t.clientSequence||t.sequence||0,this.random=t.random||0===t.random?t.random:Mt(),this.priority=this._computePriority(t.priority),this.nick=t.nick||"",this.avatar=t.avatar||"",this.isPeerRead=!1,this.nameCard="",this._elements=[],this.isPlaceMessage=t.isPlaceMessage||0,this.isRevoked=2===t.isPlaceMessage||8===t.msgFlagBits,this.from=t.from||null,this.to=t.to||null,this.flow="",this.isSystemMessage=t.isSystemMessage||!1,this.protocol=t.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=t.status||nn.SUCCESS,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=t.cloudCustomData||"",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromUnreadCount),this._isExcludedFromLastMessage=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromLastMessage),this.clientTime=t.clientTime||Fe()||0,this.senderTinyID=t.senderTinyID||t.tinyID||"",this.readReceiptInfo=t.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0},this.needReadReceipt=!0===t.needReadReceipt||1===t.needReadReceipt,this.version=t.messageVersion||0,this.isBroadcastMessage=t.isBroadcastMessage||!1,this._receiverList=t.receiverList||void 0,this.isSupportExtension=!0===t.isSupportExtension||1===t.isSupportExtension,this.revoker=t.revokerInfo&&t.revokerInfo.revoker||null,this.reInitialize(t.currentUser),this.extractGroupInfo(t.groupProfile||null),this.handleGroupAtInfo(t),this.initC2CReadReceiptInfo(t.readReceiptSentByPeer)}return a(e,[{key:"elements",get:function(){return this._elements}},{key:"getElements",value:function(){return this._elements}},{key:"extractGroupInfo",value:function(e){if(null!==e){st(e.nick)&&(this.nick=e.nick),st(e.avatar)&&(this.avatar=e.avatar);var t=e.messageFromAccountExtraInformation;rt(t)&&st(t.nameCard)&&(this.nameCard=t.nameCard)}}},{key:"handleGroupAtInfo",value:function(e){var t=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach((function(e){e!==S.MSG_AT_ALL?(t._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),t.atUserList.push(e)):(t._groupAtInfoList.push({groupAtAllFlag:1}),t.atUserList.push(S.MSG_AT_ALL))})),it(e.groupAtInfo)&&e.groupAtInfo.forEach((function(e){0===e.groupAtAllFlag?t.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&t.atUserList.push(S.MSG_AT_ALL)}))}},{key:"getGroupAtInfoList",value:function(){return this._groupAtInfoList}},{key:"_initProxy",value:function(){this._elements[0]&&(this.payload=this._elements[0].content,this.type=this._elements[0].type)}},{key:"reInitialize",value:function(e){e&&(this.status=this.from?nn.SUCCESS:nn.UNSEND,!this.from&&(this.from=e)),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:"isSendable",value:function(){return 0!==this._elements.length&&("function"==typeof this._elements[0].sendable&&this._elements[0].sendable())}},{key:"_initTo",value:function(e){this.conversationType===S.CONV_GROUP&&(this.to=e.groupID)}},{key:"_initSequence",value:function(e){0===this.clientSequence&&e&&(this.clientSequence=function(e){if(!e)return!1;if(void 0===Tt[e]){var t=new Date,n="3".concat(t.getHours()).slice(-2),o="0".concat(t.getMinutes()).slice(-2),s="0".concat(t.getSeconds()).slice(-2);Tt[e]=parseInt([n,o,s,"0001"].join("")),n=null,o=null,s=null,He.l("autoIncrementIndex start index:".concat(Tt[e]))}return Tt[e]++}(e)),0===this.sequence&&this.conversationType===S.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:"generateMessageID",value:function(){this.from===S.CONV_SYSTEM&&(this.senderTinyID="144115198244471703"),this.ID="".concat(this.senderTinyID,"-").concat(this.clientTime,"-").concat(this.random)}},{key:"_initFlow",value:function(e){""!==e&&(e===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{key:"_concatConversationID",value:function(e){var t=this.to,n="",o=this.conversationType;o!==S.CONV_SYSTEM?(n=o===S.CONV_C2C?e===this.from?t:this.from:this.to,this.conversationID=n?"".concat(o).concat(n):null):this.conversationID=S.CONV_SYSTEM}},{key:"isElement",value:function(e){return e instanceof pi||e instanceof di||e instanceof gi||e instanceof hi||e instanceof Mi||e instanceof Ii||e instanceof fi||e instanceof mi||e instanceof yi||e instanceof Ci||e instanceof Di}},{key:"setElement",value:function(e,t){var n=this;if(this.isElement(e))return this._elements=[e],void this._initProxy();var o=function(e){if(e.type&&e.content)switch(e.type){case S.MSG_TEXT:n.setTextElement(e.content);break;case S.MSG_IMAGE:n.setImageElement(e.content,t);break;case S.MSG_AUDIO:n.setAudioElement(e.content,t);break;case S.MSG_FILE:n.setFileElement(e.content,t);break;case S.MSG_VIDEO:n.setVideoElement(e.content,t);break;case S.MSG_CUSTOM:n.setCustomElement(e.content);break;case S.MSG_LOCATION:n.setLocationElement(e.content);break;case S.MSG_GRP_TIP:n.setGroupTipElement(e.content);break;case S.MSG_GRP_SYS_NOTICE:n.setGroupSystemNoticeElement(e.content);break;case S.MSG_FACE:n.setFaceElement(e.content);break;case S.MSG_MERGER:n.setMergerElement(e.content,t)}};if(it(e))for(var s=0;s1&&void 0!==arguments[1]&&arguments[1];if(e instanceof Ei)return t&&null!==Ai&&Ai.emit(k.ERROR,e),Promise.reject(e);if(e instanceof Error){var n=new Ei({code:Rr});return t&&null!==Ai&&Ai.emit(k.ERROR,n),Promise.reject(n)}if(!ut(e)&&!ut(e.code)){var o=new Ei(e);return t&&null!==Ai&&Ai.emit(k.ERROR,o),Promise.reject(o)}},Gi=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="C2CModule",t._messageFromUnreadDBMap=new Map,t._signalingFromUnreadDBList=[],t}return a(s,[{key:"onNewC2CMessage",value:function(e){var t=e.dataList,n=e.isInstantMessage,o=e.C2CRemainingUnreadList,s=e.C2CPairUnreadList;He.d("".concat(this._n,".onNewC2CMessage count:").concat(t.length," isInstantMessage:").concat(n));var a=this._newC2CMessageStoredAndSummary({dataList:t,C2CRemainingUnreadList:o,C2CPairUnreadList:s,isInstantMessage:n}),r=a.conversationOptionsList,i=a.messageList,u=a.isUnreadC2CMessage;(this.filterModifiedMessage(i),r.length>0)&&this.getModule(Hn).onNewMessage({conversationOptionsList:r,isInstantMessage:n,isUnreadC2CMessage:u});var c=this.filterUnmodifiedMessage(i);n&&c.length>0&&this.emitOuterEvent(k.MESSAGE_RECEIVED,c),i.length=0}},{key:"_newC2CMessageStoredAndSummary",value:function(e){for(var t=e.dataList,n=e.C2CRemainingUnreadList,o=e.C2CPairUnreadList,s=e.isInstantMessage,a=null,r=[],i=[],u={},c=this.getModule(zn),l=this.getModule(so),p=!1,d=this.getModule(Hn),g=this.getFileDownloadProxy(),h=0,_=t.length;h<_;h++)if(this._isSignaling(t[h]))this._signalingFromUnreadDBList.push(t[h].eventArray[0].c2CNotifyMsgArray[0]);else{var f=t[h];f.currentUser=this.getMyUserID(),f.conversationType=S.CONV_C2C,f.isSystemMessage=!!f.isSystemMessage,(ut(f.nick)||ut(f.avatar))&&(p=!0,He.d("".concat(this._n,"._newC2CMessageStoredAndSummary nick or avatar missing!"))),a=new Si(f),f.elements=c.parseElements(f.elements,f.from),a.setElement(f.elements,g),a.setNickAndAvatar({nick:f.nick,avatar:f.avatar});var v=a.conversationID;if(s){if(1===this._messageFromUnreadDBMap.get(a.ID))continue;var m=!1;if(a.from!==this.getMyUserID()){var M=d.getLatestMessageSentByPeer(v);if(M){var y=M.nick,I=M.avatar;p?a.setNickAndAvatar({nick:y,avatar:I}):y===a.nick&&I===a.avatar||(m=!0)}}else{var C=d.getLatestMessageSentByMe(v);if(C){var T=C.nick,D=C.avatar;T===a.nick&&D===a.avatar||d.modifyMessageSentByMe({conversationID:v,latestNick:a.nick,latestAvatar:a.avatar})}}var k=1===t[h].isModified;if(d.isMessageSentByCurrentInstance(a)?a.isModified=k:k=!1,0===f.msgLifeTime)a._onlineOnlyFlag=!0,d.isMessageSentByCurrentInstance(a)||i.push(a);else{if(!d.pushIntoMessageList(i,a,k))continue;m&&(d.modifyMessageSentByPeer({conversationID:v,latestNick:a.nick,latestAvatar:a.avatar}),d.updateUserProfileSpecifiedKey({conversationID:v,nick:a.nick,avatar:a.avatar}))}s&&a.clientTime>0&&l.addMessageDelay(a.clientTime)}else this._messageFromUnreadDBMap.set(a.ID,1);if(0!==f.msgLifeTime){if(!1===a._onlineOnlyFlag){var L=d.getLastMessageTime(v);if(ot(L)&&a.time0){R=!0;var n=r.find((function(t){return t.conversationID==="C2C".concat(o[e].from)}));n?n.unreadCount=o[e].unreadCount:r.push({conversationID:"C2C".concat(o[e].from),unreadCount:o[e].unreadCount,type:S.CONV_C2C})}},O=0,G=o.length;O0&&(o=e.cloudCustomData);var s=[];if(rt(t)&&rt(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c=this.isOnlineMessage(e,t)?0:void 0;return{protocolName:Mo,tjgID:this.generateTjgID(e),requestData:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:e.getElements(),cloudCustomData:o,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:c,nick:e.nick,avatar:e.avatar,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:0!==c?s:void 0,clientTime:e.clientTime,needReadReceipt:!0===e.needReadReceipt?1:0,isSupportExtension:!0===e.isSupportExtension?1:0}}}},{key:"_isVoipPush",value:function(e){var t=void 0;return ut(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:"isOnlineMessage",value:function(e,t){return!(!t||!0!==t.onlineUserOnly)}},{key:"revokeMessage",value:function(e){return this.request({protocolName:So,requestData:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;return He.l("".concat(this._n,".deleteMessage toAccount:").concat(t," count:").concat(n.length)),this.request({protocolName:Oo,requestData:{fromAccount:this.getMyUserID(),to:t,keyList:n}})}},{key:"modifyRemoteMessage",value:function(e){var t=e.from,n=e.to,o=e.version,s=void 0===o?0:o,a=e.sequence,r=e.random,i=e.time,u=e.payload,c=e.type,l=e.cloudCustomData,p=void 0;return jt(c)&&(p=[]).push({type:c,content:u}),this.request({protocolName:Go,requestData:{from:t,to:n,version:s,sequence:a,random:r,time:i,elements:p,cloudCustomData:l}})}},{key:"setMessageRead",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageTime,s="".concat(this._n,".setMessageRead");He.l("".concat(s," conversationID:").concat(n," lastMessageTime:").concat(o)),ot(o)||this.outputWarning("DoNotModifyLastTime");var a=new li("setC2CMessageRead");return a.setMessage("conversationID:".concat(n," lastMessageTime:").concat(o)),this.request({protocolName:Lo,requestData:{C2CMsgReaded:{cookie:"",C2CMsgReadedItem:[{toAccount:n.replace("C2C",""),lastMessageTime:o,receipt:1}]}}}).then((function(){a.setNetworkType(t.getNetworkType()).end(),He.l("".concat(s," ok"));var e=t.getModule(Hn);return e.updateIsReadAfterReadReport({conversationID:n,lastMessageTime:o}),e.updateUnreadCount(n),Li()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),He.l("".concat(s," failed. error:"),e),Oi(e)}))}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessage"),o=e.peerAccount,s=e.conversationID,a=e.count,r=e.lastMessageTime,i=e.messageKey,u="peerAccount:".concat(o," count:").concat(a||15," lastMessageTime:").concat(r||0," messageKey:").concat(i);He.l("".concat(n," ").concat(u));var c=new li("getC2CRoamingMessages");return this.request({protocolName:Ro,requestData:{peerAccount:o,count:a||15,lastMessageTime:r||0,messageKey:i}}).then((function(e){var o=e.data,a=o.complete,r=o.messageList,i=o.messageKey,l=o.lastMessageTime;ut(r)?He.l("".concat(n," ok. complete:").concat(a," but messageList is undefined!")):He.l("".concat(n," ok. complete:").concat(a," count:").concat(r.length)),c.setNetworkType(t.getNetworkType()).setMessage("".concat(u," complete:").concat(a," length:").concat(r.length)).end();var p=t.getModule(Hn);1===a&&p.setCompleted(s);var d=p.onRoamingMessage(r,s);p.modifyMessageList(s),p.updateIsRead(s),p.updateRoamingMessageKeyAndTime(s,i,l);var g=p.getPeerReadTime(s);if(He.l("".concat(n," update isPeerRead property. conversationID:").concat(s," peerReadTime:").concat(g)),g)p.updateMessageIsPeerReadProperty(s,g);else{var h=s.replace(S.CONV_C2C,"");t.getRemotePeerReadTime([h]).then((function(){p.updateMessageIsPeerReadProperty(s,p.getPeerReadTime(s))}))}var _="";if(d.length>0)_=d[0].ID;else{var f=p.getLocalOldestMessage(s);f&&(_=f.ID)}return He.l("".concat(n," nextReqID:").concat(_," stored message count:").concat(d.length)),{nextReqID:_,storedMessageList:d}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setMessage(u).setError(e,o,s).end()})),He.w("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessagesHopping"),o=e.peerAccount,s=e.time,a=void 0===s?0:s,r=e.count,i=e.direction,u="".concat(S.CONV_C2C).concat(o),c="peerAccount:".concat(o," count:").concat(r," time:").concat(a," direction:").concat(i);He.l("".concat(n," ").concat(c));var l=new li("getC2CRoamingMessagesHopping");return this.request({protocolName:Ro,requestData:{peerAccount:o,count:r+1,lastMessageTime:a,direction:i}}).then((function(e){var o=e.data,s=o.complete,a=o.messageList,r=void 0===a?[]:a,p=o.lastMessageTime;He.l("".concat(n," ok. complete:").concat(s," count:").concat(r.length)),l.setNetworkType(t.getNetworkType()).setMessage("".concat(c," complete:").concat(s," length:").concat(r.length)).end(),1!==s&&(1===i?r.pop():r.shift());var d=t.getModule(Hn).onRoamingMessage(r,u,!1);t._modifyMessageList(u,d);var g=t._computeResult({complete:s,lastMessageTime:p,resultList:d});return Li(g)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setMessage(c).setError(e,o,s).end()})),He.w("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_computeResult",value:function(e){var t=e.complete,n=void 0===t?0:t,o=e.lastMessageTime,s=e.resultList,a={messageList:m(void 0===s?[]:s),isCompleted:!1,nextMessageTime:""};return 1===n?(a.isCompleted=!0,a):(a.nextMessageTime=o,a)}},{key:"_modifyMessageList",value:function(e,t){var n=this.getModule(Hn).getLocalConversation(e);if(n)for(var o=n.userProfile.nick,s=n.userProfile.avatar,a=this.getModule(wn).getNickAndAvatarByUserID(this.getMyUserID()),r=a.nick,i=a.avatar,u=t.length-1;u>=0;u--){var c=t[u];"in"===c.flow&&(c.nick!==o&&c.setNickAndAvatar({nick:o}),c.avatar!==s&&c.setNickAndAvatar({avatar:s})),"out"===c.flow&&(c.nick!==r&&c.setNickAndAvatar({nick:r}),c.avatar!==i&&c.setNickAndAvatar({avatar:i}))}}},{key:"getRemotePeerReadTime",value:function(e){var t=this,n="".concat(this._n,".getRemotePeerReadTime");if(Zt(e))return He.w("".concat(n," userIDList is empty!")),Promise.resolve();var o=new li("getPeerReadTime");return He.l("".concat(n," userIDList:").concat(e)),this.request({protocolName:No,requestData:{userIDList:e}}).then((function(s){var a=s.data.peerReadTimeList;He.l("".concat(n," ok. peerReadTimeList:").concat(a));for(var r="",i=t.getModule(Hn),u=0;u0&&i.recordPeerReadTime("C2C".concat(e[u]),a[u]);o.setNetworkType(t.getNetworkType()).setMessage(r).end()})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.w("".concat(n," failed. error:"),e)}))}},{key:"sendReadReceipt",value:function(e){var t=this,n=e[0].conversationID.replace(S.CONV_C2C,""),o=new li("sendC2CReadReceipt");o.setMessage("peerAccount:".concat(n));var s=this.getMyUserID(),a=e.filter((function(e){return e.from!==s&&!0===e.needReadReceipt})).map((function(e){return{fromAccount:e.from,toAccount:e.to,sequence:e.sequence,random:e.random,time:e.time,clientTime:e.clientTime}}));if(0===a.length)return Oi({code:Ua});var r="".concat(this._n,".sendReadReceipt");return He.l("".concat(r,". peerAccount:").concat(n," messageInfoList length:").concat(a.length)),this.request({protocolName:_s,requestData:{peerAccount:n,messageInfoList:a}}).then((function(e){return o.end(),He.l("".concat(r," ok")),Li()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.w("".concat(r," failed. error:"),e),Oi(e)}))}},{key:"getReadReceiptList",value:function(e){var t="".concat(this._n,".getReadReceiptList"),n=this.getMyUserID(),o=e.filter((function(e){return e.from===n&&!0===e.needReadReceipt}));return He.l("".concat(t," userID:").concat(n," messageList length:").concat(o.length)),Ni({messageList:o})}},{key:"getMessageExtensions",value:function(e,t){return He.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.request({protocolName:Uo,requestData:{from:e.from,to:e.to,messageKey:this._getMessageKey(e),startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return He.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n)),this.request({protocolName:Po,requestData:{from:e.from,to:e.to,messageKey:this._getMessageKey(e),extensionList:t,operateType:n}})}},{key:"_getMessageKey",value:function(e){var t=e.clientSequence,n=e.random,o=e.time;return"".concat(t,"_").concat(n,"_").concat(o)}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._messageFromUnreadDBMap.clear(),this._signalingFromUnreadDBList.length=0}}]),s}(po),Pi=function(){function e(){o(this,e),this.list=new Map,this._n="MessageListHandler",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map}return a(e,[{key:"getLocalOldestMessageByConversationID",value:function(e){if(!e)return null;if(!this.list.has(e))return null;var t=this.list.get(e).values();return t?t.next().value:null}},{key:"pushIn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.conversationID,o=!0;this.list.has(n)||this.list.set(n,new Map);var s=this._getUniqueIDOfMessage(e),a=this.list.get(n).has(s);if(a){var r=this.list.get(n).get(s);if(!t||!0===r.isModified)return o=!1}return this.list.get(n).set(s,e),this._setLatestMessageSentByPeer(n,e),this._setLatestMessageSentByMe(n,e),o}},{key:"unshift",value:function(e,t){var n;if(it(e)?e.length>0&&(n=e[0].conversationID,this._unshiftMultipleMessages(e,t)):(n=e.conversationID,this._unshiftSingleMessage(e,t)),n&&n.startsWith(S.CONV_C2C)){var o=Array.from(this.list.get(n).values()),s=o.length;if(0===s)return;for(var a=s-1;a>=0;a--)if("out"===o[a].flow){this._setLatestMessageSentByMe(n,o[a]);break}for(var r=s-1;r>=0;r--)if("in"===o[r].flow){this._setLatestMessageSentByPeer(n,o[r]);break}}}},{key:"_unshiftSingleMessage",value:function(e,t){var n=e.conversationID,o=this._getUniqueIDOfMessage(e);if(!this.list.has(n))return this.list.set(n,new Map),this.list.get(n).set(o,e),void t.push(e);var s=this.list.get(n),a=Array.from(s);s.has(o)||(a.unshift([o,e]),this.list.set(n,new Map(a)),t.push(e))}},{key:"_unshiftMultipleMessages",value:function(e,t){for(var n=e.length,o=[],s=e[0].conversationID,a=this.list.get(s),r=this.list.has(s)?Array.from(a):[],i=0;i=0;l--)"in"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));He.l("".concat(this._n,".modifyMessageSentByPeer conversationID:").concat(t," count:").concat(u))}}}},{key:"modifyMessageSentByMe",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar,s=this.list.get(t);if(!Zt(s)){var a=Array.from(s.values()),r=a.length;if(0!==r){for(var i=null,u=0,c=!1,l=r-1;l>=0;l--)"out"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));He.l("".concat(this._n,".modifyMessageSentByMe conversationID:").concat(t," count:").concat(u))}}}},{key:"getTopicConversationIDList",value:function(e){return m(this.list.keys()).filter((function(t){return t.startsWith("".concat(S.CONV_GROUP).concat(e))}))}},{key:"traversal",value:function(){if(0!==this.list.size&&-1===He.getLevel()){console.group("conversationID-messageCount");var e,t=D(this.list);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];console.log("".concat(o,"-").concat(s.size))}}catch(a){t.e(a)}finally{t.f()}console.groupEnd()}}},{key:"onMessageModified",value:function(e,t){if(!this.list.has(e))return{isUpdated:!1,message:null};var n=this._getUniqueIDOfMessage(t),o=this.list.get(e).has(n);if(He.d("".concat(this._n,".onMessageModified conversationID:").concat(e," uniqueID:").concat(n," has:").concat(o)),o){var s=this.list.get(e).get(n),a=t.messageVersion,r=t.elements,i=t.cloudCustomData;return s.version1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isReady?void(t?e.call(this):setTimeout(e,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(e))},t.triggerReady=function(){var e=this;this._isReady=!0,setTimeout((function(){var t=e._readyQueue;e._readyQueue=[],t&&t.length>0&&t.forEach((function(e){e.call(this)}),e)}),1)},t.resetReady=function(){this._isReady=!1,this._readyQueue=[]},t.isReady=function(){return this._isReady}};var Fi=["jpg","jpeg","gif","png","bmp","image","webp"],xi=["mp4","quicktime","mov"],Vi=1,Bi=2,Hi=3,Ki=255,Wi=function(){function e(t){var n=this;o(this,e),Zt(t)||(this.userID=t.userID||"",this.nick=t.nick||"",this.gender=t.gender||"",this.birthday=t.birthday||0,this.location=t.location||"",this.selfSignature=t.selfSignature||"",this.allowType=t.allowType||S.ALLOW_TYPE_ALLOW_ANY,this.language=t.language||0,this.avatar=t.avatar||"",this.messageSettings=t.messageSettings||0,this.adminForbidType=t.adminForbidType||S.FORBID_TYPE_NONE,this.level=t.level||0,this.role=t.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],Zt(t.profileCustomField)||t.profileCustomField.forEach((function(e){n.profileCustomField.push({key:e.key,value:e.value})})))}return a(e,[{key:"validate",value:function(e){var t=!0,n="";if(Zt(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var o=e.profileCustomField.length,s=null,a=0;a500&&(n="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(mt(e[r])," bytes"),t=!1);break;case"gender":Ct(je,e.gender)||(n="key:gender, invalid value:"+e.gender,t=!1);break;case"birthday":ot(e.birthday)||(n="birthday must be a number",t=!1);break;case"location":st(e.location)||(n="location must be a string",t=!1);break;case"selfSignature":st(e.selfSignature)||(n="selfSignature must be a string",t=!1);break;case"allowType":Ct(ze,e.allowType)||(n="key:allowType, invalid value:"+e.allowType,t=!1);break;case"language":ot(e.language)||(n="language must be a number",t=!1);break;case"avatar":st(e.avatar)||(n="avatar must be a string",t=!1);break;case"messageSettings":0!==e.messageSettings&&1!==e.messageSettings&&(n="messageSettings must be 0 or 1",t=!1);break;case"adminForbidType":Ct(Ye,e.adminForbidType)||(n="key:adminForbidType, invalid value:"+e.adminForbidType,t=!1);break;case"level":ot(e.level)||(n="level must be a number",t=!1);break;case"role":ot(e.role)||(n="role must be a number",t=!1);break;default:n="unknown key:"+r+" "+e[r],t=!1}}return{valid:t,tips:n}}}]),e}(),ji=a((function e(t){o(this,e),this.value=t,this.next=null})),Yi=function(){function e(t){o(this,e),this.MAX_LENGTH=t,this.pTail=null,this.pNodeToDel=null,this.map=new Map}return a(e,[{key:"set",value:function(e){var t=new ji(e);if(this.map.size0&&n.members.forEach((function(e){e.userID===t.selfInfo.userID&&ft(t.selfInfo,e,["sequence"])}))}},{key:"updateSelfInfo",value:function(e){var n={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList};ft(this.selfInfo,t({},n),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(e){this.selfInfo.nameCard=e}}]),e}(),Xi=function(e,n){return ut(e)?{lastTime:0,lastSequence:0,fromAccount:0,messageForShow:"",payload:null,type:"",isRevoked:!1,cloudCustomData:"",onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:!1,revoker:null}:e instanceof Si?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",messageForShow:Wt(e.type,e.payload,n),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||"",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||"",nameCard:e.nameCard||"",version:e.version||0,isPeerRead:e.isPeerRead||!1,revoker:e.revoker||null}:t(t({},e),{},{messageForShow:Wt(e.type,e.payload,n)})},Qi=function(){function e(t,n){o(this,e),this.conversationID=t.conversationID||"",this.unreadCount=t.unreadCount||0,this.type=t.type||"",this.lastMessage=Xi(t.lastMessage,n),t.lastMsgTime&&(this.lastMessage.lastTime=t.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=t.peerReadTime||0,this.groupAtInfoList=[],this.remark="",this.isPinned=t.isPinned||!1,this.messageRemindType="",this.markList=t.markList||[],this.customData=t.customData||"",this.conversationGroupList=t.conversationGroupList||[],this._initProfile(t)}return a(e,[{key:"toAccount",get:function(){return this.conversationID.startsWith(S.CONV_C2C)?this.conversationID.replace(S.CONV_C2C,""):this.conversationID.startsWith(S.CONV_GROUP)?this.conversationID.replace(S.CONV_GROUP,""):""}},{key:"subType",get:function(){return this.groupProfile?this.groupProfile.type:""}},{key:"_initProfile",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"userProfile":t.userProfile=e.userProfile;break;case"groupProfile":t.groupProfile=e.groupProfile}})),ut(this.userProfile)&&this.type===S.CONV_C2C?this.userProfile=new Wi({userID:e.conversationID.replace("C2C","")}):ut(this.groupProfile)&&this.type===S.CONV_GROUP&&(this.groupProfile=new Ji({groupID:e.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(e){var t=e.nextUnreadCount,n=e.isFromGetConversations,o=e.isUnreadC2CMessage;ut(t)||(Lt(this.subType)?this.unreadCount=0:n&&this.type===S.CONV_GROUP||n&&this.type===S.CONV_TOPIC||o&&this.type===S.CONV_C2C?this.unreadCount=t:this.unreadCount=this.unreadCount+t)}},{key:"updateLastMessage",value:function(e){this.lastMessage=Xi(e)}},{key:"updateGroupAtInfoList",value:function(e){if(!this._isNeedMergeGroupAtInfo(e)){var t,n=(M(t=e.groupAtType)||y(t)||I(t)||T()).slice(0);-1!==n.indexOf(S.CONV_AT_ME)&&-1!==n.indexOf(S.CONV_AT_ALL)&&(n=[S.CONV_AT_ALL_AT_ME]);var o={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:n,__random:e.__random,__sequence:e.__sequence};this.groupAtInfoList.push(o)}}},{key:"_isNeedMergeGroupAtInfo",value:function(e){var t=e.groupID,n=e.sequence;if(!Et({groupID:t}))return!1;var o=!1;return this.groupAtInfoList.forEach((function(t){t.messageSequence===n&&(t.atTypeArray.indexOf(S.CONV_AT_ME)>-1&&e.groupAtType.indexOf(S.CONV_AT_ALL)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME]),t.atTypeArray.indexOf(S.CONV_AT_ALL)>-1&&e.groupAtType.indexOf(S.CONV_AT_ME)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME],t.__random=e.__random,t.__sequence=e.__sequence),o=!0)})),o}},{key:"clearGroupAtInfoList",value:function(){this.groupAtInfoList.length=0}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){var t=e.sequence,n=e.time;return this.type===S.CONV_C2C&&t===this.lastMessage.lastSequence&&n===this.lastMessage.lastTime||this.type===S.CONV_GROUP&&t===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}}]),e}(),Zi=function(){function e(t){o(this,e),this._conversationModule=t,this._n="MessageRemindHandler",this._updateSequence=0}return a(e,[{key:"getC2CMessageRemindType",value:function(){var e=this,t="".concat(this._n,".getC2CMessageRemindType");return this._conversationModule.request({protocolName:Ao,updateSequence:this._updateSequence}).then((function(n){He.l("".concat(t," ok"));var o=n.data,s=o.updateSequence,a=o.muteFlagList;e._updateSequence=s,e._patchC2CMessageRemindType(a)})).catch((function(e){He.e("".concat(t," failed. error:"),e)}))}},{key:"_patchC2CMessageRemindType",value:function(e){var t=this,n=0,o="";it(e)&&e.length>0&&e.forEach((function(e){var s=e.userID,a=e.muteFlag;0===a?o=S.MSG_REMIND_ACPT_AND_NOTE:1===a?o=S.MSG_REMIND_DISCARD:2===a&&(o=S.MSG_REMIND_ACPT_NOT_NOTE),!0===t._conversationModule.patchMessageRemindType({ID:s,isC2CConversation:!0,messageRemindType:o})&&(n+=1)})),He.l("".concat(this._n,"._patchC2CMessageRemindType count:").concat(n))}},{key:"set",value:function(e){return e.groupID?this._setGroupMessageRemindType(e):it(e.userIDList)?this._setC2CMessageRemindType(e):void 0}},{key:"_setGroupMessageRemindType",value:function(e){var t=this,n="".concat(this._n,"._setGroupMessageRemindType"),o=e.groupID,s=e.messageRemindType,a="groupID:".concat(o," messageRemindType:").concat(s),r=new li("setMessageRemindType");return r.setMessage(a),this._getModule(Vn).modifyGroupMemberInfo({groupID:o,messageRemindType:s,userID:this._conversationModule.getMyUserID()}).then((function(){r.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok. ").concat(a));var o=t.onGroupMessageRemindTypeUpdated(e);return t._conversationModule.emitTotalUnreadMessageCountUpdate(),Li(o)})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"onGroupMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.messageRemindType,o=this._getModule(Fn).getLocalGroupProfile(t);if(o&&(o.selfInfo.messageRemindType=n),At(t)){var s=t,a=Kt(s),r=this._getModule(Bn).getLocalTopic(a,s);return r&&(r.updateSelfInfo({messageRemindType:n}),this._conversationModule.emitOuterEvent(k.TOPIC_UPDATED,{groupID:a,topic:r})),{topic:r}}return this._conversationModule.patchMessageRemindType({ID:t,isC2CConversation:!1,messageRemindType:n})&&this._emitConversationUpdate(),{group:o}}},{key:"_setC2CMessageRemindType",value:function(e){var t=this,n="".concat(this._n,"._setC2CMessageRemindType"),o=e.userIDList,s=e.messageRemindType,a=o.slice(0,30),r=0;s===S.MSG_REMIND_DISCARD?r=1:s===S.MSG_REMIND_ACPT_NOT_NOTE&&(r=2);var i="userIDList:".concat(a," messageRemindType:").concat(s),u=new li("setMessageRemindType");return u.setMessage(i),this._conversationModule.request({protocolName:Eo,requestData:{userIDList:a,muteFlag:r}}).then((function(e){u.setNetworkType(t._conversationModule.getNetworkType()).end();var o=e.data,r=o.updateSequence,i=o.errorList;t._updateSequence=r;var c=[],l=[];it(i)&&i.forEach((function(e){c.push(e.userID),l.push({userID:e.userID,code:e.errorCode})}));var p=a.filter((function(e){return-1===c.indexOf(e)}));He.l("".concat(n," ok. successUserIDList:").concat(p," failureUserIDList:").concat(JSON.stringify(l)));var d=0;return p.forEach((function(e){t._conversationModule.patchMessageRemindType({ID:e,isC2CConversation:!0,messageRemindType:s})&&(d+=1)})),d>=1&&t._emitConversationUpdate(),a.length=c.length=0,t._conversationModule.emitTotalUnreadMessageCountUpdate(),Ni({successUserIDList:p.map((function(e){return{userID:e}})),failureUserIDList:l})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_getModule",value:function(e){return this._conversationModule.getModule(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"setUpdateSequence",value:function(e){this._updateSequence=e}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._updateSequence=0}}]),e}(),$i=function(){function e(t){o(this,e),this._conversationModule=t,this._n="ConvGroupHandler",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=on.NOT_START}return a(e,[{key:"setConvCustomData",value:function(e){var t=this,n="".concat(this._n,".").concat("setConvCustomData"),o=e.conversationIDList,s=e.customData;He.l("".concat(n," options:"),e);var a=new li("setConvCustomData");a.setMessage(JSON.stringify(e));var r={fromAccount:this._getMyUserID(),itemList:[]},i=[],u=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(u,e),!0;if(!Rt(e)&&!Nt(e))return t._onConversationIDInvalid(u,e),!0;var n={operationType:2,contactItem:void 0,customMark:s};Rt(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:Nt(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),r.itemList.push(n)})),u.length===o.length?Ni({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:Bo,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok"));var o=e.data.resultItem;if(it(o)){var r,c,l=!1;o.forEach((function(e){r=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(r),(c=t._getLocalConversation(r))&&c.customData!==s&&(c.customData=s,l=!0)):u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&t._emitConversationUpdate()}return Li({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"markConversation",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_MARK))return Oi({code:Kr});var n="".concat(this._n,".").concat("markConversation"),o=e.conversationIDList,s=e.markType,a=e.enableMark;He.l("".concat(n," options:"),e);var r=new li("markConversation");r.setMessage(JSON.stringify(e));var i=void 0,u=void 0,c=this._getFlagBit(s);!0===a?u=[c]:i=[c];var l={fromAccount:this._getMyUserID(),itemList:[]},p=[],d=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(d,e),!0;if(!Rt(e)&&!Nt(e))return t._onConversationIDInvalid(d,e),!0;var n={operationType:1,contactItem:void 0,clearMark:i,setMark:u};Rt(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:Nt(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),l.itemList.push(n)})),d.length===o.length?Ni({successConversationIDList:p,failureConversationIDList:d}):this._conversationModule.request({protocolName:Ho,requestData:l}).then((function(e){r.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok"));var o=e.data.resultItem;if(it(o)){var i,u,c=!1;o.forEach((function(e){if(i=t._concatConversationID(e.contactItem),0===e.resultCode){if(p.push(i),u=t._getLocalConversation(i)){var n=u.markList.indexOf(s);!0===a?-1===n&&(u.markList.push(s),c=!0):-1!==n&&(u.markList.splice(n,1),c=!0)}}else d.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===c&&t._emitConversationUpdate()}return Li({successConversationIDList:p,failureConversationIDList:d})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"getLocalConvGroupList",value:function(){var e=this;return He.l("".concat(this._n,".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===on.REJECTED?this.getRemoteConvGroupList().then((function(){return Li(m(e._convGroupMap.values()))})):Ni(m(this._convGroupMap.values()))}},{key:"getRemoteConvGroupList",value:function(){var e=this,t="".concat(this._n,".getRemoteConvGroupList");return this._pagingStatus=on.PENDING,this._conversationModule.request({protocolName:Jo,requestData:{fromAccount:this._getMyUserID(),startIndex:this._startIndex,startTime:Fe()}}).then((function(n){var o,s,a=n.data,r=a.completeFlag,i=a.contactItem,u=a.nextStartIndex,c=void 0===u?0:u,l=a.groupItem;(e._startIndex=c,He.l("".concat(t," completeFlag:").concat(r," nextStartIndex:").concat(c)),it(l)&&l.forEach((function(t){var n=t.convGroupID,o=t.groupName;e._convGroupMap.set(n,o)})),it(i))&&i.forEach((function(t){var n=t.standardMark,a=t.customData,r=t.convGroupIDList;if(o=e._concatConversationID(t),(s=e._getLocalConversation(o))&&(s.markList=Yt(n),s.customData=a||"",it(r))){var i=[];r.forEach((function(t){e._convGroupMap.has(t)&&i.push(e._convGroupMap.get(t))})),s.conversationGroupList=[].concat(i),i.length=0}}));if(0===r)return e.getRemoteConvGroupList();1===r&&(e._pagingStatus=on.RESOLVED,e._emitConversationUpdate(),e._emitConvGroupListUpdate())})).catch((function(n){e._pagingStatus=on.REJECTED,He.w("".concat(t," failed. error:"),n)}))}},{key:"createConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Oi({code:Kr});var n="".concat(this._n,".").concat("createConvGroup");He.l("".concat(n," options:"),e);var o=new li("createConvGroup");o.setMessage(JSON.stringify(e));var s=e.groupName,a=e.conversationIDList,r={fromAccount:this._getMyUserID(),itemList:[{groupName:s,contactItem:[]}]},i=[],u=[];return a.forEach((function(e){return t._hasLocalConversation(e)?Rt(e)||Nt(e)?void(Rt(e)?r.itemList[0].contactItem.push({type:1,toAccount:e.replace(S.CONV_C2C,"")}):Nt(e)&&r.itemList[0].contactItem.push({type:2,groupID:e.replace(S.CONV_GROUP,"")})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===a.length?Ni({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:Ko,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok"));var a=e.data.groupResultItem[0],r=a.groupItem,c=a.resultItem;if(rt(r)&&(t._convGroupMap.set(r.convGroupID,r.groupName),t._emitConvGroupListUpdate()),it(c)){var l,p,d=!1;c.forEach((function(e){l=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(l),(p=t._getLocalConversation(l))&&-1===p.conversationGroupList.indexOf(s)&&(p.conversationGroupList.push(s),d=!0)):u.push({conversationID:l,code:e.resultCode,message:e.resultInfo})})),!0===d&&(t._emitConversationUpdate(),t._emitConvGroupListUpdate())}return Li({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"deleteConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Oi({code:Kr});var n="".concat(this._n,".").concat("deleteConvGroup");He.l("".concat(n," groupName:").concat(e));var o=new li("deleteConvGroup");return o.setMessage(e),this._conversationModule.request({protocolName:Wo,requestData:{fromAccount:this._getMyUserID(),groupName:[e]}}).then((function(s){o.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok"));var a=s.data.groupItem;if(it(a)){var r=!1;a.forEach((function(e){t._convGroupMap.has(e.convGroupID)&&(t._convGroupMap.delete(e.convGroupID),r=!0)})),!0===r&&t._emitConvGroupListUpdate()}t._eraseFromConversationGroupList([e])})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"renameConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Oi({code:Kr});var n="".concat(this._n,".").concat("renameConvGroup");He.l("".concat(n," options:"),e);var o=new li("renameConvGroup");o.setMessage(JSON.stringify(e));var s=e.oldName,a=e.newName;return this._conversationModule.request({protocolName:jo,requestData:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:s,newName:a}}}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok"));var r=e.data.updateGroupResult.convGroupID;t._convGroupMap.set(r,a),t._emitConvGroupListUpdate();var i,u,c=t._conversationModule.getLocalConversationList(),l=!1;c.forEach((function(e){i=e.conversationGroupList,-1!==(u=i.indexOf(s))&&(i.splice(u,1,a),l=!0)})),!0===l&&t._emitConversationUpdate()})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"addConvsToGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Oi({code:Kr});var n="".concat(this._n,".").concat("addConvsToGroup");He.l("".concat(n," options:"),e);var o=new li("addConvsToGroup");o.setMessage(JSON.stringify(e));var s=e.conversationIDList,a=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?Rt(e)||Nt(e)?void(Rt(e)?r.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):Nt(e)&&r.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?Ni({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:Yo,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok"));var s=e.data.updateGroupResult.contactResultItem;if(it(s)){var r,c,l=!1;s.forEach((function(e){r=t._concatConversationID(e.contactItem),0===e.resultCode?(c=t._getLocalConversation(r))&&-1===c.conversationGroupList.indexOf(a)&&(c.conversationGroupList.push(a),i.push(r),l=!0):u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(a))}return Li({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"deleteConvsFromGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Oi({code:Kr});var n="".concat(this._n,".").concat("deleteConvsFromGroup");He.l("".concat(n," options:"),e);var o=new li("deleteConvsFromGroup");o.setMessage(JSON.stringify(e));var s=e.conversationIDList,a=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?Rt(e)||Nt(e)?void(Rt(e)?r.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):Nt(e)&&r.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?Ni({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:zo,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),He.l("".concat(n," ok"));var s=e.data.updateGroupResult.contactResultItem;if(it(s)){var r,c,l=!1;s.forEach((function(e){if(r=t._concatConversationID(e.contactItem),0===e.resultCode){if(c=t._getLocalConversation(r)){var n=c.conversationGroupList.indexOf(a);-1!==n&&(c.conversationGroupList.splice(n,1),i.push(r),l=!0)}}else u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(a))}return Li({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"onConvMarkUpdated",value:function(e){var t=this;if(!Zt(e)){var n,o;He.d("".concat(this._n,".onConvMarkUpdated markItemList:"),e);var s=!1;e.forEach((function(e){var a=e.recentContactItem,r=e.optType,i=e.standardMark,u=e.customMark;if(n=t._concatConversationID(a),o=t._getLocalConversation(n))if(1===r){var c=Yt(i);!0!==function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n=0;o--)if("1"===t[o])return n-o-1}},{key:"_concatConversationID",value:function(e){var t,n=e.type,o=e.to,s=e.groupID,a=e.userID;return 1===n?ut(a)?ut(o)||(t="".concat(S.CONV_C2C).concat(o)):t="".concat(S.CONV_C2C).concat(a):2===n&&(t="".concat(S.CONV_GROUP).concat(s)),t}},{key:"_getMyUserID",value:function(){return this._conversationModule.getMyUserID()}},{key:"_insertConversationGroup",value:function(e,t){var n=this._getLocalConversation(e);if(n){var o=n.conversationGroupList;-1===o.indexOf(t)&&o.push(t)}}},{key:"_getLocalConversation",value:function(e){return this._conversationModule.getLocalConversation(e)}},{key:"_hasLocalConversation",value:function(e){return this._conversationModule.hasLocalConversation(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"_emitConvGroupListUpdate",value:function(){this._conversationModule.emitOuterEvent(k.CONVERSATION_GROUP_LIST_UPDATED,m(this._convGroupMap.values()))}},{key:"_emitConvInGroupUpdate",value:function(e){var t={groupName:e,conversationList:[]},n=this._conversationModule.getLocalConversationList();t.conversationList=n.filter((function(t){return t.conversationGroupList.includes(e)})),this._conversationModule.emitOuterEvent(k.CONVERSATION_IN_GROUP_UPDATED,t)}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=on.NOT_START}}]),e}(),eu=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="ConversationModule",qi.mixin(h(t)),t._messageListHandler=new Pi,t._messageRemindHandler=new Zi(h(t)),t._convGroupHandler=new $i(h(t)),t.singlyLinkedList=new Yi(100),t._pagingStatus=on.NOT_START,t._pagingTimeStamp=0,t._pagingStartIndex=0,t._pagingPinnedTimeStamp=0,t._pagingPinnedStartIndex=0,t._pagingConvIDMap=new Map,t._convIDFromUnreadDBMap=new Map,t._conversationMap=new Map,t._tmpGroupList=[],t._tmpGroupAtTipsList=[],t._peerReadTimeMap=new Map,t._completedMap=new Map,t._roamingMessageKeyAndTimeMap=new Map,t._roamingMessageSequenceMap=new Map,t._remoteGroupReadSequenceMap=new Map,t._convTotalUnreadCount=0,t._initListeners(),t}return a(s,[{key:"_initListeners",value:function(){var e=this.getInnerEmitterInstance();e.on(Ui,this._initLocalConversationList,this),e.on(wi,this._onProfileUpdated,this)}},{key:"onCheckTimer",value:function(e){e%60==0&&this._messageListHandler.traversal()}},{key:"_initLocalConversationList",value:function(){var e=this,t=new li("_initLocalConversationList");He.l("".concat(this._n,".").concat("_initLocalConversationList"));var n="",o=this._getStorageConversationList(),s=this.isIntl();if(o){for(var a=o.length,r=0;r0&&(e.updateConversationGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)})),this.syncConversationList()}},{key:"onMessageSent",value:function(e){this._onSendOrReceiveMessage({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:"onNewMessage",value:function(e){this._onSendOrReceiveMessage(e)}},{key:"_onSendOrReceiveMessage",value:function(e){var t=this,n=e.conversationOptionsList,o=e.isInstantMessage,s=void 0===o||o,a=e.isUnreadC2CMessage,r=void 0!==a&&a,i=e.updateUnreadCount,u=void 0===i||i;this._isReady?0!==n.length&&(this._getC2CPeerReadTime(n),this._updateLocalConversationList({conversationOptionsList:n,isInstantMessage:s,isUnreadC2CMessage:r,isFromGetConversations:!1,updateUnreadCount:u}),s||(this._convIDFromUnreadDBMap=new Map([].concat(m(this._convIDFromUnreadDBMap),m(n.map((function(e){return[e.conversationID,1]}))))),this._diffAndDeleteConversation()),this._setStorageConversationList(),n.filter((function(e){return e.type===S.CONV_TOPIC})).length>0||this.emitConversationUpdate()):this.ready((function(){t._onSendOrReceiveMessage(e)}))}},{key:"updateConversationGroupProfile",value:function(e){var t=this;if(!it(e)||0!==e.length)if(0!==this._conversationMap.size){var n=!1;e.forEach((function(e){var o="GROUP".concat(e.groupID);if(t._conversationMap.has(o)){n=!0;var s=t._conversationMap.get(o);s.groupProfile=JSON.parse(JSON.stringify(e)),s.lastMessage.lastSequence=0;r--)if(!s[r].isDeleted){a=s[r];break}var i=this._conversationMap.get(o);if(i){var u=!1;i.lastMessage.lastSequence===a.sequence&&i.lastMessage.lastTime===a.time||(Zt(a)&&(a=void 0),i.updateLastMessage(a),i.type!==S.CONV_TOPIC&&(u=!0),He.l("".concat(this._n,".onMessageDeleted. update conversationID:").concat(o," with lastMessage:"),i.lastMessage)),o.startsWith(S.CONV_C2C)&&this.updateUnreadCount(o),u&&this.emitConversationUpdate(!0,!1)}}}},{key:"onMessageModified",value:function(e){var t=e.conversationType,n=e.from,o=e.to,s=e.time,a=e.sequence,r=e.elements,i=e.cloudCustomData,u=e.messageVersion,c=this.getMyUserID(),l="".concat(t).concat(o);o===c&&t===S.CONV_C2C&&(l="".concat(t).concat(n));var p=this._messageListHandler.onMessageModified(l,e),d=p.isUpdated,g=p.message;!0===d&&this.emitOuterEvent(k.MESSAGE_MODIFIED,[g]);var h=this._isTopicConversation(l);if(He.l("".concat(this._n,".onMessageModified isUpdated:").concat(d," isTopicMessage:").concat(h," from:").concat(n," to:").concat(o)),h){this.getModule(Bn).onMessageModified(e)}else{var _=this._conversationMap.get(l);if(_){var f=_.lastMessage;He.d("".concat(this._n.onMessageModified," lastMessage:"),JSON.stringify(f),"options:",JSON.stringify(e)),f&&f.lastTime===s&&f.lastSequence===a&&f.version!==u&&(f.type=r[0].type,f.payload=r[0].content,f.messageForShow=Wt(f.type,f.payload,this.isIntl()),f.cloudCustomData=i,f.version=u,this.emitConversationUpdate(!0,!1))}}return g}},{key:"onNewGroupAtTips",value:function(e){var n=this,o=e.dataList,s=null;o.forEach((function(e){e.groupAtTips?s=e.groupAtTips:e.elements?s=t(t({},e.elements),{},{sync:!0}):e.groupAtType&&(s=t(t({},e),{},{sync:!0})),s.__random=e.random,s.__sequence=e.clientSequence,n._tmpGroupAtTipsList.push(s)})),He.d("".concat(this._n,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:"_handleGroupAtTipsList",value:function(){var e=this;if(0!==this._tmpGroupAtTipsList.length){var t=!1;this._tmpGroupAtTipsList.forEach((function(n){var o=n.groupID,s=n.from,a=n.topicID,r=void 0===a?void 0:a,i=n.sync,u=void 0!==i&&i;if(s!==e.getMyUserID())if(ut(r)){var c=e._conversationMap.get("".concat(S.CONV_GROUP).concat(o));c&&(c.updateGroupAtInfoList(n),t=!0)}else{var l=e._conversationMap.get("".concat(S.CONV_GROUP).concat(r));if(l){l.updateGroupAtInfoList(n);var p=e.getModule(Bn),d=l.groupAtInfoList;p.onConversationProxy({topicID:r,groupAtInfoList:d})}if(Zt(l)&&u)e.updateTopicConversation([{conversationID:"".concat(S.CONV_GROUP).concat(r),type:S.CONV_TOPIC}]),e._conversationMap.get("".concat(S.CONV_GROUP).concat(r)).updateGroupAtInfoList(n)}})),t&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{key:"_getC2CPeerReadTime",value:function(e){var t=this,n=[];if(e.forEach((function(e){t._conversationMap.has(e.conversationID)||e.type!==S.CONV_C2C||n.push(e.conversationID.replace(S.CONV_C2C,""))})),n.length>0){He.d("".concat(this._n,"._getC2CPeerReadTime userIDList:").concat(n));var o=this.getModule(qn);o&&o.getRemotePeerReadTime(n)}}},{key:"_getStorageConversationList",value:function(){return this.getModule(Wn).getItem("conversationMap")}},{key:"_setStorageConversationList",value:function(){var e=this.getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C||e.type===S.CONV_GROUP&&e.lastMessage.type!==S.MSG_GRP_TIP})).slice(0,20).map((function(e){return{conversationID:e.conversationID,type:e.type,subType:e.subType,lastMessage:e.lastMessage,groupProfile:e.groupProfile,userProfile:e.userProfile}}));this.getModule(Wn).setItem("conversationMap",e)}},{key:"emitConversationUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversationList();if(t){var o=this.getModule(Fn);o&&o.updateGroupLastMessage(n)}e&&this.emitOuterEvent(k.CONVERSATION_LIST_UPDATED)}},{key:"getLocalConversationList",value:function(){return m(this._conversationMap.values()).filter((function(e){return e.type!==S.CONV_TOPIC}))}},{key:"getLocalConversation",value:function(e){return this._conversationMap.get(e)}},{key:"hasLocalConversation",value:function(e){return this._conversationMap.has(e)}},{key:"getLocalOldestMessage",value:function(e){return this._messageListHandler.getLocalOldestMessage(e)}},{key:"syncConversationList",value:function(){var e=this,t=new li("syncConversationList");return this._pagingStatus===on.NOT_START&&this._conversationMap.clear(),this._pagingGetConversationList().then((function(n){return e._pagingStatus=on.RESOLVED,e._diffAndDeleteConversation(),e.emitConversationUpdate(!0,!1),e._setStorageConversationList(),e._handleC2CPeerReadTime(),e._patchConversationProperties(),t.setMessage(e._conversationMap.size).setNetworkType(e.getNetworkType()).end(),n})).catch((function(n){return e._pagingStatus=on.REJECTED,t.setMessage(e._pagingTimeStamp),e.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];t.setError(n,s,a).end()})),Oi(n)}))}},{key:"_diffAndDeleteConversation",value:function(){var e=this;if(this._isSyncCompleted()){var t=[];this._conversationMap.forEach((function(n,o){!e._pagingConvIDMap.has(o)&&e._convIDFromUnreadDBMap.has(o)&&(e._conversationMap.delete(o),t.push(o))})),He.l("".concat(this._n,"._diffAndDeleteConversation list:").concat(t))}}},{key:"_patchConversationProperties",value:function(){var e=this,t=Date.now(),n=this.checkAndPatchRemark(),o=this._messageRemindHandler.getC2CMessageRemindType(),s=this.getModule(Fn).getGroupList();Promise.all([n,o,s]).then((function(){var n=Date.now()-t;He.l("".concat(e._n,"._patchConversationProperties ok. cost ").concat(n," ms")),e.emitConversationUpdate(!0,!1),e.emitTotalUnreadMessageCountUpdate()}))}},{key:"_pagingGetConversationList",value:function(){var e=this,t="".concat(this._n,"._pagingGetConversationList");return He.l("".concat(t," timeStamp:").concat(this._pagingTimeStamp," startIndex:").concat(this._pagingStartIndex)+" pinnedTimeStamp:".concat(this._pagingPinnedTimeStamp," pinnedStartIndex:").concat(this._pagingPinnedStartIndex)),this._pagingStatus=on.PENDING,this.request({protocolName:bo,requestData:{fromAccount:this.getMyUserID(),timeStamp:this._pagingTimeStamp,startIndex:this._pagingStartIndex,pinnedTimeStamp:this._pagingPinnedTimeStamp,pinnedStartIndex:this._pagingPinnedStartIndex,orderType:1}}).then((function(n){var o=n.data,s=o.completeFlag,a=o.conversations,r=void 0===a?[]:a,i=o.timeStamp,u=o.startIndex,c=o.pinnedTimeStamp,l=o.pinnedStartIndex,p=o.groupItem;if(He.l("".concat(t," ok. completeFlag:").concat(s," count:").concat(r.length," isReady:").concat(e._isReady)),e._convGroupHandler.onConvGroupListSynced(p),r.length>0){var d=e._getConversationOptions(r);e._pagingConvIDMap=new Map([].concat(m(e._pagingConvIDMap),m(d.map((function(e){return[e.conversationID,1]}))))),e._updateLocalConversationList({conversationOptionsList:d,isFromGetConversations:!0}),e.isLoggedIn()&&e.emitConversationUpdate()}if(!e._isReady){if(!e.isLoggedIn())return Ni();e.triggerReady()}return e._pagingTimeStamp=i,e._pagingStartIndex=u,e._pagingPinnedTimeStamp=c,e._pagingPinnedStartIndex=l,1!==s?e._pagingGetConversationList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),Ni())})).catch((function(n){throw e.isLoggedIn()&&(e._isReady||(He.w("".concat(t," failed. error:"),n),e.triggerReady())),n}))}},{key:"_updateLocalConversationList",value:function(e){var t,n=e.isFromGetConversations,o=e.isInstantMessage,s=Date.now();t=this._getTmpConversationListMapping(e),this._conversationMap=new Map(this._sortConversationList([].concat(m(t.toBeUpdatedConversationList),m(this._conversationMap)))),n||(this._updateUserOrGroupProfile(t.newConversationList),o&&this.emitTotalUnreadMessageCountUpdate()),He.d("".concat(this._n,"._updateLocalConversationList cost ").concat(Date.now()-s," ms"))}},{key:"_getTmpConversationListMapping",value:function(e){for(var t=e.conversationOptionsList,n=e.isFromGetConversations,o=e.isInstantMessage,s=e.isUnreadC2CMessage,a=void 0!==s&&s,r=e.updateUnreadCount,i=[],u=[],c=this.getModule(Fn),l=this.getModule(xn),p=this.isIntl(),d=0,g=t.length;d0&&s.getUserProfile({userIDList:n}).then((function(e){var n=e.data;it(n)?n.forEach((function(e){t._doUpdateUserProfile("C2C".concat(e.userID),e)})):t._doUpdateUserProfile("C2C".concat(n.userID),n)})),o.length>0&&a.getGroupProfileAdvance({groupIDList:o,responseFilter:{groupBaseInfoFilter:["Type","Name","FaceUrl"]}}).then((function(e){e.data.successGroupList.forEach((function(e){var n="GROUP".concat(e.groupID);if(t._conversationMap.has(n)){var o=t._conversationMap.get(n);ft(o.groupProfile,e,[],[null,void 0,"",0,NaN]),!o.subType&&e.type&&(o.subType=e.type)}}))}))}}},{key:"_doUpdateUserProfile",value:function(e,t){this.hasLocalConversation(e)&&(this.getLocalConversation(e).userProfile=t)}},{key:"_getConversationOptions",value:function(e){var n=this,o=[],s=e.filter((function(e){var t=e.type,n=e.userID;return 1===t&&"@TLS#NOT_FOUND"!==n&&"@TLS#ERROR"!==n||2===t})),a=this.getMyUserID(),r=s.map((function(e){if(ut(e.lastMsg)&&(e.lastMsg={elements:[]}),1===e.type){var s={userID:e.userID,nick:e.peerNick,avatar:e.peerAvatar};return o.push(s),{conversationID:"C2C".concat(e.userID),type:"C2C",lastMessage:{lastTime:e.time,lastSequence:e.sequence,fromAccount:e.lastC2CMsgFromAccount,messageForShow:e.messageShow,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:null,payload:e.lastMsg.elements[0]?n._amendLayersOverLimitProperty(e.lastMsg.elements[0].content):null,cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:8===e.lastMessageFlag,onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:e.lastC2CMsgFromAccount===a&&e.time<=e.c2cPeerReadTime,revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null},userProfile:new Wi(s),peerReadTime:e.c2cPeerReadTime,isPinned:1===e.isPinned,messageRemindType:"",customData:e.customMark||"",markList:Yt(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}return{conversationID:"GROUP".concat(e.groupID),type:"GROUP",lastMessage:t(t({lastTime:e.time,lastSequence:e.messageReadSeq+e.unreadCount,fromAccount:e.msgGroupFromAccount,messageForShow:e.messageShow},n._patchTypeAndPayload(e)),{},{cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:2===e.lastMessageFlag,onlineOnlyFlag:!1,nick:e.senderNick||"",nameCard:e.senderNameCard||"",revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null}),groupProfile:new Ji({groupID:e.groupID,name:e.groupNick,avatar:e.groupImage}),unreadCount:e.unreadCount,peerReadTime:0,isPinned:1===e.isPinned,messageRemindType:"",version:0,customData:e.customMark||"",markList:Yt(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}));o.length>0&&this.getModule(wn).onConversationsProfileUpdated(o);return r}},{key:"_patchTypeAndPayload",value:function(e){var n=e.lastMsg,o=n.event,s=void 0===o?void 0:o,a=n.elements,r=void 0===a?[]:a,i=n.groupTips,u=void 0===i?{}:i;if(!ut(s)&&!Zt(u)){var c=new Si(u);c.setElement({type:S.MSG_GRP_TIP,content:t(t({},u.elements),{},{groupProfile:u.groupProfile})});var l=JSON.parse(JSON.stringify(c.payload));return c=null,{type:S.MSG_GRP_TIP,payload:l}}return{type:r[0]?r[0].type:null,payload:r[0]?this._amendLayersOverLimitProperty(r[0].content):null}}},{key:"_amendLayersOverLimitProperty",value:function(e){var t=e.layersOverLimit;return 0===t?e.layersOverLimit=!1:1===t&&(e.layersOverLimit=!0),e}},{key:"getLocalMessageList",value:function(e){return this._messageListHandler.getLocalMessageList(e)}},{key:"deleteLocalMessage",value:function(e){e instanceof Si&&this._messageListHandler.remove(e)}},{key:"onConversationDeleted",value:function(e){if(it(e)){var t=e.map((function(e){var t=e.type,n=e.userID,o=e.groupID;return 1===t?"".concat(S.CONV_C2C).concat(n):2===t?"".concat(S.CONV_GROUP).concat(o):void 0}));He.l("".concat(this._n,".onConversationDeleted conversationIDList:").concat(t)),this.deleteLocalConversationList(t)}}},{key:"onConversationPinned",value:function(e){var t=this;if(it(e)){var n=!1;e.forEach((function(e){var o,s=e.type,a=e.userID,r=e.groupID;1===s?o=t.getLocalConversation("".concat(S.CONV_C2C).concat(a)):2===s&&(o=t.getLocalConversation("".concat(S.CONV_GROUP).concat(r))),o&&(He.l("".concat(t._n,".onConversationPinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned||(o.isPinned=!0,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"onConversationUnpinned",value:function(e){var t=this;if(it(e)){var n=!1;e.forEach((function(e){var o,s=e.type,a=e.userID,r=e.groupID;1===s?o=t.getLocalConversation("".concat(S.CONV_C2C).concat(a)):2===s&&(o=t.getLocalConversation("".concat(S.CONV_GROUP).concat(r))),o&&(He.l("".concat(t._n,".onConversationUnpinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned&&(o.isPinned=!1,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"getMessageList",value:function(e){var t=this,n=e.conversationID,o=e.nextReqMessageID,s=e.count,a="".concat(this._n,".getMessageList"),r=this.getLocalConversation(n),i="";if(r&&r.groupProfile&&(i=r.groupProfile.type),Lt(i))return He.l("".concat(a," not available in avchatroom. conversationID:").concat(n)),Ni({messageList:[],nextReqMessageID:"",isCompleted:!0});(ut(s)||s>15)&&(s=15),!o&&this._isNotInCommunity(n)&&(this._messageListHandler.removeByConversationID(n),this._completedMap.delete(n),this._roamingMessageSequenceMap.delete(n));var u=this._computeRemainingCount({conversationID:n,nextReqMessageID:o}),c=this._completedMap.has(n);if(He.l("".concat(a," conversationID:").concat(n," nextReqMessageID:").concat(o)+" remainingCount:".concat(u," count:").concat(s," isCompleted:").concat(c)),this._needGetHistory({conversationID:n,remainingCount:u,count:s}))return this.getHistoryMessages({conversationID:n,nextReqMessageID:o,count:20}).then((function(e){var o=e.nextReqID,s=e.storedMessageList,r=t._completedMap.has(n),i=s;u>0&&(i=t._messageListHandler.getLocalMessageList(n).slice(0,s.length+u));var c={nextReqMessageID:r?"":o,messageList:i,isCompleted:r};return He.l("".concat(a," ret.nextReqMessageID:").concat(c.nextReqMessageID," ret.isCompleted:").concat(c.isCompleted," ret.length:").concat(i.length)),Li(c)}));this.modifyMessageList(n);var l=this._getMessageListFromMemory({conversationID:n,nextReqMessageID:o,count:s});return Ni(l)}},{key:"_getMessageListFromMemory",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=e.count,s="".concat(this._n,"._getMessageListFromMemory"),a=this._messageListHandler.getLocalMessageList(t),r=a.length,i=0,u={isCompleted:!1,nextReqMessageID:"",messageList:[]};return n?(i=a.findIndex((function(e){return e.ID===n})))>o?(u.messageList=a.slice(i-o,i),u.nextReqMessageID=a[i-o].ID):(u.messageList=a.slice(0,i),u.isCompleted=!0):r>o?(i=r-o,u.messageList=a.slice(i,r),u.nextReqMessageID=a[i].ID):(u.messageList=a.slice(0,r),u.isCompleted=!0),He.l("".concat(s," conversationID:").concat(t)+" ret.nextReqMessageID:".concat(u.nextReqMessageID," ret.isCompleted:").concat(u.isCompleted," ret.length:").concat(u.messageList.length)),u}},{key:"getMessageListHopping",value:function(e){var t=e.conversationID,n=e.sequence,o=e.time,s=e.count,a=e.direction,r=void 0===a?0:a;if((ut(s)||s>15)&&(s=15),t.startsWith(S.CONV_C2C)){var i=this.getModule(qn),u=t.replace(S.CONV_C2C,"");return i.getRoamingMessagesHopping({peerAccount:u,time:o,count:s,direction:r})}if(t.startsWith(S.CONV_GROUP)){var c=this.getModule(Fn),l=t.replace(S.CONV_GROUP,"");return c.getRoamingMessagesHopping({groupID:l,sequence:n,count:s,direction:r})}}},{key:"_computeRemainingCount",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=this._messageListHandler.getLocalMessageList(t),s=o.length;if(!n)return s;var a=0;return Rt(t)?a=o.findIndex((function(e){return e.ID===n})):Nt(t)&&(a=-1!==n.indexOf("-")?o.findIndex((function(e){return e.ID===n})):o.findIndex((function(e){return e.sequence===n}))),-1===a&&(a=0),a}},{key:"_getMessageListSize",value:function(e){return this._messageListHandler.getLocalMessageList(e).length}},{key:"_needGetHistory",value:function(e){var t=e.conversationID,n=e.remainingCount,o=e.count,s=this.getLocalConversation(t),a="";return s&&s.groupProfile&&(a=s.groupProfile.type),!Ot(t)&&!Lt(a)&&(!(Nt(t)&&this._isPagingGetGroupListCompleted()&&this._getLocalGroupCount()<=4e3&&!this._hasLocalGroup(t)&&!this._isTopicConversation(t))&&(n<=o&&!this._completedMap.has(t)))}},{key:"_isTopicConversation",value:function(e){var t=e.replace(S.CONV_GROUP,"");return At(t)}},{key:"getHistoryMessages",value:function(e){var t=e.conversationID,n=e.count;if(t===S.CONV_SYSTEM)return Ni();var o=15;n>20&&(o=20);var s=null;if(Rt(t)){var a=this._roamingMessageKeyAndTimeMap.has(t);return(s=this.getModule(qn))?s.getRoamingMessage({conversationID:t,peerAccount:t.replace(S.CONV_C2C,""),count:o,lastMessageTime:a?this._roamingMessageKeyAndTimeMap.get(t).lastMessageTime:0,messageKey:a?this._roamingMessageKeyAndTimeMap.get(t).messageKey:""}):Oi({code:Pr})}if(Nt(t)){if(!(s=this.getModule(Fn)))return Oi({code:Pr});var r=null;this._conversationMap.has(t)&&(r=this._conversationMap.get(t).lastMessage);var i=0;r&&(i=r.lastSequence);var u=this._roamingMessageSequenceMap.get(t);return s.getRoamingMessage({conversationID:t,groupID:t.replace(S.CONV_GROUP,""),count:o,sequence:u||i})}return Ni()}},{key:"patchConversationLastMessage",value:function(e){var t=this.getLocalConversation(e);if(t){var n=t.lastMessage,o=n.messageForShow,s=n.payload;if(Zt(o)||Zt(s)){var a=this._messageListHandler.getLocalMessageList(e);if(0===a.length)return;var r=a[a.length-1];He.l("".concat(this._n,".patchConversationLastMessage conversationID:").concat(e," payload:"),r.payload),t.updateLastMessage(r)}}}},{key:"onRoamingMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=n.startsWith(S.CONV_C2C)?S.CONV_C2C:S.CONV_GROUP,a=null,r=[],i=[],u=0,c=e.length,l=null,p=s===S.CONV_GROUP,d=this.getModule(zn),g=this.getFileDownloadProxy(),h=function(){u=p?e.length-1:0,c=p?0:e.length},_=function(){p?--u:++u},f=function(){return p?u>=c:u0&&void 0!==arguments[0]?arguments[0]:{},n="setAllMessageRead",o="".concat(this._n,".").concat(n);t.scope||(t.scope=S.READ_ALL_MSG),He.l("".concat(o," options:"),t);var s=this._createSetAllMessageReadPack(t);if(0===s.readAllC2CMessage&&0===s.groupMessageReadInfoList.length)return Ni();var a=new li(n);return this.request({protocolName:ps,requestData:s}).then((function(n){var o=n.data,s=e._handleAllMessageRead(o);return a.setMessage("scope:".concat(t.scope," failureGroups:").concat(JSON.stringify(s))).setNetworkType(e.getNetworkType()).end(),Ni()})).catch((function(t){return e.probeNetwork().then((function(e){var n=v(e,2),o=n[0],s=n[1];a.setError(t,o,s).end()})),He.w("".concat(o," failed. error:"),t),Oi({code:t&&t.code?t.code:Pa,message:t&&t.message?t.message:void 0})}))}},{key:"setConversationCustomData",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:"markConversation",value:function(e){return this._convGroupHandler.markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:"createConversationGroup",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:"onConversationMarkUpdated",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:"onConversationGroupCreated",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:"onConversationGroupDeleted",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:"onConversationGroupNameUpdated",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:"onConversationInGroupUpdated",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:"onConversationAddedToOrDeletedFromGroup",value:function(e){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e)}},{key:"_getConversationLastMessageSequence",value:function(e){var t=this._messageListHandler.getLocalLastMessage(e.conversationID),n=e.lastMessage.lastSequence;return t&&n0)if(a.type===S.CONV_C2C&&0===n.readAllC2CMessage){if(o===S.READ_ALL_MSG)n.readAllC2CMessage=1;else if(o===S.READ_ALL_C2C_MSG){n.readAllC2CMessage=1;break}}else if(a.type===S.CONV_GROUP&&(o===S.READ_ALL_GROUP_MSG||o===S.READ_ALL_MSG)){var r=this._getConversationLastMessageSequence(a);n.groupMessageReadInfoList.push({groupID:a.groupProfile.groupID,messageSequence:r})}}}catch(i){s.e(i)}finally{s.f()}return n}},{key:"onPushedAllMessageRead",value:function(e){this._handleAllMessageRead(e)}},{key:"_handleAllMessageRead",value:function(e){var t=e.groupMessageReadInfoList,n=e.readAllC2CMessage,o=this._parseGroupReadInfo(t);return this._updateAllConversationUnreadCount({readAllC2CMessage:n})>=1&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate()),o}},{key:"_parseGroupReadInfo",value:function(e){var t=[];if(e&&e.length)for(var n=0,o=e.length;n=1){if(1===n&&i.type===S.CONV_C2C){var u=this._getConversationLastMessageTime(i);this.updateIsReadAfterReadReport({conversationID:r,lastMessageTime:u})}else if(i.type===S.CONV_GROUP){var c=r.replace(S.CONV_GROUP,"");if(this._remoteGroupReadSequenceMap.has(c)){var l=this._remoteGroupReadSequenceMap.get(c),p=this._getConversationLastMessageSequence(i);this.updateIsReadAfterReadReport({conversationID:r,remoteReadSequence:l}),p>=l&&this._remoteGroupReadSequenceMap.delete(c)}}this.updateUnreadCount(r,!1)&&(o+=1)}}}catch(d){s.e(d)}finally{s.f()}return o}},{key:"isRemoteRead",value:function(e){var t=e.conversationID,n=e.sequence,o=t.replace(S.CONV_GROUP,""),s=!1;if(this._remoteGroupReadSequenceMap.has(o)){var a=this._remoteGroupReadSequenceMap.get(o);n<=a&&(s=!0,He.l("".concat(this._n,".isRemoteRead conversationID:").concat(t," messageSequence:").concat(n," remoteReadSequence:").concat(a))),n>=a+10&&this._remoteGroupReadSequenceMap.delete(o)}return s}},{key:"updateIsReadAfterReadReport",value:function(e){var t=e.conversationID,n=e.lastMessageSeq,o=e.lastMessageTime,s=this._messageListHandler.getLocalMessageList(t);if(0!==s.length)for(var a,r=s.length-1;r>=0;r--)if(a=s[r],!(o&&a.time>o||n&&a.sequence>n)){if("in"===a.flow&&a.isRead)break;a.setIsRead(!0)}}},{key:"updateUnreadCount",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!1,o=this.getLocalConversation(e),s=this._messageListHandler.getLocalMessageList(e);if(o){var a=o.unreadCount,r=s.filter((function(e){return!e.isRead&&!e._onlineOnlyFlag&&!e.isDeleted})).length;if(a!==r&&(o.unreadCount=r,n=!0,He.l("".concat(this._n,".updateUnreadCount from ").concat(a," to ").concat(r,", conversationID:").concat(e)),!0===t&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate())),n&&o.type===S.CONV_TOPIC){var i=o.unreadCount,u=this.getModule(Bn),c=e.replace(S.CONV_GROUP,"");u.onConversationProxy({topicID:c,unreadCount:i})}return n}}},{key:"clearGroupAtInfoList",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversation(e);if(n&&n.groupAtInfoList.length>0){if(n.clearGroupAtInfoList(),He.l("".concat(this._n,".clearGroupAtInfoList conversationID:").concat(e)),n.type===S.CONV_TOPIC){var o=n.groupAtInfoList,s=this.getModule(Bn),a=e.replace(S.CONV_GROUP,"");s.onConversationProxy({topicID:a,groupAtInfoList:o})}!0===t&&this.emitConversationUpdate(!0,!1)}}},{key:"updateReadReceiptInfo",value:function(e){var t=this,n=e.userID,o=void 0===n?void 0:n,s=e.groupID,a=void 0===s?void 0:s,r=e.readReceiptList;if(!Zt(r)){var i=[];if(ut(o)){if(!ut(a)){var u="".concat(S.CONV_GROUP).concat(a);r.forEach((function(e){var n=e.tinyID,o=e.clientTime,s=e.random,r=e.readCount,c=e.unreadCount,l="".concat(n,"-").concat(o,"-").concat(s),p=t._messageListHandler.getLocalMessage(u,l),d={groupID:a,messageID:l,readCount:0,unreadCount:0};p&&(ot(r)&&(p.readReceiptInfo.readCount=r,d.readCount=r),ot(c)&&(p.readReceiptInfo.unreadCount=c,d.unreadCount=c),i.push(d))}))}}else{var c="".concat(S.CONV_C2C).concat(o);r.forEach((function(e){var n=e.tinyID,s=e.clientTime,a=e.random,r="".concat(n,"-").concat(s,"-").concat(a),u=t._messageListHandler.getLocalMessage(c,r);if(u){u.readReceiptInfo.isPeerRead=!0;var l={userID:o,messageID:r,isPeerRead:!0};i.push(l)}}))}i.length>0&&this.emitOuterEvent(k.MESSAGE_READ_RECEIPT_RECEIVED,i)}}},{key:"recomputeGroupUnreadCount",value:function(e){var t=e.conversationID,n=e.count,o=this.getLocalConversation(t);if(o){var s=o.unreadCount,a=s-n;a<0&&(a=0),o.unreadCount=a,He.l("".concat(this._n,".recomputeGroupUnreadCount from ").concat(s," to ").concat(a,", conversationID:").concat(t))}}},{key:"updateIsRead",value:function(e){var t=this.getLocalConversation(e),n=this.getLocalMessageList(e);if(t&&0!==n.length&&!Ot(t.type)){for(var o=[],s=0,a=n.length;s0){var n=this._messageListHandler.updateMessageIsPeerReadProperty(e,t);if(n.length>0&&this.emitOuterEvent(k.MESSAGE_READ_BY_PEER,n),this._conversationMap.has(e)){var o=this._conversationMap.get(e).lastMessage;Zt(o)||o.fromAccount===this.getMyUserID()&&o.lastTime<=t&&!o.isPeerRead&&(o.isPeerRead=!0,this.emitConversationUpdate(!0,!1))}}}},{key:"updateMessageIsModifiedProperty",value:function(e){this._messageListHandler.updateMessageIsModifiedProperty(e)}},{key:"setCompleted",value:function(e){He.l("".concat(this._n,".setCompleted. conversationID:").concat(e)),this._completedMap.set(e,!0)}},{key:"updateRoamingMessageKeyAndTime",value:function(e,t,n){this._roamingMessageKeyAndTimeMap.set(e,{messageKey:t,lastMessageTime:n})}},{key:"updateRoamingMessageSequence",value:function(e,t){this._roamingMessageSequenceMap.set(e,t)}},{key:"getConversationList",value:function(e){var t=this,n="getConversationList",o="".concat(this._n,".").concat(n),s="pagingStatus:".concat(this._pagingStatus,", local conversation count:").concat(this._conversationMap.size,", options:").concat(e);if(He.l("".concat(o,". ").concat(s)),this._pagingStatus===on.REJECTED){var a=new li(n);return a.setMessage(s),this.syncConversationList().then((function(){a.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Li({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}if(0===this._conversationMap.size){var r=new li(n);return r.setMessage(s),this.syncConversationList().then((function(){r.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Li({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}var i=this._getConversationList(e);return He.l("".concat(o,". returned conversation count:").concat(i.length)),Ni({conversationList:i,isSyncCompleted:this._isSyncCompleted()})}},{key:"_getConversationList",value:function(e){if(ut(e))return this.getLocalConversationList();if(it(e))return 0===e.length?[]:this.getLocalConversationList().filter((function(t){return e.includes(t.conversationID)}));if(rt(e)){var t=e.type,n=e.markType,o=e.groupName;return this.getLocalConversationList().filter((function(e){return(t!==S.CONV_C2C&&t!==S.CONV_GROUP||e.type===t)&&(!st(o)||e.conversationGroupList.includes(o))&&(!ot(n)||e.markList.includes(n))}))}return[]}},{key:"_handleC2CPeerReadTime",value:function(){var e,t=D(this._conversationMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];s.type===S.CONV_C2C&&(He.d("".concat(this._n,"._handleC2CPeerReadTime conversationID:").concat(o," peerReadTime:").concat(s.peerReadTime)),this.recordPeerReadTime(o,s.peerReadTime))}}catch(a){t.e(a)}finally{t.f()}}},{key:"_isPagingGetGroupListCompleted",value:function(){return this.getModule(Fn).isPagingGetCompleted()}},{key:"_getLocalGroupCount",value:function(){return this.getModule(Fn).getLocalGroupList().length}},{key:"_hasLocalGroup",value:function(e){return this.getModule(Fn).hasLocalGroup(e.replace(S.CONV_GROUP,""))}},{key:"getConversationProfile",value:function(e){var t,n=this;if((t=this._conversationMap.has(e)?this._conversationMap.get(e):new Qi({conversationID:e,type:e.slice(0,3)===S.CONV_C2C?S.CONV_C2C:S.CONV_GROUP},this.isIntl()))._isInfoCompleted||t.type===S.CONV_SYSTEM)return Ni({conversation:t});if(Nt(e)&&!this._hasLocalGroup(e))return Ni({conversation:t});var o="".concat(this._n,".").concat("getConversationProfile"),s=new li("getConversationProfile");return He.l("".concat(o,". conversationID:").concat(e," remark:").concat(t.remark," lastMessage:"),t.lastMessage),this._updateUserOrGroupProfileCompletely(t).then((function(a){s.setNetworkType(n.getNetworkType()).setMessage("conversationID:".concat(e," unreadCount:").concat(a.data.conversation.unreadCount)).end();var r=n.getModule(xn);if(r&&t.type===S.CONV_C2C){var i=e.replace(S.CONV_C2C,"");if(r.isMyFriend(i)){var u=r.getFriendRemark(i);t.remark!==u&&(t.remark=u,He.l("".concat(o,". conversationID:").concat(e," patch remark:").concat(t.remark)))}}return He.l("".concat(o," ok. conversationID:").concat(e)),a})).catch((function(t){return n.probeNetwork().then((function(n){var o=v(n,2),a=o[0],r=o[1];s.setError(t,a,r).setMessage("conversationID:".concat(e)).end()})),He.e("".concat(o," failed. error:"),t),Oi(t)}))}},{key:"_updateUserOrGroupProfileCompletely",value:function(e){var t=this;return e.type===S.CONV_C2C?this.getModule(wn).getUserProfile({userIDList:[e.toAccount]}).then((function(n){var o=n.data;return 0===o.length?Oi(new Ei({code:sr})):(e.userProfile=o[0],e._isInfoCompleted=!0,t._unshiftConversation(e),Ni({conversation:e}))})):this.getModule(Fn).getGroupProfile({groupID:e.toAccount}).then((function(n){return e.groupProfile=n.data.group,e._isInfoCompleted=!0,t._unshiftConversation(e),Ni({conversation:e})}))}},{key:"_unshiftConversation",value:function(e){e instanceof Qi&&!this._conversationMap.has(e.conversationID)&&(this._conversationMap=new Map([[e.conversationID,e]].concat(m(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:"_onProfileUpdated",value:function(e){var t=this;e.data.forEach((function(e){var n=e.userID;if(n===t.getMyUserID())t._onMyProfileModified({latestNick:e.nick,latestAvatar:e.avatar});else{var o=t._conversationMap.get("".concat(S.CONV_C2C).concat(n));o&&(o.userProfile=e)}}))}},{key:"_isSyncCompleted",value:function(){return this._pagingStatus===on.RESOLVED}},{key:"_errorLog",value:function(e,t,n,o){var s=new Error("Params validate failed."),a="".concat(this.getErrorMessage("API_REFER")).concat(e);throw He.w("[".concat(e,"] | ").concat(t," | ").concat(this.getErrorMessage(n,o),", ").concat(a)),He.e("[".concat(e,"] Invalid ").concat(t,": type check failed for ").concat(t,".")),s}},{key:"_isValidConversationID",value:function(e){return Rt(e)||Nt(e)||Ot(e)}},{key:"deleteConversation",value:function(e){var t=this,n="deleteConversation";return st(e)||at(e)||this._errorLog(n,"options","StringOrObjectRequiredLog"),st(e)?(this._isValidConversationID(e)||this._errorLog(n,"options","InvalidConversationID",e),He.l("".concat(this._n,".").concat(n," conversationID:").concat(e)),this.deleteConversationList({conversationIDList:[e],flag:1})):(it(e.conversationIDList)||this._errorLog(n,"conversationIDList","ArrayRequiredLog"),0===e.conversationIDList.length&&this._errorLog(n,"conversationIDList","NonEmptyArrayLog"),e.conversationIDList.forEach((function(e){t._isValidConversationID(e)||t._errorLog(n,"conversationIDList","InvalidConversationID",e)})),"clearHistoryMessage"in e&&"boolean"!=typeof e.clearHistoryMessage&&this._errorLog(n,"clearHistoryMessage","BooleanRequiredLog"),e.conversationIDList.length>100&&(e.conversationIDList=e.conversationIDList.slice(0,100)),this.deleteConversationList(e))}},{key:"deleteConversationList",value:function(e){var t=this,n=e.conversationIDList,o=void 0===n?[]:n,s=e.clearHistoryMessage,a=void 0===s||s,r=e.flag,i=void 0===r?0:r,u="".concat(this._n,".").concat("deleteConversationList");He.l("".concat(u," conversationIDList.length:").concat(o.length," clearHistoryMessage:").concat(a));var c=new li("deleteConversationList");return c.setMessage("conversationIDList:".concat(o)),Promise.all([this.rmLocalOnlyConversationList(o),this.rmLocalAndRemoteConversationList(o,a)]).then((function(e){c.setNetworkType(t.getNetworkType()).end();var n=[].concat(m(e[0]),m(e[1]));return 0===n.length?Oi(new Ei({code:or})):(He.l("".concat(u," ok")),Ni(1===i?{conversationID:n[0]}:{conversationIDList:n}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),He.e("".concat(u," failed. error:"),e),Oi(e)}))}},{key:"rmLocalOnlyConversationList",value:function(e){var t=this;return e.filter((function(e){if(!t._conversationMap.has(e))return!1;var n=t.getLocalConversation(e).type;return n!==S.CONV_GROUP||t._hasLocalGroup(e)?n===S.CONV_SYSTEM&&(t.getModule(Fn).deleteGroupSystemNotice({messageList:t._messageListHandler.getLocalMessageList(e)}),t.deleteLocalConversation(e),!0):(t.deleteLocalConversation(e),!0)}))}},{key:"rmLocalAndRemoteConversationList",value:function(e,t){var n=this,o={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:t?1:0};return e.forEach((function(e){if(n._conversationMap.has(e)){var t=n.getLocalConversation(e).type;t===S.CONV_C2C?o.conversationList.push({toAccount:e.replace(t,""),type:1}):t===S.CONV_GROUP&&n._hasLocalGroup(e)&&o.conversationList.push({toGroupID:e.replace(t,""),type:2})}})),0===o.conversationList.length?[]:this.request({protocolName:qo,requestData:o}).then((function(e){var t=[];return e.data.resultList.length>0&&e.data.resultList.map((function(e){if(0===e.code){var n="".concat(1===e.type?S.CONV_C2C:S.CONV_GROUP).concat(e.to);t.push(n)}})),n.deleteLocalConversationList(t),t}))}},{key:"clearHistoryMessage",value:function(e){var t=this,n={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(e))return Oi({code:or});var o=this._conversationMap.get(e).type;if(o===S.CONV_C2C)n.type=1,n.toAccount=e.replace(S.CONV_C2C,"");else{if(o!==S.CONV_GROUP)return o===S.CONV_SYSTEM?(this.getModule(Fn).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(e)}),Ni({conversationID:e})):Oi({code:ar});n.type=2,n.toGroupID=e.replace(S.CONV_GROUP,"")}var s="".concat(this._n,".").concat("clearHistoryMessage"),a=new li("clearHistoryMessage");return a.setMessage("conversationID:".concat(e)),He.l("".concat(s,". conversationID:").concat(e)),this.setMessageRead({conversationID:e}).then((function(){return t.request({protocolName:Fo,requestData:n})})).then((function(){a.setNetworkType(t.getNetworkType()).end(),He.l("".concat(s," ok")),t._messageListHandler.removeByConversationID(e),t.setCompleted(e);var n=t.getLocalConversation(e);return n&&(n.updateLastMessage(),t._sortConversationListAndEmitEvent()),Ni({conversationID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),He.e("".concat(s," failed. error:"),e),Oi(e)}))}},{key:"pinConversation",value:function(e){var t=this,n=e.conversationID,o=e.isPinned;if(!this._conversationMap.has(n))return Oi({code:or});var s=this.getLocalConversation(n);if(s.isPinned===o)return Ni({conversationID:n});var a="".concat(this._n,".").concat("pinConversation"),r=new li("pinConversation");r.setMessage("conversationID:".concat(n," isPinned:").concat(o)),He.l("".concat(a,". conversationID:").concat(n," isPinned:").concat(o));var i=null;return Rt(n)?i={type:1,toAccount:n.replace(S.CONV_C2C,"")}:Nt(n)&&(i={type:2,groupID:n.replace(S.CONV_GROUP,"")}),this.request({protocolName:xo,requestData:{fromAccount:this.getMyUserID(),operationType:!0===o?1:2,itemList:[i]}}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),He.l("".concat(a," ok")),s.isPinned!==o&&(s.isPinned=o,t._sortConversationListAndEmitEvent()),Li({conversationID:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(a," failed. error:"),e),Oi(e)}))}},{key:"setMessageRemindType",value:function(e){return this._messageRemindHandler.set(e)}},{key:"patchMessageRemindType",value:function(e){var t=e.ID,n=e.isC2CConversation,o=e.messageRemindType,s=!1,a=this.getLocalConversation(n?"".concat(S.CONV_C2C).concat(t):"".concat(S.CONV_GROUP).concat(t));return a&&a.messageRemindType!==o&&(a.messageRemindType=o,s=!0),He.d("".concat(this._n,".patchMessageRemindType options:"),e,"ret:".concat(s)),s}},{key:"onC2CMessageRemindTypeSynced",value:function(e){var t=this,n="".concat(this._n,".onC2CMessageRemindTypeSynced");He.d(n,e),e.dataList.forEach((function(e){if(!Zt(e.muteNotificationsSync)){var o,s=e.muteNotificationsSync,a=s.to,r=s.updateSequence,i=s.muteFlag;t._messageRemindHandler.setUpdateSequence(r),0===i?o=S.MSG_REMIND_ACPT_AND_NOTE:1===i?o=S.MSG_REMIND_DISCARD:2===i&&(o=S.MSG_REMIND_ACPT_NOT_NOTE);var u=0;t.patchMessageRemindType({ID:a,isC2CConversation:!0,messageRemindType:o})&&(u+=1),He.l("".concat(n," updateCount:").concat(u)),u>=1&&t.emitConversationUpdate(!0,!1)}}))}},{key:"onGroupMessageRemindTypeSynced",value:function(e){He.d("".concat(this._n,".onGroupMessageRemindTypeSynced options:"),e),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(e)}},{key:"deleteLocalConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._conversationMap.has(e);if(He.d("".concat(this._n,".deleteLocalConversation conversationID:").concat(e," has:").concat(n)),n&&(this._conversationMap.delete(e),this._roamingMessageKeyAndTimeMap.has(e)&&this._roamingMessageKeyAndTimeMap.delete(e),this._roamingMessageSequenceMap.has(e)&&this._roamingMessageSequenceMap.delete(e),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(e),this._completedMap.delete(e),t)){var o=!this._isTopicConversation(e);this.emitConversationUpdate(o,!1)}}},{key:"deleteLocalConversationList",value:function(e){var t=this,n=0,o=!1;e.forEach((function(e){t._conversationMap.has(e)&&(n+=t._conversationMap.get(e).unreadCount||0,t.deleteLocalConversation(e,!1),o=!0)})),He.l("".concat(this._n,".deleteLocalConversationList conversationIDList.length:").concat(e.length," isConvIDExisted:").concat(o)),o&&(this.emitConversationUpdate(!0,!1),n>0&&this.emitTotalUnreadMessageCountUpdate())}},{key:"isMessageSentByCurrentInstance",value:function(e){return!(!this._messageListHandler.hasLocalMessage(e.conversationID,e.ID)&&!this.singlyLinkedList.has(e.random))}},{key:"modifyMessageList",value:function(e){if(e.startsWith(S.CONV_C2C)&&this._conversationMap.has(e)){var t=this._conversationMap.get(e),n=Date.now();this._messageListHandler.modifyMessageSentByPeer({conversationID:e,latestNick:t.userProfile.nick,latestAvatar:t.userProfile.avatar});var o=this.getModule(wn).getNickAndAvatarByUserID(this.getMyUserID());this._messageListHandler.modifyMessageSentByMe({conversationID:e,latestNick:o.nick,latestAvatar:o.avatar}),He.l("".concat(this._n,".modifyMessageList conversationID:").concat(e," cost ").concat(Date.now()-n," ms"))}}},{key:"updateUserProfileSpecifiedKey",value:function(e){He.l("".concat(this._n,".updateUserProfileSpecifiedKey options:"),e);var t=e.conversationID,n=e.nick,o=e.avatar;if(this._conversationMap.has(t)){var s=this._conversationMap.get(t).userProfile;st(n)&&s.nick!==n&&(s.nick=n),st(o)&&s.avatar!==o&&(s.avatar=o),this.emitConversationUpdate(!0,!1)}}},{key:"_onMyProfileModified",value:function(e){var n=this,o=this.getLocalConversationList(),s=Date.now();o.forEach((function(o){n.modifyMessageSentByMe(t({conversationID:o.conversationID},e))})),He.l("".concat(this._n,"._onMyProfileModified. modify all messages sent by me, cost ").concat(Date.now()-s," ms"))}},{key:"modifyMessageSentByMe",value:function(e){this._messageListHandler.modifyMessageSentByMe(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._messageListHandler.getLatestMessageSentByMe(e)}},{key:"modifyMessageSentByPeer",value:function(e){this._messageListHandler.modifyMessageSentByPeer(e)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._messageListHandler.getLatestMessageSentByPeer(e)}},{key:"pushIntoNoticeResult",value:function(e,t){return!(!this._messageListHandler.pushIn(t)||this.singlyLinkedList.has(t.random))&&(e.push(t),!0)}},{key:"getLocalLastMessage",value:function(e){return this._messageListHandler.getLocalLastMessage(e)}},{key:"checkAndPatchRemark",value:function(){var e=Promise.resolve();if(0===this._conversationMap.size)return e;var t=this.getModule(xn);if(!t)return e;var n=m(this._conversationMap.values()).filter((function(e){return e.type===S.CONV_C2C}));if(0===n.length)return e;var o=0;return n.forEach((function(e){var n=e.conversationID.replace(S.CONV_C2C,"");if(t.isMyFriend(n)){var s=t.getFriendRemark(n);e.remark!==s&&(e.remark=s,o+=1)}})),He.l("".concat(this._n,".checkAndPatchRemark. c2c conversation count:").concat(n.length,", patched count:").concat(o)),e}},{key:"updateTopicConversation",value:function(e){this._updateLocalConversationList({conversationOptionsList:e,isFromGetConversations:!0})}},{key:"sendReadReceipt",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(qn):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(Fn)),n?n.sendReadReceipt(e):Oi({code:Pr})}},{key:"getReadReceiptList",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(qn):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(Fn)),n?n.getReadReceiptList(e):Oi({code:Pr})}},{key:"getLastMessageTime",value:function(e){var t=this.getLocalConversation(e);return t?t.lastMessage.lastTime:0}},{key:"getTotalUnreadMessageCount",value:function(){var e=this.getLocalConversationList(),t=0;return e.forEach((function(e){e.type!==S.CONV_SYSTEM&&(""!==e.messageRemindType&&e.messageRemindType!==S.MSG_REMIND_ACPT_AND_NOTE||(t+=e.unreadCount))})),t}},{key:"emitTotalUnreadMessageCountUpdate",value:function(){var e=this.getTotalUnreadMessageCount();this._convTotalUnreadCount!==e&&(He.l("".concat(this._n,".emitTotalUnreadMessageCountUpdate from ").concat(this._convTotalUnreadCount," to ").concat(e)),this._convTotalUnreadCount=e,this.emitOuterEvent(k.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._pagingStatus=on.NOT_START,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this._convTotalUnreadCount=0,this.resetReady()}}]),s}(po),tu=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupTipsHandler",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map}return a(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupTipsMap.size>0&&this._checkCachedGroupTips()}},{key:"_checkCachedGroupTips",value:function(){var e=this;this._cachedGroupTipsMap.forEach((function(t,n){var o=e._checkCountMap.get(n),s=e._groupModule.hasLocalGroup(n);He.l("".concat(e._n,"._checkCachedGroupTips groupID:").concat(n," hasLocalGroup:").concat(s," checkCount:").concat(o)),s?(e._notifyCachedGroupTips(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"onNewGroupTips",value:function(e){He.d("".concat(this._n,".onReceiveGroupTips count:").concat(e.dataList.length));var t=this.newGroupTipsStoredAndSummary(e),n=t.eventDataList,o=t.result,s=t.AVChatRoomMessageList;(s.length>0&&this._groupModule.onAVChatRoomMessage(s),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(Hn).onNewMessage({conversationOptionsList:n,isInstantMessage:!0}));o.length>0&&(this._groupModule.emitOuterEvent(k.MESSAGE_RECEIVED,o),this.handleMessageList(o))}},{key:"newGroupTipsStoredAndSummary",value:function(e){for(var n=this,o=e.event,s=e.dataList,a=null,r=[],i=[],u={},c=[],l=function(e,l){var p=kt(s[e]);if(6===o){if(n._groupModule.isGroupAttributesUpdatedNotice(p))return"continue";if(n._groupModule.isGroupCountersNotice(p))return"continue"}var d=p.groupProfile,g=d.groupID,h=d.communityType,_=void 0===h?0:h,f=d.topicID,v=void 0===f?void 0:f,m=d.invisible,M=void 0,y=n._groupModule.isMessageFromTopic(_,v);if(y){M=S.CONV_TOPIC,p.to=v;var I=n._groupModule.getModule(Bn);I.hasLocalTopic(g,v)||n._getTopicPendingMap.has(v)||(n._getTopicPendingMap.set(v,1),I.getTopicList({groupID:g,topicIDList:[v]}).finally((function(){n._getTopicPendingMap.delete(v)})))}var C=n._groupModule.hasLocalGroup(g);if(!C&&n._groupModule.isUnjoinedAVChatRoom(g))return"continue";if(!C&&!y)return n._cacheGroupTipsAndProbe({groupID:g,event:o,item:p}),"continue";if(n._groupModule.isMessageFromOrToAVChatroom(g))return p.event=o,c.push(p),"continue";if(p.currentUser=n._groupModule.getMyUserID(),p.conversationType=S.CONV_GROUP,(a=new Si(p)).setElement({type:S.MSG_GRP_TIP,content:t(t({},p.elements),{},{groupProfile:p.groupProfile})}),a.isSystemMessage=!1,1===m)return n._qualityStat(a),"continue";var T=n._groupModule.getModule(Hn),D=a,k=D.conversationID,L=D.sequence;if(6===o)a._onlineOnlyFlag=!0,i.push(a);else if(!T.pushIntoNoticeResult(i,a))return"continue";if(n._groupModule.isMessageFromCommunityOfTopic(_,v))return"continue";if(6===o&&T.getLocalConversation(k))return"continue";6!==o&&n._qualityStat(a);var E=T.isRemoteRead({conversationID:k,sequence:L});if(ut(u[k])){var A=0;"in"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||E||(A=1)),u[k]=r.push({conversationID:k,unreadCount:A,type:ut(M)?a.conversationType:M,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1}else{var R=u[k];r[R].type=a.conversationType,r[R].subType=a.conversationSubType,r[R].lastMessage=a._isExcludedFromLastMessage?"":a,"in"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||E||r[R].unreadCount++)}},p=0,d=s.length;p=0){u.updateSelfInfo({muteTime:p.muteTime}),c=!0;break}}c&&this._groupModule.emitOuterEvent(k.TOPIC_UPDATED,{groupID:i,topic:u})}}},{key:"_onTopicProfileUpdated",value:function(e){var n=e.payload,o=n.groupProfile.groupID,s=n.newTopicInfo;this._groupModule.getModule(Bn).onTopicProfileUpdated(t({groupID:o,topicID:e.to},s))}},{key:"_cacheGroupTips",value:function(e,t){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(t)}},{key:"_deleteCachedGroupTips",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:"_notifyCachedGroupTips",value:function(e){var t=this,n=this._cachedGroupTipsMap.get(e)||[];n.forEach((function(e){t.onNewGroupTips(e)})),this._deleteCachedGroupTips(e),He.l("".concat(this._n,"._notifyCachedGroupTips groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupTipsAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,s=e.item;this._cacheGroupTips(n,{event:o,dataList:[s]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupTips(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupTips(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),He.l("".concat(this._n,"._cacheGroupTipsAndProbe groupID:").concat(n))}},{key:"reset",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear()}}]),e}(),nu=function(){function e(t){o(this,e),this._groupModule=t,this._n="CommonGroupHandler",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map,this._isPagingGetCompleted=!1,t.getInnerEmitterInstance().once(Ui,this._initGroupList,this)}return a(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupMessageMap.size>0&&this._checkCachedGroupMessage()}},{key:"_checkCachedGroupMessage",value:function(){var e=this;this._cachedGroupMessageMap.forEach((function(t,n){var o=e._checkCountMap.get(n),s=e._groupModule.hasLocalGroup(n);He.l("".concat(e._n,"._checkCachedGroupMessage groupID:").concat(n," hasLocalGroup:").concat(s," checkCount:").concat(o)),s?(e._notifyCachedGroupMessage(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"_initGroupList",value:function(){var e=this;He.l("".concat(this._n,"._initGroupList"));var t=new li("getGroupListInStorage"),n=this._groupModule.getStorageGroupList();if(it(n)&&n.length>0){n.forEach((function(t){e._groupModule.initGroupMap(t)})),this._groupModule.emitGroupListUpdate(!0,!1);var o=this._groupModule.getLocalGroupList().length;t.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:".concat(o)).end()}else t.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:0").end();He.l("".concat(this._n,"._initGroupList ok"))}},{key:"handleUpdateGroupLastMessage",value:function(e){var n="".concat(this._n,".handleUpdateGroupLastMessage");if(He.l("".concat(n," conversation count:").concat(e.length,", local group count:").concat(this._groupModule.getLocalGroupList().length)),0!==this._groupModule.getGroupMap().size){for(var o,s,a,r=!1,i=0,u=e.length;i0&&this._groupModule.onAVChatRoomMessage(s),this._groupModule.filterModifiedMessage(o),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(Hn).onNewMessage({conversationOptionsList:n,isInstantMessage:e.isInstantMessage||!0,updateUnreadCount:e.updateUnreadCount||!0}));var a=this._groupModule.filterUnmodifiedMessage(o);a.length>0&&this._groupModule.emitOuterEvent(k.MESSAGE_RECEIVED,a),o.length=0}},{key:"_newGroupMessageStoredAndSummary",value:function(e){var t=this,n=e.dataList,o=e.event,s=e.isInstantMessage,a=null,r=[],i=[],u=[],c={},l=this._groupModule.getModule(zn),p=this._groupModule.getFileDownloadProxy(),d=n.length;d>1&&n.sort((function(e,t){return e.sequence-t.sequence}));for(var g=function(e){var d=kt(n[e]),g=d.groupProfile,h=g.groupID,_=g.communityType,f=void 0===_?0:_,v=g.topicID,m=void 0===v?void 0:v,M=g.invisible,y=void 0,I=t._groupModule.isMessageFromTopic(f,m);if(I){y=S.CONV_TOPIC,d.to=m;var C=t._groupModule.getModule(Bn);C.hasLocalTopic(h,m)||t._getTopicPendingMap.has(m)||(t._getTopicPendingMap.set(m,1),C.getTopicList({groupID:h,topicIDList:[m]}).finally((function(){t._getTopicPendingMap.delete(m)})))}var T=t._groupModule.hasLocalGroup(h);if(!T&&t._groupModule.isUnjoinedAVChatRoom(h))return"continue";if(!T&&!I)return t._cacheGroupMessageAndProbe({groupID:h,event:o,item:d}),"continue";if(t._groupModule.isMessageFromOrToAVChatroom(h))return d.event=o,u.push(d),"continue";if(d.currentUser=t._groupModule.getMyUserID(),d.conversationType=S.CONV_GROUP,d.isSystemMessage=!!d.isSystemMessage,a=new Si(d),d.elements=l.parseElements(d.elements,d.from),a.setElement(d.elements,p),1===M)return t._qualityStat(s,a),"continue";var D=1===n[e].isModified,k=t._groupModule.getModule(Hn);if(k.isMessageSentByCurrentInstance(a)?a.isModified=D:D=!1,1===d.onlineOnlyFlag)a._onlineOnlyFlag=!0,k.isMessageSentByCurrentInstance(a)||i.push(a);else{if(t._groupModule.isMessageFromCommunityOfTopic(f,m))return i.push(a),"continue";if(!k.pushIntoMessageList(i,a,D))return"continue";t._qualityStat(s,a);var L=a,E=L.conversationID,A=L.sequence,R=k.isRemoteRead({conversationID:E,sequence:A});if(ut(c[E])){var N=0;"in"===a.flow&&(a._isExcludedFromUnreadCount||R||(N=1)),c[E]=r.push({conversationID:E,unreadCount:N,type:ut(y)?a.conversationType:y,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1}else{var O=c[E];r[O].type=ut(y)?a.conversationType:y,r[O].subType=a.conversationSubType,r[O].lastMessage=a._isExcludedFromLastMessage?"":a,"in"===a.flow&&(a._isExcludedFromUnreadCount||R||r[O].unreadCount++)}}},h=0;h0&&n.addMessageDelay(t.clientTime)}},{key:"onGroupMessageRevoked",value:function(e){var t=this._groupModule.getModule(Hn),n=[],o=null,s=!0;e.dataList.forEach((function(e){var a=e.elements.revokedInfos;ut(a)||a.forEach((function(e){var a=Zt(e.topicID)?"GROUP".concat(e.groupID):"GROUP".concat(e.topicID);o=t.revoke(a,e.sequence,e.random);var r=e.revokerInfo&&e.revokerInfo.revoker;if(o)o.revoker=r,n.push(o);else{var i={conversationID:a,to:e.topicID||"",sequence:e.sequence,time:e.time,revoker:r};t.isLastMessageRevoked(i)&&(n.push(i),s=!1)}}))})),0!==n.length&&(t.onMessageRevoked(n),!0===s&&(He.l("".concat(this._n,".onGroupMessageRevoked count:").concat(n.length)),this._groupModule.emitOuterEvent(k.MESSAGE_REVOKED,n)))}},{key:"_groupListTreeShaking",value:function(e){for(var t=new Map(m(this._groupModule.getGroupMap())),n=0,o=e.length;ng),_="offset:".concat(u," totalCount:").concat(d," isCompleted:").concat(h," ")+"currentCount:".concat(l.length," isCommunityRelay:").concat(s);return p.setNetworkType(t._groupModule.getNetworkType()).setMessage("".concat(_)).end(),s||h?!s&&h?(He.l("".concat(n," start to get community list")),u=0,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):s&&!h?(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):(He.l("".concat(n," ok. totalCount:").concat(l.length)),Li({groupList:l})):(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l}))})).catch((function(e){return 11e3!==e.code&&t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];p.setMessage("isCommunityRelay:".concat(s)).setError(e,o,a).end()})),s?(11e3===e.code&&(p=null,He.l("".concat(n," ok. community unavailable"))),Ni({groupList:l})):Oi(e)}))}},{key:"_pagingGetGroupListWithTopic",value:function(e){var t=this,n="".concat(this._n,"._pagingGetGroupListWithTopic"),o=e.limit,s=e.offset,a=e.groupBaseInfoFilter,r=e.groupList,i=new li("pagingGetGroupListWithTopic");return this._groupModule.request({protocolName:Xo,requestData:{type:S.GRP_COMMUNITY,memberAccount:this._groupModule.getMyUserID(),limit:o,offset:s,responseFilter:{groupBaseInfoFilter:a,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]},isSupportTopic:1}}).then((function(e){var u=e.data,c=u.groups,l=void 0===c?[]:c,p=u.totalCount;r.push.apply(r,m(l));var d=s+o,g=!(p>d),h="offset:".concat(s," totalCount:").concat(p," isCompleted:").concat(g," ")+"currentCount:".concat(r.length);return i.setNetworkType(t._groupModule.getNetworkType()).setMessage("".concat(h)).end(),g?(He.l("".concat(n," ok. totalCount:").concat(r.length)),Li({groupList:r})):(s=d,t._pagingGetGroupListWithTopic({limit:o,offset:s,groupBaseInfoFilter:a,groupList:r}))})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),Oi(e)}))}},{key:"_cacheGroupMessage",value:function(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}},{key:"_deleteCachedGroupMessage",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:"_notifyCachedGroupMessage",value:function(e){var t=this,n=this._cachedGroupMessageMap.get(e)||[];n.forEach((function(e){t.onNewGroupMessage(e)})),this._deleteCachedGroupMessage(e),He.l("".concat(this._n,"._notifyCachedGroupMessage groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupMessageAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,s=e.item;this._cacheGroupMessage(n,{event:o,dataList:[s]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupMessage(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupMessage(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),He.l("".concat(this._n,"._cacheGroupMessageAndProbe groupID:").concat(n))}},{key:"_handleGroupAtInfoWithoutTopic",value:function(e,n){var o=this;e&&0!==n.length&&n.forEach((function(e){var n=e.groupID,s=e.groupAtInfoList,a=[];ut(s)||(s.forEach((function(e){a.push(t(t({},e),{},{groupID:n}))})),o._groupModule.getModule(Hn).onNewGroupAtTips({dataList:a}))}))}},{key:"reset",value:function(){this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear(),this._isPagingGetCompleted=!1,this._groupModule.getInnerEmitterInstance().once(Ui,this._initGroupList,this)}}]),e}(),ou=1,su=2,au=3,ru=4,iu=5,uu=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupAttributesHandler",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(bi,this._onCloudConfigUpdated,this)}return a(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._groupModule.getCloudConfig("grp_attr_cache_time");ut(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesMap.forEach((function(e){e.localMainSequence=0}))}},{key:"isGroupAttributesUpdatedNotice",value:function(e){var t=e.to,n=e.elements.newGroupProfile,o=!ut(n)&&!Zt(n.groupAttributeOption);return o&&this._onGroupAttributesUpdated({groupID:t,groupAttributeOption:n.groupAttributeOption}),o}},{key:"_onGroupAttributesUpdated",value:function(e){var t=this,n=e.groupID,o=e.groupAttributeOption,s=o.mainSequence,a=o.isWithChangedAttributeInfo,r=o.groupAttributeList,i=void 0===r?[]:r,u=o.operationType;if(He.l("".concat(this._n,".onGroupAttributesUpdated. ")+"groupID:".concat(n," isWithChangedAttributeInfo:").concat(a," operationType:").concat(u)),!ut(u)){this._groupAttributesCopy=this._getCachedAttributes({groupID:n});var c=this._getLocalGroupAttributes(n).localMainSequence;if(1===a&&s-c==1)return this._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:s,groupAttributeList:i,operationType:u}),void this._emitGroupAttributesUpdated(n);if(this._hasLocalGroupAttributes(n)){var l=this._getLocalGroupAttributes(n).avChatRoomKey;this._getGroupAttributes({groupID:n,avChatRoomKey:l}).then((function(){t._emitGroupAttributesUpdated(n)}))}}}},{key:"initGroupAttributesCache",value:function(e){var t=e.groupID,n=e.avChatRoomKey,o=void 0===n?void 0:n;this._groupAttributesMap.set(t,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:o}),He.l("".concat(this._n,".initGroupAttributesCache groupID:").concat(t," avChatRoomKey:").concat(o))}},{key:"initGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,s=this._getLocalGroupAttributes(n),a=s.remoteMainSequence,r=s.avChatRoomKey,i=new li("initGroupAttributes");return i.setMessage("groupID:".concat(n," avChatRoomKey:").concat(r," mainSequence:").concat(a)),this._groupModule.request({protocolName:Ds,requestData:{groupID:n,avChatRoomKey:r,mainSequence:a,groupAttributeList:this._transformGroupAttributes(o)}}).then((function(e){var s=e.data,a=s.mainSequence,r=m(s.groupAttributeList);return r.forEach((function(e){e.value=o[e.key]})),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:a,groupAttributeList:r,operationType:ou}),i.setNetworkType(t._groupModule.getNetworkType()).end(),He.l("".concat(t._n,".").concat("initGroupAttributes"," ok. groupID:").concat(n)),Li({groupAttributes:o})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),Oi(e)}))}},{key:"setGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupAttributes"),o=e.groupID,s=e.groupAttributes,a=this._getLocalGroupAttributes(o),r=a.remoteMainSequence,i=a.avChatRoomKey,u=a.attributes,c=this._transformGroupAttributes(s);c.forEach((function(e){var t=e.key;e.sequence=0,u.has(t)&&(e.sequence=u.get(t).sequence)}));var l=new li("setGroupAttributes");return l.setMessage("groupID:".concat(o," groupAttributes:").concat(JSON.stringify(s))),He.l("".concat(n,". groupID:").concat(o," mainSequence:").concat(r)),this._groupModule.request({protocolName:ks,requestData:{groupID:o,avChatRoomKey:i,mainSequence:r,groupAttributeList:c}}).then((function(e){var a=e.data,r=a.mainSequence,i=m(a.groupAttributeList);return i.forEach((function(e){e.value=s[e.key]})),t._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:r,groupAttributeList:i,operationType:su}),l.setNetworkType(t._groupModule.getNetworkType()).end(),He.l("".concat(n," ok.")),Li({groupAttributes:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),Oi(e)}))}},{key:"deleteGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.keyList,s=void 0===o?[]:o,a=this._getLocalGroupAttributes(n),r=a.remoteMainSequence,i=a.avChatRoomKey,u=a.attributes,c=m(u.keys()),l=Ls,p=au,d={groupID:n,avChatRoomKey:i,mainSequence:r},g=[];s.length>0&&(c=[],l=Ss,p=ru,s.forEach((function(e){var t=0;u.has(e)&&(t=u.get(e).sequence,c.push(e)),g.push({key:e,sequence:t})})),d.groupAttributeList=g);var h=new li("deleteGroupAttributes");return h.setMessage("groupID:".concat(n," mainSequence:").concat(r," keyList:").concat(s," protocolName:").concat(l)),this._groupModule.request({protocolName:l,requestData:d}).then((function(e){var o=e.data.mainSequence;return t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:o,groupAttributeList:g,operationType:p}),h.setNetworkType(t._groupModule.getNetworkType()).end(),He.l("".concat(t._n,".").concat("deleteGroupAttributes"," ok. groupID:").concat(n)),Li({keyList:c})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];h.setError(e,o,s).end()})),Oi(e)}))}},{key:"getGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupAttributes"),o=e.groupID,s=this._getLocalGroupAttributes(o),a=s.avChatRoomKey,r=s.lastUpdateTime,i=s.localMainSequence,u=s.remoteMainSequence,c=new li("getGroupAttributes");if(c.setMessage("groupID:".concat(o," localMainSequence:").concat(i," remoteMainSequence:").concat(u," keyList:").concat(e.keyList)),Date.now()-r>=this.CACHE_EXPIRE_TIME||i0)o.forEach((function(e){a.has(e)&&(s[e]=a.get(e).value)}));else{var r,i=D(a.keys());try{for(i.s();!(r=i.n()).done;){var u=r.value;s[u]=a.get(u).value}}catch(c){i.e(c)}finally{i.f()}}}return s}},{key:"_updateCachedAttributes",value:function(e){var t=e.groupAttributes,n=e.groupAttributeList,o=e.operationType;o!==au?o!==ru?(o===ou&&t.attributes.clear(),n.forEach((function(e){var n=e.key,o=e.value,s=e.sequence;t.attributes.set(n,{value:o,sequence:s})}))):n.forEach((function(e){t.attributes.delete(e.key)})):t.attributes.clear()}},{key:"_hasLocalGroupAttributes",value:function(e){return this._groupAttributesMap.has(e)}},{key:"_getLocalGroupAttributes",value:function(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}},{key:"_transformGroupAttributes",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_emitGroupAttributesUpdated",value:function(e){var t=this._getCachedAttributes({groupID:e}),n=this._computeAttrChangedInfo(t),o=n.updatedKeyList,s=n.deletedKeyList;this._groupModule.emitOuterEvent(k.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:t,updatedKeyList:o,deletedKeyList:s})}},{key:"_computeAttrChangedInfo",value:function(e){var t=this,n=[],o=[];return Object.keys(e).forEach((function(o){e[o]!==t._groupAttributesCopy[o]&&n.push(o)})),Object.keys(this._groupAttributesCopy).forEach((function(t){ut(e[t])&&o.push(t)})),this._groupAttributesCopy={},He.l("".concat(this._n,"._computeAttrChangedInfo update count:").concat(n.length,", delete count:").concat(o.length)),{updatedKeyList:n,deletedKeyList:o}}},{key:"deleteLocalGroupAttributes",value:function(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}},{key:"reset",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),e}(),cu="Set",lu="Increase",pu="Decrease",du=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupCountersHandler",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(bi,this._onCloudConfigUpdated,this)}return a(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._groupModule.getCloudConfig("grp_counter_expire_time");ut(e)||(this.EXPIRE_TIME=Number(e))}},{key:"isGroupCountersNotice",value:function(e){var t=e.to,n=e.elements.groupCounterInfo,o=!1;return Zt(n)||(this._onGroupCountersUpdated({groupID:t,groupCounterInfo:n}),o=!0),o}},{key:"_onGroupCountersUpdated",value:function(e){var t=this,n=e.groupID;e.groupCounterInfo.forEach((function(e){var o=e.type,s=e.groupCounterSeq,a=e.counterList,r=void 0===a?[]:a;0!==o&&2!==o||(t._updateLocalGroupCounters({groupID:n,groupCounterSeq:s,counterList:r}),r.forEach((function(e){t._groupModule.emitOuterEvent(k.GROUP_COUNTER_UPDATED,{groupID:n,key:e.key,value:e.value})}))),1===o&&t._deleteLocalGroupCounters({groupID:n,groupCounterSeq:s,counterList:r})})),He.l("".concat(this._n,"._onGroupCountersUpdated groupID:").concat(n))}},{key:"initGroupCountersCache",value:function(e){var t=e.groupID,n=e.avChatRoomKey;this._groupCountersMap.set(t,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:n}),He.l("".concat(this._n,".initGroupCountersCache groupID:").concat(t," avChatRoomKey:").concat(n))}},{key:"setGroupCounters",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Oi({code:Kr});var n="".concat(this._n,".setGroupCounters"),o=e.groupID,s=e.counters,a=this._convertObjectToList(s),r=this._getLocalGroupCounters(o).avChatRoomKey,i="groupID:".concat(o," count:").concat(a.length),u=new li("setGroupCounters");return u.setMessage("".concat(i)),He.l("".concat(n,". ").concat(i)),this._updateGroupCounters({groupID:o,counterList:a,avChatRoomKey:r,mode:cu}).then((function(e){return u.end(),He.l("".concat(n," ok.")),Li({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"increaseGroupCounter",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Oi({code:Kr});var n="".concat(this._n,".increaseGroupCounters"),o=e.groupID,s=e.key,a=e.value,r=this._getLocalGroupCounters(o).avChatRoomKey,i="groupID:".concat(o," key:").concat(s," value:").concat(a),u=new li("increaseGroupCounter");u.setMessage("".concat(i)),He.l("".concat(n,". ").concat(i));var c=[{key:s,value:a}];return this._updateGroupCounters({groupID:o,counterList:c,avChatRoomKey:r,mode:lu}).then((function(e){return u.end(),He.l("".concat(n," ok.")),Li({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"decreaseGroupCounter",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Oi({code:Kr});var n="".concat(this._n,".decreaseGroupCounter"),o=e.groupID,s=e.key,a=e.value,r=this._getLocalGroupCounters(o).avChatRoomKey,i="groupID:".concat(o," key:").concat(s," value:").concat(a),u=new li("decreaseGroupCounter");u.setMessage("".concat(i)),He.l("".concat(n,". ").concat(i));var c=[{key:s,value:a}];return this._updateGroupCounters({groupID:o,counterList:c,avChatRoomKey:r,mode:pu}).then((function(e){return u.end(),He.l("".concat(n," ok.")),Li({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"getGroupCounters",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Oi({code:Kr});var n="".concat(this._n,".getGroupCounters"),o=e.groupID,s=e.keyList,a=void 0===s?[]:s,r=this._getLocalGroupCounters(o),i=r.avChatRoomKey,u=r.lastUpdateTime,c=new li("getGroupCounters");if(c.setMessage("groupID:".concat(o)),Date.now()-u>=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:o,avChatRoomKey:i}).then((function(e){c.setMoreMessage("from remote. count:".concat(e.length)).end(),He.l("".concat(n," from remote. groupID:").concat(o));var s=t._getLocalCounters(o,a);return Li({counters:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),Oi(e)}));c.setMoreMessage("from cache").end(),He.l("".concat(n," from cache. groupID:").concat(o));var l=this._getLocalCounters(o,a);return Ni({counters:l})}},{key:"_getRemoteGroupCounters",value:function(e){var n=this;return this._groupModule.request({protocolName:Gs,requestData:t({},e)}).then((function(t){var o=t.data,s=o.counterList,a=void 0===s?[]:s,r=o.groupCounterSeq;return n._updateLocalGroupCounters({groupID:e.groupID,counterList:a,groupCounterSeq:r}),He.l("".concat(n._n,"._getRemoteGroupCounters ok. groupID:").concat(e.groupID)),a})).catch((function(e){return Oi(e)}))}},{key:"_convertObjectToList",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_updateGroupCounters",value:function(e){var n="".concat(this._n,"._updateGroupCounters"),o=e.groupID,s=e.avChatRoomKey,a=e.mode;return He.l("".concat(n,". groupID:").concat(o," avChatRoomKey:").concat(s," mode:").concat(a)),this._groupModule.request({protocolName:Os,requestData:t({},e)}).then((function(e){He.l("".concat(n," ok."));var t=e.data.counterList,o={};return(void 0===t?[]:t).forEach((function(e){var t=e.key,n=e.value;o[t]=n})),o})).catch((function(e){return Oi(e)}))}},{key:"_hasLocalGroupCounters",value:function(e){return this._groupCountersMap.has(e)}},{key:"_getLocalGroupCounters",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:"_updateLocalGroupCounters",value:function(e){var t=e.groupID,n=e.counterList,o=void 0===n?[]:n,s=e.groupCounterSeq;if(this._hasLocalGroupCounters(t)){var a=this._getLocalGroupCounters(t),r=a.counters,i=a.avChatRoomKey,u=a.groupCounterSeq;if(s>0&&s0)t.forEach((function(e){o.has(e)&&(n[e]=o.get(e))}));else{var s,a=D(o.keys());try{for(a.s();!(s=a.n()).done;){var r=s.value;n[r]=o.get(r)}}catch(i){a.e(i)}finally{a.f()}}return n}},{key:"reset",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),e}(),gu=function(){function e(t){o(this,e);var n=t.manager,s=t.groupID,a=t.onInit,r=t.onSuccess,i=t.onFail;this._n="Polling",this._manager=n,this._groupModule=n._groupModule,this._onInit=a,this._onSuccess=r,this._onFail=i,this._groupID=s,this._timeoutID=-1,this._isRunning=!1,this._protocolName=Ms}return a(e,[{key:"start",value:function(){var e=this._groupModule.isLoggedIn();e||(this._protocolName=ys),He.l("".concat(this._n,".start pollingInterval:").concat(this._manager.getPollingInterval()," isLoggedIn:").concat(e)),this._isRunning=!0,this._request()}},{key:"isRunning",value:function(){return this._isRunning}},{key:"_request",value:function(){var e=this,t=this._onInit(this._groupID);this._groupModule.request({protocolName:this._protocolName,requestData:t}).then((function(t){e._onSuccess(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))})).catch((function(t){e._onFail(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))}))}},{key:"stop",value:function(){He.l("".concat(this._n,".stop")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}}]),e}(),hu={3:!0,4:!0,5:!0,6:!0,17:!0},_u=function(){function e(t){o(this,e),this._groupModule=t,this._n="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new Yi(200),this.messageIDLinkedList=new Yi(100),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._onlineMemberCountMap=new Map,this.DEFAULT_EXPIRE_TIME=60,this.DEFAULT_POLLING_INTERVAL=300,this.MAX_POLLING_INTERVAL=2e3,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0,this._startBroadcastSeq=1,this._broadcastMessageIDMap=new Map,this.DEFAULT_POLLING_SIMPLIFIED_MSG=0}return a(e,[{key:"hasJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._joinedGroupMap.has(e)}},{key:"getJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0?m(this._joinedGroupMap.keys()):null}},{key:"_updateRequestData",value:function(e){var n=this._pollingRequestInfoMap.get(e);return e===m(this._pollingInstanceMap.keys())[0]?t(t({},n),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):t(t({},n),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:"_handleSuccess",value:function(e,t){var n=t.data,o=n.key,s=n.nextSeq,a=n.rspMsgList,r=n.errorCode,i=n.nextBroadcastSeq,u=n.broadcastMessageList;if(0!==r){var c=this._pollingRequestInfoMap.get(e),l=new li("longPollingAVError"),p=c?"".concat(c.key,"-").concat(c.startSeq):"requestInfo is undefined";l.setMessage("".concat(e,"-").concat(p,"-").concat(t.errorInfo)).setCode(t.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(e))return;st(o)&&ot(s)&&this._pollingRequestInfoMap.set(e,{key:o,startSeq:s}),ot(i)&&i>this._startBroadcastSeq&&(this._startBroadcastSeq=i),it(a)&&a.length>0?(a.forEach((function(e){e.to=e.groupID})),this.onMessage(a)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(u)}}},{key:"_handleFailure",value:function(e,t){}},{key:"onMessage",value:function(e){if(it(e)&&0!==e.length){0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var t=null,n=[],o=this._getModule(Hn),s=this._getModule(so),a=e.length;a>1&&e.sort((function(e,t){return e.sequence-t.sequence}));for(var r=this._getModule(Kn),i=0;i1&&g<=20?this._getModule(eo).onMessageMaybeLost(p,d+1,g-1):g<-1&&g>=-20&&this._getModule(eo).onMessageMaybeLost(p,t.sequence+1,Math.abs(g)-1)}this.sequencesLinkedList.set(t.sequence),this.messageIDLinkedList.set(t.ID);var h=!1;if(this._isMessageSentByCurrentInstance(t)?c&&(h=!0,t.isModified=c,o.updateMessageIsModifiedProperty(t)):h=!0,h){if(t.conversationType===S.CONV_SYSTEM&&5===t.payload.operationType&&this._onGroupDismissed(t.payload.groupProfile.groupID),!l&&t.conversationType!==S.CONV_SYSTEM){var _=t.conversationID.replace(S.CONV_GROUP,"");this._pollingInstanceMap.has(_)?this._groupModule.isLoggedIn()&&s.addMessageSequence({key:ai,message:t}):(t.type!==S.MSG_GRP_TIP&&t.clientTime>0&&s.addMessageDelay(t.clientTime),s.addMessageSequence({key:si,message:t}))}n.push(t)}}}else He.w("".concat(this._n,".onMessage unknown event:").concat(u.event))}if(0!==n.length){this._groupModule.filterModifiedMessage(n);var f=this.packConversationOption(n);if(f.length>0)this._getModule(Hn).onNewMessage({conversationOptionsList:f,isInstantMessage:!0});He.d("".concat(this._n,".onMessage count:").concat(n.length)),this._checkMessageStacked(n);var v=this._groupModule.filterUnmodifiedMessage(n);v.length>0&&this._groupModule.emitOuterEvent(k.MESSAGE_RECEIVED,v),n.length=0}}}},{key:"isBroadcastOrNormal",value:function(e){return 3===e||17===e}},{key:"isGroupTip",value:function(e){return 4===e||6===e}},{key:"isGroupSystemNotice",value:function(e){return 5===e}},{key:"restoreGroupTipElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.groupJoinType||(e.groupJoinType=1);var t=e.operatorInfo,n=void 0===t?{}:t,o=e.operatorID,s=e.userIDList,a=void 0===s?[]:s,r=n.userID,i=void 0===r?o:r,u=n.avatar,c=void 0===u?"":u,l=n.nick,p=void 0===l?"":l;e.operatorInfo={userID:i,avatar:c,nick:p};var d=a.map((function(e){return{userID:e}}));return e.memberInfoList=e.memberInfoList||d,e}},{key:"restoreMessageFromSimplified",value:function(e){var n=e.event;if(this.isBroadcastOrNormal(n)&&(e.cloudCustomData=e.cloudCustomData||"",e.elements=e.elements.map((function(e){if(e.type===S.MSG_CUSTOM){var n=e.content,o=void 0===n?{}:n;e.content=t({data:"",description:"",extension:""},o)}return e}))),(this.isGroupTip(n)||this.isGroupSystemNotice(n))&&(e.from=e.from||"@TIM#SYSTEM"),this.isGroupTip(n)){e.elements=this.restoreGroupTipElements(e.elements);var o=e.elements,s=void 0===o?{}:o,a=s.operationType,i=s.operatorInfo;if(1===a){var u=[{userID:(void 0===i?{}:i).userID}];s.memberInfoList=s.memberInfoList||u}}if(this.isGroupSystemNotice(n)){var c=e.elements,l=c.memberInfoList,p=c.operatorInfo;l||(l=void 0===p?{}:p),e.elements.memberInfoList=t({userID:e.elements.operatorID,avatar:"",nick:""},l),e.elements=t({authentication:"",remarkInfo:"",messageKey:1e3*e.time},e.elements);var d=Object.keys(e.elements).filter((function(e){return"operatorInfo"!==e})).reduce((function(n,o){return t(t({},n),{},r({},o,e.elements[o]))}),{});e.elements=d}return e}},{key:"_onGroupDismissed",value:function(e){He.l("".concat(this._n,"._onGroupDismissed groupID:").concat(e)),this._groupModule.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"_checkMessageStacked",value:function(e){var t="MessageStacked",n=e.length;n>=100&&(this._groupModule.outputWarning(t),this._reportMessageStackedCount<5&&(new li(t).setNetworkType(this._groupModule.getNetworkType()).setMessage("count:".concat(n," groupID:").concat(m(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1))}},{key:"_isMessageSentByCurrentInstance",value:function(e){return!!this._getModule(Hn).isMessageSentByCurrentInstance(e)}},{key:"packMessage",value:function(e,t){e.currentUser=this._groupModule.getMyUserID(),e.conversationType=5===t?S.CONV_SYSTEM:S.CONV_GROUP,e.isSystemMessage=!!e.isSystemMessage;var n=new Si(e),o=this.packElements(e,t);return n.setElement(o,this._groupModule.getFileDownloadProxy()),n}},{key:"packElements",value:function(e,n){return 4===n||6===n?(this._updateMemberCountByGroupTips(e),{type:S.MSG_GRP_TIP,content:t(t({},e.elements),{},{groupProfile:e.groupProfile})}):5===n?{type:S.MSG_GRP_SYS_NOTICE,content:t(t({},e.elements),{},{groupProfile:t(t({},e.groupProfile),{},{groupID:e.groupID})})}:this._getModule(zn).parseElements(e.elements,e.from)}},{key:"packConversationOption",value:function(e){for(var t=new Map,n=0;n0&&this._groupModule.emitOuterEvent(k.MESSAGE_RECEIVED,t)}}},{key:"start",value:function(e){if(this._pollingInstanceMap.has(e)){var t=this._pollingInstanceMap.get(e);t.isRunning()||t.start()}else{var n=new gu({manager:this,groupID:e,onInit:this._updateRequestData.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)});n.start(),this._pollingInstanceMap.set(e,n),He.l("".concat(this._n,".start groupID:").concat(e))}}},{key:"handleJoinResult",value:function(e){var t=this;return this._preCheck().then((function(){var n=e.longPollingKey,o=e.group,s=o.groupID;return t._joinedGroupMap.set(s,o),t._groupModule.updateGroupMap([o]),t._groupModule.deleteUnjoinedAVChatRoom(s),t._groupModule.emitGroupListUpdate(!0,!1),ut(n)?Ni({status:Je,group:o}):Promise.resolve()}))}},{key:"startRunLoop",value:function(e){var t=this;return this.handleJoinResult(e).then((function(){var n=e.longPollingKey,o=e.group,s=e.startSeq,a=void 0===s?0:s,r=o.groupID;return t._pollingRequestInfoMap.set(r,{key:n,startSeq:a}),t.start(r),t._groupModule.isLoggedIn()?Ni({status:Je,group:o}):Ni({status:Je})}))}},{key:"_preCheck",value:function(){if(this._getModule(Kn).isUnlimitedAVChatRoom())return Promise.resolve();if(!this.hasJoinedAVChatRoom())return Promise.resolve();var e=v(this._joinedGroupMap.entries().next().value,2),t=e[0],n=e[1];if(this._groupModule.isLoggedIn()){if(!(n.selfInfo.role===S.GRP_MBR_ROLE_OWNER||n.ownerID===this._groupModule.getMyUserID()))return this._groupModule.quitGroup(t);this._groupModule.deleteLocalGroupAndConversation(t)}else this._groupModule.deleteLocalGroupAndConversation(t);return this.reset(t),Promise.resolve()}},{key:"joinWithoutAuth",value:function(e){var t=this,n=e.groupID,o="".concat(this._n,".").concat("joinWithoutAuth"),s=new li("joinWithoutAuth");return this._groupModule.request({protocolName:ns,requestData:e}).then((function(e){var a=e.data.longPollingKey;if(t._groupModule.probeNetwork().then((function(e){var t=v(e,2),o=(t[0],t[1]);s.setNetworkType(o).setMessage("groupID:".concat(n," longPollingKey:").concat(a)).end(!0)})),ut(a))return Oi({code:vr});He.l("".concat(o," ok. groupID:").concat(n)),t._getModule(Hn).setCompleted("".concat(S.CONV_GROUP).concat(n));var r=new Ji({groupID:n});return t.startRunLoop({group:r,longPollingKey:a}),Li({status:Je})})).catch((function(e){return He.e("".concat(o," failed. groupID:").concat(n," error:"),e),t._groupModule.probeNetwork().then((function(t){var o=v(t,2),a=o[0],r=o[1];s.setError(e,a,r).setMessage("groupID:".concat(n)).end(!0)})),Oi(e)})).finally((function(){t._groupModule.getModule(jn).reportAtOnce()}))}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._onlineMemberCountMap.get(e)||{},n=Date.now();return Zt(t)||n-t.lastSyncTime>1e3*t.expireTime&&n-t.latestUpdateTime>1e4&&n-t.lastReqTime>3e3?(t.lastReqTime=n,this._onlineMemberCountMap.set(e,t),this._getGroupOnlineMemberCount(e).then((function(e){return Li({memberCount:e.memberCount})})).catch((function(e){return Oi(e)}))):Ni({memberCount:t.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(e){var t=this,n="".concat(this._n,".").concat("_getGroupOnlineMemberCount");return this._groupModule.request({protocolName:Is,requestData:{groupID:e}}).then((function(o){var s=t._onlineMemberCountMap.get(e)||{},a=o.data,r=a.onlineMemberNum,i=void 0===r?0:r,u=a.expireTime,c=void 0===u?t.DEFAULT_EXPIRE_TIME:u;He.l("".concat(n," ok. groupID:").concat(e," memberCount:").concat(i," expireTime:").concat(c));var l=Date.now();return Zt(s)&&(s.lastReqTime=l),t._onlineMemberCountMap.set(e,Object.assign(s,{lastSyncTime:l,latestUpdateTime:l,memberCount:i,expireTime:c})),{memberCount:i}})).catch((function(o){return He.w("".concat(n," failed. error:"),o),new li("_getGroupOnlineMemberCount").setCode(o.code).setMessage("groupID:".concat(e," error:").concat(JSON.stringify(o))).setNetworkType(t._groupModule.getNetworkType()).end(),Promise.reject(o)}))}},{key:"_getModule",value:function(e){return this._groupModule.getModule(e)}},{key:"setPollingInterval",value:function(e){ut(e)||(ot(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:"setPollingIntervalPlus",value:function(e){ut(e)||(ot(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:"setPollingNoMessageCount",value:function(e){ut(e)||(ot(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:"setPollingSimplifiedMessage",value:function(e){ut(e)||"0"!==e&&"1"!==e||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}},{key:"getPollingInterval",value:function(){return this._pollingInterval}},{key:"onAVChatRoomMemberBanned",value:function(e){var t=e.payload.groupProfile.groupID;He.l("".concat(this._n,".onAVChatRoomMemberBanned groupID:").concat(t)),this._groupModule.deleteLocalGroupAndConversation(t),this.reset(t)}},{key:"restartPolling",value:function(){He.l("".concat(this._n,".restartPolling count:").concat(this._pollingInstanceMap.size));var e,t=D(this._pollingInstanceMap.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.stop(),n.start()}}catch(o){t.e(o)}finally{t.f()}}},{key:"reset",value:function(e){if(e){He.l("".concat(this._n,".reset groupID:").concat(e));var t=this._pollingInstanceMap.get(e);t&&t.stop(),this._pollingInstanceMap.delete(e),this._joinedGroupMap.delete(e),this._pollingRequestInfoMap.delete(e),this._onlineMemberCountMap.delete(e)}else{He.l("".concat(this._n,".reset all"));var n,o=D(this._pollingInstanceMap.values());try{for(o.s();!(n=o.n()).done;){n.value.stop()}}catch(s){o.e(s)}finally{o.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.reset(),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=300,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0}}]),e}(),fu=1,vu=15,mu=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupSystemNoticeHandler",this.pendencyMap=new Map}return a(e,[{key:"onNewGroupSystemNotice",value:function(e){var t=e.dataList,n=e.isSyncingEnded,o=e.isInstantMessage;He.d("".concat(this._n,".onReceiveSystemNotice count:").concat(t.length));var s=this.newSystemNoticeStoredAndSummary({notifiesList:t,isInstantMessage:o}),a=s.eventDataList,r=s.result;a.length>0&&(this._groupModule.getModule(Hn).onNewMessage({conversationOptionsList:a,isInstantMessage:o}),this._onReceivedGroupSystemNotice({result:r,isInstantMessage:o}));o?r.length>0&&this._groupModule.emitOuterEvent(k.MESSAGE_RECEIVED,r):!0===n&&this._clearGroupSystemNotice()}},{key:"newSystemNoticeStoredAndSummary",value:function(e){var n=e.notifiesList,o=e.isInstantMessage,s=null,a=n.length,r=0,i=[],u={conversationID:S.CONV_SYSTEM,unreadCount:0,type:S.CONV_SYSTEM,subType:null,lastMessage:null};for(r=0;r0?[u]:[],result:i}}},{key:"_clearGroupSystemNotice",value:function(){var e=this;this._getPendencyList().then((function(t){t.forEach((function(t){e.pendencyMap.set("".concat(t.from,"_").concat(t.groupID,"_").concat(t.to),t)}));var n=e._groupModule.getModule(Hn).getLocalMessageList(S.CONV_SYSTEM),o=[];n.forEach((function(t){var n=t.payload,s=n.operatorID,a=n.operationType,r=n.groupProfile;if(a===fu){var i="".concat(s,"_").concat(r.groupID,"_").concat(r.to),u=e.pendencyMap.get(i);u&&ot(u.handled)&&0!==u.handled&&o.push(t)}})),e.deleteGroupSystemNotice({messageList:o})}))}},{key:"deleteGroupSystemNotice",value:function(e){var t=this,n="".concat(this._n,".deleteGroupSystemNotice");return it(e.messageList)&&0!==e.messageList.length?(He.l("".concat(n," ")+e.messageList.map((function(e){return e.ID}))),this._groupModule.request({protocolName:ms,requestData:{messageListToDelete:e.messageList.map((function(e){return{from:S.CONV_SYSTEM,messageSeq:e.clientSequence,messageRandom:e.random}}))}}).then((function(){He.l("".concat(n," ok"));var o=t._groupModule.getModule(Hn);return e.messageList.forEach((function(e){o.deleteLocalMessage(e)})),Li()})).catch((function(e){return He.e("".concat(n," error:"),e),Oi(e)}))):Ni()}},{key:"_getPendencyList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,o=void 0===n?void 0:n,s=t.startTime,a=void 0===s?0:s,r=t.limit,i=void 0===r?20:r;return this._groupModule.request({protocolName:vs,requestData:{type:o,startTime:a,limit:i,handleAccount:this._groupModule.getMyUserID()}}).then((function(t){var n=t.data.pendencyList;return 0!==t.data.nextStartTime?e._getPendencyList({startTime:t.data.nextStartTime}).then((function(e){return[].concat(m(n),m(e))})):n}))}},{key:"getGroupApplicationList",value:function(){var e=this;return this._getPendencyList().then((function(t){return e._getPendencyList({type:S.GRP_COMMUNITY}).then((function(n){return t.push.apply(t,m(n)),e._handlePendencyResult(t)})).catch((function(n){return e._handlePendencyResult(t)}))}))}},{key:"_handlePendencyResult",value:function(e){var t=this,n=[];return e.forEach((function(e){t.pendencyMap.set("".concat(e.from,"_").concat(e.groupID,"_").concat(e.to),e),0===e.handled&&n.push({applicant:e.from,applicantNick:e.fromUserNickName,groupName:e.groupName,groupID:e.groupID,authentication:e.authentication,messageKey:e.time,applicationType:e.applicationType,userID:e.userID})})),Ni({applicationList:n})}},{key:"_onReceivedGroupSystemNotice",value:function(e){var t=this,n=e.result;e.isInstantMessage&&n.forEach((function(e){switch(e.payload.operationType){case 1:break;case 2:t._onApplyGroupRequestAgreed(e);break;case 3:break;case 4:t._onMemberKicked(e);break;case 5:t._onGroupDismissed(e);break;case 6:break;case 7:t._onInviteGroup(e);break;case 8:t._onQuitGroup(e);break;case 9:t._onSetManager(e);break;case 10:t._onDeleteManager(e);break;case 11:case 12:case 15:break;case 20:t._onMessageRemindTypeSynced(e);break;case 21:t._groupModule.onAVChatRoomMemberBanned(e)}}))}},{key:"_onApplyGroupRequestAgreed",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;if(n){t._groupModule.updateGroupMap([n]);var o=!n.isSupportTopic;t._groupModule.emitGroupListUpdate(!0,o)}}))}},{key:"_onMemberKicked",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onGroupDismissed",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t);var n=this._groupModule._AVChatRoomHandler;n&&n.checkJoinedAVChatRoomByID(t)&&n.reset(t)}},{key:"_onInviteGroup",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;n&&(t._groupModule.updateGroupMap([n]),t._groupModule.emitGroupListUpdate())}))}},{key:"_onQuitGroup",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onSetManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,s=this._groupModule.getModule(Vn).getLocalGroupMemberInfo(o,n);s&&s.updateRole(S.GRP_MBR_ROLE_ADMIN)}},{key:"_onDeleteManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,s=this._groupModule.getModule(Vn).getLocalGroupMemberInfo(o,n);s&&s.updateRole(S.GRP_MBR_ROLE_MEMBER)}},{key:"_onMessageRemindTypeSynced",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.messageRemindType;this._groupModule.getModule(Hn).onGroupMessageRemindTypeSynced({groupID:t,messageRemindType:n})}},{key:"_handleTopicSystemNotice",value:function(e){var t=e.groupProfile,n=t.groupID,o=t.topicID,s=e.elements,a=s.operationType,r=s.topicIDList,i=s.messageRemindType,u=this._groupModule.getModule(Bn);17===a?u.onTopicCreated({groupID:n,topicID:o}):18===a?u.onTopicDeleted({groupID:n,topicIDList:r}):20===a&&u.onTopicMessageRemindTypeUpdated({groupID:n,topicID:o,messageRemindType:i})}},{key:"reset",value:function(){this.pendencyMap.clear()}}]),e}(),Mu=["relayFlag"],yu=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="GroupModule",t._commonGroupHandler=null,t._AVChatRoomHandler=null,t._groupSystemNoticeHandler=null,t._commonGroupHandler=new nu(h(t)),t._groupAttributesHandler=new uu(h(t)),t._groupCountersHandler=new du(h(t)),t._AVChatRoomHandler=new _u(h(t)),t._groupTipsHandler=new tu(h(t)),t._groupSystemNoticeHandler=new mu(h(t)),t.groupMap=new Map,t._unjoinedAVChatRoomList=new Map,t._receiptDetailCompleteMap=new Map,t.getInnerEmitterInstance().on(bi,t._onCloudConfigUpdated,h(t)),t}return a(s,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("polling_interval"),t=this.getCloudConfig("polling_interval_plus"),n=this.getCloudConfig("polling_no_msg_count"),o=this.getCloudConfig("polling_simplified_msg");this._AVChatRoomHandler&&(He.l("".concat(this._n,"._onCloudConfigUpdated pollingInterval:").concat(e)+" pollingIntervalPlus:".concat(t," pollingNoMessageCount:").concat(n)+" pollingSimplifiedMessage:".concat(o)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(n),this._AVChatRoomHandler.setPollingSimplifiedMessage(o))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:"guardForAVChatRoom",value:function(e){var t=this;if(e.conversationType===S.CONV_GROUP){var n=At(e.to)?Kt(e.to):e.to;return this.hasLocalGroup(n)?Ni():this.getGroupProfile({groupID:n}).then((function(o){var s=o.data.group.type;if(He.l("".concat(t._n,".guardForAVChatRoom. groupID:").concat(n," type:").concat(s)),s===S.GRP_AVCHATROOM){var a=La;return Oi(new Ei({code:a,message:t.getErrorMessage(a,e.from,n),data:{message:e}}))}return Ni()}))}return Ni()}},{key:"checkJoinedAVChatRoomByID",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"onNewGroupMessage",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onNewGroupMessage(e)}},{key:"updateNextMessageSeq",value:function(e){var t=this;if(it(e)){var n=this.getModule(Bn);e.forEach((function(e){var o=e.conversationID.replace(S.CONV_GROUP,"");At(o)&&n.updateLastMessage(o,e.lastMessage),t.groupMap.has(o)&&(t.groupMap.get(o).nextMessageSeq=e.lastMessage.sequence+1)}))}}},{key:"onNewGroupTips",value:function(e){this._groupTipsHandler&&this._groupTipsHandler.onNewGroupTips(e)}},{key:"onGroupMessageRevoked",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onGroupMessageRevoked(e)}},{key:"onNewGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:"onGroupMessageReadNotice",value:function(e){var t=this;e.dataList.forEach((function(e){var n=e.elements.groupMessageReadNotice;if(!ut(n)){var o=t.getModule(Hn);n.forEach((function(e){var n=e.groupID,s=e.topicID,a=void 0===s?void 0:s,r=e.lastMessageSeq;He.d("".concat(t._n,".onGroupMessageReadNotice groupID:").concat(n," lastMessageSeq:").concat(r));var i="".concat(S.CONV_GROUP).concat(n),u=!0;Zt(a)||(i="".concat(S.CONV_GROUP).concat(a),u=!1),o.updateIsReadAfterReadReport({conversationID:i,lastMessageSeq:r}),o.updateUnreadCount(i,u),o.clearGroupAtInfoList(i,u)}))}}))}},{key:"onReadReceiptList",value:function(e){var t=this;He.d("".concat(this._n,".onReadReceiptList options:"),JSON.stringify(e)),e.dataList.forEach((function(e){var n=e.groupProfile,o=e.elements,s=n.groupID,a=t.getModule(Hn),r=o.readReceiptList;a.updateReadReceiptInfo({groupID:s,readReceiptList:r})}))}},{key:"onGroupMessageModified",value:function(e){He.d("".concat(this._n,".onGroupMessageModified options:"),JSON.stringify(e));var n=this.getModule(Hn);e.dataList.forEach((function(e){n.onMessageModified(t(t({},e),{},{conversationType:S.CONV_GROUP,to:e.topicID?e.topicID:e.groupID}))}))}},{key:"deleteGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:"initGroupMap",value:function(e){this.groupMap.set(e.groupID,new Ji(e))}},{key:"deleteGroup",value:function(e){this.groupMap.delete(e)}},{key:"updateGroupMap",value:function(e){var t,n=this,o=this.getModule(Hn);e.forEach((function(e){t=e.groupID,n.groupMap.has(t)?n.groupMap.get(t).updateGroup(e):(n.groupMap.set(t,new Ji(e)),o.deleteGroupRomaingMessageInfo(t))}));var s,a=this.getMyUserID(),r=D(this.groupMap);try{for(r.s();!(s=r.n()).done;){var i=v(s.value,2)[1];i.selfInfo.userID=a,"Owner"===i.selfInfo.role&&(i.ownerID=a)}}catch(u){r.e(u)}finally{r.f()}this._setStorageGroupList()}},{key:"getStorageGroupList",value:function(){return this.getModule(Wn).getItem("groupMap")}},{key:"_setStorageGroupList",value:function(){var e=this.getLocalGroupList().filter((function(e){var t=e.type;return!Lt(t)})).filter((function(e){return!e.isSupportTopic})).slice(0,20).map((function(e){return{groupID:e.groupID,name:e.name,avatar:e.avatar,type:e.type}}));this.getModule(Wn).setItem("groupMap",e)}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return m(this.groupMap.values())}},{key:"getLocalGroupProfile",value:function(e){return this.groupMap.get(e)}},{key:"sortLocalGroupList",value:function(){var e=m(this.groupMap).filter((function(e){var t=v(e,2);t[0];return!Zt(t[1].lastMessage)}));e.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})),this.groupMap=new Map(m(e))}},{key:"updateGroupLastMessage",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.handleUpdateGroupLastMessage(e)}},{key:"emitGroupListUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalGroupList();if(e&&this.emitOuterEvent(k.GROUP_LIST_UPDATED),t){var o=JSON.parse(JSON.stringify(n)),s=this.getModule(Hn);s.updateConversationGroupProfile(o)}}},{key:"patchGroupMessageRemindType",value:function(){var e=this.getLocalGroupList(),t=this.getModule(Hn),n=0;e.forEach((function(e){!0===t.patchMessageRemindType({ID:e.groupID,isC2CConversation:!1,messageRemindType:e.selfInfo.messageRemindType})&&(n+=1)})),He.l("".concat(this._n,".patchGroupMessageRemindType count:").concat(n))}},{key:"recomputeUnreadCount",value:function(){var e=this.getLocalGroupList(),t=this.getModule(Hn);e.forEach((function(e){var n=e.groupID,o=e.selfInfo,s=o.excludedUnreadSequenceList,a=o.readedSequence;if(it(s)){var r=0;s.forEach((function(t){t>=a&&t<=e.nextMessageSeq-1&&(r+=1)})),r>=1&&t.recomputeGroupUnreadCount({conversationID:"".concat(S.CONV_GROUP).concat(n),count:r})}}))}},{key:"getMyNameCardByGroupID",value:function(e){var t=this.getLocalGroupProfile(e);return t?t.selfInfo.nameCard:""}},{key:"isPagingGetCompleted",value:function(){return!!this._commonGroupHandler&&this._commonGroupHandler.isPagingGetCompleted()}},{key:"getGroupList",value:function(e){return this._commonGroupHandler?this._commonGroupHandler.getGroupList(e):Ni()}},{key:"getGroupProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupProfile"),o=new li("getGroupProfile"),s=e.groupID,a=e.groupCustomFieldFilter;He.l("".concat(n," groupID:").concat(s));var r={groupIDList:[s],responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember","InviteJoinOption"],groupCustomFieldFilter:a,memberInfoFilter:["Role","JoinTime","MsgSeq","MsgFlag","NameCard"]}};return this.getGroupProfileAdvance(r).then((function(e){var a,r=e.data,i=r.successGroupList,u=r.failureGroupList;if(He.l("".concat(n," ok")),u.length>0)return Oi(u[0]);(Lt(i[0].type)&&!t.hasLocalGroup(s)?a=new Ji(i[0]):(t.updateGroupMap(i),a=t.getLocalGroupProfile(s)),a.isSupportTopic)||t.getModule(Hn).updateConversationGroupProfile([a]);return o.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(s," type:").concat(a.type," muteAllMembers:").concat(a.muteAllMembers," ownerID:").concat(a.ownerID)).end(),Li({group:a})})).catch((function(s){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],r=n[1];o.setError(s,a,r).setMessage("groupID:".concat(e.groupID)).end()})),He.e("".concat(n," failed. error:"),s),Oi(s)}))}},{key:"getGroupProfileAdvance",value:function(e){var n="".concat(this._n,".getGroupProfileAdvance"),o=e.groupIDList;it(o)&&o.length>50&&(this.outputWarning("GetGroupProfileLimit"),o.length=50);var s=[],a=[];o.forEach((function(e){Et({groupID:e})?a.push(e):s.push(e)}));var r=[];if(s.length>0){var i=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:s}));r.push(i)}if(a.length>0){var u=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:a,relayFlag:s.length>0}));r.push(u)}return Promise.all(r).then((function(e){var t=[],n=[];return e.forEach((function(e){t.push.apply(t,m(e.successGroupList)),n.push.apply(n,m(e.failureGroupList))})),Li({successGroupList:t,failureGroupList:n})})).catch((function(e){return He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_getGroupProfileAdvance",value:function(e){var t=this,n=e.relayFlag,o=void 0!==n&&n,s=g(e,Mu);return this.request({protocolName:Qo,requestData:s}).then((function(e){He.l("".concat(t._n,"._getGroupProfileAdvance ok."));var n=e.data.groups;return{successGroupList:n.filter((function(e){return ut(e.errorCode)||0===e.errorCode})),failureGroupList:n.filter((function(e){return e.errorCode&&0!==e.errorCode})).map((function(e){return new Ei({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}})}))}})).catch((function(t){return o&&Et({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Oi(t)}))}},{key:"createGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("createGroup"),s=e.type,a=e.groupID;if(e.name&&!1===this._filterProfanity("name",e))return Oi({code:Wr});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Oi({code:Wr});if(e.notification&&!1===this._filterProfanity("notification",e))return Oi({code:Wr});if(!["Public","Private","ChatRoom","AVChatRoom","Community"].includes(s))return Oi({code:ir});if(!Et({type:s})){if(!Zt(a)&&Et({groupID:a}))return Oi({code:cr});e.isSupportTopic=void 0}if(Lt(s)&&!ut(e.memberList)&&e.memberList.length>0&&(e.memberList=void 0),this._canIUseJoinOption(s)||ut(e.joinOption)||(e.joinOption=void 0),Et({type:s})){if(!Zt(a)&&!Et({groupID:a}))return Oi({code:cr});e.isSupportTopic=!0===e.isSupportTopic?1:0}var r=new li("createGroup");He.l("".concat(o," options:"),e);var i=null,u=[];return this.request({protocolName:Zo,requestData:t(t({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then((function(s){var a=s.data,c=a.groupID,l=a.overLimitUserIDList,p=void 0===l?[]:l;if(i=c,u=p,r.setNetworkType(n.getNetworkType()).setMessage("groupType:".concat(e.type," groupID:").concat(c," overLimitUserIDList=").concat(p)).end(),He.l("".concat(o," ok groupID:").concat(c," overLimitUserIDList:"),p),e.type===S.GRP_AVCHATROOM)return n.getGroupProfile({groupID:c});if(e.type===S.GRP_COMMUNITY&&1===e.isSupportTopic)return n.getGroupProfile({groupID:c});Zt(e.memberList)||Zt(p)||(e.memberList=e.memberList.filter((function(e){return-1===p.indexOf(e.userID)}))),n.updateGroupMap([t(t({},e),{},{groupID:c})]);var d=n.getModule(Un),g=d.createCustomMessage({to:c,conversationType:S.CONV_GROUP,payload:{data:"group_create",extension:n.isIntl()?"".concat(n.getMyUserID()," created a group"):"".concat(n.getMyUserID(),"创建群组")}});return d.sendMessageInstance(g),n.emitGroupListUpdate(),n.getGroupProfile({groupID:c})})).then((function(e){var t=e.data.group,n=t.selfInfo,o=n.nameCard,s=n.joinTime;return t.updateSelfInfo({nameCard:o,joinTime:s,messageRemindType:S.MSG_REMIND_ACPT_AND_NOTE,role:S.GRP_MBR_ROLE_OWNER}),Li({group:t,overLimitUserIDList:u})})).catch((function(s){if(r.setMessage("groupType:".concat(e.type)),n.probeNetwork().then((function(e){var t=v(e,2),n=t[0],o=t[1];r.setError(s,n,o).end()})),10010===s.code||10007===s.code){n.updateGroupMap([t(t({},e),{},{groupID:i})]);var a=n.getLocalGroupProfile(i);return He.l("".concat(o," success, but failed to get group profile.")),Li({group:a,overLimitUserIDList:u})}return He.e("".concat(o," failed. error:"),s),Oi(s)}))}},{key:"dismissGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("dismissGroup");if(this.hasLocalGroup(e)&&this.getLocalGroupProfile(e).type===S.GRP_WORK)return Oi(new Ei({code:gr}));var o=new li("dismissGroup");return o.setMessage("groupID:".concat(e)),He.l("".concat(n," groupID:").concat(e)),this.request({protocolName:$o,requestData:{groupID:e}}).then((function(){return o.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),t.checkJoinedAVChatRoomByID(e)&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),Li({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"updateGroupProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("updateGroupProfile");if(this.hasLocalGroup(e.groupID)){var o=this.getLocalGroupProfile(e.groupID).type;this._canIUseJoinOption(o)||ut(e.joinOption)||(He.w("".concat(n," joinOption is unavailable for Work/Meeting/AVChatRoom")),e.joinOption=void 0)}if(ut(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers="On":e.muteAllMembers="Off"),e.name&&!1===this._filterProfanity("name",e))return Oi({code:Wr});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Oi({code:Wr});if(e.notification&&!1===this._filterProfanity("notification",e))return Oi({code:Wr});var s=new li("updateGroupProfile");return s.setMessage(JSON.stringify(e)),He.l("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:es,requestData:e}).then((function(){(s.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok")),t.hasLocalGroup(e.groupID))&&(t.groupMap.get(e.groupID).updateGroup(e),t._setStorageGroupList());return Li({group:t.groupMap.get(e.groupID)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),He.l("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(io);if(!n)return!0;var o=n.filterText(t[e],z),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"joinGroup",value:function(e){var t=this,n=e.groupID,o=e.type,s="".concat(this._n,".joinGroup");if(o===S.GRP_WORK)return Oi({code:ur});if(this.deleteUnjoinedAVChatRoom(n),this.hasLocalGroup(n)){if(!this.isLoggedIn())return Ni({status:S.JOIN_STATUS_ALREADY_IN_GROUP});var a=new li("applyJoinGroup");return this.getGroupProfile({groupID:n}).then((function(){return a.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," joinedStatus:").concat(S.JOIN_STATUS_ALREADY_IN_GROUP)).end(),Ni({status:S.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function(o){return a.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," unjoined")).end(),He.w("".concat(s," ").concat(n," was unjoined, now join!")),t.groupMap.delete(n),t.applyJoinGroup(e)}))}return He.l("".concat(s," groupID:").concat(n)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e)}},{key:"applyJoinGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("applyJoinGroup"),s=e.groupID;if(!Zt(e.applyMessage)&&!1===this._filterProfanity("applyMessage",e))return Oi({code:Wr});var a=new li("applyJoinGroup"),r=t({},e),i=this.canIUse(B.AVCHATROOM_HISTORY_MSG);return i&&(r.historyMessageFlag=1),this.getModule(Hn).deleteTopicRoamingMessageInfo(s),this.request({protocolName:ts,requestData:r}).then((function(e){var t=e.data,r=t.joinedStatus,u=t.longPollingKey,c=t.startSeq,l=t.avChatRoomFlag,p=t.avChatRoomKey,d=t.messageList,g="groupID:".concat(s," joinedStatus:").concat(r," longPollingKey:").concat(u," startSeq:").concat(c)+" avChatRoomFlag:".concat(l," canGetAVChatRoomHistoryMessage:").concat(i,",")+" history message count:".concat(Zt(d)?0:d.length);switch(a.setNetworkType(n.getNetworkType()).setMessage("".concat(g)).end(),He.l("".concat(o," ok. ").concat(g)),r){case Xe:return Li({status:Xe});case Je:return n.getGroupProfile({groupID:s}).then((function(e){var t=e.data.group;return n._handleJoinResult({group:t,avChatRoomFlag:l,longPollingKey:u,startSeq:c,avChatRoomKey:p,messageList:d})})).catch((function(){var e=new Ji({groupID:s});return n._handleJoinResult({group:e,avChatRoomFlag:l,longPollingKey:u,startSeq:c,avChatRoomKey:p,messageList:d})}));default:var h=new Ei({code:_r});return He.e("".concat(o," failed. error:"),h),Oi(h)}})).catch((function(e){return a.setMessage("groupID:".concat(s)),n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}},{key:"_handleJoinResult",value:function(e){var t,n=this,o=e.group,s=e.avChatRoomFlag,a=e.longPollingKey,r=e.startSeq,i=e.avChatRoomKey,u=e.messageList,c=o.groupID;return 1===s?(this.getModule(Hn).setCompleted("".concat(S.CONV_GROUP).concat(c)),this._groupAttributesHandler.initGroupAttributesCache({groupID:c,avChatRoomKey:i}),this._groupCountersHandler.initGroupCountersCache({groupID:c,avChatRoomKey:i}),(t=ut(a)?this._AVChatRoomHandler.handleJoinResult({group:o}):this._AVChatRoomHandler.startRunLoop({group:o,longPollingKey:a,startSeq:r})).then((function(){n._onAVChatRoomHistoryMessage(u)})),t):(this.emitGroupListUpdate(!0,!1),Li({status:Je,group:o}))}},{key:"quitGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("quitGroup");He.l("".concat(n," groupID:").concat(e));var o=this.checkJoinedAVChatRoomByID(e);if(!o&&!this.hasLocalGroup(e))return Oi({code:hr});if(o&&!this.isLoggedIn())return He.l("".concat(n," anonymously ok. groupID:").concat(e)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),Ni({groupID:e});var s=new li("quitGroup");return s.setMessage("groupID:".concat(e)),this.request({protocolName:os,requestData:{groupID:e}}).then((function(){return s.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),o&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),Li({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"searchGroupByID",value:function(e){var t=this,n="".concat(this._n,".").concat("searchGroupByID"),o={groupIDList:[e]},s=new li("searchGroupByID");return s.setMessage("groupID:".concat(e)),He.l("".concat(n," groupID:").concat(e)),this.request({protocolName:ss,requestData:o}).then((function(e){var o=e.data.groupProfile;if(0!==o[0].errorCode)throw new Ei({code:o[0].errorCode,message:o[0].errorInfo});return s.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok")),Li({group:new Ji(o[0])})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),He.w("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"changeGroupOwner",value:function(e){var t=this,n="".concat(this._n,".").concat("changeGroupOwner");if(this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===S.GRP_AVCHATROOM)return Oi({code:pr});if(e.newOwnerID===this.getMyUserID())return Oi({code:dr});var o=new li("changeGroupOwner");return o.setMessage("groupID:".concat(e.groupID," newOwnerID:").concat(e.newOwnerID)),He.l("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:as,requestData:e}).then((function(){o.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok"));var s=e.groupID,a=e.newOwnerID;t.groupMap.get(s).ownerID=a;var r=t.getModule(Vn).getLocalGroupMemberList(s);if(r instanceof Map){var i=r.get(t.getMyUserID());ut(i)||(i.updateRole("Member"),t.groupMap.get(s).selfInfo.role="Member");var u=r.get(a);ut(u)||u.updateRole("Owner")}return t.emitGroupListUpdate(!0,!1),Li({group:t.groupMap.get(s)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"getGroupApplicationList",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:"handleGroupApplication",value:function(e){var t,n,o,s,a,r=this,i="".concat(this._n,".").concat("handleGroupApplication"),u=e.handleAction,c=e.handleMessage,l=e.message,p=e.application;l?(t=l.payload.operatorID,n=l.payload.groupProfile.groupID,o=l.payload.authentication,s=l.payload.messageKey):p&&(t=p.applicant,n=p.groupID,o=p.authentication,s=p.messageKey);var d=rs;p&&2===p.applicationType&&(d=is,a=p.userID);var g=new li("handleGroupApplication");return g.setMessage("groupID:".concat(n)),He.l("".concat(i," groupID:").concat(n)),this.request({protocolName:d,requestData:{handleAction:u,handleMessage:c,applicant:t,invitee:a,groupID:n,authentication:o,messageKey:s}}).then((function(){return g.setNetworkType(r.getNetworkType()).end(),He.l("".concat(i," ok")),l&&r._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Li({group:r.getLocalGroupProfile(n)})})).catch((function(e){return r.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];g.setError(e,o,s).end()})),He.e("".concat(i," failed. error"),e),Oi(e)}))}},{key:"handleGroupInvitation",value:function(e){var n=this,o="".concat(this._n,".").concat("handleGroupInvitation"),s=e.message.payload,a=s.groupProfile.groupID,r=s.authentication,i=s.messageKey,u=s.operatorID,c=e.handleAction,l=new li("handleGroupInvitation");return l.setMessage("groupID:".concat(a," inviter:").concat(u," handleAction:").concat(c)),He.l("".concat(o," groupID:").concat(a," inviter:").concat(u," handleAction:").concat(c)),this.request({protocolName:us,requestData:t(t({},e),{},{inviter:u,groupID:a,authentication:r,messageKey:i})}).then((function(){return l.setNetworkType(n.getNetworkType()).end(),He.l("".concat(o," ok")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Li({group:n.getLocalGroupProfile(a)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),He.e("".concat(o," failed. error"),e),Oi(e)}))}},{key:"getGroupOnlineMemberCount",value:function(e){return this._AVChatRoomHandler?this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)?this._AVChatRoomHandler.getGroupOnlineMemberCount(e):Ni({memberCount:0}):Oi({code:Pr})}},{key:"hasLocalGroup",value:function(e){return this.groupMap.has(e)}},{key:"deleteLocalGroupAndConversation",value:function(e){var t=this.checkJoinedAVChatRoomByID(e);(He.l("".concat(this._n,".deleteLocalGroupAndConversation isJoinedAVChatRoom:").concat(t)),t)&&this.getModule(Hn).deleteLocalConversation("".concat(S.CONV_GROUP).concat(e));if(Et({groupID:e})){var n=this.getLocalGroupProfile(e);if(n&&!0===n.isSupportTopic)this.getModule(Bn).deleteTopicListInCommunity(e)}this._deleteLocalGroup(e),this.emitGroupListUpdate(!0,!1)}},{key:"_deleteLocalGroup",value:function(e){this.groupMap.delete(e),this.getModule(Vn).deleteGroupMemberList(e),this._setStorageGroupList()}},{key:"sendMessage",value:function(e,t){if(it(e._receiverList)&&e._receiverList.length>0&&!this.canIUse(B.MSG_TO_SPECIFIED_GRP_MBR))return Oi({code:Kr});var n=this.createGroupMessagePack(e,t);return this.request(n)}},{key:"createGroupMessagePack",value:function(e,t){var n=null;t&&t.offlinePushInfo&&(n=t.offlinePushInfo);var o="";st(e.cloudCustomData)&&e.cloudCustomData.length>0&&(o=e.cloudCustomData);var s=[];if(rt(t)&&rt(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c=void 0;it(e._receiverList)&&e._receiverList.length>0&&(c=e._receiverList,e._receiverList.length>50&&(c=e._receiverList.slice(0,50),this.outputWarning("ReceiverListLimit")));var l=this.isOnlineMessage(e,t)?1:0,p=e.getGroupAtInfoList(),d={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:e.getElements(),cloudCustomData:o,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==S.MSG_TEXT||Zt(p)?void 0:p,onlineOnlyFlag:l,clientTime:e.clientTime,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:0===l?s:void 0,needReadReceipt:!0!==e.needReadReceipt||this.isMessageFromOrToAVChatroom(e.to)?0:1,receiverList:c,isSupportExtension:!0===e.isSupportExtension?1:0};return At(e.to)&&(d.groupID=Kt(e.to),d.topicID=e.to),{protocolName:yo,tjgID:this.generateTjgID(e),requestData:d}}},{key:"_isVoipPush",value:function(e){var t=void 0;return ut(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:"revokeMessage",value:function(e){var t={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return At(e.to)&&(t.groupID=Kt(e.to),t.topicID=e.to),this.request({protocolName:cs,requestData:t})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;He.l("".concat(this._n,".deleteMessage groupID:").concat(t," count:").concat(n.length));var o={groupID:t,deleter:this.getMyUserID(),keyList:n};return At(t)&&(o.groupID=Kt(t),o.topicID=t),this.request({protocolName:Cs,requestData:o})}},{key:"modifyRemoteMessage",value:function(e){var t=e.to,n=e.sequence,o=e.payload,s=e.type,a=e.version,r=void 0===a?0:a,i=e.cloudCustomData,u=t,c=void 0;At(t)&&(u=Kt(t),c=t);var l=void 0;return jt(s)&&(l=[]).push({type:s,content:o}),this.request({protocolName:Ts,requestData:{groupID:u,topicID:c,sequence:n,version:r,elements:l,cloudCustomData:i}})}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessage"),o=e.conversationID,s=e.groupID,a=e.sequence,r=new li("getGroupRoamingMessages"),i=0,u=void 0;return At(s)&&(s=Kt(u=s)),this._computeLastSequence({groupID:s,topicID:u,sequence:a}).then((function(e){return i=e,He.l("".concat(n," groupID:").concat(s," startSequence:").concat(i)),t.request({protocolName:ds,requestData:{groupID:s,count:21,sequence:i,topicID:u}})})).then((function(e){var a=e.data,c=a.messageList,l=a.complete,p=a.invisibleSequenceList,d=void 0===p?[]:p;ut(c)?He.l("".concat(n," ok. complete:").concat(l," but messageList is undefined!")):He.l("".concat(n," ok. complete:").concat(l," count:").concat(c.length));var g=t._getMinSequence(d,c)-1;r.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(s," topicID:").concat(u," startSequence:").concat(i," complete:").concat(l," nextSequence:").concat(g)).end();var h=t.getModule(Hn),_=[];return Zt(c)||(h.updateRoamingMessageSequence(o,g),_=h.onRoamingMessage(c,o),h.updateIsRead(o),h.patchConversationLastMessage(o)),2===l&&(h.setCompleted(o),g=""),He.l("".concat(n," nextReqID:").concat(g,", stored message count:").concat(_.length,", invisible sequence count:").concat(d.length)),{nextReqID:g+"",storedMessageList:_}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).setMessage("groupID:".concat(s," topicID:").concat(u," startSequence:").concat(i)).end()})),He.w("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_getGroupIDOfMessage",value:function(e){return e.conversationID.replace(S.CONV_GROUP,"")}},{key:"_getMinSequence",value:function(e,t){var n=0;Zt(t)||(n=t[t.length-1].sequence);var o=0;Zt(e)||(o=e[e.length-1]);return He.l("".concat(this._n,"._getMinSequence minVisibleSequence:").concat(n," minInvisibleSequence:").concat(o)),o>0&&o=100?100:a,h="groupID:".concat(r," sequence:").concat(u," cursor:").concat(d," filter:").concat(p," completeFlag:").concat(l);He.l("".concat(c," ").concat(h));var _={cursor:"",isCompleted:!1,messageID:i,unreadUserIDList:[],readUserIDList:[]},f=new li("getReadReceiptDetail");return f.setMessage(h),this.request({protocolName:fs,requestData:{groupID:r,sequence:u,flag:p,cursor:d,count:g}}).then((function(e){f.end();var n=e.data,o=n.cursor,s=n.isCompleted,a=n.unreadUserIDList,r=n.readUserIDList;return _.cursor=o,1===s&&(_.isCompleted=!0,t._receiptDetailCompleteMap.set(i,!0)),0===p?_.readUserIDList=r.map((function(e){return e.userID})):1===p&&(_.unreadUserIDList=a.map((function(e){return e.userID}))),He.l("".concat(c," ok")),Li(_)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];f.setError(e,o,s).end()})),He.w("".concat(c," failed. error:"),e),Oi(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessagesHopping"),o=new li("getGroupRoamingMessagesHopping"),s=e.groupID,a=e.count,r=e.sequence,i=e.direction,u=r;1===i&&(u=r+a-1);var c=void 0;At(s)&&(s=Kt(c=s));var l="".concat(c?"topicID:".concat(c):"groupID:".concat(s)," sequence:").concat(r," direction:").concat(i);return He.l("".concat(n," ").concat(l)),this.request({protocolName:ds,requestData:{groupID:s,topicID:c,count:a,sequence:u}}).then((function(s){var a=s.data,u=a.messageList,c=a.complete,p="complete:".concat(c," count:").concat(u?u.length:0);if(He.l("".concat(n," ok. ").concat(p)),o.setNetworkType(t.getNetworkType()).setMessage("".concat(l," ").concat(p)).end(),2===c||Zt(u)){var d=t._computeResult();return Li(d)}var g="".concat(S.CONV_GROUP).concat(e.groupID),h=t.getModule(Hn).onRoamingMessage(u,g,!1),_=t._computeResult({direction:i,sequence:r,remoteMessageList:u,processedMessageList:h});return Li(_)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),i=n[0],u=n[1];o.setError(e,i,u).setMessage("groupID:".concat(s," sequence:").concat(r," count:").concat(a)).end()})),He.w("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_computeResult",value:function(e){var t={messageList:[],isCompleted:!1,nextMessageSeq:""};if(ut(e))return t.isCompleted=!0,t;var n=e.direction,o=e.sequence,s=e.remoteMessageList,a=void 0===s?[]:s,r=e.processedMessageList,i=void 0===r?[]:r,u=a.length;return 1===n?(t.nextMessageSeq=a[0].sequence+1,i.forEach((function(e){e.sequence>=o&&t.messageList.push(e)})),0===t.messageList.length&&a[0].sequence0?Promise.resolve(s):ut(o)||this.hasLocalGroup(t)?ut(o)?this.getGroupLastSequence(t):this.getTopicLastSequence({groupID:t,topicID:o}):Promise.resolve(0)}},{key:"getGroupLastSequence",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupLastSequence"),o=new li("getGroupLastSequence"),s=0,a="";if(this.hasLocalGroup(e)){var r=this.getLocalGroupProfile(e),i=r.lastMessage;if(i.lastSequence>0&&!1===i.onlineOnlyFlag)return s=i.lastSequence,a="got lastSequence:".concat(s," from local group profile[lastMessage.lastSequence]. groupID:").concat(e),He.l("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(s);if(r.nextMessageSeq>1)return s=r.nextMessageSeq-1,a="got lastSequence:".concat(s," from local group profile[nextMessageSeq]. groupID:").concat(e),He.l("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(s)}var u="GROUP".concat(e),c=this.getModule(Hn).getLocalConversation(u);if(c&&c.lastMessage.lastSequence&&!1===c.lastMessage.onlineOnlyFlag)return s=c.lastMessage.lastSequence,a="got lastSequence:".concat(s," from local conversation profile[lastMessage.lastSequence]. groupID:").concat(e),He.l("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(s);var l={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}};return this.getGroupProfileAdvance(l).then((function(r){var i=r.data.successGroupList;return Zt(i)?He.l("".concat(n," successGroupList is empty. groupID:").concat(e)):(s=i[0].nextMessageSeq-1,a="got lastSequence:".concat(s," from getGroupProfileAdvance. groupID:").concat(e),He.l("".concat(n," ").concat(a))),o.setNetworkType(t.getNetworkType()).setMessage("".concat(a)).end(),s})).catch((function(s){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],r=n[1];o.setError(s,a,r).setMessage("get lastSequence failed from getGroupProfileAdvance. groupID:".concat(e)).end()})),He.w("".concat(n," failed. error:"),s),Oi(s)}))}},{key:"getTopicLastSequence",value:function(e){var t=this,n=e.groupID,o=e.topicID,s="".concat(this._n,".").concat("getTopicLastSequence"),a=new li("getTopicLastSequence"),r=0,i="",u=this.getModule(Bn);return u.hasLocalTopic(n,o)?(r=u.getLocalTopic(n,o).nextMessageSeq-1,i="get lastSequence:".concat(r," from local topic info[nextMessageSeq]. topicID:").concat(o),He.l("".concat(s," ").concat(i)),a.setNetworkType(this.getNetworkType()).setMessage("".concat(i)).end(),Promise.resolve(r)):u.getTopicList({groupID:n,topicIDList:[o]}).then((function(e){var n=e.data.successTopicList;return Zt(n)?He.l("".concat(s," successTopicList is empty. topicID:").concat(o)):(r=n[0].nextMessageSeq-1,i="get lastSequence:".concat(r," from getTopicList. topicID:").concat(o),He.l("".concat(s," ").concat(i))),a.setNetworkType(t.getNetworkType()).setMessage("".concat(i)).end(),r})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],r=n[1];a.setError(e,s,r).setMessage("get lastSequence failed from getTopicList. topicID:".concat(o)).end()})),He.w("".concat(s," failed. error:"),e),Oi(e)}))}},{key:"isMessageFromOrToAVChatroom",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"hasJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.hasJoinedAVChatRoom():0}},{key:"getJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.getJoinedAVChatRoom():[]}},{key:"isOnlineMessage",value:function(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}},{key:"_canIUseOnlineOnlyFlag",value:function(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==S.CONV_GROUP}},{key:"_onAVChatRoomHistoryMessage",value:function(e){if(!Zt(e)){He.l("".concat(this._n,"._onAVChatRoomHistoryMessage count:").concat(e.length));var n=[];e.forEach((function(e){n.push(t(t({},e),{},{isHistoryMessage:1}))})),this.onAVChatRoomMessage(n)}}},{key:"onAVChatRoomMessage",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onMessage(e)}},{key:"onAVChatRoomMemberBanned",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:"getGroupSimplifiedInfo",value:function(e){var t=this,n=new li("getGroupSimplifiedInfo"),o={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["Type","Name"]}};return this.getGroupProfileAdvance(o).then((function(o){var s=o.data.successGroupList;return n.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(e," type:").concat(s[0].type)).end(),s[0]})).catch((function(o){t.probeNetwork().then((function(t){var s=v(t,2),a=s[0],r=s[1];n.setError(o,a,r).setMessage("groupID:".concat(e)).end()}))}))}},{key:"setUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:"deleteUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:"isUnjoinedAVChatRoom",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:"isGroupAttributesUpdatedNotice",value:function(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:"initGroupAttributes",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:"isMessageFromTopic",value:function(e,t){return 2===e&&!Zt(t)}},{key:"isMessageFromCommunityOfTopic",value:function(e,t){return 2===e&&Zt(t)}},{key:"getMessageExtensions",value:function(e,t){return He.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.request({protocolName:Rs,requestData:{groupID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return He.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n)),this.request({protocolName:As,requestData:{groupID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"getGroupNotify",value:function(e){var n=this;if(this.hasLocalGroup(e)){var o=this.getLocalGroupProfile(e),s=o.type,a=o.isSupportTopic;if(!Lt(s)&&!a){var r="".concat(this._n,".getGroupNotify"),i=this._getGroupLastRevokedTime(e),u=1e3*we();He.l("".concat(r," groupID:").concat(e," type:").concat(s," beginTime:").concat(i," endTime:").concat(u)),this.request({protocolName:Ns,requestData:{type:Et({type:s,groupID:e})?S.GRP_COMMUNITY:void 0,groupID:e,beginTime:i,endTime:u}}).then((function(o){var s=o.data,a=s.nextRevokedTime,i=s.notifyList;He.l("".concat(r," ok. groupID:").concat(e," nextRevokedTime:").concat(a));var u={dataList:[{elements:{revokedInfos:[]}}]};it(i)&&i.forEach((function(n){u.dataList[0].elements.revokedInfos.push({groupID:e,sequence:n.sequence,random:n.random,revokerInfo:t({},n.revokerInfo)})})),n.onGroupMessageRevoked(u),0!==a?(n._setGroupLastRevokedTime(e,a),n.getGroupNotify(e)):n._setGroupLastRevokedTime(e,1e3*we())})).catch((function(e){He.e("".concat(r," failed. error:"),e)}))}}}},{key:"_getGroupLastRevokedTime",value:function(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}},{key:"_setGroupLastRevokedTime",value:function(e,t){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=t)}},{key:"isGroupCountersNotice",value:function(e){return this._groupCountersHandler.isGroupCountersNotice(e)}},{key:"setGroupCounters",value:function(e){return this._groupCountersHandler.setGroupCounters(e)}},{key:"increaseGroupCounter",value:function(e){return this._groupCountersHandler.increaseGroupCounter(e)}},{key:"decreaseGroupCounter",value:function(e){return this._groupCountersHandler.decreaseGroupCounter(e)}},{key:"getGroupCounters",value:function(e){return this._groupCountersHandler.getGroupCounters(e)}},{key:"restartPolling",value:function(){this._AVChatRoomHandler&&this._AVChatRoomHandler.restartPolling()}},{key:"_canIUseJoinOption",value:function(e){return function(e){return e===S.GRP_PUBLIC}(e)||Et({type:e})}},{key:"reset",value:function(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._receiptDetailCompleteMap.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._groupAttributesHandler.reset(),this._groupCountersHandler.reset(),this._AVChatRoomHandler&&this._AVChatRoomHandler.reset()}}]),s}(po),Iu=function(){function e(t){o(this,e),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this._initMember(t)}return a(e,[{key:"_initMember",value:function(e){this.updateMember(e)}},{key:"updateMember",value:function(e){var t=[null,void 0,"",0,NaN];e.memberCustomField&&St(this.memberCustomField,e.memberCustomField),ft(this,e,["memberCustomField","marks"],t)}},{key:"updateRole",value:function(e){["Owner","Admin","Member"].indexOf(e)<0||(this.role=e)}},{key:"updateMuteUntil",value:function(e){ut(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:"updateNameCard",value:function(e){ut(e)||(this.nameCard=e)}},{key:"updateMemberCustomField",value:function(e){e&&St(this.memberCustomField,e)}}]),e}(),Cu=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="GroupMemberModule",t.groupMemberListMap=new Map,t.getInnerEmitterInstance().on(wi,t._onProfileUpdated,h(t)),t}return a(s,[{key:"_onProfileUpdated",value:function(e){for(var t=this,n=e.data,o=function(e){var o=n[e];t.groupMemberListMap.forEach((function(e){e.has(o.userID)&&e.get(o.userID).updateMember({nick:o.nick,avatar:o.avatar})}))},s=0;s100?100:r};Et({groupID:n})?h.next="".concat(s):(h.offset=s,g=s+r);var _=[];return this.request({protocolName:Ps,requestData:h}).then((function(e){var o=e.data,s=o.members,a=o.memberNum,r=o.next,i=void 0===r?void 0:r;if(ut(i)||(g=Zt(i)?0:i),!it(s)||0===s.length)return g=0,Promise.resolve([]);var u=t.getModule(Fn);return u.hasLocalGroup(n)&&(u.getLocalGroupProfile(n).memberNum=a),_=t._updateLocalGroupMemberMap(n,s),t.getModule(wn).getUserProfile({userIDList:s.map((function(e){return e.userID})),tagList:[We.NICK,We.AVATAR]})})).then((function(e){var o=e.data;if(!it(o)||0===o.length)return Ni({memberList:[],offset:g});var a=o.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));return t._updateLocalGroupMemberMap(n,a),_.length5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)),He.l("".concat(o," groupID:").concat(e.groupID," userIDList:").concat(e.userIDList.join(","))),e.userIDList.length>50&&(e.userIDList=e.userIDList.slice(0,50));var a=e.groupID,r=e.userIDList;return this._getGroupMemberProfileAdvance(t(t({},e),{},{userIDList:r})).then((function(e){var t=e.data.members;return it(t)&&0!==t.length?(n._updateLocalGroupMemberMap(a,t),n.getModule(wn).getUserProfile({userIDList:t.map((function(e){return e.userID})),tagList:[We.NICK,We.AVATAR]})):Ni([])})).then((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));n._updateLocalGroupMemberMap(a,t);var o=r.filter((function(e){return n.hasLocalGroupMember(a,e)})).map((function(e){return n.getLocalGroupMemberInfo(a,e)}));return s.setNetworkType(n.getNetworkType()).end(),Li({memberList:o})}))}},{key:"addGroupMember",value:function(e){var t=this,n="".concat(this._n,".").concat("addGroupMember"),o=e.groupID,s=this.getModule(Fn).getLocalGroupProfile(o),a=s.type,r=new li("addGroupMember");if(r.setMessage("groupID:".concat(o," groupType:").concat(a)),Lt(a)){var i=new Ei({code:fr});return r.setError(i,!0,this.getNetworkType()).end(),Oi(i)}return e.userIDList=e.userIDList.map((function(e){return{userID:e}})),He.l("".concat(n," groupID:").concat(o)),this.request({protocolName:ws,requestData:e}).then((function(o){var a=o.data.members;He.l("".concat(n," ok"));var i=a.filter((function(e){return 1===e.result})).map((function(e){return e.userID})),u=a.filter((function(e){return 0===e.result})).map((function(e){return e.userID})),c=a.filter((function(e){return 2===e.result})).map((function(e){return e.userID})),l=a.filter((function(e){return 4===e.result})).map((function(e){return e.userID})),p="groupID:".concat(e.groupID,", ")+"successUserIDList:".concat(i,", ")+"failureUserIDList:".concat(u,", ")+"existedUserIDList:".concat(c,", ")+"overLimitUserIDList:".concat(l);return r.setNetworkType(t.getNetworkType()).setMoreMessage(p).end(),0===i.length?Li({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l}):(s.memberCount+=i.length,t._updateConversationGroupProfile(s),Li({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l,group:s}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"deleteGroupMember",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteGroupMember"),o=e.groupID,s=e.userIDList,a=this.getModule(Fn).getLocalGroupProfile(o);if(ut(a))return Oi({code:lr});if(Lt(a.type))return this.canIUse(B.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(e):Oi({code:Kr});var r=new li("deleteGroupMember"),i="groupID:".concat(o," ").concat(s.length>5?"userIDList.length:".concat(s.length):"userIDList:".concat(s));return r.setMessage(i),He.l("".concat(n," groupID:").concat(o," userIDList:"),s),this.request({protocolName:qs,requestData:e}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok")),a.memberCount-=1,t._updateConversationGroupProfile(a),t.deleteLocalGroupMembers(o,s),Li({group:a,userIDList:s})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_updateConversationGroupProfile",value:function(e){this.getModule(Hn).updateConversationGroupProfile([e])}},{key:"_banAVChatRoomMember",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteGroupMember"),o=e.groupID,s=e.userIDList,a="groupID:".concat(o," ").concat(s.length>5?"userIDList.length:".concat(s.length):"userIDList:".concat(s)),r=new li("deleteGroupMember");r.setMessage(a),He.l("".concat(n," groupID:").concat(o," userIDList:"),s);var i=this.getModule(Fn).getLocalGroupProfile(o);return ut(e.duration)||0===e.duration?Oi({code:Tr}):this.request({protocolName:Fs,requestData:e}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok")),t.deleteLocalGroupMembers(o,s),Li({group:i,userIDList:s})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"setGroupMemberMuteTime",value:function(e){var t=this,n=e.groupID,o=e.userID,s=e.muteTime,a="".concat(this._n,".").concat("setGroupMemberMuteTime");if(o===this.getMyUserID())return Oi(new Ei({code:Cr}));He.l("".concat(a," groupID:").concat(n," userID:").concat(o));var r=new li("setGroupMemberMuteTime");return r.setMessage("groupID:".concat(n," userID:").concat(o," muteTime:").concat(s)),this.modifyGroupMemberInfo({groupID:n,userID:o,muteTime:s}).then((function(e){r.setNetworkType(t.getNetworkType()).end(),He.l("".concat(a," ok"));var o=t.getModule(Fn);return Li({group:o.getLocalGroupProfile(n),member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(a," failed. error:"),e),Oi(e)}))}},{key:"setGroupMemberRole",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupMemberRole"),o=e.groupID,s=e.userID,a=e.role,r=this.getModule(Fn).getLocalGroupProfile(o);if(r.selfInfo.role!==S.GRP_MBR_ROLE_OWNER)return Oi({code:mr});if([S.GRP_WORK,S.GRP_AVCHATROOM].includes(r.type))return Oi({code:Mr});var i=[S.GRP_MBR_ROLE_ADMIN,S.GRP_MBR_ROLE_MEMBER];if(Et({groupID:o})&&i.push(S.GRP_MBR_ROLE_CUSTOM),i.indexOf(a)<0)return Oi({code:yr});if(s===this.getMyUserID())return Oi({code:Ir});var u=new li("setGroupMemberRole");return u.setMessage("groupID:".concat(o," userID:").concat(s," role:").concat(a)),He.l("".concat(n," groupID:").concat(o," userID:").concat(s)),this.modifyGroupMemberInfo({groupID:o,userID:s,role:a}).then((function(e){return u.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok")),Li({group:r,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(io);if(!n)return!0;var o=n.filterText(t[e],J),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"setGroupMemberNameCard",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupMemberNameCard");if(e.nameCard&&!1===this._filterProfanity("nameCard",e))return Oi({code:Wr});var o=e.groupID,s=e.userID,a=void 0===s?this.getMyUserID():s,r=e.nameCard;He.l("".concat(n," groupID:").concat(o," userID:").concat(a));var i=new li("setGroupMemberNameCard");return i.setMessage("groupID:".concat(o," userID:").concat(a," nameCard:").concat(r)),this.modifyGroupMemberInfo({groupID:o,userID:a,nameCard:r}).then((function(e){He.l("".concat(n," ok")),i.setNetworkType(t.getNetworkType()).end();var s=t.getModule(Fn).getLocalGroupProfile(o);return a===t.getMyUserID()&&s&&s.setSelfNameCard(r),Li({group:s,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"setGroupMemberCustomField",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupMemberCustomField"),o=e.groupID,s=e.userID,a=void 0===s?this.getMyUserID():s,r=e.memberCustomField;He.l("".concat(n," groupID:").concat(o," userID:").concat(a));var i=new li("setGroupMemberCustomField");return i.setMessage("groupID:".concat(o," userID:").concat(a," memberCustomField:").concat(JSON.stringify(r))),this.modifyGroupMemberInfo({groupID:o,userID:a,memberCustomField:r}).then((function(e){i.setNetworkType(t.getNetworkType()).end(),He.l("".concat(n," ok"));var s=t.getModule(Fn).getLocalGroupProfile(o);return Li({group:s,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"modifyGroupMemberInfo",value:function(e){var n=this,o=e.groupID,s=e.userID,a=void 0;return At(o)&&(o=Kt(a=o)),this.request({protocolName:xs,requestData:t(t({},e),{},{groupID:o,topicID:a})}).then((function(){if(n.hasLocalGroupMember(o,s)){var t=n.getLocalGroupMemberInfo(o,s);return ut(e.muteTime)||t.updateMuteUntil(e.muteTime),ut(e.role)||t.updateRole(e.role),ut(e.nameCard)||t.updateNameCard(e.nameCard),ut(e.memberCustomField)||t.updateMemberCustomField(e.memberCustomField),t}return n.getGroupMemberProfile({groupID:o,userIDList:[s]}).then((function(e){return v(e.data.memberList,1)[0]}))}))}},{key:"markGroupMemberList",value:function(e){var t=this,n="".concat(this._n,".").concat("markGroupMemberList"),o=e.groupID,s=e.markType,a=e.enableMark,r=e.userIDList,i=void 0===r?[]:r,u="groupID:".concat(o," markType:").concat(s," enableMark:").concat(a," userIDList count: ").concat(i.length);He.l("".concat(n," ").concat(u));var c=2,l=[];!0===a&&(c=1);var p=m(i);i.length>500&&(p=i.slice(0,500),He.w("".concat(n," ").concat(Jt(500)))),p.forEach((function(e){l.push({userID:e,markType:[s]})})),p=null;var d=new li("markGroupMemberList");return d.setMessage("".concat(u)),this.request({protocolName:Vs,requestData:{groupID:o,operationType:c,memberList:l}}).then((function(e){var o=e.data.memberList,s=void 0===o?[]:o,a=[],r=[];s.length===i.length?a.push.apply(a,m(i)):(s.forEach((function(e){a.push(e.userID)})),i.forEach((function(e){a.includes(e)||r.push(e)})));var u="success count:".concat(a.length," fail count:").concat(r.length);return d.setNetworkType(t.getNetworkType()).setMessage(u).end(),He.l("".concat(n," ok. ").concat(u)),Li({successUserIDList:a,failureUserIDList:r})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];d.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_getGroupMemberProfileAdvance",value:function(e){return this.request({protocolName:bs,requestData:t(t({},e),{},{memberInfoFilter:e.memberInfoFilter?e.memberInfoFilter:["Role","JoinTime","NameCard","ShutUpUntil"]})})}},{key:"_updateLocalGroupMemberMap",value:function(e,t){var n=this;return it(t)&&0!==t.length?t.map((function(t){return n.hasLocalGroupMember(e,t.userID)?n.getLocalGroupMemberInfo(e,t.userID).updateMember(t):n.setLocalGroupMember(e,new Iu(t)),n.getLocalGroupMemberInfo(e,t.userID)})):[]}},{key:"deleteLocalGroupMembers",value:function(e,t){var n=this.groupMemberListMap.get(e);n&&t.forEach((function(e){n.delete(e)}))}},{key:"getLocalGroupMemberInfo",value:function(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}},{key:"setLocalGroupMember",value:function(e,t){if(this.groupMemberListMap.has(e))this.groupMemberListMap.get(e).set(t.userID,t);else{var n=(new Map).set(t.userID,t);this.groupMemberListMap.set(e,n)}}},{key:"getLocalGroupMemberList",value:function(e){return this.groupMemberListMap.get(e)}},{key:"hasLocalGroupMember",value:function(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}},{key:"hasLocalGroupMemberMap",value:function(e){return this.groupMemberListMap.has(e)}},{key:"reset",value:function(){this.groupMemberListMap.clear()}}]),s}(po),Tu=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],Du=function(e,t){return Zt(e)?{lastTime:0,lastSequence:0,fromAccount:"",payload:null,type:"",messageForShow:"",nick:"",version:0,cloudCustomData:"",isRevoked:!1,revoker:null}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",payload:e.payload||null,type:e.type||"",messageForShow:Wt(e.type,e.payload,t),nick:e.nick||"",version:e.version||0,cloudCustomData:e.cloudCustomData||"",isRevoked:e.isRevoked||!1,revoker:e.revoker||null}},ku=function(){function e(t,n){o(this,e),this.topicID="",this.topicName="",this.avatar="",this.introduction="",this.notification="",this.unreadCount=0,this.muteAllMembers=!1,this.customData="",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=Du(t.lastMessage,n),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:"",excludedUnreadSequenceList:void 0},this._initTopic(t)}return a(e,[{key:"_initTopic",value:function(e){for(var t in e)Tu.indexOf(t)<0||("selfInfo"===t?this.updateSelfInfo(e[t]):this[t]="muteAllMembers"===t?1===e[t]:e[t])}},{key:"updateUnreadCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.unreadCount=e}},{key:"updateNextMessageSeq",value:function(e){this.nextMessageSeq=e}},{key:"updateLastMessage",value:function(e){this.lastMessage=Du(e)}},{key:"updateGroupAtInfoList",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:"updateTopic",value:function(e){ut(e.selfInfo)||this.updateSelfInfo(e.selfInfo),ut(e.muteAllMembers)||(this.muteAllMembers=1===e.muteAllMembers),ft(this,e,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(e){return 0!==ft(this.selfInfo,e,[],[""])}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}}]),e}(),Su=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="TopicModule",t._topicMap=new Map,t._getTopicTimeMap=new Map,t.TOPIC_CACHE_TIME=300,t.TOPIC_LAST_ACTIVE_TIME=3600,t.getInnerEmitterInstance().on(bi,t._onCloudConfigUpdated,h(t)),t}return a(s,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("topic_cache_time"),t=this.getCloudConfig("topic_last_active_time");ut(e)||(this.TOPIC_CACHE_TIME=Number(e)),ut(t)||(this.TOPIC_LAST_ACTIVE_TIME=Number(t))}},{key:"onTopicCreated",value:function(e){var t=e.groupID;this.resetGetTopicTime(t),this.emitOuterEvent(k.TOPIC_CREATED,e)}},{key:"onTopicDeleted",value:function(e){var t=this,n=e.groupID,o=e.topicIDList;(void 0===o?[]:o).forEach((function(e){t._deleteLocalTopic(n,e)})),this.emitOuterEvent(k.TOPIC_DELETED,e)}},{key:"onTopicMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=e.messageRemindType,s=this.getLocalTopic(t,n);if(s){var a=s.updateSelfInfo({messageRemindType:o});a&&this.emitOuterEvent(k.TOPIC_UPDATED,{groupID:t,topic:s}),He.d("".concat(this._n,".onTopicMessageRemindTypeUpdated topicID:").concat(n)+" messageRemindType:".concat(o," isTopicUpdated:").concat(a))}}},{key:"onTopicProfileUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=this.getLocalTopic(t,n);o&&(o.updateTopic(e),this.emitOuterEvent(k.TOPIC_UPDATED,{groupID:t,topic:o}))}},{key:"onConversationProxy",value:function(e){var t=e.topicID,n=e.unreadCount,o=e.groupAtInfoList,s=Kt(t),a=this.getLocalTopic(s,t),r=!1;a&&(ut(n)||a.unreadCount===n||(a.updateUnreadCount(n),r=!0),ut(o)||(a.updateGroupAtInfoList(o),r=!0)),r&&this.emitOuterEvent(k.TOPIC_UPDATED,{groupID:s,topic:a})}},{key:"onMessageSent",value:function(e){var t=e.groupID,n=e.topicID,o=e.lastMessage,s=this.getLocalTopic(t,n);s&&(s.nextMessageSeq+=1,s.updateLastMessage(o),this.emitOuterEvent(k.TOPIC_UPDATED,{groupID:t,topic:s}))}},{key:"onMessageModified",value:function(e){var t=e.to,n=e.time,o=e.sequence,s=e.elements,a=e.cloudCustomData,r=e.messageVersion,i=Kt(t),u=this.getLocalTopic(i,t);if(u){var c=u.lastMessage;He.d("".concat(this._n,".onMessageModified topicID:").concat(t," lastMessage:"),JSON.stringify(c),"options:",JSON.stringify(e)),c&&(null===c.payload||c.lastTime===n&&c.lastSequence===o&&c.version!==r)&&(c.type=s[0].type,c.payload=s[0].content,c.messageForShow=Wt(c.type,c.payload,this.isIntl()),c.cloudCustomData=a,c.version=r,c.lastSequence=o,c.lastTime=n,this.emitOuterEvent(k.TOPIC_UPDATED,{groupID:i,topic:u}))}}},{key:"onMessageRevoked",value:function(e){var t=this;if(0!==e.length){var n=null,o=null,s=!1;e.forEach((function(e){var a=e.to;o=Kt(a),(n=t.getLocalTopic(o,a))&&(n.reduceUnreadCount()&&(s=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(e.revoker),s=!0))})),s&&this.emitOuterEvent(k.TOPIC_UPDATED,{groupID:o,topic:n})}}},{key:"isLastMessageRevoked",value:function(e){var t=e.topicID,n=e.sequence,o=Kt(t),s=this.getLocalTopic(o,t),a=!1;return s&&(a=s.isLastMessageRevoked({sequence:n})),a}},{key:"getJoinedCommunityList",value:function(){return this.getModule(Fn).getGroupList({isGroupWithTopicOnly:!0}).then((function(e){var t=e.data.groupList;return Li({groupList:void 0===t?[]:t})})).catch((function(e){return Oi(e)}))}},{key:"createTopicInCommunity",value:function(e){var n=this,o="".concat(this._n,".").concat("createTopicInCommunity"),s=e.topicID;if(!ut(s)&&!At(s))return Oi({code:Hr});if(e.topicName&&!1===this._filterProfanity("topicName",e))return Oi({code:Wr});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Oi({code:Wr});if(e.notification&&!1===this._filterProfanity("notification",e))return Oi({code:Wr});var a=new li("createTopicInCommunity");return this.request({protocolName:sa,requestData:t({},e)}).then((function(s){var r=s.data.topicID;return a.setMessage("topicID:".concat(r)).setNetworkType(n.getNetworkType()).end(),He.l("".concat(o," ok")),n._updateTopicMap([t(t({},e),{},{topicID:r})]),Li({topicID:r})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}},{key:"deleteTopicFromCommunity",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteTopicFromCommunity"),o=e.groupID,s=e.topicIDList,a=void 0===s?[]:s,r=new li("deleteTopicFromCommunity");return r.setMessage("groupID:".concat(o," topicIDList:").concat(a)),this.request({protocolName:aa,requestData:{groupID:o,topicIDList:a}}).then((function(e){var n=e.data.resultList,s=[],a=[];(void 0===n?[]:n).forEach((function(e){var t=e.topicID,n=e.errorCode,o=e.errorInfo;0===n?s.push({topicID:t}):a.push({topicID:t,code:n,message:o})}));var i="success count:".concat(s.length,", fail count:").concat(a.length);return r.setMoreMessage("".concat(i)).setNetworkType(t.getNetworkType()).end(),He.l("".concat(i)),s.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),Li({successTopicList:s,failureTopicList:a})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"updateTopicProfile",value:function(e){var n=this,o="".concat(this._n,".").concat("updateTopicProfile");if(He.l("".concat(o," options:"),e),e.topicName&&!1===this._filterProfanity("topicName",e))return Oi({code:Wr});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Oi({code:Wr});if(e.notification&&!1===this._filterProfanity("notification",e))return Oi({code:Wr});var s=new li("updateTopicProfile");return s.setMessage("groupID:".concat(e.groupID," topicID:").concat(e.topicID)),ut(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?"On":"Off"),this.request({protocolName:ra,requestData:t({},e)}).then((function(){return s.setNetworkType(n.getNetworkType()).end(),He.l("".concat(o," ok")),n._updateTopicMap([e]),Li({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}},{key:"getTopicList",value:function(e){var n=this,o="".concat(this._n,".").concat("getTopicList"),s=e.groupID,a=e.topicIDList,r=void 0===a?[]:a,i=0===r.length,u=new li("getTopicList");if(u.setMessage("groupID:".concat(s)),this._getTopicTimeMap.has(s)){var c=this._getTopicTimeMap.get(s),l=c.isGetAll,p=c.time;if((l||!l&&!i)&&Date.now()-p<1e3*this.TOPIC_CACHE_TIME){var d=this._getLocalTopicList(s,r);if(i||d.length===r.length)return u.setNetworkType(this.getNetworkType()).setMoreMessage("from cache, topic count:".concat(d.length)).end(),He.l("".concat(o," groupID:").concat(s," from cache, topic count:").concat(d.length)),Ni({successTopicList:d,failureTopicList:[]})}}return this.request({protocolName:ia,requestData:{groupID:s,topicIDList:r}}).then((function(e){var a=e.data.topicInfoList,r=[],c=[],l=[];(void 0===a?[]:a).forEach((function(e){var n=e.topic,o=e.selfInfo,s=e.errorCode,a=e.errorInfo,i=n.topicID;0===s?(r.push(t(t({},n),{},{selfInfo:o})),c.push(i)):l.push({topicID:i,code:s,message:a})})),n._updateTopicMap(r),n._handleTopicAtInfo(r);var p="success count:".concat(c.length,", fail count:").concat(l.length);u.setNetworkType(n.getNetworkType()).setMoreMessage("".concat(p)).end(),He.l("".concat(o," groupID:").concat(s," from remote, ").concat(p));var d=[];return Zt(c)||(n._getTopicTimeMap.set(s,{time:Date.now(),isGetAll:i}),d=n._getLocalTopicList(s,c)),Li({successTopicList:d,failureTopicList:l})})).catch((function(e){return n.probeNetwork(e).then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}},{key:"hasLocalTopic",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:"getLocalTopic",value:function(e,t){var n=null;return this._topicMap.has(e)&&(n=this._topicMap.get(e).get(t)),n}},{key:"_getLocalTopicList",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._topicMap.get(e),o=[];return n&&(o=m(n.values())),0===t.length?o:o.filter((function(e){return t.includes(e.topicID)}))}},{key:"_deleteLocalTopic",value:function(e,t){this._topicMap.has(e)&&(this._topicMap.get(e).delete(t),He.l("".concat(this._n,"._deleteLocalTopic groupID:").concat(e," topicID:").concat(t)))}},{key:"_updateTopicMap",value:function(e){var t=this,n=[];(e.forEach((function(e){var o=e.groupID,s=e.topicID,a=null;t._topicMap.has(o)||t._topicMap.set(o,new Map),t._topicMap.get(o).has(s)?(a=t._topicMap.get(o).get(s)).updateTopic(e):(t._getTopicLastMessage(e),a=new ku(e,t.isIntl()),t._topicMap.get(o).set(s,a));var r=t._computeUnreadCount(a);a.updateUnreadCount(r),n.push({conversationID:"".concat(S.CONV_GROUP).concat(s),type:S.CONV_TOPIC,unreadCount:r})})),n.length>0)&&this.getModule(Hn).updateTopicConversation(n)}},{key:"resetGetTopicTime",value:function(e){var t=this;ut(e)?m(this._getTopicTimeMap.keys()).forEach((function(e){t._getTopicTimeMap.set(e,0)})):this._getTopicTimeMap.set(e,0)}},{key:"getTopicListOnReconnected",value:function(){var e=this,t=m(this._topicMap.keys()),n=[];t.forEach((function(t){var o=[];e._getLocalTopicList(t).forEach((function(t){var n=t.lastMessage.lastTime,s=void 0===n?0:n;Date.now()-1e3*s<1e3*e.TOPIC_LAST_ACTIVE_TIME&&o.push(t.topicID)})),o.length>0&&n.push({groupID:t,topicIDList:o})})),He.l("".concat(this._n,".getTopicListOnReconnected. active community count:").concat(n.length)),this._relayGetTopicList(n)}},{key:"_relayGetTopicList",value:function(e){var t=this;if(0!==e.length){var n=e.shift(),o=n.topicIDList.length>5?"topicIDList.length:".concat(n.topicIDList.length):"topicIDList:".concat(n.topicIDList),s=new li("relayGetTopicList");s.setMessage(o),He.l("".concat(this._n,"._relayGetTopicList. ").concat(o)),this.getTopicList(n).then((function(){s.setNetworkType(t.getNetworkType()).end(),t._relayGetTopicList(e)})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),o=t[0],a=t[1];s.setError(n,o,a).end()})),t._relayGetTopicList(e)}))}}},{key:"_handleTopicAtInfo",value:function(e){var n=this;0!==e.length&&e.forEach((function(e){var o=e.groupID,s=e.topicID,a=e.groupAtInfoList,r=[];ut(a)||(a.forEach((function(e){r.push(t(t({},e),{},{groupID:o,topicID:s}))})),n.getModule(Hn).onNewGroupAtTips({dataList:r}))}))}},{key:"_getTopicLastMessage",value:function(e){if(!ut(e.lastMsg)){var t={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:"",nick:e.lastMsg.nick,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData,isRevoked:2===e.lastMsg.isPlaceMessage,revoker:Zt(e.lastMsg.revokerInfo)?null:e.lastMsg.revokerInfo.revoker};e.lastMessage=t}}},{key:"deleteTopicListInCommunity",value:function(e){var t=this,n=this._getLocalTopicList(e),o=this.getModule(Hn);n.forEach((function(n){var s=n.topicID;t._deleteLocalTopic(e,s),t._getTopicTimeMap.delete(e),o.deleteLocalConversation("".concat(S.CONV_GROUP).concat(s))}))}},{key:"_computeUnreadCount",value:function(e){var t=e.selfInfo,n=t.excludedUnreadSequenceList,o=t.readedSequence,s=e.nextMessageSeq-e.selfInfo.readedSequence-1;if(it(n)){var a=0;n.forEach((function(t){t>=o&&t<=e.nextMessageSeq-1&&(a+=1)})),a>=1&&(s-=a)}return s<0?0:s}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(io);if(!n)return!0;var o=n.filterText(t[e],z),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"updateLastMessage",value:function(e,t){var n=Kt(e),o=this.getLocalTopic(n,e);if(o){var s=t.sequence+1;o.updateNextMessageSeq(s),o.updateLastMessage(t),this.emitOuterEvent(k.TOPIC_UPDATED,{groupID:n,topic:o})}}},{key:"getMessageExtensions",value:function(e,t){He.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t));var n=Kt(e.to);return this.request({protocolName:Rs,requestData:{groupID:n,topicID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;He.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n));var o=Kt(e.to);return this.request({protocolName:As,requestData:{groupID:o,topicID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),s}(po),Lu=function(){function e(t){o(this,e),this._userModule=t,this._n="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}return a(e,[{key:"setExpirationTime",value:function(e){this.expirationTime=e}},{key:"getUserProfile",value:function(e){var t=this,n=e.userIDList;e.fromAccount=this._userModule.getMyAccount(),n.length>100&&(He.w("".concat(this._n,".getUserProfile ").concat(Jt(100))),n.length=100);for(var o,s=[],a=[],r=0,i=n.length;r5?"userIDList.length:".concat(n.length):"userIDList:".concat(n)),this._userModule.request({protocolName:Io,requestData:e}).then((function(e){l.setNetworkType(t._userModule.getNetworkType()).end(),He.i("".concat(t._n,".getUserProfile ok"));var n=t._handleResponse(e).concat(a);return Li(u?n[0]:n)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),He.e("".concat(t._n,".getUserProfile failed. error:"),e),Oi(e)}))}},{key:"getMyProfile",value:function(){var e=this._userModule.getMyAccount();if(He.l("".concat(this._n,".getMyProfile myAccount:").concat(e)),this._fillMap(),this._containsAccount(e)){var t=this._getProfileFromMap(e);return He.d("".concat(this._n,".getMyProfile from cache, myProfile:")+JSON.stringify(t)),Ni(t)}return this.getUserProfile({fromAccount:e,userIDList:[e],bFromGetMyProfile:!0})}},{key:"_handleResponse",value:function(e){for(var t,n,o=_t(),s=e.data.userProfileItem,a=[],r=0,i=s.length;r-1)n.profileCustomField.push({key:t[o].tag,value:t[o].value});else switch(t[o].tag){case We.NICK:n.nick=t[o].value;break;case We.GENDER:n.gender=t[o].value;break;case We.BIRTHDAY:n.birthday=t[o].value;break;case We.LOCATION:n.location=t[o].value;break;case We.SELFSIGNATURE:n.selfSignature=t[o].value;break;case We.ALLOWTYPE:n.allowType=t[o].value;break;case We.LANGUAGE:n.language=t[o].value;break;case We.AVATAR:n.avatar=t[o].value;break;case We.MESSAGESETTINGS:n.messageSettings=t[o].value;break;case We.ADMINFORBIDTYPE:n.adminForbidType=t[o].value;break;case We.LEVEL:n.level=t[o].value;break;case We.ROLE:n.role=t[o].value;break;default:He.w("".concat(this._n,"._handleResponse unknown tag:"),t[o].tag,t[o].value)}return n}},{key:"updateMyProfile",value:function(e){var t=this,n="".concat(this._n,".updateMyProfile");if(e.nick&&!1===this._userModule.filterProfanity("nick",e))return Oi({code:Wr});if(e.selfSignature&&!1===this._userModule.filterProfanity("selfSignature",e))return Oi({code:Wr});var o=new li("updateMyProfile");o.setMessage(JSON.stringify(e));var s=(new Wi).validate(e);if(!s.valid)return o.setCode(Dr).setMoreMessage("updateMyProfile info:".concat(s.tips)).setNetworkType(this._userModule.getNetworkType()).end(),He.e("".concat(n," info:").concat(s.tips)),Oi({code:Dr});var a=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&("profileCustomField"===r?e.profileCustomField.forEach((function(e){a.push({tag:e.key,value:e.value})})):a.push({tag:We[r.toUpperCase()],value:e[r]}));if(0===a.length){var i=new Ei({code:kr});return o.setError(i,!0,this._userModule.getNetworkType()).end(),He.e("".concat(n," failed. error:"),i),Oi(i)}return this._userModule.request({protocolName:Co,requestData:{fromAccount:this._userModule.getMyAccount(),profileItem:a}}).then((function(s){o.setNetworkType(t._userModule.getNetworkType()).end(),He.i("".concat(n," ok"));var a=t._updateMap(t._userModule.getMyAccount(),e);return t._userModule.emitOuterEvent(k.PROFILE_UPDATED,[a]),Ni(a)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"onProfileModified",value:function(e){var t=e.dataList;if(!Zt(t)){var n,o,s=t.length;He.d("".concat(this._n,".onProfileModified count:").concat(s," dataList:"),e.dataList);for(var a=[],r=0;r0&&(this._userModule.emitInnerEvent(wi,a),this._userModule.emitOuterEvent(k.PROFILE_UPDATED,a))}}},{key:"_fillMap",value:function(){if(0===this.accountProfileMap.size){for(var e=this._getCachedProfiles(),t=Date.now(),n=0,o=e.length;n0&&s.push(n)):s.push(t.userID));0!==s.length&&(He.i("".concat(this._n,".onConversationsProfileUpdated toAccountList:").concat(s)),this.getUserProfile({userIDList:s}))}},{key:"getNickAndAvatarByUserID",value:function(e){if(this._containsAccount(e)){var t=this._getProfileFromMap(e);return{nick:t.nick,avatar:t.avatar}}return{nick:"",avatar:""}}},{key:"reset",value:function(){this._flushMap(!0),this.accountProfileMap.clear()}}]),e}(),Eu=a((function e(t){o(this,e),Zt||(this.userID=t.userID||"",this.timeStamp=t.timeStamp||0)})),Au=function(){function e(t){o(this,e),this._userModule=t,this._n="BlacklistHandler",this._blacklistMap=new Map,this.startIndex=0,this.maxLimited=100,this.currentSequence=0}return a(e,[{key:"getLocalBlacklist",value:function(){return m(this._blacklistMap.keys())}},{key:"getBlacklist",value:function(){var e=this,t="".concat(this._n,".getBlacklist"),n={fromAccount:this._userModule.getMyAccount(),maxLimited:this.maxLimited,startIndex:0,lastSequence:this.currentSequence},o=new li("getBlacklist");return this._userModule.request({protocolName:To,requestData:n}).then((function(n){var s=n.data,a=s.blackListItem,r=s.currentSequence,i=Zt(a)?0:a.length;o.setNetworkType(e._userModule.getNetworkType()).setMessage("count:".concat(i)).end(),He.i("".concat(t," ok")),e.currentSequence=r,e._handleResponse(a,!0),e._userModule.emitOuterEvent(k.BLACKLIST_UPDATED,m(e._blacklistMap.keys()))})).catch((function(n){return e._userModule.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];o.setError(n,s,a).end()})),He.e("".concat(t," failed. error:"),n),Oi(n)}))}},{key:"addBlacklist",value:function(e){var t=this,n=new li("addToBlacklist"),o="".concat(this._n,".addBlacklist"),s=this._userModule.getMyAccount();if(1===e.userIDList.length&&e.userIDList[0]===s){var a=Sr,r=this._userModule.getErrorMessage(a);n.setCode(a).setMessage(r).setNetworkType(this._userModule.getNetworkType()).end();var i=new Ei({code:a});return He.e("".concat(o," failed. error:"),i),Oi(i)}return e.userIDList.includes(s)&&(e.userIDList=e.userIDList.filter((function(e){return e!==s}))),e.fromAccount=this._userModule.getMyAccount(),e.toAccount=e.userIDList,this._userModule.request({protocolName:Do,requestData:e}).then((function(s){return n.setNetworkType(t._userModule.getNetworkType()).setMessage(e.userIDList.length>5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),He.i("".concat(o," ok")),t._handleResponse(s.resultItem,!0),Li(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var o=v(t,2),s=o[0],a=o[1];n.setError(e,s,a).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}},{key:"_handleResponse",value:function(e,t){if(!Zt(e))for(var n,o,s,a=0,r=e.length;a5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),He.i("".concat(n," ok")),t._handleResponse(s.data.resultItem,!1),Li(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"onAccountDeleted",value:function(e){for(var t,n=[],o=0,s=e.length;o0&&(He.l("".concat(this._n,".onAccountDeleted count:").concat(n.length," userIDList:"),n),this._userModule.emitOuterEvent(k.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(e){for(var t,n=[],o=0,s=e.length;o0&&(He.l("".concat(this._n,".onAccountAdded count:").concat(n.length," userIDList:"),n),this._userModule.emitOuterEvent(k.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),e}(),Ru=function(e){var t=String(e).replace(/[=]+$/,""),n="";if(t.length%4==1)return"";for(var o,s,a=0,r=0;s=t.charAt(r++);~s&&(o=a%4?64*o+s:s,a++%4)?n+=String.fromCharCode(255&o>>(-2*a&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);try{return decodeURIComponent(escape(n))}catch(i){return""}},Nu=function(){function e(t){o(this,e),this._userModule=t,this._n="UserStatusHandler",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userModule.getInnerEmitterInstance().on(bi,this._onCloudConfigUpdated,this)}return a(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._userModule.getCloudConfig("status_query_count"),t=this._userModule.getCloudConfig("status_sub_count"),n=this._userModule.getCloudConfig("status_unsub_count");He.l("".concat(this._n,"._onCloudConfigUpdated statusQueryCount:").concat(e," statusSubscribeCount:").concat(t)+" statusUnsubscribeCount:".concat(n)),ut(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),ut(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(t,10)),ut(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(n,10))}},{key:"onUserStatusUpdated",value:function(e){var t=e.dataList,n=this._userModule.getMyUserID(),o=this._userModule.getModule(Kn),s=t.map((function(e){var t=e.to,s=e.statusType,a=e.customStatus,r=Ru(a);return t===n&&o.setCustomStatus(r),{userID:t,statusType:s,customStatus:r}}));this._userModule.emitOuterEvent(k.USER_STATUS_UPDATED,s)}},{key:"setSelfStatus",value:function(e){var t=this,n="".concat(this._n,".setSelfStatus");if(!1===this._userModule.filterProfanity("customStatus",e))return Oi({code:Wr});var o=new li("setSelfStatus"),s=e.customStatus;return this._userModule.request({protocolName:ua,requestData:{customStatus:s}}).then((function(e){return o.setNetworkType(t._userModule.getNetworkType()).setMessage("customStatus:".concat(s)).end(),He.l("".concat(n," ok. customStatus:").concat(s)),t._userModule.getModule(Kn).setCustomStatus(s),Li({userID:t._userModule.getMyUserID(),statusType:1,customStatus:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"getUserStatus",value:function(e){var t=this,n="".concat(this._n,".getUserStatus"),o=e.userIDList,s=void 0===o?[]:o,a=this._userModule.getMyUserID(),r=m(s),i=void 0,u=r.indexOf(a);if(u>-1){r.splice(u,1);var c=this._userModule.getModule(Kn).getCustomStatus();i={userID:a,statusType:1,customStatus:c}}if(0===r.length)return Ni({successUserList:[i],failureUserList:[]});if(!this._userModule.canIUse(B.USER_STATUS))return Oi({code:Kr});r.length>this.MAX_QUERY_USER_COUNT&&(He.w("".concat(n," ").concat(Jt(this.MAX_QUERY_USER_COUNT))),r=s.slice(0,this.MAX_QUERY_USER_COUNT));var l=new li("getUserStatus");return this._userModule.request({protocolName:ca,requestData:{userIDList:r}}).then((function(e){var o=e.data,a=o.successUserList,r=void 0===a?[]:a,u=o.failureUserList,c=void 0===u?[]:u,p=r.map((function(e){var t=e.userID,n=e.statusType,o=e.customStatus;return{userID:t,statusType:n,customStatus:Ru(o)}})),d=c.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:Zt(n)?t:n,code:o,message:s}}));ut(i)||p.unshift(i);var g="userID count:".concat(s.length,", success count:").concat(p.length,", fail count:").concat(d.length);return l.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(g)).end(),He.l("".concat(n," ok. ").concat(g,".")),Li({successUserList:p,failureUserList:d})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setMessage("userID count:".concat(s.length)).setError(e,o,a).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"subscribeUserStatus",value:function(e){var t=this;if(!this._userModule.canIUse(B.USER_STATUS))return Oi({code:Kr});var n="".concat(this._n,".subscribeUserStatus"),o=e.userIDList,s=void 0===o?[]:o,a=m(s);a.length>this.MAX_SUBSCRIBE_USER_COUNT&&(He.w("".concat(n," ").concat(Jt(this.MAX_SUBSCRIBE_USER_COUNT))),a=s.slice(0,this.MAX_SUBSCRIBE_USER_COUNT));var r=new li("subscribeUserStatus"),i="userID count:".concat(s.length);return He.l("".concat(n," ").concat(i)),this._userModule.request({protocolName:la,requestData:{userIDList:a}}).then((function(e){var o=e.data.failureUserList,s=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:Zt(n)?t:n,code:o,message:s}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(i," fail count:").concat(s.length)).end(),He.l("".concat(n," ok. fail count:").concat(s.length,".")),Li({failureUserList:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setMessage("".concat(i)).setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"unsubscribeUserStatus",value:function(e){var t=this;if(!this._userModule.canIUse(B.USER_STATUS))return Oi({code:Kr});var n="".concat(this._n,".unsubscribeUserStatus"),o=(e||{}).userIDList,s=void 0===o?[]:o,a=m(s);s.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(He.w("".concat(n," ").concat(Jt(this.MAX_UNSUBSCRIBE_USER_COUNT))),a=s.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT));var r=new li("unsubscribeUserStatus"),i="userID count:".concat(s.length);He.l("".concat(n," ").concat(i));var u={userIDList:a};return 0===a.length&&(u.userIDList=void 0,u.unsubscribeAll=1),this._userModule.request({protocolName:pa,requestData:u}).then((function(e){var o=e.data.failureUserList,s=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:Zt(n)?t:n,code:o,message:s}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(i," fail count:").concat(s.length)).end(),He.l("".concat(n," ok. fail count:").concat(s.length,".")),Li({failureUserList:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setMessage("".concat(i)).setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),e}(),Ou=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="UserModule",s._profileHandler=new Lu(h(s)),s._blacklistHandler=new Au(h(s)),s._userStatusHandler=new Nu(h(s)),s.getInnerEmitterInstance().on(Ui,s.onContextUpdated,h(s)),s}return a(n,[{key:"onContextUpdated",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"onProfileModified",value:function(e){this._profileHandler.onProfileModified(e)}},{key:"onRelationChainModified",value:function(e){var t=e.dataList;if(!Zt(t)){var n=[];t.forEach((function(e){e.blackListDelAccount&&n.push.apply(n,m(e.blackListDelAccount))})),n.length>0&&this._blacklistHandler.onAccountDeleted(n);var o=[];t.forEach((function(e){e.blackListAddAccount&&o.push.apply(o,m(e.blackListAddAccount))})),o.length>0&&this._blacklistHandler.onAccountAdded(o)}}},{key:"onConversationsProfileUpdated",value:function(e){this._profileHandler.onConversationsProfileUpdated(e)}},{key:"getMyAccount",value:function(){return this.getMyUserID()}},{key:"getMyProfile",value:function(){return this._profileHandler.getMyProfile()}},{key:"getStorageModule",value:function(){return this.getModule(Wn)}},{key:"filterProfanity",value:function(e,t){var n=this.getModule(io);if(!n)return!0;var o=n.filterText(t[e],Y),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"isMyFriend",value:function(e){var t=this.getModule(xn);return!!t&&t.isMyFriend(e)}},{key:"getUserProfile",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:"getNickAndAvatarByUserID",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:"getLocalBlacklist",value:function(){var e=this._blacklistHandler.getLocalBlacklist();return Ni(e)}},{key:"addBlacklist",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:"deleteBlacklist",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:"onUserStatusUpdated",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:"setSelfStatus",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),n}(po),Gu=function(){function e(t,n){o(this,e),this._m=t,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||"",this._userSig=n.userSig||"",this._version="2.27.0",this._a2Key="",this._tinyID="",this._customStatus="",this._contentType="json",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||"",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._proxyServer=n.proxyServer,this._fileUploadProxy=n.fileUploadProxy,this._fileDownloadProxy=n.fileDownloadProxy}return a(e,[{key:"isLoggedIn",value:function(){return this._isLoggedIn}},{key:"isOversea",value:function(){return this._oversea}},{key:"isPrivateNetWork",value:function(){return this._proxyServer}},{key:"isDevMode",value:function(){return this._isDevMode}},{key:"isSingaporeSite",value:function(){return this._SDKAppID>=2e7&&this._SDKAppID<3e7||this._SDKAppID>=172e7&&this._SDKAppID<173e7}},{key:"isKoreaSite",value:function(){return this._SDKAppID>=3e7&&this._SDKAppID<4e7||this._SDKAppID>=173e7&&this._SDKAppID<174e7}},{key:"isGermanySite",value:function(){return this._SDKAppID>=4e7&&this._SDKAppID<5e7||this._SDKAppID>=174e7&&this._SDKAppID<175e7}},{key:"isIndiaSite",value:function(){return this._SDKAppID>=5e7&&this._SDKAppID<6e7||this._SDKAppID>=175e7&&this._SDKAppID<176e7}},{key:"isJapanSite",value:function(){return this._SDKAppID>=6e7&&this._SDKAppID<7e7||this._SDKAppID>=176e7&&this._SDKAppID<177e7}},{key:"isUSASite",value:function(){return this._SDKAppID>=7e7&&this._SDKAppID<8e7||this._SDKAppID>=177e7&&this._SDKAppID<178e7}},{key:"isIntl",value:function(){return 0===(e=this._SDKAppID)||e>=2e7&&e<8e7||e>=172e7&&e<178e7;var e}},{key:"isUnlimitedAVChatRoom",value:function(){return this._unlimitedAVChatRoom}},{key:"setUserID",value:function(e){this._userID=e}},{key:"getUserID",value:function(){return this._userID}},{key:"setUserSig",value:function(e){this._userSig=e}},{key:"getUserSig",value:function(){return this._userSig}},{key:"getSDKAppID",value:function(){return this._SDKAppID}},{key:"setTinyID",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:"getTinyID",value:function(){return this._tinyID}},{key:"setCustomStatus",value:function(e){this._customStatus=e}},{key:"getCustomStatus",value:function(){return this._customStatus}},{key:"getScene",value:function(){return Ne?window.tencent_cloud_im_csig_flutter_for_web_25F_cy:this._isTUIKit()?"tuikit":this._scene}},{key:"getInstanceID",value:function(){return this._instanceID}},{key:"getStatusInstanceID",value:function(){return this._statusInstanceID}},{key:"setStatusInstanceID",value:function(e){this._statusInstanceID=e}},{key:"getVersion",value:function(){return this._version}},{key:"getA2Key",value:function(){return this._a2Key}},{key:"setA2Key",value:function(e){this._a2Key=e}},{key:"getContentType",value:function(){return this._contentType}},{key:"getProxyServer",value:function(){return this._proxyServer}},{key:"getFileUploadProxy",value:function(){return this._fileUploadProxy}},{key:"getFileDownloadProxy",value:function(){return this._fileDownloadProxy}},{key:"_isTUIKit",value:function(){var e=!1,t=!1,n=!1,o=!1,s=[];ue&&(s=Object.keys(le)),ce&&(s=ie?Object.keys(uni):Object.keys(window));for(var a=0,r=s.length;a0){for(var c=0,l=u.length;c0&&void 0!==arguments[0]?arguments[0]:0;if(!this.isLoggedIn())return Oi({code:Ca});var n=new li("logout");n.setNetworkType(this.getNetworkType()).setMessage("identifier:".concat(this.getMyUserID())).end(!0);var o="".concat(this._n,".logout");return He.i("".concat(o," type:").concat(t)),0===t&&this._m.setNotReadyReason(Vr),this.request({protocolName:ho,requestData:{type:t}}).then((function(){return e.resetReady(),Ni({})})).catch((function(t){return He.e("".concat(o," error:"),t),e.resetReady(),Ni({})}))}},{key:"_fetchCloudControlConfig",value:function(){this.getModule(to).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return uni.getStorageSync("timUniAppInstanceID")}},{key:"_hello",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:_o,requestData:{isWebUniapp:this._isWebUniapp}}).catch((function(t){He.w("".concat(e._n,"._hello error:"),t)}))}},{key:"getLastWsHelloTs",value:function(){return this._lastWsHelloTs}},{key:"_checkLoginInfo",value:function(e){var t=0;return Zt(this.getModule(Kn).getSDKAppID())?t=va:Zt(e.userID)?t=ma:Zt(e.userSig)&&(t=Ma),{code:t}}},{key:"_isReactUIKit",value:function(){return ce&&void 0!==window.tencent_cloud_im_csig_react_uikit_23F_xa}},{key:"onMultipleAccountKickedOut",value:function(e){var t=this;new li("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),He.w("".concat(this._n,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(k.KICKED_OUT,{type:S.KICKED_OUT_MULT_ACCOUNT}),t._m.setNotReadyReason(Fr),t._m.reset()}))}},{key:"onMultipleDeviceKickedOut",value:function(e){var t=this;new li("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),He.w("".concat(this._n,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(k.KICKED_OUT,{type:S.KICKED_OUT_MULT_DEVICE}),t._m.setNotReadyReason(qr),t._m.reset()}))}},{key:"onUserSigExpired",value:function(){new li("kickedOut").setNetworkType(this.getNetworkType()).setMessage(S.KICKED_OUT_USERSIG_EXPIRED).end(!0),He.w("".concat(this._n,".onUserSigExpired: userSig expired")),0!==this.getModule(Kn).getStatusInstanceID()&&(this.emitOuterEvent(k.KICKED_OUT,{type:S.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(xr),this._m.reset())}},{key:"onRestApiKickedOut",value:function(e){(new li("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_REST_API," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),He.w("".concat(this._n,".onRestApiKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),0!==this.getModule(Kn).getStatusInstanceID())&&(this.emitOuterEvent(k.KICKED_OUT,{type:S.KICKED_OUT_REST_API}),this._m.setNotReadyReason(Br),this._m.reset(),this.getModule($n).onRestApiKickedOut())}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),n}(po);function Uu(){return null}var bu=function(){function e(t){o(this,e),this._m=t,this._n="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}return a(e,[{key:"_errorTolerantHandle",value:function(){ue||!ut(window)&&this._canIUseCookies()||(this.getItem=Uu,this.setItem=Uu,this.removeItem=Uu,this.clear=Uu)}},{key:"onCheckTimer",value:function(e){if(e%20==0){if(0===this._storageQueue.size)return;this._doFlush()}}},{key:"_doFlush",value:function(){try{var e,t=D(this._storageQueue);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];this._setStorageSync(this._getKey(o),s)}}catch(a){t.e(a)}finally{t.f()}this._storageQueue.clear()}catch(r){He.w("".concat(this._n,"._doFlush error:"),r)}}},{key:"_getPrefix",value:function(){var e=this._m.getModule(Kn);return"TIM_".concat(e.getSDKAppID(),"_").concat(e.getUserID(),"_")}},{key:"_getKey",value:function(e){return"".concat(this._getPrefix()).concat(e)}},{key:"getItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;return this.getStorageSync(n)}catch(o){return He.w("".concat(this._n,".getItem error:"),o),{}}}},{key:"setItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(n){var s=o?this._getKey(e):e;this._setStorageSync(s,t)}else this._storageQueue.set(e,t)}},{key:"clear",value:function(){try{ue?le.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(e){He.w("".concat(this._n,".clear error:"),e)}}},{key:"removeItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;this._removeStorageSync(n)}catch(o){He.w("".concat(this._n,".removeItem error:"),o)}}},{key:"getSize",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"b";try{var o={size:0,limitSize:5242880,unit:n};if(Object.defineProperty(o,"leftSize",{enumerable:!0,get:function(){return o.limitSize-o.size}}),ue&&(o.limitSize=1024*le.getStorageInfoSync().limitSize),e)o.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(ue){var s=le.getStorageInfoSync(),a=s.keys;a.forEach((function(e){o.size+=JSON.stringify(t.getStorageSync(e)).length+t._getKey(e).length}))}else if(this._canIUseCookies())for(var r in localStorage)localStorage.hasOwnProperty(r)&&(o.size+=localStorage.getItem(r).length+r.length);return this._convertUnit(o)}catch(i){He.w("".concat(this._n," error:"),i)}}},{key:"_convertUnit",value:function(e){var t={},n=e.unit;for(var o in t.unit=n,e)"number"==typeof e[o]&&("kb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024):"mb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024/1024):t[o]=e[o]);return t}},{key:"_setStorageSync",value:function(e,t){ue?se?my.setStorageSync({key:e,data:t}):le.setStorageSync(e,t):this._canIUseCookies()&&localStorage.setItem(e,JSON.stringify(t))}},{key:"getStorageSync",value:function(e){return ue?se?my.getStorageSync({key:e}).data:le.getStorageSync(e):this._canIUseCookies()?JSON.parse(localStorage.getItem(e)):{}}},{key:"_removeStorageSync",value:function(e){ue?se?my.removeStorageSync({key:e}):le.removeStorageSync(e):this._canIUseCookies()&&localStorage.removeItem(e)}},{key:"_canIUseCookies",value:function(){return navigator&&navigator.cookieEnabled&&localStorage}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._doFlush()}}]),e}(),wu=function(){function e(t){o(this,e),this._n="SSOLogBody",this._report=[]}return a(e,[{key:"pushIn",value:function(e){He.d("".concat(this._n,".pushIn"),this._report.length,e),this._report.push(e)}},{key:"backfill",value:function(e){var t;it(e)&&0!==e.length&&(He.d("".concat(this._n,".backfill"),this._report.length,e.length),(t=this._report).unshift.apply(t,m(e)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getLogsInMemory",value:function(){var e=this._report.slice();return this._reset(),e}}]),e}(),qu=function(e){var t=e.getModule(Kn);return{SDKType:10,SDKAppID:t.getSDKAppID(),SDKVersion:t.getVersion(),tinyID:Number(t.getTinyID()),userID:t.getUserID(),platform:e.getPlatform(),instanceID:t.getInstanceID(),traceID:we()}},Fu=function(e){i(s,e);var n=f(s);function s(e){var t;o(this,s),(t=n.call(this,e))._n="EventStatModule",t.TAG="im-ssolog-event",t._reportBody=new wu,t.MIN_THRESHOLD=20,t.MAX_THRESHOLD=100,t.WAITING_TIME=6e4,t.REPORT_LEVEL=[4,5,6],t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._lastReportTime=Date.now();var a=t.getInnerEmitterInstance();return a.on(Ui,t._onLoginSuccess,h(t)),a.on(bi,t._onCloudConfigUpdated,h(t)),t}return a(s,[{key:"reportAtOnce",value:function(){He.d("".concat(this._n,".reportAtOnce")),this._report()}},{key:"_onLoginSuccess",value:function(){var e=this,t=this.getModule(Wn),n=t.getItem(this.TAG,!1);!Zt(n)&<(n.forEach)&&(He.l("".concat(this._n,"._onLoginSuccess get ssolog in storage, count:").concat(n.length)),n.forEach((function(t){e._reportBody.pushIn(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("evt_rpt_threshold"),t=this.getCloudConfig("evt_rpt_waiting"),n=this.getCloudConfig("evt_rpt_level"),o=this.getCloudConfig("evt_rpt_sdkappid_bl"),s=this.getCloudConfig("evt_rpt_tinyid_wl");ut(e)||(this.MIN_THRESHOLD=Number(e)),ut(t)||(this.WAITING_TIME=Number(t)),ut(n)||(this.REPORT_LEVEL=n.split(",").map((function(e){return Number(e)}))),ut(o)||(this.REPORT_SDKAPPID_BLACKLIST=o.split(",").map((function(e){return Number(e)}))),ut(s)||(this.REPORT_TINYID_WHITELIST=s.split(","))}},{key:"pushIn",value:function(e){e instanceof li&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:"onCheckTimer",value:function(){Date.now()e.MAX_THRESHOLD&&e._flushAtOnce()}))}else this._lastReportTime=Date.now()}}},{key:"_flushAtOnce",value:function(){var e=this.getModule(Wn),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o="".concat(this._n,"._flushAtOnce");if(Zt(t))He.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var s=n.concat(t);s.length>this.MAX_THRESHOLD&&(s=s.slice(0,this.MAX_THRESHOLD)),He.l("".concat(o," count:").concat(s.length)),e.setItem(this.TAG,s,!0,!1)}}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),s}(po),xu="none",Vu="online",Bu=[Or,Jr],Hu=function(){function e(t){o(this,e),this._m=t,this._networkType="",this._n="NetMonitorModule",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}return a(e,[{key:"start",value:function(){var e=this;ue?(le.getNetworkType({success:function(t){e._networkType=t.networkType||t.subtype||"",t.networkType===xu?He.w("".concat(e._n,".start no network, please check!")):He.i("".concat(e._n,".start networkType:").concat(t.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),le.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=Vu,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback)))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:Vu})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:xu})}},{key:"_onNetworkStatusChange",value:function(e){var t=e.isConnected,n=e.networkType,o="".concat(this._n,"._onNetworkStatusChange"),s=!1;t?(He.i("".concat(o," previous:").concat(this._networkType," current:").concat(n)),this._networkType!==n&&(s=!0,this._m.getModule($n).reConnect(!0))):this._networkType!==n&&(s=!0,He.w("".concat(o," no network, please check!")),this._m.getModule($n).offline());s&&(new li("networkChange").setMessage("isConnected:".concat(t," previousNetworkType:").concat(this._networkType," networkType:").concat(n)).end(),this._networkType=n)}},{key:"probe",value:function(e){var t=this;if(!ut(e)&&Bu.includes(e.code))return Promise.resolve([!0,this._networkType]);var n="".concat(this._n,".probe");return new Promise((function(e,o){ue?le.getNetworkType({success:function(o){t._networkType=o.networkType,o.networkType===xu?(He.w("".concat(n," no network, please check!")),e([!1,o.networkType])):(He.i("".concat(n," networkType:").concat(o.networkType)),e([!0,o.networkType]))}}):t._networkType===xu?e([!1,xu]):e([!0,Vu])}))}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),ue?null!==this._mpNetworkStatusCallback&&(le.offNetworkStatusChange&&(re||ne?le.offNetworkStatusChange(this._mpNetworkStatusCallback):le.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(null!==this._webOnlineCallback&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null))}}]),e}();var Ku=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function s(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,o,a,r){if("function"!=typeof o)throw new TypeError("The listener must be a function");var i=new s(o,a||e,r),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],i]:e._events[u].push(i):(e._events[u]=i,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function i(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),i.prototype.eventNames=function(){var e,o,s=[];if(0===this._eventsCount)return s;for(o in e=this._events)t.call(e,o)&&s.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},i.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var s=0,a=o.length,r=new Array(a);s=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:"_getAuthorization",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(e){if(!0===e.getRelayFlag())return Promise.resolve();var t=this.getModule(so);switch(e.type){case S.MSG_IMAGE:return t.addTotalCount(ni),this._uploadImage(e);case S.MSG_FILE:return t.addTotalCount(ni),this._uploadFile(e);case S.MSG_AUDIO:return t.addTotalCount(ni),this._uploadAudio(e);case S.MSG_VIDEO:return t.addTotalCount(ni),this._uploadVideo(e);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(e){var n=this,o=this.getModule(Un),s=e.getElements()[0],a=o.getMessageOption(e.clientSequence);return this.doUploadImage({file:a.payload.file,to:a.to,onProgress:function(e){if(s.updatePercent(e),lt(a.onProgress))try{a.onProgress(e)}catch(t){return Oi({code:Na})}}}).then((function(o){var a,r,i=o.location,u=o.fileType,c=o.fileSize,l=o.width,p=o.height,d=o.smallImageUrl,g=o.smallImageWidth,h=o.smallImageHeight,_=o.largeImageUrl,f=o.largeImageWidth,v=o.largeImageHeight,m=n.isPrivateNetWork()?i:Dt(i);return s.updateImageFormat(u),d&&_?(a={url:d,width:g,height:h},r={url:_,width:f,height:v}):(a=qt({originUrl:m,originWidth:l,originHeight:p,min:198}),r=qt({originUrl:m,originWidth:l,originHeight:p,min:720})),s.updateImageInfoArray([{size:c,url:m,width:l,height:p},t({},r),t({},a)]),e}))}},{key:"_uploadFile",value:function(e){var t=this,n=this.getModule(Un),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadFile({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),lt(s.onProgress))try{s.onProgress(e)}catch(t){return Oi({code:Na})}}}).then((function(n){var s=n.location,a=t.isPrivateNetWork()?s:Dt(s);return o.updateFileUrl(a),e}))}},{key:"_uploadAudio",value:function(e){var t=this,n=this.getModule(Un),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadAudio({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),lt(s.onProgress))try{s.onProgress(e)}catch(t){return Oi({code:Na})}}}).then((function(n){var s=n.location,a=t.isPrivateNetWork()?s:Dt(s);return o.updateAudioUrl(a),e}))}},{key:"_uploadVideo",value:function(e){var t=this,n=this.getModule(Un),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadVideo({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),lt(s.onProgress))try{s.onProgress(e)}catch(t){return Oi({code:Na})}}}).then((function(n){var s=n.location,a=n.snapshotInfo,r=t.isPrivateNetWork()?s:Dt(s);return o.updateVideoUrl(r),Zt(a)||o.updateSnapshotInfo(a),e}))}},{key:"doUploadImage",value:function(e){var t=this;if(!e.file)return Oi({code:Fa});var n=this._checkImageType(e.file);if(!0!==n)return n;var o=this._checkImageSize(e.file);if(!0!==o)return o;var s=null;return this._setUploadFileType(Vi),this.uploadByCOS(e).then((function(e){return s=e,t.isPrivateNetWork()?Pt(e.location):Pt("https://".concat(e.location))})).then((function(e){return s.width=e.width,s.height=e.height,Promise.resolve(s)}))}},{key:"_checkImageType",value:function(e){var t="";return t=ue?e.url.slice(e.url.lastIndexOf(".")+1):e.files[0].name.slice(e.files[0].name.lastIndexOf(".")+1),Fi.indexOf(t.toLowerCase())>=0||Oi({code:xa})}},{key:"_checkImageSize",value:function(e){var t=0;return 0===(t=ue?e.size:e.files[0].size)?Oi({code:Ra}):t<20971520||Oi({code:Va})}},{key:"doUploadFile",value:function(e){return e.file?e.file.files[0].size>104857600?Oi({code:Ja}):0===e.file.files[0].size?Oi({code:Ra}):(this._setUploadFileType(Ki),this.uploadByCOS(e)):Oi({code:za})}},{key:"doUploadVideo",value:function(e){return e.file.videoFile.size>104857600?Oi({code:Wa}):0===e.file.videoFile.size?Oi({code:Ra}):-1===xi.indexOf(e.file.videoFile.type)?Oi({code:ja}):(this._setUploadFileType(Bi),ue?this.handleVideoUpload({file:e.file.videoFile,onProgress:e.onProgress}):ce?this.handleVideoUpload(e):void 0)}},{key:"handleVideoUpload",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new Ei({code:Ka}))}))}))}))}},{key:"doUploadAudio",value:function(e){return e.file?e.file.size>20971520?Oi({code:Ha}):0===e.file.size?Oi({code:Ra}):(this._setUploadFileType(Hi),this.uploadByCOS(e)):Oi({code:Ba})}},{key:"uploadByCOS",value:function(e){var t=this;if(!lt(this._cosUploadMethod))return this.outputWarning("PluginUndetected"),Oi({code:Da});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(e);var n=new li("upload"),o="".concat(this._n,".uploadByCOS"),s=Date.now(),a=this._getFile(e);return new Promise((function(r,i){var u=ue?t._createCosOptionsWXMiniApp(e):t._createCosOptionsWeb(e),c=t;t._cosUploadMethod(u,(function(e,u){var l=Object.create(null);if(u){if(e||it(u.files)&&u.files[0].error){var p=new Ei({code:Ya});return n.setError(p,!0,t.getNetworkType()).end(),He.l("".concat(o," failed. error:"),u.files[0].error),403===u.files[0].error.statusCode&&(He.w("".concat(o," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),void i(p)}l.fileName=a.name,l.fileSize=a.size,l.fileType=a.type.slice(a.type.indexOf("/")+1).toLowerCase(),l.location=ue?u.Location:u.files[0].data.Location;var d=Date.now()-s,g=c._formatFileSize(a.size),h=c._formatSpeed(1e3*a.size/d),_="size:".concat(g," time:").concat(d,"ms speed:").concat(h);He.l("".concat(o," success. name:").concat(a.name," ").concat(_)),r(l);var f=t.getModule(so);return f.addCost(ni,d),f.addFileSize(ni,a.size),void n.setNetworkType(t.getNetworkType()).setMessage(_).end()}var v=new Ei({code:Ya});n.setError(v,!0,c.getNetworkType()).end(),He.w("".concat(o," failed. error:"),e),403===e.statusCode&&(He.w("".concat(o," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),i(v)}))}))}},{key:"_uploadWithPreSigUrl",value:function(e){var t=this,n="".concat(this._n,"._uploadWithPreSigUrl"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(s,a){var r=new li("upload"),i=e.requestSnapshotUrl,u=void 0===i?void 0:i,c=g(e,ju),l=Date.now();t._cosUploadMethod(c,(function(e,i){if(e||403===i.statusCode)return r.setError(new Ei(e),!0,t.getNetworkType()).end(),He.l("".concat(n," failed, error:"),e),void a(new Ei({code:Ya}));var p=Object.create(null),d=i.data.location||"";t.isPrivateNetWork()||0!==d.indexOf("https://")&&0!==d.indexOf("http://")||(d=d.split("//")[1]),p.fileName=o.name,p.fileSize=o.size,p.fileType=o.type.slice(o.type.indexOf("/")+1).toLowerCase(),p.location=d;var g=Date.now()-l,h=t._formatFileSize(o.size),_=t._formatSpeed(1e3*o.size/g),f="size:".concat(h,",time:").concat(g,"ms,speed:").concat(_," res:").concat(JSON.stringify(i.data));He.l("".concat(n," success name:").concat(o.name,",").concat(f)),r.setNetworkType(t.getNetworkType()).setMessage(f).end();var v=t.getModule(so);v.addCost(ni,g),v.addFileSize(ni,o.size);var m=[];if(c.thumbUrl&&c.largeUrl&&(m=[t._getSmallImageInfoByUrl(c.thumbUrl,p),t._getLargeImageInfoByUrl(c.largeUrl,p)]),u&&m.push(t._getSnapshotInfoByUrl(u,p)),m.length>0)return Promise.all(m).then((function(){s(p)}));s(p)}))}))}))}},{key:"_getRawOrUploadProxyUrl",value:function(e){var t=this.getModule(Kn).getFileUploadProxy(),n=e;return t&&(n=e.replace(/^https:\/\/[^/]+/,t)),n}},{key:"_getFile",value:function(e){var t;return it(e.file.files)||(t=e.file.files,"filelist"===dt(t))?e.file.files[0]:e.file}},{key:"_formatFileSize",value:function(e){return e<1024?e+"B":e<1048576?Math.floor(e/1024)+"KB":Math.floor(e/1048576)+"MB"}},{key:"_formatSpeed",value:function(e){return e<=1048576?Vt(e/1024,1)+"KB/s":Vt(e/1048576,1)+"MB/s"}},{key:"_createCosOptionsWeb",value:function(e){var t=this._getFile(e),n=t.name,o=n.slice(n.lastIndexOf(".")),s=this._genFileName("".concat(Mt(999999)).concat(o));return{files:[{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(s),Body:t}],SliceSize:1048576,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){He.w("onProgress callback error:",n)}},onFileFinish:function(e,t,n){}}}},{key:"_createCosOptionsWXMiniApp",value:function(e){var t=this._getFile(e),n=this._genFileName(t.name),o=t.url;return{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(n),FilePath:o,onProgress:function(t){if(He.l(JSON.stringify(t)),"function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){He.w("onProgress callback error:",n)}}}}},{key:"_createCosOptionsPreSigUrl",value:function(e){var t=this,n="",o="",s=0,a=this._getFile(e);if(ue)n=this._genFileName(a.name),o=a.url,s=1;else{var r=a.name,i=r.slice(r.lastIndexOf("."));n=this._genFileName("".concat(Mt(999999)).concat(i)),o=a,s=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:n,uploadMethod:s,duration:this.duration}).then((function(s){var a=s.uploadUrl,r=s.downloadUrl,i=s.requestSnapshotUrl,u=void 0===i?void 0:i,c=s.thumbUrl,l=s.largeUrl;return{url:t._getRawOrUploadProxyUrl(a),fileType:t.uploadFileType,fileName:n,resources:o,downloadUrl:r,requestSnapshotUrl:u,thumbUrl:c,largeUrl:l,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){He.w("onProgress callback error:",n),He.e(n)}}}}))}},{key:"_genFileName",value:function(e){return"".concat(Ut(),"-").concat(e)}},{key:"_setUploadFileType",value:function(e){this.uploadFileType=e}},{key:"_getSnapshotInfoByUrl",value:function(e,t){var n=this,o=new li("getSnapshotInfo");return this.request({protocolName:Ks,requestData:{platform:this.getPlatform(),coverName:this._genFileName(Mt(99999)),requestSnapshotUrl:e}}).then((function(e){var n=(e.data||{}).snapshotUrl;return o.setMessage("snapshotUrl:".concat(n)).end(),Zt(n)?{}:Pt(n).then((function(e){t.snapshotInfo={snapshotUrl:n,snapshotWidth:e.width,snapshotHeight:e.height}}))})).catch((function(e){return He.w("".concat(n._n,"._getSnapshotInfoByUrl failed. error:"),e),o.setCode(e.errorCode).setMessage(e.errorInfo).end(),{}}))}},{key:"_getSmallImageInfoByUrl",value:function(e,t){return Pt(e).then((function(n){t.smallImageUrl=e,t.smallImageWidth=n.width,t.smallImageHeight=n.height}))}},{key:"_getLargeImageInfoByUrl",value:function(e,t){return Pt(e).then((function(n){t.largeImageUrl=e,t.largeImageWidth=n.width,t.largeImageHeight=n.height}))}},{key:"reset",value:function(){He.l("".concat(this._n,".reset"))}}]),s}(po),zu=["downloadKey","pbDownloadKey","messageList"],Ju=function(){function e(t){o(this,e),this._n="MergerMessageHandler",this._messageModule=t}return a(e,[{key:"uploadMergerMessage",value:function(e,t){var n=this,o="".concat(this._n,".").concat("uploadMergerMessage");He.d("".concat(o," message:"),e,"messageBytes:".concat(t));var s=e.payload.messageList,a=s.length,r=new li("uploadMergerMessage");return this._messageModule.request({protocolName:Qs,requestData:{messageList:s}}).then((function(e){He.d("".concat(o," ok. response:"),e.data);var s=e.data,i=s.pbDownloadKey,u=s.downloadKey,c={pbDownloadKey:i,downloadKey:u,messageNumber:a};return r.setNetworkType(n._messageModule.getNetworkType()).setMessage("".concat(a,"-").concat(t,"-").concat(u)).end(),c})).catch((function(e){throw He.w("".concat(o," failed. error:"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),e}))}},{key:"downloadMergerMessage",value:function(e){var n=this,o="".concat(this._n,".").concat("downloadMergerMessage");He.d("".concat(o," message:"),e);var s=e.payload.downloadKey,a=this._messageModule.getFileDownloadProxy(),r=new li("downloadMergerMessage");return r.setMessage("downloadKey:".concat(s)),this._messageModule.request({protocolName:Zs,requestData:{downloadKey:s}}).then((function(s){if(He.d("".concat(o," ok. response:"),s.data),lt(e.clearElement)){var i=e.payload,u=(i.downloadKey,i.pbDownloadKey,i.messageList,g(i,zu));e.clearElement(),e.setElement({type:e.type,content:t({messageList:s.data.messageList},u)},a)}else{var c=[];s.data.messageList.forEach((function(e){if(!Zt(e)){var t=new Ti(e,a);c.push(t)}})),e.payload.messageList=c,e.payload.downloadKey="",e.payload.pbDownloadKey=""}return r.setNetworkType(n._messageModule.getNetworkType()).end(),e})).catch((function(e){throw He.w("".concat(o," failed. key:").concat(s," error:"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),e}))}},{key:"createMergerMessagePack",value:function(e,t,n){return e.conversationType===S.CONV_C2C?this._createC2CMergerMessagePack(e,t,n):this._createGroupMergerMessagePack(e,t,n)}},{key:"_createC2CMergerMessagePack",value:function(e,t,n){var o=null;t&&(t.offlinePushInfo&&(o=t.offlinePushInfo),!0===t.onlineUserOnly&&(o?o.disablePush=!0:o={disablePush:!0}));var s=[];if(rt(t)&&rt(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c="";st(e.cloudCustomData)&&e.cloudCustomData.length>0&&(c=e.cloudCustomData);var l=n.pbDownloadKey,p=n.downloadKey,d=n.messageNumber,g=e.payload,h=g.title,_=g.abstractList,f=g.compatibleText,v=this._messageModule.getModule(qn),m=v&&v.isOnlineMessage(e,t)?0:void 0;return{protocolName:Mo,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:p,title:h,abstractList:_,compatibleText:f,messageNumber:d}}],cloudCustomData:c,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,messageControlInfo:0!==m?s:void 0,isSupportExtension:!0===e.isSupportExtension?1:0}}}},{key:"_createGroupMergerMessagePack",value:function(e,t,n){var o=null;t&&t.offlinePushInfo&&(o=t.offlinePushInfo);var s=[];if(rt(t)&&rt(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c="";st(e.cloudCustomData)&&e.cloudCustomData.length>0&&(c=e.cloudCustomData);var l=n.pbDownloadKey,p=n.downloadKey,d=n.messageNumber,g=e.payload,h=g.title,_=g.abstractList,f=g.compatibleText,v=this._messageModule.getModule(Fn),m=v&&v.isOnlineMessage(e,t)?1:0;return{protocolName:yo,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:p,title:h,abstractList:_,compatibleText:f,messageNumber:d}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:c,onlineOnlyFlag:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,clientTime:e.clientTime,needReadReceipt:!0!==e.needReadReceipt||v.isMessageFromOrToAVChatroom(e.to)?0:1,messageControlInfo:0===m?s:void 0,isSupportExtension:!0===e.isSupportExtension?1:0}}}}]),e}(),Xu={ERR_SVR_COMM_SENSITIVE_TEXT:80001,ERR_SVR_COMM_BODY_SIZE_LIMIT:80002,OPEN_SERVICE_OVERLOAD_ERROR:60022,ERR_SVR_MSG_PKG_PARSE_FAILED:20001,ERR_SVR_MSG_INTERNAL_AUTH_FAILED:20002,ERR_SVR_MSG_INVALID_ID:20003,ERR_SVR_MSG_PUSH_DENY:20006,ERR_SVR_MSG_IN_PEER_BLACKLIST:20007,ERR_SVR_MSG_BOTH_NOT_FRIEND:20009,ERR_SVR_MSG_NOT_PEER_FRIEND:20010,ERR_SVR_MSG_NOT_SELF_FRIEND:20011,ERR_SVR_MSG_SHUTUP_DENY:20012,ERR_SVR_GROUP_INVALID_PARAMETERS:10004,ERR_SVR_GROUP_PERMISSION_DENY:10007,ERR_SVR_GROUP_NOT_FOUND:10010,ERR_SVR_GROUP_INVALID_GROUPID:10015,ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY:10016,ERR_SVR_GROUP_SHUTUP_DENY:10017,MESSAGE_SEND_FAIL:2100,OVER_FREQUENCY_LIMIT:2996},Qu=[Na,Fa,xa,Ra,Va,za,Ja,Wa,ja,Ba,Ha,Da];function Zu(e){var t=!1;return Object.values(Xu).includes(e)&&(t=!0),(e>=120001&&e<=13e4||e>=10100&&e<=10200)&&(t=!0),t}var $u=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="MessageModule",t._messageOptionsMap=new Map,t._mergerMessageHandler=new Ju(h(t)),t}return a(s,[{key:"createTextMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Si(e),o="string"==typeof e.payload?e.payload:e.payload.text,s=new pi({text:o}),a=this._getNickAndAvatarByUserID(t);return n.setElement(s),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createImageMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Si(e);if(ue){var o=e.payload.file;if(nt(o))return void this.outputWarning("FileUnsupportedInMP","createImageMessage");var s=o.tempFiles[0].path||o.tempFiles[0].tempFilePath,a={url:s,name:s.slice(s.lastIndexOf("/")+1),size:o.tempFiles&&o.tempFiles[0].size||1,type:s.slice(s.lastIndexOf(".")+1).toLowerCase()};e.payload.file=a}else if(ce)if(nt(e.payload.file)){var r=e.payload.file;e.payload.file={files:[r]}}else if(rt(e.payload.file)&&"undefined"!=typeof uni){var i=e.payload.file.tempFiles[0];e.payload.file={files:[i]}}var u=new di({imageFormat:Ke.UNKNOWN,uuid:this._generateUUID(e.payload.file),file:e.payload.file}),c=this._getNickAndAvatarByUserID(t);return n.setElement(u),n.setNickAndAvatar(c),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createAudioMessage",value:function(e){var t=e.payload.file;if(ue){var n={url:t.tempFilePath,name:t.tempFilePath.slice(t.tempFilePath.lastIndexOf("/")+1),size:t.fileSize,second:parseInt(t.duration)/1e3,type:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(".")+1).toLowerCase()};e.payload.file=n}var o=this.getMyUserID();e.currentUser=o,e.senderTinyID=this.getMyTinyID();var s=new Si(e),a=new hi({second:Math.floor(t.duration/1e3),size:t.fileSize||t.size,url:t.tempFilePath,uuid:this._generateUUID(e.payload.file)}),r=this._getNickAndAvatarByUserID(o);return s.setElement(a),s.setNickAndAvatar(r),s.setNameCard(this._getNameCardByGroupID(s)),this._messageOptionsMap.set(s.clientSequence,e),s}},{key:"createVideoMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl="",e.payload.file.thumbSize=0;var n={};if(ue){if(se)return void this.outputWarning("VideoUnsupportedInAlipay");if(nt(e.payload.file))return void this.outputWarning("FileUnsupportedInMP","createVideoMessage");var o=e.payload.file;it(o.tempFiles)&&(o=o.tempFiles[0]),n.url=o.tempFilePath,n.name=o.tempFilePath.slice(o.tempFilePath.lastIndexOf("/")+1),n.size=o.size||1,n.second=o.duration||0,n.type=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else if(ce){if(nt(e.payload.file)){var s=e.payload.file;e.payload.file.files=[s]}else if(rt(e.payload.file)&&"undefined"!=typeof uni){var a=e.payload.file.tempFile;e.payload.file.files=[a]}var r=e.payload.file;n.url=window.URL.createObjectURL(r.files[0]),n.name=r.files[0].name,n.size=r.files[0].size||1,n.second=r.files[0].duration||0,n.type=r.files[0].type.split("/")[1]}e.payload.file.videoFile=n;var i=new Si(e),u=new Ii({videoFormat:n.type,videoSecond:Vt(n.second,0),videoSize:n.size,remoteVideoUrl:"",videoUrl:n.url,videoUUID:this._generateUUID(e.payload.file.videoFile),thumbUUID:this._generateUUID(e.payload.file.videoFile),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf(".")+1).toLowerCase()}),c=this._getNickAndAvatarByUserID(t);return i.setElement(u),i.setNickAndAvatar(c),i.setNameCard(this._getNameCardByGroupID(i)),this._messageOptionsMap.set(i.clientSequence,e),i}},{key:"createCustomMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Si(e),o=new yi({data:e.payload.data,description:e.payload.description,extension:e.payload.extension}),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createFaceMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Si(e),o=new gi(e.payload),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createMergerMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=this._getNickAndAvatarByUserID(t),o=new Si(e),s=new Di(e.payload);return o.setElement(s),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(o)),o.setRelayFlag(!0),o}},{key:"createForwardMessage",value:function(e){var t=e.to,n=e.conversationType,o=e.priority,s=e.payload,a=e.needReadReceipt,r=e.receiverList,i=this.getMyUserID(),u=this._getNickAndAvatarByUserID(i);if(s.type===S.MSG_GRP_TIP)return Oi({code:er});var c={to:t,conversationType:n,conversationID:"".concat(n).concat(t),priority:o,isPlaceMessage:0,status:nn.UNSEND,currentUser:i,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||s.cloudCustomData||"",needReadReceipt:a,receiverList:r,isSupportExtension:e.isSupportExtension||!1},l=new Si(c);return l.setElement(s.getElements()[0]),l.setNickAndAvatar(u),l.setNameCard(this._getNameCardByGroupID(s)),l.setRelayFlag(!0),l}},{key:"downloadMergerMessage",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:"createFileMessage",value:function(e){if(ue){if(!ee&&!te&&!re)return;var n=le.getSystemInfoSync().SDKVersion;if(ee&&wt(n,"2.5.0")<0)return void this.outputWarning("WXChooseMessageFile");if(te&&wt(n,"1.18.0")<0)return void this.outputWarning("QQChooseMessageFile")}if(ce||re){if(nt(e.payload.file)){var o=e.payload.file;e.payload.file={files:[o]}}else if(rt(e.payload.file)&&"undefined"!=typeof uni){var s=e.payload.file,a=s.tempFiles,r=s.files,i=null;it(a)?i=a[0]:it(r)&&(i=r[0]),e.payload.file={files:[i]}}}else if(ee||te){var u=e.payload.file.tempFiles,c=t(t({},u[0]),{},{url:u[0].path});e.payload.file={files:[c]}}var l=this.getMyUserID();e.currentUser=l,e.senderTinyID=this.getMyTinyID();var p=new Si(e),d=new Mi({uuid:this._generateUUID(e.payload.file),file:e.payload.file}),g=this._getNickAndAvatarByUserID(l);return p.setElement(d),p.setNickAndAvatar(g),p.setNameCard(this._getNameCardByGroupID(p)),this._messageOptionsMap.set(p.clientSequence,e),p}},{key:"createLocationMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Si(e),o=new Ci(e.payload),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"_onCannotFindModule",value:function(){return Oi({code:Pr})}},{key:"sendMessageInstance",value:function(e,t){var n=this;if(!1===this.getModule(io).filterMessage(e,t))return this._onSendMessageFailed(e,new Ei({code:Wr}));var o,s=null;switch(e.conversationType){case S.CONV_C2C:if(!(s=this.getModule(qn)))return this._onCannotFindModule();break;case S.CONV_GROUP:if(!(s=this.getModule(Fn)))return this._onCannotFindModule();if(Et({groupID:e.to})){var a=s.getLocalGroupProfile(e.to);if(a&&a.isSupportTopic)return Oi({code:ba})}break;default:return Oi({code:Aa})}var r=this.getModule(Jn),i=this.getModule(Fn);return r.upload(e).then((function(){n._getSendMessageSpecifiedKey(e)===ti&&n.getModule(so).addSuccessCount(ni);return i.guardForAVChatRoom(e).then((function(){if(!e.isSendable())return Oi({code:Xa});n._addSendMessageTotalCount(e),o=Date.now();var a=function(e){var t="utf-8";ce&&document&&(t=document.charset.toLowerCase());var n,o,s=0;if(o=e.length,"utf-8"===t||"utf8"===t)for(var a=0;a11264?n._mergerMessageHandler.uploadMergerMessage(e,a).then((function(o){var s=n._mergerMessageHandler.createMergerMessagePack(e,t,o);return n.request(s)})):(n.getModule(Hn).setMessageRandom(e),e.conversationType===S.CONV_C2C||e.conversationType===S.CONV_GROUP?s.sendMessage(e,t):void 0)})).then((function(a){var r=a.data,i=r.time,u=r.sequence,c=r.readReceiptCode;ot(c)&&0!==c&&(new li("sendMessageWithReceipt").setMessage("from:".concat(e.from," to:").concat(e.to," sequence:").concat(u," readReceiptCode:").concat(c)).end(),He.w("".concat(n._n,".sendMessageInstance readReceiptCode:").concat(c," message:").concat(n.getErrorMessage(c))));n._addSendMessageSuccessCount(e,o),n._messageOptionsMap.delete(e.clientSequence);var l=n.getModule(Hn);e.status=nn.SUCCESS,e.time=i;var p=!1;if(e.conversationType===S.CONV_GROUP)e.sequence=u;else if(e.conversationType===S.CONV_C2C){var d=l.getLatestMessageSentByMe(e.conversationID);if(d){var g=d.nick,h=d.avatar;g===e.nick&&h===e.avatar||(p=!0)}}if(p&&l.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),s.isOnlineMessage(e,t))e._onlineOnlyFlag=!0;else{l.appendToMessageList(e);var _=e;rt(t)&&rt(t.messageControlInfo)&&(!0===t.messageControlInfo.excludedFromLastMessage&&(e._isExcludedFromLastMessage=!0,_=""),!0===t.messageControlInfo.excludedFromUnreadCount&&(e._isExcludedFromUnreadCount=!0));var f=e.conversationType;if(At(e.to))f=S.CONV_TOPIC,n.getModule(Bn).onMessageSent({groupID:Kt(e.to),topicID:e.to,lastMessage:_});l.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:f,subType:e.conversationSubType,lastMessage:_}]})}return e.getRelayFlag()||"TIMImageElem"!==e.type||Ft(e.payload.imageInfoArray),Li({message:e})}))})).catch((function(t){return n._onSendMessageFailed(e,t)}))}},{key:"_onSendMessageFailed",value:function(e,t){e.status=nn.FAIL,this.getModule(Hn).deleteMessageRandom(e),this._addSendMessageFailCountOnUser(e,t);var n=new li("sendMessage");return n.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to)),this.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];n.setError(t,s,a).end()})),He.e("".concat(this._n,"._onSendMessageFailed error:"),t),Oi(new Ei({code:t&&t.code?t.code:Sa,message:t&&t.message?t.message:void 0,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){if([S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_VIDEO,S.MSG_FILE].includes(e.type))return ti;if(e.conversationType===S.CONV_C2C)return Zr;if(e.conversationType===S.CONV_GROUP){var t=this.getModule(Fn).getLocalGroupProfile(e.to);if(!t)return;var n=t.type;return Lt(n)?ei:$r}}},{key:"_addSendMessageTotalCount",value:function(e){var t=this._getSendMessageSpecifiedKey(e);t&&this.getModule(so).addTotalCount(t)}},{key:"_addSendMessageSuccessCount",value:function(e,t){var n=Math.abs(Date.now()-t),o=this._getSendMessageSpecifiedKey(e);if(o){var s=this.getModule(so);s.addSuccessCount(o),s.addCost(o,n)}}},{key:"_addSendMessageFailCountOnUser",value:function(e,t){var n,o,s=t.code,a=void 0===s?-1:s,r=this.getModule(so),i=this._getSendMessageSpecifiedKey(e);i===ti&&(n=a,o=!1,Qu.includes(n)&&(o=!0),o)?r.addFailedCountOfUserSide(ni):Zu(a)&&i&&r.addFailedCountOfUserSide(i)}},{key:"resendMessage",value:function(e){return e.isResend=!0,e.status=nn.UNSEND,this.sendMessageInstance(e)}},{key:"revokeMessage",value:function(e){var t=this,n=null;if(e.conversationType===S.CONV_C2C?n=this.getModule(qn):e.conversationType===S.CONV_GROUP&&(n=this.getModule(Fn)),!n)return this._onCannotFindModule();var o=new li("revokeMessage");o.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to));var s="".concat(this._n,".").concat("revokeMessage");return n.revokeMessage(e).then((function(n){var a=n.data.recallRetList;if(!Zt(a)&&0!==a[0].retCode){var r=new Ei({code:a[0].retCode,data:{message:e}});return o.setCode(r.code).setMoreMessage(r.message).end(),Oi(r)}return He.i("".concat(s," ok. ID:").concat(e.ID)),e.isRevoked=!0,o.end(),t.getModule(Hn).onMessageRevoked([e]),Li({message:e})})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];o.setError(n,s,a).end()}));var a=new Ei({code:n&&n.code?n.code:Oa,message:n&&n.message?n.message:void 0,data:{message:e}});return He.w("".concat(s," failed. error:"),n),Oi(a)}))}},{key:"deleteMessage",value:function(e){var t=this,n=null,o=e[0],s=o.conversationID,a="",r=[],i=[];if(o.conversationType===S.CONV_C2C)n=this.getModule(qn),a=s.replace(S.CONV_C2C,""),e.forEach((function(e){e&&e.status===nn.SUCCESS&&e.conversationID===s&&(e._onlineOnlyFlag||r.push("".concat(e.sequence,"_").concat(e.random,"_").concat(e.time)),i.push(e))}));else if(o.conversationType===S.CONV_GROUP)n=this.getModule(Fn),a=s.replace(S.CONV_GROUP,""),e.forEach((function(e){e&&e.status===nn.SUCCESS&&e.conversationID===s&&(e._onlineOnlyFlag||r.push("".concat(e.sequence)),i.push(e))}));else if(o.conversationType===S.CONV_SYSTEM)return Oi({code:wa});if(!n)return this._onCannotFindModule();if(0===r.length)return this._onMessageDeleted(i);r.length>30&&(r=r.slice(0,30),i=i.slice(0,30));var u=new li("deleteMessage");u.setMessage("to:".concat(a," count:").concat(r.length));var c="".concat(this._n,".").concat("deleteMessage");return n.deleteMessage({to:a,keyList:r}).then((function(e){return u.end(),He.i("".concat(c," ok")),t._onMessageDeleted(i)})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.w("".concat(c," failed. error:"),e);var n=new Ei({code:e&&e.code?e.code:Ga,message:e&&e.message?e.message:void 0});return Oi(n)}))}},{key:"_onMessageDeleted",value:function(e){return this.getModule(Hn).onMessageDeleted(e),Ni({messageList:e})}},{key:"translateText",value:function(e){var n="".concat(this._n,".").concat("translateText"),o=e.sourceTextList,s=e.sourceLanguage,a=e.targetLanguage,r=new li("translateText");return r.setMessage("sourceLanguage:".concat(s," targetLanguage:").concat(a)),this.request({protocolName:fa,requestData:{sourceTextList:o,source:s||"auto",target:a,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then((function(e){var o=e.data,s=o.error,a=o.requestID,i=o.translatedTextList;if(0===s.code)return r.end(),He.i("".concat(n," ok. requestID:").concat(a)),Li({translatedTextList:i});throw t(t({},s),{},{requestID:a})})).catch((function(e){return r.setCode(e.code).setMoreMessage(e.requestID).end(),He.w("".concat(n," failed. error:"),e),Oi({code:qa})}))}},{key:"modifyRemoteMessage",value:function(e){var t=this,n=null,o=e.conversationType,s=e.to;if(this.getModule(Fn).isMessageFromOrToAVChatroom(s))return Oi({code:nr,data:{message:e}});if(!1===this.getModule(io).filterMessage(e))return Oi({code:Wr,data:{message:e}});o===S.CONV_C2C?n=this.getModule(qn):o===S.CONV_GROUP&&(n=this.getModule(Fn));var a=new li("modifyMessage");a.setMessage("to:".concat(s));var r="".concat(this._n,".modifyRemoteMessage");return n.modifyRemoteMessage(e).then((function(n){a.end(),He.i("".concat(r," ok"));var o=t._onModifyRemoteMessageResp(e,n.data);return Li({message:o})})).catch((function(n){if(a.setCode(n.code).setMoreMessage(n.message).end(),He.w("".concat(r," failed. error:"),n),20027===n.code){var o=t._onModifyRemoteMessageResp(e,n.data);return Oi({code:tr,data:{message:o}})}return Oi({code:n.code,message:n.message,data:{message:e}})}))}},{key:"_onModifyRemoteMessageResp",value:function(e,t){He.d("".concat(this._n,"._onModifyRemoteMessageResp options:"),t);var n=e.conversationType,o=e.from,s=e.to,a=e.random,r=e.sequence,i=e.time,u=t.elements,c=t.messageVersion,l=t.cloudCustomData,p=void 0===l?"":l;return this.getModule(Hn).onMessageModified({conversationType:n,from:o,to:s,time:i,random:a,sequence:r,elements:u,cloudCustomData:p,messageVersion:c})}},{key:"_generateUUID",value:function(e){var t=this.getModule(Kn),n="".concat(t.getSDKAppID(),"-").concat(t.getUserID(),"-").concat(function(){for(var e="",t=32;t>0;--t)e+=yt[Math.floor(Math.random()*It)];return e}()),o=e.name||e.value||e.url||e.tempFilePath,s=o&&o.slice(o.lastIndexOf(".")+1);return s&&(n="".concat(n,".").concat(s)),n}},{key:"getMessageOption",value:function(e){return this._messageOptionsMap.get(e)}},{key:"_getNickAndAvatarByUserID",value:function(e){return this.getModule(wn).getNickAndAvatarByUserID(e)}},{key:"_getNameCardByGroupID",value:function(e){if(e.conversationType===S.CONV_GROUP){var t=this.getModule(Fn);if(t)return t.getMyNameCardByGroupID(e.to)}return""}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._messageOptionsMap.clear()}}]),s}(po),ec=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="MessageExtensionModule",s.messageExtensionMap=new Map,s.globalSeqMap=new Map,s.getMessageExtensionsMap=new Map,s}return a(n,[{key:"onMessageExtensionNotify",value:function(e){var t=this,n=e.dataList,o=n.messageInfo,s=n.operateType,a=n.operateResultList,r=n.tinyID,i=n.globalSequence,u=o.clientTime,c=o.random,l="".concat(r,"-").concat(u,"-").concat(c),p=[],d=[];He.l("".concat(this._n,".onMessageExtensionNotify messageID:").concat(l," operateType:").concat(s," globalSequence:").concat(i)),this._updateGlobalSequence(l,i);var g=!1,h=!1;a.forEach((function(e){var n=e.extensions,o=void 0===n?[]:n,a=e.clearSequence;if(1===s)g=!0,o.forEach((function(e){p.push({key:e.key,value:e.value})})),t._updateLocalExtension(l,o);else if(2===s)h=!0,o.forEach((function(e){d.push(e.key)})),t._updateLocalExtension(l,o);else if(3===s){if(h=!0,t._hasLocalExtension(l))t._getLocalExtension(l).forEach((function(e,t){e.seq<=a&&!Zt(e.value)&&d.push(t)}));t._clearLocalExtension(l,a)}})),g&&this.emitOuterEvent(k.MESSAGE_EXTENSIONS_UPDATED,{messageID:l,extensions:p}),h&&this.emitOuterEvent(k.MESSAGE_EXTENSIONS_DELETED,{messageID:l,keyList:d})}},{key:"setMessageExtensions",value:function(e,t){var n=this;if(!this.canIUse(B.MSG_EXT))return Oi({code:Kr});var o="".concat(this._n,".").concat("setMessageExtensions"),s=e.ID,a=e.conversationID,r=e.sequence,i=e.time,u=m(t);t.length>20&&(u=t.slice(0,20),He.w("".concat(o,". the length of extensions cannot exceed 20.")));var c="conversationID:".concat(a," messageID:").concat(s," sequence:").concat(r," time:").concat(i," count:").concat(u.length),l=new li("setMessageExtensions");return l.setMessage(c),He.l("".concat(o," ").concat(c)),this._modifyMessageExtensions(e,u).then((function(e){var t=e.resultList,n=e.successCount,s=e.failureCount,a="success count:".concat(n," fail count:").concat(s);return l.setMoreMessage(a).end(),He.l("".concat(o," ok. ").concat(a)),Li({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}},{key:"getMessageExtensions",value:function(e){var t=this;if(!this.canIUse(B.MSG_EXT))return Oi({code:Kr});var n="".concat(this._n,".").concat("getMessageExtensions"),o=e.ID,s=e.conversationID,a=e.sequence,r=e.time,i="conversationID:".concat(s," messageID:").concat(o," sequence:").concat(a," time:").concat(r),u=new li("getMessageExtensions");u.setMessage(i),He.l("".concat(n," ").concat(i));var c=void 0;return this.getMessageExtensionsMap.has(o)&&(c=this._getGlobalSequence(o)),this._getMessageExtensions(e,c).then((function(e){return u.end(),He.l("".concat(n," ok. total count:").concat(e.length)),ut(c)&&e.length>0&&t.getMessageExtensionsMap.set(o,1),Li({extensions:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"deleteMessageExtensions",value:function(e,t){var n=this;if(!this.canIUse(B.MSG_EXT))return Oi({code:Kr});var o="".concat(this._n,".").concat("deleteMessageExtensions"),s=[],a=3;Zt(t)||(a=2,t.forEach((function(e){s.push({key:e,value:"",seq:0})})));var r=e.ID,i=e.conversationID,u=e.sequence,c=e.time,l="conversationID:".concat(i," messageID:").concat(r," sequence:").concat(u," time:").concat(c," operateType:").concat(a),p=new li("deleteMessageExtensions");return p.setMessage(l),He.l("".concat(o," ").concat(l)),this._modifyMessageExtensions(e,s,a).then((function(e){var t=e.resultList,n=e.successCount,s=e.failureCount,r="";return 2===a&&(r="success count:".concat(n," fail count:").concat(s)),p.setMoreMessage("".concat(r)).end(),He.l("".concat(o," ok. ").concat(r)),Li({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];p.setError(e,o,s).end()})),He.e("".concat(o," failed. error:"),e),Oi(e)}))}},{key:"_modifyMessageExtensions",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=At(e.to)?S.CONV_TOPIC:e.conversationType,a=void 0;3!==o&&(a=this._getRequestExtensions(e,t));var r=null;switch(s){case S.CONV_C2C:r=this.getModule(qn);break;case S.CONV_GROUP:r=this.getModule(Fn);break;case S.CONV_TOPIC:r=this.getModule(Bn);break;default:return Oi({code:Pr})}return r.modifyMessageExtensions(e,a,o).then((function(t){var o=t.data,s=o.extensions,a=o.seq,r=[],i=0,u=0,c=[];return(s=Zt(s)?[]:s).forEach((function(e){var t=e.errorCode,n=e.extension,o=n.key,s=n.value,a=n.seq;r.push({code:t,key:o,value:s}),0===t?i++:u++,c.push({key:o,value:s,seq:a})})),n._updateGlobalSequence(e.ID,a),c.length>0&&(n._updateLocalExtension(e.ID,c),c=null),{resultList:r,successCount:i,failureCount:u}})).catch((function(e){return Oi(e)}))}},{key:"_getRequestExtensions",value:function(e,t){var n=[];if(this._hasLocalExtension(e.ID)){var o=this._getLocalExtension(e.ID);return t.forEach((function(e){var t=e.key,s=e.value,a=0;o.has(t)&&(a=o.get(t).seq),n.push({key:t,value:s,seq:a})})),n}return t.forEach((function(e){var t=e.key,o=e.value;n.push({key:t,value:o,seq:0})})),n}},{key:"_getMessageExtensions",value:function(e,t){var n=this,o="".concat(this._n,"._getMessageExtensions"),s=e.ID,a=e.to,r=null;switch(At(a)?S.CONV_TOPIC:e.conversationType){case S.CONV_C2C:r=this.getModule(qn);break;case S.CONV_GROUP:r=this.getModule(Fn);break;case S.CONV_TOPIC:r=this.getModule(Bn);break;default:return Oi({code:Pr})}return r.getMessageExtensions(e,t).then((function(t){var a=t.data,r=a.extensions,i=a.completeFlag,u=a.globalSequence,c=a.clearSequence;if(r=Zt(r)?[]:r,He.l("".concat(o," ok. completeFlag:").concat(i," globalSequence:").concat(u," clearSequence:").concat(c," count:").concat(r.length)),n._updateLocalExtension(s,r),n._clearLocalExtension(s,c),n._updateGlobalSequence(s,u),1!==i){var l=r.slice(-1)[0].seq+1;return n._getMessageExtensions(e,l)}return n._getLocalExtensions(s)})).catch((function(e){return Oi(e)}))}},{key:"_hasLocalExtension",value:function(e){return this.messageExtensionMap.has(e)}},{key:"_getLocalExtension",value:function(e){return this.messageExtensionMap.get(e)}},{key:"_updateLocalExtension",value:function(e,t){this._hasLocalExtension(e)||this.messageExtensionMap.set(e,new Map);var n=this._getLocalExtension(e);t.forEach((function(e){var t=e.key,o=e.value,s=void 0===o?"":o,a=e.seq;n.set(t,{value:s,seq:a})}))}},{key:"_clearLocalExtension",value:function(e,t){if(!(t<=0)&&this._hasLocalExtension(e)){var n=this._getLocalExtension(e);n.forEach((function(e,o){e.seq<=t&&n.delete(o)}))}}},{key:"_getLocalExtensions",value:function(e){var t=[];this._hasLocalExtension(e)&&this._getLocalExtension(e).forEach((function(e,n){var o=e.value;Zt(o)||t.push({key:n,value:o})}));return t}},{key:"_getGlobalSequence",value:function(e){return this.globalSeqMap.get(e)}},{key:"_updateGlobalSequence",value:function(e,t){this.globalSeqMap.set(e,t)}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this.messageExtensionMap.clear(),this.globalSeqMap.clear(),this.getMessageExtensionsMap.clear()}}]),n}(po),tc=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="ComboMessageModule",s}return a(n,[{key:"sendMessage",value:function(e){var t=this,n=this._constructMessageInstance(e);if(null===n)return Oi({code:Sa});this._addSendMessageTotalCount(n);var o=Date.now();return this.getModule(Hn).setMessageRandom(n),this._sendComboMessage(n,e).then((function(e){var s=e.data,a=s.time,r=s.sequence,i=s.readReceiptCode;ot(i)&&0!==i&&(new li("sendMessageWithReceipt").setMessage("from:".concat(n.from," to:").concat(n.to," sequence:").concat(r," readReceiptCode:").concat(i)).end(),He.w("".concat(t._n,".sendMessage readReceiptCode:").concat(i," message:").concat(t.getErrorMessage(i))));t._addSendMessageSuccessCount(n,o);var u=t.getModule(Hn);n.status=nn.SUCCESS,n.time=a,n.conversationType===S.CONV_GROUP&&(n.sequence=r),u.appendToMessageList(n);var c=n;return!0===n._isExcludedFromLastMessage&&(c=""),u.onMessageSent({conversationOptionsList:[{conversationID:n.conversationID,unreadCount:0,type:n.conversationType,subType:n.conversationSubType,lastMessage:c}]}),Li({message:n})})).catch((function(e){return t._onSendMessageFailed(n,e)}))}},{key:"_sendComboMessage",value:function(e,t){var n=this._m.getModule(Zn),o="";return e.conversationType===S.CONV_C2C&&(o="".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SEND_MESSAGE)),e.conversationType===S.CONV_GROUP&&(o="".concat(V.NAME.GROUP,".").concat(V.CMD.SEND_GROUP_MESSAGE)),n.sendComboMessage({servcmd:o,data:t})}},{key:"_constructMessageInstance",value:function(e){var t="".concat(this._n,"._constructMessageInstance"),n=null;try{var o=this.getMyUserID(),s={};if(s.senderTinyID=this.getMyTinyID(),s.currentUser=o,s.from=e.From_Account||o,e.GroupId?(s.conversationID="".concat(S.CONV_GROUP).concat(e.GroupId),s.conversationType=S.CONV_GROUP,s.to=e.GroupId):e.To_Account&&(s.conversationID="".concat(S.CONV_C2C).concat(e.To_Account),s.conversationType=S.CONV_C2C,s.to=e.To_Account),s.time=e.MsgTimeStamp||0,s.random=e.Random||e.MsgRandom||0,s.priority=e.MsgPriority,st(e.CloudCustomData)&&e.CloudCustomData.length>0&&(s.cloudCustomData=e.CloudCustomData),it(e.SendMsgControl)&&(s.messageControlInfo={},e.SendMsgControl.includes("NoUnread")&&(s.messageControlInfo.excludedFromUnreadCount=1),e.SendMsgControl.includes("NoLastMsg")&&(s.messageControlInfo.excludedFromLastMessage=1)),s.conversationType===S.CONV_GROUP&&it(e.To_Account)&&e.To_Account.length>0){var a=e.To_Account;e.To_Account.length>50&&(a=e.To_Account.slice(0,50),He.w("".concat(t," To_Account must be less than or equal to 50."))),s.receiverList=m(a),e.To_Account=m(a)}1!==e.IsNeedReadReceipt&&1!==e.NeedReadReceipt||(s.needReadReceipt=!0),1===e.SupportMessageExtension&&(s.isSupportExtension=!0),(n=new Si(s)).status=nn.UNSEND,e.MsgClientTime=n.clientTime,n.conversationType===S.CONV_C2C&&(e.MsgSeq=n.sequence);for(var r,i=e.MsgBody.length,u=0;u100)return n--,t;if(it(t)){var s=t.map((function(t){return at(t)?e(t,o):t}));return n--,s}if(at(t)){var a=(r=t,i=function(e,t){if(!gt(t))return!1;if((s=t)!==ac(s))for(var n=0;n65535)return cc(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533}else t<=57343&&(t=65533);return t<=2047?cc(192|t>>>6,128|63&t):cc(224|t>>>12,128|t>>>6&63,128|63&t)},pc=function(e){for(var t=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,lc),n=0|t.length,o=new Uint8Array(n),s=0;s0)for(var u=0;u=a&&(He.l("".concat(e._n,"._checkPromiseMap request timeout, delete requestID:").concat(n)),e._promiseMap.delete(n),o(new Ei({code:Er})),e._channelModule.onRequestTimeout(n))}))}},{key:"onOpen",value:function(e){if(""!==this._readyState){this._onOpenTs=Date.now();var t=e.id;this._socketID=t;var n=Date.now()-this._startTs;He.l("".concat(this._n,"._onOpen cost ").concat(n," ms. socketID:").concat(t)),new li("wsOnOpen").setMessage(n).setCostTime(n).setMoreMessage("socketID:".concat(t)).end(),e.id===this._socketID&&(this._readyState=mc,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}}},{key:"onClose",value:function(e){var t=new li("wsOnClose"),n=e.id,o=e.e,s="sourceSocketID:".concat(n," currentSocketID:").concat(this._socketID," code:").concat(o.code," reason:").concat(o.reason),a=0;0!==this._onOpenTs&&(a=Date.now()-this._onOpenTs),t.setMessage(a).setCostTime(a).setMoreMessage(s).setCode(o.code).end(),He.l("".concat(this._n,"._onClose ").concat(s," onlineTime:").concat(a)),n===this._socketID&&(this._readyState=yc,a<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{key:"onError",value:function(e){var t=e.id,n=e.e,o="sourceSocketID:".concat(t," currentSocketID:").concat(this._socketID);new li("wsOnError").setMessage(n.errMsg||vt(n)).setMoreMessage(o).setLevel("error").end(),He.w("".concat(this._n,"._onError"),n,o),t===this._socketID&&(this._readyState="",this._channelModule.onError())}},{key:"onMessage",value:function(e){var t;try{t=JSON.parse(e.data)}catch(c){new li("jsonParseError").setMessage(e.data).end()}if(t&&t.head){var n=this._getRequestIDFromHead(t.head),o=t.body;if(!n.startsWith(V.NAME.TUIROOM_SVR)){var s=xt(t.head);o=uc(t.body,this._getResponseKeyMap(s))}if(He.d("".concat(this._n,".onMessage ret:").concat(JSON.stringify(o)," requestID:").concat(n," has:").concat(this._promiseMap.has(n))),this._setNextPingTs(),this._promiseMap.has(n)){var a=this._promiseMap.get(n),r=a.resolve,i=a.reject,u=a.timestamp;return this._promiseMap.delete(n),this._calcRTT(u),void(o.errorCode&&0!==o.errorCode?(this._channelModule.onErrorCodeNotZero(o),i(new Ei({code:o.errorCode,message:o.errorInfo||"",data:n.includes(Go)||n.includes(Ts)?{elements:o.elements,messageVersion:o.messageVersion,cloudCustomData:o.cloudCustomData}:void 0}))):r(Li(o)))}this._channelModule.onMessage({head:t.head,body:o})}}},{key:"_calcRTT",value:function(e){var t=Date.now()-e;this._channelModule.getModule(so).addRTT(t)}},{key:"_connect",value:function(){this._startTs=Date.now(),this._onOpenTs=0,this._socket=new gc(this),this._socketID=this._socket.getID(),this._readyState=Mc,He.l("".concat(this._n,"._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled()," socketID:").concat(this._socketID," url:").concat(this.getURL())),new li("wsConnect").setMessage("socketID:".concat(this._socketID," url:").concat(this.getURL())).end()}},{key:"getURL",value:function(){this._channelModule.isDevMode()&&(this._canIUseBinaryFrame=!1);var e=bt();(se||ee&&"windows"===e||re)&&(this._canIUseBinaryFrame=!1);var t=-1;"ios"===e?t=Me||-1:"android"===e&&(t=Ie||-1);var n=this._channelModule.getModule(Kn),o=this._channelModule.getPlatform(),s=n.getSDKAppID(),a=n.getInstanceID(),r="sdkappid=".concat(s,"&instanceid=").concat(a,"&random=").concat(this._getRandom(),"&platform=").concat(o,"&host=").concat(e,"&version=").concat(t);return this._canIUseBinaryFrame?"".concat(this._url,"/binfo?").concat(r):"".concat(this._url,"/info?").concat(r)}},{key:"_closeConnection",value:function(e){He.l("".concat(this._n,"._closeConnection socketID:").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=yc)}},{key:"_resend",value:function(){var e=this;if(He.l("".concat(this._n,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),this._promiseMap.size>0&&this._promiseMap.forEach((function(t,n){var o=t.uplinkData,s=t.resolve,a=t.reject;e._promiseMap.set(n,{resolve:s,reject:a,timestamp:Date.now(),uplinkData:o}),e._execute(n,o)})),this._simpleRequestMap.size>0){var t,n=D(this._simpleRequestMap);try{for(n.s();!(t=n.n()).done;){var o=v(t.value,2),s=o[0],a=o[1];this._execute(s,a)}}catch(r){n.e(r)}finally{n.f()}this._simpleRequestMap.clear()}}},{key:"send",value:function(e){var t=this;e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3);e.keyMap;var n=g(e,fc),o=this._getRequestIDFromHead(e.head),s=JSON.stringify(n);return new Promise((function(e,a){(t._promiseMap.set(o,{resolve:e,reject:a,timestamp:Date.now(),uplinkData:s}),He.d("".concat(t._n,".send uplinkData:").concat(JSON.stringify(n)," requestID:").concat(o," readyState:").concat(t._readyState)),t._readyState!==mc)?t._reConnect():(t._execute(o,s),t._channelModule.getModule(so).addRequestCount())}))}},{key:"simplySend",value:function(e){e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3);e.keyMap;var t=g(e,vc),n=this._getRequestIDFromHead(e.head),o=JSON.stringify(t);this._readyState!==mc?(this._simpleRequestMap.size0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(e){this.getModule(Zn).onErrorCodeNotZero(e)}},{key:"onMessage",value:function(e){this.getModule(Zn).onMessage(e)}},{key:"send",value:function(e){return this._socketHandler?this._previousState!==S.NET_STATE_CONNECTED&&e.head.servcmd.includes(Ws)?(this.reConnect(),this._sendLogViaHTTP(e)):this._socketHandler.send(e):Promise.reject()}},{key:"_sendLogViaHTTP",value:function(e){var t=V.HOST.CURRENT.STAT;return new Promise((function(n,o){var s="".concat(t,"/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e.head.sdkappid,"&reqtime=").concat(Date.now()),a=JSON.stringify(e.body),r="application/x-www-form-urlencoded;charset=UTF-8";if(ue)le.request({url:s,data:a,method:"POST",timeout:3e3,header:{"content-type":r},success:function(){n()},fail:function(){o(new Ei({code:Lr}))}});else{var i=new XMLHttpRequest,u=setTimeout((function(){i.abort(),o(new Ei({code:Er}))}),3e3);i.onreadystatechange=function(){4===i.readyState&&(clearTimeout(u),200===i.status||304===i.status?n():o(new Ei({code:Lr})))},i.open("POST",s,!0),i.setRequestHeader("Content-type",r),i.send(a)}}))}},{key:"simplySend",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:"onOpen",value:function(){this._ping()}},{key:"onClose",value:function(){this._socketHandler&&(this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED));this.reConnect()}},{key:"onError",value:function(){ue&&!re&&this.outputWarning("DomainNameInMP"),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(e){return this.getModule(Zn).getKeyMap(e)}},{key:"_onAppHide",value:function(){this._isAppShowing=!1}},{key:"_onAppShow",value:function(){this._isAppShowing=!0}},{key:"onRequestTimeout",value:function(e){}},{key:"onReconnected",value:function(){He.l("".concat(this._n,".onReconnected")),this._m.restartTimer(),this.getModule(Zn).onReconnected(),this._emitNetStateChangeEvent(S.NET_STATE_CONNECTED)}},{key:"onReconnectFailed",value:function(){He.l("".concat(this._n,".onReconnectFailed")),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"setIsWorkerEnabled",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:"offline",value:function(){this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"reConnect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!1;this._socketHandler&&(t=this._socketHandler.getReconnectFlag());var n="forcedFlag:".concat(e," fatalErrorFlag:").concat(this._fatalErrorFlag," previousState:").concat(this._previousState," reconnectFlag:").concat(t);if(He.l("".concat(this._n,".reConnect ").concat(n)),!this._fatalErrorFlag&&this._socketHandler){if(!0===e)this._socketHandler.forcedReconnect();else{if(this._previousState===S.NET_STATE_CONNECTING&&t)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(S.NET_STATE_CONNECTING)}}},{key:"_emitNetStateChangeEvent",value:function(e){this._previousState!==e&&(He.l("".concat(this._n,"._emitNetStateChangeEvent from ").concat(this._previousState," to ").concat(e)),this._previousState=e,this.emitOuterEvent(k.NET_STATE_CHANGE,{state:e}))}},{key:"_ping",value:function(){var e=this;if(!0!==this._probing){this._probing=!0;var t=this.getModule(Zn).getProtocolData({protocolName:js});this.send(t).then((function(){e._probing=!1})).catch((function(t){if(He.w("".concat(e._n,"._ping failed. error:"),t),e._probing=!1,t&&60002===t.code)return new li("error").setMessage("code:".concat(t.code," message:").concat(t.message)).setNetworkType(e.getModule(Yn).getNetworkType()).end(),e._fatalErrorFlag=!0,void e._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED);e.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];He.l("".concat(e._n,"._ping failed. probe network, isAppShowing:").concat(e._isAppShowing," online:").concat(o," networkType:").concat(s)),o?e.reConnect():e._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}))}))}}},{key:"_checkNextPing",value:function(){this._socketHandler&&(this._socketHandler.isConnected()&&Date.now()>=this._socketHandler.getNextPingTs()&&this._ping())}},{key:"dealloc",value:function(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{key:"onRestApiKickedOut",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._previousState=S.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3)}}]),n}(po),Tc=["a2","tinyid"],Dc=["a2","tinyid"],kc=function(){function e(t){o(this,e),this._n="ProtocolHandler",this._sessionModule=t,this._configMap=new Map,this._fillConfigMap()}return a(e,[{key:"_fillConfigMap",value:function(){this._configMap.clear();var e=this._sessionModule.genCommonHead(),n=this._sessionModule.genCosSpecifiedHead(),o=this._sessionModule.genSSOReportHead(),s=this._sessionModule.isIntl();this._configMap.set(go,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.LOGIN)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:"InstType"},response:{InstId:"instanceID",HelloInterval:"helloInterval"}}}}(e)),this._configMap.set(ho,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.LOGOUT)}),body:{type:0},keyMap:{request:{type:"wslogout_type"}}}}(e)),this._configMap.set(_o,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.HELLO)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(fo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.STAT_SERVICE,".").concat(V.CMD.KICK_OTHER)}),body:{}}}(e)),this._configMap.set(Bs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_COS_SIGN,".").concat(V.CMD.COS_SIGN)}),body:{cmd:"open_im_cos_svc",subCmd:"get_cos_token",duration:300,version:2},keyMap:{request:{userSig:"usersig",subCmd:"sub_cmd",cmd:"cmd",duration:"duration",version:"version"},response:{expired_time:"expiredTime",bucket_name:"bucketName",session_token:"sessionToken",tmp_secret_id:"secretId",tmp_secret_key:"secretKey"}}}}(n)),this._configMap.set(Hs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.CUSTOM_UPLOAD,".").concat(V.CMD.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:"usersig",fileType:"file_type",fileName:"file_name",uploadMethod:"upload_method"},response:{expired_time:"expiredTime",request_id:"requestId",head_url:"headUrl",upload_url:"uploadUrl",download_url:"downloadUrl",ci_url:"ciUrl",snapshot_url:"requestSnapshotUrl"}}}}(n)),this._configMap.set(Ks,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.CUSTOM_UPLOAD,".").concat(V.CMD.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:"version",platform:"platform",coverName:"cover_name",requestSnapshotUrl:"snapshot_url"},response:{error_code:"errorCode",error_msg:"errorInfo",download_url:"snapshotUrl"}}}}(n)),this._configMap.set(ta,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:"uint32_sdkappid"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set(na,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set($s,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.FETCH_CLOUD_CONTROL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:"uint32_sdkappid",version:"uint64_version"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(ea,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.PUSHED_CLOUD_CONTROL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(oa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OVERLOAD_PUSH,".").concat(V.CMD.OVERLOAD_NOTIFY)}),body:{},keyMap:{response:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}}(e)),this._configMap.set(vo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_MESSAGES)}),body:{cookie:"",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",from:"From_Account",to:"To_Account",time:"MsgTimeStamp",sequence:"MsgSeq",random:"MsgRandom",elements:"MsgBody"},response:{MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",ClientSeq:"clientSequence",MsgSeq:"sequence",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgRandom:"random",MsgTimeStamp:"time",MsgContent:"content",ToGroupId:"to",MsgKey:"messageKey",GroupTips:"groupTips",MsgBody:"elements",MsgType:"type",C2CRemainingUnreadCount:"C2CRemainingUnreadList",C2CPairUnreadCount:"C2CPairUnreadList"}}}}(e)),s||(this._configMap.set(mo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.BIG_DATA_HALLWAY_AUTH_KEY)}),body:{}}}(e)),this._configMap.set(_a,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_MSG_AUDIT_MGR,".").concat(V.CMD.GET_RPOFANITY_LIST)}),body:{version:0,deviceID:"",startIndex:void 0},keyMap:{request:{version:"uint64_version",deviceID:"str_device_id",startIndex:"uint64_start_index"},response:{msg_cmd_error_code:"errorInfo",str_err_msg:"errorMessage",uint32_code:"errorCode",msg_scene_ctl_config:"filterConfig",uint64_c2c_custom_msg_flag:"c2c_custom_message",uint64_c2c_text_msg_flag:"c2c_text_message",uint64_group_custom_msg_flag:"group_custom_message",uint64_group_text_msg_flag:"group_text_message",uint64_group_info_flag:"group_profile",uint64_group_member_info_flag:"group_member_profile",uint64_relation_chain_flag:"sns",uint64_user_info_flag:"user_profile",rpt_msg_dirty_word:"lexicon",str_dirty_word:"profanity",str_replaced_content:"replacement",uint64_filter_type:"filterType",uint64_id:"id",uint64_word_type:"profanityType",uint64_complete_flag:"completeFlag",uint64_next_start_index:"nextStartIndex",uint64_version:"version",uint64_expired_time:"expiredTime"}}}}(e))),this._configMap.set(Mo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SEND_MESSAGE)}),body:{fromAccount:"",toAccount:"",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:"",avatar:"",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",count:"MaxCnt",lastMessageTime:"LastMsgTime",messageKey:"MsgKey",peerAccount:"Peer_Account",data:"Data",description:"Desc",extension:"Ext",type:"MsgType",content:"MsgContent",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",nick:"From_AccountNick",avatar:"From_AccountHeadurl",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"IsNeedReadReceipt"}}}}(e)),this._configMap.set(yo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SEND_GROUP_MESSAGE)}),body:{fromAccount:"",groupID:"",random:0,clientSequence:0,priority:"",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0},keyMap:{request:{to:"GroupId",extension:"Ext",data:"Data",description:"Desc",random:"Random",sequence:"ReqMsgSeq",count:"ReqMsgNumber",type:"MsgType",priority:"MsgPriority",content:"MsgContent",elements:"MsgBody",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",clientSequence:"ClientSeq",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"NeedReadReceipt",receiverList:"To_Account"},response:{MsgTime:"time",MsgSeq:"sequence"}}}}(e)),this._configMap.set(So,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.REVOKE_C2C_MESSAGE)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}}(e)),this._configMap.set(cs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.REVOKE_GROUP_MESSAGE)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{request:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}}(e)),this._configMap.set(Ro,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_C2C_ROAM_MESSAGES)}),body:{peerAccount:"",count:15,lastMessageTime:0,messageKey:"",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:"MsgKey",peerAccount:"Peer_Account",count:"MaxCnt",lastMessageTime:"LastMsgTime",withRecalledMessage:"WithRecalledMsg",direction:"GetDirection"},response:{LastMsgTime:"lastMessageTime",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer"}}}}(e)),this._configMap.set(Go,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.MODIFY_C2C_MESSAGE)}),body:{from:"",to:"",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(ds,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_ROAM_MESSAGES)}),body:{withRecalledMsg:1,groupID:"",count:15,sequence:"",topicID:void 0},keyMap:{request:{sequence:"ReqMsgSeq",count:"ReqMsgNumber",withRecalledMessage:"WithRecalledMsg"},response:{Random:"random",MsgTime:"time",MsgSeq:"sequence",ReqMsgSeq:"sequence",RspMsgList:"messageList",IsPlaceMsg:"isPlaceMessage",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgPriority:"priority",MsgBody:"elements",MsgType:"type",MsgContent:"content",IsFinished:"complete",Download_Flag:"downloadFlag",ClientSeq:"clientSequence",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList"}}}}(e)),this._configMap.set(Lo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SET_C2C_MESSAGE_READ)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:"LastedMsgTime"}}}}(e)),this._configMap.set(Eo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}}(e)),this._configMap.set(Ao,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{updateSequence:0},keyMap:{response:{MuteNotificationsList:"muteFlagList"}}}}(e)),this._configMap.set(ls,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SET_GROUP_MESSAGE_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:"MsgReadedSeq"}}}}(e)),this._configMap.set(ps,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SET_ALL_MESSAGE_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:"C2CReadAllMsg",groupMessageReadInfoList:"GroupReadInfo",messageSequence:"MsgSeq"},response:{C2CReadAllMsg:"readAllC2CMessage",GroupReadInfoArray:"groupMessageReadInfoList"}}}}(e)),this._configMap.set(Oo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.DELETE_C2C_MESSAGE)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{request:{keyList:"MsgKeyList"}}}}(e)),this._configMap.set(Cs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DELETE_GROUP_MESSAGE)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:"Deleter_Account",keyList:"Seqs"}}}}(e)),this._configMap.set(fa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_TRANSLATE,".").concat(V.CMD.TRANSLATE_TEXT)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:"",target:""},keyMap:{request:{sourceTextList:"SourceText",SDKAppID:"SdkAppId",from:"FromAccount"},response:{TargetText:"translatedTextList",RequestId:"requestID",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}}(e)),this._configMap.set(Ts,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.MODIFY_GROUP_MESSAGE)}),body:{groupID:"",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(gs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequence:"MsgSeq"}}}}(e)),this._configMap.set(_s,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:"",messageInfoList:void 0},keyMap:{request:{peerAccount:"Peer_Account",messageInfoList:"C2CMsgInfo",fromAccount:"From_Account",toAccount:"To_Account",sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",clientTime:"MsgClientTime"}}}}(e)),this._configMap.set(hs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SEND_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}}(e)),this._configMap.set(fs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_READ_RECEIPT_DETAIL)}),body:{groupID:"",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:"MsgSeq",count:"Num"},response:{ReadList:"readUserIDList",Read_Account:"userID",UnreadList:"unreadUserIDList",Unread_Account:"userID",IsFinish:"isCompleted"}}}}(e)),this._configMap.set(Po,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.MODIFY_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Uo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.GET_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}}(e)),this._configMap.set(As,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.MODIFY_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Rs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.GET_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}}(e)),this._configMap.set(No,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{request:{userIDList:"To_Account"},response:{ReadTime:"peerReadTimeList"}}}}(e)),this._configMap.set(wo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,count:0},keyMap:{request:{},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime"}}}}(e)),this._configMap.set(bo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.PAGING_GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,timeStamp:void 0,startIndex:void 0,pinnedTimeStamp:void 0,pinnedStartIndex:void 0,orderType:void 0,messageAssistFlag:4,assistFlag:15},keyMap:{request:{messageAssistFlag:"MsgAssistFlags",assistFlag:"AssistFlags",pinnedTimeStamp:"TopTimeStamp",pinnedStartIndex:"TopStartIndex"},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime",LastMsgFlags:"lastMessageFlag",TopFlags:"isPinned",TopTimeStamp:"pinnedTimeStamp",TopStartIndex:"pinnedStartIndex",GroupId:"convGroupID"}}}}(e)),this._configMap.set(qo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.DELETE_CONVERSATION)}),body:{fromAccount:"",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{request:{toGroupID:"ToGroupid",clearHistoryMessage:"ClearRamble",conversationList:"ContactItem"},response:{ResultItem:"resultList",ToGroupid:"toGroupID",ResultCode:"code",ResultInfo:"info"}}}}(e)),this._configMap.set(Fo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.CLEAR_HISTORY_MESSAGE)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:"ToGroupid"}}}}(e)),this._configMap.set(xo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.PIN_CONVERSATION)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{request:{itemList:"RecentContactItem"}}}}(e)),this._configMap.set(Vo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.DELETE_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set(Bo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(Ho,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(Ko,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.CREATE_CONVERSATION_GROUP)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"GroupContactItem",groupID:"ToGroupId"},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(Wo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.DELETE_CONVERSATION_GROUP)}),body:{fromAccount:"",groupName:void 0},keyMap:{request:{},response:{GroupId:"convGroupID"}}}}(e)),this._configMap.set(jo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:"OldGroupName",newName:"NewGroupName",groupID:"ToGroupId",operationType:"ContactOptType",groupName:"OldGroupName",updateItem:"ContactUpdateItem"},response:{ContactOptType:"operationType",ToGroupId:"groupID",GroupId:"convGroupID"}}}}(e)),this._configMap.set(Yo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(zo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Jo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.GET_CONVERSATION_GROUP_LIST)}),body:{fromAccount:"",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList"}}}}(e)),this._configMap.set(Io,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.PROFILE,".").concat(V.CMD.PORTRAIT_GET)}),body:{fromAccount:"",userItem:[]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(Co,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.PROFILE,".").concat(V.CMD.PORTRAIT_SET)}),body:{fromAccount:"",profileItem:[{tag:We.NICK,value:""},{tag:We.GENDER,value:""},{tag:We.ALLOWTYPE,value:""},{tag:We.AVATAR,value:""}]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(To,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.FRIEND,".").concat(V.CMD.GET_BLACKLIST)}),body:{fromAccount:"",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:"currentSequence"}}}}(e)),this._configMap.set(Do,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.FRIEND,".").concat(V.CMD.ADD_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(ko,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.FRIEND,".").concat(V.CMD.DELETE_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(ua,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.SET_SELF_STATUS)}),body:{customStatus:""},keyMap:{}}}(e)),this._configMap.set(ca,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:"successUserList",ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID",Status:"statusType"}}}}(e)),this._configMap.set(la,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.SUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(pa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.UNSUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(Xo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_JOINED_GROUPS)}),body:{memberAccount:"",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:"Member_Account"},response:{GroupIdList:"groups",NoUnreadSeqList:"excludedUnreadSequenceList",MsgSeq:"readedSequence",LastRecallTime:"_lastRevokedTime"}}}}(e)),this._configMap.set(Qo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_INFO)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember"],groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:"GroupIdList",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",groupCustomFieldFilter:"AppDefinedDataFilter_Group",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{GroupIdList:"groups",AppDefinedData:"groupCustomField",AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_Group:"groupCustomFieldFilter",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",InfoSeq:"infoSequence",MemberList:"members",GroupInfo:"groups",ShutUpUntil:"muteUntil",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(Zo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.CREATE_GROUP)}),body:{type:void 0,name:void 0,groupID:void 0,ownerID:void 0,introduction:void 0,notification:void 0,maxMemberNum:void 0,joinOption:void 0,memberList:void 0,groupCustomField:void 0,memberCustomField:void 0,webPushFlag:1,avatar:"",isSupportTopic:void 0,inviteOption:void 0},keyMap:{request:{ownerID:"Owner_Account",userID:"Member_Account",avatar:"FaceUrl",maxMemberNum:"MaxMemberCount",joinOption:"ApplyJoinOption",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",inviteOption:"InviteJoinOption"},response:{HugeGroupFlag:"avChatRoomFlag",OverJoinedGroupLimit_Account:"overLimitUserIDList"}}}}(e)),this._configMap.set($o,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DESTROY_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(es,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.MODIFY_GROUP_INFO)}),body:{groupID:void 0,name:void 0,introduction:void 0,notification:void 0,avatar:void 0,joinOption:void 0,groupCustomField:void 0,muteAllMembers:void 0,inviteOption:void 0},keyMap:{request:{groupCustomField:"AppDefinedData",muteAllMembers:"ShutUpAllMember",joinOption:"ApplyJoinOption",avatar:"FaceUrl",inviteOption:"InviteJoinOption"},response:{AppDefinedData:"groupCustomField",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(ts,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:"ApplyMsg",historyMessageFlag:"HugeGroupHistoryMsgFlag"},response:{HugeGroupFlag:"avChatRoomFlag",AVChatRoomKey:"avChatRoomKey",RspMsgList:"messageList",ToGroupId:"to"}}}}(e)),this._configMap.set(ns,function(e){e.a2,e.tinyid;return{head:t(t({},g(e,Tc)),{},{servcmd:"".concat(V.NAME.BIG_GROUP_NO_AUTH,".").concat(V.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:"ApplyMsg"},response:{HugeGroupFlag:"avChatRoomFlag"}}}}(e)),this._configMap.set(os,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.QUIT_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(ss,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SEARCH_GROUP_BY_ID)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption","InviteJoinOption"]}},keyMap:{response:{}}}}(e)),this._configMap.set(as,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.CHANGE_GROUP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:"NewOwner_Account"}}}}(e)),this._configMap.set(rs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.HANDLE_APPLY_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(is,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.HANDLE_INVITE_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",invitee:"Invited_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg"}}}}(e)),this._configMap.set(us,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.HANDLE_GROUP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:"Inviter_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(vs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_APPLICATION)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:"Handle_Account"},response:{To_Account:"userID"}}}}(e)),this._configMap.set(ms,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.DELETE_GROUP_SYSTEM_MESSAGE)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set(Ms,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.BIG_GROUP_LONG_POLLING,".").concat(V.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(e)),this._configMap.set(ys,function(e){e.a2,e.tinyid;return{head:t(t({},g(e,Dc)),{},{servcmd:"".concat(V.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,".").concat(V.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(e)),this._configMap.set(Is,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_ONLINE_MEMBER_NUM)}),body:{groupID:void 0}}}(e)),this._configMap.set(Ds,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(ks,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.MODIFY_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(Ss,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DELETE_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key"}}}}(e)),this._configMap.set(Ls,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.CLEAR_GROUP_ATTRIBUTES)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]}}}(e)),this._configMap.set(Es,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_ATTR,".").concat(V.CMD.GET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:"Key",groupType:"GroupType"}}}}(e)),this._configMap.set(Ns,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_NOTIFY)}),body:{notifyType:1,groupID:"",beginTime:0,endTime:0,limit:20},keyMap:{request:{},response:{NextMsgTime:"nextRevokedTime",NotifyMsgList:"notifyList"}}}}(e)),this._configMap.set(Os,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.UPDATE_GROUP_COUNTER)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{request:{counterList:"GroupCounter"}}}}(e)),this._configMap.set(Gs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_COUNTER)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:"GroupCounterKeys"}}}}(e)),this._configMap.set(sa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.CREATE_TOPIC)}),body:{groupID:void 0,topicName:void 0,avatar:void 0,customData:void 0,topicID:void 0,notification:void 0,introduction:void 0},keyMap:{request:{avatar:"FaceUrl"}}}}(e)),this._configMap.set(aa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.DELETE_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{DestroyResultItem:"resultList"}}}}(e)),this._configMap.set(ra,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.UPDATE_TOPIC_PROFILE)}),body:{groupID:void 0,topicID:void 0,avatar:void 0,customData:void 0,notification:void 0,introduction:void 0,muteAllMembers:void 0,topicName:void 0},keyMap:{request:{avatar:"FaceUrl",muteAllMembers:"ShutUpAllMember"}}}}(e)),this._configMap.set(ia,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:["NoUnreadSeqList"]},keyMap:{request:{topicIDList:"TopicIdList"},response:{TopicAndSelfInfo:"topicInfoList",TopicInfo:"topic",GroupID:"groupID",ShutUpTime:"muteTime",ShutUpAllFlag:"muteAllMembers",LastMsgTime:"lastMessageTime",MsgSeq:"readedSequence",LastMsgSeq:"sequence",NoUnreadSeqList:"excludedUnreadSequenceList"}}}}(e)),this._configMap.set(Ps,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_MEMBER_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:["Role","NameCard","ShutUpUntil","JoinTime"],memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",MemberList:"members",ShutUpUntil:"muteUntil"}}}}(e)),this._configMap.set(Us,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_AVCHATROOM,".").concat(V.CMD.GET_AVCHATROOM_MEMBER_LIST)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{request:{offset:"Timestamp",filter:"Mark"},response:{NextTimestamp:"offset"}}}}(e)),this._configMap.set(bs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_MEMBER_INFO)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:"Member_List_Account",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{MemberList:"members",ShutUpUntil:"muteUntil",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",AppMemberDefinedData:"memberCustomField"}}}}(e)),this._configMap.set(ws,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.ADD_GROUP_MEMBER)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:"Member_Account",userIDList:"MemberList"},response:{MemberList:"members"}}}}(e)),this._configMap.set(qs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DELETE_GROUP_MEMBER)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:"MemberToDel_Account"}}}}(e)),this._configMap.set(Fs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.BAN_AVCHATROOM_MEMBER)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{request:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}}(e)),this._configMap.set(xs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.MODIFY_GROUP_MEMBER_INFO)}),body:{groupID:void 0,topicID:void 0,userID:void 0,messageRemindType:void 0,nameCard:void 0,role:void 0,memberCustomField:void 0,muteTime:void 0},keyMap:{request:{userID:"Member_Account",memberCustomField:"AppMemberDefinedData",muteTime:"ShutUpTime",messageRemindType:"MsgFlag"}}}}(e)),this._configMap.set(Vs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_AVCHATROOM,".").concat(V.CMD.MARK_AVCHATROOM_MEMBER_INFO)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{request:{operationType:"CommandType",memberList:"MemberList",markType:"Marks",userID:"Member_Account"},response:{CommandType:"operationType",Marks:"markType",Member_Account:"userID"}}}}(e)),this._configMap.set(Ws,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STAT,".").concat(V.CMD.TIM_WEB_REPORT_V2)}),body:{header:{},event:[],quality:[]},keyMap:{request:{SDKType:"sdk_type",SDKVersion:"sdk_version",deviceType:"device_type",platform:"platform",instanceID:"instance_id",traceID:"trace_id",SDKAppID:"sdk_app_id",userID:"user_id",tinyID:"tiny_id",extension:"extension",timestamp:"timestamp",networkType:"network_type",eventType:"event_type",code:"error_code",message:"error_message",moreMessage:"more_message",duplicate:"duplicate",costTime:"cost_time",level:"level",qualityType:"quality_type",reportIndex:"report_index",wholePeriod:"whole_period",totalCount:"total_count",rttCount:"success_count_business",successRateOfRequest:"percent_business",countLessThan1Second:"success_count_business",percentOfCountLessThan1Second:"percent_business",countLessThan3Second:"success_count_platform",percentOfCountLessThan3Second:"percent_platform",successCountOfBusiness:"success_count_business",successRateOfBusiness:"percent_business",successCountOfPlatform:"success_count_platform",successRateOfPlatform:"percent_platform",successCountOfMessageReceived:"success_count_business",successRateOfMessageReceived:"percent_business",avgRTT:"average_value",avgDelay:"average_value",avgValue:"average_value",uiPlatform:"ui_platform"}}}}(o)),this._configMap.set(js,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.HEARTBEAT,".").concat(V.CMD.ALIVE)}),body:{}}}(e)),this._configMap.set(Ys,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_PUSH,".").concat(V.CMD.MESSAGE_PUSH)}),body:{},keyMap:{response:{C2cMsgArray:"C2CMessageArray",GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",C2cNotifyMsgArray:"C2CNotifyMessageArray",C2cMsgInfo:"C2CReadReceiptArray",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyAdd_Account:"userID",ProfileImNick:"nick",PendencyType:"applicationType",C2CReadAllMsg:"readAllC2CMessage",IsNeedReadReceipt:"needReadReceipt",Status:"statusType"}}}}(e)),this._configMap.set(zs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_PUSH,".").concat(V.CMD.MULTI_MESSAGE_PUSH)}),body:{},keyMap:{response:{GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyType:"applicationType"}}}}(e)),this._configMap.set(Js,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.MESSAGE_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{request:{sessionData:"SessionData"}}}}(e)),this._configMap.set(Xs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{response:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(Zs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_LONG_MESSAGE,".").concat(V.CMD.DOWNLOAD_MERGER_MESSAGE)}),body:{downloadKey:""},keyMap:{response:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}}(e)),this._configMap.set(Qs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_LONG_MESSAGE,".").concat(V.CMD.UPLOAD_MERGER_MESSAGE)}),body:{messageList:[]},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",type:"MsgType",content:"MsgContent",data:"Data",description:"Desc",extension:"Ext",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody"}}}}(e)),this._configMap.set(ha,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.SET_TOKEN)}),body:{tokenID:"",pushMsg:0,sdkAppID:0,businessID:"",deviceBrand:"",deviceToken:"",isTpns:0,isWebUniapp:0},keyMap:{request:{tokenID:"TokenID",pushMsg:"PushMsg",sdkAppID:"EnterVersion",businessID:"BusiID",deviceBrand:"InstType",deviceToken:"VarToken",isTpns:"IsTpns"}}}}(e)),this._configMap.set(ga,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.STAT_FOREGROUND)}),body:{isWebUniapp:0}}}(e)),this._configMap.set(da,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:"C2cUnread",groupUnreadCount:"GrpUnread"}}}}(e))}},{key:"has",value:function(e){return this._configMap.has(e)}},{key:"get",value:function(e){return this._configMap.get(e)}},{key:"update",value:function(){this._fillConfigMap()}},{key:"getKeyMap",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(He.w("".concat(this._n,".getKeyMap unknown protocolName:").concat(e)),{})}},{key:"getProtocolData",value:function(e){var t=e.protocolName,n=e.requestData,o=this.get(t),s=null;if(n){var a=this._simpleDeepCopy(o),r=this._updateService(n,a),i=r.body,u=Object.create(null);for(var c in i)if(Object.prototype.hasOwnProperty.call(i,c)){if(u[c]=i[c],void 0===n[c])continue;u[c]=n[c]}r.body=u,s=this._getUplinkData(r)}else s=this._getUplinkData(o);return s}},{key:"_getUplinkData",value:function(e){var t=this._requestDataCleaner(e),n=xt(t.head),o=ic(t.body,this._getRequestKeyMap(n));return t.body=o,t}},{key:"_updateService",value:function(e,t){var n=xt(t.head);if(this._isFromGroupRequest(t)){var o=e.type,s=e.groupID,a=void 0===s?void 0:s,r=e.groupIDList,i=void 0===r?[]:r;ut(a)&&(a=i[0]||""),Et({type:o,groupID:a})&&(t.head.servcmd="".concat(V.NAME.GROUP_COMMUNITY,".").concat(n))}return t}},{key:"_isFromGroupRequest",value:function(e){return e.head.servcmd.includes(V.NAME.GROUP)||e.head.servcmd.includes(V.NAME.GROUP_ATTR)}},{key:"_getRequestKeyMap",value:function(e){var n=this.getKeyMap(e);return t(t({},sc.request),n.request)}},{key:"_requestDataCleaner",value:function(e){var t=Array.isArray(e)?[]:Object.create(null);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&>(o)&&null!==e[o]&&void 0!==e[o]&&("object"!==n(e[o])?t[o]=e[o]:t[o]=this._requestDataCleaner.bind(this)(e[o]));return t}},{key:"_simpleDeepCopy",value:function(e){for(var t,n=Object.keys(e),o={},s=0,a=n.length;s1e3*s)return this._commandRequestInfoMap.set(t,{startTime:Date.now(),requestCount:1}),!1;i+=1,this._commandRequestInfoMap.set(t,{startTime:r,requestCount:i});var u=!1;return i>o&&(u=!0),u}},{key:"_isServerOverload",value:function(e){if(!this._serverOverloadInfoMap.has(e))return!1;var t=this._serverOverloadInfoMap.get(e),n=t.overloadTime,o=t.waitingTime,s=!1;return Date.now()-n<=1e3*o?s=!0:(this._serverOverloadInfoMap.delete(e),s=!1),s}},{key:"onPushedServerOverload",value:function(e){var t=e.overloadCommand,n=e.waitingTime;this._serverOverloadInfoMap.set(t,{overloadTime:Date.now(),waitingTime:n}),He.w("".concat(this._n,".onPushedServerOverload waitingTime:").concat(n,"s"))}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._updateCommandFrequencyLimitMap(Ec),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear()}}]),s}(po),Rc=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="MessageLossDetectionModule",s._maybeLostSequencesMap=new Map,s._firstRoundRet=[],s}return a(n,[{key:"onMessageMaybeLost",value:function(e,t,n){this._maybeLostSequencesMap.has(e)||this._maybeLostSequencesMap.set(e,[]);for(var o=this._maybeLostSequencesMap.get(e),s=0;s=this._expiredTime}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetchConfig();if(He.l("".concat(this._n,".fetchConfig canFetchConfig:").concat(t)),t){var n=new li("fetchCloudControlConfig"),o=this.getModule(Kn).getSDKAppID();this._isFetching=!0,this.request({protocolName:$s,requestData:{SDKAppID:o,version:this._version}}).then((function(t){e._isFetching=!1,n.setMessage("version:".concat(e._version," newVersion:").concat(t.data.version," config:").concat(t.data.cloudControlConfig)).setNetworkType(e.getNetworkType()).end(),He.l("".concat(e._n,".fetchConfig ok")),e._parseCloudControlConfig(t.data)})).catch((function(t){e._isFetching=!1,e.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];n.setError(t,s,a).end()})),He.l("".concat(e._n,".fetchConfig failed. error:"),t),e._setExpiredTimeOnResponseError(12e4)}))}}},{key:"onPushedCloudControlConfig",value:function(e){He.l("".concat(this._n,".onPushedCloudControlConfig")),new li("pushedCloudControlConfig").setNetworkType(this.getNetworkType()).setMessage("newVersion:".concat(e.version," config:").concat(e.cloudControlConfig)).end(),this._parseCloudControlConfig(e)}},{key:"onCheckTimer",value:function(e){this._canFetchConfig()&&this.fetchConfig()}},{key:"_parseCloudControlConfig",value:function(e){var t=this,n="".concat(this._n,"._parseCloudControlConfig"),o=e.errorCode,s=e.errorMessage,a=e.cloudControlConfig,r=e.version,i=e.expiredTime;if(0===o){if(this._version!==r){var u=null;try{u=JSON.parse(a)}catch(c){this.isPrivateNetWork()||He.e("".concat(n," JSON parse error. cloudControlConfig:"),a)}u&&(this._cloudConfig.clear(),Object.keys(u).forEach((function(e){t._cloudConfig.set(e,u[e])})),this._version=r,this.emitInnerEvent(bi))}this._expiredTime=Date.now()+1e3*i}else ut(o)?(He.l("".concat(n," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(He.e("".concat(n," errorCode:").concat(o," errorMessage:").concat(s)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),n}(po),Oc=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="RecoverMessageModule",s.PULL_LIMIT_COUNT=15,s}return a(n,[{key:"start",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:"_recoverGroupChat",value:function(){var e,t,n=this,o=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_GROUP&&e.groupProfile.type!==S.GRP_AVCHATROOM})),s=this.getModule(Hn),a=0,r=0,i=0;o.forEach((function(o){var u=o.conversationID,c=o.lastMessage;t=u.replace(S.CONV_GROUP,""),e=s.getLocalLastMessage(u),c&&0!==c.lastSequence&&e?(r=c.lastSequence,a=e.sequence,i=r-a,a>0&&i>=1&&i<300?n._recoverGroupMessage({groupID:t,localLastMessageSequence:a,remoteLastMessageSequence:r}):n._getGroupNotify(t)):n._getGroupNotify(t)}))}},{key:"_recoverC2CChat",value:function(){var e,t=this,n=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C})),o=this.getModule(Hn),s=0,a=0,r=0,i=[Promise.resolve()];n.forEach((function(n){var u=n.conversationID,c=n.lastMessage;e=o.getLocalLastMessage(u),c&&0!==c.lastTime&&e&&(a=c.lastTime,s=e.time,r=a-s,s>0&&r>=1&&r<=600&&i.push(t._recoverC2CMessage({conversationID:u,localLastMessageTime:s,remoteLastMessageTime:a})))})),Promise.all(i).then((function(){He.l("".concat(t._n,"._recoverC2CChat all promise fulfilled, start to sync unread messages")),t.getModule(Qn).startSyncOnReconnected()}))}},{key:"_getLocalConversationList",value:function(){return this.getModule(Hn).getLocalConversationList()}},{key:"_recoverGroupMessage",value:function(e){var t=this,n="".concat(this._n,"._recoverGroupMessage");He.l("".concat(n," options:"),e);var o=e.groupID,s=e.localLastMessageSequence,a=e.remoteLastMessageSequence;this._getGroupRomaingMessage({groupID:o,sequence:s}).then((function(e){var s=e.data,r=s.complete,i=s.messageList;if(!ut(i)){var u=i[0].sequence;He.l("".concat(n," pkgLastMessageSequence:").concat(u," complete:").concat(r)),u=0&&this._e2eDelayArray.push(t)}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),Vt(n/t,1)}},{key:"_calcCountWithLimit",value:function(e){var t=e.e2eDelayArray,n=e.min,o=e.max;return t.filter((function(e){return n<=e&&e100&&(n=100),n}},{key:"_checkE2EDelayException",value:function(e,t){var n=e.filter((function(e){return e>t}));if(n.length>0){var o=n.length,s=Math.min.apply(Math,m(n)),a=Math.max.apply(Math,m(n)),r=this._calcAvg(n,o),i=Vt(o/e.length*100,2);if(i>50)new li("messageE2EDelayException").setMessage("count:".concat(o," min:").concat(s," max:").concat(a," avg:").concat(r," percent:").concat(i)).setLevel("warning").end()}}},{key:"getStatResult",value:function(){var e=this._e2eDelayArray.length;if(0===e)return null;var t=m(this._e2eDelayArray),n=this._calcCountWithLimit({e2eDelayArray:t,min:0,max:1}),o=this._calcCountWithLimit({e2eDelayArray:t,min:1,max:3}),s=this._calcPercent(n,e),a=this._calcPercent(o,e),r=this._calcAvg(t,e);return this._checkE2EDelayException(t,3),t.length=0,this.reset(),{totalCount:e,countLessThan1Second:n,percentOfCountLessThan1Second:s,countLessThan3Second:o,percentOfCountLessThan3Second:a,avgDelay:r}}},{key:"reset",value:function(){this._e2eDelayArray.length=0}}]),e}(),Pc=function(){function e(){o(this,e),this._n="AvgRTT",this._requestCount=0,this._rttArray=[]}return a(e,[{key:"addRequestCount",value:function(){this._requestCount+=1}},{key:"addRTT",value:function(e){this._rttArray.push(e)}},{key:"_calcTotalCount",value:function(){return this._requestCount}},{key:"_calcRTTCount",value:function(e){return e.length}},{key:"_calcSuccessRateOfRequest",value:function(e,t){if(0===t)return 0;var n=Vt(e/t*100,2);return n>100&&(n=100),n}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcMax",value:function(){return Math.max.apply(Math,m(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,m(this._rttArray))}},{key:"getStatResult",value:function(){var e=this._calcTotalCount(),t=m(this._rttArray);if(0===e)return null;var n=this._calcRTTCount(t),o=this._calcSuccessRateOfRequest(n,e),s=this._calcAvg(t,n);return He.l("".concat(this._n,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(s)),this.reset(),{totalCount:e,rttCount:n,successRateOfRequest:o,avgRTT:s}}},{key:"reset",value:function(){this._requestCount=0,this._rttArray.length=0}}]),e}(),Uc=function(){function e(){o(this,e),this._map=new Map}return a(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}))}},{key:"addTotalCount",value:function(e){return!(ut(e)||!this._map.has(e))&&(this._map.get(e).totalCount+=1,!0)}},{key:"addSuccessCount",value:function(e){return!(ut(e)||!this._map.has(e))&&(this._map.get(e).successCount+=1,!0)}},{key:"addFailedCountOfUserSide",value:function(e){return!(ut(e)||!this._map.has(e))&&(this._map.get(e).failedCountOfUserSide+=1,!0)}},{key:"addCost",value:function(e,t){return!(ut(e)||!this._map.has(e))&&(this._map.get(e).costArray.push(t),!0)}},{key:"addFileSize",value:function(e,t){return!(ut(e)||!this._map.has(e))&&(this._map.get(e).fileSizeArray.push(t),!0)}},{key:"_calcSuccessRateOfBusiness",value:function(e){if(ut(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=Vt(t.successCount/t.totalCount*100,2);return n>100&&(n=100),n}},{key:"_calcSuccessRateOfPlatform",value:function(e){if(ut(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=this._calcSuccessCountOfPlatform(e)/t.totalCount*100;return(n=Vt(n,2))>100&&(n=100),n}},{key:"_calcTotalCount",value:function(e){return ut(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:"_calcSuccessCountOfBusiness",value:function(e){return ut(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:"_calcSuccessCountOfPlatform",value:function(e){if(ut(e)||!this._map.has(e))return-1;var t=this._map.get(e);return t.successCount+t.failedCountOfUserSide}},{key:"_calcAvg",value:function(e){return ut(e)||!this._map.has(e)?-1:e===ni?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:"_calcAvgCost",value:function(e){var t=this._map.get(e).costArray.length;if(0===t)return 0;var n=0;return this._map.get(e).costArray.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcAvgSpeed",value:function(e){var t=0,n=0;return this._map.get(e).costArray.forEach((function(e){t+=e})),this._map.get(e).fileSizeArray.forEach((function(e){n+=e})),parseInt(1e3*n/t)}},{key:"getStatResult",value:function(e){var t=this._calcTotalCount(e);if(0===t)return null;var n=this._calcSuccessCountOfBusiness(e),o=this._calcSuccessRateOfBusiness(e),s=this._calcSuccessCountOfPlatform(e),a=this._calcSuccessRateOfPlatform(e),r=this._calcAvg(e);return this.reset(e),{totalCount:t,successCountOfBusiness:n,successRateOfBusiness:o,successCountOfPlatform:s,successRateOfPlatform:a,avgValue:r}}},{key:"reset",value:function(e){ut(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),e}(),bc=function(){function e(){o(this,e),this._lastMap=new Map,this._currentMap=new Map}return a(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._lastMap.set(e,new Map),t._currentMap.set(e,new Map)}))}},{key:"addMessageSequence",value:function(e){var t=e.key,n=e.message;if(ut(t)||!this._lastMap.has(t)||!this._currentMap.has(t))return!1;var o=n.conversationID,s=n.sequence,a=o.replace(S.CONV_GROUP,"");if(0===this._lastMap.get(t).size)this._addCurrentMap(e);else if(this._lastMap.get(t).has(a)){var r=this._lastMap.get(t).get(a),i=r.length-1;s>r[0]&&s100&&(o=100),this._copyData(e),{totalCount:t,successCountOfMessageReceived:n,successRateOfMessageReceived:o}}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),e}(),wc=function(e){i(s,e);var n=f(s);function s(e){var t;o(this,s),(t=n.call(this,e))._n="QualityStatModule",t.TAG="im-ssolog-quality-stat",t.reportIndex=0,t.wholePeriod=!1,t._qualityItems=[Xr,Qr,Zr,$r,ei,ti,ni,oi,si,ai],t._messageSentItems=[Zr,$r,ei,ti,ni],t._messageReceivedItems=[oi,si,ai],t.REPORT_INTERVAL=120,t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._statInfoArr=[],t._avgRTT=new Pc,t._avgE2EDelay=new Gc,t._rateMessageSent=new Uc,t._rateMessageReceived=new bc;var a=t.getInnerEmitterInstance();return a.on(Ui,t._onLoginSuccess,h(t)),a.on(bi,t._onCloudConfigUpdated,h(t)),t}return a(s,[{key:"_onLoginSuccess",value:function(){var e=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var t=this.getModule(Wn),n=t.getItem(this.TAG,!1);!Zt(n)&<(n.forEach)&&(He.l("".concat(this._n,"._onLoginSuccess get quality stat logs from local storage, count:").concat(n.length)),n.forEach((function(t){e._statInfoArr.push(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("q_rpt_interval"),t=this.getCloudConfig("q_rpt_sdkappid_bl"),n=this.getCloudConfig("q_rpt_tinyid_wl");ut(e)||(this.REPORT_INTERVAL=Number(e)),ut(t)||(this.REPORT_SDKAPPID_BLACKLIST=t.split(",").map((function(e){return Number(e)}))),ut(n)||(this.REPORT_TINYID_WHITELIST=n.split(","))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:"addRequestCount",value:function(){this._avgRTT.addRequestCount()}},{key:"addRTT",value:function(e){this._avgRTT.addRTT(e)}},{key:"addMessageDelay",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:"addTotalCount",value:function(e){this._rateMessageSent.addTotalCount(e)||He.w("".concat(this._n,".addTotalCount invalid key:"),e)}},{key:"addSuccessCount",value:function(e){this._rateMessageSent.addSuccessCount(e)||He.w("".concat(this._n,".addSuccessCount invalid key:"),e)}},{key:"addFailedCountOfUserSide",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||He.w("".concat(this._n,".addFailedCountOfUserSide invalid key:"),e)}},{key:"addCost",value:function(e,t){this._rateMessageSent.addCost(e,t)||He.w("".concat(this._n,".addCost invalid key or cost:"),e,t)}},{key:"addFileSize",value:function(e,t){this._rateMessageSent.addFileSize(e,t)||He.w("".concat(this._n,".addFileSize invalid key or size:"),e,t)}},{key:"addMessageSequence",value:function(e){this._rateMessageReceived.addMessageSequence(e)||He.w("".concat(this._n,".addMessageSequence invalid key:"),e.key)}},{key:"_getQualityItem",value:function(e){var n={},o=ui[this.getNetworkType()];ut(o)&&(o=8);var s={qualityType:ri[e],timestamp:we(),networkType:o,extension:""};switch(e){case Xr:n=this._avgRTT.getStatResult();break;case Qr:n=this._avgE2EDelay.getStatResult();break;case Zr:case $r:case ei:case ti:case ni:n=this._rateMessageSent.getStatResult(e);break;case oi:case si:case ai:n=this._rateMessageReceived.getStatResult(e)}return null===n?null:t(t({},s),n)}},{key:"_report",value:function(e){var t=this,n=[],o=null;ut(e)?this._qualityItems.forEach((function(e){null!==(o=t._getQualityItem(e))&&(o.reportIndex=t.reportIndex,o.wholePeriod=t.wholePeriod,n.push(o))})):null!==(o=this._getQualityItem(e))&&(o.reportIndex=this.reportIndex,o.wholePeriod=this.wholePeriod,n.push(o)),He.d("".concat(this._n,"._report"),n),this._statInfoArr.length>0&&(n=n.concat(this._statInfoArr),this._statInfoArr=[]);var s=this.getModule(Kn),a=s.getSDKAppID(),r=s.getTinyID();Bt(this.REPORT_SDKAPPID_BLACKLIST,a)&&!Ht(this.REPORT_TINYID_WHITELIST,r)&&(n=[]),n.length>0&&this._doReport(n)}},{key:"_doReport",value:function(e){var n=this,o={header:qu(this),quality:e};this.request({protocolName:Ws,requestData:t({},o)}).then((function(){n.reportIndex++,n.wholePeriod=!1})).catch((function(t){He.w("".concat(n._n,"._doReport, online:").concat(n.getNetworkType()," error:"),t),n._statInfoArr=n._statInfoArr.concat(e),n._flushAtOnce()}))}},{key:"_flushAtOnce",value:function(){var e=this.getModule(Wn),t=e.getItem(this.TAG,!1),n=this._statInfoArr,o="".concat(this._n,"._flushAtOnce");if(Zt(t))He.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var s=n.concat(t);s.length>10&&(s=s.slice(0,10)),He.l("".concat(o," count:").concat(s.length)),e.setItem(this.TAG,s,!0,!1)}this._statInfoArr=[]}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),s}(po),qc=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="WorkerTimerModule",s._isWorkerEnabled=!0,s._workerTimer=null,s._timerID=-1,s._init(),s.getInnerEmitterInstance().on(bi,s._onCloudConfigUpdated,h(s)),s}return a(n,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&Ae}},{key:"startWorkerTimer",value:function(){He.l("".concat(this._n,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{key:"stopWorkerTimer",value:function(){He.l("".concat(this._n,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{key:"_init",value:function(){if(Ae){var e=URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) { if (event.data === "start") { if (interval > 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(""); }, 1000); postMessage(interval); } else if (event.data === "stop") { clearInterval(interval); interval = -1; }};'],{type:"application/javascript; charset=utf-8"}));this._workerTimer=new Worker(e);var t=this;this._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,He.l("".concat(t._n,"._init seed:").concat(t._timerID))):t._m.onCheckTimer()}}}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("enable_worker");He.l("".concat(this._n,"._onCloudConfigUpdated enableWorker:").concat(e)),ut(e)||"1"===e?!this._isWorkerEnabled&&Ae&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&Ae&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:"terminate",value:function(){He.l("".concat(this._n,".terminate")),this._workerTimer&&(this._workerTimer.terminate(),this._workerTimer=null,this._timerID=-1)}},{key:"getTimerID",value:function(){return this._timerID}},{key:"reset",value:function(){He.l("".concat(this._n,".reset"))}}]),n}(po),Fc=function(){function e(){o(this,e),this._n="PurchasedFeatureHandler",this._purchasedFeatureMap=new Map}return a(e,[{key:"isValidPurchaseBits",value:function(e){return e&&"string"==typeof e&&e.length>=1&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:"parsePurchaseBits",value:function(e){var t="".concat(this._n,".parsePurchaseBits");if(this.isValidPurchaseBits(e)){this._purchasedFeatureMap.clear();for(var n=null,o=e.length-1,s=0;o>=0;o--,s++)n=s<32?new E(0,Math.pow(2,s)).toString():new E(Math.pow(2,s-32),0).toString(),"1"===e[o]?this._purchasedFeatureMap.set(n,!0):this._purchasedFeatureMap.set(n,!1)}else He.w("".concat(t," invalid purchase bits:").concat(e))}},{key:"hasPurchasedFeature",value:function(e){return!!this._purchasedFeatureMap.get(e)}},{key:"isFeatureEnabled",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,s=t.length-1,a=0;s>=0;s--,a++)if("1"===t.charAt(s)&&(n=a<32?new E(0,Math.pow(2,a)).toString():new E(Math.pow(2,a-32),0).toString(),!this._purchasedFeatureMap.get(n))){o=!1;break}return He.l("".concat(this._n,".isFeatureEnabled decimalNumber:").concat(e," binaryString:").concat(t," ret:").concat(o)),Ni({enabled:o})}},{key:"clear",value:function(){this._purchasedFeatureMap.clear()}}]),e}(),xc=function(){function e(t){o(this,e),this._m=t,this._n="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new Fc}return a(e,[{key:"_canFetch",value:function(){return this._getModule(Kn).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetch(),n="".concat(this._n,".fetchConfig");if(He.l("".concat(n," canFetch:").concat(t)),t){var o=this._getModule(Yn),s=new li("fetchCommercialConfig");s.setNetworkType(o.getNetworkType());var a=this._getModule(Kn).getSDKAppID(),r=this._getModule(Zn);this._isFetching=!0,r.request({protocolName:ta,requestData:{SDKAppID:a}}).then((function(t){s.setMessage("purchaseBits:".concat(t.data.purchaseBits)).end(),He.l("".concat(n," ok.")),e._parseConfig(t.data),e._isFetching=!1})).catch((function(t){o.probe().then((function(e){var n=v(e,2),o=n[0],a=n[1];s.setError(t,o,a).end()})),e._isFetching=!1}))}}},{key:"onPushedConfig",value:function(e){var t="".concat(this._n,".onPushedConfig");He.l("".concat(t)),new li("pushedCommercialConfig").setNetworkType(this._getModule(Yn).getNetworkType()).setMessage("purchaseBits:".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:"_parseConfig",value:function(e){var t="".concat(this._n,"._parseConfig"),n=e.errorCode,o=e.errorMessage,s=e.purchaseBits,a=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(s),this._expiredTime=Date.now()+1e3*a):ut(n)?(He.l("".concat(t," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(He.e("".concat(t," errorCode:").concat(n," errorMessage:").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"canIUse",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:"isFeatureEnabled",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:"_getModule",value:function(e){return this._m.getModule(e)}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),e}(),Vc=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._m=e,s._n="OfflinePushModule",s._offlinePushPlugin=void 0,s._androidPushConfig={huaweiPushBussinessId:"",xiaomiPushBussinessId:"",xiaomiPushAppId:"",xiaomiPushAppKey:"",meizuPushBussinessId:"",meizuPushAppId:"",meizuPushAppKey:"",vivoPushBussinessId:"",fcmPushBussinessId:"",oppoPushBussinessId:"",oppoPushAppKey:"",oppoPushAppSecret:"",honorPushBussinessId:""},s._deviceToken="",s._businessID=0,s._iosBusinessID=0,s._c2cUnreadCount=0,s._groupUnreadCount=0,s._isWebUniapp=0,s}return a(n,[{key:"registerPlugin",value:function(e){if(re){this._offlinePushPlugin=e["tim-offline-push-plugin"];var t=e.offlinePushConfig||{},n=t.huaweiBusinessID,o=t.xiaomiBusinessID,s=t.xiaomiAppID,a=t.xiaomiAppKey,r=t.meizuBusinessID,i=t.meizuAppID,u=t.meizuAppKey,c=t.vivoBusinessID,l=t.oppoBusinessID,p=t.oppoAppKey,d=t.oppoAppSecret,g=t.honorBusinessID,h=t.iosBusinessID;this._androidPushConfig.huaweiPushBussinessId=n,this._androidPushConfig.xiaomiPushBussinessId=o,this._androidPushConfig.xiaomiPushAppId=s,this._androidPushConfig.xiaomiPushAppKey=a,this._androidPushConfig.meizuPushBussinessId=r,this._androidPushConfig.meizuPushAppId=i,this._androidPushConfig.meizuPushAppKey=u,this._androidPushConfig.vivoPushBussinessId=c,this._androidPushConfig.oppoPushBussinessId=l,this._androidPushConfig.oppoPushAppKey=p,this._androidPushConfig.oppoPushAppSecret=d,this._androidPushConfig.honorPushBussinessId=g,new li("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!ut(this._offlinePushPlugin))).end(!0),He.l("".concat(this._n,".").concat("registerPlugin"," ok. offlinePushConfig:").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=h,this._setAppShowListener()}else this.outputWarning("OfflinePushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var e=this,t="".concat(this._n,".").concat("_getDeviceToken");if(lt(this._offlinePushPlugin.getDeviceToken)){var n="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID);He.l("".concat(t," start. ").concat(n)),new li("_getDeviceToken").setMessage("".concat(n)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var s=new li("getDeviceTokenRes"),a=o.code,r=o.msg;if(0===a){var i=o.data,u=i.deviceToken,c=i.deviceBrand,l=i.deviceType,p=i.bussinessId;e._deviceToken=u,e._businessID=p||e._iosBusinessID,n="deviceToken:".concat(u,", deviceBrand:").concat(c||l,", businessID:").concat(e._businessID),He.l("".concat(t," ok. ").concat(n)),s.setMessage(n).end(!0),e._setToken()}else s.setMessage("code:".concat(a,", msg:").concat(r)).end(!0),He.e("".concat(t," failed. error:"),o)}))}else He.e("".concat(t," getDeviceToken is not a function"))}},{key:"canIUseOfflinePush",value:function(){return re&&!ut(this._offlinePushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,t="".concat(this._n,".").concat("_setAppShowListener");ut(this._offlinePushPlugin)?He.e("".concat(t," offlinePushPlugin is undefined")):lt(this._offlinePushPlugin.setAppShowListener)?(new li("_setAppShowListener").end(!0),He.l("".concat(t," start")),this._offlinePushPlugin.setAppShowListener((function(n){var o=(n||{}).appShow;new li("setAppShowListenerRes").setMessage("appShow:".concat(o)).end(!0),He.l("".concat(t," ok. appShow:").concat(o)),e._m.isReady()&&(0===o?(e._getConvUnreadCount(),e._onBackground()):1===o&&e._onForeground())}))):He.e("".concat(t," setAppShowListener is not a function"))}},{key:"getDeviceBrand",value:function(){if(!ut(this._offlinePushPlugin)&<(this._offlinePushPlugin.getDeviceType)){var e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType;return He.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}}},{key:"_setToken",value:function(){var e,t=this,n="".concat(this._n,"._setToken"),o=this.getModule(Kn),s=1,a="",r="";Zt(this._deviceToken)&&(s=0);var i=this.getUniAppPlatform(),u=this.getDeviceBrand();i===R.IOS||i===R.IPAD||i===R.MAC?r=this._deviceToken:i===R.ANDROID&&(a=this._deviceToken);var c=new li("offlinePushSetToken");return e="deviceToken:".concat(r||a,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(u,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(s,", platform:").concat(i),c.setMessage("".concat(e)),He.l("".concat(n," ").concat(e)),this.request({protocolName:ha,requestData:{tokenID:a,pushMsg:s,sdkAppID:o.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:u,deviceToken:r,isWebUniapp:this._isWebUniapp}}).then((function(e){return c.end(),He.l("".concat(n," ok")),e})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),He.e("".concat(n," failed. error:"),e),Oi(e)}))}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.getModule(Hn).getLocalConversationList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:"_onBackground",value:function(){var e=this,t="".concat(this._n,".").concat("_onBackground"),n=new li("_onBackground");this.request({protocolName:da,requestData:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(o){return n.setMessage("c2cUnreadCount: ".concat(e._c2cUnreadCount,", groupUnreadCount: ").concat(e._groupUnreadCount)).end(),He.l("".concat(t," ok")),o})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];n.setError(o,s,a).end()})),He.e("".concat(t," failed. error:"),o)}))}},{key:"_onForeground",value:function(){var e=this,t="".concat(this._n,".").concat("_onForeground"),n=new li("_onForeground");this.request({protocolName:ga,requestData:{isWebUniapp:this._isWebUniapp}}).then((function(e){return n.end(),He.l("".concat(t," ok")),e})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];n.setError(o,s,a).end()})),He.e("".concat(t," failed. error:"),o)}))}},{key:"getUniAppPlatform",value:function(){var e=uni.getSystemInfoSync().platform,t=this.getDeviceBrand();return"ios"===e?R.IOS:"android"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,He.l("".concat(this._n,".reset"))}}]),n}(po),Bc=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="ProfanityFilterModule",s._plugin=null,s._filterConfigMap=new Map,s._startIndex=0,s._version=0,s._canIUseLexicon=!1,s._isFetching=!1,s._expiredTime=0,s}return a(n,[{key:"init",value:function(){var e=this.getModule(Xn).getPlugin("tim-profanity-filter-plugin");e?(this._plugin=new e({logger:He,isArray:it,isMap:et,isDevMode:this.isDevMode()}),this._getLexicon()):this.outputWarning("ProfanityPluginNotFound")}},{key:"onCheckTimer",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:"filterMessage",value:function(e,t){var n=!0;if(!this._plugin||!this._canIUseLexicon)return n;if(t&&t.messageControlInfo&&!0===t.messageControlInfo.excludedFromContentModeration)return n;var o=e.type,s=e.conversationType;if(o!==S.MSG_TEXT&&o!==S.MSG_CUSTOM)return n;var a,r="".concat(this._n,".filterMessage");if(He.l("".concat(r)),o===S.MSG_TEXT){if(s===S.CONV_C2C?a=H:s===S.CONV_GROUP&&(a=W),!this._isConfigOn(a))return n;var i=this._plugin.filter(e.payload.text),u=i.type,c=i.modifiedText;1===u?n=!1:2===u&&(e.payload.text=c)}else if(o===S.MSG_CUSTOM){if(s===S.CONV_C2C?a=K:s===S.CONV_GROUP&&(a=j),!this._isConfigOn(a))return n;var l=this._plugin.filter(e.payload.data),p=this._plugin.filter(e.payload.description),d=this._plugin.filter(e.payload.extension);1===l.type||1===p.type||1===d.type?n=!1:(2===l.type&&(e.payload.data=l.modifiedText),2===p.type&&(e.payload.description=p.modifiedText),2===d.type&&(e.payload.extension=d.modifiedText))}return He.l("".concat(r," done. isAllowedToSend:").concat(n)),n}},{key:"filterText",value:function(e,t){var n="".concat(this._n,".filterText"),o={isAllowedToSend:!0,modifiedText:e};if(!this._plugin||!this._canIUseLexicon)return o;if(!this._isConfigOn(t))return o;He.l("".concat(n));var s=this._plugin.filter(e),a=s.type,r=s.modifiedText;return 1===a?o.isAllowedToSend=!1:2===a&&(o.modifiedText=r),He.l("".concat(n," done. ret:"),o),o}},{key:"_getLexicon",value:function(){var e=this,t=new li("profanityFilter"),n="".concat(this._n,"._getLexicon");this._isFetching=!0,this.request({protocolName:_a,requestData:{startIndex:this._startIndex,version:this._version}}).then((function(o){var s=o.data,a=s.errorInfo,r=s.filterConfig,i=s.lexicon,u=s.strToken,c=s.completeFlag,l=s.nextStartIndex,p=s.version,d=s.expiredTime,g=a.errorCode,h=a.errorMessage;return 0!==g?(e._isFetching=!1,He.w("".concat(n," failed. error:"),a),void t.setCode(g).setMessage(h).end()):(e._onFilterConfig(r),e._getToken(u),1===c?(He.l("".concat(n," done. version:").concat(p," expiredTime:").concat(d)),e._version=p,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*d,void e._plugin.onLexiconCompleted(i)):(e._startIndex=l,e._plugin.onLexiconSliced(i),void e._getLexicon()))})).catch((function(o){e.probeNetwork().then((function(e){var n=v(e,2),s=n[0],a=n[1];t.setError(o,s,a).end()})),e._isFetching=!1,He.l("".concat(n," failed. error:"),o)}))}},{key:"_onFilterConfig",value:function(e){var t=this;Zt(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach((function(n){t._filterConfigMap.set(n,e[n])})),He.l("".concat(this._n,"._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys())," values:").concat(Array.from(this._filterConfigMap.values()))))}},{key:"_isConfigOn",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:"_getToken",value:function(e){if(st(e)){var t=e.length,n="";if(t%2==0)for(var o=0;o<=t-1;o+=2)n+=e[o+1],n+=e[o];else{for(var s=0;s=this.STORAGE_EXPIRES_TIME,s=!n||"2.27.0"!==n;return He.l("".concat(this._n,"._needToUpdate isTimeout:").concat(o," isDifferentVersion:").concat(s)),o||s}},{key:"_fetch",value:function(){if(!this._m.getModule(Kn).isPrivateNetWork()){var e="https://web.sdk.qcloud.com/im/download/error-message/0.0.1/tim-error-message.txt",t="application/x-www-form-urlencoded;charset=UTF-8",n="".concat(this._n,"._fetch ok in"),o=this;if(ue)le.request({url:e,method:"GET",timeout:3e3,header:{"content-type":t},dataType:"text",success:function(e){o._fillAndSave(e.data),He.l("".concat(n," mini program"))},fail:function(){}});else{var s=new XMLHttpRequest,a=setTimeout((function(){s.abort()}),3e3);s.onreadystatechange=function(){4===s.readyState&&(clearTimeout(a),200!==s.status&&304!==s.status||(He.l("".concat(n," browser")),o._fillAndSave(s.responseText)))},s.open("GET",e,!0),s.setRequestHeader("Content-type",t),s.send()}}}},{key:"_fillAndSave",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:"2.27.0"}),!0,!1)}},{key:"_getStorageModule",value:function(){return this._m.getModule(Wn)}},{key:"_fillMap",value:function(e){this._map.clear();for(var t,n,o,s=e.split(";\n"),a=s.length,r=new RegExp(/'/g),i=0;i0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:"_stopMainThreadSocket",value:function(){He.l("".concat(this._n,"._stopMainThreadSocket"));var e=this._moduleMap.get($n);e.setIsWorkerEnabled(!0),e.reConnect()}},{key:"_startMainThreadSocket",value:function(){He.l("".concat(this._n,"._startMainThreadSocket"));var e=this._moduleMap.get($n);e.setIsWorkerEnabled(!1),e.reConnect()}},{key:"onWorkerTimerEnabled",value:function(){He.l("".concat(this._n,".onWorkerTimerEnabled, disable main thread timer and socket")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:"onWorkerTimerDisabled",value:function(){He.l("".concat(this._n,".onWorkerTimerDisabled, enable main thread timer and socket")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:"onCheckTimer",value:function(){this._checkCount+=1;var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.onCheckTimer&&n.onCheckTimer(this._checkCount)}}catch(o){t.e(o)}finally{t.f()}}},{key:"_initReadyList",value:function(){var e=this;this._readyList=[this._moduleMap.get(Pn),this._moduleMap.get(Hn)],this._readyList.forEach((function(t){t.ready((function(){return e._onModuleReady()}))}))}},{key:"_onModuleReady",value:function(){var e=!0;if(this._readyList.forEach((function(t){t.isReady()||(e=!1)})),e&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(k.SDK_READY);var t=Date.now()-this._startLoginTs;He.w("SDK is ready. cost ".concat(t," ms")),this._startLoginTs=Date.now();var n=this._moduleMap.get(Yn).getNetworkType(),o=this._ssoLogForReady.getStartTs()+be;this._ssoLogForReady.setNetworkType(n).setMessage(t).start(o).end()}}},{key:"login",value:function(){0===this._startLoginTs&&(qe(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(Yn).start(),this._ssoLogForReady=new li("sdkReady"),this._reason=br)}},{key:"onLoginFailed",value:function(){this._startLoginTs=0}},{key:"getOuterEmitterInstance",value:function(){return null===this._outerEmitter&&(this._outerEmitter=new Ku,Ri(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=function(e,t){var n=this;if(e===k.CONVERSATION_LIST_UPDATED||e===k.FRIEND_LIST_UPDATED||e===k.GROUP_LIST_UPDATED||e===k.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED)if(this._eventThrottleMap.has(e)){var o=Date.now(),s=this._eventThrottleMap.get(e);o-s.last<1e3?(s.timeoutID&&clearTimeout(s.timeoutID),s.timeoutID=setTimeout((function(){s.last=o,n._outerEmitter._emit.apply(n._outerEmitter,[e,{name:e,data:n._getEventData(e)}])}),500)):(s.last=o,this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]))}else this._eventThrottleMap.set(e,{last:Date.now(),timeoutID:-1}),this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]);else this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:arguments[1]}])}.bind(this)),this._outerEmitter}},{key:"_getEventData",value:function(e){return e===k.CONVERSATION_LIST_UPDATED?this._moduleMap.get(Hn).getLocalConversationList():e===k.FRIEND_LIST_UPDATED?this._moduleMap.get(xn).getLocalFriendList(!1):e===k.GROUP_LIST_UPDATED?this._moduleMap.get(Fn).getLocalGroupList():e===k.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._moduleMap.get(Hn).getTotalUnreadMessageCount():void 0}},{key:"getInnerEmitterInstance",value:function(){return null===this._innerEmitter&&(this._innerEmitter=new Ku,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=function(e,t){var n;n=rt(arguments[1])&&arguments[1].data?[e,{name:arguments[0],data:arguments[1].data}]:[e,{name:arguments[0],data:arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,n)}.bind(this)),this._innerEmitter}},{key:"hasModule",value:function(e){return this._moduleMap.has(e)}},{key:"getModule",value:function(e){return this._moduleMap.get(e)}},{key:"isReady",value:function(){return this._isReady}},{key:"isIntl",value:function(){return this.getModule(Kn).isIntl()}},{key:"getNotReadyReason",value:function(){return this._reason}},{key:"setNotReadyReason",value:function(e){this._reason=e}},{key:"getErrorMessage",value:function(e,t,n){return this._moduleMap.get(lo).get({key:e,replacement1:t,replacement2:n,isIntl:this.isIntl()})}},{key:"outputWarning",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&He.w(o)}},{key:"onError",value:function(e){var t="code:".concat(e.code," message:").concat(e.message);He.w("Oops! ".concat(t)),new li("error").setMessage(t).setNetworkType(this.getModule(Yn).getNetworkType()).setLevel("error").end(),this.getOuterEmitterInstance().emit(k.ERROR,e)}},{key:"restartTimer",value:function(){He.l("".concat(this._n,".restartTimer")),this.stopTimer(),this._startTimer(),this.getModule(Fn).restartPolling()}},{key:"getTimerID",value:function(){var e=this._moduleMap.get(no);return e.isWorkerEnabled()?e.getTimerID():this._checkTimer}},{key:"reset",value:function(){He.l("".concat(this._n,".reset")),qe();var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.reset&&n.reset()}}catch(r){t.e(r)}finally{t.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(k.SDK_NOT_READY);var o,s=D(this._eventThrottleMap);try{for(s.s();!(o=s.n()).done;){var a=v(o.value,2)[1];a.timeoutID&&clearTimeout(a.timeoutID)}}catch(r){s.e(r)}finally{s.f()}this._eventThrottleMap.clear()}}]),e}(),jc=function(){function e(t){o(this,e),this._funcMap=new Map,this._m=t}return a(e,[{key:"defense",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("string"!=typeof e)return null;if(0===e.length)return null;if("function"!=typeof t)return null;if(this._funcMap.has(e)&&this._funcMap.get(e).has(t))return this._funcMap.get(e).get(t);this._funcMap.has(e)||this._funcMap.set(e,new Map);var o=null;return this._funcMap.get(e).has(t)?o=this._funcMap.get(e).get(t):(o=this._pack(e,t,n),this._funcMap.get(e).set(t,o)),o}},{key:"defenseOnce",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return"function"!=typeof t?null:this._pack(e,t,n)}},{key:"find",value:function(e,t){return"string"!=typeof e||0===e.length||"function"!=typeof t?null:this._funcMap.has(e)&&this._funcMap.get(e).has(t)?this._funcMap.get(e).get(t):(this._m.outputWarning("ListenerFnNotFound",e),null)}},{key:"delete",value:function(e,t){return"function"==typeof t&&(!!this._funcMap.has(e)&&(!!this._funcMap.get(e).has(t)&&(this._funcMap.get(e).delete(t),0===this._funcMap.get(e).size&&this._funcMap.delete(e),!0)))}},{key:"_pack",value:function(e,t,n){var o=this;return function(){try{t.apply(n,Array.from(arguments))}catch(u){var s=Object.values(k).indexOf(e),a="CallbackError";if(-1!==s){var r=Object.keys(k)[s];o._m.outputWarning(a,r,u)}var i=new li(a);i.setMessage("eventName:".concat(e)).setMoreMessage(u.message).end()}}}}]),e}(),Yc=function(){function e(t){o(this,e);var n={SDKAppID:t.SDKAppID,unlimitedAVChatRoom:t.unlimitedAVChatRoom||!1,scene:t.scene||"",oversea:t.oversea||!1,instanceID:Ut(),devMode:t.devMode||!1,proxyServer:t.proxyServer||void 0,fileUploadProxy:t.fileUploadProxy||void 0,fileDownloadProxy:t.fileDownloadProxy||t.fileUploadProxy||void 0};this._m=new Wc(n),this._safetyCallbackFactory=new jc(this._m)}return a(e,[{key:"onError",value:function(e){this._m.onError(e)}},{key:"login",value:function(e){return this._m.login(),this._getModule(Pn).login(e)}},{key:"logout",value:function(){var e=this;return this._getModule(Pn).logout().then((function(t){return e._m.reset(),t}))}},{key:"isReady",value:function(){return this._m.isReady()}},{key:"isIntl",value:function(){return this._m.isIntl()}},{key:"getNotReadyReason",value:function(){return this._m.getNotReadyReason()}},{key:"getErrorMessage",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:"_getModule",value:function(e){return this._m.getModule(e)}},{key:"destroy",value:function(){var e=this;return this.logout().finally((function(){e._m.stopTimer(),e._getModule(no).terminate(),e._getModule($n).dealloc();var t=e._m.getOuterEmitterInstance(),n=e._getModule(Kn);t.emit(k.SDK_DESTROY,{SDKAppID:n.getSDKAppID()})}))}},{key:"on",value:function(e,t,n){He.d("on","eventName:".concat(e)),this._m.getOuterEmitterInstance().on(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"once",value:function(e,t,n){He.d("once","eventName:".concat(e)),this._m.getOuterEmitterInstance().once(e,this._safetyCallbackFactory.defenseOnce(e,t,n),n||this)}},{key:"off",value:function(e,t,n,o){He.d("off","eventName:".concat(e));var s=this._safetyCallbackFactory.find(e,t);null!==s&&(this._m.getOuterEmitterInstance().off(e,s,n,o),this._safetyCallbackFactory.delete(e,t))}},{key:"registerPlugin",value:function(e){ut(e["tim-offline-push-plugin"])?this._getModule(Xn).registerPlugin(e):this._getModule(ro).registerPlugin(e)}},{key:"setLogLevel",value:function(e){if(e<=0){var t=this.getErrorMessage("TIM_ASCII_ART");t&&console.log(t);var n=this.getErrorMessage("API_REFER");if(n){zt()?console.log("%c ".concat("IM SDK API ->"," %c"),"background:#ff9d00; padding:1px; border-radius:3px; color: #fff","background:transparent",n):console.log("IM SDK API ->",n)}var o=this.getErrorMessage("DOCS_GUIDE");o&&console.log(o)}He.setLevel(e)}},{key:"createTextMessage",value:function(e){return this._getModule(Un).createTextMessage(e)}},{key:"createTextAtMessage",value:function(e){return this._getModule(Un).createTextMessage(e)}},{key:"createImageMessage",value:function(e){return this._getModule(Un).createImageMessage(e)}},{key:"createAudioMessage",value:function(e){return this._getModule(Un).createAudioMessage(e)}},{key:"createVideoMessage",value:function(e){return this._getModule(Un).createVideoMessage(e)}},{key:"createCustomMessage",value:function(e){return this._getModule(Un).createCustomMessage(e)}},{key:"createFaceMessage",value:function(e){return this._getModule(Un).createFaceMessage(e)}},{key:"createFileMessage",value:function(e){return this._getModule(Un).createFileMessage(e)}},{key:"createLocationMessage",value:function(e){return this._getModule(Un).createLocationMessage(e)}},{key:"createMergerMessage",value:function(e){return this._getModule(Un).createMergerMessage(e)}},{key:"downloadMergerMessage",value:function(e){return e.type!==S.MSG_MERGER?Oi({code:Qa}):Zt(e.payload.downloadKey)?Oi({code:Za}):this._getModule(Un).downloadMergerMessage(e).catch((function(e){return Oi({code:$a})}))}},{key:"createForwardMessage",value:function(e){return this._getModule(Un).createForwardMessage(e)}},{key:"sendMessage",value:function(e,t){return e instanceof Si?this._getModule(Un).sendMessageInstance(e,t):Oi({code:Ea})}},{key:"callExperimentalAPI",value:function(e,t){return"sendComboMessage"===e?this._getModule(co).sendMessage(t):"handleGroupInvitation"===e?this._getModule(Fn).handleGroupInvitation(t):"isCommercialAbilityEnabled"===e?this._getModule(ao).isFeatureEnabled(t):"isIntl"===e?this.isIntl():"sendTRTCCustomData"===e?this._getModule(uo).sendTRTCCustomData(t):"getTimerID"===e?this._m.getTimerID():Oi({code:Nr})}},{key:"revokeMessage",value:function(e){return this._getModule(Un).revokeMessage(e)}},{key:"resendMessage",value:function(e){return this._getModule(Un).resendMessage(e)}},{key:"deleteMessage",value:function(e){return this._getModule(Un).deleteMessage(e)}},{key:"translateText",value:function(e){return this._getModule(Un).translateText(e)}},{key:"setMessageExtensions",value:function(e,t){return this._getModule(bn).setMessageExtensions(e,t)}},{key:"getMessageExtensions",value:function(e){return this._getModule(bn).getMessageExtensions(e)}},{key:"deleteMessageExtensions",value:function(e,t){return this._getModule(bn).deleteMessageExtensions(e,t)}},{key:"modifyMessage",value:function(e){return this._getModule(Un).modifyRemoteMessage(e)}},{key:"getMessageList",value:function(e){return this._getModule(Hn).getMessageList(e)}},{key:"getMessageListHopping",value:function(e){return this._getModule(Hn).getMessageListHopping(e)}},{key:"sendMessageReadReceipt",value:function(e){return this._getModule(Hn).sendReadReceipt(e)}},{key:"getMessageReadReceiptList",value:function(e){return this._getModule(Hn).getReadReceiptList(e)}},{key:"getGroupMessageReadMemberList",value:function(e){return this._getModule(Fn).getReadReceiptDetail(e)}},{key:"findMessage",value:function(e){return this._getModule(Hn).findMessage(e)}},{key:"setMessageRead",value:function(e){return this._getModule(Hn).setMessageRead(e)}},{key:"getConversationList",value:function(e){return this._getModule(Hn).getConversationList(e)}},{key:"getConversationProfile",value:function(e){return this._getModule(Hn).getConversationProfile(e)}},{key:"deleteConversation",value:function(e){return this._getModule(Hn).deleteConversation(e)}},{key:"clearHistoryMessage",value:function(e){return this._getModule(Hn).clearHistoryMessage(e)}},{key:"pinConversation",value:function(e){return this._getModule(Hn).pinConversation(e)}},{key:"setAllMessageRead",value:function(e){return this._getModule(Hn).setAllMessageRead(e)}},{key:"setMessageRemindType",value:function(e){return this._getModule(Hn).setMessageRemindType(e)}},{key:"getTotalUnreadMessageCount",value:function(){return this._getModule(Hn).getTotalUnreadMessageCount()}},{key:"setConversationCustomData",value:function(e){return this._getModule(Hn).setConversationCustomData(e)}},{key:"markConversation",value:function(e){return this._getModule(Hn).markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._getModule(Hn).getConversationGroupList()}},{key:"createConversationGroup",value:function(e){return this._getModule(Hn).createConversationGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._getModule(Hn).deleteConversationGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._getModule(Hn).renameConversationGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._getModule(Hn).addConversationsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._getModule(Hn).deleteConversationsFromGroup(e)}},{key:"getMyProfile",value:function(){return this._getModule(wn).getMyProfile()}},{key:"getUserProfile",value:function(e){return this._getModule(wn).getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._getModule(wn).updateMyProfile(e)}},{key:"getBlacklist",value:function(){return this._getModule(wn).getLocalBlacklist()}},{key:"addToBlacklist",value:function(e){return this._getModule(wn).addBlacklist(e)}},{key:"removeFromBlacklist",value:function(e){return this._getModule(wn).deleteBlacklist(e)}},{key:"setSelfStatus",value:function(e){return this._getModule(wn).setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._getModule(wn).getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._getModule(wn).subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._getModule(wn).unsubscribeUserStatus(e)}},{key:"getFriendList",value:function(){var e=this._getModule(xn);return e?e.getLocalFriendList():Oi({code:Pr})}},{key:"addFriend",value:function(e){var t=this._getModule(xn);return t?t.addFriend(e):Oi({code:Pr})}},{key:"deleteFriend",value:function(e){var t=this._getModule(xn);return t?t.deleteFriend(e):Oi({code:Pr})}},{key:"checkFriend",value:function(e){var t=this._getModule(xn);return t?t.checkFriend(e):Oi({code:Pr})}},{key:"getFriendProfile",value:function(e){var t=this._getModule(xn);return t?t.getFriendProfile(e):Oi({code:Pr})}},{key:"updateFriend",value:function(e){var t=this._getModule(xn);return t?t.updateFriend(e):Oi({code:Pr})}},{key:"getFriendApplicationList",value:function(){var e=this._getModule(xn);return e?e.getLocalFriendApplicationList():Oi({code:Pr})}},{key:"acceptFriendApplication",value:function(e){var t=this._getModule(xn);return t?t.acceptFriendApplication(e):Oi({code:Pr})}},{key:"refuseFriendApplication",value:function(e){var t=this._getModule(xn);return t?t.refuseFriendApplication(e):Oi({code:Pr})}},{key:"deleteFriendApplication",value:function(e){var t=this._getModule(xn);return t?t.deleteFriendApplication(e):Oi({code:Pr})}},{key:"setFriendApplicationRead",value:function(){var e=this._getModule(xn);return e?e.setFriendApplicationRead():Oi({code:Pr})}},{key:"getFriendGroupList",value:function(){var e=this._getModule(xn);return e?e.getLocalFriendGroupList():Oi({code:Pr})}},{key:"createFriendGroup",value:function(e){var t=this._getModule(xn);return t?t.createFriendGroup(e):Oi({code:Pr})}},{key:"deleteFriendGroup",value:function(e){var t=this._getModule(xn);return t?t.deleteFriendGroup(e):Oi({code:Pr})}},{key:"addToFriendGroup",value:function(e){var t=this._getModule(xn);return t?t.addToFriendGroup(e):Oi({code:Pr})}},{key:"removeFromFriendGroup",value:function(e){var t=this._getModule(xn);return t?t.removeFromFriendGroup(e):Oi({code:Pr})}},{key:"renameFriendGroup",value:function(e){var t=this._getModule(xn);return t?t.renameFriendGroup(e):Oi({code:Pr})}},{key:"getGroupList",value:function(e){return this._getModule(Fn).getGroupList(e)}},{key:"getGroupProfile",value:function(e){return this._getModule(Fn).getGroupProfile(e)}},{key:"createGroup",value:function(e){return this._getModule(Fn).createGroup(e)}},{key:"dismissGroup",value:function(e){return this._getModule(Fn).dismissGroup(e)}},{key:"updateGroupProfile",value:function(e){return this._getModule(Fn).updateGroupProfile(e)}},{key:"joinGroup",value:function(e){return this._getModule(Fn).joinGroup(e)}},{key:"quitGroup",value:function(e){return this._getModule(Fn).quitGroup(e)}},{key:"searchGroupByID",value:function(e){return this._getModule(Fn).searchGroupByID(e)}},{key:"getGroupOnlineMemberCount",value:function(e){return this._getModule(Fn).getGroupOnlineMemberCount(e)}},{key:"changeGroupOwner",value:function(e){return this._getModule(Fn).changeGroupOwner(e)}},{key:"getGroupApplicationList",value:function(){return this._getModule(Fn).getGroupApplicationList()}},{key:"handleGroupApplication",value:function(e){return this._getModule(Fn).handleGroupApplication(e)}},{key:"initGroupAttributes",value:function(e){return this._getModule(Fn).initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._getModule(Fn).setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._getModule(Fn).deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._getModule(Fn).getGroupAttributes(e)}},{key:"setGroupCounters",value:function(e){return this._getModule(Fn).setGroupCounters(e)}},{key:"increaseGroupCounter",value:function(e){return this._getModule(Fn).increaseGroupCounter(e)}},{key:"decreaseGroupCounter",value:function(e){return this._getModule(Fn).decreaseGroupCounter(e)}},{key:"getGroupCounters",value:function(e){return this._getModule(Fn).getGroupCounters(e)}},{key:"getGroupMemberList",value:function(e){return this._getModule(Vn).getGroupMemberList(e)}},{key:"getGroupMemberProfile",value:function(e){return this._getModule(Vn).getGroupMemberProfile(e)}},{key:"addGroupMember",value:function(e){return this._getModule(Vn).addGroupMember(e)}},{key:"deleteGroupMember",value:function(e){return this._getModule(Vn).deleteGroupMember(e)}},{key:"setGroupMemberMuteTime",value:function(e){return this._getModule(Vn).setGroupMemberMuteTime(e)}},{key:"setGroupMemberRole",value:function(e){return this._getModule(Vn).setGroupMemberRole(e)}},{key:"setGroupMemberNameCard",value:function(e){return this._getModule(Vn).setGroupMemberNameCard(e)}},{key:"setGroupMemberCustomField",value:function(e){return this._getModule(Vn).setGroupMemberCustomField(e)}},{key:"markGroupMemberList",value:function(e){return this._getModule(Vn).markGroupMemberList(e)}},{key:"getJoinedCommunityList",value:function(){return this._getModule(Bn).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(e){return this._getModule(Bn).createTopicInCommunity(e)}},{key:"deleteTopicFromCommunity",value:function(e){return this._getModule(Bn).deleteTopicFromCommunity(e)}},{key:"updateTopicProfile",value:function(e){return this._getModule(Bn).updateTopicProfile(e)}},{key:"getTopicList",value:function(e){return this._getModule(Bn).getTopicList(e)}}]),e}(),zc={login:1,logout:1,destroy:1,on:1,off:1,ready:1,setLogLevel:1,joinGroup:1,quitGroup:1,registerPlugin:1,getGroupOnlineMemberCount:1};function Jc(e,t){if(e.isReady()||1===zc[t])return!0;var n=e.getNotReadyReason(),o={code:n,message:"".concat(e.getErrorMessage(n)," | ").concat(t," | ").concat(e.getErrorMessage(Ur))};return e.onError(o),o}var Xc={},Qc={};return Qc.create=function(e){var n=0,o=e.SDKAppID;if(ot(o))n=o;else if(n=parseInt(o),isNaN(o))return He.e("".concat("TIM.create"," failed. Failed to parse the SDKAppID, please check the arguments")),null;if(n&&Xc[n])return Xc[n];He.l("".concat("TIM.create"));var s=new Yc(t(t({},e),{},{SDKAppID:n}));s.on(k.SDK_DESTROY,(function(e){Xc[e.data.SDKAppID]=null,delete Xc[e.data.SDKAppID]}));var a=function(e){var t=Object.create(null);return Object.keys(Gn).forEach((function(n){if(e[n]){var o=new L;t[n]=function(){var t=Array.from(arguments);return o.use((function(t,o){var s=Jc(e,n);return!0===s?o():Oi(s)})).use((function(e,t){if(!0===$t(e,On[n],n))return t()})).use((function(t,o){return e[n].apply(e,t)})),o.run(t)}}})),t}(s);return Xc[n]=a,On.hookGetAPITips(s.getErrorMessage.bind(s)),He.l("".concat("TIM.create"," ok")),a},Qc.TYPES=S,Qc.EVENT=k,Qc.VERSION="2.27.0",He.l("TIM.VERSION:".concat(Qc.VERSION)),Qc}));
diff --git a/TUIKit/static/assets/ic_back_black.svg b/TUIKit/static/assets/ic_back_black.svg
new file mode 100644
index 0000000..7e22047
--- /dev/null
+++ b/TUIKit/static/assets/ic_back_black.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/TUIKit/static/images/back.png b/TUIKit/static/images/back.png
new file mode 100644
index 0000000..4eafa0d
Binary files /dev/null and b/TUIKit/static/images/back.png differ
diff --git a/TUIKit/static/images/patient_bg.png b/TUIKit/static/images/patient_bg.png
new file mode 100644
index 0000000..90a1d93
Binary files /dev/null and b/TUIKit/static/images/patient_bg.png differ
diff --git a/TUIKit/static/images/play.gif b/TUIKit/static/images/play.gif
new file mode 100644
index 0000000..39212e3
Binary files /dev/null and b/TUIKit/static/images/play.gif differ
diff --git a/TUIKit/static/images/play.png b/TUIKit/static/images/play.png
new file mode 100644
index 0000000..2656566
Binary files /dev/null and b/TUIKit/static/images/play.png differ
diff --git a/TUIKit/static/images/playme.gif b/TUIKit/static/images/playme.gif
new file mode 100644
index 0000000..6595ed1
Binary files /dev/null and b/TUIKit/static/images/playme.gif differ
diff --git a/TUIKit/static/images/playme.png b/TUIKit/static/images/playme.png
new file mode 100644
index 0000000..c9a6369
Binary files /dev/null and b/TUIKit/static/images/playme.png differ
diff --git a/TUIKit/utils/constant.js b/TUIKit/utils/constant.js
index 5125093..48f6535 100644
--- a/TUIKit/utils/constant.js
+++ b/TUIKit/utils/constant.js
@@ -39,6 +39,20 @@ const constant = {
DIRTY_MEDIA: '您发送的消息包含违禁内容!',
RESEND_SUCCESS: '重发成功',
},
+ //自定义消息
+ GDXZ_CUSTOM_MSEEAGE: {
+ TRABECULA: 1,//1:消息内页横条(医生->患者)
+ ORDER_EVALUATION: 2,//2:订单结束评价弹出
+ DOCTOR_SYSTEM_NOTIFICATION: 3,//3:医生端系统通知
+ DOCTOR_SERVICE_NOTIFICATION: 4,//4:医生端服务通知
+ PATIENT_SYSTEM_MESSAGES: 5,//5:患者端系统消息
+ PRESCRIBE: 6,//6:处方开具成功(医生端)
+ PRESCRIBE_VERIFY: 7,//7:处方审核通过(患者端)
+ BANNER_MESSAGE: 8,//8 弹框消息
+ SUGAR_CHECK:10,//糖组检测
+ PATIENT_INFO:11,//患者信息
+ WENZHEN_FORM:12,//问诊表;
+ },
OPERATING_ENVIRONMENT: 'imWxTuikit'
};
diff --git a/TUIKit/utils/runtime.js b/TUIKit/utils/runtime.js
new file mode 100644
index 0000000..e444703
--- /dev/null
+++ b/TUIKit/utils/runtime.js
@@ -0,0 +1,717 @@
+/**
+ * 编程小石头
+ * wechat:2501902696
+ */
+
+!(function (global) {
+ // "use strict";
+
+ var Op = Object.prototype;
+ var hasOwn = Op.hasOwnProperty;
+ var undefined; // More compressible than void 0.
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
+
+ var inModule = typeof module === "object";
+ var runtime = global.regeneratorRuntime;
+ if (runtime) {
+ if (inModule) {
+ // If regeneratorRuntime is defined globally and we're in a module,
+ // make the exports object identical to regeneratorRuntime.
+ module.exports = runtime;
+ }
+ // Don't bother evaluating the rest of this file if the runtime was
+ // already defined globally.
+ return;
+ }
+
+ // Define the runtime globally (as expected by generated code) as either
+ // module.exports (if we're in a module) or a new, empty object.
+ runtime = global.regeneratorRuntime = inModule ? module.exports : {};
+
+ function wrap(innerFn, outerFn, self, tryLocsList) {
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
+ var generator = Object.create(protoGenerator.prototype);
+ var context = new Context(tryLocsList || []);
+
+ // The ._invoke method unifies the implementations of the .next,
+ // .throw, and .return methods.
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
+
+ return generator;
+ }
+ runtime.wrap = wrap;
+
+ // Try/catch helper to minimize deoptimizations. Returns a completion
+ // record like context.tryEntries[i].completion. This interface could
+ // have been (and was previously) designed to take a closure to be
+ // invoked without arguments, but in all the cases we care about we
+ // already have an existing method we want to call, so there's no need
+ // to create a new function object. We can even get away with assuming
+ // the method takes exactly one argument, since that happens to be true
+ // in every case, so we don't have to touch the arguments object. The
+ // only additional allocation required is the completion record, which
+ // has a stable shape and so hopefully should be cheap to allocate.
+ function tryCatch(fn, obj, arg) {
+ try {
+ return { type: "normal", arg: fn.call(obj, arg) };
+ } catch (err) {
+ return { type: "throw", arg: err };
+ }
+ }
+
+ var GenStateSuspendedStart = "suspendedStart";
+ var GenStateSuspendedYield = "suspendedYield";
+ var GenStateExecuting = "executing";
+ var GenStateCompleted = "completed";
+
+ // Returning this object from the innerFn has the same effect as
+ // breaking out of the dispatch switch statement.
+ var ContinueSentinel = {};
+
+ // Dummy constructor functions that we use as the .constructor and
+ // .constructor.prototype properties for functions that return Generator
+ // objects. For full spec compliance, you may wish to configure your
+ // minifier not to mangle the names of these two functions.
+ function Generator() { }
+ function GeneratorFunction() { }
+ function GeneratorFunctionPrototype() { }
+
+ // This is a polyfill for %IteratorPrototype% for environments that
+ // don't natively support it.
+ var IteratorPrototype = {};
+ IteratorPrototype[iteratorSymbol] = function () {
+ return this;
+ };
+
+ var getProto = Object.getPrototypeOf;
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
+ if (NativeIteratorPrototype &&
+ NativeIteratorPrototype !== Op &&
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
+ // This environment has a native %IteratorPrototype%; use it instead
+ // of the polyfill.
+ IteratorPrototype = NativeIteratorPrototype;
+ }
+
+ var Gp = GeneratorFunctionPrototype.prototype =
+ Generator.prototype = Object.create(IteratorPrototype);
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
+ GeneratorFunctionPrototype[toStringTagSymbol] =
+ GeneratorFunction.displayName = "GeneratorFunction";
+
+ // Helper for defining the .next, .throw, and .return methods of the
+ // Iterator interface in terms of a single ._invoke method.
+ function defineIteratorMethods(prototype) {
+ ["next", "throw", "return"].forEach(function (method) {
+ prototype[method] = function (arg) {
+ return this._invoke(method, arg);
+ };
+ });
+ }
+
+ runtime.isGeneratorFunction = function (genFun) {
+ var ctor = typeof genFun === "function" && genFun.constructor;
+ return ctor
+ ? ctor === GeneratorFunction ||
+ // For the native GeneratorFunction constructor, the best we can
+ // do is to check its .name property.
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
+ : false;
+ };
+
+ runtime.mark = function (genFun) {
+ if (Object.setPrototypeOf) {
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
+ } else {
+ genFun.__proto__ = GeneratorFunctionPrototype;
+ if (!(toStringTagSymbol in genFun)) {
+ genFun[toStringTagSymbol] = "GeneratorFunction";
+ }
+ }
+ genFun.prototype = Object.create(Gp);
+ return genFun;
+ };
+
+ // Within the body of any async function, `await x` is transformed to
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
+ // meant to be awaited.
+ runtime.awrap = function (arg) {
+ return { __await: arg };
+ };
+
+ function AsyncIterator(generator) {
+ function invoke(method, arg, resolve, reject) {
+ var record = tryCatch(generator[method], generator, arg);
+ if (record.type === "throw") {
+ reject(record.arg);
+ } else {
+ var result = record.arg;
+ var value = result.value;
+ if (value &&
+ typeof value === "object" &&
+ hasOwn.call(value, "__await")) {
+ return Promise.resolve(value.__await).then(function (value) {
+ invoke("next", value, resolve, reject);
+ }, function (err) {
+ invoke("throw", err, resolve, reject);
+ });
+ }
+
+ return Promise.resolve(value).then(function (unwrapped) {
+ // When a yielded Promise is resolved, its final value becomes
+ // the .value of the Promise<{value,done}> result for the
+ // current iteration.
+ result.value = unwrapped;
+ resolve(result);
+ }, function (error) {
+ // If a rejected Promise was yielded, throw the rejection back
+ // into the async generator function so it can be handled there.
+ return invoke("throw", error, resolve, reject);
+ });
+ }
+ }
+
+ var previousPromise;
+
+ function enqueue(method, arg) {
+ function callInvokeWithMethodAndArg() {
+ return new Promise(function (resolve, reject) {
+ invoke(method, arg, resolve, reject);
+ });
+ }
+
+ return previousPromise =
+ // If enqueue has been called before, then we want to wait until
+ // all previous Promises have been resolved before calling invoke,
+ // so that results are always delivered in the correct order. If
+ // enqueue has not been called before, then it is important to
+ // call invoke immediately, without waiting on a callback to fire,
+ // so that the async generator function has the opportunity to do
+ // any necessary setup in a predictable way. This predictability
+ // is why the Promise constructor synchronously invokes its
+ // executor callback, and why async functions synchronously
+ // execute code before the first await. Since we implement simple
+ // async functions in terms of async generators, it is especially
+ // important to get this right, even though it requires care.
+ previousPromise ? previousPromise.then(
+ callInvokeWithMethodAndArg,
+ // Avoid propagating failures to Promises returned by later
+ // invocations of the iterator.
+ callInvokeWithMethodAndArg
+ ) : callInvokeWithMethodAndArg();
+ }
+
+ // Define the unified helper method that is used to implement .next,
+ // .throw, and .return (see defineIteratorMethods).
+ this._invoke = enqueue;
+ }
+
+ defineIteratorMethods(AsyncIterator.prototype);
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
+ return this;
+ };
+ runtime.AsyncIterator = AsyncIterator;
+
+ // Note that simple async functions are implemented on top of
+ // AsyncIterator objects; they just return a Promise for the value of
+ // the final result produced by the iterator.
+ runtime.async = function (innerFn, outerFn, self, tryLocsList) {
+ var iter = new AsyncIterator(
+ wrap(innerFn, outerFn, self, tryLocsList)
+ );
+
+ return runtime.isGeneratorFunction(outerFn)
+ ? iter // If outerFn is a generator, return the full iterator.
+ : iter.next().then(function (result) {
+ return result.done ? result.value : iter.next();
+ });
+ };
+
+ function makeInvokeMethod(innerFn, self, context) {
+ var state = GenStateSuspendedStart;
+
+ return function invoke(method, arg) {
+ if (state === GenStateExecuting) {
+ throw new Error("Generator is already running");
+ }
+
+ if (state === GenStateCompleted) {
+ if (method === "throw") {
+ throw arg;
+ }
+
+ // Be forgiving, per 25.3.3.3.3 of the spec:
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
+ return doneResult();
+ }
+
+ context.method = method;
+ context.arg = arg;
+
+ while (true) {
+ var delegate = context.delegate;
+ if (delegate) {
+ var delegateResult = maybeInvokeDelegate(delegate, context);
+ if (delegateResult) {
+ if (delegateResult === ContinueSentinel) continue;
+ return delegateResult;
+ }
+ }
+
+ if (context.method === "next") {
+ // Setting context._sent for legacy support of Babel's
+ // function.sent implementation.
+ context.sent = context._sent = context.arg;
+
+ } else if (context.method === "throw") {
+ if (state === GenStateSuspendedStart) {
+ state = GenStateCompleted;
+ throw context.arg;
+ }
+
+ context.dispatchException(context.arg);
+
+ } else if (context.method === "return") {
+ context.abrupt("return", context.arg);
+ }
+
+ state = GenStateExecuting;
+
+ var record = tryCatch(innerFn, self, context);
+ if (record.type === "normal") {
+ // If an exception is thrown from innerFn, we leave state ===
+ // GenStateExecuting and loop back for another invocation.
+ state = context.done
+ ? GenStateCompleted
+ : GenStateSuspendedYield;
+
+ if (record.arg === ContinueSentinel) {
+ continue;
+ }
+
+ return {
+ value: record.arg,
+ done: context.done
+ };
+
+ } else if (record.type === "throw") {
+ state = GenStateCompleted;
+ // Dispatch the exception by looping back around to the
+ // context.dispatchException(context.arg) call above.
+ context.method = "throw";
+ context.arg = record.arg;
+ }
+ }
+ };
+ }
+
+ // Call delegate.iterator[context.method](context.arg) and handle the
+ // result, either by returning a { value, done } result from the
+ // delegate iterator, or by modifying context.method and context.arg,
+ // setting context.delegate to null, and returning the ContinueSentinel.
+ function maybeInvokeDelegate(delegate, context) {
+ var method = delegate.iterator[context.method];
+ if (method === undefined) {
+ // A .throw or .return when the delegate iterator has no .throw
+ // method always terminates the yield* loop.
+ context.delegate = null;
+
+ if (context.method === "throw") {
+ if (delegate.iterator.return) {
+ // If the delegate iterator has a return method, give it a
+ // chance to clean up.
+ context.method = "return";
+ context.arg = undefined;
+ maybeInvokeDelegate(delegate, context);
+
+ if (context.method === "throw") {
+ // If maybeInvokeDelegate(context) changed context.method from
+ // "return" to "throw", let that override the TypeError below.
+ return ContinueSentinel;
+ }
+ }
+
+ context.method = "throw";
+ context.arg = new TypeError(
+ "The iterator does not provide a 'throw' method");
+ }
+
+ return ContinueSentinel;
+ }
+
+ var record = tryCatch(method, delegate.iterator, context.arg);
+
+ if (record.type === "throw") {
+ context.method = "throw";
+ context.arg = record.arg;
+ context.delegate = null;
+ return ContinueSentinel;
+ }
+
+ var info = record.arg;
+
+ if (!info) {
+ context.method = "throw";
+ context.arg = new TypeError("iterator result is not an object");
+ context.delegate = null;
+ return ContinueSentinel;
+ }
+
+ if (info.done) {
+ // Assign the result of the finished delegate to the temporary
+ // variable specified by delegate.resultName (see delegateYield).
+ context[delegate.resultName] = info.value;
+
+ // Resume execution at the desired location (see delegateYield).
+ context.next = delegate.nextLoc;
+
+ // If context.method was "throw" but the delegate handled the
+ // exception, let the outer generator proceed normally. If
+ // context.method was "next", forget context.arg since it has been
+ // "consumed" by the delegate iterator. If context.method was
+ // "return", allow the original .return call to continue in the
+ // outer generator.
+ if (context.method !== "return") {
+ context.method = "next";
+ context.arg = undefined;
+ }
+
+ } else {
+ // Re-yield the result returned by the delegate method.
+ return info;
+ }
+
+ // The delegate iterator is finished, so forget it and continue with
+ // the outer generator.
+ context.delegate = null;
+ return ContinueSentinel;
+ }
+
+ // Define Generator.prototype.{next,throw,return} in terms of the
+ // unified ._invoke helper method.
+ defineIteratorMethods(Gp);
+
+ Gp[toStringTagSymbol] = "Generator";
+
+ // A Generator should always return itself as the iterator object when the
+ // @@iterator function is called on it. Some browsers' implementations of the
+ // iterator prototype chain incorrectly implement this, causing the Generator
+ // object to not be returned from this call. This ensures that doesn't happen.
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
+ Gp[iteratorSymbol] = function () {
+ return this;
+ };
+
+ Gp.toString = function () {
+ return "[object Generator]";
+ };
+
+ function pushTryEntry(locs) {
+ var entry = { tryLoc: locs[0] };
+
+ if (1 in locs) {
+ entry.catchLoc = locs[1];
+ }
+
+ if (2 in locs) {
+ entry.finallyLoc = locs[2];
+ entry.afterLoc = locs[3];
+ }
+
+ this.tryEntries.push(entry);
+ }
+
+ function resetTryEntry(entry) {
+ var record = entry.completion || {};
+ record.type = "normal";
+ delete record.arg;
+ entry.completion = record;
+ }
+
+ function Context(tryLocsList) {
+ // The root entry object (effectively a try statement without a catch
+ // or a finally block) gives us a place to store values thrown from
+ // locations where there is no enclosing try statement.
+ this.tryEntries = [{ tryLoc: "root" }];
+ tryLocsList.forEach(pushTryEntry, this);
+ this.reset(true);
+ }
+
+ runtime.keys = function (object) {
+ var keys = [];
+ for (var key in object) {
+ keys.push(key);
+ }
+ keys.reverse();
+
+ // Rather than returning an object with a next method, we keep
+ // things simple and return the next function itself.
+ return function next() {
+ while (keys.length) {
+ var key = keys.pop();
+ if (key in object) {
+ next.value = key;
+ next.done = false;
+ return next;
+ }
+ }
+
+ // To avoid creating an additional object, we just hang the .value
+ // and .done properties off the next function object itself. This
+ // also ensures that the minifier will not anonymize the function.
+ next.done = true;
+ return next;
+ };
+ };
+
+ function values(iterable) {
+ if (iterable) {
+ var iteratorMethod = iterable[iteratorSymbol];
+ if (iteratorMethod) {
+ return iteratorMethod.call(iterable);
+ }
+
+ if (typeof iterable.next === "function") {
+ return iterable;
+ }
+
+ if (!isNaN(iterable.length)) {
+ var i = -1, next = function next() {
+ while (++i < iterable.length) {
+ if (hasOwn.call(iterable, i)) {
+ next.value = iterable[i];
+ next.done = false;
+ return next;
+ }
+ }
+
+ next.value = undefined;
+ next.done = true;
+
+ return next;
+ };
+
+ return next.next = next;
+ }
+ }
+
+ // Return an iterator with no values.
+ return { next: doneResult };
+ }
+ runtime.values = values;
+
+ function doneResult() {
+ return { value: undefined, done: true };
+ }
+
+ Context.prototype = {
+ constructor: Context,
+
+ reset: function (skipTempReset) {
+ this.prev = 0;
+ this.next = 0;
+ // Resetting context._sent for legacy support of Babel's
+ // function.sent implementation.
+ this.sent = this._sent = undefined;
+ this.done = false;
+ this.delegate = null;
+
+ this.method = "next";
+ this.arg = undefined;
+
+ this.tryEntries.forEach(resetTryEntry);
+
+ if (!skipTempReset) {
+ for (var name in this) {
+ // Not sure about the optimal order of these conditions:
+ if (name.charAt(0) === "t" &&
+ hasOwn.call(this, name) &&
+ !isNaN(+name.slice(1))) {
+ this[name] = undefined;
+ }
+ }
+ }
+ },
+
+ stop: function () {
+ this.done = true;
+
+ var rootEntry = this.tryEntries[0];
+ var rootRecord = rootEntry.completion;
+ if (rootRecord.type === "throw") {
+ throw rootRecord.arg;
+ }
+
+ return this.rval;
+ },
+
+ dispatchException: function (exception) {
+ if (this.done) {
+ throw exception;
+ }
+
+ var context = this;
+ function handle(loc, caught) {
+ record.type = "throw";
+ record.arg = exception;
+ context.next = loc;
+
+ if (caught) {
+ // If the dispatched exception was caught by a catch block,
+ // then let that catch block handle the exception normally.
+ context.method = "next";
+ context.arg = undefined;
+ }
+
+ return !!caught;
+ }
+
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ var record = entry.completion;
+
+ if (entry.tryLoc === "root") {
+ // Exception thrown outside of any try block that could handle
+ // it, so set the completion value of the entire function to
+ // throw the exception.
+ return handle("end");
+ }
+
+ if (entry.tryLoc <= this.prev) {
+ var hasCatch = hasOwn.call(entry, "catchLoc");
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
+
+ if (hasCatch && hasFinally) {
+ if (this.prev < entry.catchLoc) {
+ return handle(entry.catchLoc, true);
+ } else if (this.prev < entry.finallyLoc) {
+ return handle(entry.finallyLoc);
+ }
+
+ } else if (hasCatch) {
+ if (this.prev < entry.catchLoc) {
+ return handle(entry.catchLoc, true);
+ }
+
+ } else if (hasFinally) {
+ if (this.prev < entry.finallyLoc) {
+ return handle(entry.finallyLoc);
+ }
+
+ } else {
+ throw new Error("try statement without catch or finally");
+ }
+ }
+ }
+ },
+
+ abrupt: function (type, arg) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.tryLoc <= this.prev &&
+ hasOwn.call(entry, "finallyLoc") &&
+ this.prev < entry.finallyLoc) {
+ var finallyEntry = entry;
+ break;
+ }
+ }
+
+ if (finallyEntry &&
+ (type === "break" ||
+ type === "continue") &&
+ finallyEntry.tryLoc <= arg &&
+ arg <= finallyEntry.finallyLoc) {
+ // Ignore the finally entry if control is not jumping to a
+ // location outside the try/catch block.
+ finallyEntry = null;
+ }
+
+ var record = finallyEntry ? finallyEntry.completion : {};
+ record.type = type;
+ record.arg = arg;
+
+ if (finallyEntry) {
+ this.method = "next";
+ this.next = finallyEntry.finallyLoc;
+ return ContinueSentinel;
+ }
+
+ return this.complete(record);
+ },
+
+ complete: function (record, afterLoc) {
+ if (record.type === "throw") {
+ throw record.arg;
+ }
+
+ if (record.type === "break" ||
+ record.type === "continue") {
+ this.next = record.arg;
+ } else if (record.type === "return") {
+ this.rval = this.arg = record.arg;
+ this.method = "return";
+ this.next = "end";
+ } else if (record.type === "normal" && afterLoc) {
+ this.next = afterLoc;
+ }
+
+ return ContinueSentinel;
+ },
+
+ finish: function (finallyLoc) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.finallyLoc === finallyLoc) {
+ this.complete(entry.completion, entry.afterLoc);
+ resetTryEntry(entry);
+ return ContinueSentinel;
+ }
+ }
+ },
+
+ "catch": function (tryLoc) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.tryLoc === tryLoc) {
+ var record = entry.completion;
+ if (record.type === "throw") {
+ var thrown = record.arg;
+ resetTryEntry(entry);
+ }
+ return thrown;
+ }
+ }
+
+ // The context.catch method must only be called with a location
+ // argument that corresponds to a known catch block.
+ throw new Error("illegal catch attempt");
+ },
+
+ delegateYield: function (iterable, resultName, nextLoc) {
+ this.delegate = {
+ iterator: values(iterable),
+ resultName: resultName,
+ nextLoc: nextLoc
+ };
+
+ if (this.method === "next") {
+ // Deliberately forget the last sent value so that we don't
+ // accidentally pass it on to the delegate.
+ this.arg = undefined;
+ }
+
+ return ContinueSentinel;
+ }
+ };
+})(
+ // In sloppy mode, unbound `this` refers to the global object, fallback to
+ // Function constructor if we're in global strict mode. That is sadly a form
+ // of indirect eval which violates Content Security Policy.
+ (function () { return this })() || Function("return this")()
+);
diff --git a/app.js b/app.js
index 4300824..0667b27 100644
--- a/app.js
+++ b/app.js
@@ -1,12 +1,19 @@
import Aegis from './TUIKit/lib/aegis';
+import TIM from './TUIKit/lib/tim-wx-sdk';
+import TIMUploadPlugin from './TUIKit/lib/tim-upload-plugin';
+import { API } from './utils/network/api'
+import constant from './TUIKit/utils/constant';
+const { GDXZ_CUSTOM_MSEEAGE } = constant;
+const api = new API()
App({
onLaunch: function (options) {
// 判断是否由分享进入小程序
- if (options.scene == 1007 || options.scene == 1008) {
+ if (options.scene != 1001) {
this.globalData.share = true
} else {
this.globalData.share = false
};
+ this.globalData.scene = options.scene
//获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
//这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
//页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
@@ -16,49 +23,390 @@ App({
this.globalData.height = res.statusBarHeight
}
})
-
+ wx.onCopyUrl(() => {
+ console.log("onCopyUrlonCopyUrlonCopyUrl")
+ setTimeout(()=>{
+ wx.setClipboardData({
+ data: '暂不支持分享',
+ success (res) {
+
+ },
+ complete(){
+ wx.hideToast()
+ }
+ })
+ },1000)
+ return
+ })
// console.log("download fonts from oss ");
- // let loadStatus = false;
- // if (!loadStatus) {
- // wx.loadFontFace({
- // global: true,
- // family: 'AlibabaPuHuiTi',
- // source: 'url("https://oss.igandan.com/app/fonts/AlibabaPuHuiTi/STXINGKA.TTF")',
- // // source: 'url("https://oss.igandan.com/app/fonts/AlibabaPuHuiTi/AlibabaPuHuiTi-2-65-Medium.ttf")',
- // success() {
- // loadStatus = true;
- // console.log("download fonts from oss success");
- // },
- // fail(){
- // console.log("download fonts from oss error");
- // },
- // complete(){
- // console.log("download fonts from oss complete");
- // }
- // });
- // }
- this.aegisInit()
+ let loadStatus = false;
+ if (!loadStatus) {
+ // wx.loadFontFace({
+ // global: true,
+ // family: 'AlibabaPuHuiTi',
+ // // source: 'url("https://oss.igandan.com/app/fonts/AlibabaPuHuiTi/STXINGKA.TTF")',
+ // source: 'url("https://docwebsite.oss-cn-beijing.aliyuncs.com/app/fonts/AlibabaPuHuiTi/AlibabaPuHuiTi-2-65-Medium/AlibabaPuHuiTi-2-65-Medium.ttf")',
+ // success() {
+ // loadStatus = true;
+ // console.log("download fonts from oss success");
+ // },
+ // fail(){
+ // console.log("download fonts from oss error");
+ // },
+ // complete(){
+ // console.log("download fonts from oss complete");
+ // }
+ // });
+ }
+ this.aegisInit()
console.warn("app.js wx.aegis: ", wx.aegis);
+
+ //监听网络状态变化事件
+ wx.onNetworkStatusChange(function (res) {
+ // console.log("onNetworkStatusChange: ")
+ // console.log(res.isConnected)
+ // console.log(res.networkType)
+ // wx.showToast({
+ // title: '网络类型'+res.networkType,
+ // })
+ })
+
+ wx.onNetworkWeakChange(function(res){
+ // console.log("onNetworkWeakChange: ")
+ // console.log(res.isConnected)
+ // console.log(res.networkType)
+ })
+ },
+ onShow(){
+ // this.imInit();
+ },
+ imInit(options={},type=1,callback=()=>{}){
+ console.log("imInit")
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ if(usertype != 2){//只登录医师端
+ return;
+ }
+
+ if(userID == ""){
+ return;
+ }
+ this.globalData.config.userID = userID;
+ // let sign = genTestUserSig(this.globalData.config);
+ // console.log("sign: ", sign);
+ // const userSig = sign.userSig;
+
+ if(!wx.$TUIKit){
+ //获取im签名数据
+ return api.getSignIM().then(response => {
+ let from = response.from
+ if(from != "cache"){
+ wx.setStorageSync(userID + '_imsign', {"sign":response.data,"date":new Date().getTime()})
+ }
+ return response.data;
+ }).then((userSig) => {
+ // console.log("userSig: ", userSig);
+ wx.$TUIKit = TIM.create({
+ SDKAppID: this.globalData.config.SDKAPPID
+ });
+
+ wx.$chat_userID = this.globalData.config.userID;
+ wx.$chat_SDKAppID = this.globalData.config.SDKAPPID;
+ wx.$chat_userSig = userSig;
+
+ wx.$TUIKitTIM = TIM;
+ console.log("TIM: ", wx.$TUIKitTIM)
+ wx.$TUIKit.registerPlugin({ 'tim-upload-plugin': TIMUploadPlugin });
+ let login_promise = wx.$TUIKit.login({
+ userID: this.globalData.config.userID,
+ userSig
+ });
+ let THIS=this;
+ login_promise.then(function(imResponse) {
+ // console.log(imResponse.data); // 登录成功
+ callback();
+ THIS.globalData.isLogin=true;
+ }).catch(function(imError) {
+ console.warn('login error:', imError); // 登录失败的相关信息
+ if(type==1 && imError.indexOf("重复登录")!=-1){
+ wx.showToast({
+ title: '登陆失败',
+ icon:"none"
+ })
+ };
+
+ });
+
+ //wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady);
+ wx.$TUIKit.setLogLevel(3);//设置日志级别
+ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady, this);
+ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalUnreadMessageCountUpdated);
+ }).catch(errors => {console.error(errors);})
+ }else{
+ let promise = new Promise((resolve, reject) => {
+ resolve("success");
+ }).then(res => {
+ // console.log("from app js:", res);
+ return "from app js";
+ });
+ return promise;
+ }
+ },
+ imLogout(){
+ if(wx.$TUIKit){
+ wx.$TUIKit.logout();
+ wx.$TUIKit = undefined;
+ }
+ this.clearAllInterval();
+ this.globalData.chat_sdk_ready = false;
+ },
+ clearAllInterval(){
+ this.globalData.app_inter.forEach(item => {
+ clearInterval(item)
+ })
+ },
+ onTotalUnreadMessageCountUpdated(){
+ // console.log("onTotalUnreadMessageCountUpdated");
+ let totalUnreadCount = wx.$TUIKit.getTotalUnreadMessageCount();
+ // console.log("未读消息数量:", totalUnreadCount)
+ },
+ onSDKReady(){
+ console.log("onSDKReady from app.js");
+ this.globalData.chat_sdk_ready = true;
+
+ // let promise = wx.$TUIKit.deleteConversation('C2C500318318078251008');
+ // promise.then(function(imResponse) {
+ // // 删除会话成功
+ // const { conversationID } = imResponse.data; // 被删除的会话 ID
+ // }).catch(function(imError) {
+ // console.warn('deleteConversation error:', imError); // 删除会话失败的相关信息
+ // });
+
+ // console.log("TIM.version: ", wx.$TUIKitTIM)
+ // console.log("wx.$TUIKit: ",wx.$TUIKit.deleteConversation)
+ // // 删除单一会话, 不清空会话历史消息
+ // let promise = wx.$TUIKit.deleteConversation({conversationIDList:["C2C492404831991414785"], clearHistoryMessage: false});
+ // promise.then(function(imResponse) {
+ // // 删除会话成功
+ // console.log("删除成功!!")
+ // const { conversationIDList } = imResponse.data; // 被删除的会话 ID 列表
+ // }).catch(function(imError) {
+ // console.warn('deleteConversation error:', imError); // 删除会话失败的相关信息
+ // });
+
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ //初始化tab-bar角标
+ let index_info = wx.getStorageSync(userID+'_index_info');
+ let my_info = wx.getStorageSync(userID+'_my_info');
+ if(!index_info) wx.setStorageSync(userID+'_index_info',"");
+ if(!my_info) wx.setStorageSync(userID+'_my_info', "");
+ this.formatWenZhenInfo();
+ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onSystemPushReceived, this);
+ //互踢
+ console.log("互踢");
+ wx.$TUIKit.on(wx.$TUIKitTIM.EVENT.KICKED_OUT, this.onKickedOut,this);
+ },
+ onUnload(){
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.SDK_READY, this.onSDKReady);
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onSystemPushReceived);
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED, this.onTotalUnreadMessageCountUpdated);
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.KICKED_OUT,this.$onKickedOut);
+ },
+ onKickedOut(){
+ // console.log("onKickedOutonKickedOutonKickedOutonKickedOut");
+ let usertype = wx.getStorageSync('usertype');
+ wx.setStorageSync('AUTH_TOKEN_'+usertype, "");
+ wx.setStorageSync('user_id_'+usertype, "");
+ wx.setStorageSync('client_user_id_'+usertype, "");
+ if(wx.$TUIKit){
+ wx.$TUIKit.off(wx.$TUIKitTIM.EVENT.MESSAGE_RECEIVED, this.$onSystemPushReceived);
+ wx.$TUIKit = undefined
+ }
+ this.globalData.chat_sdk_ready = false
+ this.globalData.isLogin=false;
+ this.go("/Pages/kickedout/index");
+ },
+ $onSystemPushReceived(e){
+ // console.log("onSystemPushReceived from app.js");
+ // console.log(e)
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let message = e.data[0];
+ // console.log(message)
+
+ let type = message.type;
+ // console.log(type);
+ let unread_name = "";
+ if(type == TIM.TYPES.MSG_CUSTOM){
+ let payload = message.payload;
+ let payloadData = payload.data;
+ let payloadDataJson = JSON.parse(payloadData);
+ let message_type = payloadDataJson.message_type;
+ // console.log("message_type: ", message_type);
+ switch (message_type) {
+ case GDXZ_CUSTOM_MSEEAGE.TRABECULA:
+ unread_name = userID+"_wenzhen_info"; //1、消息内页横条
+ break;
+ case GDXZ_CUSTOM_MSEEAGE.ORDER_EVALUATION:
+ unread_name = userID+"_wenzhen_info"; //2、订单结束评价弹出
+ break;
+ case GDXZ_CUSTOM_MSEEAGE.DOCTOR_SYSTEM_NOTIFICATION:
+ unread_name = userID+"_system_notice_unreadnnum"; //3、医生端系统通知
+ break;
+ case GDXZ_CUSTOM_MSEEAGE.DOCTOR_SERVICE_NOTIFICATION:
+ unread_name = userID+"_service_notice_unreadnnum"; //4、医生端服务通知
+ break;
+ case GDXZ_CUSTOM_MSEEAGE.PRESCRIBE:
+ unread_name = userID+"_wenzhen_info"; //6、处方开具成功
+ break;
+ default:
+ break;
+ }
+
+ }else{
+ unread_name = userID+"_wenzhen_info";//tabbar 问诊角标
+ }
+ this.formatUnReadNum(unread_name);
+ },
+ formatUnReadNum(name, increment=1){
+ let val = wx.getStorageSync(name);
+ if(val == "") val = 0;
+ if(increment > 0){
+ val = val + increment;
+ }else{
+ val = increment;
+ }
+ if(val == "+99") val = 100;
+ if(val > 99) val = '+99';
+ if(val == 0) val = '';
+ wx.setStorageSync(name, val);
},
aegisInit() {
wx.aegis = new Aegis({
id: 'iHWefAYquFxvklBblC', // 项目key
- reportApiSpeed: true, // 接口测速
- reportAssetSpeed: true, // 静态资源测速
- pagePerformance: true, // 开启页面测速
+ reportApiSpeed: false, // 接口测速
+ reportAssetSpeed: false, // 静态资源测速
+ pagePerformance: false, // 开启页面测速
});
},
globalData: {
share: false, // 分享默认为false
height: 0,
+ scene: "",//场景值
login_url: "/Pages/login/index",
- chat_sdk_ready: false
+ chat_sdk_ready: false,
+ jiesuan_dialog_show: false,
+ config: {
+ userID: "",
+ SDKAPPID: api.getIMappId(), // Your SDKAppID
+ SECRETKEY: api.getIMsecretkey(), // Your secretKey
+ EXPIRETIME: 604800,
+ },
+ app_inter: []
},
go(url, ...params){
wx.navigateTo({
url: url
})
- }
-
+ },
+ formatWenZhenInfo(){
+ this.getConversationList();
+ },
+ onHide(){
+ if(!this.globalData.isLogin){
+ wx.setStorageSync('usertype','');
+ }
+ },
+ getConversationList(){
+ wx.$TUIKit.getConversationList().then((imResponse) => {
+ // console.log("getConversationList from app js: ", imResponse.data.conversationList);
+ return imResponse.data.conversationList;
+ }).then(conversationList => {
+ // console.log("开始查询订单状态")
+ this.formatStatus(conversationList);
+ }).catch(error => {
+ console.error(error)
+ });
+ },
+ formatStatus(conversationList){
+ let order_inquiry_id_list = [];
+ order_inquiry_id_list.push("");//初始化一个,防止失败
+ conversationList.forEach(item => {
+ let conversationID = item.conversationID;
+ if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson;
+ try {
+ cloudCustomDataJson = JSON.parse(cloudCustomData);
+ } catch (error) {
+ console.error(error);
+ return;
+ }
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ order_inquiry_id_list.push(order_inquiry_id);//准备去请求后端那订单状态
+ })
+ //获取医生问诊消息用户属性
+ api.getDoctorInquiryMessageAttr({order_inquiry_ids: order_inquiry_id_list.join(",")}).then(response => {
+ let new_conversationList = [];
+ if(response.data.length > 0){
+ conversationList.forEach(item => {
+ let conversationID = item.conversationID;
+ if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
+ let lastMessage = item.lastMessage;
+ if(!lastMessage) return;
+ let cloudCustomData = lastMessage.cloudCustomData;
+ if(!cloudCustomData) return;
+ let cloudCustomDataJson;
+ try {
+ cloudCustomDataJson = JSON.parse(item.lastMessage.cloudCustomData);
+ } catch (error) {
+ return;
+ }
+ let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
+ let order = response.data.find(attr_item => {
+ return attr_item.order_inquiry_id == order_inquiry_id;
+ })
+ if(!order) return;
+
+ let inquiry_status = order.inquiry_status;
+ //inquiry_status 状态
+ if(inquiry_status !=3 && inquiry_status != 4){
+ return;
+ }
+ item.order_inquiry_id = order_inquiry_id;
+ item.inquiry_status = inquiry_status;
+ item.patient_age = order.patient_age;
+ item.patient_name = order.patient_name;
+ item.patient_sex = order.patient_sex;
+ new_conversationList.push(item);
+ })
+ conversationList = [];
+ }
+ return new_conversationList;
+ }).then(new_conversationList => {
+ // console.log("开始计算问诊角标");
+ let wenzhen_info = 0;
+ new_conversationList.forEach(item => {
+ let unreadCount = item.unreadCount;
+ if(unreadCount > 0){
+ wenzhen_info = wenzhen_info + unreadCount;
+ }else{//若为0,则继续判断订单状态
+ let inquiry_status = item.inquiry_status;
+ if(inquiry_status == 3){//若为待接诊,则+1
+ wenzhen_info = wenzhen_info + 1;
+ }
+ }
+ })
+ // console.log("角标的数量:", wenzhen_info);
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ wx.setStorageSync(userID+'_wenzhen_info', wenzhen_info);
+
+ }).catch(errors => {console.error(errors);})
+ },
})
\ No newline at end of file
diff --git a/app.json b/app.json
index 86cc64f..b0c5fe1 100644
--- a/app.json
+++ b/app.json
@@ -48,7 +48,22 @@
"Pages/login/index",
"Pages/mobile_login/index",
"Pages/yishi/manual_detail/index",
- "Pages/yishi/addzhenduan/index"
+ "Pages/yishi/agreement_detail/index",
+ "Pages/yishi/addzhenduan/index",
+ "Pages/yishi/wenzhen_v2/wenzhen",
+ "Pages/webpage/index",
+ "Pages/kickedout/index",
+ "Pages/yishi/onlinesetupprice/index",
+ "Pages/yishi/yizhensetupprice/index",
+ "Pages/yishi/wenzhenorderV2/index",
+ "Pages/yishi/wenzhen_v3/wenzhen",
+ "Pages/agreement_page/index",
+ "Pages/yishi/medince_list/index",
+ "Pages/yishi/linkPage/linkPage",
+ "Pages/yishi/notify/notify",
+ "Pages/yishi/patient_sick/index",
+ "Pages/yishi/write_sickform/index",
+ "Pages/yishi/sickform/index"
],
"window": {
"navigationBarBackgroundColor": "#ffffff",
@@ -76,23 +91,24 @@
},
{
"pagePath": "Pages/yishi/index/index",
- "text": "首页(Y)",
+ "text": "首页",
"iconPath": "/static/images/yishi/tabbar_icon/index.png",
"selectedIconPath": "/static/images/yishi/tabbar_icon/index_select.png"
},
{
- "pagePath": "Pages/yishi/wenzhen/wenzhen",
- "text": "问诊(Y)",
+ "pagePath": "Pages/yishi/wenzhen_v2/wenzhen",
+ "text": "问诊",
"iconPath": "/static/images/yishi/tabbar_icon/wenzhen.png",
"selectedIconPath": "/static/images/yishi/tabbar_icon/wenzhen_select.png"
},
{
"pagePath": "Pages/yishi/my/index",
- "text": "我的(Y)",
+ "text": "我的",
"iconPath": "/static/images/yishi/tabbar_icon/my.png",
"selectedIconPath": "/static/images/yishi/tabbar_icon/my_select.png"
}
]
},
+ "__usePrivacyCheck__": true,
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
diff --git a/app.wxss b/app.wxss
index 25ecd8f..12c22d3 100644
--- a/app.wxss
+++ b/app.wxss
@@ -1,5 +1,5 @@
/**app.wxss**/
-@font-face{
+/* @font-face{
font-family:AlibabaPuHuiTi-2-55-Regular;
src:url('https://oss.igandan.com/app/fonts/AlibabaPuHuiTi/AlibabaPuHuiTi-2-55-Regular/AlibabaPuHuiTi-2-55-Regular.ttf')format('TrueType');
font-display:swap;
@@ -16,4 +16,4 @@
}
page{
font-family:AlibabaPuHuiTi-2-65-Medium;
-}
+} */
diff --git a/commpents/appraise_data/index.wxml b/commpents/appraise_data/index.wxml
index 2352ca0..15c7d67 100644
--- a/commpents/appraise_data/index.wxml
+++ b/commpents/appraise_data/index.wxml
@@ -2,7 +2,7 @@
{{name}}
-
+
{{content}}
diff --git a/commpents/appraise_data/index.wxss b/commpents/appraise_data/index.wxss
index 4fc902e..e44cd25 100644
--- a/commpents/appraise_data/index.wxss
+++ b/commpents/appraise_data/index.wxss
@@ -2,7 +2,11 @@
display: flex;
padding: 20rpx;
flex-direction: column;
+ background-color: aqua;
+}
+.item:not(:last-child){
border-bottom: 1px solid #E7E7E7;
+ background-color: brown;
}
.top{
display: flex;
diff --git a/commpents/image-cropper/image-cropper.js b/commpents/image-cropper/image-cropper.js
new file mode 100644
index 0000000..d2728ce
--- /dev/null
+++ b/commpents/image-cropper/image-cropper.js
@@ -0,0 +1,1143 @@
+Component({
+ properties: {
+ /**
+ * 图片路径
+ */
+ 'imgSrc': {
+ type: String
+ },
+ /**
+ * 裁剪框高度
+ */
+ 'height': {
+ type: Number,
+ value: 200
+ },
+ /**
+ * 裁剪框宽度
+ */
+ 'width': {
+ type: Number,
+ value: 200
+ },
+ /**
+ * 裁剪框最小尺寸
+ */
+ 'min_width': {
+ type: Number,
+ value: 100
+ },
+ 'min_height': {
+ type: Number,
+ value: 100
+ },
+ /**
+ * 裁剪框最大尺寸
+ */
+ 'max_width': {
+ type: Number,
+ value: 300
+ },
+ 'max_height': {
+ type: Number,
+ value: 300
+ },
+ /**
+ * 裁剪框禁止拖动
+ */
+ 'disable_width': {
+ type: Boolean,
+ value: false
+ },
+ 'disable_height': {
+ type: Boolean,
+ value: false
+ },
+ /**
+ * 锁定裁剪框比例
+ */
+ 'disable_ratio':{
+ type: Boolean,
+ value: false
+ },
+ /**
+ * 生成的图片尺寸相对剪裁框的比例
+ */
+ 'export_scale': {
+ type: Number,
+ value: 3
+ },
+ /**
+ * 生成的图片质量0-1
+ */
+ 'quality': {
+ type: Number,
+ value: 1
+ },
+ 'cut_top': {
+ type: Number,
+ value: null
+ },
+ 'cut_left': {
+ type: Number,
+ value: null
+ },
+ /**
+ * canvas上边距(不设置默认不显示)
+ */
+ 'canvas_top': {
+ type: Number,
+ value: null
+ },
+ /**
+ * canvas左边距(不设置默认不显示)
+ */
+ 'canvas_left': {
+ type: Number,
+ value: null
+ },
+ /**
+ * 图片宽度
+ */
+ 'img_width': {
+ type: null,
+ value: null
+ },
+ /**
+ * 图片高度
+ */
+ 'img_height': {
+ type: null,
+ value: null
+ },
+ /**
+ * 图片缩放比
+ */
+ 'scale': {
+ type: Number,
+ value: 1
+ },
+ /**
+ * 图片旋转角度
+ */
+ 'angle': {
+ type: Number,
+ value: 0
+ },
+ /**
+ * 最小缩放比
+ */
+ 'min_scale': {
+ type: Number,
+ value: 0.5
+ },
+ /**
+ * 最大缩放比
+ */
+ 'max_scale': {
+ type: Number,
+ value: 2
+ },
+ /**
+ * 是否禁用旋转
+ */
+ 'disable_rotate': {
+ type: Boolean,
+ value: false
+ },
+ /**
+ * 是否限制移动范围(剪裁框只能在图片内)
+ */
+ 'limit_move':{
+ type: Boolean,
+ value: false
+ },
+ show_cropper: {
+ type: Boolean,
+ value: false,
+ observer(newVal) {
+ this.setData({
+ show_cropper: newVal
+ })
+ },
+ }
+ },
+ data: {
+ el: 'image-cropper', //暂时无用
+ show_cropper: false,
+ info: wx.getSystemInfoSync(),
+ MOVE_THROTTLE:null,//触摸移动节流settimeout
+ MOVE_THROTTLE_FLAG: true,//节流标识
+ INIT_IMGWIDTH: 0, //图片设置尺寸,此值不变(记录最初设定的尺寸)
+ INIT_IMGHEIGHT: 0, //图片设置尺寸,此值不变(记录最初设定的尺寸)
+ TIME_BG: null,//背景变暗延时函数
+ TIME_CUT_CENTER:null,
+ _touch_img_relative: [{
+ x: 0,
+ y: 0
+ }], //鼠标和图片中心的相对位置
+ _flag_cut_touch:false,//是否是拖动裁剪框
+ _hypotenuse_length: 0, //双指触摸时斜边长度
+ _flag_img_endtouch: false, //是否结束触摸
+ _flag_bright: true, //背景是否亮
+ _canvas_overflow:true,//canvas缩略图是否在屏幕外面
+ _canvas_width:200,
+ _canvas_height:200,
+ origin_x: 0.5, //图片旋转中心
+ origin_y: 0.5, //图片旋转中心
+ _cut_animation: false,//是否开启图片和裁剪框过渡
+ _img_top: wx.getSystemInfoSync().windowHeight / 2, //图片上边距
+ _img_left: wx.getSystemInfoSync().windowWidth / 2, //图片左边距
+ watch: {
+ //监听截取框宽高变化
+ width(value, that) {
+ if (value < that.data.min_width){
+ that.setData({
+ width: that.data.min_width
+ });
+ }
+ that._computeCutSize();
+ },
+ height(value, that) {
+ if (value < that.data.min_height) {
+ that.setData({
+ height: that.data.min_height
+ });
+ }
+ that._computeCutSize();
+ },
+ angle(value, that){
+ //停止居中裁剪框,继续修改图片位置
+ that._moveStop();
+ if(that.data.limit_move){
+ if (that.data.angle % 90) {
+ that.setData({
+ angle: Math.round(that.data.angle / 90) * 90
+ });
+ return;
+ }
+ }
+ },
+ _cut_animation(value, that){
+ //开启过渡300毫秒之后自动关闭
+ clearTimeout(that.data._cut_animation_time);
+ if (value){
+ that.data._cut_animation_time = setTimeout(()=>{
+ that.setData({
+ _cut_animation:false
+ });
+ },300)
+ }
+ },
+ limit_move(value, that){
+ if (value) {
+ if (that.data.angle%90){
+ that.setData({
+ angle: Math.round(that.data.angle / 90)*90
+ });
+ }
+ that._imgMarginDetectionScale();
+ !that.data._canvas_overflow && that._draw();
+ }
+ },
+ canvas_top(value, that){
+ that._canvasDetectionPosition();
+ },
+ canvas_left(value, that){
+ that._canvasDetectionPosition();
+ },
+ imgSrc(value, that){
+ // that.pushImg();
+ },
+ cut_top(value, that) {
+ that._cutDetectionPosition();
+ if (that.data.limit_move) {
+ !that.data._canvas_overflow && that._draw();
+ }
+ },
+ cut_left(value, that) {
+ that._cutDetectionPosition();
+ if (that.data.limit_move) {
+ !that.data._canvas_overflow && that._draw();
+ }
+ }
+ }
+ },
+ options: {
+ styleIsolation: 'isolated'
+ },
+ attached() {
+ this.data.info = wx.getSystemInfoSync();
+ //启用数据监听
+ this._watcher();
+ this.data.INIT_IMGWIDTH = this.data.img_width;
+ this.data.INIT_IMGHEIGHT = this.data.img_height;
+ this.setData({
+ _canvas_height: this.data.height,
+ _canvas_width: this.data.width,
+ });
+ this._initCanvas();
+ this.data.imgSrc && (this.data.imgSrc = this.data.imgSrc);
+ //根据开发者设置的图片目标尺寸计算实际尺寸
+ this._initImageSize();
+ //设置裁剪框大小>设置图片尺寸>绘制canvas
+ this._computeCutSize();
+ //检查裁剪框是否在范围内
+ this._cutDetectionPosition();
+ //检查canvas是否在范围内
+ this._canvasDetectionPosition();
+ //初始化完成
+ this.triggerEvent('load', {
+ cropper: this
+ });
+ },
+ methods: {
+ /**
+ * 上传图片
+ */
+ upload() {
+ let that = this;
+ wx.chooseImage({
+ count: 1,
+ sizeType: ['original', 'compressed'],
+ sourceType: ['album', 'camera'],
+ success(res) {
+ const tempFilePaths = res.tempFilePaths[0];
+ that.pushImg(tempFilePaths);
+ wx.showLoading({
+ title: '加载中...'
+ })
+ }
+ })
+ },
+ /**
+ * 返回图片信息
+ */
+ getImg(getCallback) {
+ this._draw(()=>{
+ wx.canvasToTempFilePath({
+ width: this.data.width * this.data.export_scale,
+ height: Math.round(this.data.height * this.data.export_scale),
+ destWidth: this.data.width * this.data.export_scale,
+ destHeight: Math.round(this.data.height) * this.data.export_scale,
+ fileType: 'png',
+ quality: this.data.quality,
+ canvasId: this.data.el,
+ success: (res) => {
+ getCallback({
+ url: res.tempFilePath,
+ width: this.data.width * this.data.export_scale,
+ height: this.data.height * this.data.export_scale
+ });
+ }
+ }, this)
+ });
+ },
+ /**
+ * 设置图片动画
+ * {
+ * x:10,//图片在原有基础上向下移动10px
+ * y:10,//图片在原有基础上向右移动10px
+ * angle:10,//图片在原有基础上旋转10deg
+ * scale:0.5,//图片在原有基础上增加0.5倍
+ * }
+ */
+ setTransform(transform) {
+ if (!transform) return;
+ if (!this.data.disable_rotate){
+ this.setData({
+ angle: transform.angle ? this.data.angle + transform.angle : this.data.angle
+ });
+ }
+ var scale = this.data.scale;
+ if (transform.scale) {
+ scale = this.data.scale + transform.scale;
+ scale = scale <= this.data.min_scale ? this.data.min_scale : scale;
+ scale = scale >= this.data.max_scale ? this.data.max_scale : scale;
+ }
+ this.data.scale = scale;
+ let cutX = this.data.cut_left;
+ let cutY = this.data.cut_top;
+ if (transform.cutX){
+ this.setData({
+ cut_left: cutX + transform.cutX
+ });
+ this.data.watch.cut_left(null, this);
+ }
+ if (transform.cutY){
+ this.setData({
+ cut_top: cutY + transform.cutY
+ });
+ this.data.watch.cut_top(null, this);
+ }
+ this.data._img_top = transform.y ? this.data._img_top + transform.y : this.data._img_top;
+ this.data._img_left = transform.x ? this.data._img_left + transform.x : this.data._img_left;
+ //图像边缘检测,防止截取到空白
+ this._imgMarginDetectionScale();
+ //停止居中裁剪框,继续修改图片位置
+ this._moveDuring();
+ this.setData({
+ scale: this.data.scale,
+ _img_top: this.data._img_top,
+ _img_left: this.data._img_left
+ });
+ !this.data._canvas_overflow && this._draw();
+ //可以居中裁剪框了
+ this._moveStop();//结束操作
+ },
+ /**
+ * 设置剪裁框位置
+ */
+ setCutXY(x,y){
+ this.setData({
+ cut_top: y,
+ cut_left:x
+ });
+ },
+ /**
+ * 设置剪裁框尺寸
+ */
+ setCutSize(w,h){
+ this.setData({
+ width: w,
+ height:h
+ });
+ this._computeCutSize();
+ },
+ /**
+ * 设置剪裁框和图片居中
+ */
+ setCutCenter() {
+ let cut_top = (this.data.info.windowHeight - this.data.height) * 0.5;
+ let cut_left = (this.data.info.windowWidth - this.data.width) * 0.5;
+ console.log(cut_top, "-" ,cut_left )
+ //顺序不能变
+ this.setData({
+ _img_top: this.data._img_top - this.data.cut_top + cut_top,
+ cut_top: cut_top, //截取的框上边距
+ _img_left: this.data._img_left - this.data.cut_left + cut_left,
+ cut_left: cut_left, //截取的框左边距
+ });
+ },
+ _setCutCenter(){
+ let cut_top = (this.data.info.windowHeight - this.data.height) * 0.5;
+ let cut_left = (this.data.info.windowWidth - this.data.width) * 0.5;
+ console.log(cut_top, "-" ,cut_left )
+ this.setData({
+ cut_top: cut_top, //截取的框上边距
+ cut_left: cut_left, //截取的框左边距
+ });
+ },
+ /**
+ * 设置剪裁框宽度-即将废弃
+ */
+ setWidth(width) {
+ this.setData({
+ width: width
+ });
+ this._computeCutSize();
+ },
+ /**
+ * 设置剪裁框高度-即将废弃
+ */
+ setHeight(height) {
+ this.setData({
+ height: height
+ });
+ this._computeCutSize();
+ },
+ /**
+ * 是否锁定旋转
+ */
+ setDisableRotate(value){
+ this.data.disable_rotate = value;
+ },
+ /**
+ * 是否限制移动
+ */
+ setLimitMove(value){
+ this.setData({
+ _cut_animation: true,
+ limit_move: !!value
+ });
+ },
+ /**
+ * 初始化图片,包括位置、大小、旋转角度
+ */
+ imgReset() {
+ this.setData({
+ scale: 1,
+ angle: 0,
+ _img_top: wx.getSystemInfoSync().windowHeight / 2,
+ _img_left: wx.getSystemInfoSync().windowWidth / 2,
+ })
+ this.pushImg()
+ // console.log(wx.getSystemInfoSync().windowHeight / 2, "-", wx.getSystemInfoSync().windowWidth / 2,)
+ },
+ /**
+ * 加载(更换)图片
+ */
+ pushImg(src) {
+ if (src) {
+ this.setData({
+ imgSrc: src
+ });
+ //发现是手动赋值直接返回,交给watch处理
+ return;
+ }
+
+ // getImageInfo接口传入 src: '' 会导致内存泄漏
+
+ if (!this.data.imgSrc) return;
+ wx.getImageInfo({
+ src: this.data.imgSrc,
+ success: (res) => {
+ this.data.imageObject = res;
+ //图片非本地路径需要换成本地路径
+ if (this.data.imgSrc.search(/tmp/) == -1){
+ this.setData({
+ imgSrc: res.path
+ });
+ }
+ //计算最后图片尺寸
+ this._imgComputeSize();
+ if (this.data.limit_move) {
+ //限制移动,不留空白处理
+ this._imgMarginDetectionScale();
+ }
+ this._draw();
+ },
+ fail: (err) => {
+ this.setData({
+ imgSrc: ''
+ });
+ }
+ });
+ },
+ imageLoad(e){
+ setTimeout(()=>{
+ this.triggerEvent('imageload', this.data.imageObject);
+
+ },1000)
+ },
+ /**
+ * 设置图片放大缩小
+ */
+ setScale(scale) {
+ if (!scale) return;
+ this.setData({
+ scale: scale
+ });
+ !this.data._canvas_overflow && this._draw();
+ },
+ /**
+ * 设置图片旋转角度
+ */
+ setAngle(angle) {
+ if (!angle) return;
+ this.setData({
+ _cut_animation: true,
+ angle: angle
+ });
+ this._imgMarginDetectionScale();
+ !this.data._canvas_overflow && this._draw();
+ },
+ _initCanvas() {
+ //初始化canvas
+ if (!this.data.ctx){
+ this.data.ctx = wx.createCanvasContext("image-cropper", this);
+ }
+ },
+ /**
+ * 根据开发者设置的图片目标尺寸计算实际尺寸
+ */
+ _initImageSize(){
+ //处理宽高特殊单位 %>px
+ if (this.data.INIT_IMGWIDTH && typeof this.data.INIT_IMGWIDTH == "string" && this.data.INIT_IMGWIDTH.indexOf("%") != -1) {
+ let width = this.data.INIT_IMGWIDTH.replace("%", "");
+ this.data.INIT_IMGWIDTH = this.data.img_width = this.data.info.windowWidth / 100 * width;
+ }
+ if (this.data.INIT_IMGHEIGHT && typeof this.data.INIT_IMGHEIGHT == "string" && this.data.INIT_IMGHEIGHT.indexOf("%") != -1) {
+ let height = this.data.img_height.replace("%", "");
+ this.data.INIT_IMGHEIGHT = this.data.img_height = this.data.info.windowHeight / 100 * height;
+ }
+ },
+ /**
+ * 检测剪裁框位置是否在允许的范围内(屏幕内)
+ */
+ _cutDetectionPosition(){
+ let _cutDetectionPositionTop = () => {
+ //检测上边距是否在范围内
+ if (this.data.cut_top < 0) {
+ this.setData({
+ cut_top: 0
+ });
+ }
+ if (this.data.cut_top > this.data.info.windowHeight - this.data.height) {
+ this.setData({
+ cut_top: this.data.info.windowHeight - this.data.height
+ });
+ }
+ }, _cutDetectionPositionLeft = () => {
+ //检测左边距是否在范围内
+ if (this.data.cut_left < 0) {
+ this.setData({
+ cut_left: 0
+ });
+ }
+ if (this.data.cut_left > this.data.info.windowWidth - this.data.width) {
+ this.setData({
+ cut_left: this.data.info.windowWidth - this.data.width
+ });
+ }
+ };
+ //裁剪框坐标处理(如果只写一个参数则另一个默认为0,都不写默认居中)
+ if (this.data.cut_top == null && this.data.cut_left == null) {
+ this._setCutCenter();
+ } else if (this.data.cut_top != null && this.data.cut_left != null){
+ _cutDetectionPositionTop();
+ _cutDetectionPositionLeft();
+ } else if (this.data.cut_top != null && this.data.cut_left == null) {
+ _cutDetectionPositionTop();
+ this.setData({
+ cut_left: (this.data.info.windowWidth - this.data.width) / 2
+ });
+ } else if (this.data.cut_top == null && this.data.cut_left != null) {
+ _cutDetectionPositionLeft();
+ this.setData({
+ cut_top: (this.data.info.windowHeight - this.data.height) / 2
+ });
+ }
+ },
+ /**
+ * 检测canvas位置是否在允许的范围内(屏幕内)如果在屏幕外则不开启实时渲染
+ * 如果只写一个参数则另一个默认为0,都不写默认超出屏幕外
+ */
+ _canvasDetectionPosition(){
+ if(this.data.canvas_top == null && this.data.canvas_left == null) {
+ this.data._canvas_overflow = false;
+ this.setData({
+ canvas_top: -5000,
+ canvas_left: -5000
+ });
+ }else if(this.data.canvas_top != null && this.data.canvas_left != null) {
+ if (this.data.canvas_top < - this.data.height || this.data.canvas_top > this.data.info.windowHeight) {
+ this.data._canvas_overflow = true;
+ } else {
+ this.data._canvas_overflow = false;
+ }
+ }else if(this.data.canvas_top != null && this.data.canvas_left == null) {
+ this.setData({
+ canvas_left: 0
+ });
+ } else if (this.data.canvas_top == null && this.data.canvas_left != null) {
+ this.setData({
+ canvas_top: 0
+ });
+ if (this.data.canvas_left < -this.data.width || this.data.canvas_left > this.data.info.windowWidth) {
+ this.data._canvas_overflow = true;
+ } else {
+ this.data._canvas_overflow = false;
+ }
+ }
+ },
+ /**
+ * 图片边缘检测-位置
+ */
+ _imgMarginDetectionPosition(scale) {
+ if (!this.data.limit_move) return;
+ let left = this.data._img_left;
+ let top = this.data._img_top;
+ var scale = scale || this.data.scale;
+ let img_width = this.data.img_width;
+ let img_height = this.data.img_height;
+ if (this.data.angle / 90 % 2) {
+ img_width = this.data.img_height;
+ img_height = this.data.img_width;
+ }
+ left = this.data.cut_left + img_width * scale / 2 >= left ? left : this.data.cut_left + img_width * scale / 2;
+ left = this.data.cut_left + this.data.width - img_width * scale / 2 <= left ? left : this.data.cut_left + this.data.width - img_width * scale / 2;
+ top = this.data.cut_top + img_height * scale / 2 >= top ? top : this.data.cut_top + img_height * scale / 2;
+ top = this.data.cut_top + this.data.height - img_height * scale / 2 <= top ? top : this.data.cut_top + this.data.height - img_height * scale / 2;
+ this.setData({
+ _img_left: left,
+ _img_top: top,
+ scale: scale
+ })
+ },
+ /**
+ * 图片边缘检测-缩放
+ */
+ _imgMarginDetectionScale(){
+ if (!this.data.limit_move)return;
+ let scale = this.data.scale;
+ let img_width = this.data.img_width;
+ let img_height = this.data.img_height;
+ if (this.data.angle / 90 % 2) {
+ img_width = this.data.img_height;
+ img_height = this.data.img_width;
+ }
+ if (img_width * scale < this.data.width){
+ scale = this.data.width / img_width;
+ }
+ if (img_height * scale < this.data.height) {
+ scale = Math.max(scale,this.data.height / img_height);
+ }
+ this._imgMarginDetectionPosition(scale);
+ },
+ _setData(obj) {
+ let data = {};
+ for (var key in obj) {
+ if (this.data[key] != obj[key]){
+ data[key] = obj[key];
+ }
+ }
+ this.setData(data);
+ return data;
+ },
+ /**
+ * 计算图片尺寸
+ */
+ _imgComputeSize() {
+ let img_width = this.data.img_width,
+ img_height = this.data.img_height;
+ if (!this.data.INIT_IMGHEIGHT && !this.data.INIT_IMGWIDTH) {
+ //默认按图片最小边 = 对应裁剪框尺寸
+ img_width = this.data.imageObject.width;
+ img_height = this.data.imageObject.height;
+ if (img_width / img_height > this.data.width / this.data.height){
+ img_height = this.data.height;
+ img_width = this.data.imageObject.width / this.data.imageObject.height * img_height;
+ }else{
+ img_width = this.data.width;
+ img_height = this.data.imageObject.height / this.data.imageObject.width * img_width;
+ }
+ } else if (this.data.INIT_IMGHEIGHT && !this.data.INIT_IMGWIDTH) {
+ img_width = this.data.imageObject.width / this.data.imageObject.height * this.data.INIT_IMGHEIGHT;
+ } else if (!this.data.INIT_IMGHEIGHT && this.data.INIT_IMGWIDTH) {
+ img_height = this.data.imageObject.height / this.data.imageObject.width * this.data.INIT_IMGWIDTH;
+ }
+ this.setData({
+ img_width: img_width,
+ img_height: img_height
+ });
+ },
+ //改变截取框大小
+ _computeCutSize() {
+ if (this.data.width > this.data.info.windowWidth) {
+ this.setData({
+ width: this.data.info.windowWidth,
+ });
+ } else if (this.data.width + this.data.cut_left > this.data.info.windowWidth){
+ this.setData({
+ cut_left: this.data.info.windowWidth - this.data.cut_left,
+ });
+ };
+ if (this.data.height > this.data.info.windowHeight) {
+ this.setData({
+ height: this.data.info.windowHeight,
+ });
+ } else if (this.data.height + this.data.cut_top > this.data.info.windowHeight){
+ this.setData({
+ cut_top: this.data.info.windowHeight - this.data.cut_top,
+ });
+ }
+ !this.data._canvas_overflow && this._draw();
+ },
+ //开始触摸
+ _start(event) {
+ this.data._flag_img_endtouch = false;
+ if (event.touches.length == 1) {
+ //单指拖动
+ this.data._touch_img_relative[0] = {
+ x: (event.touches[0].clientX - this.data._img_left),
+ y: (event.touches[0].clientY - this.data._img_top)
+ }
+ } else {
+ //双指放大
+ let width = Math.abs(event.touches[0].clientX - event.touches[1].clientX);
+ let height = Math.abs(event.touches[0].clientY - event.touches[1].clientY);
+ this.data._touch_img_relative = [{
+ x: (event.touches[0].clientX - this.data._img_left),
+ y: (event.touches[0].clientY - this.data._img_top)
+ }, {
+ x: (event.touches[1].clientX - this.data._img_left),
+ y: (event.touches[1].clientY - this.data._img_top)
+ }];
+ this.data._hypotenuse_length = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
+ }
+ !this.data._canvas_overflow && this._draw();
+ },
+ _move_throttle(){
+ //安卓需要节流
+ if (this.data.info.platform =='android'){
+ clearTimeout(this.data.MOVE_THROTTLE);
+ this.data.MOVE_THROTTLE = setTimeout(() => {
+ this.data.MOVE_THROTTLE_FLAG = true;
+ }, 1000 / 40)
+ return this.data.MOVE_THROTTLE_FLAG;
+ }else{
+ this.data.MOVE_THROTTLE_FLAG = true;
+ }
+ },
+ _move(event) {
+ if (this.data._flag_img_endtouch || !this.data.MOVE_THROTTLE_FLAG) return;
+ this.data.MOVE_THROTTLE_FLAG = false;
+ this._move_throttle();
+ this._moveDuring();
+ if (event.touches.length == 1) {
+ //单指拖动
+ let left = (event.touches[0].clientX - this.data._touch_img_relative[0].x),
+ top = (event.touches[0].clientY - this.data._touch_img_relative[0].y);
+ //图像边缘检测,防止截取到空白
+ this.data._img_left = left;
+ this.data._img_top = top;
+ this._imgMarginDetectionPosition();
+ this.setData({
+ _img_left: this.data._img_left,
+ _img_top: this.data._img_top
+ });
+ } else {
+ //双指放大
+ let width = (Math.abs(event.touches[0].clientX - event.touches[1].clientX)),
+ height = (Math.abs(event.touches[0].clientY - event.touches[1].clientY)),
+ hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)),
+ scale = this.data.scale * (hypotenuse / this.data._hypotenuse_length),
+ current_deg = 0;
+ scale = scale <= this.data.min_scale ? this.data.min_scale : scale;
+ scale = scale >= this.data.max_scale ? this.data.max_scale : scale;
+ //图像边缘检测,防止截取到空白
+ this.data.scale = scale;
+ this._imgMarginDetectionScale();
+ //双指旋转(如果没禁用旋转)
+ let _touch_img_relative = [{
+ x: (event.touches[0].clientX - this.data._img_left),
+ y: (event.touches[0].clientY - this.data._img_top)
+ }, {
+ x: (event.touches[1].clientX - this.data._img_left),
+ y: (event.touches[1].clientY - this.data._img_top)
+ }];
+ if (!this.data.disable_rotate){
+ let first_atan = 180 / Math.PI * Math.atan2(_touch_img_relative[0].y, _touch_img_relative[0].x);
+ let first_atan_old = 180 / Math.PI * Math.atan2(this.data._touch_img_relative[0].y, this.data._touch_img_relative[0].x);
+ let second_atan = 180 / Math.PI * Math.atan2(_touch_img_relative[1].y, _touch_img_relative[1].x);
+ let second_atan_old = 180 / Math.PI * Math.atan2(this.data._touch_img_relative[1].y, this.data._touch_img_relative[1].x);
+ //当前旋转的角度
+ let first_deg = first_atan - first_atan_old,
+ second_deg = second_atan - second_atan_old;
+ if (first_deg != 0) {
+ current_deg = first_deg;
+ } else if (second_deg != 0) {
+ current_deg = second_deg;
+ }
+ }
+ this.data._touch_img_relative = _touch_img_relative;
+ this.data._hypotenuse_length = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
+ //更新视图
+ this.setData({
+ angle: this.data.angle + current_deg,
+ scale: this.data.scale
+ });
+ }
+ !this.data._canvas_overflow && this._draw();
+ },
+ //结束操作
+ _end(event) {
+ this.data._flag_img_endtouch = true;
+ this._moveStop();
+ },
+ //点击中间剪裁框处理
+ _click(event) {
+ if (!this.data.imgSrc) {
+ //调起上传
+ this.upload();
+ return;
+ }
+ this._draw(()=>{
+ let x = event.detail ? event.detail.x : event.touches[0].clientX;
+ let y = event.detail ? event.detail.y : event.touches[0].clientY;
+ // if ((x >= this.data.cut_left && x <= (this.data.cut_left + this.data.width)) && (y >= this.data.cut_top && y <= (this.data.cut_top + this.data.height))) {
+ //生成图片并回调
+ wx.canvasToTempFilePath({
+ width: this.data.width * this.data.export_scale,
+ height: Math.round(this.data.height * this.data.export_scale),
+ destWidth: this.data.width * this.data.export_scale,
+ destHeight: Math.round(this.data.height) * this.data.export_scale,
+ fileType: 'png',
+ quality: this.data.quality,
+ canvasId: this.data.el,
+ success: (res) => {
+ this.triggerEvent('tapcut', {
+ url: res.tempFilePath,
+ width: this.data.width * this.data.export_scale,
+ height: this.data.height * this.data.export_scale
+ });
+ }
+ }, this)
+ // }
+ });
+ },
+ //渲染
+ _draw(callback) {
+ console.log("_draw")
+ if (!this.data.imgSrc) return;
+ let draw = () => {
+ //图片实际大小
+ let img_width = this.data.img_width * this.data.scale * this.data.export_scale;
+ let img_height = this.data.img_height * this.data.scale * this.data.export_scale;
+ //canvas和图片的相对距离
+ var xpos = this.data._img_left - this.data.cut_left;
+ var ypos = this.data._img_top - this.data.cut_top;
+ //旋转画布
+ this.data.ctx.translate(xpos * this.data.export_scale, ypos * this.data.export_scale);
+ this.data.ctx.rotate(this.data.angle * Math.PI / 180);
+ this.data.ctx.drawImage(this.data.imgSrc, -img_width / 2, -img_height / 2, img_width, img_height);
+ this.data.ctx.draw(false, () => {
+ callback && callback();
+ });
+ }
+ if (this.data.ctx.width != this.data.width || this.data.ctx.height != this.data.height){
+ //优化拖动裁剪框,所以必须把宽高设置放在离用户触发渲染最近的地方
+ this.setData({
+ _canvas_height: this.data.height,
+ _canvas_width: this.data.width,
+ },()=>{
+ //延迟40毫秒防止点击过快出现拉伸或裁剪过多
+ setTimeout(() => {
+ draw();
+ }, 40);
+ });
+ }else{
+ draw();
+ }
+ },
+ //裁剪框处理
+ _cutTouchMove(e) {
+ if (this.data._flag_cut_touch && this.data.MOVE_THROTTLE_FLAG) {
+ if (this.data.disable_ratio && (this.data.disable_width || this.data.disable_height)) return;
+ //节流
+ this.data.MOVE_THROTTLE_FLAG = false;
+ this._move_throttle();
+ let width = this.data.width,
+ height = this.data.height,
+ cut_top = this.data.cut_top,
+ cut_left = this.data.cut_left,
+ size_correct = () => {
+ width = width <= this.data.max_width ? width >= this.data.min_width ? width : this.data.min_width : this.data.max_width;
+ height = height <= this.data.max_height ? height >= this.data.min_height ? height : this.data.min_height : this.data.max_height;
+ },
+ size_inspect = () => {
+ if ((width > this.data.max_width || width < this.data.min_width || height > this.data.max_height || height < this.data.min_height) && this.data.disable_ratio) {
+ size_correct();
+ return false;
+ } else {
+ size_correct();
+ return true;
+ }
+ };
+ height = this.data.CUT_START.height + ((this.data.CUT_START.corner > 1 && this.data.CUT_START.corner < 4 ? 1 : -1) * (this.data.CUT_START.y - e.touches[0].clientY));
+ switch (this.data.CUT_START.corner) {
+ case 1:
+ width = this.data.CUT_START.width + this.data.CUT_START.x - e.touches[0].clientX;
+ if (this.data.disable_ratio) {
+ height = width / (this.data.width / this.data.height)
+ }
+ if (!size_inspect()) return;
+ cut_left = this.data.CUT_START.cut_left - (width - this.data.CUT_START.width);
+ break
+ case 2:
+ width = this.data.CUT_START.width + this.data.CUT_START.x - e.touches[0].clientX;
+ if (this.data.disable_ratio) {
+ height = width / (this.data.width / this.data.height)
+ }
+ if (!size_inspect()) return;
+ cut_top = this.data.CUT_START.cut_top - (height - this.data.CUT_START.height)
+ cut_left = this.data.CUT_START.cut_left - (width - this.data.CUT_START.width)
+ break
+ case 3:
+ width = this.data.CUT_START.width - this.data.CUT_START.x + e.touches[0].clientX;
+ if (this.data.disable_ratio) {
+ height = width / (this.data.width / this.data.height)
+ }
+ if (!size_inspect()) return;
+ cut_top = this.data.CUT_START.cut_top - (height - this.data.CUT_START.height);
+ break
+ case 4:
+ width = this.data.CUT_START.width - this.data.CUT_START.x + e.touches[0].clientX;
+ if (this.data.disable_ratio) {
+ height = width / (this.data.width / this.data.height)
+ }
+ if (!size_inspect()) return;
+ break
+ }
+ if (!this.data.disable_width && !this.data.disable_height) {
+ this.setData({
+ width: width,
+ cut_left: cut_left,
+ height: height,
+ cut_top: cut_top,
+ })
+ } else if (!this.data.disable_width) {
+ this.setData({
+ width: width,
+ cut_left: cut_left
+ })
+ } else if (!this.data.disable_height) {
+ this.setData({
+ height: height,
+ cut_top: cut_top
+ })
+ }
+ this._imgMarginDetectionScale();
+ }
+ },
+ _cutTouchStart(e) {
+ let currentX = e.touches[0].clientX;
+ let currentY = e.touches[0].clientY;
+ let cutbox_top4 = this.data.cut_top + this.data.height - 30;
+ let cutbox_bottom4 = this.data.cut_top + this.data.height + 20;
+ let cutbox_left4 = this.data.cut_left + this.data.width - 30;
+ let cutbox_right4 = this.data.cut_left + this.data.width + 30;
+
+ let cutbox_top3 = this.data.cut_top - 30;
+ let cutbox_bottom3 = this.data.cut_top + 30;
+ let cutbox_left3 = this.data.cut_left + this.data.width - 30;
+ let cutbox_right3 = this.data.cut_left + this.data.width + 30;
+
+ let cutbox_top2 = this.data.cut_top - 30;
+ let cutbox_bottom2 = this.data.cut_top + 30;
+ let cutbox_left2 = this.data.cut_left - 30;
+ let cutbox_right2 = this.data.cut_left + 30;
+
+ let cutbox_top1 = this.data.cut_top + this.data.height - 30;
+ let cutbox_bottom1 = this.data.cut_top + this.data.height + 30;
+ let cutbox_left1 = this.data.cut_left - 30;
+ let cutbox_right1 = this.data.cut_left + 30;
+ if (currentX > cutbox_left4 && currentX < cutbox_right4 && currentY > cutbox_top4 && currentY < cutbox_bottom4) {
+ this._moveDuring();
+ this.data._flag_cut_touch = true;
+ this.data._flag_img_endtouch = true;
+ this.data.CUT_START = {
+ width: this.data.width,
+ height: this.data.height,
+ x: currentX,
+ y: currentY,
+ corner: 4
+ }
+ } else if (currentX > cutbox_left3 && currentX < cutbox_right3 && currentY > cutbox_top3 && currentY < cutbox_bottom3) {
+ this._moveDuring();
+ this.data._flag_cut_touch = true;
+ this.data._flag_img_endtouch = true;
+ this.data.CUT_START = {
+ width: this.data.width,
+ height: this.data.height,
+ x: currentX,
+ y: currentY,
+ cut_top: this.data.cut_top,
+ cut_left: this.data.cut_left,
+ corner: 3
+ }
+ } else if (currentX > cutbox_left2 && currentX < cutbox_right2 && currentY > cutbox_top2 && currentY < cutbox_bottom2) {
+ this._moveDuring();
+ this.data._flag_cut_touch = true;
+ this.data._flag_img_endtouch = true;
+ this.data.CUT_START = {
+ width: this.data.width,
+ height: this.data.height,
+ cut_top: this.data.cut_top,
+ cut_left: this.data.cut_left,
+ x: currentX,
+ y: currentY,
+ corner: 2
+ }
+ } else if (currentX > cutbox_left1 && currentX < cutbox_right1 && currentY > cutbox_top1 && currentY < cutbox_bottom1) {
+ this._moveDuring();
+ this.data._flag_cut_touch = true;
+ this.data._flag_img_endtouch = true;
+ this.data.CUT_START = {
+ width: this.data.width,
+ height: this.data.height,
+ cut_top: this.data.cut_top,
+ cut_left: this.data.cut_left,
+ x: currentX,
+ y: currentY,
+ corner: 1
+ }
+ }
+ },
+ _cutTouchEnd(e) {
+ this._moveStop();
+ this.data._flag_cut_touch = false;
+ },
+ //停止移动时需要做的操作
+ _moveStop() {
+ //清空之前的自动居中延迟函数并添加最新的
+ clearTimeout(this.data.TIME_CUT_CENTER);
+ this.data.TIME_CUT_CENTER = setTimeout(() => {
+ //动画启动
+ if (!this.data._cut_animation) {
+ this.setData({
+ _cut_animation: true
+ });
+ }
+ this.setCutCenter();
+ }, 1000)
+ //清空之前的背景变化延迟函数并添加最新的
+ clearTimeout(this.data.TIME_BG);
+ this.data.TIME_BG = setTimeout(() => {
+ if (this.data._flag_bright) {
+ this.setData({
+ _flag_bright: false
+ });
+ }
+ }, 2000)
+ },
+ //移动中
+ _moveDuring() {
+ //清空之前的自动居中延迟函数
+ clearTimeout(this.data.TIME_CUT_CENTER);
+ //清空之前的背景变化延迟函数
+ clearTimeout(this.data.TIME_BG);
+ //高亮背景
+ if (!this.data._flag_bright) {
+ this.setData({
+ _flag_bright: true
+ });
+ }
+ },
+ //监听器
+ _watcher() {
+ Object.keys(this.data).forEach(v => {
+ this._observe(this.data, v, this.data.watch[v]);
+ })
+ },
+ _observe(obj, key, watchFun) {
+ var val = obj[key];
+ Object.defineProperty(obj, key, {
+ configurable: true,
+ enumerable: true,
+ set:(value) => {
+ val = value;
+ watchFun && watchFun(val, this);
+ },
+ get() {
+ if (val && '_img_top|img_left||width|height|min_width|max_width|min_height|max_height|export_scale|cut_top|cut_left|canvas_top|canvas_left|img_width|img_height|scale|angle|min_scale|max_scale'.indexOf(key)!=-1){
+ let ret = parseFloat(parseFloat(val).toFixed(3));
+ if (typeof val == "string" && val.indexOf("%") != -1){
+ ret+='%';
+ }
+ return ret;
+ }
+ return val;
+ }
+ })
+ },
+ _preventTouchMove() {
+ },
+ cnacle(){
+ this.setData({
+ show_cropper: false
+ })
+ }
+ }
+})
diff --git a/commpents/image-cropper/image-cropper.json b/commpents/image-cropper/image-cropper.json
new file mode 100644
index 0000000..32640e0
--- /dev/null
+++ b/commpents/image-cropper/image-cropper.json
@@ -0,0 +1,3 @@
+{
+ "component": true
+}
\ No newline at end of file
diff --git a/commpents/image-cropper/image-cropper.wxml b/commpents/image-cropper/image-cropper.wxml
new file mode 100644
index 0000000..a773e40
--- /dev/null
+++ b/commpents/image-cropper/image-cropper.wxml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/commpents/image-cropper/image-cropper.wxss b/commpents/image-cropper/image-cropper.wxss
new file mode 100644
index 0000000..5364fb3
--- /dev/null
+++ b/commpents/image-cropper/image-cropper.wxss
@@ -0,0 +1,144 @@
+.image-cropper{
+ background:rgba(14, 13, 13,.8);
+ position: fixed;
+ top:0;
+ left:0;
+ width:100vw;
+ height:100vh;
+ z-index: 2;
+}
+.image-cropper .main{
+ position: absolute;
+ width:100vw;
+ height:100vh;
+ overflow: hidden;
+}
+.image-cropper .content{
+ z-index: 9;
+ position: absolute;
+ width:100vw;
+ height:100vh;
+ display: flex;
+ flex-direction:column;
+ pointer-events:none;
+}
+.image-cropper .bg_black{
+ background: rgba(0, 0, 0, 0.8)!important;
+}
+.image-cropper .bg_gray{
+ background: rgba(0, 0, 0, 0.45);
+ transition-duration: .35s;
+}
+.image-cropper .content>.content_top{
+ pointer-events:none;
+}
+.image-cropper .content>.content_middle{
+ display: flex;
+ height: 200px;
+ width:100%;
+}
+.image-cropper .content_middle_middle{
+ width:200px;
+ box-sizing:border-box;
+ position: relative;
+ transition-duration: .3s;
+}
+.image-cropper .content_middle_right{
+ flex: auto;
+}
+.image-cropper .content>.content_bottom{
+ flex: auto;
+}
+.image-cropper .img{
+ z-index: 2;
+ top:0;
+ left:0;
+ position: absolute;
+ border:none;
+ width:100%;
+ backface-visibility: hidden;
+ transform-origin:center;
+}
+.image-cropper .image-cropper-canvas{
+ position: fixed;
+ background: white;
+ width:150px;
+ height:150px;
+ z-index: 10;
+ top:-200%;
+ pointer-events:none;
+}
+.image-cropper .border{
+ background: white;
+ pointer-events:auto;
+ position:absolute;
+}
+.image-cropper .border-top-left{
+ left:-2.5px;
+ top:-2.5px;
+ height:2.5px;
+ width:33rpx;
+}
+.image-cropper .border-top-right{
+ right:-2.5px;
+ top:-2.5px;
+ height:2.5px;
+ width:33rpx;
+}
+.image-cropper .border-right-top{
+ top:-1px;
+ width:2.5px;
+ height:30rpx;
+ right:-2.5px;
+}
+.image-cropper .border-right-bottom{
+ width:2.5px;
+ height:30rpx;
+ right:-2.5px;
+ bottom:-1px;
+}
+.image-cropper .border-bottom-left{
+ height:2.5px;
+ width:33rpx;
+ bottom:-2.5px;
+ left:-2.5px;
+}
+.image-cropper .border-bottom-right{
+ height:2.5px;
+ width:33rpx;
+ bottom:-2.5px;
+ right:-2.5px;
+}
+.image-cropper .border-left-top{
+ top:-1px;
+ width:2.5px;
+ height:30rpx;
+ left:-2.5px;
+}
+.image-cropper .border-left-bottom{
+ width:2.5px;
+ height:30rpx;
+ left:-2.5px;
+ bottom:-1px;
+}
+.btn_box{
+ z-index: 9;
+ position: absolute;
+ display: flex;
+ bottom: 0rpx;
+ justify-content: center;
+ width: 100vw;
+}
+.btn{
+ font-weight: 600;
+ text-align: center;
+ margin: 60rpx 20rpx;
+ flex: 1;
+}
+.btn_cancle{
+ /* width: 100rpx; */
+}
+.btn_confirm{
+ background-color: #3CC7C0;
+ color: #fff;
+}
diff --git a/commpents/mynavbar/index.wxml b/commpents/mynavbar/index.wxml
index ee5f9c8..e131b2b 100644
--- a/commpents/mynavbar/index.wxml
+++ b/commpents/mynavbar/index.wxml
@@ -1,6 +1,6 @@
-
+
{{ navbarData.title }}
diff --git a/commpents/mynavbar/index.wxss b/commpents/mynavbar/index.wxss
index baca7f2..3de4ad5 100644
--- a/commpents/mynavbar/index.wxss
+++ b/commpents/mynavbar/index.wxss
@@ -7,7 +7,7 @@
top: 0;
width: 750rpx;
height: 170rpx;
- background-color: #bae46b;
+ background-color: #ffffff;
z-index: 99;
}
.tui-navigatorbar-back{
@@ -23,7 +23,7 @@
height: 88rpx;
line-height: 56rpx;
font-size: 36rpx;
- color: #e68080;
+ color: #000000;
bottom: 0;
left: 200rpx;
display: flex;
diff --git a/commpents/myprofile/index.js b/commpents/myprofile/index.js
index 5d8544b..9c7bd62 100644
--- a/commpents/myprofile/index.js
+++ b/commpents/myprofile/index.js
@@ -1,6 +1,7 @@
// commpents/myprofile/index.js
import Toast from '@vant/weapp/toast/toast';
import { API } from './../../utils/network/api'
+import { FileUtil } from './../../utils/fileutil'
const api = new API()
const app = getApp()
@@ -19,14 +20,15 @@ Component({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '医师身份认证', //导航栏 中间的标题
},
- height: app.globalData.height,
+ height: app.globalData.height,
//选项卡
stickyProps: {
zIndex: 2,
},
realname:"",
idcard:"",
- avatar: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/default_photo.png",
+ static_host: api.getStaticHost(),
+ avatar: api.getStaticHost()+"/applet/doctor/static/images/default_photo.png",
is_avatar: false,
city_show: false,
keshi_show: false,
@@ -45,24 +47,7 @@ Component({
select_keshi_index: "",
custom_keshi: "",
zhicheng_note: "请选择职称",
- zhicheng_columns: [
- {
- text: "执业医师",
- value: 1
- },
- {
- text: "主治医师",
- value: 2
- },
- {
- text: "副主任医师",
- value: 3
- },
- {
- text: "主任医师",
- value: 4
- }
- ],
+ zhicheng_columns: [],
select_zhicheng_id: "",
select_zhicheng_index: "",
select_yiyuan_index: "",
@@ -85,23 +70,40 @@ Component({
doctorauthiden_data_ready: false,
basicdepartment_data_ready: false,
areaprovince_data_ready: false,
+ basicdoctortitle_data_ready: false,
iden_auth_status: 0,
iden_auth_disabled: 0,
iden_auth_status_txt: "未认证",
+ avatar_reason: "",
+ department_custom_mobile_reason: "",
+ brief_introduction_reason: "",
+ be_good_at_reason: "",
+ license_cert_reason: "",
+ qualification_cert_reason: "",
+ work_cert_reason: "",
+ department_custom_name_reason: '',
+ zhuanchang_note: '请选择专长',
+ jianjie_show: false,
+ shanchang_show: false,
+ show_cropper: false,
+ img_cropper_src: '',
+ img_cropper_width: 250, //宽度
+ img_cropper_height: 250, //高度
},
-
options: {
addGlobalClass: true,
styleIsolation: 'apply-shared'
},
lifetimes: {
attached(){
+
+ console.log("myprofile attached")
let _this = this;
+
//获得医师身份认证
- api.getDoctorAuthIden().then(response => {
+ api.getDoctorAuthIden({source: this.data.indentity?1:2}).then(response => {
console.log("getDoctorAuthIden: ",response);
this.setData({
- is_avatar: true,
doctorauthiden_data_ready: true,
textarea_jianjie: response.data.brief_introduction,
textarea_shanchang: response.data.be_good_at,
@@ -115,12 +117,20 @@ Component({
select_yiyuan_id: response.data.hospital.hospital_id,
hospital: response.data.hospital,
iden_auth_status: response.data.iden_auth_status,
+ avatar_reason: response.data.avatar_reason,
+ department_custom_mobile_reason: response.data.department_custom_mobile_reason,
+ brief_introduction_reason: response.data.brief_introduction_reason,
+ be_good_at_reason: response.data.be_good_at_reason,
+ license_cert_reason: response.data.license_cert_reason,
+ qualification_cert_reason: response.data.qualification_cert_reason,
+ work_cert_reason: response.data.work_cert_reason,
+ department_custom_name_reason: response.data.department_custom_name_reason,
});
let iden_auth_status = response.data.iden_auth_status;
console.log("iden_auth_status: ",iden_auth_status)
- let iden_auth_status_txt = iden_auth_status == 0?'请完善资料后提交':iden_auth_status == 1?'认证通过': iden_auth_status==2?'资料已提交,审核中':iden_auth_status==3?'认证失败':'未认证';
+ let iden_auth_status_txt = iden_auth_status == 0?'请完善资料后提交':iden_auth_status == 1?'认证通过': iden_auth_status==2?'资料已提交,审核中':iden_auth_status==3?'认证失败,修改后重新提交':'未认证';
- let iden_auth_disabled = iden_auth_status == 0?false:iden_auth_status == 1?false: iden_auth_status==2?true:iden_auth_status==3?false:true;
+ let iden_auth_disabled = iden_auth_status == 0?false:iden_auth_status == 1?true: iden_auth_status==2?true:iden_auth_status==3?false:true;
console.log("iden_auth_disabled: ",iden_auth_disabled)
this.setData({
iden_auth_status_txt: iden_auth_status_txt,
@@ -160,12 +170,12 @@ Component({
})
}
let avatar = response.data.avatar;
- if(avatar && (avatar.indexOf("http") == -1)){
- avatar = api.getStaticHost() + avatar;
+ if(avatar){
+ this.setData({
+ "avatar": avatar,
+ is_avatar: true,
+ })
}
- this.setData({
- "avatar": avatar
- })
}).catch(errors => {console.error(errors);})
//加载省份列表
@@ -188,41 +198,78 @@ Component({
})
}).catch(errors => {console.error(errors); })
+ //加载职称列表
+ api.getBasicDoctorTitle().then(response => {
+ console.log(response);
+ const list = _this.formatZhiCheng(response);
+ _this.setData({
+ basicdoctortitle_data_ready: true,
+ zhicheng_columns: list
+ })
+ }).catch(errors => {console.error(errors); })
+
//加载专长列表
api.getDoctorExpertise().then(response => {
console.log(response);
_this.setData({
zhuanchang_columns: response.data
})
+ }).then(()=>{
+ let index = this.data.zhuanchang_columns.findIndex(item => {
+ return item.is_selected == 1;
+ })
+ if(index != undefined) {
+ this.setData({
+ zhuanchang_note: ""
+ })
+ }
}).catch(errors => {console.error(errors); })
let keshi_huixian = false;
let zhicheng_huixian = false;
let area_huixian = false;
//执行回显
+ let huixian_try_count = 0;
let data_replay = setInterval(() => {
- console.log("执行回显。。。")
+ try {
+ console.log("执行回显。。。", huixian_try_count);
//回显科室
if(_this.data.doctorauthiden_data_ready && _this.data.basicdepartment_data_ready){
let index = _this.data.keshi_columns.findIndex(item => {
+ console.log("value: ",item.value);
+ console.log("select_keshi_id: ", _this.data.select_keshi_id);
return item.value == _this.data.select_keshi_id
})
- _this.setData({
- select_keshi_index: index,
- keshi_note: _this.data.keshi_columns[index].text
- })
+ console.log("科室:", index)
+ if(index == -1){
+ clearInterval(data_replay);
+ return
+ }
+ if(index > -1){
+ _this.setData({
+ select_keshi_index: index,
+ keshi_note: _this.data.keshi_columns[index].text
+ })
+ }
keshi_huixian = true;
}
+
//回显职称
- if(_this.data.doctorauthiden_data_ready){
+ if(_this.data.doctorauthiden_data_ready && _this.data.basicdoctortitle_data_ready){
let index = _this.data.zhicheng_columns.findIndex(item => {
return item.value == _this.data.select_zhicheng_id
})
- _this.setData({
- select_zhicheng_index: index,
- zhicheng_note: _this.data.zhicheng_columns[index].text
- })
+ if(index == -1){
+ clearInterval(data_replay);
+ return
+ }
+ if(index > -1){
+ _this.setData({
+ select_zhicheng_index: index,
+ zhicheng_note: _this.data.zhicheng_columns[index].text
+ })
+ }
zhicheng_huixian = true;
}
@@ -262,6 +309,7 @@ Component({
}
api.getBasicHospital(params).then(response => {// 请求医院列表
_this.setData({
+ hospital_search_val: "",
yiyuan_columns: _this.formatYiYuan(response),
city_note: _this.data.hospital.province + "/" + _this.data.hospital.city + "/" + _this.data.hospital.county
})
@@ -283,28 +331,63 @@ Component({
area_huixian = true;
}
-
+ } catch (error) {
+ console.error(error)
+ }
+ huixian_try_count = huixian_try_count + 1;
//都回显成功后,清除计时器
console.log("keshi_huixian: ", keshi_huixian)
console.log("zhicheng_huixian: ", zhicheng_huixian)
console.log("area_huixian: ", area_huixian)
- if(keshi_huixian && zhicheng_huixian && area_huixian){
+ if((keshi_huixian && zhicheng_huixian && area_huixian)){
+ console.log("clearInterval1111", data_replay);
clearInterval(data_replay);
}
- console.log("计时器")
- }, 1000);
+ if(huixian_try_count > 50){
+ console.log("clearInterva22222", data_replay);
+ clearInterval(data_replay);
+ }
+ console.log("计时器");
+ }, 500);
+
+ console.log("clearInterva3333", data_replay);
},
},
methods: {
+ hospitalSearch(e){
+ console.log(e.detail)
+ },
+ hospitalSearchChange(e){
+ console.log(e.detail);
+ let params = {
+ hospital_name: e.detail.trim(),
+ province_id: this.data.select_province_id,
+ city_id: this.data.select_city_id,
+ county_id: this.data.select_county_id,
+ }
+ api.getBasicHospital(params).then(response => {// 请求医院列表】
+ this.setData({
+ yiyuan_columns: this.formatYiYuan(response),
+ yiyuan_show: true
+ })
+ }).catch(errors => {console.error(errors); })
+ },
onCityShow(e) {
console.log("onCityShow");
this.setData({ city_show: true });
+ this.triggerEvent('showPageMeta');
+ },
+ onCloseCity(e){
+ console.log("onCloseCity");
+ this.triggerEvent('hidePageMeta');
},
onChangeCity(e) {
this.setData({
select_county_id: "",
- select_yiyuan_id: ""
+ select_yiyuan_id: "",
+ yiyuan_note: "请选择医院",
+ city_note: "请选择城市",
})
console.log("onChangeCity");
const { selectedOptions } = e.detail;
@@ -351,6 +434,7 @@ Component({
}
api.getBasicHospital(params).then(response => {// 请求医院列表】
this.setData({
+ hospital_search_val: "",
yiyuan_columns: this.formatYiYuan(response),
city_show: false,
city_note: this.getCityNote(selectedOptions),
@@ -410,6 +494,16 @@ Component({
});
return list;
},
+ formatZhiCheng(response){
+ let list = [];
+ response.data.forEach(item => {
+ let data = {};
+ data.text = item.doctor_title_name;
+ data.value = item.doctor_title_id;
+ list.push(data)
+ });
+ return list;
+ },
formatZhuanChang(response){
let list = [];
response.data.forEach(item => {
@@ -422,30 +516,48 @@ Component({
},
onYiYuanShow(e) {
console.log("onYiYuanShow");
- this.setData({ yiyuan_show: true });
+ let select_province_id = this.data.select_province_id;
+ let select_city_id = this.data.select_city_id;
+ let select_county_id = this.data.select_county_id;
+ if(select_province_id && select_city_id && select_county_id){
+ this.setData({ yiyuan_show: true });
+ }else{
+ wx.showToast({
+ title: '请先选择城市',
+ icon: "error"
+ })
+ }
+ this.triggerEvent('showPageMeta');
},
onYiYuanClose(e) {
console.log("onYiYuanClose");
this.setData({ yiyuan_show: false });
+ this.triggerEvent('hidePageMeta');
},
onYiYuanCancel(event) {
console.log("onYiYuanCancel");
const { picker, value, index } = event.detail;
Toast(`当前值:${value}, 当前索引:${index}`);
- this.setData({
- yiyuan_show: false
- });
-
+ this.setData({yiyuan_show: false});
+ this.triggerEvent('hidePageMeta');
},
onYiYuanConfirm(event) {
console.log("onYiYuanConfirm");
const { picker, value, index } = event.detail;
console.log(event.detail);
- this.setData({
- yiyuan_show: false,
- select_yiyuan_id: `${value.value}`,
- yiyuan_note: `${value.text}`
- });
+ if(value.value){
+ this.setData({
+ yiyuan_show: false,
+ select_yiyuan_id: `${value.value}`,
+ yiyuan_note: `${value.text}`
+ });
+ }else{
+ wx.showToast({
+ title: '请先选择医院',
+ icon: "error"
+ })
+ }
+ this.triggerEvent('hidePageMeta');
},
onYiYuanChange(event) {
console.log("onYiYuanChange");
@@ -455,12 +567,14 @@ Component({
onKeshiShow(e) {
console.log("onKeshiShow");
this.setData({ keshi_show: true });
+ this.triggerEvent('showPageMeta');
},
onKeshiCancel(event) {
console.log("onKeshiCancel");
const { picker, value, index } = event.detail;
Toast(`当前值:${value}, 当前索引:${index}`);
this.setData({ keshi_show: false });
+ this.triggerEvent('hidePageMeta');
},
onKeshiConfirm(event) {
console.log("onKeshiConfirm");
@@ -471,6 +585,7 @@ Component({
select_keshi_id: `${value.value}`,
keshi_note: `${value.text}`,
});
+ this.triggerEvent('hidePageMeta');
},
onKeshiChange(event) {
console.log("onKeshiChange");
@@ -478,16 +593,19 @@ Component({
onKeshiClose(e) {
console.log("onKeshiClose");
this.setData({ keshi_show: false });
+ this.triggerEvent('hidePageMeta');
},
onZhiChengShow(e) {
console.log("onKeshiShow");
this.setData({ zhicheng_show: true });
+ this.triggerEvent('showPageMeta');
},
onZhiChengCancel(event) {
console.log("onKeshiCancel");
const { picker, value, index } = event.detail;
Toast(`当前值:${value}, 当前索引:${index}`);
this.setData({ zhicheng_show: false });
+ this.triggerEvent('hidePageMeta');
},
onZhiChengConfirm(event) {
console.log("onZhiChengConfirm");
@@ -498,6 +616,7 @@ Component({
select_zhicheng_id: `${value.value}`,
zhicheng_note: `${value.text}`,
});
+ this.triggerEvent('hidePageMeta');
},
onZhiChengChange(event) {
console.log("onZhiChengChange");
@@ -505,75 +624,160 @@ Component({
onZhiChengClose(e) {
console.log("onZhiChengClose");
this.setData({ zhicheng_show: false });
+ this.triggerEvent('hidePageMeta');
},
onZhuanChangShow(){
this.setData({ zhuanchang_show: true });
+ this.triggerEvent('showPageMeta');
},
onZhuanChangVisibleChange(e) {
+ console.log("onZhuanChangVisibleChange:", e.detail.visible)
this.setData({
zhuanchang_show: e.detail.visible,
});
+ if(e.detail.visible == false){
+ this.triggerEvent('hidePageMeta');
+ }
},
onshowJianJieNote(e){
e.detail // 自定义组件触发事件时提供的 detail 对象
console.log("onshowJianJieNote");
+ this.setData({jianjie_show: true});
+ this.triggerEvent('showPageMeta');
+ },
+ onJianjieClose(e){
+ e.detail // 自定义组件触发事件时提供的 detail 对象
+ console.log("onshowJianJieNote");
+ this.setData({jianjie_show: false});
+ this.triggerEvent('hidePageMeta');
},
onshowShanChangNote(e){
e.detail // 自定义组件触发事件时提供的 detail 对象
console.log("onshowShanChangNote");
+ this.setData({shanchang_show: true});
+ this.triggerEvent('showPageMeta');
+ },
+ onshowShanChangNoteClose(e){
+ e.detail // 自定义组件触发事件时提供的 detail 对象
+ console.log("onshowShanChangNote");
+ this.setData({shanchang_show: false});
+ this.triggerEvent('hidePageMeta');
},
onshowZhiYeNote(e){
e.detail // 自定义组件触发事件时提供的 detail 对象
console.log("onshowZhiYeNote");
this.setData({ zhiye_show: true });
+ this.triggerEvent('showPageMeta');
},
onZhiYeClose(){
console.log("onZhiYeClose");
this.setData({ zhiye_show: false });
+ this.triggerEvent('hidePageMeta');
},
onshowZiGeNote(e){
e.detail // 自定义组件触发事件时提供的 detail 对象
console.log("onshowZiGeNote");
this.setData({ zige_show: true });
+ this.triggerEvent('showPageMeta');
},
onZiGeClose(){
console.log("onZhiYeClose");
this.setData({ zige_show: false });
+ this.triggerEvent('hidePageMeta');
},
onshowZhiChengImgNote(e){
e.detail // 自定义组件触发事件时提供的 detail 对象
console.log("onshowZhiChengNote");
this.setData({ zhicheng_img_show: true });
+ this.triggerEvent('showPageMeta');
},
onZhiChengImgClose(){
console.log("onZhiChengClose");
this.setData({ zhicheng_img_show: false });
+ this.triggerEvent('hidePageMeta');
+ },
+ onCustomKeshiChange(){
+ this.setData({
+ department_custom_name_reason: ""
+ })
},
getTextAreaVal(e){
- console.log("myindex: ", e);
+ console.log("myindex: ", e);//textarea_jianjie
let textarea_name = e.currentTarget.dataset.textarea_name;
+ if(textarea_name == "textarea_jianjie"){
+ this.setData({
+ brief_introduction_reason: ""
+ })
+ }
+ if(textarea_name == "textarea_shanchang"){
+ this.setData({
+ be_good_at_reason: ""
+ })
+ }
+ let reason_name = textarea_name+"_reason";
this.setData({
- [textarea_name]: e.detail.value
+ [textarea_name]: e.detail.value,
})
},
select_zhuanchang(e){
console.log(e);
- let expertise_name = e.currentTarget.dataset.expertise_name;
- let expertise_id = e.currentTarget.dataset.expertise_id;
- let is_selected = e.currentTarget.dataset.is_selected;
- let index = e.currentTarget.dataset.index;
- let data = "zhuanchang_columns["+index+"].is_selected";
- this.setData({[data]: is_selected==1?0:1})
+ let count = 0
+ this.data.zhuanchang_columns.forEach(item => {
+ if(item.is_selected == 1){
+ count = count + 1;
+ }
+ })
+
+ console.log("countcountcountcount: ",count)
+ if(count >= 10 && e.currentTarget.dataset.is_selected==0){
+ wx.showToast({
+ title: '最多10个专长',
+ icon: "error"
+ })
+ }else{
+ let is_selected = e.currentTarget.dataset.is_selected;
+ let index = e.currentTarget.dataset.index;
+ let data = "zhuanchang_columns["+index+"].is_selected";
+ this.setData({[data]: is_selected==1?0:1})
+ }
+
+ this.checkZhuanchangNote()
+ },
+ checkZhuanchangNote(){
+ let count = 0
+ this.data.zhuanchang_columns.forEach(item => {
+ if(item.is_selected == 1){
+ count = count + 1;
+ }
+ })
+
+ if(count > 0){
+ this.setData({
+ zhuanchang_note: ""
+ })
+ }
+ if(count == 0){
+ this.setData({
+ zhuanchang_note: "请选择专长"
+ })
+ }
},
zhuanchangConfirm(e){
this.setData({ zhuanchang_show: false });
+ this.triggerEvent('hidePageMeta');
},
zhuanchangConcle(e){
this.setData({ zhuanchang_show: false });
+ this.triggerEvent('hidePageMeta');
},
- addDoctorAuthIden(){
- let params = {};
+ addDoctorAuthIden(e){
+ console.log("addDoctorAuthIden addDoctorAuthIden")
+ let from = e.currentTarget.dataset.from;
+ console.log("from: ", from);
+ let params = {};
+
+ params.source = from=="myinfo"?2:1;
if(!this.data.is_avatar){wx.showToast({title: '请上传头像',icon: "error"});return}
params.avatar = this.data.avatar;
if(!this.data.select_county_id){wx.showToast({title: '请选择城市',icon: "error"});return}
@@ -581,7 +785,7 @@ Component({
params.hospital_id = this.data.select_yiyuan_id;//医院id
if(!this.data.select_keshi_id){wx.showToast({title: '请选择科室',icon: "error"});return}
params.department_custom_id = this.data.select_keshi_id;//科室id
- if(!this.data.custom_keshi){wx.showToast({title: '请输入科室',icon: "error"});return}
+ // if(!this.data.custom_keshi){wx.showToast({title: '请输入科室',icon: "error"});return}
params.department_custom_name = this.data.custom_keshi;//自定义科室名称
if(!this.data.office_phone){wx.showToast({title: '请输入科室电话',icon: "error"});return}
params.department_custom_mobile = this.data.office_phone;//科室电话
@@ -594,29 +798,226 @@ Component({
if(!this.data.textarea_shanchang){wx.showToast({title: '请输入擅长',icon: "error"});return}
params.be_good_at = this.data.textarea_shanchang;//擅长
- if(this.data.zhiye_file_list.length == 0){wx.showToast({title: '请上传医师执业证',icon: "error"});return}
- params.license_cert = this.data.zhiye_file_list.map(e => e.url);//医师执业证
- if(this.data.zige_file_list.length == 0){wx.showToast({title: '请上传医师资格证',icon: "error"});return}
- params.qualification_cert = this.data.zige_file_list.map(e => e.url);//医生资格证
- if(this.data.zhicheng_file_list.length == 0){wx.showToast({title: '请上传职称证',icon: "error"});return}
- params.work_cert = this.data.zhicheng_file_list.map(e => e.url);//工作证,职称证
-
-
+ if(from == "doctorauthiden"){//只有在医师身份认证模块才去修改证件
+ if(this.data.zhiye_file_list.length == 0){wx.showToast({title: '请上传医师执业证',icon: "error"});return}
+ if(this.data.zhiye_file_list.length < 2){wx.showToast({title: '医师执业证至少2张',icon: "error"});return}
+ params.license_cert = this.data.zhiye_file_list.map(e => e.url);//医师执业证
+ if(this.data.zige_file_list.length == 0){wx.showToast({title: '请上传医师资格证',icon: "error"});return}
+ params.qualification_cert = this.data.zige_file_list.map(e => e.url);//医生资格证
+ if(this.data.zhicheng_file_list.length == 0){wx.showToast({title: '请上传职称证',icon: "error"});return}
+ params.work_cert = this.data.zhicheng_file_list.map(e => e.url);//工作证,职称证
+ }
console.log(params);
+ let _this = this;
api.postDoctorAuthIden(params).then(response => {
console.log(response);
wx.showToast({
title: '提交成功',
icon: "success"
})
-
- this.setData({
- iden_auth_status_txt: "审核中",
- iden_auth_disabled: true
+ _this.setData({
+ iden_auth_status_txt: "资料已提交,审核中",
+ iden_auth_disabled: true,
+ iden_auth_status: 2,
})
-
}).catch(errors => {console.error(errors);})
- }
+ },
+ onOfficePhoneChange(){
+ this.setData({
+ department_custom_mobile_reason: ""
+ })
+ },
+ doUploadFile(event) {
+ console.log("index douploadFIle: ", event);
+ const scene = event.currentTarget.dataset.scene;
+ const field_name = event.currentTarget.dataset.field_name;
+ const file_multiple = event.currentTarget.dataset.file_multiple;//是否为多张图
+ console.log("scene: ", scene);
+ console.log("field_name: ", field_name);
+ console.log("file_multiple: ", file_multiple);
+ let _this = this;
+ api.getOssSign({user_type:2,scene:scene}).then(response => {
+ console.log(response);
+ const { file } = event.detail;
+
+ file.forEach(item => {
+ console.log("file: ", item);
+ const filename = FileUtil.getFileName(item);
+ const host = response.data.host;
+ const signature = response.data.signature;
+ const ossAccessKeyId = response.data.accessid;
+ const policy = response.data.policy;
+ const key = response.data.dir+filename;
+ const filePath = item.url; // 待上传文件的文件路径。
+ wx.uploadFile({
+ url: host, // 开发者服务器的URL。
+ filePath: filePath,
+ name: 'file', // 必须填file。
+ formData: {
+ key,
+ policy,
+ OSSAccessKeyId: ossAccessKeyId,
+ signature,
+ },
+ success: (res) => {
+ console.log("upload: ", res);
+ let reason_name = field_name + "_reason";//错误原因置空
+ if (res.statusCode === 204) {
+ if(scene == 1){
+ this.setData({
+ is_avatar: true
+ })
+ }
+ wx.showToast({title: '上传成功'})
+ if(file_multiple == "true"){//多张图
+ let img = {}
+ img.url = host+"/"+key;
+ img.isImg = true;
+
+ let img_list = _this.data[field_name];
+ console.log("img_list: ", img_list);
+ img_list.push(img);
+ console.log("img_list: ", img_list);
+
+ reason_name = field_name=='zhiye_file_list'?'license_cert_reason':field_name=='zige_file_list'?'qualification_cert_reason':'work_cert_reason';
+ this.setData({
+ [field_name]: img_list,
+ [reason_name]: ""
+ });
+ }else{
+ this.setData({
+ [field_name]: host+"/"+key,
+ [reason_name]: ""
+ });
+ }
+ }
+ },
+ fail: err => {
+ console.log(err);
+ }
+ });
+ })
+
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ doUploadPhoto(event) {
+ const { file } = event.detail;
+ this.setData({
+ photoEvent: event,
+ img_cropper_src: file.url,
+ show_cropper: true
+ })
+ this.loadimage()
+ },
+ OSSUpload(fileurl){
+ let event = this.data.photoEvent
+ console.log("index douploadFIle: ", event);
+ const scene = event.currentTarget.dataset.scene;
+ const field_name = event.currentTarget.dataset.field_name;
+ const file_multiple = event.currentTarget.dataset.file_multiple;//是否为多张图
+ console.log("scene: ", scene);
+ console.log("field_name: ", field_name);
+ console.log("file_multiple: ", file_multiple);
+ let _this = this;
+ api.getOssSign({user_type:2,scene:scene}).then(response => {
+ console.log(response);
+ const { file } = event.detail;
+ console.log("file: ", file);
+ const filename = FileUtil.getFileName(file);
+ const host = response.data.host;
+ const signature = response.data.signature;
+ const ossAccessKeyId = response.data.accessid;
+ const policy = response.data.policy;
+ const key = response.data.dir+filename;
+ const filePath = fileurl; // 待上传文件的文件路径。
+ wx.uploadFile({
+ url: host, // 开发者服务器的URL。
+ filePath: filePath,
+ name: 'file', // 必须填file。
+ formData: {
+ key,
+ policy,
+ OSSAccessKeyId: ossAccessKeyId,
+ signature,
+ },
+ success: (res) => {
+ console.log("upload: ", res);
+ let reason_name = field_name + "_reason";//错误原因置空
+ if (res.statusCode === 204) {
+ if(scene == 1){
+ this.setData({
+ is_avatar: true
+ })
+ }
+ wx.showToast({title: '上传成功'})
+ if(file_multiple == "true"){//多张图
+ let img = {}
+ img.url = host+"/"+key;
+ img.isImg = true;
+
+ let img_list = _this.data[field_name];
+ console.log("img_list: ", img_list);
+ img_list.push(img);
+ console.log("img_list: ", img_list);
+
+ reason_name = field_name=='zhiye_file_list'?'license_cert_reason':field_name=='zige_file_list'?'qualification_cert_reason':'work_cert_reason';
+ this.setData({
+ [field_name]: img_list,
+ [reason_name]: ""
+ });
+ }else{
+ this.setData({
+ [field_name]: host+"/"+key,
+ [reason_name]: ""
+ });
+ }
+ }
+ },
+ fail: err => {
+ console.log(err);
+ }
+ });
+ }).catch(errors => {
+ console.error(errors);
+ })
+ },
+ doDeleteFile(event){
+ console.log(event);
+ let url = event.detail.file.url;
+ let file_name = event.currentTarget.dataset.field_name;
+ let img_list = this.data[file_name].filter(item => item.url != url);
+ this.setData({
+ [file_name]: img_list
+ })
+ },
+ moveZhuanChang(){
+
+ },
+ cropperload(e) {
+ console.log("cropper初始化完成");
+ },
+ loadimage(e) {
+ this.cropper = this.selectComponent("#image-cropper");
+ //重置图片角度、缩放、位置
+ this.cropper.imgReset();
+ this.triggerEvent('showPageMeta');
+ },
+ clickcut(e) {
+ console.log(e);
+ // //点击裁剪框阅览图片
+ // wx.previewImage({
+ // current: e.detail.url, // 当前显示图片的http链接
+ // urls: [e.detail.url] // 需要预览的图片http链接列表
+ // })
+
+ this.OSSUpload(e.detail.url)
+ this.setData({
+ show_cropper: false
+ })
+ this.triggerEvent('hidePageMeta');
+ },
}
})
diff --git a/commpents/myprofile/index.json b/commpents/myprofile/index.json
index e2dc8bd..5a43e33 100644
--- a/commpents/myprofile/index.json
+++ b/commpents/myprofile/index.json
@@ -18,6 +18,10 @@
"van-picker": "@vant/weapp/picker/index",
"van-toast": "@vant/weapp/toast/index",
"van-button": "@vant/weapp/button/index",
- "van-icon": "@vant/weapp/icon/index"
+ "van-icon": "@vant/weapp/icon/index",
+ "van-search": "@vant/weapp/search/index",
+ "van-empty": "@vant/weapp/empty/index",
+ "van-image": "@vant/weapp/image/index",
+ "image-cropper": "/commpents/image-cropper/image-cropper"
}
}
diff --git a/commpents/myprofile/index.wxml b/commpents/myprofile/index.wxml
index 88252a7..caf5e1c 100644
--- a/commpents/myprofile/index.wxml
+++ b/commpents/myprofile/index.wxml
@@ -1,18 +1,26 @@
-
+
+
头像 *
-
+
真人正脸
-
+
+
+
+
+ {{ avatar_reason }}
+
+
+
-
+
-
+
+
+ bind:change="onYiYuanChange"
+ />
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+ {{ department_custom_name_reason }}
+
@@ -96,12 +135,18 @@
show="{{ zige_show }}"
closeable
round
+ lock-scroll
position="bottom"
bind:close="onZiGeClose"
>
@@ -109,17 +154,46 @@
show="{{ zhicheng_img_show }}"
closeable
round
+ lock-scroll
position="bottom"
bind:close="onZhiChengImgClose"
>
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
+
- {{iden_auth_status_txt}}
-
\ No newline at end of file
+ {{iden_auth_status_txt}}
+
+
+ {{iden_auth_status_txt}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commpents/myprofile/index.wxss b/commpents/myprofile/index.wxss
index 1569fc4..20ae616 100644
--- a/commpents/myprofile/index.wxss
+++ b/commpents/myprofile/index.wxss
@@ -1,30 +1,43 @@
-.required{
- color: #e34d59;
-}
+
.photo{
position: relative;
- padding: 32rpx;
+ padding: 32rpx 32rpx 32rpx 0;
+ margin-left: 32rpx;
display: flex;
justify-content: space-between;
- font-size: 32rpx;
+ font-size: 34rpx;
font-weight: 400;
align-items: center;
}
-.photo::after {
+.photo_reason{
+ position: relative;
+ padding: 32rpx 32rpx 32rpx 0;
+ margin-left: 32rpx;
+ display: flex;
+ justify-content: space-between;
+ font-size: 34rpx;
+ font-weight: 400;
+ align-items: center;
+}
+.photo_reason::after{
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 0;
- left: 32rpx;
bottom: 0;
border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
transform: scaleY(0.5);
- left: 32rpx;
+ left: 0rpx;
}
+
+.required{
+ color: #e34d59;
+}
+
.title{
- font-size: 30rpx;
- color: #1C2023;
+ font-size: 16px;
+ color: #000000E6;
}
.right{
display: flex;
@@ -81,7 +94,10 @@
color: #49B9AD !important;
}
.t-tabs__track{
- background-color: var(--td-tab-track-color, var(--td-primary-color, #49B9AD)) !important;
+ background-color: #49B9AD !important;
+}
+.t-icon-check{
+ color: #49B9AD !important;
}
.t-cell__note {
font-size: 25rpx !important;
@@ -105,7 +121,7 @@
}
.bottom_next{
width: 95vw;
- margin: 530rpx auto;
+ margin: 530rpx auto 0 auto;
}
.sub_button{
width: 95vw;
@@ -115,7 +131,8 @@
display: flex;
flex-direction: column;
align-items: center;
- height: 600rpx;
+ padding-bottom: 20rpx;
+ min-height: 550rpx;
}
.zhiye_popup_title{
margin-top: 16px;
@@ -125,14 +142,8 @@
}
.zhiye_popup_img{
margin-top: 30rpx;
- width: 300rpx;
- height: 300rpx;
- background-color: cadetblue;
-}
-/* 自定义 vant required 小红点位置 */
-.van-cell--required::before {
- left: 4.7rem !important;
}
+
.zhuanchang_box{
display: flex;
flex-wrap: wrap;
@@ -152,7 +163,6 @@
}
.zhuanchang_block {
width: 100vw;
- height: 240px;
background: #fff;
border-top-left-radius: 16rpx;
border-top-right-radius: 16rpx;
@@ -187,4 +197,70 @@
.zhuanchang_btn--confirm {
color: #3cc7c0;
+}
+.van-picker__columns {
+ height: 264px !important;
+ top: 40px !important;
+}
+.van-search {
+ top: -270px !important;
+ position: relative !important;
+}
+.van-picker__confirm{
+ color: #3cc7c0 !important;
+}
+.van-cell:after {
+ border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
+ bottom: 0;
+ box-sizing: border-box;
+ content: " ";
+ pointer-events: none;
+ position: absolute;
+ width: calc(100vw - 32rpx);
+ transform: scaleY(.5);
+ transform-origin: center;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-bottom-color: var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
+}
+.van-cell {
+ padding: 32rpx !important;
+}
+.jianjie_popup{
+ margin: 100rpx 20rpx;
+}
+.has_error{
+ margin-left: 32rpx;
+ padding-bottom: 20rpx;
+ border-bottom: 1rpx solid #e7e7e7;
+}
+.error_box{
+ position: relative;
+ display: flex;
+ background-color: #FEF1F1;
+ width: calc(95vw - 64rpx);
+ height: 100rpx;
+ margin: 30rpx auto 0 auto;
+ align-items: center;
+ padding-left: 32rpx;
+ border-radius: 10rpx;
+}
+.error_box::after{
+ border-radius: 5rpx;
+ position: absolute;
+ width: 0px;
+ height: 0px;
+ border-width: 16rpx;
+ border-style: solid;
+ border-color: transparent transparent #FEF1F1 transparent;
+ content: ' ';
+ left: 50rpx;
+ top: -30rpx;
+}
+.error_msg{
+ position: relative;
+ margin-left: 10rpx;
+ color: #FF0000;
+ letter-spacing: 3rpx;
+ font-weight: 600;
}
\ No newline at end of file
diff --git a/commpents/navbar/index.js b/commpents/navbar/index.js
index 41d282f..957aaeb 100644
--- a/commpents/navbar/index.js
+++ b/commpents/navbar/index.js
@@ -32,7 +32,7 @@ Component({
//返回到首页
_backhome() {
wx.navigateTo({
- url: '/Pages/index/index',
+ url: '/Pages/index/index?from=navbar',
})
}
}
diff --git a/commpents/te_navbar/index.js b/commpents/te_navbar/index.js
index 36e1021..cadc4e8 100644
--- a/commpents/te_navbar/index.js
+++ b/commpents/te_navbar/index.js
@@ -25,11 +25,24 @@ Component({
*/
methods: {
onBack() {
- wx.navigateBack();
+ console.log("onBackonBackonBack");
+ let back_url = this.data.navbarData.back_url;
+ let back_url_type = this.data.navbarData.back_url_type;
+ if(back_url){
+ if(back_url_type == 0){
+ app.go(back_url);
+ }else{
+ wx.reLaunch({
+ url: back_url,
+ });
+ }
+ }else{
+ wx.navigateBack();
+ }
},
onGoHome() {
wx.reLaunch({
- url: '/Pages/index/index',
+ url: '/Pages/index/index?from=navbar',
});
},
},
diff --git a/commpents/te_navbar/index.wxml b/commpents/te_navbar/index.wxml
index b2f3f45..8203f58 100644
--- a/commpents/te_navbar/index.wxml
+++ b/commpents/te_navbar/index.wxml
@@ -21,12 +21,21 @@
-
+
-
-
-
+
+
+
+
+
diff --git a/commpents/te_navbar/index.wxss b/commpents/te_navbar/index.wxss
index 78c64df..de4d259 100644
--- a/commpents/te_navbar/index.wxss
+++ b/commpents/te_navbar/index.wxss
@@ -20,4 +20,7 @@
width: 1px;
height: 36rpx;
background: #e7e7e7;
+}
+.custom-capsule-home{
+ margin-left: 36rpx;
}
\ No newline at end of file
diff --git a/commpents/textarea-cell/index.js b/commpents/textarea-cell/index.js
index ec83398..1511ee4 100644
--- a/commpents/textarea-cell/index.js
+++ b/commpents/textarea-cell/index.js
@@ -6,19 +6,27 @@ Component({
properties: {
textarea_cell_name: {
type: String,
- value: '示例标题',
+ value: '标题',
},
required: {
type: Boolean,
value: true,
},
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
textarea_cell_note: {
type: String,
- value: '示例备注',
+ value: '查看示例',
+ },
+ textarea_cell_note_show:{
+ type: Boolean,
+ value: true,
},
textarea_cell_content_placeholder: {
type: String,
- value: '示例placeholder',
+ value: '请输入文字',
},
t_icon_name: {
type: String,
@@ -31,7 +39,11 @@ Component({
textarea_val: {
type: String,
value: '',
- }
+ },
+ has_error_content: {
+ type: String,
+ value: "",
+ },
},
/**
diff --git a/commpents/textarea-cell/index.wxml b/commpents/textarea-cell/index.wxml
index 3dc485d..c87eefd 100644
--- a/commpents/textarea-cell/index.wxml
+++ b/commpents/textarea-cell/index.wxml
@@ -1,12 +1,16 @@
{{ textarea_cell_name }} *
-
+
- {{ textarea_cell_note }}
+ {{ textarea_cell_note }}
-
+
+
+
+
+ {{ has_error_content }}
\ No newline at end of file
diff --git a/commpents/textarea-cell/index.wxss b/commpents/textarea-cell/index.wxss
index 701f799..e7c0253 100644
--- a/commpents/textarea-cell/index.wxss
+++ b/commpents/textarea-cell/index.wxss
@@ -25,7 +25,7 @@
.textarea-cell-content{
background-color: #FAFAFA;
width: 95%;
- height: 500rpx;
+ height: 310rpx;
display: flex;
margin: 30rpx auto 0 auto;
}
@@ -42,5 +42,36 @@
left: 32rpx;
}
.textarea-cell-name{
- font-size: 30rpx;
+ font-size: 16px;
+ color: #000000E6;
+}
+.error_box{
+ position: relative;
+ display: flex;
+ background-color: #FEF1F1;
+ width: calc(95vw - 64rpx);
+ height: 100rpx;
+ margin: 30rpx auto 0 auto;
+ align-items: center;
+ padding-left: 32rpx;
+ border-radius: 10rpx;
+}
+.error_box::after{
+ border-radius: 5rpx;
+ position: absolute;
+ width: 0px;
+ height: 0px;
+ border-width: 16rpx;
+ border-style: solid;
+ border-color: transparent transparent #FEF1F1 transparent;
+ content: ' ';
+ left: 50rpx;
+ top: -30rpx;
+}
+.error_msg{
+ position: relative;
+ margin-left: 10rpx;
+ color: #FF0000;
+ letter-spacing: 3rpx;
+ font-weight: 600;
}
\ No newline at end of file
diff --git a/commpents/upload-cell/index.js b/commpents/upload-cell/index.js
index 72c9b16..7edcc27 100644
--- a/commpents/upload-cell/index.js
+++ b/commpents/upload-cell/index.js
@@ -12,10 +12,26 @@ Component({
type: Boolean,
value: true,
},
+ disabled: {
+ type: Boolean,
+ value: false,
+ },
upload_cell_note: {
type: String,
value: '示例备注',
},
+ static_host: {
+ type: String,
+ value: 'static_host',
+ },
+ upload_cell_note_show:{
+ type: Boolean,
+ value: true,
+ },
+ deletable:{
+ type: Boolean,
+ value: true,
+ },
upload_cell_desc: {
type: String,
value: '示例描述',
@@ -28,9 +44,9 @@ Component({
type: String,
value: '32rpx',
},
- has_error: {
- type: Boolean,
- value: false,
+ has_error_content: {
+ type: String,
+ value: "",
},
fileList:{
type: Array,
@@ -39,6 +55,10 @@ Component({
max_count:{
type: Number,
value: 1
+ },
+ is_multiple:{
+ type: Boolean,
+ value: false,
}
},
diff --git a/commpents/upload-cell/index.wxml b/commpents/upload-cell/index.wxml
index 113b69f..7b26e20 100644
--- a/commpents/upload-cell/index.wxml
+++ b/commpents/upload-cell/index.wxml
@@ -1,21 +1,21 @@
{{ upload_cell_name }} *
-
+
- {{ upload_cell_note }}
+ {{ upload_cell_note }}
{{ upload_cell_desc }}
-
-
+
+
-
-
- 拒绝原因照片不清晰
+
+
+ {{ has_error_content }}
\ No newline at end of file
diff --git a/commpents/upload-cell/index.wxss b/commpents/upload-cell/index.wxss
index 8ad4f31..ac55a8b 100644
--- a/commpents/upload-cell/index.wxss
+++ b/commpents/upload-cell/index.wxss
@@ -37,6 +37,7 @@
.upload-cell-desc{
color: #999999;
margin: 20rpx 0;
+ font-size: 30rpx;
}
.error_box{
position: relative;
@@ -69,5 +70,6 @@
font-weight: 600;
}
.upload-cell-name{
- font-size: 30rpx;
+ font-size: 16px;
+ color: #000000E6;
}
\ No newline at end of file
diff --git a/commpents/wenzhen_data/index.js b/commpents/wenzhen_data/index.js
index 5e23a8e..c3118ed 100644
--- a/commpents/wenzhen_data/index.js
+++ b/commpents/wenzhen_data/index.js
@@ -1,9 +1,16 @@
+import { API } from "../../utils/network/api";
+const api = new API()
+const app = getApp()
// commpents/wenzhen_data/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
+ from_account: {
+ type: String,
+ value: '10000',
+ },
name: {
type: String,
value: '张三三',
@@ -23,6 +30,11 @@ Component({
desc: {
type: String,
value: '这是示例备注desc',
+ observer(desc) {
+ this.setData({
+ desc: desc,
+ });
+ },
},
status_text: {
type: String,
@@ -35,10 +47,27 @@ Component({
status_class: {
type: String,
},
+ order_inquiry_id: {
+ type: String,
+ value: '',
+ },
+ inquiry_type: {
+ type: String,
+ value: '',
+ },
note: {
type: String,
value: '不接诊24小时后自动取消',
},
+ message_dot:{
+ type: Boolean,
+ value: false,
+ observer(dot) {
+ this.setData({
+ message_dot: dot,
+ });
+ },
+ }
},
/**
@@ -53,23 +82,44 @@ Component({
*/
methods: {
go(e){
- wx.navigateTo({
- url: e.currentTarget.dataset.url,
- events: {
- // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
- acceptDataFromOpenedPage: function(data) {
- console.log(data)
- },
- someEvent: function(data) {
- console.log(data)
- }
- },
- success: function(res) {
- // 通过 eventChannel 向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
+ app.go(e.currentTarget.dataset.url);
+ },
+ goChat(e){
+ this.setData({
+ show: false
+ })
+
+ console.log("开始订阅消息");
+ wx.requestSubscribeMessage({
+ tmplIds: ['jhYUf91ULCTX_f69hazqAYwImdFf8ELasRAwB6X-MTM'],
+ success (res) {
+ console.log(res);
+ let from_account = e.currentTarget.dataset.from_account;
+ let order_inquiry_id = e.currentTarget.dataset.order_inquiry_id;
+ let inquiry_type = e.currentTarget.dataset.inquiry_type;
+ let url = e.currentTarget.dataset.url+"?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type;
+ app.go(url);
}
})
},
+ postDoctorInquiry(e){
+ this.setData({
+ show: false
+ })
+ console.log("order_inquiry_id: ", e.currentTarget.dataset.order_inquiry_id);
+ let params = {};
+ params.order_inquiry_id = e.currentTarget.dataset.order_inquiry_id;
+ console.log("params: ",params)
+ api.postDoctorInquiry(params).then(response => {
+ console.log("开始接诊");
+ console.log(response);
+ }).then(() => {
+ this.goChat(e);
+ }).catch(errors => {
+ console.error(errors);
+ })
+
+ },
tabShow(){
this.setData({
show: true
diff --git a/commpents/wenzhen_data/index.json b/commpents/wenzhen_data/index.json
index 4c7316e..89103e5 100644
--- a/commpents/wenzhen_data/index.json
+++ b/commpents/wenzhen_data/index.json
@@ -2,6 +2,7 @@
"component": true,
"usingComponents": {
"van-button": "@vant/weapp/button/index",
- "van-popup": "@vant/weapp/popup/index"
+ "t-badge": "tdesign-miniprogram/badge/badge",
+ "t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
diff --git a/commpents/wenzhen_data/index.wxml b/commpents/wenzhen_data/index.wxml
index 513d8cb..90aa8c5 100644
--- a/commpents/wenzhen_data/index.wxml
+++ b/commpents/wenzhen_data/index.wxml
@@ -1,29 +1,44 @@
- 就诊人:{{name}} {{sex}}|{{age}}岁
+
+ 就诊人:
+ {{name}} {{sex}}|{{age}}
+
{{date}}
{{desc}}
- {{status_text}}
-
- 查看病历
- 去接诊
+ {{ status_text }}
+
+ 查看病历
+ 去接诊
-
- 问诊详情
+
+ 问诊详情
+
- {{note}}
+ {{note}}
-
+
+
+
+ 去查看
+ 去接诊
+
\ No newline at end of file
diff --git a/commpents/wenzhen_data/index.wxss b/commpents/wenzhen_data/index.wxss
index 72f6b37..3b54795 100644
--- a/commpents/wenzhen_data/index.wxss
+++ b/commpents/wenzhen_data/index.wxss
@@ -16,6 +16,8 @@
.name{
font-size: 30rpx;
color: #666666;
+ height: 50rpx;
+ line-height: 50rpx;
}
.date{
font-size: 30rpx;
@@ -27,6 +29,11 @@
color: #999999;
min-height: 70rpx;
padding: 10rpx 20rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display: block;
+ line-height: 70rpx;
}
.status{
font-size: 26rpx;
@@ -39,8 +46,7 @@
.btn{
flex: 2;
display: flex;
- justify-content: space-around;
-
+ justify-content: flex-end;
}
.content_4{
flex: 5;
@@ -53,36 +59,29 @@
border-top: 1px solid #E3E4E5;
align-items: center;
margin: 0 30rpx;
- min-height: 50rpx;
+ min-height: 70rpx;
}
-.pop_content{
+.dialog{
+ width: 50%;
text-align: center;
- display: flex;
- flex-direction: column;
- width: 80vw;
+ height: 100rpx;
+ line-height: 100rpx;
}
-.pop_title{
- font-size: 34rpx;
- color: #333333;
- padding: 30rpx 20rpx;
+.dialog_cancel_btn{
+ border-top: 1px solid #E9E9E9;
+ border-right: 1px solid #E9E9E9;
}
-.pop_note{
- font-size: 32rpx;
- color: #999999;
- padding: 0rpx 20rpx 30rpx 20rpx;
+.dialog_confirm_btn{
+ border-top: 1px solid #E9E9E9;
+ color: #3CC7C0;
}
-.pop_btn{
- display: flex;
- border-top: 1px solid #E3E4E5;
+.t-badge__content-text {
+ line-height: 70rpx !important;
+ background-color: #E34D59 !important;
}
-.pop_btn_left{
- flex: 1;
- border-right: 1px solid #E3E4E5;
- padding: 30rpx 0rpx;
- color: #999999;
-}
-.pop_btn_right{
- flex: 1;
- color: #49B9AD;
- padding: 30rpx 0rpx;
+.t-badge{
+ background-color: burlywood !important;
}
+.t-badge__content,.t-class-content{
+ background-color: crimson !important;
+}
\ No newline at end of file
diff --git a/commpents/yishi_navbar/index.js b/commpents/yishi_navbar/index.js
index 41d282f..957aaeb 100644
--- a/commpents/yishi_navbar/index.js
+++ b/commpents/yishi_navbar/index.js
@@ -32,7 +32,7 @@ Component({
//返回到首页
_backhome() {
wx.navigateTo({
- url: '/Pages/index/index',
+ url: '/Pages/index/index?from=navbar',
})
}
}
diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js
index 3ad8a0b..da3d5ba 100644
--- a/custom-tab-bar/index.js
+++ b/custom-tab-bar/index.js
@@ -1,4 +1,5 @@
// custom-tab-bar/index.js
+const app = getApp()
Component({
/**
@@ -10,57 +11,107 @@ Component({
"backgroundColor": "#ffffff",
"selectedColor": "#fff",
"listAll": {
- "list2":[
+ "list1":[
{
"pagePath": "/Pages/yaoshi/home/home",
"text": "首页",
"iconPath": "/static/images/yaoshi/tabbar_icon/home.png",
- "selectedIconPath": "/static/images/yaoshi/tabbar_icon/home_select.png"
+ "selectedIconPath": "/static/images/yaoshi/tabbar_icon/home_select.png",
+ "info": ""
},
{
"pagePath": "/Pages/yaoshi/my/my",
"text": "我的",
"iconPath": "/static/images/yaoshi/tabbar_icon/my.png",
- "selectedIconPath": "/static/images/yaoshi/tabbar_icon/my_select.png"
+ "selectedIconPath": "/static/images/yaoshi/tabbar_icon/my_select.png",
+ "info": ""
}],
- "list1":[
+ "list2":[
{
"pagePath": "/Pages/yishi/index/index",
- "text": "首页(Y)",
+ "text": "首页",
"iconPath": "/static/images/yishi/tabbar_icon/index.png",
- "selectedIconPath": "/static/images/yishi/tabbar_icon/index_select.png"
+ "selectedIconPath": "/static/images/yishi/tabbar_icon/index_select.png",
+ "info": ""
},
{
- "pagePath": "/Pages/yishi/wenzhen/wenzhen",
- "text": "问诊(Y)",
+ "pagePath": "/Pages/yishi/wenzhen_v2/wenzhen",
+ "text": "问诊",
"iconPath": "/static/images/yishi/tabbar_icon/wenzhen.png",
- "selectedIconPath": "/static/images/yishi/tabbar_icon/wenzhen_select.png"
+ "selectedIconPath": "/static/images/yishi/tabbar_icon/wenzhen_select.png",
+ "info": "99"
},
{
"pagePath": "/Pages/yishi/my/index",
- "text": "我的(Y)",
+ "text": "我的",
"iconPath": "/static/images/yishi/tabbar_icon/my.png",
- "selectedIconPath": "/static/images/yishi/tabbar_icon/my_select.png"
+ "selectedIconPath": "/static/images/yishi/tabbar_icon/my_select.png",
+ "info": ""
}]
},
items: [ ],
dialog_visible: false,
- dialog_content: ""
+ dialog_content: "",
+ usertype: 2,
+ index_info: "",
+ wenzhen_info: "",
+ my_info: "",
+ next_url: "/Pages/yishi/identity/index",
+ info_inter: 0
},
- attached() {
- const usertype = wx.getStorageSync('usertype')
- console.log("usertype: " ,usertype);
- if (usertype == 2) {
- this.setData({
- items: this.data.listAll.list1
- })
- }else{
+
+ lifetimes: {
+ attached(){
this.setData({
+ usertype: 2,
items: this.data.listAll.list2
})
- }
+ },
+ ready() {
+ const usertype = wx.getStorageSync('usertype')
+ if (usertype == 3) {
+ this.setData({
+ usertype: 3,
+ items: this.data.listAll.list1
+ })
+ }else{
+ this.setData({
+ usertype: 2,
+ items: this.data.listAll.list2
+ })
+ }
+ },
},
+
methods: {
+ startInterval(){
+ let _this = this;
+ const usertype = wx.getStorageSync('usertype')
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let info_inter = setInterval(() => {
+ if(app.globalData.config.userID == userID){
+ let index_info = wx.getStorageSync(userID+'_index_info');
+ let wenzhen_info = wx.getStorageSync(userID+'_wenzhen_info');
+ let my_info = wx.getStorageSync(userID+'_my_info');
+ _this.setData({
+ index_info: this.formatNum(index_info),
+ wenzhen_info: this.formatNum(wenzhen_info),
+ my_info: this.formatNum(my_info),
+ })
+ }
+ }, 500);
+ this.setData({
+ info_inter: info_inter
+ })
+ },
+ stopInterval(){
+ clearInterval(this.data.info_inter)
+ },
+ formatNum(val){
+ if(val > 99) val = '+99';
+ if(val == 0) val = '';
+ return val;
+ },
// swichNav: function (e) {
// console.log(123);
// let that = this;
@@ -77,27 +128,54 @@ Component({
// }
// },
onChange(e) {
- // this.setData({
- // dialog_visible: true,
- // dialog_content: "测试"
- // })
- console.log("custom tab bar onChange");
- // return;
- let url = this.data.items[e.detail].pagePath
+ const usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let idcard_status = wx.getStorageSync(userID+'_idcard_status');
+ let iden_auth_status = wx.getStorageSync(userID+'_iden_auth_status');
+ let multi_point_status = wx.getStorageSync(userID+'_multi_point_status');
+ let is_bind_bank = wx.getStorageSync(userID+'_is_bind_bank');
+
+ if(idcard_status != 1 && usertype != 3){
+ this.setData({
+ dialog_visible: true,
+ dialog_content: "请您先完成实名认证",
+ next_url: "/Pages/yishi/identity/index",
+ })
+ return;
+ }
+ if(iden_auth_status != 1 && usertype != 3){
+ this.setData({
+ dialog_visible: true,
+ dialog_content: "请您先医师身份认证",
+ next_url: "/Pages/yishi/identity/index?selected_tab=1",
+ })
+ return;
+ }
+ if(is_bind_bank != 1 && usertype != 3){
+ this.setData({
+ dialog_visible: true,
+ dialog_content: "请您先绑定结算银行卡",
+ next_url: "/Pages/yishi/bankcard/index"
+ })
+ return;
+ }
+ let url = this.data.items[e.detail].pagePath;
wx.switchTab({
url: url,
})
- },
- confirmDialog(){
- this.setData({
- dialog_visible: false
- })
- },
- cancelDialog(){
- this.setData({
- dialog_visible: false
- })
- },
- }
+ },
+ confirmDialog(){
+ this.setData({
+ dialog_visible: false
+ })
+ let next_url = this.data.next_url;
+ app.go(next_url);
+ },
+ cancelDialog(){
+ this.setData({
+ dialog_visible: false
+ })
+ },
+ }
})
\ No newline at end of file
diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml
index 6fee57f..e5d1f3f 100644
--- a/custom-tab-bar/index.wxml
+++ b/custom-tab-bar/index.wxml
@@ -1,26 +1,97 @@
-
-
-
+
+
+
+
- {{item.text}}
+ {{listAll.list2[0].text}}
+
+
+
+
+
+ {{listAll.list2[1].text}}
+
+
+
+
+
+ {{listAll.list2[2].text}}
+
+
+
+
+
+
+
+ {{listAll.list1[0].text}}
+
+
+
+
+ {{listAll.list1[1].text}}
确定
-
\ No newline at end of file
+
diff --git a/filters/filter.wxs b/filters/filter.wxs
new file mode 100644
index 0000000..40d3c6e
--- /dev/null
+++ b/filters/filter.wxs
@@ -0,0 +1,70 @@
+
+function numberTOstring(value){
+ if(value==null) return null;
+ return value.toString();
+};
+function formatwenzhenList(arr,type){
+ var obj=null;
+ for (var i = 0; i < arr.length; ++i) {
+ if(arr[i]==type){
+ return {NUMBER:i+1,ISHAS:true}
+ }
+ };
+ return {ISHAS:false}
+ };
+ function transforDay(time, type) {
+ if (time == null || type == '') {
+ return ''
+ }
+ if (arguments.length === 0) {
+ return null
+ }
+ var time_cur=0
+ if(typeof time=="string"){
+ var reg = getRegExp("-", "g");
+ var timeS=time.replace(reg, '/');
+ time_cur = getDate(timeS).getTime();
+ }else{
+ time_cur=time*1000
+ }
+ var date = getDate(time_cur);//在wxs中不能使用new Date()来处理日期
+ console.log("date", date);
+ var y = date.getFullYear();
+ var m = addZero(date.getMonth() + 1);
+ var d = addZero(date.getDate());
+ var h =addZero(date.getHours());
+ var i = addZero(date.getMinutes());
+ var s =addZero(date.getSeconds());
+ var a = addZero(date.getDay());
+ var time_str = "";
+ if (type == 'month') {
+ time_str = y + '-' + m;
+ }else if(type=='day'){
+ time_str = m + '-' + d;
+ } else if(type=='HM'){
+ time_str =h + ':' + s;
+ }else if (type == 'date') {
+ time_str = y + '-' + m + '-' + d;
+ }else if(type=='noyear'){
+ time_str =m + '-' + d + ' ' + h + ':' + i
+ }else if(type == 'dateminute'){
+ time_str = y + '-' + m + '-' + d + ' ' + h + ':' + i
+ }else if (type == 'datetime') {
+ time_str = y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s;
+ } else if (type == 'onlyMonth') {
+ time_str = m;
+ } else if (type == 'onlyYear') {
+ time_str = y;
+ }
+ return time_str
+ };
+ function addZero(n) {
+ n = n.toString()
+ return n[1] ? n : '0' + n
+ };
+
+module.exports = {
+ formatwenzhenList:formatwenzhenList,
+ numberTOstring:numberTOstring,
+ transforDay:transforDay
+};
\ No newline at end of file
diff --git a/miniprogram_npm/@vant/weapp/tabs/index.js b/miniprogram_npm/@vant/weapp/tabs/index.js
index e16ace9..e30d6a8 100644
--- a/miniprogram_npm/@vant/weapp/tabs/index.js
+++ b/miniprogram_npm/@vant/weapp/tabs/index.js
@@ -80,7 +80,7 @@ var relation_1 = require("../common/relation");
},
swipeThreshold: {
type: Number,
- value: 5,
+ value: 4,
observer: function (value) {
this.setData({
scrollable: this.children.length > value || !this.data.ellipsis,
diff --git a/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js
index 4943c45..f6fdc51 100644
--- a/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js
+++ b/miniprogram_npm/tdesign-miniprogram/cascader/cascader.js
@@ -119,8 +119,11 @@ let Cascader = class Cascader extends SuperComponent {
});
}
},
- hide() {
+ hide(e) {
this.setData({ visible: false });
+ if(e != false){
+ this.triggerEvent('close');
+ }
},
onStepClick(e) {
const { index } = e.currentTarget.dataset;
@@ -157,7 +160,7 @@ let Cascader = class Cascader extends SuperComponent {
selectedOptions: items.map((item, index) => item[selectedIndexes[index]]),
});
});
- this.hide();
+ this.hide(false);
}
},
};
diff --git a/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss
index b4e5ea5..47962de 100644
--- a/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss
+++ b/miniprogram_npm/tdesign-miniprogram/cell/cell.wxss
@@ -79,7 +79,7 @@
}
.t-cell__title-text {
display: flex;
- font-size: 32rpx;
+ font-size: 16px;
font-weight: 400;
}
.t-cell__left,
diff --git a/miniprogram_npm/tdesign-miniprogram/navbar/navbar.js b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.js
index fb8e0f9..b222517 100644
--- a/miniprogram_npm/tdesign-miniprogram/navbar/navbar.js
+++ b/miniprogram_npm/tdesign-miniprogram/navbar/navbar.js
@@ -96,8 +96,6 @@ let Navbar = class Navbar extends SuperComponent {
success: (res) => {
const boxStyleList = [];
const { statusBarHeight } = wx.getSystemInfoSync();
- console.log("statusBarHeight: ", statusBarHeight);
- console.log("${rect.height}px: ", `${rect.height}`);
boxStyleList.push(`--td-navbar-padding-top:${statusBarHeight}px`);
if (rect && (res === null || res === void 0 ? void 0 : res.windowWidth)) {
boxStyleList.push(`--td-navbar-right:${res.windowWidth - rect.left}px`);
diff --git a/project.private.config.json b/project.private.config.json
index 21b462b..f83046b 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -1,9 +1,8 @@
{
- "projectname": "test_miniprogram2",
+ "projectname": "miniprogram-doctor",
"setting": {
"compileHotReLoad": true,
- "urlCheck": false,
- "bigPackageSizeSupport": false
+ "urlCheck": true
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"condition": {
@@ -19,5 +18,5 @@
]
}
},
- "libVersion": "2.30.2"
+ "libVersion": "3.0.1"
}
\ No newline at end of file
diff --git a/static/images/yishi/tabbar_icon/check_sugar.png b/static/images/yishi/tabbar_icon/check_sugar.png
new file mode 100644
index 0000000..bfed72a
Binary files /dev/null and b/static/images/yishi/tabbar_icon/check_sugar.png differ
diff --git a/static/images/yishi/tabbar_icon/empty.png b/static/images/yishi/tabbar_icon/empty.png
new file mode 100644
index 0000000..4958f70
Binary files /dev/null and b/static/images/yishi/tabbar_icon/empty.png differ
diff --git a/static/images/yishi/tabbar_icon/medinceList.png b/static/images/yishi/tabbar_icon/medinceList.png
new file mode 100644
index 0000000..0f9d0c8
Binary files /dev/null and b/static/images/yishi/tabbar_icon/medinceList.png differ
diff --git a/static/images/yishi/tabbar_icon/ss.png b/static/images/yishi/tabbar_icon/ss.png
new file mode 100644
index 0000000..6276d5d
Binary files /dev/null and b/static/images/yishi/tabbar_icon/ss.png differ
diff --git a/static/images/yishi/tabbar_icon/wenzhenform.png b/static/images/yishi/tabbar_icon/wenzhenform.png
new file mode 100644
index 0000000..a1db918
Binary files /dev/null and b/static/images/yishi/tabbar_icon/wenzhenform.png differ
diff --git a/static/images/yishi/tabbar_icon/wenzhenicon.png b/static/images/yishi/tabbar_icon/wenzhenicon.png
new file mode 100644
index 0000000..92bdc46
Binary files /dev/null and b/static/images/yishi/tabbar_icon/wenzhenicon.png differ
diff --git a/static/images/yishi/tabbar_icon/zhiyao.png b/static/images/yishi/tabbar_icon/zhiyao.png
new file mode 100644
index 0000000..e357366
Binary files /dev/null and b/static/images/yishi/tabbar_icon/zhiyao.png differ
diff --git a/utils/debounce.js b/utils/debounce.js
new file mode 100644
index 0000000..baf1c57
--- /dev/null
+++ b/utils/debounce.js
@@ -0,0 +1,15 @@
+function debounce(fn,wait=1500){
+ var flag = true;
+ var timer = null;
+ return function(){
+ if(flag) {
+ fn.apply(this,arguments);
+ flag = false;
+ timer = setTimeout(() => {
+ flag = true
+ },wait)
+ }
+ }
+}
+
+export default debounce
\ No newline at end of file
diff --git a/utils/network/api.js b/utils/network/api.js
index e32955e..5455ddd 100644
--- a/utils/network/api.js
+++ b/utils/network/api.js
@@ -4,10 +4,16 @@ class API extends HTTP {
getStaticHost(){
return `${this.staticHost}`;
}
+ getIMappId(){
+ return `${this.IMappId}`;
+ }
+ getIMsecretkey(){
+ return `${this.IMsecretkey}`;
+ }
//获取oss签名数据
getOssSign(params) {
return this.request({
- url: `${this.baseUrl}/oss/sign`,
+ url: `${this.baseUrl}/sign/oss`,
method: 'GET',
data: {
...params
@@ -21,8 +27,7 @@ class API extends HTTP {
method: 'GET',
data: {
...params
- },
- showLoading: false
+ }
})
}
//获取城市信息
@@ -32,8 +37,7 @@ class API extends HTTP {
method: 'GET',
data: {
...params
- },
- showLoading: false
+ }
})
}
//获取区县信息
@@ -43,8 +47,7 @@ class API extends HTTP {
method: 'GET',
data: {
...params
- },
- showLoading: false
+ }
})
}
//获取医院数据
@@ -54,8 +57,7 @@ class API extends HTTP {
method: 'GET',
data: {
...params
- },
- showLoading: false
+ }
})
}
//获取自定义科室数据
@@ -65,8 +67,7 @@ class API extends HTTP {
method: 'GET',
data: {
...params
- },
- showLoading: false
+ }
})
}
//获取医生专长列表
@@ -76,8 +77,7 @@ class API extends HTTP {
method: 'GET',
data: {
...params
- },
- showLoading: false
+ }
})
}
//使用微信手机号登陆
@@ -234,10 +234,20 @@ class API extends HTTP {
})
}
//获取提现数据
- getDoctorWithdrawal(params) {
+ postDoctorWithdrawalInfo(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/withdrawal/info`,
+ method: 'POST',
+ data: {
+ ...params
+ }
+ })
+}
+ //发起提现
+ postDoctorWithdrawal(params) {
return this.request({
url: `${this.baseUrl}/doctor/withdrawal`,
- method: 'GET',
+ method: 'POST',
data: {
...params
}
@@ -362,6 +372,38 @@ class API extends HTTP {
...params
}
})
+}
+ //获取处方详情
+ getDoctorPrescriptionInfo(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/prescription/info`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //修改处方
+ putDoctorPrescription(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/prescription`,
+ method: 'PUT',
+ contentType: 'application/json',
+ data: {
+ ...params
+ }
+ })
+}
+ //新增处方
+ postDoctorPrescription(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/prescription`,
+ method: 'POST',
+ contentType: 'application/json',
+ data: {
+ ...params
+ }
+ })
}
//获取操作手册列表
getBasicOperationManual(params) {
@@ -404,6 +446,18 @@ class API extends HTTP {
...params
}
})
+}
+ //删除常用语列表
+ delDoctorWords(params) {
+ let doctor_words_id = params.doctor_words_id;
+ params = {};
+ return this.request({
+ url: `${this.baseUrl}/doctor/words/`+doctor_words_id,
+ method: 'DELETE',
+ data: {
+ ...params
+ }
+ })
}
//搜索疾病分类-系统
getBasicDiseaseSearch(params) {
@@ -414,6 +468,16 @@ class API extends HTTP {
...params
}
})
+}
+ //搜索疾病分类-平台
+ getBasicIcdSearch(params) {
+ return this.request({
+ url: `${this.baseUrl}/basic/icd/search`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
}
//搜索药品
getBasicProductSearch(params) {
@@ -435,6 +499,421 @@ class API extends HTTP {
}
})
}
+ //获取医生问诊消息列表
+ getDoctorInquiryMessage(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/inquiry/message`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取医生问诊消息用户属性
+ getDoctorInquiryMessageAttr(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/inquiry/message/attr`,
+ method: 'POST',
+ data: {
+ ...params
+ },
+ showLoading: false
+ })
+}
+ //获取患者问诊病例
+ getDoctorInquiryCase(params) {
+ return this.request({
+ url: `${this.baseUrl}/case`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取患者问诊病例
+ getCase(params) {
+ return this.request({
+ url: `${this.baseUrl}/case`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取im签名数据
+ getSignIM(params) {
+ let usertype = wx.getStorageSync('usertype');
+ let userID = wx.getStorageSync('user_id_'+usertype);
+ let imsign = wx.getStorageSync(userID + '_imsign');
+ console.log("缓存中的imsign:", imsign)
+
+ if(imsign){
+ const date = imsign.date;
+ var minute = 1000 * 60;
+ var hour = minute *60;
+ var day = hour *24;
+ if(new Date().getTime() - date < day){
+ console.log("小于一天从缓存中获取imsign")
+ return new Promise((resolve, reject) => {
+ resolve({"data": imsign.sign,"from":"cache"})
+ })
+ }
+ }
+
+ return this.request({
+ url: `${this.baseUrl}/sign/im`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+
+ //药师基本资料
+ getPharmacistInfo(params) {
+ return this.request({
+ url: `${this.baseUrl}/pharmacist/info`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //药师端-首页
+ getPharmacistIndex(params) {
+ return this.request({
+ url: `${this.baseUrl}/pharmacist/index`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取药师审核处方列表
+ getPharmacistPrescription(params) {
+ return this.request({
+ url: `${this.baseUrl}/pharmacist/prescription`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取处方详情
+ getPharmacistPrescriptioninfo(params) {
+ let order_prescription_id = params.order_prescription_id;
+ params = {}
+ return this.request({
+ url: `${this.baseUrl}/pharmacist/prescription/info/`+order_prescription_id,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //设置上下线 药师端
+ putPharmacistOnOff(params) {
+ return this.request({
+ url: `${this.baseUrl}/pharmacist/on-off`,
+ method: 'PUT',
+ data: {
+ ...params
+ }
+ })
+}
+ //药师基本资料
+ getPharmacistInfo(params) {
+ return this.request({
+ url: `${this.baseUrl}/pharmacist/info`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //审核处方
+ putPharmacistPrescriptionVerify(params) {
+ let order_prescription_id = params.order_prescription_id;
+ delete params['order_prescription_id'];
+ return this.request({
+ url: `${this.baseUrl}/pharmacist/prescription/verify/`+order_prescription_id,
+ method: 'PUT',
+ data: {
+ ...params
+ }
+ })
+}
+ //医生接诊
+ postDoctorInquiry(params) {
+ let order_inquiry_id = params.order_inquiry_id;
+ delete params['order_inquiry_id'];
+ return this.request({
+ url: `${this.baseUrl}/doctor/inquiry/`+order_inquiry_id,
+ method: 'POST',
+ data: {
+ ...params
+ }
+ })
+}
+ //结束问诊
+ putDoctorInquiryFinish(params) {
+ let order_inquiry_id = params.order_inquiry_id;
+ params = {}
+ return this.request({
+ url: `${this.baseUrl}/inquiry/finish/`+order_inquiry_id,
+ method: 'PUT',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取问诊订单消息内页基础数据
+ getInquiryMessageBasic(params) {
+ let order_inquiry_id = params.order_inquiry_id;
+ params = {}
+ return this.request({
+ url: `${this.baseUrl}/inquiry/message/basic/`+order_inquiry_id,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取医生消息页通知数据-医生
+ getDoctorMessageNotice(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/message/notice`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取医生服务消息列表-分页
+ getDoctorMessageService(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/message/service`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取医生系统公告列表-分页
+ getDoctorMessageSystem(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/message/system`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取医生系统公告详情
+ getDoctorMessageSystemDetail(params) {
+ let notice_id = params.notice_id;
+ params = {}
+ return this.request({
+ url: `${this.baseUrl}/doctor/message/system/`+notice_id,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //消息已读
+ putMessageReadNotice(params) {
+ let notice_id = params.notice_id;
+ params = {}
+ return this.request({
+ url: `${this.baseUrl}/message/notice/read/`+notice_id,
+ method: 'PUT',
+ data: {
+ ...params
+ }
+ })
+}
+ //一键消息已读
+ putMessageReadNoticeAll(params) {
+ return this.request({
+ url: `${this.baseUrl}/message/notice/read`,
+ method: 'PUT',
+ data: {
+ ...params
+ }
+ })
+}
+ //结束问诊会话列表
+ getDoctorInquiryFinishMessage(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/inquiry/finish/message`,
+ method: 'GET',
+ data: {
+ ...params
+ },
+ showLoading: false
+ })
+}
+ //获取协议内容
+ getBasicAgreement(params) {
+ let agreement_id = params.agreement_id;
+ params = {}
+ return this.request({
+ url: `${this.baseUrl}/basic/agreement/`+agreement_id,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取弹窗
+ getPopup(params) {
+ let agreement_id = params.agreement_id;
+ params = {}
+ return this.request({
+ url: `${this.baseUrl}/popup`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //检测是否可以开具处方
+ getDoctorPrescriptionCheck(params) {
+ return this.request({
+ url: `${this.baseUrl}/doctor/prescription/check`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+ //获取医生职称数据
+ getBasicDoctorTitle(params) {
+ return this.request({
+ url: `${this.baseUrl}/basic/doctor/title`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+//药品清单
+ getMedinceList(params) {
+ return this.request({
+ url: `${this.baseUrl}/basic/product`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+//获取患者最后一条问诊订单id
+getLastInquiry(params) {
+ return this.request({
+ url: `${this.baseUrl}/inquiry/last`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+//获取配置
+getConfig() {
+ return this.request({
+ url: `${this.baseUrl}/user/system`,
+ method: 'GET'
+ })
+}
+
+//获取配置
+editConfig(params) {
+ return this.request({
+ url: `${this.baseUrl}/user/system`,
+ method: 'PUT',
+ data: {
+ ...params
+ }
+ })
+}
+//获取问诊订单病例详情-基础
+getSimpleInquiry(params) {
+ return this.request({
+ url: `${this.baseUrl}/case/inquiry/simple`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+getInquiryDetail(params) {//获取问诊订单病例详情
+ return this.request({
+ url: `${this.baseUrl}/case/inquiry`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+getPathography(params) {//获取家庭成员病情记录列表-分页
+ return this.request({
+ url: `${this.baseUrl}/patient/pathography`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+getPathographyDetail(id) {//获取家庭成员病情记录列表-分页
+ return this.request({
+ url: `${this.baseUrl}/patient/pathography/${id}`,
+ method: 'GET'
+ })
+}
+
+getUnfilled(params) {//获取问诊订单病例缺少字段
+ return this.request({
+ url: `${this.baseUrl}/case/fields/unfilled`,
+ method: 'GET',
+ data: {
+ ...params
+ }
+ })
+}
+doctorSendUnfilled(params) {//医生发送缺少字段至患者
+ return this.request({
+ url: `${this.baseUrl}/case/fields/doctor`,
+ method: 'POST',
+ data: {
+ ...params
+ }
+ })
+}
+ patientSendFilled(params) {//患者填写缺少字段至医生
+ return this.request({
+ url: `${this.baseUrl}/case/fields/patient`,
+ method: 'POST',
+ data: {
+ ...params
+ }
+ })
+}
+getNation() {//获取名族
+ return this.request({
+ url: `${this.baseUrl}/basic/nation`,
+ method: 'GET'
+ })
+}
+getJob() {//获取职业
+ return this.request({
+ url: `${this.baseUrl}/basic/job`,
+ method: 'GET'
+ })
+}
+
+
+
+
}
export { API }
diff --git a/utils/network/config.js b/utils/network/config.js
index f9818ff..bbf6cfd 100644
--- a/utils/network/config.js
+++ b/utils/network/config.js
@@ -1,19 +1,22 @@
// 开发环境url
export const dev = {
baseUrl: "https://dev.hospital.applets.igandanyiyuan.com",
- staticHost: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com",//静态资源host
- appId: 'wxbdb4d63f81d98228' //此处为appId
+ staticHost: "https://img.applets.igandanyiyuan.com",//静态资源host
+ IMappId: '1400798221', //此处为IM appId
+ IMsecretkey: 'fc45ab469ca632a700166973d87b3a6f56a855cb92d7cffb54e4d37135c097da' //此处为IM secretkey
}
// 测试环境url
export const test = {
- baseUrl: "http://www.xxx.com",
- staticHost: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com",//静态资源host
- appId: 'wxbdb4d63f81d98228' //此处为appId
+ baseUrl: "https://dev.hospital.applets.igandanyiyuan.com",
+ staticHost: "https://img.applets.igandanyiyuan.com",//静态资源host
+ IMappId: '1400798221', //此处为此处为IM appId
+ IMsecretkey: 'fc45ab469ca632a700166973d87b3a6f56a855cb92d7cffb54e4d37135c097da' //此处为IM secretkey
}
// 线上环境url
export const prod = {
- baseUrl: 'https://www.xxx.com',
- staticHost: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com",//静态资源host
- appId: 'wxbdb4d63f81d98228' //此处为appId
+ baseUrl: 'https://prod.hospital.applets.igandanyiyuan.com',
+ staticHost: "https://oss.prod.applets.igandanyiyuan.com",//静态资源host
+ IMappId: '1400796919', //此处为此处为IM appId
+ IMsecretkey: 'a5bcd8c583181cf004e9d91a47687d719d4b5d2a10ce33fbee95d587889447d8' //此处为IM secretkey
}
diff --git a/utils/network/request.js b/utils/network/request.js
index 8c695e3..b9a55d8 100644
--- a/utils/network/request.js
+++ b/utils/network/request.js
@@ -1,17 +1,23 @@
-const env = require('./config').dev
-
+const { envVersion } = wx.getAccountInfoSync().miniProgram;
+let env='';
+if(envVersion=="develop" || envVersion=="trial"){
+ env = require('./config').dev
+}else{
+ env = require('./config').prod
+};
class HTTP {
constructor() {
this.baseUrl = env.baseUrl,
this.staticHost = env.staticHost,
- this.appId = env.appId
+ this.IMappId = env.IMappId,
+ this.IMsecretkey = env.IMsecretkey
}
request({
url,
data = {},
method = 'GET',
- contentType = 'application/x-www-form-urlencoded',
+ contentType = 'application/json',
showLoading = true
}){
return new Promise((resolve, reject) => {
@@ -19,22 +25,22 @@ class HTTP {
})
}
- _request(url, resolve, reject, data = {}, method = 'GET', contentType = 'application/x-www-form-urlencoded', showLoading = true) {
+ _request(url, resolve, reject, data = {}, method = 'GET', contentType = 'application/json', showLoading = true) {
if(showLoading) wx.showLoading();
+ let usertype = wx.getStorageSync('usertype');
wx.request({
url: url,
method: method,
data: data,
header: {
'content-type': contentType,
- 'appId': this.appId,
- 'Authorization': "Bearer " + wx.getStorageSync('AUTH_TOKEN')
+ 'Authorization': "Bearer " + wx.getStorageSync('AUTH_TOKEN_'+usertype)
},
success: (res) => {
- console.log("header Authorization: ", res.header.Authorization);
+ // console.log("header Authorization: ", res.header.Authorization);
var Authorization_token = res.header.Authorization;
if(Authorization_token){
- wx.setStorageSync('AUTH_TOKEN', Authorization_token);//当token快过期时,服务器会返回新token,本地刷新
+ wx.setStorageSync('AUTH_TOKEN_'+usertype, Authorization_token);//当token快过期时,服务器会返回新token,本地刷新
}
if (res.data) {
const code = res.data.code;
@@ -42,27 +48,36 @@ class HTTP {
resolve(res.data)
} else if(code == 401 || code == 403 || code == 405 || code == 406){
wx.navigateTo({
- url: "/Pages/index/index"
+ url: "/Pages/login/index"
})
} else {
- reject(res.data.message)
- this._show_error(res.data.message)
+ reject(res.data.message);//向后传递错误信息,catch会拿到
+ this._show_error(showLoading, res.data.message)
}
} else {
- resolve(res.data)
+ reject(res.data)//向后传递错误信息,catch会拿到
+ this._show_error(showLoading, err.data.message)
}
},
fail: (err) => {
- reject()
- this._show_error(err.data.message)
+ reject(err)//向后传递错误信息,catch会拿到
+ this._show_error(showLoading, err.data.message)
},
- complete: () => {
- if(showLoading) wx.hideLoading();
+ complete: (res) => {
+ // console.log("res from cmplete: ",res)
+ const code = res.data.code;
+ if (code == 200) {
+ if(showLoading) wx.hideLoading();
+ }
}
})
}
- _show_error(_message) {
+ _show_error(showLoading, _message) {
+ if(showLoading) wx.hideLoading();
+ if(_message == undefined){
+ _message = "网络错误";
+ }
wx.showToast({
title: `${_message}`,
icon: 'none',
diff --git a/utils/requestSubscribeUtil.js b/utils/requestSubscribeUtil.js
new file mode 100644
index 0000000..eeb90f6
--- /dev/null
+++ b/utils/requestSubscribeUtil.js
@@ -0,0 +1,68 @@
+function requestSubscribeMessage(tmplIds){
+
+ return new Promise((resolve, reject) => {
+ wx.requestSubscribeMessage({
+ tmplIds: tmplIds,
+ success (res) {
+ console.log("succ:", res)
+ resolve(res)
+ },
+ fail(err){
+ console.log("error:", err)
+ let code = err.errCode
+ let title = "未知错误";
+ switch (code) {
+ case 10001:
+ title = "参数传空了"
+ break;
+ case 10002:
+ title = "请检查您的网络"
+ break;
+ case 10003:
+ title = "请检查您的网络"
+ break;
+ case 10004:
+ title = "参数类型错误"
+ break;
+ case 10005:
+ title = "无法展示 UI"
+ break;
+ case 20001:
+ title = "没有模板数据"
+ break;
+ case 20002:
+ title = "模板消息类型错误"
+ break;
+ case 20003:
+ title = "模板消息数量超过上限"
+ break;
+ case 20004:
+ title = "用户关闭了主开关,无法进行订阅"
+ break;
+ case 20005:
+ title = "小程序被禁封"
+ break;
+ case 20013:
+ title = "不允许通过该接口订阅设备消息"
+ break;
+
+ default:
+ break;
+ }
+
+ // wx.showToast({
+ // title: title,
+ // icon: 'error'
+ // })
+
+
+ reject(err)
+ }
+ })
+ })
+
+}
+
+module.exports = {
+ requestSubscribeMessage
+}
\ No newline at end of file
diff --git a/utils/substr.wxs b/utils/substr.wxs
new file mode 100644
index 0000000..83533f7
--- /dev/null
+++ b/utils/substr.wxs
@@ -0,0 +1,13 @@
+var filters = {//截取字符串返回
+ substring:function(str,start,end){
+ if(!str){
+ return
+ }
+ //也可做一些判断 //我不需要所以没做其他处理,直接返回的
+ return str.substring(start,end);
+ }
+
+}
+module.exports = {
+ substring:filters.substring
+}
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
index a878422..8d629a4 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -1,3 +1,27 @@
+
+
+// 对Date的扩展,将 Date 转化为指定格式的String
+// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
+// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
+// 例子:
+// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
+// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
+Date.prototype.Format = function (fmt) {
+ var o = {
+ "M+": this.getMonth() + 1, //月份
+ "d+": this.getDate(), //日
+ "h+": this.getHours(), //小时
+ "m+": this.getMinutes(), //分
+ "s+": this.getSeconds(), //秒
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+ "S": this.getMilliseconds() //毫秒
+ };
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o)
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ return fmt;
+}
+
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
@@ -9,6 +33,17 @@ const formatTime = date => {
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
+const formatChatTime = date => {
+ const year = date.getFullYear()
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ const hour = date.getHours()
+ const minute = date.getMinutes()
+ const second = date.getSeconds()
+
+ return `${[month, day].map(formatNumber).join('-')} ${[hour, minute].map(formatNumber).join(':')}`
+}
+
const getDateArr = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
@@ -25,8 +60,112 @@ const formatNumber = n => {
return n[1] ? n : `0${n}`
}
+const getTimeAgo = stringTime =>{
+ var minute = 1000 * 60;
+ var hour = minute *60;
+ var day = hour *24;
+ var week = day * 7;
+ var month = day * 30;
+ var time1 = new Date().getTime();//当前的时间戳
+ var time2 = stringTime*1000;//指定时间的时间戳
+ var time = time1 - time2;
+ var result = null;
+ if(time < 0){
+ return '刚刚';
+ }else if(time/month >= 1){
+ result = (new Date(time2)).Format("yyyy-MM-dd hh:mm:ss");
+ }else if(time/week >= 1){
+ result = (new Date(time2)).Format("MM-dd hh:mm:ss");
+ }else if(time/day >= 1){
+ result = (new Date(time2)).Format("MM-dd hh:mm");
+ }else if(time/hour >= 1){
+ result = parseInt(time/hour) + "小时前";
+ }else if(time/minute >= 1){
+ result = parseInt(time/minute) + "分钟前";
+ }else {
+ result = "刚刚";
+ }
+ return result;
+}
+
+const getTimeAgoChat = stringTime =>{
+ console.log("stringTime: ", stringTime)
+ var minute = 1000 * 60;
+ var hour = minute *60;
+ var day = hour *24;
+ var week = day * 7;
+ var month = day * 30;
+ var time1 = new Date().getTime();//当前的时间戳
+ var time2 = stringTime;//指定时间的时间戳
+ var time = time1 - time2;
+ var result = null;
+ if(time < 0){
+ return '刚刚';
+ }else if(time/month >= 1){
+ result = (new Date(time2)).Format("yyyy-MM-dd hh:mm:ss");
+ }else if(time/week >= 1){
+ result = (new Date(time2)).Format("MM-dd hh:mm:ss");
+ }else if(time/day >= 1){
+ result = (new Date(time2)).Format("MM-dd hh:mm");
+ }else if(time/hour >= 1){
+ result = parseInt(time/hour) + "小时前";
+ }else if(time/minute >= 1){
+ result = parseInt(time/minute) + "分钟前";
+ }else {
+ result = "刚刚";
+ }
+ return result;
+}
+
+//仿微信时间显示
+const likeWeChatTimeAgoChat = stringTime =>{
+ console.log("stringTime: ", stringTime)
+ var minute = 1000 * 60;
+ var hour = minute *60;
+ var day = hour *24;
+ var week = day * 7;
+ var month = day * 30;
+ var time1 = new Date().getTime();//当前的时间戳
+ var time2 = stringTime;//指定时间的时间戳
+ var time = time1 - time2;
+ var result = null;
+ if(time < 0){
+ return '刚刚';
+ }else if(time/month >= 1){
+ result = (new Date(time2)).Format("yyyy-MM-dd hh:mm:ss");
+ }else if(time/week >= 1){
+ result = (new Date(time2)).Format("MM-dd hh:mm:ss");
+ }else if(time/day >= 1){
+ result = (new Date(time2)).Format("MM-dd hh:mm");
+ }else if(time/hour >= 1){
+ result = parseInt(time/hour) + "小时前";
+ }else if(time/minute >= 1){
+ result = parseInt(time/minute) + "分钟前";
+ }else {
+ result = "刚刚";
+ }
+ return result;
+}
+
+// px 转换为 rpx ,传参类型是数字(Number)
+const pxTorpx = px => {
+ let deviceWidth = wx.getSystemInfoSync().windowWidth; //获取设备屏幕宽度
+ let rpx = (750 / deviceWidth) * Number(px)
+ return Math.floor(rpx);
+}
+// px 转换为 rpx ,传参类型是数字(Number)
+const rpxTopx = rpx => {
+ let px = rpx / 750 * wx.getSystemInfoSync().windowWidth;
+ return Math.floor(px);
+}
+
module.exports = {
formatTime,
getDateArr,
formatNumber,
+ getTimeAgo,
+ rpxTopx,
+ pxTorpx,
+ getTimeAgoChat,
+ likeWeChatTimeAgoChat
}
diff --git a/utils/wechatTime.js b/utils/wechatTime.js
new file mode 100644
index 0000000..089b66d
--- /dev/null
+++ b/utils/wechatTime.js
@@ -0,0 +1,121 @@
+// 星期格式转换 0-6:周日到周六
+function weekFormat(e, prefix = "周") {
+ switch (e) {
+ case 0:
+ return prefix + "日"
+ break;
+ case 1:
+ return prefix + "一"
+ break;
+ case 2:
+ return prefix + "二"
+ break;
+ case 3:
+ return prefix + "三"
+ break;
+ case 4:
+ return prefix + "四"
+ break;
+ case 5:
+ return prefix + "五"
+ break;
+ case 6:
+ return prefix + "六"
+ break;
+ default:
+ return ""
+ break;
+ }
+}
+// 转换今日的时辰格式
+function todayTimeFormat(e) {
+ if (e >= 0 && e < 7) {
+ return "凌晨"
+ } else if (e >= 7 && e < 11) {
+ return "上午"
+ } else if (e >= 11 && e < 13) {
+ return "中午"
+ } else if (e >= 13 && e < 18) {
+ return "下午"
+ } else if (e >= 18 && e < 24) {
+ return "晚上"
+ } else {
+ return ""
+ }
+}
+
+// 是否显示周几
+function isShowWeekDay(sub, weekDay) {
+ const currentWeekDay = new Date().getDay()
+ const dayTime = 1000 * 60 * 60 * 24
+ // 1.当前时间与消息时间相差必须大于2天小于7天
+ // 2.当前时间距离本周一相差必须大于2天且小于当前距离周一的天数
+ // 3.消息时间不可能是0-周日,因为周日没有给后面时间留空间,不会走这里的逻辑,而是走今天的逻辑
+ if (sub >= dayTime * 2 && weekDay !== 0 && sub <= dayTime * currentWeekDay) {
+ return true
+ } else {
+ return false
+ }
+}
+
+
+// 仿微信时间显示格式转换 @time 时间戳毫秒
+function wechatTimeFormat(time) {
+ const today = new Date().getTime()
+ // 当前时间减去获取到的时间
+ const sub = today - time
+ const day = 1000 * 60 * 60 * 24
+ const timeDate = new Date(time)
+ const currentYear = new Date().getFullYear()
+ const getYear = new Date(time).getFullYear()
+ const HHmm = `${formatTime2("hh", timeDate)}:${formatTime2("mm", timeDate)}`
+ const showWeekDay = isShowWeekDay(sub, timeDate.getDay())
+ const currentDay = new Date().getDate()
+ const getDay = new Date(time).getDate()
+ const subDay = currentDay - getDay
+ if (currentYear > getYear) {
+ return `${formatTime2("yyyy-MM-dd", timeDate)} ${formatTime2("hh:mm", timeDate)}`
+ // 上午下午
+ return `${formatTime2("yyyy年MM月dd日", timeDate)} ${todayTimeFormat(timeDate.getHours())} ${formatTime2("hh:mm", timeDate)}`
+ } else if (showWeekDay) {
+ return `${weekFormat(timeDate.getDay())} ${HHmm}`
+ //} else if (sub > day && sub < day * 2) {
+ } else if (subDay === 1) {
+ return `昨天 ${HHmm}`
+ } else if (sub <= day) {
+ return HHmm
+ } else {
+ return `${formatTime2("MM-dd", timeDate)} ${formatTime2("hh:mm", timeDate)}`
+ // 上午下午
+ return `${formatTime2("MM月dd日", timeDate)} ${todayTimeFormat(timeDate.getHours())} ${formatTime2("hh:mm", timeDate)}`
+ }
+}
+
+function formatTime2(fmt, timestamp) {
+ var date = new Date(timestamp) // 兼容safari
+ var o = {
+ 'M+': date.getMonth() + 1,
+ 'd+': date.getDate(),
+ 'h+': date.getHours(),
+ 'm+': date.getMinutes(),
+ 's+': date.getSeconds(),
+ 'q+': Math.floor((date.getMonth() + 3) / 3),
+ 'S': date.getMilliseconds()
+ }
+ if (/(y+)/.test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
+ }
+ for (var k in o) {
+ if (new RegExp('(' + k + ')').test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+ }
+ }
+ return fmt
+}
+
+module.exports = {
+ weekFormat,
+ todayTimeFormat,
+ isShowWeekDay,
+ wechatTimeFormat
+}