Commit 0e4557ab3ea23582a125451573991440f79946df

Authored by wangjialin
Exists in dev_wjl and in 1 other branch dev-wrh

解决冲突

Showing 18 changed files

littleApp_child/app.js View file @ 0e4557a
... ... @@ -25,7 +25,7 @@
25 25 this.globalData.token = userToken
26 26 this.globalData.userId = userId
27 27 this.globalData.currentId = userId[0]
28   - console.log(userToken)
  28 + // console.log(userToken)
29 29  
30 30 // wx.navigateTo({
31 31 // url: 'pages/BloodSugerHome/BloodSugerHome'
32 32  
... ... @@ -67,13 +67,13 @@
67 67 //聊天
68 68 WebIM.conn.listen({
69 69 onOpened: function (message) {
70   - console.log("登录成功")
  70 + // console.log("登录成功")
71 71 wx.setStorageSync('isHxOpend', true)
72 72 // WebIM.conn.setPresence()
73 73 // WebIM.conn.getRoster(rosters)
74 74 },
75 75 onPresence: function (message) {
76   - console.log('onPresence', message)
  76 + // console.log('onPresence', message)
77 77 var pages = getCurrentPages()
78 78 if (message.type == "unsubscribe") {
79 79 pages[0].moveFriend(message)
... ... @@ -98,7 +98,7 @@
98 98 // }
99 99 },
100 100 onTextMessage(message){
101   - console.log("onTextMessage", message);
  101 + // console.log("onTextMessage", message);
102 102 var page = that.getRoomPage();
103 103 if(message){
104 104 if(onMessageError(message)){
105 105  
106 106  
... ... @@ -133,17 +133,17 @@
133 133 key: messageFrom + myName,
134 134 data: that.globalData.unrederMsg[messageFrom + myName],
135 135 success: function () {
136   - console.log('setStorage success')
  136 + // console.log('setStorage success')
137 137 disp.fire("em.xmpp.unreadspot", message);
138 138 }
139 139 })
140   - console.log('消息打印',messageFrom + myName,that.globalData.unrederMsg[messageFrom + myName])
  140 + // console.log('消息打印',messageFrom + myName,that.globalData.unrederMsg[messageFrom + myName])
141 141 }
142 142 }
143 143 }
144 144 },
145 145 onEmojiMessage: function (message) {
146   - console.log("onEmojiMessage", message);
  146 + // console.log("onEmojiMessage", message);
147 147 if(message){
148 148 if(onMessageError(message)){
149 149 msgStorage.saveReceiveMsg(message, msgType.EMOJI);
... ... @@ -151,7 +151,7 @@
151 151 }
152 152 },
153 153 onPictureMessage(message){
154   - console.log("onPictureMessage", message);
  154 + // console.log("onPictureMessage", message);
155 155 var page = that.getRoomPage()
156 156 if(message){
157 157 if(onMessageError(message)){
... ... @@ -186,7 +186,7 @@
186 186 key: messageFrom + myName,
187 187 data: that.globalData.unrederMsg[messageFrom + myName],
188 188 success: function () {
189   - console.log('setStorage success')
  189 + // console.log('setStorage success')
190 190 disp.fire("em.xmpp.unreadspot", message);
191 191 }
192 192 })
... ... @@ -195,7 +195,7 @@
195 195 }
196 196 },
197 197 onAudioMessage: function ( message ) {
198   - console.log("onAudioMessage", message);
  198 + // console.log("onAudioMessage", message);
199 199 var page = that.getRoomPage()
200 200 if(message){
201 201 if(onMessageError(message)){
... ... @@ -232,7 +232,7 @@
232 232 key: messageFrom + myName,
233 233 data: that.globalData.unrederMsg[messageFrom+ myName],
234 234 success: function () {
235   - console.log('setStorage success')
  235 + // console.log('setStorage success')
236 236 disp.fire("em.xmpp.unreadspot", message);
237 237 }
238 238 })
... ... @@ -242,7 +242,7 @@
242 242 },
243 243 // 各种异常
244 244 onError(error){
245   - console.log(error)
  245 + // console.log(error)
246 246 // 16: server-side close the websocket connection
247 247 if(error.type == WebIM.statusCode.WEBIM_CONNCTION_DISCONNECTED && !logout){
248 248 if(WebIM.conn.autoReconnectNumTotal < WebIM.conn.autoReconnectNumMax){
... ... @@ -282,7 +282,7 @@
282 282 disp.fire("em.xmpp.error.tokenErr");
283 283 }
284 284 if (error.type == 'socket_error') {///sendMsgError
285   - console.log('socket_errorsocket_error', error)
  285 + // console.log('socket_errorsocket_error', error)
286 286 wx.showToast({
287 287 title: "网络已断开",
288 288 icon: 'none',
... ... @@ -310,6 +310,7 @@
310 310 wx.getUserInfo({
311 311 success: function (res) {
312 312 that.globalData.userInfo = res.userInfo
  313 + // console.log(res.userInfo,'res.userInfo');
313 314 typeof cb == "function" && cb(that.globalData.userInfo)
314 315 }
315 316 })
littleApp_child/app.json View file @ 0e4557a
... ... @@ -56,7 +56,9 @@
56 56 "pages/article/article",
57 57 "pages/preDocumented/preDocumented",
58 58 "pages/serviceNotice/serviceNotice",
59   - "pages/eatAddress/eatAddress"
  59 + "pages/eatAddress/eatAddress",
  60 + "pages/messageNotification/messageNotification",
  61 + "pages/messageContent/messageContent"
60 62 ]
61 63 }
62 64 ],
littleApp_child/packageA/pages/messageContent/messageContent.js View file @ 0e4557a
  1 +// packageA/pages/messageContent/messageContent.js
  2 +
  3 +var networkUtil = require('../../../utils/network_util.js')
  4 +var api = require('../../../utils/apiFile.js')
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + setObject:{}
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad({id}) {
  18 + networkUtil.showLoading()
  19 + if (id) {
  20 + this.getmessageContent(id)
  21 + }
  22 + },
  23 + getmessageContent:function(id){
  24 + const _that = this
  25 + networkUtil._get(api.getBabyMsgById,{
  26 + msgId:id
  27 + },function (res) {
  28 + console.log(res,'res');
  29 + _that.setData({
  30 + setObject:res.data.object
  31 + })
  32 + wx.hideToast();
  33 + }, function (res) {
  34 + networkUtil.showErrorToast(res.errormsg)
  35 + })
  36 + },
  37 + /**
  38 + * 生命周期函数--监听页面初次渲染完成
  39 + */
  40 + onReady() {
  41 +
  42 + },
  43 +
  44 + /**
  45 + * 生命周期函数--监听页面显示
  46 + */
  47 + onShow() {
  48 +
  49 + },
  50 +
  51 + /**
  52 + * 生命周期函数--监听页面隐藏
  53 + */
  54 + onHide() {
  55 +
  56 + },
  57 +
  58 + /**
  59 + * 生命周期函数--监听页面卸载
  60 + */
  61 + onUnload() {
  62 +
  63 + },
  64 +
  65 + /**
  66 + * 页面相关事件处理函数--监听用户下拉动作
  67 + */
  68 + onPullDownRefresh() {
  69 +
  70 + },
  71 +
  72 + /**
  73 + * 页面上拉触底事件的处理函数
  74 + */
  75 + onReachBottom() {
  76 +
  77 + },
  78 +
  79 + /**
  80 + * 用户点击右上角分享
  81 + */
  82 + onShareAppMessage() {
  83 +
  84 + }
  85 +})
