Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view>
  3. <custom-header :back="false" title="选择产品"></custom-header>
  4. <view style="padding: 20rpx 0 30rpx" class="product-content">
  5. <!-- 获取产品展示 -->
  6. <view class="product-car" v-for='(item,index) in productList' @click="handleProduct(item)" :key='index'>
  7. <view class="left-amount">
  8. ¥: {{ item.fee * 0.01 }}
  9. </view>
  10. <view class="r-info">
  11. <view class="goods-name">
  12. {{ item.promoteName }}
  13. </view>
  14. <view class="goods-des">
  15. {{ item.cardTypeArr }}
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <u-modal v-model="show" :show-confirm-button='false' title='请选择办理车辆类型'>
  21. <view class="slot-content">
  22. <view class="select-content">
  23. <view class="select-item" @click="handleVanType(1)">
  24. <image :src="fileURL + 'image/index/icon-car.png'" mode="aspectFit" class='select-img'></image>
  25. <view>客车办理</view>
  26. </view>
  27. <view class="fen">
  28. </view>
  29. <view class="select-item" @click="handleVanType(2)">
  30. <image :src="fileURL + 'image/index/icon-truck.png'" mode="aspectFit" class='select-img'>
  31. </image>
  32. <view>货车办理</view>
  33. </view>
  34. </view>
  35. </view>
  36. </u-modal>
  37. </view>
  38. </template>
  39. <script setup lang='ts'>
  40. import {
  41. unifyTemplate
  42. } from '@/hooks/unifyTemplate'
  43. import {
  44. nextTick,
  45. ref,
  46. } from 'vue'
  47. import {
  48. onLoad
  49. } from '@dcloudio/uni-app';
  50. import {
  51. request
  52. } from '@/utils/network/request'
  53. import {
  54. fileURL
  55. } from '@/utils/network/api.js';
  56. let config = ref < any > ({
  57. submitName: '下一步',
  58. titleWidth: 160
  59. })
  60. const {
  61. CustomHeader, //头部组件
  62. initData, //初始化数据
  63. qdOrderVal, //qdOrder中数据 ref
  64. cusQdOrderVal
  65. } = unifyTemplate() //初始化数据
  66. let show = ref(false)
  67. //获取页面配置
  68. onLoad((opin) => {
  69. initData(opin, -2).then(data => {
  70. console.log(data);
  71. if (data.qdOrder.vanType === undefined) {
  72. // 不存在客户类型,开启弹窗
  73. setTimeout(() => {
  74. show.value = true
  75. }, 200)
  76. } else {
  77. setTimeout(() => {
  78. show.value = false
  79. }, 200)
  80. getList(data.qdOrder.vanType > 2 ? 2 : data.qdOrder.vanType)
  81. }
  82. // isShow.value = true
  83. delete data.config.tableConfig
  84. config.value = Object.assign(data.config, config.value)
  85. })
  86. })
  87. const productList = ref([])
  88. // 获取产品
  89. function getList(vanType) {
  90. let data = {
  91. type: vanType,
  92. agencyId: qdOrderVal.value.promoterChannelNum
  93. }
  94. request('58ac9653fdb24ee08409f94dde70dfa6', {
  95. data
  96. }).then((res) => {
  97. if (res.statusCode === 0) {
  98. const data = JSON.parse(res.bizContent);
  99. console.log(res, data);
  100. let cardTypeArr = ''
  101. let opt = {
  102. 1: '记账卡',
  103. 2: '储值卡',
  104. 3: '记存卡'
  105. }
  106. data.csmsnPromoteDistPro.forEach(ele => {
  107. ele.cardType.forEach(item => {
  108. cardTypeArr = cardTypeArr + ' ' + opt[item]
  109. console.log(opt[item]);
  110. })
  111. ele.cardTypeArr= cardTypeArr
  112. })
  113. productList.value = data.csmsnPromoteDistPro || []
  114. }
  115. })
  116. }
  117. // 客货类型选择
  118. function handleVanType(type) {
  119. console.log(type);
  120. cusQdOrderVal.value.vanType = type
  121. getList(type)
  122. show.value = false
  123. // let {
  124. // jumpPage
  125. // } = config.value
  126. // uni.navigateTo({
  127. // url: '/' + jumpPage,
  128. // animationType: 'pop-in',
  129. // animationDuration: 500
  130. // })
  131. }
  132. // 产品选择
  133. function handleProduct(e) {
  134. cusQdOrderVal.value.promoteId = e.promoteId
  135. let {
  136. jumpPage
  137. } = config.value
  138. uni.navigateTo({
  139. url: '/' + jumpPage,
  140. animationType: 'pop-in',
  141. animationDuration: 500
  142. })
  143. // return
  144. // request(commitInterface || '198172b1858d474fa8e35225d65014d7', {
  145. // data,
  146. // }).then((res) => {
  147. // if (res.statusCode === 0) {
  148. // uni.navigateTo({
  149. // url: '/' + jumpPage,
  150. // animationType: 'pop-in',
  151. // animationDuration: 500
  152. // })
  153. // }
  154. // })
  155. }
  156. </script>
  157. <style lang='scss' scoped>
  158. .product-content {}
  159. .product-car {
  160. margin: 30rpx 30rpx 0;
  161. width: calc(100% - 60rpx);
  162. height: 200rpx;
  163. border-radius: 20rpx;
  164. background-color: #73acf9;
  165. display: flex;
  166. justify-content: space-between;
  167. align-items: center;
  168. .left-amount {
  169. font-size: 70rpx;
  170. color: #fff;
  171. padding-left: 20rpx;
  172. }
  173. .r-info {
  174. padding-right: 20rpx;
  175. text-align: right;
  176. color: #fff;
  177. .goods-name {
  178. margin-bottom: 20rpx;
  179. font-size: 32rpx;
  180. }
  181. .goods-des {
  182. font-size: 26rpx;
  183. }
  184. }
  185. }
  186. .select-content {
  187. display: flex;
  188. align-items: center;
  189. padding: 30rpx;
  190. .fen {
  191. width: 2rpx;
  192. height: 150rpx;
  193. background-color: #eee;
  194. }
  195. .select-item {
  196. flex: 1 1 auto;
  197. text-align: center;
  198. .select-img {
  199. width: 120rpx;
  200. height: 120rpx;
  201. margin-bottom: 20rpx;
  202. }
  203. }
  204. }
  205. </style>