Ver a proveniência

停车场修改

packages
HolyKnightIX há 2 anos
ascendente
cometimento
be44c6bc79
11 ficheiros alterados com 400 adições e 396 eliminações
  1. +49
    -47
      app.js
  2. +13
    -10
      ext.json
  3. +152
    -152
      index/passCar.js
  4. +20
    -19
      index/passCar.wxml
  5. +2
    -4
      pages/coupon/childDetail/childDetail.js
  6. +146
    -148
      pages/coupon/detail/index.js
  7. +1
    -1
      pages/coupon/detail/index.json
  8. +6
    -4
      pages/coupon/detail/index.wxss
  9. +9
    -9
      pages/freeBannerDetail/index.js
  10. +1
    -1
      project.config.json
  11. +1
    -1
      project.private.config.json

+ 49
- 47
app.js Ver ficheiro

@@ -1,5 +1,5 @@
let config = require("./config/config.js"); let config = require("./config/config.js");
const { defaultObj,huanLeChengObj } = require("./utils/mouldStyle.js")
const { defaultObj, huanLeChengObj } = require("./utils/mouldStyle.js")
const Http = require("./utils/HttpBasics"); const Http = require("./utils/HttpBasics");
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}


@@ -11,7 +11,7 @@ App({
businessSwitch: businessSwitch, //判断是否开启商圈自助积分 businessSwitch: businessSwitch, //判断是否开启商圈自助积分
}, },


