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

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