index.vue 29 KB

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