navInfor.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. // console.log(this.navInforList);
  42. },
  43. onLoad(){
  44. },
  45. methods:{
  46. handleContact(e){
  47. console.log(e.detail.path)
  48. console.log(e.detail.query)
  49. },
  50. showTost(){
  51. uni.showToast({
  52. icon: 'none',
  53. title: '正在开发中,敬请期待~',
  54. duration: 2000
  55. })
  56. },
  57. // navto({type,value}){
  58. // uni.navigateTo({
  59. // url:`/pages/goods/goods?type=${type}&from=${value}`
  60. // })
  61. // }
  62. },
  63. onShow(){
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. .cate-item {
  69. width: 160rpx;
  70. margin-right:20.666rpx;
  71. display: flex;
  72. float: left;
  73. flex-direction: column;
  74. align-items: center;
  75. font-size: $font-size-26;
  76. color: $text-color;
  77. line-height: 36rpx;
  78. &:last-child{
  79. margin-right: 0;
  80. }
  81. image {
  82. width: 160rpx;
  83. height: 90rpx;
  84. margin-bottom: 16rpx;
  85. }
  86. button.contact-btn{
  87. width: 160rpx;
  88. height: 90rpx;
  89. margin: 0;
  90. padding: 0;
  91. display: flex;
  92. flex-direction: column;
  93. align-items: center;
  94. box-sizing: border-box;
  95. text-align: center;
  96. text-decoration: none;
  97. border-radius: 0;
  98. -webkit-tap-highlight-color: transparent;
  99. overflow: hidden;
  100. background-color:#FFFFFF;
  101. margin-bottom: 16rpx;
  102. image{
  103. width: 160rpx;
  104. height: 90rpx;
  105. margin-bottom: 0;
  106. }
  107. }
  108. }
  109. </style>