paint.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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 marginLeft">
  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. console.log("车=",this.carInfo);
  63. },
  64. onLoad() {
  65. this.getData();
  66. },
  67. methods: {
  68. changeState(item) {
  69. item.open = !item.open
  70. },
  71. leftClick(item, index) {
  72. this.leftIndex = index
  73. },
  74. getData() {
  75. uni.showLoading({
  76. title: '加载中'
  77. });
  78. this.$http('openSheetMetalSprayPaint/queryPackageList', {
  79. // id: this.id,
  80. }, 'GET').then(res => {
  81. uni.hideLoading();
  82. this.itemList = res.data;
  83. })
  84. },
  85. }
  86. }
  87. </script>
  88. <style>
  89. .box {
  90. min-height: 100vh;
  91. background-color: #f4f5f7;
  92. }
  93. .top {
  94. background-color: #FFFFFF;
  95. padding: 30rpx 20rpx;
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. }
  100. .left {
  101. display: flex;
  102. align-items: center;
  103. }
  104. .car {
  105. font-size: 28rpx;
  106. color: #333333;
  107. line-height: 40rpx;
  108. margin-left: 10rpx;
  109. /* 隐藏文字显示 ...不换行 */
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. white-space: nowrap;
  113. }
  114. .brandLogo {
  115. width: 42rpx;
  116. height: 42rpx;
  117. }
  118. .main {
  119. display: flex;
  120. height: calc(100vh - 310rpx);
  121. }
  122. .mainLeft {
  123. width: 154rpx;
  124. background: #F4F5F7;
  125. }
  126. .mainLeftLine {
  127. color: #3C3C3C;
  128. padding: 30rpx 20rpx;
  129. font-size: 26rpx;
  130. text-align: center;
  131. position: relative;
  132. }
  133. .leftTitle {
  134. color: #333333;
  135. font-weight: bold;
  136. font-size: 26rpx;
  137. }
  138. .lineNum {
  139. position: absolute;
  140. background: #FF270A;
  141. width: 40rpx;
  142. height: 26rpx;
  143. text-align: center;
  144. line-height: 26rpx;
  145. font-size: 20rpx;
  146. color: #FFFFFF;
  147. border-radius: 13rpx;
  148. top: 10rpx;
  149. right: 10rpx;
  150. }
  151. .lineLeftActive {
  152. background: #FFFFFF;
  153. }
  154. .mainRight {
  155. width: 596rpx;
  156. background-color: #FFFFFF;
  157. }
  158. .rightTop {
  159. padding: 13rpx 24rpx;
  160. background-color: #F9F9F9;
  161. font-size: 26rpx;
  162. color: #959595;
  163. line-height: 37rpx;
  164. }
  165. .mainRightLine {
  166. padding: 30rpx 24rpx;
  167. background-color: #FFFFFF;
  168. }
  169. .itemTop {
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. }
  174. .itemName {
  175. font-size: 28rpx;
  176. font-weight: bold;
  177. color: #333333;
  178. }
  179. .rightState {
  180. font-size: 24rpx;
  181. color: #6666666;
  182. }
  183. .itemBox {
  184. display: flex;
  185. justify-content: space-around;
  186. border-bottom: 1rpx solid #EEEEEE;
  187. padding: 30rpx 0;
  188. }
  189. .type {
  190. border-radius: 10rpx;
  191. border: 2rpx solid #CCCCCC;
  192. width: 50%;
  193. text-align: center;
  194. }
  195. .marginLeft{
  196. margin-left: 20rpx;
  197. }
  198. .typeName{
  199. height: 57rpx;
  200. color: #666666;
  201. font-size: 26rpx;
  202. line-height: 57rpx;
  203. border-bottom: 2rpx solid #EEEEEE;
  204. }
  205. </style>