You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

equitySelection - 副本 (2).vue 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view style="height: 100%">
  3. <custom-header :back="false" title="选择权益"></custom-header>
  4. <view class="product-content" v-if="selectEquity.equityId">
  5. <scroll-view scroll-y="true" style="height: 100%">
  6. <view class="content-title">{{ selectEquity.productName }}</view>
  7. <view class="content-price">价格:¥{{ handleAmount(price) }}</view>
  8. <view class="content-desc">权益简介:</view>
  9. <u-parse
  10. :html="selectEquity.productIntro"
  11. style="padding-left: 10rpx"
  12. ></u-parse>
  13. </scroll-view>
  14. </view>
  15. <view class="empty-con" v-else>
  16. <u-empty text="暂未选择权益" mode="data"></u-empty>
  17. </view>
  18. <view class="bottom-btn">
  19. <!-- <u-button
  20. @click="isPopupShow = true"
  21. :ripple="true"
  22. type="success"
  23. shape="circle"
  24. class="item-btn"
  25. >
  26. 选择权益
  27. </u-button> -->
  28. <view class="l-icon" @click="isPopupShow = true">
  29. <u-icon name="shopping-cart"></u-icon>
  30. <view class="icon-text">
  31. {{ selectEquity.equityId ? selectEquity.productName : '选择权益' }}
  32. </view>
  33. </view>
  34. <u-button
  35. class="item-btn"
  36. @click="handleConfirm"
  37. :ripple="true"
  38. shape="circle"
  39. >
  40. 确认申办该权益产品
  41. </u-button>
  42. </view>
  43. <u-popup mode="bottom" v-model="isPopupShow" height="60%">
  44. <view style="font-size: 40rpx; padding: 20rpx; text-align: center">
  45. 选择权益
  46. </view>
  47. <view class="popup-content">
  48. <scroll-view scroll-y="true" style="height: 100%">
  49. <u-cell-group>
  50. <u-cell-item
  51. v-for="(item, index) in rightsInterests"
  52. :title="item.productName"
  53. :value="handleAmount(price)"
  54. :key="index"
  55. @click="handleProduct(item)"
  56. :class="{ noClick: item.isClick === 1 }"
  57. ></u-cell-item>
  58. </u-cell-group>
  59. </scroll-view>
  60. </view>
  61. </u-popup>
  62. </view>
  63. </template>
  64. <script setup lang="ts">
  65. import { unifyTemplate } from '@/hooks/unifyTemplate';
  66. import { nextTick, ref } from 'vue';
  67. import { onLoad } from '@dcloudio/uni-app';
  68. import handleAmount from '@/utils/handleAmount.js';
  69. import { request } from '@/utils/network/request';
  70. let config = ref<any>({
  71. submitName: '下一步',
  72. titleWidth: 160
  73. });
  74. const {
  75. CustomHeader, //头部组件
  76. initData, //初始化数据
  77. qdOrderVal, //qdOrder中数据 ref
  78. cusQdOrderVal
  79. } = unifyTemplate(); //初始化数据
  80. let show = ref(false);
  81. let price = ref(0);
  82. let promoteId =ref('')
  83. //获取页面配置
  84. onLoad((opin) => {
  85. initData(opin, -2).then((data) => {
  86. console.log(data);
  87. if (opin) {
  88. if(opin.price){
  89. price.value = opin.price;
  90. }
  91. if(opin.promoteId){
  92. promoteId.value = opin.promoteId
  93. }
  94. }
  95. getList(data.qdOrder);
  96. // isShow.value = true
  97. delete data.config.tableConfig;
  98. config.value = Object.assign(data.config, config.value);
  99. });
  100. });
  101. // const content = ref(
  102. '<p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p><p>测试</p><p><img src="https://qtzl.etcjz.cn/sett-minio/20240320/ef510b6e9bb94cbd8c63d56a_image.png"></p>'
  103. // );
  104. // 权益数据
  105. const rightsInterests = ref([]);
  106. // 获取权益
  107. function getList(qdOrder) {
  108. let query = {
  109. promoteId: promoteId.value
  110. };
  111. // request('58ac9653fdb24ee08409f94dde70dfa6', {
  112. console.log('请求参数', query);
  113. request('56db1aa8b9854f2f8c2428f3393e5045', {
  114. data: query
  115. }).then((res) => {
  116. if (res.statusCode === 0) {
  117. const bizContent = JSON.parse(res.bizContent);
  118. console.log(res, bizContent, '权益数据');
  119. rightsInterests.value = bizContent.data || [];
  120. }
  121. });
  122. }
  123. const selectEquity = ref<any>({});
  124. // 权益选择
  125. function handleProduct(e) {
  126. isPopupShow.value = false;
  127. if (e.isClick) {
  128. uni.showModal({
  129. title: '提示',
  130. content: e.noClickCase + '请选择其他权益'
  131. });
  132. // return;
  133. }
  134. selectEquity.value = e;
  135. // cusQdOrderVal.value.equityId = e.equityId;
  136. // let { jumpPage } = config.value;
  137. // uni.navigateTo({
  138. // url: '/' + jumpPage,
  139. // animationType: 'pop-in',
  140. // animationDuration: 500
  141. // });
  142. // return
  143. }
  144. const isPopupShow = ref(false);
  145. function handleConfirm() {
  146. if (!selectEquity.value.equityId) {
  147. uni.showModal({
  148. title: '提示',
  149. content: '请选择权益后点击确认',
  150. success() {
  151. isPopupShow.value = true;
  152. }
  153. });
  154. return;
  155. }
  156. if (selectEquity.value.isClick) {
  157. uni.showModal({
  158. title: '提示',
  159. content: selectEquity.value.noClickCase + '请选择其他权益',
  160. success() {
  161. isPopupShow.value = true;
  162. }
  163. });
  164. return;
  165. }
  166. cusQdOrderVal.value.equityId = selectEquity.value.equityId;
  167. let { jumpPage } = config.value;
  168. uni.navigateTo({
  169. url: '/' + jumpPage,
  170. animationType: 'pop-in',
  171. animationDuration: 500
  172. });
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .product-content {
  177. height: calc(100% - 45px);
  178. font-size: 32rpx;
  179. color: #666;
  180. padding: 20rpx;
  181. padding-bottom: 140rpx;
  182. }
  183. .content-title {
  184. font-size: 50rpx;
  185. font-weight: bold;
  186. color: #222;
  187. }
  188. .content-price {
  189. font-size: 36rpx;
  190. padding-top: 20rpx;
  191. }
  192. .content-desc {
  193. font-size: 36rpx;
  194. padding: 20rpx 0;
  195. }
  196. .bottom-btn {
  197. position: fixed;
  198. bottom: 20rpx;
  199. width: 100%;
  200. display: flex;
  201. justify-content: space-around;
  202. align-items: center;
  203. padding: 20rpx;
  204. background: #fff;
  205. .l-icon {
  206. display: flex;
  207. flex-direction: column;
  208. justify-content: center;
  209. align-items: center;
  210. font-size: 44rpx;
  211. width: 30%;
  212. .icon-text {
  213. text-align: center;
  214. width: 100%;
  215. font-size: 26rpx;
  216. overflow: hidden;
  217. white-space: nowrap;
  218. text-overflow: ellipsis;
  219. -o-text-overflow: ellipsis;
  220. }
  221. }
  222. .item-btn {
  223. width: 55%;
  224. // display: flex;
  225. // justify-content: flex-end;
  226. margin-right: 20rpx;
  227. background-color: #a2d7fa;
  228. }
  229. }
  230. .popup-content {
  231. height: calc(100% - 80rpx);
  232. padding-bottom: 30rpx;
  233. .noClick {
  234. background-color: #eee !important;
  235. color: #ccc;
  236. }
  237. }
  238. .empty-con {
  239. text-align: center;
  240. margin-top: 40rpx;
  241. }
  242. </style>