duihuan.vue 4.8 KB

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