@@ -2,14 +2,14 @@ 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 = requirePlugin('auto-points-plugin') | |||
var myPluginInterface = extConfig.attr.businessSwitch ? requirePlugin('auto-points-plugin') : null; | |||
let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false | |||
App({ | |||
data: { | |||
newArr: [], //存放分享二维进入消息信息 | |||
businessSwitch: businessSwitch, //判断是否开启商圈自助积分 | |||
businessSwitch: businessSwitch || null, //判断是否开启商圈自助积分 | |||
}, | |||
onLaunch: function (options) { | |||
@@ -25,11 +25,9 @@ | |||
</view> | |||
</view> | |||
<!-- 当item.expand为true且商户数量不大于三个时 --> | |||
<view class="shop" wx:if="{{item.expand}}"> | |||
<view class='posi' wx:for="{{item.merchantVoList}}" wx:for-index="itemIndex" wx:key="{{itemIndex}}"> | |||
<view class='posi' wx:for="{{item.merchantVoList}}" wx:for-index="itemIndex" wx:key="itemIndex"> | |||
<view class='posi_logo'> | |||
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'> | |||
<image class="img" src='{{item.merchantImgUrl}}'></image> | |||
@@ -2,35 +2,45 @@ | |||
"ext": { | |||
"attr": { | |||
"car": { | |||
"tjd": { | |||
"payPath": "", | |||
"tjdAppId": "wx6945d1bda68d7993" | |||
}, | |||
"etcp": { | |||
"etcpAppId": "wx192b7d2e8dcbefd0", | |||
"etcpVersion": "release", | |||
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback" | |||
} | |||
"payPath": "pages/pay/order-pay-open/main", | |||
"etcpAppId": "wxc07f9d67923d676d", | |||
"etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback" | |||
}, | |||
"bolink": { | |||
"payPath": "pages/park/park", | |||
"bolinkAppId": "wxbd08b4baa10fcc1d" | |||
}, | |||
"version": "release" | |||
}, | |||
"mchId": "1604439800", | |||
"imgProxy": [ | |||
{ | |||
"newUrl": "https://ctest.malls.iformall.com/img", | |||
"newUrl": "https://c.malls.iformall.com/img", | |||
"orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" | |||
}, | |||
{ | |||
"newUrl": "https://ctest.malls.iformall.com/img1", | |||
"newUrl": "https://c.malls.iformall.com/img1", | |||
"orgUrl": "https://formall.oss-accelerate.aliyuncs.com" | |||
}, | |||
{ | |||
"newUrl": "https://ctest.malls.iformall.com/img2", | |||
"newUrl": "https://c.malls.iformall.com/img2", | |||
"orgUrl": "https://wx.qlogo.cn" | |||
} | |||
], | |||
"configUrl": "https://ctest.malls.iformall.com/C/api", | |||
"configUrl": "https://c.malls.iformall.com/C/api", | |||
"ifStoreApp": "0", | |||
"businessSwitch": "1", | |||
"ifHaveWebSocket": "0", | |||
"ifHaveCarModular": "1" | |||
"ifHaveCarModular": "0" | |||
}, | |||
"name": "金泸商务", | |||
"weappId": "wx649b3be73c1afe47", | |||
"appVersion": "C.test.5.2.0" | |||
"name": "富茂链客生产版", | |||
"weappId": "wx6a2524a8286d687f", | |||
"appVersion": "C.5.1.1" | |||
}, | |||
"debug": false, | |||
"tabBar": { | |||
@@ -66,8 +76,7 @@ | |||
"selectedIconPath": "assets/images/user-a.png" | |||
} | |||
], | |||
"color": "#abb1be", | |||
"selectedColor": "#b2743d" | |||
"custom": true | |||
}, | |||
"window": { | |||
"backgroundTextStyle": "dark", | |||
@@ -81,11 +90,11 @@ | |||
"provider": "wxfab2bf944bfc4da6" | |||
}, | |||
"live-player-plugin": { | |||
"version": "1.3.4", | |||
"version": "1.3.5", | |||
"provider": "wx2b03c6e691cd7370" | |||
} | |||
}, | |||
"extAppid": "wx649b3be73c1afe47", | |||
"extAppid": "wx6a2524a8286d687f", | |||
"extEnable": true, | |||
"permission": { | |||
"scope.userLocation": { | |||
@@ -571,7 +571,8 @@ Page({ | |||
console.log(res) | |||
if (res.code == 200 && res.data.html) { | |||
this.setData({ | |||
curHtml: decodeURI(res.data.html) | |||
curHtml: decodeURI(res.data.html), | |||
type: res.data.type | |||
}) | |||
app.globalData.curHtml = this.data.curHtml; | |||
console.log(app.globalData.curHtml) | |||
@@ -29,25 +29,26 @@ Page({ | |||
}, | |||
createDate: "", | |||
expiredTime: "", | |||
validStartDate:"", | |||
validEndDate:"", | |||
validStartDate: "", | |||
validEndDate: "", | |||
updateDate: "", | |||
//存储计时器 | |||
setInter: "", | |||
staticGamedata: {}, | |||
showIf: false, | |||
curHtml: '', | |||
showhieRq:false, | |||
dynamicRq:"", | |||
expiredSeconds:0, | |||
templTiem:"" | |||
showhieRq: false, | |||
dynamicRq: "", | |||
expiredSeconds: 0, | |||
templTiem: "", | |||
mallList: [] | |||
}, | |||
onUnload:function(){ | |||
onUnload: function () { | |||
let that = this; | |||
clearInterval(that.data.setInter); | |||
clearInterval(that.data.templTiem); | |||
}, | |||
onHide:function(){ | |||
onHide: function () { | |||
let that = this; | |||
clearInterval(that.data.setInter); | |||
clearInterval(that.data.templTiem); | |||
@@ -92,7 +93,7 @@ Page({ | |||
// }) | |||
// }, 200) | |||
// }, | |||
setRq(){ | |||
setRq() { | |||
let _this = this | |||
_this.setData({ | |||
showhieRq: false, | |||
@@ -113,10 +114,10 @@ Page({ | |||
TYPE: "couponorder", | |||
ID: _this.data.dynamicRq | |||
}) | |||
if (res.data.expiredSeconds==0){ | |||
if (res.data.expiredSeconds == 0) { | |||
} else { | |||
}else{ | |||
let inre = setInterval(() => { | |||
if (_this.data.expiredSeconds > 1) { | |||
_this.setData({ | |||
@@ -137,7 +138,7 @@ Page({ | |||
} | |||
// util.qrcode("qrcode", url, 350, 350); | |||
_this.createQrCode(url, "qrcode", 350, 350); | |||
}).catch(err=>{ | |||
}).catch(err => { | |||
wx.showToast({ | |||
title: err.message, | |||
icon: 'none', | |||
@@ -170,13 +171,14 @@ Page({ | |||
}, | |||
onLoad: function (options) { | |||
console.log(options, 'options'); | |||
let that = this; | |||
that.setData({ | |||
code: options.quancode, | |||
codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14), | |||
couponorderstatus: options.couponorderstatus | |||
}); | |||
if ( | |||
options.quancode && | |||
that.data.couponorderstatus == 0 | |||
@@ -184,6 +186,29 @@ Page({ | |||
//aaa | |||
that.setRq()//动态二维码 //这个方法必须在拿到 options.quancode 后调用 | |||
that.getHtml(options.quancode); | |||
// Http.get({ | |||
// url: config.api.couponMerchant, | |||
// data: { | |||
// couponChannelId: options.quancode | |||
// } | |||
// }).then(res => { | |||
// const keys = Object.keys(res.data) | |||
// const mallList = [] | |||
// keys.forEach(item => { | |||
// const arr = item.split('|') | |||
// const obj = { | |||
// tenantId: arr[0], | |||
// mallName: arr[1], | |||
// merchantVoList: res.data[item], | |||
// expand: true | |||
// } | |||
// mallList.push(obj) | |||
// }) | |||
// this.setData({ | |||
// mallList: mallList | |||
// }) | |||
// console.log(this.data.mallList, 'mallList'); | |||
// }) | |||
} | |||
//获得优惠券的详情 | |||
that.data.setInter = setInterval(function () { | |||
@@ -191,7 +216,7 @@ Page({ | |||
options.quancode && | |||
that.data.couponorderstatus == 0 | |||
) { | |||
Http.get({ | |||
url: config.api.couponOrderDetail, | |||
data: { | |||
@@ -228,7 +253,7 @@ Page({ | |||
pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd hh:mm:ss"), | |||
}) | |||
} | |||
}) | |||
.catch(err => { | |||
wx.showToast({ | |||
@@ -240,7 +265,7 @@ Page({ | |||
}) | |||
} | |||
}, 2000); | |||
/** | |||
* 页面需要初始渲染的效果 | |||
*/ | |||
@@ -248,7 +273,7 @@ Page({ | |||
url: config.api.couponOrderDetail, | |||
data: { | |||
couponOrderId: options.quancode | |||
} | |||
} | |||
}).then(res => { | |||
that.setData({ | |||
couponorderstatus: res.data.couponOrderStatus, | |||
@@ -259,13 +284,13 @@ Page({ | |||
updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"), | |||
createDate: util.formatTime(that.data.data.createDate, "yyyy-MM-dd hh:mm:ss") | |||
}); | |||
if (that.data.data.validStartDate && that.data.data.validEndDate){ | |||
if (that.data.data.validStartDate && that.data.data.validEndDate) { | |||
that.setData({ | |||
validStartDate: util.formatTime(that.data.data.validStartDate, "yyyy-MM-dd hh:mm:ss"), | |||
validEndDate: util.formatTime(that.data.data.validEndDate, "yyyy-MM-dd hh:mm:ss") | |||
}) | |||
} | |||
}) | |||
.catch(err => { | |||
wx.showToast({ | |||
@@ -288,16 +313,17 @@ Page({ | |||
this.setData({ | |||
curHtml: decodeURI(res.data.html) | |||
}) | |||
console.log(this.data.curHtml, 'curhtml'); | |||
} | |||
}) | |||
}, | |||
upDataRq(){ | |||
upDataRq() { | |||
console.log(1123) | |||
}, | |||
createQrCode: function (url, canvasId, cavW, cavH) { | |||
//调用插件中的draw方法,绘制二维码图片 | |||
let that = this; | |||
QR.api.draw(url, canvasId, cavW, cavH, function (res) { | |||
QR.api.draw(url, canvasId, cavW, cavH, function (res) { | |||
that.setData({ | |||
tempFilePath: res | |||
}) | |||
@@ -1,6 +1,7 @@ | |||
{ | |||
"usingComponents": { | |||
"navbar": "../../../components/navbar/navbar", | |||
"store": "../../../components/store/index" | |||
"store": "../../../components/store/index", | |||
"shop": "../../../components/shop/shop" | |||
} | |||
} | |||
} |
@@ -1,6 +1,6 @@ | |||
<navbar home back text="使用优惠券"></navbar> | |||
<view style="height:{{navigationBarHeight}} "></view> | |||
<view class='box' > | |||
<view class='box'> | |||
<view class="container page" wx:if="{{data.merchantVoList}}"> | |||
<view class="coupon_detail clearfix"> | |||
<view class="fl wmfl"> | |||
@@ -51,20 +51,21 @@ | |||
<image class="updataRqCode" mode='widthFix' src="{{upDataRqUrlF}}"></image> | |||
<view class="upDataRq">点一点刷新二维码</view> | |||
</view> | |||
<view class="coedTiem" wx:if="{{!showhieRq&&expiredSeconds>1}}">二维码在 | |||
<text style="color:red">{{expiredSeconds}}s</text> | |||
后失效 | |||
</view> | |||
<view class="coedTiem" wx:if="{{!showhieRq&&expiredSeconds>1}}">二维码在 | |||
<text style="color:red">{{expiredSeconds}}s</text> | |||
后失效 | |||
</view> | |||
<view class="barnum"> | |||
<view class="barnumtext">{{showIdFalg?code:codeS}}</view> | |||
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image> | |||
<view class="barnumtext">{{showIdFalg?code:codeS}}</view> | |||
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image> | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 适用门店 --> | |||
<store merchantVoList="{{data.merchantVoList}}"></store> | |||
<store merchantVoList="{{data.merchantVoList}}"></store> | |||
<!-- <shop wx:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop> --> | |||
<!-- <view class='applyshop'>适用门店</view> | |||
<view class='posi' style='overflow:{{hidden}};height:{{height}}'> | |||
<view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index"> | |||
@@ -121,7 +122,7 @@ | |||
<view wx:if="{{curHtml==''}}"> | |||
<text><text class='spot'></text>{{data.remark}}</text> | |||
</view> | |||
<view wx:if="{{curHtml!=''}}"> | |||
<view wx:if="{{curHtml!==''}}"> | |||
<rich-text nodes="{{curHtml}}"></rich-text> | |||
</view> | |||
</view> | |||
@@ -12,7 +12,7 @@ Page({ | |||
*/ | |||
data: { | |||
mouldType: 0, | |||
mouldConfig:{}, | |||
mouldConfig: {}, | |||
navigationBarHeight, | |||
teljpgUrl: imgurl.teljpg.url, | |||
wmhome: imgurl.wmhome.url, | |||
@@ -32,13 +32,15 @@ Page({ | |||
paramData: null, | |||
showErr: false, | |||
showTime: true, | |||
merchantVoList: [] | |||
}, | |||
merchantVoList: [], | |||
mallList: [] | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function(options) { | |||
onLoad: function (options) { | |||
console.log(options, 'options'); | |||
this.setData({ | |||
mouldType: app.globalData.mouldType, | |||
mouldConfig: app.globalData.mouldConfig, | |||
@@ -107,7 +109,7 @@ Page({ | |||
/** | |||
* 拨打电话 | |||
*/ | |||
phone: function(e) { | |||
phone: function (e) { | |||
let that = this; | |||
wx.makePhoneCall({ | |||
phoneNumber: e.target.dataset.merchantlinkphone | |||
@@ -179,7 +181,7 @@ Page({ | |||
// that.getOneSpell(that.data.couponId) | |||
} | |||
if (that.data.showTime) { | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
total_micro_second -= 1000; | |||
that.countdown(); | |||
}, 1000) | |||
@@ -233,8 +235,31 @@ Page({ | |||
data.validEndDate = utils.formatTime(data.validEndDate, 'yyyy-MM-dd') | |||
that.setData({ | |||
data, | |||
merchantVoList: data.merchantVoList | |||
// merchantVoList: data.merchantVoList | |||
}); | |||
Http.get({ | |||
url: config.api.couponMerchant, | |||
data: { | |||
couponChannelId: couponChannelId | |||
} | |||
}).then(res => { | |||
const keys = Object.keys(res.data) | |||
const mallList = [] | |||
keys.forEach(item => { | |||
const arr = item.split('|') | |||
const obj = { | |||
tenantId: arr[0], | |||
mallName: arr[1], | |||
merchantVoList: res.data[item], | |||
expand: true | |||
} | |||
mallList.push(obj) | |||
}) | |||
this.setData({ | |||
mallList: mallList | |||
}) | |||
console.log(this.data.mallList, 'mallList'); | |||
}) | |||
}); | |||
}, | |||
/** | |||
@@ -244,13 +269,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 +292,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 +319,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 +341,9 @@ Page({ | |||
var that = this; | |||
Http.get({ | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}) | |||
url: config.api.checkPhoneStatus, | |||
data: {} | |||
}) | |||
.then(res => { | |||
/** | |||
* orderSave 下单 | |||
@@ -423,9 +448,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 +463,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 +485,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 +507,7 @@ Page({ | |||
}) | |||
return; | |||
}, | |||
complete: res => {} | |||
complete: res => { } | |||
}); | |||
/// End payment -------- | |||
}) | |||
@@ -505,7 +530,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function() { | |||
onShow: function () { | |||
this.setData({ | |||
mouldType: app.globalData.mouldType, | |||
canSpell: true, | |||
@@ -520,7 +545,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function() { | |||
onHide: function () { | |||
this.setData({ | |||
showTime: false | |||
}) | |||
@@ -529,7 +554,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function() { | |||
onUnload: function () { | |||
this.setData({ | |||
showTime: false | |||
}) | |||
@@ -538,7 +563,7 @@ Page({ | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function() { | |||
onPullDownRefresh: function () { | |||
this.checkUser(this.data.paramData) | |||
} | |||
}) |
@@ -3,6 +3,7 @@ | |||
"enablePullDownRefresh": true, | |||
"usingComponents": { | |||
"navbar": "../../components/navbar/navbar", | |||
"store": "../../../../components/store/index" | |||
"store": "../../../../components/store/index", | |||
"shop": "../../../../components/shop/shop" | |||
} | |||
} |
@@ -1,6 +1,6 @@ | |||
<navbar back home text="拼团券" background='#fff'></navbar> | |||
<view style="height:{{navigationBarHeight}} "></view> | |||
<view class="content-box" > | |||
<view style="height:{{navigationBarHeight}} "></view> | |||
<view class="content-box"> | |||
<view class='content'> | |||
<view class='top-img' style="{{mouldConfig.groupSwiperH}}"> | |||
<image src='{{data.coverImg}}' style="{{mouldConfig.groupSwiperH}}"></image> | |||
@@ -26,42 +26,44 @@ | |||
</view> | |||
<view class='status04 st join-c' style='width:auto;'> | |||
<view class='j-f'>您正在参加 {{nickName}} 的拼团</view> | |||
<view class='j-t'>剩余时间:<view class='j-time'>{{day+' 天 '+hour+' : '+min+' : '+sec}}</view></view> | |||
<view class='j-t'>剩余时间:<view class='j-time'>{{day+' 天 '+hour+' : '+min+' : '+sec}}</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<!-- 适用门店 --> | |||
<store wx:if="{{merchantVoList.length>0}}" merchantVoList="{{merchantVoList}}"></store> | |||
<!-- <store wx:if="{{merchantVoList.length>0}}" merchantVoList="{{merchantVoList}}"></store> --> | |||
<shop wx:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop> | |||
<view class='text'> | |||
<view class='p-des'> | |||
<view class='p-title'>购买须知:</view> | |||
<view class='p-list'>{{data.remark}}</view> | |||
</view> | |||
<view class='edit'> | |||
<button class='goback' bindtap='gotoIndex'> | |||
<image src='{{homeSelectedO}}' mode="widthFix"></image> | |||
<text class='btnTxt'>首页</text> | |||
<button class='goback' bindtap='gotoIndex'> | |||
<image src='{{homeSelectedO}}' mode="widthFix"></image> | |||
<text class='btnTxt'>首页</text> | |||
</button> | |||
<form bindsubmit='{{canBuyIf?"gotoBuy":""}}' report-submit='true' wx:if='{{data.id}}'> | |||
<button form-type="submit" class='edit-left'> | |||
<view class='edit-left-top'> | |||
<view class='price'>{{data.price}}</view> | |||
<view class='price-unit'>元</view> | |||
</view> | |||
<view class='edit-left-bottom'>立即购买</view> | |||
</button> | |||
<form bindsubmit='{{canBuyIf?"gotoBuy":""}}' report-submit='true' wx:if='{{data.id}}'> | |||
<button form-type="submit" class='edit-left'> | |||
<view class='edit-left-top'> | |||
<view class='price'>{{data.price}}</view> | |||
<view class='price-unit'>元</view> | |||
</view> | |||
<view class='edit-left-bottom'>立即购买</view> | |||
</button> | |||
</form> | |||
<!-- <button class='edit-right' id="shareBtn" open-type="share"></button> --> | |||
<form bindsubmit='{{canSpell?"gotoSpell":""}}' report-submit='true' wx:if='{{data.id}}'> | |||
<button class='edit-right' form-type="submit" > | |||
<view class='edit-left-top'> | |||
<view class='price'>{{data.salePrice}}</view> | |||
<view class='price-unit'>元</view> | |||
</view> | |||
<view class='edit-left-bottom'>参加拼团</view> | |||
</button> | |||
</form> | |||
</view> | |||
</form> | |||
<!-- <button class='edit-right' id="shareBtn" open-type="share"></button> --> | |||
<form bindsubmit='{{canSpell?"gotoSpell":""}}' report-submit='true' wx:if='{{data.id}}'> | |||
<button class='edit-right' form-type="submit"> | |||
<view class='edit-left-top'> | |||
<view class='price'>{{data.salePrice}}</view> | |||
<view class='price-unit'>元</view> | |||
</view> | |||
<view class='edit-left-bottom'>参加拼团</view> | |||
</button> | |||
</form> | |||
</view> | |||
</view> | |||
</view> | |||
<view class='al-bg' wx:if='{{showErr}}'></view> | |||
@@ -7,7 +7,7 @@ const imgurl = require("../../../utils/imgurl"); | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
*/ | |||
data: { | |||
showIdFalg: false, | |||
showFlag: false, | |||
@@ -34,6 +34,7 @@ Page({ | |||
cardIf: false, | |||
contentType: 0, | |||
orderFlag: false, //判断是不是线上配送 | |||
mallList: [] | |||
}, | |||
showId() { | |||
let this_ = this; | |||
@@ -61,7 +62,7 @@ Page({ | |||
let code = e.currentTarget.dataset.text | |||
wx.setClipboardData({ | |||
data: code, | |||
success: function() { | |||
success: function () { | |||
wx.showToast({ | |||
title: '复制成功', | |||
icon: "none" | |||
@@ -105,58 +106,81 @@ Page({ | |||
// } | |||
Http.get({ | |||
url: url, | |||
url: url, | |||
data: { | |||
orderId: this.data.orderId | |||
} | |||
}).then(res => { | |||
wx.hideLoading(); | |||
// if (res.data.level == 0) { //单券 | |||
// if (res.code == 200) { | |||
// that.getUserInfo() | |||
// that.setData({ | |||
// showPage: true, | |||
// composeOrderType: res.data.composeOrderType | |||
// }) | |||
// } | |||
// let tempData = res.data | |||
// if (tempData.deliveryInfo) tempData.deliveryInfo = JSON.parse(tempData.deliveryInfo) | |||
// that.setData({ | |||
// order: res.data, | |||
// supportTransfer: res.data.supportTransfer | |||
// }); | |||
// that.getStaticGame() | |||
// //createDate 创建时间 | |||
// var createDate = util.formatTime(res.data.createDate, "yyyy-MM-dd hh:mm:ss"); | |||
// that.setData({ | |||
// createDate: createDate | |||
// }); | |||
// } else { | |||
// if (that.data.orderFlag) { | |||
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.couponOrderIdS = tempData.couponOrderIdS ? tempData.couponOrderId.slice(0, 4) + `******` + tempData.couponOrderId.slice(14) : '' | |||
that.setData({ | |||
order: tempData, | |||
showPage: true, | |||
createDate: createDate, | |||
composeOrderType: tempData.composeOrderType | |||
}) | |||
console.log(that.data.order) | |||
Http.get({ | |||
url: config.api.couponMerchant, | |||
data: { | |||
orderId: this.data.orderId | |||
couponChannelId: that.data.order.couponChannelId | |||
} | |||
}).then(res => { | |||
wx.hideLoading(); | |||
// if (res.data.level == 0) { //单券 | |||
// if (res.code == 200) { | |||
// that.getUserInfo() | |||
// that.setData({ | |||
// showPage: true, | |||
// composeOrderType: res.data.composeOrderType | |||
// }) | |||
// } | |||
// let tempData = res.data | |||
// if (tempData.deliveryInfo) tempData.deliveryInfo = JSON.parse(tempData.deliveryInfo) | |||
// that.setData({ | |||
// order: res.data, | |||
// supportTransfer: res.data.supportTransfer | |||
// }); | |||
// that.getStaticGame() | |||
// //createDate 创建时间 | |||
// var createDate = util.formatTime(res.data.createDate, "yyyy-MM-dd hh:mm:ss"); | |||
// that.setData({ | |||
// createDate: createDate | |||
// }); | |||
// } else { | |||
// if (that.data.orderFlag) { | |||
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.couponOrderIdS = tempData.couponOrderIdS? tempData.couponOrderId.slice(0, 4) + `******` + tempData.couponOrderId.slice(14):'' | |||
that.setData({ | |||
order: tempData, | |||
showPage: true, | |||
createDate: createDate, | |||
composeOrderType: tempData.composeOrderType | |||
}) | |||
console.log(that.data.order) | |||
// } | |||
// } | |||
const keys = Object.keys(res.data) | |||
const mallList = [] | |||
keys.forEach(item => { | |||
const arr = item.split('|') | |||
const obj = { | |||
tenantId: arr[0], | |||
mallName: arr[1], | |||
merchantVoList: res.data[item], | |||
expand: true | |||
} | |||
mallList.push(obj) | |||
}) | |||
this.setData({ | |||
mallList: mallList | |||
}) | |||
console.log(this.data.mallList, 'mallList'); | |||
}) | |||
// } | |||
// } | |||
}) | |||
}) | |||
.catch(error => { | |||
wx.hideLoading(); | |||
wx.showModal({ | |||
title: '提示', | |||
content: error.message ? error.message:error.data, | |||
content: error.message ? error.message : error.data, | |||
showCancel: false | |||
}) | |||
}) | |||
@@ -182,7 +206,7 @@ Page({ | |||
}) | |||
}) | |||
}, | |||
phone: function(e) { | |||
phone: function (e) { | |||
let that = this; | |||
console.log(e); | |||
wx.makePhoneCall({ | |||
@@ -197,13 +221,13 @@ Page({ | |||
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}` | |||
}) | |||
}, | |||
getUserInfo: function() { | |||
getUserInfo: function () { | |||
let that = this; | |||
// 获取用户信息 | |||
Http.get({ | |||
url: config.api.getScore, | |||
data: {} | |||
}) | |||
url: config.api.getScore, | |||
data: {} | |||
}) | |||
.then(res => { | |||
console.log(res) | |||
that.setData({ | |||
@@ -212,7 +236,7 @@ Page({ | |||
}) | |||
}) | |||
}, | |||
onShareAppMessage: function(res) { | |||
onShareAppMessage: function (res) { | |||
app.globalData.previewFlag = true | |||
if (res.from === 'button') { | |||
console.log(res, 3333333333333333333333) | |||
@@ -222,10 +246,10 @@ Page({ | |||
title: _this.data.userName + '赠送您一张' + _this.data.order.title, | |||
path: '/pages/index/index?couponChannelId=' + this.data.order.couponChannelId + '&cuserId=' + this.data.order.cuserId + '&couponId=' + this.data.order.productId + '&coverImg=' + this.data.order.coverImg + '&userName=' + this.data.userName + '&avatarUrl=' + this.data.avatarUrl + '&couponOrderId=' + this.data.order.couponOrderId + '&updateDate=' + this.data.order.updateDate, | |||
imageUrl: this.data.order.coverImg, | |||
success: function(res) { | |||
success: function (res) { | |||
// 转发成功 | |||
}, | |||
fail: function(res) { | |||
fail: function (res) { | |||
// 转发失败 | |||
} | |||
} | |||
@@ -235,7 +259,7 @@ Page({ | |||
}, | |||
powerDrawer: function(e) { | |||
powerDrawer: function (e) { | |||
let that = this; | |||
console.log(e) | |||
// couponOrderStatus | |||
@@ -245,34 +269,28 @@ Page({ | |||
// 3 已经退款 | |||
if (that.data.mystatus == "" || that.data.mystatus == undefined) { | |||
wx.navigateTo({ | |||
url: `/pages/orderquanma/index?quancode=${ | |||
e.currentTarget.dataset.quancode | |||
}&title=${e.currentTarget.dataset.title}&subtitle=${ | |||
e.currentTarget.dataset.subtitle | |||
}&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ | |||
e.currentTarget.dataset.couponorderstatus}&validstatus=${e.currentTarget.dataset.validstatus} | |||
url: `/pages/orderquanma/index?quancode=${e.currentTarget.dataset.quancode | |||
}&title=${e.currentTarget.dataset.title}&subtitle=${e.currentTarget.dataset.subtitle | |||
}&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${e.currentTarget.dataset.couponorderstatus}&validstatus=${e.currentTarget.dataset.validstatus} | |||
&contentType=${that.data.contentType}` | |||
}); | |||
} else { | |||
wx.navigateTo({ | |||
url: `/pages/orderquanma/index?quancode=${ | |||
e.currentTarget.dataset.quancode | |||
}&title=${e.currentTarget.dataset.title}&subtitle=${ | |||
e.currentTarget.dataset.subtitle | |||
}&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ | |||
that.data.mystatus}&validstatus=${e.currentTarget.dataset.validstatus} | |||
url: `/pages/orderquanma/index?quancode=${e.currentTarget.dataset.quancode | |||
}&title=${e.currentTarget.dataset.title}&subtitle=${e.currentTarget.dataset.subtitle | |||
}&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${that.data.mystatus}&validstatus=${e.currentTarget.dataset.validstatus} | |||
&contentType=${that.data.contentType}` | |||
}); | |||
} | |||
}, | |||
gotogame: function() { | |||
gotogame: function () { | |||
let that = this; | |||
wx.redirectTo({ | |||
url: '/pages/game/index?url=' + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||
}) | |||
}, | |||
// 买完卡跳转到立即使用页面 | |||
gotoUse: function() { | |||
gotoUse: function () { | |||
wx.navigateTo({ | |||
url: '/pages/cardorder/index/index' | |||
}) | |||
@@ -281,20 +299,20 @@ Page({ | |||
getStaticGame(token) { | |||
let _this = this; | |||
Http.get({ | |||
url: config.api.getGame, | |||
data: { | |||
triggleAction: 3 // 购买触发 | |||
} | |||
}).then(res => { | |||
if (res.data.id) { | |||
_this.setData({ | |||
showIf: true | |||
}) | |||
} | |||
url: config.api.getGame, | |||
data: { | |||
triggleAction: 3 // 购买触发 | |||
} | |||
}).then(res => { | |||
if (res.data.id) { | |||
_this.setData({ | |||
staticGamedata: res.data | |||
showIf: true | |||
}) | |||
} | |||
_this.setData({ | |||
staticGamedata: res.data | |||
}) | |||
}) | |||
.catch(err => { | |||
console.log(err); | |||
}) | |||
@@ -306,7 +324,7 @@ Page({ | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function(options) { | |||
onLoad: function (options) { | |||
let that = this; | |||
if (options.dingdan && options.dingdan == "order") { | |||
@@ -332,7 +350,7 @@ Page({ | |||
that.updetail() | |||
}, | |||
onShow: function() { | |||
onShow: function () { | |||
let that = this; | |||
that.setData({ | |||
showButton: false | |||
@@ -345,13 +363,13 @@ Page({ | |||
let that = this; | |||
// 支付成功 | |||
Http.post({ | |||
url: config.api.toOrderGroup, | |||
data: { | |||
id: orderGroupId, | |||
orderId, | |||
couponId: _this.data.order.productId | |||
} | |||
}) | |||
url: config.api.toOrderGroup, | |||
data: { | |||
id: orderGroupId, | |||
orderId, | |||
couponId: _this.data.order.productId | |||
} | |||
}) | |||
.then(res => { | |||
wx.redirectTo({ | |||
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.order.productId}&orderGroupId=${res.data.orderGroupId}` | |||
@@ -396,7 +414,7 @@ Page({ | |||
wx.showLoading({ | |||
title: '订单正在处理中...', | |||
}) | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
wx.hideLoading() | |||
}, 5000) | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that); // 支付成功 | |||
@@ -460,14 +478,14 @@ Page({ | |||
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this) => { | |||
// 支付成功 | |||
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(); | |||
_this.setData({ | |||
@@ -479,11 +497,11 @@ Page({ | |||
duration: 2000, | |||
image: imgurl.success.url, | |||
mask: false, | |||
success: function() { | |||
success: function () { | |||
wx.showLoading({ | |||
title: "加载中..." | |||
}); | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
wx.hideLoading(); | |||
}, 1600); | |||
setTimeout(() => { | |||
@@ -510,7 +528,7 @@ Page({ | |||
.catch(err => { | |||
console.log(err) | |||
if (!type) { | |||
setTimeout(function() { | |||
setTimeout(function () { | |||
_this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this); | |||
}, 1500) | |||
} | |||
@@ -1,6 +1,7 @@ | |||
{ | |||
"usingComponents": { | |||
"navbar": "../../../components/navbar/navbar", | |||
"store": "../../../components/store/index" | |||
} | |||
} | |||
"usingComponents": { | |||
"navbar": "../../../components/navbar/navbar", | |||
"store": "../../../components/store/index", | |||
"shop": "../../../components/shop/shop" | |||
} | |||
} |
@@ -25,7 +25,8 @@ | |||
<text>{{order.subTitle}}</text> | |||
</view> | |||
<view> | |||
<text>下单时间:</text>{{createDate}}</view> | |||
<text>下单时间:</text>{{createDate}} | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
@@ -43,8 +44,7 @@ | |||
只有支付完成的时 | |||
才显示兑换码 | |||
--> | |||
<view wx:if="{{order.orderStatus==1&&order.type!=100&&order.type!=5&&order.type!=51}}" data-couponOrderStatus="{{order.couponOrderStatus}}" data-title="{{order.title}}" data-subtitle="{{order.subTitle}}" data-remark="{{order.remark}}" data-quancode="{{order.couponOrderId}}" | |||
data-validstatus="{{order.validStatus}}" bindtap="powerDrawer" class='dhCode'> | |||
<view wx:if="{{order.orderStatus==1&&order.type!=100&&order.type!=5&&order.type!=51}}" data-couponOrderStatus="{{order.couponOrderStatus}}" data-title="{{order.title}}" data-subtitle="{{order.subTitle}}" data-remark="{{order.remark}}" data-quancode="{{order.couponOrderId}}" data-validstatus="{{order.validStatus}}" bindtap="powerDrawer" class='dhCode'> | |||
<view style="width:86%;clear: both;"> | |||
<text class="fl">兑换码:</text> | |||
<text class="fr" wx:if="{{order.validStatus!=0}}">{{showIdFalg?order.couponOrderId:order.couponOrderIdS}}</text> | |||
@@ -73,9 +73,9 @@ | |||
</view> | |||
<view class='wuliu' wx:if="{{order.shippingType==2&&order.deliveryInfo}}"> | |||
<text class='left'>快递单号:</text> | |||
<view class="left">{{order.deliveryInfo.expressageIdInput}}</view> | |||
<view class="copeCode" bindtap="copeCode" data-text="{{order.deliveryInfo.expressageIdInput}}">复制</view> | |||
<text class="goInquire" bindtap="gokuaidi" data-nu="{{order.deliveryInfo.expressageIdInput}}">查询物流</text> | |||
</view> | |||
@@ -95,14 +95,15 @@ | |||
</view> | |||
</view> | |||
<!-- 适用门店 --> | |||
<store merchantVoList="{{order.merchantVoList}}" wx:if="{{order.type!=12}}"></store> | |||
<!-- <store merchantVoList="{{order.merchantVoList}}" wx:if="{{order.type!=12}}"></store> --> | |||
<shop wx:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop> | |||
<!-- 子券列表 --> | |||
<view class="childList" wx:if="{{order.type==12}}"> | |||
<view class="childTitle">礼券:</view> | |||
<view class="childItme" wx:for="{{order.giftCouponList}}" wx:key="{{item}}"> | |||
<view class="chaildDetBox"> | |||
<image mode='aspectFill' class="chaildImg" src="{{item.coverImg}}"></image> | |||
<image mode='aspectFill' class="chaildImg" src="{{item.coverImg}}"></image> | |||
<view class="childDataBox"> | |||
<view class="orderName">{{item.title}}</view> | |||
<view class="childPriceStr">面额:{{item.priceStr}}元</view> | |||
@@ -120,11 +121,12 @@ | |||
</view> | |||
</view> | |||
<button type="primary" open-type="share" wx:if="{{order.type == 100 && supportTransfer==1&&cardIf}}" class='support-tansfer'> | |||
<image src="{{weixinTitle}}" class='share' mode="widthFix"></image>转赠给微信好友</button> | |||
<image src="{{weixinTitle}}" class='share' mode="widthFix"></image>转赠给微信好友 | |||
</button> | |||
<view class="sign" wx:if="{{order.couponOrderStatus == 0 &&order.type == 11 && order.shippingType == 2 && order.shippingStatus== 24}}" bindtap="setShow">签收</view> | |||
</view> | |||
<view class="showT" wx:if="{{showFlag}}" bindtap="hieShow"> | |||
<view class="titleBxo" > | |||
<view class="titleBxo"> | |||
<view class="text">是否确认收到商品?</view> | |||
<view class="p">签收后将完成订单</view> | |||
<view class="btnBox"> | |||
@@ -408,8 +408,9 @@ Page({ | |||
//参与别人的拼团 | |||
gotoPartner() { | |||
console.log(this.data.spellData.nickName, 'nickname'); | |||
wx.navigateTo({ | |||
url: `/pages/joinFrDpell/index?orderId=${this.data.spellData.orderId}&couponId=${this.data.spellData.couponId}&orderGroupId=${this.data.spellData.orderGroupId}&couponChannelId=${this.data.couponChannelId}&avatarUrl=${this.data.spellData.avatarUrl}&nickName=${this.data.spellData.nickName}` | |||
url: `/pages/joinFrDpell/index?orderId=${this.data.spellData.orderId}&couponId=${this.data.spellData.couponId}&orderGroupId=${this.data.spellData.orderGroupId}&nickName=${this.data.spellData.nickName}&couponChannelId=${this.data.couponChannelId}&avatarUrl=${this.data.spellData.avatarUrl}` | |||
}); | |||
}, | |||
/** | |||
@@ -474,10 +475,10 @@ Page({ | |||
data.salePrice = (data.salePrice / 100).toFixed(2); | |||
data.validStartDate = utils.formatTime(data.validStartDate, 'yyyy-MM-dd') | |||
data.validEndDate = utils.formatTime(data.validEndDate, 'yyyy-MM-dd') | |||
// that.setData({ | |||
// data, | |||
// merchantVoList: data.merchantVoList | |||
// }); | |||
that.setData({ | |||
data, | |||
// merchantVoList: data.merchantVoList | |||
}); | |||
Http.get({ | |||
url: config.api.couponMerchant, | |||
data: { | |||
@@ -1,9 +1,12 @@ | |||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | |||
console.log(extConfig, 'extConfig'); | |||
let ifStoreApp = extConfig.attr.ifStoreApp; | |||
let businessSwitch = 1 * extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false | |||
console.log(businessSwitch, 'businessSwitch'); | |||
// 无商圈注释 | |||
const myPluginInterface = requirePlugin('auto-points-plugin') | |||
let businessVersion = 1 * extConfig.attr.businessVersion | |||
let businessSwitch = 1 * extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false | |||
let mch_id = extConfig.attr.mchId | |||
const navigationBarHeight = (getApp().statusBarHeight + 44) + "px" | |||
const Http = require("../../../utils/HttpBasics"); | |||
@@ -12,7 +15,6 @@ 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') || '' | |||
let app = getApp(); | |||
Page({ | |||
data: { | |||
@@ -34,7 +34,7 @@ | |||
}, | |||
"compileType": "miniprogram", | |||
"libVersion": "2.11.2", | |||
"appid": "wxfa336cad86ed598d", | |||
"appid": "wx453ae0d37f3550d0", | |||
"projectname": "C", | |||
"simulatorType": "wechat", | |||
"simulatorPluginLibVersion": {}, | |||
@@ -3,7 +3,9 @@ | |||
"projectname": "C", | |||
"setting": { | |||
"compileHotReLoad": true, | |||
"urlCheck": true | |||
"urlCheck": true, | |||
"preloadBackgroundData": false, | |||
"useIsolateContext": true | |||
}, | |||
"libVersion": "2.27.1" | |||
"libVersion": "2.28.1" | |||
} |