# Conflicts:
#	pages/goods/externalCoupon/externalCoupon.vue
#	pages/tabBar/home/home.vue
1.解决冲突
yj-dev
杨杰 2 years ago
commit 15e29a3e6c
  1. 20
      App.vue
  2. 27
      Utils/Api.js
  3. 2
      index.html
  4. 2
      manifest.json
  5. 2
      pages.json
  6. 222
      pages/goods/coupon-details/coupon-details.vue
  7. 34
      pages/goods/coupons-info-details/coupons-info-details.vue
  8. 155
      pages/goods/externalCoupon/externalCoupon.vue
  9. 5
      pages/goods/goods.vue
  10. 202
      pages/pay/success/success.vue
  11. 2
      pages/qianZhuPay/union-pay/union-pay.vue
  12. 107
      pages/tabBar/home/home.vue
  13. 5
      pages/user/agentCoupons/agentCoupons.vue
  14. 199
      pages/user/coupon/coupon.vue
  15. 2
      pages/welcome/welcome.vue

@ -5,15 +5,19 @@
// brestUrl: 'http://192.168.3.4:9302/brest', // brestUrl: 'http://192.168.3.4:9302/brest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/', // imgUrl: 'https://192.168.3.4:9301/filesystem/',
// //
url: 'https://hsg.dctpay.com/crest', // url: 'https://hsg.dctpay.com/crest',
imgUrl: 'https://hsg.dctpay.com/filesystem/', // v1url:'https://hsg.dctpay.com/v1',
brestUrl: 'https://hsg.dctpay.com/brest', // imgUrl: 'https://hsg.dctpay.com/filesystem/',
imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/', // brestUrl: 'https://hsg.dctpay.com/brest',
// imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/',
// imageqrImg: 'https://hsg.dctpay.com/filesystem/temporary/',
// //
// url: 'https://hsgcs.dctpay.com/crest', url: 'https://hsgcs.dctpay.com/crest',
// brestUrl: 'https://hsgcs.dctpay.com/brest', v1url:'https://hsgcs.dctpay.com/v1',
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/', brestUrl: 'https://hsgcs.dctpay.com/brest',
// imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/', imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/',
imageqrImg: 'https://hsgcs.dctpay.com/filesystem/temporary/',
userInfo: "", userInfo: "",
brestUserInfo: '', brestUserInfo: '',
bresthighAgent: '', bresthighAgent: '',

