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

yj-dev
杨杰 2 years ago
parent 03dd170200
commit b80c41bffe
  1. 4
      App.vue
  2. 19
      Utils/Api.js
  3. 2
      index.html
  4. 188
      manifest.json
  5. 222
      pages/goods/coupon-details/coupon-details.vue
  6. 26
      pages/goods/coupons-info-details/coupons-info-details.vue
  7. 5
      pages/goods/goods.vue
  8. 198
      pages/pay/success/success.vue
  9. 5
      pages/user/agentCoupons/agentCoupons.vue
  10. 2
      pages/welcome/welcome.vue

@ -6,14 +6,18 @@
// imgUrl: 'https://192.168.3.4:9301/filesystem/',
//
// url: 'https://hsg.dctpay.com/crest',
// v1url:'https://hsg.dctpay.com/v1',
// imgUrl: 'https://hsg.dctpay.com/filesystem/',
// 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',
v1url:'https://hsgcs.dctpay.com/v1',
brestUrl: 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg: 'https://hsgcs.dctpay.com/filesystem/wxApplets/',
imageqrImg: 'https://hsgcs.dctpay.com/filesystem/temporary/',
userInfo: "",
brestUserInfo: '',
bresthighAgent: '',

@ -6,7 +6,19 @@ import {
} from "./bRequest.js";
let app = getApp();
let base = app.globalData.url;
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
export const HandleCode = params => {
return POST('GET', `${base}/wechat/handleCode`, params).then(res => res.data);
@ -438,6 +450,11 @@ export const cancelOrderByOrderNo = params => {
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 获取用户信息
*/
@ -499,6 +516,8 @@ export const getCodeListByAgentCoupon = params => {
export const generateCode = params => {
return POSTBREST('POST', `${brestBase}/highCouponAgent/generateCode`, params).then(res => res.data);
}
// 兑换码填写备注
export const highremark = params => {
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://open.95516.com/s/open/js/upsdk.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>
<body>
<noscript>

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

@ -2,7 +2,9 @@
<view>
<view class="backcorf06 height100p"></view>
<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="height40 width100">
<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="twoTime">使用有效期:{{twoTime | 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>
</view>
</view>
<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>
<yy-video-player :auto-play="false" :url="imagewxUrl+imgadres3" :poster="poster" :show-back-btn="true">
</yy-video-player>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image>
</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"
v-if="couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0">
预约订单已成功 门店会在24小时内联系您</view>
@ -33,17 +78,20 @@
v-if="!couponDesInfo.couponInfo.reserveStatus && couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource == 3">
请出示核销码(商户扫客户)</view>
<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 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>
</view>
<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}}
</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="width50 alijusstart">
<image mode="widthFix" style="width: 50rpx; max-height: 50rpx;margin-right: 10px;"
@ -69,6 +117,7 @@
</view>
</view>
<view class="height60"></view>
</view>
</template>
@ -76,8 +125,12 @@
import {
getUserCouponDetail,
getStoreListByCoupon,
againReceiveCoupon
} from "../../../Utils/Api.js"
getVerifyQRCode,
verifyWx
} from "../../../Utils/Api.js";
// #ifdef H5
var wx = require('jweixin-module');
// #endif
import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue'
let app = getApp()
export default {
@ -89,10 +142,13 @@
couDesId: '',
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imageqrUrl: app.globalData.imageqrImg,
imgadres1: 'dhl.png',
imgadres2: 'video.jpg',
imgadres3: 'playVideo.mp4',
imgadres: 'noorder.png',
imgadres5: 'petrovideo.jpg', //
imgadres6: 'petroplayVideo.mp4', //
couponDesInfo: [],
storeList: [],
oneTime: '',
@ -101,13 +157,46 @@
menddesId: '',
pageNum: 1,
pageSize: 1,
isNoMoreData: false
isNoMoreData: false,
qrimageurl: '', //
}
},
onLoad(option) {
this.couDesId = option.id;
this.menddesId = option.mendId;
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: {
//
@ -127,8 +216,7 @@
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
}
},
onReachBottom() {
},
onReachBottom() {},
methods: {
//
getUserCouponDetail() {
@ -142,7 +230,11 @@
if (res.return_code == '000000') {
this.couponDesInfo = res.return_data;
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.twoTime = res.return_data.highUserCoupon.useEndTime;
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) {
uni.openLocation({
@ -206,35 +311,46 @@
}
})
},
//
againReceiveCoupon() {
uni.showLoading({
title: '领取中...'
//
jumpzyhk() {
// #ifdef MP
uni.navigateToMiniProgram({
appId: 'wx7cd1712834749dcb',
extraData: {
'data1': 'release'
},
success(res) {
//
}
})
let params = {
couponId: this.couponDesInfo.couponInfo.id
}
againReceiveCoupon(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: '领取成功',
duration: 2000
})
this.couponDesInfo = res.return_data;
this.oneTime = res.return_data.highUserCoupon.createTime;
this.twoTime = res.return_data.highUserCoupon.useEndTime;
this.threeTime = res.return_data.highUserCoupon.consumeTime;
} else {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: res.return_msg,
duration: 2000
// #endif
// #ifdef H5
// location.href = 'weixin://dl/business/?t=khJZppojuyo';
// #endif
},
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)
},
scan() {
uni.scanCode({
@ -253,6 +369,16 @@
background-color: #f5f5f5;
}
.relybtn {
background-color: #0083f5;
width: 110px;
margin-left: auto;
margin-right: auto;
height: 30px;
border-radius: 5px;
line-height: 30px;
}
.couhead {
position: absolute;
top: 20px;
@ -273,6 +399,7 @@
.couStu {
background-color: #dceefe;
color: #0076dd;
font-size: 12px;
height: 60rpx;
line-height: 60rpx;
width: 60px;
@ -284,6 +411,7 @@
border-top-style: dotted;
border-top-color: #f6f6f6;
padding-bottom: 20px;
text-align: center;
border-radius: 0px 0px 5px 5px;
}
@ -351,18 +479,18 @@
border-radius: 10px;
}
.coupne-btn {
position: fixed;
bottom: 0px;
background-color: red;
color: #FFFFFF;
border-radius: 0px;
}
.czlq {
position: absolute;
bottom: 0;
background-color: red;
color: #FFFFFF;
}
.coupne-btn {
background-color: #0083f5;
color: #FFFFFF;
height: 45px;
line-height: 45px;
border-radius: 0px;
}
</style>

@ -21,8 +21,11 @@
消费时间:{{threeTime | formatDate('-')}}</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 ">
备注:{{couponDesInfo.couponAgentCode.remark}}</view>
<view class="width100" v-if="couponDesInfo.couponInfo.couponSource != 4">
<view class="width90 mart5 font13 fcor666" v-if="couponDesInfo.couponCode != null">
加油站点:{{couponDesInfo.couponCode.storeName}}</view>
@ -36,11 +39,18 @@
</view>
</view>
<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="mart30 fotct font18 marb20 fcor666">{{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 class="width90" v-if="couponDesInfo.couponCode.status ==3 && couponDesInfo.couponAgentCode.type != 1">
<view class="mart20 fotct fcorred font15 marb20">
@ -113,8 +123,9 @@
uni.hideLoading()
if (res.return_code == '000000') {
this.couponDesInfo = res.return_data;
if (res.return_data.couponInfo.couponSource != 4) {
if(res.return_data.couponCode != null){
if (res.return_data.couponInfo.couponSource != 4 && res.return_data.couponInfo
.couponSource != 5) {
if (res.return_data.couponCode != null) {
this.oneTime = res.return_data.couponCode.receiveTime;
this.twoTime = res.return_data.couponCode.useEndTime;
this.threeTime = res.return_data.couponCode.consumeTime;
@ -165,6 +176,15 @@
data: item,
success: function() {
}
})
},
//
copycontmini() {
uni.setClipboardData({
data: '#小程序://中油好客e站/YCjV6saueaTanhF',
success: function() {
}
})
}

@ -58,7 +58,7 @@
</view>
<view class="mart10 width100 font14 fcor999 height20">
<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}}
</view>
</view>
@ -306,13 +306,14 @@
},
buy() {
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({
title: '库存不足',
icon: "none"
});
return;
}
if(this.goodsData[0].reserveStatus && this.storeName == ''){
uni.showToast({
title: '请选择门店',

@ -1,12 +1,12 @@
<template>
<view>
<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 class="width100 fotct coupon-status font20 fcor41c" v-if="couponDesInfo.couponCodeInfo.status == 2">
未使用
</view>
</view> -->
<view class="line1"></view>
<view class="width90">
<view class="flright fotct">
@ -25,49 +25,70 @@
</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="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>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image>
</view>
<view class="width100">
<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>
<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 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 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>
</view>
</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 class="width90 height45l font18 fcor666 aliitem" v-if="storeList">
<view class="width90 height45l font18 fcor666 aliitem" v-if="storeList != ''">
<view class="width50 alijusstart">
<image mode="widthFix" style="width: 50rpx; max-height: 50rpx;margin-right: 10px;"
src="../../../static/img/adresw.png"></image> 门店信息
@ -103,10 +124,15 @@
import {
getUserNewCouponDetail,
getStoreListByCoupon,
getActivityByCoupon
getActivityByCoupon,
getVerifyQRCode,
verifyWx
} from "../../../Utils/Api.js";
import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
// #ifdef H5
var wx = require('jweixin-module');
// #endif
let app = getApp()
export default {
components: {
@ -118,8 +144,11 @@
couDesId: '',
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres2: 'video.jpg',
imgadres3: 'playVideo.mp4',
imageqrUrl: app.globalData.imageqrImg,
imgadres2: 'video.jpg', //
imgadres3: 'playVideo.mp4', //
imgadres5: 'petrovideo.jpg', //
imgadres6: 'petroplayVideo.mp4', //
imgadres4: 'activityimg.png',
imgadres1: 'dhl.png',
couponDesInfo: [],
@ -129,7 +158,9 @@
threeTime: '',
pageNum: 1,
pageSize: 1,
isNoMoreData: false
isNoMoreData: false,
qrimageurl: '', //
coupstus: 0
}
},
onLoad(option) {
@ -137,6 +168,34 @@
this.getUserNewCouponDetail();
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: {
//
formatDate: function(value, spe = '/') {
@ -171,7 +230,12 @@
if (res.return_code == '000000') {
uni.hideLoading();
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.twoTime = res.return_data.highUserCoupon.useEndTime;
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() {
this.$refs.popup.show();
@ -212,6 +311,18 @@
url: '../../../subPages/lottery/lottery?id=' + this.couDesId
})
},
//
jumpzyhk() {
uni.navigateToMiniProgram({
appId: 'wx7cd1712834749dcb',
extraData: {
'data1': 'release'
},
success(res) {
//
}
})
},
//
jumpstorelist() {
uni.navigateTo({
@ -284,6 +395,23 @@
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 {
width: 100%;
display: flex;
@ -348,10 +476,18 @@
border-radius: 10px;
}
.coupnejump-btn {
background-color: #0083f5;
color: #FFFFFF;
height: 45px;
line-height: 45px;
border-radius: 0px;
}
.coupne-btn {
position: fixed;
bottom: 0px;
background-color: red;
background-color: #0083f5;
color: #FFFFFF;
border-radius: 0px;
}

@ -44,7 +44,7 @@
<view :hidden="userFeedbackHidden" class="popup_content">
<view class="popup_title">填写信息</view>
<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">
<textarea class="popup_textarea" placeholder='请填写您的备注信息...' v-model="feedbackContent">
</textarea>
@ -252,7 +252,8 @@
} else {
let datas = {
couponAgentCodeId: this.couId,
remark: this.feedbackContent
remark: this.feedbackContent,
phone: this.feedPhone
}
generateCode(datas).then(res => {
uni.hideLoading()

@ -137,7 +137,7 @@
},
jumpcdx() {
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