home.vue 18 KB

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