diff --git a/assets/itemImg/merchantImgCover.png b/assets/itemImg/merchantImgCover.png
new file mode 100644
index 0000000..ac6476d
Binary files /dev/null and b/assets/itemImg/merchantImgCover.png differ
diff --git a/components/shop/shop.js b/components/shop/shop.js
index 0b8744e..722c487 100644
--- a/components/shop/shop.js
+++ b/components/shop/shop.js
@@ -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() {
}
})
\ No newline at end of file
diff --git a/components/shop/shop.less b/components/shop/shop.less
new file mode 100644
index 0000000..8d3089f
--- /dev/null
+++ b/components/shop/shop.less
@@ -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;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/components/shop/shop.ttml b/components/shop/shop.ttml
index 5a955a7..21b5b56 100644
--- a/components/shop/shop.ttml
+++ b/components/shop/shop.ttml
@@ -1 +1,57 @@
-123
\ No newline at end of file
+
+
+
+
+
+
+ {{item.mallName}}
+
+
+
+
+ {{item.merchantVoList.length+'家门店适用'}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.merchantName}}
+
+
+ {{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}
+ ,
+
+
+
+
+
+ 电话
+
+
+
+ 资质
+
+
+
+ {{item.addr}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/shop.ttss b/components/shop/shop.ttss
index 1d36417..61ecf76 100644
--- a/components/shop/shop.ttss
+++ b/components/shop/shop.ttss
@@ -1 +1,178 @@
-/* c:\Users\Holy-Knight-IX\Desktop\Working Space\3.TikTok-MiniPro\ttc\components\shop\shop.ttss */
\ No newline at end of file
+.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;
+}
diff --git a/components/store/index.js b/components/store/index.js
index f0043a9..ab7d9cd 100644
--- a/components/store/index.js
+++ b/components/store/index.js
@@ -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({
}
}
}
-});
+});
\ No newline at end of file
diff --git a/components/store/index.ttml b/components/store/index.ttml
index 93fe529..0617844 100644
--- a/components/store/index.ttml
+++ b/components/store/index.ttml
@@ -1,10 +1,9 @@
-
适用门店
-
+
{{merchantVoList.length+'家店适用'}}
-
+
@@ -22,15 +21,18 @@
-
+
电话
-
-
+
+
资质
-
+
{{merchantVoList[0].addr}}
diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js
index 53d39ab..cf73fad 100644
--- a/pages/coupon/detail/index.js
+++ b/pages/coupon/detail/index.js
@@ -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 = []
diff --git a/pages/coupon/detail/index.ttml b/pages/coupon/detail/index.ttml
index d262581..f9b47d8 100644
--- a/pages/coupon/detail/index.ttml
+++ b/pages/coupon/detail/index.ttml
@@ -136,7 +136,7 @@
-
+
购买须知
diff --git a/pages/couponorder/detail/index.js b/pages/couponorder/detail/index.js
index 5237656..91c9545 100644
--- a/pages/couponorder/detail/index.js
+++ b/pages/couponorder/detail/index.js
@@ -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,
diff --git a/pages/couponorder/detail/index.json b/pages/couponorder/detail/index.json
index 33b5282..1cc9c5f 100644
--- a/pages/couponorder/detail/index.json
+++ b/pages/couponorder/detail/index.json
@@ -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"
+ }
}
\ No newline at end of file
diff --git a/pages/couponorder/detail/index.ttml b/pages/couponorder/detail/index.ttml
index b78959c..039b2d6 100644
--- a/pages/couponorder/detail/index.ttml
+++ b/pages/couponorder/detail/index.ttml
@@ -1,11 +1,11 @@
-
+
-
+
-
+
{{data.title}}
@@ -13,7 +13,7 @@
¥{{data.couponPrice/100}}
¥{{data.price/100}}
- 过期不退款
+ 过期不退款
有效期至:{{expiredTime}}
满{{data.usePrice/100}}元可用
@@ -23,7 +23,8 @@
-
+
@@ -34,24 +35,25 @@
点一点刷新二维码
二维码在
- {{expiredSeconds}}s
- 后失效
+ {{expiredSeconds}}s
+ 后失效
{{showIdFalg?code:codeS}}
-
+
-
-
-
+
+
+
实付金额:
- 元
+ 元
{{data.couponPrice/100}}
{{createDate}}
@@ -65,7 +67,7 @@
购买须知
{{data.remark}}
-
+
diff --git a/pages/index/searchbar/detail/index.js b/pages/index/searchbar/detail/index.js
index c5e2e36..bacca6a 100644
--- a/pages/index/searchbar/detail/index.js
+++ b/pages/index/searchbar/detail/index.js
@@ -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') {}
}
};
diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js
index dbac5f0..7a3ea4e 100644
--- a/pages/order/detail/index.js
+++ b/pages/order/detail/index.js
@@ -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;
diff --git a/pages/order/detail/index.json b/pages/order/detail/index.json
index d477d35..40cb223 100644
--- a/pages/order/detail/index.json
+++ b/pages/order/detail/index.json
@@ -1,9 +1,10 @@
{
"navigationBarTitleText": "订单详情",
- "navigationBarBackgroundColor": "#fff",
- "navigationBarTextStyle": "black",
- "usingComponents": {
- "navbar": "../../../components/navbar/navbar",
- "store": "../../../components/store/index"
- }
- }
\ No newline at end of file
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "black",
+ "usingComponents": {
+ "navbar": "../../../components/navbar/navbar",
+ "store": "../../../components/store/index",
+ "shop": "../../../components/shop/shop"
+ }
+}
\ No newline at end of file
diff --git a/pages/order/detail/index.ttml b/pages/order/detail/index.ttml
index b6e6ab0..5fc6c48 100644
--- a/pages/order/detail/index.ttml
+++ b/pages/order/detail/index.ttml
@@ -161,7 +161,7 @@
-
+
团购详情
diff --git a/project.config.json b/project.config.json
index 53ef8c6..1c3787c 100644
--- a/project.config.json
+++ b/project.config.json
@@ -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"
}
+ ]
}
+ }
}