You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

183 lines
6.3 KiB

"use strict";
const common_vendor = require("../../common/vendor.js");
const config_host = require("../../config/host.js");
const HeaderNav = () => "../../components/HeaderNav/Index.js";
const FooterNav = () => "../../components/FooterNav/Index.js";
const RightNav = () => "../../components/RightNav/Index.js";
const MzButton = () => "../../components/MzButton/Index.js";
const _sfc_main = {
components: {
HeaderNav,
FooterNav,
RightNav,
MzButton
},
data() {
return {
options1: [{
text: "删除"
}],
title: "Hello",
loading: true,
staticImage: {
screenActiveImg: config_host.imghost + "/static/image/order-screen-active.png",
orderCardBackground: config_host.imghost + "/static/image/order-card-background.png",
wallpaperBgImage: config_host.imghost + "/static/image/background.png",
couponsBackground: config_host.imghost + "/static/image/coupons-bg.png",
couponsGrayBackground: config_host.imghost + "/static/image/coupons-gray-bg.png",
couponsGQ: config_host.imghost + "/static/image/coupons-gq.png",
addrDel: config_host.imghost + "/static/image/addr-del.png",
addrBg: config_host.imghost + "/static/image/addr-bg.png",
addrIcon: config_host.imghost + "/static/image/addr-icon.png",
addrEdit: config_host.imghost + "/static/image/addr-edit.png"
},
indexBanner: [{
image: config_host.imghost + "/static/image/banner.png",
url: ""
}],
user: {
avatar: config_host.imghost + "/static/image/banner.png",
nickname: "清晨的风",
coupons: 221,
id: 88685
},
isTop: false,
pagePadding: 100,
petImage: config_host.imghost + "/static/image/pet_avatar1.jpeg",
addrList: [{
id: "1",
name: "派大星",
phone: "182****6889",
addr: "四川省成都市武侯区天府二街环球中心 27253单元1601"
}, {
id: "2",
name: "派大星",
phone: "182****6889",
addr: "四川省成都市武侯区天府二街环球中心 27253单元1601"
}, {
id: "3",
name: "派大星",
phone: "182****6889",
addr: "四川省成都市武侯区天府二街环球中心 27253单元1601"
}, {
id: "4",
name: "派大星",
phone: "182****6889",
addr: "四川省成都市武侯区天府二街环球中心 27253单元1601"
}]
};
},
onLoad() {
},
methods: {
touchstart(e) {
console.log(e);
},
touchend(event, ownerInstance) {
},
touchmove(event, ownerInstance) {
var instance = event.instance;
var state = instance.getState();
if (state.disabled || !state.moving)
return;
var touches = event.touches;
var pageX = touches[0].pageX;
var pageY = touches[0].pageY;
var moveX = pageX - state.startX;
var moveY = pageY - state.startY;
var buttonsWidth = state.buttonsWidth;
if (Math.abs(moveX) > Math.abs(moveY) || Math.abs(moveX) > state.threshold) {
event.preventDefault && event.preventDefault();
event.stopPropagation && event.stopPropagation();
}
if (Math.abs(moveX) < Math.abs(moveY))
return;
if (state.status === "open") {
if (moveX < 0)
moveX = 0;
if (moveX > buttonsWidth)
moveX = buttonsWidth;
this.moveSwipeAction(-buttonsWidth + moveX, instance, ownerInstance);
} else {
if (moveX > 0)
moveX = 0;
if (Math.abs(moveX) > buttonsWidth)
moveX = -buttonsWidth;
this.moveSwipeAction(moveX, instance, ownerInstance);
}
},
moveSwipeAction(moveX, instance, ownerInstance) {
instance.getState();
ownerInstance.selectAllComponents(".u-swipe-action-item__right__button");
instance.requestAnimationFrame(function() {
instance.setStyle({
// 设置translateX的值
"transition": "none",
transform: "translateX(" + moveX + "px)",
"-webkit-transform": "translateX(" + moveX + "px)"
});
});
},
delAddr(item) {
common_vendor.index.showModal({
content: "123123",
showCancel: false
});
},
navTo(url) {
common_vendor.wx$1.navigateTo({
url
});
}
},
onPageScroll(res) {
if (res.scrollTop <= 20) {
common_vendor.index.$emit("isTop", true);
} else {
common_vendor.index.$emit("isTop", false);
}
},
created() {
}
};
if (!Array) {
const _component_HeaderNav = common_vendor.resolveComponent("HeaderNav");
const _easycom_uni_swipe_action_item2 = common_vendor.resolveComponent("uni-swipe-action-item");
const _easycom_uni_swipe_action2 = common_vendor.resolveComponent("uni-swipe-action");
(_component_HeaderNav + _easycom_uni_swipe_action_item2 + _easycom_uni_swipe_action2)();
}
const _easycom_uni_swipe_action_item = () => "../../uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js";
const _easycom_uni_swipe_action = () => "../../uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.js";
if (!Math) {
(_easycom_uni_swipe_action_item + _easycom_uni_swipe_action)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: "url(" + $data.staticImage.wallpaperBgImage + ")",
b: common_vendor.p({
title: "地址簿",
["is-back"]: true
}),
c: common_vendor.f($data.addrList, (item, k0, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.t(item.phone),
c: common_vendor.t(item.addr),
d: common_vendor.o(($event) => $options.delAddr(item)),
e: "297208bd-2-" + i0 + "," + ("297208bd-1-" + i0),
f: "297208bd-1-" + i0
};
}),
d: $data.staticImage.addrEdit,
e: common_vendor.o(($event) => $options.navTo("/pages/AddrDetail/index")),
f: $data.staticImage.addrIcon,
g: "url(" + $data.staticImage.addrBg + ")",
h: $data.staticImage.addrDel,
i: common_vendor.p({
["right-options"]: $data.options1
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/project/pet-uni/pages/Addr/index.vue"]]);
_sfc_main.__runtimeHooks = 1;
wx.createPage(MiniProgramPage);