duihuan.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="center">
  3. <view class="rule-box">
  4. <view class="rule-title">兑换规则</view>
  5. <view class="rule-main">
  6. 每{{ list.sp_exchange_origin_cost * 1 }}{{ list.sp_exchange_origin }}+{{ list.sp_exchange_bingo_time }}幸运值可兑换{{ list.sp_exchange_target_get * 1
  7. }}{{ list.sp_exchange_target }}+{{ list.sp_exchange_bingo_time }}荣誉值
  8. </view>
  9. </view>
  10. <view class="main">
  11. <view class="main-title flex">
  12. <view class="shu"></view>
  13. <view class="main-font">福利兑换</view>
  14. </view>
  15. <view class="main-main flex">
  16. <view class="left flex">
  17. <view class="top font">
  18. <span>{{ list.sp_exchange_origin_cost * 1 || 0 }}</span>
  19. {{ list.sp_exchange_origin }}
  20. </view>
  21. <view class="zong font">+</view>
  22. <view class="bottom font">
  23. <span>{{ list.sp_exchange_bingo_time || 0 }}</span>
  24. 幸运值
  25. </view>
  26. </view>
  27. <view class="bg">
  28. <image src="../../static/img/duhuanbg.png" mode=""></image>
  29. </view>
  30. <view class="left flex">
  31. <view class="top font">
  32. <span>{{ list.sp_exchange_target_get * 1 || 0 }}</span>
  33. {{ list.sp_exchange_target }}
  34. </view>
  35. <view class="zong font">+</view>
  36. <view class="bottom font">
  37. <span>{{ list.sp_exchange_bingo_time || 0 }}</span>
  38. 荣誉值
  39. </view>
  40. </view>
  41. </view>
  42. <view class="sheng">
  43. 当前剩余USDL
  44. <span>{{ USDL || 0 }}</span>
  45. 幸运值
  46. <span>{{ lucky || 0 }}</span>
  47. </view>
  48. <view class="btn" @click="buy()">确认兑换</view>
  49. </view>
  50. <!-- <u-popup v-model="show1" mode="center" width="548rpx" border-radius="14">
  51. <view class="psw-wrapper">
  52. <view class="psw-title">请输入支付密码</view>
  53. <input type="password" v-model="password" class="psw-ipt" />
  54. <view class="psw-btn">
  55. <text @click="cancel">取消</text>
  56. <text class="psw-qd" @click="pswQd">确定</text>
  57. </view>
  58. </view>
  59. </u-popup> -->
  60. </view>
  61. </template>
  62. <script>
  63. import { lalaDetial } from '@/api/product.js';
  64. import { wallet } from '@/api/finance.js';
  65. import { spExchange } from '@/api/market.js';
  66. export default {
  67. data() {
  68. return {
  69. id: '',
  70. list: '',
  71. lucky: '',
  72. USDL: '',
  73. show1: false, //支付密码
  74. password: ''
  75. };
  76. },
  77. onLoad(option) {
  78. this.id = option.id;
  79. this.loadData();
  80. },
  81. methods: {
  82. async loadData() {
  83. lalaDetial({}, this.id)
  84. .then(({ data }) => {
  85. console.log(data);
  86. this.list = data.data;
  87. this.lucky = data.luck_point - data.exchange_point;
  88. })
  89. .catch(e => {
  90. console.log(e);
  91. });
  92. wallet({}).then(({ data }) => {
  93. this.USDL = data.back['USDL'].money.money * 1 - data.back['USDL'].money.only_pink *1;
  94. });
  95. },
  96. buy() {
  97. // this.show1 = true;
  98. spExchange({}, this.id).then(e => {
  99. uni.navigateTo({
  100. url:'/pages/money/paySuccess?type=1'
  101. })
  102. });
  103. },
  104. pswQd() {
  105. spExchange({}, this.id).then(e => {});
  106. },
  107. cancel() {
  108. this.show1 = false;
  109. }
  110. }
  111. };
  112. </script>
  113. <style lang="scss">
  114. .rule-box {
  115. width: 750px;
  116. padding: 30rpx;
  117. background: #ffffff;
  118. .rule-title {
  119. font-size: 26rpx;
  120. font-family: PingFang SC;
  121. font-weight: 500;
  122. color: #0f253a;
  123. }
  124. .rule-main {
  125. margin-top: 10rpx;
  126. font-size: 26rpx;
  127. font-family: PingFang SC;
  128. font-weight: 500;
  129. color: #6d7c88;
  130. }
  131. }
  132. .main {
  133. margin-top: 15rpx;
  134. width: 100%;
  135. background: #fff;
  136. padding-bottom: 220rpx;
  137. .main-title {
  138. padding: 20rpx 0 27rpx 30rpx;
  139. justify-content: flex-start;
  140. align-items: center;
  141. border-bottom: 1px #f3f3f3 solid;
  142. .shu {
  143. width: 2rpx;
  144. height: 30rpx;
  145. background: #44969d;
  146. }
  147. .main-font {
  148. margin-left: 16rpx;
  149. font-size: 30rpx;
  150. font-family: PingFang SC;
  151. font-weight: 500;
  152. color: #0f253a;
  153. }
  154. }
  155. .main-main {
  156. padding: 62rpx;
  157. .left {
  158. flex-direction: column;
  159. align-items: center;
  160. .font {
  161. font-size: 42rpx;
  162. font-family: PingFang SC;
  163. font-weight: bold;
  164. color: #000000;
  165. span {
  166. color: #44969d;
  167. }
  168. }
  169. .zong {
  170. margin-top: 20rpx;
  171. }
  172. .bottom {
  173. margin-top: 40rpx;
  174. }
  175. }
  176. .bg{
  177. width: 70rpx;
  178. height: 70rpx;
  179. image {
  180. width: 100%;
  181. height: 100%;
  182. }
  183. }
  184. }
  185. .sheng {
  186. padding: 30rpx 0 0 28rpx;
  187. font-size: 26rpx;
  188. font-family: PingFang SC;
  189. font-weight: 500;
  190. color: #6d7c88;
  191. span {
  192. color: #44969d;
  193. }
  194. }
  195. }
  196. .btn {
  197. margin: 130rpx auto;
  198. width: 674rpx;
  199. height: 88rpx;
  200. background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
  201. border-radius: 44rpx;
  202. font-size: 36rpx;
  203. font-family: PingFang SC;
  204. font-weight: 500;
  205. color: #ffffff;
  206. text-align: center;
  207. line-height: 88rpx;
  208. }
  209. .psw-wrapper {
  210. width: 548rpx;
  211. height: 344rpx;
  212. background-color: #ffffff;
  213. .psw-title {
  214. width: 100%;
  215. font-size: 35rpx;
  216. padding: 43rpx 0 49rpx;
  217. text-align: center;
  218. font-weight: 800;
  219. }
  220. .psw-ipt {
  221. display: block;
  222. background-color: #dce3ed;
  223. height: 90rpx;
  224. width: 464rpx;
  225. padding-left: 30rpx;
  226. margin: 0 auto;
  227. font-size: 80rpx;
  228. }
  229. .psw-btn text {
  230. display: inline-block;
  231. text-align: center;
  232. width: 50%;
  233. padding-top: 29rpx;
  234. font-size: 35rpx;
  235. }
  236. .psw-qd {
  237. color: #45969b;
  238. }
  239. }
  240. </style>