丰都积分兑换

This commit is contained in:
liuye
2023-05-22 15:42:36 +08:00
parent 8c99ddafed
commit e15bf73657
3 changed files with 38 additions and 12 deletions

View File

@@ -90,7 +90,14 @@ export default {
})
},
openJd(item) {
uni.navigateTo({url: `./jdH5?goodsJdUrl=${item.goodsJdUrl}`})
if(item.goodsType == 1) {
uni.navigateTo({url: `./jdH5?goodsJdUrl=${item.goodsJdUrl}`})
}else {
uni.navigateToMiniProgram({
appId: item.goodsJdAppid,
path: item.goodsJdUrl
})
}
},
cancel(item) {
uni.showModal({

View File

@@ -104,7 +104,7 @@ export default {
},
toSuccess() {
var integralPrice = this.goodsNum*this.goodsInfo.integralPrice
uni.navigateTo({url: `./successOrder?isFree=${this.goodsInfo.type}&integralPrice=${integralPrice}&backLevel=${this.backLevel}&goodsJdUrl=${this.goodsInfo.jdUrl}`})
uni.navigateTo({url: `./successOrder?isFree=${this.goodsInfo.type}&integralPrice=${integralPrice}&backLevel=${this.backLevel}&goodsJdUrl=${this.goodsInfo.jdUrl}&shopGoodsId=${this.shopGoodsId}`})
}
},
}

View File

@@ -2,14 +2,8 @@
<div class="successOrder">
<img src="./img/success.png" alt="">
<div v-if="isFree == 1">
<h3>兑换成功</h3>
<p>提交京东低价商品订单成功扣减 <span>{{integralPrice}}积分</span><br/>
可点击下方按钮前往京东商城进行低价购买
</p>
<div class="btn" @click="openJd">去购买</div>
</div>
<div v-else>
<div v-if="isFree == 0">
<h3>提交成功</h3>
<p>提交免费兑订单成功扣减 <span>{{integralPrice}}积分</span></p>
<div class="btn-flex">
@@ -17,6 +11,13 @@
<div @click="toOrderList">查看订单</div>
</div>
</div>
<div v-else>
<h3>兑换成功</h3>
<p>提交京东低价商品订单成功扣减 <span>{{integralPrice}}积分</span><br/>
可点击下方按钮前往京东商城进行低价购买
</p>
<div class="btn" @click="openJd">去购买</div>
</div>
</div>
</template>
@@ -31,7 +32,9 @@ export default {
isFree: 0, // 0免费 1京东
integralPrice: 0,
backLevel: 1,
goodsJdUrl: ''
goodsJdUrl: '',
shopGoodsId: '',
goodsInfo: {}
}
},
computed: {
@@ -42,10 +45,26 @@ export default {
this.integralPrice = option.integralPrice
this.backLevel = option.backLevel
this.goodsJdUrl = option.goodsJdUrl
this.shopGoodsId = option.shopGoodsId
this.getDetail()
},
methods: {
getDetail() {
this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => {
if (res.code === 0) {
this.goodsInfo = res.data
}
})
},
openJd() {
uni.navigateTo({url: `./jdH5?goodsJdUrl=${this.goodsJdUrl}`})
if(this.goodsInfo.type == 1) {
uni.navigateTo({url: `./jdH5?goodsJdUrl=${this.goodsJdUrl}`})
}else {
uni.navigateToMiniProgram({
appId: this.goodsInfo.jdAppid,
path: this.goodsInfo.jdUrl
})
}
},
back() {
uni.navigateBack({delta: Number(this.backLevel)})