epcSimpleDetailTwo.vue 6.3 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. },
  76. methods: {
  77. goback() {
  78. uni.navigateBack({
  79. delta: 1,
  80. success: (res) => {
  81. console.log("返回成功", res);
  82. }
  83. });
  84. },
  85. //返回选品牌
  86. goToSelectCarModel(){
  87. let vin = this.vin;
  88. if(vin == undefined || vin =='' ||vin == 'undefined' ){
  89. uni.navigateTo({url:'SelectCarModel'});
  90. }else{
  91. uni.navigateTo({url:'index'});
  92. }
  93. },
  94. toVinDetail(item,index){
  95. uni.showLoading({
  96. title: '加载中'
  97. });
  98. this.goThree(item);
  99. },
  100. goThree(item) {
  101. console.log(item);
  102. var that = this;
  103. console.log(item);
  104. let url = "/simpleEpc/getCustomDetail";
  105. let data = {
  106. brand_id : this.brand_id,
  107. epc_id : this.epc_id,
  108. custom_id : item.id,
  109. token : this.token,
  110. access_time : this.access_time,
  111. param : this.param,
  112. vin:''
  113. };
  114. let res = this.textJieKou(url,data);
  115. res.then(response =>{
  116. let number = response.data.number;
  117. if(number != 200 ){
  118. uni.navigateTo({
  119. url: 'SimpleOemSearch?brand=' + undefined + '&token=' + this.token + '&param=' +
  120. this.param + '&access_time=' + this.access_time + '&title=' + item.title+'&epc_id='+this.epc_id+"&brand_name="+this.brand_name
  121. +"&caption="+this.caption
  122. })
  123. return;
  124. }
  125. let data = response.data.result.data.list;
  126. if(data.length > 1){//跳子组页
  127. uni.navigateTo({
  128. url: 'modelTwoSimple?brand=' + undefined + '&token=' + this.token + '&param=' +
  129. this.param + '&zzTime=' + this.access_time + '&title=' + item.title+'&epc_id='+this.epc_id+"&brand_name="+this.brand_name
  130. +"&caption="+this.caption
  131. })
  132. }else if(data.length == 1){//跳配件展示页
  133. uni.navigateTo({
  134. url: 'vinDetail?brand=' + undefined + '&token=' + data[0].token + '&param=' +
  135. data[0].param + '&access_time=' + response.data.result.data.access_time + '&title=' + item.title+'&epc_id='+this.epc_id+"&brand_name="+this.brand_name
  136. +"&tabIndex=0"
  137. })
  138. }
  139. })
  140. // uni.navigateTo({
  141. // url: 'SimpleOemSearch?brand=' + that.brand + '&token=' + that.token + '&param=' +
  142. // that.param + '&access_time=' + that.access_time + '&title=' + item.title+'&epc_id='+that.epc_id+"&brand_name="+this.brand_name
  143. // +"&caption="+this.caption
  144. // })
  145. },
  146. async textJieKou(url,data){
  147. let returnRes ;
  148. await this.$http(url,data, 'GET').then(res => {
  149. returnRes = res;
  150. console.log("方法内部返回:",res);
  151. });
  152. return returnRes;
  153. },
  154. }
  155. }
  156. </script>
  157. <style>
  158. .zdyNavBox {
  159. width: 100vw;
  160. background: #FFFFFF;
  161. position: fixed;
  162. top: 0;
  163. left: 0;
  164. z-index: 9999999;
  165. }
  166. .zdyNav {
  167. display: flex;
  168. justify-content: space-between;
  169. align-items: center;
  170. padding: 14rpx 6rpx;
  171. }
  172. .zdyNavLeft {
  173. width: 120rpx;
  174. }
  175. .zdyNavTitle {
  176. background: #FFFFFF;
  177. text-align: center;
  178. font-size: 32rpx;
  179. font-weight: bold;
  180. }
  181. .zdyNavRight {
  182. background: #FFFFFF;
  183. text-align: center;
  184. font-size: 28rpx;
  185. color: #3F90F7;
  186. width: 120rpx;
  187. }
  188. .tab-box{
  189. width: 360rpx;
  190. display: flex;
  191. height: 65rpx;
  192. align-items: center;
  193. justify-content: center;
  194. }
  195. .content{
  196. background: #F0F0F0;
  197. }
  198. .show{
  199. display: flex;
  200. flex-direction: column;
  201. width: 750rpx;
  202. padding-left: 10rpx;
  203. background: #FFFFFF;
  204. margin-bottom: 20rpx;
  205. }
  206. .show-title-left{
  207. width: 6rpx;
  208. height: 27rpx;
  209. background: #1777FF;
  210. border-radius: 3rpx;
  211. position: relative;
  212. top: 57rpx;
  213. margin-left: 15rpx;
  214. }
  215. .show-title{
  216. margin-bottom: 10rpx;
  217. /* border-left: 10rpx solid #3F90F7; */
  218. margin: 20rpx 35rpx;
  219. font-size: 30rpx;
  220. font-weight: 500;
  221. font-family: PingFangSC, PingFang SC;
  222. }
  223. .show-images{
  224. display: flex;
  225. flex-wrap: wrap;
  226. }
  227. .show-images-item{
  228. margin-left: 12rpx;
  229. }
  230. .item-box{
  231. }
  232. .item-image{
  233. justify-content: center;
  234. border-radius: 14rpx;
  235. border: 1rpx solid #E2E2E2;
  236. padding: 5rpx;
  237. margin: 10rpx 5rpx 10rpx 5rpx;
  238. width: 150rpx;
  239. display: flex;
  240. }
  241. .item-title{
  242. text-align: center;
  243. font-size: 24rpx;
  244. margin: 10rpx 0 14rpx 0;
  245. }
  246. </style>