epcSimpleDetailTwo.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="content">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
  9. style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
  10. </view>
  11. <view class="xx" style="position: absolute;left:100rpx;color: black;font-size: 23px;" @click="goToSelectCarModel">X</view>
  12. <view class="zdyNavTitle">{{title}}</view>
  13. <view v-if="param.length != 0" class="zdyNavRight"></view>
  14. <view v-else style="width: 120rpx;"></view>
  15. </view>
  16. </view>
  17. <view class="show" v-for="parent in chlilds" >
  18. <view class="show-title">
  19. {{parent.title}}
  20. </view>
  21. <view class="show-images">
  22. <view class="show-images-item" v-for="(item,index) in parent.children" @click="toVinDetail(item,index)">
  23. <view class="item-box">
  24. <view class="item-image">
  25. <image :src="item.image" mode="aspectFit" style="width: 150rpx;height: 150rpx;"></image>
  26. </view>
  27. <view class="item-title">
  28. {{item.title}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. title:"",
  41. chlilds:[],
  42. childrenList:[],
  43. token:'',
  44. param:'',
  45. access_time:'',
  46. epc_id:'',
  47. brand_id:"",
  48. brand_name:"",
  49. caption:'',
  50. }
  51. },
  52. onLoad(opt){
  53. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  54. this.title = opt.title;
  55. this.token = opt.token;
  56. this.param = opt.param;
  57. this.access_time = opt.access_time;
  58. this.epc_id = opt.epc_id;
  59. this.brand_id = opt.brand_id;
  60. this.brand_name = opt.brand_name;
  61. this.caption = opt.caption;
  62. //获取缓存对象 epcChildrenTwo
  63. this.chlilds = uni.getStorageSync('epcChildrenTwo');
  64. uni.removeStorageSync('epcChildrenTwo');
  65. console.log(this.chlilds);
  66. },
  67. methods: {
  68. goback() {
  69. uni.navigateTo({
  70. url: 'epcSimpleDetailOne?type=2&token='+this.token+'&param='+this.param+'&access_time='+this.access_time
  71. +'&epc_id='+this.epc_id+'&brand_id='+this.brand_id+"&brand_name="+this.brand_name
  72. })
  73. },
  74. //返回选品牌
  75. goToSelectCarModel(){
  76. uni.navigateTo({url:'SelectCarModel'});
  77. },
  78. toVinDetail(item,index){
  79. uni.showLoading({
  80. title: '加载中'
  81. });
  82. console.log(this.chlilds);
  83. this.goThree(item);
  84. },
  85. goThree(item) {
  86. var that = this;
  87. console.log("点了",item);
  88. console.log("去search");
  89. uni.navigateTo({
  90. url: 'SimpleOemSearch?brand=' + that.brand + '&token=' + that.token + '&param=' +
  91. that.param + '&access_time=' + that.access_time + '&title=' + item.title+'&epc_id='+that.epc_id+"&brand_name="+this.brand_name
  92. +"&caption="+this.caption
  93. })
  94. // uni.setStorage({
  95. // key: 'childrenList',
  96. // data: that.childrenList,
  97. // success: function() {
  98. // uni.navigateTo({
  99. // url: 'SimpleOemSearch.vue?brand=' + that.brand + '&token=' + that.token + '&param=' +
  100. // that.param + '&access_time=' + that.access_time + '&title=' + index+'&epc_id='+that.epc_id
  101. // })
  102. // }
  103. // });
  104. }
  105. }
  106. }
  107. </script>
  108. <style>
  109. .zdyNavBox {
  110. width: 100vw;
  111. background: #FFFFFF;
  112. position: fixed;
  113. top: 0;
  114. left: 0;
  115. z-index: 9999999;
  116. }
  117. .zdyNav {
  118. display: flex;
  119. justify-content: space-between;
  120. align-items: center;
  121. padding: 14rpx 6rpx;
  122. }
  123. .zdyNavLeft {
  124. width: 120rpx;
  125. }
  126. .zdyNavTitle {
  127. background: #FFFFFF;
  128. text-align: center;
  129. font-size: 32rpx;
  130. font-weight: bold;
  131. }
  132. .zdyNavRight {
  133. background: #FFFFFF;
  134. text-align: center;
  135. font-size: 28rpx;
  136. color: #3F90F7;
  137. width: 120rpx;
  138. }
  139. .content{
  140. background: #F0F0F0;
  141. }
  142. .show{
  143. display: flex;
  144. flex-direction: column;
  145. width: 750rpx;
  146. padding-left: 10rpx;
  147. background: #FFFFFF;
  148. margin-bottom: 20rpx;
  149. }
  150. .show-title{
  151. margin-bottom: 10rpx;
  152. border-left: 10rpx solid #3F90F7;
  153. padding-left: 20rpx;
  154. margin: 20rpx 0;
  155. }
  156. .show-images{
  157. display: grid;
  158. grid-template-columns: repeat(4,1fr);
  159. }
  160. .show-images-item{
  161. }
  162. .item-box{
  163. }
  164. .item-image{
  165. justify-content: center;
  166. border-radius: 10rpx;
  167. border: 1rpx solid #999999;
  168. padding: 5rpx;
  169. margin: 10rpx 5rpx 10rpx 5rpx;
  170. width: 150rpx;
  171. display: flex;
  172. }
  173. .item-title{
  174. text-align: center;
  175. }
  176. </style>