You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

285 lines
6.1 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <view class="content ">
  3. <view class="status_bar"></view>
  4. <up-navbar leftText=" " title="事务通" :safeAreaInsetTop="false" :autoBack="false" :fixed="false">
  5. <template #left>
  6. <view class=""></view>
  7. </template>
  8. </up-navbar>
  9. <view class="padding">
  10. <view class="banner1">
  11. <image :src="imgUrl + 'homebanner.png'" mode=""></image>
  12. </view>
  13. <view class="myhome">
  14. <view class="flex-b">
  15. <view class="h2">我的房屋</view>
  16. <view class="btn" @click="goHome('/pages/subPage/authentication/authentication')">关联房屋</view>
  17. </view>
  18. <view class="borderCard" @click="$goPage('/pages/subPage/login/login')" v-if="!counterStore.token">
  19. <view class="flex">
  20. <view class="text2">立即登录</view>
  21. <u-icon name="arrow-right"></u-icon>
  22. </view>
  23. <view class="text3">登录成功即可关联房屋~</view>
  24. <view class="banner3">
  25. <image :src="imgUrl + 'homebanner3.png'" mode=""></image>
  26. <!-- <image src="@/static/images/homebanner3.png" mode=""></image> -->
  27. </view>
  28. </view>
  29. <view class="borderCard" v-if="myHouse.length">
  30. <view class="" v-for="(item, index) in myHouse" :key="index">
  31. <view class="text">房屋地址{{ item.roomAddress}}</view>
  32. <view class="text">房屋面积{{ item.roomSize }}</view>
  33. </view>
  34. <view class="banner3">
  35. <!-- <image src="@/static/images/homebanner3.png" mode=""></image> -->
  36. <image :src="imgUrl + 'homebanner3.png'" mode=""></image>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="severCon">
  41. <view class="h1pad">
  42. <view class="h1">服务</view>
  43. </view>
  44. <view class="banner2" @click="goHome('/pages/subPage/ballots/ballotsList/ballotsList')">
  45. <!-- <image src="@/static/images/homebanner2.png" mode=""></image> -->
  46. <image :src="imgUrl + 'homebanner2.png'" mode=""></image>
  47. </view>
  48. </view>
  49. <view class="noticeCon">
  50. <view class="h1pad flex-b">
  51. <view class="h1">公示公告</view>
  52. <view class="more" @click="$goPage('/pages/subPage/notice/notice')">
  53. <view class="txt">更多</view>
  54. <view class="icon">
  55. <image src="@/static/images/arrRight.png" mode=""></image>
  56. </view>
  57. </view>
  58. </view>
  59. <notice :list="noticeList"/>
  60. </view>
  61. </view>
  62. <up-popup :show="show" @close="show=false" mode="center" :round="10" :customStyle="{width: '90%'}" closeable>
  63. <view class="popCon">
  64. <view class="hello">你好</view>
  65. <view class="p">
  66. 欢迎来到 <text>新疆首付公馆</text>为了更好的为您提供服务请您选择房屋信息进行业主身份认证
  67. </view>
  68. <oneBtn text="点击认证业主" @click.native="authentication"></oneBtn>
  69. </view>
  70. </up-popup>
  71. </view>
  72. </template>
  73. <script setup>
  74. import siteObj from '@/config/site.config.js'
  75. const {imgUrl} = siteObj
  76. import {
  77. ref
  78. } from 'vue'
  79. import notice from './comp/notice.vue'
  80. import { userStore } from '@/store/index.js';
  81. const counterStore = userStore();
  82. import { getNoticeList, getHouses } from '@/config/api.js'
  83. import {
  84. onLoad,
  85. onShow,
  86. onPullDownRefresh,
  87. onReachBottom
  88. } from '@dcloudio/uni-app'
  89. console.log(counterStore.token)
  90. const show = ref(false)
  91. function authentication() {
  92. show.value = false
  93. uni.$u.route({
  94. url: '/pages/subPage/authentication/authentication'
  95. })
  96. }
  97. // 公告列表
  98. let params = ref({
  99. pageNo: 1,
  100. pageSize: 20
  101. })
  102. let noticeList = ref([])
  103. async function getNoticeListFn() {
  104. const {data: res} = await getNoticeList(params)
  105. noticeList.value = res.list
  106. }
  107. // 我的房子
  108. const myHouse = ref([])
  109. async function getHousesFn() {
  110. if(!counterStore.token) return true
  111. const {data: res} = await getHouses()
  112. myHouse.value = res
  113. counterStore.upDateUseInfo('name', res.userName)
  114. }
  115. function goHome(url) {
  116. uni.requestSubscribeMessage({
  117. tmplIds: ['OH_1gceM-m3EXRKOtjl_Hb1ymyC5zw8_Ag6LaFXV4Do', 'AjD_oLafmKGO8X3YvDGl1qmITq_Q6bSFMDeygJNAIes'],
  118. success (res) { console.log('订阅成功: ', res) },
  119. fail(err) {console.log('订阅失败:', err)}
  120. })
  121. let token = counterStore.token;
  122. if(token) {
  123. uni.$u.route({
  124. url
  125. })
  126. }else {
  127. uni.$u.route({
  128. url: '/pages/subPage/login/login'
  129. })
  130. }
  131. }
  132. onPullDownRefresh(async ()=>{
  133. await getNoticeListFn()
  134. await getHousesFn()
  135. uni.stopPullDownRefresh()
  136. })
  137. onShow(()=>{
  138. getNoticeListFn()
  139. getHousesFn()
  140. })
  141. </script>
  142. <style lang="scss" scoped>
  143. .h1pad {
  144. padding: 30rpx 0 20rpx 0;
  145. }
  146. .popCon {
  147. padding: 60rpx 40rpx;
  148. color: #333;
  149. .hello {
  150. font-size: 36rpx;
  151. font-weight: 700;
  152. }
  153. .p {
  154. font-size: 28rpx;
  155. padding: 30rpx 0 60rpx 0;
  156. text {
  157. color: $themC;
  158. }
  159. }
  160. }
  161. image {
  162. display: block;
  163. width: 100%;
  164. height: 100%;
  165. }
  166. .content {
  167. width: 100%;
  168. padding: 0rpx 0 100rpx 0;
  169. .banner1 {
  170. width: 100%;
  171. height: 260rpx;
  172. }
  173. .myhome {
  174. width: 100%;
  175. margin-top: 40rpx;
  176. background: #FFFFFF;
  177. box-shadow: 0px 0px 14rpx 0px rgba(0, 0, 0, 0.06);
  178. border-radius: 20rpx;
  179. padding: 0 30rpx 0rpx 30rpx;
  180. .flex-b {
  181. width: 100%;
  182. height: 94rpx;
  183. .h2 {
  184. font-size: 36rpx;
  185. color: #333;
  186. font-weight: 700;
  187. }
  188. .btn {
  189. width: 132rpx;
  190. height: 44rpx;
  191. background: #DE3A26;
  192. border-radius: 22rpx;
  193. line-height: 44rpx;
  194. font-size: 24rpx;
  195. color: #fff;
  196. text-align: center;
  197. }
  198. }
  199. .borderCard {
  200. width: 100%;
  201. border-radius: 20rpx;
  202. border: 2rpx solid #EFEFEF;
  203. padding: 40rpx 20rpx 0rpx 30rpx;
  204. margin-top: 30rpx;
  205. .text {
  206. font-size: 28rpx;
  207. margin-bottom: 24rpx;
  208. }
  209. .text2 {
  210. font-size: 36rpx;
  211. font-weight: bold;
  212. }
  213. .text3 {
  214. color: #999;
  215. margin-top: 20rpx;
  216. }
  217. .banner3 {
  218. width: 255rpx;
  219. height: 142rpx;
  220. margin-left: auto;
  221. }
  222. }
  223. }
  224. .severCon {
  225. .banner2 {
  226. width: 100%;
  227. height: 180rpx;
  228. }
  229. }
  230. .noticeCon {
  231. .h1pad {
  232. .more {
  233. display: flex;
  234. align-items: center;
  235. .txt {
  236. font-size: 28rpx;
  237. color: #CCCCCC;
  238. }
  239. .icon {
  240. width: 12rpx;
  241. height: 22rpx;
  242. margin-left: 10rpx;
  243. }
  244. }
  245. }
  246. }
  247. }
  248. </style>