publish.vue 6.0 KB

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