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

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