gift_confirm.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="cu-modal bottom-modal" :class="{'show': visible}">
  3. <view class="mask" @click="close"></view>
  4. <view class="wrapper cu-dialog">
  5. <view class="paddingY25 flex-align-center relative">
  6. <view class="font10 color-theme">
  7. 确认赠送吗?
  8. </view>
  9. <image :src="resource.icon_x" class="x" @click="close" />
  10. </view>
  11. <view>
  12. <view class="paddingB20">
  13. <scroll-view scroll-x class="scroll-wrapper" v-if="goods.length > 4">
  14. <view class="item" v-for="(goods, index) in goods" :key="index">
  15. <image class="super-image translateX" mode="aspectFit" :src="goods.cover" />
  16. </view>
  17. </scroll-view>
  18. <view v-else class="flex-align-around">
  19. <view class="item" v-for="(goods, index) in goods" :key="index">
  20. <image class="super-image translateX" mode="aspectFit" :src="goods.cover" />
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="bottom flex-align-between color-white" >
  26. <view class="left">受赠人:</view>
  27. <view class="right flex-align">
  28. <image class="img" :src="userData.avatar" mode="aspectFit" />
  29. <view class="">{{ userData.nickname }}</view>
  30. </view>
  31. </view>
  32. <view class="gift_text">
  33. 一键转赠仅用于好友间转赠商品,不提供其他任何场景使用,若因操作不当或过分使用造成的损失,本平台概不负责。
  34. </view>
  35. <cm-button ::height="44" @click="submit()">确认赠送</cm-button>
  36. <view class="fill"> </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import cmButton from '../../components/cm-button.vue'
  42. import resource from '@/utils/resource'
  43. export default {
  44. components: { cmButton },
  45. data() {
  46. return {
  47. resource,
  48. visible: false,
  49. goods: [],
  50. userData: [],
  51. param: {}
  52. }
  53. },
  54. mounted() {},
  55. methods: {
  56. show(data, goods,param) {
  57. this.goods = goods
  58. this.userData = data.toUser
  59. this.param = param
  60. this.visible = true
  61. },
  62. close() {
  63. this.visible = false
  64. this.$emit('close', false)
  65. },
  66. async submit() {
  67. const res = await this.$service.award.transferOrderSubmit(this.param)
  68. if (res.code === '0') {
  69. this.$emit('success')
  70. this.close()
  71. } else {
  72. this.$message.error(res.msg)
  73. }
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .mask {
  80. position: absolute;
  81. left: 0;
  82. right: 0;
  83. top: 0;
  84. bottom: 0;
  85. }
  86. .wrapper {
  87. padding: 0 28rpx;
  88. background: #171b1e;
  89. border-radius: 15px 15px 2px 2px;
  90. .title {
  91. width: 172rpx;
  92. height: 28rpx;
  93. }
  94. .x {
  95. position: absolute;
  96. right: 28rpx;
  97. top: 50%;
  98. margin-top: -16rpx;
  99. width: 32rpx;
  100. height: 32rpx;
  101. }
  102. .fill {
  103. height: 50rpx;
  104. }
  105. }
  106. .scroll-wrapper {
  107. padding-left: 28rpx;
  108. overflow: hidden;
  109. height: 182rpx;
  110. white-space: nowrap;
  111. width: 100%;
  112. .item {
  113. display: inline-block;
  114. margin-right: 8rpx;
  115. }
  116. }
  117. .item {
  118. width: 120rpx;
  119. height: 182rpx;
  120. position: relative;
  121. .super {
  122. position: absolute;
  123. z-index: 0;
  124. left: 0;
  125. top: 0;
  126. width: 120rpx;
  127. height: 182rpx;
  128. }
  129. .super-image {
  130. position: absolute;
  131. top: 14rpx;
  132. width: 109rpx;
  133. height: 120rpx;
  134. }
  135. .bg-title {
  136. color: #fff;
  137. font-size: 24rpx;
  138. text-align: center;
  139. position: absolute;
  140. left: 0;
  141. right: 0;
  142. bottom: 16rpx;
  143. // padding: 2rpx 0;
  144. }
  145. }
  146. .bottom {
  147. height: 60rpx;
  148. margin-bottom: 10rpx;
  149. .left {
  150. width: 100rpx;
  151. }
  152. .right {
  153. .img {
  154. width: 50rpx;
  155. height: 50rpx;
  156. border-radius: 50%;
  157. margin-right: 10rpx;
  158. }
  159. }
  160. }
  161. .gift_text {
  162. color: #999;
  163. font-size: 22rpx;
  164. margin-bottom: 20rpx;
  165. }
  166. </style>