| @@ -19,7 +19,7 @@ Component({ | |||||
| data: { | data: { | ||||
| bannerUrl: imgurl.banner.url, | bannerUrl: imgurl.banner.url, | ||||
| currentIndex: 0, | currentIndex: 0, | ||||
| mouldType:0, | |||||
| mouldType: 0, | |||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -33,29 +33,30 @@ Component({ | |||||
| let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("="); | let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("="); | ||||
| console.log(indexOf, "123") | console.log(indexOf, "123") | ||||
| let id = (e.currentTarget.dataset.data.pagePath).substring(indexOf); | let id = (e.currentTarget.dataset.data.pagePath).substring(indexOf); | ||||
| let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2)// 2020/7/22 变量获取pagePath中的type | |||||
| let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2) // 2020/7/22 变量获取pagePath中的type | |||||
| console.log(indexOf, id, type); | console.log(indexOf, id, type); | ||||
| console.log(e.currentTarget.dataset.data.pagePath) | console.log(e.currentTarget.dataset.data.pagePath) | ||||
| if(type == 'cd' || type == 'sd'){ | |||||
| if (type == 'cd' || type == 'sd') { | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/${e.currentTarget.dataset.data.pagePath}`, | url: `/${e.currentTarget.dataset.data.pagePath}`, | ||||
| }) | }) | ||||
| }else if(type == "wj"){ | |||||
| } else if (type == "wj") { | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/questionnaire/questionnaire?id=${id}`, | url: `/pages/questionnaire/questionnaire?id=${id}`, | ||||
| }) | }) | ||||
| }else if (type == 'ra'){ | |||||
| } else if (type == 'ra') { | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/radetail/index?id=${id}`, | url: `/pages/radetail/index?id=${id}`, | ||||
| }) | }) | ||||
| } | } | ||||
| }else if(e.currentTarget.dataset.data.type==2){ | |||||
| } else if (e.currentTarget.dataset.data.type == 2) { | |||||
| // 自由图文 | // 自由图文 | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` | url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` | ||||
| }); | }); | ||||
| }else if(e.currentTarget.dataset.data.type==4){ | |||||
| wx.navigateToMiniProgram({ | |||||
| } else if (e.currentTarget.dataset.data.type == 4) { | |||||
| let tempObj = { | |||||
| appId: e.currentTarget.dataset.data.goAppid, | appId: e.currentTarget.dataset.data.goAppid, | ||||
| // path: 'page/index/index?id=123', | // path: 'page/index/index?id=123', | ||||
| // extraData: { | // extraData: { | ||||
| @@ -65,27 +66,31 @@ Component({ | |||||
| success(res) { | success(res) { | ||||
| // 打开成功 | // 打开成功 | ||||
| } | } | ||||
| }) | |||||
| } | |||||
| else{ | |||||
| } | |||||
| if (e.currentTarget.dataset.data.pagePath){ | |||||
| tempObj.path = e.currentTarget.dataset.data.pagePath | |||||
| } | |||||
| wx.navigateToMiniProgram(tempObj) | |||||
| } else { | |||||
| // 固定格式 | // 固定格式 | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}` | url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}` | ||||
| }); | }); | ||||
| } | } | ||||
| }, | }, | ||||
| handleChange: function (e) { | |||||
| handleChange: function(e) { | |||||
| this.setData({ | this.setData({ | ||||
| currentIndex: e.detail.current | currentIndex: e.detail.current | ||||
| }) | }) | ||||
| }, | }, | ||||
| }, | }, | ||||
| attached: function () { | |||||
| attached: function() { | |||||
| // 在组件实例进入页面节点树时执行 | // 在组件实例进入页面节点树时执行 | ||||
| if (app.globalData.mouldType){ | |||||
| if (app.globalData.mouldType) { | |||||
| this.setData({ | this.setData({ | ||||
| mouldType: app.globalData.mouldType | mouldType: app.globalData.mouldType | ||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| }); | |||||
| }); | |||||
| @@ -62,6 +62,21 @@ var config = { | |||||
| * 商户优惠信息 | * 商户优惠信息 | ||||
| */ | */ | ||||
| listByMerchant: "/wxCouponChannel/listByMerchant", | listByMerchant: "/wxCouponChannel/listByMerchant", | ||||
| /** | |||||
| * 获取券价格与库存 | |||||
| */ | |||||
| couponPriceAndStock: "/wxCoupon/couponPriceAndStock", | |||||
| /** | |||||
| * 获取券适用门店List | |||||
| */ | |||||
| couponMerchant: "/wxCoupon/couponMerchant", | |||||
| /** | |||||
| * 获取券详情 | |||||
| */ | |||||
| newCouponDetail: '/wxCoupon/couponDetail', | |||||
| /** | /** | ||||
| * 优惠券详情 | * 优惠券详情 | ||||
| */ | */ | ||||
| @@ -96,5 +96,9 @@ | |||||
| "networkTimeout": { | "networkTimeout": { | ||||
| "request": 30000, | "request": 30000, | ||||
| "downloadFile": 10000 | "downloadFile": 10000 | ||||
| } | |||||
| }, | |||||
| "requiredPrivateInfos": [ | |||||
| "chooseLocation", | |||||
| "getLocation" | |||||
| ] | |||||
| } | } | ||||
| @@ -501,6 +501,7 @@ Page({ | |||||
| * 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
| */ | */ | ||||
| onLoad: function(options) { | onLoad: function(options) { | ||||
| console.log("onLoad--") | |||||
| this.setData({ | this.setData({ | ||||
| mouldType: app.globalData.mouldType, | mouldType: app.globalData.mouldType, | ||||
| marketName: app.globalData.marketName, | marketName: app.globalData.marketName, | ||||
| @@ -535,29 +536,29 @@ Page({ | |||||
| /** | /** | ||||
| * 获得经纬度 | * 获得经纬度 | ||||
| */ | */ | ||||
| getLocation() { | |||||
| let that = this; | |||||
| wx.getLocation({ | |||||
| type: "wgs84", | |||||
| success: function(res) { | |||||
| console.log(res, 9999) | |||||
| if (res && res.longitude && res.latitude) { | |||||
| Http.post({ | |||||
| url: config.api.updateLBS, | |||||
| data: { | |||||
| latitude: res.latitude, | |||||
| longitude: res.longitude | |||||
| } | |||||
| }).then(res => { | |||||
| console.log(res, 9999) | |||||
| }) | |||||
| } | |||||
| }, | |||||
| fail: error => { | |||||
| console.log(error); | |||||
| } | |||||
| }) | |||||
| }, | |||||
| // getLocation() { | |||||
| // let that = this; | |||||
| // wx.getLocation({ | |||||
| // type: "wgs84", | |||||
| // success: function(res) { | |||||
| // console.log(res, 9999) | |||||
| // if (res && res.longitude && res.latitude) { | |||||
| // Http.post({ | |||||
| // url: config.api.updateLBS, | |||||
| // data: { | |||||
| // latitude: res.latitude, | |||||
| // longitude: res.longitude | |||||
| // } | |||||
| // }).then(res => { | |||||
| // console.log(res, 9999) | |||||
| // }) | |||||
| // } | |||||
| // }, | |||||
| // fail: error => { | |||||
| // console.log(error); | |||||
| // } | |||||
| // }) | |||||
| // }, | |||||
| onUnload() { | onUnload() { | ||||
| // wx.removeStorageSync('squareList') | // wx.removeStorageSync('squareList') | ||||
| @@ -595,6 +596,7 @@ Page({ | |||||
| }, | }, | ||||
| onShow: function() { | onShow: function() { | ||||
| console.log("onShow--") | |||||
| console.log(app.globalData.mouldType, "mouldType") | console.log(app.globalData.mouldType, "mouldType") | ||||
| if (app.globalData.token) { | if (app.globalData.token) { | ||||
| this.getmemberId(app.globalData.token); | this.getmemberId(app.globalData.token); | ||||
| @@ -777,7 +779,7 @@ Page({ | |||||
| that.getType() | that.getType() | ||||
| // that.uesrInfo() | // that.uesrInfo() | ||||
| that.getLocation(); | |||||
| // that.getLocation(); | |||||
| that.getMallInfo(app.globalData.token); | that.getMallInfo(app.globalData.token); | ||||
| if (app.couponChannelListCallback) { | if (app.couponChannelListCallback) { | ||||
| @@ -841,7 +843,7 @@ Page({ | |||||
| } | } | ||||
| that.getType() | that.getType() | ||||
| // that.uesrInfo() | // that.uesrInfo() | ||||
| that.getLocation(); | |||||
| // that.getLocation(); | |||||
| that.getMallInfo(app.globalData.token); | that.getMallInfo(app.globalData.token); | ||||
| if (app.couponChannelListCallback) { | if (app.couponChannelListCallback) { | ||||
| @@ -164,7 +164,7 @@ Page({ | |||||
| this.checkUserStatus(); | this.checkUserStatus(); | ||||
| }, | }, | ||||
| onLoad() { | onLoad() { | ||||
| this.getLocation(); | |||||
| // this.getLocation(); | |||||
| this.updateScene(); | this.updateScene(); | ||||
| // this.getRoomId(); | // this.getRoomId(); | ||||
| // this.getRoomList(); | // this.getRoomList(); | ||||
| @@ -197,29 +197,29 @@ Page({ | |||||
| /** | /** | ||||
| * 获得经纬度 | * 获得经纬度 | ||||
| */ | */ | ||||
| getLocation() { | |||||
| let that = this; | |||||
| wx.getLocation({ | |||||
| type: "wgs84", | |||||
| success: function(res) { | |||||
| console.log(res) | |||||
| if (res && res.longitude && res.latitude) { | |||||
| Http.post({ | |||||
| url: config.api.updateLBS, | |||||
| data: { | |||||
| latitude: res.latitude, | |||||
| longitude: res.longitude | |||||
| } | |||||
| }).then(res => { | |||||
| console.log(res) | |||||
| }) | |||||
| } | |||||
| }, | |||||
| fail: error => { | |||||
| console.log(error); | |||||
| } | |||||
| }) | |||||
| }, | |||||
| // getLocation() { | |||||
| // let that = this; | |||||
| // wx.getLocation({ | |||||
| // type: "wgs84", | |||||
| // success: function(res) { | |||||
| // console.log(res) | |||||
| // if (res && res.longitude && res.latitude) { | |||||
| // Http.post({ | |||||
| // url: config.api.updateLBS, | |||||
| // data: { | |||||
| // latitude: res.latitude, | |||||
| // longitude: res.longitude | |||||
| // } | |||||
| // }).then(res => { | |||||
| // console.log(res) | |||||
| // }) | |||||
| // } | |||||
| // }, | |||||
| // fail: error => { | |||||
| // console.log(error); | |||||
| // } | |||||
| // }) | |||||
| // }, | |||||
| /** | /** | ||||
| * 用户更新scene | * 用户更新scene | ||||
| */ | */ | ||||
| @@ -4,7 +4,7 @@ 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"); | const imgurl = require("../../utils/imgurl"); | ||||
| Page({ | |||||
| Page({ | |||||
| data: { | data: { | ||||
| mouldType: 0, | mouldType: 0, | ||||
| mouldConfig:{}, | mouldConfig:{}, | ||||
| @@ -20,36 +20,73 @@ Page({ | |||||
| goHomeUrl: "", | goHomeUrl: "", | ||||
| }, | }, | ||||
| onLoad(options) { | onLoad(options) { | ||||
| this.setData({ | |||||
| mouldType: app.globalData.mouldType, | |||||
| mouldConfig: app.globalData.mouldConfig, | |||||
| goHomeUrl: app.globalData.goHomeUrl, | |||||
| }) | |||||
| let that = this; | |||||
| if (options.id){ | |||||
| Http.get({ | |||||
| url: config.api.bannerDetail, | |||||
| data: { | |||||
| id: options.id | |||||
| } | |||||
| }).then(res => { | |||||
| if(res.data.type==2){ | |||||
| if (app.globalData.token) { | |||||
| this.setData({ | |||||
| mouldType: app.globalData.mouldType, | |||||
| mouldConfig: app.globalData.mouldConfig, | |||||
| goHomeUrl: app.globalData.goHomeUrl, | |||||
| }) | |||||
| let that = this; | |||||
| if (options.id) { | |||||
| Http.get({ | |||||
| url: config.api.bannerDetail, | |||||
| data: { | |||||
| id: options.id | |||||
| } | |||||
| }).then(res => { | |||||
| if (res.data.type == 2) { | |||||
| that.setData({ | |||||
| nodes: res.data.html | |||||
| }) | |||||
| } | |||||
| that.setData({ | that.setData({ | ||||
| nodes: res.data.html | |||||
| data: res.data | |||||
| }); | |||||
| }).catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| } | |||||
| }else{ | |||||
| app.tokenCallback = token =>{ | |||||
| this.setData({ | |||||
| mouldType: app.globalData.mouldType, | |||||
| mouldConfig: app.globalData.mouldConfig, | |||||
| goHomeUrl: app.globalData.goHomeUrl, | |||||
| }) | |||||
| let that = this; | |||||
| if (options.id) { | |||||
| Http.get({ | |||||
| url: config.api.bannerDetail, | |||||
| data: { | |||||
| id: options.id | |||||
| } | |||||
| }).then(res => { | |||||
| if (res.data.type == 2) { | |||||
| that.setData({ | |||||
| nodes: res.data.html | |||||
| }) | |||||
| } | |||||
| that.setData({ | |||||
| data: res.data | |||||
| }); | |||||
| }).catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | }) | ||||
| } | } | ||||
| that.setData({ | |||||
| data: res.data | |||||
| }); | |||||
| }).catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| } | |||||
| } | } | ||||
| }, | }, | ||||
| goback: function () { | goback: function () { | ||||
| let this_=this | let this_=this | ||||
| @@ -57,4 +94,23 @@ Page({ | |||||
| url: this_.data.goHomeUrl, | url: this_.data.goHomeUrl, | ||||
| }) | }) | ||||
| }, | }, | ||||
| onShareAppMessage: function (options) { | |||||
| var that = this; | |||||
| console.log(`/pages/bannerdetail/index?id=${that.data.data.id}`) | |||||
| var shareObj = { | |||||
| title: that.data.title, | |||||
| path: `/pages/bannerdetail/index?id=${that.data.data.id}`, | |||||
| success: function (res) { | |||||
| if (res.errMsg == 'shareAppMessage:ok') { } | |||||
| }, | |||||
| fail: function (error) { | |||||
| if (res.errMsg == 'shareAppMessage:fail cancel') { } else if (res.errMsg == 'shareAppMessage:fail') { } | |||||
| } | |||||
| }; | |||||
| console.log(shareObj) | |||||
| return shareObj; | |||||
| }, | |||||
| }); | }); | ||||
| @@ -10,7 +10,7 @@ Page({ | |||||
| */ | */ | ||||
| data: { | data: { | ||||
| navigationBarHeight, | navigationBarHeight, | ||||
| poterbg: imgurl.poterbg.url, | |||||
| poterbg: imgurl.poterbg.url, | |||||
| windowWidth: wx.getSystemInfoSync().windowWidth, | windowWidth: wx.getSystemInfoSync().windowWidth, | ||||
| windowHeight: wx.getSystemInfoSync().screenHeight, | windowHeight: wx.getSystemInfoSync().screenHeight, | ||||
| totalHeight: 0, | totalHeight: 0, | ||||
| @@ -110,6 +110,7 @@ Page({ | |||||
| // 首先要绘制顶部的背景图片,因为它在最底层,然后才能绘制其他内容 | // 首先要绘制顶部的背景图片,因为它在最底层,然后才能绘制其他内容 | ||||
| let bgimg1 = that.data.poterbg + `?imageView/2/w/${wW}/h/${wH}`; | let bgimg1 = that.data.poterbg + `?imageView/2/w/${wW}/h/${wH}`; | ||||
| let bgimg2 = util.getProxyImgUrl(bgimg1); | let bgimg2 = util.getProxyImgUrl(bgimg1); | ||||
| wx.getImageInfo({ | wx.getImageInfo({ | ||||
| src: bgimg2, | src: bgimg2, | ||||
| success: function(res) { | success: function(res) { | ||||
| @@ -126,6 +127,7 @@ Page({ | |||||
| let topImageHeight = parseInt(260 * scale); | let topImageHeight = parseInt(260 * scale); | ||||
| let src1 = ""; | let src1 = ""; | ||||
| let src2 = ""; | let src2 = ""; | ||||
| console.log(that.data.data.coverImg, "bgimg2") | |||||
| //劵详情海报 | //劵详情海报 | ||||
| if (options && options.couponChannelId) { | if (options && options.couponChannelId) { | ||||
| src1 = that.data.data.coverImg + `?imageView/2/w/${topImageWidth}/h/${topImageHeight}`; | src1 = that.data.data.coverImg + `?imageView/2/w/${topImageWidth}/h/${topImageHeight}`; | ||||
| @@ -135,6 +137,11 @@ Page({ | |||||
| src1 = that.data.data.merchantImgUrl + `?imageView/2/w/${topImageWidth}/h/${topImageHeight}`; | src1 = that.data.data.merchantImgUrl + `?imageView/2/w/${topImageWidth}/h/${topImageHeight}`; | ||||
| src2 = util.getProxyImgUrl(src1); | src2 = util.getProxyImgUrl(src1); | ||||
| } | } | ||||
| // console.log(, "789") | |||||
| let tempArr = src2.split('?') | |||||
| if(tempArr.length>2){ | |||||
| src2 = tempArr[0]+"?"+tempArr[1]+"&"+tempArr[2] | |||||
| } | |||||
| wx.getImageInfo({ | wx.getImageInfo({ | ||||
| src: src2, | src: src2, | ||||
| success: function(res) { | success: function(res) { | ||||
| @@ -159,6 +166,7 @@ Page({ | |||||
| //商户详情海报 | //商户详情海报 | ||||
| let src1 = that.data.avatarUrl + `?imageView/2/w/${100}/h/${100}`; | let src1 = that.data.avatarUrl + `?imageView/2/w/${100}/h/${100}`; | ||||
| let src2 = util.getProxyImgUrl(src1); | let src2 = util.getProxyImgUrl(src1); | ||||
| wx.getImageInfo({ | wx.getImageInfo({ | ||||
| src: src2, | src: src2, | ||||
| success: function(res) { | success: function(res) { | ||||
| @@ -6,6 +6,7 @@ const util = require("../../../utils/util"); | |||||
| const imgurl = require("../../../utils/imgurl"); | const imgurl = require("../../../utils/imgurl"); | ||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| priceAndStockObj: {},//存放价格和库存 | |||||
| goHomeUrl: "", | goHomeUrl: "", | ||||
| mouldType: 0, | mouldType: 0, | ||||
| mouldConfig:{}, | mouldConfig:{}, | ||||
| @@ -447,6 +448,7 @@ Page({ | |||||
| }, | }, | ||||
| setIntervalTime(end_time) { | setIntervalTime(end_time) { | ||||
| let that = this; | let that = this; | ||||
| var EndTime = end_time; | var EndTime = end_time; | ||||
| var NowTime = new Date().getTime(); | var NowTime = new Date().getTime(); | ||||
| @@ -470,12 +472,17 @@ Page({ | |||||
| sec: "00", | sec: "00", | ||||
| }) | }) | ||||
| //如果倒计时结束,需要重新查询一下券的状态 | //如果倒计时结束,需要重新查询一下券的状态 | ||||
| // 给getDetail一个标识 | |||||
| that.getDetail(that.data.couponChannelId, 'endclock'); | |||||
| // 给getDetail一个标识 | |||||
| setTimeout(function () { | |||||
| console.log("当前时间", new Date().getTime()); | |||||
| that.getDetail(that.data.couponChannelId, 'endclock'); | |||||
| }, 300); | |||||
| } | } | ||||
| total_micro_second -= 1000; | total_micro_second -= 1000; | ||||
| }, | }, | ||||
| countdown: function(end_time) { | |||||
| countdown: function(end_time) { | |||||
| let that = this; | let that = this; | ||||
| that.setIntervalTime(end_time); | that.setIntervalTime(end_time); | ||||
| that.data.setInterval = setInterval(function() { | that.data.setInterval = setInterval(function() { | ||||
| @@ -570,9 +577,55 @@ Page({ | |||||
| } | } | ||||
| }) | }) | ||||
| }, | }, | ||||
| getCouponPriceAndStock(couponChannelId) {//获取券价格与库存 | |||||
| Http.get({ | |||||
| url: config.api.couponPriceAndStock, | |||||
| data: { | |||||
| couponChannelId | |||||
| } | |||||
| }).then(res => { | |||||
| let tempBoj = JSON.parse(res.data) | |||||
| console.log(tempBoj, "$"); | |||||
| this.setData({ | |||||
| priceAndStockObj: tempBoj | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| getCouponMerchant(couponChannelId) {//获取适用门店 | |||||
| Http.get({ | |||||
| url: config.api.couponMerchant, | |||||
| data: { | |||||
| couponChannelId: couponChannelId | |||||
| } | |||||
| }).then(res => { | |||||
| 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 | |||||
| }) | |||||
| }) | |||||
| }, | |||||
| getDetail: function(couponChannelId, flag) { | getDetail: function(couponChannelId, flag) { | ||||
| let that = this; | let that = this; | ||||
| let data={}; | let data={}; | ||||
| that.getCouponMerchant(couponChannelId);//获取适用门店 | |||||
| that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存 | |||||
| if (that.data.couponIds){ | if (that.data.couponIds){ | ||||
| data.couponId = couponChannelId | data.couponId = couponChannelId | ||||
| }else{ | }else{ | ||||
| @@ -584,18 +637,6 @@ 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 | ||||
| @@ -665,6 +706,7 @@ Page({ | |||||
| that.countdown(res.data.endTime); | that.countdown(res.data.endTime); | ||||
| } else { | } else { | ||||
| clearInterval(that.data.setInterval) | clearInterval(that.data.setInterval) | ||||
| that.countdown(res.data.endTime); | |||||
| } | } | ||||
| if (res.data.activityStatus == 0) { | if (res.data.activityStatus == 0) { | ||||
| var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); | var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); | ||||
| @@ -693,7 +735,6 @@ Page({ | |||||
| wx.hideLoading(); | wx.hideLoading(); | ||||
| that.setData({ | that.setData({ | ||||
| data: res.data, | data: res.data, | ||||
| merchantVoList: res.data.merchantVoList | |||||
| }); | }); | ||||
| if(res.data.type == 10){ | if(res.data.type == 10){ | ||||
| that.setData({ | that.setData({ | ||||
| @@ -66,22 +66,22 @@ | |||||
| <view class='salePriceStr clearfix' wx:if="{{data.type!=10}}"> | <view class='salePriceStr clearfix' wx:if="{{data.type!=10}}"> | ||||
| <text class='rmb'>¥</text> | <text class='rmb'>¥</text> | ||||
| <view class="fl" wx:if="{{data.type!=8}}"> | <view class="fl" wx:if="{{data.type!=8}}"> | ||||
| <text class="pri01" wx:if="{{data.type!=50&&data.type!=51}}">{{data.salePriceStr}}</text> | |||||
| <view class="pri01" wx:if="{{data.type==50||data.type==51}}">{{data.creditPrice}} | |||||
| <text class="pri01" wx:if="{{data.type!=50&&data.type!=51}}">{{priceAndStockObj.salePrice/100}}</text> | |||||
| <view class="pri01" wx:if="{{data.type==50||data.type==51}}">{{priceAndStockObj.creditPrice}} | |||||
| <text class='jifen'>积分</text> | <text class='jifen'>积分</text> | ||||
| </view> | </view> | ||||
| <!-- <text class="yuan" wx:if="{{data.type!=50&&data.type!=51}}">元</text> --> | <!-- <text class="yuan" wx:if="{{data.type!=50&&data.type!=51}}">元</text> --> | ||||
| <text class='throgh' wx:if="{{data.unit==0&&data.type!=50&&data.type!=51}}">{{data.priceStr}}元</text> | |||||
| <text wx:if="{{data.unit==1&&data.type!=50&&data.type!=51}}">{{data.priceStr}}小时</text> | |||||
| <text class='throgh' wx:if="{{data.unit==0&&data.type!=50&&data.type!=51}}">{{priceAndStockObj.price/100}}元</text> | |||||
| <text wx:if="{{data.unit==1&&data.type!=50&&data.type!=51}}">{{priceAndStockObj.price/100}}小时</text> | |||||
| <text class='rest' wx:if="{{data.autoRefund == 1}}"> | <text class='rest' wx:if="{{data.autoRefund == 1}}"> | ||||
| <text class='time refound'><text class="use">过期不退款</text></text> | <text class='time refound'><text class="use">过期不退款</text></text> | ||||
| </text> | </text> | ||||
| </view> | </view> | ||||
| <view class="fl" wx:if="{{data.type==8}}"> | <view class="fl" wx:if="{{data.type==8}}"> | ||||
| <!-- <text class="pri01 pri01Hr">¥</text> --> | <!-- <text class="pri01 pri01Hr">¥</text> --> | ||||
| <text class="pri01">{{data.salePriceStr}}</text> | |||||
| <text class="pri01">{{priceAndStockObj.salePrice/100}}</text> | |||||
| <text class='presslimit' wx:if="{{data.type==8}}"><text>{{data.pressLimitNum+'人可砍至底价'}}</text></text> | <text class='presslimit' wx:if="{{data.type==8}}"><text>{{data.pressLimitNum+'人可砍至底价'}}</text></text> | ||||
| <text class='throgh'>{{data.priceStr}}元</text> | |||||
| <text class='throgh'>{{priceAndStockObj.price/100}}元</text> | |||||
| <text class='rest' wx:if="{{data.autoRefund == 1}}"> | <text class='rest' wx:if="{{data.autoRefund == 1}}"> | ||||
| <text class='time refound'><text class="use">过期不退款</text></text> | <text class='time refound'><text class="use">过期不退款</text></text> | ||||
| </text> | </text> | ||||
| @@ -112,7 +112,7 @@ | |||||
| <text class='timess' wx:if='{{limitCondition==1}}'>(仅限新用户活动)</text> | <text class='timess' wx:if='{{limitCondition==1}}'>(仅限新用户活动)</text> | ||||
| <text class='timess' wx:if='{{limitCondition==2&&(minLimit||minLimit==0)&&maxLimit}}'>({{minLimit}}-{{maxLimit}}成长值)</text> | <text class='timess' wx:if='{{limitCondition==2&&(minLimit||minLimit==0)&&maxLimit}}'>({{minLimit}}-{{maxLimit}}成长值)</text> | ||||
| <text class='timess' wx:if='{{limitCondition==2&&minLimit&&!maxLimit}}'>(大于{{minLimit}}成长值)</text> | <text class='timess' wx:if='{{limitCondition==2&&minLimit&&!maxLimit}}'>(大于{{minLimit}}成长值)</text> | ||||
| <text class="restNum fr">剩余<text>{{data.remainInventory}}张</text></text> | |||||
| <text class="restNum fr">剩余<text>{{priceAndStockObj.remainInventory}}张</text></text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -154,19 +154,19 @@ | |||||
| <image src='{{homeSelectedO}}' mode="widthFix"></image> | <image src='{{homeSelectedO}}' mode="widthFix"></image> | ||||
| <text class='btnTxt'>首页</text> | <text class='btnTxt'>首页</text> | ||||
| </button> | </button> | ||||
| <button form-type="submit" disabled='{{showbutton}}' hover-class='active' class='buy' wx:if="{{data.type!=11&&data.type!=8&&data.type!=50&&data.type!=51&&data.salePriceStr!=0&&data.remainInventory!=0&&endtime!='活动已结束'&&data.activityStatus!=0}}"> | |||||
| <text class='txt'>{{data.salePriceStr}}元</text>马上购买</button> | |||||
| <button wx:if="{{data.type==11&&data.remainInventory!=0}}" bindtap="gohome" data-couponchannelid="{{couponChannelId}}" data-couponid="{{couponId}}" | |||||
| <button form-type="submit" disabled='{{showbutton}}' hover-class='active' class='buy' wx:if="{{data.type!=11&&data.type!=8&&data.type!=50&&data.type!=51&&priceAndStockObj.salePrice/100!=0&&priceAndStockObj.remainInventory!=0&&endtime!='活动已结束'&&data.activityStatus!=0}}"> | |||||
| <text class='txt'>{{priceAndStockObj.salePrice/100}}元</text>马上购买</button> | |||||
| <button wx:if="{{data.type==11&&priceAndStockObj.remainInventory!=0}}" bindtap="gohome" data-couponchannelid="{{couponChannelId}}" data-couponid="{{couponId}}" | |||||
| data-shippingtype="2" class="home">配送到家 | data-shippingtype="2" class="home">配送到家 | ||||
| </button> | </button> | ||||
| <button wx:if="{{data.type==11&&data.remainInventory!=0}}" bindtap="gohome" data-couponchannelid="{{couponChannelId}}" data-couponid="{{couponId}}" | |||||
| <button wx:if="{{data.type==11&&priceAndStockObj.remainInventory!=0}}" bindtap="gohome" data-couponchannelid="{{couponChannelId}}" data-couponid="{{couponId}}" | |||||
| data-shippingtype="1" class="arrive">到店自提 | data-shippingtype="1" class="arrive">到店自提 | ||||
| </button> | </button> | ||||
| <button form-type="submit" disabled='{{showbutton}}' class='buy' wx:if="{{data.type!=8&&data.type!=50&&data.type!=51&&data.salePriceStr==0&&data.remainInventory!=0&&endtime!='活动已结束'&&data.activityStatus!=0}}">免费领取</button> | |||||
| <button form-type="submit" disabled='{{showbutton}}' class='buy' wx:if="{{data.type!=8&&data.type!=50&&data.type!=51&&priceAndStockObj.salePrice/100==0&&priceAndStockObj.remainInventory!=0&&endtime!='活动已结束'&&data.activityStatus!=0}}">免费领取</button> | |||||
| <button form-type="submit" disabled='{{showbutton}}' class='buy' wx:if="{{data.type==51&&data.remainInventory!=0||data.type==50&&data.remainInventory!=0}}">马上兑换</button> | |||||
| <button class='buy buyHr' disabled='true' wx:if="{{data.sendType!=3&&(data.remainInventory==0&&endtime!='活动已结束'||data.remainInventory==0&&data.type==8)}}">已售罄</button> | |||||
| <button class='buy' disabled='true' wx:if="{{data.remainInventory==0&&data.type==50||data.remainInventory==0&&data.type==51}}">已兑完</button> | |||||
| <button form-type="submit" disabled='{{showbutton}}' class='buy' wx:if="{{data.type==51&&priceAndStockObj.remainInventory!=0||data.type==50&&priceAndStockObj.remainInventory!=0}}">马上兑换</button> | |||||
| <button class='buy buyHr' disabled='true' wx:if="{{data.sendType!=3&&(priceAndStockObj.remainInventory==0&&endtime!='活动已结束'||priceAndStockObj.remainInventory==0&&data.type==8)}}">已售罄</button> | |||||
| <button class='buy' disabled='true' wx:if="{{priceAndStockObj.remainInventory==0&&data.type==50||priceAndStockObj.remainInventory==0&&data.type==51}}">已兑完</button> | |||||
| <button class='buy' disabled='true' wx:if="{{endtime=='活动已结束'&&data.activityStatus!=0}}">活动已结束</button> | <button class='buy' disabled='true' wx:if="{{endtime=='活动已结束'&&data.activityStatus!=0}}">活动已结束</button> | ||||
| <button class='buy' disabled='true' wx:if="{{total_micro_second<=0&&data.activityStatus!=0}}">活动已结束</button> | <button class='buy' disabled='true' wx:if="{{total_micro_second<=0&&data.activityStatus!=0}}">活动已结束</button> | ||||
| <button id='noBuy' disabled='true' wx:if="{{data.activityStatus==0}}">活动未开始</button> | <button id='noBuy' disabled='true' wx:if="{{data.activityStatus==0}}">活动未开始</button> | ||||
| @@ -174,14 +174,14 @@ | |||||
| </form> | </form> | ||||
| </view> | </view> | ||||
| <view wx:if="{{data.remainInventory!=0&&data.type==8}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||||
| <view wx:if="{{priceAndStockObj.remainInventory!=0&&data.type==8}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||||
| <button class='goback' bindtap='goback'> | <button class='goback' bindtap='goback'> | ||||
| <image src='{{homeSelectedO}}' mode="widthFix"></image> | <image src='{{homeSelectedO}}' mode="widthFix"></image> | ||||
| <text class='btnTxt'>首页</text> | <text class='btnTxt'>首页</text> | ||||
| </button> | </button> | ||||
| <form bindsubmit="gotopay" report-submit='true' class="fl"> | <form bindsubmit="gotopay" report-submit='true' class="fl"> | ||||
| <button form-type="submit" style='background:transparent;color:#fff;' data-discount='discount1' disabled='{{showbutton}}'> | <button form-type="submit" style='background:transparent;color:#fff;' data-discount='discount1' disabled='{{showbutton}}'> | ||||
| <text>¥{{data.priceStr}}</text> | |||||
| <text>¥{{priceAndStockObj.price/100}}</text> | |||||
| <text>立即购买</text> | <text>立即购买</text> | ||||
| </button> | </button> | ||||
| </form> | </form> | ||||
| @@ -8,6 +8,7 @@ const QR = require("../../../utils/memberqrcode.js"); | |||||
| //券详情页面 | //券详情页面 | ||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| showIdFalg: false, | |||||
| navigationBarHeight, | navigationBarHeight, | ||||
| code: "", | code: "", | ||||
| topLine: imgurl.topLine.url, | topLine: imgurl.topLine.url, | ||||
| @@ -107,30 +108,33 @@ Page({ | |||||
| dynamicRq: res.data.dynamicId, | dynamicRq: res.data.dynamicId, | ||||
| expiredSeconds: res.data.expiredSeconds | expiredSeconds: res.data.expiredSeconds | ||||
| }) | }) | ||||
| let url = JSON.stringify({ | let url = JSON.stringify({ | ||||
| END: "C", | END: "C", | ||||
| TYPE: "couponorder", | TYPE: "couponorder", | ||||
| ID: _this.data.dynamicRq | ID: _this.data.dynamicRq | ||||
| }) | }) | ||||
| if (res.data.expiredSeconds==0){ | |||||
| let inre = setInterval(()=>{ | |||||
| if(_this.data.expiredSeconds>1){ | |||||
| _this.setData({ | |||||
| expiredSeconds: _this.data.expiredSeconds-1 | |||||
| }) | |||||
| console.log("有效",_this.data.expiredSeconds) | |||||
| }else{ | |||||
| console.log("无效", _this.data.expiredSeconds) | |||||
| clearInterval(_this.data.templTiem) | |||||
| _this.setData({ | |||||
| showhieRq:true | |||||
| }) | |||||
| } | |||||
| },1000) | |||||
| _this.setData({ | |||||
| templTiem:inre | |||||
| }) | |||||
| }else{ | |||||
| let inre = setInterval(() => { | |||||
| if (_this.data.expiredSeconds > 1) { | |||||
| _this.setData({ | |||||
| expiredSeconds: _this.data.expiredSeconds - 1 | |||||
| }) | |||||
| console.log("有效", _this.data.expiredSeconds) | |||||
| } else { | |||||
| console.log("无效", _this.data.expiredSeconds) | |||||
| clearInterval(_this.data.templTiem) | |||||
| _this.setData({ | |||||
| showhieRq: true | |||||
| }) | |||||
| } | |||||
| }, 1000) | |||||
| _this.setData({ | |||||
| templTiem: inre | |||||
| }) | |||||
| } | |||||
| // util.qrcode("qrcode", url, 350, 350); | // util.qrcode("qrcode", url, 350, 350); | ||||
| _this.createQrCode(url, "qrcode", 350, 350); | _this.createQrCode(url, "qrcode", 350, 350); | ||||
| }).catch(err=>{ | }).catch(err=>{ | ||||
| @@ -142,11 +146,34 @@ Page({ | |||||
| }); | }); | ||||
| }) | }) | ||||
| }, | }, | ||||
| showId() { | |||||
| let this_ = this; | |||||
| if (!this_.data.showIdFalg) { | |||||
| wx.showModal({ | |||||
| content: '是否查看完整券码', | |||||
| success(res) { | |||||
| if (res.confirm) { | |||||
| this_.setData({ | |||||
| showIdFalg: true | |||||
| }) | |||||
| } else if (res.cancel) { | |||||
| console.log('用户点击取消') | |||||
| } | |||||
| } | |||||
| }) | |||||
| } else { | |||||
| this.setData({ | |||||
| showIdFalg: false | |||||
| }) | |||||
| } | |||||
| }, | |||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| let that = this; | let that = this; | ||||
| that.setData({ | that.setData({ | ||||
| code: options.quancode, | code: options.quancode, | ||||
| codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14), | |||||
| couponorderstatus: options.couponorderstatus | couponorderstatus: options.couponorderstatus | ||||
| }); | }); | ||||
| @@ -57,8 +57,10 @@ | |||||
| 后失效 | 后失效 | ||||
| </view> | </view> | ||||
| <view class="barnum buy"> | |||||
| <text>优惠券码:</text>{{code}}</view> | |||||
| <view class="barnum"> | |||||
| <view class="barnumtext">{{showIdFalg?code:codeS}}</view> | |||||
| <image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <!-- 适用门店 --> | <!-- 适用门店 --> | ||||
| @@ -62,29 +62,36 @@ page { | |||||
| margin: 0 auto; | margin: 0 auto; | ||||
| } | } | ||||
| .barnum { | |||||
| background: #fff; | |||||
| height: 88rpx; | |||||
| width: 100%; | |||||
| margin: 0 auto; | |||||
| line-height: 88rpx; | |||||
| border: 2rpx solid #ccc; | |||||
| border-radius: 10px; | |||||
| font-size: 36rpx; | |||||
| color: #333; | |||||
| letter-spacing: 0; | |||||
| text-align: center; | |||||
| .barnum{ | |||||
| background: #fff; | |||||
| height: 88rpx; | |||||
| width: 600rpx; | |||||
| margin: 0 auto; | |||||
| line-height: 88rpx; | |||||
| border: 2rpx solid #ccc; | |||||
| border-radius: 10px; | |||||
| font-size: 36rpx; | |||||
| color: #333; | |||||
| letter-spacing: 0; | |||||
| text-align: center; | |||||
| overflow: hidden; | |||||
| } | |||||
| .barnumtext{ | |||||
| float: left; | |||||
| margin-left: 20rpx; | |||||
| font-size: 30rpx; | |||||
| } | |||||
| .barnumImg{ | |||||
| float: left; | |||||
| height: 40rpx; | |||||
| width: 40rpx !important; | |||||
| margin: 24rpx 20rpx !important; | |||||
| } | |||||
| .barnumtext::before{ | |||||
| content: "优惠券码:"; | |||||
| font-size: 24rpx; | |||||
| color: #999; | |||||
| } | } | ||||
| .barnum text { | |||||
| display: inline-block; | |||||
| vertical-align: top; | |||||
| font-size: 24rpx; | |||||
| color: #999; | |||||
| letter-spacing: 0; | |||||
| margin-right: 6rpx; | |||||
| } | |||||
| .barcode > canvas { | .barcode > canvas { | ||||
| width: 510rpx; | width: 510rpx; | ||||
| height: 100rpx; | height: 100rpx; | ||||
| @@ -16,43 +16,90 @@ Page({ | |||||
| navigationBarHeight, | navigationBarHeight, | ||||
| url: config.url, | url: config.url, | ||||
| token: app.globalData.token, | token: app.globalData.token, | ||||
| id:'', | |||||
| date:new Date() | |||||
| id: '', | |||||
| date: new Date() | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
| */ | */ | ||||
| onLoad: function (options) { | |||||
| const that = this; | |||||
| that.setData({ | |||||
| url: config.url, | |||||
| id:options.id, | |||||
| token: app.globalData.token | |||||
| }) | |||||
| if (options&&options.id){ | |||||
| wx.request({ | |||||
| url: configUrls + config.api.printHtmlById, | |||||
| data: { | |||||
| token: app.globalData.token, | |||||
| onLoad: function(options) { | |||||
| if (app.globalData.token) { | |||||
| const that = this; | |||||
| that.setData({ | |||||
| url: config.url, | |||||
| id: options.id, | |||||
| token: app.globalData.token | |||||
| }) | |||||
| if (options && options.id) { | |||||
| wx.request({ | |||||
| url: configUrls + config.api.printHtmlById, | |||||
| data: { | |||||
| token: app.globalData.token, | |||||
| id: options.id, | |||||
| date: new Date() | |||||
| }, | |||||
| header: { | |||||
| 'content-type': 'application/html' | |||||
| }, | |||||
| success: function(res) { | |||||
| var temp = WxParse.wxParse('article', 'html', res.data, that, 5); | |||||
| } | |||||
| }) | |||||
| } | |||||
| } else { | |||||
| app.tokenCallback = token => { | |||||
| const that = this; | |||||
| that.setData({ | |||||
| url: config.url, | |||||
| id: options.id, | id: options.id, | ||||
| date: new Date() | |||||
| }, | |||||
| header: { | |||||
| 'content-type': 'application/html' | |||||
| }, | |||||
| success: function (res) { | |||||
| var temp = WxParse.wxParse('article', 'html', res.data, that, 5); | |||||
| token: app.globalData.token | |||||
| }) | |||||
| if (options && options.id) { | |||||
| wx.request({ | |||||
| url: configUrls + config.api.printHtmlById, | |||||
| data: { | |||||
| token: app.globalData.token, | |||||
| id: options.id, | |||||
| date: new Date() | |||||
| }, | |||||
| header: { | |||||
| 'content-type': 'application/html' | |||||
| }, | |||||
| success: function(res) { | |||||
| var temp = WxParse.wxParse('article', 'html', res.data, that, 5); | |||||
| } | |||||
| }) | |||||
| } | } | ||||
| }) | |||||
| } | |||||
| } | } | ||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
| */ | */ | ||||
| onShow: function () { | |||||
| onShow: function() { | |||||
| this.setData({ | this.setData({ | ||||
| date:new Date() | |||||
| date: new Date() | |||||
| }) | }) | ||||
| } | |||||
| }, | |||||
| onShareAppMessage: function(options) { | |||||
| var that = this; | |||||
| console.log(`/pages/freeBannerDetail/index?id=${that.data.data.id}`) | |||||
| var shareObj = { | |||||
| title: that.data.title, | |||||
| path: `/pages/freeBannerDetail/index?id=${that.data.data.id}`, | |||||
| success: function(res) { | |||||
| if (res.errMsg == 'shareAppMessage:ok') {} | |||||
| }, | |||||
| fail: function(error) { | |||||
| if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {} | |||||
| } | |||||
| }; | |||||
| console.log(shareObj) | |||||
| return shareObj; | |||||
| }, | |||||
| }) | }) | ||||
| @@ -7,8 +7,9 @@ const imgurl = require("../../../utils/imgurl"); | |||||
| Page({ | Page({ | ||||
| /** | /** | ||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| */ | |||||
| */ | |||||
| data: { | data: { | ||||
| showIdFalg: false, | |||||
| showFlag: false, | showFlag: false, | ||||
| navigationBarHeight, | navigationBarHeight, | ||||
| succUrl: imgurl.succ.url, | succUrl: imgurl.succ.url, | ||||
| @@ -34,6 +35,28 @@ Page({ | |||||
| contentType: 0, | contentType: 0, | ||||
| orderFlag: false, //判断是不是线上配送 | orderFlag: false, //判断是不是线上配送 | ||||
| }, | }, | ||||
| showId() { | |||||
| let this_ = this; | |||||
| if (!this_.data.showIdFalg) { | |||||
| wx.showModal({ | |||||
| content: '是否查看完整券码', | |||||
| success(res) { | |||||
| if (res.confirm) { | |||||
| this_.setData({ | |||||
| showIdFalg: true | |||||
| }) | |||||
| } else if (res.cancel) { | |||||
| console.log('用户点击取消') | |||||
| } | |||||
| } | |||||
| }) | |||||
| } else { | |||||
| this.setData({ | |||||
| showIdFalg: false | |||||
| }) | |||||
| } | |||||
| }, | |||||
| copeCode(e) { | copeCode(e) { | ||||
| let code = e.currentTarget.dataset.text | let code = e.currentTarget.dataset.text | ||||
| wx.setClipboardData({ | wx.setClipboardData({ | ||||
| @@ -115,7 +138,8 @@ Page({ | |||||
| that.getStaticGame() | that.getStaticGame() | ||||
| var createDate = util.formatTime(res.data.orders[0].createDate, "yyyy-MM-dd hh:mm:ss"); | var createDate = util.formatTime(res.data.orders[0].createDate, "yyyy-MM-dd hh:mm:ss"); | ||||
| let tempData = res.data.orders[0] | let tempData = res.data.orders[0] | ||||
| tempData.deliveryInfo = tempData.deliveryInfo ? JSON.parse(tempData.deliveryInfo) : "" | |||||
| tempData.deliveryInfo = tempData.deliveryInfo ? JSON.parse(tempData.deliveryInfo) : ""; | |||||
| tempData.couponOrderIdS = tempData.couponOrderIdS? tempData.couponOrderId.slice(0, 4) + `******` + tempData.couponOrderId.slice(14):'' | |||||
| that.setData({ | that.setData({ | ||||
| order: tempData, | order: tempData, | ||||
| showPage: true, | showPage: true, | ||||
| @@ -132,7 +156,7 @@ Page({ | |||||
| wx.hideLoading(); | wx.hideLoading(); | ||||
| wx.showModal({ | wx.showModal({ | ||||
| title: '提示', | title: '提示', | ||||
| content: error.errMsg, | |||||
| content: error.message ? error.message:error.data, | |||||
| showCancel: false | showCancel: false | ||||
| }) | }) | ||||
| }) | }) | ||||
| @@ -47,7 +47,8 @@ | |||||
| data-validstatus="{{order.validStatus}}" bindtap="powerDrawer" class='dhCode'> | data-validstatus="{{order.validStatus}}" bindtap="powerDrawer" class='dhCode'> | ||||
| <view style="width:86%;clear: both;"> | <view style="width:86%;clear: both;"> | ||||
| <text class="fl">兑换码:</text> | <text class="fl">兑换码:</text> | ||||
| <text class="fr" wx:if="{{order.validStatus!=0}}">{{order.couponOrderId}}</text> | |||||
| <text class="fr" wx:if="{{order.validStatus!=0}}">{{showIdFalg?order.couponOrderId:order.couponOrderIdS}}</text> | |||||
| <image class="barnumImg" src="../../../assets/images/password.png" catchtap="showId"></image> | |||||
| </view> | </view> | ||||
| <view> | <view> | ||||
| <image class="spcode" src="{{spcodeUrl}}" mode='widthFix'></image> | <image class="spcode" src="{{spcodeUrl}}" mode='widthFix'></image> | ||||
| @@ -13,7 +13,12 @@ page { | |||||
| width: 100%; | width: 100%; | ||||
| padding-bottom: 160rpx; | padding-bottom: 160rpx; | ||||
| } | } | ||||
| .barnumImg{ | |||||
| float: left; | |||||
| height: 40rpx; | |||||
| width: 40rpx; | |||||
| margin: 24rpx 20rpx; | |||||
| } | |||||
| .success { | .success { | ||||
| vertical-align: middle; | vertical-align: middle; | ||||
| width: 40rpx; | width: 40rpx; | ||||
| @@ -7,6 +7,7 @@ const imgurl = require("../../utils/imgurl"); | |||||
| const QR = require("../../utils/memberqrcode.js"); | const QR = require("../../utils/memberqrcode.js"); | ||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| showIdFalg: false, | |||||
| navigationBarHeight, | navigationBarHeight, | ||||
| btomLineUrl: imgurl.btomLine.url, | btomLineUrl: imgurl.btomLine.url, | ||||
| topLineUrl: imgurl.topLine.url, | topLineUrl: imgurl.topLine.url, | ||||
| @@ -29,6 +30,28 @@ Page({ | |||||
| expiredSeconds: 0, | expiredSeconds: 0, | ||||
| templTiem: "" | templTiem: "" | ||||
| }, | }, | ||||
| showId() { | |||||
| let this_ = this; | |||||
| if (!this_.data.showIdFalg) { | |||||
| wx.showModal({ | |||||
| content: '是否查看完整券码', | |||||
| success(res) { | |||||
| if (res.confirm) { | |||||
| this_.setData({ | |||||
| showIdFalg: true | |||||
| }) | |||||
| } else if (res.cancel) { | |||||
| console.log('用户点击取消') | |||||
| } | |||||
| } | |||||
| }) | |||||
| } else { | |||||
| this.setData({ | |||||
| showIdFalg: false | |||||
| }) | |||||
| } | |||||
| }, | |||||
| gotogame: function () { | gotogame: function () { | ||||
| let that = this; | let that = this; | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| @@ -79,30 +102,34 @@ Page({ | |||||
| dynamicRq: res.data.dynamicId, | dynamicRq: res.data.dynamicId, | ||||
| expiredSeconds: res.data.expiredSeconds | expiredSeconds: res.data.expiredSeconds | ||||
| }) | }) | ||||
| let url = JSON.stringify({ | let url = JSON.stringify({ | ||||
| END: "C", | END: "C", | ||||
| TYPE: "couponorder", | TYPE: "couponorder", | ||||
| ID: _this.data.dynamicRq | ID: _this.data.dynamicRq | ||||
| }) | }) | ||||
| let inre = setInterval(() => { | |||||
| if (_this.data.expiredSeconds > 1) { | |||||
| _this.setData({ | |||||
| expiredSeconds: _this.data.expiredSeconds - 1 | |||||
| }) | |||||
| console.log("有效", _this.data.expiredSeconds) | |||||
| } else { | |||||
| console.log("无效", _this.data.expiredSeconds) | |||||
| clearInterval(_this.data.templTiem) | |||||
| _this.setData({ | |||||
| showhieRq: true | |||||
| }) | |||||
| } | |||||
| }, 1000) | |||||
| _this.setData({ | |||||
| templTiem: inre | |||||
| }) | |||||
| if (res.data.expiredSeconds==0){ | |||||
| }else{ | |||||
| let inre = setInterval(() => { | |||||
| if (_this.data.expiredSeconds > 1) { | |||||
| _this.setData({ | |||||
| expiredSeconds: _this.data.expiredSeconds - 1 | |||||
| }) | |||||
| console.log("有效", _this.data.expiredSeconds) | |||||
| } else { | |||||
| console.log("无效", _this.data.expiredSeconds) | |||||
| clearInterval(_this.data.templTiem) | |||||
| _this.setData({ | |||||
| showhieRq: true | |||||
| }) | |||||
| } | |||||
| }, 1000) | |||||
| _this.setData({ | |||||
| templTiem: inre | |||||
| }) | |||||
| } | |||||
| // util.qrcode("qrcode", url, 350, 350); | // util.qrcode("qrcode", url, 350, 350); | ||||
| _this.createQrCode(url, "qrcode", 350, 350); | _this.createQrCode(url, "qrcode", 350, 350); | ||||
| }).catch(err => { | }).catch(err => { | ||||
| @@ -112,7 +139,7 @@ Page({ | |||||
| duration: 2000, | duration: 2000, | ||||
| mask: false | mask: false | ||||
| }); | }); | ||||
| }) | |||||
| }) | |||||
| }, | }, | ||||
| onLoad: function (options) { //quancode | onLoad: function (options) { //quancode | ||||
| @@ -123,6 +150,7 @@ Page({ | |||||
| // that.createQrCode(value, "qrcode", 350, 350); | // that.createQrCode(value, "qrcode", 350, 350); | ||||
| that.setData({ | that.setData({ | ||||
| code: options.quancode, | code: options.quancode, | ||||
| codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14), | |||||
| title: options.title, | title: options.title, | ||||
| subtitle: options.subtitle, | subtitle: options.subtitle, | ||||
| remark: options.remark, | remark: options.remark, | ||||
| @@ -32,7 +32,10 @@ | |||||
| <text style="color:red">{{expiredSeconds}}s</text> | <text style="color:red">{{expiredSeconds}}s</text> | ||||
| 后失效 | 后失效 | ||||
| </view> | </view> | ||||
| <view class="barnum buy"><text>兑换码:</text>{{code}}</view> | |||||
| <view class="barnum"> | |||||
| <view class="barnumtext">{{showIdFalg?code:codeS}}</view> | |||||
| <image class="barnumImg" src="../../assets/images/password.png" bindtap="showId"></image> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <image class='line' src='{{btomLineUrl}}' mode="widthFix"></image> | <image class='line' src='{{btomLineUrl}}' mode="widthFix"></image> | ||||
| @@ -77,23 +77,36 @@ page { | |||||
| margin: 0 auto; | margin: 0 auto; | ||||
| } | } | ||||
| .barnum { | |||||
| height: 46rpx; | |||||
| line-height: 46rpx; | |||||
| font-size: 24rpx; | |||||
| text-align: center; | |||||
| letter-spacing: 2rpx; | |||||
| white-space: nowrap; | |||||
| color: #7f7f7f; | |||||
| } | |||||
| .barnum{ | |||||
| background: #fff; | |||||
| height: 88rpx; | |||||
| width: 540rpx; | |||||
| line-height: 88rpx; | |||||
| border: 2rpx solid #ccc; | |||||
| border-radius: 10px; | |||||
| font-size: 36rpx; | |||||
| color: #333; | |||||
| letter-spacing: 0; | |||||
| text-align: center; | |||||
| overflow: hidden; | |||||
| margin-left: -10rpx; | |||||
| .barnum text { | |||||
| display: inline-block; | |||||
| vertical-align: top; | |||||
| font-size: 24rpx; | |||||
| color: #999; | |||||
| letter-spacing: 0; | |||||
| margin-right: 6rpx; | |||||
| } | |||||
| .barnumtext{ | |||||
| float: left; | |||||
| margin-left: 20rpx; | |||||
| font-size: 30rpx; | |||||
| } | |||||
| .barnumImg{ | |||||
| float: left; | |||||
| height: 40rpx; | |||||
| width: 40rpx !important; | |||||
| margin: 24rpx 20rpx !important; | |||||
| } | |||||
| .barnumtext::before{ | |||||
| content: "优惠券码:"; | |||||
| font-size: 24rpx; | |||||
| color: #999; | |||||
| } | } | ||||
| .barcode > canvas { | .barcode > canvas { | ||||
| @@ -108,7 +108,7 @@ Page({ | |||||
| }).then(res=>{ | }).then(res=>{ | ||||
| wx.hideLoading() | wx.hideLoading() | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`, | |||||
| url: `/pages/radetail/joinActivity/edit?activityId=${activityId}&phone=${res.data.phone}`, | |||||
| }) | }) | ||||
| }).catch(err=>{ | }).catch(err=>{ | ||||
| wx.hideLoading() | wx.hideLoading() | ||||
| @@ -80,6 +80,7 @@ Page({ | |||||
| console.log(value) | console.log(value) | ||||
| }, | }, | ||||
| formSubmit: function(e) { | formSubmit: function(e) { | ||||
| app.globalData.previewFlag = true | app.globalData.previewFlag = true | ||||
| let that = this; | let that = this; | ||||
| /** | /** | ||||
| @@ -115,8 +116,10 @@ Page({ | |||||
| delete e.detail.value.username; | delete e.detail.value.username; | ||||
| let obj = e.detail.value; | let obj = e.detail.value; | ||||
| if (that.data&&that.data.question&&that.data.question.length>0){ | if (that.data&&that.data.question&&that.data.question.length>0){ | ||||
| let valArr22; | |||||
| valArr22 = Object.keys(obj).map(function (item,index) { | |||||
| let valArr22=[]; | |||||
| Object.keys(obj).map(function (item,index) { | |||||
| console.log(item, index) | |||||
| if (!obj[item]){ | if (!obj[item]){ | ||||
| wx.showToast({ | wx.showToast({ | ||||
| title: '问卷调查回答不完整,请补充', | title: '问卷调查回答不完整,请补充', | ||||
| @@ -130,9 +133,30 @@ Page({ | |||||
| that.setData({ | that.setData({ | ||||
| answerflag: "answer" | answerflag: "answer" | ||||
| }) | }) | ||||
| return { ques: that.data.question[index].ques, answer: obj[item] } | |||||
| // return { ques: that.data.question[index].ques, answer: obj[item] } | |||||
| } | } | ||||
| }); | }); | ||||
| that.data.question.map((item, index) => { | |||||
| if (obj['answer' + index] == '') { | |||||
| wx.showToast({ | |||||
| title: '问卷调查回答不完整,请补充', | |||||
| duration: 2000, | |||||
| icon: "none" | |||||
| }) | |||||
| that.setData({ | |||||
| answerflag: "noanswer" | |||||
| }) | |||||
| } else { | |||||
| that.setData({ | |||||
| answerflag: "answer" | |||||
| }) | |||||
| valArr22.push({ ques: item.ques, answer: obj['answer' + index]}) | |||||
| } | |||||
| }) | |||||
| this.setData({ | this.setData({ | ||||
| answer:valArr22 | answer:valArr22 | ||||
| }); | }); | ||||
| @@ -145,8 +169,10 @@ Page({ | |||||
| }) | }) | ||||
| } | } | ||||
| else { | else { | ||||
| if (this.data.answerflag == 'noanswer'){ | if (this.data.answerflag == 'noanswer'){ | ||||
| }else{ | }else{ | ||||
| that.setData({ | that.setData({ | ||||
| disabled: true | disabled: true | ||||
| }) | }) | ||||
| @@ -158,7 +184,14 @@ Page({ | |||||
| birthday: birthday, | birthday: birthday, | ||||
| answer: JSON.stringify(that.data.answer), | answer: JSON.stringify(that.data.answer), | ||||
| activityId: that.data.activityId | activityId: that.data.activityId | ||||
| }; | |||||
| }; | |||||
| if (obj.number) { | |||||
| data.number = obj.number | |||||
| } | |||||
| if (obj.age) { | |||||
| data.age = obj.age | |||||
| } | |||||
| if (that.data.receiptUrl){ | if (that.data.receiptUrl){ | ||||
| data.imgUrl = "[" + '"' + that.data.receiptUrl + '"' + "]"; | data.imgUrl = "[" + '"' + that.data.receiptUrl + '"' + "]"; | ||||
| } | } | ||||
| @@ -203,7 +236,8 @@ Page({ | |||||
| that.getLocation(); | that.getLocation(); | ||||
| if (options && options.activityId) { | if (options && options.activityId) { | ||||
| that.setData({ | that.setData({ | ||||
| activityId: options.activityId | |||||
| activityId: options.activityId, | |||||
| phone: options.phone | |||||
| }) | }) | ||||
| that.getDetail(options.activityId); | that.getDetail(options.activityId); | ||||
| } | } | ||||
| @@ -266,7 +300,7 @@ Page({ | |||||
| id: activityId | id: activityId | ||||
| } | } | ||||
| }).then(res => { | }).then(res => { | ||||
| if (res && res.data && res.data.activity) { | |||||
| if (res && res.data && res.data.activity) { | |||||
| this.setData({ | this.setData({ | ||||
| useImg: res.data.activity.useImg, | useImg: res.data.activity.useImg, | ||||
| imgDetail: res.data.activity.imgDetail, | imgDetail: res.data.activity.imgDetail, | ||||
| @@ -292,33 +326,33 @@ Page({ | |||||
| */ | */ | ||||
| getLocation() { | getLocation() { | ||||
| let that = this; | let that = this; | ||||
| wx.getLocation({ | |||||
| type: "wgs84", | |||||
| success: function (res) { | |||||
| console.log(res) | |||||
| if (res && res.longitude && res.latitude) { | |||||
| Http.post({ | |||||
| url: config.api.updateLBS, | |||||
| data: { | |||||
| latitude: res.latitude, | |||||
| longitude: res.longitude | |||||
| } | |||||
| }).then(res => { | |||||
| console.log(res) | |||||
| }) | |||||
| } | |||||
| }, | |||||
| fail: error => { | |||||
| wx.showModal({ | |||||
| title: '提醒', | |||||
| content: '您拒绝了地理位置的授权,将无法参加报名活动,请删除小程序重新登录,才可以继续参加该活动', | |||||
| showCancel:false, | |||||
| success:function(res){ | |||||
| if (res.confirm){ | |||||
| } | |||||
| } | |||||
| }) | |||||
| } | |||||
| }) | |||||
| // wx.getLocation({ | |||||
| // type: "wgs84", | |||||
| // success: function (res) { | |||||
| // console.log(res) | |||||
| // if (res && res.longitude && res.latitude) { | |||||
| // Http.post({ | |||||
| // url: config.api.updateLBS, | |||||
| // data: { | |||||
| // latitude: res.latitude, | |||||
| // longitude: res.longitude | |||||
| // } | |||||
| // }).then(res => { | |||||
| // console.log(res) | |||||
| // }) | |||||
| // } | |||||
| // }, | |||||
| // fail: error => { | |||||
| // wx.showModal({ | |||||
| // title: '提醒', | |||||
| // content: '您拒绝了地理位置的授权,将无法参加报名活动,请删除小程序重新登录,才可以继续参加该活动', | |||||
| // showCancel:false, | |||||
| // success:function(res){ | |||||
| // if (res.confirm){ | |||||
| // } | |||||
| // } | |||||
| // }) | |||||
| // } | |||||
| // }) | |||||
| }, | }, | ||||
| }) | }) | ||||
| @@ -1,4 +1,4 @@ | |||||
| <navbar home back text="活动调查"></navbar> | |||||
| <navbar home back text="填写报名信息"></navbar> | |||||
| <view style="height:{{navigationBarHeight}} "></view> | <view style="height:{{navigationBarHeight}} "></view> | ||||
| <view > | <view > | ||||
| <form bindsubmit="formSubmit"> | <form bindsubmit="formSubmit"> | ||||
| @@ -8,6 +8,25 @@ | |||||
| <input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}' /> | <input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}' /> | ||||
| <input wx:if="{{!username}}" name="username" type="text" placeholder='请填写名字' /> | <input wx:if="{{!username}}" name="username" type="text" placeholder='请填写名字' /> | ||||
| </view> | </view> | ||||
| <view class='section' wx:if="{{selectques.phone==1}}"> | |||||
| <text>手机号</text> | |||||
| <input wx:if="{{phone}}" name="phone" type="number" placeholder='{{phone}}' disabled/> | |||||
| <input wx:if="{{!phone}}" name="phone" type="number" placeholder='请填写手机号' disabled /> | |||||
| </view> | |||||
| <view class='section' wx:if="{{selectques.number==1}}"> | |||||
| <text>人数</text> | |||||
| <input wx:if="{{number}}" name="number" type="number" placeholder='{{number}}' /> | |||||
| <input wx:if="{{!number}}" name="number" type="number" placeholder='请填写人数' /> | |||||
| </view> | |||||
| <view class='section' wx:if="{{selectques.age==1}}"> | |||||
| <text>年龄</text> | |||||
| <input wx:if="{{age}}" name="age" type="number" placeholder='{{age}}' /> | |||||
| <input wx:if="{{!age}}" name="age" type="number" placeholder='请填写年龄' /> | |||||
| </view> | |||||
| <view class="section sec" wx:if="{{selectques.birth==1}}"> | <view class="section sec" wx:if="{{selectques.birth==1}}"> | ||||
| <text>生日</text> | <text>生日</text> | ||||
| <picker mode="date" value="{{date}}" start="1930-09-01" end="2017-09-01" bindchange="bindDateChange"> | <picker mode="date" value="{{date}}" start="1930-09-01" end="2017-09-01" bindchange="bindDateChange"> | ||||
| @@ -29,10 +48,10 @@ | |||||
| <view class='names' wx:if="{{!address}}">请选择地址</view> | <view class='names' wx:if="{{!address}}">请选择地址</view> | ||||
| </view> | </view> | ||||
| <view class='ques' wx:if="{{question&&question.length>0}}"> | <view class='ques' wx:if="{{question&&question.length>0}}"> | ||||
| <text class='questionTitle'>调查问卷</text> | |||||
| <!-- <text class='questionTitle'>报名信息收集</text> --> | |||||
| <view class='answer' wx:for="{{question}}" wx:key="index"> | <view class='answer' wx:for="{{question}}" wx:key="index"> | ||||
| <text>{{item.ques}}</text> | |||||
| <textarea name="answer{{index}}" bindinput='change' type="textarea" placeholder='请填写您的回答?'></textarea> | |||||
| <text class="answerText">{{item.ques}}</text> | |||||
| <textarea class="answerTextarea" name="answer{{index}}" bindinput='change' type="textarea" placeholder='请填写您的回答'></textarea> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view wx:if="{{useImg==1}}"> | <view wx:if="{{useImg==1}}"> | ||||
| @@ -1,5 +1,5 @@ | |||||
| input { | input { | ||||
| width:600rpx; | |||||
| width:500rpx; | |||||
| display: inline-block; | display: inline-block; | ||||
| font-size: 32rpx; | font-size: 32rpx; | ||||
| vertical-align: middle; | vertical-align: middle; | ||||
| @@ -16,6 +16,8 @@ input { | |||||
| width: 710rpx; | width: 710rpx; | ||||
| margin: 0 auto; | margin: 0 auto; | ||||
| border-bottom: 1px solid #eee; | border-bottom: 1px solid #eee; | ||||
| background-color: #fff; | |||||
| } | } | ||||
| .camera{ | .camera{ | ||||
| width: 400rpx; | width: 400rpx; | ||||
| @@ -35,6 +37,7 @@ input { | |||||
| margin: 0 auto; | margin: 0 auto; | ||||
| border-bottom: 1px solid #eee; | border-bottom: 1px solid #eee; | ||||
| padding-bottom: 10rpx; | padding-bottom: 10rpx; | ||||
| background-color: #fff; | |||||
| } | } | ||||
| .radio{ | .radio{ | ||||
| margin-right: 30rpx; | margin-right: 30rpx; | ||||
| @@ -57,11 +60,13 @@ radio { | |||||
| font-size: 32rpx; | font-size: 32rpx; | ||||
| display: inline-block; | display: inline-block; | ||||
| margin-right: 20rpx; | margin-right: 20rpx; | ||||
| margin-left: 20rpx | |||||
| } | } | ||||
| .address > text:nth-of-type(1) { | .address > text:nth-of-type(1) { | ||||
| font-size: 32rpx; | font-size: 32rpx; | ||||
| display: inline-block; | display: inline-block; | ||||
| margin-right: 20rpx; | margin-right: 20rpx; | ||||
| margin-left: 20rpx | |||||
| } | } | ||||
| .btn{ | .btn{ | ||||
| position: fixed; | position: fixed; | ||||
| @@ -87,17 +92,19 @@ radio { | |||||
| } | } | ||||
| .input{ | .input{ | ||||
| position: absolute; | position: absolute; | ||||
| left: 84rpx; | |||||
| left: 110rpx; | |||||
| z-index: 1000; | z-index: 1000; | ||||
| top: 0; | top: 0; | ||||
| bottom: 0; | bottom: 0; | ||||
| margin: auto; | margin: auto; | ||||
| background: #fff; | background: #fff; | ||||
| } | } | ||||
| .names{ | .names{ | ||||
| font-size: 26rpx; | font-size: 26rpx; | ||||
| line-height: 46rpx; | line-height: 46rpx; | ||||
| color: #999; | color: #999; | ||||
| margin-left: 20rpx | |||||
| } | } | ||||
| .ques{ | .ques{ | ||||
| padding-left: 20rpx; | padding-left: 20rpx; | ||||
| @@ -108,8 +115,8 @@ radio { | |||||
| text-align: left; | text-align: left; | ||||
| } | } | ||||
| .questionTitle{ | .questionTitle{ | ||||
| width: 180rpx; | |||||
| font-size: 40rpx; | |||||
| width: 260rpx; | |||||
| font-size: 36rpx; | |||||
| border-top:6rpx solid orange; | border-top:6rpx solid orange; | ||||
| border-bottom:6rpx solid orange; | border-bottom:6rpx solid orange; | ||||
| margin: 40rpx auto 30rpx; | margin: 40rpx auto 30rpx; | ||||
| @@ -120,13 +127,26 @@ radio { | |||||
| } | } | ||||
| .answer{ | .answer{ | ||||
| margin-bottom: 20rpx; | margin-bottom: 20rpx; | ||||
| background-color: #fff; | |||||
| overflow: hidden; | |||||
| } | |||||
| .answerText{ | |||||
| margin-left: 20rpx; | |||||
| } | } | ||||
| /* .answerTextarea{ | |||||
| margin-left: 20rpx; | |||||
| } */ | |||||
| .answer textarea{ | .answer textarea{ | ||||
| border: 1rpx solid #efefef; | border: 1rpx solid #efefef; | ||||
| border-radius: 10rpx; | border-radius: 10rpx; | ||||
| padding: 10rpx 0; | padding: 10rpx 0; | ||||
| margin-top: 10rpx; | margin-top: 10rpx; | ||||
| padding-left: 10rpx; | padding-left: 10rpx; | ||||
| height: 100rpx; | |||||
| margin-left: 20rpx; | |||||
| padding-bottom: 10rpx; | |||||
| margin-bottom: 10rpx; | |||||
| } | } | ||||
| .quesTitle{ | .quesTitle{ | ||||
| text-align: center; | text-align: center; | ||||
| @@ -535,29 +535,29 @@ Page({ | |||||
| /** | /** | ||||
| * 获得经纬度 | * 获得经纬度 | ||||
| */ | */ | ||||
| getLocation() { | |||||
| let that = this; | |||||
| wx.getLocation({ | |||||
| type: "wgs84", | |||||
| success: function (res) { | |||||
| console.log(res, 9999) | |||||
| if (res && res.longitude && res.latitude) { | |||||
| Http.post({ | |||||
| url: config.api.updateLBS, | |||||
| data: { | |||||
| latitude: res.latitude, | |||||
| longitude: res.longitude | |||||
| } | |||||
| }).then(res => { | |||||
| console.log(res, 9999) | |||||
| }) | |||||
| } | |||||
| }, | |||||
| fail: error => { | |||||
| console.log(error); | |||||
| } | |||||
| }) | |||||
| }, | |||||
| // getLocation() { | |||||
| // let that = this; | |||||
| // wx.getLocation({ | |||||
| // type: "wgs84", | |||||
| // success: function (res) { | |||||
| // console.log(res, 9999) | |||||
| // if (res && res.longitude && res.latitude) { | |||||
| // Http.post({ | |||||
| // url: config.api.updateLBS, | |||||
| // data: { | |||||
| // latitude: res.latitude, | |||||
| // longitude: res.longitude | |||||
| // } | |||||
| // }).then(res => { | |||||
| // console.log(res, 9999) | |||||
| // }) | |||||
| // } | |||||
| // }, | |||||
| // fail: error => { | |||||
| // console.log(error); | |||||
| // } | |||||
| // }) | |||||
| // }, | |||||
| onUnload() { | onUnload() { | ||||
| // wx.removeStorageSync('squareList') | // wx.removeStorageSync('squareList') | ||||
| @@ -786,7 +786,7 @@ Page({ | |||||
| that.getType() | that.getType() | ||||
| // that.uesrInfo() | // that.uesrInfo() | ||||
| that.getLocation(); | |||||
| // that.getLocation(); | |||||
| that.getMallInfo(app.globalData.token); | that.getMallInfo(app.globalData.token); | ||||
| if (app.couponChannelListCallback) { | if (app.couponChannelListCallback) { | ||||
| @@ -850,7 +850,7 @@ Page({ | |||||
| } | } | ||||
| that.getType() | that.getType() | ||||
| // that.uesrInfo() | // that.uesrInfo() | ||||
| that.getLocation(); | |||||
| // that.getLocation(); | |||||
| that.getMallInfo(app.globalData.token); | that.getMallInfo(app.globalData.token); | ||||
| if (app.couponChannelListCallback) { | if (app.couponChannelListCallback) { | ||||
| @@ -80,10 +80,10 @@ | |||||
| "referrerInfo": {} | "referrerInfo": {} | ||||
| }, | }, | ||||
| { | { | ||||
| "id": 8, | |||||
| "name": "个人信息", | |||||
| "pathName": "pages/site/site", | |||||
| "query": "", | |||||
| "id": 3, | |||||
| "name": "pages/main/index", | |||||
| "pathName": "pages/main/index", | |||||
| "query": "type=cd&couponChannelId=684973014355992576", | |||||
| "scene": null | "scene": null | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -100,6 +100,13 @@ | |||||
| "query": "", | "query": "", | ||||
| "scene": 1036, | "scene": 1036, | ||||
| "referrerInfo": {} | "referrerInfo": {} | ||||
| }, | |||||
| { | |||||
| "id": 6, | |||||
| "name": "pages/freeBannerDetail/index", | |||||
| "pathName": "pages/freeBannerDetail/index", | |||||
| "query": "id= 690072721969307648", | |||||
| "scene": null | |||||
| } | } | ||||
| ] | ] | ||||
| } | } | ||||