index.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  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. showBindNote:true,//弹出绑定提示
  421. };
  422. },
  423. components: {
  424. foot,
  425. footerCopyright,
  426. banner,
  427. district,
  428. msgNumber
  429. },
  430. props: {},
  431. onPullDownRefresh() {
  432. req.removeStorage('shareId')
  433. setTimeout(()=>{
  434. uni.stopPullDownRefresh()
  435. },1000)
  436. this.getHotActivity()
  437. this.getMatchList()
  438. this.getTbal()
  439. this.getLpal()
  440. this.getFx()
  441. QQMapWX.initMap();
  442. req.getLocation(res => {
  443. const to = {
  444. latitude: res.latitude,
  445. longitude: res.longitude
  446. };
  447. QQMapWX.reverseGeocoder(to, resp => {});
  448. this.getRecommendCard(to)
  449. });
  450. },
  451. onLoad: async function(options) {
  452. // console.log("扫码进去参数===" + JSON.stringify(options));
  453. // if (options.scene) {
  454. // // this.scene = options.scene || '1290926887903780865';
  455. // this.scene = options.scene;
  456. // await this.loadCodeParams();
  457. // }
  458. // wx.setNavigationBarColor({
  459. // frontColor: '#ffffff',
  460. // backgroundColor: req.public.titleTopBgColor,
  461. // })
  462. // this.getPopAd()
  463. this.query = options;
  464. // req.silenceLogin(options.userId, '');
  465. if (options.custom_params) {
  466. let obj = decodeURIComponent(opt.custom_params);
  467. obj = JSON.parse(obj);
  468. // console.log(obj)
  469. req.setStorage('pidCode', obj.userId);
  470. }
  471. if (options.isShare) {
  472. if (options.userId) {
  473. req.setStorage('pidCode', options.userId);
  474. }
  475. }
  476. setInterval(() => {
  477. this.setData({
  478. isNotice: true
  479. });
  480. }, 10000); // this.init();
  481. // QQMapWX.initMap();
  482. // req.getLocation(res => {
  483. // const to = {
  484. // latitude: res.latitude,
  485. // longitude: res.longitude
  486. // };
  487. // QQMapWX.reverseGeocoder(to, resp => {});
  488. // });
  489. },
  490. async onShow() {
  491. await req.silenceLogin(this.query.userId, '');
  492. let _ts = this;
  493. setTimeout(()=>{
  494. this.userInfo = req.getStorage('userInfo')
  495. console.log('onShow',req.getStorage('userInfo'))
  496. if (this.firstLoad==true) {
  497. req.saveBehaviorNew('',15,4)
  498. }
  499. this.getUpdate()
  500. this.firstLoad = false
  501. },500)
  502. await this.getConfig().then(res => {});
  503. await this.getHomeTemplateConfig();
  504. uni.setNavigationBarColor({
  505. frontColor: this.skinNotColor ? '#000' : '#ffffff',
  506. backgroundColor: req.public.titleTopBgColor
  507. });
  508. _ts.setData({
  509. isUpdate: !_ts.isUpdate
  510. });
  511. this.getHotActivity()
  512. this.getMatchList()
  513. this.getTbal()
  514. this.getLpal()
  515. this.getFx()
  516. QQMapWX.initMap();
  517. req.getLocation(res => {
  518. const to = {
  519. latitude: res.latitude,
  520. longitude: res.longitude
  521. };
  522. QQMapWX.reverseGeocoder(to, resp => {});
  523. this.getRecommendCard(to)
  524. });
  525. // console.log('this.freshen=='+this.freshen)
  526. let first = req.getStorage('first');
  527. if (first !== false)
  528. _ts.setData({
  529. first: true
  530. });
  531. else
  532. _ts.setData({
  533. first: false
  534. });
  535. },
  536. onUnload() {
  537. // this.isShowTime = false;
  538. this.clearAllTimer(1);
  539. this.clearAllTimer(2);
  540. this.clearAllTimer(3);
  541. this.clearAllTimer(4);
  542. },
  543. onHide() {
  544. // this.isShowTime = false;
  545. this.clearAllTimer(1);
  546. this.clearAllTimer(2);
  547. this.clearAllTimer(3);
  548. this.clearAllTimer(4);
  549. },
  550. onShareAppMessage: function() {
  551. },
  552. onShareTimeline() {
  553. },
  554. onReachBottom() {},
  555. methods: {
  556. jumpSingleChatRoom() {
  557. if (this.recommendCard) {
  558. req.jumpSingleChatRoom(this.recommendCard.userId, this.recommendCard.avatar, this.recommendCard
  559. .realName);
  560. req.saveBehaviorNew(this.recommendCard.id,1,14)
  561. }
  562. },
  563. jumpUrl(url) {
  564. if (req.isLogins(false)) {
  565. uni.navigateTo({
  566. url: url
  567. })
  568. }
  569. },
  570. // 获取推荐销售
  571. getRecommendCard(loction) {
  572. let params = loction
  573. if(req.getStorage("shareId")){
  574. params.shareSaleNo = req.getStorage("shareId")
  575. }
  576. req.getRequest('/api/visiting/card/recommendCardInfo', params, res => {
  577. this.recommendCard = res
  578. console.log('获取推荐销售》》》》》', res);
  579. setTimeout(() => {
  580. this.chatShow = false
  581. setTimeout(() => {
  582. this.chatShowText = false
  583. }, 450)
  584. }, 2000)
  585. // 判断销售员是否离职
  586. this.getEmploymentState()
  587. })
  588. },
  589. getEmploymentState(){
  590. req.getRequest('/api/visiting/card/saleIsDepart',{},res=>{
  591. let userInfo = req.getStorage('userInfo')
  592. req.getRequest('/api/user/info', {}, suc => {
  593. userInfo.manageSaleNo = suc.manageSaleNo
  594. req.setStorage('userInfo',userInfo)
  595. this.userInfo.manageSaleNo = suc.manageSaleNo
  596. });
  597. })
  598. },
  599. // 获取热门活动
  600. getHotActivity() {
  601. req.getRequest('/api/banner', {
  602. code: 'index_hot_activity'
  603. }, res => {
  604. this.hotActivityList = res?res:[]
  605. })
  606. },
  607. // 获取更多活动
  608. getMatchList() {
  609. req.getRequest('/api/match/list', {
  610. page: 1,
  611. limit: 10,
  612. shareSaleNo:req.getStorage("shareId")?req.getStorage("shareId"):null
  613. }, res => {
  614. this.matchList = res
  615. })
  616. },
  617. // 获取投保案例
  618. async getTbal() {
  619. this.tbalName =await this.getContentName(req.public.tbalCode)
  620. this.tbalList = await this.getContentList(req.public.tbalCode)
  621. if(this.tbalList.length>0)
  622. this.tbalContentList = await this.getContentPageList(this.tbalList[this.tbalIndex]
  623. .code)
  624. this.$forceUpdate()
  625. },
  626. // 获取理赔案例
  627. async getLpal() {
  628. this.lpalName =await this.getContentName(req.public.lpalCode)
  629. if(this.lpalList.length==0){
  630. this.lpalList = await this.getContentList(req.public.lpalCode)
  631. }else{
  632. // 防止页面onShow时内容闪动
  633. let lpal = await this.getContentList(req.public.lpalCode)
  634. for(let i=0;i<lpal.length;i++){
  635. let item = lpal[i]
  636. for(let j=0;j<this.lpalList.length;j++){
  637. let it = this.lpalList[i]
  638. if(it.id==item.id){
  639. item.contentList = it.contentList?it.contentList:[]
  640. }
  641. }
  642. }
  643. }
  644. this.lpalList.map(async item => {
  645. item.contentList = await this.getContentPageList(item.code)
  646. this.$forceUpdate()
  647. })
  648. },
  649. // 获取发现
  650. async getFx() {
  651. this.fxList = await this.getContentList('faxian')
  652. this.getFxContenteList(this.fxList[this.fxIndex].code)
  653. },
  654. // 获取文章栏目名称
  655. getContentName(code) {
  656. return new Promise((r, j) => {
  657. req.getRequest('/api/content/category/detailByCode', {
  658. code: code
  659. }, res => {
  660. r(res ? res.name : '')
  661. })
  662. })
  663. },
  664. // 获取文章栏目列表
  665. getContentList(code) {
  666. return new Promise((r, j) => {
  667. req.getRequest('/api/content/category/list', {
  668. parentCode: code
  669. }, res => {
  670. r(res ? res : [])
  671. })
  672. })
  673. },
  674. // 获取文章列表
  675. getContentPageList(code) {
  676. return new Promise((r, j) => {
  677. req.getRequest('/api/content/list', {
  678. code: code,
  679. page: 1,
  680. limit: 2,
  681. shareSaleNo : req.getStorage("shareId")?req.getStorage("shareId"):null
  682. }, res => {
  683. r(res ? res : [])
  684. })
  685. })
  686. },
  687. // 获取发现文章列表
  688. getFxContenteList(code) {
  689. return new Promise((r, j) => {
  690. req.getRequest('/api/content/list', {
  691. code: code,
  692. page: 1,
  693. limit: 10,
  694. shareSaleNo : req.getStorage("shareId")?req.getStorage("shareId"):null
  695. }, res => {
  696. this.fxContentList = res ? res : []
  697. r(res ? res : [])
  698. })
  699. })
  700. },
  701. // 投保案例tab切换
  702. async changeTbalTab(index) {
  703. if (this.tbalIndex == index) return false;
  704. this.tbalIndex = index
  705. this.tbalContentList = await this.getContentPageList(this.tbalList[this.tbalIndex]
  706. .code)
  707. this.$forceUpdate()
  708. },
  709. // 发现tab切换
  710. changeFxTab(index) {
  711. if (this.fxIndex == index) return false;
  712. this.fxIndex = index
  713. this.getFxContenteList(this.fxList[this.fxIndex].code)
  714. if(this.fxList[this.fxIndex].addToday>0){
  715. let s = req.getStorage('readFindCode')
  716. let readObj = {
  717. date:utils.formatTime(new Date()).t2,
  718. readCode:(s && s.date == utils.formatTime(new Date()).t2)?s.readCode:{}
  719. }
  720. if(readObj.readCode[this.fxList[this.fxIndex].code]){
  721. }else{
  722. readObj.readCode[this.fxList[this.fxIndex].code] = true
  723. }
  724. req.setStorage('readFindCode',readObj)
  725. }
  726. this.isUpdate = !this.isUpdate
  727. },
  728. getReadFindCode(){
  729. let s = req.getStorage('readFindCode')
  730. if(s && s.date == utils.formatTime(new Date()).t2){
  731. return req.getStorage('readFindCode').readCode
  732. }else{
  733. return {}
  734. }
  735. },
  736. async getRqeDatas() {
  737. console.log('getRqeDatas');
  738. let that = this; //多门店
  739. // 金刚区
  740. let district = that.homeTemplate.filter(it => it.module == that.templateType
  741. .module_king_kong_district);
  742. if (district && district.length > 0 && district[0].state == 0) {
  743. let data = district[0];
  744. data.content = JSON.parse(district[0].content);
  745. that.districtTemplate = data;
  746. if (data.contentId == 2) {
  747. that.districtShow = true;
  748. }
  749. console.log(that.districtTemplate, '=============');
  750. }
  751. //顶部banner
  752. let ad = that.homeTemplate.filter(it => it.module == that.templateType.module_ad);
  753. if (ad && ad.length > 0 && ad[0].state == 0) {
  754. if (that.freshen) {
  755. await that.getBannerList(ad[0].module, ad[0].contentId);
  756. }
  757. }
  758. that.logo = true;
  759. },
  760. //获取首页模板配置
  761. getHomeTemplateConfig() {
  762. let _ts = this;
  763. let page = 'index';
  764. //荣康模板配置、小店产品==门店产品
  765. // if (this.merchant && this.merchant.type == 5 || this.shopId && this.merchantId) page = 'shopIndex'
  766. req.getRequest(
  767. '/api/template/getTemplate', {
  768. page: page
  769. },
  770. data => {
  771. let arr = [];
  772. data.forEach(it => {
  773. arr.push(it.module);
  774. });
  775. this.setData({
  776. contact: [...new Set(arr)],
  777. contactShow: false
  778. });
  779. if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('store_options') != -1) {
  780. this.top = false;
  781. } else {
  782. this.top = true;
  783. }
  784. if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('type_district') != -1) {
  785. this.top_type = false;
  786. } else {
  787. this.top_type = true;
  788. }
  789. console.log(this.contact.indexOf('sou') != -1, this.contact.indexOf('store_options') != -1,
  790. this.contact.indexOf('type_district') != -1, this.top);
  791. console.log(this.contact);
  792. this.setData({
  793. homeTemplate: data
  794. });
  795. this.getRqeDatas();
  796. }
  797. );
  798. },
  799. getConfig() {
  800. var _this = this;
  801. return new Promise((res, rej) => {
  802. req.g(
  803. '/api/other/config',
  804. data => {
  805. req.setStorage('configRes', JSON.stringify(data));
  806. this.about = data;
  807. if (!data.Index_Store_Confirm || data.Index_Store_Confirm == 0) {
  808. _this.setData({
  809. switchStoreShow: false,
  810. storeShow: false
  811. });
  812. } else {
  813. _this.setData({
  814. switchStoreShow: true
  815. });
  816. }
  817. // console.log(data.Index_Store_Confirm, "====", !data.Index_Store_Confirm, typeof(res
  818. // .Index_Store_Confirm))
  819. uni.setNavigationBarTitle({
  820. // title: res['CONFIG_PROJECT_TITLE'],
  821. title: data['CONFIG_PROJECT_TITLE']
  822. });
  823. // console.log(data.Is_Store_Price_Stock);
  824. if (data.Is_Store_Price_Stock) {
  825. this.Is_Store_Price_Stock = data.Is_Store_Price_Stock;
  826. }
  827. this.setData({
  828. Is_Store_Price_Stock: data.Is_Store_Price_Stock
  829. });
  830. if (data.b2c_service_guarantee && data.b2c_service_guarantee != null) {
  831. this.setData({
  832. guarantee: data.b2c_service_guarantee.split(';').filter(it => {
  833. return (it = it && it.trim());
  834. })
  835. });
  836. }
  837. req.setStorage('appName', data['CONFIG_PROJECT_TITLE']);
  838. req.setStorage('productDiy', data['Product_Foot-Diy']);
  839. res(data);
  840. },
  841. true
  842. );
  843. });
  844. },
  845. merchantFun() {
  846. app.globalData.openPage('pages/nearby/nearby');
  847. },
  848. saoma() {
  849. var _this = this; // 允许从相机和相册扫码
  850. uni.scanCode({
  851. success: res => {
  852. uni.navigateTo({
  853. url: '/' + res.path
  854. }); // this.scene = '1290926887903780865';
  855. this.loadCodeParams();
  856. }
  857. });
  858. },
  859. update(content) {
  860. var that = this;
  861. var animation = uni.createAnimation(); // 旧消息向上平移
  862. animation.translateY(-50).step({
  863. duration: 1000,
  864. timingFunction: 'ease-in'
  865. }); // 为了实现下一条新内容向上平移的效果,必须把内容很快平移到下方,并且不能被用户看见,这里其原理类似轮播图的思路。
  866. // 实现方法:动画时间设置为1ms,过渡效果设置为’动画第一帧就跳至结束状态直到结束‘
  867. animation
  868. .opacity(0)
  869. .translateY(50)
  870. .step({
  871. duration: 1000,
  872. timingFunction: 'step-start'
  873. }); // 新消息向上平移的同时恢复透明
  874. animation
  875. .opacity(1)
  876. .translateY(0)
  877. .step({
  878. duration: 1000,
  879. timingFunction: 'ease-out'
  880. });
  881. that.setData({
  882. animationData: animation.export()
  883. }); // 更新内容的延时必须大于第一步动画时间
  884. setTimeout(() => {
  885. that.setData({
  886. content: content
  887. });
  888. }, 500000);
  889. },
  890. loadCodeParams() {
  891. let _ts = this;
  892. return new Promise((resolve, reject) => {
  893. if (!_ts.scene) {
  894. resolve();
  895. return false;
  896. }
  897. req.getRequest(
  898. '/api/code/params', {
  899. scene: _ts.scene
  900. },
  901. data => {
  902. req.setStorage('pidCode', data.userId);
  903. resolve();
  904. }
  905. );
  906. });
  907. },
  908. getBannerList(module, contentId) {
  909. //banner图
  910. let that = this;
  911. return new Promise((resolve, reject) => {
  912. req.getRequest(
  913. '/api/banner', {
  914. groupId: contentId
  915. },
  916. data => {
  917. if (module == that.templateType.module_ad) {
  918. that.setData({
  919. bannerList: data,
  920. bannerShow: true
  921. });
  922. } else {
  923. that.setData({
  924. popAdList: data[0]
  925. });
  926. }
  927. resolve();
  928. }
  929. );
  930. })
  931. },
  932. clearAllTimer(type) {
  933. // console.log(this.activityGroup, this.joingroupList, this.bargainList, this.customersList);
  934. if (type == 1) {
  935. this.activityGroup.products.forEach(it => clearInterval(it.timer));
  936. this.activityGroup.products.forEach(it => clearInterval(it.times));
  937. } else if (type == 2) {
  938. this.joingroupList.products.forEach(it => clearInterval(it.timer));
  939. this.joingroupList.products.forEach(it => clearInterval(it.times));
  940. } else if (type == 3) {
  941. this.bargainList.products.forEach(it => clearInterval(it.timer));
  942. this.bargainList.products.forEach(it => clearInterval(it.times));
  943. } else if (type == 4) {
  944. this.customersList.products.forEach(it => clearInterval(it.timer));
  945. this.customersList.products.forEach(it => clearInterval(it.times));
  946. } else if (type == 5) {
  947. this.seckillList.products.forEach(it => clearInterval(it.timer));
  948. this.seckillList.products.forEach(it => clearInterval(it.times));
  949. }
  950. },
  951. hideGuide() {
  952. //关闭提示加入我的小程序
  953. this.setData({
  954. first: false
  955. });
  956. req.setStorage('first', false);
  957. },
  958. hideAd() {
  959. //关闭广告
  960. // if(this.data.first==false){
  961. this.setData({
  962. isLayerAd: false
  963. }); // }
  964. app.globalData.isLayerAd = false;
  965. },
  966. click(e) {
  967. // console.log(e)
  968. this.storeShow = e;
  969. },
  970. goUrl(event) {
  971. //跳转链接
  972. let url = event.currentTarget.dataset.url;
  973. app.globalData.openPage(url);
  974. },
  975. showCodePop(){
  976. this.isShowCodePop = true
  977. req.saveBehaviorNew(this.recommendCard.id,1,18)
  978. },
  979. // 拨打电话
  980. callPhone(val) {
  981. if (!val) return false
  982. uni.makePhoneCall({
  983. phoneNumber: val,
  984. success(res){
  985. req.saveBehaviorNew(this.recommendCard.id,1,17,this.recommendCard.phone)
  986. }
  987. });
  988. },
  989. copy(val) {
  990. this.isShowCodePop = false
  991. uni.setClipboardData({
  992. data: val,
  993. complete() {
  994. req.msg('复制成功')
  995. }
  996. })
  997. },
  998. unitFormat(data) {
  999. return req.unitConverter(data).text
  1000. },
  1001. formatTime(date) {
  1002. date = new Date(date.replace(/-/g, '/'))
  1003. return utils.formatTime(date).t3
  1004. },
  1005. monthDayDiff(date) {
  1006. return utils.monthDayDiff(date)
  1007. },
  1008. // 热门活动
  1009. async getUrlHot(item) {
  1010. console.log(item)
  1011. var dt = item
  1012. dt.content = item.bannerContent
  1013. dt.page = item.pageUrl
  1014. var url = "";
  1015. var id = "";
  1016. var acid = "";
  1017. if (dt.content != "") {
  1018. let conunt = dt.content.split("_");
  1019. id = conunt[1];
  1020. acid = conunt[0];
  1021. }
  1022. if (dt.type * 1 == 2 && dt.content != "") {
  1023. url = "product/detail/detail?id=" + dt.content;
  1024. } else if (dt.type * 1 == 3) {
  1025. url = dt.content;
  1026. console.log('url===',url)
  1027. if(!url){
  1028. req.msg('功能待接入')
  1029. return false
  1030. }
  1031. if(url=='pages/index/index'||url=='pages/matchList/index'||url=='pages/interactive/index'||url=='pages/found/found'||url=='pages/user/user'){
  1032. app.globalData.switchTab(url)
  1033. return false
  1034. }else{
  1035. if(url.indexOf('http')!=-1){
  1036. if(url.indexOf('${salesno}')!=-1){
  1037. // 如果打开的分享的销售员微页
  1038. if(req.getStorage('shareId')){
  1039. url = url.replace(/\${salesno}/g,'salesno='+req.getStorage('shareId'))
  1040. }else{
  1041. // 如果自己是销售员
  1042. if(req.getStorage('userInfo').saleNo){
  1043. url = url.replace(/\${salesno}/g,'salesno='+req.getStorage('userInfo').saleNo)
  1044. }else{
  1045. //当前绑定的微页或推荐的微页
  1046. let salesno = await new Promise((r,j)=>{
  1047. req.getLocation(res => {
  1048. const to = {
  1049. latitude: res.latitude,
  1050. longitude: res.longitude
  1051. };
  1052. req.getRequest('/api/visiting/card/recommendCardInfo', to, res => {
  1053. r(res.jobNumber?res.jobNumber:'')
  1054. })
  1055. });
  1056. })
  1057. url = url.replace(/\${salesno}/g,'salesno='+salesno)
  1058. }
  1059. }
  1060. }
  1061. app.globalData.openPage('pages/web/web?url='+encodeURIComponent(url));
  1062. return false
  1063. }
  1064. }
  1065. } else if (dt.type * 1 == 4) {
  1066. url = "product/groupDetail/groupDetail?acid=" + acid + "&id=" + id;
  1067. } else if (dt.type * 1 == 5) {
  1068. url = "product/coupon/coupon";
  1069. } else if (dt.type * 1 == 6) {
  1070. url = "pages/live/live";
  1071. } else if (dt.type * 1 == 7) {
  1072. url = "product/groupList/groupList" + dt.merchant;
  1073. } else if (dt.type * 1 == 9 && dt.content != "") {
  1074. url = "product/list/list?id=" + dt.content + '&title=' + dt.title + this.web;
  1075. } else if (dt.type * 1 == 10) {
  1076. url = "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=" + dt.content;
  1077. // console.log(
  1078. // url); // url=`plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${dt.content}`
  1079. } else if (dt.type * 1 == 11) {
  1080. url = "activity/group/index/index" + dt.merchant;
  1081. } else if (dt.type * 1 == 12) {
  1082. url = "activity/seckill/seckill" + dt.merchant;
  1083. } else if (dt.type * 1 == 13) {
  1084. url = "activity/bargain/index/index" + dt.merchant;
  1085. } else if (dt.type * 1 == 14) {
  1086. url = "activity/newbornZone/newbornZone" + dt.merchant;
  1087. } else if (dt.type * 1 == 15 && dt.content != "") {
  1088. url = "activity/newbornDetails/newbornDetails?acid=" + acid + "&id=" + id;
  1089. } else if (dt.type * 1 == 16 && dt.content != "") {
  1090. url = "activity/seckillDetails/seckillDetails?acid=" + acid + "&id=" + id;
  1091. } else if (dt.type * 1 == 17 && dt.content != "") {
  1092. url = "activity/bargain/detail/detail?acid=" + acid + "&id=" + id;
  1093. } else if (dt.type * 1 == 18 && dt.content != "") {
  1094. url = "activity/group/detail/detail?acid=" + acid + "&id=" + id;
  1095. }else if (dt.type * 1 == 19 && dt.content != "") {
  1096. url = "topic/content/content?id=" + dt.content;
  1097. }else if (dt.type * 1 == 27 && dt.content != "") {
  1098. url = "match/activityDetail/activityDetail?id=" + dt.content;
  1099. }else if (dt.type * 1 == 1 && dt.content != "") {
  1100. console.log('dt.content',dt.content)
  1101. uni.navigateToMiniProgram({
  1102. appId: dt.content, // 目标小程序appid
  1103. path: dt.page?dt.page:'', // 目标路径,例如‘pages/billManage/index’
  1104. extraData: {}, // 跳转传参,例如'orderNo': 'xxx......'
  1105. success(res) {
  1106. uni.showToast({
  1107. title: '跳转成功'
  1108. })
  1109. }
  1110. })
  1111. } else {
  1112. url = "";
  1113. }
  1114. if (dt.type * 1 == 6) app.globalData.switchTab(url);
  1115. else app.globalData.openPage(url);
  1116. this.hideAd();
  1117. },
  1118. closeUpdate(){
  1119. this.isShowUpdate = false
  1120. this.showBindNoteFn()
  1121. },
  1122. updateInfo(e){
  1123. this.isUpdateInfo = e;
  1124. },
  1125. updateMobile(e){
  1126. this.isUpdateMobile = e;
  1127. },
  1128. getUpdate() {
  1129. console.log('getUpdate')
  1130. let userInfos = req.getStorage('userInfo')
  1131. // if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
  1132. // console.log('没有昵称')
  1133. // this.isShowUpdate = true;
  1134. // this.isUpdateInfo = true;
  1135. // return false;
  1136. // }
  1137. if(!userInfos.mobile){
  1138. console.log('没有手机号')
  1139. this.isShowUpdate = true
  1140. this.isUpdateMobile = true
  1141. return false;
  1142. }
  1143. this.showBindNoteFn()
  1144. return true;
  1145. },
  1146. showBindNoteFn(){
  1147. if(this.showBindNote){
  1148. if(req.getStorage('userInfo')&&req.getStorage('userInfo').userType!=1&&!req.getStorage('userInfo').manageSaleNo){
  1149. this.showBindNote = false
  1150. uni.showModal({
  1151. title:'提示',
  1152. content:'检测到您还未绑定专属顾问,为了给您提供更好的服务,您可通过右侧绑定按钮快速绑定当前专属顾问',
  1153. showCancel:false,
  1154. confirmText:'知道了'
  1155. })
  1156. }
  1157. }
  1158. },
  1159. bindSale(){
  1160. let userInfo = req.getStorage('userInfo');
  1161. console.log('updateInfo userInfo.avatar',userInfo.avatar)
  1162. if (!userInfo.avatar || !userInfo.nickName || userInfo.avatar.indexOf('thirdwx.qlogo') > -1 || userInfo.nickName.indexOf('用户') > -1) {
  1163. this.isShowUpdate = true
  1164. this.isUpdateInfo = true
  1165. this.isUpdateMobile = false
  1166. return false
  1167. }
  1168. if(userInfo.avatar&&!userInfo.mobile){
  1169. this.isShowUpdate = true
  1170. this.isUpdateMobile = true
  1171. this.isUpdateInfo = false
  1172. return false
  1173. }
  1174. uni.showModal({
  1175. title:'提示',
  1176. content:`是否绑定${this.recommendCard.realName}为您的专属顾问?`,
  1177. success: (con) => {
  1178. if(con.confirm){
  1179. req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.recommendCard.jobNumber},res=>{
  1180. req.msg('已绑定专属顾问')
  1181. let userInfo = req.getStorage('userInfo')
  1182. userInfo.manageSaleNo = this.recommendCard.jobNumber
  1183. req.setStorage('userInfo',userInfo)
  1184. this.userInfo = req.getStorage('userInfo')
  1185. })
  1186. }
  1187. }
  1188. })
  1189. },
  1190. },
  1191. mounted() {
  1192. const systemInfo = uni.getSystemInfoSync();
  1193. // px转换到rpx的比例
  1194. let pxToRpxScale = 750 / systemInfo.windowWidth;
  1195. let systems = {
  1196. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  1197. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  1198. };
  1199. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  1200. this.systems = systems;
  1201. }
  1202. };
  1203. </script>
  1204. <style>
  1205. @import './index.css';
  1206. </style>