modelThree.vue 5.3 KB

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