From e380e6419864d8ffa9076747d516a82c1c94ea91 Mon Sep 17 00:00:00 2001
From: Gaoxs <704041637@qq.com>
Date: Sun, 27 Sep 2020 16:34:52 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A0=8D=E4=BB=B7=E9=80=BB?=
=?UTF-8?q?=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/index.js | 4 +--
libs/wechat.js | 5 ++++
pages/activity/DargainDetails/index.vue | 39 ++++++++++++++++---------
pages/shop/GoodsCon/index.vue | 1 +
4 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/config/index.js b/config/index.js
index c54667e..d2febdd 100644
--- a/config/index.js
+++ b/config/index.js
@@ -1,8 +1,8 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
-export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
+// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api';
-// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
+export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static';
diff --git a/libs/wechat.js b/libs/wechat.js
index f9e5144..021ddee 100644
--- a/libs/wechat.js
+++ b/libs/wechat.js
@@ -109,6 +109,11 @@ export function wechat() {
})
.catch(error => {
console.log(error)
+ uni.showToast({
+ title: error,
+ icon: "none",
+ duration: 2000
+ });
reject()
});
})
diff --git a/pages/activity/DargainDetails/index.vue b/pages/activity/DargainDetails/index.vue
index 0487d49..744287b 100644
--- a/pages/activity/DargainDetails/index.vue
+++ b/pages/activity/DargainDetails/index.vue
@@ -70,7 +70,7 @@
- 立即参与砍价
+ 立即发起砍价
邀请好友帮砍价
@@ -79,7 +79,7 @@
帮好友砍一刀
- 我也要参与
+ 我也要砍价
立即支付
@@ -227,6 +227,8 @@
mountedStart: function () {
var that = this;
let url = handleQrCode();
+ // bargainId 砍价商品id
+ // bargainUid 发起砍价人
if (url) {
// 通过二维码进来
that.bargainId = url.bargainId;
@@ -236,7 +238,7 @@
that.bargainId = that.$yroute.query.id;
that.bargainUid = parseInt(that.$yroute.query.partake);
}
-
+
if (!this.bargainUid) {
// url未携带用户uid,填上登录用户uid,跳转
that.bargainUid = that.userInfo.uid;
@@ -250,11 +252,14 @@
that.getBargainStartUser();
}
},
- //参与砍价
+ // 发起砍价
goParticipate() {
+ //发起人和当前用户为同一人
if (this.bargainUid === this.userInfo.uid) {
- this.getBargainStart()
+ // 变更为当前用户砍价页面
+ this.getBargainStart();
} else {
+ // 发起人与当前用户非同一人,变更为发起人的砍价页面
this.getBargainStartUser();
}
this.getBargainHelpCount();
@@ -323,8 +328,13 @@
// 获取产品详情
getBargainDetail: function () {
var that = this;
+ uni.showLoading({
+ title: "加载中",
+ mask: true
+ });
getBargainDetail(that.bargainId)
.then(res => {
+ uni.hideLoading()
that.goodsDetail = res.data.bargain;
that.goodsDetail.description = that.goodsDetail.description.replace(
/\ {
+ uni.hideLoading()
uni.showToast({
title: res.msg,
icon: "none",
@@ -345,7 +356,7 @@
});
});
},
- // 开启砍价
+ // 开启砍价-发起人与当前用户非同一人
getBargainStart: function () {
var that = this;
getBargainStart({
@@ -354,6 +365,7 @@
.then(() => {
that.bargainUid = that.userInfo.uid;
that.getBargainHelp();
+ that.getBargainHelpCount();
})
.catch(res => {
uni.showToast({
@@ -488,7 +500,7 @@
// 判断是否可以支付
handleButtonStatus() {
// 砍价按钮分为
- // 1.参与砍价 ==> 发起用户和砍价用户为同一人 && 未参与
+ // 1.参与砍价 ==> 发起人与当前用户为同一人 && 未参与
if (
this.bargainUid === this.userInfo.uid &&
this.bargainHelpCount.status == 0
@@ -498,7 +510,7 @@
this.participate = false
}
- // 2.邀请好友 ==> 发起用户和砍价用户同一人 && 已参与未过期 && 剩余金额>0
+ // 2.邀请好友 ==> 发起人与当前用户同一人 && 已参与未过期 && 剩余金额>0
if (
this.bargainUid === this.userInfo.uid &&
this.bargainHelpCount.status == 1 &&
@@ -509,7 +521,7 @@
this.inviteFriends = false
}
- // 3.帮好友砍价 ==> 发起用户和砍价用户非一人 && 未参与未过期 && 剩余金额>0 && 为砍价
+ // 3.帮好友砍价 ==> 发起人与当前用户非一人 && 未参与未过期 && 剩余金额>0 && 为砍价
if (
this.bargainUid != this.userInfo.uid &&
this.bargainHelpCount.status == 1 &&
@@ -521,7 +533,7 @@
this.helpFriendsBargain = false
}
- // 4.支付 ==> 发起用户和砍价用户用户同一人 && 已参与未过期 && 剩余金额<=0
+ // 4.支付 ==> 发起人与当前用户同一人 && 已参与未过期 && 剩余金额<=0
if (
this.bargainUid === this.userInfo.uid &&
this.bargainHelpCount.status == 1 &&
@@ -532,7 +544,7 @@
this.pay = false
}
- // 5.砍价人发起新的砍价 ==> 发起用户和砍价用户非一人 && 未参与
+ // 5.砍价人发起新的砍价 ==> 发起人与当前用户非一人 && 未参与
if (
this.bargainUid != this.userInfo.uid
) {
@@ -542,12 +554,13 @@
}
// 砍价弹窗
- // 1.发起人砍价成功 ==> 发起用户和砍价用户用户同一人 && 已参与未过期
- // 2.砍价人砍价成功 ==> 发起用户和砍价用户非一人 && 已参与未过期
+ // 1.发起人砍价成功 ==> 发起人与当前用户同一人 && 已参与未过期
+ // 2.砍价人砍价成功 ==> 发起人与当前用户非一人 && 已参与未过期
// 3.已砍价 ==> 已参与 && 砍价状态为 true
},
// 获取开启砍价用户信息
+ // 参与砍价,为同一人发起砍价后
getBargainStartUser: function () {
var that = this;
getBargainStartUser({
diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue
index 7ff7bf3..1833391 100644
--- a/pages/shop/GoodsCon/index.vue
+++ b/pages/shop/GoodsCon/index.vue
@@ -217,6 +217,7 @@
getCollectDel,
getUserInfo,
} from "@/api/user";
+ import cookie from "@/utils/store/cookie";
import {
isWeixin,
PosterCanvas,