珠宝小程序前端代码
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.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
  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. },
  99. onShow() {
  100. this.$store.commit('getRiceInfo')
  101. },
  102. methods: {
  103. //点击不同分类用户tab
  104. handleTabEvent(e) {
  105. this.state = e.index;
  106. this.queryParams.state = this.state
  107. this.getData();
  108. },
  109. //计算两个时间相差天数
  110. daysBetweenDates(dateString1, dateString2) {
  111. const date1 = new Date(dateString1.replace(/-/g, '/'));
  112. const date2 = new Date(dateString2.replace(/-/g, '/'));
  113. if (isNaN(date1) || isNaN(date2)) {
  114. throw new Error('Invalid date string');
  115. }
  116. const timeDifference = Math.abs(date2 - date1);
  117. const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
  118. return daysDifference;
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .partner {
  125. // 合伙人信息
  126. .partner-info-bg {
  127. background: $uni-color;
  128. padding: 60rpx 0rpx;
  129. .partner-info {
  130. display: flex;
  131. align-items: center;
  132. background: white;
  133. border-radius: 20rpx;
  134. box-sizing: border-box;
  135. padding: 20rpx;
  136. width: calc(100% - 40rpx);
  137. margin: 0rpx auto;
  138. .profile-photo {
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. width: 25%;
  143. .pro-img {
  144. width: 170rpx;
  145. height: 170rpx;
  146. border-radius: 50%;
  147. }
  148. }
  149. .performance-information {
  150. width: 75%;
  151. padding: 0rpx 20rpx;
  152. box-sizing: border-box;
  153. .user-info-base {
  154. display: flex;
  155. flex-wrap: wrap;
  156. align-items: center;
  157. border-bottom: 2px dashed $uni-color;
  158. padding: 20rpx 0rpx;
  159. .username {
  160. font-size: 36rpx;
  161. }
  162. .user-tag {
  163. background: black;
  164. color: white;
  165. margin-left: 20rpx;
  166. border-radius: 20rpx;
  167. padding: 3rpx 20rpx;
  168. font-size: 28rpx;
  169. }
  170. }
  171. .live-performance {
  172. display: flex;
  173. flex-wrap: wrap;
  174. padding: 20rpx 0rpx;
  175. box-sizing: border-box;
  176. .live-performance-money {
  177. width: 50%;
  178. .live-tag {
  179. display: flex;
  180. align-items: center;
  181. justify-content: center;
  182. background: #F99F9F;
  183. color: #DC2828;
  184. border-radius: 40rpx;
  185. font-weight: bold;
  186. font-size: 28rpx;
  187. padding: 10rpx 0rpx;
  188. }
  189. .money {
  190. font-size: 45rpx;
  191. color: $uni-color;
  192. font-weight: bold;
  193. .unit {
  194. font-size: 32rpx;
  195. }
  196. }
  197. }
  198. .withdraw {
  199. display: flex;
  200. flex-direction: column;
  201. justify-content: center;
  202. align-items: flex-end;
  203. width: 50%;
  204. .btn {
  205. width: 90%;
  206. display: flex;
  207. align-items: center;
  208. justify-content: center;
  209. background: #DC2828;
  210. color: white;
  211. border-radius: 40rpx;
  212. padding: 20rpx 0rpx;
  213. font-weight: bold;
  214. font-size: 32rpx;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. .tabs {
  222. background: white;
  223. }
  224. // 佣金列表
  225. .brokerage-list {
  226. padding: 0rpx 20rpx;
  227. .brokerage-item {
  228. display: flex;
  229. align-items: center;
  230. background: white;
  231. margin: 20rpx 0rpx;
  232. border-radius: 20rpx;
  233. padding: 20rpx;
  234. box-sizing: border-box;
  235. .brokerage-user {
  236. display: flex;
  237. align-items: center;
  238. flex-wrap: wrap;
  239. .pro-img {
  240. width: 100rpx;
  241. height: 100rpx;
  242. }
  243. .name-time {
  244. width: calc(100% - 100rpx);
  245. padding: 0rpx 20rpx;
  246. box-sizing: border-box;
  247. .name {
  248. font-size: 32rpx;
  249. white-space: nowrap;
  250. overflow: hidden;
  251. text-overflow: ellipsis;
  252. }
  253. .time {
  254. color: #999999;
  255. font-size: 26rpx;
  256. }
  257. }
  258. }
  259. .brokerage-money {
  260. width: 260rpx;
  261. display: flex;
  262. justify-content: space-between;
  263. font-size: 24rpx;
  264. .order-money {
  265. text {
  266. margin-right: 5rpx;
  267. }
  268. }
  269. .money {
  270. text {
  271. color: #FEB814;
  272. margin-left: 5rpx;
  273. }
  274. }
  275. }
  276. }
  277. }
  278. }
  279. </style>