|
@@ -0,0 +1,280 @@
|
|
|
|
+<template>
|
|
|
|
+ <view class="pages flex flex_column">
|
|
|
|
+ <view class="forms">
|
|
|
|
+ <view class="forms-tits">车辆信息</view>
|
|
|
|
+ <view class="flex align_center">
|
|
|
|
+ <view class="labes">车辆品牌:</view>
|
|
|
|
+ <view class="inputs">日产(东风)</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex align_center">
|
|
|
|
+ <view class="labes">车型:</view>
|
|
|
|
+ <view class="inputs">轩逸</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex align_center">
|
|
|
|
+ <view class="labes">里程数:</view>
|
|
|
|
+ <view class="inputs">{{carInfo.mileage}}KM</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex align_center">
|
|
|
|
+ <view class="labes">车牌号:</view>
|
|
|
|
+ <view class="inputs">{{carInfo.carNo}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="forms">
|
|
|
|
+ <view class="forms-tits">客户联系方式</view>
|
|
|
|
+ <view class="flex align_center">
|
|
|
|
+ <view class="labes"><text>*</text>客户姓名:</view>
|
|
|
|
+ <view class="inputs"><u-input :focus="focusInput" v-model="form.customerName" maxlength="30" border clearable type="text" placeholder="请输入客户姓名"></u-input></view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex align_center">
|
|
|
|
+ <view class="labes"><text>*</text>手机号码:</view>
|
|
|
|
+ <view class="inputs"><u-input v-model="form.phone" type="number" maxlength="11" border clearable placeholder="请输入手机号码"></u-input></view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex align_center">
|
|
|
|
+ <view class="labes"><text>*</text>验证码:</view>
|
|
|
|
+ <view class="inputs"><u-input v-model="form.vericode" type="number" maxlength="6" border clearable placeholder="请输入验证码"></u-input></view>
|
|
|
|
+ <view class="btns" @click="checkMobile()" >{{codeText}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="forms-foot flex align_center">
|
|
|
|
+ <u-checkbox v-model="checkedXy"></u-checkbox>
|
|
|
|
+ <text class="links">您已知晓《XXX轮胎质保法律条款》</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="buttons flex align_center">
|
|
|
|
+ <u-button type="default" @click="toBack">上一步</u-button>
|
|
|
|
+ <u-button type="primary" @click="saveForm">确定</u-button>
|
|
|
|
+ </view>
|
|
|
|
+ <!-- 图文验证码 -->
|
|
|
|
+ <uni-popup @change="changeModal" ref="imageTxtPopup" type="center">
|
|
|
|
+ <popup-con title="图文验证码" :popBtn="popBtn" :changeImg="changeImg" @captchaImg="captchaVerify"></popup-con>
|
|
|
|
+ </uni-popup>
|
|
|
|
+ </view>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
|
+ import popupCon from '@/components/uni-popup/popup-con.vue'
|
|
|
|
+ import {
|
|
|
|
+ isvalidPhone
|
|
|
|
+ } from '@/libs/validate.js'
|
|
|
|
+ export default {
|
|
|
|
+ components: {
|
|
|
|
+ uniPopup,
|
|
|
|
+ popupCon
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ changeImg: false, // 是否重新更换图形验证码
|
|
|
|
+ randomCode: '', // 图片验证码随机码
|
|
|
|
+ popBtn: [], // name为操作按钮名称,color为操作按钮颜色值
|
|
|
|
+ codeText: '获取验证码',
|
|
|
|
+ getCodeing: false,
|
|
|
|
+ totalTime: 60,
|
|
|
|
+ isDisabled: false ,// 倒计时按钮是否禁用
|
|
|
|
+ checkedXy: true,
|
|
|
|
+ carInfo:{
|
|
|
|
+ vinCode: '',
|
|
|
|
+ mileage: '',
|
|
|
|
+ carNo: ''
|
|
|
|
+ },
|
|
|
|
+ form:{
|
|
|
|
+ customerName: '',
|
|
|
|
+ phone: '',
|
|
|
|
+ vericode: ''
|
|
|
|
+ },
|
|
|
|
+ uuid: [],
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onLoad() {
|
|
|
|
+ const tempData = this.$store.state.vuex_uuidTempData
|
|
|
|
+ this.uuid = tempData&&tempData.uuid ? tempData.uuid : [],
|
|
|
|
+ this.carInfo = Object.assign(this.carInfo, tempData.carInfo)
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ toBack(){
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ },
|
|
|
|
+ // 获取验证码
|
|
|
|
+ getCode() {
|
|
|
|
+ let sid = null
|
|
|
|
+ sid = setInterval(() => {
|
|
|
|
+ if (this.totalTime > 0) {
|
|
|
|
+ this.totalTime = this.totalTime - 1
|
|
|
|
+ this.codeText = '已发送' + this.totalTime + 's'
|
|
|
|
+ if (this.totalTime < 60) {
|
|
|
|
+ this.isDisabled = true
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.isDisabled = false
|
|
|
|
+ clearInterval(sid)
|
|
|
|
+ this.getCodeing = false
|
|
|
|
+ this.codeText = '获取验证码'
|
|
|
|
+ this.totalTime = 60
|
|
|
|
+ }
|
|
|
|
+ }, 1000)
|
|
|
|
+ },
|
|
|
|
+ // 验证手机
|
|
|
|
+ checkMobile() {
|
|
|
|
+ if(this.isDisabled){return}
|
|
|
|
+ if (!this.getCodeing) {
|
|
|
|
+ if (this.form.phone) {
|
|
|
|
+ console.log(!isvalidPhone(this.form.phone))
|
|
|
|
+ if (!isvalidPhone(this.form.phone)) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请输入正确的手机号码',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ } else {
|
|
|
|
+ this.getCodeing = true
|
|
|
|
+ this.retsetCode()
|
|
|
|
+ // 图文验证码
|
|
|
|
+ this.$refs.imageTxtPopup.open()
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请输入手机号码',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ changeModal(val) {
|
|
|
|
+ if (val.show == false) {
|
|
|
|
+ this.getCodeing = false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 验证图片验证码
|
|
|
|
+ captchaVerify(code, nowRandomCode) {
|
|
|
|
+ const _this = this
|
|
|
|
+ let obj = {}
|
|
|
|
+ obj.mobile = this.form.phone
|
|
|
|
+ obj.random = nowRandomCode
|
|
|
|
+ obj.code = code
|
|
|
|
+ obj.signName = '修配易码通'
|
|
|
|
+ obj.openid = this.$store.state.vuex_openid
|
|
|
|
+ // 发送短信验证码
|
|
|
|
+ sendLoginVerifyCode(obj).then(res => {
|
|
|
|
+ console.log(JSON.stringify(res.data))
|
|
|
|
+ if (res.status == 200) { // 验证码输入正确
|
|
|
|
+ _this.randomCode = nowRandomCode // 图片验证码随机码
|
|
|
|
+ // 关闭 图形验证码 弹框
|
|
|
|
+ _this.$refs.imageTxtPopup.close()
|
|
|
|
+ // 开启倒计时
|
|
|
|
+ _this.getCode()
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '验证码发送成功'
|
|
|
|
+ })
|
|
|
|
+ } else { // 验证码输入错误
|
|
|
|
+ _this.retsetCode()
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: res.message,
|
|
|
|
+ duration: 5000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 重新触发获取图片验证码
|
|
|
|
+ retsetCode() {
|
|
|
|
+ const _this = this
|
|
|
|
+ _this.code = ''
|
|
|
|
+ _this.randomCode = ''
|
|
|
|
+ // 切换验证码重新校验
|
|
|
|
+ _this.changeImg = false
|
|
|
|
+ _this.$nextTick(function() {
|
|
|
|
+ _this.changeImg = true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ saveForm(){
|
|
|
|
+ if(this.form.customerName == ''){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '请输入客户名称'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.form.phone == ''){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '请输入电话号码'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.form.vericode == ''){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '请输入验证码'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$store.state.vuex_uuidTempData.customerInfo = this.form
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: "/pagesA/qualityPolicy/resultOrder"
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less">
|
|
|
|
+.pages{
|
|
|
|
+ height: 100vh;
|
|
|
|
+ background: #f8f8f8;
|
|
|
|
+ padding-bottom: 6rem;
|
|
|
|
+ overflow: auto;
|
|
|
|
+
|
|
|
|
+ .buttons{
|
|
|
|
+ padding: 1rem 2rem 2rem;
|
|
|
|
+ position: fixed;
|
|
|
|
+ width: 100%;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ background: #fff;
|
|
|
|
+ z-index: 10000;
|
|
|
|
+ border-top: 1px solid #eee;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ /deep/ .u-btn{
|
|
|
|
+ width: 7rem;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.forms{
|
|
|
|
+ background: #fff;
|
|
|
|
+ .forms-tits{
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ color: #333;
|
|
|
|
+ }
|
|
|
|
+ .forms-foot{
|
|
|
|
+ padding-left: 1.5rem;
|
|
|
|
+ .links{
|
|
|
|
+ color: #999;
|
|
|
|
+ }
|
|
|
|
+ /deep/.u-checkbox__label{
|
|
|
|
+ margin-right: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ > view{
|
|
|
|
+ border-bottom: 1px solid #eee;
|
|
|
|
+ padding: 0.6rem 1rem;
|
|
|
|
+ }
|
|
|
|
+ .labes{
|
|
|
|
+ width: 5.2rem;
|
|
|
|
+ text{
|
|
|
|
+ color: red;
|
|
|
|
+ margin-right: 5px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .inputs{
|
|
|
|
+ flex-grow: 1;
|
|
|
|
+ }
|
|
|
|
+ .btns{
|
|
|
|
+ padding: 0 0.3rem;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: dodgerblue;
|
|
|
|
+ font-size: 0.8rem;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|