@@ -1,10 +1,15 @@ | |||||
let config = require("./config/config.js"); | let config = require("./config/config.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; | |||||
let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch:false | |||||
App({ | App({ | ||||
data: { | data: { | ||||
newArr:[],//存放分享二维进入消息信息 | newArr:[],//存放分享二维进入消息信息 | ||||
businessSwitch: businessSwitch,//判断是否开启商圈自助积分 | |||||
}, | }, | ||||
onLaunch: function(options) { | onLaunch: function(options) { | ||||
// wx.hideTabBar() | // wx.hideTabBar() | ||||
var that = this; | var that = this; | ||||
@@ -15,7 +20,7 @@ App({ | |||||
if (options.query.scene) { | if (options.query.scene) { | ||||
that.globalData.newArr = decodeURIComponent(options.query.scene).split(":"); | that.globalData.newArr = decodeURIComponent(options.query.scene).split(":"); | ||||
} | } | ||||
that.globalData.sceneAddress = options.scene; | |||||
that.globalData.sceneAddress = options.scene | |||||
/** | /** | ||||
* 小程序版本更新 | * 小程序版本更新 | ||||
*/ | */ | ||||
@@ -29,11 +34,34 @@ App({ | |||||
that.statusBarHeight = res.statusBarHeight | that.statusBarHeight = res.statusBarHeight | ||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
onShow:function(options){ | onShow:function(options){ | ||||
console.log("onshow被调用了!") | |||||
//自助积分 需要openId 且必须写在onshow里面 | |||||
let _this = this | |||||
wx.login({ | |||||
success:(res)=>{ | |||||
console.log('我是onshow') | |||||
if (res.code){ | |||||
let usrdata = { | |||||
appId: config.weapp.AppId, | |||||
code: res.code, | |||||
} | |||||
Http.post({ | |||||
url: config.api.login, | |||||
data: usrdata | |||||
}).then(res=>{ | |||||
if (_this.data.businessSwitch) { | |||||
myPluginInterface.getLocation(res.data.openId).then(res => { | |||||
console.log(res, "我是地理位置") | |||||
}) | |||||
} | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
}, | }, | ||||
statusBarHeight: 0, | statusBarHeight: 0, | ||||
/** | /** | ||||
@@ -62,7 +90,8 @@ App({ | |||||
data: usrdata | data: usrdata | ||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
wx.setStorageSync('openId',res.data.openId) | |||||
wx.setStorageSync('0',res.data.openId) | |||||
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) | ||||
@@ -2,33 +2,44 @@ | |||||
"ext": { | "ext": { | ||||
"attr": { | "attr": { | ||||
"car": { | "car": { | ||||
"tjd": { | |||||
"payPath": "", | |||||
"tjdAppId": "wx6945d1bda68d7993" | |||||
}, | |||||
"etcp": { | "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": [ | "imgProxy": [ | ||||
{ | { | ||||
"newUrl": "https://ctest.malls.iformall.com/img", | |||||
"newUrl": "https://c.malls.iformall.com/img", | |||||
"orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" | "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" | "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" | "orgUrl": "https://wx.qlogo.cn" | ||||
} | } | ||||
], | ], | ||||
"configUrl": "https://ctest.malls.iformall.com/C/api", | |||||
"configUrl": "https://c.malls.iformall.com/C/api", | |||||
"ifStoreApp": "0", | |||||
"ifHaveWebSocket": "0", | "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, | "debug": false, | ||||
"tabBar": { | "tabBar": { | ||||
@@ -58,8 +69,7 @@ | |||||
"selectedIconPath": "assets/images/user-a.png" | "selectedIconPath": "assets/images/user-a.png" | ||||
} | } | ||||
], | ], | ||||
"color": "#abb1be", | |||||
"selectedColor": "#b2743d" | |||||
"custom": true | |||||
}, | }, | ||||
"window": { | "window": { | ||||
"backgroundTextStyle": "dark", | "backgroundTextStyle": "dark", | ||||
@@ -73,7 +83,7 @@ | |||||
"provider": "wx2b03c6e691cd7370" | "provider": "wx2b03c6e691cd7370" | ||||
} | } | ||||
}, | }, | ||||
"extAppid": "wx649b3be73c1afe47", | |||||
"extAppid": "wx6a2524a8286d687f", | |||||
"extEnable": true, | "extEnable": true, | ||||
"permission": { | "permission": { | ||||
"scope.userLocation": { | "scope.userLocation": { | ||||
@@ -1,5 +1,7 @@ | |||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | ||||
let ifStoreApp = extConfig.attr.ifStoreApp; | let ifStoreApp = extConfig.attr.ifStoreApp; | ||||
let businessSwitch = extConfig.attr.businessSwitch | |||||
let mch_id = extConfig.attr.mchId | |||||
const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" | const navigationBarHeight = (getApp().statusBarHeight + 44)+"px" | ||||
const Http = require("../utils/HttpBasics"); | const Http = require("../utils/HttpBasics"); | ||||
const imgurl = require("../utils/imgurl"); | const imgurl = require("../utils/imgurl"); | ||||
@@ -10,6 +12,10 @@ const bgColor = require("../utils/bgColor.js") | |||||
let app = getApp(); | let app = getApp(); | ||||
Page({ | Page({ | ||||
data: { | data: { | ||||
mch_id: mch_id, | |||||
goUrl:"",//商圈跳转链接 | |||||
accreditFlag:1,//1是未授权微信且未授权手机号 2授权了微信 没授权手机号 3微信和手机号都授权了 | |||||
businessSwitch: businessSwitch, | |||||
typeLsit:{}, | typeLsit:{}, | ||||
showLocationIf: true, | showLocationIf: true, | ||||
ifStoreApp: ifStoreApp, | ifStoreApp: ifStoreApp, | ||||
@@ -87,6 +93,50 @@ Page({ | |||||
isShowSqare: false, | isShowSqare: false, | ||||
}, | }, | ||||
//判断用户是否授权 | |||||
uesrInfo(){ | |||||
Http.get({ | |||||
url: config.api.checkUserStatus, | |||||
data: { | |||||
token: app.globalData.token | |||||
} | |||||
}).then(res => { | |||||
Http.get({ | |||||
url: config.api.checkPhoneStatus | |||||
}).then(res=>{//全部授权 | |||||
this.setData({ | |||||
accreditFlag: 3 | |||||
}) | |||||
}).catch(err => { | |||||
if(err.code==11005){//未授权手机号 | |||||
this.setData({ | |||||
accreditFlag: 2 | |||||
}) | |||||
}else{ | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} | |||||
}) | |||||
}).catch (err => { | |||||
if(err.code==11004){//未授权微信 | |||||
this.setData({ | |||||
accreditFlag:1 | |||||
}) | |||||
}else{ | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} | |||||
}) | |||||
}, | |||||
//获取当前广场名 | //获取当前广场名 | ||||
//跳转到每日签到 | //跳转到每日签到 | ||||
goSign(){ | goSign(){ | ||||
@@ -265,11 +315,6 @@ Page({ | |||||
let optionss; | let optionss; | ||||
let openId = wx.getStorageSync('openId') | let openId = wx.getStorageSync('openId') | ||||
if (openId) { | |||||
that.setData({ | |||||
openId: openId | |||||
}) | |||||
} | |||||
if (wx.getStorageSync('options')) { | if (wx.getStorageSync('options')) { | ||||
optionss = JSON.parse(wx.getStorageSync('options')); | optionss = JSON.parse(wx.getStorageSync('options')); | ||||
} | } | ||||
@@ -289,6 +334,7 @@ Page({ | |||||
//获取条形码 | //获取条形码 | ||||
// util.barcode("barcode", optionss.quancode, 510, 100); | // util.barcode("barcode", optionss.quancode, 510, 100); | ||||
// console.log(Http.headers.token, "?") | // console.log(Http.headers.token, "?") | ||||
}, | }, | ||||
/** | /** | ||||
* 获得经纬度 | * 获得经纬度 | ||||
@@ -352,6 +398,13 @@ Page({ | |||||
}, | }, | ||||
onShow: function() { | onShow: function() { | ||||
if (businessSwitch) { | |||||
let openId = wx.getStorageSync("0") | |||||
this.setData({ | |||||
goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}` | |||||
}) | |||||
} | |||||
this.uesrInfo() | |||||
if(JSON.stringify(app.globalData.styleLsit)!="{}"){ | if(JSON.stringify(app.globalData.styleLsit)!="{}"){ | ||||
this.setTabStyle() | this.setTabStyle() | ||||
} | } | ||||
@@ -149,4 +149,18 @@ | |||||
<view class='signin' wx:if="{{fistLogin}}" animation="{{alphaData}}"> | <view class='signin' wx:if="{{fistLogin}}" animation="{{alphaData}}"> | ||||
<open-data class="open" type="userAvatarUrl"></open-data> | <open-data class="open" type="userAvatarUrl"></open-data> | ||||
<text class='text'>您今日签到成功,获得{{fistLogin}}成长值</text> | <text class='text'>您今日签到成功,获得{{fistLogin}}成长值</text> | ||||
</view> | |||||
</view> | |||||
<view class="integralBox" wx:if="{{businessSwitch}}"> | |||||
<!--是未授权微信且未授权手机号 --> | |||||
<navigator url="/pages/getuserinfo/index" open-type="navigate" wx:if="{{accreditFlag==1}}"> | |||||
<image src='https://formall.oss-accelerate.aliyuncs.com/cimg/self-help-integral.png' mode='widthFix' style="width: 100%;height: 100%;"></image> | |||||
</navigator> | |||||
<!-- 授权了微信 没授权手机号 --> | |||||
<navigator url="/pages/getuserinfo/index" open-type="navigate" wx:if="{{accreditFlag==2}}"> | |||||
<image src='https://formall.oss-accelerate.aliyuncs.com/cimg/self-help-integral.png' mode='widthFix' style="width: 100%;height: 100%;"></image> | |||||
</navigator> | |||||
<!-- 微信和手机号都授权了 跳转到商圈--> | |||||
<navigator url="{{goUrl}}" wx:if="{{accreditFlag==3}}"> | |||||
<image src='https://formall.oss-accelerate.aliyuncs.com/cimg/self-help-integral.png' mode='widthFix' style="width: 100%;height: 100%;"></image> | |||||
</navigator> | |||||
</view> |
@@ -590,3 +590,11 @@ i-tabs i-tabs-scroll{ | |||||
background: #F4F5F9!important; | background: #F4F5F9!important; | ||||
} | } | ||||
.integralBox{ | |||||
width: 110rpx; | |||||
height: 110rpx; | |||||
bottom: 500rpx; | |||||
right: 20rpx; | |||||
position: fixed; | |||||
z-index: 1000000 | |||||
} |
@@ -69,23 +69,25 @@ Page({ | |||||
* 选择使用的优惠券 | * 选择使用的优惠券 | ||||
*/ | */ | ||||
choicecoupon: function(e) { | choicecoupon: function(e) { | ||||
/* wx.navigateBack(); | |||||
var pages = getCurrentPages(); | |||||
var prevPage = pages[pages.length - 2] //上一个页面 */ | |||||
var that = this; | var that = this; | ||||
var quantitle = e.currentTarget.dataset.title; | |||||
var quanid = e.currentTarget.dataset.id; | |||||
this.setData({ | |||||
quantitle: quantitle, | |||||
quanid: quanid, | |||||
showTicketModal: false, | |||||
}); | |||||
that.bindCoupon(that.data.quanid); | |||||
/* wx.setStorage({ | |||||
key: 'chosed', | |||||
data: 'chosed', | |||||
}) */ | |||||
wx.showModal({ | |||||
title: '确定是否使用停车券', | |||||
content: '使用后无法撤销', | |||||
success(res) { | |||||
if (res.confirm) { | |||||
var quantitle = e.currentTarget.dataset.title; | |||||
var quanid = e.currentTarget.dataset.id; | |||||
that.setData({ | |||||
quanid: quanid, | |||||
showTicketModal: false, | |||||
}); | |||||
that.bindCoupon(that.data.quanid, quantitle); | |||||
} else if (res.cancel) { | |||||
console.log('用户点击取消') | |||||
} | |||||
} | |||||
}) | |||||
}, | }, | ||||
/* | /* | ||||
*/ | */ | ||||
@@ -453,7 +455,7 @@ Page({ | |||||
/** | /** | ||||
* 券绑定车牌 | * 券绑定车牌 | ||||
*/ | */ | ||||
bindCoupon: function (quanid) { | |||||
bindCoupon: function (quanid,quantitle) { | |||||
var that = this; | var that = this; | ||||
/** | /** | ||||
* etcp | * etcp | ||||
@@ -498,10 +500,24 @@ Page({ | |||||
data: postCouponData | data: postCouponData | ||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
that.getStopFee(that.data.listCardNum); | |||||
that.initUsrCarList(); | |||||
// if(res.data){ | |||||
that.getStopFee(that.data.listCardNum); | |||||
that.initUsrCarList(); | |||||
that.setData({ | |||||
quantitle: quantitle,//接口条用成功后在赋值 | |||||
}) | |||||
// }else{ | |||||
// wx.showToast({ | |||||
// title: res.message, | |||||
// icon: 'none', | |||||
// duration: 3000, | |||||
// mask: false | |||||
// }); | |||||
// } | |||||
}) | }) | ||||
.catch(err => { | .catch(err => { | ||||
if (err.message!=undefined) { | if (err.message!=undefined) { | ||||
wx.showToast({ | wx.showToast({ | ||||
title: err.message, | title: err.message, | ||||
@@ -1,6 +1,8 @@ | |||||
var app = getApp(); | var app = getApp(); | ||||
const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' | ||||
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | ||||
let businessSwitch = extConfig.attr.businessSwitch | |||||
let mch_id = extConfig.attr.mchId | |||||
let ifStoreApp = extConfig.attr.ifStoreApp; | let ifStoreApp = extConfig.attr.ifStoreApp; | ||||
const Http = require("../utils/HttpBasics"); | const Http = require("../utils/HttpBasics"); | ||||
const imgurl = require("../utils/imgurl"); | const imgurl = require("../utils/imgurl"); | ||||
@@ -11,6 +13,10 @@ Page({ | |||||
* 页面的初始数据 | * 页面的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
mch_id: mch_id, | |||||
businessSwitch:businessSwitch, | |||||
goUrl: "", | |||||
templateId: [], | templateId: [], | ||||
aboutShow: false, | aboutShow: false, | ||||
navigationBarHeight, | navigationBarHeight, | ||||
@@ -40,6 +46,7 @@ Page({ | |||||
mineFlag: "", | mineFlag: "", | ||||
flag: 'hidden', | flag: 'hidden', | ||||
score: '0', | score: '0', | ||||
credit:'0', | |||||
userId:"", | userId:"", | ||||
memberName:"", | memberName:"", | ||||
memberLogo:"", | memberLogo:"", | ||||
@@ -150,7 +157,6 @@ Page({ | |||||
}, | }, | ||||
//获取房间列表 | //获取房间列表 | ||||
getRoomList() { | getRoomList() { | ||||
debugger | |||||
Http.get({ | Http.get({ | ||||
url: config.api.getRoomList, | url: config.api.getRoomList, | ||||
data: { | data: { | ||||
@@ -216,6 +222,14 @@ Page({ | |||||
* 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
*/ | */ | ||||
onShow: function() { | onShow: function() { | ||||
if (businessSwitch){ | |||||
let openId = wx.getStorageSync("0") | |||||
this.setData({ | |||||
goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}` | |||||
}) | |||||
} | |||||
console.log(this.data.goUrl) | |||||
let that = this; | let that = this; | ||||
that.userAuthorization() | that.userAuthorization() | ||||
if (typeof that.getTabBar === 'function' && | if (typeof that.getTabBar === 'function' && | ||||
@@ -297,6 +311,7 @@ Page({ | |||||
} | } | ||||
that.setData({ | that.setData({ | ||||
score: res.data.score, | score: res.data.score, | ||||
credit: res.data.credit, | |||||
curPhone: curPhone, | curPhone: curPhone, | ||||
levelName: res.data.levelName, | levelName: res.data.levelName, | ||||
userId: res.data.userId | userId: res.data.userId | ||||
@@ -53,6 +53,7 @@ | |||||
<!-- <text class="my">更多成长值</text> --> | <!-- <text class="my">更多成长值</text> --> | ||||
<text class="view" style='color:{{view}}'>更多成长值</text> | <text class="view" style='color:{{view}}'>更多成长值</text> | ||||
</view> | </view> | ||||
<view class="integral">我的积分:{{credit}}</view> | |||||
</view> | </view> | ||||
<!-- <image src="{{memberLogo}}" class="memberLogo"></image> --> | <!-- <image src="{{memberLogo}}" class="memberLogo"></image> --> | ||||
</view> | </view> | ||||
@@ -135,6 +136,12 @@ | |||||
<view class="particulars_go">></view> | <view class="particulars_go">></view> | ||||
</view> | </view> | ||||
</navigator> | </navigator> | ||||
<navigator wx:if="{{businessSwitch}}" url="{{goUrl}}"> | |||||
<view class="particulars_list"> | |||||
<view class="particulars_name">自助积分</view> | |||||
<view class="particulars_go">></view> | |||||
</view> | |||||
</navigator> | |||||
<navigator url="/pages/mallInfo/mallInfo" open-type="navigate"> | <navigator url="/pages/mallInfo/mallInfo" open-type="navigate"> | ||||
<view class="particulars_list"> | <view class="particulars_list"> | ||||
<view class="particulars_name">关于我们</view> | <view class="particulars_name">关于我们</view> | ||||
@@ -54,7 +54,7 @@ page{ | |||||
font-family: PingFangSC-Medium; | font-family: PingFangSC-Medium; | ||||
height: 42rpx; | height: 42rpx; | ||||
margin-top: 66rpx; | margin-top: 66rpx; | ||||
letter-spacing: 0.64rpx; | |||||
line-height: 44rpx; | line-height: 44rpx; | ||||
font-size: 32rpx; | font-size: 32rpx; | ||||
color: #FFFFFF; | color: #FFFFFF; | ||||
@@ -72,7 +72,7 @@ page{ | |||||
.user_phone{ | .user_phone{ | ||||
font-family: PingFangSC-Medium; | font-family: PingFangSC-Medium; | ||||
height: 42rpx; | height: 42rpx; | ||||
letter-spacing: 0.64rpx; | |||||
line-height: 44rpx; | line-height: 44rpx; | ||||
font-size: 32rpx; | font-size: 32rpx; | ||||
color: #FFFFFF; | color: #FFFFFF; | ||||
@@ -102,6 +102,9 @@ page{ | |||||
} | } | ||||
.memberBox{ | .memberBox{ | ||||
float: left; | float: left; | ||||
margin-left: 20rpx; | |||||
margin-top: 10rpx; | |||||
margin-bottom: 10rpx; | |||||
} | } | ||||
.memberCode{ | .memberCode{ | ||||
font-size: 24rpx; | font-size: 24rpx; | ||||
@@ -109,17 +112,12 @@ page{ | |||||
font-weight: 400; | font-weight: 400; | ||||
color: #888; | color: #888; | ||||
line-height: 34rpx; | line-height: 34rpx; | ||||
margin: 20rpx 0 0 20rpx; | |||||
} | } | ||||
.user-phone { | .user-phone { | ||||
font-family: PingFangSC-Regular; | font-family: PingFangSC-Regular; | ||||
letter-spacing: 0.64rpx; | |||||
line-height: 44rpx; | line-height: 44rpx; | ||||
font-size: 36rpx; | font-size: 36rpx; | ||||
color: #000; | color: #000; | ||||
padding: 0 20rpx 20rpx; | |||||
text-align: center; | |||||
} | } | ||||
.user-avatar { | .user-avatar { | ||||
@@ -470,10 +468,16 @@ page{ | |||||
text-align: center; | text-align: center; | ||||
font-size: 28rpx; | font-size: 28rpx; | ||||
} | } | ||||
.membercode { | |||||
/* .membercode { | |||||
margin-top: 20rpx; | margin-top: 20rpx; | ||||
} */ | |||||
.integral{ | |||||
font-size:24rpx; | |||||
font-family:PingFangSC-Regular; | |||||
font-weight:400; | |||||
color:rgba(166,166,166,1); | |||||
line-height:34rpx | |||||
} | } | ||||
.top{ | .top{ | ||||
width: 100%; | width: 100%; | ||||
height: 234rpx; | height: 234rpx; | ||||
@@ -109,11 +109,21 @@ Page({ | |||||
list: [] | list: [] | ||||
}) | }) | ||||
} | } | ||||
var tmpArr = that.data.list; | |||||
Object.assign(tmpArr, res.data.list); | |||||
that.setData({ | |||||
list: tmpArr | |||||
}) | |||||
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 => { | .catch(err => { | ||||
wx.showModal({ | wx.showModal({ | ||||
@@ -14,7 +14,7 @@ Page({ | |||||
optionData: null, | optionData: null, | ||||
fromflag: '', | fromflag: '', | ||||
couponChannelIdflag: '', | couponChannelIdflag: '', | ||||
wjId:"", | |||||
wjId: "", | |||||
}, | }, | ||||
//是否授权手机号 | //是否授权手机号 | ||||
judgePhonelngo() { | judgePhonelngo() { | ||||
@@ -23,15 +23,15 @@ Page({ | |||||
data: {} | data: {} | ||||
}).then(res => { | }).then(res => { | ||||
var tempSkip = app.globalData.skip | var tempSkip = app.globalData.skip | ||||
if (tempSkip =='redirectTo'){ | |||||
if (tempSkip == 'redirectTo') { | |||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: app.globalData.skipUrl, | url: app.globalData.skipUrl, | ||||
}) | }) | ||||
} else if (tempSkip == 'navigateTo'){ | |||||
} else if (tempSkip == 'navigateTo') { | |||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: app.globalData.skipUrl, | url: app.globalData.skipUrl, | ||||
}) | }) | ||||
} else if (tempSkip == 'reLaunch'){ | |||||
} else if (tempSkip == 'reLaunch') { | |||||
wx.reLaunch({ | wx.reLaunch({ | ||||
url: app.globalData.skipUrl, | url: app.globalData.skipUrl, | ||||
}) | }) | ||||
@@ -40,7 +40,7 @@ Page({ | |||||
url: app.globalData.skipUrl, | url: app.globalData.skipUrl, | ||||
}) | }) | ||||
} | } | ||||
}).catch(err => { | }).catch(err => { | ||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: `/pages/getphoneInfo/index?skipUrl=1` | url: `/pages/getphoneInfo/index?skipUrl=1` | ||||
@@ -64,7 +64,7 @@ Page({ | |||||
}) | }) | ||||
} | } | ||||
//调查问卷 | //调查问卷 | ||||
if (options && !options.wjId || options.wjId){ | |||||
if (options && !options.wjId || options.wjId) { | |||||
this.setData({ | this.setData({ | ||||
wjId: options.wjId | wjId: options.wjId | ||||
}) | }) | ||||
@@ -144,238 +144,477 @@ Page({ | |||||
url: '/index/index', | url: '/index/index', | ||||
}) | }) | ||||
}, | }, | ||||
bindGetUserInfo: function(e) { | |||||
let that = this; | |||||
var iv = e.detail.iv; | |||||
var encryptedData = e.detail.encryptedData; | |||||
wx.getUserInfo({ | |||||
success: function(res) { | |||||
Http.post({ | |||||
url: config.api.getUserInfo, | |||||
data: { | |||||
encryptedData: encryptedData, | |||||
iv: iv | |||||
} | |||||
}).then( | |||||
function(res) { | |||||
if(that.data.wjId){ | |||||
app.globalData.skipUrl =`/pages/questionnaire/questionnaire?id=${that.data.wjId}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
return; | |||||
} | |||||
if (that.data.fromflag == 'poster') { | |||||
app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
return; | |||||
} | |||||
// | |||||
if (that.data.optionData.orderGroupId) { | |||||
app.globalData.skipUrl = `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}` | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | |||||
return; | |||||
} | |||||
if (that.data.path == 'index') { | |||||
app.globalData.skipUrl = "/pages/game/index" | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | |||||
} else { | |||||
//返回主页 | |||||
// if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { | |||||
if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup && app.globalData.type == 'cd') { | |||||
// 跳转普通券/消费卡/限时秒杀/砍价详情 | |||||
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` | |||||
app.globalData.skip = 'navigateTo' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') { | |||||
// 来自转赠 | |||||
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) { | |||||
// 拼团详情页 | |||||
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.optionData.id && app.globalData.type == 'gm') { | |||||
// 游戏页面 | |||||
that.getGameOne(app.globalData.token, that.data.optionData.id) | |||||
// bindGetUserInfo: function (e) { | |||||
// let that = this; | |||||
// var iv = e.detail.iv; | |||||
// var encryptedData = e.detail.encryptedData; | |||||
// wx.getUserInfo({ | |||||
// success: function (res) { | |||||
// Http.post({ | |||||
// url: config.api.getUserInfo, | |||||
// data: { | |||||
// encryptedData: encryptedData, | |||||
// iv: iv | |||||
// } | |||||
// }).then( | |||||
// function (res) { | |||||
// if (that.data.wjId) { | |||||
// app.globalData.skipUrl = `/pages/questionnaire/questionnaire?id=${that.data.wjId}` | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// return; | |||||
// } | |||||
// if (that.data.fromflag == 'poster') { | |||||
// app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// return; | |||||
// } | |||||
// // | |||||
// if (that.data.optionData.orderGroupId) { | |||||
// app.globalData.skipUrl = `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}` | |||||
// app.globalData.skip = 'reLaunch' | |||||
// that.judgePhonelngo() | |||||
// return; | |||||
// } | |||||
// if (that.data.path == 'index') { | |||||
// app.globalData.skipUrl = "/pages/game/index" | |||||
// app.globalData.skip = 'reLaunch' | |||||
// that.judgePhonelngo() | |||||
// } else { | |||||
// //返回主页 | |||||
// // if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { | |||||
// if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup && app.globalData.type == 'cd') { | |||||
// // 跳转普通券/消费卡/限时秒杀/砍价详情 | |||||
// app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` | |||||
// app.globalData.skip = 'navigateTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') { | |||||
// // 来自转赠 | |||||
// app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` | |||||
// app.globalData.skip = 'reLaunch' | |||||
// that.judgePhonelngo() | |||||
// } else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) { | |||||
// // 拼团详情页 | |||||
// app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}` | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (that.data.optionData.id && app.globalData.type == 'gm') { | |||||
// // 游戏页面 | |||||
// that.getGameOne(app.globalData.token, that.data.optionData.id) | |||||
} else if (that.data.optionData.id && app.globalData.type == 'td') { | |||||
app.globalData.skipUrl = `/pages/topicDetail/index?id=${that.data.optionData.id}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 报名活动 | |||||
else if (that.data.optionData.id && app.globalData.type == 'ra') { | |||||
app.globalData.skipUrl = `/pages/radetail/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 报名签到 | |||||
else if (that.data.optionData.id && app.globalData.type == 'si') { | |||||
app.globalData.skipUrl = `/pages/acSignIn/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
// } else if (that.data.optionData.id && app.globalData.type == 'td') { | |||||
// app.globalData.skipUrl = `/pages/topicDetail/index?id=${that.data.optionData.id}` | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// // 报名活动 | |||||
// else if (that.data.optionData.id && app.globalData.type == 'ra') { | |||||
// app.globalData.skipUrl = `/pages/radetail/index?id=${that.data.optionData.id}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// // 报名签到 | |||||
// else if (that.data.optionData.id && app.globalData.type == 'si') { | |||||
// app.globalData.skipUrl = `/pages/acSignIn/index?id=${that.data.optionData.id}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// // 门店详情 | |||||
// else if (that.data.optionData.id && app.globalData.type == 'md') { | |||||
// app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// // 通过分享进入的门店详情页面 | |||||
// else if (that.data.id && that.data.frommd == 'md') { | |||||
// app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.id}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { | |||||
// // 宣传页详情 | |||||
// if (that.data.optionData.bt == '2') { | |||||
// // 自由图文 | |||||
// app.globalData.skipUrl = `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else { | |||||
// // 标准格式 | |||||
// app.globalData.skipUrl = `/pages/bannerdetail/index?id=${that.data.optionData.id}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// } else if (that.data.orderId || that.data.orderId && app.globalData.type == 'bg') { | |||||
// // 参与砍价 | |||||
// app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}`, | |||||
// app.globalData.skip = 'navigateTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'uc') { | |||||
// // 我的 | |||||
// app.globalData.skipUrl = '/index/user', | |||||
// app.globalData.skip = 'switchTab' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'in') { | |||||
// // 首页 | |||||
// app.globalData.skipUrl = '/index/index', | |||||
// app.globalData.skip = 'switchTab' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == "qd") { | |||||
// //每日签到 | |||||
// app.globalData.skipUrl = "/pages/activityCalendar/activityCalendar" | |||||
// app.globalData.skip = 'reLaunch' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// else if (app.globalData.type == "hdrl") { | |||||
// //活动日历 | |||||
// app.globalData.skipUrl = `/pages/radetail/index?id=${app.globalData.activityId}` | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// // 积分 | |||||
// else if (app.globalData.type == 'jf') { | |||||
// app.globalData.skipUrl = '/pages/integralmall/index', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'pc') { | |||||
// // 停车 | |||||
// app.globalData.skipUrl = '/index/passCar', | |||||
// app.globalData.skip = 'switchTab' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'mc') { | |||||
// // 我的券包 | |||||
// app.globalData.skipUrl = '/pages/couponorder/index/index', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'mo') { | |||||
// // 我的订单 | |||||
// app.globalData.skipUrl = '/pages/order/index/index?id=all', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'ca') { | |||||
// // 我的卡包 | |||||
// app.globalData.skipUrl = '/pages/cardorder/index/index', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'sc') { | |||||
// // 特享礼遇 | |||||
// app.globalData.skipUrl = '/pages/specialcourtesy/specialcourtesy', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'rb') { | |||||
// // 限时秒杀 | |||||
// app.globalData.skipUrl = '/pages/rushToBuy/index', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'bl') { | |||||
// // 砍价专场 | |||||
// app.globalData.skipUrl = '/pages/bargain/bargain', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'mb') { | |||||
// // 我的砍价 | |||||
// app.globalData.skipUrl = '/pages/bargain/bargain?from=myhtml', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'sl') { | |||||
// // 拼团专场 | |||||
// app.globalData.skipUrl = '/pages/spellGroup/spellGroup', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'ms') { | |||||
// // 我的拼团 | |||||
// app.globalData.skipUrl = '/pages/spellGroup/spellGroup?from=myhtml', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'dc') { | |||||
// // 消费卡 | |||||
// app.globalData.skipUrl = '/pages/discountCardList/discountCardList', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'td') { | |||||
// // 专题活动页 | |||||
// app.globalData.skipUrl = '/pages/topicDetail/index', | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (app.globalData.type == 'ml') { | |||||
// // 门店 | |||||
// app.globalData.skipUrl = '/index/searchbar', | |||||
// app.globalData.skip = 'switchTab' | |||||
// that.judgePhonelngo() | |||||
// } else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) { | |||||
// app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) { | |||||
// app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}`, | |||||
// app.globalData.skip = 'redirectTo' | |||||
// that.judgePhonelngo() | |||||
// } else { | |||||
// app.globalData.skipUrl = "/index/index", | |||||
// app.globalData.skip = 'switchTab' | |||||
// that.judgePhonelngo() | |||||
// } | |||||
// } | |||||
// }, | |||||
// function (error) { | |||||
// console.log(error) | |||||
// wx.showToast({ | |||||
// title: "请授权个人信息", | |||||
// icon: "none" | |||||
// }); | |||||
// } | |||||
// ) | |||||
// .catch(err => { | |||||
// wx.showToast({ | |||||
// title: err.errMsg, | |||||
// icon: 'none', | |||||
// duration: 2000, | |||||
// mask: false | |||||
// }); | |||||
// }) | |||||
// } | |||||
// }) | |||||
// }, | |||||
bindGetUserInfo(e) { | |||||
wx.getUserProfile({ | |||||
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 | |||||
success: (res) => { | |||||
let that = this; | |||||
var iv = res.iv; | |||||
var encryptedData = res.encryptedData; | |||||
wx.getUserInfo({ | |||||
success: function(res) { | |||||
Http.post({ | |||||
url: config.api.getUserInfo, | |||||
data: { | |||||
encryptedData: encryptedData, | |||||
iv: iv | |||||
} | } | ||||
// 门店详情 | |||||
else if (that.data.optionData.id && app.globalData.type == 'md') { | |||||
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`, | |||||
}).then( | |||||
function(res) { | |||||
if (that.data.wjId) { | |||||
app.globalData.skipUrl = `/pages/questionnaire/questionnaire?id=${that.data.wjId}` | |||||
app.globalData.skip = 'redirectTo' | app.globalData.skip = 'redirectTo' | ||||
that.judgePhonelngo() | |||||
} | |||||
// 通过分享进入的门店详情页面 | |||||
else if (that.data.id && that.data.frommd == 'md') { | |||||
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.id}`, | |||||
that.judgePhonelngo() | |||||
return; | |||||
} | |||||
if (that.data.fromflag == 'poster') { | |||||
app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` | |||||
app.globalData.skip = 'redirectTo' | app.globalData.skip = 'redirectTo' | ||||
that.judgePhonelngo() | |||||
} else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { | |||||
// 宣传页详情 | |||||
if (that.data.optionData.bt == '2') { | |||||
// 自由图文 | |||||
app.globalData.skipUrl = `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
return; | |||||
} | |||||
// | |||||
if (that.data.optionData.orderGroupId) { | |||||
app.globalData.skipUrl = `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}` | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | |||||
return; | |||||
} | |||||
if (that.data.path == 'index') { | |||||
app.globalData.skipUrl = "/pages/game/index" | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | that.judgePhonelngo() | ||||
} else { | } else { | ||||
// 标准格式 | |||||
app.globalData.skipUrl = `/pages/bannerdetail/index?id=${that.data.optionData.id}`, | |||||
//返回主页 | |||||
// if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { | |||||
if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup && app.globalData.type == 'cd') { | |||||
// 跳转普通券/消费卡/限时秒杀/砍价详情 | |||||
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` | |||||
app.globalData.skip = 'navigateTo' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') { | |||||
// 来自转赠 | |||||
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) { | |||||
// 拼团详情页 | |||||
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}` | |||||
app.globalData.skip = 'redirectTo' | app.globalData.skip = 'redirectTo' | ||||
that.judgePhonelngo() | |||||
that.judgePhonelngo() | |||||
} else if (that.data.optionData.id && app.globalData.type == 'gm') { | |||||
// 游戏页面 | |||||
that.getGameOne(app.globalData.token, that.data.optionData.id) | |||||
} else if (that.data.optionData.id && app.globalData.type == 'td') { | |||||
app.globalData.skipUrl = `/pages/topicDetail/index?id=${that.data.optionData.id}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 报名活动 | |||||
else if (that.data.optionData.id && app.globalData.type == 'ra') { | |||||
app.globalData.skipUrl = `/pages/radetail/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 报名签到 | |||||
else if (that.data.optionData.id && app.globalData.type == 'si') { | |||||
app.globalData.skipUrl = `/pages/acSignIn/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 门店详情 | |||||
else if (that.data.optionData.id && app.globalData.type == 'md') { | |||||
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 通过分享进入的门店详情页面 | |||||
else if (that.data.id && that.data.frommd == 'md') { | |||||
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { | |||||
// 宣传页详情 | |||||
if (that.data.optionData.bt == '2') { | |||||
// 自由图文 | |||||
app.globalData.skipUrl = `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else { | |||||
// 标准格式 | |||||
app.globalData.skipUrl = `/pages/bannerdetail/index?id=${that.data.optionData.id}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
} else if (that.data.orderId || that.data.orderId && app.globalData.type == 'bg') { | |||||
// 参与砍价 | |||||
app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}`, | |||||
app.globalData.skip = 'navigateTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'uc') { | |||||
// 我的 | |||||
app.globalData.skipUrl = '/index/user', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'in') { | |||||
// 首页 | |||||
app.globalData.skipUrl = '/index/index', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == "qd") { | |||||
//每日签到 | |||||
app.globalData.skipUrl = "/pages/activityCalendar/activityCalendar" | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == "hdrl") { | |||||
//活动日历 | |||||
app.globalData.skipUrl = `/pages/radetail/index?id=${app.globalData.activityId}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 积分 | |||||
else if (app.globalData.type == 'jf') { | |||||
app.globalData.skipUrl = '/pages/integralmall/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'pc') { | |||||
// 停车 | |||||
app.globalData.skipUrl = '/index/passCar', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'mc') { | |||||
// 我的券包 | |||||
app.globalData.skipUrl = '/pages/couponorder/index/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'mo') { | |||||
// 我的订单 | |||||
app.globalData.skipUrl = '/pages/order/index/index?id=all', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'ca') { | |||||
// 我的卡包 | |||||
app.globalData.skipUrl = '/pages/cardorder/index/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'sc') { | |||||
// 特享礼遇 | |||||
app.globalData.skipUrl = '/pages/specialcourtesy/specialcourtesy', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'rb') { | |||||
// 限时秒杀 | |||||
app.globalData.skipUrl = '/pages/rushToBuy/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'bl') { | |||||
// 砍价专场 | |||||
app.globalData.skipUrl = '/pages/bargain/bargain', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'mb') { | |||||
// 我的砍价 | |||||
app.globalData.skipUrl = '/pages/bargain/bargain?from=myhtml', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'sl') { | |||||
// 拼团专场 | |||||
app.globalData.skipUrl = '/pages/spellGroup/spellGroup', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'ms') { | |||||
// 我的拼团 | |||||
app.globalData.skipUrl = '/pages/spellGroup/spellGroup?from=myhtml', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'dc') { | |||||
// 消费卡 | |||||
app.globalData.skipUrl = '/pages/discountCardList/discountCardList', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'td') { | |||||
// 专题活动页 | |||||
app.globalData.skipUrl = '/pages/topicDetail/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'ml') { | |||||
// 门店 | |||||
app.globalData.skipUrl = '/index/searchbar', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) { | |||||
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) { | |||||
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else { | |||||
app.globalData.skipUrl = "/index/index", | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} | |||||
} | } | ||||
} else if (that.data.orderId || that.data.orderId && app.globalData.type == 'bg') { | |||||
// 参与砍价 | |||||
app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}`, | |||||
app.globalData.skip = 'navigateTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'uc') { | |||||
// 我的 | |||||
app.globalData.skipUrl = '/index/user', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'in') { | |||||
// 首页 | |||||
app.globalData.skipUrl = '/index/index', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == "qd"){ | |||||
//每日签到 | |||||
app.globalData.skipUrl = "/pages/activityCalendar/activityCalendar" | |||||
app.globalData.skip = 'reLaunch' | |||||
that.judgePhonelngo() | |||||
} | |||||
else if (app.globalData.type == "hdrl") { | |||||
//活动日历 | |||||
app.globalData.skipUrl = `/pages/radetail/index?id=${app.globalData.activityId}` | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} | |||||
// 积分 | |||||
else if (app.globalData.type == 'jf') { | |||||
app.globalData.skipUrl = '/pages/integralmall/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'pc') { | |||||
// 停车 | |||||
app.globalData.skipUrl = '/index/passCar', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'mc') { | |||||
// 我的券包 | |||||
app.globalData.skipUrl = '/pages/couponorder/index/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'mo') { | |||||
// 我的订单 | |||||
app.globalData.skipUrl = '/pages/order/index/index?id=all', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'ca') { | |||||
// 我的卡包 | |||||
app.globalData.skipUrl = '/pages/cardorder/index/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'sc') { | |||||
// 特享礼遇 | |||||
app.globalData.skipUrl = '/pages/specialcourtesy/specialcourtesy', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'rb') { | |||||
// 限时秒杀 | |||||
app.globalData.skipUrl = '/pages/rushToBuy/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'bl') { | |||||
// 砍价专场 | |||||
app.globalData.skipUrl = '/pages/bargain/bargain', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'mb') { | |||||
// 我的砍价 | |||||
app.globalData.skipUrl = '/pages/bargain/bargain?from=myhtml', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'sl') { | |||||
// 拼团专场 | |||||
app.globalData.skipUrl = '/pages/spellGroup/spellGroup', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'ms') { | |||||
// 我的拼团 | |||||
app.globalData.skipUrl = '/pages/spellGroup/spellGroup?from=myhtml', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'dc') { | |||||
// 消费卡 | |||||
app.globalData.skipUrl = '/pages/discountCardList/discountCardList', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'td') { | |||||
// 专题活动页 | |||||
app.globalData.skipUrl = '/pages/topicDetail/index', | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (app.globalData.type == 'ml') { | |||||
// 门店 | |||||
app.globalData.skipUrl = '/index/searchbar', | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) { | |||||
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) { | |||||
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}`, | |||||
app.globalData.skip = 'redirectTo' | |||||
that.judgePhonelngo() | |||||
} else { | |||||
app.globalData.skipUrl = "/index/index", | |||||
app.globalData.skip = 'switchTab' | |||||
that.judgePhonelngo() | |||||
} | |||||
} | |||||
}, | |||||
function(error) { | |||||
console.log(error) | |||||
wx.showToast({ | |||||
title: "请授权个人信息", | |||||
icon: "none" | |||||
}); | |||||
} | |||||
}, | |||||
function(error) { | |||||
console.log(error) | |||||
wx.showToast({ | |||||
title: "请授权个人信息", | |||||
icon: "none" | |||||
}); | |||||
} | |||||
) | |||||
.catch(err => { | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
) | |||||
.catch(err => { | |||||
wx.showToast({ | |||||
title: err.errMsg, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
} | |||||
}) | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
getGameOne: function(token, id) { | getGameOne: function(token, id) { | ||||
let _this = this; | let _this = this; | ||||
@@ -8,7 +8,8 @@ | |||||
<text>授权后,可以更好的体验我们哦~</text> | <text>授权后,可以更好的体验我们哦~</text> | ||||
</view> | </view> | ||||
<view class="login-btn"> | <view class="login-btn"> | ||||
<button open-type="getUserInfo" wx:if="{{canIUse}}" hover-class='active' class="login-btn-login" bindgetuserinfo="bindGetUserInfo">获取微信授权</button> | |||||
<button open-type="getUserProfile" wx:if="{{canIUse}}" hover-class='active' class="login-btn-login" bindtap="bindGetUserInfo">获取微信授权</button> | |||||
<!-- <button open-type="getUserInfo" wx:if="{{canIUse}}" hover-class='active' class="login-btn-login" bindgetuserinfo="bindGetUserInfo">获取微信授权</button> --> | |||||
<view wx:else>微信用户登录</view> | <view wx:else>微信用户登录</view> | ||||
<button hover-class='active' class="login-btn-login backHome" bindtap="backHome">取消</button> | <button hover-class='active' class="login-btn-login backHome" bindtap="backHome">取消</button> | ||||
</view> | </view> |
@@ -12,6 +12,7 @@ Page({ | |||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function(options) { | onLoad: function(options) { | ||||
console.log("我是中转页面") | |||||
let that = this; | let that = this; | ||||
console.log(options); | console.log(options); | ||||
wx.showToast({ | wx.showToast({ | ||||
@@ -58,7 +58,7 @@ | |||||
.content { | .content { | ||||
position: relative; | position: relative; | ||||
padding: 0 35rpx; | padding: 0 35rpx; | ||||
height: 145rpx; | |||||
height: 155rpx; | |||||
border-bottom: 1px solid #eaeaea; | border-bottom: 1px solid #eaeaea; | ||||
} | } | ||||
@@ -80,7 +80,7 @@ | |||||
.content>view:nth-of-type(2n+1) { | .content>view:nth-of-type(2n+1) { | ||||
float: left; | float: left; | ||||
width: 60%; | width: 60%; | ||||
height: 145rpx; | |||||
height: 150rpx; | |||||
overflow: hidden; | overflow: hidden; | ||||
} | } | ||||
@@ -32,7 +32,7 @@ | |||||
<view class='status' wx:if="{{isMyself==true}}" style='margin-top:30rpx;'> | <view class='status' wx:if="{{isMyself==true}}" style='margin-top:30rpx;'> | ||||
<view class='status-center' style='{{"width:"+(120*data.userList.length>634?634:120*data.userList.length)+"rpx;"+"margin:0 auto;"}}'> | <view class='status-center' style='{{"width:"+(120*data.userList.length>634?634:120*data.userList.length)+"rpx;"+"margin:0 auto;"}}'> | ||||
<view class='status-lists'> | <view class='status-lists'> | ||||
<view class='tuanzhang touxiangitems' wx:for="{{data.userList}}" wx:key="{{index}}"> | |||||
<view class='tuanzhang touxiangitems' wx:for="{{data.userList}}" wx:key="{{index}}+','"> | |||||
<view class='touxiang' wx:if='{{item.avatarUrl}}'> | <view class='touxiang' wx:if='{{item.avatarUrl}}'> | ||||
<image src='{{item.avatarUrl}}'></image> | <image src='{{item.avatarUrl}}'></image> | ||||
</view> | </view> | ||||
@@ -89,7 +89,7 @@ | |||||
<view class='status' wx:if='{{data.status!=10&&!isMyself}}' style='padding:0;overflow:hidden;margin-top:30rpx;'> | <view class='status' wx:if='{{data.status!=10&&!isMyself}}' style='padding:0;overflow:hidden;margin-top:30rpx;'> | ||||
<view class='status-center' style='margin:0 20rpx;width:650rpx;box-sizing:border-box;'> | <view class='status-center' style='margin:0 20rpx;width:650rpx;box-sizing:border-box;'> | ||||
<view class='status-lists' style='{{"width:"+(120*data.userList.length>634?634:120*data.userList.length)+"rpx;"+"margin:0 auto;"}}'> | <view class='status-lists' style='{{"width:"+(120*data.userList.length>634?634:120*data.userList.length)+"rpx;"+"margin:0 auto;"}}'> | ||||
<view class='tuanzhang touxiangitems' wx:for="{{data.userList}}" wx:key="{{index}}"> | |||||
<view class='tuanzhang touxiangitems' wx:for="{{data.userList}}" wx:key="{{index}}+'*'"> | |||||
<view class='touxiang' wx:if='{{item.avatarUrl}}'> | <view class='touxiang' wx:if='{{item.avatarUrl}}'> | ||||
<image src='{{item.avatarUrl}}'></image> | <image src='{{item.avatarUrl}}'></image> | ||||
</view> | </view> | ||||
@@ -53,7 +53,7 @@ Page({ | |||||
/** | /** | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function(options) { | |||||
onLoad: function (options) { | |||||
Http.get({ | Http.get({ | ||||
url: config.api.checkUserStatus, | url: config.api.checkUserStatus, | ||||
data: { | data: { | ||||
@@ -96,7 +96,7 @@ Page({ | |||||
url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` | url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` | ||||
}) | }) | ||||
}, */ | }, */ | ||||
showPoster: function() { | |||||
showPoster: function () { | |||||
console.log(this.data.data) | console.log(this.data.data) | ||||
let that = this; | let that = this; | ||||
Http.get({ | Http.get({ | ||||
@@ -125,7 +125,7 @@ Page({ | |||||
/** | /** | ||||
* 显示分享弹框 | * 显示分享弹框 | ||||
*/ | */ | ||||
showshare: function() { | |||||
showshare: function () { | |||||
this.setData({ | this.setData({ | ||||
isshowposter: true, | isshowposter: true, | ||||
}) | }) | ||||
@@ -133,12 +133,12 @@ Page({ | |||||
/** | /** | ||||
* 隐藏分享弹框 | * 隐藏分享弹框 | ||||
*/ | */ | ||||
hidemodal: function() { | |||||
hidemodal: function () { | |||||
this.setData({ | this.setData({ | ||||
isshowposter: false, | isshowposter: false, | ||||
}) | }) | ||||
}, | }, | ||||
gotoIndex: function() { | |||||
gotoIndex: function () { | |||||
wx.switchTab({ | wx.switchTab({ | ||||
url: '/index/index', | url: '/index/index', | ||||
}) | }) | ||||
@@ -146,7 +146,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 | ||||
@@ -168,11 +168,11 @@ Page({ | |||||
getQuestions(type) { | getQuestions(type) { | ||||
let that = this; | let that = this; | ||||
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) { | ||||
@@ -206,7 +206,7 @@ Page({ | |||||
/** | /** | ||||
* 点击提交问题单选 | * 点击提交问题单选 | ||||
*/ | */ | ||||
formSubmit: function(e) { | |||||
formSubmit: function (e) { | |||||
console.log(e); | console.log(e); | ||||
let that = this; | let that = this; | ||||
/** | /** | ||||
@@ -224,12 +224,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(); | ||||
}) | }) | ||||
@@ -245,21 +245,21 @@ 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) | ||||
}, | }, | ||||
@@ -312,7 +312,7 @@ Page({ | |||||
}) | }) | ||||
} | } | ||||
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) | ||||
@@ -349,7 +349,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/spellGroup/paySpellGroup/index?orderId=${that.data.disOrderNumber}&couponChannelId=${that.data.couponChannelId}&couponId=${couponId}&orderGroupId={that.data.orderGroupId}`, | url: `/pages/spellGroup/paySpellGroup/index?orderId=${that.data.disOrderNumber}&couponChannelId=${that.data.couponChannelId}&couponId=${couponId}&orderGroupId={that.data.orderGroupId}`, | ||||
@@ -363,7 +363,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/order/detail/index?orderId=${that.data.disOrderNumber}`, | url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}`, | ||||
@@ -476,13 +476,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.navigateTo({ | wx.navigateTo({ | ||||
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}` | ||||
@@ -492,6 +492,7 @@ Page({ | |||||
console.log(err); | console.log(err); | ||||
}) | }) | ||||
}, | }, | ||||
/** | /** | ||||
* 支付订单更新 | * 支付订单更新 | ||||
*/ | */ | ||||
@@ -500,14 +501,14 @@ Page({ | |||||
let that = this; | let that = this; | ||||
// 支付成功 | // 支付成功 | ||||
Http.post({ | Http.post({ | ||||
url: config.api.payOrderUpdate, | |||||
data: { | |||||
payOrderId: payOrderId, | |||||
orderId: orderId, | |||||
status: status, | |||||
reason: reason | |||||
} | |||||
}) | |||||
url: config.api.payOrderUpdate, | |||||
data: { | |||||
payOrderId: payOrderId, | |||||
orderId: orderId, | |||||
status: status, | |||||
reason: reason | |||||
} | |||||
}) | |||||
.then(res => { | .then(res => { | ||||
wx.hideLoading() | wx.hideLoading() | ||||
if (orderGroupId !== 0) { | if (orderGroupId !== 0) { | ||||
@@ -520,7 +521,7 @@ Page({ | |||||
}) | }) | ||||
.catch(err => { | .catch(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) | ||||
} | } | ||||
@@ -552,193 +553,189 @@ Page({ | |||||
} | } | ||||
Http.get({ | Http.get({ | ||||
url: config.api.checkUserStatus, | |||||
data: { | |||||
token: app.globalData.token | |||||
url: config.api.checkUserStatus, | |||||
data: { | |||||
token: app.globalData.token | |||||
} | |||||
}).then(res => { | |||||
Http.get({ | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}).then(res => { | |||||
/** | |||||
* orderSave 下单 | |||||
*/ | |||||
return Http.post({ | |||||
url: config.api.orderSave, | |||||
data: data | |||||
}); | |||||
}).catch(err => { | |||||
console.log(err); | |||||
that.setData({ | |||||
showbutton: false, | |||||
showbutton1: false, | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
if (err.code == 2011) { | |||||
wx.showToast({ | |||||
title: "商户信息没找到", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 2013) { | |||||
wx.showToast({ | |||||
title: "商户信息禁用", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3000) { | |||||
wx.showToast({ | |||||
title: "库存不足", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3001) { | |||||
wx.showToast({ | |||||
title: "您已超过限购", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3002) { | |||||
wx.showToast({ | |||||
title: "订单失败", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3003) { | |||||
wx.showToast({ | |||||
title: "订单不存在", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3004) { | |||||
wx.showToast({ | |||||
title: "订单不存在", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 4003) { | |||||
wx.showToast({ | |||||
title: "卡券已作废", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3012) { | |||||
// wx.showToast({ | |||||
// title: err.message, | |||||
// icon: "none" | |||||
// }) | |||||
that.getUnPaidOrder(that.data.data.couponId); | |||||
} else if (err.code == 11005) { | |||||
/** | |||||
* 将值传到用户手机号授权的页面 | |||||
* | |||||
*/ | |||||
wx.redirectTo({ | |||||
url: `/pages/getphoneInfo/index?path=spell&couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}` | |||||
}); | |||||
} else if (err.code == 11006) { | |||||
// 用户手机已加密 | |||||
wx.redirectTo({ | |||||
url: `/pages/phoneinput/phoneinput?path=spell&couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}` | |||||
}); | |||||
} else { | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
Http.get({ | |||||
url: config.api.checkPhoneStatus, | |||||
data: {} | |||||
}) | |||||
.then(res => { | |||||
/** | |||||
* orderSave 下单 | |||||
*/ | |||||
return Http.post({ | |||||
url: config.api.orderSave, | |||||
data: data | |||||
console.log(res) | |||||
if (typeof (res) != "undefined") { | |||||
let orderId = "" + res.data.id; | |||||
that.setData({ | |||||
orderId: orderId, | |||||
canSpell: false, | |||||
canBuyIf: true | |||||
}); | |||||
// 支付金额不为0 | |||||
/** | |||||
* 支付订单创建 | |||||
*/ | |||||
Http.post({ | |||||
url: config.api.payOrderCreate, | |||||
data: { | |||||
orderId: orderId | |||||
} | |||||
}).then(res => { | |||||
var payOrderId = "" + res.data.payOrderId; | |||||
wx.hideLoading(); | |||||
wx.requestPayment({ | |||||
timeStamp: res.data.timeStamp, | |||||
nonceStr: res.data.nonceStr, | |||||
package: res.data.package, | |||||
signType: (res.data.signType) ? res.data.signType : "MD5", | |||||
paySign: res.data.paySign, | |||||
success: res => { | |||||
that.setData({ | |||||
canSpell: false | |||||
}) | |||||
wx.showLoading({ | |||||
title: '订单正在处理中...', | |||||
}) | |||||
// setTimeout(function() { | |||||
// wx.hideLoading() | |||||
// }, 5000) | |||||
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); | |||||
if (res.errMsg == "requestPayment:ok") { | |||||
setTimeout(function () { | |||||
wx.hideLoading(); | |||||
}, 2000); | |||||
} | |||||
}, | |||||
fail: res => { | |||||
/** | |||||
* 支付失败,需要更新订单的状态 | |||||
*/ | |||||
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', that, orderGroupId); | |||||
that.setData({ | |||||
showbutton: false, | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
return; | |||||
}, | |||||
complete: res => { } | |||||
}); | }); | ||||
/// End payment -------- | |||||
}) | }) | ||||
.catch(err => { | |||||
console.log(err); | |||||
that.setData({ | |||||
showbutton: false, | |||||
showbutton1: false, | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
if (err.code == 2011) { | |||||
wx.showToast({ | |||||
title: "商户信息没找到", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 2013) { | |||||
wx.showToast({ | |||||
title: "商户信息禁用", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3000) { | |||||
wx.showToast({ | |||||
title: "库存不足", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3001) { | |||||
wx.showToast({ | |||||
title: "您已超过限购", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3002) { | |||||
wx.showToast({ | |||||
title: "订单失败", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3003) { | |||||
wx.showToast({ | |||||
title: "订单不存在", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3004) { | |||||
wx.showToast({ | |||||
title: "订单不存在", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 4003) { | |||||
wx.showToast({ | |||||
title: "卡券已作废", | |||||
image: './../../../assets/images/fail.png', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
} else if (err.code == 3012) { | |||||
// wx.showToast({ | |||||
// title: err.message, | |||||
// icon: "none" | |||||
// }) | |||||
that.getUnPaidOrder(that.data.data.couponId); | |||||
} else if (err.code == 11005) { | |||||
/** | |||||
* 将值传到用户手机号授权的页面 | |||||
* | |||||
*/ | |||||
wx.redirectTo({ | |||||
url: `/pages/getphoneInfo/index?path=spell&couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}` | |||||
}); | |||||
} else if (err.code == 11006) { | |||||
// 用户手机已加密 | |||||
wx.redirectTo({ | |||||
url: `/pages/phoneinput/phoneinput?path=spell&couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}` | |||||
}); | |||||
} else { | |||||
.catch(err => { | |||||
that.setData({ | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
wx.showToast({ | wx.showToast({ | ||||
title: err.message, | title: err.message, | ||||
icon: 'none', | icon: 'none', | ||||
duration: 2000, | duration: 2000, | ||||
mask: false | mask: false | ||||
}); | }); | ||||
} | |||||
}) | |||||
.then(res => { | |||||
console.log(res) | |||||
if (typeof(res) != "undefined") { | |||||
let orderId = "" + res.data.id; | |||||
that.setData({ | |||||
orderId: orderId, | |||||
canSpell: false, | |||||
canBuyIf: true | |||||
}); | |||||
// 支付金额不为0 | |||||
/** | |||||
* 支付订单创建 | |||||
*/ | |||||
Http.post({ | |||||
url: config.api.payOrderCreate, | |||||
data: { | |||||
orderId: orderId | |||||
} | |||||
}) | |||||
.then(res => { | |||||
var payOrderId = "" + res.data.payOrderId; | |||||
wx.hideLoading(); | |||||
wx.requestPayment({ | |||||
timeStamp: res.data.timeStamp, | |||||
nonceStr: res.data.nonceStr, | |||||
package: res.data.package, | |||||
signType: (res.data.signType) ? res.data.signType : "MD5", | |||||
paySign: res.data.paySign, | |||||
success: res => { | |||||
that.setData({ | |||||
canSpell: false | |||||
}) | |||||
wx.showLoading({ | |||||
title: '订单正在处理中...', | |||||
}) | |||||
setTimeout(function() { | |||||
wx.hideLoading() | |||||
}, 5000) | |||||
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', that, orderGroupId); | |||||
if (res.errMsg == "requestPayment:ok") { | |||||
setTimeout(function() { | |||||
wx.hideLoading(); | |||||
}, 2000); | |||||
} | |||||
}, | |||||
fail: res => { | |||||
/** | |||||
* 支付失败,需要更新订单的状态 | |||||
*/ | |||||
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', that, orderGroupId); | |||||
that.setData({ | |||||
showbutton: false, | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
return; | |||||
}, | |||||
complete: res => {} | |||||
}); | |||||
/// End payment -------- | |||||
}) | |||||
.catch(err => { | |||||
that.setData({ | |||||
canSpell: true, | |||||
canBuyIf: true | |||||
}) | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'none', | |||||
duration: 2000, | |||||
mask: false | |||||
}); | |||||
}) | |||||
} | |||||
}) | |||||
} | |||||
}) | |||||
}) | }) | ||||
}) | |||||
.catch(err => { | .catch(err => { | ||||
console.log(err) | console.log(err) | ||||
if (err.code == 11004) { | if (err.code == 11004) { | ||||
@@ -758,7 +755,7 @@ Page({ | |||||
/** | /** | ||||
* 生命周期函数--监听页面显示 | * 生命周期函数--监听页面显示 | ||||
*/ | */ | ||||
onShow: function() { | |||||
onShow: function () { | |||||
this.setData({ | this.setData({ | ||||
canSpell: true, | canSpell: true, | ||||
canBuyIf: true, | canBuyIf: true, | ||||
@@ -772,7 +769,7 @@ Page({ | |||||
/** | /** | ||||
* 生命周期函数--监听页面隐藏 | * 生命周期函数--监听页面隐藏 | ||||
*/ | */ | ||||
onHide: function() { | |||||
onHide: function () { | |||||
this.setData({ | this.setData({ | ||||
showTime: false | showTime: false | ||||
}) | }) | ||||
@@ -781,7 +778,7 @@ Page({ | |||||
/** | /** | ||||
* 生命周期函数--监听页面卸载 | * 生命周期函数--监听页面卸载 | ||||
*/ | */ | ||||
onUnload: function() { | |||||
onUnload: function () { | |||||
this.setData({ | this.setData({ | ||||
showTime: false | showTime: false | ||||
}) | }) | ||||
@@ -790,7 +787,7 @@ Page({ | |||||
/** | /** | ||||
* 页面相关事件处理函数--监听用户下拉动作 | * 页面相关事件处理函数--监听用户下拉动作 | ||||
*/ | */ | ||||
onPullDownRefresh: function(e) { | |||||
onPullDownRefresh: function (e) { | |||||
let that = this; | let that = this; | ||||
console.log(this.data.couponId, 222) | console.log(this.data.couponId, 222) | ||||
that.getDetail(that.data.couponChannelId); | that.getDetail(that.data.couponChannelId); | ||||
@@ -798,18 +795,18 @@ Page({ | |||||
that.getOneSpell(that.data.couponId) | that.getOneSpell(that.data.couponId) | ||||
} | } | ||||
}, | }, | ||||
onShareAppMessage: function(options) { | |||||
onShareAppMessage: function (options) { | |||||
app.globalData.previewFlag = true | app.globalData.previewFlag = true | ||||
console.log(options) | console.log(options) | ||||
var that = this; | var that = this; | ||||
var shareObj = { | var shareObj = { | ||||
title: that.data.data.title, | title: that.data.data.title, | ||||
path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}&spellGroup=spellGroup`, | path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.data.couponId}&spellGroup=spellGroup`, | ||||
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') { } | |||||
} | } | ||||
}; | }; | ||||
// 来自页面内的按钮的转发 | // 来自页面内的按钮的转发 | ||||
@@ -32,7 +32,7 @@ | |||||
}, | }, | ||||
"compileType": "miniprogram", | "compileType": "miniprogram", | ||||
"libVersion": "2.14.4", | "libVersion": "2.14.4", | ||||
"appid": "wxfa336cad86ed598d", | |||||
"appid": "wx453ae0d37f3550d0", | |||||
"projectname": "oldC", | "projectname": "oldC", | ||||
"isGameTourist": false, | "isGameTourist": false, | ||||
"simulatorType": "wechat", | "simulatorType": "wechat", | ||||