|
@@ -6,7 +6,7 @@ import starOff from '@/assets/icons/GuideCheck/starOff.png'
|
6
|
6
|
import formatTime from '@/utils/formatTime'
|
7
|
7
|
import food from '@/assets/icons/ProCard/food.png'
|
8
|
8
|
import Popup from '@/components/Popup'
|
9
|
|
-import {saveEvaluate} from '@/services/mine'
|
|
9
|
+import { saveEvaluate } from '@/services/mine'
|
10
|
10
|
import './style.less'
|
11
|
11
|
|
12
|
12
|
|
|
@@ -16,49 +16,50 @@ import './style.less'
|
16
|
16
|
|
17
|
17
|
export default (props) => {
|
18
|
18
|
const { showCutover, maskClosable, item, onClose } = props
|
19
|
|
-
|
20
|
|
-
|
21
|
19
|
const scoreList = new Array(5).fill(0)
|
|
20
|
+
|
22
|
21
|
const ButtonCancel = () => {
|
23
|
22
|
onClose()
|
24
|
23
|
}
|
25
|
24
|
const ButtonOK = (e) => {
|
26
|
|
- if (evaluate.sweetScore==0||evaluate.environmentScore==0||evaluate.serviceScore==0) {
|
|
25
|
+ if (evaluate.sweetScore == 0 || evaluate.environmentScore == 0 || evaluate.serviceScore == 0) {
|
27
|
26
|
Taro.showToast({
|
28
|
27
|
title: '请您给本店点亮小星星哦',
|
29
|
28
|
icon: 'none'
|
30
|
29
|
})
|
31
|
30
|
return;
|
32
|
31
|
}
|
33
|
|
- else{
|
34
|
|
- saveEvaluate(evaluate.targetType,evaluate.targetId,evaluate).then((res)=>{
|
|
32
|
+ else {
|
|
33
|
+ saveEvaluate(evaluate.targetType, evaluate.targetId, evaluate).then((res) => {
|
35
|
34
|
console.log(res)
|
36
|
|
- })
|
|
35
|
+ })
|
37
|
36
|
onClose()
|
38
|
37
|
}
|
39
|
38
|
}
|
40
|
|
- const [evaluate,setEvaluate]=useState({
|
41
|
|
- sweetScore:0,//口味
|
42
|
|
- environmentScore:0,//环境
|
43
|
|
- serviceScore:0,//服务
|
44
|
|
- targetId:'',
|
45
|
|
- targetType:'shop'
|
|
39
|
+ const [evaluate, setEvaluate] = useState({
|
|
40
|
+ sweetScore: 0,//口味
|
|
41
|
+ environmentScore: 0,//环境
|
|
42
|
+ serviceScore: 0,//服务
|
|
43
|
+ targetId: '',
|
|
44
|
+ targetType: 'shop'
|
46
|
45
|
})
|
47
|
46
|
const [kwCollectNub, setkwCollectNub] = useState(0)
|
48
|
47
|
const kwChange = (val) => {
|
49
|
|
- setkwCollectNub(val+1)
|
50
|
|
- setEvaluate({...evaluate,sweetScore:val+1,targetId:item.shopId})
|
|
48
|
+ setkwCollectNub(val + 1)
|
|
49
|
+ setEvaluate({ ...evaluate, sweetScore: val + 1, targetId: item.shopId })
|
51
|
50
|
}
|
|
51
|
+
|
52
|
52
|
const [hjCollectNub, sethjCollectNub] = useState(0)
|
53
|
53
|
const hjChange = (val) => {
|
54
|
|
- sethjCollectNub(val+1)
|
55
|
|
- setEvaluate({...evaluate,serviceScore:val+1})
|
|
54
|
+ sethjCollectNub(val + 1)
|
|
55
|
+ setEvaluate({ ...evaluate, serviceScore: val + 1 })
|
56
|
56
|
|
57
|
57
|
}
|
|
58
|
+
|
58
|
59
|
const [fwCollectNub, setfwCollectNub] = useState(0)
|
59
|
60
|
const fwChange = (val) => {
|
60
|
|
- setfwCollectNub(val+1)
|
61
|
|
- setEvaluate({...evaluate,environmentScore:val+1})
|
|
61
|
+ setfwCollectNub(val + 1)
|
|
62
|
+ setEvaluate({ ...evaluate, environmentScore: val + 1 })
|
62
|
63
|
}
|
63
|
64
|
|
64
|
65
|
return (
|
|
@@ -99,9 +100,9 @@ export default (props) => {
|
99
|
100
|
{
|
100
|
101
|
scoreList.map((_, index) => {
|
101
|
102
|
|
102
|
|
- const src = index < kwCollectNub ? starOn : starOff
|
|
103
|
+ const src = index < kwCollectNub ? starOn : starOff
|
103
|
104
|
return (
|
104
|
|
- <image className='card-star-image' key={index} src={src} onClick={()=>kwChange(index)} />
|
|
105
|
+ <image className='card-star-image' key={index} src={src} onClick={() => kwChange(index)} />
|
105
|
106
|
)
|
106
|
107
|
})
|
107
|
108
|
}
|
|
@@ -111,9 +112,9 @@ export default (props) => {
|
111
|
112
|
{
|
112
|
113
|
scoreList.map((_, index) => {
|
113
|
114
|
|
114
|
|
- const src = index < hjCollectNub ? starOn : starOff
|
|
115
|
+ const src = index < hjCollectNub ? starOn : starOff
|
115
|
116
|
return (
|
116
|
|
- <image className='card-star-image' key={index} src={src} onClick={()=>hjChange(index)} />
|
|
117
|
+ <image className='card-star-image' key={index} src={src} onClick={() => hjChange(index)} />
|
117
|
118
|
)
|
118
|
119
|
})
|
119
|
120
|
}
|
|
@@ -123,9 +124,9 @@ export default (props) => {
|
123
|
124
|
{
|
124
|
125
|
scoreList.map((_, index) => {
|
125
|
126
|
|
126
|
|
- const src = index < fwCollectNub ? starOn : starOff
|
|
127
|
+ const src = index < fwCollectNub ? starOn : starOff
|
127
|
128
|
return (
|
128
|
|
- <image className='card-star-image' key={index} src={src} onClick={()=>fwChange(index)} />
|
|
129
|
+ <image className='card-star-image' key={index} src={src} onClick={() => fwChange(index)} />
|
129
|
130
|
)
|
130
|
131
|
})
|
131
|
132
|
}
|