您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

choice-product.vue 6.2KB

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