diff --git a/components/my-components/my-date-pickerview.vue b/components/my-components/my-date-pickerview.vue index c061e1f..0f92a6f 100644 --- a/components/my-components/my-date-pickerview.vue +++ b/components/my-components/my-date-pickerview.vue @@ -129,7 +129,7 @@ mode: { //all date time type: String, - default: 'all' + default: 'time' }, yearsLen:{ type: Number, diff --git a/http/yskApi/coupon.js b/http/yskApi/coupon.js new file mode 100644 index 0000000..ae4d4fc --- /dev/null +++ b/http/yskApi/coupon.js @@ -0,0 +1,58 @@ +import http from './http.js' +const request=http.request + + +/** + * 获取优惠券列表 + * @returns + */ +export function getTbShopCoupon(data) { + return request({ + url: `/api/tbShopCoupon`, + method: 'get', + params: { + shopId: uni.getStorageSync('shopId'), + ...data + } + }) +} + +/** + * 获取优惠券详情 + * @returns + */ +export function getTbShopCouponInfo(id) { + return request({ + url: `/api/tbShopCoupon/${id}`, + method: 'get', + params: { + } + }) +} + +/** + * 增加优惠券 + * @returns + */ +export function addTbShopCoupon(data) { + return request({ + url: `/api/tbShopCoupon`, + method: 'post', + params: { + shopId: uni.getStorageSync('shopId'), + ...data + } + }) +} + +/** + * 删除优惠券 + * @returns + */ +export function delTbShopCoupon(data) { + return request({ + url: `/api/tbShopCoupon`, + method: 'delete', + params: data + }) +} diff --git a/http/yskApi/http.js b/http/yskApi/http.js index db1a980..cfb63d3 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -16,10 +16,10 @@ import { import infoBox from "@/commons/utils/infoBox.js" import go from '@/commons/utils/go.js'; // 测试服 -// let baseUrl = 'https://admintestpapi.sxczgkj.cn' +let baseUrl = 'https://admintestpapi.sxczgkj.cn' //预发布 -let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn' +// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn' // 王伟本地测 // let baseUrl = '/ww' diff --git a/pageCoupon/components/select-goods.vue b/pageCoupon/components/select-goods.vue index feab79a..2bda69c 100644 --- a/pageCoupon/components/select-goods.vue +++ b/pageCoupon/components/select-goods.vue @@ -3,7 +3,7 @@ 请选择 - + @@ -65,7 +65,7 @@ import { goodsValue.value = item.id; } function groupChange ( n ) { - console.log(n) + // console.log(n) } function getCategoryList () { $tbShopCategory({ @@ -78,7 +78,6 @@ import { } function getGoodsList () { $tbProductV2(category.query).then(res => { - console.log(res); category.goodsList = res.content.map(v => { return { ...v, @@ -104,18 +103,14 @@ import { * 确认 */ function affirm() { - console.log(goodsValue.value) - // let params = { - // coverImg: vdata.imgUrlList, - // consId: itemData.value.consId, - // amount: vdata.stockNumber, - // shopId: uni.getStorageSync("shopId"), - // } - // tbConsInfoFlowfrmLoss(params).then((res) => { - // show.value = false; - // vdata.imgUrlList = []; - // vdata.stockNumber = 1; - // }) + let item; + category.goodsList.forEach((v,e)=>{ + if ( v.id == goodsValue.value) { + item = v; + } + }) + emits('affirm',item) + close(); } defineExpose({ open,close,affirm diff --git a/pageCoupon/discountCoupons.vue b/pageCoupon/discountCoupons.vue index 6d7384c..a382ff5 100644 --- a/pageCoupon/discountCoupons.vue +++ b/pageCoupon/discountCoupons.vue @@ -4,42 +4,50 @@ 优惠券名称 - + 使用门槛 - + 有效期类型 - - - - - + + + + + + + + + + {{ formData.validStartTime || '开始时间'}}-- + {{ formData.validEndTime || '结束时间'}} + + 有效期(天) - + 隔天生效 - 天生效 + 天生效 可用日期 - + 指定时间段可用 - - - - - + + + + + + + + + + {{ formData.useStartTime || '开始时间'}}-- + {{ formData.useEndTime || '结束时间'}} + @@ -67,24 +82,32 @@ - + - + + @@ -150,6 +273,30 @@ width: 150rpx; text-align: center; } + .date,.time{ + display: flex; + align-items: center; + font-weight: 400; + font-size: 26rpx; + color: #999999; + margin-top: 10rpx; + view{ + border: 1rpx solid #999; + padding: 10rpx 20rpx; + border-radius: 10rpx + } + view:nth-child(1){ + margin-right: 10rpx; + } + view:nth-child(2){ + margin-left: 10rpx; + } + } + .time{ + view{ + padding: 10rpx 30rpx; + } + } } } .item:last-child{ diff --git a/pageCoupon/editCertificate.vue b/pageCoupon/editCertificate.vue index 651951e..aa2048b 100644 --- a/pageCoupon/editCertificate.vue +++ b/pageCoupon/editCertificate.vue @@ -4,19 +4,19 @@ 商品兑换券名称 - + 使用门槛 - 元,可用 + 元,可用 总发放数量 - + @@ -28,7 +28,12 @@ 选择商品 - 选择指定商品 + 选择指定商品 + + + {{item.name}} + + @@ -46,23 +51,31 @@ @@ -129,6 +168,13 @@ font-size: 24rpx; color: #999999; } + .goodsItem{ + display: flex; + align-items: center; + .productName{ + margin-right: 20rpx; + } + } } } } diff --git a/pageCoupon/index.vue b/pageCoupon/index.vue index 357d8b0..033d62c 100644 --- a/pageCoupon/index.vue +++ b/pageCoupon/index.vue @@ -1,16 +1,13 @@