home.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <u-navbar bgColor="transparent">
  4. <view class="u-nav-slot" slot="left" style="display: flex;background-color: transparent;">
  5. <image :src="imgBase+'home_logo.png'" style="width: 375rpx;height: 54rpx;margin-left: 12rpx;"></image>
  6. </view>
  7. </u-navbar>
  8. <image class="topbg" :src="imgBase+'home_top_bg.png'" mode="widthFix"></image>
  9. <view class="lunbo">
  10. <u-swiper
  11. :list="bannarList"
  12. @change="e => current = e.current"
  13. @click="bannerClick"
  14. :autoplay="true"
  15. :interval="2000"
  16. :duration="200"
  17. :circular="true"
  18. imgMode="scaleToFill"
  19. height="368rpx"
  20. >
  21. <template #indicator>
  22. <view class="indicator adf">
  23. <view class="indicator__dot" v-for="(item, index) in bannarList" :key="index"
  24. :class="[index === current && 'indicator__dot--active']">
  25. </view>
  26. </view>
  27. </template>
  28. </u-swiper>
  29. </view>
  30. <view class="preill adfacjb">
  31. <view class="preill-box" @click="toTurn('/pagesHome/questionnaire?type=receive')">
  32. <view class="preill-box-title">我的PREILL评估:<span>{{perillPJ.sum||0}}</span></view>
  33. <view class="preill-box-state adfacjb">
  34. <view class="preill-box-state-pre adfac grey">我收到:<span>{{perillPJ.completed||0}}</span></view>
  35. <view class="preill-box-state-pre adfac yellow">我创建:<span>{{perillPJ.uncompleted||0}}</span></view>
  36. </view>
  37. <view class="preill-box-progress">
  38. <view class="preill-box-progress-current pbp-yellow" :style="{'width':((perillPJ.completed||0)/(perillPJ.sum||9999)*100)+'%'}"></view>
  39. </view>
  40. </view>
  41. <view class="preill-box" @click="toTurn('/pagesHome/report')">
  42. <view class="preill-box-title">我的PREILL报告:<span>{{perillBG.sum||0}}</span></view>
  43. <view class="preill-box-state adfacjb">
  44. <view class="preill-box-state-pre adfac green">我收到:<span>{{perillBG.received||0}}</span></view>
  45. <view class="preill-box-state-pre adfac grey">我发送:<span>{{perillBG.sent||0}}</span></view>
  46. </view>
  47. <view class="preill-box-progress">
  48. <view class="preill-box-progress-current pbp-green" :style="{'width':((perillBG.received||0)/(perillBG.sum||9999)*100)+'%'}"></view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="boxs adfacjb">
  53. <view class="boxs-pre bp1" @click="toTurn('/pages/dialog')">
  54. <view class="boxs-pre-title">AI教练对话</view>
  55. <view class="boxs-pre-tip adfac">点击开始<image :src="imgBase+'home_arrow_right.png'"></image></view>
  56. </view>
  57. <view class="boxs-pre bp2" @click="toTurn('/pagesHome/weixin')">
  58. <view class="boxs-pre-title">专业支持</view>
  59. <view class="boxs-pre-tip adfac">添加客服微信预约<image :src="imgBase+'home_arrow_right.png'"></image></view>
  60. </view>
  61. </view>
  62. <view class="common">
  63. <view class="common-title">常用功能</view>
  64. <view class="common-menu adf">
  65. <view class="common-menu-pre adffcac" @click="toTurn('/pages/perillPgjs')">
  66. <image :src="imgBase+'home_img_pinggu.png'"></image>
  67. <text>PERILL团队发展动态评估介绍</text>
  68. </view>
  69. <view class="common-menu-pre adffcac" @click="toTurn('/pages/perillPgsm')">
  70. <image :src="imgBase+'home_img_baogao.png'"></image>
  71. <text>PERILL团队发展动态评估说明</text>
  72. </view>
  73. <view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/questionnaire?type=create')">
  74. <image :src="imgBase+'home_img_guanli.png'"></image>
  75. <text>问卷管理</text>
  76. </view>
  77. <view class="common-menu-pre adffcac" @click="toTurn('/pages/support')">
  78. <image :src="imgBase+'home_img_qywx.png'" style="width: 74rpx;"></image>
  79. <text>常见问题与支持</text>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="new-user-free adffcacjc" v-if="newUserFreeShow">
  84. <view class="new-user-free-box1">
  85. <view class="new-user-free-box1-text">PERILL评估</view>
  86. <view class="new-user-free-box1-text" style="margin-top: 8rpx;">个人版免费体验1次</view>
  87. </view>
  88. <view class="new-user-free-box2 adffcac">
  89. <view class="new-user-free-box2-price adfacjb">
  90. <view class="new-user-free-box2-price-left adffc">
  91. <view class="new-user-free-box2-price-left-title">仅限个人创建使用</view>
  92. <view class="new-user-free-box2-price-left-tip">领取后1年内有效</view>
  93. </view>
  94. <view class="new-user-free-box2-price-right adffcac">
  95. <view class="new-user-free-box2-price-right-top">1次</view>
  96. <view class="new-user-free-box2-price-right-bottom">原价699/次</view>
  97. </view>
  98. </view>
  99. <view class="new-user-free-box2-btn" @click="handleFree">免费体验</view>
  100. </view>
  101. <image class="new-user-free-close" :src="imgBase+'new_free_close.png'" @click="newUserFreeShow=false"></image>
  102. </view>
  103. <view class="kind-reminder adffcacjc" v-if="teamKindShow">
  104. <view class="kr-box adffcac">
  105. <image :src="imgBase+'remind_close.png'" @click="teamKindShow=false"></image>
  106. <view class="kr-title">温馨提示</view>
  107. <view class="kr-p" style="margin-top: 32rpx;">{{teamKindMsg}}</view>
  108. <view class="kr-btn" @click="teamKindShow=false">我知道了</view>
  109. </view>
  110. </view>
  111. <view class="kind-reminder adffcacjc" v-if="questionnaireKindShow">
  112. <view class="kr-box adffcac">
  113. <image :src="imgBase+'remind_close.png'" @click="questionnaireKindShow=false"></image>
  114. <view class="kr-title">温馨提示</view>
  115. <view class="kr-p" style="margin-top: 32rpx;">你有一份<span>“PERILL团队发展动态评估(团队版)”</span>问卷待完成,请及时作答,</view>
  116. <view class="kr-p">以便我们为您提供精准分析。</view>
  117. <view class="kr-btn" @click="handleToFill">去填写</view>
  118. </view>
  119. </view>
  120. <Tabbar :tabbarIndex="0"></Tabbar>
  121. </view>
  122. </template>
  123. <script>
  124. import Tabbar from '@/components/CusTabbar/index.vue'
  125. export default {
  126. components:{ Tabbar },
  127. data(){
  128. return {
  129. current:0,
  130. perillPJ:null,
  131. perillBG:null,
  132. defaultBanner:this.$imgBase+'home_lb.png',
  133. bannerOrigin:[],
  134. bannarList:[],
  135. newUserFreeShow:false,
  136. teamKindShow:false,
  137. teamKindMsg:'',
  138. questionnaireKindShow:false,
  139. }
  140. },
  141. onLoad(options) {
  142. this.getBannerList();
  143. if(options.q){
  144. try{
  145. const decodedUrl = decodeURIComponent(options.q);
  146. const codeMatch = decodedUrl.match(/type=([^&]+)/);
  147. const codeMatchId = decodedUrl.match(/shareUserId=([^&]+)/);
  148. const stationCode = codeMatch ? codeMatch[1] : null;
  149. const stationCodeId = codeMatchId ? codeMatchId[1] : null;
  150. if(stationCode) uni.setStorageSync('channelType',stationCode)
  151. if(stationCodeId){
  152. uni.setStorageSync('shareUserId',stationCodeId)
  153. uni.setStorageSync('channelType','Forward')
  154. }
  155. }catch(e){
  156. console.log(e,'e');
  157. }
  158. }
  159. if(options.shareType) uni.setStorageSync('channelType',options.shareType)
  160. if(options.shareUserId) uni.setStorageSync('shareUserId',options.shareUserId)
  161. if(options.shareTQId) uni.setStorageSync('shareTQId',options.shareTQId)
  162. if(options.shareTQId||uni.getStorageSync('shareTQId')){
  163. // if(uni.getStorageSync('userInfo')&&uni.getStorageSync('shareUserId')==JSON.parse(uni.getStorageSync('userInfo')).id) return
  164. // 邀请进来的并且已经登录的
  165. if(uni.getStorageSync('userInfo')){
  166. this.$api.get('/wx/queShareCheck',{
  167. channelType:uni.getStorageSync('channelType')||'',
  168. phone:JSON.parse(uni.getStorageSync('userInfo')).mobile||'',
  169. referrerId:uni.getStorageSync('shareUserId')||'',
  170. teamQuestionnaireId:uni.getStorageSync('shareTQId')||'',
  171. }).then(({data:res})=>{
  172. if(res.code!==0){
  173. this.teamKindMsg = res.msg||'';
  174. this.teamKindShow = true;
  175. }else if(res.code===0&&res.data==1) this.questionnaireKindShow = true;
  176. })
  177. }
  178. }
  179. if(uni.getStorageSync('token')){
  180. this.getPerillPJ();
  181. this.getPerillBG();
  182. }
  183. if(uni.getStorageSync('newUser')) this.newUserFreeShow = true;
  184. },
  185. methods:{
  186. getBannerList(){
  187. //space 广告位置: 1首页 2发布问卷
  188. //type 类型: 1 banner区 2弹框
  189. this.$api.get('/core/advertisement/manage/page',{
  190. space:1,
  191. type:1
  192. }).then(({data:res})=>{
  193. if(res.code!==0) return this.$showToast(res.msg)
  194. if(res.data&&res.data.length){
  195. const list = res.data.filter(l=>l.enable==1);
  196. this.bannerOrigin = list;
  197. this.bannarList = list.map(d=>d.fileUrl);
  198. } else this.bannarList = [this.defaultBanner]
  199. })
  200. },
  201. bannerClick(e){
  202. let banner = this.bannerOrigin[e];
  203. if(banner&&banner?.redirect){
  204. if(banner?.redirectType==1){//微信公众号
  205. uni.navigateTo({
  206. url:'/pages/webView?src='+banner?.redirect
  207. })
  208. }else if(banner?.redirectType==2){//微信小程序
  209. uni.navigateToMiniProgram({
  210. appId:banner?.redirect
  211. })
  212. }
  213. }
  214. },
  215. toTurn(url){
  216. if(!url) return
  217. const notloginurls = ['/pages/dialog','/pages/support','/pagesHome/weixin','perillPgjs','perillPgsm'];
  218. if(!notloginurls.includes(url)&&!this.isLogin()) return
  219. uni.navigateTo({
  220. url
  221. })
  222. },
  223. getPerillPJ(){
  224. this.$api.get('/core/teammember/que/questionnaireStats').then(res=>{
  225. if(res.data.code!==0) return
  226. this.perillPJ = res.data.data||{};
  227. this.perillPJ.sum = (this.perillPJ?.completed||0)+(this.perillPJ?.uncompleted||0);
  228. })
  229. },
  230. getPerillBG(){
  231. this.$api.get('/core/report/reportStats').then(res=>{
  232. if(res.data.code!==0) return
  233. this.perillBG = res.data.data||{};
  234. this.perillBG.sum = (this.perillBG?.received||0)+(this.perillBG?.sent||0);
  235. })
  236. },
  237. getWjList(){
  238. this.$api.get('/core/teammember/que/listByUser').then(res=>{
  239. if(res.data.code!==0) return
  240. this.wjDwc = res.data.data.filter(d=>d.status===0).length;
  241. this.wjYwc = res.data.data.filter(d=>d.status===1).length;
  242. })
  243. },
  244. getReportList(){
  245. this.$api.get('/core/report/member/personalReportList').then(res=>{
  246. if(res.data.code!==0) return
  247. this.reportCount = res.data.data.length;
  248. })
  249. },
  250. handleToFill(){
  251. this.questionnaireKindShow = false;
  252. uni.navigateTo({
  253. url:'/pagesHome/questionnaire?type=receive'
  254. })
  255. },
  256. handleFree(){
  257. uni.reLaunch({
  258. url:'/pages/publish'
  259. })
  260. }
  261. }
  262. }
  263. </script>
  264. <style scoped lang="scss">
  265. ::v-deep .u-swiper{
  266. border-radius: 24rpx !important;
  267. }
  268. ::v-deep .indicator__dot{
  269. width: 10rpx;
  270. height: 10rpx;
  271. background: transparent;
  272. border: 2rpx solid #FFFFFF;
  273. border-radius: 50%;
  274. margin: 0 7rpx;
  275. }
  276. ::v-deep .indicator__dot--active{
  277. width: 10rpx;
  278. height: 10rpx;
  279. background: #FFFFFF;
  280. }
  281. .tabPage{
  282. background: #F7F7F7;
  283. .topbg{
  284. width: 100%;
  285. height: 720rpx;
  286. position: fixed;
  287. top: 0;
  288. left: 0;
  289. right: 0;
  290. }
  291. .lunbo{
  292. width: 100%;
  293. height: 368rpx;
  294. margin-top: 30rpx;
  295. position: relative;
  296. }
  297. .preill{
  298. margin-top: 30rpx;
  299. position: relative;
  300. &-box{
  301. width: calc(50% - 11rpx);
  302. background: #FFFFFF;
  303. border-radius: 24rpx;
  304. padding: 54rpx 24rpx 52rpx;
  305. box-sizing: border-box;
  306. &-title{
  307. font-family: PingFang-SC, PingFang-SC;
  308. font-weight: bold;
  309. font-size: 28rpx;
  310. color: #002846;
  311. line-height: 28rpx;
  312. span{
  313. font-size: 36rpx;
  314. }
  315. }
  316. &-num{
  317. font-family: PingFang-SC, PingFang-SC;
  318. font-weight: 800;
  319. font-size: 40rpx;
  320. color: #002846;
  321. line-height: 40rpx;
  322. margin-top: 24rpx;
  323. }
  324. &-state{
  325. margin-top: 46rpx;
  326. &-pre{
  327. padding-left: 16rpx;
  328. position: relative;
  329. font-family: PingFangSC, PingFang SC;
  330. font-weight: 400;
  331. font-size: 24rpx;
  332. color: #335368;
  333. line-height: 20rpx;
  334. span{
  335. color: #1D2129;
  336. }
  337. &::before{
  338. content: '';
  339. width: 10rpx;
  340. height: 10rpx;
  341. border-radius: 5rpx;
  342. position: absolute;
  343. left: 0;
  344. top: 50%;
  345. margin-top: -5rpx;
  346. }
  347. &.grey{
  348. &::before{
  349. background: #DDE0E6;
  350. }
  351. }
  352. &.yellow{
  353. &::before{
  354. background: #FFD750;
  355. }
  356. }
  357. &.green{
  358. &::before{
  359. background: #31D1D6;
  360. }
  361. }
  362. }
  363. }
  364. &-progress{
  365. margin-top: 24rpx;
  366. width: 100%;
  367. height: 10rpx;
  368. background: #DFE5EE;
  369. border-radius: 5rpx;
  370. position: relative;
  371. &-current{
  372. height: 10rpx;
  373. border-radius: 4rpx;
  374. position: absolute;
  375. left: 0;
  376. top: 0;
  377. }
  378. .pbp-yellow{
  379. background: #FFD750;
  380. }
  381. .pbp-green{
  382. background: #31D1D6;
  383. }
  384. }
  385. }
  386. }
  387. .boxs{
  388. margin-top: 20rpx;
  389. position: relative;
  390. &-pre{
  391. width: calc(50% - 11rpx);
  392. padding: 42rpx 0 0 20rpx;
  393. box-sizing: border-box;
  394. height: 184rpx;
  395. &-title{
  396. font-family: PingFang-SC, PingFang-SC;
  397. font-weight: bold;
  398. font-size: 32rpx;
  399. color: #E0EFEF;
  400. line-height: 45rpx;
  401. }
  402. &-tip{
  403. font-family: PingFangSC, PingFang SC;
  404. font-weight: 400;
  405. font-size: 24rpx;
  406. color: #E0EFEF;
  407. line-height: 33rpx;
  408. margin-top: 16rpx;
  409. image{
  410. width: 26rpx;
  411. height: 26rpx;
  412. margin-left: 12rpx;
  413. }
  414. }
  415. &.bp1{
  416. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg1.png') no-repeat;
  417. background-size: 100% 100%;
  418. }
  419. &.bp2{
  420. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg2.png') no-repeat;
  421. background-size: 100% 100%;
  422. }
  423. }
  424. }
  425. .common{
  426. margin-top: 20rpx;
  427. background: #FFFFFF;
  428. border-radius: 24rpx;
  429. padding: 40rpx 24rpx 48rpx;
  430. position: relative;
  431. &-title{
  432. font-family: PingFang-SC, PingFang-SC;
  433. font-weight: bold;
  434. font-size: 34rpx;
  435. color: #002846;
  436. line-height: 48rpx;
  437. }
  438. &-menu{
  439. width: calc(100% + 48rpx);
  440. margin-left: -24rpx;
  441. margin-top: 45rpx;
  442. &-pre{
  443. width: calc(100% / 4);
  444. image{
  445. width: 64rpx;
  446. height: 64rpx;
  447. }
  448. text{
  449. font-family: PingFangSC, PingFang SC;
  450. font-weight: 400;
  451. font-size: 22rpx;
  452. color: #193D59;
  453. line-height: 32rpx;
  454. text-align: center;
  455. margin-top: 24rpx;
  456. padding: 0 4rpx;
  457. }
  458. }
  459. }
  460. }
  461. .new-user-free{
  462. position: fixed;
  463. left: 0;
  464. right: 0;
  465. top: 0;
  466. bottom: 0;
  467. background: rgba(0, 0, 0, .6);
  468. z-index: 1000;
  469. &-box1{
  470. width: calc(100% - 180rpx);
  471. height: 280rpx;
  472. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_title.png') no-repeat;
  473. background-size: 100% 100%;
  474. padding-left: 53rpx;
  475. &-text{
  476. font-family: SourceHanSansCN, SourceHanSansCN;
  477. font-weight: bold;
  478. font-size: 36rpx;
  479. color: #874016;
  480. line-height: 54rpx;
  481. margin-top: 140rpx;
  482. }
  483. }
  484. &-box2{
  485. width: calc(100% - 140rpx);
  486. background: #FFFFFF;
  487. border-radius: 24rpx;
  488. padding: 45rpx 25rpx 42rpx;
  489. box-sizing: border-box;
  490. &-price{
  491. width: 100%;
  492. height: 132rpx;
  493. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_price.png') no-repeat;
  494. background-size: 100% 100%;
  495. padding: 27rpx 34rpx 27rpx 30rpx;
  496. box-sizing: border-box;
  497. &-left{
  498. &-title{
  499. font-family: PingFang-SC, PingFang-SC;
  500. font-weight: bold;
  501. font-size: 28rpx;
  502. color: #5E2E11;
  503. line-height: 36rpx;
  504. }
  505. &-tip{
  506. font-family: PingFangSC, PingFang SC;
  507. font-weight: 400;
  508. font-size: 24rpx;
  509. color: #808080;
  510. line-height: 32rpx;
  511. margin-top: 10rpx;
  512. }
  513. }
  514. &-right{
  515. &-top{
  516. font-family: PingFang-SC, PingFang-SC;
  517. font-weight: bold;
  518. font-size: 48rpx;
  519. color: #FF5A09;
  520. line-height: 67rpx;
  521. }
  522. &-bottom{
  523. font-family: PingFangSC, PingFang SC;
  524. font-weight: 400;
  525. font-size: 24rpx;
  526. color: #612D11;
  527. line-height: 33rpx;
  528. margin-top: 3rpx;
  529. text-decoration: line-through;
  530. }
  531. }
  532. }
  533. &-btn{
  534. width: calc(100% - 170rpx);
  535. height: 80rpx;
  536. border-radius: 40rpx;
  537. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_btn.png') no-repeat;
  538. background-size: 100% 100%;
  539. font-family: PingFang-SC, PingFang-SC;
  540. font-weight: bold;
  541. font-size: 32rpx;
  542. color: #5E2E11;
  543. line-height: 80rpx;
  544. text-align: center;
  545. letter-spacing: 2rpx;
  546. margin-top: 38rpx;
  547. }
  548. }
  549. &-close{
  550. width: 64rpx;
  551. height: 64rpx;
  552. margin-top: 48rpx;
  553. }
  554. }
  555. .kind-reminder{
  556. position: fixed;
  557. left: 0;
  558. right: 0;
  559. top: 0;
  560. bottom: 0;
  561. z-index: 1000;
  562. background: rgba(0, 0, 0, .6);
  563. .kr-box{
  564. width: calc(100% - 100rpx);
  565. padding: 54rpx 60rpx 48rpx;
  566. box-sizing: border-box;
  567. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/remind_bg.png') no-repeat;
  568. background-size: 100% 100%;
  569. position: relative;
  570. image{
  571. width: 48rpx;
  572. height: 48rpx;
  573. position: absolute;
  574. top: 40rpx;
  575. right: 30rpx;
  576. }
  577. .kr-title{
  578. font-family: PingFang-SC, PingFang-SC;
  579. font-weight: bold;
  580. font-size: 36rpx;
  581. color: #002846;
  582. line-height: 56rpx;
  583. text-align: center;
  584. }
  585. .kr-p{
  586. font-family: PingFangSC, PingFang SC;
  587. font-weight: 400;
  588. font-size: 30rpx;
  589. color: #002846;
  590. line-height: 48rpx;
  591. text-align: center;
  592. span{
  593. font-weight: bold;
  594. margin: 0 10rpx;
  595. }
  596. }
  597. .kr-btn{
  598. width: calc(100% - 80rpx);
  599. height: 88rpx;
  600. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  601. border-radius: 44rpx;
  602. font-family: PingFang-SC, PingFang-SC;
  603. font-weight: bold;
  604. font-size: 32rpx;
  605. color: #FFFFFF;
  606. line-height: 88rpx;
  607. text-align: center;
  608. letter-spacing: 2rpx;
  609. margin-top: 66rpx;
  610. }
  611. }
  612. }
  613. }
  614. </style>