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.

choice-product.vue 13KB

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