myInfo.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="content">
  3. <view class="card-list">
  4. <view class="row" v-for="(item,index) in cardList" :key="index">
  5. <view class="title-name">
  6. {{item.cardBusiness}}
  7. </view>
  8. <view class="flex card-list-item">
  9. <view class="left">
  10. <view class="top flex-row-center">
  11. <image :src="item.headSculpture" mode="widthFix" class="img"></image>
  12. </view>
  13. <view class="bottom flex flex-evenly">
  14. <uni-icons type="home" size="20" @click="toHome(item)"></uni-icons>
  15. <uni-icons type="home" size="20"></uni-icons>
  16. <uni-icons type="redo" size="20"></uni-icons>
  17. </view>
  18. </view>
  19. <view class="right">
  20. <view class="row1 flex">
  21. <text>{{item.name}}</text>
  22. <text class="line"></text>
  23. <text>{{item.post}}</text>
  24. </view>
  25. <view class="row2">
  26. {{item.companyName}}
  27. </view>
  28. <view class="row3" @click="toMap">
  29. <uni-icons type="redo" size="20"></uni-icons>
  30. <text>{{item.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}</text>
  31. </view>
  32. <view class="row3">
  33. <uni-icons type="redo" size="20"></uni-icons>
  34. <text>{{item.phone}}</text>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="car-bottom flex">
  39. <u-button text="置顶" @click="topMarking(item)" throttle-time='1000'></u-button>
  40. <!-- <button @click="$u.debounce(topMarking, 500)">置顶</button> -->
  41. <!-- <button @click="$u.debounce(topMarking(item), 500)">置顶</button> -->
  42. <button>删除</button>
  43. <button>编辑</button>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="upload">
  48. <view class="solids" @click="addCard">
  49. <text class=''>添加新名片</text>
  50. </view>
  51. </view>
  52. <u-toast ref="uToast"></u-toast>
  53. </view>
  54. </template>
  55. <script>
  56. var that;
  57. export default {
  58. data() {
  59. return {
  60. cardList: []
  61. };
  62. },
  63. onLoad() {
  64. that = this
  65. this.userInfo = uni.getStorageSync("userInfo")
  66. },
  67. onShow() {
  68. this.init()
  69. },
  70. methods: {
  71. init() {
  72. this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
  73. commonId: this.userInfo.id
  74. }, failres => {
  75. this.$refs.uToast.show({
  76. type: 'error',
  77. message: failres.errmsg,
  78. })
  79. uni.hideLoading()
  80. }).then(res => {
  81. this.cardList = res.data.items
  82. })
  83. },
  84. addCard() {
  85. uni.navigateTo({
  86. url: "/pages/mySet/newCard"
  87. })
  88. },
  89. topMarking(val) {
  90. that.$request.baseRequest('admin.unimall.cardManagementInfo', 'top', {
  91. cardManagementInfo: JSON.stringify({id:val.id})
  92. }, failres => {
  93. this.$refs.uToast.show({
  94. type: 'error',
  95. message: failres.errmsg,
  96. })
  97. uni.hideLoading()
  98. }).then(res => {
  99. this.$refs.uToast.show({
  100. type: 'success',
  101. message: '置顶成功!',
  102. })
  103. this.init()
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .card-list-item {
  111. border: 1px solid #ccc;
  112. border-radius: 30rpx;
  113. padding: 40rpx;
  114. box-sizing: border-box;
  115. .left {
  116. width: 30%;
  117. .top {
  118. margin-bottom: 20rpx;
  119. }
  120. .img {
  121. width: 80%;
  122. }
  123. .bottom {}
  124. }
  125. .right {
  126. .row1 {
  127. .line {
  128. width: 1px;
  129. height: 20px;
  130. margin: 0 20rpx;
  131. background: black;
  132. }
  133. }
  134. }
  135. }
  136. </style>