裂变星小程序-25.03.04
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.

343 lines
7.6 KiB

  1. <template>
  2. <view class="page">
  3. <navbar title="分销" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="content">
  5. <view class="overview">
  6. <view class="title">我的推荐人</view>
  7. <view class="card flex referrer">
  8. <!-- todo: 换回接口提供的 -->
  9. <image class="avatar" src="../static/temp-avatar.png"></image>
  10. <view class="referrer-info">
  11. <view>
  12. <view class="nick-name">裂变星1号</view>
  13. <view>{{ `ID:${12345678}` }}</view>
  14. </view>
  15. <view>
  16. <view class="phone-label">手机号</view>
  17. <view>15234567891</view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="summary">
  22. <image class="bg" src="../static/center/overview-bg.png"></image>
  23. <view class="flex flex-column summary-info">
  24. <!-- todo: 换回接口提供的 -->
  25. <view class="flex summary-info-total">
  26. <view class="flex flex-column">
  27. <view class="value">100</view>
  28. <view class="label">推荐总人数</view>
  29. </view>
  30. </view>
  31. <view class="flex summary-info-detail">
  32. <view class="flex flex-column">
  33. <view class="label">直接推荐</view>
  34. <view class="value">90</view>
  35. </view>
  36. <view class="flex flex-column">
  37. <view class="label">间接推荐</view>
  38. <view class="value">10</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="card" style="padding: 20rpx 10rpx 11rpx 0;">
  45. <uv-tabs :list="tabs"
  46. :inactiveStyle="{
  47. color: '#999999',
  48. fontSize: '30rpx',
  49. fontWeight: 500,
  50. whiteSpace: 'nowrap',
  51. }"
  52. :activeStyle="{
  53. color: '#1B1B1B',
  54. fontSize: '38rpx',
  55. fontWeight: 900,
  56. whiteSpace: 'nowrap',
  57. }"
  58. lineHeight="13rpx"
  59. lineWidth="77rpx"
  60. :lineColor="`url('../../static/image/record/slider.png') 100% 100%`"
  61. :scrollable="false"
  62. @click="clickTabs"
  63. >
  64. <template v-slot:right>
  65. <suspendDropdown
  66. v-model="queryParams.role"
  67. :options="roleOptions"
  68. @change="onRoleChange"
  69. ></suspendDropdown>
  70. </template>
  71. </uv-tabs>
  72. </view>
  73. <view class="card flex list-item"
  74. v-for="item in recordList.records"
  75. :key="item.id"
  76. >
  77. <image class="avatar" :src="item.avatarUrl"></image>
  78. <view class="flex" style="flex: 1; justify-content: space-between;">
  79. <view class="flex flex-column left">
  80. <view class="highlight">{{ item.nickName }}</view>
  81. <view>{{ item.roleName }}</view>
  82. </view>
  83. <view class="flex flex-column right">
  84. <view>{{ item.createTime }}</view>
  85. <view>{{ item.createDate }}</view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import suspendDropdown from '@/components/base/suspendDropdown.vue'
  94. export default {
  95. components: {
  96. suspendDropdown,
  97. },
  98. data() {
  99. return {
  100. tabs: [{
  101. name: '直接推荐'
  102. },
  103. {
  104. name: '间接推荐'
  105. },
  106. ],
  107. roleOptions: [
  108. {
  109. label: '普通会员',
  110. value: 0,
  111. },
  112. {
  113. label: '代理商',
  114. value: 1,
  115. },
  116. ],
  117. recordList: {
  118. records: [
  119. {
  120. id: '001',
  121. avatarUrl: '../static/temp-avatar.png',
  122. nickName: '裂变星1号',
  123. roleName: '普通会员',
  124. createDate: '2025年2月15日',
  125. createTime: '12:56:48',
  126. },
  127. {
  128. id: '002',
  129. avatarUrl: '../static/temp-avatar.png',
  130. nickName: '裂变星1号',
  131. roleName: '代理商',
  132. createDate: '2025年2月15日',
  133. createTime: '12:56:48',
  134. },
  135. {
  136. id: '003',
  137. avatarUrl: '../static/temp-avatar.png',
  138. nickName: '裂变星1号',
  139. roleName: '普通会员',
  140. createDate: '2025年2月15日',
  141. createTime: '12:56:48',
  142. },
  143. {
  144. id: '004',
  145. avatarUrl: '../static/temp-avatar.png',
  146. nickName: '裂变星1号',
  147. roleName: '代理商',
  148. createDate: '2025年2月15日',
  149. createTime: '12:56:48',
  150. },
  151. {
  152. id: '005',
  153. avatarUrl: '../static/temp-avatar.png',
  154. nickName: '裂变星1号',
  155. roleName: '普通会员',
  156. createDate: '2025年2月15日',
  157. createTime: '12:56:48',
  158. },
  159. ],
  160. total: 0,
  161. },
  162. // recordList: {
  163. // records: [],
  164. // total: 0,
  165. // },
  166. state: -1,
  167. queryParams: {
  168. pageNo: 1,
  169. pageSize: 10,
  170. role: null,
  171. },
  172. }
  173. },
  174. onShow() {
  175. this.orderPage()
  176. },
  177. //滚动到屏幕底部
  178. onReachBottom() {
  179. if(this.queryParams.pageSize < this.recordList.total){
  180. this.queryParams.pageSize += 10
  181. this.orderPage()
  182. }
  183. },
  184. methods: {
  185. orderPage(){
  186. // todo
  187. return
  188. let queryParams = {
  189. ...this.queryParams,
  190. }
  191. if(this.state != -1){
  192. queryParams.state = this.state
  193. }
  194. this.$api('orderPage', queryParams, res => {
  195. if(res.code == 200){
  196. this.recordList = res.result
  197. }
  198. })
  199. },
  200. //点击tab栏
  201. clickTabs(index) {
  202. if (index == 0) {
  203. this.state = -1;
  204. } else {
  205. this.state = index - 1;
  206. }
  207. this.queryParams.pageSize = 10
  208. this.orderPage()
  209. },
  210. onRoleChange(role) {
  211. // todo
  212. // fetch list
  213. }
  214. },
  215. }
  216. </script>
  217. <style scoped lang="scss">
  218. .page {
  219. background-color: $uni-bg-color;
  220. }
  221. .content {
  222. padding: 20rpx;
  223. }
  224. .overview {
  225. & > .title {
  226. color: #1B1B1B;
  227. font-size: 24rpx;
  228. }
  229. .referrer {
  230. color: #999999;
  231. font-size: 24rpx;
  232. padding: 20rpx;
  233. margin-top: 20rpx;
  234. .avatar {
  235. width: 84rpx;
  236. height: 84rpx;
  237. border-radius: 50%;
  238. margin-right: 20rpx;
  239. }
  240. &-info {
  241. flex: 1;
  242. display: inline-flex;
  243. align-items: center;
  244. justify-content: space-between;
  245. }
  246. .nick-name {
  247. color: #1B1B1B;
  248. font-size: 32rpx;
  249. font-weight: 700;
  250. }
  251. .phone-label {
  252. color: #1B1B1B;
  253. text-align: right;
  254. }
  255. }
  256. .summary {
  257. margin-top: 20rpx;
  258. position: relative;
  259. width: 100%;
  260. height: 373rpx;
  261. color: #04D6A3;
  262. & > .bg {
  263. width: 100%;
  264. height: 100%;
  265. }
  266. &-info {
  267. position: absolute;
  268. top: 0;
  269. left: 0;
  270. justify-content: space-between;
  271. width: 100%;
  272. height: 100%;
  273. padding: 32rpx 78rpx;
  274. box-sizing: border-box;
  275. &-detail {
  276. width: 100%;
  277. justify-content: space-between;
  278. }
  279. }
  280. .label {
  281. font-size: 24rpx;
  282. font-weight: 500;
  283. }
  284. .value {
  285. font-size: 78rpx;
  286. font-weight: 900;
  287. }
  288. }
  289. }
  290. .card {
  291. margin-top: 20rpx;
  292. }
  293. .list {
  294. &-item {
  295. color: #999999;
  296. font-size: 24rpx;
  297. .left {
  298. align-items: flex-start;
  299. }
  300. .right {
  301. align-items: flex-end;
  302. }
  303. .highlight {
  304. color: #1B1B1B;
  305. font-size: 32rpx;
  306. font-weight: 800;
  307. }
  308. .avatar {
  309. width: 84rpx;
  310. height: 84rpx;
  311. border-radius: 50%;
  312. margin-right: 20rpx;
  313. }
  314. }
  315. }
  316. </style>