已支付订单列表:where.payStatus = 1;
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
const button = {
|
||||
props: {
|
||||
lang: String,
|
||||
sessionFrom: String,
|
||||
sendMessageTitle: String,
|
||||
sendMessagePath: String,
|
||||
sendMessageImg: String,
|
||||
showMessageCard: Boolean,
|
||||
appParameter: String,
|
||||
formType: String,
|
||||
openType: String
|
||||
}
|
||||
};
|
||||
exports.button = button;
|
||||
@@ -0,0 +1,150 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uvUiTools_libs_function_index = require("../function/index.js");
|
||||
const uni_modules_uvUiTools_libs_function_test = require("../function/test.js");
|
||||
const uni_modules_uvUiTools_libs_util_route = require("../util/route.js");
|
||||
const uni_modules_uvUiTools_libs_function_debounce = require("../function/debounce.js");
|
||||
const uni_modules_uvUiTools_libs_function_throttle = require("../function/throttle.js");
|
||||
const mixin = {
|
||||
// 定义每个组件都可能需要用到的外部样式以及类名
|
||||
props: {
|
||||
// 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
|
||||
customStyle: {
|
||||
type: [Object, String],
|
||||
default: () => ({})
|
||||
},
|
||||
customClass: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
// 跳转的页面路径
|
||||
url: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
// 页面跳转的类型
|
||||
linkType: {
|
||||
type: String,
|
||||
default: "navigateTo"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad() {
|
||||
this.$uv.getRect = this.$uvGetRect;
|
||||
},
|
||||
created() {
|
||||
this.$uv.getRect = this.$uvGetRect;
|
||||
},
|
||||
computed: {
|
||||
$uv() {
|
||||
var _a, _b, _c;
|
||||
return {
|
||||
...uni_modules_uvUiTools_libs_function_index.index,
|
||||
test: uni_modules_uvUiTools_libs_function_test.test,
|
||||
route: uni_modules_uvUiTools_libs_util_route.route,
|
||||
debounce: uni_modules_uvUiTools_libs_function_debounce.debounce,
|
||||
throttle: uni_modules_uvUiTools_libs_function_throttle.throttle,
|
||||
unit: (_c = (_b = (_a = common_vendor.index) == null ? void 0 : _a.$uv) == null ? void 0 : _b.config) == null ? void 0 : _c.unit
|
||||
};
|
||||
},
|
||||
/**
|
||||
* 生成bem规则类名
|
||||
* 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用
|
||||
* 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式
|
||||
* @param {String} name 组件名称
|
||||
* @param {Array} fixed 一直会存在的类名
|
||||
* @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名
|
||||
* @returns {Array|string}
|
||||
*/
|
||||
bem() {
|
||||
return function(name, fixed, change) {
|
||||
const prefix = `uv-${name}--`;
|
||||
const classes = {};
|
||||
if (fixed) {
|
||||
fixed.map((item) => {
|
||||
classes[prefix + this[item]] = true;
|
||||
});
|
||||
}
|
||||
if (change) {
|
||||
change.map((item) => {
|
||||
this[item] ? classes[prefix + item] = this[item] : delete classes[prefix + item];
|
||||
});
|
||||
}
|
||||
return Object.keys(classes);
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 跳转某一个页面
|
||||
openPage(urlKey = "url") {
|
||||
const url = this[urlKey];
|
||||
if (url) {
|
||||
common_vendor.index[this.linkType]({
|
||||
url
|
||||
});
|
||||
}
|
||||
},
|
||||
// 查询节点信息
|
||||
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
|
||||
// 解决办法为在组件根部再套一个没有任何作用的view元素
|
||||
$uvGetRect(selector, all) {
|
||||
return new Promise((resolve) => {
|
||||
common_vendor.index.createSelectorQuery().in(this)[all ? "selectAll" : "select"](selector).boundingClientRect((rect) => {
|
||||
if (all && Array.isArray(rect) && rect.length) {
|
||||
resolve(rect);
|
||||
}
|
||||
if (!all && rect) {
|
||||
resolve(rect);
|
||||
}
|
||||
}).exec();
|
||||
});
|
||||
},
|
||||
getParentData(parentName = "") {
|
||||
if (!this.parent) this.parent = {};
|
||||
this.parent = this.$uv.$parent.call(this, parentName);
|
||||
if (this.parent.children) {
|
||||
this.parent.children.indexOf(this) === -1 && this.parent.children.push(this);
|
||||
}
|
||||
if (this.parent && this.parentData) {
|
||||
Object.keys(this.parentData).map((key) => {
|
||||
this.parentData[key] = this.parent[key];
|
||||
});
|
||||
}
|
||||
},
|
||||
// 阻止事件冒泡
|
||||
preventEvent(e) {
|
||||
e && typeof e.stopPropagation === "function" && e.stopPropagation();
|
||||
},
|
||||
// 空操作
|
||||
noop(e) {
|
||||
this.preventEvent(e);
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
common_vendor.index.$emit("uvOnReachBottom");
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.parent && uni_modules_uvUiTools_libs_function_test.array(this.parent.children)) {
|
||||
const childrenList = this.parent.children;
|
||||
childrenList.map((child, index) => {
|
||||
if (child === this) {
|
||||
childrenList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 兼容vue3
|
||||
unmounted() {
|
||||
if (this.parent && uni_modules_uvUiTools_libs_function_test.array(this.parent.children)) {
|
||||
const childrenList = this.parent.children;
|
||||
childrenList.map((child, index) => {
|
||||
if (child === this) {
|
||||
childrenList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.mixin = mixin;
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
const mpMixin = {
|
||||
// 将自定义节点设置成虚拟的(去掉自定义组件包裹层),更加接近Vue组件的表现,能更好的使用flex属性
|
||||
options: {
|
||||
virtualHost: true
|
||||
}
|
||||
};
|
||||
exports.mpMixin = mpMixin;
|
||||
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const mpShare = {
|
||||
onLoad() {
|
||||
common_vendor.index.$uv.mpShare = {
|
||||
title: "",
|
||||
// 默认为小程序名称
|
||||
path: "",
|
||||
// 默认为当前页面路径
|
||||
imageUrl: ""
|
||||
// 默认为当前页面的截图
|
||||
};
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return common_vendor.index.$uv.mpShare;
|
||||
}
|
||||
};
|
||||
exports.mpShare = mpShare;
|
||||
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
const openType = {
|
||||
props: {
|
||||
openType: String
|
||||
},
|
||||
emits: ["getphonenumber", "getuserinfo", "error", "opensetting", "launchapp", "contact", "chooseavatar", "addgroupapp", "chooseaddress", "subscribe", "login", "im"],
|
||||
methods: {
|
||||
onGetPhoneNumber(event) {
|
||||
this.$emit("getphonenumber", event.detail);
|
||||
},
|
||||
onGetUserInfo(event) {
|
||||
this.$emit("getuserinfo", event.detail);
|
||||
},
|
||||
onError(event) {
|
||||
this.$emit("error", event.detail);
|
||||
},
|
||||
onOpenSetting(event) {
|
||||
this.$emit("opensetting", event.detail);
|
||||
},
|
||||
onLaunchApp(event) {
|
||||
this.$emit("launchapp", event.detail);
|
||||
},
|
||||
onContact(event) {
|
||||
this.$emit("contact", event.detail);
|
||||
},
|
||||
onChooseavatar(event) {
|
||||
this.$emit("chooseavatar", event.detail);
|
||||
},
|
||||
onAgreeprivacyauthorization(event) {
|
||||
this.$emit("agreeprivacyauthorization", event.detail);
|
||||
},
|
||||
onAddgroupapp(event) {
|
||||
this.$emit("addgroupapp", event.detail);
|
||||
},
|
||||
onChooseaddress(event) {
|
||||
this.$emit("chooseaddress", event.detail);
|
||||
},
|
||||
onSubscribe(event) {
|
||||
this.$emit("subscribe", event.detail);
|
||||
},
|
||||
onLogin(event) {
|
||||
this.$emit("login", event.detail);
|
||||
},
|
||||
onIm(event) {
|
||||
this.$emit("im", event.detail);
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.openType = openType;
|
||||
Reference in New Issue
Block a user