敢为人鲜小程序前端代码仓库
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.

312 lines
6.3 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <!-- 合伙人页面 -->
  2. <template>
  3. <view class="partner">
  4. <!-- 导航栏 -->
  5. <navbar title="合伙人" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" />
  6. <!-- 合伙人信息 -->
  7. <view class="partner-info-bg">
  8. <view class="partner-info">
  9. <view class="profile-photo">
  10. <image :src="userInfo.headImage" mode="aspectFill" class="pro-img"></image>
  11. </view>
  12. <view class="performance-information">
  13. <view class="user-info-base">
  14. <view class="username">{{ userInfo.phone }}</view>
  15. <view class="user-tag">{{ userRole[userInfo.isPay] }}</view>
  16. </view>
  17. <view class="live-performance">
  18. <view class="live-performance-money">
  19. <view class="live-tag">
  20. 直推及间推业绩
  21. </view>
  22. <view class="money">
  23. <text class="unit"></text>666
  24. </view>
  25. </view>
  26. <view class="withdraw">
  27. <view @click="$utils.navigateTo('/pages_order/mine/withdraw')" class="btn">
  28. 去提现
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="tabs">
  36. <uv-tabs :activeStyle="{ color : '#DC2828' }" lineColor="#DC2828" :list="tabList"
  37. @click="handleTabEvent"></uv-tabs>
  38. </view>
  39. <!-- 佣金列表 -->
  40. <view class="brokerage-list">
  41. <view v-for="item in users" :key="item.id" class="brokerage-item">
  42. <view class="brokerage-user">
  43. <image :src="item.headImage" mode="widthFix" class="pro-img"></image>
  44. <view class="name-time">
  45. <view class="name">
  46. {{ item.nickName }}
  47. </view>
  48. <view class="time">
  49. 已加入平台{{ daysBetweenDates(item.createTime,new Date().toString())}}
  50. </view>
  51. </view>
  52. </view>
  53. <view class="brokerage-money">
  54. <view class="order-money">
  55. 下单量: <text>666</text>
  56. </view>
  57. <text>|</text>
  58. <view class="money">
  59. 佣金:<text>666</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. name: "Partner",
  69. data() {
  70. return {
  71. tabList: [{
  72. name: '直推用户'
  73. },
  74. {
  75. name: '间推用户'
  76. }
  77. ],
  78. state: 0,
  79. users: [],
  80. userRole: ['会员', '用户', '渠道']
  81. }
  82. },
  83. onShow() {
  84. this.getCommonUser()
  85. },
  86. methods: {
  87. //获取合伙人人信息
  88. getCommonUser() {
  89. this.$api('getHanHaiMemberUser', {
  90. stete: this.state
  91. }, res => {
  92. if (res.code == 200) {
  93. this.users = res?.result?.records
  94. }
  95. })
  96. },
  97. //点击不同分类用户tab
  98. handleTabEvent(e) {
  99. this.state = e.index;
  100. this.getCommonUser();
  101. },
  102. //计算两个时间相差天数
  103. daysBetweenDates(dateString1, dateString2) {
  104. const date1 = new Date(dateString1.replace(/-/g, '/'));
  105. const date2 = new Date(dateString2.replace(/-/g, '/'));
  106. if (isNaN(date1) || isNaN(date2)) {
  107. throw new Error('Invalid date string');
  108. }
  109. const timeDifference = Math.abs(date2 - date1);
  110. const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
  111. return daysDifference;
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .partner {
  118. // 合伙人信息
  119. .partner-info-bg {
  120. background: $uni-color;
  121. padding: 60rpx 0rpx;
  122. .partner-info {
  123. display: flex;
  124. align-items: center;
  125. background: white;
  126. border-radius: 20rpx;
  127. box-sizing: border-box;
  128. padding: 20rpx;
  129. width: calc(100% - 40rpx);
  130. margin: 0rpx auto;
  131. .profile-photo {
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. width: 25%;
  136. .pro-img {
  137. width: 170rpx;
  138. height: 170rpx;
  139. border-radius: 50%;
  140. }
  141. }
  142. .performance-information {
  143. width: 75%;
  144. padding: 0rpx 20rpx;
  145. box-sizing: border-box;
  146. .user-info-base {
  147. display: flex;
  148. flex-wrap: wrap;
  149. align-items: center;
  150. border-bottom: 2px dashed $uni-color;
  151. padding: 20rpx 0rpx;
  152. .username {
  153. font-size: 36rpx;
  154. }
  155. .user-tag {
  156. background: black;
  157. color: white;
  158. margin-left: 20rpx;
  159. border-radius: 20rpx;
  160. padding: 3rpx 20rpx;
  161. font-size: 28rpx;
  162. }
  163. }
  164. .live-performance {
  165. display: flex;
  166. flex-wrap: wrap;
  167. padding: 20rpx 0rpx;
  168. box-sizing: border-box;
  169. .live-performance-money {
  170. width: 50%;
  171. .live-tag {
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. background: #F99F9F;
  176. color: #DC2828;
  177. border-radius: 40rpx;
  178. font-weight: bold;
  179. font-size: 28rpx;
  180. padding: 10rpx 0rpx;
  181. }
  182. .money {
  183. font-size: 45rpx;
  184. color: $uni-color;
  185. font-weight: bold;
  186. .unit {
  187. font-size: 32rpx;
  188. }
  189. }
  190. }
  191. .withdraw {
  192. display: flex;
  193. flex-direction: column;
  194. justify-content: center;
  195. align-items: flex-end;
  196. width: 50%;
  197. .btn {
  198. width: 90%;
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. background: #DC2828;
  203. color: white;
  204. border-radius: 40rpx;
  205. padding: 20rpx 0rpx;
  206. font-weight: bold;
  207. font-size: 32rpx;
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. .tabs {
  215. background: white;
  216. }
  217. // 佣金列表
  218. .brokerage-list {
  219. padding: 0rpx 20rpx;
  220. .brokerage-item {
  221. display: flex;
  222. align-items: center;
  223. flex-wrap: wrap;
  224. background: white;
  225. margin: 20rpx 0rpx;
  226. border-radius: 20rpx;
  227. padding: 20rpx;
  228. box-sizing: border-box;
  229. .brokerage-user {
  230. width: 50%;
  231. display: flex;
  232. align-items: center;
  233. flex-wrap: wrap;
  234. .pro-img {
  235. width: 100rpx;
  236. height: 100rpx;
  237. }
  238. .name-time {
  239. width: calc(100% - 100rpx);
  240. padding: 0rpx 20rpx;
  241. box-sizing: border-box;
  242. .name {
  243. font-size: 32rpx;
  244. white-space: nowrap;
  245. overflow: hidden;
  246. text-overflow: ellipsis;
  247. }
  248. .time {
  249. color: #999999;
  250. font-size: 26rpx;
  251. }
  252. }
  253. }
  254. .brokerage-money {
  255. width: 50%;
  256. display: flex;
  257. flex-wrap: wrap;
  258. justify-content: space-between;
  259. .order-money {
  260. text {
  261. margin-left: 10rpx;
  262. }
  263. }
  264. .money {
  265. text {
  266. color: #FEB814;
  267. margin-left: 10rpx;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. </style>