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.3KB

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