Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shop_mobile_uni
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑秀明
shop_mobile_uni
Commits
1b37178b
Commit
1b37178b
authored
Feb 17, 2020
by
王建威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
白条转区
parent
d59f1113
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
17 deletions
+63
-17
App.vue
App.vue
+3
-3
main.js
main.js
+30
-1
manifest.json
manifest.json
+2
-2
Category.vue
pages/category/Category.vue
+8
-3
index.vue
pages/index/index.vue
+20
-8
No files found.
App.vue
View file @
1b37178b
<
script
>
<
script
>
export
default
{
export
default
{
onLaunch
:
function
()
{
onLaunch
:
function
()
{
console
.
log
(
'App Launch'
)
},
},
onShow
:
function
()
{
onShow
:
function
()
{
console
.
log
(
'App Show'
)
},
},
onHide
:
function
()
{
onHide
:
function
()
{
console
.
log
(
'App Hide'
)
}
}
}
}
</
script
>
</
script
>
...
...
main.js
View file @
1b37178b
import
Vue
from
'vue'
import
Vue
from
'vue'
import
App
from
'./App'
import
App
from
'./App'
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
// 加入购物车
function
addCart
(
spec_id
,
quantity
)
{
uni
.
request
({
url
:
'/uni/api//credit_goods/add_cart'
,
method
:
'post'
,
dataType
:
'json'
,
data
:
{
spec_id
:
spec_id
,
quantity
:
quantity
},
success
:
(
res
)
=>
{
console
.
log
(
res
)
}
})
}
(
function
()
{
uni
.
request
({
url
:
'/uni/api/application/is_login'
,
type
:
'get'
,
success
:
(
res
)
=>
{
Vue
.
prototype
.
$isLogin
=
res
.
data
.
data
;
}
});
})()
Vue
.
prototype
.
$addCart
=
addCart
;
App
.
mpType
=
'app'
App
.
mpType
=
'app'
...
...
manifest.json
View file @
1b37178b
...
@@ -88,11 +88,11 @@
...
@@ -88,11 +88,11 @@
"port"
:
8080
,
"port"
:
8080
,
"disableHostCheck"
:
true
,
"disableHostCheck"
:
true
,
"proxy"
:
{
"proxy"
:
{
"/api"
:
{
"/
uni/
api"
:
{
"target"
:
"http://192.168.50.133:6564/"
,
"target"
:
"http://192.168.50.133:6564/"
,
"changeOrigin"
:
true
,
"changeOrigin"
:
true
,
"secure"
:
false
,
"secure"
:
false
,
"pathRewrite"
:{
"^/api"
:
"api"
}
"pathRewrite"
:{
"^/
uni/
api"
:
"api"
}
}
}
}
}
}
}
...
...
pages/category/Category.vue
View file @
1b37178b
...
@@ -20,10 +20,10 @@
...
@@ -20,10 +20,10 @@
<text>
9个月账期
</text>
<text>
9个月账期
</text>
</view>
</view>
<p
class=
"price"
>
<p
class=
"price"
>
<text>
¥
</text>
{{
item
.
price
}}
<text>
{{
isLogin
?
'¥'
:
''
}}
</text>
{{
isLogin
?
item
.
price
:
'登录显示价格'
}}
</p>
</p>
</view>
</view>
<i
class=
"cart_icon"
></i>
<i
class=
"cart_icon"
@
click=
"addCart(item.spec_id, 1)"
></i>
</view>
</view>
<view
class=
"pageBox"
>
<view
class=
"pageBox"
>
<uni-pagination
:total=
"page['total']"
show-icon=
"true"
@
change=
"changePage"
></uni-pagination>
<uni-pagination
:total=
"page['total']"
show-icon=
"true"
@
change=
"changePage"
></uni-pagination>
...
@@ -46,10 +46,12 @@
...
@@ -46,10 +46,12 @@
firsr_cate_id
:
''
,
firsr_cate_id
:
''
,
tabIndex
:
-
1
,
tabIndex
:
-
1
,
params
:
{},
params
:
{},
keyword
:
''
keyword
:
''
,
isLogin
:
0
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
this
.
isLogin
=
this
.
$isLogin
;
this
.
firsr_cate_id
=
option
.
cate_id_1
;
this
.
firsr_cate_id
=
option
.
cate_id_1
;
option
.
current
=
Number
(
option
.
current
);
option
.
current
=
Number
(
option
.
current
);
option
.
pageSize
=
Number
(
option
.
pageSize
);
option
.
pageSize
=
Number
(
option
.
pageSize
);
...
@@ -140,6 +142,9 @@
...
@@ -140,6 +142,9 @@
this
.
page
=
page
;
this
.
page
=
page
;
}
}
});
});
},
addCart
(
spec_id
,
quantity
)
{
this
.
$addCart
(
spec_id
,
quantity
)
}
}
}
}
}
}
...
...
pages/index/index.vue
View file @
1b37178b
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
<i
class=
"search_icon"
@
click=
"search"
></i>
<i
class=
"search_icon"
@
click=
"search"
></i>
<input
type=
"text"
class=
"search_input"
v-model=
"keyword"
@
confirm=
"search"
>
<input
type=
"text"
class=
"search_input"
v-model=
"keyword"
@
confirm=
"search"
>
</view>
</view>
<text
class=
"login_btn"
@
click=
"jumpPhpPage('app=member&act=login')"
>
登录
</text>
<text
class=
"login_btn"
@
click=
"jumpPhpPage('app=member&act=login')"
v-if=
"!isLogin"
>
登录
</text>
<uni-icons
v-else
type=
"person"
size=
"30"
@
click=
"jumpPhpPage('app=member')"
></uni-icons>
</view>
</view>
<view
class=
"flex tab_bar"
>
<view
class=
"flex tab_bar"
>
<text
:class=
"
{act: tabIndex === 1}" @click="jumpPhpPage()">首页
</text>
<text
:class=
"
{act: tabIndex === 1}" @click="jumpPhpPage()">首页
</text>
...
@@ -26,7 +27,7 @@
...
@@ -26,7 +27,7 @@
<view>
<view>
<text
class=
"text"
>
白条商品
</text>
<text
class=
"text"
>
白条商品
</text>
<i></i>
<i></i>
<text
class=
"text"
>
信用支付
帐
期无忧
</text>
<text
class=
"text"
>
信用支付
账
期无忧
</text>
</view>
</view>
<view
class=
"flex classbox"
>
<view
class=
"flex classbox"
>
<view
class=
"class_item"
v-for=
"(item, index) in credit_cates_list"
:key=
"index"
@
click=
"jumpSecondPage(item.cate_id, 1, 10)"
>
<view
class=
"class_item"
v-for=
"(item, index) in credit_cates_list"
:key=
"index"
@
click=
"jumpSecondPage(item.cate_id, 1, 10)"
>
...
@@ -43,7 +44,7 @@
...
@@ -43,7 +44,7 @@
<view
class=
"part_three"
>
<view
class=
"part_three"
>
<view
class=
"part_three_top"
>
<view
class=
"part_three_top"
>
<view>
<view>
<p>
谛宝多多
帐
期无忧
</p>
<p>
谛宝多多
账
期无忧
</p>
<p>
最高可享12期免息
</p>
<p>
最高可享12期免息
</p>
</view>
</view>
<text
class=
"go_detail"
@
click=
"jumpGoPage('/introduce')"
>
查看详情
<i
class=
"go_credit_icon"
></i></text>
<text
class=
"go_detail"
@
click=
"jumpGoPage('/introduce')"
>
查看详情
<i
class=
"go_credit_icon"
></i></text>
...
@@ -72,8 +73,8 @@
...
@@ -72,8 +73,8 @@
</view>
</view>
<text
class=
"goods_des"
>
{{
val
.
goods_subname
}}
</text>
<text
class=
"goods_des"
>
{{
val
.
goods_subname
}}
</text>
<view
class=
"price_view"
>
<view
class=
"price_view"
>
<text>
¥
{{
val
.
price
}}
</text>
<text>
{{
isLogin
?
`¥${val.price
}
`
:
'登录显示价格'
}}
<
/text
>
<i></i>
<
i
@
click
=
"addCart(val.spec_id, 1)"
><
/i
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
...
@@ -85,19 +86,27 @@
...
@@ -85,19 +86,27 @@
<
/template>
<
/template>
<
script
>
<
script
>
import
{
php
,
go
}
from
'../../common/host.js'
;
import
{
php
,
go
}
from
'../../common/host.js'
;
import
uniIcons
from
"@/components/uni-icons/uni-icons.vue"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
tabIndex
:
3
,
// 1:首页 2:精彩活动 3:谛宝白条 4:采购分期
tabIndex
:
3
,
// 1:首页 2:精彩活动 3:谛宝白条 4:采购分期
credit_cates_list
:
[],
// 分类
credit_cates_list
:
[],
// 分类
credit_goods_list
:
[],
// 商品
credit_goods_list
:
[],
// 商品
user_name
:
''
,
portrait
:
''
,
current
:
0
,
current
:
0
,
keyword
:
''
keyword
:
''
,
isLogin
:
0
}
}
}
,
}
,
onLoad
()
{
onLoad
()
{
this
.
isLogin
=
this
.
$isLogin
;
this
.
getData
();
this
.
getData
();
}
,
components
:
{
uniIcons
}
,
}
,
methods
:
{
methods
:
{
// changeTab(index)
{
// changeTab(index)
{
...
@@ -132,6 +141,9 @@
...
@@ -132,6 +141,9 @@
jumpGoPage
(
url
)
{
jumpGoPage
(
url
)
{
let
link
=
url
?
`${go
}
${url
}
`
:
go
;
let
link
=
url
?
`${go
}
${url
}
`
:
go
;
window
.
location
.
href
=
link
;
window
.
location
.
href
=
link
;
}
,
addCart
(
spec_id
,
quantity
)
{
this
.
$addCart
(
spec_id
,
quantity
)
}
}
}
}
}
;
}
;
...
...
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