index.vue 29 KB

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