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

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