Commit e7426ee4234759b86df31613a939c7128c1692c0

Authored by yiren
1 parent d580ec02

充值和买券页面和接口对接

... ... @@ -56,7 +56,8 @@
"pages/tcads/cmyy",
"pages/pinglun/video",
"pages/customer/detail_owner_invitation_new",
"pages/me/coupon_news"
"pages/me/coupon_news",
"pages/me/wananchi"
],
"requiredPrivateInfos": [
"getLocation",
... ...
... ... @@ -46,39 +46,26 @@ Page({
},
getDetail(){
App.Activity.GetOrderRechargeByid({
orderid:this.data.id
id:this.data.id
}).then(res=>{
if(res.data.length>0){
let detail=res.data[0];
let exp_date=detail.exp_date?JSON.parse(detail.exp_date):'';
this.setData({
detail,
exp_date
})
console.log('detaildetail',{...this.data.detail});
console.log('exp_date',{...this.data.exp_date});
this.getSeller(res.data[0].sellerid)
this.getCertificateDetail(res.data[0].recharge_id)
}
})
},
getCertificateDetail(id){
App.Activity.GetActivityById({
id
}).then(res => {
if(res.data.length>0){
let certificateDetail =res.data[0];
let exp_date=certificateDetail.exp_date?JSON.parse(certificateDetail.exp_date):'';
this.setData({
certificateDetail,
exp_date,
})
console.log('certificateDetail',{...certificateDetail});
console.log('exp_date',{...exp_date});
let detail=res.data;
let exp_date=detail.exp_date?JSON.parse(detail.exp_date):'';
let date=Date.now()*1;
if(date>detail.etime){
detail.is_expire='0';
}else{
detail.is_expire='1';
}
this.setData({
detail,
exp_date
})
console.log('detaildetail',{...this.data.detail});
console.log('exp_date',{...this.data.exp_date});
this.getSeller(res.data.sellerid)
})
},
// 获取商家信息
getSeller(sid){
App.Customer.GetSellerDetail({
sid,
... ... @@ -110,9 +97,15 @@ Page({
// 申请退款
subscribeDrawback() {
wx.navigateTo({
url: '/pack-activity/pack/subscribeDrawback',
url: '/pack-activity/pack/subscribeDrawback?id='+this.data.detail.orderid,
})
},
// 跳转到商家详情
getReserve(){
wx.reLaunch({
url:'/pages/reserve/detail?id='+this.data.detail.sellerid
})
},
/**
* 生命周期函数--监听页面隐藏
*/
... ...
... ... @@ -4,15 +4,15 @@
<view class="box_wrap">
<view class="top_box">
<view class="discount_name font40r">
{{detail.aname}}
{{detail.activity.aname}}
</view>
<view class="shop_name font28r">
{{detail.sellername}}
</view>
<view class="lineBox">
<view class="line"></view>
<image wx:if="{{type=='group2'}}" class="group" src="https://qn.colorcun.com/WechatIMG714.png" mode="" />
<image wx:if="{{type=='group'}}" class="group" src="https://qn.colorcun.com/WechatIMG713.png" mode="" />
<image wx:if="{{detail.is_examine=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG713.png" mode="" />
<image wx:if="{{detail.is_expire=='1'}}" class="group" src="https://qn.colorcun.com/WechatIMG714.png" mode="" />
</view>
<image class="qcode" src="{{detail.qrcode}}" mode="" />
<view class="orderNumber font28r">
... ... @@ -20,15 +20,15 @@
</view>
</view>
<view class="center_box">
<view class="info">
<view class="info" wx:if="{{detail.activity.desc}}">
<view class="info_left font32r">
券要求
</view>
<view class="info_right font32r">
{{detail.desc}}
{{detail.activity.desc}}
</view>
</view>
<view class="info">
<view class="info" wx:if="{{detail.stime}}">
<view class="info_left font32r">
有效期从
</view>
... ... @@ -37,7 +37,7 @@
</view>
</view>
<view class="info">
<view class="info_left font32r">
<view class="info_left font32r" wx:if="{{detail.etime}}">
有效期至
</view>
<view class="info_right font32r">
... ... @@ -73,20 +73,20 @@
{{exp_date.week_show?exp_date.week_show+'可用':''}}
</text>
</view>
<view class="info info1" wx:if="{{detail.explain}}">
<view class="info info1" wx:if="{{detail.activity.explain}}">
<view class="info_left font32r">
券说明
</view>
</view>
<view class="explain_news">{{detail.explain}}</view>
<view class="explain_news">{{detail.activity.explain}}</view>
</view>
<view class="btns">
<view class="btns" wx:if="{{detail.is_examine!='1' && detail.is_expire!='1'}}">
<button class="font24r" plain="true" bindtap="subscribeDrawback">申请退费</button>
</view>
<view class="canteen_box">
<view class="canteen_box" bindtap="getReserve">
<image src="{{sellerObj.seller_image}}" mode="heightFix" />
<view class="info_right">
<view class="font38r">{{sellerObj.sellername}}</view>
<view class="font38r sellerName">{{sellerObj.sellername}}</view>
<view class="font24r">{{sellerObj.cateStr}}</view>
<view class="font28r">{{sellerObj.real_address}}</view>
</view>
... ...
... ... @@ -98,6 +98,10 @@
font-family: PingFang SC;
}
.sellerName{
color: #515151;
}
.explain_news {
width: 100%;
box-sizing: border-box;
... ...
// pack-activity/pack/subscribeDrawback.js
import App from '../../utils/api'
Page({
/**
* 页面的初始数据
*/
data: {
checkboxList: [{
number:'0',
checkName:'',
id:'',
radioboxList: [{
value: '1',
name: '计划有变,没时间消费'
},
... ... @@ -64,6 +67,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.data.id=options.id;
this.modal = this.selectComponent("#drawbackModal"); //通过给组件所起的id调用组件
},
showModal() {
... ... @@ -72,9 +76,21 @@ Page({
closeModal() {
this.modal.closeModal() //调用组件中关闭模态框方法
},
// 关注公众号
wananchi() {
wx.navigateTo({
url: '/pages/me/wananchi'
})
},
//申请退款
subscribeDrawback() {
this.modal.showModal()
App.PayOnline.RechargeRefundApply({
reason:this.data.checkName,
id:this.data.id,
}).then(res=>{
console.log(res);
})
// this.modal.showModal()
// wx.showModal({
// title: '申请成功',
// cancelText:' ',
... ... @@ -90,21 +106,30 @@ Page({
// })
},
// 选择退款原因
checkboxChange(e) {
radioChange(e) {
console.log('checkbox发生change事件,携带value值为:', e.detail.value)
const checkboxList = this.data.checkboxList
const radioboxList = this.data.radioboxList
const values = e.detail.value
for (let i = 0, lenI = checkboxList.length; i < lenI; ++i) {
checkboxList[i].checked = false
let checkName;
for (let i = 0, lenI = radioboxList.length; i < lenI; ++i) {
radioboxList[i].checked = false
for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
if (checkboxList[i].value === values[j]) {
checkboxList[i].checked = true
if (radioboxList[i].value === values[j]) {
radioboxList[i].checked = true;
break
}
}
}
this.setData({
checkboxList
radioboxList,
checkName
})
},
bindTextAreaBlur(e){
let value = e.detail.value;//获取textarea的内容,
let len = value.length;//获取textarea的内容长度
this.setData({
'number': len
})
},
/**
... ...
<!--pack-activity/pack/subscribeDrawback.wxml 申请退款页面-->
<nav> </nav>
<nav></nav>
<view class="box">
<view class="content">
<view class="info">
... ... @@ -23,24 +23,25 @@
退款原因(至少选1项)
</view>
</view>
<checkbox-group bindchange="checkboxChange" class="checklist">
<label class="weui-cell info weui-check__label" wx:for="{{checkboxList}}" wx:key="{{item.value}}">
<radio-group bindchange="radioChange" class="checklist radio-label">
<label class="weui-cell info weui-check__label radio" wx:for="{{radioboxList}}" wx:key="{{item.value}}">
<view class="weui-cell__bd info_left">{{item.name}}</view>
<view class="weui-cell__hd info_right">
<checkbox value="{{item.value}}" color="#0143A3" checked="{{item.checked}}" />
<radio value="{{item.value}}" color="#0143A3" checked="{{item.checked}}" />
</view>
</label>
</checkbox-group>
</radio-group>
<view class="info">
<view class="info_left font32r">
更多不爽?必须吐槽!
</view>
</view>
<view class="section">
<textarea class="textareaStyle" bindblur="bindTextAreaBlur" auto-height placeholder="小周将用心倾听您的任何意见~" />
<textarea class="textareaStyle" bindinput="bindTextAreaBlur" maxlength="500" auto-height placeholder="小周将用心倾听您的任何意见~" />
<span class="wordwrap">{{number}}/500</span>
</view>
</view>
<view class="bottom">
<view class="bottom" bindtap="wananchi">
<view class="font26r publicity">关注<text class="bold_box">周到安排</text>公众号,及时获取更多优惠券动态
</view>
<view class="more" style="margin-left: 20rpx;"></view>
... ...
... ... @@ -94,6 +94,8 @@
width: 93%;
margin-top: 24rpx;
margin-left: 7%;
padding-bottom: 20rpx;
position: relative;
}
.textareaStyle {
... ... @@ -155,4 +157,37 @@
.mymodal-content {
height: 380px;
}
\ No newline at end of file
}
.wordwrap {
position: absolute;
right: 12rpx;
bottom: 12rpx;
}
radio .wx-radio-input{
width: 35rpx;
height: 35rpx;
line-height: 35rpx;
border-radius: 3px;/* 圆角:border-radius: 50%; */
}
radio .wx-radio-input.wx-radio-input-checked {
border: 1rpx solid #4788E5;
background: #4788E5;
width: 35rpx; /* 背景的宽 */
height: 35rpx; /* 背景的高 */
line-height: 35rpx;
}
radio .wx-radio-input.wx-radio-input-checked::before {
width: 35rpx;
height: 35rpx;
line-height: 35rpx;
text-align: center;
font-size: 30rpx; /* 对勾大小 30rpx */
color: #fff; /* 对勾颜色 白色 */
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}
radio::before, checkbox::before {
z-index: -10 !important;
}
\ No newline at end of file
... ...
... ... @@ -9,12 +9,21 @@ Page({
this.getlist();
},
getlist() {
App.Activity.GetNewRechargeListByOpenid().then((json) => {
console.log(json);
if (json.ret == 200) {
App.Activity.GetNewRechargeListByOpenid().then((res) => {
if (res.ret == 200) {
let list=res.data;
let date=Date.now()*1;
list.forEach(item=>{
if(date>item.etime){
item.is_expire='0';
}else{
item.is_expire='1';
}
})
this.setData({
list: json.data
list: res.data
})
}
})
},
... ... @@ -35,12 +44,28 @@ Page({
contentHeight: systemInfo.windowHeight - pt - h
})
},
getnext() {
// 去详情或者去评价
todetail(e) {
let id=e.currentTarget.dataset['id'];
let examine=e.currentTarget.dataset['examine'];
let expire=e.currentTarget.dataset['expire'];
let sellername=e.currentTarget.dataset['name'];
let sid=e.currentTarget.dataset['sid'];
console.log('todetailid',id);
if(expire=='0' && examine=='0'){
wx.reLaunch({
url: '/pack-activity/pack/examineCertificate?id='+id,
})
}else{
wx.reLaunch({
url: `/pages/pinglun/create?oid=${id}&sellername=${sellername}&sid=${sid}&types=3`,
})
}
},
toused() {
// 关注公众号
wananchi() {
wx.navigateTo({
url: './used'
url: './wananchi'
})
}
})
\ No newline at end of file
... ...
<!--pages/taocan/coupon_news.wxml 用户端--我的--卡券-->
<wxs src="../../utils/util.wxs" module="util" />
<nav>卡券</nav>
<scroll-view class="list" style="height:{{contentHeight}}px;padding-bottom: 140rpx;" bindscrolltolower="getnext" scroll-y>
<block wx:for="{{list}}">
<view class="card bg-white {{mark}}" bindtap="todetail" data-id="{{item.aid}}">
<view class="flex-vl {{mark=='canuse' ? 'orange-font' : 'gray-font'}} card-main {{mark}}" style="justify-content:space-between;">
<scroll-view class="list" style="height:{{contentHeight}}px;padding-bottom: 140rpx;" scroll-y>
<block wx:if="{{list.length>0}}">
<view wx:for="{{list}}" class="card bg-white" bindtap="todetail" data-id="{{item.id}}" data-examine="{{item.is_examine}}" data-expire="{{item.is_expire}}" data-name="{{item.recharge_name}}" data-sid="{{item.sellerid}}">
<view class="flex-vl gray-font card-main" style="justify-content:space-between;">
<view class="seller-info flex-ll">
<view class="smooth font-siny font32r" wx:if="{{item.recharge_name}}">{{item.recharge_name}}</view>
</view>
<view class="font24r font-bold text1" wx:if="{{item.sellername}}">{{item.sellername}}</view>
<view class="font24r font-bold text1" wx:if="{{item.order_no}}">{{item.order_no}}</view>
</view>
<button class="flex-cc card-info font30r font-bold smooth" style="color:{{mark=='canuse' ? '#F05522' : '#999999'}};">{{mark=='used' ? (item.status==1 ? '已使用' : '已过期') : '去使用'}}</button>
<view class="{{mark=='canuse' ? 'orange-font' : 'gray-font'}} font24r texts smooth">有效时间:{{util.unixtoTime(item.stime,'YYYY-MM-DD')}}-{{util.unixtoTime(item.etime,'YYYY-MM-DD')}}</view>
<image wx:if="{{item.is_examine=='1'}}" src="https://qn.colorcun.com/WechatIMG713.png" class="imgs1" mode="" />
<image wx:if="{{item.is_expire=='1'}}" src="https://qn.colorcun.com/WechatIMG714.png" class="imgs1" mode="" />
<button wx:if="{{item.is_examine=='1' || (item.is_expire=='0'&& item.is_examine=='0')}}" class="flex-cc card-info font30r font-bold smooth">{{item.is_examine=='1' ? '去评价' : (item.is_expire=='0'&& item.is_examine=='0') ?'去使用': ''}}</button>
<view class="font24r texts smooth">有效时间:{{util.unixtoTime(item.stime,'YYYY-MM-DD')}}-{{util.unixtoTime(item.etime,'YYYY-MM-DD')}}</view>
</view>
</block>
<block wx:else>
<view class="flex-vc">
<view class="empty-img"></view>
<view class="empty-txt">暂时没有优惠券哦~</view>
</view>
</block>
</scroll-view>
<view class="card-used flex-cc bg-white gray-font font32r">
<view class="card-used flex-cc bg-white gray-font font32r" bindtap="wananchi">
<view class="wananchi">
关注<text>周到安排</text>公众号,及时获取更多优惠信息
</view>
... ...
... ... @@ -38,6 +38,7 @@
height: 65%;
padding: 14rpx 24rpx;
box-sizing: border-box;
position: relative;
}
.card-main.canuse {
... ... @@ -58,8 +59,8 @@
.card-info {
padding: 0 26rpx;
height: 54rpx;
line-height: 54rpx;
height: 48rpx;
line-height: 48rpx;
box-sizing: border-box;
margin: 0;
position: absolute;
... ... @@ -68,6 +69,7 @@
border: 2rpx solid #0143A3;
border-radius: 44rpx;
font-weight: normal;
color: #999999;
}
.use-button {
... ... @@ -156,4 +158,27 @@
left: 0;
color: #fff;
background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%);
}
.imgs1{
position: absolute !important;
right: 30%;
top: 15%;
width: 92rpx;
height: 92rpx;
}
.empty-img{
background-image: url("http://nosqn.colorcun.com/sellerbaobao/empty2.png");
background-size: 100% 100%;
width:302rpx;
height:408rpx;
}
.empty-txt{
height:44rpx;
font-size:32rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(53,53,53,1);
line-height:44rpx;
margin-top: 40rpx;
}
\ No newline at end of file
... ...
// pages/me/wananchi.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"usingComponents": {
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pages/me/wananchi.wxml-->
<nav backgroundColor="transparent"></nav>
<view class="box">
<view class="title">
关注周到安排公众号
</view>
<image show-menu-by-longpress="{{true}}" src="https://img1.maka.im/user/2755422/56504fec5d6a6629f825ed1e17abdb1e.jpeg" class="qrcode" mode="aspectFill" />
<view class="info">
长按扫码关注【周到安排】服务号
</view>
<view class="text1">
关注<text>周到安排</text>服务号
</view>
<view class="text1">
即可获得以下权益
</view>
</view>
<view class="bottom flex-lr">
<view class="content flex-cc">
<image src="https://xt04.colorcun.com/NewRecharge/order/9.png" mode="" />
<view class="texts">
订单实时提醒
</view>
<view class="texts1">
及时接收服务信息
</view>
<view class="texts1">
方便快捷
</view>
</view>
<view class="content flex-cc">
<image src="https://xt04.colorcun.com/NewRecharge/order/9.png" mode="" />
<view class="texts">
订单实时提醒
</view>
<view class="texts1">
及时接收服务信息
</view>
<view class="texts1">
方便快捷
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/me/wananchi.wxss */
page {
background-color: #42A5FF;
height: 100%;
}
.box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 44rpx;
}
.title {
color: #f8f9fd;
font-family: PingFang SC;
font-size: 66rpx;
line-height: 52rpx;
padding: 140rpx 0 116rpx 0;
}
.qrcode {
width: 320rpx;
height: 320rpx;
border-radius: 18rpx;
}
.info {
color: #f8f9fd;
font-family: PingFang SC;
font-size: 26rpx;
line-height: 53rpx;
padding: 30rpx 0 90rpx 0;
}
.text1 {
color: #f8f9fd;
font-family: PingFang SC;
font-size: 26rpx;
line-height: 52rpx;
}
.bottom {
padding: 0 100rpx;
}
.text1 text {
font-weight: 600;
font-size: 34rpx
}
.content {
flex-direction: column;
}
.bottom image {
width: 132rpx;
height: 132rpx;
margin-bottom: 60rpx;
}
.left {
flex-direction: column;
}
.texts {
color: #f8f9fd;
font-family: PingFang SC;
font-weight: 600;
font-size: 30rpx;
line-height: 52rpx;
}
.texts1 {
color: #f8f9fd;
font-family: PingFang SC;
font-size: 26rpx;
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@ Page({
* 页面的初始数据
*/
data: {
types:'',
qnConf:{
accessKey:'uva-aaonM8dukeR6phc9yuPBrOXk9brrNW_PxLD7',
secretKey:'oZMMVN6phk49lG0J1xwmi1Ju0ETT15EnAEWcU9Cs',
... ... @@ -55,7 +56,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options',{...options});
this.options=options
this.data.types=options.options?options.types:'1';
this.initPage()
},
async initPage(){
... ... @@ -199,7 +202,7 @@ Page({
enclosure:JSON.stringify(enclosure),
identity:1,
text:this.text||'',
types:1,
types:this.data.types,
grade:this.statVal,
isnoshow:this.data.isnoshow
}
... ...
... ... @@ -660,4 +660,14 @@ export default {
'App.Activity.GetNewRechargeListByOpenid':{
openid:'openid'
},
// 获取订单中券详情
'App.Activity.GetOrderRechargeByid':{
openid:'openid'
},
// 申请优惠券退款
'App.PayOnline.RechargeRefundApply':{
openid:'openid'
},
}
\ No newline at end of file
... ...
... ... @@ -155,9 +155,10 @@
"scene": "1001"
},
{
"name": "pack-cookbook/pages/index",
"name": "提前点餐",
"pathName": "pack-cookbook/pages/index",
"query": "rid=18599&oid=273&identity=1&sid=154",
"query": "rid=322708&oid=1879&identity=1&sid=4352",
"launchMode": "default",
"scene": 1001
},
{
... ... @@ -585,6 +586,41 @@
"pathName": "pages/reserve/detail",
"query": "id=1297",
"scene": null
},
{
"name": "充值",
"pathName": "pack-activity/pack/vipRecharge",
"query": "id=254&name=14号酒庄天幕山总部",
"launchMode": "default",
"scene": null
},
{
"name": "新邀请函",
"pathName": "pages/customer/detail_owner_invitation_new",
"query": "id=329755&hasInvitation=1&hasSellerShare=1&tplid=1",
"launchMode": "default",
"scene": null
},
{
"name": "新提前点餐",
"pathName": "pack-cookbook/pages/index_new",
"query": "rid=322708&oid=1879&identity=1&sid=4352",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pack-activity/pack/examineCertificate",
"query": "id=9",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/me/coupon_news",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
... ...