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

344 lines
9.8 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="https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video"></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(${sliderBgUrl}) 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: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
  122. nickName: '裂变星1号',
  123. roleName: '普通会员',
  124. createDate: '2025年2月15日',
  125. createTime: '12:56:48',
  126. },
  127. {
  128. id: '002',
  129. avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
  130. nickName: '裂变星1号',
  131. roleName: '代理商',
  132. createDate: '2025年2月15日',
  133. createTime: '12:56:48',
  134. },
  135. {
  136. id: '003',
  137. avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
  138. nickName: '裂变星1号',
  139. roleName: '普通会员',
  140. createDate: '2025年2月15日',
  141. createTime: '12:56:48',
  142. },
  143. {
  144. id: '004',
  145. avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
  146. nickName: '裂变星1号',
  147. roleName: '代理商',
  148. createDate: '2025年2月15日',
  149. createTime: '12:56:48',
  150. },
  151. {
  152. id: '005',
  153. avatarUrl: 'https://thumbnail0.baidupcs.com/thumbnail/a4166d65fm1072cc3d763d59df8feb8a?fid=3983569511-250528-247083465710867&time=1742544000&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-8%2Bjq3Cl0GcBe8y3JIzmmJnNofiY%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8765802821729992500&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video',
  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. sliderBgUrl: 'https://thumbnail0.baidupcs.com/thumbnail/5128034cfj9ac619ca072da4706a6c90?fid=3983569511-250528-294545550145327&time=1742536800&rt=sh&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iqtAvQatpPXXyCeN8GEAHhPMHEM%3D&expires=8h&chkv=0&chkbd=0&chkpc=&dp-logid=8764190582084176609&dp-callid=0&file_type=0&size=c850_u580&quality=100&vuk=-&ft=video'
  173. }
  174. },
  175. onShow() {
  176. this.orderPage()
  177. },
  178. //滚动到屏幕底部
  179. onReachBottom() {
  180. if(this.queryParams.pageSize < this.recordList.total){
  181. this.queryParams.pageSize += 10
  182. this.orderPage()
  183. }
  184. },
  185. methods: {
  186. orderPage(){
  187. // todo
  188. return
  189. let queryParams = {
  190. ...this.queryParams,
  191. }
  192. if(this.state != -1){
  193. queryParams.state = this.state
  194. }
  195. this.$api('orderPage', queryParams, res => {
  196. if(res.code == 200){
  197. this.recordList = res.result
  198. }
  199. })
  200. },
  201. //点击tab栏
  202. clickTabs(index) {
  203. if (index == 0) {
  204. this.state = -1;
  205. } else {
  206. this.state = index - 1;
  207. }
  208. this.queryParams.pageSize = 10
  209. this.orderPage()
  210. },
  211. onRoleChange(role) {
  212. // todo
  213. // fetch list
  214. }
  215. },
  216. }
  217. </script>
  218. <style scoped lang="scss">
  219. .page {
  220. background-color: $uni-bg-color;
  221. }
  222. .content {
  223. padding: 20rpx;
  224. }
  225. .overview {
  226. & > .title {
  227. color: #1B1B1B;
  228. font-size: 24rpx;
  229. }
  230. .referrer {
  231. color: #999999;
  232. font-size: 24rpx;
  233. padding: 20rpx;
  234. margin-top: 20rpx;
  235. .avatar {
  236. width: 84rpx;
  237. height: 84rpx;
  238. border-radius: 50%;
  239. margin-right: 20rpx;
  240. }
  241. &-info {
  242. flex: 1;
  243. display: inline-flex;
  244. align-items: center;
  245. justify-content: space-between;
  246. }
  247. .nick-name {
  248. color: #1B1B1B;
  249. font-size: 32rpx;
  250. font-weight: 700;
  251. }
  252. .phone-label {
  253. color: #1B1B1B;
  254. text-align: right;
  255. }
  256. }
  257. .summary {
  258. margin-top: 20rpx;
  259. position: relative;
  260. width: 100%;
  261. height: 373rpx;
  262. color: #04D6A3;
  263. & > .bg {
  264. width: 100%;
  265. height: 100%;
  266. }
  267. &-info {
  268. position: absolute;
  269. top: 0;
  270. left: 0;
  271. justify-content: space-between;
  272. width: 100%;
  273. height: 100%;
  274. padding: 32rpx 78rpx;
  275. box-sizing: border-box;
  276. &-detail {
  277. width: 100%;
  278. justify-content: space-between;
  279. }
  280. }
  281. .label {
  282. font-size: 24rpx;
  283. font-weight: 500;
  284. }
  285. .value {
  286. font-size: 78rpx;
  287. font-weight: 900;
  288. }
  289. }
  290. }
  291. .card {
  292. margin-top: 20rpx;
  293. }
  294. .list {
  295. &-item {
  296. color: #999999;
  297. font-size: 24rpx;
  298. .left {
  299. align-items: flex-start;
  300. }
  301. .right {
  302. align-items: flex-end;
  303. }
  304. .highlight {
  305. color: #1B1B1B;
  306. font-size: 32rpx;
  307. font-weight: 800;
  308. }
  309. .avatar {
  310. width: 84rpx;
  311. height: 84rpx;
  312. border-radius: 50%;
  313. margin-right: 20rpx;
  314. }
  315. }
  316. }
  317. </style>