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

choice-product.vue 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <navBar title="选择产品" :scrollTop="scrollTop"></navBar>
  3. <navBgCar></navBgCar>
  4. <view class="content-value">
  5. <view
  6. @click="savaHandle(item)"
  7. class="ul-item"
  8. v-for="(item, index) in state.dataArray"
  9. :key="index"
  10. >
  11. <image
  12. style="width: 100%; height: 170rpx; border-radius: 20rpx"
  13. :src="`${$imgUrl}applyCard/product-bg.png`"
  14. ></image>
  15. <view class="item-value">
  16. <image class="icon-tip" :src="`${$imgUrl}applyCard/wechat.png`"></image>
  17. <view class="content">
  18. <view class="title">
  19. {{ item.name }}
  20. </view>
  21. <view style="margin-top: 15rpx" class="tip">
  22. {{ item.productMsg }}
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="bottomTip"> 到底啦!敬请期待其他产品! </view>
  28. </view>
  29. </template>
  30. <script setup lang="ts">
  31. import { onLoad, onPageScroll } from "@dcloudio/uni-app";
  32. import { reactive, ref } from "vue";
  33. import { etcQueryProduct, productReCode } from "@/utils/network/api.js";
  34. import { request } from "@/utils/network/request.js";
  35. import { stringToJson } from "@/utils/network/encryption";
  36. import { fileURL } from "@/datas/fileURL.js";
  37. import navBgCar from "./components/nav-bg-car1";
  38. import navBar from "@/components/nav-bar/nav-bar2.vue";
  39. import { getItem, StorageKeys } from "@/utils/storage.ts";
  40. import { msg } from "@/utils/utils";
  41. const imgURL = `${fileURL}image/`;
  42. import { setItem } from "@/utils/storage";
  43. const scrollTop = ref(0); //滚动距离
  44. const savaHandle = (val) => {
  45. // productReCodeAction(val.id).then((value) => {
  46. // if (val.isValueCard === 2) {
  47. setItem("clientFee", val.clientFee);
  48. setItem("productId", val.id);
  49. setItem("isValueCard", val.isValueCard);
  50. uni.redirectTo({
  51. url: `/subpackage/applyCard/essential-information?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}`,
  52. });
  53. // if (state.userType === 1) {
  54. // uni.redirectTo({
  55. // url: `/subpackage/applyCard/opening-account-people?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}`,
  56. // });
  57. // } else {
  58. // uni.redirectTo({
  59. // url: `/subpackage/applyCard/opening-account-unit?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}`,
  60. // });
  61. // }
  62. // if (val.isValueCard === 2) {
  63. // setItem('clientFee', val.clientFee)
  64. // setItem("productId", val.id)
  65. // uni.navigateTo({
  66. // url: `/subpackage/applyCard/release-products?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
  67. // });
  68. // } else {
  69. // uni.navigateTo({
  70. // url: `/subpackage/applyCard/product-detail?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
  71. // });
  72. // }
  73. // });
  74. };
  75. onLoad((option: any) => {
  76. // state.orderId = option.orderId;
  77. // state.userType = option.userType;
  78. // state.vehiclePlateColor = option.vehiclePlateColor;
  79. state.userType = option.userType;
  80. state.type = option.type;
  81. // var data = {
  82. // orderId: state.orderId,
  83. // };
  84. // const options = {
  85. // type: 2,
  86. // data: data,
  87. // method: "POST",
  88. // showLoading: true,
  89. // };
  90. // console.log('输出内容',options.data)
  91. // request(etcQueryProduct, options).then((res) => {
  92. // console.log(res.bizContent);
  93. // const data = stringToJson(res.bizContent);
  94. // console.log(data);
  95. // console.log(typeof(data));
  96. // state.dataArray = data??[];
  97. // });
  98. var data = {
  99. productType: state.type,
  100. };
  101. const options = {
  102. type: 2,
  103. data: data,
  104. method: "POST",
  105. showLoading: true,
  106. };
  107. console.log("输出内容", options.data);
  108. request(etcQueryProduct, options).then((res) => {
  109. // console.log(res.bizContent);
  110. const data = stringToJson(res.bizContent);
  111. console.log(data);
  112. // console.log(typeof(data));
  113. state.dataArray = data.csmsnProducts ?? [];
  114. });
  115. });
  116. //监听页面滚动
  117. onPageScroll((e) => {
  118. scrollTop.value = e.scrollTop;
  119. });
  120. const productReCodeAction = (id) => {
  121. var data = {
  122. productId: id,
  123. orderId: state.orderId,
  124. };
  125. const options = {
  126. type: 2,
  127. data: data,
  128. method: "POST",
  129. showLoading: true,
  130. };
  131. return new Promise(async (resolve, reject) => {
  132. const res = await request(productReCode, options);
  133. const data = stringToJson(res.bizContent);
  134. resolve(data);
  135. }).catch((error) => {
  136. reject(error);
  137. });
  138. };
  139. const state = reactive({
  140. orderId: "",
  141. userType: 1, //1 个人 2单位
  142. type: 0, //0 客车 1货车
  143. vehiclePlateColor: "",
  144. data: {
  145. show: false,
  146. src: imgURL + "applyCard/edit.png",
  147. },
  148. dataArray: [],
  149. list: [
  150. {
  151. bg: imgURL + "applyCard/product-bg.png",
  152. icon: imgURL + "applyCard/wechat.png",
  153. title: "【货车】微信车主服务",
  154. tip: "绑定微信支付,无需绑定银行卡",
  155. },
  156. ],
  157. });
  158. </script>
  159. <style lang="scss" scoped>
  160. .bottomTip {
  161. margin-top: 100rpx;
  162. text-align: center;
  163. font-size: 28rpx;
  164. font-family: Microsoft YaHei;
  165. font-weight: 400;
  166. color: #b3b3b3;
  167. }
  168. .content-value {
  169. position: relative;
  170. margin-top: -50rpx;
  171. padding: 0rpx 30rpx;
  172. position: relative;
  173. .img-pos {
  174. position: absolute;
  175. left: 500rpx;
  176. top: -38rpx;
  177. right: 50rpx;
  178. .img-flex {
  179. display: flex;
  180. justify-content: space-between;
  181. align-items: center;
  182. .car-img {
  183. width: 86rpx;
  184. height: 42rpx;
  185. }
  186. .flag-img {
  187. width: 30rpx;
  188. height: 35rpx;
  189. }
  190. }
  191. }
  192. }
  193. .flex {
  194. display: flex;
  195. align-items: center;
  196. }
  197. .action {
  198. margin-top: 30rpx;
  199. padding-left: 20rpx;
  200. padding-right: 20rpx;
  201. padding-bottom: 30rpx;
  202. .button {
  203. height: 80rpx;
  204. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  205. border-radius: 40rpx;
  206. font-size: 32rpx;
  207. font-weight: 400;
  208. color: #ffffff;
  209. line-height: 80rpx;
  210. }
  211. }
  212. .action-btn {
  213. margin-left: 45rpx;
  214. width: 121rpx;
  215. height: 61rpx;
  216. border: 1px solid rgba(255, 255, 255, 1);
  217. border-radius: 30rpx;
  218. background: rgba(255, 255, 255, 0.2);
  219. text-align: center;
  220. font-size: 30rpx;
  221. font-family: Microsoft YaHei;
  222. font-weight: 400;
  223. color: #ffffff;
  224. line-height: 61rpx;
  225. }
  226. .tag1 {
  227. padding: 5rpx;
  228. background: rgba(0, 179, 139, 0.5);
  229. border-radius: 6rpx;
  230. font-size: 22rpx;
  231. font-family: Microsoft YaHei;
  232. font-weight: 400;
  233. color: #ffffff;
  234. }
  235. .tag3 {
  236. padding: 5rpx;
  237. background: rgba(139, 112, 228, 0.5);
  238. border-radius: 6rpx;
  239. font-size: 22rpx;
  240. font-family: Microsoft YaHei;
  241. font-weight: 400;
  242. color: #ffffff;
  243. }
  244. .tag2 {
  245. padding: 5rpx;
  246. background: rgba(249, 97, 60, 0.5);
  247. border-radius: 6rpx;
  248. font-size: 22rpx;
  249. font-family: Microsoft YaHei;
  250. font-weight: 400;
  251. color: #ffffff;
  252. }
  253. .ul-item {
  254. padding: 5px 20rpx;
  255. display: flex;
  256. align-items: center;
  257. .item-value {
  258. padding: 20rpx;
  259. position: absolute;
  260. display: flex;
  261. align-items: center;
  262. justify-content: space-around;
  263. .content {
  264. .title {
  265. font-size: 32rpx;
  266. font-family: Microsoft YaHei;
  267. font-weight: 400;
  268. color: #ffffff;
  269. }
  270. .tip {
  271. font-size: 24rpx;
  272. font-family: Microsoft YaHei;
  273. font-weight: 400;
  274. color: #ffffff;
  275. }
  276. }
  277. }
  278. .icon-tip {
  279. width: 100rpx;
  280. height: 100rpx;
  281. }
  282. .content {
  283. margin-left: 40rpx;
  284. }
  285. }
  286. </style>