vinDetail.vue 6.5 KB

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