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

457 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. onLoad() {
  105. if(uni.getStorageSync('token')){
  106. this.$store.commit('getUserInfo')
  107. }
  108. },
  109. onShow() {
  110. // todo: refresh is partner?
  111. },
  112. methods: {
  113. // todo: delete
  114. getData() {
  115. this.list = [
  116. {
  117. id: '001',
  118. avatar: '/pages_order/static/temp-30.png',
  119. name: '李世海',
  120. price: 10,
  121. createTime: '2025-07-15',
  122. },
  123. {
  124. id: '002',
  125. avatar: '/pages_order/static/temp-30.png',
  126. name: '周静',
  127. price: 10,
  128. createTime: '2025-07-15',
  129. },
  130. {
  131. id: '003',
  132. avatar: '/pages_order/static/temp-30.png',
  133. name: '周海',
  134. price: 10,
  135. createTime: '2025-07-15',
  136. },
  137. {
  138. id: '004',
  139. avatar: '/pages_order/static/temp-30.png',
  140. name: '冯启彬',
  141. price: 10,
  142. createTime: '2025-07-15',
  143. },
  144. {
  145. id: '005',
  146. avatar: '/pages_order/static/temp-30.png',
  147. name: '李娉',
  148. price: 10,
  149. createTime: '2025-07-15',
  150. },
  151. {
  152. id: '006',
  153. avatar: '/pages_order/static/temp-30.png',
  154. name: '李书萍',
  155. price: 10,
  156. createTime: '2025-07-15',
  157. },
  158. {
  159. id: '007',
  160. avatar: '/pages_order/static/temp-30.png',
  161. name: '李世海',
  162. price: 10,
  163. createTime: '2025-07-15',
  164. },
  165. {
  166. id: '008',
  167. avatar: '/pages_order/static/temp-30.png',
  168. name: '周静',
  169. price: 10,
  170. createTime: '2025-07-15',
  171. },
  172. {
  173. id: '009',
  174. avatar: '/pages_order/static/temp-30.png',
  175. name: '周海',
  176. price: 10,
  177. createTime: '2025-07-15',
  178. },
  179. {
  180. id: '010',
  181. avatar: '/pages_order/static/temp-30.png',
  182. name: '冯启彬',
  183. price: 10,
  184. createTime: '2025-07-15',
  185. },
  186. {
  187. id: '011',
  188. avatar: '/pages_order/static/temp-30.png',
  189. name: '李娉',
  190. price: 10,
  191. createTime: '2025-07-15',
  192. },
  193. {
  194. id: '012',
  195. avatar: '/pages_order/static/temp-30.png',
  196. name: '李书萍',
  197. price: 10,
  198. createTime: '2025-07-15',
  199. },
  200. ]
  201. },
  202. onApplyPartner() {
  203. this.$utils.navigateTo(`/pages_order/partner/apply`)
  204. },
  205. jumpToTeam() {
  206. this.$utils.navigateTo(`/pages_order/partner/team`)
  207. },
  208. openPosterPopup() {
  209. this.$refs.posterPopup.open()
  210. },
  211. jumpToWithdraw() {
  212. this.$utils.navigateTo(`/pages_order/partner/withdraw`)
  213. },
  214. },
  215. }
  216. </script>
  217. <style scoped lang="scss">
  218. @import '../../components/member/styles/tag.scss';
  219. .page__view {
  220. min-height: 100vh;
  221. background: linear-gradient(to right, #21FEEC, #019AF9);
  222. /deep/ .nav-bar__view {
  223. position: fixed;
  224. top: 0;
  225. left: 0;
  226. }
  227. .icon-nav {
  228. width: 168rpx;
  229. height: auto;
  230. }
  231. /deep/ .tabbar-box {
  232. height: auto;
  233. padding-bottom: 0;
  234. }
  235. }
  236. .main {
  237. // min-height: 100vh;
  238. // padding: calc(var(--status-bar-height) + 130rpx) 0 calc(120rpx + env(safe-area-inset-bottom)) 0;
  239. padding-top: calc(var(--status-bar-height) + 130rpx);
  240. box-sizing: border-box;
  241. }
  242. .advantage {
  243. padding: 0 40rpx 32rpx 40rpx;
  244. &-content {
  245. justify-content: space-between;
  246. padding: 16rpx;
  247. background: #1FB2FD99;
  248. border: 2rpx solid #FFFFFF4D;
  249. border-radius: 16rpx;
  250. }
  251. &-item {
  252. column-gap: 8rpx;
  253. padding-right: 16rpx;
  254. font-size: 26rpx;
  255. color: #FFFFFF;
  256. .icon {
  257. width: 40rpx;
  258. height: auto;
  259. }
  260. }
  261. }
  262. .card {
  263. width: 100%;
  264. // height: 100%;
  265. $advantage-height: 54px;
  266. // min-height: calc(100vh - #{$advantage-height} - (var(--status-bar-height) + 130rpx) - (120rpx + env(safe-area-inset-bottom)));
  267. min-height: calc(100vh - #{$advantage-height} - (var(--status-bar-height) + 130rpx));
  268. padding: 40rpx;
  269. padding-bottom: calc(40rpx + 120rpx + env(safe-area-inset-bottom));
  270. box-sizing: border-box;
  271. font-family: PingFang SC;
  272. font-weight: 400;
  273. line-height: 1.4;
  274. background: linear-gradient(#DAF3FF, #FBFEFF 400rpx, #FBFEFF);
  275. border: 2rpx solid #FFFFFF;
  276. border-top-left-radius: 48rpx;
  277. border-top-right-radius: 48rpx;
  278. }
  279. .user {
  280. justify-content: space-between;
  281. padding: 32rpx 40rpx;
  282. background: linear-gradient(#DAF3FF, #FBFEFF 70%, #FBFEFF);
  283. border: 2rpx solid #FFFFFF;
  284. border-radius: 48rpx;
  285. column-gap: 24rpx;
  286. .avatar {
  287. flex: none;
  288. position: relative;
  289. width: 128rpx;
  290. height: 128rpx;
  291. border-radius: 24rpx;
  292. overflow: hidden;
  293. .img {
  294. width: 100%;
  295. height: 100%;
  296. }
  297. }
  298. .summary {
  299. flex: 1;
  300. column-gap: 26rpx;
  301. &-item {
  302. flex: 1;
  303. row-gap: 8rpx;
  304. &.name {
  305. flex: none;
  306. align-items: flex-start;
  307. }
  308. &.operate {
  309. justify-content: flex-end;
  310. }
  311. &-content {
  312. font-size: 32rpx;
  313. font-weight: 600;
  314. color: #000000;
  315. }
  316. &-label {
  317. font-size: 24rpx;
  318. color: #939393;
  319. }
  320. }
  321. }
  322. .btn {
  323. padding: 8rpx 24rpx;
  324. font-size: 28rpx;
  325. font-weight: 500;
  326. line-height: 1.4;
  327. color: #FFFFFF;
  328. background: linear-gradient(to right, #21FEEC, #019AF9);
  329. border-radius: 28rpx;
  330. }
  331. }
  332. .btn-apply {
  333. margin-top: 32rpx;
  334. width: 100%;
  335. height: auto;
  336. padding: 0;
  337. background: none;
  338. font-size: 0;
  339. .bg {
  340. width: 100%;
  341. height: auto;
  342. }
  343. }
  344. .bar {
  345. margin-top: 24rpx;
  346. flex-wrap: nowrap;
  347. padding: 16rpx 24rpx;
  348. .col {
  349. flex: none;
  350. }
  351. .divider {
  352. flex: 1;
  353. .line {
  354. width: 2rpx;
  355. height: 44rpx;
  356. background: #00A9FF;
  357. }
  358. }
  359. .btn {
  360. column-gap: 8rpx;
  361. font-size: 24rpx;
  362. color: #181818;
  363. .icon {
  364. width: 64rpx;
  365. height: auto;
  366. }
  367. }
  368. }
  369. .list {
  370. margin-top: 32rpx;
  371. background: #FFFFFF;
  372. border: 2rpx solid #F0F0F0;
  373. border-radius: 24rpx;
  374. overflow: hidden;
  375. &-item {
  376. margin-top: 16rpx;
  377. padding: 16rpx 32rpx;
  378. font-size: 28rpx;
  379. color: #333333;
  380. background: #FFFFFF;
  381. border-bottom: 2rpx solid #F1F1F1;
  382. &:last-child {
  383. border: none;
  384. }
  385. .col {
  386. flex: 1;
  387. text-align: center;
  388. }
  389. .info {
  390. justify-content: flex-start;
  391. column-gap: 24rpx;
  392. .avatar {
  393. width: 72rpx;
  394. height: 72rpx;
  395. border-radius: 50%;
  396. overflow: hidden;
  397. .img {
  398. width: 100%;
  399. height: 100%;
  400. }
  401. }
  402. }
  403. .desc {
  404. font-size: 26rpx;
  405. color: #A3A3A3;
  406. }
  407. }
  408. }
  409. </style>