paint.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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" v-if="item2.open==true">
  37. <view class="type" :class="{orangeLine:item2.type==1}" @click="select(item2,'1')">
  38. <view class="typeName" :class="{orangeColor:item2.type==1}">喷漆</view>
  39. <view class="money"><span class="renminbi">¥</span>{{item2.PSalePrice?item2.PSalePrice:'0'}}</view>
  40. </view>
  41. <view class="type marginLeft" :class="{orangeLine:item2.type==2}" @click="select(item2,'2')">
  42. <view class="typeName" :class="{orangeColor:item2.type==2}">钣金喷漆</view>
  43. <view class="money"><span class="renminbi">¥</span>{{item2.BPSalePrice?item2.BPSalePrice:'0'}}</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. select(item,type){
  69. console.log('type'+type);
  70. item.type = type
  71. },
  72. changeState(item) {
  73. item.open = !item.open
  74. },
  75. leftClick(item, index) {
  76. this.leftIndex = index
  77. },
  78. getData() {
  79. uni.showLoading({
  80. title: '加载中'
  81. });
  82. this.$http('openSheetMetalSprayPaint/queryPackageList', {
  83. // id: this.id,
  84. }, 'GET').then(res => {
  85. uni.hideLoading();
  86. let List = res.data;
  87. for (var i = 0; i < List.length; i++) {
  88. List[i].list.forEach((item, index) => {
  89. for (const key in item) {
  90. item['open'] = false
  91. }
  92. })
  93. }
  94. this.itemList = List;
  95. console.log('列表=',this.itemList);
  96. })
  97. },
  98. }
  99. }
  100. </script>
  101. <style>
  102. .box {
  103. min-height: 100vh;
  104. background-color: #f4f5f7;
  105. }
  106. .top {
  107. background-color: #FFFFFF;
  108. padding: 30rpx 20rpx;
  109. display: flex;
  110. justify-content: space-between;
  111. align-items: center;
  112. }
  113. .left {
  114. display: flex;
  115. align-items: center;
  116. }
  117. .car {
  118. font-size: 28rpx;
  119. color: #333333;
  120. line-height: 40rpx;
  121. margin-left: 10rpx;
  122. /* 隐藏文字显示 ...不换行 */
  123. overflow: hidden;
  124. text-overflow: ellipsis;
  125. white-space: nowrap;
  126. }
  127. .brandLogo {
  128. width: 42rpx;
  129. height: 42rpx;
  130. }
  131. .main {
  132. display: flex;
  133. height: calc(100vh - 310rpx);
  134. }
  135. .mainLeft {
  136. width: 154rpx;
  137. background: #F4F5F7;
  138. }
  139. .mainLeftLine {
  140. color: #3C3C3C;
  141. padding: 30rpx 20rpx;
  142. font-size: 26rpx;
  143. text-align: center;
  144. position: relative;
  145. }
  146. .leftTitle {
  147. color: #333333;
  148. font-weight: bold;
  149. font-size: 26rpx;
  150. }
  151. .lineNum {
  152. position: absolute;
  153. background: #FF270A;
  154. width: 40rpx;
  155. height: 26rpx;
  156. text-align: center;
  157. line-height: 26rpx;
  158. font-size: 20rpx;
  159. color: #FFFFFF;
  160. border-radius: 13rpx;
  161. top: 10rpx;
  162. right: 10rpx;
  163. }
  164. .lineLeftActive {
  165. background: #FFFFFF;
  166. }
  167. .mainRight {
  168. width: 596rpx;
  169. background-color: #FFFFFF;
  170. }
  171. .rightTop {
  172. padding: 13rpx 24rpx;
  173. background-color: #F9F9F9;
  174. font-size: 26rpx;
  175. color: #959595;
  176. line-height: 37rpx;
  177. }
  178. .mainRightLine {
  179. padding: 30rpx 24rpx;
  180. background-color: #FFFFFF;
  181. }
  182. .itemTop {
  183. display: flex;
  184. justify-content: space-between;
  185. align-items: center;
  186. }
  187. .itemName {
  188. font-size: 28rpx;
  189. font-weight: bold;
  190. color: #333333;
  191. }
  192. .rightState {
  193. font-size: 24rpx;
  194. color: #6666666;
  195. }
  196. .itemBox {
  197. display: flex;
  198. justify-content: space-around;
  199. border-bottom: 1rpx solid #EEEEEE;
  200. padding: 30rpx 0;
  201. }
  202. .type {
  203. border-radius: 10rpx;
  204. border: 2rpx solid #CCCCCC;
  205. width: 50%;
  206. text-align: center;
  207. }
  208. .marginLeft{
  209. margin-left: 20rpx;
  210. }
  211. .typeName{
  212. height: 57rpx;
  213. color: #666666;
  214. font-size: 26rpx;
  215. line-height: 57rpx;
  216. border-bottom: 2rpx solid #EEEEEE;
  217. }
  218. .orangeLine{
  219. border: 2rpx solid #FF0000;
  220. }
  221. .orangeColor{
  222. color: #FF0000;
  223. }
  224. .renminbi{
  225. font-size: 22rpx;
  226. }
  227. .money{
  228. height: 76rpx;
  229. line-height: 76rpx;
  230. font-size: 32rpx;
  231. color: #FF0000;
  232. }
  233. </style>