代码更新
This commit is contained in:
@@ -7,21 +7,7 @@
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜搜 -->
|
||||
<!-- <view class="search">
|
||||
<up-input
|
||||
placeholder="搜索优惠券名称"
|
||||
prefixIcon="search"
|
||||
shape="circle"
|
||||
border="none"
|
||||
fontSize="14px"
|
||||
prefixIconStyle="font-size: 28px;color: #999;"
|
||||
:customStyle="{backgroundColor:'#F9F9F9',padding: '10rpx 18rpx'}"
|
||||
></up-input>
|
||||
<view class="searchBtn">
|
||||
搜索
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 内容 -->
|
||||
<view class="couponContentList">
|
||||
<view class="couponContent" v-for="(item,index) in pageData.couponList" :key="index">
|
||||
@@ -71,10 +57,7 @@
|
||||
<button @tap="delCoupon(item)">删除</button>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="pageData.couponList.length">
|
||||
<my-pagination :page="pageData.query.page" :totalElements="pageData.totalElements" :size="pageData.query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
@@ -86,16 +69,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { getTbShopCoupon , delTbShopCoupon} from '@/http/yskApi/coupon.js'
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import { onLoad, onShow,onPageScroll,
|
||||
onPullDownRefresh,
|
||||
onReachBottom, } from '@dcloudio/uni-app';
|
||||
|
||||
import { getCouponList } from '@/api/coupon.js'
|
||||
|
||||
const pageData = reactive({
|
||||
delShow: false,
|
||||
delItem: null,
|
||||
@@ -109,22 +89,14 @@
|
||||
},
|
||||
query: {
|
||||
type: 1,
|
||||
page: 1,
|
||||
size: 10,
|
||||
},
|
||||
couponList: [],
|
||||
totalElements: 0,
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
getCoupon();
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
// pageData.query.page++
|
||||
// getCoupon()
|
||||
})
|
||||
|
||||
/**
|
||||
* tag切换
|
||||
*/
|
||||
@@ -135,21 +107,18 @@
|
||||
getCoupon();
|
||||
}
|
||||
|
||||
// 获取优惠券列表
|
||||
/**
|
||||
* 获取优惠券列表
|
||||
*/
|
||||
let getCoupon = () => {
|
||||
let params = pageData.query;
|
||||
getTbShopCoupon(params).then((res) => {
|
||||
getCouponList(params).then((res) => {
|
||||
console.log(res)
|
||||
pageData.couponList = res.content;
|
||||
pageData.totalElements = res.totalElements;
|
||||
pageData.couponList = res;
|
||||
})
|
||||
}
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
console.log(page)
|
||||
pageData.query.page = page
|
||||
getCoupon()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@@ -168,9 +137,9 @@
|
||||
let editCoupon = (item)=>{
|
||||
console.log(item.id)
|
||||
if ( item.type == 1 ) {
|
||||
go.to('PAGES_COUPON_DISCOUNTCOUPONS',{type: 'info', id: item.id})
|
||||
go.to('PAGES_COUPON_DISCOUNTCOUPONS',{type: 'info', item: JSON.stringify(item)})
|
||||
} else {
|
||||
go.to('PAGES_COUPON_CERTIFICATE',{type: 'info', id: item.id})
|
||||
go.to('PAGES_COUPON_CERTIFICATE',{type: 'info', item: JSON.stringify(item)})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user