epcSimpleDetailTwo.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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="zdyNavLeft">
  13. <div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
  14. style="color: #333333; font-size: 27px;" ></i></div>
  15. </view>
  16. <view class="xx" style="margin-left: -70rpx;" @click="goToSelectCarModel">
  17. <image src="/static/img/group2.png" style="width: 27rpx;height: 27rpx;"></image>
  18. </view>
  19. <view class="tab-box">{{title}}</view>
  20. <view v-if="param.length != 0" class="zdyNavRight"></view>
  21. <view v-else style="width: 120rpx;"></view>
  22. </view>
  23. </view>
  24. <view class="show" v-for="parent in chlilds" >
  25. <view class="show-title-left">
  26. </view>
  27. <view class="show-title">
  28. {{parent.title}}
  29. </view>
  30. <view class="show-images">
  31. <view class="show-images-item" v-for="(item,index) in parent.children" @click="toVinDetail(item,index)">
  32. <view class="item-box">
  33. <view class="item-image">
  34. <image :src="item.image" mode="aspectFit" style="width: 150rpx;height: 150rpx;"></image>
  35. </view>
  36. <view class="item-title">
  37. {{item.title}}
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. title:"",
  50. chlilds:[],
  51. childrenList:[],
  52. token:'',
  53. param:'',
  54. access_time:'',
  55. epc_id:'',
  56. brand_id:"",
  57. brand_name:"",
  58. caption:'',
  59. vin:'',
  60. }
  61. },
  62. onLoad(opt){
  63. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  64. this.title = opt.title;
  65. this.token = opt.token;
  66. this.param = opt.param;
  67. this.access_time = opt.access_time;
  68. this.epc_id = opt.epc_id;
  69. this.brand_id = opt.brand_id;
  70. this.brand_name = opt.brand_name;
  71. this.caption = opt.caption;
  72. this.vin = opt.vin;
  73. //获取缓存对象 epcChildrenTwo
  74. this.chlilds = uni.getStorageSync('epcChildrenTwo');
  75. uni.removeStorageSync('epcChildrenTwo');
  76. },
  77. methods: {
  78. goback() {
  79. uni.navigateTo({
  80. url: 'epcSimpleDetailOne?type=2&token='+this.token+'&param='+this.param+'&access_time='+this.access_time
  81. +'&epc_id='+this.epc_id+'&brand_id='+this.brand_id+"&brand_name="+this.brand_name+"&caption="+this.caption+"&vin="+this.vin
  82. })
  83. },
  84. //返回选品牌
  85. goToSelectCarModel(){
  86. let vin = this.vin;
  87. if(vin == undefined || vin =='' ||vin == 'undefined' ){
  88. uni.navigateTo({url:'SelectCarModel'});
  89. }else{
  90. uni.navigateTo({url:'index'});
  91. }
  92. },
  93. toVinDetail(item,index){
  94. uni.showLoading({
  95. title: '加载中'
  96. });
  97. this.goThree(item);
  98. },
  99. goThree(item) {
  100. console.log(item);
  101. var that = this;
  102. console.log(item);
  103. let url = "/simpleEpc/getCustomDetail";
  104. let data = {
  105. brand_id : this.brand_id,
  106. epc_id : this.epc_id,
  107. custom_id : item.id,
  108. token : this.token,
  109. access_time : this.access_time,
  110. param : this.param,
  111. vin:''
  112. };
  113. let res = this.textJieKou(url,data);
  114. res.then(response =>{
  115. let number = response.data.number;
  116. if(number != 200 ){
  117. uni.navigateTo({
  118. url: 'SimpleOemSearch?brand=' + undefined + '&token=' + this.token + '&param=' +
  119. this.param + '&access_time=' + this.access_time + '&title=' + item.title+'&epc_id='+this.epc_id+"&brand_name="+this.brand_name
  120. +"&caption="+this.caption
  121. })
  122. return;
  123. }
  124. let data = response.data.result.data.list;
  125. if(data.length > 1){//跳子组页
  126. uni.navigateTo({
  127. url: 'modelTwoSimple?brand=' + undefined + '&token=' + this.token + '&param=' +
  128. this.param + '&zzTime=' + this.access_time + '&title=' + item.title+'&epc_id='+this.epc_id+"&brand_name="+this.brand_name
  129. +"&caption="+this.caption
  130. })
  131. }else if(data.length == 1){//跳配件展示页
  132. uni.navigateTo({
  133. url: 'vinDetail?brand=' + undefined + '&token=' + data[0].token + '&param=' +
  134. data[0].param + '&access_time=' + response.data.result.data.access_time + '&title=' + item.title+'&epc_id='+this.epc_id+"&brand_name="+this.brand_name
  135. +"&tabIndex=0"
  136. })
  137. }
  138. })
  139. // uni.navigateTo({
  140. // url: 'SimpleOemSearch?brand=' + that.brand + '&token=' + that.token + '&param=' +
  141. // that.param + '&access_time=' + that.access_time + '&title=' + item.title+'&epc_id='+that.epc_id+"&brand_name="+this.brand_name
  142. // +"&caption="+this.caption
  143. // })
  144. },
  145. async textJieKou(url,data){
  146. let returnRes ;
  147. await this.$http(url,data, 'GET').then(res => {
  148. returnRes = res;
  149. console.log("方法内部返回:",res);
  150. });
  151. return returnRes;
  152. },
  153. }
  154. }
  155. </script>
  156. <style>
  157. .zdyNavBox {
  158. width: 100vw;
  159. background: #FFFFFF;
  160. position: fixed;
  161. top: 0;
  162. left: 0;
  163. z-index: 9999999;
  164. }
  165. .zdyNav {
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. padding: 14rpx 6rpx;
  170. }
  171. .zdyNavLeft {
  172. width: 120rpx;
  173. }
  174. .zdyNavTitle {
  175. background: #FFFFFF;
  176. text-align: center;
  177. font-size: 32rpx;
  178. font-weight: bold;
  179. }
  180. .zdyNavRight {
  181. background: #FFFFFF;
  182. text-align: center;
  183. font-size: 28rpx;
  184. color: #3F90F7;
  185. width: 120rpx;
  186. }
  187. .tab-box{
  188. width: 360rpx;
  189. display: flex;
  190. height: 65rpx;
  191. align-items: center;
  192. justify-content: center;
  193. }
  194. .content{
  195. background: #F0F0F0;
  196. }
  197. .show{
  198. display: flex;
  199. flex-direction: column;
  200. width: 750rpx;
  201. padding-left: 10rpx;
  202. background: #FFFFFF;
  203. margin-bottom: 20rpx;
  204. }
  205. .show-title-left{
  206. width: 6rpx;
  207. height: 27rpx;
  208. background: #1777FF;
  209. border-radius: 3rpx;
  210. position: relative;
  211. top: 57rpx;
  212. margin-left: 15rpx;
  213. }
  214. .show-title{
  215. margin-bottom: 10rpx;
  216. /* border-left: 10rpx solid #3F90F7; */
  217. margin: 20rpx 35rpx;
  218. font-size: 30rpx;
  219. font-weight: 500;
  220. font-family: PingFangSC, PingFang SC;
  221. }
  222. .show-images{
  223. display: flex;
  224. }
  225. .show-images-item{
  226. margin-left: 12rpx;
  227. }
  228. .item-box{
  229. }
  230. .item-image{
  231. justify-content: center;
  232. border-radius: 14rpx;
  233. border: 1rpx solid #E2E2E2;
  234. padding: 5rpx;
  235. margin: 10rpx 5rpx 10rpx 5rpx;
  236. width: 150rpx;
  237. display: flex;
  238. }
  239. .item-title{
  240. text-align: center;
  241. font-size: 24rpx;
  242. margin: 10rpx 0 14rpx 0;
  243. }
  244. </style>