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

472 lines
9.3 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
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. <template v-if="false">
  51. <!-- 列表 -->
  52. <view class="brokerage-list">
  53. <view v-for="item in list" :key="item.id" class="brokerage-item">
  54. <view class="brokerage-user">
  55. <image :src="item.headImage" mode="aspectFill" class="pro-img"></image>
  56. <view class="name-time">
  57. <view class="name">
  58. {{ item.nickName }}
  59. </view>
  60. <!-- <view class="time">
  61. 已加入平台{{ daysBetweenDates(item.createTime,new Date().toString())}}
  62. </view> -->
  63. <view class="time">
  64. 加入时间{{ item.createTime }}
  65. </view>
  66. </view>
  67. </view>
  68. <view class="brokerage-money">
  69. <view class="order-money">
  70. 下单量: <text>{{ item.orderNum }}</text>
  71. </view>
  72. <text>|</text>
  73. <view class="money">
  74. 佣金:<text>{{ item.commission }}</text>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. </view>
  81. </template>
  82. <script>
  83. import mixinsList from '@/mixins/list.js'
  84. import { mapState } from 'vuex'
  85. export default {
  86. name: "Partner",
  87. mixins: [mixinsList],
  88. data() {
  89. return {
  90. tabList: [{
  91. name: '直推用户'
  92. },
  93. {
  94. name: '间推用户'
  95. }
  96. ],
  97. state: 0,
  98. userRole: ['会员', '用户', '渠道'],
  99. mixinsListApi: 'getHanHaiMemberUser',
  100. }
  101. },
  102. computed : {
  103. ...mapState(['riceInfo']),
  104. },
  105. onLoad() {
  106. this.queryParams.state = this.state
  107. },
  108. onShow() {
  109. this.$store.commit('getRiceInfo')
  110. },
  111. methods: {
  112. //点击不同分类用户tab
  113. handleTabEvent(e) {
  114. this.state = e.index;
  115. this.queryParams.state = this.state
  116. this.getData();
  117. },
  118. //计算两个时间相差天数
  119. daysBetweenDates(dateString1, dateString2) {
  120. const date1 = new Date(dateString1.replace(/-/g, '/'));
  121. const date2 = new Date(dateString2.replace(/-/g, '/'));
  122. if (isNaN(date1) || isNaN(date2)) {
  123. throw new Error('Invalid date string');
  124. }
  125. const timeDifference = Math.abs(date2 - date1);
  126. const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
  127. return daysDifference;
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. .page {
  134. background-color: #F5F5F5;
  135. min-height: 100vh;
  136. position: relative;
  137. /deep/ .nav-bar__view {
  138. padding-bottom: 324rpx;
  139. background-image: linear-gradient(#84A73F, #D8FF8F);
  140. }
  141. }
  142. .info {
  143. position: absolute;
  144. z-index: 999;
  145. transform: translateY(calc(-100% - 27rpx));
  146. box-sizing: border-box;
  147. width: calc(100% - 13rpx*2);
  148. padding: 0 33rpx 0 20rpx;
  149. margin: 0 13rpx;
  150. align-items: flex-start;
  151. .avatar {
  152. width: 145rpx;
  153. height: 145rpx;
  154. margin: 46rpx 20rpx 26rpx 0;
  155. }
  156. .phone {
  157. color: #000000;
  158. font-size: 28rpx;
  159. }
  160. .account {
  161. border-top: 1rpx dashed #707070;
  162. align-items: flex-start;
  163. justify-content: space-between;
  164. padding: 23rpx 7rpx 15rpx 26rpx;
  165. .count {
  166. color: #FF2A2A;
  167. font-size: 32rpx;
  168. font-weight: 700;
  169. &-unit {
  170. font-size: 15rpx;
  171. }
  172. &-desc {
  173. color: #666666;
  174. font-size: 22rpx;
  175. margin-top: 9rpx;
  176. margin-left: 2rpx;
  177. }
  178. }
  179. .btn {
  180. display: inline-block;
  181. padding: 14rpx 47rpx;
  182. color: $uni-text-color-inverse;
  183. font-size: 28rpx;
  184. line-height: 40rpx;
  185. border-radius: 34rpx;
  186. border: none;
  187. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  188. }
  189. }
  190. .right {
  191. flex: 1;
  192. padding-top: 52rpx;
  193. }
  194. }
  195. .list {
  196. &-header {
  197. background-color: $uni-fg-color;
  198. padding: 0 48rpx;
  199. &-title {
  200. color: #000000;
  201. font-size: 28rpx;
  202. padding: 33rpx 0 17rpx 0;
  203. position: relative;
  204. .sub {
  205. color: #84A73F;
  206. font-size: 22rpx;
  207. }
  208. &-line {
  209. position: absolute;
  210. left: 6rpx;
  211. bottom: 0;
  212. width: 92rpx;
  213. height: 5rpx;
  214. border-radius: 3rpx;
  215. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  216. }
  217. }
  218. }
  219. &-content {
  220. padding: 7rpx 13rpx;
  221. .left {
  222. flex: 1;
  223. }
  224. }
  225. &-item {
  226. margin-top: 8rpx;
  227. padding: 0 40rpx 0 18rpx;
  228. .avatar {
  229. width: 82rpx;
  230. height: 82rpx;
  231. border-radius: 50%;
  232. }
  233. .detail {
  234. flex: 1;
  235. margin: 9rpx 0 7rpx 13rpx;
  236. color: #999999;
  237. font-size: 18rpx;
  238. }
  239. .row + .row {
  240. margin-top: 4rpx;
  241. }
  242. .name {
  243. color: #000000;
  244. font-size: 26rpx;
  245. }
  246. .commission {
  247. color: #FF2A2A;
  248. font-size: 22rpx;
  249. }
  250. }
  251. }
  252. .partner {
  253. // 合伙人信息
  254. .partner-info-bg {
  255. background: $uni-color;
  256. padding: 60rpx 0rpx;
  257. .partner-info {
  258. display: flex;
  259. align-items: center;
  260. background: white;
  261. border-radius: 20rpx;
  262. box-sizing: border-box;
  263. padding: 20rpx;
  264. width: calc(100% - 40rpx);
  265. margin: 0rpx auto;
  266. .profile-photo {
  267. display: flex;
  268. justify-content: center;
  269. align-items: center;
  270. width: 25%;
  271. .pro-img {
  272. width: 170rpx;
  273. height: 170rpx;
  274. border-radius: 50%;
  275. }
  276. }
  277. .performance-information {
  278. width: 75%;
  279. padding: 0rpx 20rpx;
  280. box-sizing: border-box;
  281. .user-info-base {
  282. display: flex;
  283. flex-wrap: wrap;
  284. align-items: center;
  285. border-bottom: 2px dashed $uni-color;
  286. padding: 20rpx 0rpx;
  287. .username {
  288. font-size: 36rpx;
  289. }
  290. .user-tag {
  291. background: black;
  292. color: white;
  293. margin-left: 20rpx;
  294. border-radius: 20rpx;
  295. padding: 3rpx 20rpx;
  296. font-size: 28rpx;
  297. }
  298. }
  299. .live-performance {
  300. display: flex;
  301. flex-wrap: wrap;
  302. padding: 20rpx 0rpx;
  303. box-sizing: border-box;
  304. .live-performance-money {
  305. width: 50%;
  306. .live-tag {
  307. display: flex;
  308. align-items: center;
  309. justify-content: center;
  310. background: #F99F9F;
  311. color: #DC2828;
  312. border-radius: 40rpx;
  313. font-weight: bold;
  314. font-size: 28rpx;
  315. padding: 10rpx 0rpx;
  316. }
  317. .money {
  318. font-size: 45rpx;
  319. color: $uni-color;
  320. font-weight: bold;
  321. .unit {
  322. font-size: 32rpx;
  323. }
  324. }
  325. }
  326. .withdraw {
  327. display: flex;
  328. flex-direction: column;
  329. justify-content: center;
  330. align-items: flex-end;
  331. width: 50%;
  332. .btn {
  333. width: 90%;
  334. display: flex;
  335. align-items: center;
  336. justify-content: center;
  337. background: #DC2828;
  338. color: white;
  339. border-radius: 40rpx;
  340. padding: 20rpx 0rpx;
  341. font-weight: bold;
  342. font-size: 32rpx;
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. .tabs {
  350. background: white;
  351. }
  352. // 佣金列表
  353. .brokerage-list {
  354. padding: 0rpx 20rpx;
  355. .brokerage-item {
  356. display: flex;
  357. align-items: center;
  358. flex-wrap: wrap;
  359. background: white;
  360. margin: 20rpx 0rpx;
  361. border-radius: 20rpx;
  362. padding: 20rpx;
  363. box-sizing: border-box;
  364. .brokerage-user {
  365. width: 50%;
  366. display: flex;
  367. align-items: center;
  368. flex-wrap: wrap;
  369. .pro-img {
  370. width: 100rpx;
  371. height: 100rpx;
  372. }
  373. .name-time {
  374. width: calc(100% - 100rpx);
  375. padding: 0rpx 20rpx;
  376. box-sizing: border-box;
  377. .name {
  378. font-size: 32rpx;
  379. white-space: nowrap;
  380. overflow: hidden;
  381. text-overflow: ellipsis;
  382. }
  383. .time {
  384. color: #999999;
  385. font-size: 26rpx;
  386. }
  387. }
  388. }
  389. .brokerage-money {
  390. width: 50%;
  391. display: flex;
  392. flex-wrap: wrap;
  393. justify-content: space-between;
  394. .order-money {
  395. text {
  396. margin-left: 10rpx;
  397. }
  398. }
  399. .money {
  400. text {
  401. color: #FEB814;
  402. margin-left: 10rpx;
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. </style>