| | |
| | | 完整语音: |
| | | <mini-audio |
| | | :audio-source=" |
| | | voice ? voice : 'https://example.com/example.mp3' |
| | | voice ? voice : '@assets/order/example.mp3' |
| | | " |
| | | ></mini-audio> |
| | | </div> |
| | |
| | | :audio-source=" |
| | | item.questionvoice |
| | | ? item.questionvoice |
| | | : 'https://example.com/example.mp3' |
| | | : '@assets/order/example.mp3' |
| | | " |
| | | ></mini-audio> |
| | | </div> |
| | |
| | | }) |
| | | .catch(() => { |
| | | if (this.form.serviceType == 13) { |
| | | if (this.visitCount) { |
| | | if (this.visitCount!=1) { |
| | | this.$router.push({ |
| | | path: "/logisticsservice/zbAgain", |
| | | }); |
| | |
| | | }); |
| | | } |
| | | } else if (this.form.serviceType == 2) { |
| | | if (this.visitCount) { |
| | | if (this.visitCount!=1) { |
| | | this.$router.push({ |
| | | path: "/logisticsservice/again", |
| | | }); |
| | |
| | | }); |
| | | }, |
| | | // 验证电话号码格式并返回错误信息 |
| | | validatePhoneNumber(phone) { |
| | | if (!phone) { |
| | | return { isValid: false, message: '请输入电话号码' }; |
| | | } |
| | | validatePhoneNumber(phone) { |
| | | if (!phone) { |
| | | return { isValid: false, message: "请输入电话号码" }; |
| | | } |
| | | |
| | | // 手机号正则 |
| | | const mobileRegex = /^1[3-9]\d{9}$/; |
| | | // 手机号正则 |
| | | const mobileRegex = /^1[3-9]\d{9}$/; |
| | | |
| | | // 带区号的固定电话(完整格式) |
| | | const landlineFullRegex = /^0\d{2,3}-?\d{7,8}$/; |
| | | // 带区号的固定电话(完整格式) |
| | | const landlineFullRegex = /^0\d{2,3}-?\d{7,8}$/; |
| | | |
| | | // 不带区号的固定电话(仅本地号码) |
| | | const landlineLocalRegex = /^\d{7,8}$/; |
| | | // 不带区号的固定电话(仅本地号码) |
| | | const landlineLocalRegex = /^\d{7,8}$/; |
| | | |
| | | if (mobileRegex.test(phone)) { |
| | | return { isValid: true, type: 'mobile' }; |
| | | } else if (landlineFullRegex.test(phone)) { |
| | | return { isValid: true, type: 'landline' }; |
| | | } else if (landlineLocalRegex.test(phone)) { |
| | | return { |
| | | isValid: false, |
| | | message: '本地号码请添加区号(如028-1234567)' |
| | | }; |
| | | } else { |
| | | return { |
| | | isValid: false, |
| | | message: '请输入正确的电话号码(手机号或带区号的固定电话)' |
| | | }; |
| | | } |
| | | }, |
| | | if (mobileRegex.test(phone)) { |
| | | return { isValid: true, type: "mobile" }; |
| | | } else if (landlineFullRegex.test(phone)) { |
| | | return { isValid: true, type: "landline" }; |
| | | } else if (landlineLocalRegex.test(phone)) { |
| | | return { |
| | | isValid: false, |
| | | message: "本地号码请添加区号(如028-1234567)", |
| | | }; |
| | | } else { |
| | | return { |
| | | isValid: false, |
| | | message: "请输入正确的电话号码(手机号或带区号的固定电话)", |
| | | }; |
| | | } |
| | | }, |
| | | |
| | | // 使用示例 |
| | | isValidPhone(phone) { |
| | | return this.validatePhoneNumber(phone).isValid; |
| | | }, |
| | | // 使用示例 |
| | | isValidPhone(phone) { |
| | | return this.validatePhoneNumber(phone).isValid; |
| | | }, |
| | | handleCall(phone, type) { |
| | | if (!this.isValidPhone(phone)) { |
| | | this.$message.error("请输入正确的手机号码"); |
| | |
| | | |
| | | // 处理通话状态变化 |
| | | handleCallStatusChange(status) { |
| | | console.log(status,'status'); |
| | | console.log(status, "status"); |
| | | |
| | | this.callStatus = status.type; |
| | | |
| | |
| | | setupsubtask() { |
| | | this.$refs["zcform"].validate((valid) => { |
| | | if (valid) { |
| | | if (this.form.date1 && new Date(this.form.date1) < new Date()) { |
| | | this.$message.error("随访时间不能小于当前时间"); |
| | | return false; |
| | | } |
| | | this.form.remark = |
| | | this.form.remark + "【" + this.getCurrentTime() + "】"; |
| | | let form = structuredClone(this.form); |