You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 7.4 kB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <div class="ui container">
  3. <div class="title">
  4. <div class="title-1"><span>邀请好友</span></div>
  5. <div class="title-2"><span>复制二维码或者邀请注册链接分享给好友</span></div>
  6. </div>
  7. <div class="content-1">
  8. <div class="img-c">
  9. <img class="img" src="/img/ad/ad03.jpg" />
  10. <div class="txt">邀请好友来启智,用免费算力还能赚奖金!</div>
  11. </div>
  12. <div class="descr">
  13. <span>新一期的开源打榜活动,每邀请一名好友注册并激活,就可以获得5打榜积分。快快邀请更多好友帮你冲击榜单吧~ </span>
  14. <a>点击查看活动详情</a>
  15. </div>
  16. </div>
  17. <div class="content-2">
  18. <div class="txt-c">
  19. <div class="txt-1">
  20. <span>启智AI协作平台是启智社区面向AI开发者提供的一站式AI开发协作平台,提供了代码托管、数据集管理、基于异构计算资源的模型调试与训练等功能。目前已经与鹏城云脑、中国算力网(C²NET)一期打通,免费提供丰富算力资源,支撑大家完成AI开发任务。</span>
  21. </div>
  22. <div class="txt-2"><span>{{ sharedLink }}</span></div>
  23. <div class="txt-3"><span>推荐人:</span><span>{{ sharedUser }}</span></div>
  24. <el-button class="__copy_link_btn__" type="primary">复制注册邀请链接</el-button>
  25. </div>
  26. <div class="qr-code">
  27. <img src="" alt="" style="width:120px;height:120px;">
  28. </div>
  29. </div>
  30. <div class="table-container">
  31. <div>
  32. <el-table border :data="tableData" style="width:100%" v-loading="loading" stripe>
  33. <el-table-column prop="ID" label="已邀请好友" align="left" header-align="center">
  34. <template slot-scope="scope">
  35. <div style="display:flex;align-items:center;padding-left:20px;">
  36. <img src="" alt="" style="height:45px;width:45px;margin-right:10px;" />
  37. <a :href="scope.row.userLink" style="font-weight:500;font-size:15px;">{{ scope.row.userName }}</a>
  38. </div>
  39. </template>
  40. </el-table-column>
  41. <el-table-column prop="statusStr" label="状态" align="center" header-align="center">
  42. <template slot-scope="scope">
  43. <span :style="{ color: scope.row.statusColor }">{{ scope.row.statusStr }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column prop="regTime" label="注册时间" align="center" header-align="center">
  47. </el-table-column>
  48. <template slot="empty">
  49. <span style="font-size: 12px">{{
  50. loading ? $t('loading') : $t('noData')
  51. }}</span>
  52. </template>
  53. </el-table>
  54. </div>
  55. <div class="__r_p_pagination">
  56. <div style="margin-top: 2rem">
  57. <div class="center">
  58. <el-pagination background @current-change="currentChange" :current-page="pageInfo.curpage"
  59. :page-sizes="pageInfo.pageSizes" :page-size="pageInfo.pageSize"
  60. layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.total">
  61. </el-pagination>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import { formatDate } from 'element-ui/lib/utils/date-util';
  70. import Clipboard from 'clipboard';
  71. export default {
  72. data() {
  73. return {
  74. sharedLink: 'https://git.openi.org.cn/user/sign_up?sharedUser=Openihu',
  75. sharedUser: 'Openihu',
  76. loading: false,
  77. tableData: [],
  78. pageInfo: {
  79. curpage: 1,
  80. pageSize: 10,
  81. pageSizes: [10],
  82. total: 0,
  83. },
  84. };
  85. },
  86. components: {},
  87. methods: {
  88. initCopy() {
  89. const clipboard = new Clipboard('.__copy_link_btn__', {
  90. text: () => {
  91. return this.sharedLink;
  92. },
  93. })
  94. clipboard.on('success', (e) => {
  95. this.$message({
  96. type: 'success',
  97. message: '分享内容已复制到剪切板'
  98. });
  99. });
  100. },
  101. getTableData() {
  102. const data = new Array(10).fill(0).map((item, index) => {
  103. const status = Math.random() > 0.5 ? '1' : '2';
  104. return {
  105. userName: 'userName-' + index + '-' + Math.random().toFixed(2),
  106. userLink: 'userLink-' + index + '-' + Math.random().toFixed(2),
  107. status: status,
  108. statusStr: status == '1' ? '已激活' : '未激活',
  109. statusColor: status == '1' ? 'rgb(82, 196, 26)' : 'rgb(245, 34, 45)',
  110. regTime: 'regTime' + index + Math.random().toFixed(2),
  111. }
  112. });
  113. this.tableData = data;
  114. return;
  115. const params = {
  116. page: this.pageInfo.curpage,
  117. pagesize: this.pageInfo.pageSize,
  118. };
  119. this.loading = true;
  120. getResSceneList(params).then(res => {
  121. this.loading = false;
  122. res = res.data;
  123. if (res.Code === 0) {
  124. const list = res.Data.List;
  125. const data = list.map((item) => {
  126. return {
  127. }
  128. });
  129. this.tableData = data;
  130. this.pageInfo.total = res.Data.TotalSize;
  131. }
  132. }).catch(err => {
  133. console.log(err);
  134. this.loading = false;
  135. });
  136. },
  137. currentChange(val) {
  138. this.pageInfo.curpage = val;
  139. this.getTableData();
  140. },
  141. },
  142. mounted() {
  143. this.initCopy();
  144. this.getTableData();
  145. },
  146. beforeDestroy() {
  147. },
  148. };
  149. </script>
  150. <style scoped lang="less">
  151. .title {
  152. margin-top: 15px;
  153. margin-bottom: 15px;
  154. .title-1 {
  155. font-weight: 500;
  156. font-size: 20px;
  157. color: rgba(16, 16, 16, 1);
  158. margin-bottom: 10px;
  159. }
  160. .title-2 {
  161. font-weight: 400;
  162. font-size: 14px;
  163. color: rgba(136, 136, 136, 1);
  164. }
  165. }
  166. .content-1 {
  167. margin-bottom: 32px;
  168. .img-c {
  169. height: 80px;
  170. position: relative;
  171. .img {
  172. width: 100%;
  173. height: 100%;
  174. }
  175. .txt {
  176. position: absolute;
  177. width: 100%;
  178. height: 100%;
  179. left: 0;
  180. top: 0;
  181. line-height: 80px;
  182. padding-left: 25px;
  183. font-weight: 500;
  184. font-size: 24px;
  185. color: rgb(255, 255, 255);
  186. }
  187. }
  188. .descr {
  189. font-weight: 300;
  190. font-size: 16px;
  191. color: rgb(16, 16, 16);
  192. padding: 25px;
  193. border-left: 1px solid rgba(0, 0, 0, 0.1);
  194. border-right: 1px solid rgba(0, 0, 0, 0.1);
  195. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  196. border-radius: 0px 0px 4px 4px;
  197. }
  198. }
  199. .content-2 {
  200. display: flex;
  201. background-color: rgb(228, 242, 255);
  202. border-color: rgb(228, 242, 255);
  203. border-width: 1px;
  204. border-style: solid;
  205. border-radius: 5px;
  206. padding: 25px;
  207. margin-bottom: 32px;
  208. .txt-c {
  209. flex: 1;
  210. font-weight: 300;
  211. font-size: 16px;
  212. color: rgb(16, 16, 16);
  213. span {
  214. line-height: 24px;
  215. }
  216. div {
  217. margin-bottom: 6px;
  218. }
  219. .txt-3 {
  220. margin-bottom: 15px;
  221. }
  222. }
  223. .qr-code {
  224. width: 150px;
  225. display: flex;
  226. flex-direction: column;
  227. align-items: end;
  228. }
  229. }
  230. .table-container {
  231. margin-bottom: 16px;
  232. /deep/ .el-table__header {
  233. th {
  234. background: rgb(245, 245, 246);
  235. font-size: 12px;
  236. color: rgb(36, 36, 36);
  237. }
  238. }
  239. /deep/ .el-table__body {
  240. td {
  241. font-size: 12px;
  242. }
  243. }
  244. .op-btn {
  245. cursor: pointer;
  246. font-size: 12px;
  247. color: rgb(25, 103, 252);
  248. margin: 0 5px;
  249. }
  250. }
  251. .center {
  252. display: flex;
  253. justify-content: center;
  254. }
  255. </style>