index.vue 27 KB

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