Commit 9d665f75 authored by 管新明's avatar 管新明

Merge branch 'b-template-component' into b_template_component_bugfixed_20200531

parents c3728d74 dd9ec4a9
<view class="items-config">
<text style="font-size: 12px">{{itemIds ? `已选择${(itemIds + '').split(',').length}个商品` : ''}} </text>
<button type="primary" text size="small" onTap="onOpenDialog">{{itemIds ? '更换商品' : '选择商品'}}</button>
<text a:if="{{itemIds}}" style="font-size: 12px; margin-right: 10px">{{`已选择${(itemIds + '').split(',').length}个商品`}} </text>
<button type="primary" style="height:auto;" text size="small" onTap="onOpenDialog">{{itemIds ? '更换商品' : '选择商品'}}</button>
<items-dialog
onUpdateBabyChoose="onUpdateBabyChoose"
browseItemIds="{{itemIds + ''}}"
......
......@@ -21,11 +21,12 @@ var validator = new schema(descriptor)
const tasks = {
<% for(var i = 0; i < configList.length; ++i) {%>
<%- taskKeys.includes(configList[i].key) && configList[i].key !== 'label' ? `${configList[i].key}:{
value:"",
taskRateType:"",
times:"",
title:"",
link:""
value:${configList[i].value || '""'},
taskRateType: ${configList[i].taskRateType ? `TASK_RATE_TYPE["${configList[i].taskRateType}"]`: '""'},
times:${configList[i].times || '""'},
title:"${configList[i].taskConfigMode === 'fixed' ? configList[i].name : ''}",
link:"",
itemIds:""
},` : '' %><% } %>
}
......@@ -220,6 +221,18 @@ Component({
}
return prizeInfoListCopy
},
// 任务配置选择商品回调
onItemIdsChange(ids, dataName) {
this.setData({
tasks: {
...this.data.tasks,
[dataName]: {
...this.data.tasks[dataName],
itemIds: ids
}
},
});
},
backList() {
this.$page.$router.go(-1)
}
......
......@@ -28,7 +28,7 @@ export const isNumber = val => {
* @returns { boolean }
*/
export const validateRangeNumber = (number, [min, max] = [], fixed = 0) => {
let pattern = new RegExp(`^[0-9]+(\\.[0-9]{1,${fixed}})?$`);
let pattern = /`^[0-9]+(\\.[0-9]{1,${fixed}})?$`/;
// 判断空字符
if (typeof number === 'string' && !number.trim()) return false
......
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