积分超市
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
<template>
|
||||
<div class="order">
|
||||
<div class="order-info">
|
||||
<h2>{{ userName }}家</h2>
|
||||
<span>剩余积分:{{ familyIntegral }}分</span>
|
||||
<div><span class="tips">*</span>结算对象</div>
|
||||
<div class="family-name" @click="toSearch">
|
||||
<span v-if="familyInfo.familyId" class="name">{{familyInfo.familyName}}家 剩余积分:{{familyInfo.familyIntegral}}分</span>
|
||||
<span v-else class="name">请选择</span>
|
||||
<u-icon name="arrow-right" color="#666" size="24" style="margin-left:4px;" />
|
||||
</div>
|
||||
</div>
|
||||
<image class="line" src="/static/img/line.png" />
|
||||
<image class="line" src="./components/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" />
|
||||
@@ -33,7 +37,7 @@
|
||||
<em>积分</em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods-footer__bottom--btn" @click="submit" hover-class="text-hover">确认提交</div>
|
||||
<div class="goods-footer__bottom--btn" @click="submit" hover-class="text-hover">确认领取</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,29 +50,36 @@
|
||||
total: 0,
|
||||
money: 0,
|
||||
goods: [],
|
||||
memberId: '',
|
||||
userName: '',
|
||||
familyId: '',
|
||||
familyIntegral: 0
|
||||
areaId: '',
|
||||
familyInfo: {}
|
||||
}
|
||||
},
|
||||
|
||||
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)
|
||||
onLoad (options) {
|
||||
this.total = options.total
|
||||
this.money = options.money
|
||||
this.goods = JSON.parse(options.goods)
|
||||
this.areaId = options.areaId
|
||||
uni.$on('selectFamily', res => {
|
||||
console.log(res)
|
||||
this.familyInfo = res
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
document.title = '结算'
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit () {
|
||||
this.$loading()
|
||||
toSearch() {
|
||||
uni.navigateTo({url: `./Search?areaId=${this.areaId}`})
|
||||
},
|
||||
submit() {
|
||||
if(!this.familyInfo.familyId) {
|
||||
return this.$u.toast('请选择结算对象')
|
||||
}
|
||||
this.$http.post(`/app/appvillagerintegralshoporder/createOrderForWx`, {
|
||||
memberId: this.memberId,
|
||||
familyId: this.familyId,
|
||||
memberId: this.familyInfo.memberId,
|
||||
familyId: this.familyInfo.familyId,
|
||||
orderIntegral: this.money,
|
||||
shopId: this.goods[0].shopId,
|
||||
merchandiseList: this.goods.map(item => {
|
||||
@@ -79,10 +90,9 @@
|
||||
})
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
uni.$emit('update')
|
||||
this.$linkTo('/subPages/creditPoints/result?type=0')
|
||||
|
||||
} else {
|
||||
this.$linkTo('/subPages/creditPoints/result?type=1')
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -142,12 +152,30 @@
|
||||
|
||||
.order-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 128rpx;
|
||||
padding: 0 30rpx;
|
||||
color: #333333;
|
||||
font-size: 32rpx;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
padding: 40px 30px 20px 30px;
|
||||
.tips{
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #FF4466;
|
||||
margin-right: 4px;
|
||||
}
|
||||
.family-name{
|
||||
color: #666;
|
||||
width: calc(100% - 170px);
|
||||
.name{
|
||||
display: inline-block;
|
||||
width: calc(100% - 40px);
|
||||
word-break: break-all;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods-footer {
|
||||
@@ -179,6 +207,7 @@
|
||||
h3 {
|
||||
color: #F94246;
|
||||
font-size: 32rpx;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.goods-footer__bottom--middle {
|
||||
@@ -241,4 +270,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
i{
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user