index.vue 27 KB

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