index.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  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. },
  721. getReadFindCode(){
  722. let s = req.getStorage('readFindCode')
  723. if(s && s.date == utils.formatTime(new Date()).t2){
  724. return req.getStorage('readFindCode').readCode
  725. }else{
  726. return {}
  727. }
  728. },
  729. async getRqeDatas() {
  730. console.log('getRqeDatas');
  731. let that = this; //多门店
  732. // 金刚区
  733. let district = that.homeTemplate.filter(it => it.module == that.templateType
  734. .module_king_kong_district);
  735. if (district && district.length > 0 && district[0].state == 0) {
  736. let data = district[0];
  737. data.content = JSON.parse(district[0].content);
  738. that.districtTemplate = data;
  739. if (data.contentId == 2) {
  740. that.districtShow = true;
  741. }
  742. console.log(that.districtTemplate, '=============');
  743. }
  744. //顶部banner
  745. let ad = that.homeTemplate.filter(it => it.module == that.templateType.module_ad);
  746. if (ad && ad.length > 0 && ad[0].state == 0) {
  747. if (that.freshen) {
  748. await that.getBannerList(ad[0].module, ad[0].contentId);
  749. }
  750. }
  751. that.logo = true;
  752. },
  753. //获取首页模板配置
  754. getHomeTemplateConfig() {
  755. let _ts = this;
  756. let page = 'index';
  757. //荣康模板配置、小店产品==门店产品
  758. // if (this.merchant && this.merchant.type == 5 || this.shopId && this.merchantId) page = 'shopIndex'
  759. req.getRequest(
  760. '/api/template/getTemplate', {
  761. page: page
  762. },
  763. data => {
  764. let arr = [];
  765. data.forEach(it => {
  766. arr.push(it.module);
  767. });
  768. this.setData({
  769. contact: [...new Set(arr)],
  770. contactShow: false
  771. });
  772. if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('store_options') != -1) {
  773. this.top = false;
  774. } else {
  775. this.top = true;
  776. }
  777. if (this.contact.indexOf('sou') != -1 && this.contact.indexOf('type_district') != -1) {
  778. this.top_type = false;
  779. } else {
  780. this.top_type = true;
  781. }
  782. console.log(this.contact.indexOf('sou') != -1, this.contact.indexOf('store_options') != -1,
  783. this.contact.indexOf('type_district') != -1, this.top);
  784. console.log(this.contact);
  785. this.setData({
  786. homeTemplate: data
  787. });
  788. this.getRqeDatas();
  789. }
  790. );
  791. },
  792. getConfig() {
  793. var _this = this;
  794. return new Promise((res, rej) => {
  795. req.g(
  796. '/api/other/config',
  797. data => {
  798. req.setStorage('configRes', JSON.stringify(data));
  799. this.about = data;
  800. if (!data.Index_Store_Confirm || data.Index_Store_Confirm == 0) {
  801. _this.setData({
  802. switchStoreShow: false,
  803. storeShow: false
  804. });
  805. } else {
  806. _this.setData({
  807. switchStoreShow: true
  808. });
  809. }
  810. // console.log(data.Index_Store_Confirm, "====", !data.Index_Store_Confirm, typeof(res
  811. // .Index_Store_Confirm))
  812. uni.setNavigationBarTitle({
  813. // title: res['CONFIG_PROJECT_TITLE'],
  814. title: data['CONFIG_PROJECT_TITLE']
  815. });
  816. // console.log(data.Is_Store_Price_Stock);
  817. if (data.Is_Store_Price_Stock) {
  818. this.Is_Store_Price_Stock = data.Is_Store_Price_Stock;
  819. }
  820. this.setData({
  821. Is_Store_Price_Stock: data.Is_Store_Price_Stock
  822. });
  823. if (data.b2c_service_guarantee && data.b2c_service_guarantee != null) {
  824. this.setData({
  825. guarantee: data.b2c_service_guarantee.split(';').filter(it => {
  826. return (it = it && it.trim());
  827. })
  828. });
  829. }
  830. req.setStorage('appName', data['CONFIG_PROJECT_TITLE']);
  831. req.setStorage('productDiy', data['Product_Foot-Diy']);
  832. res(data);
  833. },
  834. true
  835. );
  836. });
  837. },
  838. merchantFun() {
  839. app.globalData.openPage('pages/nearby/nearby');
  840. },
  841. saoma() {
  842. var _this = this; // 允许从相机和相册扫码
  843. uni.scanCode({
  844. success: res => {
  845. uni.navigateTo({
  846. url: '/' + res.path
  847. }); // this.scene = '1290926887903780865';
  848. this.loadCodeParams();
  849. }
  850. });
  851. },
  852. update(content) {
  853. var that = this;
  854. var animation = uni.createAnimation(); // 旧消息向上平移
  855. animation.translateY(-50).step({
  856. duration: 1000,
  857. timingFunction: 'ease-in'
  858. }); // 为了实现下一条新内容向上平移的效果,必须把内容很快平移到下方,并且不能被用户看见,这里其原理类似轮播图的思路。
  859. // 实现方法:动画时间设置为1ms,过渡效果设置为’动画第一帧就跳至结束状态直到结束‘
  860. animation
  861. .opacity(0)
  862. .translateY(50)
  863. .step({
  864. duration: 1000,
  865. timingFunction: 'step-start'
  866. }); // 新消息向上平移的同时恢复透明
  867. animation
  868. .opacity(1)
  869. .translateY(0)
  870. .step({
  871. duration: 1000,
  872. timingFunction: 'ease-out'
  873. });
  874. that.setData({
  875. animationData: animation.export()
  876. }); // 更新内容的延时必须大于第一步动画时间
  877. setTimeout(() => {
  878. that.setData({
  879. content: content
  880. });
  881. }, 500000);
  882. },
  883. loadCodeParams() {
  884. let _ts = this;
  885. return new Promise((resolve, reject) => {
  886. if (!_ts.scene) {
  887. resolve();
  888. return false;
  889. }
  890. req.getRequest(
  891. '/api/code/params', {
  892. scene: _ts.scene
  893. },
  894. data => {
  895. req.setStorage('pidCode', data.userId);
  896. resolve();
  897. }
  898. );
  899. });
  900. },
  901. getBannerList(module, contentId) {
  902. //banner图
  903. let that = this;
  904. return new Promise((resolve, reject) => {
  905. req.getRequest(
  906. '/api/banner', {
  907. groupId: contentId
  908. },
  909. data => {
  910. if (module == that.templateType.module_ad) {
  911. that.setData({
  912. bannerList: data,
  913. bannerShow: true
  914. });
  915. } else {
  916. that.setData({
  917. popAdList: data[0]
  918. });
  919. }
  920. resolve();
  921. }
  922. );
  923. })
  924. },
  925. clearAllTimer(type) {
  926. // console.log(this.activityGroup, this.joingroupList, this.bargainList, this.customersList);
  927. if (type == 1) {
  928. this.activityGroup.products.forEach(it => clearInterval(it.timer));
  929. this.activityGroup.products.forEach(it => clearInterval(it.times));
  930. } else if (type == 2) {
  931. this.joingroupList.products.forEach(it => clearInterval(it.timer));
  932. this.joingroupList.products.forEach(it => clearInterval(it.times));
  933. } else if (type == 3) {
  934. this.bargainList.products.forEach(it => clearInterval(it.timer));
  935. this.bargainList.products.forEach(it => clearInterval(it.times));
  936. } else if (type == 4) {
  937. this.customersList.products.forEach(it => clearInterval(it.timer));
  938. this.customersList.products.forEach(it => clearInterval(it.times));
  939. } else if (type == 5) {
  940. this.seckillList.products.forEach(it => clearInterval(it.timer));
  941. this.seckillList.products.forEach(it => clearInterval(it.times));
  942. }
  943. },
  944. hideGuide() {
  945. //关闭提示加入我的小程序
  946. this.setData({
  947. first: false
  948. });
  949. req.setStorage('first', false);
  950. },
  951. hideAd() {
  952. //关闭广告
  953. // if(this.data.first==false){
  954. this.setData({
  955. isLayerAd: false
  956. }); // }
  957. app.globalData.isLayerAd = false;
  958. },
  959. click(e) {
  960. // console.log(e)
  961. this.storeShow = e;
  962. },
  963. goUrl(event) {
  964. //跳转链接
  965. let url = event.currentTarget.dataset.url;
  966. app.globalData.openPage(url);
  967. },
  968. showCodePop(){
  969. this.isShowCodePop = true
  970. req.saveBehaviorNew(this.recommendCard.id,1,18)
  971. },
  972. // 拨打电话
  973. callPhone(val) {
  974. if (!val) return false
  975. uni.makePhoneCall({
  976. phoneNumber: val,
  977. success(res){
  978. req.saveBehaviorNew(this.recommendCard.id,1,17,this.recommendCard.phone)
  979. }
  980. });
  981. },
  982. copy(val) {
  983. this.isShowCodePop = false
  984. uni.setClipboardData({
  985. data: val,
  986. complete() {
  987. req.msg('复制成功')
  988. }
  989. })
  990. },
  991. unitFormat(data) {
  992. return req.unitConverter(data).text
  993. },
  994. formatTime(date) {
  995. date = new Date(date.replace(/-/g, '/'))
  996. return utils.formatTime(date).t3
  997. },
  998. monthDayDiff(date) {
  999. return utils.monthDayDiff(date)
  1000. },
  1001. // 热门活动
  1002. async getUrlHot(item) {
  1003. console.log(item)
  1004. var dt = item
  1005. var url = "";
  1006. var id = "";
  1007. var acid = "";
  1008. if (dt.content != "") {
  1009. let conunt = dt.content.split("_");
  1010. id = conunt[1];
  1011. acid = conunt[0];
  1012. }
  1013. if (dt.type * 1 == 2 && dt.content != "") {
  1014. url = "product/detail/detail?id=" + dt.content;
  1015. } else if (dt.type * 1 == 3) {
  1016. url = dt.content;
  1017. console.log('url===',url)
  1018. if(!url){
  1019. req.msg('功能待接入')
  1020. return false
  1021. }
  1022. if(url=='pages/index/index'||url=='pages/matchList/index'||url=='pages/interactive/index'||url=='pages/found/found'||url=='pages/user/user'){
  1023. app.globalData.switchTab(url)
  1024. return false
  1025. }else{
  1026. if(url.indexOf('http')!=-1){
  1027. if(url.indexOf('${salesno}')!=-1){
  1028. // 如果打开的分享的销售员微页
  1029. if(req.getStorage('shareId')){
  1030. url = url.replace(/\${salesno}/g,'salesno='+req.getStorage('shareId'))
  1031. }else{
  1032. // 如果自己是销售员
  1033. if(req.getStorage('userInfo').saleNo){
  1034. url = url.replace(/\${salesno}/g,'salesno='+req.getStorage('userInfo').saleNo)
  1035. }else{
  1036. //当前绑定的微页或推荐的微页
  1037. let salesno = await new Promise((r,j)=>{
  1038. req.getLocation(res => {
  1039. const to = {
  1040. latitude: res.latitude,
  1041. longitude: res.longitude
  1042. };
  1043. req.getRequest('/api/visiting/card/recommendCardInfo', to, res => {
  1044. r(res.jobNumber?res.jobNumber:'')
  1045. })
  1046. });
  1047. })
  1048. url = url.replace(/\${salesno}/g,'salesno='+salesno)
  1049. }
  1050. }
  1051. }
  1052. app.globalData.openPage('pages/web/web?url='+encodeURIComponent(url));
  1053. return false
  1054. }
  1055. }
  1056. } else if (dt.type * 1 == 4) {
  1057. url = "product/groupDetail/groupDetail?acid=" + acid + "&id=" + id;
  1058. } else if (dt.type * 1 == 5) {
  1059. url = "product/coupon/coupon";
  1060. } else if (dt.type * 1 == 6) {
  1061. url = "pages/live/live";
  1062. } else if (dt.type * 1 == 7) {
  1063. url = "product/groupList/groupList" + dt.merchant;
  1064. } else if (dt.type * 1 == 9 && dt.content != "") {
  1065. url = "product/list/list?id=" + dt.content + '&title=' + dt.title + this.web;
  1066. } else if (dt.type * 1 == 10) {
  1067. url = "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=" + dt.content;
  1068. // console.log(
  1069. // url); // url=`plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${dt.content}`
  1070. } else if (dt.type * 1 == 11) {
  1071. url = "activity/group/index/index" + dt.merchant;
  1072. } else if (dt.type * 1 == 12) {
  1073. url = "activity/seckill/seckill" + dt.merchant;
  1074. } else if (dt.type * 1 == 13) {
  1075. url = "activity/bargain/index/index" + dt.merchant;
  1076. } else if (dt.type * 1 == 14) {
  1077. url = "activity/newbornZone/newbornZone" + dt.merchant;
  1078. } else if (dt.type * 1 == 15 && dt.content != "") {
  1079. url = "activity/newbornDetails/newbornDetails?acid=" + acid + "&id=" + id;
  1080. } else if (dt.type * 1 == 16 && dt.content != "") {
  1081. url = "activity/seckillDetails/seckillDetails?acid=" + acid + "&id=" + id;
  1082. } else if (dt.type * 1 == 17 && dt.content != "") {
  1083. url = "activity/bargain/detail/detail?acid=" + acid + "&id=" + id;
  1084. } else if (dt.type * 1 == 18 && dt.content != "") {
  1085. url = "activity/group/detail/detail?acid=" + acid + "&id=" + id;
  1086. }else if (dt.type * 1 == 19 && dt.content != "") {
  1087. url = "topic/content/content?id=" + dt.content;
  1088. }else if (dt.type * 1 == 27 && dt.content != "") {
  1089. url = "match/activityDetail/activityDetail?id=" + dt.content;
  1090. }else if (dt.type * 1 == 1 && dt.content != "") {
  1091. console.log('dt.content',dt.content)
  1092. uni.navigateToMiniProgram({
  1093. appId: dt.content, // 目标小程序appid
  1094. path: '', // 目标路径,例如‘pages/billManage/index’
  1095. extraData: {}, // 跳转传参,例如'orderNo': 'xxx......'
  1096. success(res) {
  1097. uni.showToast({
  1098. title: '跳转成功'
  1099. })
  1100. }
  1101. })
  1102. } else {
  1103. url = "";
  1104. }
  1105. if (dt.type * 1 == 6) app.globalData.switchTab(url);
  1106. else app.globalData.openPage(url);
  1107. this.hideAd();
  1108. },
  1109. closeUpdate(){
  1110. this.isShowUpdate = false
  1111. },
  1112. updateInfo(e){
  1113. this.isUpdateInfo = e;
  1114. },
  1115. updateMobile(e){
  1116. this.isUpdateMobile = e;
  1117. },
  1118. getUpdate() {
  1119. console.log('getUpdate')
  1120. let userInfos = req.getStorage('userInfo')
  1121. // if ((!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || !userInfos.nickName || userInfos.nickName.indexOf('用户') > -1) ) {
  1122. // console.log('没有昵称')
  1123. // this.isShowUpdate = true;
  1124. // this.isUpdateInfo = true;
  1125. // return false;
  1126. // }
  1127. if(!userInfos.mobile){
  1128. console.log('没有手机号')
  1129. this.isShowUpdate = true
  1130. this.isUpdateMobile = true
  1131. return false;
  1132. }
  1133. return true;
  1134. },
  1135. },
  1136. mounted() {
  1137. const systemInfo = uni.getSystemInfoSync();
  1138. // px转换到rpx的比例
  1139. let pxToRpxScale = 750 / systemInfo.windowWidth;
  1140. let systems = {
  1141. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  1142. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  1143. };
  1144. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  1145. this.systems = systems;
  1146. }
  1147. };
  1148. </script>
  1149. <style>
  1150. @import './index.css';
  1151. </style>