1.上线嗨森逛

2.修改扫码领取优惠券
2.分享领取优惠券功能
yj-dev
杨杰 2 years ago
parent fd039f2c04
commit 912c398e24
  1. 60
      App.vue
  2. 30
      Utils/Api.js
  3. 1
      index.html
  4. 30
      pages.json
  5. 272
      pages/goods/externalCoupon/externalCoupon.vue
  6. 4
      pages/goods/goods.vue
  7. 21
      pages/tabBar/home/home.vue
  8. 41
      pages/tabBar/user/user.vue
  9. 499
      pages/user/payActivity/payActivity.vue
  10. 20
      pages/welcome/welcome.vue
  11. 225
      subPages/shareCounpon/shareCounpon.vue
  12. 50
      subPages/shareImgage/shareImgage.vue

@ -19,6 +19,7 @@
orderurl: '',
userurl: '',
brestUrl: '',
payurl: '',
imgUrl: '',
imageWxImg: '',
imageqrImg: '',
@ -63,40 +64,44 @@
//
qianzhuCityName: '重庆市',
//
pelletoilList: ''
pelletoilList: '',
//
shareNum:0
},
onLaunch: function() {
},
onLaunch: function() {},
onShow: function() {
// #ifdef MP
let accountInfo = uni.getAccountInfoSync();
if (accountInfo.miniProgram.envVersion == 'develop' || accountInfo.miniProgram.envVersion == 'trial') {
this.globalData.url = 'https://hsgcs.dctpay.com/crest';
this.globalData.v1url = 'https://hsgcs.dctpay.com/v1';
this.globalData.orderurl = 'https://hsgcs.dctpay.com/order';
this.globalData.userurl = 'https://hsgcs.dctpay.com/user';
this.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest';
this.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/';
this.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/';
this.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/';
}
if (accountInfo.miniProgram.envVersion == 'release') {
// if (accountInfo.miniProgram.envVersion == 'develop' || accountInfo.miniProgram.envVersion == 'trial') {
// this.globalData.url = 'https://hsgcs.dctpay.com/crest';
// this.globalData.v1url = 'https://hsgcs.dctpay.com/v1';
// this.globalData.payurl = 'https://gratia-pay.dctpay.com/crest';
// this.globalData.orderurl = 'https://hsgcs.dctpay.com/order';
// this.globalData.userurl = 'https://hsgcs.dctpay.com/user';
// this.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest';
// this.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/';
// this.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/';
// this.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/';
// }
// if (accountInfo.miniProgram.envVersion == 'release') {
this.globalData.url = 'https://hsg.dctpay.com/crest';
this.globalData.v1url = 'https://hsg.dctpay.com/v1';
this.globalData.payurl = 'https://pay.dctpay.com/crest';
this.globalData.orderurl = 'https://hsg.dctpay.com/order';
this.globalData.userurl = 'https://hsg.dctpay.com/user';
this.globalData.brestUrl = 'https://hsg.dctpay.com/brest';
this.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/';
this.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/';
this.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/';
}
// }
// #endif
// #ifdef H5
let that = this;
// that.globalData.url = 'https://hsgcs.dctpay.com/crest';
// that.globalData.v1url = 'https://hsgcs.dctpay.com/v1';
// that.globalData.payurl = 'https://gratia-pay.dctpay.com/crest';
// that.globalData.orderurl = 'https://hsgcs.dctpay.com/order';
// that.globalData.userurl = 'https://hsgcs.dctpay.com/user';
// that.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest';
@ -106,6 +111,7 @@
that.globalData.url = 'https://hsg.dctpay.com/crest';
that.globalData.v1url = 'https://hsg.dctpay.com/v1';
that.globalData.payurl = 'https://pay.dctpay.com/crest';
that.globalData.orderurl = 'https://hsg.dctpay.com/order';
that.globalData.userurl = 'https://hsg.dctpay.com/user';
that.globalData.brestUrl = 'https://hsg.dctpay.com/brest';
@ -226,22 +232,22 @@
})
// #endif
},
onHide: function() {
}
onHide: function() {}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import "/static/iconfont/font.scss";
@keyframes noticeAnimation {
from {
transform: translateX(100rpx);
}
to {
// transform: translateX(calc(-100% + 150px));
transform: translateX(-100%);
}
@import "/static/iconfont/font.scss";
@keyframes noticeAnimation {
from {
transform: translateX(100rpx);
}
to {
// transform: translateX(calc(-100% + 150px));
transform: translateX(-100%);
}
}
</style>

@ -10,6 +10,7 @@ let orderbase = app.globalData.orderurl;
let userbase = app.globalData.userurl;
let v1base = app.globalData.v1url;
let brestBase = app.globalData.brestUrl;
let payBase = app.globalData.payurl;
//公众号获取跳小程序参数
export const verifyWx = params => {
return POST('GET', `${v1base}/wxMsg/verifyWx`, params).then(res => res.data);
@ -651,7 +652,15 @@ export const getOrderByOrderNo = params => {
// 获取登录验证码
export const getLoginSMSCode = params => {
return POST('POST', `${userbase}/sms/getLoginSMSCode`, params).then(res => res.data);
}
}
//获取优惠列表
export const queryHzfDiscountList = params => {
return POST('GET', `${userbase}/discount/queryHzfDiscountList`, params).then(res => res.data);
}
//查询总次数
export const queryHzfDiscountTotalNum = params => {
return POST('GET', `${userbase}/discount/queryHzfDiscountTotalNum`, params).then(res => res.data);
}
// 手机号登录
export const phone = params => {
@ -684,3 +693,22 @@ export const getUserAccount = params => {
export const getUserDiscountList = params => {
return POST('GET', `${userbase}/discount/getUserDiscountList`, params).then(res => res.data);
}
//支付项目 领取优惠券
export const getReceiveDiscountList = params => {
return POST('GET', `${payBase}/storeDiscountActivityPartakeUser/getReceiveDiscountList`, params).then(res => res.data);
}
export const payReceiveDiscount = params => {
return POST('POST', `${payBase}/storeDiscountActivityPartakeUser/receiveDiscount`, params).then(res => res.data);
}
//获取二维码
export const generateWeChatMpQrCode = params => {
return POST('POST', `${payBase}/storeDiscountActivityPartakeUser/generateWeChatMpQrCode`, params).then(res => res.data);
}
//查询订单详情
export const getOrderByOutTradeOrder = params => {
return POST('POST', `${payBase}/tradeOrder/getOrderByOutTradeOrder`, params).then(res => res.data);
}

@ -19,7 +19,6 @@
<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>

@ -514,6 +514,15 @@
}
, {
"path": "pages/user/payActivity/payActivity",
"style": {
"navigationBarTitleText": "活动券",
"enablePullDownRefresh": false
}
}
],
"subpackages": [{
"root": "subPages",
@ -819,14 +828,21 @@
}
}
}, {
"path": "shareCounpon/shareCounpon",
"style": {
"navigationBarTitleText": "分享领取优惠券",
"enablePullDownRefresh": false
}
}, {
"path": "shareCounpon/shareCounpon",
"style": {
"navigationBarTitleText": "分享领取优惠券",
"enablePullDownRefresh": false
}
}
}, {
"path": "shareImgage/shareImgage",
"style": {
"navigationBarTitleText": "分享领取优惠券",
"enablePullDownRefresh": false
}
}
]
}, {
"root": "qianzhu-KFC",

@ -1,6 +1,6 @@
<template>
<view>
<view class="width90">
<!-- <view class="width90" v-if="couponsDetails.highDiscount.usingRange == 8">
<view class="flright fotct">
<image class="coupon-img" :src="imageUrl+couponsDetails.highDiscount.discountImg"></image>
</view>
@ -12,14 +12,9 @@
<view class="fcor666 font13 width100 mart5">
领取有效期:{{couponsDetails.highDiscount.effectiveDay}}
</view>
</view>
<view class="line1 mart15"></view>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN"
@click="jumpres">点击领取</button>
<button class="coupne-btn width60w mart20 marb20"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status == 1 && couponsDetails.highDiscount.usingRange != 8"
@click="receiveDiscount">点击领取</button>
<button class="coupne-btn width60w mart20 marb20"
</view> -->
<!-- <view class="line1 mart15" v-if="couponsDetails.highDiscount.usingRange == 8"></view> -->
<!-- <button class="coupne-btn width60w mart20 marb20"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status == 1 && couponsDetails.highDiscount.usingRange == 8"
@click="receiveDiscount">点击领取</button>
<view class="alijus width90 mart20"
@ -34,43 +29,89 @@
</view>
</view>
<view class="width90 mart10 fcor666" v-if="couponsDetails.highDiscount.usingRange != 8">去使用</view>
<view v-if="minecoupones == '' && couponsDetails.highDiscount.usingRange != 8"
class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view>
<view class="width90 mart30" v-if="couponsDetails.highDiscount.usingRange == 8">
<image :src="imagewxUrl+imgadres3" 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 != 8">
<view class="product" v-for="product in minecoupones" :key="product.id"
@tap="toGoods(product.highCoupon.id)">
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image>
<view class="name">{{ product.highCoupon.couponName }}</view>
<view class="info" v-if="product.highCoupon.payType == 1">
<view class="price">
{{ product.highCoupon.discountPrice}}
</view>
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice">
{{ product.highCoupon.salesPrice}}
</view>
</view> -->
<image :src="imageres5" class="width100 headbgimg" mode="widthFix"
v-if="couponsDetails.highDiscount.usingRange == 8"></image>
<view class="width90 contents backcorfff height260 border-r fotct"
v-if="couponsDetails.highDiscount.usingRange == 8">
<view class="width90 font18 fontwig6 fcor333 paddtop10 ">{{couponsDetails.highDiscount.discountName}}
</view>
<view class="width90 font14 fcor333 paddtop5">领取有效期: {{couponsDetails.highDiscount.effectiveDay}}
</view>
<view class="width90 font14 fcor333">活动截止时间:{{salesEndTime | formatDate('-')}}</view>
<image class="headcontimg paddtop5" :src="imageUrl+couponsDetails.highDiscount.discountImg"></image>
<button class="contentbtn width60w mart10 marb20 height40 fontwig6" lang="zh_CN" v-if="userInfo == 1"
@click="jumpres">点击领取</button>
<button class="contentbtn width60w mart10 marb20 height40 fontwig6" lang="zh_CN"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status == 1 && couponsDetails.highDiscount.usingRange == 8"
@click="receiveDiscount">点击领取</button>
<view class="alijus width90 mart20"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status != 1 && couponsDetails.highDiscount.usingRange == 8">
<view class="width40" style="margin-right: 5%;" @click="useDiscount">
<view class="width100 btnno fotct font16 backgrounde72">立即使用</view>
</view>
<view class="info" v-else>
<view class="price">
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfx.png">
</image>{{ product.highCoupon.discountPrice*100}}
</view>
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice">
<image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfh.png">
</image>{{ product.highCoupon.salesPrice*100}}
<view class="width40" style="margin-left: 5%;" @click="jumpCounlist">
<view class="width100 btnno fotct font16 backgrounde72">立即查看</view>
</view>
</view>
</view>
<view class="contconpon width90 border-r"
v-if="minecoupones && couponsDetails.highDiscount.usingRange == 8">
<image :src="imagewxUrl+imgadres3" 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>
<!-- // -->
<image :src="imageres4" class="width100 headbgimg" mode="widthFix"
v-if="couponsDetails.highDiscount.usingRange != 8"></image>
<view class="width90 contents backcorfff height260 border-r fotct"
v-if="couponsDetails.highDiscount.usingRange != 8">
<view class="width90 font18 fontwig6 fcor333 paddtop10 ">{{couponsDetails.highDiscount.discountName}}
</view>
<view class="width90 font14 fcor333 paddtop5">领取有效期: {{couponsDetails.highDiscount.effectiveDay}}
</view>
<view class="width90 font14 fcor333">活动截止时间:{{salesEndTime | formatDate('-')}}</view>
<image class="headcontimg paddtop5" :src="imageUrl+couponsDetails.highDiscount.discountImg"></image>
<button class="contentbtn width60w mart10 marb20 height40 fontwig6" lang="zh_CN" v-if="userInfo == 1"
@click="jumpres">点击领取</button>
<button class="contentbtn width60w mart10 marb20 height40 fontwig6" lang="zh_CN"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status == 1 && couponsDetails.highDiscount.usingRange != 8"
@click="receiveDiscount">点击领取</button>
<button class="backcor99 fcorfff width60w mart10 marb20 height40 fontwig6" lang="zh_CN"
v-if="userInfo != 1 && couponsDetails.highDiscountAgentCode.status != 1 && couponsDetails.highDiscount.usingRange != 8">已领取</button>
</view>
<view class="contconpon width90 backcorfff border-r"
v-if="minecoupones && couponsDetails.highDiscount.usingRange != 8">
<view class="product-list width94 alijusnostart" v-for="product in minecoupones" :key="product.id">
<image class="prodimg" :src="imageUrl+product.highCoupon.couponImg">
</image>
<view class="margle10">
<view class="font15 fontwig6 fcor333">{{ product.highCoupon.couponName }}</view>
<view class="price mart5">
{{ product.highCoupon.discountPrice}} <text
class="margle10 slogan">{{ product.highCoupon.salesPrice}}</text>
</view>
<view class="usebtn border-r height25l font14 fontwig6 fotct mart5"
@tap="toGoods(product.highCoupon.id)">去使用</view>
</view>
</view>
</view>
<view class="width100 height60"></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>
@ -125,9 +166,10 @@
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'noorder.png',
imgadres1: 'noCoupon.jpg',
imgadres2: 'onCoupon.jpg',
imgadres3: 'showCoupon.jpg',
imageres4: 'https://hsg.dctpay.com/filesystem/wxApplets/couponbg1.png',
imageres5: 'https://hsg.dctpay.com/filesystem/wxApplets/couponbg2.png', //
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
@ -176,9 +218,9 @@
},
onLoad() {
var arr1 = window.location.href;
var arr2 = arr1.split('=');
if(!app.globalData.openId){
this.getH5AccessToken(arr2[1]);
var arr2 = arr1.split('=');
if (!app.globalData.openId) {
this.getH5AccessToken(arr2[1]);
}
this.getDiscountByQrCode();
@ -391,8 +433,8 @@
</script>
<style lang="scss">
.coupon-mes {
// margin-right: 90px;
page {
background-color: #3fa9fd;
}
.popup_content {
@ -437,54 +479,81 @@
height: 80px;
}
// .product-list {
// display: flex;
// justify-content: space-between;
// flex-wrap: wrap;
// .product {
// width: 48%;
// border-radius: 20upx;
// background-color: #fff;
// margin: 0 0 15upx 0;
// box-shadow: 0upx 5upx 25upx rgba(0, 0, 0, 0.1);
// image {
// width: 100%;
// border-radius: 20upx 20upx 0 0;
// }
// .name {
// width: 92%;
// padding: 8upx 4%;
// display: -webkit-box;
// -webkit-box-orient: vertical;
// -webkit-line-clamp: 1;
// text-align: justify;
// overflow: hidden;
// font-size: 30upx;
// }
// .info {
// display: flex;
// justify-content: space-between;
// align-items: flex-end;
// width: 92%;
// padding: 10upx 4% 10upx 4%;
// .price {
// color: #e65339;
// font-size: 30upx;
// font-weight: 600;
// }
// .slogan {
// color: #807c87;
// font-size: 24upx;
// text-decoration: line-through;
// margin-right: 10px;
// }
// }
// }
// }
.product-list {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.product {
width: 48%;
border-radius: 20upx;
background-color: #fff;
margin: 0 0 15upx 0;
box-shadow: 0upx 5upx 25upx rgba(0, 0, 0, 0.1);
image {
width: 100%;
border-radius: 20upx 20upx 0 0;
}
.name {
width: 92%;
padding: 8upx 4%;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
text-align: justify;
overflow: hidden;
font-size: 30upx;
}
.prodimg {
width: 80px;
height: 80px;
}
.info {
display: flex;
justify-content: space-between;
align-items: flex-end;
width: 92%;
padding: 10upx 4% 10upx 4%;
.price {
color: #e65339;
font-size: 30upx;
font-weight: 600;
}
.price {
color: #e65339;
font-size: 30upx;
font-weight: 600;
}
.slogan {
color: #807c87;
font-size: 24upx;
text-decoration: line-through;
margin-right: 10px;
}
}
.slogan {
color: #807c87;
font-size: 24upx;
text-decoration: line-through;
margin-right: 10px;
}
.usebtn {
width: 60px;
background: linear-gradient(to right, #fccd17, #fceb63);
color: #e72114;
}
}
@ -500,4 +569,35 @@
justify-content: center;
color: #ffffff;
}
.headbgimg {
position: absolute;
}
.contents {
position: relative;
top: 160px;
.headcontimg {
width: 90px;
height: 90px;
}
.contentbtn {
background: linear-gradient(to right, #fccd17, #fceb63);
color: #e72114;
}
}
.backgrounde72 {
background-color: #e72114;
}
.contconpon {
position: relative;
top: 180px;
padding-top: 10px;
padding-bottom: 10px;
}
</style>

@ -44,10 +44,6 @@
<!-- 标题 价格 -->
<view class="backcorfff border-r paddtop10 paddbotm10 mart10 width94">
<view class="width96">
<view class="font12 height20 fotct" style="width: 75px;border: 1px solid #3da7e7;color: #3da7e7;">购买返积分
</view>
</view>
<view class="font16 fcor333 fontwig6 mart10 width96">
{{goodsData[0].couponName}}
</view>

@ -210,7 +210,8 @@
};
},
onShow() {
onShow() {
this.homeCateList = [];
if (app.globalData.cityName != '') {
this.city = app.globalData.qianzhuCityName;
this.getCmsContentcmsContent();
@ -516,9 +517,11 @@
// 007 线
// 008
// 009 广
// 0010
// 0011
// 0010
// 0011
// 0012
// 0013
if (e.data == '000000#/' && app.globalData.h5code) {
uni.navigateTo({
url: '../../goods/refuel-details/refuel-details'
@ -580,6 +583,16 @@
url: '../../goods/externalCoupon/externalCoupon'
})
}
if (e.data == '0000012&key' && app.globalData.h5code) {
uni.navigateTo({
url: '/subPages/shareCounpon/shareCounpon'
})
}
if (e.data == '0000013&key' && app.globalData.h5code) {
uni.navigateTo({
url: '/subPages/shareImgage/shareImgage'
})
}
}
}
})

@ -24,16 +24,23 @@
<!-- 优惠券卡券 -->
<view class="headcoun width100">
<view class="height80 alijus width92 border-8r backcorfff">
<view class="width45 fotct" @click="jumppage(5)">
<view class=" fotct" style="width: 50%;" @click="jumppage(5)">
<view class="width100 font12 fcor333"><text class="font20 marglerig">{{textnum}} </text> </view>
<view class="width100 font18 fcor333 mart5">卡券</view>
</view>
<view style="width: 1px;height: 50px;background-color: #f6f6f6;">
</view>
<view class="width45 fotct" @click="jumppage(6)">
<view class=" fotct" style="width: 50%;" @click="jumppage(6)">
<view class="width100 font12 fcor333"><text class="font20 marglerig">{{textSend}} </text> </view>
<view class="width100 font18 fcor333 mart5">优惠券</view>
</view>
</view>
<!-- <view style="width: 1px;height: 50px;background-color: #f6f6f6;">
</view>
<view class=" fotct" style="width: 32%;" @click="jumppage(7)">
<view class="width100 font12 fcor333"><text class="font20 marglerig">{{payactivitynum}} </text> </view>
<view class="width100 font18 fcor333 mart5">活动券</view>
</view> -->
</view>
</view>
@ -184,7 +191,8 @@
loginOut,
getUserAccount,
getUserOrderList,
orderCheck
orderCheck,
queryHzfDiscountTotalNum
} from "../../../Utils/Api.js";
// import authorize from '../../../components/Authorize';
import uniBadge from "../../../components/uni-badge/components/uni-badge/uni-badge.vue";
@ -200,7 +208,8 @@
imgadres: 'head.png',
textnum: '',
textSend: '',
therrNum: '',
therrNum: '',
payactivitynum:'',
rechargeOrderNum: '', //
whetherCheckNum: '', //
orderPayNum: '', //
@ -242,7 +251,8 @@
},
onLoad() {
if (!app.globalData.userInfo) {
this.findUser()
this.findUser();
// this.queryHzfDiscountTotalNum();
}
},
onReady() {
@ -256,7 +266,8 @@
},
onShow() {
if (app.globalData.userInfo) {
this.findUser();
this.findUser();
// this.queryHzfDiscountTotalNum();
}
// #ifdef MP
if (!app.globalData.userInfo.isSetPayPwd) {
@ -363,6 +374,14 @@
})
}
});
},
//
queryHzfDiscountTotalNum(){
queryHzfDiscountTotalNum().then(res => {
if (res.return_code == '000000') {
this.payactivitynum = res.return_data;
}
});
},
//
getUserOrderList() {
@ -492,6 +511,11 @@
uni.navigateTo({
url: '../../user/coupon/coupon'
})
}
if (item == 7) {
uni.navigateTo({
url: '/pages/user/payActivity/payActivity'
})
}
},
toPage(url, item) {
@ -537,7 +561,8 @@
app.globalData.token = '';
that.textnum = '';
that.textSend = '';
that.therrNum = '';
that.therrNum = '';
that.payactivitynum = '';
that.whetherCheckNum = '';
that.orderPayNum = '';
that.rechargeOrderNum = '';

@ -0,0 +1,499 @@
<template>
<view>
<view class="tabr" :style="{top:headerTop}">
<view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">待使用</view>
<!-- <view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">已使用</view> -->
<view :class="{on:typeClass=='noinvalid'}" @tap="switchType('noinvalid')">已过期</view>
</view>
<view class="place"></view>
<view class="list">
<!-- 优惠券列表 -->
<view class="sub-list" v-if="typeClass == 'valid'">
<view class="tis" v-if="couponValidList.length==0">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view>
<view class="row" v-for="(row,index) in couponValidList" :key="index">
<!-- content -->
<view class="carrier">
<view class="left">
<view class="title alijusstart">
<view class="text1 width70">{{row.discountActivityName}}</view>
</view>
<view class="term fcoreb5">
剩余次数:{{row.partakeSurplusNum}}
</view>
<view class="term fcor999">
有效期:{{row.endTime | formatDate('-')}}
</view>
</view>
<view class="right">
<view class="ticket" style="background-color: #009DFF;padding-top: 1vw;">
<view class="num" v-if="row.discountType == 3">
{{row.discountPrice * 10}}
</view>
<view class="num" v-else>
{{row.discountPrice}}
</view>
<view class="unit margle" v-if="row.discountType == 3">
</view>
<view class="unit margle" v-else>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- //使 -->
<!-- <view class="sub-list" v-if="typeClass == 'invalid'">
<view class="tis" v-if="couponinvalidList.length==0">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view>
<view class="row" v-for="(row,index) in couponinvalidList" :key="index">
<view class="carrier">
<view class="left">
<view class="title alijusstart">
<view class="text1 width70">{{row.discountName}}</view>
</view>
<view class="term">
有效期:{{row.useEndTime | formatDate('-')}}
</view>
<image src="../../../static/img/user/use.png" mode="widthFix"
style="position: absolute;right: 5px;top: 5px;" class="icon50"></image>
</view>
</view>
</view>
</view> -->
<!-- 已过期 -->
<view class="sub-list" v-if="typeClass == 'noinvalid'">
<view class="tis" v-if="couponnoinvalidList.length==0">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view>
<view class="row" v-for="(row,index) in couponnoinvalidList" :key="index">
<view class="carrier">
<view class="left">
<view class="title alijusstart">
<view class="text1 width70">{{row.discountActivityName}}</view>
</view>
<view class="term fcoreb5">
剩余次数:{{row.partakeSurplusNum}}
</view>
<view class="term fcor999">
有效期:{{row.endTime | formatDate('-')}}
</view>
<image src="../../../static/img/user/overdue.png" mode="widthFix"
style="position: absolute;right: 5px;top: 5px;" class="icon50"></image>
</view>
<view class="right">
<view class="ticket" style="background-color: #999999;">
<view class="num" v-if="row.discountType == 3">
{{row.discountPrice * 10}}
</view>
<view class="num" v-else>
{{row.discountPrice}}
</view>
<view class="unit margle" v-if="row.discountType == 3">
</view>
<view class="unit margle" v-else>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
queryHzfDiscountList
} from '../../../Utils/Api.js';
// #ifdef H5
var wx = require('jweixin-module');
// #endif
let app = getApp();
export default {
data() {
return {
couponValidList: [],
couponinvalidList: [],
couponnoinvalidList: [],
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'noorder.png',
headerTop: 0,
headerswiperTop: '45px',
//
typeClass: 'valid',
subState: '',
theIndex: null,
oldIndex: null,
isStop: false,
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
loadingText: '',
couponcout: 0,
statusid: '' //
}
},
onPageScroll(e) {
},
//page.json "enablePullDownRefresh": true
onPullDownRefresh() {
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
created() {},
onLoad() {
// #ifdef H5
this.headerTop = '44PX';
this.headerswiperTop = '89px';
// #endif
this.queryHzfDiscountList(1);
},
filters: {
//
formatDate: function(value, spe = '/') {
let data = new Date(value);
let year = data.getFullYear();
let month = data.getMonth() + 1;
let day = data.getDate();
let h = data.getHours();
let mm = data.getMinutes();
let s = data.getSeconds();
month = month >= 10 ? month : "0" + month;
day = day >= 10 ? day : "0" + day;
h = h >= 10 ? h : "0" + h;
mm = mm >= 10 ? mm : "0" + mm;
s = s >= 10 ? s : "0" + s;
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
},
//
msgFormat: function(value, value1) {
for (var i = 0; i < value.length; i++) {
if (value1 == value[i].codeValue) {
let a = value[i].codeName;
return a;
}
}
}
},
onReachBottom() {
if (this.typeClass == 'valid') {
this.queryHzfDiscountList(1);
} else {
this.queryHzfDiscountList(2);
}
},
methods: {
//
queryHzfDiscountList(item) {
this.statusid = item;
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
this.loadingText = '到底了';
return false;
}
let pagenum = this.pageNum;
let params = {
pageNum: pagenum,
status: item,
pageSize: this.pageSize,
}
queryHzfDiscountList(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
if (this.typeClass == 'valid') {
this.couponValidList = this.couponValidList.concat(res.return_data.list);
this.couponcout = res.return_data.total;
} else if (this.typeClass == 'invalid') {
this.couponinvalidList = this.couponinvalidList.concat(res.return_data.list);
} else {
this.couponnoinvalidList = this.couponnoinvalidList.concat(res.return_data.list);
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.couponValidList = [];
this.couponinvalidList = [];
this.couponnoinvalidList = [];
uni.hideLoading()
}
})
},
switchType(type) {
if (this.typeClass == type) {
return;
}
uni.pageScrollTo({
scrollTop: 0,
duration: 0
})
this.typeClass = type;
this.subState = this.typeClass == '' ? '' : 'show' + type;
if (this.typeClass == 'valid') {
this.pageNum = 1;
this.couponValidList = []
this.isNoMoreData = false;
this.queryHzfDiscountList(1);
} else {
this.pageNum = 1;
this.couponnoinvalidList = []
this.isNoMoreData = false;
this.queryHzfDiscountList(2);
}
}
}
}
</script>
<style lang="scss">
view {
display: flex;
flex-wrap: wrap;
}
page {
background-color: #f5f5f5;
}
.place {
width: 100%;
height: 50px;
}
.tabr {
background-color: #fff;
width: 94%;
height: 95upx;
padding: 0 3%;
border-bottom: solid 1upx #dedede;
position: fixed;
top: 0;
z-index: 10;
view {
width: 50%;
height: 90upx;
justify-content: center;
align-items: center;
font-size: 32upx;
color: #999;
}
.on {
color: #0083f5;
border-bottom: 2px solid #0083f5;
}
}
.list {
width: 100%;
display: block;
position: relative;
}
@keyframes showValid {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
@keyframes showInvalid {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-100%);
}
}
@keyframes shownoInvalid {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-200%);
}
}
.sub-list {
&.invalid {
position: absolute;
top: 0;
left: 100%;
display: none;
}
&.showvalid {
display: flex;
animation: showValid 0.20s linear both;
}
&.showinvalid {
display: flex;
animation: showInvalid 0.20s linear both;
}
&.shownoinvalid {
display: flex;
animation: shownoInvalid 0.20s linear both;
}
width: 100%;
padding: 20upx 0 120upx 0;
.tis {
width: 100%;
height: 60upx;
justify-content: center;
align-items: center;
font-size: 32upx;
}
.row {
width: 92%;
height: 27vw;
margin: 20upx auto 10upx auto;
border-radius: 8upx;
// box-shadow: 0upx 0 10upx rgba(0,0,0,0.1);
align-items: center;
position: relative;
overflow: hidden;
z-index: 4;
border: 0;
.menu {
.icon {
color: #fff;
font-size: 50upx;
}
position: absolute;
width: 28%;
height: 100%;
right: 0;
justify-content: center;
align-items: center;
background-color: red;
color: #fff;
z-index: 2;
}
.carrier {
@keyframes showMenu {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-28%);
}
}
@keyframes closeMenu {
0% {
transform: translateX(-28%);
}
100% {
transform: translateX(0);
}
}
&.open {
animation: showMenu 0.25s linear both;
}
&.close {
animation: closeMenu 0.15s linear both;
}
position: absolute;
width: 100%;
padding: 0 0;
height: 100%;
z-index: 3;
flex-wrap: nowrap;
.left {
background-color: #fff;
width: 72%;
background-image: radial-gradient(6px at top right, #ffffff 50px, #ffffff);
.title {
width: 90%;
margin: 0 5%;
font-size: 36upx;
}
.term {
width: 95%;
background-image: radial-gradient(6px at bottom right, #ffffff 50px, #ffffff);
margin-left: 5%;
font-size: 26upx;
}
position: relative;
}
.right {
flex-shrink: 0;
width: 28%;
color: #fff;
background: linear-gradient(to right, #66c4ff, #009DFF);
background-image: radial-gradient(6px at bottom left, #009DFF 50px, #009DFF);
&.invalid {
background: linear-gradient(to right, #aaa, #999);
}
justify-content: center;
.ticket {
width: 100%;
}
.ticket {
// background-image: radial-gradient(6px at top left, #f5f5f5 50px, #009DFF);
// padding-top: 1vw;
justify-content: center;
align-items: center;
.num {
font-size: 30px;
font-weight: 600;
}
.unit {
font-size: 28upx;
}
}
}
}
}
}
</style>

@ -17,22 +17,22 @@
}
},
onLoad(options) {
onLoad(options) {
let that = this;
// #ifdef MP
app.globalData.accountId = options.accountId;
uni.switchTab({
url: '../tabBar/home/home'
})
// uni.navigateTo({
// url:'/subPages/shareCounpon/shareCounpon'
// })
// uni.switchTab({
// url: '../tabBar/home/home'
// })
uni.navigateTo({
url:'/subPages/shareImgage/shareImgage'
})
// #endif
// #ifdef H5
var arr1 = window.location.href;
var arr2 = arr1.split('=');
if (arr2[1] != undefined && arr2[2] == '1#/') {
app.globalData.h5code = arr2[1];
app.globalData.h5code = arr2[1];
uni.setStorage({
key: "h5code",
data: arr2[1]
@ -61,7 +61,7 @@
that.loginBySilence(arr3[0]);
}
if (arr2[3] != undefined && arr2[3]) {
let arr4 = arr2[3].split('#');
let arr4 = arr2[3].split('#');
uni.setStorage({
key: "staffCode",
data: arr4[0]
@ -121,7 +121,7 @@
let datas = {
openId: app.globalData.openId
}
getH5AccessByOpenId(datas).then(res => {
getH5AccessByOpenId(datas).then(res => {
app.globalData.userInfo = res.return_data
.object
.highUser;

@ -5,57 +5,256 @@
<view class="conts paddtop13">
<view v-for="(item,index) in couponList" :key="index" class="conpon border-r height90 flleft marb10 ">
<view class="width94 font15 fontwig6 fotlt fcorfff mart5">
96折星巴克优惠券
{{item.name}}
</view>
<view class="width80 fotct backcor99 mart5 linec6" style="opacity: 0.2;"></view>
<view class="width90 font10 fotlt fcorfff mart3">
30-5
<view class="width90 font10 fotlt fcorfff mart3" v-if="item.discountType == 1">
{{item.discountCondition}}-{{item.discountPrice}}
</view>
<view class="width90 font10 fotlt fcorfff mart3">
有效时间: 30
<view class="width90 font10 fotlt fcorfff mart3" v-if="item.discountType == 2">
立减{{item.discountPrice}}
</view>
<view class="width90 font10 fotlt fcorfff mart3" v-if="item.discountType == 3">
享受{{item.discountPrice}}
</view>
<view class="width90 font10 fotlt fcorfff mart3">
截止时间:2023年2月31日
截止时间: {{item.createTime | timeFormat('yyyy-mm-dd')}}
</view>
</view>
</view>
</view>
<view class="imgsfoot">
<view class="width100 height50"></view>
<view class="couponBtn fontlet font24 fotct fontwig6 width60w height45l">一键领取</view>
<view class="couponBtn fontlet font24 fotct fontwig6 width60w height45l" @click="payReceiveDiscount">一键领取
</view>
</view>
</view>
</template>
<script>
import {
getReceiveDiscountList,
payReceiveDiscount,
verifyWx,
getOrderByOutTradeOrder
} from '../../Utils/Api.js'
let app = getApp();
// #ifdef H5
var wx = require('weixin-js-sdk');
// #endif
export default {
data() {
return {
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'share1.png',
imgadres1: 'share2.png',
couponList: [1, 2, 3, 4, 5, 6]
couponList: [],
shareNum: 0, //
orderNo: ''
}
},
created() {
this.doShare();
},
onShow() {
let that = this;
uni.getStorage({
key: 'shareNum',
success(e) {
that.shareNum = e.data;
}
})
this.getOrderByOutTradeOrder();
},
methods: {
//
getOrderByOutTradeOrder() {
let that = this;
uni.getStorage({
key: 'staffCode',
success: (res) => {
that.orderNo = res.data;
let datas = {
outTradeOrder: that.orderNo
}
getOrderByOutTradeOrder(datas).then(res => {
if (res.return_code == '000000') {
that.getReceiveDiscountList(res.return_data.storeId);
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
},
})
},
//
getReceiveDiscountList(items) {
let datas = {
qrCodeSn: items
// 1000017476
}
getReceiveDiscountList(datas).then(res => {
if (res.return_code == '000000') {
that.couponList = res.return_data;
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
},
//
payReceiveDiscount() {
if (app.globalData.userInfo.phone == '' || app.globalData.userInfo.phone == null || app.globalData.userInfo
.phone == undefined) {
uni.showModal({
title: '温馨提示',
content: '前往获取手机号',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/register'
})
}
}
})
return;
}
if (this.shareNum == 0) {
uni.showToast({
title: "分享活动得领取机会",
duration: 2000,
icon: 'none'
})
return;
}
let actividatas = [];
for (var i = 0; i < this.couponList.length; i++) {
let acid = {
id: this.couponList[i].id
};
actividatas.push(acid);
}
let datas = {
"phone": app.globalData.userInfo.phone,
"activityIds": actividatas
}
payReceiveDiscount(datas).then(res => {
if (res.return_code == '000000') {
uni.showToast({
title: res.return_data,
duration: 2000,
icon: 'none'
})
this.shareNum = this.shareNum - 1
uni.setStorage({
key: "shareNum",
data: this.shareNum
})
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
},
//
doShare() {
let theUrl = window.location.href.split('#')[0];
let datas = {
url: theUrl
}
verifyWx(datas).then(res => {
if (res.return_code == '000000') {
wx.config({
debug: false, // ,apialertpclogpc
appId: res.return_data.appId, //
timestamp: res.return_data.timestamp, //
nonceStr: res.return_data.nonceStr, //
signature: res.return_data.signature, // 1
jsApiList: ['onMenuShareTimeline',
'onMenuShareAppMessage'
] // 使JSJS2
});
wx.ready(function() {
wx.onMenuShareTimeline({
title: '分享好友,立获大额优惠券', //
desc: '分享好友,立获大额优惠券', //
link: 'https://hsg.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
this.orderNo, //
imgUrl: 'https://hsg.dctpay.com/filesystem/wxApplets/logo.png', //
success: function(res) {
//
uni.showToast({
title: '分享成功',
duration: 2000,
icon: 'none'
})
this.shareNum = this.shareNum + 1;
uni.setStorage({
key: "shareNum",
data: this.shareNum
})
},
cancel: function(r) {},
fail: function(res) {}
});
wx.onMenuShareAppMessage({
title: '分享好友,立获大额优惠券', //
desc: '分享好友,立获大额优惠券', //
link: 'https://hsg.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
this.orderNo, //
imgUrl: 'https://hsg.dctpay.com/filesystem/wxApplets/logo.png', //
success: function(res) {
//
uni.showToast({
title: '分享成功',
duration: 2000,
icon: 'none'
})
this.shareNum = this.shareNum + 1;
uni.setStorage({
key: "shareNum",
data: this.shareNum
})
},
cancel: function(r) {},
fail: function(res) {}
});
});
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
}
}
}
</script>
<style lang="scss">
.imgshead {
background-image: url(https://hsgcs.dctpay.com/filesystem/wxApplets/share1.png);
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share1.png);
background-size: 100% 230px;
height: 230px;
background-repeat: no-repeat;
}
.imgscontent {
background-image: url(https://hsgcs.dctpay.com/filesystem/wxApplets/share2.png);
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share2.png);
background-size: 100% 320px;
height: 320px;
background-repeat: no-repeat;
@ -67,7 +266,7 @@
}
.imgsfoot {
background-image: url(https://hsgcs.dctpay.com/filesystem/wxApplets/share3.png);
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share3.png);
background-size: 100% 250px;
height: 250px;
background-repeat: no-repeat;

@ -0,0 +1,50 @@
<template>
<view>
<image class="width100" mode="widthFix" src="https://gratia-pay.dctpay.com/filesystem/share/1679038223473.png">
</image>
</view>
</template>
<script>
let app = getApp();
import {
generateWeChatMpQrCode
} from '../../Utils/Api.js'
export default {
data() {
return {
urls: 'https://gratia-pay.dctpay.com/filesystem/share/1679038223473.png' //
}
},
methods: {
generateWeChatMpQrCode() {
let that = this;
uni.getStorage({
key: 'staffCode',
success: (res) => {
let datas = {
outTradeNo: res.data,
// 1000017476,
type: 2
}
generateWeChatMpQrCode(datas).then(res => {
if (res.return_code == '000000') {
that.urls = res.return_data;
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
}
})
}
}
}
</script>
<style>
</style>
Loading…
Cancel
Save