Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
H5_2.0
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
329b0412
authored
May 19, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
7b1b12c6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
147 additions
and
51 deletions
assets/css/mine/userAddress.scss
main.js
pages.json
pages/mine/userAddress.vue
router/index.js
assets/css/mine/userAddress.scss
View file @
329b0412
...
...
@@ -94,4 +94,70 @@
}
}
}
.btn
{
position
:
fixed
;
bottom
:
0
;
left
:
0
;
right
:
0
;
width
:
100%
;
height
:
100rpx
;
z-index
:
9
;
background
:
#ffffff
;
box-shadow
:
0px
-4rpx
20rpx
0px
rgba
(
198
,
199
,
204
,
0
.1
);
border-radius
:
10rpx
10rpx
0px
0px
;
padding
:
0
24rpx
;
.btn1
{
width
:
100%
;
height
:
68rpx
;
background
:
#1969f9
;
border-radius
:
10rpx
;
.iconfont
{
font-size
:
44rpx
;
color
:
#ffffff
;
}
.text
{
margin-left
:
12rpx
;
font-size
:
28rpx
;
color
:
#ffffff
;
}
}
}
.form-box
{
border-radius
:
10rpx
;
background
:
#ffffff
;
padding
:
0
24rpx
;
.input-box
{
border-bottom
:
1px
solid
#d8d8d8
;
&
:last-child
{
border-bottom
:
none
;
}
.tt
{
width
:
155rpx
;
font-size
:
26rpx
;
color
:
#484b59
;
}
.uni-input
{
height
:
100%
;
font-size
:
26rpx
;
&
:
:-
webkit-input-placeholder
{
color
:
#919399
;
}
}
&
.input
{
height
:
88rpx
;
}
}
}
}
.no-data
{
image
{
width
:
356rpx
;
height
:
356rpx
;
}
.tt
{
margin-top
:
32rpx
;
font-size
:
28rpx
;
color
:
#292b33
;
}
}
main.js
View file @
329b0412
import
App
from
'./App'
import
{
request
,
setCookie
,
getCookie
}
from
'@/util/util.js'
import
{
request
,
setCookie
,
getCookie
}
from
'@/util/util.js'
import
filters
from
'@/filters'
import
router
from
'@/router/index.js'
import
{
RouterMount
}
from
'uni-simple-router'
...
...
@@ -13,12 +13,6 @@ Vue.prototype.request = request
App
.
mpType
=
'app'
//过滤器遍历
Object
.
keys
(
filters
).
forEach
(
key
=>
Vue
.
filter
(
key
,
filters
[
key
]));
...
...
@@ -27,58 +21,57 @@ Vue.use(directive);
//生成临时Yo4teW_gid和Yo4teW_csrf
let
time
1s
=
parseInt
(
new
Date
().
getTime
()
/
1000
);
let
gid_
=
w_md5
.
hex_md5_32
(
w_md5
.
hex_md5_32
(
String
(
time1s
)
+
Math
.
random
())
+
"usersign"
)
let
csrf_
=
w_md5
.
hex_md5_32
(
w_md5
.
hex_md5_32
(
String
(
time1s
)
+
Math
.
random
())
+
"csrf"
)
if
(
!
getCookie
(
"Yo4teW_gid"
))
{
setCookie
(
'Yo4teW_gid'
,
gid_
,
7
);
let
time
=
parseInt
(
new
Date
().
getTime
()
/
1000
);
let
gid_
=
w_md5
.
hex_md5_32
(
w_md5
.
hex_md5_32
(
String
(
time
)
+
Math
.
random
())
+
"usersign"
)
let
csrf_
=
w_md5
.
hex_md5_32
(
w_md5
.
hex_md5_32
(
String
(
time
)
+
Math
.
random
())
+
"csrf"
)
if
(
!
getCookie
(
"Yo4teW_gid"
))
{
setCookie
(
'Yo4teW_gid'
,
gid_
,
15
);
}
if
(
!
getCookie
(
"Yo4teW_csrf"
))
{
setCookie
(
'Yo4teW_csrf'
,
csrf_
,
7
);
if
(
!
getCookie
(
"Yo4teW_csrf"
))
{
setCookie
(
'Yo4teW_csrf'
,
csrf_
,
15
);
}
try
{
function
isPromise
(
obj
)
{
return
(
!!
obj
&&
(
typeof
obj
===
"object"
||
typeof
obj
===
"function"
)
&&
typeof
obj
.
then
===
"function"
);
}
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致
uni
.
addInterceptor
({
returnValue
(
res
)
{
if
(
!
isPromise
(
res
))
{
return
res
;
}
return
new
Promise
((
resolve
,
reject
)
=>
{
res
.
then
((
res
)
=>
{
if
(
res
[
0
])
{
reject
(
res
[
0
]);
}
else
{
resolve
(
res
[
1
]);
}
});
});
},
});
}
catch
(
error
)
{
}
function
isPromise
(
obj
)
{
return
(
!!
obj
&&
(
typeof
obj
===
"object"
||
typeof
obj
===
"function"
)
&&
typeof
obj
.
then
===
"function"
);
}
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致
uni
.
addInterceptor
({
returnValue
(
res
)
{
if
(
!
isPromise
(
res
))
{
return
res
;
}
return
new
Promise
((
resolve
,
reject
)
=>
{
res
.
then
((
res
)
=>
{
if
(
res
[
0
])
{
reject
(
res
[
0
]);
}
else
{
resolve
(
res
[
1
]);
}
});
});
},
});
}
catch
(
error
)
{}
const
app
=
new
Vue
({
...
App
...
App
})
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount
(
app
,
'#app'
);
RouterMount
(
app
,
'#app'
);
// #endif
// #ifndef H5
app
.
$mount
()
//为了兼容小程序及app端必须这样写才有效果
app
.
$mount
()
//为了兼容小程序及app端必须这样写才有效果
// #endif
// #endif
...
...
@@ -86,9 +79,9 @@ const app = new Vue({
// #ifdef VUE3
import
{
createSSRApp
}
from
'vue'
export
function
createApp
()
{
const
app
=
createSSRApp
(
App
)
return
{
app
}
const
app
=
createSSRApp
(
App
)
return
{
app
}
}
// #endif
\ No newline at end of file
pages.json
View file @
329b0412
...
...
@@ -76,6 +76,18 @@
"style"
:
{
"navigationBarTitleText"
:
"收货地址"
}
},
{
"path"
:
"pages/mine/userAddressAdd"
,
"style"
:
{
"navigationBarTitleText"
:
"新增地址"
}
},
{
"path"
:
"pages/mine/userAddressEdit"
,
"style"
:
{
"navigationBarTitleText"
:
"编辑地址"
}
}
],
"globalStyle"
:
{
...
...
pages/mine/userAddress.vue
View file @
329b0412
...
...
@@ -57,6 +57,16 @@
</view>
</view>
</view>
<view
class=
"no-data column rowCenter verCenter"
>
<image
src=
"../../static/nodate.png"
></image>
<text
class=
"tt"
>
暂无收货地址
</text>
</view>
<view
class=
"btn row verCenter"
>
<view
class=
"btn1 row rowCenter verCenter"
>
<text
class=
"iconfont icon-tj"
></text>
<text
class=
"text"
>
新增地址
</text>
</view>
</view>
</view>
</
template
>
...
...
router/index.js
View file @
329b0412
...
...
@@ -5,9 +5,9 @@ import Router from 'uni-simple-router'
Vue
.
use
(
Router
)
//初始化
const
router
=
new
Router
({
h5
:
{
loading
:
false
,
},
h5
:
{
loading
:
false
,
},
APP
:
{
animation
:
{
animationType
:
'pop-in'
,
...
...
@@ -105,6 +105,20 @@ const router = new Router({
meta
:
{
title
:
'收货地址'
}
},
{
path
:
'/pages/mine/userAddressAdd'
,
aliasPath
:
'/userAddressAdd'
,
meta
:
{
title
:
'新增地址'
}
},
{
path
:
'/pages/mine/userAddressEdit'
,
aliasPath
:
'/userAddressEdit'
,
meta
:
{
title
:
'编辑地址'
}
}
]
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment