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

choice-product.vue 14KB

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