Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9e6ed057
authored
Sep 25, 2020
by
wjw
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://120.77.182.185/yanl/mini-shimao.git
into master
parents
339440b6
0050ff0e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
258 additions
and
33 deletions
app.js
environmental.js
pages/commodity/project/project.js
pages/home/dynamic/dynamic.js
pages/mine/appointment/appointment.wxml
pages/mine/home/home.js
pages/mine/home/home.wxml
pages/play/home/home.js
project.config.json
app.js
View file @
9e6ed057
...
@@ -296,6 +296,12 @@ App({
...
@@ -296,6 +296,12 @@ App({
})
})
},
},
/**
* 全局函数 - 设置商店信息
* @function
* @param
* @returns
*/
setShopInfo
:
function
(
funcShopAppId
,
funcShopType
)
{
setShopInfo
:
function
(
funcShopAppId
,
funcShopType
)
{
for
(
let
i
=
0
,
l
=
iEnvironmental
.
shopId
.
length
;
i
<
l
;
i
++
)
{
for
(
let
i
=
0
,
l
=
iEnvironmental
.
shopId
.
length
;
i
<
l
;
i
++
)
{
if
(
funcShopAppId
===
iEnvironmental
.
shopId
[
i
].
appId
)
{
if
(
funcShopAppId
===
iEnvironmental
.
shopId
[
i
].
appId
)
{
...
@@ -307,4 +313,62 @@ App({
...
@@ -307,4 +313,62 @@ App({
}
}
}
}
},
},
/**
* 全局函数 - 设置商品信息
* @function
* @param {object} - { commodity: '商品数据对象', complete: '回调函数' }
* @returns
*/
setCommodityInfo
:
function
(
funcInfoRaw
)
{
// 特殊数据格式化
switch
(
Number
(
funcInfoRaw
.
genre
))
{
case
1
:
funcInfoRaw
.
number
=
funcInfoRaw
.
inventorie
[
0
].
number
funcInfoRaw
.
cardName
=
funcInfoRaw
.
inventorie
[
0
].
cardName
funcInfoRaw
.
ownerPrice
=
funcInfoRaw
.
inventorie
[
0
].
ownerPrice
funcInfoRaw
.
cardId
=
funcInfoRaw
.
inventorie
[
0
].
cardId
funcInfoRaw
.
sightseerPrice
=
funcInfoRaw
.
inventorie
[
0
].
sightseerPrice
funcInfoRaw
.
cardNam
=
funcInfoRaw
.
inventorie
[
0
].
cardNam
funcInfoRaw
.
inventoriesId
=
funcInfoRaw
.
inventorie
[
0
].
inventoriesId
break
}
// 商品通用属性设置
let
funcInfo
=
{
'id'
:
funcInfoRaw
.
id
,
'typeId'
:
funcInfoRaw
.
genre
,
// 分类
'name'
:
funcInfoRaw
.
name
,
// 名称
'cover'
:
funcInfoRaw
.
ticketsImg
,
// 封面
'notificationId'
:
funcInfoRaw
.
notificationId
,
// 购买须知
'priceType'
:
1
,
// 当前用户身份享受价格类型
'price'
:
funcInfoRaw
.
sightseerPrice
,
// 普通价
'priceText'
:
this
.
modular
.
utils
.
formatAmount
(
funcInfoRaw
.
sightseerPrice
),
// 普通价文本格式
'priceSpecial'
:
funcInfoRaw
.
ownerPrice
,
// 业主价
'priceSpecialText'
:
this
.
modular
.
utils
.
formatAmount
(
funcInfoRaw
.
ownerPrice
),
// 业主价文本格式
'priceDiscount'
:
funcInfoRaw
.
price
,
// 活动价
'priceDiscountText'
:
this
.
modular
.
utils
.
formatAmount
(
funcInfoRaw
.
price
),
// 活动价文本格式
'inventoriesId'
:
funcInfoRaw
.
inventoriesId
,
'dateValid'
:
this
.
modular
.
miment
().
format
(
'YYYY.MM.DD'
),
// 有效时间
'dateInvalid'
:
funcInfoRaw
.
cardNam
,
// 失效时间
}
let
funcUserType
=
wx
.
getStorageSync
(
'userInfo'
).
userType
// 根据后台判断价格显示类型
// 活动价优先级最高,如果存在活动价,则只显示活动价和普通价
if
(
funcInfo
.
priceDiscount
||
funcInfo
.
priceDiscount
===
0
)
{
funcInfo
.
priceType
=
1
}
else
{
// 活动价不存在,进一步判断普通价与业主价是否一致,如果不一致,则显示两者
if
(
funcInfo
.
price
!==
funcInfo
.
priceSpecial
&&
funcUserType
)
{
funcInfo
.
priceType
=
2
}
else
{
funcInfo
.
priceType
=
3
}
}
return
funcInfo
},
})
})
\ No newline at end of file
environmental.js
View file @
9e6ed057
let
Environmental
=
'dev'
let
Environmental
=
'dev'
let
Development
=
{
let
Development
=
{
host
:
'https://sm-web.meiqicloud.com'
,
// host: 'https://sm-web.meiqicloud.com',
host
:
'https://smbhyh-web.meiqicloud.com'
,
// 景点信息
// 景点信息
pointInfo
:
[
pointInfo
:
[
...
...
pages/commodity/project/project.js
View file @
9e6ed057
...
@@ -235,47 +235,100 @@ Page({
...
@@ -235,47 +235,100 @@ Page({
* @returns
* @returns
*/
*/
onBanner
:
function
(
event
)
{
onBanner
:
function
(
event
)
{
return
let
funcItme
=
event
.
currentTarget
.
dataset
.
item
let
funcItme
=
event
.
currentTarget
.
dataset
.
item
console
.
log
(
funcItme
)
if
(
funcItme
.
targetId
&&
funcItme
.
targetType
)
{
// 月卡商品
// 0 - 首页,1 - 所有服务,2 - 儿童营地,3 - 海错图,4 - 元养水韵,5 - 儿童营地接待,6 - 拾光花坊, 7 - 商品
funcItme
.
targetId
=
'94b7a6a7f82845d3a1875ee1e7a033fa'
switch
(
funcItme
.
targetType
)
{
case
0
:
break
case
1
:
break
// 门票商品
// funcItme.targetId = '0ac170457a8546469976753ea21cd8e9'
case
2
:
// 普通商品
// funcItme.targetId = '67fc0c3967e94e9d98fe4c7b1949b084'
break
// 文创商品
// funcItme.targetId = '006a1a3df15e43119103ec34e0bec393'
case
3
:
// 餐品
// funcItme.targetId = '329f304aca104ff1887dde5877e15126'
break
funcItme
.
targetType
=
4
case
4
:
let
funcUrl
=
''
if
(
funcItme
.
targetType
)
{
switch
(
funcItme
.
targetType
)
{
case
1
:
// 活动
if
(
funcItme
.
targetId
)
{
funcUrl
=
'/pages/play/activity-detail/activity-detail?id='
+
funcItme
.
targetId
}
else
{
funcUrl
=
'/pages/play/activity/activity'
}
wx
.
navigateTo
({
url
:
funcUrl
})
break
break
case
5
:
case
2
:
// 动态
if
(
funcItme
.
targetId
)
{
funcUrl
=
'/pages/home/dynamic-detail/dynamic-detail?id='
+
funcItme
.
targetId
}
else
{
funcUrl
=
'/pages/home/dynamic/dynamic'
}
wx
.
navigateTo
({
url
:
funcUrl
})
break
break
case
6
:
case
3
:
// 攻略详情
if
(
funcItme
.
targetId
)
{
funcUrl
=
'/pages/play/strategy-detail/strategy-detail?id='
+
funcItme
.
targetId
wx
.
navigateTo
({
url
:
funcUrl
})
}
break
break
case
7
:
case
4
:
// 商品
// 跳转商品下单,需要查询商品参数
App
.
wxRequest
({
url
:
'/api/v1/commodity/getCommodityParticulars'
,
data
:
{
'commodityId'
:
funcItme
.
targetId
},
success
:
(
response
)
=>
{
console
.
log
(
response
)
console
.
log
(
App
.
setCommodityInfo
(
response
.
data
))
}
})
// if (funcItme.targetId) {
// funcUrl = '/pages/pay/order-input/order-input?type=' + funcItme.targetId
// wx.navigateTo({
// url: funcUrl
// })
// }
break
break
}
}
}
}
},
},
/**
* 整合商品数据,输出固定格式
* 三期可将此函数抽出,作为全局函数使用
* @function
* @param {object} - event
* @returns
*/
setCommodityData
:
function
(
funcCommodityData
)
{
},
onBuy
:
function
(
event
)
{
onBuy
:
function
(
event
)
{
let
funcIndex
=
event
.
currentTarget
.
dataset
.
index
let
funcIndex
=
event
.
currentTarget
.
dataset
.
index
let
funcItemIndex
=
event
.
currentTarget
.
dataset
.
itemindex
let
funcItemIndex
=
event
.
currentTarget
.
dataset
.
itemindex
...
...
pages/home/dynamic/dynamic.js
View file @
9e6ed057
...
@@ -18,7 +18,7 @@ Page({
...
@@ -18,7 +18,7 @@ Page({
onNoticeDetail
:
function
(
funcItem
)
{
onNoticeDetail
:
function
(
funcItem
)
{
console
.
log
(
funcItem
)
console
.
log
(
funcItem
)
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'/pages/
notice-detail/notice
-detail?id='
+
funcItem
.
currentTarget
.
dataset
.
id
url
:
'/pages/
home/dynamic-detail/dynamic
-detail?id='
+
funcItem
.
currentTarget
.
dataset
.
id
})
})
},
},
...
...
pages/mine/appointment/appointment.wxml
View file @
9e6ed057
...
@@ -175,7 +175,7 @@
...
@@ -175,7 +175,7 @@
<text>{{activity.amount}}</text>
<text>{{activity.amount}}</text>
</view>
</view>
<view class="appointment-activity-btn row">
<view class="appointment-activity-btn row">
<view data-item="{{activity}}" data-type='1' catchtap="doCancel" class="cancel-btn ">删除报名
<view
style="position:relative;z-index:8"
data-item="{{activity}}" data-type='1' catchtap="doCancel" class="cancel-btn ">删除报名
</view>
</view>
</view>
</view>
</view>
</view>
...
...
pages/mine/home/home.js
View file @
9e6ed057
...
@@ -79,7 +79,7 @@ Page({
...
@@ -79,7 +79,7 @@ Page({
authInfo
:
null
,
authInfo
:
null
,
goodTypeCountData
:
{},
goodTypeCountData
:
{},
enrollSubscribeData
:
{},
enrollSubscribeData
:
{},
isLoadingOrder
:
true
isLoadingOrder
:
true
},
},
// 去活动预约列表
// 去活动预约列表
...
@@ -189,7 +189,7 @@ Page({
...
@@ -189,7 +189,7 @@ Page({
getWillUseOrders
()
{
getWillUseOrders
()
{
let
that
=
this
let
that
=
this
this
.
setData
({
this
.
setData
({
isLoadingOrder
:
true
isLoadingOrder
:
true
})
})
App
.
wxRequest
({
App
.
wxRequest
({
url
:
'/api/v1/order/getOrderList'
,
url
:
'/api/v1/order/getOrderList'
,
...
@@ -217,11 +217,14 @@ Page({
...
@@ -217,11 +217,14 @@ Page({
let
listBackUp
=
JSON
.
parse
(
JSON
.
stringify
(
list
))
//备份数据
let
listBackUp
=
JSON
.
parse
(
JSON
.
stringify
(
list
))
//备份数据
let
orderList
=
`myOrder.artOrder.orderList`
let
orderList
=
`myOrder.artOrder.orderList`
list
.
length
=
1
// 初始化取一个
if
(
list
.
length
>
0
)
{
list
.
length
=
1
}
that
.
setData
({
that
.
setData
({
[
orderList
]:
list
,
[
orderList
]:
list
,
orderListBackup
:
listBackUp
,
orderListBackup
:
listBackUp
,
isLoadingOrder
:
false
isLoadingOrder
:
false
})
})
...
@@ -432,11 +435,11 @@ Page({
...
@@ -432,11 +435,11 @@ Page({
App
.
wxRequest
({
App
.
wxRequest
({
url
:
'/api/v1/activity/getMyActivityList'
,
url
:
'/api/v1/activity/getMyActivityList'
,
data
:
{
data
:
{
enrollState
:
2
,
//待使用
enrollState
:
2
,
//待使用
activeState
:
'1'
,
//""全部 0 未开始 1进行中 2已结束
activeState
:
'1'
,
//""全部 0 未开始 1进行中 2已结束
pageSize
:
-
1
,
pageSize
:
-
1
,
pageNo
:
1
,
pageNo
:
1
,
type
:
1
,
//0 影片 1 活动
type
:
1
,
//0 影片 1 活动
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
let
list
=
res
.
data
.
list
let
list
=
res
.
data
.
list
...
@@ -506,12 +509,15 @@ Page({
...
@@ -506,12 +509,15 @@ Page({
// 二期代码
// 二期代码
onOrder
:
function
()
{
onOrder
:
function
()
{
let
funcUserInfo
=
wx
.
getStorageSync
(
'userInfo'
)
if
(
!
funcUserInfo
.
isSignIn
)
return
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'/pages/mine/order/order'
url
:
'/pages/mine/order/order'
})
})
},
},
onAppointment
:
function
()
{
onAppointment
:
function
()
{
let
funcUserInfo
=
wx
.
getStorageSync
(
'userInfo'
)
if
(
!
funcUserInfo
.
isSignIn
)
return
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'/pages/mine/appointment/appointment'
url
:
'/pages/mine/appointment/appointment'
})
})
...
...
pages/mine/home/home.wxml
View file @
9e6ed057
...
@@ -207,7 +207,7 @@
...
@@ -207,7 +207,7 @@
</view>
</view>
</view>
</view>
<!-- more -->
<!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreOrder" wx:if="{{!isLoadingOrder}}">
<view class="more row align-c con-c" bindtap="onShowMoreOrder" wx:if="{{!isLoadingOrder
&&orderListBackup.length>1
}}">
<text wx:if="{{!showMoreOrder}}">展开更多</text>
<text wx:if="{{!showMoreOrder}}">展开更多</text>
<text wx:else>收起</text>
<text wx:else>收起</text>
<image wx:if="{{!showMoreOrder}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
<image wx:if="{{!showMoreOrder}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
...
...
pages/play/home/home.js
View file @
9e6ed057
const
App
=
getApp
()
const
App
=
getApp
()
Page
({
Page
({
// 此处属性是页面全局属性,通常用于记录不进行渲染的逻辑数据,避免过多 setData 操作。
option
:
{},
data
:
{
data
:
{
imageBase
:
App
.
globalData
.
appImageBase
,
imageBase
:
App
.
globalData
.
appImageBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
resourcesBase
:
App
.
globalData
.
appResourcesBase
,
...
...
project.config.json
0 → 100644
View file @
9e6ed057
{
"description"
:
"项目配置文件"
,
"packOptions"
:
{
"ignore"
:
[]
},
"setting"
:
{
"urlCheck"
:
true
,
"es6"
:
true
,
"enhance"
:
true
,
"postcss"
:
true
,
"minified"
:
true
,
"newFeature"
:
true
,
"coverView"
:
true
,
"nodeModules"
:
true
,
"autoAudits"
:
false
,
"showShadowRootInWxmlPanel"
:
true
,
"scopeDataCheck"
:
false
,
"uglifyFileName"
:
false
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
false
,
"uploadWithSourceMap"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
}
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.10.0"
,
"appid"
:
"wx37a9b7a3d92029f2"
,
"projectname"
:
"%E4%B8%96%E8%8C%82%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%BA%8C%E6%9C%9F"
,
"cloudfunctionTemplateRoot"
:
""
,
"watchOptions"
:
{
"ignore"
:
[]
},
"debugOptions"
:
{
"hidedInDevtools"
:
[]
},
"scripts"
:
{},
"simulatorType"
:
"wechat"
,
"simulatorPluginLibVersion"
:
{},
"condition"
:
{
"search"
:
{
"current"
:
-1
,
"list"
:
[]
},
"conversation"
:
{
"current"
:
-1
,
"list"
:
[]
},
"plugin"
:
{
"current"
:
-1
,
"list"
:
[]
},
"game"
:
{
"list"
:
[]
},
"gamePlugin"
:
{
"current"
:
-1
,
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
-1
,
"list"
:
[
{
"id"
:
-1
,
"name"
:
"pages/commodity/menu-food/menu-food"
,
"pathName"
:
"pages/commodity/menu-food/menu-food"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/play/home/home"
,
"pathName"
:
"pages/play/home/home"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/play/service-detail/service-detail"
,
"pathName"
:
"pages/play/service-detail/service-detail"
,
"query"
:
"id=1&type=4"
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/mine/home/home"
,
"pathName"
:
"pages/mine/home/home"
,
"query"
:
""
,
"scene"
:
null
}
]
}
}
}
\ No newline at end of file
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