home.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <view class="home-warp">
  3. <view class="header">
  4. <view class="headerPng" @click="gotoPath('/pagesA/my/my')">
  5. <image :src="imageUrl" mode="widthFix" />
  6. </view>
  7. <view class="title">健康雷达</view>
  8. </view>
  9. <view class="leineng">
  10. <view>
  11. <image
  12. src="http://jkld.radar-power.com//uploadFiles/framework/file/20250620/home_ln.png"
  13. mode=""
  14. />
  15. </view>
  16. <view class="right">
  17. <view class="rightItem">
  18. <view class="rightTitle">今日天气</view>
  19. <view class="rightPng">
  20. <view class="rightContent">暂无</view>
  21. </view>
  22. </view>
  23. <view
  24. class="rightItem"
  25. @click="gotoPath('/pagesA/homeManage/homeManage')"
  26. >
  27. <view class="rightTitle">我的家庭</view>
  28. <view class="rightContent"
  29. ><text>{{ groupNum }}</text
  30. >家</view
  31. >
  32. </view>
  33. <view
  34. class="rightItem"
  35. @click="gotoPath('/pagesA/devices/devices')"
  36. >
  37. <view class="rightTitle">全部设备</view>
  38. <view class="rightContent"
  39. ><text>{{ devNum }}</text
  40. >台</view
  41. >
  42. </view>
  43. <view class="rightItem" @click="goNo()">
  44. <view class="rightTitle">报警设备</view>
  45. <view class="rightContent" v-if="warnNum == 0"
  46. ><text>0</text>台</view
  47. >
  48. <view class="rightAlarm" v-else
  49. ><text>{{ warnNum }}</text
  50. >台</view
  51. >
  52. </view>
  53. </view>
  54. </view>
  55. <view class="content">
  56. <view class="card" @click="gotoPath('/pagesA/adDevice/adDevice')">
  57. <view class="contentTitle">
  58. <text>添加设备</text>
  59. <image src="../../static/rightArrow.png" />
  60. </view>
  61. <view class="contentCenter"> 家庭陪伴探测器 </view>
  62. <view class="contentImg">
  63. <image src="../../static/smalLn.png" mode="" />
  64. </view>
  65. </view>
  66. <view class="card" @click="gotoPath('/pagesA/devices/devices')">
  67. <view class="contentTitle">
  68. <text>我的家庭</text>
  69. <image src="../../static/rightArrow.png" />
  70. </view>
  71. <view class="contentCenter"> 点击进入我的家 </view>
  72. <view class="contentImg">
  73. <image src="../../static/myHome.png" mode="" />
  74. </view>
  75. </view>
  76. </view>
  77. <view class="bottom">
  78. <image src="../../static/linkService.png" mode="" />
  79. <button open-type="contact">联系客服</button>
  80. </view>
  81. <view class="bot_version"> v3.0.0 </view>
  82. <!-- <view class="headerInfo">111111</view> -->
  83. <alarmCom></alarmCom>
  84. </view>
  85. </template>
  86. <script>
  87. export default {
  88. name: "my",
  89. data() {
  90. return {
  91. notices: [],
  92. groupNum: 0,
  93. shareNum: 0,
  94. devNum: 0,
  95. warnNum: 0,
  96. imageUrl: "../../static/headerInfo.png",
  97. };
  98. },
  99. computed: {},
  100. methods: {
  101. gotoPath(path) {
  102. if (uni.getStorageSync("userId")) {
  103. uni.navigateTo({
  104. url: path,
  105. });
  106. } else {
  107. uni.showToast({
  108. title: "暂未登录,请先登录",
  109. icon: "none",
  110. duration: 1500,
  111. });
  112. uni.reLaunch({
  113. url: "/pagesA/loginNew/loginNew",
  114. });
  115. }
  116. },
  117. goNo() {
  118. if (uni.getStorageSync("userId")) {
  119. uni.showToast({
  120. title: "该功能正在开发中,敬请期待",
  121. icon: "none",
  122. duration: 1500,
  123. });
  124. return;
  125. }
  126. uni.reLaunch({
  127. url: "/pagesA/loginNew/loginNew",
  128. });
  129. },
  130. },
  131. onLoad() {},
  132. onShow() {
  133. if (uni.getStorageSync("userId")) {
  134. this.$http
  135. .get("wap/home/homeInfo", {
  136. userId: uni.getStorageSync("userId"),
  137. })
  138. .then((res) => {
  139. if (res.data.data) {
  140. const { groupNum, shareNum, devNum, warnNum } =
  141. res.data.data;
  142. this.groupNum = groupNum;
  143. this.shareNum = shareNum;
  144. this.devNum = devNum;
  145. this.warnNum = warnNum;
  146. }
  147. });
  148. }
  149. // 配置服务器
  150. let selectedService = uni.getStorageSync("sercviceChoice");
  151. if (!selectedService) {
  152. uni.setStorageSync("sercviceChoice", "aloneServe");
  153. }
  154. },
  155. onShareAppMessage() {
  156. return {
  157. title: "好友向您分享雷能守护",
  158. path: "/pages/home/home",
  159. };
  160. },
  161. };
  162. </script>
  163. <style lang="less" scoped>
  164. .home-warp {
  165. position: relative;
  166. height: 100vh;
  167. background: linear-gradient(180deg, #faede2 0%, #f4f4f4 100%);
  168. /* padding: 24rpx 30rpx 20rpx; */
  169. }
  170. .header {
  171. display: flex;
  172. align-items: center;
  173. justify-content: space-between;
  174. padding: 90rpx 80rpx;
  175. }
  176. .headerPng {
  177. z-index: 1;
  178. }
  179. .headerPng image {
  180. width: 70rpx;
  181. height: 70rpx;
  182. border-radius: 50%;
  183. }
  184. .title {
  185. position: absolute;
  186. left: 50%;
  187. transform: translateX(-50%);
  188. color: #111111;
  189. font-size: 32rpx;
  190. }
  191. .leineng {
  192. position: absolute;
  193. top: -100rpx;
  194. display: flex;
  195. align-items: center;
  196. justify-content: flex-end;
  197. width: 100vw;
  198. height: 100vh;
  199. }
  200. .leineng image {
  201. position: absolute;
  202. top: 10%;
  203. left: 0;
  204. width: 700rpx;
  205. height: 1200rpx;
  206. }
  207. .right {
  208. z-index: 99;
  209. padding-right: 100rpx;
  210. }
  211. .right .rightItem {
  212. margin-bottom: 60rpx;
  213. color: #666666;
  214. }
  215. .right .rightItem .rightTitle {
  216. font-size: 23.44rpx;
  217. text-align: center;
  218. }
  219. .right .rightItem .rightContent {
  220. margin-top: 17rpx;
  221. font-size: 24rpx;
  222. font-weight: bold;
  223. }
  224. .right .rightItem .rightContent text {
  225. font-weight: 700;
  226. font-size: 66rpx;
  227. }
  228. .right .rightItem .rightAlarm {
  229. margin-top: 17rpx;
  230. font-size: 24rpx;
  231. font-weight: bold;
  232. color: #f55050;
  233. }
  234. .right .rightItem .rightAlarm text {
  235. font-weight: 700;
  236. font-size: 66rpx;
  237. color: #f55050;
  238. }
  239. .content {
  240. position: absolute;
  241. bottom: 200rpx;
  242. width: 100vw;
  243. display: flex;
  244. justify-content: space-around;
  245. }
  246. .card {
  247. width: 350rpx;
  248. height: 300rpx;
  249. border: 2rpx solid #ffffff;
  250. border-radius: 37rpx;
  251. background: #ffffff;
  252. padding: 38rpx 30rpx;
  253. box-sizing: border-box;
  254. }
  255. .contentTitle {
  256. display: flex;
  257. align-items: center;
  258. font-size: 32rpx;
  259. color: #111111;
  260. }
  261. .contentTitle image {
  262. width: 28rpx;
  263. height: 28rpx;
  264. margin-left: 8rpx;
  265. }
  266. .contentCenter {
  267. margin-top: 14rpx;
  268. font-size: 24rpx;
  269. color: #999999;
  270. }
  271. .contentImg image {
  272. margin-top: 60rpx;
  273. width: 94rpx;
  274. height: 94rpx;
  275. }
  276. .bottom {
  277. position: absolute;
  278. bottom: 80rpx;
  279. left: 50%;
  280. transform: translate(-50%, -50%);
  281. display: flex;
  282. justify-content: center;
  283. align-items: center;
  284. }
  285. .bottom image {
  286. width: 28rpx;
  287. height: 28rpx;
  288. }
  289. .bottom button {
  290. all: unset;
  291. margin: 0;
  292. padding: 0;
  293. border: none;
  294. background: none;
  295. font: inherit;
  296. text-align: inherit;
  297. line-height: normal;
  298. outline: none;
  299. box-shadow: none;
  300. -webkit-appearance: none;
  301. margin-left: 6rpx;
  302. color: #a1aab4;
  303. font-size: 28rpx;
  304. }
  305. .bot_version {
  306. opacity: 0.4;
  307. position: absolute;
  308. bottom: 20rpx;
  309. left: 50%;
  310. font-size: 28rpx;
  311. transform: translate(-50%, -50%);
  312. display: flex;
  313. justify-content: center;
  314. align-items: center;
  315. }
  316. // .headerInfo {
  317. // position: fixed;
  318. // top: 40rpx;
  319. // left: 0;
  320. // width: 750rpx;
  321. // height: 105rpx;
  322. // background: linear-gradient(
  323. // 90deg,
  324. // rgba(255, 97, 97, 0) 0%,
  325. // #6ddea7 50.44%,
  326. // rgba(255, 97, 97, 0) 100%
  327. // );
  328. // }
  329. </style>