已支付订单列表:where.payStatus = 1;
This commit is contained in:
Vendored
+317
@@ -0,0 +1,317 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "uni-data-select",
|
||||
mixins: [common_vendor.Ws.mixinDatacom || {}],
|
||||
props: {
|
||||
localdata: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择"
|
||||
},
|
||||
emptyTips: {
|
||||
type: String,
|
||||
default: "无选项"
|
||||
},
|
||||
clear: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
defItem: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
|
||||
format: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placement: {
|
||||
type: String,
|
||||
default: "bottom"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showSelector: false,
|
||||
current: "",
|
||||
mixinDatacomResData: [],
|
||||
apps: [],
|
||||
channels: [],
|
||||
cacheKey: "uni-data-select-lastSelectedValue"
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.debounceGet = this.debounce(() => {
|
||||
this.query();
|
||||
}, 300);
|
||||
if (this.collection && !this.localdata.length) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typePlaceholder() {
|
||||
const text = {
|
||||
"opendb-stat-app-versions": "版本",
|
||||
"opendb-app-channels": "渠道",
|
||||
"opendb-app-list": "应用"
|
||||
};
|
||||
const common = this.placeholder;
|
||||
const placeholder = text[this.collection];
|
||||
return placeholder ? common + placeholder : common;
|
||||
},
|
||||
valueCom() {
|
||||
return this.modelValue;
|
||||
},
|
||||
textShow() {
|
||||
let text = this.current;
|
||||
if (text.length > 10) {
|
||||
return text.slice(0, 25) + "...";
|
||||
}
|
||||
return text;
|
||||
},
|
||||
getOffsetByPlacement() {
|
||||
switch (this.placement) {
|
||||
case "top":
|
||||
return "bottom:calc(100% + 12px);";
|
||||
case "bottom":
|
||||
return "top:calc(100% + 12px);";
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
localdata: {
|
||||
immediate: true,
|
||||
handler(val, old) {
|
||||
if (Array.isArray(val) && old !== val) {
|
||||
this.mixinDatacomResData = val;
|
||||
}
|
||||
}
|
||||
},
|
||||
valueCom(val, old) {
|
||||
this.initDefVal();
|
||||
},
|
||||
mixinDatacomResData: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
if (val.length) {
|
||||
this.initDefVal();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
debounce(fn, time = 100) {
|
||||
let timer = null;
|
||||
return function(...args) {
|
||||
if (timer) clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, args);
|
||||
}, time);
|
||||
};
|
||||
},
|
||||
// 执行数据库查询
|
||||
query() {
|
||||
this.mixinDatacomEasyGet();
|
||||
},
|
||||
// 监听查询条件变更事件
|
||||
onMixinDatacomPropsChange() {
|
||||
if (this.collection) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
initDefVal() {
|
||||
let defValue = "";
|
||||
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
|
||||
defValue = this.valueCom;
|
||||
} else {
|
||||
let strogeValue;
|
||||
if (this.collection) {
|
||||
strogeValue = this.getCache();
|
||||
}
|
||||
if (strogeValue || strogeValue === 0) {
|
||||
defValue = strogeValue;
|
||||
} else {
|
||||
let defItem = "";
|
||||
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
|
||||
defItem = this.mixinDatacomResData[this.defItem - 1].value;
|
||||
}
|
||||
defValue = defItem;
|
||||
}
|
||||
if (defValue || defValue === 0) {
|
||||
this.emit(defValue);
|
||||
}
|
||||
}
|
||||
const def = this.mixinDatacomResData.find((item) => item.value === defValue);
|
||||
this.current = def ? this.formatItemName(def) : "";
|
||||
},
|
||||
/**
|
||||
* @param {[String, Number]} value
|
||||
* 判断用户给的 value 是否同时为禁用状态
|
||||
*/
|
||||
isDisabled(value) {
|
||||
let isDisabled = false;
|
||||
this.mixinDatacomResData.forEach((item) => {
|
||||
if (item.value === value) {
|
||||
isDisabled = item.disable;
|
||||
}
|
||||
});
|
||||
return isDisabled;
|
||||
},
|
||||
clearVal() {
|
||||
this.emit("");
|
||||
if (this.collection) {
|
||||
this.removeCache();
|
||||
}
|
||||
},
|
||||
change(item) {
|
||||
if (!item.disable) {
|
||||
this.showSelector = false;
|
||||
this.current = this.formatItemName(item);
|
||||
this.emit(item.value);
|
||||
}
|
||||
},
|
||||
emit(val) {
|
||||
this.$emit("input", val);
|
||||
this.$emit("update:modelValue", val);
|
||||
this.$emit("change", val);
|
||||
if (this.collection) {
|
||||
this.setCache(val);
|
||||
}
|
||||
},
|
||||
toggleSelector() {
|
||||
if (this.disabled) {
|
||||
return;
|
||||
}
|
||||
this.showSelector = !this.showSelector;
|
||||
},
|
||||
formatItemName(item) {
|
||||
let {
|
||||
text,
|
||||
value,
|
||||
channel_code
|
||||
} = item;
|
||||
channel_code = channel_code ? `(${channel_code})` : "";
|
||||
if (this.format) {
|
||||
let str = "";
|
||||
str = this.format;
|
||||
for (let key in item) {
|
||||
str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
|
||||
}
|
||||
return str;
|
||||
} else {
|
||||
return this.collection.indexOf("app-list") > 0 ? `${text}(${value})` : text ? text : `未命名${channel_code}`;
|
||||
}
|
||||
},
|
||||
// 获取当前加载的数据
|
||||
getLoadData() {
|
||||
return this.mixinDatacomResData;
|
||||
},
|
||||
// 获取当前缓存key
|
||||
getCurrentCacheKey() {
|
||||
return this.collection;
|
||||
},
|
||||
// 获取缓存
|
||||
getCache(name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
return cacheData[name];
|
||||
},
|
||||
// 设置缓存
|
||||
setCache(value, name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
cacheData[name] = value;
|
||||
common_vendor.index.setStorageSync(this.cacheKey, cacheData);
|
||||
},
|
||||
// 删除缓存
|
||||
removeCache(name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
delete cacheData[name];
|
||||
common_vendor.index.setStorageSync(this.cacheKey, cacheData);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_icons();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $props.label
|
||||
}, $props.label ? {
|
||||
b: common_vendor.t($props.label + ":")
|
||||
} : {}, {
|
||||
c: $data.current
|
||||
}, $data.current ? {
|
||||
d: common_vendor.t($options.textShow)
|
||||
} : {
|
||||
e: common_vendor.t($options.typePlaceholder)
|
||||
}, {
|
||||
f: $data.current && $props.clear && !$props.disabled
|
||||
}, $data.current && $props.clear && !$props.disabled ? {
|
||||
g: common_vendor.p({
|
||||
type: "clear",
|
||||
color: "#c0c4cc",
|
||||
size: "24"
|
||||
}),
|
||||
h: common_vendor.o((...args) => $options.clearVal && $options.clearVal(...args))
|
||||
} : {
|
||||
i: common_vendor.p({
|
||||
type: $data.showSelector ? "top" : "bottom",
|
||||
size: "14",
|
||||
color: "#999"
|
||||
})
|
||||
}, {
|
||||
j: common_vendor.o((...args) => $options.toggleSelector && $options.toggleSelector(...args)),
|
||||
k: $data.showSelector
|
||||
}, $data.showSelector ? {
|
||||
l: common_vendor.o((...args) => $options.toggleSelector && $options.toggleSelector(...args))
|
||||
} : {}, {
|
||||
m: $data.showSelector
|
||||
}, $data.showSelector ? common_vendor.e({
|
||||
n: common_vendor.n($props.placement == "bottom" ? "uni-popper__arrow_bottom" : "uni-popper__arrow_top"),
|
||||
o: $data.mixinDatacomResData.length === 0
|
||||
}, $data.mixinDatacomResData.length === 0 ? {
|
||||
p: common_vendor.t($props.emptyTips)
|
||||
} : {
|
||||
q: common_vendor.f($data.mixinDatacomResData, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.formatItemName(item)),
|
||||
b: item.disable ? 1 : "",
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.change(item), index)
|
||||
};
|
||||
})
|
||||
}, {
|
||||
r: common_vendor.s($options.getOffsetByPlacement)
|
||||
}) : {}, {
|
||||
s: $props.disabled ? 1 : "",
|
||||
t: $data.current ? 1 : ""
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue"]]);
|
||||
wx.createComponent(Component);
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<view class="uni-stat__select"><label wx:if="{{a}}" class="uni-label-text hide-on-phone">{{b}}</label><view class="{{['uni-stat-box', t && 'uni-stat__actived']}}"><view class="{{['uni-select', s && 'uni-select--disabled']}}"><view class="uni-select__input-box" bindtap="{{j}}"><view wx:if="{{c}}" class="uni-select__input-text">{{d}}</view><view wx:else class="uni-select__input-text uni-select__input-placeholder">{{e}}</view><view wx:if="{{f}}" catchtap="{{h}}"><uni-icons wx:if="{{g}}" u-i="a27774b6-0" bind:__l="__l" u-p="{{g}}"/></view><view wx:else><uni-icons wx:if="{{i}}" u-i="a27774b6-1" bind:__l="__l" u-p="{{i}}"/></view></view><view wx:if="{{k}}" class="uni-select--mask" bindtap="{{l}}"/><view wx:if="{{m}}" class="uni-select__selector" style="{{r}}"><view class="{{n}}"></view><scroll-view scroll-y="true" class="uni-select__selector-scroll"><view wx:if="{{o}}" class="uni-select__selector-empty"><text>{{p}}</text></view><block wx:else><view wx:for="{{q}}" wx:for-item="item" wx:key="c" class="uni-select__selector-item" bindtap="{{item.d}}"><text class="{{[item.b && 'uni-select__selector__disabled']}}">{{item.a}}</text></view></block></scroll-view></view></view></view></view>
|
||||
Vendored
+200
@@ -0,0 +1,200 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
@media screen and (max-width: 500px) {
|
||||
.hide-on-phone {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.uni-stat__select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.uni-stat-box {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-stat__actived {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-label-text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #6a6a6a;
|
||||
margin: auto 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.uni-select {
|
||||
font-size: 14px;
|
||||
border: 1px solid #e5e5e5;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
padding: 0 5px;
|
||||
padding-left: 10px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
border-bottom: solid 1px #e5e5e5;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
height: 35px;
|
||||
}
|
||||
.uni-select--disabled {
|
||||
background-color: #f5f7fa;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.uni-select__label {
|
||||
font-size: 16px;
|
||||
height: 35px;
|
||||
padding-right: 10px;
|
||||
color: #909399;
|
||||
}
|
||||
.uni-select__input-box {
|
||||
height: 35px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.uni-select__input {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.uni-select__input-plac {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
}
|
||||
.uni-select__selector {
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #EBEEF5;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
z-index: 3;
|
||||
padding: 4px 0;
|
||||
}
|
||||
.uni-select__selector-scroll {
|
||||
max-height: 200px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.uni-select__selector-empty,
|
||||
.uni-select__selector-item {
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
line-height: 35px;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
/* border-bottom: solid 1px $uni-border-3; */
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.uni-select__selector-item:hover {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.uni-select__selector-empty:last-child,
|
||||
.uni-select__selector-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.uni-select__selector__disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* picker 弹出层通用的指示小三角 */
|
||||
.uni-popper__arrow_bottom,
|
||||
.uni-popper__arrow_bottom::after,
|
||||
.uni-popper__arrow_top,
|
||||
.uni-popper__arrow_top::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 6px;
|
||||
}
|
||||
.uni-popper__arrow_bottom {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
top: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #EBEEF5;
|
||||
}
|
||||
.uni-popper__arrow_bottom::after {
|
||||
content: " ";
|
||||
top: 1px;
|
||||
margin-left: -6px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.uni-popper__arrow_top {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
bottom: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-bottom-width: 0;
|
||||
border-top-color: #EBEEF5;
|
||||
}
|
||||
.uni-popper__arrow_top::after {
|
||||
content: " ";
|
||||
bottom: 1px;
|
||||
margin-left: -6px;
|
||||
border-bottom-width: 0;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
.uni-select__input-text {
|
||||
width: 100%;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.uni-select__input-placeholder {
|
||||
color: #6a6a6a;
|
||||
font-size: 12px;
|
||||
}
|
||||
.uni-select--mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
Reference in New Issue
Block a user