zyXingqing.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  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.single_time_max*1}}</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}}%+100%)*{{base.day}}
  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}}</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="$t('zy.b1')" :value="num" :placeholder="$t('zy.b2')"
  97. @confirm="joinNum" :confirmText="$t('zy.b3')" :cancelText="$t('zy.b4')"></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. export default {
  111. components: {
  112. inputPassword
  113. },
  114. data() {
  115. return {
  116. id: '',
  117. base: {},
  118. userWallet: '',
  119. allMoney: '',
  120. // 保存支付密码
  121. password: '',
  122. //购买的数量
  123. num: '',
  124. };
  125. },
  126. onLoad(option) {
  127. this.id = option.id;
  128. uni.setNavigationBarTitle({
  129. title: this.$t("tab.b5"),
  130. });
  131. // 加载数据
  132. this.lockDetail();
  133. this.gameWallet();
  134. },
  135. methods: {
  136. // 关闭支付弹窗
  137. colsePayPassword() {
  138. this.$refs.popup.close();
  139. },
  140. KeyInfo(val) {
  141. this.password = val;
  142. this.colsePayPassword();
  143. this.joinLock();
  144. },
  145. // 打开输入弹窗
  146. joinNumOpen() {
  147. this.$refs.inputDialog.open();
  148. },
  149. // 输入的金额
  150. joinNum(e) {
  151. if (isNaN(Number(e))) {
  152. uni.showToast({
  153. title: this.$t("zy.b5"),
  154. icon: "error"
  155. })
  156. return
  157. }
  158. this.num = e;
  159. this.$refs.popup.open();
  160. console.log(e, '233');
  161. },
  162. // 购买质押
  163. joinLock() {
  164. const that = this;
  165. const data = {
  166. id: that.id,
  167. number: that.num,
  168. trade_password: that.password
  169. }
  170. // 初始化数量
  171. that.num = '';
  172. lockJoin(data).then(
  173. (res) => {
  174. uni.showToast({
  175. title: this.$t("zy.b6"),
  176. })
  177. that.gameWallet();
  178. }
  179. ).then((err) => {
  180. console.log(err);
  181. })
  182. },
  183. gameWallet() {
  184. gameWallet().then((res) => {
  185. this.userWallet = +res.data.back.USDT.money.money
  186. })
  187. },
  188. lockDetail() {
  189. const that = this;
  190. lockDetail({
  191. id: that.id
  192. }).then(
  193. (res) => {
  194. that.base = res.data.data;
  195. that.allMoney = that.base.single_time_max * (that.base.day_get * 1 + 100) * that.base.day /
  196. 100;
  197. }
  198. ).catch(
  199. (res) => {
  200. console.log(res);
  201. }
  202. )
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="scss">
  208. page {
  209. background-color: #191a1f;
  210. }
  211. .all {
  212. line-height: 1;
  213. padding-bottom: 190rpx;
  214. }
  215. .shang {
  216. font-weight: 800;
  217. background-color: $page-color-base;
  218. .tz {
  219. font-size: 33rpx;
  220. color: #FFFFFF;
  221. }
  222. .sy {
  223. .syl {
  224. background: #FEB041;
  225. border-radius: 10rpx;
  226. font-size: 21rpx;
  227. color: #000000;
  228. padding: 10rpx;
  229. }
  230. }
  231. .sj {
  232. font-weight: 800;
  233. text-align: center;
  234. .sj1 {
  235. width: 25%;
  236. .sz {
  237. font-size: 40rpx;
  238. color: #FFFFFF;
  239. }
  240. .wz {
  241. margin-top: 20rpx;
  242. font-size: 22rpx;
  243. color: #999999;
  244. padding-bottom: 20rpx;
  245. }
  246. }
  247. }
  248. .img {
  249. position: absolute;
  250. width: 325rpx;
  251. height: 285rpx;
  252. top: 0rpx;
  253. right: 40rpx;
  254. }
  255. }
  256. .sygc {
  257. background-color: $page-color-base;
  258. .gc {
  259. font-size: 28rpx;
  260. font-weight: 800;
  261. color: #FFFFFF;
  262. }
  263. .an {
  264. .an1 {
  265. width: 24rpx;
  266. height: 24rpx;
  267. border: 4px solid #FEB041;
  268. border-radius: 12rpx;
  269. }
  270. .xian {
  271. flex-grow: 1;
  272. height: 1rpx;
  273. background: #fff;
  274. }
  275. }
  276. }
  277. .wenben {
  278. background-color: $page-color-base;
  279. .wb {
  280. width: 33.3%;
  281. .wen {
  282. font-size: 22rpx;
  283. font-weight: 500;
  284. color: #999999;
  285. }
  286. }
  287. }
  288. .icon-box {
  289. background-color: $page-color-base;
  290. .icon:nth-child(2n-1) {
  291. background: #161616;
  292. }
  293. .icon {
  294. margin: 0 30rpx;
  295. border-radius: 10rpx;
  296. padding: 20rpx;
  297. .ic {
  298. width: 38rpx;
  299. height: 36rpx;
  300. }
  301. .jiaru {
  302. padding-left: 20rpx;
  303. height: 23rpx;
  304. font-size: 24rpx;
  305. color: #FFFFFF;
  306. }
  307. }
  308. }
  309. .jine {
  310. background-color: $page-color-base;
  311. font-weight: 800;
  312. padding: 30rpx;
  313. .je {
  314. font-size: 28rpx;
  315. color: #999999;
  316. }
  317. .jes {
  318. font-size: 74rpx;
  319. color: #FEB041;
  320. }
  321. }
  322. .yue {
  323. background-color: $page-color-base;
  324. width: 750rpx;
  325. color: #FFFFFF;
  326. font-size: 29rpx;
  327. padding: 30rpx;
  328. .qianbao {
  329. width: 80rpx;
  330. height: 64rpx;
  331. }
  332. .ye {}
  333. .dangqian {}
  334. .dqs {
  335. color: #FEB041;
  336. }
  337. }
  338. .liji {
  339. padding: 40rpx 30rpx;
  340. position: fixed;
  341. bottom: 0;
  342. left: 0;
  343. right: 0;
  344. background-color: $page-color-base;
  345. box-shadow: 0rpx 0rpx 20rpx #FFF;
  346. .jr {
  347. background: linear-gradient(90deg, #feb041 0%, #feb041 100%);
  348. border-radius: 10rpx;
  349. padding: 30rpx;
  350. text-align: center;
  351. }
  352. .jia {
  353. font-size: 32rpx;
  354. font-weight: bold;
  355. color: #040404;
  356. }
  357. }
  358. </style>