index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="myIndex">
  3. <uni-menubar title="我的名片" />
  4. <view class="pure_top blue">
  5. </view>
  6. <!-- 顶部自定义导航栏 -->
  7. <tm-sheet v-if="card.id">
  8. <view class="visitor-box text-size-s">
  9. <view class="visitor-items">
  10. <view>
  11. <image class="visitor-user-avatar" :src="card.picture"></image>
  12. </view>
  13. <view class="visitor-items-user">
  14. <view class="text-weight-b">
  15. <text class="mr-20">{{card.name}} </text>
  16. <!-- <tm-button theme="orange" plan icon="icon-integral" size="s"></tm-button> -->
  17. </view>
  18. <view class="visitor-items-content">{{card.industry}}</view>
  19. <view class="visitor-items-content">{{card.company}}</view>
  20. <view class="visitor-items-content">
  21. <text style="font-size: 24rpx;">会员:{{getVip(user.vip_last_time)}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. <view>
  26. <!-- <tm-icons name="icon-menu" color="darkgray"></tm-icons> -->
  27. <tm-icons color="orange" :size="50" name="icon-integral"></tm-icons>
  28. </view>
  29. </view>
  30. <view class="recent-items">
  31. <view>
  32. <view>{{card.views}}</view>
  33. <view class="recent-items-title">最近访客</view>
  34. </view>
  35. <view>
  36. <view>{{card.view_count}}</view>
  37. <view class="recent-items-title">最近查看</view>
  38. </view>
  39. <view>
  40. <view>{{card.recommend}}</view>
  41. <view class="recent-items-title">给我点赞</view>
  42. </view>
  43. </view>
  44. </tm-sheet>
  45. <tm-sheet v-else>
  46. <view
  47. style="display: flex; margin-top: 20rpx; height: 200rpx; align-items: center; justify-content: space-around;">
  48. <!-- <tm-button @click="register" :font-size="24" :round="24" theme="bg-gradient-blue-accent" size="g">立即注册
  49. </tm-button> -->
  50. </view>
  51. </tm-sheet>
  52. <!-- 主题内容 -->
  53. <!-- <tm-sheet>
  54. <tm-grid :grid="4" @change="change" color="blue" :list="list"></tm-grid>
  55. </tm-sheet> -->
  56. <uni-tabBar />
  57. <view class="mx-32 text-weight-b text-size-g">
  58. 其他服务
  59. </view>
  60. <view>
  61. <tm-sheet :margin="[0,0]">
  62. <tm-grouplist :margin="[0,0]" :round="0" :shadow="0" :border-bottom="false">
  63. <!-- <tm-listitem :left-icon-size="40" title="使用指引" left-icon="tmicon-yiwen2x" show-left-icon></tm-listitem> -->
  64. <tm-listitem left-icon-color="blue" :left-icon-size="40" title="建议与反馈" left-icon="icon-new-releases" show-left-icon>
  65. <template v-slot:rightIcon>
  66. <view>
  67. <tm-button theme="grey" titl icon="icon-angle-right" :width="20" :height="20" open-type="feedback"></tm-button>
  68. </view>
  69. </template>
  70. </tm-listitem>
  71. <tm-listitem left-icon-color="blue" :left-icon-size="40" title="联系客服" left-icon="icon-headset-fill"
  72. show-left-icon>
  73. <template v-slot:rightIcon>
  74. <view>
  75. <tm-button theme="grey" titl icon="icon-angle-right" :width="20" :height="20" open-type="contact"></tm-button>
  76. </view>
  77. </template>
  78. </tm-listitem>
  79. <tm-listitem left-icon-color="blue" :left-icon-size="40" title="设置" left-icon="icon-cog-fill"
  80. show-left-icon>
  81. <template v-slot:rightIcon>
  82. <tm-button theme="grey" titl icon="icon-angle-right" :width="20" :height="20" open-type="openSetting"></tm-button>
  83. </template>
  84. </tm-listitem>
  85. <!-- <tm-listitem :left-icon-size="40" title="关于" left-icon="tmicon-guanyuwomen" show-left-icon></tm-listitem> -->
  86. </tm-grouplist>
  87. </tm-sheet>
  88. </view>
  89. <uni-suspension v-if='userInfo.card_id' />
  90. </view>
  91. </template>
  92. <script>
  93. export default {
  94. data() {
  95. return {
  96. card:{},
  97. vipLastTime: ""
  98. }
  99. },
  100. onLoad() {
  101. if (this.userInfo) {
  102. this.getVip()
  103. }
  104. },
  105. onShow() {
  106. this.$tm.request.get('card/read').then(res => {
  107. this.card = res.data
  108. })
  109. },
  110. computed: {
  111. user() {
  112. return this.$tm.vx.state().user.userInfo || {}
  113. }
  114. },
  115. methods: {
  116. getVip(val) {
  117. let date = new Date();
  118. date.setTime(val * 1000);
  119. let y = date.getFullYear()
  120. let m = date.getMonth() + 1
  121. let mm = m < 10 ? '0' + m : m
  122. let d = date.getDate()
  123. let dd = d < 10 ? '0' + d : d
  124. let h = date.getHours();
  125. let hh = h < 10 ? ("0" + h) : h;
  126. let M = date.getMinutes();
  127. let MM = M < 10 ? ("0" + M) : M;
  128. let S = date.getSeconds();
  129. let ss = S < 10 ? ("0" + S) : S;
  130. return `${y}-${mm}-${dd} ${hh}:${MM}:${ss}`
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .visitor-box {
  137. display: flex;
  138. justify-content: space-between;
  139. .visitor-items {
  140. display: flex;
  141. align-items: flex-start;
  142. .visitor-items-user {
  143. padding-left: 20rpx;
  144. font-size: 28rpx;
  145. .visitor-items-content {
  146. margin-top: 10rpx;
  147. color: #999999;
  148. }
  149. }
  150. .visitor-user-avatar {
  151. width: 160rpx;
  152. height: 160rpx;
  153. border-radius: 50%;
  154. }
  155. .visitor-items-avatar {
  156. width: 90rpx;
  157. height: 90rpx;
  158. border-radius: 50%;
  159. }
  160. }
  161. }
  162. .recent-items {
  163. padding-top: 20rpx;
  164. display: flex;
  165. align-items: center;
  166. justify-content: space-around;
  167. text-align: center;
  168. font-weight: 600;
  169. .recent-items-title {
  170. font-weight: 400;
  171. color: #4a5260;
  172. }
  173. }
  174. </style>