paint.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="box">
  3. <view class="top">
  4. <view class="left">
  5. <image :src="carInfo.brandLogo" mode="widthFix" class="brandLogo" v-if="carInfo.brandLogo">
  6. <img src="../../static/timg/nocar.png" alt="" class="brandLogo" v-else>
  7. <view class="car" v-if="carInfo.carModel">{{carInfo.carModel}}</view>
  8. <view class="car" v-else>暂无</view>
  9. </image>
  10. </view>
  11. <image src="../../static/img/big_rightArrow.png" mode="" style="width: 30rpx;height: 30rpx;"></image>
  12. </view>
  13. <view class="main" v-if="itemList">
  14. <view class="mainLeft">
  15. <view class="mainLeftLine" v-for="(item,index) in itemList" :class="{lineLeftActive:leftIndex==index}"
  16. @click="leftClick(item,index)">
  17. <span class="leftTitle">{{item.name}}</span>
  18. <view class="lineNum" v-show="item.num!=0">{{item.num}}</view>
  19. </view>
  20. </view>
  21. <view class="mainRight">
  22. <view class="rightTop">{{itemList[leftIndex].name}}</view>
  23. <view class="mainRightLine" v-for="(item2,index) in itemList[leftIndex].list" :key="index">
  24. <view class="itemTop">
  25. <view class="itemName">{{item2.ItemName}}</view>
  26. <span class="rightState" v-if="item2.open==false" @click="changeState(item2)">展开<image
  27. src="../../static/img/icon_arrow_down.png" mode=""
  28. style="width: 20rpx;height: 11rpx; padding: 5rpx 8rpx;"></image>
  29. </span>
  30. <span class="rightState" v-else @click="changeState(item2)">收起<image
  31. src="../../static/img/icon_arrow_up.png" mode=""
  32. style="width: 20rpx;height: 11rpx; padding: 5rpx 8rpx;"></image>
  33. </span>
  34. </view>
  35. <!-- -->
  36. <view class="itemBox">
  37. <view class="type">
  38. <view class="typeName">喷漆</view>
  39. <view class=""><span class="renminbi">¥</span>{{item2.PSalePrice}}</view>
  40. </view>
  41. <view class="type">
  42. <view class="typeName">钣金喷漆</view>
  43. <view class=""><span class="renminbi">¥</span>{{item2.BPSalePrice}}</view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. carInfo: '',
  56. itemList: [],
  57. leftIndex: 0,
  58. }
  59. },
  60. onShow() {
  61. this.carInfo = this.$store.state.carInfo
  62. },
  63. onLoad() {
  64. this.getData();
  65. },
  66. methods: {
  67. changeState(item) {
  68. item.open = !item.open
  69. },
  70. leftClick(item, index) {
  71. this.leftIndex = index
  72. },
  73. getData() {
  74. uni.showLoading({
  75. title: '加载中'
  76. });
  77. this.$http('openSheetMetalSprayPaint/queryPackageList', {
  78. // id: this.id,
  79. }, 'GET').then(res => {
  80. uni.hideLoading();
  81. this.itemList = res.data;
  82. })
  83. },
  84. }
  85. }
  86. </script>
  87. <style>
  88. .box {
  89. min-height: 100vh;
  90. background-color: #f4f5f7;
  91. }
  92. .top {
  93. background-color: #FFFFFF;
  94. padding: 30rpx 20rpx;
  95. display: flex;
  96. justify-content: space-between;
  97. align-items: center;
  98. }
  99. .left {
  100. display: flex;
  101. align-items: center;
  102. }
  103. .car {
  104. font-size: 28rpx;
  105. color: #333333;
  106. line-height: 40rpx;
  107. margin-left: 10rpx;
  108. /* 隐藏文字显示 ...不换行 */
  109. overflow: hidden;
  110. text-overflow: ellipsis;
  111. white-space: nowrap;
  112. }
  113. .brandLogo {
  114. width: 42rpx;
  115. height: 42rpx;
  116. }
  117. .main {
  118. display: flex;
  119. height: calc(100vh - 310rpx);
  120. }
  121. .mainLeft {
  122. width: 154rpx;
  123. background: #F4F5F7;
  124. }
  125. .mainLeftLine {
  126. color: #3C3C3C;
  127. padding: 30rpx 20rpx;
  128. font-size: 26rpx;
  129. text-align: center;
  130. position: relative;
  131. }
  132. .leftTitle {
  133. color: #333333;
  134. font-weight: bold;
  135. font-size: 26rpx;
  136. }
  137. .lineNum {
  138. position: absolute;
  139. background: #FF270A;
  140. width: 40rpx;
  141. height: 26rpx;
  142. text-align: center;
  143. line-height: 26rpx;
  144. font-size: 20rpx;
  145. color: #FFFFFF;
  146. border-radius: 13rpx;
  147. top: 10rpx;
  148. right: 10rpx;
  149. }
  150. .lineLeftActive {
  151. background: #FFFFFF;
  152. }
  153. .mainRight {
  154. width: 596rpx;
  155. background-color: #FFFFFF;
  156. }
  157. .rightTop {
  158. padding: 13rpx 24rpx;
  159. background-color: #F9F9F9;
  160. font-size: 26rpx;
  161. color: #959595;
  162. line-height: 37rpx;
  163. }
  164. .mainRightLine {
  165. padding: 30rpx 24rpx;
  166. background-color: #FFFFFF;
  167. }
  168. .itemTop {
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. }
  173. .itemName {
  174. font-size: 28rpx;
  175. font-weight: bold;
  176. color: #333333;
  177. }
  178. .rightState {
  179. font-size: 24rpx;
  180. color: #6666666;
  181. }
  182. .itemBox {
  183. display: flex;
  184. border-bottom: 1rpx solid #EEEEEE;
  185. padding: 30rpx 0;
  186. }
  187. .type {
  188. border-radius: 10rpx;
  189. border: 2rpx solid #CCCCCC;
  190. margin-right: 20rpx;
  191. width: 50%;
  192. text-align: center;
  193. }
  194. </style>