Commit 9ef2bccb authored by qinhaitao's avatar qinhaitao

Merge branch 'feature/2021-05-31-benefitUpdate' into 'b-template-component'

Feature/2021 05 31 benefit update

See merge request !30
parents bf7820dc f9715570
......@@ -28,7 +28,17 @@
<!-- <option a:if="{{typeChecked.includes(5)}}" value="{{5}}">降级奖品</option> -->
</select>
</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>
<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 == MEMBER_EQUITY}}" 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 == SIMPLE_EQUITY}}" 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">
<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>
......@@ -36,7 +46,7 @@
</form-item>
<form-item
style="width:100%"
a:if="{{[OBJECT_TYPE, CREDITS_TYPE].includes(prizeInitData.type)}}"
a:if="{{[OBJECT_TYPE, CREDITS_TYPE].includes(prizeInitData.type) || prizeInitData.benefitType==MEMBER_EQUITY}}"
size="large"
class="probability-prize-content-formItem"
label="奖品名称"
......
......@@ -29,6 +29,7 @@ const INIT_DATA = {
rank: "",
amount: "",
itemId: "",
benefitType: 1,
};
Component({
......@@ -40,6 +41,8 @@ Component({
CREDITS_TYPE,
OBJECT_TYPE,
LOWER_TYPE,
SIMPLE_EQUITY:1,
MEMBER_EQUITY:2,
showDialogMask: true,
canSavePrize: true,
dialogTop: "",
......@@ -98,6 +101,7 @@ Component({
switchStock: STOCK_NO_LIMIT,
isBackUp: false,
useStock: 0,
benefitType: 1,
rank: "",
amount: "",
itemId: "",
......@@ -247,6 +251,15 @@ Component({
},
});
},
onBenefitTypeTypeChange(e) {
let value = e.detail.value;
this.setData({
prizeInitData: {
...this.data.prizeInitData,
benefitType: value
},
});
},
navigateToPlugin() {
clearTimeout(this.$page.data.backPageTimeOut);
my.navigateTo({
......@@ -388,6 +401,7 @@ Component({
switchStock,
isBackUp,
endTime,
benefitType,
rank,
itemId,
amount,
......@@ -582,6 +596,7 @@ Component({
prizeDataType: +prizeDataType,
itemId,
amount,
benefitType,
...rest,
};
// 自定义新增字段
......
......@@ -11,7 +11,7 @@
"dayjs": "^1.8.28",
"node-xlsx": "^0.15.0",
"source-map-support": "^0.5.19",
"taobao-mini-sdk": "0.2.4"
"taobao-mini-sdk": "0.2.5"
},
"scripts": {
"start": "tsc",
......
......@@ -2,7 +2,7 @@
import { CODE_TYPES, _48_HOURS } from './../constants'
import { services, paramsCheck, paramsValidate } from '../decorator'
import { resultsModel } from '../sdk'
import { resultsModel, TBAPIS } from '../sdk'
import { ActivityconfigService } from '../service'
import { saveParams } from '../utils/saveValidate'
......@@ -92,11 +92,20 @@ export default class ActivitSaveController {
}
if (result || result === 0) {
<%if (miniConfig.needMiniapp && miniConfig.MiniappIdList.length > 0) {%>
try {
<% for (var i = 0; i < miniConfig.MiniappIdList.length; ++i) { %>
<%- `await TBAPIS.configMiniApp(context, {appId: ${+miniConfig.MiniappIdList[i]},version:'0.0.1'})` %>
<% } %>
} catch (error) {
console.log(error)
}
<%}%>
return resultsModel.success(true)
} else {
console.log(result, '保存活动失败')
return resultsModel.error(CODE_TYPES.SYSTEM_ERROR, '保存活动失败')
}
} else {
console.log(result, '保存活动失败')
return resultsModel.error(CODE_TYPES.SYSTEM_ERROR, '保存活动失败')
}
}
}
}
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