index.vue 27 KB

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