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.vue 12KB

hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 11 meses
hace 1 año
hace 1 año
hace 11 meses
hace 1 año
hace 1 año
hace 1 año
hace 11 meses
hace 1 año
hace 1 año
hace 1 año
hace 11 meses
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 11 meses
hace 1 año
hace 1 año
hace 1 año
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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"
  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}&signAgencyId=${state.signAgencyId}`,
  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.signAgencyId = val['releaseProductStandards']['signAgencyId'];
  105. state.equityId = val.releaseProductStandards.equityList[idx].equityId;
  106. // 产品金额+权益金额
  107. state.fee = Number(val.fee) + Number(val.releaseProductStandards.equityList[idx].discountPrice);
  108. // 判断是几张卡
  109. console.log("state.dataArray[i]['releaseProductStandards']['productStandards']", val['releaseProductStandards']['productStandards'])
  110. if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",").length == 1) {
  111. if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[0] == "记账卡") {
  112. state.isValueCard = 2
  113. } else if (val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[0] == '储值卡') {
  114. state.isValueCard = 1
  115. } else {
  116. state.isValueCard = 2
  117. }
  118. console.log("state.isValueCard", state.isValueCard)
  119. setItem("isValueCard", state.isValueCard);
  120. uni.navigateTo({
  121. 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}&signAgencyId=${val['releaseProductStandards']['signAgencyId']}`,
  122. });
  123. } else {
  124. state.radiolist1 = [];
  125. // 处理卡的数据
  126. for (var i = 0; i < val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",").length; i++) {
  127. const obj = {};
  128. obj["name"] = val['releaseProductStandards']['productStandards']['cardTypeArr'].split(",")[i];
  129. obj["disabled"] = false;
  130. state.radiolist1.push(obj)
  131. }
  132. state.choiceCardShow = true;
  133. console.log("state.radiolist1", state.radiolist1)
  134. }
  135. };
  136. onLoad((option : any) => {
  137. // #ifdef MP-ALIPAY
  138. state.sysType = 'ALI';
  139. // #endif
  140. // #ifdef MP-WEIXIN
  141. state.sysType = 'WECHAT';
  142. // #endif
  143. state.userType = option.userType;
  144. state.type = option.type;
  145. productList();
  146. console.log("option选择产品列表", option)
  147. });
  148. onShow(() => {
  149. })
  150. // 产品列表
  151. const productList = () => {
  152. var data = {
  153. userType: state.userType,
  154. agencyId: agentId,
  155. vanType: state.type,
  156. promotionMode: 1
  157. };
  158. const options = {
  159. type: 2,
  160. data: data,
  161. method: "POST",
  162. showLoading: true,
  163. };
  164. console.log("输出内容", options);
  165. request(etcQueryProduct, options).then((res) => {
  166. const data = stringToJson(res.bizContent);
  167. console.log("产品列表", data.list);
  168. if (data.list && data.list.length > 0) {
  169. state.dataArray = data.list ? data.list : [];
  170. console.log("state.dataArray", state.dataArray);
  171. for (var i = 0; i < state.dataArray.length; i++) {
  172. const cardTypeArr = []
  173. for (var j = 0; j < state.dataArray[i]['releaseProductStandards']['productStandards'].cardType.length; j++) {
  174. if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '2') {
  175. cardTypeArr.push('储值卡')
  176. } else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '1') {
  177. cardTypeArr.push('记账卡')
  178. } else if (state.dataArray[i]['releaseProductStandards']['productStandards'].cardType[j] == '3') {
  179. cardTypeArr.push('预存卡')
  180. }
  181. }
  182. state.dataArray[i]['releaseProductStandards']['productStandards']['cardTypeArr'] = cardTypeArr.toString()
  183. }
  184. } else {
  185. uni.showModal({
  186. title: '提示',
  187. content: '尊敬的用户:感谢您的关注!我们正紧锣密鼓地为您准备一款全新的产品。虽然目前尚未上线,但请您耐心等待,我们将以更好的姿态与更丰富的功能,为您呈现一份超出期待的产品。',
  188. showCancel: false,
  189. success: function (res) {
  190. if (res.confirm) {
  191. console.log('用户点击确定');
  192. uni.switchTab({
  193. url: '/pages/index/index'
  194. })
  195. } else if (res.cancel) {
  196. console.log('用户点击取消');
  197. }
  198. }
  199. });
  200. }
  201. console.log("state.dataArray", state.dataArray)
  202. });
  203. }
  204. //监听页面滚动
  205. onPageScroll((e) => {
  206. scrollTop.value = e.scrollTop;
  207. });
  208. const state = reactive({
  209. isValueCard: 1, //卡的类型
  210. radiolist1: [], //选择卡的数据列表
  211. choiceCardShow: false, //选择卡的弹出框
  212. isSign: '',
  213. sysType: "",
  214. orderId: "",
  215. userType: 1, //1 个人 2单位
  216. type: 0, //0 客车 1货车
  217. vehiclePlateColor: "",
  218. data: {
  219. show: false,
  220. src: imgURL + "applyCard/edit.png",
  221. },
  222. dataArray: [],
  223. list: [
  224. {
  225. bg: imgURL + "applyCard/product-bg.png",
  226. icon: imgURL + "applyCard/wechat.png",
  227. title: "【货车】微信车主服务",
  228. tip: "绑定微信支付,无需绑定银行卡",
  229. },
  230. ],
  231. fee: 0, //产品金额
  232. equityId: "",
  233. signAgencyId:"",//渠道标识
  234. });
  235. const closeMask = () => {
  236. state.choiceCardShow = false;
  237. };
  238. </script>
  239. <style lang="scss" scoped>
  240. ::v-deep .u-radio {
  241. display: flex !important;
  242. align-items: center !important;
  243. float: none !important;
  244. }
  245. ::v-deep .u-icon__icon {
  246. top: -4px !important;
  247. }
  248. .bottomTip {
  249. margin-top: 100rpx;
  250. text-align: center;
  251. font-size: 28rpx;
  252. font-family: Microsoft YaHei;
  253. font-weight: 400;
  254. color: #b3b3b3;
  255. }
  256. .content-value {
  257. position: relative;
  258. padding: 0rpx 30rpx;
  259. position: relative;
  260. .img-pos {
  261. position: absolute;
  262. left: 500rpx;
  263. top: -38rpx;
  264. right: 50rpx;
  265. .img-flex {
  266. display: flex;
  267. justify-content: space-between;
  268. align-items: center;
  269. .car-img {
  270. width: 86rpx;
  271. height: 42rpx;
  272. }
  273. .flag-img {
  274. width: 30rpx;
  275. height: 35rpx;
  276. }
  277. }
  278. }
  279. }
  280. .flex {
  281. display: flex;
  282. align-items: center;
  283. }
  284. .action {
  285. margin-top: 30rpx;
  286. padding-left: 20rpx;
  287. padding-right: 20rpx;
  288. padding-bottom: 30rpx;
  289. .button {
  290. height: 80rpx;
  291. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  292. border-radius: 40rpx;
  293. font-size: 32rpx;
  294. font-weight: 400;
  295. color: #ffffff;
  296. line-height: 80rpx;
  297. }
  298. }
  299. .action-btn {
  300. margin-left: 45rpx;
  301. width: 121rpx;
  302. height: 61rpx;
  303. border: 1px solid rgba(255, 255, 255, 1);
  304. border-radius: 30rpx;
  305. background: rgba(255, 255, 255, 0.2);
  306. text-align: center;
  307. font-size: 30rpx;
  308. font-family: Microsoft YaHei;
  309. font-weight: 400;
  310. color: #ffffff;
  311. line-height: 61rpx;
  312. }
  313. .tag1 {
  314. padding: 5rpx;
  315. background: rgba(0, 179, 139, 0.5);
  316. border-radius: 6rpx;
  317. font-size: 22rpx;
  318. font-family: Microsoft YaHei;
  319. font-weight: 400;
  320. color: #ffffff;
  321. }
  322. .tag3 {
  323. padding: 5rpx;
  324. background: rgba(139, 112, 228, 0.5);
  325. border-radius: 6rpx;
  326. font-size: 22rpx;
  327. font-family: Microsoft YaHei;
  328. font-weight: 400;
  329. color: #ffffff;
  330. }
  331. .tag2 {
  332. padding: 5rpx;
  333. background: rgba(249, 97, 60, 0.5);
  334. border-radius: 6rpx;
  335. font-size: 22rpx;
  336. font-family: Microsoft YaHei;
  337. font-weight: 400;
  338. color: #ffffff;
  339. }
  340. .ul-item {
  341. padding: 5px 20rpx;
  342. display: flex;
  343. align-items: center;
  344. .item-value {
  345. padding: 20rpx;
  346. position: absolute;
  347. display: flex;
  348. align-items: center;
  349. width: 80%;
  350. .content {
  351. width: 51%;
  352. .title {
  353. font-size: 32rpx;
  354. font-family: Microsoft YaHei;
  355. font-weight: 400;
  356. color: #ffffff;
  357. }
  358. .tip {
  359. font-size: 24rpx;
  360. font-family: Microsoft YaHei;
  361. font-weight: 400;
  362. color: #ffffff;
  363. }
  364. }
  365. }
  366. .icon-tip {
  367. width: 100rpx;
  368. height: 100rpx;
  369. }
  370. .content {
  371. margin-left: 40rpx;
  372. }
  373. }
  374. .money {
  375. color: white;
  376. }
  377. ::v-deep .u-mode-center-box {
  378. border-radius: 10rpx;
  379. }
  380. .squire {
  381. padding: 30rpx 30rpx 50rpx 50rpx;
  382. }
  383. .mask-close {
  384. text-align: right;
  385. }
  386. .icon-closed {
  387. width: 48rpx;
  388. height: 48rpx;
  389. }
  390. .mask-title {
  391. text-align: center;
  392. font-size: 32rpx;
  393. color: $uni-text-color-black;
  394. margin-bottom: 50rpx;
  395. }
  396. .icon-closed {
  397. width: 40rpx;
  398. height: 40rpx;
  399. }
  400. </style>