home.vue 18 KB

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