Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
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
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
6f21af0b
Commit
6f21af0b
authored
Aug 06, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
8cfcc9c9
88382beb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
197 additions
and
45 deletions
+197
-45
App.vue
src/App.vue
+1
-32
Search.vue
src/components/index/Search.vue
+7
-7
pages.json
src/pages.json
+7
-0
index.vue
src/pages/index/index.vue
+6
-3
loading.vue
src/pages/index/loading.vue
+34
-0
detail.vue
src/pages/storeEntry/detail.vue
+108
-3
signIn.js
src/utils/signIn.js
+34
-0
No files found.
src/App.vue
View file @
6f21af0b
<
script
setup
>
<
script
setup
>
import
{
getTokenUser
}
from
'./api/index'
;
onLaunch
(()
=>
{});
import
{
sgyOrderGetStatus
}
from
'./api/order'
;
import
testJson
from
'./static/json/test.json'
;
import
{
getToken
}
from
'./utils/auth'
;
import
{
setOrderDic
}
from
'./utils/orderDic'
;
// beforeMount(() => {
// if (!getToken()) signIn();
// });
onLaunch
(()
=>
{
if
(
!
getToken
())
signIn
();
sgyOrderGetStatus
().
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
setOrderDic
(
res
.
data
.
store
);
}
});
});
onShow
(()
=>
{
onShow
(()
=>
{
console
.
log
(
'App Show'
);
console
.
log
(
'App Show'
);
...
@@ -23,22 +8,6 @@ onShow(() => {
...
@@ -23,22 +8,6 @@ onShow(() => {
onHide
(()
=>
{
onHide
(()
=>
{
console
.
log
(
'App Hide'
);
console
.
log
(
'App Hide'
);
});
});
// 登录
const
signIn
=
()
=>
{
xma
.
xh
.
getUserProfile
({
range
:
[
'ACCOUNT'
,
'MOBILE'
,
'CITIZEN'
],
async
success
(
info
)
{
const
info2
=
JSON
.
stringify
(
info
);
getTokenUser
(
info2
).
then
((
res
)
=>
{
const
token
=
res
.
data
.
access_token
;
const
userInfo
=
res
.
data
.
user_info
;
xma
.
setStorageSync
(
'Authorization'
,
token
);
xma
.
setStorageSync
(
'userInfo'
,
userInfo
);
console
.
log
(
'登录...'
);
});
},
});
};
</
script
>
</
script
>
<
style
>
<
style
>
.multi-line
{
.multi-line
{
...
...
src/components/index/Search.vue
View file @
6f21af0b
...
@@ -31,13 +31,13 @@ const title = ref('小程序平台');
...
@@ -31,13 +31,13 @@ const title = ref('小程序平台');
const
{
countInfo
,
addCount
}
=
useCountStore
();
const
{
countInfo
,
addCount
}
=
useCountStore
();
const
test
=
ref
(
''
);
const
test
=
ref
(
''
);
onMounted
(()
=>
{
onMounted
(()
=>
{
xma
.
xh
.
getUserProfile
({
//
xma.xh.getUserProfile({
range
:
[
'ACCOUNT'
,
'MOBILE'
,
'CITIZEN'
],
//
range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
async
success
(
info
)
{
//
async success(info) {
const
info2
=
JSON
.
stringify
(
info
);
//
const info2 = JSON.stringify(info);
test
.
value
=
info2
;
//
test.value = info2;
},
//
},
});
//
});
});
});
const
search
=
(
res
)
=>
{
const
search
=
(
res
)
=>
{
...
...
src/pages.json
View file @
6f21af0b
...
@@ -6,6 +6,13 @@
...
@@ -6,6 +6,13 @@
}
}
},
},
"pages"
:
[
"pages"
:
[
{
"path"
:
"pages/index/loading"
,
"style"
:
{
"navigationBarTitleText"
:
"加载"
,
"navigationStyle"
:
"custom"
}
},
{
{
"path"
:
"pages/index/index"
,
"path"
:
"pages/index/index"
,
"style"
:
{
"style"
:
{
...
...
src/pages/index/index.vue
View file @
6f21af0b
...
@@ -155,7 +155,9 @@ import FoodDetails from '../../components/index/FoodDetails.vue';
...
@@ -155,7 +155,9 @@ import FoodDetails from '../../components/index/FoodDetails.vue';
import
ShopCard
from
'../../components/index/ShopCard.vue'
;
import
ShopCard
from
'../../components/index/ShopCard.vue'
;
import
Marketing
from
'../../components/index/Marketing.vue'
;
import
Marketing
from
'../../components/index/Marketing.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
{
orderStatus
}
from
'../../utils/signIn'
;
import
{
import
{
getTokenUser
,
groupBuyList
,
groupBuyList
,
groupImgList
,
groupImgList
,
popularityPage
,
popularityPage
,
...
@@ -165,9 +167,8 @@ import {
...
@@ -165,9 +167,8 @@ import {
receiveCoupon
,
receiveCoupon
,
}
from
'../../api/index'
;
}
from
'../../api/index'
;
import
{
timeConversion
}
from
'../../utils/tool'
;
import
{
timeConversion
}
from
'../../utils/tool'
;
const
nowTime
=
ref
(
new
Date
().
getTime
());
// import testJson from '../../static/json/test.json';
// import testJson from '../../static/json/test.json';
// import { getToken } from '../../utils/auth'
;
const
nowTime
=
ref
(
new
Date
().
getTime
())
;
const
title
=
ref
(
'小程序平台'
);
const
title
=
ref
(
'小程序平台'
);
const
{
countInfo
,
addCount
}
=
useCountStore
();
const
{
countInfo
,
addCount
}
=
useCountStore
();
// 附近美食
// 附近美食
...
@@ -205,7 +206,8 @@ const coupon = ref([]);
...
@@ -205,7 +206,8 @@ const coupon = ref([]);
let
total
;
let
total
;
// 轮播图数据
// 轮播图数据
let
lunboData
;
let
lunboData
;
onMounted
(()
=>
{
onMounted
(
async
()
=>
{
orderStatus
();
getClassification
();
getClassification
();
rotatingBroadcast
();
rotatingBroadcast
();
nearbyFood
();
nearbyFood
();
...
@@ -213,6 +215,7 @@ onMounted(() => {
...
@@ -213,6 +215,7 @@ onMounted(() => {
getMerchantList
();
getMerchantList
();
getCouponMainList
();
getCouponMainList
();
});
});
function
jumpProductDetails
(
item
)
{
function
jumpProductDetails
(
item
)
{
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
'/pages/shop/shop?shopId='
+
item
.
shopId
,
url
:
'/pages/shop/shop?shopId='
+
item
.
shopId
,
...
...
src/pages/index/loading.vue
0 → 100644
View file @
6f21af0b
<
template
>
<view
class=
"loading"
></view>
</
template
>
<
script
setup
>
import
{}
from
'vue'
;
import
{
signIn
}
from
'../../utils/signIn'
;
import
testJson
from
'../../static/json/test.json'
;
import
{
getTokenUser
}
from
'../../api/index'
;
import
{
getToken
}
from
'../../utils/auth'
;
onMounted
(
async
()
=>
{
// await signIn();
if
(
!
getToken
())
await
signIn2
();
xma
.
reLaunch
({
url
:
'/pages/index/index'
});
});
// 登录
const
signIn2
=
()
=>
{
xma
.
showLoading
({
title
:
'加载中'
,
mask
:
true
,
});
return
getTokenUser
(
testJson
).
then
((
res
)
=>
{
const
token
=
res
.
data
.
access_token
;
const
userInfo
=
res
.
data
.
user_info
;
xma
.
setStorageSync
(
'Authorization'
,
token
);
xma
.
setStorageSync
(
'userInfo'
,
userInfo
);
console
.
log
(
'登录...'
);
});
};
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
src/pages/storeEntry/detail.vue
View file @
6f21af0b
...
@@ -96,17 +96,61 @@
...
@@ -96,17 +96,61 @@
class=
"img1"
class=
"img1"
></wd-upload>
></wd-upload>
</view>
</view>
<view
class=
"flex"
>
<view
class=
"logo"
>
店铺分类
</view>
<view
class=
"text"
@
click=
"showclass"
>
请选择
</view>
</view>
<wd-textarea
<wd-textarea
placeholder=
"请填写评价"
placeholder=
"请填写评价"
label=
"店铺介绍"
label=
"店铺介绍"
label-width=
"100px"
label-width=
"100px"
v-model=
"formData.szdq"
v-model=
"formData.szdq"
prop=
"szdq"
prop=
"szdq"
:no-border=
"false"
/>
/>
<button
type=
"primary"
style=
"width: 80%"
>
提交
</button>
<button
type=
"primary"
style=
"width: 80%"
>
提交
</button>
</wd-cell-group>
</wd-cell-group>
<wd-popup
v-model=
"show"
position=
"bottom"
custom-style=
"height:300px;overflow:auto;"
@
close=
"handleClose"
>
<view
class=
"hcontent"
>
<view
class=
"flex1"
>
<view
class=
"text"
>
取消
</view>
<view
class=
"text"
>
请选择
</view>
<view
class=
"text"
>
确定
</view>
</view>
<view
class=
"nr"
>
<view
class=
"left"
>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
<view
class=
"name"
>
周边美食
</view>
</view>
<view
class=
"right"
>
<view
class=
"item"
>
<view
class=
"hname"
>
生活用品
</view>
<view
class=
"hnr"
>
<wd-tag
round
>
标签
</wd-tag>
<wd-tag
round
>
标签
</wd-tag>
<wd-tag
round
>
标签
</wd-tag>
<wd-tag
round
>
标签
</wd-tag>
</view>
</view>
</view>
</view>
</view>
</wd-popup>
</wd-form>
</wd-form>
</view>
</view>
</view>
</view>
...
@@ -125,11 +169,15 @@ const promotionlist = ref([
...
@@ -125,11 +169,15 @@ const promotionlist = ref([
label
:
'连锁加盟'
,
label
:
'连锁加盟'
,
},
},
]);
]);
const
show
=
ref
(
false
);
const
fileList
=
ref
([
const
fileList
=
ref
([
{
{
url
:
'1'
,
url
:
'1'
,
},
},
]);
]);
const
showclass
=
()
=>
{
show
.
value
=
true
;
};
function
chooseImage
({
fileList
:
files
})
{
function
chooseImage
({
fileList
:
files
})
{
xma
.
chooseImage
({
xma
.
chooseImage
({
...
@@ -175,8 +223,59 @@ const getLocationFn = () => {
...
@@ -175,8 +223,59 @@ const getLocationFn = () => {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
page
{
page
{
background
:
#f
3f3f3
;
background
:
#f
ff
;
}
}
.uni-textarea-placeholder
,
.uni-textarea-line
,
.uni-textarea-compute
,
.uni-textarea-textarea
{
width
:
400rpx
;
height
:
220rpx
;
border
:
1px
solid
#d5d1d1
;
}
.wd-tag
{
margin-left
:
15rpx
;
}
.hcontent
{
height
:
100%
;
.flex1
{
padding
:
10px
;
display
:
flex
;
position
:
fixed
;
width
:
100%
;
justify-content
:
space-between
;
box-sizing
:
border-box
;
border-bottom
:
1px
solid
#ccc
;
background
:
#fff
;
z-index
:
6
;
}
.nr
{
padding-top
:
42px
;
display
:
flex
;
.left
{
background
:
#ebe7e7
;
width
:
33%
;
height
:
100%
;
overflow-y
:
auto
;
.name
{
text-align
:
center
;
height
:
40px
;
line-height
:
40px
;
}
}
.right
{
background
:
#fff
;
width
:
67%
;
.hname
{
font-size
:
14px
;
margin
:
15rpx
;
padding-bottom
:
10px
;
border-bottom
:
1px
solid
#ccc
;
}
}
}
}
.container
{
.container
{
width
:
375
*
2rpx
;
width
:
375
*
2rpx
;
margin
:
0
auto
;
margin
:
0
auto
;
...
@@ -196,6 +295,12 @@ page {
...
@@ -196,6 +295,12 @@ page {
padding
:
var
(
--
wot-input-cell-padding
,
10px
)
padding
:
var
(
--
wot-input-cell-padding
,
10px
)
var
(
--
wot-input-padding
,
var
(
--
wot-size-side-padding
,
15px
));
var
(
--
wot-input-padding
,
var
(
--
wot-size-side-padding
,
15px
));
background-color
:
var
(
--
wot-input-cell-bg
,
var
(
--
wot-color-white
,
rgb
(
255
,
255
,
255
)));
background-color
:
var
(
--
wot-input-cell-bg
,
var
(
--
wot-color-white
,
rgb
(
255
,
255
,
255
)));
.text
{
margin-left
:
16px
;
width
:
60%
;
font-size
:
var
(
--
wot-input-fs
,
var
(
--
wot-cell-title-fs
,
14px
));
color
:
var
(
--
wot-input-placeholder-color
,
#bfbfbf
);
}
.logo
{
.logo
{
position
:
relative
;
position
:
relative
;
padding-left
:
12px
;
padding-left
:
12px
;
...
...
src/utils/signIn.js
0 → 100644
View file @
6f21af0b
import
{
getTokenUser
}
from
'../api/index'
;
import
{
sgyOrderGetStatus
}
from
'../api/order'
;
import
{
setOrderDic
}
from
'../utils/orderDic'
;
// 登录
export
const
signIn
=
()
=>
{
xma
.
showLoading
({
title
:
'加载中'
,
mask
:
true
,
});
return
new
Promise
((
resolve
,
reject
)
=>
{
xma
.
xh
.
getUserProfile
({
range
:
[
'ACCOUNT'
,
'MOBILE'
,
'CITIZEN'
],
success
(
info
)
{
getTokenUser
(
info
.
data
).
then
((
res
)
=>
{
xma
.
hideLoading
();
const
token
=
res
.
data
.
access_token
;
const
userInfo
=
res
.
data
.
user_info
;
xma
.
setStorageSync
(
'Authorization'
,
token
);
xma
.
setStorageSync
(
'userInfo'
,
userInfo
);
resolve
();
});
},
});
});
};
export
const
orderStatus
=
()
=>
{
sgyOrderGetStatus
().
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
setOrderDic
(
res
.
data
.
store
);
}
});
};
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