Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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