Commit 81578dab by 李伟康

修改样式

1 parent b29d3149
const url = '/rop-scrm-carlife/router'
import { util } from 'utils'
export default {
/**获取车品牌列表 */
getCarBrandList (data = {}) {
data.method = 'scrm.api.carlife.common.getOnlyCarBrandList'
return window.$HTTP({
url,
data
})
},
/** 获取车系列表 */
getCarSeriesList (params) {
let data = {
method: 'scrm.api.carlife.common.getCarSeriesList',
...params
}
return window.$HTTP({
url,
data
})
},
/** 获取车型 */
getCarTypeList (carSeriesId) {
let data = {
method: 'scrm.api.carlife.common.getCarTypeList',
carSeriesId
}
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file
......@@ -11,10 +11,13 @@ import mapApi from './mapApi'
import wxConfig from './wxConfig'
import shopmallApi from './shopmallApi'
import bigdatautilApi from './bigdatautilApi'
import carLifeApi from './carLifeApi'
export {
ssoApi,
mapApi,
wxConfig,
shopmallApi,
bigdatautilApi
bigdatautilApi,
carLifeApi
}
\ No newline at end of file
const url = '/rop-scrm-shopmall/router'
export default {
/** */
/**众筹详情 */
getActivityDetail (id) {
return window.$HTTP({
url,
......@@ -10,6 +10,7 @@ export default {
}
})
},
/**参团人数 */
getActivityGroup (id) {
return window.$HTTP({
url,
......
......@@ -50,7 +50,9 @@ import {
loading,
SwipeCell,
Swipe,
SwipeItem
SwipeItem,
IndexBar,
IndexAnchor
} from 'vant'
export const components = [
Button,
......@@ -95,5 +97,7 @@ export const components = [
loading,
SwipeCell,
Swipe,
SwipeItem
SwipeItem,
IndexBar,
IndexAnchor
]
\ No newline at end of file
......@@ -3,14 +3,14 @@ const pages = {
{
name: 'index',
meta: {
// keepAlive: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
},
},
{
name: 'success',
meta: {
// keepAlive: true,
keepAlive: true,
backgroundColor: '#FFF',
noAuth: true,
title: '参团成功'
......@@ -24,6 +24,22 @@ const pages = {
noAuth: true,
title: '隐私协议'
}
},
{
name:'carBrands',
meta:{
keepAlive: true,
backgroundColor: '#FFF',
title: '品牌'
}
},
{
name:'carSeries',
meta:{
keepAlive: true,
backgroundColor: '#F7F8FA',
title: '选择车系'
}
}
]
}
......
<template>
<div
class="car-brands"
:key="upData"
>
<van-index-bar highlight-color="#FC5B32">
<template v-for="(item,index) in brandList">
<div :key="index">
<van-index-anchor :index="item.letter" />
<template v-for="(i,ind) in item.list">
<van-cell
:key="ind"
@click="showCarSeries(i)"
>
<template #title>
<img
:src="i.logoUrl"
v-if="i.logoUrl"
>
<span>{{i.name}}</span>
</template>
</van-cell>
</template>
</div>
</template>
</van-index-bar>
</div>
</template>
<script type='text/ecmascript-6'>
import { carLifeApi } from '@/api'
export default {
name: 'carBrands',
data () {
return {
brandList: [],
upData: Date.now()
}
},
mounted () {
let data = this.getLocalStorage('wx_scrm_car_brand_list')
if (data) {
this.formatData(data)
} else {
carLifeApi.getCarBrandList().then(data => {
this.setLocalStorage('wx_scrm_car_brand_list', data)
this.formatData(data)
})
}
},
methods: {
formatData (data) {
let letterList = Array.from(new Set([...data.map(e => e.letter)]))
let brandList = letterList.map(e => {
let list = []
data.map(i => {
if (e === i.letter) {
list.push(i)
}
})
return {
letter: e,
list
}
})
this.setCarData(brandList)
},
setCarData (brandList) {
this.showLoading('加载中...')
let count = 0
let settime = setInterval(() => {
if (null != brandList[count].list && brandList[count].list.length > 0) {
this.brandList[count] = brandList[count]
}
count++
if (count >= brandList.length) {
this.hideLoading()
this.upData = Date.now()
clearInterval(settime)
}
}, 10)
},
showCarSeries (i) {
let brandInfo = {
vehicleBrandId: i.id,
vehicleBrandName: i.name
}
if (i.childs && i.childs.length) this.to('crowdfunding.carSeries', { brandInfo, list: i.childs })
else this.showToast('暂无该品牌车系')
}
}
}
</script>
<style scoped lang='scss'>
.car-brands {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
/deep/.van-cell {
height: 56px;
}
/deep/.van-index-anchor {
height: 32px;
background: #f7f8fa;
}
/deep/.van-cell__title {
display: flex;
align-items: center;
img {
width: 34px;
height: 34px;
margin-right: 4px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="layout">
<van-index-bar
highlight-color="#FC5B32"
class="list"
:index-list="indexList"
>
<template v-for="(item,index) in list">
<div
class="item"
:key="index"
>
<van-index-anchor :index="item.name" />
<template v-if="item.childs && item.childs.length">
<template v-for="(i,ind) in item.childs">
<div
class="card flex"
:key="ind"
@click="showCarType(i,item)"
>
{{i.name}}
</div>
</template>
</template>
<template v-else>
<div class="loading text-center">
<van-loading
color="#282829"
size="80"
text-size="18"
vertical
>加载中...</van-loading>
</div>
</template>
</div>
</template>
</van-index-bar>
<van-popup
v-model="showType"
position="right"
class="popup"
>
<div :class="['car-view',{'text-center':!carTypeList.length}]">
<template v-if="carTypeList.length">
<template v-for="(i,index) in carTypeList">
<div
:key="index"
class="flex item"
@click="choose(i)"
>{{i.name}}</div>
</template>
</template>
<template v-else>
<van-loading
color="#282829"
size="40"
text-size="12"
vertical
>加载中...</van-loading>
</template>
</div>
</van-popup>
</div>
</template>
<script type='text/ecmascript-6'>
import { carLifeApi } from '@/api'
export default {
name: 'carSeries',
data () {
return {
list: [],
indexList: [],
showType: false,
carTypeList: [],
brandInfo: null
}
},
activated () {
this.showType = false
this.indexList = []
let { list, brandInfo } = this.getParams()
this.list = list
this.brandInfo = brandInfo
// this.showLoading()
list.map((e, index) => {
this.getCarSeriesList(e, { index, brandId: brandInfo.vehicleBrandId })
this.indexList.push(e.name)
})
},
mounted () {
},
methods: {
getCarSeriesList (e, { index, brandId }) {
carLifeApi.getCarSeriesList({
brandId,
childBrandId: e.id
}).then(data => {
this.list[index].childs = data
})
},
showCarType (i, item) {
let { brandInfo } = this
this.brandInfo = {
...brandInfo,
vehicleSubBrandId: item.id,
vehicleSubBrandName: item.name,
vehicleSeriesId: i.id,
vehicleSeriesName: i.name
}
this.carTypeList = []
this.showType = true
carLifeApi.getCarTypeList(i.id).then(data => {
this.carTypeList = data
})
},
choose (i) {
this.showType = false
let { brandInfo } = this
let carInfo = {
...brandInfo,
vehicleShapeId: i.id,
vehicleShapeName: i.name
}
this.$route.params.carInfo = carInfo
this.$router.replace({ name: 'crowdfunding' })
}
}
}
</script>
<style scoped lang='scss'>
.list {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
/deep/.van-index-anchor {
height: 26px;
background: #f7f8fa;
padding: 0 16px;
font-size: 11px;
color: #282829;
}
.loading {
aspect-ratio: 1/1;
color: #282829;
}
.card {
height: 56px;
background-color: #fff;
padding: 0 16px;
font-size: 16px;
font-weight: 500;
color: #282829;
.logo {
width: 88px;
height: 66px;
margin-right: 8px;
}
}
}
.popup {
.car-view {
height: 100vh;
width: 75vw;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
.item {
padding: 10px 16px;
border-bottom: 1px solid #e9e9e9;
}
}
}
</style>
\ No newline at end of file
......@@ -4,25 +4,6 @@
v-if="show"
>
<div class="btn-box flex">
<!-- <div
class="item"
@click="launchMiniprogram"
>
<div class="sprite-icon icon-order"></div>
订单
<template v-if="!$parent.ISWXWORK">
<wx-open-launch-weapp
class="mini"
:path="path"
:username="miniprogramInfo.username"
:env-version="miniprogramInfo.envVersion"
>
<script type="text/wxtag-template">
<div class="mini-btn">点击跳转</div>
</script>
</wx-open-launch-weapp>
</template>
</div> -->
<div
class="item"
@click="getPoster"
......@@ -33,9 +14,6 @@
</div>
<div class="price">
<span class="unit">¥</span>{{detail.price}}<span>.{{detail.decimal}}</span>
<template v-if="detail.buyFlag == 3">
<span>参团成功</span>
</template>
</div>
<div
:class="['btn text-center',{'disabled': detail.activityStatus == 3 || detail.buyFlag == 2},{'short':detail.buyFlag == 3}]"
......@@ -57,6 +35,7 @@
@cancel="showModal = false"
@pay="checkOut"
:payStatus="payStatus"
:carInfo="carInfo"
/>
<van-overlay
:show="showPoster"
......@@ -103,7 +82,17 @@ export default {
n.decimal = decimal
// limitPurchaseFlag 是否限购标志:1 否;2 是;
//buyFlag 1是未购买或者未限购,2是已购买且达到购买上限,3是已购买且未达到购买上限
this.formList = [{
let formList = []
if (n.selectCarNumberFlag && n.selectCarNumberFlag == 2) formList.push({
key: 'plateNo',
maxlength: 10,
name: '车牌号'
})
if (n.selectVehicleTypeFlag && n.selectVehicleTypeFlag == 2) formList.push({
route: 'crowdfunding.carBrands',
name: '品牌车型'
})
let list = [{
key: 'formDescribeFirst',
maxlength: 40,
name: n.formDescribeFirst
......@@ -116,7 +105,11 @@ export default {
maxlength: 40,
name: n.formDescribeThird
}]
this.formList = [...formList, ...list]
},
updata (n) {
this.carInfo = this.detail.carInfo
}
},
data () {
return {
......@@ -125,19 +118,11 @@ export default {
showPoster: false,
formList: [],
payStatus: Date.now(),
miniprogramInfo: {},
posterImg: '',
path: 'packageMine/pages/order/index/index.html'
carInfo: {}
}
},
mounted () {
let params = this.getLocalStorage('wx_scrm_link_params') || {}
const { miniprogramInfo } = window.$fetchConfig
this.miniprogramInfo = miniprogramInfo
if (params.merchantId) this.path = `packageMine/pages/order/index/index.html?merchantId=${params.merchantId}`
// shopmallApi.payOrder({
// orderCode:2207101414289656
// })
},
methods: {
submit () {
......
......@@ -15,13 +15,25 @@
{{i.name}}
</div>
<div class="value">
<van-field
v-model="params[i.key]"
:placeholder="`请填写您的${i.name}`"
:maxlength="i.maxlength"
:type="i.type"
clearable
/>
<template v-if="i.route">
<van-field
readonly
placeholder="请选择您的品牌车型"
@click="to(i.route)"
v-model="carText"
class="readonly"
>
</van-field>
</template>
<template v-else>
<van-field
v-model="params[i.key]"
:placeholder="`请填写您的${i.name}`"
:maxlength="i.maxlength"
:type="i.type"
clearable
/>
</template>
</div>
</div>
</template>
......@@ -60,7 +72,11 @@ export default {
type: Array,
default: () => []
},
payStatus: Number
payStatus: Number,
carInfo: {
type: Object,
default: () => { }
}
},
watch: {
value (n) {
......@@ -72,11 +88,20 @@ export default {
{ name: '电话', key: 'userPhone', maxlength: 11, type: 'tel' },
...this.list
]
let params = {}
this.items.map(e => {
params[e.key] = ''
if (e.route) this.hasCarBrand = true
})
this.params = params
if (!this.params.userPhone) this.params.userPhone = phone
}
},
payStatus (n) {
this.payLoading = false
},
carInfo (n) {
this.carText = `${n.vehicleBrandName} ${n.vehicleSubBrandName} ${n.vehicleSeriesName} ${n.vehicleShapeName}`
}
},
data () {
......@@ -84,13 +109,9 @@ export default {
showBox: false,
payLoading: false,
items: [],
params: {
userName: '',
userPhone: '',
formDescribeFirst: '',
formDescribeSecond: '',
formDescribeThird: ''
}
params: null,
carText: '',
hasCarBrand: false
}
},
mounted () {
......@@ -100,7 +121,7 @@ export default {
this.$emit('cancel')
},
pay () {
let { params, items } = this,
let { params, items, hasCarBrand, carText, carInfo } = this,
obj = {},
phoneRex = /^[1]([3-9])[0-9]{9}$/,
userInfo = this.getUserInfo()
......@@ -115,12 +136,22 @@ export default {
return
}
if (!phoneRex.test(params.userPhone)) {
this.showToast('请输入正确的手机号')
return
}
Object.keys(params).map(key => {
if (params[key]) obj[key] = params[key]
})
if (hasCarBrand) {
if (!carText) {
this.showToast('请选择品牌车型')
return
} else {
obj = {
...obj,
...carInfo
}
}
}
if (userInfo.phone) this.emit(obj)
else ssoApi.captchaLogin({
mobile: params.userPhone,
......@@ -165,6 +196,13 @@ export default {
padding: 0;
font-size: 12px;
}
.readonly {
/deep/.van-field__control {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
.btn {
......
......@@ -57,7 +57,6 @@
:key="index"
@click="playVideo(index)"
>
<!-- <template v-if="!ISMOBILE"> -->
<video
:src="i.activityVideo"
:ref="`video-${index}`"
......@@ -65,7 +64,6 @@
preload
@loadedmetadata="loadedmetadata($event,index)"
></video>
<!-- </template> -->
<div class="mask">
<img src="https://img02.glsx.com.cn/weapp/resource/h5/images/video-poster.png" />
<div :class="['sprite-icon xy-center',detail.activityVideos.length == 1 ?'icon-big-play':'icon-play']"></div>
......@@ -205,7 +203,10 @@
></div>
<div class="tips text-center">技术支持:广联数科</div>
</template>
<action :detail="detail"></action>
<action
:detail="detail"
:updata="carInfoKey"
></action>
<kf-modal
v-model="showKf"
:detail="detail"
......@@ -232,13 +233,18 @@ export default {
distanceKey: Date.now(),
showKf: false,
viewFlag: false,
audioFlag: false
audioFlag: false,
carInfoKey: Date.now()
}
},
beforeRouteEnter (to, from, next) {
if (from.name == 'crowdfunding.success') window.location.reload()
else next(vm => {
let { carInfo } = from.params
if (carInfo) {
vm.detail.carInfo = carInfo,
vm.carInfoKey = Date.now()
}
})
},
created () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!