Commit b2b94cc9d8e54323ef5b40217999117b81ec8e5b

Authored by vking
1 parent eaf3334d

pay

... ... @@ -31,11 +31,12 @@ Component({
methods: {
Invoice(){
wx.chooseInvoiceTitle({
success:res=>{
success:(res)=>{
console.log('wx.chooseInvoiceTitle',res)
this.triggerEvent('event',res)
},
fail:(efail)=>{
console.log('wx.chooseInvoiceTitle',res)
console.log('wx.chooseInvoiceTitle',efail)
wx.showModal({
title: '授权提示',
content: '您拒绝了获取发票抬头,请点击确定打开授权',
... ...
// pack-checkout/components/jinduBar.js
Component({
/**
* 组件的属性列表
*/
properties: {
checkout:Object,
},
/**
* 组件的初始数据
*/
data: {
steps:[
{number:1,txt:'获取消费金额'},
{number:2,txt:'商家反馈消费金额'},
{number:3,txt:'提前买单'},
],
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pack-checkout/components/jinduBar.wxml-->
<view class="jindu-view">
<view class="tips-info">3步轻松买单</view>
<view class="top flex-lr">
<view class="top-icon flex-vc {{checkout.status>=index?'active':''}}" wx:for="{{steps}}" wx:key="key">
<view class="top-icon-txt flex-vc">{{item.number}}</view>
</view>
</view>
<view class="bottom flex-lr">
<view class="bottom-txt {{checkout.status>=index?'active':''}}" wx:for="{{steps}}" wx:key="key">{{item.txt}}</view>
</view>
</view>
... ...
/* pack-checkout/components/jinduBar.wxss */
@import "/app.wxss";
.jindu-view{
padding-top: 90rpx;
padding-bottom: 36rpx;
position: relative;
}
.tips-info{
width:238rpx;
height:50rpx;
position: absolute;
top:-4rpx;
left:calc(50% - 129rpx);
font-size:28rpx;
font-weight:500;
color:rgba(255,255,255,1);
line-height:50rpx;
text-align: center;
background-size: 100% 100%;
background-image: url("http://qn.colorcun.com/checkout/images/4.png");
}
.top{
height:50rpx;
position: relative;
}
.top:before{
display: block;
position: absolute;
height: 2rpx;
background-color: #E0E0E0;
top:25rpx;
left:0;
width: 100%;
content: "";
}
.top-icon{
width: 130rpx;
background-color: #fff;
position: relative;
}
.top-icon-txt{
width:50rpx;
height:50rpx;
border-radius:10rpx;
background:rgba(153,153,153,1);
font-size:28rpx;
font-weight:500;
color:rgba(255,255,255,1);
}
.active .top-icon-txt{
background:linear-gradient(180deg,rgba(227,191,131,1) 0%,rgba(211,157,92,1) 100%);
box-shadow:2rpx 2rpx 4rpx 0rpx rgba(179,124,54,1);
}
.bottom{
margin-top: 24rpx;
height: 40rpx;
font-size:28rpx;
font-weight:500;
color:rgba(153,153,153,1);
line-height:40rpx;
}
.bottom-txt{
text-align: center;
}
.bottom-txt:first-child{
text-align: left;
}
.bottom-txt:last-child{
text-align: right;
}
.bottom-txt.active{
color:rgba(38,38,40,1);
}
\ No newline at end of file
... ...
... ... @@ -7,8 +7,7 @@ Page({
* 页面的初始数据
*/
data: {
activity:null,
count:0,
checkout:null,
},
/**
... ... @@ -16,21 +15,7 @@ Page({
*/
onLoad: function (options) {
this.options=options
let sys=wx.getSystemInfoSync();
if("wxwork"==sys.environment){
console.log('wxwork run pack-activity',options)
App.Task.GetTaskByOpenid({
...options
}).then(res=>{
this.options.id=options.aid
if(res.ret==200){
util.toast('恭喜获得红包','none')
setTimeout(()=>{
this.GetTaskInfos()
},300)
}
})
}
},
/**
... ... @@ -44,7 +29,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.GetTaskInfos()
this.GetCheckout()
},
/**
... ... @@ -74,59 +59,40 @@ Page({
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title:this.data.activity.title,
path:'/pages/reserve/index',
imageUrl:this.data.activity.bgurl+'.share.jpg',
}
},
GetTaskInfos(){
App.Task.GetTaskInfos({
aid:this.options.id,
}).then(res=>{
let activity=res.data.activity
activity.list=res.data.task
let count=0
activity.list.forEach(t=>{
if(t.status==2){
count+=(t.price*1)
}
})
GetCheckout(){
App.Customer.GetOrderInfo({rid:this.options.rid}).then(res=>{
this.setData({
count:count.toFixed(2),
activity:activity
checkout:res.data
})
})
},
taskNextDo(e){
let index=util.attr(e,'index')
let task=this.data.activity.list[index]
let tid=task.id
,path=util.http_build_query({aid:this.data.activity.id,tid:tid},task.task_url||'/pack-activity/pages/yuding')
console.log(path)
if(task.status==0){
App.Task.SetTaskInfo({//领取任务
aid:this.data.activity.id,
tid:tid,
}).then(()=>{
this.GetTaskInfos()
wx.navigateTo({
url: path
})
})
}else if(task.status==1){
wx.navigateTo({
url: path
})
}else{
wx.navigateTo({
url: '/pack-activity/pages/money'
})
is_wine:0,
is_pack:0,
checkoutData(e){
console.log(e)
this[util.attr(e,'type')]=util.val(e)?1:0
},
checkoutInit(){
let params={
rid:this.options.rid,
sid:this.options.sid,
is_wine:this.is_wine,
is_pack:this.is_pack
}
App.Customer.InitOrder(params).then(res=>{
this.GetCheckout()
})
},
setInvoice(e){
let invoice={
orderid:this.data.checkout.id,
}
Object.keys(e.detail).forEach(key=>{
invoice[key.toLowerCase()]=e.detail[key]
})
console.log('setInvoice',invoice)
App.Customer.SetInvoice(invoice).then(res=>{
util.toast('发票已提交','none')
})
},
})
\ No newline at end of file
... ...
... ... @@ -3,6 +3,9 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nav":"/components/nav/nav"
"nav":"/components/nav/nav",
"showModal":"/components/tips/showModal/showModal",
"invoice":"/components/userinfo/invoice",
"jinduBar":"../components/jinduBar"
}
}
\ No newline at end of file
... ...
<!--pack-activity/pages/index.wxml-->
<nav hasHome>周到安排</nav>
<view class="pages" style="background-color: {{activity.element}}">
<view class="banner">
<image mode="widthFix" src="{{activity.bgurl}}" style="width: 100%"></image>
<navigator url="/pack-activity/pages/rule?id={{activity.id}}" hover-class="navigator-hover">
<view class="guize">活动 规则</view>
</navigator>
<view class="nomoney" wx:if="{{activity.balance<=1000}}"></view>
</view>
<view class="pages">
<view class="content">
<navigator url="/pack-activity/pages/money" hover-class="navigator-hover">
<view class="tips flex-lr">
<view>活动累计收入:{{count}}元</view>
<view class="flex-rr">
查看余额
<view class="more"></view>
</view>
<jinduBar checkout="{{checkout}}"></jinduBar>
</view>
<!--//买单相关(可选)-->
<block wx:if="{{checkout.status<1}}">
<view class="content checkout">
<view class="title">买单相关(可选)</view>
<view class="item flex-lr">
<view>剩余酒水饮料需要退</view>
<switch color="#C0A369" bindchange="checkoutData" data-type="is_wine"/>
</view>
<view class="item flex-lr">
<view>菜品打包</view>
<switch color="#C0A369" bindchange="checkoutData" data-type="is_pack"/>
</view>
</navigator>
<view class="list">
<view class="header flex-cc">
<view class="header-img lt"></view>
<view class="header-txt">完成任务得红包</view>
<view class="header-img gt"></view>
</view>
<view class="checkout-get" bindtap="checkoutInit">获取消费金额</view>
</block>
<block wx:elif="{{checkout.status==1}}">
<view class="content checkout" wx:if="{{checkout.is_pack==1 || checkout.is_wine==1}}">
<view class="title">已提交信息</view>
<view class="item flex-lr" wx:if="{{checkout.is_wine==1}}">
<view>有剩余酒水饮料要退</view>
</view>
<view class="item flex-lr" wx:for="{{activity.list}}" wx:key="list">
<image class="icon" src="{{item.icon_url}}" mode="aspectFit"></image>
<view class="item-content">
<view class="item-title">{{item.title}}</view>
<view class="item-desc">{{item.desc}}</view>
</view>
<view class="opt" bindtap="taskNextDo" data-index="{{index}}" wx:if="{{activity.balance>1000}}">
<view class="opt-button status{{item.status}}">{{['领取','去完成','已完成'][item.status]}}</view>
<view class="opt-money">{{item.price}}元红包</view>
</view>
<view class="item flex-lr" wx:if="{{checkout.is_pack==1}}">
<view>菜品打包</view>
</view>
</view>
<view class="share-but">
<button class="button-none" open-type="share">分享活动</button>
<view class="content invoice">
<view class="title">提前开发票</view>
<view class="item flex-lr" bindtap="setInvoice">
<view>发票</view>
<invoice bindevent="setInvoice">
<view class="flex-rr invoice-right">
<view class="title {{checkout.invoice?'active':''}}">{{checkout.invoice.title||'提前提交发票抬头'}}</view>
<view class="more"></view>
</view>
</invoice>
</view>
</view>
</view>
<view class="checkout-get subscribe" bindtap="checkoutInit">商家反馈金额后提醒我</view>
<view class="checkout-get tx-seller" bindtap="checkoutInit">催一下商家</view>
</block>
</view>
<showModal id="showModal" confirmText="知道了" bindshowModal="showModal" cla="checkout"></showModal>
\ No newline at end of file
... ...
/* pack-activity/pages/index.wxss */
.pages{
page{
background-color: #F5F5F5;
}
.banner{
width:100%;
background:linear-gradient(202deg,rgba(213,45,182,1) 0%,rgba(240,72,102,1) 100%);
position: relative;
.pages{
padding: 204rpx 0 52rpx;
background-size: 100% auto;
background-repeat: no-repeat;
background-image: url("http://qn.colorcun.com/checkout/images/3.png");
}
.content{
height: 1020rpx;
width: calc(100% - 40rpx);
margin: 0 20rpx 0;
}
.tips{
width:100%;
height:50rpx;
background:rgba(53,53,53,0.3);
border-radius:30rpx;
position: relative;
background-color: #fff;
background:rgba(255,255,255,1);
border-radius:10px;
padding: 0 40rpx;
box-sizing: border-box;
padding: 0 28rpx 0 40rpx;
font-size:24rpx;
font-weight:500;
color:rgba(255,255,255,1);
line-height:50rpx;
}
.more{
background-image: url("http://qn.colorcun.com/activity/images/more.png");
margin-left: 22rpx;
.checkout,.invoice{
margin-top: 10rpx;
}
.guize{
width:40rpx;
height:120rpx;
background:rgba(53,53,53,0.29);
border-radius:10rpx 0rpx 0rpx 10rpx;
padding: 2rpx 10rpx 0;
.title{
height: 80rpx;
box-sizing: border-box;
font-size:20rpx;
border-bottom: 1rpx solid #F5F5F5;
line-height: 80rpx;
font-size:28rpx;
font-weight:500;
color:rgba(255,255,255,1);
line-height:28rpx;
position: absolute;
top:20rpx;
right:0;
}
.nomoney{
background-image: url("http://qn.colorcun.com/activity/images/nomoney.png");
width:176rpx;
height:144rpx;
right:24rpx;
bottom: 42rpx;
position: absolute;
background-size: 100% 100%;
color:rgba(153,153,153,1);
}
.list{
background:rgba(255,255,255,1);
box-shadow:4rpx 4rpx 6rpx 4rpx rgba(218,61,69,1);
border-radius:20rpx;
margin-top: 20rpx;
.item{
height: 138rpx;
box-sizing: border-box;
padding-top: 60rpx;
padding-bottom: 60rpx;
}
.header{
margin-bottom: 60rpx;
}
.header .header-txt{
width:236rpx;
height:44rpx;
border-bottom: 1rpx solid #F5F5F5;
line-height: 138rpx;
font-size:32rpx;
font-weight:600;
color:rgba(204,17,39,1);
line-height:44rpx;
margin: 0 20rpx;
color:rgba(53,53,53,1);
}
.header-img{
background-size: 100% 100%;
width: 70rpx;
height: 16rpx;
.item:last-child{
border-bottom-width: 0;
}
.header-img.gt{
background-image: url("http://qn.colorcun.com/activity/images/lt.png");
.checkout-get{
position: fixed;
bottom: 80rpx;
left: 38rpx;
width: calc(100% - 72rpx);
height: 80rpx;
line-height: 80rpx;
font-size:34rpx;
font-weight:400;
color:rgba(254,254,254,1);
background:rgba(36,35,32,1);
text-align: center;
}
.header-img.lt{
background-image: url("http://qn.colorcun.com/activity/images/gt.png");
.checkout-get.subscribe{
bottom: 178rpx;
}
.list .item{
margin-bottom: 60rpx;
height: 94rpx;
padding: 0 20rpx;
.checkout-get.tx-seller{
background: none;
border:2rpx solid rgba(38,38,40,1);
box-sizing: border-box;
color:rgba(38,38,40,1);
bottom: 80rpx;
}
.list .item:last-child{
margin-bottom: 0;
}
.item .icon{
width: 94rpx;
height: 94rpx;
min-width: 94rpx;
}
.item-content{
margin-left: 10rpx;
width: 100%;
}
.opt{
width: 130rpx;
min-width: 130rpx;
}
.item-title{
height:44rpx;
.invoice-right .title{
font-size:32rpx;
font-weight:600;
color:rgba(53,53,53,1);
line-height:44rpx;
}
.item-desc{
height:34rpx;
font-size:24rpx;
font-weight:500;
color:rgba(153,153,153,1);
line-height:34rpx;
margin-top: 10rpx;
margin-right: 20rpx;
}
.opt-money{
height:28rpx;
font-size:20rpx;
font-weight:600;
color:rgba(230,34,57,1);
line-height:28rpx;
margin-top: 10rpx;
}
.opt-button{
box-sizing: border-box;
width:130rpx;
height:50rpx;
border-radius:25rpx;
border:2rpx solid rgba(235,41,65,1);
font-size:24rpx;
font-weight:600;
color:rgba(230,34,57,1);
line-height:50rpx;
text-align: center;
}
.opt-button.status0,.opt-button.status1{
background:linear-gradient(180deg,rgba(225,27,49,1) 0%,rgba(243,53,78,1) 100%);
box-shadow:0rpx 2rpx 4rpx 0rpx rgba(232,37,60,1),2rpx 0rpx 6rpx 0rpx rgba(255,172,171,1);
color:rgba(255,227,192,1);
}
.share-but{
width:400rpx;
height:80rpx;
background:linear-gradient(180deg,rgba(252,190,38,1) 0%,rgba(255,233,128,1) 100%);
box-shadow:0rpx 4rpx 8rpx 0rpx rgba(182,43,68,1);
border-radius:40rpx;
margin-top: 40rpx;
font-size:32rpx;
font-weight:600;
color:rgba(230,34,57,1);
line-height:80rpx;
text-align: center;
margin-left: calc(50% - 200rpx);
}
.share-but .button-none{
height: 80rpx;
line-height:80rpx;
.invoice-right .title.active{
color:rgba(53,53,53,1);
}
\ No newline at end of file
... ...
... ... @@ -323,7 +323,10 @@ Page({
}).show();
}else{
wx.navigateTo({
url:'/pack-checkout/pages/index?rid='+this.data.detail.id
url:util.http_build_query({
rid:this.data.detail.id,
sid:this.data.detail.sid
},'/pack-checkout/pages/index')
})
}
},
... ...
... ... @@ -178,6 +178,14 @@
width: 32rpx;
height: 32rpx;
margin-right: 20rpx;
background-color: #1AAD19;
background-size: 100% 100%;
}
.checkout-icon-1{
background-image: url("http://qn.colorcun.com/checkout/images/2.png");
}
.checkout-icon-2{
background-image: url("http://qn.colorcun.com/checkout/images/1.png");
}
.checkout-icon-3{
background-image: url("http://qn.colorcun.com/checkout/images/1.png");
}
\ No newline at end of file
... ...
... ... @@ -483,7 +483,7 @@
"id": 57,
"name": "pages/customer/detail_owner",
"pathName": "pages/customer/detail_owner",
"query": "id=60409&firstShowMsg=",
"query": "id=60472&firstShowMsg=",
"scene": null
},
{
... ... @@ -639,6 +639,13 @@
"pathName": "pack-activity/pages/rule",
"query": "id=1",
"scene": null
},
{
"id": 80,
"name": "pack-checkout/pages/index",
"pathName": "pack-checkout/pages/index",
"query": "rid=60472&sid=80",
"scene": null
}
]
}
... ...
... ... @@ -455,4 +455,12 @@ export default {
},
//获取账单详情
'App.Customer.GetOrderInfo':null,
//初始化账单
'App.Customer.InitOrder':{
openid:'openid',
},
//用户发票关联账单、同时生成个人发票记录
'App.Customer.SetInvoice':{
openid:'openid',
},
}
\ No newline at end of file
... ...