details.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="center">
  3. <view class="top"><image :src="list.logo" mode=""></image></view>
  4. <view class="name-box">
  5. <view class="price-box">
  6. 兑换价:
  7. <text class="price">{{price * 1}}</text>
  8. <text class="unit">{{ list.cost_money_type}}</text>
  9. <!-- <text class="yuan">¥229</text> -->
  10. </view>
  11. <view class="name clamp">{{list.name}}</view>
  12. </view>
  13. <view class="tip-box">
  14. <view class="tip-titele">兑换须知</view>
  15. <view class="tip-main">兑换说明详细介绍兑换说明详细介绍兑换兑换说明详细介绍兑换说明详细介绍兑换说明详细介绍</view>
  16. </view>
  17. <view class="detail">
  18. <view class="detail-title">
  19. 商品详情
  20. </view>
  21. <view class="systom" v-html="list.detail">
  22. </view>
  23. </view>
  24. <view class="btn" @click="buy()">
  25. 立即兑换
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import { miningDateils } from '@/api/market.js';
  31. import uniNumberBox from '@/components/uni-number-box.vue';
  32. export default {
  33. components: {
  34. uniNumberBox
  35. },
  36. data() {
  37. return {
  38. id: '',
  39. type: '',
  40. num: 1,
  41. step: 0,
  42. password: '',
  43. price: '',
  44. list: {},
  45. checked: false,
  46. current: 0
  47. };
  48. },
  49. onLoad(option) {
  50. this.id = option.id;
  51. this.type = option.type;
  52. this.loadData();
  53. },
  54. computed: {
  55. money() {
  56. return this.num * this.price * this.step;
  57. }
  58. },
  59. onShow() {},
  60. methods: {
  61. async loadData() {
  62. let obj = this;
  63. miningDateils({}, obj.id).then(({ data }) => {
  64. obj.list = data;
  65. // obj.money = obj.list.cost_money;
  66. obj.price = obj.list.cost_money;
  67. obj.step = obj.list.step;
  68. console.log(obj.list);
  69. });
  70. },
  71. ToIndex() {
  72. uni.navigateTo({
  73. url: '/pages/finance/xieyi'
  74. });
  75. },
  76. numberChange(data) {
  77. let obj = this;
  78. obj.num = data.number;
  79. },
  80. buy() {
  81. // let list = JSON.stringify(this.list)
  82. uni.navigateTo({
  83. url: '/pages/market/pay?&id=' + this.id + '&type=' + this.type
  84. });
  85. // console.log(this.list,'--------------***********')
  86. // console.log('buy click')
  87. },
  88. changeCurrent(index) {
  89. this.current = index;
  90. },
  91. back() {
  92. uni.navigateTo({
  93. url: '/pages/market/pay?&id=' + this.id + '&type=' + this.type
  94. });
  95. }
  96. }
  97. };
  98. </script>
  99. <style lang="scss" scoped>
  100. page,
  101. .center {
  102. background: #f8f6f6;
  103. height: 100%;
  104. }
  105. .top {
  106. width: 750rpx;
  107. height: 710rpx;
  108. image {
  109. width: 100%;
  110. height: 100%;
  111. }
  112. }
  113. .name-box {
  114. padding: 30rpx 26rpx;
  115. line-height: 1;
  116. background-color: #FFFFFF;
  117. .price-box {
  118. font-size: 28rpx;
  119. font-family: PingFang SC;
  120. font-weight: bold;
  121. color: #333333;
  122. .price {
  123. font-size: 48rpx;
  124. color: #E83F30;
  125. }
  126. .unit {
  127. display: inline-block;
  128. padding-left: 10rpx;
  129. color: #E83F30;
  130. }
  131. .yuan {
  132. padding-left: 10rpx;
  133. font-size: 30rpx;
  134. font-weight: 500;
  135. text-decoration: line-through;
  136. color: #999999;
  137. }
  138. }
  139. .name {
  140. font-size: 34rpx;
  141. font-family: PingFang SC;
  142. font-weight: bold;
  143. color: #1D2023;
  144. margin-top: 30rpx;
  145. }
  146. }
  147. .tip-box {
  148. margin-top: 20rpx;
  149. padding: 34rpx 90rpx 50rpx 30rpx;
  150. display: flex;
  151. align-items: flex-start;
  152. background-color: #FFFFFF;
  153. .tip-titele {
  154. font-size: 32rpx;
  155. font-family: PingFang SC;
  156. font-weight: bold;
  157. color: #3B3B3B;
  158. }
  159. .tip-main {
  160. margin-left: 30rpx;
  161. width: 467rpx;
  162. font-size: 26rpx;
  163. font-family: PingFang SC;
  164. font-weight: 500;
  165. color: #8A8A8A;
  166. }
  167. }
  168. .detail {
  169. .detail-title{
  170. width: 750rpx;
  171. height: 80rpx;
  172. line-height: 80rpx;
  173. text-align: center;
  174. font-size: 28rpx;
  175. font-family: PingFangSC;
  176. font-weight: bold;
  177. color: #1D2023;
  178. }
  179. }
  180. .btn {
  181. position: fixed;
  182. bottom: 0;
  183. left: 0;
  184. right: 0;
  185. width: 750rpx;
  186. height: 98rpx;
  187. background: linear-gradient(0deg, #2E58FF, #32C6FF);
  188. text-align: center;
  189. line-height: 98rpx;
  190. font-size: 36rpx;
  191. font-family: PingFang SC;
  192. font-weight: bold;
  193. color: #FFFFFF;
  194. }
  195. </style>