完成小程序前端部分
This commit is contained in:
@ -7,6 +7,43 @@ Page({
|
||||
data: {
|
||||
items_1: [null, null, null],
|
||||
items: [null, null],
|
||||
showPopup: false, // 控制弹窗显隐
|
||||
showCommissionRatePop: false,
|
||||
},
|
||||
// 显示弹窗
|
||||
showPopup() {
|
||||
this.setData({
|
||||
showPopup: true
|
||||
});
|
||||
},
|
||||
// 关闭弹窗
|
||||
closePopup() {
|
||||
this.setData({
|
||||
showPopup: false
|
||||
});
|
||||
},
|
||||
// 处理抽佣比例提交
|
||||
handleCommissionSubmit(e) {
|
||||
const { commissionRate } = e.detail;
|
||||
console.log(`设置的抽佣比例是:${commissionRate}%`);
|
||||
// 你可以在这里保存提交的数据,或者执行其他操作
|
||||
this.closePopup(); // 确认后关闭弹窗
|
||||
},
|
||||
// 点击“设价”按钮,显示弹窗
|
||||
showCommissionRatePop() {
|
||||
this.setData({ showCommissionRatePop: true });
|
||||
},
|
||||
|
||||
// 关闭弹窗(包括遮罩点击和取消按钮)
|
||||
closeCommissionRatePop() {
|
||||
this.setData({ showCommissionRatePop: false });
|
||||
},
|
||||
|
||||
// 确认按钮回调
|
||||
handleCommissionRateConfirm(e) {
|
||||
const { agentPrice, commissionRate, pricingMethod } = e.detail;
|
||||
console.log('设置数据:', agentPrice, commissionRate, pricingMethod);
|
||||
this.closeCommissionRatePop();
|
||||
},
|
||||
gotoSubCommission() {
|
||||
wx.navigateTo({
|
||||
|
@ -1,3 +1,6 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"commissionPop": "/pages/personCenter/component/commissionPop/commissionPop",
|
||||
"commissionRatePop": "/pages/personCenter/component/commissionRatePop/commissionRatePop"
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<view class="flex-col page">
|
||||
<view class="flex-row justify-between items-center section">
|
||||
<view class="flex-row justify-between items-center section" bindtap="showPopup">
|
||||
<view class="flex-row items-center">
|
||||
<image
|
||||
class="shrink-0 image"
|
||||
@ -54,7 +54,7 @@
|
||||
>
|
||||
<text class="font_6 text_6 pos">3.6元购买</text>
|
||||
<text class="font_7 text_9">0.30/0.30/0.00%</text>
|
||||
<view class="flex-row group_5 pos_2">
|
||||
<view class="flex-row group_5 pos_2" bindtap="showCommissionRatePop">
|
||||
<image
|
||||
class="image_4 image_6"
|
||||
src="https://ide.code.fun/api/image?token=68368d354ae84d001230f4d1&name=2994ec01c6859d93ce653a6cb3d50301.png"
|
||||
@ -66,4 +66,13 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹窗组件 -->
|
||||
<commissionPop show="{{showPopup}}" bind:close="closePopup" bind:submit="handleCommissionSubmit" />
|
||||
<!-- 弹窗组件 -->
|
||||
<commissionRatePop
|
||||
show="{{showCommissionRatePop}}"
|
||||
bind:cancel="closeCommissionRatePop"
|
||||
bind:close="closeCommissionRatePop"
|
||||
bind:confirm="handleCommissionRateConfirm"
|
||||
/>
|
Reference in New Issue
Block a user