publish.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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 adffcacjc" 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. export default {
  34. components:{ Tabbar, Notice },
  35. data(){
  36. return {
  37. list:[],
  38. type:1,
  39. questionnaireId:'',
  40. typeDict:{
  41. 1:'基础版',
  42. 2:'专业版',
  43. 3:'专家版,敬请期待'
  44. },
  45. buyShow:false,
  46. buyImgList:[
  47. {img:this.$imgBase+'buy_img1.png',text:'全球200+客户'},
  48. {img:this.$imgBase+'buy_img2.png',text:'企业正念'},
  49. {img:this.$imgBase+'buy_img3.png',text:'国际教练专业认证'},
  50. {img:this.$imgBase+'buy_img4.png',text:'4A领导力'}
  51. ],
  52. noticeShow:false,
  53. }
  54. },
  55. onLoad(options) {
  56. this.getList()
  57. },
  58. methods:{
  59. getList(){
  60. this.$api.get('/core/questionnaire/list').then(({data:res})=>{
  61. if(res.code!==0) return this.$showToast(res.msg)
  62. this.list = res.data
  63. })
  64. },
  65. handleTurnPage(item){
  66. this.type = item.type;
  67. if(item.type==3) return this.$showToast('敬请期待专家版~')
  68. this.$api.get(`/que/order/getUseFrequency/${JSON.parse(uni.getStorageSync('userInfo')).id}/${item.type}`).then(({data:res})=>{
  69. if(res.code!==0) return this.$showToast(res.msg)
  70. if(res.data>0){
  71. this.questionnaireId = item.id;
  72. this.noticeShow = true;
  73. }else this.buyShow = true;
  74. })
  75. },
  76. handleBuy(){
  77. uni.navigateTo({
  78. url:'/pagesPublish/rechargeCenter'
  79. })
  80. },
  81. handleKnow(){
  82. this.noticeShow = false;
  83. uni.navigateTo({
  84. url:'/pagesPublish/fillTeamInfo?type='+this.type+'&questionnaireId='+this.questionnaireId+'&next=true'
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style scoped lang="scss">
  91. .tabPage{
  92. padding: 0;
  93. &>image{
  94. width: 100%;
  95. position: absolute;
  96. left: 0;
  97. right: 0;
  98. }
  99. .list{
  100. margin-top: 369rpx;
  101. position: relative;
  102. padding: 0 24rpx;
  103. &-item{
  104. margin-top: 20rpx;
  105. background: #FFFFFF;
  106. border-radius: 24rpx;
  107. padding: 40rpx 30rpx;
  108. &:first-child{
  109. margin-top: 0;
  110. }
  111. &-left{
  112. width: calc(100% - 50rpx);
  113. padding-right: 30rpx;
  114. box-sizing: border-box;
  115. &-title{
  116. font-family: PingFang-SC, PingFang-SC;
  117. font-weight: bold;
  118. font-size: 30rpx;
  119. color: #002846;
  120. line-height: 42rpx;
  121. text-overflow: ellipsis;
  122. overflow: hidden;
  123. white-space: nowrap;
  124. }
  125. &-type{
  126. background: #FFF7DC;
  127. border-radius: 8rpx;
  128. margin-top: 20rpx;
  129. padding: 2rpx 13rpx;
  130. font-family: PingFangSC, PingFang SC;
  131. font-weight: 400;
  132. font-size: 24rpx;
  133. color: #BA9B31;
  134. line-height: 33rpx;
  135. letter-spacing: 2rpx;
  136. display: inline-block;
  137. }
  138. }
  139. &-right{
  140. width: 50rpx;
  141. height: 50rpx;
  142. }
  143. }
  144. }
  145. .dialog{
  146. position: fixed;
  147. left: 0;
  148. right: 0;
  149. top: 0;
  150. bottom: 0;
  151. z-index: 1000;
  152. background: rgba(0, 0, 0, .6);
  153. &-box{
  154. width: calc(100% - 48rpx);
  155. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/buy_bg.png') no-repeat;
  156. background-size: 100% 100%;
  157. padding: 308rpx 30rpx 40rpx;
  158. box-sizing: border-box;
  159. position: relative;
  160. &.zyb{
  161. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/buy_bg_zyb.png') no-repeat;
  162. background-size: 100% 100%;
  163. }
  164. &>image{
  165. width: 48rpx;
  166. height: 48rpx;
  167. position: absolute;
  168. top: 0;
  169. right: 30rpx;
  170. }
  171. &-list{
  172. width: 100%;
  173. justify-content: space-between;
  174. &-item{
  175. width: calc(25% - 16rpx);
  176. image{
  177. width: 80rpx;
  178. height: 80rpx;
  179. }
  180. text{
  181. font-family: PingFangSC, PingFang SC;
  182. font-weight: 400;
  183. font-size: 22rpx;
  184. color: #6F4611;
  185. line-height: 30rpx;
  186. text-align: center;
  187. margin-top: 24rpx;
  188. }
  189. }
  190. }
  191. &-btn{
  192. width: calc(100% - 70rpx);
  193. height: 88rpx;
  194. background: linear-gradient( 90deg, #EBB56C 0%, #FCEAD0 100%);
  195. border-radius: 44rpx;
  196. margin-top: 27rpx;
  197. font-family: PingFang-SC, PingFang-SC;
  198. font-weight: bold;
  199. font-size: 32rpx;
  200. color: #6F4611;
  201. line-height: 88rpx;
  202. text-align: center;
  203. letter-spacing: 2rpx;
  204. }
  205. }
  206. }
  207. }
  208. </style>