This commit is contained in:
2024-08-22 12:53:28 +08:00
commit 1d65a849fd
360 changed files with 41757 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
var e = getApp();
Page({
data: {
disabled: !1,
nav_select: !1,
name: "",
region: "",
phone: "",
detail: "",
error: ""
},
onLoad: function(e) {},
saveData: function(a) {
var t = this, n = a.detail.value;
if (n.region = t.data.region, !t.validation(n)) return e.showError(t.data.error),
!1;
t.setData({
disabled: !0
}), e._post_form("address/add", n, function(a) {
e.showSuccess(a.msg, function() {
wx.navigateBack();
});
}, !1, function() {
t.setData({
disabled: !1
});
});
},
validation: function(e) {
if ("" === e.name) return this.data.error = "收件人不能为空", !1;
if (e.phone.length < 1) return this.data.error = "手机号不能为空", !1;
return /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/.test(e.phone) ? this.data.region ? "" !== e.detail || (this.data.error = "详细地址不能为空",
!1) : (this.data.error = "省市区不能空", !1) : (this.data.error = "手机号不符合要求", !1);
},
bindRegionChange: function(e) {
this.setData({
region: e.detail.value
});
},
webvue1: function() {
console.log(111), wx.navigateTo({
url: "webvue?id=1"
});
},
webvue2: function() {
console.log(111), wx.navigateTo({
url: "webvue?id=2"
});
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "新增收货地址",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,52 @@
<view class="container">
<view class="common-header-xian"></view>
<form bindsubmit="saveData">
<view class="address-cont-title b-f b-b">
<view class="list address-box dis-flex b-b">
<view class="left-name">
<text class="f-30">收货人</text>
</view>
<view class="right-cont flex-box">
<input name="name" placeholder="请输入收货人姓名" value="{{name}}"></input>
</view>
</view>
<view class="list address-box dis-flex">
<view class="left-name">
<text class="f-30">手机号</text>
</view>
<view class="right-cont flex-box">
<input name="phone" placeholder="请输入收货人联系电话" type="number" value="{{phone}}"></input>
</view>
</view>
</view>
<view class="address-cont-title b-f b-b">
<view class="dis-flex list address-box m-top20 b-b">
<view class="left-name">
<text class="f-30">所在地区</text>
</view>
<view class="address-cont-box flex-box">
<picker bindchange="bindRegionChange" mode="region">
<text class="f-30" wx:if="{{region}}">{{region}}</text>
<text class="f-30 col-7" wx:else>选择省、市、区</text>
</picker>
</view>
</view>
<view class="dis-flex list address-box">
<view class="left-name">
<text class="f-30">详细地址</text>
</view>
<view class="right-cont flex-box">
<input name="detail" placeholder="请输入街道小区楼层" type="text" value="{{detail}}"></input>
</view>
</view>
</view>
<view class="padding-box m-top20 profile-btn">
<button disabled="{{disabled}}" formType="submit">保存</button>
</view>
</form>
<view>
<view bindtap="webvue1" style="color: blue;"> 《用户服务协议》 </view>
<view bindtap="webvue2" style="color: blue;"> 《隐私政策》 </view>
</view>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,172 @@
.profile-list .admin {
color: #333;
font-size: 30rpx;
padding-left: 15px;
}
.address-box .left-name {
width: 85px;
}
.address-cont-title .list {
padding: 24rpx;
width: auto;
}
.tui-picker-detail text {
padding: 0 10rpx;
}
.infoText {
display: block;
line-height: 56rpx;
}
picker-view {
background-color: #fff;
bottom: 0;
height: 480rpx;
padding: 0;
position: fixed;
width: 100%;
}
picker-view-column view {
align-items: center;
display: flex;
font-size: 28rpx;
height: 100%;
justify-content: center;
line-height: 28rpx;
vertical-align: middle;
}
.animation-element-wrapper {
height: 100%;
left: 0;
top: 0;
z-index: 21;
}
.animation-element,.animation-element-wrapper {
display: flex;
position: fixed;
width: 100%;
}
.animation-element {
background-color: #fff;
bottom: 0;
height: 570rpx;
}
.animation-button {
align-items: center;
height: 100rpx;
line-height: 100rpx;
margin-top: 20rpx;
top: 20rpx;
width: 400rpx;
}
.address-text {
color: #999;
display: inline-flex;
font-family: Arial,Helvetica,sans-serif;
font-size: 30rpx;
height: 50rpx;
line-height: 50rpx;
margin-top: 20rpx;
position: fixed;
text-align: center;
}
.left-bt {
left: 30rpx;
}
.right-bt {
color: #ec5151;
right: 30rpx;
}
.line {
background-color: #eee;
display: block;
height: 1rpx;
margin-top: 89rpx;
position: fixed;
width: 100%;
}
.address-box .right-cont input {
color: #444;
font-size: 30rpx;
width: 100%;
}
.bargain-commont-bg {
background: rgba(0,0,0,.6);
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 20;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.m-top35 {
margin-top: 35rpx;
}

View File

@@ -0,0 +1,49 @@
var a = getApp();
Page({
data: {
disabled: !1,
nav_select: !1,
region: "",
detail: {},
error: ""
},
onLoad: function(a) {
this.getAddressDetail(a.address_id);
},
getAddressDetail: function(t) {
var e = this;
a._get("address/detail", {
address_id: t
}, function(a) {
e.setData(a.data);
});
},
saveData: function(t) {
var e = this, d = t.detail.value;
if (d.region = e.data.region, !e.validation(d)) return a.showError(e.data.error),
!1;
e.setData({
disabled: !0
}), d.address_id = e.data.detail.address_id, a._post_form("address/edit", d, function(t) {
a.showSuccess(t.msg, function() {
wx.navigateBack();
});
}, !1, function() {
e.setData({
disabled: !1
});
});
},
validation: function(a) {
if ("" === a.name) return this.data.error = "收件人不能为空", !1;
if (a.phone.length < 1) return this.data.error = "手机号不能为空", !1;
return /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/.test(a.phone) ? this.data.region ? "" !== a.detail || (this.data.error = "详细地址不能为空",
!1) : (this.data.error = "省市区不能空", !1) : (this.data.error = "手机号不符合要求", !1);
},
bindRegionChange: function(a) {
this.setData({
region: a.detail.value
});
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "编辑收货地址",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,48 @@
<view class="container">
<view class="common-header-xian"></view>
<form bindsubmit="saveData">
<view class="address-cont-title b-f b-b">
<view class="list address-box dis-flex b-b">
<view class="left-name">
<text class="f-30">收货人</text>
</view>
<view class="right-cont flex-box">
<input name="name" placeholder="请输入收货人姓名" value="{{detail.name}}"></input>
</view>
</view>
<view class="list address-box dis-flex">
<view class="left-name">
<text class="f-30">手机号</text>
</view>
<view class="right-cont flex-box">
<input name="phone" placeholder="请输入收货人联系电话" type="number" value="{{detail.phone}}"></input>
</view>
</view>
</view>
<view class="address-cont-title b-f b-b">
<view class="dis-flex list address-box m-top20 b-b">
<view class="left-name">
<text class="f-30">所在地区</text>
</view>
<view class="address-cont-box flex-box">
<picker bindchange="bindRegionChange" mode="region" value="{{region}}">
<text class="f-30" wx:if="{{region.length}}">{{region}}</text>
<text class="f-30 col-7" wx:else>选择省、市、区</text>
</picker>
</view>
</view>
<view class="dis-flex list address-box">
<view class="left-name">
<text class="f-30">详细地址</text>
</view>
<view class="right-cont flex-box">
<input name="detail" placeholder="请输入街道小区楼层" type="text" value="{{detail.detail}}"></input>
</view>
</view>
</view>
<view class="padding-box m-top20 profile-btn">
<button disabled="{{disabled}}" formType="submit">保存</button>
</view>
</form>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,172 @@
.profile-list .admin {
color: #333;
font-size: 30rpx;
padding-left: 15px;
}
.address-box .left-name {
width: 85px;
}
.address-cont-title .list {
padding: 24rpx;
width: auto;
}
.tui-picker-detail text {
padding: 0 10rpx;
}
.infoText {
display: block;
line-height: 56rpx;
}
picker-view {
background-color: #fff;
bottom: 0;
height: 480rpx;
padding: 0;
position: fixed;
width: 100%;
}
picker-view-column view {
align-items: center;
display: flex;
font-size: 28rpx;
height: 100%;
justify-content: center;
line-height: 28rpx;
vertical-align: middle;
}
.animation-element-wrapper {
height: 100%;
left: 0;
top: 0;
z-index: 21;
}
.animation-element,.animation-element-wrapper {
display: flex;
position: fixed;
width: 100%;
}
.animation-element {
background-color: #fff;
bottom: 0;
height: 570rpx;
}
.animation-button {
align-items: center;
height: 100rpx;
line-height: 100rpx;
margin-top: 20rpx;
top: 20rpx;
width: 400rpx;
}
.address-text {
color: #999;
display: inline-flex;
font-family: Arial,Helvetica,sans-serif;
font-size: 30rpx;
height: 50rpx;
line-height: 50rpx;
margin-top: 20rpx;
position: fixed;
text-align: center;
}
.left-bt {
left: 30rpx;
}
.right-bt {
color: #ec5151;
right: 30rpx;
}
.line {
background-color: #eee;
display: block;
height: 1rpx;
margin-top: 89rpx;
position: fixed;
width: 100%;
}
.address-box .right-cont input {
color: #444;
font-size: 30rpx;
width: 100%;
}
.bargain-commont-bg {
background: rgba(0,0,0,.6);
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 20;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.m-top35 {
margin-top: 35rpx;
}

View File

@@ -0,0 +1,54 @@
var t = getApp();
Page({
data: {
list: [],
default_id: null
},
onLoad: function(t) {
this.data.options = t;
},
onShow: function() {
this.getAddressList();
},
getAddressList: function() {
var e = this;
t._get("address/lists", {}, function(t) {
e.setData(t.data);
});
},
createAddress: function() {
wx.navigateTo({
url: "./create"
});
},
editAddress: function(t) {
wx.navigateTo({
url: "./detail?address_id=" + t.currentTarget.dataset.id
});
},
removeAddress: function(e) {
var s = this, a = e.currentTarget.dataset.id;
wx.showModal({
title: "提示",
content: "您确定要移除当前收货地址吗?",
success: function(e) {
e.confirm && t._post_form("address/delete", {
address_id: a
}, function(t) {
s.getAddressList();
});
}
});
},
setDefault: function(e) {
var s = this, a = e.detail.value;
return s.setData({
default_id: parseInt(a)
}), t._post_form("address/setDefault", {
address_id: a
}, function(t) {
"flow" === s.data.options.from && wx.navigateBack();
}), !1;
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "收货地址",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,45 @@
<view class="container m-b6 p-bottom">
<view class="common-header-xian"></view>
<custom-ul class="addres-list" wx:if="{{list.length}}">
<custom-li wx:for="{{list}}" wx:key="this">
<view class="address-header b-f m-top18">
<view class="flow-header-left pl-12">
<view class="flow-checkout-admin">{{item.name}} <text>{{item.phone}}</text>
</view>
<view class="flow-checkout-address"> {{item.region.province}} {{item.region.city}} {{item.region.region}} {{item.detail}} </view>
</view>
</view>
<view class="address-list dis-flex b-f">
<view class="list address-left">
<radio-group bindchange="setDefault" class="radio-group">
<label class="radio">
<radio checked="{{item.address_id==default_id}}" color="#ff495e" value="{{item.address_id}}"></radio>
<text class="cont" wx:if="{{item.address_id==default_id}}">默认</text>
<text class="cont" wx:else>选择</text>
</label>
</radio-group>
</view>
<view class="list address-right dis-flex">
<view bindtap="editAddress" data-id="{{item.address_id}}">
<text class="iconfont icon-edit"></text>
<text class="title">编辑</text>
</view>
<view bindtap="removeAddress" data-id="{{item.address_id}}">
<text class="iconfont icon-lajixiang"></text>
<text class="title">删除</text>
</view>
</view>
</view>
</custom-li>
</custom-ul>
<view wx:else>
<view class="yoshop-notcont">
<text class="iconfont icon-ziyuan"></text>
<text class="cont">亲,您还没有收货列表</text>
</view>
</view>
<view class="footer-fixed f-32">
<view bindtap="createAddress" class="order-bt" style="width:100%">添加新地址</view>
</view>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,100 @@
.address-list {
border-bottom: 1px solid #f6f6f9;
}
.address-list .list {
padding: 15rpx;
}
.address-list .list .title {
color: #666;
font-size: 30rpx;
padding: 0 24rpx 0 6rpx;
}
.address-list .list .cont {
color: #333;
font-size: 30rpx;
}
.address-list .list navigator {
display: inline-block;
}
.address-list .list image {
height: 28rpx;
width: 28rpx;
}
.address-left {
flex: 6;
}
.address-right {
flex: 3.2;
}
.address-right .iconfont {
color: #777;
font-size: 30rpx;
}
.flow-fixed-footer {
background: #f42424;
bottom: 0;
position: fixed;
width: 100%;
z-index: 4999;
}
.flow-fixed-footer .chackout-left {
color: #777;
font-size: 32rpx;
line-height: 44px;
}
.flow-fixed-footer .chackout-right {
font-size: 34rpx;
}
.address-header {
background-size: 120rpx auto;
border-bottom: 1px solid #f6f6f9;
font-size: 1.7rem;
padding: 28rpx 0;
}
.flow-header-left {
flex: 14;
padding: 0rpx 20rpx;
}
.flow-header-right {
flex: 1;
}
.flow-header-right image {
float: right;
height: 34rpx;
margin-top: 20rpx;
width: 34rpx;
}
.address-header .flow-checkout-admin {
color: #444;
font-size: 34rpx;
}
.address-header .flow-checkout-admin text {
padding: 0 10rpx;
}
.address-header .flow-checkout-address {
color: #777;
font-size: 26rpx;
margin-top: 6rpx;
}
.radio-group raido {
color: #f42424;
}

View File

@@ -0,0 +1,14 @@
Page({
data: {
url2: "https://ltwxminiapp.19year.cn/2.html",
url1: "https://ltwxminiapp.19year.cn/1.html",
url: ""
},
onLoad: function(t) {
console.log("id", t.id), "1" == t.id ? (console.log(1), this.setData({
url: "https://ltwxminiapp.19year.cn/1.html?dat=" + Date.now()
})) : (console.log(2), this.setData({
url: "https://ltwxminiapp.19year.cn/2.html?dat=" + Date.now()
})), console.log(this.url);
}
});

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "说明",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<web-view src="{{url}}"></web-view>