invite-user.vue 7.0 KB

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