Commit b69e367d by liuquan

3.1.0

A:添加医生、患者图片渲染失败加载默认图片
parent 5b69ec19
...@@ -524,4 +524,14 @@ Page({ ...@@ -524,4 +524,14 @@ Page({
} }
}); });
}, },
/**
* 图片加载失败函数
* @param {*} e
*/
binderrorimg(e) {
let up = "t_userInfo.image";
this.setData({
[up]: '/images/doctor_img.png'
})
},
}) })
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<text class="ptitle">服务信息</text> <text class="ptitle">服务信息</text>
<view class="one-wrap"> <view class="one-wrap">
<view class="flex-name"> <view class="flex-name">
<image class="touxiang" src="{{t_userInfo.image}}"></image> <image class="touxiang" mode="aspectFill" src="{{t_userInfo.image}}" binderror="binderrorimg"></image>
<view class="jianj"> <view class="jianj">
<view> <view>
<text class="name">{{t_userInfo.name}}</text> <text class="name">{{t_userInfo.name}}</text>
......
...@@ -1623,4 +1623,26 @@ Page({ ...@@ -1623,4 +1623,26 @@ Page({
phoneNumber: tel, phoneNumber: tel,
}) })
}, },
/**
* 图片加载失败函数
* type 0 医生头像 1 患者头像
* @param {any} e
*/
binderrorimg(e) {
let type = e.currentTarget.dataset.type;
// let errorindex = e.currentTarget.dataset.errorindex;
let up;
let img;
if (type == 0) {
up = "doctorimage";
img="/images/doctor_img.png";
} else if(type == 1) {
up = "avatarUrl";
img="/images/head-img.png";
}
console.log('img',img)
this.setData({
[up]: img
})
},
}) })
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<view class="nav" wx:if='{{nav}}'> <view class="nav" wx:if='{{nav}}'>
<view> <view>
<image class='nav-img' src='{{doctorimage}}' mode="aspectFill"></image> <image class='nav-img' src='{{doctorimage}}' mode="aspectFill" binderror="binderrorimg" data-type="0"></image>
</view> </view>
<text>服务类型:{{serviceName}}</text> <text>服务类型:{{serviceName}}</text>
<text></text> <text></text>
...@@ -73,19 +73,19 @@ ...@@ -73,19 +73,19 @@
<block wx:if='{{item.type == "TIMTextElem"}}'> <block wx:if='{{item.type == "TIMTextElem"}}'>
<!-- 白方消息 --> <!-- 白方消息 -->
<view class='left' wx:if="{{item.flow=='in'}}" id='d{{index}}'> <view class='left' wx:if="{{item.flow=='in'}}" id='d{{index}}'>
<image class='head' src='{{doctorimage || noSrc}}'></image> <image class='head' src='{{doctorimage || noSrc}}' binderror="binderrorimg" data-type="0"></image>
<view class='msg' data-c="{{item.payload.text}}" bind:longpress='copy'>{{item.payload.text}}</view> <view class='msg' data-c="{{item.payload.text}}" bind:longpress='copy'>{{item.payload.text}}</view>
</view> </view>
<!-- 蓝方消息 --> <!-- 蓝方消息 -->
<view class='right' wx:if="{{item.flow=='out'}}" id='d{{index}}'> <view class='right' wx:if="{{item.flow=='out'}}" id='d{{index}}'>
<image class='head' src='{{avatarUrl|| noSrc}}'></image> <image class='head' src='{{avatarUrl|| noSrc}}' binderror="binderrorimg" data-type="1"></image>
<view class='msg' data-c="{{item.payload.text}}" bind:longpress='copy'>{{item.payload.text}}</view> <view class='msg' data-c="{{item.payload.text}}" bind:longpress='copy'>{{item.payload.text}}</view>
</view> </view>
</block> </block>
<!-- 图片消息 --> <!-- 图片消息 -->
<block wx:if='{{item.type == "TIMImageElem"}}'> <block wx:if='{{item.type == "TIMImageElem"}}'>
<view class='left' wx:if="{{item.flow=='in'}}" id='d{{index}}'> <view class='left' wx:if="{{item.flow=='in'}}" id='d{{index}}'>
<image class='head' src='{{doctorimage || noSrc}}'></image> <image class='head' src='{{doctorimage || noSrc}}' binderror="binderrorimg" data-type="0"></image>
<block wx:for='{{item.payload.imageInfoArray}}' wx:for-item="_item" wx:key='key'> <block wx:for='{{item.payload.imageInfoArray}}' wx:for-item="_item" wx:key='key'>
<view wx:if='{{_item.sizeType==1}}' class='info-img' bindtap='previewImage' data-src='{{_item.url}}'> <view wx:if='{{_item.sizeType==1}}' class='info-img' bindtap='previewImage' data-src='{{_item.url}}'>
<image src='{{_item.url}}' data-index="{{index}}" lazy-load="{{true}}" mode="widthFix"></image> <image src='{{_item.url}}' data-index="{{index}}" lazy-load="{{true}}" mode="widthFix"></image>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</block> </block>
</view> </view>
<view class='right' wx:if="{{item.flow=='out'}}" id='d{{index}}'> <view class='right' wx:if="{{item.flow=='out'}}" id='d{{index}}'>
<image class='head' src='{{avatarUrl|| noSrc}}'></image> <image class='head' src='{{avatarUrl|| noSrc}}' binderror="binderrorimg" data-type="1"></image>
<block wx:for='{{item.payload.imageInfoArray}}' wx:for-item="_item" wx:key='key'> <block wx:for='{{item.payload.imageInfoArray}}' wx:for-item="_item" wx:key='key'>
<view wx:if='{{_item.sizeType==1}}' class='info-img' bindtap='previewImage' data-src='{{_item.url}}'> <view wx:if='{{_item.sizeType==1}}' class='info-img' bindtap='previewImage' data-src='{{_item.url}}'>
<image src='{{_item.url}}' data-index="{{index}}" lazy-load="{{true}}" mode="widthFix"></image> <image src='{{_item.url}}' data-index="{{index}}" lazy-load="{{true}}" mode="widthFix"></image>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<block wx:if='{{item.type == "TIMSoundElem"}}'> <block wx:if='{{item.type == "TIMSoundElem"}}'>
<!-- 白方消息 --> <!-- 白方消息 -->
<view class='left' wx:if="{{item.flow=='in'}}" id='d{{index}}'> <view class='left' wx:if="{{item.flow=='in'}}" id='d{{index}}'>
<image class='head' src='{{doctorimage|| noSrc}}'></image> <image class='head' src='{{doctorimage|| noSrc}}' binderror="binderrorimg" data-type="0"></image>
<view class='msg' style='width:{{80+item.payload.second*6}}rpx;text-align: right;' bindtap='openAudio' data-payload='{{item.payload}}'> <view class='msg' style='width:{{80+item.payload.second*6}}rpx;text-align: right;' bindtap='openAudio' data-payload='{{item.payload}}'>
<image class="ico" wx:if="{{item.payload.uuid==audioSave}}" src="/images/yuyin-gif.gif"></image> <image class="ico" wx:if="{{item.payload.uuid==audioSave}}" src="/images/yuyin-gif.gif"></image>
<image class="ico" wx:else src="/images/yuyin-ico.png"></image> <image class="ico" wx:else src="/images/yuyin-ico.png"></image>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</view> </view>
<!-- 蓝方消息 --> <!-- 蓝方消息 -->
<view class='right' wx:if="{{item.flow=='out'}}" id='d{{index}}'> <view class='right' wx:if="{{item.flow=='out'}}" id='d{{index}}'>
<image class='head' src='{{avatarUrl || noSrc}}'></image> <image class='head' src='{{avatarUrl || noSrc}}' binderror="binderrorimg" data-type="1"></image>
<view class='msg' style='width:{{80+item.payload.second*6}}rpx;' bindtap='openAudio' data-payload='{{item.payload}}'> <view class='msg' style='width:{{80+item.payload.second*6}}rpx;' bindtap='openAudio' data-payload='{{item.payload}}'>
<image class="ico" wx:if="{{item.payload.uuid==audioSave}}" src="/images/yuyin-gif1.gif"></image> <image class="ico" wx:if="{{item.payload.uuid==audioSave}}" src="/images/yuyin-gif1.gif"></image>
<image class="ico" wx:else src="/images/yuyin-ico1.png"></image> <image class="ico" wx:else src="/images/yuyin-ico1.png"></image>
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
<block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="Checkup"}}'> <block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="Checkup"}}'>
<view class='Report'> <view class='Report'>
<view class="Report-doctor"> <view class="Report-doctor">
<image class='head' src='{{item.payload.description.headimgurl || noSrc}}'></image> <image class='head' src='{{avatarUrl || noSrc}}' binderror="binderrorimg" data-type="1"></image>
<view class="doctor-info"> <view class="doctor-info">
<view><text class="doctor-name">{{item.payload.description.nickname}}</text><text <view><text class="doctor-name">{{item.payload.description.nickname}}</text><text
class="doctor-title">{{doctortitle}}</text></view> class="doctor-title">{{doctortitle}}</text></view>
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
<block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="UserDrug"}}'> <block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="UserDrug"}}'>
<view class='recipe'> <view class='recipe'>
<view class="recipe-doctor"> <view class="recipe-doctor">
<image class='head' src='{{item.payload.description.img|| noSrc}}'></image> <image class='head' src='{{doctorimage|| noSrc}}' binderror="binderrorimg" data-type="0" ></image>
<view class="doctor-info"> <view class="doctor-info">
<view><text class="doctor-name">{{item.payload.description.name}}</text><text <view><text class="doctor-name">{{item.payload.description.name}}</text><text
class="doctor-title">{{doctortitle}}</text></view> class="doctor-title">{{doctortitle}}</text></view>
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
<block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="Prescription"}}'> <block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="Prescription"}}'>
<view class='recipe'> <view class='recipe'>
<view class="recipe-doctor"> <view class="recipe-doctor">
<image class='head' src='{{item.payload.description.img|| noSrc}}'></image> <image class='head' src='{{doctorimage|| noSrc}}' binderror="binderrorimg" data-type="0" ></image>
<view class="doctor-info"> <view class="doctor-info">
<view><text class="doctor-name">{{item.payload.description.name}}</text><text <view><text class="doctor-name">{{item.payload.description.name}}</text><text
class="doctor-title">{{doctortitle}}</text></view> class="doctor-title">{{doctortitle}}</text></view>
...@@ -237,21 +237,21 @@ ...@@ -237,21 +237,21 @@
<!-- 视频消息 --> <!-- 视频消息 -->
<block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="LaunchVideo"}}'> <block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="LaunchVideo"}}'>
<view class="{{item.flow=='in'?'left':'right'}}" id='d{{index}}'> <view class="{{item.flow=='in'?'left':'right'}}" id='d{{index}}'>
<image class='head' src='{{doctorimage || noSrc}}'></image> <image class='head' src="{{doctorimage || noSrc}}" binderror="binderrorimg" data-type="0" ></image>
<view class='msg' data-c="{{item.payload.text}}">视频通话请求</view> <view class='msg' data-c="{{item.payload.text}}">视频通话请求</view>
</view> </view>
<!-- <view class="LaunchVideo">视频通话请求</view> --> <!-- <view class="LaunchVideo">视频通话请求</view> -->
</block> </block>
<block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="closeVideo"}}'> <block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="closeVideo"}}'>
<view class="{{item.flow=='in'?'left':'right'}}" id='d{{index}}'> <view class="{{item.flow=='in'?'left':'right'}}" id='d{{index}}'>
<image class='head' src="{{item.flow=='in'?doctorimage:avatarUrl|| noSrc}}"></image> <image class='head' src="{{item.flow=='in'?doctorimage:avatarUrl|| noSrc}}" binderror="binderrorimg" data-type="{{item.flow=='in'?'0':'1'}}"></image>
<view class='msg' data-c="{{item.payload.text}}">已挂断</view> <view class='msg' data-c="{{item.payload.text}}">已挂断</view>
</view> </view>
<!-- <view class="LaunchVideo">已挂断</view> --> <!-- <view class="LaunchVideo">已挂断</view> -->
</block> </block>
<block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="hangUpVideo"}}'> <block wx:if='{{item.type == "TIMCustomElem"&&item.payload.data=="hangUpVideo"}}'>
<view class="{{item.flow=='in'?'left':'right'}}" id='d{{index}}'> <view class="{{item.flow=='in'?'left':'right'}}" id='d{{index}}'>
<image class='head' src="{{item.flow=='in'?doctorimage:avatarUrl|| noSrc}}"></image> <image class='head' src="{{item.flow=='in'?doctorimage:avatarUrl|| noSrc}}" binderror="binderrorimg" data-type="{{item.flow=='in'?'0':'1'}}"></image>
<view class='msg' data-c="{{item.payload.text}}">已拒接</view> <view class='msg' data-c="{{item.payload.text}}">已拒接</view>
</view> </view>
<!-- <view class="LaunchVideo">已挂断</view> --> <!-- <view class="LaunchVideo">已挂断</view> -->
...@@ -282,7 +282,7 @@ ...@@ -282,7 +282,7 @@
<block wx:if='{{item.type == "TIMTextElem"}}'> <block wx:if='{{item.type == "TIMTextElem"}}'>
<!-- 蓝方消息 --> <!-- 蓝方消息 -->
<view class='right' id='d{{index}}'> <view class='right' id='d{{index}}'>
<image class='head' src='{{avatarUrl || noSrc}}'></image> <image class='head' src='{{avatarUrl || noSrc}}' binderror="binderrorimg" data-type="1"></image>
<view class='msg' data-c="{{item.payload.text}}" bind:longpress='cope'>{{item.payload.text}}</view> <view class='msg' data-c="{{item.payload.text}}" bind:longpress='cope'>{{item.payload.text}}</view>
<view class="unsentloading"><i class="weui-loading"></i></view> <view class="unsentloading"><i class="weui-loading"></i></view>
</view> </view>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
<block wx:if='{{item.type == "TIMImageElem"}}'> <block wx:if='{{item.type == "TIMImageElem"}}'>
<!-- 图片消息 --> <!-- 图片消息 -->
<view class='right' id='d{{index}}'> <view class='right' id='d{{index}}'>
<image class='head' src='{{avatarUrl || noSrc}}'></image> <image class='head' src='{{avatarUrl || noSrc}}' binderror="binderrorimg" data-type="1"></image>
<view class='info-img' data-src='{{item.path}}'> <view class='info-img' data-src='{{item.path}}'>
<image src='{{item.path}}' data-index="{{index}}" mode="widthFix"></image> <image src='{{item.path}}' data-index="{{index}}" mode="widthFix"></image>
</view> </view>
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
<block wx:if='{{item.type == "TIMSoundElem"}}'> <block wx:if='{{item.type == "TIMSoundElem"}}'>
<!-- 语音消息 --> <!-- 语音消息 -->
<view class='right' id='d{{index}}'> <view class='right' id='d{{index}}'>
<image class='head' src='{{avatarUrl|| noSrc}}'></image> <image class='head' src='{{avatarUrl|| noSrc}}' binderror="binderrorimg" data-type="1"></image>
<view class='msg' style='width:{{item.payload.file.second*6+80}}rpx;'> <view class='msg' style='width:{{item.payload.file.second*6+80}}rpx;'>
<image class="ico" src="/images/yuyin-ico1.png"></image> <image class="ico" src="/images/yuyin-ico1.png"></image>
</view> </view>
......
...@@ -157,7 +157,6 @@ Page({ ...@@ -157,7 +157,6 @@ Page({
},1000,true), },1000,true),
//查看物流-待收货+已完成 //查看物流-待收货+已完成
goLogistics:debouce(function (e) { goLogistics:debouce(function (e) {
console.log(2)
wx.navigateTo({ wx.navigateTo({
url: e.currentTarget.dataset.src + "?num=" + e.currentTarget.dataset.num + '&tel=' + e.currentTarget.dataset.tel + '&ordernumber=' + e.currentTarget.dataset.ordernumber + '&img=' + e.currentTarget.dataset.img + '&status=' + e.currentTarget.dataset.status+'&com='+e.currentTarget.dataset.com+'&address='+JSON.stringify(e.currentTarget.dataset.address), url: e.currentTarget.dataset.src + "?num=" + e.currentTarget.dataset.num + '&tel=' + e.currentTarget.dataset.tel + '&ordernumber=' + e.currentTarget.dataset.ordernumber + '&img=' + e.currentTarget.dataset.img + '&status=' + e.currentTarget.dataset.status+'&com='+e.currentTarget.dataset.com+'&address='+JSON.stringify(e.currentTarget.dataset.address),
}) })
......
...@@ -8,17 +8,17 @@ Page({ ...@@ -8,17 +8,17 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
active:0, active: 0,
arr:[], arr: [],
list: [], list: [],
time:'', time: '',
time2:'', time2: '',
time3:'', time3: '',
img:'', img: '',
status:'', status: '',
logistics:false, logistics: false,
mobileTail:'', mobileTail: '',
xdorderid:'' xdorderid: ''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -28,60 +28,60 @@ Page({ ...@@ -28,60 +28,60 @@ Page({
that.setData({ that.setData({
img: options.img, img: options.img,
status: options.status, status: options.status,
address:JSON.parse(options.address) address: JSON.parse(options.address)
}) })
if (options.tel){ if (options.tel) {
that.setData({ that.setData({
mobileTail: options.tel.substring(options.tel.length - 4), mobileTail: options.tel.substring(options.tel.length - 4),
}) })
} }
var list = options.num.split(',') var list = options.num.split(',')
var comlist=options.com.split(',') var comlist = options.com.split(',')
that.setData({ that.setData({
xdorderid: options.ordernumber, xdorderid: options.ordernumber,
list: list, list: list,
orderid:list[0], orderid: list[0],
comlist:comlist, comlist: comlist,
com:util.isEmpty(comlist[0])?'shunfeng':comlist[0] com: util.isEmpty(comlist[0]) ? 'shunfeng' : comlist[0]
}) })
that.getWl() that.getWl()
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
getWl:function() { getWl: function () {
var that = this var that = this
var data = {} var data = {}
data.orderid = that.data.orderid; data.orderid = that.data.orderid;
data.mobileTail = that.data.mobileTail; data.mobileTail = that.data.mobileTail;
data.xdorderid = that.data.xdorderid; data.xdorderid = that.data.xdorderid;
data.com=that.data.com; data.com = that.data.com;
data.phone=that.data.mobileTail; data.phone = that.data.mobileTail;
Service.logisticsInfo(data).then((res)=>{ Service.logisticsInfo(data).then((res) => {
if (res.data) { if (res.data) {
that.setData({ that.setData({
arr: res.data.orderRoute, arr: res.data.orderRoute.reverse(),
time: res.data.create_time, time: res.data.create_time,
time2: res.data.pcreate_time, time2: res.data.pcreate_time,
time3: res.data.create_time_two, time3: res.data.create_time_two,
time4:res.data.drug_send_time, time4: res.data.drug_send_time,
logistics: true logistics: true
}) })
} }
}) })
}, },
getSf:function(e){ getSf: function (e) {
var _this = this var _this = this
_this.setData({ _this.setData({
orderid: e.currentTarget.dataset.num orderid: e.currentTarget.dataset.num
}) })
_this.getWl() _this.getWl()
}, },
getNum:function(e){ getNum: function (e) {
wx.setClipboardData({ wx.setClipboardData({
data: this.data.orderid, data: this.data.orderid,
success: function (res) { success: function (res) {
...@@ -89,7 +89,7 @@ Page({ ...@@ -89,7 +89,7 @@ Page({
} }
}) })
}, },
ddh:function(){ ddh: function () {
wx.makePhoneCall({ wx.makePhoneCall({
phoneNumber: '95338' //仅为示例,并非真实的电话号码 phoneNumber: '95338' //仅为示例,并非真实的电话号码
}) })
......
...@@ -314,5 +314,16 @@ Page({ ...@@ -314,5 +314,16 @@ Page({
}) })
} }
}) })
},1000,true) },1000,true),
/**
* 图片加载失败函数
* @param {any} e
*/
binderrorimg(e) {
let errorindex = e.currentTarget.dataset.errorindex;
let up = "itemList[" + errorindex + "].image";
this.setData({
[up]: '/images/doctor_img.png'
})
},
}) })
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="flex user" bindtap='next' data-item="{{item}}" data-index="{{num}}" data-one="{{index}}"> <view class="flex user" bindtap='next' data-item="{{item}}" data-index="{{num}}" data-one="{{index}}">
<view class="flex" data-index="{{num}}" > <view class="flex" data-index="{{num}}" >
<view class="user-img" > <view class="user-img" >
<image src="{{item.image}}" mode="aspectFill"></image> <image src="{{item.image}}" mode="aspectFill" binderror="binderrorimg" data-errorIndex="{{num}}"></image>
<view class="xixui" wx:if="{{item.is_rest==1}}">休息中</view> <view class="xixui" wx:if="{{item.is_rest==1}}">休息中</view>
</view> </view>
<view> <view>
......
...@@ -177,5 +177,16 @@ Page({ ...@@ -177,5 +177,16 @@ Page({
url: '/packageA/serviceDetails/serviceDetails?id=' + e.currentTarget.dataset.id+"&item="+JSON.stringify(e.currentTarget.dataset.item), url: '/packageA/serviceDetails/serviceDetails?id=' + e.currentTarget.dataset.id+"&item="+JSON.stringify(e.currentTarget.dataset.item),
}) })
} }
},1000,true) },1000,true),
/**
* 图片加载失败函数
* @param {any} e
*/
binderrorimg(e) {
let errorindex = e.currentTarget.dataset.errorindex;
let up = "rechargeList[" + errorindex + "].image";
this.setData({
[up]: '/images/doctor_img.png'
})
},
}) })
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view style='position:relative;height:214rpx;' class="user"> <view style='position:relative;height:214rpx;' class="user">
<view class='item' bindtap='checkDetails' data-id='{{item.id}}' data-n='{{item.image}}' data-p='{{item.name}}' data-item='{{item}}'> <view class='item' bindtap='checkDetails' data-id='{{item.id}}' data-n='{{item.image}}' data-p='{{item.name}}' data-item='{{item}}'>
<view class='photo'> <view class='photo'>
<image class='info-img' src='{{item.image || noSrc}}'></image> <image class='info-img' src='{{item.image || noSrc}}' binderror="binderrorimg" data-errorIndex="{{index}}"></image>
</view> </view>
<view class='info' style="{{index == serviceList.length -1?'border-bottom: none':''}}"> <view class='info' style="{{index == serviceList.length -1?'border-bottom: none':''}}">
<view class='info-name'><text>{{item.name}}</text><text style="margin-left:5px;color:rgba(51, 51, 51, 1);font-size:15px;font-weight:400;">{{item.title}}</text></view> <view class='info-name'><text>{{item.name}}</text><text style="margin-left:5px;color:rgba(51, 51, 51, 1);font-size:15px;font-weight:400;">{{item.title}}</text></view>
......
...@@ -233,6 +233,17 @@ Page({ ...@@ -233,6 +233,17 @@ Page({
console.error("获取服务列表", error) console.error("获取服务列表", error)
}) })
}, },
/**
* 图片加载失败函数
* @param {any} e
*/
binderrorimg(e) {
let errorindex = e.currentTarget.dataset.errorindex;
let up = "serviceList[" + errorindex + "].image";
this.setData({
[up]: '/images/doctor_img.png'
})
},
//登陆后组件回调方法刷新当前页面 //登陆后组件回调方法刷新当前页面
_refreshEvent() { _refreshEvent() {
console.log("刷新"); console.log("刷新");
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<view style='position:relative;height:214rpx;'> <view style='position:relative;height:214rpx;'>
<view class='item' bindtap='goChat' data-item='{{item}}' data-index="{{index}}"> <view class='item' bindtap='goChat' data-item='{{item}}' data-index="{{index}}">
<view class='photo'> <view class='photo'>
<image class='info-img' src='{{item.image || noSrc}}' mode="aspectFill"></image> <image class='info-img' src='{{item.image || noSrc}}' mode="aspectFill" binderror="binderrorimg" data-errorIndex="{{index}}" ></image>
<view class='unread' wx:if='{{item.unreadCount>0}}'>{{item.unreadCount}}</view> <view class='unread' wx:if='{{item.unreadCount>0}}'>{{item.unreadCount}}</view>
</view> </view>
<view class='info' style="{{index == serviceList.length -1?'border-bottom: none':''}}"> <view class='info' style="{{index == serviceList.length -1?'border-bottom: none':''}}">
......
...@@ -416,4 +416,14 @@ Page({ ...@@ -416,4 +416,14 @@ Page({
console.log("刷新"); console.log("刷新");
this.onShow(); this.onShow();
}, },
/**
* 图片加载失败函数
* @param {*} e
*/
binderrorimg(e) {
let up = "t_userInfo.image";
this.setData({
[up]: '/images/doctor_img.png'
})
},
}) })
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</view> </view>
<view class="user"> <view class="user">
<view class="userInfo"> <view class="userInfo">
<image class='user-header' mode="aspectFill" src='{{t_userInfo.image}}'></image> <image class='user-header' mode="aspectFill" src='{{t_userInfo.image}}' binderror="binderrorimg" ></image>
<view class="info"> <view class="info">
<view class="userInfo-a"> <view class="userInfo-a">
<view class='user-name'>{{t_userInfo.name}}</view> <view class='user-name'>{{t_userInfo.name}}</view>
......
...@@ -4,7 +4,7 @@ const app = getApp(); ...@@ -4,7 +4,7 @@ const app = getApp();
Page({ Page({
data: { data: {
list: [], //页面数据展现 list: [], //页面数据展现
userInfo: "",//用户信息 userInfo: "", //用户信息
}, },
onLoad: function () { onLoad: function () {
let that = this; let that = this;
...@@ -24,8 +24,8 @@ Page({ ...@@ -24,8 +24,8 @@ Page({
userInfo: res userInfo: res
}) })
// that.resultNot(res.openid); // that.resultNot(res.openid);
}).catch(error=>{ }).catch(error => {
console.error("首页数据err",error) console.error("首页数据err", error)
}) })
} }
}) })
...@@ -38,8 +38,8 @@ Page({ ...@@ -38,8 +38,8 @@ Page({
this.answer = this.selectComponent("#answer"); this.answer = this.selectComponent("#answer");
}, },
//菜单栏红点提示 //菜单栏红点提示
resultNot(openid) { resultNot(openid) {
console.log("resultNot") console.log("resultNot")
//未做量表提醒await //未做量表提醒await
var data = { var data = {
openid: openid openid: openid
...@@ -54,8 +54,8 @@ Page({ ...@@ -54,8 +54,8 @@ Page({
index: 2 index: 2
}) })
} }
}).catch(error=>{ }).catch(error => {
console.error("菜单栏红点提示",error) console.error("菜单栏红点提示", error)
}) })
}, },
/** /**
...@@ -118,8 +118,26 @@ Page({ ...@@ -118,8 +118,26 @@ Page({
that.setData({ that.setData({
list: res.data list: res.data
}) })
}).catch(error=>{ }).catch(error => {
console.error("医生数据",error) console.error("医生数据", error)
})
},
/**
* 图片加载失败函数
* type 0 临床心理 1 社会心理
* @param {any} e
*/
binderrorimg(e) {
let type = e.currentTarget.dataset.type;
let errorindex = e.currentTarget.dataset.errorindex;
let up;
if (type == 0) {
up = "list.lcxl[" + errorindex + "].image";
} else {
up = "list.shxl[" + errorindex + "].image";
}
this.setData({
[up]: '/images/doctor_img.png'
}) })
}, },
// showDialog() { // showDialog() {
...@@ -133,7 +151,7 @@ Page({ ...@@ -133,7 +151,7 @@ Page({
// console.log('this.answer',this.answer) // console.log('this.answer',this.answer)
// this.answer.showAnswer(); // this.answer.showAnswer();
// }, // },
//确认事件 //确认事件
_cancelEvent() { _cancelEvent() {
console.log('你点击了取消'); console.log('你点击了取消');
this.modal.hideModal(); this.modal.hideModal();
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</view> </view>
<block wx:for="{{list.lcxl}}" wx:key="index"> <block wx:for="{{list.lcxl}}" wx:key="index">
<view class="flex user" bindtap="doctorInfo" data-unionid="{{item.unionid}}" data-unitid="{{item.unitid}}"> <view class="flex user" bindtap="doctorInfo" data-unionid="{{item.unionid}}" data-unitid="{{item.unitid}}">
<image src="{{item.image}}"></image> <image src="{{item.image}}" mode="aspectFill" binderror="binderrorimg" data-type="0" data-errorIndex="{{index}}"></image>
<view> <view>
<view> <view>
<text class="user-name">{{item.name}}</text> <text class="user-name">{{item.name}}</text>
...@@ -98,9 +98,9 @@ ...@@ -98,9 +98,9 @@
<image src="/images/Rounded@2x.png"></image> <image src="/images/Rounded@2x.png"></image>
</view> </view>
</view> </view>
<block wx:for="{{list.shxl}}" wx:key="index"> <block wx:for="{{list.shxl}}" wx:for-item="item" wx:for-index="index" wx:key='index'>
<view class="flex user" bindtap="doctorInfo" data-unitid="{{item.unitid}}" data-unionid="{{item.unionid}}"> <view class="flex user" bindtap="doctorInfo" data-unitid="{{item.unitid}}" data-unionid="{{item.unionid}}">
<image src="{{item.image}}" mode="aspectFill"></image> <image src="{{item.image}}" mode="aspectFill" binderror="binderrorimg" data-type="1" data-errorIndex="{{index}}"></image>
<view> <view>
<view> <view>
<text class="user-name">{{item.name}}</text> <text class="user-name">{{item.name}}</text>
......
...@@ -29,7 +29,7 @@ Page({ ...@@ -29,7 +29,7 @@ Page({
userInfo:res, userInfo:res,
unionid: res.unionid || '', unionid: res.unionid || '',
nickname: res.nickname || res.name || 0, nickname: res.nickname || res.name || 0,
headimgurl: res.headimgurl || '/images/sqicon@2x.png', headimgurl: res.headimgurl || '/images/head-img.png',
isShow:true isShow:true
}) })
// that.resultNot(res.openid) // that.resultNot(res.openid)
...@@ -137,6 +137,7 @@ dial(e) { ...@@ -137,6 +137,7 @@ dial(e) {
phoneNumber: tel, phoneNumber: tel,
}) })
}, },
//设置推送 //设置推送
setPush: function () { setPush: function () {
wx.openSetting() wx.openSetting()
...@@ -146,4 +147,13 @@ _refreshEvent() { ...@@ -146,4 +147,13 @@ _refreshEvent() {
console.log("刷新"); console.log("刷新");
this.onShow(); this.onShow();
}, },
/**
* 图片加载失败函数
* @param {any} e
*/
binderrorimg(){
this.setData({
headimgurl:'/images/head-img.png'
})
},
}) })
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class='user-info'> <view class='user-info'>
<view class='user-name' wx:if='{{nickname!=""}}'>{{nickname}}</view> <view class='user-name' wx:if='{{nickname!=""}}'>{{nickname}}</view>
<button class='user-name' wx:if='{{nickname==0}}' bindtap='getUserInfo'>点击登录</button> <button class='user-name' wx:if='{{nickname==0}}' bindtap='getUserInfo'>点击登录</button>
<image src='{{headimgurl}}' class='header-img'></image> <image src='{{headimgurl}}' class='header-img' binderror="binderrorimg"></image>
</view> </view>
<view class="server"> <view class="server">
<view bindtap='goToURL' data-src='/packageB/myService/myService'> <view bindtap='goToURL' data-src='/packageB/myService/myService'>
......
...@@ -334,7 +334,7 @@ Page({ ...@@ -334,7 +334,7 @@ Page({
} }
let data = { let data = {
payid: that.data.list.payid, payid: that.data.list.payid,
patient_unionid: that.data.list.user.unionid, patient_unionid: that.data.item.unionid,
modular: that.data.list.modular, modular: that.data.list.modular,
lastid: that.data.item.id, lastid: that.data.item.id,
address: that.data.receiveAddress.id, address: that.data.receiveAddress.id,
......
...@@ -507,4 +507,15 @@ Page({ ...@@ -507,4 +507,15 @@ Page({
}) })
wx.hideLoading(); wx.hideLoading();
}, },
/**
* 图片加载失败函数
* @param {any} e
*/
binderrorimg(e) {
let errorindex = e.currentTarget.dataset.errorindex;
let up = "doctorList[" + errorindex + "].image";
this.setData({
[up]: '/images/doctor_img.png'
})
},
}) })
\ No newline at end of file
...@@ -84,9 +84,9 @@ ...@@ -84,9 +84,9 @@
<template is="noRecord" data="{{...noRecord}}" /> <template is="noRecord" data="{{...noRecord}}" />
</view> </view>
<view class="{{filtrateSelect?'content':'content1'}}" wx:if='{{doctorList.length>0}}'> <view class="{{filtrateSelect?'content':'content1'}}" wx:if='{{doctorList.length>0}}'>
<block wx:for="{{doctorList}}" wx:key="index"> <block wx:for="{{doctorList}}" wx:for-index="index" wx:key="index">
<view class="flex user" bindtap="doctorInfo" data-openid="{{item.openid}}" data-unitid="{{item.unitid}}" data-unionid="{{item.unionid}}"> <view class="flex user" bindtap="doctorInfo" data-openid="{{item.openid}}" data-unitid="{{item.unitid}}" data-unionid="{{item.unionid}}">
<image src="{{item.image}}" mode="aspectFill"></image> <image src="{{item.image}}" mode="aspectFill" binderror="binderrorimg" data-errorIndex="{{index}}"></image>
<view class="xixui" wx:if="{{item.is_rest==1}}">休息中</view> <view class="xixui" wx:if="{{item.is_rest==1}}">休息中</view>
<view> <view>
<view> <view>
......
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