zyXingqing.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <view class="all">
  3. <view class="shang padding-v-30 padding-c-30 position-relative">
  4. <image class="img" src="../../static/img/xq6.png" mode="scaleToFill"></image>
  5. <view class="tz padding-b-30">{{base.name}}</view>
  6. <view class="sy flex-start padding-b-10">
  7. <view class="syl">{{$t('zy.m0')}}:{{base.day_get}}%</view>
  8. </view>
  9. <view class="sj flex margin-t-30 position-relative">
  10. <view class="sj1">
  11. <view class="sz">{{base.user_time_limit}}</view>
  12. <view class="wz">{{$t('zy.m1')}}</view>
  13. </view>
  14. <view class="sj1">
  15. <view class="sz">{{base.single_time_max*1}}</view>
  16. <view class="wz">{{$t('zy.m3')}}</view>
  17. </view>
  18. <view class="sj1">
  19. <view class="sz">{{base.day}}</view>
  20. <view class="wz">{{$t('zy.m2')}}</view>
  21. </view>
  22. <view class="sj1">
  23. <view class="sz">{{base.single_time_min*1}}</view>
  24. <view class="wz">{{$t('zy.m4')}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="sygc margin-t-20 padding-v-30 padding-c-30">
  29. <view class="gc padding-b-30">{{$t('zy.m5')}}</view>
  30. <view class="an flex padding-c-30">
  31. <view class="an1"></view>
  32. <view class="xian"></view>
  33. <view class="an1"></view>
  34. <view class="xian"></view>
  35. <view class="an1"></view>
  36. </view>
  37. <view class="wenben padding-t-30 flex padding-c-30">
  38. <view class="wb">
  39. <view class="wen">{{$t('zy.m6')}}</view>
  40. <view class="wen padding-t-10">{{$t('zy.m7')}}</view>
  41. </view>
  42. <view class="wb">
  43. <view class="wen text-center">{{$t('zy.m8')}}</view>
  44. <view class="wen padding-t-10 text-center">{{$t('zy.m9')}}</view>
  45. </view>
  46. <view class="wb">
  47. <view class="wen text-right">{{$t('zy.m10')}}</view>
  48. <view class="wen padding-t-10 text-right">{{$t('zy.m11')}}</view>
  49. </view>
  50. </view>
  51. <view class="icon-box padding-t-30">
  52. <view class="icon flex-start">
  53. <image class="ic" src="../../static/img/xq1.png" mode=""></image>
  54. <view class="jiaru">{{$t('zy.m12')}}</view>
  55. </view>
  56. <view class="icon flex-start">
  57. <image class="ic" src="../../static/img/xq4.png" mode=""></image>
  58. <view class="jiaru">{{$t('zy.m13')}}</view>
  59. </view>
  60. <view class="icon flex-start">
  61. <image class="ic" src="../../static/img/xq3.png" mode=""></image>
  62. <view class="jiaru">
  63. {{$t('zy.m14')}}:{{base.single_time_max*1}}*({{base.day_get}}%*{{base.day}}+100%)
  64. </view>
  65. </view>
  66. <view class="icon flex-start">
  67. <image class="ic" src="../../static/img/xq2.png" mode=""></image>
  68. <view class="jiaru">{{$t('zy.m15')}}:{{allMoney}}</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="jine margin-t-20">
  73. <view class="je">{{$t('zy.m16')}}</view>
  74. <view class="jes margin-t-30">{{base.join*1}}U</view>
  75. </view>
  76. <view class="yue flex margin-t-20">
  77. <view class="flex">
  78. <image class="qianbao" src="../../static/img/xq5.png" mode=""></image>
  79. <view class="ye padding-l-20">{{$t('zy.m17')}}</view>
  80. </view>
  81. <view class="flex">
  82. <view class="dangqian">{{$t('zy.m18')}}:</view>
  83. <view class="dqs">{{userWallet|getMoneyStyle}}</view>
  84. </view>
  85. </view>
  86. <view class="aaa"></view>
  87. <view class="liji">
  88. <view class="jr" @click="joinNumOpen">
  89. <view class="jia">{{$t('zy.m19')}}</view>
  90. </view>
  91. </view>
  92. <uni-popup type="bottom" ref="popup">
  93. <inputPassword @commit='KeyInfo'></inputPassword>
  94. </uni-popup>
  95. <uni-popup ref="inputDialog" type="dialog">
  96. <uni-popup-dialog ref="inputClose" mode="input" title="押注金额" :value="num" placeholder="请输入购买金额(USDT)"
  97. @confirm="joinNum" confirmText='确定' cancelText='取消'></uni-popup-dialog>
  98. </uni-popup>
  99. </view>
  100. </template>
  101. <script>
  102. import {
  103. lockDetail,
  104. lockJoin
  105. } from "@/api/mypledge.js"
  106. import {
  107. gameWallet
  108. } from "@/api/game.js";
  109. import inputPassword from "@/components/input-password/input-password.vue";
  110. import { getMoneyStyle } from "@/utils/rocessor.js";
  111. export default {
  112. filters: {
  113. getMoneyStyle,
  114. },
  115. components: {
  116. inputPassword
  117. },
  118. data() {
  119. return {
  120. id: '',
  121. base: {},
  122. userWallet: '',
  123. allMoney: '',
  124. // 保存支付密码
  125. password: '',
  126. //购买的数量
  127. num: '',
  128. };
  129. },
  130. onLoad(option) {
  131. this.id = option.id;
  132. uni.setNavigationBarTitle({
  133. title: this.$t("tab.b5"),
  134. });
  135. // 加载数据
  136. this.lockDetail();
  137. this.gameWallet();
  138. },
  139. methods: {
  140. // 关闭支付弹窗
  141. colsePayPassword() {
  142. this.$refs.popup.close();
  143. },
  144. KeyInfo(val) {
  145. this.password = val;
  146. this.colsePayPassword();
  147. this.joinLock();
  148. },
  149. // 打开输入弹窗
  150. joinNumOpen() {
  151. this.$refs.inputDialog.open();
  152. },
  153. // 输入的金额
  154. joinNum(e) {
  155. if (isNaN(Number(e))) {
  156. uni.showToast({
  157. title: "请输入数字",
  158. icon: "error"
  159. })
  160. return
  161. }
  162. this.num = e;
  163. this.$refs.popup.open();
  164. console.log(e, '233');
  165. },
  166. // 购买质押
  167. joinLock() {
  168. const that = this;
  169. const data = {
  170. id: that.id,
  171. number: that.num,
  172. trade_password: that.password
  173. }
  174. // 初始化数量
  175. that.num = '';
  176. lockJoin(data).then(
  177. (res) => {
  178. uni.showToast({
  179. title:"质押成功"
  180. })
  181. that.gameWallet();
  182. }
  183. ).then((err) => {
  184. console.log(err);
  185. })
  186. },
  187. gameWallet() {
  188. gameWallet().then((res) => {
  189. this.userWallet = +res.data.back.USDT.money.money
  190. })
  191. },
  192. lockDetail() {
  193. const that = this;
  194. lockDetail({
  195. id: that.id
  196. }).then(
  197. (res) => {
  198. that.base = res.data.data;
  199. that.allMoney = that.base.single_time_max * (that.base.day_get * that.base.day+ 100) /
  200. 100;
  201. }
  202. ).catch(
  203. (res) => {
  204. console.log(res);
  205. }
  206. )
  207. }
  208. }
  209. }
  210. </script>
  211. <style lang="scss">
  212. page {
  213. background-color: #191a1f;
  214. }
  215. .all {
  216. line-height: 1;
  217. padding-bottom: 190rpx;
  218. }
  219. .shang {
  220. font-weight: 800;
  221. background-color: $page-color-base;
  222. .tz {
  223. font-size: 33rpx;
  224. color: #FFFFFF;
  225. }
  226. .sy {
  227. .syl {
  228. background: #FEB041;
  229. border-radius: 10rpx;
  230. font-size: 21rpx;
  231. color: #000000;
  232. padding: 10rpx;
  233. }
  234. }
  235. .sj {
  236. font-weight: 800;
  237. text-align: center;
  238. .sj1 {
  239. width: 25%;
  240. .sz {
  241. font-size: 40rpx;
  242. color: #FFFFFF;
  243. }
  244. .wz {
  245. margin-top: 20rpx;
  246. font-size: 22rpx;
  247. color: #999999;
  248. padding-bottom: 20rpx;
  249. }
  250. }
  251. }
  252. .img {
  253. position: absolute;
  254. width: 325rpx;
  255. height: 285rpx;
  256. top: 0rpx;
  257. right: 40rpx;
  258. }
  259. }
  260. .sygc {
  261. background-color: $page-color-base;
  262. .gc {
  263. font-size: 28rpx;
  264. font-weight: 800;
  265. color: #FFFFFF;
  266. }
  267. .an {
  268. .an1 {
  269. width: 24rpx;
  270. height: 24rpx;
  271. border: 4px solid #FEB041;
  272. border-radius: 12rpx;
  273. }
  274. .xian {
  275. flex-grow: 1;
  276. height: 1rpx;
  277. background: #fff;
  278. }
  279. }
  280. }
  281. .wenben {
  282. background-color: $page-color-base;
  283. .wb {
  284. width: 33.3%;
  285. .wen {
  286. font-size: 22rpx;
  287. font-weight: 500;
  288. color: #999999;
  289. }
  290. }
  291. }
  292. .icon-box {
  293. background-color: $page-color-base;
  294. .icon:nth-child(2n-1) {
  295. background: #161616;
  296. }
  297. .icon {
  298. margin: 0 30rpx;
  299. border-radius: 10rpx;
  300. padding: 20rpx;
  301. .ic {
  302. width: 38rpx;
  303. height: 36rpx;
  304. }
  305. .jiaru {
  306. padding-left: 20rpx;
  307. height: 23rpx;
  308. font-size: 24rpx;
  309. color: #FFFFFF;
  310. }
  311. }
  312. }
  313. .jine {
  314. background-color: $page-color-base;
  315. font-weight: 800;
  316. padding: 30rpx;
  317. .je {
  318. font-size: 28rpx;
  319. color: #999999;
  320. }
  321. .jes {
  322. font-size: 74rpx;
  323. color: #FEB041;
  324. }
  325. }
  326. .yue {
  327. background-color: $page-color-base;
  328. width: 750rpx;
  329. color: #FFFFFF;
  330. font-size: 29rpx;
  331. padding: 30rpx;
  332. .qianbao {
  333. width: 80rpx;
  334. height: 64rpx;
  335. }
  336. .ye {}
  337. .dangqian {}
  338. .dqs {
  339. color: #FEB041;
  340. }
  341. }
  342. .liji {
  343. padding: 40rpx 30rpx;
  344. position: fixed;
  345. bottom: 0;
  346. left: 0;
  347. right: 0;
  348. background-color: $page-color-base;
  349. box-shadow: 0rpx 0rpx 20rpx #FFF;
  350. .jr {
  351. background: linear-gradient(90deg, #feb041 0%, #feb041 100%);
  352. border-radius: 10rpx;
  353. padding: 30rpx;
  354. text-align: center;
  355. }
  356. .jia {
  357. font-size: 32rpx;
  358. font-weight: bold;
  359. color: #040404;
  360. }
  361. }
  362. </style>