推拿小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
1.9 KiB

  1. <template>
  2. <view class="card flex store">
  3. <image class="store-img" :src="data.image"></image>
  4. <view class="store-info">
  5. <view class="store-name">{{ data.name }}</view>
  6. <view class="store-desc">{{ `地址:${data.address}` }}</view>
  7. <view class="store-desc">{{ `联系方式:${data.phone}` }}</view>
  8. <view class="store-contact">
  9. <button plain class="flex btn" @click="onCall(data.phone)">
  10. <image class="btn-icon" src="../../static/voucher/icon-phone.png" mode="widthFix"></image>
  11. <text>电话</text>
  12. </button>
  13. <button plain class="flex btn" @click="openLocation(data.latitude, data.longitude)">
  14. <image class="btn-icon" src="../../static/voucher/icon-address.png" mode="widthFix"></image>
  15. <text>导航</text>
  16. </button>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. data: {
  25. type: Object,
  26. default() {
  27. return {}
  28. }
  29. },
  30. },
  31. methods: {
  32. onCall(phoneNumber) {
  33. uni.makePhoneCall({
  34. phoneNumber,
  35. success() {
  36. console.log('安卓拨打成功');
  37. },
  38. fail() {
  39. console.log('安卓拨打失败');
  40. }
  41. })
  42. },
  43. },
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .store {
  48. padding: 22rpx 38rpx 30rpx 30rpx;
  49. &-img {
  50. width: 155rpx;
  51. height: 155rpx;
  52. margin-right: 23rpx;
  53. }
  54. &-info {
  55. flex: 1;
  56. }
  57. &-name {
  58. color: #3B3B3B;
  59. font-size: 28rpx;
  60. font-weight: 700;
  61. }
  62. &-desc {
  63. color: #999999;
  64. font-size: 22rpx;
  65. margin-top: 13rpx;
  66. }
  67. &-contact {
  68. margin-top: 3rpx;
  69. text-align: right;
  70. }
  71. }
  72. .btn {
  73. display: inline-flex;
  74. border: none;
  75. color: $uni-color-light;
  76. font-size: 22rpx;
  77. line-height: 30rpx;
  78. & + & {
  79. margin-left: 44rpx;
  80. }
  81. &-icon {
  82. width: 23rpx;
  83. height: 23rpx;
  84. margin-right: 6rpx;
  85. }
  86. }
  87. </style>