合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

137 lines
2.9 KiB

<template>
<view class="container">
<view class="header_infos">
<view class="header_info_left" @click="getBack">
<uni-icons type="left" size="30">
</uni-icons>
</view>
<text class="header_info_right">
选择车系
</text>
</view>
<view class="contents">
<scroll-view scroll-y="true" class="scroll-view" :scroll-into-view="currentIndex">
<view class="content" v-for="(item, index) in list" :key="index" @click="getPid(item.id,item.name)">
<text class="content-left">
{{item.name}}
</text>
<uni-icons class="content-right" type="right" color="#c0c0c0"></uni-icons>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import {childList} from '@/api.uts'
export default {
data() {
return {
list:[],
currentIndex: '',
clientInfo:{},
certFront:'',
carPic:'',
certBack:'',
}
},
onLoad(options) {
this.clientInfo = JSON.parse(decodeURIComponent(options.clientInfo));
console.log(this.clientInfo.appOrderCarList[0].carSeries);
},
mounted() {
childList({pid:getApp().pid}).then((res)=>{
this.list =res.result.records
})
},
methods: {
getBack(){
uni.navigateBack(
{delta:1}
)
},
getPid(id,name){
this.clientInfo.appOrderCarList[0].carSeries = this.clientInfo.appOrderCarList[0].carSeries + name;
childList({pid:id}).then((res)=>{
if(res.result.records.length == 0){
if(this.pagesCount >= 10){
// 使用重定向跳转页面
uni.redirectTo(
{url:'/pages/index/PayPal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
})
}else{
uni.navigateTo(
{url:'/pages/index/PayPal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
})
}
}else{
getApp().pid = id;
if(this.pagesCount >= 10){
// 使用重定向跳转页面
uni.redirectTo(
{url:'/pages/views/carFinal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
})
}else{
uni.navigateTo(
{url:'/pages/views/carFinal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
})
}
}
})
}
}
}
</script>
<style scss>
.header_infos{
height: 10%;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
background-color: #f8f8f8;
}
.header_info_right{
width: 80%;
display: flex;
align-items: center;
justify-content: center;
/* left: 40%; */
}
.contents{
height: 100%;
width: 100%;
}
.scroll-view {
flex: 1;
height: 100%;
/* margin-top: 10%; */
background-color: #ffffff;
}
.content{
height: 5%;
display: flex;
flex-direction: row;
border-bottom: 0.01rem solid #e0e0e0;
/* height: 15%; */
}
.content-left{
font-size: 0.8rem;
display: flex;
align-items: center;
justify-content: center;
}
.content-right{
margin-left: auto;
display: flex;
align-items: center;
justify-content: center;
}
</style>