@@ -2,7 +2,6 @@ let config = require("./config/config.js"); | |||
const { defaultObj, huanLeChengObj } = require("./utils/mouldStyle.js") | |||
const Http = require("./utils/HttpBasics"); | |||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | |||
var myPluginInterface = extConfig.attr.businessSwitch ? requirePlugin('auto-points-plugin') : null; | |||
let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false | |||
@@ -1,7 +1,14 @@ | |||
{ | |||
"ext": { | |||
"attr": { | |||
"mchId": "1602801645", | |||
"car": { | |||
"etcp": { | |||
"etcpAppId": "wx192b7d2e8dcbefd0", | |||
"etcpVersion": "release", | |||
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback" | |||
} | |||
}, | |||
"mchId": "1604439800", | |||
"imgProxy": [ | |||
{ | |||
"newUrl": "https://ctest.malls.iformall.com/img", | |||
@@ -17,16 +24,12 @@ | |||
} | |||
], | |||
"configUrl": "https://ctest.malls.iformall.com/C/api", | |||
"etcpAppId": "wx219a81b9c87aa4f7", | |||
"etcpVersion": "release", | |||
"businessSwitch": "1", | |||
"businessVersion": "1", | |||
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback", | |||
"ifHaveWebSocket": "0", | |||
"ifHaveCarModular": "1" | |||
}, | |||
"name": "富茂光谷测试版", | |||
"weappId": "wx219a81b9c87aa4f7", | |||
"name": "金泸商务", | |||
"weappId": "wx649b3be73c1afe47", | |||
"appVersion": "C.test.5.2.0" | |||
}, | |||
"debug": false, | |||
@@ -74,15 +77,15 @@ | |||
}, | |||
"plugins": { | |||
"auto-points-plugin": { | |||
"version": "2.4.0", | |||
"version": "1.3.0", | |||
"provider": "wxfab2bf944bfc4da6" | |||
}, | |||
"live-player-plugin": { | |||
"version": "1.2.5", | |||
"version": "1.3.4", | |||
"provider": "wx2b03c6e691cd7370" | |||
} | |||
}, | |||
"extAppid": "wx219a81b9c87aa4f7", | |||
"extAppid": "wx649b3be73c1afe47", | |||
"extEnable": true, | |||
"permission": { | |||
"scope.userLocation": { | |||
@@ -13,21 +13,21 @@ Page({ | |||
wmhome: imgurl.wmhome.url, | |||
wmgive: imgurl.wmgive.url, | |||
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: [], | |||
current: "0", | |||
@@ -37,7 +37,7 @@ Page({ | |||
loading: true, //"上拉加载"的变量,默认false,隐藏 | |||
content: "", | |||
mystatus: '', | |||
showPage:false, | |||
showPage: false, | |||
goHomeUrl: "", | |||
}, | |||
onLoad() { | |||
@@ -71,8 +71,7 @@ Page({ | |||
var mystatus = this.data.mystatus; | |||
} | |||
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) { | |||
@@ -80,8 +79,14 @@ Page({ | |||
if (that.data.allow_load) { | |||
that.setData({ | |||
loading: true, | |||
content: "小主,我在玩命加载中...", | |||
}); | |||
content: "小主,我在玩命加载中..." | |||
}) | |||
// 3秒后隐藏加载组件 | |||
setTimeout(() => { | |||
that.setData({ | |||
loading: false, | |||
}); | |||
}, 3000) | |||
Http.get({ | |||
url: config.api.couponOrderList, | |||
data: { | |||
@@ -90,54 +95,54 @@ Page({ | |||
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 { | |||
that.setData({ | |||
loading: true, | |||
@@ -157,7 +162,7 @@ Page({ | |||
list: [], | |||
allow_load: true, | |||
current_scroll: detail.key, | |||
page:1, | |||
page: 1, | |||
}); | |||
this.getList(detail.key, 1); | |||
}, | |||
@@ -12,7 +12,7 @@ Page({ | |||
*/ | |||
data: { | |||
mouldType: 0, | |||
mouldConfig:{}, | |||
mouldConfig: {}, | |||
navigationBarHeight, | |||
teljpgUrl: imgurl.teljpg.url, | |||
wmhome: imgurl.wmhome.url, | |||
@@ -33,12 +33,12 @@ Page({ | |||
showErr: false, | |||
showTime: true, | |||
merchantVoList: [] | |||
}, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function(options) { | |||
onLoad: function (options) { | |||
this.setData({ | |||
mouldType: app.globalData.mouldType, | |||
mouldConfig: app.globalData.mouldConfig, | |||
@@ -107,7 +107,7 @@ Page({ | |||
/** | |||
* 拨打电话 | |||
*/ | |||
phone: function(e) { | |||
phone: function (e) { | |||
let that = this; | |||
wx.makePhoneCall({ | |||
phoneNumber: e.target.dataset.merchantlinkphone | |||
@@ -179,7 +179,7 @@ Page({ | |||
// that.getOneSpell(that.data.couponId) | |||
} | |||
if (that.data.showTime) { | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
total_micro_second -= 1000; | |||
that.countdown(); | |||
}, 1000) | |||
@@ -210,7 +210,8 @@ Page({ | |||
if (res.data) { | |||
that.countdown(res.data.expiredDate); | |||
that.setData({ | |||
spellData: res.data | |||
spellData: res.data, | |||
nickName: res.data.nickName | |||
}); | |||
} | |||
}); | |||
@@ -244,13 +245,13 @@ Page({ | |||
let that = this; | |||
// 支付成功 | |||
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 => { | |||
wx.reLaunch({ | |||
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) => { | |||
// 支付成功 | |||
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 => { | |||
wx.hideLoading() | |||
if (res.data.orderStatus == 14) { | |||
@@ -294,7 +295,7 @@ Page({ | |||
.catch(err => { | |||
console.log(err); | |||
if (err.code != 12002) { | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); | |||
}, 2000) | |||
} | |||
@@ -316,9 +317,9 @@ Page({ | |||
var that = this; | |||
Http.get({ | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}) | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}) | |||
.then(res => { | |||
/** | |||
* orderSave 下单 | |||
@@ -423,9 +424,9 @@ Page({ | |||
}) | |||
.then(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; | |||
that.setData({ | |||
orderId: orderId, | |||
@@ -438,12 +439,12 @@ Page({ | |||
* 支付订单创建 | |||
*/ | |||
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 => { | |||
var payOrderId = "" + res.data.payOrderId; | |||
wx.hideLoading(); | |||
@@ -460,12 +461,12 @@ Page({ | |||
that.setData({ | |||
canSpell: false | |||
}) | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
wx.hideLoading() | |||
}, 5000) | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); | |||
if (res.errMsg == "requestPayment:ok") { | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
wx.hideLoading(); | |||
}, 2000); | |||
} | |||
@@ -482,7 +483,7 @@ Page({ | |||
}) | |||
return; | |||
}, | |||
complete: res => {} | |||
complete: res => { } | |||
}); | |||
/// End payment -------- | |||
}) | |||
@@ -505,7 +506,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function() { | |||
onShow: function () { | |||
this.setData({ | |||
mouldType: app.globalData.mouldType, | |||
canSpell: true, | |||
@@ -520,7 +521,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function() { | |||
onHide: function () { | |||
this.setData({ | |||
showTime: false | |||
}) | |||
@@ -529,7 +530,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function() { | |||
onUnload: function () { | |||
this.setData({ | |||
showTime: false | |||
}) | |||
@@ -538,7 +539,7 @@ Page({ | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function() { | |||
onPullDownRefresh: function () { | |||
this.checkUser(this.data.paramData) | |||
} | |||
}) |
@@ -12,7 +12,7 @@ const config = require("../../../config/config"); | |||
const QR = require("../../../utils/memberqrcode.js"); | |||
const util = require("../../../utils/util"); | |||
const bgColor = require("../../../utils/bgColor.js") | |||
const myPluginInterface = requirePlugin('auto-points-plugin') || '' | |||
const myPluginInterface = requirePlugin('auto-points-plugin') || null | |||
let app = getApp(); | |||
Page({ | |||
data: { | |||
@@ -106,7 +106,7 @@ | |||
<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}}" /> --> | |||
@@ -5,5 +5,5 @@ | |||
"compileHotReLoad": true, | |||
"urlCheck": true | |||
}, | |||
"libVersion": "2.27.1" | |||
"libVersion": "2.11.2" | |||
} |