Commit 3c729c45 authored by 王波's avatar 王波

Merge branch 'b-template-component-taskConfig' into 'b-template-component'

模板任务配置

See merge request !26
parents 97b155f9 7a8ecf50
<view class="items-config"> <view class="items-config">
<text style="font-size: 12px">{{itemIds ? `已选择${(itemIds + '').split(',').length}个商品` : ''}} </text> <text a:if="{{itemIds}}" style="font-size: 12px; margin-right: 10px">{{`已选择${(itemIds + '').split(',').length}个商品`}} </text>
<button type="primary" text size="small" onTap="onOpenDialog">{{itemIds ? '更换商品' : '选择商品'}}</button> <button type="primary" style="height:auto;" text size="small" onTap="onOpenDialog">{{itemIds ? '更换商品' : '选择商品'}}</button>
<items-dialog <items-dialog
onUpdateBabyChoose="onUpdateBabyChoose" onUpdateBabyChoose="onUpdateBabyChoose"
browseItemIds="{{itemIds + ''}}" browseItemIds="{{itemIds + ''}}"
......
...@@ -21,11 +21,12 @@ var validator = new schema(descriptor) ...@@ -21,11 +21,12 @@ var validator = new schema(descriptor)
const tasks = { const tasks = {
<% for(var i = 0; i < configList.length; ++i) {%> <% for(var i = 0; i < configList.length; ++i) {%>
<%- taskKeys.includes(configList[i].key) && configList[i].key !== 'label' ? `${configList[i].key}:{ <%- taskKeys.includes(configList[i].key) && configList[i].key !== 'label' ? `${configList[i].key}:{
value:"", value:${configList[i].value || '""'},
taskRateType:"", taskRateType: ${configList[i].taskRateType ? `TASK_RATE_TYPE["${configList[i].taskRateType}"]`: '""'},
times:"", times:${configList[i].times || '""'},
title:"", title:"${configList[i].name || ''}",
link:"" link:"",
itemIds:""
},` : '' %><% } %> },` : '' %><% } %>
} }
...@@ -220,6 +221,18 @@ Component({ ...@@ -220,6 +221,18 @@ Component({
} }
return prizeInfoListCopy return prizeInfoListCopy
}, },
// 任务配置选择商品回调
onItemIdsChange(ids, dataName) {
this.setData({
tasks: {
...this.data.tasks,
[dataName]: {
...this.data.tasks[dataName],
itemIds: ids
}
},
});
},
backList() { backList() {
this.$page.$router.go(-1) this.$page.$router.go(-1)
} }
......
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