积分代兑换

This commit is contained in:
liuye
2023-04-23 11:38:09 +08:00
parent 78da22962c
commit 87fcacf38c
5 changed files with 51 additions and 34 deletions

View File

@@ -5,15 +5,16 @@
search-icon-color="#999" color="#666" @search="getListInit"></u-search>
</AiTopFixed>
<div class="list-content">
<div class="item">
<div class="item" v-for="(item, index) in list" :key="index" @click="toGoodsList(item)">
<div class="name">
<img src="./img/user-img.png" alt="">张三
<img :src="item.avatarUrl" alt="" v-if="item.avatarUrl">
<img src="./img/user-img.png" alt="" v-else>{{item.name}}
</div>
<div class="total">
<span>积分总额2350</span>
<span>积分余额2350</span>
<span>积分总额{{item.allIntegral}}</span>
<span>积分余额{{item.integral}}</span>
</div>
<div class="bottom" @click="toGoodsList">
<div class="bottom">
<p>帮兑换</p>
<u-icon name="arrow-right" color="#CACACA" size="24" />
</div>
@@ -51,19 +52,19 @@ export default {
this.getList()
},
getList() {
// this.$http.post(`/app/appconvenientaddressbook/list`, null, {
// params: {
// current: this.current,
// name: this.keyword
// }
// }).then(res => {
// if (res.code == 0) {
// this.list = this.current == 1 ? res.data.records : [...this.list, ...res.data.records]
// }
// })
this.$http.post(`/app/appwechatuserqujing/listByFdAppletUserByGirdMember`, null, {
params: {
current: this.current,
con: this.keyword
}
}).then(res => {
if (res.code == 0) {
this.list = this.current == 1 ? res.data.records : [...this.list, ...res.data.records]
}
})
},
toGoodsList() {
uni.navigateTo({url: './goodsList'})
toGoodsList(item) {
uni.navigateTo({url: `./goodsList?openId=${item.openId}&userId=${item.id}&integralUserId=${item.integralUserId}`})
}
},
onReachBottom() {
@@ -100,6 +101,7 @@ export default {
width: 40px;
height: 40px;
margin-right: 12px;
vertical-align: bottom;
}
}
.total {

View File

@@ -6,7 +6,7 @@
<p>积分余额</p>
<h3>{{total}}</h3>
</div>
<div class="btn" @click="toMyOrder">的订单</div>
<div class="btn" @click="toMyOrder">ta的订单</div>
</div>
<div class="search">
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="76" font-size="28" bg-color="#fff" inactive-color="#8891A1"
@@ -99,13 +99,19 @@ export default {
leftList: [],
rightList: [],
total: 0,
current: 1
current: 1,
openId: '',
integralUserId: '',
userId: ''
}
},
computed: {
...mapState(['user']),
},
onLoad() {
onLoad(option) {
this.openId = option.openId
this.userId = option.userId
this.integralUserId = option.integralUserId
this.getTotal()
this.$dict.load(['integralSGType']).then(() => {
this.getList()
@@ -117,7 +123,7 @@ export default {
},
methods: {
getTotal() {
this.$http.post(`/app/appintegraluser/integralUserInfoFD`).then(res => {
this.$http.post(`/app/appintegraluser/integralUserInfoFD?integralUserId=${this.integralUserId}`).then(res => {
if (res?.data) {
this.total = res.data.integral || 0
}
@@ -131,13 +137,15 @@ export default {
this.getList()
},
getList() {
this.$http.post(`/app/appintegralsupermarketshop/goodsListXCX`, null, {
this.$http.post(`/app/appintegralsupermarketshop/goodsListWXCP`, null, {
params: {
goodsType: this.currentTabs, //商品类型0全部、1免费兑、2京东低价商品默认0
orderType: this.currentType == 0 ? 1 : 0, //排序类型0积分升序、1上架时间倒序默认0
filterIntegral: this.currentType == 2 ? true : false, //过滤我可兑换的默认false
integralRange: this.currentType == 1 ? this.currentPoint : '', //积分区间类型0全部、150分以下、2:100分以下、3200分以下、45000分以下默认0
current: this.current
current: this.current,
userId: this.userId,
openId: this.openId
}
}).then(res => {
if (res.code === 0) {
@@ -165,14 +173,14 @@ export default {
this.getListInit()
},
toProductDetail(item) {
uni.navigateTo({url: `./productDetails?shopGoodsId=${item.shopGoodsId}&total=${this.total}`})
uni.navigateTo({url: `./productDetails?shopGoodsId=${item.shopGoodsId}&total=${this.total}&userId=${this.userId}`})
},
toMyOrder() {
uni.navigateTo({url: './myOrderList'})
uni.navigateTo({url: `./myOrderList?userId=${this.userId}`})
},
toOrder(item) {
if(this.total >= item.integralPrice && item.stock > 0) {
uni.navigateTo({url: `./placeOrder?shopGoodsId=${item.shopGoodsId}&total=${this.total}&backLevel=3`})
uni.navigateTo({url: `./placeOrder?shopGoodsId=${item.shopGoodsId}&total=${this.total}&backLevel=3&userId=${this.userId}`})
}
},
},

View File

@@ -56,13 +56,15 @@ export default {
'background': '#2D7DFF'
},
list: [],
current: 1
current: 1,
userId: ''
}
},
computed: {
...mapState(['user']),
},
onLoad() {
onLoad(option) {
this.userId = option.userId
this.$dict.load(['integralSGOStatus', 'integralSGType']).then(() => {
this.getList()
})
@@ -81,7 +83,7 @@ export default {
params: {
current: this.current,
status: this.currentTabs == 0 ? '' : this.currentTabs - 1,
createUserId: this.user.id
createUserId: this.userId
}
}).then(res => {
if (res.code === 0) {

View File

@@ -62,13 +62,15 @@ export default {
total: 0,
goodsInfo: {},
goodsNum: 1,
backLevel: 0
backLevel: 0,
userId: ''
}
},
computed: {
...mapState(['user']),
},
onLoad(option) {
this.userId = option.userId
this.shopGoodsId = option.shopGoodsId
this.total = option.total
this.backLevel = option.backLevel
@@ -94,11 +96,12 @@ export default {
this.show = false
},
confirmOrder() {
this.$http.post(`/app/appintegralsupermarketorder/add`, {
this.$http.post(`/app/appintegralsupermarketorder/addWXCP`, {
shopId: this.goodsInfo.shopId,
goodsId: this.goodsInfo.id,
remarks: this.value,
quantity: this.goodsNum
quantity: this.goodsNum,
createUserId: this.userId
}).then(res => {
if (res.code === 0) {
this.toSuccess()

View File

@@ -33,7 +33,8 @@ export default {
return {
shopGoodsId: '',
goodsInfo: {},
total: 0
total: 0,
userId: ''
}
},
computed: {
@@ -41,6 +42,7 @@ export default {
},
onLoad(option) {
this.shopGoodsId = option.shopGoodsId
this.userId = option.userId
this.total = option.total
this.$dict.load(['integralSGType']).then(() => {
this.getDetail()
@@ -59,7 +61,7 @@ export default {
},
toOrder() {
if(this.total >= this.goodsInfo.integralPrice && this.goodsInfo.stock > 0 && this.goodsInfo.status == 1) {
uni.navigateTo({url: `./placeOrder?shopGoodsId=${this.goodsInfo.shopGoodsId}&total=${this.total}&backLevel=4`})
uni.navigateTo({url: `./placeOrder?shopGoodsId=${this.goodsInfo.shopGoodsId}&total=${this.total}&backLevel=4&userId=${this.userId}`})
}
},
},