Commit 23a9d6d8 by liwk

道路救援

1 parent 780cc0e9
......@@ -28,7 +28,7 @@
</template>
<script>
// import VConsole from 'vconsole'
import VConsole from 'vconsole'
export default {
data () {
return {
......@@ -40,7 +40,7 @@ export default {
},
mounted () {
// window.vConsole = new VConsole()
window.vConsole = new VConsole()
},
methods: {
onClickLeft () {
......

1.18 MB | W: | H:

1.32 MB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
.sprite-icon { background-image: url(../images/sprite.png);background-size: 721px 710px;}
.icon-400 { width: 59px; height: 16px; background-position: -456px -484px;}
.icon-10000 { width: 80px; height: 16px; background-position: -366px -484px;}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 791px 680px;}
.icon-400 { width: 59px; height: 16px; background-position: -420px -360px;}
.icon-10000 { width: 80px; height: 16px; background-position: -330px -360px;}
.icon-banner { width: 375px; height: 240px; background-position: 0px 0px;}
.icon-btn { width: 362px; height: 63px; background-position: -330px -340px;}
.icon-card { width: 23px; height: 18px; background-position: -696px -414px;}
.icon-city { width: 60px; height: 60px; background-position: 0px -600px;}
.icon-default-avatar { width: 50px; height: 50px; background-position: -627px -515px;}
.icon-didi { width: 60px; height: 60px; background-position: -70px -600px;}
.icon-btn { width: 362px; height: 63px; background-position: -185px -504px;}
.icon-card { width: 23px; height: 18px; background-position: -330px -386px;}
.icon-city { width: 60px; height: 60px; background-position: -731px 0px;}
.icon-default-avatar { width: 50px; height: 50px; background-position: -731px -624px;}
.icon-didi { width: 60px; height: 60px; background-position: -731px -70px;}
.icon-equity-card { width: 336px; height: 216px; background-position: -385px 0px;}
.icon-gas { width: 60px; height: 60px; background-position: -140px -600px;}
.icon-halou { width: 60px; height: 60px; background-position: -210px -600px;}
.icon-kfc { width: 100px; height: 60px; background-position: -366px -414px;}
.icon-m { width: 100px; height: 60px; background-position: -476px -414px;}
.icon-more { width: 20px; height: 20px; background-position: -696px -442px;}
.icon-gas { width: 60px; height: 60px; background-position: -731px -140px;}
.icon-halou { width: 60px; height: 60px; background-position: -731px -210px;}
.icon-kfc { width: 100px; height: 60px; background-position: -385px -414px;}
.icon-m { width: 100px; height: 60px; background-position: -495px -414px;}
.icon-more { width: 20px; height: 20px; background-position: -698px -577px;}
.icon-partner { width: 320px; height: 154px; background-position: 0px -250px;}
.icon-qingji { width: 60px; height: 60px; background-position: -280px -600px;}
.icon-ruixing { width: 100px; height: 60px; background-position: -586px -414px;}
.icon-scan { width: 18px; height: 18px; background-position: -702px -340px;}
.icon-tickets { width: 60px; height: 60px; background-position: -350px -600px;}
.icon-today { width: 60px; height: 60px; background-position: -420px -600px;}
.icon-tuanyou { width: 60px; height: 60px; background-position: -490px -600px;}
.icon-vip { width: 20px; height: 18px; background-position: -684px -630px;}
.icon-xbk { width: 100px; height: 60px; background-position: -185px -515px;}
.icon-device-add { width: 40px; height: 40px; background-position: 0px -670px;}
.icon-device-bg { width: 375px; height: 80px; background-position: -330px -250px;}
.icon-device-bind { width: 54px; height: 54px; background-position: -560px -600px;}
.icon-device-scan { width: 20px; height: 20px; background-position: -687px -515px;}
.icon-device-sn { width: 20px; height: 16px; background-position: -525px -484px;}
.icon-device-vin { width: 20px; height: 16px; background-position: -555px -484px;}
.icon-car-add { width: 175px; height: 176px; background-position: 0px -414px;}
.icon-ruixing { width: 100px; height: 60px; background-position: -605px -414px;}
.icon-scan { width: 18px; height: 18px; background-position: -393px -386px;}
.icon-tickets { width: 60px; height: 60px; background-position: -731px -280px;}
.icon-today { width: 60px; height: 60px; background-position: -731px -350px;}
.icon-tuanyou { width: 60px; height: 60px; background-position: -731px -420px;}
.icon-vip { width: 20px; height: 18px; background-position: -363px -386px;}
.icon-xbk { width: 100px; height: 60px; background-position: -557px -504px;}
.icon-device-add { width: 40px; height: 40px; background-position: -662px -310px;}
.icon-device-bg { width: 375px; height: 80px; background-position: 0px -414px;}
.icon-device-bind { width: 54px; height: 54px; background-position: -731px -560px;}
.icon-device-scan { width: 20px; height: 20px; background-position: -698px -607px;}
.icon-device-sn { width: 20px; height: 16px; background-position: -489px -360px;}
.icon-device-vin { width: 20px; height: 16px; background-position: -519px -360px;}
.icon-car-add { width: 175px; height: 176px; background-position: 0px -504px;}
.icon-car-err { width: 11px; height: 11px; background-position: -385px -226px;}
.icon-car-photo-0 { width: 73px; height: 51px; background-position: -295px -515px;}
.icon-car-photo-1 { width: 73px; height: 51px; background-position: -378px -515px;}
.icon-car-photo-2 { width: 73px; height: 51px; background-position: -461px -515px;}
.icon-car-photo-3 { width: 73px; height: 51px; background-position: -544px -515px;}
.icon-car-photo-0 { width: 73px; height: 51px; background-position: -366px -577px;}
.icon-car-photo-1 { width: 73px; height: 51px; background-position: -449px -577px;}
.icon-car-photo-2 { width: 73px; height: 51px; background-position: -532px -577px;}
.icon-car-photo-3 { width: 73px; height: 51px; background-position: -615px -577px;}
.icon-car-success { width: 11px; height: 11px; background-position: -406px -226px;}
.icon-car-camera { width: 20px; height: 20px; background-position: -687px -545px;}
.icon-car-bind { width: 50px; height: 50px; background-position: -624px -600px;}
.icon-car-edit { width: 20px; height: 20px; background-position: -684px -600px;}
.icon-car-tips { width: 171px; height: 91px; background-position: -185px -414px;}
\ No newline at end of file
.icon-car-camera { width: 20px; height: 20px; background-position: -366px -638px;}
.icon-car-bind { width: 50px; height: 50px; background-position: -662px -250px;}
.icon-car-edit { width: 20px; height: 20px; background-position: -396px -638px;}
.icon-car-tips { width: 171px; height: 91px; background-position: -185px -577px;}
.icon-jiuyuan { width: 60px; height: 60px; background-position: -731px -490px;}
.icon-equity-bg { width: 322px; height: 100px; background-position: -330px -250px;}
.icon-equity-phone { width: 20px; height: 20px; background-position: -426px -638px;}
.icon-equity-type1 { width: 50px; height: 50px; background-position: -667px -504px;}
\ No newline at end of file
......@@ -11,10 +11,10 @@ export default {
id: 54
},
{
name: '青桔单车',
icon: 'qingji',
description: '6折起',
typeId: 167
name: '道路救援',
icon: 'jiuyuan',
description: '时刻守护',
route: 'road'
},
{
name: '滴滴出行',
......@@ -108,6 +108,12 @@ export default {
delete params.icon
delete params.description
console.log(params)
if (params.route) {
let [href] = window.location.href.split('/#/')
let url = `${href}/#/equity/${params.route}`
this.openWindows(url, `equity.${params.route}`)
return
}
equity.getCouponList({
requestSource: this.getChannel(), //1.小程序,2.APP,3.公众号
...params
......
......@@ -11,7 +11,7 @@ import {
import store from '@/store'
import { common } from '../api/api'
router.beforeEach(async(to, from, next) => {
let { meta: { showTab, toTop, isDetail } } = to
let { meta: { showTab, toTop, isDetail, authBase } } = to
Vue.prototype.TabShowHide = showTab || false
if (toTop) document.documentElement.scrollTop = 0
if (isDetail) Vue.prototype.goHome = !from.name
......@@ -27,7 +27,7 @@ router.beforeEach(async(to, from, next) => {
return
}
let [redirectUrl] = window.location.href.split('?')
getSessionId(redirectUrl, { to, from, next })
getSessionId(redirectUrl, { to, from, next }, authBase ? 'snsapi_base' : 'snsapi_userinfo')
return
} else {
setUserInfo(params)
......@@ -38,10 +38,10 @@ router.beforeEach(async(to, from, next) => {
}
})
const getSessionId = (redirectUrl, route) => {
const getSessionId = (redirectUrl, route, scope) => {
const params = getParams(window.location.href)
if (params.code) {
common.getSessionId({ code: params.code }).then(res => {
common.getSessionId({ code: params.code, state: scope }).then(res => {
if (res) {
let { code, data, errId, message } = res
if (code == 0) {
......@@ -61,13 +61,15 @@ const getSessionId = (redirectUrl, route) => {
} else {
const WXAppId = 'wx56bed167ad463f70'
redirectUrl = encodeURIComponent(redirectUrl)
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${WXAppId}&redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${WXAppId}&redirect_uri=${redirectUrl}&response_type=code&scope=${scope}&state=${scope}#wechat_redirect`
}
}
const setUserInfo = params => {
if (params.sessionId) {
store.commit('setSessionId', params.sessionId)
store.commit('setUserId', params.userId)
if (params.userId) store.commit('setUserId', params.userId)
if (params.accountId) store.commit('setUserId', params.accountId)
if (params.openid) store.commit('setOpenid', params.openid)
}
// let test = 'mini-91fbb2c4-ba2c-44e4-b973-3943c7a063b2-rop'
// store.commit('setSessionId', test)
......
const pages = {
equity: [{ name: 'index' }],
common: [{
name: 'index',
// hasAuth: true
},
equity: [{ name: 'index' }, { name: 'road', title: '道路救援' }],
common: [
{ name: 'index', hasAuth: true },
{ name: 'activate', title: '激活权益' },
{ name: 'explain', title: '常见疑问' },
{ name: 'phoneLogin', title: '登录' }
......@@ -15,6 +13,8 @@ const pages = {
}],
device: [{
name: 'index',
hasAuth: true,
authBase: true,
title: '设备关联'
},
{
......
......@@ -7,7 +7,8 @@ export default {
clearFlag: false,
verificationCount: null,
verificationFlag: null,
lastPath: ''
lastPath: '',
openid: ''
},
mutations: {
setSessionId(state, newVal) {
......@@ -27,6 +28,9 @@ export default {
setUserId(state, newVal) {
state.userId = newVal
},
setOpenid(state, newVal) {
state.openid = newVal
},
setActiveIndex(state, newVal) {
state.activeIndex = newVal
},
......
......@@ -135,11 +135,25 @@ const getChannel = () => {
}
return source
}
const makePhoneCall = phoneNumber => {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.location.href = `tel://${phoneNumber}`
} else {
if (checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 6, tel: phoneNumber }))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 6, tel: phoneNumber }))
}
}
}
const utils = {
removeLocalStorage,
setLocalStorage,
getLocalStorage,
checkPhoneType,
makePhoneCall,
showLoading,
openWindows,
hideLoading,
......
<template>
<div class="main">
<div class="box">
<div class="header">
<div class="sprite-icon icon-equity-bg"></div>
<div class="type-1-header">
道路救援
<div class="sprite-icon icon-equity-type1"></div>
</div>
</div>
<div class="body">
<div class="type-1-body">
<div class="title">
<span>权益说明</span>
</div>
<div class="content">
<p>1、<span>救援服务对象:非营运自用9座以下车辆。</span></p>
<p>2、<span>服务期限:一年</span></p>
<p>3、<span>服务范围:全国范围(除港澳台)</span></p>
<p>4、<span>服务时间:全年7*24小时</span></p>
<p>5、<span>救援场景:非事故免费道路救援。</span></p>
<p>6、<span>服务内容“包括拖车、紧急送油、路边快修、更换轮胎等,相关材料费由车主承担。</span></p>
</div>
<div class="tips">注:本服务不承接事故类救援,请在需要时联系 您投保的车辆商业险的保险公司协助处理。</div>
</div>
</div>
</div>
<div
class="phone btn"
@click="makePhoneCall(4006123886)"
>
<div class="sprite-icon icon-equity-phone"></div>
电话咨询
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'road',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
border: 1px solid #fbdcae;
border-radius: 4px;
margin: 30px 26.5px 40px;
.header {
width: 100%;
height: 100px;
position: relative;
> div {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
font-size: 18px;
color: #696969;
box-sizing: border-box;
padding: 25px 0 0 34px;
}
.type-1-header {
.sprite-icon {
position: absolute;
top: 25px;
right: 20px;
}
}
}
.body {
padding: 24px 34px 20px;
font-size: 12px;
color: #333;
> div {
.title {
font-size: 16px;
color: #6a6a6a;
font-weight: 700;
position: relative;
span {
position: relative;
&::after {
content: "";
position: absolute;
width: 100%;
height: 4px;
background-color: #ffc775;
bottom: 3px;
left: 0;
z-index: -1;
}
}
}
.content {
margin: 14px 0 8px;
line-height: 24px;
color: #333;
p {
display: grid;
grid-template-columns: 20px 1fr;
}
.item {
display: grid;
grid-template-columns: 30px 1fr;
gap: 0 10px;
align-items: center;
margin-bottom: 18px;
}
}
.tips {
color: #666;
}
}
}
}
.btn {
width: 85.9%;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
margin: 40px auto 20px;
font-size: 18px;
color: #ffffff;
background: #ffc775;
border-radius: 10px;
.sprite-icon {
margin-right: 20px;
}
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!