navInfor.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template name="navinfor">
  2. <!-- 优选分类 -->
  3. <view class="tabbar clearfix">
  4. <view class="cate-item" @click="this.$api.navToListPage({type:'星范优惠',value:navInforList[0].text})">
  5. <image :src="navInforList[0].icon"></image>
  6. <text>{{navInforList[0].text}}</text>
  7. </view>
  8. <view class="cate-item" @click="this.$api.navToListPage({type:'惊喜特惠',value:navInforList[1].text})">
  9. <image :src="navInforList[1].icon"></image>
  10. <text>{{navInforList[1].text}}</text>
  11. </view>
  12. <view class="cate-item" @click="showTost">
  13. <image :src="navInforList[2].icon"></image>
  14. <text>{{navInforList[2].text}}</text>
  15. </view>
  16. <view class="cate-item">
  17. <!-- #ifdef MP-WEIXIN -->
  18. <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
  19. <image :src="navInforList[3].icon"></image>
  20. </button>
  21. <!-- #endif -->
  22. <text>{{navInforList[3].text}}</text>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. var self;
  28. export default{
  29. name:'navinfor',
  30. props:{
  31. navInforList: { // 由父页面传递的数据
  32. type: Array,
  33. value: [],
  34. },
  35. },
  36. data() {
  37. return{
  38. }
  39. },
  40. created() {
  41. },
  42. onLoad(){
  43. },
  44. methods:{
  45. handleContact(e){
  46. console.log(e.detail.path)
  47. console.log(e.detail.query)
  48. },
  49. showTost(){
  50. uni.showToast({
  51. icon: 'none',
  52. title: '正在开发中,敬请期待~',
  53. duration: 2000
  54. })
  55. }
  56. },
  57. onShow(){
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .cate-item {
  63. width: 160rpx;
  64. margin-right:20.666rpx;
  65. display: flex;
  66. float: left;
  67. flex-direction: column;
  68. align-items: center;
  69. font-size: $font-size-26;
  70. color: $text-color;
  71. line-height: 36rpx;
  72. &:last-child{
  73. margin-right: 0;
  74. }
  75. image {
  76. width: 160rpx;
  77. height: 90rpx;
  78. margin-bottom: 16rpx;
  79. }
  80. button.contact-btn{
  81. width: 160rpx;
  82. height: 90rpx;
  83. margin: 0;
  84. padding: 0;
  85. display: flex;
  86. flex-direction: column;
  87. align-items: center;
  88. box-sizing: border-box;
  89. text-align: center;
  90. text-decoration: none;
  91. border-radius: 0;
  92. -webkit-tap-highlight-color: transparent;
  93. overflow: hidden;
  94. background-color:#FFFFFF;
  95. margin-bottom: 16rpx;
  96. image{
  97. width: 160rpx;
  98. height: 90rpx;
  99. margin-bottom: 0;
  100. }
  101. }
  102. }
  103. </style>