123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <template>
- <view class="content">
- <view class="top">
- <!-- 轮播图 -->
- <swiper class="swiper" :circular="true" :indicator-dots="true" indicator-active-color="#FF4F00"
- v-if="bannerArr.length>0">
- <swiper-item v-for="(item,index) in bannerArr">
-
- <image :src="item.pic_url" mode="" class="swpImg"></image>
-
- <image @click="previewImage(item.pic_url)" src="../../static/img/icon_fangda@2x.png" mode="" class="enlarge">
- </image>
-
- </swiper-item>
-
- </swiper>
- <image v-if="loading" class="swiper" src="../../static/img/barner_noimg.png" mode=""></image>
- </view>
- <view style="height: 20rpx;background: #F4F5F7;"></view>
- <view class="mainBox">
-
- <view class="commentBox" v-for="(item,index) in itemList" :key="index" v-if="item.disabled==0">
- <view class="line">
- <view class="wei">位置{{item.refernum}}</view>
- <view class="yong">用量{{item.qty}}</view>
- </view>
- <view class="name" v-html="item.description"></view>
- <view class="comment">{{item.remark}}</view>
- <view class="forLine">
- <view @click="goOemDetail(item)" class="code">{{item.extened.join()}}</view>
- <view class="price">4S店价:
- <span class="orangePrice">¥ {{item.price}}</span>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- title: 'Hello',
- vin: '',
- epc_id: '',
- token: '',
- param: '',
- access_time: '',
-
- groupData: [],
- itemList: [],
- bannerArr: [],
- tabIndex: 1,
- son_vin: '',
- son_epc_id: '',
- son_token: '',
- son_param: '',
- son_access_time: '',
- page: 1,
- total_page: 1,
- loading:false,
- }
- },
- onLoad(opt) {
- // console.log('opt++',opt);
- this.vin = opt.vin;
- this.epc_id = opt.epc_id;
- this.token = opt.token;
- this.param = opt.param;
- this.access_time = opt.access_time;
-
-
- //oem搜索过来的,没有分组概念
- this.getPeijianData();
-
- },
- methods: {
-
-
-
- // oem子组配件列表
- getPeijianData() {
- uni.showLoading({
- title: '加载中'
- });
- this.$http('/advancedEpc/getParts', {
- vin: this.vin,
- epc_id: this.epc_id,
- token: this.token,
- param: this.param,
- access_time: this.access_time,
- page: this.page,
- }, 'GET').then(res => {
- uni.hideLoading();
- this.bannerArr = res.data.result.list.image_info;
- this.total_page = res.data.result.total_page;
- var list = res.data.result.list.rows;
- if (list.length != 0) {
- this.itemList = this.itemList.concat(list)
- }
- console.log('itemList++', this.itemList);
-
- if (this.bannerArr.length == 0) {
- this.loading = true;
- }
- });
- },
- goOemDetail(item) {
- uni.navigateTo({
- url: 'OemDetail?epc_id=' + this.epc_id + '&partsnum=' + item.partnum + '&weizhi=' + item
- .refernum + '&yongliang=' + item.qty
- })
- },
- previewImage(imgUrl) {
- var arr = [];
- var img = imgUrl
- arr.push(img)
- // 预览图片
- uni.previewImage({
- urls: arr,
- current: img,
- longPressActions: {
- itemList: ['发送给朋友', '保存图片', '收藏'],
- success: function(data) {
- console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
- },
- fail: function(err) {
- console.log(err.errMsg);
- }
- }
- });
- }
- },
- // 下拉刷新 上拉加载更多
- onPullDownRefresh() {
- // this.page = 1
- // this.getItemData()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- onReachBottom() {
- if (this.page <= this.total_page) {
- this.page++;
- this.getPeijianData()
- }
- }
- }
- </script>
- <style scoped>
- .content{
- padding-bottom: constant(safe-area-inset-bottom);
- padding-bottom: env(safe-area-inset-bottom);
- }
- .quanImg {
-
- width: 100vw;
- height: 352rpx;
- }
-
- .swiper,
- .swiper-item,
- .swpImg {
- width: 100%;
- height: 352rpx;
-
- }
- .top {
- position: relative;
- }
- .enlarge {
- position: absolute;
- width: 44rpx;
- height: 44rpx;
- right: 30rpx;
- bottom: 34rpx;
- }
- .mainBox {
- width: 100vw;
- }
- .mainTop {
- padding: 28rpx 25rpx;
- display: flex;
- justify-content: space-between;
- border-bottom: 1rpx solid #EEEEEE;
- }
- .arrowBox {
- display: flex;
- align-items: center;
- }
- .arrow {
- width: 25rpx;
- height: 24rpx;
- }
- .title {
- font-size: 24rpx;
- color: #3F90F7;
- }
- .page {
- font-size: 28rpx;
- color: #333333;
- }
- .commentBox {
- padding: 20rpx 24rpx;
- border-bottom: 1rpx solid #EEEEEE;
- }
- .line {
- display: flex;
- align-items: center;
- }
- .wei {
- color: #F19D01;
- font-size: 22rpx;
- background: #FDF7EB;
- border-radius: 4px;
- padding: 0 8rpx;
- }
- .yong {
- color: #666666;
- font-size: 22rpx;
- margin-left: 10rpx;
- }
- .name {
- color: #333333;
- font-size: 26rpx;
- font-weight: bold;
- padding-top: 16rpx;
- padding-bottom: 10rpx;
- }
- .comment {
- color: #999999;
- font-size: 24rpx;
- padding-bottom: 14rpx;
- }
- .forLine {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .code {
- color: #3F90F7;
- font-size: 24rpx;
- }
- .price {
- color: #999999;
- font-size: 24rpx;
- }
- .orangePrice {
- color: #FF4F00;
- font-weight: bold;
- }
- </style>
|