Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

choice-product.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <navBar title="选择产品" :scrollTop="scrollTop"></navBar>
  3. <navBgCar></navBgCar>
  4. <view class="content-value">
  5. <view v-for="(item, index) in state.dataArray" :key="index">
  6. <view :style="`background-color:${bgc}`" style="border-radius: 16rpx;padding: 20rpx;margin-top: 20rpx;">
  7. <view class="title" style="display: flex;flex-direction: row;justify-content: flex-start;">
  8. <view style="font-weight: bold;margin-right: 10rpx;font-size: 18px;">
  9. {{ item.promoteName }}
  10. </view>
  11. <view>
  12. {{ item['releaseProductStandards']['productStandards']['cardTypeArr'] }}
  13. </view>
  14. </view>
  15. <view v-for="(str, index) in item.releaseProductStandards.equityList" :key="index" class="ul-item"
  16. style="padding: 0rpx;margin-top: 20rpx;" @click="savaHandle(item,index)">
  17. <image style="width: 100%; height: 170rpx; border-radius: 20rpx"
  18. :src="`${$imgUrl}applyCard/product-bg.png`"></image>
  19. <view class="item-value">
  20. <image class="icon-tip"
  21. :src="state.sysType === 'WECHAT'?`${$imgUrl}applyCard/wechat.png` : `${$imgUrl}applyCard/alibaba.png`">
  22. </image>
  23. <view class="content">
  24. <view class="title">
  25. {{ str.equityName }}
  26. </view>
  27. <view style="margin-top: 15rpx" class="tip">
  28. {{ str.sellingPoint.substring(0,15) }}
  29. </view>
  30. </view>
  31. <view class="money">
  32. ¥:{{ str.discountPrice * 0.01 }}
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="bottomTip"> 到底啦!敬请期待其他产品! </view>
  39. </view>
  40. <u-popup mode="center" v-model="state.choiceCardShow">
  41. <view class="squire">
  42. <view class="mask-close">
  43. <image :src="fileURL + 'image/index/icon-close.png'" class="icon-closed" @click="closeMask"></image>
  44. </view>
  45. <view class="mask-title" :style="{ '--color': color }">选择办理卡类型</view>
  46. <view class="as-layout-horizontal">
  47. <view v-for="(item, index) in state.radiolist1" :key="index" :label="item.disabled" :name="item.name"
  48. @click="radioChange(item.name)"
  49. style="width: 100%;display: flex;align-items: center;margin-bottom: 30rpx;">
  50. <view class="as-layout-vertical as-gravity-center">
  51. <image style="width: 140rpx; height: 100rpx; border-radius: 20rpx;margin-right: 20rpx;"
  52. :src="`${$imgUrl}card2.png`" mode="aspectFill"></image>
  53. <view style="margin-top: 20rpx;text-align: center;">
  54. {{item.name}}
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </u-popup>
  61. </template>
  62. <script setup lang="ts">
  63. import { onLoad, onPageScroll, onShow } from "@dcloudio/uni-app";
  64. import { reactive, ref } from "vue";
  65. import { etcQueryProduct } from "@/utils/network/api.js";
  66. import { request } from "@/utils/network/request.js";
  67. import { stringToJson } from "@/utils/network/encryption";
  68. import { fileURL } from "@/datas/fileURL.js";
  69. import navBgCar from "./components/nav-bg-car1";
  70. import navBar from "@/components/nav-bar/nav-bar2.vue";
  71. import { getItem, StorageKeys, setItem } from "@/utils/storage.ts";
  72. import { msg } from "@/utils/utils";
  73. import { agentId } from "@/utils/network/difference";
  74. const imgURL = `${fileURL}image/`;
  75. let bgc = ""
  76. // #ifdef MP-ALIPAY
  77. bgc = "#FFFFFF"
  78. // #endif
  79. // #ifdef MP-WEIXIN
  80. bgc = "#F4F6FA" //52010106004
  81. // #endif
  82. const scrollTop = ref(0); //滚动距离
  83. // 单选默认数据
  84. // 单选
  85. const radioChange = (n) => {
  86. console.log('radioChange', n);
  87. if (n == '记账卡') {
  88. state.isValueCard = 2
  89. } else if (n == '储值卡') {
  90. state.isValueCard = 1
  91. } else {
  92. state.isValueCard = 2
  93. }
  94. setItem("isValueCard", state.isValueCard);
  95. uni.navigateTo({
  96. url: `/subpackage/orders/interestsList?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&fee=${Number(state.fee)}&equityId=${state.equityId}&fee=${state.fee}`,
  97. });
  98. }
  99. const savaHandle = (val, idx) => {
  100. console.log("vAL", val)
  101. setItem("clientFee", val.clientFee);
  102. setItem("promoteId", val.promoteId);
  103. state.isSign = val.isSign;
  104. state.equityId = val.releaseProductStandards.equityList[idx].equityId;
  105. // 产品金额+权益金额
  106. state.fee = Number(val.fee) + Number(val.releaseProductStandards.equityList[idx].discountPrice);
  107. // 判断是几张卡
  108. console.log("state.dataArray[i]['releaseProductStandards']['productStandards']", val['releaseProductStandards']['productStandards'])
  109. if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",").length == 1) {
  110. if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[0] == "记账卡") {
  111. state.isValueCard = 2
  112. } else if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[0] == '储值卡') {
  113. state.isValueCard = 1
  114. } else {
  115. state.isValueCard = 2
  116. }
  117. console.log("state.isValueCard", state.isValueCard)
  118. setItem("isValueCard", state.isValueCard);
  119. uni.navigateTo({
  120. url: `/subpackage/orders/interestsList?equityId=${val.releaseProductStandards.equityList[idx].equityId}&promoteId=${val['promoteId']}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&fee=${state.fee}`,
  121. });
  122. } else {
  123. state.radiolist1 = [];
  124. // 处理卡的数据
  125. for (var i = 0; i < val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",").length; i++) {
  126. const obj = {};
  127. obj["name"] = val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[i];
  128. obj["disabled"] = false;
  129. state.radiolist1.push(obj)
  130. }
  131. state.choiceCardShow = true;
  132. console.log("state.radiolist1", state.radiolist1)
  133. }
  134. };
  135. onLoad((option : any) => {
  136. // #ifdef MP-ALIPAY
  137. state.sysType = 'ALI';
  138. // #endif
  139. // #ifdef MP-WEIXIN
  140. state.sysType = 'WECHAT';
  141. // #endif
  142. state.userType = option.userType;
  143. state.type = option.type;
  144. productList();
  145. console.log("option选择产品列表", option)
  146. });
  147. onShow(() => {
  148. })
  149. // 产品列表
  150. const productList = () => {
  151. var data = {
  152. userType: state.userType,
  153. agencyId: agentId,
  154. vanType: state.type,
  155. promotionMode: 1
  156. };
  157. const options = {
  158. type: 2,
  159. data: data,
  160. method: "POST",
  161. showLoading: true,
  162. };
  163. console.log("输出内容", options);
  164. request(etcQueryProduct, options).then((res) => {
  165. const data = stringToJson(res.bizContent);
  166. console.log("产品列表", data.list);
  167. if (data.list && data.list.length > 0) {
  168. state.dataArray = data.list ? data.list : [];
  169. console.log("state.dataArray", state.dataArray);
  170. for (var i = 0; i < state.dataArray.length; i++) {
  171. const cardTypeArr = []
  172. for (var j = 0; j < state.dataArray[i]['releaseProductStandards']['productStandards'].cardType.length; j++) {
  173. if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '2') {
  174. cardTypeArr.push('储值卡')
  175. } else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '1') {
  176. cardTypeArr.push('记账卡')
  177. } else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '3') {
  178. cardTypeArr.push('预存卡')
  179. }
  180. }
  181. state.dataArray[i]['releaseProductStandards']['productStandards']['cardTypeArr'] = cardTypeArr.toString()
  182. }
  183. } else {
  184. uni.showModal({
  185. title: '提示',
  186. content: '尊敬的用户:感谢您的关注!我们正紧锣密鼓地为您准备一款全新的产品。虽然目前尚未上线,但请您耐心等待,我们将以更好的姿态与更丰富的功能,为您呈现一份超出期待的产品。',
  187. showCancel: false,
  188. success: function (res) {
  189. if (res.confirm) {
  190. console.log('用户点击确定');
  191. uni.switchTab({
  192. url: '/pages/index/index'
  193. })
  194. } else if (res.cancel) {
  195. console.log('用户点击取消');
  196. }
  197. }
  198. });
  199. }
  200. console.log("state.dataArray", state.dataArray)
  201. });
  202. }
  203. //监听页面滚动
  204. onPageScroll((e) => {
  205. scrollTop.value = e.scrollTop;
  206. });
  207. const state = reactive({
  208. isValueCard: 1, //卡的类型
  209. radiolist1: [], //选择卡的数据列表
  210. choiceCardShow: false, //选择卡的弹出框
  211. isSign: '',
  212. sysType: "",
  213. orderId: "",
  214. userType: 1, //1 个人 2单位
  215. type: 0, //0 客车 1货车
  216. vehiclePlateColor: "",
  217. data: {
  218. show: false,
  219. src: imgURL + "applyCard/edit.png",
  220. },
  221. dataArray: [],
  222. list: [
  223. {
  224. bg: imgURL + "applyCard/product-bg.png",
  225. icon: imgURL + "applyCard/wechat.png",
  226. title: "【货车】微信车主服务",
  227. tip: "绑定微信支付,无需绑定银行卡",
  228. },
  229. ],
  230. fee: 0, //产品金额
  231. equityId: "",
  232. });
  233. const closeMask = () => {
  234. state.choiceCardShow = false;
  235. };
  236. </script>
  237. <style lang="scss" scoped>
  238. ::v-deep .u-radio {
  239. display: flex !important;
  240. align-items: center !important;
  241. float: none !important;
  242. }
  243. ::v-deep .u-icon__icon {
  244. top: -4px !important;
  245. }
  246. .bottomTip {
  247. margin-top: 100rpx;
  248. text-align: center;
  249. font-size: 28rpx;
  250. font-family: Microsoft YaHei;
  251. font-weight: 400;
  252. color: #b3b3b3;
  253. }
  254. .content-value {
  255. position: relative;
  256. padding: 0rpx 30rpx;
  257. position: relative;
  258. .img-pos {
  259. position: absolute;
  260. left: 500rpx;
  261. top: -38rpx;
  262. right: 50rpx;
  263. .img-flex {
  264. display: flex;
  265. justify-content: space-between;
  266. align-items: center;
  267. .car-img {
  268. width: 86rpx;
  269. height: 42rpx;
  270. }
  271. .flag-img {
  272. width: 30rpx;
  273. height: 35rpx;
  274. }
  275. }
  276. }
  277. }
  278. .flex {
  279. display: flex;
  280. align-items: center;
  281. }
  282. .action {
  283. margin-top: 30rpx;
  284. padding-left: 20rpx;
  285. padding-right: 20rpx;
  286. padding-bottom: 30rpx;
  287. .button {
  288. height: 80rpx;
  289. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  290. border-radius: 40rpx;
  291. font-size: 32rpx;
  292. font-weight: 400;
  293. color: #ffffff;
  294. line-height: 80rpx;
  295. }
  296. }
  297. .action-btn {
  298. margin-left: 45rpx;
  299. width: 121rpx;
  300. height: 61rpx;
  301. border: 1px solid rgba(255, 255, 255, 1);
  302. border-radius: 30rpx;
  303. background: rgba(255, 255, 255, 0.2);
  304. text-align: center;
  305. font-size: 30rpx;
  306. font-family: Microsoft YaHei;
  307. font-weight: 400;
  308. color: #ffffff;
  309. line-height: 61rpx;
  310. }
  311. .tag1 {
  312. padding: 5rpx;
  313. background: rgba(0, 179, 139, 0.5);
  314. border-radius: 6rpx;
  315. font-size: 22rpx;
  316. font-family: Microsoft YaHei;
  317. font-weight: 400;
  318. color: #ffffff;
  319. }
  320. .tag3 {
  321. padding: 5rpx;
  322. background: rgba(139, 112, 228, 0.5);
  323. border-radius: 6rpx;
  324. font-size: 22rpx;
  325. font-family: Microsoft YaHei;
  326. font-weight: 400;
  327. color: #ffffff;
  328. }
  329. .tag2 {
  330. padding: 5rpx;
  331. background: rgba(249, 97, 60, 0.5);
  332. border-radius: 6rpx;
  333. font-size: 22rpx;
  334. font-family: Microsoft YaHei;
  335. font-weight: 400;
  336. color: #ffffff;
  337. }
  338. .ul-item {
  339. padding: 5px 20rpx;
  340. display: flex;
  341. align-items: center;
  342. .item-value {
  343. padding: 20rpx;
  344. position: absolute;
  345. display: flex;
  346. align-items: center;
  347. width: 80%;
  348. .content {
  349. width: 51%;
  350. .title {
  351. font-size: 32rpx;
  352. font-family: Microsoft YaHei;
  353. font-weight: 400;
  354. color: #ffffff;
  355. }
  356. .tip {
  357. font-size: 24rpx;
  358. font-family: Microsoft YaHei;
  359. font-weight: 400;
  360. color: #ffffff;
  361. }
  362. }
  363. }
  364. .icon-tip {
  365. width: 100rpx;
  366. height: 100rpx;
  367. }
  368. .content {
  369. margin-left: 40rpx;
  370. }
  371. }
  372. .money {
  373. color: white;
  374. }
  375. ::v-deep .u-mode-center-box {
  376. border-radius: 10rpx;
  377. }
  378. .squire {
  379. padding: 30rpx 30rpx 50rpx 50rpx;
  380. }
  381. .mask-close {
  382. text-align: right;
  383. }
  384. .icon-closed {
  385. width: 48rpx;
  386. height: 48rpx;
  387. }
  388. .mask-title {
  389. text-align: center;
  390. font-size: 32rpx;
  391. color: $uni-text-color-black;
  392. margin-bottom: 50rpx;
  393. }
  394. .icon-closed {
  395. width: 40rpx;
  396. height: 40rpx;
  397. }
  398. </style>