publish.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='发布问卷' :showback="false"></cus-header>
  4. <image :style="{'top':mt+'px'}" :src="imgBase+'publish_bg.png'" mode="widthFix"></image>
  5. <div class="list">
  6. <div class="list-item adfacjb" v-for="(item,index) in list" :key="index" @click="handleTurnPage(item)">
  7. <div class="list-item-left">
  8. <div class="list-item-left-title">{{item.title}}</div>
  9. <div class="list-item-left-type">{{typeDict[item.type]||'默认版'}}</div>
  10. </div>
  11. <image class="list-item-right" :src="imgBase+'publish_arrow_right.png'" v-if="item.type<3"></image>
  12. </div>
  13. </div>
  14. <div class="dialog adffcac" v-if="buyShow">
  15. <div class="dialog-box adffcac" :class="{'zyb':type==2}">
  16. <image :src="imgBase+'new_free_close.png'" @click="buyShow=false"></image>
  17. <div class="dialog-box-list adf">
  18. <div class="dialog-box-list-item adffcac" v-for="(item,index) in buyImgList" :key="index">
  19. <image :src="item.img"></image>
  20. <text>{{item.text}}</text>
  21. </div>
  22. </div>
  23. <div class="dialog-box-btn" @click="handleBuy">立即购买</div>
  24. </div>
  25. </div>
  26. <Notice :show="noticeShow" @close="noticeShow=false" @handleKnow="handleKnow"></Notice>
  27. <Tabbar :tabbarIndex="1"></Tabbar>
  28. </view>
  29. </template>
  30. <script>
  31. import Tabbar from '@/components/CusTabbar/index.vue'
  32. import Notice from '@/components/CusNotice/index.vue'
  33. import backgroundSurveyRules from '@/utils/backgroundSurvey.js'
  34. const { isPublishablePerillQuestionnaire } = backgroundSurveyRules
  35. export default {
  36. components:{ Tabbar, Notice },
  37. data(){
  38. return {
  39. list:[],
  40. type:1,
  41. questionnaireId:'',
  42. questionnaireName:'',
  43. typeDict:{
  44. 1:'个人版',
  45. 2:'团队版',
  46. 0:'团队PRO版,敬请期待'
  47. },
  48. buyShow:false,
  49. buyImgList:[
  50. {img:this.$imgBase+'buy_img1.png',text:'全球前沿研究'},
  51. {img:this.$imgBase+'buy_img2.png',text:'扎实理论基础'},
  52. {img:this.$imgBase+'buy_img3.png',text:'一键全面评估'},
  53. {img:this.$imgBase+'buy_img4.png',text:'专业教练解读'}
  54. ],
  55. noticeShow:false,
  56. }
  57. },
  58. onLoad(options) {
  59. this.getList()
  60. },
  61. methods:{
  62. getList(){
  63. this.$api.get('/core/questionnaire/list?mode=1').then(({data:res})=>{
  64. if(res.code!==0) return this.$showToast(res.msg)
  65. this.list = (res.data || []).filter(isPublishablePerillQuestionnaire)
  66. })
  67. },
  68. handleTurnPage(item){
  69. this.type = item.type;
  70. this.questionnaireName = item.title;
  71. if(item.type==0) return this.$showToast('敬请期待团队PRO版~')
  72. this.$api.get(`/que/order/getUseFrequency/${JSON.parse(uni.getStorageSync('userInfo')).id}/${item.type}`).then(({data:res})=>{
  73. if(res.code!==0) return this.$showToast(res.msg)
  74. if(res.data>0){
  75. this.questionnaireId = item.id;
  76. this.noticeShow = true;
  77. }else this.buyShow = true;
  78. })
  79. },
  80. handleBuy(){
  81. uni.navigateTo({
  82. url:'/pagesPublish/rechargeCenter?type='+(this.type-1)
  83. })
  84. },
  85. handleKnow(){
  86. this.noticeShow = false;
  87. if(this.type==1){
  88. uni.navigateTo({
  89. url:'/pagesPublish/fillTeamInfo?type='+this.type+'&questionnaireId='+this.questionnaireId+'&next=true'+'&title='+this.questionnaireName
  90. })
  91. }else if(this.type==2){
  92. uni.navigateTo({
  93. url:'/pagesHome/questionnaireEdit?type=2&questionnaireId='+this.questionnaireId+'&questionnaireName='+this.questionnaireName+'&teamQuestionnaireId='+this.questionnaireId
  94. })
  95. }
  96. }
  97. }
  98. }
  99. </script>
  100. <style scoped lang="scss">
  101. .tabPage{
  102. padding: 0;
  103. &>image{
  104. width: 100%;
  105. position: absolute;
  106. left: 0;
  107. right: 0;
  108. }
  109. .list{
  110. margin-top: 369rpx;
  111. position: relative;
  112. padding: 0 24rpx;
  113. &-item{
  114. margin-top: 20rpx;
  115. background: #FFFFFF;
  116. border-radius: 24rpx;
  117. padding: 40rpx 30rpx;
  118. &:first-child{
  119. margin-top: 0;
  120. }
  121. &-left{
  122. width: calc(100% - 50rpx);
  123. padding-right: 30rpx;
  124. box-sizing: border-box;
  125. &-title{
  126. font-family: PingFang-SC, PingFang-SC;
  127. font-weight: bold;
  128. font-size: 30rpx;
  129. color: #002846;
  130. line-height: 42rpx;
  131. text-overflow: ellipsis;
  132. overflow: hidden;
  133. white-space: nowrap;
  134. }
  135. &-type{
  136. background: #FFF7DC;
  137. border-radius: 8rpx;
  138. margin-top: 20rpx;
  139. padding: 2rpx 13rpx;
  140. font-family: PingFangSC, PingFang SC;
  141. font-weight: 400;
  142. font-size: 24rpx;
  143. color: #BA9B31;
  144. line-height: 33rpx;
  145. letter-spacing: 2rpx;
  146. display: inline-block;
  147. }
  148. }
  149. &-right{
  150. width: 50rpx;
  151. height: 50rpx;
  152. }
  153. }
  154. }
  155. .dialog{
  156. position: fixed;
  157. left: 0;
  158. right: 0;
  159. top: 0;
  160. bottom: 0;
  161. z-index: 1000;
  162. background: rgba(0, 0, 0, .6);
  163. padding-bottom: 140rpx;
  164. box-sizing: border-box;
  165. justify-content: flex-end;
  166. &-box{
  167. width: calc(100% - 48rpx);
  168. height: 628rpx;
  169. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/buy_bg.png') no-repeat;
  170. background-size: 100% 100%;
  171. padding: 306rpx 31rpx 40rpx;
  172. box-sizing: border-box;
  173. position: relative;
  174. &.zyb{
  175. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/buy_bg_zyb.png') no-repeat;
  176. background-size: 100% 100%;
  177. }
  178. &>image{
  179. width: 48rpx;
  180. height: 48rpx;
  181. position: absolute;
  182. top: 0;
  183. right: 30rpx;
  184. }
  185. &-list{
  186. width: 100%;
  187. justify-content: space-between;
  188. &-item{
  189. width: calc(25% - 16rpx);
  190. image{
  191. width: 80rpx;
  192. height: 80rpx;
  193. }
  194. text{
  195. font-family: PingFangSC, PingFang SC;
  196. font-weight: 400;
  197. font-size: 22rpx;
  198. color: #6F4611;
  199. line-height: 30rpx;
  200. text-align: center;
  201. margin-top: 24rpx;
  202. }
  203. }
  204. }
  205. &-btn{
  206. width: calc(100% - 70rpx);
  207. height: 88rpx;
  208. background: linear-gradient( 90deg, #EBB56C 0%, #FCEAD0 100%);
  209. border-radius: 44rpx;
  210. margin-top: 60rpx;
  211. font-family: PingFang-SC, PingFang-SC;
  212. font-weight: bold;
  213. font-size: 32rpx;
  214. color: #6F4611;
  215. line-height: 88rpx;
  216. text-align: center;
  217. letter-spacing: 2rpx;
  218. }
  219. }
  220. }
  221. }
  222. </style>