Commit 9cf2c04b by ym

接口替换

1 parent 10082e79
Showing 227 changed files with 10841 additions and 0 deletions
> 1%
last 2 versions
not dead
# 所有环境默认
# 网络请求公用地址(正式环境)
#正式环境
#VUE_APP_API=https://scrm.glsx.com.cn/rop-scrm-equity/router
#VUE_APP_KEY=036cc0e0fe316483238287e5721df4c3
#VUE_APP_SECRET=c7290f606d6b4e9aaf6da3ad6310e883fe316483238287e5
#嘀加智享车生活公众号
#VUE_APP_WECHAT_ACCOUNT=https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg3NTU4MTcxNg==#wechat_redirect
#测试环境
#VUE_APP_API=https://qcwx.glsx.com.cn/rop-ddh-carlife/router
VUE_APP_API=http://scrm.test.glsx.com.cn/rop-scrm-equity/router
VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637
VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
#深圳广联公众号
VUE_APP_WECHAT_ACCOUNT=https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MjM5NzY4MTIzNw==#wechat_redirect
# 所有环境默认
# 页面 title 前缀
VUE_APP_TITLE=广联运营平台
# 网络请求公用地址
#VUE_APP_API=https://wx.glsx.com.cn/rop-ddh-carlife/router
VUE_APP_API=http://scrm.test.glsx.com.cn/rop-scrm-equity/router
#VUE_APP_API=http://192.168.2.60:7226/rop-scrm-equity/router
#VUE_APP_API=http://scrm.test.glsx.com.cn/rop-scrm-equity/router
#VUE_APP_API=http://qcwx.glsx.com.cn/rop-ddh-carlife/router
#VUE_APP_API=http://192.168.2.60:8086/rop-ddh-carlife/router
VUE_APP_KEY=48e5e13229b82c1b4e6e8c96151f0637
VUE_APP_SECRET=c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b
module.exports = {
root: true,
env: {
node: true
},
globals: { wx: true },
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
},
}
\ No newline at end of file \ No newline at end of file
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
\ No newline at end of file \ No newline at end of file
# wechat
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run dev
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This diff could not be displayed because it is too large.
{
"name": "wechat",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.0",
"core-js": "^3.6.5",
"sha1": "^1.1.1",
"vant": "^2.10.11",
"vconsole": "^3.4.0",
"vue": "^2.6.12",
"vue-photo-preview": "^1.1.3",
"vue-router": "^3.2.0",
"vue-wechat-title": "^2.0.7",
"vuex": "^3.6.2",
"webpack-spritesmith": "^1.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0",
"@vue/cli-plugin-router": "^4.5.0",
"@vue/cli-plugin-vuex": "^4.5.0",
"@vue/cli-service": "^4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.12.0",
"postcss-px-to-viewport": "^1.1.1",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
}
}
const path = require('path');
module.exports = ({ file }) => {
return {
plugins: {
autoprefixer: {},
"postcss-px-to-viewport": {
unitToConvert: "px",
viewportWidth: 375,
unitPrecision: 6,
propList: ["*"],
viewportUnit: "vw",
fontViewportUnit: "vw",
selectorBlackList: [],
minPixelValue: 1,
mediaQuery: true,
exclude: [],
landscape: false
}
}
}
}
\ No newline at end of file \ No newline at end of file
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script>
<title>权益中心</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<style>
html,
body {
margin: 0;
padding: 0;
}
#app {
color: #333333;
}
</style>
<template>
<div id="app">
<template v-if="$route.meta.showNavBar && !isMiniprogram">
<div class="nav-bar">
<van-nav-bar
safe-area-inset-top
:title="$route.meta.title"
left-arrow
@click-left="onClickLeft"
/>
</div>
</template>
<transition name="fade">
<keep-alive>
<router-view
v-if="$route.meta.keepAlive"
v-wechat-title="$route.meta.title"
/>
</keep-alive>
</transition>
<transition name="fade">
<router-view
v-wechat-title="$route.meta.title"
v-if="!$route.meta.keepAlive"
/>
</transition>
</div>
</template>
<script>
// import VConsole from 'vconsole'
export default {
data() {
return {};
},
components: {},
created() {},
mounted() {
// window.vConsole = new VConsole()
//解决ios下history.back后不刷新
var isPageHide = false;
window.addEventListener("pageshow", function() {
if (isPageHide) {
window.location.reload();
}
});
window.addEventListener("pagehide", function() {
isPageHide = true;
});
},
methods: {},
};
</script>
<style scoped>
#app {
font-size: 14px;
}
</style>
const RequestMethods = {
POST: 'post',
GET: 'get',
PUT: 'put',
DELETE: 'delete'
}
export default RequestMethods
\ No newline at end of file \ No newline at end of file
import { request } from './request'
export const equity = {
/**365淘卷请求地址 */
getCouponList(data) {
return request(data, 'scrm.api.equity.h5.365.coupon.url.get')
},
/** 获取会员权益卡 */
getCardInfo() {
return request({}, 'scrm.api.equity.info')
},
/** 根据卡号激活权益卡 */
activateByCardNo(data) {
return request(data, 'scrm.api.equity.open.card.by.cardno')
},
/** 根据SN激活权益卡 */
activateBySn(data) {
return request(data, 'scrm.api.equity.open.card.by.sn')
},
//权益订单
getOrderUrl(data) {
return request(data, 'scrm.api.equity.h5.365.order.url.get')
},
getFissionInfo(data) {
return request(data, 'scrm.api.equity.h5.get.fission.info')
},
/** 是否开通权益 */
openCardFission(data) {
return request(data, 'scrm.api.equity.h5.open.card.by.fission.user')
},
getOrderCount(data) {
return request(data, 'scrm.api.equity.h5.get.hw.order.count')
},
/** 是否开通权益 */
getMerchantid(data) {
return request(data, 'scrm.api.equity.pakage.by.merchantid')
},
/** 获取Edj地址 */
getEdjUrl(data) {
return request(data, 'scrm.api.equity.edj.url')
},
}
export const common = {
getSessionId(data) {
return request(data, 'scrm.api.user.login.by.wechat', 'GET')
},
getAppSessionId(data) {
return request(data, 'scrm.api.user.app.auth', 'GET')
},
/** 获取验证码 */
getSms(data) {
return request(data, 'scrm.api.user.captcha.get')
},
/** 验证码登陆 */
smsLogin(data) {
return request(data, 'scrm.api.user.sms.login')
},
/**获取微信config */
getWxConfig(data) {
return request(data, 'scrm.api.equity.common.wechat.jsconfig', 'get')
},
/**上传图片 */
uploadImage(data) {
return request(data, 'scrm.api.equity.common.upload.image', 'post', ['file'])
}
}
export const device = {
/**VIN OCR扫描 */
scanVin(data) {
return request(data, 'scrm.api.common.ocr.vin.scan')
},
/**上传记录 */
getInstallationList(data) {
return request(data, 'scrm.api.equity.movecar.installation.list')
},
/** 安装师傅绑定新增 */
installation(data) {
return request(data, 'scrm.api.equity.movecar.installation.insert')
},
/** 验证安装绑定 */
checkInstallation(data) {
return request(data, 'scrm.api.equity.movecar.installation.validate')
},
}
export const car = {
/**行驶证OCR扫描 */
scanVehicle(data) {
return request(data, 'scrm.api.common.ocr.vehicle.license')
},
/** 验证车架号 */
checkVin(data) {
return request(data, 'scrm.api.equity.movecar.vin.validate')
},
/** 验证挪车码 */
checkCode(data) {
return request(data, 'scrm.api.equity.movecar.code.validate')
},
/** 挪车信息新增 */
bindCarCode(data) {
return request(data, 'scrm.api.equity.movecar.info.insert')
},
}
export const cardRoll = {
/**获取我的卡券 */
getCardList(data) {
return request(data, 'scrm.api.equity.h5.order.list.get')
},
/**订单详情 */
getCardDetail(data) {
return request(data, 'scrm.api.equity.h5.order.detail.get')
},
/**创建售后 */
getCardRefund(data) {
return request(data, 'scrm.api.equity.order.refund.detail.create')
},
/**获取售后详情 */
getCardRefundDetail(data) {
return request(data, 'scrm.api.equity.h5.order.refund.detail.get')
},
/**获取权益卡详情 */
getCardMerchantid(data) {
return request(data, 'scrm.api.equity.open.card.price.get.by.merchantid')
},
/**购买权益卡 */
getCardBuy(data) {
return request(data, 'scrm.api.equity.open.card.to.buy')
},
/**确认收货 */
getCardConfirm(data) {
return request(data, 'scrm.api.equity.h5.order.finish.confirm')
},
}
export const oilStation = {
/**获取油号 */
getOilNoList(data) {
return request(data, 'scrm.api.equity.oil.oilNoList')
},
/**获取加油站列表 */
getStationList(data) {
return request(data, 'scrm.api.equity.oil.list')
},
/**获取加油站详情 */
getStationDetail(data) {
return request(data, 'scrm.api.equity.oil.detail')
},
/**获取全部订单列表 */
getStationOrderList(data) {
return request(data, 'scrm.api.equity.oil.orderList')
},
/**分页获取订单列表 */
getStationOrderPage(data) {
return request(data, 'scrm.api.equity.oil.orderPage')
},
/**获取支付url地址 */
getStationPayUrl(data) {
return request(data, 'scrm.api.equity.oil.payUrl')
},
getStationAppPayUrl(data) {
return request(data, 'scrm.api.equity.oil.appPayUrl')
},
/**获取搜索记录 */
getStationSearchList(data) {
return request(data, 'scrm.api.equity.oil.search.list')
},
/**新增搜索记录 */
getStationSearchInsert(data) {
return request(data, 'scrm.api.equity.oil.search.insert')
},
/**删除搜索记录 */
getStationSearchDelete(data) {
return request(data, 'scrm.api.equity.oil.search.delete')
},
/**清空搜索记录 */
getStationSearchDeleteAll(data) {
return request(data, 'scrm.api.equity.oil.search.deleteAll')
},
}
export const commodity = {
/**获取商品数据 */
getCouponDetail(data) {
return request(data, 'scrm.api.equity.coupon.detail')
},
/**获取商品数据 */
getChargeDetail(data) {
return request(data, 'scrm.api.equity.charge.detail')
},
/**获取订单编号 */
getOrderCode(data) {
return request(data, 'scrm.api.equity.ordercode.get')
},
/**支付订单 */
payOrder(data) {
return request(data, 'scrm.api.equity.create.order')
}
}
import axios from 'axios'
import Qs from 'qs'
import {
Toast,
Notify,
Dialog
} from 'vant'
import store from '@/store'
axios.defaults.withCredentials = true
const service = axios.create({
baseURL: process.env.VUE_APP_API,
timeout: 60 * 1000, // 请求超时时间
transformRequest: [function(data) {
return Qs.stringify(data)
}],
})
service.interceptors.request.use(
config => {
return config
}
)
service.interceptors.response.use(
response => {
Toast.clear()
const dataAxios = response.data
// 这个状态码是和后端约定的
const { code } = dataAxios
// 有 code 代表这是一个后端接口 可以进行进一步的判断
if (code == -1) {
// Notify({ type: 'danger', message })
return dataAxios
}
switch (+code) {
case 0:
return dataAxios
case 20:
case 21:
Dialog.alert({
title: '温馨提示',
message: '登录过期,请重新登录。',
confirmButtonColor: '#008fff'
}).then(() => {
if (window.__wxjs_environment === 'miniprogram') {
wx.miniProgram.navigateTo({
url: `/pages/relogin/relogin?sessionId=${store.state.sessionId}`
})
} else {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.replace({ name: 'common.phoneLogin' })
} else{
let equipmentType = ""
let agent = navigator.userAgent.toLowerCase()
let android = agent.indexOf("android")
let iphone = agent.indexOf("iphone")
let ipad = agent.indexOf("ipad")
if (android != -1) {
equipmentType = "android"
}
if (iphone != -1 || ipad != -1) {
equipmentType = "ios"
}
if (equipmentType == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 0 }))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 0 }))
}
}
}
})
break
default:
break
}
},
error => {
Toast.clear()
Notify({ type: 'danger', message: '系统异常' })
console.log(error)
return Promise.reject(error)
})
export default service
\ No newline at end of file \ No newline at end of file
import axios from './axios'
import sign from './sign'
import RequestMethods from './RequestMethods'
import store from '@/store'
const request = (params = {}, url, method = RequestMethods.POST, noSignAttr = []) => {
params.method = url.trimStart().trimEnd()
// params.source = 'h5'
params.source = 1
params.appKey = process.env.VUE_APP_KEY
params.timestamp = new Date().getTime()
// params.timestamp = new Date().format('yyyy-MM-dd hh:mm:ss')
params.v = '1.0.0'
params.format = 'json'
params.locale = 'zh_CN'
let { sessionId } = sessionStorage.getItem('GL_EQUITY_USER_INFO')?JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO')):store.state
if (sessionId) params.sessionId = sessionId
if (method == 'post') {
return axios({
method,
data: sign(params, noSignAttr)
})
} else {
return axios({
method,
params: sign(params, noSignAttr)
})
}
}
export { request }
\ No newline at end of file \ No newline at end of file
import sha1 from 'sha1'
import qs from 'qs'
const secret = process.env.VUE_APP_SECRET
const sign = (params, noSignAttr = []) => {
delete params.sign
var objStr = qs.stringify(params, { arrayFormat: 'indices', encode: false, allowDots: true })
var objVal = objStr.split('&')
var realObj = {}
objVal.forEach(item => {
if (item.split('=')[0] == 'scene') {
realObj.scene = params.scene
} else {
realObj[item.split('=')[0]] = item.split('=')[1]
}
})
const keys = Object.keys(realObj).sort()
var str = []
var obj = null
for (const key in realObj) {
obj = realObj[key]
if (obj === null) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
realObj[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
realObj.sign = sha1(secret + str.join('') + secret).toUpperCase()
return realObj
}
export default sign
\ No newline at end of file \ No newline at end of file
@import './sprite';
* {
margin: 0;
padding: 0;
}
img {
width: 100%;
height: 100%;
vertical-align: top;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-hide-2 {
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
.btn-disabled {
background: #ccc !important;
}
.x-center {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.y-center {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.fixed-btn {
position: fixed !important;
bottom: 20px;
}
.btn-on-leave {
position: relative;
overflow: hidden;
&::after {
position: absolute;
top: 0;
left: 0;
content: '';
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: .1);
display: block;
}
}
// 路由淡入淡出
.fade-enter-active,
.fade-leave-active {
transition-property: opacity;
transition-duration: .3s;
}
.fade-enter-active {
transition-delay: .3s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
.disabled {
background-color: #999 !important;
}
.line-through {
text-decoration:line-through;
}
.refresh-animation {
animation: rotate 4s;
-webkit-animation: rotate 1s;
}
@keyframes rotate {
0%{
transform:rotate(0deg);
-ms-transform:rotate(0deg); /* IE 9 */
-moz-transform:rotate(0deg); /* Firefox */
-o-transform:rotate(0deg);
}
100% {
transform:rotate(360deg);
-ms-transform:rotate(360deg); /* IE 9 */
-moz-transform:rotate(360deg); /* Firefox */
-o-transform:rotate(360deg);
}
}
@-webkit-keyframes rotate {
0%{
-moz-transform:rotate(0deg);
}
100%{
-moz-transform:rotate(360deg);
}
}
\ No newline at end of file \ No newline at end of file
.content {
.van-notice-bar {
margin: 0 20px 16px;
padding: 0 5px;
border-radius: 8px;
}
.box {
margin-bottom: 20px;
padding-bottom: 20px;
background-color: #fff;
.bar_title{
display: flex;
align-items: center;
margin-bottom: 10px;
&>span{
color: #F2C446;
border: 1px solid #F2C446;
border-radius: 10px;
border-radius: 10px;
padding: 0px 12px;
margin-left: 10px;
}
&:after{
content: '';
flex: 1;
height: 1px;
background-color: #F2C446;
}
}
.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);
&.items_5_1 {
grid-template-columns: repeat(5, 1fr);
.item{
margin-bottom: 10px;
}
.item-des{
font-size: 10px;
color: #B2B2B2;
}
}
.item {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
color: #999999;
.sprite-icon {
margin-bottom: 4px;
}
&-name {
font-size: 12px;
width: 60px;
text-align: center;
color: #2c2c2c;
}
&-des {
text-align: center;
width: 60px;
}
}
}
.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%);
}
}
}
}
.tab_list{
white-space: nowrap;
padding-right: 12px;
&>li{
display: inline-block;
font-size: 16px;
margin: 5px 10px;
padding: 2px 0;
&:first-child{
margin-left: 0;
}
&:last-child{
margin-right: 0;
}
&.active{
border-bottom: 2px solid #008FFF;
}
}
}
}
}
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 903px 880px;}
.icon-400 { width: 59px; height: 16px; background-position: -731px -636px;}
.icon-10000 { width: 80px; height: 16px; background-position: -346px -186px;}
.icon-1yaowang { width: 46px; height: 46px; background-position: -857px -448px;}
.icon-aiqiyi { width: 46px; height: 46px; background-position: -392px -666px;}
.icon-banner { width: 375px; height: 176px; background-position: -346px 0px;}
.icon-bgy { width: 46px; height: 46px; background-position: -801px -168px;}
.icon-bilibili { width: 46px; height: 46px; background-position: -672px -778px;}
.icon-boanfei { width: 46px; height: 46px; background-position: -857px -392px;}
.icon-btn { width: 362px; height: 63px; background-position: -185px -480px;}
.icon-buggerking { width: 46px; height: 46px; background-position: -857px -672px;}
.icon-call_drive { width: 46px; height: 46px; background-position: 0px -666px;}
.icon-caocao { width: 46px; height: 46px; background-position: -224px -666px;}
.icon-car_charge { width: 46px; height: 46px; background-position: -336px -666px;}
.icon-car-add { width: 175px; height: 176px; background-position: 0px -480px;}
.icon-car-bind { width: 50px; height: 50px; background-position: -731px -464px;}
.icon-car-camera { width: 20px; height: 20px; background-position: -692px -282px;}
.icon-car-edit { width: 20px; height: 20px; background-position: -680px -336px;}
.icon-car-err { width: 11px; height: 11px; background-position: -801px -756px;}
.icon-car-photo-0 { width: 73px; height: 51px; background-position: -615px -553px;}
.icon-car-photo-1 { width: 73px; height: 51px; background-position: -532px -553px;}
.icon-car-photo-2 { width: 73px; height: 51px; background-position: -449px -553px;}
.icon-car-photo-3 { width: 73px; height: 51px; background-position: -366px -553px;}
.icon-car-success { width: 11px; height: 11px; background-position: -834px -728px;}
.icon-car-tips { width: 171px; height: 91px; background-position: -185px -553px;}
.icon-card { width: 23px; height: 18px; background-position: -801px -728px;}
.icon-chabaidao { width: 46px; height: 46px; background-position: -662px -226px;}
.icon-chayan { width: 46px; height: 46px; background-position: -667px -480px;}
.icon-city { width: 60px; height: 60px; background-position: -731px -70px;}
.icon-coco { width: 46px; height: 46px; background-position: -56px -666px;}
.icon-costa { width: 46px; height: 46px; background-position: -112px -666px;}
.icon-dedao { width: 46px; height: 46px; background-position: -168px -666px;}
.icon-default-avatar { width: 50px; height: 50px; background-position: -731px -404px;}
.icon-device-add { width: 40px; height: 40px; background-position: -857px -784px;}
.icon-device-bg { width: 375px; height: 80px; background-position: 0px -390px;}
.icon-device-bind { width: 54px; height: 54px; background-position: -731px -280px;}
.icon-device-scan { width: 20px; height: 20px; background-position: -385px -438px;}
.icon-device-sn { width: 20px; height: 16px; background-position: -436px -186px;}
.icon-device-vin { width: 20px; height: 16px; background-position: -466px -186px;}
.icon-didi { width: 46px; height: 46px; background-position: -616px -666px;}
.icon-dingdang { width: 46px; height: 46px; background-position: -672px -666px;}
.icon-edaijia { width: 46px; height: 46px; background-position: -728px -666px;}
.icon-equity-bg { width: 322px; height: 100px; background-position: -330px -226px;}
.icon-equity-card { width: 336px; height: 216px; background-position: 0px 0px;}
.icon-equity-phone { width: 20px; height: 20px; background-position: -662px -282px;}
.icon-equity-type1 { width: 50px; height: 50px; background-position: -731px -344px;}
.icon-fit { width: 46px; height: 46px; background-position: -224px -722px;}
.icon-gaode { width: 46px; height: 46px; background-position: -280px -722px;}
.icon-gas { width: 60px; height: 60px; background-position: -731px -140px;}
.icon-halou { width: 46px; height: 46px; background-position: -392px -722px;}
.icon-hechang { width: 46px; height: 46px; background-position: -448px -722px;}
.icon-hls { width: 46px; height: 46px; background-position: -504px -722px;}
.icon-jiuyuan { width: 46px; height: 46px; background-position: -560px -722px;}
.icon-kaishu { width: 46px; height: 46px; background-position: -616px -722px;}
.icon-keep { width: 46px; height: 46px; background-position: -672px -722px;}
.icon-kfc { width: 46px; height: 46px; background-position: -728px -722px;}
.icon-kugou { width: 46px; height: 46px; background-position: -801px 0px;}
.icon-lagoujiaoyu { width: 46px; height: 46px; background-position: -731px -524px;}
.icon-lppz { width: 46px; height: 46px; background-position: -801px -112px;}
.icon-m { width: 100px; height: 60px; background-position: -557px -480px;}
.icon-maoyan { width: 46px; height: 46px; background-position: -801px -224px;}
.icon-mcd { width: 46px; height: 46px; background-position: -801px -280px;}
.icon-meiriyujia { width: 46px; height: 46px; background-position: -801px -336px;}
.icon-meituanbike { width: 46px; height: 46px; background-position: -801px -392px;}
.icon-mgtv { width: 46px; height: 46px; background-position: -801px -448px;}
.icon-mingyikanya { width: 46px; height: 46px; background-position: -801px -504px;}
.icon-more { width: 20px; height: 20px; background-position: -682px -390px;}
.icon-mt_car_price { width: 46px; height: 46px; background-position: -801px -616px;}
.icon-mt_customer { width: 46px; height: 46px; background-position: -801px -672px;}
.icon-mt_drive { width: 46px; height: 46px; background-position: 0px -778px;}
.icon-mt_food { width: 46px; height: 46px; background-position: -56px -778px;}
.icon-mt_gas { width: 46px; height: 46px; background-position: -112px -778px;}
.icon-mt_help { width: 46px; height: 46px; background-position: -168px -778px;}
.icon-mt_hope { width: 46px; height: 46px; background-position: -224px -778px;}
.icon-mt_intel_car { width: 46px; height: 46px; background-position: -280px -778px;}
.icon-mt_more { width: 46px; height: 46px; background-position: -336px -778px;}
.icon-mt_shop_service { width: 46px; height: 46px; background-position: -392px -778px;}
.icon-mt_video { width: 46px; height: 46px; background-position: -448px -778px;}
.icon-naixue { width: 46px; height: 46px; background-position: -504px -778px;}
.icon-pacific { width: 46px; height: 46px; background-position: -560px -778px;}
.icon-panzinvren { width: 46px; height: 46px; background-position: -616px -778px;}
.icon-partner { width: 320px; height: 154px; background-position: 0px -226px;}
.icon-pizzahut { width: 46px; height: 46px; background-position: -728px -778px;}
.icon-qingju { width: 46px; height: 46px; background-position: -784px -778px;}
.icon-qqmusic { width: 46px; height: 46px; background-position: -857px 0px;}
.icon-qqread { width: 46px; height: 46px; background-position: -857px -56px;}
.icon-ruixing { width: 46px; height: 46px; background-position: -857px -112px;}
.icon-scan { width: 18px; height: 18px; background-position: -445px -438px;}
.icon-sf { width: 46px; height: 46px; background-position: -857px -224px;}
.icon-shanzhen { width: 46px; height: 46px; background-position: -857px -280px;}
.icon-shuyi { width: 46px; height: 46px; background-position: -857px -336px;}
.icon-slogan1 { width: 340px; height: 38px; background-position: -330px -336px;}
.icon-slogan2 { width: 287px; height: 38px; background-position: -385px -390px;}
.icon-szss { width: 46px; height: 46px; background-position: -857px -504px;}
.icon-tencenttv { width: 46px; height: 46px; background-position: -857px -560px;}
.icon-tickets { width: 60px; height: 60px; background-position: -731px -210px;}
.icon-today { width: 60px; height: 60px; background-position: -731px 0px;}
.icon-tuanyou { width: 46px; height: 46px; background-position: -857px -728px;}
.icon-vip { width: 20px; height: 18px; background-position: -415px -438px;}
.icon-wanda { width: 46px; height: 46px; background-position: 0px -834px;}
.icon-wangyiyun { width: 46px; height: 46px; background-position: -857px -168px;}
.icon-wechatread { width: 46px; height: 46px; background-position: -801px -560px;}
.icon-woniu { width: 46px; height: 46px; background-position: -801px -56px;}
.icon-xiaoyuan { width: 46px; height: 46px; background-position: -112px -722px;}
.icon-xicha { width: 46px; height: 46px; background-position: -560px -666px;}
.icon-xingbake { width: 46px; height: 46px; background-position: -504px -666px;}
.icon-xueersi { width: 46px; height: 46px; background-position: -448px -666px;}
.icon-youku { width: 46px; height: 46px; background-position: -280px -666px;}
.icon-zgf { width: 46px; height: 46px; background-position: -731px -580px;}
.icon-zhangmen { width: 46px; height: 46px; background-position: -857px -616px;}
.icon-zhihu { width: 46px; height: 46px; background-position: -336px -722px;}
.icon-zhy { width: 46px; height: 46px; background-position: -168px -722px;}
.icon-zuoyebang { width: 46px; height: 46px; background-position: -56px -722px;}
.icon-zuzuche { width: 46px; height: 46px; background-position: 0px -722px;}
\ No newline at end of file \ No newline at end of file
<template>
<div class="device-tabbar">
<template v-for="(i,index) in tabbar">
<div
:key="index"
:class="{'active':tabIndex == index}"
@click="jump(index)"
@touchstart="touchstart"
@touchend="touchend"
>
{{i}}
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'DeviceTabBar',
data () {
return {
tabbar: ['上传信息', '上传记录']
}
},
props: {
tabIndex: {
type: Number,
default: 0
},
routeName: {
type: String
}
},
mounted () {
},
methods: {
jump (index) {
let { routeName, tabIndex } = this
if (index == tabIndex) return
this.$router.replace({ name: routeName })
}
}
}
</script>
<style lang='scss'>
.device-tabbar {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 44px;
background: #ffffff;
display: flex;
z-index: 2;
> div {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #999999;
}
.active {
background: #4fa3ff;
color: #fff;
}
&::before {
position: absolute;
top: -0.3px;
left: 0;
width: 100%;
height: 0.3px;
background-color: #c8c8c8;
content: "";
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="input-group">
<template v-for="(i,index) in length">
<div
:key="index"
:class="['input',{'active':values[index]},{'error':error}]"
>
<input
v-model="values[index]"
type="number"
maxlength="1"
@input="input(index,$event)"
:ref="`focus-${index}`"
@keydown="keydown(index,$event)"
>
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'InputGroup',
data () {
return {
values: [],
flag: false,
focusList: []
}
},
props: {
length: {
type: Number,
default: 6
},
value: {
type: String,
default: ''
},
error: {
type: Boolean,
default: false
},
pattern: {
type: RegExp
}
},
watch: {
'values' (newVal) {
this.$emit('input', newVal.join(''))
},
},
mounted () {
let { value, length } = this
if (value) {
value = value.substring(0, length)
this.values = value.split('')
} else {
this.values = new Array(6).fill('')
this.focusList = new Array(6).fill(false)
}
},
methods: {
keydown (index, $event) {
let { keyCode } = $event
if (keyCode == 8) {
setTimeout(() => {
if (index > 0) this.$refs[`focus-${index - 1}`][0].focus()
}, 100)
}
},
input (index) {
let { length, pattern } = this
this.values[index] = pattern.test(this.values[index]) ? this.values[index].substring(0, 1) : ''
if (index < length - 1 && this.values[index]) this.$refs[`focus-${index + 1}`][0].focus()
}
}
}
</script>
<style scoped lang='scss'>
.input-group {
display: flex;
.input {
width: 36px;
height: 36px;
background: #ffffff;
border: 1px solid #dbdbdb;
padding: 0 12px;
box-sizing: border-box;
margin-right: 24px;
input {
width: 100%;
height: 100%;
border: none;
}
&:last-of-type {
margin-right: 0;
}
}
.active {
border-color: #008fff;
}
.error {
border-color: #fa5151;
}
}
</style>
\ No newline at end of file \ No newline at end of file
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import '@u/util'
import Vant from 'vant'
import 'vant/lib/index.css'
import VueWechatTitle from 'vue-wechat-title'
import '@a/scss/common.scss'
import store from "./store"
Vue.use(VueWechatTitle)
Vue.use(Vant)
import VConsole from 'vconsole'
const vConsole = new VConsole()
Vue.use(vConsole)
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.use(preview)
Vue.config.productionTip = false
Vue.prototype.isMiniprogram = window.__wxjs_environment === 'miniprogram'
window.vm = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
import indexMixin from './indexMixin'
import pay from './pay'
export {
indexMixin,
pay
}
\ No newline at end of file \ No newline at end of file
import { equity } from '@r/api.js'
import shopList from './list'
export default {
data() {
return {
ServiceList: {},
goodsServiceList: {},
carServiceList: [],
equityGoodsGroupDescDtos: [],
goodsTab: 0,
merchantId: sessionStorage.getItem('GL_WX_MERCHANTID'),
notice: '',
phone_range: ['134', '135', '136', '137', '138', '139', '147', '150', '151', '152', '157', '158', '159', '182', '183', '184', '187', '188', '130', '131', '132', '145', '155', '156', '185', '186', '133', '153', '180', '181', '189', '170', '176', '177', '178'],
travelList: [{
name: '优惠加油',
icon: 'tuanyou',
description: '7折起',
id: 54
},
{
name: '道路救援',
icon: 'jiuyuan',
description: '非事故免费',
route: 'road'
},
],
hotelList: [{
name: '今日特惠',
icon: 'today',
description: '超性价比'
},
{
name: '景区门票',
icon: 'tickets',
description: '全国3000+景点'
}
],
cateringList2: [{
name: '肯德基',
icon: 'kfc',
description: '最高省81元',
typeId: 23
},
{
name: '麦当劳',
icon: 'm',
description: '最高省44元',
typeId: 64
},
{
name: '星巴克',
icon: 'xbk',
description: '最高省17元',
typeId: 21
},
{
name: '瑞幸咖啡',
icon: 'ruixing',
description: '最高省10元',
typeId: 148
}
],
gasList: [{
name: '覆盖城市',
icon: 'city',
subIcon: '400'
},
{
name: '加油站',
icon: 'gas',
subIcon: '10000'
}
],
...shopList
}
},
mounted() {
this.setNoticeInfo();
this.getMerchantid();
if (this.isMiniprogram) wx.miniProgram.postMessage({})
},
methods: {
setNoticeInfo() {
let { phone_range } = this
let start = this.setRandom(0, phone_range.length, 'floor')
let end = `${this.setRandom(0, 9, 'floor')}${this.setRandom(0, 9, 'floor')}${this.setRandom(0, 9, 'floor')}${this.setRandom(0, 9, 'floor')}`
let phone = `${phone_range[start]}***${end}`
let price = this.setRandom(25.99, 45.99).toFixed(2)
this.notice = `距离您当前位置的油站有优惠,点击加油,用户${phone}刚通过加油优惠${price}元。`
},
setRandom(start, end, type) {
if (type == 'floor') {
return Math.floor(Math.random() * (end - start)) + start
}
return Math.random() * (end - start) + start
},
updataNotice() {
this.setNoticeInfo()
},
CarLink(e) {
let {sessionId} = this.$store.state;
let [href] = window.location.href.split('/#/');
let url;
let supplier = e.supplier;
sessionStorage.setItem('common',this.icon?1:0)
switch(supplier) {
case 'GL_OIL':
url = `${href}/#/oilStation/index?sessionId=${sessionId}`
this.openWindows(url, 'oilStation.index')
break;
case 'GL_ROAD_RESCUE':
url = `${href}/#/equity/road`
this.openWindows(url, 'equity.road')
break;
case 'GL_TIRE_PROTECTION':
url = `${href}/#/equity/tyre`
this.openWindows(url, 'equity.tyre')
break;
case 'GL_ROBBERY_PROTECTION':
url = `${href}/#/equity/compensate`
this.openWindows(url, 'equity.compensate')
break;
case 'GL_COLLISION_REPAIR':
url = `${href}/#/equity/collision`
this.openWindows(url, 'equity.collision')
break;
case 'GL_CAR_TOTAL_LOSS':
url = `${href}/#/equity/loss`
this.openWindows(url, 'equity.loss')
break;
case 'EDJ':
this.jumpDEJ();
break;
default:
this.showToast('即将上线,敬请期待')
}
},
jumpDEJ() {
let {sessionId} = this.$store.state;
let para = {
sessionId
}
equity.getEdjUrl(para).then(res => {
let {code, data, message} = res
if (code == 0){
this.openWindows(data)
} else {
this.showToast(message)
}
})
},
jumpLink(e) {
let { sessionId } = this.$store.state;
this.$store.commit('setGoodsInfo',e);
let {brandId,supplier,brandName} = e;
if(e.appearance == 1) {
let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/business?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`;
this.openWindows(url, 'commodity.business')
}else {
let [href] = window.location.href.split('/#/');
let url = `${href}/#/commodity/recharge?sessionId=${sessionId}&brandId=${brandId}&supplier=${supplier}&brandName=${brandName}`;
this.openWindows(url, 'commodity.recharge')
}
},
getMerchantid() {
this.carServiceList = []
let para = {
merchantId: this.merchantId
}
equity.getMerchantid(para).then(res => {
let {code, data, message} = res
if (code == 0){
this.carServiceList = data.carServiceList
this.goodsServiceList = data.goodsServiceList;
this.equityGoodsGroupDescDtos = this.goodsServiceList[0].equityGoodsGroupDescDtos;
} else {
this.showToast(message)
}
})
},
changeGoods(item) {
this.goodsTab = item;
this.equityGoodsGroupDescDtos = this.goodsServiceList[item].equityGoodsGroupDescDtos;
},
jumpMore() {
equity.getCouponList({
requestSource: this.getChannel() //1.小程序,2.APP,3.公众号
}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.openWindows(data)
} else {
this.showToast(message)
}
})
}
},
}
const data = {
cateringList: [{
name: '肯德基',
icon: 'kfc',
description: '4.8折起',
typeId: 23
},
{
name: '麦当劳',
icon: 'mcd',
description: '4.8折起',
typeId: 64
},
{
name: '必胜客',
icon: 'pizzahut',
description: '8.5折起',
typeId: 22
},
{
name: '汉堡王',
icon: 'buggerking',
description: '4折起',
typeId: 24
},
{
name: '华莱士',
icon: 'hls',
description: '4.5折起',
typeId: 362
},
{
name: '真功夫',
icon: 'zgf',
description: '2折起',
typeId: 149
},
{
name: '三只松鼠',
icon: 'szss',
description: '5.3折起',
typeId: 191
},
{
name: '百果园',
icon: 'bgy',
description: '7.9折起',
typeId: 30
},
{
name: '良品铺子',
icon: 'lppz',
description: '9.6折起',
typeId: 158
},
{
name: '周黑鸭',
icon: 'zhy',
description: '7.4折起',
typeId: 40
}],
drinkList: [{
name: '星巴克',
icon: 'xingbake',
description: '6.8折起',
typeId: 21
},
{
name: '瑞幸咖啡',
icon: 'ruixing',
description: '5折起',
typeId: 148
},
{
name: 'Costa咖啡',
icon: 'costa',
description: '5.5折起',
typeId: 28
},
{
name: '太平洋咖啡',
icon: 'pacific',
description: '2.9折起',
typeId: 27
},
{
name: '奈雪の茶',
icon: 'naixue',
description: '8.9折起',
typeId: 130
},
{
name: '喜茶',
icon: 'xicha',
description: '8.5折起',
typeId: 155
},
{
name: 'CoCo都可',
icon: 'coco',
description: '7.7折起',
typeId: 25
},
{
name: '书亦烧仙草',
icon: 'shuyi',
description: '8.3折起',
typeId: 312
},
{
name: '茶颜悦色',
icon: 'chayan',
description: '9折起',
typeId: 370
},
{
name: '茶百道',
icon: 'chabaidao',
description: '8.6折起',
typeId: 414
}],
videoList: [{
name: '猫眼电影',
icon: 'maoyan',
description: '7折起',
typeId: 70
},
{
name: '万达影城',
icon: 'wanda',
description: '1.9折起',
typeId: 393
},
{
name: '网易云音乐',
icon: 'wangyiyun',
description: '5.9折起',
id: 20
},
{
name: 'QQ音乐',
icon: 'qqmusic',
description: '8.5折起',
id: 4
},
{
name: '酷狗音乐',
icon: 'kugou',
description: '8折起',
id: 5
},
{
name: '爱奇艺',
icon: 'aiqiyi',
description: '5折起',
id: 3
},
{
name: '腾讯视频',
icon: 'tencenttv',
description: '5折起',
id: 7
},
{
name: '优酷',
icon: 'youku',
description: '5折起',
id: 2
},
{
name: '芒果TV',
icon: 'mgtv',
description: '5折起',
id: 1
},
{
name: '哔哩哔哩',
icon: 'bilibili',
description: '5.5折起',
id: 36
}],
tripList: [{
name: '滴滴出行',
icon: 'didi',
description: '9.2折起',
typeId: 35
},
{
name: '曹操出行',
icon: 'caocao',
description: '9.2折起',
typeId: 108
},
{
name: '高德打车',
icon: 'gaode',
description: '9.5折起',
typeId: 256
},
{
name: '哈罗出行',
icon: 'halou',
description: '7.5折起',
typeId: 90
},
{
name: '青桔单车',
icon: 'qingju',
description: '4.5折起',
id: 31
},
{
name: '美团单车',
icon: 'meituanbike',
description: '3折起',
id: 30
},
{
name: '泊安飞停车',
icon: 'boanfei',
description: '2.3折起',
typeId: 76
},
{
name: '租租车',
icon: 'zuzuche',
description: '1折起',
typeId: 210
},
{
name: 'e代驾',
icon: 'edaijia',
description: '9折起',
typeId: 214
},
{
name: '顺丰寄件',
icon: 'sf',
description: '6.6折起',
typeId: 260
}],
readList: [{
name: '知乎',
icon: 'zhihu',
description: '5折起',
id: 29
},
{
name: '微信阅读',
icon: 'wechatread',
description: '8.3折起',
typeId: 207
},
{
name: 'QQ阅读',
icon: 'qqread',
description: '8折起',
id: 32
},
{
name: '凯叔讲故事',
icon: 'kaishu',
description: '8.9折起',
id: 197
},
{
name: '学而思',
icon: 'xueersi',
description: '1折起',
typeId: 199
},
{
name: '作业帮',
icon: 'zuoyebang',
description: '6.5折起',
id: 55
},
{
name: '小猿搜题',
icon: 'xiaoyuan',
description: '7.6折起',
typeId: 228
},
{
name: '拉勾教育',
icon: 'lagoujiaoyu',
description: '1折起',
typeId: 422
},
{
name: '掌门1对1',
icon: 'zhangmen',
description: '1折起',
typeId: 219
},
{
name: '得到',
icon: 'dedao',
description: '4.5折起',
typeId: 334
}],
healthList: [{
name: 'Keep',
icon: 'keep',
description: '2.7折起',
typeId: 132
},
{
name: 'Fit健身',
icon: 'fit',
description: '3.6折起',
typeId: 162
},
{
name: '蜗牛睡眠',
icon: 'woniu',
description: '1.3折起',
typeId: 160
},
{
name: '每日瑜伽',
icon: 'meiriyujia',
description: '1折起',
typeId: 163
},
{
name: '盘子女人坊',
icon: 'panzinvren',
description: '3.3折起',
typeId: 194
},
{
name: '叮当快药',
icon: 'dingdang',
description: '6.5折起',
typeId: 138
},
{
name: '1药网',
icon: '1yaowang',
description: '1折起',
typeId: 270
},
{
name: '名医看牙',
icon: 'mingyikanya',
description: '1折起',
typeId: 313
},
{
name: '善诊',
icon: 'shanzhen',
description: '1折起',
typeId: 153
},
{
name: '和畅依',
icon: 'hechang',
description: '1折起',
typeId: 231
}],
}
export default data
\ No newline at end of file \ No newline at end of file
import WxConfig from '@u/WxConfig'
import {commodity} from "@r/api";
const WX = new WxConfig(['chooseWXPay']);
export default {
data() {
return {}
},
mounted() {
},
methods: {
async chooseWXPay() {
if (this.appearance == 2 && !/^[a-zA-Z0-9]+$/.test(this.rechargeNumber)) {
this.showToast('请输入正确的充值账号')
return
}
this.orderPay();
},
async orderPay() {
this.showLoading();
let {sessionId} = this.$store.state;
let orderCode = await commodity.getOrderCode({
sessionId,
supplier: this.supplier,
brandId: this.brandId
}).then(res => {
let {code, data, message} = res
if (code == 0) {
return data;
} else {
this.showToast(message)
}
})
let payMannerId;
const ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 4;
}else {
payMannerId = 7; // 5
}
let para = {
orderCode,
goodsId: this.selectData ? this.selectData.id : this.denomination.id,
goodsQuality: 1,
rechargeNumber: this.rechargeNumber,
payMannerId: payMannerId,
sessionId,
}
let payData = await commodity.payOrder(para).then(res => {
this.hideLoading()
let {code, data, message} = res
if (code == 0) {
return data;
} else {
this.showToast(message)
}
})
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.handlePay(payData);
} else {
if (this.checkPhoneType() == 'ios') {
if (window["payWebOrder"] && typeof window.payWebOrder === "function") {
window.payWebOrder("wxpay", JSON.stringify(payData))
} else {
window.webkit.messageHandlers.payWebOrder.postMessage(["wxpay", JSON.stringify(payData)]);
}
} else {
window.myjs.payWebOrder("wxpay", JSON.stringify(payData));
}
let self = this;
window.onMessageFromPayBack = function(result) {
if(result == 0) {
if (self.appearance == 2) {
let productName = self.brandName + self.businessList[self.typeSno].productName + self.denomination.denomination
window.vm.$router.push({
name: 'commodity.process', query: {
rechargeNumber: self.rechargeNumber,
productName
}
})
} else {
window.vm.$router.push({name: 'commodity.success', query: {price: self.selectData.salesPrice}})
}
}else {
window.vm.showToast(result==-1?'支付失败':'取消支付')
}
}
}
},
handlePay(payData) {
const {timeStamp, nonceStr, packages, signType, paySign} = payData;
WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(res => {
console.log(res)
if (this.appearance == 2) {
let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination
window.vm.$router.push({
name: 'commodity.process', query: {
rechargeNumber: this.rechargeNumber,
productName
}
})
} else {
window.vm.$router.replace({name: 'commodity.success', query: {price: this.selectData.salesPrice}})
}
})
}
}
}
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
import {
Toast,
Notify
} from 'vant'
import store from '@/store'
import { common,equity } from '../api/api'
Vue.use(VueRouter)
const router = new VueRouter({
routes,
scrollBehavior() {
return {
x: 0,
y: 0
}
}
})
router.beforeEach((to, from, next) => {
let { meta: { authBase } } = to
store.commit('findPrevPath', from.name)
if (to.name != 'common.phoneLogin') store.commit('jumpPath', to.name)
const params = getParams(window.location.href);
if (params.appId) sessionStorage.setItem('GL_WX_APPID', params.appId)
if (params.merchantId){
store.commit('setMerchantId',params.merchantId)
sessionStorage.setItem('GL_WX_MERCHANTID', params.merchantId)
}
window.onMessageFromLoginBack = (type, userId, sessionId) => {
console.log('onMessageFromLoginBack', type, userId, sessionId)
if (type == 0) {
getSessionAppId(sessionId,true);
} else {
store.commit('clearSessionId')
next()
}
return
}
if (to.matched.some(recode => recode.meta.wxAuth)) {
const ua = navigator.userAgent.toLowerCase()
if (window.__wxjs_environment === 'miniprogram') {
setUserInfo(params)
next()
} else {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
let userInfo = sessionStorage.getItem('GL_EQUITY_USER_INFO')
if (userInfo) {
setUserInfo(JSON.parse(userInfo))
next()
} else {
let [redirectUrl] = window.location.href.split('?')
getSessionId(redirectUrl, authBase ? 'snsapi_base' : 'snsapi_userinfo')
}
return
} else {
setUserInfo(params)
getSessionAppId(params.sessionId)
next()
}
}
} else {
setUserInfo(params)
next()
}
})
const getSessionAppId = (sid,status) => {
common.getAppSessionId({ sid }).then(res => {
let { code, data } = res
if (code == 0) {
setUserInfo(data);
if(status) {
store.commit('reload');
}else {
equity.getCardInfo().then(res => {
let { code } = res;
if (code == 0) {
router.push({name: 'equity.index'})
}
})
}
}
})
}
const getSessionId = (redirectUrl, state) => {
const params = getParams(window.location.href)
console.log(params)
if (params.code) {
const appId = sessionStorage.getItem('GL_WX_APPID')
common.getSessionId({ code: params.code, state, appId }).then(res => {
if (res) {
let { code, data,message } = res
if (code == 0) {
setUserInfo(data)
} else {
Notify({ type: 'danger', message })
}
} else {
Notify({ type: 'danger', message: '系统异常' })
}
})
} else {
Toast({
type: 'loading',
message: '加载中...',
forbidClick: true,
duration: 0
})
sessionStorage.setItem('GL_WX_APPID', params.appId)
sessionStorage.setItem('URL_PARAM', JSON.stringify(params))
window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${params.appId}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=${state}&state=${state}#wechat_redirect`)
}
}
const setUserInfo = params => {
if (params.sessionId) {
store.commit('setUserInfo', params)
}
}
const getParams = str => {
let params = str.split('?')
if (params.length < 2) return {}
let param = params[1].split('&')
let obj = {}
for (let i = 0; i < param.length; i++) {
let paramsA = param[i].split('=')
let key = paramsA[0]
let value = paramsA[1]
obj[key] = value
}
return obj
}
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
export default router
const pages = {
equity: [
{name: 'index', wxAuth: true},
{name: 'road', title: '道路救援'},
{name: 'tyre', title: '轮胎保障'},
{name: 'collision', title: '碰撞维修'},
{name: 'compensate', title: '盗抢补偿'},
{name: 'loss', title: '整车全损'},
],
oilStation: [
{name: 'index'},
{name: 'record', title: '加油记录'},
{name: 'detail', title: '加油站详情'},
{name: 'location', title: '加油站详情'},
],
common: [
{name: 'index'},
{name: 'activate', title: '激活权益'},
{name: 'explain', title: '常见疑问'},
{name: 'phoneLogin', title: '登录'},
{name: 'nothing'},
{name: 'marketing', wxAuth: true},
],
car: [{
name: 'marketing',
title: '绑定挪车码'
}, {
name: 'index',
wxAuth: true,
title: '绑定挪车码'
}],
cardRoll: [
{
name: 'index',
title: '我的卡券'
},
{
name: 'detail',
title: '查看卡券'
},
{
name: 'opening',
title: '开通权益'
},
{
name: 'salesDetail',
title: '售后详情'
},
{
name: 'waiting',
title: '等待处理'
},
{
name: 'salesApply',
title: '申请售后'
},
{
name: 'agreement',
title: '权益服务协议'
},
{
name: 'customer',
}
],
commodity: [
{
name: 'process',
},
{
name: 'recharge',
},
{
name: 'success',
},
{
name: 'business',
},
],
device: [{
name: 'index',
wxAuth: true,
authBase: true,
title: '设备关联'
},
{
name: 'list',
title: '设备关联'
}
]
}
let routes = []
Object.keys(pages).map(parent => {
pages[parent].map((val, index) => {
let {name} = val
let meta = val
delete meta.name
meta.rank = index
if (!meta.title) meta.title = '权益中心'
let routeName = `${parent}.${name}`
let route = {
component: resolve => require([`@v/${parent}/${name}.vue`], resolve),
path: routeName === 'common.marketing' ? '/' : `/${parent}/${name}`,
name: routeName,
meta
}
routes.push(route)
})
})
export default routes
import router from '@/router'
export default {
state: {
verificationCount: null,
verificationFlag: null,
lastPath: '',
prevPath: '',
goodsInfo: {},
merchantId: null,
order: {},
address: {}
},
mutations: {
setUserInfo(state, newVal) {
Object.keys(newVal).map(key => {
if(key == 'sessionId' && newVal[key].indexOf('-') == -1) {
return
}
if (newVal[key]) state[key] = newVal[key]
})
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
let userInfo = sessionStorage.getItem('GL_EQUITY_USER_INFO')
if (!userInfo) {
sessionStorage.setItem('GL_EQUITY_USER_INFO', JSON.stringify(state))
if (state.lastPath) {
let route = state.lastPath.replace('.', '/')
if (route == 'common/marketing') {
route = ''
history.back()//去掉历史记录,重复页面
//router.replace({ name: 'common.marketing' })
//window.location.replace(`${window.location.href.split('?')[0]}#/${route}`)
return
} else {
if (!newVal.phone && route != 'device/index') {
router.replace({ name: 'common.phoneLogin' })
return
}
}
window.location.href = `${window.location.href.split('?')[0]}#/${route}`
return
}
}
}
},
setMerchantId(state, newVal) {
state.merchantId = newVal;
},
setOrder(state, newVal) {
state.order = newVal;
},
setAddress(state, newVal) {
state.address = newVal;
},
setGoodsInfo(state, newVal) {
state.goodsInfo = newVal;
sessionStorage.setItem('GL_GOODS_INFO', JSON.stringify(newVal))
},
setVerificationCount(state, newVal) {
state.verificationCount = newVal
},
setVerificationFlag(state, newVal) {
state.verificationFlag = newVal
},
jumpPath(state, newVal) {
state.lastPath = newVal
},
findPrevPath(state, newVal) {
state.prevPath = newVal
},
clearSessionId(state) {
state.sessionId = ''
router.replace({ name: 'common.marketing' })
},
reload(state) {
// router.replace({ name: 'common.nothing' })
setTimeout(() => {
state.lastPath?router.replace({ name: state.lastPath }):router.replace({name: 'common.index'})
}, 1000)
}
},
}
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
import commonStore from './commonStore'
export default new Vuex.Store({
state: {
...commonStore.state
},
mutations: {
...commonStore.mutations,
},
})
\ No newline at end of file \ No newline at end of file
import { common } from '@r/api'
class WxConfig {
constructor(jsApiList) {
jsApiList.map(e => {
if (e == 'chooseImage') jsApiList.push('getLocalImgData')
})
let [redirectUrl] = window.location.href.split('?')
const appId = sessionStorage.getItem('GL_WX_APPID')
common.getWxConfig({
url: redirectUrl.split('#')[0],
appId
}).then(res => {
if (res) {
let { data } = res
this.setConfig({
...data,
jsApiList
})
} else {
window.vm.showToast('系统异常')
}
})
}
setConfig(params) {
let obj = {}
Object.keys(params).map(key => {
if (params[key]) obj[key] = params[key]
})
wx.config(obj)
}
ready(callBack) {
return new Promise(resolve => {
wx.ready(() => {
callBack(resolve)
})
})
}
scanQRCode(needResult = 0) {
return this.ready(resolve => {
wx.scanQRCode({
needResult,
scanType: ['qrCode', 'barCode'],
success(res) {
resolve(res)
}
})
})
}
chooseImage(count = 1) {
return this.ready(resolve => {
wx.chooseImage({
count, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success(res) {
let { localIds } = res
let imgs = []
localIds.map((e, index) => {
wx.getLocalImgData({
localId: e,
success(img) {
imgs.push(img)
if (index == localIds.length - 1) resolve(imgs)
}
})
})
}
})
})
}
getLocation(type = 'wgs84') {
return this.ready(resolve => {
wx.getLocation({
type, // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
success(res) {
resolve(res)
}
})
})
}
openLocation(latitude,longitude,name,address,scale = '18',infoUrl) {
return this.ready(resolve => {
wx.openLocation({
latitude,
longitude,
name,
address,
scale,
infoUrl,
success(res) {
console.log(res)
resolve(res)
}
})
})
}
chooseWXPay(timestamp,nonceStr,packages,signType,paySign) {
return this.ready(resolve => {
wx.chooseWXPay({
timestamp, // 支付签名时间戳,注意微信js sdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr, // 支付签名随机串,不长于 32 位
package:packages, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign, // 支付签名
success(res) {
window.vm.showToast('支付成功')
resolve(res)
},
fail() {
window.vm.showToast('已取消支付')
},
cancel() {
window.vm.showToast('支付失败,请重试')
}
})
})
}
}
export default WxConfig
import Vue from 'vue'
import { Toast, Dialog } from 'vant'
/**
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
Date.prototype.format = function(fmt) {
let o = {
'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日
'h+': this.getHours(), //小时
'm+': this.getMinutes(), //分
's+': this.getSeconds(), //秒
//季度
'q+': Math.floor((this.getMonth() + 3) / 3),
'S': this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
}
}
return fmt
}
const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
let _lastTime = null
return function() {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
}
}
}
/**防止重复点击 */
// const noScroll = (e) => { e.preventDefault() }
const showLoading = (title = '加载中...') => {
Toast({
type: 'loading',
message: title,
forbidClick: true,
duration: 0
})
}
const hideLoading = () => {
Toast.clear()
}
/**复制 */
const cloneText = (message)=> {
let input = document.createElement("input");
input.value = message;
document.body.appendChild(input);
input.select();
input.setSelectionRange(0, input.value.length), document.execCommand('Copy');
document.body.removeChild(input);
Toast('复制成功');
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
const showToast = (message = '', icon) => {
let params = {
message,
forbidClick: true
}
if (icon) params.icon = icon
Toast(params)
}
/**触摸样式 */
const touchstart = e => {
e.target.classList.add('btn-on-leave')
}
const touchend = e => {
e.target.classList.remove('btn-on-leave')
}
const setLocalStorage = (key, item) => {
localStorage.setItem(key, JSON.stringify(item))
}
const getLocalStorage = key => {
return JSON.parse(localStorage.getItem(key))
}
const removeLocalStorage = key => {
localStorage.removeItem(key)
}
const dialog = (params = {}) => {
params.confirmButtonColor = '#008fff'
return Dialog.confirm(params)
}
const alert = (params = {}) => {
params.confirmButtonColor = '#008fff'
return Dialog.alert(params)
}
const checkPhoneType = () => {
let equipmentType = ""
let agent = navigator.userAgent.toLowerCase()
let android = agent.indexOf("android")
let iphone = agent.indexOf("iphone")
let ipad = agent.indexOf("ipad")
if (android != -1) {
equipmentType = "android"
}
if (iphone != -1 || ipad != -1) {
equipmentType = "ios"
}
return equipmentType
}
const openWindows = (url, name) => {
if (window.__wxjs_environment === 'miniprogram') {
wx.miniProgram.navigateTo({
url: `/pages/commonWebView/commonWebView?path=${encodeURIComponent(url)}`
})
} else {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (name) {
window.vm.$router.push({ name })
} else {
window.location.href = url
}
} else {
let params = {
needNavigator: 1,
type: 4,
url,
}
if (checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify(params))
} else {
window.myjs.jumpNativeApp(JSON.stringify(params))
}
}
}
}
const getParams = str => {
let params = str.split('?')
if (params.length < 2) return {}
let param = params[1].split('&')
let obj = {}
for (let i = 0; i < param.length; i++) {
let paramsA = param[i].split('=')
let key = paramsA[0]
let value = paramsA[1]
obj[key] = value
}
return obj
}
const getChannel = () => {
let source = 3
if (window.__wxjs_environment === 'miniprogram') {
source = 1
} else {
if (checkPhoneType() == 'ios') {
if (window.webkit && window.webkit.messageHandlers.jumpNativeApp) {
source = 2
}
} else {
if (window.myjs) {
source = 2
}
}
}
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 equityLogin = () => {
const ua = navigator.userAgent.toLowerCase()
let url = window.location.href
if (window.__wxjs_environment === 'miniprogram') {
url = `${url}?isTab=true&tabIndex=2`
wx.miniProgram.navigateTo({
url: `/pages/auth/auth?url=${encodeURIComponent(url)}`
})
} else {
dialog({
title: '提示',
message: '领取权益卡,请先登录',
confirmButtonText: '前往登录',
cancelButtonText: '残忍拒绝',
}).then(() => {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.replace({ name: 'common.phoneLogin' })
} else {
if (checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 0 }))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 0 }))
}
}
})
}
}
const utils = {
removeLocalStorage,
setLocalStorage,
getLocalStorage,
checkPhoneType,
makePhoneCall,
showLoading,
openWindows,
hideLoading,
equityLogin,
touchstart,
getChannel,
showToast,
touchend,
throttle,
decimal,
dialog,
alert,
cloneText,
getParams
}
Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key]
})
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="step-box">
<template v-for="(i,index) in stepList">
<div
:key="index"
:class="['step',{'active':index <= step},{'hideArc':index != step}]"
>
<div class="step-arc">
<div class="outset"></div>
<div class="inset"></div>
<div
class="line"
v-if="index > 0"
></div>
</div>
{{i}}
</div>
</template>
</div>
<template v-if="step == 0">
<transition name="fade">
<step-one @step_one_success="step_one_success"></step-one>
</transition>
</template>
<template v-if="step == 1">
<transition name="fade">
<step-two
:values="values"
@step_two_success="step_two_success"
></step-two>
</transition>
</template>
<template v-if="step == 2">
<transition name="fade">
<step-done></step-done>
</transition>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
import stepOne from './step-one'
import stepTwo from './step-two'
import stepDone from './step-done'
export default {
name: 'index',
data () {
return {
step: 0,
stepList: ['绑定车架号', '绑定挪车码', '完成'],
values: {}
}
},
components: {
'step-one': stepOne,
'step-two': stepTwo,
'step-done': stepDone
},
mounted () {
},
methods: {
step_one_success (data) {
this.values = data
this.step = 1
},
step_two_success () {
this.step = 2
}
}
}
</script>
<style lang='scss'>
html,
body {
background-color: rgb(247, 247, 247);
}
.step-box {
display: grid;
grid-template-columns: repeat(3, 1fr);
background: #ffffff;
box-shadow: 0 2px 8px 0 rgba(59, 147, 217, 0.1);
height: 100px;
align-items: center;
position: sticky;
top: 0;
z-index: 2;
.step {
display: flex;
flex-direction: column;
align-items: center;
font-size: 12px;
color: #b9b9b9;
&-arc {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 14px;
position: relative;
.outset {
position: absolute;
background-color: rgba($color: #dddddd, $alpha: 0.2);
width: 100%;
height: 100%;
border-radius: 100%;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.inset {
width: 16px;
height: 16px;
border-radius: 100%;
background: #dddddd;
}
.line {
position: absolute;
width: 90px;
height: 2px;
background: #dddddd;
border-radius: 1px;
top: 50%;
transform: translateY(-50%);
left: -94px;
}
}
}
.step.active {
color: #008fff;
.step-arc {
.inset {
background: #008fff;
}
.line {
background: #008fff;
}
.outset {
animation: Lumos 3.6s infinite;
background-color: rgba($color: #008fff, $alpha: 0.2);
}
@keyframes Lumos {
0% {
opacity: 0.5;
width: 50%;
height: 50%;
}
50% {
width: 100%;
height: 100%;
opacity: 1;
}
100% {
opacity: 0.5;
width: 50%;
height: 50%;
}
}
}
}
.step.active.hideArc {
.step-arc {
.outset {
display: none;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="marketing">
<div class="banner">
<img src="@a/images/marketing/banner.png">
</div>
<div class="tips">
现在绑定挪车贴送
<span>无忧车主权益</span>
</div>
<div
class="marketing-btn"
@touchstart="touchstart"
@touchend="touchend"
@click="jump"
>
绑定挪车贴
</div>
<div class="marketing-box page">
<div class="title">现实中的困扰</div>
<div class="page-items">
<template v-for="(i,index) in page1">
<div
class="page-item"
:key="index"
>
<div class="page-item-img">
<img :src="i.icon">
</div>
{{i.name}}
</div>
</template>
</div>
<div class="title">我们的优势</div>
<div class="page-items page-icon">
<template v-for="(i,index) in page2">
<div
class="page-item "
:key="index"
>
<div class="page-item-img">
<img :src="i.icon">
</div>
{{i.name}}
<div
class="description"
v-html="i.description"
></div>
</div>
</template>
</div>
</div>
<div class="marketing-box equity">
<div class="bg">
<img src="@a/images/marketing/bg.png">
<div class="title">无忧车主权益</div>
</div>
<div class="info">
<div class="tips">
特价加油优惠、全国特价景区门票、超值外卖红包、特价视频会员
</div>
<div class="title">百余种优惠 覆盖您的衣食住行</div>
<div class="line"></div>
<div class="icon-items">
<template v-for="(i,index) in iconItems">
<div
class="item"
:key="index"
>
<div class="icon">
<img :src="i.icon">
</div>
{{i.name}}
</div>
</template>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'marketing',
data () {
return {
page1: [
{ name: '号码暴露遭骚扰', icon: require('@a/images/marketing/page1.png') },
{ name: '临时停车被涂鸦', icon: require('@a/images/marketing/page2.png') }
],
page2: [
{ name: '号码隐藏', description: '虚拟号转接<br>告别电话骚扰', icon: require('@a/images/marketing/icon0.png') },
{ name: '永久免费', description: '终身服务<br>无需额外续费', icon: require('@a/images/marketing/icon1.png') },
{ name: '赠送权益', description: '百种权益<br>覆盖衣食住行', icon: require('@a/images/marketing/icon2.png') },
],
iconItems: [{
name: '加油优惠',
icon: require('@a/images/marketing/icon-0.png')
},
{
name: '特价门票',
icon: require('@a/images/marketing/icon-1.png')
},
{
name: '外卖红包',
icon: require('@a/images/marketing/icon-2.png')
},
{
name: '视频会员',
icon: require('@a/images/marketing/icon-3.png')
}],
}
},
mounted () {
},
methods: {
jump () {
const appId = sessionStorage.getItem('GL_WX_APPID')
window.location.href = `${window.location.href.split('#')[0]}/#/car/index?appId=${appId}`
}
}
}
</script>
<style scoped lang='scss'>
.marketing {
background: #168ae5;
padding-bottom: 20px;
.banner {
width: 100%;
height: 190px;
}
.tips {
font-size: 12px;
color: #ffffff;
text-align: center;
margin: 10px auto;
span {
color: #ffec06;
}
}
.marketing-btn {
margin: 0 auto 24px;
width: 179px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
background: #ffffff;
box-shadow: 0 2px 4px 0 #0063b1;
border-radius: 25.5px;
color: #008fff;
}
&-box {
background: #ffffff;
border-radius: 10px;
margin: 0 20px;
}
.page {
padding: 20px;
.title {
font-size: 16px;
color: #7c7c7c;
text-align: center;
margin-bottom: 10px;
}
.page-items {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
.page-item {
font-size: 14px;
color: #7c7c7c;
text-align: center;
&-img {
width: 108px;
height: 70px;
margin-bottom: 6px;
}
}
}
.page-icon {
margin-bottom: 1px;
.page-item {
color: #666666;
&-img {
width: 50px;
height: 50px;
margin: 0 auto 8px;
}
.description {
font-size: 12px;
color: #b7b7b7;
margin-top: 11px;
}
}
}
}
.equity {
position: relative;
height: 237px;
margin-top: 64px;
.bg {
position: absolute;
top: -44px;
left: 50%;
transform: translateX(-50%);
width: 309px;
height: 265px;
.title {
font-size: 16px;
color: #168ae5;
position: absolute;
top: 6px;
left: 50%;
transform: translateX(-50%);
}
}
.info {
position: relative;
z-index: 2;
.tips {
width: 216px;
text-align: center;
font-size: 12px;
color: #606060;
padding-top: 27px;
line-height: 16px;
margin-bottom: 20px;
}
.title {
font-size: 18px;
color: #008fff;
text-align: center;
font-weight: 700;
}
.line {
width: 200px;
height: 1px;
margin: 12px auto 24px;
background-color: #168ae5;
}
.icon-items {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #f4a346;
text-align: center;
padding: 0 43px;
.icon {
width: 40px;
height: 40px;
margin: 0 auto 10px;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="step-done">
<div class="bind-img">
<div class="sprite-icon icon-car-bind"></div>
挪车贴已绑定
</div>
<div class="tips">
注意:
<ul>
<li><span>1、</span>请将挪车码贴放在挡风玻璃附近,并确保挪车码清晰无遮挡。</li>
<li><span>2、</span>他人拨打挪车贴上的400服务热线并输入挪车码后,系统将自动转接到您的号码({{phone}})</li>
</ul>
</div>
<div class="marketing-box">
<div class="img">
<img src="@a/images/marketing.png">
</div>
<div
class="btn"
@click="jump"
@touchstart="touchstart"
@touchend="touchend"
>免费领取</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'step-done',
data () {
return {
phone: ''
}
},
mounted () {
this.phone = this.$store.state.phone
},
methods: {
jump () {
this.$router.replace({ name: 'equity.index' })
}
}
}
</script>
<style scoped lang='scss'>
.step-done {
padding-bottom: 20px;
.bind-img {
padding: 40px 0 24px;
font-size: 14px;
color: #008eff;
text-align: center;
.sprite-icon {
margin: 0 auto 16px;
}
}
.tips {
width: 236px;
margin: 0 auto 50px;
font-size: 12px;
color: #3b3b3b;
line-height: 24px;
li {
display: flex;
}
}
.marketing-box {
padding: 0 20px;
position: relative;
.img {
width: 100%;
height: 100%;
box-shadow: 0 2px 8px 0 rgba(159, 31, 46, 0.35);
border-radius: 18px;
}
.btn {
background-image: linear-gradient(
180deg,
#f6d99b 0%,
#ffba50 100%,
#e9b970 100%
);
box-shadow: 0 2px 8px 0 rgba(251, 213, 132, 0.41);
border-radius: 20px;
width: 266px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
color: #ba2f40;
position: absolute;
top: 265px;
left: 50%;
transform: translateX(-50%);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="step-one">
<div
:class="['user-orc']"
v-show="inputType"
>
<div class="title">上传驾驶证自动识别VIN码</div>
<div
class="img-box"
@click="chooseImage"
@touchstart="touchstart"
@touchend="touchend"
>
<template v-if="vinImg">
<img :src="vinImg">
</template>
<template v-else>
<div class="sprite-icon icon-car-add"></div>
</template>
</div>
<div
class="input-items"
v-show="showInput"
>
<div class="item">
<div class="label">所有人:</div>
<div :class="['item-input',{'active':userName}]">
<input
type="text"
maxlength="20"
v-model="userName"
>
</div>
</div>
<div class="item">
<div class="label">VIN码:</div>
<div :class="['item-input',{'active':vin},{'err':vinErr}]">
<input
type="text"
maxlength="17"
v-model="vin"
>
</div>
</div>
<div class="item">
<div class="label">车牌号:</div>
<div :class="['item-input',{'active':plateNum},{'err':plateNumberErr}]">
<input
type="text"
maxlength="10"
v-model="plateNum"
>
</div>
</div>
</div>
<div class="line"></div>
<div class="subtitle">拍照要求</div>
<div class="photo-list">
<template v-for="(i,index) in photoList">
<div
:key="index"
class="photo-item"
>
<div :class="['sprite-icon',index == 0 ?'icon-car-success':'icon-car-err']"></div>
<div :class="['sprite-icon',`icon-car-photo-${index}`,'photo']"></div>
{{i}}
</div>
</template>
</div>
<div
:class="['btn',{'btn-disabled':!vin||!userName||!plateNumber||plateNumberErr}]"
v-show="vinImg"
@click="submit"
@touchstart="touchstart"
@touchend="touchend"
>
提交
</div>
<div :class="['tips',{'clearMargin':vinImg}]">
行驶证不在身边?
<div
class="change"
@click="changeType"
>
手动填写
<div class="sprite-icon icon-car-edit"></div>
</div>
</div>
</div>
<div :class="['user-input',{'show-user-input':!inputType}]">
<div class="title">请输入17位车辆VIN码信息</div>
<div class="input-items">
<div class="item">
<div class="label">所有人:</div>
<div :class="['item-input',{'active':userName}]">
<input
type="text"
maxlength="20"
v-model="userName"
>
</div>
</div>
<div class="item">
<div class="label">VIN码:</div>
<div :class="['item-input',{'active':vin},{'err':vinErr}]">
<input
type="text"
maxlength="17"
v-model="vin"
>
</div>
</div>
<div class="item">
<div class="label">车牌号:</div>
<div :class="['item-input',{'active':plateNum},{'err':plateNumberErr}]">
<input
type="text"
maxlength="10"
v-model="plateNum"
>
</div>
</div>
</div>
<div
:class="['btn',{'btn-disabled':!vin||!userName||!plateNumber || vinErr||plateNumberErr}]"
@click="submit"
@touchstart="touchstart"
@touchend="touchend"
>
提交
</div>
<div
class="tips"
@click="changeType"
>
证件识别
<div class="sprite-icon icon-car-camera"></div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import WxConfig from '@u/WxConfig'
const WX = new WxConfig(['chooseImage'])
import { common, car } from '@r/api'
export default {
name: 'step-one',
data () {
return {
inputType: true,
photoList: ['正常拍摄', '照片模糊', '边框缺失', '照片反光'],
vinImg: '',
userName: '',
vin: '',
plateNum: '',
showInput: false,
vinErr: false,
plateNumberErr: false
}
},
mounted () {
},
watch: {
'vin' (n) {
if (n) {
let rex = /^[A-HJ-NPR-Z\d]{17}$/
this.vinErr = !rex.test(n)
}
},
'plateNum' (n) {
if (n) {
let rex = /^([京津晋冀蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新][ABCDEFGHJKLMNPQRSTUVWXY][1-9DF][1-9ABCDEFGHJKLMNPQRSTUVWXYZ]\d{3}[1-9DF]|[京津晋冀蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新][ABCDEFGHJKLMNPQRSTUVWXY][\dABCDEFGHJKLNMxPQRSTUVWXYZ]{5})$/
this.plateNumberErr = !rex.test(n)
}
}
},
methods: {
chooseImage () {
WX.chooseImage().then(res => {
let [data] = res
let { localData } = data
let suffix = ''
let imgUrl = ''
if (localData.indexOf(';') != -1) {
suffix = localData.split(';')[0]
imgUrl = localData.split('base64,')[1]
}
let type = suffix ? suffix.split('/')[1] : 'jpg'
if (!imgUrl) imgUrl = localData
if (type == 'unknown') type = 'jpg'
if (type.toLowerCase() != 'jpg' && type.toLowerCase() != 'jpeg' && type.toLowerCase() != 'png') {
this.showToast('图片格式错误')
return
}
this.showLoading('上传中...')
common.uploadImage({
file: `${type}@${imgUrl}`
}).then(img => {
if (img) {
let { data } = img
this.showLoading('识别中...')
car.scanVehicle({ imageUrl: data }).then(vinRes => {
if (vinRes) {
console.log(vinRes)
let { code, data } = vinRes
if (code == 0) {
this.vinImg = img.data
console.log(data)
this.plateNum = data.plateNumber
this.vin = data.vin
this.userName = data.userName
this.showInput = true
} else {
this.showToast('识别失败请重试', 'close')
this.vinImg = ''
this.showInput = false
}
} else {
this.showToast('识别失败请重试', 'close')
this.vinImg = ''
this.showInput = false
}
})
} else {
this.showToast('上传失败')
this.vinImg = ''
this.showInput = false
}
})
})
},
changeType () {
let { inputType } = this
this.inputType = !inputType
},
submit () {
let { vin, userName, plateNum, vinErr, plateNumberErr } = this
if (!vin || !userName || !plateNum || vinErr || plateNumberErr) return
this.showLoading('校检中...')
car.checkVin({
vin
}).then(res => {
if (res) {
console.log(res)
let { code, message } = res
if (code == 0) {
this.$emit('step_one_success', {
vin,
userName,
plateNum
})
} else {
this.showToast(message)
}
} else {
this.showToast('系统异常')
}
console.log(res)
})
}
}
}
</script>
<style scoped lang='scss'>
.step-one {
position: relative;
padding: 0 20px 20px;
.title {
font-size: 14px;
padding-top: 20px;
}
.input-items {
padding: 20px 26px 6px 17px;
.item {
display: flex;
align-items: center;
font-size: 12px;
color: #333333;
margin-bottom: 24px;
.label {
margin-right: 10px;
text-align: right;
width: 50px;
}
&-input {
background: #ffffff;
border: 1px solid #d8d8d8;
height: 28px;
width: calc(100% - 60px);
padding: 0 12px;
transition: all 0.2s;
input {
border: none;
width: 100%;
height: 100%;
font-size: 14px;
}
}
.active {
border-color: #008fff;
}
.err {
border-color: #fa5151;
}
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 226px;
height: 30px;
background: #008fff;
border-radius: 18.5px;
font-size: 14px;
color: #ffffff;
margin: 30px auto;
}
.btn-disabled {
background: #e0e0e0;
}
.user-orc {
color: #3b3b3b;
text-align: center;
.subtitle {
font-size: 12px;
margin: 16px 0 10px;
}
.img-box {
width: 300px;
height: 180px;
margin: 10px auto 20px;
background: #ffffff;
box-shadow: 0 2px 8px 0 rgba(59, 147, 217, 0.1);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
}
.line {
background: #e9e9e9;
border-radius: 1px;
width: 100%;
height: 2px;
}
.photo-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
font-size: 12px;
.photo-item {
display: flex;
flex-direction: column;
align-items: center;
.photo {
margin: 5px 0;
}
}
}
.tips {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #666666;
margin-top: 90px;
.change {
display: flex;
align-items: center;
color: #008fff;
.sprite-icon {
margin-left: 6px;
}
}
}
.clearMargin {
margin-top: 0;
}
}
.user-input {
text-align: center;
padding: 20px 20px 0;
position: absolute;
right: 100%;
top: 0;
transition: all 0.5s;
.tips {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 12px;
color: #008fff;
.sprite-icon {
margin-left: 6px;
}
}
}
.show-user-input {
right: 0;
width: 100%;
box-sizing: border-box;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="step-two">
<div class="input-group-box">
<input-group
:value="value"
@input="input"
:error="error"
:pattern="/^[A-Za-z0-9]+$/"
></input-group>
<div
class="err-box"
v-show="error"
>提示:当前输入的{{errText}}</div>
</div>
<div class="line"></div>
<div class="title">如何查找挪车码</div>
<div class="tips-box">
<div class="sprite-icon icon-car-tips"></div>
<div class="tips-text">请在<span>挪车贴</span>上寻找“挪车码”</div>
</div>
<div
:class="['btn',{'btn-disabled':value.length < 6}]"
@click="submit"
@touchstart="touchstart"
@touchend="touchend"
>提交</div>
</div>
</template>
<script type='text/ecmascript-6'>
import InputGroup from '@c/InputGroup'
import { car } from '@r/api'
export default {
name: 'step-two',
data () {
return {
value: '',
error: false,
errText: ''
}
},
props: {
values: null
},
components: {
'input-group': InputGroup,
},
mounted () {
},
methods: {
input (val) {
this.value = val
this.error = false
},
submit () {
let { value, values } = this
if (value.length < 6) return
this.showLoading('校检中...')
car.checkCode({ code: value }).then(res => {
if (res) {
let { code, message } = res
if (code == 0) {
car.bindCarCode({
...values,
code: value
}).then(_res_ => {
console.log(_res_)
if (_res_) {
if (_res_.code == 0) {
this.$emit('step_two_success')
} else {
this.showToast(_res_.message)
}
} else {
this.showToast('系统异常')
}
})
} else {
this.error = true
this.errText = message
}
} else {
this.showToast('系统异常')
}
})
}
}
}
</script>
<style scoped lang='scss'>
.step-two {
padding: 0 20px;
.input-group-box {
padding: 40px 0 66px;
position: relative;
.err-box {
font-size: 12px;
color: #fa5151;
position: absolute;
top: 90px;
left: 0;
}
}
.line {
width: 100%;
height: 2px;
background: #e9e9e9;
border-radius: 1px;
}
.title {
font-size: 14px;
color: #3b3b3b;
margin: 20px 0 10px;
text-align: center;
}
.tips-box {
width: 100%;
height: 119px;
background: #ffffff;
box-shadow: 0 1px 4px 0 rgba(59, 147, 217, 0.3);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
padding-right: 10px;
.sprite-icon {
transform: translateX(38px);
}
.tips-text {
font-size: 12px;
color: #2a2a2a;
span {
color: #52e8ff;
}
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 226px;
height: 30px;
background: #008fff;
border-radius: 18.5px;
margin: 81px auto 0;
font-size: 14px;
color: #ffffff;
}
.btn-disabled {
background: #e0e0e0;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="box">
<div class="agreement-title">
汽车增值服务权益卡领取协议
</div>
<div class="agreement-content">
<p>本协议是您与 深圳市嘀加智慧云服务有限公司(以下简称为“我司”)、以及“商家”之间就汽车增值服务权益卡领取事项所订立的契约。请您仔细阅读本协议,您勾选“同意《汽车增值服务权益卡领取协议》”后,本协议即构成对双方有约束力的法律文件。</p>
<h3>第1条 相关定义</h3>
<p>1.1 权益卡:指签署本协议并根据权益卡开通流程所展示的收费标准支付相应费用或免费领取后获取的特殊权益(实际名称以开通流程及前端页面展示为准),权益卡包括无门槛卡、规则卡及付费卡。</p>
<p>权益卡权益可能包括以下部分或全部类型(实际权益类型可能出现新增或减少,以商家/我司/ 第三方实际设置为准):</p>
<p>1)特定商品的优惠,即在购买特定商品过程中,通过享受优惠价格、获得折扣让利、使用品类券等方式获取的特殊权益;</p>
<p>2)特定服务,即可直接享受特别服务的特殊权益;</p>
<p>3)专属权利;</p>
<p>4)其他权益。</p>
<p>1.2 权益卡权益:指您基于其权益卡资格所享有的特殊权益,具体权益内容由商家单独提供,请予以关注或及时与商家沟通确认。</p>
<p>1.3.商家:指自行或与我司共同制定收费标准以及领卡会员权益,并独立或与我司共同协商决定是否收取费用且提供服务的经我司认证的主体。</p>
<p>1.4.我司:指本协议中“权益卡”的所有权人(在尚未正式销售给您之前)。</p>
<h3>第2条 本站服务条款的确认和接纳</h3>
<p>2.1本协议所提供的汽车增值服务权益活动的解释权和运作权归我司所有。</p>
<p>2.2您在申请开通权益卡流程中点击同意本协议之前,应当认真阅读本协议。请您务必审慎阅读、充分理解各条款内容,特别是免除或者限制责任的条款、法律适用和争议解决条款。免除或者限制责任的条款将以粗体下划线标识,领卡/购卡您应重点阅读。如您对协议有任何疑问,可向商家或我司或客服咨询。</p>
<p>2.3您点击同意本协议的,即视为您确认自己同意汽车增值服务权益相关服务的条款,且同意按本协议内容履行,如产生相关责任的,同意承担相应法律责任。</p>
<h3>第3条 活动时间</h3>
<p>3.1汽车增值服务权益的开始时间和结束时间以 我司发布的活动规则中列明的时间为准。</p>
<h3>第4条 用户权益</h3>
<p>4.1 您申请开通权益卡服务时,需根据页面提示支付相应的会员服务费用后方可完成开通。基于权益调整、市场与业务的发展,可能会调整权益卡服务开通所需会员服务费用,或向您提供与会员权益相关的增值服务,并可能收取增值服务的费用。我司就前述权益调整将在相应服务页面进行通知或公告,您可以通过 商家公众号 平台查询最新的VIP您权益内容。您确认费用及权益的调整由我司/商家/ 第三方独立完成,如果非我司调整,与我司无关。</p>
<h3>第5条 用户领权益卡注意事项</h3>
<p>5.1提交申请领取时,您同意并提交本人手机号码和邮箱等本站所需的个人资料,并保证其提供的注册资料真实、准确、完整、合法有效,您注册资料如有变动的,应及时更新其注册资料。如果您提供的注册资料不合法、不真实、不准确、不详尽,您需承担因此引起的相应责任及后果,并且我司保留终止您参与该活动的权利。</p>
<p>5.2权益服务领取后,您应谨慎合理的保存、使用其您名和密码,不得将在本站注册获得的账户借给他人使用,否则您应承担由此产生的全部责任,同时我司在该种情况下有权做出独立判断,可采取暂停或关闭您参与资格等措施。</p>
<p>5.3您同意,我司拥有通过邮件、短信电话等形式,向其发送相关活动信息等必要信息的权利。</p>
<p>5.4您同意,领取汽车增值服务权益,除为实现您自身利益外,不得利用其享有的权益非法获利,不得以任何形式售卖其所享有的权益,不得滥用其所享有的权益,如因您不当行为致我司合理怀疑的或判定的,我司有权暂停或关闭该活动的权益,此外,您需承担因此引起的相应责任及后果。</p>
<h3>第6条 协议变更</h3>
<p>6.1我们可根据国家法律法规变化及服务内容调整、保护用户权益等需要修订本协议。一旦相关内容发生重大变更,我们将通过我们的网站或客户端公告、消息通知等方式通知您。</p>
<p>6.2如您不同意本协议的修订,您应立即停止使用本服务。如您继续使用本服务的,则视为您同意本协议的修订。</p>
<h3>第7条 责任免除</h3>
<p>因下列原因导致无法正常提供服务,我司不承担任何责任:</p>
<p>1.系统停机维护或升级;</p>
<p>2.因台风、地震、洪水、雷电或恐怖袭击等不可抗力原因;</p>
<p>3.您的电脑软硬件和通信线路、供电线路出现故障的;</p>
<p>4.您操作不当或通过非授权或认可的方式使用本服务的;</p>
<p>5.因病毒、木马、恶意程序攻击、网络拥堵、系统不稳定、系统或设备故障、通讯故障、电力故障、第三方服务瑕疵或政府行为等原因。</p>
<h3>第8条 法律管辖和适用</h3>
<p>8.1如缔约方就本协议内容或其执行发生任何争议,合同各方应尽力友好协商解决;协商不成时,任何一方均可向深圳市南山区人民法院提起诉讼。</p>
<h3>第9条 其他</h3>
<p>9.1如因不可抗力或其它本站无法控制的原因使本站活动服务无法及时提供或无法按本协议进行的,我司会合理地尽力协助处理善后事宜。</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: "agreement",
data() {
return {
}
},
mounted() {
}
}
</script>
<style scoped lang="scss">
.box {
padding: 15px;
.agreement-title {
color: #666666;
line-height: 32px;
font-size: 14px;
text-align: center;
}
.agreement-content {
color: #666666;
line-height: 18px;
font-size: 12px;
>h3 {
line-height: 30px;
}
>p {
text-indent: 24px;
line-height: 18px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="serve-box">
<img src="@a/images/service.png">
</div>
</div>
</template>
<script>
export default {
name: "customer"
}
</script>
<style scoped lang="scss">
.serve-box {
position: absolute;
height: 100%;
width: 100%;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="box">
<div class="card-detail-h">
<div class="card-img">
<img :src="detailInfo.brandLogo">
</div>
<div class="card-name">{{ detailInfo.brandName }}{{ detailInfo.productName }}</div>
<div class="card-time">质保期至 {{ new Date(detailInfo.warrantyDate).format('yyyy-MM-dd hh:mm:ss') }}</div>
<div class="card-number">订单编号 {{ detailInfo.orderCode }}</div>
</div>
<div class="card-item-panel" v-if="detailInfo.cardType >2">
<div class="card-item">
<div class="card-item-title">{{ detailInfo.brandName }}丨{{ detailInfo.productName }}</div>
<div class="card-item-style" v-if="detailInfo.cardType == 5">
<div class="card-item-number">
<div class="card-item-label text-hide">账号:{{detailInfo.cardPwd}}</div>
<div class="btn-clone" @click="getClone(detailInfo.cardPwd)">复制</div>
</div>
<div class="card-item-number">
<div class="card-item-label text-hide">密码:{{detailInfo.cardPwd}}</div>
<div class="btn-clone" @click="getClone(detailInfo.cardPwd)">复制</div>
</div>
</div>
<div class="card-item-style" v-if="detailInfo.cardType == 3">
<div class="card-item-number">
<div class="card-item-label text-hide">URL:{{detailInfo.linkUrl}}</div>
<div class="btn-clone" @click="getClone(detailInfo.linkUrl)">复制</div>
</div>
</div>
<div class="card-item-style" v-if="detailInfo.cardType == 4">
<div class="card-item-number">
<div class="card-item-label text-hide">兑换码:{{detailInfo.cardPwd}}</div>
<div class="btn-clone" @click="getClone(detailInfo.cardPwd)">复制</div>
</div>
</div>
</div>
</div>
<div class="card-panel" v-if="detailInfo.cardType == 0 || detailInfo.cardType == 1 || detailInfo.cardType == 2">
<div class="card-qrcode-panel">
<img :src="detailInfo.qrcode" preview="0"/>
</div>
</div>
<div class="card-tips-panel" v-if="detailInfo.useNotes">
<p>使用须知</p>
<p v-html="decodeURIComponent(detailInfo.useNotes)"></p>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import {cardRoll} from "@r/api";
export default {
name: "detail",
data() {
return {
detailInfo: {},
codeStatus: 1,
status: 3,
account: '',
password: '',
url: '',
qrcode: [1],
code: '',
}
},
mounted() {
this.showLoading();
const ua = navigator.userAgent.toLowerCase();
let orderCode;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
orderCode = this.$store.state.order.orderCode;
}else {
orderCode = this.$store.state.orderCode;
}
let para = {
orderCode
}
cardRoll.getCardDetail(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.detailInfo = data;
} else {
this.showToast(message)
}
})
},
methods: {
//复制编码
getClone(value) {
this.cloneText(value)
}
}
}
</script>
<style scoped lang="scss">
.main {
.box {
padding: 0 20px;
.card-detail-h {
text-align: center;
margin-bottom: 20px;
img {
width: 46px;
height: 46px;
border-radius: 50%;
margin: 20px 0;
}
.card-name {
font-size: 16px;
font-weight: 800;
color: #333333;
line-height: 24px;
}
.card-time,.card-number {
font-size: 10px;
font-weight: 500;
line-height: 22px;
color: #999999;
}
}
.card-qrcode-panel {
width: 160px;
height: 160px;
margin: 10px auto;
padding-top: 20px;
img {
width: 160px;
height: 160px;
}
}
.card-item {
background: #f2f2f2;
padding: 23px;
height: 177px;
border-radius: 16px;
box-sizing: border-box;
background: linear-gradient(164deg, #FF9900 0%, rgba(254, 190, 0, 0.81) 100%);
opacity: 0.86;
margin-bottom: 10px;
position: relative;
.card-item-step {
position: absolute;
font-size: 16px;
right: 24px;
top: 27px;
font-weight: 600;
color: #FFFFFF;
}
&-title {
font-size: 16px;
font-weight: 500;
color: #FFFFFF;
line-height: 22px;
text-shadow: 0px 2px 4px rgba(254, 96, 0, 0.24);
margin-bottom: 50px;
}
.card-item-style {
display:table-cell;
vertical-align:bottom;
height: 60px;
.card-item-number {
display: flex;
align-items: center;
height: 30px;
.card-item-label {
max-width: 235px;
font-size: 14px;
font-weight: 400;
color: #FFFFFF;
line-height: 20px;
text-shadow: 0px 2px 4px rgba(254, 96, 0, 0.24);
}
.btn-clone {
margin-left: 10px;
display: inline-block;
text-align: center;
width: 36px;
height: 18px;
line-height: 18px;
background: #FFFFFF;
border-radius: 16px;
font-size: 10px;
color: #666666;
}
}
}
}
.card-tips-panel {
margin-top: 30px;
p {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
&:first-child {
color: #666666;
font-size: 16px;
line-height: 32px;
text-align: center;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<van-tabs v-model="active" @click="tabClick" class="card-tab">
<van-tab :title="item.name" v-for="(item,index) in tabStatus" :key="index"></van-tab>
</van-tabs>
<div class="card-list" v-if="cardList.length != 0">
<div class="card-list-item" v-for="(item,index) in cardList" :key="index">
<template v-if="item.appearance == 1">
<div class="card-img">
<div class="card-l-panel">
<div class="card-l-title">{{ item.brandName }}</div>
<div class="card-l-price">{{ item.officePrice }}元券</div>
<div class="card-l-number">X{{ item.goodsQuality }}</div>
</div>
</div>
<div class="card-desc">
<div class="card-num">¥{{ item.orderPrices }}</div>
<div class="card-name">
<span class="card-name-span text-hide">{{ item.productName }}</span>
<template v-for="(i,key) in cardStatus">
<span :class="`color-${key+1}`" v-if="i.value == item.orderStatus" :key="key">{{ i.name }}</span>
</template>
</div>
<div class="card-time">
保质期至 {{new Date(item.warrantyDate).format('yyyy-MM-dd hh:mm:ss')}}
</div>
<div class="card-operation">
<span @click="jumpDetail(item)" v-if="item.orderStatus != 6">查看卡券</span>
<span @click="handleConfirm(item.orderCode)" v-if="item.orderStatus == 2">确认收货</span>
<span @click="jumpSales(item)" v-if="!item.refundCode && item.orderStatus == 2">售后</span>
<span @click="jumpSalesDetail(item)" v-if="item.refundCode">售后详情</span>
</div>
</div>
</template>
<template v-if="item.appearance == 2">
<div class="card-img">
<div class="card-l-panel">
<div class="card-l-title">{{ item.brandName }}</div>
<div class="card-l-price text-hide">{{ item.productName }}</div>
<div class="card-l-number">{{ item.denomination }}</div>
</div>
</div>
<div class="card-desc">
<div class="card-num">¥{{ item.orderPrices }}</div>
<div class="card-name">
<span class="card-name-span text-hide">{{ item.productName }}</span>
<template v-for="(i,key) in reStatus">
<span :class="`color-${i.value}`" v-if="i.value == item.orderStatus" :key="key">{{ i.name }}</span>
</template>
</div>
<div class="card-time card-time-2" v-if="item.appearance == 2">
充值账号{{item.rechargeNumber}}
</div>
<div class="card-type" v-if="item.appearance == 2">
<p>购买日期 {{ new Date(item.orderDate).format('yyyy-MM-dd hh:mm:ss') }}</p>
<p>订单编号 {{item.orderCode}}</p>
</div>
</div>
</template>
</div>
</div>
<div class="van-empty" v-if="cardList.length == 0">
<div class="van-empty__image">
<img src="@a/images/Coupon.png">
</div>
<p class="van-empty-description">暂无可用优惠券</p>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import {cardRoll} from "@r/api";
const cardStatus = [{
value: 0,
name: '未支付',
},{
value: 1,
name: '已支付'
},{
value: 2,
name: '待收货'
},{
value: 3,
name: '已完成'
},{
value: 4,
name: '售后中'
},{
value: 5,
name: '退款失败'
},{
value: 6,
name: '已退款'
}]
const reStatus = [{
value: 2,
name: '充值中',
},{
value: 3,
name: '充值成功'
},{
value: 6,
name: '充值失败'
}]
const tabStatus = [{
value: 0,
name: '全部',
},{
value: 1,
name: '待收货'
},{
value: 2,
name: '已完成'
},{
value: 3,
name: '已退款'
},{
value: 4,
name: '售后'
}]
export default {
name: "index",
data() {
return {
pageIndex: 1,
statusIndex: 0,
status: false,
cardList: [],
cardListStart: [],
active: 0,
list: [],
loading: false,
finished: false,
isLoading: false,
immediateCheck: false,
finishedText: '没有更多了...',
offset: 280,
tabStatus,
reStatus,
idx: 1,
cardStatus
}
},
mounted() {
this.getCardList();
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) != 'micromessenger') {
this.reload();
}
},
methods: {
reload() {
let hiddenProperty ='hidden' in document ?'hidden':'webkitHidden' in document ?'webkitHidden':
'mozHidden' in document ?'mozHidden':null;
let visibilityChangeEvent = hiddenProperty.replace(/hidden/i,'visibilitychange');
let onVisibilityChange = function(){
window.location.reload()
}
document.addEventListener(visibilityChangeEvent, onVisibilityChange);
},
getCardList(e) {
let {sessionId} = this.$store.state;
this.showLoading();
let para = {
sessionId,
...e
};
cardRoll.getCardList(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.cardList = data?data:[];
} else {
this.showToast(message)
}
})
},
//切换tab
tabClick(name) {
let params = {};
switch(name)
{
case 0:
params = {}
break;
case 1:
params = {
'statusList[0]': 1,
'statusList[1]': 2,
}
break
case 2:
params = {
'statusList[0]': 3,
}
break;
case 3:
params = {
'statusList[0]': 5,
'statusList[1]': 6,
}
break;
case 4:
params = {
'statusList[0]': 4,
}
break;
}
this.getCardList(params)
},
//确认收货
handleConfirm(val) {
this.dialog({
title: '提示',
message: '是否确认收货',
})
.then(() => {
this.showLoading();
let para = {
sessionId: this.sessionId,
orderCode: val
};
cardRoll.getCardConfirm(para).then(res => {
this.hideLoading()
let { code, message } = res
if (code == 0) {
this.showToast('确认收货成功');
let status;
if(this.active == 1) {
status = {
'statusList[0]': 1,
'statusList[1]': 2,
}
}
let self = this;
setTimeout(function (){
self.getCardList(status);
},1000)
} else {
this.showToast(message)
}
})
})
.catch(() => {
this.showToast('取消成功')
});
},
//刷新
// onRefresh() {
// setTimeout(() => {
// this.showToast('刷新成功');
// this.isLoading = false;
// }, 1000);
// },
//查看卡券
jumpDetail(val) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val)
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/detail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'cardRoll.detail')
},
jumpSales(val) {
if(val.openRefund) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val)
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/salesApply?sessionId=${sessionId}&orderCode=${val.orderCode}&orderPrices=${val.orderPrices}`;
this.openWindows(url, 'cardRoll.salesApply')
}else {
this.alert({
message: '该卡券无法发起售后,如有其它疑问,请联系购券页面的在线客服进行咨询!',
})
}
},
jumpSalesDetail(val) {
let { sessionId } = this.$store.state;
this.$store.commit('setOrder',val)
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/salesDetail?sessionId=${sessionId}&orderCode=${val.orderCode}`;
this.openWindows(url, 'cardRoll.salesDetail')
},
},
}
</script>
<style scoped lang='scss'>
.color-2,.color-3,.color-4,.color-5 {
color: #248B20;
}
.color-1,.color-4,.color-6 {
color: #F10016;
}
.main {
background: #F4F4F4;
position: absolute;
min-height: 100%;
box-sizing: border-box;
width: 100%;
.card-tab {
/deep/ .van-tab--active {
color: #008FFF;
}
/deep/ .van-tabs__line {
background: rgba(0,143,255,0.1);
width: 57px;
height: 24px;
border-radius: 12px;
bottom: 25px;
}
}
.van-empty {
img {
width: 160px;
height: 160px;
}
.van-empty-description {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
.card-list {
padding: 10px;
//min-height: calc(100vh - 70px);
&-item {
margin-bottom: 10px;
height: 100px;
box-sizing: border-box;
padding: 15px;
background: #FFFFFF;
border-radius: 6px;
display: flex;
position: relative;
>.card-img {
width: 70px;
height: 70px;
background-image: url('~@a/images/cardRoll.png');
background-size: 100% 100%;
.card-l-panel {
width: 70px;
height: 70px;
text-align: center;
color: #FFFFFF;
padding: 9px 0px;
box-sizing: border-box;
.card-l-title,card-l-num {
font-size: 12px;
line-height: 17px;
}
.card-l-price {
font-size: 14px;
line-height: 20px;
}
}
}
>.card-desc {
margin-left: 16px;
flex: 1;
>div {
height: 23.3px;
}
>.card-num {
position: absolute;
top: 37px;
right: 15px;
font-size: 18px;
font-weight: 800;
color: #FF9900;
line-height: 25px;
}
>.card-name {
display: flex;
justify-content: space-between;
font-size: 14px;
font-weight: 800;
color: #333333;
line-height: 20px;
.card-name-span {
display: inline-block;
width: 180px;
}
>span {
&:last-child {
font-size: 12px;
font-weight: 500;
color: #248B20;
}
}
}
>.card-time {
font-size: 10px;
font-weight: 500;
color: #FF9900;
line-height: 24px;
&.card-time-2 {
line-height: 18px;
}
}
>.card-type {
>p {
font-size: 10px;
font-weight: 500;
color: #999999;
line-height: 14px;
}
}
>.card-operation {
span {
margin-right: 10px;
display: inline-block;
padding: 2px 8px;
background: rgba(255,153,0,0.1);
border-radius: 16px;
font-size: 10px;
font-weight: 400;
color: #FF9900;
}
}
}
}
}
}
</style>
<template>
<div class="main">
<div class="box">
<div class="opening-border">
<div class="opening-border-p">{{ equityName }} <span>未开通</span></div>
<div class="opening-border-p">尊享100+专属权益</div>
<div class="opening-border-p price" v-if="price">¥<span>{{price}}</span>/年</div>
</div>
<div class="opening-vip-border">
<img src="@a/images/title-100.png" alt="" class="vip-title-images">
<div class="vip-shop-panel">
<img src="@a/images/vip-more.png" alt="">
</div>
<div class="vip-more">更多权益,开通即享</div>
</div>
<div class="opening-other">
<div class="opening-other-title">
其他开通方式
</div>
<div class="opening-other-border" @click="jumpOpen">
<div class="other-border-icon">
<img src="@a/images/exchange.png" alt="">
</div>
<div class="other-border-desc">
<div class="other-border-p1">兑换权益卡</div>
<div class="other-border-p2">设备码兑换</div>
</div>
</div>
</div>
</div>
<div class="opening-loading-panel" v-if="openingStatus">
<div class="opening-popup">
<div class="opening-header">
<div class="opening-jump" @click="jumpPast">
<span>跳过</span>
</div>
</div>
<div class="opening-tips">
支付成功 正在开卡中…
</div>
<div class="opening-loading">
<van-loading color="#19C34E" size="40" class="opening-loading-icon"/>
</div>
</div>
</div>
<div class="opening-operation">
<div class="opening-operation-price" v-if="price" @click="buyCard"><span>¥{{ price }}</span>立即开通</div>
<div class="opening-operation-price disabled" v-else>暂不支持付费购买</div>
<div class="opening-operation-desc">开通权益代表接受 <a @click="jumpAgree">《权益服务协议》</a></div>
</div>
</div>
</template>
<script>
import {cardRoll, equity} from "@r/api";
import WxConfig from '@u/WxConfig'
const WX = new WxConfig(['chooseWXPay']);
export default {
name: "opening",
data() {
return {
equityName: '',
price: '',
orderCode:'',
openingStatus: false,
timer: '',
sessionId: '',
merchantId: '',
payStatus: 0,
}
},
mounted(){
this.payStatus = this.$route.query;
let { sessionId,merchantId} = this.$store.state;
this.merchantId = merchantId;
this.sessionId = sessionId;
this.showLoading();
let para = {
merchantId: this.merchantId,
}
cardRoll.getCardMerchantid(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.price = data.goodPrice;
this.orderCode = data.orderCode;
this.equityName = data.equityName;
} else {
this.showToast(message)
}
})
},
methods: {
jumpOpen() {
window.vm.$router.push({ name: 'common.activate' });
},
async buyCard() {
this.showLoading();
let payMannerId;
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 5; //6
}else {
payMannerId = 6; //2
}
let para = {
merchantId: this.merchantId,
orderCode: this.orderCode,
payMannerId: payMannerId,
orderSource: 3,
sessionId: this.sessionId,
}
let payData = await cardRoll.getCardBuy(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
return data
} else {
this.showToast(message)
}
})
const { timeStamp,nonceStr, packages, signType, paySign } = payData;
const self = this;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
WX.chooseWXPay(timeStamp,nonceStr, packages, signType, paySign).then(res => {
console.log(res);
self.getCardInfo();
})
} else {
if (self.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.payWebOrder.postMessage(["wxpay", JSON.stringify(payData)]);
} else {
window.myjs.payWebOrder("wxpay", JSON.stringify(payData));
}
window.onMessageFromPayBack = function(result) {
if(result == 0) {
self.getCardInfo();
}else {
self.showToast(result==-1?'支付失败':'取消支付')
}
}
}
},
getCardInfo() {
this.openingStatus = true;
equity.getCardInfo().then(res => {
this.hideLoading()
let { code } = res;
if (code == 0) {
this.openingStatus = false;
clearInterval(this.timer);
this.payStatus? window.vm.$router.go(-1):window.vm.$router.replace({ name: 'equity.index' });
} else {
clearInterval(this.timer);
this.timer = setInterval(this.getCardInfo, 3000);
}
})
},
jumpPast() {
window.vm.$router.replace({ name: 'equity.index' });
this.openingStatus = false;
},
jumpAgree() {
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/agreement?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.agreement')
}
},
beforeDestroy() {
clearInterval(this.timer);
}
}
</script>
<style scoped lang="scss">
.main {
.box {
padding: 20px;
.opening-border {
background-image: url('~@a/images/card.png');
background-size: 100% 100%;
border-radius: 16px;
padding: 15px 20px;
height: 125px;
box-sizing: border-box;
&-p {
font-size: 16px;
margin-bottom: 10px;
color: #FFFFFF;
text-shadow: 0 2px 4px rgba(254,96,0,0.24);
display: flex;
justify-content: space-between;
&.price {
font-size: 14px;
justify-content: flex-start;
font-weight: 400;
line-height: 40px;
>span {
margin: 0px 2px;
font-size: 26px;
color: #FFFFFF;
}
}
>span {
font-size: 14px;
color: #8B5A0F;
}
}
}
.opening-vip-border {
height: 190px;
margin-top: 60px;
box-sizing: border-box;
background: #FFFFFF;
border: 1px solid #F5D890;
box-shadow: 0 2px 8px 0 rgba(255,222,166,0.30);
border-radius: 8px;
position: relative;
.vip-title-images {
position: absolute;
width: 200px;
height: 40px;
top: -30px;
left: 50%;
margin-left: -100px;
}
.vip-shop-panel {
height: 140px;
width: 312px;
margin: 14px auto 8px auto;
}
.vip-more {
font-size: 12px;
color: #CE9B1F;
letter-spacing: 0;
text-align: center;
line-height: 24px;
}
}
.opening-other {
margin: 20px auto;
&-title {
font-size: 16px;
color: #666666;
position: relative;
height: 22px;
padding-left: 15px;
margin-bottom: 10px;
&:before {
content: '';
position: absolute;
top: 0px;
left: 0px;
width: 4px;
height: 22px;
background: #FFAE23;
}
}
&-border {
opacity: 0.86;
border: 1px solid #FFA100;
border-radius: 8px;
width: 148px;
height: 60px;
display: flex;
padding: 10px;
box-sizing: border-box;
align-items: center;
justify-content: space-between;
.other-border-icon {
width: 36px;
height: 25px;
}
.other-border-p1 {
font-size: 14px;
color: #FFA100;
line-height: 20px;
}
.other-border-p2 {
font-size: 12px;
color: #6A6A6A;
line-height: 20px;
}
}
}
}
.opening-loading-panel {
position: fixed;
top: 0;
left: 0;
z-index: 2015;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
.opening-popup {
width: 205px;
height: 184px;
border-radius: 8px;
opacity: 0.94;
position: fixed;
max-height: 100%;
overflow-y: auto;
background-color: #fff;
top: 50%;
left: 50%;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
.opening-header {
text-align: right;
padding: 10px;
display: flex;
justify-content: flex-end;
.opening-jump {
width: 32px;
height: 20px;
line-height: 20px;
text-align: center;
border-radius: 14px;
border: 1px solid #CDCDCD;
box-sizing: border-box;
font-size: 10px;
color: #666666;
}
}
.opening-tips {
width: 96px;
height: 44px;
font-size: 16px;
margin-left: 17px;
font-weight: 500;
color: #19C34E;
line-height: 22px;
}
.opening-loading {
text-align: center;
margin: 10px auto;;
.opening-loading-icon {
font-size: 80px;
}
}
}
}
.opening-operation {
position: fixed;
bottom: 0px;
height: 65px;
width: 100%;
padding: 6px 0px;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 -2px 4px 0 rgba(0,0,0,0.20);
&-price {
width: 342px;
margin: 0px auto;
height: 32px;
opacity: 0.86;
background: linear-gradient(129deg, #FF9900 0%, #FEBE00 76%, #FFBE00 100%);
border-radius: 20px;
font-size: 16px;
color: #FFFFFF;
letter-spacing: 0;
text-align: center;
line-height: 32px;
&.disabled {
background: #aaaaaa;
}
}
&-desc {
font-size: 12px;
color: #565656;
line-height: 23px;
letter-spacing: 0;
text-align: center;
>a {
text-decoration: underline;
}
}
}
}
</style>
<template>
<div class="main">
<div class="box">
<div class="apply-item-1">
<div class="apply-title">申请描述</div>
<van-field
v-model="reason"
rows="6"
autosize
type="textarea"
maxlength="230"
placeholder="请您详细描述申请说明"
show-word-limit
class="apply-textarea"
/>
</div>
<div class="apply-item-2">
<div class="apply-title">上传图片</div>
<div class="apply-photo">
<div class="apply-photo-b" :class="{'success-image':refundImg}">
<input id="input" type="file" class="upload-btn" accept="image/*" @change="fileChange" v-if="!weixinImg">
<img :src="refundImg" @click="weixinImg && uploadImage()" v-if="refundImg">
<img src="@a/images/upload.png" @click="weixinImg && uploadImage()" v-if="!refundImg">
</div>
</div>
</div>
<div class="apply-item-3">
<div class="apply-title">申请金额</div>
<div class="apply-price">¥{{ orderPrices }}</div>
</div>
<div class="apply-operation">
<div class="apply-btn" @click="jumpApply">提交申请</div>
</div>
<!-- <van-dialog v-model="priceDialog" title="修改金额" show-cancel-button @cancel="cancel" @confirm="confirm">-->
<!-- <van-field v-model="price2" type="number"/>-->
<!-- </van-dialog>-->
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import {cardRoll, common} from "@r/api";
import WxConfig from '@u/WxConfig'
const WX = new WxConfig([ 'chooseImage'])
export default {
name: "salesApply",
data() {
return {
weixinImg: true,
priceDialog: false,
price2: '',
reason: '',
refundImg: '',
orderPrices: ''
}
},
mounted() {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.weixinImg = true;
this.orderCode = this.$store.state.order.orderCode;
this.orderPrices = this.$store.state.order.orderPrices;
}else {
this.weixinImg = false;
this.orderCode = this.$store.state.orderCode;
this.orderPrices = this.$store.state.orderPrices;
}
},
methods: {
handleEditPrice() {
this.priceDialog = true;
this.price2 = this.orderPrices;
},
cancel() {
this.showToast('取消成功');
this.priceDialog = false;
},
fileChange(e) {
let files = e.target.files || e.dataTransfer.files
// const isLt2M = files.size / 1024 / 1024 < 2
// if (!isLt2M) {
// this.showToast('上传图片太大');
// return;
// }
let id = e.target.id
if (!files.length) return
this.picavalue = files[0]
this.imgPreview(this.picavalue, id)
},
//获取图片
imgPreview(file, id) {
let self = this
//判断支不支持FileReader
if (!file || !window.FileReader) return false
if (/^image/.test(file.type)) {
//创建一个reader
let reader = new FileReader()
//将图片转成base64格式
reader.readAsDataURL(file)
//读取成功后的回调
reader.onloadend = function() {
let result = this.result
let img = new Image()
img.src = result
img.onload = function() {
let data = self.compress(img, 0.8)
self.uploadImg(data, id)
}
}
}
},
// 压缩图片
compress(img, size) {
let canvas = document.createElement('canvas')
let ctx = canvas.getContext('2d')
let width = img.width
let height = img.height
let scale = width / height;
width = 200;
height = width/scale;
canvas.width = width
canvas.height = height
// 铺底色
ctx.fillStyle = '#fff'
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.drawImage(img, 0, 0, width, height)
//进行最小压缩
let ndata = canvas.toDataURL('image/png', size)
return ndata
},
uploadImg(base64) {
let that = this;
let suffix = base64.split(';')[0]
let img = base64.split('base64,')[1]
let type = suffix.split('/')[1];
common.uploadImage({
file: `${type}@${img}`
}).then(img => {
if (img) {
that.refundImg = img.data;
that.showToast('上传成功')
} else {
that.showToast('上传失败')
that.refundImg = '';
}
})
},
//上传图片
uploadImage () {
WX.chooseImage().then(res => {
let [data] = res
let { localData } = data
let suffix = ''
let imgUrl = ''
if (localData.indexOf(';') != -1) {
suffix = localData.split(';')[0]
imgUrl = localData.split('base64,')[1]
}
let type = suffix ? suffix.split('/')[1] : 'jpg'
if (!imgUrl) imgUrl = localData
if (type == 'unknown') type = 'jpg'
if (type.toLowerCase() != 'jpg' && type.toLowerCase() != 'jpeg' && type.toLowerCase() != 'png') {
this.showToast('图片格式错误')
return
}
this.showLoading('上传中...')
common.uploadImage({
file: `${type}@${imgUrl}`
}).then(img => {
if (img) {
this.refundImg = img.data;
this.showToast('上传成功')
} else {
this.showToast('上传失败')
this.refundImg = '';
}
})
})
},
//跳转
jumpApply() {
if(!this.reason){
this.showToast('请输入申请描述')
return
}
if(!this.refundImg){
this.showToast('请上传图片')
return
}
this.showLoading();
let {sessionId} = this.$store.state;
let para = {
orderCode: this.orderCode,
reason: this.reason,
refundImg: this.refundImg,
sessionId
}
cardRoll.getCardRefund(para).then(res => {
this.hideLoading();
console.log(res)
let { code, message } = res
if (code == 0) {
window.vm.$router.replace({ name: 'cardRoll.waiting' })
} else {
this.showToast(message)
}
})
}
}
}
</script>
<style scoped lang="scss">
.main {
.box {
position: absolute;
min-height: 100%;
width: 100%;
background: #f4f4f4;
padding: 15px;
box-sizing: border-box;
.apply-textarea {
display: block;
padding: 0px;
box-sizing: border-box;
}
.apply-item-1 {
background: #FFFFFF;
border-radius: 6px;
padding: 0px 16px;
margin-bottom: 10px;
.apply-title {
font-size: 16px;
line-height: 30px;
font-weight: 500;
color: #333333;
}
}
.apply-item-2 {
background: #FFFFFF;
border-radius: 6px;
padding: 15px;
margin-bottom: 15px;
.apply-title {
font-size: 16px;
line-height: 30px;
font-weight: 500;
color: #333333;
}
}
.apply-item-3 {
height: 50px;
line-height: 50px;
background: #FFFFFF;
border-radius: 6px;
padding: 0px 16px;
margin-bottom: 15px;
display: flex;
align-items: center;
justify-content: space-between;
.apply-title {
font-size: 16px;
font-weight: 500;
color: #333333;
}
.apply-price {
height: 50px;
font-size: 20px;
font-weight: 500;
color: #008FFF;
>span {
display: inline-block;
vertical-align: middle;
margin-left: 6px;
font-size: 10px;
font-weight: 400;
color: #666666;
width: 56px;
height: 18px;
line-height: 18px;
background: #F4F4F4;
border-radius: 16px;
}
}
}
.apply-photo {
&-b {
position: relative;
margin: 5px 0px;
width: 80px;
height: 80px;
&.success-image {
width: 80px;
height: auto;
}
.upload-btn {
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
width: 80px;
height: 80px;
opacity: 0;
}
}
}
.apply-operation {
.apply-btn {
text-align: center;
width: 337px;
height: 44px;
line-height: 44px;
color: #FFFFFF;
font-weight: 500;
background: #008FFF;
border-radius: 22px;
margin: 20px auto;
font-size: 18px;
}
}
}
}
</style>
<template>
<div class="main">
<div class="box" v-if="salesStatus">
<div class="sales-h" v-if="detail.refundStatus == 1">
<div class="sales-status-1 after-status">售后中</div>
<div class="sales-status-2">等待平台处理</div>
</div>
<div class="sales-h" v-if="detail.refundStatus == 3">
<div class="sales-status-1 after-status">已退款</div>
<div class="sales-status-2">钱款将原路退回至您的账户</div>
</div>
<div class="sales-h" v-if="detail.refundStatus == 2">
<div class="sales-status-1 after-status">拒绝售后</div>
<div class="sales-status-2">该商品已退换兑换或不支持售后</div>
</div>
<div class="sales-desc">
<p class="text-hide"><span>售后商品:</span>{{ detail.productName }}</p>
<p class="sales-price"><span>申请金额:</span>¥{{ detail.orderPrice }}</p>
<p><span>申请时间:</span>{{ detail.createDate }}</p>
<p class="detail-desc">
<span>申请描述:</span>
<span class="detail-reason">{{ decodeURIComponent(detail.reason) }}</span>
</p>
<p><span>售后编号:</span>{{ detail.refundCode }}</p>
<p><span>订单编号:</span>{{ detail.orderCode}}</p>
</div>
<div class="sales-image">
<div class="sales-image-item">
<img :src="detail.img" preview="0">
</div>
</div>
</div>
<div class="box" v-else>
<div class="sales-h">
<van-icon name="clock" class="sales-icon"/>
<div class="sales-status-1">等待处理</div>
<div class="sales-status-2">已提交申请,等待处理</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import {cardRoll} from "@r/api";
export default {
name: "salesDetail",
data() {
return {
salesStatus: true,
salesResult: 1,
detail: {},
}
},
mounted() {
const ua = navigator.userAgent.toLowerCase();
let orderCode;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
orderCode = this.$store.state.order.orderCode;
}else {
orderCode = this.$store.state.orderCode;
}
let para = {
orderCode
}
this.showLoading()
cardRoll.getCardRefundDetail(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.detail = data;
} else {
this.showToast(message)
}
})
},
methods: {
}
}
</script>
<style scoped lang="scss">
.main {
.box {
padding: 0 15px;
.sales-h {
margin-bottom: 30px;
text-align: center;
line-height: 30px;
.sales-icon {
font-size: 50px;
color: #19c341;
margin-top: 100px;
}
.sales-status-1 {
height: 33px;
font-size: 24px;
font-weight: 500;
color: #333333;
line-height: 33px;
&.after-status {
margin-top: 35px;
}
}
.sales-status-2 {
font-size: 16px;
font-weight: 400;
color: #999999;
line-height: 22px;
margin-top: 8px;
}
}
.sales-desc {
.detail-desc {
height: auto;
}
p {
height: 26px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 26px;
&.sales-price {
color: #FF9900;
}
>span {
font-size: 14px;
font-weight: 500;
color: #999999;
}
}
}
.sales-image {
display: flex;
justify-content: center;
margin-top: 20px;
.sales-image-item {
width: 96px;
height: auto;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="box">
<div class="sales-h">
<van-icon name="clock" class="sales-icon"/>
<div class="sales-status-1">等待处理</div>
<div class="sales-status-2">已提交申请,等待处理</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: "waiting",
data() {
return {
}
},
mounted() {
sessionStorage.setItem("need-refresh",1)
},
methods: {
}
}
</script>
<style scoped lang="scss">
.main {
.box {
padding: 0 15px;
.sales-h {
margin-bottom: 30px;
text-align: center;
line-height: 30px;
.sales-icon {
font-size: 50px;
color: #19c341;
margin-top: 100px;
}
.sales-status-1 {
height: 33px;
font-size: 24px;
font-weight: 500;
color: #333333;
line-height: 33px;
&.after-status {
margin-top: 35px;
}
}
.sales-status-2 {
font-size: 16px;
font-weight: 400;
color: #999999;
line-height: 22px;
margin-top: 8px;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="business-box">
<div class="business-select-more" @click="getMore" v-if="businessList.length>3">
<div class="business-more-b">
<div class="business-more-text">更多</div>
<van-icon name="arrow-down" />
</div>
</div>
<div class="business-select">
<div class="business-select-item" @click="selectBusiness(item,index)" :class="[{'checked': index == bindex,'itemWid': businessList.length<3},`select-${index}`]" v-for="(item,index) in businessList" :key="index">
<van-icon name="checked" class="business-checked" v-if="index == bindex"/>
<div class="business-select-img">
<img :src="item.goodsImage" alt="">
</div>
<div class="business-select-name text-hide-2">{{ item.productName }}</div>
<div class="business-select-price1"><span>¥</span>{{ isOpen?item.salesPrice:item.lineationPrice}}</div>
<div class="business-select-price2" v-if="!isOpen">¥{{ item.salesPrice }} <span>权益价</span></div>
<div class="business-select-price3 line-through" v-else>官方价¥{{ item.lineationPrice }}</div>
</div>
</div>
<div class="business-item business-number-n" v-if="selectData.stock == 0">已抢光</div>
<div class="business-item">
<div class="business-item-label">质保期至</div>
<div class="business-item-quality" v-if="selectData.warrantyDate">{{ new Date(selectData.warrantyDate).format('yyyy-MM-dd hh:mm:ss')}}</div>
</div>
<div class="business-item" v-if="selectData.validityPeriod">
<div class="business-item-label">卡券有效期</div>
<div class="business-item-effective">兑换到账户内有效期{{ selectData.validityPeriod }}天</div>
</div>
<div class="business-item">
<div class="business-item-label">商品金额</div>
<div class="business-item-price1"><span>¥</span>{{ isOpen?selectData.salesPrice:selectData.lineationPrice }}</div>
</div>
<div class="business-item">
<div class="business-item-label">应付金额</div>
<div class="business-item-price2"><span>¥</span>{{ isOpen?selectData.salesPrice:selectData.lineationPrice }}</div>
</div>
<div class="business-tips" v-if="selectData.buysNotes">
<h3 class="business-title">使用须知</h3>
<div v-html="decodeURIComponent(selectData.buysNotes)"></div>
</div>
</div>
<div class="recharge-footer">
<div class="card-roll" @click="getCard">
<div class="card-roll-icon">
<img src="@a/images/card-icon.png">
</div>
<div>我的卡券</div>
</div>
<div class="card-roll" @click="jumpCustomer">
<div class="card-roll-icon smile-icon">
<img src="@a/images/customer.png">
</div>
<div>客服</div>
</div>
<template v-if="isOpen == 1">
<div class="recharge-operation" v-if="selectData.stock" @click="chooseWXPay"><span>{{ selectData.salesPrice }}元</span>立即购买</div>
<div class="recharge-operation disabled" v-if="!selectData.stock">立即购买</div>
</template>
<template v-else>
<div class="recharge-operation" @click="jumpOpening">去开通权益</div>
</template>
</div>
<van-popup
class="more-popup"
v-model="show"
closeable
position="bottom"
:style="{ height: '70%' }"
>
<div class="pop-title">更多商品</div>
<div class="pop-list">
<div class="pop-item" @click="selectBusiness(item,index)" v-for="(item,index) in businessList" :key="index">
<van-icon name="checked" class="pop-checked" v-if="index == bindex"/>
<div class="pop-item-img">
<img :src="item.goodsImage" alt="">
</div>
<div class="pop-item-name text-hide-2">{{ item.productName }}</div>
<div class="pop-item-price1"><span>¥</span>{{ isOpen?item.salesPrice:item.lineationPrice}}</div>
<div class="pop-item-price2" v-if="!isOpen">¥{{ item.salesPrice }} <span>权益价</span></div>
<div class="pop-item-price3 line-through" v-else>官方价¥{{ item.lineationPrice }}</div>
</div>
</div>
</van-popup>
</div>
</template>
<script type='text/ecmascript-6'>
import { pay} from '@/mixins'
import { commodity,equity} from "@r/api";
export default {
mixins: [pay],
name: "business",
data() {
return {
isOpen: 1,
appearance: 1,
businessStatus: 2,
bindex: 0,
show: false,
bussinessNumber: 0,
businessList: [
],
selectData: {
},
status: true,
supplier: ''
}
},
mounted() {
this.getCardInfo();
const ua = navigator.userAgent.toLowerCase()
if(ua.match(/MicroMessenger/i) == 'micromessenger') {
let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO'));
document.title = goods.brandName
this.brandName = goods.brandName;
this.supplier = goods.supplier;
}else {
let params = this.getParams(window.location.href)
this.brandName = params.brandName;
this.supplier = params.supplier;
document.title = decodeURI(params.brandName)
}
this.showLoading();
let para = {
brandName: this.brandName,
supplier: this.supplier
}
commodity.getCouponDetail(para).then(res => {
let { code, data, message } = res
if (code == 0) {
this.businessList = data;
this.selectData = this.businessList[0]
} else {
this.showToast(message)
}
this.hideLoading();
})
},
methods: {
getCardInfo() {
equity.getCardInfo().then(res => {
let { code } = res;
if (code == 0) {
this.isOpen = 1;
} else {
this.isOpen = 0;
}
})
},
getCard() {
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index')
},
jumpCustomer() {
window.vm.$router.push({ name: 'cardRoll.customer' })
},
jumpOpening() {
window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
},
getMore() {
this.show = true;
},
selectBusiness(item,index){
this.selectData = item;
this.bindex = index;
this.show = false;
if(this.businessList.length>3) {
document.querySelector('.business-select').scrollLeft = document.querySelector(`.select-${index}`).offsetLeft - 10;
}
},
}
}
</script>
<style scoped lang="scss">
.main {
.business-box {
position: relative;
.business-select-more {
position: absolute;
right: 0px;
top: 30px;
width: 40px;
height: 174px;
background: #e4e4e4;
opacity: .95;
z-index: 10;
border-radius: 6px;
.business-more-b {
text-align: center;
width: 14px;
height: 54px;
margin-top: 60px;
margin-left: 13px;
font-size: 14px;
color: #666666;
}
.business-more-text {
width: 14px;
}
}
.business-select {
padding: 20px;
display: flex;
overflow-x: auto;
&:after {
content: '';
width: 5px;
flex-shrink: 0;
}
&-item {
width: 144px;
box-sizing: border-box;
flex: 1 0 auto;
height: 190px;
border-radius: 8px;
border: 1px solid #FFFFFF;
box-shadow: 0 2px 8px rgba(0,0,0,.1);
margin-right: 10px;
position: relative;
&.itemWid {
flex: none;
}
&.checked {
box-shadow: 0 2px 8px rgba(128,199,255,.5);
border: 1px solid #008FFF;
.business-checked {
position: absolute;
color: #008FFF;
font-size: 16px;
bottom: 10px;
right: 10px;
}
.business-select-name {
color: #333333;
}
.business-select-price1 {
color: #333333;
&.price-in {
color: #008FFF;
}
}
.business-select-price2 {
color: #389AFF;
>span {
background: rgba(0, 143, 255, 0.1);
color: #008FFF;
}
}
}
.business-select-img {
width: 100%;
height: 89px;
>img {
width: 100%;
height: 89px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
}
.business-select-name {
padding: 0px 10px;
height: 44px;
font-size: 16px;
font-weight: 400;
color: #999999;
line-height: 22px;
margin-top: 6px;
}
.business-select-price1 {
padding: 0px 10px;
font-size: 20px;
font-weight: 500;
color: #A3A3A3;
line-height: 28px;
>b {
font-size: 20px;
}
}
.business-select-price3 {
padding: 0px 10px;
font-size: 12px;
font-weight: 500;
color: #A3A3A3;
line-height: 17px;
}
.business-select-price2 {
padding: 0px 10px;
font-size: 12px;
font-weight: 500;
color: #A3A3A3;
line-height: 17px;
>span {
display: inline-block;
padding: 2px 4px;
background: #F2F2F2;
border-radius: 9px;
font-size: 10px;
font-weight: 400;
color: #A3A3A3;
line-height: 14px;
margin-left: 10px;
text-align: center;
}
}
}
}
.business-item {
padding: 0 20px;
display: flex;
justify-content: space-between;
height: 50px;
line-height: 50px;
border-bottom: 1px solid #E9E9E9;
/deep/ .van-stepper__minus {
color: #008FFF;
background-color: #fff;
border: 1px solid #008FFF;
}
/deep/ .van-stepper__plus {
background: #008FFF;
}
&.business-number-n {
justify-content: center;
font-size: 16px;
font-weight: 600;
color: #F10016;
background: rgba(241, 0, 22, 0.1);
}
&.business-number {
background: #F0F8FF;
.business-item-label {
font-size: 16px;
font-weight: 500;
color: #333333;
>span {
font-size: 12px;
font-weight: 400;
color: #999999;
margin-left: 10px;
}
}
}
&-label {
font-size: 14px;
font-weight: 400;
color: #323232;
}
&-quality,&-price1 {
font-size: 14px;
font-weight: 400;
color: #666666;
>span {
font-size: 12px;
margin-right: 4px;
}
}
&-effective {
font-size: 14px;
font-weight: 400;
color: #F10016;
}
&-price2 {
font-size: 20px;
font-weight: 600;
color: #008FFF;
>span {
font-size: 12px;
margin-right: 4px;
}
}
}
.business-tips {
padding: 20px;
margin-bottom: 50px;
>h3 {
height: 22px;
line-height: 22px;
font-size: 16px;
color: #333333;
position: relative;
padding-left: 10px;
margin-bottom: 16px;
&:before {
content: '';
position: absolute;
width: 3px;
top: 3px;
left: 0px;
height: 16px;
background: #008FFF;
}
}
/deep/ p {
line-height: 25px;
font-size: 14px;
color: #333333;
}
}
}
}
.recharge-footer {
position: fixed;
background: #FFFFFF;
width: 375px;
bottom: 0px;
padding: 0px 16px;
box-sizing: border-box;
height: 50px;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
.card-roll {
text-align: center;
flex: 1;
&-icon {
width: 26px;
height: 26px;
margin: 0px auto 2px auto;
color: #666666;
}
>div {
color: #666666;
font-size: 12px;
line-height: 14px;
}
}
.recharge-operation {
width: 234px;
height: 40px;
background: #008FFF;
border-radius: 100px;
line-height: 40px;
text-align: center;
font-size: 14px;
color: #FFFFFF;
>span {
margin-right: 10px;
}
}
}
.pop-title {
font-size: 16px;
padding: 20px;
color: #333333;
}
.more-popup {
overflow-y: hidden;
}
.pop-list {
padding: 0 10px;
display: flex;
flex-wrap: wrap;
max-height: calc(100% - 60px);
overflow-y: auto;
>.pop-item {
width: 112px;
border: 1px solid #DEDFDF;
height: 148px;
margin: 0px 6px 6px 0px;
border-radius: 6px;
position: relative;
&:nth-child(3n) {
margin-right: 0px;
}
.pop-checked {
position: absolute;
color: #008FFF;
font-size: 12px;
bottom: 8px;
right: 8px;
}
.pop-item-img {
>img {
width: 100%;
height: 70px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
}
.pop-item-name {
padding: 0px 7px;
font-size: 13px;
height: 40px;
line-height: 20px;
color: #333333;
}
.pop-item-price1 {
padding: 0px 7px;
font-size: 16px;
color: #333333;
&.checked {
color: #008FFF;
}
>span {
font-size: 10px;
margin-right: 4px;
}
}
.pop-item-price2 {
color: #389AFF;
padding: 0px 7px;
font-size: 10px;
>span {
display: inline-block;
padding: 2px;
background: rgba(0, 143, 255, 0.1);
color: #008FFF;
border-radius: 9px;
font-size: 10px;
font-weight: 400;
line-height: 14px;
margin-left: 5px;
text-align: center;
}
}
.pop-item-price3 {
padding: 0px 7px;
font-size: 10px;
color: #999999;
}
}
}
</style>
<template>
<div class="main">
<div class="process-title">充值流程</div>
<div class="process-step-panel">
<div class="van-steps van-steps--vertical">
<div class="van-steps__items">
<div class="van-hairline van-step van-step--vertical van-step--finish">
<div class="van-step__title" style="color: rgb(0, 143, 255);">
<h3 >支付成功</h3>
</div>
<div class="van-step__circle-container">
<div class="step-in">
</div>
</div>
<div class="van-step__line" style="background: rgb(0, 143, 255);"></div>
</div>
<div class="van-hairline van-step van-step--vertical van-step--process">
<div class="van-step__title van-step__title--active" style="color: rgb(0, 143, 255);">
<h3>充值已提交</h3>
</div>
<div class="van-step__circle-container">
<div class="step-in">
</div>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--vertical">
<div class="van-step__title"><h3 data-v-5fb13f3a="">预计10s内到账</h3>
<p>具体到账情况以运营商为准,如有疑问,请致电400-028-0503联系我们</p></div>
<div class="van-step__circle-container">
<div class="step-in-d">
</div>
</div>
<div class="van-step__line"></div>
</div>
</div>
</div>
</div>
<div class="process-detail">
<div class="process-detail-name">{{ productName }}</div>
<div class="process-detail-account">充值账号:{{ rechargeNumber }}</div>
<div class="process-detail-operation">
<div class="process-recharge" @click="getAgainPay">继续充值</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: "process",
data() {
return {
status: 1,
productName: '',
rechargeNumber: ''
}
},
mounted() {
this.rechargeNumber = this.$route.query.rechargeNumber;
this.productName = this.$route.query.productName;
},
methods: {
getAgainPay() {
this.$router.go(-1);
}
}
}
</script>
<style scoped lang="scss">
.main {
.process-title {
margin-top: 16px;
line-height: 20px;
padding-left: 20px;
font-weight: 700;
color: #333333;
font-size: 14px;
}
.process-step-panel {
border-bottom: 6px solid #F4F4F4;
padding: 0px 10px 20px 10px;
.van-step--vertical {
padding: 16px 16px 16px 0;
}
.van-step__circle-container {
top: 26px;
}
.van-step__line {
height: 30px;
top: 38px;
}
h3 {
font-size: 16px;
font-weight: 400;
line-height: 22px;
}
p {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
margin-top: 10px;
}
.step-in {
width: 10px;
height: 10px;
background: #008FFF;
border-radius: 50%;
box-shadow: 0px 0px 6px rgba(0,143,255,1);
}
.step-in-d {
width: 10px;
height: 10px;
background: #E9E9E9;
border-radius: 50%;
}
}
.process-detail {
margin-top: 30px;
text-align: center;
line-height: 30px;
&-name {
font-size: 16px;
font-weight: 700;
color: #333333;
}
&-account {
font-size: 14px;
font-weight: 400;
color: #666666;
}
}
.process-detail-operation {
display: flex;
justify-content: center;
margin-top: 10px;
> div {
width: 116px;
height: 28px;
line-height: 28px;
text-align: center;
border-radius: 70px;
font-size: 12px;
}
.process-recharge {
background: rgba(0, 143, 255, 0.08);
border: 1px solid #008FFF;
margin-right: 10px;
font-weight: 400;
color: #008FFF;
}
.process-order {
background: #FFFFFF;
border: 1px solid #E9E9E9;
font-weight: 400;
color: #666666;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="box">
<div class="box-h">
<div class="recharge-title">充值账号</div>
<input type="text" v-model="rechargeNumber" placeholder="请输入充值账号" class="van-field__control input-recharge">
</div>
<div class="recharge-select">
<div class="recharge-select-name">充值类型</div>
<div class="recharge-select-panel">
<div class="recharge-select-item text-hide" :class="{'checked':typeSno == index}" @click="selectType(index)" v-for="(item,index) in businessList" :key="index">
{{ item.productName }}</div>
</div>
</div>
<div class="recharge-select">
<div class="recharge-select-name">充值面额</div>
<div class="recharge-select-panel">
<div class="recharge-select-item2 text-hide" :class="{'checked':amountSno == index}" @click="selectAmount(index)" v-for="(item,index) in denominationList" :key="index">
<div class="recharge-item-time recharge-im">{{ item.denomination }}</div>
<div class="recharge-item-total recharge-im">售价{{ isOpen?item.salesPrice:item.lineationPrice }}元</div>
<div class="recharge-item-total2" v-if="!isOpen">权益价{{ item.salesPrice }}元</div>
<div class="recharge-item-total2 line-through" v-else>官方价{{ item.lineationPrice }}元</div>
</div>
</div>
</div>
<div class="recharge-tips" v-if="denomination.buysNotes">
<h3>温馨提示</h3>
<div v-html="decodeURIComponent(denomination.buysNotes)"></div>
</div>
</div>
<div class="recharge-footer">
<div class="card-roll" @click="getCard">
<div class="card-roll-icon">
<img src="@a/images/card-icon.png">
</div>
<div>我的卡券</div>
</div>
<div class="card-roll" @click="jumpCustomer">
<div class="card-roll-icon smile-icon">
<img src="@a/images/customer.png">
</div>
<div>客服</div>
</div>
<template v-if="isOpen == 1">
<div class="recharge-operation" @click="chooseWXPay"><span>{{denomination.salesPrice}}元</span>立即充值</div>
</template>
<template v-else>
<div class="recharge-operation" @click="jumpOpening">去开通权益</div>
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { pay} from '@/mixins'
import {commodity,equity} from "@r/api";
export default {
mixins: [pay],
name: "recharge",
data() {
return {
brandName: '',
isOpen: 1,
appearance: 2,
rechargeNumber: '',
businessStatus: 1,
denomination: {},
denominationList: [],
businessList: [],
mobile: '',
reType: [],
typeSno: 0,
amountSno: 0,
supplier: ''
}
},
mounted() {
this.getCardInfo();
const ua = navigator.userAgent.toLowerCase()
if(ua.match(/MicroMessenger/i) == 'micromessenger') {
let goods = JSON.parse(sessionStorage.getItem('GL_GOODS_INFO'));
this.brandName = goods.brandName;
document.title = this.brandName;
this.supplier = goods.supplier;
}else {
let params = this.getParams(window.location.href)
this.supplier = params.supplier;
this.brandName = decodeURI(params.brandName);
document.title = decodeURI(params.brandName);
}
this.showLoading();
let para = {
brandName: this.brandName,
supplier: this.supplier
}
commodity.getChargeDetail(para).then(res => {
let { code, data, message } = res
if (code == 0) {
this.businessList = data;
this.denominationList = this.businessList[0].denominationList;
this.denomination = this.denominationList[0];
} else {
this.showToast(message)
}
this.hideLoading();
})
},
methods: {
getCardInfo() {
equity.getCardInfo().then(res => {
let { code } = res;
if (code == 0) {
this.isOpen = 1;
} else {
this.isOpen = 0;
}
})
},
jumpOpening() {
window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
},
getCard() {
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index')
},
jumpCustomer() {
window.vm.$router.push({ name: 'cardRoll.customer'});
},
//充值类型
selectType(item) {
this.typeSno = item;
this.amountSno = 0;
this.denominationList = this.businessList[item].denominationList;
this.denomination = this.businessList[item].denominationList[0];
},
//选择面额
selectAmount(item) {
this.amountSno = item;
this.denomination = this.denominationList[item]
}
}
}
</script>
<style scoped lang="scss">
.main {
.box {
padding: 0px 20px;
.box-h {
border-bottom: 1px solid #ebedf0;
margin-top: 20px;
.recharge-title {
font-size: 14px;
font-weight: 600;
color: #333333;
}
.input-recharge {
height: 36px;
font-size: 18px;
font-weight: 500;
color: #333333;
}
}
.recharge-select {
&-name {
margin-top: 20px;
font-size: 14px;
font-weight: 600;
color: #333333;
}
&-panel {
display: flex;
flex-wrap: wrap;
margin-top: 5px;
.recharge-select-item {
width: 105px;
height: 50px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid #E9E9E9;
line-height: 50px;
text-align: center;
margin: 0px 10px 10px 0px;
color: #666666;
&:nth-child(3n) {
margin-right: 0px;
}
&.checked {
background: #E6F4FF;
border-radius: 4px;
border: 1px solid #008FFF;
color: #008FFF;
}
}
.recharge-select-item2 {
box-sizing: border-box;
width: 105px;
height: 80px;
border-radius: 4px;
border: 1px solid #E9E9E9;
text-align: center;
margin: 0px 10px 10px 0px;
&:nth-child(3n) {
margin-right: 0px;
}
&.checked {
font-weight: 700;
background: #E6F4FF;
border-radius: 4px;
border: 1px solid #008FFF;
> .recharge-item-time {
color: #333333;
&.recharge-im {
color: #008FFF;
}
}
> .recharge-item-total {
color: #333333;
&.recharge-im {
color: #008FFF;
}
}
> .recharge-item-total2 {
color: #008FFF;
}
}
.recharge-item-time {
line-height: 30px;
font-size: 16px;
font-weight: 400;
color: #666666;
}
.recharge-item-total {
line-height: 20px;
font-size: 14px;
color: #666666;
}
.recharge-item-total2 {
line-height: 25px;
font-size: 12px;
color: #A3A3A3;
font-weight: 400;
}
}
}
}
.recharge-tips {
padding: 20px 0px;
margin-bottom: 70px;
>h3 {
height: 22px;
line-height: 22px;
font-size: 16px;
color: #333333;
position: relative;
padding-left: 10px;
margin-bottom: 6px;
&:before {
content: '';
position: absolute;
width: 3px;
top: 3px;
left: 0px;
height: 16px;
background: #008FFF;
}
}
/deep/ p {
line-height: 20px;
font-size: 14px;
color: #333333;
}
}
}
}
.recharge-footer {
background: #FFFFFF;
position: fixed;
width: 375px;
bottom: 0px;
padding: 0px 16px;
box-sizing: border-box;
height: 50px;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
.card-roll {
text-align: center;
flex: 1;
&-icon {
width: 26px;
height: 26px;
margin: 0px auto 2px auto;
color: #666666;
}
>div {
color: #666666;
font-size: 12px;
line-height: 14px;
}
}
.recharge-operation {
width: 234px;
height: 40px;
background: #008FFF;
border-radius: 100px;
line-height: 40px;
text-align: center;
font-size: 14px;
color: #FFFFFF;
>span {
margin-right: 10px;
}
}
}
</style>
<template>
<div class="main">
<div class="success-box">
<div class="success-img">
<van-icon name="checked" class="success-icon" v-if="status"/>
<van-icon name="warning" class="warning-icon" v-else/>
</div>
<div class="success-number">¥{{ price }}</div>
<div class="success-desc" v-if="status">订单支付成功</div>
<div class="success-desc" v-if="!status">订单支付失败</div>
<div class="success-order" v-if="status" @click="getOrder">查看订单</div>
<div class="success-order" v-if="!status" @click="getAgainPay">重新购买</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: "success",
data() {
return {
status: true,
price: '',
}
},
mounted() {
this.price = this.$route.query.price;
},
methods: {
getAgainPay() {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.go(-1)
}else {
window.vm.$router.replace({name:'equity.index'})
}
},
getOrder() {
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index')
}
}
}
</script>
<style scoped lang="scss">
.main {
.success-box {
text-align: center;
.success-icon {
font-size: 50px;
color: #19C34E;
background: #FFFFFF;
margin-top: 60px;
}
.warning-icon {
font-size: 50px;
color: #F10016;
background: #FFFFFF;
margin-top: 60px;
}
.success-number {
font-size: 24px;
color: #323232;
line-height: 42px;
font-weight: 700;
}
.success-desc {
font-weight: 700;
font-size: 16px;
color: #323232;
line-height: 22px;
margin-bottom: 100px;
}
.success-order {
margin: 0 auto;
width: 166px;
height: 40px;
line-height: 40px;
box-sizing: border-box;
background: rgba(0, 143, 255, 0.08);
border-radius: 100px;
border: 1px solid #008FFF;
font-size: 14px;
font-weight: 400;
color: #008FFF;
}
}
}
</style>
<template>
<div class="main">
<div class="input">
<div class="sprite-icon icon-card"></div>
<input
type="text"
placeholder="权益卡号或设备编码"
v-model="no"
>
</div>
<div
class="tips"
@click="jump"
>
<div class="title">常见疑问:</div>
<ul>
<li>1.如何查看您的设备编码<div class="sprite-icon icon-more"></div>
</li>
<li>2.如何查看您的权益卡号<div class="sprite-icon icon-more"></div>
</li>
</ul>
</div>
<div
:class="['btn',{'disabled':disabled}]"
@click="confirm"
>确认</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { equity } from '@r/api.js'
export default {
name: '',
data () {
return {
no: '',
disabled: true
}
},
mounted () {
if (this.isMiniprogram) wx.miniProgram.postMessage({})
},
watch: {
'no' (nelVal) {
this.disabled = nelVal.length < 1 ? true : false
}
},
methods: {
jump () {
let [href] = window.location.href.split('/#/')
let url = `${href}/#/common/explain`
this.openWindows(url, 'common.explain')
},
confirm () {
let { no } = this
if (!no) return
let target = 'activateBySn'
let params = {
sn: no
}
if (no.length == 12) {
target = 'activateByCardNo'
params.cardNo = no
delete params.sn
}
this.showLoading('激活中...')
equity[target](params).then(res => {
this.hideLoading()
let { code, message } = res
if (code == 0) {
this.dialog({
title: '提示',
message: '激活成功',
confirmButtonText: '知道了',
showCancelButton: false
}).then(() => {
if (window.__wxjs_environment === 'miniprogram') {
wx.miniProgram.navigateBack()
} else {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.push({ name: 'equity.index' })
} else {
if (this.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 1, reloadView: 'equity' }))
} else {
window.myjs.jumpNativeApp(JSON.stringify({ type: 1, reloadView: 'equity' }))
}
}
}
})
} else {
this.showToast(message)
}
})
}
}
}
</script>
<style scoped lang='scss'>
.main {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.input {
width: 100%;
display: grid;
grid-template-columns: 23px 1fr;
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;
}
}
.tips {
margin: 30px 0 0;
color: #2c2c2c;
.title {
font-size: 15px;
margin-bottom: 10px;
}
li {
font-size: 13px;
margin-bottom: 10px;
display: flex;
align-items: center;
}
}
.btn {
margin: 100px auto 0;
width: 300px;
height: 35px;
background: #2f77f3;
border-radius: 4px;
display: grid;
place-items: center;
color: #fff;
font-size: 14px;
transition: all 0.5s;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="page">
<div class="title">1、如何查看您的设备编码</div>
<div class="tips">根据您所购买的智能硬件类型的不同,设备编码所在的位置略有差异。您可以尝试在以下几个位置进行查找</div>
<ul>
<li>① 硬件本身:如后视镜、记录仪等外露式设备,可以在机身上找到设备编码,如SN:87377727372</li>
<li>② 机器包装盒:部分硬件需嵌入式安装如中控大屏,可在包装盒上找到设备编码。</li>
<li>③若以上方法都无法找到设备编码,请联系门店销售经理,广联后台运营将协助提供设备编码。</li>
</ul>
</div>
<div class="page">
<div class="title">2、如何查看您的权益卡号</div>
<div class="tips">权益卡号是无忧权益卡实体卡上的编码,用户可输入该编码领用专属权益。</div>
<ul>
<li>1、权益卡通常包含在您所购买的硬件产品的附带包装中。</li>
<li>2、绝大多数嘀嘀虎品牌及部分第三方合作品牌硬件出厂自带权益服务,若您不确认所购买的产品是否具备权益套餐,请联系具体门店销售人员。</li>
</ul>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.main {
padding: 20px;
color: #2c2c2c;
.page {
margin-bottom: 30px;
.title {
font-size: 16px;
}
.tips {
font-size: 14px;
}
li {
font-size: 12px;
}
.title,
.tips,
li {
margin-bottom: 10px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main" :class="[
showFollowAccount ? 'main-top' : ''
]">
<div class="follow-wechat-account" v-if="showFollowAccount">
<span>权益服务可通过公众号随时随地使用</span>
<button class="follow-btn" @click="followAccount">关注公众号</button>
</div>
<div class="card">
<div class="sprite-icon icon-banner">
<!-- <img src="" alt="" class="user_img"> -->
<div v-show="userInfo" class="user_img">
<img
:src="userInfo.logo"
v-if="userInfo.logo"
>
<div
v-else
class="sprite-icon icon-default-avatar"
></div>
</div>
<h2 class="title">领取无忧权益卡,臻享车生活</h2>
<span @click="receive" class="get_btn">立即领取</span>
</div>
</div>
<div class="content">
<div class="box equity_box">
<div class="bar_title"><span>用车权益</span></div>
<div class="car_content">
<div class="items">
<template v-for="(i,index) in carServiceList">
<div
class="item"
:key="index"
@click="unReceiveCar(i)"
>
<div class="icon-goods">
<img :src="i.equityIcon" alt="">
</div>
<div class="item-name text-hide">{{i.equityName}}</div>
<div class="item-des text-hide">{{i.equityDesc}}</div>
</div>
</template>
</div>
</div>
</div>
<div class="box equity_box">
<div class="bar_title"><span>更多权益</span></div>
<div class="scroll-items">
<ul class="tab_list" >
<li :class="goodsTab === index?'active':''" @click="changeGoods(index)" v-for="(item,index) in goodsServiceList" :key="index">{{item.goodsCategory}}</li>
</ul>
</div>
<div class="tab_content">
<div class="items items_5_1">
<template v-for="(i,index) in equityGoodsGroupDescDtos">
<div
class="item"
:key="index"
@click="unReceiveDialog(i)"
>
<div class="icon-goods">
<img :src="i.equityIcon" alt="">
</div>
<div class="item-name">{{i.brandName}}</div>
<div class="item-des">{{i.equityDesc}}</div>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { indexMixin } from '@/mixins'
import { equity } from '@r/api.js'
export default {
name: '',
mixins: [indexMixin],
data () {
return {
showFollowAccount: false,
params: window.location.href,
activeTab: 'drink',
userInfo: sessionStorage.getItem('GL_EQUITY_USER_INFO')?sessionStorage.getItem('GL_EQUITY_USER_INFO'):{},
}
},
mounted () {
let { sessionId, phone } = this.$store.state;
const ua = navigator.userAgent.toLowerCase()
if (sessionId) {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) return
}
}
this.showLoading()
equity.getCardInfo().then(res => {
this.hideLoading()
let { code ,data} = res
if (code == 0) {
if(data.isConcern == 0) {
this.showFollowAccount = true;
}
this.$router.replace({ name: 'equity.index' })
}
})
}
},
methods: {
receive () {
let { sessionId, phone } = JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO'))?JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO')):this.$store.state;
const ua = navigator.userAgent.toLowerCase()
if (sessionId) {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) {
this.equityLogin()
return
}
}
}
let [href] = window.location.href.split('/#/')
let url = `${href}/#/cardRoll/opening?sessionId=${sessionId}`
this.openWindows(url, 'cardRoll.opening');
} else {
this.equityLogin()
}
},
unReceiveCar(e) {
let { sessionId, phone } = JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO'))?JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO')):this.$store.state;
const ua = navigator.userAgent.toLowerCase()
if (sessionId) {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) {
this.equityLogin()
return
}
}
}
this.CarLink(e)
}else {
this.equityLogin()
}
},
unReceiveDialog(e) {
let { sessionId, phone } = JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO'))?JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO')):this.$store.state;
const ua = navigator.userAgent.toLowerCase()
if (sessionId) {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) {
this.equityLogin()
return
}
}
}
this.jumpLink(e)
}else {
this.equityLogin()
}
},
willComeDialog() {
this.showToast('即将上线,敬请期待')
}
}
}
</script>
<style lang='scss'>
@import "@a/scss/index.scss";
html,
body {
background-color: #fff;
}
.icon-goods {
width: 46px;
height: 46px;
margin-bottom: 4px;
>img {
border-radius: 50%;
}
}
.main {
padding-bottom: 73px;
&.main-top {
padding-top: 40px;
}
}
.follow-wechat-account {
box-sizing: border-box;
position: fixed;
top: 0;
padding: 0 20px;
width: 100%;
height: 40px;
line-height: 40px;
font-size: 13px;
color: #333;
background-color: #fdf6f0;
.follow-btn {
float: right;
margin-top: 8.5px;
height: 25px;
line-height: 25px;
border-radius: 100px;
padding: 0 10px;
color: #fff;
border: none;
background-color: #fd4705;
}
}
.card {
margin-bottom: 30px;
.icon-banner{
display: flex;
flex-direction: column;
align-items: center;
.user_img{
width: 50px;
height: 50px;
margin: 30px 0 10px 40px;
align-self: flex-start;
&.hide{
opacity: 0;
}
}
.title{
font-weight: 400;
font-size: 16px;
}
.get_btn{
color: #fff;
background-image: linear-gradient(90deg, #858585 0%, #555555 100%);
box-shadow: 0 2px 8px 0 rgba(46,46,46,0.30);
border-radius: 15px;
width: 130px;
height: 30px;
line-height: 30px;
margin-top: 20px;
text-align: center;
font-size: 16px;
}
}
}
.tab_content{
padding: 10px;
}
.content .box {
&.equity_box{
margin-bottom: 10px;
}
.car_content{
padding: 10px;
.items {
grid-template-columns: repeat(5, 1fr);
.item {
margin-bottom: 10px;
}
.tip{
flex: 1;
color: #9C9C9C;
font-size: 12px;
align-self: center;
}
}
}
}
.receive-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>
<template>
<div class="main marketing_page">
<div class="banner_bg">
<p class="slogan">每年最高可省<span class="price">2289</span>元</p>
<span @click="receive" class="get_btn">立即领取</span>
</div>
<div class="slogan_wrap">
<div class="sprite-icon icon-slogan1"></div>
</div>
<div class="box ">
<div class="box_3_1">
<div class="item">
<div class="sprite-icon icon-mt_gas"></div>
<p>全国314城</p>
<p>加油7折起</p>
</div>
<div class="item">
<div class="sprite-icon icon-mt_help"></div>
<p>非事故救援</p>
<p>全天候免费</p>
</div>
<div class="item">
<div class="sprite-icon icon-mt_shop_service"></div>
<p>门店服务</p>
<p>专业接待</p>
</div>
<div class="item">
<div class="sprite-icon icon-mt_customer"></div>
<p>专属客服</p>
<p>1对1为您解答</p>
</div>
<div class="item">
<div class="sprite-icon icon-mt_video"></div>
<p>视频会员</p>
<p>充值5折起</p>
</div>
<div class="item">
<div class="sprite-icon icon-mt_food"></div>
<p>饮品炸鸡</p>
<p>特惠五折起</p>
</div>
</div>
<div class="item" @click="jump">
<div class="sprite-icon icon-mt_more"></div>
<p>查看</p>
<p>更多特权</p>
</div>
</div>
<div class="slogan_wrap">
<div class="sprite-icon icon-slogan2"></div>
</div>
<div class="box">
<div class="box_2_1">
<div class="item">
<div class="sprite-icon icon-mt_drive"></div>
<div class="right_info">
<p>国际驾照</p>
<p>免费认证</p>
</div>
</div>
<div class="item">
<div class="sprite-icon icon-mt_car_price"></div>
<div class="right_info">
<p>爱车估值</p>
<p>高价拍卖</p>
</div>
</div>
<div class="item">
<div class="sprite-icon icon-mt_intel_car"></div>
<div class="right_info">
<p>智能车载</p>
<p>享品质生活</p>
</div>
</div>
<div class="item">
<div class="sprite-icon icon-mt_hope"></div>
<div class="right_info">
<p>敬请期待...</p>
</div>
</div>
</div>
</div>
<span @click="jump" class="know_btn">我知道了</span>
</div>
</template>
<script type='text/ecmascript-6'>
//import { indexMixin } from '@/mixins'
import { equity } from '@r/api.js'
export default {
name: '',
data () {
return {
}
},
mounted () {
let urlParams = window.location.href.split('/#/?')[1]
if(urlParams) {
let urlObj = {}
let urlParamsArr = urlParams.split('&')
urlParamsArr.forEach((item) => {
const [param, value] = item.split('=')
urlObj[param] = value
})
sessionStorage.setItem('URL_PARAM', JSON.stringify(urlObj))
//console.log(JSON.parse(sessionStorage.getItem('URL_PARAM')))
}
let urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM'))
if(urlObj && ('appId' in urlObj) && ('courseId' in urlObj) && ('channl' in urlObj) && ('merchantId' in urlObj) && ('fissionUser' in urlObj)) {
if(urlObj.fissionUser === 'false') {
this.showLoading()
equity.getFissionInfo({merchantId: urlObj.merchantId}).then(res => {
let { code, data } = res
this.hideLoading()
if (code == 0) {
if(data) {
if(data.presentNumber>0) {
this.openCard(urlObj)
}else{
this.showToast('赠送名额已失效,请联系门店')
this.init()
}
}
} else {
//this.showToast(message)
this.init()
}
})
}else if (urlObj.fissionUser === 'true') {
this.openCard(urlObj)
}
}else{
this.init()
}
},
methods: {
init() {
let { sessionId, phone } = this.$store.state
const ua = navigator.userAgent.toLowerCase()
if (sessionId) {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) return
}
}
equity.getCardInfo().then(res => {
let { code } = res
if (code == 0) {
this.$router.replace({ name: 'equity.index' })
}
})
}
},
openCard(data) {
this.showLoading()
equity.openCardFission({...data}).then(res => {
let { code, message } = res
this.hideLoading()
if (code == 0) {
//
} else {
this.showToast(message)
}
this.init()
})
},
receive () {
let { sessionId, phone } = this.$store.state
const ua = navigator.userAgent.toLowerCase()
if (sessionId) {
if (!this.isMiniprogram) {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (!phone) {
this.equityLogin()
return
}
}
}
let [href] = window.location.href.split('/#/')
let url = `${href}/#/cardRoll/opening?sessionId=${sessionId}`
this.openWindows(url, 'cardRoll.opening')
} else {
this.equityLogin()
}
},
jump () {
this.$router.replace({ name: 'common.index' })
}
}
}
</script>
<style lang='scss'>
html,body{
}
.main.marketing_page{
background-color: #FEFAED;
padding: 10px;
color: #2c2c2c;
.banner_bg{
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
width: 355px;
height: 160px;
font-size: 16px;
background-image: url('~@a/images/marketing_bg.png');
background-size: 355px 160px;
margin-bottom: 20px;
.slogan{
color: #C7C7C7;
.price{
color: #fff;
font-size: 20px;
margin: 0 5px;
}
}
.get_btn{
display: inline-block;
width: 238px;
height: 32px;
line-height: 32px;
color: #525252;
text-align: center;
background-image: linear-gradient(180deg, #F1C23B 0%, #FFE596 100%);
box-shadow: 0 2px 4px 0 rgba(254,228,148,0.20);
border-radius: 25px;
margin: 10px 0;
}
}
.box{
background: #FFFFFF;
border: 1px solid #F5D890;
box-shadow: 0 2px 8px 0 rgba(255,222,166,0.20);
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
.box_3_1{
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.box_2_1{
display: grid;
grid-template-columns: repeat(2, 1fr);
.item{
display: flex;
margin-left: 10px;
.right_info{
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 10px;
}
}
}
.item{
text-align: center;
margin: 10px 0;
p{
color: #797979;
font-size: 12px;
}
.sprite-icon{
display: inline-block;
}
}
}
.slogan_wrap{
text-align: center;
margin-bottom: 10px;
.sprite-icon{
display: inline-block;
}
}
.know_btn{
display: block;
height: 50px;
line-height: 50px;
color: #fff;
text-align: center;
font-size: 20px;
background-image: radial-gradient(86% 95%, #5E5E5E 0%, #2F2F2F 100%);
margin: 0 -10px -10px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<van-field
v-model="tel"
type="tel"
label="手机号"
placeholder="请输入手机号"
maxlength="11"
/>
<van-field
v-model="sms"
center
clearable
label="短信验证码"
placeholder="请输入短信验证码"
maxlength="4"
>
<template #button>
<van-button
size="small"
type="info"
@click="getSms"
:disabled="!tel || countDown"
:key="countKey"
>
{{!countDown ? '发送验证码' :`${count}秒后重新获取`}}
</van-button>
</template>
</van-field>
<div class="login-btn">
<van-button
round
block
type="info"
:disabled="!tel || !sms"
@click="login"
>提交</van-button>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { common } from '@r/api.js'
let countDownTime = null
const rex = /^[1]([3-9])[0-9]{9}$/
export default {
name: '',
data () {
return {
tel: '',
sms: '',
countDown: false,
countKey: new Date().getTime()
}
},
mounted () {
if (countDownTime) clearInterval(countDownTime)
let nowTime = Math.round(new Date() / 1000)
let count = 60
let { verificationCount, verificationFlag } = this.$store.state
if (verificationCount) {
count = verificationCount - nowTime
}
this.countDown = verificationFlag
this.count = count
this.verificationCount
if (count < 60) {
this.playCountDown()
}
},
methods: {
getSms () {
let { tel } = this
if (!rex.test(tel)) {
this.showToast('请填写正确的手机号')
return
}
this.$store.commit('setVerificationCount', Math.round(new Date() / 1000) + 60)
this.$store.commit('setVerificationFlag', true)
this.countDown = true
this.playCountDown()
common.getSms({
mobile: tel
}).then(res => {
if (res) {
let { code, message } = res
if (code != 0) {
this.showToast(message)
}
}
})
},
playCountDown () {
let {
count
} = this
let { verificationCount } = this.$store.state
countDownTime = setInterval(() => {
let nowTime = Math.round(new Date() / 1000)
if (nowTime == verificationCount) {
clearInterval(countDownTime)
this.count = 60
this.countDown = false
this.$store.commit('setVerificationFlag', false)
this.$store.commit('setVerificationCount', null)
return
}
count--
this.count = count
this.countKey = new Date().getTime()
}, 1 * 1000)
},
login () {
let { lastPath } = this.$store.state
let { tel, sms } = this
if (!rex.test(tel)) {
this.showToast('请填写正确的手机号')
return
}
this.showLoading('登陆中...')
common.smsLogin({
mobile: tel,
captcha: sms,
source: 'H5'
}).then(res => {
console.log(res)
if (res) {
let { code, data, message } = res
if (code == 0) {
sessionStorage.setItem('GL_EQUITY_USER_INFO', JSON.stringify(data))
this.$store.commit('setUserInfo', data)
window.vm.$router.replace({ name: lastPath })
} else {
this.showToast(message)
}
}
})
}
}
}
</script>
<style scoped lang='scss'>
.login-btn {
margin: 16px 20px 0;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="device-index">
<div class="sprite-icon icon-device-bg">
绑定设备SN码和车辆VIN码<br />
关联硬件设备和车辆信息
</div>
<div class="box">
<div class="step">
第一步,扫描设备SN码
</div>
<div class="sn input-item">
SN码
<div class="sn-input input">
<input
type="number"
placeholder="点击手动输入SN码"
v-model="sn"
maxlength="11"
:class="{'inputErr':snErr}"
@blur="checkInstallation('sn')"
:pattern="/^[0-9]*[1-9][0-9]*$/"
>
<div
class="err"
v-show="snErr && sn"
>{{snText}}</div>
</div>
<div
class="sprite-icon icon-device-scan"
@click="scanQRCode"
></div>
</div>
</div>
<div class="box">
<div class="step">
第二步,拍照上传车辆VIN码
</div>
<div
class="vin-box"
@click="chooseImage"
>
<template v-if="vinImg">
<img :src="vinImg">
</template>
<template v-else>
<div class="add">
<div class="sprite-icon icon-device-add"></div>
上传安装设备的车辆VIN码
<div class="tips">
注:<div>VIN码是车辆车架号,通常位于<br>汽车前挡风玻璃左/右下角</div>
</div>
</div>
</template>
</div>
<div class="vin input-item">
VIN码
<div class="vin-input input">
<input
type="text"
placeholder="点击手动输入车辆VIN码"
v-model="vin"
maxlength="17"
:class="{'inputErr':vinErr}"
@blur="checkInstallation('vin')"
@input="vinInput(vin)"
>
<div
class="err"
v-show="vinErr && vin"
>{{vinText}}</div>
</div>
</div>
</div>
<div
:class="['dev-btn',{'btn-disabled':!sn||!vin || snErr || vinErr}]"
@click="submit"
@touchstart="touchstart"
@touchend="touchend"
>提交</div>
<device-tabbar
routeName="device.list"
:tabIndex="0"
></device-tabbar>
</div>
</template>
<script type='text/ecmascript-6'>
import DeviceTabBar from '@c/DeviceTabBar'
import WxConfig from '@u/WxConfig'
const WX = new WxConfig(['scanQRCode', 'chooseImage', 'getLocation'])
import { common, device } from '@r/api'
import AMap from 'AMap'
const vin_text = '该设备码已被关联,请重新输入或扫描'
const sn_text = '该设备码已被关联,请重新输入或扫描'
export default {
name: 'index',
data () {
return {
addressInfo: {},
sn: '',
vin: '',
vinImg: '',
snErr: false,
vinErr: false,
vinText: '',
snText: ''
}
},
components: {
'device-tabbar': DeviceTabBar
},
mounted () {
this.getLocation()
},
watch: {
'sn' (n) {
n = n.replace('.', '')
this.sn = n.substring(0, 11)
this.snErr = this.sn.length < 11
},
},
methods: {
vinInput (vin) {
this.vin = vin.substring(0, 17)
let rex = /^[A-HJ-NPR-Z\d]{17}$/
this.vinErr = !rex.test(this.vin)
},
scanQRCode () {
WX.scanQRCode(1).then(res => {
let { resultStr } = res
this.sn = resultStr.split(',')[1]
this.checkInstallation('sn')
})
},
getLocation () {
WX.getLocation().then(res => {
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
let { longitude, latitude } = res
let lnglat = [longitude, latitude]
geocoder.getAddress(lnglat, (status, result) => {
let { info, regeocode: { formattedAddress } } = result
if (status === 'complete' && info === 'OK') {
// result为对应的地理位置详细信息
this.addressInfo = {
longitude,
latitude,
address: formattedAddress
}
}
})
})
})
},
checkInstallation (name) {
let value = this[name]
if (!value) return
let text = {
sn: sn_text,
vin: vin_text
}
device.checkInstallation({
[name]: value,
}).then(res => {
if (res) {
let { code, message } = res
if (code == 0) {
this[`${name}Err`] = false
} else {
this[`${name}Err`] = true
this[`${name}Text`] = text[name]
this.showToast(message)
}
} else {
this.showToast('系统异常')
}
console.log(res)
})
},
chooseImage () {
WX.chooseImage().then(res => {
let [data] = res
let { localData } = data
let suffix = ''
let imgUrl = ''
if (localData.indexOf(';') != -1) {
suffix = localData.split(';')[0]
imgUrl = localData.split('base64,')[1]
}
let type = suffix ? suffix.split('/')[1] : 'jpg'
if (!imgUrl) imgUrl = localData
if (type == 'unknown') type = 'jpg'
if (type.toLowerCase() != 'jpg' && type.toLowerCase() != 'jpeg' && type.toLowerCase() != 'png') {
this.showToast('图片格式错误')
return
}
this.showLoading('上传中...')
common.uploadImage({
file: `${type}@${imgUrl}`
}).then(img => {
console.log(img)
if (img) {
let { data } = img
this.showLoading('识别中...')
device.scanVin({ imageUrl: data }).then(vinRes => {
if (vinRes) {
console.log(vinRes)
let { code } = vinRes
if (code == 0) {
this.vinImg = img.data
this.vin = vinRes.data.vin
this.checkInstallation('vin')
} else {
this.showToast('识别失败请重试', 'close')
this.vinImg = ''
this.showInput = false
}
} else {
this.showToast('识别失败请重试', 'close')
this.vinImg = ''
this.showInput = false
}
})
} else {
this.showToast('上传失败')
this.vinImg = ''
this.showInput = false
}
})
})
},
submit () {
let { sn, vin, snErr, vinErr, addressInfo } = this
if (!sn || !vin || snErr || vinErr) return
console.log('提交')
let { openid } = this.$store.state
this.showLoading('绑定中...')
let params = {
sn,
vin,
openid,
...addressInfo
}
device.installation(params).then(res => {
if (res) {
let { code, message, data } = res
if (code == 0) {
this.dialog({
title: '提示',
message: '提交成功',
confirmButtonText: '返回',
showCancelButton: false
}).then(() => {
this.showToast(data)
Object.assign(this.$data, this.$options.data())
this.getLocation()
})
} else {
this.showToast(message)
}
} else {
this.showToast('系统异常')
}
})
}
}
}
</script>
<style scoped lang='scss'>
.device-index {
padding-bottom: 44px;
.icon-device-bg {
font-size: 16px;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
line-height: 24px;
}
.box {
background: #ffffff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
margin-bottom: 10px;
padding: 20px 16px;
.step {
padding-left: 20px;
font-size: 14px;
color: #333333;
position: relative;
margin-bottom: 20px;
&::before,
&::after {
content: "";
position: absolute;
top: 50%;
transform: translateY(-50%);
border-radius: 100%;
}
&::before {
border: 1px solid #a7d1ff;
width: 10px;
height: 10px;
left: 0;
}
&::after {
background: #4a9dff;
width: 4px;
height: 4px;
left: 4px;
}
}
.input-item {
padding: 0 21px 0 22px;
font-size: 16px;
color: #4a9dff;
display: grid;
align-items: center;
.input {
border-bottom: 1px solid #666666;
position: relative;
padding: 2px 6px;
input {
border: none;
font-size: 12px;
color: #666666;
height: 17px;
width: 100%;
font-size: 14px;
}
.inputErr {
color: #fa5151;
}
.err {
font-size: 10px;
color: #fa5151;
position: absolute;
left: 0;
bottom: -15px;
}
}
}
.sn {
grid-template-columns: 39px 1fr 20px;
&-input {
max-width: 220px;
margin: 0 20px 0 1px;
}
}
.vin {
grid-template-columns: 43px 1fr;
}
.vin-box {
width: 300px;
height: 180px;
margin: 0 auto 20px;
box-sizing: border-box;
border: 1px dotted #979797;
display: flex;
align-items: center;
justify-content: center;
.add {
font-size: 16px;
color: #999999;
text-align: center;
.icon-device-add {
margin: 0 auto 10px;
}
.tips {
margin-top: 12px;
color: #c6c6c6;
font-size: 10px;
display: flex;
align-items: flex-start;
justify-content: center;
div {
text-align: left;
}
}
}
}
}
.dev-btn {
width: 198px;
height: 32px;
display: grid;
place-items: center;
border-radius: 6px;
font-size: 14px;
color: #ffffff;
background: #4fa3ff;
margin: 20px auto;
}
.btn-disabled {
background: #d2d2d2;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main device-list">
<template v-for="(i,index) in list">
<div
:key="index"
class="items"
>
<div class="top">
<div class="time">
{{i.time}}
</div>
<div class="info">
<div class="info-box">
<div class="item">
<div class="sprite-icon icon-device-sn"></div>
SN码:
<div class="no">{{i.sn}}</div>
</div>
<div class="item">
<div class="sprite-icon icon-device-vin"></div>
VIN码:
<div class="no">{{i.vin}}</div>
</div>
</div>
<div class="sprite-icon icon-device-bind"></div>
</div>
</div>
<div class="bottom">
<div class="label">操作地址</div>
<div class="address">{{i.address}}</div>
</div>
</div>
</template>
<device-tabbar
routeName="device.index"
:tabIndex="1"
></device-tabbar>
</div>
</template>
<script type='text/ecmascript-6'>
import DeviceTabBar from '@c/DeviceTabBar'
import { device } from '@r/api'
export default {
name: 'list',
data () {
return {
list: []
}
},
components: {
'device-tabbar': DeviceTabBar
},
mounted () {
this.showLoading()
device.getInstallationList().then(res => {
console.log(res)
if (res) {
let { code, data, message } = res
if (code == 0) {
data.map(e => {
e.time = new Date(e.updatedDate).format('yyyy.MM.dd hh:mm:ss')
})
this.list = data
} else {
this.showToast(message)
}
} else {
this.showToast('系统异常')
}
})
},
methods: {
}
}
</script>
<style lang='scss'>
html,
body {
background-color: rgb(247, 247, 247);
}
.device-list {
padding-bottom: 60px;
.items {
background: #ffffff;
border-bottom: 0.2px solid #c8c8c8;
border-top: 0.2px solid #c8c8c8;
margin-top: 16px;
position: relative;
&::before {
position: absolute;
content: "";
background: #ededed;
height: 100%;
width: 2px;
left: 66px;
top: 0;
z-index: 2;
}
.top {
display: grid;
grid-template-columns: 68px 1fr;
color: #333333;
position: relative;
&::before {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 62px;
background: #ffffff;
border: 2px solid #ededed;
content: "";
width: 10px;
height: 10px;
border-radius: 100%;
z-index: 3;
box-sizing: border-box;
}
.time,
.info {
display: flex;
align-items: center;
}
.time {
font-size: 10px;
text-align: center;
line-height: 14px;
}
.info {
font-size: 14px;
display: grid;
padding: 16px 12px;
grid-template-columns: 229px 54px;
&-box {
.item {
display: flex;
align-items: center;
.sprite-icon {
margin-right: 4px;
}
.no {
word-break: break-all;
max-width: 152px;
margin-left: 6px;
}
}
.item:first-of-type {
margin-bottom: 8px;
}
}
}
}
.bottom {
border-top: 1.5px solid #ededed;
display: grid;
grid-template-columns: 68px 1fr;
min-height: 22.5px;
font-size: 10px;
color: #999999;
.label,
.address {
display: flex;
align-items: center;
justify-content: center;
}
.address {
padding: 3.5px 12px;
justify-content: flex-start;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="box">
<div class="header">
</div>
<div class="body">
<div class="type-1-body">
<div class="title-sign">
权益说明
</div>
<div class="content-ul">
<p>1、发生碰撞事故后,车主须返回指定经销处维修方可享受补偿,维修质量由承修经销商负责。</p>
<p>2、必须投保商业车损险,且出险后车损险定损金额须达到起赔点。</p>
<p>3、发生碰撞事故,经商业车损险承保公司核定属于保险事故,启动车损险赔付后方可申请补偿(不区分事故责任归属)。</p>
</div>
</div>
</div>
</div>
<div
class="phone btn"
@click="makePhoneCall('400-6123-886')"
>
<div class="icon-equity-phone"><van-icon name="phone-o" class="icon-phone"/>服务热线 400-6123-886</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'loss',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
position: absolute;
min-height: 100%;
width: 100%;
background: #068589;
.header {
width: 100%;
height: 250px;
background-image: url("~@a/images/equity/colltit.png");
background-size: 100% 100%;
> 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 {
font-size: 12px;
color: #333;
.type-1-body {
padding: 16px;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 2px 4px 0 rgba(255,255,255,0.50);
border-radius: 8px;
width: 335px;
margin: 10px auto 60px auto;
position: relative;
.title-sign {
position: absolute;
left: 50%;
color: #FFFFFF;
margin-left: -85.5px;
top: -15px;
width: 171px;
height: 30px;
line-height: 30px;
text-align: center;
background-image: url("~@a/images/equity/coll.png");
background-size: 100% 100%;
}
}
> div {
.title {
font-size: 16px;
color: #6a6a6a;
font-weight: 700;
position: relative;
text-align: center;
span {
position: relative;
&::after {
content: "";
position: absolute;
width: 100%;
height: 4px;
background-color: #ffc775;
bottom: 3px;
left: 0;
z-index: -1;
}
}
}
.content-ul {
font-size: 12px;
color: #005254;
p {
margin-top: 20px;
}
}
.content {
margin: 14px 0 8px;
line-height: 18px;
font-size: 12px;
color: #4C4C4C;
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: #4C4C4C;
font-size: 12px;
}
}
}
}
.btn {
position: fixed;
width: 100%;
height: 50px;
bottom: 0px;
background: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
.icon-equity-phone {
margin: 3px auto;
background: #008FFF;
color: #FFFFFF;
text-align: center;
width: 343px;
height: 44px;
line-height: 44px;
border-radius: 20px;
.icon-phone {
margin-right: 8px;
font-size: 20px;
vertical-align: middle;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="box">
<div class="header">
</div>
<div class="body">
<div class="type-1-body">
<div class="title-sign">
权益说明
</div>
<div class="content">
服务范围:在正确安装并使用深圳广联赛讯股份有限公司提供的“车载智能终端”产品情况下,全车被盗抢,经商业车损险公司赔偿后,赔偿车主由于车辆被盗导致的相关损失,包括
</div>
<div class="content-ul">
<p>— 商业车损险赔偿免赔额部分;</p>
<p>— 车辆购置税;</p>
<p>— 重置车辆的登记费用;</p>
<p>— 为减损要求使用其他代步车辆产生的费用损失;</p>
<p>— 车辆盗抢过程中产生的合理维修费用;</p>
<p> — 补偿被盗抢车辆的加装损失;</p>
<p> — 随车行李损失;</p>
</div>
<div class="content">
服务区域:全国(除港澳台)
</div>
<div class="tips">
<p>除外责任:未投保商业车损险或商业车损险承保公司拒赔或者未予理赔的;</p>
<p>服务须知:在发生服务责任范围内事故后的24小时内向事故当地公安机关报案,保留现场并同时通知深圳广联赛讯股份有限公司,并全面告知车辆的相关资料</p>
</div>
</div>
</div>
</div>
<div
class="phone btn"
@click="makePhoneCall('400-6123-886')"
>
<div class="icon-equity-phone"><van-icon name="phone-o" class="icon-phone"/>服务热线 400-6123-886</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'loss',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
position: absolute;
min-height: 100%;
width: 100%;
background: #2C09A3;
.header {
width: 100%;
height: 250px;
background-image: url("~@a/images/equity/pens.png");
background-size: 100% 100%;
> 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 {
font-size: 12px;
color: #333;
.type-1-body {
padding: 16px;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 2px 4px 0 rgba(255,255,255,0.50);
border-radius: 8px;
width: 335px;
margin: 10px auto 70px auto;
position: relative;
.title-sign {
position: absolute;
left: 50%;
color: #FFFFFF;
margin-left: -85.5px;
top: -15px;
width: 171px;
height: 30px;
line-height: 30px;
text-align: center;
background-image: url("~@a/images/equity/penstit.png");
background-size: 100% 100%;
}
}
> div {
.title {
font-size: 16px;
color: #6a6a6a;
font-weight: 700;
position: relative;
text-align: center;
span {
position: relative;
&::after {
content: "";
position: absolute;
width: 100%;
height: 4px;
background-color: #ffc775;
bottom: 3px;
left: 0;
z-index: -1;
}
}
}
.content-ul {
width: 220px;
margin: 0 auto;
font-size: 12px;
color: #4C4C4C;
line-height: 20px;
}
.content {
margin: 14px 0 8px;
line-height: 18px;
font-size: 12px;
color: #4C4C4C;
.item {
display: grid;
grid-template-columns: 30px 1fr;
gap: 0 10px;
align-items: center;
margin-bottom: 18px;
}
}
.tips {
color: #4C4C4C;
font-size: 12px;
}
}
}
}
.btn {
position: fixed;
width: 100%;
height: 50px;
bottom: 0px;
background: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
.icon-equity-phone {
margin: 3px auto;
background: #008FFF;
color: #FFFFFF;
text-align: center;
width: 343px;
height: 44px;
line-height: 44px;
border-radius: 20px;
.icon-phone {
margin-right: 8px;
font-size: 20px;
vertical-align: middle;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main" :class="[
showFollowAccount ? 'main-top' : ''
]">
<div class="follow-wechat-account" v-if="showFollowAccount">
<span>权益服务可通过公众号随时随地使用</span>
<button class="follow-btn" @click="followAccount">关注公众号</button>
</div>
<div class="card-box">
<div class="sprite-icon icon-banner">
<div class="card_num">
<span class="num_no">NO:{{userInfo.cardNo}}</span>
<span class="num_date">到期:{{userInfo.time}}</span>
</div>
<div class="card_user">
<div class="user_info">
<img
:src="userInfo.logo"
v-if="userInfo.logo"
class="user_img"
>
<div
v-else
class="sprite-icon icon-default-avatar"
></div>
<span class="user_name">{{nickName?nickName:userInfo.memberName}}</span>
</div>
<div class="user_func">
<span class="user_func_link" @click="jumpOrder">权益订单</span>
<span class="user_func_link" @click="jumpJiangli">查看奖励</span>
</div>
</div>
</div>
</div>
<div class="card-box box_between">
<div class="invite_box invite_bg" @click="jumpInvite">
<span class="invite_btn">我要分享</span>
<p>享推广佣金奖励</p>
</div>
<!-- <div class="invite_box openshop_bg" @click="jumpOpenShop">-->
<!-- <span class="invite_btn" >我要开店</span>-->
<!-- <p>促活拉新轻松享</p>-->
<!-- </div>-->
</div>
<div class="content">
<div class="box equity_box">
<div class="bar_title"><span>用车权益</span></div>
<div class="car_content">
<div class="items">
<template v-for="(i,index) in carServiceList">
<div
class="item"
:key="index"
@click="CarLink(i)"
>
<div class="icon-goods">
<img :src="i.equityIcon" alt="">
</div>
<div class="item-name text-hide">{{i.equityName}}</div>
<div class="item-des text-hide">{{i.equityDesc}}</div>
</div>
</template>
</div>
</div>
</div>
<div class="box equity_box">
<div class="bar_title"><span>更多权益</span></div>
<div class="scroll-items">
<ul class="tab_list" >
<li :class="goodsTab === index?'active':''" @click="changeGoods(index)" v-for="(item,index) in goodsServiceList" :key="index">{{item.goodsCategory}}</li>
</ul>
</div>
<div class="tab_content">
<div class="items items_5_1">
<template v-for="(i,index) in equityGoodsGroupDescDtos">
<div
class="item"
:key="index"
@click="jumpLink(i)"
>
<div class="icon-goods">
<img :src="i.equityIcon" alt="">
</div>
<div class="item-name">{{i.equityName}}</div>
<div class="item-des">{{i.equityDesc}}</div>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { indexMixin } from '@/mixins'
import { equity } from '@r/api.js'
export default {
name: 'index',
data () {
return {
userInfo: {},
nickName: sessionStorage.getItem('GL_EQUITY_USER_INFO')?JSON.parse(sessionStorage.getItem('GL_EQUITY_USER_INFO')).nickName:'',
showFollowAccount: false,
icon: require(`@a/images/notice.png`),
activeTab: 'drink',
inviteUrl: '',
jiangliUrl: '',
orderCount: 0,
}
},
mixins: [indexMixin],
mounted () {
this.showLoading()
equity.getCardInfo().then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
if(data.isConcern == 0) {
this.showFollowAccount = true;
}
data.time = new Date(data.validitDate).format('yyyy-MM-dd');
this.userInfo = data
} else {
this.showToast(message)
}
})
const urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM'))
let URLParams = {}
if(urlObj && urlObj.merchantId) {
URLParams.merchantId = urlObj.merchantId
}
equity.getFissionInfo(URLParams).then(res => {
let { code, data } = res
this.hideLoading()
if (code == 0) {
if(data) {
this.inviteUrl = data.posterUrl
this.jiangliUrl = data.commissionUrl
}
}
})
// equity.getOrderCount().then(res => {
// let { code, data, message } = res
// if (code == 0) {
// this.orderCount = data
// } else {
// this.showToast(message)
// }
// })
},
methods: {
followAccount() {
window.location.href = process.env.VUE_APP_WECHAT_ACCOUNT;
},
jumpHotel () {
let url = 'http://m.s11.cn/tehui/sz/?order_cust_id=4892038'
this.openWindows(url)
},
jumpOrder() {
let { sessionId } = this.$store.state;
let [href] = window.location.href.split('/#/');
let url = `${href}/#/cardRoll/index?sessionId=${sessionId}`;
this.openWindows(url, 'cardRoll.index')
},
jumpOpenShop() {
this.openWindows('https://www.wjx.cn/m/89882107.aspx')
},
jumpJiangli() {
if(this.jiangliUrl) {
this.openWindows(this.jiangliUrl)
}else {
this.showToast('尚未配置活动参数')
}
},
jumpInvite() {
if(this.inviteUrl) {
this.openWindows(this.inviteUrl)
}else {
this.showToast('尚未配置活动参数')
}
},
willComeDialog() {
this.showToast('即将上线,敬请期待')
}
}
}
</script>
<style lang='scss'>
@import "@a/scss/index.scss";
html,
body {
background-color: #fff;
}
.icon-goods {
width: 46px;
height: 46px;
margin-bottom: 4px;
>img {
border-radius: 50%;
}
}
.main {
&.main-top {
padding-top: 40px;
}
.follow-wechat-account {
box-sizing: border-box;
position: fixed;
top: 0;
padding: 0 20px;
width: 100%;
height: 40px;
line-height: 40px;
font-size: 13px;
color: #333;
background-color: #fdf6f0;
.follow-btn {
float: right;
margin-top: 8.5px;
height: 25px;
line-height: 25px;
border-radius: 100px;
padding: 0 10px;
color: #fff;
border: none;
background-color: #fd4705;
}
}
.card-box {
padding: 20px 0 0;
&:first-child{
padding-top: 0;
}
.card {
margin: 0 auto;
position: relative;
font-size: 14px;
color: #ffffff;
padding-left: 24px;
box-sizing: border-box;
&-name {
display: flex;
align-items: center;
height: 70px;
.icon-vip {
margin-right: 8px;
}
}
&-user {
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;
}
}
}
&-No {
position: absolute;
bottom: 33px;
left: 24px;
font-size: 16px;
}
}
.card_num{
padding: 30px 40px 10px;
display: flex;
justify-content: space-between;
}
.card_user{
padding: 5px 40px 10px;
display: flex;
.user_info{
display: flex;
align-items: center;
flex: 1;
align-self: flex-start;
.user_img{
width: 50px;
height: 50px;
}
.user_name{
padding: 0 10px;
font-size: 16px;
flex: 1;
word-break: break-word;
}
}
.user_func{
display: flex;
flex-direction: column;
.user_func_link{
font-size: 12px;
background: #DCA700;
color: #ffffff;
border-radius: 12px;
padding: 3px 10px;
margin: 10px;
&.hide{
visibility: hidden
}
}
}
}
.invite_box{
width: 350px;
height: 135px;
background-size: 100% 100%;
box-shadow: 0 2px 8px 0 rgba(0,55,170,0.09);
.invite_btn{
display: inline-block;
border: 1px solid #6A0000;
padding: 2px 8px;
border-radius: 14px;
color: #6A0000;
margin: 20px 0 10px 10px;
&.hide{
visibility: hidden;
}
}
&>p{
color: #B00000;
font-size: 12px;
margin: 0px 0 0 10px;
}
&.invite_bg{
background-image: url('~@a/images/invite_bg_lg.png');
}
&.openshop_bg{
background-image: url('~@a/images/openshop_bg.png');
.invite_btn{
border-color: #002D4E;
color: #002D4E;
}
&>p{
color: #004F8A;
}
}
}
&.box_between{
display: flex;
justify-content: space-between;
padding: 20px;
}
}
}
.tab_content{
padding: 10px;
.icon-goods {
width: 46px;
height: 46px;
margin-bottom: 4px;
}
}
.content .box {
&.equity_box{
margin-bottom: 10px;
}
.car_content{
padding: 10px;
.items {
grid-template-columns: repeat(5, 1fr);
.item {
margin-bottom: 10px;
}
.tip{
flex: 1;
color: #9C9C9C;
font-size: 12px;
align-self: center;
}
}
}
}
</style>
<template>
<div class="main">
<div class="box">
<div class="header">
</div>
<div class="body">
<div class="type-1-body">
<div class="title-sign">
权益说明
</div>
<div class="content">
服务范围:在正确安装并使用深圳广联赛讯股份有限公司提供的“车载智能终端”产品情况下,签订整车全损无忧合同,赔偿标准包含:
</div>
<div class="content-ul">
<div class="content-li">
<img src="@a/images/equity/car1.png" alt="">
<div class="content-desc">车辆折旧费补足</div>
</div>
<div class="content-li">
<img src="@a/images/equity/car2.png" alt="">
<div class="content-desc">车辆购置税补足</div>
</div>
<div class="content-li">
<img src="@a/images/equity/car3.png" alt="">
<div class="content-desc">车辆登记费补足</div>
</div>
</div>
<div class="content">
服务区域:全国(除港澳台)
</div>
<div class="tips">服务须知:在发生保险事故后的24小时内向保险公司报案,保留现场并同时通知经销商,并全面告知出险车辆的相关资料</div>
</div>
</div>
</div>
<div
class="phone btn"
@click="makePhoneCall('400-6123-886')"
>
<div class="icon-equity-phone"><van-icon name="phone-o" class="icon-phone"/>服务热线 400-6123-886</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'loss',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
position: absolute;
min-height: 100%;
width: 100%;
background: #3F87FF;
.header {
width: 100%;
height: 220px;
background-image: url("~@a/images/equity/carbg.png");
background-size: 100% 100%;
> 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 {
font-size: 12px;
color: #333;
.type-1-body {
padding: 16px;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 2px 4px 0 rgba(255,255,255,0.50);
border-radius: 8px;
width: 335px;
margin: 10px auto 60px auto;
position: relative;
.title-sign {
position: absolute;
left: 50%;
color: #FFFFFF;
margin-left: -85.5px;
top: -15px;
width: 171px;
height: 30px;
line-height: 30px;
text-align: center;
background-image: url("~@a/images/equity/cartit.png");
background-size: 100% 100%;
}
}
> div {
.title {
font-size: 16px;
color: #6a6a6a;
font-weight: 700;
position: relative;
text-align: center;
span {
position: relative;
&::after {
content: "";
position: absolute;
width: 100%;
height: 4px;
background-color: #ffc775;
bottom: 3px;
left: 0;
z-index: -1;
}
}
}
.content-ul {
display: flex;
justify-content: space-around;
font-size: 12px;
color: #EF732C;
margin: 20px 0px;
.content-li {
text-align: center;
line-height: 30px;
img {
width: 60px;
height: 60px;
}
}
}
.content {
margin: 14px 0 8px;
line-height: 18px;
font-size: 12px;
color: #4C4C4C;
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: #4C4C4C;
font-size: 12px;
}
}
}
}
.btn {
position: fixed;
width: 100%;
height: 50px;
bottom: 0px;
background: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
.icon-equity-phone {
margin: 3px auto;
background: #008FFF;
color: #FFFFFF;
text-align: center;
width: 343px;
height: 44px;
line-height: 44px;
border-radius: 20px;
.icon-phone {
margin-right: 8px;
font-size: 20px;
vertical-align: middle;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<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>
<p>7、<span>全国救援电话:4008060999转5号键</span></p>
</div>
<div class="tips">注:</div>
<div class="tips">1、本服务不承接事故类救援,请在需要时联系您投保的车辆商业险的保险公司协助处理。</div>
<div class="tips">2、道路救援(不含高速)50公里内免费(非碰撞、非营运车辆),超过9元/公里。</div>
</div>
</div>
</div>
<div
class="phone btn"
@click="makePhoneCall('4008060999')"
>
<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 30px 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>
<template>
<div class="main">
<div class="box">
<div class="header">
</div>
<div class="body">
<div class="type-1-body">
<div class="title-sign">
什么是轮胎保障?
</div>
<div class="content-ul">
<p>轮胎在正常使用过程中由于非人为因素导致轮胎无法继续使用,对轮胎的合理置换费用进行补偿。</p>
</div>
</div>
<div class="type-1-body">
<div class="title-sign">
补偿标准
</div>
<div class="content-ul">
<p>1、自新车购买之日起一年内补偿轮胎销售价格的100%。</p>
<p>2、每条轮胎限补偿一次,每辆车最多申请两次补偿,单车最高补偿限额为5000元。</p>
</div>
</div>
</div>
</div>
<div
class="phone btn"
@click="makePhoneCall('400-6123-886')"
>
<div class="icon-equity-phone"><van-icon name="phone-o" class="icon-phone"/>服务热线 400-6123-886</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'loss',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
position: absolute;
min-height: 100%;
width: 100%;
background: #FF862C;
.header {
width: 100%;
height: 250px;
background-image: url("~@a/images/equity/tyre.png");
background-size: 100% 100%;
> 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 {
font-size: 12px;
color: #333;
margin: 10px 0px 50px 0px;
.type-1-body {
padding: 16px;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 2px 4px 0 rgba(255,255,255,0.50);
border-radius: 8px;
width: 335px;
margin: 30px auto;
position: relative;
.title-sign {
position: absolute;
left: 50%;
color: #FFFFFF;
margin-left: -85.5px;
top: -15px;
width: 171px;
height: 30px;
line-height: 30px;
text-align: center;
background-image: url("~@a/images/equity/tyretit.png");
background-size: 100% 100%;
}
}
> div {
.title {
font-size: 16px;
color: #6a6a6a;
font-weight: 700;
position: relative;
text-align: center;
span {
position: relative;
&::after {
content: "";
position: absolute;
width: 100%;
height: 4px;
background-color: #ffc775;
bottom: 3px;
left: 0;
z-index: -1;
}
}
}
.content-ul {
font-size: 12px;
color: #4C4C4C;
p {
margin-top: 20px;
}
}
.content {
margin: 14px 0 8px;
line-height: 18px;
font-size: 12px;
color: #4C4C4C;
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: #4C4C4C;
font-size: 12px;
}
}
}
}
.btn {
position: fixed;
width: 100%;
height: 50px;
bottom: 0px;
background: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
.icon-equity-phone {
margin: 3px auto;
background: #008FFF;
color: #FFFFFF;
text-align: center;
width: 343px;
height: 44px;
line-height: 44px;
border-radius: 20px;
.icon-phone {
margin-right: 8px;
font-size: 20px;
vertical-align: middle;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main">
<div class="box" id="mapContainer">
<div class="de-header">
<img :src="detailInfo.gasLogoBig" alt="">
</div>
<div class="box-detail">
<div class="de-desc">
<div class="de-desc-title">{{ detailInfo.gasName }}</div>
<div class="de-desc-price">
<span>¥{{detailInfo.priceYfq}}/升</span>
<span class="line-through">国标价¥{{ detailInfo.priceOfficial }}</span>
<span>每升优惠{{ detailInfo.priceReduced }}元</span>
</div>
<div class="de-desc-select" v-if="detailInfo.isInvoice">站内开票</div>
<div class="de-desc-localtion">
<div class="text-hide">{{ detailInfo.gasAddress }}</div>
<div @click="openLocation(detailInfo)"><img src="@a/images/navigation.png" alt="">距离{{distance}}km</div>
</div>
</div>
<div class="de-select">
<div class="select-item-title">选择油号</div>
<div class="select-item-panel">
<div class="select-item" :class="{'checked':oilSnoi == item.oilNo}" v-for="(item,index) in equityOilNoDTOList" :key="index" @click="changeOilSno(item.oilNo)">{{item.oilName}}</div>
</div>
<div class="select-item-title">选择油枪</div>
<div class="select-item-panel">
<div class="select-item" :class="{'checked':oilSuni == item}" v-for="(item,index) in gunNos" :key="index" @click="changeOilSun(item)">{{item}}</div>
</div>
</div>
<div class="de-explain">
<div class="de-explain-title">重要说明:</div>
<p>1、请先加油后下单,即您到站后,与工作人员确认油号、枪号后再付款。</p>
<p>2、请勿先付款后加油。若您已先下单付款,请于24小时内到加油站完成加油;若您48小时内未完成加油,请及时发起退单;逾期退单可能会退单失败。</p>
</div>
</div>
<div class="de-btn-p">
<div class="de-btn" @click="oilPay" v-if="isOpen">下一步</div>
<div class="de-btn" v-else @click="jumpOpening">去开通权益</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import WxConfig from "@u/WxConfig";
import {oilStation,equity} from "@r/api";
const WX = new WxConfig([ 'openLocation'])
export default {
name: "detail",
data() {
return {
isOpen: '',
oilSnoi: null,
oilSuni: null,
detailInfo: {},
gunNos: [],
equityOilNoDTOList: [],
oilId: '',
oilNo: '',
longitude: '',
latitude: '',
distance: 0
}
},
mounted() {
let {oilId,oilNo,longitude,latitude,distance} = this.$route.query;
this.oilId = oilId;
this.oilNo = oilNo;
this.oilSnoi = oilNo;
this.longitude = longitude;
this.latitude = latitude;
this.distance = distance;
this.getOilDetail();
this.getCardInfo();
},
methods: {
jumpOpening() {
window.vm.$router.push({ name: 'cardRoll.opening',query: {payStatus:1} })
},
getCardInfo() {
equity.getCardInfo().then(res => {
let { code } = res;
if (code == 0) {
this.isOpen = 1;
} else {
this.isOpen = 0;
}
})
},
getOilDetail() {
this.showLoading();
let para = {
oilId: this.oilId,
oilNo: this.oilNo,
longitude: this.longitude,
latitude: this.latitude,
}
oilStation.getStationDetail(para).then(res => {
let { code, data, message } = res
if (code == 0) {
this.detailInfo = data;
this.gunNos = data.gunNos;
this.equityOilNoDTOList = data.equityOilNoDTOList;
} else {
this.showToast(message)
}
this.hideLoading()
})
},
openLocation(val) {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(res => {
console.log(res)
})
}
},
changeOilSno(item) {
if(this.oilSnoi == item) {
return
}
this.oilSnoi = item;
this.oilNo = item;
this.oilSuni = null;
this.getOilDetail();
},
changeOilSun(item) {
this.oilSuni = item;
},
oilPay() {
let {oilId} = this.$route.query
if (this.oilSnoi == null) {
this.showToast('请选择油号')
return
}
if (this.oilSuni == null) {
this.showToast('请选择油枪')
return
}
let para = {
oilId,
oilNo: this.oilSnoi,
gunNo: this.oilSuni,
}
this.showLoading();
let jumpUrl;
const ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
jumpUrl = 'getStationPayUrl'
} else {
jumpUrl = 'getStationAppPayUrl'
}
oilStation[jumpUrl](para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.openWindows(data.url)
} else {
this.showToast(message)
}
})
}
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
background: #f2f2f2;
position: absolute;
min-height: 100%;
width: 100%;
overflow-x: hidden;
box-sizing: border-box;
>.de-header {
img {
width: 375px;
height: 185px;
}
}
.box-detail {
position: absolute;
top: 105px;
padding: 15px;
}
.de-desc {
padding: 15px;
border-radius: 8px;
background: #FFFFFF;
.de-desc-title {
font-size: 14px;
color: #333333;
line-height: 30px;
}
.de-desc-price {
font-size: 14px;
color: #FE6B00;
>span {
margin-right: 10px;
&:nth-child(1) {
}
&:nth-child(2) {
font-size: 10px;
color: #999999;
margin-right: 50px;
}
&:nth-child(3) {
}
}
}
>.de-desc-select {
display: inline-block;
background: #FE6000;
border-radius: 16px;
color: #FFFFFF;
font-size: 10px;
padding: 2px 5px;
margin: 10px 0px 5px 0px;
}
>.de-desc-localtion {
margin-top: 5px;
display: flex;
justify-content: space-between;
font-size: 12px;
color: #333333;
img {
width: 14px;
height: 14px;
margin-right: 3px;
}
}
}
.de-select {
padding: 15px;
margin-top: 10px;
border-radius: 6px;
background: #FFFFFF;
>.select-item-title {
font-size: 14px;
color: #4C4C4C;
}
>.select-item-panel {
margin-top: 12px;
display: flex;
flex-wrap: wrap;
>.select-item {
width: 40px;
height: 20px;
margin-bottom: 15px;
margin-right: 20px;
text-align: center;
border: 1px solid #7E7E7E;
border-radius: 4px;
box-sizing: border-box;
line-height: 20px;
font-size: 12px;
color: #777777;
&.checked {
background: #FE6000;
color: #FFFFFF;
border: none;
}
}
}
}
.de-explain {
padding: 15px;
border-radius: 8px;
margin-top: 10px;
background: #FFFFFF;
margin-bottom: 50px;
>.de-explain-title {
line-height: 30px;
font-size: 14px;
color: #565656;
}
>p {
line-height: 20px;
margin-top: 6px;
font-size: 14px;
color: #666666;
}
}
.de-btn-p {
position: fixed;
width: 100%;
height: 50px;
bottom: 0px;
background: #FFFFFF;
.de-btn {
margin: 3px auto;
background: #008FFF;
color: #FFFFFF;
text-align: center;
width: 343px;
height: 44px;
line-height: 44px;
border-radius: 20px;
}
}
}
}
</style>
<template>
<div class="main">
<div class="box" id="mapContainer">
<div class="box-nav">
<div class="nav-address" @click="jumpLocation">
<span><van-icon name="location" class="location-icon"/></span>
<span class="van-ellipsis">{{addressInfo.address}}</span>
</div>
<div class="nav-select">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item :title="oilName" ref="vanItem">
<div class="oil-select">
<div class="oil-gasoline-t">汽油</div>
<div class="select-item-panel">
<div class="select-item" :class="{'checked':oilNo == item.oilNo}" v-for="(item,index) in gasolineSno" :key="index" @click="changeOilNo(item.oilNo,item.oilName)">{{item.oilName}}</div>
</div>
</div>
<div class="oil-select">
<div class="oil-gasoline-t">柴油</div>
<div class="select-item-panel">
<div class="select-item" :class="{'checked':oilNo == item.oilNo}" v-for="(item,index) in dieselSno" :key="index" @click="changeOilNo(item.oilNo,item.oilName)">{{item.oilName}}</div>
</div>
</div>
</van-dropdown-item>
<van-dropdown-item v-model="sortType" :options="option2" @change="change"/>
</van-dropdown-menu>
</div>
</div>
<van-list
v-model="loading"
:finished="finished"
@load="onLoad"
@offset="300"
v-if="oilList.length >0"
>
<div class="oil-list-panel">
<div class="oil-list-box" v-for="(item,index) in oilList" :key="index" @click="jumpDetail(item)">
<div class="oil-list-h">
<div class="oil-list-img">
<img :src="item.gasLogoSmall" alt="">
</div>
<div class="oil-list-desc">
<div class="oil-desc-t1 text-hide">{{ item.gasName }}</div>
<div class="oil-desc-t2">
<span>¥{{item.priceYfq}}/升</span>
<span>国标价¥{{ item.priceOfficial }}/升</span>
</div>
<div class="oil-desc-t3">每升优惠 {{ item.priceReduced }} 元</div>
</div>
</div>
<div class="oil-list-f">
<span class="text-hide"><van-icon name="location" class="location-icon"/>{{ item.gasAddress }}</span>
<div class="list-f-distance">
距离:{{item.distance}}km <div @click.stop="openLocation(item)" class="navigation-btn"><img src="@a/images/navigation.png" alt="">导航</div>
</div>
</div>
</div>
</div>
</van-list>
<van-empty description="无数据" v-if="oilList.length ==0"/>
<div class="location-his" @click="jumpRecord">
<img src="@a/images/oil.png" alt="">
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import {oilStation} from "@r/api";
import WxConfig from '@u/WxConfig'
const WX = new WxConfig([ 'openLocation', 'getLocation'])
import AMap from 'AMap'
export default {
name: "index",
data() {
return {
oilNo: '92',
oilName: '92#',
oilNoList:{},
sortType: '0',
addressInfo: {},
option2: [
{ text: '距离优先', value: '0' },
{ text: '价格优先', value: '1' },
],
oilNumber: 0,
gasolineSno: [],
dieselSno: [],
loading: false,
finished: false,
pageNum: 1,
pageSize: 10,
oilList: []
}
},
mounted() {
this.listeningBack();
this.getOilNoList();
let longitude,latitude;
if(this.$store.state.address.longitude) {
longitude = this.$store.state.address.longitude;
latitude = this.$store.state.address.latitude;
}
if(longitude) {
this.mapChange({ longitude, latitude })
}else {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.getLocation();
}else {
this.getMapLocation()
}
}
},
methods:{
listeningBack() {
const path = window.vm.$store.state.prevPath
window.onpopstate = null;
window.onpopstate = function() {
window.onpopstate = null;
history.pushState({}, null, window.location.href);
if(path == 'oilStation.location' || path == 'oilStation.detail' || path == 'oilStation.record') {
window.vm.$router.replace({name:window.vm.$store.state.prevPath})
if(sessionStorage.getItem('common') == 1) {
window.vm.$router.replace({name:'equity.index'})
}else {
window.vm.$router.replace({name:'common.index'})
}
}
}
},
mapChange(e) {
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
let { longitude, latitude } = e;
let lnglat = [longitude, latitude];
geocoder.getAddress(lnglat, (status, result) => {
let { info, regeocode: { formattedAddress,addressComponent:{adcode} } } = result
if (status === 'complete' && info === 'OK') {
// result为对应的地理位置详细信息
this.addressInfo = {
longitude,
latitude,
cityCode: adcode,
address: formattedAddress
}
this.getStationList();
this.$store.commit('setAddress',this.addressInfo)
}
})
})
},
getMapLocation() {
let self = this;
AMap.plugin('AMap.Geolocation', function () {
var geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位,默认:5s
buttonPosition: 'RB', //定位按钮的停靠位置
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
zoomToAccuracy: true, //定位成功后是否自动调整地图视野到定位点
})
geolocation.getCurrentPosition(function (status, result) {
if (status == 'complete') {
self.addressInfo = {
longitude: result.position.lng,
latitude: result.position.lat,
address: result.formattedAddress,
cityCode: result.addressComponent.adcode,
}
self.$store.commit('setAddress',self.addressInfo)
self.getStationList();
} else {
self.showToast('获取定位失败');
}
})
})
},
//定位
getLocation() {
WX.getLocation().then(res => {
this.mapChange(res)
})
},
//获取油号
getOilNoList() {
this.gasolineSno = [];
this.dieselSno = [];
let para = {
oilId: ''
}
oilStation.getOilNoList(para).then(res => {
let { code, data, message } = res
if (code == 0) {
for(let i in data) {
if(data[i].oilType == 1) {
this.gasolineSno.push({oilName: data[i].oilName,oilNo: data[i].oilNo})
}
if(data[i].oilType == 2) {
this.dieselSno.push({oilName: data[i].oilName,oilNo: data[i].oilNo})
}
}
} else {
this.showToast(message)
}
})
},
//获取油站
getStationList() {
this.showLoading();
let {longitude, latitude, cityCode}= this.addressInfo;
let para = {
oilNo: this.oilNo,
sortType: this.sortType,
pageNum: this.pageNum,
pageSize: this.pageSize,
longitude,
latitude,
cityCode,
};
oilStation.getStationList(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.oilList = this.pageNum == 1?data:this.oilList.concat(data);
this.loading = false;
if (this.oilList.length%this.pageSize != 0 || (data.length == 0 && this.oilList.length !=0)) this.finished = true
} else {
this.showToast(message)
}
})
},
onLoad() {
if (this.oilList.length != 0 && this.oilList.length % this.pageSize == 0) {
this.pageNum = this.pageNum + 1
this.getStationList()
}
},
//导航
openLocation(val) {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(res => {
console.log(res)
})
}
},
//更新定位
jumpLocation() {
window.vm.$router.push({ name: 'oilStation.location'})
},
//加油记录
jumpRecord() {
window.vm.$router.push({ name: 'oilStation.record' })
},
//详情
jumpDetail(val) {
window.vm.$router.push({ name: 'oilStation.detail',query:{
oilId: val.id,
oilNo: val.oilNo,
longitude: val.gasAddressLongitude,
latitude: val.gasAddressLatitude,
distance: val.distance
}
})
},
change() {
this.pageNum = 1;
this.getStationList();
},
//选择油号
changeOilNo(item,name) {
this.$refs.vanItem.toggle(false);
this.oilNo = item;
this.oilName = name;
this.pageNum = 1;
this.getStationList();
},
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
.box-nav {
display: flex;
.nav-address {
width: 35%;
padding-left: 10px;
line-height: 48px;
font-size: 12px;
color: #333333;
display: flex;
position: relative;
&:after {
position: absolute;
top: 50%;
right: 0px;
margin-top: -1.333333vw;
border: 0.8vw solid;
border-color: transparent transparent #dcdee0 #dcdee0;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
opacity: .8;
content: '';
}
.location-icon {
color: #008FFF;
font-size: 12px;
vertical-align: text-top;
margin-right: 3px;
}
}
.nav-select {
width: 65%;
/deep/ .van-dropdown-menu__bar {
box-shadow: none;
}
}
}
.location-his {
position: fixed;
right: 30px;
bottom: 80px;
width: 48px;
height: 48px;
>img {
box-shadow: 0px 2px 4px rgba(53,168,255,.4);
border-radius: 50%;
}
}
.location-m {
display: flex;
height: 42px;
line-height: 42px;
padding: 0 10px;
justify-content: space-between;
}
.oil-select {
padding: 10px 15px;
}
.oil-gasoline-t {
font-size: 12px;
color: #333333;
}
.select-item-panel {
padding: 10px;
display: flex;
flex-wrap: wrap;
>.select-item {
padding: 0px 24px;
height: 28px;
font-size: 12px;
box-sizing: border-box;
color: #666666;
background: #EBEBEB;
border-radius: 4px;
margin-bottom: 15px;
margin-right: 15px;
text-align: center;
line-height: 28px;
//&:nth-child(4n) {
// margin-right: 0px;
//}
&.checked {
background: transparent;
border: 1px solid #008FFF;
color: #008FFF;
}
}
}
.oil-list-panel {
padding: 10px;
background: #f4f4f4;
min-height: calc(100vh - 68px);
.oil-list-box {
border-radius: 6px;
padding: 15px;
margin-bottom: 10px;
background: #FFFFFF;
position: relative;
.oil-list-h {
display: flex;
.oil-discount {
position: absolute;
top: 25px;
right: 25px;
font-size: 18px;
color: #FE6000;
}
.oil-list-img {
width: 70px;
height: 70px;
}
.oil-list-desc {
margin-left: 10px;
.oil-desc-t1 {
width: 200px;
line-height: 16px;
margin-bottom: 4px;
font-size: 14px;
color: #333333;
}
.oil-desc-t2 {
font-size: 14px;
color: #FE6000;
line-height: 24px;
margin-bottom: 6px;
>span {
&:nth-child(2) {
font-size: 10px;
color: #FE6000;
margin-left: 16px;
text-align: center;
}
&:nth-child(3) {
display: inline-block;
padding: 1px;
line-height: 1;
border: 1px solid #666666;
border-radius: 8px;
}
}
}
.oil-desc-t3 {
display: inline-block;
text-align: center;
background: #FE6000;
border-radius: 16px;
font-size: 10px;
color: #FFFFFF;
letter-spacing: 0;
padding: 2px 8px;
}
}
}
.oil-list-f {
line-height: 16px;
margin-top: 10px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
color: #333333;
span{
display: inline-block;
&:first-child {
display: inline-block;
max-width: 185px;
}
}
.location-icon {
color: #008FFF;
font-size: 12px;
vertical-align: text-top;
margin-right: 3px;
}
.list-f-distance {
font-size: 10px;
color: #666666;
.navigation-btn {
display: inline-block;
border-left: 1px solid #D8D8D8;
color: #008FFF;
padding-left: 5px;
img {
width: 14px;
height: 14px;
vertical-align: text-top;
margin-right: 3px;
}
}
}
}
}
}
}
}
</style>
<template>
<div class="main">
<div class="box">
<div class="search-panel">
<van-search
v-model="input"
show-action
shape="round"
clearable
placeholder="请输入目的地或加油站名称"
@search="onSearch"
>
<template #action>
<div @click="onSearch" class="search-btn" v-if="localStatus">搜索</div>
<div @click="onCancel" class="search-btn" v-if="!localStatus">取消</div>
</template>
</van-search>
</div>
<map-search v-show="!localStatus" :keyword="input" ref="maps" @selectLocation="selectLocation"></map-search>
<div class="location-result" v-show="localStatus">
<div class="location-now-h">
<div class="location-now-h1">当前定位<van-icon name="location" class="location-icon"/></div>
<div class="location-now-h2">
<div class="location-now-address" @click="selectAddress">{{addressInfo.address}}</div>
<div class="location-now-refresh" @click="handleLocation"><img src="@a/images/repositioning.png" alt="">重新定位</div>
</div>
</div>
<div class="location-history">
<div class="location-history-t" v-if="hisList.length>0">
<span>最近三个月搜索过</span>
<span @click="clearEmpty">清空</span>
</div>
<div class="location-history-list">
<div class="location-history-item" v-for="(item,index) in hisList" :key="index">
<div class="history-list-icon text-hide" @click="selectItem(item)">{{ item.address }}</div>
<div class="history-list-clear"><van-icon name="cross" @click="delHistory(item.id)"/></div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import mapSearch from './map-search'
import AMap from 'AMap';
import WxConfig from '@u/WxConfig'
import {oilStation} from "@r/api";
const WX = new WxConfig(['scanQRCode', 'chooseImage', 'getLocation']);
export default {
name: "location",
data() {
return {
input: '',
localStatus: true,
hisList: [1,2,3],
addressInfo: {}
}
},
components: {
mapSearch
},
watch: {
input(newValue, oldValue) {
if (newValue.trim() && newValue !== oldValue) {
this.ms = 1000;
clearTimeout(this.timeID);
this.timeID = setTimeout(() => {
this.onSearch();
}, this.ms)
}
}
},
mounted() {
this.getRecord();
this.handleLocation();
},
methods: {
getRecord() {
oilStation.getStationSearchList().then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.hisList = data;
} else {
this.showToast(message)
}
})
},
clearEmpty() {
oilStation.getStationSearchDeleteAll().then(res => {
this.hideLoading()
let { code, message } = res
if (code == 0) {
this.getRecord();
} else {
this.showToast(message)
}
})
},
delHistory(index) {
let para = {
id: index
}
oilStation.getStationSearchDelete(para).then(res => {
this.hideLoading()
let { code, message } = res
if (code == 0) {
this.getRecord();
} else {
this.showToast(message)
}
})
},
//重新定位
handleLocation() {
const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.getLocation();
}else {
this.getMapLocation();
}
},
getMapLocation() {
let self = this;
AMap.plugin('AMap.Geolocation', function () {
var geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
timeout: 10000, //超过10秒后停止定位,默认:5s
buttonPosition: 'RB', //定位按钮的停靠位置
buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
zoomToAccuracy: true, //定位成功后是否自动调整地图视野到定位点
})
geolocation.getCurrentPosition(function (status, result) {
if (status == 'complete') {
self.addressInfo = {
longitude: result.position.lng,
latitude: result.position.lat,
address: result.formattedAddress,
cityCode: result.addressComponent.adcode,
}
self.$store.commit('setAddress',self.addressInfo)
self.getStationList();
} else {
self.showToast('获取定位失败');
}
})
})
},
mapChange(e) {
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
let { longitude, latitude } = e;
let lnglat = [longitude, latitude];
geocoder.getAddress(lnglat, (status, result) => {
let { info, regeocode: { formattedAddress } } = result
if (status === 'complete' && info === 'OK') {
// result为对应的地理位置详细信息
this.addressInfo = {
longitude,
latitude,
address: formattedAddress
}
this.$store.commit('setAddress',this.addressInfo)
}
})
})
},
getLocation(){
WX.getLocation().then(res => {
this.hideLoading();
this.mapChange(res)
})
},
onCancel() {
this.localStatus = true;
},
onSearch(){
this.localStatus = false;
this.$refs.maps.onSearch();
},
selectItem(val) {
this.$store.commit('setAddress',val)
window.vm.$router.push({ path: '/oilStation/index'})
},
selectAddress() {
window.vm.$router.push({ path: '/oilStation/index'})
},
selectLocation(value) {
let para = {
address: value.address,
longitude: value.location.lng,
latitude: value.location.lat,
}
oilStation.getStationSearchInsert(para).then(res => {
this.hideLoading()
let { code, message } = res
if (code == 0) {
this.$store.commit('setAddress',para)
window.vm.$router.push({ path: '/oilStation/index'})
} else {
this.showToast(message)
}
})
}
}
}
</script>
<style scoped lang='scss'>
.main {
.box {
.search-btn {
font-size: 14px;
color: #008FFF;
}
.location-result {
padding: 0 15px;
background: #FFFFFF;
.location-now-h {
line-height: 30px;
padding-bottom: 15px;
border-bottom: 1px solid #D8D8D8;
.location-now-h1 {
font-size: 14px;
color: #666666;
>.location-icon {
font-size: 12px;
color: #333333;
margin-left: 3px;
vertical-align: middle;
}
}
.location-now-h2 {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 14px;
color: #333333;
.location-now-address {
line-height: 18px;
flex: 1;
}
.location-now-refresh {
font-size: 10px;
color: #008FFF;
width: 70px;
text-align: right;
line-height: 29px;
}
img {
width: 15px;
height: 15px;
vertical-align: middle;
margin-right: 3px;
}
}
}
.location-history {
padding: 15px 0px;
}
.location-history-t {
display: flex;
justify-content: space-between;
font-size: 14px;
color: #333333;
}
.location-history-list {
margin-top: 10px;
.location-history-item {
display: flex;
justify-content: space-between;
align-items: center;
line-height: 24px;
height: 24px;
margin-top: 10px;
.history-list-icon {
padding-left: 30px;
}
.history-icons {
font-size: 14px;
color: #666666;
margin-right: 10px;
vertical-align: middle;
}
}
}
}
}
}
</style>
<template>
<div class="main">
<van-cell is-link v-for="(item,index) in localList" :key="index" @click="selectAddress(item)">
<div class="location-history-list" >
<div class="history-list-icon"><van-icon name="location-o" class="localtion-icon"/></div>
<div class="list-address">
<div class="list-address-n" v-if="item.nameArr.length > 1">{{item.nameArr[0]}}<span>{{item.nameArr[1]}}</span>{{item.nameArr[2]}}</div>
<div class="list-address-n" v-if="item.nameArr.length == 1">{{item.nameArr[0]}}</div>
<div class="list-address-d">{{item.address}}</div>
</div>
</div>
</van-cell>
<div class="more-history" @click="searchMore" v-if="localList.length>0">查看更多搜索结果</div>
</div>
</template>
<script type='text/ecmascript-6'>
import AMap from 'AMap';
let placeSearch;
export default {
name: "mapSearch",
data() {
return {
localList: [],
pageIndex: 1,
}
},
props: {
keyword: null
},
mounted() {
this.AMapInit();
},
methods: {
AMapInit: function () {
AMap.service(["AMap.PlaceSearch"], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
});
});
},
onSearch(){
this.pageIndex = 1;
this.localList = [];
this.onLocation();
},
onLocation() {
this.showLoading();
let _this = this;
placeSearch.setPageIndex(this.pageIndex);
placeSearch.search(this.keyword, function(status, result) {
_this.hideLoading();
if(status == 'complete') {
let poiList = result.poiList.pois;
_this.localList = _this.localList.concat(poiList);
_this.localList = _this.localList.map((item)=>{
let idx = item.name.indexOf(_this.keyword);
let length = _this.keyword.length;
return {
nameArr: idx == -1 ? [item.name] : [item.name.substring(0,idx),_this.keyword,item.name.substring(idx+length)],
name: item.name,
address: item.address,
location: item.location
}
})
}
if(status != 'complete' && _this.pageIndex == 1) {
_this.localList = [];
}
});
},
searchMore() {
//查看更多搜索数据
this.pageIndex ++;
this.onLocation();
},
//选择定位
selectAddress(value) {
this.$emit('selectLocation',value)
},
}
}
</script>
<style scoped lang="scss">
.main {
.location-history-list {
display: flex;
align-items: center;
.localtion-icon {
font-size: 18px;
}
.list-address {
margin-left: 10px;
&-n {
line-height: 24px;
font-size: 14px;
color: #151515;
>span {
color: #FE6000;
}
}
&-d {
font-size: 12px;
color: #999999;
}
}
}
.more-history {
text-align: center;
margin-top: 20px;
line-height: 30px;
color: #008FFF;
font-size: 14px;
}
}
</style>
<template>
<div class="main">
<van-list
v-model="loading"
:finished="finished"
@load="onLoad"
@offset="300"
v-if="oilList.length >0"
>
<div class="oil-panel">
<div class="oil-item" :class="{'refund-status': item.orderStatusName=='已退款'}" v-for="(item,index) in oilList" :key="index">
<div class="item-title">
<div class="item-title-time">{{ item.orderTime }}</div>
<template v-for="(i,key) in orderStatus">
<span :class="`color-${key}`" v-if="i.name == item.orderStatusName" :key="key">{{ i.name }}</span>
</template>
</div>
<div class="item-desc">
<div class="item-desc-detail">
<div class="item-desc-name text-hide">{{ item.gasName }}</div>
<div class="item-desc-total">
<span>加油金额: {{ item.amountPay }}元</span>
<span>实付 ¥{{ item.amountGun }}</span>
</div>
<div class="item-desc-number">
<div>
<span style="margin-right: 9px">{{ item.litre }}升</span>
<span>{{ item.oilName }}</span>
</div>
<span>优惠{{ item.amountDiscounts }}元</span>
</div>
</div>
</div>
<div class="item-order">订单号:{{ item.orderId }}</div>
</div>
</div>
</van-list>
<van-empty description="无数据" v-else/>
</div>
</template>
<script type='text/ecmascript-6'>
import {oilStation} from "@r/api";
const orderStatus = [{
value: 0,
name: '已支付',
},{
value: 4,
name: '退款申请中'
},{
value: 5,
name: '已退款'
},{
value: 6,
name: '退款失败'
}]
export default {
name: "record",
data() {
return {
oilList: [],
orderStatus,
pageNum: 1,
pageSize: 10,
loading: false,
finished: false,
}
},
mounted() {
this.getStationRecord();
},
methods: {
getStationRecord() {
this.showLoading();
let para = {
pageNum: this.pageNum,
pageSize: this.pageSize,
};
oilStation.getStationOrderList(para).then(res => {
this.hideLoading()
let { code, data, message } = res
if (code == 0) {
this.oilList = this.pageNum == 1?data:this.oilList.concat(data);
this.loading = false;
if (this.oilList.length%this.pageSize != 0 || (data.length == 0 && this.oilList.length !=0)) this.finished = true
} else {
this.showToast(message)
}
})
},
onLoad() {
if (this.oilList.length != 0 && this.oilList.length % this.pageSize == 0) {
this.pageNum = this.pageNum + 1
this.getStationRecord()
}
},
}
}
</script>
<style scoped lang='scss'>
.color-0 {
color: #248B20;
}
.color-4 {
color: #008FFF;
}
.color-6 {
color: #F30016;
}
.color-5 {
color: #999999;
}
.main{
.oil-panel {
background: #f2f2f2;
position: absolute;
height: 100%;
width: 100%;
overflow-x: hidden;
padding: 15px;
box-sizing: border-box;
>.oil-item {
padding: 0px 15px;
border-radius: 5px;
margin-bottom: 15px;
background: #FFFFFF;
&.refund-status {
* {
color: #999999!important;
}
}
>.item-title {
display: flex;
justify-content: space-between;
height: 30px;
line-height: 30px;
border-bottom: 1px solid #E9E9E9;
font-size: 14px;
color: #999999;
.item-title-status {
font-size: 12px;
}
}
>.item-desc {
.item-desc-detail {
.item-desc-name {
font-size: 14px;
color: #333333;
line-height: 24px;
}
.item-desc-total {
font-size: 12px;
color: #FE6000;
display: flex;
justify-content: space-between;
line-height: 32px;
>span {
&:last-child {
font-size: 14px;
color: #333333;
font-weight: 500;
}
}
}
.item-desc-number {
font-size: 12px;
color: #FE6000;
display: flex;
justify-content: space-between;
line-height: 28px;
>span {
&:nth-child(3) {
display: inline-block;
padding: 1px;
border: 1px solid #666666;
border-radius: 8px;
}
}
}
}
}
>.item-order {
line-height: 26px;
font-size: 10px;
color: #999999;
}
}
}
}
</style>
const path = require('path')
/**
* 雪碧图插件
*/
const SpritesmithPlugin = require('webpack-spritesmith')
const spritesmithFunction = data => {
let { spritesheet, sprites } = data
let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}`
let perSprite = sprites.map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite
return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}`
}).join('\n')
return `${shared}\n${perSprite}`
}
const versions = Math.round(new Date() / 1000)
const CDN_URL = 'https://cdn.bootcdn.net/'
const CDN = {
css: [
'https://cdn.jsdelivr.net/npm/vant@2.12/lib/index.css'
],
js: [
`${CDN_URL}ajax/libs/vue/2.6.11/vue.min.js`,
`${CDN_URL}ajax/libs/vue-router/3.2.0/vue-router.min.js`,
`${CDN_URL}ajax/libs/axios/0.21.0/axios.min.js`,
`${CDN_URL}ajax/libs/vuex/3.6.2/vuex.min.js`,
'https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js'
]
}
const publicPath = '/scrm-equity/'
module.exports = {
// publicPath,
devServer: {
disableHostCheck: true,
host: '0.0.0.0',
port: 8081,
publicPath
},
configureWebpack: config => {
config.resolve.modules = ['node_modules', './src/assets/spritesmith']
const Plugins = [
new SpritesmithPlugin({
// 引入图片文件夹
src: {
cwd: path.resolve(__dirname, './src/assets/spritesmith'),
glob: ['*.png', '*.jpg']
},
// 生成图片的路径
target: {
image: path.resolve(__dirname, './src/assets/images/sprite.png'),
// 生成SCSS
css: [
[path.resolve(__dirname, './src/assets/scss/sprite.scss'), {
format: 'function_based_template'
}]
]
},
customTemplates: {
'function_based_template': spritesmithFunction,
},
//background引用路径
apiOptions: {
cssImageRef: '../images/sprite.png'
},
// 每个图片间距
spritesmithOptions: {
padding: 20
}
})
]
config.plugins = [...config.plugins, ...Plugins]
config.externals = {
'wx': 'wx',
'AMap': 'AMap'
}
},
publicPath: './',
chainWebpack: config => {
if (process.env.NODE_ENV === 'production') {
// 给js和css配置版本号
config.output.filename(`js/[name].${versions}.js`).end()
config.output.chunkFilename(`js/[name].${versions}.js`).end()
config.plugin('extract-css').tap(args => [{
filename: `css/[name].${versions}.css`,
chunkFilename: `css/[name].${versions}.css`
}])
config.externals = {
'vue': 'Vue',
'vue-router': 'VueRouter',
'vant': 'Vant',
'axios': 'Axios',
'Vuex': 'vuex'
}
config.plugin('html')
.tap(args => {
args[0].cdn = CDN
return args
})
config.devtool = "source-map";
}
// 修复HMR
config.resolve.symlinks(true);
// 别名配置
config.resolve.alias
.set('@', path.resolve(__dirname, './src'))
.set('@a', path.resolve(__dirname, './src/assets'))
.set('@r', path.resolve(__dirname, './src/api'))
.set('@c', path.resolve(__dirname, './src/components'))
.set('@v', path.resolve(__dirname, './src/views'))
.set('@u', path.resolve(__dirname, './src/utils'))
},
css: {
sourceMap: false
},
runtimeCompiler: true,
productionSourceMap: false
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!