Browse Source

适用门店

soldDate
HolyKnightIX 2 years ago
parent
commit
252e84ab8f
17 changed files with 750 additions and 130 deletions
  1. BIN
      assets/itemImg/merchantImgCover.png
  2. +83
    -2
      components/shop/shop.js
  3. +211
    -0
      components/shop/shop.less
  4. +57
    -1
      components/shop/shop.ttml
  5. +178
    -1
      components/shop/shop.ttss
  6. +24
    -23
      components/store/index.js
  7. +9
    -7
      components/store/index.ttml
  8. +7
    -4
      pages/coupon/detail/index.js
  9. +1
    -1
      pages/coupon/detail/index.ttml
  10. +40
    -0
      pages/couponorder/detail/index.js
  11. +8
    -7
      pages/couponorder/detail/index.json
  12. +15
    -13
      pages/couponorder/detail/index.ttml
  13. +39
    -38
      pages/index/searchbar/detail/index.js
  14. +39
    -5
      pages/order/detail/index.js
  15. +8
    -7
      pages/order/detail/index.json
  16. +1
    -1
      pages/order/detail/index.ttml
  17. +30
    -20
      project.config.json

BIN
assets/itemImg/merchantImgCover.png View File

Before After
Width: 200  |  Height: 200  |  Size: 8.3 KiB

+ 83
- 2
components/shop/shop.js View File

@@ -1,11 +1,92 @@
Component({
properties: {
mallList: {
value: [],
type: Array
}
},

data: {
list: [], // 广场、商户列表
mallNum: 0, // 适用商户数量
},

methods: {
// 跳转详情页
gotoDetail(e) {
console.log(e);
tt.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}&mallTenantId=${e.currentTarget.dataset.tenantid}`
})
},

// 跳转资质页面
goCertification(e) {
tt.navigateTo({
url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}`
})
},

//跳转地图页面
goMap(e) {
let {
latitude,
longitude
} = e.currentTarget.dataset.item
console.log(latitude, longitude);
tt.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
scale: 18,
success() {
console.log("打开地图成功");
},
fail(err) {
console.log("打开地图失败:", err.errMsg);
},
});
},

goFitShop() {
const arr = []
this.data.list.forEach(item => {
item.merchantVoList.forEach(el => {
arr.push(el)
})
})
tt.navigateTo({
url: `/pages/fitShop/fitShop?list=${JSON.stringify(arr)}`,
success: (res) => {},
fail: (res) => {},
});
},

expandList(e) {
const index = e.currentTarget.dataset.index
const arr = this.data.list
arr[index].expand = !arr[index].expand
this.setData({
list: arr
})
}
},
properties: {

ready() {
this.setData({
list: JSON.parse(JSON.stringify(this.properties.mallList))
})

console.log(this.data.mallList, 'mallList');
let mallNum = 0
this.data.list.forEach(item => {
mallNum += item.merchantVoList.length
})
this.setData({
mallNum: mallNum
})
},
methods: {

created() {

}
})

+ 211
- 0
components/shop/shop.less View File

