Commit 9e6ed057 by wjw

Merge branch 'master' of http://120.77.182.185/yanl/mini-shimao.git into master

parents 339440b6 0050ff0e
......@@ -296,6 +296,12 @@ App({
})
},
/**
* 全局函数 - 设置商店信息
* @function
* @param
* @returns
*/
setShopInfo: function (funcShopAppId, funcShopType) {
for (let i = 0, l = iEnvironmental.shopId.length; i < l; i++) {
if (funcShopAppId === iEnvironmental.shopId[i].appId) {
......@@ -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
let Environmental = 'dev'
let Development = {
host: 'https://sm-web.meiqicloud.com',
// host: 'https://sm-web.meiqicloud.com',
host: 'https://smbhyh-web.meiqicloud.com',
// 景点信息
pointInfo: [
......
......@@ -235,47 +235,100 @@ Page({
* @returns
*/
onBanner: function (event) {
return
let funcItme = event.currentTarget.dataset.item
console.log(funcItme)
if (funcItme.targetId && funcItme.targetType) {
// 0 - 首页,1 - 所有服务,2 - 儿童营地,3 - 海错图,4 - 元养水韵,5 - 儿童营地接待,6 - 拾光花坊, 7 - 商品
switch (funcItme.targetType) {
case 0:
break
// 月卡商品
funcItme.targetId = '94b7a6a7f82845d3a1875ee1e7a033fa'
case 1:
break
// 门票商品
// funcItme.targetId = '0ac170457a8546469976753ea21cd8e9'
case 2:
// 普通商品
// funcItme.targetId = '67fc0c3967e94e9d98fe4c7b1949b084'
break
// 文创商品
// funcItme.targetId = '006a1a3df15e43119103ec34e0bec393'
case 3:
// 餐品
// funcItme.targetId = '329f304aca104ff1887dde5877e15126'
break
case 4:
funcItme.targetType = 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
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
case 6:
case 3:
// 攻略详情
if (funcItme.targetId) {
funcUrl = '/pages/play/strategy-detail/strategy-detail?id=' + funcItme.targetId
wx.navigateTo({
url: funcUrl
})
}
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
}
}
},
/**
* 整合商品数据,输出固定格式
* 三期可将此函数抽出,作为全局函数使用
* @function
* @param {object} - event
* @returns
*/
setCommodityData: function (funcCommodityData) {
},
onBuy: function (event) {
let funcIndex = event.currentTarget.dataset.index
let funcItemIndex = event.currentTarget.dataset.itemindex
......
......@@ -18,7 +18,7 @@ Page({
onNoticeDetail: function (funcItem) {
console.log(funcItem)
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
})
},
......
......@@ -175,7 +175,7 @@
<text>{{activity.amount}}</text>
</view>
<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>
......
......@@ -79,7 +79,7 @@ Page({
authInfo: null,
goodTypeCountData: {},
enrollSubscribeData: {},
isLoadingOrder:true
isLoadingOrder: true
},
// 去活动预约列表
......@@ -189,7 +189,7 @@ Page({
getWillUseOrders() {
let that = this
this.setData({
isLoadingOrder:true
isLoadingOrder: true
})
App.wxRequest({
url: '/api/v1/order/getOrderList',
......@@ -217,11 +217,14 @@ Page({
let listBackUp = JSON.parse(JSON.stringify(list)) //备份数据
let orderList = `myOrder.artOrder.orderList`
// 初始化取一个
if (list.length > 0) {
list.length = 1
}
that.setData({
[orderList]: list,
orderListBackup: listBackUp,
isLoadingOrder:false
isLoadingOrder: false
})
......@@ -432,11 +435,11 @@ Page({
App.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: {
enrollState:2,//待使用
activeState: '1',//""全部 0 未开始 1进行中 2已结束
enrollState: 2, //待使用
activeState: '1', //""全部 0 未开始 1进行中 2已结束
pageSize: -1,
pageNo: 1,
type: 1 ,//0 影片 1 活动
type: 1, //0 影片 1 活动
},
success: function (res) {
let list = res.data.list
......@@ -506,12 +509,15 @@ Page({
// 二期代码
onOrder: function () {
let funcUserInfo = wx.getStorageSync('userInfo')
if (!funcUserInfo.isSignIn) return
wx.navigateTo({
url: '/pages/mine/order/order'
})
},
onAppointment: function () {
let funcUserInfo = wx.getStorageSync('userInfo')
if (!funcUserInfo.isSignIn) return
wx.navigateTo({
url: '/pages/mine/appointment/appointment'
})
......
......@@ -207,7 +207,7 @@
</view>
</view>
<!-- 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:else>收起</text>
<image wx:if="{{!showMoreOrder}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
......
const App = getApp()
Page({
// 此处属性是页面全局属性,通常用于记录不进行渲染的逻辑数据,避免过多 setData 操作。
option: {},
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
......
{
"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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment