Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
singleStore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Max
singleStore
Commits
9d80fcc6
Commit
9d80fcc6
authored
Jun 27, 2021
by
June
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:登录,首页,分类
parent
e603d9c2
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
366 additions
and
200 deletions
+366
-200
App.vue
App.vue
+2
-2
apis/category.js
apis/category.js
+10
-0
components/inputNumber/index.vue
components/inputNumber/index.vue
+1
-1
mixins/goods_popup.js
mixins/goods_popup.js
+0
-25
pages/category/index.vue
pages/category/index.vue
+95
-27
pages/goods/components/back-btn.vue
pages/goods/components/back-btn.vue
+7
-4
pages/home/components/goods-module.vue
pages/home/components/goods-module.vue
+8
-8
pages/home/index.js
pages/home/index.js
+15
-1
pages/home/index.vue
pages/home/index.vue
+66
-27
pages/login/index.vue
pages/login/index.vue
+31
-57
pages/mine/index.vue
pages/mine/index.vue
+1
-1
readme.md
readme.md
+7
-3
static/images/common/icon-back.png
static/images/common/icon-back.png
+0
-0
store/modules/user.js
store/modules/user.js
+10
-10
styles/mixins.scss
styles/mixins.scss
+10
-0
subPages/resetPwd/common.js
subPages/resetPwd/common.js
+1
-1
subPages/resetPwd/index.vue
subPages/resetPwd/index.vue
+102
-33
No files found.
App.vue
View file @
9d80fcc6
...
...
@@ -6,11 +6,11 @@ import { login_wx } from '@/utils/modules/login.js'
export
default
{
onLaunch
:
function
()
{
this
.
setSystemInfo
()
// 获取系统信息
this
.
setLocation
()
// 获取经纬度
this
.
setMenuButtonInfo
()
// 获取胶囊信息
this
.
checkUpdate
()
// 检查更新
const
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
():
{}
console
.
log
(
extConfig
)
this
.
$store
.
state
.
user
.
appid
=
extConfig
.
appid
const
token
=
this
.
$getStorage
(
'
token
'
)
this
.
$store
.
state
.
user
.
token
=
token
...
...
@@ -29,7 +29,7 @@ export default {
methods
:
{
...
mapActions
(
'
systemInfo
'
,
[
'
setSystemInfo
'
,
'
setMenuButtonInfo
'
]),
...
mapActions
(
'
user
'
,
[
'
set
Location
'
,
'
set
Token
'
,
'
setLoginStatus
'
,
'
getStoreInfo
'
]),
...
mapActions
(
'
user
'
,
[
'
setToken
'
,
'
setLoginStatus
'
,
'
getStoreInfo
'
]),
...
mapActions
(
'
cart
'
,
[
'
setCount
'
]),
// 检查更新
...
...
apis/category.js
View file @
9d80fcc6
...
...
@@ -26,3 +26,13 @@ export function cateGoodsList(cat_id, keywords = '') {
}
})
}
/**
* @desc 首页展示栏商品接口
*/
export
function
homeCategory
()
{
return
request
({
url
:
'
zsxcx/indexGoodsXcx.htm
'
,
method
:
'
post
'
})
}
\ No newline at end of file
components/inputNumber/index.vue
View file @
9d80fcc6
...
...
@@ -31,7 +31,7 @@ export default {
calVal
(
newVal
)
{
this
.
$emit
(
'
change
'
,
{
index
:
this
.
index
,
val
:
Number
(
newVal
)
val
:
~~
newVal
})
}
},
...
...
mixins/goods_popup.js
deleted
100644 → 0
View file @
e603d9c2
/**
* unipopup 的ref必须为goods_popup
*/
export
default
{
data
()
{
return
{
// 弹窗商品的信息
popGoodInfo
:
{
1
:
11
}
}
},
mounted
()
{
console
.
log
(
this
.
module1
)
},
methods
:
{
// 打开弹出
openPopup
()
{
this
.
$refs
.
goods_popup
.
open
()
},
closePopup
()
{
this
.
$refs
.
goods_popup
.
close
()
this
.
popGoodInfo
=
{}
// 清空弹窗商品的信息
}
}
}
\ No newline at end of file
pages/category/index.vue
View file @
9d80fcc6
<
template
>
<view
class=
"category-wrap w-100"
>
<!-- search bar -->
<view
class=
"searchBar-wrap w-100"
>
搜索框
</view>
<view
class=
"searchBar-wrap flex j-center a-center w-100"
>
<view
class=
"search flex j-center a-center"
>
<image
class=
"search-icon mr-1"
src=
"/static/images/common/icon-search.png"
mode=
"aspectFit"
/>
<text
class=
"font-24"
>
搜索商品
</text>
</view>
</view>
<!-- category 未优化,可以递归组件 -->
<view
class=
"category flex j-between w-100 font-24"
>
...
...
@@ -11,30 +16,32 @@
:scroll-into-view=
"leftScrollName"
>
<view
class=
"
flex j-center flex-column a-center p
-2"
class=
"
w-100 px-3 py
-2"
v-for=
"(cate_1, cate_idx_1) in cate_list"
:key=
"cate_1.cat_id"
:class=
"cate1_current === cate_1.cat_id ? 'cate-active' : null"
>
<view>
<view
class=
"mb-2"
@
click.stop=
"cateChange(1, cate_1.cat_id)"
:class=
"cate1_current === cate_1.cat_id ? 'cate-
active' : null"
:class=
"cate1_current === cate_1.cat_id ? 'cate-1_
active' : null"
>
{{
cate_1
.
cat_name
}}
</view>
<view
v-show=
"cate1_current === cate_1.cat_id && cate_1.list.length > 0"
>
<view
class=
"ml
-2"
class=
"ml-2 mb
-2"
v-for=
"(cate_2, cate_idx_2) in cate_1.list"
:key=
"cate_2.cat_id"
>
<view
:class=
"cate2_current === cate_2.cat_id ? 'cate-
active' : null"
:class=
"cate2_current === cate_2.cat_id ? 'cate-2_
active' : null"
@
click.stop=
"cateChange(2, cate_2.cat_id)"
>
{{
cate_2
.
cat_name
}}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
...
...
@@ -46,20 +53,27 @@
@
tolower=
'tolower'
>
<view
class=
"goods-item flex j-start a-center"
v-for=
"good in goods_list"
:key=
"good.goods_id"
@
click=
"navDetail(good)"
>
<image
style=
"width: 300rpx;height: 300rpx;
"
class=
"goods-cover mr-2
"
lazy-load
:src=
"baseUrl + '/' + good.goods_thumb"
mode=
"aspectFit"
/>
<view>
{{
good
.
goods_name
}}
</view>
<view
class=
"goods-price flex-1 flex flex-column j-between font-28"
>
<view
class=
"title"
>
{{
good
.
goods_name
}}
</view>
<view
class=
"w-100 flex j-between a-center"
>
<text
class=
"price-txt"
>
¥152.50
</text>
<image
class=
"cart-icon"
src=
"/static/images/common/icon-cart.png"
mode=
"aspectFit"
></image>
</view>
</view>
</view>
<view>
到底了,看看别的分类吧~
</view>
<view
class=
"empty-text text-center mt-4 p-2"
>
到底了,看看别的分类吧~
</view>
</pull-list>
</view>
</view>
...
...
@@ -116,6 +130,7 @@ export default {
cateChange
(
type
,
cate_id
)
{
if
(
type
===
1
)
{
this
.
cate1_current
=
cate_id
this
.
cate2_current
=
null
}
else
if
(
type
===
2
)
{
this
.
cate2_current
=
cate_id
}
...
...
@@ -157,18 +172,71 @@ export default {
<
style
lang=
"scss"
scoped
>
.category-wrap
{
border-top
:
1rpx
solid
$line
;
.searchBar-wrap
{
height
:
10vh
;
background-color
:
red
;
height
:
112rpx
;
background-color
:
#fff
;
.search
{
width
:
690rpx
;
height
:
72rpx
;
border-radius
:
4rpx
;
background-color
:
$mainBg
;
.search-icon
{
width
:
32rpx
;
height
:
32rpx
;
}
}
}
.category
{
height
:
90vh
;
height
:
calc
(
100vh
-
112rpx
);
background-color
:
$mainBg
;
overflow
:
hidden
;
.scroll-left
{
flex
:
0
0
240rpx
;
flex
:
0
0
180rpx
;
overflow
:
hidden
;
.cate-1_active
{
color
:
$primary
;
font-weight
:
bold
;
}
.cate-2_active
{
color
:
$primary
;
}
.cate-active
{
color
:
red
;
background-color
:
#fff
;
}
}
.scroll-right
{
background-color
:
#fff
;
.empty-text
{
font-size
:
20rpx
;
color
:
$desc
;
}
.goods-item
{
@include
borderBox
(
20rpx
,
20rpx
);
border-bottom
:
1rpx
solid
$line
;
.goods-cover
{
flex
:
0
0
160rpx
;
width
:
160rpx
;
height
:
160rpx
;
}
.goods-price
{
height
:
160rpx
;
.title
{
@include
text-ellipsis
(
2
);
color
:
#343434
;
font-weight
:
500
;
}
.price-txt
{
color
:
$primary
;
}
.cart-icon
{
width
:
34rpx
;
height
:
32rpx
;
}
}
}
}
}
...
...
pages/goods/components/back-btn.vue
View file @
9d80fcc6
<
template
>
<view
class=
"back-wrap flex j-center a-center"
:style=
"menuSty"
@
click=
"handleBack"
>
返回
<view
class=
"back-wrap flex j-start a-center"
:style=
"menuSty"
@
click=
"handleBack"
>
<!--
<image
class=
"icon"
src=
"/static/images/common/icon-back.png"
mode=
"aspectFit"
></image>
-->
<icon
class=
"icon ml-1"
></icon>
</view>
</
template
>
...
...
@@ -29,11 +30,13 @@ export default {
}
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
scoped
>
.back-wrap
{
position
:
fixed
;
z-index
:
999
;
border-radius
:
50%
;
background-color
:
red
;
.icon
{
@include
backBtn
(
18rpx
,
34rpx
)
}
}
</
style
>
pages/home/components/goods-module.vue
View file @
9d80fcc6
...
...
@@ -10,18 +10,16 @@
>
<image
class=
"goods_cover w-100"
:src=
"
arr[item]
"
:src=
"
baseUrl + '/' + item.goods_thumb
"
mode=
"aspectFit"
/>
<view
class=
"goods-info flex flex-column j-between"
>
<view
class=
"title font-28 my-1"
>
标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题
</view>
<view
class=
"title font-28 my-1"
>
{{
item
.
goods_name
}}
</view>
<view
class=
"flex j-between a-center mt-1 mb-2"
>
<view
class=
"price font-28"
>
价格
</view>
<view
class=
"price font-28"
>
{{
item
.
shop_price
}}
</view>
<image
class=
"cart-btn"
src=
"
../../..
/static/images/common/icon-cart.png"
src=
"/static/images/common/icon-cart.png"
mode=
"aspectFit"
/>
</view>
...
...
@@ -32,7 +30,7 @@
</
template
>
<
script
>
import
{
baseUrl
}
from
'
@/config/index.js
'
export
default
{
props
:
{
title
:
{
...
...
@@ -44,11 +42,13 @@ export default {
default
:
()
=>
[]
}
},
data
()
{
return
{
arr
:
[
'
https://www.gelifood.com/upload/wxxcx_img/images/icon/dalian.png
'
,
'
https://www.gelifood.com/upload/wxxcx_img/images/icon/bijie.png
'
]
baseUrl
}
},
methods
:
{
nav
()
{
uni
.
navigateTo
({
...
...
pages/home/index.js
View file @
9d80fcc6
import
{
searchGoods
}
from
'
@/apis/goods.js
'
import
{
homeCategory
}
from
'
@/apis/category.js
'
const
searchParams
=
{
sort
:
1
,
// 1综合优先 2销量优先 3价格升序 4价格降序
...
...
@@ -21,6 +22,19 @@ async function searchData () {
}
}
async
function
getHomeCate
()
{
try
{
const
{
status
,
data
}
=
await
homeCategory
()
if
(
status
)
{
this
.
cate_data
=
data
}
}
catch
(
e
){
console
.
log
(
e
)
//TODO handle the exception
}
}
export
default
{
searchData
searchData
,
getHomeCate
}
\ No newline at end of file
pages/home/index.vue
View file @
9d80fcc6
...
...
@@ -2,14 +2,18 @@
<view>
<!-- 店铺信息 -->
<view
class=
"storeInfo-wrap w-100 flex j-start a-center"
>
<view
class=
"logo"
>
<image
class=
"logo mr-2"
v-if=
"storeInfo.shop_img"
class=
"img"
:src=
"baseUrl + '/' + storeInfo.shop_img"
mode=
"aspectFit"
/>
<view
class=
"introduct flex-1"
>
<view
class=
"shop-name mb-2"
>
{{
storeInfo
.
shop_name
}}
</view>
<view
class=
"intro-deatil font-24"
>
简介:
{{
storeInfo
.
shop_intro
}}
</view>
</view>
<view
class=
"introduct flex-1 ml-2"
>
<view
class=
"shop-name mb-2"
>
{{
storeInfo
.
shop_name
||
''
}}
</view>
<view>
{{
appid
||
""
}}
</view>
<view
class=
"intro-deatil font-24"
>
简介:
{{
storeInfo
.
shop_intro
||
''
}}
</view>
</view>
</view>
...
...
@@ -83,14 +87,31 @@
/>
</block>
<block
v-else
>
<goods-module
title=
"新品推荐"
:list=
"module1"
@
purchase=
"purchase"
/>
<template
v-if=
"cate_data"
>
<goods-module
v-if=
"cate_data.xplist.length > 0"
title=
"新品推荐"
:list=
"cate_data.xplist"
@
purchase=
"purchase"
/>
<goods-module
title=
"新品推荐"
:list=
"module1"
@
purchase=
"purchase"
/>
<goods-module
v-if=
"cate_data.cxlist.length > 0"
title=
"促销商品"
:list=
"cate_data.cxlist"
@
purchase=
"purchase"
/>
<goods-module
title=
"新品推荐"
:list=
"module1"
@
purchase=
"purchase"
/>
<goods-module
v-if=
"cate_data.bklist.length > 0"
title=
"爆款商品"
:list=
"cate_data.bklist"
@
purchase=
"purchase"
/>
</
template
>
<!-- 综合商品 -->
<template
v-
show
=
"searchList.length > 0"
>
<
template
v-
if
=
"searchList.length > 0"
>
<view
class=
"w-100"
>
<view
class=
"font-bold font-36 px-3 py-2"
>
综合商品
</view>
<view
class=
"list-wrap w-100 flex j-start a-center flex-wrap"
>
...
...
@@ -106,6 +127,7 @@
:url=
"'/pages/goods/detail?goods_id=' + good.goods_id"
>
<image
lazy-load
class=
"goods_cover w-100"
:src=
"baseUrl + '/' + good.goods_thumb"
mode=
"aspectFit"
...
...
@@ -145,7 +167,6 @@ import LoadMore from '@/utils/load-more.js'
import
{
checkLogin
}
from
'
@/utils/modules/login.js
'
import
indexModule
from
'
./index.js
'
import
{
baseUrl
}
from
'
@/config/index.js
'
import
goods_popup
from
'
@/mixins/goods_popup.js
'
import
{
mapState
,
mapActions
}
from
'
vuex
'
export
default
{
...
...
@@ -154,12 +175,11 @@ export default {
baseUrl
,
module1
:
[
2
,
1
,
1
],
select_goods
:
null
,
cate_data
:
null
,
searchList
:
[]
}
},
mixins
:
[
goods_popup
],
components
:
{
searchBar
,
goodsModule
,
...
...
@@ -170,21 +190,25 @@ export default {
...
mapState
({
isOverdue
:
state
=>
state
.
user
.
isOverdue
,
token
:
state
=>
state
.
user
.
token
,
storeInfo
:
state
=>
state
.
user
.
storeInfo
storeInfo
:
state
=>
state
.
user
.
storeInfo
,
appid
:
state
=>
state
.
user
.
appid
})
},
created
()
{
// 实例化分页方法
this
.
loadmore
=
new
LoadMore
()
// 获取店铺信息
uni
.
setNavigationBarTitle
({
title
:
'
测试店铺
'
})
this
.
getHomeCate
()
},
mounted
()
{
console
.
log
(
this
.
popGoodInfo
)
const
storeInfo
=
this
.
storeInfo
if
(
storeInfo
.
shop_name
)
{
// 获取店铺信息
uni
.
setNavigationBarTitle
({
title
:
storeInfo
.
shop_name
})
}
},
// 下拉刷新
...
...
@@ -225,9 +249,19 @@ export default {
checkLogin
(()
=>
{
switch
(
type
)
{
case
'
contact
'
:
const
storeInfo
=
this
.
storeInfo
if
(
storeInfo
&&
storeInfo
.
shop_tel
)
{
uni
.
showModal
({
content
:
''
content
:
`是否拨打
${
storeInfo
.
shop_tel
}
`
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
uni
.
makePhoneCall
({
phoneNumber
:
storeInfo
.
shop_tel
})
}
}
})
}
break
;
case
'
collect
'
:
uni
.
navigateTo
({
...
...
@@ -257,6 +291,11 @@ export default {
width
:
140rpx
;
height
:
140rpx
;
border-radius
:
8rpx
;
overflow
:
hidden
;
.img
{
width
:
100%
;
height
:
100%
;
}
}
.introduct
{
height
:
140rpx
;
...
...
pages/login/index.vue
View file @
9d80fcc6
<
template
>
<view
class=
"wrap
per
"
>
<view
class=
"wrap"
>
<view
class=
"title font-36 font-bold ml-4"
>
欢迎来到
{{
storeInfo
.
shop_name
||
'
格利专属小程序
'
}}
</view>
...
...
@@ -21,7 +21,7 @@
v-model=
"form.yzm"
/>
<view
class=
"sms-btn font-28
py-2
"
class=
"sms-btn font-28"
@
click=
"handleSms"
:class=
"smsDisabled ? 'disabledSmsBtn' : null"
>
{{
smsMsg
}}
</view>
...
...
@@ -40,8 +40,16 @@
<view
class=
"forget font-24 py-1"
@
click=
"handleForget"
>
忘记密码
</view>
</view>
<view
class=
"login-btn login-btn_active"
>
短信验证码注册/登录
</view>
<view
class=
"login-btn"
>
密码登录
</view>
<view
class=
"login-btn"
:class=
"form.lgtype === 2 ? 'login-btn_active' : null"
@
click=
"handleLogin(2)"
>
短信验证码注册/登录
</view>
<view
class=
"login-btn"
:class=
"form.lgtype === 3 ? 'login-btn_active' : null"
@
click=
"handleLogin(3)"
>
密码登录
</view>
</view>
...
...
@@ -51,6 +59,7 @@
<image
class=
"wx-login_icon mb-4"
src=
"/static/images/common/icon_wx.png"
mode=
"aspectFit"
/>
</label>
<view
class=
"agreement flex j-start a-center"
>
<view
class=
"p-1"
@
click=
"handleAgree"
>
{{
agree
?
'
同意
'
:
'
no
'
}}
</view>
<text
class=
"mr-1"
>
同意
</text>
<navigator
class=
"agr_text"
...
...
@@ -66,39 +75,6 @@
open-type=
"getPhoneNumber"
@
getphonenumber=
"getPhoneNumber"
></button>
<!--
<view>
<input
:type=
"form.lgtype === 3 ? 'text' : 'number'"
:placeholder=
"userPlachelder"
v-model=
"form.user"
/>
</view>
<view
v-show=
"form.lgtype === 2"
>
<input
type=
"text"
placeholder=
"请输入验证码"
v-model=
"form.yzm"
/>
<button
@
click=
"handleSms"
>
{{
smsMsg
}}
</button>
</view>
<view
v-show=
"form.lgtype === 3"
>
<input
type=
"password"
placeholder=
"请输入密码"
v-model=
"form.pwd"
/>
</view>
<view>
<button
:class=
"form.lgtype === 2 ? 'btn_active' : null"
type=
"default"
@
click=
"handleLogin(2)"
>
短信验证码注册登录
</button>
<button
:class=
"form.lgtype === 1 ? 'btn_active' : null"
open-type=
"getPhoneNumber"
@
click=
"handleLogin(1)"
@
getphonenumber=
"getPhoneNumber"
>
微信快捷登录
</button>
<button
:class=
"form.lgtype === 3 ? 'btn_active' : null"
type=
"default"
@
click=
"handleLogin(3)"
>
密码登录
</button>
</view>
<button
type=
"default"
>
忘记密码
</button>
-->
</view>
</
template
>
...
...
@@ -112,12 +88,13 @@ import { mapState, mapActions } from 'vuex'
const
userPlachelderStr
=
{
1
:
''
,
2
:
'
请输入手机号码
'
,
3
:
'
请输入用户名
'
3
:
'
请输入用户名
或手机号码
'
}
export
default
{
data
()
{
return
{
smsDisabled
:
false
,
// sms按钮是否禁用
agree
:
false
,
// 同意平台协议
smsMsg
:
'
获取验证码
'
,
form
:
{
lgtype
:
2
,
// 1微信登录 2短信验证码登录 3账号密码登录
...
...
@@ -142,7 +119,8 @@ export default {
...
mapActions
(
'
user
'
,
[
'
login
'
]),
async
handleLogin
(
type
)
{
if
(
type
!==
this
.
form
.
lgtype
)
return
this
.
$set
(
this
.
form
,
'
lgtype
'
,
type
)
if
(
type
!==
this
.
form
.
lgtype
)
this
.
$set
(
this
.
form
,
'
lgtype
'
,
type
)
if
(
!
this
.
agree
)
return
this
.
$toast
({
title
:
'
请先同意平台协议
'
})
switch
(
type
)
{
case
2
:
const
smsValidaErr
=
this
.
smsValidate
()
...
...
@@ -161,6 +139,7 @@ export default {
getPhoneNumber
(
e
)
{
if
(
!
this
.
agree
)
return
this
.
$toast
({
title
:
'
请先同意平台协议
'
})
if
(
e
.
detail
.
errMsg
===
'
getPhoneNumber:fail user deny
'
)
return
const
{
iv
,
encryptedData
}
=
e
.
detail
this
.
loginCommon
({
...
...
@@ -198,15 +177,22 @@ export default {
uni
.
navigateTo
({
url
:
`/subPages/resetPwd/index`
})
},
// 是否同意平台协议
handleAgree
()
{
this
.
agree
=
!
this
.
agree
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.wrap
per
{
.wrap
{
background-color
:
#fff
;
border-top
:
1rpx
solid
$line
;
height
:
100vh
;
overflow
:
hidden
;
.title
{
padding-top
:
80rpx
;
margin-bottom
:
190rpx
;
...
...
@@ -220,11 +206,12 @@ export default {
border-bottom
:
1rpx
solid
$line
;
.sms-btn
{
position
:
absolute
;
right
:
0
;
right
:
20rpx
;
top
:
50%
;
height
:
88rpx
;
line-height
:
88rpx
;
z-index
:
20
;
transform
:
translateY
(
-50%
);
background-color
:
#fff
;
color
:
$primary
;
}
.disabledSmsBtn
{
...
...
@@ -271,17 +258,4 @@ export default {
}
}
}
.btn_active
{
background-color
:
yellow
;
}
.test
{
position
:
fixed
;
right
:
20rpx
;
top
:
20rpx
;
z-index
:
2
;
}
</
style
>
pages/mine/index.vue
View file @
9d80fcc6
...
...
@@ -154,7 +154,7 @@ export default {
<
style
lang=
"scss"
scoped
>
.user-wrap
{
@include
borderBox
(
20rpx
,
20rpx
);
height
:
240
rpx
;
height
:
454
rpx
;
background-color
:
red
;
.avatar
{
width
:
160rpx
;
...
...
readme.md
View file @
9d80fcc6
...
...
@@ -26,6 +26,10 @@
-
仅次于小程序原生弹窗 zIndex 100
#### 未完成
+
请求状态码
+
分页封装未处理页数
+
封装数量递增/递减 分类树形递归 首页
\ No newline at end of file
+
呼叫老板提取公共方法
+
分类页面选中名称显示
+
一级分类无商品 二级分类却有商品
+
商品弹窗组件封装(根据sku打开购物弹窗组件)
+
商品的价格展示处理
+
购物
+
购物车step组件
static/images/common/icon-back.png
0 → 100644
View file @
9d80fcc6
556 Bytes
store/modules/user.js
View file @
9d80fcc6
...
...
@@ -9,7 +9,7 @@ const state = {
unionid
:
null
,
session_key
:
''
,
userInfo
:
{},
// 昵称,头像,手机号码
location
:
{},
// location: {}, // 经纬度
appid
:
''
,
storeInfo
:
{},
...
...
@@ -46,15 +46,15 @@ const actions = {
setLoginStatus
:
({
commit
},
status
)
=>
{
commit
(
'
SETLOGINSTATUS
'
,
status
)
},
setLocation
:
async
({
state
})
=>
{
uni
.
getLocation
({
type
:
'
gcj02
'
,
success
:
res
=>
{
state
.
location
.
longitude
=
res
.
longitude
||
null
state
.
location
.
latitude
=
res
.
latitude
||
null
}
})
},
//
setLocation: async ({state}) => {
//
uni.getLocation({
//
type: 'gcj02',
//
success: res => {
//
state.location.longitude = res.longitude || null
//
state.location.latitude = res.latitude || null
//
}
//
})
//
},
setUserInfo
:
async
({
commit
},
userInfo
)
=>
{
try
{
const
{
status
,
data
}
=
await
getUserInfo
()
...
...
styles/mixins.scss
View file @
9d80fcc6
...
...
@@ -24,3 +24,13 @@
box-sizing
:
border-box
;
padding
:
$row
$vertical
;
}
// 返回background
@mixin
backBtn
(
$w
,
$h
)
{
width
:
$w
;
height
:
$h
;
background-image
:
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAABECAMAAADXwceKAAAAjVBMVEUAAAAzMzM0NDRJSUkzMzMzMzM2NjY0NDQzMzMzMzMzMzM0NDQ8PDw+Pj4zMzMzMzMzMzMzMzMzMzM0NDQzMzMzMzMzMzM0NDQzMzM0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ1NTU0NDQzMzM1NTU3Nzc0NDQzMzMzMzM0NDQ0NDQzMzM0NDQ1NTUzMzM0NDQzMzPceya4AAAALnRSTlMA8hMG5Pcb/OuwpIcPC+jb19LOwLWpgHVvZ2FVUElEOTUsIyDFlvrJu5AxMMSY+uhUcQAAASBJREFUSMeE0lcSglAQRFGSCogYyTmYy7f/5anT383M77HKhou1cE5gB86C7+7GmNDiF5jf2dyf5n8e9dzIpcxr+MMl3q/EjxHxKRaP18Sjg7j9Iu6exTcNGxhiYME8hW+Zl/CEeXsTn13igy2+ZxXXnrg/ssIn8VXHBlwwsGJ+hWfMM/iHeQW/MO9Q+LQjPvriHivs7FF4YIVnFG7ZgAQDS+ZbpXABD5k3G/EzK/xG4UO0XDieiDs+CvdswBEDa4sdPLf0H+h/oY/UH1N9Ufqr1mPpudUPhp37LbQOjQAAQBgGToNj//kQ6NxrJG3SjchFaBF7FsfVQ3knzqg/AAIEAWLAIEAqFBvm1oGFYiW11P731CLFSjVT7pwHHBicKAdvqE0z/uTTsgAAAABJRU5ErkJggg==)
;
background-position
:
0
0
;
background-repeat
:
no-repeat
;
background-size
:
100%
100%
;
}
\ No newline at end of file
subPages/resetPwd/common.js
View file @
9d80fcc6
...
...
@@ -12,7 +12,7 @@ function validateForm() {
const
form
=
this
.
form
smsValidator
.
add
(
form
.
phone
,
[{
strategy
:
'
notEmpty
'
,
errorMsg
:
'
手机号码不能为空
'
},
{
strategy
:
'
isMobile
'
,
errorMsg
:
'
手机号码格式不正确
'
}])
smsValidator
.
add
(
form
.
f_code
,
[{
strategy
:
'
notEmpty
'
,
errorMsg
:
'
验证码不能为空
'
}])
smsValidator
.
add
(
form
.
upwd
,
[{
strategy
:
'
notEmpty
'
,
errorMsg
:
'
密码不能为空
'
},
{
strategy
:
'
minLength:
8
'
,
errorMsg
:
'
密码不能少于8
位数字或字母
'
}],
smsValidator
.
add
(
form
.
upwd
,
[{
strategy
:
'
notEmpty
'
,
errorMsg
:
'
密码不能为空
'
},
{
strategy
:
'
minLength:
6
'
,
errorMsg
:
'
密码不能少于6
位数字或字母
'
}],
smsValidator
.
add
(
form
.
upwd2
,
[{
strategy
:
'
notEmpty
'
,
errorMsg
:
'
确认密码不能为空
'
},
{
strategy
:
`unique:
${
form
.
upwd
}
`
,
errorMsg
:
'
两次输入的密码不一致
'
}]))
return
smsValidator
.
validate
()
}
...
...
subPages/resetPwd/index.vue
View file @
9d80fcc6
<
template
>
<view>
<view>
<view
class=
"wrap"
>
<view
class=
"title font-36 font-bold ml-4"
>
欢迎来到
{{
storeInfo
.
shop_name
||
'
格利专属小程序
'
}}
</view>
<view
class=
"input-wrap"
>
<view
class=
"item mb-4 pl-2"
>
<input
class=
"font-28 py-2"
type=
"number"
placeholder=
"请输入手机号码"
maxlength=
"11"
placeholder=
"请输入手机号码"
v-model=
"form.phone"
/>
</view>
<view
>
<view
class=
"item mb-4"
>
<input
class=
"font-28 py-2 pl-2"
type=
"text"
placeholder=
"请输入验证码"
v-model=
"form.f_code"
/>
<view
class=
"sms-btn font-28"
@
click=
"handleSms"
:class=
"smsDisabled ? 'disabledSmsBtn' : null"
>
{{
smsMsg
}}
</view>
</view>
<view
>
<view
class=
"item mb-4"
>
<input
type=
"text"
class=
"font-28 py-2 pl-2"
type=
"password"
placeholder=
"请输入新密码"
v-model=
"form.upwd"
/>
<view
class=
"psd-visibility"
>
icon
</view>
</view>
<view
>
<view
class=
"item mb-2"
>
<input
type=
"text"
placeholder=
"请再次输入密码"
class=
"font-28 py-2 pl-2"
type=
"password"
placeholder=
"再次输入密码"
v-model=
"form.upwd2"
/>
<view
class=
"psd-visibility"
>
icon
</view>
</view>
<view
class=
"tips"
>
密码由6-12位英文字母或数字组成
</view>
</view>
<button
type=
"default"
@
click=
"handleSms"
>
{{
smsMsg
}}
</button>
<button
type=
"default"
@
click=
"handleReset"
>
重置
</button>
<view
class=
"submit font-bold font-32 text-center"
@
click=
"handleReset"
>
提交
</view>
</view>
</
template
>
0
<
script
>
import
{
mapState
}
from
'
vuex
'
...
...
@@ -103,5 +121,56 @@ export default {
}
</
script
>
<
style
>
<
style
lang=
"scss"
scoped
>
.wrap
{
background-color
:
#fff
;
border-top
:
1rpx
solid
$line
;
height
:
100vh
;
overflow
:
hidden
;
.title
{
padding-top
:
80rpx
;
margin-bottom
:
190rpx
;
}
.input-wrap
{
width
:
550rpx
;
margin
:
0
auto
;
.item
{
position
:
relative
;
height
:
88rpx
;
border-radius
:
8rpx
;
background-color
:
#f7f7f7
;
.sms-btn
,
.psd-visibility
{
position
:
absolute
;
right
:
20rpx
;
top
:
50%
;
height
:
88rpx
;
line-height
:
88rpx
;
z-index
:
20
;
transform
:
translateY
(
-50%
);
color
:
$primary
;
}
.disabledSmsBtn
{
color
:
$desc
;
}
}
.tips
{
font-size
:
20rpx
;
margin-bottom
:
60rpx
;
color
:
$desc
;
}
}
.submit
{
width
:
360rpx
;
height
:
88rpx
;
line-height
:
88rpx
;
margin
:
0
auto
;
border-radius
:
8rpx
;
background-color
:
$primary
;
color
:
#fff
;
}
}
</
style
>
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