信用积分

This commit is contained in:
liuye
2022-02-15 10:48:33 +08:00
parent f168a86f31
commit 8b5da40e0c
8 changed files with 1364 additions and 0 deletions

View File

@@ -0,0 +1,244 @@
<template>
<div class="order">
<div class="order-info">
<h2>{{ userName }}</h2>
<span>剩余积分:{{ familyIntegral }}</span>
</div>
<image class="line" src="/static/img/line.png" />
<div class="order-list">
<div class="order-item" v-for="(item, index) in goods" :key="index">
<image :src="item.photo[0].url" />
<div class="order-item__right flex1">
<h2>{{ item.merchandiseName }}</h2>
<div class="order-item__right--info">
<span>{{ item.costIntegral }}</span>
<i>积分</i>
</div>
<div class="item-bottom">
<div></div>
<div class="item-bottom__right">
<span>x {{ item.num }}</span>
</div>
</div>
</div>
</div>
</div>
<div class="goods-footer">
<div class="goods-footer__bottom">
<div class="goods-footer__bottom__left">
<h3>{{ total }}件商品</h3>
<div class="goods-footer__bottom--middle">
<span>合计 </span>
<i>{{ money }}</i>
<em>积分</em>
</div>
</div>
<div class="goods-footer__bottom--btn" @click="submit" hover-class="text-hover">确认提交</div>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
total: 0,
money: 0,
goods: [],
memberId: '',
userName: '',
familyId: '',
familyIntegral: 0
}
},
onLoad (query) {
this.userName = query.userName
this.total = query.total
this.familyIntegral = query.familyIntegral
this.money = query.money
this.memberId = query.memberId
this.familyId = query.familyId
this.goods = JSON.parse(query.goods)
},
methods: {
submit () {
this.$loading()
this.$http.post(`/app/appvillagerintegralshoporder/createOrderForWx`, {
memberId: this.memberId,
familyId: this.familyId,
orderIntegral: this.money,
shopId: this.goods[0].shopId,
merchandiseList: this.goods.map(item => {
return {
merchandiseId: item.id,
merchandiseNumber: item.num
}
})
}).then(res => {
if (res.code === 0) {
uni.$emit('update')
this.$linkTo('/subPages/creditPoints/result?type=0')
} else {
this.$linkTo('/subPages/creditPoints/result?type=1')
}
})
}
},
}
</script>
<style lang="scss" scoped>
.order {
min-height: 100%;
background: #fff;
.line {
width: 100%;
height: 8rpx;
}
.order-item {
display: flex;
padding: 28rpx 30rpx 44rpx;
.order-item__right--info {
display: flex;
align-items: baseline;
span {
margin-right: 8rpx;
color: #FA4A51;
font-size: 40rpx;
}
i {
color: #FA4A51;
font-size: 24rpx;
}
}
h2 {
margin-top: 2rpx;
margin-bottom: 30rpx;
color: #333333;
font-size: 30rpx;
text-align: justify;
}
& > image {
width: 192rpx;
height: 192rpx;
margin-right: 30rpx;
}
}
.order-list {
margin-top: 20rpx;
padding-bottom: 110rpx;
}
.order-info {
display: flex;
align-items: center;
justify-content: space-between;
height: 128rpx;
padding: 0 30rpx;
color: #333333;
font-size: 32rpx;
}
.goods-footer {
position: fixed;
left: 0;
bottom: 0;
z-index: 11;
width: 100%;
box-shadow: 0px -1px 4px 0px rgba(214, 214, 214, 0.5);
background: #fff;
.goods-footer__bottom--btn {
width: 212rpx;
height: 104rpx;
line-height: 104rpx;
font-size: 36rpx;
color: #fff;
text-align: center;
background: #197DF0;
}
.goods-footer__bottom__left {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
padding: 0 32rpx;
h3 {
color: #F94246;
font-size: 32rpx;
}
.goods-footer__bottom--middle {
display: flex;
align-items: baseline;
span {
color: #F94246;
font-size: 32rpx;
}
i {
position: relative;
top: 2rpx;
margin-right: 6px;
color: #FA444B;
font-size: 40rpx;
}
em {
color: #F94246;
font-size: 24rpx;
}
}
}
.goods-footer__bottom {
display: flex;
align-items: center;
justify-content: space-between;
height: 104rpx;
}
}
.item-bottom {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 28rpx;
.item-bottom__right {
display: flex;
align-items: center;
color: #666;
}
image {
width: 40rpx;
height: 40rpx;
}
input {
width: 90rpx;
height: 60rpx;
padding: 0 20rpx;
margin: 0 10rpx;
background: #F6F6F6;
border-radius: 10rpx;
font-size: 26rpx;
color: #666;
}
}
}
</style>