Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
815d08be
authored
Sep 21, 2020
by
zqm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
MM - 订单评价
parent
451e5518
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
180 additions
and
74 deletions
pages/mine/order/order.js
pages/pay/order-comment/order-comment.js
pages/pay/order-comment/order-comment.wxml
pages/pay/order-comment/order-comment.wxss
pages/pay/order-detail/order-detail.js
pages/pay/order-detail/order-detail.wxml
pages/pay/order-detail/order-detail.wxss
pages/mine/order/order.js
View file @
815d08be
...
...
@@ -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
`
,
})
},
/**
...
...
pages/pay/order-comment/order-comment.js
View file @
815d08be
...
...
@@ -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
pages/pay/order-comment/order-comment.wxml
View file @
815d08be
...
...
@@ -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
pages/pay/order-comment/order-comment.wxss
View file @
815d08be
...
...
@@ -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;
...
...
pages/pay/order-detail/order-detail.js
View file @
815d08be
...
...
@@ -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
`
,
})
},
// 删除订单&取消订单
...
...
pages/pay/order-detail/order-detail.wxml
View file @
815d08be
<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>
...
...
pages/pay/order-detail/order-detail.wxss
View file @
815d08be
...
...
@@ -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,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment