提交 6da55a94 编写于 作者: api工厂's avatar api工厂

优化登陆授权机制,下单前需要绑定手机号码

上级 d17b3836
......@@ -84,12 +84,6 @@ App({
wx.getShareInfo({
shareTicket: e.shareTicket,
success: res => {
console.log(res)
console.log({
referrer: e.query.inviter_id,
encryptedData: res.encryptedData,
iv: res.iv
})
wx.login({
success(loginRes) {
if (loginRes.code) {
......@@ -113,7 +107,7 @@ App({
}
}
// 自动登录
AUTH.checkHasLogined().then(async isLogined => {
AUTH.checkHasLogined().then(isLogined => {
if (!isLogined) {
AUTH.login()
}
......
module.exports = {
version: '10.1.0',
note: '商品价格自动显示后台设置的会员价', // 这个为版本描述,无需修改
version: '10.2.0',
note: '优化登陆授权机制,下单前需要绑定手机号码', // 这个为版本描述,无需修改
subDomain: 'tz', // 此处改成你自己的专属域名。什么是专属域名?请看教程 https://www.it120.cc/help/qr6l4m.html
sdkAppID: 1400450467, // 腾讯实时音视频应用编号,请看教程 https://www.it120.cc/help/nxoqsl.html
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
hover-class="van-button--active hover-class"
lang="{{ lang }}"
form-type="{{ formType }}"
style="{{ computed.rootStyle({ plain, color }) }} {{ customStyle }}"
style="{{ computed.rootStyle({ plain, color, customStyle }) }}"
open-type="{{ disabled ? '' : openType }}"
business-id="{{ businessId }}"
session-from="{{ sessionFrom }}"
......
......@@ -3,7 +3,7 @@ var style = require('../wxs/style.wxs');
function rootStyle(data) {
if (!data.color) {
return '';
return data.customStyle;
}
var properties = {
......@@ -18,7 +18,7 @@ function rootStyle(data) {
properties['border-color'] = data.color;
}
return style(properties);
return style([properties, data.customStyle]);
}
function loadingColor(data) {
......
<wxs src="./index.wxs" module="computed"></wxs>
<view class="van-calendar">
<header
title="{{ title }}"
showTitle="{{ showTitle }}"
subtitle="{{ subtitle }}"
showSubtitle="{{ showSubtitle }}"
>
<slot name="title" slot="title"></slot>
</header>
<template name="calendar">
<view class="van-calendar">
<header
title="{{ title }}"
showTitle="{{ showTitle }}"
subtitle="{{ subtitle }}"
<scroll-view
class="van-calendar__body"
scroll-y
scroll-into-view="{{ scrollIntoView }}"
>
<month
wx:for="{{ computed.getMonths(minDate, maxDate) }}"
wx:key="index"
id="month{{ index }}"
class="month"
data-date="{{ item }}"
date="{{ item }}"
type="{{ type }}"
color="{{ color }}"
minDate="{{ minDate }}"
maxDate="{{ maxDate }}"
showMark="{{ showMark }}"
formatter="{{ formatter }}"
rowHeight="{{ rowHeight }}"
currentDate="{{ currentDate }}"
showSubtitle="{{ showSubtitle }}"
>
<slot name="title" slot="title"></slot>
</header>
<scroll-view class="van-calendar__body" scroll-y scroll-into-view="{{ scrollIntoView }}">
<month
wx:for="{{ computed.getMonths(minDate, maxDate) }}"
wx:key="index"
id="month{{ index }}"
class="month"
data-date="{{ item }}"
date="{{ item }}"
type="{{ type }}"
color="{{ color }}"
minDate="{{ minDate }}"
maxDate="{{ maxDate }}"
showMark="{{ showMark }}"
formatter="{{ formatter }}"
rowHeight="{{ rowHeight }}"
currentDate="{{ currentDate }}"
showSubtitle="{{ showSubtitle }}"
allowSameDay="{{ allowSameDay }}"
showMonthTitle="{{ index !== 0 || !showSubtitle }}"
bind:click="onClickDay"
/>
</scroll-view>
allowSameDay="{{ allowSameDay }}"
showMonthTitle="{{ index !== 0 || !showSubtitle }}"
bind:click="onClickDay"
/>
</scroll-view>
<view class="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
<slot name="footer"></slot>
</view>
<view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<slot name="footer"></slot>
</view>
<view class="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
<van-button
wx:if="{{ showConfirm }}"
round
block
type="danger"
color="{{ color }}"
custom-class="van-calendar__confirm"
disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
nativeType="text"
bind:click="onConfirm"
>
{{ computed.getButtonDisabled(type, currentDate) ? confirmDisabledText : confirmText }}
</van-button>
</view>
<view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<van-button
wx:if="{{ showConfirm }}"
round
block
type="danger"
color="{{ color }}"
custom-class="van-calendar__confirm"
disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
nativeType="text"
bind:click="onConfirm"
>
{{
computed.getButtonDisabled(type, currentDate)
? confirmDisabledText
: confirmText
}}
</van-button>
</view>
</template>
</view>
......@@ -22,13 +22,13 @@ component_1.VantComponent({
observer: 'setDays',
},
showMark: Boolean,
rowHeight: [Number, String],
rowHeight: null,
formatter: {
type: null,
observer: 'setDays',
},
currentDate: {
type: [null, Array],
type: null,
observer: 'setDays',
},
allowSameDay: Boolean,
......
......@@ -42,7 +42,7 @@ component_1.VantComponent({
},
rangePrompt: String,
defaultDate: {
type: [Number, Array],
type: null,
observer: function (val) {
this.setData({ currentDate: val });
this.scrollIntoView();
......@@ -72,7 +72,7 @@ component_1.VantComponent({
value: 'bottom',
},
rowHeight: {
type: [Number, String],
type: null,
value: utils_1.ROW_HEIGHT,
},
round: {
......@@ -108,7 +108,7 @@ component_1.VantComponent({
value: true,
},
maxRange: {
type: [Number, String],
type: null,
value: null,
},
},
......
<wxs src="./index.wxs" module="computed" />
<wxs src="../wxs/utils.wxs" module="utils" />
<import src="./calendar.wxml" />
......@@ -16,16 +17,9 @@
bind:after-enter="onOpened"
bind:after-leave="onClosed"
>
<template
is="calendar"
data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
/>
<include src="calendar.wxml" />
</van-popup>
<template
wx:else
is="calendar"
data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
/>
<include wx:else src="calendar.wxml" />
<van-toast id="van-toast" />
<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="computed" />
<view
class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: isLink || clickable }]) }}"
......@@ -16,7 +17,7 @@
<slot wx:else name="icon" />
<view
style="{{ (titleWidth ? 'max-width:' + titleWidth + ';min-width:' + titleWidth + ';' : '') + titleStyle }}"
style="{{ computed.titleStyle({ titleWidth, titleStyle }) }}"
class="van-cell__title title-class"
>
<block wx:if="{{ title }}">{{ title }}</block>
......
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var relation_1 = require('../common/relation');
var component_1 = require('../common/component');
component_1.VantComponent({
field: true,
relation: {
name: 'checkbox',
type: 'descendant',
current: 'checkbox-group',
linked: function (target) {
this.updateChild(target);
},
},
relation: relation_1.useChildren('checkbox', function (target) {
this.updateChild(target);
}),
props: {
max: Number,
value: {
......@@ -25,7 +21,7 @@ component_1.VantComponent({
methods: {
updateChildren: function () {
var _this = this;
(this.children || []).forEach(function (child) {
this.children.forEach(function (child) {
return _this.updateChild(child);
});
},
......
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var relation_1 = require('../common/relation');
var component_1 = require('../common/component');
function emit(target, value) {
target.$emit('input', value);
......@@ -7,11 +8,7 @@ function emit(target, value) {
}
component_1.VantComponent({
field: true,
relation: {
name: 'checkbox-group',
type: 'ancestor',
current: 'checkbox',
},
relation: relation_1.useParent('checkbox-group'),
classes: ['icon-class', 'label-class'],
props: {
value: Boolean,
......
......@@ -40,7 +40,7 @@ component_1.VantComponent({
value: color_1.WHITE,
},
color: {
type: [String, Object],
type: null,
value: color_1.BLUE,
observer: function () {
var _this = this;
......
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var relation_1 = require('../common/relation');
var component_1 = require('../common/component');
component_1.VantComponent({
relation: {
name: 'row',
type: 'ancestor',
current: 'col',
},
relation: relation_1.useParent('row'),
props: {
span: Number,
offset: Number,
},
data: {
viewStyle: '',
},
methods: {
setGutter: function (gutter) {
var padding = gutter / 2 + 'px';
var viewStyle = gutter
? 'padding-left: ' + padding + '; padding-right: ' + padding + ';'
: '';
if (viewStyle !== this.data.viewStyle) {
this.setData({ viewStyle: viewStyle });
}
},
},
});
<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="computed" />
<view
class="custom-class {{ utils.bem('col', [span]) }} {{ offset ? 'van-col--offset-' + offset : '' }}"
style="{{ viewStyle }}"
style="{{ computed.rootStyle({ gutter }) }}"
>
<slot />
</view>
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
var relation_1 = require('../common/relation');
var animate_1 = require('./animate');
component_1.VantComponent({
classes: ['title-class', 'content-class'],
relation: {
name: 'collapse',
type: 'ancestor',
current: 'collapse-item',
},
relation: relation_1.useParent('collapse'),
props: {
name: null,
title: null,
......
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
var relation_1 = require('../common/relation');
component_1.VantComponent({
relation: {
name: 'collapse-item',
type: 'descendant',
current: 'collapse',
},
relation: relation_1.useChildren('collapse-item'),
props: {
value: {
type: null,
......
......@@ -2,32 +2,6 @@
Object.defineProperty(exports, '__esModule', { value: true });
exports.VantComponent = void 0;
var basic_1 = require('../mixins/basic');
var relationFunctions = {
ancestor: {
linked: function (parent) {
// @ts-ignore
this.parent = parent;
},
unlinked: function () {
// @ts-ignore
this.parent = null;
},
},
descendant: {
linked: function (child) {
// @ts-ignore
this.children = this.children || [];
// @ts-ignore
this.children.push(child);
},
unlinked: function (child) {
// @ts-ignore
this.children = (this.children || []).filter(function (it) {
return it !== child;
});
},
},
};
function mapKeys(source, target, map) {
Object.keys(map).forEach(function (key) {
if (source[key]) {
......@@ -35,49 +9,7 @@ function mapKeys(source, target, map) {
}
});
}
function makeRelation(options, vantOptions, relation) {
var _a;
var type = relation.type,
name = relation.name,
linked = relation.linked,
unlinked = relation.unlinked,
linkChanged = relation.linkChanged;
var beforeCreate = vantOptions.beforeCreate,
destroyed = vantOptions.destroyed;
if (type === 'descendant') {
options.created = function () {
beforeCreate && beforeCreate.bind(this)();
this.children = this.children || [];
};
options.detached = function () {
this.children = [];
destroyed && destroyed.bind(this)();
};
}
options.relations = Object.assign(
options.relations || {},
((_a = {}),
(_a['../' + name + '/index'] = {
type: type,
linked: function (node) {
relationFunctions[type].linked.bind(this)(node);
linked && linked.bind(this)(node);
},
linkChanged: function (node) {
linkChanged && linkChanged.bind(this)(node);
},
unlinked: function (node) {
relationFunctions[type].unlinked.bind(this)(node);
unlinked && unlinked.bind(this)(node);
},
}),
_a)
);
}
function VantComponent(vantOptions) {
if (vantOptions === void 0) {
vantOptions = {};
}
var options = {};
mapKeys(vantOptions, options, {
data: 'data',
......@@ -87,32 +19,25 @@ function VantComponent(vantOptions) {
beforeCreate: 'created',
created: 'attached',
mounted: 'ready',
relations: 'relations',
destroyed: 'detached',
classes: 'externalClasses',
});
var relation = vantOptions.relation;
if (relation) {
makeRelation(options, vantOptions, relation);
}
// add default externalClasses
options.externalClasses = options.externalClasses || [];
options.externalClasses.push('custom-class');
// add default behaviors
options.behaviors = options.behaviors || [];
options.behaviors.push(basic_1.basic);
// add relations
var relation = vantOptions.relation;
if (relation) {
options.relations = relation.relations;
options.behaviors.push(relation.mixin);
}
// map field to form-field behavior
if (vantOptions.field) {
options.behaviors.push('wx://form-field');
}
if (options.properties) {
Object.keys(options.properties).forEach(function (name) {
if (Array.isArray(options.properties[name])) {
// miniprogram do not allow multi type
options.properties[name] = null;
}
});
}
// add default options
options.options = {
multipleSlots: true,
......
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.getSystemInfoSync = exports.nextTick = exports.range = void 0;
exports.getCurrentPage = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.getSystemInfoSync = exports.nextTick = exports.range = void 0;
var validator_1 = require('./validator');
var version_1 = require('./version');
function range(num, min, max) {
......@@ -106,3 +106,8 @@ function toPromise(promiseLike) {
return Promise.resolve(promiseLike);
}
exports.toPromise = toPromise;
function getCurrentPage() {
var pages = getCurrentPages();
return pages[pages.length - 1];
}
exports.getCurrentPage = getCurrentPage;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
......@@ -70,6 +70,7 @@ component_1.VantComponent({
confirm: false,
cancel: false,
},
callback: function () {},
},
methods: {
onConfirm: function () {
......@@ -79,7 +80,7 @@ component_1.VantComponent({
this.handleAction('cancel');
},
onClickOverlay: function () {
this.onClose('overlay');
this.close('overlay');
},
close: function (action) {
var _this = this;
......
......@@ -3,33 +3,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
var component_1 = require('../common/component');
component_1.VantComponent({
props: {
dashed: {
type: Boolean,
value: false,
},
hairline: {
type: Boolean,
value: false,
},
contentPosition: {
type: String,
value: '',
},
fontSize: {
type: Number,
value: '',
},
borderColor: {
type: String,
value: '',
},
textColor: {
type: String,
value: '',
},
customStyle: {
type: String,
value: '',
},
dashed: Boolean,
hairline: Boolean,
contentPosition: String,
fontSize: String,