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

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