first commit
This commit is contained in:
108
unpackage/dist/dev/mp-weixin/pages/address/add.js
vendored
Normal file
108
unpackage/dist/dev/mp-weixin/pages/address/add.js
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_index = require("../../api/index.js");
|
||||
if (!Array) {
|
||||
const _easycom_wd_navbar2 = common_vendor.resolveComponent("wd-navbar");
|
||||
const _easycom_wd_input2 = common_vendor.resolveComponent("wd-input");
|
||||
const _easycom_wd_switch2 = common_vendor.resolveComponent("wd-switch");
|
||||
(_easycom_wd_navbar2 + _easycom_wd_input2 + _easycom_wd_switch2)();
|
||||
}
|
||||
const _easycom_wd_navbar = () => "../../uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js";
|
||||
const _easycom_wd_input = () => "../../uni_modules/wot-design-uni/components/wd-input/wd-input.js";
|
||||
const _easycom_wd_switch = () => "../../uni_modules/wot-design-uni/components/wd-switch/wd-switch.js";
|
||||
if (!Math) {
|
||||
(_easycom_wd_navbar + _easycom_wd_input + _easycom_wd_switch)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "add",
|
||||
setup(__props) {
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.id) {
|
||||
api_index.api.addressInfo({ id: options.id }).then((res) => {
|
||||
const resData = res || {};
|
||||
resData.isDefault = resData.isDefault ? true : false;
|
||||
const formKeys = Object.keys(from.value);
|
||||
const updateData = {};
|
||||
formKeys.forEach((key) => {
|
||||
if (resData.hasOwnProperty(key)) {
|
||||
updateData[key] = resData[key];
|
||||
}
|
||||
});
|
||||
Object.assign(from.value, updateData);
|
||||
});
|
||||
}
|
||||
});
|
||||
const from = common_vendor.ref({
|
||||
receiverName: "",
|
||||
receiverPhone: "",
|
||||
receiverArea: "",
|
||||
receiverAddress: "",
|
||||
isDefault: true,
|
||||
status: 0,
|
||||
id: ""
|
||||
});
|
||||
const add_Address = () => {
|
||||
let data = JSON.parse(JSON.stringify(from.value));
|
||||
data.isDefault = data.isDefault ? 1 : 0;
|
||||
if (data.id) {
|
||||
api_index.api.addressUp(data).then((res) => {
|
||||
common_vendor.index.navigateBack();
|
||||
});
|
||||
} else {
|
||||
api_index.api.addressAdd(data).then((res) => {
|
||||
common_vendor.index.navigateBack();
|
||||
});
|
||||
}
|
||||
};
|
||||
const back = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(back),
|
||||
b: common_vendor.p({
|
||||
title: "新增地址",
|
||||
safeAreaInsetTop: true,
|
||||
["left-arrow"]: true
|
||||
}),
|
||||
c: common_vendor.o(($event) => from.value.receiverName = $event),
|
||||
d: common_vendor.p({
|
||||
type: "text",
|
||||
["no-border"]: true,
|
||||
placeholder: "请输入收货人姓名",
|
||||
modelValue: from.value.receiverName
|
||||
}),
|
||||
e: common_vendor.o(($event) => from.value.receiverPhone = $event),
|
||||
f: common_vendor.p({
|
||||
type: "number",
|
||||
["no-border"]: true,
|
||||
placeholder: "请输入手机号",
|
||||
modelValue: from.value.receiverPhone
|
||||
}),
|
||||
g: common_vendor.o(($event) => from.value.receiverArea = $event),
|
||||
h: common_vendor.p({
|
||||
type: "text",
|
||||
["no-border"]: true,
|
||||
placeholder: "请输入省市区",
|
||||
modelValue: from.value.receiverArea
|
||||
}),
|
||||
i: common_vendor.o(($event) => from.value.receiverAddress = $event),
|
||||
j: common_vendor.p({
|
||||
type: "text",
|
||||
["no-border"]: true,
|
||||
placeholder: "请输入详细地址",
|
||||
modelValue: from.value.receiverAddress
|
||||
}),
|
||||
k: common_vendor.o(($event) => from.value.isDefault = $event),
|
||||
l: common_vendor.p({
|
||||
size: "20px",
|
||||
modelValue: from.value.isDefault
|
||||
}),
|
||||
m: common_vendor.o(add_Address)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ef9226d4"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/address/add.js.map
|
||||
9
unpackage/dist/dev/mp-weixin/pages/address/add.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/pages/address/add.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"wd-navbar": "../../uni_modules/wot-design-uni/components/wd-navbar/wd-navbar",
|
||||
"wd-input": "../../uni_modules/wot-design-uni/components/wd-input/wd-input",
|
||||
"wd-switch": "../../uni_modules/wot-design-uni/components/wd-switch/wd-switch"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/address/add.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/address/add.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="address-add data-v-ef9226d4"><wd-navbar wx:if="{{b}}" class="data-v-ef9226d4" bindclickLeft="{{a}}" u-i="ef9226d4-0" bind:__l="__l" u-p="{{b}}"></wd-navbar><view class="from-address data-v-ef9226d4"><view class="title data-v-ef9226d4">收货人</view><view class="content data-v-ef9226d4"><wd-input wx:if="{{d}}" class="data-v-ef9226d4" u-i="ef9226d4-1" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"/></view></view><view class="from-address data-v-ef9226d4"><view class="title data-v-ef9226d4">手机号</view><view class="content data-v-ef9226d4"><wd-input wx:if="{{f}}" class="data-v-ef9226d4" u-i="ef9226d4-2" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"/></view></view><view class="from-address data-v-ef9226d4"><view class="title data-v-ef9226d4">所在地区</view><view class="content data-v-ef9226d4"><wd-input wx:if="{{h}}" class="data-v-ef9226d4" u-i="ef9226d4-3" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"/></view></view><view class="from-address data-v-ef9226d4"><view class="title data-v-ef9226d4">详细地址</view><view class="content data-v-ef9226d4"><wd-input wx:if="{{j}}" class="data-v-ef9226d4" u-i="ef9226d4-4" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"/></view></view><view class="from-address data-v-ef9226d4" style="margin-top:30rpx;justify-content:space-between"><view class="title data-v-ef9226d4" style="width:300rpx">设置为默认地址</view><view class="data-v-ef9226d4"><wd-switch wx:if="{{l}}" class="data-v-ef9226d4" u-i="ef9226d4-5" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"/></view></view><view class="bottom-btn data-v-ef9226d4"><view class="button-a data-v-ef9226d4" bindtap="{{m}}">保存</view></view></view>
|
||||
50
unpackage/dist/dev/mp-weixin/pages/address/add.wxss
vendored
Normal file
50
unpackage/dist/dev/mp-weixin/pages/address/add.wxss
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
.address-add.data-v-ef9226d4 {
|
||||
width: 100%;
|
||||
padding: 0rpx 0 180rpx;
|
||||
}
|
||||
.address-add .from-address.data-v-ef9226d4 {
|
||||
background-color: #fff;
|
||||
height: 110rpx;
|
||||
padding: 0rpx 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.address-add .from-address .title.data-v-ef9226d4 {
|
||||
width: 150rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.address-add .from-address .content.data-v-ef9226d4 {
|
||||
flex: 1;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx solid #f6f6f6;
|
||||
}
|
||||
.address-add .bottom-btn.data-v-ef9226d4 {
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
padding: 30rpx;
|
||||
background-color: #ffffff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
box-shadow: 0px 6rpx 16rpx 2rpx rgba(170, 170, 170, 0.35);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.address-add .bottom-btn .button-a.data-v-ef9226d4 {
|
||||
width: 690rpx;
|
||||
height: 90rpx;
|
||||
background: #799675;
|
||||
border-radius: 15rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #ffffff;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
111
unpackage/dist/dev/mp-weixin/pages/address/list.js
vendored
Normal file
111
unpackage/dist/dev/mp-weixin/pages/address/list.js
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_index = require("../../api/index.js");
|
||||
if (!Array) {
|
||||
const _easycom_wd_navbar2 = common_vendor.resolveComponent("wd-navbar");
|
||||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
||||
(_easycom_wd_navbar2 + _easycom_z_paging2)();
|
||||
}
|
||||
const _easycom_wd_navbar = () => "../../uni_modules/wot-design-uni/components/wd-navbar/wd-navbar.js";
|
||||
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
||||
if (!Math) {
|
||||
(_easycom_wd_navbar + _easycom_z_paging)();
|
||||
}
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "list",
|
||||
setup(__props) {
|
||||
const paging = common_vendor.ref(null);
|
||||
const type = common_vendor.ref(null);
|
||||
const dataList = common_vendor.ref([]);
|
||||
common_vendor.onLoad((options) => {
|
||||
type.value = options.type;
|
||||
});
|
||||
common_vendor.onShow(() => {
|
||||
paging.value.reload();
|
||||
});
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
api_index.api.addressPage({ pageNo, pageSize }).then((res) => {
|
||||
paging.value.complete(res.list);
|
||||
}).catch((res) => {
|
||||
paging.value.complete(false);
|
||||
});
|
||||
};
|
||||
const back = () => {
|
||||
common_vendor.index.navigateBack();
|
||||
};
|
||||
const tn = (e) => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: e
|
||||
});
|
||||
};
|
||||
const back_A = (e) => {
|
||||
if (type.value == 1) {
|
||||
common_vendor.index.$emit("address", e);
|
||||
common_vendor.index.navigateBack();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
};
|
||||
const deleAddress = (data) => {
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: "是否确认删除?",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
api_index.api.addressDel({ id: data.id }).then((res2) => {
|
||||
paging.value.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const copyAddress = (data) => {
|
||||
let aaa = `收货人:${data.receiverName}
|
||||
手机号码:${data.receiverPhone}
|
||||
所在地区:${data.receiverArea}
|
||||
详细地址:${data.receiverAddress}`;
|
||||
common_vendor.index.setClipboardData({
|
||||
data: aaa,
|
||||
success: function() {
|
||||
common_vendor.index.__f__("log", "at pages/address/list.vue:100", "success");
|
||||
}
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(back),
|
||||
b: common_vendor.p({
|
||||
title: "地址管理",
|
||||
safeAreaInsetTop: true,
|
||||
["left-arrow"]: true
|
||||
}),
|
||||
c: common_vendor.f(dataList.value, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.receiverName),
|
||||
b: common_vendor.t(item.receiverPhone),
|
||||
c: common_vendor.t(item.receiverArea),
|
||||
d: common_vendor.t(item.receiverAddress),
|
||||
e: common_vendor.o(($event) => deleAddress(item), index),
|
||||
f: common_vendor.o(($event) => tn(`./add?id=${item.id}`), index),
|
||||
g: common_vendor.o(($event) => copyAddress(item), index),
|
||||
h: common_vendor.o(($event) => back_A(item), index),
|
||||
i: index
|
||||
};
|
||||
}),
|
||||
d: common_vendor.sr(paging, "90a3874e-1", {
|
||||
"k": "paging"
|
||||
}),
|
||||
e: common_vendor.o(queryList),
|
||||
f: common_vendor.o(($event) => dataList.value = $event),
|
||||
g: common_vendor.p({
|
||||
["use-page-scroll"]: true,
|
||||
modelValue: dataList.value
|
||||
}),
|
||||
h: common_vendor.o(($event) => tn("./add"))
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-90a3874e"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/address/list.js.map
|
||||
8
unpackage/dist/dev/mp-weixin/pages/address/list.json
vendored
Normal file
8
unpackage/dist/dev/mp-weixin/pages/address/list.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"wd-navbar": "../../uni_modules/wot-design-uni/components/wd-navbar/wd-navbar",
|
||||
"z-paging": "../../uni_modules/z-paging/components/z-paging/z-paging"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/address/list.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/address/list.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="address data-v-90a3874e"><wd-navbar wx:if="{{b}}" class="data-v-90a3874e" bindclickLeft="{{a}}" u-i="90a3874e-0" bind:__l="__l" u-p="{{b}}"></wd-navbar><z-paging wx:if="{{g}}" class="r data-v-90a3874e" u-s="{{['d']}}" u-r="paging" bindquery="{{e}}" u-i="90a3874e-1" bind:__l="__l" bindupdateModelValue="{{f}}" u-p="{{g}}"><view class="data-v-90a3874e" style="padding:30rpx"><view wx:for="{{c}}" wx:for-item="item" wx:key="i" class="address-a data-v-90a3874e" bindtap="{{item.h}}"><view class="top data-v-90a3874e"><view class="top-a data-v-90a3874e"><view class="data-v-90a3874e">{{item.a}}</view><view class="data-v-90a3874e">{{item.b}}</view></view><view class="top-b data-v-90a3874e">{{item.c}} {{item.d}}</view></view><view class="bottom data-v-90a3874e"><view class="bottom-r data-v-90a3874e"><view class="data-v-90a3874e" catchtap="{{item.e}}">删除</view><view class="data-v-90a3874e" style="margin-left:50rpx" catchtap="{{item.f}}">编辑</view><view class="data-v-90a3874e" catchtap="{{item.g}}" style="margin:0 50rpx">复制</view></view></view></view></view></z-paging><view class="bottom-btn data-v-90a3874e"><view class="button-a data-v-90a3874e" bindtap="{{h}}">新增收货地址</view></view></view>
|
||||
76
unpackage/dist/dev/mp-weixin/pages/address/list.wxss
vendored
Normal file
76
unpackage/dist/dev/mp-weixin/pages/address/list.wxss
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
/* 水平间距 */
|
||||
/* 水平间距 */
|
||||
.address .address-a.data-v-90a3874e {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 2rpx 21rpx 0px rgba(184, 184, 184, 0.35);
|
||||
border-radius: 17rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.address .address-a .top.data-v-90a3874e {
|
||||
padding: 40rpx;
|
||||
border-bottom: 1rpx solid #f3f3f3;
|
||||
}
|
||||
.address .address-a .top .top-a.data-v-90a3874e {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #222222;
|
||||
margin-bottom: 45rpx;
|
||||
}
|
||||
.address .address-a .top .top-b.data-v-90a3874e {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
}
|
||||
.address .address-a .bottom.data-v-90a3874e {
|
||||
padding: 35rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.address .address-a .bottom .bottom-che.data-v-90a3874e {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
color: #222222;
|
||||
}
|
||||
.address .address-a .bottom .bottom-che image.data-v-90a3874e {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.address .address-a .bottom .bottom-r.data-v-90a3874e {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.address .bottom-btn.data-v-90a3874e {
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
padding: 30rpx;
|
||||
background-color: #ffffff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
box-shadow: 0px 6rpx 16rpx 2rpx rgba(170, 170, 170, 0.35);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.address .bottom-btn .button-a.data-v-90a3874e {
|
||||
width: 690rpx;
|
||||
height: 90rpx;
|
||||
background: #799675;
|
||||
border-radius: 15rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #ffffff;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user