@@ -0,0 +1,211 @@
.components {
display: block;
height: auto;
margin-top: 15rpx;
background-color: #fff;

.header {
height: 70rpx;

.applyshop {
float: left;
font-size: 30rpx;
line-height: 70rpx;
text-indent: 1em;
color: #333;
background: #fff;
font-weight: bold;
}

.goShop {
float: right;
font-size: 22rpx;
height: 70rpx;
line-height: 70rpx;
text-indent: 1em;
color: #a6a6a6;
background: #fff;
font-weight: bold;
margin-right: 25rpx;
}

.rightArrow {
float: right;
display: block;
width: 14rpx;
margin: 24rpx 30rpx 0 10rpx;
}
}

.body {
border-bottom: 10rpx solid #f4f5f9;

.mall {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15rpx;
margin-bottom: 15rpx;
padding-left: 25rpx;
padding-right: 65rpx;

.img {
width: 120rpx;
height: 120rpx;
}

.mallItem {
display: flex;
justify-content: space-between;
align-items: center;

.title {
font-size: 35rpx;
}
}
}

.goExpand {
text-align: center;
font-size: 25rpx;
color: #a6a6a6;

.rightArrowDown {
position: relative;
left: 50%;
transform: translate(-50%);
display: block;
width: 14rpx;
transform: rotate(90deg);
}

.rightArrowUp {
position: relative;
left: 50%;
transform: translate(-50%);
display: block;
width: 14rpx;
transform: rotate(-90deg);
}
}

.shop {
.posi {
/* position: relative; */
width: 100%;
background: #FFF;
margin-bottom: 20rpx;

.posi_logo {
position: relative;
width: 92%;
display: flex;
padding: 20rpx 0;
background: #fff;
margin: 0 auto;

view {
&:nth-child(1) {
image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
margin-right: 16rpx;
border: 1px solid #e5e5e5;
}
}
}

.name {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
width: 500rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.shopVoList {
white-space: nowrap !important;
overflow-y: scroll;
height: 90rpx !important;
width: 360rpx;
font-size: 16px;
color: #333;
letter-spacing: 0;

text {
font-size: 20rpx !important;
color: #b8b8b8 !important;
}
}

.telBox {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;

.telImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}

.telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
}

.certificationBox {
position: absolute;
right: 80rpx;
top: 0;
bottom: 0;
margin: auto;

.certificationImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}

.telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
}
}

.siteBox {
overflow: hidden;
width: 92%;
margin: 0 auto 1rpx auto;
padding-bottom: 10rpx;

.siteText {
width: 90%;
float: left;
font-size: 24rpx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.siteImg {
float: right;
width: 40rpx;
height: 40rpx;
}
}
}
}
}
}

+ 57
- 1
components/shop/shop.ttml View File

@@ -1 +1,57 @@
<view>123</view>
<view class="components">
<view class="header">
<view class='applyshop'>适用门店</view>
<!-- <image src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrow">
</image> -->
<view class="goShop">{{'共'+mallNum+'家门店适用'}}</view>
</view>
<view tt:for="{{list}}" tt:for-index="index" tt:key="index" class="body">
<view class="mall">
<image class="img" src="../../assets/itemImg/merchantImgCover.png"></image>
<view class="mallItem">
<view class="title">{{item.mallName}}</view>
</view>
</view>

<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>

<view class="shop" tt:if="{{item.expand}}">
<view class='posi' 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>
</view>

+ 178
- 1
components/shop/shop.ttss View File

