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
007c5c32
Commit
007c5c32
authored
Feb 23, 2023
by
songbingqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成部分开发
parent
170cd1d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
19 deletions
+95
-19
components/OrderQrCode/index.vue
+21
-16
pages/menu/menu.vue
+35
-2
pages/mine/mine.vue
+17
-0
request/menu/index.js
+13
-0
store/modules/menu.js
+9
-1
No files found.
components/OrderQrCode/index.vue
View file @
007c5c32
...
...
@@ -33,7 +33,6 @@
<u-icon
name=
"close-circle"
color=
"#666666"
size=
"28"
:top=
"-3"
></u-icon>
</div>
<div
class=
"code"
>
取单码
{{
orderInfo
.
orderNum
}}
</div>
<!--
<image
mode=
"scaleToFill"
:src=
"qrCode"
class=
"qr_code"
></image>
-->
<div
class=
"qr_code_readly"
>
<image
mode=
"scaleToFill"
:src=
"orderInfo.pickCode"
class=
"qr"
></image>
</div>
...
...
@@ -84,7 +83,6 @@ export default {
return
{
orderInfo
:
{},
shopInfo
:{},
qrCode
:
''
,
show
:
false
,
clientYStart
:
0
,
clientYEnd
:
0
,
...
...
@@ -96,6 +94,16 @@ export default {
timer
:
''
}
},
watch
:{
'show'
:{
handler
(
val
)
{
console
.
log
(
val
,
'wywy'
)
if
(
!
val
)
{
this
.
cleanTimeout
()
}
}
}
},
computed
:
{
// 0 创建未校验
// 1 未支付
...
...
@@ -131,6 +139,9 @@ export default {
return
this
.
$store
.
getters
.
Authorization
;
},
},
onShow
()
{
console
.
log
(
'onShow'
)
},
async
mounted
()
{
// console.log(123,this.shopInfo)
// if (!this.userms) return;
...
...
@@ -147,8 +158,7 @@ export default {
// }
},
methods
:
{
async
getOrderInfo
(
shopInfo
)
{
console
.
log
(
1
)
async
getOrderInfo
(
shopInfo
,
timerout
=
true
)
{
if
(
shopInfo
)
this
.
shopInfo
=
shopInfo
if
(
!
this
.
userms
)
return
;
const
res
=
await
Order
.
getHomeOrder
({
shopId
:
this
.
shopInfo
.
id
});
...
...
@@ -157,10 +167,12 @@ export default {
// this.$set(data.data, 'state', '2');
// console.log("getHomeOrder:"+JSON.stringify(data.data));
this
.
buied
=
true
;
this
.
timer
=
setTimeout
(()
=>
{
this
.
getOrderInfo
()
clearTimeout
(
this
.
timer
)
},
5000
);
if
(
timerout
)
{
this
.
timer
=
setTimeout
(()
=>
{
this
.
getOrderInfo
()
clearTimeout
(
this
.
timer
)
},
2000
);
}
this
.
orderInfo
=
{...
data
.
data
};
}
else
{
clearTimeout
(
this
.
timer
)
...
...
@@ -202,14 +214,7 @@ export default {
open
(
data
,
path
)
{
this
.
popupStyle
.
transform
=
'translateY(0px)'
this
.
show
=
true
;
// this.orderInfo = data;
// console.log("order:"+JSON.stringify(this.orderInfo));
// if(this.showMask) {
// this.qrCode = '';
// } else {
this
.
qrCode
=
path
;
// }
this
.
getOrderInfo
()
},
jsonParse
(
json
)
{
return
JSON
.
parse
(
json
)
...
...
pages/menu/menu.vue
View file @
007c5c32
<
template
>
<view
class=
"menu-box"
>
<view
class=
"menu-banner"
:style=
"
{ height: buied ? '360rpx' : '450rpx' }">
<!--
<image
:src=
"img"
/>
-->
<u-swiper
v-if=
"swiperList.length!=0"
:list=
"swiperList"
:interval=
"5000"
circular
:height=
"200"
></u-swiper>
<ImageLoader
v-else
:defaultSrc=
"'../../static/imgs/shouyezhanweitu.png'"
:realSrc=
"img"
width=
"100%"
...
...
@@ -151,6 +160,11 @@ export default {
img
:
""
,
isInRange
:
true
,
dayTitle
:
""
,
list1
:
[
'https://cdn.uviewui.com/uview/swiper/swiper1.png'
,
'https://cdn.uviewui.com/uview/swiper/swiper2.png'
,
'https://cdn.uviewui.com/uview/swiper/swiper3.png'
,
]
};
},
computed
:
{
...
...
@@ -193,6 +207,9 @@ export default {
userInfo
()
{
return
this
.
$store
.
state
.
user
.
userInfo
;
},
swiperList
()
{
return
this
.
$store
.
state
.
menu
.
swiperList
.
home
;
}
},
created
()
{
let
platform
=
uni
.
getSystemInfoSync
().
platform
;
...
...
@@ -244,7 +261,7 @@ export default {
this
.
getShopMenus
(
params
);
});
}
else
{
//
this.getShopMenus();
this
.
getShopMenus
();
this
.
authLocation
();
}
},
...
...
@@ -307,6 +324,7 @@ export default {
uni
.
setStorageSync
(
"shopInfo"
,
JSON
.
stringify
(
this
.
shopInfo
));
this
.
getMenuList
(
data
.
id
);
this
.
getHomeOrder
(
data
.
id
);
this
.
getBanerList
(
data
.
id
)
// 判断店铺是否在范围内
const
shopInfo
=
uni
.
getStorageSync
(
"shopInfo"
);
const
{
distanceLimit
,
realDistance
}
=
JSON
.
parse
(
shopInfo
);
...
...
@@ -325,6 +343,21 @@ export default {
});
User
.
getShopInfo
(
params
);
},
async
getBanerList
(
id
=
this
.
shopInfo
.
id
)
{
const
{
data
=
{}}
=
await
Menu
.
getSwiperList
({
id
});
const
sendData
=
{
home
:[
'https://cdn.uviewui.com/uview/swiper/swiper1.png'
,
'https://cdn.uviewui.com/uview/swiper/swiper2.png'
,
'https://cdn.uviewui.com/uview/swiper/swiper3.png'
,
],
mine
:[
'https://cdn.uviewui.com/uview/swiper/swiper1.png'
,
'https://cdn.uviewui.com/uview/swiper/swiper2.png'
,
'https://cdn.uviewui.com/uview/swiper/swiper3.png'
,
],
}
if
(
data
.
code
===
200
)
{
this
.
$store
.
commit
(
"setSwiperList"
,
sendData
);
}
console
.
log
(
data
)
},
async
getHomeOrder
(
id
=
this
.
shopInfo
.
id
)
{
if
(
!
this
.
userms
)
return
;
const
res
=
await
Order
.
getHomeOrder
({
shopId
:
id
});
...
...
@@ -335,7 +368,7 @@ export default {
this
.
buied
=
true
;
this
.
orderInfo
=
data
.
data
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
OrderQrCode
.
getOrderInfo
(
this
.
shopInfo
);
this
.
$refs
.
OrderQrCode
.
getOrderInfo
(
this
.
shopInfo
,
false
);
})
}
else
{
this
.
buied
=
false
;
...
...
pages/mine/mine.vue
View file @
007c5c32
...
...
@@ -80,6 +80,17 @@
</view>
</view>
</view>
<view
class=
"swiper"
>
<u-swiper
v-if=
"swiperList.length!=0"
:list=
"swiperList"
:interval=
"5000"
circular
:height=
"100"
></u-swiper>
</view>
<view
class=
"contents"
v-if=
"!userms"
...
...
@@ -224,6 +235,9 @@ export default {
userInfo
()
{
return
this
.
$store
.
state
.
user
.
userInfo
;
},
swiperList
()
{
return
this
.
$store
.
state
.
menu
.
swiperList
.
mine
;
}
},
methods
:
{
getShareData
(
type
)
{
...
...
@@ -424,7 +438,10 @@ button::after {
.mod11
::after
{
border-radius
:
0
rpx
;
}
.swiper
{
margin
:
15
rpx
32
rpx
24
rpx
32
rpx
;
}
.contents
{
display
:
flex
;
padding
:
52
rpx
64
rpx
52
rpx
70
rpx
;
...
...
request/menu/index.js
View file @
007c5c32
...
...
@@ -146,4 +146,17 @@ export default {
return
err
;
});
},
// 获取轮播图
getSwiperList
(
data
)
{
return
uni
.
$u
.
http
.
get
(
`/system/banner/getShopBanners?shopId=
${
data
.
id
}
`
,{
params
:
{},
custom
:
{
noLoading
:
true
},
})
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
{
// uni.showToast({ title: '哎哟!刚刚走神了,请退出后重进', icon: 'none' })
console
.
log
(
"哎哟!刚刚走神了,请退出后重进"
);
});
}
};
store/modules/menu.js
View file @
007c5c32
...
...
@@ -3,7 +3,11 @@ const menu = {
state
:
{
menuAllInfo
:
null
,
//菜单信息
orderPrePayInfo
:
null
,
//(需要和购物车数据格式一致)
setMenuCategorys
:[]
setMenuCategorys
:[],
swiperList
:{
home
:[],
mine
:[]
}
},
mutations
:
{
// 设置用户菜单信息
...
...
@@ -17,6 +21,10 @@ const menu = {
// 设置首页商品信息
setMenuCategorys
(
state
,
setMenuCategorys
){
state
.
setMenuCategorys
=
setMenuCategorys
},
// 存储轮播图
setSwiperList
(
state
,
val
)
{
state
.
swiperList
=
val
}
},
...
...
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