1.对接中石油接口 跳转”好客小程序“

yj-dev
杨杰 2 years ago
parent 03dd170200
commit b80c41bffe
  1. 12
      App.vue
  2. 23
      Utils/Api.js
  3. 2
      index.html
  4. 190
      manifest.json
  5. 222
      pages/goods/coupon-details/coupon-details.vue
  6. 34
      pages/goods/coupons-info-details/coupons-info-details.vue
  7. 5
      pages/goods/goods.vue
  8. 200
      pages/pay/success/success.vue
  9. 5
      pages/user/agentCoupons/agentCoupons.vue
  10. 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',
// v1url:'https://hsg.dctpay.com/v1',
// imgUrl: 'https://hsg.dctpay.com/filesystem/', // imgUrl: 'https://hsg.dctpay.com/filesystem/',
// brestUrl: 'https://hsg.dctpay.com/brest', // brestUrl: 'https://hsg.dctpay.com/brest',
// imageWxImg: 'https://hsg.dctpay.com/filesystem/wxApplets/', // 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',
v1url:'https://hsgcs.dctpay.com/v1',
brestUrl: 'https://hsgcs.dctpay.com/brest', brestUrl: 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/', imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/', 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);
@ -437,6 +449,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 获取用户信息
@ -498,7 +515,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>

@ -1,97 +1,95 @@
{ {
"name": "嗨森逛", "name" : "嗨森逛",
"appid": "__UNI__E807B53", "appid" : "__UNI__E807B53",
"description": "", "description" : "",
"versionName": "1.2.1", "versionName" : "1.2.1",
"versionCode": "100", "versionCode" : "100",
"transformPx": false, "transformPx" : false,
"app-plus": { "app-plus" : {
"usingComponents": true, //``true`` `template` "usingComponents" : true, //``true`` `template`
"softinput": { "softinput" : {
"navBar": "none" // "navBar" : "none" //
}, },
/* 5+App */ /* 5+App */
"splashscreen": { "splashscreen" : {
"alwaysShowBeforeRender": true, "alwaysShowBeforeRender" : true,
"waiting": true, "waiting" : true,
"autoclose": true, "autoclose" : true,
"delay": 0 "delay" : 0
}, },
"modules": { "modules" : {
"Share": {}, "Share" : {},
"OAuth": {} "OAuth" : {}
}, },
/* */ /* */
"distribute": { "distribute" : {
"orientation": ["portrait-primary"], "orientation" : [ "portrait-primary" ],
/* */ /* */
"android": { "android" : {
/* android */ /* android */
"permissions": [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
"ios": {}, "ios" : {},
/* ios */ /* ios */
"sdkConfigs": {} "sdkConfigs" : {}
} }
}, },
/* SDK */ /* SDK */
"quickapp": {}, "quickapp" : {},
/* */ /* */
"mp-weixin": { "mp-weixin" : {
"appid": "wx8d49e2f83025229d", "appid" : "wx8d49e2f83025229d",
"setting": { "setting" : {
"urlCheck": true "urlCheck" : true
}, },
"permission": { "permission" : {
"scope.userLocation": { "scope.userLocation" : {
"desc": "你的位置信息将用于小程序定位" "desc" : "你的位置信息将用于小程序定位"
} }
}, },
"requiredPrivateInfos": [ "requiredPrivateInfos" : [ "getLocation" ]
"getLocation" },
] "h5" : {
}, "sdkConfigs" : {
"h5": { "maps" : {
"sdkConfigs": { "qqmap" : {
"maps": { "key" : "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB"
"qqmap": { }
"key": "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" }
} },
} "title" : "嗨森逛",
}, "router" : {
"title": "嗨森逛", "mode" : "hash",
"router": { "base" : "/hsgH5"
"mode": "hash", },
"base": "/hsgH5" "devServer" : {
}, "port" : "",
"devServer": { "https" : false
"port": "", },
"https": false "domain" : "https://hsgcs.dctpay.com",
}, "template" : "index.html"
"domain": "https://hsgcs.dctpay.com", }
"template": "index.html"
}
} }

@ -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() {
}
})
} }
} }
} }

@ -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,12 @@
<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 class="width100 fotct coupon-status font20 fcorred" v-if="couponDesInfo.couponCodeInfo.status == 3">
已使用 已使用
</view> </view>
<view class="width100 fotct coupon-status font20 fcor41c" v-if="couponDesInfo.couponCodeInfo.status == 2"> <view class="width100 fotct coupon-status font20 fcor41c" v-if="couponDesInfo.couponCodeInfo.status == 2">
未使用 未使用
</view> </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 +25,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>
</view>
<!-- #endif -->
<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 +124,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 +144,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 +158,9 @@
threeTime: '', threeTime: '',
pageNum: 1, pageNum: 1,
pageSize: 1, pageSize: 1,
isNoMoreData: false isNoMoreData: false,
qrimageurl: '', //
coupstus: 0
} }
}, },
onLoad(option) { onLoad(option) {
@ -137,6 +168,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 +230,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 +250,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 +311,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 +395,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 +476,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>

@ -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()

@ -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