modelThree.vue 5.2 KB

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