details.vue 4.1 KB

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