modelThree.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. }
  60. },
  61. onLoad(opt) {
  62. // console.log('opt++',opt);
  63. this.vin = opt.vin;
  64. this.epc_id = opt.epc_id;
  65. this.token = opt.token;
  66. this.param = opt.param;
  67. this.access_time = opt.access_time;
  68. this.oemSearch = opt.oemSearch;
  69. if (this.oemSearch == 'true') {
  70. //oem搜索过来的,没有分组概念
  71. this.getPeijianData();
  72. } else{
  73. // this.getGroupData();
  74. }
  75. },
  76. methods: {
  77. upGroup() {
  78. this.tabIndex -= 1;
  79. if (this.tabIndex <= 0) {
  80. this.tabIndex = 1
  81. }
  82. this.son_param = this.groupData[this.tabIndex-1].param;
  83. this.son_token = this.groupData[this.tabIndex-1].token;
  84. this.getItemData();
  85. },
  86. downGroup(){
  87. this.tabIndex += 1;
  88. if (this.tabIndex >= this.groupData.length) {
  89. this.tabIndex = this.groupData.length
  90. }
  91. this.son_param = this.groupData[this.tabIndex-1].param;
  92. this.son_token = this.groupData[this.tabIndex-1].token;
  93. this.getItemData();
  94. },
  95. /*
  96. // 车型子组列表
  97. getGroupData() {
  98. var that = this
  99. uni.showLoading({
  100. title: '加载中'
  101. });
  102. this.$http('/advancedEpc/getSubgroupPc', {
  103. vin: this.vin,
  104. epc_id: this.epc_id,
  105. token: this.token,
  106. param: this.param,
  107. access_time: this.access_time,
  108. }, 'GET').then(res => {
  109. uni.hideLoading();
  110. this.groupData = res.data.result.list;
  111. this.son_epc_id = res.data.result.epc_id;
  112. this.son_access_time = res.data.result.access_time;
  113. that.groupData.forEach((item, index) => {
  114. if (item.group_no.includes(that.group_no)) {
  115. console.log('有index',index);
  116. }
  117. })
  118. this.son_param = this.groupData[0].param;
  119. this.son_token = this.groupData[0].token;
  120. that.getItemData();
  121. });
  122. },
  123. */
  124. // 子组配件列表
  125. getItemData() {
  126. uni.showLoading({
  127. title: '加载中'
  128. });
  129. this.$http('/advancedEpc/getPartsPc', {
  130. vin: this.son_vin,
  131. epc_id: this.son_epc_id,
  132. token: this.son_token,
  133. param: this.son_param,
  134. access_time: this.son_access_time,
  135. }, 'GET').then(res => {
  136. uni.hideLoading();
  137. this.itemList = res.data.result.list.rows;
  138. this.imgUrl = res.data.result.list.image_info[0].pic_url;
  139. console.log('itemList++',this.itemList);
  140. });
  141. },
  142. // oem子组配件列表
  143. getPeijianData() {
  144. uni.showLoading({
  145. title: '加载中'
  146. });
  147. this.$http('/advancedEpc/getPartsPc', {
  148. vin: this.vin,
  149. epc_id: this.epc_id,
  150. token: this.token,
  151. param: this.param,
  152. access_time: this.access_time,
  153. }, 'GET').then(res => {
  154. uni.hideLoading();
  155. this.itemList = res.data.result.list.rows;
  156. this.imgUrl = res.data.result.list.image_info[0].pic_url;
  157. console.log('itemList++',this.itemList);
  158. });
  159. },
  160. goOemDetail(item) {
  161. uni.navigateTo({
  162. url: 'OemDetail?epc_id=' + this.epc_id + '&partsnum=' + item.partnum+ '&weizhi=' + item.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. }
  186. </script>
  187. <style scoped>
  188. .topIMg {
  189. width: 100%;
  190. display: block;
  191. }
  192. .top {
  193. position: relative;
  194. }
  195. .enlarge {
  196. position: absolute;
  197. width: 44rpx;
  198. height: 44rpx;
  199. right: 30rpx;
  200. bottom: 34rpx;
  201. }
  202. .mainBox {
  203. width: 100vw;
  204. }
  205. .mainTop {
  206. padding: 28rpx 25rpx;
  207. display: flex;
  208. justify-content: space-between;
  209. border-bottom: 1rpx solid #EEEEEE;
  210. }
  211. .arrowBox {
  212. display: flex;
  213. align-items: center;
  214. }
  215. .arrow {
  216. width: 25rpx;
  217. height: 24rpx;
  218. }
  219. .title {
  220. font-size: 24rpx;
  221. color: #3F90F7;
  222. }
  223. .page {
  224. font-size: 28rpx;
  225. color: #333333;
  226. }
  227. .commentBox {
  228. padding: 20rpx 24rpx;
  229. border-bottom: 1rpx solid #EEEEEE;
  230. }
  231. .line {
  232. display: flex;
  233. align-items: center;
  234. }
  235. .wei {
  236. color: #F19D01;
  237. font-size: 22rpx;
  238. background: #FDF7EB;
  239. border-radius: 4px;
  240. padding: 0 8rpx;
  241. }
  242. .yong {
  243. color: #666666;
  244. font-size: 22rpx;
  245. margin-left: 10rpx;
  246. }
  247. .name {
  248. color: #333333;
  249. font-size: 26rpx;
  250. font-weight: bold;
  251. padding-top: 16rpx;
  252. padding-bottom: 10rpx;
  253. }
  254. .comment {
  255. color: #999999;
  256. font-size: 24rpx;
  257. padding-bottom: 14rpx;
  258. }
  259. .forLine {
  260. display: flex;
  261. justify-content: space-between;
  262. align-items: center;
  263. }
  264. .code {
  265. color: #3F90F7;
  266. font-size: 24rpx;
  267. }
  268. .price {
  269. color: #999999;
  270. font-size: 24rpx;
  271. }
  272. .orangePrice {
  273. color: #FF4F00;
  274. font-weight: bold;
  275. }
  276. </style>