invite-user.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. activityId: null,
  98. },
  99. };
  100. },
  101. async fetch() {
  102. //
  103. this.data = (await getStarCoinOverview(this)).data;
  104. },
  105. head: {
  106. title: '邀请好友',
  107. // share: {
  108. // title: '标题',
  109. // content: '内容',
  110. // gotoUrl: 'http://localhost',
  111. // shareImg: 'http://localhost',
  112. // },
  113. },
  114. computed: {
  115. dataList() {
  116. return [
  117. { label: '今日收益(星币)', value: this.data.todayIncomeStarCoin },
  118. { label: '总收益(星币)', value: this.data.totalIncomeStarCoin },
  119. { label: '今日购买订单数', value: this.data.totalBuyOrderCount },
  120. { label: '累计推广订单', value: this.data.totalBuyOrderCount },
  121. {
  122. label: '今日购买成功客户',
  123. value: this.data.todayBuyOrderSuccessCount,
  124. },
  125. {
  126. label: '累计购买成功客户',
  127. value: this.data.totalBuyOrderSuccessCount,
  128. },
  129. // { label: '可提现星币数量', value: this.data.withdrawStarCoinNum },
  130. ];
  131. },
  132. },
  133. mounted() {},
  134. methods: {
  135. async share() {
  136. // console.log(this);
  137. this.$tongji.trackEvent('活动', '分享', '', 0);
  138. const url =
  139. location.origin +
  140. this.$router.resolve({
  141. path: '/register-for-invite',
  142. query: {
  143. invitationUserName: this.data.inviteUserName,
  144. activityId: this.data.activityId,
  145. },
  146. }).href;
  147. if (this.$userAgent.isMiniProgram) {
  148. // 小程序环境
  149. await clipboard.writeText(url);
  150. this.$toast.success('链接复制成功');
  151. } else if (this.$userAgent.isApp) {
  152. // app环境
  153. this.$native.share({
  154. title: '双子星APP',
  155. content: '分享好友购买云机套餐,返星币换现金',
  156. gotoUrl: url,
  157. shareImg: 'sdsa.png',
  158. });
  159. } else {
  160. // 浏览器环境
  161. await clipboard.writeText(url);
  162. // throw new Error('1231');
  163. this.$toast.success('链接复制成功');
  164. }
  165. },
  166. },
  167. };
  168. </script>
  169. <style lang="scss" scoped>
  170. .invite-user {
  171. color: #333;
  172. background-image: url('~/assets/image/activity/invite-user/bg@2x.png');
  173. background-size: 100% auto;
  174. background-position-y: -44px;
  175. overflow: hidden;
  176. padding-bottom: 30px;
  177. }
  178. .box {
  179. width: 373px;
  180. box-sizing: border-box;
  181. margin: auto;
  182. border-image-source: url('~/assets/image/activity/invite-user/box@2x.png');
  183. border-image-slice: 38 * 2 20 * 2 30 * 2 fill;
  184. // border-image-width: 200px;
  185. // border-image-slice: 200%;
  186. border-width: 38px 15px 15px;
  187. // border-width: 1px;
  188. border-style: solid;
  189. position: relative;
  190. + .box {
  191. margin-top: 30px;
  192. }
  193. .box-header {
  194. position: absolute;
  195. top: -30px;
  196. // left: 141px;
  197. left: 0;
  198. right: 0;
  199. text-align: center;
  200. padding: 0 130px;
  201. color: #fff;
  202. }
  203. .box-main {
  204. padding: 30px 15px 20px;
  205. }
  206. }
  207. .box1 {
  208. margin-top: 275px;
  209. .box-main {
  210. // padding: 30px 15px 20px;
  211. padding-left: 0;
  212. padding-right: 0;
  213. }
  214. .cybz-content {
  215. width: 305px;
  216. height: 75px;
  217. margin: auto;
  218. display: block;
  219. // margin-top: 30px;
  220. }
  221. .cybz-content-text {
  222. // display: flex;
  223. display: grid;
  224. // width: 305px;
  225. // padding: 0 28px;
  226. // align-items: center;
  227. // margin: auto;
  228. // justify-content: space-between;
  229. grid-template-columns: 1fr 1fr 1fr;
  230. font-size: 12px;
  231. color: #333;
  232. .cybz-content-text-item {
  233. // width: 0;
  234. // flex: auto;
  235. text-align: center;
  236. }
  237. }
  238. .share-button {
  239. display: block;
  240. margin: auto;
  241. width: 302px !important;
  242. height: 62px !important;
  243. background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
  244. background-size: 100% 100%;
  245. margin-top: 24px;
  246. // margin-bottom: 24px;
  247. }
  248. }
  249. .box2 {
  250. .label {
  251. // font-size: 14px;
  252. }
  253. .value {
  254. color: #ff6600;
  255. // font-size: 24px;
  256. }
  257. .box-main {
  258. padding-left: 20px;
  259. padding-right: 20px;
  260. }
  261. }
  262. .box4 {
  263. .box-main {
  264. // padding-left: 20px;
  265. // padding-top: 0;
  266. }
  267. }
  268. </style>