modelThree.vue 5.7 KB

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