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

Merge branch 'b-template-component' into b_template_component_bugfixed_20200531

parents c3728d74 dd9ec4a9
<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].taskConfigMode === 'fixed' ? 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)
} }
......
...@@ -28,7 +28,7 @@ export const isNumber = val => { ...@@ -28,7 +28,7 @@ export const isNumber = val => {
* @returns { boolean } * @returns { boolean }
*/ */
export const validateRangeNumber = (number, [min, max] = [], fixed = 0) => { 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 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