@@ -72,6 +72,7 @@ App({ | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
login() { | login() { | ||||
let that = this; | let that = this; | ||||
tt.login({ | tt.login({ | ||||
@@ -19,44 +19,45 @@ Component({ | |||||
data: { | data: { | ||||
bannerUrl: imgurl.banner.url, | bannerUrl: imgurl.banner.url, | ||||
currentIndex: 0, | currentIndex: 0, | ||||
mouldType:0, | |||||
mouldType: 0, | |||||
}, | }, | ||||
/** | /** | ||||
* 组件的方法列表 | * 组件的方法列表 | ||||
*/ | */ | ||||
methods: { | methods: { | ||||
gotobannerdetail: function(e) { | |||||
gotobannerdetail: function (e) { | |||||
console.log(e, 'e'); | |||||
console.log(this.data.list) | console.log(this.data.list) | ||||
if (e.currentTarget.dataset.data.type == 3) { | if (e.currentTarget.dataset.data.type == 3) { | ||||
// 小程序路径 | // 小程序路径 | ||||
let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("="); | let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("="); | ||||
console.log(indexOf, "123") | console.log(indexOf, "123") | ||||
let id = (e.currentTarget.dataset.data.pagePath).substr(indexOf); | let id = (e.currentTarget.dataset.data.pagePath).substr(indexOf); | ||||
console.log(id.split("="),123); | |||||
let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2)// 2020/7/22 变量获取pagePath中的type | |||||
console.log(id.split("="), 123); | |||||
let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2) // 2020/7/22 变量获取pagePath中的type | |||||
console.log(indexOf, id, type); | console.log(indexOf, id, type); | ||||
console.log(e.currentTarget.dataset.data.pagePath) | console.log(e.currentTarget.dataset.data.pagePath) | ||||
if(type == 'cd' || type == 'sd'){ | |||||
if (type == 'cd' || type == 'sd') { | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/${e.currentTarget.dataset.data.pagePath}`, | url: `/${e.currentTarget.dataset.data.pagePath}`, | ||||
}) | }) | ||||
}else if(type == "wj"){ | |||||
} else if (type == "wj") { | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/questionnaire/questionnaire?id=`+id.split("=")[2], | |||||
url: `/pages/questionnaire/questionnaire?id=` + id.split("=")[2], | |||||
}) | }) | ||||
}else if (type == 'ra'){ | |||||
} else if (type == 'ra') { | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/radetail/index?id=`+id.split("=")[2], | |||||
url: `/pages/radetail/index?id=` + id.split("=")[2], | |||||
}) | }) | ||||
} | } | ||||
}else if(e.currentTarget.dataset.data.type==2){ | |||||
} else if (e.currentTarget.dataset.data.type == 2) { | |||||
// 自由图文 | // 自由图文 | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` | url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` | ||||
}); | }); | ||||
}else if(e.currentTarget.dataset.data.type==4){ | |||||
} else if (e.currentTarget.dataset.data.type == 4) { | |||||
tt.navigateToMiniProgram({ | tt.navigateToMiniProgram({ | ||||
appId: e.currentTarget.dataset.data.goAppid, | appId: e.currentTarget.dataset.data.goAppid, | ||||
// path: 'page/index/index?id=123', | // path: 'page/index/index?id=123', | ||||
@@ -68,11 +69,10 @@ Component({ | |||||
// 打开成功 | // 打开成功 | ||||
} | } | ||||
}) | }) | ||||
} | |||||
else{ | |||||
} else { | |||||
// 固定格式 | // 固定格式 | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/bannerdetail/bannerdetail?id=${e.currentTarget.dataset.id}` | |||||
url: `/pages/bannerdetail/bannerdetail?id=${e.currentTarget.dataset.id}&mallTenantId=${e.currentTarget.dataset.data.tenantId}` | |||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
@@ -84,10 +84,10 @@ Component({ | |||||
}, | }, | ||||
attached: function () { | attached: function () { | ||||
// 在组件实例进入页面节点树时执行 | // 在组件实例进入页面节点树时执行 | ||||
if (app.globalData.mouldType){ | |||||
if (app.globalData.mouldType) { | |||||
this.setData({ | this.setData({ | ||||
mouldType: app.globalData.mouldType | mouldType: app.globalData.mouldType | ||||
}) | }) | ||||
} | } | ||||
}, | }, | ||||
}); | |||||
}); |
@@ -28,13 +28,16 @@ Component({ | |||||
}, | }, | ||||
methods: { | methods: { | ||||
gotoDetail(e) { | gotoDetail(e) { | ||||
console.log(e, 'e'); | |||||
let couponId = e.currentTarget.dataset.couponid; | let couponId = e.currentTarget.dataset.couponid; | ||||
let title = e.currentTarget.dataset.title; | let title = e.currentTarget.dataset.title; | ||||
let id = e.currentTarget.dataset.id; | let id = e.currentTarget.dataset.id; | ||||
let targetAd = e.currentTarget.dataset.targetad; | let targetAd = e.currentTarget.dataset.targetad; | ||||
let mallTenantId = e.currentTarget.dataset.malltenantid; | |||||
if (id && targetAd != 7) { | if (id && targetAd != 7) { | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/coupon/detail/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`, | |||||
url: `/pages/coupon/detail/index?couponChannelId=${id}&couponId=${couponId}&title=${title}&mallTenantId=${mallTenantId}`, | |||||
}) | }) | ||||
} else if (targetAd == 7) { | } else if (targetAd == 7) { | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
@@ -1,5 +1,5 @@ | |||||
<view class='navigator' bindtap='gotoDetail' data-id='{{data.id}}' data-targetAd='{{data.targetAd}}' hover-class='hover' | <view class='navigator' bindtap='gotoDetail' data-id='{{data.id}}' data-targetAd='{{data.targetAd}}' hover-class='hover' | ||||
data-couponId='{{data.couponId}}' data-title='{{data.title}}'> | |||||
data-couponId='{{data.couponId}}' data-title='{{data.title}}' data-malltenantid='{{data.tenantId}}'> | |||||
<view class="presell" tt:if="{{data.type==10}}" style="{{mouldType==1?'top: 280rpx;':''}}">预售 </view> | <view class="presell" tt:if="{{data.type==10}}" style="{{mouldType==1?'top: 280rpx;':''}}">预售 </view> | ||||
<!-- 首页优惠券列表页面 --> | <!-- 首页优惠券列表页面 --> | ||||
<view class="coupons"> | <view class="coupons"> | ||||
@@ -23,8 +23,8 @@ | |||||
<view class="coupons-info-name tit">{{data.title}}</view> | <view class="coupons-info-name tit">{{data.title}}</view> | ||||
<view class="coupons-info-name subtitle">{{data.subTitle}}</view> | <view class="coupons-info-name subtitle">{{data.subTitle}}</view> | ||||
<view class="coupons-info-price-p"> | <view class="coupons-info-price-p"> | ||||
<view class='price' tt:if="{{data.type!=10&&mouldType==1}}"> | |||||
<view class="fuhaoX"> ¥{{data.salePriceStr}}</view> | |||||
<view class='price' tt:if="{{data.type!=10&&mouldType==1}}"> | |||||
<view class="fuhaoX"> ¥{{data.salePriceStr}}</view> | |||||
</view> | </view> | ||||
<view class='price' tt:if="{{data.type!=10&&mouldType!=1}}"> | <view class='price' tt:if="{{data.type!=10&&mouldType!=1}}"> | ||||
<text tt:if="{{data.targetAd == 101||data.targetAd == 5}}"><text class='rmb'>¥</text> | <text tt:if="{{data.targetAd == 101||data.targetAd == 5}}"><text class='rmb'>¥</text> | ||||
@@ -61,8 +61,9 @@ | |||||
<view class="coupons-btn" tt:if="{{mouldType!=1}}"> | <view class="coupons-btn" tt:if="{{mouldType!=1}}"> | ||||
<!-- 优惠券价格 --> | <!-- 优惠券价格 --> | ||||
<i-button i-class=" coupons-btn-gm" tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" | |||||
data-date='{{data}}'>免费领</i-button> | |||||
<i-button i-class=" coupons-btn-gm" | |||||
tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" data-date='{{data}}'>免费领 | |||||
</i-button> | |||||
<i-button i-class="coupons-btn-gm" | <i-button i-class="coupons-btn-gm" | ||||
tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}" | tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}" | ||||
data-date='{{data}}'>购买</i-button> | data-date='{{data}}'>购买</i-button> | ||||
@@ -79,8 +80,9 @@ | |||||
<view class="coupons-btn" tt:if="{{mouldType==1}}"> | <view class="coupons-btn" tt:if="{{mouldType==1}}"> | ||||
<!-- 优惠券价格 --> | <!-- 优惠券价格 --> | ||||
<i-button i-class=" coupons-btn-gmX" tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" | |||||
data-date='{{data}}'>免费领</i-button> | |||||
<i-button i-class=" coupons-btn-gmX" | |||||
tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" data-date='{{data}}'>免费领 | |||||
</i-button> | |||||
<i-button i-class="coupons-btn-gmX" | <i-button i-class="coupons-btn-gmX" | ||||
tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}" | tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}" | ||||
data-date='{{data}}'>购买</i-button> | data-date='{{data}}'>购买</i-button> | ||||
@@ -4,9 +4,9 @@ Component({ | |||||
* 组件的属性列表 | * 组件的属性列表 | ||||
*/ | */ | ||||
properties: { | properties: { | ||||
businessList:{ | |||||
type:Array, | |||||
value:[] | |||||
businessList: { | |||||
type: Array, | |||||
value: [] | |||||
}, | }, | ||||
businessData: { | businessData: { | ||||
type: Array, | type: Array, | ||||
@@ -18,39 +18,40 @@ Component({ | |||||
* 组件的初始数据 | * 组件的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
classIndex:0 | |||||
classIndex: 0 | |||||
}, | }, | ||||
/** | /** | ||||
* 组件的方法列表 | * 组件的方法列表 | ||||
*/ | */ | ||||
methods: { | methods: { | ||||
goDetail(e){ | |||||
goDetail(e) { | |||||
let couponChannelId = e.currentTarget.dataset.id | let couponChannelId = e.currentTarget.dataset.id | ||||
let couponId = e.currentTarget.dataset.couponid | let couponId = e.currentTarget.dataset.couponid | ||||
let mallTenantId = e.currentTarget.dataset.malltenantid | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | |||||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}&mallTenantId=${mallTenantId}`, | |||||
}) | }) | ||||
}, | }, | ||||
setIndex(e){ | |||||
setIndex(e) { | |||||
let index = e.currentTarget.dataset.index | let index = e.currentTarget.dataset.index | ||||
let id = e.currentTarget.dataset.id | let id = e.currentTarget.dataset.id | ||||
this.triggerEvent('businessid',id) | |||||
this.triggerEvent('businessid', id) | |||||
this.setData({ | this.setData({ | ||||
classIndex:index | |||||
classIndex: index | |||||
}) | }) | ||||
}, | }, | ||||
goLsit(){ | |||||
goLsit() { | |||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: '/pages/liveLsit/liveLsit', | url: '/pages/liveLsit/liveLsit', | ||||
success: (res) => { | success: (res) => { | ||||
}, | }, | ||||
fail: (res) => { | fail: (res) => { | ||||
}, | }, | ||||
}); | }); | ||||
} | } | ||||
} | } | ||||
}) | |||||
}) |
@@ -1,31 +1,33 @@ | |||||
<view class="optimizationBox"> | <view class="optimizationBox"> | ||||
<view class="titleImg"> | |||||
<view class="textl f">优选好物</view> | |||||
<view class="textr r">Preferred Good</view> | |||||
</view> | |||||
<view class="classifyBox-go-box"> | |||||
<view class="classifyBox"> | |||||
<view class="itemBox" tt:for="{{businessList}}" tt:key="{{index}}" bindtap="setIndex" data-index="{{index}}" data-id="{{item.id}}"> | |||||
<view class="{{classIndex==index?'className_a':'className'}}">{{item.title}}</view> | |||||
<view class="xian" tt:if="{{classIndex==index}}"></view> | |||||
</view> | |||||
<view class="titleImg"> | |||||
<view class="textl f">优选好物</view> | |||||
<view class="textr r">Preferred Good</view> | |||||
</view> | |||||
<view class="classifyBox-go-box"> | |||||
<view class="classifyBox"> | |||||
<view class="itemBox" tt:for="{{businessList}}" tt:key="{{index}}" bindtap="setIndex" data-index="{{index}}" | |||||
data-id="{{item.id}}"> | |||||
<view class="{{classIndex==index?'className_a':'className'}}">{{item.title}}</view> | |||||
<view class="xian" tt:if="{{classIndex==index}}"></view> | |||||
</view> | </view> | ||||
<!-- <view class="goLsit" bindtap="goLsit"> 直播商品 <image class="rup" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_jt.png"></image></view> --> | |||||
</view> | </view> | ||||
<view class="contBox"> | |||||
<view class="contLsitBox"> | |||||
<view class="item" tt:for="{{businessData}}" tt:key="{{index}}" bindtap="goDetail" data-couponid="{{item.couponId}}" data-id="{{item.id}}"> | |||||
<view class="itemImg"> | |||||
<image src="{{item.coverImg}}" mode='scaleToFill'></image> | |||||
</view> | |||||
<view class="titleName">{{item.title}}</view> | |||||
<!-- <view class="goLsit" bindtap="goLsit"> 直播商品 <image class="rup" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_jt.png"></image></view> --> | |||||
</view> | |||||
<!-- <view class="priceBox"> | |||||
<view class="contBox"> | |||||
<view class="contLsitBox"> | |||||
<view class="item" tt:for="{{businessData}}" tt:key="{{index}}" bindtap="goDetail" | |||||
data-couponid="{{item.couponId}}" data-id="{{item.id}}" data-malltenantid="{{item.tenantId}}"> | |||||
<view class="itemImg"> | |||||
<image src="{{item.coverImg}}" mode='scaleToFill'></image> | |||||
</view> | |||||
<view class="titleName">{{item.title}}</view> | |||||
<!-- <view class="priceBox"> | |||||
<view class="sellingBox f"> | <view class="sellingBox f"> | ||||
<view class="fuhao">¥</view> | <view class="fuhao">¥</view> | ||||
<view class="int">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view> | <view class="int">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view> | ||||
@@ -37,19 +39,20 @@ | |||||
</view> | </view> | ||||
</view> --> | </view> --> | ||||
<view class="priceBox"> | |||||
<view class="sellingBox f"> | |||||
<view class="priceBox"> | |||||
<view class="sellingBox f"> | |||||
<view class="fuhaoX">¥{{item.salePriceStr?item.salePriceStr:""}} </view> | |||||
<view class="fuhaoX">¥{{item.salePriceStr?item.salePriceStr:""}} </view> | |||||
</view> | |||||
<view class="r btn">马上抢</view> | |||||
</view> | |||||
<view class="sellout" tt:if="{{item.remainInventory==0}}"> | |||||
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png"></image> | |||||
</view> | </view> | ||||
<view class="r btn">马上抢</view> | |||||
</view> | |||||
<view class="sellout" tt:if="{{item.remainInventory==0}}"> | |||||
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png"> | |||||
</image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | |||||
</view> | |||||
</view> |
@@ -117,7 +117,8 @@ Page({ | |||||
currentMall: '富茂广场', | currentMall: '富茂广场', | ||||
shopList: [], | shopList: [], | ||||
mallTenantId: tt.getStorageSync('mallTenantId') || '', | mallTenantId: tt.getStorageSync('mallTenantId') || '', | ||||
index: tt.getStorageSync('mallIndex') || 0 | |||||
index: tt.getStorageSync('mallIndex') || 0, | |||||
locateData: {} | |||||
}, | }, | ||||
getCongig() { //获取小程序是否开通授权手机号 | getCongig() { //获取小程序是否开通授权手机号 | ||||
@@ -133,19 +134,25 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
mallSync() { | |||||
this.setData({ | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || '', | |||||
index: tt.getStorageSync('mallIndex') || 0, | |||||
}) | |||||
}, | |||||
getsubMallList() { | getsubMallList() { | ||||
Http.get({ | Http.get({ | ||||
url: '/mall/subMall?isAll=1', | url: '/mall/subMall?isAll=1', | ||||
}).then(res => { | }).then(res => { | ||||
this.setData({ | this.setData({ | ||||
shopList: res.data, | shopList: res.data, | ||||
mallTenantId: res.data[0].tenantId | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId | |||||
}); | }); | ||||
const index = this.data.index | |||||
const mallTenantId = this.data.shopList[index].tenantId | |||||
tt.setStorageSync('mallTenantId', mallTenantId) | |||||
tt.setStorageSync('mallIndex', index) | |||||
Http.setMallTenantId(mallTenantId); | |||||
if (!tt.getStorageSync('mallTenantId') && res.data.length > 1) { | |||||
tt.setStorageSync('mallTenantId', res.data[0].tenantId) | |||||
tt.setStorageSync('mallIndex', 0) | |||||
} | |||||
}).catch(err => { | }).catch(err => { | ||||
console.log(err, 'err'); | console.log(err, 'err'); | ||||
}) | }) | ||||
@@ -159,9 +166,11 @@ Page({ | |||||
this.setData({ | this.setData({ | ||||
index: index, | index: index, | ||||
mallTenantId: mallTenantId, | mallTenantId: mallTenantId, | ||||
allow_load: true | |||||
}); | }); | ||||
Http.setMallTenantId(mallTenantId); | |||||
this.getBannerlist(); | |||||
this.getBusinessList() | |||||
this.getCouponChannelList(0) | |||||
}, | }, | ||||
getBusineData(e) { | getBusineData(e) { | ||||
@@ -176,7 +185,8 @@ Page({ | |||||
Http.get({ | Http.get({ | ||||
url: config.api.businessList, | url: config.api.businessList, | ||||
data: { | data: { | ||||
filter: 2 | |||||
filter: 2, | |||||
mallTenantId: this.data.mallTenantId, | |||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
this.setData({ | this.setData({ | ||||
@@ -206,14 +216,16 @@ Page({ | |||||
param = { | param = { | ||||
pageNum: this.data.businePageNum, | pageNum: this.data.businePageNum, | ||||
pageSize: 6, | pageSize: 6, | ||||
targetAd: 101 | |||||
targetAd: 101, | |||||
mallTenantId: this.data.mallTenantId, | |||||
} | } | ||||
} else { | } else { | ||||
param = { | param = { | ||||
pageNum: this.data.businePageNum, | pageNum: this.data.businePageNum, | ||||
pageSize: 6, | pageSize: 6, | ||||
business: key, | business: key, | ||||
targetAd: 101 | |||||
targetAd: 101, | |||||
mallTenantId: this.data.mallTenantId, | |||||
} | } | ||||
} | } | ||||
@@ -579,9 +591,6 @@ Page({ | |||||
// util.barcode("barcode", optionss.quancode, 510, 100); | // util.barcode("barcode", optionss.quancode, 510, 100); | ||||
// console.log(Http.headers.token, "?") | // console.log(Http.headers.token, "?") | ||||
this.getLocation() | this.getLocation() | ||||
setTimeout(() => { | |||||
this.getsubMallList() | |||||
}, 1000) | |||||
}, | }, | ||||
/** | /** | ||||
* 获得经纬度 | * 获得经纬度 | ||||
@@ -593,6 +602,13 @@ Page({ | |||||
// isHighAccuracy: true, | // isHighAccuracy: true, | ||||
success: function (res) { | success: function (res) { | ||||
console.log(res, 'getLocation') | console.log(res, 'getLocation') | ||||
const locateData = { | |||||
latitude: res.latitude, | |||||
longitude: res.longitude, | |||||
} | |||||
that.setData({ | |||||
locateData: locateData | |||||
}) | |||||
if (res && res.longitude && res.latitude) { | if (res && res.longitude && res.latitude) { | ||||
Http.post({ | Http.post({ | ||||
url: config.api.updateLBS, | url: config.api.updateLBS, | ||||
@@ -616,9 +632,45 @@ Page({ | |||||
}, | }, | ||||
/** | |||||
* @description:根据经纬度计算距离 | |||||
* @param {*} locationInfo (lat1, lng1, lat2, lng2) | |||||
* @return: distanceObj: { distance , distance_str } | |||||
*/ | |||||
getDistances(lat1, lng1, lat2, lng2) { | |||||
function rad(d) { | |||||
return d * Math.PI / 180.0; | |||||
} | |||||
var radLat1 = rad(lat1); | |||||
var radLat2 = rad(lat2); | |||||
var a = radLat1 - radLat2; | |||||
var b = rad(lng1) - rad(lng2); | |||||
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + | |||||
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); | |||||
s = s * 6378.137; | |||||
s = Math.round(s * 10000) / 10000; | |||||
var distance = s; | |||||
var distance_str = ""; | |||||
if (parseInt(distance) >= 1) { | |||||
distance_str = distance.toFixed(2) + "km"; | |||||
} else { | |||||
distance_str = (distance * 1000).toFixed(2) + "m"; | |||||
} | |||||
let objData = { | |||||
distance: distance, | |||||
distance_str: distance_str | |||||
} | |||||
return objData | |||||
}, | |||||
onShow: function () { | onShow: function () { | ||||
this.mallSync() | |||||
console.log(app.globalData.mouldType, "mouldType") | console.log(app.globalData.mouldType, "mouldType") | ||||
// tt.requestSubscribeMessage({ | // tt.requestSubscribeMessage({ | ||||
// tmplIds: [], // 需要填入开放平台申请的模版id,支持最多3个同类型模版 | // tmplIds: [], // 需要填入开放平台申请的模版id,支持最多3个同类型模版 | ||||
@@ -781,6 +833,7 @@ Page({ | |||||
var that = this; | var that = this; | ||||
if (app.globalData.token) { | if (app.globalData.token) { | ||||
that.getsubMallList() | |||||
// 登录 | // 登录 | ||||
console.log(app.globalData.token) | console.log(app.globalData.token) | ||||
that.getCongig() //获取小程序是否开通授权手机号 | that.getCongig() //获取小程序是否开通授权手机号 | ||||
@@ -808,7 +861,7 @@ Page({ | |||||
that.topicShowall(6); | that.topicShowall(6); | ||||
that.getBusinessList(); | that.getBusinessList(); | ||||
that.getCouponChannelList(0) | that.getCouponChannelList(0) | ||||
that.getsubMallList() | |||||
that.getType() | that.getType() | ||||
that.uesrInfo() | that.uesrInfo() | ||||
@@ -857,6 +910,7 @@ Page({ | |||||
} else { | } else { | ||||
app.tokenCallback = token => { | app.tokenCallback = token => { | ||||
that.getsubMallList() | |||||
// 登录 | // 登录 | ||||
console.log(app.globalData.token) | console.log(app.globalData.token) | ||||
that.getCongig() //获取小程序是否开通授权手机号 | that.getCongig() //获取小程序是否开通授权手机号 | ||||
@@ -881,6 +935,7 @@ Page({ | |||||
that.topicShowall(5); | that.topicShowall(5); | ||||
that.topicShowall(6); | that.topicShowall(6); | ||||
that.getBusinessList(); | that.getBusinessList(); | ||||
that.getCouponChannelList(0) | that.getCouponChannelList(0) | ||||
that.getType() | that.getType() | ||||
that.uesrInfo() | that.uesrInfo() | ||||
@@ -1054,7 +1109,8 @@ Page({ | |||||
data: { | data: { | ||||
pageNum: 1, | pageNum: 1, | ||||
pageSize: 7, | pageSize: 7, | ||||
plat: 3 | |||||
plat: 3, | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || "" | |||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
that.getmemberId(app.globalData.token); | that.getmemberId(app.globalData.token); | ||||
@@ -22,7 +22,9 @@ | |||||
disabled="{{false}}"> | disabled="{{false}}"> | ||||
<view> | <view> | ||||
<view> | <view> | ||||
当前广场:{{ shopList[index].name }} ↓ | |||||
<image src="../assets/images/location.png" class="location"></image> | |||||
<text class="mallName">{{ shopList[index].name }}</text> | |||||
<image src="../assets/itemImg/arrow-right-l.png" class="right"></image> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</picker> | </picker> | ||||
@@ -118,16 +118,25 @@ page { | |||||
.pickerMall { | .pickerMall { | ||||
height: auto; | height: auto; | ||||
margin: 10rpx 0 15rpx 10rpx; | |||||
margin: 0 0 15rpx 20rpx; | |||||
font-size: 30rpx; | |||||
} | } | ||||
.location { | |||||
position: relative; | |||||
top: 8rpx; | |||||
width: 35rpx; | |||||
height: 35rpx; | |||||
margin-right: 10rpx; | |||||
} | |||||
.underlingImg { | |||||
width: 30rpx; | |||||
height: 60rpx; | |||||
font-size: 30prx; | |||||
float: left; | |||||
/* margin-top: 20rpx; */ | |||||
.right { | |||||
position: relative; | |||||
top: 6rpx; | |||||
left: 10rpx; | |||||
width: 35rpx; | |||||
height: 35rpx; | |||||
} | } | ||||
.underlingName { | .underlingName { | ||||
@@ -11,7 +11,7 @@ Page({ | |||||
data: { | data: { | ||||
navigationBarHeight, | navigationBarHeight, | ||||
navLineHeight: ((app.statusBarHeight + app.statusBarHeight) + 50) + "px", | navLineHeight: ((app.statusBarHeight + app.statusBarHeight) + 50) + "px", | ||||
navImgHeight:(((app.statusBarHeight + app.statusBarHeight) + 34)/2) + "px", | |||||
navImgHeight: (((app.statusBarHeight + app.statusBarHeight) + 34) / 2) + "px", | |||||
lists: [], | lists: [], | ||||
merchantVoList: [], | merchantVoList: [], | ||||
indexId: 0, | indexId: 0, | ||||
@@ -23,11 +23,11 @@ Page({ | |||||
teljpgUrl: imgurl.teljpg.url, | teljpgUrl: imgurl.teljpg.url, | ||||
map: imgurl.map.url, //商场地图 | map: imgurl.map.url, //商场地图 | ||||
mapUrl: '/pages/marketAtlas/marketAtlas', //跳转地图的路径 | mapUrl: '/pages/marketAtlas/marketAtlas', //跳转地图的路径 | ||||
mouldType:0, | |||||
mouldType: 0, | |||||
}, | }, | ||||
getFemgMap() { //判断时候对接封了地图 | getFemgMap() { //判断时候对接封了地图 | ||||
Http.get({ | Http.get({ | ||||
url: config.api.ifFengMap | |||||
url: config.api.ifFengMap + `?mallTenantId=${tt.getStorageSync('mallTenantId')||""}` | |||||
}).then(res => { | }).then(res => { | ||||
if (res.data) { // | if (res.data) { // | ||||
let initMpa = { | let initMpa = { | ||||
@@ -82,13 +82,13 @@ Page({ | |||||
*/ | */ | ||||
gotoDetail(e) { | gotoDetail(e) { | ||||
tt.navigateTo({ | tt.navigateTo({ | ||||
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}` | |||||
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}&mallTenantId=${tt.getStorageSync('mallTenantId') || ""}` | |||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function(options) { | |||||
onLoad: function (options) { | |||||
this.setData({ | this.setData({ | ||||
mouldType: app.globalData.mouldType, | mouldType: app.globalData.mouldType, | ||||
}) | }) | ||||
@@ -112,19 +112,20 @@ Page({ | |||||
}) | }) | ||||
}; | }; | ||||
tt.getSystemInfo({ | tt.getSystemInfo({ | ||||
success: function(res) { | |||||
success: function (res) { | |||||
that.setData({ | that.setData({ | ||||
windowHeight: res.windowHeight | windowHeight: res.windowHeight | ||||
}) | }) | ||||
}, | }, | ||||
}) | }) | ||||
}, | }, | ||||
getBussiness: function() { | |||||
getBussiness: function () { | |||||
let that = this; | let that = this; | ||||
Http.get({ | Http.get({ | ||||
url: config.api.businessList, | url: config.api.businessList, | ||||
data: { | data: { | ||||
filter: 1 | |||||
filter: 1, | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || "" | |||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
that.setData({ | that.setData({ | ||||
@@ -144,19 +145,21 @@ Page({ | |||||
}); | }); | ||||
}) | }) | ||||
}, | }, | ||||
getList: function(page, businessId) { | |||||
getList: function (page, businessId) { | |||||
let that = this; | let that = this; | ||||
let data; | let data; | ||||
if (businessId == 0) { | if (businessId == 0) { | ||||
data = { | data = { | ||||
pageNum: page, | pageNum: page, | ||||
pageSize: 8 | |||||
pageSize: 8, | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || "" | |||||
} | } | ||||
} else { | } else { | ||||
data = { | data = { | ||||
pageNum: page, | pageNum: page, | ||||
pageSize: 8, | pageSize: 8, | ||||
businessId: businessId | |||||
businessId: businessId, | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || "" | |||||
} | } | ||||
} | } | ||||
Http.get({ | Http.get({ | ||||
@@ -189,7 +192,7 @@ Page({ | |||||
}); | }); | ||||
}) | }) | ||||
}, | }, | ||||
phone: function(e) { | |||||
phone: function (e) { | |||||
let that = this; | let that = this; | ||||
if (e.currentTarget.dataset.merchantlinkphone) { | if (e.currentTarget.dataset.merchantlinkphone) { | ||||
tt.makePhoneCall({ | tt.makePhoneCall({ | ||||
@@ -200,7 +203,7 @@ Page({ | |||||
/** | /** | ||||
* 页面上拉触底事件的处理函数 | * 页面上拉触底事件的处理函数 | ||||
*/ | */ | ||||
onReachBottom: function() { | |||||
onReachBottom: function () { | |||||
let that = this; | let that = this; | ||||
that.data.page++; | that.data.page++; | ||||
that.setData({ | that.setData({ | ||||
@@ -22,14 +22,15 @@ Page({ | |||||
mouldType: app.globalData.mouldType, | mouldType: app.globalData.mouldType, | ||||
}) | }) | ||||
let that = this; | let that = this; | ||||
if (options.id){ | |||||
if (options.id) { | |||||
Http.get({ | Http.get({ | ||||
url: config.api.bannerDetail, | url: config.api.bannerDetail, | ||||
data: { | data: { | ||||
id: options.id | |||||
id: options.id, | |||||
mallTenantId: options.mallTenantId, | |||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
if(res.data.type==2){ | |||||
if (res.data.type == 2) { | |||||
that.setData({ | that.setData({ | ||||
nodes: res.data.html | nodes: res.data.html | ||||
}) | }) | ||||
@@ -52,4 +53,4 @@ Page({ | |||||
url: '/index/index', | url: '/index/index', | ||||
}) | }) | ||||
}, | }, | ||||
}); | |||||
}); |
@@ -560,7 +560,8 @@ Page({ | |||||
Http.get({ | Http.get({ | ||||
url: config.api.getSpuid, | url: config.api.getSpuid, | ||||
data: { | data: { | ||||
id: id | |||||
id: id, | |||||
mallTenantId: this.data.mallTenantId || '' | |||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
if (res.data) { | if (res.data) { | ||||
@@ -200,6 +200,7 @@ Page({ | |||||
url: config.api.listByMerchant, | url: config.api.listByMerchant, | ||||
data: data | data: data | ||||
}).then(res => { | }).then(res => { | ||||
console.log(res, 'res'); | |||||
that.setData({ | that.setData({ | ||||
couponList: res.data.page.list, | couponList: res.data.page.list, | ||||
}) | }) | ||||
@@ -41,8 +41,8 @@ Page({ | |||||
canIUse: tt.canIUse("button.open-type.getPhoneNumber"), //判断小程序是否能用获取手机插件 | canIUse: tt.canIUse("button.open-type.getPhoneNumber"), //判断小程序是否能用获取手机插件 | ||||
ifshowtab: null, | ifshowtab: null, | ||||
shopList: [], | shopList: [], | ||||
index: 0, | |||||
mallTenantId: '' | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || '', | |||||
index: tt.getStorageSync('mallIndex') || 0 | |||||
}, | }, | ||||
setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功 | setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功 | ||||
@@ -79,8 +79,8 @@ Page({ | |||||
bindPickerChange(e) { | bindPickerChange(e) { | ||||
const index = e.detail.value | const index = e.detail.value | ||||
const mallTenantId = this.data.shopList[index].tenantId | const mallTenantId = this.data.shopList[index].tenantId | ||||
// tt.setStorageSync('mallTenantId', mallTenantId) | |||||
// tt.setStorageSync('mallIndex', index) | |||||
tt.setStorageSync('mallTenantId', mallTenantId) | |||||
tt.setStorageSync('mallIndex', index) | |||||
this.setData({ | this.setData({ | ||||
index: index, | index: index, | ||||
mallTenantId: mallTenantId, | mallTenantId: mallTenantId, | ||||
@@ -95,14 +95,21 @@ Page({ | |||||
url: '/index/index', | url: '/index/index', | ||||
}) | }) | ||||
}, | }, | ||||
mallSync() { | |||||
this.setData({ | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || '', | |||||
index: tt.getStorageSync('mallIndex') || 0, | |||||
}) | |||||
}, | |||||
onLoad(e) { | onLoad(e) { | ||||
Http.get({ | Http.get({ | ||||
url: '/mall/subMall?isAll=1', | url: '/mall/subMall?isAll=1', | ||||
}).then(res => { | }).then(res => { | ||||
this.setData({ | this.setData({ | ||||
shopList: res.data, | shopList: res.data, | ||||
// tt.getStorageSync('mallTenantId') || | |||||
mallTenantId: res.data[0].tenantId | |||||
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId | |||||
}); | }); | ||||
console.log(this.data.shopList, 'list'); | console.log(this.data.shopList, 'list'); | ||||
@@ -111,6 +118,7 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
onShow() { | onShow() { | ||||
this.mallSync() | |||||
this.getList(this.data.boatFlag, 1); | this.getList(this.data.boatFlag, 1); | ||||
Http.get({ | Http.get({ | ||||
url: config.api.checkUserStatus, | url: config.api.checkUserStatus, | ||||
@@ -21,7 +21,6 @@ class HttpBasics { | |||||
headers = { | headers = { | ||||
"Content-Type": "application/json;charset=UTF-8", | "Content-Type": "application/json;charset=UTF-8", | ||||
token: "", | token: "", | ||||
mallTenantId: "" | |||||
// token:"3ab2afa2-f704-4086-b6e5-ad0715c7e2a1:1027:tt-cuser" | // token:"3ab2afa2-f704-4086-b6e5-ad0715c7e2a1:1027:tt-cuser" | ||||
}; | }; | ||||
@@ -33,13 +32,13 @@ class HttpBasics { | |||||
this.headers.token = token; | this.headers.token = token; | ||||
} | } | ||||
/** | |||||
* @description 设置mallTenantId | |||||
* @param {*} mallTenantId | |||||
*/ | |||||
setMallTenantId(mallTenantId) { | |||||
this.headers.mallTenantId = mallTenantId; | |||||
} | |||||
// /** | |||||
// * @description 设置mallTenantId | |||||
// * @param {*} mallTenantId | |||||
// */ | |||||
// setMallTenantId(mallTenantId) { | |||||
// this.headers.mallTenantId = mallTenantId; | |||||
// } | |||||
/** | /** | ||||
* 获取数据 | * 获取数据 | ||||