Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

choice-product.vue 6.5KB

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