Merge refs/remotes/KXMH/develop into refs/heads/develop

develop
mice2333 4 years ago
commit 6064ce17fb

@ -176,9 +176,6 @@ Page({
})
},
onlinkurl(e) {
// wx.navigateTo({
// url: '/pages/user/discount/coupons/coupons',
// })
this.cancle_mark(e)
let link_url = e.currentTarget.dataset.link_url
wx.navigateTo({

@ -127,7 +127,7 @@ page{
.father-size {
width: auto;
background-color:#fff;
margin-top: 80px;
margin-top: 40rpx;
margin-left: -25vw;
margin-right: -25vw;
}

@ -1,8 +1,7 @@
// pages/user/discount/coupons/coupons.js
import {
httpUtil,
location_city,
login_check
http,
} from '../../../../utils/util'
Page({
@ -21,31 +20,33 @@ Page({
},
getcollect_list(activity_id) {
console.log(activity_id);
http("/api/v1/bind-coupon-list", "post", {
activity_id
}).then(res => {
this.setData({
coupons_list: res
})
})
},
collect_receive(e) {
// if (login_check()) {
// // let id = e.currentTarget.dataset.id
let status=1
let statusInfo=['success','error','error']
let statusTitle=['领取成功','已经领取','领取失败']
http("/api/v1/bind-coupon", "post", {
activity_id: e.currentTarget.dataset.id
}).then(res => {
wx.showToast({
title: statusTitle[status],
icon: statusInfo[status],
title: '领取成功',
icon: 'success',
mask: true
})
setTimeout(() => {
wx.hideToast()
if(status==0){
wx.redirectTo({
url: '/pages/user/discount/discount/discount',
})
}
}, 1000);
// }
this.data.coupons_list[e.currentTarget.dataset.index].is_received = 1
this.setData({
coupons_list: this.data.coupons_list
})
})
},
mydiscount() {
wx.redirectTo({
url: '/pages/user/discount/discount/discount',
})
},
/**
* 生命周期函数--监听页面初次渲染完成

@ -3,17 +3,20 @@
<image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到可用优惠券</view>
</view> -->
<view class="coupon coupon_back">
<view class="_left">
<text style=" font-size: 30px;">¥</text>
<!-- {{item.subtract}} -->50
<view class="coupon coupon_back{{item.is_received}}" wx:for="{{coupons_list}}">
<view class="_left color{{item.is_received}}">
<text style=" font-size: 30px;">¥</text>{{item.subtract}}
</view>
<view class="_right">
<view class="_ln">满{{item.full}}元可用</view>
<view class="_ln">
<!-- <text wx:for="{{item.drama_abb}}" wx:for-item='params'>{{params.short_name}}</text>可使用本张优惠券</view> -->
仅可购买部分演出
</view>
<view class="_right">
<!-- <view class="_ln">满{{item.full}}元可用</view> -->
<view class="_ln">满100元可用</view>
<view class="_ln">所有剧目可使用本张优惠券</view>
<view class="_ln">有效期至2021年10月1日</view>
</view>
<view class="_rightbtn" bindtap="collect_receive" data-id="2">领取</view>
<view class="_ln">有效期至{{item.end_date}}</view>
</view>
<view class="_rightbtn" bindtap="collect_receive" data-id="{{item.id}}" data-index='{{index}}' wx:if="{{!item.is_received}}">领取</view>
<view class="_rightbtn received" wx:else>已领取</view>
</view>
</view>
</view>
<button class="_button" bindtap="mydiscount">我的优惠券</button>

File diff suppressed because one or more lines are too long

@ -1,41 +1,43 @@
<van-tabs swipeable >
<van-tab title="可使用({{coupon_list?coupon_list.length:'0'}})" >
<van-tabs swipeable>
<van-tab title="可使用({{coupon_list?coupon_list.length:'0'}})">
<view wx:if="{{coupon_list.length==0}}" class="no_content">
<image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到可用优惠券</view>
</view>
<view wx:el class="coupon {{item.status==1?'couponA':'couponU'}}" wx:for="{{coupon_list}}" data-coupon_id='{{item.coupon_id}}' bindtap="use">
<view class="_left" style="{{item.status==1?'color: #FF1D42;':''}}">
<text style=" font-size: 30px;">¥</text>
{{item.subtract}}
<image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到可用优惠券</view>
</view>
<view class="_right">
<view class="_ln">满{{item.full}}元可用</view>
<view class="_ln" style="margin: 20rpx 0;">{{item.abb_num==0?'所有':(item.abb_num+'个')}}剧目可使用本张优惠券</view>
<view class="_ln">有效期至{{item.end_date}}</view>
<view wx:el class="coupon {{item.status==1?'couponA':'couponU'}}" wx:for="{{coupon_list}}"
data-coupon_id='{{item.coupon_id}}' bindtap="use">
<view class="_left" style="{{item.status==1?'color: #FF1D42;':''}}">
<text style=" font-size: 30px;">¥</text>{{item.subtract}}
</view>
<view class="_right">
<view class="_ln">满{{item.full}}元可用</view>
<!-- <view class="_ln" style="margin: 20rpx 0;">{{item.abb_num==0?'所有':(item.abb_num+'个')}}剧目可使用本张优惠券</view> -->
<view class="_ln">仅可购买部分演出</view>
<view class="_ln">有效期至{{item.end_date}}</view>
</view>
<view style="margin-left:auto;margin-right:20rpx">
<van-icon name="arrow" size="20" />
</view>
</view>
<van-icon name="arrow" size="20" custom-style=" margin: 0 20rpx;" />
</view>
</van-tab>
<van-tab title="已失效({{coupon_listU?coupon_listU.length:'0'}})">
<view wx:if="{{coupon_listU.length==0}}" class="no_content">
<image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到失效优惠券</view>
</view>
<view wx:el class="coupon couponU" style="color: #999999;" wx:for="{{coupon_listU}}">
<image class="image" src="/images/ui/kxmh.png" />
<image class="img" src="{{item.status==2?'/images/ui/coupon_ued.png':''}}" />
<image class="img" src="{{item.status==4?'/images/ui/coupon_passed.png':''}}" />
<view class="_left" >
<text style=" font-size: 30px;">¥</text>
{{item.subtract}}
<image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到失效优惠券</view>
</view>
<view class="_right1">
<view class="_ln1">满{{item.full}}元可用</view>
<view class="_ln2">有效期至{{item.end_date}}</view>
<view wx:el class="coupon couponU" style="color: #999999;" wx:for="{{coupon_listU}}">
<image class="image" src="/images/ui/kxmh.png" />
<image class="img" src="{{item.status==2?'/images/ui/coupon_ued.png':''}}" />
<image class="img" src="{{item.status==4?'/images/ui/coupon_passed.png':''}}" />
<view class="_left">
<text style=" font-size: 30px;">¥</text>
{{item.subtract}}
</view>
<view class="_right1">
<view class="_ln1">满{{item.full}}元可用</view>
<view class="_ln2">有效期至{{item.end_date}}</view>
</view>
</view>
</view>
</van-tab>
</van-tabs>
<button class="_button" bindtap="ex" >兑换优惠券</button>
<button class="_button" bindtap="ex">兑换优惠券</button>

File diff suppressed because one or more lines are too long

@ -1,6 +1,7 @@
import {
http
http,
location_city
} from '../../../../utils/util'
Page({
@ -19,13 +20,26 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let coupon_id = options.coupon_id
let city_id = getApp().globalData.city_id
http("/api/v1/coupon-cycle","post",{coupon_id,city_id}).then(res=>{
this.setData({IP_list:res})
if (!city_id) {
// 默认北京写法
location_city().then(res => {
let city_id = res.city_info.city_id
getApp().globalData.city_id = city_id
this.getip_list(coupon_id, city_id)
})
return
}
this.getip_list(coupon_id, city_id)
},
getip_list(coupon_id, city_id) {
http("/api/v1/coupon-cycle", "post", { coupon_id, city_id }).then(res => {
this.setData({ IP_list: res })
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

Loading…
Cancel
Save