123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <template>
- <view class="box">
-
- <!-- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
- :duration="duration">
- <swiper-item v-for="(item,index) in oedata.image.epc">
- <view class="swiper-item ">
- <image class="swiper-itemIMg" :src="item.pic" mode="aspectFit"></image>
- </view>
- </swiper-item>
-
- </swiper> -->
- <view class="TOP">
- <image :src="oedata.image.epc.pic" mode="" class="picIMg"></image>
- </view>
- <!-- <view class="brandBox">
- <span>共{{oedata.epc_info.length}}个品牌,已选品牌:{{oedata.brand}}</span>
- <view class="switch" @click="switchBrand">切换</view>
- </view> -->
- <view >
- <picker @change="bindChange" :value="pkvalue" class="picker-view" :range="epc_info" :range-key="'brand'">
- <view class="brandBox">
- <span>共{{oedata.epc_info.length}}个品牌,已选品牌:{{brandName}}</span>
- <view class="switch" @click="switchBrand" >切换</view><!-- v-if="oedata.epc_info.length>1" -->
- </view>
- </picker>
-
- </view>
- <view class="line">
- <view class="lineLeft">结构位置</view>
- <view class="lineRight">{{oedata.image.epc.refernum}}</view>
- </view>
- <view class="line">
- <view class="lineLeft">配件OE</view>
- <view class="lineRight">{{partsnum}}</view>
- </view>
- <view class="line">
- <view class="lineLeft">配件名称</view>
- <view class="lineRight">{{oedata.caption}}</view>
- </view>
- <view class="line">
- <view class="lineLeft">4S店价:</view>
- <view class="lineRight">¥{{oedata.price}}</view>
- </view>
- <view class="line">
- <view class="lineLeft">备注</view>
- <view class="lineRight">{{oedata.remark}}</view>
- </view>
-
- </view>
- </template>
- <script>
- export default {
- components: {
- },
- data() {
- return {
- partsnum:'',
- indicatorDots: true,
- autoplay: true,
- interval: 5000,
- duration: 500,
- oedata:"",
- index:0,
- brand_id:'',
- epc_id:'',
- brandShow:false,
- pkvalue:0,
- brandName:'',
- epc_info:'',
- }
- },
- onLoad(opt) {
- console.log('opt+', opt);
- this.partsnum = opt.partnum;
- this.find()
- },
- methods: {
- switchBrand(){
- this.brandShow=true;
- },
- bindChange(e){
- console.log(e)
- this.brandName=this.epc_info[e.detail.value].brand
- this.epc_id=this.oedata.epc_info[e.detail.value].epc_id;
- this.brand_id=this.oedata.epc_info[e.detail.value].brand_id;
- this.find2()
- },
-
- // 配件查询
- find() {
- uni.showLoading({
- title: '加载中'
- });
- this.$http('advancedEpc/parts/detail', {
- partsnum: this.partsnum,
- brand_id:this.brand_id,
- epc_id:this.epc_id
- }, 'GET').then(res => {
- uni.hideLoading();
- if (res.data.number == 200 || res.data.number == 5212) {
- this.oedata=res.data.result
- this.brandName=res.data.result.brand;
- this.epc_info=res.data.result.epc_info;
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 3000
- });
- }
-
- });
- },
- find2() {
- uni.showLoading({
- title: '加载中'
- });
- this.$http('advancedEpc/parts/detail', {
- partsnum: this.partsnum,
- brand_id:this.brand_id,
- epc_id:this.epc_id
- }, 'GET').then(res => {
- uni.hideLoading();
- if (res.data.number == 200 || res.data.number == 5212) {
- this.oedata=res.data.result
-
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 3000
- });
- }
-
-
-
- });
- },
- },
- // 下拉刷新 上拉加载更多
- onPullDownRefresh() {
- // this.page = 1
- // this.getItemData()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- onReachBottom() {
-
- }
- }
- </script>
- <style>
- .box {
- min-height: 100vh;
- background: #FFFFFF;
- padding-bottom: constant(safe-area-inset-bottom);
- padding-bottom: env(safe-area-inset-bottom);
- }
- .swiper-item{
- width: 750rpx;
- height: 500rpx;
- }
- .swiper{
- width: 750rpx;
- height: 500rpx;
- }
- .swiper-itemIMg{
- width: 750rpx;
- height: 500rpx;
- }
- .picIMg{
- width: 100%;
- }
- .brandBox{
- padding:20rpx 24px;
- color: #333333;
- border-bottom: 1rpx solid #eeeeee;
- font-size: 28rpx;
- }
- .line{
- padding:20rpx 24px;
- color: #333333;
- border-bottom: 1rpx solid #eeeeee;
- font-size: 26rpx;
- display: flex;
- justify-content: space-between;
- }
- .brandBox{
- display: flex;
- justify-content: space-between;
- }
- .lineLeft{
- width: 200rpx;
- }
- .switch{
- color: #3F90F7;
- padding-left: 20rpx;
- }
- .lineRight{
- width: 500rpx;
-
- }
- </style>
|