littleApp_child/packageA/pages/messageContent/messageContent.json View file @ 0e4557a
  1 +{
  2 + "navigationBarTitleText": "医院活动通知详情",
  3 + "navigationBarBackgroundColor": "#48C17B",
  4 + "navigationBarTextStyle": "white",
  5 + "backgroundColor": "#d8dbd4",
  6 + "pageOrientation": "auto",
  7 + "usingComponents": {}
  8 +}
littleApp_child/packageA/pages/messageContent/messageContent.wxml View file @ 0e4557a
  1 +<!--pages/messageContent/Count.wxml-->
  2 +<view class="title">
  3 + <view>
  4 + <block >
  5 + <view>{{setObject.title}}</view>
  6 + </block>
  7 + </view>
  8 +</view>
  9 +
  10 +<view class="time-read">
  11 + <text class="time">{{setObject.createdStr}}</text>
  12 + <view class="read" wx:if="{{true}}">
  13 + 阅读量:<text>{{setObject.readNum}}</text>
  14 + </view>
  15 +</view>
  16 +
  17 +
  18 +<!-- penner图 -->
  19 +<view class="penner" wx:if="{{setObject.img}}">
  20 + <image src="{{setObject.img}}" mode=""/>
  21 +</view>
  22 +
  23 +<!-- 内容 -->
  24 +<view class="content">
  25 + <view class="content1">
  26 + {{setObject.content}}
  27 + </view>
  28 +</view>
