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
526fd2be
Commit
526fd2be
authored
Aug 13, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
b9199c46
2fbaf903
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
441 additions
and
68 deletions
+441
-68
Date.vue
src/Components/assistingAgriculture/index/Date.vue
+125
-0
Search.vue
src/Components/assistingAgriculture/index/Search.vue
+9
-3
specialOfferZoneList.js
src/api/assistingAgriculture/specialOfferZoneList.js
+10
-0
Search.vue
src/components/index/Search.vue
+11
-1
pages.json
src/pages.json
+3
-2
RouteDetails.vue
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
+22
-12
RuralTravel.vue
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
+12
-2
specialOfferZoneList.vue
...assistingAgriculture/RuralTravel/specialOfferZoneList.vue
+211
-41
index.vue
src/pages/index/index.vue
+6
-1
loading.vue
src/pages/index/loading.vue
+17
-1
detail.vue
src/pages/storeEntry/detail.vue
+14
-4
index.vue
src/pages/storeEntry/index.vue
+1
-1
No files found.
src/Components/assistingAgriculture/index/Date.vue
0 → 100644
View file @
526fd2be
<
template
>
<view
class=
"sort"
:style=
"
{ width: width }">
<view
class=
"date"
>
出发日期
</view>
<ul
class=
"ul"
>
<li
v-for=
"(item, index) in dataList"
:key=
"index"
:class=
"
{ active: selectedItem === index }"
@tap="selectItem(index, item)"
>
{{
item
.
startDate
}}
</li>
<wd-calendar
use-default-slot
v-model=
"value"
@
confirm=
"handleConfirm"
>
<li>
选择日期
</li>
</wd-calendar>
</ul>
</view>
</
template
>
<
script
setup
>
import
{
defineProps
,
onMounted
,
ref
}
from
'vue'
;
import
{
getStartDate
}
from
'@/api/assistingAgriculture/village'
;
const
selectedItem
=
ref
(
null
);
const
emit
=
defineEmits
([
'dataParams'
]);
const
dataList
=
ref
([]);
const
value
=
ref
(
''
);
const
formatValue
=
ref
(
''
);
const
params
=
{
current
:
1
,
size
:
10
,
};
const
props
=
defineProps
({
width
:
{
type
:
String
,
default
:
'100%'
,
},
});
onMounted
(
async
()
=>
{
getStartDateList
();
});
const
selectItem
=
(
index
,
item
)
=>
{
console
.
log
(
item
,
323
);
const
datePart
=
timestampToDateBasic
(
value
.
value
);
selectedItem
.
value
=
index
;
emit
(
'dataParams'
,
item
,
datePart
);
console
.
log
(
datePart
,
'datePart'
);
};
const
getStartDateList
=
()
=>
{
getStartDate
(
params
).
then
((
res
)
=>
{
dataList
.
value
=
res
.
data
;
});
};
function
handleConfirm
({
value
})
{
const
datePart
=
timestampToDateBasic
(
value
);
emit
(
'dataParams'
,
null
,
datePart
);
}
function
timestampToDateBasic
(
timestamp
)
{
const
date
=
new
Date
(
timestamp
);
const
year
=
date
.
getFullYear
();
const
month
=
(
date
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
date
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
return
`
${
year
}
/
${
month
}
/
${
day
}
`
;
}
</
script
>
<
style
lang=
"scss"
scoped
>
.sort
{
width
:
710rpx
;
height
:
192rpx
;
position
:
absolute
;
top
:
100%
;
// width: 100%;
// min-height: 212rpx;
border-radius
:
0rpx
0rpx
16rpx
16rpx
;
background
:
#ffffff
;
box-shadow
:
0rpx
16rpx
16rpx
0rpx
rgba
(
73
,
73
,
73
,
0
.14
);
margin
:
0
auto
;
z-index
:
99
;
// display: flex;
padding-bottom
:
20rpx
;
box-sizing
:
border-box
;
overflow
:
auto
;
.date
{
width
:
96rpx
;
height
:
28rpx
;
font-family
:
Source
Han
Sans
;
font-size
:
24rpx
;
font-weight
:
normal
;
line-height
:
28rpx
;
letter-spacing
:
0em
;
font-variation-settings
:
'opsz'
auto
;
font-feature-settings
:
'kern'
on
;
color
:
#fa5151
;
margin-left
:
44rpx
;
margin-top
:
20rpx
;
}
.ul
{
padding-left
:
20rpx
;
display
:
flex
;
flex-flow
:
wrap
;
li
{
width
:
154rpx
;
height
:
20rpx
;
border-radius
:
8rpx
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
padding
:
6rpx
26rpx
;
margin-left
:
20rpx
;
background
:
#f3f3f3
;
font-size
:
24rpx
;
line-height
:
20rpx
;
text-align
:
center
;
list-style-type
:
none
;
margin-top
:
20rpx
;
}
.active
{
color
:
#fa5151
;
background
:
#feeeee
;
}
}
}
</
style
>
src/Components/assistingAgriculture/index/Search.vue
View file @
526fd2be
...
@@ -11,10 +11,12 @@
...
@@ -11,10 +11,12 @@
/>
/>
<input
<input
type=
"text"
type=
"text"
:value=
"test"
class=
"text"
class=
"text"
:placeholder=
"placeholderText"
:placeholder=
"placeholderText"
placeholder-style=
"font-size:16rpx;"
placeholder-style=
"font-size:16rpx;"
:value=
"modelValue"
@
input=
"updateModelValue"
@
keyup
.
enter=
"toSearch"
@
focus=
"toSearch"
@
focus=
"toSearch"
/>
/>
</view>
</view>
...
@@ -33,9 +35,13 @@ const props = defineProps({
...
@@ -33,9 +35,13 @@ const props = defineProps({
type
:
String
,
type
:
String
,
default
:
''
,
default
:
''
,
},
},
modelValue
:
String
,
});
});
const
toSearch
=
()
=>
{
const
updateModelValue
=
(
event
)
=>
{
emit
(
'search'
);
emit
(
'update:modelValue'
,
event
.
target
.
value
);
};
const
toSearch
=
(
test
)
=>
{
emit
(
'search'
,
test
);
};
};
// 返回上一级
// 返回上一级
function
back
()
{
function
back
()
{
...
...
src/api/assistingAgriculture/specialOfferZoneList.js
0 → 100644
View file @
526fd2be
import
{
request
}
from
'../../utils/request'
;
// 筑农首页-分类查询商品列表
export
function
queryOfferProdList
(
data
)
{
return
request
({
url
:
`/sgyrdd/prod/queryOfferProdList`
,
method
:
'GET'
,
data
,
});
}
src/components/index/Search.vue
View file @
526fd2be
<
template
>
<
template
>
<view
class=
"search"
:style=
"
{ background: background }">
<view
class=
"search"
:style=
"
{ background: background }">
<wd-icon
name=
"thin-arrow-left"
class=
"icon"
@
tap=
"back"
:style=
"
{ color: backIcon }">
</wd-icon>
<wd-icon
v-if=
"show"
name=
"thin-arrow-left"
class=
"icon"
@
tap=
"back"
:style=
"
{ color: backIcon }"
>
</wd-icon>
<slot></slot>
<slot></slot>
<view
class=
"searchBox"
>
<view
class=
"searchBox"
>
<image
<image
...
@@ -25,6 +31,10 @@ const props = defineProps({
...
@@ -25,6 +31,10 @@ const props = defineProps({
type
:
String
,
type
:
String
,
default
:
'white'
,
default
:
'white'
,
},
},
show
:
{
type
:
Boolean
,
default
:
true
,
},
});
});
const
emit
=
defineEmits
([
'toSearch'
]);
const
emit
=
defineEmits
([
'toSearch'
]);
const
title
=
ref
(
'小程序平台'
);
const
title
=
ref
(
'小程序平台'
);
...
...
src/pages.json
View file @
526fd2be
...
@@ -152,7 +152,9 @@
...
@@ -152,7 +152,9 @@
"path"
:
"pages/assistingAgriculture/RuralTravel/specialOfferZoneList"
,
"path"
:
"pages/assistingAgriculture/RuralTravel/specialOfferZoneList"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
"navigationBarBackgroundColor"
:
"#ffffff"
"navigationBarBackgroundColor"
:
"#ffffff"
,
"enablePullDownRefresh"
:
true
,
"onReachBottomDistance"
:
50
}
}
},
},
{
{
...
@@ -227,7 +229,6 @@
...
@@ -227,7 +229,6 @@
"navigationBarTitleText"
:
"景点详情"
,
"navigationBarTitleText"
:
"景点详情"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationStyle"
:
""
,
"navigationStyle"
:
""
,
"enablePullDownRefresh"
:
true
,
"onReachBottomDistance"
:
50
"onReachBottomDistance"
:
50
}
}
},
},
...
...
src/pages/assistingAgriculture/RouteDetails/RouteDetails.vue
View file @
526fd2be
...
@@ -212,6 +212,7 @@
...
@@ -212,6 +212,7 @@
<ul>
<ul>
<li>
<li>
{{
activeMeal
.
mealScenery
}}
{{
activeMeal
.
mealScenery
}}
<text
@
click=
"jumpPage"
style=
"color: #0974f5"
>
详情
</text>
</li>
</li>
<!--
<li>
<!--
<li>
4个景点,约7小时
4个景点,约7小时
...
@@ -343,6 +344,7 @@ const photoList = ref([]);
...
@@ -343,6 +344,7 @@ const photoList = ref([]);
// 套餐列表
// 套餐列表
const
mealList
=
ref
([]);
const
mealList
=
ref
([]);
const
activeMeal
=
ref
(
null
);
const
activeMeal
=
ref
(
null
);
const
orderInfo
=
ref
({});
const
onActiveMeal
=
(
item
)
=>
{
const
onActiveMeal
=
(
item
)
=>
{
activeMeal
.
value
=
item
;
activeMeal
.
value
=
item
;
getPriceListFn
(
item
.
mealId
);
getPriceListFn
(
item
.
mealId
);
...
@@ -353,6 +355,7 @@ const viewPriceList = ref([]);
...
@@ -353,6 +355,7 @@ const viewPriceList = ref([]);
const
activePrice
=
ref
(
null
);
const
activePrice
=
ref
(
null
);
const
show
=
ref
(
false
);
const
show
=
ref
(
false
);
const
shopIds
=
ref
(
''
);
const
shopIds
=
ref
(
''
);
const
prodIds
=
ref
(
''
);
watch
(
show
,
(
value
)
=>
{
watch
(
show
,
(
value
)
=>
{
let
index
=
priceList
.
value
.
indexOf
(
activePrice
.
value
);
let
index
=
priceList
.
value
.
indexOf
(
activePrice
.
value
);
index
=
Math
.
max
(
1
,
index
);
index
=
Math
.
max
(
1
,
index
);
...
@@ -370,7 +373,13 @@ const getPriceListFn = (mealId) => {
...
@@ -370,7 +373,13 @@ const getPriceListFn = (mealId) => {
viewPriceList
.
value
=
res
.
data
.
slice
(
0
,
4
);
viewPriceList
.
value
=
res
.
data
.
slice
(
0
,
4
);
});
});
};
};
function
jumpPage
()
{
xma
.
navigateTo
({
url
:
'/pages/assistingAgriculture/reviewDetails/scenicSpotDetails?prodId='
+
activeMeal
.
value
.
prodId
,
});
}
function
groupBuyConfirmFn
(
prodId
,
skuId
)
{
function
groupBuyConfirmFn
(
prodId
,
skuId
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
groupBuyConfirm
({
prodId
,
skuId
}).
then
((
res
)
=>
{
groupBuyConfirm
({
prodId
,
skuId
}).
then
((
res
)
=>
{
...
@@ -407,8 +416,8 @@ function formatDate(inputDate) {
...
@@ -407,8 +416,8 @@ function formatDate(inputDate) {
return
`
${
year
}
-
${
monthDay
}
`
;
return
`
${
year
}
-
${
monthDay
}
`
;
}
}
const
payNow
=
async
(
data
)
=>
{
const
payNow
=
async
(
data
)
=>
{
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
).
then
((
res
)
=>
{
groupBuyConfirmFn
(
activeMeal
.
value
.
prodId
,
activeMeal
.
value
.
skuId
).
then
((
res
)
=>
{
groupBuyUpdateFnQg
();
groupBuyUpdateFnQg
()
.
then
(()
=>
{})
;
});
});
params
.
value
.
id
=
orderInfo
.
value
.
key
;
params
.
value
.
id
=
orderInfo
.
value
.
key
;
params
.
value
.
tradeType
=
data
.
selectType
;
params
.
value
.
tradeType
=
data
.
selectType
;
...
@@ -419,25 +428,25 @@ const payNow = async (data) => {
...
@@ -419,25 +428,25 @@ const payNow = async (data) => {
payWayCode
:
5
,
payWayCode
:
5
,
tradeType
:
data
.
selectType
,
tradeType
:
data
.
selectType
,
};
};
groupBuyCreate
(
qgParams
).
then
((
res
)
=>
{
//
groupBuyCreate(qgParams).then((res) => {
if
(
res
.
code
===
0
)
{
//
if (res.code === 0) {
openUrl
(
res
.
data
.
result
);
//
openUrl(res.data.result);
}
else
{
//
} else {
groupBuyConfirmFn
(
prodIds
.
value
,
skuIds
.
value
);
//
groupBuyConfirmFn(prodIds.value, skuIds.value);
}
//
}
});
//
});
};
};
function
groupBuyUpdateFnQg
(
couponUserId
=
''
)
{
function
groupBuyUpdateFnQg
(
couponUserId
=
''
)
{
const
{
receiverName
,
receiverMobile
,
receiverAddress
}
=
addressParams
.
value
;
return
new
Promise
((
resolve
,
reject
)
=>
{
groupBuyUpdate
({
groupBuyUpdate
({
key
:
orderInfo
.
value
.
key
,
key
:
orderInfo
.
value
.
key
,
couponUserId
,
receiverTime
:
formatDate
(
activePrice
.
value
.
priceDay
),
receiverTime
:
formatDate
(
activePrice
.
value
.
priceDay
),
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
orderInfo
.
value
=
res
.
data
;
orderInfo
.
value
=
res
.
data
;
}
}
});
});
});
}
}
const
shopInfo
=
ref
({});
const
shopInfo
=
ref
({});
// 获取店铺信息
// 获取店铺信息
...
@@ -457,6 +466,7 @@ const itineraryData = ref([]);
...
@@ -457,6 +466,7 @@ const itineraryData = ref([]);
prodId:43835 */
prodId:43835 */
onLoad
(({
shopId
,
prodId
})
=>
{
onLoad
(({
shopId
,
prodId
})
=>
{
shopIds
.
value
=
shopId
;
shopIds
.
value
=
shopId
;
prodIds
.
value
=
prodId
;
// const shopId = 1821388624367861761n;
// const shopId = 1821388624367861761n;
// const prodId = 43835;
// const prodId = 43835;
getProd
({
getProd
({
...
...
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
View file @
526fd2be
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
backIcon=
"black"
backIcon=
"black"
iconSrc=
"/static/assistingAgriculture/assets/left.png"
iconSrc=
"/static/assistingAgriculture/assets/left.png"
placeholderText=
"请输入要搜索的关键词"
placeholderText=
"请输入要搜索的关键词"
@
search=
"toSearch"
v-model=
"keyword"
></Search>
></Search>
</view>
</view>
<view
class=
"bac-img"
>
<view
class=
"bac-img"
>
...
@@ -189,6 +191,7 @@ const startCity = ref(null);
...
@@ -189,6 +191,7 @@ const startCity = ref(null);
const
dateType
=
ref
(
null
);
const
dateType
=
ref
(
null
);
const
allocateDate
=
ref
(
null
);
const
allocateDate
=
ref
(
null
);
const
serviceCommitment
=
ref
(
null
);
const
serviceCommitment
=
ref
(
null
);
const
keyword
=
ref
(
''
);
const
labelId
=
ref
(
null
);
const
labelId
=
ref
(
null
);
const
locationFiltering
=
(
index
)
=>
{
const
locationFiltering
=
(
index
)
=>
{
switch
(
index
)
{
switch
(
index
)
{
...
@@ -227,8 +230,8 @@ const locationFiltering = (index) => {
...
@@ -227,8 +230,8 @@ const locationFiltering = (index) => {
}
}
};
};
onPullDownRefresh
(()
=>
{
onPullDownRefresh
(()
=>
{
keyword
.
value
=
''
;
getProd
();
getProd
();
getPopular
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
uni
.
stopPullDownRefresh
();
uni
.
stopPullDownRefresh
();
},
1000
);
},
1000
);
...
@@ -278,8 +281,14 @@ const screenParams = (item, type) => {
...
@@ -278,8 +281,14 @@ const screenParams = (item, type) => {
getProd
();
getProd
();
}
}
};
};
// 搜索
const
toSearch
=
(
data
)
=>
{
keyword
.
value
=
data
.
detail
.
value
;
getProd
(
keyword
.
value
);
};
// 查询列表
// 查询列表
const
getProd
=
()
=>
{
const
getProd
=
(
searchKeyword
=
''
)
=>
{
const
params
=
{
const
params
=
{
current
:
1
,
current
:
1
,
size
:
10
,
size
:
10
,
...
@@ -290,6 +299,7 @@ const getProd = () => {
...
@@ -290,6 +299,7 @@ const getProd = () => {
...(
serviceCommitment
.
value
!==
null
&&
{
serviceCommitment
:
serviceCommitment
.
value
}),
...(
serviceCommitment
.
value
!==
null
&&
{
serviceCommitment
:
serviceCommitment
.
value
}),
...(
labelId
.
value
!==
null
&&
{
labelId
:
labelId
.
value
}),
...(
labelId
.
value
!==
null
&&
{
labelId
:
labelId
.
value
}),
...(
dateType
.
value
===
8
&&
{
allocateDate
:
allocateDate
.
value
}),
...(
dateType
.
value
===
8
&&
{
allocateDate
:
allocateDate
.
value
}),
...(
searchKeyword
&&
{
keyword
:
searchKeyword
}),
};
};
getProdList
(
params
).
then
((
res
)
=>
{
getProdList
(
params
).
then
((
res
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
...
...
src/pages/assistingAgriculture/RuralTravel/specialOfferZoneList.vue
View file @
526fd2be
<
template
>
<
template
>
<view
class=
"special-offer-zone-list-page"
>
<view
class=
"special-offer-zone-list-page"
>
<view
class=
"search"
>
<wd-icon
color=
"#fff"
name=
"thin-arrow-left"
class=
"icon"
@
tap=
"back"
></wd-icon>
</view>
<view
class=
"swiper"
>
<view
class=
"swiper"
>
<wd-swiper
<wd-swiper
customClass=
"swiper-custom"
customClass=
"swiper-custom"
...
@@ -65,84 +68,196 @@
...
@@ -65,84 +68,196 @@
></wd-icon>
></wd-icon>
</view>
</view>
</view>
</view>
<Sort
v-show=
"rotate"
/>
<view
class=
"bootom-top"
>
<DepartureDate
v-show=
"rotate2"
/>
<view
class=
"option"
@
tap=
"resetParams"
>
<ScenicSpots
v-show=
"rotate3"
/>
<text>
清空
</text>
<Screen
v-show=
"rotate4"
/>
<wd-icon
size=
"24rpx"
class=
"icons"
></wd-icon>
</view>
</view>
<Sort
v-show=
"rotate"
@
sortParams=
"sortParams"
/>
<DepartureDate
v-show=
"rotate2"
@
dataParams=
"dataParams"
/>
<ScenicSpots
v-show=
"rotate3"
@
placeParams=
"placeParams"
/>
<Screen
v-show=
"rotate4"
@
screenParams=
"screenParams"
/>
</view>
</view>
<view
class=
"list"
>
<view
class=
"list"
>
<view
class=
"item"
v-for=
"i in 10"
:key=
"i
"
>
<view
@
click=
"jumpPage(item)"
class=
"item"
v-for=
"(item, index) in cardData"
:key=
"index
"
>
<image
mode=
"aspectFill"
src=
"@/static/assistingAgriculture/reviewDetails/fj.png
"
></image>
<image
mode=
"aspectFill"
:src=
"imgUrl + item.pic
"
></image>
<view
class=
"info"
>
<view
class=
"info"
>
<text
class=
"title multi-line"
>
红枫湖+青岩古镇+云漫湖+云顶高坡景区一日游
</text>
<text
class=
"title multi-line"
>
{{ item.prodName }}
</text>
<text
class=
"subtitle"
>
赠价值59元特产伴手礼一份
</text>
<!-- <text class="subtitle">{{ item.brief }}</text> -->
<text
class=
"subtitle"
></text>
<view
class=
"tag-list"
>
<view
class=
"tag-list"
>
<!-- <text class="tag">可定明日</text>
<text class="tag">可定明日</text>
<text class="tag">可定明日</text>
<text
class=
"tag"
>
可定明日
</text>
<text class="tag">可定明日</text> -->
<text
class=
"tag"
>
可定明日
</text>
</view>
</view>
<view
class=
"fs-box"
>
<view
class=
"fs-box"
>
<text
class=
"fs-num"
>
4.9分
</text>
<text
class=
"fs-num"
v-if=
"item.score"
>
{{ item.score }}分
</text>
<text
style=
"margin-left: 20rpx"
class=
"sales-volume"
>
月销2000+
</text>
<text
style=
"margin-left: 20rpx"
class=
"sales-volume"
>
月销{{ item.monthSoldNum }}
</text>
</view>
</view>
<text
class=
"address"
>
云岩
出发
</text>
<text
class=
"address"
>
{{ item.tripArea }}
出发
</text>
</view>
</view>
<text
class=
"price"
>
¥
299.00
</text>
<text
class=
"price"
>
¥
{{ item.price }}
</text>
</view>
</view>
</view>
</view>
<view
style=
"width: 100%; text-align: center; font-size: 24rpx; margin-top: 10rpx; color: #888989"
v-if=
"params.isEnd"
>
没有更多啦~
</view>
</view>
</view>
</view>
</view>
</template>
</template>
<
script
setup
>
<
script
setup
>
import
{
queryOfferProdList
}
from
'@/api/assistingAgriculture/specialOfferZoneList'
;
import
Sort
from
'../../../components/assistingAgriculture/index/Sort.vue'
;
import
Sort
from
'../../../components/assistingAgriculture/index/Sort.vue'
;
import
DepartureDate
from
'../../../components/assistingAgriculture/index/D
epartureD
ate.vue'
;
import
DepartureDate
from
'../../../components/assistingAgriculture/index/Date.vue'
;
import
ScenicSpots
from
'../../../components/assistingAgriculture/index/ScenicSpots.vue'
;
import
ScenicSpots
from
'../../../components/assistingAgriculture/index/ScenicSpots.vue'
;
import
Screen
from
'../../../components/assistingAgriculture/index/Screen.vue'
;
import
Screen
from
'../../../components/assistingAgriculture/index/Screen.vue'
;
const
rotate
=
ref
(
false
);
const
rotate
=
ref
(
false
);
const
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
rotate2
=
ref
(
false
);
const
rotate2
=
ref
(
false
);
const
rotate3
=
ref
(
false
);
const
rotate3
=
ref
(
false
);
const
rotate4
=
ref
(
false
);
const
rotate4
=
ref
(
false
);
const
current
=
ref
(
0
);
const
current
=
ref
(
0
);
const
isLoadReachBottom
=
ref
(
null
);
const
params
=
ref
({
current
:
1
,
size
:
15
,
isEnd
:
false
,
});
const
shopSwiperList
=
ref
([
const
shopSwiperList
=
ref
([
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg'
,
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg'
,
]);
]);
const
locationFiltering
=
(
index
)
=>
{
const
locationFiltering
=
(
index
)
=>
{
switch
(
index
)
{
const
rotates
=
[
rotate
,
rotate2
,
rotate3
,
rotate4
];
case
0
:
rotates
.
forEach
((
rotate
,
i
)
=>
{
rotate
.
value
=
!
rotate
.
value
;
rotate
.
value
=
i
===
index
?
!
rotate
.
value
:
false
;
rotate2
.
value
=
false
;
});
rotate3
.
value
=
false
;
rotate4
.
value
=
false
;
break
;
case
1
:
rotate2
.
value
=
!
rotate2
.
value
;
rotate
.
value
=
false
;
rotate3
.
value
=
false
;
rotate4
.
value
=
false
;
break
;
case
2
:
rotate3
.
value
=
!
rotate3
.
value
;
rotate
.
value
=
false
;
rotate2
.
value
=
false
;
rotate4
.
value
=
false
;
break
;
case
3
:
rotate4
.
value
=
!
rotate4
.
value
;
rotate
.
value
=
false
;
rotate2
.
value
=
false
;
rotate3
.
value
=
false
;
break
;
}
};
};
onMounted
(()
=>
{
queryOfferProdListFn
();
});
function
handleClick
(
e
)
{
function
handleClick
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
}
}
function
jumpPage
(
item
)
{
xma
.
navigateTo
({
url
:
`/pages/assistingAgriculture/RouteDetails/RouteDetails?prodId=
${
item
.
prodId
}
&shopId=
${
item
.
shopId
}
`
,
});
}
function
onChange
(
e
)
{
function
onChange
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
}
}
// 智能排序
const
sortParams
=
(
sortMode
)
=>
{
params
.
value
.
sortType
=
sortMode
.
sortMode
;
refresh
().
then
(()
=>
{
queryOfferProdListFn
();
});
};
// 出发日期
const
dataParams
=
(
item
,
datePart
)
=>
{
if
(
item
)
{
params
.
value
.
dateType
=
item
.
key
;
refresh
().
then
(()
=>
{
queryOfferProdListFn
();
});
}
else
{
params
.
value
.
dateType
=
8
;
if
(
datePart
&&
datePart
!==
'NaN/NaN/NaN'
)
{
params
.
value
.
allocateDate
=
datePart
;
rotate2
.
value
=
false
;
refresh
().
then
(()
=>
{
queryOfferProdListFn
();
});
}
}
};
// 景点
const
placeParams
=
(
info
)
=>
{
params
.
value
.
attractionIdList
=
[
info
.
id
];
refresh
().
then
(()
=>
{
queryOfferProdListFn
();
});
};
// 筛选
const
screenParams
=
(
item
,
type
)
=>
{
if
(
type
===
'screen'
)
{
params
.
value
.
startCityList
=
[
item
.
tripCity
];
}
else
if
(
type
===
'serve'
)
{
params
.
value
.
serviceList
=
[
item
.
labelName
];
}
else
if
(
type
===
'people'
)
{
params
.
value
.
forPeopleList
=
[
item
.
labelName
];
}
refresh
().
then
(()
=>
{
queryOfferProdListFn
();
});
};
const
resetParams
=
()
=>
{
params
.
value
=
{
size
:
15
,
current
:
1
,
isEnd
:
false
,
};
refresh
().
then
(()
=>
{
queryOfferProdListFn
();
});
};
/**
* @description: 刷新
*/
function
refresh
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cardData
.
value
=
[];
params
.
value
.
current
=
1
;
params
.
value
.
isEnd
=
false
;
resolve
();
});
}
onPullDownRefresh
(()
=>
{
refresh
().
then
(()
=>
{
queryOfferProdListFn
();
});
});
function
back
()
{
xma
.
navigateBack
({
delta
:
1
,
});
}
const
cardData
=
ref
([]);
onReachBottom
(()
=>
{
if
(
isLoadReachBottom
.
value
===
true
)
return
;
isLoadReachBottom
.
value
=
true
;
queryOfferProdListFn
().
then
(()
=>
{
isLoadReachBottom
.
value
=
false
;
});
});
function
queryOfferProdListFn
()
{
if
(
params
.
value
.
isEnd
===
true
)
return
new
Promise
((
resolve
)
=>
{
resolve
();
});
xma
.
showLoading
({
title
:
'加载中...'
,
mask
:
false
,
});
return
queryOfferProdList
(
params
.
value
).
then
((
res
)
=>
{
if
(
res
.
data
.
records
.
length
<
params
.
value
.
size
)
{
params
.
value
.
isEnd
=
true
;
}
params
.
value
.
current
+=
1
;
cardData
.
value
=
cardData
.
value
.
concat
(
res
.
data
.
records
);
xma
.
stopPullDownRefresh
();
xma
.
hideLoading
();
});
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
@@ -154,6 +269,60 @@ page {
...
@@ -154,6 +269,60 @@ page {
flex-direction
:
column
;
flex-direction
:
column
;
align-items
:
center
;
align-items
:
center
;
width
:
750rpx
;
width
:
750rpx
;
.search
{
width
:
710rpx
;
height
:
80rpx
;
// background: rgba(255, 255, 255, 0.8);
border-radius
:
16rpx
16rpx
16rpx
16rpx
;
opacity
:
0
.8
;
margin
:
0
auto
;
margin-top
:
44rpx
;
display
:
flex
;
align-items
:
center
;
padding-left
:
20rpx
;
box-sizing
:
border-box
;
position
:
absolute
;
top
:
0
;
z-index
:
99
;
.arrow
{
width
:
15rpx
;
height
:
24rpx
;
}
.icon
{
font-size
:
28rpx
;
}
.searchBox
{
width
:
129
*
2rpx
;
height
:
26
*
2rpx
;
background
:
rgba
(
243
,
243
,
243
,
0
.4
);
border-radius
:
28rpx
28rpx
28rpx
28rpx
;
display
:
flex
;
align-items
:
center
;
padding-left
:
20rpx
;
margin-left
:
20rpx
;
.magnifyingGlass
{
width
:
26rpx
;
height
:
26rpx
;
}
.text
{
margin-left
:
10rpx
;
font-size
:
24rpx
;
}
}
.icon-box
{
display
:
flex
;
align-content
:
center
;
margin-left
:
86rpx
;
.icon
{
font-size
:
40rpx
;
color
:
#fff
;
}
.icon-fenxiang
{
margin-left
:
20rpx
;
}
}
}
.custom-indicator
{
.custom-indicator
{
padding
:
0
12rpx
;
padding
:
0
12rpx
;
height
:
48rpx
;
height
:
48rpx
;
...
@@ -272,6 +441,7 @@ page {
...
@@ -272,6 +441,7 @@ page {
font-weight
:
bold
;
font-weight
:
bold
;
/* 主题色 */
/* 主题色 */
color
:
#fa5151
;
color
:
#fa5151
;
margin-left
:
auto
;
align-self
:
flex-end
;
align-self
:
flex-end
;
}
}
}
}
...
...
src/pages/index/index.vue
View file @
526fd2be
...
@@ -2,7 +2,12 @@
...
@@ -2,7 +2,12 @@
<view
class=
"container"
>
<view
class=
"container"
>
<view
class=
"top"
>
<view
class=
"top"
>
<!-- 搜索 -->
<!-- 搜索 -->
<Search
background=
"rgba(255, 255, 255, 0.8)"
backIcon=
"black"
@
toSearch=
"toSearch"
>
<Search
background=
"rgba(255, 255, 255, 0.8)"
backIcon=
"black"
@
toSearch=
"toSearch"
:show=
"false"
>
<image
class=
"food"
src=
"../../static/index/food.png"
mode=
"widthFix"
/>
<image
class=
"food"
src=
"../../static/index/food.png"
mode=
"widthFix"
/>
</Search>
</Search>
<!-- 类别选择 -->
<!-- 类别选择 -->
...
...
src/pages/index/loading.vue
View file @
526fd2be
...
@@ -9,10 +9,26 @@ import testJson from '../../static/json/test.json';
...
@@ -9,10 +9,26 @@ import testJson from '../../static/json/test.json';
import
{
getTokenUser
}
from
'../../api/index'
;
import
{
getTokenUser
}
from
'../../api/index'
;
import
{
getToken
}
from
'../../utils/auth'
;
import
{
getToken
}
from
'../../utils/auth'
;
on
Mounted
(
async
(
)
=>
{
on
Load
(
async
(
options
)
=>
{
// await signIn();
// await signIn();
if
(
!
getToken
())
await
signIn2
();
if
(
!
getToken
())
await
signIn2
();
const
{
type
}
=
options
;
switch
(
type
)
{
case
'0'
:
xma
.
reLaunch
({
url
:
'/pages/assistingAgriculture/index/index'
});
break
;
case
'1'
:
xma
.
reLaunch
({
url
:
'/pages/index/index'
});
xma
.
reLaunch
({
url
:
'/pages/index/index'
});
break
;
case
'2'
:
xma
.
reLaunch
({
url
:
'/pages/assistingAgriculture/index/building?categoryId=3266'
});
break
;
case
'3'
:
xma
.
reLaunch
({
url
:
'/pages/assistingAgriculture/RuralTravel/RuralTravel?categoryId=3268'
});
}
});
onMounted
(
async
()
=>
{
// xma.reLaunch({ url: '/pages/index/index' });
});
});
// 登录
// 登录
...
...
src/pages/storeEntry/detail.vue
View file @
526fd2be
...
@@ -253,8 +253,7 @@ const cardBackwardNull = ref(false);
...
@@ -253,8 +253,7 @@ const cardBackwardNull = ref(false);
const
qualificationsNull
=
ref
(
false
);
const
qualificationsNull
=
ref
(
false
);
// 用户选择的分类
// 用户选择的分类
const
choosedShopInfo
=
ref
([]);
const
choosedShopInfo
=
ref
([]);
// 临时创建的用户选择分类
const
tempChoosedData
=
ref
([]);
// 确保choosedShopInfo内是用户最新选择的分类
// 确保choosedShopInfo内是用户最新选择的分类
const
chooseShopType
=
(
id
,
name
)
=>
{
const
chooseShopType
=
(
id
,
name
)
=>
{
let
hasSameData
=
false
;
let
hasSameData
=
false
;
...
@@ -265,7 +264,6 @@ const chooseShopType = (id, name) => {
...
@@ -265,7 +264,6 @@ const chooseShopType = (id, name) => {
});
});
if
(
!
hasSameData
)
{
if
(
!
hasSameData
)
{
choosedShopInfo
.
value
.
push
({
areaId
:
id
,
areaName
:
name
,
qualifications
:
''
});
choosedShopInfo
.
value
.
push
({
areaId
:
id
,
areaName
:
name
,
qualifications
:
''
});
tempChoosedData
.
value
.
push
(
id
);
}
else
{
}
else
{
choosedShopInfo
.
value
=
choosedShopInfo
.
value
.
filter
((
item
)
=>
{
choosedShopInfo
.
value
=
choosedShopInfo
.
value
.
filter
((
item
)
=>
{
return
item
.
areaId
!==
id
;
return
item
.
areaId
!==
id
;
...
@@ -277,7 +275,7 @@ const chooseShopType = (id, name) => {
...
@@ -277,7 +275,7 @@ const chooseShopType = (id, name) => {
const
beforeRemove
=
({
file
,
fileList
,
resolve
})
=>
{
const
beforeRemove
=
({
file
,
fileList
,
resolve
})
=>
{
xma
.
showModal
({
xma
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
content
:
'确定删除图片
'
+
file
.
name
+
'吗
'
,
content
:
'确定删除图片
吗?
'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
xma
.
showToast
({
title
:
'删除成功'
,
duration
:
2000
});
xma
.
showToast
({
title
:
'删除成功'
,
duration
:
2000
});
...
@@ -489,6 +487,18 @@ const show = ref(false);
...
@@ -489,6 +487,18 @@ const show = ref(false);
// 关闭店铺分类弹出层
// 关闭店铺分类弹出层
const
handleClose
=
()
=>
{
const
handleClose
=
()
=>
{
show
.
value
=
false
;
show
.
value
=
false
;
setTimeout
(()
=>
{
testFileList
.
value
=
choosedShopInfo
.
value
.
reduce
((
obj
,
item
)
=>
{
if
(
item
.
qualifications
===
''
)
{
obj
[
item
.
areaId
]
=
[];
}
else
{
obj
[
item
.
areaId
]
=
[{
url
:
fileDomain
+
item
.
qualifications
}];
}
return
obj
;
},
{});
},
1000
);
};
};
// 原添加的店铺分类个数
// 原添加的店铺分类个数
const
originChooseCategoryLength
=
0
;
const
originChooseCategoryLength
=
0
;
...
...
src/pages/storeEntry/index.vue
View file @
526fd2be
...
@@ -72,7 +72,7 @@ const getList = async () => {
...
@@ -72,7 +72,7 @@ const getList = async () => {
};
};
const
shopGto
=
(
item
)
=>
{
const
shopGto
=
(
item
)
=>
{
xma
.
navigateTo
({
xma
.
navigateTo
({
url
:
`/pages/storeEntry/detail
${
item
?
`?content=
${
JSON
.
stringify
(
item
)
}
`
:
''
}
`
,
url
:
`/pages/storeEntry/detail
${
item
?
`?content=
${
item
}
`
:
''
}
`
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
// 通过eventChannel向被打开页面传送数据
// 通过eventChannel向被打开页面传送数据
res
.
eventChannel
.
emit
(
'acceptDataFromOpenerPage'
,
{
data
:
item
});
res
.
eventChannel
.
emit
(
'acceptDataFromOpenerPage'
,
{
data
:
item
});
...
...
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