diff --git a/api/information.js b/api/information.js new file mode 100644 index 0000000..64ed887 --- /dev/null +++ b/api/information.js @@ -0,0 +1,14 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const Submit = BASE_URL + '/visitor/apply/submit' + +/** + * 提交访客记录 + * @param {*} + */ +export function getSubmit(data) { + useNetWork(); + return fetch.post(Submit,data).then(res => res); +} \ No newline at end of file diff --git a/api/information.js b/api/information.js new file mode 100644 index 0000000..64ed887 --- /dev/null +++ b/api/information.js @@ -0,0 +1,14 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const Submit = BASE_URL + '/visitor/apply/submit' + +/** + * 提交访客记录 + * @param {*} + */ +export function getSubmit(data) { + useNetWork(); + return fetch.post(Submit,data).then(res => res); +} \ No newline at end of file diff --git a/api/user.js b/api/user.js index 115f7c4..0588bf2 100644 --- a/api/user.js +++ b/api/user.js @@ -21,7 +21,7 @@ */ export function getUserType() { useNetWork(); - return fetch.get(UserType).then(res => console.log(res)); + return fetch.get(UserType).then(res => res); } /** @@ -31,19 +31,11 @@ export function getUserRegister(data) { useNetWork(); const params = { - + phone:data.phone, + account:data.account, + name:data.name, + salt:data.salt } return fetch.post(UserRegister,params).then(res => res); } -/** - * 修改图片 - * @param {*} - */ -export function getUpdateUserImg(data) { - useNetWork(); - const params = { - - } - return fetch.post(UpdateUserImg,params).then(res => res); -} \ No newline at end of file diff --git a/api/information.js b/api/information.js new file mode 100644 index 0000000..64ed887 --- /dev/null +++ b/api/information.js @@ -0,0 +1,14 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const Submit = BASE_URL + '/visitor/apply/submit' + +/** + * 提交访客记录 + * @param {*} + */ +export function getSubmit(data) { + useNetWork(); + return fetch.post(Submit,data).then(res => res); +} \ No newline at end of file diff --git a/api/user.js b/api/user.js index 115f7c4..0588bf2 100644 --- a/api/user.js +++ b/api/user.js @@ -21,7 +21,7 @@ */ export function getUserType() { useNetWork(); - return fetch.get(UserType).then(res => console.log(res)); + return fetch.get(UserType).then(res => res); } /** @@ -31,19 +31,11 @@ export function getUserRegister(data) { useNetWork(); const params = { - + phone:data.phone, + account:data.account, + name:data.name, + salt:data.salt } return fetch.post(UserRegister,params).then(res => res); } -/** - * 修改图片 - * @param {*} - */ -export function getUpdateUserImg(data) { - useNetWork(); - const params = { - - } - return fetch.post(UpdateUserImg,params).then(res => res); -} \ No newline at end of file diff --git a/common/fetch.js b/common/fetch.js index d851aac..11941a4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -24,12 +24,12 @@ if (data.data.code === 200) { resolve(data.data); } else { - uni.showToast({ - title: '系统异常,请稍后再试!', - icon: 'none', - duration: 2000, - }) - reject(data); + uni.showToast({ + title: `${data.data.message}`, + icon: 'none', + duration: 2000, + }) + resolve(data); } } else { reject(data); diff --git a/api/information.js b/api/information.js new file mode 100644 index 0000000..64ed887 --- /dev/null +++ b/api/information.js @@ -0,0 +1,14 @@ +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; +import useNetWork from '@/common/useNetWork.js'; + +const Submit = BASE_URL + '/visitor/apply/submit' + +/** + * 提交访客记录 + * @param {*} + */ +export function getSubmit(data) { + useNetWork(); + return fetch.post(Submit,data).then(res => res); +} \ No newline at end of file diff --git a/api/user.js b/api/user.js index 115f7c4..0588bf2 100644 --- a/api/user.js +++ b/api/user.js @@ -21,7 +21,7 @@ */ export function getUserType() { useNetWork(); - return fetch.get(UserType).then(res => console.log(res)); + return fetch.get(UserType).then(res => res); } /** @@ -31,19 +31,11 @@ export function getUserRegister(data) { useNetWork(); const params = { - + phone:data.phone, + account:data.account, + name:data.name, + salt:data.salt } return fetch.post(UserRegister,params).then(res => res); } -/** - * 修改图片 - * @param {*} - */ -export function getUpdateUserImg(data) { - useNetWork(); - const params = { - - } - return fetch.post(UpdateUserImg,params).then(res => res); -} \ No newline at end of file diff --git a/common/fetch.js b/common/fetch.js index d851aac..11941a4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -24,12 +24,12 @@ if (data.data.code === 200) { resolve(data.data); } else { - uni.showToast({ - title: '系统异常,请稍后再试!', - icon: 'none', - duration: 2000, - }) - reject(data); + uni.showToast({ + title: `${data.data.message}`, + icon: 'none', + duration: 2000, + }) + resolve(data); } } else { reject(data); diff --git a/pages/information/information.vue b/pages/information/information.vue index 483551b..8bfbb31 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -2,39 +2,39 @@ - - + + - - + + - - + + - - {{callerInfo.purpose || '请选择访客目的'}} + + {{callerInfo.visitReason || '请选择访客目的'}} - - {{callerInfo.building || '请选择访客楼栋'}} + + {{callerInfo.visitPosition || '请选择访客楼栋'}} - + - {{`开始时间:${callerInfo.time}`}} - {{`结束时间:${callerInfo.endTime}`}} + {{`开始时间:${callerInfo.inTime}`}} + {{`结束时间:${callerInfo.outTime}`}} - - + + - + - + @@ -50,7 +50,7 @@