Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

choice-product.vue 13KB

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