index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <app-layout>
  3. <app-math-card v-for="(item,index) in mathLists"
  4. :key="index"
  5. :cover-image="item.coverImage"
  6. :title="item.title"
  7. :index="index"
  8. :custom-style="{marginLeft:index % 2 === 1 ? '20rpx' : 0}"
  9. @open="handleOpen"
  10. >
  11. </app-math-card>
  12. <u-modal v-model="modal.show"
  13. :show-cancel-button="true"
  14. cancel-text="放弃机会"
  15. cancel-color="#CCCCCC"
  16. confirm-text="购买"
  17. confirm-color="#046E64"
  18. @confirm="handleConfirmBuy"
  19. >
  20. <view class="slot-content">
  21. <view class="title">{{modal.title}}</view>
  22. <view class="sub-title">{{modal.subTitle}}</view>
  23. </view>
  24. </u-modal>
  25. </app-layout>
  26. </template>
  27. <script>
  28. import appLayout from "@/components/app-layout"
  29. import appMathCard from "@/components/index/app-math-card"
  30. import mathLists from "@/core/math-lists.js"
  31. export default {
  32. components:{
  33. appLayout,
  34. appMathCard
  35. },
  36. data() {
  37. return {
  38. mathLists: mathLists,
  39. modal:{
  40. show: false,
  41. title: '该功能需付费永久使用',
  42. subTitle: '做桥架不求人,让你秒变大师',
  43. }
  44. }
  45. },
  46. methods: {
  47. handleOpen(index){
  48. //this.modal.show = true
  49. this.$jump({url: mathLists[index].url,type:'to'})
  50. },
  51. handleConfirmBuy(){
  52. this.$jump({url:'/pages/my/member',type:'to'})
  53. }
  54. },
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .slot-content{
  59. text-align: center;
  60. padding: 36rpx 0;
  61. .title{
  62. font-size: 36rpx;
  63. font-weight: 600;
  64. color: #333333;
  65. padding: 12rpx 0;
  66. }
  67. .sub-title{
  68. font-size: 28rpx;
  69. color: #999999;
  70. }
  71. }
  72. </style>