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.

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