Commit 4f854c7b authored by lihongqiang's avatar lihongqiang

Initial commit

parents
.text_overflow{
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
}
.over_two_lines {
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
white-space: pre-line;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
div{
word-wrap: break-word;
word-break: normal;
}
/* 换行^ */
.page-wrapper{
width: 100%;
/*height: 100%;*/
background-color: #f7f7f7;
}
.page-wrapper .gettitle{
width: 100%;
height: 1.7837837837837838rem;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.page-wrapper .gettitle .img{
width: 0.7567567567567568rem;
height: 0.7567567567567568rem;
background-size: 100%;
margin-right: 0.21621621621621623rem;
}
.page-wrapper .gettitle div{
font-size:0.43243243243243246rem;
font-weight:400;
color:rgba(102,102,102,1);
line-height:0.5405405405405406rem;
}
.page-wrapper .detail{
margin: 0 0.6216216216216216rem;
}
.page-wrapper .card{
width: 100%;
background: #ffffff;
border-radius: 0.2702702702702703rem;
height: 8.64864864864865rem;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
.page-wrapper .card .title{
width: 5.405405405405405rem;
font-size: 0.43243243243243246rem;
line-height: 0.5945945945945946rem;
color: #666;
padding-top: 0.7027027027027027rem;
}
.page-wrapper .card .con{
width: 6.324324324324325rem;
font-size: 0.32432432432432434rem;
line-height: 0.43243243243243246rem;
color: #666;
margin: 0.2702702702702703rem 0;
}
.page-wrapper .card img{
background-size: 100%;
width: 3.7837837837837838rem;
height: 3.7837837837837838rem;
}
.page-wrapper .card .time{
width: 4.324324324324325rem;
font-size: 0.32432432432432434rem;
line-height: 0.3783783783783784rem;
color: #666;
margin: 0.5405405405405406rem 0 0 0;
}
.getgift{
width:8.756756756756756rem;
height:1.3513513513513513rem;
background:rgba(87,189,106,1);
border-radius:0.16216216216216217rem;
color:#ffffff;
font-size: 0.43243243243243246rem;
line-height: 1.3513513513513513rem;
text-align: center;
margin:0.7567567567567568rem auto 0;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--<meta content="yes" name="apple-mobile-web-app-capable">-->
<!--<meta content="yes" name="apple-touch-fullscreen">-->
<!--<meta content="telephone=no,email=no" name="format-detection">-->
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<script src="../../lib/rem.js"></script>
<link rel="stylesheet" type="text/css" href="../../lib/base.css">
<link rel="stylesheet" type="text/css" href="couponGetSuccess.css">
<link href="https://cdn.bootcss.com/weui/2.0.1/style/weui.min.css" rel="stylesheet">
<title>兑换成功</title>
</head>
<body>
<div class="page-wrapper">
<div class="gettitle">
<img src="https://hh-oss-html.miyapay.com/hhops/picture/156689535460602adc0700023" class="img">
<div>兑换成功,请点击领取</div>
</div>
<div class="detail">
<div class="card">
<div class="title text_overflow"></div>
<div class="con over_two_lines"></div>
<img src="">
<div class="time">兑换时间:</div>
</div>
</div>
<div class="getgift">立即领取</div>
</div>
<!-- 弹窗 -->
<div class="js_dialog" id="iosDialog1" style=" display: none;">
<div class="weui-mask"></div>
<div class="weui-dialog">
<div class="weui-dialog__hd"><strong class="weui-dialog__title">title</strong></div>
<div class="weui-dialog__bd"></div>
<div class="weui-dialog__ft">
<!--<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default">辅助操作</a>-->
<a href="javascript:;" id="iosDialog1primary" class="weui-dialog__btn weui-dialog__btn_primary">确定</a>
</div>
</div>
</div>
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script><!-- 引入小程序api -->
<script>
// 弹出弹窗
function DialogAlert(title,con,primary) {
$('#iosDialog1').show()
$('.weui-dialog__title').html(title)
$('.weui-dialog__bd').html(con)
$('#iosDialog1Close').html(primary)
}
// 关闭
$('#iosDialog1primary').on('click',function () {
$('#iosDialog1').hide()
})
$(function () {
// 设置背景图最小高度,铺满全屏
$('.page-wrapper').css('min-height',window.screen.height+'px')
// 公共参数
// var apiUrl = 'http://192.168.3.33:8100' // url api
// var apiUrl = 'https://saas-zuultest.miyapay.com' // url api
var apiUrl = ''
var token = ''
var hhForm = 'cocaCola'
var hhCI = 'saas-wechat-app'
var nickName = '' // 用户名/手机号
var status = '' // 0已处理 1未处理可领取
var cardId = '' // id
var orderId = '' // 订单id
// 获取url参数
function GetQueryString(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
var code = GetQueryString("code")
var state = GetQueryString("state").split('.')
token = state[0]
nickName = state[1]
status = state[2] // 0已处理 1未处理可领取
if(status == '1'){
$('.getgift').html('已领取').css('background','#cccccc')
}
cardId = state[3] // id
orderId = state[4] // 订单id
// 定义data
var openid= ''
// 获取openid
$.ajax({
type: "get",
beforeSend: function(xhr) {
xhr.setRequestHeader("content-type","application/json")
xhr.setRequestHeader("Authorization","bearer "+ token)
xhr.setRequestHeader("hh-from", hhForm)
xhr.setRequestHeader("HH-CI",hhCI)
},
url: apiUrl + "/sapi/message/openid?code="+ openid,
success: function(res) {
if(res.code == '200'){
if(res.data.code == '200'){
openid = res.data.data
}else{
DialogAlert('提示',res.data.msg)
}
}else{
DialogAlert('提示',res.data.msg)
}
},
error: function(err) {
}
})
// 券详情
$.ajax({
type: "post",
beforeSend: function(xhr) {
xhr.setRequestHeader("content-type","application/json")
xhr.setRequestHeader("Authorization","bearer "+ token)
xhr.setRequestHeader("hh-from", hhForm)
xhr.setRequestHeader("HH-CI",hhCI)
},
url: apiUrl + "/sapi/card/detail",
data: JSON.stringify({
id: cardId
}),
success: function(res) {
if(res.code == '200'){
console.log(res.data)
$('.card .title').html(res.data.coupon_name)
$('.card .con').html(res.data.desc)
$('.card img').attr('src',res.data.img)
$('.card .time').html('兑换时间:'+res.data.begin_time+'至'+res.data.end_time)
}else{
DialogAlert('提示',res.msg)
}
},
error: function(err) {
}
})
// 点击领券
$('.getgift').on('click',function () {
if(status == '1'){ // 已经领取了
return
}
var that = $(this)
$.ajax({
type: "post",
beforeSend: function(xhr) {
xhr.setRequestHeader("content-type","application/json")
xhr.setRequestHeader("Authorization","bearer "+ token)
xhr.setRequestHeader("hh-from", hhForm)
xhr.setRequestHeader("HH-CI",hhCI)
},
url: apiUrl + "/sapi/card/send/coupon",
data:JSON.stringify({
id: cardId,
nickName: nickName,
openid:openid
}),
success: function(res) {
if(res.code == '200'){
var status = res.data.status
if(status == '200' || status == '204'){ // 204为已领取
DialogAlert(status=='200'?'领取成功':'领取失败',status=='200'?'恭喜您领取成功,可在我的卡包中查看~':res.data.msg)
if(status == '200'){
$.ajax({
type: "post",
beforeSend: function(xhr) {
xhr.setRequestHeader("content-type","application/json")
xhr.setRequestHeader("Authorization","bearer "+ token)
xhr.setRequestHeader("hh-from", hhForm)
xhr.setRequestHeader("HH-CI",hhCI)
},
url: apiUrl + "/sapi/order/update/status",
data: JSON.stringify({
id: orderId,
status: 1
}),
success: function(res) {
if(res.code == '200'){
}else{
DialogAlert('提示',res.msg)
}
},
error: function(err) {
}
})
// 跳转回积分商城
wx.miniProgram.switchTab({
url : '/pages/brand/brand_mall/index'
})
}
}else{
DialogAlert('领取失败',res.data.msg)
}
}else{
DialogAlert('提示',res.msg)
}
},
error: function(err) {
}
})
})
})
</script>
</body>
</html>
\ No newline at end of file
.text_overflow{
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
}
.over_two_lines {
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
white-space: pre-line;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
div{
box-sizing: border-box;
}
/* 公用^ */
.page-wrapper{
width: 100%;
/*height: 71.89189189189189rem;*/
background-size: 100%;
background-repeat: no-repeat;
}
.page-wrapper .list{
width: 100%;
box-sizing: border-box;
padding: 8.45945945945946rem 0.5945945945945946rem 0;
margin: 0 auto 0;
}
.page-wrapper .list .item{
width: 100%;
height: 2.4324324324324325rem;
background-color: white;
border-radius: 0.2702702702702703rem;
margin-bottom: 0.2702702702702703rem;
box-shadow:0rem 0.05405405405405406rem 0.2702702702702703rem 0rem rgba(0,0,0,0.1);
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 0.43243243243243246rem;
}
.page-wrapper .list .item .item_img{
width: 1.2432432432432432rem;
height: 1.2432432432432432rem;
background-size: 100%;
}
.page-wrapper .list .item .item_title{
width: 4.324324324324325rem;
font-size: 0.3783783783783784rem;
color: #666;
line-height: 0.5405405405405406rem;
}
.page-wrapper .list .item .item_title .con{
font-size: 0.32432432432432434rem;
line-height: 0.43243243243243246rem;
margin-top: 0.13513513513513514rem;
}
.page-wrapper .list .item .item_button{
width: 1.8918918918918919rem;
height: 0.8108108108108109rem;
border-radius: 0.40540540540540543rem;
background-color: #cccccc;
font-size: 0.32432432432432434rem;
color: #ffffff;
line-height: 0.8108108108108109rem;
text-align: center;
position: relative;
}
.explain{
font-size: 0.32432432432432434rem;
line-height: 0.4864864864864865rem;
color:#ffffff;
text-align: center;
padding-bottom: 1.2972972972972974rem;
}
.explain .top_explain{
margin-top: 0.40540540540540543rem;
}
.explain .top_explain span{
display: inline-block;
}
.explain .bottom_explain{
padding: 0.2702702702702703rem;
width: 6.756756756756757rem;
margin: 0 auto;
}
/*底部浮窗提示*/
.bottomTip{
width:8.108108108108109rem;
height:1.3513513513513513rem;
background:linear-gradient(360deg,rgba(239,239,239,1) 0%,rgba(255,255,255,1) 100%);
box-shadow:0rem 0.05405405405405406rem 0.2702702702702703rem 0rem rgba(0,0,0,0.5);
border-radius:0.6756756756756757rem;
margin: 1.0810810810810811rem auto 0.43243243243243246rem;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.bottomTip .left{
width: 0.6756756756756757rem;
height: 0.6756756756756757rem;
border-radius: 50%;
border: 0.08108108108108109rem solid #FEF18A;
background-color: #FDB120;
text-align: center;
color: #ffffff;
font-size: 0.32432432432432434rem;
line-height: 0.5405405405405406rem;
}
.bottomTip .right{
width: 5.88rem;
font-size:0.32432432432432434rem;
color:rgba(153,153,153,1);
line-height:0.4594594594594595rem;
margin-left: 0.17rem;
}
.bottomTip .right span{
color: #E64340;
}
/* 暂无活动 */
.noactivity{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.noactivity .shopImage{
width:4.054054054054054rem;
height:4.054054054054054rem;
}
.noactivity div{
font-size: 0.32432432432432434rem;
color:#999999;
padding-top: 0.5405405405405406rem;
}
/* 活动弹窗 */
.popup {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.popup .mask {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.4);
}
.popup .dialog {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 80vw;
}
.popup .dialog .container{
background-color: #ffffff;
border-radius: 0.21621621621621623rem;
padding-bottom: 0.5405405405405406rem;
}
.popup .dialog .header {
width: 100%;
padding: 0.5405405405405406rem 0.9459459459459459rem;
font-size: 0.43243243243243246rem;
line-height: 0.5945945945945946rem;
text-align: center;
font-weight:500;
}
.popup .dialog .content {
width: 100%;
max-height: 45vh;
box-sizing: border-box;
padding: 0 0.9459459459459459rem 0.9459459459459459rem;
overflow: auto;
}
.popup .dialog .content .contentcontent{
width: 100%;
font-size: 0.32432432432432434rem;
line-height: 0.4864864864864865rem;
color:#333;
word-wrap: break-word;
word-break: normal;
}
.popup .dialog .closeexplain {
margin: 0.40540540540540543rem auto 0;
width: 1.0810810810810811rem;
height: 1.0810810810810811rem;
background-image: url("https://hh-oss-html.miyapay.com/hhops/picture/15662902569090e349c454c80");
background-size: 100%;
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment