Commit 50db8166 authored by 肖健's avatar 肖健

bug修复

parent 291791ae
<!--
* @Author: euzhi
* @Description: 扫码绑定
-->
<template> <template>
<view class="appCotent"> <view class="appCotent" v-if="show">
<div class="scan"> <view class="index-content">
<div class="contentMoveCar"> <u-swiper :radius="0" :height="210" :list="list5" circular @change="e => current = e.current" :autoplay="false">
<div class="car_item__one"> <view slot="indicator" class="indicator">
<div class="item__content"> <view class="indicator__dot" v-for="(item, index) in list5" :key="index" :class="[index === current && 'indicator__dot--active']">
{{moveCode}} </view>
</view>
</u-swiper>
<u-gap bgColor="transparent" height="15"></u-gap>
<div class="content__code">
<div class="code__img">
<image :src="freeCode.mainImgUrl" class="code__img"></image>
</div>
<div class="code__money">
<div class="money__title">
<text>{{freeCode.title}}</text>
</div>
<div class="code__tips">
<text>绑定友众账号,仅需支付邮费</text>
</div>
<div class="money__num">
<text class="num__one">¥0.00</text>
<text class="num__two">{{freeCode.originalPrice/100}}</text>
</div> </div>
</div> </div>
<div class="car_item__three"> <div class="code__get" @click="getPrice">
感谢您使用挪车二维码,请完成车牌号与手机的绑定以便享受挪车服务 <div>
立即
</div>
<div>
领取
</div>
</div> </div>
</div> </div>
<div class="moveCarMsg"> <u-gap bgColor="transparent" height="15"></u-gap>
<div class="scan__tips"> <div class="index__item3">
<div>请填写以下信息</div> <image src="@/static/index/index23.png"></image>
<div @click="goLoveCar">从爱车选择<span> </div>
<image src="@/static/move-car/scan_right.png" /></span></div> <u-gap bgColor="transparent" height="15"></u-gap>
</div> <div class="index__item3-1">
<div class="car__num__self"> <image src="@/static/index/index14.png"></image>
<div class="car__num">车牌号:</div> </div>
<car-number class="car__in" v-model="moveCodeInfo.carNo"></car-number> <u-gap bgColor="transparent" height="15"></u-gap>
</div> <div class="index__item4">
<active-form :formDate.sync="formData"></active-form> <image src="@/static/index/index20.png"></image>
</div> </div>
<div class="view__btn view__no__bind" @click="confirmBinding"> <u-gap bgColor="transparent" height="15"></u-gap>
确认绑定 <div class="index__item5">
<image src="@/static/index/index8.png"></image>
</div> </div>
<div class="use__text">使用说明</div> <u-gap bgColor="transparent" height="60"></u-gap>
</div> </view>
</view> </view>
</template> </template>
<script> <script>
import CarNumber from "@/common/codecook-carnumber/codecook-carnumber.vue";
export default { export default {
components: {
CarNumber,
},
data() { data() {
return { return {
model1: { show: false,
carInfo: {}, current: 0,
}, balance: "0.00",
formData: [ list5: [],
// { //免费挪车码
// id: "kjjns", //id必须唯一 可以是数字 freeCode: {},
// placeholder: "请输入", };
// label: "车牌号", // 提示输入名
// type: "text", //类型
// rules: {
// name: "carNo", //字段名 即提交给后端的字段
// value: "",
// verify: false, //是否开启校验
// errMess: "车牌号未填写", //校验不通过的错误提示
// },
// },
{
id: "kjjns", //id必须唯一 可以是数字
placeholder: "请输入",
label: "品牌:", // 提示输入名
type: "text", //类型
rules: {
name: "brand", //字段名 即提交给后端的字段
value: "",
verify: false, //是否开启校验
errMess: "品牌未填写", //校验不通过的错误提示
},
},
{
id: "kjjns", //id必须唯一 可以是数字
placeholder: "请输入",
label: "车型:", // 提示输入名
type: "text", //类型
rules: {
name: "carModel", //字段名 即提交给后端的字段
value: "",
verify: false, //是否开启校验
errMess: "车型未填写", //校验不通过的错误提示
},
},
{
id: "kjjns", //id必须唯一 可以是数字
placeholder: "请输入",
label: "手机号:", // 提示输入名
type: "text", //类型
rules: {
name: "phone", //字段名 即提交给后端的字段userMobile
value: "",
verify: false, //是否开启校验
errMess: "手机号未填写", //校验不通过的错误提示
},
},
{
id: "uisdfjks",
placeholder: "请输入验证码",
label: "验证码:",
type: "text",
// oneKeyPhone:true,
rules: {
name: "yzm",
value: "", //字段值
verify: false,
errMess: "验证码未填写",
},
},
],
//挪车码
moveCode: '',
//绑定挪车码信息
moveCodeInfo: {},
//选择车辆id
carId: '',
}
}, },
methods: { methods: {
goLoveCar() { getPrice() {
uni.showToast({
title: "您的免费领取次数已用完",
icon: 'none',
duration: 2000,
});
//跳转到领取优惠卷页面
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/pages/move-car/loveCar?price=1' url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
}); });
}, },
confirmBinding() { getMoveCode() {
for (let i in this.formData) { let opts = {
let name = this.formData[i].rules.name url: '/app/mall/free/code',
if (name == 'yzm') { method: 'get'
this.moveCodeInfo.verificationCode = this.formData[i].rules.value };
} else if (name == 'phone') { this.http.httpTokenRequest(opts, {}).then(res => {
this.moveCodeInfo.userMobile = this.formData[i].rules.value if (res.data.code == 200) {
} else { this.freeCode = res.data.data
this.moveCodeInfo[name] = this.formData[i].rules.value
} }
})
} },
//console.log(this.moveCodeInfo) getRotationList() {
this.moveCodeInfo.moveCode = this.moveCode
let opts = { let opts = {
url: '/app/moveCode/binding/', url: '/app/index/carouse/1',
method: 'put' method: 'get'
}; };
this.http.httpTokenRequest(opts, this.moveCodeInfo).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
//展示绑定成功 let data = []
uni.showToast({ data = res.data.data
title: "绑定成功", let imgList = []
icon: "success", data.forEach(e => {
}); imgList.push(e.imageUrl)
uni.navigateTo({
url: '/pagesB/pages/move-car/myMoveCar'
}) })
} else { this.list5 = imgList
//绑定失败,展示失败信息
uni.showToast({
title: res.data.msg,
icon: "error",
});
} }
}) })
}, },
getCarInfo() {
if (this.carId) {
let opts = {
url: '/app/vehicleAdmin/' + this.carId,
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.model1.carInfo = res.data.data
}
})
this.formData.forEach(e => {
if (e.label == '车牌号') {
e.rules.value = this.model1.carInfo.carNo
} else if (e.label == '品牌') {
e.rules.value = this.model1.carInfo.brand
} else if (e.label == '车型') {
e.rules.value = this.model1.carInfo.carModel
}
})
console.log(this.formData)
}
},
}, },
onLoad(option) { created() {
this.moveCode = option.moveCode this.getMoveCode()
this.getRotationList()
},
mounted() {
setTimeout(() => {
this.show = true
}, 100);
}, },
onShow: function () { onReady: function () {
this.getCarInfo() uni.setNavigationBarTitle({
//console.log( this.$store.state.selectedCar); title: '首页'
});
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.scan { .index-content {
/deep/ .form-container .line .input { background-color: #f9f9f9;
text-align: right !important; height: 100%;
padding-right: 30rpx;
}
.use__text { .index__item3 {
text-align: center; width: 100%;
font-size: 28rpx; height: 356rpx;
font-family: PingFang SC;
font-weight: 500;
text-decoration: underline;
color: #3A86F7;
}
.view__btn { image {
width: 670rpx; width: 100%;
height: 76rpx; height: 356rpx;
text-align: center; }
line-height: 76rpx;
margin: 0 auto;
font-size: 32rpx;
} }
.view__no__bind { .index__item3-1 {
background: url('@/static/move-car/move-car-view2.png') no-repeat; width: 100%;
margin-bottom: 30rpx; height: 711rpx;
background-size: contain;
color: rgba(255, 255, 255, 1);
}
/deep/ .p-l14 { image {
padding-left: 0 !important; width: 100%;
height: 711rpx;
}
} }
.u-checkbox-group { .index__item4 {
display: inline-block !important; width: 100%;
} height: 646rpx;
/deep/.u-checkbox-group--row { image {
display: inline-block !important; width: 100%;
height: 646rpx;
}
} }
.contentMoveCar { .index__item5 {
width: 100%;
height: 1289rpx;
padding: 40rpx; image {
width: 100%;
.item__label { height: 1289rpx;
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
line-height: 42rpx;
} }
}
.item__label__one { .content__code {
padding-right: 34rpx; padding: 28rpx;
} box-sizing: border-box;
width: 630rpx;
height: 220rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.16);
border-radius: 10rpx 40rpx 10rpx 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 30rpx;
position: relative;
.item__content { .code__img {
width: 500rpx; width: 160rpx;
font-size: 40rpx; height: 160rpx;
font-family: PingFang SC; background: #3699ff;
font-weight: bold; border-radius: 10rpx;
color: #F1251B;
line-height: 42rpx;
text-align: center;
line-height: 100rpx;
height: 100rpx;
background: url(@/static/move-car/move-car-code5.png) no-repeat;
background-size: contain;
} }
.car_item__one { .code__money {
display: flex; margin: 0 20rpx;
align-items: center;
margin-bottom: 30rpx; .money__title {
justify-content: center; font-size: 36rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
line-height: 42rpx;
.code__tips {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
line-height: 42rpx;
}
}
.money__num {
.num__one {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #e1251b;
line-height: 42rpx;
}
.num__two {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
line-height: 42rpx;
position: relative;
}
.num__two::before {
content: '';
width: 100%;
height: 1rpx;
background: #999;
position: absolute;
bottom: 16rpx;
left: 8rpx;
}
}
} }
.car_item__three { .code__get {
margin-top: 40rpx; position: absolute;
font-size: 24rpx; right: -60rpx;
width: 90rpx;
height: 90rpx;
font-size: 28rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #F88D28; color: #ffffff;
line-height: 36rpx; padding-top: 4rpx;
text-indent: 2em;
padding: 30rpx;
box-sizing: border-box; box-sizing: border-box;
background: url(@/static/move-car/move-car-code6.png) no-repeat; text-align: center;
background: url("@/static/index/index26.png") no-repeat;
background-size: contain; background-size: contain;
} }
} }
.moveCarMsg { /deep/ .u-swiper__indicator {
background: #FFFFFF; right: 0 !important;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2); }
border-radius: 20rpx;
padding: 32rpx 40rpx;
position: relative;
top: -56rpx;
.car__num__self { /deep/ .u-swiper {
display: flex; border-radius: 0 0 0 100rpx !important;
align-items: center; }
justify-content: space-between;
.car__num {
width: 160rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
}
}
.scan__tips { .indicator {
display: flex; @include flex(row);
align-items: center; justify-content: center;
justify-content: space-between;
margin-bottom: 30rpx;
>div:nth-of-type(1) { &__dot {
font-size: 28rpx; height: 20rpx;
font-family: PingFang SC; width: 20rpx;
font-weight: 500; border-radius: 100%;
color: #666666; background-color: rgba(255, 255, 255, 0.35);
} margin: 0 10rpx;
transition: background-color 0.3s;
>div:nth-of-type(2) { &--active {
font-size: 28rpx; background-color: #e1251b;
font-family: PingFang SC; }
font-weight: 500; }
color: #F88D28; }
span { .indicator-num {
image { padding: 4rpx 0;
width: 11rpx; background-color: rgba(0, 0, 0, 0.35);
height: 18rpx; border-radius: 100%;
} width: 35px;
@include flex;
justify-content: center;
margin-left: 10rpx; &__text {
} color: #ffffff;
} font-size: 24rpx;
} }
} }
} }
......
...@@ -228,6 +228,9 @@ export default { ...@@ -228,6 +228,9 @@ export default {
margin: 20rpx 0; margin: 20rpx 0;
text-indent: 20rpx; text-indent: 20rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
} }
.one__item__price { .one__item__price {
......
...@@ -61,6 +61,9 @@ export default { ...@@ -61,6 +61,9 @@ export default {
id: '', id: '',
}; };
}, },
onShow() {
this.getMyMoveCodeList()
},
methods: { methods: {
// 加载数据 // 加载数据
// load(paging) { // load(paging) {
...@@ -120,10 +123,6 @@ export default { ...@@ -120,10 +123,6 @@ export default {
} }
}, },
created() {
this.getMyMoveCodeList()
}
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment