Explorar o código

fix: 接口联调

szr190 hai 2 meses
pai
achega
cdcd7bb67b

+ 1 - 6
src/App.vue

@@ -1,12 +1,7 @@
1 1
 <script setup lang="ts">
2
-import { user } from '@/stores/modules/user'
3 2
 import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
4 3
 
5
-const userStore = user()
6
-
7
-onLaunch(() => {
8
-  //
9
-})
4
+onLaunch(() => {})
10 5
 onShow(() => {
11 6
   console.log('App Show')
12 7
 })

+ 37 - 0
src/api/home.ts

@@ -158,3 +158,40 @@ export const getQuestionDetail = (id: string) => {
158 158
     url: `/other/question/web/${id}`
159 159
   })
160 160
 }
161
+
162
+// 新增问题反馈
163
+export const addQuestionFeedback = (data: any) => {
164
+  return http({
165
+    method: 'POST',
166
+    url: `/operate/feedback/mpAdd`,
167
+    data
168
+  })
169
+}
170
+
171
+// 查询问题反馈列表
172
+export const getQuestionFeedbackList = (data: any) => {
173
+  return http({
174
+    method: 'GET',
175
+    url: `/operate/feedback/mpList`,
176
+    data
177
+  })
178
+}
179
+
180
+// 查询问题反馈详情
181
+export const getQuestionFeedbackDetail = (id: string) => {
182
+  return http({
183
+    method: 'GET',
184
+    url: `/operate/feedback/mp/${id}`
185
+  })
186
+}
187
+
188
+/**
189
+ * @description: 获取banner
190
+ * @return {*}
191
+ */
192
+export const getBannerApi = () => {
193
+  return http<EmptyObjectType[]>({
194
+    method: 'GET',
195
+    url: '/operate/banner/web'
196
+  })
197
+}

+ 2 - 2
src/api/login.ts

@@ -154,9 +154,9 @@ export const phoneLoginApi = (data: { code: string }) => {
154 154
 }
155 155
 
156 156
 // 手机号登录
157
-export const h5PhoneLoginApi = () => {
157
+export const h5PhoneLoginApi = (phone: string) => {
158 158
   return http({
159 159
     method: 'POST',
160
-    url: `/h5PhoneLogin`
160
+    url: `/h5PhoneLogin?phone=${phone}`
161 161
   })
162 162
 }

+ 4 - 5
src/base/common/charge.vue

@@ -5,15 +5,12 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">{{ chargeInfo?.title }}</view>
10
-        <!-- sub title -->
11 9
         <view class="common-sub-title">营业时间:{{ chargeInfo?.businessAt }}</view>
12 10
         <view class="common-sub-title">客服电话:{{ chargeInfo?.mobile }}</view>
13 11
       </view>
14 12
       <view class="common-card">
15 13
         <view class="common-card-title u-margin-bottom-20">当前电价</view>
16
-        <!-- 当前电价及时间展示 -->
17 14
         <view class="charge-current-wrapper">
18 15
           <view class="current-left-wrap">
19 16
             <view class="text">{{ content?.price }}</view>
@@ -46,8 +43,10 @@ onLoad(async () => {
46 43
   const parkId = uni.getStorageSync('parkId')
47 44
   const res = await getParkServicePower(parkId)
48 45
   if (res.code === 200) {
49
-    chargeInfo.value = res.data
50
-    content.value = JSON.parse(chargeInfo.value.content)
46
+    if (res.data) {
47
+      chargeInfo.value = res.data
48
+      content.value = JSON.parse(chargeInfo.value?.content)
49
+    }
51 50
   }
52 51
 })
53 52
 </script>

+ 4 - 5
src/base/common/driversHome.vue

@@ -5,9 +5,7 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">{{ driverInfo?.title }}</view>
10
-        <!-- sub title -->
11 9
         <view class="common-sub-title">营业时间:{{ driverInfo?.businessAt }}</view>
12 10
         <view class="common-sub-title">客服电话:{{ driverInfo?.mobile }}</view>
13 11
       </view>
@@ -39,9 +37,10 @@ onLoad(async () => {
39 37
   const parkId = uni.getStorageSync('parkId')
40 38
   const res = await getParkServiceDriver(parkId)
41 39
   if (res.code === 200) {
42
-    driverInfo.value = res.data
43
-    content.value = JSON.parse(driverInfo.value.content)
44
-    console.log('🚀 ~ content.value:', content.value)
40
+    if (res.data) {
41
+      driverInfo.value = res.data
42
+      content.value = JSON.parse(driverInfo.value?.content)
43
+    }
45 44
   }
46 45
 })
47 46
 </script>

+ 4 - 4
src/base/common/join.vue

@@ -20,8 +20,6 @@
20 20
 import { ref } from 'vue'
21 21
 import { onLoad } from '@dcloudio/uni-app'
22 22
 import { getParkServiceInvestment } from '@/api/home'
23
-import { useGlobal } from '../../composables/index'
24
-const { minioUrl } = useGlobal()
25 23
 
26 24
 // 招商加盟详情
27 25
 const joinInfo = ref<any>({})
@@ -32,8 +30,10 @@ onLoad(async () => {
32 30
   if (parkId) {
33 31
     const res = await getParkServiceInvestment(parkId)
34 32
     if (res.code === 200) {
35
-      joinInfo.value = res.data
36
-      content.value = JSON.parse(joinInfo.value.content)
33
+      if (res.data) {
34
+        joinInfo.value = res.data
35
+        content.value = JSON.parse(joinInfo.value?.content)
36
+      }
37 37
     }
38 38
   }
39 39
 })

+ 4 - 4
src/base/common/nursingRoom.vue

@@ -5,9 +5,7 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">{{ boyInfo?.title }}</view>
10
-        <!-- sub title -->
11 9
         <view class="common-sub-title">营业时间:{{ boyInfo?.businessAt }}</view>
12 10
         <view class="common-sub-title">客服电话:{{ boyInfo?.mobile }}</view>
13 11
       </view>
@@ -39,8 +37,10 @@ onLoad(async () => {
39 37
   const parkId = uni.getStorageSync('parkId')
40 38
   const res = await getParkServiceBoy(parkId)
41 39
   if (res.code === 200) {
42
-    boyInfo.value = res.data
43
-    content.value = JSON.parse(boyInfo.value.content)
40
+    if (res.data) {
41
+      boyInfo.value = res.data
42
+      content.value = JSON.parse(boyInfo.value?.content)
43
+    }
44 44
   }
45 45
 })
46 46
 </script>

+ 0 - 4
src/base/common/refuel.vue

@@ -5,9 +5,7 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">{{ refuelInfo.title }}</view>
10
-        <!-- sub title -->
11 9
         <view class="common-sub-title">营业时间:{{ refuelInfo?.businessAt }}</view>
12 10
         <view class="common-sub-title">客服电话:{{ refuelInfo?.mobile }}</view>
13 11
       </view>
@@ -30,8 +28,6 @@
30 28
 import { ref } from 'vue'
31 29
 import { onLoad } from '@dcloudio/uni-app'
32 30
 import { getParkServiceOil } from '@/api/home'
33
-import { useGlobal } from '../../composables/index'
34
-const { minioUrl } = useGlobal()
35 31
 
36 32
 // 我要加油
37 33
 const refuelInfo = ref<any>({})

+ 4 - 4
src/base/common/repair.vue

@@ -5,9 +5,7 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">{{ carInfo?.title }}</view>
10
-        <!-- sub title -->
11 9
         <view class="common-sub-title">营业时间:{{ carInfo?.businessAt }}</view>
12 10
         <view class="common-sub-title">客服电话:{{ carInfo?.mobile }}</view>
13 11
       </view>
@@ -34,8 +32,10 @@ onLoad(async () => {
34 32
   const parkId = uni.getStorageSync('parkId')
35 33
   const res = await getParkServiceCar(parkId)
36 34
   if (res.code === 200) {
37
-    carInfo.value = res.data
38
-    content.value = JSON.parse(carInfo.value.content)
35
+    if (res.data) {
36
+      carInfo.value = res.data
37
+      content.value = JSON.parse(carInfo.value.content)
38
+    }
39 39
   }
40 40
 })
41 41
 </script>

+ 0 - 2
src/base/common/spot.vue

@@ -5,12 +5,10 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">
10 9
           <view class="text">{{ details.title }}</view>
11 10
           <view class="card-tag">{{ content.level }}</view>
12 11
         </view>
13
-        <!-- sub title -->
14 12
         <view class="common-sub-title">开放时间:{{ details?.businessAt }}</view>
15 13
         <view class="common-sub-title">
16 14
           <view class="text">地址:{{ content?.address }}</view>

+ 6 - 7
src/base/shop/details.vue

@@ -5,14 +5,11 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">{{ details.title }}</view>
10
-        <!-- rate -->
11 9
         <view class="common-card-rate">
12
-          <uni-rate allow-half :value="content.rate" color="#ddd" activeColor="#ff5702" />
10
+          <uni-rate allow-half :value="content.rate" disabled disabledColor="#ff5702" color="#ddd" activeColor="#ff5702" />
13 11
           <text>{{ content.rate }}</text>
14 12
         </view>
15
-        <!-- sub title -->
16 13
         <view class="common-sub-title">营业时间: {{ details.businessAt }}</view>
17 14
       </view>
18 15
       <view class="common-card">
@@ -21,7 +18,7 @@
21 18
           <u-parse :html="content?.intro" />
22 19
         </view>
23 20
         <view class="common-card-title u-margin-top-30">精品推荐</view>
24
-        <view class="common-card-list" v-if="content.facilities.length > 0">
21
+        <view class="common-card-list" v-if="content.facilities?.length > 0">
25 22
           <view class="card-list-item" v-for="(item, index) in content.facilities" :key="index">
26 23
             <view class="item-img-wrap">
27 24
               <image :src="item.img" mode="scaleToFill" />
@@ -50,8 +47,10 @@ onLoad(async (options) => {
50 47
   const parkId = uni.getStorageSync('parkId')
51 48
   const res = await getParkServiceEatDetail(id.value, parkId)
52 49
   if (res.code === 200) {
53
-    details.value = res.data
54
-    content.value = JSON.parse(details.value.content)
50
+    if (res.data) {
51
+      details.value = res.data
52
+      content.value = JSON.parse(details.value?.content || '{}')
53
+    }
55 54
   }
56 55
 })
57 56
 </script>

+ 10 - 8
src/base/shop/detailsShop.vue

@@ -5,23 +5,23 @@
5 5
     </view>
6 6
     <view class="common-content-wrapper">
7 7
       <view class="common-card">
8
-        <!-- common title -->
9 8
         <view class="common-card-title">{{ details.title }}</view>
10
-        <!-- rate -->
11 9
         <view class="common-card-rate">
12
-          <uni-rate allow-half :value="content.rate" color="#ddd" activeColor="#ff5702" />
10
+          <uni-rate allow-half :value="content.rate" disabled disabledColor="#ff5702" color="#ddd" activeColor="#ff5702" />
13 11
           <text>{{ content.rate }}</text>
14 12
         </view>
15
-        <!-- sub title -->
16 13
         <view class="common-sub-title">营业时间: {{ details.businessAt }}</view>
17 14
       </view>
18 15
       <view class="common-card">
19 16
         <view class="common-card-title">店铺简介</view>
20
-        <view class="common-card-content">
17
+        <view class="common-card-content" v-if="content?.intro">
21 18
           <u-parse :html="content?.intro" />
22 19
         </view>
20
+        <view class="common-card-content" v-else>
21
+          <u-empty text="暂无简介" />
22
+        </view>
23 23
         <view class="common-card-title u-margin-top-30">精品推荐</view>
24
-        <view class="common-card-list" v-if="content.facilities.length > 0">
24
+        <view class="common-card-list" v-if="content.facilities?.length > 0">
25 25
           <view class="card-list-item" v-for="(item, index) in content.facilities" :key="index">
26 26
             <view class="item-img-wrap">
27 27
               <image :src="item.img" mode="scaleToFill" />
@@ -50,8 +50,10 @@ onLoad(async (options) => {
50 50
   const parkId = uni.getStorageSync('parkId')
51 51
   const res = await getParkServiceShopDetail(id.value, parkId)
52 52
   if (res.code === 200) {
53
-    details.value = res.data
54
-    content.value = JSON.parse(details.value.content)
53
+    if (res.data) {
54
+      details.value = res.data
55
+      content.value = JSON.parse(details.value?.content || '{}')
56
+    }
55 57
   }
56 58
 })
57 59
 </script>

+ 1 - 1
src/base/shop/index.vue

@@ -8,7 +8,7 @@
8 8
 
9 9
 <script lang="ts" setup>
10 10
 import { ref, computed } from 'vue'
11
-import { onLoad, onShow, onPageScroll } from '@dcloudio/uni-app'
11
+import { onShow, onPageScroll } from '@dcloudio/uni-app'
12 12
 import { getParkServiceShopList } from '@/api/home'
13 13
 import { useListLoader } from '@/composables/useListLoader'
14 14
 

+ 1 - 1
src/base/shop/meal.vue

@@ -8,7 +8,7 @@
8 8
 
9 9
 <script lang="ts" setup>
10 10
 import { ref, computed } from 'vue'
11
-import { onLoad, onShow, onPageScroll } from '@dcloudio/uni-app'
11
+import { onShow, onPageScroll } from '@dcloudio/uni-app'
12 12
 import { getParkServiceEatList } from '@/api/home'
13 13
 import { useListLoader } from '@/composables/useListLoader'
14 14
 

+ 0 - 1
src/base/suggest/details.vue

@@ -1,6 +1,5 @@
1 1
 <template>
2 2
   <view class="notice-detail-container">
3
-    <!-- 详情内容 -->
4 3
     <view class="notice-detail-content">
5 4
       <view class="detail-content-header">
6 5
         <view class="title">{{ detailInfo.title }}</view>

+ 58 - 20
src/base/suggest/record.vue

@@ -1,30 +1,65 @@
1 1
 <template>
2
-  <view class="suggest-record-container">
3
-    <view class="record-item">
4
-      <view class="record-item-header">
5
-        <view class="title u-line-2">功能还有不少需要提升的,需要改进的地方不少希望尽快处理提升完善</view>
6
-        <view class="pic-list">
7
-          <view class="pic-wrap">
8
-            <image src="" mode="scaleToFill" />
2
+  <mescroll-body @init="mescrollInit" :down="{ use: true, minAngle: angle }" @down="downCallback" @up="upCallback">
3
+    <view class="suggest-record-container">
4
+      <view class="record-item" v-for="(item, index) in listData" :key="index">
5
+        <view class="record-item-header" :class="{ borderBottom: item.status === 1 }" :style="{ paddingBottom: item.status === 0 ? '0' : '24rpx' }">
6
+          <view class="title u-line-2">{{ item.content }}</view>
7
+          <view class="pic-list">
8
+            <view class="pic-wrap" v-for="(pic, index) in item.albumPics" :key="index">
9
+              <image :src="pic" mode="aspectFill" @click="previewImage(item.albumPics, index)" />
10
+            </view>
9 11
           </view>
10
-          <view class="pic-wrap">
11
-            <image src="" mode="scaleToFill" />
12
+          <view class="time-status-wrap">
13
+            <view class="time-text">{{ item.publishAt }}</view>
14
+            <view class="status-text" :class="{ warning: item.status === 0 }">{{ item.status === 1 ? '已完结' : '待反馈' }}</view>
12 15
           </view>
13 16
         </view>
14
-        <view class="time-status-wrap">
15
-          <view class="time-text">2025-10-12 12:36:50</view>
16
-          <view class="status-text">已完结</view>
17
+        <view class="record-item-bottom" v-if="item.status === 1">
18
+          <view class="bottom-title-text">{{ item.feedback }}</view>
19
+          <view class="bottom-time-text">{{ item.feedbackAt }}</view>
17 20
         </view>
18 21
       </view>
19
-      <view class="record-item-bottom">
20
-        <view class="bottom-title-text">感谢您对我们的反馈,我们会持续优化, 继续完善!</view>
21
-        <view class="bottom-time-text">2025-10-12 12:36:50</view>
22
-      </view>
23 22
     </view>
24
-  </view>
23
+  </mescroll-body>
25 24
 </template>
26 25
 
27
-<script lang="ts" setup></script>
26
+<script lang="ts" setup>
27
+import { ref } from 'vue'
28
+import { onLoad, onPageScroll } from '@dcloudio/uni-app'
29
+import { getQuestionFeedbackList } from '@/api/home'
30
+import { useListLoader } from '@/composables/useListLoader'
31
+
32
+const angle = ref(45)
33
+// 监听页面滚动
34
+onPageScroll((e) => {
35
+  if (e.scrollTop > 80) {
36
+    angle.value = 90
37
+  } else {
38
+    angle.value = 45
39
+  }
40
+})
41
+
42
+// 图片预览功能
43
+const previewImage = (pics: string[], currentIndex: number) => {
44
+  // 将图片路径转换为完整路径
45
+  const fullImageList = pics.map((pic) => pic)
46
+
47
+  // 调用uni的图片预览API
48
+  uni.previewImage({
49
+    current: fullImageList[currentIndex], // 当前显示图片的http链接
50
+    urls: fullImageList, // 需要预览的图片http链接列表
51
+    loop: true // 是否可循环预览
52
+  })
53
+}
54
+
55
+// 列表加载
56
+const { listData, upCallback, downCallback, handleSearch, mescrollInit } = useListLoader({
57
+  apiFn: getQuestionFeedbackList,
58
+  initialParams: {
59
+    parkId: uni.getStorageSync('parkId')
60
+  }
61
+})
62
+</script>
28 63
 
29 64
 <style lang="scss" scoped>
30 65
 .suggest-record-container {
@@ -36,10 +71,12 @@
36 71
     padding: 34rpx 34rpx 38rpx 34rpx;
37 72
     background-color: #fff;
38 73
     border-radius: 14rpx;
74
+    margin-bottom: 24rpx;
39 75
     .record-item-header {
40 76
       box-sizing: border-box;
41
-      padding-bottom: 24rpx;
42
-      border-bottom: 1rpx solid #f4f5f9;
77
+      &.borderBottom {
78
+        border-bottom: 1rpx solid #f4f5f9;
79
+      }
43 80
       .title {
44 81
         font-size: 28rpx;
45 82
         color: #333;
@@ -88,6 +125,7 @@
88 125
         font-weight: 500;
89 126
         line-height: 42rpx;
90 127
         margin-bottom: 20rpx;
128
+        color: #999;
91 129
       }
92 130
       .bottom-time-text {
93 131
         font-size: 25rpx;

+ 92 - 12
src/base/suggest/suggest.vue

@@ -3,17 +3,22 @@
3 3
     <!-- 问题类型 -->
4 4
     <HyCard title="请选择您要反馈的问题类型">
5 5
       <view class="suggest-type-wrapper">
6
-        <view class="type-item active">现场环境</view>
7
-        <view class="type-item">商家服务</view>
8
-        <view class="type-item">商品问题</view>
9
-        <view class="type-item">价格问题</view>
10
-        <view class="type-item">其他</view>
6
+        <view
7
+          v-for="(item, index) in typeList"
8
+          :key="index"
9
+          class="type-item"
10
+          :class="{ active: index === typeIndex }"
11
+          @click="handleTypeClick(index)"
12
+        >
13
+          {{ item.name }}
14
+        </view>
11 15
       </view>
12 16
     </HyCard>
13 17
     <!-- 描述问题 -->
14 18
     <HyCard title="请描述您的问题">
15 19
       <view class="suggest-common-wrapper">
16 20
         <u-input
21
+          v-model="form.content"
17 22
           type="textarea"
18 23
           :height="328"
19 24
           :maxlength="200"
@@ -25,21 +30,95 @@
25 30
     <!-- 图片描述 -->
26 31
     <HyCard title="图片描述(选填)">
27 32
       <view class="suggest-common-wrapper">
28
-        <u-upload />
33
+        <u-upload ref="uploadRef" width="160" height="160" :action="'/system/oss/upload'" />
29 34
       </view>
30 35
     </HyCard>
31 36
     <!-- 联系方式 -->
32 37
     <HyCard title="联系方式">
33 38
       <view class="suggest-common-wrapper">
34
-        <u-input placeholder="请输入您的联系方式" />
39
+        <u-input v-model="form.phone" placeholder="请输入您的联系方式" />
35 40
       </view>
36 41
     </HyCard>
37 42
     <!-- 提交 -->
38
-    <view class="submit-btn-wrapper">提交</view>
43
+    <view class="submit-btn-wrapper" @click="submit">提交</view>
39 44
   </view>
40 45
 </template>
41 46
 
42
-<script lang="ts" setup></script>
47
+<script lang="ts" setup>
48
+import { computed, reactive, ref, getCurrentInstance } from 'vue'
49
+import { addQuestionFeedback } from '@/api/home'
50
+
51
+const { proxy } = getCurrentInstance() as any
52
+
53
+const typeList = ref([
54
+  { name: '现场环境', value: 1 },
55
+  { name: '商家服务', value: 2 },
56
+  { name: '商品问题', value: 3 },
57
+  { name: '价格问题', value: 4 },
58
+  { name: '其他', value: 5 }
59
+])
60
+const typeIndex = ref(0)
61
+const categoryId = computed(() => typeList.value[typeIndex.value].value)
62
+
63
+const handleTypeClick = (index: number) => {
64
+  typeIndex.value = index
65
+}
66
+
67
+const form = reactive({
68
+  content: '',
69
+  phone: ''
70
+})
71
+
72
+const pics = ref<any>([])
73
+
74
+const submit = () => {
75
+  if (!form.content) {
76
+    uni.showToast({
77
+      title: '请描述您的问题',
78
+      icon: 'none'
79
+    })
80
+    return
81
+  }
82
+  if (!form.phone) {
83
+    uni.showToast({
84
+      title: '请输入您的联系方式',
85
+      icon: 'none'
86
+    })
87
+    return
88
+  }
89
+  // 处理上传的图片
90
+  const files = proxy?.$refs?.uploadRef?.lists.filter((v: any) => v.progress == 100) || []
91
+  files.forEach((file: any) => {
92
+    if (file.response && file.response.data && file.response.data.url) {
93
+      pics.value.push(file.response.data.url)
94
+    }
95
+  })
96
+  // 构造提交参数
97
+  const submitParams = {
98
+    ...form,
99
+    categoryId: categoryId.value,
100
+    albumPics: pics.value,
101
+    parkId: uni.getStorageSync('parkId')
102
+  }
103
+  // 提交到服务器
104
+  addQuestionFeedback(submitParams).then((res: any) => {
105
+    if (res.code == 200) {
106
+      uni.showToast({
107
+        title: '提交成功',
108
+        icon: 'success'
109
+      })
110
+      // 提交成功后,清空表单数据
111
+      form.content = ''
112
+      form.phone = ''
113
+      pics.value = []
114
+      typeIndex.value = 0
115
+      setTimeout(() => {
116
+        uni.navigateBack()
117
+      }, 1000)
118
+    }
119
+  })
120
+}
121
+</script>
43 122
 
44 123
 <style lang="scss" scoped>
45 124
 .suggest-submit-container {
@@ -83,9 +162,10 @@
83 162
     font-size: 31rpx;
84 163
     color: #fff;
85 164
     border-radius: 42rpx;
86
-    position: fixed;
87
-    bottom: 31rpx;
88
-    left: 28rpx;
165
+    margin-top: 50rpx;
166
+    // position: fixed;
167
+    // bottom: 31rpx;
168
+    // left: 28rpx;
89 169
   }
90 170
 }
91 171
 </style>

+ 0 - 2
src/base/travel/tips.vue

@@ -1,7 +1,6 @@
1 1
 <template>
2 2
   <mescroll-body @init="mescrollInit" :down="{ use: true, minAngle: angle }" @down="downCallback" @up="upCallback">
3 3
     <view class="travel-tips-container">
4
-      <!-- tabs -->
5 4
       <u-tabs
6 5
         v-model="tabActive"
7 6
         :list="list"
@@ -13,7 +12,6 @@
13 12
         }"
14 13
         @change="handleTabChange"
15 14
       ></u-tabs>
16
-      <!-- list -->
17 15
       <view class="travel-tips-list">
18 16
         <view class="tips-list-item" v-for="(item, index) in listData" :key="index" @click="toDetail(item.id)">
19 17
           <view class="title u-line-2">{{ item.title }}</view>

+ 3 - 4
src/components/HyCard.vue

@@ -16,9 +16,7 @@
16 16
 </template>
17 17
 
18 18
 <script lang="ts" setup>
19
-import { ref } from 'vue'
20
-
21
-const props = defineProps({
19
+defineProps({
22 20
   title: {
23 21
     type: String,
24 22
     default: ''
@@ -61,7 +59,8 @@ const handleClickRight = () => {
61 59
   border-radius: 14rpx;
62 60
   &.bg-card {
63 61
     width: 100%;
64
-    min-height: 549rpx;
62
+    // min-height: 549rpx;
63
+    padding-bottom: 24rpx;
65 64
     background-position: center center;
66 65
     background-size: 100% 100%;
67 66
     background-repeat: no-repeat;

+ 1 - 3
src/components/HyCharge.vue

@@ -13,9 +13,7 @@
13 13
 </template>
14 14
 
15 15
 <script lang="ts" setup>
16
-import { ref } from 'vue'
17
-
18
-const props = defineProps({
16
+defineProps({
19 17
   title: {
20 18
     type: String,
21 19
     default: '快充'

+ 3 - 2
src/components/HyService.vue

@@ -5,7 +5,7 @@
5 5
       <text>{{ item.title }}</text>
6 6
     </view>
7 7
     <view class="item-right-wrap" :style="{ backgroundImage: `url(${minioUrl}/bg_service_03.png)` }">
8
-      <view class="main-text" v-if="item.title === '司机之家'">淋浴/洗衣</view>
8
+      <view class="main-text" v-if="item.title === '司机之家'">{{ item.content.serviceContent }}</view>
9 9
       <view class="block-content" v-else>
10 10
         <view class="label">空闲</view>
11 11
         <view class="number-box">
@@ -20,7 +20,8 @@
20 20
 <script lang="ts" setup>
21 21
 import { useGlobal } from '@/composables/index'
22 22
 const { minioUrl } = useGlobal()
23
-const props = defineProps({
23
+
24
+defineProps({
24 25
   item: {
25 26
     type: Object,
26 27
     default: () => ({})

+ 0 - 3
src/components/HyTag.vue

@@ -8,9 +8,6 @@
8 8
 </template>
9 9
 
10 10
 <script lang="ts" setup>
11
-import { useGlobal } from '@/composables/index'
12
-const { minioUrl } = useGlobal()
13
-
14 11
 // props需要传入 图片宽高、文字、字号、是否需要背景边框
15 12
 defineProps({
16 13
   imgWidth: {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1026
src/menu/index.js


+ 1 - 1
src/pages.json

@@ -54,7 +54,7 @@
54 54
           "path": "suggest/record",
55 55
           "style": {
56 56
             "navigationBarTitleText": "反馈历史",
57
-            "enablePullDownRefresh": true
57
+            "enablePullDownRefresh": false
58 58
           }
59 59
         },
60 60
         {

+ 34 - 5
src/pages/index.vue

@@ -7,15 +7,16 @@ import {
7 7
   getParkServiceShopList,
8 8
   getParkServiceScenicList,
9 9
   getParkServiceFacility,
10
-  getParkServiceNoticeList
10
+  getParkServiceNoticeList,
11
+  getBannerApi
11 12
 } from '@/api/home'
12
-import { getParkWebAPI } from '@/api/system'
13
+import { h5PhoneLoginApi } from '@/api/login'
13 14
 import { useListLoader } from '@/composables/useListLoader'
14 15
 import { useGlobal } from '@/composables/index'
15 16
 import { user } from '@/stores/modules/user'
16 17
 
17
-const userStore = user()
18 18
 const { minioUrl } = useGlobal()
19
+const userStore = user()
19 20
 
20 21
 const angle = ref(45)
21 22
 // 监听页面滚动
@@ -54,7 +55,17 @@ const isRescueShow = ref(false)
54 55
 // 失物招领弹窗展示
55 56
 const isLostFoundShow = ref(false)
56 57
 
57
-onLoad(() => {
58
+onLoad((options) => {
59
+  const m = options?.m || ''
60
+  if (m) {
61
+    h5PhoneLoginApi(m).then((res: any) => {
62
+      const token = res.data.token || ''
63
+      if (token) {
64
+        uni.setStorageSync('token', token)
65
+        userStore.setToken(token)
66
+      }
67
+    })
68
+  }
58 69
   // 页面加载时从本地缓存获取园区ID
59 70
   const cachedParkId = uni.getStorageSync('parkId')
60 71
   if (cachedParkId) {
@@ -74,6 +85,8 @@ const init = () => {
74 85
   getFacilityList()
75 86
   // 获取出行提醒数据
76 87
   getNoticeList()
88
+  // 获取banner数据
89
+  // getBannerList()
77 90
 }
78 91
 
79 92
 // 处理园区选择变化
@@ -93,6 +106,15 @@ onShow(() => {
93 106
   init()
94 107
 })
95 108
 
109
+// 获取banner数据
110
+const bannerList = ref<any>([])
111
+const getBannerList = async () => {
112
+  const res = (await getBannerApi()) as any
113
+  if (res.data) {
114
+    bannerList.value = res.data.map((item: any) => item.imageInfo?.url)
115
+  }
116
+}
117
+
96 118
 // 获取我要加油数据
97 119
 const oilInfo = ref<any>({})
98 120
 const listOli = ref<any>([])
@@ -209,6 +231,13 @@ const navigateToShop = () => {
209 231
   })
210 232
 }
211 233
 
234
+// 精选商家详情点击事件
235
+const navigateToShopDetail = (id: string) => {
236
+  uni.navigateTo({
237
+    url: '/base/shop/detailsShop?id=' + id
238
+  })
239
+}
240
+
212 241
 // 景点点击事件
213 242
 const navigateToSpot = (id: string) => {
214 243
   uni.navigateTo({
@@ -354,7 +383,7 @@ const callPhone = (phone: string) => {
354 383
       <!-- 人气优选商家 -->
355 384
       <HyCard title="人气优选商家" rightText="更多商家" isShowRight :marginBottom="24" @clickRight="navigateToShop">
356 385
         <view class="index-shop-wrapper" v-if="shopList.length > 0">
357
-          <view class="shop-item" v-for="(item, index) in shopList" :key="index">
386
+          <view class="shop-item" v-for="(item, index) in shopList" :key="index" @click="navigateToShopDetail(item.id)">
358 387
             <view class="img-wrap">
359 388
               <image :src="item.content.image" mode="scaleToFill" />
360 389
             </view>

+ 27 - 3
src/pages/my.vue

@@ -1,16 +1,40 @@
1 1
 <script setup lang="ts">
2
+import { ref } from 'vue'
3
+import { onLoad } from '@dcloudio/uni-app'
4
+import { getUserInfoApi } from '@/api/login'
2 5
 import { useGlobal } from '@/composables/index'
3 6
 const { minioUrl } = useGlobal()
7
+
8
+const userInfo = ref<any>({})
9
+
10
+onLoad(() => {
11
+  getUserInfoApi().then((res: any) => {
12
+    const _userInfo = res.data || {}
13
+    userInfo.value = _userInfo
14
+  })
15
+})
16
+
17
+const toPage = (path: string) => {
18
+  uni.navigateTo({
19
+    url: path
20
+  })
21
+}
22
+
23
+const callPhone = (phone: string) => {
24
+  uni.makePhoneCall({
25
+    phoneNumber: phone
26
+  })
27
+}
4 28
 </script>
5 29
 
6 30
 <template>
7 31
   <view class="my-container" :style="{ backgroundImage: `url(${minioUrl + '/my_bg.png'})` }">
8 32
     <view class="my-header-wrapper">
9 33
       <image :src="minioUrl + '/icon_default_user.png'" mode="scaleToFill" />
10
-      <text class="user-name-text">用户15615550287</text>
34
+      <text class="user-name-text">{{ userInfo.user.mobile || userInfo.user.username }}</text>
11 35
     </view>
12 36
     <HyCard>
13
-      <view class="my-list-item">
37
+      <view class="my-list-item" @click="toPage('/base/suggest/record')">
14 38
         <view class="list-left">
15 39
           <image :src="minioUrl + '/icon_feed.png'" mode="scaleToFill" style="width: 42rpx; height: 42rpx" />
16 40
           <text class="text">我的反馈</text>
@@ -19,7 +43,7 @@ const { minioUrl } = useGlobal()
19 43
           <image :src="minioUrl + '/icon_right.png'" mode="scaleToFill" />
20 44
         </view>
21 45
       </view>
22
-      <view class="my-list-item">
46
+      <view class="my-list-item" @click="callPhone('0532-88886666')">
23 47
         <view class="list-left">
24 48
           <image :src="minioUrl + '/icon_phone.png'" mode="scaleToFill" style="width: 42rpx; height: 42rpx" />
25 49
           <text class="text">客服热线:0532-88886666</text>

+ 5 - 5
src/pages/service.vue

@@ -19,10 +19,10 @@ onPageScroll((e) => {
19 19
 
20 20
 const rateMap = {
21 21
   5: '五星级服务区',
22
-  4: '四星服务区',
23
-  3: '三星服务区',
24
-  2: '二星服务区',
25
-  1: '一星服务区'
22
+  4: '四星服务区',
23
+  3: '三星服务区',
24
+  2: '二星服务区',
25
+  1: '一星服务区'
26 26
 } as any
27 27
 
28 28
 const list = computed(() => {
@@ -64,7 +64,7 @@ const goToNavigation = (longitude: string, latitude: string, name: string) => {
64 64
             <view class="header-right-box">
65 65
               <view class="u-line-1 title">{{ item.title }}</view>
66 66
               <view class="rate-content">
67
-                <uni-rate :value="item.content.rate" activeColor="#ff5702"></uni-rate>
67
+                <uni-rate allow-half :value="item.content.rate" disabled disabledColor="#ff5702" activeColor="#ff5702"></uni-rate>
68 68
                 <text class="rate-text">{{ rateMap[item.content.rate] }}</text>
69 69
               </view>
70 70
               <view class="distance">{{ item.content.distance }}KM</view>

+ 0 - 7
src/stores/index.ts

@@ -1,10 +1,3 @@
1
-/*
2
- * @Author: wyd
3
- * @Date: 2024-02
4
- * @LastEditors: wyd
5
- * @LastEditTime: 2024-03
6
- * @Description:
7
- */
8 1
 import { createPinia } from 'pinia'
9 2
 import persist from 'pinia-plugin-persistedstate'
10 3
 

+ 2 - 2
src/stores/modules/system.ts

@@ -37,13 +37,13 @@ export const system = defineStore(
37 37
       clearInfo,
38 38
       setLoad
39 39
     }
40
-  },
40
+  }
41 41
   // 持久化配置
42 42
   // {
43 43
   //   persist: {
44 44
   //     paths: [],
45 45
   //     storage: {
46
-        
46
+
47 47
   //     }
48 48
   //   }
49 49
   // }

+ 0 - 7
src/stores/modules/user.ts

@@ -1,10 +1,3 @@
1
-/*
2
- * @Author: wyd
3
- * @Date: 2024-02
4
- * @LastEditors: wyd
5
- * @LastEditTime: 2024-04
6
- * @Description: 用户信息
7
- */
8 1
 import { defineStore } from 'pinia'
9 2
 import { ref } from 'vue'
10 3
 import type { UserInfo } from '@/types/user'

+ 0 - 7
src/stores/reset.ts

@@ -1,10 +1,3 @@
1
-/*
2
- * @Author: wyd
3
- * @Date: 2024-03
4
- * @LastEditors: wyd
5
- * @LastEditTime: 2024-03
6
- * @Description: 重置pinia所有状态
7
- */
8 1
 import cloneDeep from 'lodash/cloneDeep'
9 2
 
10 3
 export default function resetStore(data: { store: any }) {