积分代兑换

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

View File

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

View File

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

View File

@@ -33,7 +33,8 @@ export default {
return { return {
shopGoodsId: '', shopGoodsId: '',
goodsInfo: {}, goodsInfo: {},
total: 0 total: 0,
userId: ''
} }
}, },
computed: { computed: {
@@ -41,6 +42,7 @@ export default {
}, },
onLoad(option) { onLoad(option) {
this.shopGoodsId = option.shopGoodsId this.shopGoodsId = option.shopGoodsId
this.userId = option.userId
this.total = option.total this.total = option.total
this.$dict.load(['integralSGType']).then(() => { this.$dict.load(['integralSGType']).then(() => {
this.getDetail() this.getDetail()
@@ -59,7 +61,7 @@ export default {
}, },
toOrder() { toOrder() {
if(this.total >= this.goodsInfo.integralPrice && this.goodsInfo.stock > 0 && this.goodsInfo.status == 1) { 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}`})
} }
}, },
}, },