invite-user.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <v-container class="invite-user pa-0" fluid>
  3. <div class="box box1">
  4. <div class="box-header">参与步骤</div>
  5. <div class="box-main">
  6. <v-img
  7. class="cybz-content"
  8. src="~/assets/image/activity/invite-user/cybz-content@2x.png"
  9. />
  10. <div class="cybz-content-text">
  11. <div class="cybz-content-text-item">分享好友</div>
  12. <div class="cybz-content-text-item">邀请购买云机</div>
  13. <div class="cybz-content-text-item">返星币换现金</div>
  14. </div>
  15. <v-btn class="share-button" rounded @click="share()"></v-btn>
  16. <!-- <button @click="share()">邀请</button> -->
  17. </div>
  18. <!-- <div class="h-40">13</div> -->
  19. </div>
  20. <div class="box box2">
  21. <div class="box-header">收益明细</div>
  22. <div class="box-main">
  23. <div class="grid grid-cols-2 gap-x-4 gap-y-8">
  24. <div
  25. v-for="(item, index) in dataList"
  26. :key="index"
  27. :class="{
  28. 'col-span-2': index === 6,
  29. }"
  30. >
  31. <div class="label text-sm">
  32. <span>{{ item.label }}</span>
  33. </div>
  34. <div class="value text-2xl font-bold">
  35. <span>{{ item.value | formatNumber }}</span>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <!-- <div class="box box3">
  42. <div class="box-header">返利套餐</div>
  43. <div class="box-main"></div>
  44. </div> -->
  45. <div class="box box4">
  46. <div class="box-header">活动规则</div>
  47. <div class="box-main text-sm">
  48. <p>1、传播过程中有任何疑问,可直接咨询客服</p>
  49. <p>
  50. 2、用户可以通过分享页面或者套餐给想要分享的人,被分享人购买云机套餐后,分享人可获得套餐对应的星币
  51. </p>
  52. <p>
  53. 3、星币为双子星云手机平台唯一认可代币,仅能通过充值、赠送和分享获得,其它渠道途径非法获取的星币,不受平台认可
  54. </p>
  55. <p>4、星币可在双子星购买任一等价值套餐</p>
  56. <p>
  57. 5、请勿利用双子星传播或扩散任何有关于政治、情色等任何违法的信息,一经发现,取消资格,如果触犯任何法律相关问题,平台不负任何责任
  58. </p>
  59. </div>
  60. </div>
  61. <!-- <div class="">invite-user</div> -->
  62. <!-- <button>刷新数据</button> -->
  63. <!-- <div class="">{{ data }}</div> -->
  64. <!-- <div class="text-center">
  65. <span>分享好友购买云机套餐<br />返星币换现金</span>
  66. </div>
  67. <div class="text-center mt-4">
  68. <van-button type="primary" @click="share()">邀请好友</van-button>
  69. </div>
  70. <van-icon name="chat-o" />
  71. <van-icon name="shape-plus" class-prefix="mdi" />
  72. <van-button @click="$fetch()">刷新</van-button>
  73. <div class="ccc">{{ 36666666.123456 | formatNumber }}</div>
  74. <div class="ccc">{{ '2020-01-01' | formatDate }}</div> -->
  75. </v-container>
  76. </template>
  77. <script>
  78. // import qs from 'qs';
  79. // import clipboard from 'clipboardy/browser';
  80. import * as clipboard from 'clipboard-polyfill/text';
  81. import { getStarCoinOverview } from '~/api/activity/invite-user.js';
  82. export default {
  83. // auth: false,
  84. name: 'InviteUser',
  85. filters: {},
  86. data() {
  87. return {
  88. data: {
  89. todayIncomeStarCoin: 0,
  90. totalIncomeStarCoin: 0,
  91. todayBuyOrderCount: 0,
  92. totalBuyOrderCount: 0,
  93. todayBuyOrderSuccessCount: 0,
  94. totalBuyOrderSuccessCount: 0,
  95. withdrawStarCoinNum: 0,
  96. inviteUserName: null,
  97. },
  98. };
  99. },
  100. async fetch() {
  101. //
  102. this.data = (await getStarCoinOverview(this)).data;
  103. },
  104. head: {
  105. title: '邀请好友',
  106. // share: {
  107. // title: '标题',
  108. // content: '内容',
  109. // gotoUrl: 'http://localhost',
  110. // shareImg: 'http://localhost',
  111. // },
  112. },
  113. computed: {
  114. dataList() {
  115. return [
  116. { label: '今日收益(星币)', value: this.data.todayIncomeStarCoin },
  117. { label: '总收益(星币)', value: this.data.totalIncomeStarCoin },
  118. { label: '今日购买订单数', value: this.data.totalBuyOrderCount },
  119. { label: '累计推广订单', value: this.data.totalBuyOrderCount },
  120. {
  121. label: '今日购买成功客户',
  122. value: this.data.todayBuyOrderSuccessCount,
  123. },
  124. {
  125. label: '累计购买成功客户',
  126. value: this.data.totalBuyOrderSuccessCount,
  127. },
  128. // { label: '可提现星币数量', value: this.data.withdrawStarCoinNum },
  129. ];
  130. },
  131. },
  132. mounted() {},
  133. methods: {
  134. async share() {
  135. // console.log(this);
  136. this.$tongji.trackEvent('活动', '分享', '', 0);
  137. const url =
  138. location.origin +
  139. this.$router.resolve({
  140. path: '/register-for-invite',
  141. query: {
  142. invitationUserName: this.data.invitationUserName,
  143. activityId: this.$route.query.activityId,
  144. },
  145. }).href;
  146. if (this.$userAgent.isMiniProgram) {
  147. // 小程序环境
  148. await clipboard.writeText(url);
  149. this.$toast.success('链接复制成功');
  150. } else if (this.$userAgent.isApp) {
  151. // app环境
  152. this.$native.share({
  153. title: '双子星APP',
  154. content: '分享好友购买云机套餐,返星币换现金',
  155. gotoUrl: url,
  156. shareImg: 'sdsa.png',
  157. });
  158. } else {
  159. // 浏览器环境
  160. await clipboard.writeText(url);
  161. // throw new Error('1231');
  162. this.$toast.success('链接复制成功');
  163. }
  164. },
  165. },
  166. };
  167. </script>
  168. <style lang="scss" scoped>
  169. .invite-user {
  170. color: #333;
  171. background-image: url('~/assets/image/activity/invite-user/bg@2x.png');
  172. background-size: 100% auto;
  173. background-position-y: -44px;
  174. overflow: hidden;
  175. padding-bottom: 30px;
  176. }
  177. .box {
  178. width: 373px;
  179. box-sizing: border-box;
  180. margin: auto;
  181. border-image-source: url('~/assets/image/activity/invite-user/box@2x.png');
  182. border-image-slice: 38 * 2 20 * 2 30 * 2 fill;
  183. // border-image-width: 200px;
  184. // border-image-slice: 200%;
  185. border-width: 38px 15px 15px;
  186. // border-width: 1px;
  187. border-style: solid;
  188. position: relative;
  189. + .box {
  190. margin-top: 30px;
  191. }
  192. .box-header {
  193. position: absolute;
  194. top: -30px;
  195. // left: 141px;
  196. left: 0;
  197. right: 0;
  198. text-align: center;
  199. padding: 0 130px;
  200. color: #fff;
  201. }
  202. .box-main {
  203. padding: 30px 15px 20px;
  204. }
  205. }
  206. .box1 {
  207. margin-top: 275px;
  208. .box-main {
  209. // padding: 30px 15px 20px;
  210. padding-left: 0;
  211. padding-right: 0;
  212. }
  213. .cybz-content {
  214. width: 305px;
  215. height: 75px;
  216. margin: auto;
  217. display: block;
  218. // margin-top: 30px;
  219. }
  220. .cybz-content-text {
  221. // display: flex;
  222. display: grid;
  223. // width: 305px;
  224. // padding: 0 28px;
  225. // align-items: center;
  226. // margin: auto;
  227. // justify-content: space-between;
  228. grid-template-columns: 1fr 1fr 1fr;
  229. font-size: 12px;
  230. color: #333;
  231. .cybz-content-text-item {
  232. // width: 0;
  233. // flex: auto;
  234. text-align: center;
  235. }
  236. }
  237. .share-button {
  238. display: block;
  239. margin: auto;
  240. width: 302px !important;
  241. height: 62px !important;
  242. background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
  243. background-size: 100% 100%;
  244. margin-top: 24px;
  245. // margin-bottom: 24px;
  246. }
  247. }
  248. .box2 {
  249. .label {
  250. // font-size: 14px;
  251. }
  252. .value {
  253. color: #ff6600;
  254. // font-size: 24px;
  255. }
  256. .box-main {
  257. padding-left: 20px;
  258. padding-right: 20px;
  259. }
  260. }
  261. .box4 {
  262. .box-main {
  263. // padding-left: 20px;
  264. // padding-top: 0;
  265. }
  266. }
  267. </style>