diff --git a/api/common.js b/api/common.js
index 8307db7..d775b09 100644
--- a/api/common.js
+++ b/api/common.js
@@ -35,3 +35,9 @@ export const articleInfoReq = id => get(`/cms/cms-article/${id}`)
export const articleCateReq = params => get('/cms/article-category', {params})
export const openDoorReq = serial => get(`/zhsq/zhsq-access-device/openDoor/${serial}`)
+
+export const addPatrolRecordReq = data => post(`/zhsq/zhsq-service-patrol-point-question-record`, data)
+
+export const getPointInfoReq = id => get(`/zhsq/zhsq-service-point/${id}`)
+
+export const adListReq = () => get(`/cms/cms-ad`)
diff --git a/api/service.js b/api/service.js
new file mode 100644
index 0000000..1c89c8d
--- /dev/null
+++ b/api/service.js
@@ -0,0 +1,11 @@
+import post, { get } from "@/api/request";
+
+/**
+ * 服务中心相关API
+ */
+
+// 获取服务列表
+export const getServiceListReq = params => get('/shop/category', { params })
+
+// 获取服务详情
+export const getServiceDetailReq = id => get(`/shop/category/${id}`)
diff --git a/config/index.js b/config/index.js
index faefbb3..95b4bc0 100644
--- a/config/index.js
+++ b/config/index.js
@@ -1,7 +1,7 @@
const MAIN_API_FN = () => {
if (process.env.NODE_ENV === 'development') {
- return 'http://127.0.0.1:9011'
- // return 'https://xq-api.ggsxiangan.com'
+ // return 'http://127.0.0.1:9011'
+ return 'https://xq-api.ggsxiangan.com'
} else {
return 'https://xq-api.ggsxiangan.com'
}
diff --git a/pages.json b/pages.json
index e7b4b7b..ad6e050 100644
--- a/pages.json
+++ b/pages.json
@@ -151,12 +151,34 @@
"style": {
"navigationBarTitleText": "远程开门(访客)"
}
+ },
+ {
+ "path": "pages/adList",
+ "style": {
+ "navigationBarTitleText": "广告列表"
+ }
}
]
},
{
"root": "servicePages",
"pages": [
+ {
+ "path": "pages/index",
+ "style": {
+ "navigationBarTitleText": "服务中心",
+ "navigationBarBackgroundColor": "#87CEEB",
+ "navigationBarTextStyle": "white"
+ }
+ },
+ {
+ "path": "pages/detail",
+ "style": {
+ "navigationBarTitleText": "服务详情",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black"
+ }
+ },
{
"path": "pages/pay",
"style": {
@@ -193,36 +215,42 @@
"navigationBarTitleText": "常用工具"
}
},
- {
- "path": "pages/survey",
- "style": {
- "navigationBarTitleText": "问卷调查"
- }
- },
- {
- "path": "pages/surveyInfo",
- "style": {
- "navigationBarTitleText": "问卷详情"
- }
- },
- {
- "path": "pages/invite",
- "style": {
- "navigationBarTitleText": "访客邀请"
- }
- },
- {
- "path": "pages/suggest",
- "style": {
- "navigationBarTitleText": "投诉建议"
- }
- },
- {
- "path": "pages/fix",
- "style": {
- "navigationBarTitleText": "报修"
- }
- }
+ {
+ "path": "pages/survey",
+ "style": {
+ "navigationBarTitleText": "问卷调查"
+ }
+ },
+ {
+ "path": "pages/surveyInfo",
+ "style": {
+ "navigationBarTitleText": "问卷详情"
+ }
+ },
+ {
+ "path": "pages/invite",
+ "style": {
+ "navigationBarTitleText": "访客邀请"
+ }
+ },
+ {
+ "path": "pages/suggest",
+ "style": {
+ "navigationBarTitleText": "投诉建议"
+ }
+ },
+ {
+ "path": "pages/fix",
+ "style": {
+ "navigationBarTitleText": "报修"
+ }
+ },
+ {
+ "path": "pages/patrol",
+ "style": {
+ "navigationBarTitleText": "巡更"
+ }
+ }
]
}
],
diff --git a/pages/ai/index.vue b/pages/ai/index.vue
index 0b60227..df6f6bd 100644
--- a/pages/ai/index.vue
+++ b/pages/ai/index.vue
@@ -66,6 +66,7 @@
+
@@ -79,10 +80,12 @@ import {dictDataReq} from "@/api/common";
import {userRoomListReq} from "@/api/room";
import {listBillReq} from "@/api/bill";
import BillItem from "@/pages/ai/components/BillItem.vue";
+import Login from "@/components/Login.vue";
+import {userInfoReq} from "@/api/user";
export default {
name: "index",
- components: {BillItem, HeaderItem},
+ components: {Login, BillItem, HeaderItem},
data() {
return {
list: [],
@@ -90,7 +93,9 @@ export default {
content: '',
taskId: null,
roomList: null,
+ userData: null,
answering: false,
+ isLogin: false,
billList: [],
}
},
@@ -102,6 +107,12 @@ export default {
const {data} = await dictDataReq({dictId: '165'})
this.questionList = data
},
+ async getUserData() {
+ const {data} = await userInfoReq()
+ this.userData = data
+ this.isLogin = true
+ this.ws()
+ },
async getWelcomeWord() {
const {data} = await dictDataReq({dictId: '1435'})
this.list.push({
@@ -114,6 +125,7 @@ export default {
console.log(this.list)
},
async send(content = null) {
+ if (!this.isLogin) return this.$refs.Login.open()
const contentItem = content || this.content
// console.log(contentItem, this.content)
if (!contentItem.trim()) return this.$toast('请输入提问内容')
@@ -136,7 +148,7 @@ export default {
this.taskId = null
sendChatReq({
query: contentItem,
- user: getUserInfo().uid
+ user: this.userData.userId,
}).then(() => {
this.list[this.list.length - 1].done = true
this.answering = false
@@ -158,7 +170,9 @@ export default {
taskId: this.taskId
})
this.answering = false
- uni.closeSocket()
+ this.list.splice(this.list.length - 1, 1)
+
+ // uni.closeSocket()
},
async getRoomList() {
const {data} = await userRoomListReq()
@@ -204,70 +218,78 @@ export default {
console.error('获取账单数据失败:', error);
}
},
+ ws() {
+ uni.connectSocket({
+ url: `${WS_API}/${this.userData.userId}`
+ })
+ uni.onSocketMessage(async res => {
+ // console.log(res.data)
+ if (res.data.includes('连接成功')) return
+ const aiData = JSON.parse(res.data)
+ this.list[this.list.length - 1].loading = false
+ if (aiData.answer !== '__END__' && !this.list[this.list.length - 1].isMine) {
+ this.list[this.list.length - 1].type = 'text'
+ this.list[this.list.length - 1].content += aiData.answer
+ } else {
+ this.list[this.list.length - 1].done = true
+ const lastContent = this.list[this.list.length - 1].content
+ console.log('check url', lastContent, lastContent.includes(``))
+ if (lastContent.includes(`pages/user/property-bill`)) {
+ await this.getRoomList()
+ this.list.push({
+ content: '',
+ isMine: false,
+ loading: false,
+ done: true,
+ type: 'bill'
+ })
+ } else if (lastContent.includes(`servicePages/pages/suggest`) || lastContent.includes(`servicePages/pages/suuggest`)) {
+ this.list.push({
+ content: '点击跳转',
+ isMine: false,
+ loading: false,
+ done: true,
+ type: 'link',
+ url: '/servicePages/pages/suggest'
+ })
+ } else if (lastContent.includes(`servicePages/pages/survey`)) {
+ this.list.push({
+ content: '点击跳转',
+ isMine: false,
+ loading: false,
+ done: true,
+ type: 'link',
+ url: '/servicePages/pages/survey'
+ })
+ } else if (lastContent.includes(`servicePages/pages/fix`)) {
+ this.list.push({
+ content: '点击跳转',
+ isMine: false,
+ loading: false,
+ done: true,
+ type: 'link',
+ url: '/servicePages/pages/fix'
+ })
+ }
+ }
+ this.taskId = aiData.taskId
+ this.scrollToBottom()
+ // console.log(this.list)
+ })
+ }
},
onLoad() {
-
- uni.connectSocket({
- url: `${WS_API}/aiUser`
- })
- uni.onSocketMessage(async res => {
- if (res.data === '连接成功') return
- const aiData = JSON.parse(res.data)
- this.list[this.list.length - 1].loading = false
- if (aiData.answer !== '__END__') {
- this.list[this.list.length - 1].type = 'text'
- this.list[this.list.length - 1].content += aiData.answer
- } else {
- const lastContent = this.list[this.list.length - 1].content
- console.log('check url', lastContent, lastContent.includes(``))
- if (lastContent.includes(``)) {
- await this.getRoomList()
- this.list.push({
- content: '',
- isMine: false,
- loading: false,
- done: true,
- type: 'bill'
- })
- } else if (lastContent.includes(`servicePages/pages/suggest`) || lastContent.includes(``)) {
- this.list.push({
- content: '点击跳转',
- isMine: false,
- loading: false,
- done: true,
- type: 'link',
- url: '/servicePages/pages/suggest'
- })
- } else if (lastContent.includes(`servicePages/pages/survey`)) {
- this.list.push({
- content: '点击跳转',
- isMine: false,
- loading: false,
- done: true,
- type: 'link',
- url: '/servicePages/pages/survey'
- })
- } else if (lastContent.includes(``)) {
- this.list.push({
- content: '点击跳转',
- isMine: false,
- loading: false,
- done: true,
- type: 'link',
- url: '/servicePages/pages/fix'
- })
- }
- }
- this.taskId = aiData.taskId
- this.scrollToBottom()
- console.log(this.list)
- })
this.getWelcomeWord()
},
+ onShow() {
+ if (getUserInfo().token) this.getUserData()
+ },
onUnload() {
+ uni.closeSocket()
this.stopAI()
},
onHide() {
+ uni.closeSocket()
this.stopAI()
},
}
diff --git a/pages/index/index.scss b/pages/index/index.scss
index 297f347..ce0d687 100644
--- a/pages/index/index.scss
+++ b/pages/index/index.scss
@@ -106,7 +106,7 @@
margin: 30rpx 0;
border-radius: 20rpx;
overflow: hidden;
- box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
+ //box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
.ad-img {
width: 100%;
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 53bbd36..a3bc649 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -8,15 +8,15 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -43,7 +43,7 @@
style="width: 80rpx; height: 80rpx"/>
远程开门
-
+
生活缴费
@@ -51,7 +51,18 @@
-
+
+
+
+
+
+
+
+ 查看更多
+
+
-
+
@@ -109,7 +120,7 @@ import Login from "@/components/Login.vue";
import {userInfoReq} from "@/api/user";
import {getUserInfo} from "@/util/user";
import {userRoomListReq} from "@/api/room";
-import {dictDataInfoReq, openDoorReq, pageArticleReq} from "@/api/common";
+import {adListReq, dictDataInfoReq, openDoorReq, pageArticleReq} from "@/api/common";
import dayjs from "dayjs";
import CustomTabbar from "@/components/customTabbar.vue";
@@ -126,6 +137,7 @@ export default {
villageList: [],
currentVillage: null,
articleList: [],
+ adList: [],
isAuditing: true
}
},
@@ -138,6 +150,10 @@ export default {
})
this.articleList = data.list
},
+ async getAdList() {
+ const {data} = await adListReq()
+ this.adList = data
+ },
async getRoomList() {
this.villageList = []
const {data} = await userRoomListReq()
@@ -197,7 +213,7 @@ export default {
async checkAudit() {
const {data} = await dictDataInfoReq(3678)
this.isAuditing = data.dictDataCode === '1'
- }
+ },
},
onLoad() {
const systemInfo = uni.getSystemInfoSync()
@@ -210,6 +226,7 @@ export default {
onShow() {
if (getUserInfo().token) this.getUserData()
this.checkAudit()
+ this.getAdList()
},
onShareAppMessage() {
let path = `/pages/index/index`
diff --git a/pages/service/index.scss b/pages/service/index.scss
index 2813227..4e41c7d 100644
--- a/pages/service/index.scss
+++ b/pages/service/index.scss
@@ -34,7 +34,7 @@
display: flex;
flex-direction: column;
align-items: center;
- padding: 20rpx;
+ padding: 10rpx;
border-radius: 16rpx;
transition: all 0.3s ease;
cursor: pointer;
diff --git a/pages/service/index.vue b/pages/service/index.vue
index de67a42..e65e90e 100644
--- a/pages/service/index.vue
+++ b/pages/service/index.vue
@@ -5,7 +5,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ serviceInfo.name || serviceInfo.title }}
+ {{ serviceInfo.comments }}
+
+
+
+
+ ¥
+ {{ serviceInfo.amount || '0' }}
+ 起
+
+
+ 原价: ¥{{ serviceInfo.originAmount }}
+
+
+
+
+
+
+
+
+ 服务详情
+
+
+
+
+
+
+ 服务名称:
+ {{ serviceInfo.title }}
+
+
+ 服务说明:
+ {{ serviceInfo.comments }}
+
+
+ 服务价格:
+ ¥{{ serviceInfo.amount || '0' }}
+
+
+ 详细描述:
+ {{ serviceInfo.description }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ serviceInfo.title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/servicePages/pages/index.vue b/servicePages/pages/index.vue
new file mode 100644
index 0000000..a392f53
--- /dev/null
+++ b/servicePages/pages/index.vue
@@ -0,0 +1,464 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.title }}
+
+
+
+
+
+
+
+ {{ tab.title }}
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+ {{ item.comments }}
+
+ ¥
+ {{ item.amount }}
+ ¥{{ item.originAmount }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/servicePages/pages/patrol.vue b/servicePages/pages/patrol.vue
new file mode 100644
index 0000000..77e912c
--- /dev/null
+++ b/servicePages/pages/patrol.vue
@@ -0,0 +1,294 @@
+
+
+
+
+ 巡更名称
+ {{ patrolName }}
+
+
+
+ 上报描述
+
+
+
+ 异常图片
+
+
+
+
+ ×
+
+
+ +
+
+
+
+
+
+ 处理描述
+
+
+
+
+ 处理图片
+
+
+
+
+ ×
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/userPages/pages/adList.vue b/userPages/pages/adList.vue
new file mode 100644
index 0000000..0d7275d
--- /dev/null
+++ b/userPages/pages/adList.vue
@@ -0,0 +1,37 @@
+
+
+
+
+ {{ item.name }}
+ {{ dayjs(item.createTime).format('YYYY-MM-DD') }}
+
+
+
+
+
+
+
\ No newline at end of file