index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="container">
  3. <view
  4. class="list flex_r flex_ac"
  5. v-for="(item, index) in list"
  6. :key="index"
  7. >
  8. <image class="head_img" :src="item.head_pic" mode=""></image>
  9. <view class="tea_info flex_grow flex_c">
  10. <view class="tea_name">{{ item.nickname }}</view>
  11. <view class="balance flex_r flex_ac"
  12. >{{ item.mobile }}
  13. <view class="copyBalance" @tap="copyText(item.mobile)"
  14. >复制</view
  15. ></view
  16. >
  17. </view>
  18. <view class="head_option flex_r flex_ac">
  19. <!-- <image
  20. class="option_weixin"
  21. src="/static/weixin.png"
  22. mode=""
  23. @tap="copyText(item.wxNumber)"
  24. ></image> -->
  25. <view class="option_hr"></view>
  26. <image
  27. class="option_phone"
  28. src="/static/dianhua.png"
  29. mode=""
  30. @tap="dial(item.mobile)"
  31. ></image>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. let page = 1;
  38. let app = getApp();
  39. var appEv = app.$vm.$options;
  40. import uniCopy from "@/utils/copy";
  41. import { post } from "@/request/api.js";
  42. export default {
  43. data() {
  44. return {
  45. list: [], // 我的茶友列表
  46. };
  47. },
  48. onShow() {
  49. this.loadData();
  50. },
  51. methods: {
  52. loadData() {
  53. post('/my/mychayou').then(res => {
  54. if(res.code === 0){
  55. this.list = res.data.data
  56. }
  57. })
  58. },
  59. // 拨打电话
  60. dial: function (e) {
  61. let that = this;
  62. if (e == "") {
  63. appEv.errTips("用户暂未设置电话");
  64. return false;
  65. }
  66. uni.makePhoneCall({
  67. phoneNumber: e, //仅为示例
  68. });
  69. },
  70. // 复制微信号
  71. copyText: function (e) {
  72. let that = this;
  73. if (e == "") {
  74. appEv.errTips("用户暂未设置微信");
  75. return false;
  76. }
  77. uniCopy({
  78. content: e,
  79. success: (res) => {},
  80. error: (e) => {},
  81. });
  82. },
  83. },
  84. };
  85. </script>
  86. <style lang="scss" scoped>
  87. // 页面配置
  88. .container {
  89. border-top: 20rpx solid #f5f5f5;
  90. }
  91. // 页面配置-end
  92. // 我的茶友列表
  93. .tea_name {
  94. font-size: 30rpx;
  95. color: #363638;
  96. }
  97. .option_weixin {
  98. width: 42rpx;
  99. height: 35rpx;
  100. }
  101. .balance {
  102. font-size: 28rpx;
  103. color: #18bb88;
  104. margin-top: 6rpx;
  105. }
  106. .option_phone {
  107. width: 36rpx;
  108. height: 36rpx;
  109. margin-left: 30rpx;
  110. }
  111. .tea_level {
  112. font-size: 26rpx;
  113. color: #6c6c6c;
  114. margin-top: 12rpx;
  115. }
  116. .head_img {
  117. width: 79rpx;
  118. height: 79rpx;
  119. margin-right: 40rpx;
  120. border-radius: 50%;
  121. }
  122. .option_hr {
  123. width: 3rpx;
  124. height: 66rpx;
  125. background: rgba(0, 0, 0, 0.12);
  126. margin-left: 30rpx;
  127. }
  128. .copyBalance {
  129. padding: 0 10rpx;
  130. background: #1cbe8c;
  131. color: #fff;
  132. font-size: 22rpx;
  133. margin-left: 12rpx;
  134. }
  135. .list {
  136. width: 100%;
  137. height: 130rpx;
  138. box-sizing: border-box;
  139. padding: 0 36rpx;
  140. border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
  141. }
  142. // 我的茶友列表-end
  143. </style>