my.wxml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <wxs module="wxs">
  2. function formatDate(time) {
  3. var t = getDate(time);
  4. var tf = function(i){return (i < 10 ? '0' : '') + i};
  5. var year = t.getFullYear();
  6. var month = tf(t.getMonth() + 1);
  7. var day = tf(t.getDate());
  8. var hour = tf(t.getHours());
  9. var minute = tf(t.getMinutes());
  10. return month + '-' + day + ' ' + hour + ':' + minute;
  11. }
  12. function getBirthday(birthday){
  13. var t = getDate(birthday);
  14. var tf = function(i){return (i < 10 ? '0' : '') + i};
  15. var year = t.getFullYear();
  16. var month = tf(t.getMonth() + 1);
  17. var day = tf(t.getDate());
  18. return year + '年' + month + '月' + day + '日';
  19. }
  20. module.exports.formatDate = formatDate;
  21. module.exports.getBirthday = getBirthday;
  22. </wxs>
  23. <template name="my">
  24. <view class='mine-container'>
  25. <view class='follow-details'>
  26. <view class='follow-info'>
  27. <view class='avatar-bg'>
  28. <view class='avatar-box'>
  29. <image class='avatar-image' src='{{ myData.user.user.avatar }}'></image>
  30. </view>
  31. <view class='occupation-title'>{{ myData.user.user.profession }}</view>
  32. </view>
  33. <view class='avatar-msg'>
  34. <view class='avatar-nickname'>
  35. <text>{{ myData.user.user.wechatName }}</text>
  36. <view class='flowers-box' wx:if='{{ myData.user.user.gender === 2 }}'>
  37. <image src='../../static/image/flowers.png'></image>
  38. </view>
  39. <view class='flowers-box' wx:elif='{{ myData.user.user.gender === 1 }}'>
  40. <image src='../../static/image/boy.png'></image>
  41. </view>
  42. <view wx:else class='gender-size'>未知</view>
  43. </view>
  44. <view class='avatar-birthday'>{{ wxs.getBirthday(myData.user.user.birthday) }}</view>
  45. <view class='avatar-address'>{{ myData.user.user.schoolName }}</view>
  46. </view>
  47. <view class='mine-edit' bindtap='toMyEdit' data-title='{{ myData.title }}'>
  48. <view class='edit-image'>
  49. <image class='edit-img' src='../../static/image/reset.png'></image>
  50. </view>
  51. <view class='edit-text'>修改</view>
  52. </view>
  53. </view>
  54. <view class='mine-category'>
  55. <view class='play-count'>
  56. <view>{{ myData.user.playAmount || 0 }}</view>
  57. <view class='border-right'>
  58. <view class='play-img'>
  59. <image src='../../static/image/play.png'></image>
  60. </view>
  61. <text>播放量</text>
  62. </view>
  63. </view>
  64. <view class='follow-count'>
  65. <view class='color'>{{ myData.user.fansAmount || 0 }}</view>
  66. <view class='border-right'>
  67. <view class='play-img'>
  68. <image src='../../static/image/follow.png'></image>
  69. </view>
  70. <text>关注</text>
  71. </view>
  72. </view>
  73. <view class='point-count'>
  74. <view class='color'>{{ myData.user.likeAmount || 0 }}</view>
  75. <view class='border-right'>
  76. <view class='play-img'>
  77. <image src='../../static/image/point.png'></image>
  78. </view>
  79. <text>赞</text>
  80. </view>
  81. </view>
  82. <view class='flower-count'>
  83. <view class='color'>{{ myData.user.pointAmount || 0 }}</view>
  84. <view class='border-right'>
  85. <view class='play-img'>
  86. <image src='../../static/image/flower.png'></image>
  87. </view>
  88. <text>红花</text>
  89. </view>
  90. </view>
  91. </view>
  92. <view class='wallet-module' bindtap='toMyWallet' data-title='{{ myData.wallet }}' wx:if="{{!myData.isIOS}}">
  93. <view class='wallet-center'>
  94. <view class='wallet-left'>
  95. <view class='icon-box'>
  96. <image src='../../static/image/wallet.png'></image>
  97. </view>
  98. <text>钱包</text>
  99. </view>
  100. <view class='wallet-right'>
  101. <image src='../../static/image/to.png'></image>
  102. </view>
  103. </view>
  104. </view>
  105. <view class='course-module' bindtap='toMyCourse' data-title='{{ myData.course }}'>
  106. <view class='wallet-center'>
  107. <view class='wallet-left'>
  108. <view class='icon-box'>
  109. <image src='../../static/image/courses.png'></image>
  110. </view>
  111. <text>我的课程</text>
  112. </view>
  113. <view class='wallet-right'>
  114. <image src='../../static/image/to.png'></image>
  115. </view>
  116. </view>
  117. </view>
  118. <view class='group-module' bindtap='toMyCollage' data-title='{{ myData.collage }}' wx:if="{{!myData.isIOS}}">
  119. <view class='wallet-center'>
  120. <view class='wallet-left'>
  121. <view class='icon-box'>
  122. <image src='../../static/image/group.png'></image>
  123. </view>
  124. <text>我的拼团</text>
  125. </view>
  126. <view class='wallet-right'>
  127. <image src='../../static/image/to.png'></image>
  128. </view>
  129. </view>
  130. </view>
  131. <view class='reading-module' bindtap='toMyRead' data-title='{{ myData.read }}'>
  132. <view class='wallet-center'>
  133. <view class='wallet-left'>
  134. <view class='icon-box'>
  135. <image src='../../static/image/record.png'></image>
  136. </view>
  137. <text>我的朗读</text>
  138. </view>
  139. <view class='wallet-right'>
  140. <image src='../../static/image/to.png'></image>
  141. </view>
  142. </view>
  143. </view>
  144. <view class='keep-module' bindtap='toMyKeep' data-title='{{ myData.keep }}'>
  145. <view class='wallet-center'>
  146. <view class='wallet-left'>
  147. <view class='icon-box'>
  148. <image src='../../static/image/keep.png'></image>
  149. </view>
  150. <text>我的收藏</text>
  151. </view>
  152. <view class='wallet-right'>
  153. <image src='../../static/image/to.png'></image>
  154. </view>
  155. </view>
  156. </view>
  157. <view class='myfollow-module' bindtap='toMyConcern' data-title='{{ myData.concern }}'>
  158. <view class='wallet-center'>
  159. <view class='wallet-left'>
  160. <view class='icon-box'>
  161. <image src='../../static/image/myfollow.png'></image>
  162. </view>
  163. <text>我的关注</text>
  164. </view>
  165. <view class='wallet-right'>
  166. <image src='../../static/image/to.png'></image>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. </template>