index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view>
  3. <uni-section title="量表测试" type="line" padding>
  4. <uni-grid :column="2" :highlight="true" @change="changeHandle">
  5. <uni-grid-item v-for="(item, index) in menuList" :index="index" :key="index">
  6. <view class="grid-item-box">
  7. <image :src="item.imageUrl" class="image" mode="aspectFill" />
  8. <text class="text">{{ item.name }}</text>
  9. </view>
  10. </uni-grid-item>
  11. </uni-grid>
  12. </uni-section>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. menuList: [{
  20. name: '情商测试',
  21. imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/paymentPage/pay_scale_info.png',
  22. pageUrl: '/newScale/EQtest/index'
  23. },
  24. {
  25. name: '异性吸引指数测试',
  26. imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/paymentPage/pay_scale_info.png',
  27. pageUrl: '/newScale/Charm/index'
  28. },
  29. {
  30. name: '你是否在逐渐老化',
  31. imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/Senile/paymentPage/pay_scale_info.png',
  32. pageUrl: '/newScale/Senile/index'
  33. },
  34. {
  35. name: 'MBTI 16型人格测试',
  36. imageUrl: 'https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/paymentPage/pay_scale_info.png',
  37. pageUrl: '/newScale/Mbti/index'
  38. }
  39. ]
  40. }
  41. },
  42. methods: {
  43. changeHandle(e) {
  44. let {
  45. index
  46. } = e.detail
  47. uni.navigateTo({
  48. url: this.menuList[index].pageUrl
  49. })
  50. }
  51. }
  52. }
  53. </script>
  54. <style scoped>
  55. .grid-item-box {
  56. flex: 1;
  57. flex-direction: column;
  58. align-items: center;
  59. justify-content: center;
  60. padding: 15px 0;
  61. text-align: center;
  62. }
  63. .grid-item-box image {
  64. width: 340rpx;
  65. }
  66. .image {
  67. width: 200rpx;
  68. height: 200rpx;
  69. }
  70. .text {
  71. font-size: 32rpx;
  72. margin-top: 5px;
  73. }
  74. </style>