index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view>
  3. <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="我的奖品库"></u-navbar>
  4. <!-- 奖品选择 -->
  5. <view class="prize-state">
  6. <u-tabs @change="changeTab" :scrollable="false" :list="stateArr" lineWidth="40" lineHeight="1"
  7. lineColor="#D70909" :activeStyle="{
  8. color: '#D70909',
  9. transform: 'scale(1)'
  10. }" :inactiveStyle="{
  11. color: '#333',
  12. transform: 'scale(1)'
  13. }" itemStyle="padding-left: 25px; padding-right: 25px; height: 44px;">
  14. </u-tabs>
  15. </view>
  16. <!-- 实物商品 -->
  17. <view class="prize-goods" v-if="state == 0">
  18. <view class="prize-goods-list">
  19. <view class="flex prize-goods-list-item">
  20. <view class="flex checkbox">
  21. <u-checkbox-group>
  22. <u-checkbox :value="checked" shape="circle" :checked="checked" activeColor="#E96737"
  23. @change="changeChecked($event, item)"></u-checkbox>
  24. </u-checkbox-group>
  25. </view>
  26. <view class="flex info">
  27. <image src="../../static/logo.png" mode=""></image>
  28. <view class="flex desc">
  29. <view class="content">Apple iPhone 13 (A2634) 128GB 星光色 支持移动联通电信5G 双卡双待手机</view>
  30. <view class="num">数量:2</view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="flex prize-goods-list-item">
  35. <view class="flex checkbox">
  36. <u-checkbox-group>
  37. <u-checkbox :value="checked" shape="circle" :checked="checked" activeColor="#E96737"
  38. @change="changeChecked($event, item)"></u-checkbox>
  39. </u-checkbox-group>
  40. </view>
  41. <view class="flex info">
  42. <image src="../../static/logo.png" mode=""></image>
  43. <view class="flex desc">
  44. <view class="content">Apple iPhone 13 (A2634) 128GB 星光色 支持移动联通电信5G 双卡双待手机</view>
  45. <view class="num">数量:2</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 卡券 -->
  52. <view class="prize-coupon" v-else>
  53. <view class="prize-coupon-list">
  54. <navigator url="/pages/prize/detail" class="flex prize-coupon-list-item" hover-class="navigator-hover">
  55. <image src="../../static/logo.png" mode=""></image>
  56. <view class="flex info">
  57. <view class="flex desc">
  58. <view class="title">200元代金券</view>
  59. <view class="txt">使用期限:2022.03.02-2022.04.01</view>
  60. <view class="txt">适用范围:星巴克xxx店</view>
  61. </view>
  62. <view class="flex btn">
  63. <view class="amt"><text>¥</text>100</view>
  64. <view class="action">立即使用</view>
  65. </view>
  66. </view>
  67. </navigator>
  68. <navigator url="/pages/prize/detail" class="flex prize-coupon-list-item" hover-class="navigator-hover">
  69. <image src="../../static/logo.png" mode=""></image>
  70. <view class="flex info">
  71. <view class="flex desc">
  72. <view class="title">200元代金券</view>
  73. <view class="txt">使用期限:2022.03.02-2022.04.01</view>
  74. <view class="txt">适用范围:星巴克xxx店</view>
  75. </view>
  76. <view class="flex btn">
  77. <view class="amt"><text>¥</text>100</view>
  78. <view class="action">立即使用</view>
  79. </view>
  80. </view>
  81. </navigator>
  82. </view>
  83. </view>
  84. <view class="prize-action">
  85. <!-- 实物商品提货 -->
  86. <view class="flex prize-action-goods" v-if="state == 0">
  87. <view class="flex checkbox">
  88. <u-checkbox-group>
  89. <u-checkbox :value="checked" shape="circle" :checked="checked" activeColor="#E96737"
  90. @change="changeChecked($event, item)"></u-checkbox>
  91. </u-checkbox-group>
  92. </view>
  93. <view class="btn" @click="toSettlement">立即提货</view>
  94. </view>
  95. <!-- 卡券使用记录 -->
  96. <view class="flex prize-action-coupon" @click="toCoupon" v-else>
  97. <view class="title">卡券使用记录</view>
  98. <u-icon name="arrow-right" size="15" color="#333"></u-icon>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. export default {
  105. data() {
  106. return {
  107. stateArr: [{
  108. name: '实物商品'
  109. }, {
  110. name: '卡券',
  111. }],
  112. state: 0,
  113. checked: false,
  114. };
  115. },
  116. methods: {
  117. // 切换奖品
  118. changeTab(e) {
  119. if (e.index == 0) {
  120. this.state = 0
  121. } else if (e.index == 1) {
  122. this.state = 1
  123. }
  124. },
  125. changeChecked() {
  126. },
  127. // 查看卡券使用记录
  128. toCoupon() {
  129. uni.navigateTo({
  130. url: '/pages/prize/coupon'
  131. })
  132. },
  133. toSettlement() {
  134. uni.navigateTo({
  135. url: "/pages/order/settlement"
  136. })
  137. },
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .prize-state {
  143. position: fixed;
  144. background-color: #FFFFFF;
  145. width: 100%;
  146. padding-bottom: 16rpx;
  147. z-index: 10;
  148. }
  149. .prize-goods {
  150. margin-top: 104rpx;
  151. padding: 40rpx 30rpx 100rpx;
  152. &-list {
  153. &-item {
  154. justify-content: space-between;
  155. padding: 36rpx 16rpx;
  156. background-color: #fff;
  157. border-radius: 10rpx;
  158. margin-bottom: 40rpx;
  159. .checkbox {}
  160. .info {
  161. flex: 1;
  162. justify-content: flex-start;
  163. }
  164. image {
  165. width: 122rpx;
  166. height: 164rpx;
  167. }
  168. .desc {
  169. height: 164rpx;
  170. padding-left: 22rpx;
  171. flex: 1;
  172. flex-direction: column;
  173. align-items: flex-end;
  174. justify-content: space-between;
  175. }
  176. .content {
  177. line-height: 40rpx;
  178. overflow: hidden;
  179. text-overflow: ellipsis;
  180. display: -webkit-box;
  181. -webkit-box-orient: vertical;
  182. -webkit-line-clamp: 2;
  183. }
  184. .num {
  185. color: #8C8C8C;
  186. }
  187. }
  188. &-item:last-child {
  189. margin-bottom: 0;
  190. }
  191. }
  192. }
  193. .prize-coupon {
  194. margin-top: 104rpx;
  195. padding: 40rpx 30rpx 100rpx;
  196. &-list {
  197. &-item {
  198. justify-content: space-between;
  199. background-color: #FFFFFF;
  200. padding: 40rpx 20rpx;
  201. border-radius: 10rpx;
  202. margin-bottom: 40rpx;
  203. image {
  204. width: 94rpx;
  205. height: 132rpx;
  206. }
  207. .info {
  208. justify-content: space-between;
  209. flex: 1;
  210. }
  211. .desc {
  212. height: 132rpx;
  213. flex-direction: column;
  214. justify-content: space-between;
  215. align-items: flex-start;
  216. padding-left: 20rpx;
  217. }
  218. .txt {
  219. font-size: 24rpx;
  220. }
  221. .btn {
  222. flex-direction: column;
  223. }
  224. .amt {
  225. font-size: 48rpx;
  226. font-weight: bold;
  227. line-height: 72rpx;
  228. }
  229. text {
  230. font-size: 24rpx;
  231. }
  232. .action {
  233. width: 124rpx;
  234. height: 40rpx;
  235. line-height: 40rpx;
  236. border-radius: 20rpx;
  237. background-color: rgba(215, 9, 9, 100);
  238. color: rgba(255, 255, 255, 100);
  239. font-size: 24rpx;
  240. text-align: center
  241. }
  242. }
  243. &-item:last-child {
  244. margin-bottom: 0;
  245. }
  246. }
  247. }
  248. .prize-action {
  249. position: fixed;
  250. bottom: var(--window-bottom);
  251. left: 0;
  252. right: 0;
  253. z-index: 10;
  254. box-shadow: 0 -4rpx 10rpx 0 rgba(151, 151, 151, 0.24);
  255. background: #fff;
  256. width: 100%;
  257. // 设置ios刘海屏底部横线安全区域
  258. padding-bottom: constant(safe-area-inset-bottom);
  259. padding-bottom: env(safe-area-inset-bottom);
  260. &-goods {
  261. justify-content: space-between;
  262. padding: 30rpx 40rpx;
  263. .btn {
  264. width: 250rpx;
  265. height: 60rpx;
  266. line-height: 60rpx;
  267. border-radius: 10rpx;
  268. background-color: rgba(235, 112, 9, 100);
  269. color: rgba(255, 255, 255, 100);
  270. font-size: 28rpx;
  271. text-align: center;
  272. }
  273. }
  274. &-coupon {
  275. padding: 30rpx 40rpx;
  276. .title {
  277. margin-right: 20rpx;
  278. line-height: 40rpx;
  279. }
  280. }
  281. }
  282. </style>