Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

equitySelection - 副本.vue 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view>
  3. <custom-header :back="false" title="选择权益"></custom-header>
  4. <view style="padding: 20rpx 0 30rpx" class="product-content">
  5. <view
  6. class="product-car"
  7. v-for="(item, index) in rightsInterests"
  8. @click="handleProduct(item)"
  9. :key="index"
  10. :class="{ noClick: item.isClick === 1 }"
  11. >
  12. <view class="l-info">
  13. <view class="goods-name">
  14. {{ item.productName }}
  15. </view>
  16. <view class="goods-des">
  17. <u-collapse
  18. :head-style="{ fontSize: '28rpx', color: '#fff' }"
  19. arrow-color="#fff"
  20. >
  21. <u-collapse-item :title="item.productIntro">
  22. <view class="collapse-item">
  23. {{ item.productIntro }}
  24. </view>
  25. </u-collapse-item>
  26. </u-collapse>
  27. </view>
  28. </view>
  29. <!-- <view class="r-amount">¥: {{ handleAmount(item.discountPrice) }}</view> -->
  30. <view class="r-amount">¥{{ handleAmount(price) }}</view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup lang="ts">
  36. import { unifyTemplate } from '@/hooks/unifyTemplate';
  37. import { nextTick, ref } from 'vue';
  38. import { onLoad } from '@dcloudio/uni-app';
  39. import handleAmount from '@/utils/handleAmount.js';
  40. import { request } from '@/utils/network/request';
  41. let config = ref<any>({
  42. submitName: '下一步',
  43. titleWidth: 160
  44. });
  45. const {
  46. CustomHeader, //头部组件
  47. initData, //初始化数据
  48. qdOrderVal, //qdOrder中数据 ref
  49. cusQdOrderVal
  50. } = unifyTemplate(); //初始化数据
  51. let show = ref(false);
  52. let price = ref(0);
  53. //获取页面配置
  54. onLoad((opin) => {
  55. initData(opin, -2).then((data) => {
  56. console.log(data);
  57. if (opin && opin.price) {
  58. price.value = opin.price;
  59. }
  60. getList(data.qdOrder);
  61. // isShow.value = true
  62. delete data.config.tableConfig;
  63. config.value = Object.assign(data.config, config.value);
  64. });
  65. });
  66. // 权益数据
  67. const rightsInterests = ref([]);
  68. // 获取权益
  69. function getList(qdOrder) {
  70. let query = {
  71. promoteId: cusQdOrderVal.value.promoteId
  72. };
  73. // request('58ac9653fdb24ee08409f94dde70dfa6', {
  74. console.log('请求参数', query);
  75. request('56db1aa8b9854f2f8c2428f3393e5045', {
  76. data: query
  77. }).then((res) => {
  78. if (res.statusCode === 0) {
  79. const bizContent = JSON.parse(res.bizContent);
  80. console.log(res, bizContent, '权益数据');
  81. rightsInterests.value = bizContent.data || [];
  82. }
  83. });
  84. }
  85. // 权益选择
  86. function handleProduct(e) {
  87. if (e.isClick) {
  88. uni.showModal({
  89. title: '提示',
  90. content: e.noClickCase + '请选择其他权益',
  91. });
  92. return;
  93. }
  94. cusQdOrderVal.value.equityId = e.equityId;
  95. let { jumpPage } = config.value;
  96. uni.navigateTo({
  97. url: '/' + jumpPage,
  98. animationType: 'pop-in',
  99. animationDuration: 500
  100. });
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .product-car {
  105. margin: 30rpx 30rpx 0;
  106. width: calc(100% - 60rpx);
  107. // height: 170rpx;
  108. border-radius: 20rpx;
  109. background-color: #57aef9;
  110. display: flex;
  111. justify-content: space-between;
  112. box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
  113. align-items: center;
  114. padding: 20rpx 40rpx 10rpx;
  115. &.noClick {
  116. background-color: #bbb;
  117. }
  118. .l-info {
  119. color: #fff;
  120. width: calc(100% - 120rpx);
  121. .goods-name {
  122. // margin-bottom: 16rpx;
  123. font-size: 32rpx;
  124. font-weight: bold;
  125. }
  126. .goods-des {
  127. font-size: 26rpx;
  128. width: 100%;
  129. }
  130. }
  131. .r-amount {
  132. flex-shrink: 0;
  133. font-size: 30rpx;
  134. color: #fff;
  135. font-weight: bold;
  136. }
  137. }
  138. .select-content {
  139. display: flex;
  140. align-items: center;
  141. padding: 30rpx;
  142. .fen {
  143. width: 2rpx;
  144. height: 150rpx;
  145. background-color: #eee;
  146. }
  147. .select-item {
  148. flex: 1 1 auto;
  149. text-align: center;
  150. .select-img {
  151. width: 120rpx;
  152. height: 120rpx;
  153. margin-bottom: 20rpx;
  154. }
  155. }
  156. }
  157. .collapse-item {
  158. font-size: 26rpx;
  159. color: #fff;
  160. }
  161. </style>