Commit 7497e403 by 前端

找车位

1 parent 2dcfe552
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 4
let index = 2
/**
*
......@@ -102,7 +102,8 @@ const pathEnum = {
sop: '/rop-scrm-sop/',
customercollect: '/rop-scrm-bigdatautil/',
drac: '/rop-scrm-entmicro/',
busassistant: '/rop-scrm-busassistant/'
busassistant: '/rop-scrm-busassistant/',
charge: '/rop-scrm-marketing/'
}
const defaultMerchantId = {
ip: '44211227',
......
......@@ -24,7 +24,8 @@
"selectedColor": "#3772EC",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [{
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "assets/images/home.png",
......@@ -56,7 +57,8 @@
}
]
},
"subpackages": [{
"subpackages": [
{
"root": "packageIndex",
"pages": [
"pages/carLife/index",
......@@ -162,7 +164,9 @@
"pages/receiveRed/receiveRed",
"pages/package/package",
"pages/success/success",
"pages/packageDetail/packageDetail"
"pages/packageDetail/packageDetail",
"pages/parking/index/index",
"pages/parking/detail/detail"
]
},
{
......@@ -181,7 +185,7 @@
"popup": "/components/Popup/Popup",
"goods-action": "/components/GoodsAction/GoodsAction",
"stepper": "/components/Stepper/Stepper",
"store-select":"/components/Store/index"
"store-select": "/components/Store/index"
},
"resolveAlias": {
"~/*": "/*"
......
Page({
/**
* 页面的初始数据
*/
data: {
current: 0,
show: false,
currentDate: new Date().getTime(),
minDate: new Date().getTime(),
vertical: false,
autoplay: true,
interval: 5000,
duration: 500
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { id } = options
wx.p.api.equityApi.parkingSpaceDetail({ parkingSpaceId: id }).then(res => {
this.setData({ detailInfo: res })
})
},
startTimeChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
startTime: e.detail.value
})
},
endTimeChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
endTime: e.detail.value
})
},
showTime(e) {
const { type } = e.currentTarget.dataset, { startTime, endTime } = this.data
this.setData({ show: true, type, currentDate: new Date(type == 1 ? startTime : endTime).getTime() })
},
cancel() {
this.setData({ show: false })
},
onChange(e) {
const current = e.detail.current;
this.setData({
current
})
},
confirm(event) {
const time = this.data.type == 1 ? 'startTime' : 'endTime'
this.setData({
[time]: new Date(event.detail).format('yyyy-MM-dd hh:mm')
});
this.cancel()
},
handleCancel() {
wx.p.router.back()
},
handleSure() {
wx.requestSubscribeMessage({
tmplIds: ['ctivVQAIoDzv1OKlcI9cXiJpyKZBUP1XamO8sBP8ij0'],
miniprogram_state: wx.getAccountInfoSync().miniProgram.envVersion == 'trial'?'trial':'formal',
success(res) {
}
})
let { detailInfo, startTime, endTime } = this.data
if (!startTime) {
wx.showToast({
title: '请选择开始时间',
icon: 'none'
})
return
}
if (!endTime) {
wx.showToast({
title: '请选择结束时间',
icon: 'none'
})
return
}
wx.p.api.equityApi.parkingSpaceSubscribe({
parkingSpaceId: detailInfo.id,
subscribeStartTime: startTime + ':00',
subscribeEndTime: endTime + ':00'
}).then(res => {
wx.requestSubscribeMessage({
tmplIds: ['ctivVQAIoDzv1OKlcI9cXiJpyKZBUP1XamO8sBP8ij0'],
success(res) {
}
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "车位详情",
"usingComponents": {
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-popup": "@vant/weapp/popup/index"
}
}
\ No newline at end of file
/* packageEquity/pages/parking/detail/detail.wxss */
.box {
margin: 0rpx 30rpx;
}
.swiper-box {
position: relative;
.tip {
position: absolute;
width: 72rpx;
height: 40rpx;
opacity: 0.5;
background: #1B233D;
border-radius: 24rpx;
right: 20rpx;
bottom: 20rpx;
color: #fff;
text-align: center;
line-height: 40rpx;
}
}
swiper {
height: 50vh;
}
.empty-box {
height: 50vh;
.empty-img {
width: 100%;
height: 50vh;
}
}
.swiper-item {
width: 100%;
height: 100%;
}
.location-box,
.remind-box {
background: #ffffff;
padding: 24rpx;
margin-bottom: 30rpx;
}
.location-num {
font-weight: 600;
font-size: 32rpx;
color: #333333;
display: flex;
.parking-logo {
width: 48rpx;
height: 48rpx;
margin-right: 6rpx;
}
}
.location-status {
margin-top: 10rpx;
text {
margin-left: 10rpx;
display: inline-block;
width: 64rpx;
height: 32rpx;
border-radius: 4rpx;
text-align: center;
line-height: 32rpx;
font-size: 22rpx;
&.idle {
color: #3772EC;
background: #3772ec1a;
border: 1rpx solid #3772ec33;
}
&.occupy {
color: #EC3C1F;
background: #ec3c1f1a;
border: 1rpx solid #ec3c1f33;
}
&.unknown {
color: #999999;
border: 1rpx solid #99999933;
border-radius: 4rpx;
}
}
}
.remind-title {
font-size: 30rpx;
color: #333333;
font-weight: 600;
}
.remind-desc {
font-size: 26rpx;
color: #999999;
margin: 10rpx 0rpx;
}
.time-box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 40rpx;
.picker {
width: 284rpx;
height: 104rpx;
background: #F8F8F8;
border-radius: 8rpx;
text-align: center;
line-height: 104rpx;
font-size: 26rpx;
color: #999999;
}
text {
margin: 24rpx;
font-size: 26rpx;
color: #999999;
}
}
.footer-box {
position: fixed;
bottom: 0rpx;
left: 0rpx;
height: 156rpx;
background: #FFFFFF;
padding: 20rpx 30rpx;
display: flex;
justify-content: center;
.cancel-btn {
width: 334rpx;
height: 88rpx;
background: #FFFFFF;
border: 2rpx solid #D9D9D9;
border-radius: 48rpx;
font-size: 32rpx;
color: #333333;
text-align: center;
line-height: 88rpx;
}
.sure-btn {
width: 334rpx;
height: 88rpx;
background: #3772EC;
border-radius: 48rpx;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 88rpx;
margin-left: 20rpx;
}
}
\ No newline at end of file
<view class="box">
<view class="swiper-box" wx:if="{{detailInfo.parkingStatus == 2}}">
<swiper circular bindchange="onChange" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{detailInfo.parkingSpaceImgList}}" wx:key="*this">
<swiper-item>
<view class="swiper-item">
<image src="{{item.url}}" mode="" />
</view>
</swiper-item>
</block>
</swiper>
<view class="tip">{{current+1}}/{{detailInfo.parkingSpaceImgList.length}}</view>
</view>
<block wx:else>
<view class="empty-box">
<view class="empty-img"><glsx-image webp src="home/parking/empty-p.png"></glsx-image></view>
</view>
</block>
<view class="location-box">
<view class="location-num">
<view class="parking-logo">
<glsx-image webp src="home/parking/{{detailInfo.parkingStatus == 1?'idle':detailInfo.parkingStatus == 2?'occupy':'unknown'}}.png" class="parking-logo"></glsx-image>
</view>
<text> {{detailInfo.parkingArea}}-{{detailInfo.parkingBuilding}}-{{detailInfo.parkingFloor}}</text>
</view>
<view class="location-status">
车位状态<text class="{{detailInfo.parkingStatus == 1?'idle':detailInfo.parkingStatus == 2?'occupy':'unknown'}}">{{detailInfo.parkingStatusStr}}</text>
</view>
</view>
<view class="remind-box" wx:if="{{detailInfo.parkingStatus == 2}}">
<view class="remind-title">
车位空闲提醒
</view>
<view class="remind-desc">
在所选时间段内车位空闲将收到提醒通知
</view>
<view class="time-box">
<view class="picker" bind:tap="showTime" data-type="1">
{{startTime?startTime:'起始时间'}}
</view>
<text>至</text>
<view class="picker" bind:tap="showTime" data-type="2">
{{endTime?endTime:'结束时间'}}
</view>
</view>
</view>
<van-popup show="{{show}}" position="bottom" custom-style="height: 50%;" bind:close="onClose">
<van-datetime-picker min-date="{{ minDate }}" bind:cancel="cancel" bind:confirm="confirm" type="datetime" value="{{ currentDate }}" />
</van-popup>
<view class="footer-box" wx:if="{{detailInfo.parkingStatus == 2}}">
<view class="cancel-btn" bind:tap="handleCancel">取消</view>
<view class="sure-btn" bind:tap="handleSure">确认</view>
</view>
</view>
\ No newline at end of file
var includes = function (array, searchElement) {
return array.indexOf(searchElement) !== -1
}
module.exports = {
includes: includes
}
\ No newline at end of file
// packageEquity/pages/parking/index/index.js
const STATUS = [{
label: '空闲', value: 1,name:'idleStatusCount'
},
{
label: '占用', value: 2,name:'occupyStatusCount'
},
{
label: '未知', value: 0,name:'unknowStatusCount'
}
]
Page({
/**
* 页面的初始数据
*/
data: {
isRotate:false,
boxHeight: 456,
scale:16,
markers: [],
STATUS,
tabIndex: [1],
customCalloutMarkerIds: [],
num: 1,
},
pullH() {
const {boxHeight} = this.data
this.setData({boxHeight: boxHeight == 850?456:850})
},
getCarPosition(latitude, longitude) {
const normalCallout = {
id: 0,
latitude,
longitude,
width: 32,
height: 32,
iconPath: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/home/parking/location.png',
}
const {markers} = this.data
this.setData({
latitude, longitude,
markers: [normalCallout,...markers],
})
},
handleRefresh() {
this.parkingSpaceList()
this.setData({isRotate:true})
setTimeout(()=>{
this.setData({isRotate:false})
},1000)
},
getAllParking() {
wx.p.api.equityApi.parkingSpaceList({ locateFlag: 1 }).then(res => {
const normalCallout = [], list = res.responseList || [];
list.forEach((item, index) => {
normalCallout.push({
id: item.id,
latitude: item.parkingAddressLat,
longitude: item.parkingAddressLng,
width: 32,
height: 32,
iconPath: `https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/home/parking/${item.parkingStatus == 1 ? 'idle' : item.parkingStatus == 2 ? 'occupy' : 'unknown'}.png`,
callout: {
content: `车位编号${item.parkingArea}-${item.parkingBuilding}-${item.parkingFloor} >`,
color: '#666',
fontSize: 10,
borderWidth: 1,
borderRadius:22,
borderColor: '#FFFFFF',
padding: 6,
display: 'BYCLICK',
textAlign: 'center'
},
})
})
const {markers} = this.data
this.setData({ markers: [...normalCallout,...markers],parking:res,isEmpty:normalCallout.length })
})
},
parkingSpaceList() {
let { tabIndex } = this.data
wx.p.api.equityApi.parkingSpaceList({ locateFlag: 1, parkingStatusList: tabIndex }).then(res => {
const list = res.responseList || [];
this.setData({ carList: list })
})
},
/**
* 点击冒泡
*/
callouttap(e) {
wx.p.router.go('/packageEquity/pages/parking/detail/detail', { id:e.markerId })
},
tolower() {
console.log(88)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.parkingSpaceList()
this.getAllParking()
wx.getLocation({
type: 'wgs84',
success: res => {
this.getCarPosition(res.latitude, res.longitude)
}
})
},
controltap(e) {
// 创建 map 上下文 MapContext 对象。建议使用 wx.createSelectorQuery 获取 context 对象
// 获取地图,map要与wxml页面的id名一致。注意:不需要#符号
let mpCtx = wx.createMapContext('myMap')
// 将地图中心移置当前定位点,此时需设置地图组件 show-location 为true。'2.8.0' 起支持将地图中心移动到指定位置。
mpCtx.moveToLocation()
console.log(mpCtx)
// 将地图缩放值改为初始值
this.setData({
scale: 16
})
},
markertap(e) {
},
selectTab(e) {
[1,2,3].indexOf(3)
const { index } = e.currentTarget.dataset,{tabIndex} = this.data,k = tabIndex.indexOf(index)
if (k<0) {
tabIndex.push(index)
}else {
tabIndex.splice(k,1)
}
this.setData({ tabIndex }, () => {
this.parkingSpaceList()
})
},
jump(e) {
const { id } = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/parking/detail/detail', { id })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "找车位"
}
\ No newline at end of file
/* packageEquity/pages/parking/index/index.wxss */
.map-box {
height: 100vh;
overflow: hidden;
}
#myMap {
width: 100%;
position: relative;
}
.draw-box {
width: 100%;
height: 456rpx;
transition: all ease 1s;
}
.cover-view {
width: 64rpx;
height: 64rpx;
position: absolute;
bottom: 20rpx;
right: 20rpx;
}
.draw-tab {
display: flex;
margin: 20rpx;
align-items: center;
.tab-item {
width: 160rpx;
height: 60rpx;
line-height: 60rpx;
background: #FFFFFF;
border: 2rpx solid #D9D9D9;
border-radius: 30rpx;
font-size: 26rpx;
color: #333333;
text-align: center;
margin-right: 10rpx;
&.checked {
background: rgba(55, 114, 236, 0.1);
border: 2rpx solid #3772EC;
color: #3772EC;
}
}
.tab-btn {
font-size: 28rpx;
color: #5878DB;
margin-left: auto;
display: flex;
align-items: center;
.parking-refresh {
width: 32rpx;
height: 32rpx;
margin-left: 4rpx;
margin-top: 2px;
&.rotate {
transition: all 1s;
transform: rotate(360deg);
}
}
}
}
.draw-header {
height: 56px;
background-image: linear-gradient(180deg, #D6E8FE 0%, #F8F8F8 100%);
border-radius: 16px 16px 0 0;
display: flex;
align-items: center;
padding: 0rpx 24rpx;
position: relative;
.parking-arrow-icon {
position: absolute;
width: 72rpx;
height: 25rpx;
left: 350rpx;
top: 10rpx;
z-index: 10000;background: #FFFFFF;
}
.parking-logo {
width: 56rpx;
height: 56rpx;
}
.parking-desc {
font-size: 32rpx;
color: #333333;
text {
color: #3772EC;
font-weight: 600;
}
}
.parking-btn {
margin-left: auto;
font-size: 28rpx;
color: #5878DB;
}
}
.draw-body {
background: #F8F8F8;
height: calc(100% - 200rpx);
overflow-y: auto;
}
.customCallout-box {
width: 408rpx;
height: 88rpx;
background: #FFFFFF;
box-shadow: 0 4rpx 20rpx 0 rgba(147, 149, 153, 0.3);
border-radius: 44rpx;
}
.car-item {
width: 345px;
height: 60px;
background: #FFFFFF;
border-radius: 4px;
margin: 10rpx auto;
display: flex;
align-items: center;
padding: 0rpx 24rpx;
.parking-logo {
width: 44rpx;
height: 44rpx;
margin-right: 6rpx;
}
.parking-desc {
.parking-num {
font-size: 28rpx;
color: #333333;
line-height: 44rpx;
margin-bottom: 10rpx;
}
.parking-status {
width: 64rpx;
height: 32rpx;
border-radius: 4rpx;
text-align: center;
line-height: 32rpx;
font-size: 22rpx;
&.idle {
color: #3772EC;
background: #3772ec1a;
border: 1rpx solid #3772ec33;
}
&.occupy {
color: #EC3C1F;
background: #ec3c1f1a;
border: 1rpx solid #ec3c1f33;
}
&.unknown {
color: #999999;
border: 1rpx solid #99999933;
border-radius: 4rpx;
}
}
}
.parking-btn {
width: 132rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 26rpx;
color: #3772EC;
border: 2rpx solid #3772EC;
border-radius: 30rpx;
text-align: center;
margin-left: auto;
}
}
.empty-box {
.empty-header {
width: 750rpx;
height: 112rpx;
background-image: linear-gradient(180deg, #D6E8FE 0%, #F8F8F8 100%);
border-radius: 32rpx 32rpx 0 0;
}
.empty-text {
text-align: center;
color: #999999;
text-align: center;
}
.empty-body {
width: 320rpx;
height: 320rpx;
margin: -50rpx auto -10rpx;
}
}
\ No newline at end of file
<wxs module="jstools" src="includes.wxs"></wxs>
<view class="map-box">
<map id="myMap" style="height:calc(100vh - {{boxHeight}}rpx)" latitude="{{latitude}}" longitude="{{longitude}}" bindmarkertap="markertap" bindcallouttap="callouttap" bindlabeltap="labeltap" markers="{{markers}}" scale="{{scale}}">
<cover-view class="cover-view" bindtap="controltap">
<cover-image class="station" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/home/parking/position.png"></cover-image>
</cover-view>
</map>
<view class="draw-box" style="height: {{boxHeight}}rpx;">
<block wx:if="{{isEmpty}}">
<view class="draw-header">
<view class="parking-arrow-icon" catch:tap="pullH">
</view>
<view class="parking-logo">
<glsx-image webp src="home/parking/stop.png" class="parking-logo"></glsx-image>
</view>
<view class="parking-desc">当前剩余空闲车位: <text>{{parking.idleStatusCount}}</text></view>
</view>
<view class="draw-tab">
<view class="tab-item {{jstools.includes(tabIndex,item.value)?'checked':''}}" data-index="{{item.value}}" bind:tap="selectTab" wx:for="{{STATUS}}">{{item.label}}({{parking[item.name]}})</view>
<view class="tab-btn" bindtap="handleRefresh">刷新<view class="parking-refresh {{isRotate?'rotate':''}}">
<glsx-image webp src="home/parking/refresh.png"></glsx-image>
</view>
</view>
</view>
<view class="draw-body">
<view class="car-item" wx:for="{{carList}}" wx:key="index">
<view class="parking-logo">
<glsx-image webp src="home/parking/{{item.parkingStatus == 1?'idle':item.parkingStatus == 2?'occupy':'unknown'}}.png" class="parking-logo"></glsx-image>
</view>
<view class="parking-desc">
<view class="parking-num">
{{item.parkingArea}}-{{item.parkingBuilding}}-{{item.parkingFloor}}
</view>
<view class="parking-status {{item.parkingStatus == 1?'idle':item.parkingStatus == 2?'occupy':'unknown'}}">
{{item.parkingStatusStr}}
</view>
</view>
<view class="parking-btn" bind:tap="jump" data-id="{{item.id}}">详情</view>
</view>
</view>
</block>
<block wx:else>
<view class="empty-box">
<view class="empty-header"></view>
<view class="empty-body">
<glsx-image webp src="home/parking/empty.png"></glsx-image>
</view>
<view class="empty-text">暂无车位</view>
</view>
</block>
</view>
</view>
\ No newline at end of file
......@@ -2,125 +2,131 @@ import { env } from '~/api/env/index'
import { goodsList } from '../constant/lifeConstant'
Page({
/**
* 页面的初始数据
*/
data: {
tripMenu: [],
goodsList,
utilList: []
},
/**
* 页面的初始数据
*/
data: {
tripMenu: [],
goodsList,
utilList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const {
merchantId
} = wx.p.storage.get('merchant_info')
this.getHomeConfig(merchantId)
this.getAllMerchantList()
},
getHomeConfig(merchantId) {
wx.p.api.homeApi.getHomeConfig({ merchantId }).then(data => {
wx.hideLoading();
let utilList = []
if (data.clueList && data.clueList.length) {
data.clueList.map(e => {
if (e.clueId == 1) {
let rescueTypeList = [
{
confId: 5,
name: '事故救援',
iconUrl: 'accident_rescue_icon',
sign: '免费'
},
{
confId: 3,
name: '送油',
iconUrl: 'send_oil_icon'
},
{
confId: 4,
name: '搭电',
iconUrl: 'pick_up_power_icon'
},
{
confId: 2,
name: '换胎',
iconUrl: 'trie_change_icon'
},
{
confId: 0,
name: '紧急脱困',
iconUrl: 'emergency_relief_icon',
},
{
confId: 1,
name: '拖车',
iconUrl: 'trailer_icon'
},
]
rescueTypeList.forEach(v => {
utilList.push({
...v,
url: '/packageEquity/pages/road/index/index'
})
})
}
})
}
this.setData({
utilList
})
})
},
getAllMerchantList() {
const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = {
merchantId
}
wx.p.api.equityApi.getAllEquity(para).then(res => {
const carList = res.carServiceList
const equityList = res.goodsServiceList
let tripMenu = []
const needShowEquity = ['高德打车','曹操出行']
if (env == 'production') {
equityList.forEach(el => {
if (el.goodsCategory == '交通出行') {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
if(needShowEquity.includes(item.equityName))
tripMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item,
sign:item.equityName=='高德打车'?'10元券':''
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const {
merchantId
} = wx.p.storage.get('merchant_info')
this.getHomeConfig(merchantId)
this.getAllMerchantList()
},
getHomeConfig(merchantId) {
wx.p.api.homeApi.getHomeConfig({ merchantId }).then(data => {
wx.hideLoading();
let utilList = []
if (data.clueList && data.clueList.length) {
data.clueList.map(e => {
if (e.clueId == 1) {
let rescueTypeList = [
{
confId: 5,
name: '事故救援',
iconUrl: 'accident_rescue_icon',
sign: '免费'
},
{
confId: 3,
name: '送油',
iconUrl: 'send_oil_icon'
},
{
confId: 4,
name: '搭电',
iconUrl: 'pick_up_power_icon'
},
{
confId: 2,
name: '换胎',
iconUrl: 'trie_change_icon'
},
{
confId: 0,
name: '紧急脱困',
iconUrl: 'emergency_relief_icon',
},
{
confId: 1,
name: '拖车',
iconUrl: 'trailer_icon'
},
{
confId: 6,
name: '找车位',
iconUrl: 'parking_icon',
url: '/packageEquity/pages/parking/index/index'
},
]
rescueTypeList.forEach(v => {
utilList.push({
...v,
url: v.url ? v.url : '/packageEquity/pages/road/index/index'
})
})
}
})
})
}
}
this.setData({
utilList
})
})
} else if (env == 'test' || env == 'beta') {
equityList.forEach(el => {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
tripMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item
},
getAllMerchantList() {
const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = {
merchantId
}
wx.p.api.equityApi.getAllEquity(para).then(res => {
const carList = res.carServiceList
const equityList = res.goodsServiceList
let tripMenu = []
const needShowEquity = ['高德打车', '曹操出行']
if (env == 'production') {
equityList.forEach(el => {
if (el.goodsCategory == '交通出行') {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
if (needShowEquity.includes(item.equityName))
tripMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item,
sign: item.equityName == '高德打车' ? '10元券' : ''
})
})
}
}
})
} else if (env == 'test' || env == 'beta') {
equityList.forEach(el => {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
tripMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
})
}
})
})
}
this.setData({
tripMenu
})
})
}
this.setData({
tripMenu
})
})
},
},
})
\ No newline at end of file
......@@ -27,5 +27,5 @@
"ignore": [],
"include": []
},
"appid": "wx39a574d259fe58a0"
"appid": "wxb818f6bc908c52fc"
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!