推拿小程序前端代码仓库
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.

254 lines
5.2 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="我的团队" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  5. <view class="card flex info">
  6. <image class="avatar" :src="userInfo.headImage" mode="aspectFill"></image>
  7. <view class="right">
  8. <view class="phone">{{ userInfo.phone }}</view>
  9. <view class="flex account">
  10. <view class="count">
  11. <view><text class="count-unit">¥</text>{{ riceInfo.canWithdraw }}</view>
  12. <view class="count-desc">推广佣金</view>
  13. </view>
  14. <button plain class="btn" @click="$utils.navigateTo('/pages_order/mine/withdraw')">去提现</button>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="list">
  19. <view class="list-header">
  20. <!-- todo: check -->
  21. <view class="list-header-title">
  22. <text>直推用户<text class="sub">1</text></text>
  23. <view class="list-header-title-line"></view>
  24. </view>
  25. <!-- <view class="tabs">
  26. <uv-tabs :activeStyle="{ color : '#DC2828' }" lineColor="#DC2828" :list="tabList"
  27. @click="handleTabEvent"></uv-tabs>
  28. </view> -->
  29. </view>
  30. <view class="list-content">
  31. <template v-if="list.length">
  32. <view class="card flex list-item" v-for="item in list" :key="item.id">
  33. <view class="left flex">
  34. <image class="avatar" :src="item.headImage" mode="aspectFill"></image>
  35. <view class="detail">
  36. <view class="row name">{{ item.nickName }}</view>
  37. <view class="row">{{ `下单时间:${item.createTime}` }}</view>
  38. <!-- todo: 对接接口字段 -->
  39. <view class="row">{{ `${item.projectNmae}${item.projectPrice}` }}</view>
  40. </view>
  41. </view>
  42. <view class="commission">{{ `+${item.commission}` }}</view>
  43. </view>
  44. </template>
  45. <template v-else>
  46. <uv-empty mode="list"></uv-empty>
  47. </template>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import mixinsList from '@/mixins/list.js'
  54. import { mapState } from 'vuex'
  55. export default {
  56. name: "Partner",
  57. mixins: [mixinsList],
  58. data() {
  59. return {
  60. tabList: [{
  61. name: '直推用户'
  62. },
  63. {
  64. name: '间推用户'
  65. }
  66. ],
  67. state: 0,
  68. userRole: ['会员', '用户', '渠道'],
  69. mixinsListApi: 'getHanHaiMemberUser',
  70. }
  71. },
  72. computed : {
  73. ...mapState(['riceInfo']),
  74. },
  75. onLoad() {
  76. this.queryParams.state = this.state
  77. },
  78. onShow() {
  79. this.$store.commit('getRiceInfo')
  80. },
  81. methods: {
  82. //点击不同分类用户tab
  83. handleTabEvent(e) {
  84. this.state = e.index;
  85. this.queryParams.state = this.state
  86. this.getData();
  87. },
  88. //计算两个时间相差天数
  89. daysBetweenDates(dateString1, dateString2) {
  90. const date1 = new Date(dateString1.replace(/-/g, '/'));
  91. const date2 = new Date(dateString2.replace(/-/g, '/'));
  92. if (isNaN(date1) || isNaN(date2)) {
  93. throw new Error('Invalid date string');
  94. }
  95. const timeDifference = Math.abs(date2 - date1);
  96. const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
  97. return daysDifference;
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .page {
  104. background-color: #F5F5F5;
  105. min-height: 100vh;
  106. position: relative;
  107. /deep/ .nav-bar__view {
  108. padding-bottom: 324rpx;
  109. background-image: linear-gradient(#84A73F, #D8FF8F);
  110. }
  111. }
  112. .info {
  113. position: absolute;
  114. z-index: 999;
  115. transform: translateY(calc(-100% - 27rpx));
  116. box-sizing: border-box;
  117. width: calc(100% - 13rpx*2);
  118. padding: 0 33rpx 0 20rpx;
  119. margin: 0 13rpx;
  120. align-items: flex-start;
  121. .avatar {
  122. width: 145rpx;
  123. height: 145rpx;
  124. margin: 46rpx 20rpx 26rpx 0;
  125. }
  126. .phone {
  127. color: #000000;
  128. font-size: 28rpx;
  129. }
  130. .account {
  131. border-top: 1rpx dashed #707070;
  132. align-items: flex-start;
  133. justify-content: space-between;
  134. padding: 23rpx 7rpx 15rpx 26rpx;
  135. .count {
  136. color: #FF2A2A;
  137. font-size: 32rpx;
  138. font-weight: 700;
  139. &-unit {
  140. font-size: 15rpx;
  141. }
  142. &-desc {
  143. color: #666666;
  144. font-size: 22rpx;
  145. margin-top: 9rpx;
  146. margin-left: 2rpx;
  147. }
  148. }
  149. .btn {
  150. display: inline-block;
  151. padding: 14rpx 47rpx;
  152. color: $uni-text-color-inverse;
  153. font-size: 28rpx;
  154. line-height: 40rpx;
  155. border-radius: 34rpx;
  156. border: none;
  157. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  158. }
  159. }
  160. .right {
  161. flex: 1;
  162. padding-top: 52rpx;
  163. }
  164. }
  165. .list {
  166. &-header {
  167. background-color: $uni-fg-color;
  168. padding: 0 48rpx;
  169. &-title {
  170. color: #000000;
  171. font-size: 28rpx;
  172. padding: 33rpx 0 17rpx 0;
  173. position: relative;
  174. .sub {
  175. color: #84A73F;
  176. font-size: 22rpx;
  177. }
  178. &-line {
  179. position: absolute;
  180. left: 6rpx;
  181. bottom: 0;
  182. width: 92rpx;
  183. height: 5rpx;
  184. border-radius: 3rpx;
  185. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  186. }
  187. }
  188. }
  189. &-content {
  190. padding: 7rpx 13rpx;
  191. .left {
  192. flex: 1;
  193. }
  194. }
  195. &-item {
  196. margin-top: 8rpx;
  197. padding: 0 40rpx 0 18rpx;
  198. .avatar {
  199. width: 82rpx;
  200. height: 82rpx;
  201. border-radius: 50%;
  202. }
  203. .detail {
  204. flex: 1;
  205. margin: 9rpx 0 7rpx 13rpx;
  206. color: #999999;
  207. font-size: 18rpx;
  208. }
  209. .row + .row {
  210. margin-top: 4rpx;
  211. }
  212. .name {
  213. color: #000000;
  214. font-size: 26rpx;
  215. }
  216. .commission {
  217. color: #FF2A2A;
  218. font-size: 22rpx;
  219. }
  220. }
  221. }
  222. </style>