Merge branch 'cedev' into dev

# Conflicts:
#	high-unionPay/Utils/Api.js
#	high-unionPay/pages/user/coupon/coupon.vue
1.解决冲突 扫码领取优惠券
master
杨杰 2 years ago
commit d4839f4c8a
  1. 4
      high-unionPay/Utils/Api.js
  2. 95
      high-unionPay/pages/goods/externalCoupon/externalCoupon.vue
  3. 35
      high-unionPay/pages/user/coupon/coupon.vue

@ -159,6 +159,10 @@ export const getCouponByDiscount = params => {
export const againReceiveCoupon = params => {
return POST('GET', `${base}/coupon/againReceiveCoupon`, params).then(res => res.data);
}
//使用优惠券
export const useDiscount = params => {
return POST('GET', `${base}/discount/useDiscount`, params).then(res => res.data);
}
//我的优惠券查详情
export const getDiscountByUserDiscountId = params => {
return POST('GET', `${base}/userDiscount/getDiscountByUserDiscountId`, params).then(res => res.data);

@ -14,13 +14,38 @@
</view>
</view>
<view class="line1 mart15"></view>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" @click="jumpres">点击领取</button>
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button>
<view class="width90 mart10 fcor666">去使用</view>
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666">
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN"
@click="jumpres">点击领取</button>
<button class="coupne-btn width60w mart20 marb20"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status == 1"
@click="receiveDiscount">点击领取</button>
<!-- <button class="coupne-btn width60w mart20 marb20"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status != 1 && couponsDetails.highDiscount.usingRange == 5"
@click="useDiscount">立即使用</button> -->
<view class="alijus width90 mart20"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status != 1 && couponsDetails.highDiscount.usingRange == 5">
<view class="width40" style="margin-right: 5%;" @click="useDiscount">
<view class="width100 btnno fotct font16 backcor008">立即使用</view>
</view>
<view class="width40" style="margin-left: 5%;" @click="jumpCounlist">
<view class="width100 btnno fotct font16 backcor008">立即查看</view>
</view>
</view>
<view class="width90 mart30" v-if="couponsDetails.highDiscount.usingRange == 5">
<image :src="imagewxUrl+imgadres3" mode="widthFix" class="width100"
v-if="couponsDetails.highDiscountAgentCode.status ==1"></image>
<!-- <image :src="imagewxUrl+imgadres1" mode="widthFix" class="width100"
v-if="couponsDetails.highDiscountAgentCode.status != 1"></image> -->
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="width100"
v-if="couponsDetails.highDiscountAgentCode.status != 1"></image>
</view>
<view class="width90 mart10 fcor666" v-if="couponsDetails.highDiscount.usingRange != 5">去使用</view>
<view v-if="minecoupones == '' && couponsDetails.highDiscount.usingRange != 5"
class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view>
<view class="product-list mart20 width90">
<view class="product-list mart20 width90" v-if="couponsDetails.highDiscount.usingRange != 5">
<view class="product" v-for="product in minecoupones" :key="product.id"
@tap="toGoods(product.highCoupon.id)">
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image>
@ -35,13 +60,11 @@
</view>
<view class="info" v-else>
<view class="price">
<image style="width: 15px;height: 15px;vertical-align: sub;"
src="../../../static/img/jfx.png">
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfx.png">
</image>{{ product.highCoupon.discountPrice*100}}
</view>
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice">
<image style="width: 15px;height: 15px;vertical-align: sub;"
src="../../../static/img/jfh.png">
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfh.png">
</image>{{ product.highCoupon.salesPrice*100}}
</view>
</view>
@ -62,7 +85,8 @@
receiveDiscount,
HandleCode,
getUserInfo,
loginByPhone
loginByPhone,
useDiscount
} from '../../../Utils/Api.js';
// import authorize from '../../../components/Authorize';
let app = getApp();
@ -75,7 +99,10 @@
minecoupones: [],
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres:'noorder.png',
imgadres: 'noorder.png',
imgadres1: 'noCoupon.jpg',
imgadres2: 'onCoupon.jpg',
imgadres3: 'showCoupon.jpg',
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
@ -169,10 +196,11 @@
if (res.return_code == '000000') {
uni.showToast({
icon: 'none',
title: res.return_data,
title: '操作成功',
duration: 2000
})
}else{
this.getDiscountByQrCode();
} else {
uni.showToast({
icon: 'none',
title: res.return_msg,
@ -250,7 +278,7 @@
},
//
loginByPhone(PhoneNumber) {
if(PhoneNumber.detail.iv == undefined){
if (PhoneNumber.detail.iv == undefined) {
uni.showToast({
title: "用户取消授权",
icon: "none"
@ -289,17 +317,38 @@
}
});
},
//使
useDiscount() {
let datas = {
discountAgentCodeId: this.couponsDetails.highDiscountAgentCode.id
}
useDiscount(datas).then(res => {
if (res.return_code == '000000') {
uni.showModal({
title: '温馨提示',
content: '请前往微信“中油好客e站”小程序使用,须在有效期30天内使用。(中油好客E站APP也可使用)',
success: function(res) {}
})
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
},
//
jumpres() {
uni.navigateTo({
url:'../../login/register?id=2'
url: '../../login/register?id=2'
})
},
//
toGoods(e) {
if (app.globalData.userInfo) {
uni.navigateTo({
url: '../../order/confirmation?id=' + e +'&typeid=2'
url: '../../order/confirmation?id=' + e + '&typeid=2'
})
} else {
uni.showToast({
@ -308,6 +357,12 @@
duration: 2000
})
}
},
//
jumpCounlist() {
uni.reLaunch({
url: '/pages/user/coupon/coupon'
})
}
}
@ -323,7 +378,13 @@
width: 80px;
height: 80px;
}
.btnno {
height: 40px;
line-height: 40PX;
display: flex;
justify-content: center;
color: #ffffff;
}
.product-list {
display: flex;
justify-content: space-between;

@ -141,7 +141,8 @@
<script>
import {
getUserDiscountList
getUserDiscountList,
useDiscount
} from '../../../Utils/Api.js';
let app = getApp();
export default {
@ -261,11 +262,11 @@
},
//
jumpcoupons(e) {
if (e.highDiscount.useScope == 3) {
if(e.highDiscount.useScope == 3){
uni.navigateTo({
url: '../../../subPages/recharge/recharge'
url: '../../unionPay/recharge/recharge'
})
} else if (e.highDiscount.useScope == 4) {
}else if (e.highDiscount.useScope == 4) {
app.globalData.distinguishid = 1;
uni.navigateTo({
url: '/qianzhu-KFC/buffet-order/buffet-order'
@ -283,13 +284,37 @@
uni.navigateTo({
url: '../../goods/refuel/refuel'
})
} else {
}else if (e.highDiscount.usingRange == 5) {
this.useDiscount(e.discountAgentCodeId);
} else{
uni.navigateTo({
url: '../mineCouponsDestails/mineCouponsDestails?id=' + e.id
})
}
},
//使
useDiscount(item) {
let datas = {
discountAgentCodeId: item
}
useDiscount(datas).then(res => {
if (res.return_code == '000000') {
uni.showModal({
title: '温馨提示',
content: '请前往微信“中油好客e站”小程序使用,须在有效期30天内使用。(中油好客E站APP也可使用)',
success: function(res) {
}
})
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
},
switchType(type) {
if (this.typeClass == type) {
return;

Loading…
Cancel
Save