This commit is contained in:
zhangmanman
2021-07-07 10:47:38 +08:00
parent fc77594016
commit c29fc7b5cb
12 changed files with 56 additions and 48 deletions

View File

@@ -45,8 +45,6 @@ Page({
// 获取卡券列表 // 获取卡券列表
this.couponInfo() this.couponInfo()
console.log(this.data.platformCp[this.data.platIndex])
}, },
/** /**
@@ -270,8 +268,6 @@ Page({
} }
}, },
fail : res=>{ fail : res=>{
console.log(this.data.isdeliver)
console.log(Newtype)
if(Newtype == 'welfare'){ if(Newtype == 'welfare'){
if(this.data.isdeliver == 1) { if(this.data.isdeliver == 1) {
wx.reLaunch({ wx.reLaunch({

View File

@@ -25,7 +25,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad (options) { onLoad (options) {
console.log(options)
// 登录方式-活动 // 登录方式-活动
this.setData({ this.setData({
way : options.way way : options.way
@@ -121,10 +120,10 @@ Page({
* 点击账号登录 * 点击账号登录
*/ */
loginGo(e) { loginGo(e) {
let username = e.currentTarget.dataset.name, let username = e.currentTarget.dataset.name
wechatUser_id = app.globalData.wechatUser const wechatUserId = wx.getStorageSync("wechatUser")
wx.$api.enroll.tel(wechatUser_id, username).then(res=>{ wx.$api.enroll.tel(wechatUserId, username).then(res=>{
app.globalData.token = res.data.token app.globalData.token = res.data.token
app.globalData.isUser = true app.globalData.isUser = true

View File

@@ -33,7 +33,6 @@ Page({
*/ */
frozenInfo() { frozenInfo() {
wx.$api.user.ungrants(this.data.type).then(res=>{ wx.$api.user.ungrants(this.data.type).then(res=>{
console.log(res.data)
this.setData({ this.setData({
frozenData: res.data frozenData: res.data
}) })

View File

@@ -354,7 +354,6 @@ Page({
} }
}, },
fail: err => { fail: err => {
console.log(err)
} }
}) })
} }

View File

@@ -107,7 +107,12 @@ Page({
// 存入缓存 // 存入缓存
app.globalData.userInfo = res.data.users app.globalData.userInfo = res.data.users
app.globalData.wechatUser = res.data.wechatUser_id
// 写入缓存
wx.setStorage({
key : 'wechatUser',
data : res.data.wechatUser_id
})
this.setData({ this.setData({
isLogin: false isLogin: false

View File

@@ -26,8 +26,6 @@ Page({
orderType: options.orderType, orderType: options.orderType,
stateType: options.stateType stateType: options.stateType
}) })
console.log(options.orderType)
}, },
onShow() { onShow() {

View File

@@ -97,35 +97,55 @@ Page({
* 支付提交 * 支付提交
*/ */
orderPay(e) { orderPay(e) {
let url = ''
let orderid = e.currentTarget.dataset.id let orderid = e.currentTarget.dataset.id
wx.$api.exchange.payments(orderid).then(res=>{ if(this.data.orderType == 'welfare' || this.data.orderType == 'welfareGoods') url = wx.$api.exchange.welfarePay
wx.$api.index.wechat(res.data.trade_no).then(res=>{ if(this.data.orderType == 'rights' || this.data.orderType == 'rightsCoupons') url = wx.$api.exchange.rightsPay
let payInfo = JSON.parse(res.data) url(orderid).then(res=>{
wx.requestPayment({ // payTips为1的时候为微信支付
timeStamp: payInfo.timeStamp, if(this.data.pay.payTips == 1) {
nonceStr : payInfo.nonceStr, let wechaUrl = ''
package : payInfo.package, if(this.data.orderType == 'welfare' || this.data.orderType == 'welfareGoods') wechaUrl = wx.$api.index.fridayPay
paySign : payInfo.paySign, if(this.data.orderType == 'rights' || this.data.orderType == 'rightsCoupons') wechaUrl = wx.$api.index.wechat
signType : payInfo.signType, wechaUrl(res.data.trade_no).then(res=>{
success : res=>{ let payInfo = JSON.parse(res.data)
if(res.errMsg == "requestPayment:ok"){ wx.requestPayment({
wx.showToast({ timeStamp: payInfo.timeStamp,
title: '支付成功', nonceStr : payInfo.nonceStr,
icon : 'success' package : payInfo.package,
}) paySign : payInfo.paySign,
setTimeout(()=>{ signType : payInfo.signType,
wx.reLaunch({ success : res=>{
url: '/pages/coupon/coupon?type=couponPublic' if(res.errMsg == "requestPayment:ok"){
wx.showToast({
title: '支付成功',
icon : 'success'
}) })
},2000) setTimeout(()=>{
// 获取商品活动订单
this.orderInfo();
},2000)
}
},
fail : res=>{
// 获取商品活动订单
this.orderInfo();
} }
}, })
fail : res=>{
wx.reLaunch({
url: '/pages/order/order?stateType=unpay'
})
}
}) })
}
// payTips为2的时候为沃钱包支付
if(this.data.pay.payTips == 2) {
const newUrl = "https://lifetest.ysd-bs.com/unicom/payment?trade_no=" + res.data.trade_no
let url= encodeURIComponent(newUrl)
wx.navigateTo({
// 跳转到webview页面
url: `/pages/webView/webView?url=${url}`
});
}
this.setData({
['pay.payState']: false
}) })
}) })

View File

@@ -59,5 +59,5 @@
<view class="order-data-footer {{statusHeight > 30 ? 'iphoneX':''}}"> <view class="order-data-footer {{statusHeight > 30 ? 'iphoneX':''}}">
<view class="order-btn" bindtap="orderRun">返回订单</view> <view class="order-btn" bindtap="orderRun">返回订单</view>
<view class="order-btn" bindtap="orderDelete" data-id="{{order.orderid}}" wx:if="{{order.canCancel || order.can.cancel}}">取消订单</view> <view class="order-btn" bindtap="orderDelete" data-id="{{order.orderid}}" wx:if="{{order.canCancel || order.can.cancel}}">取消订单</view>
<view class="order-btn order-btn-back" bindtap="orderPay" wx:if="{{order.canPay || order.can.pay}}" data-id="{{order.orderid}}">立即支付</view> <!-- <view class="order-btn order-btn-back" bindtap="orderPay" wx:if="{{order.canPay || order.can.pay}}" data-id="{{order.orderid}}">立即支付</view> -->
</view> </view>

View File

@@ -78,7 +78,6 @@ Page({
} }
if(res.data.detail.type == 'virtual') this.setData({isdeliver : 1}) if(res.data.detail.type == 'virtual') this.setData({isdeliver : 1})
} }
this.setData({ this.setData({
address : res.data.address, address : res.data.address,
allAddress : res.data.all_address, allAddress : res.data.all_address,
@@ -219,7 +218,6 @@ Page({
* 选择收货地址 * 选择收货地址
*/ */
selectAddress(e){ selectAddress(e){
console.log(e)
let new_addressId = e.currentTarget.dataset.id, let new_addressId = e.currentTarget.dataset.id,
addressId = this.data.address.id addressId = this.data.address.id
if (new_addressId != addressId) { if (new_addressId != addressId) {

View File

@@ -122,7 +122,7 @@
<view class="rightsList" style="padding: 0 0 2rpx"> <view class="rightsList" style="padding: 0 0 2rpx">
<view class="rightsLabel"> <view class="rightsLabel">
<view class="rightsLabel-left">{{detail.attribute.form_type}}</view> <view class="rightsLabel-left">{{detail.attribute.form_type}}</view>
<view class="rightsLabel-right rightsLabel-red">¥{{detail.score}}</view> <view class="rightsLabel-right rightsLabel-red">¥{{score}}</view>
</view> </view>
<view class="rightsLabel uni-border-top"> <view class="rightsLabel uni-border-top">
<view class="rightsLabel-left">{{detail.attribute.form_pay}}</view> <view class="rightsLabel-left">{{detail.attribute.form_pay}}</view>

View File

@@ -27,7 +27,6 @@ Page({
}, },
onLoad(e) { onLoad(e) {
console.log(e)
wx.getLocation({ wx.getLocation({
success: res => { success: res => {
// 解析坐标 // 解析坐标
@@ -133,8 +132,6 @@ Page({
this.setData({ this.setData({
regiList : res.data regiList : res.data
}) })
console.log(this.data.regiList)
}) })
}, },
@@ -142,7 +139,6 @@ Page({
* 选择市区返回 * 选择市区返回
*/ */
regionOpt (e) { regionOpt (e) {
console.log(e)
let area_name = e.currentTarget.dataset.city let area_name = e.currentTarget.dataset.city
var pages = getCurrentPages(); var pages = getCurrentPages();
var prevPage = pages[pages.length - 2]; var prevPage = pages[pages.length - 2];

View File

@@ -15,8 +15,6 @@ Page({
this.setData({ this.setData({
url : decodeURIComponent(options.url) url : decodeURIComponent(options.url)
}) })
console.log(this.data.url)
}, },
/** /**