123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 |
- <template>
- <!-- 奖励明细页面 -->
- <view class="header">
-
- <view class="header-one">
- </view>
-
- <view class="content">
- <u-tabs style="width: 500rpx;" bg-color="#0095ff" inactive-color="#FFFFFF" active-color="#fff" :list="list"
- :is-scroll="false" :current="current" @change="change"></u-tabs>
- <u-select @cancel="clear" style=" color: #fff;" @confirm="confirm" v-model="showBrand" value-name="brandId" label-name="brandName" :list="brandList"></u-select>
- <u-calendar style=" color: #fff;" @change="changetime" v-model="showDate" :mode="mode"></u-calendar>
- <view @click="search">
- <u-search :show-action="true" :animation="true"></u-search>
- </view>
- </view>
- <view v-if="count!=0">
- <view class="content-one" v-for="(item,index) in datalist" :key="index">
- <view class="content-one-view">
- </view>
- <view class="content-one-text">获得奖励:{{item.money}}元</view>
-
-
- <view class="content-two">
- <view class="">
- 轮胎型号
- </view>
- <view class="">
- {{item.tireModel}}
- </view>
- </view>
- <view class="content-two">
- <view class="">
- 扫码胎号
- </view>
- <view class="">
- {{item.tyreNum}}
- </view>
- </view>
- <view class="content-two">
- <view class="">
- 奖励类型
- </view>
- <view class="">
- {{getWay}}
- </view>
- </view>
- <view class="content-two">
- <view class="">
- 获得时间
- </view>
- <view class="">
- {{item.createTime}}
- </view>
- </view>
-
- </view>
-
- <u-loadmore :status="status" />
- </view>
- <view v-else style="margin-top: 400rpx;">
- <u-empty text="暂无数据" mode="list"></u-empty>
- </view>
- </view>
- </template>
- <script>
- import {
- request
- } from '../../../common/request/request'
- require("promise.prototype.finally").shim()
- export default {
- data() {
- return {
- datalist: [],
- status: 'loadmore',
- getWay: '',
- list: [{
- name: '全部'
- }, {
- name: '品牌'
- }, {
- name: '时间',
- }],
-
- itemList: [{
- head: "赛轮 12R22.5 18PR S838",
- body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
- open: true,
- disabled: true
- }, {
- head: "赛轮 12R22.5 18PR S838",
- body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
- open: false,
- }, {
- head: "赛轮 12R22.5 18PR S838",
- body: "12R22.5 152/149K 18PR S838 LBGSL 0L",
- open: false,
- }],
- brandList:JSON.parse(JSON.stringify([])),
- // brandList: [{
- // value: '1',
- // label: '赛轮'
- // },
- // {
- // value: '2',
- // label: '黑鹰'
- // }
- // ],
- current: 0,
- // 默认页数
- current1: 1,
- showBrand: false,
- showDate: false,
- mode: 'range',
- // 开始时间
- startTime: '',
- // 结束时间
- endTime: '',
- pages: '',
- count:'',
- datalength: '',
- label: '',
-
-
- };
- },
- created() {
- this.data()
- this.getBrandList()
- },
- methods: {
- // 获取奖励明细
- data() {
- request({
- url: '/myPage/getPageScanRewordList',
- method: 'post',
- data: {
- storeId:this.$store.state.storeInfo.storeId,
- userId:this.$store.state.storeInfo.userId,
- 'current': this.current1,
- 'size': '10'
- }
- }).then(res => {
- console.log(res)
- // this.datalist = res.data.data
- this.count = res.data.count
- this.datalength = res.data.data.length
- this.datalist = this.datalist.concat(res.data.data)
-
- // 判断扫码类型
- for (var i = 0; i < res.data.data.length; i++) {
- if (res.data.data[i].getWay == 0) {
- this.getWay = "车主扫码"
- } else {
- this.getWay = "门店扫码"
- }
- }
- }).catch(err => {
- console.log(err)
- })
- .finally(() => {
- setTimeout(() => {
- uni.hideLoading();
- this.loading = false;
- }, 1000)
- })
- },
- // 时间选择器获取时间
- changetime(e) {
- console.log(e)
- this.startTime = e.startDate
- this.endTime = e.endDate
- this.datalist= []
- request({
- url: '/myPage/getPageScanRewordList',
- method: 'post',
- data: {
- storeId:this.$store.state.storeInfo.storeId,
- userId:this.$store.state.storeInfo.userId,
- 'current': '1',
- 'size': '10',
- 'startTime': this.startTime +' 00:00:00',
- 'endTime': this.endTime +' 00:00:00'
- }
- }).then(res => {
- console.log(res)
- // this.datalist = res.data.data
- this.datalist = this.datalist.concat(res.data.data)
- console.log(res.data.data)
- console.log(this.datalist)
- this.count = res.data.count
- // 判断扫码类型
- for (var i = 0; i < res.data.data.length; i++) {
- if (res.data.data[i].getWay == 0) {
- this.getWay = "车主扫码"
- } else {
- this.getWay = "门店扫码"
- }
- }
- console.log(res.data.data)
- }).catch(err => {
- console.log(err)
- })
- .finally(() => {
- setTimeout(() => {
- uni.hideLoading();
- this.loading = false;
- }, 1000)
-
- })
- },
- // 获取品牌列表
- getBrandList() {
- request({
- url: '/baseReq/getBrandList',
- method: 'post',
- data: {
- storeId:this.$store.state.storeInfo.storeId,
- userId:this.$store.state.storeInfo.userId
- }
- }).then(res => {
- this.brandList = JSON.parse(JSON.stringify(res.data.data))
-
- }).catch(err => {
- console.log(err)
- })
- .finally(() => {
- setTimeout(() => {
- uni.hideLoading();
- this.loading = false;
- }, 1000)
-
- })
- },
- // 点击获取品牌
- confirm(e) {
-
- console.log(e)
- console.log(e[0].label)
- this.label = e[0].label
- request({
- url: '/myPage/getPageScanRewordList',
- method: 'post',
- data: {
- storeId:this.$store.state.storeInfo.storeId,
- userId:this.$store.state.storeInfo.userId,
- 'current': '1',
- 'size': '10',
- 'searchKey': this.label
- }
- }).then(res => {
- console.log(res)
- this.count = res.data.count
- this.datalength = res.data.data.length
- this.datalist = this.datalist.concat(res.data.data)
- // 判断扫码类型
- for (var i = 0; i < res.data.data.length; i++) {
- if (res.data.data[i].getWay == 0) {
- this.getWay = "车主扫码"
- } else {
- this.getWay = "门店扫码"
- }
- }
- console.log(res.data.data)
- }).catch(err => {
- console.log(err)
- })
- .finally(() => {
- setTimeout(() => {
- uni.hideLoading();
- this.loading = false;
- }, 1000)
-
- })
- },
- // 点击取消按钮
-
-
- clear() {
- this.current = 0
- console.log("@@")
- },
- search() {
- this.$u.route({
- url: 'pages/me/search/index',
- })
- },
- change(index) {
- this.current = index;
- if (this.current == 1) {
- this.showBrand = true
- this.datalist= []
- } else if (this.current == 2) {
- this.showDate = true
- this.datalist= []
- }
- this.current1 = 1
- this.datalist= []
- this.data()
- }
- },
- onReachBottom() {
- console.log("@@@")
- console.log(this.count)
- console.log(this.datalength)
- setTimeout(() => {
- if (this.count > this.datalength) {
- this.current1 = ++this.current1;
- this.data()
- this.status = 'nomore'
-
- } else {
-
- this.status = 'loading';
- console.log("@@@")
- // this.status = 'nomore'
-
- }
- }, 1000)
-
- }
- }
- </script>
- <style lang="scss" scoped>
- .header {
- height: 400rpx;
- width: 100%;
- background: #0094FE;
- color: #fff;
- font-size: 28rpx;
- }
- .header-one {
- text-align: center;
- padding-top: 10rpx;
- }
- .header-one>text {
- font-size: 52rpx;
- }
- .content {
- display: flex;
- justify-content: space-between;
- width: 700rpx;
- margin-top: 80rpx;
- }
- .content-one {
- width: 690rpx;
- height: 305rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 24px 0px rgba(101, 176, 249, 0.41);
- border-radius: 20rpx;
- margin: 0 auto;
- margin-top: 30rpx;
- }
- .content-one-view {
- width: 6rpx;
- height: 30rpx;
- background: #0292FD;
- position: relative;
- top: 20rpx;
- left: 30rpx;
- }
- .content-one-text {
- position: relative;
- top: -8rpx;
- left: 60rpx;
- font-size: 24rpx;
- font-weight: bold;
- color: #000;
- }
- .content-one-time {
- position: relative;
- top: -40rpx;
- left: 530rpx;
- font-size: 13rpx;
- color: #626262;
- }
- .content-two {
- display: flex;
- justify-content: space-between;
- font-size: 24rpx;
- color: #6A6A6A;
- margin-top: 25rpx;
- margin-left: 30rpx;
- margin-right: 30rpx;
- }
- </style>
|