Commit 01fdd129 by 前端

Merge branch 'SAAS+V5.0.0-1014' into 'master'

上线合并

See merge request !13
2 parents 034f1721 3ee89f07
Showing 95 changed files with 2391 additions and 409 deletions
import newApi from '~/utils/request/newRequest'
export {
newApi
}
\ No newline at end of file
......@@ -85,7 +85,8 @@
"pages/warReport/warReport",
"pages/visitor/visitor",
"pages/monthReport/monthReport",
"pages/crowdDetail/crowdDetail"
"pages/crowdDetail/crowdDetail",
"pages/vehicleDetail/vehicleDetail"
]
},
{
......@@ -128,7 +129,10 @@
"glsx-image": "/components/image/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-calendar": "@vant/weapp/calendar/index",
"no-product": "/components/NoProduct/index"
"no-product": "/components/NoProduct/index",
"van-icon": "@vant/weapp/icon/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-picker": "@vant/weapp/picker/index"
},
"resolveAlias": {
"~/*": "/*"
......
......@@ -38,6 +38,10 @@ var button_1 = require("../mixins/button");
type: Boolean,
value: true,
},
rootPortal: {
type: Boolean,
value: false,
},
},
methods: {
onSelect: function (event) {
......
......@@ -9,6 +9,7 @@
custom-class="van-action-sheet custom-class"
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
close-on-click-overlay="{{ closeOnClickOverlay }}"
root-portal="{{ rootPortal }}"
bind:close="onClickOverlay"
>
<view wx:if="{{ title }}" class="van-action-sheet__header">
......
......@@ -2,7 +2,7 @@
<wxs src="./index.wxs" module="computed" />
<button
id="{{ id }}"
id="{{ id || buttonId }}"
data-detail="{{ dataset }}"
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
hover-class="{{ disabled || loading ? '' : 'van-button--active hover-class'}}"
......@@ -22,6 +22,8 @@
bindgetuserinfo="onGetUserInfo"
bindcontact="onContact"
bindgetphonenumber="onGetPhoneNumber"
bindgetrealtimephonenumber="onGetRealTimePhoneNumber"
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
binderror="onError"
bindlaunchapp="onLaunchApp"
bindopensetting="onOpenSetting"
......
<wxs src="./index.wxs" module="computed" />
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-calendar">
<header
title="{{ title }}"
......
......@@ -56,6 +56,7 @@ var getTime = function (date) {
},
defaultDate: {
type: null,
value: (0, utils_1.getToday)().getTime(),
observer: function (val) {
this.setData({ currentDate: val });
this.scrollIntoView();
......@@ -128,12 +129,24 @@ var getTime = function (date) {
value: 0,
},
readonly: Boolean,
rootPortal: {
type: Boolean,
value: false,
},
},
data: {
subtitle: '',
currentDate: null,
scrollIntoView: '',
},
watch: {
minDate: function () {
this.initRect();
},
maxDate: function () {
this.initRect();
},
},
created: function () {
this.setData({
currentDate: this.getInitialDate(this.data.defaultDate),
......@@ -147,7 +160,7 @@ var getTime = function (date) {
},
methods: {
reset: function () {
this.setData({ currentDate: this.getInitialDate() });
this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) });
this.scrollIntoView();
},
initRect: function () {
......@@ -185,13 +198,16 @@ var getTime = function (date) {
var _this = this;
if (defaultDate === void 0) { defaultDate = null; }
var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, allowSameDay = _a.allowSameDay;
if (!defaultDate)
return [];
var now = (0, utils_1.getToday)().getTime();
if (type === 'range') {
if (!Array.isArray(defaultDate)) {
defaultDate = [];
}
var _b = defaultDate || [], startDay = _b[0], endDay = _b[1];
var start = this.limitDateRange(startDay || now, minDate, (0, utils_1.getPrevDay)(new Date(maxDate)).getTime());
var startDate = getTime(startDay || now);
var start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : (0, utils_1.getPrevDay)(new Date(maxDate)).getTime());
var date = getTime(endDay || now);
var end = this.limitDateRange(date, allowSameDay ? date : (0, utils_1.getNextDay)(new Date(minDate)).getTime());
return [start, end];
......@@ -211,6 +227,8 @@ var getTime = function (date) {
var _this = this;
(0, utils_2.requestAnimationFrame)(function () {
var _a = _this.data, currentDate = _a.currentDate, type = _a.type, show = _a.show, poppable = _a.poppable, minDate = _a.minDate, maxDate = _a.maxDate;
if (!currentDate)
return;
// @ts-ignore
var targetDate = type === 'single' ? currentDate : currentDate[0];
var displayed = show || !poppable;
......
......@@ -13,6 +13,7 @@
closeable="{{ showTitle || showSubtitle }}"
close-on-click-overlay="{{ closeOnClickOverlay }}"
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
root-portal="{{ rootPortal }}"
bind:enter="onOpen"
bind:close="onClose"
bind:after-enter="onOpened"
......
@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important}
\ No newline at end of file
@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important}
\ No newline at end of file
......@@ -98,6 +98,8 @@ var STEP = 1;
var _a = this.data, color = _a.color, size = _a.size;
if ((0, validator_1.isObj)(color)) {
return this.getContext().then(function (context) {
if (!context)
return;
var LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color)
.sort(function (a, b) { return parseFloat(a) - parseFloat(b); })
......@@ -142,6 +144,8 @@ var STEP = 1;
var _this = this;
var size = this.data.size;
this.getContext().then(function (context) {
if (!context)
return;
context.clearRect(0, 0, size, size);
_this.renderLayerCircle(context);
var formatValue = format(currentValue);
......
......@@ -26,6 +26,7 @@ var animate_1 = require("./animate");
},
data: {
expanded: false,
parentBorder: true,
},
mounted: function () {
this.updateExpanded();
......@@ -36,7 +37,7 @@ var animate_1 = require("./animate");
if (!this.parent) {
return;
}
var _a = this.parent.data, value = _a.value, accordion = _a.accordion;
var _a = this.parent.data, value = _a.value, accordion = _a.accordion, border = _a.border;
var _b = this.parent.children, children = _b === void 0 ? [] : _b;
var name = this.data.name;
var index = children.indexOf(this);
......@@ -47,7 +48,7 @@ var animate_1 = require("./animate");
if (expanded !== this.data.expanded) {
(0, animate_1.setContentAnimate)(this, expanded, this.mounted);
}
this.setData({ index: index, expanded: expanded });
this.setData({ index: index, expanded: expanded, parentBorder: border });
},
onClick: function () {
if (this.data.disabled) {
......
<wxs src="../wxs/utils.wxs" module="utils" />
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
<view class="van-collapse-item custom-class {{ index !== 0 && parentBorder ? 'van-hairline--top' : '' }}">
<van-cell
size="{{ size }}"
title="{{ title }}"
......
......@@ -14,4 +14,8 @@ export declare function getRect(context: WechatMiniprogram.Component.TrivialInst
export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void;
export declare function toPromise(promiseLike: Promise<unknown> | unknown): Promise<unknown>;
export declare function addNumber(num1: any, num2: any): number;
export declare const clamp: (num: any, min: any, max: any) => number;
export declare function getCurrentPage<T>(): T & WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> & WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> & WechatMiniprogram.IAnyObject;
export declare const isPC: boolean;
export declare const isWxWork: boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentPage = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0;
exports.isWxWork = exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0;
var validator_1 = require("./validator");
var version_1 = require("./version");
var validator_2 = require("./validator");
......@@ -90,8 +90,20 @@ function toPromise(promiseLike) {
return Promise.resolve(promiseLike);
}
exports.toPromise = toPromise;
// 浮点数精度处理
function addNumber(num1, num2) {
var cardinal = Math.pow(10, 10);
return Math.round((num1 + num2) * cardinal) / cardinal;
}
exports.addNumber = addNumber;
// 限制value在[min, max]之间
var clamp = function (num, min, max) { return Math.min(Math.max(num, min), max); };
exports.clamp = clamp;
function getCurrentPage() {
var pages = getCurrentPages();
return pages[pages.length - 1];
}
exports.getCurrentPage = getCurrentPage;
exports.isPC = ['mac', 'windows'].includes((0, version_1.getSystemInfoSync)().platform);
// 是否企业微信
exports.isWxWork = (0, version_1.getSystemInfoSync)().environment === 'wxwork';
/// <reference types="miniprogram-api-typings" />
export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo;
interface WxWorkSystemInfo extends WechatMiniprogram.SystemInfo {
environment?: 'wxwork';
}
interface SystemInfo extends WxWorkSystemInfo, WechatMiniprogram.SystemInfo {
}
export declare function getSystemInfoSync(): SystemInfo;
export declare function canIUseModel(): boolean;
export declare function canIUseFormFieldButton(): boolean;
export declare function canIUseAnimate(): boolean;
......@@ -7,3 +12,4 @@ export declare function canIUseGroupSetData(): boolean;
export declare function canIUseNextTick(): boolean;
export declare function canIUseCanvas2d(): boolean;
export declare function canIUseGetUserProfile(): boolean;
export {};
......@@ -4,6 +4,7 @@ interface VantComponentInstance {
children: WechatMiniprogram.Component.TrivialInstance[];
index: number;
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
setView: (value: Record<string, any>, callback?: () => void) => void;
}
export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
data?: Data;
......
......@@ -6,6 +6,7 @@ var color_1 = require("../common/color");
var utils_1 = require("../common/utils");
(0, component_1.VantComponent)({
mixins: [button_1.button],
classes: ['cancle-button-class', 'confirm-button-class'],
props: {
show: {
type: Boolean,
......@@ -19,14 +20,17 @@ var utils_1 = require("../common/utils");
type: String,
value: 'default',
},
useSlot: Boolean,
confirmButtonId: String,
className: String,
customStyle: String,
asyncClose: Boolean,
messageAlign: String,
beforeClose: null,
overlayStyle: String,
useSlot: Boolean,
useTitleSlot: Boolean,
useConfirmButtonSlot: Boolean,
useCancelButtonSlot: Boolean,
showCancelButton: Boolean,
closeOnClickOverlay: Boolean,
confirmButtonOpenType: String,
......@@ -63,6 +67,10 @@ var utils_1 = require("../common/utils");
type: String,
value: 'scale',
},
rootPortal: {
type: Boolean,
value: false,
},
},
data: {
loading: {
......@@ -82,15 +90,16 @@ var utils_1 = require("../common/utils");
this.close('overlay');
},
close: function (action) {
var _this = this;
this.setData({ show: false });
wx.nextTick(function () {
_this.$emit('close', action);
var callback = _this.data.callback;
if (callback) {
callback(action, _this);
}
});
this.closeAction = action;
},
onAfterLeave: function () {
var action = this.closeAction;
this.$emit('close', action);
var callback = this.data.callback;
if (callback) {
callback(action, this);
}
},
stopLoading: function () {
this.setData({
......
......@@ -9,7 +9,9 @@
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
overlay-style="{{ overlayStyle }}"
close-on-click-overlay="{{ closeOnClickOverlay }}"
root-portal="{{ rootPortal }}"
bind:close="onClickOverlay"
bind:after-leave="onAfterLeave"
>
<view
wx:if="{{ title || useTitleSlot }}"
......@@ -33,7 +35,7 @@
size="large"
loading="{{ loading.cancel }}"
class="van-dialog__button van-hairline--right"
custom-class="van-dialog__cancel"
custom-class="van-dialog__cancel cancle-button-class"
custom-style="color: {{ cancelButtonColor }}"
bind:click="onCancel"
>
......@@ -44,9 +46,9 @@
size="large"
class="van-dialog__button"
loading="{{ loading.confirm }}"
custom-class="van-dialog__confirm"
custom-class="van-dialog__confirm confirm-button-class"
custom-style="color: {{ confirmButtonColor }}"
button-id="{{ confirmButtonId }}"
open-type="{{ confirmButtonOpenType }}"
lang="{{ lang }}"
business-id="{{ businessId }}"
......@@ -56,7 +58,8 @@
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
app-parameter="{{ appParameter }}"
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
bindgetRealTimePhoneNumber="onGetRealTimePhoneNumber"
bind:click="onConfirm"
bindgetuserinfo="onGetUserInfo"
bindcontact="onContact"
......@@ -70,44 +73,54 @@
</van-goods-action>
<view wx:elif="{{ showCancelButton || showConfirmButton }}" class="van-hairline--top van-dialog__footer">
<van-button
wx:if="{{ showCancelButton }}"
size="large"
loading="{{ loading.cancel }}"
class="van-dialog__button van-hairline--right"
custom-class="van-dialog__cancel"
custom-style="color: {{ cancelButtonColor }}"
bind:click="onCancel"
>
{{ cancelButtonText }}
</van-button>
<van-button
wx:if="{{ showConfirmButton }}"
size="large"
class="van-dialog__button"
loading="{{ loading.confirm }}"
custom-class="van-dialog__confirm"
custom-style="color: {{ confirmButtonColor }}"
<block wx:if="{{ showCancelButton }}">
<slot wx:if="{{ useCancelButtonSlot }}" name="cancel-button" />
open-type="{{ confirmButtonOpenType }}"
lang="{{ lang }}"
business-id="{{ businessId }}"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
app-parameter="{{ appParameter }}"
<van-button
wx:else
size="large"
loading="{{ loading.cancel }}"
class="van-dialog__button van-hairline--right"
custom-class="van-dialog__cancel cancle-button-class"
custom-style="color: {{ cancelButtonColor }}"
bind:click="onCancel"
>
{{ cancelButtonText }}
</van-button>
</block>
bind:click="onConfirm"
bindgetuserinfo="onGetUserInfo"
bindcontact="onContact"
bindgetphonenumber="onGetPhoneNumber"
binderror="onError"
bindlaunchapp="onLaunchApp"
bindopensetting="onOpenSetting"
>
{{ confirmButtonText }}
</van-button>
<block wx:if="{{ showConfirmButton }}">
<slot wx:if="{{ useConfirmButtonSlot }}" name="confirm-button" />
<van-button
wx:else
size="large"
class="van-dialog__button"
loading="{{ loading.confirm }}"
custom-class="van-dialog__confirm confirm-button-class"
custom-style="color: {{ confirmButtonColor }}"
button-id="{{ confirmButtonId }}"
open-type="{{ confirmButtonOpenType }}"
lang="{{ lang }}"
business-id="{{ businessId }}"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
app-parameter="{{ appParameter }}"
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
bindgetRealTimePhoneNumber="onGetRealTimePhoneNumber"
bind:click="onConfirm"
bindgetuserinfo="onGetUserInfo"
bindcontact="onContact"
bindgetphonenumber="onGetPhoneNumber"
binderror="onError"
bindlaunchapp="onLaunchApp"
bindopensetting="onOpenSetting"
>
{{ confirmButtonText }}
</van-button>
</block>
</view>
</van-popup>
......@@ -44,16 +44,36 @@ var props_1 = require("./props");
innerValue: '',
showClear: false,
},
watch: {
value: function (value) {
if (value !== this.value) {
this.setData({ innerValue: value });
this.value = value;
this.setShowClear();
}
},
clearTrigger: function () {
this.setShowClear();
},
},
created: function () {
this.value = this.data.value;
this.setData({ innerValue: this.value });
},
methods: {
formatValue: function (value) {
var maxlength = this.data.maxlength;
if (maxlength !== -1 && value.length > maxlength) {
return value.slice(0, maxlength);
}
return value;
},
onInput: function (event) {
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
this.value = value;
var formatValue = this.formatValue(value);
this.value = formatValue;
this.setShowClear();
this.emitChange(event.detail);
return this.emitChange(__assign(__assign({}, event.detail), { value: formatValue }));
},
onFocus: function (event) {
this.focused = true;
......@@ -101,15 +121,20 @@ var props_1 = require("./props");
onKeyboardHeightChange: function (event) {
this.$emit('keyboardheightchange', event.detail);
},
onBindNicknameReview: function (event) {
this.$emit('nicknamereview', event.detail);
},
emitChange: function (detail) {
var _this = this;
var extraEventParams = this.data.extraEventParams;
this.setData({ value: detail.value });
(0, utils_1.nextTick)(function () {
var data = extraEventParams ? detail : detail.value;
_this.$emit('input', data);
_this.$emit('change', data);
});
var result;
var data = extraEventParams
? __assign(__assign({}, detail), { callback: function (data) {
result = data;
} }) : detail.value;
this.$emit('input', data);
this.$emit('change', data);
return result;
},
setShowClear: function () {
var _a = this.data, clearable = _a.clearable, readonly = _a.readonly, clearTrigger = _a.clearTrigger;
......@@ -120,7 +145,7 @@ var props_1 = require("./props");
var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
showClear = hasValue && trigger;
}
this.setData({ showClear: showClear });
this.setView({ showClear: showClear });
},
noop: function () { },
},
......
......@@ -13,12 +13,12 @@
title-style="margin-right: 12px;"
custom-style="{{ customStyle }}"
arrow-direction="{{ arrowDirection }}"
custom-class="van-field"
custom-class="custom-class van-field"
>
<slot name="left-icon" slot="icon" />
<view wx:if="{{ label }}" class="label-class {{ utils.bem('field__label', { disabled }) }}" slot="title">
<label for="{{ name }}" wx:if="{{ label }}" class="label-class {{ utils.bem('field__label', { disabled }) }}" slot="title">
{{ label }}
</view>
</label>
<slot wx:else name="label" slot="title" />
<view class="{{ utils.bem('field__body', [type]) }}">
<view class="{{ utils.bem('field__control', [inputAlign, 'custom']) }}" bindtap="onClickInput">
......@@ -47,10 +47,10 @@
<slot name="button" />
</view>
</view>
<view wx:if="{{ showWordLimit && maxlength }}" class="van-field__word-limit">
<label for="{{ name }}" wx:if="{{ showWordLimit && maxlength }}" class="van-field__word-limit">
<view class="{{ utils.bem('field__word-num', { full: value.length >= maxlength }) }}">{{ value.length >= maxlength ? maxlength : value.length }}</view>/{{ maxlength }}
</view>
<view wx:if="{{ errorMessage }}" class="{{ utils.bem('field__error-message', [errorMessageAlign, { disabled, error }]) }}">
</label>
<label for="{{ name }}" wx:if="{{ errorMessage }}" class="{{ utils.bem('field__error-message', [errorMessageAlign, { disabled, error }]) }}">
{{ errorMessage }}
</view>
</label>
</van-cell>
@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)}
\ No newline at end of file
@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);display:block;font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)}
\ No newline at end of file
<wxs src="../wxs/utils.wxs" module="utils" />
<input
id="{{ name }}"
class="{{ utils.bem('field__control', [inputAlign, { disabled, error }]) }} input-class"
type="{{ type }}"
focus="{{ focus }}"
......@@ -25,4 +27,5 @@
bindfocus="onFocus"
bindconfirm="onConfirm"
bindkeyboardheightchange="onKeyboardHeightChange"
bindnicknamereview="onBindNicknameReview"
/>
......@@ -2,15 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.textareaProps = exports.inputProps = exports.commonProps = void 0;
exports.commonProps = {
value: {
type: String,
observer: function (value) {
if (value !== this.value) {
this.setData({ innerValue: value });
this.value = value;
}
},
},
value: String,
placeholder: String,
placeholderStyle: String,
placeholderClass: String,
......
<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="computed" />
<textarea
id="{{ name }}"
class="{{ utils.bem('field__control', [inputAlign, type, { disabled, error }]) }} input-class"
fixed="{{ fixed }}"
focus="{{ focus }}"
......
......@@ -10,6 +10,10 @@ var link_1 = require("../mixins/link");
props: {
text: String,
color: String,
size: {
type: String,
value: 'normal',
},
loading: Boolean,
disabled: Boolean,
plain: Boolean,
......@@ -17,6 +21,10 @@ var link_1 = require("../mixins/link");
type: String,
value: 'danger',
},
customStyle: {
type: String,
value: '',
},
},
methods: {
onClick: function (event) {
......
<wxs src="../wxs/utils.wxs" module="utils" />
<van-button
id="{{ id }}"
button-id="{{ buttonId }}"
lang="{{ lang }}"
type="{{ type }}"
size="{{ size }}"
color="{{ color }}"
plain="{{ plain }}"
loading="{{ loading }}"
disabled="{{ disabled }}"
open-type="{{ openType }}"
class="{{ utils.bem('goods-action-button', [type, { first: isFirst, last: isLast, plain: plain }])}}"
custom-class="van-goods-action-button__inner"
custom-class="van-goods-action-button__inner custom-class"
custom-style="{{customStyle}}"
business-id="{{ businessId }}"
session-from="{{ sessionFrom }}"
app-parameter="{{ appParameter }}"
......@@ -22,6 +25,8 @@
bindcontact="onContact"
bindopensetting="onOpenSetting"
bindgetuserinfo="onGetUserInfo"
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
bindgetRealTimePhoneNumber="onGetRealTimePhoneNumber"
bindgetphonenumber="onGetPhoneNumber"
bindlaunchapp="onLaunchApp"
>
......
......@@ -4,13 +4,14 @@ var component_1 = require("../common/component");
var button_1 = require("../mixins/button");
var link_1 = require("../mixins/link");
(0, component_1.VantComponent)({
classes: ['icon-class', 'text-class'],
classes: ['icon-class', 'text-class', 'info-class'],
mixins: [link_1.link, button_1.button],
props: {
text: String,
dot: Boolean,
info: String,
icon: String,
size: String,
color: String,
classPrefix: {
type: String,
......
......@@ -27,11 +27,15 @@
name="{{ icon }}"
dot="{{ dot }}"
info="{{ info }}"
size="{{ size }}"
color="{{ color }}"
class-prefix="{{ classPrefix }}"
class="van-goods-action-icon__icon"
custom-class="icon-class"
info-class="info-class"
/>
<slot wx:else name="icon" />
<view wx:else>
<slot name="icon" />
</view>
<text class="text-class">{{ text }}</text>
</van-button>
......@@ -2,6 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require("../common/component");
(0, component_1.VantComponent)({
classes: ['info-class'],
props: {
dot: Boolean,
info: null,
......
......@@ -9,7 +9,7 @@
wx:if="{{ info !== null || dot }}"
dot="{{ dot }}"
info="{{ info }}"
custom-class="van-icon__info"
custom-class="van-icon__info info-class"
/>
<image
wx:if="{{ computed.isImage(name) }}"
......
......@@ -9,12 +9,12 @@ function isImage(name) {
function rootClass(data) {
var classes = ['custom-class'];
if (data.classPrefix != null) {
classes.push(data.classPrefix);
if (data.classPrefix !== 'van-icon') {
classes.push('van-icon--custom')
}
if (data.classPrefix !== 'van-icon') {
classes.push('van-icon')
if (data.classPrefix != null) {
classes.push(data.classPrefix);
}
if (isImage(data.name)) {
......
@import '../common/index.wxss';.van-image{display:inline-block;position:relative}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
\ No newline at end of file
@import '../common/index.wxss';.van-image{display:inline-block;position:relative;vertical-align:top}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
\ No newline at end of file
......@@ -10,5 +10,21 @@ exports.basic = Behavior({
this.setData(data);
return new Promise(function (resolve) { return wx.nextTick(resolve); });
},
// high performance setData
setView: function (data, callback) {
var _this = this;
var target = {};
var hasChange = false;
Object.keys(data).forEach(function (key) {
if (data[key] !== _this.data[key]) {
target[key] = data[key];
hasChange = true;
}
});
if (hasChange) {
return this.setData(target, callback);
}
return callback && callback();
},
},
});
......@@ -6,6 +6,7 @@ exports.button = Behavior({
externalClasses: ['hover-class'],
properties: {
id: String,
buttonId: String,
lang: String,
businessId: Number,
sessionFrom: String,
......@@ -31,6 +32,9 @@ exports.button = Behavior({
onGetPhoneNumber: function (event) {
this.triggerEvent('getphonenumber', event.detail);
},
onGetRealTimePhoneNumber: function (event) {
this.triggerEvent('getrealtimephonenumber', event.detail);
},
onError: function (event) {
this.triggerEvent('error', event.detail);
},
......@@ -40,6 +44,9 @@ exports.button = Behavior({
onOpenSetting: function (event) {
this.triggerEvent('opensetting', event.detail);
},
onAgreePrivacyAuthorization: function (event) {
this.triggerEvent('agreeprivacyauthorization', event.detail);
},
onChooseAvatar: function (event) {
this.triggerEvent('chooseavatar', event.detail);
},
......
......@@ -24,7 +24,6 @@ function transition(showDefaultValue) {
duration: {
type: null,
value: 300,
observer: 'observeDuration',
},
name: {
type: String,
......@@ -46,9 +45,26 @@ function transition(showDefaultValue) {
if (value === old) {
return;
}
value ? this.enter() : this.leave();
value ? this.enureEnter() : this.enureLeave();
},
enter: function () {
enureEnter: function () {
var _this = this;
if (this.enterPromise)
return;
this.enterPromise = new Promise(function (resolve) { return _this.enter(resolve); });
},
enureLeave: function () {
var _this = this;
var enterPromise = this.enterPromise;
if (!enterPromise)
return;
enterPromise
.then(function () { return new Promise(function (resolve) { return _this.leave(resolve); }); })
.then(function () {
_this.enterPromise = null;
});
},
enter: function (resolve) {
var _this = this;
var _a = this.data, duration = _a.duration, name = _a.name;
var classNames = getClassNames(name);
......@@ -75,10 +91,11 @@ function transition(showDefaultValue) {
}
_this.transitionEnded = false;
_this.setData({ classes: classNames['enter-to'] });
resolve();
});
});
},
leave: function () {
leave: function (resolve) {
var _this = this;
if (!this.data.display) {
return;
......@@ -102,7 +119,10 @@ function transition(showDefaultValue) {
return;
}
_this.transitionEnded = false;
setTimeout(function () { return _this.onTransitionEnd(); }, currentDuration);
setTimeout(function () {
_this.onTransitionEnd();
resolve();
}, currentDuration);
_this.setData({ classes: classNames['leave-to'] });
});
});
......
......@@ -64,7 +64,7 @@ var utils_1 = require("../common/utils");
(0, utils_1.getRect)(_this, '.van-notice-bar__wrap'),
]).then(function (rects) {
var contentRect = rects[0], wrapRect = rects[1];
var _a = _this.data, speed = _a.speed, scrollable = _a.scrollable, delay = _a.delay;
var scrollable = _this.data.scrollable;
if (contentRect == null ||
wrapRect == null ||
!contentRect.width ||
......@@ -73,20 +73,26 @@ var utils_1 = require("../common/utils");
return;
}
if (scrollable || wrapRect.width < contentRect.width) {
var duration = ((wrapRect.width + contentRect.width) / speed) * 1000;
_this.wrapWidth = wrapRect.width;
_this.contentWidth = contentRect.width;
_this.duration = duration;
_this.animation = wx.createAnimation({
duration: duration,
timingFunction: 'linear',
delay: delay,
});
_this.initAnimation(wrapRect.width, contentRect.width);
_this.scroll(true);
}
});
});
},
initAnimation: function (warpWidth, contentWidth) {
var _a = this.data, speed = _a.speed, delay = _a.delay;
this.wrapWidth = warpWidth;
this.contentWidth = contentWidth;
// begin 0
this.contentDuration = (contentWidth / speed) * 1000;
// begin -wrapWidth
this.duration = ((warpWidth + contentWidth) / speed) * 1000;
this.animation = wx.createAnimation({
duration: this.contentDuration,
timingFunction: 'linear',
delay: delay,
});
},
scroll: function (isInit) {
var _this = this;
if (isInit === void 0) { isInit = false; }
......@@ -98,17 +104,18 @@ var utils_1 = require("../common/utils");
.step()
.export(),
});
var duration = isInit ? this.contentDuration : this.duration;
(0, utils_1.requestAnimationFrame)(function () {
_this.setData({
animationData: _this.animation
.translateX(-_this.contentWidth)
.step()
.step({ duration: duration })
.export(),
});
});
this.timer = setTimeout(function () {
_this.scroll();
}, this.duration);
}, duration + this.data.delay);
},
onClickIcon: function (event) {
if (this.data.mode === 'closeable') {
......
......@@ -55,6 +55,10 @@ var version_1 = require("../common/version");
type: String,
value: 'clear',
},
cursorSpacing: {
type: Number,
value: 0,
},
},
methods: {
onChange: function (event) {
......
......@@ -28,6 +28,7 @@
input-class="input-class"
placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }}"
cursor-spacing="{{ cursorSpacing }}"
custom-style="padding: 5px 10px 5px 0; background-color: transparent;"
bind:blur="onBlur"
bind:focus="onFocus"
......
......@@ -38,6 +38,10 @@ var component_1 = require("../common/component");
type: null,
value: 300,
},
rootPortal: {
type: Boolean,
value: false,
},
},
methods: {
onClickOverlay: function () {
......
......@@ -11,6 +11,7 @@
overlay-style="{{ overlayStyle }}"
close-on-click-overlay="{{ closeOnClickOverlay }}"
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
root-portal="{{ rootPortal }}"
bind:close="onClose"
bind:click-overlay="onClickOverlay"
>
......
......@@ -195,8 +195,12 @@ var DRAG_STATUS = {
return '0%';
},
format: function (value) {
var _a = this.data, max = _a.max, min = _a.min, step = _a.step;
return Math.round(Math.max(min, Math.min(value, max)) / step) * step;
var min = +this.data.min;
var max = +this.data.max;
var step = +this.data.step;
value = (0, utils_1.clamp)(value, min, max);
var diff = Math.round((value - min) / step) * step;
return (0, utils_1.addNumber)(min, diff);
},
},
});
......@@ -85,35 +85,35 @@ function equal(value1, value2) {
},
created: function () {
this.setData({
currentValue: this.format(this.data.value),
currentValue: this.format(this.data.value).newValue,
});
},
methods: {
observeValue: function () {
var value = this.data.value;
this.setData({ currentValue: this.format(value) });
this.setData({ currentValue: this.format(value).newValue });
},
check: function () {
var val = this.format(this.data.currentValue);
if (!equal(val, this.data.currentValue)) {
this.setData({ currentValue: val });
var newValue = this.format(this.data.currentValue).newValue;
if (!equal(newValue, this.data.currentValue)) {
this.setData({ currentValue: newValue });
}
},
isDisabled: function (type) {
var _a = this.data, disabled = _a.disabled, disablePlus = _a.disablePlus, disableMinus = _a.disableMinus, currentValue = _a.currentValue, max = _a.max, min = _a.min;
if (type === 'plus') {
return disabled || disablePlus || currentValue >= max;
return disabled || disablePlus || +currentValue >= +max;
}
return disabled || disableMinus || currentValue <= min;
return disabled || disableMinus || +currentValue <= +min;
},
onFocus: function (event) {
this.$emit('focus', event.detail);
},
onBlur: function (event) {
var value = this.format(event.detail.value);
this.setData({ currentValue: value });
this.emitChange(value);
this.$emit('blur', __assign(__assign({}, event.detail), { value: value }));
var data = this.format(event.detail.value);
this.setData({ currentValue: data.newValue });
this.emitChange(data);
this.$emit('blur', __assign(__assign({}, event.detail), { value: +data.newValue }));
},
// filter illegal characters
filter: function (value) {
......@@ -123,17 +123,16 @@ function equal(value1, value2) {
}
return value;
},
// limit value range
format: function (value) {
value = this.filter(value);
// filter illegal characters and format integer
var safeValue = this.filter(value);
// format range
value = value === '' ? 0 : +value;
value = Math.max(Math.min(this.data.max, value), this.data.min);
var rangeValue = Math.max(Math.min(this.data.max, +safeValue), this.data.min);
// format decimal
if ((0, validator_1.isDef)(this.data.decimalLength)) {
value = value.toFixed(this.data.decimalLength);
}
return value;
var newValue = (0, validator_1.isDef)(this.data.decimalLength)
? rangeValue.toFixed(this.data.decimalLength)
: String(rangeValue);
return { value: value, newValue: newValue };
},
onInput: function (event) {
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
......@@ -141,19 +140,16 @@ function equal(value1, value2) {
if (value === '') {
return;
}
var formatted = this.filter(value);
// limit max decimal length
if ((0, validator_1.isDef)(this.data.decimalLength) && formatted.indexOf('.') !== -1) {
var pair = formatted.split('.');
formatted = "".concat(pair[0], ".").concat(pair[1].slice(0, this.data.decimalLength));
}
var formatted = this.format(value);
this.emitChange(formatted);
},
emitChange: function (value) {
emitChange: function (data) {
var value = data.value, newValue = data.newValue;
if (!this.data.asyncChange) {
this.setData({ currentValue: value });
// fix when input 11. parsed to 11, unable to enter decimal
this.setData({ currentValue: +value === +newValue ? value : newValue });
}
this.$emit('change', value);
this.$emit('change', +newValue);
},
onChange: function () {
var type = this.type;
......@@ -162,7 +158,7 @@ function equal(value1, value2) {
return;
}
var diff = type === 'minus' ? -this.data.step : +this.data.step;
var value = this.format(add(+this.data.currentValue, diff));
var value = this.format(String(add(+this.data.currentValue, diff)));
this.emitChange(value);
this.$emit(type);
},
......
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{position:absolute;right:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
\ No newline at end of file
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{bottom:0;position:absolute;right:0;top:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
\ No newline at end of file
......@@ -61,10 +61,8 @@ var ROOT_ELEMENT = '.van-sticky';
}
this.scrollTop = scrollTop || this.scrollTop;
if (typeof container === 'function') {
Promise.all([
(0, utils_1.getRect)(this, ROOT_ELEMENT),
this.getContainerRect(),
]).then(function (_a) {
Promise.all([(0, utils_1.getRect)(this, ROOT_ELEMENT), this.getContainerRect()])
.then(function (_a) {
var root = _a[0], container = _a[1];
if (offsetTop + root.height > container.height + container.top) {
_this.setDataAfterDiff({
......@@ -82,11 +80,12 @@ var ROOT_ELEMENT = '.van-sticky';
else {
_this.setDataAfterDiff({ fixed: false, transform: 0 });
}
});
})
.catch(function () { });
return;
}
(0, utils_1.getRect)(this, ROOT_ELEMENT).then(function (root) {
if (!(0, validator_1.isDef)(root)) {
if (!(0, validator_1.isDef)(root) || (!root.width && !root.height)) {
return;
}
if (offsetTop >= root.top) {
......@@ -118,6 +117,9 @@ var ROOT_ELEMENT = '.van-sticky';
},
getContainerRect: function () {
var nodesRef = this.data.container();
if (!nodesRef) {
return Promise.reject(new Error('not found container'));
}
return new Promise(function (resolve) { return nodesRef.boundingClientRect(resolve).exec(); });
},
},
......
......@@ -179,6 +179,9 @@ var relation_1 = require("../common/relation");
});
});
if (currentIndex === data.currentIndex) {
if (!data.inited) {
this.resize();
}
return;
}
var shouldEmitChange = data.currentIndex !== null;
......
<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="computed" />
<view class="custom-class {{ utils.bem('tabs', [type]) }}">
<view class="custom-class {{ utils.bem('tabs') }}">
<van-sticky
disabled="{{ !sticky }}"
z-index="{{ zIndex }}"
......@@ -9,7 +9,7 @@
container="{{ container }}"
bind:scroll="onTouchScroll"
>
<view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }} wrap-class">
<view class="{{ utils.bem('tabs--') + type }} {{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }} wrap-class">
<slot name="nav-left" />
<scroll-view
......
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{display:inline-block;position:relative!important;top:-1px!important;transform:translateX(0)!important}
\ No newline at end of file
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff);overflow:auto}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line{height:var(--tabs-line-height,44px)}.van-tabs--card{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
\ No newline at end of file
......@@ -12,9 +12,9 @@ var __assign = (this && this.__assign) || function () {
};
Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require("../common/component");
var utils_1 = require("./utils");
var shared_1 = require("./shared");
var validator_1 = require("../common/validator");
var shared_1 = require("./shared");
var utils_1 = require("./utils");
(0, component_1.VantComponent)({
props: __assign(__assign(__assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
type: null,
......@@ -47,6 +47,9 @@ var validator_1 = require("../common/validator");
}, previewFullImage: {
type: Boolean,
value: true,
}, videoFit: {
type: String,
value: 'contain',
}, imageFit: {
type: String,
value: 'scaleToFill',
......@@ -165,6 +168,8 @@ var validator_1 = require("../common/validator");
});
},
onPreviewFile: function (event) {
if (!this.data.previewFile)
return;
var index = event.currentTarget.dataset.index;
wx.openDocument({
filePath: this.data.lists[index].url,
......
......@@ -28,6 +28,8 @@
title="{{ item.name || ('视频' + index) }}"
poster="{{ item.thumb }}"
autoplay="{{ item.autoplay }}"
object-fit="{{videoFit}}"
referrer-policy="{{ referrerPolicy }}"
class="van-uploader__preview-image"
style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}"
......
......@@ -29,6 +29,10 @@ export declare const videoProps: {
type: StringConstructor;
value: string;
};
referrerPolicy: {
type: StringConstructor;
value: string;
};
};
export declare const mediaProps: {
capture: {
......@@ -50,4 +54,8 @@ export declare const mediaProps: {
};
export declare const messageFileProps: {
extension: null;
previewFile: {
type: BooleanConstructor;
value: boolean;
};
};
......@@ -34,6 +34,10 @@ exports.videoProps = {
type: String,
value: 'back',
},
referrerPolicy: {
type: String,
value: 'no-referrer',
},
};
// props for media
exports.mediaProps = {
......@@ -43,7 +47,7 @@ exports.mediaProps = {
},
mediaType: {
type: Array,
value: ['image', 'video'],
value: ['image', 'video', 'mix'],
},
maxDuration: {
type: Number,
......@@ -57,4 +61,8 @@ exports.mediaProps = {
// props for file
exports.messageFileProps = {
extension: null,
previewFile: {
type: Boolean,
value: true,
},
};
......@@ -41,7 +41,7 @@ function isVideoFile(item) {
}
exports.isVideoFile = isVideoFile;
function formatImage(res) {
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { type: 'image', url: item.path, thumb: item.path })); });
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { type: 'image', url: item.tempFilePath || item.path, thumb: item.tempFilePath || item.path })); });
}
function formatVideo(res) {
return [
......@@ -49,7 +49,7 @@ function formatVideo(res) {
];
}
function formatMedia(res) {
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['fileType', 'thumbTempFilePath', 'tempFilePath'])), { type: res.type, url: item.tempFilePath, thumb: res.type === 'video' ? item.thumbTempFilePath : item.tempFilePath })); });
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['fileType', 'thumbTempFilePath', 'tempFilePath'])), { type: item.fileType, url: item.tempFilePath, thumb: item.fileType === 'video' ? item.thumbTempFilePath : item.tempFilePath })); });
}
function formatFile(res) {
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { url: item.path })); });
......@@ -59,13 +59,27 @@ function chooseFile(_a) {
return new Promise(function (resolve, reject) {
switch (accept) {
case 'image':
wx.chooseImage({
count: multiple ? Math.min(maxCount, 9) : 1,
sourceType: capture,
sizeType: sizeType,
success: function (res) { return resolve(formatImage(res)); },
fail: reject,
});
if (utils_1.isPC || utils_1.isWxWork) {
wx.chooseImage({
count: multiple ? Math.min(maxCount, 9) : 1,
sourceType: capture,
sizeType: sizeType,
success: function (res) { return resolve(formatImage(res)); },
fail: reject,
});
}
else {
wx.chooseMedia({
count: multiple ? Math.min(maxCount, 9) : 1,
mediaType: ['image'],
sourceType: capture,
maxDuration: maxDuration,
sizeType: sizeType,
camera: camera,
success: function (res) { return resolve(formatImage(res)); },
fail: reject,
});
}
break;
case 'media':
wx.chooseMedia({
......
......@@ -4,10 +4,119 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@sentry-internal/feedback": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.120.4.tgz",
"integrity": "sha512-eSwgvTdrh03zYYaI6UVOjI9p4VmKg6+c2+CBQfRZX++6wwnCVsNv7XF7WUIpVGBAkJ0N2oapjQmCzJKGKBRWQg==",
"requires": {
"@sentry/core": "7.120.4",
"@sentry/types": "7.120.4",
"@sentry/utils": "7.120.4"
}
},
"@sentry-internal/replay-canvas": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.120.4.tgz",
"integrity": "sha512-2+W4CgUL1VzrPjArbTid4WhKh7HH21vREVilZdvffQPVwOEpgNTPAb69loQuTlhJVveh9hWTj2nE5UXLbLP+AA==",
"requires": {
"@sentry/core": "7.120.4",
"@sentry/replay": "7.120.4",
"@sentry/types": "7.120.4",
"@sentry/utils": "7.120.4"
}
},
"@sentry-internal/tracing": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.120.4.tgz",
"integrity": "sha512-Fz5+4XCg3akeoFK+K7g+d7HqGMjmnLoY2eJlpONJmaeT9pXY7yfUyXKZMmMajdE2LxxKJgQ2YKvSCaGVamTjHw==",
"requires": {
"@sentry/core": "7.120.4",
"@sentry/types": "7.120.4",
"@sentry/utils": "7.120.4"
}
},
"@sentry/browser": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.120.4.tgz",
"integrity": "sha512-ymlNtIPG6HAKzM/JXpWVGCzCNufZNADfy+O/olZuVJW5Be1DtOFyRnBvz0LeKbmxJbXb2lX/XMhuen6PXPdoQw==",
"requires": {
"@sentry-internal/feedback": "7.120.4",
"@sentry-internal/replay-canvas": "7.120.4",
"@sentry-internal/tracing": "7.120.4",
"@sentry/core": "7.120.4",
"@sentry/integrations": "7.120.4",
"@sentry/replay": "7.120.4",
"@sentry/types": "7.120.4",
"@sentry/utils": "7.120.4"
}
},
"@sentry/core": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.120.4.tgz",
"integrity": "sha512-TXu3Q5kKiq8db9OXGkWyXUbIxMMuttB5vJ031yolOl5T/B69JRyAoKuojLBjRv1XX583gS1rSSoX8YXX7ATFGA==",
"requires": {
"@sentry/types": "7.120.4",
"@sentry/utils": "7.120.4"
}
},
"@sentry/integrations": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.120.4.tgz",
"integrity": "sha512-kkBTLk053XlhDCg7OkBQTIMF4puqFibeRO3E3YiVc4PGLnocXMaVpOSCkMqAc1k1kZ09UgGi8DxfQhnFEjUkpA==",
"requires": {
"@sentry/core": "7.120.4",
"@sentry/types": "7.120.4",
"@sentry/utils": "7.120.4",
"localforage": "^1.8.1"
}
},
"@sentry/replay": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.120.4.tgz",
"integrity": "sha512-FW8sPenNFfnO/K7sncsSTX4rIVak9j7VUiLIagJrcqZIC7d1dInFNjy8CdVJUlyz3Y3TOgIl3L3+ZpjfyMnaZg==",
"requires": {
"@sentry-internal/tracing": "7.120.4",
"@sentry/core": "7.120.4",
"@sentry/types": "7.120.4",
"@sentry/utils": "7.120.4"
}
},
"@sentry/types": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.120.4.tgz",
"integrity": "sha512-cUq2hSSe6/qrU6oZsEP4InMI5VVdD86aypE+ENrQ6eZEVLTCYm1w6XhW1NvIu3UuWh7gZec4a9J7AFpYxki88Q=="
},
"@sentry/utils": {
"version": "7.120.4",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.120.4.tgz",
"integrity": "sha512-zCKpyDIWKHwtervNK2ZlaK8mMV7gVUijAgFeJStH+CU/imcdquizV3pFLlSQYRswG+Lbyd6CT/LGRh3IbtkCFw==",
"requires": {
"@sentry/types": "7.120.4"
}
},
"@vant/weapp": {
"version": "1.10.15",
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.10.15.tgz",
"integrity": "sha512-swM4k3pVwt/6Tnijvq86paLiKE1CzbrBQ4lR7+9uRhwKOM0HS3ooK1Q4IjSEyxQ59ZFKmYYvZln77RZcnSDqmA=="
"version": "1.11.7",
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.7.tgz",
"integrity": "sha512-Rwn9BBnb4kHSV4XmvBicwtd42J+amEUfnFDcXJsGNPNX4a9c/DoT6YLsm4X1wB2+sQbdiQsbFBLAvGRBxCkD8g=="
},
"crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"dayjs": {
"version": "1.11.18",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.18.tgz",
"integrity": "sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA=="
},
"glsk-toolkit": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/glsk-toolkit/-/glsk-toolkit-1.0.5.tgz",
"integrity": "sha512-BUWYTM5NWzN0n2jho6b5nbTwfCiQHBz+Ce5DN6MmJi8pQxI+AXFqgD5DDY1BfRdXjAVsHXdyBauw1VJjFX3Tqw==",
"requires": {
"@sentry/browser": "^7.101.1",
"crypto-js": "^4.2.0"
}
},
"glsx-applet-component": {
"version": "1.1.24",
......@@ -18,6 +127,27 @@
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/glsx-common-sdk/-/glsx-common-sdk-0.2.7.tgz",
"integrity": "sha512-qwna2x+Pe3KQLYoWFa5dXwBGmwtHMp+t/7vv60rOAaDWRSsx9iShZAZHFguYnSVBf0DTLXkeB32iWy0FgAMXdw=="
},
"immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="
},
"lie": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
"integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==",
"requires": {
"immediate": "~3.0.5"
}
},
"localforage": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",
"integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",
"requires": {
"lie": "3.1.1"
}
}
}
}
......@@ -5,6 +5,8 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.7",
"dayjs": "^1.11.18",
"glsk-toolkit": "^1.0.5",
"glsx-applet-component": "^1.1.24",
"glsx-common-sdk": "^0.2.7"
},
......
// packagesList/outDetail/components/SecondHandCar/components/Board/index.js
import Dialog from '@vant/weapp/dialog/dialog';
import { first_cell, second_cell, third_cell, fourth_cell } from '../../contant.js';
Component({
/**
* 组件的属性列表
*/
properties: {
boardData: {
type: Object,
value: {}
}
},
/**
* 组件的初始数据
*/
data: {
up: 'store-assistant-assemble/output/icon-rise.png',
down: 'store-assistant-assemble/output/icon-decline.png',
flat: 'store-assistant-assemble/output/icon-flat.png',
firstCell: first_cell,
secondCell: second_cell,
thirdCell: third_cell,
fourthCell: fourth_cell,
},
/**
* 组件的方法列表
*/
methods: {
open(e) {
console.log(e.currentTarget.dataset.type)
const type = e.currentTarget.dataset.type
let message = ''
if (type == 1) {
message = '置换率 = 二手车成交量/新车零售交车量*100%'
} else if (type == 2) {
message = '评估转换率 = 二手车收购量/二手车评估量*100%'
}
Dialog.alert({
title: '温馨提示',
message: message,
context: this,
confirmButtonColor: '#347BFF',
messageAlign: 'left',
confirmButtonText: '确定',
}).then(() => {
// on close
});
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/outDetail/components/SecondHandCar/components/Board/index.wxss */
.data-cards {
margin: 0 32rpx 0 30rpx;
padding-top: 24rpx;
height: 100%;
.data-row {
display: flex;
margin-bottom: 24rpx;
.data-card {
flex: 1;
background-color: #fff;
border-radius: 12rpx;
// padding: 20rpx;
margin: 0 20rpx;
// box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
position: relative;
&:nth-child(1),
&:nth-child(2) {
width: 238rpx;
}
&:first-child{
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
&::before {
content: '';
position: absolute;
top: 20rpx;
right: 20rpx;
width: 40rpx;
height: 40rpx;
background-size: contain;
background-repeat: no-repeat;
opacity: 0.2;
}
.first-row-title {
color: #323436;
font-size: 24rpx;
font-weight: 600;
margin-bottom: 8rpx;
}
.first-card-value {
color: #2D2D33;
font-size: 36rpx;
font-weight: 700;
line-height: 64rpx;
display: flex;
align-items: center;
.unit {
display: inline-block;
font-size: 28rpx;
color: #222222;
line-height: 50rpx;
}
}
.card-compare {
font-size: 22rpx;
display: flex;
align-items: center;
&.up {
color: #ff4d4f;
}
&.down {
color: #52c41a;
}
&.neutral {
color: #999;
}
.icon {
width: 24rpx;
height: 24rpx;
}
}
}
}
.card-row {
display: flex;
margin-bottom: 24rpx;
.data-card {
flex: 1;
background-image: linear-gradient(90deg, #F3FCFC 0%, #F9FEFF 49%, #EFF7FF 100%);
border-radius: 12rpx;
padding: 24rpx 12rpx 24rpx 16rpx;
margin-right: 16rpx;
// box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
position: relative;
&:last-child {
margin-right: 0;
}
&::before {
content: '';
position: absolute;
top: 20rpx;
right: 20rpx;
width: 40rpx;
height: 40rpx;
background-size: contain;
background-repeat: no-repeat;
opacity: 0.2;
}
.card-header {
display: flex;
align-items: center;
margin-bottom: 12rpx;
.icon {
width: 28rpx;
height: 28rpx;
}
}
.card-title {
font-size: 22rpx;
color: #5A6066;
margin-right: 2rpx;
}
.card-value {
font-size: 32rpx;
font-weight: 700;
color: #2D2D33;
margin-bottom: 8rpx;
}
.card-compare {
display: flex;
align-items: center;
font-size: 20rpx;
color: #8A8C90;
&.neutral {
color: #999;
}
.icon {
width: 24rpx;
height: 24rpx;
}
}
.card-icon {
position: absolute;
right: 6rpx;
top: 10rpx;
width: 56rpx;
height: 56rpx;
transform: translate(-50% -50%);
}
}
}
}
\ No newline at end of file
<!-- packagesList/outDetail/components/SecondHandCar/components/Board/index.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="data-cards">
<!-- 第一行卡片 -->
<view class="data-row">
<view class="data-card" wx:for="{{firstCell}}" wx:key="index">
<view class="first-row-title">{{item.name}}</view>
<view class="first-card-value"><view class="unit">¥</view>{{boardData[item.value] == null ? '-' : filter.money_three_for_two_thousands(boardData[item.value])}}</view>
<view class="card-compare neutral">
环比{{boardData[item.rate] == null ? ' -' : (boardData[item.rate] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view>
</view>
</view>
<!-- 第二行卡片 -->
<view class="card-row">
<view class="data-card" wx:for="{{secondCell}}" wx:key="index">
<view class="card-header">
<view class="card-title">{{item.name}}</view>
<glsx-image class="icon" wx:if="{{item.tipsType}}" src="store-assistant-assemble/output/icon-inco.png" bind:tap="open" data-type="{{item.tipsType}}"></glsx-image>
<glsx-image class="card-icon" src="store-assistant-assemble/output/icon7{{item.type}}.png"></glsx-image>
</view>
<view class="card-value">{{boardData[item.value] == null ? '-' : item.unit ? boardData[item.value] + item.unit : boardData[item.value]}}</view>
<view class="card-compare neutral">
环比{{boardData[item.rate] == null ? ' -' : (boardData[item.rate] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view>
</view>
</view>
<!-- 第三行卡片 -->
<view class="card-row">
<view class="data-card" wx:for="{{thirdCell}}" wx:key="index">
<view class="card-header">
<view class="card-title">{{item.name}}</view>
<glsx-image class="icon" wx:if="{{item.tipsType}}" src="store-assistant-assemble/output/icon-inco.png" bind:tap="open"data-type="{{item.tipsType}}"></glsx-image>
<glsx-image class="card-icon" src="store-assistant-assemble/output/icon7{{item.type}}.png"></glsx-image>
</view>
<view class="card-value">{{boardData[item.value] == null ? '-' : item.unit ? boardData[item.value] + item.unit : boardData[item.value]}}</view>
<view class="card-compare neutral">
环比{{boardData[item.rate] == null ? ' -' : (boardData[item.rate] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view>
</view>
</view>
<!-- 第四行卡片 -->
<view class="card-row">
<view class="data-card" wx:for="{{fourthCell}}" wx:key="index">
<view class="card-header">
<view class="card-title">{{item.name}}</view>
<glsx-image class="icon" wx:if="{{item.tipsType}}" src="store-assistant-assemble/output/icon-inco.png" bind:tap="open"data-type="{{item.tipsType}}"></glsx-image>
<glsx-image class="card-icon" src="store-assistant-assemble/output/icon7{{item.type}}.png"></glsx-image>
</view>
<view class="card-value">{{boardData[item.value] == null ? '-' : (item.unit ? boardData[item.value] + item.unit : boardData[item.value])}}</view>
<view class="card-compare neutral">
环比{{boardData[item.rate] == null ? ' -' : (boardData[item.rate] > 0 ? '+' : '') + boardData[item.rate] + '%'}}
<glsx-image wx:if="{{boardData[item.rate] != null}}" src="{{boardData[item.rate] > 0 ? up : boardData[item.rate] < 0 ? down : flat}}" class="icon"></glsx-image>
</view>
</view>
</view>
</view>
<van-dialog id="van-dialog" />
\ No newline at end of file
// packagesList/outDetail/components/SecondHandCar/components/SortTab/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
// 可以从父组件传入的初始排序字段
defaultSortField: {
type: String,
value: ''
},
// 可以从父组件传入的初始排序顺序
defaultSortOrder: {
type: String,
value: ''
}
},
/**
* 组件的初始数据
*/
data: {
sortField: '', // 当前排序字段:buyPrice(收车价) 或 sellPrice(卖出价)
sortOrder: '' // 排序顺序:asc(升序) 或 desc(降序)
},
/**
* 组件生命周期
*/
lifetimes: {
attached() {
// 组件初始化时设置默认排序
if (this.properties.defaultSortField) {
this.setData({
sortField: this.properties.defaultSortField,
sortOrder: this.properties.defaultSortOrder
});
}
}
},
/**
* 组件的方法列表
*/
methods: {
/**
* 处理排序点击事件
* @param {Object} e - 事件对象
*/
handleSort(e) {
const field = e.currentTarget.dataset.field;
let order = this.data.sortOrder;
// 如果点击的是当前排序字段,则切换排序顺序
if (field === this.data.sortField) {
if (order === 'asc') {
order = 'desc';
} else if (order === 'desc') {
order = '';
} else {
order = 'asc';
}
} else {
// 如果点击的是新字段,则默认使用升序
order = 'asc';
}
this.setData({
sortField: field,
sortOrder: order
});
// 触发排序事件,传递排序参数给父组件
this.triggerEvent('sort', {
field: field,
order: order
});
}
}
});
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
.sort-container {
width: 100%;
}
.sort-tab {
display: flex;
height: 80rpx;
padding: 0 30rpx;
.sort-item {
display: flex;
align-items: center;
justify-content: center;
margin-right: 60rpx;
height: 100%;
position: relative;
text {
font-size: 28rpx;
color: #666;
margin-right: 8rpx;
}
&.active text {
color: #333;
font-weight: 500;
}
.sort-arrows {
display: flex;
flex-direction: column;
height: 32rpx;
width: 32rpx;
.icon {
width: 100%;
height: 100%;
}
.arrow-up {
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-bottom: 10rpx solid #ccc;
margin-bottom: 4rpx;
&.active {
border-bottom-color: #3666FE;
}
}
.arrow-down {
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 10rpx solid #ccc;
&.active {
border-top-color: #3666FE;
}
}
}
}
}
\ No newline at end of file
<!--packagesList/outDetail/components/SecondHandCar/components/SortTab/index.wxml-->
<view class="sort-container">
<view class="sort-tab">
<view class="sort-item {{sortField === 'buyPrice' ? 'active' : ''}}" bindtap="handleSort" data-field="buyPrice">
<text>收车价</text>
<view class="sort-arrows">
<!-- <view class="arrow-up {{sortField === 'buyPrice' && sortOrder === 'asc' ? 'active' : ''}}"></view>
<view class="arrow-down {{sortField === 'buyPrice' && sortOrder === 'desc' ? 'active' : ''}}"></view> -->
<glsx-image src="output/sort-{{ sortField === 'buyPrice' && sortOrder === 'desc' ? 'up' : sortField === 'buyPrice' && sortOrder === 'asc' ? 'down' : 'default'}}.png" class="icon" />
</view>
</view>
<view class="sort-item {{sortField === 'sellPrice' ? 'active' : ''}}" bindtap="handleSort" data-field="sellPrice">
<text>卖出价</text>
<view class="sort-arrows">
<!-- <view class="arrow-up {{sortField === 'sellPrice' && sortOrder === 'asc' ? 'active' : ''}}"></view>
<view class="arrow-down {{sortField === 'sellPrice' && sortOrder === 'desc' ? 'active' : ''}}"></view> -->
<glsx-image src="output/sort-{{ sortField === 'sellPrice' && sortOrder === 'desc' ? 'up' : sortField === 'sellPrice' && sortOrder === 'asc' ? 'down' : 'default'}}.png" class="icon" />
</view>
</view>
</view>
</view>
\ No newline at end of file
// packagesList/outDetail/components/SecondHandCar/components/VehicleList/index.js
import {newApi} from '~/api/secondHandApi'
import {vehicle_category} from '../../contant'
import dayjs from 'dayjs'
Component({
/**
* 组件的属性列表
*/
properties: {
timeType: {
type: String,
value: 'date'
},
merchantId: {
type: String,
value: ''
},
date: {
type: String,
value: '',
observer(newVal) {
console.log(newVal, 'date')
if (newVal) {
const params = this.computedDate(newVal)
this.setData({
pageParams: {
pageNum: 1,
pageSize: 10
},
scrollTop: 0
})
this.getVehicleList(params, 'date')
}
}
},
currentWeek: {
type: String,
value: ''
},
},
/**
* 组件的初始数据
*/
data: {
vehicleList: [],
vehicle_category,
pageParams: {
pageNum: 1,
pageSize: 10
},
total: 0,
sortParams: {},
scrollTop: 0,
isEnd: false
},
lifetimes: {
attached() {
console.log('=======getVehicleList')
// this.getVehicleList()
}
},
/**
* 组件的方法列表
*/
methods: {
// 父组件中
onSort(e) {
const { field, order } = e.detail;
console.log(field, order, 'onSort')
const params = {}
if (order) {
if (order == 'asc') {
params.asc = true
} else if (order == 'desc') {
params.asc = false
}
if (field == 'buyPrice') {
params.sortBy = 1
} else if (field == 'sellPrice') {
params.sortBy = 2
}
}
this.setData({
sortParams: params,
pageParams: {
pageNum: 1,
pageSize: 10
},
scrollTop: 0
})
this.getVehicleList(params, 'sort')
},
jumpDetail(e) {
console.log(e.currentTarget.dataset.evalorderno, 'evalOrderNo')
const { evalorderno } = e.currentTarget.dataset;
wx.$router.go("/packagesList/packageOutput/pages/vehicleDetail/vehicleDetail", {
evalorderno
})
},
computedDate(date) {
const {timeType} = this.data
let dateParams = {}
if (timeType == 'date') {
dateParams.startDate = dateParams.endDate = dayjs(date).format('YYYY-MM-DD');
} else if (timeType == 'year-month') {
dateParams.startDate = dayjs(date).startOf('month').format('YYYY-MM-DD');
dateParams.endDate = dayjs(date).endOf('month').format('YYYY-MM-DD');
} else {
const [start, end] = date.split('-').map(d => dayjs(d.trim()));
dateParams.startDate = start.format('YYYY-MM-DD');
dateParams.endDate = end.format('YYYY-MM-DD');
}
return dateParams
},
getParams() {
const {pageParams, sortParams} = this.data
const dateParams = this.computedDate(this.data.date)
return {...pageParams, ...sortParams, ...dateParams}
},
// 车辆列表
async getVehicleList(params = {}, type) {
const {pageParams, sortParams, merchantId} = this.data
if (type == 'date') {
params = {...params, ...pageParams, ...sortParams}
} else if (type == 'sort') {
const dateParams = this.computedDate(this.data.date)
params = {...params, ...pageParams, ...dateParams}
} else {
params = this.getParams()
}
if (merchantId) {
params.merchantNos = [merchantId]
}
console.log(params, 'params')
wx.showLoading({
title: '加载中',
})
const result = await newApi.post('/minicarManage/findAllSoldPage', params);
if (result.records.length) {
result.records.forEach(item => {
if (item.evalImageInfoList && item.evalImageInfoList.length) {
item.img = item.evalImageInfoList.find(item => item.fileSubtype == 11)?.fileUrl
}
})
}
let vehicleList
if (pageParams.pageNum == 1) {
vehicleList = result.records || []
} else {
vehicleList = this.data.vehicleList.concat(result.records || [])
}
this.setData({
vehicleList,
total: result.total || 0
})
wx.hideLoading()
console.log(result, 'vehicleList')
},
scrollonReachBottom(e) {
console.log(e, 'scrollonReachBottom')
let { total, pageParams } = this.data
console.log(total)
if (Math.floor(total / pageParams.pageSize) == pageParams.pageNum - 1) {
return this.setData({
isEnd: true
})
}
this.setData({
pageParams: {...pageParams, pageNum: pageParams.pageNum + 1}
}, () => {
this.getVehicleList()
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {
"sort-tab": "../SortTab/index"
}
}
\ No newline at end of file
.vehicle-list {
background-color: #F8F9F9;
height: calc(100% - 230rpx - 24rpx);
.vehicle-ul {
height: calc(100% - 80rpx);
margin-bottom: 60rpx;
.vehicle-li {
margin: 0 20rpx;
background-color: #fff;
margin-bottom: 20rpx;
border-radius: 12rpx;
.vehicle-content {
display: flex;
padding: 26rpx 20rpx 24rpx;
.vehicle-img {
width: 174rpx;
height: 116rpx;
border-radius: 8rpx;
}
.vehicle-info {
margin-left: 16rpx;
.vehicle-title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
font-size: 28rpx;
font-weight: 600;
color: #323436;
margin-bottom: 12rpx;
.vehicle-type {
display: inline-flex;
justify-content: center;
align-items: center;
width: 82rpx;
height: 32rpx;
line-height: 32rpx;
font-size: 22rpx;
font-weight: normal;
border-radius: 4rpx;
margin: 4rpx 4rpx 4rpx 0;
&.orange {
background-color: #FFF9F2;
color: #F2882B;
}
&.red {
background-color: #FFF2F2;
color: #EC4D32;
}
}
.car-series {
display: inline-block;
padding-right: 8rpx;
}
}
.vehicle-desc {
font-size: 24rpx;
color: #858A94;
margin-bottom: 34rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
.vehicle-price-box {
display: flex;
.vehicle-price-item {
display: flex;
width: 50%;
align-items: baseline;
.vehicle-price-name {
font-size: 26rpx;
color: #393B3E;
line-height: 50rpx;
}
.vehicle-price-value {
display: flex;
color: #EC4D32;
align-items: baseline;
.vehicle-price-number {
display: flex;
align-items: baseline;
font-size: 36rpx;
font-weight: 700;
}
.vehicle-price-unit {
font-size: 26rpx;
}
}
}
}
}
}
.vehicle-footer {
display: flex;
justify-content: space-between;
padding: 16rpx 20rpx;
background-color: #FFF9F2;
font-size: 24rpx;
color: #8A8C90;
.footer-item {
display: flex;
align-items: center;
.name {
max-width: 280rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 16rpx;
}
}
}
}
}
}
.bottom-tip {
text-align: center;
padding: 30rpx 0;
font-size: 20rpx;
color: #BEC1C7;
}
.no-data {
font-size: 24rpx;
color:#CCCED1;
text-align: center;
&-img {
width: 512rpx;
height: 512rpx;
margin: 84rpx auto 0;
}
.text {
margin-top: -66rpx;
}
}
\ No newline at end of file
<!-- packagesList/outDetail/components/SecondHandCar/components/VehicleList/index.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="vehicle-list">
<sort-tab bind:sort="onSort"></sort-tab>
<block wx:if="{{vehicleList.length > 0}}">
<scroll-view scroll-y="true" class="vehicle-ul" bindscrolltolower="scrollonReachBottom" model:scroll-top="{{scrollTop}}">
<view style="padding-bottom: 60rpx;">
<block wx:for="{{vehicleList}}" wx:key="index">
<view class="vehicle-li" bind:tap="jumpDetail" data-evalOrderNo="{{item.evalOrderNo}}">
<view class="vehicle-content">
<image class="vehicle-img" src="{{item.img}}" mode="aspectFill"></image>
<view class="vehicle-info">
<view class="vehicle-title">
<view wx:if="{{item.evalCarBase && item.evalCarBase.vehicleCategory}}" class="vehicle-type {{item.evalCarBase && item.evalCarBase.vehicleCategory ? vehicle_category[item.evalCarBase.vehicleCategory].class : ''}}">{{item.evalCarBase && item.evalCarBase.vehicleCategory ? vehicle_category[item.evalCarBase.vehicleCategory].name : '-'}}</view>
<view class="car-series">{{item.evalCarBase && item.evalCarBase.carSeriesName ? item.evalCarBase.carSeriesName : ''}}</view>{{item.carTypeName}}
</view>
<view class="vehicle-desc">{{item.licensePlate}}|{{filter.yearFormat(item.listingDate)}}年上牌|{{filter.mileageFormat(item.mileage)}}|{{item.transfersNumber > 0 ? '二' : '一'}}手车</view>
<view class="vehicle-price-box">
<view class="vehicle-price-item">
<view class="vehicle-price-name">收车价</view>
<view class="vehicle-price-value">
<view class="vehicle-price-number">{{filter.threeNumForTwoPriceFormat(item.purchasePrice)}}</view>
<view class="vehicle-price-unit">万</view>
</view>
</view>
<view class="vehicle-price-item">
<view class="vehicle-price-name">卖出价</view>
<view class="vehicle-price-value">
<view class="vehicle-price-number">{{filter.threeNumForTwoPriceFormat(item.sellingPrice)}}</view>
<view class="vehicle-price-unit">万</view>
</view>
</view>
</view>
</view>
</view>
<view class="vehicle-footer">
<view class="footer-item"><view class="name">{{item.evalOrder && item.evalOrder.sellerName ? item.evalOrder.sellerName : '-'}}</view> {{item.sellPhone ? item.sellPhone : '-'}}</view>
<view class="footer-item">{{filter.dateFormat(item.sellingTime)}}成交</view>
</view>
</view>
</block>
<view wx:if="{{isEnd}}" class="bottom-tip">到底了~</view>
</view>
</scroll-view>
</block>
<block wx:else>
<view class="no-data">
<glsx-image src="store-assistant-assemble/output/no_data_1.png" class="no-data-img"></glsx-image>
<view class="text">暂无数据~</view>
</view>
</block>
</view>
\ No newline at end of file
const MENUS = [
{
title: '经营分析',
index: 0
},
{
title: '车辆列表',
index: 1
}
]
const DATELIST = [
{
title: '日',
index: 0
},
{
title: '周',
index: 1
},
{
title: '月',
index: 2
},
{
title: '自定义',
index: 3
}
]
const first_cell = [
{
name: '总毛利(万)',
value: 'grossProfitTotal',
rate: 'grossProfitTotalChainRatio',
haswan: true
},
{
name: '单车毛利(元)',
value: 'grossProfitPerUnit',
rate: 'grossProfitPerUnitChainRatio'
},
{
name: '平均售价(万)',
value: 'avgSellingPrice',
rate: 'avgSellingPriceChainRatio',
haswan: true
},
]
const second_cell = [
{
name: '置换率',
value: 'replacementRate',
rate: 'replacementRateChainRatio',
tipsType: 1, // 对应弹窗type
unit: '%',
type: 1
},
{
name: '评估转换率',
value: 'appraisalConversionRate',
rate: 'appraisalConversionRateChainRatio',
tipsType: 2,
unit: '%',
type: 2
},
{
name: '评估量',
value: 'appraisalCount',
rate: 'appraisalCountChainRatio',
type: 3
}
]
const third_cell = [
{
name: '收购交车量',
value: 'acquisitionDeliveryCount',
rate: 'acquisitionDeliveryCountChainRatio',
type: 4
},
{
name: '成交量',
value: 'transactionCount',
rate: 'transactionCountChainRatio',
type: 5
},
{
name: '新车下订数',
value: 'newCarOrderCount',
rate: 'newCarOrderCountChainRatio',
type: 3
},
]
const fourth_cell = [
{
name: '新车交付数',
value: 'newCarDeliveryCount',
rate: 'newCarDeliveryCountChainRatio',
type: 4
},
{
name: '总产值(万)',
value: 'totalOutputValue',
rate: 'totalOutputValueChainRatio',
type: 6,
isPrice: true,
haswan: true
},
{
name: '已售出车辆',
value: 'vehiclesSold',
rate: 'vehiclesSoldChainRatio',
type: 3
}
]
const vehicle_category = {
1: {
name: '置换车',
class: 'orange'
},
2: {
name: '报废车',
class: 'red'
}
}
export {
DATELIST,
MENUS,
first_cell,
second_cell,
third_cell,
fourth_cell,
vehicle_category,
}
\ No newline at end of file
{
"component": true,
"usingComponents": {
"vehicleList": "./components/VehicleList/index",
"board": "./components/Board/index"
}
}
\ No newline at end of file
.second-hand-car {
background-color: #fff;
height: 100%;
.header {
margin-bottom: 20rpx;
.title-section {
// justify-content: center;
width: 380rpx;
height: 76rpx;
font-size: 28rpx;
font-weight: 400;
padding: 16rpx 0;
margin: 0 auto;
// border-radius: 38rpx;
overflow: hidden;
.title-container {
display: flex;
align-items: center;
width: calc(100% - 12rpx);
height: 100%;
background-color: #F8F9F9;
border-radius: 38rpx;
padding: 0 6rpx;
}
.title {
display: flex;
align-items: center;
justify-content: center;
width: 50%;
color: #323436;
text-align: center;
height: calc(100% - 12rpx);
// margin-right: 40rpx;
&.active {
color: #3666FE;
font-weight: 600;
background-color: #fff;
border-radius: 32rpx;
}
}
}
.tab-section {
width: 528rpx;
height: 62rpx;
display: flex;
align-items: center;
margin: 0 auto;
background-color: #F7F8FA;
border-radius: 8rpx;
overflow: hidden;
margin-bottom: 32rpx;
.tab {
flex: 1;
text-align: center;
height: 48rpx;
line-height: 48rpx;
// padding: 16rpx 0;
font-size: 28rpx;
margin: 0 8rpx;
color: #999EA8;
&.active {
background-color: #fff;
color: #292D33;
border-radius: 4rpx;
}
}
}
.date-section {
width: 528rpx;
margin: 0 auto;
// padding: 0 24rpx;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24rpx;
.date {
color: #5A5E66;
font-size: 28rpx;
}
.arrow {
display: flex;
align-items: center;
width: 30rpx;
height: 30rpx;
font-size: 30rpx;
color: #666;
.arrow-left {
padding-left: 24rpx;
padding-right: 24rpx;
}
.arrow-right {
padding-right: 24rpx;
padding-left: 24rpx;
}
}
}
}
}
.no-data {
font-size: 24rpx;
color:#CCCED1;
text-align: center;
&-img {
width: 512rpx;
height: 512rpx;
margin: 84rpx auto 0;
}
.text {
margin-top: -66rpx;
}
}
\ No newline at end of file
<wxs src="../index.wxs" module="filter" />
<view class="second-hand-car" wx:if="{{usedCarFlag == 1}}">
<view class="header">
<view class="title-section">
<view class="title-container">
<block wx:for="{{menus}}" wx:key="index">
<view class="title {{item.index==current?'active':''}}" data-index="{{item.index}}" bind:tap="selectMenu">{{item.title}}</view>
</block>
</view>
</view>
<view class="tab-section">
<block wx:for="{{dateList}}" wx:key="index">
<view class="tab {{item.index==dateCurrent?'active':''}}" data-index="{{item.index}}" bind:tap="selectDate">{{item.title}}</view>
</block>
</view>
<view class="date-section">
<view class="arrow left">
<van-icon wx:if="{{timeType != 'custom' && !leftCurrent}}" class="arrow-left" name="arrow-left" bind:tap="last" />
</view>
<view class="date" bind:tap="onDisplayDate">{{date}}</view>
<view class="arrow right">
<van-icon wx:if="{{timeType != 'custom' && !rightCurrent}}" class="arrow-right" name="arrow" bind:tap="next" />
</view>
</view>
</view>
<block wx:if="{{current == 0}}">
<board boardData="{{boardData}}"></board>
</block>
<block wx:if="{{current==1}}">
<vehicleList merchantId="{{merchantId}}" timeType="{{timeType}}" date="{{date}}" currentWeek="{{currentWeek}}"></vehicleList>
</block>
</view>
<view class="no-data" wx:else>
<glsx-image src="store-assistant-assemble/output/no_data_1.png" class="no-data-img"></glsx-image>
<view class="text">暂未开通~</view>
</view>
<!-- 年月日 -->
<popup bind:hidePopup="cancel" bind:confirm="confirm" show="{{dateShow}}" title="{{titleEnum[timeType]}}" height="50vh">
<block wx:if="{{timeType == 'date' || timeType == 'year-month'}}">
<van-datetime-picker id="datePicker" show-toolbar="{{false}}" min-date="{{ minDate }}" max-date="{{ maxDate }}" model:value="{{ currentDate }}" type="{{timeType=='date'?'date':'year-month'}}" bind:change="onChange" bind:input="onInput" />
</block>
<!-- 周 -->
<block wx:if="{{timeType == 'week'}}">
<van-picker id="weekPicker" show-toolbar="{{false}}" model:value="{{ currentDate }}" default-index="{{defaultIndex}}" value-key="label" columns="{{ weekColumns }}" bind:change="onWeekChange" />
</block>
</popup>
<van-calendar
id="calendar"
max-range="{{ 31 }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
show="{{ show }}"
type="range"
color="#4466F0"
bind:confirm="onConfirm"
bind:close="onClose"
/>
\ No newline at end of file
var threeNumForTwo = {
money_three_for_two_thousands: function (num) {
//num = parseInt(num);
// return num
var num = num + ''
var d = ''
if (num.slice(0, 1) == '-') {
d = num.slice(0, 1)
num = num.slice(1)
}
var len = num.length
var index = num.indexOf('.')
if (index == -1) {
num = num + '.00'
} else if (index + 2 == len) {
num = num + '0'
}
var index = num.indexOf('.') // 字符出现的位置
var num2 = num.slice(-3)
num = num.slice(0, index)
var result = ''
while (num.length > 3) {
result = ',' + num.slice(-3) + result
num = num.slice(0, num.length - 3)
}
if (num) {
result = num + result
}
// return result
return d + (result + num2)
}
}
var format = {
yearFormat: function (date) {
var _date = getDate(date)
var year = _date.getFullYear()
return year
},
dateFormat: function (date) {
var _date = getDate(date)
var year = _date.getFullYear()
var month = _date.getMonth() + 1
var day = _date.getDate()
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day)
},
mileageFormat: function (mileage) {
if (mileage > 10000) {
return (mileage / 10000).toFixed(2) + '万公里'
} else {
return mileage + '公里'
}
},
// 万单位,保留两位小数
priceFormat: function(price) {
return (price / 10000).toFixed(2)
},
// 万单位,加千位符
threeNumForTwoPriceFormat: function(num) {
return threeNumForTwo.money_three_for_two_thousands(format.priceFormat(num))
},
formatDate: function(date) {
var _date = getDate(date)
var year = _date.getFullYear()
var month = _date.getMonth() + 1
var day = _date.getDate()
return year + '/' + (month < 10 ? '0' + month : month) + '/' + (day < 10 ? '0' + day : day)
}
}
module.exports = {
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands, //暴露接口调用
yearFormat: format.yearFormat, //暴露接口调用
mileageFormat: format.mileageFormat, //暴露接口调用
dateFormat: format.dateFormat, //暴露接口调用
priceFormat: format.priceFormat, //暴露接口调用
threeNumForTwoPriceFormat: format.threeNumForTwoPriceFormat, //暴露接口调用
formatDate: format.formatDate, //暴露接口调用
}
\ No newline at end of file
......@@ -80,7 +80,12 @@ Component({
title: '会员权益/升级',
count: 0,
serviceType: 2
}]
}, {
logo: 'esc-icon',
title: '二手车',
count: 0,
serviceType: 7
}]
tabs.forEach(item => {
data.forEach(el => {
if (item.serviceType == el.serviceType) {
......
......@@ -16,6 +16,7 @@ Component({
totals_zc: 0,
ids: [],
currentServiceType: 0,
usedCarFlag: 0,
},
methods: {
// 获取众筹总数
......@@ -69,10 +70,9 @@ Component({
},
onLoad(options) {
const { merchantId, merchantName } = options;
this.setData({ merchantId, merchantName })
const { merchantId, merchantName, usedCarFlag } = options;
this.setData({ merchantId, merchantName, usedCarFlag })
this.getSubscribeConfig(options)
console.log(Date.now())
this.addEvent()
},
// 获取活动订阅配置
......@@ -80,11 +80,15 @@ Component({
let tab = [
{ serviceTypeName: '精品升级', serviceType: 1 },
{ serviceTypeName: '售后众筹', serviceType: 0 },
{ serviceTypeName: '会员权益/升级', serviceType: 2 }]
{ serviceTypeName: '会员权益/升级', serviceType: 2 },
{ serviceTypeName: '二手车', serviceType: 7 }]
const index = tab.findIndex(item => item.serviceType == obj.type) || 0
this.setData({
tab,
fresh: obj && obj.fresh,
currentServiceType: obj.type
currentServiceType: obj.type || 0,
tabIndex: index,
to: `to-${index}`,
})
console.log(Date.now())
setTimeout(() => {
......
......@@ -2,7 +2,8 @@
"usingComponents": {
"menu":"./components/menu/index",
"workertableEntrance":"./components/WorktableEntrance/index",
"OutputWork":"./components/OutputWork/index"
"OutputWork":"./components/OutputWork/index",
"secondHandCar": "./components/SecondHandCar/index"
},
"navigationStyle": "custom",
"onReachBottomDistance": 100
......
......@@ -64,6 +64,8 @@ page {
white-space: nowrap;
box-sizing: border-box;
padding: 0 32rpx;
background-color: #fff;
font-size: 0;
.tab-scroll {
height: 100%;
......
......@@ -21,7 +21,7 @@
<view class="tab-box" style="top: {{navHeight}}px">
<scroll-view class="tab-scroll" scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-x="{{true}}" scroll-with-animation>
<block wx:for="{{tab}}" wx:key="index">
<view id="{{tab.length<3?'':'to-'+index}}" class="tab_element" bindtap="click" data-index="{{index}}">
<view id="{{tab.length<4?'':'to-'+index}}" class="tab_element" bindtap="click" data-index="{{index}}">
<view class="inner {{currentServiceType == item.serviceType? 'active' : '' }}">
{{item.serviceTypeName}}
<block wx:if="{{item.serviceType == 0&&totals_zc}}">({{totals_zc|| 0}})</block>
......@@ -45,6 +45,9 @@
<view wx:if="{{fn.arrInclues(currentServiceType,[1,2,3,4])}}" style="height: calc(100%);">
<OutputWork entranceType="{{currentServiceType}}" />
</view>
<view wx:if="{{currentServiceType == 7}}" style="height: 100%;">
<secondHandCar usedCarFlag="{{usedCarFlag}}"></secondHandCar>
</view>
</view>
</view>
</block>
......
......@@ -45,12 +45,43 @@ var threeNumForTwo = {
return d + (result + num2)
}
}
var format = {
yearFormat: function (date) {
var _date = getDate(date)
var year = _date.getFullYear()
return year
},
dateFormat: function (date) {
var _date = getDate(date)
var year = _date.getFullYear()
var month = _date.getMonth() + 1
var day = _date.getDate()
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day)
},
mileageFormat: function (mileage) {
if (mileage > 10000) {
return (mileage / 10000).toFixed(2) + '万公里'
} else {
return mileage + '公里'
}
},
// 万单位,保留两位小数
priceFormat: function(price) {
return (price / 10000).toFixed(2)
},
// 万单位,加千位符
threeNumForTwoPriceFormat: function(num) {
return threeNumForTwo.money_three_for_two_thousands(format.priceFormat(num))
}
}
/*
* 导出
*/
module.exports = {
setPrice: setPrice,
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands //暴露接口调用
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands, //暴露接口调用
threeNumForTwoPriceFormat: format.threeNumForTwoPriceFormat,
dateFormat: format.dateFormat,
mileageFormat: format.mileageFormat,
}
// packagesList/packageOutput/pages/vehicleDetail/vehicleDetail.js
import {newApi} from '~/api/secondHandApi'
Page({
/**
* 页面的初始数据
*/
data: {
background: ['https://scrm.test.glsx.com.cn/group1/M00/07/4A/wKgD3mdFNkaAY18BAAATsiTabFw663.png',
'https://scrm.test.glsx.com.cn/group1/M00/07/3F/wKgD3mc255SAdNJ4AAAWi9wQ6GM113.png',
'https://scrm.test.glsx.com.cn/group1/M00/07/3B/wKgD3mcsaZGAdjzYAAFI8MRvYEs452.jpg'],
current: 0,
detail: null,
usageTypeEnum: {
1: '非营运',
2: '营运',
3: '营转非'
},
vehicleCategoryEnum: {
1: '置换车',
2: '报废车',
},
sunroofEnum: {
1: '无天窗',
2: '普通天窗',
3: '全景天窗'
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onSwiperChange(e) {
this.setData({
current: e.detail.current
})
},
onRoute(options) {
console.log(options, 'onRoute')
this.getDetail(options.evalorderno)
},
// 获取车辆详情
async getDetail(evalOrderNo) {
const result = await newApi.post('/minicarManage/findSoldCarInfoByEvalOrderNo', {
evalOrderNo
})
console.log(result, 'getDetail')
if (result.evalImageInfoList && result.evalImageInfoList.length) {
result.driverImg = result.evalImageInfoList.find(item => item.fileSubtype == 21)?.fileUrl
result.registrationImg = result.evalImageInfoList.filter(item => item.fileSubtype == 22 || item.fileSubtype == 23 || item.fileSubtype == 24)
// 车辆图片11-17
result.bannerList = result.evalImageInfoList.filter(item => item.fileSubtype > 10 && item.fileSubtype <18)
}
console.log(result, 'getDetail')
this.setData({
detail: result
})
},
// 预览图片
preview(e) {
const {url, type} = e.currentTarget.dataset
const {detail} = this.data
if (type == 'bannerList') {
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: detail.bannerList.map(item => item.fileUrl) // 需要预览的图片http链接列表
})
} else if (type == 'registrationImg') {
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: detail.registrationImg.map(item => item.fileUrl) // 需要预览的图片http链接列表
})
} else if (type == 'driverImg') {
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: [url] // 需要预览的图片http链接列表
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "车辆详情"
}
\ No newline at end of file
/* packagesList/packageOutput/pages/vehicleDetail/vehicleDetail.wxss */
.vehicle-detail {
min-height: 100vh;
height: 100%;
background-color: #fff;
}
.swiper-contain {
position: relative;
.swiper-total {
position: absolute;
right: 20rpx;
bottom: 20rpx;
// width: 80rpx;
// height: 48rpx;
padding: 10rpx 18rpx;
background: #00000080;
border-radius: 24rpx;
font-size: 20rpx;
color: #fff;
}
}
.swiper-box {
height: 500rpx;
background-color: #eeeeee;
}
.image {
height: 100%;
display: block;
padding: 0;
font-size: 0;
}
.title-box {
padding: 24rpx 32rpx;
background-color: #fff;
.vehicle-title {
color: #323436;
font-size: 32rpx;
font-weight: 600;
margin-bottom: 16rpx;
.car-series {
display: inline-block;
padding-right: 8rpx;
}
}
.vehicle-price-box {
display: flex;
.vehicle-price-item {
display: flex;
width: 50%;
align-items: baseline;
.vehicle-price-name {
font-size: 26rpx;
color: #393B3E;
line-height: 50rpx;
}
.vehicle-price-value {
display: flex;
color: #EC4D32;
align-items: baseline;
.vehicle-price-number {
display: flex;
align-items: baseline;
font-size: 54rpx;
font-weight: 700;
}
.vehicle-price-unit {
font-size: 26rpx;
}
}
}
}
}
.gap {
width: 100%;
background-color: #F8F9F9;
height: 16rpx;
}
.vehicle-info-box {
padding: 24rpx 32rpx 80rpx;
.vehicle-info-title {
font-size: 28rpx;
font-weight: 600;
color: #323436;
margin-bottom: 24rpx;
}
.vehicle-info {
display: flex;
background-color: #F8F9FC;
border-radius: 12rpx;
.info-item {
width: 25%;
text-align: center;
padding: 28rpx 0;
.label {
font-size: 24rpx;
color: #8A8C90;
}
.value {
font-size: 26rpx;
color: #393B3E;
margin-bottom: 6rpx;
font-weight: 500;
}
}
}
}
.other-info-box {
margin-top: 26rpx;
.other-info {
display: inline-flex;
align-items: center;
margin-bottom: 16rpx;
&-label {
width: 96rpx;
font-size: 24rpx;
color: #858A94;
margin-right: 12rpx;
}
&-value {
display: inline-flex;
font-size: 26rpx;
color: #393B3E;
font-weight: 500;
.name {
max-width: 380rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 16rpx;
}
}
&.small {
width: 300rpx;
}
&.middle {
width: calc(100% - 300rpx);
}
&.long {
width: 100%;
}
.vehicle-image {
width: 174rpx;
height: 116rpx;
border-radius: 20rpx;
margin-right: 16rpx;
}
}
}
\ No newline at end of file
<!-- packagesList/packageOutput/pages/vehicleDetail/vehicleDetail.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="vehicle-detail" wx:if="{{detail}}">
<view class="swiper-contain">
<swiper class="swiper-box" current="{{current}}" bindchange="onSwiperChange">
<block wx:for="{{detail.bannerList}}" wx:key="*this">
<swiper-item class="swiper-item">
<image class="image" mode="aspectFit" bind:tap="preview" data-url="{{item.fileUrl}}" data-type="{{'bannerList'}}" src="{{item.fileUrl}}"></image>
</swiper-item>
</block>
</swiper>
<view class="swiper-total">{{current + 1}}/{{detail.bannerList.length}}</view>
</view>
<view class="title-box">
<view class="vehicle-title">
<view class="car-series">{{detail.evalCarBase && detail.evalCarBase.carSeriesName ? detail.evalCarBase.carSeriesName : ''}}</view>{{detail.carTypeName}}
</view>
<view class="vehicle-price-box">
<view class="vehicle-price-item">
<view class="vehicle-price-name">收车价</view>
<view class="vehicle-price-value">
<view class="vehicle-price-number">{{filter.threeNumForTwoPriceFormat(detail.purchasePrice)}}</view>
<view class="vehicle-price-unit">万</view>
</view>
</view>
<view class="vehicle-price-item">
<view class="vehicle-price-name">卖出价</view>
<view class="vehicle-price-value">
<view class="vehicle-price-number">{{filter.threeNumForTwoPriceFormat(detail.sellingPrice)}}</view>
<view class="vehicle-price-unit">万</view>
</view>
</view>
</view>
</view>
<view class="gap"></view>
<view class="vehicle-info-box">
<view class="vehicle-info-title">车辆资料</view>
<view class="vehicle-info">
<view class="info-item">
<view class="value">{{detail.evalCarBase && detail.evalCarBase.carCityName ? detail.evalCarBase.carCityName : '-'}}</view>
<view class="label">车辆所在地</view>
</view>
<view class="info-item">
<view class="value">{{detail.listingDate ? filter.dateFormat(detail.listingDate) : '-'}}</view>
<view class="label">首次上牌</view>
</view>
<view class="info-item">
<view class="value">{{detail.mileage !== undefined && detail.mileage !== null ? filter.mileageFormat(detail.mileage) : '-'}}</view>
<view class="label">表显里程</view>
</view>
<view class="info-item">
<view class="value">{{detail.evalCarBase && detail.evalCarBase.usageType ? usageTypeEnum[detail.evalCarBase.usageType] : '-'}}</view>
<view class="label">使用性质</view>
</view>
</view>
<view class="other-info-box">
<view class="other-info small">
<view class="other-info-label">过户次数</view>
<view class="other-info-value">{{detail.transfersNumber}}次</view>
</view>
<view class="other-info middle">
<view class="other-info-label">入库日期</view>
<view class="other-info-value">{{detail.purchaseTime ? filter.dateFormat(detail.purchaseTime) : '-'}}</view>
</view>
<view class="other-info small">
<view class="other-info-label">车辆类型</view>
<view class="other-info-value">{{detail.evalCarBase && detail.evalCarBase.vehicleCategory ? vehicleCategoryEnum[detail.evalCarBase.vehicleCategory] : '-'}}</view>
</view>
<view class="other-info middle">
<view class="other-info-label">车架号</view>
<view class="other-info-value">{{detail.vin ? detail.vin : '-'}}</view>
</view>
<view class="other-info small">
<view class="other-info-label">天窗</view>
<view class="other-info-value">{{detail.sunroof ? sunroofEnum[detail.sunroof] : '-'}}</view>
</view>
<view class="other-info middle">
<view class="other-info-label">车牌号</view>
<view class="other-info-value">{{detail.licensePlate ? detail.licensePlate : '-'}}</view>
</view>
<view class="other-info long">
<view class="other-info-label">销售顾问</view>
<view class="other-info-value"><view class="name">{{detail.evalOrder && detail.evalOrder.sellerName ? detail.evalOrder.sellerName : '-'}}</view> {{detail.sellPhone ? detail.sellPhone : '-'}}</view>
</view>
<view class="other-info long">
<view class="other-info-label">卖出时间</view>
<view class="other-info-value">{{detail.sellingTime ? filter.dateFormat(detail.sellingTime) : '-'}}</view>
</view>
<view class="other-info long" wx:if="{{detail.driverImg}}">
<view class="other-info-label">行驶证</view>
<image
class="vehicle-image"
src="{{detail.driverImg}}"
mode="aspectFit"
bind:tap="preview"
data-url="{{detail.driverImg}}"
data-type="{{'driverImg'}}"
/>
</view>
<view class="other-info long" wx:if="{{detail.registrationImg.length}}">
<view class="other-info-label">登记证</view>
<image
wx:for="{{detail.registrationImg}}"
wx:key="*this"
class="vehicle-image"
src="{{item.fileUrl}}"
mode="aspectFit"
bind:tap="preview"
data-url="{{item.fileUrl}}"
data-type="{{'registrationImg'}}"
/>
</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -59,7 +59,7 @@ Component({
const {item:{type,name},info} = e.currentTarget.dataset
if(info[name] == '未开通')return
wx.navigateTo({
url: `/packagesList/outDetail/index?merchantId=${info.merchantId4s}&type=${type}&merchantName=${info.merchantName4s}`,
url: `/packagesList/outDetail/index?merchantId=${info.merchantId4s}&type=${type}&merchantName=${info.merchantName4s}&usedCarFlag=${info.usedCarFlag}`,
})
}
}
......
......@@ -3,7 +3,7 @@
background: #FFFFFF;
box-shadow: 0 2rpx 20rpx 0 #b4bacc52;
border-radius: 8rpx;
margin: 0rpx 16rpx 20rpx;
margin: 0rpx 20rpx 20rpx;
padding: 20rpx 0;
.title-box {
......@@ -59,7 +59,7 @@
}
.content-item {
width: 32%;
width: calc(50% - 10rpx);
// flex: 1;
text-align: center;
font-size: 20rpx;
......@@ -71,7 +71,10 @@
margin-top: 16rpx;
height: 128rpx;
background: #F8F9FC;
border-radius: 12rpx;
border-radius: 12rpx;
&:nth-child(2n - 1) {
margin-right: 14rpx;
}
.price {
font-weight: 700;
......
......@@ -24,6 +24,12 @@ const clientFormObj = {
prefix: '¥',
isNum: true,
type: 2
}, {
label: '二手车',
name: 'usedCarTotal',
prefix: '¥',
isNum: true,
type: 7
}],
'SC002': [{
label: '营业额',
......
......@@ -119,14 +119,22 @@ Component({
code: 'SC001',
name: 'vdUpgrade',
type: 2,
}]
}, {
code: 'usedCarFlag',
name: 'usedCarTotal',
type: 4,
}]
_list.forEach(item => {
_openList.forEach(k => {
if (!item.sceneCodes) {
item[k.name] = '未开通'
} else if (item.sceneCodes && !item.sceneCodes.includes(k.code)) {
item[k.name] = '未开通'
}
if (k.code === 'usedCarFlag') {
// 二手车特殊处理:根据usedCarFlag值判断是否开通(1:开通,0:未开通)
if (item.usedCarFlag !== 1) item[k.name] = '未开通'
// item[k.name] = item.usedCarFlag === 1 ? '' : '未开通'
} else if (!item.sceneCodes) {
item[k.name] = '未开通'
} else if (item.sceneCodes && !item.sceneCodes.includes(k.code)) {
item[k.name] = '未开通'
}
})
})
this.setData({
......
/* pages/tab/output/components/client/client.wxss */
.client {
padding-top: 20rpx;
box-sizing: border-box;
height: calc(100% - 280rpx);
height: calc(100% - 300rpx);
color: #323436;
padding-bottom: env(safe-area-inset-bottom) !important;
padding-bottom: constant(safe-area-inset-bottom) !important;
}
.client-box {
......@@ -32,7 +35,7 @@
}
.store-box {
height: 100%;
height: calc(100% - 100rpx);
background: #ffffff;
border-top-left-radius: 32rpx;
border-top-right-radius: 32rpx;
......
......@@ -21,8 +21,8 @@ Component({
actIdx: '-1',
imgObj: {
'': 'default',
1: 'up',
2: 'down',
1: 'down',
2: 'up'
},
// 全部-1;精品升级SC002;会员权益/升级SC001
// asc:''-无, 1-升序,2-降序
......@@ -39,6 +39,10 @@ Component({
label: '会员权益/升级',
asc: '',
value: 3
}, {
label: '二手车',
asc: '',
value: 7
}],
'SC002': [{
label: '营业额',
......@@ -160,14 +164,14 @@ Component({
let _asc = ''
switch (formObj[sceneCode][idx]?.asc) {
case '1':
_asc = ''
_actIdx = '-1'
_asc = '2'
break
case '2':
_asc = '1'
_asc = ''
_actIdx = '-1'
break
case '':
_asc = '2'
_asc = '1'
break
}
this.setData({
......
......@@ -10,28 +10,24 @@
border-top-left-radius: 32rpx;
border-top-right-radius: 32rpx;
.title {
font-weight: 600;
font-size: 30rpx;
width: 196rpx;
padding-left: 8rpx;
flex-shrink: 0;
}
.flex {
display: flex;
justify-content: space-between;
}
.sort-scroll {
display: flex;
width: calc(100% - 196rpx);
// width: calc(100% - 196rpx);
width: 100%;
.item {
display: flex;
flex-shrink: 0;
justify-content: center;
align-items: center;
margin-right: 20rpx;
// margin-right: 20rpx;
color: #5a6066;
}
......@@ -40,4 +36,12 @@
height: 32rpx;
}
}
}
.title {
font-weight: 600;
font-size: 28rpx;
width: 196rpx;
padding-left: 20rpx;
flex-shrink: 0;
color: #323436;
}
\ No newline at end of file
<!--pages/tab/output/components/sortTab/sortTab.wxml-->
<view class="sort-tab">
<view class="title">{{title}}</view>
<scroll-view class="sort-scroll" scroll-x="true">
<view class="flex">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="item" bindtap="handleSort" data-idx="{{index}}">
<view>{{item.label}}</view>
<glsx-image src="output/sort-{{imgObj[item.asc]}}.png" class="icon" />
<view>
<view class="sort-tab">
<scroll-view class="sort-scroll" scroll-x="true">
<view class="flex">
<view wx:for="{{formObj[sceneCode]}}" wx:key="index" class="item" bindtap="handleSort" data-idx="{{index}}">
<view>{{item.label}}</view>
<glsx-image src="output/sort-{{imgObj[item.asc]}}.png" class="icon" />
</view>
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
</scroll-view>
</view>
<view class="title">{{title}}</view>
</view>
\ No newline at end of file
......@@ -87,11 +87,22 @@
"useCompilerPlugins": [
"sass"
],
"condition": false
"condition": false,
"es6": false,
"compileWorklet": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"minifyWXSS": true,
"minifyWXML": true,
"localPlugins": false,
"disableUseStrict": false,
"swc": false,
"disableSWC": true
},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"libVersion": "2.31.0"
"libVersion": "3.1.2",
"simulatorPluginLibVersion": {}
}
\ No newline at end of file
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "3.1.2",
"condition": {
"miniprogram": {
"list": [
{
"name": "看产值",
"pathName": "pages/tab/output/output",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "携带目标页面",
"pathName": "login/loading/loading",
"query": "url=%2Fpages%2Ftab%2Fmine%2Fmine%3Fid%3D123",
"launchMode": "default",
"scene": null
},
{
"name": "选择账号",
"pathName": "login/accountItems/accountItems",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "个人中心",
"pathName": "pages/tab/mine/mine",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "login/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "客户管理",
"pathName": "packagesList/mineDetail/pages/customerManagement",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "消息盒子",
"pathName": "packagesList/mineDetail/pages/messageBox",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "开通门店",
"pathName": "pages/apply/apply",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/checkProduct/checkProduct",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "看线索",
"pathName": "pages/tab/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "申请业务+产品",
"pathName": "packagesList/apply/pages/apply",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "login/loading/loading",
"query": "scene=sceneId%3D22402",
"launchMode": "default",
"scene": 1047
},
{
"name": "",
"pathName": "packageOutput/pages/boutique/boutique",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "packagesList/outDetail/index",
"query": "merchantIds=4&type=1",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "packageOutput/pages/monthReport/monthReport",
"query": "merchantIds=4",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/viewVideo/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "个人中心",
"pathName": "pages/tab/mine/mine",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "看产值",
"pathName": "pages/tab/output/output",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "产值",
"pathName": "packagesList/outDetail/index",
"query": "merchantId=44211468&type=1&merchantName=%E6%98%8E%E6%98%8E%E9%95%BF%E5%B2%AD4s%E5%BA%97A",
"launchMode": "default",
"scene": null
},
{
"name": "产值日报",
"pathName": "packagesList/packageOutput/pages/monthReport/monthReport",
"query": "time=day&type=1&merchantId=44202909&merchantName=%E5%B9%BF%E8%81%94%E8%B5%9B%E8%AE%AF%E6%B5%8B%E8%AF%95%E9%97%A8%E5%BA%97%EF%BC%88%E4%BB%85%E5%86%85%E9%83%A8%E4%BD%BF%E7%94%A8%EF%BC%89%20",
"launchMode": "default",
"scene": null
},
{
"name": "访客详情",
"pathName": "packagesList/packageOutput/pages/visitor/visitor",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "月报表",
"pathName": "packagesList/packageOutput/pages/monthReport/monthReport",
"query": "time=month&type=1&merchantId=44206511&merchantName=%E8%BD%BB%E6%94%B9%E4%B8%93%E5%AE%B6",
"launchMode": "default",
"scene": null
},
{
"name": "产值相关",
"pathName": "packagesList/packageOutput/pages/crowdDetail/crowdDetail",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "售后众筹",
"pathName": "packagesList/outDetail/index",
"query": "merchantId=44205761&type=0&merchantName=%E6%9D%B0%E8%A5%BF%E9%9B%86%E5%9B%A2%E7%9A%84%E9%97%A8%E5%BA%97",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "login/loading/loading",
"query": "scene=sceneId%3D24957",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "packagesList/log/log",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
},
"libVersion": "3.10.0",
"condition": {},
"setting": {
"urlCheck": false,
"compileHotReLoad": true
"compileHotReLoad": true,
"coverView": true,
"lazyloadPlaceholderEnable": true,
"skylineRenderEnable": false,
"preloadBackgroundData": false,
"autoAudits": false,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true,
"useStaticServer": true,
"useLanDebug": false,
"showES6CompileOption": false,
"checkInvalidKey": true,
"ignoreDevUnusedFiles": true,
"bigPackageSizeSupport": false,
"useIsolateContext": false
},
"projectname": "store-assistant-assemble"
}
\ No newline at end of file
......@@ -22,7 +22,8 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 2
// newRequest里面是新接口也要修改
let index = 3
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......
import { Request } from 'glsk-toolkit';
import { domain } from './http.js'
let { sessionId } = wx.$storage.get()
console.log(sessionId, '=-====')
let target = 'prod'
const requestObj = {
dev: 'http://gsc.dev.glsx.com.cn/gsc-vcp-miniapp-facade',
test: 'https://gsc.test.glsx.com.cn/gsc-vcp-miniapp-facade',
// preRelease: 'https://gsc.test.glsx.com.cn/gsc-vcp-miniapp-facade',
prod: 'https://gsc.glsx.com.cn/gsc-vcp-miniapp-facade',
}
const newRequest = new Request({
baseURL: requestObj[target],
// baseURL: 'https://gsc.test.glsx.com.cn/gsc-vcp-miniapp-facade',
// baseURL: 'http://192.168.1.117:9898/gsc-vcp-miniapp-facade',
// baseURL: 'http://192.168.1.114:9898/gsc-vcp-miniapp-facade',
appId: 'Mini_StoreAssistant',
appSecret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
session: {
requiresSession: true,
sessionParamName: 'sessionId',
sessionId: () => wx.$storage.get('sessionId') || ''
},
// params: {sessionId},
response: { // 响应处理配置(推荐使用)
code_key: 'code', // 状态码字段名,可以是字符串或字符串数组
code_success_value: '0', // 成功状态码值
data_key: 'data', // 数据字段名
errId: 'errId', // 错误ID字段名
errId_logout_value: '21' // 登出错误ID值
},
// 事件配置
events: {
// 请求发送前触发
request: (requestData, config) => {
// console.log('request事件触发', requestData, config);
},
// 收到响应时触发(无论成功或失败)
response: (responseData, config) => {
// console.log('response事件触发', responseData, config);
},
// 请求成功时触发(业务状态码为成功值)
success: (data, config) => {
console.log('success事件触发', data, config);
},
// 请求失败时触发(业务状态码为失败值)
error: (errorData, config) => {
console.log('error事件触发', errorData, config);
wx.$api.showToast(errorData.msg)
},
// 需要登出时触发(业务状态码为登出值)
logout: (data, config) => {
console.log('logout事件触发', data, config);
// 可以在这里处理登出逻辑
},
// 重复请求被阻止时触发
duplicate: (duplicateData, config) => {
console.log('duplicate事件触发', duplicateData, config);
// 可以在这里处理重复请求的逻辑,如显示提示信息
}
}
})
export default newRequest
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!