鸿宇研学生前端代码
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.

452 lines
11 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar>
  4. <image class="icon-nav" src="@/pages_order/static/partner/icon-nav.png" mode="widthFix"></image>
  5. </navbar>
  6. <view class="main">
  7. <view class="advantage">
  8. <view class="flex advantage-content">
  9. <view class="flex advantage-item" v-for="(item, aIdx) in advantages" :key="aIdx">
  10. <image class="icon" src="@/static/image/icon-checkmark-circle-fill.png" mode="widthFix"></image>
  11. <view>{{ item }}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="card">
  16. <view class="flex user">
  17. <view class="avatar">
  18. <image class="img" src="@/pages_order/static/temp-30.png" mode="scaleToFill"></image>
  19. <view :class="['tag', `tag-1`]">家长</view>
  20. </view>
  21. <view class="flex summary">
  22. <view class="flex flex-column summary-item name">
  23. <view class="summary-item-content">战斗世界</view>
  24. <view class="summary-item-label">ID5625354</view>
  25. </view>
  26. <template v-if="isPartner">
  27. <view class="flex flex-column summary-item" @click="jumpToAchievement">
  28. <view class="summary-item-content">888</view>
  29. <view class="summary-item-label">推广人数</view>
  30. </view>
  31. <view class="flex flex-column summary-item">
  32. <view class="summary-item-content">341</view>
  33. <view class="summary-item-label">总佣金</view>
  34. </view>
  35. </template>
  36. <template v-else>
  37. <view class="flex summary-item operate">
  38. <button class="btn" @click="onApplyPartner">成为合伙人</button>
  39. </view>
  40. </template>
  41. </view>
  42. </view>
  43. <view class="flex bar" v-if="isPartner">
  44. <button class="flex col btn" @click="jumpToTeam">
  45. <image class="icon" src="@/pages_order/static/partner/icon-team.png" mode="widthFix"></image>
  46. <view>我的团队</view>
  47. </button>
  48. <view class="flex divider">
  49. <view class="line"></view>
  50. </view>
  51. <button class="flex col btn" @click="openPosterPopup">
  52. <image class="icon" src="@/pages_order/static/partner/icon-qrcode.png" mode="widthFix"></image>
  53. <view>邀请二维码</view>
  54. </button>
  55. <view class="flex divider">
  56. <view class="line"></view>
  57. </view>
  58. <button class="flex col btn" @click="jumpToWithdraw">
  59. <image class="icon" src="@/pages_order/static/partner/icon-cash.png" mode="widthFix"></image>
  60. <view>提现</view>
  61. </button>
  62. </view>
  63. <!-- todo: check -->
  64. <button class="btn-apply" @click="onApplyPartner">
  65. <image class="bg" src="@/pages_order/static/partner/apply.png" mode="widthFix"></image>
  66. </button>
  67. <view class="list" v-if="isPartner && list.length">
  68. <view class="flex list-item" v-for="item in list" :key="item.id">
  69. <view class="flex col info">
  70. <view class="avatar">
  71. <image class="img" :src="item.avatar" mode="scaleToFill"></image>
  72. </view>
  73. <view>{{ item.name }}</view>
  74. </view>
  75. <view class="col price">{{ `${item.price}` }}</view>
  76. <view class="col desc">{{ item.createTime }}</view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <posterPopup ref="posterPopup"></posterPopup>
  82. <tabber select="partner" />
  83. </view>
  84. </template>
  85. <script>
  86. import mixinsList from '@/mixins/list.js'
  87. import tabber from '@/components/base/tabbar.vue'
  88. import posterPopup from '@/components/partner/posterPopup.vue'
  89. export default {
  90. mixins: [mixinsList],
  91. components: {
  92. tabber,
  93. posterPopup,
  94. },
  95. data() {
  96. return {
  97. advantages: ['收益高', '品类全', '到账快', '城市多'],
  98. // todo: fetch
  99. isPartner: true,
  100. // todo
  101. mixinsListApi: '',
  102. }
  103. },
  104. onShow() {
  105. // todo: refresh is partner?
  106. },
  107. methods: {
  108. // todo: delete
  109. getData() {
  110. this.list = [
  111. {
  112. id: '001',
  113. avatar: '/pages_order/static/temp-30.png',
  114. name: '李世海',
  115. price: 10,
  116. createTime: '2025-07-15',
  117. },
  118. {
  119. id: '002',
  120. avatar: '/pages_order/static/temp-30.png',
  121. name: '周静',
  122. price: 10,
  123. createTime: '2025-07-15',
  124. },
  125. {
  126. id: '003',
  127. avatar: '/pages_order/static/temp-30.png',
  128. name: '周海',
  129. price: 10,
  130. createTime: '2025-07-15',
  131. },
  132. {
  133. id: '004',
  134. avatar: '/pages_order/static/temp-30.png',
  135. name: '冯启彬',
  136. price: 10,
  137. createTime: '2025-07-15',
  138. },
  139. {
  140. id: '005',
  141. avatar: '/pages_order/static/temp-30.png',
  142. name: '李娉',
  143. price: 10,
  144. createTime: '2025-07-15',
  145. },
  146. {
  147. id: '006',
  148. avatar: '/pages_order/static/temp-30.png',
  149. name: '李书萍',
  150. price: 10,
  151. createTime: '2025-07-15',
  152. },
  153. {
  154. id: '007',
  155. avatar: '/pages_order/static/temp-30.png',
  156. name: '李世海',
  157. price: 10,
  158. createTime: '2025-07-15',
  159. },
  160. {
  161. id: '008',
  162. avatar: '/pages_order/static/temp-30.png',
  163. name: '周静',
  164. price: 10,
  165. createTime: '2025-07-15',
  166. },
  167. {
  168. id: '009',
  169. avatar: '/pages_order/static/temp-30.png',
  170. name: '周海',
  171. price: 10,
  172. createTime: '2025-07-15',
  173. },
  174. {
  175. id: '010',
  176. avatar: '/pages_order/static/temp-30.png',
  177. name: '冯启彬',
  178. price: 10,
  179. createTime: '2025-07-15',
  180. },
  181. {
  182. id: '011',
  183. avatar: '/pages_order/static/temp-30.png',
  184. name: '李娉',
  185. price: 10,
  186. createTime: '2025-07-15',
  187. },
  188. {
  189. id: '012',
  190. avatar: '/pages_order/static/temp-30.png',
  191. name: '李书萍',
  192. price: 10,
  193. createTime: '2025-07-15',
  194. },
  195. ]
  196. },
  197. onApplyPartner() {
  198. this.$utils.navigateTo(`/pages_order/partner/apply`)
  199. },
  200. jumpToTeam() {
  201. this.$utils.navigateTo(`/pages_order/partner/team`)
  202. },
  203. openPosterPopup() {
  204. this.$refs.posterPopup.open()
  205. },
  206. jumpToWithdraw() {
  207. this.$utils.navigateTo(`/pages_order/partner/withdraw`)
  208. },
  209. },
  210. }
  211. </script>
  212. <style scoped lang="scss">
  213. @import '../../components/member/styles/tag.scss';
  214. .page__view {
  215. min-height: 100vh;
  216. background: linear-gradient(to right, #21FEEC, #019AF9);
  217. /deep/ .nav-bar__view {
  218. position: fixed;
  219. top: 0;
  220. left: 0;
  221. }
  222. .icon-nav {
  223. width: 168rpx;
  224. height: auto;
  225. }
  226. /deep/ .tabbar-box {
  227. height: auto;
  228. padding-bottom: 0;
  229. }
  230. }
  231. .main {
  232. // min-height: 100vh;
  233. // padding: calc(var(--status-bar-height) + 130rpx) 0 calc(120rpx + env(safe-area-inset-bottom)) 0;
  234. padding-top: calc(var(--status-bar-height) + 130rpx);
  235. box-sizing: border-box;
  236. }
  237. .advantage {
  238. padding: 0 40rpx 32rpx 40rpx;
  239. &-content {
  240. justify-content: space-between;
  241. padding: 16rpx;
  242. background: #1FB2FD99;
  243. border: 2rpx solid #FFFFFF4D;
  244. border-radius: 16rpx;
  245. }
  246. &-item {
  247. column-gap: 8rpx;
  248. padding-right: 16rpx;
  249. font-size: 26rpx;
  250. color: #FFFFFF;
  251. .icon {
  252. width: 40rpx;
  253. height: auto;
  254. }
  255. }
  256. }
  257. .card {
  258. width: 100%;
  259. // height: 100%;
  260. $advantage-height: 54px;
  261. // min-height: calc(100vh - #{$advantage-height} - (var(--status-bar-height) + 130rpx) - (120rpx + env(safe-area-inset-bottom)));
  262. min-height: calc(100vh - #{$advantage-height} - (var(--status-bar-height) + 130rpx));
  263. padding: 40rpx;
  264. padding-bottom: calc(40rpx + 120rpx + env(safe-area-inset-bottom));
  265. box-sizing: border-box;
  266. font-family: PingFang SC;
  267. font-weight: 400;
  268. line-height: 1.4;
  269. background: linear-gradient(#DAF3FF, #FBFEFF 400rpx, #FBFEFF);
  270. border: 2rpx solid #FFFFFF;
  271. border-top-left-radius: 48rpx;
  272. border-top-right-radius: 48rpx;
  273. }
  274. .user {
  275. justify-content: space-between;
  276. padding: 32rpx 40rpx;
  277. background: linear-gradient(#DAF3FF, #FBFEFF 70%, #FBFEFF);
  278. border: 2rpx solid #FFFFFF;
  279. border-radius: 48rpx;
  280. column-gap: 24rpx;
  281. .avatar {
  282. flex: none;
  283. position: relative;
  284. width: 128rpx;
  285. height: 128rpx;
  286. border-radius: 24rpx;
  287. overflow: hidden;
  288. .img {
  289. width: 100%;
  290. height: 100%;
  291. }
  292. }
  293. .summary {
  294. flex: 1;
  295. column-gap: 26rpx;
  296. &-item {
  297. flex: 1;
  298. row-gap: 8rpx;
  299. &.name {
  300. flex: none;
  301. align-items: flex-start;
  302. }
  303. &.operate {
  304. justify-content: flex-end;
  305. }
  306. &-content {
  307. font-size: 32rpx;
  308. font-weight: 600;
  309. color: #000000;
  310. }
  311. &-label {
  312. font-size: 24rpx;
  313. color: #939393;
  314. }
  315. }
  316. }
  317. .btn {
  318. padding: 8rpx 24rpx;
  319. font-size: 28rpx;
  320. font-weight: 500;
  321. line-height: 1.4;
  322. color: #FFFFFF;
  323. background: linear-gradient(to right, #21FEEC, #019AF9);
  324. border-radius: 28rpx;
  325. }
  326. }
  327. .btn-apply {
  328. margin-top: 32rpx;
  329. width: 100%;
  330. height: auto;
  331. padding: 0;
  332. background: none;
  333. font-size: 0;
  334. .bg {
  335. width: 100%;
  336. height: auto;
  337. }
  338. }
  339. .bar {
  340. margin-top: 24rpx;
  341. flex-wrap: nowrap;
  342. padding: 16rpx 24rpx;
  343. .col {
  344. flex: none;
  345. }
  346. .divider {
  347. flex: 1;
  348. .line {
  349. width: 2rpx;
  350. height: 44rpx;
  351. background: #00A9FF;
  352. }
  353. }
  354. .btn {
  355. column-gap: 8rpx;
  356. font-size: 24rpx;
  357. color: #181818;
  358. .icon {
  359. width: 64rpx;
  360. height: auto;
  361. }
  362. }
  363. }
  364. .list {
  365. margin-top: 32rpx;
  366. background: #FFFFFF;
  367. border: 2rpx solid #F0F0F0;
  368. border-radius: 24rpx;
  369. overflow: hidden;
  370. &-item {
  371. margin-top: 16rpx;
  372. padding: 16rpx 32rpx;
  373. font-size: 28rpx;
  374. color: #333333;
  375. background: #FFFFFF;
  376. border-bottom: 2rpx solid #F1F1F1;
  377. &:last-child {
  378. border: none;
  379. }
  380. .col {
  381. flex: 1;
  382. text-align: center;
  383. }
  384. .info {
  385. justify-content: flex-start;
  386. column-gap: 24rpx;
  387. .avatar {
  388. width: 72rpx;
  389. height: 72rpx;
  390. border-radius: 50%;
  391. overflow: hidden;
  392. .img {
  393. width: 100%;
  394. height: 100%;
  395. }
  396. }
  397. }
  398. .desc {
  399. font-size: 26rpx;
  400. color: #A3A3A3;
  401. }
  402. }
  403. }
  404. </style>