littleApp_child/packageA/pages/messageContent/messageContent.wxss View file @ 0e4557a
  1 +/* packageA/pages/messageContent/messageContent.wxss */
  2 +
  3 +/* pages/messageContent/Count.wxss */
  4 +.title {
  5 + margin: 56rpx 36rpx 30rpx;
  6 + font-family: Adobe Heiti Std;
  7 + font-size: 34rpx;
  8 + color: #333333;
  9 + line-height: 46rpx;
  10 + text-align: justifyLeft;
  11 + font-style: normal;
  12 + text-transform: none;
  13 +}
  14 +.time-read{
  15 + display: flex;
  16 + margin: 0 36rpx;
  17 + font-family: SourceHanSansCN, SourceHanSansCN;
  18 + font-weight: 400;
  19 + font-size: 24rpx;
  20 + color: #999999;
  21 + text-align: justifyLeft;
  22 + font-style: normal;
  23 + text-transform: none;
  24 +}
  25 +.time-read .time{
  26 + margin-right: 59rpx;
  27 +}
  28 +
  29 +.penner{
  30 + margin: 45rpx 31rpx;
  31 + width: 690rpx;
  32 + height: 294rpx;
  33 + background: #7F7F7F;
  34 + border-radius: 10rpx 10rpx 10rpx 10rpx;
  35 +}
  36 +
  37 +.penner image{
  38 + width: 100%;
  39 + height: 100%;
  40 +}
  41 +.content{
  42 + margin: 20rpx 30rpx;
  43 + font-family: SourceHanSansCN, SourceHanSansCN;
  44 + font-weight: 400;
  45 + font-size: 28rpx;
  46 + color: #333333;
  47 + font-style: normal;
  48 + text-transform: none;
  49 +}
  50 +
  51 +.content .content1{
  52 + margin-bottom: 50rpx;
  53 +}
littleApp_child/packageA/pages/messageNotification/messageNotification.js View file @ 0e4557a
  1 +// pages/messageNotification/message.js
  2 +
  3 +// 网络请求工具类
  4 +var networkUtil = require('../../../utils/network_util.js')
  5 +var api = require('../../../utils/apiFile.js')
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + notificationList:[], // 消息通知列表
  13 + currentPage: 1, // 当前页码
  14 + limit: 10, // 每页显示的数据条数
  15 + hasMoreData: true, // 是否有更多数据可加载
  16 + babyId:null,
  17 + formattedDate:null
  18 + },
  19 +
  20 + //获取消息通知
  21 + getNotificationList:function(){
  22 +
  23 + },
  24 +
  25 + // 下拉加载
  26 + loadMore:function(){
  27 + const self = this;
  28 + if (!self.data.hasMoreData) {
  29 + return; // 如果没有更多数据,不执行任何操作
  30 + }
  31 + // 使用 setData 更新页面状态为正在加载
  32 + self.setData({
  33 + isLoading: true
  34 + });
  35 + networkUtil._get(api.getMsgList, {
  36 + page: self.data.currentPage,
  37 + limit: self.data.limit,
  38 + babyId:self.data.babyId,
  39 + }, function(res) {
  40 + if (res.data && res.data.data.length > 0) {
  41 + const newData = self.data.notificationList.concat(res.data.data);
  42 +
  43 +
  44 +
  45 + self.setData({
  46 + notificationList: newData,
  47 + currentPage: self.data.currentPage + 1,
  48 + isLoading: false
  49 + });
  50 + // 判断是否还有更多数据
  51 + const hasMoreData = res.data.pageInfo.page < res.data.pageInfo.lastPage
  52 + // 更新页面数据(假设你在微信小程序或其他使用setData方法的框架中)
  53 + self.setData({
  54 + hasMoreData: hasMoreData
  55 + });
  56 +
  57 + wx.hideToast();
  58 + } else {
  59 + // 如果没有返回数据,表示没有更多数据了
  60 + self.setData({
  61 + hasMoreData: false,
  62 + isLoading: false
  63 + });
  64 + }
  65 + }, function(res) {
  66 + networkUtil.showErrorToast(res.errormsg);
  67 + wx.hideToast();
  68 + });
  69 + },
  70 +
  71 + // 跳转
  72 + messageBtn:function(e){
  73 + const id = e.currentTarget.dataset.index
  74 + if(id){
  75 + setTimeout(() =>{
  76 + wx.navigateTo({
  77 + url: `/packageA/pages/messageContent/messageContent?id=${id}`,
  78 + })
  79 + },100)
  80 + } else {
  81 + return
  82 + }
  83 + },
  84 + // 快速预约课程
  85 + goAddQuestion: function(e) {
  86 + networkUtil.showLoading();
  87 + var self = this;
  88 + wx.showModal({
  89 + title: '提示',
  90 + confirmText: '线上',
  91 + content:`您目前是要线上预约还是现场预约?`,
  92 + cancelText: '现场',
  93 + success(res) {
  94 + if (res.confirm) {
  95 + var param = { courseId: e.target.dataset.id, type: 1 };
  96 + networkUtil._get(api.orderCourse, param, function(res) {
  97 + if (res.data.errorcode == 0) {
  98 + networkUtil.showToast('预约成功');
  99 + self.loadMore();
  100 + }
  101 + },
  102 + function(res) {
  103 + networkUtil.showErrorToast(res.errormsg);
  104 + wx.hideToast();
  105 + });
  106 + } else if (res.cancel) {
  107 + var param = { courseId: e.target.dataset.id, type: 2 };
  108 + networkUtil._get(api.orderCourse, param, function(res) {
  109 + // console.log(ress,'res');
  110 + if (res.data.errorcode == 0) {
  111 + networkUtil.showToast('预约成功');
  112 + self.loadMore();
  113 + }
  114 + }
  115 + , function(res) {
  116 + networkUtil.showErrorToast(res.errormsg);
  117 + wx.hideToast();
  118 + }
  119 + );
  120 + }
  121 + }
  122 + });
  123 + },
  124 + /**
  125 + * 生命周期函数--监听页面加载
  126 + */
  127 + onLoad(options) {
  128 + networkUtil.showLoading()
  129 + this.setData({
  130 + babyId:wx.getStorageSync('erid')
  131 + })
  132 + },
  133 +
  134 + /**
  135 + * 生命周期函数--监听页面初次渲染完成
  136 + */
  137 + onReady() {
  138 +
  139 + },
  140 +
  141 + /**
  142 + * 生命周期函数--监听页面显示
  143 + */
  144 + onShow() {
  145 + this.loadMore()
  146 +
  147 + },
  148 +
  149 + /**
  150 + * 生命周期函数--监听页面隐藏
  151 + */
  152 + onHide() {
  153 +
  154 + },
  155 +
  156 + /**
  157 + * 生命周期函数--监听页面卸载
  158 + */
  159 + onUnload() {
  160 +
  161 + },
  162 +
  163 + /**
  164 + * 页面相关事件处理函数--监听用户下拉动作
  165 + */
  166 + onPullDownRefresh() {
  167 +
  168 + },
  169 +
  170 + /**
  171 + * 页面上拉触底事件的处理函数
  172 + */
  173 + onReachBottom() {
  174 +
  175 + },
  176 +
  177 + /**
  178 + * 用户点击右上角分享
  179 + */
  180 + onShareAppMessage() {
  181 +
  182 + }
  183 +})
