home.vue 17 KB

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