Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BEHALF
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
华国豪
BEHALF
Commits
91653df4
Commit
91653df4
authored
Nov 13, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增代码
parent
39b20993
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
306 additions
and
190 deletions
+306
-190
app.js
app.js
+8
-23
gouwuche-big.png
images/product/gouwuche-big.png
+0
-0
home.js
pages/Home/home.js
+23
-14
home.wxml
pages/Home/home.wxml
+1
-1
home.wxss
pages/Home/home.wxss
+8
-0
ProductDetails.js
pages/Product/ProductDetails/ProductDetails.js
+1
-1
ProductList.js
pages/Product/ProductList/ProductList.js
+2
-2
Settlement.js
pages/Product/Settlement/Settlement.js
+53
-21
Settlement.wxml
pages/Product/Settlement/Settlement.wxml
+54
-54
Settlement.wxss
pages/Product/Settlement/Settlement.wxss
+11
-0
classify.js
pages/Product/classify/classify.js
+3
-1
ShoppingCart.js
pages/ShoppingCart/ShoppingCart.js
+9
-8
ShoppingCart.wxml
pages/ShoppingCart/ShoppingCart.wxml
+6
-2
ShoppingCart.wxss
pages/ShoppingCart/ShoppingCart.wxss
+9
-0
mine.js
pages/mine/mine.js
+53
-4
mine.wxml
pages/mine/mine.wxml
+63
-58
mineAddrEdit.js
pages/mine/mineAddrEdit/mineAddrEdit.js
+1
-0
project.config.json
project.config.json
+1
-1
No files found.
app.js
View file @
91653df4
...
...
@@ -2,8 +2,8 @@
let
md5
=
require
(
'utils/md5.js'
)
let
javaUrl
=
'https://efficient.oytour.com/'
;
// let javaUrl = 'http://47.96.12.235:9001/';
//
let netUrl = 'https://reborn.oytour.com/api/common/post';
let
netUrl
=
'http://192.168.2.214:8082/api/Common/Post'
;
let
netUrl
=
'https://reborn.oytour.com/api/common/post'
;
//
let netUrl = 'http://192.168.2.214:8082/api/Common/Post';
App
({
// 小程序初始化时
onLaunch
:
function
(
options
)
{
...
...
@@ -17,29 +17,14 @@ App({
onError
:
function
(
msg
)
{},
// 用户token
token
:
''
,
isLogin
:
wx
.
getStorageSync
(
'admin'
)
?
1
:
0
,
isLogin
:
wx
.
getStorageSync
(
'admin'
).
Id
?
1
:
0
,
GuestId
:
0
,
// 全局状态
state
:
{
admin
:
{
account
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
account
:
''
,
address
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
address
:
''
,
businessCardPhotos
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
businessCardPhotos
:
null
,
contact
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
contact
:
''
,
customerAccountId
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
customerAccountId
:
0
,
housePhotos
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
housePhotos
:
null
,
images
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
images
:
null
,
isMember
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
isMember
:
0
,
name
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
name
:
''
,
photo
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
photo
:
''
,
secretKey
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
secretKey
:
''
,
token
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
token
:
''
,
customerName
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
customerName
:
''
,
id
:
wx
.
getStorageSync
(
'admin'
)
?
wx
.
getStorageSync
(
'admin'
).
id
:
5
},
site
:{
companyId
:
wx
.
getStorageSync
(
'site'
)
?
wx
.
getStorageSync
(
'site'
).
companyId
:
0
,
cityId
:
wx
.
getStorageSync
(
'site'
)
?
wx
.
getStorageSync
(
'site'
).
cityId
:
262
,
siteName
:
wx
.
getStorageSync
(
'site'
)
?
wx
.
getStorageSync
(
'site'
).
siteName
:
'成都站'
id
:
0
,
openId
:
null
,
},
companyId
:
wx
.
getStorageSync
(
'site'
)
?
wx
.
getStorageSync
(
'site'
).
companyId
:
0
,
cityId
:
wx
.
getStorageSync
(
'site'
)
?
wx
.
getStorageSync
(
'site'
).
cityId
:
262
,
...
...
@@ -63,7 +48,7 @@ App({
timestamp
:
timestamp
,
token
:
getApp
().
state
.
admin
.
token
,
sign
:
sign
,
uid
:
getApp
().
state
.
admin
.
id
uid
:
0
},
success
(
res
)
{
wx
.
hideLoading
()
...
...
images/product/gouwuche-big.png
0 → 100644
View file @
91653df4
13.4 KB
pages/Home/home.js
View file @
91653df4
...
...
@@ -33,7 +33,7 @@ Page({
let
id
=
e
.
currentTarget
.
dataset
.
id
app
.
$api
(
'Shop_post_SetCommodityShopInfo'
,
{
CommodityId
:
id
,
GuestId
:
app
.
state
.
admin
.
id
,
Guest
Account
Id
:
app
.
state
.
admin
.
id
,
CustomerId
:
0
,
Number
:
1
,
}).
then
(
res
=>
{
...
...
@@ -130,6 +130,12 @@ Page({
})
})
},
goDerails2
:
function
(
e
)
{
let
src
=
e
.
currentTarget
.
dataset
.
src
wx
.
navigateTo
({
url
:
src
,
})
},
goDerails
:
function
(
e
){
let
id
=
e
.
currentTarget
.
dataset
.
id
wx
.
navigateTo
({
...
...
@@ -137,12 +143,15 @@ Page({
})
},
register
:
function
(){
app
.
$api
(
'ShopGuest_post_
Set
GuestAccountService'
,
{
app
.
$api
(
'ShopGuest_post_
Create
GuestAccountService'
,
{
WeChatOpenId
:
this
.
data
.
openId
,
GuestId
:
app
.
state
.
admin
.
i
d
,
GuestId
:
app
.
GuestI
d
,
}).
then
(
r
=>
{
console
.
log
(
r
)
this
.
getUserInfo
()
app
.
state
.
admin
.
id
=
r
.
Id
wx
.
setStorage
({
key
:
'admin'
,
data
:
r
,
})
}).
catch
(
err
=>
{
})
...
...
@@ -151,7 +160,10 @@ Page({
app
.
$api
(
'ShopGuest_get_GetGuestAccountByOpenIdService'
,
{
OpenId
:
this
.
data
.
openId
}).
then
(
r
=>
{
console
.
log
(
r
)
wx
.
setStorage
({
key
:
'admin'
,
data
:
r
,
})
}).
catch
(
err
=>
{
})
...
...
@@ -160,14 +172,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
if
(
options
.
GuestId
)
{
app
.
state
.
admin
.
id
=
options
.
GuestId
wx
.
setStorage
({
key
:
"admin"
,
data
:
{
id
:
options
.
GuestId
}
})
if
(
typeof
(
options
.
GuestId
)
!==
"undefined"
)
{
app
.
GuestId
=
options
.
GuestId
}
else
{
app
.
GuestId
=
0
}
wx
.
login
({
success
:
res
=>
{
...
...
@@ -177,6 +185,7 @@ Page({
app
.
$apiNew
(
'ShopGuest_get_GetShopWeChatOpenIdService'
,
{
code
:
res
.
code
}).
then
(
r
=>
{
app
.
state
.
admin
.
openId
=
r
this
.
setData
({
openId
:
r
})
...
...
pages/Home/home.wxml
View file @
91653df4
...
...
@@ -11,7 +11,7 @@
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{imgList}}" wx:key="index">
<swiper-item>
<image src="{{item.ShowImage}}"></image>
<image src="{{item.ShowImage}}"
bindtap="goDerails2" data-src="{{item.AdLink}}"
></image>
</swiper-item>
</block>
</swiper>
...
...
pages/Home/home.wxss
View file @
91653df4
...
...
@@ -107,4 +107,12 @@
.zhi-pro-item-info .zhi-pro-item-price .gouwuche image{
width: 36rpx;
height: 32rpx;
}
.modal{
width: calc(100vw);
height: calc(100vh);
background-color: rgba(0,0,0,.5);
position: fixed;
left: 0;
top: 0;
}
\ No newline at end of file
pages/Product/ProductDetails/ProductDetails.js
View file @
91653df4
...
...
@@ -35,7 +35,7 @@ Page({
addGwc
:
function
(
e
)
{
app
.
$api
(
'Shop_post_SetCommodityShopInfo'
,
{
CommodityId
:
this
.
data
.
proId
,
GuestId
:
app
.
state
.
admin
.
id
,
Guest
Account
Id
:
app
.
state
.
admin
.
id
,
CustomerId
:
0
,
Number
:
1
,
}).
then
(
res
=>
{
...
...
pages/Product/ProductList/ProductList.js
View file @
91653df4
...
...
@@ -126,7 +126,7 @@ Page({
},
getGwc
:
function
()
{
app
.
$api
(
'Shop_post_GetCommodityShopNumber'
,
{
GuestId
:
app
.
state
.
admin
.
id
,
Guest
Account
Id
:
app
.
state
.
admin
.
id
,
}).
then
(
res
=>
{
this
.
setData
({
allNumber
:
res
...
...
@@ -148,7 +148,7 @@ Page({
let
id
=
e
.
currentTarget
.
dataset
.
id
app
.
$api
(
'Shop_post_SetCommodityShopInfo'
,
{
CommodityId
:
id
,
GuestId
:
app
.
state
.
admin
.
id
,
Guest
Account
Id
:
app
.
state
.
admin
.
id
,
CustomerId
:
0
,
Number
:
1
,
}).
then
(
res
=>
{
...
...
pages/Product/Settlement/Settlement.js
View file @
91653df4
...
...
@@ -12,9 +12,50 @@ Page({
AddrYes
:
true
,
isGowuche
:
false
,
isOrder
:
false
,
openId
:
''
openId
:
''
,
islogin
:
true
},
onGotUserInfo
:
function
(
e
)
{
console
.
log
(
e
)
if
(
e
.
detail
.
userInfo
)
{
let
userInfo
=
e
.
detail
.
userInfo
app
.
$api
(
'ShopGuest_post_SetGuestAccountService'
,
{
AccountName
:
userInfo
.
nickName
,
Id
:
app
.
state
.
admin
.
id
,
Sex
:
userInfo
.
gender
}).
then
(
r
=>
{
app
.
$api
(
'ShopGuest_get_GetGuestAccountByOpenIdService'
,
{
OpenId
:
app
.
state
.
admin
.
openId
}).
then
(
r
=>
{
this
.
setData
({
islogin
:
true
})
wx
.
setStorage
({
key
:
'admin'
,
data
:
r
,
})
}).
catch
(
err
=>
{
})
}).
catch
(
err
=>
{
})
}
else
{
wx
.
navigateBack
({
delta
:
1
})
}
},
setOrder
:
function
(){
if
(
!
this
.
data
.
AddrObj
.
Id
)
{
wx
.
showToast
({
title
:
'请添加/新增收货地址'
,
icon
:
'none'
,
duration
:
2000
})
return
}
let
orderId
=
null
if
(
this
.
data
.
isOrder
)
{
// 已下单未支付
...
...
@@ -24,16 +65,16 @@ Page({
})
}
else
{
let
msg
=
{
GuestId
:
app
.
state
.
admin
.
id
,
Guest
Account
Id
:
app
.
state
.
admin
.
id
,
ShopList
:
[],
GuestAddressId
:
this
.
data
.
AddrObj
.
Id
,
WeChatOpenId
:
this
.
data
.
openId
WeChatOpenId
:
app
.
state
.
admin
.
openId
}
this
.
data
.
dataList
.
map
(
x
=>
{
let
obj
=
{
"Id"
:
0
,
"CustomerId"
:
0
,
"GuestId"
:
0
,
"Guest
Account
Id"
:
0
,
"CommodityId"
:
0
,
"CostPrice"
:
0
,
"SellPrice"
:
0
,
...
...
@@ -46,7 +87,7 @@ Page({
obj
.
Number
=
x
.
number
msg
.
ShopList
.
push
(
obj
)
})
app
.
$api
(
'
'
,
msg
).
then
(
res
=>
{
app
.
$api
(
'
ShopOrder_post_AddCommodityOrderService
'
,
msg
).
then
(
res
=>
{
console
.
log
(
res
)
orderId
=
res
wx
.
redirectTo
({
...
...
@@ -137,25 +178,16 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
wx
.
login
({
success
:
res
=>
{
// 登录注册接口
if
(
res
.
code
)
{
// 调用服务端登录接口,发送 res.code 到服务器端换取 openId, sessionKey, unionId并存入数据库中
app
.
$apiNew
(
'ShopGuest_get_GetShopWeChatOpenIdService'
,
{
code
:
res
.
code
}).
then
(
r
=>
{
this
.
setData
({
openId
:
r
})
}).
catch
(
err
=>
{
let
_this
=
this
wx
.
getSetting
({
success
(
res
)
{
if
(
!
res
.
authSetting
[
'scope.userInfo'
])
{
_this
.
setData
({
islogin
:
false
})
}
else
{
console
.
log
(
'登录失败!'
+
res
.
errMsg
)
}
}
})
;
})
if
(
typeof
(
options
.
isGowuche
)
!==
"undefined"
)
{
this
.
setData
({
isGowuche
:
true
...
...
pages/Product/Settlement/Settlement.wxml
View file @
91653df4
<view class="Settlement commonF">
<view class="Settlement-addr">
<view wx:if="{{AddrYes}}">
<view class="sar-tit f28 c11">{{AddrObj.LinkMan}} <text>{{AddrObj.LinkTel}}</text></view>
<view class="sar-info">
<image src="/images/mine/dingwei2.png"></image>
<view class="text2 f28 c22">{{AddrObj.DetaileAddress}}</view>
<view class="edit-btn f28" bindtap="jumpEidtAddrPage" data-index="1">修改</view>
<view>
<view class="Settlement-addr">
<view wx:if="{{AddrYes}}">
<view class="sar-tit f28 c11">{{AddrObj.LinkMan}} <text>{{AddrObj.LinkTel}}</text></view>
<view class="sar-info">
<image src="/images/mine/dingwei2.png"></image>
<view class="text2 f28 c22">{{AddrObj.DetaileAddress}}</view>
<view class="edit-btn f28" bindtap="jumpEidtAddrPage" data-index="1">修改</view>
</view>
</view>
<view class="add-btn f30" bindtap="jumpEidtAddrPage" wx:else>
<text>新建收货地址</text>
</view>
</view>
<view class="add-btn f30" bindtap="jumpEidtAddrPage" wx:else>
<text>新建收货地址</text>
<image class="se-line" src="/images/mine/line.png"></image>
<view class="Gray30"></view>
<scroll-view class="Settlement-scroll-view" scroll-y>
<view class="sett-pro-item" wx:for="{{dataList}}" wx:key="index">
<view class="left">
<image mode="aspectFit" src="{{item.FlowImgList[0]}}"></image>
</view>
<view class="right c11 bold">
<view class="f26 text2">{{item.Name}}</view>
<view class="price">
<view class="f28">¥ {{item.SellPrice}}</view>
<view class="f22 c88">x{{item.number}}</view>
</view>
</view>
</view>
</scroll-view>
<view class="peisong-allprice">
<view class="peisong">
<view class="f28 c11">配送方式 <text class="f24 c99">快递</text> </view>
<view class="f24 c11">免运费</view>
</view>
<view class="allprice">
<text class="f24 c99">共2件 </text>
<text class="f24 c11">小计: <text class="f30 cee">¥{{allPrice}}</text></text>
</view>
</view>
</view>
<image class="se-line" src="/images/mine/line.png"></image>
<!-- <view class="Gray30"></view>
<view class="shenfenz f24 c11">
<view>身份证号</view>
<view>5139**********1234</view>
</view> -->
<view class="Gray30"></view>
<scroll-view class="Settlement-scroll-view" scroll-y>
<view class="sett-pro-item" wx:for="{{dataList}}" wx:key="index">
<view class="Gray30"></view>
<view class="pay-way" bindtap="changePayway">
<view class="left">
<image mode="aspectFit" src="{{item.FlowImgList[0]}}"></image>
<image src="/images/mine/wechat.png"></image>
<text class="f30 c11">微信支付</text>
</view>
<view class="right c11 bold">
<view class="f26 text2">{{item.Name}}</view>
<view class="price">
<view class="f28">¥ {{item.SellPrice}}</view>
<view class="f22 c88">x{{item.number}}</view>
</view>
<view class="right">
<view class="raduis" wx:if="{{!wxPay}}"></view>
<image src="/images/product/xuanzhong.png" wx:else></image>
</view>
</view>
</scroll-view>
<view class="peisong-allprice">
<view class="peisong">
<view class="f28 c11">配送方式 <text class="f24 c99">快递</text> </view>
<view class="f24 c11">免运费</view>
</view>
<view class="allprice">
<text class="f24 c99">共2件 </text>
<text class="f24 c11">小计: <text class="f30 cee">¥{{allPrice}}</text></text>
</view>
</view>
<view class="Gray30"></view>
<view class="pay-way" bindtap="changePayway">
<view class="left">
<image src="/images/mine/wechat.png"></image>
<text class="f30 c11">微信支付</text>
</view>
<view class="right">
<view class="raduis" wx:if="{{!wxPay}}"></view>
<image src="/images/product/xuanzhong.png" wx:else></image>
<view class="tips f22 c99">点击支付则表示您同意 <text class="c11">《用户购买须知》</text></view>
<view class="pay-box">
<view class="f24">
总计: <text class="cee bold f30">¥{{allPrice}}</text>
</view>
<view class="pay-btn f30 cff" bindtap="setOrder">
立即支付
</view>
</view>
</view>
<view class="tips f22 c99">点击支付则表示您同意 <text class="c11">《用户购买须知》</text></view>
<view class="pay-box">
<view class="f24">
总计: <text class="cee bold f30">¥{{allPrice}}</text>
</view>
<view class="pay-btn f30 cff" bindtap="setOrder">
立即支付
</view>
<view wx:if="{{!islogin}}" class="no-login">
<button class="f26" size="mini" type="primary" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="onGotUserInfo">微信授权登录</button>
</view>
</view>
\ No newline at end of file
pages/Product/Settlement/Settlement.wxss
View file @
91653df4
...
...
@@ -138,4 +138,15 @@
border-radius:37rpx;
margin-top: 40rpx;
color: rgba(226,20,54,1);
}
.no-login{
height: calc(100vh);
width: calc(100vw);
display: flex;
align-items: center;
justify-content: center;
position: fixed;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .3)
}
\ No newline at end of file
pages/Product/classify/classify.js
View file @
91653df4
...
...
@@ -62,7 +62,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
wx
.
setNavigationBarTitle
({
title
:
'分类'
})
},
/**
...
...
pages/ShoppingCart/ShoppingCart.js
View file @
91653df4
...
...
@@ -16,7 +16,7 @@ Page({
pageIndex
:
1
,
pageSize
:
10
,
CustomerId
:
0
,
GuestId
:
app
.
state
.
admin
.
id
,
Guest
Account
Id
:
app
.
state
.
admin
.
id
,
},
totalPage
:
0
,
pageIndex
:
1
,
...
...
@@ -181,13 +181,8 @@ Page({
if
(
res
.
confirm
)
{
app
.
$api
(
'Shop_post_DelCommodityShopInfo'
,
{
Id
:
id
,
Guest
Id
:
app
.
state
.
admin
.
id
Guest
AccountId
:
app
.
state
.
admin
.
id
,
}).
then
(
res
=>
{
wx
.
showToast
({
title
:
'删除成功'
,
icon
:
'none'
,
duration
:
2000
})
_this
.
getList
()
_this
.
calculationPrice
()
}).
catch
(
err
=>
{
...
...
@@ -204,6 +199,10 @@ Page({
})
},
getList
:
function
(
type
)
{
if
(
!
app
.
state
.
admin
.
id
)
{
return
}
this
.
data
.
msg
.
GuestAccountId
=
app
.
state
.
admin
.
id
if
(
this
.
data
.
pageIndex
>=
this
.
data
.
totalPage
&&
type
)
{
return
}
...
...
@@ -248,7 +247,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
wx
.
setNavigationBarTitle
({
title
:
'购物车'
})
},
/**
...
...
pages/ShoppingCart/ShoppingCart.wxml
View file @
91653df4
...
...
@@ -2,7 +2,7 @@
<view class="zonghe f24 c11">
共{{dataList.length}}件宝贝
</view>
<scroll-view class="ShoppingCart-scroll-view" scroll-y bindscrolltolower="scrollGetMore">
<scroll-view class="ShoppingCart-scroll-view" scroll-y bindscrolltolower="scrollGetMore"
wx:if="{{dataList.length > 0}}"
>
<view class="ShoppingCart-item bb1e9" wx:for="{{dataList}}" wx:key="index" data-index="{{index}}" bindtouchstart="drawStart" bindtouchmove="drawMove" bindtouchend="drawEnd" style="right:{{item.right}}rpx">
<view class="check-box" data-index="{{index}}" bindtap="selectItem">
<view wx:if="{{!item.select}}" class="raduis"></view>
...
...
@@ -34,7 +34,7 @@
<view class="remove" bindtap="delItem" data-id="{{item.Id}}">删除 </view>
</view>
</scroll-view>
<view class="btn-info-box">
<view class="btn-info-box"
wx:if="{{dataList.length > 0}}"
>
<view class="check-box" bindtap="checkAll">
<view wx:if="{{!selectAll}}" class="raduis"></view>
<image wx:else src="/images/product/xuanzhong.png"></image>
...
...
@@ -49,4 +49,8 @@
<view wx:else class="f30 cff">去结算({{selectNum}})</view>
</view>
</view>
<view class="f26 c88 center kongkong" wx:if="{{dataList.length == 0}}">
<image src="/images/product/gouwuche-big.png"></image>
<view>购物车空空如也</view>
</view>
</view>
\ No newline at end of file
pages/ShoppingCart/ShoppingCart.wxss
View file @
91653df4
...
...
@@ -117,4 +117,13 @@
}
.btn-info-box-btn view.submit{
background:linear-gradient(90deg,rgba(226,20,54,1),rgba(253,78,107,1));
}
.kongkong{
padding: 100rpx 30rpx 0 30rpx;
background-color: #F5F5F5;
}
.kongkong image{
width: 150rpx;
height: 150rpx;
margin-bottom: 20rpx;
}
\ No newline at end of file
pages/mine/mine.js
View file @
91653df4
...
...
@@ -5,7 +5,8 @@ Page({
* 页面的初始数据
*/
data
:
{
userInfo
:
{},
islogin
:
true
},
jumpPage
:
function
(
e
){
let
url
=
e
.
currentTarget
.
dataset
.
url
...
...
@@ -13,12 +14,47 @@ Page({
url
:
url
,
})
},
onGotUserInfo
:
function
(
e
)
{
console
.
log
(
e
.
detail
.
userInfo
)
if
(
e
.
detail
.
userInfo
)
{
let
userInfo
=
e
.
detail
.
userInfo
app
.
$api
(
'ShopGuest_post_SetGuestAccountService'
,
{
AccountName
:
userInfo
.
nickName
,
Id
:
app
.
state
.
admin
.
id
,
Sex
:
userInfo
.
gender
}).
then
(
r
=>
{
app
.
$api
(
'ShopGuest_get_GetGuestAccountByOpenIdService'
,
{
OpenId
:
app
.
state
.
admin
.
openId
}).
then
(
r
=>
{
this
.
setData
({
userInfo
:
r
,
islogin
:
true
})
wx
.
setStorage
({
key
:
'admin'
,
data
:
r
,
})
}).
catch
(
err
=>
{
})
}).
catch
(
err
=>
{
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
_this
=
this
wx
.
getStorage
({
key
:
'admin'
,
success
:
function
(
res
)
{
_this
.
setData
({
userInfo
:
res
.
data
})
},
})
},
/**
...
...
@@ -32,7 +68,20 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
let
_this
=
this
;
wx
.
getSetting
({
success
(
res
)
{
if
(
!
res
.
authSetting
[
'scope.userInfo'
])
{
_this
.
setData
({
islogin
:
false
})
}
else
{
_this
.
setData
({
islogin
:
true
})
}
}
})
},
/**
...
...
pages/mine/mine.wxml
View file @
91653df4
<view class="mine commonF">
<view class="top">
<view class="head-name">
<view class="top-head">
<view>
<image src="https://profile.csdnimg.cn/A/E/0/3_chijinrong4312"></image>
<view>
<view class="top" >
<view class="head-name">
<view class="top-head">
<view>
<image src="https://profile.csdnimg.cn/A/E/0/3_chijinrong4312"></image>
</view>
</view>
<view class="f32 c11" wx:if="{{islogin}}">
{{userInfo.AccountName}}
</view>
<view wx:else class="no-login">
<button class="f26" size="mini" type="primary" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="onGotUserInfo">微信授权登录</button>
</view>
</view>
<view class="f32 c11">
唐先生
</view>
</view>
<view class="bottom-line"></view>
</view>
<view class="order-box">
<view class="order-box-tit">
<view class="c30 c11 bold">我的订单</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=0">
<text class="f24 c99">查看更多</text><image src="/images/product/right.png"></image>
</view>
<view class="bottom-line"></view>
</view>
<view class="order-type">
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=2">
<view>
<image src="/images/mine/qianbao.png"></image>
<view class="order-box" wx:if="{{islogin}}">
<view class="order-box-tit">
<view class="c30 c11 bold">我的订单</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=0">
<text class="f24 c99">查看更多</text><image src="/images/product/right.png"></image>
</view>
<view>待付款</view>
</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=5">
<view>
<image src="/images/mine/baoguo.png"></image>
<view class="order-type">
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=2">
<view>
<image src="/images/mine/qianbao.png"></image>
</view>
<view>待付款</view>
</view>
<view
>待发货</view
>
</
view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=6"
>
<
view>
<
image src="/images/mine/che.png"></image
>
<view
bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=5"
>
<
view>
<image src="/images/mine/baoguo.png"></image
>
</
view>
<
view>待发货</view
>
</view>
<view>待收货</view>
</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=7">
<view>
<image src="/images/mine/wancheng.png"></image>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=6">
<view>
<image src="/images/mine/che.png"></image>
</view>
<view>待收货</view>
</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=7">
<view>
<image src="/images/mine/wancheng.png"></image>
</view>
<view>已完成</view>
</view>
<view>已完成</view>
</view>
</view>
</view>
<view class="Gray30"></view>
<view class="gongneng">
<view class="g-row bb1e9" bindtap="jumpPage" data-url="/pages/mine/mineAddrList/mineAddrList">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/dingwei.png"></image>
<text>收货地址</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view>
<view class="g-row bb1e9">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/kefu.png"></image>
<text>客服中心</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view>
<view class="g-row bb1e9">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/xinfeng.png"></image>
<text>意见反馈</text>
<view class="Gray30" wx:if="{{islogin}}"></view>
<view class="gongneng" wx:if="{{islogin}}">
<view class="g-row bb1e9" bindtap="jumpPage" data-url="/pages/mine/mineAddrList/mineAddrList">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/dingwei.png"></image>
<text>收货地址</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view>
<image class="right-img" src="/images/product/right.png"></image>
<!-- <view class="g-row bb1e9">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/kefu.png"></image>
<text>客服中心</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view> -->
<!-- <view class="g-row bb1e9">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/xinfeng.png"></image>
<text>意见反馈</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view> -->
</view>
</view>
</view>
\ No newline at end of file
pages/mine/mineAddrEdit/mineAddrEdit.js
View file @
91653df4
...
...
@@ -28,6 +28,7 @@ Page({
})
},
seveMsg
:
function
()
{
this
.
data
.
msg
.
GuestAccountId
=
app
.
state
.
admin
.
id
if
(
!
this
.
data
.
msg
.
LinkMan
){
wx
.
showToast
({
title
:
'请填写收货人'
,
...
...
project.config.json
View file @
91653df4
...
...
@@ -22,7 +22,7 @@
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.7.7"
,
"appid"
:
"wx
b6bcc99626870225
"
,
"appid"
:
"wx
32833ebd278dfc43
"
,
"projectname"
:
"DAIGOU"
,
"cloudfunctionTemplateRoot"
:
""
,
"watchOptions"
:
{
...
...
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