Commit 1c0eae4b by 张立顺

other: 去除无关联组件

1 parent 5b55955a
Showing 49 changed files with 25 additions and 648 deletions
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
员工账号 :15626599735 (选明明塘朗园区店) 员工账号 :15626599735 (选明明塘朗园区店)
员工账号 :13632791593 (选fennun03能下单 园区测试门店有多条数据) 员工账号 :13632791593 (选fennun03能下单 园区测试门店有多条数据)
项目功需真机测试的功能:scroll-view组件里面有组件使用fixed定位的组件
测试机iphone8plus 密码 127458
接口环境切换 在api目录下的environment (项目上传体验版或生产环境需手动切换) 接口环境切换 在api目录下的environment (项目上传体验版或生产环境需手动切换)
0本地 0本地
1开发 1开发
......
...@@ -116,11 +116,9 @@ App({ ...@@ -116,11 +116,9 @@ App({
}, },
// 获取园区店信息 // 获取园区店信息
getYQInfo(userInfo) { getYQInfo(userInfo) {
console.log(userInfo) // console.log(userInfo)
// console.log(globalData) // console.log(globalData)
// let merchantRange // console.log(this.globalData)
console.log(this.globalData)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 如果有 直接返回 // 如果有 直接返回
if (this.globalData.yqdInfo.merchantRange) { if (this.globalData.yqdInfo.merchantRange) {
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
"gl-textarea": "/components/GlTextarea/GlTextarea", "gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell", "gl-cell": "/components/GlCell/GlCell",
"calendar": "/components/Calendar/Calendar", "calendar": "/components/Calendar/Calendar",
"CalendarMonth": "/components/CalendarMonth/Calendar", "CalendarMonth": "/components/CalendarMonth/CalendarMonth",
"navigation-bar": "/components/navigationBar/navigationBar", "navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput", "search-input": "/components/SearchInput/SearchInput",
......
...@@ -21,6 +21,7 @@ class Calendar { ...@@ -21,6 +21,7 @@ class Calendar {
setCalenderHeight() { setCalenderHeight() {
let _this = this[_CalendarObject_] let _this = this[_CalendarObject_]
let { data: calenderHeight } = _this let { data: calenderHeight } = _this
console.log(calenderHeight)
let height = '80%' let height = '80%'
if (typeof calenderHeight === 'number') { if (typeof calenderHeight === 'number') {
wx.$util.getPhoneInfo(res => { wx.$util.getPhoneInfo(res => {
......
...@@ -2,7 +2,9 @@ export default { ...@@ -2,7 +2,9 @@ export default {
properties: { properties: {
calenderHeight: { calenderHeight: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误 // 新版本不能使用type 改用optionalTypes 属性避免提示错误
optionalTypes: [String, Number] type: String,
optionalTypes: [Number]
// optionalTypes: [String]
}, },
title: String, // 标题名称 title: String, // 标题名称
hasRadius: { hasRadius: {
...@@ -63,7 +65,8 @@ export default { ...@@ -63,7 +65,8 @@ export default {
/** 周起始日,默认周日 */ /** 周起始日,默认周日 */
firstDayOfWeek: { firstDayOfWeek: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误 // 新版本不能使用type 改用optionalTypes 属性避免提示错误
optionalTypes: [Number, String], type: Number,
optionalTypes: [Number],
value: 7 value: 7
}, },
/** /**
......
...@@ -2,7 +2,8 @@ export default { ...@@ -2,7 +2,8 @@ export default {
properties: { properties: {
calenderHeight: { calenderHeight: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误 // 新版本不能使用type 改用optionalTypes 属性避免提示错误
optionalTypes: [String, Number] type: String,
optionalTypes: [Number]
}, },
title: String, // 标题名称 title: String, // 标题名称
hasRadius: { hasRadius: {
...@@ -63,7 +64,8 @@ export default { ...@@ -63,7 +64,8 @@ export default {
/** 周起始日,默认周日 */ /** 周起始日,默认周日 */
firstDayOfWeek: { firstDayOfWeek: {
// 新版本不能使用type 改用optionalTypes 属性避免提示错误 // 新版本不能使用type 改用optionalTypes 属性避免提示错误
optionalTypes: [Number, String], type: Number,
optionalTypes: [Number],
value: 7 value: 7
}, },
/** /**
......
// components/GlInput.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<!--components/GlInput.wxml-->
<text>components/GlInput.wxml</text>
/* components/GlInput.wxss */
\ No newline at end of file \ No newline at end of file
export const RED = '#ee0a24';
export const BLUE = '#1989fa';
export const WHITE = '#fff';
export const GREEN = '#07c160';
export const ORANGE = '#ff976a';
export const GRAY = '#323233';
export const GRAY_DARK = '#969799';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useChildren = exports.useParent = void 0;
function useParent(name, onEffect) {
var _a;
var path = "../" + name + "/index";
return {
relations: (_a = {},
_a[path] = {
type: 'ancestor',
linked: function () {
onEffect && onEffect.call(this);
},
linkChanged: function () {
onEffect && onEffect.call(this);
},
unlinked: function () {
onEffect && onEffect.call(this);
},
},
_a),
mixin: Behavior({
created: function () {
var _this = this;
Object.defineProperty(this, 'parent', {
get: function () { return _this.getRelationNodes(path)[0]; },
});
Object.defineProperty(this, 'index', {
// @ts-ignore
get: function () { var _a, _b; return (_b = (_a = _this.parent) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.indexOf(_this); },
});
},
}),
};
}
exports.useParent = useParent;
function useChildren(name, onEffect) {
var _a;
var path = "../" + name + "/index";
return {
relations: (_a = {},
_a[path] = {
type: 'descendant',
linked: function (target) {
onEffect && onEffect.call(this, target);
},
linkChanged: function (target) {
onEffect && onEffect.call(this, target);
},
unlinked: function (target) {
onEffect && onEffect.call(this, target);
},
},
_a),
mixin: Behavior({
created: function () {
var _this = this;
Object.defineProperty(this, 'children', {
get: function () { return _this.getRelationNodes(path) || []; },
});
},
}),
};
}
exports.useChildren = useChildren;
.van-clearfix:after{display:table;clear:both;content:""}
\ No newline at end of file \ No newline at end of file
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}
\ No newline at end of file \ No newline at end of file
.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
\ No newline at end of file \ No newline at end of file
export function isDef(value) {
return value !== undefined && value !== null;
}
export function isObj(x) {
const type = typeof x;
return x !== null && (type === 'object' || type === 'function');
}
export function isNumber(value) {
return /^\d+(\.\d+)?$/.test(value);
}
export function range(num, min, max) {
return Math.min(Math.max(num, min), max);
}
export function nextTick(fn) {
setTimeout(() => {
fn();
}, 1000 / 30);
}
let systemInfo = null;
export function getSystemInfoSync() {
if (systemInfo == null) {
systemInfo = wx.getSystemInfoSync();
}
return systemInfo;
}
export function addUnit(value) {
if (!isDef(value)) {
return undefined;
}
value = String(value);
return isNumber(value) ? `${value}px` : value;
}
import { VantComponent } from '../common/component';
import { useParent } from '../common/relation';
import { link } from '../mixins/link';
VantComponent({
relation: useParent('grid'),
classes: ['content-class', 'icon-class', 'text-class'],
mixins: [link],
props: {
icon: String,
iconColor: String,
iconPrefix: {
type: String,
value: 'van-icon',
},
dot: Boolean,
info: null,
badge: null,
text: String,
useSlot: Boolean,
},
data: {
viewStyle: '',
},
mounted() {
this.updateStyle();
},
methods: {
updateStyle() {
if (!this.parent) {
return;
}
const { data, children } = this.parent;
const { columnNum, border, square, gutter, clickable, center, direction, reverse, iconSize, } = data;
this.setData({
center,
border,
square,
gutter,
clickable,
direction,
reverse,
iconSize,
index: children.indexOf(this),
columnNum,
});
},
onClick() {
this.$emit('click');
this.jumpLink();
},
},
});
{
"component": true,
"usingComponents": {
"van-icon": "../icon/index"
}
}
<wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="computed" />
<view
class="custom-class {{ utils.bem('grid-item', { square }) }}"
style="{{ computed.wrapperStyle({ square, gutter, columnNum, index }) }}"
bindtap="onClick"
>
<view
class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, reverse, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
style="{{ computed.contentStyle({ square, gutter }) }}"
>
<block wx:if="{{ useSlot }}">
<slot />
</block>
<block wx:else>
<view class="van-grid-item__icon icon-class">
<van-icon wx:if="{{ icon }}" name="{{ icon }}" color="{{ iconColor }}" class-prefix="{{ iconPrefix }}" dot="{{ dot }}" info="{{ badge || info }}" size="{{ iconSize }}" />
<slot wx:else name="icon"></slot>
</view>
<view class="van-grid-item__text text-class">
<text wx:if="{{ text }}">{{ text }}</text>
<slot wx:else name="text"></slot>
</view>
</block>
</view>
</view>
/* eslint-disable */
var style = require('../wxs/style.wxs');
var addUnit = require('../wxs/add-unit.wxs');
function wrapperStyle(data) {
var width = 100 / data.columnNum + '%';
return style({
width: width,
'padding-top': data.square ? width : null,
'padding-right': addUnit(data.gutter),
'margin-top':
data.index >= data.columnNum && !data.square
? addUnit(data.gutter)
: null,
});
}
function contentStyle(data) {
return data.square
? style({
right: addUnit(data.gutter),
bottom: addUnit(data.gutter),
height: 'auto',
})
: '';
}
module.exports = {
wrapperStyle: wrapperStyle,
contentStyle: contentStyle,
};
@import '../common/index.wxss';.van-grid-item{box-sizing:border-box;float:left;position:relative}.van-grid-item--square{height:0}.van-grid-item__content{background-color:var(--grid-item-content-background-color,#fff);box-sizing:border-box;display:flex;flex-direction:column;height:100%;padding:var(--grid-item-content-padding,16px 8px)}.van-grid-item__content:after{border-width:0 1px 1px 0;z-index:1}.van-grid-item__content--surround:after{border-width:1px}.van-grid-item__content--center{align-items:center;justify-content:center}.van-grid-item__content--square{left:0;position:absolute;right:0;top:0}.van-grid-item__content--horizontal{flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__text{margin:0 0 0 8px}.van-grid-item__content--reverse{flex-direction:column-reverse}.van-grid-item__content--reverse .van-grid-item__text{margin:0 0 8px}.van-grid-item__content--horizontal.van-grid-item__content--reverse{flex-direction:row-reverse}.van-grid-item__content--horizontal.van-grid-item__content--reverse .van-grid-item__text{margin:0 8px 0 0}.van-grid-item__content--clickable:active{background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{align-items:center;display:flex;font-size:var(--grid-item-icon-size,26px);height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:var(--grid-item-text-color,#646566);font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}
\ No newline at end of file \ No newline at end of file
import { VantComponent } from '../common/component';
import { useChildren } from '../common/relation';
VantComponent({
relation: useChildren('grid-item'),
props: {
square: {
type: Boolean,
observer: 'updateChildren',
},
gutter: {
type: null,
value: 0,
observer: 'updateChildren',
},
clickable: {
type: Boolean,
observer: 'updateChildren',
},
columnNum: {
type: Number,
value: 4,
observer: 'updateChildren',
},
center: {
type: Boolean,
value: true,
observer: 'updateChildren',
},
border: {
type: Boolean,
value: true,
observer: 'updateChildren',
},
direction: {
type: String,
observer: 'updateChildren',
},
iconSize: {
type: String,
observer: 'updateChildren',
},
reverse: {
type: Boolean,
value: false,
observer: 'updateChildren',
},
},
methods: {
updateChildren() {
this.children.forEach((child) => {
child.updateStyle();
});
},
},
});
<wxs src="./index.wxs" module="computed" />
<view
class="van-grid custom-class {{ border && !gutter ? 'van-hairline--top' : '' }}"
style="{{ computed.rootStyle({ gutter }) }}"
>
<slot />
</view>
/* eslint-disable */
var style = require('../wxs/style.wxs');
var addUnit = require('../wxs/add-unit.wxs');
function rootStyle(data) {
return style({
'padding-left': addUnit(data.gutter),
});
}
module.exports = {
rootStyle: rootStyle,
};
@import '../common/index.wxss';.van-grid{box-sizing:border-box;overflow:hidden;position:relative}
\ No newline at end of file \ No newline at end of file
export const basic = Behavior({
methods: {
$emit(...args) {
this.triggerEvent(...args);
},
set(data, callback) {
this.setData(data, callback);
return new Promise(resolve => wx.nextTick(resolve));
},
getRect(selector, all) {
return new Promise(resolve => {
wx.createSelectorQuery()
.in(this)[all ? 'selectAll' : 'select'](selector)
.boundingClientRect(rect => {
if (all && Array.isArray(rect) && rect.length) {
resolve(rect);
}
if (!all && rect) {
resolve(rect);
}
})
.exec();
});
}
}
});
export const button = Behavior({
externalClasses: ['hover-class'],
properties: {
id: String,
lang: String,
businessId: Number,
sessionFrom: String,
sendMessageTitle: String,
sendMessagePath: String,
sendMessageImg: String,
showMessageCard: Boolean,
appParameter: String,
ariaLabel: String
}
});
export const link = Behavior({
properties: {
url: String,
linkType: {
type: String,
value: 'navigateTo'
}
},
methods: {
jumpLink(urlKey = 'url') {
const url = this.data[urlKey];
if (url) {
wx[this.data.linkType]({ url });
}
}
}
});
export const openType = Behavior({
properties: {
openType: String
},
methods: {
bindGetUserInfo(event) {
this.$emit('getuserinfo', event.detail);
},
bindContact(event) {
this.$emit('contact', event.detail);
},
bindGetPhoneNumber(event) {
this.$emit('getphonenumber', event.detail);
},
bindError(event) {
this.$emit('error', event.detail);
},
bindLaunchApp(event) {
this.$emit('launchapp', event.detail);
},
bindOpenSetting(event) {
this.$emit('opensetting', event.detail);
},
}
});
function getCurrentPage() {
const pages = getCurrentPages();
return pages[pages.length - 1] || {};
}
function onPageScroll(event) {
const { vanPageScroller = [] } = getCurrentPage();
vanPageScroller.forEach((scroller) => {
if (typeof scroller === 'function') {
scroller(event);
}
});
}
export const pageScrollMixin = (scroller) => Behavior({
attached() {
const page = getCurrentPage();
if (Array.isArray(page.vanPageScroller)) {
page.vanPageScroller.push(scroller.bind(this));
}
else {
page.vanPageScroller = [page.onPageScroll, scroller.bind(this)];
}
page.onPageScroll = onPageScroll;
},
detached() {
const page = getCurrentPage();
page.vanPageScroller = (page.vanPageScroller || []).filter(item => item !== scroller);
}
});
const MIN_DISTANCE = 10;
function getDirection(x, y) {
if (x > y && x > MIN_DISTANCE) {
return 'horizontal';
}
if (y > x && y > MIN_DISTANCE) {
return 'vertical';
}
return '';
}
export const touch = Behavior({
methods: {
resetTouchStatus() {
this.direction = '';
this.deltaX = 0;
this.deltaY = 0;
this.offsetX = 0;
this.offsetY = 0;
},
touchStart(event) {
this.resetTouchStatus();
const touch = event.touches[0];
this.startX = touch.clientX;
this.startY = touch.clientY;
},
touchMove(event) {
const touch = event.touches[0];
this.deltaX = touch.clientX - this.startX;
this.deltaY = touch.clientY - this.startY;
this.offsetX = Math.abs(this.deltaX);
this.offsetY = Math.abs(this.deltaY);
this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
}
}
});
import { isObj } from '../common/utils';
const getClassNames = (name) => ({
enter: `van-${name}-enter van-${name}-enter-active enter-class enter-active-class`,
'enter-to': `van-${name}-enter-to van-${name}-enter-active enter-to-class enter-active-class`,
leave: `van-${name}-leave van-${name}-leave-active leave-class leave-active-class`,
'leave-to': `van-${name}-leave-to van-${name}-leave-active leave-to-class leave-active-class`
});
const nextTick = () => new Promise(resolve => setTimeout(resolve, 1000 / 30));
export const transition = function (showDefaultValue) {
return Behavior({
properties: {
customStyle: String,
// @ts-ignore
show: {
type: Boolean,
value: showDefaultValue,
observer: 'observeShow'
},
// @ts-ignore
duration: {
type: null,
value: 300,
observer: 'observeDuration'
},
name: {
type: String,
value: 'fade'
}
},
data: {
type: '',
inited: false,
display: false
},
methods: {
observeShow(value, old) {
if (value === old) {
return;
}
value ? this.enter() : this.leave();
},
enter() {
const { duration, name } = this.data;
const classNames = getClassNames(name);
const currentDuration = isObj(duration) ? duration.enter : duration;
this.status = 'enter';
this.$emit('before-enter');
Promise.resolve()
.then(nextTick)
.then(() => {
this.checkStatus('enter');
this.$emit('enter');
this.setData({
inited: true,
display: true,
classes: classNames.enter,
currentDuration
});
})
.then(nextTick)
.then(() => {
this.checkStatus('enter');
this.transitionEnded = false;
this.setData({
classes: classNames['enter-to']
});
})
.catch(() => { });
},
leave() {
if (!this.data.display) {
return;
}
const { duration, name } = this.data;
const classNames = getClassNames(name);
const currentDuration = isObj(duration) ? duration.leave : duration;
this.status = 'leave';
this.$emit('before-leave');
Promise.resolve()
.then(nextTick)
.then(() => {
this.checkStatus('leave');
this.$emit('leave');
this.setData({
classes: classNames.leave,
currentDuration
});
})
.then(nextTick)
.then(() => {
this.checkStatus('leave');
this.transitionEnded = false;
setTimeout(() => this.onTransitionEnd(), currentDuration);
this.setData({
classes: classNames['leave-to']
});
})
.catch(() => { });
},
checkStatus(status) {
if (status !== this.status) {
throw new Error(`incongruent status: ${status}`);
}
},
onTransitionEnd() {
if (this.transitionEnded) {
return;
}
this.transitionEnded = true;
this.$emit(`after-${this.status}`);
const { show, display } = this.data;
if (!show && display) {
this.setData({ display: false });
}
}
}
});
};
const api = wx.$request
module.exports = {
/**获取当前登录账号能查看的园区店列表 */
getYQList() {
return api.post('dj.api.smartcarlife.serviceMerchant.curYqList')
},
/** 根据商户号获取员工列表信息(转化人员) */
getConversionEmployeeList(data) {
return api.post('dj.api.smartcarlife.employee.getByMerchantId', data)
},
/** 根据园区店商户号获取绑定4S店列表 */
getServiceMerchantList(data) {
return api.post('dj.api.smartcarlife.serviceMerchant.list', data)
}
}
\ No newline at end of file \ No newline at end of file
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
"minifyWXML": true, "minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true "ignoreUploadUnusedFiles": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.22.1", "libVersion": "2.20.3",
"appid": "wx570d9331f9ace0bd", "appid": "wx570d9331f9ace0bd",
"projectname": "%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F", "projectname": "%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F",
"debugOptions": { "debugOptions": {
......
...@@ -6,11 +6,15 @@ module.exports = { ...@@ -6,11 +6,15 @@ module.exports = {
}, },
/**门店礼券发放数据 */ /**门店礼券发放数据 */
getMerchantCouponList(data) { getMerchantCouponList(data) {
return api.post('dj.api.smartcarlife.couponDayReport.countByMerchant', { return api.post(
// 'dj.api.smartcarlife.couponDayReport.countByMerchant',
'dj.api.smartcarlife.couponDayReport.countByMerchantByOrderReport',
{
pageSize: 9999, pageSize: 9999,
pageNum: 1, pageNum: 1,
...data ...data
}) }
)
}, },
/** 首页账户数据 */ /** 首页账户数据 */
getHomeReport() { getHomeReport() {
......
{ {
"usingComponents": { "usingComponents": {},
"van-grid": "/components/vant/grid/index",
"van-grid-item": "/components/vant/grid-item/index"
},
"navigationBarTitleText": "我的种草" "navigationBarTitleText": "我的种草"
} }
// filter.wxs
var dateFormat = function (date) {
var dates = date.split('/')
return dates[0] + '年' + dates[1] + '月' + dates[2] + '日'
}
var moneyFormat = function (money) {
return money.toFixed(2)
}
/*
* 导出
*/
module.exports = {
dateFormat: dateFormat,
moneyFormat: moneyFormat
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!