Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

choice-product-new.vue 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <view class="content-value">
  3. <view @click="savaHandle(item)" class="ul-item" v-for="(item, index) in state.dataArray" :key="index">
  4. <image style="width: 100%; height: 170rpx; border-radius: 20rpx"
  5. :src="`${$imgUrl}applyCard/product-bg.png`"></image>
  6. <view class="item-value">
  7. <image class="icon-tip"
  8. :src="state.sysType === 'WECHAT'?`${$imgUrl}applyCard/wechat.png` : `${$imgUrl}applyCard/alibaba.png`">
  9. </image>
  10. <view class="content">
  11. <view class="title">
  12. {{ item.promoteName }}
  13. </view>
  14. <!-- 1记账卡2储值卡3记存卡 -->
  15. <!-- <view style="margin-top: 15rpx" class="tip" v-if="item.cardType=='1'">
  16. 记账卡
  17. </view> -->
  18. <view style="margin-top: 15rpx" class="tip">
  19. {{ item['releaseProductStandards']['productStandards']['cardTypeArr'] }}
  20. </view>
  21. </view>
  22. <view class="money">
  23. ¥:{{ item.fee * 0.01 }}
  24. </view>
  25. </view>
  26. </view>
  27. <view class="bottomTip"> 到底啦!敬请期待其他产品! </view>
  28. </view>
  29. <u-popup mode="center" v-model="state.choiceCardShow" closeable>
  30. <view class="squire">
  31. <view class="mask-title" :style="{ '--color': color }">选择办理卡类型</view>
  32. <view class="as-layout-horizontal">
  33. <view v-for="(item, index) in state.radiolist1" :key="index" :label="item.disabled" :name="item.name"
  34. @click="radioChange(item.name)"
  35. style="width: 100%;display: flex;align-items: center;margin-bottom: 30rpx;">
  36. <view class="as-layout-vertical as-gravity-center">
  37. <image style="width: 140rpx; height: 100rpx; border-radius: 20rpx;margin-right: 20rpx;"
  38. :src="`${$imgUrl}card2.png`" mode="aspectFill"></image>
  39. <view style="margin-top: 20rpx;">
  40. {{item.name}}
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </u-popup>
  47. </template>
  48. <script setup lang="ts">
  49. import { onLoad, onPageScroll } from "@dcloudio/uni-app";
  50. import { reactive, ref } from "vue";
  51. import { etcQueryProduct } from "@/utils/network/api.js";
  52. import { request } from "@/utils/network/request.js";
  53. import { stringToJson } from "@/utils/network/encryption";
  54. import { fileURL } from "@/datas/fileURL.js";
  55. // import navBgCar from "./components/nav-bg-car1";
  56. // import navBar from "@/components/nav-bar/nav-bar2.vue";
  57. import { getItem, StorageKeys, setItem } from "@/utils/storage.ts";
  58. import { msg } from "@/utils/utils";
  59. import { agentId } from "@/utils/network/difference";
  60. import {
  61. navTo
  62. } from "@/utils/utils"
  63. const imgURL = `${fileURL}image/`;
  64. // import { setItem } from "@/utils/storage";
  65. const scrollTop = ref(0); //滚动距离
  66. // 单选默认数据
  67. // let flag = ref(true)
  68. // 单选
  69. const radioChange = (n) => {
  70. console.log('radioChange', n);
  71. if (n == '记账卡') {
  72. state.isValueCard = 2
  73. } else if (n == '储值卡') {
  74. state.isValueCard = 1
  75. } else {
  76. state.isValueCard = 2
  77. }
  78. uni.redirectTo({
  79. url: `/subpackage/orders/essential-information?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isSign=${state.isSign}&isValueCard=${state.isValueCard}`,
  80. });
  81. }
  82. const savaHandle = (val) => {
  83. console.log("vAL", val)
  84. navTo(`/subpackage/orders/interestsList?promoteId=${val.promoteId}&changeCardType=1&&applyId=${state.applyId}&&orderId=${state.orderId}&&fee=${val.fee}`);
  85. // navTo(
  86. // `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${val.promoteId}`
  87. // )
  88. };
  89. onLoad((option : any) => {
  90. console.log("option选择产品", option)
  91. // #ifdef MP-ALIPAY
  92. state.sysType = 'ALI';
  93. // #endif
  94. // #ifdef MP-WEIXIN
  95. state.sysType = 'WECHAT';
  96. // #endif
  97. // PERSONAL_USER(1, "个人用户"),
  98. // UNIT_USER(2, "单位用户"),
  99. // OTHER(3, "其他"),
  100. // OFFICAL(6, "公务车用户"),
  101. if (option.userType == "PERSONAL_USER") {
  102. state.userType = 1;
  103. } else if (option.userType == "UNIT_USER") {
  104. state.userType = 2;
  105. } else if (option.userType == "OTHER") {
  106. state.userType = 3;
  107. } else if (option.userType == "OFFICAL") {
  108. state.userType = 6;
  109. }
  110. state.orderId = option.orderId;
  111. state.applyId = option.applyId;
  112. state.type = option.type;
  113. var data = {
  114. type: state.type,
  115. source: state.sysType, //请求方来源
  116. agencyId: agentId,//渠道编号
  117. userType: state.userType, //用户类型
  118. vanType: state.type, //车类型
  119. promotionMode: 1
  120. };
  121. const options = {
  122. type: 2,
  123. data: data,
  124. method: "POST",
  125. showLoading: true,
  126. };
  127. request(etcQueryProduct, options).then((res) => {
  128. const data = stringToJson(res.bizContent);
  129. console.log("csmsnPromoteDistPro", data.list);
  130. state.dataArray = data.list ? data.list : [];
  131. for (var i = 0; i < state.dataArray.length; i++) {
  132. const cardTypeArr = []
  133. for (var j = 0; j < state.dataArray[i]['releaseProductStandards']['productStandards'].cardType.length; j++) {
  134. if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '2') {
  135. cardTypeArr.push('储值卡')
  136. } else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '1') {
  137. cardTypeArr.push('记账卡')
  138. } else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '3') {
  139. cardTypeArr.push('预存卡')
  140. }
  141. }
  142. state.dataArray[i]['releaseProductStandards']['productStandards']['cardTypeArr'] = cardTypeArr.toString()
  143. }
  144. state.dataArray = state.dataArray.filter(function (e) {
  145. console.log("e", e['releaseProductStandards']['productStandards']['cardType'])
  146. for (var i = 0; i < e['releaseProductStandards']['productStandards']['cardType'].length; i++) {
  147. if (e['releaseProductStandards']['productStandards']['cardType'][i] == "1") {
  148. return e['releaseProductStandards']['productStandards']['cardType'];
  149. }
  150. }
  151. });
  152. console.log("state.dataArray", state.dataArray)
  153. });
  154. });
  155. //监听页面滚动
  156. onPageScroll((e) => {
  157. scrollTop.value = e.scrollTop;
  158. });
  159. const state = reactive({
  160. applyId: "",
  161. isValueCard: 1, //卡的类型
  162. radiolist1: [], //选择卡的数据列表
  163. choiceCardShow: false, //选择卡的弹出框
  164. isSign: '',
  165. sysType: "",
  166. orderId: "",
  167. userType: 1, //1 个人 2单位
  168. type: 0, //
  169. vehiclePlateColor: "",
  170. data: {
  171. show: false,
  172. src: imgURL + "applyCard/edit.png",
  173. },
  174. dataArray: [],
  175. list: [
  176. {
  177. bg: imgURL + "applyCard/product-bg.png",
  178. icon: imgURL + "applyCard/wechat.png",
  179. title: "【货车】微信车主服务",
  180. tip: "绑定微信支付,无需绑定银行卡",
  181. },
  182. ],
  183. });
  184. </script>
  185. <style lang="scss" scoped>
  186. ::v-deep .u-radio {
  187. display: flex !important;
  188. align-items: center !important;
  189. float: none !important;
  190. }
  191. ::v-deep .u-icon__icon {
  192. top: -4px !important;
  193. }
  194. .bottomTip {
  195. margin-top: 100rpx;
  196. text-align: center;
  197. font-size: 28rpx;
  198. font-family: Microsoft YaHei;
  199. font-weight: 400;
  200. color: #b3b3b3;
  201. }
  202. .content-value {
  203. position: relative;
  204. // margin-top: -50rpx;
  205. padding: 0rpx 30rpx;
  206. position: relative;
  207. .img-pos {
  208. position: absolute;
  209. left: 500rpx;
  210. top: -38rpx;
  211. right: 50rpx;
  212. .img-flex {
  213. display: flex;
  214. justify-content: space-between;
  215. align-items: center;
  216. .car-img {
  217. width: 86rpx;
  218. height: 42rpx;
  219. }
  220. .flag-img {
  221. width: 30rpx;
  222. height: 35rpx;
  223. }
  224. }
  225. }
  226. }
  227. .flex {
  228. display: flex;
  229. align-items: center;
  230. }
  231. .action {
  232. margin-top: 30rpx;
  233. padding-left: 20rpx;
  234. padding-right: 20rpx;
  235. padding-bottom: 30rpx;
  236. .button {
  237. height: 80rpx;
  238. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  239. border-radius: 40rpx;
  240. font-size: 32rpx;
  241. font-weight: 400;
  242. color: #ffffff;
  243. line-height: 80rpx;
  244. }
  245. }
  246. .action-btn {
  247. margin-left: 45rpx;
  248. width: 121rpx;
  249. height: 61rpx;
  250. border: 1px solid rgba(255, 255, 255, 1);
  251. border-radius: 30rpx;
  252. background: rgba(255, 255, 255, 0.2);
  253. text-align: center;
  254. font-size: 30rpx;
  255. font-family: Microsoft YaHei;
  256. font-weight: 400;
  257. color: #ffffff;
  258. line-height: 61rpx;
  259. }
  260. .tag1 {
  261. padding: 5rpx;
  262. background: rgba(0, 179, 139, 0.5);
  263. border-radius: 6rpx;
  264. font-size: 22rpx;
  265. font-family: Microsoft YaHei;
  266. font-weight: 400;
  267. color: #ffffff;
  268. }
  269. .tag3 {
  270. padding: 5rpx;
  271. background: rgba(139, 112, 228, 0.5);
  272. border-radius: 6rpx;
  273. font-size: 22rpx;
  274. font-family: Microsoft YaHei;
  275. font-weight: 400;
  276. color: #ffffff;
  277. }
  278. .tag2 {
  279. padding: 5rpx;
  280. background: rgba(249, 97, 60, 0.5);
  281. border-radius: 6rpx;
  282. font-size: 22rpx;
  283. font-family: Microsoft YaHei;
  284. font-weight: 400;
  285. color: #ffffff;
  286. }
  287. .ul-item {
  288. padding: 5px 20rpx;
  289. display: flex;
  290. align-items: center;
  291. .item-value {
  292. padding: 20rpx;
  293. position: absolute;
  294. display: flex;
  295. align-items: center;
  296. // justify-content: space-around;
  297. width: 80%;
  298. .content {
  299. width: 51%;
  300. .title {
  301. font-size: 32rpx;
  302. font-family: Microsoft YaHei;
  303. font-weight: 400;
  304. color: #ffffff;
  305. }
  306. .tip {
  307. font-size: 24rpx;
  308. font-family: Microsoft YaHei;
  309. font-weight: 400;
  310. color: #ffffff;
  311. }
  312. }
  313. }
  314. .icon-tip {
  315. width: 100rpx;
  316. height: 100rpx;
  317. }
  318. .content {
  319. margin-left: 40rpx;
  320. }
  321. }
  322. .money {
  323. color: white;
  324. // float: right;
  325. }
  326. ::v-deep .u-mode-center-box {
  327. border-radius: 10rpx;
  328. }
  329. .squire {
  330. padding: 30rpx 30rpx 50rpx 50rpx;
  331. }
  332. .mask-close {
  333. text-align: right;
  334. }
  335. .icon-closed {
  336. width: 48rpx;
  337. height: 48rpx;
  338. }
  339. .mask-title {
  340. text-align: center;
  341. font-size: 32rpx;
  342. color: $uni-text-color-black;
  343. margin-bottom: 50rpx;
  344. }
  345. </style>