|
|
@@ -31,13 +31,36 @@
|
|
|
</div>
|
|
|
<div class="item" v-for="(item, i) in list" :key="item.id">
|
|
|
<div class="user">
|
|
|
- <img :src="item.packageImg" class="avatar" />
|
|
|
- <div class="info">
|
|
|
+ <div class="coupon-img" v-if="brand">
|
|
|
+ {{ item.coupon.price }}
|
|
|
+ </div>
|
|
|
+ <img v-else :src="item.packageImg" class="avatar" />
|
|
|
+ <div class="info" v-if="brand">
|
|
|
+ <div class="tag">立减券</div>
|
|
|
+ <div class="name">{{ item.coupon.name }}</div>
|
|
|
+ <div class="desc">{{ item.coupon.title }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="info" v-else>
|
|
|
<div class="name">{{ item.name }}</div>
|
|
|
<div class="time">¥{{ item.price }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="items">
|
|
|
+ <div class="items" v-if="brand">
|
|
|
+ <img src="../static/svgs/icon_yihexiao.svg" class="hexiao-img" alt="" />
|
|
|
+ <div class="row">
|
|
|
+ <div class="name">核销时间</div>
|
|
|
+ <div class="num">{{ item.useTime }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="row">
|
|
|
+ <div class="name">使用门店</div>
|
|
|
+ <div class="num">{{ item.coupon.store }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="row row-start">
|
|
|
+ <div class="name">套餐详情</div>
|
|
|
+ <div class="num" v-html="item.coupon.content"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="items" v-else>
|
|
|
<img src="../static/svgs/icon_yihexiao.svg" class="hexiao-img" alt="" />
|
|
|
<!-- <div class="row head">
|
|
|
<div class="name">项目名称</div>
|
|
|
@@ -108,7 +131,14 @@
|
|
|
扫码核销
|
|
|
</div>
|
|
|
|
|
|
- <order-card :show="showScan" @close="closeScan" :info="orderInfo"></order-card>
|
|
|
+ <order-card
|
|
|
+ :show="showScan"
|
|
|
+ :userCoupon="userCoupon"
|
|
|
+ :couponInfo="couponInfo"
|
|
|
+ @close="closeScan"
|
|
|
+ :info="orderInfo"
|
|
|
+ :isCoupon="isCoupon"
|
|
|
+ ></order-card>
|
|
|
</scroll-view>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -129,7 +159,10 @@ export default {
|
|
|
img: ''
|
|
|
},
|
|
|
showScan: false,
|
|
|
- brand: false
|
|
|
+ brand: false,
|
|
|
+ couponInfo: {},
|
|
|
+ userCoupon: {},
|
|
|
+ isCoupon: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -154,29 +187,42 @@ export default {
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
console.log(options);
|
|
|
- var id = 0;
|
|
|
+ var orderId = 0;
|
|
|
+ var userCouponId = 0;
|
|
|
if (options.orderId) {
|
|
|
- id = options.orderId;
|
|
|
+ orderId = options.orderId;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (options.userCouponId) {
|
|
|
+ userCouponId = options.userCouponId;
|
|
|
}
|
|
|
|
|
|
if (options.q) {
|
|
|
let query = decodeURIComponent(options.q).split('?orderId=');
|
|
|
if (query.length > 1) {
|
|
|
let q = query[1].split('&time=');
|
|
|
- id = q[0];
|
|
|
+ orderId = q[0];
|
|
|
+ } else {
|
|
|
+ query = decodeURIComponent(options.q).split('?userCouponId=');
|
|
|
+ if (query.length > 1) {
|
|
|
+ userCouponId = query[1];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if (id) {
|
|
|
- this.getOrderInfo(id);
|
|
|
+ if (orderId) {
|
|
|
+ this.getOrderInfo(orderId);
|
|
|
+ } else if (userCouponId) {
|
|
|
+ this.getCouponInfo(userCouponId);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getData() {
|
|
|
this.$http.get(`/attractions/get/${this.userInfo.attractionsId}`).then(res => {
|
|
|
this.brand = res.brand;
|
|
|
+ console.log('品牌核销员', this.brand);
|
|
|
|
|
|
this.$http
|
|
|
- .postJson(res.brand ? '/userCoupon/all' : '/userPackageFlow/writeOffAll1', {
|
|
|
+ .postJson(this.brand ? '/userCoupon/all' : '/userPackageFlow/writeOffAll1', {
|
|
|
page: this.page,
|
|
|
sort: 'createdAt,desc',
|
|
|
query: {
|
|
|
@@ -203,6 +249,11 @@ export default {
|
|
|
if (q[0]) {
|
|
|
this.getOrderInfo(q[0]);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ query = res.result.split('?userCouponId=');
|
|
|
+ if (query.length > 1) {
|
|
|
+ this.getCouponInfo(query[1]);
|
|
|
+ }
|
|
|
}
|
|
|
// let id = base64.decode(res.result);
|
|
|
// if (!isNaN(Number(id))) {
|
|
|
@@ -249,6 +300,29 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ getCouponInfo(userCouponId) {
|
|
|
+ wx.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ this.$mp.page.getTabBar().setData({ show: false });
|
|
|
+ this.$http
|
|
|
+ .get(`/userCoupon/get/${userCouponId}`)
|
|
|
+ .then(res => {
|
|
|
+ this.userCoupon = res;
|
|
|
+ this.$http.get(`/coupon/get/${res.couponId}`).then(res => {
|
|
|
+ this.couponInfo = res;
|
|
|
+ this.showScan = true;
|
|
|
+ this.isCoupon = true;
|
|
|
+ });
|
|
|
+ wx.hideLoading();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: e.error
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
closeScan() {
|
|
|
this.page = 0;
|
|
|
this.getData();
|
|
|
@@ -311,6 +385,26 @@ page {
|
|
|
border-radius: 8px;
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
+
|
|
|
+ .coupon-img {
|
|
|
+ padding: 0 8px;
|
|
|
+ height: 72px;
|
|
|
+ background: linear-gradient(271deg, #fe9b45 0%, #ffae50 100%);
|
|
|
+ border-radius: 8px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 40px;
|
|
|
+ line-height: 72px;
|
|
|
+ .flex();
|
|
|
+ align-items: flex-end;
|
|
|
+ &::before {
|
|
|
+ content: '¥';
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
.info {
|
|
|
margin-left: 12px;
|
|
|
.flex-col();
|
|
|
@@ -330,6 +424,25 @@ page {
|
|
|
font-size: 14px;
|
|
|
color: @text4;
|
|
|
}
|
|
|
+
|
|
|
+ .tag {
|
|
|
+ align-self: flex-start;
|
|
|
+ padding: 0 4px;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #f9692a;
|
|
|
+ line-height: 18px;
|
|
|
+ height: 18px;
|
|
|
+ background: #ffd984;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .desc {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #ff7f1f;
|
|
|
+ line-height: 17px;
|
|
|
+ margin-top: 4px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.items {
|
|
|
@@ -350,6 +463,10 @@ page {
|
|
|
color: black;
|
|
|
height: 44px;
|
|
|
.flex();
|
|
|
+
|
|
|
+ &.row-start {
|
|
|
+ align-items: flex-start;
|
|
|
+ }
|
|
|
.name {
|
|
|
font-size: 14px;
|
|
|
color: #939599;
|