OEDetail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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" :value="pkvalue" class="picker-view" :range="epc_info" :range-key="'brand'">
  20. <view class="brandBox">
  21. <span>共{{oedata.epc_info.length}}个品牌,已选品牌:{{brandName}}</span>
  22. <view class="switch" @click="switchBrand" >切换</view><!-- v-if="oedata.epc_info.length>1" -->
  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">4S店价:</view>
  40. <view class="lineRight">¥{{oedata.price}}</view>
  41. </view>
  42. <view class="line">
  43. <view class="lineLeft">备注</view>
  44. <view class="lineRight">{{oedata.remark}}</view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. components: {
  51. },
  52. data() {
  53. return {
  54. partsnum:'',
  55. indicatorDots: true,
  56. autoplay: true,
  57. interval: 5000,
  58. duration: 500,
  59. oedata:"",
  60. index:0,
  61. brand_id:'',
  62. epc_id:'',
  63. brandShow:false,
  64. pkvalue:0,
  65. brandName:'',
  66. epc_info:'',
  67. }
  68. },
  69. onLoad(opt) {
  70. console.log('opt+', opt);
  71. this.partsnum = opt.partnum;
  72. this.find()
  73. },
  74. methods: {
  75. switchBrand(){
  76. this.brandShow=true;
  77. },
  78. bindChange(e){
  79. console.log(e)
  80. this.brandName=this.epc_info[e.detail.value].brand
  81. this.epc_id=this.oedata.epc_info[e.detail.value].epc_id;
  82. this.brand_id=this.oedata.epc_info[e.detail.value].brand_id;
  83. this.find2()
  84. },
  85. // 配件查询
  86. find() {
  87. uni.showLoading({
  88. title: '加载中'
  89. });
  90. this.$http('advancedEpc/parts/detail', {
  91. partsnum: this.partsnum,
  92. brand_id:this.brand_id,
  93. epc_id:this.epc_id
  94. }, 'GET').then(res => {
  95. uni.hideLoading();
  96. if (res.data.number == 200 || res.data.number == 5212) {
  97. this.oedata=res.data.result
  98. this.brandName=res.data.result.brand;
  99. this.epc_info=res.data.result.epc_info;
  100. } else {
  101. uni.showToast({
  102. title: res.data.message,
  103. icon: 'none',
  104. duration: 3000
  105. });
  106. }
  107. });
  108. },
  109. find2() {
  110. uni.showLoading({
  111. title: '加载中'
  112. });
  113. this.$http('advancedEpc/parts/detail', {
  114. partsnum: this.partsnum,
  115. brand_id:this.brand_id,
  116. epc_id:this.epc_id
  117. }, 'GET').then(res => {
  118. uni.hideLoading();
  119. if (res.data.number == 200 || res.data.number == 5212) {
  120. this.oedata=res.data.result
  121. } else {
  122. uni.showToast({
  123. title: res.data.message,
  124. icon: 'none',
  125. duration: 3000
  126. });
  127. }
  128. });
  129. },
  130. },
  131. // 下拉刷新 上拉加载更多
  132. onPullDownRefresh() {
  133. // this.page = 1
  134. // this.getItemData()
  135. setTimeout(function() {
  136. uni.stopPullDownRefresh();
  137. }, 1000);
  138. },
  139. onReachBottom() {
  140. }
  141. }
  142. </script>
  143. <style>
  144. .box {
  145. min-height: 100vh;
  146. background: #FFFFFF;
  147. padding-bottom: constant(safe-area-inset-bottom);
  148. padding-bottom: env(safe-area-inset-bottom);
  149. }
  150. .swiper-item{
  151. width: 750rpx;
  152. height: 500rpx;
  153. }
  154. .swiper{
  155. width: 750rpx;
  156. height: 500rpx;
  157. }
  158. .swiper-itemIMg{
  159. width: 750rpx;
  160. height: 500rpx;
  161. }
  162. .picIMg{
  163. width: 100%;
  164. }
  165. .brandBox{
  166. padding:20rpx 24px;
  167. color: #333333;
  168. border-bottom: 1rpx solid #eeeeee;
  169. font-size: 28rpx;
  170. }
  171. .line{
  172. padding:20rpx 24px;
  173. color: #333333;
  174. border-bottom: 1rpx solid #eeeeee;
  175. font-size: 26rpx;
  176. display: flex;
  177. justify-content: space-between;
  178. }
  179. .brandBox{
  180. display: flex;
  181. justify-content: space-between;
  182. }
  183. .lineLeft{
  184. width: 200rpx;
  185. }
  186. .switch{
  187. color: #3F90F7;
  188. padding-left: 20rpx;
  189. }
  190. .lineRight{
  191. width: 500rpx;
  192. }
  193. </style>