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. // console.log(this.telPhone);
  39. },
  40. onLoad(){
  41. },
  42. methods:{
  43. showTost(){
  44. uni.showToast({
  45. icon: 'none',
  46. title: '正在开发中,敬请期待~',
  47. duration: 2000
  48. })
  49. },
  50. navto(url){
  51. uni.navigateTo({
  52. url
  53. })
  54. },
  55. telPhoneTo(){
  56. let self = this;
  57. uni.makePhoneCall({
  58. phoneNumber:self.telPhone //仅为示例
  59. });
  60. }
  61. },
  62. onShow(){
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. /*底部服务导航*/
  68. .cate-item {
  69. width: 99rpx;
  70. margin-right: 102rpx;
  71. float: left;
  72. display: flex;
  73. flex-direction: column;
  74. align-items: center;
  75. font-size: $font-size-24;
  76. color: $text-color;
  77. &:last-child{
  78. margin-right: 0;
  79. }
  80. image {
  81. width: 75rpx;
  82. height: 75rpx;
  83. margin-bottom: 8rpx;
  84. border-radius: 50%;
  85. }
  86. }
  87. </style>