|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view class="width90">
|
|
|
|
<view class="flright fotct">
|
|
|
|
<image class="coupon-img" :src="imageUrl+couponsDetails.highDiscount.discountImg"></image>
|
|
|
|
</view>
|
|
|
|
<view class="coupon-mes mart10" style="margin-right: 90px;">
|
|
|
|
<view class="fcor333 fontwig6 font24 width100 text2">{{couponsDetails.highDiscount.discountName}}</view>
|
|
|
|
<view class="fcor666 font13 width100 mart5">
|
|
|
|
活动截止时间:{{salesEndTime | formatDate('-')}}</view>
|
|
|
|
</view>
|
|
|
|
<view class="fcor666 font13 width100 mart5">
|
|
|
|
领取有效期:{{couponsDetails.highDiscount.effectiveDay}}天
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="line1 mart15"></view>
|
|
|
|
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" @click="getuserinfo"
|
|
|
|
withCredentials="true">点击领取</button>
|
|
|
|
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button>
|
|
|
|
<view class="width90 mart10 fcor666">去使用</view>
|
|
|
|
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666">
|
|
|
|
<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image>
|
|
|
|
</view>
|
|
|
|
<view class="product-list mart20 width90">
|
|
|
|
<view class="product" v-for="product in minecoupones" :key="product.id"
|
|
|
|
@tap="toGoods(product.highCoupon.id)">
|
|
|
|
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image>
|
|
|
|
<view class="name">{{ product.highCoupon.couponName }}</view>
|
|
|
|
<view class="info" v-if="product.highCoupon.payType == 1">
|
|
|
|
<view class="price">
|
|
|
|
¥{{ product.highCoupon.discountPrice}}
|
|
|
|
</view>
|
|
|
|
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice">
|
|
|
|
¥{{ product.highCoupon.salesPrice}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="info" v-else>
|
|
|
|
<view class="price">
|
|
|
|
<image style="width: 15px;height: 15px;vertical-align: sub;"
|
|
|
|
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAXdElEQVR4Xu1dCZhcVZX+z3v1Xnc6nfSW7qSTdDZAAgkJJC4EERCZEMF0V4UhRlkVRKPCDDKiA44iCIqMCMoyoowLiJAZyGDgC8IgiChLFkgngQAh6e50dzrpfa2qtx2/9yppeqmq917Vq6W7634fX4evzj33nHP/d9dzziXkyoS2AE1o7XPKIweACQ6CHAByAJjgFpjg6udGgBwAJrgFJrj6uREgB4DxZwHehAItf84ylBx3NqSS5YZYdDzkyRUQ5DyQz8fkE0mUBYj5kQ9A7TNID+lshDTSFYUNZQCG3knQm1jre0MYOPi8r+O1l2k1BsabtcbFCMAvwKdOXfVFiJPXQipebuRXFFNeiad9xWofhODBbmh9O0RoTwqTjn2Ijvthq6eNZIDZmAQAN99UoIfUT+nBlitZKjyV8ivKIUhp14XCHd0c7vqbKJfeIx4z9/+JvqxmoA+TajLtRktGWt6z/nhFV29B3rRVyC+dkgwvz+tqoTCCTZtkfeA6WvxQg+f8U8Qw6wHArbfPVLoOX00kXMn55dNSZAcAIZChAawAHAZx5GNmkoAh/zHJAHyxxTB59O59j0OHr8tf/tSm1MnrDeesBoBSe+FVXDDnR8if7tmETkYXSGsBaYcANfKX9A6X1syDIVWCpVmANNP6y0LxKB7cV39YCLbcLJ/y+L0uG0gbeVYCQN3yT9cbRQtvQEFVUbKWENQGkHoAUOph/hscSpZl9PqUD0OqAuQFMOR5YF/lIB2Zi8f2bTfKp76UdUDIKgDwa6etCBcc+ySVLCpHgvdUZPRDUPYAwVoIan1qOtsJVxMQ8rwIIPIWgoUpoO53DkuhfTW0/MVXnbBIB01WAIC3Li8Ii/M2omTpSvLlu9ebQxDDu4HQbgjKfnPmds8jpTUIRt5iGIWnA5pg0L5H7/SVHLiBPoyM7xoyDoDwmxd9lq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ZZZ0zKEL0GjHxxUAwjvWPY6yZWtiMmWGr+0OEGd/Kj2acgZw7ObYqhy8DWi51Yn9Mkajtk0CDcRIbUO8Xq7BfzkRzvEIEH77q02YMi/mcZYZxWM6eI6JYk4n5tYyRuExAAA9WAlujeVMy4/KfjiKx3AEAOabZKVBCELMF2IZTex+DEI4yso0SxERb2s5FgBg6PNgNEW3N4Ob8/yY5cT0jgCg7b70Yr1ocewrPQ5Car3dSXtZQWM7BbT/Hmi4KitkjSWETnPBMXcCgCTyh2g13rNTwhEAwrsuewLFiwKxmAnhXRC7/9eurez5ff6joOLVseUx9/K7T0jpXj5ZYxjCbBh1cfqX+Uo5gAft2nEGgLev2oMpxx4fc/jv2QQhtM2urcz/bl71zrghfucfldLcSh68FdaOIAsLC2bgSLyAGr5P9uNrdqI7A8B73+jGpBkxT2Gk9rsBvdOuLc9+z/qbQRM8HQ/DugNIUWGhDHpdnJ0e83NyACvtmncEgFDdzQb5jqRWH8lR74bU/lO7drz7fQzdDKZ0MWk6ita1xLQrM9fnBTDPzvC2ALCcPyZVHYlSHM1OCG6H2PtHu3Y8+31MXQx55AgS1XhCAbS69rh2lWpYJBuHDFsAhN+84GJM+1jMHYDQ+9SRPH2e9XFcRmMKAOb9wRuTU2MYkqDV98TlzeBFeX4MCS4cTW4LAP2NwI1a+YofxGrJ1/kbkDraWzU1WgM5AByxLE2CVh8/yTUxnyMFEDcMyxYAyo5//imXffRfY3Wo1PYTwOhNVX+P4psDwBGTmP6BdTFnZotIYA74Avi/eJ3jAADrfsdlyy6JysRQILXdlrbONxvKASBibqYS6PU2qQKYL7XLQmoLgPCOSzah7KTPROtlUpusiJ90FlsAmI4aLbeCe
|
|
|
|
</image>{{ product.highCoupon.discountPrice*100}}
|
|
|
|
</view>
|
|
|
|
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice">
|
|
|
|
<image style="width: 15px;height: 15px;vertical-align: sub;"
|
|
|
|
src="data:image/png;base64,iVBORw0KGgoAA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nBb1QFjgI3LBhw4Kenp5f5gBoPwB0d3efuHLlyr/EGgNwZq01ZeQ4QNOVwJkyCLRpAYjogFIq8H3lwBaAAWCM4fAjfXa9dLJU+RjA2r4/klIGRnCxAoDWehciHrWAboNEa3EtCXMA2BmKT3Erpd4dRG0FgHK5/C0hxFHny3IAwMQh02bBK1yvBNra3DZ6mBUAtNYeIn48CE1pfM9bADsr+75/WalUCrzcYAuAUxCRLxta0duJGI0qB0Cw3YhofGRkpN/zPH6ZtGmydqgxhi/JHzWqtG2SggSx/Z4lAPC5gAsvvLDpPQPXXYCNnYjoQaWUVVAlawBorX+AiEcxnSkAqMUWOPfcc218cITGFQBC2vmTUsr/sBE0DABWIOL1NkyTpGlVC3DppZfCggULQqnGB1T4ilnaiYgWKaXutynXGgCe53UXCgUOSmydx0aAsDStAkDQUbR6erTokum+arU6x/O8cRvbhnKmMYYvyr3EhnFSNO0EAFdhZsI0/7Z3Amv+CQsAjg+YaMzTIOA0AwCf42sUH2g637DxAZYtWzYRANo2taj2805h4AbQVB1CAYAzGmPGAKDb1hCu6Rr1xex4BoBtCgsA7v+57KDEB0r5VLLN2cQgXvw9TO0HgNDRQqMAgG+aLLIRPgkaHo3zQcypp3rZ+RzQwbb2s1xhAcB5eNWPZwG1aOL8N3Y4l1v75yIqeM1uIZ3PZwS8YrHIj3dZp9AAGBoaernv+xz7PHRea6ksCGuh3KPG7osCAAuxnJKEAQAv/iDiqVJKfsHFOkVyotb6cUR8T
|
|
|
|
</image>{{ product.highCoupon.salesPrice*100}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="width100 height60"></view>
|
|
|
|
<!-- <button class="coupne-btn width100" v-if="userInfo == 1" open-type="getUserInfo" lang="zh_CN"
|
|
|
|
@getuserinfo="getuserinfo" withCredentials="true">点击领取</button>
|
|
|
|
<button class="coupne-btn width100" v-else @click="receiveDiscount">点击领取</button> -->
|
|
|
|
<!-- <authorize></authorize> -->
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
getCouponByDiscount,
|
|
|
|
getDiscountByQrCode,
|
|
|
|
receiveDiscount,
|
|
|
|
HandleCode,
|
|
|
|
getUserInfo
|
|
|
|
} from '../../../Utils/Api.js';
|
|
|
|
// import authorize from '../../../components/Authorize';
|
|
|
|
let app = getApp();
|
|
|
|
export default {
|
|
|
|
// components: {
|
|
|
|
// authorize
|
|
|
|
// },
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
minecoupones: [],
|
|
|
|
imageUrl: app.globalData.imgUrl,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
isNoMoreData: false,
|
|
|
|
couponsDetails: '',
|
|
|
|
salesEndTime: '',
|
|
|
|
codes: '',
|
|
|
|
userInfo: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
filters: {
|
|
|
|
//过滤器 用于格式化时间
|
|
|
|
formatDate: function(value, spe = '/') {
|
|
|
|
let data = new Date(value);
|
|
|
|
let year = data.getFullYear();
|
|
|
|
let month = data.getMonth() + 1;
|
|
|
|
let day = data.getDate();
|
|
|
|
let h = data.getHours();
|
|
|
|
let mm = data.getMinutes();
|
|
|
|
let s = data.getSeconds();
|
|
|
|
month = month >= 10 ? month : "0" + month;
|
|
|
|
day = day >= 10 ? day : "0" + day;
|
|
|
|
h = h >= 10 ? h : "0" + h;
|
|
|
|
mm = mm >= 10 ? mm : "0" + mm;
|
|
|
|
s = s >= 10 ? s : "0" + s;
|
|
|
|
return `${year}${spe}${month}${spe}${day}`;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onLoad(options) {
|
|
|
|
if (app.globalData.userInfo) {
|
|
|
|
this.userInfo = 2;
|
|
|
|
} else {
|
|
|
|
this.userInfo = 1;
|
|
|
|
}
|
|
|
|
uni.login({
|
|
|
|
provider: 'weixin',
|
|
|
|
success: function(loginRes) {
|
|
|
|
app.globalData.code = loginRes.code;
|
|
|
|
// 请求接口
|
|
|
|
let params = {
|
|
|
|
code: app.globalData.code
|
|
|
|
}
|
|
|
|
HandleCode(params).then(res => {
|
|
|
|
if (res.return_code == '000000') {
|
|
|
|
app.globalData.openId = res.return_data.openId;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
var arr1 = decodeURIComponent(options.q);
|
|
|
|
var arr2 = arr1.split('=');
|
|
|
|
this.codes = arr2[2];
|
|
|
|
this.getDiscountByQrCode();
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
//获取卡券详情
|
|
|
|
getDiscountByQrCode() {
|
|
|
|
let params = {
|
|
|
|
code: this.codes
|
|
|
|
}
|
|
|
|
getDiscountByQrCode(params).then(res => {
|
|
|
|
if (res.return_code == '000000') {
|
|
|
|
this.couponsDetails = res.return_data;
|
|
|
|
this.salesEndTime = res.return_data.highDiscount.salesEndTime;
|
|
|
|
this.getCouponByDiscount(res.return_data.highDiscount.id);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
//根据优惠券查询卡券列表
|
|
|
|
getCouponByDiscount(item) {
|
|
|
|
let params = {
|
|
|
|
discountId: item
|
|
|
|
}
|
|
|
|
getCouponByDiscount(params).then(res => {
|
|
|
|
if (res.return_code == '000000') {
|
|
|
|
this.minecoupones = res.return_data;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
//领取
|
|
|
|
receiveDiscount() {
|
|
|
|
|
|
|
|
uni.showLoading({
|
|
|
|
title: '领取中...'
|
|
|
|
})
|
|
|
|
let params = {
|
|
|
|
codeId: this.couponsDetails.highDiscountAgentCode.id
|
|
|
|
}
|
|
|
|
receiveDiscount(params).then(res => {
|
|
|
|
if (res.return_code == '000000') {
|
|
|
|
uni.hideLoading();
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: res.return_data,
|
|
|
|
duration: 2000
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
uni.hideLoading();
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: res.return_msg,
|
|
|
|
duration: 2000
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
//获取登陆信息
|
|
|
|
getuserinfo() {
|
|
|
|
let that = this;
|
|
|
|
// wx.login({
|
|
|
|
// success(res) {
|
|
|
|
// if (res.code) {
|
|
|
|
// 发起网络请求
|
|
|
|
// var code = res.code;
|
|
|
|
// 获取微信用户信息
|
|
|
|
uni.getUserProfile({
|
|
|
|
desc: '登录中...',
|
|
|
|
success: function(res) {
|
|
|
|
let params = {
|
|
|
|
openId: app.globalData.openId,
|
|
|
|
iv: res.iv,
|
|
|
|
encryptedData: res.encryptedData
|
|
|
|
}
|
|
|
|
getUserInfo(params).then(res => {
|
|
|
|
if (res.return_code == '000000') {
|
|
|
|
uni.hideLoading();
|
|
|
|
app.globalData.userInfo = res
|
|
|
|
.return_data
|
|
|
|
.object
|
|
|
|
.highUser;
|
|
|
|
app.globalData.token = res
|
|
|
|
.return_data.uniqueCode;
|
|
|
|
uni.setStorage({
|
|
|
|
key: "user",
|
|
|
|
data: res.return_data
|
|
|
|
.object
|
|
|
|
.highUser
|
|
|
|
})
|
|
|
|
uni.setStorage({
|
|
|
|
key: "token",
|
|
|
|
data: res.return_data
|
|
|
|
.uniqueCode
|
|
|
|
})
|
|
|
|
that.receiveDiscount();
|
|
|
|
that.userInfo = 2;
|
|
|
|
} else {
|
|
|
|
uni.hideLoading();
|
|
|
|
uni.showToast({
|
|
|
|
title: res.return_msg,
|
|
|
|
icon: 'none',
|
|
|
|
duration: 2000
|
|
|
|
})
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
fail: res => {
|
|
|
|
uni.showToast({
|
|
|
|
title: "微信登录授权失败",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// } else {
|
|
|
|
// uni.showToast({
|
|
|
|
// title: "微信登录授权失败",
|
|
|
|
// icon: "none"
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
|
|
|
|
},
|
|
|
|
//商品跳转
|
|
|
|
toGoods(e) {
|
|
|
|
if (app.globalData.userInfo) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '../../order/confirmation?id=' + e
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '请点击领取后再使用',
|
|
|
|
duration: 2000
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.coupon-mes {
|
|
|
|
// margin-right: 90px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.coupon-img {
|
|
|
|
width: 80px;
|
|
|
|
height: 80px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.product-list {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
.product {
|
|
|
|
width: 48%;
|
|
|
|
border-radius: 20upx;
|
|
|
|
background-color: #fff;
|
|
|
|
margin: 0 0 15upx 0;
|
|
|
|
box-shadow: 0upx 5upx 25upx rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
|
|
image {
|
|
|
|
width: 100%;
|
|
|
|
border-radius: 20upx 20upx 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
width: 92%;
|
|
|
|
padding: 8upx 4%;
|
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
-webkit-line-clamp: 1;
|
|
|
|
text-align: justify;
|
|
|
|
overflow: hidden;
|
|
|
|
font-size: 30upx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.info {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: flex-end;
|
|
|
|
width: 92%;
|
|
|
|
padding: 10upx 4% 10upx 4%;
|
|
|
|
|
|
|
|
.price {
|
|
|
|
color: #e65339;
|
|
|
|
font-size: 30upx;
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
|
|
|
|
.slogan {
|
|
|
|
color: #807c87;
|
|
|
|
font-size: 24upx;
|
|
|
|
text-decoration: line-through;
|
|
|
|
margin-right: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.coupne-btn {
|
|
|
|
background-color: red;
|
|
|
|
color: #FFFFFF;
|
|
|
|
}
|
|
|
|
</style>
|