Commit 107cfc10 by liuquan

A:IM量表修改 1.判断是否答完,不可重复答题 2.IM量表答完题会发送报告 3.答完IM量表会跳回聊天房间

parent 5e7955f7
......@@ -13,7 +13,8 @@
"pages/dati03/dati03",
"pages/dati04/dati04",
"pages/info/info",
"pages/info1/info1"
"pages/info1/info1",
"pages/dati05/dati05"
],
"subpackages": [
{
......
......@@ -1422,7 +1422,7 @@ Page({
let that = this
let id = e.currentTarget.dataset.id; //量表id
let res_id = e.currentTarget.dataset.id; //量表id
let lbname = e.currentTarget.dataset.lbname; //量表id
let lbname = e.currentTarget.dataset.lbname; //量表名称
let time = e.currentTarget.dataset.time; //量表时间
let is_type = e.currentTarget.dataset.istype; //量表是否允许查看
wx.showModal({
......@@ -1445,11 +1445,11 @@ Page({
data: JSON.stringify({
type: 'report',
content: JSON.stringify({
id,
res_id,
lbname,
time,
is_type
id, //量表id
res_id, //量表id
lbname, //量表名称
time, //量表时间
is_type //量表是否允许查看
})
}),
description: "",
......@@ -1510,13 +1510,28 @@ Page({
/**心理体检 */
getCheckup: Util.debouce(function (e) {
wx.showLoading();
let that = this;
let data = {}
let code=1;
data.inquiry_id = e.currentTarget.dataset.id;
let status= e.currentTarget.dataset.status?e.currentTarget.dataset.status:1;
Service.getIsAnswer({inquiryid:data.inquiry_id,groupID: that.data.groupID}).then((res)=>{
if(res.code==0){
code=res.code;
that.setData({
errorToptips: res.msg
})
}else{
/**
* @todo 修改im发生量表收费
*/
let status= e.currentTarget.dataset.status?e.currentTarget.dataset.status:1;
let url;
let roomService={
t_unionid: that.data.t_unionid,
groupID: that.data.groupID,
orderId:that.data.orderId
}
wx.setStorageSync('roomService', roomService);
if (status == 0) {
url=`/pages/info/info?inquiry=2&inquiry_id=${e.currentTarget.dataset.id}`;
wx.reLaunch({
......@@ -1525,7 +1540,6 @@ Page({
} else {
url= `/pages/info/info?otype=1&inquiry=2&inquiry_id=${e.currentTarget.dataset.id}`;
Service.getTestInfo(data).then((res) => {
console.log("getCheckup", res)
if (res.code == 1) {
var data = {
t_openid: res.data.openid,
......@@ -1541,6 +1555,8 @@ Page({
url: url,
})
}
}
})
wx.hideLoading();
}, 1000, true),
//微信获取手机号
......
......@@ -91,7 +91,7 @@ Page({
var that = this
var data = {
page: page,
// unionid:'oHhp80XTpjf-JKvU94VEztv3aLhc',
// unionid:'oHhp80QCN2WjClijvSyhkEFQcUwY',
unionid: wx.getStorageSync('data').unionid,
status: status
};
......
......@@ -61,6 +61,7 @@ Page({
*/
getScale(e) {
let that = this;
wx.removeStorageSync('roomService');
if (this.data.repeatClick) {
this.setData({
repeatClick: false
......
......@@ -402,8 +402,21 @@ Page({
})
}
} else if (res == 0) {
wx.removeStorageSync('tplbDetail')
wx.removeStorageSync('weiLb')
wx.removeStorageSync('tplbDetail');
wx.removeStorageSync('weiLb');
let roomService =wx.getStorageSync('roomService');
//判断是否从IM跳入
if(roomService){
wx.reLaunch({
url: `/packageA/chat/chat?t_unionid=${roomService.t_unionid}&groupID=${roomService.groupID}&orderId=${roomService.orderId}`,
success: function() {
that.setData({
flag: true
})
wx.removeStorageSync('roomService');
}
})
}else{
wx.reLaunch({
url: '/pages/my/my',
success: function() {
......@@ -414,6 +427,7 @@ Page({
}
})
}
}
})
},
fail(e) {
......
......@@ -320,6 +320,19 @@ Page({
} else if (res == 0) {
wx.removeStorageSync('tplbDetail')
wx.removeStorageSync('weiLb')
let roomService =wx.getStorageSync('roomService');
//判断是否从IM跳入
if (roomService) {
wx.reLaunch({
url: `/packageA/chat/chat?t_unionid=${roomService.t_unionid}&groupID=${roomService.groupID}&orderId=${roomService.orderId}`,
success: function () {
that.setData({
flag: true
})
wx.removeStorageSync('roomService');
}
})
} else {
wx.reLaunch({
url: '/pages/my/my',
success: function () {
......@@ -330,6 +343,7 @@ Page({
}
})
}
}
})
},
fail(e) {
......
......@@ -91,11 +91,11 @@ Page({
})
} else {
console.log("loadData",2);
console.log("loadData", 2);
this.loadData();
}
} else {
console.log("loadData",1);
console.log("loadData", 1);
this.loadData();
}
}
......@@ -419,7 +419,7 @@ Page({
wx.setStorageSync("timeArr", arr);
}
},
tijiao:Util.debouce(function () {
tijiao: Util.debouce(function () {
let that = this;
this.setData({
sc: false
......@@ -612,6 +612,19 @@ Page({
setTimeout(function () {
wx.removeStorageSync('tplbDetail')
wx.removeStorageSync('weiLb')
let roomService =wx.getStorageSync('roomService');
//判断是否从IM跳入
if (roomService) {
wx.reLaunch({
url: `/packageA/chat/chat?t_unionid=${roomService.t_unionid}&groupID=${roomService.groupID}&orderId=${roomService.orderId}`,
success: function () {
that.setData({
flag: true
})
wx.removeStorageSync('roomService');
}
})
} else {
wx.reLaunch({
url: '/pages/my/my',
success: function () {
......@@ -621,6 +634,7 @@ Page({
wx.removeStorageSync('lb_descript')
}
})
}
}, 2000)
}
})
......@@ -631,7 +645,7 @@ Page({
complete: function (e) {}
})
}
},1000,true),
}, 1000, true),
onReady: function () {
let that = this;
// setTimeout(function () {
......
{
"enablePullDownRefresh": false
}
\ No newline at end of file
<view class="warp" style="height:{{winH}}px;">
<view class="con">
<text class='con-first'>{{lifeName[item.type - 1]}}</text>
<text style='margin-top: 10rpx;'>{{item.con}}({{eName}})</text>
</view>
<block wx:for="{{item.answer}}" wx:for-item="itemName" wx:for-index="index1" wx:key="*this">
<block wx:if='{{true}}'>
<view class=" answer {{active == index1?'s-active':''}}" bindtap='selectData' data-index="{{index1}}"
data-answer="{{itemName}}" data-score="{{item.score[index1]}}" data-record="{{current}}" data-btnflag='0'>
<text>{{itemName}}</text>
</view>
</block>
</block>
</view>
<block wx:if='{{true}}'>
<view class="btn {{current<all-1?'show':'hid'}}">
<view class="menuebtn1 {{current>0?'menuebtn-active':''}}" bindtap='prev'>上一题</view>
</view>
<view class="btn {{all==current+1?'show':'hid'}}">
<view class="menuebtn {{current>0?'menuebtn-active':''}}" bindtap='prev'>上一题</view>
<view class="menuebtn {{disab?'show':'hid'}} " style='margin-left:40rpx;'>提交</view>
<view class="menuebtn menuebtn-active {{disab?'hid':'show'}} " style='margin-left:40rpx;' bindtap='tijiao'>提交</view>
</view>
</block>
<view class='all-item'>
<text>{{current+1}}/{{all}}</text>
</view>
\ No newline at end of file
page {
background-image: url(https://static.xiaodongai.com/xiaodong_yiyuan/kongtian/Uploads/Picture/uid2/member/20180129/5a6ee68692cd8.png);
background-size: 36rpx 36rpx;
}
.line_top {
background: #cecece;
}
.warp {
width: 690rpx;
margin: 29rpx auto;
/* height: 500rpx; */
border: 0.5px solid #e3e3e3;
/* border-bottom: *//* border-radius: 18rpx; */
background: #fff;
overflow: hidden;
}
.con {
padding: 40rpx 30rpx;
border-bottom: 0.5px solid #e3e3e3;
}
/* .con text:nth-child(1){
color: #2684ff;
display: block;
font-family: "PingFang-SC-Medium";
font-size: 28rpx;
letter-spacing: 5rpx;
} */
.con text {
color: #179259;
display: block;
/* margin-top: 30rpx; */
font-family: "PingFang-SC-Bold";
font-size: 36rpx;
letter-spacing: 5rpx;
font-weight: bold;
}
.answer {
min-height: 30rpx;
width: 630rpx;
border-bottom: 0.5px solid #e3e3e3;
padding: 30rpx 30rpx;
font-family: "PingFang-SC-Bold";
font-size: 32rpx;
color: #666;
font-weight: bold;
display: table;
}
.shehui{
width: 345rpx;
/* border-left: 0.5px solid #e3e3e3; */
/* box-sizing: border-box; */
float: left;
}
.answer1 {
min-height: 30rpx;
width: 285rpx;
border-bottom: 0.5px solid #e3e3e3;
padding: 30rpx 30rpx;
font-family: "PingFang-SC-Bold";
font-size: 32rpx;
color: #666;
font-weight: bold;
display: table;
text-align: center;
/* border-left: 0.5px solid #e3e3e3; */
/* box-sizing: border-box; */
float: left;
}
.warp .answer:last-child {
/* border-bottom: none; */
}
.answer text {
vertical-align: middle;
display: table-cell;
}
.answer1 text {
vertical-align: middle;
display: table-cell;
}
.s-active {
background: #179259;
color: #fff;
}
.btn {
height: 88rpx;
width: 690rpx;
/* margin: 30rpx auto; *//* margin-top: 30rpx; */
position: fixed;
left: 50%;
margin-left: -345rpx;
bottom: 80rpx;
}
.menuebtn {
width: 325rpx;
/* width: 295rpx; */
height: 88rpx;
line-height: 88rpx;
text-align: center;
float: left;
background: #eaeaea;
border: 1px solid #e3e3e3;
/* border-radius: 18rpx; */
box-sizing: border-box;
font-family: "PingFang-SC-Medium";
font-size: 34rpx;
color: #999;
/* opacity: 0.9; */
}
.menuebtn1 {
height: 88rpx;
width: 690rpx;
line-height: 88rpx;
text-align: center;
background: #eaeaea;
border: 1px solid #e3e3e3;
box-sizing: border-box;
font-family: "PingFang-SC-Medium";
font-size: 34rpx;
color: #999;
}
.menuebtn-active {
background: #2684ff;
color: #fff;
border: none;
opacity: 1;
}
.all-item {
position: fixed;
bottom: 20rpx;
width: 100%;
text-align: center;
font-size: 30rpx;
color: #333;
}
.pizibao {
width: 582rpx;
height: 90rpx;
margin: 300rpx auto;
}
.p_time {
width: 220rpx;
height: 88rpx;
float: left;
}
.p_time input {
display: block;
width: 150rpx;
height: 88rpx;
text-align: center;
font-size: 34rpx;
float: left;
border: 0.5px solid #cecece;
border-radius: 8rpx;
outline: none;
}
.p_time text {
display: block;
font-size: 30rpx;
height: 88rpx;
width: 30rpx;
margin-left: 20rpx;
float: left;
line-height: 88rpx;
color: #666;
}
.p_btn {
height: 88rpx;
width: 120rpx;
text-align: center;
line-height: 88rpx;
float: left;
margin-left: 20rpx;
background: #2684ff;
color: #fff;
border-radius: 8rpx;
font-size: 30rpx;
}
.con .con-first{
/* text-align: center; */
font-size: 28rpx;
color: #666;
/* line-height: 46rpx; */
}
.con-title{
text-align: right;
}
\ No newline at end of file
......@@ -425,6 +425,7 @@ Page({
*/
loadScene(scene) {
let that = this;
wx.removeStorageSync('roomService');
var user = wx.getStorageSync('user');
var data = {
z_openid: user.openid,
......@@ -468,7 +469,7 @@ Page({
up_money: res.money,
uo_price: res.price
})
} else if (res.unitid == '4725' || res.unitid == '5') {
} else if (res.unitid == '4725') {
wx.hideLoading()
that.setData({
show: 2,
......@@ -1080,7 +1081,7 @@ Page({
marketstatus: 4,
showLoading: true
})
} else if (weiLb.unitid == '4725' || weiLb.unitid == '5') {
} else if (weiLb.unitid == '4725') {
this.setData({
show: 2,
marketstatus: 4,
......@@ -1261,6 +1262,7 @@ Page({
clearTimeout(timer1)
// 个人信息提交成功 返回ret== 1
if (res.code == 1) {
console.log("that.data.lb_id",that.data.lb_id)
// otype = 0 从首页进入需要支付 现在已移除
// otype = 1 从报告页面进入 不需要支付
// otype 不存在 = -1 扫码进入
......@@ -1280,7 +1282,7 @@ Page({
}, 500)
}
})
} else if (that.data.lb_tz == '3') {
} else if (Number(that.data.lb_id) == 60) {
// 瑞文
wx.navigateTo({
url: '/pages/dati03/dati03',
......@@ -1293,6 +1295,19 @@ Page({
}, 500)
}
})
} else if (Number(that.data.lb_id) == 145) {
// 生活事件量表
wx.navigateTo({
url: '/pages/dati05/dati05',
success: function () {
wx.hideLoading()
setTimeout(function () {
that.setData({
payInfo: true
})
}, 500)
}
})
} else {
// 进入普通的答题页面
if (that.data.monitor == 1) {
......
......@@ -249,6 +249,16 @@ Page({
}, 500)
}
})
} else if (that.data.lb_tz == '145') {
// 生活事件量表
wx.navigateTo({
url: '/pages/dati05/dati05?tplb=1',
success: function(){
setTimeout(function(){
that.setData({payInfo:true})
},500)
}
})
} else if (that.data.lb_tz == '0') {
wx.navigateTo({
url: '/pages/dati04/dati04?tplb=1',
......
......@@ -3,8 +3,8 @@ var HOST_xinli = 'https://www.xiaodongai.com/xiaodongai/xinli';
// var HOST_xinli = 'https://www.xiaodongai.com/xiaodongai/xinli_ceshi_copy';
var HOST_xinli_lb = 'https://static.xiaodongai.com/';
const HOST= "https://test-wechat.xiaodongai.com/";
// var HOST = 'https://www.xiaodongai.com/xiaodongai/kongtian/';
// const HOST= "https://test-wechat.xiaodongai.com/";
var HOST = 'https://www.xiaodongai.com/xiaodongai/kongtian/';
// var HOST = 'https://www.xiaodongai.com/xiaodongai/ceshi/';//测试库
var HOST_P = "http://static.xiaodongai.com/xiaodongai/";
var HOST_P_K = "http://static.xiaodongai.com/xiaodongai/kongtian/";
......
......@@ -7,8 +7,8 @@ const HOST_P = "https://static.xiaodongai.com/xiaodongai/";
const HOST_P_K = "https://static.xiaodongai.com/xiaodongai/kongtian/";
const HOST= "https://test-wechat.xiaodongai.com/";
// const HOST = 'https://www.xiaodongai.com/xiaodongai/kongtian/';
// const HOST= "https://test-wechat.xiaodongai.com/";
const HOST = 'https://www.xiaodongai.com/xiaodongai/kongtian/';
// var HOST = 'https://www.xiaodongai.com/xiaodongai/ceshi/';//测试库
// var HOST = 'http://192.168.0.123:8081/xiaodongai/ceshi/';//本地
// var HOST = 'http://localhost/xiaodongai/kongtian/';//本地
......@@ -38,6 +38,7 @@ const url = {
acceptFollowUp:HOST+ "wechatIteration.php?s=/Inquisition/jieshou",//接受预约
getPayStatus:HOST+"wechatIteration.php?s=/Prescription/drug_order_list_payresult",//获取药方支付状态
getChatMsgLog:HOST+"wechatIteration.php?s=/Im/chat_message_logging",//获取历史记录
getIsAnswer:HOST+"wechatIteration.php?s=home/testing_gauge",//获取当前量表是否已答
/**end */
/**服务设置 begin*/
myServerList:HOST+"wechatIteration.php?s=/InquiryUser/inquiryImList",//我的服务记录
......
let lifeEventName = [
'事件发生时间',
'该事件发生次数为',
'该事件持续时间为',
'性质',
'精神影响程度',
'影响持续时间',
];
let lifeArr = {
happenTimeArr: {
title: '事件发生时间',
name: ['未发生', '一年前', '一年内', '长期性'],
score: [0, 0, 1, 2]
},
happenNumArr: {
name: ['1次', '2次', '3次', '4次'],
score: [1, 2, 3, 4],
title:'该事件发生次数为'
},
continusTimeArr : {
name: ['半年之内', '半年以上'],
score: [1, 2],
title: '该事件持续时间为'
},
natureArr: {
name: ['好事', '坏事'],
score: [1, 2],
title: '性质'
},
spiritDegreeArr: {
name: ['无影响', '轻度', '中度', '重度', '极重'],
score: [0, 1, 2, 3, 4],
title:'精神影响程度'
},
impactConTimeArr: {
name: ['三月内', '半年内', '一年内', '一年以上'],
score: [1, 2, 3, 4],
title:'影响持续时间'
}
}
let lifeName = [
'第一部分(家庭有关问题)',
'第二部分(工作学习中的问题)',
'第三部分(社交与其他问题)'
]
module.exports = {
lifeEventName: lifeEventName,
lifeName: lifeName,
lifeArr: lifeArr
}
\ No newline at end of file
......@@ -600,6 +600,10 @@ function drogOrderDetail(param) {
var drogOrderDetailUrl = config.url.drogOrderDetail;
return wxRequest.postRequest(drogOrderDetailUrl, param);
}
function getIsAnswer(param){
var getIsAnswerUrl = config.url.getIsAnswer;
return wxRequest.postRequest(getIsAnswerUrl, param);
}
function getBusStopListPromise(sid, stopType) {
var getStopListUrl = config.url.getBusStopList;
......@@ -697,4 +701,5 @@ module.exports = {
logisticsInfo: logisticsInfo, //物流信息
firendAfterRoom: firendAfterRoom, //成功加好友之后选择身份信息进入群聊房间
drogOrderDetail: drogOrderDetail, //药品订单详情
getIsAnswer:getIsAnswer,//是否答题
}
\ No newline at end of file
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