水滴兑换模块开发完成
This commit is contained in:
@@ -156,19 +156,22 @@ Page({
|
||||
* 创建订单
|
||||
*/
|
||||
payFound() {
|
||||
wx.$api.index.skinOrder().then(res => {
|
||||
this.setData({
|
||||
disabled : true
|
||||
})
|
||||
wx.$api.index.skinOrder().then(res => {
|
||||
this.payBtn(res.data.order_id)
|
||||
}).catch(err => {})
|
||||
}).catch(err => {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认支付1元
|
||||
*/
|
||||
payBtn(orderid) {
|
||||
|
||||
wx.showLoading({
|
||||
title: '支付中...',
|
||||
mask : true
|
||||
@@ -190,6 +193,7 @@ Page({
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
disabled : false,
|
||||
payStatus: false
|
||||
})
|
||||
this.setData({
|
||||
|
||||
@@ -13,6 +13,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
console.log(options)
|
||||
if(options.invite != undefined) {
|
||||
getApp().globalData.inviteText = options.invite
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ Page({
|
||||
paySuccess : false, // 兑换成功显示
|
||||
maxcoupon : '', //拥有兑换券数量
|
||||
coupon_qty : 1, //兑换券数量
|
||||
checked : false//兑换券
|
||||
checked : false, //兑换券
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -169,6 +169,10 @@ Page({
|
||||
* 产品确认购买
|
||||
*/
|
||||
buyTap() {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
})
|
||||
@@ -181,9 +185,6 @@ Page({
|
||||
coupon_qty : this.data.coupon_qty
|
||||
}
|
||||
wx.$api.mall.mallAffirm(data).then(res => {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
wx.hideLoading()
|
||||
|
||||
if(res.data.can_pay) {
|
||||
@@ -201,7 +202,8 @@ Page({
|
||||
mask:true,
|
||||
success: function () {
|
||||
that.setData({
|
||||
paySuccess: true
|
||||
paySuccess: true,
|
||||
disabled: true
|
||||
})
|
||||
setTimeout(()=>{
|
||||
wx.redirectTo({
|
||||
|
||||
@@ -301,6 +301,24 @@ page {
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.btn-disabled {
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
border: none;
|
||||
border-radius:0;
|
||||
background-color: #ff9951;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
button[disabled]{
|
||||
padding: 0;
|
||||
padding: 0;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.btn.active {
|
||||
background-color: #cacaca;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ Page({
|
||||
inviteText : '', // 自己的邀请码
|
||||
isParent : false, // 绑定邀请码
|
||||
nameValue : '', // 上级邀请码
|
||||
disabled : false
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -64,7 +65,14 @@ Page({
|
||||
buyTap() {
|
||||
// 获取登录状态
|
||||
if(wx.getStorageSync("token") != ''){
|
||||
this.setData({
|
||||
disabled: true
|
||||
})
|
||||
|
||||
if(this.data.mallData.is_parent == true) {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
wx.navigateTo({
|
||||
url: '/pages/mall/confirm/confirm?goodsid=' + this.data.mallData.goods_id + '&skuid=' + this.data.mallData.skus[0].sku_id + '&qty=1',
|
||||
})
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<view class="number-price">{{mallData.is_vip ? mallData.price.vip : mallData.price.price}}</view>
|
||||
<view class="number-vip">{{mallData.is_vip ? 'VIP会员价' : '市场指导价'}}</view>
|
||||
</view>
|
||||
<view bindtap="buyTap" class="btn">确认购买</view>
|
||||
<button class="btn btn-disabled" disabled="{{disabled}}" bindtap="buyTap">确认购买</button>
|
||||
</view>
|
||||
|
||||
<!-- 产品图 -->
|
||||
|
||||
@@ -299,6 +299,26 @@ page {
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.btn-disabled {
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
border: none;
|
||||
border-radius:0;
|
||||
background-color: #ff9951;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
button[disabled]{
|
||||
padding: 0;
|
||||
padding: 0;
|
||||
height: 100rpx;
|
||||
line-height: 60px;
|
||||
color: white !important;
|
||||
opacity: .8;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.detailsBrief-back {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ Page({
|
||||
* 确认支付
|
||||
*/
|
||||
payBtn() {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
wx.showLoading({
|
||||
title: '支付中...',
|
||||
mask : true
|
||||
@@ -31,9 +34,6 @@ Page({
|
||||
let that = this
|
||||
wx.$api.mall.mallPay(this.data.orderNo,{type: 'miniapp', openid: wx.getStorageSync("openid")}).then(res=>{
|
||||
wx.hideLoading()
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
let payInfo = JSON.parse(res.data.wechat)
|
||||
wx.requestPayment({
|
||||
timeStamp: payInfo.timeStamp,
|
||||
@@ -51,7 +51,8 @@ Page({
|
||||
mask:true,
|
||||
success: function () {
|
||||
that.setData({
|
||||
paySuccess: true
|
||||
paySuccess: true,
|
||||
disabled: true
|
||||
})
|
||||
setTimeout(()=>{
|
||||
wx.redirectTo({
|
||||
@@ -71,7 +72,8 @@ Page({
|
||||
mask:true,
|
||||
success: function () {
|
||||
that.setData({
|
||||
paySuccess: true
|
||||
paySuccess: true,
|
||||
disabled: true
|
||||
})
|
||||
setTimeout(()=>{
|
||||
wx.redirectTo({
|
||||
@@ -82,6 +84,10 @@ Page({
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(err => {});
|
||||
}).catch(err => {
|
||||
that.setData({
|
||||
disabled: true
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
@@ -13,7 +13,8 @@ Page({
|
||||
address : '', // 地址
|
||||
addressId : '', // 地址id
|
||||
dataShow : '', // 数据
|
||||
exchangesHide: false
|
||||
exchangesHide: false,
|
||||
disabled : false
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -56,6 +57,9 @@ Page({
|
||||
* 水滴兑换提交
|
||||
*/
|
||||
createGo (){
|
||||
this.setData({
|
||||
disabled: true
|
||||
})
|
||||
wx.showModal({
|
||||
title : '兑换提示',
|
||||
content : '尊敬的用户,是否确认兑换此商品',
|
||||
@@ -65,9 +69,18 @@ Page({
|
||||
if (res.confirm) {
|
||||
wx.$api.recruit.exchangesPost({address_id: this.data.addressId}).then(res => {
|
||||
this.setData({
|
||||
disabled: false,
|
||||
exchangesHide: true
|
||||
})
|
||||
}).catch(err => { })
|
||||
}).catch(err => {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<!-- 按钮 -->
|
||||
<view class="recruit-btn" bindtap="createGo">
|
||||
<image class="recruit-btn-img" src="https://cdn.shuiganying.com/images/2023/07/21/76a01a5c46aa872e37c6af02ab2f6ace.png" mode="widthFix"></image>
|
||||
<view class="recruit-btn-text">兑换水感应喷雾一瓶</view>
|
||||
<button class="recruit-btn-text recruit-btn-disabled" disabled="{{disabled}}">兑换水感应喷雾一瓶</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -187,6 +187,28 @@
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
.recruit-btn-disabled {
|
||||
line-height: 100rpx;
|
||||
height: 100rpx;
|
||||
width: 100% !important;
|
||||
text-align: center;
|
||||
border: none;
|
||||
border-radius:0;
|
||||
background-color:transparent;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
button[disabled]{
|
||||
padding: 0;
|
||||
padding: 0;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
color: white !important;
|
||||
opacity: .8;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.siteTop {
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
|
||||
@@ -138,7 +138,6 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
let data = {
|
||||
name : value.name,
|
||||
address : value.address,
|
||||
@@ -154,7 +153,8 @@ Page({
|
||||
})
|
||||
wx.$api.recruit.recruitAdd(data).then(res => {
|
||||
this.setData({
|
||||
checkStatus: true
|
||||
checkStatus: true,
|
||||
disabled: false
|
||||
})
|
||||
}).catch(() =>{
|
||||
this.setData({
|
||||
|
||||
@@ -98,7 +98,8 @@ Page({
|
||||
})
|
||||
wx.$api.recruit.EditPut(this.data.enrollData.experience_area_enroll_id,data).then(res => {
|
||||
this.setData({
|
||||
checkStatus: true
|
||||
checkStatus: true,
|
||||
disabled: false
|
||||
})
|
||||
}).catch(() =>{
|
||||
this.setData({
|
||||
|
||||
@@ -126,14 +126,13 @@ Page({
|
||||
* 签到提交
|
||||
*/
|
||||
tapSign() {
|
||||
this.setData({
|
||||
disabled: true
|
||||
})
|
||||
let newPictures = []
|
||||
for (let pictures of this.data.albumArr){
|
||||
newPictures.push(pictures.path)
|
||||
}
|
||||
|
||||
this.setData({
|
||||
disabled: true
|
||||
})
|
||||
wx.$api.recruit.signLabor({
|
||||
experience_id : this.data.experienceId,
|
||||
describe : this.data.etciData,
|
||||
@@ -143,8 +142,13 @@ Page({
|
||||
this.setData({
|
||||
refertoStatus: true,
|
||||
signDayNumber: res.data.signDayNumber,
|
||||
signWaterNumber: res.data.signWaterNumber
|
||||
signWaterNumber: res.data.signWaterNumber,
|
||||
disabled: false
|
||||
})
|
||||
}).catch(err => {
|
||||
this.setData({
|
||||
disabled: false
|
||||
})
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user