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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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. request(etcQueryProduct, options).then((res) => {
  99. console.log(res.bizContent);
  100. const data = stringToJson(res.bizContent);
  101. console.log(data);
  102. console.log(typeof(data));
  103. state.dataArray = data??[];
  104. });
  105. });
  106. const productReCodeAction = (id) => {
  107. var data = {
  108. productId: id,
  109. orderId: state.orderId
  110. };
  111. const options = {
  112. type: 2,
  113. data: data,
  114. method: "POST",
  115. showLoading: true,
  116. };
  117. return new Promise(async (resolve, reject) => {
  118. const res = await request(productReCode, options);
  119. const data = stringToJson(res.bizContent);
  120. resolve(data);
  121. }).catch((error) => {
  122. reject(error);
  123. });
  124. }
  125. const state = reactive({
  126. orderId: "",
  127. userType:"",
  128. vehiclePlateColor:"",
  129. data: {
  130. show: false,
  131. src: imgURL + "applyCard/edit.png",
  132. },
  133. dataArray: [],
  134. list: [{
  135. bg: imgURL + "applyCard/product-bg.png",
  136. icon: imgURL + "applyCard/wechat.png",
  137. title: "【货车】微信车主服务",
  138. tip: "绑定微信支付,无需绑定银行卡",
  139. }, ],
  140. });
  141. </script>
  142. <style lang="scss" scoped>
  143. .bottomTip {
  144. margin-top: 100rpx;
  145. text-align: center;
  146. font-size: 28rpx;
  147. font-family: Microsoft YaHei;
  148. font-weight: 400;
  149. color: #b3b3b3;
  150. }
  151. .content-value {
  152. position: relative;
  153. margin-top: -50rpx;
  154. padding: 0rpx 30rpx;
  155. position: relative;
  156. .img-pos {
  157. position: absolute;
  158. left: 500rpx;
  159. top: -38rpx;
  160. right: 50rpx;
  161. .img-flex {
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: center;
  165. .car-img {
  166. width: 86rpx;
  167. height: 42rpx;
  168. }
  169. .flag-img {
  170. width: 30rpx;
  171. height: 35rpx;
  172. }
  173. }
  174. }
  175. }
  176. .flex {
  177. display: flex;
  178. align-items: center;
  179. }
  180. .action {
  181. margin-top: 30rpx;
  182. padding-left: 20rpx;
  183. padding-right: 20rpx;
  184. padding-bottom: 30rpx;
  185. .button {
  186. height: 80rpx;
  187. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  188. border-radius: 40rpx;
  189. font-size: 32rpx;
  190. font-weight: 400;
  191. color: #ffffff;
  192. line-height: 80rpx;
  193. }
  194. }
  195. .action-btn {
  196. margin-left: 45rpx;
  197. width: 121rpx;
  198. height: 61rpx;
  199. border: 1px solid rgba(255, 255, 255, 1);
  200. border-radius: 30rpx;
  201. background: rgba(255, 255, 255, 0.2);
  202. text-align: center;
  203. font-size: 30rpx;
  204. font-family: Microsoft YaHei;
  205. font-weight: 400;
  206. color: #ffffff;
  207. line-height: 61rpx;
  208. }
  209. .tag1 {
  210. padding: 5rpx;
  211. background: rgba(0, 179, 139, 0.5);
  212. border-radius: 6rpx;
  213. font-size: 22rpx;
  214. font-family: Microsoft YaHei;
  215. font-weight: 400;
  216. color: #ffffff;
  217. }
  218. .tag3 {
  219. padding: 5rpx;
  220. background: rgba(139, 112, 228, 0.5);
  221. border-radius: 6rpx;
  222. font-size: 22rpx;
  223. font-family: Microsoft YaHei;
  224. font-weight: 400;
  225. color: #ffffff;
  226. }
  227. .tag2 {
  228. padding: 5rpx;
  229. background: rgba(249, 97, 60, 0.5);
  230. border-radius: 6rpx;
  231. font-size: 22rpx;
  232. font-family: Microsoft YaHei;
  233. font-weight: 400;
  234. color: #ffffff;
  235. }
  236. .ul-item {
  237. padding: 5px 20rpx;
  238. display: flex;
  239. align-items: center;
  240. .item-value {
  241. padding: 20rpx;
  242. position: absolute;
  243. display: flex;
  244. align-items: center;
  245. justify-content: space-around;
  246. .content {
  247. .title {
  248. font-size: 32rpx;
  249. font-family: Microsoft YaHei;
  250. font-weight: 400;
  251. color: #ffffff;
  252. }
  253. .tip {
  254. font-size: 24rpx;
  255. font-family: Microsoft YaHei;
  256. font-weight: 400;
  257. color: #ffffff;
  258. }
  259. }
  260. }
  261. .icon-tip {
  262. width: 100rpx;
  263. height: 100rpx;
  264. }
  265. .content {
  266. margin-left: 40rpx;
  267. }
  268. }
  269. </style>