index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. <template>
  2. <view class="page u-skeleton">
  3. <wm-watermark :text="userInfo.phone" :num="50"></wm-watermark>
  4. <!-- 经纪人信息卡片 -->
  5. <view class="userinfo-wrap u-skeleton-fillet box-shadow">
  6. <!-- 个人信息 -->
  7. <view class="userinfo">
  8. <view class="user">
  9. <view class="avatar-wrap" @click="pageTo('/pages/user/setting/avatar')">
  10. <u-avatar
  11. class="u-skeleton-circle"
  12. :src="userInfo.avatar"
  13. size="100"
  14. mode="circle"
  15. ></u-avatar>
  16. <!-- :show-level="true" -->
  17. <view class="avatar-bg box-shadow"></view>
  18. </view>
  19. <view class="info">
  20. <view class="nickname u-skeleton-rect">
  21. {{userInfo.user_id ? userInfo.nickname ? `${userInfo.nickname}(${userInfo.dept_code || '暂无'})` : '未设置用户名' : '未登录'}}
  22. </view>
  23. </view>
  24. <image v-if="userInfo.estate_govern && userInfo.estate_govern.length > 0" src="/static/index/i_c_1.png" class="scoped-scan-img" @click="scanHandle"></image>
  25. </view>
  26. <u-button
  27. v-if="!userInfo.user_id"
  28. class="u-skeleton-fillet"
  29. size="mini"
  30. type="primary"
  31. @click="pageTo('/pages/user/login/login')"
  32. :customStyle="{ margin: 0 }"
  33. >
  34. 立即登录
  35. </u-button>
  36. <view
  37. style="padding-top: 16rpx;"
  38. v-if="userInfo.user_id" @click="pageTo('/pages/user/setting/setting')">
  39. <u-icon name="/static/index/i_c_2.png" size="40" style="display: inline-block;vertical-align: top;"></u-icon>
  40. <text style="display: inline-block;vertical-align: top;padding-left: 10rpx;">设置认证</text>
  41. </view>
  42. </view>
  43. <u-line length="650rpx" margin="30rpx 0 0"></u-line>
  44. <!-- 数据信息 -->
  45. <view class="datainfo">
  46. <view class="data-item" @click="pageTo('/pages/agent/recommend/list?filterStepStatus=1')">
  47. <view class="data u-skeleton-fillet">{{reportStepCountObj['1'] || 0}}</view>
  48. <view class="item u-skeleton-fillet">未到访</view>
  49. </view>
  50. <view class="data-item" @click="pageTo('/pages/agent/recommend/list?filterStepStatus=2')">
  51. <view class="data u-skeleton-fillet">{{reportStepCountObj['2'] || 0}}</view>
  52. <view class="item u-skeleton-fillet">已到访</view>
  53. </view>
  54. <view class="data-item" @click="pageTo('/pages/agent/recommend/list?filterStepStatus=3')">
  55. <view class="data u-skeleton-fillet">{{reportStepCountObj['3'] || 0}}</view>
  56. <view class="item u-skeleton-fillet">已认购</view>
  57. </view>
  58. <view class="data-item" @click="pageTo('/pages/agent/recommend/list?filterStepStatus=4')">
  59. <view class="data u-skeleton-fillet">
  60. {{reportStepCountObj['4'] || 0}}
  61. </view>
  62. <view class="item u-skeleton-fillet">已签约</view>
  63. </view>
  64. <view class="data-item" @click="pageTo('/pages/agent/recommend/list?filterStepStatus=5')">
  65. <view class="data u-skeleton-fillet">{{reportStepCountObj['5'] || 0}}</view>
  66. <view class="item u-skeleton-fillet">已结佣</view>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 功能卡片 -->
  71. <view class="scoped-entry">
  72. <view class="op" @click="pageTo('/pages/agent/recommend/create')">
  73. <u-image src="/static/index/i_e_1.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  74. </view>
  75. <view class="op" @click="pageTo('/pages/agent/recommend/list')">
  76. <u-image src="/static/index/i_e_2.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  77. </view>
  78. <view class="op" @click="pageTo('/pages/cust/list')">
  79. <u-image src="/static/index/i_e_3.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  80. </view>
  81. <view v-if="userInfo.estate_govern && userInfo.estate_govern.length > 0" class="op" @click="pageTo('/pages/agent/recommend/estate')">
  82. <u-image src="/static/index/i_e_5.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  83. </view>
  84. <view v-else class="op" @click="commonRulesShow = true">
  85. <u-image src="/static/index/i_e_4.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  86. </view>
  87. <view v-if="curRoles == 1 || curRoles == 5 || curRoles == 6" class="op" @click="pageTo('/pages/saler/check')">
  88. <u-image src="/static/index/i_e_4c.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  89. </view>
  90. <view v-if="GT == 1" class="op" @click="pageTo('/pages/saler/list')">
  91. <u-image src="/static/index/i_e_4s.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  92. </view>
  93. <view v-if="curRoles == 1 || curRoles == 5 || curRoles == 7" class="op" @click="pageTo('/pages/cust/my')">
  94. <u-image src="/static/index/i_e_7.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  95. </view>
  96. <!-- <view v-if="curRoles == 1 || curRoles == 5 || curRoles == 7" class="op" @click="pageTo('/pages/agent/report/buycheck')">
  97. <u-image src="/static/index/i_e_6.png" mode="heightFix" height="146rpx" class="icon"></u-image>
  98. </view> -->
  99. </view>
  100. <!-- <view class="function-card-wrap">
  101. <view class="col-card-wrap">
  102. <view class="function-card box-shadow u-skeleton-fillet" @click="pageTo('/pages/agent/recommend/create')">
  103. <view class="title-wrap">
  104. <view class="main-title">
  105. <u-icon class="u-m-r-5" name="/static/icon/thump-up.png" size="32"></u-icon>
  106. ️我要推荐
  107. </view>
  108. <view class="sub-title u-line-1">Recommend</view>
  109. </view>
  110. <u-image src="/static/icon/wenli1.png" mode="heightFix" height="144rpx" class="icon"></u-image>
  111. </view>
  112. <view class="function-card box-shadow u-skeleton-fillet" @click="pageTo('/pages/agent/recommend/list')">
  113. <view class="title-wrap">
  114. <view class="main-title">
  115. <u-icon class="u-m-r-5" name="/static/icon/money.png" size="32"></u-icon>
  116. 报备管理
  117. </view>
  118. <view class="sub-title u-line-1">Filing</view>
  119. </view>
  120. <u-image src="/static/icon/wenli2.png" mode="heightFix" height="144rpx" class="icon"></u-image>
  121. </view>
  122. </view>
  123. <view class="col-card-wrap">
  124. <view class="function-card box-shadow u-skeleton-fillet" @click="pageTo('/pages/cust/list')">
  125. <view class="title-wrap">
  126. <view class="main-title">
  127. <u-icon class="u-m-r-5" name="/static/icon/customer.png" size="32"></u-icon>
  128. 客户管理
  129. </view>
  130. <view class="sub-title u-line-1">Customer</view>
  131. </view>
  132. <u-image src="/static/icon/wenli3.png" mode="heightFix" height="144rpx" class="icon"></u-image>
  133. </view>
  134. <view class="function-card box-shadow u-skeleton-fillet" @click="commonRulesShow = true">
  135. <view class="title-wrap">
  136. <view class="main-title">
  137. <u-icon class="u-m-r-5" name="/static/icon/book.png" size="32"></u-icon>
  138. 奖励政策
  139. </view>
  140. <view class="sub-title u-line-1">Rules</view>
  141. </view>
  142. <u-image src="/static/icon/wenli4.png" mode="heightFix" height="144rpx" class="icon"></u-image>
  143. </view>
  144. </view>
  145. </view> -->
  146. <!-- 项目卡片 -->
  147. <view class="card-list-wrap box-shadow u-m-b-20">
  148. <view class="header-title-warp">
  149. <view class="title u-skeleton-rect">
  150. <u-icon class="u-m-r-10" name="/static/index/i_c_3.png" size="36"></u-icon>
  151. 热销推荐
  152. </view>
  153. <!-- <view v-show="propertyList.length > 5" class="more u-skeleton-rect">
  154. 更多
  155. <u-icon name="arrow-right"></u-icon>
  156. </view> -->
  157. <view class="scoped-more-estate-tips" @click="pageTo('/pages/estate/list')">所有楼盘列表>></view>
  158. <view class="more u-skeleton-rect" @click="this.isOneRow = !this.isOneRow">{{isOneRow ? '切换至双行' : '切换至单行'}}</view>
  159. </view>
  160. <view v-if="propertyList.length == 0" class="u-m-t-40 u-m-b-40"><u-empty mode="list" text="暂无在售房源"></u-empty></view>
  161. <view class="scoped-list-one" v-for="(item, one) in twoObj" :key="one">
  162. <view class="slo-title">{{item.str}}</view>
  163. <view :class="isOneRow ? 'property-row-wrap' : 'property-col-wrap'">
  164. <view class="property-body u-skeleton-fillet box-shadow" v-for="(item, index) in item.list" :key="index" @click="showDetail(index, item)">
  165. <view class="image-wrap">
  166. <text class="tag u-skeleton-rect">{{ item.estate_tag }}</text>
  167. <image class="u-skeleton-rect" :src="item.pri_image" mode="aspectFill"></image>
  168. </view>
  169. <view class="property-info-wrap">
  170. <view class="title u-skeleton-rect">{{ item.estate_name }}{{item.report_open == 2 ? '[上架中]' : ''}}
  171. <text class="s">{{areaTypeObj[item.area_type]}}</text>
  172. </view>
  173. <view class="commission u-skeleton-rect" v-if="userInfo.auth_state == 1">预计奖励:{{ item.brokerage }}</view>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <!-- 平台佣金政策弹窗 -->
  180. <u-popup v-model="commonRulesShow" mode="center" width="80%" height="800rpx" border-radius="20" closeable>
  181. <view class="bwin-popup">
  182. <view class="popup-header">平台佣金政策</view>
  183. <view class="popup-body">需上传身份证进行实名认证(认证时,身份选择:有营业执照选'渠道/店东',其余选'中介/员工'填写渠道的4位数推荐码)。认证通过后方可报备客户和获得佣金,各楼盘相关带看规则和佣金政策点击下方对应楼盘<!-- <u-parse :html="xxxxxxxxxx"></u-parse> --></view>
  184. </view>
  185. </u-popup>
  186. <!-- 项目佣金政策信息弹窗 -->
  187. <u-popup v-model="propertyPopupShow" mode="center" width="80%" height="90%" border-radius="20" closeable>
  188. <view class="bwin-popup">
  189. <view class="popup-header">{{ currentPropertyObj.estate_name + '介绍' }}</view>
  190. <view class="popup-body">
  191. <view class="scoped-popup-more" @click="oneImgHandle(currentPropertyObj)">
  192. <u-image src="/static/index/popup_bg_more.png" mode="heightFix" height="118rpx" class="icon"></u-image>
  193. </view>
  194. <u-parse :html="currentPropertyObj.introduce"></u-parse>
  195. <u-divider marginTop="20" marginBottom="20">详情</u-divider>
  196. <view class="property-info">
  197. <!-- <view class="item">
  198. <view class="item-title">基本情况:</view>
  199. <view class="item-info" style="text-decoration: underline;color: #2080f0;">点击查看楼盘一页纸</view>
  200. </view> -->
  201. <view class="item" v-if="userInfo.auth_state == 1">
  202. <view class="item-title">预计奖励:</view>
  203. <view class="item-info" style="color: red;font-weight: bold;">{{ currentPropertyObj.brokerage }}</view>
  204. </view>
  205. <view class="item">
  206. <view class="item-title">营销中心:</view>
  207. <view class="item-info">{{ currentPropertyObj.address }}</view>
  208. </view>
  209. <view class="item">
  210. <view class="item-title">销售热线:</view>
  211. <view class="item-info">{{ currentPropertyObj.marketing_phone || '00000000' }}</view>
  212. </view>
  213. <view class="item">
  214. <view class="item-title">带看需收集:</view>
  215. <view class="item-info">{{ currentPropertyObj.report_visit }}</view>
  216. </view>
  217. <view class="item">
  218. <view class="item-title">报备保护期:</view>
  219. <view class="item-info">{{ currentPropertyObj.report_lock + '天' }}</view>
  220. </view>
  221. <view class="item">
  222. <view class="item-title">带看保护期:</view>
  223. <view class="item-info">{{ currentPropertyObj.lead_lock + '天' }}</view>
  224. </view>
  225. </view>
  226. <u-divider marginTop="20" marginBottom="20">滚动查看更多</u-divider>
  227. <view class="scoped-estate-desc">
  228. <!-- <view v-html="curHtml"></view> -->
  229. <rich-text :nodes="curHtml | filtersRichText"></rich-text>
  230. </view>
  231. </view>
  232. </view>
  233. </u-popup>
  234. <!-- 骨架屏 -->
  235. <u-skeleton :loading="skeletonLoading" animation></u-skeleton>
  236. <backTop :src="backTop.src" :scrollTop="backTop.scrollTop"></backTop>
  237. </view>
  238. </template>
  239. <script>
  240. var that;
  241. import { arrToObj } from '@/utils'
  242. import backTop from '@/components/back-top/back-top.vue'
  243. import wmWatermark from '@/components/wm-watermark/wm-watermark.vue'
  244. export default {
  245. components: {
  246. backTop,
  247. wmWatermark
  248. },
  249. filters: {
  250. filtersRichText(html) { //控制小程序中图片大小
  251. let newContent = html.replace(/<img[^>]*>/gi, (match, capture)=>{
  252. match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
  253. match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
  254. match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
  255. return match;
  256. });
  257. newContent = newContent.replace(/style="[^"]+"/gi, (match, capture)=>{
  258. match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
  259. return match;
  260. });
  261. newContent = newContent.replace(/<br[^>]*\/>/gi, '');
  262. newContent = newContent.replace(/\<img/gi,
  263. '<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
  264. return newContent;
  265. }
  266. },
  267. data() {
  268. // 页面数据变量
  269. return {
  270. curRoles: '',
  271. isOneRow: false,
  272. curHtml: '',
  273. backTop: {
  274. src: '../../static/back-top/top.png',
  275. scrollTop: 0
  276. },
  277. userInfo: {},
  278. skeletonLoading: true,
  279. agentTypeList: ['', '自由经纪人', '渠道经纪人', '老业主'],
  280. propertyList: [
  281. {
  282. estate_name: '在售项目1',
  283. pri_image: 'https://zdcdn.2bwin.cn/uploads/20220501/af6eb9c2a5d462be10a15c2302e5e6b5.jpg',
  284. sale_tag: '刚需好盘',
  285. rulesInfo: {
  286. des: '内容加载中1....',
  287. des_content: '内容加载中2....'
  288. }
  289. },
  290. ],
  291. commonRulesShow: false,
  292. propertyPopupShow: false,
  293. currentPropertyIndex: 0,
  294. currentPropertyObj: {},
  295. // init请求返回的数据
  296. data: {},
  297. // 表单请求数据
  298. form1: {},
  299. scrollTop: 0,
  300. reportStepCountObj: {},
  301. areaTypeObj: {},
  302. twoObj: {},
  303. GT: '',
  304. };
  305. },
  306. onPageScroll(e) {
  307. this.scrollTop = e.scrollTop;
  308. this.backTop.scrollTop = e.scrollTop;
  309. },
  310. // 监听 - 页面每次【加载时】执行(如:前进)
  311. onLoad(options = {}) {
  312. // that = this;
  313. // this.options = options;
  314. // this.init(options);
  315. },
  316. // 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快,会在页面进入动画完成前触发
  317. onReady() {
  318. },
  319. // 监听 - 页面每次【显示时】执行(如:前进和返回) (页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面)
  320. onShow() {
  321. this.init()
  322. this.checkUpdate()
  323. // const dictObj = uni.getStorageSync('MD_dict')
  324. // this.areaTypeObj = arrToObj(dictObj.area_type)
  325. },
  326. // 监听 - 页面每次【隐藏时】执行(如:返回)
  327. onHide() {},
  328. // 监听 - 页面触底部
  329. onReachBottom() {},
  330. // 监听 - 窗口尺寸变化(仅限:App、微信小程序)
  331. onResize() {},
  332. // 监听 - 点击右上角转发时
  333. onShareAppMessage(options) {},
  334. // 监听 - 页面创建时
  335. created() {},
  336. // 函数
  337. methods: {
  338. checkUpdate() {
  339. const updateManager = uni.getUpdateManager();
  340. updateManager.onUpdateReady(function(res) {
  341. uni.showModal({
  342. title: '更新提示',
  343. content: '新版本已经准备好,是否重启应用?',
  344. success(res) {
  345. if (res.confirm) {
  346. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  347. updateManager.applyUpdate()
  348. }
  349. }
  350. })
  351. })
  352. },
  353. oneImgHandle (item) {
  354. uni.navigateTo({
  355. url: `/pages/estate/dtl?id=${item.id}`
  356. })
  357. return
  358. uni.api.estate.apiestateinfodetail({id: item.id}).then(res => {
  359. const curImgUrl = res.info_img || ''
  360. if (!curImgUrl) {
  361. uni.$msg('该楼盘暂未设置一页纸楼盘简介~')
  362. return
  363. }
  364. uni.previewImage({
  365. current: curImgUrl,
  366. urls: [curImgUrl],
  367. })
  368. })
  369. },
  370. scanHandle () {
  371. uni.scanCode({
  372. success: function (res) {
  373. uni.navigateTo({
  374. url: `/pages/agent/recommend/detail2?id=${res.result}`
  375. })
  376. }
  377. })
  378. },
  379. // 页面数据初始化函数
  380. init(options) {
  381. const userInfo2 = uni.getStorageSync('MD_userInfo2')
  382. this.curRoles = userInfo2 ? userInfo2.roles : ''
  383. this.GT = userInfo2 ? userInfo2.group_type : ''
  384. this.userInfo = userInfo2 || {}
  385. uni.api.estate.apireportcount().then(res => {
  386. const reportStepCount = res.report_step_count || []
  387. let reportStepCountObj = {}
  388. reportStepCount.forEach(item => {
  389. reportStepCountObj[item.report_step] = item.total || 0
  390. })
  391. this.reportStepCountObj = {...reportStepCountObj}
  392. })
  393. uni.api.estate.apiestatelist({page_size: 100}).then(res => {
  394. const list = res.list || []
  395. const dictObj = uni.getStorageSync('MD_dict')
  396. const areaTypeObj = arrToObj(dictObj.area_type)
  397. let twoObj = {}
  398. list.forEach(item => {
  399. if (twoObj[item.area_type]) {
  400. twoObj[item.area_type].list.push(item)
  401. } else {
  402. twoObj[item.area_type] = {
  403. list: [item],
  404. str: areaTypeObj[item.area_type],
  405. }
  406. }
  407. })
  408. this.twoObj = {...twoObj}
  409. // console.log(twoObj)
  410. // let oneObj = list[0] || {}
  411. this.propertyList = [...list]
  412. // this.propertyList = [list[0], list[1], list[2]]
  413. })
  414. // let currentTime = Date.parse(new Date()) / 1000; // 秒级
  415. // // 初始化平台数据
  416. // let systemConfig = vk.vuex.get('$app.systemConfig');
  417. // if (!systemConfig.use_skeleton) {
  418. this.skeletonLoading = false;
  419. // }
  420. // if (vk.pubfn.isNull(systemConfig._id)) {
  421. // // 不存在则直接初始化
  422. // vk.callFunction({
  423. // url: 'client/agent/pub/getConfigInfo',
  424. // needAlert: false
  425. // }).then(res => {
  426. // vk.vuex.set('$app.systemConfig', res.config);
  427. // vk.vuex.set('$app.systemConfig.lastGetTime', currentTime);
  428. // });
  429. // } else {
  430. // let mathTime = ((currentTime - systemConfig.lastGetTime) / 3600).toFixed(2);
  431. // if (mathTime > systemConfig.cache_time) {
  432. // vk.callFunction({
  433. // url: 'client/agent/pub/getConfigInfo',
  434. // needAlert: false
  435. // }).then(res => {
  436. // vk.vuex.set('$app.systemConfig', res.config);
  437. // vk.vuex.set('$app.systemConfig.lastGetTime', currentTime);
  438. // });
  439. // }
  440. // }
  441. // // 请求经纪人个人数据
  442. // let lastInitAgentDataTime = vk.vuex.get('$user.history.lastInitAgentDataTime');
  443. // if (currentTime - lastInitAgentDataTime >= 60 && vk.checkToken()) {
  444. // // 个人数据1分钟主动更新1次
  445. // vk.callFunction({
  446. // url: 'client/agent/kh/getAgentData',
  447. // data: {
  448. // agentId: vk.vuex.get('$user.agentInfo._id')
  449. // },
  450. // needAlert: false
  451. // }).then(res => {
  452. // vk.vuex.set('$user.dataInfo.recommendNum', res.data.recommendNum);
  453. // vk.vuex.set('$user.dataInfo.visitedNum', res.data.visitedNum);
  454. // vk.vuex.set('$user.dataInfo.buyNum', res.data.buyNum);
  455. // vk.vuex.set('$user.dataInfo.totalCommission', res.data.totalCommission);
  456. // vk.vuex.set('$user.history.lastInitAgentDataTime', currentTime);
  457. // });
  458. // }
  459. // // 请求未读消息数量
  460. // // 最快1分钟请求一次
  461. // let lastGetUnreadMsgTime = vk.vuex.get('$user.history.lastGetUnreadMsgTime');
  462. // if (currentTime - lastGetUnreadMsgTime > 60 && vk.checkToken()) {
  463. // vk.callFunction({
  464. // url: 'client/agent/kh/getUnreadMsgNum'
  465. // }).then(res => {
  466. // vk.vuex.set('$user.dataInfo.unreadMsgNum', res.num);
  467. // vk.vuex.set('$user.history.lastGetUnreadMsgTime', currentTime);
  468. // });
  469. // }
  470. // // 请求在售项目列表
  471. // vk.callFunction({
  472. // url: 'client/agent/pub/getPropertyList',
  473. // needAlert: false
  474. // }).then(res => {
  475. // that.propertyList = res.list;
  476. // // 存储到vuex,方便其他页面调用
  477. // if (res.list.length < 5) {
  478. // // 若大于等于5则可能有更多项目,则不缓存
  479. // let list = res.list.map(function(val, index) {
  480. // return { value: val._id, label: val.name };
  481. // });
  482. // vk.vuex.set('$app.propertyList', list);
  483. // }
  484. // // 拼接佣金政策
  485. // // 非经纪人身份时显示佣金政策简介
  486. // // 否则显示最高可获得的佣金额度
  487. // let i;
  488. // for (i = 0; i < res.list.length; i++) {
  489. // let agentType = vk.vuex.get('$user.agentInfo.type');
  490. // if (vk.pubfn.isNull(agentType)) {
  491. // // 还未注册为经纪人
  492. // that.propertyList[i].commissionText = that.propertyList[i].rulesInfo.des;
  493. // } else {
  494. // let commissionInfo = that.propertyList[i].rulesInfo.commission_info;
  495. // let item = vk.pubfn.getListItem(commissionInfo, 'type', agentType);
  496. // that.propertyList[i].commissionText = '您最高可获得佣金' + item.amount + '元';
  497. // }
  498. // }
  499. // that.skeletonLoading = false;
  500. // });
  501. },
  502. pageTo(path) {
  503. if (path === 'dev') {
  504. uni.$msg('开发中~')
  505. return
  506. }
  507. uni.navigateTo({
  508. url: path
  509. })
  510. },
  511. // 弹窗展示项目佣金详情
  512. showDetail(index, item) {
  513. this.curHtml = ''
  514. if (this.userInfo && this.userInfo.auth_state == 1) {
  515. uni.navigateTo({
  516. url: `/pages/estate/dtl?id=${item.id}`
  517. })
  518. return
  519. // this.currentPropertyIndex = index;
  520. // this.currentPropertyObj = item
  521. // this.propertyPopupShow = true;
  522. // uni.api.estate.apiestatecontentdetail({id: item.id}).then(res => {
  523. // this.curHtml = res.content || ''
  524. // })
  525. } else {
  526. uni.$msgConfirm('请点击首页右上角设置,进行实名认证,实名认证后可查看详细信息')
  527. }
  528. }
  529. },
  530. // 监听器
  531. watch: {},
  532. // 计算属性
  533. computed: {}
  534. };
  535. </script>
  536. <style lang="scss" scoped>
  537. .page {
  538. min-height: calc(100vh - 44px);
  539. }
  540. .userinfo-wrap {
  541. display: flex;
  542. flex-direction: column;
  543. align-items: flex-start;
  544. background-color: #fff;
  545. padding: 10rpx 26rpx 26rpx;
  546. width: 100%;
  547. margin-bottom: 20rpx;
  548. border-radius: 10rpx;
  549. position: relative;
  550. .userinfo {
  551. width: 100%;
  552. display: flex;
  553. align-items: center;
  554. justify-content: space-between;
  555. .user {
  556. display: flex;
  557. align-items: center;
  558. padding-top: 10rpx;
  559. .avatar-wrap {
  560. position: relative;
  561. .avatar-bg {
  562. position: absolute;
  563. left: 0;
  564. top: 0;
  565. border-radius: 50%;
  566. width: 100rpx;
  567. height: 100rpx;
  568. }
  569. }
  570. .info {
  571. margin-left: 32rpx;
  572. .nickname {
  573. font-size: $u-p;
  574. font-weight: bold;
  575. color: $u-main-color;
  576. margin-bottom: 5rpx;
  577. }
  578. .mobile {
  579. font-size: $u-p1;
  580. color: $u-tips-color;
  581. }
  582. }
  583. }
  584. }
  585. .datainfo {
  586. width: 100%;
  587. display: flex;
  588. align-items: flex-end;
  589. justify-content: space-between;
  590. padding: 20rpx 0 0;
  591. .data-item {
  592. display: flex;
  593. flex-direction: column;
  594. align-items: center;
  595. .data {
  596. font-weight: bold;
  597. font-size: $u-h2;
  598. line-height: $u-h2;
  599. margin-bottom: 10rpx;
  600. }
  601. .item {
  602. font-size: $u-p2;
  603. color: $u-content-color;
  604. }
  605. }
  606. }
  607. }
  608. .function-card-wrap {
  609. .col-card-wrap {
  610. display: flex;
  611. align-items: center;
  612. justify-content: space-between;
  613. }
  614. .function-card {
  615. background-color: #fff;
  616. padding: 32rpx 20rpx;
  617. width: 345rpx;
  618. margin-bottom: 20rpx;
  619. border-radius: 10rpx;
  620. position: relative;
  621. overflow: hidden;
  622. .title-wrap {
  623. text-align: left;
  624. .main-title {
  625. display: flex;
  626. align-items: center;
  627. font-size: $u-p;
  628. font-weight: bold;
  629. }
  630. .sub-title {
  631. font-size: $u-p2;
  632. color: $u-content-color;
  633. }
  634. }
  635. .icon {
  636. text-align: right;
  637. position: absolute;
  638. top: 0;
  639. right: 0;
  640. }
  641. }
  642. }
  643. // 项目列表
  644. .card-list-wrap {
  645. background-color: #fff;
  646. // margin: 0rpx -20rpx 20rpx;
  647. padding: 20rpx 20rpx 0 20rpx;
  648. display: flex;
  649. flex-direction: column;
  650. border-radius: 10rpx;
  651. .header-title-warp {
  652. width: 100%;
  653. margin-bottom: 20rpx;
  654. display: flex;
  655. align-items: center;
  656. justify-content: space-between;
  657. .title {
  658. display: flex;
  659. align-items: center;
  660. color: $u-main-color;
  661. font-weight: bold;
  662. font-size: $u-p;
  663. }
  664. .more {
  665. font-size: $u-sub;
  666. color: $u-tips-color;
  667. }
  668. }
  669. // 行版
  670. .property-row-wrap {
  671. .property-body {
  672. width: 100%;
  673. border-radius: 10rpx;
  674. margin-bottom: 20rpx;
  675. // background-color: #fff;
  676. .image-wrap {
  677. position: relative;
  678. image {
  679. width: 100%;
  680. height: 300rpx;
  681. display: block;
  682. border-top-left-radius: 10rpx;
  683. border-top-right-radius: 10rpx;
  684. }
  685. .tag {
  686. color: #ffffff;
  687. // background-color: $u-theme-color;
  688. background: #8BC34A;
  689. font-size: $u-p2;
  690. position: absolute;
  691. z-index: 1;
  692. left: 0;
  693. padding: 8rpx 20rpx;
  694. border-top-left-radius: 10rpx;
  695. border-bottom-right-radius: 10rpx;
  696. }
  697. }
  698. .property-info-wrap {
  699. padding: 20rpx;
  700. .title {
  701. font-weight: bold;
  702. color: $u-main-color;
  703. font-size: $u-p;
  704. .s {
  705. font-weight: normal;
  706. padding-left: 10rpx;
  707. }
  708. }
  709. .commission {
  710. margin-top: 10rpx;
  711. font-size: $u-p2;
  712. color: $u-content-color;
  713. }
  714. }
  715. }
  716. }
  717. // 两列版
  718. .property-col-wrap {
  719. display: flex;
  720. flex-wrap: wrap;
  721. justify-content: space-between;
  722. align-items: flex-start;
  723. .property-body {
  724. width: 325rpx;
  725. border-radius: 10rpx;
  726. margin-bottom: 20rpx;
  727. // background-color: #fff;
  728. .image-wrap {
  729. position: relative;
  730. image {
  731. width: 100%;
  732. height: 210rpx;
  733. display: block;
  734. border-top-left-radius: 10rpx;
  735. border-top-right-radius: 10rpx;
  736. }
  737. .tag {
  738. color: #ffffff;
  739. // background-color: $u-theme-color;
  740. background: #8BC34A;
  741. font-size: $u-sub;
  742. position: absolute;
  743. z-index: 1;
  744. left: 0;
  745. padding: 8rpx 20rpx;
  746. border-top-left-radius: 10rpx;
  747. border-bottom-right-radius: 10rpx;
  748. }
  749. }
  750. .property-info-wrap {
  751. padding: 20rpx;
  752. .title {
  753. font-weight: bold;
  754. color: $u-main-color;
  755. font-size: $u-p2;
  756. .s {
  757. font-weight: normal;
  758. padding-left: 10rpx;
  759. }
  760. }
  761. .commission {
  762. margin-top: 10rpx;
  763. font-size: $u-sub;
  764. color: $u-content-color;
  765. }
  766. }
  767. }
  768. }
  769. }
  770. .popup-body {
  771. .property-info {
  772. font-size: $u-p1;
  773. .item {
  774. display: flex;
  775. margin-bottom: 10rpx;
  776. text-align: left;
  777. .item-title {
  778. font-weight: bold;
  779. width: 170rpx;
  780. }
  781. .item-info {
  782. flex: 1;
  783. }
  784. }
  785. }
  786. }
  787. .scoped-scan-img {
  788. padding-left: 20px;
  789. width: 40rpx;
  790. height: 40rpx;
  791. }
  792. .scoped-estate-desc {
  793. padding: 10rpx;
  794. iamge, img {
  795. width: 100%;
  796. }
  797. }
  798. .scoped-popup-more {
  799. width: 100%;
  800. height: 118rpx;
  801. margin-left: -20rpx;
  802. margin-top: -20rpx;
  803. margin-bottom: 20rpx;
  804. }
  805. .scoped-entry {
  806. display: flex;
  807. flex-wrap: wrap;
  808. .op {
  809. flex: 1;
  810. margin-bottom: 20rpx;
  811. &:nth-child(2n) {
  812. text-align: right;
  813. }
  814. }
  815. }
  816. .scoped-list-one {
  817. .slo-title {
  818. margin-top: 20rpx;
  819. margin-bottom: 20rpx;
  820. color: #2080f0;
  821. font-weight: bold;
  822. border-left: 2PX solid #2080f0;
  823. padding-left: 10rpx;
  824. font-size: 32rpx;
  825. }
  826. }
  827. .scoped-more-estate-tips {
  828. display: inline-block;
  829. text-decoration: underline;
  830. color: #2080f0;
  831. font-weight: bold;
  832. }
  833. </style>