index.vue 27 KB

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