Commit 5469705f authored by leiqingsong's avatar leiqingsong

修改一下优惠券选择器加上ID

parent 9baf0ca0
......@@ -22,3 +22,4 @@ dist.zip
*.sln
*.sw?
package-lock.json
sh.exe.stackdump
Stack trace:
Frame Function Args
00000010000 0018006133E (0018025BEB0, 0018024E199, 00000010000, 000FFFFBA20)
00000010000 00180049229 (00100002000, 00000000002, 00000000002, 00180338F90)
00000010000 00180049262 (00000000002, 001803392A0, 00000010000, 00000000008)
00000010000 0018005A98C (000FFFFCC72, 000FFFFCC55, 00000000000, 0018024E48F)
000FFFFCCD0 0018005AA30 (645C655C725C635C, 695C745C6E5C655C, 6D5C2D5C6C5C615C, 675C615C6E5C615C)
000FFFFCCD0 001800499EC (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 00180048343 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 001800483F4 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace
......@@ -205,7 +205,7 @@ export default {
};
console.log("params", params);
APi_Active.isMember(params).then(res => {
this.isMember = res.data.vipId !== "";
this.isMember = res.data.vipId != null;
this.userBaseInfo.vipId = res.data.vipId;
this.userBaseInfo.mobile = res.data.mobile;
this.userBaseInfo.name = res.data.name;
......@@ -246,7 +246,6 @@ export default {
unionId: this.userBaseInfo.unionid,
vipId: this.userBaseInfo.vipId
};
console.log("领取", params);
APi_Active.collectMyCoupon(params).then(res => {
this.showAward = false;
this.$toast(
......@@ -309,7 +308,7 @@ export default {
this.$toast("活动已结束");
return false;
}
if (!this.userBaseInfo.vipId) {
if (this.userBaseInfo.vipId === null) {
this.$toast("非会员,");
let url = "http://oysales.oywanhao.com/register";
window.location.href = url;
......
......@@ -117,7 +117,7 @@
@blur="totalLimit_show = false"
/>
</div>
</template> -->
</template>-->
</van-cell>
<van-cell
:required="true"
......@@ -191,8 +191,7 @@ export default {
totalLimit_show: false
};
},
created() {
},
created() {},
methods: {
openStartTime() {
this.startShow = true;
......@@ -259,7 +258,6 @@ export default {
}
},
getCoupons() {
console.log("获取优惠券");
let id = sessionStorage.getItem("oyStallCode") || 1;
API_Active.getAllCouponsByOyStallCode(id).then(res => {
if (res.data.length === 0 || !res.data.length) {
......@@ -268,7 +266,13 @@ export default {
this.$router.push("/");
}, 500);
} else {
this.coupons = res.data;
let temp = [];
res.data.forEach(i => {
let item = i;
item.name = i.name + " ID:" + i.id;
temp.push(item);
});
this.coupons = temp;
}
});
},
......
......@@ -338,6 +338,7 @@ import { Toast } from "vant";
export default {
data() {
return {
can_create: true,
minStartDate: null,
minEndDate: null,
// 选择优惠券 当前下标
......@@ -519,13 +520,20 @@ export default {
},
// 选择优惠券
onSelect(val) {
console.log(val);
this.prizeList[this.current_index].checked_coupon = val;
this.show = false;
},
getCoupons() {
let id = sessionStorage.getItem("oyStallCode") || 1;
API_Active.getAllCouponsByOyStallCode(id).then(res => {
this.coupons = res.data;
let temp = [];
res.data.forEach(i => {
let item = i;
item.name = i.name + ' ID:' + i.id;
temp.push(item);
})
this.coupons = temp;
});
},
afterImgRead(file) {
......@@ -582,6 +590,9 @@ export default {
// console.log(val);
},
handleCreate() {
if (!this.can_create) {
return false;
}
if (
this.basicInfo.title == "" ||
this.basicInfo.startTime1 == "" ||
......@@ -696,6 +707,7 @@ export default {
return false;
}
Toast.success("创建成功");
this.can_create = true;
setTimeout(() => {
this.$router.push({
name: "createSuccess",
......
<template>
<div class="contain">
<div class="box" v-for="(item,index) in list" :key="index" @click="handleCoupon(item.id)">
<div class="name">{{ item.name }}</div>
<div class="name">{{ item.name }} ID: {{ item.id }}</div>
<div class="nr">
<div class="left" >
<div class="price">¥{{ item.unit }}</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment