|
|
@ -20,7 +20,7 @@ |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view class="item"> |
|
|
|
<view class="label">推广作品</view> |
|
|
|
<view class="label">推广作品名称</view> |
|
|
|
<view class="value">{{item.name}}</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
@ -42,8 +42,8 @@ |
|
|
|
<view class="label">剩余推广时长</view> |
|
|
|
<view class="value">{{item.remainingPromotionTime}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <view>推广作品</view> |
|
|
|
<view style="width: 30%;height: 300rpx;border-radius: 20rpx;overflow: hidden;"> |
|
|
|
<image :src="item.image" style="width: 100%;height: 100%;"></image> |
|
|
@ -67,13 +67,13 @@ |
|
|
|
<!--付费周期--> |
|
|
|
<view style="" class="payCycle"> |
|
|
|
<view>付费周期</view> |
|
|
|
<view>{{item.day}}天</view> |
|
|
|
<view>{{popupData.day}}天</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!--金额--> |
|
|
|
<view style="width:100%;display: flex;justify-content: space-between;align-items: center;"> |
|
|
|
<view>金额</view> |
|
|
|
<view>¥{{item.money}}</view> |
|
|
|
<view>¥{{popupData.money}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!--确认推广按钮--> |
|
|
@ -86,11 +86,11 @@ |
|
|
|
</uv-popup> |
|
|
|
|
|
|
|
<!--支付弹框--> |
|
|
|
<confirmationPopup ref="confirmationPopup" title="提示" @confirm="pay" confirmText="确认支付"> |
|
|
|
<confirmationPopup ref="confirmationPopup" title="提示" @confirm="payOrder" confirmText="确认支付"> |
|
|
|
<view class="confirmationPopup"> |
|
|
|
<image src="/static/image/publish/pay.png" style="width: 150rpx;height: 150rpx;" mode=""></image> |
|
|
|
<view class="info"> |
|
|
|
确认支付{{ item.money }}元,可置顶{{ item.day }}天 |
|
|
|
确认支付{{ popupData.money }}元,可置顶{{ popupData.day }}天 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</confirmationPopup> |
|
|
@ -134,6 +134,10 @@ |
|
|
|
day: 0, |
|
|
|
money: 0, |
|
|
|
}, |
|
|
|
popupData: { |
|
|
|
day: 0, |
|
|
|
money: 0, |
|
|
|
}, |
|
|
|
param: { |
|
|
|
type: 'default', |
|
|
|
title: '结束后跳转标签页', |
|
|
@ -149,7 +153,9 @@ |
|
|
|
methods: { |
|
|
|
// 获取推广详情数据 |
|
|
|
getData() { |
|
|
|
this.$api('infoGetPromotionDetail',{id: this.item.id}, res => { |
|
|
|
this.$api('infoGetPromotionDetail', { |
|
|
|
id: this.item.id |
|
|
|
}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.item = res.result |
|
|
|
|
|
|
@ -196,18 +202,19 @@ |
|
|
|
|
|
|
|
select(e) { |
|
|
|
console.log('选中该项:', e); |
|
|
|
// 使用正则表达式匹配所有的数字 |
|
|
|
const matches = e.name.match(/\d+/g).map(Number); |
|
|
|
// 使用正则表达式匹配整数和浮点数 |
|
|
|
const matches = e.name.match(/(\d+\.?\d*)/g).map(Number); |
|
|
|
|
|
|
|
// 如果匹配到数字,则输出 |
|
|
|
if (matches) { |
|
|
|
if (matches && matches.length >= 2) { |
|
|
|
console.log(matches, "matches"); |
|
|
|
this.item.day = matches[0] |
|
|
|
this.item.money = matches[1] |
|
|
|
|
|
|
|
// 提取天数和金额 |
|
|
|
this.popupData.day = matches[0]; // 例如,置顶天数 |
|
|
|
this.popupData.money = matches[1]; // 例如,金额 |
|
|
|
this.$refs.actionSheet.close() //关闭弹框 |
|
|
|
this.$refs.popup.open() //打开另外一个弹框 |
|
|
|
} |
|
|
|
console.log(this.item.day, "this.item.day"); |
|
|
|
this.$refs.actionSheet.close() //关闭弹框 |
|
|
|
this.$refs.popup.open() //打开另外一个弹框 |
|
|
|
}, |
|
|
|
|
|
|
|
// ActionSheet 操作菜单关闭 |
|
|
@ -224,10 +231,10 @@ |
|
|
|
}, |
|
|
|
// 继续推广按钮 |
|
|
|
continueToPromotion() { |
|
|
|
if(this.item.phone=='' || this.item.phone==null){ |
|
|
|
if (this.item.phone == '' || this.item.phone == null) { |
|
|
|
return uni.showToast({ |
|
|
|
title: '请输入联系电话', |
|
|
|
icon : 'none' |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$refs.actionSheet.open(); |
|
|
@ -238,17 +245,53 @@ |
|
|
|
this.$refs.confirmationPopup.open() |
|
|
|
this.$refs.popup.close() |
|
|
|
}, |
|
|
|
pay() { |
|
|
|
this.$refs.confirmationPopupUpload.open() |
|
|
|
return |
|
|
|
// 支付逻辑待补充 |
|
|
|
this.$api('ConfirmPromotion', {}, res => { |
|
|
|
if (res.code == 200) { |
|
|
|
//平台审核 |
|
|
|
this.$refs.confirmationPopupUpload.open() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 发起支付 |
|
|
|
payOrder() { |
|
|
|
let self = this |
|
|
|
|
|
|
|
let data = { |
|
|
|
id: this.item.id, |
|
|
|
day: this.popupData.day, |
|
|
|
money: this.popupData.money, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$api('confirmPromotion', data, |
|
|
|
res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (self.form.topId) { |
|
|
|
uni.requestPayment({ |
|
|
|
provider: 'wxpay', // 服务提提供商 |
|
|
|
timeStamp: res.result.timeStamp, // 时间戳 |
|
|
|
nonceStr: res.result.nonceStr, // 随机字符串 |
|
|
|
package: res.result.packageValue, |
|
|
|
signType: res.result.signType, // 签名算法 |
|
|
|
paySign: res.result.paySign, // 签名 |
|
|
|
success: function(res) { |
|
|
|
console.log('支付成功', res); |
|
|
|
self.$refs.confirmationPopupUpload.open() |
|
|
|
// self.$refs.confirmationPopup.close() |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
|
console.log('支付失败', err); |
|
|
|
self.$refs.confirmationPopup.close() |
|
|
|
uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: "支付失败" |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
self.$refs.confirmationPopupUpload.open() |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
@ -291,6 +334,7 @@ |
|
|
|
|
|
|
|
.value { |
|
|
|
width: 40%; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -307,6 +351,25 @@ |
|
|
|
background: $uni-linear-gradient-btn-color; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.confirmationPopup { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
width: 100%; |
|
|
|
height: 300rpx; |
|
|
|
|
|
|
|
image { |
|
|
|
margin-top: 40rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.info { |
|
|
|
margin-top: 40rpx; |
|
|
|
font-size: 26rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|