平昌-积分兑换
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
<div class="list-info" v-for="(item, index) in leftList" :key="index">
|
<div class="list-info" v-for="(item, index) in leftList" :key="index">
|
||||||
<div class="item" @click="toProductDetail(item)">
|
<div class="item" @click="toProductDetail(item)">
|
||||||
<img :src="item.picUrl" alt="">
|
<img :src="item.picUrl" alt="">
|
||||||
<div class="type" :class="`type`+item.type">{{ $dict.getLabel('integralSGType', item.type) }}</div>
|
<div class="type" :class="`type`+item.type">{{ $dict.getLabel('integralSGTypeText', item.typeText) }}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="text">{{item.title}}</p>
|
<p class="text">{{item.title}}</p>
|
||||||
<div class="item-money">
|
<div class="item-money">
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<div class="list-info" v-for="(item, index) in rightList" :key="index">
|
<div class="list-info" v-for="(item, index) in rightList" :key="index">
|
||||||
<div class="item" @click="toProductDetail(item)">
|
<div class="item" @click="toProductDetail(item)">
|
||||||
<img :src="item.picUrl" alt="">
|
<img :src="item.picUrl" alt="">
|
||||||
<div class="type" :class="`type`+item.type">{{ $dict.getLabel('integralSGType', item.type) }}</div>
|
<div class="type" :class="`type`+item.type">{{ $dict.getLabel('integralSGTypeText', item.typeText) }}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="text">{{item.title}}</p>
|
<p class="text">{{item.title}}</p>
|
||||||
<div class="item-money">
|
<div class="item-money">
|
||||||
@@ -108,7 +108,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getTotal()
|
this.getTotal()
|
||||||
this.$dict.load(['integralSGType']).then(() => {
|
this.$dict.load(['integralSGTypeText']).then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -143,6 +143,7 @@ export default {
|
|||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.goodsList = this.current == 1 ? res.data.records : [...this.goodsList, ...res.data.records]
|
this.goodsList = this.current == 1 ? res.data.records : [...this.goodsList, ...res.data.records]
|
||||||
res.data.records.map((item, index) => {
|
res.data.records.map((item, index) => {
|
||||||
|
item.typeText = item.type == 0 ? 0 : 1
|
||||||
if(index%2 ==0) {
|
if(index%2 ==0) {
|
||||||
this.leftList.push(item)
|
this.leftList.push(item)
|
||||||
}else {
|
}else {
|
||||||
@@ -292,6 +293,9 @@ export default {
|
|||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
.type2 {
|
||||||
|
background-color: #E64E39;
|
||||||
|
}
|
||||||
.type1 {
|
.type1 {
|
||||||
background-color: #E64E39;
|
background-color: #E64E39;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,23 +12,23 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<img :src="item.goodsPicUrl" alt="">
|
<img :src="item.goodsPicUrl" alt="">
|
||||||
<div class="type" :class="`type`+item.goodsType">{{ $dict.getLabel('integralSGType', item.goodsType) }}</div>
|
<div class="type" :class="`type`+item.goodsTypeText">{{ $dict.getLabel('integralSGTypeText', item.goodsTypeText) }}</div>
|
||||||
<div class="flex-right">
|
<div class="flex-right">
|
||||||
<p>{{item.goodsTitle}}</p>
|
<p>{{item.goodsTitle}}</p>
|
||||||
<div class="num-flex">
|
<div class="num-flex">
|
||||||
<h3>{{item.usedIntegral}}积分<span v-if="item.goodsType == 1">+{{item.payMoney}}元</span></h3>
|
<h3>{{item.usedIntegral}}积分<span v-if="item.goodsType == 2">+{{item.payMoney}}元</span></h3>
|
||||||
<div>x {{item.quantity}}</div>
|
<div>x {{item.quantity}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="tips" v-if="item.goodsType == 1"><span>兑换成功后,点击「去购买」前往京东低价购买</span></p>
|
<p class="tips" v-if="item.goodsType == 2"><span>兑换成功后,点击「去购买」前往京东低价购买</span></p>
|
||||||
<p class="tips" v-else>免费兑换商品,可到固定的兑换点进行「核销兑换」</p>
|
<p class="tips" v-else>免费兑换商品,可到固定的兑换点进行「核销兑换」</p>
|
||||||
<p class="remark" v-if="item.remarks">备注:{{item.remarks}}</p>
|
<p class="remark" v-if="item.remarks">备注:{{item.remarks}}</p>
|
||||||
<div class="flex-btn" v-if="item.goodsType == 1 && item.status != 2">
|
<div class="flex-btn" v-if="item.goodsType == 2 && item.status != 2">
|
||||||
<p></p>
|
<p></p>
|
||||||
<div class="btn confirm" @click="openJd(item)">去购买</div>
|
<div class="btn confirm" @click="openJd(item)">去购买</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-btn" v-if="item.goodsType != 1">
|
<div class="flex-btn" v-if="item.goodsType != 2">
|
||||||
<p>核销码:<span>{{item.verificationCode}}</span></p>
|
<p>核销码:<span>{{item.verificationCode}}</span></p>
|
||||||
<div class="btn" v-if="item.status == 0" @click="cancel(item)">取消订单</div>
|
<div class="btn" v-if="item.status == 0" @click="cancel(item)">取消订单</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,7 +63,7 @@ export default {
|
|||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.$dict.load(['integralSGOStatus', 'integralSGType']).then(() => {
|
this.$dict.load(['integralSGOStatus', 'integralSGTypeText']).then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -85,12 +85,22 @@ export default {
|
|||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
|
res.data.records.map((item) => {
|
||||||
|
item.goodsTypeText = item.goodsType == 0 ? 0 : 1
|
||||||
|
})
|
||||||
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]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
openJd(item) {
|
openJd(item) {
|
||||||
|
if(item.goodsType == 1) {
|
||||||
uni.navigateTo({url: `./jdH5?goodsJdUrl=${item.goodsJdUrl}`})
|
uni.navigateTo({url: `./jdH5?goodsJdUrl=${item.goodsJdUrl}`})
|
||||||
|
}else {
|
||||||
|
uni.navigateToMiniProgram({
|
||||||
|
appId: item.goodsJdAppid,
|
||||||
|
path: item.goodsJdUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
cancel(item) {
|
cancel(item) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -183,6 +193,9 @@ export default {
|
|||||||
scale: 0.9;
|
scale: 0.9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.type2 {
|
||||||
|
background-color: #E64E39;
|
||||||
|
}
|
||||||
.type1 {
|
.type1 {
|
||||||
background-color: #E64E39;
|
background-color: #E64E39;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
<div class="header-info">
|
<div class="header-info">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<img :src="goodsInfo.picUrl" alt="">
|
<img :src="goodsInfo.picUrl" alt="">
|
||||||
<div class="type" :class="`type`+goodsInfo.type">{{ $dict.getLabel('integralSGType', goodsInfo.type) }}</div>
|
<div class="type" :class="`type`+goodsInfo.typeText">{{ $dict.getLabel('integralSGTypeText', goodsInfo.typeText) }}</div>
|
||||||
<div class="flex-right">
|
<div class="flex-right">
|
||||||
<p>{{goodsInfo.title}}</p>
|
<p>{{goodsInfo.title}}</p>
|
||||||
<div>
|
<div>
|
||||||
<u-number-box v-model="goodsNum" @change="valChange" input-height="44" size="24" :min="1" :max="goodsInfo.stock"></u-number-box>
|
<u-number-box v-model="goodsNum" @change="valChange" input-height="44" size="24" :min="1" :max="goodsInfo.stock"></u-number-box>
|
||||||
</div>
|
</div>
|
||||||
<h3>{{goodsInfo.integralPrice}}积分<span v-if="goodsInfo.type == 1">+¥{{goodsInfo.payMoney}}.00</span></h3>
|
<h3>{{goodsInfo.integralPrice}}积分<span v-if="goodsInfo.type == 2">+¥{{goodsInfo.payMoney}}.00</span></h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="tips" v-if="goodsInfo.type == 1">兑换成功后,点击「去购买」前往京东低价购买</p>
|
<p class="tips" v-if="goodsInfo.type == 2">兑换成功后,点击「去购买」前往京东低价购买</p>
|
||||||
<p class="tips" v-else>免费兑换商品,可到固定的兑换点进行「核销兑换」</p>
|
<p class="tips" v-else>免费兑换商品,可到固定的兑换点进行「核销兑换」</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<div class="label">支付积分</div>
|
<div class="label">支付积分</div>
|
||||||
<div class="value">减{{(goodsNum*goodsInfo.integralPrice).toFixed(2)}}积分</div>
|
<div class="value">减{{(goodsNum*goodsInfo.integralPrice).toFixed(2)}}积分</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-flex" v-if="goodsInfo.type == 1">
|
<div class="item-flex" v-if="goodsInfo.type == 2">
|
||||||
<div class="label">京东支付</div>
|
<div class="label">京东支付</div>
|
||||||
<div class="value color-999">¥{{(goodsNum*goodsInfo.payMoney).toFixed(2)}}</div>
|
<div class="value color-999">¥{{(goodsNum*goodsInfo.payMoney).toFixed(2)}}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
this.shopGoodsId = option.shopGoodsId
|
this.shopGoodsId = option.shopGoodsId
|
||||||
this.total = option.total
|
this.total = option.total
|
||||||
this.backLevel = option.backLevel
|
this.backLevel = option.backLevel
|
||||||
this.$dict.load(['integralSGType']).then(() => {
|
this.$dict.load(['integralSGTypeText']).then(() => {
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -81,6 +81,7 @@ export default {
|
|||||||
this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => {
|
this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.goodsInfo = res.data
|
this.goodsInfo = res.data
|
||||||
|
this.goodsInfo.typeText = this.goodsInfo.type == 0 ? 0 : 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -104,7 +105,7 @@ export default {
|
|||||||
},
|
},
|
||||||
toSuccess() {
|
toSuccess() {
|
||||||
var integralPrice = this.goodsNum*this.goodsInfo.integralPrice
|
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?integralPrice=${integralPrice}&backLevel=${this.backLevel}&shopGoodsId=${this.goodsInfo.shopGoodsId}`})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -142,6 +143,9 @@ export default {
|
|||||||
scale: 0.9;
|
scale: 0.9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.type2 {
|
||||||
|
background-color: #E64E39;
|
||||||
|
}
|
||||||
.type1 {
|
.type1 {
|
||||||
background-color: #E64E39;
|
background-color: #E64E39;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="productDetails" v-if="goodsInfo.picUrl">
|
<div class="productDetails" v-if="goodsInfo.picUrl">
|
||||||
<img :src="goodsInfo.picUrl" alt="">
|
<img :src="goodsInfo.picUrl" alt="">
|
||||||
<div class="type" :class="`type`+goodsInfo.type">{{ $dict.getLabel('integralSGType', goodsInfo.type) }}</div>
|
<div class="type" :class="`type`+goodsInfo.typeText">{{ $dict.getLabel('integralSGTypeText', goodsInfo.typeText) }}</div>
|
||||||
<div class="product-info">
|
<div class="product-info">
|
||||||
<p>{{goodsInfo.title}}</p>
|
<p>{{goodsInfo.title}}</p>
|
||||||
<h3>{{goodsInfo.integralPrice}}积分<span v-if="goodsInfo.type == 1">+¥{{goodsInfo.payMoney}}<span v-if="goodsInfo.type == 1">(兑换后再付)</span></span></h3>
|
<h3>{{goodsInfo.integralPrice}}积分<span v-if="goodsInfo.type == 2">+¥{{goodsInfo.payMoney}}<span v-if="goodsInfo.type == 2">(兑换后再付)</span></span></h3>
|
||||||
<div>零售单价¥{{goodsInfo.retailPrice}}</div>
|
<div>零售单价¥{{goodsInfo.retailPrice}}</div>
|
||||||
<span class="tips" v-if="goodsInfo.type == 1">兑换成功后,点击「去购买」前往京东低价购买</span>
|
<span class="tips" v-if="goodsInfo.type == 2">兑换成功后,点击「去购买」前往京东低价购买</span>
|
||||||
<span class="tips" v-else>免费兑换商品,可到固定的兑换点进行「核销兑换」</span>
|
<span class="tips" v-else>免费兑换商品,可到固定的兑换点进行「核销兑换」</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="product-content">
|
<div class="product-content">
|
||||||
@@ -42,7 +42,7 @@ export default {
|
|||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.shopGoodsId = option.shopGoodsId
|
this.shopGoodsId = option.shopGoodsId
|
||||||
this.total = option.total
|
this.total = option.total
|
||||||
this.$dict.load(['integralSGType']).then(() => {
|
this.$dict.load(['integralSGTypeText']).then(() => {
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -51,6 +51,7 @@ export default {
|
|||||||
this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => {
|
this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.goodsInfo = res.data
|
this.goodsInfo = res.data
|
||||||
|
this.goodsInfo.typeText = this.goodsInfo.type == 0 ? 0 : 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -83,6 +84,9 @@ export default {
|
|||||||
padding: 16px 16px 16px 36px;
|
padding: 16px 16px 16px 36px;
|
||||||
border-bottom-left-radius: 40px;
|
border-bottom-left-radius: 40px;
|
||||||
}
|
}
|
||||||
|
.type2 {
|
||||||
|
background-color: #E64E39;
|
||||||
|
}
|
||||||
.type1 {
|
.type1 {
|
||||||
background-color: #E64E39;
|
background-color: #E64E39;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,8 @@
|
|||||||
<div class="successOrder">
|
<div class="successOrder">
|
||||||
<img src="./img/success.png" alt="">
|
<img src="./img/success.png" alt="">
|
||||||
|
|
||||||
<div v-if="isFree == 1">
|
|
||||||
<h3>兑换成功</h3>
|
<div v-if="goodsInfo.type == 0">
|
||||||
<p>提交「京东低价商品」订单成功,扣减 <span>{{integralPrice}}积分</span><br/>
|
|
||||||
可点击下方按钮前往京东商城进行低价购买
|
|
||||||
</p>
|
|
||||||
<div class="btn" @click="openJd">去购买</div>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<h3>提交成功</h3>
|
<h3>提交成功</h3>
|
||||||
<p>提交「免费兑」订单成功,扣减 <span>{{integralPrice}}积分</span></p>
|
<p>提交「免费兑」订单成功,扣减 <span>{{integralPrice}}积分</span></p>
|
||||||
<div class="btn-flex">
|
<div class="btn-flex">
|
||||||
@@ -17,6 +11,13 @@
|
|||||||
<div @click="toOrderList">查看订单</div>
|
<div @click="toOrderList">查看订单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<h3>兑换成功</h3>
|
||||||
|
<p>提交「京东低价商品」订单成功,扣减 <span>{{integralPrice}}积分</span><br/>
|
||||||
|
可点击下方按钮前往京东商城进行低价购买
|
||||||
|
</p>
|
||||||
|
<div class="btn" @click="openJd">去购买</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -28,24 +29,39 @@ export default {
|
|||||||
appName: '提交订单',
|
appName: '提交订单',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isFree: 0, // 0免费 1京东
|
|
||||||
integralPrice: 0,
|
integralPrice: 0,
|
||||||
backLevel: 1,
|
backLevel: 1,
|
||||||
goodsJdUrl: ''
|
shopGoodsId: '',
|
||||||
|
goodsInfo: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.isFree = option.isFree
|
console.log(option)
|
||||||
this.integralPrice = option.integralPrice
|
this.integralPrice = option.integralPrice
|
||||||
this.backLevel = option.backLevel
|
this.backLevel = option.backLevel
|
||||||
this.goodsJdUrl = option.goodsJdUrl
|
this.shopGoodsId = option.shopGoodsId
|
||||||
|
this.getDetail()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getDetail() {
|
||||||
|
this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.goodsInfo = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
openJd() {
|
openJd() {
|
||||||
uni.navigateTo({url: `./jdH5?goodsJdUrl=${this.goodsJdUrl}`})
|
if(this.goodsInfo.type == 1) {
|
||||||
|
uni.navigateTo({url: `./jdH5?goodsJdUrl=${this.goodsInfo.jdUrl}`})
|
||||||
|
}else {
|
||||||
|
uni.navigateToMiniProgram({
|
||||||
|
appId: this.goodsInfo.jdAppid,
|
||||||
|
path: this.goodsInfo.jdUrl
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
uni.navigateBack({delta: Number(this.backLevel)})
|
uni.navigateBack({delta: Number(this.backLevel)})
|
||||||
|
|||||||
Reference in New Issue
Block a user