littleApp_child/packageA/pages/messageNotification/messageNotification.json View file @ 0e4557a
  1 +{
  2 + "navigationBarTitleText": "医院活动通知",
  3 + "navigationBarBackgroundColor": "#48C17B",
  4 + "navigationBarTextStyle": "white",
  5 + "backgroundColor": "#d8dbd4",
  6 + "pageOrientation": "auto",
  7 + "usingComponents": {}
  8 +}
littleApp_child/packageA/pages/messageNotification/messageNotification.wxml View file @ 0e4557a
  1 +<!--packageA/pages/messageNotification/messageNotification.wxml-->
  2 +<!-- <text>packageA/pages/messageNotification/messageNotification.wxml</text> -->
  3 +
  4 +
  5 +<scroll-view scroll-y="true" bindscrolltolower="loadMore" style="height: 100vh;">
  6 + <view class="messageNotification">
  7 + <!-- -->
  8 + <!-- -->
  9 +
  10 + <view bind:tap="messageBtn" data-index="{{item.id}}" wx:for="{{notificationList}}" wx:for-item="item"
  11 + wx:for-index="index"
  12 + wx:key="index" class="messageNotification-item"
  13 + >
  14 + <view class="head">
  15 + <view class="notice">
  16 + <view class="notice-title tile-color" wx:if="{{true}}">通知</view>
  17 + <text class="text"></text>
  18 + </view>
  19 + <view class="time">
  20 + {{item.createdStr}}
  21 + </view>
  22 + </view>
  23 + <view class="content">
  24 + <view class="title-head" style="display: flex; justify-content: space-between; align-items: center;">
  25 + <view>
  26 + <text>{{item.title}}</text>
  27 + </view>
  28 + </view>
  29 + <view class="title-content">
  30 + {{item.content}}
  31 + </view>
  32 + </view>
  33 + </view>
  34 +</view>
  35 +
  36 +</scroll-view>
