Commit 1468af25 authored by 肖健's avatar 肖健

Merge branch 'v1.0.0' into v1.0.0_jd

parents ca272eef 14f1b701
......@@ -2,3 +2,4 @@ unpackage/
.hbuilderx/
.idea/
.vscode/
node_modules
\ No newline at end of file
{
"name": "表单 动态表单 uniapp最强动态表单 表单校验 快速生成表单 全端支持",
"version": "1.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "表单 动态表单 uniapp最强动态表单 表单校验 快速生成表单 全端支持",
"version": "1.1.0",
"dependencies": {
"crypto-js": "^4.1.1"
}
},
"node_modules/crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
}
},
"dependencies": {
"crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
}
}
}
......@@ -9,5 +9,8 @@
"表单校验",
"快速生成表单",
"全端"
]
],
"dependencies": {
"crypto-js": "^4.1.1"
}
}
......@@ -80,7 +80,7 @@
//检查挪车码存在、是否绑定
getCheckMoveCode() {
let opts = {
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
};
this.http.httpTokenRequest(opts, {
......@@ -170,7 +170,7 @@
code: this.scene
}
opts = {
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
}
that.http.httpTokenRequest(opts, param).then(res => {
......@@ -306,7 +306,7 @@
code: this.scene
}
opts = {
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
}
that.http.httpTokenRequest(opts, param).then(res => {
......
......@@ -81,7 +81,7 @@ export default {
code: scene
}
let opts = {
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
}
......
......@@ -115,7 +115,7 @@
code: scene
}
let opts = {
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
}
that.http.httpTokenRequest(opts, param).then(
......@@ -329,7 +329,7 @@
//获取二维码携带的参数
//扫码后得到的参数
that.http.httpTokenRequest({
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
}, {
code: that.scene
......@@ -385,7 +385,7 @@
that.scene = decodeURIComponent(option.scene)
uni.setStorageSync('scene', that.scene)
that.http.httpTokenRequest({
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
}, {
code: that.scene
......
......@@ -91,7 +91,7 @@
code: scene
}
let opts = {
url: '/app/user/check/move/code',
url: '/app/user/c/m/c',
method: 'post'
}
......
......@@ -3,7 +3,7 @@
* @Description: 扫码绑定
-->
<template>
<view class="appCotent">
<view class="appCotent">
<div class="scan">
<div class="contentMoveCar">
<div class="car_item__one">
......@@ -152,7 +152,8 @@
</view>
</view>
<view class="radio">
<image src="../../../static/move-car/radio-active.png" v-if="item.id === radioValue"></image>
<image src="../../../static/move-car/radio-active.png"
v-if="item.id === radioValue"></image>
<image src="../../../static/move-car/radio.png" v-else></image>
</view>
</view>
......@@ -167,23 +168,24 @@
</view>
</u-popup>
</div>
</view>
</view>
</template>
<script>
import CarNumber from "@/common/codecook-carnumber/codecook-carnumber.vue";
export default {
import CarNumber from "@/common/codecook-carnumber/codecook-carnumber.vue";
import CryptoJS from "crypto-js";
export default {
components: {
CarNumber,
},
data() {
return {
model1: {
moveCode:"",
carNo:"",
userMobile:"",
verificationCode:"",
carId:""
moveCode: "",
carNo: "",
userMobile: "",
verificationCode: "",
carId: ""
},
carInfo: null,
formData: [
......@@ -255,16 +257,18 @@ export default {
moveCodeInfo: null,
//选择车辆id
carId: '',
carList:[],
checked:false,
selectCar:false,
radioValue:"",
smsbtn:{
text:'发送验证码',
status:false,
codeTime:60
carList: [],
checked: false,
selectCar: false,
radioValue: "",
smsbtn: {
text: '发送验证码',
status: false,
codeTime: 60
}, // 验证码
clickStatus:false, // 节流
clickStatus: false, // 节流
key:null, // 加密key
iv:null // 加密iv
}
},
methods: {
......@@ -283,7 +287,7 @@ export default {
});
},
// 选择爱车
radioChange(item){
radioChange(item) {
this.carInfo = item
this.radioValue = item.id
this.selectCar = false
......@@ -291,12 +295,15 @@ export default {
this.model1.carId = item.id
},
// 获取爱车列表
getCarList(){
getCarList() {
uni.showLoading({
title: '加载中',
mask:true
mask: true
});
let opts = { url: '/app/vehicleAdmin/list', method: 'get' };
let opts = {
url: '/app/vehicleAdmin/list',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.statusCode == 200) {
uni.hideLoading()
......@@ -313,8 +320,8 @@ export default {
});
},
// 发送验证码
sendCode(){
if(this.model1.userMobile.length == 0){
sendCode() {
if (this.model1.userMobile.length == 0) {
uni.showToast({
title: "联系方式不能为空!",
icon: "none",
......@@ -331,10 +338,15 @@ export default {
}
uni.showLoading({
title: '加载中',
mask:true
mask: true
});
let opts = { url: '/app/smsCode/binding/', method: 'post' };
this.http.httpTokenRequest(opts,{phone: this.model1.userMobile}).then(res => {
let opts = {
url: '/app/smsCode/binding/',
method: 'post'
};
this.http.httpTokenRequest(opts, {
phone: this.model1.userMobile
}).then(res => {
if (res.statusCode == 200) {
uni.showToast({
title: "别着急!短信已经发送了~",
......@@ -342,7 +354,7 @@ export default {
duration: 1500
});
uni.hideLoading()
if(this.clickStatus == false){
if (this.clickStatus == false) {
this.clickStatus = true
let timer = setInterval(() => {
if (this.smsbtn.codeTime > 0) {
......@@ -362,22 +374,21 @@ export default {
})
},
confirmBinding() {
console.log(this.model1,22222222222)
if(!this.carInfo){
if (!this.carInfo) {
uni.showToast({
title: "请选择绑定的爱车!",
icon: "none",
});
return;
}
if(this.model1.userMobile.length == 0){
if (this.model1.userMobile.length == 0) {
uni.showToast({
title: "联系方式不能为空!",
icon: "none",
});
return;
}
if(this.model1.verificationCode.length == 0){
if (this.model1.verificationCode.length == 0) {
uni.showToast({
title: "验证码不能为空!",
icon: "none",
......@@ -386,10 +397,10 @@ export default {
}
uni.showLoading({
title: '加载中',
mask:true
mask: true
});
let opts = {
url: '/app/moveCode/binding/',
url: '/app/moveCode/bind',
method: 'put'
};
this.http.httpTokenRequest(opts, this.model1).then(res => {
......@@ -400,41 +411,19 @@ export default {
icon: "success",
});
uni.hideLoading()
setTimeout(()=>{
uni.navigateTo({
url: '/pagesB/pages/move-car/myMoveCar'
})
} else {
//绑定失败,展示失败信息
uni.hideLoading()
},500)
} else if(res.data.code == 1000000002){
uni.showToast({
title: res.data.msg,
icon: "none",
});
}
})
},
getCarInfo() {
if (this.carId) {
uni.showLoading({
title:"加载中",
mask:true
})
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
uni.hideLoading()
this.formData.forEach(e => {
if (e.label == '品牌:') {
e.rules.value = this.model1.carInfo.brand
} else if (e.label == '车型:') {
e.rules.value = this.model1.carInfo.carModel
}
})
}else{
this.setAES(this.moveCode,this.key)
} else {
//绑定失败,展示失败信息
uni.hideLoading()
uni.showToast({
title: res.data.msg,
......@@ -442,7 +431,6 @@ export default {
});
}
})
}
},
// 跳转协议政策页面
goArticle(index) {
......@@ -462,28 +450,81 @@ export default {
uni.navigateTo({
url: '/pages/binding/article'
});
}else {
}else{
uni.showToast({
title: res.data.msg,
icon: "none",
});
}
})
},
// 获取加密key
getKey(){
let opts = {
url: '/app/user/c/i',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
let data = res.data.data
try{
let str = data.s3.padStart(8,0)
let ivs = data.s3
let str2 = data.l1
if(str2.length == 4){
let str3 = str2.substring(0,2)
let str4 = str2.substring(2,4)
this.key = str.substring(str3,str4)
let str5;
if(ivs.length > 8){
str5 = ivs.substring(ivs.length-8,ivs.length)
this.iv = String(str2 + str5).padStart(16,0)
}else{
str5 = ivs.padStart(8,0)
this.iv = String(str2 + str5).padStart(16,0)
}
this.setAES(this.moveCode,this.key)
}
}catch(err){
}
} else {
uni.showToast({
title: res.data.msg,
icon: "none",
});
}
})
},
setAES(str,keys) {
// const data = CryptoJS.enc.Utf8.parse(str);
const key = CryptoJS.enc.Utf8.parse(keys);
const iv = CryptoJS.enc.Utf8.parse(this.iv);
var option = {
iv: iv,
mode: CryptoJS.mode['CBC'],//看需求变“CBC”
padding: CryptoJS.pad['Pkcs7']//看需求变“ZeroPadding”
};
var encrypted = CryptoJS.AES.encrypt(str, key, option);
const words = encrypted.ciphertext.toString();
// var hex = CryptoJS.enc.Utf8.stringify(words);
// return hex
this.model1.moveCode = words
},
},
onLoad(option) {
this.moveCode = option.moveCode
this.model1.moveCode = option.moveCode
this.getKey()
},
onShow:function(){
this.getCarInfo()
onShow: function() {
//console.log( this.$store.state.selectedCar);
}
}
}
</script>
<style lang="scss" scoped>
.scan {
.scan {
/deep/ .form-container .line .input {
text-align: right !important;
padding-right: 30rpx;
......@@ -542,7 +583,7 @@ export default {
.contentMoveCar {
background-color: #fff;
padding:40rpx 40rpx 10rpx;
padding: 40rpx 40rpx 10rpx;
.item__label {
font-size: 34rpx;
......@@ -558,7 +599,7 @@ export default {
.item__content {
width: 500rpx;
padding:15rpx 0;
padding: 15rpx 0;
font-size: 40rpx;
font-family: PingFang SC;
font-weight: bold;
......@@ -566,12 +607,13 @@ export default {
text-align: center;
background: url(@/static/move-car/move-car-code5.png) no-repeat;
background-size: 100% 100%;
letter-spacing:6rpx;
view{
letter-spacing: 6rpx;
view {
font-size: 30rpx;
font-weight: 500;
margin-bottom:6rpx;
letter-spacing:0;
margin-bottom: 6rpx;
letter-spacing: 0;
}
}
......@@ -592,10 +634,11 @@ export default {
// text-indent: 2em;
text-align: center;
box-sizing: border-box;
padding:16rpx 30rpx 26rpx;
background:#FEF4E9;
border-radius:10rpx;
text{
padding: 16rpx 30rpx 26rpx;
background: #FEF4E9;
border-radius: 10rpx;
text {
font-size: 28rpx;
font-weight: bold;
}
......@@ -612,6 +655,7 @@ export default {
display: flex;
align-items: center;
justify-content: space-between;
.car__num {
width: 160rpx;
font-size: 32rpx;
......@@ -619,7 +663,8 @@ export default {
font-weight: 500;
color: #666666;
}
.car__input{
.car__input {
width: 100%;
}
}
......@@ -656,209 +701,245 @@ export default {
}
// 已绑定车辆信息
.car_info{
.car_info {
background: #FFFFFF;
background-color: #fff;
padding:0 40rpx;
padding: 0 40rpx;
position: relative;
top:-6rpx;
.select-car{
line-height:80rpx;
top: -6rpx;
.select-car {
line-height: 80rpx;
text-align: right;
font-size: 28rpx;
color: #E1251B;
}
.info_list{
line-height:90rpx;
.info_list {
line-height: 90rpx;
display: flex;
justify-content: space-between;
align-items: center;
// border-bottom:2rpx solid rgba(0,0,0,.1);
.left{
.left {
font-size: 32rpx;
}
.right{
.right {
font-size: 28rpx;
color: #666;
line-height: 1.8;
word-wrap:break-word;
word-wrap: break-word;
text-align: right;
&.info{
&.info {
display: flex;
align-items: center;
justify-content: flex-end;
text-align: left;
// padding:20rpx 0;
image{
max-width:48rpx;height: 48rpx;
image {
max-width: 48rpx;
height: 48rpx;
}
>view{
margin:0 10rpx;
>view {
margin: 0 10rpx;
line-height: 1.5;
>view{
font-weight:bold;
>view {
font-weight: bold;
font-size: 32rpx;
color: #333;
}
}
}
.car__input{
.car__input {
width: 100%;
}
}
}
.car_btn{
.car_btn {
width: 400rpx;
line-height: 76rpx;
background: #FFFFFF;
border: 2rpx solid #DDDDDD;
border-radius: 10rpx;
text-align: center;
margin:30rpx auto 0;
margin: 30rpx auto 0;
font-size: 32rpx;
color: #666;
}
}
.no-car-info{
width:100%;
.no-car-info {
width: 100%;
background-color: #fff;
text-align: center;
padding:30rpx 0;
.title{
font-size:28rpx;
padding: 30rpx 0;
.title {
font-size: 28rpx;
color: #666;
}
image{
width:130rpx;height:130rpx;
margin:40rpx 0 20rpx;
image {
width: 130rpx;
height: 130rpx;
margin: 40rpx 0 20rpx;
}
.content{
font-size:28rpx;
.content {
font-size: 28rpx;
}
.no-car-btn{
width:480rpx;
font-size:32rpx;
.no-car-btn {
width: 480rpx;
font-size: 32rpx;
color: #E1251B;
text-align: center;
line-height:80rpx;
border-radius:50rpx;
line-height: 80rpx;
border-radius: 50rpx;
border: 2rpx solid #F4B1AD;
margin:30rpx auto 0;
margin: 30rpx auto 0;
}
}
.form-data{
.form-data {
position: relative;
top:-6rpx;
top: -6rpx;
background-color: #fff;
margin-bottom:40rpx;
margin-bottom: 40rpx;
box-sizing: border-box;
padding:0 40rpx;
.form-item{
height:100rpx;
padding: 0 40rpx;
.form-item {
height: 100rpx;
line-height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
&:first-child{
border-bottom:2rpx solid rgba(0,0,0,.1);
&:first-child {
border-bottom: 2rpx solid rgba(0, 0, 0, .1);
}
.item-text{
.item-text {
font-size: 32rpx;
}
.item-input{
.item-input {
font-size: 28rpx;
text-align: right;
color: #333;
display: flex;
justify-content: space-around;
align-items: center;
.code{
height:50rpx;
line-height:50rpx;
.code {
height: 50rpx;
line-height: 50rpx;
font-size: 26rpx;
padding-left:20rpx;
border-left: 2rpx solid rgba(0,0,0,.1);
margin-left:20rpx;
padding-left: 20rpx;
border-left: 2rpx solid rgba(0, 0, 0, .1);
margin-left: 20rpx;
color: #BBBBBB;
}
}
.car-num{
width:500rpx;
.car-num {
width: 500rpx;
}
}
}
// 爱车列表
.love_car_list{
padding:30rpx 40rpx;
.love_title{
.love_car_list {
padding: 30rpx 40rpx;
.love_title {
text-align: center;
font-size: 36rpx;
font-weight: bold;
margin-bottom:30rpx;
margin-bottom: 30rpx;
position: relative;
text{
text {
position: absolute;
right:20rpx;
top:-4rpx;
font-size:40rpx;
font-weight:500;
right: 20rpx;
top: -4rpx;
font-size: 40rpx;
font-weight: 500;
color: #666;
}
}
.love_list{
height:400rpx;
.love_list {
height: 400rpx;
overflow: auto;
.love_item{
padding:20rpx 0;
.love_item {
padding: 20rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
border-top: 2rpx solid #E8E8E8;
&:first-child{
border:none;
&:first-child {
border: none;
}
image{
width:100rpx;height:100rpx;
image {
width: 100rpx;
height: 100rpx;
}
.love_info{
width:450rpx;
>view{
&:first-child{
font-size:34rpx;
.love_info {
width: 450rpx;
>view {
&:first-child {
font-size: 34rpx;
font-weight: bold;
margin-bottom:10rpx;
margin-bottom: 10rpx;
}
&:last-child{
&:last-child {
font-size: 28rpx;
color:#666;
color: #666;
}
}
}
.radio{
width:60rpx;
>image{
width:48rpx;height:48rpx;
.radio {
width: 60rpx;
>image {
width: 48rpx;
height: 48rpx;
}
}
}
}
.love_btn{
padding:50rpx;
.love_btn {
padding: 50rpx;
button {
height:80rpx;
line-height:80rpx;
border-radius:50rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 50rpx;
background: linear-gradient(150deg, #E1251B, #E14A1B);
box-shadow: 0 6rpx 13rpx 2rpx rgba(225, 50, 27, 0.17);
border:0;
font-size:32rpx !important;
border: 0;
font-size: 32rpx !important;
}
}
}
}
}
</style>
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