modelThree.vue 7.0 KB

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