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 \ No newline at end of file
...@@ -11,10 +11,13 @@ import mapApi from './mapApi' ...@@ -11,10 +11,13 @@ import mapApi from './mapApi'
import wxConfig from './wxConfig' import wxConfig from './wxConfig'
import shopmallApi from './shopmallApi' import shopmallApi from './shopmallApi'
import bigdatautilApi from './bigdatautilApi' import bigdatautilApi from './bigdatautilApi'
import carLifeApi from './carLifeApi'
export { export {
ssoApi, ssoApi,
mapApi, mapApi,
wxConfig, wxConfig,
shopmallApi, shopmallApi,
bigdatautilApi bigdatautilApi,
carLifeApi
} }
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-shopmall/router' const url = '/rop-scrm-shopmall/router'
export default { export default {
/** */ /**众筹详情 */
getActivityDetail (id) { getActivityDetail (id) {
return window.$HTTP({ return window.$HTTP({
url, url,
...@@ -10,6 +10,7 @@ export default { ...@@ -10,6 +10,7 @@ export default {
} }
}) })
}, },
/**参团人数 */
getActivityGroup (id) { getActivityGroup (id) {
return window.$HTTP({ return window.$HTTP({
url, url,
......
...@@ -50,7 +50,9 @@ import { ...@@ -50,7 +50,9 @@ import {
loading, loading,
SwipeCell, SwipeCell,
Swipe, Swipe,
SwipeItem SwipeItem,
IndexBar,
IndexAnchor
} from 'vant' } from 'vant'
export const components = [ export const components = [
Button, Button,
...@@ -95,5 +97,7 @@ export const components = [ ...@@ -95,5 +97,7 @@ export const components = [
loading, loading,
SwipeCell, SwipeCell,
Swipe, Swipe,
SwipeItem SwipeItem,
IndexBar,
IndexAnchor
] ]
\ No newline at end of file \ No newline at end of file
...@@ -3,14 +3,14 @@ const pages = { ...@@ -3,14 +3,14 @@ const pages = {
{ {
name: 'index', name: 'index',
meta: { meta: {
// keepAlive: true, keepAlive: true,
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
}, },
}, },
{ {
name: 'success', name: 'success',
meta: { meta: {
// keepAlive: true, keepAlive: true,
backgroundColor: '#FFF', backgroundColor: '#FFF',
noAuth: true, noAuth: true,
title: '参团成功' title: '参团成功'
...@@ -24,6 +24,22 @@ const pages = { ...@@ -24,6 +24,22 @@ const pages = {
noAuth: true, noAuth: true,
title: '隐私协议' 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 \ 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 \ No newline at end of file
...@@ -4,25 +4,6 @@ ...@@ -4,25 +4,6 @@
v-if="show" v-if="show"
> >
<div class="btn-box flex"> <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 <div
class="item" class="item"
@click="getPoster" @click="getPoster"
...@@ -33,9 +14,6 @@ ...@@ -33,9 +14,6 @@
</div> </div>
<div class="price"> <div class="price">
<span class="unit">¥</span>{{detail.price}}<span>.{{detail.decimal}}</span> <span class="unit">¥</span>{{detail.price}}<span>.{{detail.decimal}}</span>
<template v-if="detail.buyFlag == 3">
<span>参团成功</span>
</template>
</div> </div>
<div <div
:class="['btn text-center',{'disabled': detail.activityStatus == 3 || detail.buyFlag == 2},{'short':detail.buyFlag == 3}]" :class="['btn text-center',{'disabled': detail.activityStatus == 3 || detail.buyFlag == 2},{'short':detail.buyFlag == 3}]"
...@@ -57,6 +35,7 @@ ...@@ -57,6 +35,7 @@
@cancel="showModal = false" @cancel="showModal = false"
@pay="checkOut" @pay="checkOut"
:payStatus="payStatus" :payStatus="payStatus"
:carInfo="carInfo"
/> />
<van-overlay <van-overlay
:show="showPoster" :show="showPoster"
...@@ -103,7 +82,17 @@ export default { ...@@ -103,7 +82,17 @@ export default {
n.decimal = decimal n.decimal = decimal
// limitPurchaseFlag 是否限购标志:1 否;2 是; // limitPurchaseFlag 是否限购标志:1 否;2 是;
//buyFlag 1是未购买或者未限购,2是已购买且达到购买上限,3是已购买且未达到购买上限 //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', key: 'formDescribeFirst',
maxlength: 40, maxlength: 40,
name: n.formDescribeFirst name: n.formDescribeFirst
...@@ -116,7 +105,11 @@ export default { ...@@ -116,7 +105,11 @@ export default {
maxlength: 40, maxlength: 40,
name: n.formDescribeThird name: n.formDescribeThird
}] }]
this.formList = [...formList, ...list]
}, },
updata (n) {
this.carInfo = this.detail.carInfo
}
}, },
data () { data () {
return { return {
...@@ -125,19 +118,11 @@ export default { ...@@ -125,19 +118,11 @@ export default {
showPoster: false, showPoster: false,
formList: [], formList: [],
payStatus: Date.now(), payStatus: Date.now(),
miniprogramInfo: {},
posterImg: '', posterImg: '',
path: 'packageMine/pages/order/index/index.html' carInfo: {}
} }
}, },
mounted () { 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: { methods: {
submit () { submit () {
......
...@@ -15,13 +15,25 @@ ...@@ -15,13 +15,25 @@
{{i.name}} {{i.name}}
</div> </div>
<div class="value"> <div class="value">
<van-field <template v-if="i.route">
v-model="params[i.key]" <van-field
:placeholder="`请填写您的${i.name}`" readonly
:maxlength="i.maxlength" placeholder="请选择您的品牌车型"
:type="i.type" @click="to(i.route)"
clearable 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>
</div> </div>
</template> </template>
...@@ -60,7 +72,11 @@ export default { ...@@ -60,7 +72,11 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
payStatus: Number payStatus: Number,
carInfo: {
type: Object,
default: () => { }
}
}, },
watch: { watch: {
value (n) { value (n) {
...@@ -72,11 +88,20 @@ export default { ...@@ -72,11 +88,20 @@ export default {
{ name: '电话', key: 'userPhone', maxlength: 11, type: 'tel' }, { name: '电话', key: 'userPhone', maxlength: 11, type: 'tel' },
...this.list ...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 if (!this.params.userPhone) this.params.userPhone = phone
} }
}, },
payStatus (n) { payStatus (n) {
this.payLoading = false this.payLoading = false
},
carInfo (n) {
this.carText = `${n.vehicleBrandName} ${n.vehicleSubBrandName} ${n.vehicleSeriesName} ${n.vehicleShapeName}`
} }
}, },
data () { data () {
...@@ -84,13 +109,9 @@ export default { ...@@ -84,13 +109,9 @@ export default {
showBox: false, showBox: false,
payLoading: false, payLoading: false,
items: [], items: [],
params: { params: null,
userName: '', carText: '',
userPhone: '', hasCarBrand: false
formDescribeFirst: '',
formDescribeSecond: '',
formDescribeThird: ''
}
} }
}, },
mounted () { mounted () {
...@@ -100,7 +121,7 @@ export default { ...@@ -100,7 +121,7 @@ export default {
this.$emit('cancel') this.$emit('cancel')
}, },
pay () { pay () {
let { params, items } = this, let { params, items, hasCarBrand, carText, carInfo } = this,
obj = {}, obj = {},
phoneRex = /^[1]([3-9])[0-9]{9}$/, phoneRex = /^[1]([3-9])[0-9]{9}$/,
userInfo = this.getUserInfo() userInfo = this.getUserInfo()
...@@ -115,12 +136,22 @@ export default { ...@@ -115,12 +136,22 @@ export default {
return return
} }
if (!phoneRex.test(params.userPhone)) { if (!phoneRex.test(params.userPhone)) {
this.showToast('请输入正确的手机号')
return
} }
Object.keys(params).map(key => { Object.keys(params).map(key => {
if (params[key]) obj[key] = params[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) if (userInfo.phone) this.emit(obj)
else ssoApi.captchaLogin({ else ssoApi.captchaLogin({
mobile: params.userPhone, mobile: params.userPhone,
...@@ -165,6 +196,13 @@ export default { ...@@ -165,6 +196,13 @@ export default {
padding: 0; padding: 0;
font-size: 12px; font-size: 12px;
} }
.readonly {
/deep/.van-field__control {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
} }
} }
.btn { .btn {
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
:key="index" :key="index"
@click="playVideo(index)" @click="playVideo(index)"
> >
<!-- <template v-if="!ISMOBILE"> -->
<video <video
:src="i.activityVideo" :src="i.activityVideo"
:ref="`video-${index}`" :ref="`video-${index}`"
...@@ -65,7 +64,6 @@ ...@@ -65,7 +64,6 @@
preload preload
@loadedmetadata="loadedmetadata($event,index)" @loadedmetadata="loadedmetadata($event,index)"
></video> ></video>
<!-- </template> -->
<div class="mask"> <div class="mask">
<img src="https://img02.glsx.com.cn/weapp/resource/h5/images/video-poster.png" /> <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> <div :class="['sprite-icon xy-center',detail.activityVideos.length == 1 ?'icon-big-play':'icon-play']"></div>
...@@ -205,7 +203,10 @@ ...@@ -205,7 +203,10 @@
></div> ></div>
<div class="tips text-center">技术支持:广联数科</div> <div class="tips text-center">技术支持:广联数科</div>
</template> </template>
<action :detail="detail"></action> <action
:detail="detail"
:updata="carInfoKey"
></action>
<kf-modal <kf-modal
v-model="showKf" v-model="showKf"
:detail="detail" :detail="detail"
...@@ -232,13 +233,18 @@ export default { ...@@ -232,13 +233,18 @@ export default {
distanceKey: Date.now(), distanceKey: Date.now(),
showKf: false, showKf: false,
viewFlag: false, viewFlag: false,
audioFlag: false audioFlag: false,
carInfoKey: Date.now()
} }
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
if (from.name == 'crowdfunding.success') window.location.reload() if (from.name == 'crowdfunding.success') window.location.reload()
else next(vm => { else next(vm => {
let { carInfo } = from.params
if (carInfo) {
vm.detail.carInfo = carInfo,
vm.carInfoKey = Date.now()
}
}) })
}, },
created () { created () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!