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 8.4KB

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