Commit f70ccb26 authored by gengchunlei's avatar gengchunlei

扫一扫修改

parent 05b02f17
......@@ -35,7 +35,7 @@ export const getStockInfo = params => {
return apiInstance.get(`/stock-info/v1/stock-info/stock-basic-info/basic-info`, {params})
}
//用户领取次数
//判断用户首次领取是否已填随访
export const getUserReceiveNum = params => {
return apiInstance.get(`/stock-info/v1/stock-info/stock-provide-record/number/${params.residentId}`, {params})
}
......@@ -46,6 +46,6 @@ export const addVisitRecord = params => {
}
//确认领取药具
export const getMedical = params => {
export const addMedicalRecord = params => {
return apiInstance.post(`/stock-info/v1/stock-info/stock-provide-record`, params)
}
<template>
<div class="choiceContraceptives">
<mt-header title="选择药具">
<router-link to="/" slot="left">
<div slot="left" @click="goBack">
<mt-button icon="back"></mt-button>
</router-link>
</div>
</mt-header>
<div class="content-list" v-if="!noDataShow">
<div
......@@ -53,9 +53,9 @@
</template>
<script>
import {getMedical, getStockInfo} from "../utils/api";
import {addMedicalRecord, getStockInfo} from "../utils/api";
import {callMobile} from "../utils/common";
import { MessageBox } from 'mint-ui';
export default {
name: "choiceContraceptives",
data(){
......@@ -75,13 +75,8 @@
methods:{
getStockListInfo(callBack) {
this.routerDetail = JSON.parse(this.$route.query.info)
Toast({
message: '测试'+ this.routerDetail,
position: 'bottom',
duration: 5000
});
let par = {
relationId: 4,
relationId: this.routerDetail,
...this.param
}
getStockInfo(par).then(({data = {}}) => {
......@@ -110,16 +105,34 @@
backHome(){
callMobile("goIndex", {});
},
goBack() {
window.history.go(-1)
},
receiveContraceptives(){
let pars = JSON.parse(this.checkedMedical)
let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
const {phone = '', userId =''} = info
const {id, ...other } = pars
let par = {
residentId: 1,
networkId: 4,
...pars
residentId: userId,
telephone: phone,
networkId: this.routerDetail,
...other
}
getMedical(par).then(({data}) => {
addMedicalRecord(par).then(({data}) => {
if (data.code == 'SUCCESS') {
Toast({
message: '领取成功!',
position: 'bottom',
duration: 2000
});
this.$router.push("/receiveSuccess");
} else {
Toast({
message: '系统异常,请联系管理员!',
position: 'bottom',
duration: 2000
});
}
})
......
<template>
<div>
<mt-header title="领取记录">
<router-link to="/" slot="left">
<div slot="left" @click="goBack">
<mt-button icon="back"></mt-button>
</router-link>
</div>
</mt-header>
<div>
......@@ -103,6 +103,9 @@
this.getRecordInfo()
}
},
goBack() {
window.history.go(-1)
},
beforeDestroy() {
this.detailInfo = []
}
......
<template>
<div class="myMap">
<mt-header title="药具领取">
<router-link to="/" slot="left">
<div slot="left" @click="toRealHome">
<mt-button icon="back"></mt-button>
</router-link>
</div>
</mt-header>
<div id="map-container" class="containerMap"></div>
<div class="scanCode">
......@@ -39,10 +39,9 @@
import closeImg from '../assets/img/close.png';
import presonImg from '../assets/img/preson.png';
import sharpImg from '../assets/img/sharp.png';
import { MessageBox } from 'mint-ui';
import {getNetworkInfo, getUserReceiveNum} from '../utils/api';
import {callMobile, getQueryVariable} from "../utils/common";
import { Toast } from 'mint-ui';
import { MessageBox } from 'mint-ui';
export default {
name: "myMap",
data() {
......@@ -60,10 +59,10 @@
mounted() {
this.createMap();
// 将qrcodeContent方法绑定到window下面,提供给外部调用
document.addEventListener("qrcodeContent",this.subscanQRCallBack);
},
beforeDestroy() {//销毁
document.removeEventListener("qrcodeContent",this.subscanQRCallBack);
let vm = this
window['qrcodeContent'] = (result) => {
vm.subscanQRCallBack(result)
}
},
methods: {
// 接收url后的数据
......@@ -79,29 +78,24 @@
window.sessionStorage.setItem('mobileTokenIno', JSON.stringify(mobileTokenIno))
},
ScanCode() {
callMobile("qrcode", {});
},
async subscanQRCallBack(result){
/*先判断是否有没有回访的领取记录*/
let par = {residentId: 1}//居民id
await getUserReceiveNum(par).then(({data}) => {
this.recordNum = data.data
})
Toast({
message: 'ceshi'+this.recordNum,
position: 'top',
duration: 100000
});
if (this.recordNum = 0) {
this.$router.push({path: `/choiceContraceptives`,query:{info:result}});
} else {
this.$router.push({path: `/returnVisit`,query:{info:result}});
}
let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
const {phone = '', userId = ''} = info
let par = {telephone: phone, residentId: userId}//居民id
getUserReceiveNum(par).then(({data}) => {
if (data.data == true) {
callMobile("qrcode", {});
} else {
this.$router.push( `/returnVisit`);
}
})
},
subscanQRCallBack(result){
this.$router.push({path: `/choiceContraceptives`,query:{info:result}});
},
toCollectRecords() {
this.$router.push({path: `/returnVisit`,query:{info:4}});
// this.$router.push('/collectRecords');
// this.$router.push({path: `/choiceContraceptives`,query:{info:1986}});
this.$router.push('/collectRecords');
},
toRealHome() {
callMobile("goIndex", {});
......
<template>
<div>
<mt-header title="领取成功">
<router-link to="/" slot="left">
<div slot="left" @click="goBack">
<mt-button icon="back"></mt-button>
</router-link>
</div>
</mt-header>
<div class="success-img">
<img src="../assets/img/receiveSuccess.png"/>
......@@ -23,6 +23,9 @@
export default {
name: "receiveSuccess",
methods:{
goBack() {
window.history.go(-1)
},
backHome(){
callMobile("goIndex", {});
}
......
......@@ -122,7 +122,11 @@
/*验证完毕*/
if(flag){
let badInfo = this.formData.badReaction.join()
let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
const {phone = '', userId =''} = info
let par = {
residentId: userId,
telephone: phone,
satisfied: this.formData.isAgree,
satisfiedReason: this.formData.disagreeReason,
bad: this.formData.isBadReaction,
......@@ -136,7 +140,7 @@
position: 'bottom',
duration: 2000
});
this.$router.push("/");
window.history.go(-1)
} else {
Toast({
message: '失败,请联系管理员!',
......
<template>
<div class="siteDetails">
<mt-header title="网点详情">
<router-link to="/" slot="left">
<div slot="left" @click="goBack">
<mt-button icon="back"></mt-button>
</router-link>
</div>
</mt-header>
<div class="siteDetailInfo">
<div class="siteName">{{siteDetail.netName}}</div>
......@@ -147,6 +147,9 @@
clickPhone() {
console.log(456);
},
goBack() {
window.history.go(-1)
},
getDistance(latFrom, lngFrom, latTo, lngTo) {
var rad = function (d) {//计算角度
return d * Math.PI / 180.0;
......
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