faet 添加领券中心,修改自营内容
This commit is contained in:
parent
543e3e7421
commit
d2c7465c4f
1
app.json
1
app.json
@ -31,6 +31,7 @@
|
|||||||
"pages/goods/comments/create/index",
|
"pages/goods/comments/create/index",
|
||||||
"pages/coupon/coupon-list/index",
|
"pages/coupon/coupon-list/index",
|
||||||
"pages/coupon/coupon-detail/index",
|
"pages/coupon/coupon-detail/index",
|
||||||
|
"pages/coupon/coupon-center/index",
|
||||||
"pages/coupon/coupon-activity-goods/index",
|
"pages/coupon/coupon-activity-goods/index",
|
||||||
"pages/promotion-detail/index",
|
"pages/promotion-detail/index",
|
||||||
"pages/order/fill-tracking-no/index",
|
"pages/order/fill-tracking-no/index",
|
||||||
|
@ -55,6 +55,7 @@ Component({
|
|||||||
methods: {
|
methods: {
|
||||||
// 删除商品
|
// 删除商品
|
||||||
deleteGoods(e) {
|
deleteGoods(e) {
|
||||||
|
console.log(e,'asda111111111111111');
|
||||||
const { goods } = e.currentTarget.dataset;
|
const { goods } = e.currentTarget.dataset;
|
||||||
this.triggerEvent('delete', { goods });
|
this.triggerEvent('delete', { goods });
|
||||||
},
|
},
|
||||||
|
@ -65,9 +65,9 @@
|
|||||||
catchspecs="specsTap"
|
catchspecs="specsTap"
|
||||||
catchclick="goGoodsDetail"
|
catchclick="goGoodsDetail"
|
||||||
>
|
>
|
||||||
<view slot="thumb-cover" class="stock-mask" wx:if="{{goods.shortageStock || goods.stockQuantity <= 3}}">
|
<!-- <view slot="thumb-cover" class="stock-mask" wx:if="{{goods.shortageStock || goods.stockQuantity <= 3}}">
|
||||||
仅剩{{goods.stockQuantity}}件
|
仅剩{{goods.stockQuantity}}件
|
||||||
</view>
|
</view> -->
|
||||||
<view slot="append-body" class="goods-stepper">
|
<view slot="append-body" class="goods-stepper">
|
||||||
<view class="stepper-tip" wx:if="{{goods.shortageStock}}">库存不足</view>
|
<view class="stepper-tip" wx:if="{{goods.shortageStock}}">库存不足</view>
|
||||||
<t-stepper
|
<t-stepper
|
||||||
@ -121,6 +121,7 @@
|
|||||||
data-goods="{{goods}}"
|
data-goods="{{goods}}"
|
||||||
catchspecs="specsTap"
|
catchspecs="specsTap"
|
||||||
catchclick="goGoodsDetail"
|
catchclick="goGoodsDetail"
|
||||||
|
catchdel="deleteGoods"
|
||||||
>
|
>
|
||||||
<view slot="thumb-cover" class="no-storage-mask" wx:if="{{goods.stockQuantity <=0 || (goods.skuId != 0 && goods.skuStockQuantity <=0)}}">
|
<view slot="thumb-cover" class="no-storage-mask" wx:if="{{goods.stockQuantity <=0 || (goods.skuId != 0 && goods.skuStockQuantity <=0)}}">
|
||||||
<view class="no-storage-content">无货</view>
|
<view class="no-storage-content">无货</view>
|
||||||
|
@ -150,6 +150,9 @@ Component({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
clickDeletesHandle(){
|
||||||
|
this.triggerEvent('del', { goods: this.data.goods });
|
||||||
|
},
|
||||||
clickHandle() {
|
clickHandle() {
|
||||||
this.triggerEvent('click', { goods: this.data.goods });
|
this.triggerEvent('click', { goods: this.data.goods });
|
||||||
},
|
},
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<block wx:else>
|
<block wx:else>
|
||||||
<view class="no_storage">
|
<view class="no_storage">
|
||||||
<view>请重新选择商品规格</view>
|
<view>请重新选择商品规格</view>
|
||||||
<view class="no_storage__right" bind:handleClick="reSelect">重选</view>
|
<view class="no_storage__right" bind:tap="clickDeletesHandle" data-goods="{{goods}}">删除</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
@ -1,7 +1,31 @@
|
|||||||
|
import {
|
||||||
|
imageProps
|
||||||
|
} from "~/miniprogram_npm/@vant/weapp/uploader/shared";
|
||||||
|
import {
|
||||||
|
addCustomerCoupon
|
||||||
|
} from '~/services/coupon/addCustomerCoupon';
|
||||||
|
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
1: { text: '去使用', theme: 'primary' },
|
1: {
|
||||||
2: { text: '已使用', theme: 'default' },
|
text: '去使用',
|
||||||
3: { text: '已过期', theme: 'default' },
|
theme: 'primary'
|
||||||
|
},
|
||||||
|
2: {
|
||||||
|
text: '已使用',
|
||||||
|
theme: 'default'
|
||||||
|
},
|
||||||
|
3: {
|
||||||
|
text: '已过期',
|
||||||
|
theme: 'default'
|
||||||
|
},
|
||||||
|
4: {
|
||||||
|
text: '领取',
|
||||||
|
theme: 'primary'
|
||||||
|
},
|
||||||
|
5: {
|
||||||
|
text: '已领取',
|
||||||
|
theme: 'default'
|
||||||
|
},
|
||||||
};
|
};
|
||||||
Component({
|
Component({
|
||||||
options: {
|
options: {
|
||||||
@ -40,17 +64,32 @@ Component({
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 跳转到详情页
|
// 跳转到详情页
|
||||||
gotoDetail() {
|
// gotoDetail() {
|
||||||
wx.navigateTo({
|
// wx.navigateTo({
|
||||||
url: `/pages/coupon/coupon-detail/index?id=${this.data.couponDTO.key}`,
|
// url: `/pages/coupon/coupon-detail/index?id=${this.data.couponDTO.key}`,
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
|
|
||||||
// 跳转到商品列表
|
// 跳转到商品列表
|
||||||
gotoGoodsList() {
|
gotoGoodsList() {
|
||||||
wx.navigateTo({
|
let status = this.properties.couponDTO.status
|
||||||
url: `/pages/coupon/coupon-activity-goods/index?id=${this.data.couponDTO.key}`,
|
let couponGuid = this.properties.couponDTO.couponGuid
|
||||||
});
|
if (status == 4) {
|
||||||
|
addCustomerCoupon({
|
||||||
|
couponGuid
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.triggerEvent('refresh')
|
||||||
|
wx.showToast({
|
||||||
|
icon: '',
|
||||||
|
title: res.data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// wx.navigateTo({
|
||||||
|
// url: `/pages/coupon/coupon-activity-goods/index?id=${this.data.couponDTO.key}`,
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
36
pages/coupon/coupon-center/index.js
Normal file
36
pages/coupon/coupon-center/index.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import {
|
||||||
|
getCouponList
|
||||||
|
} from '~/services/coupon/getCouponList';
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
couponList: [],
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.fetchList();
|
||||||
|
},
|
||||||
|
|
||||||
|
fetchList() {
|
||||||
|
// 优惠券接口
|
||||||
|
getCouponList().then((couponList) => {
|
||||||
|
this.setData({
|
||||||
|
couponList
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onPullDownRefresh_() {
|
||||||
|
this.setData({
|
||||||
|
couponList: [],
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.fetchList();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
11
pages/coupon/coupon-center/index.json
Normal file
11
pages/coupon/coupon-center/index.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "领券中心",
|
||||||
|
"usingComponents": {
|
||||||
|
"t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh",
|
||||||
|
"t-tabs": "tdesign-miniprogram/tabs/tabs",
|
||||||
|
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
|
||||||
|
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||||
|
"coupon-card": "../components/coupon-card/index",
|
||||||
|
"t-empty": "tdesign-miniprogram/empty/empty"
|
||||||
|
}
|
||||||
|
}
|
15
pages/coupon/coupon-center/index.wxml
Normal file
15
pages/coupon/coupon-center/index.wxml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
<view class="coupon-list-wrap">
|
||||||
|
<t-pull-down-refresh
|
||||||
|
t-class-indicator="t-class-indicator"
|
||||||
|
id="t-pull-down-refresh"
|
||||||
|
bind:refresh="onPullDownRefresh_"
|
||||||
|
background="#fff"
|
||||||
|
>
|
||||||
|
<view class="coupon-list-item" wx:for="{{couponList}}" wx:key="key">
|
||||||
|
<coupon-card couponDTO="{{item}}" bindrefresh="init"/>
|
||||||
|
</view>
|
||||||
|
<t-empty wx:if="{{couponList.length == 0}}" t-class="empty-cls" t-class-image="t-empty__image" image="https://tdesign.gtimg.com/miniprogram/images/empty1.png" description="暂无优惠券可领取" />
|
||||||
|
</t-pull-down-refresh>
|
||||||
|
</view>
|
||||||
|
|
82
pages/coupon/coupon-center/index.wxss
Normal file
82
pages/coupon/coupon-center/index.wxss
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
page {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs-external__inner {
|
||||||
|
height: 88rpx;
|
||||||
|
width: 100%;
|
||||||
|
line-height: 88rpx;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
.tabs-external__inner {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333333;
|
||||||
|
position: fixed;
|
||||||
|
width: 100vw;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs-external__inner .tabs-external__track {
|
||||||
|
/* background: #fa4126 !important; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs-external__inner .tabs-external__item {
|
||||||
|
/* color: #666; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs-external__inner .tabs-external__active {
|
||||||
|
font-size: 28rpx;
|
||||||
|
/* color: #fa4126 !important; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs-external__inner.order-nav .order-nav-item .bottom-line {
|
||||||
|
bottom: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coupon-list-wrap {
|
||||||
|
margin-top: 32rpx;
|
||||||
|
margin-left: 32rpx;
|
||||||
|
margin-right: 32rpx;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
padding-bottom: calc(constant(safe-area-inset-top) + 100rpx);
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center-entry {
|
||||||
|
box-sizing: content-box;
|
||||||
|
border-top: 1rpx solid #dce0e4;
|
||||||
|
background-color: #fff;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 100rpx;
|
||||||
|
padding-bottom: 0;
|
||||||
|
padding-bottom: constant(safe-area-inset-top);
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
.center-entry-btn {
|
||||||
|
color: #1989fa;
|
||||||
|
font-size: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 100rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coupon-list-wrap .t-pull-down-refresh__bar {
|
||||||
|
background: #fff !important;
|
||||||
|
}
|
||||||
|
.t-class-indicator {
|
||||||
|
color: #b9b9b9 !important;
|
||||||
|
}
|
||||||
|
.t-empty__image {
|
||||||
|
width: 240rpx !important;
|
||||||
|
height: 240rpx !important;
|
||||||
|
}
|
@ -71,10 +71,13 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
goCouponCenterHandle() {
|
goCouponCenterHandle() {
|
||||||
wx.showToast({
|
wx.navigateTo({
|
||||||
title: '去领券中心',
|
url: `/pages/coupon/coupon-center/index`,
|
||||||
icon: 'none'
|
|
||||||
});
|
});
|
||||||
|
// wx.showToast({
|
||||||
|
// title: '去领券中心',
|
||||||
|
// icon: 'none'
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
onPullDownRefresh_() {
|
onPullDownRefresh_() {
|
||||||
|
@ -28,16 +28,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<t-empty wx:if="{{couponList.length == 0}}" t-class="empty-cls" t-class-image="t-empty__image" image="https://tdesign.gtimg.com/miniprogram/images/empty1.png" description="暂无数据" />
|
<t-empty wx:if="{{couponList.length == 0}}" t-class="empty-cls" t-class-image="t-empty__image" image="https://tdesign.gtimg.com/miniprogram/images/empty1.png" description="暂无数据" />
|
||||||
</t-pull-down-refresh>
|
</t-pull-down-refresh>
|
||||||
<!-- <view class="center-entry">
|
<view class="center-entry">
|
||||||
<view class="center-entry-btn" bind:tap="goCouponCenterHandle">
|
<view class="center-entry-btn" bind:tap="goCouponCenterHandle">
|
||||||
<view>领券中心</view>
|
<view>领券中心</view>
|
||||||
<t-icon
|
<t-icon
|
||||||
name="chevron-right"
|
name="chevron-right"
|
||||||
color="#fa4126"
|
color="#1989fa"
|
||||||
size="40rpx"
|
size="40rpx"
|
||||||
style="line-height: 28rpx;"
|
style="line-height: 28rpx;"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.center-entry-btn {
|
.center-entry-btn {
|
||||||
color: #fa4126;
|
color: #1989fa;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<view class="search-page">
|
<view class="search-page">
|
||||||
<t-search t-class-input-container="t-class__input-container" t-class-input="t-search__input" value="{{searchValue}}" leftIcon="" placeholder="iPhone12pro" bind:submit="handleSubmit" focus>
|
<t-search t-class-input-container="t-class__input-container" t-class-input="t-search__input" value="{{searchValue}}" leftIcon="" placeholder="请输入关键词" bind:submit="handleSubmit" focus>
|
||||||
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
||||||
</t-search>
|
</t-search>
|
||||||
<view class="search-wrap">
|
<view class="search-wrap">
|
||||||
|
@ -243,12 +243,11 @@ Component({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onBuyAgain() {
|
onBuyAgain(order) {
|
||||||
Toast({
|
console.log(order,'asdasd');
|
||||||
context: this,
|
console.log(order.goodsList[0].id,'asdasd');
|
||||||
selector: '#t-toast',
|
wx.navigateTo({
|
||||||
message: '你点击了再次购买',
|
url: `/pages/goods/details/index?spuId=${order.goodsList[0].id}`
|
||||||
icon: 'check-circle',
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
<address-card addressData="{{userAddress}}" bind:addclick="onGotoAddress" bind:addressclick="onGotoAddress" />
|
<address-card addressData="{{userAddress}}" bind:addclick="onGotoAddress" bind:addressclick="onGotoAddress" />
|
||||||
|
|
||||||
<view class="order-wrapper" wx:for="{{settleDetailData.storeGoodsList}}" wx:for-item="stores" wx:for-index="storeIndex" wx:key="storeIndex">
|
<view class="order-wrapper" wx:for="{{settleDetailData.storeGoodsList}}" wx:for-item="stores" wx:for-index="storeIndex" wx:key="storeIndex">
|
||||||
<view class="store-wrapper">
|
<!-- <view class="store-wrapper">
|
||||||
<t-icon prefix="wr" size="40rpx" color="#333333" name="store" class="store-logo" />
|
<t-icon prefix="wr" size="40rpx" color="#333333" name="store" class="store-logo" />
|
||||||
{{stores.storeName}}
|
{{stores.storeName}}
|
||||||
</view>
|
</view> -->
|
||||||
<view wx:if="{{orderCardList[storeIndex].goodsList.length > 0}}" wx:for="{{orderCardList[storeIndex].goodsList}}" wx:for-item="goods" wx:for-index="gIndex" wx:key="id" class="goods-wrapper">
|
<view wx:if="{{orderCardList[storeIndex].goodsList.length > 0}}" wx:for="{{orderCardList[storeIndex].goodsList}}" wx:for-item="goods" wx:for-index="gIndex" wx:key="id" class="goods-wrapper">
|
||||||
<image src="{{goods.thumb}}" class="goods-image" mode="aspectFill" />
|
<image src="{{goods.thumb}}" class="goods-image" mode="aspectFill" />
|
||||||
<view class="goods-content">
|
<view class="goods-content">
|
||||||
|
21
services/coupon/addCustomerCoupon.js
Normal file
21
services/coupon/addCustomerCoupon.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import {
|
||||||
|
request
|
||||||
|
} from '../_utils/request';
|
||||||
|
|
||||||
|
/** 优惠券列表 */
|
||||||
|
export async function addCustomerCoupon(data) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
request({
|
||||||
|
url: `CustomerCouponApi/addCustomerCoupon`,
|
||||||
|
data: data,
|
||||||
|
method: 'POST',
|
||||||
|
success: function (res) {
|
||||||
|
|
||||||
|
resolve(res);
|
||||||
|
},
|
||||||
|
fail: function (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
22
services/coupon/getCouponList.js
Normal file
22
services/coupon/getCouponList.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import {
|
||||||
|
request
|
||||||
|
} from '../_utils/request';
|
||||||
|
|
||||||
|
/** 优惠券列表 */
|
||||||
|
export async function getCouponList(parm) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
request({
|
||||||
|
url: `CouponApi/getCouponList`,
|
||||||
|
data: parm,
|
||||||
|
method: 'GET',
|
||||||
|
success: function (res) {
|
||||||
|
let data = res.data;
|
||||||
|
|
||||||
|
resolve(data);
|
||||||
|
},
|
||||||
|
fail: function (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user