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

316 lines
6.5 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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>{{ riceInfo.canWithdraw }}
  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 list" :key="item.id" class="brokerage-item">
  42. <view class="brokerage-user">
  43. <image :src="item.headImage" mode="aspectFill" 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 class="time">
  52. 加入时间{{ item.createTime }}
  53. </view>
  54. </view>
  55. </view>
  56. <view class="brokerage-money">
  57. <view class="order-money">
  58. 下单量: <text>{{ item.orderNum }}</text>
  59. </view>
  60. <text>|</text>
  61. <view class="money">
  62. 佣金:<text>{{ item.commission }}</text>
  63. </view>
  64. </view>
  65. </view>
  66. <uv-empty mode="list" v-if="list.length == 0"></uv-empty>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import mixinsList from '@/mixins/list.js'
  72. import { mapState } from 'vuex'
  73. export default {
  74. name: "Partner",
  75. mixins: [mixinsList],
  76. data() {
  77. return {
  78. tabList: [{
  79. name: '直推用户'
  80. },
  81. {
  82. name: '间推用户'
  83. }
  84. ],
  85. state: 0,
  86. userRole: ['用户', '会员', '渠道'],
  87. mixinsListApi: 'getHanHaiMemberUser',
  88. }
  89. },
  90. computed : {
  91. ...mapState(['riceInfo']),
  92. },
  93. onLoad() {
  94. this.queryParams.state = this.state
  95. },
  96. onShow() {
  97. this.$store.commit('getRiceInfo')
  98. },
  99. methods: {
  100. //点击不同分类用户tab
  101. handleTabEvent(e) {
  102. this.state = e.index;
  103. this.queryParams.state = this.state
  104. this.getData();
  105. },
  106. //计算两个时间相差天数
  107. daysBetweenDates(dateString1, dateString2) {
  108. const date1 = new Date(dateString1.replace(/-/g, '/'));
  109. const date2 = new Date(dateString2.replace(/-/g, '/'));
  110. if (isNaN(date1) || isNaN(date2)) {
  111. throw new Error('Invalid date string');
  112. }
  113. const timeDifference = Math.abs(date2 - date1);
  114. const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
  115. return daysDifference;
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .partner {
  122. // 合伙人信息
  123. .partner-info-bg {
  124. background: $uni-color;
  125. padding: 60rpx 0rpx;
  126. .partner-info {
  127. display: flex;
  128. align-items: center;
  129. background: white;
  130. border-radius: 20rpx;
  131. box-sizing: border-box;
  132. padding: 20rpx;
  133. width: calc(100% - 40rpx);
  134. margin: 0rpx auto;
  135. .profile-photo {
  136. display: flex;
  137. justify-content: center;
  138. align-items: center;
  139. width: 25%;
  140. .pro-img {
  141. width: 170rpx;
  142. height: 170rpx;
  143. border-radius: 50%;
  144. }
  145. }
  146. .performance-information {
  147. width: 75%;
  148. padding: 0rpx 20rpx;
  149. box-sizing: border-box;
  150. .user-info-base {
  151. display: flex;
  152. flex-wrap: wrap;
  153. align-items: center;
  154. border-bottom: 2px dashed $uni-color;
  155. padding: 20rpx 0rpx;
  156. .username {
  157. font-size: 36rpx;
  158. }
  159. .user-tag {
  160. background: black;
  161. color: white;
  162. margin-left: 20rpx;
  163. border-radius: 20rpx;
  164. padding: 3rpx 20rpx;
  165. font-size: 28rpx;
  166. }
  167. }
  168. .live-performance {
  169. display: flex;
  170. flex-wrap: wrap;
  171. padding: 20rpx 0rpx;
  172. box-sizing: border-box;
  173. .live-performance-money {
  174. width: 50%;
  175. .live-tag {
  176. display: flex;
  177. align-items: center;
  178. justify-content: center;
  179. background: #F99F9F;
  180. color: #DC2828;
  181. border-radius: 40rpx;
  182. font-weight: bold;
  183. font-size: 28rpx;
  184. padding: 10rpx 0rpx;
  185. }
  186. .money {
  187. font-size: 45rpx;
  188. color: $uni-color;
  189. font-weight: bold;
  190. .unit {
  191. font-size: 32rpx;
  192. }
  193. }
  194. }
  195. .withdraw {
  196. display: flex;
  197. flex-direction: column;
  198. justify-content: center;
  199. align-items: flex-end;
  200. width: 50%;
  201. .btn {
  202. width: 90%;
  203. display: flex;
  204. align-items: center;
  205. justify-content: center;
  206. background: #DC2828;
  207. color: white;
  208. border-radius: 40rpx;
  209. padding: 20rpx 0rpx;
  210. font-weight: bold;
  211. font-size: 32rpx;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. .tabs {
  219. background: white;
  220. }
  221. // 佣金列表
  222. .brokerage-list {
  223. padding: 0rpx 20rpx;
  224. .brokerage-item {
  225. display: flex;
  226. align-items: center;
  227. flex-wrap: wrap;
  228. background: white;
  229. margin: 20rpx 0rpx;
  230. border-radius: 20rpx;
  231. padding: 20rpx;
  232. box-sizing: border-box;
  233. .brokerage-user {
  234. width: 50%;
  235. display: flex;
  236. align-items: center;
  237. flex-wrap: wrap;
  238. .pro-img {
  239. width: 100rpx;
  240. height: 100rpx;
  241. }
  242. .name-time {
  243. width: calc(100% - 100rpx);
  244. padding: 0rpx 20rpx;
  245. box-sizing: border-box;
  246. .name {
  247. font-size: 32rpx;
  248. white-space: nowrap;
  249. overflow: hidden;
  250. text-overflow: ellipsis;
  251. }
  252. .time {
  253. color: #999999;
  254. font-size: 26rpx;
  255. }
  256. }
  257. }
  258. .brokerage-money {
  259. width: 50%;
  260. display: flex;
  261. flex-wrap: wrap;
  262. justify-content: space-between;
  263. .order-money {
  264. text {
  265. margin-left: 10rpx;
  266. }
  267. }
  268. .money {
  269. text {
  270. color: #FEB814;
  271. margin-left: 10rpx;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. </style>