detection-user/pages/detection/coupon.vue

193 lines
3.3 KiB
Vue
Raw Normal View History

2024-09-01 18:16:43 +08:00
<template>
<view class="content">
<view class="c-top">
<view class="" @click="getback()">
<uni-icons type="left" size="18"></uni-icons>
</view>
<view class="c-title">优惠券</view>
<view class=""></view>
</view>
<view class="ail">
<view class="imgqs" v-if="arrlist == ''">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
</view>
2025-07-11 10:20:49 +08:00
<view class="q-box" v-for="(item,index) in arrlist" :key="index"
@click="getcouponId(item.couponId,item.discount,item.title,item.couponType)">
2024-09-01 18:16:43 +08:00
<view class="dix">
<view class="qimg">
<image src="http://www.nuoyunr.com/lananRsc/detection/yhq.png" mode=""></image>
</view>
<view>
<view class="q-title">{{item.title}}</view>
<view class="q-hui">{{item.startTime}}-{{item.expirationTime}}</view>
</view>
</view>
<view class="dix">
<view class="">
<view class="ju"> <text class="xju"></text> {{item.discount / 100}}</view>
2025-07-11 10:20:49 +08:00
2024-09-01 18:16:43 +08:00
</view>
<view class="xuan">
2025-07-11 10:20:49 +08:00
2024-09-01 18:16:43 +08:00
</view>
</view>
</view>
</view>
2025-07-11 10:20:49 +08:00
2024-09-01 18:16:43 +08:00
</view>
</template>
<script>
2025-07-11 10:20:49 +08:00
import request from '../../utils/newRequest'
2024-09-01 18:16:43 +08:00
import config from '@/config'
export default {
2025-07-11 10:20:49 +08:00
data() {
return {
id: '',
type: '',
arrlist: [],
2024-09-01 18:16:43 +08:00
}
},
onLoad(option) {
this.id = option.id
this.type = option.type
this.imgs = this.$baseUrl
this.getcanUseCoupon()
2025-07-11 10:20:49 +08:00
2024-09-01 18:16:43 +08:00
},
mounted() {
2025-07-11 10:20:49 +08:00
2024-09-01 18:16:43 +08:00
},
2025-07-11 10:20:49 +08:00
methods: {
getcouponId(id, discount, title, couponType) {
let data = {
couponId: id,
discount: discount / 100,
title: title,
couponType: couponType,
2024-09-01 18:16:43 +08:00
}
uni.$emit('userCouponDiscount', data)
uni.navigateBack({
delta: 1
})
},
2025-07-11 10:20:49 +08:00
async getcanUseCoupon() {
2024-09-01 18:16:43 +08:00
let res = await request({
2025-07-11 10:20:49 +08:00
url: '/app-api/goods/canUseCoupon?objectId=' + this.id + '&type=' + this.type,
2024-09-01 18:16:43 +08:00
method: 'get',
})
this.arrlist = res.data
},
2025-07-11 10:20:49 +08:00
getback() {
2024-09-01 18:16:43 +08:00
uni.navigateBack()
}
}
}
</script>
<style lang="scss" scoped>
2025-07-11 10:20:49 +08:00
.content {
2024-09-01 18:16:43 +08:00
width: 100%;
height: calc(100vh);
background-color: #F6F6F6;
box-sizing: border-box;
padding-top: 45px;
}
2025-07-11 10:20:49 +08:00
.c-top {
2024-09-01 18:16:43 +08:00
width: 100%;
box-sizing: border-box;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
}
2025-07-11 10:20:49 +08:00
.c-title {
2024-09-01 18:16:43 +08:00
font-size: 18px;
font-weight: bold
}
2025-07-11 10:20:49 +08:00
.ail {
2024-09-01 18:16:43 +08:00
width: 100%;
box-sizing: border-box;
padding: 10px;
}
2025-07-11 10:20:49 +08:00
.q-box {
2024-09-01 18:16:43 +08:00
width: 100%;
height: 82px;
background: #FFFFFF;
2025-07-11 10:20:49 +08:00
border-radius: 8px;
2024-09-01 18:16:43 +08:00
box-sizing: border-box;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
2025-07-11 10:20:49 +08:00
.qimg {
2024-09-01 18:16:43 +08:00
width: 60px;
height: 60px;
margin-right: 10px;
2025-07-11 10:20:49 +08:00
image {
2024-09-01 18:16:43 +08:00
width: 100%;
height: 100%;
}
}
2025-07-11 10:20:49 +08:00
.q-title {
2024-09-01 18:16:43 +08:00
font-size: 16px;
font-weight: bold;
color: #333333;
margin-bottom: 20px;
}
2025-07-11 10:20:49 +08:00
.q-hui {
2024-09-01 18:16:43 +08:00
font-size: 13px;
font-weight: 400;
color: #666666;
}
2025-07-11 10:20:49 +08:00
.dix {
2024-09-01 18:16:43 +08:00
display: flex;
align-items: center;
}
2025-07-11 10:20:49 +08:00
.xuan {
2024-09-01 18:16:43 +08:00
width: 16px;
height: 16px;
border-radius: 8px;
border: 1px solid #B4B3B1;
margin-left: 20px;
}
2025-07-11 10:20:49 +08:00
.ju {
2024-09-01 18:16:43 +08:00
font-size: 30px;
font-weight: 400;
color: #FF571A;
margin-bottom: 0px;
}
2025-07-11 10:20:49 +08:00
.xju {
2024-09-01 18:16:43 +08:00
font-size: 14px;
font-weight: 400;
color: #FF571A;
}
2025-07-11 10:20:49 +08:00
.imgqs {
2024-09-01 18:16:43 +08:00
width: 200px;
height: 200px;
margin: 0 auto;
margin-top: 150px;
2025-07-11 10:20:49 +08:00
image {
2024-09-01 18:16:43 +08:00
width: 100%;
height: 100%;
}
}
</style>