OEDetail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="box">
  3. <!-- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  4. :duration="duration">
  5. <swiper-item v-for="(item,index) in oedata.image.epc">
  6. <view class="swiper-item ">
  7. <image class="swiper-itemIMg" :src="item.pic" mode="aspectFit"></image>
  8. </view>
  9. </swiper-item>
  10. </swiper> -->
  11. <view class="TOP">
  12. <image :src="oedata.image.epc.pic" mode="" class="picIMg"></image>
  13. </view>
  14. <!-- <view class="brandBox">
  15. <span>共{{oedata.epc_info.length}}个品牌,已选品牌:{{oedata.brand}}</span>
  16. <view class="switch" @click="switchBrand">切换</view>
  17. </view> -->
  18. <view >
  19. <picker @change="bindChange" class="picker-view" :range="oedata.epc_info" :range-key="'brand'">
  20. <view class="brandBox">
  21. <span>共{{oedata.epc_info.length}}个品牌,已选品牌:{{oedata.brand}}</span>
  22. <view class="switch" @click="switchBrand" v-if="oedata.epc_info.length>1">切换</view>
  23. </view>
  24. </picker>
  25. </view>
  26. <view class="line">
  27. <view class="lineLeft">结构位置</view>
  28. <view class="lineRight">{{oedata.image.epc.refernum}}</view>
  29. </view>
  30. <view class="line">
  31. <view class="lineLeft">配件OE</view>
  32. <view class="lineRight">{{partsnum}}</view>
  33. </view>
  34. <view class="line">
  35. <view class="lineLeft">配件名称</view>
  36. <view class="lineRight">{{oedata.caption}}</view>
  37. </view>
  38. <view class="line">
  39. <view class="lineLeft">备注</view>
  40. <view class="lineRight">{{oedata.remark}}</view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. components: {
  47. },
  48. data() {
  49. return {
  50. partsnum:'',
  51. indicatorDots: true,
  52. autoplay: true,
  53. interval: 5000,
  54. duration: 500,
  55. oedata:"",
  56. index:0,
  57. brand_id:'',
  58. epc_id:'',
  59. brandShow:false,
  60. }
  61. },
  62. onLoad(opt) {
  63. console.log('opt+', opt);
  64. this.partsnum = opt.partnum;
  65. this.find()
  66. },
  67. methods: {
  68. switchBrand(){
  69. this.brandShow=true;
  70. },
  71. bindChange(e){
  72. console.log(e)
  73. this.epc_id=this.oedata.epc_info[e.detail.value].epc_id;
  74. this.brand_id=this.oedata.epc_info[e.detail.value].brand_id;
  75. this.find()
  76. },
  77. // 配件查询
  78. find() {
  79. uni.showLoading({
  80. title: '加载中'
  81. });
  82. this.$http('advancedEpc/parts/detail', {
  83. partsnum: this.partsnum,
  84. brand_id:this.brand_id,
  85. epc_id:this.epc_id
  86. }, 'GET').then(res => {
  87. uni.hideLoading();
  88. if (res.data.number == 200 || res.data.number == 5212) {
  89. this.oedata=res.data.result
  90. } else {
  91. uni.showToast({
  92. title: res.data.message,
  93. icon: 'none',
  94. duration: 3000
  95. });
  96. }
  97. });
  98. },
  99. },
  100. // 下拉刷新 上拉加载更多
  101. onPullDownRefresh() {
  102. // this.page = 1
  103. // this.getItemData()
  104. setTimeout(function() {
  105. uni.stopPullDownRefresh();
  106. }, 1000);
  107. },
  108. onReachBottom() {
  109. }
  110. }
  111. </script>
  112. <style>
  113. .box {
  114. min-height: 100vh;
  115. background: #FFFFFF;
  116. padding-bottom: constant(safe-area-inset-bottom);
  117. padding-bottom: env(safe-area-inset-bottom);
  118. }
  119. .swiper-item{
  120. width: 750rpx;
  121. height: 500rpx;
  122. }
  123. .swiper{
  124. width: 750rpx;
  125. height: 500rpx;
  126. }
  127. .swiper-itemIMg{
  128. width: 750rpx;
  129. height: 500rpx;
  130. }
  131. .picIMg{
  132. width: 100%;
  133. }
  134. .brandBox{
  135. padding:20rpx 24px;
  136. color: #333333;
  137. border-bottom: 1rpx solid #eeeeee;
  138. font-size: 28rpx;
  139. }
  140. .line{
  141. padding:20rpx 24px;
  142. color: #333333;
  143. border-bottom: 1rpx solid #eeeeee;
  144. font-size: 26rpx;
  145. display: flex;
  146. justify-content: space-between;
  147. }
  148. .brandBox{
  149. display: flex;
  150. justify-content: space-between;
  151. }
  152. .lineLeft{
  153. width: 200rpx;
  154. }
  155. .switch{
  156. color: #3F90F7;
  157. padding-left: 20rpx;
  158. }
  159. .lineRight{
  160. width: 500rpx;
  161. }
  162. </style>