提交 f8fa35e0 编写于 作者: 张敬贤's avatar 张敬贤

Merge branch 'feature/zjx' into 'develop'

Feature/zjx

See merge request !32
...@@ -14,6 +14,7 @@ module.exports = { ...@@ -14,6 +14,7 @@ module.exports = {
globals: { globals: {
'gdp': true, 'gdp': true,
'uni': true, 'uni': true,
'wx':true
}, },
// add your custom rules here // add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue //it is base on https://github.com/vuejs/eslint-config-vue
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<link rel="dns-prefetch" href="<%= process.env.VUE_APP_SERVICE_URL %>"> <link rel="dns-prefetch" href="<%= process.env.VUE_APP_SERVICE_URL %>">
<link rel="icon" type="image/x-icon" href="<%= VUE_APP_OSS_URL %>static/img/logo.png"> <link rel="icon" type="image/x-icon" href="<%= VUE_APP_OSS_URL %>static/img/logo.png">
<title>云鹊医</title> <title>云鹊医</title>
</head> </head>
<body> <body>
<noscript> <noscript>
...@@ -29,7 +28,6 @@ ...@@ -29,7 +28,6 @@
<script src="<%= VUE_APP_OSS_URL %>static/js/crypto.min-4.0.0.js"></script> <script src="<%= VUE_APP_OSS_URL %>static/js/crypto.min-4.0.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vconsole-3.3.4.js"></script> <script src="<%= VUE_APP_OSS_URL %>static/js/vconsole-3.3.4.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/lodash-4.17.15.js"></script> <script src="<%= VUE_APP_OSS_URL %>static/js/lodash-4.17.15.js"></script>
<script type="text/javascript" src="https://unpkg.com/@dcloudio/uni-webview-js@0.0.3/index.js"></script>
<script> <script>
!(function(c,b,d,a){c[a]||(c[a]={});c[a].config= !(function(c,b,d,a){c[a]||(c[a]={});c[a].config=
......
...@@ -9,10 +9,20 @@ export const getButtonStatus = (id) => { ...@@ -9,10 +9,20 @@ export const getButtonStatus = (id) => {
}; };
// 根据订单号获取跳转页状态/ // 根据订单号获取跳转页状态/
// /tis/insurance/jumpPageStatus?orderNo=1&projectEquityNo=1 // /tis/insurance/jumpPageStatus?orderNo=1&projectEquityNo=1
export const getJumpPageStatus = (orderNo, projectEquityNo) => { export const getJumpPageStatus = ({orderNo, projectEquityNo}) => {
return request({ return request({
method: 'get', method: 'get',
url: `/tis/insurance/jumpPageStatus?orderNo=${orderNo}&projectEquityNo=${projectEquityNo}`, url: `/tis/insurance/jumpPageStatus?orderNo=${orderNo}&projectEquityNo=${projectEquityNo}`,
withCredentials: true, withCredentials: true,
}); });
}; };
// https://dev-sc.yunqueyi.com/tis/insurance/create/order
export const createOrder = (data) => {
return request({
method: 'post',
data,
url: '/tis/insurance/create/order',
withCredentials: true,
});
};
...@@ -39,6 +39,12 @@ document.documentElement.addEventListener( ...@@ -39,6 +39,12 @@ document.documentElement.addEventListener(
vueApp.$rocNative.appInit(); vueApp.$rocNative.appInit();
vueApp.$rocNative.on('wx_ready', function () { vueApp.$rocNative.on('wx_ready', function () {
console.log('-wx_ready-', window._picaWechat); console.log('-wx_ready-', window._picaWechat);
// 初始化wx jssdk 后 执行 脚手架将 wx 对象挂在到 $rocNative对象上,后执行 小程序环境判断方法 miniProgram.getEnv
vueApp.$rocNative.WXInstance.miniProgram.getEnv(function(res) {
console.log('_miniprogram', res.miniprogram); // true
window._miniprogram = res.miniprogram;
});
}); });
console.log('---', isWeixin()); console.log('---', isWeixin());
if(isWeixin()) { if(isWeixin()) {
...@@ -47,6 +53,7 @@ if(isWeixin()) { ...@@ -47,6 +53,7 @@ if(isWeixin()) {
if(dd.env.version) { if(dd.env.version) {
window._picaWechat = 'dingtalk'; window._picaWechat = 'dingtalk';
} }
sessionStorage.setItem('headerHeight', 0); sessionStorage.setItem('headerHeight', 0);
window.Vue.use(PicaArea); window.Vue.use(PicaArea);
......
...@@ -145,12 +145,12 @@ ...@@ -145,12 +145,12 @@
</van-field> </van-field>
</van-form> </van-form>
</div> </div>
<van-button <!-- <van-button
@click="submit" @click="submit"
> >
提交1 提交1
</van-button> </van-button> -->
<van-button <van-button
round round
block block
...@@ -294,6 +294,7 @@ export default { ...@@ -294,6 +294,7 @@ export default {
this.getDetectionName(yunOrderNo); this.getDetectionName(yunOrderNo);
this.getOrderInfo(yunOrderNo); this.getOrderInfo(yunOrderNo);
this.initMap(); this.initMap();
// document.addEventListener('UniAppJSBridgeReady', function() { // document.addEventListener('UniAppJSBridgeReady', function() {
// console.log('UniAppJSBridgeReady', uni); // console.log('UniAppJSBridgeReady', uni);
// }); // });
...@@ -304,16 +305,11 @@ export default { ...@@ -304,16 +305,11 @@ export default {
methods: { methods: {
choose() {}, choose() {},
submit() { submit() {
console.log(1122334); console.log('1122334', this.$rocNative.WXInstance.miniProgram.navigateTo);
uni.postMessage({
data: { this.$rocNative.WXInstance.miniProgram.navigateTo({
action: 'message' url:'/pagesInsurance/appoint-details/index?yunOrderNo=' + this.yunOrderNo
}
});
uni.navigateTo({
url: '/pagesInsurance/binding-code/index'
}); });
console.log(1122334);
}, },
// 高德地图导航只有在线上环境才能使用 // 高德地图导航只有在线上环境才能使用
initMap() { initMap() {
...@@ -388,7 +384,6 @@ export default { ...@@ -388,7 +384,6 @@ export default {
this.dectionForm.goodsId = dectionData.goodsId; this.dectionForm.goodsId = dectionData.goodsId;
this.$store.dispatch('home/setInsuranceInfo', dectionData); this.$store.dispatch('home/setInsuranceInfo', dectionData);
} }
}); });
}, },
// 获取订单信息 // 获取订单信息
...@@ -448,13 +443,14 @@ export default { ...@@ -448,13 +443,14 @@ export default {
}; };
appointment(data).then(res => { appointment(data).then(res => {
if (res.code === '000000') { if (res.code === '000000') {
this.$router.push({ this.$router.push({
path: '/appoint-details', path: '/appoint-details',
query: { query: {
yunOrderNo:this.yunOrderNo yunOrderNo: this.yunOrderNo,
} projectEquityNo:this.projectEquityNo
}); }
} });
}
}); });
}, },
......
...@@ -79,12 +79,13 @@ ...@@ -79,12 +79,13 @@
<div <div
class="value" class="value"
> >
{{ detailInfo.recordNo || "--" }} <text {{ detailInfo.recordNo || "--" }}
<!-- <text
class="value-copy" class="value-copy"
@click="copyNum()" @click="copyNum()"
> >
复制 复制
</text> </text> -->
</div> </div>
</div> </div>
<div <div
...@@ -154,6 +155,7 @@ export default { ...@@ -154,6 +155,7 @@ export default {
detailInfo: {}, detailInfo: {},
showSsheet:false, showSsheet:false,
yunOrderNo: '', yunOrderNo: '',
projectEquityNo:'',
query:{}, query:{},
// 状态 代码 说明 // 状态 代码 说明
// 0101 未填写问卷 // 0101 未填写问卷
...@@ -185,11 +187,13 @@ export default { ...@@ -185,11 +187,13 @@ export default {
}, },
mounted() { mounted() {
setTimeout(() => { // setTimeout(() => {
this.locationAreaCode = [330, 330400000000, 330424000000]; // this.locationAreaCode = [330, 330400000000, 330424000000];
}, 3000); // }, 3000);
const { yunOrderNo } = this.$route.query;
const { yunOrderNo, projectEquityNo} = this.$route.query;
this.yunOrderNo = yunOrderNo; this.yunOrderNo = yunOrderNo;
this.projectEquityNo = projectEquityNo;
console.log('yunOrderNo', yunOrderNo); console.log('yunOrderNo', yunOrderNo);
this.getDetailByYunOrderNo(yunOrderNo); this.getDetailByYunOrderNo(yunOrderNo);
}, },
...@@ -207,17 +211,22 @@ export default { ...@@ -207,17 +211,22 @@ export default {
}, },
reAppoint() { reAppoint() {
this.$router.push({ this.$router.push({
path: '/appoint',
}); query: {
projectEquityNo:this.projectEquityNo,
yunOrderNo:this.yunOrderNo
}
});
}, },
selectItem(item) { selectItem(item) {
console.log('--$rocNative', this.$rocNative);
const geolocation = store.get('geolocation'); const geolocation = store.get('geolocation');
const hospitalName = '上海市浦东新区兰花路333'; const hospitalName = this.detailInfo.hospitalName;
let url = ''; let url = '';
// lat<纬度>,lng<经度> // lat<纬度>,lng<经度>
const latitude = '31.234527'; const latitude = this.detailInfo.latitude;
const longitude = '121.287689'; const longitude = this.detailInfo.longitude;
if (geolocation && geolocation.lat && geolocation.lng) { if (geolocation && geolocation.lat && geolocation.lng) {
// https://uri.amap.com/navigation // https://uri.amap.com/navigation
...@@ -230,7 +239,6 @@ export default { ...@@ -230,7 +239,6 @@ export default {
break; break;
case 2: case 2:
// https://lbs.qq.com/webApi/uriV1/uriGuide/uriWebMarker api地址 // https://lbs.qq.com/webApi/uriV1/uriGuide/uriWebMarker api地址
url = 'https://apis.map.qq.com/uri/v1/geocoder?coord=' + latitude + ',' + longitude + '&referer=PICA'; url = 'https://apis.map.qq.com/uri/v1/geocoder?coord=' + latitude + ',' + longitude + '&referer=PICA';
break; break;
case 3: case 3:
...@@ -247,16 +255,35 @@ export default { ...@@ -247,16 +255,35 @@ export default {
}, },
bindingCode() { bindingCode() {
const {pprotocolType, detectionServiceRecordId} = this.detailInfo; const { pprotocolType, detectionServiceRecordId } = this.detailInfo;
this.$router.push({ console.log('window.miniProgram', window._miniprogram);
path: '/insuranceBindCode', if (window._miniprogram) {
query: { this.$rocNative.WXInstance.miniProgram.navigateTo({
pprotocolType, url:`/pagesInsurance/binding-code/index?yunOrderNo=${this.yunOrderNo}&detectionRecordId=${detectionServiceRecordId}&pprotocolType=${pprotocolType}&channelSource=insurance_channel`
detectionRecordId:detectionServiceRecordId, });
} } else {
}); this.$router.push({
path: '/insuranceBindCode',
query: {
pprotocolType,
detectionRecordId: detectionServiceRecordId,
yunOrderNo:this.yunOrderNo
}
});
}
}, },
navigation() { navigation() {
if (window._miniprogram) {
const addressInfo = {
address: this.detailInfo.hospitalAddress,
latitude: this.detailInfo.latitude,
longitude: this.detailInfo.longitude,
name: this.detailInfo.hospitalName,
};
console.log(this.$rocNative.WXInstance);
this.$rocNative.WXInstance.openLocation(addressInfo);
return;
}
this.showSsheet = true; this.showSsheet = true;
}, },
......
...@@ -3,63 +3,126 @@ ...@@ -3,63 +3,126 @@
</template> </template>
<script> <script>
import { getJumpPageStatus} from '@/api/question'; import { getJumpPageStatus, createOrder } from '@/api/question';
import {getDetectionName} from '@/api/appoint';
export default { export default {
data() { data() {
return { return {
// 无问卷-0001 有问卷未填写-0101 已填写问卷未出结果-0102 已出结果无需领用-0401 已出结果未预约-0201 已预约未采样-0301 已预约已采样-0302 // 无问卷-0001 有问卷未填写-0101 已填写问卷未出结果-0102 已出结果无需领用-0401 已出结果未预约-0201 已预约未采样-0301 已预约已采样-0302
// // 0102 已填写问卷
// // 0201 待预约
// // 0202 已预约
// // 0203 已取消待重新预约(暂时无用)
// // 0301 待采样 (暂时无用)
// // 0302 已采样
// // 0303 待重新采样
// // 0901 已结束
// // 0902 已出报告
// // 变化如下:
// // 原来的 已出报告状态从0304变更为0901, 原来的已结束状态0401变更为0902
routerMap:{ routerMap:{
'0001': '/appoint', // '0001': '/appoint',
'0101': null, // '0101': null,
'0102': '/insuranceQuestionBack', '0102': '/insuranceQuestionBack',
'0401': '/insuranceQuestionResult', // '0401': '/insuranceQuestionResult',
'0201': '/appoint', '0201': '/appoint',
'0301': '/appoint-details', '0202': '/appoint-details',
'0302': '/insuranceBindCode', // '0203': '/appoint-details',
} '0302': '/insuranceDetectionDetail',
'0303': '/insuranceBindCode',
'0901': '/insuranceQuestionResult',
// '0902': '/insuranceBindCode',
},
dectionData: {},
projectEquityNo: '',
orderNo: '',
query:{}
}; };
}, },
mounted() {
const { projectEquityNo, orderNo } = this.$route.query;
this.query = this.$route.query;
this.projectEquityNo = projectEquityNo;
this.orderNo = orderNo;
this.getJumpPageStatus();
},
methods: { methods: {
// 目前是配置一个检测信息,可能会拓展,所以返回的是一个list
getDetectionName(yunOrderNo) {
getDetectionName(yunOrderNo).then(res => {
if (res.code === '000000' && res.data) {
const dectionData = res.data[0] || {};
console.log('getDetectionName', dectionData);
this.dectionData = dectionData;
this.dectionForm.detectName = dectionData.detectionName;
this.dectionForm.goodsId = dectionData.goodsId;
this.$store.dispatch('home/setInsuranceInfo', dectionData);
}
});
},
// 获取跳转状态 // 获取跳转状态
getJumpPageStatus() { getJumpPageStatus() {
getJumpPageStatus(this.orderNo, this.projectEquityNo).then(res => { const data = {
orderNo: this.orderNo,
projectEquityNo:this.projectEquityNo
};
getJumpPageStatus(data).then(res => {
if (res.code == '000000') { if (res.code == '000000') {
this.yunOrderNo = res.data.yunOrderNo; if (res.data.yunOrderNo && res.data.yunOrderNo != '') {
this.query.yunOrderNo = res.data.yunOrderNo; this.checkStatus(res);
this.status = res.data.status; } else {
switch (res.data.status) { // https://dev-sc.yunqueyi.com/tis/insurance/create/order
case '0001': this.createOrder(data);
this.turnToPage(this.routerMap[ this.status], this.query);
break;
case '0101':
// this.turnToPage(this.routerMap[ this.status], this.query);
// 跳转到问卷页面
window.location.href = res.data.url;
break;
case '0102':
// 跳转到结果页面;
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0401':
this.query.needDetect = 1;
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0201':
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0301':
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0302':
this.turnToPage(this.routerMap[this.status], this.query);
break;
default:
break;
} }
} }
}); });
}, },
checkStatus(res) {
this.yunOrderNo = res.data.yunOrderNo;
this.query.yunOrderNo = res.data.yunOrderNo;
this.status = res.data.status;
this.getDetectionName(this.yunOrderNo);
switch (res.data.status) {
case '0001':
this.turnToPage(this.routerMap[ this.status], this.query);
break;
case '0101':
// this.turnToPage(this.routerMap[ this.status], this.query);
// 跳转到问卷页面
window.location.href = res.data.questionnaireUrl;
break;
case '0102':
// 跳转到结果页面;
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0401':
this.query.needDetect = 1;
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0201':
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0301':
this.turnToPage(this.routerMap[this.status], this.query);
break;
case '0302':
this.turnToPage(this.routerMap[this.status], this.query);
break;
default:
break;
}
},
createOrder(data) {
createOrder(data).then(res => {
if (res.code == '000000') {
this.checkStatus(res);
}
});
},
turnToPage(path, query) { turnToPage(path, query) {
this.$router.push({ this.$router.push({
path, query path, query
}); });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册