index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <v-page>
  3. <v-header
  4. class="nav-head"
  5. :border="false"
  6. :title="$t('invite.a0')"
  7. ></v-header>
  8. <view class="layout-main">
  9. <view class="top color-plain">
  10. <view :style="{ height: taskHeight + 'px' }"></view>
  11. <!-- <view class="fn-center fn-30 title">{{app.appName}} {{$t('invite.a1')}}</view>
  12. <view class="fn-center fn-18">{{$t('invite.a2')}}</view> -->
  13. <view class="leveup m-md p-md bg-light rounded-lg">
  14. <view
  15. class="d-flex align-center m-t-md m-b-lg justify-between fn-center"
  16. >
  17. <view>
  18. <view class="fn-lg">{{ $t("invite.a3") }}</view>
  19. </view>
  20. <view class="fn-30 color-yellows d-flex align-center">
  21. <img src="static/img/rbox.png" alt="" class="w-30" />
  22. </view>
  23. <view>
  24. <view class="fn-lg">{{ app.appName }} {{ $t("invite.a1") }}</view>
  25. <!-- <view>
  26. <van-icon name="diamond-o" />
  27. {{ $t("invite.a5") }}
  28. </view> -->
  29. </view>
  30. </view>
  31. <view class="fn-center">
  32. <v-qr :text="detail.invite_url" class="search-code"></v-qr>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 邀请码 -->
  37. <view
  38. class="invite-code m-x-md m-b-md bg-panel-4 rounded bg-inv p-y-xl p-x-md"
  39. >
  40. <view class=" ">
  41. <view class="d-flex justify-center fn-16">{{ $t("invite.a6") }}</view>
  42. <view class="fn-22 color-theme-1 d-flex justify-center m-y-lg">
  43. {{ detail.invite_code }}
  44. <i class="iconfont" @click="$copy(detail.invite_code,$t('common.a1'))">&#xe706;</i>
  45. </view>
  46. </view>
  47. <view class="group d-flex m-t-xs" >
  48. <button
  49. type="blue"
  50. class="btn d-flex flex-fill color-plain justify-center rounded-sm btn-1 m-r-md fn-md bg-gradient-blue"
  51. @click="downImg"
  52. style="line-height: inherit;align-items: stretch;min-height:40rpx;"
  53. >
  54. <view class="d-flex align-center justify-center" style="min-height:45px;">{{ $t("invite.a7") }}</view>
  55. </button>
  56. <button
  57. type="green"
  58. class="btn d-flex flex-fill justify-center rounded-sm color-plain btn-2 fn-md bg-gradient-green"
  59. @click="$copy(detail.invite_url,$t('common.a1'))"
  60. style="line-height: inherit;align-items: stretch;min-height:40rpx;"
  61. >
  62. <view class="d-flex align-center justify-center" style="min-height:45px;">{{ $t("invite.a8") }}</view>
  63. </button>
  64. </view>
  65. </view>
  66. <!-- 推广 -->
  67. <view class="d-flex justify-between m-b-lg m-x-lg fn-18">
  68. <span>{{ $t("invite.a9") }}</span>
  69. </view>
  70. <view class="extension bg-panel-4 p-md m-y-md m-x-lg rounded-md">
  71. <view class="data d-flex justify-between fn-center p-x-md">
  72. <view class="item">
  73. <view class="label fn-sm"
  74. >{{ $t("invite.b0") }}({{ $t("invite.b1") }})</view
  75. >
  76. <view class="num color-light fn-lg">{{
  77. detail.invite_user_num
  78. }}</view>
  79. </view>
  80. <view class="item">
  81. <view class="label fn-sm">{{ $t("invite.b2") }}(USDT)</view>
  82. <view class="num color-light fn-lg">{{
  83. detail.invite_dividend
  84. }}</view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 记录 -->
  89. <view class="bill p-x-md">
  90. <van-tabs
  91. v-model="active"
  92. animated
  93. class="bg-panel-4"
  94. lazy-render
  95. :broder="false"
  96. >
  97. <van-tab :title="$t('invite.b3')">
  98. <v-paging :ajax="generalizeList" :refresher-enabled="false">
  99. <template #box="list" class="">
  100. <van-empty v-if="!$list(list).length" description="" />
  101. <view
  102. v-else
  103. class=" p-x-md p-y-xs color-light bg-panel-3 rounded-sm m-y-md"
  104. v-for="item in $list(list)"
  105. :key="item.account"
  106. >
  107. <view> {{ item.account || item.username }} </view>
  108. <view class="d-flex justify-between m-t-xs">
  109. <van-tag mark plain type="danger">{{
  110. $t("invite.b4")
  111. }}</van-tag>
  112. <view>{{ $date(item.created_at) }}</view>
  113. </view>
  114. </view>
  115. </template>
  116. </v-paging>
  117. </van-tab>
  118. <van-tab :title="$t('invite.b5')">
  119. <v-paging :ajax="rewardLogs" :refresher-enabled="false">
  120. <template #box="list">
  121. <table class="w-max">
  122. <tbody>
  123. <tr v-for="item in $list(list)" :key="item.id">
  124. <td class="p-l-md p-y-xs color-light">
  125. {{ item.log_type_text }}
  126. </td>
  127. <td class="fn-sm fn-center color-default">
  128. {{ $date(item.created_at) }}
  129. </td>
  130. <td class="p-r-md fn-right color-light">
  131. {{ item.amount }}{{ item.coin_name }}
  132. </td>
  133. </tr>
  134. </tbody>
  135. </table>
  136. </template>
  137. </v-paging>
  138. </van-tab>
  139. </van-tabs>
  140. </view>
  141. </view>
  142. </v-page>
  143. </template>
  144. <script>
  145. import Profile from "@/api/profile";
  146. import app from "@/app";
  147. export default {
  148. data() {
  149. return {
  150. active: 0,
  151. detail: {},
  152. imgBase64: undefined,
  153. app,
  154. taskHeight: 0,
  155. };
  156. },
  157. computed: {},
  158. methods: {
  159. // 获取推广记录
  160. generalizeList: Profile.generalizeList,
  161. // 获取返佣记录
  162. rewardLogs: Profile.rewardLogs,
  163. generalizeInfo() {
  164. Profile.generalizeInfo().then((res) => {
  165. this.detail = res.data;
  166. });
  167. },
  168. downImg() {
  169. var pages = getCurrentPages();
  170. var page = pages[pages.length - 1];
  171. var bitmap = null;
  172. var currentWebview = page.$getAppWebview();
  173. bitmap = new plus.nativeObj.Bitmap("amway_img");
  174. // 将webview内容绘制到Bitmap对象中
  175. currentWebview.draw(
  176. bitmap,
  177. function () {
  178. bitmap.save(
  179. "_doc/a.jpg",
  180. {},
  181. function (i) {
  182. uni.saveImageToPhotosAlbum({
  183. filePath: i.target,
  184. success: function () {
  185. bitmap.clear(); //销毁Bitmap图片
  186. uni.showToast({
  187. title: "保存图片成功",
  188. mask: false,
  189. duration: 1500,
  190. });
  191. },
  192. });
  193. },
  194. function (e) {
  195. console.log("保存图片失败:" + JSON.stringify(e));
  196. }
  197. );
  198. },
  199. function (e) {
  200. console.log("截屏绘制图片失败:" + JSON.stringify(e));
  201. }
  202. );
  203. },
  204. callback($ev) {
  205. this.imgBase64 = $ev;
  206. },
  207. getTaskHeight() {
  208. uni.getSystemInfo({
  209. success: (obj) => {
  210. this.taskHeight = obj.statusBarHeight;
  211. },
  212. });
  213. },
  214. },
  215. onLoad() {
  216. this.generalizeInfo();
  217. this.getTaskHeight();
  218. },
  219. };
  220. </script>
  221. <style lang="scss" scoped>
  222. // .nav-head {
  223. // background: transparent;
  224. // ::v-deep .van-nav-bar{
  225. // background-color: inherit;
  226. // .van-nav-bar__title,.van-icon{
  227. // color:$plain;
  228. // }
  229. // }
  230. // // position: absolute;
  231. // left: 0;
  232. // width: 100%;
  233. // top: 0;
  234. // z-index: 99;
  235. // &::after {
  236. // border-bottom: none;
  237. // }
  238. // }
  239. .bg-inv {
  240. background: url("../../static/img/bgb3.png") no-repeat center top;
  241. }
  242. .top {
  243. // background: linear-gradient(180deg, #c86b49, $theme-1);
  244. padding-bottom: 80px;
  245. .title {
  246. padding-top: 45px;
  247. }
  248. .leveup {
  249. background: $white url("../../static/img/bgshare.png") no-repeat center top;
  250. .search-code {
  251. width: 100px;
  252. height: 100px;
  253. margin: 0 auto;
  254. border: 4px solid $white;
  255. }
  256. background-size: 100% 100%;
  257. box-sizing: border-box;
  258. .apply-btn {
  259. border-radius: 50px;
  260. border: none;
  261. width: 120px;
  262. background: linear-gradient(180deg, #ffd01e, #ff9d2c);
  263. box-shadow: 1px 1px 6px 1px #c8c9cc;
  264. }
  265. }
  266. }
  267. .invite-code {
  268. margin-top: -45px;
  269. .group {
  270. .btn-1 {
  271. border: 0;
  272. // background: linear-gradient(90deg, $theme-1, #ff9d2c);
  273. }
  274. .btn-2 {
  275. border: 0;
  276. // background: linear-gradient(90deg, $blue, #6dabe8);
  277. }
  278. }
  279. }
  280. </style>