littleApp_child/packageA/pages/messageNotification/messageNotification.wxss View file @ 0e4557a
  1 +/* packageA/pages/messageNotification/messageNotification.wxss */
  2 +
  3 +.messageNotification {
  4 + width: 100vw;
  5 + height: 100vh;
  6 + background-color: #F2F2F2;
  7 +}
  8 +
  9 +.messageNotification .messageNotification-item{
  10 + width: 690rpx;
  11 + margin: 28rpx 30rpx;
  12 + background: #FFFFFF;
  13 + border-radius: 6rpx 6rpx 6rpx 6rpx;
  14 + }
  15 +
  16 + .messageNotification-item .head{
  17 + height: 100rpx;
  18 + display: flex;
  19 + align-items: center;
  20 + justify-content: space-between;
  21 + border-bottom: 2rpx solid #F4F4F4;
  22 + padding: 0 36rpx;
  23 + }
  24 +
  25 + .head .time{
  26 + font-family: SourceHanSansSC, SourceHanSansSC;
  27 + font-weight: 400;
  28 + font-size: 22rpx;
  29 + color: #636363;
  30 + line-height: 0rpx;
  31 + text-align: left;
  32 + font-style: normal;
  33 + text-transform: none;
  34 + }
  35 +
  36 + .messageNotification-item .notice{
  37 + position: relative;
  38 + }
  39 +
  40 + .notice .text {
  41 + position: absolute;
  42 + top: 10rpx;
  43 + left: -20rpx;
  44 + width: 10rpx;
  45 + height: 10rpx;
  46 + background: #FF2727;
  47 + border-radius: 5rpx 5rpx 5rpx 5rpx
  48 + }
  49 +
  50 + .notice .notice-title {
  51 + font-family: SourceHanSansSC, SourceHanSansSC;
  52 + font-weight: 400;
  53 + font-size: 22rpx;
  54 + color: #FFFFFF;
  55 + width: 56rpx;
  56 + height: 31rpx;
  57 + line-height: 31rpx;
  58 + text-align: center;
  59 + }
  60 + .notice .tile-color{
  61 + background: #FF6D89;
  62 + border-radius: 3rpx 3rpx 3rpx 3rpx;
  63 + }
  64 + .notice .tile-color1 {
  65 + background: #FD992F;
  66 + border-radius: 3rpx 3rpx 3rpx 3rpx;
  67 + }
  68 +
  69 + .messageNotification-item .content{
  70 + padding: 30rpx;
  71 +
  72 + }
  73 +
  74 + .content .title-head{
  75 + font-family: SourceHanSansSC, SourceHanSansSC;
  76 + font-weight: 400;
  77 + font-size: 28rpx;
  78 + color: #0B0B0B;
  79 + margin-bottom: 20rpx;
  80 + font-style: normal;
  81 + text-transform: none;
  82 + }
  83 + .content .title-content{
  84 + font-family: SourceHanSansSC, SourceHanSansSC;
  85 + font-weight: 400;
  86 + font-size: 24rpx;
  87 + color: #999999;
  88 + font-style: normal;
  89 + text-transform: none;
  90 + display: -webkit-box;
  91 + -webkit-line-clamp: 3; /* 设置最大行数 */
  92 + -webkit-box-orient: vertical; /* 设置为垂直方向 */
  93 + overflow: hidden; /* 超出部分隐藏 */
  94 + }
