|
@@ -49,7 +49,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="item-value from-item-code">
|
|
<view class="item-value from-item-code">
|
|
<u--input class="code-input" placeholder="请输入内容" border="surround" v-model="from.validCode" />
|
|
<u--input class="code-input" placeholder="请输入内容" border="surround" v-model="from.validCode" />
|
|
- <image class="code-img" :src="CaptchaImg" mode="scaleToFill" />
|
|
|
|
|
|
+ <image class="code-img" :src="CaptchaImg" mode="scaleToFill" @click.stop="getPicCaptcha()" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="from-item file-box">
|
|
<view class="from-item file-box">
|
|
@@ -96,17 +96,34 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init() {
|
|
init() {
|
|
|
|
+ this.getPicCaptcha()
|
|
this.from = {
|
|
this.from = {
|
|
score: 0,
|
|
score: 0,
|
|
feedbackType: undefined,
|
|
feedbackType: undefined,
|
|
phone: undefined,
|
|
phone: undefined,
|
|
feedbackContent: undefined,
|
|
feedbackContent: undefined,
|
|
validCode: undefined,
|
|
validCode: undefined,
|
|
- attachmentList: undefined
|
|
|
|
|
|
+ attachmentList: undefined,
|
|
|
|
+ validCodeReqNo:undefined
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getLable(val){
|
|
|
|
- const item = this.FeedbackType.find(el => el.value === val)
|
|
|
|
|
|
+ async getPicCaptcha() {
|
|
|
|
+ try {
|
|
|
|
+ const data = await getPicCaptcha_Api();
|
|
|
|
+ console.log("data == ", data)
|
|
|
|
+ if (data) {
|
|
|
|
+ this.CaptchaImg = data.validCodeBase64;
|
|
|
|
+ this.from.validCodeReqNo = data.validCodeReqNo;
|
|
|
|
+ };
|
|
|
|
+ } catch (error) {
|
|
|
|
+
|
|
|
|
+ //TODO handle the exception
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ getLable(val) {
|
|
|
|
+ const item = this.FeedbackType.find(el => el.value === val)
|
|
return item ? item.label : item
|
|
return item ? item.label : item
|
|
},
|
|
},
|
|
isPlaceholder(val) {
|
|
isPlaceholder(val) {
|
|
@@ -160,25 +177,16 @@
|
|
if (!regex.test(phone) || phone.length !== 11) {
|
|
if (!regex.test(phone) || phone.length !== 11) {
|
|
throw new Error("请输入正确的手机号码")
|
|
throw new Error("请输入正确的手机号码")
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
throw new Error("请输入手机号码")
|
|
throw new Error("请输入手机号码")
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
if (!this.from.feedbackContent) {
|
|
if (!this.from.feedbackContent) {
|
|
throw new Error("请输入建议内容")
|
|
throw new Error("请输入建议内容")
|
|
}
|
|
}
|
|
if (this.CaptchaImg && !this.from.validCode) {
|
|
if (this.CaptchaImg && !this.from.validCode) {
|
|
throw new Error("请输入验证码")
|
|
throw new Error("请输入验证码")
|
|
}
|
|
}
|
|
- const { data } = await getPicCaptcha_Api();
|
|
|
|
- if (data) {
|
|
|
|
- this.CaptchaImg = data;
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '请先输入验证码',
|
|
|
|
- icon: 'none'
|
|
|
|
- });
|
|
|
|
- return
|
|
|
|
- };
|
|
|
|
await addMapuserfeedback_Api(this.from)
|
|
await addMapuserfeedback_Api(this.from)
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '提交成功'
|
|
title: '提交成功'
|