Commit f166c481 by 李伟康

提交

1 parent b4ab48ca
import { preReleaseAppId } from '~/config' import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 3 let index = 2
/** /**
* *
......
...@@ -99,7 +99,7 @@ module.exports = { ...@@ -99,7 +99,7 @@ module.exports = {
/** 获取商品关联优惠券列表 */ /** 获取商品关联优惠券列表 */
getGoodscouponList(data) { getGoodscouponList(data) {
return api.fetch('scrm.api.shopmall.weapp.goods.user.coupons.get', data) return api.fetch('scrm.api.coupon.seahorse.knife.goods.list', data)
}, },
/** 领取商品详情优惠券 */ /** 领取商品详情优惠券 */
......
...@@ -23,18 +23,18 @@ ...@@ -23,18 +23,18 @@
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 2}}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view> <view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 2}}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 3}}">无期限</view> <view class="h4_text drive" wx:if="{{item.couponStatus == 0&&item.effectiveType == 3}}">无期限</view>
<!-- 已领取,effectiveType == 1 或者2,都显示时间段,effectiveType == 3 无限制 --> <!-- 已领取,effectiveType == 1 或者2,都显示时间段,effectiveType == 3 无限制 -->
<view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 1||item.couponStatus == 1&&item.effectiveType == 2 }}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view> <view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 1||item.couponStatus == 1&&item.effectiveType == 2 }}">{{item.effectiveStartTime}}-{{item.effectiveEndTime}}</view>
<view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 3}}">无期限</view> <view class="h4_text drive" wx:if="{{item.couponStatus == 1&&item.effectiveType == 3}}">无期限</view>
</view> </view>
<block wx:if="{{order == 0}}"> <block wx:if="{{order == 0}}">
<view class="box_btn box_btn_color box_btn_color_grey" bindtap="toDetail" wx:if="{{item.couponStatus == 0&&item.residueAmount >0}}" data-item="{{item}}" bindtap="getCoupon">领取</view> <!-- <view class="box_btn box_btn_color box_btn_color_grey" bindtap="toDetail" wx:if="{{item.couponStatus == 0&&item.residueAmount >0}}" data-item="{{item}}" bindtap="getCoupon">领取</view>
<view class="box_btn_color_been_gray " bind:tap="toDetail" wx:elif="{{item.couponStatus != 1&&item.residueAmount ==0}}">已抢光</view> <view class="box_btn_color_been_gray " bind:tap="toDetail" wx:elif="{{item.couponStatus != 1&&item.residueAmount ==0}}">已抢光</view>
<view class="box_btn_color_been" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view> <view class="box_btn_color_been" bind:tap="toDetail" wx:elif="{{item.couponStatus == 1}}">已领取</view> -->
<view class="already" wx:if="{{item.couponStatus == 1}}"> <block wx:if="{{item.couponStatus == 1}}">
<glsx-image webp src="coupons/been.png" /> <view class="already">
</view> <glsx-image webp src="coupons/been.png" />
</view>
</block>
</block> </block>
<block wx:else> <block wx:else>
<view class="circle-selected" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.isChecked}}" bindtap="selectCoupon"> <view class="circle-selected" data-item="{{item}}" data-index="{{index}}" wx:if="{{item.isChecked}}" bindtap="selectCoupon">
...@@ -66,9 +66,6 @@ ...@@ -66,9 +66,6 @@
</view> </view>
</block> --> </block> -->
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
margin-top: 24rpx; margin: 24rpx;
} }
.gray { .gray {
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
margin-top: 24rpx; margin-top: 24rpx auto 0;
} }
.left_icon_box { .left_icon_box {
......
...@@ -394,31 +394,31 @@ Page({ ...@@ -394,31 +394,31 @@ Page({
}) })
}, },
async getGoodscouponList(id) { async getGoodscouponList(id) {
const res = await wx.p.router.intercept(false) const res = await wx.p.router.intercept(false),
{
merchantId
} = wx.p.storage.get('merchant_info')
if (res) return if (res) return
id = id ? id : this.data.id id = id ? id : this.data.id
wx.p.api.shopmallApi wx.p.api.shopmallApi.getGoodscouponList({
.getGoodscouponList({ goodsId: id,
id merchantId
}).then(({
code,
data,
message
}) => {
let list = data && data.map(item => {
if (item.effectiveEndTime || item.effectiveStartTime) {
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
}
return item
}) })
.then(({ this.setData({
code, couponData: list
data,
message
}) => {
let list =
data &&
data.map(item => {
if (item.effectiveEndTime || item.effectiveStartTime) {
item.effectiveEndTime = new Date(item.effectiveEndTime).format('yyyy.MM.dd')
item.effectiveStartTime = new Date(item.effectiveStartTime).format('yyyy.MM.dd')
}
return item
})
this.setData({
couponData: list
})
}) })
})
}, },
setMediaInfo(goodsDescList) { setMediaInfo(goodsDescList) {
wx.p.wxApi.getSystemInfo(({ wx.p.wxApi.getSystemInfo(({
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
"tabSize": 2 "tabSize": 2
}, },
"condition": {}, "condition": {},
"libVersion": "2.24.4",
"packOptions": { "packOptions": {
"ignore": [ "ignore": [
{ {
...@@ -59,6 +58,5 @@ ...@@ -59,6 +58,5 @@
], ],
"include": [] "include": []
}, },
"appid": "wx2a9f38eb8e39b823", "appid": "wx2a9f38eb8e39b823"
"projectname": "hmd-0817"
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!