選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

choice-product.vue 11KB

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