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() {
......@@ -413,6 +426,7 @@ Page({
wx.removeStorageSync('lb_descript')
}
})
}
}
})
},
......
......@@ -320,15 +320,29 @@ Page({
} else if (res == 0) {
wx.removeStorageSync('tplbDetail')
wx.removeStorageSync('weiLb')
wx.reLaunch({
url: '/pages/my/my',
success: function () {
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
}
})
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 () {
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
}
})
}
}
})
},
......
......@@ -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,15 +612,29 @@ Page({
setTimeout(function () {
wx.removeStorageSync('tplbDetail')
wx.removeStorageSync('weiLb')
wx.reLaunch({
url: '/pages/my/my',
success: function () {
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
}
})
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 () {
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
}
})
}
}, 2000)
}
})
......@@ -631,7 +645,7 @@ Page({
complete: function (e) {}
})
}
},1000,true),
}, 1000, true),
onReady: function () {
let that = this;
// setTimeout(function () {
......
// pages/demo/demo.js
var Api = require('../../utils/api');
var util = require('../../utils/util');
const lifeEvent = require('../../utils/lifeEvent.js');
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
id: 0,
winH: '',
winW: '',
disab: true,
current: 1,
flag: true,
animationData: {},
item: {
answer: [],
con: '',
active: -1,
num: '',
add: '',
lb_id: '',
time: '',
},
nextFalg: {},
lifeName: lifeEvent.lifeName,
eName: lifeEvent.lifeEventName[0],
lifeNum: 0,
lifeArr: lifeEvent.lifeArr,
track: [], //答题轨迹
},
onLoad: function(options) {
let that = this;
var otype = options.otype;
var answer_swiper = wx.getStorageSync('answer_swiper');
var swiper_arr = wx.getStorageSync('swiper_arr');
var lb_descript = wx.getStorageSync('lb_descript');
var yanzhengid = wx.getStorageSync('yanzhengid');
let len = answer_swiper != '' ? (answer_swiper.answer.length < swiper_arr[1].length ? answer_swiper.answer.length : swiper_arr[1].length - 1) : 0;
if (false) {} else {
if (lb_descript.desc.record_id == -1) {
this.loadData();
} else if (yanzhengid == lb_descript.desc.record_id) {
if (len > 0) {
var item = swiper_arr[1][len];
var nextFalg = this.data.nextFalg;
// 处理最后一题的选择问题
if (swiper_arr[1].length == answer_swiper.answer.length) {
var last_len = swiper_arr[1].length - 1; // 最后一题序号
var ind_len = answer_swiper.answer[last_len].split('-'); // 最后答案
var con_len = swiper_arr[1][last_len].score; // 最后问题的答案
for (let i = 0; i < con_len.length; i++) {
(function(j) {
if (ind_len[0] == j) {
that.setData({
active: j,
disab: false,
nextFalg: nextFalg
})
}
})(i)
}
}
this.setData({
item: item,
current: len,
all: swiper_arr[1].length,
nextFalg: nextFalg,
})
} else {
this.loadData();
}
} else {
this.loadData();
}
}
},
loadData: function() {
var lb_swiper_con = wx.getStorageSync('lb_swiper_con');
var lb = lb_swiper_con[1];
var arr = [];
var an = ['A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.'];
let zimu = [];
for (let j in lb) {
let le = lb[j].quesion_answer.split(',').length;
var obj = {
con: lb[j].quesion_title,
answer: lb[j].quesion_answer.split(','),
score: lb[j].quesion_score.split(','),
check: [],
zimu: an,
type: lb[j].type
}
obj.check.length = obj.answer.length;
for (let i = 0; i < obj.answer.length; i++) {
obj.check[i] = 0;
}
arr.push(obj)
}
var swiper_arr = [lb_swiper_con[0], arr];
wx.setStorageSync('swiper_arr', swiper_arr);
var lb_swiper_con = wx.getStorageSync('lb_swiper_con');
var answerData = {
score: [],
answer: [],
id: lb_swiper_con[0].measure_id
}
var yanzhengid = -1;
wx.setStorageSync('answer_swiper', answerData);
let answerPer = {
score: [],
answer: [],
}
wx.setStorageSync('answerPer', answerPer);
wx.setStorageSync('yanzhengid', yanzhengid);
var timeArr = [];
wx.setStorageSync("timeArr", timeArr);
// wx.removeStorageSync('lb_swiper_con')
var item = swiper_arr[1][0];
var nextFalg = {
0: false
}
this.setData({
all: arr.length,
current: 0,
item: item,
nextFalg: nextFalg
});
wx.setNavigationBarTitle({
title: swiper_arr[0].measure_name
});
},
selectData: function(e) {
let that = this;
var qufentime = wx.getStorageSync('qufentime');
var lb_descript = wx.getStorageSync('lb_descript');
wx.setStorageSync('yanzhengid', lb_descript.desc.record_id);
// var lb_swiper_con = wx.getStorageSync('lb_swiper_con');
var swiper_arr = wx.getStorageSync('swiper_arr');
var answer_swiper = wx.getStorageSync('answer_swiper');
let len = swiper_arr[1].length;
var record = e.currentTarget.dataset.record;
var index = e.currentTarget.dataset.index; // 序号,
// var answer = e.currentTarget.dataset.answer;
var score = e.currentTarget.dataset.score; // 分数
var nextFalg = this.data.nextFalg;
nextFalg[record] = true;
this.setData({
nextFalg: nextFalg,
})
// 判断题长度
if (record < Number(len) - 1) {
// 多选判断
this.setData({
active: index,
all: len,
current: Number(record)
})
this.checkAnswer(score, index, function(checkA) {
if (checkA.type == 0) {
that.cacheAnser(checkA.obj, record);
setTimeout(() => {
that.next(record);
}, 300)
}
});
} else {
let anCurArr = wx.getStorageSync('answer_swiper').answer[that.data.current];
if (!anCurArr) anCurArr = '';
anCurArr = anCurArr.split('-');
if (anCurArr.length == 5 || anCurArr[3] == 0) {
wx.showToast({
title: '量表已做完,请提交',
icon: 'none',
duration: 1000
})
if (anCurArr.length == 5){
this.setData({
eName: lifeEvent.lifeArr.impactConTimeArr.title,
})
}
if (anCurArr[3] == 0){
this.setData({
eName: lifeEvent.lifeArr.spiritDegreeArr.title,
})
}
return;
} else {
this.setData({
active: index,
all: len,
current: Number(record)
})
this.checkAnswer(score, index, function(checkA) {
if (checkA.type == 0) {
that.cacheAnser(checkA.obj, record);
let _len = checkA.obj.s.split('-');
if (_len.length == 5) {
that.setData({
eName: lifeEvent.lifeArr.impactConTimeArr.title,
})
}
if (_len.length == 3) {
that.setData({
eName: lifeEvent.lifeArr.spiritDegreeArr.title,
})
}
wx.showToast({
title: '量表已做完,请提交',
icon: 'none',
duration: 1000
})
that.setData({
active: index,
// active: -1,
all: len,
current: Number(record),
disab: false,
})
}
});
}
}
},
checkAnswer(score, index, back) {
console.log("score",score,"index",index,"back",back);
let answerPer = wx.getStorageSync('answerPer');
let lifeNum = this.data.lifeNum;
let answerArr = answerPer.answer;
let scoreArr = answerPer.score;
let track = this.data.track;
answerArr.push(index);
scoreArr.push(score);
let jsonArr = {};
if (score == 0) { // 未发生|| 一年前
this.setData({
lifeNum: 0,
track: [],
})
answerPer.answer = answerPer.score = [];
wx.setStorageSync('answerPer', answerPer);
jsonArr = lifeEvent.lifeArr.happenTimeArr;
this.changeCon(jsonArr, 1);
let obj = {
'type': 0,
'obj': {
a: answerArr.join('-'),
s: scoreArr.join('-')
}
}
back(obj)
return;
} else { // 一年内
track.push(index);
lifeNum++;
this.setData({
track: track
})
if (track.length == 1) { // 第一次点击 区分一年内和长期性
if (score == 1) {
jsonArr = lifeEvent.lifeArr.happenNumArr;
} else if (score == 2) {
jsonArr = lifeEvent.lifeArr.continusTimeArr;
}
} else
if (track.length == 2) {
jsonArr = lifeEvent.lifeArr.natureArr;
}
if (track.length == 3) {
jsonArr = lifeEvent.lifeArr.spiritDegreeArr;
}
if (track.length == 4) {
jsonArr = lifeEvent.lifeArr.impactConTimeArr;
}
if (track.length == 5) {
this.setData({
lifeNum: 0,
track: [],
})
answerPer.answer = answerPer.score = [];
wx.setStorageSync('answerPer', answerPer);
jsonArr = lifeEvent.lifeArr.happenTimeArr;
lifeEvent.lifeArr
this.changeCon(jsonArr, 1);
let obj = {
'type': 0,
'obj': {
a: answerArr.join('-'),
s: scoreArr.join('-')
}
}
back(obj)
return;
}
this.setData({
lifeNum: lifeNum,
})
setTimeout(() => {
if (!jsonArr.title) return;
this.changeCon(jsonArr);
}, 200)
answerPer.answer = answerArr;
answerPer.score = scoreArr;
wx.setStorageSync('answerPer', answerPer);
let obj = {
'type': 1,
'obj': {
a: answerArr.join('-'),
s: scoreArr.join('-')
}
}
back(obj)
return;
}
},
//
changeCon(j, n) {
let item = this.data.item;
item.answer = j.name;
item.score = j.score;
if (n && n == 1) {
this.setData({
eName: j.title,
// active: -1
})
} else {
let anCurArr = wx.getStorageSync('answer_swiper').answer[this.data.current];
if (!anCurArr) anCurArr = '';
anCurArr = anCurArr.split('-');
if (anCurArr[this.data.lifeNum]) {
this.setData({
item: item,
eName: j.title,
active: anCurArr[this.data.lifeNum]
})
} else {
this.setData({
item: item,
eName: j.title,
active: -1
})
}
}
},
// 存储答案 n
cacheAnser(n, record) {
var answer_swiper = wx.getStorageSync('answer_swiper');
if (answer_swiper.score.length <= record) {
answer_swiper.score.push(n.s);
answer_swiper.answer.push(n.a);
} else {
answer_swiper.score[record] = n.s;
answer_swiper.answer[record] = n.a;
}
wx.setStorageSync('answer_swiper', answer_swiper);
},
prev: function(e) {
if (this.data.current > 0) {
var record = this.data.current - 1;
this.prevAnimation();
var swiper_arr = wx.getStorageSync('swiper_arr');
let len = swiper_arr[1].length;
var answer_swiper = wx.getStorageSync('answer_swiper');
var item = swiper_arr[1][record];
var nextFalg = this.data.nextFalg;
nextFalg[record] = true;
let anserCacheArr = answer_swiper.answer[Number(record)].split('-');
// 多选题 的数据状态
this.setData({
active: anserCacheArr[0],
current: record,
item: item,
nextFalg: nextFalg,
eName: lifeEvent.lifeArr.happenTimeArr.title,
lifeNum: 0,
track: [],
})
}
},
next: function(n) {
var answer_swiper = wx.getStorageSync('answer_swiper');
if (answer_swiper.answer[n].length <= 0) {
wx.showToast({
title: '请选择',
icon: 'none',
duration: 1000
});
return;
}
var swiper_arr = wx.getStorageSync('swiper_arr');
let len = swiper_arr[1].length;
if (n < len) {
// this.nextAnimation();
var item = swiper_arr[1][n + 1]
var answer_swiper = wx.getStorageSync('answer_swiper');
var an_len = answer_swiper.answer ? answer_swiper.answer.length : -1;
if (an_len - n > 1) {
let anserCacheArr = answer_swiper.answer[n + 1].split('-');
this.setData({
active: anserCacheArr[0],
// active: -1,
item: item,
all: len,
current: n + 1
})
} else {
this.setData({
active: -1,
item: item,
all: len,
current: n + 1
})
}
} else if (n == len) {} else {
}
},
nextAnimation: function() {
var that = this;
var _thisWidth = Number(this.data.winW);
var animation = wx.createAnimation({
duration: 400,
timingFunction: 'linear',
})
this.animation = animation
animation.left(-_thisWidth).opacity(0).step();
this.setData({
animationData: animation.export()
})
setTimeout(function() {
var animation1 = wx.createAnimation({
duration: 0,
timingFunction: 'step-start',
})
that.animation = animation1
animation1.left(_thisWidth / 2).opacity(1).step();
that.setData({
animationData: animation1.export()
})
}, 410)
},
prevAnimation: function() {
var that = this;
var _thisWidth = Number(this.data.winW);
var animation = wx.createAnimation({
duration: 300,
timingFunction: 'linear',
})
this.animation = animation
animation.left(_thisWidth * 2).opacity(1).step();
this.setData({
animationData: animation.export()
})
setTimeout(function() {
var animation1 = wx.createAnimation({
duration: 0,
timingFunction: 'step-start',
})
that.animation = animation1
animation1.left(_thisWidth / 2).opacity(1).step();
that.setData({
animationData: animation1.export()
})
}, 310)
},
dealPho(str, host) {
return str.replace("./", host);
},
onShow: function() {
let that = this;
var lb_descript = wx.getStorageSync('lb_descript');
var swiper_arr = wx.getStorageSync('swiper_arr');
if (swiper_arr) {
wx.setNavigationBarTitle({
title: swiper_arr[0].measure_name
});
}
wx.getSystemInfo({
success: (res) => {
that.setData({
winW: res.windowWidth,
})
}
});
var startTime = Date.parse(new Date());
var cha = wx.getStorageSync('chaTime') ? wx.getStorageSync('chaTime') : 0;
wx.setStorageSync('startTime', Number(startTime));
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
var endtTime = Date.parse(new Date());
var startTime = wx.getStorageSync('startTime');
var cha = endtTime - startTime;
var arr = wx.getStorageSync("timeArr");
if (Number(cha) < 1000000040000) {
arr.push(Number(cha))
wx.setStorageSync("timeArr", arr);
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
var endtTime = Date.parse(new Date());
var startTime = wx.getStorageSync('startTime');
var cha = endtTime - startTime;
var arr = wx.getStorageSync("timeArr");
if (Number(cha) < 1000000040000) {
arr.push(Number(cha))
wx.setStorageSync("timeArr", arr);
}
},
tijiao: function() {
let that = this;
var lb_descript = wx.getStorageSync('lb_descript');
let userInfo = wx.getStorageSync('userInfoName');
if (lb_descript.id[0] == 523) {
var ans = wx.getStorageSync('answer_swiper')
if (ans.answer[ans.answer.length - 1].length <= 0) {
wx.showToast({
title: '请选择',
icon: 'none',
duration: 1000
});
return;
}
}
if (this.data.flag && !this.disab) {
this.setData({
flag: false
})
wx.showLoading({
title: '上传中...',
})
var startTime = wx.getStorageSync('startTime');
var timeArr = wx.getStorageSync('timeArr');
var chaTime = 0;
for (let i = 0; i < timeArr.length; i++) {
if (Number(timeArr) > 1000000040000) {
timeArr[i] = 0;
}
chaTime += timeArr[i]
}
var thisTime = Date.parse(new Date());
var cha = thisTime - startTime + chaTime;
var time = Api.reversalTime(cha)
var user = wx.getStorageSync('user');
var answer = wx.getStorageSync('answer_swiper');
// for (let i = 0; i < answer.score.length; i++) {
// answer.score[i] = answer.score[i].replace(/[\r\n]/g, '');
// }
answer.score = answer.score.join('|');
answer.score = answer.score.replace(/-/g, ',');
var lb_descript = wx.getStorageSync('lb_descript');
var swiper_arr = wx.getStorageSync('swiper_arr');
var lb_tp = wx.getStorageSync('lb_tz')
if (lb_tp == '1') {
var data = {
user_stime: time,
user_answer: answer.score,
answer: answer.score,
user_number: lb_descript.desc.z_openid,
measure_id: lb_descript.id[0],
};
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else {
var data = {
user_stime: time,
user_answer: answer.score,
answer: answer.score,
openid: user.openid,
user_number: userInfo.user_number,
user_id: userInfo.user_id,
qrcode: userInfo.qrcode,
measure_id: lb_descript.id[0],
};
var url = Api.HOST_xinli + 'jswszx/index.php/Api/add_res';
}
console.log(data)
data.unitid = lb_descript.desc.unitid;
var uploadData = setTimeout(function() {
wx.hideLoading()
wx.showToast({
icon: 'none',
title: '您当前的网络不稳定,请检查网络重新提交',
duration: 2000
})
that.setData({
flag: true
})
}, 5000)
Api.fetchPostN(url, data, (err, res) => {
clearTimeout(uploadData)
if (Number(res) == 0) {
Api.alert("提交失败,请重新提交。")
return;
}
var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {};
var urls = Api.HOST + 'index.php?s=Home/del_vip';
var ti_title = swiper_arr[0].measure_name;
var lb_descript = wx.getStorageSync("lb_descript");
data1.user_id = userInfo.user_id;
data1.g_id = userInfo.qrcode;
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title;
data1.res_id = res;
data1.user_stime = time;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
data1.unitid = unitid;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
data1.measure_id = lb_descript.id[0];
} else {
data1.z_openid = user.openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = user.openid;
data1.is_type = 1;
data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0];
}
Api.fetchPost(urls, data1, (err, res) => {
if (err) {
that.setData({
flag: true
})
}
that.setData({
flag: true
})
if (res.key == 1 || res.key == 0) {
wx.removeStorageSync('answer_swiper')
wx.removeStorageSync('swiper_arr')
wx.removeStorageSync('chaTime')
wx.removeStorageSync('endTime')
wx.removeStorageSync('startTime')
wx.removeStorageSync('timeArr')
wx.removeStorageSync('lb_swiper_con')
wx.hideLoading()
}
// var timer = setTimeout(function () {
// wx.showLoading({
// title: '连接超时',
// })
// }, 8000)
if (res.key == 1) {
// clearTimeout(timer)
wx.showToast({
title: '还剩' + res.val + '个量表',
icon: 'success',
duration: 2000
})
setTimeout(function() {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1&g_id=' + userInfo.qrcode,
success: function() {
that.setData({
flag: true
})
}
})
} else {
wx.reLaunch({
url: '/pages/info/info?otype=1&otype1=1&g_id=' + userInfo.qrcode,
success: function() {
that.setData({
flag: true
})
}
})
}
}, 2000)
} else if (res.key == 0) {
// clearTimeout(timer)
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
setTimeout(function() {
wx.removeStorageSync('tplbDetail')
wx.removeStorageSync('weiLb')
// wx.reLaunch({
// // url: '/pages/end/end?lbtype=-1',
// url: '/pages/record/record',
// success: function() {
// that.setData({
// flag: true
// })
// wx.removeStorageSync('lb_descript')
// }
// })
wx.reLaunch({
url: '/pages/index/index',
success: function () {
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
}
})
}, 2000)
}
})
})
}
},
onReady: function() {
let that = this;
// setTimeout(function () {
wx.getSystemInfo({
success: (res) => {
if (/^iPhone X.*/i.test(res.model)) {
that.setData({
iPhoneX: true,
winH: res.windowHeight - 118
})
} else {
that.setData({
iPhoneX: false,
winH: res.windowHeight - 118
})
}
}
});
// }, 600)
},
})
\ No newline at end of file
{
"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