Browse Source

商户列表优化

soldDate
HolyKnightIX 2 years ago
parent
commit
7d226e1a9c
4 changed files with 125 additions and 10 deletions
  1. +115
    -6
      components/shop/shop.ttml
  2. +5
    -0
      pages/coupon/detail/index.js
  3. +4
    -3
      pages/index/searchbar/detail/index.js
  4. +1
    -1
      pages/order/detail/index.js

+ 115
- 6
components/shop/shop.ttml View File

@@ -13,15 +13,19 @@
</view> </view>
</view> </view>


<!-- 当商户数量不大于三个时 -->
<view class="goExpand" catchtap="expandList" data-index="{{index}}"> <view class="goExpand" catchtap="expandList" data-index="{{index}}">
<view>{{item.merchantVoList.length+'家门店适用'}}</view>
<image tt:if="{{!item.expand}}" src="../../assets/itemImg/chevron.png" mode="widthFix"
class="rightArrowDown">
</image>
<image tt:else src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrowUp"></image>
<view tt:if="{{item.merchantVoList.length<=3}}">
<view>{{item.merchantVoList.length+'家门店适用'}}</view>
<image tt:if="{{!item.expand}}" src="../../assets/itemImg/chevron.png" mode="widthFix"
class="rightArrowDown">
</image>
<image tt:else src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrowUp"></image>
</view>
</view> </view>


<view class="shop" tt:if="{{item.expand}}">
<!-- 当item.expand为true且商户数量不大于三个时 -->
<view class="shop" tt:if="{{item.expand&&item.merchantVoList.length<=3}}">
<view class='posi' tt:for="{{item.merchantVoList}}" tt:key="index"> <view class='posi' tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'> <view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'> <view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
@@ -53,5 +57,110 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 当商户数量不大于三个时 -->
<view class="shop" tt:if="{{item.merchantVoList.length>3}}">
<!-- 当item.expand为true时 -->
<view class='posi' tt:if="{{item.expand}}" tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" tt:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification"
data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>
</view>
<!-- 当item.expand为true时 -->
<view class='posi' tt:if="{{item.expand}}" tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" tt:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification"
data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>
</view>
<!-- 当item.expand为false时 -->
<view class='posi' tt:else tt:for="{{item.merchantVoList}}" tt:key="index">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" tt:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification"
data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>
</view>
</view>

<!-- 当商户数量不小于三个时 -->
<view tt:if="{{item.merchantVoList.length>3}}">
<view>{{item.merchantVoList.length+'家门店适用,展开全部'}}</view>
<image tt:if="{{!item.expand}}" src="../../assets/itemImg/chevron.png" mode="widthFix"
class="rightArrowDown">
</image>
<image tt:else src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrowUp"></image>
</view>
</view> </view>
</view> </view>

+ 5
- 0
pages/coupon/detail/index.js View File

@@ -601,6 +601,7 @@ Page({
}).then(res => { }).then(res => {
const keys = Object.keys(res.data) const keys = Object.keys(res.data)
const mallList = [] const mallList = []
let i = 0
keys.forEach(item => { keys.forEach(item => {
const arr = item.split('|') const arr = item.split('|')
const obj = { const obj = {
@@ -609,7 +610,11 @@ Page({
merchantVoList: res.data[item], merchantVoList: res.data[item],
expand: false expand: false
} }
if (i == 0) {
obj.expand = true
}
mallList.push(obj) mallList.push(obj)
i++
}) })
this.setData({ this.setData({
mallList: mallList mallList: mallList


+ 4
- 3
pages/index/searchbar/detail/index.js View File

@@ -54,7 +54,7 @@ Page({
id: options.id id: options.id
}); });
that.getList(options.id, options.mallTenantId); that.getList(options.id, options.mallTenantId);
that.getCouponList(options.id);
that.getCouponList(options.id, options.mallTenantId);
this.setData({ this.setData({
currentTab: 0 currentTab: 0
}) })
@@ -186,14 +186,15 @@ Page({
* 获取商户活动信息 券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券 100.消费卡) * 获取商户活动信息 券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券 100.消费卡)
* 投放频道:(1.列表, 2.限时抢购, 3. banner图 4. 游戏 5.卡频道 6.砍价频道 7.拼团频道 8专题) * 投放频道:(1.列表, 2.限时抢购, 3. banner图 4. 游戏 5.卡频道 6.砍价频道 7.拼团频道 8专题)
*/ */
getCouponList: function (id) {
getCouponList: function (id, mallTenantId) {
let that = this; let that = this;
let data; let data;
data = { data = {
status: 0, status: 0,
// merchantId: id,
merchantId: id,
pageNum: that.data.page, pageNum: that.data.page,
pageSize: 15, pageSize: 15,
mallTenantId: mallTenantId
} }
Http.post({ Http.post({
url: config.api.listByMerchant, url: config.api.listByMerchant,


+ 1
- 1
pages/order/detail/index.js View File

@@ -168,7 +168,7 @@ Page({
tenantId: arr[0], tenantId: arr[0],
mallName: arr[1], mallName: arr[1],
merchantVoList: res.data[item], merchantVoList: res.data[item],
expand: false
expand: true
} }
mallList.push(obj) mallList.push(obj)
}) })


Loading…
Cancel
Save