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

develop
mice2333 4 years ago
commit 6064ce17fb

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

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

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

@ -3,17 +3,20 @@
<image class="img" src="/images/ui/none.png" /> <image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到可用优惠券</view> <view class="warn">还未查询到可用优惠券</view>
</view> --> </view> -->
<view class="coupon coupon_back"> <view class="coupon coupon_back{{item.is_received}}" wx:for="{{coupons_list}}">
<view class="_left"> <view class="_left color{{item.is_received}}">
<text style=" font-size: 30px;">¥</text> <text style=" font-size: 30px;">¥</text>{{item.subtract}}
<!-- {{item.subtract}} -->50 </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>
<view class="_right"> <view class="_ln">有效期至{{item.end_date}}</view>
<!-- <view class="_ln">满{{item.full}}元可用</view> --> </view>
<view class="_ln">满100元可用</view> <view class="_rightbtn" bindtap="collect_receive" data-id="{{item.id}}" data-index='{{index}}' wx:if="{{!item.is_received}}">领取</view>
<view class="_ln">所有剧目可使用本张优惠券</view> <view class="_rightbtn received" wx:else>已领取</view>
<view class="_ln">有效期至2021年10月1日</view>
</view>
<view class="_rightbtn" bindtap="collect_receive" data-id="2">领取</view>
</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-tabs swipeable > <van-tab title="可使用({{coupon_list?coupon_list.length:'0'}})">
<van-tab title="可使用({{coupon_list?coupon_list.length:'0'}})" >
<view wx:if="{{coupon_list.length==0}}" class="no_content"> <view wx:if="{{coupon_list.length==0}}" class="no_content">
<image class="img" src="/images/ui/none.png" /> <image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到可用优惠券</view> <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}}
</view> </view>
<view class="_right"> <view wx:el class="coupon {{item.status==1?'couponA':'couponU'}}" wx:for="{{coupon_list}}"
<view class="_ln">满{{item.full}}元可用</view> data-coupon_id='{{item.coupon_id}}' bindtap="use">
<view class="_ln" style="margin: 20rpx 0;">{{item.abb_num==0?'所有':(item.abb_num+'个')}}剧目可使用本张优惠券</view> <view class="_left" style="{{item.status==1?'color: #FF1D42;':''}}">
<view class="_ln">有效期至{{item.end_date}}</view> <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> </view>
<van-icon name="arrow" size="20" custom-style=" margin: 0 20rpx;" />
</view>
</van-tab> </van-tab>
<van-tab title="已失效({{coupon_listU?coupon_listU.length:'0'}})"> <van-tab title="已失效({{coupon_listU?coupon_listU.length:'0'}})">
<view wx:if="{{coupon_listU.length==0}}" class="no_content"> <view wx:if="{{coupon_listU.length==0}}" class="no_content">
<image class="img" src="/images/ui/none.png" /> <image class="img" src="/images/ui/none.png" />
<view class="warn">还未查询到失效优惠券</view> <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}}
</view> </view>
<view class="_right1"> <view wx:el class="coupon couponU" style="color: #999999;" wx:for="{{coupon_listU}}">
<view class="_ln1">满{{item.full}}元可用</view> <image class="image" src="/images/ui/kxmh.png" />
<view class="_ln2">有效期至{{item.end_date}}</view> <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>
</view>
</van-tab> </van-tab>
</van-tabs> </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 { import {
http http,
location_city
} from '../../../../utils/util' } from '../../../../utils/util'
Page({ Page({
@ -19,13 +20,26 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let coupon_id = options.coupon_id let coupon_id = options.coupon_id
let city_id = getApp().globalData.city_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