Commit ca8a2ed7 by liwk

commit

1 parent 4a551865
......@@ -4,7 +4,7 @@ VUE_APP_TITLE=广联运营平台
# 网络请求公用地址
#VUE_APP_API=https://wx.glsx.com.cn/rop-ddh-carlife/router
#VUE_APP_API=https://qcwx.glsx.com.cn/rop-ddh-carlife/router
VUE_APP_API=http://192.168.1.102:8086/rop-ddh-carlife/router
VUE_APP_API=http://r2j7.branch.glsx.com.cn/rop-ddh-carlife/router
# APPKEY
VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637
VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
\ No newline at end of file
......@@ -8,4 +8,14 @@ export const equity = {
getCardInfo() {
return request({}, 'ddh.carlife.equity.h5.card.get')
},
}
export const common = {
/** 根据卡号激活权益卡 */
activateByCardNo(data) {
return request(data, 'ddh.carlife.equity.h5.card.enable.by.cardno')
},
/** 根据SN激活权益卡 */
activateBySn(data) {
return request(data, 'ddh.carlife.equity.h5.card.enable.by.sn')
},
}
\ No newline at end of file

469 KB | W: | H:

1 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
.content {
.van-notice-bar {
margin: 0 20px 16px;
padding: 0 5px;
border-radius: 8px;
}
.box {
margin-bottom: 20px;
padding-bottom: 20px;
background-color: #fff;
.title {
font-size: 18px;
color: #2c2c2c;
display: flex;
justify-content: space-between;
font-weight: 700;
padding: 10px 20px;
margin-bottom: 14px;
.more {
font-weight: normal;
font-size: 14px;
display: flex;
align-items: center;
.icon-more {
margin-left: 7px;
}
}
}
.sub-title {
font-size: 17px;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
margin: 46px 0 5px;
&::before,
&::after {
display: block;
content: '';
background: #FADFB8;
width: 72px;
height: 2px;
}
&::before {
margin-right: 20px;
}
&::after {
margin-left: 20px;
}
}
.partner {
margin: 0 auto;
}
.items {
display: grid;
grid-template-columns: repeat(4, 1fr);
.item {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
color: #999999;
.sprite-icon {
margin-bottom: 4px;
}
&-name {
font-size: 14px;
color: #2c2c2c;
}
}
}
.scroll-items {
overflow-x: scroll;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
padding: 0 20px;
display: flex;
.item {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
color: #999999;
.sprite-icon {
margin-bottom: 4px;
margin-right: 10px;
}
&-name {
font-size: 14px;
color: #2c2c2c;
}
&-name,
&-description {
transform: translateX(-5px);
}
}
.item:last-of-type {
.sprite-icon {
margin-right: 20px;
}
.item-name,
.item-description {
transform: translateX(-10px);
}
}
&::-webkit-scrollbar {
display: none;
height: 0;
opacity: 0;
width: 0;
}
}
.gas-grid {
display: grid;
grid-template-columns: 1fr 1fr;
.item {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 6px;
.sprite-icon {
margin-right: 10px;
position: relative;
.sub-icon {
position: absolute;
left: 0;
bottom: -6px;
transform: translateY(100%);
}
}
}
}
}
}
\ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 438.5px 341px;}
.icon-default-avatar { width: 50px; height: 50px; background-position: -187.5px -281px;}
.icon-didi { width: 60px; height: 60px; background-position: -338.5px -62.5px;}
.icon-equity-card { width: 336px; height: 216px; background-position: 0px 0px;}
.icon-halou { width: 60px; height: 60px; background-position: -338.5px -125px;}
.icon-kfc { width: 100px; height: 60px; background-position: 0px -218.5px;}
.icon-m { width: 100px; height: 60px; background-position: -102.5px -218.5px;}
.icon-more { width: 20px; height: 20px; background-position: -401px -62.5px;}
.icon-qingji { width: 60px; height: 60px; background-position: -338.5px -187.5px;}
.icon-ruixing { width: 100px; height: 60px; background-position: -205px -218.5px;}
.icon-tickets { width: 60px; height: 60px; background-position: 0px -281px;}
.icon-today { width: 60px; height: 60px; background-position: -62.5px -281px;}
.icon-tuanyou { width: 60px; height: 60px; background-position: -125px -281px;}
.icon-vip { width: 20px; height: 18px; background-position: -401px -85px;}
.icon-xbk { width: 100px; height: 60px; background-position: -338.5px 0px;}
\ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 721px 530px;}
.icon-400 { width: 59px; height: 16px; background-position: -660px -414px;}
.icon-10000 { width: 80px; height: 16px; background-position: 0px -484px;}
.icon-banner { width: 375px; height: 240px; background-position: 0px 0px;}
.icon-btn { width: 362px; height: 63px; background-position: -330px -250px;}
.icon-card { width: 23px; height: 18px; background-position: -660px -440px;}
.icon-city { width: 60px; height: 60px; background-position: -660px -323px;}
.icon-default-avatar { width: 50px; height: 50px; background-position: -600px -414px;}
.icon-didi { width: 60px; height: 60px; background-position: -110px -414px;}
.icon-equity-card { width: 336px; height: 216px; background-position: -385px 0px;}
.icon-gas { width: 60px; height: 60px; background-position: -180px -414px;}
.icon-halou { width: 60px; height: 60px; background-position: -250px -414px;}
.icon-kfc { width: 100px; height: 60px; background-position: -330px -323px;}
.icon-m { width: 100px; height: 60px; background-position: -440px -323px;}
.icon-more { width: 20px; height: 20px; background-position: 0px -510px;}
.icon-partner { width: 320px; height: 154px; background-position: 0px -250px;}
.icon-qingji { width: 60px; height: 60px; background-position: -320px -414px;}
.icon-ruixing { width: 100px; height: 60px; background-position: -550px -323px;}
.icon-scan { width: 18px; height: 18px; background-position: -702px -250px;}
.icon-tickets { width: 60px; height: 60px; background-position: -390px -414px;}
.icon-today { width: 60px; height: 60px; background-position: -460px -414px;}
.icon-tuanyou { width: 60px; height: 60px; background-position: -530px -414px;}
.icon-vip { width: 20px; height: 18px; background-position: -693px -440px;}
.icon-xbk { width: 100px; height: 60px; background-position: 0px -414px;}
\ No newline at end of file
......@@ -64,6 +64,17 @@ export default {
description: '最高省10元',
typeId: 148
}
],
gasList: [{
name: '覆盖城市',
icon: 'city',
subIcon: '400'
},
{
name: '加油站',
icon: 'gas',
subIcon: '10000'
}
]
}
},
......@@ -114,4 +125,5 @@ export default {
})
}
},
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ router.beforeEach(async(to, from, next) => {
store.commit('setSessionId', params.sessionId)
store.commit('setUserId', params.userId)
}
let test = 'mini-ecde1183-3b2f-42cf-bb30-00f203a453f8-rop'
let test = 'mini-4e270894-2495-4231-98a6-2169161bd252-rop'
store.commit('setSessionId', test)
let { meta: { showTab, toTop, isDetail } } = to
Vue.prototype.TabShowHide = showTab || false
......
......@@ -3,7 +3,8 @@ const pages = {
name: 'index',
}],
common: [
{ name: 'index' },
{ name: 'activate', title: '激活权益' }
]
}
......
......@@ -25,15 +25,6 @@ Date.prototype.format = function(fmt) {
}
return fmt
}
const WindowEvent = (type, callBack) => {
if (window.attachEvent) {
window.attachEvent(`on${type}`, function() {
callBack.call(window)
})
} else {
window.addEventListener(type, callBack, false)
}
}
const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
......@@ -60,12 +51,6 @@ const showLoading = (title = '加载中...') => {
const hideLoading = () => {
Toast.clear()
}
/**监听页面滚动事件 */
const onPageScroll = callBack => {
WindowEvent('scroll', $event => {
return callBack($event)
})
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
......@@ -154,7 +139,6 @@ const utils = {
setLocalStorage,
getLocalStorage,
checkPhoneType,
onPageScroll,
showLoading,
openWindows,
hideLoading,
......
<template>
<div class="main">
<div class="input">
<div class="sprite-icon icon-card"></div>
<input
type="text"
placeholder="权益卡号或设备编码"
v-model="no"
>
</div>
<div
class="btn"
@click="confirm"
>确认</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { common } from '@r/api.js'
export default {
name: '',
data () {
return {
no: ''
}
},
mounted () {
},
methods: {
confirm () {
let { no } = this
if (!no) return
console.log(no)
let target = 'activateBySn'
let params = {
sn: no
}
if (no.length == 12) {
target = 'activateByCardNo'
params.cardNo = no
delete params.sn
}
common[target](params).then(res => {
console.log(res)
})
}
}
}
</script>
<style scoped lang='scss'>
.main {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.input {
width: 211px;
display: grid;
grid-template-columns: 23px 150px 18px;
gap: 0 10px;
align-items: center;
padding-bottom: 5px;
border-bottom: 1px solid #e9e9e9;
margin: 0 auto;
img {
height: 18px;
}
input {
border: none;
outline: none;
background-color: rgba(0, 0, 0, 0);
}
::-webkit-input-placeholder {
color: #999;
}
}
.btn {
margin: 185px auto 0;
width: 300px;
height: 35px;
background: #2f77f3;
border-radius: 4px;
display: grid;
place-items: center;
color: #fff;
font-size: 14px;
}
}
</style>
\ No newline at end of file
<template>
<div class="main">
<div class="card">
<div class="sprite-icon icon-banner"></div>
</div>
<div class="content">
<div class="box">
<div class="title">
出行特权
</div>
<div class="items">
<template v-for="(i,index) in travelList">
<div
class="item"
:key="index"
>
<div :class="['sprite-icon',`icon-${i.icon}`]"></div>
<div class="item-name">{{i.name}}</div>
<div>{{i.description}}</div>
</div>
</template>
</div>
</div>
<div class="box">
<div class="title">
加油特惠
</div>
<div class="gas-grid">
<template v-for="(i,index) in gasList">
<div
class="item"
:key="index"
>
<div :class="['sprite-icon',`icon-${i.icon}`]">
<div class="sub-icon">
<div :class="['sprite-icon',`icon-${i.subIcon}`]"></div>
</div>
</div>
<div class="item-name">{{i.name}}</div>
</div>
</template>
</div>
<div class="sub-title">
品牌合作商
</div>
<div class="sprite-icon icon-partner partner"></div>
</div>
<div class="box">
<div class="title">
餐饮特权
</div>
<div class="scroll-items">
<template v-for="(i,index) in cateringList">
<div
class="item"
:key="index"
>
<div :class="['sprite-icon',`icon-${i.icon}`]"></div>
<div class="item-name">{{i.name}}</div>
<div class="item-description">{{i.description}}</div>
</div>
</template>
</div>
</div>
<div class="box">
<div class="title">
酒店旅游特权
</div>
<div class="items">
<template v-for="(i,index) in hotelList">
<div
class="item"
:key="index"
>
<div :class="['sprite-icon',`icon-${i.icon}`]"></div>
<div class="item-name">{{i.name}}</div>
<div>{{i.description}}</div>
</div>
</template>
</div>
</div>
</div>
<div
class="sprite-icon icon-btn btn"
@click="receive"
>
<div class="content">
领取无忧权益卡,臻享车生活
<div class="receive">立即领取</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { indexMixin } from '@/mixins'
export default {
name: '',
mixins: [indexMixin],
data () {
return {
isLogin: false
}
},
mounted () {
let { sessionId } = this.$store.state
if (sessionId) {
this.isLogin = true
}
},
methods: {
receive () {
let { isLogin } = this
let [href] = window.location.href.split('/index')
if (isLogin) {
let url = `${href}/activate`
this.openWindows(url)
} else {
let url = window.location.href
if (this.isMiniprogram) {
wx.miniProgram.redirectTo({
url: `/pages/auth/auth?url=${encodeURIComponent(url)}`
})
} else {
this.dialog({
title: '提示',
message: '领取权益卡,请先登录',
confirmButtonText: '前往登录',
cancelButtonText: '残忍拒绝',
}).then(() => {
if (this.checkPhoneType() == 'ios') {
if (window.webkit && window.webkit.messageHandlers.jumpNativeApp) {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 0 }))
} else {
window.location.href = url
}
} else {
if (window.myjs) {
window.myjs.jumpNativeApp(JSON.stringify({ type: 0 }))
} else {
window.location.href = url
}
}
})
}
}
}
}
}
</script>
<style lang='scss'>
@import "@a/scss/index.scss";
html,
body {
background-color: rgb(247, 247, 247);
}
.main {
padding-bottom: 73px;
}
.card {
margin-bottom: 30px;
}
.btn {
position: fixed;
left: 50%;
bottom: 10px;
transform: translateX(-50%);
display: flex;
justify-content: center;
.content {
display: flex;
align-items: center;
justify-content: space-between;
width: 344px;
height: 100%;
box-sizing: border-box;
padding: 0 27px 0 14px;
.receive {
width: calc(100% - 210px);
font-size: 16px;
color: #ffe3b5;
display: flex;
align-items: center;
justify-content: flex-end;
height: 100%;
}
}
}
</style>
\ No newline at end of file
......@@ -4,23 +4,23 @@
<div class="sprite-icon icon-equity-card card">
<div class="card-name">
<div class="sprite-icon icon-vip"></div>
无忧权益尊享版
{{userInfo.memberName}}
</div>
<div class="card-user">
<img
:src="userInfo.icon"
v-if="userInfo.icon"
:src="userInfo.logo"
v-if="userInfo.logo"
>
<div
v-else
class="sprite-icon icon-default-avatar"
></div>
<div class="card-user-info">
<div class="card-user-info-name text-hide">恒河猴</div>
<div class="card-user-info-time">到期:2021-10-10</div>
<div class="card-user-info-name text-hide">{{userInfo.nickName}}</div>
<div class="card-user-info-time">到期:{{userInfo.time}}</div>
</div>
</div>
<div class="card-No">NO:123456789</div>
<div class="card-No">NO:{{userInfo.cardNo}}</div>
</div>
</div>
<div class="content">
......@@ -30,6 +30,7 @@
:left-icon="icon"
@replay="updataNotice"
speed="30"
@click="jumpLink({id:54})"
>
{{notice}}
</van-notice-bar>
......@@ -82,7 +83,10 @@
<div class="box">
<div class="title">
酒店旅游特权
<div class="more">更多<div class="sprite-icon icon-more"></div>
<div
class="more"
@click="jumpHotel"
>更多<div class="sprite-icon icon-more"></div>
</div>
</div>
<div class="items">
......@@ -90,6 +94,7 @@
<div
class="item"
:key="index"
@click="jumpHotel"
>
<div :class="['sprite-icon',`icon-${i.icon}`]"></div>
<div class="item-name">{{i.name}}</div>
......@@ -116,19 +121,31 @@ export default {
},
mixins: [indexMixin],
mounted () {
this.showLoading()
equity.getCardInfo().then(res => {
console.log(res)
this.hideLoading()
if (res) {
res.time = new Date(res.validitDate).format('yyyy-MM-dd')
this.userInfo = res
}
})
},
methods: {
jumpHotel () {
let url = 'http://m.s11.cn/tehui/sz/?order_cust_id=4892038'
this.openWindows(url)
}
}
}
</script>
<style lang='scss'>
@import "@a/scss/index.scss";
html,
body {
background-color: rgb(242, 242, 242);
background-color: rgb(247, 247, 247);
}
.main {
.card-box {
......@@ -152,6 +169,12 @@ body {
display: grid;
grid-template-columns: 50px calc(100% - 84px);
gap: 0 10px;
img {
border-radius: 100%;
overflow: hidden;
width: 50px;
height: 50px;
}
&-info {
&-name {
margin-bottom: 10px;
......@@ -166,94 +189,5 @@ body {
}
}
}
.content {
.van-notice-bar {
margin: 0 20px 16px;
padding: 0 5px;
border-radius: 8px;
}
.box {
margin-bottom: 20px;
padding-bottom: 20px;
background-color: #fff;
.title {
font-size: 18px;
color: #2c2c2c;
display: flex;
justify-content: space-between;
font-weight: 700;
padding: 10px 20px;
margin-bottom: 14px;
.more {
font-weight: normal;
font-size: 14px;
display: flex;
align-items: center;
.icon-more {
margin-left: 7px;
}
}
}
.items {
display: grid;
grid-template-columns: repeat(4, 1fr);
.item {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
color: #999999;
.sprite-icon {
margin-bottom: 4px;
}
&-name {
font-size: 14px;
color: #2c2c2c;
}
}
}
.scroll-items {
overflow-x: scroll;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
padding: 0 20px;
display: flex;
.item {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
color: #999999;
.sprite-icon {
margin-bottom: 4px;
margin-right: 10px;
}
&-name {
font-size: 14px;
color: #2c2c2c;
}
&-name,
&-description {
transform: translateX(-5px);
}
}
.item:last-of-type {
.sprite-icon {
margin-right: 20px;
}
.item-name,
.item-description {
transform: translateX(-10px);
}
}
&::-webkit-scrollbar {
display: none;
height: 0;
opacity: 0;
width: 0;
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -59,7 +59,7 @@ module.exports = {
},
// 每个图片间距
spritesmithOptions: {
padding: 5
padding: 20
}
})
]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!