Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
points-mall
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d2814729
authored
Aug 26, 2025
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商城首页联调
1 parent
292944b2
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
401 additions
and
315 deletions
api/module/mine.js
components/Adress/index.js
components/Sku/index.js
components/goods/goods.wxml
packageIndex/pages/SpecialSale/SpecialSale.js
packageIndex/pages/SpecialSale/SpecialSale.wxml
packageIndex/pages/confirmOrder/index.js
packageIndex/pages/confirmOrder/index.json
packageIndex/pages/confirmOrder/index.wxml
packageIndex/pages/goodsDetail/index.js
packageMine/pages/address/detail/components/AreaSelect/index.js
packageMine/pages/address/detail/components/AreaSelect/index.json
packageMine/pages/address/detail/components/AreaSelect/index.scss
packageMine/pages/address/detail/components/AreaSelect/index.wxml
packageMine/pages/address/detail/detail.js
packageMine/pages/address/detail/detail.json
packageMine/pages/address/detail/detail.wxml
packageMine/pages/address/index/index.js
packageMine/pages/address/index/index.scss
packageMine/pages/address/index/index.wxml
pages/tab/index/index.js
pages/tab/index/index.scss
pages/tab/index/index.wxml
pages/tab/mine/index.wxml
api/module/mine.js
View file @
d281472
import
api
from
'../request/http'
import
api
from
'../request/http'
module
.
exports
=
{
module
.
exports
=
{
/**获取集团或者门店详细信息 */
/**. 分页查询订单 */
getMerchantDetail
(
data
)
{
getOrderList
(
data
)
{
return
api
.
post
({
method
:
'scrm.api.carlife.merchant.detail'
,
...
data
})
},
/**获取当前用户的收货地址列表 */
getUserAddressList
(
data
)
{
return
api
.
post
({
method
:
`scrm.api.carlife.weapp.userAddress.list`
,
...
data
})
},
/**根据ID获取用户收货地址 */
getUserAddress
(
data
)
{
return
api
.
post
({
method
:
`scrm.api.carlife.weapp.userAddress.getById`
,
...
data
})
},
/** 新增用户收货地址 */
addUserAddress
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`scrm.api.carlife.weapp.userAddress.add`
,
method
:
`scrm.api.shopmall.weapp.order.page`
,
pageSize
:
99999
,
...
data
...
data
})
})
},
},
/**
编辑用户收货地址
*/
/**
获取订单状态数量
*/
updateUserAddress
(
data
)
{
getOrderNumberList
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`scrm.api.carlife.weapp.userAddress.update`
,
method
:
'scrm.api.shopmall.weapp.order.statis'
,
...
data
...
data
})
})
},
},
/**
更改为默认收货地址
*/
/**
获取客户保存的地址列表
*/
setUserAddressDefaul
t
(
data
)
{
getCustomerAddressLis
t
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`scrm.api.carlife.weapp.userAddress.updateDefault`
,
method
:
'scrm.api.shopmall.platform.customer.address.list'
,
...
data
...
data
})
})
},
},
/**
删除用户
收货地址 */
/**
保存或更新
收货地址 */
delUser
Address
(
data
)
{
save
Address
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`scrm.api.carlife.weapp.userAddress.delete`
,
method
:
'scrm.api.shopmall.platform.customer.address.save'
,
...
data
...
data
})
})
},
},
/** 获取用户默认收货地址 */
/**删除收货地址 */
getUserAddressDefault
()
{
removeAddress
(
data
)
{
return
api
.
fetch
(
'scrm.api.carlife.weapp.userAddress.getDefault'
)
},
/**. 分页查询订单 */
getOrderList
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`scrm.api.shopmall.weapp.order.page`
,
method
:
'scrm.api.shopmall.platform.customer.address.delete'
,
pageSize
:
99999
,
...
data
...
data
})
})
},
},
/**获取
订单状态数量
*/
/**获取
地址基础数据
*/
get
OrderNumberList
(
data
)
{
get
BaseAddress
(
data
)
{
return
api
.
post
({
return
api
.
post
({
method
:
'scrm.api.shopmall.
weapp.order.statis
'
,
method
:
'scrm.api.shopmall.
platform.base.address.list
'
,
...
data
...
data
})
})
}
}
...
...
components/Adress/index.js
View file @
d281472
// import { shopmallApi } from '~/api/api
'
import
mineApi
from
'~/api/module/mine.js
'
Component
({
Component
({
/**
/**
* 组件的属性列表
* 组件的属性列表
...
@@ -71,12 +71,12 @@ Component({
...
@@ -71,12 +71,12 @@ Component({
this
.
setData
({
address
})
this
.
setData
({
address
})
},
},
addressList
()
{
addressList
()
{
let
para
=
{}
mineApi
.
getCustomerAddressList
().
then
(
data
=>
{
console
.
log
(
this
.
data
.
staff
,
'this.data.staff'
);
// 新增地址后默认将新增的选中
if
(
this
.
data
.
staff
)
{
data
?.
forEach
((
val
,
index
)
=>
{
para
.
businessType
=
1
val
.
active
=
false
}
if
(
index
==
0
)
val
.
active
=
true
shopmallApi
.
platformAddressList
(
para
).
then
(
data
=>
{
})
this
.
setData
({
this
.
setData
({
address
:
data
address
:
data
})
})
...
@@ -87,7 +87,7 @@ Component({
...
@@ -87,7 +87,7 @@ Component({
lifetimes
:
{
lifetimes
:
{
attached
:
function
()
{
attached
:
function
()
{
wx
.
p
.
eventbus
.
on
(
'REFRESH_PLATFORM_ADDRESS'
,()
=>
{
wx
.
p
.
eventbus
.
on
(
'REFRESH_PLATFORM_ADDRESS'
,()
=>
{
//
this.addressList()
this
.
addressList
()
})
})
},
},
},
},
...
...
components/Sku/index.js
View file @
d281472
...
@@ -80,17 +80,15 @@ Component({
...
@@ -80,17 +80,15 @@ Component({
})
})
})
})
let
specificationData
=
activeList
.
join
(
'&'
)
let
specificationData
=
activeList
.
join
(
'&'
)
let
redeemPoints
,
goodsStock
,
saleAmount
let
goodsStock
,
saleAmount
platformGlGoodsSpecifications
?.
map
(
val
=>
{
platformGlGoodsSpecifications
?.
map
(
val
=>
{
if
(
val
.
specificationData
==
specificationData
)
{
if
(
val
.
specificationData
==
specificationData
)
{
redeemPoints
=
val
.
retailPrice
goodsStock
=
val
.
stock
goodsStock
=
val
.
stock
saleAmount
=
val
.
saleAmount
saleAmount
=
val
.
saleAmount
}
}
})
})
this
.
setData
({
this
.
setData
({
detailInfo
,
detailInfo
,
[
'detailInfo.redeemPoints'
]:
redeemPoints
,
[
'detailInfo.goodsStock'
]:
goodsStock
,
[
'detailInfo.goodsStock'
]:
goodsStock
,
[
'detailInfo.specificationData'
]:
specificationData
[
'detailInfo.specificationData'
]:
specificationData
})
})
...
...
components/goods/goods.wxml
View file @
d281472
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</block>
</block>
</view>
</view>
<template name="item">
<template name="item">
<view class='item-box' wx:if="{{item.id}}" bindtap='handleSale' data-target="{{item}}">
<view class='item-box' wx:if="{{item.id
|| item.goodsId
}}" bindtap='handleSale' data-target="{{item}}">
<view class="preview">
<view class="preview">
<image webp src="{{item.goodsImgUrl}}" lazy-load></image>
<image webp src="{{item.goodsImgUrl}}" lazy-load></image>
</view>
</view>
...
...
packageIndex/pages/SpecialSale/SpecialSale.js
View file @
d281472
...
@@ -7,64 +7,7 @@ Page({
...
@@ -7,64 +7,7 @@ Page({
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
pageParams
:
{},
pageParams
:
{}
goodsList
:
[
{
"id"
:
243
,
"goodsSkuCode"
:
"2888888889106540"
,
"brandName"
:
"维仕蓝维仕蓝维仕蓝维仕蓝维仕蓝"
,
"goodsSkuName"
:
"志翔验收白名单 丹青额 "
,
"goodsImgUrl"
:
"https://img.yunzhonghe.com/image/1650792972441AZtFGalcxH.jpg"
,
"goodsStock"
:
185
,
"redeemPoints"
:
100
,
"salePrice"
:
0.00
,
"sellPrice"
:
100.00
,
"marketPrice"
:
100.00
,
"firstCategoryName"
:
"数码dcg "
,
"secondCategoryName"
:
"摄影摄像"
,
"lastCategoryName"
:
"单电微单相机"
,
"shelvesStatus"
:
1001
,
"saleDate"
:
1755571007000
,
"saleFlag"
:
1
,
"saleAmount"
:
12
,
"fronCategoryId"
:
null
,
"fronCategoryName"
:
null
,
"pageView"
:
null
,
"visitorCount"
:
0
,
"goodsSource"
:
1
,
"minGoodsStock"
:
0
,
"minSalePrice"
:
0
,
"maxSalePrice"
:
0
,
"maxGoodsStock"
:
0
},
{
"id"
:
251
,
"goodsSkuCode"
:
"SKUGLCODE959010599847862272"
,
"brandName"
:
null
,
"goodsSkuName"
:
"测试商品1"
,
"goodsImgUrl"
:
"https://img.yunzhonghe.com/image/1650002967483MFjkVZlvEn.jpg"
,
"goodsStock"
:
null
,
"redeemPoints"
:
100
,
"salePrice"
:
0.00
,
"sellPrice"
:
null
,
"marketPrice"
:
null
,
"firstCategoryName"
:
null
,
"secondCategoryName"
:
null
,
"lastCategoryName"
:
null
,
"shelvesStatus"
:
1001
,
"saleDate"
:
1755568022000
,
"saleFlag"
:
1
,
"saleAmount"
:
0
,
"fronCategoryId"
:
null
,
"fronCategoryName"
:
null
,
"pageView"
:
null
,
"visitorCount"
:
0
,
"goodsSource"
:
2
,
"minGoodsStock"
:
4
,
"minSalePrice"
:
10
,
"maxSalePrice"
:
10
,
"maxGoodsStock"
:
7
}
]
},
},
/**
/**
...
@@ -87,7 +30,7 @@ Page({
...
@@ -87,7 +30,7 @@ Page({
let
value
=
e
.
detail
let
value
=
e
.
detail
let
{
userInfo
}
=
this
.
data
let
{
userInfo
}
=
this
.
data
const
PARAMS
=
{
const
PARAMS
=
{
goodsId
:
value
.
i
d
,
goodsId
:
value
.
goodsI
d
,
sellQty
:
1
,
sellQty
:
1
,
goodsSource
:
value
.
goodsSource
,
goodsSource
:
value
.
goodsSource
,
scoreSource
:
userInfo
?.
channelSource
,
scoreSource
:
userInfo
?.
channelSource
,
...
...
packageIndex/pages/SpecialSale/SpecialSale.wxml
View file @
d281472
<!--packageIndex/pages/SpecialSale/SpecialSale.wxml-->
<!--packageIndex/pages/SpecialSale/SpecialSale.wxml-->
<navigation-bar page-title="专场" navStyle="{{navStyle}}" showBack="{{true}}">
<navigation-bar page-title="专场" navStyle="{{navStyle}}" showBack="{{true}}">
<view class="page-title">{{pageParams.
sale
Name}}</view>
<view class="page-title">{{pageParams.
event
Name}}</view>
</navigation-bar>
</navigation-bar>
<block wx:if="{{navHeight}}">
<block wx:if="{{navHeight}}">
<view class="container" style="height: calc(100vh - {{navHeight}}px);margin-top: {{navHeight}}px;">
<view class="container" style="height: calc(100vh - {{navHeight}}px);margin-top: {{navHeight}}px;">
<view class="special-image">
<view class="special-image">
<glsx-image src="{{pageParams.
url
}}"></glsx-image>
<glsx-image src="{{pageParams.
bannerImage
}}"></glsx-image>
</view>
</view>
<view class="goods-content">
<view class="goods-content">
<view class="goods-content-top"></view>
<view class="goods-content-top"></view>
<view class="goods-box">
<view class="goods-box">
<goods list="{{
g
oodsList}}" bindjoin="handleAddToCart"></goods>
<goods list="{{
pageParams.specialEventG
oodsList}}" bindjoin="handleAddToCart"></goods>
</view>
</view>
</view>
</view>
</view>
</view>
...
...
packageIndex/pages/confirmOrder/index.js
View file @
d281472
import
homeApi
from
'~/api/module/home.js'
import
homeApi
from
'~/api/module/home.js'
import
commonApi
from
'~/api/module/common.js'
import
commonApi
from
'~/api/module/common.js'
import
mineApi
from
'~/api/module/mine.js'
import
NP
from
'number-precision'
import
NP
from
'number-precision'
Page
({
Page
({
/**
/**
...
@@ -51,7 +52,7 @@ Page({
...
@@ -51,7 +52,7 @@ Page({
goodsId
:
val
.
id
,
goodsId
:
val
.
id
,
sellQty
:
val
?.
sellQty
,
sellQty
:
val
?.
sellQty
,
specificationData
:
val
?.
specificationData
,
specificationData
:
val
?.
specificationData
,
goodsSkuCode
:
val
.
goodsS
ource
==
1
?
val
.
goodsSkuCode
:
''
,
goodsSkuCode
:
val
.
goodsS
kuCode
,
goodsSource
:
val
.
goodsSource
goodsSource
:
val
.
goodsSource
})
})
})
})
...
@@ -136,47 +137,15 @@ Page({
...
@@ -136,47 +137,15 @@ Page({
padding_bottom
:
e
.
detail
padding_bottom
:
e
.
detail
})
})
},
},
jump
()
{
// 显示地址选择弹窗
wx
.
p
.
router
.
go
(
'/packageMine/pages/address/index/index'
,
{
toShowAddressModal
()
{
isChooseAddress
:
true
,
this
.
setData
({
platform
:
this
.
data
.
platformShop
showAddress
:
true
})
})
},
},
getAddressList
()
{
getAddressList
()
{
let
{
goodsInfo
}
=
this
.
data
let
{
goodsInfo
}
=
this
.
data
let
res
=
[{
mineApi
.
getCustomerAddressList
().
then
(
res
=>
{
"userId"
:
91713345
,
"cityId"
:
null
,
"areaId"
:
440305
,
"createTime"
:
1755922362000
,
"provinceId"
:
null
,
"cityName"
:
"深圳市"
,
"countyName"
:
"南山区"
,
"postCode"
:
"518000"
,
"receiveName"
:
"qw"
,
"provinceName"
:
"广东省"
,
"address"
:
"广东省深圳市南山区南山街道学府路30号"
,
"updateTime"
:
null
,
"isDefault"
:
0
,
"receiveMobile"
:
"18555558878"
,
"id"
:
58
},
{
"userId"
:
91713345
,
"cityId"
:
null
,
"areaId"
:
440305
,
"createTime"
:
1755922362000
,
"provinceId"
:
null
,
"cityName"
:
"深圳市"
,
"countyName"
:
"南山区"
,
"postCode"
:
"518000"
,
"receiveName"
:
"qw222"
,
"provinceName"
:
"广东省"
,
"address"
:
"广东省深圳市南山区南山街道学府路30号"
,
"updateTime"
:
null
,
"isDefault"
:
1
,
"receiveMobile"
:
"18555558878"
,
"id"
:
59
}]
let
obj
=
{}
let
obj
=
{}
res
?.
forEach
(
val
=>
{
res
?.
forEach
(
val
=>
{
if
((
!
goodsInfo
?.
defaultAddress
&&
val
.
isDefault
==
1
)
||
if
((
!
goodsInfo
?.
defaultAddress
&&
val
.
isDefault
==
1
)
||
...
@@ -191,7 +160,21 @@ Page({
...
@@ -191,7 +160,21 @@ Page({
})
})
this
.
setData
({
this
.
setData
({
contactInfo
:
obj
,
contactInfo
:
obj
,
isDefault
:
obj
?.
isDefault
==
1
isDefault
:
obj
?.
isDefault
==
1
,
addressList
:
res
||
[]
})
})
},
// 地址选择确定
getAddress
(
e
)
{
this
.
setData
({
contactInfo
:
{
...
e
.
detail
.
defaultAddress
,
contactName
:
e
.
detail
.
defaultAddress
.
receiveName
,
contactPhone
:
e
.
detail
.
defaultAddress
.
receiveMobile
,
contactAddress
:
e
.
detail
.
contactAddress
},
isDefault
:
e
.
detail
.
defaultAddress
?.
isDefault
})
})
},
},
/**
/**
...
...
packageIndex/pages/confirmOrder/index.json
View file @
d281472
{
{
"navigationBarTitleText"
:
"确认订单"
,
"navigationBarTitleText"
:
"确认订单"
,
"usingComponents"
:
{
"usingComponents"
:
{
"stepper"
:
"/components/Stepper/Stepper"
"stepper"
:
"/components/Stepper/Stepper"
,
"address"
:
"/components/Adress/index"
}
}
}
}
\ No newline at end of file
\ No newline at end of file
packageIndex/pages/confirmOrder/index.wxml
View file @
d281472
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<block wx:if="{{shopFlag && shopCartFlag}}">
<block wx:if="{{shopFlag && shopCartFlag}}">
<view class="address-box">
<view class="address-box">
<view class="ad-title">快递配送</view>
<view class="ad-title">快递配送</view>
<view class="ad-box" bindtap="
jump
">
<view class="ad-box" bindtap="
toShowAddressModal
">
<block wx:if="{{contactInfo.contactAddress}}">
<block wx:if="{{contactInfo.contactAddress}}">
<view class="left">
<view class="left">
<view class="top">
<view class="top">
...
@@ -95,6 +95,7 @@
...
@@ -95,6 +95,7 @@
</view>
</view>
</goods-action>
</goods-action>
</block>
</block>
<address address="{{addressList}}" defaultAddress="{{contactInfo}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" title="积分兑换">
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" title="积分兑换">
<view class="suggest-box">
<view class="suggest-box">
<view>您当前总积分为<text>{{walletObj.currentScore}}</text>积分</view>
<view>您当前总积分为<text>{{walletObj.currentScore}}</text>积分</view>
...
...
packageIndex/pages/goodsDetail/index.js
View file @
d281472
...
@@ -21,23 +21,7 @@ Page({
...
@@ -21,23 +21,7 @@ Page({
payWayActions
:
[{
name
:
'金额支付'
,
type
:
1
,
disabled
:
false
},
{
name
:
'积分兑换'
,
type
:
2
,
disabled
:
false
}],
payWayActions
:
[{
name
:
'金额支付'
,
type
:
1
,
disabled
:
false
},
{
name
:
'积分兑换'
,
type
:
2
,
disabled
:
false
}],
detailInfo
:
{},
detailInfo
:
{},
eventFlag
:
false
,
eventFlag
:
false
,
addressList
:
[{
addressList
:
[],
"userId"
:
91713345
,
"cityId"
:
null
,
"areaId"
:
440305
,
"createTime"
:
1755922362000
,
"provinceId"
:
null
,
"cityName"
:
"深圳市"
,
"countyName"
:
"南山区"
,
"postCode"
:
"518000"
,
"receiveName"
:
"qw"
,
"provinceName"
:
"广东省"
,
"address"
:
"广东省深圳市南山区南山街道学府路30号"
,
"updateTime"
:
null
,
"isDefault"
:
1
,
"phoneNumber"
:
"18555558878"
,
"id"
:
58
}],
defaultAddress
:
{}
defaultAddress
:
{}
},
},
appHide
()
{
appHide
()
{
...
@@ -120,30 +104,8 @@ Page({
...
@@ -120,30 +104,8 @@ Page({
},
},
// 获取默认的地址
// 获取默认的地址
getPlatFormAddress
()
{
getPlatFormAddress
()
{
let
res
=
this
.
data
.
addressList
let
_isSetDefault
=
false
,
contactAddress
=
''
,
defaultAddress
=
{}
if
(
res
&&
res
.
length
)
{
res
.
forEach
(
el
=>
{
if
(
el
.
isDefault
==
1
)
{
contactAddress
=
el
.
provinceName
+
el
.
cityName
+
el
.
countyName
+
el
.
address
,
defaultAddress
=
el
_isSetDefault
=
true
}
})
if
(
!
_isSetDefault
)
{
let
_first
=
res
[
0
]
||
{}
contactAddress
=
_first
.
provinceName
+
_first
.
cityName
+
_first
.
countyName
+
_first
.
address
,
defaultAddress
=
_first
}
}
this
.
setData
({
addressList
:
res
||
[],
contactAddress
,
defaultAddress
})
return
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
mineApi
.
platformAddressList
({}
).
then
(
res
=>
{
mineApi
.
getCustomerAddressList
(
).
then
(
res
=>
{
wx
.
hideLoading
()
wx
.
hideLoading
()
let
_isSetDefault
=
false
,
contactAddress
=
''
,
defaultAddress
=
{}
let
_isSetDefault
=
false
,
contactAddress
=
''
,
defaultAddress
=
{}
if
(
res
&&
res
.
length
)
{
if
(
res
&&
res
.
length
)
{
...
@@ -165,7 +127,6 @@ Page({
...
@@ -165,7 +127,6 @@ Page({
contactAddress
,
contactAddress
,
defaultAddress
defaultAddress
})
})
console
.
log
(
defaultAddress
,
'222'
)
})
})
},
},
// 显示地址选择弹窗
// 显示地址选择弹窗
...
@@ -206,7 +167,6 @@ Page({
...
@@ -206,7 +167,6 @@ Page({
}
}
if
(
res
&&
res
.
platformGlGoodsSpecifications
?.
length
)
{
if
(
res
&&
res
.
platformGlGoodsSpecifications
?.
length
)
{
let
item
=
res
.
platformGlGoodsSpecifications
[
0
]
||
{}
let
item
=
res
.
platformGlGoodsSpecifications
[
0
]
||
{}
res
.
redeemPoints
=
item
.
retailPrice
res
.
goodsStock
=
item
.
stock
res
.
goodsStock
=
item
.
stock
res
.
saleAmount
=
item
.
saleAmount
res
.
saleAmount
=
item
.
saleAmount
res
.
specificationData
=
item
.
specificationData
res
.
specificationData
=
item
.
specificationData
...
...
packageMine/pages/address/detail/components/AreaSelect/index.js
0 → 100644
View file @
d281472
// packageEquity/pages/serviceApply/util/components/areaSelect.js
Component
({
/**
* 组件的属性列表
*/
properties
:
{
provinceShow
:
Boolean
,
provinceList
:{
type
:
Array
,
observer
:
function
(
val
)
{
this
.
setData
({
provinceList
:
val
})
}
}
},
/**
* 组件的初始数据
*/
data
:
{
region
:
[
0
,
0
,
0
],
//地址每列的index
regionCode
:
[],
provinceList
:
[]
},
/**
* 组件的方法列表
*/
methods
:
{
emitHideRegion
(){},
// 省市切换
bindChange
(
e
)
{
// 用于对比滑动的是哪一列数据
const
val
=
e
.
detail
.
value
if
(
this
.
data
.
region
[
0
]
!==
val
[
0
])
{
// 如果滑动的是第一列数据,让二三列恢复到0
this
.
setData
({
region
:
[
val
[
0
],
0
,
0
]
})
}
else
if
(
this
.
data
.
region
[
1
]
!==
val
[
1
])
{
// 滑动的是第二列数据
this
.
setData
({
region
:
[
val
[
0
],
val
[
1
],
0
]
})
}
else
{
this
.
setData
({
region
:
e
.
detail
.
value
})
}
},
// 确定提交
comfirm
()
{
const
{
provinceList
,
region
}
=
this
.
data
// 省市code
const
provinceCode
=
provinceList
[
region
[
0
]].
addressCode
const
cityCode
=
provinceList
[
region
[
0
]].
children
[
region
[
1
]].
addressCode
const
townCode
=
provinceList
[
region
[
0
]].
children
[
region
[
1
]].
children
[
region
[
2
]].
addressCode
const
codeData
=
[
provinceCode
,
cityCode
,
townCode
]
// 省市名称
const
provinceName
=
provinceList
[
region
[
0
]].
addressName
const
cityName
=
provinceList
[
region
[
0
]].
children
[
region
[
1
]].
addressName
const
townName
=
provinceList
[
region
[
0
]].
children
[
region
[
1
]].
children
[
region
[
2
]].
addressName
const
provinceNameData
=
[
provinceName
,
cityName
,
townName
]
this
.
triggerEvent
(
'getProvinceCode'
,{
codeData
,
provinceNameData
})
this
.
triggerEvent
(
'cancelProvince'
)
},
// 取消
cancel
()
{
this
.
triggerEvent
(
'cancelProvince'
)
}
}
})
packageMine/pages/address/detail/components/AreaSelect/index.json
0 → 100644
View file @
d281472
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
\ No newline at end of file
packageMine/pages/address/detail/components/AreaSelect/index.scss
0 → 100644
View file @
d281472
.dialog_mask
{
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
z-index
:
10
;
background
:
rgba
(
0
,
0
,
0
,
0
.5
);
}
.dialog_container
{
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
0
;
width
:
100%
;
height
:
70%
;
background
:
white
;
border-radius
:
40rpx
40rpx
0
0
;
box-shadow
:
0px
-2rpx
4rpx
0px
rgba
(
0
,
0
,
0
,
0
.06
);
z-index
:
9999
;
}
.header
{
height
:
112rpx
;
box-sizing
:
border-box
;
padding
:
0
32rpx
;
}
.header
.cancle
{
font-size
:
28rpx
;
font-weight
:
500
;
color
:
#969799
;
}
.header
.title
{
font-size
:
32rpx
;
font-weight
:
500
;
color
:
#323233
;
}
.header
.comfirm
{
font-size
:
28rpx
;
font-weight
:
500
;
color
:
#FC5B32
;
}
.main
{
height
:
calc
(
100%
-
112rpx
);
box-sizing
:
border-box
;
padding
:
0
32rpx
;
}
.flex_scb
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
\ No newline at end of file
\ No newline at end of file
packageMine/pages/address/detail/components/AreaSelect/index.wxml
0 → 100644
View file @
d281472
<view wx:if="{{provinceShow}}" class="dialog_mask {{provinceShow?'dialog_show':''}}">
<view class="dialog_mask" bindtap="cancel"></view>
<view class="dialog_container">
<view class="header flex_scb">
<view class="cancle" bindtap="cancel">取消</view>
<view class="title">城市地区</view>
<view class="comfirm" bindtap="comfirm">确定</view>
</view>
<view class="main">
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 100%;" value="{{region}}" bindchange="bindChange">
<picker-view-column>
<view wx:for="{{provinceList}}" wx:key="{{item.addressCode}}" style="line-height: 50px; text-align: center;">
{{item.addressName}}
</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{provinceList[region[0]].children}}" wx:key="{{item.addressCode}}" style="line-height: 50px; text-align: center;">
{{item.addressName}}
</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{provinceList[region[0]].children[region[1]].children}}" wx:key="{{item.addressCode}}" style="line-height: 50px; text-align: center;">
{{item.addressName}}
</view>
</picker-view-column>
</picker-view>
</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
packageMine/pages/address/detail/detail.js
View file @
d281472
...
@@ -8,8 +8,7 @@ Page({
...
@@ -8,8 +8,7 @@ Page({
data
:
{
data
:
{
userObj
:
{
userObj
:
{
receiveName
:
""
,
receiveName
:
""
,
phoneNumber
:
""
,
receiveMobile
:
""
,
region
:
[],
address
:
""
,
address
:
""
,
isDefault
:
0
,
isDefault
:
0
,
platformObj
:
{},
platformObj
:
{},
...
@@ -17,40 +16,68 @@ Page({
...
@@ -17,40 +16,68 @@ Page({
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
wx
.
p
.
router
.
getRouterParams
(
options
).
then
((
params
)
=>
{
wx
.
p
.
router
.
getRouterParams
(
options
).
then
((
params
)
=>
{
const
{
id
,
is
ChooseAddress
,
is
Default
}
=
params
;
const
{
id
,
isDefault
}
=
params
;
if
(
id
)
{
if
(
id
)
{
wx
.
setNavigationBarTitle
({
wx
.
setNavigationBarTitle
({
title
:
"编辑收货地址"
,
title
:
"编辑收货地址"
,
});
});
wx
.
p
.
api
.
mineApi
.
get
UserAddress
(
params
).
then
((
data
)
=>
{
wx
.
p
.
api
.
mineApi
.
get
CustomerAddressList
({
id
:
params
.
id
}).
then
((
res
)
=>
{
data
=
wx
.
p
.
util
.
clearObjNull
(
data
);
let
data
=
res
[
0
]
||
{}
data
.
region
=
[
data
.
province
,
data
.
city
,
data
.
area
];
data
=
wx
.
p
.
util
.
clearObjNull
(
data
)
this
.
setData
({
this
.
setData
({
userObj
:
data
,
userObj
:
data
,
});
})
this
.
platformAddressShowInfo
(
data
)
});
});
}
}
this
.
setData
({
isChooseAddress
,
});
if
(
isDefault
)
{
if
(
isDefault
)
{
this
.
setData
({
this
.
setData
({
"userObj.isDefault"
:
1
,
"userObj.isDefault"
:
1
,
});
});
}
}
this
.
getBaseData
()
});
});
},
},
platformAddressShowInfo
(
item
){
const
ADDRESS
=
`
${
item
.
provinceName
}
-
${
item
.
cityName
}
-
${
item
.
countyName
}
`
this
.
setData
({
'userObj.receiveName'
:
item
.
receiveName
,
'userObj.receiveMobile'
:
item
.
receiveMobile
,
'userObj.address'
:
item
.
address
,
'platformObj.code[0]'
:
item
.
provinceId
,
'platformObj.name[0]'
:
item
.
provinceName
,
'platformObj.code[1]'
:
item
.
cityId
,
'platformObj.name[1]'
:
item
.
cityName
,
'platformObj.code[2]'
:
item
.
countyId
,
'platformObj.name[2]'
:
item
.
countyName
,
'platformObj.address'
:
ADDRESS
,
'platformObj.id'
:
item
.
id
,
'userObj.isDefault'
:
item
.
isDefault
,
})
},
useLocation
()
{
useLocation
()
{
let
{
let
{
currentAddress
:
{
formatted_addresses
,
address_component
,
ad_info
},
currentAddress
:
{
formatted_addresses
,
address_component
,
ad_info
},
areaCode
}
=
this
.
data
;
}
=
this
.
data
;
const
provinceNameData
=
[
ad_info
.
province
,
ad_info
.
city
,
ad_info
.
district
]
const
provinceCode
=
areaCode
?.
find
(
val
=>
ad_info
.
province
?.
includes
(
val
.
addressName
))?.
addressCode
const
cityCode
=
areaCode
.
map
(
val
=>
val
.
children
?.
find
(
v
=>
ad_info
.
city
?.
includes
(
v
.
addressName
))?.
addressCode
).
filter
(
code
=>
code
)[
0
]
const
townCode
=
areaCode
.
map
(
val
=>
val
.
children
?.
map
(
v
=>
v
.
children
?.
find
(
d
=>
ad_info
.
district
?.
includes
(
d
.
addressName
))?.
addressCode
)
).
flat
().
filter
(
code
=>
code
)[
0
];
const
codeData
=
[
provinceCode
,
cityCode
,
townCode
]
let
detail
=
{
provinceNameData
,
codeData
}
this
.
getProvinceCode
({
detail
})
this
.
setData
({
this
.
setData
({
"userObj.address"
:
formatted_addresses
.
recommend
,
"userObj.address"
:
formatted_addresses
.
recommend
,
"userObj.region"
:
[
address_component
.
province
,
address_component
.
city
,
address_component
.
district
,
],
"userObj.areaId"
:
ad_info
.
adcode
,
"userObj.areaId"
:
ad_info
.
adcode
,
});
});
},
},
...
@@ -95,6 +122,60 @@ Page({
...
@@ -95,6 +122,60 @@ Page({
authSuccess
()
{
authSuccess
()
{
this
.
getLocation
();
this
.
getLocation
();
},
},
getBaseData
()
{
wx
.
p
.
api
.
mineApi
.
getBaseAddress
().
then
(
res
=>
{
this
.
setData
({
areaCode
:
this
.
areaTree
(
res
)
})
})
},
// 省市区转数型
areaTree
(
items
)
{
// items = items.slice(0,50)
let
res
=
[]
// 存放结果集
let
map
=
{}
// 判断对象是否有某个属性
let
getHasOwnProperty
=
(
obj
,
property
)
=>
Object
.
prototype
.
hasOwnProperty
.
call
(
obj
,
property
)
// 边做map存储,边找对应关系
for
(
const
i
of
items
)
{
map
[
i
.
addressCode
]
=
{
...
i
,
children
:
getHasOwnProperty
(
map
,
i
.
addressCode
)
?
map
[
i
.
addressCode
].
children
:
[]
}
const
newItem
=
map
[
i
.
addressCode
]
if
(
i
.
parentAddressCode
==
0
)
{
res
.
push
(
newItem
)
}
else
{
if
(
!
getHasOwnProperty
(
map
,
i
.
parentAddressCode
))
{
map
[
i
.
parentAddressCode
]
=
{
children
:
[]
}
}
map
[
i
.
parentAddressCode
].
children
.
push
(
newItem
)
}
}
return
res
},
showSelect
(){
this
.
setData
({
showAreaSelect
:
true
})
},
cancelProvince
(){
this
.
setData
({
showAreaSelect
:
false
})
},
getProvinceCode
(
e
){
let
address
=
e
.
detail
.
provinceNameData
.
toString
()
address
=
address
.
replace
(
/,/g
,
"-"
)
this
.
setData
({
'platformObj.code'
:
e
.
detail
.
codeData
,
"platformObj.address"
:
address
,
"platformObj.name"
:
e
.
detail
.
provinceNameData
,
})
},
input
(
e
)
{
input
(
e
)
{
let
{
target
}
=
e
.
currentTarget
.
dataset
;
let
{
target
}
=
e
.
currentTarget
.
dataset
;
let
{
value
}
=
e
.
detail
;
let
{
value
}
=
e
.
detail
;
...
@@ -109,69 +190,44 @@ Page({
...
@@ -109,69 +190,44 @@ Page({
});
});
},
},
save
()
{
save
()
{
let
{
userObj
,
isChooseAddress
}
=
this
.
data
;
let
{
userObj
,
platformObj
}
=
this
.
data
;
try
{
try
{
Object
.
keys
(
userObj
).
map
((
key
)
=>
{
Object
.
keys
(
userObj
).
map
((
key
)
=>
{
if
(
key
==
"receiveName"
&&
!
userObj
[
key
])
throw
"请输入姓名"
;
if
(
key
==
"receiveName"
&&
!
userObj
[
key
])
throw
"请输入姓名"
;
if
(
key
==
"
phoneNumber
"
)
{
if
(
key
==
"
receiveMobile
"
)
{
if
(
!
userObj
[
key
])
throw
"请输入手机号"
;
if
(
!
userObj
[
key
])
throw
"请输入手机号"
;
if
(
!
phoneRex
.
test
(
userObj
[
key
]))
throw
"请输入正确的手机号"
;
if
(
!
phoneRex
.
test
(
userObj
[
key
]))
throw
"请输入正确的手机号"
;
}
}
if
(
Array
.
isArray
(
userObj
[
key
])
&&
!
userObj
[
key
].
length
)
throw
"请选择省市区"
;
if
(
key
==
"address"
&&
!
userObj
[
key
])
throw
"请填写详细地址"
;
if
(
key
==
"address"
&&
!
userObj
[
key
])
throw
"请填写详细地址"
;
});
});
if
(
!
platformObj
){
throw
'请选择所在地区'
}
}
catch
(
error
)
{
}
catch
(
error
)
{
wx
.
p
.
wxApi
.
showToast
(
error
);
wx
.
p
.
wxApi
.
showToast
(
error
);
return
;
return
;
}
}
let
[
province
,
city
,
area
]
=
userObj
.
region
;
let
_params
=
{
let
obj
=
{
receiveName
:
userObj
.
receiveName
,
...
userObj
,
receiveMobile
:
userObj
.
receiveMobile
,
province
,
address
:
userObj
.
address
,
city
,
provinceId
:
platformObj
.
code
[
0
],
area
,
provinceName
:
platformObj
.
name
[
0
],
};
cityId
:
platformObj
.
code
[
1
],
delete
obj
.
region
;
cityName
:
platformObj
.
name
[
1
],
let
target
=
obj
.
id
?
"updateUserAddress"
:
"addUserAddress"
;
countyId
:
platformObj
.
code
[
2
],
if
(
obj
.
id
)
{
countyName
:
platformObj
.
name
[
2
],
delete
obj
.
userId
;
isDefault
:
userObj
.
isDefault
,
delete
obj
.
createTime
;
delete
obj
.
updateTime
;
}
}
console
.
log
(
obj
,
'==='
)
if
(
userObj
?.
id
)
{
wx
.
p
.
api
.
mineApi
[
target
](
obj
).
then
(()
=>
{
_params
.
id
=
userObj
.
id
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
setTimeout
(()
=>
{
if
(
isChooseAddress
)
{
wx
.
p
.
router
.
back
((
page
)
=>
{
let
contactAddress
=
`
${
province
}${
city
}${
area
}${
userObj
.
address
}
`
;
page
.
setData
({
contactAddress
,
contactInfo
:
{
contactAddress
,
contactName
:
userObj
.
receiveName
,
contactPhone
:
userObj
.
phoneNumber
,
},
});
},
2
);
}
else
{
wx
.
p
.
router
.
back
();
}
}
},
1.5e3
);
wx
.
p
.
api
.
mineApi
.
saveAddress
(
_params
).
then
(()
=>
{
});
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
},
wx
.
p
.
router
.
back
(
page
=>
{
/**选择地区 */
wx
.
p
.
eventbus
.
emit
(
'REFRESH_PLATFORM_ADDRESS'
)
chooseArea
(
e
)
{
})
let
{
value
,
code
}
=
e
.
detail
;
})
let
{
userObj
}
=
this
.
data
;
userObj
.
region
=
[
value
[
0
],
value
[
1
],
value
[
2
]];
userObj
.
provinceId
=
code
[
0
];
userObj
.
cityId
=
code
[
1
];
userObj
.
areaId
=
code
[
2
];
this
.
setData
({
userObj
,
});
},
},
setDefault
()
{
setDefault
()
{
this
.
setData
({
this
.
setData
({
...
...
packageMine/pages/address/detail/detail.json
View file @
d281472
{
{
"navigationBarTitleText"
:
"新建收货地址"
,
"navigationBarTitleText"
:
"新建收货地址"
,
"usingComponents"
:{
"usingComponents"
:{
"gl-textarea"
:
"/components/GlTextarea/GlTextarea"
"gl-textarea"
:
"/components/GlTextarea/GlTextarea"
,
"area-select"
:
"./components/AreaSelect/index"
}
}
}
}
\ No newline at end of file
\ No newline at end of file
packageMine/pages/address/detail/detail.wxml
View file @
d281472
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<block wx:else>
<block wx:else>
<view class="address-box">
<view class="address-box">
<view class="address-icon y-center">
<view class="address-icon y-center">
<glsx-image src="mine/location.png"></glsx-image>
<glsx-image src="
/
mine/location.png"></glsx-image>
</view>
</view>
<view class="address-info">
<view class="address-info">
<view class="address-title text-hide">
<view class="address-title text-hide">
...
@@ -33,21 +33,18 @@
...
@@ -33,21 +33,18 @@
<view class="item">
<view class="item">
<view class="label">手机号码</view>
<view class="label">手机号码</view>
<view class="value">
<view class="value">
<input bindblur="input" data-target="
phoneNumber" value="{{userObj.phoneNumber
}}" type="number" maxlength="11" placeholder="请填写收货人手机号" placeholder-style="color:#B1B1B3;" />
<input bindblur="input" data-target="
receiveMobile" value="{{userObj.receiveMobile
}}" type="number" maxlength="11" placeholder="请填写收货人手机号" placeholder-style="color:#B1B1B3;" />
</view>
</view>
</view>
</view>
<picker value="{{userObj.region}}" mode="region" bindchange="chooseArea">
<view class="item" bindtap="showSelect">
<view class="item">
<view class="label">所在地区</view>
<view class="label">所在地区</view>
<view class="value " style="color:{{userObj.region.length?'':'#B1B1B3'}}">
<view class="value " style="color:{{platformObj.address?'':'#B1B1B3'}}">
{{userObj.region[0]}}
<block wx:if="{{platformObj.address}}">
<block wx:if="{{userObj.region.length}}">
{{platformObj.address}}
{{userObj.region[0]}}{{userObj.region[1]}}{{userObj.region[2]}}
</block>
</block>
<block wx:else>请选择省/市/区</block>
<block wx:else>请选择省/市/区</block>
</view>
</view>
</view>
</view>
</picker>
<view class="item textarea">
<view class="item textarea">
<view class="label">详细地址</view>
<view class="label">详细地址</view>
<view class="value">
<view class="value">
...
@@ -70,4 +67,5 @@
...
@@ -70,4 +67,5 @@
</view>
</view>
</view>
</view>
<authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file
\ No newline at end of file
<area-select provinceShow="{{showAreaSelect}}" provinceList="{{areaCode}}" bind:cancelProvince="cancelProvince" bind:getProvinceCode="getProvinceCode"></area-select>
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file
\ No newline at end of file
packageMine/pages/address/index/index.js
View file @
d281472
...
@@ -41,10 +41,6 @@ Page({
...
@@ -41,10 +41,6 @@ Page({
isDefault
:
item
.
isDefault
==
1
,
isDefault
:
item
.
isDefault
==
1
,
});
});
});
});
}
else
{
wx
.
p
.
router
.
go
(
"/packageMine/pages/address/detail/detail"
,
{
id
:
item
.
id
,
});
}
}
},
},
getUserAddressList
(
showTips
=
""
)
{
getUserAddressList
(
showTips
=
""
)
{
...
@@ -52,7 +48,7 @@ Page({
...
@@ -52,7 +48,7 @@ Page({
this
.
setData
({
this
.
setData
({
addressList
:
[],
addressList
:
[],
});
});
wx
.
p
.
api
.
mineApi
.
get
Us
erAddressList
().
then
((
data
)
=>
{
wx
.
p
.
api
.
mineApi
.
get
Custom
erAddressList
().
then
((
data
)
=>
{
this
.
setData
({
this
.
setData
({
addressList
:
data
,
addressList
:
data
,
});
});
...
@@ -66,10 +62,12 @@ Page({
...
@@ -66,10 +62,12 @@ Page({
item
,
item
,
}
=
e
.
currentTarget
.
dataset
;
}
=
e
.
currentTarget
.
dataset
;
if
(
isDefault
!=
0
)
return
;
if
(
isDefault
!=
0
)
return
;
let
params
=
{
...
item
,
isDefault
:
1
}
wx
.
p
.
api
.
mineApi
wx
.
p
.
api
.
mineApi
.
setUserAddressDefault
({
.
saveAddress
(
params
)
id
,
})
.
then
(()
=>
{
.
then
(()
=>
{
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
wx
.
p
.
wxApi
.
showToast
(
"操作成功"
);
let
{
isChooseAddress
}
=
this
.
data
;
let
{
isChooseAddress
}
=
this
.
data
;
...
@@ -102,8 +100,8 @@ Page({
...
@@ -102,8 +100,8 @@ Page({
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
wx
.
p
.
api
.
mineApi
wx
.
p
.
api
.
mineApi
.
delUser
Address
({
.
remove
Address
({
id
,
id
})
})
.
then
(()
=>
{
.
then
(()
=>
{
wx
.
p
.
wxApi
.
showToast
(
"删除成功"
);
wx
.
p
.
wxApi
.
showToast
(
"删除成功"
);
...
...
packageMine/pages/address/index/index.scss
View file @
d281472
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
}
}
.address-item
.top
{
.address-item
.top
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
padding-top
:
34rpx
;
padding-top
:
34rpx
;
justify-content
:
space-between
;
justify-content
:
space-between
;
}
}
...
@@ -37,8 +36,11 @@
...
@@ -37,8 +36,11 @@
font-weight
:
400
;
font-weight
:
400
;
}
}
.address-item
.top
.icon-box
{
.address-item
.top
.icon-box
{
width
:
70rpx
;
height
:
40rpx
;
min-height
:
154rpx
;
.icon-address-edit
{
width
:
40rpx
;
height
:
40rpx
;
}
}
}
.address-item
.top
.icon
{
.address-item
.top
.icon
{
width
:
var
(
--
margin
);
width
:
var
(
--
margin
);
...
...
packageMine/pages/address/index/index.wxml
View file @
d281472
...
@@ -11,8 +11,10 @@
...
@@ -11,8 +11,10 @@
<view wx:if="{{platform}}" class="address">{{item.provinceName}}{{item.cityName}}{{item.countyName}}{{item.address}}</view>
<view wx:if="{{platform}}" class="address">{{item.provinceName}}{{item.cityName}}{{item.countyName}}{{item.address}}</view>
</view>
</view>
<block wx:if="{{!isChooseAddress}}">
<block wx:if="{{!isChooseAddress}}">
<view class="icon-box text-center" catchtap="jump" data-item="{{item}}" data-edit data-id="{{item.id}}">
<view class="icon-box" catchtap="jump" data-item="{{item}}" data-edit data-id="{{item.id}}">
<view class="sprite-icon icon-address-edit"></view>
<view class="sprite-icon icon-address-edit">
<glsx-image src="/mine/edit-address.png"></glsx-image>
</view>
</view>
</view>
</block>
</block>
</view>
</view>
...
...
pages/tab/index/index.js
View file @
d281472
...
@@ -11,15 +11,7 @@ Page({
...
@@ -11,15 +11,7 @@ Page({
animationData
:
{},
animationData
:
{},
bannerUrl
:
''
,
bannerUrl
:
''
,
walletObj
:
{},
walletObj
:
{},
specialSaleArr
:
[{
specialSaleArr
:
[],
id
:
1
,
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/index-bg.png'
,
saleName
:
'九阳专场'
},
{
id
:
2
,
url
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-bg.png'
,
saleName
:
'维达专场'
}],
tab
:
[{
tab
:
[{
id
:
'1'
,
id
:
'1'
,
label
:
'我能兑换'
label
:
'我能兑换'
...
@@ -94,7 +86,7 @@ Page({
...
@@ -94,7 +86,7 @@ Page({
onLoad
(
options
)
{
onLoad
(
options
)
{
const
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
const
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
this
.
setData
({
userInfo
})
this
.
setData
({
userInfo
})
//
this.getHomeData()
this
.
getHomeData
()
wx
.
p
.
router
.
getRouterParams
(
options
).
then
(
params
=>
{
wx
.
p
.
router
.
getRouterParams
(
options
).
then
(
params
=>
{
this
.
setData
({
loginPageFlag
:
params
?.
loginPageFlag
},
()
=>
{
this
.
setData
({
loginPageFlag
:
params
?.
loginPageFlag
},
()
=>
{
this
.
getPointsWallet
()
this
.
getPointsWallet
()
...
@@ -108,15 +100,17 @@ Page({
...
@@ -108,15 +100,17 @@ Page({
// 获取积分商城配置
// 获取积分商城配置
getHomeData
()
{
getHomeData
()
{
homeApi
.
getHomeConfigData
({}).
then
(
res
=>
{
homeApi
.
getHomeConfigData
({
miniType
:
1
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
setData
({
bannerUrl
:
res
?.
mallBannerList
[
0
]?.
bannerUrl
,
specialSaleArr
:
res
.
specialEvents
})
})
})
},
},
// 获取积分钱包数据
// 获取积分钱包数据
getPointsWallet
()
{
getPointsWallet
()
{
let
{
loginPageFlag
}
=
this
.
data
let
{
loginPageFlag
,
userInfo
}
=
this
.
data
let
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
// 获取当前积分数量
// 获取当前积分数量
commonApi
.
getPointsSummary
({
staffPhone
:
userInfo
?.
phone
,
channelSource
:
userInfo
?.
channelSource
,
merchantId
:
userInfo
?.
merchantId
}).
then
(
r
=>
{
commonApi
.
getPointsSummary
({
staffPhone
:
userInfo
?.
phone
,
channelSource
:
userInfo
?.
channelSource
,
merchantId
:
userInfo
?.
merchantId
}).
then
(
r
=>
{
if
(
r
?.
code
==
0
)
{
if
(
r
?.
code
==
0
)
{
...
@@ -216,7 +210,6 @@ Page({
...
@@ -216,7 +210,6 @@ Page({
},
},
// 跳转专场
// 跳转专场
handleSpecialSale
(
e
)
{
handleSpecialSale
(
e
)
{
console
.
log
(
e
,
2222
)
let
{
target
}
=
e
.
currentTarget
.
dataset
let
{
target
}
=
e
.
currentTarget
.
dataset
wx
.
p
.
router
.
go
(
'/packageIndex/pages/SpecialSale/SpecialSale'
,
target
)
wx
.
p
.
router
.
go
(
'/packageIndex/pages/SpecialSale/SpecialSale'
,
target
)
},
},
...
@@ -292,6 +285,7 @@ Page({
...
@@ -292,6 +285,7 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
this
.
getPointsWallet
()
},
},
/**
/**
...
...
pages/tab/index/index.scss
View file @
d281472
...
@@ -121,15 +121,28 @@ page {
...
@@ -121,15 +121,28 @@ page {
overflow
:
hidden
;
overflow
:
hidden
;
position
:
relative
;
position
:
relative
;
.item-name
{
.item-name
{
width
:
166rpx
;
// width: auto;
height
:
78rpx
;
// height: 78rpx;
// position: absolute;
// padding: 10rpx 20rpx;
// left: 0;
// top: 0;
// background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/special-sale.png') no-repeat;
// background-size: auto 78rpx;
// color: #FFFFFF;
padding
:
10rpx
20rpx
;
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
top
:
0
;
top
:
0
;
background
:
url('https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/special-sale.png')
no-repeat
;
display
:
inline-block
;
background-size
:
166rpx
78rpx
;
font-size
:
24rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
padding
:
10rpx
20rpx
;
background-image
:
linear-gradient
(
134deg
,
#FFB14E
11%
,
#FB8A32
96%
);
border-top-left-radius
:
24rpx
;
/* 左上角圆角 */
border-bottom-right-radius
:
24px
;
/* 右下角圆角 */
border-top-right-radius
:
0
;
/* 右上角无圆角 */
border-bottom-left-radius
:
0
;
/* 左下角无圆角 */
}
}
&
:last-child
{
&
:last-child
{
margin-bottom
:
0
;
margin-bottom
:
0
;
...
...
pages/tab/index/index.wxml
View file @
d281472
...
@@ -35,8 +35,8 @@
...
@@ -35,8 +35,8 @@
<!-- 专场 -->
<!-- 专场 -->
<view class="special-sale-box">
<view class="special-sale-box">
<view class="item" wx:for="{{specialSaleArr}}" wx:key="index" bindtap="handleSpecialSale" data-target="{{item}}">
<view class="item" wx:for="{{specialSaleArr}}" wx:key="index" bindtap="handleSpecialSale" data-target="{{item}}">
<glsx-image src="{{item.
url
}}"></glsx-image>
<glsx-image src="{{item.
entryImage
}}"></glsx-image>
<view class="item-name">{{item.
sale
Name}}</view>
<view class="item-name">{{item.
event
Name}}</view>
</view>
</view>
</view>
</view>
<!-- 商品 -->
<!-- 商品 -->
...
...
pages/tab/mine/index.wxml
View file @
d281472
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</view>
</view>
</view>
</view>
<view class="phone">{{username}}{{userInfo.phone}}</view>
<view class="phone">{{username}}{{userInfo.phone}}</view>
<view class="merchant_box" bindtap="changeMerchant">
<view class="merchant_box" bindtap="changeMerchant"
wx:if="{{userInfo.merchantId != -1}}"
>
<view class="name">{{userInfo.merchantName}}</view>
<view class="name">{{userInfo.merchantName}}</view>
<view class="change_icon">
<view class="change_icon">
<glsx-image src="/mine/change.png"></glsx-image>
<glsx-image src="/mine/change.png"></glsx-image>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment