合同小程序前端代码仓库
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.

136 lines
2.9 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="container">
  3. <view class="header_infos">
  4. <view class="header_info_left" @click="getBack">
  5. <uni-icons type="left" size="30">
  6. </uni-icons>
  7. </view>
  8. <text class="header_info_right">
  9. 选择车系
  10. </text>
  11. </view>
  12. <view class="contents">
  13. <scroll-view scroll-y="true" class="scroll-view" :scroll-into-view="currentIndex">
  14. <view class="content" v-for="(item, index) in list" :key="index" @click="getPid(item.id,item.name)">
  15. <text class="content-left">
  16. {{item.name}}
  17. </text>
  18. <uni-icons class="content-right" type="right" color="#c0c0c0"></uni-icons>
  19. </view>
  20. </scroll-view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {childList} from '@/api.uts'
  26. export default {
  27. data() {
  28. return {
  29. list:[],
  30. currentIndex: '',
  31. clientInfo:{},
  32. certFront:'',
  33. carPic:'',
  34. certBack:'',
  35. }
  36. },
  37. onLoad(options) {
  38. this.clientInfo = JSON.parse(decodeURIComponent(options.clientInfo));
  39. console.log(this.clientInfo.appOrderCarList[0].carSeries);
  40. },
  41. mounted() {
  42. childList({pid:getApp().pid}).then((res)=>{
  43. this.list =res.result.records
  44. })
  45. },
  46. methods: {
  47. getBack(){
  48. uni.navigateBack(
  49. {delta:1}
  50. )
  51. },
  52. getPid(id,name){
  53. this.clientInfo.appOrderCarList[0].carSeries = this.clientInfo.appOrderCarList[0].carSeries + name;
  54. childList({pid:id}).then((res)=>{
  55. if(res.result.records.length == 0){
  56. if(this.pagesCount >= 10){
  57. // 使用重定向跳转页面
  58. uni.redirectTo(
  59. {url:'/pages/index/PayPal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
  60. })
  61. }else{
  62. uni.navigateTo(
  63. {url:'/pages/index/PayPal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
  64. })
  65. }
  66. }else{
  67. getApp().pid = id;
  68. if(this.pagesCount >= 10){
  69. // 使用重定向跳转页面
  70. uni.redirectTo(
  71. {url:'/pages/views/carFinal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
  72. })
  73. }else{
  74. uni.navigateTo(
  75. {url:'/pages/views/carFinal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
  76. })
  77. }
  78. }
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style scss>
  85. .header_infos{
  86. height: 10%;
  87. width: 100%;
  88. display: flex;
  89. flex-direction: row;
  90. align-items: center;
  91. background-color: #f8f8f8;
  92. }
  93. .header_info_right{
  94. width: 80%;
  95. display: flex;
  96. align-items: center;
  97. justify-content: center;
  98. /* left: 40%; */
  99. }
  100. .contents{
  101. height: 100%;
  102. width: 100%;
  103. }
  104. .scroll-view {
  105. flex: 1;
  106. height: 100%;
  107. /* margin-top: 10%; */
  108. background-color: #ffffff;
  109. }
  110. .content{
  111. height: 5%;
  112. display: flex;
  113. flex-direction: row;
  114. border-bottom: 0.01rem solid #e0e0e0;
  115. /* height: 15%; */
  116. }
  117. .content-left{
  118. font-size: 0.8rem;
  119. display: flex;
  120. align-items: center;
  121. justify-content: center;
  122. }
  123. .content-right{
  124. margin-left: auto;
  125. display: flex;
  126. align-items: center;
  127. justify-content: center;
  128. }
  129. </style>