diff --git a/app.json b/app.json index f864159..a513ca1 100644 --- a/app.json +++ b/app.json @@ -14,7 +14,7 @@ "pages/main/index", "pages/index/searchbar/index", "pages/index/merchantList/index", - "pages/index/detail/index", + "pages/index/searchbar/detail/index", "pages/bargain/bargainDatail/bargainDatail", "pages/bargain/bargain", "pages/cardorder/index/index", diff --git a/ext.json b/ext.json index c8ec7e1..92aeec9 100644 --- a/ext.json +++ b/ext.json @@ -7,7 +7,7 @@ "etcpVersion": "release", "etcpCallbackUrl": "https://ciformall.youlane.cn/api/carCallback/etcpPaidCallback", "ifHaveWebSocket": "0", - "ifHaveCarModular": "0" + "ifHaveCarModular": "1" }, "name": "富茂客官开发", "weappId": "wxea71200db93d756b", diff --git a/pages/grade/grade.wxml b/pages/grade/grade.wxml index e8f5db5..29eb63f 100644 --- a/pages/grade/grade.wxml +++ b/pages/grade/grade.wxml @@ -1,5 +1,5 @@ - 生成规则 + 成长值增长规则 diff --git a/pages/index/searchbar/detail/index.js b/pages/index/searchbar/detail/index.js new file mode 100644 index 0000000..0630bfc --- /dev/null +++ b/pages/index/searchbar/detail/index.js @@ -0,0 +1,146 @@ +const Http = require("../../../../utils/HttpBasics"); +const imgurl = require("../../../../utils/imgurl"); +const config = require("../../../../config/config"); +let app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + teljpgUrl: imgurl.teljpg.url, + share01: imgurl.share01.url, + page: 1, + imglist: null, + shopVoList: [], + couponList: [], //活动劵列表 + data: { + currentTab: 0 + }, + id: null + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + let that = this; + if (options && options.id) { + this.setData({ + id: options.id + }); + that.getList(options.id); + that.getCouponList(options.id); + } + }, + /** + * 拨打电话 + */ + phone: function(e) { + let that = this; + wx.makePhoneCall({ + phoneNumber: e.target.dataset.merchantlinkphone + }); + }, + /** + * 获取商户详情 + */ + getList: function(id) { + let that = this; + let data; + data = { + pageNum: that.data.page, + pageSize: 15, + id: id + } + Http.get({ + url: config.api.merchantList, + data: data + }).then(res => { + that.setData({ + data: res.data.list[0], + shopVoList: res.data.list[0].shopVoList, + imglist: JSON.parse(res.data.list[0].coverPicture) ? JSON.parse(res.data.list[0].coverPicture) : res.data.list[0].merchantImgUrl, + }) + }) + .catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + /** + * 获取商户活动信息 券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券 100.消费卡) + * 投放频道:(1.列表, 2.限时抢购, 3. banner图 4. 游戏 5.卡频道 6.砍价频道 7.拼团频道 8专题) + */ + getCouponList: function(id) { + let that = this; + let data; + data = { + status: 0, + merchantId: id, + pageNum: that.data.page, + pageSize: 15, + } + Http.get({ + url: config.api.merchantCouponList, + data: data + }).then(res => { + that.setData({ + couponList: res.data.list, + }) + }) + .catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, + + /** + * 获取多商铺列表 + */ + shopList: function(e) { + wx.navigateTo({ + url: `/pages/index/merchantList/index?id=${e.currentTarget.dataset.id}` + }) + }, + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function() { + + }, + onShareAppMessage: function(options) { + var that = this; + var shareObj = { + title: that.data.data.title, + path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}`, + success: function(res) { + if (res.errMsg == 'shareAppMessage:ok') {} + }, + fail: function(error) { + if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {} + } + }; + // 来自页面内的按钮的转发 + if (options.from == 'button') { + var eData = options.target.dataset.id; + shareObj.path = `/pages/index/index?couponChannelId=${eData}`; + } + // 返回shareObj + return shareObj; + }, + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function() { + + }, +}) \ No newline at end of file diff --git a/pages/index/searchbar/detail/index.json b/pages/index/searchbar/detail/index.json new file mode 100644 index 0000000..1399980 --- /dev/null +++ b/pages/index/searchbar/detail/index.json @@ -0,0 +1,9 @@ +{ + "navigationBarTitleText": "商户详情", + "backgroundColor": "#f4f4f4", + "enablePullDownRefresh": true, + "usingComponents": { + "c-banner": "../../../../components/banner/index", + "c-coupons": "../../../../components/coupons/index" + } +} \ No newline at end of file diff --git a/pages/index/searchbar/detail/index.wxml b/pages/index/searchbar/detail/index.wxml new file mode 100644 index 0000000..40f826c --- /dev/null +++ b/pages/index/searchbar/detail/index.wxml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + {{data.merchantName}} + {{data.title}} + + + + + + + + + + + + 商户位置 + + + {{item.buildingName}}{{item.floorName}}--{{item.shopNumber}} + + + + + + + 联系商户 + + + + {{data.merchantLinkPhone}} + + + + + + + 商家简介 + + + {{data.summary}} + 信息完善中,敬请期待。 + + + + 优惠信息 + + + + + + + + 请您敬请期待 + 我们正在筹备一大波优惠活动 + + + {{content}} + {{loadingtext}} + + + + + + + \ No newline at end of file diff --git a/pages/index/searchbar/detail/index.wxss b/pages/index/searchbar/detail/index.wxss new file mode 100644 index 0000000..4af361b --- /dev/null +++ b/pages/index/searchbar/detail/index.wxss @@ -0,0 +1,214 @@ +.index-slide, swiper-item + .index-slide-image { + display: block; + width: 750rpx; + margin: 0 auto; + overflow: hidden; + position: relative; + height: 576rpx; +} + +.index-slide-view .dots { + position: absolute; + left: 0; + right: 0; + bottom: 20rpx; + display: flex; + justify-content: center; +} + +.index-slide-view .dots .dot { + margin: 0 8rpx; + width: 12rpx; + height: 12rpx; + background: #b6b6b7; + border-radius: 50%; + transition: all 0.6s; +} + +.index-slide-view .dots .dot.active { + background: #02c0ff; + width: 30rpx; + height: 12rpx; + border-radius: 10rpx; + opacity: 1; +} + +.bannerbg { + width: 100%; +} + +.bannerbg image { + display: block; + width: 100%; +} + +.merchant-detail { + width:92%; + padding:30rpx 4% 0; + background:#fff; + border-top-left-radius:20rpx; + border-top-right-radius:20rpx; + margin-top:-25rpx; +} + +.merchant-brand, .merchant-shop, .merchant-phone { + width: 100%; + display: flex; + padding: 20rpx 0; + background: #fff; + border-bottom: 1rpx solid #efefef; +} + +.merchant-brand view:nth-child(1) { + width: 160rpx; + border-radius: 16rpx; + height: 160rpx; +} + +.merchant-brand view:nth-child(1) image { + display: block; + width: 160rpx; + height: 160rpx; + border-radius: 16rpx; + border: 1px solid #e5e5e5; +} + +.merchant-brand view:nth-child(2) { + display: flex; + flex-direction: column; + flex: 6; + padding-left: 30rpx; +} + +.merchant-brand view:nth-child(2) text:nth-child(1) { + margin-top: 20rpx; +} + +.merchant-shop text, .merchant-phone text { + font-size: 30rpx; +} + +.merchant-shop view, .merchant-phone view { + display: flex; + flex: 2; + color: #333; +} + +.merchant-shop view:nth-child(2){ + font-size: 30rpx; +} + +.merchant-info { + display: block!important; + color: #999; + font-size: 28rpx; +} +.merchant-phones{ + padding: 20rpx 0; + display: block; + font-size: 30rpx; + border-top: 1rpx solid #efefef; +} +.tel { + right: 0; + top: 0; + bottom: 0; + margin: auto; + width: 50rpx; + height: 50rpx; +} + +.shoplists { + display: flex; +} + +.shoplists text { + flex: 2; +} + +.godetail { + color: #999; + font-size: 30rpx; + position: absolute; + right: 10rpx; +} +.merchants text{ + display: block; + text-align: left; + font-size:26rpx; + margin-bottom: 6rpx; +} +.merchants{ + display: block!important; +} +.merchant-brand{ + border: none!important; +} +.tabs-item.selected { + color:rgba(171,149,109,.8); + border-bottom:2px solid rgba(171,149,109,.8); +} +.tabs-item { + width:33.3%; + color:#C7C7CB; + font-size:28rpx; + display:flex; + align-items:center; + justify-content:center; + border-bottom:1rpx solid #D0D0D7; +} +.swiper-tab{ + text-align: left; + width: 100%; + display: flex; + flex-flow: row; + height: 88rpx; + line-height: 88rpx; + margin-left: -30rpx; +} +.swiper-tab-item { + color: #434343; + font-size: 30rpx; + padding-left:30rpx; + margin-right:30rpx; +} +.active-tab { + color: #1693FC; + border-bottom: 10rpx solid #1693FC; +} +.fenxiang { + position: absolute; + right: 0; + top: 27rpx; + width: 108rpx; +} + +.fenxiang image { + width: 108rpx; + position: absolute; + top: 0; + right: 0; +} +/* 商户活动列表 */ +.coupons c-coupons{ + width: 335rpx; + height: 354rpx; + margin-bottom: 22rpx; +} +.coupons c-coupons:nth-of-type(2n+1){ + float: left; +} +.coupons c-coupons:nth-of-type(2n){ + float: right; +} +.loading image { + width: 60rpx; + height: 60rpx; + vertical-align: middle; + margin-right: 10rpx; +} +.intro{ + font-size:30rpx; + line-height: 36rpx; +} \ No newline at end of file diff --git a/pages/index/searchbar/index.js b/pages/index/searchbar/index.js index 6e71a99..8461e89 100644 --- a/pages/index/searchbar/index.js +++ b/pages/index/searchbar/index.js @@ -35,7 +35,7 @@ Page({ */ gotoDetail(e){ wx.navigateTo({ - url: `/pages/index/detail/index?id=${e.currentTarget.dataset.id}` + url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}` }) }, /**