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

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