Commit f606d418 authored by jiangjiantao's avatar jiangjiantao

merge fixd

parents d264d2d8 4f572433
...@@ -39,3 +39,22 @@ export const ACTION_CONVERT_COUPON = "ACTION_CONVERT_COUPON"; ...@@ -39,3 +39,22 @@ export const ACTION_CONVERT_COUPON = "ACTION_CONVERT_COUPON";
//前屏登录完成 //前屏登录完成
export const ACTION_LOGIN_OK = "ACTION_LOGIN_OK"; export const ACTION_LOGIN_OK = "ACTION_LOGIN_OK";
//退款操作
export const ACTION_REFUND = "ACTION_REFUND";
//退款成功
export const ACTION_REFUND_SUCCESS = "ACTION_REFUND_SUCCESS";
//退款失败
export const ACTION_REFUND_FAILED = "ACTION_REFUND_FAILED";
const FLOW_IDLE = "idle";
const FLOW_COLLECTIONS = "collections";
const FLOW_REFUND = "refund";
export {
FLOW_IDLE,FLOW_COLLECTIONS,FLOW_REFUND
}
...@@ -29,6 +29,8 @@ Component({ ...@@ -29,6 +29,8 @@ Component({
scenes: nextProps.scene, scenes: nextProps.scene,
}); });
console.log("scenes:"+this.data.scenes);
}, },
methods: { methods: {
......
...@@ -753,4 +753,102 @@ ...@@ -753,4 +753,102 @@
color:rgba(91,105,129,1); color:rgba(91,105,129,1);
line-height:22rpx; line-height:22rpx;
margin-top: 15rpx margin-top: 15rpx
} }
\ No newline at end of file /* 操作结果页面 */
.operateTopView{
position: relative;
width: 750rpx;
height: 60rpx;
background: rgba(255, 255, 255, 1);
/* border: 2px solid red; */
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
}
.operateBodyView{
position: relative;
display: flex;
flex-direction: column;
align-items: center;
width: 750rpx;
height: 364rpx;
background: #ffffff;
}
.operateResultIcon{
position: relative;
width: 84rpx;
height: 84rpx;
margin-top: 35rpx;
}
.operateResultText{
font-size:26rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(0,122,255,1);
line-height:26rpx;
margin-top: 23rpx;
}
.operateResultDesc{
font-size:21rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(91,105,129,1);
line-height:21rpx;
margin-top: 19rpx;
}
.operateResultBtnContainer{
width: auto;
height: auto;
display: flex;
flex-direction: row;
margin-top: 54rpx;
}
.operateResultConfirmBtn{
width:246rpx;
height:59rpx;
background:rgba(0,122,255,1);
border-radius:5rpx;
border:1rpx solid rgba(151,151,151,1);
flex-direction: row;
display: flex;
align-items: center;
}
.operateResultConfirmBtnText{
font-size:23rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(255,255,255,1);
line-height:33rpx;
text-align: center;
width: 100%;
height: auto;
}
.operateResultCloseBtn{
width:246rpx;
height:59rpx;
background:rgba(255,255,255,1);
border-radius:5rpx;
border:1rpx solid rgba(0,122,255,1);
flex-direction: row;
display: flex;
margin-right:35rpx;
align-items: center;
}
.operateResultCloseBtnText{
font-size:23rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(0,122,255,1);
line-height:33rpx;
text-align: center;
width: 100%;
height: auto;
}
...@@ -290,4 +290,38 @@ ...@@ -290,4 +290,38 @@
<view class="login-waiting-right"> <view class="login-waiting-right">
<image class="login-waiting-right-image" mode="aspectFit" src="/images/login_waiting_right.png"/> <image class="login-waiting-right-image" mode="aspectFit" src="/images/login_waiting_right.png"/>
</view> </view>
<!-- 操作结果页 -->
<view hidden="{{!pageShow['operateResult']}}">
<view class="operateTopView"></view>
<view class="operateBodyView">
<block a:if="{{operateSuccess}}">
<image class="operateResultIcon" mode="aspectFit" src="/images/icon_success.png"/>
<view class="operateResultText">{{operateSuccessRemind}}</view>
<view class="operateResultDesc">{{operateSuccessDesc}}</view>
<view class="operateResultBtnContainer">
<view class="operateResultConfirmBtn">
<view class="operateResultConfirmBtnText">确定</view>
</view>
</view>
</block>
<block a:else>
<image class="operateResultIcon" mode="aspectFit" src="/images/icon_failed.png"/>
<view class="operateResultText">{{operateFailedRemind}}</view>
<view class="operateResultDesc">{{operateFailedDesc}}</view>
<view class="operateResultBtnContainer">
<view class="operateResultCloseBtn">
<view class="operateResultCloseBtnText">关闭</view>
</view>
<view class="operateResultConfirmBtn">
<view class="operateResultConfirmBtnText">重新退款</view>
</view>
</view>
</block>
</view>
</view>
</view> </view>
\ No newline at end of file
...@@ -13,8 +13,11 @@ import { ACTION_GET_ACCOUNT } from '../../const/actioncmd' ...@@ -13,8 +13,11 @@ import { ACTION_GET_ACCOUNT } from '../../const/actioncmd'
import { ACTION_DIRECT_PAYMENT } from '../../const/actioncmd' import { ACTION_DIRECT_PAYMENT } from '../../const/actioncmd'
import { ACTION_CONVERT_COUPON } from '../../const/actioncmd' import { ACTION_CONVERT_COUPON } from '../../const/actioncmd'
import { ACTION_LOGIN_OK } from '../../const/actioncmd' import { ACTION_LOGIN_OK } from '../../const/actioncmd'
import { ACTION_REFUND } from '../../const/actioncmd'
import { ACTION_REFUND_SUCCESS } from '../../const/actioncmd'
import { ACTION_REFUND_FAILED } from '../../const/actioncmd'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND} from '../../const/actioncmd'
Page({ Page({
data: { data: {
//页面控制相关参数 //页面控制相关参数
...@@ -22,10 +25,12 @@ Page({ ...@@ -22,10 +25,12 @@ Page({
"home": true, "home": true,
"landscan": false, "landscan": false,
"waitoperate": false, "waitoperate": false,
"payresult": false "payresult": false,
"operateResult":false
}, },
// 前屏是否完成登录 // 前屏是否完成登录
isFrontScreenLoginOK:false, isFrontScreenLoginOK:false,
flowType:"", //流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
storeName: "--", storeName: "--",
/**支付结果页相关参数 */ /**支付结果页相关参数 */
payFailedReason: "xxxxxxxxxxx", payFailedReason: "xxxxxxxxxxx",
...@@ -55,7 +60,12 @@ Page({ ...@@ -55,7 +60,12 @@ Page({
//折扣 //折扣
totalDisc: 0.00, totalDisc: 0.00,
goods: [ goods: [
] ],
operateSuccess:false,
operateSuccessRemind:"退款成功",
operateSuccessDesc:"退款完成!会在1~2个工作日返还到付款账户",
operateFailedRemind:"退款失败",
operateFailedDesc:"核销失败!无效的订单码",
}, },
/**跳转页面方法 */ /**跳转页面方法 */
...@@ -64,7 +74,8 @@ Page({ ...@@ -64,7 +74,8 @@ Page({
"home": false, "home": false,
"landscan": false, "landscan": false,
"waitoperate": false, "waitoperate": false,
"payresult": false "payresult": false,
"operateResult":false,
}; };
//遍历pageShow //遍历pageShow
for (var key in pageShowTemp) { for (var key in pageShowTemp) {
...@@ -124,6 +135,9 @@ Page({ ...@@ -124,6 +135,9 @@ Page({
}); });
//跳首页 //跳首页
context.goPage('home'); context.goPage('home');
setData({
flowType: FLOW_IDLE,
})
} else if (res.action == ACTION_GOODS) { } else if (res.action == ACTION_GOODS) {
//商品信息同步 //商品信息同步
my.hideLoading(); my.hideLoading();
...@@ -179,6 +193,15 @@ Page({ ...@@ -179,6 +193,15 @@ Page({
}else if(res.action == ACTION_LOGIN_OK){ }else if(res.action == ACTION_LOGIN_OK){
//前屏登录完成 //前屏登录完成
context.setData({isFrontScreenLoginOK:true}) context.setData({isFrontScreenLoginOK:true})
} else if(res.action == ACTION_REFUND_SUCCESS){
//跳转到成功页面
context.goPage('operateResult');
} else if(res.action == ACTION_REFUND_FAILED) {
context.setData({
isPaySuccess: false,
});
context.goPage('operateResult');
} }
} }
...@@ -254,7 +277,11 @@ Page({ ...@@ -254,7 +277,11 @@ Page({
* 退款 * 退款
*/ */
onHomeRefundClicked() { onHomeRefundClicked() {
this.setData({
flowType :FLOW_REFUND,
scene:4
})
console.log("scene:"+this.data.scene)
}, },
/** /**
...@@ -350,9 +377,11 @@ Page({ ...@@ -350,9 +377,11 @@ Page({
target: getApp().globalData.frontScreenAppId, target: getApp().globalData.frontScreenAppId,
data: commonRequest, data: commonRequest,
success: (res) => { success: (res) => {
flowType = FLOW_COLLECTIONS;
console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res)); console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res));
}, },
fail: (res) => { fail: (res) => {
flowType = FLOW_IDLE;
console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res)); console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
//发送失败重试 //发送失败重试
// context.sendGoToCollections(); // context.sendGoToCollections();
...@@ -388,7 +417,6 @@ Page({ ...@@ -388,7 +417,6 @@ Page({
}); });
}, },
/**landscan页面逻辑方法 */ /**landscan页面逻辑方法 */
//把所有的商品数据发送到后屏 //把所有的商品数据发送到后屏
sendGoodInfoToFront() { sendGoodInfoToFront() {
...@@ -418,7 +446,10 @@ Page({ ...@@ -418,7 +446,10 @@ Page({
this.sendPaymentToFront(result) this.sendPaymentToFront(result)
}else if(this.data.scene == 1){ }else if(this.data.scene == 1){
this.sendGoodsInfoToFront(result) this.sendGoodsInfoToFront(result)
} }else if(this.data.scene ==4){
this.sendRefund(result);
return;
}
this.onKeyBordClose(); this.onKeyBordClose();
}, },
...@@ -622,5 +653,32 @@ Page({ ...@@ -622,5 +653,32 @@ Page({
//使用券 //使用券
useCoupon(e) { useCoupon(e) {
this.setData({ couponUseing: true }) this.setData({ couponUseing: true })
},
//发送退款金额.以分为单位
sendRefund(amount){
var miyapay = require("/utils/miyapay4.js");
var refundAmount = miyapay.yuan2Fen(amount);
console.log("amount"+refundAmount);
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data:{
action: ACTION_REFUND,
data: refundAmount
},
success:(res)=>{
//成功发送则
console.log("发送退款金额到前屏小程序成功 ===》" + JSON.stringify(res));
},
fail:(res)=>{
my.showToast({
type: 'fail',
content: '发送退款金额到前屏失败',
duration: 3000,
success: () => {
},
});
}
})
} }
}); });
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