home.vue 18 KB

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