productPricing.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="productPricing-content">
  3. <!-- <u-navbar title="产品报价" :safeAreaInsetTop="false" :border-bottom="false" @leftClick="toPage('/pages/sales/index')">
  4. <view class="u-nav-slot" slot="right" style="padding-right: 40rpx;" @click="showModal=true">
  5. <u-icon name="search" color="#999" size="28"></u-icon>查询
  6. </view>
  7. </u-navbar> -->
  8. <view class="checkbox-price">
  9. <u-checkbox-group placement="row">
  10. <u-checkbox v-model="item.checked" activeColor="rgb(4, 133, 246)" v-for="(item,index) in priceList" :key="index" :name="item.val">{{item.name}}</u-checkbox>
  11. </u-checkbox-group>
  12. </view>
  13. <scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
  14. <view class="st-detailList-main">
  15. <view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
  16. <view class="st-detailList-tit">
  17. <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{item.name}}
  18. </view>
  19. <view class="st-detailList-item-con flex align_center">
  20. <view class="pimgs">
  21. <u-image :src="item.productMainPic&&item.productMainPic.imageUrl?item.productMainPic.imageUrl:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
  22. </view>
  23. <view class="flex_1">
  24. <view>产品编码:{{item.code}}</view>
  25. <view class="padding_3">原厂编码:{{item.origCode}}</view>
  26. <view class="flex align_center justify_between">
  27. <view class="font_13">
  28. 总款数:<text>{{toThousands(item.stockQty|| 0)}} 个</text>
  29. </view>
  30. <view class="font_13">
  31. 车主价:¥<text>{{toThousands(item.carOwnersPrice|| 0,2)}} </text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="price-all flex">
  37. <view class="price-item" v-if="priceList[0].checked">
  38. <text>{{toThousands(item.offerCost|| 0,2)}} </text>
  39. <view>成本价</view>
  40. </view>
  41. <view class="price-item" v-if="priceList[1].checked">
  42. <text>{{toThousands(item.cityPrice|| 0,2)}} </text>
  43. <view>市级价</view>
  44. </view>
  45. <view class="price-item" v-if="priceList[2].checked">
  46. <text>{{toThousands(item.specialPrice|| 0,2)}} </text>
  47. <view>特约价</view>
  48. </view>
  49. <view class="price-item" v-if="priceList[3].checked">
  50. <text>{{toThousands(item.terminalPrice|| 0,2)}} </text>
  51. <view>终端会员价</view>
  52. </view>
  53. </view>
  54. </view>
  55. <u-empty v-if="listData.length == 0 &&status!='loading'" :text="noDataText" mode="list" ></u-empty>
  56. <view style="padding-bottom: 20upx;">
  57. <u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
  58. </view>
  59. </view>
  60. </scroll-view>
  61. <!-- 搜索弹窗 -->
  62. <search :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
  63. </view>
  64. </template>
  65. <script>
  66. import { toThousands } from '@/libs/tools'
  67. import { dealerProductList } from '@/api/sales'
  68. import search from './search.vue'
  69. export default{
  70. components:{search},
  71. data(){
  72. return{
  73. toThousands,
  74. listData:[],
  75. totalNum:0,
  76. priceList:[
  77. { name: '成本价', checked: false, val: 'offerCost' },
  78. { name: '市级价', checked: false, val: 'cityPrice' },
  79. { name: '特约价', checked: false, val: 'specialPrice' },
  80. { name: '终端会员价', checked: false, val: 'terminalPrice' },
  81. ],
  82. pageNo:1,
  83. pageSize:6,
  84. noDataText: '暂无数据',
  85. theme: '',
  86. status: 'loadmore',
  87. showModal:false,
  88. params:{}
  89. }
  90. },
  91. onNavigationBarButtonTap(e){
  92. this.showModal=true
  93. },
  94. onLoad(option) {
  95. this.theme = getApp().globalData.theme
  96. this.getList()
  97. },
  98. methods:{
  99. toPage(url){
  100. uni.switchTab({
  101. url:url
  102. })
  103. },
  104. // 刷新列表
  105. refreshList(val){
  106. this.params =val ? val : {},
  107. this.$nextTick(function(){
  108. this.getList(1)
  109. })
  110. },
  111. // 列表
  112. getList(pageNo){
  113. const _this = this
  114. if (pageNo) {
  115. this.pageNo = pageNo
  116. }
  117. let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize })
  118. this.status = "loading"
  119. dealerProductList(params).then(res => {
  120. if (res.status == 200) {
  121. if(this.pageNo>1){
  122. this.listData = this.listData.concat(res.data.list || [])
  123. }else{
  124. this.listData = res.data.list || []
  125. }
  126. this.totalNum = res.data.count || 0
  127. } else {
  128. this.listData = []
  129. this.totalNum = 0
  130. this.noDataText = res.message
  131. }
  132. this.status = "loadmore"
  133. })
  134. },
  135. // scroll-view到底部加载更多
  136. onreachBottom() {
  137. if(this.listData.length < this.totalNum){
  138. this.pageNo += 1
  139. this.getList()
  140. }
  141. },
  142. }
  143. }
  144. </script>
  145. <style lang="scss">
  146. .productPricing-content{
  147. width:100%;
  148. height: 100vh;
  149. .checkbox-price{
  150. background-color: #fff;
  151. display: flex;
  152. justify-content: space-around;
  153. padding: 20rpx 0;
  154. margin-bottom: 15rpx;
  155. color: #191919;
  156. }
  157. .product-list{
  158. height: calc(100vh - 94upx);
  159. .st-detailList-main{
  160. .st-detailList-main-item{
  161. background: #ffffff;
  162. padding: 20upx;
  163. margin-bottom: 25upx;
  164. border-radius: 25upx;
  165. box-shadow: 1px 1px 3px #EEEEEE;
  166. .st-detailList-tit{
  167. padding-bottom: 20upx;
  168. border-bottom: 1px solid #e4e7ed;
  169. white-space: nowrap;
  170. overflow: hidden;
  171. text-overflow: ellipsis;
  172. .u-line{
  173. display: inline-block;
  174. width: 6upx;
  175. height: 40upx;
  176. background-color: red;
  177. vertical-align: bottom;
  178. margin: 0 20upx 0 10upx;
  179. }
  180. }
  181. .st-detailList-item-con{
  182. padding: 20upx;
  183. font-size: 26upx;
  184. .pimgs{
  185. margin-right: 16upx;
  186. }
  187. .font_13{
  188. font-size: 26upx;
  189. }
  190. .padding_3{
  191. padding: 6upx 0;
  192. }
  193. }
  194. .price-all{
  195. border-top: 1px solid #e4e7ed;
  196. padding: 20upx 20upx 0;
  197. .price-item{
  198. width: 25%;
  199. border-right: 1px solid #e4e7ed;
  200. text-align: center;
  201. >view{
  202. color:#999;
  203. }
  204. }
  205. .price-item:last-child{
  206. border-right: none;
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. </style>