Browse Source

修改砍价逻辑

zyh
Gaoxs 4 years ago
parent
commit
e380e64198
  1. 4
      config/index.js
  2. 5
      libs/wechat.js
  3. 39
      pages/activity/DargainDetails/index.vue
  4. 1
      pages/shop/GoodsCon/index.vue

4
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';

5
libs/wechat.js

@ -109,6 +109,11 @@ export function wechat() {
})
.catch(error => {
console.log(error)
uni.showToast({
title: error,
icon: "none",
duration: 2000
});
reject()
});
})

39
pages/activity/DargainDetails/index.vue

@ -70,7 +70,7 @@
</view>
<!-- 参与砍价按钮 同一人-->
<view v-if="participate" class="bargainBnt" @click="goParticipate">立即参与砍价</view>
<view v-if="participate" class="bargainBnt" @click="goParticipate">立即发起砍价</view>
<!-- 邀请好友按钮 -->
<view v-if="inviteFriends" class="bargainBnt" @click="goPoster">邀请好友帮砍价</view>
@ -79,7 +79,7 @@
<view v-if="helpFriendsBargain" class="bargainBnt" @click="getBargainHelp">帮好友砍一刀</view>
<!-- 发起砍价按钮 非同一人-->
<view v-if="bargain" class="bargainBnt" @click="getBargainStart">我也要参与</view>
<view v-if="bargain" class="bargainBnt" @click="getBargainStart">我也要砍价</view>
<!-- 支付按钮 -->
<view class="bargainBnt" @click="goPay" v-if="pay">立即支付</view>
@ -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) {
// urluiduid
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(
/\<img/gi,
@ -338,6 +348,7 @@
that.getBargainHelpCount();
})
.catch(res => {
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({

1
pages/shop/GoodsCon/index.vue

@ -217,6 +217,7 @@
getCollectDel,
getUserInfo,
} from "@/api/user";
import cookie from "@/utils/store/cookie";
import {
isWeixin,
PosterCanvas,

Loading…
Cancel
Save