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-new.vue 9.7KB

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