diff --git a/src/project/fengdu/AppRedemptionPoints/AppRedemptionPoints.vue b/src/project/fengdu/AppRedemptionPoints/AppRedemptionPoints.vue index 744f245..234dbd3 100644 --- a/src/project/fengdu/AppRedemptionPoints/AppRedemptionPoints.vue +++ b/src/project/fengdu/AppRedemptionPoints/AppRedemptionPoints.vue @@ -4,7 +4,7 @@

积分余额

-

562

+

{{total}}

我的订单
@@ -23,8 +23,8 @@ -
- +
+
- +
@@ -86,25 +90,45 @@ export default { currentPoint: 0, leftList: [], rightList: [], - flowList: [], + goodsList: [], + total: 0 } }, computed: { ...mapState(['user']), }, onLoad() { + this.getToatl() this.$dict.load(['integralSGType']).then(() => { this.getList() }) }, methods: { + getToatl() { + this.$instance.post(`/app/appintegraluser/integralUserInfoFD`).then(res => { + if (res?.data) { + this.total = res.data.integral || 0 + } + }) + }, getListInit() { - + this.goodsList = [] + this.leftList = [] + this.rightList = [] + this.current = 1 }, getList() { - this.$instance.post(`/app/appintegralsupermarketshop/goodsListXCX`).then(res => { + this.$instance.post(`/app/appintegralsupermarketshop/goodsListXCX`, 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:全部、1:50分以下、2:100分以下、3:200分以下、4:5000分以下默认0 + current: this.current + } + }).then(res => { if (res.code === 0) { - this.flowList = res.data.records + this.goodsList = this.current == 1 ? res.data.records : [...this.goodsList, ...res.data.records] if(res.data && res.data.records.length) { res.data.records.map((item, index) => { if(index%2 == 0) { @@ -119,26 +143,31 @@ export default { }, changeTab(index) { this.currentTabs = index - // this.getListInit() + this.getListInit() }, typeClick(index) { this.currentType = index - // this.getListInit() + this.getListInit() }, pointClick(index) { this.currentPoint = index - // this.getListInit() + this.getListInit() }, toProductDetail(item) { - uni.navigateTo({url: `./productDetails?id=${item.id}`}) + uni.navigateTo({url: `./productDetails?shopGoodsId=${item.shopGoodsId}&total=${this.total}`}) }, toMyOrder() { uni.navigateTo({url: './myOrderList'}) - } + }, + toOrder(item) { + if(this.total >= item.integralPrice && item.stock > 0) { + uni.navigateTo({url: `./placeOrder?shopGoodsId=${item.shopGoodsId}&total=${this.total}&backLevel=2`}) + } + }, }, onReachBottom() { - // this.current = this.current + 1 - // this.getList() + this.current = this.current + 1 + this.getList() }, } @@ -228,6 +257,8 @@ export default { img { width: 100%; height: 340px; + border-top-left-radius: 20px; + border-top-right-radius: 20px; } .type { padding: 8px 16px; @@ -301,11 +332,11 @@ export default { bottom: 24px; right: 16px; } - .btn0 { + .btn1 { background-color: #2D7DFF; color: #FFF; } - .btn1 { + .btn0 { background-color: #E2E2E2; color: #666; } diff --git a/src/project/fengdu/AppRedemptionPoints/jdH5.vue b/src/project/fengdu/AppRedemptionPoints/jdH5.vue new file mode 100644 index 0000000..c26b96e --- /dev/null +++ b/src/project/fengdu/AppRedemptionPoints/jdH5.vue @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/src/project/fengdu/AppRedemptionPoints/myOrderList.vue b/src/project/fengdu/AppRedemptionPoints/myOrderList.vue index 9c9a8ad..f66f168 100644 --- a/src/project/fengdu/AppRedemptionPoints/myOrderList.vue +++ b/src/project/fengdu/AppRedemptionPoints/myOrderList.vue @@ -4,36 +4,37 @@ -
-
+
+
-

2022-05-25 17:45

-
已完成
+

{{item.createTime.substring(0, 16)}}

+
{{ $dict.getLabel('integralSGOStatus', item.status) }}
- -

京东低价商品

+ +
{{ $dict.getLabel('integralSGType', item.type) }}
-

无染(wuro)本色抽纸无染(wuro)本色抽纸无染(wuro)无染(wuro)本色抽纸无染无染(wuro)本色抽纸无染(wuro)本色抽纸无染(wuro)无染(wuro)

+

{{item.goodsTitle}}

-

50积分+2元

-
x 1
+

{{item.usedIntegral}}积分+{{item.payMoney}}元

+
x {{item.quantity}}
-

兑换成功后,点击「去购买」前往京东低价购买

-

备注:不太好用不太好用不太好用不太好用不太好用不太好用不太好用不太好用不太好用不太好用不太好用

-
-

核销码:58555

-
取消订单
-
-
+

兑换成功后,点击「去购买」前往京东低价购买

+

免费兑换商品,可到固定的兑换点进行「核销兑换」

+

备注:{{item.remarks}}

+

-
去购买
+
去购买
+
+
+

核销码:{{item.verificationCode}}

+
取消订单
- +
@@ -54,23 +55,65 @@ export default { 'bottom': '3px', 'background': '#2D7DFF' }, + list: [], + current: 1 } }, computed: { ...mapState(['user']), }, onLoad() { - + this.$dict.load(['integralSGOStatus', 'integralSGType']).then(() => { + this.getList() + }) }, methods: { changeTab(index) { this.currentTabs = index - // this.getListInit() + this.getListInit() + }, + getListInit() { + this.current = 1 + this.getList() + }, + getList() { + this.$instance.post(`/app/appintegralsupermarketorder/listForXCX`, null, { + params: { + current: this.current, + status: this.currentTabs == 0 ? '' : this.currentTabs - 1 + } + }).then(res => { + if (res.code === 0) { + this.list = this.current == 1 ? res.data.records : [...this.list, ...res.data.records] + } + }) + }, + openJd(item) { + uni.navigateTo({url: `./jdH5?goodsJdUrl=${item.goodsJdUrl}`}) + }, + cancel(item) { + uni.showModal({ + title: '确认取消该订单?', + confirmspan: "确认", + confirmColor: "#135AB8", + success: function (res) { + if (res.confirm) { + this.cancelOrder(item) + } + } + }); + }, + cancelOrder(item) { + this.$instance.post(`/app/appintegralsupermarketorder/cancelForXCX?id=${item.id}`).then(res => { + if (res.code === 0) { + this.getListInit() + } + }) }, }, onReachBottom() { - // this.current = this.current + 1 - // this.getList() + this.current = this.current + 1 + this.getList() }, } @@ -104,6 +147,9 @@ export default { div { color: #2D7DFF; } + .status2 { + color: #999; + } } .flex { padding: 32px 32px 0; @@ -132,10 +178,10 @@ export default { scale: 0.9; } } - .type0 { + .type1 { background-color: #E64E39; } - .type1 { + .type0 { background-color: #FF6900; } .flex-right { diff --git a/src/project/fengdu/AppRedemptionPoints/placeOrder.vue b/src/project/fengdu/AppRedemptionPoints/placeOrder.vue index ed86295..0a863d2 100644 --- a/src/project/fengdu/AppRedemptionPoints/placeOrder.vue +++ b/src/project/fengdu/AppRedemptionPoints/placeOrder.vue @@ -2,34 +2,35 @@
- -

京东低价商品

+ +
{{ $dict.getLabel('integralSGType', goodsInfo.type) }}
-

无染(wuro)本色抽纸无染(wuro)本色抽纸无染(wuro)无染(wuro)本色抽纸无染无染(wuro)本色抽纸无染(wuro)本色抽纸无染(wuro)无染(wuro)

+

{{goodsInfo.title}}

- +
-

50积分+¥2.00

+

{{goodsInfo.integralPrice}}积分+¥{{goodsInfo.payMoney}}.00

-

兑换成功后,点击「去购买」前往京东低价购买

+

兑换成功后,点击「去购买」前往京东低价购买

+

免费兑换商品,可到固定的兑换点进行「核销兑换」

订单备注
-
无备注
+
{{value || '无备注'}}
积分余额
-
562积分
+
{{total}}积分
支付积分
-
减100积分
+
减{{goodsNum*goodsInfo.integralPrice}}积分
-
+
京东支付
-
¥4.00
+
¥{{goodsNum*goodsInfo.payMoney}}
@@ -42,7 +43,7 @@ 保存
-
+
提交订单
@@ -56,28 +57,56 @@ export default { appName: '提交订单', data() { return { - value: 1, - show: false + value: '', + show: false, + total: 0, + goodsInfo: {}, + goodsNum: 1, + backLevel: 0 } }, computed: { ...mapState(['user']), }, - onLoad() { - + onLoad(option) { + this.shopGoodsId = option.shopGoodsId + this.total = option.total + this.backLevel = option.backLevel + this.$dict.load(['integralSGType']).then(() => { + this.getDetail() + }) }, methods: { + getDetail() { + this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => { + if (res.code === 0) { + this.goodsInfo = res.data + } + }) + }, valChange(e) { - console.log('当前值为: ' + e.value) + this.goodsNum = e.value + }, + confirm() { + this.show = false + }, + confirmOrder() { + this.$instance.post(`/app/appintegralsupermarketorder/add`, { + shopId: this.goodsInfo.shopId, + goodsId: this.goodsInfo.id, + remarks: this.value, + quantity: this.goodsNum + }).then(res => { + if (res.code === 0) { + this.toSuccess() + } + }) }, toSuccess() { - uni.navigateTo({url: './successOrder'}) + var integralPrice = this.goodsNum*this.goodsInfo.integralPrice + uni.navigateTo({url: `./successOrder?isFree=${this.goodsInfo.type}&integralPrice=${integralPrice}&backLevel=${this.backLevel}&goodsJdUrl=${this.goodsInfo.goodsJdUrl}`}) } }, - onReachBottom() { - // this.current = this.current + 1 - // this.getList() - }, } @@ -113,10 +142,10 @@ export default { scale: 0.9; } } - .type0 { + .type1 { background-color: #E64E39; } - .type1 { + .type0 { background-color: #FF6900; } .flex-right { diff --git a/src/project/fengdu/AppRedemptionPoints/productDetails.vue b/src/project/fengdu/AppRedemptionPoints/productDetails.vue index 41598c8..96ca127 100644 --- a/src/project/fengdu/AppRedemptionPoints/productDetails.vue +++ b/src/project/fengdu/AppRedemptionPoints/productDetails.vue @@ -1,25 +1,21 @@ @@ -32,23 +28,34 @@ export default { appName: '兑换商品', data() { return { - + shopGoodsId: '', + goodsInfo: {}, + total: 0 } }, computed: { ...mapState(['user']), }, - onLoad() { - + onLoad(option) { + this.shopGoodsId = option.shopGoodsId + this.total = option.total + this.$dict.load(['integralSGType']).then(() => { + this.getDetail() + }) }, methods: { - toPlaceOrder() { - uni.navigateTo({url: './placeOrder'}) - } - }, - onReachBottom() { - // this.current = this.current + 1 - // this.getList() + getDetail() { + this.$instance.post(`/app/appintegralsupermarketshop/queryGoodsInfoXCX?shopGoodsId=${this.shopGoodsId}`).then(res => { + if (res.code === 0) { + this.goodsInfo = res.data + } + }) + }, + 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=3`}) + } + }, }, } @@ -73,10 +80,10 @@ export default { padding: 16px 16px 16px 36px; border-bottom-left-radius: 40px; } - .type0 { + .type1 { background-color: #E64E39; } - .type1 { + .type0 { background-color: #FF6900; } .product-info { @@ -158,11 +165,11 @@ export default { font-weight: 500; font-size: 34px; } - .status0 { + .status1 { color: #FFF; background: #4181FF; } - .status1 { + .status0 { color: #666; background: #E2E2E2; } diff --git a/src/project/fengdu/AppRedemptionPoints/successOrder.vue b/src/project/fengdu/AppRedemptionPoints/successOrder.vue index d7d9ef7..57ef95f 100644 --- a/src/project/fengdu/AppRedemptionPoints/successOrder.vue +++ b/src/project/fengdu/AppRedemptionPoints/successOrder.vue @@ -1,20 +1,21 @@ @@ -27,21 +28,33 @@ export default { appName: '提交订单', data() { return { - isOrder: false + isFree: 0, // 0免费 1京东 + integralPrice: 0, + backLevel: 1, + goodsJdUrl: '' } }, computed: { ...mapState(['user']), }, - onLoad() { - + onLoad(option) { + this.isFree = option.isFree + this.integralPrice = option.integralPrice + this.backLevel = option.backLevel + this.goodsJdUrl = option.goodsJdUrl }, methods: { - - }, - onReachBottom() { - // this.current = this.current + 1 - // this.getList() + openJd() { + uni.navigateTo({url: `./jdH5?goodsJdUrl=${this.goodsJdUrl}`}) + }, + back() { + uni.navigateBack({delta: backLevel}) + }, + toOrderList() { + uni.redirectTo({ + url: './myOrderList' + }) + } }, }