珠宝小程序前端代码
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.

317 lines
6.6 KiB

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