modelThree.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <!-- 轮播图 -->
  5. <swiper class="swiper" :circular="true" :indicator-dots="true" indicator-active-color="#FF4F00"
  6. v-if="bannerArr.length>0">
  7. <swiper-item v-for="(item,index) in bannerArr">
  8. <image :src="item.pic_url" mode="" class="swpImg"></image>
  9. <image @click="previewImage(item.pic_url)" src="../../static/img/icon_fangda@2x.png" mode="" class="enlarge">
  10. </image>
  11. </swiper-item>
  12. </swiper>
  13. <image v-if="loading" class="swiper" src="../../static/img/barner_noimg.png" mode=""></image>
  14. </view>
  15. <view style="height: 20rpx;background: #F4F5F7;"></view>
  16. <view class="mainBox">
  17. <view class="commentBox" v-for="(item,index) in itemList" :key="index" v-if="item.disabled==0">
  18. <view class="line">
  19. <view class="wei">位置{{item.refernum}}</view>
  20. <view class="yong">用量{{item.qty}}</view>
  21. </view>
  22. <view class="name" v-html="item.description"></view>
  23. <view class="comment">{{item.remark}}</view>
  24. <view class="forLine">
  25. <view @click="goOemDetail(item)" class="code">{{item.extened.join()}}</view>
  26. <view class="price">4S店价:
  27. <span class="orangePrice">¥ {{item.price}}</span>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. title: 'Hello',
  39. vin: '',
  40. epc_id: '',
  41. token: '',
  42. param: '',
  43. access_time: '',
  44. groupData: [],
  45. itemList: [],
  46. bannerArr: [],
  47. tabIndex: 1,
  48. son_vin: '',
  49. son_epc_id: '',
  50. son_token: '',
  51. son_param: '',
  52. son_access_time: '',
  53. page: 1,
  54. total_page: 1,
  55. loading:false,
  56. }
  57. },
  58. onLoad(opt) {
  59. // console.log('opt++',opt);
  60. this.vin = opt.vin;
  61. this.epc_id = opt.epc_id;
  62. this.token = opt.token;
  63. this.param = opt.param;
  64. this.access_time = opt.access_time;
  65. //oem搜索过来的,没有分组概念
  66. this.getPeijianData();
  67. },
  68. methods: {
  69. // oem子组配件列表
  70. getPeijianData() {
  71. uni.showLoading({
  72. title: '加载中'
  73. });
  74. this.$http('/advancedEpc/getParts', {
  75. vin: this.vin,
  76. epc_id: this.epc_id,
  77. token: this.token,
  78. param: this.param,
  79. access_time: this.access_time,
  80. page: this.page,
  81. }, 'GET').then(res => {
  82. uni.hideLoading();
  83. this.bannerArr = res.data.result.list.image_info;
  84. this.total_page = res.data.result.total_page;
  85. var list = res.data.result.list.rows;
  86. if (list.length != 0) {
  87. this.itemList = this.itemList.concat(list)
  88. }
  89. console.log('itemList++', this.itemList);
  90. if (this.bannerArr.length == 0) {
  91. this.loading = true;
  92. }
  93. });
  94. },
  95. goOemDetail(item) {
  96. uni.navigateTo({
  97. url: 'OemDetail?epc_id=' + this.epc_id + '&partsnum=' + item.partnum + '&weizhi=' + item
  98. .refernum + '&yongliang=' + item.qty
  99. })
  100. },
  101. previewImage(imgUrl) {
  102. var arr = [];
  103. var img = imgUrl
  104. arr.push(img)
  105. // 预览图片
  106. uni.previewImage({
  107. urls: arr,
  108. current: img,
  109. longPressActions: {
  110. itemList: ['发送给朋友', '保存图片', '收藏'],
  111. success: function(data) {
  112. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  113. },
  114. fail: function(err) {
  115. console.log(err.errMsg);
  116. }
  117. }
  118. });
  119. }
  120. },
  121. // 下拉刷新 上拉加载更多
  122. onPullDownRefresh() {
  123. // this.page = 1
  124. // this.getItemData()
  125. setTimeout(function() {
  126. uni.stopPullDownRefresh();
  127. }, 1000);
  128. },
  129. onReachBottom() {
  130. if (this.page <= this.total_page) {
  131. this.page++;
  132. this.getPeijianData()
  133. }
  134. }
  135. }
  136. </script>
  137. <style scoped>
  138. .content{
  139. padding-bottom: constant(safe-area-inset-bottom);
  140. padding-bottom: env(safe-area-inset-bottom);
  141. }
  142. .quanImg {
  143. width: 100vw;
  144. height: 352rpx;
  145. }
  146. .swiper,
  147. .swiper-item,
  148. .swpImg {
  149. width: 100%;
  150. height: 352rpx;
  151. }
  152. .top {
  153. position: relative;
  154. }
  155. .enlarge {
  156. position: absolute;
  157. width: 44rpx;
  158. height: 44rpx;
  159. right: 30rpx;
  160. bottom: 34rpx;
  161. }
  162. .mainBox {
  163. width: 100vw;
  164. }
  165. .mainTop {
  166. padding: 28rpx 25rpx;
  167. display: flex;
  168. justify-content: space-between;
  169. border-bottom: 1rpx solid #EEEEEE;
  170. }
  171. .arrowBox {
  172. display: flex;
  173. align-items: center;
  174. }
  175. .arrow {
  176. width: 25rpx;
  177. height: 24rpx;
  178. }
  179. .title {
  180. font-size: 24rpx;
  181. color: #3F90F7;
  182. }
  183. .page {
  184. font-size: 28rpx;
  185. color: #333333;
  186. }
  187. .commentBox {
  188. padding: 20rpx 24rpx;
  189. border-bottom: 1rpx solid #EEEEEE;
  190. }
  191. .line {
  192. display: flex;
  193. align-items: center;
  194. }
  195. .wei {
  196. color: #F19D01;
  197. font-size: 22rpx;
  198. background: #FDF7EB;
  199. border-radius: 4px;
  200. padding: 0 8rpx;
  201. }
  202. .yong {
  203. color: #666666;
  204. font-size: 22rpx;
  205. margin-left: 10rpx;
  206. }
  207. .name {
  208. color: #333333;
  209. font-size: 26rpx;
  210. font-weight: bold;
  211. padding-top: 16rpx;
  212. padding-bottom: 10rpx;
  213. }
  214. .comment {
  215. color: #999999;
  216. font-size: 24rpx;
  217. padding-bottom: 14rpx;
  218. }
  219. .forLine {
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. }
  224. .code {
  225. color: #3F90F7;
  226. font-size: 24rpx;
  227. }
  228. .price {
  229. color: #999999;
  230. font-size: 24rpx;
  231. }
  232. .orangePrice {
  233. color: #FF4F00;
  234. font-weight: bold;
  235. }
  236. </style>