@@ -1 +1,178 @@
/* c:\Users\Holy-Knight-IX\Desktop\Working Space\3.TikTok-MiniPro\ttc\components\shop\shop.ttss */
.components {
display: block;
height: auto;
margin-top: 15rpx;
background-color: #fff;
}
.components .header {
height: 70rpx;
}
.components .header .applyshop {
float: left;
font-size: 30rpx;
line-height: 70rpx;
text-indent: 1em;
color: #333;
background: #fff;
font-weight: bold;
}
.components .header .goShop {
float: right;
font-size: 22rpx;
height: 70rpx;
line-height: 70rpx;
text-indent: 1em;
color: #a6a6a6;
background: #fff;
font-weight: bold;
margin-right: 25rpx;
}
.components .header .rightArrow {
float: right;
display: block;
width: 14rpx;
margin: 24rpx 30rpx 0 10rpx;
}
.components .body {
border-bottom: 10rpx solid #f4f5f9;
}
.components .body .mall {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15rpx;
margin-bottom: 15rpx;
padding-left: 25rpx;
padding-right: 65rpx;
}
.components .body .mall .img {
width: 120rpx;
height: 120rpx;
}
.components .body .mall .mallItem {
display: flex;
justify-content: space-between;
align-items: center;
}
.components .body .mall .mallItem .title {
font-size: 35rpx;
}
.components .body .goExpand {
text-align: center;
font-size: 25rpx;
color: #a6a6a6;
}
.components .body .goExpand .rightArrowDown {
position: relative;
left: 50%;
transform: translate(-50%);
display: block;
width: 14rpx;
transform: rotate(90deg);
}
.components .body .goExpand .rightArrowUp {
position: relative;
left: 50%;
transform: translate(-50%);
display: block;
width: 14rpx;
transform: rotate(-90deg);
}
.components .body .shop .posi {
/* position: relative; */
width: 100%;
background: #FFF;
margin-bottom: 20rpx;
}
.components .body .shop .posi .posi_logo {
position: relative;
width: 92%;
display: flex;
padding: 20rpx 0;
background: #fff;
margin: 0 auto;
}
.components .body .shop .posi .posi_logo view:nth-child(1) image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
margin-right: 16rpx;
border: 1px solid #e5e5e5;
}
.components .body .shop .posi .posi_logo .name {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
width: 500rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.components .body .shop .posi .posi_logo .shopVoList {
white-space: nowrap !important;
overflow-y: scroll;
height: 90rpx !important;
width: 360rpx;
font-size: 16px;
color: #333;
letter-spacing: 0;
}
.components .body .shop .posi .posi_logo .shopVoList text {
font-size: 20rpx !important;
color: #b8b8b8 !important;
}
.components .body .shop .posi .posi_logo .telBox {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
.components .body .shop .posi .posi_logo .telBox .telImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}
.components .body .shop .posi .posi_logo .telBox .telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
.components .body .shop .posi .posi_logo .certificationBox {
position: absolute;
right: 80rpx;
top: 0;
bottom: 0;
margin: auto;
}
.components .body .shop .posi .posi_logo .certificationBox .certificationImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}
.components .body .shop .posi .posi_logo .certificationBox .telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
.components .body .shop .posi .siteBox {
overflow: hidden;
width: 92%;
margin: 0 auto 1rpx auto;
padding-bottom: 10rpx;
}
.components .body .shop .posi .siteBox .siteText {
width: 90%;
float: left;
font-size: 24rpx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.components .body .shop .posi .siteBox .siteImg {
float: right;
width: 40rpx;
height: 40rpx;
}

+ 24
- 23
components/store/index.js View File

@@ -15,47 +15,49 @@ Component({
*/
data: {
teljpgUrl: imgurl.teljpg.url,
showMore:false,
showMore: false,
more: "点击查看更多",
hidden:"hidden",
hidden: "hidden",
height: ""
},
/**
* 组件的方法列表
*/
methods: {
/**
* 跳转到门店列表的详情页面
*/
* 跳转到门店列表的详情页面
*/
gotoDetail(e) {
tt.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}`
})
},
goCertification(e){
goCertification(e) {
tt.navigateTo({
url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}`
})
},
goFitShop(){
goFitShop() {
tt.navigateTo({
url: `/pages/fitShop/fitShop?list=${JSON.stringify(this.data.merchantVoList)}`,
success: (res) => {
success: (res) => {
},
fail: (res) => {
},
});
},
goMap(e){

let {latitude,longitude} = e.currentTarget.dataset.item
console.log(latitude,longitude);
goMap(e) {
let {
latitude,
longitude
} = e.currentTarget.dataset.item
console.log(latitude, longitude);
tt.openLocation({
latitude:Number(latitude),
longitude:Number(longitude),
latitude: Number(latitude),
longitude: Number(longitude),
scale: 18,
success() {
console.log("打开地图成功");
@@ -64,11 +66,10 @@ Component({
console.log("打开地图失败:", err.errMsg);
},
});

},
// 点击查看更多
more: function () {
console.log(this.properties.merchantVoList,"merchantVoList");
console.log(this.properties.merchantVoList, "merchantVoList");
let that = this;
if (that.data.more == '点击查看更多') {
this.setData({
@@ -92,17 +93,17 @@ Component({
phoneNumber: e.target.dataset.merchantlinkphone
});
},
},
ready: function () {
let merchantVoList = this.properties.merchantVoList;
if (merchantVoList.length>0){
if (merchantVoList.length > 0) {
if (merchantVoList.length <= 4) {
this.setData({
height: merchantVoList.length * 140 + 'rpx',
showMore: false,
hidden:"hidden"
hidden: "hidden"
})
} else if (merchantVoList && merchantVoList.length > 4) {
this.setData({
@@ -111,4 +112,4 @@ Component({
}
}
}
});
});

+ 9
- 7
components/store/index.ttml View File

@@ -1,10 +1,9 @@

<view class="applyshopBox" bindtap="goFitShop">
<view class='applyshop'>适用门店</view>
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/chevron.png" mode="widthFix" class="genduoImg">
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/chevron.png" mode="widthFix" class="genduoImg">
</image>
<view class="goShop">{{merchantVoList.length+'家店适用'}}</view>
</view>
<!-- style='overflow:{{hidden}};height:{{height}}' -->
<view class='posi'>
@@ -22,15 +21,18 @@
</view>
</view>
<view class="telBox" tt:if="{{merchantVoList[0].linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{merchantVoList[0].linkLinePhone}}' class="telImg" src="{{teljpgUrl}}" mode="widthFix" />
<image bindtap='phone' data-merchantLinkPhone='{{merchantVoList[0].linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goCertification" data-id="{{merchantVoList[0].id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="certificationBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}"
bindtap="goCertification" data-id="{{merchantVoList[0].id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goMap" data-item="{{merchantVoList[0]}}">
<view class="siteBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goMap"
data-item="{{merchantVoList[0]}}">
<view class="siteText">{{merchantVoList[0].addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>


+ 7
- 4
pages/coupon/detail/index.js View File

@@ -96,7 +96,8 @@ Page({
idList: [],
showBox: false, //手机号授权框
spuIdObj: {},
mallTenantId: ''
mallTenantId: '',
mallList: []
},

/**
@@ -598,7 +599,6 @@ Page({
couponChannelId: couponChannelId
}
}).then(res => {
console.log(res.data, 'Merchant')
const keys = Object.keys(res.data)
const mallList = []
keys.forEach(item => {
@@ -606,11 +606,14 @@ Page({
const obj = {
tenantId: arr[0],
mallName: arr[1],
merchantVoList: res.data[item]
merchantVoList: res.data[item],
expand: false
}
mallList.push(obj)
})
console.log(mallList, 'mallList');
this.setData({
mallList: mallList
})
// if (res.data && res.data.length) {
// let merchantVoList = res.data
// let idList = []


+ 1
- 1
pages/coupon/detail/index.ttml View File

@@ -136,7 +136,7 @@
<!-- 适用门店 -->
<!-- <store merchantVoList="{{merchantVoList}}" tt:if="{{data.type!=12}}"></store> -->

<shop></shop>
<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop>

<view class='notes'>
<view class="notesH">购买须知</view>


+ 40
- 0
pages/couponorder/detail/index.js View File

@@ -60,6 +60,46 @@ Page({
}

},

getCouponMerchant(couponChannelId) { //获取适用门店
Http.get({
url: config.api.couponMerchant,
data: {
couponChannelId: couponChannelId
}
}).then(res => {
const keys = Object.keys(res.data)
const mallList = []
keys.forEach(item => {
const arr = item.split('|')
const obj = {
tenantId: arr[0],
mallName: arr[1],
merchantVoList: res.data[item],
expand: true
}
mallList.push(obj)
})
this.setData({
mallList: mallList
})
// if (res.data && res.data.length) {
// let merchantVoList = res.data
// let idList = []
// merchantVoList.map(item => {
// idList.push(item.id)
// })
// this.setData({
// idList: idList
// })
// this.getCouponList(idList) //获取推荐列表
// }
// this.setData({
// merchantVoList: res.data
// })
})
},

getHtml(couponOrderId) {
Http.get({
url: config.api.couponHtmlDetailForPkg,


+ 8
- 7
pages/couponorder/detail/index.json View File

@@ -1,9 +1,10 @@
{
"navigationBarTitleText": "使用优惠券",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store":"../../../components/store/index"
}
"navigationBarTitleText": "使用优惠券",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"shop": "../../../components/shop/shop"
}
}

+ 15
- 13
pages/couponorder/detail/index.ttml View File

@@ -1,11 +1,11 @@
<view class="BoxBg">
<!-- <navbar back home text="使用优惠券" background='#fff' color="#000"></navbar>
<view style="height:{{navigationBarHeight}} "></view> -->
<view class="container">
<view class="logoBox">
<image src="{{data.coverImg}}" class="logo" mode='aspectFill'/>
<image src="{{data.coverImg}}" class="logo" mode='aspectFill' />
</view>
<view class="quanDataBox">
<view class="qianTitle">{{data.title}}</view>
@@ -13,7 +13,7 @@
<view class="payBox">
<view class="selling">¥{{data.couponPrice/100}}</view>
<view class="original">¥{{data.price/100}}</view>
<view class="past" tt:if="{{data.autoRefund==1}}" >过期不退款</view>
<view class="past" tt:if="{{data.autoRefund==1}}">过期不退款</view>
</view>
<view class="timevalidity">有效期至:{{expiredTime}}</view>
<view class="manjian" tt:if="{{data.usePrice}}">满{{data.usePrice/100}}元可用</view>
@@ -23,7 +23,8 @@
<image tt:if="{{couponorderstatus==1}}" src="../../../assets/itemImg/wm01.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==2}}" src="../../../assets/itemImg/wm02.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==3}}" src="../../../assets/itemImg/wm03.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==0&&validStatus==0}}" src="../../../assets/itemImg/wm04.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==0&&validStatus==0}}" src="../../../assets/itemImg/wm04.jpg"
mode='widthFix'></image>
<view class="panel" tt:if="{{couponorderstatus==0&&validStatus!=0}}">
<view class="rqImg">
<canvas canvas-id="qrcode" style="width: 420rpx;; height: 420rpx;margin: 28rpx auto;" />
@@ -34,24 +35,25 @@
<view class="upDataRq">点一点刷新二维码</view>
</view>
<view class="coedTiem" tt:if="{{!showhieRq&&expiredSeconds>1}}">二维码在
<text style="color:red">{{expiredSeconds}}s</text>
后失效
<text style="color:red">{{expiredSeconds}}s</text>
后失效
</view>
<view class="barnum">
<view class="barnumtext">{{showIdFalg?code:codeS}}</view>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
</view>
</view>
</view>

<view class="shopData">
<store merchantVoList="{{data.merchantVoList}}"></store>
</view>
<view class="shopData">
<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop>
</view>
<image class="line" mode="widthFix" src="../../../assets/itemImg/topLine.png" />
<view class="note">
<view style='height:60rpx;line-height:60rpx;'>
<text class="shiji">实付金额:</text>
<text style='font-size:24rpx;text-align:right;color: #FF4949;float: right;margin-right: 50rpx;'>元</text>
<text
style='font-size:24rpx;text-align:right;color: #FF4949;float: right;margin-right: 50rpx;'>元</text>
<text class='moneys'>{{data.couponPrice/100}}</text>
</view>
<view class="orderDate" tt:if="{{data.couponOrderStatus==0}}">{{createDate}}</view>
@@ -65,7 +67,7 @@
<view class="notesText">购买须知</view>
<text class="introduce" tt:if="{{curHtml==''}}"> {{data.remark}}</text>
<!-- <text class="notesText" tt:if="{{curHtml==""}}">{{detailObj.remark}}</text> -->
<rich-text class="rich_text" tt:if="{{curHtml!=''}}" nodes="{{curHtml}}"></rich-text>
<rich-text class="rich_text" tt:if="{{curHtml!=''}}" nodes="{{curHtml}}"></rich-text>
</view>
</view>
</view>

+ 39
- 38
pages/index/searchbar/detail/index.js View File

@@ -34,7 +34,7 @@ Page({
canvasScale: 1.0, // 画布放大的倍数,因为如果保存的是一倍的分享图片的话,分享图会有点虚。所以保存的时候,canvasScale设置为2.0,wxss 里面的left: 500%;打开注释。就可保存两倍的分享图
},
//关闭海报
closePoste: function() {
closePoste: function () {
this.setData({
showpost: false
})
@@ -47,13 +47,13 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
let that = this;
if (options && options.id) {
this.setData({
id: options.id
});
that.getList(options.id);
that.getList(options.id, options.mallTenantId);
that.getCouponList(options.id);
this.setData({
currentTab: 0
@@ -63,7 +63,7 @@ Page({
/**
* 拨打电话
*/
phone: function(e) {
phone: function (e) {
let that = this;
tt.makePhoneCall({
phoneNumber: e.target.dataset.merchantlinkphone
@@ -72,7 +72,7 @@ Page({
/**
* 显示分享弹框
*/
showshare: function() {
showshare: function () {
this.setData({
isshare: true,
})
@@ -80,13 +80,13 @@ Page({
/**
* 隐藏分享弹框
*/
hidemodal: function() {
hidemodal: function () {
this.setData({
isshare: false,
})
},
//滑动切换
swiperTabView: function(e) {
swiperTabView: function (e) {
this.setData({
currentTab: e.detail.current
});
@@ -100,32 +100,32 @@ Page({
url: `/pages/canvas/index?merchantId=${this.data.id}`
})
}, */
showPoster: function() {
showPoster: function () {
//跳转到海报生成页
let that = this;
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
}).then(res => {
tt.navigateTo({
url: `/pages/canvas/index?merchantId=${that.data.id}`
})
}).catch(err => {
console.log(err)
if (err.code == 11004) {
// 用户昵称未授权
tt.redirectTo({
url: `/pages/getuserinfo/index?couponChannelId=${that.data.id}&fromflag=poster`
})
}
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
}).then(res => {
tt.navigateTo({
url: `/pages/canvas/index?merchantId=${that.data.id}`
})
}).catch(err => {
console.log(err)
if (err.code == 11004) {
// 用户昵称未授权
tt.redirectTo({
url: `/pages/getuserinfo/index?couponChannelId=${that.data.id}&fromflag=poster`
})

}
})

},
//点击切换
clickTab: function(e) {
clickTab: function (e) {
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
@@ -137,24 +137,25 @@ Page({
/**
* 获取商户详情
*/
getList: function(id) {
getList: function (id, mallTenantId) {
let that = this;
let data;
data = {
pageNum: that.data.page,
pageSize: 15,
id: id
id: id,
mallTenantId: mallTenantId
}
Http.get({
url: config.api.merchantList,
data: data
}).then(res => {
if (res.data.list.length==0){
if (res.data.list.length == 0) {
tt.showModal({
title: '提示',
content: '此商户已经停用',
confirmText: "返回",
showCancel:false,
showCancel: false,
success: function (res) {
if (res.confirm) {
tt.navigateBack({
@@ -185,12 +186,12 @@ Page({
* 获取商户活动信息 券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券 100.消费卡)
* 投放频道:(1.列表, 2.限时抢购, 3. banner图 4. 游戏 5.卡频道 6.砍价频道 7.拼团频道 8专题)
*/
getCouponList: function(id) {
getCouponList: function (id) {
let that = this;
let data;
data = {
status: 0,
merchantId: id,
// merchantId: id,
pageNum: that.data.page,
pageSize: 15,
}
@@ -201,7 +202,7 @@ Page({
that.setData({
couponList: res.data.page.list,
})
// if (res.data && res.data.qrCode){
// that.setData({
// qrCode: res.data.qrCode,
@@ -220,16 +221,16 @@ Page({
/**
* 获取多商铺列表
*/
onShareAppMessage: function(res) {
onShareAppMessage: function (res) {
app.globalData.previewFlag = true
let that = this;
let shareObj = {
title: that.data.data.merchantName,
path: `/pages/index/index?id=${that.data.id}&frommd=md&type=md`,
success: function(res) {
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {}
},
fail: function(error) {
fail: function (error) {
if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {}
}
};


+ 39
- 5
pages/order/detail/index.js View File

@@ -51,7 +51,8 @@ Page({
cardIf: false,
contentType: 0,
orderFlag: false, //判断是不是线上配送
tenantId: ''
tenantId: '',
mallList: []
},
handleRefund(event) {
const {
@@ -144,6 +145,42 @@ Page({
})
},

getCouponMerchant() { //获取适用门店
Http.get({
url: config.api.orderDetail,
data: {
orderId: this.data.orderId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
const couponChannelId = res.data.orders[0].couponChannelId
Http.get({
url: config.api.couponMerchant,
data: {
couponChannelId: couponChannelId
}
}).then(res => {
const keys = Object.keys(res.data)
const mallList = []
keys.forEach(item => {
const arr = item.split('|')
const obj = {
tenantId: arr[0],
mallName: arr[1],
merchantVoList: res.data[item],
expand: false
}
mallList.push(obj)
})
this.setData({
mallList: mallList
})
})
}).catch(err => {

})
},

goDetail() {
tt.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${this.data.order.couponChannelId}&mallTenantId=${this.data.mallTenantId}`,
@@ -648,7 +685,6 @@ Page({
*/
onLoad: function (options) {
this.getSeUrl()

if (options.mallTenantId) {
this.setData({
mallTenantId: options.mallTenantId,
@@ -664,7 +700,6 @@ Page({
// }
that.setData({
orderId: options.orderId,

});
tt.hideShareMenu()
if (options.cardIf) { //转赠 展示不需
@@ -676,8 +711,7 @@ Page({
title: "加载中"
});



this.getCouponMerchant() //获取可用商户
},
onShow: function () {
let that = this;


+ 8
- 7
pages/order/detail/index.json View File

@@ -1,9 +1,10 @@
{
"navigationBarTitleText": "订单详情",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index"
}
}
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"shop": "../../../components/shop/shop"
}
}

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

@@ -161,7 +161,7 @@
</view>
</view>
<!-- 适用门店 -->
<store merchantVoList="{{order.merchantVoList}}" tt:if="{{order.type!=12}}"></store>
<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop>

<vieW class="groupTitleBox">
<view class="groupTitle" tt:if="{{order.itemGroup.length>0}}">团购详情</view>


+ 30
- 20
project.config.json View File

@@ -1,24 +1,34 @@
{
"setting": {
"urlCheck": false,
"es6": true,
"newFeature": false,
"postcss": false,
"mockUpdate": true,
"minified": false,
"autoPush": false,
"scripts": false,
"mockLogin": false,
"autoCompile": true,
"localPlugins": false,
"IDEPreviewHotRestartCache": false
},
"appid": "ttde7ca8c141425a2301",
"projectname": "tt富茂C",
"condition": {
"miniprogram": {
"current": -1,
"list": []
"setting": {
"urlCheck": false,
"es6": true,
"newFeature": false,
"postcss": false,
"mockUpdate": true,
"minified": false,
"autoPush": false,
"scripts": false,
"mockLogin": false,
"autoCompile": true,
"localPlugins": false,
"IDEPreviewHotRestartCache": false
},
"appid": "ttde7ca8c141425a2301",
"projectname": "tt富茂C",
"condition": {
"miniprogram": {
"current": -1,
"list": [
{
"id": 1670551556787,
"name": "pages/coupon/detail/index",
"pathName": "pages/coupon/detail/index",
"query": "couponChannelId=760764417613029376&couponId=760349248090595328",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
}
]
}
}
}

Loading…
Cancel
Save