Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

choice-product.vue 6.3KB

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