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

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