|
|
@ -16,11 +16,52 @@ |
|
|
|
<view class="line1 mart15"></view> |
|
|
|
<view class="line1 mart15"></view> |
|
|
|
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" |
|
|
|
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" |
|
|
|
@click="jumpres">点击领取</button> |
|
|
|
@click="jumpres">点击领取</button> |
|
|
|
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button> |
|
|
|
<button class="coupne-btn width60w mart20 marb20" |
|
|
|
<view class="width90 mart10 fcor666">去使用</view> |
|
|
|
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status == 1 && couponsDetails.highDiscount.usingRange != 5" |
|
|
|
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666"> |
|
|
|
@click="receiveDiscount">点击领取</button> |
|
|
|
|
|
|
|
<button class="coupne-btn width60w mart20 marb20" |
|
|
|
|
|
|
|
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status == 1 && couponsDetails.highDiscount.usingRange == 5" |
|
|
|
|
|
|
|
@click="receiveDiscount">点击领取</button> |
|
|
|
|
|
|
|
<view class="alijus width90 mart20" |
|
|
|
|
|
|
|
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status != 1 && couponsDetails.highDiscount.usingRange == 5"> |
|
|
|
|
|
|
|
<!-- <wx-open-launch-weapp style="width: 40%;margin-right: 5%;" id="launch-btn" username="gh_5fb54244cdbb"> |
|
|
|
|
|
|
|
<script type="text/wxtag-template"> |
|
|
|
|
|
|
|
<style> |
|
|
|
|
|
|
|
.btn { |
|
|
|
|
|
|
|
padding: 12px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.download { |
|
|
|
|
|
|
|
color: #ffffff; |
|
|
|
|
|
|
|
background: #0083f5; |
|
|
|
|
|
|
|
width:100%; |
|
|
|
|
|
|
|
height:100%; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
<button class="download btn" style="height:50px;width:100%;border:none;">立即使用</button> |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
</wx-open-launch-weapp> --> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="width40" style="margin-right: 5%;" @click="useDiscount"> |
|
|
|
|
|
|
|
<view class="width100 btnno fotct font16 ">立即使用</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="width40" style="margin-left: 5%;" @click="jumpCounlist"> |
|
|
|
|
|
|
|
<view class="width100 btnno fotct font16 ">立即查看</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="width90 mart10 fcor666" v-if="couponsDetails.highDiscount.usingRange != 5">去使用</view> |
|
|
|
|
|
|
|
<view v-if="minecoupones == '' && couponsDetails.highDiscount.usingRange != 5" |
|
|
|
|
|
|
|
class="mart60 fotct font14 fcor666"> |
|
|
|
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> |
|
|
|
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="width90 mart30" v-if="couponsDetails.highDiscount.usingRange == 5"> |
|
|
|
|
|
|
|
<image :src="imagewxUrl+imgadres1" mode="widthFix" class="width100" v-if="couponsDetails.highDiscountAgentCode.status ==1"></image> |
|
|
|
|
|
|
|
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="width100" v-if="couponsDetails.highDiscountAgentCode.status != 1"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="product-list mart20 width90"> |
|
|
|
<view class="product-list mart20 width90"> |
|
|
|
<view class="product" v-for="product in minecoupones" :key="product.id" |
|
|
|
<view class="product" v-for="product in minecoupones" :key="product.id" |
|
|
|
@tap="toGoods(product.highCoupon.id)"> |
|
|
|
@tap="toGoods(product.highCoupon.id)"> |
|
|
@ -51,6 +92,34 @@ |
|
|
|
@getuserinfo="getuserinfo" withCredentials="true">点击领取</button> |
|
|
|
@getuserinfo="getuserinfo" withCredentials="true">点击领取</button> |
|
|
|
<button class="coupne-btn width100" v-else @click="receiveDiscount">点击领取</button> --> |
|
|
|
<button class="coupne-btn width100" v-else @click="receiveDiscount">点击领取</button> --> |
|
|
|
<!-- <authorize></authorize> --> |
|
|
|
<!-- <authorize></authorize> --> |
|
|
|
|
|
|
|
<view :style="{display: usercouFeedbackHidden}" class="popup_content"> |
|
|
|
|
|
|
|
<view class="popup_title font18 fcor333 fontwig6 paddtop10">温馨提示</view> |
|
|
|
|
|
|
|
<view class="popup_title font16 fcor666 paddtop20 height60">领取优惠券后请在有效期三十天内使用</view> |
|
|
|
|
|
|
|
<view class="width100 bor-botm1 mart10"></view> |
|
|
|
|
|
|
|
<view class="alijus width90 mart20"> |
|
|
|
|
|
|
|
<view class="width40" style="margin-right: 5%;" @click="hideDiv()"> |
|
|
|
|
|
|
|
<view class="width100 btnno font16 ">取消</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<wx-open-launch-weapp style="width: 40%;margin-left: 5%;" id="launch-btn" username="gh_5fb54244cdbb"> |
|
|
|
|
|
|
|
<script type="text/wxtag-template"> |
|
|
|
|
|
|
|
<style> |
|
|
|
|
|
|
|
.download { |
|
|
|
|
|
|
|
color: #ffffff; |
|
|
|
|
|
|
|
background: #0083f5; |
|
|
|
|
|
|
|
width:100%; |
|
|
|
|
|
|
|
height:100%; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
<button class="download" style="height:40px;line-height: 40PX;width:100%;border:none;">立即使用</button> |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
</wx-open-launch-weapp> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="popup_overlay" :style="{display: usercouFeedbackHidden}" @click="hideDiv()"></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -62,8 +131,13 @@ |
|
|
|
HandleCode, |
|
|
|
HandleCode, |
|
|
|
getUserInfo, |
|
|
|
getUserInfo, |
|
|
|
getH5AccessToken, |
|
|
|
getH5AccessToken, |
|
|
|
loginByPhone |
|
|
|
loginByPhone, |
|
|
|
|
|
|
|
verifyWx, |
|
|
|
|
|
|
|
useDiscount |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
|
|
|
|
var wx = require('jweixin-module'); |
|
|
|
|
|
|
|
// #endif |
|
|
|
let app = getApp(); |
|
|
|
let app = getApp(); |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
@ -72,13 +146,16 @@ |
|
|
|
imageUrl: app.globalData.imgUrl, |
|
|
|
imageUrl: app.globalData.imgUrl, |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imgadres: 'noorder.png', |
|
|
|
imgadres: 'noorder.png', |
|
|
|
|
|
|
|
imgadres1: 'noCoupon.jpg', |
|
|
|
|
|
|
|
imgadres2: 'onCoupon.jpg', |
|
|
|
pageNum: 1, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
isNoMoreData: false, |
|
|
|
isNoMoreData: false, |
|
|
|
couponsDetails: '', |
|
|
|
couponsDetails: '', |
|
|
|
salesEndTime: '', |
|
|
|
salesEndTime: '', |
|
|
|
codes: '', |
|
|
|
codes: '', |
|
|
|
userInfo: '' |
|
|
|
userInfo: '', |
|
|
|
|
|
|
|
usercouFeedbackHidden: 'none', // 默认隐藏 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
filters: { |
|
|
@ -124,6 +201,34 @@ |
|
|
|
this.getDiscountByQrCode(); |
|
|
|
this.getDiscountByQrCode(); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '加载中' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
let url = window.location.href.split('#')[0]; |
|
|
|
|
|
|
|
let datas = { |
|
|
|
|
|
|
|
url: url |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
verifyWx(datas).then(res => { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
wx.config({ |
|
|
|
|
|
|
|
debug: false, // 开启调试模式,返回值会在客户端alert出来。 |
|
|
|
|
|
|
|
appId: res.return_data.appId, // 必填,公众号的唯一标识 |
|
|
|
|
|
|
|
timestamp: res.return_data.timestamp, // 必填,生成签名的时间戳 |
|
|
|
|
|
|
|
nonceStr: res.return_data.nonceStr, // 必填,生成签名的随机串 |
|
|
|
|
|
|
|
signature: res.return_data.signature, // 必填,签名 |
|
|
|
|
|
|
|
jsApiList: ['onMenuShareTimeline'], // 必填,需要使用的JS接口列表 |
|
|
|
|
|
|
|
openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
wx.ready(function(res) {}); |
|
|
|
|
|
|
|
wx.error(function(err) {}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
//获取卡券详情 |
|
|
|
//获取卡券详情 |
|
|
|
getDiscountByQrCode() { |
|
|
|
getDiscountByQrCode() { |
|
|
@ -151,6 +256,30 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//使用优惠券 |
|
|
|
|
|
|
|
useDiscount() { |
|
|
|
|
|
|
|
let datas = { |
|
|
|
|
|
|
|
discountAgentCodeId: this.couponsDetails.highDiscountAgentCode.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
useDiscount(datas).then(res => { |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
this.onhiddle(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//弹出框 |
|
|
|
|
|
|
|
onhiddle() { |
|
|
|
|
|
|
|
this.usercouFeedbackHidden = 'block'; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
hideDiv() { // 隐藏输入弹出框 |
|
|
|
|
|
|
|
this.usercouFeedbackHidden = 'none'; |
|
|
|
|
|
|
|
}, |
|
|
|
//根据优惠券查询卡券列表 |
|
|
|
//根据优惠券查询卡券列表 |
|
|
|
getCouponByDiscount(item) { |
|
|
|
getCouponByDiscount(item) { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
@ -179,6 +308,7 @@ |
|
|
|
title: res.return_data, |
|
|
|
title: res.return_data, |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.getDiscountByQrCode(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -266,6 +396,12 @@ |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//跳转列表 |
|
|
|
|
|
|
|
jumpCounlist(){ |
|
|
|
|
|
|
|
uni.reLaunch({ |
|
|
|
|
|
|
|
url:'/pages/user/coupon/coupon' |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -277,6 +413,43 @@ |
|
|
|
// margin-right: 90px; |
|
|
|
// margin-right: 90px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.popup_content { |
|
|
|
|
|
|
|
position: fixed; |
|
|
|
|
|
|
|
top: 40%; |
|
|
|
|
|
|
|
left: 50%; |
|
|
|
|
|
|
|
width: 520upx; |
|
|
|
|
|
|
|
height: 400upx; |
|
|
|
|
|
|
|
margin-left: -270upx; |
|
|
|
|
|
|
|
margin-top: -270upx; |
|
|
|
|
|
|
|
border: 10px solid white; |
|
|
|
|
|
|
|
background-color: white; |
|
|
|
|
|
|
|
z-index: 1002; |
|
|
|
|
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
border-radius: 20upx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.popup_title { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
width: 480upx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 弹窗 |
|
|
|
|
|
|
|
.popup_overlay { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
position: fixed; |
|
|
|
|
|
|
|
top: 0%; |
|
|
|
|
|
|
|
left: 0%; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
height: 100%; |
|
|
|
|
|
|
|
background-color: black; |
|
|
|
|
|
|
|
z-index: 1001; |
|
|
|
|
|
|
|
-moz-opacity: 0.8; |
|
|
|
|
|
|
|
opacity: .80; |
|
|
|
|
|
|
|
filter: alpha(opacity=88); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.coupon-img { |
|
|
|
.coupon-img { |
|
|
|
width: 80px; |
|
|
|
width: 80px; |
|
|
|
height: 80px; |
|
|
|
height: 80px; |
|
|
@ -337,4 +510,13 @@ |
|
|
|
background-color: red; |
|
|
|
background-color: red; |
|
|
|
color: #FFFFFF; |
|
|
|
color: #FFFFFF; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.btnno { |
|
|
|
|
|
|
|
height: 40px; |
|
|
|
|
|
|
|
line-height: 40PX; |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
color: #ffffff; |
|
|
|
|
|
|
|
background: #999999; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|