littleApp_child/pages/chatHis/chatHis.js View file @ 0e4557a
... ... @@ -19,7 +19,7 @@
19 19 * 生命周期函数--监听页面加载
20 20 */
21 21 onLoad: function (options) {
22   - console.log(options)
  22 + // console.log(options)
23 23 let me = this;
24 24 this.setData({
25 25 illnessList:{ title:'疾病类型',
littleApp_child/pages/home/home.js View file @ 0e4557a
... ... @@ -29,6 +29,7 @@
29 29 Page({
30 30 /*---------属性变量--------*/
31 31 data: {
  32 + MsgCount:null,
32 33 isLogin: '',
33 34 item_big_height: 0,
34 35 item_small: 0,
35 36  
36 37  
... ... @@ -84,13 +85,20 @@
84 85 riskBase: false,
85 86 //是否开通疾病指导
86 87 riskDise:false,
87   - yc:0
  88 + yc:0,
  89 + hospitalId1:null,
  90 + userInfoDate:{},
  91 + erid:null
88 92 },
89 93 /*---------生命周期--------*/
90 94 onLoad: function(options) {
  95 + // console.log(app.globalData,'options1121');
  96 + this.getUserInfo(app.globalData.token)
91 97 hospitalId = options.hospitalId;
92 98 this.calculatePageSize()
93   -
  99 + this.setData({
  100 + hospitalId1:options.hospitalId
  101 + })
94 102 // 网络监听
95 103 this.networkStatusChange()
96 104 var that = this
97 105  
... ... @@ -120,10 +128,34 @@
120 128 }
121 129  
122 130 },
  131 + setNotification:function(){
  132 + const _that = this
  133 + networkUtil._get(api.getMsgList,{
  134 + page: 1,
  135 + limit: 20,
  136 + babyId:_that.data.erid,
  137 + },function (res) {
  138 + if (res.data.data.length > 0 ) {
  139 + wx.navigateTo({
  140 + url: '/packageA/pages/messageNotification/messageNotification',
  141 + })
  142 + } else {
  143 + wx.showModal({
  144 + title: '提示',
  145 + content: '当前没有医院活动通知',
  146 + showCancel: false,
  147 + })
  148 + }
  149 + }, function (res) {
  150 + networkUtil.showErrorToast(res.errormsg)
  151 + })
  152 +
  153 +
  154 + },
123 155 onShow: function() {
124 156 // 生命周期函数--监听页面显示
125 157 if (wx.getStorageSync("access_token") != null&&wx.getStorageSync("access_token")) {
126   - console.log(wx.getStorageSync("access_token"))
  158 + // console.log(wx.getStorageSync("access_token"))
127 159 this.connectWebIM()
128 160  
129 161 }
... ... @@ -143,6 +175,23 @@
143 175 // 移除监听
144 176 event.remove('likeChanged', this);
145 177 },
  178 +
  179 + getBabyMsgCountByIdNum:function(id){
  180 + const _that = this
  181 + networkUtil._get(api.getBabyMsgCountById,{
  182 + babyId:id
  183 + },function (res) {
  184 + // console.log(res.data.object,'res1111');
  185 + _that.setData({
  186 + MsgCount:res.data.object
  187 + })
  188 + wx.hideToast();
  189 + }, function (res) {
  190 + networkUtil.showErrorToast(res.errormsg)
  191 + })
  192 + },
  193 +
  194 +
146 195 /*---------交互--------*/
147 196 // 下拉刷新回调接口
148 197 onPullDownRefresh: function() {
... ... @@ -263,7 +312,7 @@
263 312 toBefore() {
264 313 var index = this.data.babyIndex
265 314 index--
266   - console.log('index', index)
  315 + // console.log('index', index)
267 316 var left = true
268 317 var right = true
269 318 if (index == 0) {
... ... @@ -280,7 +329,7 @@
280 329 toAfter() {
281 330 var index = this.data.babyIndex
282 331 index++
283   - console.log('index', index)
  332 + // console.log('index', index)
284 333 var left = true
285 334 var right = true
286 335 if (index == app.globalData.userId.length - 1) {
... ... @@ -417,7 +466,7 @@
417 466 var self = this
418 467 var param = {}
419 468 networkUtil._get(api.goods, param, function(res) {
420   - console.log(res)
  469 + // console.log(res)
421 470 res.data.data.map(function(item) {
422 471 if (item.id == 7) {
423 472 if (item.status == 1) {
... ... @@ -440,7 +489,7 @@
440 489 })
441 490 },
442 491 getAccessToken() {
443   - console.log('getAccessToken')
  492 + // console.log('getAccessToken')
444 493 var that = this
445 494 var token = '';
446 495 var options = {
... ... @@ -448,7 +497,7 @@
448 497 user: wx.getStorageSync('hxName'),
449 498 pwd: wx.getStorageSync('hxPassWord'),
450 499 success: function (res) {
451   - console.log("conn success:", res);
  500 + // console.log("conn success:", res);
452 501 wx.setStorageSync("access_token", res.data.access_token)
453 502 token = res.data.access_token
454 503 },
... ... @@ -472,7 +521,7 @@
472 521 })
473 522 },
474 523 connectWebIM() {
475   - console.log('开始连接')
  524 + // console.log('开始连接')
476 525 //WebIM.conn.close()
477 526 var that = this
478 527 var options = {
... ... @@ -510,7 +559,7 @@
510 559 param.type = 2
511 560 }
512 561 networkUtil._get(api.userInfo + app.globalData.currentId, param, function(res) {
513   - console.log('获取用户信息', res)
  562 + // console.log('获取用户信息1212', res)
514 563 if (res.data.data.bzstatus==1){
515 564 self.data.riskBase=true;
516 565 }else{
... ... @@ -554,7 +603,12 @@
554 603 'hospitalId':app.globalData.userInfo.hospitalId
555 604 }
556 605 networkUtil._post(api.getBabyBuildPidInfo,param,function(res){
557   - console.log(res.data.data)
  606 + wx.setStorageSync('erid',res.data.data.id)
  607 + self.getBabyMsgCountByIdNum(res.data.data.id)
  608 + // self.setNotification(res.data.data.id)
  609 + self.setData({
  610 + erid:res.data.data.id
  611 + })
558 612 app.globalData.encoded = res.data.data.encoded;
559 613 app.globalData.openDisease = res.data.data.openDisease;
560 614 if(res.data.data.openDisease == '2'){
... ... @@ -582,7 +636,7 @@
582 636 limit: 100,
583 637 days: days
584 638 }, function(res) {
585   - console.log('获取文章信息', res.data.list)
  639 + // console.log('获取文章信息', res.data.list)
586 640 artCache[self.data.babyIndex] = res.data.list
587 641 self.setArtInfo(res.data.list)
588 642 }, function(res) {
... ... @@ -596,6 +650,7 @@
596 650 app.globalData.userInfo = data
597 651 self.setData({
598 652 userData: data,
  653 + userInfoDate:data,
599 654 tourist: getApp().globalData.tourist
600 655 })
601 656 },
... ... @@ -609,7 +664,7 @@
609 664 },
610 665 // 文章点赞
611 666 articleLike(e) {
612   - console.log(e)
  667 + // console.log(e)
613 668 var self = this
614 669 // 已经点赞
615 670 if (e.currentTarget.dataset.islike == 1) {
... ... @@ -631,7 +686,7 @@
631 686 },
632 687 // 标签页面
633 688 clickLabel(e) {
634   - console.log(e)
  689 + // console.log(e)
635 690 wx.navigateTo({
636 691 url: '../articleLists/articleLists?category=' + e.currentTarget.dataset.categary,
637 692 })
... ... @@ -664,8 +719,8 @@
664 719 },
665 720 // 获取验证码
666 721 getVerifyCode: function(e) {
667   - console.log("name:" + name)
668   - console.log("phone:" + phone)
  722 + // console.log("name:" + name)
  723 + // console.log("phone:" + phone)
669 724 // name = '小向阳'
670 725 // phone = '18202810912'
671 726 if (timeCount < 60) {
672 727  
673 728  
... ... @@ -756,14 +811,14 @@
756 811 }
757 812 if (getApp().globalData.openInfo.mpid) {
758 813 param.gzopenid = getApp().globalData.openInfo.mpid
759   - console.log('绑定mpid', param)
  814 + // console.log('绑定mpid', param)
760 815 }
761 816 if (getApp().globalData.openInfo.childCode) {
762 817 param.jscode = getApp().globalData.openInfo.childCode
763   - console.log('绑定code', param)
  818 + // console.log('绑定code', param)
764 819 }
765 820 networkUtil._get(api.verifyCode, param, function(res) {
766   - console.log(res)
  821 + // console.log(res)
767 822 self.loginSuccess(res.data)
768 823 }, function(res) {
769 824 networkUtil.showErrorToast(res.errormsg)
... ... @@ -827,7 +882,7 @@
827 882 doctorId:this.data.userData.disData.doctorId
828 883 }
829 884 wx.setStorageSync('serviceId',serviceId)
830   - console.log(nameList)
  885 + // console.log(nameList)
831 886 wx.navigateTo({
832 887 url: '../consulting/consulting?username='+ JSON.stringify(nameList)
833 888 })
... ... @@ -841,6 +896,7 @@
841 896 'hospitalId':app.globalData.userInfo.hospitalId
842 897 }
843 898 networkUtil._post(api.getBabyBuildPidInfo,param,function(res){
  899 + // console.log(res,'res1212112');
844 900 if (res.data.data) {
845 901 wx.navigateTo({url: '/packageA/pages/graph/graph?id=' + res.data.data.id })
846 902 }
... ... @@ -879,7 +935,6 @@
879 935 memberId:this.data.userData.disData.memberId,
880 936 doctorId:this.data.userData.disData.doctorId
881 937 }
882   - console.log(nameList)
883 938 wx.navigateTo({
884 939 url: '../doctorLists/doctorLists?username='+ JSON.stringify(nameList),
885 940 })
... ... @@ -905,7 +960,7 @@
905 960 var myName = wx.getStorageSync("hxName");
906 961 WebIM.conn.listRooms({
907 962 success: function(rooms){
908   - console.log(rooms)
  963 + // console.log(rooms)
909 964 rooms.map((item) => {
910 965 wx.getStorage({
911 966 key: item.roomId + myName,
... ... @@ -914,7 +969,7 @@
914 969 if(unreadMas){
915 970 num += unreadMas.length;
916 971 }
917   - console.log(num)
  972 + // console.log(num)
918 973 that.setData({unTotleReadCount:num})
919 974 }
920 975 })
littleApp_child/pages/home/home.wxml View file @ 0e4557a
1 1 <!--首页-->
2 2 <!--主机类型-->
3 3 <!-- <view class="promptText" wx:if="{{HOSTType != 1 && HOSTType != 3}}">--{{HOSTTypeText}}--</view> -->
  4 +
4 5 <view class="backgroundView" style="background: #48C17B" wx:if="{{pageType == 0}}">
5 6 </view>
  7 +
  8 +
6 9 <!--首页模块-->
7 10 <view class="backgroundView" wx:if="{{pageType == 2}}">
8 11 <!-- <image class="TopBgImage" src=""></image> -->
9 12 <!--顶部红色有头像等信息的栏目-->
  13 +
10 14 <view class="TopBar" style='height:{{tourist == false ? 212 : 152}}px'>
11 15 <!--头像-->
  16 + <view class="Notification" bind:tap="setNotification" wx:if="{{userData.hospitalId == 666668}}">
  17 + <image src="../../source/xiaox.png" mode=""/>
  18 + <text style="color: #fff;" wx:if="{{MsgCount !== 0 || MsgCount == null }}">{{MsgCount || ''}}</text>
  19 + </view>
12 20 <image class="avatar" bindtap="tapAvatar" src="{{userData.avatar.medium ? userData.avatar.medium : ''}}" background-size="cover"></image>
13 21 <!--用户名-->
14 22 <!-- <view class="top_name" wx:if="{{babys.length > 1}}">
... ... @@ -105,7 +113,7 @@
105 113 <image src="../../source/icon_consult@2x.png" style="{{item_small}}" class="foundation_item_small_image"></image>
106 114 <view class="foundation_item_small_text">专家咨询</view>
107 115 </navigator>
108   - <navigator class="foundation_item_small" bind:tap="goGraph" wx:if="{{yc==1}}">
  116 + <navigator wx:if="{{userData.hospitalId !== 666668}}" class="foundation_item_small" bind:tap="goGraph">
109 117 <image src="../../source/graph.jpg" style="{{item_small}}" class="foundation_item_small_image"></image>
110 118 <view class="foundation_item_small_text">身高体重曲线</view>
111 119 </navigator>
... ... @@ -117,7 +125,7 @@
117 125 <image src="../../source/jianchajilu.png" style="{{item_small}}" class="foundation_item_small_image"></image>
118 126 <view class="foundation_item_small_text">中医指导文章</view>
119 127 </navigator>
120   - <navigator class="foundation_item_small" bind:tap="goServiceNotice">
  128 + <navigator wx:if="{{userData.hospitalId !== 666668}}" class="foundation_item_small" bind:tap="goServiceNotice">
121 129 <image src="../../source/jianchajilu.png" style="{{item_small}}" class="foundation_item_small_image"></image>
122 130 <view class="foundation_item_small_text">服务名目通知</view>
123 131 </navigator>
littleApp_child/pages/home/home.wxss View file @ 0e4557a
... ... @@ -352,4 +352,32 @@
352 352 .navigator_class {
353 353 width: 100%;
354 354 }
  355 +
  356 +
  357 +
  358 +/* 消息通知 */
  359 +.Notification{
  360 + position: absolute;
  361 + width: 54rpx;
  362 + height: 54rpx;
  363 + top: 40rpx;
  364 + right: 40rpx;
  365 +}
  366 +
  367 +.Notification image {
  368 +width: 100%;
  369 +height: 100%;
  370 +}
  371 +.Notification text {
  372 + position: absolute;
  373 + top: -20rpx;
  374 + right: -14rpx;
  375 + width: 40rpx;
  376 + height: 40rpx;
  377 + background: #CF3350;
  378 + border-radius: 50%;
  379 + font-size: 30rpx;
  380 + text-align: center;
  381 + line-height: 40rpx;
  382 +}
littleApp_child/pages/login/login.js View file @ 0e4557a
... ... @@ -87,11 +87,11 @@
87 87 var param = { code: e.detail.value.code, phone: phone }
88 88 if (getApp().globalData.openInfo.mpid) {
89 89 param.gzopenid = getApp().globalData.openInfo.mpid
90   - console.log('绑定mpid', param)
  90 + // console.log('绑定mpid', param)
91 91 }
92 92 if (getApp().globalData.openInfo.childCode) {
93 93 param.jscode = getApp().globalData.openInfo.childCode
94   - console.log('绑定code', param)
  94 + // console.log('绑定code', param)
95 95 }
96 96 networkUtil._get(api.verifyCode, param, function (res) {
97 97 console.log(res)
littleApp_child/source/xiaox.png View file @ 0e4557a

2.77 KB

littleApp_child/utils/apiFile.js View file @ 0e4557a
... ... @@ -114,6 +114,12 @@
114 114 // 身长体重曲线
115 115 getGraphEcharts: '/queryBabyCurve',
116 116 // 中医指导文章
117   - getArticle: 'baby/queryArticle'
  117 + getArticle: 'baby/queryArticle',
  118 + // 消息列表
  119 + getMsgList:'babyMsgList',
  120 + // 通知详情
  121 + getBabyMsgById :'getBabyMsgById',
  122 + // 消息记录
  123 + getBabyMsgCountById:'getBabyMsgCountById'
118 124 }
littleApp_child/utils/network_util.js View file @ 0e4557a
... ... @@ -17,7 +17,7 @@
17 17 case 3:
18 18 return 'https://weixin-bj.healthbaby.com.cn/';
19 19 case 4:
20   - return 'http://localhost:9090/mombaby/'
  20 + return 'http://192.168.0.15:8084/'
21 21 }
22 22 }
23 23