zyXingqing.vue 7.8 KB

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