index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view>
  3. <div class="managementBody" v-show="userType == 2">
  4. <image
  5. src="https://www.idea-co-sf.com/gardenProduct/image/banner.png"
  6. class="banner"
  7. ></image>
  8. <div class="needBox" v-if="false">
  9. <div
  10. class="needLeft"
  11. @click="toMsgPage('/pages/subPackages/todo/index')"
  12. >
  13. <div class="needLeftLeft">
  14. <span style="color: #18172a; font-size: 4.5vw; margin-bottom: 1vw"
  15. >我的待办</span
  16. >
  17. <span style="color: #666666; font-size: 3.5vw"
  18. >需处理待办<span
  19. style="color: #0365f9; font-weight: 600; margin-left: 0.5vw"
  20. >{{ handleSize }}</span
  21. ></span
  22. >
  23. </div>
  24. <img
  25. src="https://www.idea-co-sf.com/gardenProduct/image/dbImage.png"
  26. class="needImg"
  27. />
  28. </div>
  29. <div
  30. class="needRight"
  31. @tap.stop="toMsgPage('/pages/subPackages/toread/index')"
  32. >
  33. <div class="needLeftLeft">
  34. <span style="color: #18172a; font-size: 4.5vw; margin-bottom: 1vw"
  35. >我的待阅</span
  36. >
  37. <span style="color: #666666; font-size: 3.5vw"
  38. >需处理待阅<span
  39. style="color: #22b565; font-weight: 600; margin-left: 0.5vw"
  40. >{{ readSize }}</span
  41. ></span
  42. >
  43. </div>
  44. <img
  45. src="https://www.idea-co-sf.com/gardenProduct/image/dyImage.png"
  46. class="needImg"
  47. />
  48. </div>
  49. </div>
  50. <div class="titleTips">
  51. <div class="myLine"></div>
  52. <div>服务入口</div>
  53. </div>
  54. <div class="map">
  55. <div
  56. class="mapdom"
  57. style="float: left"
  58. v-for="(item, index) in mapList"
  59. :key="index"
  60. @click="jumpPage(item.path)"
  61. >
  62. <img class="mapIcon" :src="item.url" />
  63. <div class="maptxt">{{ item.label }}</div>
  64. </div>
  65. </div>
  66. </div>
  67. <!-- 企业端页面-->
  68. <div class="enterpriseBody" v-show="userType == 1 || userType == 3">
  69. <enterprise-side></enterprise-side>
  70. </div>
  71. </view>
  72. </template>
  73. <script>
  74. // import {demo} from "@/js_sdk/http"
  75. import {
  76. getUserPower,
  77. getUserLocalStorageInfo,
  78. getReadSizeByTypes,
  79. } from "@/js_sdk/http";
  80. import EnterpriseSide from "./components/enterpriseSide.vue";
  81. import { getHandleSizeTypes } from "../../js_sdk/http";
  82. export default {
  83. components: { EnterpriseSide },
  84. data() {
  85. return {
  86. readSize: 0,
  87. handleSize: 0,
  88. userType: 2,
  89. mapList: [
  90. {
  91. label: "房源查看",
  92. url: "https://www.idea-co-sf.com/gardenProduct/image/fjgl.png",
  93. path: "/pages/subPackages/propertyManagement/maintenance",
  94. },
  95. {
  96. label: "选房及意向金",
  97. url: "https://www.idea-co-sf.com/gardenProduct/image/zsgl.png",
  98. path: "/pages/subPackages/chooseHouse/index",
  99. },
  100. {
  101. label: "意向金管理",
  102. url: "https://www.idea-co-sf.com/gardenProduct/image/zsgl.png",
  103. path: "/pages/subPackages/yxjlist/index",
  104. },
  105. {
  106. label: "定金管理",
  107. url: "https://www.idea-co-sf.com/gardenProduct/image/zsgl.png",
  108. path: "/pages/subPackages/djlist/index",
  109. },
  110. ],
  111. };
  112. },
  113. onShareAppMessage() {},
  114. mounted() {
  115. // demo();
  116. },
  117. onShow() {
  118. // this.getUserPower();
  119. // this.getReadSize();
  120. // this.getHandleSize();
  121. },
  122. onLoad(e) {
  123. // uni.$on("userType", (userType) => {
  124. // if (userType === "OK") {
  125. // this.userType = !this.userType;
  126. // }
  127. // });
  128. },
  129. methods: {
  130. getReadSize() {
  131. const data = {
  132. userId: getUserLocalStorageInfo().userId,
  133. types: "1",
  134. };
  135. getReadSizeByTypes(data).then((res) => {
  136. this.readSize = res;
  137. });
  138. },
  139. getHandleSize() {
  140. const data = {
  141. userId: getUserLocalStorageInfo().userId,
  142. types: "0,1,8,9,10,11",
  143. };
  144. getHandleSizeTypes(data).then((res) => {
  145. this.handleSize = res;
  146. });
  147. },
  148. toMsgPage(e) {
  149. uni.navigateTo({
  150. url: e,
  151. fail: (fail) => {},
  152. });
  153. },
  154. // getUserLocalStorageInfo
  155. async getUserPower() {
  156. let that = this;
  157. console.log("getUserLocalStorageInfo", getUserLocalStorageInfo());
  158. that.userType = getUserLocalStorageInfo().userType;
  159. if (that.userType == 3) {
  160. uni.showModal({
  161. title: "提示",
  162. cancelText: "暂不",
  163. confirmText: "去切换",
  164. content: "您还不是企业用户,请切换登录身份后再进行相关操作。",
  165. success: function (res) {
  166. if (res.confirm) {
  167. uni.navigateTo({
  168. url: "/pages/login2/login",
  169. success: function (e) {
  170. // uni.$emit('userType', 'OK')
  171. },
  172. });
  173. } else if (res.cancel) {
  174. console.log("用户点击取消");
  175. }
  176. },
  177. });
  178. }
  179. // if (getUserLocalStorageInfo().user.id == 1) return;
  180. // let newList = [];
  181. // let { data } = await getUserPower(getUserLocalStorageInfo().user.id);
  182. // for (let i = 0; i < that.mapList.length; i++) {
  183. // let index = data.findIndex((e) => e == that.mapList[i].label);
  184. // if (index != -1) {
  185. // newList.push(that.mapList[i]);
  186. // }
  187. // }
  188. // that.mapList = newList;
  189. },
  190. jumpPage(path) {
  191. uni.navigateTo({
  192. url: path,
  193. fail: (fail) => {},
  194. });
  195. },
  196. },
  197. };
  198. </script>
  199. <style lang="scss">
  200. page {
  201. background: white;
  202. }
  203. .managementBody {
  204. padding: 4vw;
  205. }
  206. .banner {
  207. width: 92vw;
  208. height: 250rpx;
  209. //position: absolute;
  210. z-index: 1;
  211. }
  212. .mapdom {
  213. width: 25%;
  214. height: 184rpx;
  215. }
  216. .maptxt {
  217. width: 100%;
  218. height: 34rpx;
  219. font-size: 24rpx;
  220. font-family: PingFang SC-Medium, PingFang SC;
  221. font-weight: 500;
  222. color: #18172a;
  223. text-align: center;
  224. margin-top: 8rpx;
  225. }
  226. .mapIcon {
  227. width: 65rpx;
  228. height: 80rpx;
  229. //background: linear-gradient(141deg, #89BCFF 0%, #2782FA 100%);
  230. display: block;
  231. margin: auto;
  232. }
  233. .map {
  234. //position: absolute;
  235. z-index: 2;
  236. width: calc(100% - 24rpx);
  237. //height: 770rpx;
  238. border-radius: 48rpx 48rpx 0rpx 0rpx;
  239. background: white;
  240. //margin-top: 402rpx;
  241. padding: 24rpx 12rpx;
  242. overflow-y: auto;
  243. }
  244. .needBox {
  245. display: flex;
  246. align-items: center;
  247. justify-content: space-between;
  248. margin: 2vw 0;
  249. .needLeft {
  250. display: flex;
  251. justify-content: space-around;
  252. background: rgba(238, 244, 255, 1);
  253. border-radius: 8rpx;
  254. align-items: center;
  255. width: 45vw;
  256. height: 23vw;
  257. }
  258. .needRight {
  259. display: flex;
  260. justify-content: space-around;
  261. background: #def6f8;
  262. border-radius: 8rpx;
  263. align-items: center;
  264. width: 45vw;
  265. height: 23vw;
  266. }
  267. .needLeftLeft {
  268. display: flex;
  269. flex-direction: column;
  270. }
  271. .needImg {
  272. width: 100rpx;
  273. height: 100rpx;
  274. }
  275. }
  276. .titleTips {
  277. display: flex;
  278. align-items: center;
  279. font-size: 4.7vw;
  280. font-weight: 600;
  281. color: #18172a;
  282. margin: 4vw 0 2vw 0;
  283. .myLine {
  284. width: 13rpx;
  285. height: 40rpx;
  286. background: linear-gradient(180deg, #509fff 0%, #034df7 100%);
  287. margin-right: 20rpx;
  288. }
  289. }
  290. </style>