index.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. <template>
  2. <view>
  3. <view :class="(about.greyTheme==1?'grayTheme':'')">
  4. <view class="bg">
  5. <image :src="about.INDEX_PIC"></image>
  6. </view>
  7. <view v-if="!recommendCard">
  8. <view class="top-title ddflex" :style="'height: '+ systems.navigationHeight + 'rpx;top:' + systems.ktxStatusHeight + 'rpx;'">
  9. <image :src="about.CONFIG_PROJECT_LOGO" mode="heightFix"></image>
  10. {{about.CONFIG_PROJECT_TITLE?about.CONFIG_PROJECT_TITLE:''}}
  11. </view>
  12. </view>
  13. <view class="service-person" :style="'top:' + systems.ktxStatusHeight + 'rpx;'" v-if="recommendCard">
  14. <view class="ddflex" @click="jumpUrl('/card/index/index?cardId='+recommendCard.id)">
  15. <image class="service-person-header"
  16. :src="recommendCard.avatar?recommendCard.avatar:'../../static/pages/images/userimg.png'"></image>
  17. <view>
  18. <view class="service-person-name ddflex">
  19. <view>{{recommendCard.realName}}的微页</view>
  20. <image src="/static/images/rico2.png" class="rico"></image>
  21. </view>
  22. <view class="service-person-number">(工号:{{recommendCard.jobNumber}}) <text v-if="recommendCard&&userInfo.id!=recommendCard.userId">欢迎您来到我的微页</text></view>
  23. </view>
  24. </view>
  25. <view style="margin: 20rpx 30rpx 0;justify-content: space-between;" class="ddflex">
  26. <view>
  27. <view class="ddflex">
  28. <view class="service-person-tag">{{recommendCard.companyName}}</view>
  29. <view class="service-person-tag">{{recommendCard.jobName}}</view>
  30. </view>
  31. <view class="service-person-options ddflex">
  32. <view class="service-person-option ddflex">
  33. <image src="/static/pages/images/dz.png"></image>
  34. <view>{{recommendCard.favorableComment}}%</view>
  35. </view>
  36. <view class="service-person-option ddflex">
  37. <image src="/static/pages/images/cy.png"></image>
  38. <view>入司{{recommendCard.inDate?monthDayDiff(recommendCard.inDate):'1年'}}</view>
  39. </view>
  40. <view class="service-person-option ddflex">
  41. <image src="/static/pages/images/fw.png"></image>
  42. <view>为{{recommendCard.cntCust?recommendCard.cntCust:0}}人服务</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="ddflex">
  47. <view class="service-person-phone" v-if="recommendCard.phone"
  48. @click="callPhone(recommendCard.phone)">
  49. <image src="../../static/pages/images/dh.png"></image>
  50. <view>电话</view>
  51. </view>
  52. <view class="service-person-phone" v-if="recommendCard.wechat||recommendCard.wechatCode||recommendCard.wechatCompanyCode" @click="showCodePop()">
  53. <image src="../../static/pages/images/wx.png"></image>
  54. <view>微信</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view style="height: 610rpx;"></view>
  60. <view v-for="(item, index) in contact" :key="index">
  61. <!-- 弹窗广告 -->
  62. <view style="position: absolute;top:290rpx;left: 0;right: 0;" v-if="bannerList&&bannerList.length>0">
  63. <banner v-if="item == 'ad' && bannerShow" :bannerList="bannerList" :url="site" :web="url"
  64. :config="about" :couponList="couponList" :officeList="officeList"
  65. :districtTemplate="districtTemplate"></banner>
  66. </view>
  67. <district v-if="item == 'king_kong_district' && districtShow" :url="site" :web="url"
  68. :districtTemplate="districtTemplate"></district>
  69. </view>
  70. <view class="index-box" style="margin-top: 10rpx;" v-if="hotActivityList.length>0">
  71. <view class="index-box-title">热门活动</view>
  72. <view class="ddflex" style="margin-top: 20rpx;">
  73. <view style="margin-right: 20rpx;">
  74. <image class="pic230" :src="hotActivityList[0].pic" @click="getUrlHot(hotActivityList[0])"></image>
  75. <image class="pic230" style="margin-top: 20rpx;" :src="hotActivityList[1].pic" @click="getUrlHot(hotActivityList[1])"></image>
  76. </view>
  77. <image class="pic480" :src="hotActivityList[2].pic" @click="getUrlHot(hotActivityList[2])"></image>
  78. </view>
  79. </view>
  80. <!-- 参与活动 -->
  81. <view class="index-box" style="margin-top: 50rpx;" v-if="matchList.length>0">
  82. <view class="index-box-title">更多活动</view>
  83. <view class="map-ac">
  84. <scroll-view scroll-x="true" class="map-acs">
  85. <view class="li" v-for="(item,index) in matchList" :key="index"
  86. @click="jumpUrl('/match/activityDetail/activityDetail?id='+item.id)">
  87. <view style="position: relative;border-radius: 20rpx;overflow: hidden;">
  88. <image :src="item.pic ? item.pic : '/static/images/def_zw1.png'" mode="aspectFill"></image>
  89. <view class="ac-type" v-if="item.categoryName">{{ item.categoryName }}</view>
  90. </view>
  91. <view class="ac-title tovers">{{ item.title }}</view>
  92. </view>
  93. </scroll-view>
  94. </view>
  95. </view>
  96. <!-- 投保案例 -->
  97. <view class="index-box" style="margin:0;padding: 30rpx;background-color: #f5f5f5;" v-if="tbalList.length>0">
  98. <view class="index-box-title">{{tbalName}}</view>
  99. <view>
  100. <view class="tbal-nav ddflex">
  101. <view :class="'tbal-nav-item '+(tbalIndex==index?'tbal-nav-item-active':'' )"
  102. v-for="item,index in tbalList" @click="changeTbalTab(index)" :key="index">
  103. <view>{{item.name}}</view>
  104. <view class="tbal-nav-label" v-if="index==0">20~30岁</view>
  105. <view class="tbal-nav-label" v-else-if="index==1">25-35岁</view>
  106. <view class="tbal-nav-label" v-else-if="index==2">30-50岁</view>
  107. <view class="tbal-nav-label" v-else-if="index==3">50-65岁</view>
  108. </view>
  109. </view>
  110. <block v-if="tbalContentList.length>0">
  111. <view class="tbal-item ddflex" v-for="it in tbalContentList"
  112. @click="jumpUrl('/topic/content/content?id='+it.id)">
  113. <!-- @click="jumpUrl('/topic/alContent/alContent?id='+it.id)" -->
  114. <image class="tbal-pic" :src="it.pic?it.pic:'/static/images/lj_img.png'" mode="aspectFill"></image>
  115. <view class="flex">
  116. <view class="tbal-title">{{it.title}}</view>
  117. <view class="ddflex">
  118. <view class="flex">
  119. <view class="tbal-price">
  120. {{it.fieldValues&&it.fieldValues.yearMoney?it.fieldValues.yearMoney:'0'}}
  121. </view>
  122. <view class="tbal-price-text">年缴费</view>
  123. </view>
  124. <view class="tbal-line"></view>
  125. <view class="flex">
  126. <view class="tbal-price">
  127. {{it.fieldValues&&it.fieldValues.allMoney?it.fieldValues.allMoney:'0'}}
  128. </view>
  129. <view class="tbal-price-text">总保额 </view>
  130. </view>
  131. </view>
  132. <view class="tbal-btn">去看看</view>
  133. </view>
  134. <view class="tbal-tag" v-if="it.fieldValues&&it.fieldValues.version">{{it.fieldValues.version}}
  135. </view>
  136. </view>
  137. </block>
  138. <view class="nodata" v-else style="padding-top: 0rpx;">
  139. <image :src="picUrlss+'empty_dd.png'"></image>
  140. <text>暂无数据</text>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 真实理赔故事 -->
  145. <view class="index-box" v-if="lpalList.length>0">
  146. <view class="index-box-title ddflex">
  147. <text class="fflex">{{lpalName}}</text>
  148. <view class="fx-header-more ddflex"
  149. @click="jumpUrl('/topic/contentList/contentList?code='+lpalCode+'&title='+lpalName)">
  150. 更多
  151. <image src="/static/pages/images/more.png"></image>
  152. </view>
  153. </view>
  154. <view class="map-ac">
  155. <scroll-view scroll-x="true" class="map-acs ddflex" style="height: 502rpx;">
  156. <view class="lpgs-item" v-for="items,indexs in lpalList ">
  157. <image class="lpgs-icon" src="../../static/images/lpgs_icon.png"></image>
  158. <view :class="'lpgs-header '+(indexs%2==0?'':'lpgs-header-c')">
  159. <view>{{items.name}}</view>
  160. </view>
  161. <view class="lpgs-content" v-if="items.contentList&&items.contentList.length>0">
  162. <view class="lpgs-item-content ddflex" v-for="item,index in items.contentList" :key="index"
  163. @click="jumpUrl('/topic/content/content?id='+item.id)">
  164. <view class="flex" style="min-width: 0;">
  165. <view class="lpgs-item-content-title tovers3">{{item.title}}</view>
  166. <view class="lpgs-item-content-look ddflex">
  167. <image src="/static/images/eyes.png"></image>
  168. <view>{{unitFormat(item.browse)}}</view>
  169. </view>
  170. </view>
  171. <image class="lpgs-item-content-pic"
  172. :src="item.pic?item.pic:'/static/images/lj_img.png'"></image>
  173. </view>
  174. </view>
  175. <view class="lpgs-content" v-else>
  176. <view class="nodata" style="padding-top: 40rpx;padding-bottom: 40rpx;">
  177. <image :src="picUrlss+'empty_dd.png'" style="margin: 0 auto 0rpx;width: 208rpx;height: 139rpx;" mode="aspectFill"></image>
  178. <text>暂无数据</text>
  179. </view>
  180. </view>
  181. </view>
  182. </scroll-view>
  183. </view>
  184. </view>
  185. <!-- 发现 -->
  186. <view class="index-box" style="margin:0;padding: 30rpx;background-color: #f5f5f5;" v-if="fxList.length>0">
  187. <view class="map-ac">
  188. <scroll-view scroll-x="true" class="map-acs ddflex" style="height: 70rpx;">
  189. <view :class="'fx-nav '+(fxIndex==index?'fx-nav-active':'')" v-for="item,index in fxList"
  190. @click="changeFxTab(index)">
  191. <view class="fx-dot" v-if="item.addToday>0 && !getReadFindCode()[item.code]"></view>
  192. {{item.name}}
  193. </view>
  194. </scroll-view>
  195. </view>
  196. <view class="fx-bar">
  197. <view class="fx-header ddflex">
  198. <view class="ddflex">
  199. <view class="fx-header-title">{{fxList[fxIndex].name}}</view>
  200. <view class="fx-header-more">{{unitFormat(fxList[fxIndex].shareCount?fxList[fxIndex].shareCount:0)}}人浏览</view>
  201. </view>
  202. <view class="fx-header-more ddflex"
  203. @click="jumpUrl('/topic/contentList/contentList?code='+fxList[fxIndex].code+'&title='+fxList[fxIndex].name)">
  204. 更多
  205. <image src="/static/pages/images/more.png"></image>
  206. </view>
  207. </view>
  208. <view v-if="fxContentList.length>0">
  209. <view class="fx-item ddflex" v-for="item in fxContentList"
  210. @click="jumpUrl('/topic/content/content?id='+item.id)">
  211. <view class="flex" style="min-width: 0;">
  212. <view class="fx-item-title tovers3">{{item.title}}</view>
  213. <view class="ddflex" style="margin-top: 24rpx;">
  214. <view class="fx-item-time">{{formatTime(item.createDate)}}</view>
  215. <view class="fx-item-look ddflex">
  216. <image src="/static/images/eyes.png"></image>
  217. <view>{{unitFormat(item.browse)}}</view>
  218. </view>
  219. </view>
  220. </view>
  221. <image class="fx-item-pic" :src="item.pic?item.pic:'../../static/images/lj_img.png'" mode="aspectFill"></image>
  222. </view>
  223. </view>
  224. <view class="nodata" v-else style="padding-top: 0rpx;padding-bottom: 40rpx;">
  225. <image :src="picUrlss+'empty_dd.png'" style="margin: 0 auto 0rpx;width: 208rpx;height: 139rpx;" mode="aspectFill"></image>
  226. <text>暂无数据</text>
  227. </view>
  228. </view>
  229. </view>
  230. <!-- <component v-for="(item,index) in contact" ></component> -->
  231. <!-- <ad></ad> -->
  232. <block v-if="contactShow">
  233. <view class="spinner">
  234. <view class="spinner-container container1">
  235. <view class="circle1"></view>
  236. <view class="circle2"></view>
  237. <view class="circle3"></view>
  238. <view class="circle4"></view>
  239. </view>
  240. <view class="spinner-container container2">
  241. <view class="circle1"></view>
  242. <view class="circle2"></view>
  243. <view class="circle3"></view>
  244. <view class="circle4"></view>
  245. </view>
  246. <view class="spinner-container container3">
  247. <view class="circle1"></view>
  248. <view class="circle2"></view>
  249. <view class="circle3"></view>
  250. <view class="circle4"></view>
  251. </view>
  252. </view>
  253. <view class="lond">加载中···</view>
  254. </block>
  255. <view class="foot-logo">
  256. <image src="/static/images/zgrs_logo.png"></image>
  257. </view>
  258. <!-- <footer-copyright v-if="logo"></footer-copyright> -->
  259. <!-- <contact-button img-url="/static/pages/images/kfico1_1.png" class-name="contact_index" button-text="客服"></contact-button> -->
  260. <!-- <view class="guide" @tap="hideGuide" v-if="first">
  261. <image src="/static/pages/images/guide.png" mode="widthFix"></image>
  262. </view> -->
  263. </view>
  264. <!-- <view class="placeholder-view" :style="'height:' + (bottomBlankHeight + 115) + 'rpx'"></view> -->
  265. <foot channel="home" :isUpdate="isUpdate"></foot>
  266. <view class="ceng2" v-if="isShowCodePop" @click="isShowCodePop = false" @touchmove.stop.prevent="moveHandle">
  267. </view>
  268. <view :class="'code-pop ' +(about.greyTheme==1?'grayTheme':'')" v-if="isShowCodePop">
  269. <view v-if="recommendCard.wechatCode||recommendCard.wechatCompanyCode" class="ddflex" style="justify-content: center;">
  270. <view class="code-content" v-if="recommendCard.wechatCode">
  271. <image :src="recommendCard.wechatCode?recommendCard.wechatCode:'/static/images/wxCode.jpg'" :style="recommendCard.wechatCompanyCode?'width: 200rpx;height: 200rpx;':''"
  272. show-menu-by-longpress="true"></image>
  273. <view style="text-align: center;font-size: 24rpx;color: #999;margin-bottom: 50rpx;">长按识别微信二维码</view>
  274. </view>
  275. <view class="code-content" v-if="recommendCard.wechatCompanyCode" :style="recommendCard.wechatCode?'margin-left:30rpx':''">
  276. <image :src="recommendCard.wechatCompanyCode?recommendCard.wechatCompanyCode:'/static/images/wxCode.jpg'" :style="recommendCard.wechatCode?'width: 200rpx;height: 200rpx;':''"
  277. show-menu-by-longpress="true"></image>
  278. <view style="text-align: center;font-size: 24rpx;color: #999;margin-bottom: 50rpx;">长按识别企微二维码</view>
  279. </view>
  280. </view>
  281. <view class="code-text" v-else>
  282. <view>微信号</view>
  283. <view>{{recommendCard.wechat}}</view>
  284. </view>
  285. <view class="code-btn" @click="copy(recommendCard.wechat)" v-if="recommendCard.wechat">
  286. 复制微信号
  287. </view>
  288. </view>
  289. <view class="bind-btn" v-if="userInfo.id&&userInfo.userType!=1&&!userInfo.manageSaleNo" @click="bindSale()" :style="'bottom:'+(recommendCard&&userInfo.id!=recommendCard.userId?'480rpx;':'360rpx;')">
  290. <image style="width: 38rpx;height: 38rpx;" src="/static/images/bind.png" mode="aspectFit"></image>
  291. <view class="change-option-text">绑定</view>
  292. <!-- 绑定销售员-->
  293. </view>
  294. <msgNumber :bottom="recommendCard&&userInfo.id!=recommendCard.userId?'350rpx':'230rpx'"></msgNumber>
  295. <!-- <view class="chat-fixed" v-if="recommendCard">
  296. <view class="chat-box ddflex" @click="jumpSingleChatRoom()">
  297. <image :src="recommendCard.avatar?recommendCard.avatar:'../../static/pages/images/userimg.png'"></image>
  298. <view class="chat-lyl">聊一聊</view>
  299. </view>
  300. </view> -->
  301. <view :class="'chat-fixed '+(chatShow?'chat-fixed-long':'')" v-if="recommendCard&&userInfo.id!=recommendCard.userId">
  302. <view class="chat-box ddflex" @click="jumpSingleChatRoom()">
  303. <image :src="recommendCard.avatar?recommendCard.avatar:'../../static/pages/images/userimg.png'"></image>
  304. <view v-if="chatShowText" class="fflex tover"
  305. style="font-size: 24rpx;color: #333333;margin-left: 20rpx;">您好,我是{{recommendCard.realName}},欢迎访问我的微页
  306. </view>
  307. <view :class="'chat-lyl '+(!chatShowText?'chat-lyl2':'')">聊一聊</view>
  308. </view>
  309. </view>
  310. <!-- <to-userinfo v-if="isShowUpdate" @closeUpdate="closeUpdate"></to-userinfo> -->
  311. <update-userinfonew :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfonew>
  312. </view>
  313. </template>
  314. <script>
  315. //index.js
  316. //获取应用实例
  317. const app = getApp();
  318. const req = require('../../utils/request.js');
  319. const api = require('../../utils/api.js');
  320. const utils = require('../../utils/util.js');
  321. const mes = require('../../utils/requestmessage.js');
  322. const route = require('../../utils/route');
  323. const QQMapWX = require("../../utils/qqmap.js");
  324. import foot from '../../components/nav-bar/index';
  325. import footerCopyright from '../../components/footer-copyright/footer-copyright';
  326. import banner from '../../template/banner/banner';
  327. import district from '../../template/king_kong_district/king_kong_district';
  328. import msgNumber from '../../components/msg-number/index.vue';
  329. export default {
  330. data() {
  331. return {
  332. picUrlss: req.public.picUrls,
  333. skinNotColor: req.public.skinNotColor,
  334. systems: {},
  335. header: req.header,
  336. bottomBlankHeight: app.globalData.isIPhoneX ? 68 : 0,
  337. bannerList: [],
  338. //产品分类列表
  339. page: 1,
  340. //产品列表
  341. merchant: {},
  342. activityGroup: {
  343. products: []
  344. },
  345. couponList: {}, //优惠券,
  346. isUpdate: false,
  347. // 是否更新消息
  348. first: true,
  349. //是否显示提示加入我的小程序
  350. isLayerAd: true,
  351. //广告
  352. homeTemplate: [],
  353. //首页栏目配置
  354. storeShow: true,
  355. templateType: {
  356. module_ad: 'ad',
  357. //广告
  358. module_type_district: 'type_district',
  359. //分类导航
  360. module_king_kong_district: 'king_kong_district', //金刚区
  361. },
  362. isNotice: false,
  363. joingroupList: {
  364. products: []
  365. },
  366. //拼团
  367. bargainList: {
  368. products: []
  369. },
  370. //砍价
  371. customersList: {
  372. products: []
  373. },
  374. //新客
  375. freshen: true,
  376. url: '',
  377. web: '',
  378. site: '',
  379. districtTemplate: {},
  380. contact: [],
  381. seckillList: {
  382. products: []
  383. },
  384. about: {},
  385. Is_Store_Price_Stock: '',
  386. guarantee: [],
  387. animationData: '',
  388. content: '',
  389. popAdList: {},
  390. iscouponAd: false,
  391. logo: false,
  392. top: Boolean,
  393. top_type: Boolean,
  394. switchStoreShow: Boolean,
  395. contactShow: true,
  396. districtShow: false,
  397. bannerShow: false,
  398. officeList: [], //互动
  399. hotActivityList: [], //热门活动
  400. matchList: [], //活动列表
  401. tbalName:'',
  402. tbalList: [], //投保案例
  403. tbalIndex: 0, //投保案例tab
  404. tbalContentList: [],
  405. lpalName:'',
  406. lpalList: [], //理赔案例
  407. fxList: [], //发现
  408. fxIndex: 0,
  409. fxContentList: [],
  410. recommendCard: '', //销售
  411. isShowCodePop: false,
  412. lpalCode: req.public.lpalCode,
  413. chatShow: true,
  414. chatShowText: true,
  415. userInfo:{},
  416. isShowUpdate: false, //是否显示更新信息弹窗
  417. isUpdateInfo: false,//更新用户信息
  418. isUpdateMobile: false,//绑定手机号
  419. firstLoad:true,//第一次加载页面
  420. };
  421. },
  422. components: {
  423. foot,
  424. footerCopyright,
  425. banner,
  426. district,
  427. msgNumber
  428. },
  429. props: {},
  430. onPullDownRefresh() {
  431. req.removeStorage('shareId')
  432. setTimeout(()=>{
  433. uni.stopPullDownRefresh()
  434. },1000)
  435. this.getHotActivity()
  436. this.getMatchList()
  437. this.getTbal()
  438. this.getLpal()
  439. this.getFx()
  440. QQMapWX.initMap();
  441. req.getLocation(res => {
  442. const to = {
  443. latitude: res.latitude,
  444. longitude: res.longitude
  445. };
  446. QQMapWX.reverseGeocoder(to, resp => {});
  447. this.getRecommendCard(to)
  448. });
  449. },
  450. onLoad: async function(options) {
  451. // console.log("扫码进去参数===" + JSON.stringify(options));
  452. // if (options.scene) {
  453. // // this.scene = options.scene || '1290926887903780865';
  454. // this.scene = options.scene;
  455. // await this.loadCodeParams();
  456. // }
  457. // wx.setNavigationBarColor({
  458. // frontColor: '#ffffff',
  459. // backgroundColor: req.public.titleTopBgColor,
  460. // })
  461. // this.getPopAd()
  462. this.query = options;
  463. // req.silenceLogin(options.userId, '');
  464. if (options.custom_params) {
  465. let obj = decodeURIComponent(opt.custom_params);
  466. obj = JSON.parse(obj);
  467. // console.log(obj)
  468. req.setStorage('pidCode', obj.userId);
  469. }
  470. if (options.isShare) {
  471. if (options.userId) {
  472. req.setStorage('pidCode', options.userId);
  473. }
  474. }
  475. setInterval(() => {
  476. this.setData({
  477. isNotice: true
  478. });
  479. }, 10000); // this.init();
  480. // QQMapWX.initMap();
  481. // req.getLocation(res => {
  482. // const to = {
  483. // latitude: res.latitude,
  484. // longitude: res.longitude
  485. // };
  486. // QQMapWX.reverseGeocoder(to, resp => {});
  487. // });
  488. },
  489. async onShow() {
  490. await req.silenceLogin(this.query.userId, '');
  491. let _ts = this;
  492. setTimeout(()=>{
  493. this.userInfo = req.getStorage('userInfo')
  494. console.log('onShow',req.getStorage('userInfo'))
  495. if (this.firstLoad==true) {
  496. req.saveBehaviorNew('',15,4)
  497. }
  498. this.getUpdate()
  499. this.firstLoad = false
  500. },500)
  501. await this.getConfig().then(res => {});
  502. await this.getHomeTemplateConfig();
  503. uni.setNavigationBarColor({
  504. frontColor: this.skinNotColor ? '#000' : '#ffffff',
  505. backgroundColor: req.public.titleTopBgColor
  506. });
  507. _ts.setData({
  508. isUpdate: !_ts.isUpdate
  509. });
  510. this.getHotActivity()
  511. this.getMatchList()
  512. this.getTbal()
  513. this.getLpal()
  514. this.getFx()
  515. QQMapWX.initMap();
  516. req.getLocation(res => {
  517. const to = {
  518. latitude: res.latitude,
  519. longitude: res.longitude
  520. };
  521. QQMapWX.reverseGeocoder(to, resp => {});
  522. this.getRecommendCard(to)
  523. });
  524. // console.log('this.freshen=='+this.freshen)
  525. let first = req.getStorage('first');
  526. if (first !== false)
  527. _ts.setData({
  528. first: true
  529. });
  530. else
  531. _ts.setData({
  532. first: false
  533. });
  534. },
  535. onUnload() {
  536. // this.isShowTime = false;
  537. this.clearAllTimer(1);
  538. this.clearAllTimer(2);
  539. this.clearAllTimer(3);
  540. this.clearAllTimer(4);
  541. },
  542. onHide() {
  543. // this.isShowTime = false;
  544. this.clearAllTimer(1);
  545. this.clearAllTimer(2);
  546. this.clearAllTimer(3);
  547. this.clearAllTimer(4);
  548. },
  549. onShareAppMessage: function() {
  550. },
  551. onShareTimeline() {
  552. },
  553. onReachBottom() {},
  554. methods: {
  555. jumpSingleChatRoom() {
  556. if (this.recommendCard) {
  557. req.jumpSingleChatRoom(this.recommendCard.userId, this.recommendCard.avatar, this.recommendCard
  558. .realName);
  559. req.saveBehaviorNew(this.recommendCard.id,1,14)
  560. }
  561. },
  562. jumpUrl(url) {
  563. if (req.isLogins(false)) {
  564. uni.navigateTo({
  565. url: url
  566. })
  567. }
  568. },
  569. // 获取推荐销售
  570. getRecommendCard(loction) {
  571. let params = loction
  572. if(req.getStorage("shareId")){
  573. params.shareSaleNo = req.getStorage("shareId")
  574. }
  575. req.getRequest('/api/visiting/card/recommendCardInfo', params, res => {
  576. this.recommendCard = res
  577. console.log('获取推荐销售》》》》》', res);
  578. setTimeout(() => {
  579. this.chatShow = false
  580. setTimeout(() => {
  581. this.chatShowText = false
  582. }, 450)
  583. }, 2000)
  584. // 判断销售员是否离职
  585. this.getEmploymentState()
  586. })
  587. },
  588. getEmploymentState(){
  589. req.getRequest('/api/visiting/card/saleIsDepart',{},res=>{
  590. let userInfo = req.getStorage('userInfo')
  591. req.getRequest('/api/user/info', {}, suc => {
  592. userInfo.manageSaleNo = suc.manageSaleNo
  593. req.setStorage('userInfo',userInfo)
  594. this.userInfo.manageSaleNo = suc.manageSaleNo
  595. });
  596. })
  597. },
  598. // 获取热门活动
  599. getHotActivity() {
  600. req.getRequest('/api/banner', {
  601. code: 'index_hot_activity'
  602. }, res => {
  603. this.hotActivityList = res?res:[]
  604. })
  605. },
  606. // 获取更多活动
  607. getMatchList() {
  608. req.getRequest('/api/match/list', {
  609. page: 1,
  610. limit: 10,
  611. shareSaleNo:req.getStorage("shareId")?req.getStorage("shareId"):null
  612. }, res => {
  613. this.matchList = res
  614. })
  615. },
  616. // 获取投保案例
  617. async getTbal() {
  618. this.tbalName =await this.getContentName(req.public.tbalCode)
  619. this.tbalList = await this.getContentList(req.public.tbalCode)
  620. if(this.tbalList.length>0)
  621. this.tbalContentList = await this.getContentPageList(this.tbalList[this.tbalIndex]
  622. .code)
  623. this.$forceUpdate()
  624. },
  625. // 获取理赔案例
  626. async getLpal() {
  627. this.lpalName =await this.getContentName(req.public.lpalCode)
  628. if(this.lpalList.length==0){
  629. this.lpalList = await this.getContentList(req.public.lpalCode)
  630. }else{
  631. // 防止页面onShow时内容闪动
  632. let lpal = await this.getContentList(req.public.lpalCode)
  633. for(let i=0;i<lpal.length;i++){
  634. let item = lpal[i]
  635. for(let j=0;j<this.lpalList.length;j++){
  636. let it = this.lpalList[i]
  637. if(it.id==item.id){
  638. item.contentList = it.contentList?it.contentList:[]
  639. }
  640. }
  641. }
  642. }
  643. this.lpalList.map(async item => {
  644. item.contentList = await this.getContentPageList(item.code)
  645. this.$forceUpdate()
  646. })
  647. },
  648. // 获取发现
  649. async getFx() {
  650. this.fxList = await this.getContentList('faxian')
  651. this.getFxContenteList(this.fxList[this.fxIndex].code)
  652. },
  653. // 获取文章栏目名称
  654. getContentName(code) {
  655. return new Promise((r, j) => {
  656. req.getRequest('/api/content/category/detailByCode', {
  657. code: code
  658. }, res => {
  659. r(res ? res.name : '')
  660. })
  661. })
  662. },
  663. // 获取文章栏目列表
  664. getContentList(code) {
  665. return new Promise((r, j) => {
  666. req.getRequest('/api/content/category/list', {
  667. parentCode: code
  668. }, res => {
  669. r(res ? res : [])
  670. })
  671. })
  672. },
  673. // 获取文章列表
  674. getContentPageList(code) {
  675. return new Promise((r, j) => {
  676. req.getRequest('/api/content/list', {
  677. code: code,
  678. page: 1,
  679. limit: 2,
  680. shareSaleNo : req.getStorage("shareId")?req.getStorage("shareId"):null
  681. }, res => {
  682. r(res ? res : [])
  683. })
  684. })
  685. },
  686. // 获取发现文章列表
  687. getFxContenteList(code) {
  688. return new Promise((r, j) => {
  689. req.getRequest('/api/content/list', {
  690. code: code,
  691. page: 1,
  692. limit: 10,
  693. shareSaleNo : req.getStorage("shareId")?req.getStorage("shareId"):null
  694. }, res => {
  695. this.fxContentList = res ? res : []
  696. r(res ? res : [])
  697. })
  698. })
  699. },
  700. // 投保案例tab切换
  701. async changeTbalTab(index) {
  702. if (this.tbalIndex == index) return false;
  703. this.tbalIndex = index
  704. this.tbalContentList = await this.getContentPageList(this.tbalList[this.tbalIndex]
  705. .code)
  706. this.$forceUpdate()
  707. },
  708. // 发现tab切换
  709. changeFxTab(index) {
  710. if (this.fxIndex == index) return false;
  711. this.fxIndex = index
  712. this.getFxContenteList(this.fxList[this.fxIndex].code)
  713. if(this.fxList[this.fxIndex].addToday>0){
  714. let s = req.getStorage('readFindCode')
  715. let readObj = {
  716. date:utils.formatTime(new Date()).t2,
  717. readCode:(s && s.date == utils.formatTime(new Date()).t2)?s.readCode:{}
  718. }
  719. if(readObj.readCode[this.fxList[this.fxIndex].code]){
  720. }else{
  721. readObj.readCode[this.fxList[this.fxIndex].code] = true
  722. }
  723. req.setStorage('readFindCode',readObj)
  724. }
  725. this.isUpdate = !this.isUpdate
  726. },
  727. getReadFindCode(){
  728. let s = req.getStorage('readFindCode')
  729. if(s && s.date == utils.formatTime(new Date()).t2){
  730. return req.getStorage('readFindCode').readCode
  731. }else{
  732. return {}
  733. }
  734. },
  735. async getRqeDatas() {
  736. console.log('getRqeDatas');
  737. let that = this; //多门店
  738. // 金刚区
  739. let district = that.homeTemplate.filter(it => it.module == that.templateType
  740. .module_king_kong_district);
  741. if (district && district.length > 0 && district[0].state == 0) {
  742. let data = district[0];
  743. data.content = JSON.parse(district[0].content);
  744. that.districtTemplate = data;
  745. if (data.contentId == 2) {
  746. that.districtShow = true;
  747. }
  748. console.log(that.districtTemplate, '=============');
  749. }
  750. //顶部banner
  751. let ad = that.homeTemplate.filter(it => it.module == that.templateType.module_ad);
  752. if (ad && ad.length > 0 && ad[0].state == 0) {
  753. if (that.freshen) {
  754. await that.getBannerList(ad[0].module, ad[0].contentId);
  755. }
  756. }
  757. that.logo = true;
  758. },
  759. //获取首页模板配置
  760. getHomeTemplateConfig() {
  761. let _ts = this;
  762. let page = 'index';
  763. //荣康模板配置、小店产品==门店产品
  764. // if (this.merchant && this.merchant.type == 5 || this.shopId && this.merchantId) page = 'shopIndex'
  765. req.getRequest(
  766. '/api/template/getTemplate', {
  767. page: page
  768. },
  769. data => {
  770. let arr = [];
  771. data.forEach(it => {
  772. arr.push(it.module);
  773. });
  774. this.setData({
  775. contact: [...new Set(arr)],
  776. contactShow: false
  777. });
  778. if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('store_options') != -1) {
  779. this.top = false;
  780. } else {
  781. this.top = true;
  782. }
  783. if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('type_district') != -1) {
  784. this.top_type = false;
  785. } else {
  786. this.top_type = true;
  787. }
  788. console.log(this.contact.indexOf('sou') != -1, this.contact.indexOf('store_options') != -1,
  789. this.contact.indexOf('type_district') != -1, this.top);
  790. console.log(this.contact);
  791. this.setData({
  792. homeTemplate: data
  793. });
  794. this.getRqeDatas();
  795. }
  796. );
  797. },
  798. getConfig() {
  799. var _this = this;
  800. return new Promise((res, rej) => {
  801. req.g(
  802. '/api/other/config',
  803. data => {
  804. req.setStorage('configRes', JSON.stringify(data));
  805. this.about = data;
  806. if (!data.Index_Store_Confirm || data.Index_Store_Confirm == 0) {
  807. _this.setData({
  808. switchStoreShow: false,
  809. storeShow: false
  810. });
  811. } else {
  812. _this.setData({
  813. switchStoreShow: true
  814. });
  815. }
  816. // console.log(data.Index_Store_Confirm, "====", !data.Index_Store_Confirm, typeof(res
  817. // .Index_Store_Confirm))
  818. uni.setNavigationBarTitle({
  819. // title: res['CONFIG_PROJECT_TITLE'],
  820. title: data['CONFIG_PROJECT_TITLE']
  821. });
  822. // console.log(data.Is_Store_Price_Stock);
  823. if (data.Is_Store_Price_Stock) {
  824. this.Is_Store_Price_Stock = data.Is_Store_Price_Stock;
  825. }
  826. this.setData({
  827. Is_Store_Price_Stock: data.Is_Store_Price_Stock
  828. });
  829. if (data.b2c_service_guarantee && data.b2c_service_guarantee != null) {
  830. this.setData({
  831. guarantee: data.b2c_service_guarantee.split(';').filter(it => {
  832. return (it = it && it.trim());
  833. })
  834. });
  835. }
  836. req.setStorage('appName', data['CONFIG_PROJECT_TITLE']);
  837. req.setStorage('productDiy', data['Product_Foot-Diy']);
  838. res(data);
  839. },
  840. true
  841. );
  842. });
  843. },
  844. merchantFun() {
  845. app.globalData.openPage('pages/nearby/nearby');
  846. },
  847. saoma() {
  848. var _this = this; // 允许从相机和相册扫码
  849. uni.scanCode({
  850. success: res => {
  851. uni.navigateTo({
  852. url: '/' + res.path
  853. }); // this.scene = '1290926887903780865';
  854. this.loadCodeParams();
  855. }
  856. });
  857. },
  858. update(content) {
  859. var that = this;
  860. var animation = uni.createAnimation(); // 旧消息向上平移
  861. animation.translateY(-50).step({
  862. duration: 1000,
  863. timingFunction: 'ease-in'
  864. }); // 为了实现下一条新内容向上平移的效果,必须把内容很快平移到下方,并且不能被用户看见,这里其原理类似轮播图的思路。
  865. // 实现方法:动画时间设置为1ms,过渡效果设置为’动画第一帧就跳至结束状态直到结束‘
  866. animation
  867. .opacity(0)
  868. .translateY(50)
  869. .step({
  870. duration: 1000,
  871. timingFunction: 'step-start'
  872. }); // 新消息向上平移的同时恢复透明
  873. animation
  874. .opacity(1)
  875. .translateY(0)
  876. .step({
  877. duration: 1000,
  878. timingFunction: 'ease-out'
  879. });
  880. that.setData({
  881. animationData: animation.export()
  882. }); // 更新内容的延时必须大于第一步动画时间
  883. setTimeout(() => {
  884. that.setData({
  885. content: content
  886. });
  887. }, 500000);
  888. },
  889. loadCodeParams() {
  890. let _ts = this;
  891. return new Promise((resolve, reject) => {
  892. if (!_ts.scene) {
  893. resolve();
  894. return false;
  895. }
  896. req.getRequest(
  897. '/api/code/params', {
  898. scene: _ts.scene
  899. },
  900. data => {
  901. req.setStorage('pidCode', data.userId);
  902. resolve();
  903. }
  904. );
  905. });
  906. },
  907. getBannerList(module, contentId) {
  908. //banner图
  909. let that = this;
  910. return new Promise((resolve, reject) => {
  911. req.getRequest(
  912. '/api/banner', {
  913. groupId: contentId
  914. },
  915. data => {
  916. if (module == that.templateType.module_ad) {
  917. that.setData({
  918. bannerList: data,
  919. bannerShow: true
  920. });
  921. } else {
  922. that.setData({
  923. popAdList: data[0]
  924. });
  925. }
  926. resolve();
  927. }
  928. );
  929. })
  930. },
  931. clearAllTimer(type) {
  932. // console.log(this.activityGroup, this.joingroupList, this.bargainList, this.customersList);
  933. if (type == 1) {
  934. this.activityGroup.products.forEach(it => clearInterval(it.timer));
  935. this.activityGroup.products.forEach(it => clearInterval(it.times));
  936. } else if (type == 2) {
  937. this.joingroupList.products.forEach(it => clearInterval(it.timer));
  938. this.joingroupList.products.forEach(it => clearInterval(it.times));
  939. } else if (type == 3) {
  940. this.bargainList.products.forEach(it => clearInterval(it.timer));
  941. this.bargainList.products.forEach(it => clearInterval(it.times));
  942. } else if (type == 4) {
  943. this.customersList.products.forEach(it => clearInterval(it.timer));
  944. this.customersList.products.forEach(it => clearInterval(it.times));
  945. } else if (type == 5) {
  946. this.seckillList.products.forEach(it => clearInterval(it.timer));
  947. this.seckillList.products.forEach(it => clearInterval(it.times));
  948. }
  949. },
  950. hideGuide() {
  951. //关闭提示加入我的小程序
  952. this.setData({
  953. first: false
  954. });
  955. req.setStorage('first', false);
  956. },
  957. hideAd() {
  958. //关闭广告
  959. // if(this.data.first==false){
  960. this.setData({
  961. isLayerAd: false
  962. }); // }
  963. app.globalData.isLayerAd = false;
  964. },
  965. click(e) {
  966. // console.log(e)
  967. this.storeShow = e;
  968. },
  969. goUrl(event) {
  970. //跳转链接
  971. let url = event.currentTarget.dataset.url;
  972. app.globalData.openPage(url);
  973. },
  974. showCodePop(){
  975. this.isShowCodePop = true
  976. req.saveBehaviorNew(this.recommendCard.id,1,18)
  977. },
  978. // 拨打电话
  979. callPhone(val) {
  980. if (!val) return false
  981. uni.makePhoneCall({
  982. phoneNumber: val,
  983. success(res){
  984. req.saveBehaviorNew(this.recommendCard.id,1,17,this.recommendCard.phone)
  985. }
  986. });
  987. },
  988. copy(val) {
  989. this.isShowCodePop = false
  990. uni.setClipboardData({
  991. data: val,
  992. complete() {
  993. req.msg('复制成功')
  994. }
  995. })
  996. },
  997. unitFormat(data) {
  998. return req.unitConverter(data).text
  999. },
  1000. formatTime(date) {
  1001. date = new Date(date.replace(/-/g, '/'))
  1002. return utils.formatTime(date).t3
  1003. },
  1004. monthDayDiff(date) {
  1005. return utils.monthDayDiff(date)
  1006. },
  1007. // 热门活动
  1008. async getUrlHot(item) {
  1009. console.log(item)
  1010. var dt = item
  1011. var url = "";
  1012. var id = "";
  1013. var acid = "";
  1014. if (dt.content != "") {
  1015. let conunt = dt.content.split("_");
  1016. id = conunt[1];
  1017. acid = conunt[0];
  1018. }
  1019. if (dt.type * 1 == 2 && dt.content != "") {
  1020. url = "product/detail/detail?id=" + dt.content;
  1021. } else if (dt.type * 1 == 3) {
  1022. url = dt.content;
  1023. console.log('url===',url)
  1024. if(!url){
  1025. req.msg('功能待接入')
  1026. return false
  1027. }
  1028. if(url=='pages/index/index'||url=='pages/matchList/index'||url=='pages/interactive/index'||url=='pages/found/found'||url=='pages/user/user'){
  1029. app.globalData.switchTab(url)
  1030. return false
  1031. }else{
  1032. if(url.indexOf('http')!=-1){
  1033. if(url.indexOf('${salesno}')!=-1){
  1034. // 如果打开的分享的销售员微页
  1035. if(req.getStorage('shareId')){
  1036. url = url.replace(/\${salesno}/g,'salesno='+req.getStorage('shareId'))
  1037. }else{
  1038. // 如果自己是销售员
  1039. if(req.getStorage('userInfo').saleNo){
  1040. url = url.replace(/\${salesno}/g,'salesno='+req.getStorage('userInfo').saleNo)
  1041. }else{
  1042. //当前绑定的微页或推荐的微页
  1043. let salesno = await new Promise((r,j)=>{
  1044. req.getLocation(res => {
  1045. const to = {
  1046. latitude: res.latitude,
  1047. longitude: res.longitude
  1048. };
  1049. req.getRequest('/api/visiting/card/recommendCardInfo', to, res => {
  1050. r(res.jobNumber?res.jobNumber:'')
  1051. })
  1052. });
  1053. })
  1054. url = url.replace(/\${salesno}/g,'salesno='+salesno)
  1055. }
  1056. }
  1057. }
  1058. app.globalData.openPage('pages/web/web?url='+encodeURIComponent(url));
  1059. return false
  1060. }
  1061. }
  1062. } else if (dt.type * 1 == 4) {
  1063. url = "product/groupDetail/groupDetail?acid=" + acid + "&id=" + id;
  1064. } else if (dt.type * 1 == 5) {
  1065. url = "product/coupon/coupon";
  1066. } else if (dt.type * 1 == 6) {
  1067. url = "pages/live/live";
  1068. } else if (dt.type * 1 == 7) {
  1069. url = "product/groupList/groupList" + dt.merchant;
  1070. } else if (dt.type * 1 == 9 && dt.content != "") {
  1071. url = "product/list/list?id=" + dt.content + '&title=' + dt.title + this.web;
  1072. } else if (dt.type * 1 == 10) {
  1073. url = "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=" + dt.content;
  1074. // console.log(
  1075. // url); // url=`plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${dt.content}`
  1076. } else if (dt.type * 1 == 11) {
  1077. url = "activity/group/index/index" + dt.merchant;
  1078. } else if (dt.type * 1 == 12) {
  1079. url = "activity/seckill/seckill" + dt.merchant;
  1080. } else if (dt.type * 1 == 13) {
  1081. url = "activity/bargain/index/index" + dt.merchant;
  1082. } else if (dt.type * 1 == 14) {
  1083. url = "activity/newbornZone/newbornZone" + dt.merchant;
  1084. } else if (dt.type * 1 == 15 && dt.content != "") {
  1085. url = "activity/newbornDetails/newbornDetails?acid=" + acid + "&id=" + id;
  1086. } else if (dt.type * 1 == 16 && dt.content != "") {
  1087. url = "activity/seckillDetails/seckillDetails?acid=" + acid + "&id=" + id;
  1088. } else if (dt.type * 1 == 17 && dt.content != "") {
  1089. url = "activity/bargain/detail/detail?acid=" + acid + "&id=" + id;
  1090. } else if (dt.type * 1 == 18 && dt.content != "") {
  1091. url = "activity/group/detail/detail?acid=" + acid + "&id=" + id;
  1092. }else if (dt.type * 1 == 19 && dt.content != "") {
  1093. url = "topic/content/content?id=" + dt.content;
  1094. }else if (dt.type * 1 == 27 && dt.content != "") {
  1095. url = "match/activityDetail/activityDetail?id=" + dt.content;
  1096. }else if (dt.type * 1 == 1 && dt.content != "") {
  1097. console.log('dt.content',dt.content)
  1098. uni.navigateToMiniProgram({
  1099. appId: dt.content, // 目标小程序appid
  1100. path: '', // 目标路径,例如‘pages/billManage/index’
  1101. extraData: {}, // 跳转传参,例如'orderNo': 'xxx......'
  1102. success(res) {
  1103. uni.showToast({
  1104. title: '跳转成功'
  1105. })
  1106. }
  1107. })
  1108. } else {
  1109. url = "";
  1110. }
  1111. if (dt.type * 1 == 6) app.globalData.switchTab(url);
  1112. else app.globalData.openPage(url);
  1113. this.hideAd();
  1114. },
  1115. closeUpdate(){
  1116. this.isShowUpdate = false
  1117. },
  1118. updateInfo(e){
  1119. this.isUpdateInfo = e;
  1120. },
  1121. updateMobile(e){
  1122. this.isUpdateMobile = e;
  1123. },
  1124. getUpdate() {
  1125. console.log('getUpdate')
  1126. let userInfos = req.getStorage('userInfo')
  1127. // if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
  1128. // console.log('没有昵称')
  1129. // this.isShowUpdate = true;
  1130. // this.isUpdateInfo = true;
  1131. // return false;
  1132. // }
  1133. if(!userInfos.mobile){
  1134. console.log('没有手机号')
  1135. this.isShowUpdate = true
  1136. this.isUpdateMobile = true
  1137. return false;
  1138. }
  1139. return true;
  1140. },
  1141. bindSale(){
  1142. let userInfo = req.getStorage('userInfo');
  1143. console.log('updateInfo userInfo.avatar',userInfo.avatar)
  1144. if (!userInfo.avatar || userInfo.nickName == '微信用户') {
  1145. this.isShowUpdate = true
  1146. this.isUpdateInfo = true
  1147. this.isUpdateMobile = false
  1148. return false
  1149. }
  1150. if(userInfo.avatar&&!userInfo.mobile){
  1151. this.isShowUpdate = true
  1152. this.isUpdateMobile = true
  1153. this.isUpdateInfo = false
  1154. return false
  1155. }
  1156. uni.showModal({
  1157. title:'提示',
  1158. content:`是否绑定${this.recommendCard.realName}为您的专属顾问?`,
  1159. success: (con) => {
  1160. if(con.confirm){
  1161. req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.recommendCard.jobNumber},res=>{
  1162. req.msg('已绑定专属顾问')
  1163. let userInfo = req.getStorage('userInfo')
  1164. userInfo.manageSaleNo = this.recommendCard.jobNumber
  1165. req.setStorage('userInfo',userInfo)
  1166. this.userInfo = req.getStorage('userInfo')
  1167. })
  1168. }
  1169. }
  1170. })
  1171. },
  1172. },
  1173. mounted() {
  1174. const systemInfo = uni.getSystemInfoSync();
  1175. // px转换到rpx的比例
  1176. let pxToRpxScale = 750 / systemInfo.windowWidth;
  1177. let systems = {
  1178. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  1179. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  1180. };
  1181. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  1182. this.systems = systems;
  1183. }
  1184. };
  1185. </script>
  1186. <style>
  1187. @import './index.css';
  1188. </style>