home.vue 17 KB

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