details.vue 4.0 KB

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