Commit 6eaa2721 authored by gengchunlei's avatar gengchunlei

有盟前端埋点

parent eb525c7c
This diff is collapsed.
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"mint-ui": "^2.2.13", "mint-ui": "^2.2.13",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vue-uweb": "^0.2.2",
"vuex": "^3.4.0" "vuex": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -16,13 +16,21 @@ ...@@ -16,13 +16,21 @@
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<!-- <script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>--> <!-- <script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>-->
<title>云南省免费提供避孕药具服务平台</title> <title>云南省免费提供避孕药具服务平台</title>
<!-- <script>-->
<!-- //声明_czc对象:-->
<!-- var _czc = _czc || [];-->
<!-- //绑定siteid,请用您的siteid替换下方"XXXXXXXX"部分-->
<!-- _czc.push(["_setAccount", "1280549113"]);-->
<!-- </script>-->
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<!--<script type="text/javascript" src="https://v1.cnzz.com/z_stat.php?id=1280549113&web_id=1280549113"></script>-->
<script type="text/javascript">document.write(unescape("%3Cspan id='cnzz_stat_icon_1280549113'%3E%3C/span%3E%3Cscript src='https://v1.cnzz.com/z_stat.php%3Fid%3D1280549113%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script>
</body> </body>
<script> <script>
// var vConsole =new VConsole(); // var vConsole =new VConsole();
// console.log('Hello world'); // console.log('Hello world');
</script> </script>
</html> </html>
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
<router-view/> <router-view/>
</div> </div>
</template> </template>
...@@ -7,12 +7,15 @@ import 'mint-ui/lib/style.css' ...@@ -7,12 +7,15 @@ import 'mint-ui/lib/style.css'
import './assets/elGlobal.css' import './assets/elGlobal.css'
import Router from 'vue-router' import Router from 'vue-router'
import { InfiniteScroll } from 'mint-ui'; import { InfiniteScroll } from 'mint-ui';
import eventLog from "./utils/directive/eventLog";//有盟事件埋点指令v-log="[]"
import uweb from "vue-uweb";
Vue.use(InfiniteScroll); Vue.use(InfiniteScroll);
Vue.use(Router) Vue.use(Router)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(MintUI) Vue.use(MintUI)
Vue.use(eventLog)
Vue.use(uweb,1280549113)
new Vue({ new Vue({
router, router,
store, store,
......
/***************** 埋点自定义指令 *******************/
// readme: https://open.cnzz.com/a/api/trackevent/
export default {
install (Vue) {
Vue.directive('log', {
bind (el, binding) {
el.addEventListener('click', () => { window._czc.push(['_trackEvent', ...binding.value]) }, false)
},
unbind (el) {
el.removeEventListener('click', () => { console.log('remove') })
}
})
}
}
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
<div class="bottom_btn"> <div class="bottom_btn">
<mt-button type="primary" @click="nextStep" size="large"> 下一步</mt-button> <mt-button type="primary" @click="nextStep" size="large" v-log="['微信扫码领取人信息填写', '下一步']"> 下一步</mt-button>
</div> </div>
</div> </div>
<no-data v-if="isNoData"> <no-data v-if="isNoData">
...@@ -173,7 +173,8 @@ ...@@ -173,7 +173,8 @@
if (data.data) { if (data.data) {
let par = { let par = {
...this.urlParamsDetail, ...this.urlParamsDetail,
...this.formData ...this.formData,
resource: '2'
} }
this.$router.push({path:'/manualCollection', query: par}) this.$router.push({path:'/manualCollection', query: par})
} else { } else {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</div> </div>
</div> </div>
<!--class="item-right add sub"--> <!--class="item-right add sub"-->
<div class="sub" @click="singleSub(item)">申请领取</div> <div class="sub" @click="singleSub(item)" v-log="['药具领取', '确定']">申请领取</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -119,7 +119,24 @@ ...@@ -119,7 +119,24 @@
}, },
created() { created() {
this.routerDetail = this.$route.query this.routerDetail = this.$route.query
if (this.routerDetail.resource == '2') {
this.$uweb.ready().then(() => {
// window._czc.push(["_setCustomVar","访客来源", "微信扫码", 0])
this.$uweb.setCustomVar("访客来源", "微信扫码", 0)
}).catch(() => {
})
} else {
this.$uweb.ready().then(() => {
// window._czc.push(["_setCustomVar","访客来源", "医站到家", 0])
this.$uweb.setCustomVar("访客来源", "医站到家", 0)
}).catch(() => {
})
}
// this.sessionInfo = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')) // this.sessionInfo = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
},
mounted() {
}, },
methods: { methods: {
getRecordInfo(callBack) { getRecordInfo(callBack) {
...@@ -334,12 +351,12 @@ ...@@ -334,12 +351,12 @@
...record, ...record,
phone: this.routerDetail.telephone, phone: this.routerDetail.telephone,
networkId: this.routerDetail.id, networkId: this.routerDetail.id,
receiveWay: receiveWay[1].id, receiveWay: receiveWay[0].id,
number: +record.number, number: +record.number,
produceDate: record.produceDate + ' '+'00:00:00', produceDate: record.produceDate + ' '+'00:00:00',
expireDate: record.expireDate + ' '+'00:00:00', expireDate: record.expireDate + ' '+'00:00:00',
residentName: this.routerDetail.residentName, residentName: this.routerDetail.residentName,
resource: '2' resource: this.routerDetail.resource
} }
// console.log(JSON.stringify(par)) // console.log(JSON.stringify(par))
addSingleManualMedicalRecord(par).then(({data}) => { addSingleManualMedicalRecord(par).then(({data}) => {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</mt-header> </mt-header>
<div id="map-container" class="containerMap"></div> <div id="map-container" class="containerMap"></div>
<div class="scanCode"> <div class="scanCode">
<mt-button icon="saoma" type="primary" @click="ScanCode">扫码领取</mt-button> <mt-button icon="saoma" type="primary" @click="ScanCode" v-log="['h5摄像头调用', '开始']">扫码领取</mt-button>
</div> </div>
<div class="right_item"> <div class="right_item">
<div class="item"> <div class="item">
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
}) })
}, },
subscanQRCallBack(val) { subscanQRCallBack(val) {
// window.sessionStorage.setItem('test', val)
let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')) let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
const {phone = '', userId = ''} = info const {phone = '', userId = ''} = info
let urlP = '' let urlP = ''
...@@ -116,7 +115,8 @@ ...@@ -116,7 +115,8 @@
netTypeName, netTypeName,
netName, netName,
status: netStauts, status: netStauts,
telephone: phone telephone: phone,
resource: '1'
} }
if (!result.netType) { if (!result.netType) {
return return
......
This diff is collapsed.
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