|
@@ -70,7 +70,7 @@
|
|
|
</text>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 领券弹窗-->
|
|
|
+ <!-- 会员日注册领券弹窗-->
|
|
|
<van-popup
|
|
|
:show="twenty&first"
|
|
|
:close-on-click-overlay="false"
|
|
@@ -92,7 +92,7 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="flex justify-center margin-top-xl padding-top-xs">
|
|
|
- <text class="time margin-right-xs">
|
|
|
+ <text class="experience time margin-right-xs">
|
|
|
10
|
|
|
</text>
|
|
|
<text class="time_text margin-top-xs">
|
|
@@ -107,6 +107,94 @@
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
|
|
|
+ <!-- 外发领券弹窗-->
|
|
|
+ <van-popup
|
|
|
+ :show="is_outShow"
|
|
|
+ :close-on-click-overlay="false"
|
|
|
+ custom-class="pop"
|
|
|
+ overlay
|
|
|
+ z-index="99"
|
|
|
+ >
|
|
|
+ <div class="quan_container padding-tb-xl">
|
|
|
+ <view class=" margin-top-xs flex justify-center">
|
|
|
+ <text class="title">
|
|
|
+ {{outCouponData.name}}
|
|
|
+ </text>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="flex justify-center">
|
|
|
+ <text class="text-xs" v-if="outCouponData.validity_time.type==1">
|
|
|
+ {{outCouponData.validity_time.time_format}} 之前领取有效
|
|
|
+ </text>
|
|
|
+ <text class="text-xs" v-else>
|
|
|
+ {{outCouponData.validity_time.start_time_format}} 至 {{outCouponData.validity_time.end_time_format}} 之前领取有效
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <!-- 核销 -->
|
|
|
+ <view class="flex justify-center margin-top-xl padding-top-xs" v-if="outCouponData.type==1">
|
|
|
+ <text class="hexiao time margin-right-xs">
|
|
|
+ {{ outCouponData.discount.time }}
|
|
|
+ </text>
|
|
|
+ <text class="time_text margin-top-xs" v-if="outCouponData.discount.type==0">
|
|
|
+ 分钟
|
|
|
+ </text>
|
|
|
+ <text class="time_text margin-top-xs" v-else>
|
|
|
+ 次
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <!-- 满减 -->
|
|
|
+ <view class="flex justify-center margin-top-xl padding-top-xs margin-left-xs" v-if="outCouponData.type==2">
|
|
|
+ <text class="time_text margin-top-xs">
|
|
|
+ 满
|
|
|
+ </text>
|
|
|
+ <text class="manjian time margin-lr-xs">
|
|
|
+ {{ outCouponData.discount.full }}
|
|
|
+ </text>
|
|
|
+ <text class="time_text margin-top-xs">
|
|
|
+ 减
|
|
|
+ </text>
|
|
|
+ <text class="manjian time margin-left-xs">
|
|
|
+ {{ outCouponData.discount.reduce }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <!-- 折扣 -->
|
|
|
+ <view class="flex justify-center margin-top-xl padding-top-xs margin-left-xs" v-if="outCouponData.type==3">
|
|
|
+ <text class="time_text margin-top-xs">
|
|
|
+ 打
|
|
|
+ </text>
|
|
|
+ <text class="discount time margin-lr-sm">
|
|
|
+ {{ outCouponData.discount.discount*10 }}
|
|
|
+ </text>
|
|
|
+ <text class="time_text margin-top-xs">
|
|
|
+ 折
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <!-- 随机 -->
|
|
|
+ <view class="flex justify-center margin-top-xl padding-top-xs margin-left-xs" v-if="outCouponData.type==4">
|
|
|
+ <text class="time_text margin-top-xs">
|
|
|
+ 随机
|
|
|
+ </text>
|
|
|
+ <text class="random time margin-lr-xs">
|
|
|
+ {{ outCouponData.discount.start }}
|
|
|
+ </text>
|
|
|
+ <text class="time_text margin-top-xs">
|
|
|
+ 至
|
|
|
+ </text>
|
|
|
+ <text class="random time margin-lr-xs">
|
|
|
+ {{ outCouponData.discount.end }}
|
|
|
+ </text>
|
|
|
+ <text class="time_text margin-top-xs">
|
|
|
+ 元
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="flex justify-center margin-top-xl">
|
|
|
+ <button class="cu-btn get_btn text-white" @click="get_coupon">领取</button>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+
|
|
|
<!-- 窗口弹出-->
|
|
|
<van-popup :show="pop_show" @close="close_pop" round>
|
|
|
<div class="err_container flex flex-direction align-center justify-around">
|
|
@@ -130,10 +218,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { userUpdateLoginTime } from "../../requests/user";
|
|
|
-import { couponReceiveFirst, couponReceiveFirstID } from "../../requests/coupons";
|
|
|
+import { userUpdateLoginTime} from "../../requests/user";
|
|
|
+import { couponReceiveFirst, couponReceiveFirstID, outputCoupon, couponReceive } from "../../requests/coupons";
|
|
|
import Toast from "../../../static/vant/toast/toast";
|
|
|
import { reload_userinfo } from "../../utils/user";
|
|
|
+import { timestampTwoNum } from "../../utils/index";
|
|
|
import user_store from "@/store/index";
|
|
|
|
|
|
var $this;
|
|
@@ -149,18 +238,36 @@ export default {
|
|
|
receive: 0,
|
|
|
invite_code: false,
|
|
|
twenty: false,
|
|
|
+ //外发
|
|
|
+ output: false,
|
|
|
+ is_outShow: false,
|
|
|
+ outCouponData:{
|
|
|
+ type:Number,
|
|
|
+ validity_time:{
|
|
|
+ type:Number
|
|
|
+ },
|
|
|
+ discount:{
|
|
|
+ type:Number
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ //会员日注册领取体验卡
|
|
|
get_ticket() {
|
|
|
if ($this.receive == 0) {
|
|
|
$this.receive += 1;
|
|
|
console.log($this.receive);
|
|
|
$this.first = false;
|
|
|
- let ID
|
|
|
+ let params
|
|
|
couponReceiveFirstID().then((res)=>{
|
|
|
- ID = res.data.data.coupon_category_id
|
|
|
- couponReceiveFirst(ID).then((res) => {
|
|
|
+ let resData = res.data.data
|
|
|
+ params={
|
|
|
+ ID: resData.coupon_category_id,
|
|
|
+ start_time: resData.validity_time.start_time,
|
|
|
+ end_time: resData.validity_time.end_time,
|
|
|
+ }
|
|
|
+ couponReceiveFirst(params).then((res) => {
|
|
|
let $res = res.data;
|
|
|
if ($res.code == 0) {
|
|
|
$this.first = false;
|
|
@@ -179,6 +286,31 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ //领取外发卡券
|
|
|
+ get_coupon(){
|
|
|
+ wx.setStorageSync("is_out", false);
|
|
|
+ couponReceive($this.outCouponData).then((res) => {
|
|
|
+ let $res = res.data;
|
|
|
+ if ($res.code == 0) {
|
|
|
+ Toast.success({
|
|
|
+ message: $res.errmsg,
|
|
|
+ duration:800,
|
|
|
+ onClose() {
|
|
|
+ reload_userinfo($this);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $this.is_outShow = false
|
|
|
+ } else {
|
|
|
+ Toast.fail({
|
|
|
+ message: $res.errmsg,
|
|
|
+ duration:800,
|
|
|
+ })
|
|
|
+ $this.is_outShow = false
|
|
|
+ }
|
|
|
+ }).catch((err)=>{
|
|
|
+ console.log("错误",err)
|
|
|
+ })
|
|
|
+ },
|
|
|
//修改第一次登录状态
|
|
|
close_pop() {
|
|
|
this.pop_show = false;
|
|
@@ -207,7 +339,28 @@ export default {
|
|
|
mounted() {
|
|
|
$this.first = wx.getStorageSync("is_first");
|
|
|
$this.invite_code = wx.getStorageSync("code");
|
|
|
+ //外发
|
|
|
+ $this.output = wx.getStorageSync("is_out");
|
|
|
reload_userinfo($this);
|
|
|
+
|
|
|
+ //获取外发数据
|
|
|
+ if($this.output == true){
|
|
|
+ outputCoupon().then((res)=>{
|
|
|
+ if(res.data.code == 0){
|
|
|
+ let $newData = res.data.data
|
|
|
+ $newData.validity_time['start_time_format'] = timestampTwoNum($newData.validity_time['start_time'])
|
|
|
+ $newData.validity_time['end_time_format'] = timestampTwoNum($newData.validity_time['end_time'])
|
|
|
+ $newData.validity_time['time_format'] = timestampTwoNum($newData.validity_time['time'])
|
|
|
+
|
|
|
+ $this.outCouponData = $newData
|
|
|
+ console.log('外发数据:',$this.outCouponData)
|
|
|
+ $this.is_outShow = true
|
|
|
+ }else{
|
|
|
+ wx.setStorageSync("is_out", false);
|
|
|
+ $this.output = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
//判断是否每月20号
|
|
|
let day = new Date().getDate();
|
|
@@ -305,12 +458,21 @@ export default {
|
|
|
|
|
|
/*分钟数*/
|
|
|
.quan_container .time {
|
|
|
- font-size: 36px;
|
|
|
font-weight: bold;
|
|
|
color: #6858C4;
|
|
|
- line-height: 24px;
|
|
|
}
|
|
|
-
|
|
|
+.experience{
|
|
|
+ font-size: 36px;
|
|
|
+ line-height: 20px;
|
|
|
+}
|
|
|
+.hexiao,.discount{
|
|
|
+ font-size: 36px;
|
|
|
+ line-height: 7px;
|
|
|
+}
|
|
|
+.manjian,.random{
|
|
|
+ font-size: 28px;
|
|
|
+ line-height: 7px;
|
|
|
+}
|
|
|
/*分钟二字*/
|
|
|
.quan_container .time_text {
|
|
|
font-size: 12px;
|