Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
mp
user
Commits
9e619c8a
Commit
9e619c8a
authored
Jul 02, 2022
by
weijiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://140.143.224.240:8100/hooloo/mp/user
parents
bf0c9590
3ed5ea22
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
66 deletions
+133
-66
components/AreaPicker/index.vue
+102
-0
components/OrderQrCode/index.vue
+1
-1
menuSubPackage/pages/areaSelect/areaSelect.vue
+11
-1
orderSubPackage/pages/orderInfo/index.vue
+11
-4
pages/menu/menu.vue
+8
-60
No files found.
components/AreaPicker/index.vue
0 → 100644
View file @
9e619c8a
<
template
>
<view>
<u-picker
@
cancel=
"show = false"
:show=
"show"
:immediateChange=
"true"
ref=
"uPicker"
:columns=
"columns"
@
confirm=
"confirm"
keyName=
"name"
@
change=
"changeHandler"
></u-picker>
</view>
</
template
>
<
script
>
import
Order
from
'@/request/order'
import
User
from
'@/request/user'
export
default
{
data
(){
return
{
show
:
false
,
columns
:
[],
cityInfo
:[]
}
},
props
:{
noSwitch
:{
type
:
Boolean
,
default
(){
return
false
}
}
},
methods
:{
showArea
()
{
uni
.
getSetting
({
success
:
(
res
)
=>
{
// 已经授权位置不获取默认店铺
if
(
res
.
authSetting
[
'scope.userLocation'
])
{
User
.
getLocation
((
state
,
params
)
=>
{
console
.
log
(
"showArea, state:"
+
state
+
", params:"
+
JSON
.
stringify
(
params
));
this
.
showAreaDialog
(
params
);
});
}
else
{
console
.
log
(
"showArea no location"
);
this
.
showAreaDialog
();
}
}
})
},
showAreaDialog
(
params
)
{
Order
.
getShop
(
params
).
then
(
res
=>
{
const
data
=
res
.
data
.
data
;
const
two
=
data
[
0
].
children
;
const
three
=
two
[
0
].
children
;
this
.
columns
=
[[...
data
],
[...
two
],
[...
three
]];
this
.
show
=
true
;
})
},
confirm
(
res
)
{
const
{
value
}
=
res
;
console
.
log
(
value
)
const
areaName
=
{
proviceName
:
value
[
0
]
&&
value
[
0
].
name
,
cityName
:
value
[
1
]
&&
value
[
1
].
name
,
disName
:
value
[
2
]
&&
value
[
2
].
name
}
const
shops
=
value
[
2
].
shops
;
this
.
show
=
false
;
// console.log(shops);
uni
.
setStorageSync
(
'shops'
,
shops
);
uni
.
setStorageSync
(
'areaName'
,
areaName
);
if
(
this
.
noSwitch
){
this
.
$emit
(
'sendAreaInfo'
,{
shops
,
areaName
})
}
else
{
uni
.
navigateTo
({
url
:
'/menuSubPackage/pages/areaSelect/areaSelect'
})
}
},
changeHandler
(
e
)
{
const
{
columnIndex
,
index
,
picker
=
this
.
$refs
.
uPicker
}
=
e
if
(
columnIndex
===
0
){
this
.
cityInfo
=
this
.
columns
[
0
][
index
].
children
?
this
.
columns
[
0
][
index
].
children
:[]
picker
.
setColumnValues
(
1
,
this
.
cityInfo
)
picker
.
setColumnValues
(
2
,
this
.
cityInfo
[
0
].
children
?
this
.
cityInfo
[
0
].
children
:[])
}
if
(
columnIndex
===
1
){
picker
.
setColumnValues
(
2
,
this
.
cityInfo
[
index
].
children
?
this
.
cityInfo
[
index
].
children
:[])
}
},
}
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
components/OrderQrCode/index.vue
View file @
9e619c8a
...
@@ -87,7 +87,7 @@ export default {
...
@@ -87,7 +87,7 @@ export default {
end
(
e
)
{
end
(
e
)
{
this
.
clientYEnd
=
e
.
changedTouches
[
0
].
clientY
;
this
.
clientYEnd
=
e
.
changedTouches
[
0
].
clientY
;
const
val
=
parseInt
((
this
.
clientYStart
-
this
.
clientYEnd
))
const
val
=
parseInt
((
this
.
clientYStart
-
this
.
clientYEnd
))
if
(
val
<-
5
00
){
if
(
val
<-
3
00
){
this
.
close
()
this
.
close
()
}
}
},
},
...
...
menuSubPackage/pages/areaSelect/areaSelect.vue
View file @
9e619c8a
<
template
>
<
template
>
<view
ew
class=
"product-list"
>
<view
ew
class=
"product-list"
>
<view
class=
"provice_city"
>
<view
class=
"provice_city"
>
<view
class=
"text"
>
<view
class=
"text"
@
click=
"showArea"
>
<text>
{{
areaName
.
proviceName
}}
-
</text>
<text>
{{
areaName
.
proviceName
}}
-
</text>
<text
v-show=
"areaName.proviceName!=areaName.cityName"
>
{{
areaName
.
cityName
}}
-
</text>
<text
v-show=
"areaName.proviceName!=areaName.cityName"
>
{{
areaName
.
cityName
}}
-
</text>
<text>
{{
areaName
.
disName
}}
</text>
<text>
{{
areaName
.
disName
}}
</text>
...
@@ -29,13 +29,16 @@
...
@@ -29,13 +29,16 @@
<view
:style=
"
{'height':'34rpx'}" class="distance" v-show="item.distance
&&
item.distance!=-1">距离
{{
item
.
distance
}}
</view>
<view
:style=
"
{'height':'34rpx'}" class="distance" v-show="item.distance
&&
item.distance!=-1">距离
{{
item
.
distance
}}
</view>
</div>
</div>
</div>
</div>
<AreaPicker
ref=
"AreaPicker"
noSwitch
@
sendAreaInfo=
"updataAreaInfo"
/>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
$EventBus
}
from
'@/utils/EventBus'
;
import
{
$EventBus
}
from
'@/utils/EventBus'
;
import
AreaPicker
from
'@/components/AreaPicker/index.vue'
export
default
{
export
default
{
components
:
{
AreaPicker
},
data
()
{
data
()
{
return
{
return
{
show
:
true
,
show
:
true
,
...
@@ -57,6 +60,13 @@ export default {
...
@@ -57,6 +60,13 @@ export default {
uni
.
setStorage
({
key
:
'shopData'
,
data
:
item
});
uni
.
setStorage
({
key
:
'shopData'
,
data
:
item
});
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
$EventBus
.
$emit
(
'getMenuList'
,
item
);
$EventBus
.
$emit
(
'getMenuList'
,
item
);
},
updataAreaInfo
(
data
){
this
.
list
=
data
.
shops
this
.
areaName
=
data
.
areaName
},
showArea
(){
this
.
$refs
.
AreaPicker
.
showArea
()
}
}
},
},
}
}
...
...
orderSubPackage/pages/orderInfo/index.vue
View file @
9e619c8a
...
@@ -160,7 +160,8 @@ export default {
...
@@ -160,7 +160,8 @@ export default {
ewmImg
:
''
,
ewmImg
:
''
,
Utils
,
Utils
,
isBuild
:
true
,
isBuild
:
true
,
waitTime
:
0
waitTime
:
0
,
backFlag
:
false
}
}
},
},
methods
:
{
methods
:
{
...
@@ -170,15 +171,18 @@ export default {
...
@@ -170,15 +171,18 @@ export default {
return
rpx
*
(
wx
.
getSystemInfoSync
().
windowWidth
/
750
);
return
rpx
*
(
wx
.
getSystemInfoSync
().
windowWidth
/
750
);
},
},
goBack
(){
goBack
(){
if
(
!
this
.
backFlag
){
uni
.
switchTab
({
url
:
'/pages/order/order'
})
uni
.
switchTab
({
url
:
'/pages/order/order'
})
}
},
},
async
oneMoreOrder
(
item
)
{
async
oneMoreOrder
(
item
)
{
uni
.
removeStorageSync
(
'shopCarInfo'
);
uni
.
removeStorageSync
(
'shopCarInfo'
);
$EventBus
.
$emit
(
'updateCar'
);
$EventBus
.
$emit
(
'updateCar'
);
const
numObj
=
{}
const
numObj
=
{}
const
{
id
,
shopId
,
orderDetails
}
=
item
;
const
{
id
,
shopId
,
orderDetails
}
=
item
;
orderDetails
.
forEach
(
item
=>
{
const
newOrderDetail
=
[...
orderDetails
]
orderDetails
[
item
.
skuId
]
=
Number
(
item
.
num
)
newOrderDetail
.
forEach
(
item
=>
{
newOrderDetail
[
item
.
skuId
]
=
Number
(
item
.
num
)
})
})
const
{
data
}
=
await
Order
.
moreOrder
({
orderId
:
id
,
shopId
});
const
{
data
}
=
await
Order
.
moreOrder
({
orderId
:
id
,
shopId
});
if
(
!
data
||
!
data
.
data
){
if
(
!
data
||
!
data
.
data
){
...
@@ -188,7 +192,7 @@ export default {
...
@@ -188,7 +192,7 @@ export default {
let
list
=
new
Array
();
let
list
=
new
Array
();
data
.
data
.
forEach
(
item
=>
{
data
.
data
.
forEach
(
item
=>
{
const
skuId
=
item
.
skus
[
0
].
skuId
const
skuId
=
item
.
skus
[
0
].
skuId
const
nextData
=
{
...
item
,
skuId
,
num
:
orderDetails
[
skuId
],
flag
:
true
,
sku
:
item
.
skus
[
0
]
}
const
nextData
=
{
...
item
,
skuId
,
num
:
newOrderDetail
[
skuId
],
flag
:
true
,
sku
:
item
.
skus
[
0
]
}
if
(
nextData
.
sku
.
state
==
1
)
{
if
(
nextData
.
sku
.
state
==
1
)
{
list
.
push
(
nextData
);
list
.
push
(
nextData
);
}
}
...
@@ -200,6 +204,7 @@ export default {
...
@@ -200,6 +204,7 @@ export default {
list
.
forEach
(
nextData
=>
{
list
.
forEach
(
nextData
=>
{
Utils
.
getallNum
(
nextData
);
Utils
.
getallNum
(
nextData
);
})
})
this
.
backFlag
=
true
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
},
},
async
PayNow
()
{
async
PayNow
()
{
...
@@ -220,6 +225,7 @@ export default {
...
@@ -220,6 +225,7 @@ export default {
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
Order
.
orderRefund
({
orderId
:
this
.
orderInfo
.
id
,
refundAmount
:
this
.
orderInfo
.
amount
}).
then
(
res
=>
{
Order
.
orderRefund
({
orderId
:
this
.
orderInfo
.
id
,
refundAmount
:
this
.
orderInfo
.
amount
}).
then
(
res
=>
{
this
.
backFlag
=
true
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
})
})
}
else
if
(
res
.
cancel
)
{
}
else
if
(
res
.
cancel
)
{
...
@@ -234,6 +240,7 @@ export default {
...
@@ -234,6 +240,7 @@ export default {
},
},
cancelOrder
()
{
cancelOrder
()
{
Order
.
cancelOrder
({
orderId
:
this
.
orderInfo
.
id
}).
then
(
res
=>
{
Order
.
cancelOrder
({
orderId
:
this
.
orderInfo
.
id
}).
then
(
res
=>
{
this
.
backFlag
=
true
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
})
})
},
},
...
...
pages/menu/menu.vue
View file @
9e619c8a
...
@@ -47,8 +47,9 @@
...
@@ -47,8 +47,9 @@
</view>
</view>
</view>
</view>
<MenuAssembly
ref=
"MenuAssembly"
@
getallNum=
"getallNum"
:buied=
"buied"
/>
<MenuAssembly
ref=
"MenuAssembly"
@
getallNum=
"getallNum"
:buied=
"buied"
/>
<u-picker
@
cancel=
"show = false"
:show=
"show"
:immediateChange=
"true"
ref=
"uPicker"
:columns=
"columns"
<!--
<u-picker
@
cancel=
"show = false"
:show=
"show"
:immediateChange=
"true"
ref=
"uPicker"
:columns=
"columns"
@
confirm=
"confirm"
keyName=
"name"
@
change=
"changeHandler"
></u-picker>
@
confirm=
"confirm"
keyName=
"name"
@
change=
"changeHandler"
></u-picker>
-->
<AreaPicker
ref=
"AreaPicker"
/>
<OrderQrCode
ref=
"OrderQrCode"
/>
<OrderQrCode
ref=
"OrderQrCode"
/>
<canvas
class=
"canvas-code"
canvas-id=
"myQrcode2"
<canvas
class=
"canvas-code"
canvas-id=
"myQrcode2"
style=
"background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;"
/>
style=
"background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;"
/>
...
@@ -59,6 +60,7 @@
...
@@ -59,6 +60,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
MenuAssembly
from
'@/components/menuAssembly'
import
MenuAssembly
from
'@/components/menuAssembly'
import
AreaPicker
from
'@/components/AreaPicker/index.vue'
import
User
from
'@/request/user'
import
User
from
'@/request/user'
import
ShopCar
from
'../../components/shopCar/shopCar.vue'
import
ShopCar
from
'../../components/shopCar/shopCar.vue'
import
Utils
from
'@/utils/utils'
import
Utils
from
'@/utils/utils'
...
@@ -69,7 +71,7 @@ import Order from '@/request/order'
...
@@ -69,7 +71,7 @@ import Order from '@/request/order'
import
OrderQrCode
from
'@/components/OrderQrCode'
import
OrderQrCode
from
'@/components/OrderQrCode'
import
QRCode
from
'@/utils/qrCode'
import
QRCode
from
'@/utils/qrCode'
export
default
{
export
default
{
components
:
{
ShopCar
,
MenuAssembly
,
OrderQrCode
},
components
:
{
ShopCar
,
MenuAssembly
,
OrderQrCode
,
AreaPicker
},
data
()
{
data
()
{
return
{
return
{
shopInfo
:
{
name
:
'请选择'
},
// 店铺信息
shopInfo
:
{
name
:
'请选择'
},
// 店铺信息
...
@@ -77,10 +79,7 @@ export default {
...
@@ -77,10 +79,7 @@ export default {
orderInfo
:
{},
//即将取餐的订单信息
orderInfo
:
{},
//即将取餐的订单信息
classifyData
:
[],
classifyData
:
[],
customerName
:
''
,
customerName
:
''
,
show
:
false
,
loginInfo
:
""
columns
:
[],
loginInfo
:
""
,
cityInfo
:[]
};
};
},
},
computed
:
{
computed
:
{
...
@@ -171,59 +170,8 @@ export default {
...
@@ -171,59 +170,8 @@ export default {
})
})
},
},
showArea
()
{
showArea
()
{
uni
.
getSetting
({
console
.
log
(
this
.
$refs
)
success
:
(
res
)
=>
{
this
.
$refs
.
AreaPicker
.
showArea
()
// 已经授权位置不获取默认店铺
if
(
res
.
authSetting
[
'scope.userLocation'
])
{
User
.
getLocation
((
state
,
params
)
=>
{
console
.
log
(
"showArea, state:"
+
state
+
", params:"
+
JSON
.
stringify
(
params
));
this
.
showAreaDialog
(
params
);
});
}
else
{
console
.
log
(
"showArea no location"
);
this
.
showAreaDialog
();
}
}
})
},
showAreaDialog
(
params
)
{
Order
.
getShop
(
params
).
then
(
res
=>
{
const
data
=
res
.
data
.
data
;
const
two
=
data
[
0
].
children
;
const
three
=
two
[
0
].
children
;
this
.
columns
=
[[...
data
],
[...
two
],
[...
three
]];
this
.
show
=
true
;
})
},
changeHandler
(
e
)
{
const
{
columnIndex
,
index
,
picker
=
this
.
$refs
.
uPicker
}
=
e
if
(
columnIndex
===
0
){
this
.
cityInfo
=
this
.
columns
[
0
][
index
].
children
?
this
.
columns
[
0
][
index
].
children
:[]
picker
.
setColumnValues
(
1
,
this
.
cityInfo
)
picker
.
setColumnValues
(
2
,
this
.
cityInfo
[
0
].
children
?
this
.
cityInfo
[
0
].
children
:[])
}
if
(
columnIndex
===
1
){
picker
.
setColumnValues
(
2
,
this
.
cityInfo
[
index
].
children
?
this
.
cityInfo
[
index
].
children
:[])
}
},
confirm
(
res
)
{
const
{
value
}
=
res
;
console
.
log
(
value
)
const
areaName
=
{
proviceName
:
value
[
0
]
&&
value
[
0
].
name
,
cityName
:
value
[
1
]
&&
value
[
1
].
name
,
disName
:
value
[
2
]
&&
value
[
2
].
name
}
const
shops
=
value
[
2
].
shops
;
this
.
show
=
false
;
// console.log(shops);
uni
.
setStorageSync
(
'shops'
,
shops
);
uni
.
setStorageSync
(
'areaName'
,
areaName
);
uni
.
navigateTo
({
url
:
'/menuSubPackage/pages/areaSelect/areaSelect'
})
},
},
// 手机号授权登录
// 手机号授权登录
getPhoneNumber
(
e
)
{
getPhoneNumber
(
e
)
{
...
...
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