index.vue 26 KB

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