modelThree.vue 5.9 KB

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