index.vue 39 KB

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