zyXingqing.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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="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}}</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 + 100) * that.base.day /
  192. 100;
  193. }
  194. ).catch(
  195. (res) => {
  196. console.log(res);
  197. }
  198. )
  199. }
  200. }
  201. }
  202. </script>
  203. <style lang="scss">
  204. page {
  205. background-color: #191a1f;
  206. // background-color: #000000;
  207. }
  208. .all {
  209. line-height: 1;
  210. padding-bottom: 190rpx;
  211. }
  212. .shang {
  213. font-weight: 800;
  214. background-color: $page-color-base;
  215. .tz {
  216. font-size: 33rpx;
  217. color: #FFFFFF;
  218. }
  219. .sy {
  220. .syl {
  221. background: #FEB041;
  222. border-radius: 10rpx;
  223. font-size: 21rpx;
  224. color: #000000;
  225. padding: 10rpx;
  226. }
  227. }
  228. .sj {
  229. font-weight: 800;
  230. text-align: center;
  231. .sj1 {
  232. width: 25%;
  233. .sz {
  234. font-size: 40rpx;
  235. color: #FFFFFF;
  236. }
  237. .wz {
  238. margin-top: 20rpx;
  239. font-size: 22rpx;
  240. color: #999999;
  241. padding-bottom: 20rpx;
  242. }
  243. }
  244. }
  245. .img {
  246. position: absolute;
  247. width: 325rpx;
  248. height: 285rpx;
  249. top: 0rpx;
  250. right: 40rpx;
  251. }
  252. }
  253. .sygc {
  254. background-color: $page-color-base;
  255. .gc {
  256. font-size: 28rpx;
  257. font-weight: 800;
  258. color: #FFFFFF;
  259. }
  260. .an {
  261. .an1 {
  262. width: 24rpx;
  263. height: 24rpx;
  264. border: 4px solid #FEB041;
  265. border-radius: 12rpx;
  266. }
  267. .xian {
  268. flex-grow: 1;
  269. height: 1rpx;
  270. background: #fff;
  271. }
  272. }
  273. }
  274. .wenben {
  275. background-color: $page-color-base;
  276. .wb {
  277. width: 33.3%;
  278. .wen {
  279. font-size: 22rpx;
  280. font-weight: 500;
  281. color: #999999;
  282. }
  283. }
  284. }
  285. .icon-box {
  286. background-color: $page-color-base;
  287. .icon:nth-child(2n-1) {
  288. background: #161616;
  289. }
  290. .icon {
  291. margin: 0 30rpx;
  292. border-radius: 10rpx;
  293. padding: 20rpx;
  294. .ic {
  295. width: 38rpx;
  296. height: 36rpx;
  297. }
  298. .jiaru {
  299. padding-left: 20rpx;
  300. height: 23rpx;
  301. font-size: 24rpx;
  302. color: #FFFFFF;
  303. }
  304. }
  305. }
  306. .jine {
  307. background-color: $page-color-base;
  308. font-weight: 800;
  309. padding: 30rpx;
  310. .je {
  311. font-size: 28rpx;
  312. color: #999999;
  313. }
  314. .jes {
  315. font-size: 74rpx;
  316. color: #FEB041;
  317. }
  318. }
  319. .yue {
  320. background-color: $page-color-base;
  321. width: 750rpx;
  322. color: #FFFFFF;
  323. font-size: 29rpx;
  324. padding: 30rpx;
  325. .qianbao {
  326. width: 80rpx;
  327. height: 64rpx;
  328. }
  329. .ye {}
  330. .dangqian {}
  331. .dqs {
  332. color: #FEB041;
  333. }
  334. }
  335. .liji {
  336. padding: 40rpx 30rpx;
  337. position: fixed;
  338. bottom: 0;
  339. left: 0;
  340. right: 0;
  341. background-color: $page-color-base;
  342. .jr {
  343. background: linear-gradient(90deg, #feb041 0%, #feb041 100%);
  344. border-radius: 10rpx;
  345. padding: 30rpx;
  346. text-align: center;
  347. }
  348. .jia {
  349. font-size: 32rpx;
  350. font-weight: bold;
  351. color: #040404;
  352. }
  353. }
  354. </style>