@ -6,7 +6,19 @@ import {
} from "./bRequest.js"; } from "./bRequest.js";
let app = getApp(); let app = getApp();
let base = app.globalData.url; let base = app.globalData.url;
let brestBase = app.globalData.brestUrl; let v1base = app.globalData.v1url;
let brestBase = app.globalData.brestUrl;
//公众号获取跳小程序参数
export const verifyWx = params => {
return POST('GET', `${v1base}/wxMsg/verifyWx`, params).then(res => res.data);
}
//公众号获取跳转小程序地址
export const getScheme = params => {
return POST('GET', `${v1base}/wxMsg/getScheme`, params).then(res => res.data);
}
//根据code获取openId //根据code获取openId
export const HandleCode = params => { export const HandleCode = params => {
return POST('GET', `${base}/wechat/handleCode`, params).then(res => res.data); return POST('GET', `${base}/wechat/handleCode`, params).then(res => res.data);
@ -186,6 +198,10 @@ export const againReceiveCoupon = params => {
export const getUserDiscountList = params => { export const getUserDiscountList = params => {
return POST('GET', `${base}/userDiscount/getUserDiscountList`, params).then(res => res.data); return POST('GET', `${base}/userDiscount/getUserDiscountList`, params).then(res => res.data);
} }
//使用优惠券
export const useDiscount = params => {
return POST('GET', `${base}/discount/useDiscount`, params).then(res => res.data);
}
//我的优惠券查详情 //我的优惠券查详情
export const getDiscountByUserDiscountId = params => { export const getDiscountByUserDiscountId = params => {
return POST('GET', `${base}/userDiscount/getDiscountByUserDiscountId`, params).then(res => res.data); return POST('GET', `${base}/userDiscount/getDiscountByUserDiscountId`, params).then(res => res.data);
@ -449,6 +465,11 @@ export const getGatewayToken = params => {
export const cancelOrderByOrderNo = params => { export const cancelOrderByOrderNo = params => {
return POST('GET', `${base}/highOrder/cancelOrderByOrderNo`, params).then(res => res.data); return POST('GET', `${base}/highOrder/cancelOrderByOrderNo`, params).then(res => res.data);
} }
//中石油生成二维码
export const getVerifyQRCode = params => {
return POST('GET', `${base}/coupon/getVerifyQRCode`, params).then(res => res.data);
}
/** /**
* H5 获取用户信息 * H5 获取用户信息
@ -510,7 +531,9 @@ export const getCodeListByAgentCoupon = params => {
// 生成二维码 // 生成二维码
export const generateCode = params => { export const generateCode = params => {
return POSTBREST('POST', `${brestBase}/highCouponAgent/generateCode`, params).then(res => res.data); return POSTBREST('POST', `${brestBase}/highCouponAgent/generateCode`, params).then(res => res.data);
} }
// 兑换码填写备注 // 兑换码填写备注
export const highremark = params => { export const highremark = params => {
return POSTBREST('POST', `${brestBase}/highCouponAgent/remark`, params).then(res => res.data); return POSTBREST('POST', `${brestBase}/highCouponAgent/remark`, params).then(res => res.data);

@ -19,7 +19,7 @@
<script src="https://cdn.bootcss.com/socket.io/2.1.1/socket.io.js"></script> <script src="https://cdn.bootcss.com/socket.io/2.1.1/socket.io.js"></script>
<script src="https://open.95516.com/s/open/js/upsdk.js"></script> <script src="https://open.95516.com/s/open/js/upsdk.js"></script>
<script src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script> <script src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
<!-- <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> -->
</head> </head>
<body> <body>
<noscript> <noscript>

@ -87,7 +87,7 @@
}, },
"devServer" : { "devServer" : {
"port" : "", "port" : "",
"https" : false "https" : true
}, },
"domain" : "https://hsgcs.dctpay.com", "domain" : "https://hsgcs.dctpay.com",
"template" : "index.html" "template" : "index.html"

@ -29,7 +29,7 @@
"backgroundColorTop": "#0083f5", "backgroundColorTop": "#0083f5",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "pages/user/bindingCardList/bindingCardList", "path": "pages/user/bindingCardList/bindingCardList",
"style": { "style": {

@ -2,7 +2,9 @@
<view> <view>
<view class="backcorf06 height100p"></view> <view class="backcorf06 height100p"></view>
<view class="backcorfff backgrd width90 couhead"> <view class="backcorfff backgrd width90 couhead">
<image class="couimg flleft" mode="widthFix" :src="imageUrl+couponDesInfo.couponInfo.couponImg"></image> <image class="couimg flleft" mode="widthFix"
v-if="couponDesInfo.couponInfo.couponImg && couponDesInfo.couponInfo.couponImg !=undefined"
:src="imageUrl+couponDesInfo.couponInfo.couponImg"></image>
<view class="couhedcout"> <view class="couhedcout">
<view class="height40 width100"> <view class="height40 width100">
<view class="couStu flright fotct mart10" v-if="couponDesInfo.highUserCoupon.status == 2">已使用</view> <view class="couStu flright fotct mart10" v-if="couponDesInfo.highUserCoupon.status == 2">已使用</view>
@ -13,19 +15,62 @@
<view class="fontwig6 font13 fcor999 mart5" v-if="oneTime">领取时间:{{oneTime | formatDate('-')}}</view> <view class="fontwig6 font13 fcor999 mart5" v-if="oneTime">领取时间:{{oneTime | formatDate('-')}}</view>
<view class="fontwig6 font13 fcor999 mart5" v-if="twoTime">使用有效期:{{twoTime | formatDate('-')}}</view> <view class="fontwig6 font13 fcor999 mart5" v-if="twoTime">使用有效期:{{twoTime | formatDate('-')}}</view>
<view class="fontwig6 font13 fcor999 mart5" v-if="threeTime">消费时间:{{threeTime | formatDate('-')}}</view> <view class="fontwig6 font13 fcor999 mart5" v-if="threeTime">消费时间:{{threeTime | formatDate('-')}}</view>
<view class="fontwig6 font13 fcor999 mart5" v-if="couponDesInfo.couponCodeInfo.storeName"> <view class="fontwig6 font13 fcor999 mart5" v-if="couponDesInfo.couponCodeInfo">
加油站点:{{couponDesInfo.couponCodeInfo.storeName}}</view> 加油站点:{{couponDesInfo.couponCodeInfo.storeName}}</view>
</view> </view>
</view> </view>
<view class="width90 backcorfff mart80 qrcs"> <view class="width90 backcorfff mart80 qrcs">
<view class="width100 fotct" v-if="couponDesInfo.couponInfo.couponSource == 4"> <view class="relybtn font13 fcorfff fotct mart15" v-if="couponDesInfo.couponInfo.couponSource == 5"
@click="getVerifyQRCode(couponDesInfo.highUserCoupon.id)">刷新二维码</view>
<view class="width90 mart10 marb10 fotct" v-if="couponDesInfo.couponInfo.couponSource == 5">
<image class="coupon-qr" :src="imageqrUrl+qrimageurl"></image>
</view>
<!-- #ifdef MP -->
<button class="coupne-btn font14 width80" v-if="couponDesInfo.couponInfo.couponSource == 5"
@click="jumpzyhk">前往"中油好客e站小程序"</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<wx-open-launch-weapp style="width: 270px;" v-if="couponDesInfo.couponInfo.couponSource == 5"
id="launch-btn" username="gh_5fb54244cdbb">
<script type="text/wxtag-template">
<style>
.btn {
padding: 12px;
}
.download {
color: #ffffff;
background: #0083f5;
width:100%;
height:100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
</style>
<button class="download btn" style="height:50px;width:100%;border:none;">前往"中油好客e站小程序"</button>
</script>
</wx-open-launch-weapp>
<!-- #endif -->
<view class="width100 mart10 fotct" v-if="couponDesInfo.couponInfo.couponSource == 4">
<view class="font28 fontlet mart5 marb10" style="color: #1593c3;">视频教程</view> <view class="font28 fontlet mart5 marb10" style="color: #1593c3;">视频教程</view>
<yy-video-player :auto-play="false" :url="imagewxUrl+imgadres3" :poster="poster" :show-back-btn="true"> <yy-video-player :auto-play="false" :url="imagewxUrl+imgadres3" :poster="poster" :show-back-btn="true">
</yy-video-player> </yy-video-player>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image> <image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image>
</view> </view>
<!-- <view class="width100 mart10 fotct" v-if="couponDesInfo.couponInfo.couponSource == 5">
<view class="font28 fontlet mart5 marb10" style="color: #1593c3;">视频教程</view>
<yy-video-player :auto-play="false" :url="imagewxUrl+imgadres6" :poster="poster" :show-back-btn="true">
</yy-video-player>
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="mart10"></image>
</view> -->
<view class="mart20 fotct fcorred font15 marb20 height20" <view class="mart20 fotct fcorred font15 marb20 height20"
v-if="couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0"> v-if="couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0">
预约订单已成功 门店会在24小时内联系您</view> 预约订单已成功 门店会在24小时内联系您</view>
@ -33,17 +78,20 @@
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource == 3"> v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource == 3">
请出示核销码(商户扫客户)</view> 请出示核销码(商户扫客户)</view>
<view class="mart20 fotct fcorred font15 marb20 height20" <view class="mart20 fotct fcorred font15 marb20 height20"
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 3"> v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 3 && couponDesInfo.couponInfo.couponSource != 5">
请告知加油员用码商支付</view> 请告知加油员用码商支付</view>
<view class="width90 mart20 fotct" v-if="!couponDesInfo.couponInfo.reserveStatus"> <view class="width90 mart20 fotct" v-if="couponDesInfo.couponInfo.reserveStatus">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"></image> <image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"></image>
</view> </view>
<view class="fotct fcor333 font15 marb10 mart10" <view class="fotct fcor333 font15 marb10 mart10"
v-if="couponDesInfo.couponInfo.couponSource != 4 && couponDesInfo.couponCodeInfo.codeKey"> v-if="couponDesInfo.couponInfo.couponSource != 4 && couponDesInfo.couponInfo.couponSource != 5">
{{couponDesInfo.couponCodeInfo.codeKey}} {{couponDesInfo.couponCodeInfo.codeKey}}
</view> </view>
</view> </view>
<view class="width90 mart10 googscs backcorfff" v-if="couponDesInfo.couponInfo.couponSource != 4"> <view class="width90 mart10 googscs backcorfff"
v-if="couponDesInfo.couponInfo.couponSource != 4 && couponDesInfo.couponInfo.couponSource != 5">
<view class="width90 height45l font18 fcor666 aliitem" v-if="storeList"> <view class="width90 height45l font18 fcor666 aliitem" v-if="storeList">
<view class="width50 alijusstart"> <view class="width50 alijusstart">
<image mode="widthFix" style="width: 50rpx; max-height: 50rpx;margin-right: 10px;" <image mode="widthFix" style="width: 50rpx; max-height: 50rpx;margin-right: 10px;"
@ -69,6 +117,7 @@
</view> </view>
</view> </view>
<view class="height60"></view> <view class="height60"></view>
</view> </view>
</template> </template>
@ -76,8 +125,12 @@
import { import {
getUserCouponDetail, getUserCouponDetail,
getStoreListByCoupon, getStoreListByCoupon,
againReceiveCoupon getVerifyQRCode,
} from "../../../Utils/Api.js" verifyWx
} from "../../../Utils/Api.js";
// #ifdef H5
var wx = require('jweixin-module');
// #endif
import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue' import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue'
let app = getApp() let app = getApp()
export default { export default {
@ -89,10 +142,13 @@
couDesId: '', couDesId: '',
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imageqrUrl: app.globalData.imageqrImg,
imgadres1: 'dhl.png', imgadres1: 'dhl.png',
imgadres2: 'video.jpg', imgadres2: 'video.jpg',
imgadres3: 'playVideo.mp4', imgadres3: 'playVideo.mp4',
imgadres: 'noorder.png', imgadres: 'noorder.png',
imgadres5: 'petrovideo.jpg', //
imgadres6: 'petroplayVideo.mp4', //
couponDesInfo: [], couponDesInfo: [],
storeList: [], storeList: [],
oneTime: '', oneTime: '',
@ -101,13 +157,46 @@
menddesId: '', menddesId: '',
pageNum: 1, pageNum: 1,
pageSize: 1, pageSize: 1,
isNoMoreData: false isNoMoreData: false,
qrimageurl: '', //
} }
}, },
onLoad(option) { onLoad(option) {
this.couDesId = option.id; this.couDesId = option.id;
this.menddesId = option.mendId; this.menddesId = option.mendId;
this.getUserCouponDetail(); this.getUserCouponDetail();
},
created() {
// #ifdef H5
uni.showLoading({
title: '加载中'
})
let url = window.location.href.split('#')[0];
let datas = {
url: url
}
verifyWx(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
wx.config({
debug: false, // ,alert
appId: res.return_data.appId, //
timestamp: res.return_data.timestamp, //
nonceStr: res.return_data.nonceStr, //
signature: res.return_data.signature, //
jsApiList: ['onMenuShareTimeline'], // 使JS
openTagList: ['wx-open-launch-weapp'] // 使
});
wx.ready(function(res) {});
wx.error(function(err) {});
}
});
// #endif
},
onUnload() {
clearInterval(this.Timer);
}, },
filters: { filters: {
// //
@ -127,8 +216,7 @@
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`; return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
} }
}, },
onReachBottom() { onReachBottom() {},
},
methods: { methods: {
// //
getUserCouponDetail() { getUserCouponDetail() {
@ -142,7 +230,11 @@
if (res.return_code == '000000') { if (res.return_code == '000000') {
this.couponDesInfo = res.return_data; this.couponDesInfo = res.return_data;
uni.hideLoading(); uni.hideLoading();
if (res.return_data.couponInfo.couponSource == 4) { if (res.return_data.couponInfo.couponSource == 5) {
this.getVerifyQRCode(res.return_data.highUserCoupon.id);
}
if (res.return_data.couponInfo.couponSource == 4 || res.return_data.couponInfo
.couponSource == 5) {
this.oneTime = res.return_data.highUserCoupon.createTime; this.oneTime = res.return_data.highUserCoupon.createTime;
this.twoTime = res.return_data.highUserCoupon.useEndTime; this.twoTime = res.return_data.highUserCoupon.useEndTime;
this.threeTime = res.return_data.highUserCoupon.consumeTime; this.threeTime = res.return_data.highUserCoupon.consumeTime;
@ -157,6 +249,19 @@
} }
}) })
}, },
//
getVerifyQRCode(item) {
let params = {
userCouponId: item
}
getVerifyQRCode(params).then(res => {
if (res.return_code == '000000') {
this.qrimageurl = res.return_data;
clearInterval(this.Timer);
this.setTimer();
}
});
},
// //
seeloaction(e) { seeloaction(e) {
uni.openLocation({ uni.openLocation({
@ -206,35 +311,46 @@
} }
}) })
}, },
// //
againReceiveCoupon() { jumpzyhk() {
uni.showLoading({ // #ifdef MP
title: '领取中...' uni.navigateToMiniProgram({
appId: 'wx7cd1712834749dcb',
extraData: {
'data1': 'release'
},
success(res) {
//
}
}) })
let params = { // #endif
couponId: this.couponDesInfo.couponInfo.id
} // #ifdef H5
againReceiveCoupon(params).then(res => { // location.href = 'weixin://dl/business/?t=khJZppojuyo';
if (res.return_code == '000000') { // #endif
uni.hideLoading();
uni.showToast({ },
icon: 'none', Timer() {},
title: '领取成功', //
duration: 2000 setTimer() {
}) let that = this;
this.couponDesInfo = res.return_data; let holdTime = 60;
this.oneTime = res.return_data.highUserCoupon.createTime; that.Timer = setInterval(() => {
this.twoTime = res.return_data.highUserCoupon.useEndTime; if (holdTime <= 0) {
this.threeTime = res.return_data.highUserCoupon.consumeTime; uni.showModal({
} else { title: '提示',
uni.hideLoading(); content: '当前二维码已失效,请刷新后展示',
uni.showToast({ success: function(res) {
icon: 'none', if (res.confirm) {
title: res.return_msg, that.getVerifyQRCode(that.couponDesInfo.highUserCoupon.id);
duration: 2000 }
}
}) })
clearInterval(that.Timer);
return;
} }
}) holdTime--;
}, 1000)
}, },
scan() { scan() {
uni.scanCode({ uni.scanCode({
@ -253,6 +369,16 @@
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.relybtn {
background-color: #0083f5;
width: 110px;
margin-left: auto;
margin-right: auto;
height: 30px;
border-radius: 5px;
line-height: 30px;
}
.couhead { .couhead {
position: absolute; position: absolute;
top: 20px; top: 20px;
@ -273,6 +399,7 @@
.couStu { .couStu {
background-color: #dceefe; background-color: #dceefe;
color: #0076dd; color: #0076dd;
font-size: 12px;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
width: 60px; width: 60px;
@ -284,6 +411,7 @@
border-top-style: dotted; border-top-style: dotted;
border-top-color: #f6f6f6; border-top-color: #f6f6f6;
padding-bottom: 20px; padding-bottom: 20px;
text-align: center;
border-radius: 0px 0px 5px 5px; border-radius: 0px 0px 5px 5px;
} }
@ -351,18 +479,18 @@
border-radius: 10px; border-radius: 10px;
} }
.coupne-btn {
position: fixed;
bottom: 0px;
background-color: red;
color: #FFFFFF;
border-radius: 0px;
}
.czlq { .czlq {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
background-color: red; background-color: red;
color: #FFFFFF; color: #FFFFFF;
} }
.coupne-btn {
background-color: #0083f5;
color: #FFFFFF;
height: 45px;
line-height: 45px;
border-radius: 0px;
}
</style> </style>

@ -21,8 +21,11 @@
消费时间:{{threeTime | formatDate('-')}}</view> 消费时间:{{threeTime | formatDate('-')}}</view>
</view> </view>
</view> </view>
<view class="width90 mart5 font13 fcor666" v-if="couponDesInfo.couponAgentCode.convertUserPhone != null ">
客户电话:{{couponDesInfo.couponAgentCode.convertUserPhone}}</view>
<view class="width90 mart5 font13 fcor666" v-if="couponDesInfo.couponAgentCode.remark != null "> <view class="width90 mart5 font13 fcor666" v-if="couponDesInfo.couponAgentCode.remark != null ">
备注:{{couponDesInfo.couponAgentCode.remark}}</view> 备注:{{couponDesInfo.couponAgentCode.remark}}</view>
<view class="width100" v-if="couponDesInfo.couponInfo.couponSource != 4"> <view class="width100" v-if="couponDesInfo.couponInfo.couponSource != 4">
<view class="width90 mart5 font13 fcor666" v-if="couponDesInfo.couponCode != null"> <view class="width90 mart5 font13 fcor666" v-if="couponDesInfo.couponCode != null">
加油站点:{{couponDesInfo.couponCode.storeName}}</view> 加油站点:{{couponDesInfo.couponCode.storeName}}</view>
@ -36,10 +39,17 @@
</view> </view>
</view> </view>
<view class="width90" <view class="width90"
v-if="couponDesInfo.couponAgentCode.status !=3 && couponDesInfo.couponAgentCode.type != 1"> v-if="couponDesInfo.couponAgentCode.status !=3 && couponDesInfo.couponAgentCode.type != 1 && couponDesInfo.couponInfo.couponSource != 5">
<view class="width90 mart10 fcor666">点击下方复制按钮,复制兑换码发送用户</view> <view class="width90 mart10 fcor666">点击下方复制按钮,复制兑换码发送用户</view>
<view class="mart30 fotct font18 marb20 fcor666">{{couponDesInfo.couponAgentCode.convertCode}}</view> <view class="mart30 fotct font18 marb20 fcor666">{{couponDesInfo.couponAgentCode.convertCode}}</view>
<view class="btn90w mart40" @click="copycont(couponDesInfo.couponAgentCode.convertCode)">复制兑换码</view> <view class="btn90w mart40" @click="copycont(couponDesInfo.couponAgentCode.convertCode)">复制兑换码</view>
</view>
<view class="width90"
v-if="couponDesInfo.couponInfo.couponSource == 5">
<view class="width90 mart10 fcor666">点击下方复制按钮,复制链接发送用户微信</view>
<view class="mart30 fotct font14 marb20 fcor666">#小程序://e/YCjV6saueaTanhF</view>
<view class="btn90w mart40" @click="copycontmini">复制链接</view>
</view> </view>
</view> </view>
<!-- <view class="width90" v-if="couponDesInfo.couponCode.status ==3 && couponDesInfo.couponAgentCode.type != 1"> <!-- <view class="width90" v-if="couponDesInfo.couponCode.status ==3 && couponDesInfo.couponAgentCode.type != 1">
@ -113,14 +123,15 @@
uni.hideLoading() uni.hideLoading()
if (res.return_code == '000000') { if (res.return_code == '000000') {
this.couponDesInfo = res.return_data; this.couponDesInfo = res.return_data;
if (res.return_data.couponInfo.couponSource != 4) { if (res.return_data.couponInfo.couponSource != 4 && res.return_data.couponInfo
if(res.return_data.couponCode != null){ .couponSource != 5) {
this.oneTime = res.return_data.couponCode.receiveTime; if (res.return_data.couponCode != null) {
this.twoTime = res.return_data.couponCode.useEndTime; this.oneTime = res.return_data.couponCode.receiveTime;
this.threeTime = res.return_data.couponCode.consumeTime; this.twoTime = res.return_data.couponCode.useEndTime;
this.threeTime = res.return_data.couponCode.consumeTime;
} }
return; return;
} }
this.oneTime = res.return_data.couponCodeOther.activeTime; this.oneTime = res.return_data.couponCodeOther.activeTime;
this.twoTime = res.return_data.couponCodeOther.validEndDate; this.twoTime = res.return_data.couponCodeOther.validEndDate;
} }
@ -167,6 +178,15 @@
} }
}) })
},
//
copycontmini() {
uni.setClipboardData({
data: '#小程序://中油好客e站/YCjV6saueaTanhF',
success: function() {
}
})
} }
} }
} }

@ -26,7 +26,15 @@
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666"> <view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> <image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view> </view>
<view class="product-list mart20 width90"> <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 mart10"
v-if="couponsDetails.highDiscountAgentCode.status != 1"></image>
</view>
<view class="product-list mart20 width90" v-if="couponsDetails.highDiscount.usingRange != 5">
<view class="product" v-for="product in minecoupones" :key="product.id" <view class="product" v-for="product in minecoupones" :key="product.id"
@tap="toGoods(product.highCoupon.id,product.highCoupon.couponSource)"> @tap="toGoods(product.highCoupon.id,product.highCoupon.couponSource)">
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image> <image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image>
@ -56,6 +64,34 @@
@getuserinfo="getuserinfo" withCredentials="true">点击领取</button> @getuserinfo="getuserinfo" withCredentials="true">点击领取</button>
<button class="coupne-btn width100" v-else @click="receiveDiscount">点击领取</button> --> <button class="coupne-btn width100" v-else @click="receiveDiscount">点击领取</button> -->
<!-- <authorize></authorize> --> <!-- <authorize></authorize> -->
<view :style="{display: usercouFeedbackHidden}" class="popup_content">
<view class="popup_title font18 fcor333 fontwig6 paddtop10">温馨提示</view>
<view class="popup_title font16 fcor666 paddtop20 height60">请在有效期30天内使用过期作废</view>
<view class="width100 bor-botm1 mart10"></view>
<view class="alijus width90 mart20">
<view class="width40" style="margin-right: 5%;" @click="hideDiv()">
<view class="width100 btnno font16 backcor99">取消</view>
</view>
<wx-open-launch-weapp style="width: 40%;margin-left: 5%;" id="launch-btn" username="gh_5fb54244cdbb">
<script type="text/wxtag-template">
<style>
.download {
color: #ffffff;
background: #0083f5;
width:100%;
height:100%;
align-items: center;
justify-content: center;
font-size: 16px;
}
</style>
<button class="download" style="height:40px;line-height: 40PX;width:100%;border:none;">立即使用</button>
</script>
</wx-open-launch-weapp>
</view>
</view>
<view class="popup_overlay" :style="{display: usercouFeedbackHidden}" @click="hideDiv()"></view>
</view> </view>
</template> </template>
@ -67,8 +103,13 @@
HandleCode, HandleCode,
getUserInfo, getUserInfo,
getH5AccessToken, getH5AccessToken,
loginByPhone loginByPhone,
verifyWx,
useDiscount
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
// #ifdef H5
var wx = require('jweixin-module');
// #endif
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
@ -77,13 +118,17 @@
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'noorder.png', imgadres: 'noorder.png',
imgadres1: 'noCoupon.jpg',
imgadres2: 'onCoupon.jpg',
imgadres3: 'showCoupon.jpg',
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
isNoMoreData: false, isNoMoreData: false,
couponsDetails: '', couponsDetails: '',
salesEndTime: '', salesEndTime: '',
codes: '', codes: '',
userInfo: '' userInfo: '',
usercouFeedbackHidden: 'none', //
} }
}, },
filters: { filters: {
@ -129,6 +174,34 @@
this.getDiscountByQrCode(); this.getDiscountByQrCode();
}, },
created() {
// #ifdef H5
uni.showLoading({
title: '加载中'
})
let url = window.location.href.split('#')[0];
let datas = {
url: url
}
verifyWx(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
wx.config({
debug: false, // ,alert
appId: res.return_data.appId, //
timestamp: res.return_data.timestamp, //
nonceStr: res.return_data.nonceStr, //
signature: res.return_data.signature, //
jsApiList: ['onMenuShareTimeline'], // 使JS
openTagList: ['wx-open-launch-weapp'] // 使
});
wx.ready(function(res) {});
wx.error(function(err) {});
}
});
// #endif
},
methods: { methods: {
// //
getDiscountByQrCode() { getDiscountByQrCode() {
@ -156,6 +229,30 @@
}); });
}, },
//使
useDiscount() {
let datas = {
discountAgentCodeId: this.couponsDetails.highDiscountAgentCode.id
}
useDiscount(datas).then(res => {
if (res.return_code == '000000') {
this.onhiddle();
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
},
//
onhiddle() {
this.usercouFeedbackHidden = 'block';
},
hideDiv() { //
this.usercouFeedbackHidden = 'none';
},
// //
getCouponByDiscount(item) { getCouponByDiscount(item) {
let params = { let params = {
@ -184,6 +281,7 @@
title: res.return_data, title: res.return_data,
duration: 2000 duration: 2000
}) })
this.getDiscountByQrCode();
} else { } else {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
@ -289,6 +387,12 @@
duration: 2000 duration: 2000
}) })
} }
},
//
jumpCounlist() {
uni.reLaunch({
url: '/pages/user/coupon/coupon'
})
} }
} }
@ -300,6 +404,43 @@
// margin-right: 90px; // margin-right: 90px;
} }
.popup_content {
position: fixed;
top: 40%;
left: 50%;
width: 520upx;
height: 400upx;
margin-left: -270upx;
margin-top: -270upx;
border: 10px solid white;
background-color: white;
z-index: 1002;
overflow: auto;
border-radius: 20upx;
}
.popup_title {
display: flex;
justify-content: center;
text-align: center;
width: 480upx;
}
//
.popup_overlay {
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.8;
opacity: .80;
filter: alpha(opacity=88);
}
.coupon-img { .coupon-img {
width: 80px; width: 80px;
height: 80px; height: 80px;
@ -359,4 +500,12 @@
.coupne-btn { .coupne-btn {
color: #FFFFFF; color: #FFFFFF;
} }
.btnno {
height: 40px;
line-height: 40PX;
display: flex;
justify-content: center;
color: #ffffff;
}
</style> </style>

@ -58,7 +58,7 @@
</view> </view>
<view class="mart10 width100 font14 fcor999 height20"> <view class="mart10 width100 font14 fcor999 height20">
<view class="width70 flleft">有效期至: {{goodsData[0].salesEndTime | formatDate('-')}}</view> <view class="width70 flleft">有效期至: {{goodsData[0].salesEndTime | formatDate('-')}}</view>
<view class="width30 flright fotrt" v-if="goodsData[0].couponSource != 4">库存 : <view class="width30 flright fotrt" v-if="goodsData[0].couponSource != 4 && goodsData[0].couponSource != 5 ">库存 :
{{goodsData[0].stockCount}} {{goodsData[0].stockCount}}
</view> </view>
</view> </view>
@ -306,13 +306,14 @@
}, },
buy() { buy() {
let that = this; let that = this;
if (this.goodsData[0].stockCount == 0 && this.goodsData[0].couponSource != 4) { if (this.goodsData[0].stockCount == 0 && this.goodsData[0].couponSource != 4 && this.goodsData[0].couponSource != 5) {
uni.showToast({ uni.showToast({
title: '库存不足', title: '库存不足',
icon: "none" icon: "none"
}); });
return; return;
} }
if(this.goodsData[0].reserveStatus && this.storeName == ''){ if(this.goodsData[0].reserveStatus && this.storeName == ''){
uni.showToast({ uni.showToast({
title: '请选择门店', title: '请选择门店',

@ -1,12 +1,6 @@
<template> <template>
<view> <view>
<view class="width100" v-if="couponDesInfo"> <view class="width100" v-if="couponDesInfo">
<view class="width100 fotct coupon-status font20 fcorred" v-if="couponDesInfo.couponCodeInfo.status == 3">
已使用
</view>
<view class="width100 fotct coupon-status font20 fcor41c" v-if="couponDesInfo.couponCodeInfo.status == 2">
未使用
</view>
<view class="line1"></view> <view class="line1"></view>
<view class="width90"> <view class="width90">
<view class="flright fotct"> <view class="flright fotct">
@ -25,49 +19,70 @@
</view> </view>
<view class="line1 mart15"></view> <view class="line1 mart15"></view>
<view class="relybtn font13 fcorfff fotct mart20 marb10" v-if="couponDesInfo.couponInfo.couponSource == 5"
@click="getVerifyQRCode(couponDesInfo.highUserCoupon.id)">刷新二维码</view>
<view class="width90 mart20 fotct" v-if="couponDesInfo.couponInfo.couponSource == 5">
<image class="coupon-qr" :src="imageqrUrl+qrimageurl">
</image>
</view>
<view class="fotct">
<!-- #ifdef MP -->
<button class="coupnejump-btn font14 width80" v-if="couponDesInfo.couponInfo.couponSource == 5"
@click="jumpzyhk">前往"中油好客e站小程序"</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<wx-open-launch-weapp style="width: 270px;" v-if="couponDesInfo.couponInfo.couponSource == 5"
id="launch-btn" username="gh_5fb54244cdbb">
<script type="text/wxtag-template">
<style>
.btn {
padding: 12px;
}
.download {
color: #ffffff;
background: #0083f5;
width:100%;
height:100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
</style>
<button class="download btn" style="height:50px;width:100%;border:none;">前往"中油好客e站小程序"</button>
</script>
</wx-open-launch-weapp>
<!-- #endif -->
</view>
<view class="width100 fotct" v-if="couponDesInfo.couponInfo.couponSource == 4"> <view class="width100 fotct" v-if="couponDesInfo.couponInfo.couponSource == 4">
<view class="font28 fontlet mart5 marb10" style="color: #1593c3;">视频教程</view> <view class="font28 fontlet mart5 marb10" style="color: #1593c3;">视频教程</view>
<yy-video-player :auto-play="false" :url="imagewxUrl+imgadres3" :poster="poster" :show-back-btn="true"> <yy-video-player :auto-play="false" :url="imagewxUrl+imgadres3" :poster="poster" :show-back-btn="true">
</yy-video-player> </yy-video-player>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image> <image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image>
</view> </view>
<view class="width100"> <view class="width100">
<view class="mart20 fotct fcorred font15 marb20" <view class="mart20 fotct fcorred font15 marb20"
v-if="couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0">预约订单已成功 v-if="couponDesInfo.couponInfo.reserveStatus && coupstus != 0">预约订单已成功
门店会在24小时内联系您</view> 门店会在24小时内联系您</view>
<view class="mart20 fotct fcorred font15 marb20" <view class="mart20 fotct fcorred font15 marb20"
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource == 3"> v-if="!couponDesInfo.couponInfo.reserveStatus && coupstus != 0 && couponDesInfo.couponInfo.couponSource == 3">
请出示核销码(商户扫客户)</view> 请出示核销码(商户扫客户)</view>
<view class="mart20 fotct fcorred font15 marb20" <view class="mart20 fotct fcorred font15 marb20"
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 3"> v-if="!couponDesInfo.couponInfo.reserveStatus && coupstus != 0 && couponDesInfo.couponInfo.couponSource != 3 && couponDesInfo.couponInfo.couponSource != 5">
请告知加油员用码商支付</view> 请告知加油员用码商支付</view>
<view class="width90 mart20 fotct" v-if="!couponDesInfo.couponInfo.reserveStatus"> <view class="width90 mart20 fotct" v-if="couponDesInfo.couponInfo.reserveStatus">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"> <image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg">
</image> </image>
</view> </view>
</view> </view>
<view class="width90 mart30 font20 fcor333 fotct marb40" v-if="!couponDesInfo">二维码生效中,前往个人中心查看</view> <view class="width90 mart30 font20 fcor333 fotct marb40" v-if="!couponDesInfo">二维码生效中,前往个人中心查看</view>
<!-- <view class="width90 mart20" style="height: 80px;" v-for="(store,i) in storeList" :key="i">
<view class="coupon-des flleft">
<image mode="widthFix" :src="imageUrl+store.ext1"></image>
</view>
<view class="coupon-cont-dh">
<view class="coupon-title flleft width70">
<view class="font20 fcor333 fontwig6 width100 text1">{{store.storeName}}</view>
<view class="font14 fcor999 width100 text2 mart5">{{store.address}}</view>
</view>
<view class="coupon-map flright width30 fotct" @click="seeloaction(store)">
<image :src="imagewxUrl+imgadres1">
</image>
<view class="mart5 fcor999 font13">{{store.distance}}km</view>
</view>
</view>
</view> -->
</view> </view>
<view class="width90 height45l font18 fcor666 aliitem" v-if="storeList"> <view class="width90 height45l font18 fcor666 aliitem" v-if="storeList != ''">
<view class="width50 alijusstart"> <view class="width50 alijusstart">
<image mode="widthFix" style="width: 50rpx; max-height: 50rpx;margin-right: 10px;" <image mode="widthFix" style="width: 50rpx; max-height: 50rpx;margin-right: 10px;"
src="../../../static/img/adresw.png"></image> 门店信息 src="../../../static/img/adresw.png"></image> 门店信息
@ -103,10 +118,15 @@
import { import {
getUserNewCouponDetail, getUserNewCouponDetail,
getStoreListByCoupon, getStoreListByCoupon,
getActivityByCoupon getActivityByCoupon,
getVerifyQRCode,
verifyWx
} from "../../../Utils/Api.js"; } from "../../../Utils/Api.js";
import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue'; import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
// #ifdef H5
var wx = require('jweixin-module');
// #endif
let app = getApp() let app = getApp()
export default { export default {
components: { components: {
@ -118,8 +138,11 @@
couDesId: '', couDesId: '',
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres2: 'video.jpg', imageqrUrl: app.globalData.imageqrImg,
imgadres3: 'playVideo.mp4', imgadres2: 'video.jpg', //
imgadres3: 'playVideo.mp4', //
imgadres5: 'petrovideo.jpg', //
imgadres6: 'petroplayVideo.mp4', //
imgadres4: 'activityimg.png', imgadres4: 'activityimg.png',
imgadres1: 'dhl.png', imgadres1: 'dhl.png',
couponDesInfo: [], couponDesInfo: [],
@ -129,7 +152,9 @@
threeTime: '', threeTime: '',
pageNum: 1, pageNum: 1,
pageSize: 1, pageSize: 1,
isNoMoreData: false isNoMoreData: false,
qrimageurl: '', //
coupstus: 0
} }
}, },
onLoad(option) { onLoad(option) {
@ -137,6 +162,34 @@
this.getUserNewCouponDetail(); this.getUserNewCouponDetail();
this.getActivityByCoupon(); this.getActivityByCoupon();
}, },
created() {
// #ifdef H5
uni.showLoading({
title: '加载中'
})
let url = window.location.href.split('#')[0];
let datas = {
url: url
}
verifyWx(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
wx.config({
debug: false, // ,alert
appId: res.return_data.appId, //
timestamp: res.return_data.timestamp, //
nonceStr: res.return_data.nonceStr, //
signature: res.return_data.signature, //
jsApiList: ['onMenuShareTimeline'], // 使JS
openTagList: ['wx-open-launch-weapp'] // 使
});
wx.ready(function(res) {});
wx.error(function(err) {});
}
});
// #endif
},
filters: { filters: {
// //
formatDate: function(value, spe = '/') { formatDate: function(value, spe = '/') {
@ -171,7 +224,12 @@
if (res.return_code == '000000') { if (res.return_code == '000000') {
uni.hideLoading(); uni.hideLoading();
this.couponDesInfo = res.return_data; this.couponDesInfo = res.return_data;
if (res.return_data.couponInfo.couponSource == 4) { this.coupstus = res.return_data.highUserCoupon.status;
if (res.return_data.couponInfo.couponSource == 5) {
this.getVerifyQRCode(res.return_data.highUserCoupon.id);
}
if (res.return_data.couponInfo.couponSource == 4 || res.return_data.couponInfo
.couponSource == 5) {
this.oneTime = res.return_data.highUserCoupon.createTime; this.oneTime = res.return_data.highUserCoupon.createTime;
this.twoTime = res.return_data.highUserCoupon.useEndTime; this.twoTime = res.return_data.highUserCoupon.useEndTime;
this.threeTime = res.return_data.highUserCoupon.consumeTime; this.threeTime = res.return_data.highUserCoupon.consumeTime;
@ -186,6 +244,41 @@
} }
}) })
}, },
//
getVerifyQRCode(item) {
let params = {
userCouponId: item
}
getVerifyQRCode(params).then(res => {
if (res.return_code == '000000') {
this.qrimageurl = res.return_data;
clearInterval(this.Timer);
this.setTimer();
}
});
},
Timer() {},
//
setTimer() {
let that = this;
let holdTime = 60;
that.Timer = setInterval(() => {
if (holdTime <= 0) {
uni.showModal({
title: '提示',
content: '当前二维码已失效,请刷新后展示',
success: function(res) {
if (res.confirm) {
that.getVerifyQRCode(that.couponDesInfo.highUserCoupon.id);
}
}
})
clearInterval(that.Timer);
return;
}
holdTime--;
}, 1000)
},
// //
showPopup() { showPopup() {
this.$refs.popup.show(); this.$refs.popup.show();
@ -212,6 +305,18 @@
url: '../../../subPages/lottery/lottery?id=' + this.couDesId url: '../../../subPages/lottery/lottery?id=' + this.couDesId
}) })
}, },
//
jumpzyhk() {
uni.navigateToMiniProgram({
appId: 'wx7cd1712834749dcb',
extraData: {
'data1': 'release'
},
success(res) {
//
}
})
},
// //
jumpstorelist() { jumpstorelist() {
uni.navigateTo({ uni.navigateTo({
@ -284,6 +389,23 @@
height: 440px; height: 440px;
} }
.relybtn {
background-color: #0083f5;
width: 110px;
margin-left: auto;
margin-right: auto;
height: 30px;
border-radius: 5px;
line-height: 30px;
}
.jumpbtn {
background-color: #0083f5;
height: 40px;
border-radius: 5px;
line-height: 40px;
}
.loading-text { .loading-text {
width: 100%; width: 100%;
display: flex; display: flex;
@ -348,11 +470,19 @@
border-radius: 10px; border-radius: 10px;
} }
.coupnejump-btn {
background-color: #0083f5;
color: #FFFFFF;
height: 45px;
line-height: 45px;
border-radius: 0px;
}
.coupne-btn { .coupne-btn {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
background-color: red; background-color: #0083f5;
color: #FFFFFF; color: #FFFFFF;
border-radius: 0px; border-radius: 0px;
} }
</style> </style>

@ -127,7 +127,7 @@
jumpMp() { jumpMp() {
if (!app.globalData.openId) { if (!app.globalData.openId) {
location.href = location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FH5%2F%23%2Fpages%2Fgoods%2FexternalCoupon%2FexternalCoupon&response_type=code&scope=snsapi_base#wechat_redirect'; 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FH5%2F%23%2Fpages%2Fgoods%2FexternalCoupon%2FexternalCoupon&response_type=code&scope=snsapi_base#wechat_redirect';
} else { } else {
uni.reLaunch({ uni.reLaunch({
url: '../../goods/externalCoupon/externalCoupon' url: '../../goods/externalCoupon/externalCoupon'

@ -253,53 +253,53 @@
}) })
}, },
}) })
// #endif
// //
that.postionIng(); that.postionIng();
// #endif
// #ifdef H5 // #ifdef H5
// if (app.globalData.h5code) { // if (app.globalData.h5code) {
// that.getH5AccessToken(); // that.getH5AccessToken();
// } // }
// uni.showLoading({ uni.showLoading({
// title: '' title: '加载中'
// }) })
// var geolocation = new qq.maps.Geolocation('7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', ""); var geolocation = new qq.maps.Geolocation('7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', "嗨森逛");
// //
// geolocation.getLocation( geolocation.getLocation(
// res => { res => {
// uni.hideLoading(); uni.hideLoading();
// app.globalData.latitude = res.lat; app.globalData.latitude = res.lat;
// app.globalData.longitude = res.lng; app.globalData.longitude = res.lng;
// uni.setStorage({ uni.setStorage({
// key: "latitude", key: "latitude",
// data: res.lat data: res.lat
// }) })
// uni.setStorage({ uni.setStorage({
// key: "longitude", key: "longitude",
// data: res.lng data: res.lng
// }) })
// that.findByLatAndLng(res.lng, res.lat); that.findByLatAndLng(res.lng, res.lat);
// }, },
// err => { err => {
// uni.hideLoading(); uni.hideLoading();
// uni.showModal({ uni.showModal({
// title: ',', title: '获取定位权限失败,默认城市重庆市',
// content: '' content: '请确定手机定位已打开,并且当前浏览器允许获取定位,都开启后请刷新页面。'
// }) })
// that.city = ''; that.city = '重庆市';
// app.globalData.cityName = ''; app.globalData.cityName = '重庆市';
// app.globalData.cityId = '500000'; app.globalData.cityId = '500000';
// that.getCouponListArea(); that.getCouponListArea();
// that.getCouponListgold(); that.getCouponListgold();
// that.getunioncardCouponListgold(); that.getunioncardCouponListgold();
// that.getCmsContent(); that.getCmsContent();
// that.getCmsAactibity(); that.getCmsAactibity();
// that.getCmsContentcmshome(); that.getCmsContentcmshome();
// that.getCmsContentcmsContent(); that.getCmsContentcmsContent();
// } }
// ); );
// #endif // #endif
uni.getStorage({ uni.getStorage({
key: "user", key: "user",
@ -456,21 +456,10 @@
success: function(res) { success: function(res) {
app.globalData.latitude = res.latitude; app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude; app.globalData.longitude = res.longitude;
uni.setStorage({
key: "latitude",
data: res.latitude
})
uni.setStorage({
key: "longitude",
data: res.longitude
})
uni.hideLoading(); uni.hideLoading();
that.findByLatAndLng(res.longitude, res.latitude); that.findByLatAndLng(res.longitude, res.latitude);
}, },
fail: (err) => { fail: (err) => {
uni.hideLoading();
if (err.errCode == 2) { if (err.errCode == 2) {
uni.showToast({ uni.showToast({
title: '请开启系统定位', title: '请开启系统定位',
@ -478,16 +467,6 @@
icon: 'none' icon: 'none'
}) })
} }
that.city = '重庆市';
app.globalData.cityName = '重庆市';
app.globalData.cityId = '500000';
that.getCouponListArea();
that.getCouponListgold();
that.getunioncardCouponListgold();
that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
} }
}) })
}, },
@ -935,11 +914,9 @@
}, },
// //
playPhone() { playPhone() {
let cont = "本服务由惠兑礼品提供\n400-678-738";
let content = cont.replace(/<br>/g, "\n");
uni.showModal({ uni.showModal({
title: '客服', title: '客服',
content: content, content: '4006780738',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.makePhoneCall({ uni.makePhoneCall({
@ -1573,4 +1550,4 @@
background-color: rgba(0, 0, 0, 0.65); background-color: rgba(0, 0, 0, 0.65);
z-index: 310; z-index: 310;
} }
</style> </style>

@ -44,7 +44,7 @@
<view :hidden="userFeedbackHidden" class="popup_content"> <view :hidden="userFeedbackHidden" class="popup_content">
<view class="popup_title">填写信息</view> <view class="popup_title">填写信息</view>
<input class="width85 pop_input font14 mart20 marb10" maxlength="11" v-model="feedPhone" placeholder="请输入手机号" <input class="width85 pop_input font14 mart20 marb10" maxlength="11" v-model="feedPhone" placeholder="请输入手机号"
type="number" v-if="couponSource == 4" /> type="number" v-if="couponSource == 4 || couponSource == 5" />
<view class="popup_textarea_item"> <view class="popup_textarea_item">
<textarea class="popup_textarea" placeholder='请填写您的备注信息...' v-model="feedbackContent"> <textarea class="popup_textarea" placeholder='请填写您的备注信息...' v-model="feedbackContent">
</textarea> </textarea>
@ -252,7 +252,8 @@
} else { } else {
let datas = { let datas = {
couponAgentCodeId: this.couId, couponAgentCodeId: this.couId,
remark: this.feedbackContent remark: this.feedbackContent,
phone: this.feedPhone
} }
generateCode(datas).then(res => { generateCode(datas).then(res => {
uni.hideLoading() uni.hideLoading()

@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<view class="tabr" :style="{top:headerTop}"> <view class="tabr" :style="{top:headerTop}">
<!-- ({{couponcout}}) --> <!-- ({{couponcout}}) -->
<view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">待使用</view> <view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">待使用</view>
<view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">已使用</view> <view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">已使用</view>
@ -13,7 +13,7 @@
<view class="tis" v-if="couponValidList.length==0"> <view class="tis" v-if="couponValidList.length==0">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> <image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view> </view>
<view class="row" v-for="(row,index) in couponValidList" :key="index" @click="jumpcoupons(row)"> <view class="row" v-for="(row,index) in couponValidList" :key="index">
<!-- content --> <!-- content -->
<view class="carrier"> <view class="carrier">
<view class="left"> <view class="left">
@ -42,9 +42,18 @@
<!-- <view class="criteria"> <!-- <view class="criteria">
{{row.highDiscount.discountName}} {{row.highDiscount.discountName}}
</view> --> </view> -->
<view class="use"> <!-- #ifdef MP -->
<view class="use" @click="jumpcoupons(row)">
去使用
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<!-- <view class="btnsclick" v-if="row.highDiscount.usingRange == 5"
@click="useDiscount(row.discountAgentCodeId)"></view> -->
<view class="use" @click="jumpcoupons(row)">
去使用 去使用
</view> </view>
<!-- #endif -->
</view> </view>
</view> </view>
</view> </view>
@ -120,14 +129,46 @@
</view> </view>
</view> </view>
</view> </view>
<view :style="{display: usercouFeedbackHidden}" class="popup_content">
<view class="popup_title font18 fcor333 fontwig6 paddtop10">温馨提示</view>
<view class="popup_title font16 fcor666 paddtop20 height60">请在有效期30天内使用过期作废</view>
<view class="width100 bor-botm1 mart10"></view>
<view class="alijus width90 mart20">
<view class="width40" style="margin-right: 5%;" @click="hideDiv()">
<view class="width100 btnno font16 ">取消</view>
</view>
<wx-open-launch-weapp style="width: 40%;margin-left: 5%;" id="launch-btn" username="gh_5fb54244cdbb">
<script type="text/wxtag-template">
<style>
.download {
color: #ffffff;
background: #0083f5;
width:100%;
height:100%;
align-items: center;
justify-content: center;
font-size: 16px;
}
</style>
<button class="download" style="height:40px;line-height: 40PX;width:100%;border:none;">立即使用</button>
</script>
</wx-open-launch-weapp>
</view>
</view>
<view class="popup_overlay" :style="{display: usercouFeedbackHidden}" @click="hideDiv()"></view>
</view> </view>
</template> </template>
<script> <script>
import { import {
getUserDiscountList getUserDiscountList,
verifyWx,
useDiscount
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
// #ifdef H5
var wx = require('jweixin-module');
// #endif
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
@ -148,7 +189,8 @@
pageSize: 10, pageSize: 10,
isNoMoreData: false, isNoMoreData: false,
loadingText: '', loadingText: '',
couponcout: 0 couponcout: 0,
usercouFeedbackHidden: 'none', //
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -160,6 +202,34 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 1000); }, 1000);
}, },
created() {
// #ifdef H5
uni.showLoading({
title: '加载中'
})
let url = window.location.href.split('#')[0];
let datas = {
url: url
}
verifyWx(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
wx.config({
debug: false, // ,alert
appId: res.return_data.appId, //
timestamp: res.return_data.timestamp, //
nonceStr: res.return_data.nonceStr, //
signature: res.return_data.signature, //
jsApiList: ['onMenuShareTimeline'], // 使JS
openTagList: ['wx-open-launch-weapp'] // 使
});
wx.ready(function(res) {});
wx.error(function(err) {});
}
});
// #endif
},
onLoad() { onLoad() {
this.getUserDiscountList(1); this.getUserDiscountList(1);
//H5 //H5
@ -248,26 +318,76 @@
uni.navigateTo({ uni.navigateTo({
url: '../../../subPages/recharge/recharge' url: '../../../subPages/recharge/recharge'
}) })
} else if (e.highDiscount.useScope == 4) { } else if (e.highDiscount.useScope == 4) {
app.globalData.distinguishid = 1; app.globalData.distinguishid = 1;
uni.navigateTo({ uni.navigateTo({
url: '/qianzhu-KFC/buffet-order/buffet-order' url: '/qianzhu-KFC/buffet-order/buffet-order'
}) })
} else if (e.highDiscount.useScope == 5) { } else if (e.highDiscount.useScope == 5) {
app.globalData.distinguishid = 2; app.globalData.distinguishid = 2;
uni.navigateTo({ uni.navigateTo({
url: '/qianzhu-KFC/buffet-order/buffet-order' url: '/qianzhu-KFC/buffet-order/buffet-order'
}) })
} else if (e.highDiscount.useScope == 6) { } else if (e.highDiscount.useScope == 6) {
uni.navigateTo({ uni.navigateTo({
url: '/member-Recharge/choicepage/choicepage' url: '/member-Recharge/choicepage/choicepage'
}) })
} else{ }else if (e.highDiscount.useScope == 7) {
uni.navigateTo({
url: '/pages/goods/refuel/refuel'
})
} else if (e.highDiscount.usingRange == 5) {
this.useDiscount(e.discountAgentCodeId);
} else {
uni.navigateTo({ uni.navigateTo({
url: '../mineCouponsDestails/mineCouponsDestails?id=' + e.id url: '../mineCouponsDestails/mineCouponsDestails?id=' + e.id
}) })
} }
},
//使
useDiscount(item) {
let datas = {
discountAgentCodeId: item
}
useDiscount(datas).then(res => {
if (res.return_code == '000000') {
// #ifdef MP
uni.showModal({
title: '温馨提示',
content: '请在有效期30天内使用。过期作废!',
success: function(res) {
if (res.confirm) {
uni.navigateToMiniProgram({
appId: 'wx7cd1712834749dcb',
extraData: {
'data1': 'release'
},
success(res) {
//
}
})
}
}
})
// #endif
// #ifdef H5
this.onhiddle();
// #endif
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
},
//
onhiddle() {
this.usercouFeedbackHidden = 'block';
},
hideDiv() { //
this.usercouFeedbackHidden = 'none';
}, },
switchType(type) { switchType(type) {
if (this.typeClass == type) { if (this.typeClass == type) {
@ -308,14 +428,71 @@
view { view {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
}
.btnsclick {
width: 50px;
height: 20px;
justify-content: center;
align-items: center;
font-size: 12px;
border-radius: 20px;
padding: 0 5px;
position: fixed;
margin-top: 50px;
} }
page { page {
position: relative;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.popup_content {
position: fixed;
top: 40%;
left: 50%;
width: 520upx;
height: 400upx;
margin-left: -270upx;
margin-top: -270upx;
border: 10px solid white;
background-color: white;
z-index: 1002;
overflow: auto;
border-radius: 20upx;
}
.popup_title {
display: flex;
justify-content: center;
text-align: center;
width: 480upx;
}
//
.popup_overlay {
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.8;
opacity: .80;
filter: alpha(opacity=88);
}
.btnno {
height: 40px;
line-height: 40PX;
display: flex;
justify-content: center;
color: #ffffff;
background: #999999;
}
.hidden { .hidden {
display: none !important; display: none !important;
} }

@ -137,7 +137,7 @@
}, },
jumpcdx() { jumpcdx() {
location.href = location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'; 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
}, },
} }
} }

Loading…
Cancel
Save