Commit bdb5b227 by liuquan

修复bug

parent 48651c12
...@@ -56,6 +56,7 @@ App({ ...@@ -56,6 +56,7 @@ App({
}, },
onShow: function () { onShow: function () {
console.log("onShow") console.log("onShow")
this.forcedUpdate();
}, },
onHide: function () { onHide: function () {
console.log("onHide") console.log("onHide")
......
...@@ -99,11 +99,5 @@ ...@@ -99,11 +99,5 @@
} }
] ]
}, },
"usingComponents": {
"mp-toptips": "/miniprogram_npm/weui-miniprogram/toptips/toptips",
"answer":"/components/answer/answer",
"modal": "/components/modal/modal",
"login": "/components/login/login"
},
"sitemapLocation": "sitemap.json" "sitemapLocation": "sitemap.json"
} }
\ No newline at end of file
...@@ -612,9 +612,10 @@ Page({ ...@@ -612,9 +612,10 @@ Page({
wx.getSetting({ wx.getSetting({
withSubscriptions: true, withSubscriptions: true,
success(res) { success(res) {
var itemSettings = !Util.isEmpty(res.subscriptionsSetting) ? res.subscriptionsSetting.itemSettings : ""; let itemSettings = !Util.isEmpty(res.subscriptionsSetting) ? res.subscriptionsSetting.itemSettings : "";
console.log('itemSettings', res, itemSettings)
if (itemSettings) { if (itemSettings) {
if (itemSettings['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY'] == 'accept') { if (itemSettings['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY'] == 'accept' && itemSettings['FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'] == 'accept') {
that.setData({ that.setData({
remind: false remind: false
}); });
...@@ -644,9 +645,12 @@ Page({ ...@@ -644,9 +645,12 @@ Page({
that.setData({ that.setData({
remind: false remind: false
}) })
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY'], tmplIds: ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY', 'FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'],
success(res) {} success(res) {
console.log('requestSubscribeMessage', res)
}
}) })
that.checkDeviceAuthorize().then((result) => { that.checkDeviceAuthorize().then((result) => {
console.log('%c授权成功', 'color:#04BE02', result) console.log('%c授权成功', 'color:#04BE02', result)
...@@ -654,6 +658,24 @@ Page({ ...@@ -654,6 +658,24 @@ Page({
console.log('没有授权', error) console.log('没有授权', error)
}) })
}, },
tmplArr() {
let arr=[];
wx.getSetting({
withSubscriptions: true,
success(res) {
let itemSettings = !Util.isEmpty(res.subscriptionsSetting) ? res.subscriptionsSetting.itemSettings : "";
console.log('itemSettings', res, itemSettings)
if (itemSettings) {
arr=itemSettings.map((item)=>{
})
}else{
arr= ['d33RkZvTz6O8Zjw8b8faoKIQGXA0cJJ2G24_kIWQjtY', 'FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'];
}
}
})
return arr;
},
/** /**
* 服务提前结束 0同意 1拒绝 * 服务提前结束 0同意 1拒绝
*/ */
...@@ -719,7 +741,7 @@ Page({ ...@@ -719,7 +741,7 @@ Page({
status: true, status: true,
serviceName: res.data.name serviceName: res.data.name
}) })
if( res.data.counsel=="20"){ if (res.data.counsel == "20") {
that.getFreeChat(that.data.t_unionid, wx.getStorageSync('data').unionid); that.getFreeChat(that.data.t_unionid, wx.getStorageSync('data').unionid);
} }
return return
...@@ -729,7 +751,7 @@ Page({ ...@@ -729,7 +751,7 @@ Page({
end_time: '', end_time: '',
serviceName: '未知', serviceName: '未知',
}) })
if( res.data.counsel=="20"){ if (res.data.counsel == "20") {
that.getFreeChat(that.data.t_unionid, wx.getStorageSync('data').unionid); that.getFreeChat(that.data.t_unionid, wx.getStorageSync('data').unionid);
} }
break; break;
......
...@@ -55,7 +55,7 @@ Page({ ...@@ -55,7 +55,7 @@ Page({
that.login = that.selectComponent("#login"); that.login = that.selectComponent("#login");
that.modal = that.selectComponent("#modal"); that.modal = that.selectComponent("#modal");
that.answer = that.selectComponent("#answer"); that.answer = that.selectComponent("#answer");
if (wx.getStorageSync('data').unionid == undefined || wx.getStorageSync('data').unionid == '') { if (Util.isEmpty(wx.getStorageSync('data').unionid)) {
wx.login({ wx.login({
success: function (msg) { success: function (msg) {
Service.getOpenId(msg.code).then((res) => { Service.getOpenId(msg.code).then((res) => {
...@@ -405,11 +405,19 @@ Page({ ...@@ -405,11 +405,19 @@ Page({
// } // }
// } // }
let { let {
unionid unionid,openid
} = wx.getStorageSync('user'); } = wx.getStorageSync('user');
if (unionid == undefined || unionid == ''){
wx.showModel({
title: '小懂提示:-99',
content: '当前小程序版本太低,请重启小程序再试!',
})
return
}
let data = { let data = {
payid: that.data.list.payid, payid: that.data.list.payid,
patient_unionid: unionid, patient_unionid: unionid,
openid:openid,
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,
......
...@@ -61,7 +61,7 @@ Page({ ...@@ -61,7 +61,7 @@ Page({
that.login = that.selectComponent("#login"); that.login = that.selectComponent("#login");
that.modal = that.selectComponent("#modal"); that.modal = that.selectComponent("#modal");
that.answer = that.selectComponent("#answer"); that.answer = that.selectComponent("#answer");
if (wx.getStorageSync('data').unionid == undefined || wx.getStorageSync('data').unionid == '') { if (Util.isEmpty(wx.getStorageSync('data').unionid)) {
wx.login({ wx.login({
success: function (msg) { success: function (msg) {
Service.getOpenId(msg.code).then((res) => { Service.getOpenId(msg.code).then((res) => {
...@@ -364,9 +364,10 @@ Page({ ...@@ -364,9 +364,10 @@ Page({
// hstr.push(healthcare[i].id); // hstr.push(healthcare[i].id);
// } // }
// } // }
let {unionid}=wx.getStorageSync('data'); let {unionid,openid}=wx.getStorageSync('user');
let data = { let data = {
id: that.data.options.scene, id: that.data.options.scene,
openid:openid,
patient_unionid:unionid, patient_unionid:unionid,
modular: that.data.list.modular, modular: that.data.list.modular,
lastid: that.data.item.id, lastid: that.data.item.id,
......
...@@ -216,6 +216,7 @@ Page({ ...@@ -216,6 +216,7 @@ Page({
}, },
//支付 //支付
applyPay: function (e) { applyPay: function (e) {
console.log('e',e)
wx.showLoading({ wx.showLoading({
title: '正在生成', title: '正在生成',
mask: true mask: true
......
...@@ -228,13 +228,13 @@ Page({ ...@@ -228,13 +228,13 @@ Page({
}) })
} }
}, },
/** /**
* 是否需要开具纸质发票 * 是否需要开具纸质发票
* @param {*} e * @param {*} e
*/ */
checkboxChange: function (e) { checkboxChange: function (e) {
this.setData({ this.setData({
isInvoice: e.detail.value[0]==1?1:0, isInvoice: e.detail.value[0] == 1 ? 1 : 0,
}) })
}, },
/** /**
...@@ -291,7 +291,9 @@ Page({ ...@@ -291,7 +291,9 @@ Page({
that.setData({ that.setData({
isBtnAsh: false isBtnAsh: false
}) })
let {unionid}=wx.getStorageSync('user'); let {
unionid
} = wx.getStorageSync('user');
if (Util.isEmpty(unionid)) { if (Util.isEmpty(unionid)) {
that.login.showLogin(); that.login.showLogin();
that.setData({ that.setData({
...@@ -365,11 +367,21 @@ Page({ ...@@ -365,11 +367,21 @@ Page({
// hstr.push(healthcare[i].id); // hstr.push(healthcare[i].id);
// } // }
// } // }
let {
let {unionid}=wx.getStorageSync('data'); unionid,
openid
} = wx.getStorageSync('data');
if (unionid == undefined || unionid == '') {
wx.showModel({
title: '小懂提示:-99',
content: '当前小程序版本太低,请重启小程序再试!',
})
return
}
let data = { let data = {
payid: that.data.list.payid, payid: that.data.list.payid,
patient_unionid:unionid, openid: openid,
patient_unionid: 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,
...@@ -377,7 +389,7 @@ Page({ ...@@ -377,7 +389,7 @@ Page({
money: that.data.list.money, money: that.data.list.money,
hstr: hstr.toString(), hstr: hstr.toString(),
isgd: 1, isgd: 1,
isInvoice:that.data.isInvoice, isInvoice: that.data.isInvoice,
// rise_need:that.data.isInvoice // rise_need:that.data.isInvoice
} }
Service.prescriptionPay(data).then((res) => { Service.prescriptionPay(data).then((res) => {
......
...@@ -94,6 +94,12 @@ ...@@ -94,6 +94,12 @@
"pathName": "pages/docuterInfo/docuterInfo", "pathName": "pages/docuterInfo/docuterInfo",
"query": "t_unitid=18870", "query": "t_unitid=18870",
"scene": 1008 "scene": 1008
},
{
"name": "pages/index/index",
"pathName": "pages/index/index",
"query": "",
"scene": null
} }
] ]
} }
......
...@@ -50,7 +50,7 @@ function getUserData(openid) { ...@@ -50,7 +50,7 @@ function getUserData(openid) {
let getUserDataUrl = config.url.getUserData; let getUserDataUrl = config.url.getUserData;
let data = {}; let data = {};
data.openid = openid; data.openid = openid;
// data.openid='oYQX40NLrhSABsJpu_5GbRTELTP4' // data.openid='oYQX40IIkeCSa2Kb_5UmEKkrUcH0'
return wxRequest.postRequest(getUserDataUrl, data); return wxRequest.postRequest(getUserDataUrl, data);
}; };
/** /**
......
...@@ -188,7 +188,7 @@ function formatLocation(longitude, latitude) { ...@@ -188,7 +188,7 @@ function formatLocation(longitude, latitude) {
} }
//非空判断 //非空判断
function isEmpty(obj) { function isEmpty(obj) {
if (!obj || obj == "undefined" || obj == null || obj == 'null' || obj == "") { if (!obj || obj == "undefined" || obj == null || obj == 'null' || obj == "" || obj == undefined) {
return true; return true;
} else { } else {
return false; return false;
......
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