Commit 99a2d65a by TengFengLian

LTF-券码核销权限

parent a4b6d590
...@@ -60,6 +60,7 @@ Page({ ...@@ -60,6 +60,7 @@ Page({
shopConfig: App.globalData.shopId, shopConfig: App.globalData.shopId,
isYearCard: true, isYearCard: true,
isMonthCard: false, isMonthCard: false,
authInfo: null,
}, },
// 跳转订单详情 // 跳转订单详情
onOrderDetail: function (event) { onOrderDetail: function (event) {
...@@ -97,7 +98,7 @@ Page({ ...@@ -97,7 +98,7 @@ Page({
// 去核销 // 去核销
goCouponInput(event) { goCouponInput(event) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/pay/coupon-input/coupon-input', url: '/pages/pay/coupon-input/coupon-input?authInfo=' + JSON.stringify(this.data.authInfo),
}) })
}, },
// 获取核销权限 // 获取核销权限
...@@ -113,7 +114,11 @@ Page({ ...@@ -113,7 +114,11 @@ Page({
console.log(res, '核销'); console.log(res, '核销');
let data = res.data let data = res.data
let isPer = false let isPer = false
if (data.length > 0) { let authInfo = {
officeName: data.officeName,
roleName: data.roleNames[0],
}
if (data.permissions.length > 0) {
//有核销权限 //有核销权限
isPer = true isPer = true
} else { } else {
...@@ -124,7 +129,8 @@ Page({ ...@@ -124,7 +129,8 @@ Page({
that.setData({ that.setData({
isCheckPermission: isPer isCheckPermission: isPer,
authInfo: authInfo
}) })
} }
}) })
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<view class="coupon row align-c" bindtap="goCouponInput" wx:if="{{isCheckPermission}}"> <view class="coupon row align-c" bindtap="goCouponInput" wx:if="{{isCheckPermission}}">
<view class="cpopon-info col"> <view class="cpopon-info col">
<text>券码核销</text> <text>券码核销</text>
<text>所属门店:拾光花坊</text> <text>所属门店:{{authInfo.officeName}}</text>
</view> </view>
<view class=""> <view class="">
<image src="{{imageBase + 'icon/arrow-r-2.png'}}"></image> <image src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
......
...@@ -117,7 +117,12 @@ Page({ ...@@ -117,7 +117,12 @@ Page({
volumeId: that.data.couponDetail.volumeId, volumeId: that.data.couponDetail.volumeId,
}, },
success: function (res) { success: function (res) {
if (res.data.code * 1 == 200) { if (res.data && res.data.code * 1 == 500) {
wx.lin.showToast({
image: '/image/error.png',
title: res.data.msg,
})
} else {
wx.lin.showToast({ wx.lin.showToast({
image: '/image/success.png', image: '/image/success.png',
title: '核销成功', title: '核销成功',
...@@ -125,11 +130,6 @@ Page({ ...@@ -125,11 +130,6 @@ Page({
setTimeout(() => { setTimeout(() => {
wx.navigateBack() wx.navigateBack()
}, 2000); }, 2000);
} else {
wx.lin.showToast({
image: '/image/error.png',
title: res.data.msg,
})
} }
}, },
......
...@@ -2,13 +2,24 @@ const App = getApp() ...@@ -2,13 +2,24 @@ const App = getApp()
Page({ Page({
data: { data: {
bgUrl: '/pages/mine/home/image/mine.png',
avatarUrl: '/pages/mine/home/image/avatar.png', avatarUrl: '/pages/mine/home/image/avatar.png',
name:'姓名',
idString: '前台核销',
shop: '艺术花坊',
showDialog: false, showDialog: false,
showDialogSmg: '非本店券码,无法使用', showDialogSmg: '非本店券码,无法使用',
couponCode: '', couponCode: '',
}, },
onLoad: function (options) { onLoad: function (options) {
let userInfo = wx.getStorageSync('userInfo')
let authInfo = JSON.parse(options.authInfo)
this.setData({
avatarUrl: userInfo.avatar ? userInfo.avatar : '/pages/mine/home/image/avatar.png',
name: userInfo.name,
idString: authInfo.roleName,
shop: authInfo.officeName,
})
}, },
handleWriteOff() { handleWriteOff() {
this.getVolumeDetails(this.data.couponCode) this.getVolumeDetails(this.data.couponCode)
......
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
<!-- 头像信息 --> <!-- 头像信息 -->
<view class="header col align-c"> <view class="header col align-c">
<view class="header-bg"> <view class="header-bg">
<image src=""></image> <image src="{{bgUrl}}"></image>
</view> </view>
<view class="header-avatar"> <view class="header-avatar">
<l-avatar size="160" src="{{avatarUrl}}"></l-avatar> <l-avatar size="160" src="{{avatarUrl}}"></l-avatar>
</view> </view>
<view class="header-info"> <view class="header-info">
<view class="info-name">文碧海</view> <view class="info-name">{{name}}</view>
<view class="info-text col con-b"> <view class="info-text col con-b">
<view class="row con-b"> <view class="row con-b">
<text class="info-left">工作身份</text> <text class="info-left">工作身份</text>
<text class="info-right">前台核销</text> <text class="info-right">{{idString}}</text>
</view> </view>
<view class="row con-b"> <view class="row con-b">
<text class="info-left">所属门店</text> <text class="info-left">所属门店</text>
<text class="info-right">艺术花坊</text> <text class="info-right">{{shop}}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
.header-info { .header-info {
position: absolute; position: absolute;
top: 472rpx; top: 472rpx;
width: 232rpx; /* width: 232rpx; */
height: 205rpx; height: 205rpx;
} }
.info-name { .info-name {
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
.info-right { .info-right {
color: #15191F; color: #15191F;
font-size: 26rpx; font-size: 26rpx;
margin-left: 10rpx;
} }
.coupon-input-wrapper { .coupon-input-wrapper {
width: 668rpx; width: 668rpx;
...@@ -83,9 +84,9 @@ ...@@ -83,9 +84,9 @@
min-width: 262rpx !important; min-width: 262rpx !important;
min-height: 262prx !important; min-height: 262prx !important;
} }
.toast-image { /* .toast-image {
} } */
.coupon-scan-wrapper { .coupon-scan-wrapper {
width: 668rpx; width: 668rpx;
......
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 sign in to comment