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

148 lines
3.4 KiB

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. console.log(res.result.records);
  56. if(res.result.records.length == 0){
  57. if(this.pagesCount >= 10){
  58. if(getApp().flag == 0){
  59. uni.redirectTo (
  60. {url:'/pages/index/PayPal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))}
  61. )
  62. }else{
  63. uni.redirectTo (
  64. {url:'/pages/index/PayPal_pinpai?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))}
  65. )
  66. }
  67. }else{
  68. if(getApp().flag == 0){
  69. uni.navigateTo (
  70. {url:'/pages/index/PayPal?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))}
  71. )
  72. }else{
  73. uni.navigateTo (
  74. {url:'/pages/index/PayPal_pinpai?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))}
  75. )
  76. }
  77. }
  78. }else{
  79. getApp().pid_1 = id;
  80. if(this.pagesCount >= 10){
  81. // 使用重定向跳转页面
  82. uni.redirectTo(
  83. {url:'/pages/views/car?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
  84. })
  85. }else{
  86. uni.navigateTo(
  87. {url:'/pages/views/car?clientInfo='+ encodeURIComponent(JSON.stringify(this.clientInfo))
  88. })
  89. }
  90. }
  91. })
  92. }
  93. }
  94. }
  95. </script>
  96. <style scss>
  97. .header_infos{
  98. height: 10%;
  99. width: 100%;
  100. display: flex;
  101. flex-direction: row;
  102. align-items: center;
  103. background-color: #f8f8f8;
  104. }
  105. .header_info_right{
  106. width: 80%;
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. /* left: 40%; */
  111. }
  112. .contents{
  113. height: 100%;
  114. width: 100%;
  115. }
  116. .scroll-view {
  117. flex: 1;
  118. height: 100%;
  119. /* margin-top: 10%; */
  120. background-color: #ffffff;
  121. }
  122. .content{
  123. height: 5%;
  124. display: flex;
  125. flex-direction: row;
  126. border-bottom: 0.01rem solid #e0e0e0;
  127. /* height: 15%; */
  128. }
  129. .content-left{
  130. font-size: 0.8rem;
  131. display: flex;
  132. align-items: center;
  133. justify-content: center;
  134. }
  135. .content-right{
  136. margin-left: auto;
  137. display: flex;
  138. align-items: center;
  139. justify-content: center;
  140. }
  141. </style>