Task:送礼相关接口

This commit is contained in:
linxi
2025-02-19 18:31:38 +08:00
parent 5dc1f5ad92
commit dbc31c72fb
9 changed files with 18138 additions and 160 deletions
+64 -5
View File
@@ -7,7 +7,7 @@
<view class="v12-font-28 v12-secondary-dark-text">送礼寄语</view>
</view>
<view class="v12-primary-text v12-font-26">
<view>默认封面</view>
<view @click="showCoverPicker = true">默认封面</view>
<view>
</view>
</view>
@@ -23,23 +23,82 @@
<view class="swich-btn">
<view class="v12-font-28 v12-dark-text">是否支持好友转赠</view>
<view>
<u-switch v-model="value3" ></u-switch>
<u-switch v-model="canTransfe" ></u-switch>
</view>
</view>
<view class="btn-wrap v12-mt-16 v12-justify-center">
<view class="gift-submit">付款并赠送</view>
<view class="gift-submit" @click="submitGift">付款并赠送</view>
</view>
<view class="tip-wrap v12-justify-center">
<view class="tip-text v12-mr-1">好友未收下礼包将于24小时后自动退款</view>
<u-icon name="error-circle" color="#666" size="28rpx"></u-icon>
<u-icon @click="showTips" name="error-circle" color="#666" size="28rpx"></u-icon>
</view>
<giftTips ref="giftTips" :richText="giftNotice"></giftTips>
<CoverPicker
:show.sync="showCoverPicker"
:list="coverList"
@confirm="onCoverConfirm"
/>
</view>
</template>
<script>
import { getGiftCardSendOrderConfirm } from '@/api/gift'
import giftTips from './components/giftTips.vue'
import CoverPicker from './components/CoverPicker.vue'
export default {
components: {
giftTips,
CoverPicker
},
data() {
return {
canTransfe: false,
cartId: '',
couponId: '',
coverList: [],
giftNotice: '',
showCoverPicker: false,
selectedCover: '',
orderKey: '',
goodsInfo: {}
}
},
onLoad(opts) {
console.log(opts, 'gift');
this.cartId = opts.cartId
this.couponId = opts.couponId
this.getGift()
},
methods: {
// 付款并赠送
submitGift() {
const params = {
cartId: this.cartId,
couponId: this.couponId,
cover: this.selectedCover,
canTransfe: this.canTransfe
}
},
onCoverConfirm(cover) {
this.selectedCover = cover.image
},
showTips() {
this.$refs.giftTips.showTips = true
},
getGift() {
const params = {
cartId: this.cartId,
}
getGiftCardSendOrderConfirm(params).then(res => {
this.coverList = res.data.giftCardTemplates
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = res.data.cartInfo[0]
})
}
}
}
</script>