salesUser.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view class="sales">
  3. <view class="fix">
  4. <view class="head_top">
  5. <view class="top"></view>
  6. <view class="head">
  7. <span class="cuIcon-back" @click="back"></span>
  8. <view class="case">
  9. <image :src="productImage" alt="" /> {{productName}}
  10. </view>
  11. </view>
  12. </view>
  13. <view class="type">
  14. <view class="type_item">
  15. <image src="/static/product/sales.png" mode=""></image>
  16. {{salesNum}}
  17. </view>
  18. <view class="line"></view>
  19. <view class="type_item">
  20. <image src="/static/product/num.png" mode=""></image>
  21. {{numberBuyers}}
  22. </view>
  23. </view>
  24. </view>
  25. <mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getList" @init="mescrollInit" :use="false">
  26. <view class="item" v-for="(item,index) in list" :key="index">
  27. <view class="img">
  28. <image :src="item.userAvatar?item.userAvatar:'/static/product/user.png'" mode=""></image>
  29. </view>
  30. <view class="right">
  31. {{item.nickName}}<br/>
  32. <span>{{item.phone}}</span>
  33. </view>
  34. </view>
  35. </mescroll-uni>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. productName: '',
  43. productImage: '',
  44. productId: '',
  45. salesNum: '100',
  46. numberBuyers: '200',
  47. upOption: {
  48. page: {
  49. num: 0,
  50. size: 10 // 每页数据的数量,默认10
  51. },
  52. noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  53. empty: {
  54. tip: '暂无相关数据'
  55. }
  56. },
  57. list:[]
  58. }
  59. },
  60. methods: {
  61. //返回
  62. back() {
  63. uni.navigateBack({
  64. delta: 1
  65. });
  66. },
  67. mescrollInit(mescroll) {
  68. this.mescroll = mescroll;
  69. },
  70. getList(page){
  71. let data = {
  72. productId:this.productId,
  73. pageSize: page.size,
  74. pageNo: page.num,
  75. }
  76. this.$http.post('/productSales/list',data).then(res => {
  77. console.log(res)
  78. this.list = this.list.concat(res.data.result.records)
  79. this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
  80. })
  81. },
  82. getCount(){
  83. this.$http.get('/productSales/count?productId='+this.productId).then(res => {
  84. this.numberBuyers = res.data.result.numberBuyers
  85. this.salesNum = res.data.result.salesNum
  86. })
  87. }
  88. },
  89. mounted() {
  90. this.mescroll.optDown.use = false
  91. this.getCount()
  92. },
  93. onLoad(options) {
  94. this.productName = options.productName
  95. this.productImage = options.productImage
  96. this.productId = options.productId
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .sales {
  102. width: 100%;
  103. height: 100%;
  104. background: #F7F8FC;
  105. display: flex;
  106. flex-direction: column;
  107. justify-content: space-between;
  108. position: fixed;
  109. .fix {
  110. height: 422rpx;
  111. background:
  112. linear-gradient(360deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%),
  113. linear-gradient(90deg, #FFFBFA 2%, #FEFFCF 100%);
  114. .head_top {
  115. /*#ifdef APP-PLUS*/
  116. .top {
  117. width: 100%;
  118. height: var(--status-bar-height);
  119. }
  120. /*#endif*/
  121. .head {
  122. width: 100vw;
  123. height: 112rpx;
  124. padding: 20rpx;
  125. display: flex;
  126. align-items: center;
  127. position: relative;
  128. .cuIcon-back {
  129. font-size: 40rpx;
  130. margin-right: 40rpx;
  131. position: absolute;
  132. left: 24rpx;
  133. }
  134. .case {
  135. flex: 1;
  136. font-size: 36rpx;
  137. font-weight: 600;
  138. display: flex;
  139. align-items: center;
  140. justify-content: center;
  141. image {
  142. width: 40rpx;
  143. height: 40rpx;
  144. border-radius: 12rpx;
  145. margin-right: 12rpx;
  146. }
  147. }
  148. }
  149. }
  150. .type {
  151. margin-top: 35rpx;
  152. height: 208rpx;
  153. display: flex;
  154. justify-content: space-around;
  155. align-items: center;
  156. .type_item {
  157. font-size: 48rpx;
  158. display: flex;
  159. align-items: center;
  160. image{
  161. width: 120rpx;
  162. height: 152rpx;
  163. margin-right: 16rpx;
  164. }
  165. }
  166. .line{
  167. height: 60rpx;
  168. width: 1rpx;
  169. background-color: #E7E4B6;
  170. }
  171. }
  172. }
  173. .list{
  174. background-color:transparent;
  175. padding:0px 32rpx;
  176. overflow-y: auto;
  177. .item{
  178. width: 100%;
  179. height: 128rpx;
  180. padding: 20rpx;
  181. background: #FFFFFF;
  182. border-radius: 16rpx;
  183. margin-bottom: 16rpx;
  184. display: flex;
  185. align-items: center;
  186. .img{
  187. margin-right: 16rpx;
  188. image{
  189. width: 80rpx;
  190. height: 80rpx;
  191. }
  192. }
  193. .right{
  194. font-size: 28rpx;
  195. color: #000000;
  196. font-weight: 600;
  197. height: 100%;
  198. display: flex;
  199. flex-direction: column;
  200. justify-content: space-between;
  201. span{
  202. font-size: 24rpx;
  203. color: #8A91A8;
  204. font-weight: 400;
  205. }
  206. }
  207. }
  208. }
  209. }
  210. </style>