| @@ -13,6 +13,8 @@ | |||||
| "pages/topicDetail/index", | "pages/topicDetail/index", | ||||
| "pages/main/index", | "pages/main/index", | ||||
| "pages/index/searchbar/index", | "pages/index/searchbar/index", | ||||
| "pages/index/merchantList/index", | |||||
| "pages/index/detail/index", | |||||
| "pages/bargain/bargainDatail/bargainDatail", | "pages/bargain/bargainDatail/bargainDatail", | ||||
| "pages/bargain/bargain", | "pages/bargain/bargain", | ||||
| "pages/cardorder/index/index", | "pages/cardorder/index/index", | ||||
| @@ -2,6 +2,7 @@ let config = require("../../config/config.js"); | |||||
| let app = getApp(); | let app = getApp(); | ||||
| const Http = require("../../utils/HttpBasics"); | const Http = require("../../utils/HttpBasics"); | ||||
| const util = require("../../utils/util"); | const util = require("../../utils/util"); | ||||
| const imgurl = require("../../utils/imgurl"); | |||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| data: {}, | data: {}, | ||||
| @@ -9,6 +10,7 @@ Page({ | |||||
| orderId: "", | orderId: "", | ||||
| day: "", | day: "", | ||||
| hour: "", | hour: "", | ||||
| wmhome: imgurl.wmhome.url, | |||||
| minute: "", | minute: "", | ||||
| nodes: '' | nodes: '' | ||||
| }, | }, | ||||
| @@ -41,6 +43,11 @@ Page({ | |||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| goback: function () { | |||||
| wx.switchTab({ | |||||
| url: '/pages/main/index', | |||||
| }) | |||||
| }, | |||||
| gotoactdetail:function(){ | gotoactdetail:function(){ | ||||
| let that = this; | let that = this; | ||||
| console.log(that.data.data.detail) | console.log(that.data.data.detail) | ||||
| @@ -1,3 +1,4 @@ | |||||
| <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||||
| <!-- banner活动详情页面 --> | <!-- banner活动详情页面 --> | ||||
| <view class='coupons'> | <view class='coupons'> | ||||
| <view class="coupons-body"> | <view class="coupons-body"> | ||||
| @@ -349,6 +349,7 @@ navigator:nth-of-type(2n+1) { | |||||
| border-radius: 16rpx; | border-radius: 16rpx; | ||||
| padding-bottom: 21rpx; | padding-bottom: 21rpx; | ||||
| overflow: hidden; | overflow: hidden; | ||||
| height: 486rpx; | |||||
| } | } | ||||
| /* .coupons1-border { | /* .coupons1-border { | ||||
| @@ -464,6 +465,7 @@ navigator:nth-of-type(2n+1) { | |||||
| width: 300rpx; | width: 300rpx; | ||||
| color: #999; | color: #999; | ||||
| letter-spacing: 0; | letter-spacing: 0; | ||||
| height: 30rpx; | |||||
| } | } | ||||
| .coupons1-info-manjian { | .coupons1-info-manjian { | ||||
| @@ -540,3 +542,25 @@ scroll-view { | |||||
| font-size: 26rpx; | font-size: 26rpx; | ||||
| line-height: 15rpx; | line-height: 15rpx; | ||||
| } | } | ||||
| button::after{ border: none; } | |||||
| .goback{ | |||||
| position: fixed; | |||||
| right: 50rpx; | |||||
| bottom: 60rpx; | |||||
| width:100rpx!important; | |||||
| height:100rpx; | |||||
| z-index: 100; | |||||
| background:rgba(255,255,255,1); | |||||
| line-height: 95rpx; | |||||
| border:1rpx solid rgba(227,227,227,1); | |||||
| border-radius:50%; | |||||
| } | |||||
| .goback image{ | |||||
| position: absolute; | |||||
| width: 60rpx; | |||||
| left: 0; | |||||
| right: 0; | |||||
| top: 0; | |||||
| bottom: 0; | |||||
| margin: auto; | |||||
| } | |||||
| @@ -50,27 +50,6 @@ Page({ | |||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| onShow: function () { | |||||
| let that = this; | |||||
| Http.get({ | |||||
| url: config.api.businessList | |||||
| }).then(res => { | |||||
| console.log(res) | |||||
| let businessObj = [{ id: 0, title: "全部", type: 1, createDate: 0}]; | |||||
| that.setData({ | |||||
| tabs: res.data.concat(businessObj).sort(compare("createDate")) | |||||
| }); | |||||
| console.log(that.data.tabs) | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | |||||
| //点击跳转到券详情页面 | //点击跳转到券详情页面 | ||||
| gotouse: function (e) { | gotouse: function (e) { | ||||
| console.log(e.currentTarget.dataset.couponid) | console.log(e.currentTarget.dataset.couponid) | ||||
| @@ -13,15 +13,18 @@ Page({ | |||||
| }, | }, | ||||
| onLoad: function(options) { | onLoad: function(options) { | ||||
| var that = this; | var that = this; | ||||
| console.log(options) | |||||
| if (options.couponChannelId && !options.cuserId||options.orderId) { | if (options.couponChannelId && !options.cuserId||options.orderId) { | ||||
| that.setData({ | that.setData({ | ||||
| couponChannelId: options.couponChannelId, | couponChannelId: options.couponChannelId, | ||||
| orderId:options.orderId | orderId:options.orderId | ||||
| }) | }) | ||||
| } | } | ||||
| this.setData({ | |||||
| optionData:options | |||||
| that.setData({ | |||||
| optionData: wx.getStorageSync('options') ? JSON.parse(wx.getStorageSync('options')):null | |||||
| }) | }) | ||||
| console.log(that.data.optionData) | |||||
| if (options&&options.path == 'index') { | if (options&&options.path == 'index') { | ||||
| that.setData({ | that.setData({ | ||||
| path: options.path | path: options.path | ||||
| @@ -31,7 +34,6 @@ Page({ | |||||
| * 来自转赠 | * 来自转赠 | ||||
| */ | */ | ||||
| if (options.couponChannelId && options.cuserId){ | if (options.couponChannelId && options.cuserId){ | ||||
| console.log(1231231231,options) | |||||
| that.setData({ | that.setData({ | ||||
| couponChannelId: options.couponChannelId, | couponChannelId: options.couponChannelId, | ||||
| cuserId: options.cuserId, | cuserId: options.cuserId, | ||||
| @@ -107,6 +109,10 @@ Page({ | |||||
| } else if (that.data.optionData.id && app.globalData.type == 'gm') { | } else if (that.data.optionData.id && app.globalData.type == 'gm') { | ||||
| // 游戏页面 | // 游戏页面 | ||||
| that.getGameOne(app.globalData.token, that.data.optionData.id) | that.getGameOne(app.globalData.token, that.data.optionData.id) | ||||
| } else if (that.data.optionData.id && app.globalData.type == 'td') { | |||||
| wx.redirectTo({ | |||||
| url: `/pages/topicDetail/index?id=${that.data.optionData.id}` | |||||
| }); | |||||
| } else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { | } else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { | ||||
| // 宣传页详情 | // 宣传页详情 | ||||
| if (that.data.optionData.bt == '2') { | if (that.data.optionData.bt == '2') { | ||||
| @@ -191,15 +197,6 @@ Page({ | |||||
| url: '/pages/topicDetail/index' | url: '/pages/topicDetail/index' | ||||
| }); | }); | ||||
| } | } | ||||
| /** | |||||
| * options有问题 | |||||
| */ | |||||
| // else if (options && options.id && app.globalData.type == 'td') { | |||||
| // // 专题活动页 | |||||
| // wx.redirectTo({ | |||||
| // url: '/pages/topicDetail/index' | |||||
| // }); | |||||
| // } | |||||
| else if (app.globalData.type == 'ml') { | else if (app.globalData.type == 'ml') { | ||||
| // 门店 | // 门店 | ||||
| wx.switchTab({ | wx.switchTab({ | ||||
| @@ -0,0 +1,103 @@ | |||||
| const Http = require("../../../utils/HttpBasics"); | |||||
| const imgurl = require("../../../utils/imgurl"); | |||||
| const config = require("../../../config/config"); | |||||
| let app = getApp(); | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| teljpgUrl: imgurl.teljpg.url, | |||||
| page: 1, | |||||
| imglist:null, | |||||
| shopVoList:[], | |||||
| data:{}, | |||||
| id:null | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| let that=this; | |||||
| this.setData({ | |||||
| id: options.id | |||||
| }); | |||||
| that.getList(options.id); | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| let that = this; | |||||
| }, | |||||
| /** | |||||
| * 拨打电话 | |||||
| */ | |||||
| 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), | |||||
| }) | |||||
| }) | |||||
| .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 () { | |||||
| }, | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh: function () { | |||||
| }, | |||||
| }) | |||||
| @@ -0,0 +1,8 @@ | |||||
| { | |||||
| "navigationBarTitleText": "商户详情", | |||||
| "backgroundColor": "#f4f4f4", | |||||
| "enablePullDownRefresh": true, | |||||
| "usingComponents": { | |||||
| "c-banner": "../../../components/banner/index" | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,70 @@ | |||||
| <!--pages/index/detail/index.wxml--> | |||||
| <view> | |||||
| <swiper class="index-slide" autoplay="true" circular="false"> | |||||
| <block wx:for="{{imglist}}" wx:key="unique"> | |||||
| <swiper-item> | |||||
| <image src="{{item}}" class="index-slide-image" /> | |||||
| </swiper-item> | |||||
| </block> | |||||
| </swiper> | |||||
| <!-- <view class='merchant-detail'> | |||||
| <view>{{data.merchantName}}</view> | |||||
| </view> --> | |||||
| <view class='merchant-detail'> | |||||
| <!-- 品牌信息 --> | |||||
| <view class='merchant-brand'> | |||||
| <view> | |||||
| <image src='{{data.brandImg}}'></image> | |||||
| </view> | |||||
| <view> | |||||
| <text>{{data.merchantName}}</text> | |||||
| <text>{{data.title}}</text> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 一个商铺 --> | |||||
| <!-- <view class='merchant-shop' wx:if="{{shopVoList.length==1}}"> | |||||
| <view> | |||||
| <text>商户位置</text> | |||||
| </view> | |||||
| <view> | |||||
| <text>{{shopVoList[0].buildingName}} {{shopVoList[0].floorName}} {{shopVoList[0].shopNumber}}</text> | |||||
| <text></text> | |||||
| </view> | |||||
| </view> --> | |||||
| <!-- 多个商铺 --> | |||||
| <view class='merchant-shop'> | |||||
| <view > | |||||
| <view > | |||||
| <text>商户位置</text> | |||||
| </view> | |||||
| <view> | |||||
| <text wx:if="{{shopVoList.length==1}}">{{shopVoList[0].buildingName}} {{shopVoList[0].floorName}} {{shopVoList[0].shopNumber}}</text> | |||||
| <text wx:else>{{shopVoList[0].buildingName}} {{shopVoList[0].floorName}} {{shopVoList[0].shopNumber}}..</text> | |||||
| <text wx:if="{{shopVoList.length!=1}}" class='godetail' data-id='{{data.id}}' bindtap='shopList'>详情 ></text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 联系方式 --> | |||||
| <view class='merchant-phone'> | |||||
| <view > | |||||
| <text>联系商户</text> | |||||
| </view> | |||||
| <view> | |||||
| <view> | |||||
| <text>{{data.merchantLinkPhone}}</text> | |||||
| </view> | |||||
| <image bindtap='phone' data-merchantLinkPhone='{{data.merchantLinkPhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" /> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 商户简介 --> | |||||
| <view class='merchant-phone'> | |||||
| <view> | |||||
| <text>商户简介</text> | |||||
| </view> | |||||
| </view> | |||||
| <view class='merchant-info'> | |||||
| <text wx:if="{{data.summary}}">{{data.summary}}</text> | |||||
| <text wx:else>{{"信息完善中,敬请期待。"}}</text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -0,0 +1,119 @@ | |||||
| /* pages/index/detail/index.wxss */ | |||||
| .index-slide-view{ | |||||
| position: relative; | |||||
| width: 750rpx; | |||||
| height: 260rpx; | |||||
| overflow: hidden; | |||||
| /* margin:-132rpx auto 0; */ | |||||
| border-radius:16rpx; | |||||
| box-shadow: 0 6px 20px 0 rgba(0,0,0,0.15); | |||||
| } | |||||
| .index-slide, | |||||
| swiper-item | |||||
| .index-slide-image { | |||||
| display: block; | |||||
| width: 750rpx; | |||||
| height: 560rpx; | |||||
| margin: 0 auto; | |||||
| overflow: hidden; | |||||
| position: relative; | |||||
| } | |||||
| .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 .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%; | |||||
| margin: 0 auto; | |||||
| } | |||||
| .merchant-brand,.merchant-shop,.merchant-phone{ | |||||
| width:100%; | |||||
| display:flex; | |||||
| padding:20rpx 0; | |||||
| background:#fff; | |||||
| } | |||||
| .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,.merchant-phone{ | |||||
| height: 60rpx; | |||||
| line-height: 60rpx; | |||||
| } | |||||
| .merchant-shop view,.merchant-phone view{ | |||||
| display:flex; | |||||
| flex: 4; | |||||
| color:#333; | |||||
| } | |||||
| .merchant-shop view:nth-child(2),.merchant-phone view:nth-child(2){ | |||||
| font-size: 30rpx; | |||||
| } | |||||
| .merchant-info{ | |||||
| padding:0 30rpx; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| .tel { | |||||
| right: 0; | |||||
| top: 0; | |||||
| bottom: 0; | |||||
| margin: auto; | |||||
| width: 50rpx; | |||||
| height: 50rpx; | |||||
| } | |||||
| .shoplists{ | |||||
| display: flex; | |||||
| } | |||||
| .shoplists text{ | |||||
| flex: 2; | |||||
| } | |||||
| .godetail{ | |||||
| color:#999999; | |||||
| font-size:30rpx; | |||||
| position: absolute; | |||||
| right: 10rpx; | |||||
| } | |||||
| @@ -8,21 +8,17 @@ Page({ | |||||
| /** | /** | ||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| */ | */ | ||||
| data: { | |||||
| }, | |||||
| data: {}, | |||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| console.log(options); | |||||
| let that = this; | let that = this; | ||||
| /** | /** | ||||
| * 根据接收到的参数的值,判断跳转到哪个页面 | * 根据接收到的参数的值,判断跳转到哪个页面 | ||||
| */ | */ | ||||
| if (options && options.type) { | if (options && options.type) { | ||||
| app.globalData.type = options.type; | app.globalData.type = options.type; | ||||
| console.log(app.globalData.type) | |||||
| } | } | ||||
| if (decodeURIComponent(options.scene) == "undefined") { | if (decodeURIComponent(options.scene) == "undefined") { | ||||
| that.setData({ | that.setData({ | ||||
| @@ -59,6 +55,9 @@ Page({ | |||||
| options.id = this.data.newArr[2]; | options.id = this.data.newArr[2]; | ||||
| } else if (options.type == 'sd') { | } else if (options.type == 'sd') { | ||||
| options.couponChannelId = this.data.newArr[2]; | options.couponChannelId = this.data.newArr[2]; | ||||
| } else if (options.type == 'td') { | |||||
| // 专题活动页 | |||||
| options.id = this.data.newArr[2]; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -71,7 +70,6 @@ Page({ | |||||
| wx.setStorageSync('imgurl', imgurl) | wx.setStorageSync('imgurl', imgurl) | ||||
| app.getLocation(); | app.getLocation(); | ||||
| if (options.couponChannelId || options.orderId || options.id) { | if (options.couponChannelId || options.orderId || options.id) { | ||||
| console.log(options, 33333333333) | |||||
| that.userLogin(options); | that.userLogin(options); | ||||
| } else { | } else { | ||||
| that.userLogin() | that.userLogin() | ||||
| @@ -113,7 +111,6 @@ Page({ | |||||
| }); | }); | ||||
| return; | return; | ||||
| } | } | ||||
| if (options && options.couponChannelId && app.globalData.type == 'cd') { | if (options && options.couponChannelId && app.globalData.type == 'cd') { | ||||
| // 跳转普通券/消费卡/限时秒杀/砍价详情 | // 跳转普通券/消费卡/限时秒杀/砍价详情 | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| @@ -145,7 +142,12 @@ Page({ | |||||
| url: `/pages/bannerdetail/index?id=${options.id}`, | url: `/pages/bannerdetail/index?id=${options.id}`, | ||||
| }) | }) | ||||
| } | } | ||||
| } else if (options && options.orderId && app.globalData.type == 'bg') { | |||||
| } else if (options && options.id && app.globalData.type == 'td'){ | |||||
| wx.redirectTo({ | |||||
| url: `/pages/topicDetail/index?id=${options.id}` | |||||
| }); | |||||
| } | |||||
| else if (options && options.orderId && app.globalData.type == 'bg') { | |||||
| // 参与砍价 | // 参与砍价 | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`, | url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`, | ||||
| @@ -210,12 +212,7 @@ Page({ | |||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| url: '/pages/discountCardList/discountCardList' | url: '/pages/discountCardList/discountCardList' | ||||
| }); | }); | ||||
| } else if (options && options.id && app.globalData.type == 'td') { | |||||
| // 专题活动页 | |||||
| wx.redirectTo({ | |||||
| url: `/pages/topicDetail/index?id=${options.id}` | |||||
| }); | |||||
| } else if (app.globalData.type == 'ml') { | |||||
| } else if (app.globalData.type == 'ml') { | |||||
| // 门店 | // 门店 | ||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: '/pages/index/searchbar/index' | url: '/pages/index/searchbar/index' | ||||
| @@ -263,7 +260,6 @@ Page({ | |||||
| * 用户登录 | * 用户登录 | ||||
| */ | */ | ||||
| userLogin: function (options) { | userLogin: function (options) { | ||||
| console.log(1111, options, 2222222222) | |||||
| var that = this; | var that = this; | ||||
| // 登录 | // 登录 | ||||
| wx.login({ | wx.login({ | ||||
| @@ -3,4 +3,4 @@ Page{ | |||||
| width: 100%; | width: 100%; | ||||
| background:#fff; | background:#fff; | ||||
| opacity: 0; | opacity: 0; | ||||
| } | |||||
| } | |||||
| @@ -0,0 +1,66 @@ | |||||
| const Http = require("../../../utils/HttpBasics"); | |||||
| const imgurl = require("../../../utils/imgurl"); | |||||
| const config = require("../../../config/config"); | |||||
| let app = getApp(); | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| page: 1, | |||||
| shopVoList: [], | |||||
| data: {}, | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| let that = this; | |||||
| that.getList(options.id); | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| }, | |||||
| /** | |||||
| * 获取商户详情 | |||||
| */ | |||||
| 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 | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "navigationBarTitleText": "商户位置", | |||||
| "backgroundColor": "#f4f4f4", | |||||
| "enablePullDownRefresh": true, | |||||
| "usingComponents": {} | |||||
| } | |||||
| @@ -0,0 +1,12 @@ | |||||
| <view class='merchant-detail'> | |||||
| <!-- 商户列表 --> | |||||
| <view class='merchant-brand'wx:for="{{shopVoList}}" wx:key="unique"> | |||||
| <view> | |||||
| <image src='{{data.brandImg}}'></image> | |||||
| </view> | |||||
| <view> | |||||
| <text>{{data.merchantName}}</text> | |||||
| <text>{{item.shopNumber}}, {{item.buildingName}} {{item.floorName}}</text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| @@ -0,0 +1,51 @@ | |||||
| /* pages/index/merchantList/index.wxss */ | |||||
| .merchant-detail{ | |||||
| width: 92%; | |||||
| margin: 0 auto; | |||||
| } | |||||
| .merchant-brand{ | |||||
| /* width:100%; */ | |||||
| display:flex; | |||||
| /* padding:20rpx 0; */ | |||||
| background:#fff; | |||||
| border-bottom:1rpx solid #efefef; | |||||
| width:690rpx; | |||||
| height:197rpx !important; | |||||
| background:#fff; | |||||
| padding:30rpx 0 0; | |||||
| margin:0 auto 40rpx; | |||||
| border-radius:16rpx; | |||||
| border-top:8rpx solid #02b7ff; | |||||
| box-shadow:0 6px 20px 0 rgba(0, 0, 0, 0.10); | |||||
| } | |||||
| .merchant-brand view:nth-child(1) { | |||||
| width:160rpx; | |||||
| border-radius:16rpx; | |||||
| height:160rpx; | |||||
| padding-left: 10rpx; | |||||
| } | |||||
| .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) text:nth-child(1){ | |||||
| margin-top: 20rpx; | |||||
| padding: 10rpx 0; | |||||
| font-size:35rpx; | |||||
| font-weight: bold; | |||||
| color:#333; | |||||
| } | |||||
| .merchant-brand view:nth-child(2) text:nth-child(2){ | |||||
| font-size: 28rpx; | |||||
| color: #333; | |||||
| } | |||||
| .merchant-brand view:nth-child(2) { | |||||
| display:flex; | |||||
| flex-direction:column; | |||||
| flex:8; | |||||
| padding-left:80rpx; | |||||
| } | |||||
| @@ -21,7 +21,6 @@ Page({ | |||||
| jumpIndex(e) { | jumpIndex(e) { | ||||
| let that = this; | let that = this; | ||||
| let index = e.currentTarget.dataset.menuindex; | let index = e.currentTarget.dataset.menuindex; | ||||
| console.log(index) | |||||
| that.setData({ | that.setData({ | ||||
| indexId: index, | indexId: index, | ||||
| businessId: index | businessId: index | ||||
| @@ -35,16 +34,15 @@ Page({ | |||||
| * 跳转到门店列表的详情页面 | * 跳转到门店列表的详情页面 | ||||
| */ | */ | ||||
| gotoDetail(e){ | gotoDetail(e){ | ||||
| console.log(e) | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/', | |||||
| url: `/pages/index/detail/index?id=${e.currentTarget.dataset.id}` | |||||
| }) | }) | ||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| var that = this | |||||
| let that = this; | |||||
| wx.getSystemInfo({ | wx.getSystemInfo({ | ||||
| success: function (res) { | success: function (res) { | ||||
| that.setData({ | that.setData({ | ||||
| @@ -52,34 +50,26 @@ Page({ | |||||
| }); | }); | ||||
| } | } | ||||
| }); | }); | ||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| let that = this; | |||||
| that.getBussiness(); | that.getBussiness(); | ||||
| that.getList(1,0); | |||||
| that.getList(1, 0); | |||||
| }, | }, | ||||
| getBussiness:function(){ | getBussiness:function(){ | ||||
| let that = this; | let that = this; | ||||
| Http.get({ | Http.get({ | ||||
| url: config.api.businessList, | url: config.api.businessList, | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res) | |||||
| let businessObj = [{ id: 0, title: "全部", type: 1, createDate:0}]; | |||||
| that.setData({ | that.setData({ | ||||
| lists: res.data.concat(businessObj).sort(compare("createDate")) | |||||
| lists: [{ id: 0, title: "全部", type: 1 }].concat(res.data) | |||||
| }); | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | }); | ||||
| }) | }) | ||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | }, | ||||
| getList: function (page, businessId) { | getList: function (page, businessId) { | ||||
| let that = this; | let that = this; | ||||
| @@ -149,16 +139,3 @@ Page({ | |||||
| } | } | ||||
| } | } | ||||
| }) | }) | ||||
| function compare(pro) { | |||||
| return function (obj2, obj1) { | |||||
| var val1 = obj1[pro]; | |||||
| var val2 = obj2[pro]; | |||||
| if (val1 < val2) { | |||||
| return 1; | |||||
| } else if (val1 > val2) { | |||||
| return -1; | |||||
| } else { | |||||
| return 0; | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -3,11 +3,11 @@ | |||||
| <view style='float: left' class='left'> | <view style='float: left' class='left'> | ||||
| <scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" class='scrollY' style='height: {{winHeight}}px'> | <scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" class='scrollY' style='height: {{winHeight}}px'> | ||||
| <view class='all clear'> | <view class='all clear'> | ||||
| <block wx:key="lists" wx:for="{{lists}}"> | |||||
| <view bindtap='jumpIndex' data-menuindex='{{index}}'> | |||||
| <block wx:for="{{lists}}" wx:key="{{index}}"> | |||||
| <view bindtap='jumpIndex' data-menuindex='{{item.id}}'> | |||||
| <view class='text-style'> | <view class='text-style'> | ||||
| <text class="{{indexId==index?'active1':''}}">{{item.title}}</text> | |||||
| <text class="{{indexId==index?'active':''}}"></text> | |||||
| <text class="{{indexId==item.id?'active1':''}}">{{item.title}}</text> | |||||
| <text class="{{indexId==item.id?'active':''}}"></text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </block> | </block> | ||||
| @@ -185,12 +185,9 @@ Component({ | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.businessList | url: config.api.businessList | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res) | |||||
| let businessObj = [{ id: 0, title: "全部", type: 1, createDate:0}]; | |||||
| that.setData({ | that.setData({ | ||||
| tabs: res.data.concat(businessObj).sort(compare("createDate")) | |||||
| tabs: [{ id: 0, title: "全部", type: 1 }].concat(res.data) | |||||
| }); | }); | ||||
| console.log(that.data.tabs) | |||||
| }) | }) | ||||
| .catch(err => { | .catch(err => { | ||||
| wx.showToast({ | wx.showToast({ | ||||
| @@ -13,8 +13,7 @@ | |||||
| <text class='remainchengzhangzhi'>还需{{upgradeScore}}成长值可升级</text> | <text class='remainchengzhangzhi'>还需{{upgradeScore}}成长值可升级</text> | ||||
| <view class="view"> | <view class="view"> | ||||
| <!-- 成长值<text class="score">{{score}}</text> --> | <!-- 成长值<text class="score">{{score}}</text> --> | ||||
| <progress percent="{{upgradePercent}}" wx:if="{{upgradeScore!=0}}" stroke-width="6" activeColor="#b2743d" /> | |||||
| <progress percent="0" wx:if="{{upgradeScore==0}}" stroke-width="6" activeColor="#b2743d" /> | |||||
| <progress percent="{{upgradePercent}}" stroke-width="6" activeColor="#b2743d" /> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <!-- 积分 --> | <!-- 积分 --> | ||||
| @@ -2,5 +2,6 @@ | |||||
| "navigationBarTitleText": "拼团详情", | "navigationBarTitleText": "拼团详情", | ||||
| "usingComponents": {}, | "usingComponents": {}, | ||||
| "navigationBarBackgroundColor": "#F13C42", | "navigationBarBackgroundColor": "#F13C42", | ||||
| "navigationBarTextStyle": "white", | |||||
| "enablePullDownRefresh": true | "enablePullDownRefresh": true | ||||
| } | } | ||||
| @@ -2,11 +2,13 @@ let config = require("../../config/config.js"); | |||||
| let app = getApp(); | let app = getApp(); | ||||
| const Http = require("../../utils/HttpBasics"); | const Http = require("../../utils/HttpBasics"); | ||||
| const util = require("../../utils/util"); | const util = require("../../utils/util"); | ||||
| const imgurl = require("../../utils/imgurl"); | |||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| data: { | data: { | ||||
| bgColor:"#fff" | bgColor:"#fff" | ||||
| }, | }, | ||||
| wmhome: imgurl.wmhome.url, | |||||
| couponId: null, | couponId: null, | ||||
| orderId: "", | orderId: "", | ||||
| day: "", | day: "", | ||||
| @@ -23,6 +25,11 @@ Page({ | |||||
| this.topicShow(options.id) | this.topicShow(options.id) | ||||
| } | } | ||||
| }, | }, | ||||
| goback: function () { | |||||
| wx.switchTab({ | |||||
| url: '/pages/main/index', | |||||
| }) | |||||
| }, | |||||
| topicShow(id){ | topicShow(id){ | ||||
| let that = this; | let that = this; | ||||
| Http.get({ | Http.get({ | ||||
| @@ -1,3 +1,4 @@ | |||||
| <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||||
| <!-- banner活动详情页面 --> | <!-- banner活动详情页面 --> | ||||
| <view class='coupons' style='background:{{data.bgColor}};height:{{winHeight}}'> | <view class='coupons' style='background:{{data.bgColor}};height:{{winHeight}}'> | ||||
| <view class="coupons-body"> | <view class="coupons-body"> | ||||
| @@ -531,8 +531,29 @@ scroll-view { | |||||
| display: block; | display: block; | ||||
| margin: 30rpx auto; | margin: 30rpx auto; | ||||
| } | } | ||||
| .description { | .description { | ||||
| font-size: 26rpx; | font-size: 26rpx; | ||||
| line-height: 15rpx; | line-height: 15rpx; | ||||
| } | } | ||||
| button::after{ border: none; } | |||||
| .goback{ | |||||
| position: fixed; | |||||
| right: 50rpx; | |||||
| bottom: 60rpx; | |||||
| width:100rpx!important; | |||||
| height:100rpx; | |||||
| z-index: 100; | |||||
| background:rgba(255,255,255,1); | |||||
| line-height: 95rpx; | |||||
| border:1rpx solid rgba(227,227,227,1); | |||||
| border-radius:50%; | |||||
| } | |||||
| .goback image{ | |||||
| position: absolute; | |||||
| width: 60rpx; | |||||
| left: 0; | |||||
| right: 0; | |||||
| top: 0; | |||||
| bottom: 0; | |||||
| margin: auto; | |||||
| } | |||||
| @@ -28,8 +28,7 @@ page{ | |||||
| box-sizing: border-box; | box-sizing: border-box; | ||||
| background: #fff; | background: #fff; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| border-bottom: 6rpx solid #AF6E34; | |||||
| border-top: 6rpx solid #AF6E34; | |||||
| border-bottom: 6rpx solid #00C0FF; | |||||
| } | } | ||||
| .version { | .version { | ||||