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.

productSelection.vue 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <template>
  2. <view class="bg-content">
  3. <image
  4. class="bg-image"
  5. mode="widthFix"
  6. src="https://qtzl.etcjz.cn/sett-minio/20240326/35ca98a43c7d4b7fb4c05013_bingjingxin.png"
  7. ></image>
  8. <view class="content-re" style="height: 100%">
  9. <!-- <custom-header :back="false" title="选择产品"></custom-header> -->
  10. <view class="content-title">请选择办理产品类型</view>
  11. <view class="product-content">
  12. <scroll-view scroll-y="true" style="height: 100%">
  13. <view
  14. class="product-car"
  15. v-for="item in productList"
  16. :key="item.promoteId"
  17. >
  18. <view class="product-car-top">
  19. <view class="car-title">
  20. {{ item.releaseProductStandards.productName }}
  21. </view>
  22. <view class="car-type">{{ item.cardTypeArr }}</view>
  23. </view>
  24. <!-- <view class="equity-car" @click="handleProduct(item, equityItem)"> -->
  25. <view
  26. class="equity-car"
  27. @click="handleProduct(item, equityItem)"
  28. v-for="(equityItem, index) in item.releaseProductStandards
  29. .equityList"
  30. :key="index"
  31. :class="{ noClick: equityItem.isClick === 1 }"
  32. >
  33. <view class="l-info">
  34. <view class="info-top">
  35. <view class="equity-title">
  36. {{ equityItem.productName }}
  37. <!-- 途虎无忧套餐 -->
  38. </view>
  39. <u-icon
  40. name="arrow-right"
  41. size="28"
  42. style="flex-shrink: 0"
  43. ></u-icon>
  44. </view>
  45. <view class="selling-point">{{ equityItem.sellingPoint }}</view>
  46. <!-- <view class="selling-point">尊享套餐330元汽车养美服务</view> -->
  47. </view>
  48. <view class="r-price">
  49. <view class="top-discount">
  50. ¥{{ handleAmount(equityItem.discountPrice) }}
  51. </view>
  52. <view class="bottom-original" v-if="equityItem.originalPrice">
  53. 原价:
  54. <text class="original-pri">
  55. {{ handleAmount(equityItem.originalPrice) }}元
  56. </text>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </scroll-view>
  62. </view>
  63. <view class="empty" v-if="!loaing && productList.length === 0">
  64. 暂无办理产品,请敬请期待
  65. </view>
  66. </view>
  67. <u-modal
  68. v-model="show"
  69. :show-confirm-button="false"
  70. title="请选择办理车辆类型"
  71. >
  72. <view class="slot-content">
  73. <view class="select-content">
  74. <view class="select-item" @click="handleVanType(1)">
  75. <image
  76. :src="fileURL + 'image/index/icon-car.png'"
  77. mode="aspectFit"
  78. class="select-img"
  79. ></image>
  80. <view>客车办理</view>
  81. </view>
  82. <view class="fen"></view>
  83. <view class="select-item" @click="handleVanType(2)">
  84. <image
  85. :src="fileURL + 'image/index/icon-truck.png'"
  86. mode="aspectFit"
  87. class="select-img"
  88. ></image>
  89. <view>货车办理</view>
  90. </view>
  91. </view>
  92. </view>
  93. </u-modal>
  94. <u-modal
  95. v-model="isUserTypeshow"
  96. :show-confirm-button="false"
  97. title="请选择ETC用户类型"
  98. >
  99. <view class="slot-content">
  100. <view class="select-content">
  101. <view class="select-item" @click="handleUserType(1)">
  102. <image
  103. :src="fileURL + 'image/index/icon-personal.png'"
  104. mode="aspectFit"
  105. class="select-img"
  106. ></image>
  107. <view>个人办理</view>
  108. </view>
  109. <view class="fen"></view>
  110. <view class="select-item" @click="handleUserType(2)">
  111. <image
  112. :src="fileURL + 'image/index/icon-unit.png'"
  113. mode="aspectFit"
  114. class="select-img"
  115. ></image>
  116. <view>单位办理</view>
  117. </view>
  118. </view>
  119. </view>
  120. </u-modal>
  121. </view>
  122. </template>
  123. <script setup lang="ts">
  124. import { unifyTemplate } from '@/hooks/unifyTemplate';
  125. import { ref } from 'vue';
  126. import { onLoad } from '@dcloudio/uni-app';
  127. import { request } from '@/utils/network/request';
  128. import { fileURL } from '@/utils/network/api.js';
  129. import handleAmount from '@/utils/handleAmount.js';
  130. let config = ref<any>({
  131. submitName: '下一步',
  132. titleWidth: 160
  133. });
  134. const {
  135. CustomHeader, //头部组件
  136. initData, //初始化数据
  137. qdOrderVal, //qdOrder中数据 ref
  138. cusQdOrderVal
  139. } = unifyTemplate(); //初始化数据
  140. let show = ref(false);
  141. //获取页面配置
  142. onLoad((opin) => {
  143. initData(opin, -2).then((data) => {
  144. console.log(data);
  145. // getLoti()
  146. if (data.qdOrder.vanType === undefined) {
  147. // 不存在客户类型,开启弹窗
  148. setTimeout(() => {
  149. show.value = true;
  150. }, 200);
  151. } else {
  152. setTimeout(() => {
  153. show.value = false;
  154. }, 200);
  155. handleUserTypeShow();
  156. }
  157. // isShow.value = true
  158. delete data.config.tableConfig;
  159. config.value = Object.assign(data.config, config.value);
  160. });
  161. });
  162. const productList = ref([]);
  163. const loaing = ref(true);
  164. // 获取产品
  165. function getList() {
  166. // 请求数据
  167. let data = {
  168. // type: 1,
  169. // agencyId: '52010188919'
  170. agencyId: qdOrderVal.value.promoterChannelNum,
  171. vanType: qdOrderVal.value.vanType || cusQdOrderVal.value.vanType,
  172. userType: qdOrderVal.value.userType || cusQdOrderVal.value.userType
  173. };
  174. // request('58ac9653fdb24ee08409f94dde70dfa6', {
  175. console.log('请求参数', data);
  176. request('f01002fa6ded4162afaec1139e503641', {
  177. data
  178. })
  179. .then((res) => {
  180. if (res.statusCode === 0) {
  181. const data = JSON.parse(res.bizContent);
  182. console.log(res, data, '产品数据');
  183. let opt = {
  184. 1: '记账卡',
  185. 2: '储值卡',
  186. 3: '记存卡'
  187. };
  188. let proList = data.list || [];
  189. proList.forEach((ele) => {
  190. let cardTypeArr = '';
  191. ele.releaseProductStandards.productStandards.cardType.forEach(
  192. (item) => {
  193. cardTypeArr = cardTypeArr + ' ' + opt[item];
  194. console.log(opt[item]);
  195. }
  196. );
  197. ele.cardTypeArr = cardTypeArr;
  198. });
  199. productList.value = proList;
  200. }
  201. })
  202. .finally(() => {
  203. loaing.value = false;
  204. });
  205. }
  206. // 客货类型选择
  207. function handleVanType(type) {
  208. console.log(type);
  209. cusQdOrderVal.value.vanType = type;
  210. handleUserTypeShow();
  211. show.value = false;
  212. }
  213. let isUserTypeshow = ref(false);
  214. function handleUserTypeShow() {
  215. if (!qdOrderVal.value.userType) {
  216. isUserTypeshow.value = true;
  217. } else {
  218. getList();
  219. }
  220. }
  221. // 用户类型选择
  222. function handleUserType(val) {
  223. cusQdOrderVal.value.userType = val;
  224. isUserTypeshow.value = false;
  225. getList();
  226. }
  227. // 产品选择
  228. function handleProduct(product, equityItem) {
  229. // let { jumpPage } = config.value;
  230. if (equityItem.isClick) {
  231. uni.showModal({
  232. title: '提示',
  233. content: equityItem.noClickCase + '请选择其他权益'
  234. });
  235. return;
  236. }
  237. cusQdOrderVal.value.promoteId = product.promoteId;
  238. cusQdOrderVal.value.productIntro = equityItem.productIntro;
  239. uni.navigateTo({
  240. url:
  241. '/pages/equitySelection/equitySelection?equityId=' + equityItem.equityId,
  242. animationType: 'pop-in',
  243. animationDuration: 500
  244. });
  245. }
  246. function getLoti() {
  247. console.log('获取经纬度111');
  248. uni.getLocation({
  249. type: 'gcj02',
  250. // type: 'wgs84',
  251. accuracy: 'best',
  252. isHighAccuracy: true,
  253. success: function (res) {
  254. console.log('当前位置的经度高德:' + res.longitude);
  255. console.log('当前位置的纬度高德:' + res.latitude);
  256. console.log(res);
  257. },
  258. fail: (error) => {
  259. console.error('err:', error);
  260. }
  261. });
  262. }
  263. </script>
  264. <style lang="scss" scoped>
  265. .bg-content {
  266. height: 100%;
  267. width: 100%;
  268. background: #f4f6fa;
  269. }
  270. .content-title {
  271. font-size: 38rpx;
  272. height: 540rpx;
  273. box-sizing: border-box;
  274. display: flex;
  275. color: #394357;
  276. align-items: flex-end;
  277. justify-content: center;
  278. padding-bottom: 40rpx;
  279. }
  280. .product-content {
  281. padding: 0 44rpx 40rpx;
  282. height: calc(100% - 540rpx);
  283. box-sizing: border-box;
  284. overflow: hidden;
  285. }
  286. .empty {
  287. text-align: center;
  288. margin-top: 40rpx;
  289. }
  290. .product-car:nth-child(n + 2) {
  291. margin-top: 40rpx;
  292. }
  293. .product-car {
  294. overflow: hidden;
  295. padding: 50rpx 26rpx;
  296. // border: 1rpx solid rgba(187, 187, 187, 1);
  297. background-color: rgba(255, 255, 255, 1);
  298. border-radius: 14rpx;
  299. .product-car-top {
  300. display: flex;
  301. align-items: center;
  302. justify-content: space-between;
  303. padding-bottom: 30rpx;
  304. .car-title {
  305. font-size: 45rpx;
  306. font-weight: bold;
  307. }
  308. .car-type {
  309. flex-shrink: 0;
  310. }
  311. }
  312. .equity-car {
  313. &.noClick {
  314. background-color: #bbb;
  315. color: #fff;
  316. }
  317. display: flex;
  318. align-items: center;
  319. justify-content: space-between;
  320. color: #fff;
  321. background-color: #4095e5;
  322. margin-top: 30rpx;
  323. padding: 30rpx 20rpx;
  324. border-radius: 16rpx;
  325. .l-info {
  326. flex-grow: 1;
  327. .info-top {
  328. display: flex;
  329. align-items: center;
  330. font-size: 34rpx;
  331. font-weight: bold;
  332. margin-bottom: 10rpx;
  333. .equity-title {
  334. margin-right: 5rpx;
  335. overflow: hidden;
  336. text-overflow: ellipsis;
  337. display: -webkit-box;
  338. -webkit-box-orient: vertical;
  339. -webkit-line-clamp: 2;
  340. }
  341. }
  342. .selling-point {
  343. font-size: 26rpx;
  344. }
  345. }
  346. .r-price {
  347. font-size: 34rpx;
  348. color: #ffbf6b;
  349. font-weight: bold;
  350. padding-left: 20rpx;
  351. flex-shrink: 0;
  352. display: flex;
  353. justify-content: center;
  354. flex-direction: column;
  355. align-items: center;
  356. .bottom-original {
  357. font-size: 24rpx;
  358. font-weight: normal;
  359. color: #fff;
  360. .original-pri {
  361. text-decoration: line-through;
  362. }
  363. }
  364. }
  365. }
  366. }
  367. .select-content {
  368. display: flex;
  369. align-items: center;
  370. padding: 30rpx;
  371. .fen {
  372. width: 2rpx;
  373. height: 150rpx;
  374. background-color: #eee;
  375. }
  376. .select-item {
  377. flex: 1 1 auto;
  378. text-align: center;
  379. .select-img {
  380. width: 120rpx;
  381. height: 120rpx;
  382. margin-bottom: 20rpx;
  383. }
  384. }
  385. }
  386. </style>