detail.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view>
  3. <u-navbar title="兑换详情" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
  4. <view class="detail">
  5. <view class="detail-top">
  6. <u-swiper :list="picUrlArr" height="348" :indicator="true" :circular="true"></u-swiper>
  7. </view>
  8. <view class="detail-title">
  9. <view class="txt">Apple iPhone 13 (A2634) 128GB 星光色 支持移动联通电信5G 双卡双待手机</view>
  10. <view class="coin">
  11. <image src="../../static/logo.png" mode=""></image>
  12. <view>x 6800</view>
  13. </view>
  14. </view>
  15. <view class="detail-goods">商品详情</view>
  16. </view>
  17. <view class="footer-fixed">
  18. <view class="flex btn">
  19. <button type="default" @click="exChange">立即兑换</button>
  20. </view>
  21. </view>
  22. <!-- 兑换选择 -->
  23. <u-popup :show="choiceShow" mode="bottom" @close="close" :closeable="true">
  24. <view class="choiceShow-wrap">
  25. <view class="flex goods">
  26. <view class="flex image-wrap">
  27. <image src="../../static/logo.png" mode="aspectFill"></image>
  28. </view>
  29. <view class="info">
  30. <view class="info-title">Apple iPhone 13 (A2634) 128GB 星光色 支持移动联通电信5G 双卡双待手机</view>
  31. <view class="info-coin">
  32. <image src="../../static/logo.png" mode=""></image>
  33. <view>x 6800</view>
  34. </view>
  35. <view class="info-stock">库存:234</view>
  36. </view>
  37. </view>
  38. <view class="sku">
  39. <view class="sku-title">颜色</view>
  40. <view class="flex sku-list">
  41. <view class="sku-list-item">红色</view>
  42. <view class="sku-list-item">黑色</view>
  43. </view>
  44. </view>
  45. <view class="sku">
  46. <view class="sku-title">颜色</view>
  47. <view class="flex sku-list">
  48. <view class="sku-list-item">红色</view>
  49. <view class="sku-list-item">黑色</view>
  50. </view>
  51. </view>
  52. <view class="flex quantity">
  53. <view class="quantity-title">兑换数量</view>
  54. <view class="quantity-title">
  55. <u-number-box v-model="value" :min="1" @change="valChange"></u-number-box>
  56. </view>
  57. </view>
  58. <view class="flex btn">
  59. <view class="flex btn-left">
  60. <view class="title">应付:</view>
  61. <view class="flex coin">
  62. <image src="../../static/logo.png" mode=""></image>
  63. <view>x 6800</view>
  64. </view>
  65. </view>
  66. <view class="btn-right">
  67. <view class="confirm">立即兑换</view>
  68. </view>
  69. </view>
  70. </view>
  71. </u-popup>
  72. </view>
  73. </template>
  74. <script>
  75. import env from '../../config/env.js'
  76. import $http from '@/utils/request.js'
  77. export default {
  78. data() {
  79. return {
  80. boxId: '',
  81. picUrlArr: [
  82. 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
  83. 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
  84. 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  85. ],
  86. info: {},
  87. prizeList: [],
  88. choiceShow: false,
  89. value: 1,
  90. };
  91. },
  92. onLoad(opthios) {
  93. // this.getDetail(opthios.boxId)
  94. },
  95. methods: {
  96. getDetail(id) {
  97. $http.post('/api/v1/mp/channel/mall/ticket/detail', {
  98. boxId: id
  99. }).then(res => {
  100. if (res.code == 0) {
  101. this.info = res.data
  102. let picUrlArr = res.data.picUrl.split(',')
  103. picUrlArr.forEach(item => {
  104. this.picUrlArr.push(env.filePublic + item)
  105. })
  106. let prizeList = res.data.prizeList
  107. prizeList.forEach(item => {
  108. item.picUrl = env.filePublic + item.picUrl
  109. })
  110. this.prizeList = prizeList
  111. }
  112. })
  113. },
  114. exChange() {
  115. this.choiceShow = true
  116. },
  117. close() {
  118. this.choiceShow = false
  119. },
  120. valChange(e) {
  121. console.log(e);
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. </style>
  128. <style lang="scss" scoped>
  129. .detail {
  130. padding-bottom: 100rpx;
  131. &-top {
  132. height: 696rpx;
  133. background-color: #FFFFFF;
  134. }
  135. &-title {
  136. padding: 24rpx;
  137. background-color: #FFFFFF;
  138. margin-bottom: 10rpx;
  139. .txt {
  140. font-size: 32rpx;
  141. line-height: 44rpx;
  142. overflow: hidden;
  143. text-overflow: ellipsis;
  144. display: -webkit-box;
  145. -webkit-box-orient: vertical;
  146. -webkit-line-clamp: 2;
  147. margin-bottom: 24rpx;
  148. font-weight: bold;
  149. }
  150. .coin {
  151. display: flex;
  152. align-items: center;
  153. font-size: 32rpx;
  154. line-height: 44rpx;
  155. color: rgba(235, 112, 9, 100);
  156. }
  157. image {
  158. width: 42rpx;
  159. height: 42rpx;
  160. margin-right: 20rpx;
  161. }
  162. }
  163. &-goods {
  164. height: 88rpx;
  165. text-align: center;
  166. line-height: 88rpx;
  167. font-weight: bold;
  168. background-color: #FFFFFF;
  169. }
  170. }
  171. .choiceShow-wrap {
  172. min-height: 400rpx;
  173. padding: 80rpx 20rpx 60rpx;
  174. .goods {
  175. justify-content: space-between;
  176. margin-bottom: 20rpx;
  177. .image-wrap {
  178. width: 220rpx;
  179. height: 220rpx;
  180. border: 1px solid rgba(236, 236, 236, 100);
  181. border-radius: 10rpx;
  182. image {
  183. width: 174rpx;
  184. height: 174rpx;
  185. }
  186. }
  187. .info {
  188. flex: 1;
  189. display: flex;
  190. flex-direction: column;
  191. justify-content: space-between;
  192. padding-left: 26rpx;
  193. &-title {
  194. font-size: 32rpx;
  195. line-height: 44rpx;
  196. font-weight: bold;
  197. }
  198. &-coin {
  199. display: flex;
  200. align-items: center;
  201. font-size: 32rpx;
  202. line-height: 44rpx;
  203. color: rgba(235, 112, 9, 100);
  204. font-weight: bold;
  205. image {
  206. width: 42rpx;
  207. height: 42rpx;
  208. margin-right: 20rpx;
  209. }
  210. }
  211. &-stock {
  212. line-height: 44rpx;
  213. }
  214. }
  215. }
  216. .sku {
  217. margin-bottom: 30rpx;
  218. &-title {
  219. line-height: 42rpx;
  220. }
  221. &-list {
  222. justify-content: flex-start;
  223. &-item {
  224. line-height: 44rpx;
  225. padding: 0 20rpx;
  226. border: 1px solid rgba(187, 187, 187, 100);
  227. margin-left: 36rpx;
  228. }
  229. &-item:first-child {
  230. margin-left: 0;
  231. }
  232. }
  233. }
  234. .quantity {
  235. justify-content: space-between;
  236. margin-bottom: 40rpx;
  237. }
  238. .btn {
  239. justify-content: space-between;
  240. &-left {
  241. .coin {
  242. display: flex;
  243. align-items: center;
  244. font-size: 32rpx;
  245. line-height: 44rpx;
  246. color: rgba(235, 112, 9, 100);
  247. font-weight: bold;
  248. margin-left: 20rpx;
  249. image {
  250. width: 42rpx;
  251. height: 42rpx;
  252. margin-right: 20rpx;
  253. }
  254. }
  255. }
  256. &-right {
  257. .confirm {
  258. width: 250rpx;
  259. height: 60rpx;
  260. line-height: 60rpx;
  261. border-radius: 8px;
  262. background-color: rgba(235, 112, 9, 100);
  263. color: rgba(255, 255, 255, 100);
  264. font-size: 28rpx;
  265. text-align: center;
  266. }
  267. }
  268. }
  269. }
  270. .footer-fixed {
  271. position: fixed;
  272. bottom: var(--window-bottom);
  273. left: 0;
  274. right: 0;
  275. z-index: 11;
  276. box-shadow: 0 -4rpx 40rpx 0 rgba(151, 151, 151, 0.24);
  277. background: #fff;
  278. // 设置ios刘海屏底部横线安全区域
  279. padding-bottom: constant(safe-area-inset-bottom);
  280. padding-bottom: env(safe-area-inset-bottom);
  281. .btn {
  282. padding: 20rpx 40rpx;
  283. /deep/ button {
  284. width: 100%;
  285. line-height: 60rpx;
  286. font-size: 28rpx;
  287. height: 60rpx;
  288. color: #fff;
  289. background-color: $uni-bg-color;
  290. border: none;
  291. border-radius: 100rpx;
  292. }
  293. }
  294. }
  295. </style>