| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- <template>
- <view class="sales">
- <view class="fix">
- <view class="head_top">
- <view class="top"></view>
- <view class="head">
- <span class="cuIcon-back" @click="back"></span>
- <view class="case">
- <image :src="productImage" alt="" /> {{productName}}
- </view>
- </view>
- </view>
- <view class="type">
- <view class="type_item">
- <image src="/static/product/sales.png" mode=""></image>
- {{salesNum}}
- </view>
- <view class="line"></view>
- <view class="type_item">
- <image src="/static/product/num.png" mode=""></image>
- {{numberBuyers}}
- </view>
- </view>
- </view>
- <mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getList" @init="mescrollInit" :use="false">
- <view class="item" v-for="(item,index) in list" :key="index">
- <view class="img">
- <image :src="item.userAvatar?item.userAvatar:'/static/product/user.png'" mode=""></image>
- </view>
- <view class="right">
- {{item.nickName}}<br/>
- <span>{{item.phone}}</span>
- </view>
- </view>
- </mescroll-uni>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- productName: '',
- productImage: '',
- productId: '',
- salesNum: '100',
- numberBuyers: '200',
- upOption: {
- page: {
- num: 0,
- size: 10 // 每页数据的数量,默认10
- },
- noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
- empty: {
- tip: '暂无相关数据'
- }
- },
- list:[]
- }
- },
- methods: {
- //返回
- back() {
- uni.navigateBack({
- delta: 1
- });
- },
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
- getList(page){
- let data = {
- productId:this.productId,
- pageSize: page.size,
- pageNo: page.num,
- }
- this.$http.post('/productSales/list',data).then(res => {
- console.log(res)
- this.list = this.list.concat(res.data.result.records)
- this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);
- })
- },
- getCount(){
- this.$http.get('/productSales/count?productId='+this.productId).then(res => {
- this.numberBuyers = res.data.result.numberBuyers
- this.salesNum = res.data.result.salesNum
- })
- }
- },
- mounted() {
- this.mescroll.optDown.use = false
- this.getCount()
- },
- onLoad(options) {
- this.productName = options.productName
- this.productImage = options.productImage
- this.productId = options.productId
- }
- }
- </script>
- <style lang="scss" scoped>
- .sales {
- width: 100%;
- height: 100%;
- background: #F7F8FC;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- position: fixed;
- .fix {
- height: 422rpx;
- background:
- linear-gradient(360deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%),
- linear-gradient(90deg, #FFFBFA 2%, #FEFFCF 100%);
- .head_top {
- /*#ifdef APP-PLUS*/
- .top {
- width: 100%;
- height: var(--status-bar-height);
- }
- /*#endif*/
- .head {
- width: 100vw;
- height: 112rpx;
- padding: 20rpx;
- display: flex;
- align-items: center;
- position: relative;
- .cuIcon-back {
- font-size: 40rpx;
- margin-right: 40rpx;
- position: absolute;
- left: 24rpx;
- }
- .case {
- flex: 1;
- font-size: 36rpx;
- font-weight: 600;
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- width: 40rpx;
- height: 40rpx;
- border-radius: 12rpx;
- margin-right: 12rpx;
- }
- }
- }
- }
- .type {
- margin-top: 35rpx;
- height: 208rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
- .type_item {
- font-size: 48rpx;
- display: flex;
- align-items: center;
-
- image{
- width: 120rpx;
- height: 152rpx;
- margin-right: 16rpx;
- }
- }
- .line{
- height: 60rpx;
- width: 1rpx;
- background-color: #E7E4B6;
- }
- }
- }
- .list{
- background-color:transparent;
- padding:0px 32rpx;
- overflow-y: auto;
- .item{
- width: 100%;
- height: 128rpx;
- padding: 20rpx;
- background: #FFFFFF;
- border-radius: 16rpx;
- margin-bottom: 16rpx;
- display: flex;
- align-items: center;
- .img{
- margin-right: 16rpx;
- image{
- width: 80rpx;
- height: 80rpx;
- }
- }
- .right{
- font-size: 28rpx;
- color: #000000;
- font-weight: 600;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- span{
- font-size: 24rpx;
- color: #8A91A8;
- font-weight: 400;
- }
- }
- }
- }
- }
- </style>
|