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 8.6KB

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