|
@@ -33,12 +33,21 @@
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import {
|
|
import {
|
|
|
- ref
|
|
|
|
|
|
|
+ ref,
|
|
|
|
|
+ onMounted
|
|
|
} from 'vue'
|
|
} from 'vue'
|
|
|
import {
|
|
import {
|
|
|
myRequest
|
|
myRequest
|
|
|
} from "../../util/api.js"
|
|
} from "../../util/api.js"
|
|
|
|
|
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ const accredit = uni.getStorageSync('accredit')
|
|
|
|
|
+
|
|
|
|
|
+ if (accredit) {
|
|
|
|
|
+ submit()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
const name = ref(uni.getStorageSync('form_name') || '')
|
|
const name = ref(uni.getStorageSync('form_name') || '')
|
|
|
const phone = ref(uni.getStorageSync('form_phone') || '')
|
|
const phone = ref(uni.getStorageSync('form_phone') || '')
|
|
|
const company = ref(uni.getStorageSync('form_company') || '')
|
|
const company = ref(uni.getStorageSync('form_company') || '')
|
|
@@ -91,7 +100,7 @@
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
uni.setStorageSync('form_name', name.value);
|
|
uni.setStorageSync('form_name', name.value);
|
|
|
uni.setStorageSync('form_phone', phone.value);
|
|
uni.setStorageSync('form_phone', phone.value);
|
|
|
uni.setStorageSync('form_company', company.value);
|
|
uni.setStorageSync('form_company', company.value);
|
|
@@ -100,62 +109,60 @@
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
|
content: '本次操作需要获取您的手机号码',
|
|
content: '本次操作需要获取您的手机号码',
|
|
|
- success: (res)=> {
|
|
|
|
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url:"/pages/authorization/authorization"
|
|
|
|
|
|
|
+ url: "/pages/authorization/authorization"
|
|
|
})
|
|
})
|
|
|
} else if (res.cancel) {
|
|
} else if (res.cancel) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- submit()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '确认提交吗',
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ submit()
|
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
|
|
|
|
- const submit = () => {
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: '提示',
|
|
|
|
|
- content: '确认提交吗',
|
|
|
|
|
- success: async (res) => {
|
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
- const res = await myRequest({
|
|
|
|
|
- url: "/informationReporting/add",
|
|
|
|
|
- method: "post",
|
|
|
|
|
- data: {
|
|
|
|
|
- name: name.value,
|
|
|
|
|
- phone: phone.value,
|
|
|
|
|
- company: company.value,
|
|
|
|
|
- content: content.value,
|
|
|
|
|
- wxPhone: wxPhone.value,
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- // console.log(res)
|
|
|
|
|
- if (res.success && res.code == 1) {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '提交成功',
|
|
|
|
|
- duration: 3000
|
|
|
|
|
- })
|
|
|
|
|
- content.value = ''
|
|
|
|
|
- uni.setStorageSync('form_content','')
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: res.message,
|
|
|
|
|
- icon: 'error'
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
- } else if (res.cancel) {
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // uni.navigateTo({
|
|
|
|
|
- // url:"/pages/authorization/authorization"
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ const submit = async () => {
|
|
|
|
|
+ const res = await myRequest({
|
|
|
|
|
+ url: "/informationReporting/add",
|
|
|
|
|
+ method: "post",
|
|
|
|
|
+ data: {
|
|
|
|
|
+ name: name.value,
|
|
|
|
|
+ phone: phone.value,
|
|
|
|
|
+ company: company.value,
|
|
|
|
|
+ content: content.value,
|
|
|
|
|
+ wxPhone: wxPhone.value,
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ if (res.success && res.code == 1) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '提交成功',
|
|
|
|
|
+ duration: 3000
|
|
|
|
|
+ })
|
|
|
|
|
+ content.value = ''
|
|
|
|
|
+ uni.setStorageSync('form_content', '')
|
|
|
|
|
+ uni.setStorageSync('accredit', false)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res.message,
|
|
|
|
|
+ icon: 'error'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|