invite-user.vue 7.6 KB

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