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.

327 lines
6.7 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 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="widthFix"></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="widthFix"></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="widthFix"></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="goSever('/pages/subPage/ballots/ballotsList/ballotsList')">
  45. <!-- <image src="@/static/images/homebanner2.png" mode=""></image> -->
  46. <image :src="imgUrl + 'homebanner2.png'" mode="widthFix"></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="点击认证业主" @oneBtnClick="goHome('/pages/subPage/authentication/authentication')"></oneBtn>
  69. </view>
  70. </up-popup>
  71. </view>
  72. </template>
  73. <script setup>
  74. import siteObj from '@/config/site.config.js'
  75. const {
  76. imgUrl,
  77. tmplIds
  78. } = siteObj
  79. import {
  80. ref
  81. } from 'vue'
  82. import notice from './comp/notice.vue'
  83. import {
  84. userStore
  85. } from '@/store/index.js';
  86. const counterStore = userStore();
  87. import {
  88. getNoticeList,
  89. getHouses,
  90. appletSubscribe
  91. } from '@/config/api.js'
  92. import {
  93. onLoad,
  94. onShow,
  95. onPullDownRefresh,
  96. onReachBottom
  97. } from '@dcloudio/uni-app'
  98. console.log(counterStore.token)
  99. const show = ref(false)
  100. function authentication() {
  101. show.value = false
  102. uni.$u.route({
  103. url: '/pages/subPage/authentication/authentication'
  104. })
  105. }
  106. // 公告列表
  107. let params = ref({
  108. pageNo: 1,
  109. pageSize: 20
  110. })
  111. let noticeList = ref([])
  112. async function getNoticeListFn() {
  113. const {
  114. data: res
  115. } = await getNoticeList(params)
  116. noticeList.value = res.list
  117. }
  118. // 我的房子
  119. const myHouse = ref([])
  120. async function getHousesFn() {
  121. if (!counterStore.token) return true
  122. const {
  123. data: res
  124. } = await getHouses()
  125. if(!res.length) {
  126. show.value = true
  127. return
  128. }
  129. myHouse.value = res
  130. counterStore.upDateUseInfo('myHouse', res)
  131. }
  132. // 点击投票跳转
  133. function goSever(url) {
  134. if(!myHouse.value) return
  135. goHome(url)
  136. }
  137. async function goHome(url) {
  138. if(show.value) show.value = false
  139. let token = counterStore.token;
  140. if (token) {
  141. const openId = counterStore.loginInfo.openId
  142. uni.requestSubscribeMessage({
  143. tmplIds,
  144. async success(res) {
  145. let acceptArr = []
  146. tmplIds.forEach((item) => {
  147. if (res[item] == 'accept') {
  148. acceptArr.push(item)
  149. }
  150. })
  151. console.log('订阅成功: ', acceptArr)
  152. if(!acceptArr.length) return
  153. await appletSubscribe({openId, templateIds: acceptArr})
  154. },
  155. fail(err) {
  156. console.log('订阅失败:', err)
  157. },
  158. complete() {
  159. uni.$u.route({
  160. url
  161. })
  162. }
  163. })
  164. } else {
  165. uni.$u.route({
  166. url: '/pages/subPage/login/login'
  167. })
  168. }
  169. }
  170. onPullDownRefresh(async () => {
  171. await getNoticeListFn()
  172. await getHousesFn()
  173. uni.stopPullDownRefresh()
  174. })
  175. onShow(() => {
  176. getNoticeListFn()
  177. getHousesFn()
  178. })
  179. </script>
  180. <style lang="scss" scoped>
  181. .h1pad {
  182. padding: 30rpx 0 20rpx 0;
  183. }
  184. .popCon {
  185. padding: 60rpx 40rpx;
  186. color: #333;
  187. .hello {
  188. font-size: 36rpx;
  189. font-weight: 700;
  190. }
  191. .p {
  192. font-size: 28rpx;
  193. padding: 30rpx 0 60rpx 0;
  194. text {
  195. color: $themC;
  196. }
  197. }
  198. }
  199. image {
  200. display: block;
  201. width: 100%;
  202. height: 100%;
  203. }
  204. .content {
  205. width: 100%;
  206. padding: 0rpx 0 100rpx 0;
  207. .banner1 {
  208. width: 100%;
  209. // height: 260rpx;
  210. }
  211. .myhome {
  212. width: 100%;
  213. margin-top: 40rpx;
  214. background: #FFFFFF;
  215. box-shadow: 0px 0px 14rpx 0px rgba(0, 0, 0, 0.06);
  216. border-radius: 20rpx;
  217. padding: 0 30rpx 0rpx 30rpx;
  218. overflow: auto;
  219. .flex-b {
  220. width: 100%;
  221. height: 94rpx;
  222. .h2 {
  223. font-size: 36rpx;
  224. color: #333;
  225. font-weight: 700;
  226. }
  227. .btn {
  228. width: 132rpx;
  229. height: 44rpx;
  230. background: #DE3A26;
  231. border-radius: 22rpx;
  232. line-height: 44rpx;
  233. font-size: 24rpx;
  234. color: #fff;
  235. text-align: center;
  236. }
  237. }
  238. .borderCard {
  239. width: 100%;
  240. border-radius: 20rpx;
  241. border: 2rpx solid #EFEFEF;
  242. padding: 40rpx 20rpx 0rpx 30rpx;
  243. margin-top: 15rpx;
  244. margin-bottom: 30rpx;
  245. .text {
  246. font-size: 28rpx;
  247. margin-bottom: 24rpx;
  248. }
  249. .text2 {
  250. font-size: 36rpx;
  251. font-weight: bold;
  252. }
  253. .text3 {
  254. color: #999;
  255. margin-top: 20rpx;
  256. }
  257. .banner3 {
  258. width: 255rpx;
  259. height: 142rpx;
  260. margin-left: auto;
  261. }
  262. }
  263. }
  264. .severCon {
  265. .banner2 {
  266. width: 100%;
  267. // height: 180rpx;
  268. }
  269. }
  270. .noticeCon {
  271. .h1pad {
  272. .more {
  273. display: flex;
  274. align-items: center;
  275. .txt {
  276. font-size: 28rpx;
  277. color: #CCCCCC;
  278. }
  279. .icon {
  280. width: 12rpx;
  281. height: 22rpx;
  282. margin-left: 10rpx;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. </style>