home.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  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 .u-swiper{
  247. border-radius: 24rpx !important;
  248. }
  249. ::v-deep .indicator__dot{
  250. width: 12rpx;
  251. height: 12rpx;
  252. background: transparent;
  253. border: 2rpx solid #FFFFFF;
  254. border-radius: 6rpx;
  255. margin: 0 8rpx;
  256. }
  257. ::v-deep .indicator__dot--active{
  258. width: 12rpx;
  259. height: 12rpx;
  260. background: #FFFFFF;
  261. }
  262. .tabPage{
  263. background: #F7F7F7;
  264. .topbg{
  265. width: 100%;
  266. height: 720rpx;
  267. position: fixed;
  268. top: 0;
  269. left: 0;
  270. right: 0;
  271. }
  272. .lunbo{
  273. width: 100%;
  274. height: 368rpx;
  275. margin-top: 30rpx;
  276. position: relative;
  277. }
  278. .preill{
  279. margin-top: 30rpx;
  280. position: relative;
  281. &-box{
  282. width: calc(50% - 11rpx);
  283. background: #FFFFFF;
  284. border-radius: 24rpx;
  285. padding: 54rpx 24rpx 52rpx;
  286. box-sizing: border-box;
  287. &-title{
  288. font-family: PingFang-SC, PingFang-SC;
  289. font-weight: bold;
  290. font-size: 28rpx;
  291. color: #002846;
  292. line-height: 28rpx;
  293. span{
  294. font-size: 36rpx;
  295. }
  296. }
  297. &-num{
  298. font-family: PingFang-SC, PingFang-SC;
  299. font-weight: 800;
  300. font-size: 40rpx;
  301. color: #002846;
  302. line-height: 40rpx;
  303. margin-top: 24rpx;
  304. }
  305. &-state{
  306. margin-top: 46rpx;
  307. &-pre{
  308. padding-left: 16rpx;
  309. position: relative;
  310. font-family: PingFangSC, PingFang SC;
  311. font-weight: 400;
  312. font-size: 24rpx;
  313. color: #335368;
  314. line-height: 20rpx;
  315. span{
  316. color: #1D2129;
  317. }
  318. &::before{
  319. content: '';
  320. width: 10rpx;
  321. height: 10rpx;
  322. border-radius: 5rpx;
  323. position: absolute;
  324. left: 0;
  325. top: 50%;
  326. margin-top: -5rpx;
  327. }
  328. &.grey{
  329. &::before{
  330. background: #DDE0E6;
  331. }
  332. }
  333. &.yellow{
  334. &::before{
  335. background: #FFD750;
  336. }
  337. }
  338. &.green{
  339. &::before{
  340. background: #31D1D6;
  341. }
  342. }
  343. }
  344. }
  345. &-progress{
  346. margin-top: 24rpx;
  347. width: 100%;
  348. height: 10rpx;
  349. background: #DFE5EE;
  350. border-radius: 5rpx;
  351. position: relative;
  352. &-current{
  353. height: 10rpx;
  354. border-radius: 4rpx;
  355. position: absolute;
  356. left: 0;
  357. top: 0;
  358. }
  359. .pbp-yellow{
  360. background: #FFD750;
  361. }
  362. .pbp-green{
  363. background: #31D1D6;
  364. }
  365. }
  366. }
  367. }
  368. .boxs{
  369. margin-top: 20rpx;
  370. position: relative;
  371. &-pre{
  372. width: calc(50% - 11rpx);
  373. padding: 42rpx 0 0 20rpx;
  374. box-sizing: border-box;
  375. height: 184rpx;
  376. &-title{
  377. font-family: PingFang-SC, PingFang-SC;
  378. font-weight: bold;
  379. font-size: 32rpx;
  380. color: #E0EFEF;
  381. line-height: 45rpx;
  382. }
  383. &-tip{
  384. font-family: PingFangSC, PingFang SC;
  385. font-weight: 400;
  386. font-size: 24rpx;
  387. color: #E0EFEF;
  388. line-height: 33rpx;
  389. margin-top: 16rpx;
  390. image{
  391. width: 26rpx;
  392. height: 26rpx;
  393. margin-left: 12rpx;
  394. }
  395. }
  396. &.bp1{
  397. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg1.png') no-repeat;
  398. background-size: 100% 100%;
  399. }
  400. &.bp2{
  401. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/home_box_bg2.png') no-repeat;
  402. background-size: 100% 100%;
  403. }
  404. }
  405. }
  406. .common{
  407. margin-top: 20rpx;
  408. background: #FFFFFF;
  409. border-radius: 24rpx;
  410. padding: 40rpx 24rpx 48rpx;
  411. position: relative;
  412. &-title{
  413. font-family: PingFang-SC, PingFang-SC;
  414. font-weight: bold;
  415. font-size: 34rpx;
  416. color: #002846;
  417. line-height: 48rpx;
  418. }
  419. &-menu{
  420. width: calc(100% + 48rpx);
  421. margin-left: -24rpx;
  422. margin-top: 45rpx;
  423. &-pre{
  424. width: calc(100% / 3);
  425. image{
  426. width: 64rpx;
  427. height: 64rpx;
  428. }
  429. text{
  430. font-family: PingFangSC, PingFang SC;
  431. font-weight: 400;
  432. font-size: 24rpx;
  433. color: #193D59;
  434. line-height: 32rpx;
  435. text-align: center;
  436. margin-top: 24rpx;
  437. padding: 0 24rpx;
  438. }
  439. }
  440. }
  441. }
  442. .new-user-free{
  443. position: fixed;
  444. left: 0;
  445. right: 0;
  446. top: 0;
  447. bottom: 0;
  448. background: rgba(0, 0, 0, .6);
  449. z-index: 1000;
  450. &-box1{
  451. width: calc(100% - 180rpx);
  452. height: 280rpx;
  453. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_title.png') no-repeat;
  454. background-size: 100% 100%;
  455. padding-left: 53rpx;
  456. &-text{
  457. font-family: SourceHanSansCN, SourceHanSansCN;
  458. font-weight: bold;
  459. font-size: 36rpx;
  460. color: #874016;
  461. line-height: 54rpx;
  462. margin-top: 140rpx;
  463. }
  464. }
  465. &-box2{
  466. width: calc(100% - 140rpx);
  467. background: #FFFFFF;
  468. border-radius: 24rpx;
  469. padding: 45rpx 25rpx 42rpx;
  470. box-sizing: border-box;
  471. &-price{
  472. width: 100%;
  473. height: 132rpx;
  474. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_price.png') no-repeat;
  475. background-size: 100% 100%;
  476. padding: 27rpx 34rpx 27rpx 30rpx;
  477. box-sizing: border-box;
  478. &-left{
  479. &-title{
  480. font-family: PingFang-SC, PingFang-SC;
  481. font-weight: bold;
  482. font-size: 28rpx;
  483. color: #5E2E11;
  484. line-height: 36rpx;
  485. }
  486. &-tip{
  487. font-family: PingFangSC, PingFang SC;
  488. font-weight: 400;
  489. font-size: 24rpx;
  490. color: #808080;
  491. line-height: 32rpx;
  492. margin-top: 10rpx;
  493. }
  494. }
  495. &-right{
  496. &-top{
  497. font-family: PingFang-SC, PingFang-SC;
  498. font-weight: bold;
  499. font-size: 48rpx;
  500. color: #FF5A09;
  501. line-height: 67rpx;
  502. }
  503. &-bottom{
  504. font-family: PingFangSC, PingFang SC;
  505. font-weight: 400;
  506. font-size: 24rpx;
  507. color: #612D11;
  508. line-height: 33rpx;
  509. margin-top: 3rpx;
  510. text-decoration: line-through;
  511. }
  512. }
  513. }
  514. &-btn{
  515. width: calc(100% - 170rpx);
  516. height: 80rpx;
  517. border-radius: 40rpx;
  518. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/new_free_btn.png') no-repeat;
  519. background-size: 100% 100%;
  520. font-family: PingFang-SC, PingFang-SC;
  521. font-weight: bold;
  522. font-size: 32rpx;
  523. color: #5E2E11;
  524. line-height: 80rpx;
  525. text-align: center;
  526. letter-spacing: 2rpx;
  527. margin-top: 38rpx;
  528. }
  529. }
  530. &-close{
  531. width: 64rpx;
  532. height: 64rpx;
  533. margin-top: 48rpx;
  534. }
  535. }
  536. .kind-reminder{
  537. position: fixed;
  538. left: 0;
  539. right: 0;
  540. top: 0;
  541. bottom: 0;
  542. z-index: 1000;
  543. background: rgba(0, 0, 0, .6);
  544. .kr-box{
  545. width: calc(100% - 100rpx);
  546. padding: 54rpx 60rpx 48rpx;
  547. box-sizing: border-box;
  548. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/remind_bg.png') no-repeat;
  549. background-size: 100% 100%;
  550. position: relative;
  551. image{
  552. width: 48rpx;
  553. height: 48rpx;
  554. position: absolute;
  555. top: 40rpx;
  556. right: 30rpx;
  557. }
  558. .kr-title{
  559. font-family: PingFang-SC, PingFang-SC;
  560. font-weight: bold;
  561. font-size: 36rpx;
  562. color: #002846;
  563. line-height: 56rpx;
  564. text-align: center;
  565. }
  566. .kr-p{
  567. font-family: PingFangSC, PingFang SC;
  568. font-weight: 400;
  569. font-size: 30rpx;
  570. color: #002846;
  571. line-height: 48rpx;
  572. text-align: center;
  573. span{
  574. font-weight: bold;
  575. margin: 0 10rpx;
  576. }
  577. }
  578. .kr-btn{
  579. width: calc(100% - 80rpx);
  580. height: 88rpx;
  581. background: linear-gradient( 90deg, #33A7A7 0%, #64BBBB 100%);;
  582. border-radius: 44rpx;
  583. font-family: PingFang-SC, PingFang-SC;
  584. font-weight: bold;
  585. font-size: 32rpx;
  586. color: #FFFFFF;
  587. line-height: 88rpx;
  588. text-align: center;
  589. letter-spacing: 2rpx;
  590. margin-top: 66rpx;
  591. }
  592. }
  593. }
  594. }
  595. </style>