From 38f92c6766dffb120922f7b4b4397e9d9d6c697d Mon Sep 17 00:00:00 2001
From: Gdpao <1341331954@qq.com>
Date: Mon, 3 Aug 2020 19:51:05 +0800
Subject: [PATCH] gdpaoup2
---
pageB/photo/index.vue | 62 +++++++++++++++++++++++++++-----
pageB/sdetails/index.vue | 2 +-
pageC/cart/ConfirmOrder.vue | 2 ++
pageC/cart/cashier.vue | 71 ++++++++++++++++++++++++++++---------
pageE/order/Details.vue | 6 ++--
pages/index/index.vue | 2 --
6 files changed, 113 insertions(+), 32 deletions(-)
diff --git a/pageB/photo/index.vue b/pageB/photo/index.vue
index ec0add7..05d218b 100644
--- a/pageB/photo/index.vue
+++ b/pageB/photo/index.vue
@@ -37,15 +37,21 @@
{{ item.member_nickname }}
{{ item.create_time }}
- 回复
+ 回复
{{ item.content }}
+
+
+
+
+ 展开更多回复
+
111
-
+
发送
@@ -53,7 +59,7 @@
-
+
发送
@@ -218,8 +224,14 @@
}
.content {
padding: 0 20rpx 10rpx 90rpx;
- border-bottom: 1px solid #ececec;
}
+ .child-content {
+ margin: 6rpx 90rpx 6rpx;
+ .more-reply {
+ font-size: 22rpx;
+ color: #999;
+ }
+ }
}
.no-data {
margin-top: 100rpx;
@@ -372,13 +384,28 @@ export default {
cartList: [],
cart_len: 0,
edit_text: "有爱评论,说点好听的 ~",
+ edit_text_other: "有爱评论,说点好听的 ~",
commentList: [], // 评论
+ allList: {}, // 全部子评论
}
},
onLoad(option){
this.article_id = option.id;
this.articleInfo(this.article_id);
},
+ // 监听返回按钮
+ onBackPress() {
+ if (this.cart_type) {
+ this.cart_type = !this.cart_type;
+ } else if (this.is_comment) {
+ this.is_comment = !this.is_comment;
+ } else if (this.is_edit) {
+ this.is_edit = !this.is_edit;
+ } else {
+ return false;
+ }
+ return true;
+ },
methods:{
// 发现详情
articleInfo(article_id){
@@ -414,22 +441,39 @@ export default {
})
},
// 打开评论输入
- openKeyInput(data) {
+ openKeyInput(data,index) {
console.log(data);
this.is_edit = true;
this.is_focus = true;
+ this.comment_id = index;
+ if (data.id) {
+ this.edit_text_other = "回复@" + data.member_nickname;
+ this.pid = data.id;
+ this.reply_id = data.member_id;
+ } else {
+ this.edit_text_other = "有爱评论,说点好听的 ~";
+ this.pid = "";
+ this.reply_id = "";
+ }
+ // console.log(this.pid, this.edit_text_other);
},
// 发布评论
- sendComment(data) {
+ sendComment() {
this.$u.post("article/articleAddComment",{
article_id: this.article_id,
content: this.send_value,
- pid: data.id,
- reply_id: data.member_id,
+ pid: this.pid,
+ reply_id: this.reply_id,
}).then(res => {
- console.log(res);
+ // console.log(res.data.data);
if (res.errCode == 0) {
this.is_edit = false;
+ if (res.data.data.pid) {
+ this.commentList[this.comment_id].reply_count = true;
+ this.allList[this.comment_id].unshift(res.data.data);
+ } else {
+ this.commentList.unshift(res.data.data);
+ }
} else {
this.$u.toast(res.message);
}
diff --git a/pageB/sdetails/index.vue b/pageB/sdetails/index.vue
index f467767..88313c7 100644
--- a/pageB/sdetails/index.vue
+++ b/pageB/sdetails/index.vue
@@ -396,7 +396,7 @@ export default {
if(type == 'involvement') {
Object.assign(params, {
pintuan_id: this.id,
- pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id
+ pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id,
})
} else {
const userId = uni.getStorageSync('user_info').member.member_id;
diff --git a/pageC/cart/ConfirmOrder.vue b/pageC/cart/ConfirmOrder.vue
index 870d14f..e145051 100644
--- a/pageC/cart/ConfirmOrder.vue
+++ b/pageC/cart/ConfirmOrder.vue
@@ -253,8 +253,10 @@ export default {
type: 'redirect',
url: '/pageC/cart/cashier',
params: {
+ ifcart: params.ifcart,
pay_sn: res.data.pay_sn,
price: res.data.order_total_amount,
+ order_id: res.data.order_list[0].order_id,
}
})
} else {
diff --git a/pageC/cart/cashier.vue b/pageC/cart/cashier.vue
index a6b61ac..7a43f04 100644
--- a/pageC/cart/cashier.vue
+++ b/pageC/cart/cashier.vue
@@ -11,8 +11,8 @@
{{ item.pay_way }}
-
-
+
+
@@ -39,13 +39,18 @@ export default {
}
],
pay_way: 'wxpay_app',
- pay_sn: '',
price: '',
+ pay_sn: '',
+ ifcart: '',
+ order_id: '',
}
},
onLoad(option) {
- this.pay_sn = option.pay_sn;
+ console.log(option);
+ this.ifcart = option.ifcart;
this.price = option.price;
+ this.pay_sn = option.pay_sn;
+ this.order_id = option.order_id;
},
methods: {
radioGroupChange(e) {
@@ -55,14 +60,43 @@ export default {
// uni.getProvider({service: 'payment'})
// },
payOrder(provider, orderInfo) {
+ let me = this;
uni.requestPayment({
provider: provider,
orderInfo: orderInfo, //订单数据
- success: function (res) {
+ success: (res) => {
console.log('success:' + JSON.stringify(res));
+ this.$u.toast("支付成功!");
+ setTimeout(function(){
+ if (Boolean(parseInt(me.ifcart))) {
+ me.$u.route({
+ type: 'redirect',
+ url: '/pageE/order/Index',
+ })
+ } else {
+ me.$u.route({
+ type: 'redirect',
+ url: '/pageE/order/Details?oid=' + me.order_id,
+ })
+ }
+ },2000)
},
- fail: function (err) {
+ fail: (err) => {
console.log('fail:' + JSON.stringify(err));
+ this.$u.toast("支付失败,支付已取消!");
+ setTimeout(function(){
+ if (Boolean(parseInt(me.ifcart))) {
+ me.$u.route({
+ type: 'redirect',
+ url: '/pageE/order/Index',
+ })
+ } else {
+ me.$u.route({
+ type: 'redirect',
+ url: '/pageE/order/Details?oid=' + me.order_id,
+ })
+ }
+ },2000)
}
});
},
@@ -115,15 +149,18 @@ export default {
/deep/ .u-radio-group {
width: 100%;
flex-direction: column;
+ .u-radio__icon-wrap {
+ width: 30rpx !important;
+ height: 30rpx !important;
+ padding: 4rpx;
+ border: 1px solid #FF780F;
+ }
+ .active {
+ }
+ .default {
+ }
.radio-view {
- padding: 6rpx;
- border-radius: 50%;
- }
- .active {
- border: 2rpx solid rgba(255,120,15,1);
- }
- .default {
- border: 2rpx solid rgba(219,219,219,1);
+
}
.u-radio {
.u-icon {
@@ -135,13 +172,13 @@ export default {
}
}
.pay-item {
- height: 98rpx;
- background: rgba(255,255,255,1);
- padding: 24rpx 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
+ height: 98rpx;
+ padding: 24rpx 30rpx;
margin-bottom: 2rpx;
+ background: rgba(255,255,255,1);
.pay-way {
display: flex;
align-items: center;
diff --git a/pageE/order/Details.vue b/pageE/order/Details.vue
index de70e93..6d7d785 100644
--- a/pageE/order/Details.vue
+++ b/pageE/order/Details.vue
@@ -198,9 +198,9 @@ export default {
title = "订单详情"
break;
}
- uni.setNavigationBarTitle({
- title: title
- });
+ // uni.setNavigationBarTitle({
+ // title: title
+ // });
},
payNow() {
this.$u.route('/pageC/cart/cashier', {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index d85d7a1..25faad7 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -2,7 +2,6 @@
- bbb
@@ -83,7 +82,6 @@
-