Commit bae6b957 by wjw

Merge branch 'master' of http://120.77.182.185/yanl/mini-shimao.git into master

parents 2d4977f3 815d08be
......@@ -60,6 +60,7 @@ Page({
shopConfig: App.globalData.shopId,
isYearCard: true,
isMonthCard: false,
authInfo: null,
goodTypeCountData: {}
},
goQuestion: function () {
......@@ -103,7 +104,7 @@ Page({
// 去核销
goCouponInput(event) {
wx.navigateTo({
url: '/pages/pay/coupon-input/coupon-input',
url: '/pages/pay/coupon-input/coupon-input?authInfo=' + JSON.stringify(this.data.authInfo),
})
},
// 获取核销权限
......@@ -119,7 +120,11 @@ Page({
console.log(res, '核销');
let data = res.data
let isPer = false
if (data.length > 0) {
let authInfo = {
officeName: data.officeName,
roleName: data.roleNames[0],
}
if (data.permissions.length > 0) {
//有核销权限
isPer = true
} else {
......@@ -130,7 +135,8 @@ Page({
that.setData({
isCheckPermission: isPer
isCheckPermission: isPer,
authInfo: authInfo
})
}
})
......
......@@ -63,7 +63,7 @@
<view class="coupon row align-c" bindtap="goCouponInput" wx:if="{{isCheckPermission}}">
<view class="cpopon-info col">
<text>券码核销</text>
<text>所属门店:拾光花坊</text>
<text>所属门店:{{authInfo.officeName}}</text>
</view>
<view class="">
<image src="{{imageBase + 'icon/arrow-r-2.png'}}"></image>
......
......@@ -40,7 +40,26 @@ Page({
this.setData({
option: options
})
console.log('onload-----------');
// App.login({
// timeout: 0,
// success: (result) => {
// this.setOrderType()
// },
// })
},
onShow: function () {
App.login({
timeout: 0,
success: (result) => {
this.setOrderType()
},
})
},
refresh: function () {
App.login({
timeout: 0,
success: (result) => {
......@@ -223,7 +242,11 @@ Page({
* @returns
*/
onToBuy: function (event) {
this.onOrderAgain(event)
let commodityType = this.data.orderType[this.data.orderTypeActive].value
let shopAppId = wx.getStorageSync('shopInfoBuffer') ? wx.getStorageSync('shopInfoBuffer').appId : ""
wx.navigateTo({
url: `/pages/commodity/menu-food/menu-food?formPage=order&shopAppId=${shopAppId}&commodityType=${commodityType}`,
})
},
/**
......@@ -464,11 +487,10 @@ Page({
* @returns
*/
onOrderEvaluate: function (event) {
console.log(event.currentTarget.dataset, '----------------event.currentTarget.dataset');
let item = JSON.stringify(event.currentTarget.dataset.item)
wx.navigateTo({
url: `/pages/pay/order-comment/order-comment?orderItem=${item}`,
url: `/pages/pay/order-comment/order-comment?orderItem=${item}&pageFrom=orderList`,
})
},
/**
......
......@@ -117,7 +117,12 @@ Page({
volumeId: that.data.couponDetail.volumeId,
},
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({
image: '/image/success.png',
title: '核销成功',
......@@ -125,11 +130,6 @@ Page({
setTimeout(() => {
wx.navigateBack()
}, 2000);
} else {
wx.lin.showToast({
image: '/image/error.png',
title: res.data.msg,
})
}
},
......
......@@ -2,13 +2,24 @@ const App = getApp()
Page({
data: {
bgUrl: '/pages/mine/home/image/mine.png',
avatarUrl: '/pages/mine/home/image/avatar.png',
name:'姓名',
idString: '前台核销',
shop: '艺术花坊',
showDialog: false,
showDialogSmg: '非本店券码,无法使用',
couponCode: '',
},
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() {
this.getVolumeDetails(this.data.couponCode)
......
......@@ -4,21 +4,21 @@
<!-- 头像信息 -->
<view class="header col align-c">
<view class="header-bg">
<image src=""></image>
<image src="{{bgUrl}}"></image>
</view>
<view class="header-avatar">
<l-avatar size="160" src="{{avatarUrl}}"></l-avatar>
</view>
<view class="header-info">
<view class="info-name">文碧海</view>
<view class="info-name">{{name}}</view>
<view class="info-text col con-b">
<view class="row con-b">
<text class="info-left">工作身份</text>
<text class="info-right">前台核销</text>
<text class="info-right">{{idString}}</text>
</view>
<view class="row con-b">
<text class="info-left">所属门店</text>
<text class="info-right">艺术花坊</text>
<text class="info-right">{{shop}}</text>
</view>
</view>
</view>
......
......@@ -12,7 +12,7 @@
.header-info {
position: absolute;
top: 472rpx;
width: 232rpx;
/* width: 232rpx; */
height: 205rpx;
}
.info-name {
......@@ -33,6 +33,7 @@
.info-right {
color: #15191F;
font-size: 26rpx;
margin-left: 10rpx;
}
.coupon-input-wrapper {
width: 668rpx;
......@@ -83,9 +84,9 @@
min-width: 262rpx !important;
min-height: 262prx !important;
}
.toast-image {
/* .toast-image {
}
} */
.coupon-scan-wrapper {
width: 668rpx;
......
......@@ -3,6 +3,7 @@ let App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
scoreServe: 0, // 服务分数
scoreServeText: '0.0',
scoreProduct: 0, // 产品分数
......@@ -17,12 +18,15 @@ Page({
amount: '',
commodity: []
},
fileResults: []
},
onLoad: function (options) {
console.log(options, '----------options------');
let orderItem = JSON.parse(options.orderItem)
let pageFrom = options.pageFrom
this.setData({
orderInfo: orderItem
orderInfo: orderItem,
pageFrom: pageFrom
})
},
......@@ -78,19 +82,52 @@ Page({
})
},
/**
* 预览评价图片
* @function
* @param
* @returns
*/
eventImagePreview: function (event) {
// console.log(event.detail)
console.log(9898);
// let imgUrl = event.detail.all[0].url
// let imgUrls = []
// imgUrls.push(imgUrl)
// this.setData({
// imgUrls
// })
},
/**
* 新增评价图片
* @function
* @param
* @returns
*/
eventImageAdd: function (event) {
console.log(event.detail.all[0])
console.log(event.detail, '新增------')
let that = this
let imgUrl = event.detail.all[0].url
let imgUrls = []
imgUrls.push(imgUrl)
this.setData({
imgUrls
})
wx.uploadFile({
url: App.globalData.baseUrl + '/api/v1/common/upload',
filePath: imgUrl,
name: 'file',
header: {
'Content-Type': 'multipart/form-data',
'token': App.globalData.token
},
success: function (res) {
let data = typeof (res.data) == 'string' ? JSON.parse(res.data) : res.data
that.data.fileResults.push(data.data.fileUrl)
}
})
},
/**
* 移除评价图片
......@@ -99,7 +136,8 @@ Page({
* @returns
*/
eventImageRemove: function (event) {
console.log(event.detail.all)
let index = event.detail.index
this.data.fileResults.splice(index, 1)
},
/**
* 提交订单
......@@ -108,55 +146,78 @@ Page({
* @returns
*/
onSubmitCommennt: function () {
console.log('submit')
let funcFile = this.data.imgUrls[0]
wx.uploadFile({
url: App.globalData.baseUrl + '/api/v1/common/upload',
filePath: funcFile,
name: 'file',
header: {
'Content-Type': 'multipart/form-data',
'token': App.globalData.token
let that = this;
if (this.data.scoreServeText == 0) {
wx.lin.showToast({
image: '/image/error.png',
title: '请对服务进行评价',
})
return
}
if (this.data.scoreProductText == 0) {
wx.lin.showToast({
image: '/image/error.png',
title: '请对产品进行评价',
})
return
}
if (this.data.scoreEnvironmentText == 0) {
wx.lin.showToast({
image: '/image/error.png',
title: '请对环境进行评价',
})
return
}
let formData = {}
formData.orderId = this.data.orderInfo.id
formData.imgUrls = this.data.fileResults
formData.serviceEvaluation = this.data.scoreServeText //服务评价
formData.productEvaluation = this.data.scoreProductText //产品评价
formData.environmentalEvaluation = this.data.scoreEnvironmentText //环境评价
formData.content = this.data.content
wx.showLoading({
title: '处理中',
})
App.wxRequest({
url: '/api/v1/order/doAppraise',
data: {
'orderId': formData.orderId,
'imgUrls': formData.imgUrls,
'serviceEvaluation': formData.serviceEvaluation,
'productEvaluation': formData.productEvaluation,
'environmentalEvaluation': formData.productEvaluation,
'content': formData.content
},
success: (res) => {
const data = JSON.parse(res.data)
let fileUrls = []
if (data.code === 200 && data.success === true) {
console.log(data.data.fileUrl)
fileUrls.push(data.data.fileUrl)
} else {
console.log('上传失败')
}
// this.setData({
// fileUrls
// })
let formData = {}
formData.orderId = this.data.orderInfo.id
formData.imgUrls = fileUrls,
formData.serviceEvaluation = this.data.scoreServeText
formData.productEvaluation = this.data.scoreProductText
formData.environmentalEvaluation = this.data.scoreEnvironmentText
formData.content = this.data.content
console.log(formData)
App.wxRequest({
url: '/api/v1/order/doAppraise',
data: {
'orderId': formData.orderId,
'imgUrls': formData.imgUrls,
'serviceEvaluation': formData.serviceEvaluation,
'productEvaluation': formData.productEvaluation,
'environmentalEvaluation': formData.productEvaluation,
'content': formData.content = this.data.content
},
success: (response) => {
console.log(response)
wx.navigateBack({
delta: 0,
})
}
success: (response) => {
wx.hideLoading({
success: (res) => {},
})
wx.lin.showToast({
image: '/image/success.png',
title: '评价成功',
})
setTimeout(() => {
// var pages = getCurrentPages();
// var beforePage = pages[pages.length - 2];
// beforePage.refresh();
let pageFrom = that.data.pageFrom
let url = ''
if (pageFrom == 'orderList') {
//评价列表
url = '/pages/mine/order/order'
} else if (pageFrom == 'orderDetail') {
//评价详情
url = '/pages/pay/order-detail/order-detail?id=' + that.data.orderInfo.id
} else {
url = '/pages/home/home/home'
}
wx.redirectTo({
url: url,
})
}, 2000);
}
})
}
})
\ No newline at end of file
......@@ -79,13 +79,16 @@
<text>{{scoreEnvironmentText + '星'}}</text>
</view>
</view>
<view class="order-comment">
<l-textarea placeholder="您的评价与建议,会让园区做的更好" placeholder-style="color: #C2C7CF" maxlength="200" l-class="l-textarea" border="{{false}}" bind:linblur="eventInputDone" />
<l-textarea cursor-spacing="100" placeholder="您的评价与建议,会让园区做的更好" placeholder-style="color: #C2C7CF" maxlength="200"
l-class="l-textarea" border="{{false}}" bind:linconfirm="eventInputDone" />
<view class="order-picker">
<l-image-picker l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed" custom="{{true}}" bind:linchange="eventImageAdd" bind:linremove="eventImageRemove">
<l-image-picker l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed"
custom="{{true}}" bind:linchange="eventImageAdd" bind:linremove="eventImageRemove"
bind:linpreview="eventImagePreview">
<view class="col con-c align-c">
<image class="icon-img"></image>
<image class="icon-img" src="{{resourcesBase+'mine/server/camera_icon.png'}}"></image>
<text>添加图片</text>
</view>
</l-image-picker>
......@@ -97,4 +100,6 @@
<text>提交评价</text>
</view>
</view>
</view>
\ No newline at end of file
</view>
<l-toast l-image-class="toast-image"></l-toast>
\ No newline at end of file
......@@ -131,7 +131,7 @@
.icon-img {
width: 48rpx;
height: 48rpx;
background-color: #ccc;
/* background-color: #ccc; */
}
.footer-wrapper {
position: fixed;
......@@ -142,7 +142,7 @@
padding: 30rpx 40rpx 0;
background-color: #fff;
border-top: 1px solid #E2E7EF;
z-index: 5;
z-index: 100;
}
.comment-btn {
width: 670rpx;
......
......@@ -82,7 +82,7 @@ Page({
onOrderEvaluate: function (event) {
let item = JSON.stringify(this.data.orderInfo)
wx.navigateTo({
url: `/pages/pay/order-comment/order-comment?orderItem=${item}`,
url: `/pages/pay/order-comment/order-comment?orderItem=${item}&pageFrom=orderDetail`,
})
},
// 删除订单&取消订单
......
<navigation class="navigation" titleText="订单详情" color="#000000" background="#FFFFFF" backIcon="/image/back.png"
bind:navBack="navBack"></navigation>
<view class="container">
<view class="container padding-bottom-166">
<!-- 订单状态 -->
<view class="state row con-c">
<view class="state-content col con-c" wx:if="{{orderInfo.state === 0}}">
......@@ -32,9 +32,9 @@
<view class="state-content-title row">
<text>订单已取消</text>
</view>
<view class="state-content-tip row">
<!-- <view class="state-content-tip row">
<text>下单后15分钟内未付款,自动取消订单</text>
</view>
</view> -->
</view>
<view class="state-content state-content-invalid col con-c" wx:if="{{orderInfo.state === 6}}">
......@@ -80,7 +80,8 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">{{orderInfo.contactPhone}}</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}">
</image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
......@@ -115,7 +116,8 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">{{orderInfo.contactPhone}}</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}">
</image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
......@@ -158,7 +160,8 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}">
</image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
......@@ -196,7 +199,8 @@
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"></image>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}">
</image>
</view>
<block wx:if="{{orderInfo.state===2}}">
<view class="info-line row con-b align-c">
......@@ -232,7 +236,7 @@
<view class="logo-box">
<image src="{{resourcesBase + orderInfo.shopInfo.logo}}" mode="aspectFit"></image>
</view>
<text>{{orderInfo.officeName}}</text>
</view>
<block wx:for="{{orderInfo.commodity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
......@@ -262,8 +266,9 @@
<!-- 订单提示 -->
<view class="tip">
<view class="tip-pay row con-b align-c">
<view class="tip-pay-title">
<text>实付金额</text>
<view class="tip-pay-title" wx:if="{{orderInfo.amount!==undefined}}">
<text wx:if="{{orderInfo.state === 0||orderInfo.state === -1}}">待付金额</text>
<text wx:else>实付金额</text>
</view>
<view class="tip-pay-amount">
<text>¥</text>
......@@ -291,7 +296,7 @@
<swiper class="code-main" next-margin="64rpx" bindchange="swiperChange">
<swiper-item wx:for="{{codeList}}" wx:key="id">
<view class="code-item col con-c align-c {{index === swiperCurrent ? 'item-center' : ''}}">
<view class="code-item-title">{{item.name}}</view>
<view class="code-item-title cord-title">{{item.name}}</view>
<view class="code-img">
<image mode="widthFix" src="{{'data:image/jpg;base64,'+item.qrcode}}"></image>
</view>
......
......@@ -546,6 +546,11 @@
color: #15191F;
font-size: 30rpx;
font-weight: 600;
}
.cord-title {
padding: 0 20rpx;
}
.code-img {
......@@ -791,9 +796,18 @@
line-height: 42rpx;
}
.padding-bottom-166 {
padding-bottom: 166rpx;
}
.footer-btn {
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
padding: 32rpx 20rpx;
border-top: 1px solid #E2E7EF;
}
.delete-btn,
......
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