Commit 2a82aa82 authored by 王波's avatar 王波

memberBenefit

parent c4468795
...@@ -28,7 +28,19 @@ ...@@ -28,7 +28,19 @@
<!-- <option a:if="{{typeChecked.includes(5)}}" value="{{5}}">降级奖品</option> --> <!-- <option a:if="{{typeChecked.includes(5)}}" value="{{5}}">降级奖品</option> -->
</select> </select>
</form-item> </form-item>
<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type)}}" validateState="{{choosePrizeTips.status}}" style="width:100%" size="large" help="{{choosePrizeTips.content}}" class="probability-prize-content-formItem probability-prize-content-formItem-choosePrize" label="选择奖品" required> <%if(buttons.includes('useMemberBenefit')) {%>
<%- `<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type)}}" style="width:100%" size="large" class="probability-prize-content-formItem" label="权益类型" required>
<radio-group disabled="{{isEdit}}" value="{{prizeInitData.benefitType}}" onChange="onBenefitTypeTypeChange">
<radio value="{{1}}">普通权益</radio>
<radio value="{{2}}">会员权益</radio>
</radio-group>
</form-item>` %>
<%}%>
<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type) && prizeInitData.benefitType == 2}}" validateState="{{choosePrizeTips.status}}" style="width:100%" size="large" help="{{choosePrizeTips.content}}" class="probability-prize-content-formItem probability-prize-content-formItem-choosePrize" label="权益隐藏id" required>
<input class="probability-prize-content-input" data-name="ename" onChange="onChangePrizeValue" value="{{prizeInitData.ename}}" hasLimitHint="true" name="权益隐藏id" defaultValue="{{prizeDialogEdit ? prizeDialogData.record.ename : prizeInitData.ename}}" placeholder="请输入权益隐藏id"/>
</form-item>
<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type) && prizeInitData.benefitType == 1}}" validateState="{{choosePrizeTips.status}}" style="width:100%" size="large" help="{{choosePrizeTips.content}}" class="probability-prize-content-formItem probability-prize-content-formItem-choosePrize" label="选择奖品" required>
<view class="probability-prize-content-formitem-choosePrize-wrap"> <view class="probability-prize-content-formitem-choosePrize-wrap">
<input a:if="{{prizeInitData.ename}}" class="probability-prize-content-input" style="margin-right:10px" onChange="changeInput" maxLength="10" value="{{prizeInitData.name}}" hasLimitHint="true" name="活动名称" defaultValue="{{prizeDialogEdit ? prizeDialogData.record.name : prizeInitData.name}}" placeholder="请选择奖品"/> <input a:if="{{prizeInitData.ename}}" class="probability-prize-content-input" style="margin-right:10px" onChange="changeInput" maxLength="10" value="{{prizeInitData.name}}" hasLimitHint="true" name="活动名称" defaultValue="{{prizeDialogEdit ? prizeDialogData.record.name : prizeInitData.name}}" placeholder="请选择奖品"/>
<view a:if="{{!isEdit}}" class="probability-prize-content-formitem-goequity" onTap="navigateToPlugin" type="primary">{{prizeInitData.ename ? '重新选择' : '选择奖品'}}</view> <view a:if="{{!isEdit}}" class="probability-prize-content-formitem-goequity" onTap="navigateToPlugin" type="primary">{{prizeInitData.ename ? '重新选择' : '选择奖品'}}</view>
......
...@@ -29,6 +29,7 @@ const INIT_DATA = { ...@@ -29,6 +29,7 @@ const INIT_DATA = {
rank: "", rank: "",
amount: "", amount: "",
itemId: "", itemId: "",
benefitType: 1,
}; };
Component({ Component({
...@@ -98,6 +99,7 @@ Component({ ...@@ -98,6 +99,7 @@ Component({
switchStock: STOCK_NO_LIMIT, switchStock: STOCK_NO_LIMIT,
isBackUp: false, isBackUp: false,
useStock: 0, useStock: 0,
benefitType: 1,
rank: "", rank: "",
amount: "", amount: "",
itemId: "", itemId: "",
...@@ -247,6 +249,15 @@ Component({ ...@@ -247,6 +249,15 @@ Component({
}, },
}); });
}, },
onBenefitTypeTypeChange(e) {
let value = e.detail.value;
this.setData({
prizeInitData: {
...this.data.prizeInitData,
benefitType: value
},
});
},
navigateToPlugin() { navigateToPlugin() {
clearTimeout(this.$page.data.backPageTimeOut); clearTimeout(this.$page.data.backPageTimeOut);
my.navigateTo({ my.navigateTo({
...@@ -388,6 +399,7 @@ Component({ ...@@ -388,6 +399,7 @@ Component({
switchStock, switchStock,
isBackUp, isBackUp,
endTime, endTime,
benefitType,
rank, rank,
itemId, itemId,
amount, amount,
...@@ -582,6 +594,7 @@ Component({ ...@@ -582,6 +594,7 @@ Component({
prizeDataType: +prizeDataType, prizeDataType: +prizeDataType,
itemId, itemId,
amount, amount,
benefitType,
...rest, ...rest,
}; };
// 自定义新增字段 // 自定义新增字段
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment