| @@ -19,7 +19,7 @@ Component({ | |||
| data: { | |||
| bannerUrl: imgurl.banner.url, | |||
| currentIndex: 0, | |||
| mouldType:0, | |||
| mouldType: 0, | |||
| }, | |||
| /** | |||
| @@ -33,29 +33,30 @@ Component({ | |||
| let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("="); | |||
| console.log(indexOf, "123") | |||
| 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(e.currentTarget.dataset.data.pagePath) | |||
| if(type == 'cd' || type == 'sd'){ | |||
| if (type == 'cd' || type == 'sd') { | |||
| wx.navigateTo({ | |||
| url: `/${e.currentTarget.dataset.data.pagePath}`, | |||
| }) | |||
| }else if(type == "wj"){ | |||
| } else if (type == "wj") { | |||
| wx.navigateTo({ | |||
| url: `/pages/questionnaire/questionnaire?id=${id}`, | |||
| }) | |||
| }else if (type == 'ra'){ | |||
| } else if (type == 'ra') { | |||
| wx.navigateTo({ | |||
| url: `/pages/radetail/index?id=${id}`, | |||
| }) | |||
| } | |||
| }else if(e.currentTarget.dataset.data.type==2){ | |||
| } else if (e.currentTarget.dataset.data.type == 2) { | |||
| // 自由图文 | |||
| wx.navigateTo({ | |||
| 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, | |||
| // path: 'page/index/index?id=123', | |||
| // extraData: { | |||
| @@ -65,27 +66,31 @@ Component({ | |||
| success(res) { | |||
| // 打开成功 | |||
| } | |||
| }) | |||
| } | |||
| else{ | |||
| } | |||
| if (e.currentTarget.dataset.data.pagePath){ | |||
| tempObj.path = e.currentTarget.dataset.data.pagePath | |||
| } | |||
| wx.navigateToMiniProgram(tempObj) | |||
| } else { | |||
| // 固定格式 | |||
| wx.navigateTo({ | |||
| url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}` | |||
| }); | |||
| } | |||
| }, | |||
| handleChange: function (e) { | |||
| handleChange: function(e) { | |||
| this.setData({ | |||
| currentIndex: e.detail.current | |||
| }) | |||
| }, | |||
| }, | |||
| attached: function () { | |||
| attached: function() { | |||
| // 在组件实例进入页面节点树时执行 | |||
| if (app.globalData.mouldType){ | |||
| if (app.globalData.mouldType) { | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType | |||
| }) | |||
| } | |||
| }, | |||
| }); | |||
| }); | |||
| @@ -62,6 +62,21 @@ var config = { | |||
| * 商户优惠信息 | |||
| */ | |||
| listByMerchant: "/wxCouponChannel/listByMerchant", | |||
| /** | |||
| * 获取券价格与库存 | |||
| */ | |||
| couponPriceAndStock: "/wxCoupon/couponPriceAndStock", | |||
| /** | |||
| * 获取券适用门店List | |||
| */ | |||
| couponMerchant: "/wxCoupon/couponMerchant", | |||
| /** | |||
| * 获取券详情 | |||
| */ | |||
| newCouponDetail: '/wxCoupon/couponDetail', | |||
| /** | |||
| * 优惠券详情 | |||
| */ | |||
| @@ -96,5 +96,9 @@ | |||
| "networkTimeout": { | |||
| "request": 30000, | |||
| "downloadFile": 10000 | |||
| } | |||
| }, | |||
| "requiredPrivateInfos": [ | |||
| "chooseLocation", | |||
| "getLocation" | |||
| ] | |||
| } | |||
| @@ -501,6 +501,7 @@ Page({ | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onLoad: function(options) { | |||
| console.log("onLoad--") | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType, | |||
| 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() { | |||
| // wx.removeStorageSync('squareList') | |||
| @@ -595,6 +596,7 @@ Page({ | |||
| }, | |||
| onShow: function() { | |||
| console.log("onShow--") | |||
| console.log(app.globalData.mouldType, "mouldType") | |||
| if (app.globalData.token) { | |||
| this.getmemberId(app.globalData.token); | |||
| @@ -777,7 +779,7 @@ Page({ | |||
| that.getType() | |||
| // that.uesrInfo() | |||
| that.getLocation(); | |||
| // that.getLocation(); | |||
| that.getMallInfo(app.globalData.token); | |||
| if (app.couponChannelListCallback) { | |||
| @@ -841,7 +843,7 @@ Page({ | |||
| } | |||
| that.getType() | |||
| // that.uesrInfo() | |||
| that.getLocation(); | |||
| // that.getLocation(); | |||
| that.getMallInfo(app.globalData.token); | |||
| if (app.couponChannelListCallback) { | |||
| @@ -164,7 +164,7 @@ Page({ | |||
| this.checkUserStatus(); | |||
| }, | |||
| onLoad() { | |||
| this.getLocation(); | |||
| // this.getLocation(); | |||
| this.updateScene(); | |||
| // this.getRoomId(); | |||
| // 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 | |||
| */ | |||
| @@ -4,7 +4,7 @@ let app = getApp(); | |||
| const Http = require("../../utils/HttpBasics"); | |||
| const util = require("../../utils/util"); | |||
| const imgurl = require("../../utils/imgurl"); | |||
| Page({ | |||
| Page({ | |||
| data: { | |||
| mouldType: 0, | |||
| mouldConfig:{}, | |||
| @@ -20,36 +20,73 @@ Page({ | |||
| goHomeUrl: "", | |||
| }, | |||
| 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({ | |||
| 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 () { | |||
| let this_=this | |||
| @@ -57,4 +94,23 @@ Page({ | |||
| 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: { | |||
| navigationBarHeight, | |||
| poterbg: imgurl.poterbg.url, | |||
| poterbg: imgurl.poterbg.url, | |||
| windowWidth: wx.getSystemInfoSync().windowWidth, | |||
| windowHeight: wx.getSystemInfoSync().screenHeight, | |||
| totalHeight: 0, | |||
| @@ -110,6 +110,7 @@ Page({ | |||
| // 首先要绘制顶部的背景图片,因为它在最底层,然后才能绘制其他内容 | |||
| let bgimg1 = that.data.poterbg + `?imageView/2/w/${wW}/h/${wH}`; | |||
| let bgimg2 = util.getProxyImgUrl(bgimg1); | |||
| wx.getImageInfo({ | |||
| src: bgimg2, | |||
| success: function(res) { | |||
| @@ -126,6 +127,7 @@ Page({ | |||
| let topImageHeight = parseInt(260 * scale); | |||
| let src1 = ""; | |||
| let src2 = ""; | |||
| console.log(that.data.data.coverImg, "bgimg2") | |||
| //劵详情海报 | |||
| if (options && options.couponChannelId) { | |||
| 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}`; | |||
| src2 = util.getProxyImgUrl(src1); | |||
| } | |||
| // console.log(, "789") | |||
| let tempArr = src2.split('?') | |||
| if(tempArr.length>2){ | |||
| src2 = tempArr[0]+"?"+tempArr[1]+"&"+tempArr[2] | |||
| } | |||
| wx.getImageInfo({ | |||
| src: src2, | |||
| success: function(res) { | |||
| @@ -159,6 +166,7 @@ Page({ | |||
| //商户详情海报 | |||
| let src1 = that.data.avatarUrl + `?imageView/2/w/${100}/h/${100}`; | |||
| let src2 = util.getProxyImgUrl(src1); | |||
| wx.getImageInfo({ | |||
| src: src2, | |||
| success: function(res) { | |||
| @@ -6,6 +6,7 @@ const util = require("../../../utils/util"); | |||
| const imgurl = require("../../../utils/imgurl"); | |||
| Page({ | |||
| data: { | |||
| priceAndStockObj: {},//存放价格和库存 | |||
| goHomeUrl: "", | |||
| mouldType: 0, | |||
| mouldConfig:{}, | |||
| @@ -447,6 +448,7 @@ Page({ | |||
| }, | |||
| setIntervalTime(end_time) { | |||
| let that = this; | |||
| var EndTime = end_time; | |||
| var NowTime = new Date().getTime(); | |||
| @@ -470,12 +472,17 @@ Page({ | |||
| 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; | |||
| }, | |||
| countdown: function(end_time) { | |||
| countdown: function(end_time) { | |||
| let that = this; | |||
| that.setIntervalTime(end_time); | |||
| 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) { | |||
| let that = this; | |||
| let data={}; | |||
| that.getCouponMerchant(couponChannelId);//获取适用门店 | |||
| that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存 | |||
| if (that.data.couponIds){ | |||
| data.couponId = couponChannelId | |||
| }else{ | |||
| @@ -584,18 +637,6 @@ Page({ | |||
| }; | |||
| Http.get(parmer) | |||
| .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 | |||
| if (res.data.contentType != undefined && res.data.contentType == 1) { | |||
| //获取图文展示详情html | |||
| @@ -665,6 +706,7 @@ Page({ | |||
| that.countdown(res.data.endTime); | |||
| } else { | |||
| clearInterval(that.data.setInterval) | |||
| that.countdown(res.data.endTime); | |||
| } | |||
| if (res.data.activityStatus == 0) { | |||
| var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); | |||
| @@ -693,7 +735,6 @@ Page({ | |||
| wx.hideLoading(); | |||
| that.setData({ | |||
| data: res.data, | |||
| merchantVoList: res.data.merchantVoList | |||
| }); | |||
| if(res.data.type == 10){ | |||
| that.setData({ | |||
| @@ -66,22 +66,22 @@ | |||
| <view class='salePriceStr clearfix' wx:if="{{data.type!=10}}"> | |||
| <text class='rmb'>¥</text> | |||
| <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> | |||
| </view> | |||
| <!-- <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='time refound'><text class="use">过期不退款</text></text> | |||
| </text> | |||
| </view> | |||
| <view class="fl" wx:if="{{data.type==8}}"> | |||
| <!-- <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='throgh'>{{data.priceStr}}元</text> | |||
| <text class='throgh'>{{priceAndStockObj.price/100}}元</text> | |||
| <text class='rest' wx:if="{{data.autoRefund == 1}}"> | |||
| <text class='time refound'><text class="use">过期不退款</text></text> | |||
| </text> | |||
| @@ -112,7 +112,7 @@ | |||
| <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&&!maxLimit}}'>(大于{{minLimit}}成长值)</text> | |||
| <text class="restNum fr">剩余<text>{{data.remainInventory}}张</text></text> | |||
| <text class="restNum fr">剩余<text>{{priceAndStockObj.remainInventory}}张</text></text> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -154,19 +154,19 @@ | |||
| <image src='{{homeSelectedO}}' mode="widthFix"></image> | |||
| <text class='btnTxt'>首页</text> | |||
| </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">配送到家 | |||
| </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">到店自提 | |||
| </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="{{total_micro_second<=0&&data.activityStatus!=0}}">活动已结束</button> | |||
| <button id='noBuy' disabled='true' wx:if="{{data.activityStatus==0}}">活动未开始</button> | |||
| @@ -174,14 +174,14 @@ | |||
| </form> | |||
| </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'> | |||
| <image src='{{homeSelectedO}}' mode="widthFix"></image> | |||
| <text class='btnTxt'>首页</text> | |||
| </button> | |||
| <form bindsubmit="gotopay" report-submit='true' class="fl"> | |||
| <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> | |||
| </button> | |||
| </form> | |||
| @@ -8,6 +8,7 @@ const QR = require("../../../utils/memberqrcode.js"); | |||
| //券详情页面 | |||
| Page({ | |||
| data: { | |||
| showIdFalg: false, | |||
| navigationBarHeight, | |||
| code: "", | |||
| topLine: imgurl.topLine.url, | |||
| @@ -107,30 +108,33 @@ Page({ | |||
| dynamicRq: res.data.dynamicId, | |||
| expiredSeconds: res.data.expiredSeconds | |||
| }) | |||
| let url = JSON.stringify({ | |||
| END: "C", | |||
| TYPE: "couponorder", | |||
| 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); | |||
| _this.createQrCode(url, "qrcode", 350, 350); | |||
| }).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) { | |||
| let that = this; | |||
| that.setData({ | |||
| code: options.quancode, | |||
| codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14), | |||
| couponorderstatus: options.couponorderstatus | |||
| }); | |||
| @@ -57,8 +57,10 @@ | |||
| 后失效 | |||
| </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> | |||
| <!-- 适用门店 --> | |||
| @@ -62,29 +62,36 @@ page { | |||
| 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 { | |||
| width: 510rpx; | |||
| height: 100rpx; | |||
| @@ -16,43 +16,90 @@ Page({ | |||
| navigationBarHeight, | |||
| url: config.url, | |||
| 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, | |||
| 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({ | |||
| 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({ | |||
| /** | |||
| * 页面的初始数据 | |||
| */ | |||
| */ | |||
| data: { | |||
| showIdFalg: false, | |||
| showFlag: false, | |||
| navigationBarHeight, | |||
| succUrl: imgurl.succ.url, | |||
| @@ -34,6 +35,28 @@ Page({ | |||
| contentType: 0, | |||
| 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) { | |||
| let code = e.currentTarget.dataset.text | |||
| wx.setClipboardData({ | |||
| @@ -115,7 +138,8 @@ Page({ | |||
| that.getStaticGame() | |||
| var createDate = util.formatTime(res.data.orders[0].createDate, "yyyy-MM-dd hh:mm:ss"); | |||
| 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({ | |||
| order: tempData, | |||
| showPage: true, | |||
| @@ -132,7 +156,7 @@ Page({ | |||
| wx.hideLoading(); | |||
| wx.showModal({ | |||
| title: '提示', | |||
| content: error.errMsg, | |||
| content: error.message ? error.message:error.data, | |||
| showCancel: false | |||
| }) | |||
| }) | |||
| @@ -47,7 +47,8 @@ | |||
| data-validstatus="{{order.validStatus}}" bindtap="powerDrawer" class='dhCode'> | |||
| <view style="width:86%;clear: both;"> | |||
| <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> | |||
| <image class="spcode" src="{{spcodeUrl}}" mode='widthFix'></image> | |||
| @@ -13,7 +13,12 @@ page { | |||
| width: 100%; | |||
| padding-bottom: 160rpx; | |||
| } | |||
| .barnumImg{ | |||
| float: left; | |||
| height: 40rpx; | |||
| width: 40rpx; | |||
| margin: 24rpx 20rpx; | |||
| } | |||
| .success { | |||
| vertical-align: middle; | |||
| width: 40rpx; | |||
| @@ -7,6 +7,7 @@ const imgurl = require("../../utils/imgurl"); | |||
| const QR = require("../../utils/memberqrcode.js"); | |||
| Page({ | |||
| data: { | |||
| showIdFalg: false, | |||
| navigationBarHeight, | |||
| btomLineUrl: imgurl.btomLine.url, | |||
| topLineUrl: imgurl.topLine.url, | |||
| @@ -29,6 +30,28 @@ Page({ | |||
| expiredSeconds: 0, | |||
| 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 () { | |||
| let that = this; | |||
| wx.navigateTo({ | |||
| @@ -79,30 +102,34 @@ Page({ | |||
| dynamicRq: res.data.dynamicId, | |||
| expiredSeconds: res.data.expiredSeconds | |||
| }) | |||
| let url = JSON.stringify({ | |||
| END: "C", | |||
| TYPE: "couponorder", | |||
| 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); | |||
| _this.createQrCode(url, "qrcode", 350, 350); | |||
| }).catch(err => { | |||
| @@ -112,7 +139,7 @@ Page({ | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| }) | |||
| }, | |||
| onLoad: function (options) { //quancode | |||
| @@ -123,6 +150,7 @@ Page({ | |||
| // that.createQrCode(value, "qrcode", 350, 350); | |||
| that.setData({ | |||
| code: options.quancode, | |||
| codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14), | |||
| title: options.title, | |||
| subtitle: options.subtitle, | |||
| remark: options.remark, | |||
| @@ -32,7 +32,10 @@ | |||
| <text style="color:red">{{expiredSeconds}}s</text> | |||
| 后失效 | |||
| </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> | |||
| <image class='line' src='{{btomLineUrl}}' mode="widthFix"></image> | |||
| @@ -77,23 +77,36 @@ page { | |||
| 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 { | |||
| @@ -108,7 +108,7 @@ Page({ | |||
| }).then(res=>{ | |||
| wx.hideLoading() | |||
| wx.navigateTo({ | |||
| url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`, | |||
| url: `/pages/radetail/joinActivity/edit?activityId=${activityId}&phone=${res.data.phone}`, | |||
| }) | |||
| }).catch(err=>{ | |||
| wx.hideLoading() | |||
| @@ -80,6 +80,7 @@ Page({ | |||
| console.log(value) | |||
| }, | |||
| formSubmit: function(e) { | |||
| app.globalData.previewFlag = true | |||
| let that = this; | |||
| /** | |||
| @@ -115,8 +116,10 @@ Page({ | |||
| delete e.detail.value.username; | |||
| let obj = e.detail.value; | |||
| 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]){ | |||
| wx.showToast({ | |||
| title: '问卷调查回答不完整,请补充', | |||
| @@ -130,9 +133,30 @@ Page({ | |||
| that.setData({ | |||
| 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({ | |||
| answer:valArr22 | |||
| }); | |||
| @@ -145,8 +169,10 @@ Page({ | |||
| }) | |||
| } | |||
| else { | |||
| if (this.data.answerflag == 'noanswer'){ | |||
| }else{ | |||
| that.setData({ | |||
| disabled: true | |||
| }) | |||
| @@ -158,7 +184,14 @@ Page({ | |||
| birthday: birthday, | |||
| answer: JSON.stringify(that.data.answer), | |||
| activityId: that.data.activityId | |||
| }; | |||
| }; | |||
| if (obj.number) { | |||
| data.number = obj.number | |||
| } | |||
| if (obj.age) { | |||
| data.age = obj.age | |||
| } | |||
| if (that.data.receiptUrl){ | |||
| data.imgUrl = "[" + '"' + that.data.receiptUrl + '"' + "]"; | |||
| } | |||
| @@ -203,7 +236,8 @@ Page({ | |||
| that.getLocation(); | |||
| if (options && options.activityId) { | |||
| that.setData({ | |||
| activityId: options.activityId | |||
| activityId: options.activityId, | |||
| phone: options.phone | |||
| }) | |||
| that.getDetail(options.activityId); | |||
| } | |||
| @@ -266,7 +300,7 @@ Page({ | |||
| id: activityId | |||
| } | |||
| }).then(res => { | |||
| if (res && res.data && res.data.activity) { | |||
| if (res && res.data && res.data.activity) { | |||
| this.setData({ | |||
| useImg: res.data.activity.useImg, | |||
| imgDetail: res.data.activity.imgDetail, | |||
| @@ -292,33 +326,33 @@ 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 => { | |||
| 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 > | |||
| <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='请填写名字' /> | |||
| </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}}"> | |||
| <text>生日</text> | |||
| <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> | |||
| <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"> | |||
| <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 wx:if="{{useImg==1}}"> | |||
| @@ -1,5 +1,5 @@ | |||
| input { | |||
| width:600rpx; | |||
| width:500rpx; | |||
| display: inline-block; | |||
| font-size: 32rpx; | |||
| vertical-align: middle; | |||
| @@ -16,6 +16,8 @@ input { | |||
| width: 710rpx; | |||
| margin: 0 auto; | |||
| border-bottom: 1px solid #eee; | |||
| background-color: #fff; | |||
| } | |||
| .camera{ | |||
| width: 400rpx; | |||
| @@ -35,6 +37,7 @@ input { | |||
| margin: 0 auto; | |||
| border-bottom: 1px solid #eee; | |||
| padding-bottom: 10rpx; | |||
| background-color: #fff; | |||
| } | |||
| .radio{ | |||
| margin-right: 30rpx; | |||
| @@ -57,11 +60,13 @@ radio { | |||
| font-size: 32rpx; | |||
| display: inline-block; | |||
| margin-right: 20rpx; | |||
| margin-left: 20rpx | |||
| } | |||
| .address > text:nth-of-type(1) { | |||
| font-size: 32rpx; | |||
| display: inline-block; | |||
| margin-right: 20rpx; | |||
| margin-left: 20rpx | |||
| } | |||
| .btn{ | |||
| position: fixed; | |||
| @@ -87,17 +92,19 @@ radio { | |||
| } | |||
| .input{ | |||
| position: absolute; | |||
| left: 84rpx; | |||
| left: 110rpx; | |||
| z-index: 1000; | |||
| top: 0; | |||
| bottom: 0; | |||
| margin: auto; | |||
| background: #fff; | |||
| } | |||
| .names{ | |||
| font-size: 26rpx; | |||
| line-height: 46rpx; | |||
| color: #999; | |||
| margin-left: 20rpx | |||
| } | |||
| .ques{ | |||
| padding-left: 20rpx; | |||
| @@ -108,8 +115,8 @@ radio { | |||
| text-align: left; | |||
| } | |||
| .questionTitle{ | |||
| width: 180rpx; | |||
| font-size: 40rpx; | |||
| width: 260rpx; | |||
| font-size: 36rpx; | |||
| border-top:6rpx solid orange; | |||
| border-bottom:6rpx solid orange; | |||
| margin: 40rpx auto 30rpx; | |||
| @@ -120,13 +127,26 @@ radio { | |||
| } | |||
| .answer{ | |||
| margin-bottom: 20rpx; | |||
| background-color: #fff; | |||
| overflow: hidden; | |||
| } | |||
| .answerText{ | |||
| margin-left: 20rpx; | |||
| } | |||
| /* .answerTextarea{ | |||
| margin-left: 20rpx; | |||
| } */ | |||
| .answer textarea{ | |||
| border: 1rpx solid #efefef; | |||
| border-radius: 10rpx; | |||
| padding: 10rpx 0; | |||
| margin-top: 10rpx; | |||
| padding-left: 10rpx; | |||
| height: 100rpx; | |||
| margin-left: 20rpx; | |||
| padding-bottom: 10rpx; | |||
| margin-bottom: 10rpx; | |||
| } | |||
| .quesTitle{ | |||
| 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() { | |||
| // wx.removeStorageSync('squareList') | |||
| @@ -786,7 +786,7 @@ Page({ | |||
| that.getType() | |||
| // that.uesrInfo() | |||
| that.getLocation(); | |||
| // that.getLocation(); | |||
| that.getMallInfo(app.globalData.token); | |||
| if (app.couponChannelListCallback) { | |||
| @@ -850,7 +850,7 @@ Page({ | |||
| } | |||
| that.getType() | |||
| // that.uesrInfo() | |||
| that.getLocation(); | |||
| // that.getLocation(); | |||
| that.getMallInfo(app.globalData.token); | |||
| if (app.couponChannelListCallback) { | |||
| @@ -80,10 +80,10 @@ | |||
| "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 | |||
| }, | |||
| { | |||
| @@ -100,6 +100,13 @@ | |||
| "query": "", | |||
| "scene": 1036, | |||
| "referrerInfo": {} | |||
| }, | |||
| { | |||
| "id": 6, | |||
| "name": "pages/freeBannerDetail/index", | |||
| "pathName": "pages/freeBannerDetail/index", | |||
| "query": "id= 690072721969307648", | |||
| "scene": null | |||
| } | |||
| ] | |||
| } | |||