zan-choose-dialog
Advanced tools
Comparing version 4.1.5-beta3.0 to 4.1.5
@@ -8,2 +8,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -112,3 +114,3 @@ | ||
link: '外链', | ||
weappFeature: '小程序微页面' | ||
weappfeature: '小程序微页面' | ||
}; | ||
@@ -131,3 +133,3 @@ | ||
var ITEM_LINK_TYPE = ['feature', 'category', 'goods', 'tag', 'guaguale', 'wheel', 'zodiac', 'crazyguess', 'survey', 'paidcolumn', 'paidcontent']; | ||
var ITEM_LINK_TYPE = ['feature', 'category', 'goods', 'tag', 'guaguale', 'wheel', 'zodiac', 'crazyguess', 'survey', 'paidcolumn', 'paidcontent', 'weappfeature']; | ||
var STATIC_LINK_TYPE = ['history', 'homepage', 'usercenter', 'mypaidcontent']; | ||
@@ -178,2 +180,11 @@ var CUSTOM_LINK_TYPE = ['link']; | ||
// 获取小程序微页面的url,需要保存但不可点击 | ||
// 小程序微页面 type: weappfeature | ||
function getLinkUrl(type, value) { | ||
if (type === 'weappfeature') { | ||
return 'pages/home/feature/index?id=' + value.id; | ||
} | ||
return value.url; | ||
} | ||
function normalizeLinkValue(type, value, config) { | ||
@@ -186,3 +197,3 @@ return new Promise(function (resolve, reject) { | ||
link_title: value.title || '', | ||
link_url: value.url || '', | ||
link_url: getLinkUrl(type, value) || '', | ||
alias: value.alias || '' | ||
@@ -305,3 +316,3 @@ }); | ||
multiple: false, | ||
typeMap: 'feature' | ||
typeMap: 'weappfeature' | ||
}) | ||
@@ -373,7 +384,14 @@ }; | ||
var items = this.state.items; | ||
var type = value.link_type; | ||
var presentValue = _extends({}, value); | ||
// 去掉小程序微页面的link_url,需要上传但不可点击 | ||
if (type === 'weappfeature') { | ||
presentValue.link_url = ''; | ||
} | ||
return _react2['default'].createElement(_zanChooseLinkMenu2['default'], { | ||
menuHideDelay: 250, | ||
value: value, | ||
value: presentValue, | ||
menuItems: items, | ||
@@ -380,0 +398,0 @@ trigger: trigger, |
{ | ||
"name": "zan-choose-dialog", | ||
"version": "4.1.5-beta3.0", | ||
"version": "4.1.5", | ||
"description": "这是一个React组件", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -189,3 +189,4 @@ ## zan-choose-dialog | ||
MyPaidContent: '我购买的专栏、内容', | ||
Link: '自定义链接' | ||
Link: '自定义链接', | ||
WeappFeature: '小程序微页面' | ||
} | ||
@@ -192,0 +193,0 @@ ``` |
@@ -40,3 +40,3 @@ /* eslint-disable no-underscore-dangle */ | ||
link: '外链', | ||
weappFeature: '小程序微页面' | ||
weappfeature: '小程序微页面' | ||
}; | ||
@@ -70,3 +70,4 @@ | ||
'paidcolumn', | ||
'paidcontent' | ||
'paidcontent', | ||
'weappfeature' | ||
]; | ||
@@ -122,2 +123,11 @@ const STATIC_LINK_TYPE = ['history', 'homepage', 'usercenter', 'mypaidcontent']; | ||
// 获取小程序微页面的url,需要保存但不可点击 | ||
// 小程序微页面 type: weappfeature | ||
function getLinkUrl(type, value) { | ||
if (type === 'weappfeature') { | ||
return `pages/home/feature/index?id=${value.id}`; | ||
} | ||
return value.url; | ||
} | ||
function normalizeLinkValue(type, value, config) { | ||
@@ -130,3 +140,3 @@ return new Promise((resolve, reject) => { | ||
link_title: value.title || '', | ||
link_url: value.url || '', | ||
link_url: getLinkUrl(type, value) || '', | ||
alias: value.alias || '' | ||
@@ -249,3 +259,3 @@ }); | ||
multiple: false, | ||
typeMap: 'feature' | ||
typeMap: 'weappfeature' | ||
}) | ||
@@ -309,7 +319,14 @@ }; | ||
const { items } = this.state; | ||
const { link_type: type } = value; | ||
let presentValue = { ...value }; | ||
// 去掉小程序微页面的link_url,需要上传但不可点击 | ||
if (type === 'weappfeature') { | ||
presentValue.link_url = ''; | ||
} | ||
return ( | ||
<ChooseLinkMenu | ||
menuHideDelay={250} | ||
value={value} | ||
value={presentValue} | ||
menuItems={items} | ||
@@ -316,0 +333,0 @@ trigger={trigger} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1084823
31431
1
220