Commit ddf4601d by hanpeng

-mark- 免费聊天顶部按钮跳转功能添加

parent 78cf55c2
......@@ -81,6 +81,11 @@ body {
font-size: 0.2rem;
margin: 0.15rem;
}
.service_btn_list .grayBtn{
color:#999999;
background:#F9F9F9;
border:none;
}
.top_btn {
width: 100%;
......@@ -139,8 +144,8 @@ body {
}
/* 图片消息中图片的大小*/
.chat_nopadding img {
height: 2rem;
/* width: 2rem; */
height: 1.5rem;
width: 2rem;
}
.chat_message {
......
body{
background:#F6F6FC;
font-size:0.32rem;
}
.header_tab_list{
width:100%;
height:0.8rem;
line-height:0.8rem;
background:#fff;
text-align:center;
}
.header_tab_list .tab_item{
display:inline-block;
height:0.8rem;
line-height:0.8rem;
margin-right:0.3rem;
margin-left:0.3rem;
}
.header_tab_list .tabOn{
color:#2CBCA0;
border-bottom:0.01rem solid #2CBCA0;
}
.myOrder_list_warp{
padding-top:0.2rem;
}
.myOrder_list_item{
width:6.86rem;
border-radius:0.08rem;
background:#fff;
margin-left:0.32rem;
margin-bottom:0.2rem;
}
.myOrder_list_warp .myOrder_list_item .myOrder_list_item_header{
padding:0.26rem 0.32rem 0.2rem 0.32rem;
border-bottom:0.01rem solid #F1F1F1;
}
.myOrder_list_warp .myOrder_list_item .myOrder_list_item_header img{
width:0.32rem;
height:0.32rem;
}
.myOrder_list_warp .myOrder_list_item .myOrder_list_item_header .myOrder_list_item_type{
font-size:0.28rem;
font-weight:600;
margin-left:0.1rem;
}
.myOrder_list_warp .myOrder_list_item .myOrder_list_item_header .myOrder_list_item_status{
float:right;
font-size:0.28rem;
}
.myOrder_list_item .myOrder_list_detail{
padding:0.32rem;
}
.myOrder_list_item .myOrder_list_detail .mar-b{
margin-bottom:0.2rem;
}
.myOrder_list_item .myOrder_list_detail .myOrder_list_detail_item_title{
color:#111;
font-weight:600;
margin-right:0.2rem;
display:inline-block;
float:left;
}
.myOrder_list_item .myOrder_list_detail .myOrder_list_detail_item_desc{
display:inline-block;
width:4.6rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
float:left;
}
.no_order{
width:100%;
text-align:center;
display:none;
}
.no_order img{
width:2.28rem;
margin-top:1.2rem;
}
.no_order .no_order_tip{
font-size:0.28rem;
margin-top:0.6rem;
color:#666;
}
\ No newline at end of file
......@@ -26,6 +26,7 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
// 上传图片后的url地址
imgUrl: '',
init: function() {
chat.getDoctorDetail();
chat.bindEve();
chat.talkRelation();
chat.getWechatTicket();
......@@ -67,9 +68,6 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
}
}, 5000);
});
/* $(window).scroll(function(){
clearInterval(getTalk);
}) */
},
bindEve: function() {
$('.close_info_btn').unbind().bind('click', function() {
......@@ -95,12 +93,13 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
} else {
chat.sendMsg(chat.num);
}
//$('.footer').removeClass('footerOn')
});
/* $('#sendMsg').unbind().bind('focus',function(){
$('.footer').addClass('footerOn')
}) */
//跳转至医生主页
$('.doctor_profile').unbind().bind('click',function(){
medtap.pushWindow('https://review-formal.iplusmed.com/wechatForLungCancer/dev/wechat_lung_push_doctor/pages/doctorHomePage.html?doctorId=' + chat.doctorId + '&wechatId=' + medtap.getRequest('wechatId'));
});
},
//绑定,获取聊天关系
talkRelation: function() {
......@@ -132,7 +131,6 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
: ''
);
$('.assistant_name').html(chat.helperName);
//$('.assistant_title').html('')
$('.assistant_profile').attr('src', res.content.talkRealtion.helperProfile);
chat.getTalkRecord();
} else {
......@@ -180,9 +178,6 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
var serverId = res.serverId; // 返回图片的服务器端ID
//其他对serverId做处理的代码
chat.upLoadImg(serverId, chat.localId);
// if (localIds.length > 0) {
// syncUpload(localIds);
// }
}
});
};
......@@ -231,19 +226,11 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
'user-os': 'wechat'
},
success: function(data) {
// console.log('上传图片success', data);
if (data.success == true) {
var res = data.content;
var imgKey = res.ossKey;
var imgUrl = res.url;
// console.log('图片地址', res.url);
chat.sendMsg(1, res.url);
// newCard.imgList.push(imgKey);
// var html = '<div class="image_files_item">' +
// '<img src="' + localId + '" class="image_files_img" imgkey="' + imgKey + '">' +
// '<img src="../images/post_delete_btn@2x.png" class="image_del" >' +
// '</div>';
// $('#ImgUp').append(html);
}
}
});
......@@ -342,9 +329,9 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
chat.doctorProfile +
'" class="chat_profile from_profile">' +
'<div class="chat_message_warp">' +
// '<p class="chat_from_name">' +
// chat.doctorName +
// '医生</p>' +
'<p class="chat_from_name">' +
chat.doctorName +
'医生</p>' +
'<div class="chat_message chat_message_from">' +
record[i].content +
'</div>' +
......@@ -447,9 +434,9 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
chat.doctorProfile +
'" class="chat_profile from_profile">' +
'<div class="chat_message_warp">' +
// '<p class="chat_from_name">' +
// chat.doctorName +
// '医生</p>' +
/* '<p class="chat_from_name">' +
chat.doctorName +
'医生</p>' + */
'<div class="chat_message chat_message_from chat_nopadding">' +
// 图片消息
'<img src="' +
......@@ -679,6 +666,139 @@ define([ 'zepto', 'medtap' ], function($, medtap) {
console.log(res.resultDesc);
}
});
},
getDoctorDetail:function(){
medtap.loading(1);
medtap.submitAjax({
url: 'https://testdevgw.medtap.cn/doctor/getDoctorDetail',
type: 'get',
async: false,
data: {
doctorId: chat.doctorId
},
success:function(res){
medtap.loading(0);
var detail = res.content.doctorItem;
//电话咨询
if (detail.openConsult == false) {
$('.to_consult').addClass('grayBtn');
} else {
$('.to_consult').removeClass('grayBtn');
chat.getConsultNumber();
}
//图文咨询
if (detail.isOpenImageConsult == false) {
$('.to_img_consult').addClass('grayBtn');
} else {
$('.to_img_consult').removeClass('grayBtn');
//查找与当前医生相关的图文咨询订单信息
chat.getImgConsultNumber();
}
//私人医生
if (detail.isOpenPmd == false) {
$('.to_pmd').addClass('grayBtn');
} else {
$('.to_pmd').removeClass('grayBtn');
chat.getPmdConsultNumber();
}
}
})
},
//查询图文咨询订单数量
getImgConsultNumber:function(){
medtap.loading(1);
medtap.submitAjax({
url:'https://testdevgw.medtap.cn/trade/imageConsultOrder/countOrder',
type:'post',
async: false,
contentType: 'application/json',
data:{
condition:{
serviceStatusList:['3','10'],
doctorId:parseInt(chat.doctorId)
}
},
success:function(res){
medtap.loading(0);
if(res.success == true){
var count = res.content.totalCount;
if(count != 0){
//medtap.pushWindow('myOrder.html?orderType=TWZX');//跳转至图文咨询订单列表
$('.to_img_consult').unbind().bind('click',function(){
medtap.pushWindow('myOrder.html?orderType=TWZX&wechatId=' + medtap.getRequest('wechatId'));
})
}else{
$('.to_img_consult').unbind().bind('click',function(){
medtap.pushWindow('../../wechat_lung_imgConsult/index.html?doctorId=' + chat.doctorId + '&pmdOrderSn=' + medtap.getRequest('pmdSn') + '&wechatId=' + medtap.getRequest('wechatId'));
})
}
}
}
})
},
//查询电话咨询订单数量
getConsultNumber:function(){
medtap.loading(1);
medtap.submitAjax({
url:'https://testdevgw.medtap.cn/trade/consult/countOrder',
type:'post',
async: false,
contentType: 'application/json',
data:{
condition:{
serviceStatusList:['3','10'],
doctorId:parseInt(chat.doctorId)
}
},
success:function(res){
medtap.loading(0);
if(res.success == true){
var count = res.content.totalCount;
if(count != 0){
//跳转至电话咨询订单列表
$('.to_consult').unbind().bind('click',function(){
medtap.pushWindow('myOrder.html?orderType=DHZX&wechatId=' + medtap.getRequest('wechatId'));
})
}else{
$('.to_consult').unbind().bind('click',function(){
medtap.pushWindow('../../wechat_lung_consult/rukou.html?doctorId=' + chat.doctorId + '&pmdOrderSn=' + medtap.getRequest('pmdSn') + '&doctorname=' + chat.doctorName + '&wechatId=' + medtap.getRequest('wechatId'))
})
}
}
}
})
},
//查询私人医生订单数量
getPmdConsultNumber:function(){
medtap.loading(1);
medtap.submitAjax({
url:'https://testdevgw.medtap.cn/trade/pmdConsultOrder/countOrder',
type:'post',
async: false,
contentType: 'application/json',
data:{
condition:{
serviceStatusList:['3','10'],
doctorId:parseInt(chat.doctorId)
}
},
success:function(res){
medtap.loading(0);
if(res.success == true){
var count = res.content.totalCount;
if(count != 0){
//跳转至私人医生订单列表
$('.to_pmd').unbind().bind('click',function(){
medtap.pushWindow('myOrder.html?orderType=PMD&wechatId=' + medtap.getRequest('wechatId'));
})
}else{
$('.to_pmd').unbind().bind('click',function(){
medtap.pushWindow('../../wechat_lung_prvivateDoctor/index.html?doctorId=' + chat.doctorId + '&wechatId=' + medtap.getRequest('wechatId'));
})
}
}
}
})
}
};
chat.init();
......
define(['zepto', 'medtap'], function($, medtap) {
var order = {
wechatId: medtap.getRequest('wechatId'),
init: function() {
//order.getOrderList();
order.bindEve();
order.checkUser();
},
bindEve: function() {
},
getOrderList: function(type) {
var requestUrl = '';
switch (type) {
case 'TWZX':
requestUrl = 'https://testdevgw.medtap.cn/trade/imageConsultOrder/listOrder';
break;
case 'DHZX':
requestUrl = 'https://testdevgw.medtap.cn/trade/consult/listOrder';
break;
case 'PMD':
requestUrl = 'https://testdevgw.medtap.cn/trade/pmdConsultOrder/listOrder';
break;
default:
break;
}
medtap.loading(1);
medtap.submitAjax({
url: requestUrl,
type: 'post',
async: false,
contentType: 'application/json',
data: {
offset: 1,
limit: 20,
condition: {
serviceStatusList: ['3', '10']
}
},
success: function(res) {
medtap.loading(0);
if (res.success == true) {
var list = res.content.list;
var html = '';
if (list.length != 0) {
$('.myOrder_list_warp').show();
$('.no_order').hide();
for (var i = 0; i < list.length; i++) {
var type = list[i].orderType.key;
if (type == 'TWZX') {
html += '<div class="myOrder_list_item img_consult" data-id="' + list[i].orderSn + '">' +
'<div class="myOrder_list_item_header clearfix">' +
'<img src="../images/order list_twzx_png@2x.png" >' +
'<span class="myOrder_list_item_type">图文咨询</span>' +
'<span class="myOrder_list_item_status">' + list[i].serviceStatus.value + '</span>' +
'</div>' +
'<div class="myOrder_list_detail">' +
'<p class="myOrder_list_detail_item clearfix mar-b">' +
'<span class="myOrder_list_detail_item_title">医生姓名:</span>' +
'<span class="myOrder_list_detail_item_desc doctor_name">' + list[i].doctorName +
'</span>' +
'</p>' +
'<p class="myOrder_list_detail_item clearfix">' +
'<span class="myOrder_list_detail_item_title">咨询问题:</span>' +
'<span class="myOrder_list_detail_item_desc questioon">' + list[i].describe +
'</span>' +
'</p>' +
'</div>' +
'</div>';
} else if (type == 'PMDTWZX') {
html += '<div class="myOrder_list_item pmd" data-id="' + list[i].orderSn + '">' +
'<div class="myOrder_list_item_header clearfix">' +
'<img src="../images/order list_srys_png@2x.png" >' +
'<span class="myOrder_list_item_type">私人医生</span>' +
'<span class="myOrder_list_item_status">' + list[i].serviceStatus.value + '</span>' +
'</div>' +
'<div class="myOrder_list_detail">' +
'<p class="myOrder_list_detail_item clearfix mar-b">' +
'<span class="myOrder_list_detail_item_title">医生姓名:</span>' +
'<span class="myOrder_list_detail_item_desc doctor_name">' + list[i].doctorName +
'</span>' +
'</p>' +
'<p class="myOrder_list_detail_item clearfix">' +
'<span class="myOrder_list_detail_item_title">患者姓名:</span>' +
'<span class="myOrder_list_detail_item_desc patient_name">' + list[i].patientName +
'</span>' +
'</p>' +
'</div>' +
'</div>';
} else if (type == 'DHZX') {
html += '<div class="myOrder_list_item consult" data-id="' + list[i].orderSn + '">' +
'<div class="myOrder_list_item_header clearfix">' +
'<img src="../images/order list_dhzx_png@2x.png" >' +
'<span class="myOrder_list_item_type">电话咨询</span>' +
'<span class="myOrder_list_item_status">' + list[i].serviceStatus.value + '</span>' +
'</div>' +
'<div class="myOrder_list_detail">' +
'<p class="myOrder_list_detail_item clearfix mar-b">' +
'<span class="myOrder_list_detail_item_title">医生姓名:</span>' +
'<span class="myOrder_list_detail_item_desc doctor_name">' + list[i].doctorName +
'</span>' +
'</p>' +
'<p class="myOrder_list_detail_item clearfix mar-b">' +
'<span class="myOrder_list_detail_item_title">预约时间:</span>' +
'<span class="myOrder_list_detail_item_desc time">' + list[i].formatTime + '</span>' +
'</p>' +
'<p class="myOrder_list_detail_item clearfix">' +
'<span class="myOrder_list_detail_item_title">咨询问题:</span>' +
'<span class="myOrder_list_detail_item_desc askQuestion">' + list[i].diseaseDescription +
'</span>' +
'</p>' +
'</div>' +
'</div>';
}
}
$('.myOrder_list_warp').html(html)
} else {
$('.no_order').show();
$('.myOrder_list_warp').hide();
}
$('.myOrder_list_item').unbind().bind('click', function() {
var orderSn = $(this).attr('data-id');
if ($(this).hasClass('img_consult')) {
//console.log('跳转至图文咨询详情');
medtap.pushWindow('../../wechat_lung_imgConsult/pages/imgConsultDetail.html?id=' + orderSn +
'&wechatId=' + order.wechatId);
} else if ($(this).hasClass('pmd')) {
//console.log('跳转至私人医生订单详情')
medtap.pushWindow('../../wechat_lung_prvivateDoctor/pages/pmdDetail.html?id=' + orderSn + '&wechatId=' +
order.wechatId);
} else if ($(this).hasClass('consult')) {
//console.log('跳转至电话咨询订单详情')
medtap.pushWindow('../../wechat_lung_consult/pages/consultDetail.html?id=' + orderSn + '&wechatId=' +
order.wechatId)
}
})
}
}
})
},
getToken: function() {
localStorage.wxLungToken = '';
medtap.loading(1);
medtap.submitAjax({
url: 'https://testdevgw.medtap.cn/user/auth/token',
type: 'POST',
async: false,
contentType: 'application/json',
data: {
wechatId: order.wechatId
},
success: function(res) {
medtap.loading(0);
if (res.success == true) {
var token = res.content.token;
localStorage.setItem('wxLungToken', token);
} else {
}
},
error: function(res) {
console.log(res.resultDesc);
}
})
},
checkUser: function() {
medtap.loading(1);
medtap.submitAjax({
url: 'https://testdevgw.medtap.cn/wechat/user/getWechatUser',
type: 'GET',
async: false,
data: {
wechatId: order.wechatId
},
success: function(res) {
medtap.loading(0);
var info = res.content.wechatUser;
if (info.hasOwnProperty('userId')) {
order.getUserDetail();
} else {
window.location.replace('../login/login.html?wechatId=' + order.wechatId + '&route=order');
}
}
})
},
getUserDetail: function() {
medtap.loading(1);
medtap.submitAjax({
url: 'https://testdevgw.medtap.cn/user/getUserDetail',
type: 'GET',
async: false,
data: {
},
success: function(res) {
medtap.loading(0);
if (res.success == true) {
var userInfo = res.content.userInfo;
if (!userInfo.hasOwnProperty('healthType') || !userInfo['username'] || !userInfo['sex'] || !userInfo[
'telephone']) {
window.location.replace('../login/pages/basicUserInfo.html?wechatId=' + order.wechatId +
'&operationType=12&route=my');
} else {
var type = medtap.getRequest('orderType')
order.getOrderList(type);
}
}
}
})
}
}
order.init();
})
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<link rel="stylesheet" type="text/css" href="https://review-formal.iplusmed.com/Common/css/wechat_Reset.min.css" />
<link rel="stylesheet" type="text/css" href="../css/myOrder.css"/>
<script src="https://review-formal.iplusmed.com/Common/javaScript/calRem.js" type="text/javascript" charset="utf-8"></script>
<title>我的订单</title>
<script src="https://review-formal.iplusmed.com/Common/javaScript/require.min.js"></script>
<script type="text/javascript">
require.config({
baseUrl: "./",
paths: {
"zepto": "https://review-formal.iplusmed.com/Common/javaScript/zepto.min",
"medtap": "https://review-formal.iplusmed.com/Common/javaScript/medtap_core_wx",
"md5": "https://review-formal.iplusmed.com/Common/javaScript/md5.min"
},
shim: {
"zepto": {
exports: "$"
}
}
});
</script>
</head>
<body>
<div id="content">
<!-- <div class="header_tab_list">
<span class="tab_item all tabOn">全部</span>
<span class="tab_item bePaid">待支付</span>
<span class="tab_item inService">已支付</span>
<span class="tab_item completed">已完成</span>
</div> -->
<div class="myOrder_list_warp">
</div>
<div class="no_order">
<img src="../images/order list_no_png@2x.png" >
<p class="no_order_tip">暂无订单</p>
</div>
</div>
</body>
<script type="text/javascript">
require(['../javaScript/myOrder.js'])
</script>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment