您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

choice-product.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <template>
  2. <navBar title="产品选择" :scrollTop="scrollTop" navbgClass="nav-bgXin" fontColor='#fff'></navBar>
  3. <navBgCar :activeNum='1'></navBgCar>
  4. <view class="content-value">
  5. <view class="con">
  6. <view class="con-item bgImgs" v-for="(item, index) in state.dataArray" :key="index"
  7. :style="{'--bgimg':`url(${$imgUrl}issuance/chanping-bg.png)`}" @click="toEquity(item)">
  8. <view class="item-header ">
  9. <view class="l-txt">
  10. {{ item.productName }}
  11. </view>
  12. <view class="r-tip bgImgs" :style="{'--bgimg':`url(${$imgUrl}issuance/r-tip.png)`}">
  13. {{ item['cardTypeArr'] }}
  14. </view>
  15. </view>
  16. <view class="b-txt">
  17. <view class="l-money">
  18. <text>¥</text> <text class="fee">{{ item.amount * 0.01 }}</text>
  19. </view>
  20. <view class="c-line" v-if='item.remarks'>
  21. </view>
  22. <view class="r-desc">
  23. {{item.remarks}}
  24. <!-- 产品权益专用,2%加息10天 -->
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="bottomTip" v-if='state.dataArray.length===0'> 暂无产品,敬请期待! </view>
  30. </view>
  31. <!-- <uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt"
  32. v-if="ordersList.length > 0" /> -->
  33. <u-popup mode="center" v-model="state.choiceCardShow">
  34. <view class="squire">
  35. <view class="mask-close">
  36. <image :src="fileURL + 'image/index/icon-close.png'" class="icon-closed" @click="closeMask"></image>
  37. </view>
  38. <view class="mask-title" :style="{ '--color': color }">选择办理卡类型</view>
  39. <view class="as-layout-horizontal">
  40. <view v-for="(item, index) in state.radiolist1" :key="index" :label="item.disabled" :name="item.name"
  41. @click="radioChange(item.name)"
  42. style="width: 100%;display: flex;align-items: center;margin-bottom: 30rpx;">
  43. <view class="as-layout-vertical as-gravity-center">
  44. <image style="width: 140rpx; height: 100rpx; border-radius: 20rpx;margin-right: 20rpx;"
  45. :src="`${$imgUrl}card2.png`" mode="aspectFill"></image>
  46. <view style="margin-top: 20rpx;text-align: center;">
  47. {{item.name}}
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </u-popup>
  54. </template>
  55. <script setup lang="ts">
  56. import { onLoad, onPageScroll, onShow, onReachBottom, onPullDownRefresh, } from "@dcloudio/uni-app";
  57. import { reactive, ref } from "vue";
  58. import { pageQuery } from "@/utils/network/api.js";
  59. import { requestNew } from "@/utils/network/request.js";
  60. import { fileURL } from "@/datas/fileURL.js";
  61. import navBgCar from "./components/nav-bg-car1";
  62. import navBar from "@/components/nav-bar/nav-bar2.vue";
  63. import { setItem } from "@/utils/storage.ts";
  64. import { agentId } from "@/utils/network/difference";
  65. import { msg, navTo } from "@/utils/utils";
  66. const imgURL = `${fileURL}image/`;
  67. let bgc = ""
  68. // #ifdef MP-ALIPAY
  69. bgc = "#FFFFFF"
  70. // #endif
  71. // #ifdef MP-WEIXIN
  72. bgc = "#F4F6FA"
  73. // #endif
  74. const scrollTop = ref(0); //滚动距离
  75. // /* 刷新列表 */
  76. // const refreshList = (isLoading) => {
  77. // console.log("========", isLoading)
  78. // params.pageNum = 1;
  79. // params.total = 0;
  80. // params.status = 'more';
  81. // params.reload = false;
  82. // getList();
  83. // }
  84. // const config = {
  85. // emptyHint: {
  86. // hint: '~ 暂无订单数据 ~',
  87. // icon: '',
  88. // mode: 'order'
  89. // },
  90. // contentTxt: {
  91. // contentdown: '~上拉加载更多~',
  92. // contentrefresh: '努力加载中...',
  93. // contentnomore: '-- 我是有底线的 --'
  94. // }
  95. // }
  96. // /* 加载更多 */
  97. // const loadMore = () => {
  98. // if (params.total > ordersList.value.length) {
  99. // params.status = 'loading';
  100. // params.pageNum++;
  101. // getList();
  102. // } else {
  103. // params.status = 'noMore';
  104. // }
  105. // }
  106. // onReachBottom(() => {
  107. // loadMore();
  108. // });
  109. // 单选默认数据
  110. // 单选
  111. // 单选
  112. const radioChange = (n) => {
  113. console.log('radioChange', n);
  114. if (n == '记账卡') {
  115. state.isValueCard = 2
  116. state.cardType = 1
  117. } else if (n == '储值卡') {
  118. state.isValueCard = 1
  119. state.cardType = 2
  120. } else {
  121. state.isValueCard = 2
  122. state.cardType = 3
  123. }
  124. setItem("isValueCard", state.isValueCard);
  125. navTo(`/subpackage/orders/interestsList?userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&cardType=${state.cardType}&fee=${Number(state.fee)}&equityId=${state.equityId}&fee=${state.fee}&signAgencyId=${state.signAgencyId}`)
  126. }
  127. const toEquity = (itemData) => {
  128. if (itemData['cardTypeArr'].split(",").length == 1) {
  129. if (itemData['cardTypeArr'] == "记账卡") {
  130. state.isValueCard = 2
  131. state.cardType = 1
  132. } else if (itemData['cardTypeArr'] == '储值卡') {
  133. state.isValueCard = 1
  134. state.cardType = 2
  135. } else {
  136. state.isValueCard = 2
  137. state.cardType = 3
  138. }
  139. }
  140. console.log("state.isValueCard", state.isValueCard)
  141. setItem("isValueCard", state.isValueCard);
  142. setItem("currentProductList", itemData);
  143. navTo(`/subpackage/orders/equity/equityList?userType=${state.userType}&vanType=${state.vanType}&cardType=${state.cardType}&isValueCard=${state.isValueCard}`)
  144. }
  145. const savaHandle = (val, idx) => {
  146. console.log("vAL", val)
  147. // 1不能点击 0可以点击 权益置灰 弹出提示
  148. if (val.equityList[0]['isClick'] == 1) {
  149. msg(val.equityList[0]['noClickCase'])
  150. return;
  151. }
  152. setItem("clientFee", val.clientFee);
  153. // setItem("promoteId", val.promoteId);
  154. state.isSign = val.isSign;
  155. state.signAgencyId = val['deviceType'];
  156. state.equityId = val.equityList[idx].equityId;
  157. // 产品金额+权益金额
  158. state.fee = Number(val.fee) + Number(val.equityList[idx].discountPrice);
  159. // 判断是几张卡
  160. if (val['cardTypeArr'].split(",").length == 1) {
  161. if (val['cardTypeArr'].split(",")[0] == "记账卡") {
  162. state.isValueCard = 2
  163. state.cardType = 1
  164. } else if (val['cardTypeArr'].split(",")[0] == '储值卡') {
  165. state.isValueCard = 1
  166. state.cardType = 2
  167. } else {
  168. state.isValueCard = 2
  169. state.cardType = 3
  170. }
  171. console.log("state.isValueCard", state.isValueCard)
  172. setItem("isValueCard", state.isValueCard);
  173. navTo(`/subpackage/orders/interestsList?equityId=${val.equityList[idx].equityId}&userType=${state.userType}&vanType=${state.vanType}&cardType=${state.cardType}&isValueCard=${state.isValueCard}&fee=${state.fee}&signAgencyId=${val['deviceType']}&productId=${val['productId']}`)
  174. } else {
  175. state.radiolist1 = [];
  176. // 处理卡的数据
  177. for (var i = 0; i < val['cardTypeArr'].split(",").length; i++) {
  178. const obj = {};
  179. obj["name"] = val['cardTypeArr'].split(",")[i];
  180. obj["disabled"] = false;
  181. state.radiolist1.push(obj)
  182. }
  183. state.choiceCardShow = true;
  184. console.log("state.radiolist1", state.radiolist1)
  185. }
  186. };
  187. onLoad((option : any) => {
  188. // #ifdef MP-ALIPAY
  189. state.sysType = 'ALI';
  190. // #endif
  191. // #ifdef MP-WEIXIN
  192. state.sysType = 'WECHAT';
  193. // #endif
  194. state.userType = Number(option.userType);
  195. state.vanType = Number(option.vanType);
  196. productList();
  197. console.log("option选择产品列表", option)
  198. });
  199. // 产品列表
  200. const productList = () => {
  201. var data = {
  202. userType: state.userType,
  203. // agencyId: agentId,
  204. vanType: state.vanType,
  205. "customerId": "",
  206. "pageNo": 1,
  207. "pageSize": 10,
  208. "staffId": "",
  209. };
  210. console.log("data", data)
  211. const options = {
  212. data: data,
  213. method: "POST",
  214. showLoading: true,
  215. };
  216. console.log("输出内容", options);
  217. requestNew(pageQuery, options).then((res) => {
  218. console.log("产品列表", res);
  219. const data = res;
  220. if (data.result && data.result.length > 0) {
  221. state.dataArray = data.result ? data.result : [];
  222. console.log("state.dataArray", state.dataArray);
  223. for (var i = 0; i < state.dataArray.length; i++) {
  224. // const cardTypeArr = []
  225. // for (var j = 0; j < state.dataArray[i].cardType.length; j++) {
  226. // if (state.dataArray[i].cardType[j] == 'STORED_VALUE_CARD') {
  227. // cardTypeArr.push('储值卡')
  228. // } else if (state.dataArray[i].cardType[j] == 'CHARGE_CARD') {
  229. // cardTypeArr.push('记账卡')
  230. // } else if (state.dataArray[i].cardType[j] == 'PRE_CHARGE_CARD') {
  231. // cardTypeArr.push('预存卡')
  232. // }
  233. // }
  234. let cardTypeArr = "";
  235. if (state.dataArray[i].cardType == 'STORED_VALUE_CARD') {
  236. cardTypeArr = ('储值卡')
  237. } else if (state.dataArray[i].cardType == 'CHARGE_CARD') {
  238. cardTypeArr = ('记账卡')
  239. } else if (state.dataArray[i].cardType == 'PRE_CHARGE_CARD') {
  240. cardTypeArr = ('预存卡')
  241. }
  242. state.dataArray[i]['cardTypeArr'] = cardTypeArr;
  243. }
  244. } else {
  245. uni.showModal({
  246. title: '提示',
  247. content: '尊敬的用户:感谢您的关注!我们正紧锣密鼓地为您准备一款全新的产品。虽然目前尚未上线,但请您耐心等待,我们将以更好的姿态与更丰富的功能,为您呈现一份超出期待的产品。',
  248. showCancel: false,
  249. success: function (res) {
  250. if (res.confirm) {
  251. uni.switchTab({
  252. url: '/pages/index/index'
  253. })
  254. console.log('用户点击确定');
  255. } else if (res.cancel) {
  256. console.log('用户点击取消');
  257. }
  258. }
  259. });
  260. }
  261. console.log("state.dataArray", state.dataArray)
  262. });
  263. }
  264. //监听页面滚动
  265. onPageScroll((e) => {
  266. scrollTop.value = e.scrollTop;
  267. });
  268. const state = reactive({
  269. isValueCard: 1, //卡的类型
  270. radiolist1: [], //选择卡的数据列表
  271. choiceCardShow: false, //选择卡的弹出框
  272. isSign: '',
  273. sysType: "",
  274. orderId: "",
  275. userType: 1, //1 个人 2单位
  276. vanType: 0, //0 客车 1货车
  277. vehiclePlateColor: "",
  278. data: {
  279. show: false,
  280. src: imgURL + "applyCard/edit.png",
  281. },
  282. dataArray: [],
  283. list: [
  284. {
  285. bg: imgURL + "applyCard/product-bg.png",
  286. icon: imgURL + "applyCard/wechat.png",
  287. title: "【货车】微信车主服务",
  288. tip: "绑定微信支付,无需绑定银行卡",
  289. },
  290. ],
  291. fee: 0, //产品金额
  292. equityId: "",
  293. signAgencyId: "",//渠道标识
  294. cardType: ""
  295. });
  296. const params = {
  297. userType: state.userType,
  298. // agencyId: agentId,
  299. vanType: state.vanType,
  300. "customerId": "",
  301. "pageNo": 1,
  302. "pageSize": 10,
  303. "staffId": "",
  304. };
  305. const closeMask = () => {
  306. state.choiceCardShow = false;
  307. };
  308. </script>
  309. <style lang="scss" scoped>
  310. ::v-deep .u-radio {
  311. display: flex !important;
  312. align-items: center !important;
  313. float: none !important;
  314. }
  315. ::v-deep .u-icon__icon {
  316. top: -4px !important;
  317. }
  318. .bottomTip {
  319. padding: 30rpx 0 0;
  320. text-align: center;
  321. font-size: 28rpx;
  322. font-family: Microsoft YaHei;
  323. font-weight: 400;
  324. color: #b3b3b3;
  325. }
  326. .content-value {
  327. position: absolute;
  328. top: 370rpx;
  329. // height: calc(100% - 390rpx);
  330. background-color: #fff;
  331. border-radius: 12rpx;
  332. padding: 20rpx 0 50rpx;
  333. margin: 0 30rpx;
  334. width: 690rpx;
  335. .img-pos {
  336. position: absolute;
  337. left: 500rpx;
  338. top: -38rpx;
  339. right: 50rpx;
  340. .img-flex {
  341. display: flex;
  342. justify-content: space-between;
  343. align-items: center;
  344. .car-img {
  345. width: 86rpx;
  346. height: 42rpx;
  347. }
  348. .flag-img {
  349. width: 30rpx;
  350. height: 35rpx;
  351. }
  352. }
  353. }
  354. }
  355. .flex {
  356. display: flex;
  357. align-items: center;
  358. }
  359. .action {
  360. margin-top: 30rpx;
  361. padding-left: 20rpx;
  362. padding-right: 20rpx;
  363. padding-bottom: 30rpx;
  364. .button {
  365. height: 80rpx;
  366. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  367. border-radius: 40rpx;
  368. font-size: 32rpx;
  369. font-weight: 400;
  370. color: #ffffff;
  371. line-height: 80rpx;
  372. }
  373. }
  374. .action-btn {
  375. margin-left: 45rpx;
  376. width: 121rpx;
  377. height: 61rpx;
  378. border: 1px solid rgba(255, 255, 255, 1);
  379. border-radius: 30rpx;
  380. background: rgba(255, 255, 255, 0.2);
  381. text-align: center;
  382. font-size: 30rpx;
  383. font-family: Microsoft YaHei;
  384. font-weight: 400;
  385. color: #ffffff;
  386. line-height: 61rpx;
  387. }
  388. .tag1 {
  389. padding: 5rpx;
  390. background: rgba(0, 179, 139, 0.5);
  391. border-radius: 6rpx;
  392. font-size: 22rpx;
  393. font-family: Microsoft YaHei;
  394. font-weight: 400;
  395. color: #ffffff;
  396. }
  397. .tag3 {
  398. padding: 5rpx;
  399. background: rgba(139, 112, 228, 0.5);
  400. border-radius: 6rpx;
  401. font-size: 22rpx;
  402. font-family: Microsoft YaHei;
  403. font-weight: 400;
  404. color: #ffffff;
  405. }
  406. .tag2 {
  407. padding: 5rpx;
  408. background: rgba(249, 97, 60, 0.5);
  409. border-radius: 6rpx;
  410. font-size: 22rpx;
  411. font-family: Microsoft YaHei;
  412. font-weight: 400;
  413. color: #ffffff;
  414. }
  415. .ul-item-hui {
  416. padding: 5px 20rpx;
  417. display: flex;
  418. align-items: center;
  419. color: #c1c1cc;
  420. .item-value {
  421. padding: 20rpx;
  422. position: absolute;
  423. display: flex;
  424. align-items: center;
  425. width: 80%;
  426. .content {
  427. width: 51%;
  428. .title {
  429. font-size: 32rpx;
  430. font-family: Microsoft YaHei;
  431. font-weight: 400;
  432. }
  433. .tip {
  434. font-size: 24rpx;
  435. font-family: Microsoft YaHei;
  436. font-weight: 400;
  437. }
  438. }
  439. }
  440. .icon-tip {
  441. width: 100rpx;
  442. height: 100rpx;
  443. }
  444. .content {
  445. margin-left: 40rpx;
  446. }
  447. }
  448. .ul-item {
  449. padding: 5px 20rpx;
  450. display: flex;
  451. align-items: center;
  452. color: white;
  453. .item-value {
  454. padding: 20rpx;
  455. position: absolute;
  456. display: flex;
  457. align-items: center;
  458. width: 80%;
  459. .content {
  460. width: 51%;
  461. .title {
  462. font-size: 32rpx;
  463. font-family: Microsoft YaHei;
  464. font-weight: 400;
  465. }
  466. .tip {
  467. font-size: 24rpx;
  468. font-family: Microsoft YaHei;
  469. font-weight: 400;
  470. }
  471. }
  472. }
  473. .icon-tip {
  474. width: 100rpx;
  475. height: 100rpx;
  476. }
  477. .content {
  478. margin-left: 40rpx;
  479. }
  480. }
  481. ::v-deep .u-mode-center-box {
  482. border-radius: 10rpx;
  483. }
  484. .squire {
  485. padding: 30rpx 30rpx 50rpx 50rpx;
  486. }
  487. .mask-close {
  488. text-align: right;
  489. }
  490. .icon-closed {
  491. width: 48rpx;
  492. height: 48rpx;
  493. }
  494. .mask-title {
  495. text-align: center;
  496. font-size: 32rpx;
  497. color: $uni-text-color-black;
  498. margin-bottom: 50rpx;
  499. }
  500. .icon-closed {
  501. width: 40rpx;
  502. height: 40rpx;
  503. }
  504. .bgImgs {
  505. background-image: var(--bgimg);
  506. background-repeat: no-repeat;
  507. background-size: 100% 100%;
  508. }
  509. .con {
  510. .con-item {
  511. padding: 20rpx 0;
  512. box-sizing: border-box;
  513. width: 630rpx;
  514. // height: 198rpx;
  515. margin: 30rpx auto 0;
  516. }
  517. .item-header {
  518. display: flex;
  519. align-items: center;
  520. justify-content: space-between;
  521. .l-txt {
  522. margin-left: 30rpx;
  523. font-family: SourceHanSansCN, SourceHanSansCN;
  524. font-weight: bold;
  525. font-size: 26rpx;
  526. color: #FFF9EE;
  527. }
  528. .r-tip {
  529. width: 150rpx;
  530. height: 50rpx;
  531. font-family: SourceHanSansCN, SourceHanSansCN;
  532. font-size: 22rpx;
  533. color: #BF6229;
  534. text-align: center;
  535. line-height: 46rpx;
  536. position: relative;
  537. left: 10rpx;
  538. }
  539. }
  540. .b-txt {
  541. margin-top: 10rpx;
  542. display: flex;
  543. align-items: center;
  544. padding: 0 20rpx;
  545. .l-money {
  546. font-family: MicrosoftYaHei;
  547. font-size: 28rpx;
  548. color: #FFFFFF;
  549. .fee {
  550. margin-left: 5rpx;
  551. font-size: 92rpx;
  552. }
  553. }
  554. .c-line {
  555. margin: 0 18rpx 0 30rpx;
  556. background: #FFF9EE;
  557. height: 70rpx;
  558. width: 1rpx;
  559. }
  560. .r-desc {
  561. font-family: SourceHanSansCN, SourceHanSansCN;
  562. font-size: 26rpx;
  563. color: #FFF0D0;
  564. }
  565. }
  566. }
  567. </style>