123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <template>
- <view class="gift_list">
- <view v-if="giftList.length > 0">
- <view class="gift_item" v-for="item in giftList" :key="item.id" v-show="item.num > 0">
- <image :src="item.img" class="gift_img"></image>
- <view class="right">
- <view class="fixed">赠品名称:</view>
- <view class="bottom">
- <view class="name">{{ item.name }}</view>
- <view class="num">数量:{{ item.num }}</view>
- </view>
- </view>
- </view>
- </view>
- <view v-else class="noTip">该订单没有赠品</view>
- </view>
- </template>
- <script>
-
- import { _API_GetOrderGift } from '../../apis/order.js'
-
- export default {
- data() {
- return {
- giftList: []
- }
- },
- onLoad({ order_no }) {
- if(order_no) {
- this.getGiftList(order_no)
- }
- },
- methods: {
- getGiftList(order_no) {
- uni.showLoading({
- title:'加载中'
- })
- _API_GetOrderGift({
- order_num: order_no
- }).then(res => {
- uni.hideLoading()
- if(res.code === 200) {
- this.giftList = res.data.list
- }
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .noTip {
- width: 100%;
- padding: 20px 0;
- text-align: center;
- color: #181818;
- }
- .gift_list {
- min-height: 100%;
- background: $app-base-bg;
- .gift_item {
- padding: 28rpx 30rpx;
- margin-bottom: 1px;
- background-color: #FFFFFF;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .gift_img {
- display: block;
- width: 140rpx;
- height: 140rpx;
- }
- .right {
- width: calc(100% - 140rpx);
- height: 140rpx;
- padding: 0 50rpx 0 30rpx;
- display: flex;
- justify-content: space-between;
- flex-direction: column;
- .fixed {
- color: #181818;
- font-size: 32rpx;
- }
- .bottom {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .name {
- color: #F76454;
- font-size: 32rpx;
- }
- .num {
- color: #181818;
- font-size: 28rpx;
- }
- }
- }
- }
- }
- </style>
|