@@ -2,7 +2,6 @@ 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() : {} | ||||
var myPluginInterface = extConfig.attr.businessSwitch ? requirePlugin('auto-points-plugin') : null; | var myPluginInterface = extConfig.attr.businessSwitch ? requirePlugin('auto-points-plugin') : null; | ||||
let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false | let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false | ||||
@@ -1,7 +1,14 @@ | |||||
{ | { | ||||
"ext": { | "ext": { | ||||
"attr": { | "attr": { | ||||
"mchId": "1602801645", | |||||
"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", | |||||
"businessSwitch": "1", | "businessSwitch": "1", | ||||
"businessVersion": "1", | |||||
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback", | |||||
"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": { | ||||
@@ -13,21 +13,21 @@ Page({ | |||||
wmhome: imgurl.wmhome.url, | wmhome: imgurl.wmhome.url, | ||||
wmgive: imgurl.wmgive.url, | wmgive: imgurl.wmgive.url, | ||||
tabs: [{ | tabs: [{ | ||||
key: 0, | |||||
name: "未使用" | |||||
}, | |||||
{ | |||||
key: 1, | |||||
name: "已使用" | |||||
}, | |||||
{ | |||||
key: 2, | |||||
name: "已过期" | |||||
}, | |||||
{ | |||||
key: 3, | |||||
name: "已退款" | |||||
} | |||||
key: 0, | |||||
name: "未使用" | |||||
}, | |||||
{ | |||||
key: 1, | |||||
name: "已使用" | |||||
}, | |||||
{ | |||||
key: 2, | |||||
name: "已过期" | |||||
}, | |||||
{ | |||||
key: 3, | |||||
name: "已退款" | |||||
} | |||||
], | ], | ||||
list: [], | list: [], | ||||
current: "0", | current: "0", | ||||
@@ -37,7 +37,7 @@ Page({ | |||||
loading: true, //"上拉加载"的变量,默认false,隐藏 | loading: true, //"上拉加载"的变量,默认false,隐藏 | ||||
content: "", | content: "", | ||||
mystatus: '', | mystatus: '', | ||||
showPage:false, | |||||
showPage: false, | |||||
goHomeUrl: "", | goHomeUrl: "", | ||||
}, | }, | ||||
onLoad() { | onLoad() { | ||||
@@ -71,8 +71,7 @@ Page({ | |||||
var mystatus = this.data.mystatus; | var mystatus = this.data.mystatus; | ||||
} | } | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/couponorder/detail/index?quancode=${ | |||||
e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` | |||||
url: `/pages/couponorder/detail/index?quancode=${e.currentTarget.dataset.quancode}&couponorderstatus=${mystatus}` | |||||
}); | }); | ||||
}, | }, | ||||
getList(key, pageNum) { | getList(key, pageNum) { | ||||
@@ -80,8 +79,14 @@ Page({ | |||||
if (that.data.allow_load) { | if (that.data.allow_load) { | ||||
that.setData({ | that.setData({ | ||||
loading: true, | loading: true, | ||||
content: "小主,我在玩命加载中...", | |||||
}); | |||||
content: "小主,我在玩命加载中..." | |||||
}) | |||||
// 3秒后隐藏加载组件 | |||||
setTimeout(() => { | |||||
that.setData({ | |||||
loading: false, | |||||
}); | |||||
}, 3000) | |||||
Http.get({ | Http.get({ | ||||
url: config.api.couponOrderList, | url: config.api.couponOrderList, | ||||
data: { | data: { | ||||
@@ -90,54 +95,54 @@ Page({ | |||||
couponOrderStatus: key | couponOrderStatus: key | ||||
} | } | ||||
}) | }) | ||||
.then(res => { | |||||
if(res.code == 200){ | |||||
that.setData({ | |||||
showPage:true | |||||
}) | |||||
} | |||||
res.data.list.map(file => { | |||||
file.expiredTimeStr = util.fmtDate(Number(file.expiredTime)); | |||||
console.log(file.expiredTime,file.expiredTimeStr) | |||||
}); | |||||
setTimeout(function () { | |||||
that.setData({ | |||||
loading: false | |||||
}); | |||||
}, 1400); | |||||
if (pageNum >= res.data.pages) { | |||||
that.setData({ | |||||
allow_load: false | |||||
.then(res => { | |||||
if (res.code == 200) { | |||||
that.setData({ | |||||
showPage: true | |||||
}) | |||||
} | |||||
res.data.list.map(file => { | |||||
file.expiredTimeStr = util.fmtDate(Number(file.expiredTime)); | |||||
console.log(file.expiredTime, file.expiredTimeStr) | |||||
}); | }); | ||||
} | |||||
if (pageNum == 1) { | |||||
that.setData({ | |||||
list: [] | |||||
}) | |||||
} | |||||
var tmpArr =[]; | |||||
tmpArr = that.data.list | |||||
// Object.assign(tmpArr, res.data.list); | |||||
if(pageNum==1){ | |||||
console.log(res.data.list) | |||||
that.setData({ | |||||
list: res.data.list | |||||
}) | |||||
}else{ | |||||
tmpArr = [...tmpArr,...res.data.list] | |||||
that.setData({ | |||||
list: tmpArr | |||||
setTimeout(function () { | |||||
that.setData({ | |||||
loading: false | |||||
}); | |||||
}, 1400); | |||||
if (pageNum >= res.data.pages) { | |||||
that.setData({ | |||||
allow_load: false | |||||
}); | |||||
} | |||||
if (pageNum == 1) { | |||||
that.setData({ | |||||
list: [] | |||||
}) | |||||
} | |||||
var tmpArr = []; | |||||
tmpArr = that.data.list | |||||
// Object.assign(tmpArr, res.data.list); | |||||
if (pageNum == 1) { | |||||
console.log(res.data.list) | |||||
that.setData({ | |||||
list: res.data.list | |||||
}) | |||||
} else { | |||||
tmpArr = [...tmpArr, ...res.data.list] | |||||
that.setData({ | |||||
list: tmpArr | |||||
}) | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.errMsg, | |||||
showCancel: false | |||||
}) | }) | ||||
} | |||||
}) | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: '提示', | |||||
content: err.errMsg, | |||||
showCancel:false | |||||
}) | }) | ||||
}) | |||||
} else { | } else { | ||||
that.setData({ | that.setData({ | ||||
loading: true, | loading: true, | ||||
@@ -157,7 +162,7 @@ Page({ | |||||
list: [], | list: [], | ||||
allow_load: true, | allow_load: true, | ||||
current_scroll: detail.key, | current_scroll: detail.key, | ||||
page:1, | |||||
page: 1, | |||||
}); | }); | ||||
this.getList(detail.key, 1); | this.getList(detail.key, 1); | ||||
}, | }, | ||||
@@ -12,7 +12,7 @@ Page({ | |||||
*/ | */ | ||||
data: { | data: { | ||||
mouldType: 0, | mouldType: 0, | ||||
mouldConfig:{}, | |||||
mouldConfig: {}, | |||||
navigationBarHeight, | navigationBarHeight, | ||||
teljpgUrl: imgurl.teljpg.url, | teljpgUrl: imgurl.teljpg.url, | ||||
wmhome: imgurl.wmhome.url, | wmhome: imgurl.wmhome.url, | ||||
@@ -33,12 +33,12 @@ Page({ | |||||
showErr: false, | showErr: false, | ||||
showTime: true, | showTime: true, | ||||
merchantVoList: [] | merchantVoList: [] | ||||
}, | |||||
}, | |||||
/** | /** | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function(options) { | |||||
onLoad: function (options) { | |||||
this.setData({ | this.setData({ | ||||
mouldType: app.globalData.mouldType, | mouldType: app.globalData.mouldType, | ||||
mouldConfig: app.globalData.mouldConfig, | mouldConfig: app.globalData.mouldConfig, | ||||
@@ -107,7 +107,7 @@ Page({ | |||||
/** | /** | ||||
* 拨打电话 | * 拨打电话 | ||||
*/ | */ | ||||
phone: function(e) { | |||||
phone: function (e) { | |||||
let that = this; | let that = this; | ||||
wx.makePhoneCall({ | wx.makePhoneCall({ | ||||
phoneNumber: e.target.dataset.merchantlinkphone | phoneNumber: e.target.dataset.merchantlinkphone | ||||
@@ -179,7 +179,7 @@ Page({ | |||||
// that.getOneSpell(that.data.couponId) | // that.getOneSpell(that.data.couponId) | ||||
} | } | ||||
if (that.data.showTime) { | if (that.data.showTime) { | ||||
setTimeout(function() { | |||||
setTimeout(function () { | |||||
total_micro_second -= 1000; | total_micro_second -= 1000; | ||||
that.countdown(); | that.countdown(); | ||||
}, 1000) | }, 1000) | ||||
@@ -210,7 +210,8 @@ Page({ | |||||
if (res.data) { | if (res.data) { | ||||
that.countdown(res.data.expiredDate); | that.countdown(res.data.expiredDate); | ||||
that.setData({ | that.setData({ | ||||
spellData: res.data | |||||
spellData: res.data, | |||||
nickName: res.data.nickName | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
@@ -244,13 +245,13 @@ Page({ | |||||
let that = this; | let that = this; | ||||
// 支付成功 | // 支付成功 | ||||
Http.post({ | Http.post({ | ||||
url: config.api.toOrderGroup, | |||||
data: { | |||||
id: orderGroupId, | |||||
orderId, | |||||
couponId: _this.data.data.couponId | |||||
} | |||||
}) | |||||
url: config.api.toOrderGroup, | |||||
data: { | |||||
id: orderGroupId, | |||||
orderId, | |||||
couponId: _this.data.data.couponId | |||||
} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
wx.reLaunch({ | wx.reLaunch({ | ||||
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}` | url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}` | ||||
@@ -267,14 +268,14 @@ Page({ | |||||
payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => { | payOrderUpdate: (orderId, payOrderId, status, reason, _this, orderGroupId) => { | ||||
// 支付成功 | // 支付成功 | ||||
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 (res.data.orderStatus == 14) { | if (res.data.orderStatus == 14) { | ||||
@@ -294,7 +295,7 @@ Page({ | |||||
.catch(err => { | .catch(err => { | ||||
console.log(err); | console.log(err); | ||||
if (err.code != 12002) { | if (err.code != 12002) { | ||||
setTimeout(function() { | |||||
setTimeout(function () { | |||||
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); | _this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); | ||||
}, 2000) | }, 2000) | ||||
} | } | ||||
@@ -316,9 +317,9 @@ Page({ | |||||
var that = this; | var that = this; | ||||
Http.get({ | Http.get({ | ||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}) | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
/** | /** | ||||
* orderSave 下单 | * orderSave 下单 | ||||
@@ -423,9 +424,9 @@ Page({ | |||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
console.log(res) | console.log(res) | ||||
that.setData({aa:res}) | |||||
if (typeof(res) != "undefined") { | |||||
that.setData({ aa: res }) | |||||
if (typeof (res) != "undefined") { | |||||
let orderId = "" + res.data.mainOrderId; | let orderId = "" + res.data.mainOrderId; | ||||
that.setData({ | that.setData({ | ||||
orderId: orderId, | orderId: orderId, | ||||
@@ -438,12 +439,12 @@ Page({ | |||||
* 支付订单创建 | * 支付订单创建 | ||||
*/ | */ | ||||
Http.post({ | Http.post({ | ||||
url: config.api.payOrderCreate, | |||||
data: { | |||||
orderId: orderId, | |||||
composeOrderType: that.data.composeOrderType | |||||
} | |||||
}) | |||||
url: config.api.payOrderCreate, | |||||
data: { | |||||
orderId: orderId, | |||||
composeOrderType: that.data.composeOrderType | |||||
} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
var payOrderId = "" + res.data.payOrderId; | var payOrderId = "" + res.data.payOrderId; | ||||
wx.hideLoading(); | wx.hideLoading(); | ||||
@@ -460,12 +461,12 @@ Page({ | |||||
that.setData({ | that.setData({ | ||||
canSpell: false | canSpell: false | ||||
}) | }) | ||||
setTimeout(function() { | |||||
setTimeout(function () { | |||||
wx.hideLoading() | wx.hideLoading() | ||||
}, 5000) | }, 5000) | ||||
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); | that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); | ||||
if (res.errMsg == "requestPayment:ok") { | if (res.errMsg == "requestPayment:ok") { | ||||
setTimeout(function() { | |||||
setTimeout(function () { | |||||
wx.hideLoading(); | wx.hideLoading(); | ||||
}, 2000); | }, 2000); | ||||
} | } | ||||
@@ -482,7 +483,7 @@ Page({ | |||||
}) | }) | ||||
return; | return; | ||||
}, | }, | ||||
complete: res => {} | |||||
complete: res => { } | |||||
}); | }); | ||||
/// End payment -------- | /// End payment -------- | ||||
}) | }) | ||||
@@ -505,7 +506,7 @@ Page({ | |||||
/** | /** | ||||
* 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
*/ | */ | ||||
onShow: function() { | |||||
onShow: function () { | |||||
this.setData({ | this.setData({ | ||||
mouldType: app.globalData.mouldType, | mouldType: app.globalData.mouldType, | ||||
canSpell: true, | canSpell: true, | ||||
@@ -520,7 +521,7 @@ Page({ | |||||
/** | /** | ||||
* 生命周期函数--监听页面隐藏 | * 生命周期函数--监听页面隐藏 | ||||
*/ | */ | ||||
onHide: function() { | |||||
onHide: function () { | |||||
this.setData({ | this.setData({ | ||||
showTime: false | showTime: false | ||||
}) | }) | ||||
@@ -529,7 +530,7 @@ Page({ | |||||
/** | /** | ||||
* 生命周期函数--监听页面卸载 | * 生命周期函数--监听页面卸载 | ||||
*/ | */ | ||||
onUnload: function() { | |||||
onUnload: function () { | |||||
this.setData({ | this.setData({ | ||||
showTime: false | showTime: false | ||||
}) | }) | ||||
@@ -538,7 +539,7 @@ Page({ | |||||
/** | /** | ||||
* 页面相关事件处理函数--监听用户下拉动作 | * 页面相关事件处理函数--监听用户下拉动作 | ||||
*/ | */ | ||||
onPullDownRefresh: function() { | |||||
onPullDownRefresh: function () { | |||||
this.checkUser(this.data.paramData) | this.checkUser(this.data.paramData) | ||||
} | } | ||||
}) | }) |
@@ -12,7 +12,7 @@ const config = require("../../../config/config"); | |||||
const QR = require("../../../utils/memberqrcode.js"); | const QR = require("../../../utils/memberqrcode.js"); | ||||
const util = require("../../../utils/util"); | const util = require("../../../utils/util"); | ||||
const bgColor = require("../../../utils/bgColor.js") | const bgColor = require("../../../utils/bgColor.js") | ||||
const myPluginInterface = requirePlugin('auto-points-plugin') || '' | |||||
const myPluginInterface = requirePlugin('auto-points-plugin') || null | |||||
let app = getApp(); | let app = getApp(); | ||||
Page({ | Page({ | ||||
data: { | data: { | ||||
@@ -106,7 +106,7 @@ | |||||
<optimization wx:if="{{businessList.length>0}}" businessList="{{businessList}}" businessData="{{businessData}}" bind:businessid="getBusineData" /> | <optimization wx:if="{{businessList.length>0}}" businessList="{{businessList}}" businessData="{{businessData}}" bind:businessid="getBusineData" /> | ||||
<!-- <c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}" loading="{{loading}}" /> --> | <!-- <c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}" loading="{{loading}}" /> --> | ||||
@@ -5,5 +5,5 @@ | |||||
"compileHotReLoad": true, | "compileHotReLoad": true, | ||||
"urlCheck": true | "urlCheck": true | ||||
}, | }, | ||||
"libVersion": "2.27.1" | |||||
"libVersion": "2.11.2" | |||||
} | } |