| @@ -5,6 +5,23 @@ App({ | |||||
| data: { | data: { | ||||
| newArr:[],//存放分享二维进入消息信息 | newArr:[],//存放分享二维进入消息信息 | ||||
| }, | }, | ||||
| // 这里这么写,是要在其他界面监听,而不是在app.js中监听,而且这个监听方法,需要一个回调方法。 | |||||
| watch: function (method) { | |||||
| var obj = this.globalData; | |||||
| Object.defineProperty(obj, "ifShowTab", { | |||||
| configurable: true, | |||||
| enumerable: true, | |||||
| set: function (value) { | |||||
| this._ifShowTab = value; | |||||
| console.log('是否会被执行2') | |||||
| method(value); | |||||
| }, | |||||
| get: function () { | |||||
| // 可以在这里打印一些东西,然后在其他界面调用getApp().globalData.name的时候,这里就会执行。 | |||||
| return this._ifShowTab | |||||
| } | |||||
| }) | |||||
| }, | |||||
| onLaunch: function(options) { | onLaunch: function(options) { | ||||
| var that = this; | var that = this; | ||||
| if (that.globalData.previewFlag) {//解决微信图片预览重复进入app.js onshow | if (that.globalData.previewFlag) {//解决微信图片预览重复进入app.js onshow | ||||
| @@ -164,6 +181,8 @@ App({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| globalData: { | globalData: { | ||||
| styleLsit:{}, | |||||
| ifShowTab: true, | |||||
| previewFlag:false,//解决图片预览调用noshow | previewFlag:false,//解决图片预览调用noshow | ||||
| activityId:'',//活动id方便授权数据回传 | activityId:'',//活动id方便授权数据回传 | ||||
| typeLsit: [],//初始哈样式 | typeLsit: [],//初始哈样式 | ||||
| @@ -94,16 +94,20 @@ Component({ | |||||
| // console.log(this.data.home_a_img) | // console.log(this.data.home_a_img) | ||||
| const data = e.currentTarget.dataset; | const data = e.currentTarget.dataset; | ||||
| this.setData({ | |||||
| selected: data.index | |||||
| }) | |||||
| console.log(data.index) | |||||
| const url = data.path; | const url = data.path; | ||||
| if (data.index == 0 || data.index == 3) { | if (data.index == 0 || data.index == 3) { | ||||
| console.log("ifShowTab = false") | |||||
| app.globalData.ifShowTab = false | |||||
| this.getTemplateId() | this.getTemplateId() | ||||
| } | } | ||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url | url | ||||
| }); | }); | ||||
| this.setData({ | |||||
| selected: data.index | |||||
| }) | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 获取全局样式 | * 获取全局样式 | ||||
| @@ -118,6 +122,7 @@ Component({ | |||||
| data | data | ||||
| } = res | } = res | ||||
| if (code == 200) { | if (code == 200) { | ||||
| app.globalData.styleLsit = data | |||||
| this.setData({ | this.setData({ | ||||
| list: [{ | list: [{ | ||||
| "pagePath": "/index/index", | "pagePath": "/index/index", | ||||
| @@ -209,6 +214,7 @@ Component({ | |||||
| wx.requestSubscribeMessage({ | wx.requestSubscribeMessage({ | ||||
| tmplIds: tmplIds, | tmplIds: tmplIds, | ||||
| success(res) { | success(res) { | ||||
| console.log("我重复订阅") | |||||
| let _statue = null | let _statue = null | ||||
| tmplIds.map((item, index) => { //判读用户是否点击了确定 | tmplIds.map((item, index) => { //判读用户是否点击了确定 | ||||
| if (res[item] == "accept") { | if (res[item] == "accept") { | ||||
| @@ -219,15 +225,25 @@ Component({ | |||||
| Http.post({ | Http.post({ | ||||
| url: config.api.wxMsg | url: config.api.wxMsg | ||||
| }).then(res => { | }).then(res => { | ||||
| app.globalData.ifShowTab = true | |||||
| wx.setStorageSync({ | |||||
| key: 'ifShowTab', | |||||
| data: true, | |||||
| }) | |||||
| console.log(res) | console.log(res) | ||||
| }) | }) | ||||
| return | return | ||||
| } | } | ||||
| app.globalData.ifShowTab = true | |||||
| // for (let i = 0; i < tmplIds.length;i++){ | // for (let i = 0; i < tmplIds.length;i++){ | ||||
| // if (res.tmplIds[i] == 'accept'){ | // if (res.tmplIds[i] == 'accept'){ | ||||
| // console.log("发送") | // console.log("发送") | ||||
| // } | // } | ||||
| // } | // } | ||||
| }, | |||||
| complete(){ | |||||
| app.globalData.ifShowTab = true | |||||
| } | } | ||||
| }) | }) | ||||
| }, | }, | ||||
| @@ -4,7 +4,7 @@ | |||||
| left: 0; | left: 0; | ||||
| right: 0; | right: 0; | ||||
| height: 70rpx; | height: 70rpx; | ||||
| /* padding: 10rpx; */ | |||||
| padding: 10rpx; | |||||
| background: white; | background: white; | ||||
| display: flex; | display: flex; | ||||
| padding-bottom: env(safe-area-inset-bottom); | padding-bottom: env(safe-area-inset-bottom); | ||||
| @@ -30,8 +30,8 @@ | |||||
| } | } | ||||
| .tab-bar-item cover-image { | .tab-bar-item cover-image { | ||||
| width: 44rpx; | |||||
| height: 44rpx; | |||||
| width: 46rpx; | |||||
| height: 46rpx; | |||||
| } | } | ||||
| .tab-bar-item cover-view { | .tab-bar-item cover-view { | ||||
| @@ -2,43 +2,33 @@ | |||||
| "ext": { | "ext": { | ||||
| "attr": { | "attr": { | ||||
| "car": { | "car": { | ||||
| "tjd": { | |||||
| "payPath": "", | |||||
| "tjdAppId": "wx6945d1bda68d7993" | |||||
| }, | |||||
| "etcp": { | "etcp": { | ||||
| "payPath": "pages/pay/order-pay-open/main", | |||||
| "etcpAppId": "wxc07f9d67923d676d", | |||||
| "etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback" | |||||
| }, | |||||
| "bolink": { | |||||
| "payPath": "pages/park/park", | |||||
| "bolinkAppId": "wxbd08b4baa10fcc1d" | |||||
| }, | |||||
| "version": "release" | |||||
| "etcpAppId": "wx192b7d2e8dcbefd0", | |||||
| "etcpVersion": "release", | |||||
| "etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback" | |||||
| } | |||||
| }, | }, | ||||
| "imgProxy": [ | "imgProxy": [ | ||||
| { | { | ||||
| "newUrl": "https://c.malls.iformall.com/img", | |||||
| "newUrl": "https://ctest.malls.iformall.com/img", | |||||
| "orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" | "orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" | ||||
| }, | }, | ||||
| { | { | ||||
| "newUrl": "https://c.malls.iformall.com/img1", | |||||
| "newUrl": "https://ctest.malls.iformall.com/img1", | |||||
| "orgUrl": "https://formall.oss-accelerate.aliyuncs.com" | "orgUrl": "https://formall.oss-accelerate.aliyuncs.com" | ||||
| }, | }, | ||||
| { | { | ||||
| "newUrl": "https://c.malls.iformall.com/img2", | |||||
| "newUrl": "https://ctest.malls.iformall.com/img2", | |||||
| "orgUrl": "https://wx.qlogo.cn" | "orgUrl": "https://wx.qlogo.cn" | ||||
| } | } | ||||
| ], | ], | ||||
| "configUrl": "https://c.malls.iformall.com/C/api", | |||||
| "ifStoreApp": "0", | |||||
| "configUrl": "https://ctest.malls.iformall.com/C/api", | |||||
| "ifHaveWebSocket": "0", | "ifHaveWebSocket": "0", | ||||
| "ifHaveCarModular": "0" | |||||
| "ifHaveCarModular": "1" | |||||
| }, | }, | ||||
| "name": "富茂链客生产版", | |||||
| "weappId": "wx6a2524a8286d687f", | |||||
| "appVersion": "C.5.1.1" | |||||
| "name": "金泸商务", | |||||
| "weappId": "wx649b3be73c1afe47", | |||||
| "appVersion": "C.test.5.2.0" | |||||
| }, | }, | ||||
| "debug": false, | "debug": false, | ||||
| "tabBar": { | "tabBar": { | ||||
| @@ -68,7 +58,8 @@ | |||||
| "selectedIconPath": "assets/images/user-a.png" | "selectedIconPath": "assets/images/user-a.png" | ||||
| } | } | ||||
| ], | ], | ||||
| "custom": true | |||||
| "color": "#abb1be", | |||||
| "selectedColor": "#b2743d" | |||||
| }, | }, | ||||
| "window": { | "window": { | ||||
| "backgroundTextStyle": "dark", | "backgroundTextStyle": "dark", | ||||
| @@ -82,7 +73,7 @@ | |||||
| "provider": "wx2b03c6e691cd7370" | "provider": "wx2b03c6e691cd7370" | ||||
| } | } | ||||
| }, | }, | ||||
| "extAppid": "wx6a2524a8286d687f", | |||||
| "extAppid": "wx649b3be73c1afe47", | |||||
| "extEnable": true, | "extEnable": true, | ||||
| "permission": { | "permission": { | ||||
| "scope.userLocation": { | "scope.userLocation": { | ||||
| @@ -259,6 +259,7 @@ Page({ | |||||
| * 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
| */ | */ | ||||
| onLoad: function(options) { | onLoad: function(options) { | ||||
| console.log("我只执行一次") | |||||
| this.getType() | this.getType() | ||||
| this.getLocation(); | this.getLocation(); | ||||
| let that = this; | let that = this; | ||||
| @@ -319,7 +320,110 @@ Page({ | |||||
| onUnload() { | onUnload() { | ||||
| // wx.removeStorageSync('squareList') | // wx.removeStorageSync('squareList') | ||||
| }, | }, | ||||
| watchBack: function (ifShowTab) { //监听ifShowTab变化 | |||||
| if (ifShowTab){ | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| }else{ | |||||
| console.log("我隐藏了") | |||||
| this.getTabBar().setData({ | |||||
| list:[] | |||||
| }) | |||||
| } | |||||
| }, | |||||
| onShow: function() { | onShow: function() { | ||||
| if (app.globalData.ifShowTab){ | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| } else { | |||||
| console.log("我隐藏") | |||||
| this.getTabBar().setData({ | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| if (wx.getStorageSync("tabFlag") && wx.getStorageSync("tabFlag")==1){//处理授权取消后回到首页底部导航栏显示 | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| wx.removeStorageSync("tabFlag") | |||||
| } | |||||
| console.log("我每次都执行" ,app.globalData.ifShowTab) | |||||
| app.watch(this.watchBack) | |||||
| this.ifShowSqare(); | this.ifShowSqare(); | ||||
| if (wx.getStorageSync("squareList")) { | if (wx.getStorageSync("squareList")) { | ||||
| var temp = wx.getStorageSync("squareList").filter(item => item.tenantId == wx.getStorageSync("selectedMall"))[0].name | var temp = wx.getStorageSync("squareList").filter(item => item.tenantId == wx.getStorageSync("selectedMall"))[0].name | ||||
| @@ -330,7 +434,7 @@ Page({ | |||||
| if (typeof this.getTabBar === 'function' && | if (typeof this.getTabBar === 'function' && | ||||
| this.getTabBar()) { | this.getTabBar()) { | ||||
| this.getTabBar().setData({ | this.getTabBar().setData({ | ||||
| selected: 0 | |||||
| selected: 0, | |||||
| }) | }) | ||||
| } | } | ||||
| let that = this; | let that = this; | ||||
| @@ -75,7 +75,7 @@ Page({ | |||||
| * 将值传到用户手机号授权的页面 | * 将值传到用户手机号授权的页面 | ||||
| * | * | ||||
| */ | */ | ||||
| wx.redirectTo({ | |||||
| wx.navigateTo({ | |||||
| url: `/pages/getphoneInfo/index?path=main` | url: `/pages/getphoneInfo/index?path=main` | ||||
| }); | }); | ||||
| }, | }, | ||||
| @@ -128,7 +128,67 @@ Page({ | |||||
| gotoedit: function() { | gotoedit: function() { | ||||
| this.checkUserStatus(); | this.checkUserStatus(); | ||||
| }, | }, | ||||
| watchBack: function (ifShowTab) { //监听ifShowTab变化 | |||||
| console.log("ifShowTab",ifShowTab) | |||||
| if (ifShowTab) { | |||||
| console.log("ifShowTab", ifShowTab) | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| } else { | |||||
| console.log("我隐藏") | |||||
| this.getTabBar().setData({ | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| }, | |||||
| onLoad() { | onLoad() { | ||||
| if (typeof this.getTabBar === 'function' && | |||||
| this.getTabBar()) { | |||||
| if (ifStoreApp == 1) { | |||||
| this.getTabBar().setData({ | |||||
| selected: 1 | |||||
| }) | |||||
| } else if (ifStoreApp == 2) { | |||||
| this.getTabBar().setData({ | |||||
| selected: 2 | |||||
| }) | |||||
| } else { | |||||
| this.getTabBar().setData({ | |||||
| selected: 3, | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| } | |||||
| this.getLocation(); | this.getLocation(); | ||||
| this.updateScene(); | this.updateScene(); | ||||
| // this.getRoomId(); | // this.getRoomId(); | ||||
| @@ -203,6 +263,42 @@ Page({ | |||||
| * 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
| */ | */ | ||||
| onShow: function() { | onShow: function() { | ||||
| console.log(app.globalData.ifShowTab,"////") | |||||
| if (app.globalData.ifShowTab){ | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| } else { | |||||
| console.log("我隐藏") | |||||
| this.getTabBar().setData({ | |||||
| list: [] | |||||
| }) | |||||
| } | |||||
| app.watch(this.watchBack) | |||||
| let that = this; | let that = this; | ||||
| that.userAuthorization() | that.userAuthorization() | ||||
| if (typeof that.getTabBar === 'function' && | if (typeof that.getTabBar === 'function' && | ||||
| @@ -217,10 +313,40 @@ Page({ | |||||
| }) | }) | ||||
| } else { | } else { | ||||
| that.getTabBar().setData({ | that.getTabBar().setData({ | ||||
| selected: 3 | |||||
| selected: 3, | |||||
| }) | }) | ||||
| } | } | ||||
| } | |||||
| if (wx.getStorageSync("tabFlag") && wx.getStorageSync("tabFlag") == 1) {//处理授权取消后回到首页底部导航栏显示 | |||||
| this.getTabBar().setData({ | |||||
| list: [{ | |||||
| "pagePath": "/index/index", | |||||
| "iconPath": `${app.globalData.styleLsit.t_in.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_in_std.icon}`, | |||||
| "text": "首页" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/searchbar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_md.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_md_std.icon}`, | |||||
| "text": "门店" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/passCar", | |||||
| "iconPath": `${app.globalData.styleLsit.t_tc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_tc_std.icon}`, | |||||
| "text": "停车" | |||||
| }, | |||||
| { | |||||
| "pagePath": "/index/user", | |||||
| "iconPath": `${app.globalData.styleLsit.t_uc.icon}`, | |||||
| "selectedIconPath": `${app.globalData.styleLsit.t_uc_std.icon}`, | |||||
| "text": "我的" | |||||
| } | |||||
| ], | |||||
| }) | |||||
| wx.removeStorageSync("tabFlag") | |||||
| } | } | ||||
| that.setData({ | that.setData({ | ||||
| appVersion: extConfig.appVersion, | appVersion: extConfig.appVersion, | ||||
| @@ -286,7 +412,7 @@ Page({ | |||||
| score: res.data.score, | score: res.data.score, | ||||
| curPhone: curPhone, | curPhone: curPhone, | ||||
| levelName: res.data.levelName, | levelName: res.data.levelName, | ||||
| userId: res.data.id | |||||
| userId: res.data.userId | |||||
| }) | }) | ||||
| if (res.data.nickName) { | if (res.data.nickName) { | ||||
| that.setData({ | that.setData({ | ||||
| @@ -348,7 +348,7 @@ Page({ | |||||
| pageNum: 1, | pageNum: 1, | ||||
| pageSize: 15 | pageSize: 15 | ||||
| }; | }; | ||||
| Http.get({ | |||||
| Http.post({ | |||||
| url: config.api.listByMerchant, | url: config.api.listByMerchant, | ||||
| data: data | data: data | ||||
| }) | }) | ||||
| @@ -25,6 +25,7 @@ Page({ | |||||
| swiperCurrent: 0, | swiperCurrent: 0, | ||||
| detailPicture: [], | detailPicture: [], | ||||
| coverPicture: [], | coverPicture: [], | ||||
| couponList:[], | |||||
| data: { | data: { | ||||
| title: null | title: null | ||||
| }, | }, | ||||
| @@ -88,7 +89,8 @@ Page({ | |||||
| //图文混排 | //图文混排 | ||||
| curHtml: '', | curHtml: '', | ||||
| contentType: 0, | contentType: 0, | ||||
| page:1,//查询商户优惠券page | |||||
| idList:[], | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 显示分享弹框 | * 显示分享弹框 | ||||
| @@ -97,6 +99,58 @@ Page({ | |||||
| this.setData({ | this.setData({ | ||||
| isshowposter: true, | isshowposter: true, | ||||
| }) | }) | ||||
| }, | |||||
| getCouponList: function(id) { | |||||
| let that = this; | |||||
| let data; | |||||
| data = { | |||||
| status: 0, | |||||
| merchantIds: id, | |||||
| pageNum: that.data.page, | |||||
| pageSize: 4, | |||||
| } | |||||
| Http.post({ | |||||
| url: config.api.listByMerchant, | |||||
| data: data | |||||
| }).then(res => { | |||||
| if (res.data.page.list<=0){ | |||||
| return | |||||
| } | |||||
| let dataLsit = [] | |||||
| dataLsit = that.data.couponList | |||||
| dataLsit.push(...res.data.page.list) | |||||
| dataLsit.map((item,index)=>{ | |||||
| if (item.id == that.data.couponChannelId){ | |||||
| dataLsit.splice(index,1) | |||||
| } | |||||
| }) | |||||
| if (that.data.page>1){ | |||||
| let tmpeLsit = dataLsit | |||||
| tmpeLsit.push(...res.data.page.list) | |||||
| that.setData({ | |||||
| couponList: tmpeLsit, | |||||
| }) | |||||
| }else{ | |||||
| that.setData({ | |||||
| couponList: dataLsit, | |||||
| }) | |||||
| } | |||||
| // if (res.data && res.data.qrCode){ | |||||
| // that.setData({ | |||||
| // qrCode: res.data.qrCode, | |||||
| // }) | |||||
| // } | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 隐藏分享弹框 | * 隐藏分享弹框 | ||||
| @@ -450,6 +504,7 @@ Page({ | |||||
| }) | }) | ||||
| if (options && options.couponChannelId) { | if (options && options.couponChannelId) { | ||||
| that.getDetail(options.couponChannelId, 'notendclock'); | that.getDetail(options.couponChannelId, 'notendclock'); | ||||
| } | } | ||||
| /** | /** | ||||
| * 转赠判断 | * 转赠判断 | ||||
| @@ -498,6 +553,18 @@ Page({ | |||||
| }; | }; | ||||
| Http.get(parmer) | Http.get(parmer) | ||||
| .then(res => { | .then(res => { | ||||
| if (res.data.merchantVoList && res.data.merchantVoList.length){ | |||||
| let merchantVoList = res.data.merchantVoList | |||||
| let idList = [] | |||||
| merchantVoList.map(item=>{ | |||||
| idList.push(item.id) | |||||
| }) | |||||
| that.setData({ | |||||
| idList: idList | |||||
| }) | |||||
| that.getCouponList(idList) | |||||
| } | |||||
| //aaa | //aaa | ||||
| if (res.data.contentType != undefined && res.data.contentType == 1) { | if (res.data.contentType != undefined && res.data.contentType == 1) { | ||||
| //获取图文展示详情html | //获取图文展示详情html | ||||
| @@ -1070,5 +1137,14 @@ Page({ | |||||
| onPullDownRefresh: function() { | onPullDownRefresh: function() { | ||||
| this.getDetail(this.data.couponChannelId); | this.getDetail(this.data.couponChannelId); | ||||
| wx.stopPullDownRefresh() | wx.stopPullDownRefresh() | ||||
| }, | |||||
| onReachBottom:function(){ | |||||
| this.setData({ | |||||
| page:this.data.page+1 | |||||
| }) | |||||
| if (this.data.idList.length>0){ | |||||
| this.getCouponList(this.data.idList) | |||||
| } | |||||
| } | } | ||||
| }); | }); | ||||
| @@ -2,7 +2,8 @@ | |||||
| "usingComponents": { | "usingComponents": { | ||||
| "c-shareposter": "../../../../components/shareposter/index", | "c-shareposter": "../../../../components/shareposter/index", | ||||
| "navbar": "../../../../components/navbar/navbar", | "navbar": "../../../../components/navbar/navbar", | ||||
| "store": "../../../../components/store/index" | |||||
| "store": "../../../../components/store/index", | |||||
| "c-coupons": "../../../components/coupons/index" | |||||
| }, | }, | ||||
| "navigationBarTitleText": "", | "navigationBarTitleText": "", | ||||
| "backgroundColor":"#f4f4f4", | "backgroundColor":"#f4f4f4", | ||||
| @@ -129,6 +129,10 @@ | |||||
| <rich-text nodes="{{curHtml}}"></rich-text> | <rich-text nodes="{{curHtml}}"></rich-text> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view wx:if="{{couponList.length!=0}}" style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;">其他活动</view> | |||||
| <view class='couponsL clearfix'> | |||||
| <c-coupons wx:if="{{couponList.length!=0}}" wx:for="{{couponList}}" from="fromMerchant" paramAtoB="{{loading}}" wx:key="unique" data="{{item}}" list="{{couponList}}" /> | |||||
| </view> | |||||
| <view class='detailImg' wx:if="{{detailPicture.length>0}}"> | <view class='detailImg' wx:if="{{detailPicture.length>0}}"> | ||||
| <image wx:for="{{detailPicture}}" wx:key="{{index}}" wx:for-item="item" src='{{item}}' mode='widthFix'></image> | <image wx:for="{{detailPicture}}" wx:key="{{index}}" wx:for-item="item" src='{{item}}' mode='widthFix'></image> | ||||
| </view> | </view> | ||||
| @@ -16,6 +16,20 @@ button::after { | |||||
| background: #f4f5f9; | background: #f4f5f9; | ||||
| } | } | ||||
| .couponsL c-coupons { | |||||
| width: 335rpx; | |||||
| height: 354rpx; | |||||
| margin-bottom: 22rpx; | |||||
| } | |||||
| .couponsL c-coupons:nth-of-type(2n+1) { | |||||
| float: left; | |||||
| } | |||||
| .couponsL c-coupons:nth-of-type(2n) { | |||||
| float: right; | |||||
| } | |||||
| .banner { | .banner { | ||||
| position: relative; | position: relative; | ||||
| width: 750rpx; | width: 750rpx; | ||||
| @@ -59,16 +73,17 @@ button::after { | |||||
| .pickFinal_Box { | .pickFinal_Box { | ||||
| overflow: hidden; | overflow: hidden; | ||||
| } | } | ||||
| .earnestTime{ | |||||
| .earnestTime { | |||||
| font-size: 28rpx; | font-size: 28rpx; | ||||
| color: #a6a6a6; | color: #a6a6a6; | ||||
| } | } | ||||
| .finalTime{ | |||||
| .finalTime { | |||||
| font-size: 28rpx; | font-size: 28rpx; | ||||
| color: #a6a6a6; | color: #a6a6a6; | ||||
| } | } | ||||
| .original { | .original { | ||||
| float: left; | float: left; | ||||
| width: 100rpx; | width: 100rpx; | ||||
| @@ -111,6 +126,11 @@ button::after { | |||||
| margin-left: 14rpx; | margin-left: 14rpx; | ||||
| } | } | ||||
| .couponsL { | |||||
| width: 92%; | |||||
| margin: 20rpx auto; | |||||
| } | |||||
| .coupons_info { | .coupons_info { | ||||
| width: 92%; | width: 92%; | ||||
| padding: 0 4%; | padding: 0 4%; | ||||
| @@ -340,9 +360,10 @@ button::after { | |||||
| line-height: 94rpx; | line-height: 94rpx; | ||||
| border-radius: 61rpx; | border-radius: 61rpx; | ||||
| } | } | ||||
| #noBuy{ | |||||
| #noBuy { | |||||
| position: relative; | position: relative; | ||||
| background-color:rgba(0, 0, 0, 0.2); | |||||
| background-color: rgba(0, 0, 0, 0.2); | |||||
| height: 94rpx; | height: 94rpx; | ||||
| width: 560rpx; | width: 560rpx; | ||||
| margin: 0 auto 30rpx; | margin: 0 auto 30rpx; | ||||
| @@ -67,11 +67,13 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| backHome: function() { | backHome: function() { | ||||
| wx.setStorageSync("tabFlag", 1) | |||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: '/index/index', | url: '/index/index', | ||||
| }) | }) | ||||
| }, | }, | ||||
| getPhoneNumber: function(e) { | getPhoneNumber: function(e) { | ||||
| wx.setStorageSync("tabFlag", 1) | |||||
| var that = this; | var that = this; | ||||
| var iv = e.detail.iv; | var iv = e.detail.iv; | ||||
| var encryptedData = e.detail.encryptedData; | var encryptedData = e.detail.encryptedData; | ||||
| @@ -82,6 +84,7 @@ Page({ | |||||
| iv: iv | iv: iv | ||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| app.globalData.phone = res.data.phone; | app.globalData.phone = res.data.phone; | ||||
| if (that.data.skipUrl == '1') { | if (that.data.skipUrl == '1') { | ||||
| console.log(app.globalData.skip,app.globalData.skipUrl,"跳转地址" ) | console.log(app.globalData.skip,app.globalData.skipUrl,"跳转地址" ) | ||||
| @@ -164,6 +167,7 @@ Page({ | |||||
| url: '/index/user' | url: '/index/user' | ||||
| }); | }); | ||||
| } else { | } else { | ||||
| wx.showToast({ | wx.showToast({ | ||||
| title: res.data.msg, | title: res.data.msg, | ||||
| icon: "success", | icon: "success", | ||||
| @@ -136,6 +136,7 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| backHome: function() { | backHome: function() { | ||||
| wx.setStorageSync("tabFlag", 1) | |||||
| wx.switchTab({ | wx.switchTab({ | ||||
| url: '/index/index', | url: '/index/index', | ||||
| }) | }) | ||||
| @@ -194,7 +194,7 @@ Page({ | |||||
| pageNum: that.data.page, | pageNum: that.data.page, | ||||
| pageSize: 15, | pageSize: 15, | ||||
| } | } | ||||
| Http.get({ | |||||
| Http.post({ | |||||
| url: config.api.listByMerchant, | url: config.api.listByMerchant, | ||||
| data: data | data: data | ||||
| }).then(res => { | }).then(res => { | ||||
| @@ -32,7 +32,7 @@ | |||||
| }, | }, | ||||
| "compileType": "miniprogram", | "compileType": "miniprogram", | ||||
| "libVersion": "2.9.5", | "libVersion": "2.9.5", | ||||
| "appid": "wx453ae0d37f3550d0", | |||||
| "appid": "wxfa336cad86ed598d", | |||||
| "projectname": "oldC", | "projectname": "oldC", | ||||
| "isGameTourist": false, | "isGameTourist": false, | ||||
| "simulatorType": "wechat", | "simulatorType": "wechat", | ||||