Browse Source

upload

newCard
HolyKnightIX 2 years ago
parent
commit
7b9e7c2a62
7 changed files with 667 additions and 32 deletions
  1. +2
    -1
      app.json
  2. +115
    -0
      pages/cardorder/cardUse/cardUse.js
  3. +11
    -0
      pages/cardorder/cardUse/cardUse.json
  4. +135
    -0
      pages/cardorder/cardUse/cardUse.wxml
  5. +371
    -0
      pages/cardorder/cardUse/cardUse.wxss
  6. +32
    -30
      pages/cardorder/index/index.js
  7. +1
    -1
      pages/cardorder/index/index.wxml

+ 2
- 1
app.json View File

@@ -80,7 +80,8 @@
"pages/siteAdd/siteAdd",
"pages/fillIndent/fillIndent",
"pages/coupon/childDetail/childDetail",
"pages/theme/index1/index"
"pages/theme/index1/index",
"pages/cardorder/cardUse/cardUse"
],
"subpackages": [
{


+ 115
- 0
pages/cardorder/cardUse/cardUse.js View File

@@ -0,0 +1,115 @@
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px';
const util = require("../../../utils/util.js");
const config = require("../../../config/config.js");
const Http = require("../../../utils/HttpBasics");
let app = getApp();
const imgurl = require("../../../utils/imgurl");
Page({

/**
* 页面的初始数据
*/
data: {
navigationBarHeight,
data: {}
},

cardDetail(couponOrderId) {
let that = this;
Http.get({
url: config.api.cardDetail,
data: {
couponOrderId: couponOrderId
}
})
.then(res => {
console.log(res)
if (res.code == 200) {
res.data.expiredTime = util.formatTime(res.data.expiredTime, "yyyy-MM-dd hh:mm:ss")
that.setData({
showPage: true,
data: res.data,
supportTransfer: res.data.supportTransfer
})
/**
* 若可转赠获取用户头像信息
*/
if (res.data.supportTransfer) {
that.getUserInfo()
}
if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length <= 4) {
that.setData({
height: that.data.cardDetail.merchantVoList.length * 140 + 'rpx',
showMore: false
})
} else if (that.data.cardDetail.merchantVoList && that.data.cardDetail.merchantVoList.length > 4) {
that.setData({
height: 4 * 140 + 'rpx'
})
}
}
})
.catch(err => {
console.log(err)
})
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options);
if (options.cardId) {
this.cardDetail(options.cardId);
}
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide() {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload() {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage() {

}
})

+ 11
- 0
pages/cardorder/cardUse/cardUse.json View File

@@ -0,0 +1,11 @@
{
"usingComponents": {
"i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index",
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"shop": "../../../components/shop/shop"
},
"navigationBarTitleText": "使用消费卡",
"navigationBarBackgroundColor": "#F4F5F9"
}

+ 135
- 0
pages/cardorder/cardUse/cardUse.wxml View File

@@ -0,0 +1,135 @@
<navbar home back text="使用消费卡" color="#000" background="#ffff"></navbar>
<view style="height:{{navigationBarHeight}} "></view>
<view class='box'>
<view class="container page" wx:if="{{data.merchantVoList}}">
<view class="coupon_detail clearfix">
<view class="fl wmfl">
<image src="{{data.coverImg}}" mode='aspectFill' />
</view>
<view class="fr">
<text class="title">{{data.title}}</text>
<view class="time">{{data.subTitle}}</view>
<view class="money">
<text wx:if="{{data.type == 8&&data.price == data.couponPrice}}">余额:<text style="color: red;">{{data.couponPrice/100}}</text>元</text>
<text wx:if="{{data.type == 8&&data.price != data.couponPrice}}">余额:<text style="color: red;">{{data.salePrice/100}}</text>元</text>
<text wx:if="{{data.type != 8}}">余额:<text style="color: red;">{{data.couponPrice/100}}</text>元</text>
<!-- <del>¥{{data.price/100}}</del> -->
<text class="refund" wx:if="{{data.autoRefund == 1}}">
<text>过期不退款</text>
</text>
</view>
</view>
</view>
<view class="timevalidity" wx:if="{{data.validStatus != 0}}">
<text>有效期至:</text>
<text>{{expiredTime}}</text>
</view>
<view class="timevalidity" wx:if="{{data.validStatus == 0}}">
<text>有效期:</text>
<text>{{data.type==10?pickStartDate:validStartDate}}</text>
<i>至</i>
<text>{{data.type==10?pickEndDate:validEndDate}}</text>
</view>
<view></view>
<view wx:if="{{data.usePrice!=undefined}}" class="manjian">满{{data.usePrice/100}}元可用</view>
<!-- <view wx:if="{{data.usePrice==undefined}}" class="manjian">仅限本店使用</view> -->
<image class='line' mode="widthFix" src="{{topLine}}"></image>
<view class="zhuangtai">
<image wx:if="{{data.couponOrderStatus==1}}" src="{{wm01Url}}" mode='widthFix'></image>
<image wx:if="{{data.couponOrderStatus==2}}" src="{{wm02Url}}" mode='widthFix'></image>
<image wx:if="{{data.couponOrderStatus==3}}" src="{{wm03Url}}" mode='widthFix'></image>
<image wx:if="{{data.couponOrderStatus==0&&data.validStatus==0}}" src="{{wm04Url}}" mode='widthFix'></image>
<view class="panel" wx:if="{{data.couponOrderStatus==0&&data.validStatus!=0}}">
<!-- <view class="qrcode">
<canvas canvas-id="qrcode" />
</view> -->
<view class="canWrap">
<canvas canvas-id="qrcode" style="width: 1200rpx; height: 800rpx;" />
</view>
<image src="{{tempFilePath}}" mode="aspectFit" />
<view class="closeRq" wx:if="{{showhieRq}}" bindtap="setRq">
<image class="updataRqCode" mode='widthFix' src="{{upDataRqUrlF}}"></image>
<view class="upDataRq">点一点刷新二维码</view>
</view>

<view class="coedTiem" wx:if="{{!showhieRq&&expiredSeconds>1}}">二维码在
<text style="color:red">{{expiredSeconds}}s</text>
后失效
</view>

<view class="barnum">
<view class="barnumtext">{{showIdFalg?code:codeS}}</view>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
</view>
</view>
</view>
<!-- 适用门店 -->
<store merchantVoList="{{data.merchantVoList}}"></store>
<!-- <shop wx:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop> -->
<!-- <view class='applyshop'>适用门店</view>
<view class='posi' style='overflow:{{hidden}};height:{{height}}'>
<view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index">
<view bindtap='gotoDetail' data-id='{{item.id}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view wx:for="{{item.shopVoList}}" wx:key="index" wx:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' wx:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<image wx:if="{{item.linkLinePhone}}" bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" />
</view>
</view>
<view class='bottom' bindtap='more' wx:if="{{showMore}}">{{more}}</view> -->

<image class='line' mode="widthFix" src="{{btomLine}}"></image>
<view class='note'>
<view style='height:60rpx;line-height:60rpx;'>
<text class="shiji">实付金额:</text>
<text class='moneys'>{{data.couponPrice/100}}</text>
<text style='font-size:24rpx;text-align:right;color: #FF4949;'>元</text>
</view>
<view wx:if="{{data.couponOrderStatus==0}}">
<text>下单时间:</text>
<text>{{createDate}}</text>
</view>
<view wx:if="{{data.couponOrderStatus==1}}">
<text>核销时间:</text>
<text>{{updateDate}}</text>
</view>
<view wx:if="{{data.couponOrderStatus==2}}">
<text>过期时间:</text>
<text>{{updateDate}}</text>
</view>
<view wx:if="{{data.couponOrderStatus==3}}">
<text>退款时间:</text>
<text>{{updateDate}}</text>
</view>
<view>
<text>订单编号:</text>
<text>{{data.orderId}}</text>
</view>
<!-- <view><text>手机号</text><text>2018.05.25</text></view> -->
</view>
<view class='notes' style="border-bottom:0">
<view>
<text>购买须知</text>
</view>
<view wx:if="{{data.contentType==0}}">
<text><text class='spot'></text>{{data.remark}}</text>
</view>
<view wx:if="{{data.contentType==1}}">
<rich-text nodes="{{curHtml}}"></rich-text>
</view>
</view>
</view>
<view class='game' bindtap="gotogame" wx-if="{{showIf}}">
<view class='game-entry'>
<image src="{{newUrl}}" class='gameimg' mode='widthFix'></image>
</view>
</view>
</view>

+ 371
- 0
pages/cardorder/cardUse/cardUse.wxss View File

@@ -0,0 +1,371 @@
.box {
height: 100%;
background: linear-gradient(180deg, rgba(253, 131, 45, 1) 0%, rgba(254, 74, 22, 1) 100%);
}

.container {
background: #fff;
width: 92%;
margin: 8% auto 6%;
border-radius: 16rpx;

}

.coedTiem {
text-align: center;
color: rgba(253, 131, 45, 1);
margin-bottom: 10rpx;
}

page {
background: linear-gradient(180deg, rgba(253, 131, 45, 1) 0%, rgba(254, 74, 22, 1) 100%);
height: auto !important;
}

.zhuangtai {
margin-bottom: 20rpx;

}

.panel,
.zhuangtai image {
position: relative;
width: 600rpx;
display: block;
border-radius: 10rpx;
margin: 0 auto;
padding: 0;
z-index: 10000;
}

.panel {
position: relative;
}

.pane2 {
background: #fff;
opacity: 0.6;
}

.pane2 image {
width: 500rpx;
display: block;
margin: 40rpx auto 0;
}

.buy {
background: #fff;
height: 88rpx;
width: 98%;
color: #7e7e7e;
line-height: 88rpx;
border-radius: 16rpx;
border: 1px solid #eee;
}

.barcode {
height: 100rpx;
width: 510rpx;
margin: 0 auto;
}

.barnum {
background: #fff;
height: 88rpx;
width: 600rpx;
margin: 0 auto;
line-height: 88rpx;
border: 2rpx solid #ccc;
border-radius: 10px;
font-size: 36rpx;
color: #333;
letter-spacing: 0;
text-align: center;
overflow: hidden;
}

.barnumtext {
float: left;
margin-left: 20rpx;
font-size: 30rpx;
}

.barnumImg {
float: left;
height: 40rpx;
width: 40rpx !important;
margin: 24rpx 20rpx !important;
}

.barnumtext::before {
content: "优惠券码:";
font-size: 24rpx;
color: #999;
}

.barcode>canvas {
width: 510rpx;
height: 100rpx;
}

.qrcode {
position: relative;
height: 350rpx;
width: 350rpx;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
margin: 0 auto;
}

.qrcode>canvas {
width: 350rpx;
height: 350rpx;
}

.coupon_detail {
position: relative;
}

.coupon_detail .wmfl {
position: absolute;
width: 120rpx;
height: 120rpx;
left: 0;
right: 0;
margin: auto;
top: -50rpx;
border-radius: 50%;
overflow: hidden;
}

.coupon_detail image {
display: block;
width: 100%;
height: 100%;
}

.coupon_detail .fr {
width: 100%;
text-align: center;
}

.coupon_detail .title {
font-size: 32rpx;
color: #1f2d3d;
letter-spacing: 0;
text-align: center;
display: block;
padding-top: 92rpx;
line-height: 45rpx;
}

.line {
height: 10rpx;
display: block;
width: 100%;
margin-top: 20rpx;
}

.time {
font-size: 26rpx;
color: #999;
letter-spacing: 0;
text-align: center;
line-height: 37rpx;
padding: 0 10rpx;
}

.time text {
font-size: 26rpx;
color: red;
}

.money text {
color: #000;
}

.money del {
color: #999;
font-size: 26rpx;
text-decoration: line-through;
margin-left: 20rpx;
}

.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

.timevalidity {
text-align: center;
}

.timevalidity text:nth-of-type(1) {
font-size: 22rpx;
color: #999;
letter-spacing: 0;
text-align: left;
}

.timevalidity text:nth-of-type(2) {
font-size: 22rpx;
color: #999;
letter-spacing: 0;
text-align: left;
}

.timevalidity text:nth-of-type(3) {
font-size: 22rpx;
color: #999;
letter-spacing: 0;
text-align: left;
}

.tit {
padding: 53rpx 0 0;
text-indent: 30rpx;
font-size: 24rpx;
color: #919191;
letter-spacing: 0;
}

.notes view:nth-child(1) {
width: 92%;
height: 87rpx;
padding: 0 4%;
line-height: 87rpx;
background: #fff;
}

.notes view:nth-child(1) text {
font-size: 30rpx;
color: #333;
letter-spacing: 0;
}

.notes view:nth-child(2) {
width: 92%;
padding: 0 4%;
background: #fff;
display: flex;
flex-direction: column;
}

.notes view:nth-child(2)>text {
font-size: 24rpx;
color: #333;
letter-spacing: 0;
line-height: 42rpx;
}

.notes {
border-bottom-left-radius: 16rpx;
border-bottom-right-radius: 16rpx;
padding-bottom: 30rpx;
}

.note view {
height: 48rpx;
line-height: 48rpx;
}

.note view text {
display: inline-block;
}

.note text:nth-of-type(1) {
width: 22%;
text-indent: 30rpx;
text-align: left;
font-size: 24rpx;
color: #333;
letter-spacing: 1.16rpx;
}

.note text:nth-of-type(2) {
width: 67%;
font-size: 24rpx;
color: #333;
letter-spacing: 1.16rpx;
}

.manjian {
margin-left: 26rpx;
color: #999 !important;
font-size: 26rpx !important;
text-align: center;
}

.moneys {
font-size: 40rpx !important;
color: #ff4949 !important;
letter-spacing: 0;
text-align: right;
}


.game-entry {
width: 690rpx;
height: 140rpx;
margin: 10rpx auto 0;
}

.gameimg {
display: block;
width: 100%;
height: 140rpx;
}

.refund {
display: inline-block;
font-size: 26rpx !important;
color: red !important;
border: 1px solid red;
padding: 3rpx;
}

.closeRq {
position: absolute;
width: 420rpx;
height: 420rpx;
line-height: 420rpx;
text-align: center;
background-color: rgba(0, 0, 0, 0.8);
left: 50%;
top: 42%;
transform: translate(-50%, -50%);
/* 50%为自身尺寸的一半 */
z-index: 10000000;
color: #fff;
font-size: 38rpx;
}

.updataRqCode {
width: 80rpx !important;
height: 80rpx;
margin-top: calc(50%-80rpx) !important;
margin-left: calc(50%-80rpx) !important;
display: inline-block !important;
}

.upDataRq {
position: absolute;
width: 100%;
text-align: center;
height: 80rpx;
color: #fff;
top: 20%;
left: 0;
}

/* .upDataRqImg{
width: 40rpx !important;
height: 40rpx;
float: left;
margin: 20rpx 0 0 20rpx !important;
} */

+ 32
- 30
pages/cardorder/index/index.js View File

@@ -17,13 +17,13 @@ Page({
weixinTitle: imgurl.weixinTitle.url,
shixiao: imgurl.shixiao.url,
tabs: [{
key: 4,
name: "使用中"
},
{
key: "5,6,7",
name: "已失效"
}
key: 4,
name: "使用中"
},
{
key: "5,6,7",
name: "已失效"
}
],
list: [],
current: "4",
@@ -42,7 +42,7 @@ Page({
url: this_.data.goHomeUrl,
})
},
onLoad: function() {
onLoad: function () {
this.setData({
goHomeUrl: app.globalData.goHomeUrl
})
@@ -60,13 +60,13 @@ Page({
// index: 3
// })
},
userule: function() {
userule: function () {
wx.navigateTo({
url: '/pages/cardorder/userule/userule',
})
},
// 扫一扫去支付
gotoPay: function(e) {
gotoPay: function (e) {
app.globalData.previewFlag = true
/* wx.navigateTo({
url: `/pages/scanPay/scanPay`,
@@ -79,11 +79,11 @@ Page({
let value = JSON.parse(res.result);
if (value.END == 'B' && value.TYPE == 'merchant' && value.ID) {
Http.get({
url: config.api.findByCode,
data: {
merchantCode: value.ID,
}
})
url: config.api.findByCode,
data: {
merchantCode: value.ID,
}
})
.then(res => {
if (res.code == 200) {
let merChantDetail = JSON.stringify(res.data);
@@ -123,15 +123,18 @@ Page({
})
},
// 跳转到详情
gotoConsumeDetail: function(e) {
if (e.currentTarget.dataset.id){
gotoConsumeDetail: function (e) {
if (e.currentTarget.dataset.id) {
// wx.navigateTo({
// url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`,
// })
wx.navigateTo({
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`,
url: `/pages/cardorder/cardUse/cardUse?cardId=${e.currentTarget.dataset.id}`,
})
}
},
//点击跳转到券详情页面
gotouse: function(e) {
gotouse: function (e) {
if (this.data.mystatus == '' || this.data.mystatus == 'undefined') {
var mystatus = e.currentTarget.dataset.couponorderstatus;
} else {
@@ -139,12 +142,11 @@ Page({
}
if (e.currentTarget.dataset.quancode) {
wx.navigateTo({
url: `/pages/couponorder/detail/index?quancode=${
e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}`
url: `/pages/couponorder/detail/index?quancode=${e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}`
});
}
},
gotoBuy: function() {
gotoBuy: function () {
wx.navigateTo({
url: '/pages/discountCardList/discountCardList',
})
@@ -172,9 +174,9 @@ Page({
}
}
Http.get({
url: config.api.cardorderList,
data: data
})
url: config.api.cardorderList,
data: data
})
.then(res => {
console.log(res)
if (res.code == 200) {
@@ -182,8 +184,8 @@ Page({
showPage: true
})
}
if (res.data.list && res.data.list.length>0){
if (res.data.list && res.data.list.length > 0) {
res.data.list.map(file => {
file.expiredTime = util.formatTime(file.expiredTime, "yyyy.MM.dd")
if (file.couponOrderStatus == 5 || file.couponOrderStatus == 6 || file.couponOrderStatus == 7 || file.couponOrderStatus == 8) {
@@ -203,7 +205,7 @@ Page({

});
}
setTimeout(function() {
setTimeout(function () {
that.setData({
loading: false
});
@@ -227,7 +229,7 @@ Page({
.catch(err => {
wx.showModal({
title: '提示',
content: err.message ? err.message:err.data,
content: err.message ? err.message : err.data,
showCancel: false
})
})
@@ -254,7 +256,7 @@ Page({
});
this.getList(detail.key, 1);
},
onReachBottom: function() {
onReachBottom: function () {
var that = this;
that.data.page++;
that.setData({


+ 1
- 1
pages/cardorder/index/index.wxml View File

@@ -36,7 +36,7 @@
</view>
</view>
<!-- <view hover-class='active' bindtap='gotoPay' data-remainingAmount="{{item.remainingAmount/100}}" data-cardId="{{item.id}}" data-couponorderstatus="{{item.couponOrderStatus}}" wx:if="{{item.couponOrderStatus==4}}" class="btns" style='color:{{item.background}}!important'>扫一扫付款</view> -->
<view hover-class='active' bindtap='gotoPay' data-remainingAmount="{{item.remainingAmount/100}}" data-cardId="{{item.id}}" data-couponorderstatus="{{item.couponOrderStatus}}" wx:if="{{item.couponOrderStatus==4}}" class="btns">扫一扫付款</view>
<!-- <view hover-class='active' bindtap='gotoPay' data-remainingAmount="{{item.remainingAmount/100}}" data-cardId="{{item.id}}" data-couponorderstatus="{{item.couponOrderStatus}}" wx:if="{{item.couponOrderStatus==4}}" class="btns">扫一扫付款</view> -->
<view hover-class='active' bindtap='gotoBuy' wx:if="{{item.couponOrderStatus!=4}}" style='color:rgba(179,180,181,1);bottom:20rpx' class="btns clearfix">再次购买</view>
<text class='txtstatus' wx:if="{{item.couponOrderStatus == 5}}">已过期</text>
<text class='txtstatus' wx:if="{{item.couponOrderStatus == 6}}">余额已用完</text>


Loading…
Cancel
Save