onLaunch: function(options) {
onLaunch: function (options) {
// wx.hideTabBar() // wx.hideTabBar()
var that = this; var that = this;
if (that.globalData.previewFlag) { //解决微信图片预览重复进入app.js onshow if (that.globalData.previewFlag) { //解决微信图片预览重复进入app.js onshow
@@ -38,10 +38,10 @@ App({


}, },


onShow: function(options) {
onShow: function (options) {
//自助积分 需要openId 且必须写在onshow里面 //自助积分 需要openId 且必须写在onshow里面
let _this = this let _this = this
if (businessSwitch && wx.getStorageSync('openId')){
if (businessSwitch && wx.getStorageSync('openId')) {
myPluginInterface.getLocation(wx.getStorageSync('openId')).then(res => { console.log("商圈位置授权onS") }) myPluginInterface.getLocation(wx.getStorageSync('openId')).then(res => { console.log("商圈位置授权onS") })
} }
// if (businessSwitch) { // if (businessSwitch) {
@@ -78,11 +78,11 @@ App({
/** /**
* 用户登录 * 用户登录
*/ */
userLogin: function(sceneAddress) {
userLogin: function (sceneAddress) {
let that = this; let that = this;
// 登录 // 登录
wx.login({ wx.login({
success: ({
success: ({
code code
}) => { }) => {
let usrdata = { let usrdata = {
@@ -96,34 +96,34 @@ App({
usrdata.MId = that.globalData.newArr[2] usrdata.MId = that.globalData.newArr[2]
} }
Http.post({ Http.post({
url: config.api.login,
data: usrdata
})
url: config.api.login,
data: usrdata
})
.then(res => { .then(res => {
if (res.data.mall){
if (res.data.mall) {
that.globalData.marketName = res.data.mall.name ? res.data.mall.name : "" that.globalData.marketName = res.data.mall.name ? res.data.mall.name : ""
} }
wx.setStorageSync('openId', res.data.openId) wx.setStorageSync('openId', res.data.openId)
if (businessSwitch && res.data.openId) { if (businessSwitch && res.data.openId) {
myPluginInterface.getLocation(res.data.openId).then(res => { console.log("商圈位置授权onL") }).catch(err=>{
console.log(err,"商圈位置授权onL err")
myPluginInterface.getLocation(res.data.openId).then(res => { console.log("商圈位置授权onL") }).catch(err => {
console.log(err, "商圈位置授权onL err")
}) })
} }
if (res.data&&res.data.mouldType==0){//原风格尺寸
this.globalData.goHomeUrl="/index/index"
if (res.data && res.data.mouldType == 0) {//原风格尺寸
this.globalData.goHomeUrl = "/index/index"
this.globalData.mouldConfig = defaultObj this.globalData.mouldConfig = defaultObj
} else if (res.data&&res.data.mouldType == 1){
} else if (res.data && res.data.mouldType == 1) {
this.globalData.goHomeUrl = "/pages/theme/index1/index" this.globalData.goHomeUrl = "/pages/theme/index1/index"
this.globalData.mouldConfig = huanLeChengObj this.globalData.mouldConfig = huanLeChengObj
} }
that.globalData.mouldType = res.data.mouldType ? res.data.mouldType:0
that.globalData.mouldType = res.data.mouldType ? res.data.mouldType : 0
if (res.data.subMalls) { if (res.data.subMalls) {
const squareList = JSON.parse(res.data.subMalls) const squareList = JSON.parse(res.data.subMalls)
wx.setStorageSync("squareList", squareList) wx.setStorageSync("squareList", squareList)
if (res.data.mall){
if (res.data.mall) {
wx.setStorageSync("selectedMall", res.data.mall.tenantId) wx.setStorageSync("selectedMall", res.data.mall.tenantId)
} }
} }
if (res.data && res.data.score) { if (res.data && res.data.score) {
if (res.data.score != 0) { if (res.data.score != 0) {
@@ -132,9 +132,9 @@ App({
} }
Http.setToken(res.data.token); Http.setToken(res.data.token);
that.globalData.token = res.data.token; that.globalData.token = res.data.token;
console.log(that.tokenCallback,"that.tokenCallback")
console.log(that.tokenCallback, "that.tokenCallback")



if (that.tokenCallback) { if (that.tokenCallback) {
that.tokenCallback(res.data.token); that.tokenCallback(res.data.token);
} }
@@ -145,7 +145,7 @@ App({
title: '提示', title: '提示',
showCancel: false, showCancel: false,
content: '登录失败,请重新尝试', content: '登录失败,请重新尝试',
success: function(res) {
success: function (res) {
if (res.cancel) { if (res.cancel) {
//点击取消,默认隐藏弹框 //点击取消,默认隐藏弹框
} else { } else {
@@ -160,19 +160,19 @@ App({
} }
}) })
}, },
autoUpdate: function() {
autoUpdate: function () {
let that = this; let that = this;
if (wx.canIUse('getUpdateManager')) { if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager() const updateManager = wx.getUpdateManager()
// 1. 检查小程序是否有新版本发布 // 1. 检查小程序是否有新版本发布
updateManager.onCheckForUpdate(function(res) {
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调 // 请求完新版本信息的回调
if (res.hasUpdate) { if (res.hasUpdate) {
// 检测到新版本,需要更新,给出提示 // 检测到新版本,需要更新,给出提示
wx.showModal({ wx.showModal({
title: '更新提示', title: '更新提示',
content: '检测到新版本,是否下载新版本并重启小程序?', content: '检测到新版本,是否下载新版本并重启小程序?',
success: function(res) {
success: function (res) {
if (res.confirm) { if (res.confirm) {
//2. 用户确定下载更新小程序,小程序下载及更新静默进行 //2. 用户确定下载更新小程序,小程序下载及更新静默进行
that.downLoadAndUpdate(updateManager) that.downLoadAndUpdate(updateManager)
@@ -183,7 +183,7 @@ App({
content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~', content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
showCancel: false, //隐藏取消按钮 showCancel: false, //隐藏取消按钮
confirmText: "确定更新", //只保留确定更新按钮 confirmText: "确定更新", //只保留确定更新按钮
success: function(res) {
success: function (res) {
if (res.confirm) { if (res.confirm) {
//下载新版本,并重新应用 //下载新版本,并重新应用
that.downLoadAndUpdate(updateManager) that.downLoadAndUpdate(updateManager)
@@ -207,16 +207,16 @@ App({
/** /**
* 下载小程序新版本并重启应用 * 下载小程序新版本并重启应用
*/ */
downLoadAndUpdate: function(updateManager) {
downLoadAndUpdate: function (updateManager) {
let that = this let that = this
wx.showLoading(); wx.showLoading();
//静默下载更新小程序新版本 //静默下载更新小程序新版本
updateManager.onUpdateReady(function() {
updateManager.onUpdateReady(function () {
wx.hideLoading() wx.hideLoading()
//新的版本已经下载好,调用 applyUpdate 应用新版本并重启 //新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate() updateManager.applyUpdate()
}) })
updateManager.onUpdateFailed(function() {
updateManager.onUpdateFailed(function () {
// 新的版本下载失败 // 新的版本下载失败
wx.showModal({ wx.showModal({
title: '已经有新版本了哟~', title: '已经有新版本了哟~',
@@ -225,11 +225,11 @@ App({
}) })
}, },
globalData: { globalData: {
userName:"",//用户名
userAvatarUrl:"",//用户头像地址
goHomeUrl:'/index/index',
mouldConfig:{},//模板尺寸
mouldType:0,//主题风格模板
userName: "",//用户名
userAvatarUrl: "",//用户头像地址
goHomeUrl: '/index/index',
mouldConfig: {},//模板尺寸
mouldType: 0,//主题风格模板
styleLsit: {}, styleLsit: {},
previewFlag: false, //解决图片预览调用noshow previewFlag: false, //解决图片预览调用noshow
activityId: '', //活动id方便授权数据回传 activityId: '', //活动id方便授权数据回传
@@ -252,19 +252,19 @@ App({
// ETCP token // ETCP token
etcpToken: null, etcpToken: null,
carLogin: false, carLogin: false,
marketName:"",//商场,名称
marketName: "",//商场,名称
// 当前商场信息 // 当前商场信息
market: { market: {
name: "" name: ""
}, },
// websocket // websocket
socketClient: null, socketClient: null,
socketReceiver: function(e) {}, //收到消息回调
socketReceiver: function (e) { }, //收到消息回调
curHtml: '', //富文本相关,由于浏览器传参长度有限制 curHtml: '', //富文本相关,由于浏览器传参长度有限制
}, },


// 初始化websocket // 初始化websocket
initSocket: function() {
initSocket: function () {
let that = this; let that = this;
// socket是否连接 // socket是否连接
let socketConnected = false; let socketConnected = false;
@@ -313,7 +313,7 @@ App({
connect(); connect();


// 监听 WebSocket 连接打开事件 // 监听 WebSocket 连接打开事件
wx.onSocketOpen(function(res) {
wx.onSocketOpen(function (res) {
console.log("WebSocket 连接成功") console.log("WebSocket 连接成功")
socketConnected = true; socketConnected = true;
ws.onopen(); ws.onopen();
@@ -325,12 +325,12 @@ App({
}) })


// 监听 WebSocket 接受到服务器的消息事件 // 监听 WebSocket 接受到服务器的消息事件
wx.onSocketMessage(function(res) {
wx.onSocketMessage(function (res) {
ws.onmessage(res); ws.onmessage(res);
}) })


// 监听 WebSocket 错误事件 // 监听 WebSocket 错误事件
wx.onSocketError(function(res) {
wx.onSocketError(function (res) {
console.log("WebSocket 错误事件") console.log("WebSocket 错误事件")
if (!socketConnected) { if (!socketConnected) {
// 断线重连 // 断线重连
@@ -341,7 +341,7 @@ App({
}) })


// 监听 WebSocket 连接关闭事件 // 监听 WebSocket 连接关闭事件
wx.onSocketClose(function(res) {
wx.onSocketClose(function (res) {
console.log("WebSocket 连接关闭") console.log("WebSocket 连接关闭")
socketConnected = false; socketConnected = false;
// 断线重连 // 断线重连
@@ -357,11 +357,11 @@ App({
* The heart-beating is using window.setInterval() to regularly send heart-beats and/or check server heart-beats. * The heart-beating is using window.setInterval() to regularly send heart-beats and/or check server heart-beats.
* 可看stomp.js的源码(195,207,489行),由于小程序没有window对象,所以我们要调用小程序的定时器api实现 * 可看stomp.js的源码(195,207,489行),由于小程序没有window对象,所以我们要调用小程序的定时器api实现
*/ */
Stomp.setInterval = function(interval, f) {
Stomp.setInterval = function (interval, f) {
return setInterval(f, interval); return setInterval(f, interval);
}; };
// 结束定时器的循环调用 // 结束定时器的循环调用
Stomp.clearInterval = function(id) {
Stomp.clearInterval = function (id) {
return clearInterval(id); return clearInterval(id);
}; };


@@ -369,17 +369,17 @@ App({


that.globalData.socketClient = stompClient; that.globalData.socketClient = stompClient;


stompClient.connect({}, function(callback) {
stompClient.connect({}, function (callback) {


// 订阅自己的 // 订阅自己的
stompClient.subscribe('/user/' + config.weapp.AppId + '/' + that.globalData.openId + '/message', function(message, headers) {
stompClient.subscribe('/user/' + config.weapp.AppId + '/' + that.globalData.openId + '/message', function (message, headers) {
console.log('收到只发送给我的消息:', message); console.log('收到只发送给我的消息:', message);
that.globalData.socketReceiver(JSON.parse(message.body)); that.globalData.socketReceiver(JSON.parse(message.body));
// 通知服务端收到消息 // 通知服务端收到消息
message.ack(); message.ack();
}); });


stompClient.subscribe('/topic/' + config.weapp.AppId, function(message, headers) {
stompClient.subscribe('/topic/' + config.weapp.AppId, function (message, headers) {
console.log('收到TOPIC的消息:', message); console.log('收到TOPIC的消息:', message);
that.globalData.socketReceiver(JSON.parse(message.body)); that.globalData.socketReceiver(JSON.parse(message.body));
// 通知服务端收到消息 // 通知服务端收到消息
@@ -394,7 +394,9 @@ App({
}, },


//统一发送消息 //统一发送消息
sendSocketMessage: function(msg) {
sendSocketMessage: function (msg) {
this.globalData.socketClient.send("/app/message", {}, JSON.stringify(msg)); this.globalData.socketClient.send("/app/message", {}, JSON.stringify(msg));
} }
});
});
// wxfa336cad86ed598d 测试
// wx453ae0d37f3550d0 生产

+ 13
- 10
ext.json Ver ficheiro

@@ -1,7 +1,14 @@
{ {
"ext": { "ext": {
"attr": { "attr": {
"mchId": "1623869862",
"car": {
"etcp": {
"etcpAppId": "wx192b7d2e8dcbefd0",
"etcpVersion": "release",
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback"
}
},
"mchId": "1604439800",
"imgProxy": [ "imgProxy": [
{ {
"newUrl": "https://ctest.malls.iformall.com/img", "newUrl": "https://ctest.malls.iformall.com/img",
@@ -17,16 +24,12 @@
} }
], ],
"configUrl": "https://ctest.malls.iformall.com/C/api", "configUrl": "https://ctest.malls.iformall.com/C/api",
"etcpAppId": "wx219a81b9c87aa4f7",
"etcpVersion": "release",
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback",
"businessSwitch": "1", "businessSwitch": "1",
"businessVersion": "1",
"ifHaveWebSocket": "0", "ifHaveWebSocket": "0",
"ifHaveCarModular": "1" "ifHaveCarModular": "1"
}, },
"name": "富茂光谷测试版",
"weappId": "wx219a81b9c87aa4f7",
"name": "金泸商务",
"weappId": "wx649b3be73c1afe47",
"appVersion": "C.test.5.2.0" "appVersion": "C.test.5.2.0"
}, },
"debug": false, "debug": false,
@@ -74,15 +77,15 @@
}, },
"plugins": { "plugins": {
"auto-points-plugin": { "auto-points-plugin": {
"version": "2.4.0",
"version": "1.3.0",
"provider": "wxfab2bf944bfc4da6" "provider": "wxfab2bf944bfc4da6"
}, },
"live-player-plugin": { "live-player-plugin": {
"version": "1.2.5",
"version": "1.3.4",
"provider": "wx2b03c6e691cd7370" "provider": "wx2b03c6e691cd7370"
} }
}, },
"extAppid": "wx219a81b9c87aa4f7",
"extAppid": "wx649b3be73c1afe47",
"extEnable": true, "extEnable": true,
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {


+ 152
- 152
index/passCar.js Ver ficheiro

@@ -53,7 +53,7 @@ Page({
remark: '', remark: '',
generalPayPath: '', generalPayPath: '',
generalExtraData: {}, generalExtraData: {},
goHomeUrl:"",
goHomeUrl: "",
}, },
getMoreList(e) { getMoreList(e) {
let totalNum = this.data.ticketList.length; let totalNum = this.data.ticketList.length;
@@ -68,7 +68,7 @@ Page({
/** /**
* 选择使用的优惠券 * 选择使用的优惠券
*/ */
choicecoupon: function(e) {
choicecoupon: function (e) {
var that = this; var that = this;
wx.showModal({ wx.showModal({
title: '确定是否使用停车券', title: '确定是否使用停车券',
@@ -98,53 +98,53 @@ Page({
title: "加载中" title: "加载中"
}); });
Http.get({ Http.get({
url: config.api.couponOrderCarList,
data: {
pageNum: pageNum,
pageSize: 15,
couponOrderStatus: key
}
}).then(res => {
url: config.api.couponOrderCarList,
data: {
pageNum: pageNum,
pageSize: 15,
couponOrderStatus: key
}
}).then(res => {
that.setData({
curTotalpageNum: res.data.pages,
curPageNum: res.data.pageNum,
totalTicketNum: res.data.total
})
res.data.list.map(file => {
file.expiredTime = format.formatTime(
file.expiredTime,
"yyyy-MM-dd hh:mm:ss"
);
});
setTimeout(function () {
wx.hideLoading();
}, 1200);
if (pageNum >= res.data.pages) {
that.setData({ that.setData({
curTotalpageNum: res.data.pages,
curPageNum: res.data.pageNum,
totalTicketNum: res.data.total
})
res.data.list.map(file => {
file.expiredTime = format.formatTime(
file.expiredTime,
"yyyy-MM-dd hh:mm:ss"
);
allow_load: false
}); });
setTimeout(function() {
wx.hideLoading();
}, 1200);
if (pageNum >= res.data.pages) {
that.setData({
allow_load: false
});
}
/**
* 先赋值后渲染页面
* concat 不会改变原数组值
* push 会改变原数组值,但不会一条一条插入,而是整个数组插入
*/
if (pageNum == 1) {
that.setData({
ticketList: res.data.list,
curPageNum: pageNum
});
} else {
that.setData({
ticketList: that.data.ticketList.concat(res.data.list)
});
}
// that.data.ticketList = that.data.ticketList.concat(res.data.list);
}
/**
* 先赋值后渲染页面
* concat 不会改变原数组值
* push 会改变原数组值,但不会一条一条插入,而是整个数组插入
*/
if (pageNum == 1) {
that.setData({
ticketList: res.data.list,
curPageNum: pageNum
});
} else {
that.setData({
ticketList: that.data.ticketList.concat(res.data.list)
});
}
// that.data.ticketList = that.data.ticketList.concat(res.data.list);


wx.hideLoading();
})
wx.hideLoading();
})
.catch(err => { .catch(err => {
setTimeout(function() {
setTimeout(function () {
wx.hideLoading(); wx.hideLoading();
}, 1200); }, 1200);
wx.showToast({ wx.showToast({
@@ -154,21 +154,20 @@ Page({
mask: false mask: false
}); });
}) })
} else {}
} else { }
}, },
//点击跳转到券详情页面 //点击跳转到券详情页面
gotouse: function(e) {
gotouse: function (e) {
wx.navigateTo({ wx.navigateTo({
url: `/pages/passCar/couponDetail/couponDetail?quancode=${
e.currentTarget.dataset.quancode
url: `/pages/passCar/couponDetail/couponDetail?quancode=${e.currentTarget.dataset.quancode
}`, }`,
success: function(res) {
success: function (res) {
// success // success
}, },
fail: function() {
fail: function () {
// fail // fail
}, },
complete: function() {
complete: function () {
// complete // complete
} }
}); });
@@ -176,7 +175,7 @@ Page({
/** /**
* 车牌轮播滑动 * 车牌轮播滑动
*/ */
onSlideChangeEnd: function(e) {
onSlideChangeEnd: function (e) {
var that = this; var that = this;
/** /**
* 获得当前的车牌号码 * 获得当前的车牌号码
@@ -194,7 +193,7 @@ Page({
}, },


//停车费用为0 //停车费用为0
paySuccess: function() {
paySuccess: function () {
wx.showModal({ wx.showModal({
title: '支付成功', title: '支付成功',
content: '请15分钟内离场', content: '请15分钟内离场',
@@ -202,16 +201,16 @@ Page({
}) })
}, },


gotomange: function() {
gotomange: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/managelicenseplate/managelicenseplate', url: '/pages/managelicenseplate/managelicenseplate',
}) })
}, },
bindfail: function(res) {
bindfail: function (res) {
console.log(123) console.log(123)
console.log(res) console.log(res)
}, },
gotoCarMini: function(e) {
gotoCarMini: function (e) {
console.log(478) console.log(478)
var that = this var that = this
// etcp parkVendor1 // etcp parkVendor1
@@ -232,19 +231,19 @@ Page({
}) })
} }
}, },
showquan: function() {
showquan: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/passCar/couponList/couponList', url: '/pages/passCar/couponList/couponList',
}) })
}, },
gotodetail: function(e) {
gotodetail: function (e) {
wx.showModal({ wx.showModal({
title: '缴费规则', title: '缴费规则',
content: e.target.dataset.rule, content: e.target.dataset.rule,
showCancel: false, showCancel: false,
}) })
}, },
onShow: function(options) {
onShow: function (options) {
this.setData({ this.setData({
goHomeUrl: app.globalData.goHomeUrl goHomeUrl: app.globalData.goHomeUrl
}) })
@@ -262,6 +261,7 @@ Page({
payPath: extConfig.attr.car.etcp.payPath, payPath: extConfig.attr.car.etcp.payPath,
ifHaveCarModular: extConfig.attr.ifHaveCarModular ifHaveCarModular: extConfig.attr.ifHaveCarModular
}) })
console.log(this.data.ifHaveCarModular, 'ifHaveCarModular');
if (app.globalData.token) { if (app.globalData.token) {
that.getList(); that.getList();
that.init(); that.init();
@@ -305,11 +305,11 @@ Page({




}, },
cancelMove: function() {
cancelMove: function () {
console.log(111) console.log(111)
return false; return false;
}, },
onHide: function() {
onHide: function () {
this.setData({ this.setData({
allow_load: true, allow_load: true,
showTicketModal: false, showTicketModal: false,
@@ -317,8 +317,8 @@ Page({
ticketList: [] ticketList: []
}) })
}, },
onLoad: function(options) {
onLoad: function (options) {
var that = this; var that = this;
/** /**
* 获得分享小程序的 * 获得分享小程序的
@@ -326,11 +326,11 @@ Page({
* desc * desc
*/ */
Http.get({ Http.get({
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
}
})
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
}
})
.then(res => { .then(res => {
let weapNote = JSON.parse(res.data.weapNote); let weapNote = JSON.parse(res.data.weapNote);
that.setData({ that.setData({
@@ -346,7 +346,7 @@ Page({
that.setData({ that.setData({
scene: scene scene: scene
}); });
if (app.globalData.token) {} else {
if (app.globalData.token) { } else {
// app.getLocation(); // app.getLocation();
that.userLogin() that.userLogin()
} }
@@ -355,7 +355,7 @@ Page({
/** /**
* 用户登录 * 用户登录
*/ */
userLogin: function() {
userLogin: function () {
var that = this; var that = this;
// 登录 // 登录
wx.login({ wx.login({
@@ -363,7 +363,7 @@ Page({
code code
}) => { }) => {
wx.getSystemInfo({ wx.getSystemInfo({
success: function(res) {
success: function (res) {
that.setData({ that.setData({
systemInfo: JSON.stringify(res) systemInfo: JSON.stringify(res)
}) })
@@ -388,9 +388,9 @@ Page({
}; };
} }
Http.post({ Http.post({
url: config.api.login,
data: usrdata
})
url: config.api.login,
data: usrdata
})
.then(res => { .then(res => {
app.globalData.token = res.data.token; app.globalData.token = res.data.token;
Http.setToken(res.data.token); Http.setToken(res.data.token);
@@ -403,7 +403,7 @@ Page({
data: {} data: {}
}); });
}) })
.then(res => {})
.then(res => { })
.catch(err => { .catch(err => {
if (err.code == 11004) { if (err.code == 11004) {
// 用户昵称未授权 // 用户昵称未授权
@@ -424,33 +424,33 @@ Page({
/** /**
* 检查用户是否有车 * 检查用户是否有车
*/ */
checkUserCarStatus: function() {
checkUserCarStatus: function () {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.userCarCount,
data: {}
}).then(res => {
if (res.data > 0) {
// 用户名下有车
app.globalData.phone = res.data.phone;
app.globalData.supportCar = true;
// 共同登录
that.userCarLogin();
}
})
.catch(err => {})
url: config.api.userCarCount,
data: {}
}).then(res => {
if (res.data > 0) {
// 用户名下有车
app.globalData.phone = res.data.phone;
app.globalData.supportCar = true;
// 共同登录
that.userCarLogin();
}
})
.catch(err => { })
}, },
jumpToAdd: function() {
jumpToAdd: function () {
wx.navigateTo({ wx.navigateTo({
url: `/pages/addPark/addPark?flags=managepalte` url: `/pages/addPark/addPark?flags=managepalte`
}); });
}, },
passc: function() {
passc: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/ques/ques', url: '/pages/ques/ques',
}) })
}, },
goExplain: function() {
goExplain: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/tcExplain/tcExplain', url: '/pages/tcExplain/tcExplain',
}) })
@@ -460,7 +460,7 @@ Page({
/** /**
* 券绑定车牌 * 券绑定车牌
*/ */
bindCoupon: function(quanid, quantitle) {
bindCoupon: function (quanid, quantitle) {
wx.showLoading({ wx.showLoading({
title: '使用中...', title: '使用中...',
}) })
@@ -504,9 +504,9 @@ Page({
} }
} }
Http.post({ Http.post({
url: config.api.getCarCoupon,
data: postCouponData
})
url: config.api.getCarCoupon,
data: postCouponData
})
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
// if(res.data){ // if(res.data){
@@ -554,7 +554,7 @@ Page({
// } // }


// }, // },
closeTicketModal: function() {
closeTicketModal: function () {
this.setData({ this.setData({
showTicketModal: false showTicketModal: false
}) })
@@ -562,7 +562,7 @@ Page({
/** /**
* 停车券 弹框 * 停车券 弹框
*/ */
openTicketModal: function() {
openTicketModal: function () {
this.setData({ this.setData({
showTicketModal: true, showTicketModal: true,
allow_load: true, allow_load: true,
@@ -581,17 +581,17 @@ Page({
getList() { getList() {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0",
data: {
pageNum: 1,
pageSize: 15,
couponOrderStatus: 0
}
}).then(res => {
that.setData({
couponList: res.data.list
});
})
url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0",
data: {
pageNum: 1,
pageSize: 15,
couponOrderStatus: 0
}
}).then(res => {
that.setData({
couponList: res.data.list
});
})
.catch(err => { .catch(err => {
console.log(err) console.log(err)
}) })
@@ -601,7 +601,7 @@ Page({
/** /**
* 共同登录 * 共同登录
*/ */
init: function(carNumber) {
init: function (carNumber) {
var that = this; var that = this;
app.parkInitCallback = token => { app.parkInitCallback = token => {
that.initPark(); that.initPark();
@@ -616,9 +616,9 @@ Page({
* 判断是否授权手机号 * 判断是否授权手机号
*/ */
Http.get({ Http.get({
url: config.api.checkPhoneStatus,
data: {}
})
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => { .then(res => {
Http.post({ Http.post({
url: config.api.carInit, url: config.api.carInit,
@@ -685,7 +685,7 @@ Page({
} }
}, },


bindCar: function(carNum) {
bindCar: function (carNum) {
var that = this; var that = this;
// ETCP // ETCP
var etcpData = { var etcpData = {
@@ -697,9 +697,9 @@ Page({
}; };
var postData = app.globalData.parkVendor == 1 ? etcpData : otherData; var postData = app.globalData.parkVendor == 1 ? etcpData : otherData;
Http.post({ Http.post({
url: config.api.bindCar,
data: postData
})
url: config.api.bindCar,
data: postData
})
.then(res => { .then(res => {
that.setData({ that.setData({
addCar: null addCar: null
@@ -709,7 +709,7 @@ Page({
title: "提示", title: "提示",
showCancel: false, showCancel: false,
content: "绑车牌成功!", content: "绑车牌成功!",
success: function() {}
success: function () { }
}); });
}) })
.catch(error => { .catch(error => {
@@ -717,19 +717,19 @@ Page({
title: "提示", title: "提示",
showCancel: false, showCancel: false,
content: error.data.message, content: error.data.message,
success: function() {}
success: function () { }
}); });
}); });
}, },
/** /**
* 车场信息获取 * 车场信息获取
*/ */
initPark: function() {
initPark: function () {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.getParkInfo,
data: {}
})
url: config.api.getParkInfo,
data: {}
})
.then(res => { .then(res => {
that.setData({ that.setData({
park: res.data park: res.data
@@ -784,11 +784,11 @@ Page({
/** /**
* 车场状态获取 * 车场状态获取
*/ */
getParkStatus: function() {
getParkStatus: function () {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.getParkStatus,
})
url: config.api.getParkStatus,
})
.then(res => { .then(res => {
console.log(res) console.log(res)
}) })
@@ -805,30 +805,30 @@ Page({
/** /**
* 绑定车获取 * 绑定车获取
*/ */
initUsrCarList: function(flag) {
initUsrCarList: function (flag) {
var that = this; var that = this;
Http.get({ Http.get({
url: config.api.getUserCarList,
data: {}
}).then(res => {
url: config.api.getUserCarList,
data: {}
}).then(res => {
that.setData({
carList: res.data
});
/**
* flag ==flags
* 表示从首页onShow进来的
*/
if (flag == "flags" && res.data.length > 0) {
var listCardNum = res.data[0].carNumber;
that.setData({ that.setData({
carList: res.data
});
listCardNum: listCardNum
})
/** /**
* flag ==flags
* 表示从首页onShow进来的
* 获得停车费用
*/ */
if (flag == "flags" && res.data.length > 0) {
var listCardNum = res.data[0].carNumber;
that.setData({
listCardNum: listCardNum
})
/**
* 获得停车费用
*/
that.getStopFee(listCardNum);
}
})
that.getStopFee(listCardNum);
}
})
.catch(err => { .catch(err => {
wx.showToast({ wx.showToast({
title: err.message, title: err.message,
@@ -842,19 +842,19 @@ Page({
/** /**
* 获得停车费用修改 * 获得停车费用修改
*/ */
getStopFee: function(carNumber) {
getStopFee: function (carNumber) {
let that = this; let that = this;
let postData = let postData =
app.globalData.parkVendor == 1 ? { app.globalData.parkVendor == 1 ? {
etcpToken: app.globalData.etcpToken, etcpToken: app.globalData.etcpToken,
carNumber: carNumber carNumber: carNumber
} : { } : {
carNumber: carNumber
};
carNumber: carNumber
};
Http.post({ Http.post({
url: config.api.getCarStopFee,
data: postData
})
url: config.api.getCarStopFee,
data: postData
})
.then(res => { .then(res => {
console.log(res) console.log(res)
if (app.globalData.parkVendor == 1) { // ETCP if (app.globalData.parkVendor == 1) { // ETCP
@@ -955,7 +955,7 @@ Page({
/** /**
* 下拉刷新 * 下拉刷新
*/ */
onPullDownRefresh: function(e) {
onPullDownRefresh: function (e) {
let that = this; let that = this;
that.initUsrCarList("flags"); that.initUsrCarList("flags");
that.setData({ that.setData({


+ 20
- 19
index/passCar.wxml Ver ficheiro

@@ -1,10 +1,11 @@
<navbar text="停车"></navbar>
<navbar text="停车"></navbar>
<view style="height:{{navigationBarHeight}} "></view> <view style="height:{{navigationBarHeight}} "></view>
<view class='container' wx:if="{{ifHaveCarModular == 1}}" >
<view class='container' wx:if="{{ifHaveCarModular == 1}}">
<view class='top'> <view class='top'>
<view class='header'> <view class='header'>
<image src='{{parkUrl}}' mode="widthFix"></image>{{park.addr}} <image src='{{parkUrl}}' mode="widthFix"></image>{{park.addr}}
(<text style='color:#f86661;'>{{park.number}}</text>车位)</view>
(<text style='color:#f86661;'>{{park.number}}</text>车位)
</view>
</view> </view>
<view class='borderBox'> <view class='borderBox'>
<view class='passNumberBox'> <view class='passNumberBox'>
@@ -48,7 +49,7 @@
</view> </view>
<view class="clearfix" wx:if="{{remark}}"> <view class="clearfix" wx:if="{{remark}}">
<text class="fl">备注:</text> <text class="fl">备注:</text>
<text class='fr time' >{{remark}}</text>
<text class='fr time'>{{remark}}</text>
</view> </view>


<view class="clearfix" wx:if="{{stopFees.sysNotice!=''&&stopFees.sysNotice}}"> <view class="clearfix" wx:if="{{stopFees.sysNotice!=''&&stopFees.sysNotice}}">
@@ -63,14 +64,14 @@
<navigator bindfail="bindfail" path="{{payPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{etcpAppId}}" extra-data='{{extraData}}' version="{{carMiniVersion}}"> <navigator bindfail="bindfail" path="{{payPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{etcpAppId}}" extra-data='{{extraData}}' version="{{carMiniVersion}}">
立即支付 立即支付
</navigator> </navigator>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
</view> </view>
<!-- 停车费用大于0 tjd --> <!-- 停车费用大于0 tjd -->
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==2}}"> <view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==2}}">
<navigator bindfail="bindfail" path="{{payPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{tjdAppId}}" extra-data='{{extraData}}' version="{{carMiniVersion}}"> <navigator bindfail="bindfail" path="{{payPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{tjdAppId}}" extra-data='{{extraData}}' version="{{carMiniVersion}}">
立即支付 立即支付
</navigator> </navigator>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
</view> </view>
<!-- 停车费用大于0 bolink --> <!-- 停车费用大于0 bolink -->
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==5}}"> <view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor==5}}">
@@ -80,23 +81,23 @@
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor5" bindtap='gotoCarMini'>立即支付</view> <view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor5" bindtap='gotoCarMini'>立即支付</view>
</view> </view>
<!-- 通用停车 --> <!-- 通用停车 -->
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor!=1&&parkVendor!=2&&parkVendor!=3&&parkVendor!=4&&parkVendor!=5&&extraDataFlag!='{}'}}">
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor!=1&&parkVendor!=2&&parkVendor!=3&&parkVendor!=4&&parkVendor!=5&&extraDataFlag!='{}'}}">
<navigator bindfail="bindfail" path="{{generalPayPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{generalAppId}}" extra-data='{{generalExtraData}}' version="{{carMiniVersion}}"> <navigator bindfail="bindfail" path="{{generalPayPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{generalAppId}}" extra-data='{{generalExtraData}}' version="{{carMiniVersion}}">
立即支付 立即支付
</navigator> </navigator>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
</view> </view>




<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor!=1&&parkVendor!=2&&parkVendor!=3&&parkVendor!=4&&parkVendor!=5&&extraDataFlag=='{}'}}">
<navigator bindfail="bindfail" path="{{generalPayPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{generalAppId}}" version="{{carMiniVersion}}">
<view class="buy-view" wx:if="{{stopFees.orderId&&stopFees.remainingFee>0&&parkVendor!=1&&parkVendor!=2&&parkVendor!=3&&parkVendor!=4&&parkVendor!=5&&extraDataFlag=='{}'}}">
<navigator bindfail="bindfail" path="{{generalPayPath}}" wx:if="{{canIUse}}" class='buy' target="miniProgram" open-type="navigate" app-id="{{generalAppId}}" version="{{carMiniVersion}}">
立即支付 立即支付
</navigator> </navigator>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
<view wx:if="{{!canIUse}}" class='buy' data-flag="parkVendor1" bindtap='gotoCarMini'>立即支付</view>
</view> </view>


<!-- 停车费用为0 --> <!-- 停车费用为0 -->
<view wx:if="{{stopFees.remainingFee==0}}" class='buy' bindtap='paySuccess'>立即支付</view>
<view wx:if="{{stopFees.remainingFee==0}}" class='buy' bindtap='paySuccess'>立即支付</view>
</view> </view>


<!-- 没有车牌的时候显示 --> <!-- 没有车牌的时候显示 -->
@@ -150,7 +151,7 @@
</view> </view>
</view> </view>


<view class="con" wx:if="{{ifHaveCarModular == 0}}" >
<view class="con" wx:if="{{ifHaveCarModular == 0}}">
<image class="img" src="{{parkUrl}}" mode="widthFix"></image> <image class="img" src="{{parkUrl}}" mode="widthFix"></image>
<text class="txt1">智慧停车即将上线</text> <text class="txt1">智慧停车即将上线</text>
<text class="txt2">敬请期待</text> <text class="txt2">敬请期待</text>
@@ -172,9 +173,9 @@
<icon bindtap="closeTicketModal" class="close-icon" type="cancel"></icon> <icon bindtap="closeTicketModal" class="close-icon" type="cancel"></icon>
</view> </view>
<scroll-view bindscrolltolower="getMoreList" scroll-y style="height:800rpx;"> <scroll-view bindscrolltolower="getMoreList" scroll-y style="height:800rpx;">
<view class='section' wx:for='{{ticketList}}' wx:key='{{index}}' bindtap="choicecoupon" data-title="{{item.title}}" data-id="{{item.id}}">
<view class='mms'>
<!-- <text>{{index}}</text> -->
<view class='section' wx:for='{{ticketList}}' wx:key='{{index}}' bindtap="choicecoupon" data-title="{{item.title}}" data-id="{{item.id}}">
<view class='mms'>
<!-- <text>{{index}}</text> -->
<!-- <image class='gou' wx:if="{{item.id==quanid}}" mode='widthFix' src='{{gouHr}}'></image> --> <!-- <image class='gou' wx:if="{{item.id==quanid}}" mode='widthFix' src='{{gouHr}}'></image> -->
<view class='detail_msg'> <view class='detail_msg'>
<view class='info'> <view class='info'>
@@ -185,8 +186,8 @@
<text>{{item.subTitle}}</text> <text>{{item.subTitle}}</text>
</view> </view>
<view class="btns"> <view class="btns">
<text class='yuan' style='margin-right:10rpx;'>售价:{{item.salePrice/100}}元</text><text class='yuan' style='text-decoration:line-through' wx:if="{{item.unit==0}}">{{item.price/100}}元</text>
<text class='yuan' style='text-decoration:line-through' wx:if="{{item.unit==1}}">{{item.price/100}}小时</text>
<text class='yuan' style='margin-right:10rpx;'>售价:{{item.salePrice/100}}元</text><text class='yuan' style='text-decoration:line-through' wx:if="{{item.unit==0}}">{{item.price/100}}元</text>
<text class='yuan' style='text-decoration:line-through' wx:if="{{item.unit==1}}">{{item.price/100}}小时</text>
</view> </view>
</view> </view>
</view> </view>
@@ -196,7 +197,7 @@
<text class="txt1">{{item.expiredTime}}</text> <text class="txt1">{{item.expiredTime}}</text>
</view> </view>
</view> </view>
</view>
</view>
</scroll-view> </scroll-view>
<view class="loading" wx:if="{{loading}}"> <view class="loading" wx:if="{{loading}}">
<image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} <image src="{{loadingUrl}}" mode="widthFix"></image>{{content}}


+ 2
- 4
pages/coupon/childDetail/childDetail.js Ver ficheiro

@@ -754,14 +754,12 @@ Page({
// 有价券 // 有价券
if (!type && type != 'free') { if (!type && type != 'free') {
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
url: `/pages/order/detail/index?orderId=${orderId
}&cardIf=true&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` }&cardIf=true&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}`
}); });
} else if (type == 'free') { } else if (type == 'free') {
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
url: `/pages/order/detail/index?orderId=${orderId
}&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` }&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}`
}); });
} }


+ 146
- 148
pages/coupon/detail/index.js Ver ficheiro

@@ -9,7 +9,7 @@ Page({
priceAndStockObj: {},//存放价格和库存 priceAndStockObj: {},//存放价格和库存
goHomeUrl: "", goHomeUrl: "",
mouldType: 0, mouldType: 0,
mouldConfig:{},
mouldConfig: {},
navigationBarHeight, navigationBarHeight,
homeSelectedO: imgurl.homeSelectedO.url, homeSelectedO: imgurl.homeSelectedO.url,
isshowposter: false, //是否显示分享弹框 isshowposter: false, //是否显示分享弹框
@@ -29,7 +29,7 @@ Page({
swiperCurrent: 0, swiperCurrent: 0,
detailPicture: [], detailPicture: [],
coverPicture: [], coverPicture: [],
couponList:[],
couponList: [],
data: { data: {
title: null title: null
}, },
@@ -61,7 +61,7 @@ Page({
scaleData: null, scaleData: null,
skewData: null, skewData: null,
matrixData: null, matrixData: null,
opacity: 0,
opacity: 0,
queueData: null, queueData: null,
zIndex: 11, zIndex: 11,
display: "none", display: "none",
@@ -93,18 +93,18 @@ Page({
//图文混排 //图文混排
curHtml: '', curHtml: '',
contentType: 0, contentType: 0,
page:1,//查询商户优惠券page
idList:[],
page: 1,//查询商户优惠券page
idList: [],
}, },
/** /**
* 显示分享弹框 * 显示分享弹框
*/ */
showshare: function() {
showshare: function () {
this.setData({ this.setData({
isshowposter: true, isshowposter: true,
}) })
}, },
getCouponList: function(id) {
getCouponList: function (id) {
let that = this; let that = this;
let data; let data;
data = { data = {
@@ -114,39 +114,39 @@ Page({
pageSize: 5, pageSize: 5,
} }
Http.post({ Http.post({
url: config.api.listByMerchant,
data: data
}).then(res => {
if (res.data.page.list<=0){
return
}
let dataLsit = []
// dataLsit = that.data.couponList
dataLsit=res.data.page.list
dataLsit.map((item,index)=>{
if (item.id == that.data.couponChannelId){
dataLsit.splice(index,1)
}
})
if (that.data.page>1){
let tmpeLsit = that.data.couponList
tmpeLsit.push(...dataLsit)
that.setData({
couponList: tmpeLsit,
})
}else{
that.setData({
couponList: dataLsit,
})
url: config.api.listByMerchant,
data: data
}).then(res => {
if (res.data.page.list <= 0) {
return
}
let dataLsit = []
// dataLsit = that.data.couponList
dataLsit = res.data.page.list
dataLsit.map((item, index) => {
if (item.id == that.data.couponChannelId) {
dataLsit.splice(index, 1)
} }
// if (res.data && res.data.qrCode){
// that.setData({
// qrCode: res.data.qrCode,
// })
// }
}) })
if (that.data.page > 1) {
let tmpeLsit = that.data.couponList
tmpeLsit.push(...dataLsit)
that.setData({
couponList: tmpeLsit,
})
} else {
that.setData({
couponList: dataLsit,
})
}


// if (res.data && res.data.qrCode){
// that.setData({
// qrCode: res.data.qrCode,
// })
// }
})
.catch(err => { .catch(err => {
wx.showToast({ wx.showToast({
title: err.errMsg, title: err.errMsg,
@@ -159,7 +159,7 @@ Page({
/** /**
* 隐藏分享弹框 * 隐藏分享弹框
*/ */
hidemodal: function() {
hidemodal: function () {
this.setData({ this.setData({
isshowposter: false, isshowposter: false,
}) })
@@ -176,7 +176,7 @@ Page({
url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` url: `/pages/canvas/index?couponChannelId=${this.data.data.id}`
}) })
}, */ }, */
showPoster: function() {
showPoster: function () {
//跳转到海报生成页 //跳转到海报生成页
let that = this; let that = this;
Http.get({ Http.get({
@@ -199,32 +199,32 @@ Page({
}) })


}, },
swiperChange: function(e) {
swiperChange: function (e) {
this.setData({ this.setData({
swiperCurrent: e.detail.current swiperCurrent: e.detail.current
}); });
}, },
gohome(e){
console.log(e.currentTarget.dataset.id,"123")
gohome(e) {
console.log(e.currentTarget.dataset.id, "123")
wx.navigateTo({ wx.navigateTo({
url: `/pages/fillIndent/fillIndent?couponChannelId=${e.currentTarget.dataset.couponchannelid}&couponId=${e.currentTarget.dataset.couponid}&shippingtype=${e.currentTarget.dataset.shippingtype}`, url: `/pages/fillIndent/fillIndent?couponChannelId=${e.currentTarget.dataset.couponchannelid}&couponId=${e.currentTarget.dataset.couponid}&shippingtype=${e.currentTarget.dataset.shippingtype}`,
}) })
}, },


gochild(e){
gochild(e) {
let id = e.currentTarget.dataset.id let id = e.currentTarget.dataset.id
wx.navigateTo({ wx.navigateTo({
url: `/pages/coupon/childDetail/childDetail?couponIds=${id}`, url: `/pages/coupon/childDetail/childDetail?couponIds=${id}`,
}) })
}, },
//获取当前登录用户信息 //获取当前登录用户信息
getUserInfo: function() {
getUserInfo: function () {
let that = this; let that = this;
// 获取用户信息 // 获取用户信息
Http.get({ Http.get({
url: config.api.getScore,
data: {}
})
url: config.api.getScore,
data: {}
})
.then(res => { .then(res => {
console.log(res) console.log(res)
that.getQueryCardStatus() that.getQueryCardStatus()
@@ -245,9 +245,9 @@ Page({
updateDate: util.formatTime(Number(that.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss") updateDate: util.formatTime(Number(that.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss")
} }
Http.get({ Http.get({
url: config.api.queryCardStatus,
data: param
})
url: config.api.queryCardStatus,
data: param
})
.then(res => { .then(res => {
console.log(res, 333333333333) console.log(res, 333333333333)
}) })
@@ -270,9 +270,9 @@ Page({
receivedDisabled: true receivedDisabled: true
}) })
Http.post({ Http.post({
url: config.api.cardAccept,
data: param
})
url: config.api.cardAccept,
data: param
})
.then(res => { .then(res => {
wx.showToast({ wx.showToast({
title: '领取成功!', title: '领取成功!',
@@ -301,7 +301,7 @@ Page({
showCardOffer: false showCardOffer: false
}) })
}, },
goback: function() {
goback: function () {
let this_ = this let this_ = this
wx.switchTab({ wx.switchTab({
url: this_.data.goHomeUrl, url: this_.data.goHomeUrl,
@@ -310,7 +310,7 @@ Page({
/** /**
* 点击提交问题单选 * 点击提交问题单选
*/ */
formSubmit: function(e) {
formSubmit: function (e) {
console.log(e); console.log(e);
let that = this; let that = this;
/** /**
@@ -328,12 +328,12 @@ Page({
console.log(answserIs) console.log(answserIs)
console.log(e.currentTarget.dataset.questionid) console.log(e.currentTarget.dataset.questionid)
Http.post({ Http.post({
url: config.api.answerQuestion,
data: {
answer: answserIs,
questionId: e.currentTarget.dataset.questionid
}
})
url: config.api.answerQuestion,
data: {
answer: answserIs,
questionId: e.currentTarget.dataset.questionid
}
})
.then(res => { .then(res => {
that.closeQuestion(); that.closeQuestion();
}) })
@@ -349,29 +349,29 @@ Page({
/** /**
* 多选 * 多选
*/ */
checkboxChange: function(e) {
checkboxChange: function (e) {
console.log(e) console.log(e)
this.setData({ this.setData({
anwserId: e.detail.value anwserId: e.detail.value
}) })
}, },


closeQuestion: function() {
closeQuestion: function () {
let that = this; let that = this;
that.setData({ that.setData({
display: "none", display: "none",
zIndex: 11, zIndex: 11,
opacity: 0 opacity: 0
}) })
setTimeout(function() {
setTimeout(function () {
that.orderFunc(); that.orderFunc();
}, 500) }, 500)
}, },
gotopay: function(e) {
gotopay: function (e) {
app.globalData.previewFlag = true app.globalData.previewFlag = true
/* 判断是否授权*/ /* 判断是否授权*/
Http.get({ Http.get({
url: config.api.checkUserStatus,
url: config.api.checkUserStatus,
data: { data: {
token: app.globalData.token token: app.globalData.token
} }
@@ -394,13 +394,13 @@ Page({
queueData: null, queueData: null,
showbutton: true, showbutton: true,
formId: formId formId: formId
})
})
Http.get({ Http.get({
url: config.api.getQuestion,
data: {
couponType: JSON.stringify(that.data.data.type)
}
})
url: config.api.getQuestion,
data: {
couponType: JSON.stringify(that.data.data.type)
}
})
.then(res => { .then(res => {
wx.hideLoading(); wx.hideLoading();
if (res.data == undefined) { if (res.data == undefined) {
@@ -448,7 +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();
@@ -473,19 +473,19 @@ Page({
}) })
//如果倒计时结束,需要重新查询一下券的状态 //如果倒计时结束,需要重新查询一下券的状态
// 给getDetail一个标识 // 给getDetail一个标识
setTimeout(function () { setTimeout(function () {
console.log("当前时间", new Date().getTime()); console.log("当前时间", new Date().getTime());
that.getDetail(that.data.couponChannelId, 'endclock'); that.getDetail(that.data.couponChannelId, 'endclock');
}, 300); }, 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 () {
that.setIntervalTime(end_time); that.setIntervalTime(end_time);
}, 1000) }, 1000)
}, },
@@ -516,7 +516,7 @@ Page({
onLoad(options) { onLoad(options) {
this.setData({ this.setData({
mouldType: app.globalData.mouldType, mouldType: app.globalData.mouldType,
}) })
let that = this; let that = this;
if (options.g) { if (options.g) {
@@ -529,19 +529,19 @@ Page({
onshow: false onshow: false
}) })
if (options && (options.couponChannelId || options.couponIds)) { if (options && (options.couponChannelId || options.couponIds)) {
if (options.couponIds){
if (options.couponIds) {
this.setData({ this.setData({
couponIds: options.couponIds couponIds: options.couponIds
}) })
that.getDetail(options.couponIds, 'notendclock'); that.getDetail(options.couponIds, 'notendclock');
}else{
} else {
that.getDetail(options.couponChannelId, 'notendclock'); that.getDetail(options.couponChannelId, 'notendclock');
} }


} }
/** /**
* 转赠判断
* 转赠判断
*/ */
if (options.cuserId) { if (options.cuserId) {
this.setData({ this.setData({
@@ -617,23 +617,23 @@ Page({
}) })
}, },






getDetail: function(couponChannelId, flag) {

getDetail: function (couponChannelId, flag) {
let that = this; let that = this;
let data={};
let data = {};
that.getCouponMerchant(couponChannelId);//获取适用门店 that.getCouponMerchant(couponChannelId);//获取适用门店
that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存 that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存


if (that.data.couponIds){
if (that.data.couponIds) {
data.couponId = couponChannelId data.couponId = couponChannelId
}else{
} else {
data.couponChannelId = couponChannelId data.couponChannelId = couponChannelId
} }
var parmer = { var parmer = {
url: config.api.couponDetail, url: config.api.couponDetail,
data:data
data: data
}; };
Http.get(parmer) Http.get(parmer)
.then(res => { .then(res => {
@@ -736,7 +736,7 @@ Page({
that.setData({ that.setData({
data: res.data, data: res.data,
}); });
if(res.data.type == 10){
if (res.data.type == 10) {
that.setData({ that.setData({
salePriceStr: res.data.salePriceStr, salePriceStr: res.data.salePriceStr,
pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"),
@@ -772,7 +772,7 @@ Page({
/** /**
* 邀请好友继续砍价 * 邀请好友继续砍价
*/ */
inviteFriend: function(e) {
inviteFriend: function (e) {
let that = this; let that = this;
let formId = e.detail.formId; let formId = e.detail.formId;
that.setData({ that.setData({
@@ -788,27 +788,25 @@ Page({
let that = this; let that = this;
// 支付成功 // 支付成功
Http.post({ Http.post({
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
composeOrderId: orderId,
status: status,
reason: reason
}
})
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
composeOrderId: orderId,
status: status,
reason: reason
}
})
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
// 有价券 // 有价券
if (!type && type != 'free') { if (!type && type != 'free') {
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
url: `/pages/order/detail/index?orderId=${orderId
}&cardIf=true&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` }&cardIf=true&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}`
}); });
} else if (type == 'free') { } else if (type == 'free') {
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
url: `/pages/order/detail/index?orderId=${orderId
}&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}` }&contentType=${_this.data.contentType}&composeOrderType=${composeOrderType}`
}); });
} }
@@ -816,18 +814,18 @@ Page({
.catch(err => { .catch(err => {
console.log(err); console.log(err);
if (!type) { if (!type) {
setTimeout(function() {
setTimeout(function () {
_this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this, composeOrderType); _this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this, composeOrderType);
}, 2000) }, 2000)
} }
}) })
}, },
checkPhoneStatus: function() {
checkPhoneStatus: function () {
let that = this; let that = this;
Http.get({ Http.get({
url: config.api.checkPhoneStatus,
data: {}
})
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => { .then(res => {
console.log(666, '授权成功!') console.log(666, '授权成功!')
that.receiveCard() that.receiveCard()
@@ -857,7 +855,7 @@ Page({
}) })
}, },
// 券包支付 // 券包支付
/** /**
* 发起支付 * 发起支付
*/ */
@@ -870,9 +868,9 @@ Page({
} }
}).then(res => { }).then(res => {
Http.get({ Http.get({
url: config.api.checkPhoneStatus,
data: {}
})
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => { .then(res => {
// 发起砍价 // 发起砍价
if (discount == 'discount') { if (discount == 'discount') {
@@ -899,24 +897,24 @@ Page({
couponChannelId: "" + that.data.couponChannelId, couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId, couponId: "" + that.data.couponId,
formId: "" + that.data.formId, formId: "" + that.data.formId,
}
}
} }
console.log(data,"data")
console.log(data, "data")
let url = "" let url = ""
let tempObj; let tempObj;
let tempArr = [] let tempArr = []
if(that.data.data.type==12){
if (that.data.data.type == 12) {
url = config.api.couponPackageSave url = config.api.couponPackageSave
tempObj={
signleOrder:{
tempObj = {
signleOrder: {
couponChannelId: "" + that.data.couponChannelId, couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId, couponId: "" + that.data.couponId,
formId: "" + that.data.formId, formId: "" + that.data.formId,
}, },
count:"1"
count: "1"
} }
tempArr.push(tempObj) tempArr.push(tempObj)
}else{
} else {
url = config.api.orderSave url = config.api.orderSave
} }
/** /**
@@ -924,7 +922,7 @@ Page({
*/ */
return Http.post({ return Http.post({
url: url, url: url,
data: that.data.data.type == 12 ? JSON.stringify(tempArr):data
data: that.data.data.type == 12 ? JSON.stringify(tempArr) : data
}); });
}) })
.catch(err => { .catch(err => {
@@ -1016,9 +1014,9 @@ Page({
} }
}) })
.then(res => { .then(res => {
console.log(res,"res123")
console.log(res, "res123")
if (discount != 'discount') { if (discount != 'discount') {
if (typeof(res) != "undefined") {
if (typeof (res) != "undefined") {
let orderId = "" + res.data.mainOrderId; let orderId = "" + res.data.mainOrderId;
that.setData({ that.setData({
orderId: orderId, orderId: orderId,
@@ -1030,12 +1028,12 @@ Page({
* 支付订单创建 * 支付订单创建
*/ */
Http.post({ Http.post({
url: config.api.payOrderCreate,
data: {
orderId: orderId,
composeOrderType: res.data.composeOrderType
}
})
url: config.api.payOrderCreate,
data: {
orderId: orderId,
composeOrderType: res.data.composeOrderType
}
})
.then(res => { .then(res => {
var payOrderId = "" + res.data.payOrderId; var payOrderId = "" + res.data.payOrderId;
wx.hideLoading(); wx.hideLoading();
@@ -1078,7 +1076,7 @@ Page({
}) })
return; return;
}, },
complete: res => {}
complete: res => { }
}); });
/// End payment -------- /// End payment --------
}) })
@@ -1158,7 +1156,7 @@ Page({
title: '提示', title: '提示',
content: "您有未支付订单,请到“我的-我的砍价”进行支付", content: "您有未支付订单,请到“我的-我的砍价”进行支付",
confirmText: "我的砍价", confirmText: "我的砍价",
success: function(res) {
success: function (res) {
if (res.confirm) { if (res.confirm) {
wx.navigateTo({ wx.navigateTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}&composeOrderType=${that.data.composeOrderType}`, url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.disOrderNumber}&composeOrderType=${that.data.composeOrderType}`,
@@ -1171,19 +1169,19 @@ Page({
title: '提示', title: '提示',
content: '您有未支付订单,请先进行支付', content: '您有未支付订单,请先进行支付',
confirmText: "去支付", confirmText: "去支付",
success: function(res1) {
success: function (res1) {
if (res1.confirm) { if (res1.confirm) {
if (that.data.composeOrderType>0){//券包
if (that.data.composeOrderType > 0) {//券包
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}&contentType=${that.data.contentType}&composeOrderType=${that.data.composeOrderType}`, url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}&contentType=${that.data.contentType}&composeOrderType=${that.data.composeOrderType}`,
})
}else{
})
} else {
wx.navigateTo({ wx.navigateTo({
url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}&contentType=${that.data.contentType}&composeOrderType=${that.data.composeOrderType}`, url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}&contentType=${that.data.contentType}&composeOrderType=${that.data.composeOrderType}`,
}) })
} }
} }
} }
}) })
@@ -1210,26 +1208,26 @@ Page({
this.countdown(this.data.begin_time) this.countdown(this.data.begin_time)
} }
}, },
onUnload: function() {
onUnload: function () {
let that = this; let that = this;
clearInterval(that.data.setInterval) clearInterval(that.data.setInterval)
}, },
onHide: function() {
onHide: function () {
let that = this; let that = this;
clearInterval(that.data.setInterval) clearInterval(that.data.setInterval)
}, },
onShareAppMessage: function(options) {
onShareAppMessage: function (options) {
app.globalData.previewFlag = true app.globalData.previewFlag = true
var that = this; var that = this;
console.log(options) console.log(options)
var shareObj = { var shareObj = {
title: that.data.data.title, title: that.data.data.title,
path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}`, path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}`,
success: function(res) {
if (res.errMsg == 'shareAppMessage:ok') {}
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') { }
}, },
fail: function(error) {
if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {}
fail: function (error) {
if (res.errMsg == 'shareAppMessage:fail cancel') { } else if (res.errMsg == 'shareAppMessage:fail') { }
} }
}; };
// 来自页面内的按钮的转发 // 来自页面内的按钮的转发
@@ -1242,16 +1240,16 @@ Page({
return shareObj; return shareObj;
}, },
// 下拉刷新 // 下拉刷新
onPullDownRefresh: function() {
onPullDownRefresh: function () {
this.getDetail(this.data.couponChannelId); this.getDetail(this.data.couponChannelId);
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
}, },
onReachBottom:function(){
onReachBottom: function () {
this.setData({ this.setData({
page:this.data.page+1
page: this.data.page + 1
}) })
if (this.data.idList.length>0){
if (this.data.idList.length > 0) {
this.getCouponList(this.data.idList) this.getCouponList(this.data.idList)
} }
} }

+ 1
- 1
pages/coupon/detail/index.json Ver ficheiro

@@ -6,6 +6,6 @@
"c-coupons": "../../../components/coupons/index" "c-coupons": "../../../components/coupons/index"
}, },
"navigationBarTitleText": "", "navigationBarTitleText": "",
"backgroundColor":"#f4f4f4",
"backgroundColor": "#f4f4f4",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }

+ 6
- 4
pages/coupon/detail/index.wxss Ver ficheiro

@@ -551,7 +551,7 @@ button::after {
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
} }


.quessss >view:last-child {
.quessss>view:last-child {
border-bottom: 0; border-bottom: 0;
} }


@@ -628,7 +628,8 @@ button::after {
bottom: 15rpx; bottom: 15rpx;
} }


.btns .fr, .btns .fl {
.btns .fr,
.btns .fl {
width: 270rpx; width: 270rpx;
height: 95rpx; height: 95rpx;
border-radius: 48rpx; border-radius: 48rpx;
@@ -796,7 +797,8 @@ button::after {
background: rgba(201, 201, 201, 0.1); background: rgba(201, 201, 201, 0.1);
} }


checkbox-group, radio-group {
checkbox-group,
radio-group {
height: 400rpx; height: 400rpx;
overflow-y: scroll; overflow-y: scroll;
} }
@@ -986,4 +988,4 @@ checkbox-group, radio-group {
font-size: 24rpx; font-size: 24rpx;
margin: 10px; margin: 10px;
text-decoration: line-through; text-decoration: line-through;
}
}

+ 9
- 9
pages/freeBannerDetail/index.js Ver ficheiro

@@ -23,7 +23,7 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) {
onLoad: function (options) {
if (app.globalData.token) { if (app.globalData.token) {
const that = this; const that = this;
that.setData({ that.setData({
@@ -42,7 +42,7 @@ Page({
header: { header: {
'content-type': 'application/html' 'content-type': 'application/html'
}, },
success: function(res) {
success: function (res) {
var temp = WxParse.wxParse('article', 'html', res.data, that, 5); var temp = WxParse.wxParse('article', 'html', res.data, that, 5);
} }
}) })
@@ -66,7 +66,7 @@ Page({
header: { header: {
'content-type': 'application/html' 'content-type': 'application/html'
}, },
success: function(res) {
success: function (res) {
var temp = WxParse.wxParse('article', 'html', res.data, that, 5); var temp = WxParse.wxParse('article', 'html', res.data, that, 5);
} }
}) })
@@ -78,22 +78,22 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() {
onShow: function () {
this.setData({ this.setData({
date: new Date() date: new Date()
}) })
}, },
onShareAppMessage: function(options) {
onShareAppMessage: function (options) {
var that = this; var that = this;
console.log(`/pages/freeBannerDetail/index?id=${that.data.data.id}`) console.log(`/pages/freeBannerDetail/index?id=${that.data.data.id}`)
var shareObj = { var shareObj = {
title: that.data.title, title: that.data.title,
path: `/pages/freeBannerDetail/index?id=${that.data.data.id}`, path: `/pages/freeBannerDetail/index?id=${that.data.data.id}`,
success: function(res) {
if (res.errMsg == 'shareAppMessage:ok') {}
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') { }
}, },
fail: function(error) {
if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {}
fail: function (error) {
if (res.errMsg == 'shareAppMessage:fail cancel') { } else if (res.errMsg == 'shareAppMessage:fail') { }
} }
}; };




+ 1
- 1
project.config.json Ver ficheiro

@@ -7,7 +7,7 @@
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": true, "es6": true,
"enhance": false,
"enhance": true,
"postcss": true, "postcss": true,
"minified": true, "minified": true,
"newFeature": true, "newFeature": true,


+ 1
- 1
project.private.config.json Ver ficheiro

@@ -4,5 +4,5 @@
"setting": { "setting": {
"compileHotReLoad": true "compileHotReLoad": true
}, },
"libVersion": "2.21.4"
"libVersion": "2.26.2"
} }

Carregando…
Cancelar
Guardar