diff --git a/assets/images/password.png b/assets/images/password.png
new file mode 100644
index 0000000..4417051
Binary files /dev/null and b/assets/images/password.png differ
diff --git a/components/banner/index.js b/components/banner/index.js
index dfde683..869ed92 100644
--- a/components/banner/index.js
+++ b/components/banner/index.js
@@ -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
})
}
},
-});
+});
\ No newline at end of file
diff --git a/config/config.js b/config/config.js
index 56fad9c..c4d7bb6 100755
--- a/config/config.js
+++ b/config/config.js
@@ -62,6 +62,21 @@ var config = {
* 商户优惠信息
*/
listByMerchant: "/wxCouponChannel/listByMerchant",
+
+ /**
+ * 获取券价格与库存
+ */
+ couponPriceAndStock: "/wxCoupon/couponPriceAndStock",
+ /**
+ * 获取券适用门店List
+ */
+ couponMerchant: "/wxCoupon/couponMerchant",
+
+ /**
+ * 获取券详情
+ */
+ newCouponDetail: '/wxCoupon/couponDetail',
+
/**
* 优惠券详情
*/
diff --git a/ext.json b/ext.json
index 40b0286..34dfe10 100644
--- a/ext.json
+++ b/ext.json
@@ -96,5 +96,9 @@
"networkTimeout": {
"request": 30000,
"downloadFile": 10000
- }
+ },
+ "requiredPrivateInfos": [
+ "chooseLocation",
+ "getLocation"
+ ]
}
\ No newline at end of file
diff --git a/index/index.js b/index/index.js
index 57a5fa2..a8f5460 100644
--- a/index/index.js
+++ b/index/index.js
@@ -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) {
diff --git a/index/user.js b/index/user.js
index f3233cb..6cd03d8 100644
--- a/index/user.js
+++ b/index/user.js
@@ -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
*/
diff --git a/pages/bannerdetail/index.js b/pages/bannerdetail/index.js
index 1d17638..8b2c794 100644
--- a/pages/bannerdetail/index.js
+++ b/pages/bannerdetail/index.js
@@ -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;
+ },
});
diff --git a/pages/canvas/index.js b/pages/canvas/index.js
index 2790175..88582c2 100644
--- a/pages/canvas/index.js
+++ b/pages/canvas/index.js
@@ -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) {
diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js
index 6fa2d3a..589c449 100644
--- a/pages/coupon/detail/index.js
+++ b/pages/coupon/detail/index.js
@@ -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({
diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml
index 53ab123..880646e 100644
--- a/pages/coupon/detail/index.wxml
+++ b/pages/coupon/detail/index.wxml
@@ -66,22 +66,22 @@
¥
- {{data.salePriceStr}}
- {{data.creditPrice}}
+ {{priceAndStockObj.salePrice/100}}
+ {{priceAndStockObj.creditPrice}}
积分
- {{data.priceStr}}元
- {{data.priceStr}}小时
+ {{priceAndStockObj.price/100}}元
+ {{priceAndStockObj.price/100}}小时
过期不退款
- {{data.salePriceStr}}
+ {{priceAndStockObj.salePrice/100}}
{{data.pressLimitNum+'人可砍至底价'}}
- {{data.priceStr}}元
+ {{priceAndStockObj.price/100}}元
过期不退款
@@ -112,7 +112,7 @@
(仅限新用户活动)
({{minLimit}}-{{maxLimit}}成长值)
(大于{{minLimit}}成长值)
- 剩余{{data.remainInventory}}张
+ 剩余{{priceAndStockObj.remainInventory}}张
@@ -154,19 +154,19 @@
首页
-
-
+
-
-
+
-
-
-
+
+
+
@@ -174,14 +174,14 @@
-
+
diff --git a/pages/couponorder/detail/index.js b/pages/couponorder/detail/index.js
index 5324120..c98763d 100644
--- a/pages/couponorder/detail/index.js
+++ b/pages/couponorder/detail/index.js
@@ -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
});
diff --git a/pages/couponorder/detail/index.wxml b/pages/couponorder/detail/index.wxml
index c3d3504..29b92da 100644
--- a/pages/couponorder/detail/index.wxml
+++ b/pages/couponorder/detail/index.wxml
@@ -57,8 +57,10 @@
后失效
-
- 优惠券码:{{code}}
+
+ {{showIdFalg?code:codeS}}
+
+
diff --git a/pages/couponorder/detail/index.wxss b/pages/couponorder/detail/index.wxss
index 01b12d1..1401522 100644
--- a/pages/couponorder/detail/index.wxss
+++ b/pages/couponorder/detail/index.wxss
@@ -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;
diff --git a/pages/freeBannerDetail/index.js b/pages/freeBannerDetail/index.js
index 255ab5c..4fe9a8d 100644
--- a/pages/freeBannerDetail/index.js
+++ b/pages/freeBannerDetail/index.js
@@ -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;
+ },
})
\ No newline at end of file
diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js
index 0dca7f4..3bda81e 100644
--- a/pages/order/detail/index.js
+++ b/pages/order/detail/index.js
@@ -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
})
})
diff --git a/pages/order/detail/index.wxml b/pages/order/detail/index.wxml
index 0f98db8..6a2b43d 100644
--- a/pages/order/detail/index.wxml
+++ b/pages/order/detail/index.wxml
@@ -47,7 +47,8 @@
data-validstatus="{{order.validStatus}}" bindtap="powerDrawer" class='dhCode'>
兑换码:
- {{order.couponOrderId}}
+ {{showIdFalg?order.couponOrderId:order.couponOrderIdS}}
+
diff --git a/pages/order/detail/index.wxss b/pages/order/detail/index.wxss
index 2f63945..238998b 100644
--- a/pages/order/detail/index.wxss
+++ b/pages/order/detail/index.wxss
@@ -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;
diff --git a/pages/orderquanma/index.js b/pages/orderquanma/index.js
index f4e9324..e9a1f4b 100644
--- a/pages/orderquanma/index.js
+++ b/pages/orderquanma/index.js
@@ -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,
diff --git a/pages/orderquanma/index.wxml b/pages/orderquanma/index.wxml
index 66774fd..1080293 100644
--- a/pages/orderquanma/index.wxml
+++ b/pages/orderquanma/index.wxml
@@ -32,7 +32,10 @@
{{expiredSeconds}}s
后失效
- 兑换码:{{code}}
+
+ {{showIdFalg?code:codeS}}
+
+
diff --git a/pages/orderquanma/index.wxss b/pages/orderquanma/index.wxss
index 824a331..4c88ba2 100644
--- a/pages/orderquanma/index.wxss
+++ b/pages/orderquanma/index.wxss
@@ -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 {
diff --git a/pages/radetail/index.js b/pages/radetail/index.js
index f9b54eb..4167550 100644
--- a/pages/radetail/index.js
+++ b/pages/radetail/index.js
@@ -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()
diff --git a/pages/radetail/joinActivity/edit.js b/pages/radetail/joinActivity/edit.js
index f3c55e6..fa505c0 100644
--- a/pages/radetail/joinActivity/edit.js
+++ b/pages/radetail/joinActivity/edit.js
@@ -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){
+ // }
+ // }
+ // })
+ // }
+ // })
},
})
\ No newline at end of file
diff --git a/pages/radetail/joinActivity/edit.wxml b/pages/radetail/joinActivity/edit.wxml
index 3722943..ae60c7d 100644
--- a/pages/radetail/joinActivity/edit.wxml
+++ b/pages/radetail/joinActivity/edit.wxml
@@ -1,4 +1,4 @@
-
+
+
+
+ 手机号
+
+
+
+
+
+ 人数
+
+
+
+
+
+ 年龄
+
+
+
+
生日
@@ -29,10 +48,10 @@
请选择地址
- 调查问卷
+
- {{item.ques}}
-
+ {{item.ques}}
+
diff --git a/pages/radetail/joinActivity/edit.wxss b/pages/radetail/joinActivity/edit.wxss
index 8bc68b1..2cd5865 100644
--- a/pages/radetail/joinActivity/edit.wxss
+++ b/pages/radetail/joinActivity/edit.wxss
@@ -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;
diff --git a/pages/theme/index1/index.js b/pages/theme/index1/index.js
index d915137..5b9b6be 100644
--- a/pages/theme/index1/index.js
+++ b/pages/theme/index1/index.js
@@ -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) {
diff --git a/project.config.json b/project.config.json
index 4945293..61c3692 100644
--- a/project.config.json
+++ b/project.config.json
@@ -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
}
]
}