navServer.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template name="navserver">
  2. <!-- 优选分类 -->
  3. <view class="tabbar clearfix">
  4. <view class="cate-item" @click="showTost">
  5. <image :src="navServerList[0].icon"></image>
  6. <text>{{navServerList[0].text}}</text>
  7. </view>
  8. <view class="cate-item" @click="navto(navServerList[1].path)">
  9. <image :src="navServerList[1].icon"></image>
  10. <text>{{navServerList[1].text}}</text>
  11. </view>
  12. <view class="cate-item" @click="navto(navServerList[2].path)">
  13. <image :src="navServerList[2].icon"></image>
  14. <text>{{navServerList[2].text}}</text>
  15. </view>
  16. <view class="cate-item" @click="telPhoneTo">
  17. <image :src="navServerList[3].icon"></image>
  18. <text>{{navServerList[3].text}}</text>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. var self;
  24. export default{
  25. name:'navserver',
  26. props:{
  27. telPhone:String,
  28. navServerList: { // 由父页面传递的数据
  29. type: Array,
  30. value: [],
  31. },
  32. },
  33. data() {
  34. return{
  35. }
  36. },
  37. created() {
  38. },
  39. onLoad(){
  40. },
  41. methods:{
  42. showTost(){
  43. uni.showToast({
  44. icon: 'none',
  45. title: '正在开发中,敬请期待~',
  46. duration: 2000
  47. })
  48. },
  49. navto(url){
  50. uni.navigateTo({
  51. url
  52. })
  53. },
  54. telPhoneTo(){
  55. let self = this;
  56. uni.makePhoneCall({
  57. phoneNumber:self.telPhone //仅为示例
  58. });
  59. }
  60. },
  61. onShow(){
  62. }
  63. }
  64. </script>
  65. <style lang="scss">
  66. /*底部服务导航*/
  67. .cate-item {
  68. width: 99rpx;
  69. margin-right: 102rpx;
  70. float: left;
  71. display: flex;
  72. flex-direction: column;
  73. align-items: center;
  74. font-size: $font-size-24;
  75. color: $text-color;
  76. &:last-child{
  77. margin-right: 0;
  78. }
  79. image {
  80. width: 75rpx;
  81. height: 75rpx;
  82. margin-bottom: 8rpx;
  83. border-radius: 50%;
  84. }
  85. }
  86. </style>