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 ce4c306c
authored
Aug 22, 2025
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
登录修改,商品修改
1 parent
95344d0c
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
217 additions
and
580 deletions
api/env/index.js
api/module/home.js
api/module/user.js
components/EnableWallet/EnableWallet.js
components/goods/goods.js
components/goods/goods.wxml
packageIndex/pages/goodsDetail/index.js
packageIndex/pages/goodsDetail/index.wxml
packageIndex/pages/selfGoodsDetail/index.js
pages/Login/Login.js
pages/chooseMerchant/index.js
pages/loading/loading.js
pages/tab/index/components/SearchBox/SearchBox.js
pages/tab/index/components/good-tab/good-tab.js
pages/tab/index/index.js
pages/tab/index/index.wxml
pages/tab/mine/index.js
pages/tab/mine/index.scss
pages/tab/mine/index.wxml
project.config.json
api/env/index.js
View file @
ce4c306
...
...
@@ -80,7 +80,7 @@ const secretKey = {
const
domain
=
{
// ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315',
ip
:
'http://192.168.1.1
70
:8315'
,
ip
:
'http://192.168.1.1
17
:8315'
,
/**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */
dev
:
'https://scrm.dev.glsx.com.cn'
,
...
...
api/module/home.js
View file @
ce4c306
import
api
from
'../request/http'
module
.
exports
=
{
/**获取商
户小程序首页配置
*/
get
HomeConfig
(
data
)
{
/**获取商
城首页商品数据
*/
get
GoodsStockroomList
(
data
)
{
return
api
.
post
({
method
:
`scrm.api.shopmall.weapp.homeConfig.getByMerchant`
,
method
:
'scrm.api.shopmall.app.platform.goods.stockroom.page'
,
...
data
})
},
/**
查询当前商户的分类列表
*/
get
ClassifyList
(
data
)
{
/**
获取商品详情
*/
get
GoodsDetailInfo
(
data
)
{
return
api
.
post
({
method
:
`scrm.api.shopmall.classify.weapp.listByMerchantId`
,
method
:
'scrm.api.shopmall.app.stockroom.goods.detail'
,
...
data
})
},
/** 分页查询活动 */
getActivityList
(
data
)
{
return
api
.
post
({
method
:
'scrm.api.shopmall.weapp.activity.page'
,
pageSize
:
10
,
...
data
})
},
}
}
\ No newline at end of file
api/module/user.js
View file @
ce4c306
...
...
@@ -15,7 +15,7 @@ class UsersApi {
const
{
code
}
=
await
this
.
getWxCode
(),
data
=
await
http
.
fetch
(
'scrm.api.sso.weapp.jscode.
l
ogin'
,
{
data
=
await
http
.
fetch
(
'scrm.api.sso.weapp.jscode.
getOpenIdAndL
ogin'
,
{
appId
,
code
,
delSessionId
:
true
...
...
components/EnableWallet/EnableWallet.js
View file @
ce4c306
...
...
@@ -7,16 +7,15 @@ Component({
*/
properties
:
{
show
:
{
type
:
Boolean
},
walletObj
:
{
type
:
Object
,
value
:
{},
type
:
Boolean
,
observer
:
function
(
n
)
{
this
.
setData
({
copyWalletObj
:
JSON
.
parse
(
JSON
.
stringify
(
n
))
copyWalletObj
:
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
walletObj
))
})
}
},
walletObj
:
{
type
:
Object
}
},
...
...
components/goods/goods.js
View file @
ce4c306
...
...
@@ -39,7 +39,8 @@ Component({
let
{
target
}
=
e
.
currentTarget
.
dataset
// 自营商品与云中鹤商品数据不同
let
url
=
target
?.
goodsSource
==
1
?
'/packageIndex/pages/goodsDetail/index'
:
'/packageIndex/pages/selfGoodsDetail/index'
wx
.
p
.
router
.
go
(
url
,
target
)
// wx.p.router.go(url, target)
wx
.
p
.
router
.
go
(
'/packageIndex/pages/goodsDetail/index'
,
target
)
},
joinCart
(
e
)
{
this
.
handleSale
(
e
)
...
...
components/goods/goods.wxml
View file @
ce4c306
...
...
@@ -17,17 +17,17 @@
</block>
</view>
<template name="item">
<view class='item-box' wx:if="{{item.
goodsI
d}}" bindtap='handleSale' data-target="{{item}}">
<view class='item-box' wx:if="{{item.
i
d}}" bindtap='handleSale' data-target="{{item}}">
<view class="preview">
<image webp src="{{item.goodsUrl}}" lazy-load></image>
<image webp src="{{item.goods
Img
Url}}" lazy-load></image>
</view>
<view class="item-box-content">
<view class='item-box-title'>
<text class="item-box-title-text">{{item.goodsName}}</text>
<text class="item-box-title-text">{{item.goods
Sku
Name}}</text>
</view>
<view class="item-box-price">
<view class="points-price">
{{item.
sale
Points}}
{{item.
redeem
Points}}
<text>积分</text>
</view>
</view>
...
...
packageIndex/pages/goodsDetail/index.js
View file @
ce4c306
const
navStyle
=
'background-color: transparent;'
let
navBarHeight
=
38
import
mallApi
from
'~/api/module/mall
.js'
import
homeApi
from
'~/api/module/home
.js'
import
cartApi
from
'~/api/module/cart.js'
// import { mineApi, shopmallApi } from '~/api/api'
// import MineApi from '~/api/mineApi/index'
...
...
@@ -20,80 +20,8 @@ Page({
1006
:
'支持7天无理由退货(使用后不支持)'
,
},
skuInfo
:
''
,
staffShop
:
false
,
payWayActions
:
[{
name
:
'金额支付'
,
type
:
1
,
disabled
:
false
},
{
name
:
'积分兑换'
,
type
:
2
,
disabled
:
false
}],
detailInfo
:
{
"id"
:
233
,
"goodsSkuCode"
:
"2888888889106169"
,
"goodsSkuName"
:
"书架 丹青"
,
"goodsSkuTitle"
:
""
,
"firstCategoryName"
:
"家具"
,
"secondCategoryName"
:
"家具"
,
"lastCategoryName"
:
"书架"
,
"goodsStock"
:
11690
,
"salePrice"
:
0.00
,
"redeemPoints"
:
null
,
"sellPrice"
:
100.00
,
"marketPrice"
:
100.00
,
"startQty"
:
1
,
"brandName"
:
"土匠坊"
,
"returnGoodsRules"
:
1001
,
"goodsCharacteristic"
:
"书架"
,
"goodsUnit"
:
"个"
,
"modelNumber"
:
"书架"
,
"productPlace"
:
"湖南"
,
"haveShelfLife"
:
0
,
"shelfLife"
:
"0"
,
"fragileGoods"
:
0
,
"grossWeight"
:
0.0000
,
"grossWeightUnit"
:
"kg"
,
"density"
:
0.0000
,
"extent"
:
11
,
"width"
:
12
,
"height"
:
11
,
"attributeResponses"
:
[
{
"attributeCode"
:
null
,
"attributeName"
:
null
,
"attributeValueCode"
:
null
,
"attributeValueName"
:
null
},
{
"attributeCode"
:
null
,
"attributeName"
:
null
,
"attributeValueCode"
:
null
,
"attributeValueName"
:
null
},
{
"attributeCode"
:
null
,
"attributeName"
:
null
,
"attributeValueCode"
:
null
,
"attributeValueName"
:
null
}
],
"imageResponses"
:
[
{
"imgUrl"
:
"https://img.yunzhonghe.com/image/1650252368566tfAMIHdsHJ.jpg"
,
"imgMain"
:
1
,
"imgSort"
:
1
},
{
"imgUrl"
:
"https://img.yunzhonghe.com/image/1685065224278RMJRENGzEu.jpg"
,
"imgMain"
:
0
,
"imgSort"
:
2
},
{
"imgUrl"
:
"https://img.yunzhonghe.com/image/1685065228949FBsBtEXxrq.jpg"
,
"imgMain"
:
0
,
"imgSort"
:
3
}
],
"specificationResponses"
:
[
{
"specName"
:
"颜色"
,
"specValue"
:
"丹青"
}
],
"goodsDescribe"
:
"<p>书架</p>"
,
"goodsPosition"
:
2
,
"saleFlag"
:
1
,
"shelvesStatus"
:
1001
,
"retailPrice"
:
null
,
"exchangeIntegralFlag"
:
null
,
"exchangeIntegral"
:
null
,
"merchantId"
:
null
,
"merchantName"
:
null
},
detailInfo
:
{},
addressList
:
[{
id
:
1
,
receiveName
:
'何瑶1'
,
...
...
@@ -163,21 +91,22 @@ Page({
appHide
()
{
wx
.
offAppHide
()
wx
.
onAppHide
(()
=>
{
if
(
this
.
timer
)
clearInterval
(
this
.
timer
)
this
.
trackQuery
.
view
=
5
})
},
// 处理已选商品
toGetSpecString
(
info
,
count
)
{
let
skuInfo
=
this
.
data
,
num
=
''
,
weight
=
''
num
=
`
${
count
}${
info
.
goodsUnit
}
`
weight
=
`
${
info
.
grossWeight
}${
info
.
grossWeightUnit
}
`
skuInfo
=
`
${
info
.
specificationResponses
[
0
].
specValue
}
`
+
`,
${
weight
}
`
+
`,
${
num
}
`
this
.
setData
({
skuInfo
previewImage
(
e
)
{
let
{
current
,
item
}
=
e
.
currentTarget
.
dataset
let
urls
=
[]
item
.
map
(
i
=>
{
urls
.
push
(
i
.
imgUrl
)
})
wx
.
p
.
wxApi
.
previewImage
({
current
,
urls
})
},
/**添加埋点结束 */
navbarReady
(
e
)
{
navBarHeight
=
e
.
detail
.
height
},
...
...
@@ -202,7 +131,7 @@ Page({
},
onLoad
(
options
)
{
wx
.
p
.
router
.
getRouterParams
(
options
).
then
(
params
=>
{
this
.
getDetail
(
option
s
)
this
.
getDetail
(
param
s
)
}).
catch
(
err
=>
{
console
.
error
(
'参数获取失败:'
,
err
)
})
...
...
@@ -303,30 +232,29 @@ Page({
},
// 获取详情
getDetail
(
options
)
{
// if(!options || !options.id)return
// const { id, staff, score, openId } = options
// const merchantId = wx.$storage.get("srcm_shopmall_merchant_id");
// this.merchantId = merchantId
// let para = { id }, canPay = true
// if (staff) para.businessType = 1
let
data
=
this
.
data
.
detailInfo
this
.
toGetSpecString
(
data
,
data
.
startQty
)
homeApi
.
getGoodsDetailInfo
({
id
:
options
.
id
}).
then
(
res
=>
{
if
(
res
&&
res
.
specificationResponses
?.
length
)
{
this
.
toGetSpecString
(
res
,
res
.
startQty
)
}
if
(
res
&&
res
.
platformGlGoodsSpecifications
?.
length
)
{
this
.
setData
({
activeSku
:
res
.
platformGlGoodsSpecifications
[
0
].
specificationData
})
}
this
.
setData
({
detailInfo
:
res
||
{}
})
})
},
// 处理云中鹤已选商品
toGetSpecString
(
info
,
count
)
{
let
skuInfo
=
this
.
data
,
num
=
''
,
weight
=
''
num
=
`
${
count
}${
info
.
goodsUnit
}
`
weight
=
`
${
info
.
grossWeight
}${
info
.
grossWeightUnit
}
`
skuInfo
=
`
${
info
.
specificationResponses
[
0
].
specValue
}
`
+
`,
${
weight
}
`
+
`,
${
num
}
`
this
.
setData
({
detailInfo
:
data
skuInfo
})
// this.toGetSpecString(this.data.detailInfo, this.data.detailInfo.startQty)
// shopmallApi.platformGoodsDetail(para).then(res => {
// if (res && res.specificationResponses) {
// this.toGetSpecString(res, res.startQty)
// }
// if (staff) {
// canPay = score > res.redeemPoints
// }
// this.setData({
// detailInfo: res || {},
// canPay
// })
// })
},
getCount
(
e
)
{
this
.
toGetSpecString
(
this
.
data
.
detailInfo
,
e
.
detail
)
...
...
@@ -372,77 +300,6 @@ Page({
}
})
},
//获取我的积分
getMyIntegral
()
{
shopmallApi
.
getMyIntegralApi
({}).
then
(
res
=>
{
if
(
res
)
{
this
.
setData
({
availableIntegral
:
res
.
availableIntegral
})
}
})
},
judgePayWay
()
{
const
{
availableIntegral
,
detailInfo
,
payWayActions
}
=
this
.
data
if
(
detailInfo
.
exchangeIntegralFlag
)
{
const
canPay
=
+
availableIntegral
>
+
detailInfo
.
exchangeIntegral
const
canMoneyPay
=
!
detailInfo
.
retailPrice
if
(
!
canPay
)
{
payWayActions
[
1
].
disabled
=
true
payWayActions
[
1
].
name
=
'积分不足'
}
if
(
canMoneyPay
){
payWayActions
[
0
].
disabled
=
true
}
this
.
setData
({
showPayWay
:
true
,
canPay
,
payWayActions
})
}
else
{
this
.
jumpToPay
()
}
},
closePayWayModal
()
{
this
.
setData
({
showPayWay
:
false
})
},
//选择支付方式
selectPayWay
(
e
)
{
const
val
=
e
.
detail
if
(
val
.
type
==
2
)
{
this
.
useJFtoPay
=
true
}
else
{
this
.
useJFtoPay
=
false
}
this
.
jumpToPay
()
this
.
closePayWayModal
()
},
// 跳转确认支付订单页面
jumpToPay
()
{
const
{
detailInfo
}
=
this
.
data
const
obj
=
{
useJFtoPay
:
this
.
useJFtoPay
,
merchantName
:
detailInfo
.
merchantName
,
merchantId
:
detailInfo
.
merchantId
,
goodsList
:
[{
goodsImage
:
detailInfo
.
imageResponses
[
0
].
imgUrl
,
goodsSkuName
:
detailInfo
.
goodsSkuName
,
retailPrice
:
detailInfo
.
retailPrice
,
exchangeIntegral
:
detailInfo
.
exchangeIntegral
,
goodsNumber
:
1
,
goodsStock
:
detailInfo
.
goodsStock
,
goodsId
:
detailInfo
.
id
,
isPay
:
false
,
goodsSkuCode
:
detailInfo
.
goodsSkuCode
,
}]
}
const
query
=
`?goodsInfo=
${
JSON
.
stringify
(
obj
)}
`
wx
.
navigateTo
({
url
:
'/packageShopmall/packageMall/pages/platformShop/pay/index'
+
query
,
});
},
onUnload
:
function
()
{
const
{
isCarOwner
...
...
packageIndex/pages/goodsDetail/index.wxml
View file @
ce4c306
...
...
@@ -22,7 +22,7 @@
<swiper class="banner" bindchange="changeBanner">
<block wx:for="{{detailInfo.imageResponses}}" wx:key="index">
<swiper-item>
<glsx-image class="icon-bg" src="{{item.imgUrl}}" />
<glsx-image class="icon-bg" src="{{item.imgUrl}}"
bindtap="previewImage" data-current="{{item.imgUrl}}" data-item="{{detailInfo.imageResponses}}"
/>
</swiper-item>
</block>
</swiper>
...
...
@@ -39,7 +39,7 @@
<view class="price">
<view class="price-box">
<view class="sale-price">
{{detailInfo.
sellPrice
}}
{{detailInfo.
redeemPoints
}}
<text>积分</text>
</view>
<view class="market-price">¥{{detailInfo.marketPrice}}</view>
...
...
@@ -55,7 +55,8 @@
<view class="flex">
<view class="title">已选</view>
<view class="content flex_ccc">
<view>{{skuInfo}}</view>
<view wx:if="{{detailInfo.goodsSource == 1}}">{{skuInfo}}</view>
<view wx:else>{{activeSku}}</view>
</view>
</view>
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon>
...
...
@@ -107,13 +108,8 @@
</view>
</view>
</view>
<view wx:if="{{staffShop}}" class="fixed_btn_wrap">
<view bind:tap="toDuiHuang" class="dh_btn {{canPay?'':'grey_btn'}}">
{{canPay?'立即兑换':'积分不足'}}
</view>
</view>
<block wx:if="{{navHeight&&!staffShop}}">
<block wx:if="{{navHeight}}">
<goods-action platformShop="{{true}}" bindready="goodsActionReady" pay-disabled="{{false}}" upgradeSet="{{!detailInfo.retailPrice&&detailInfo.exchangeIntegral}}" stock="{{detailInfo.goodsStock===0}}" buyFlag="{{false}}" bindclick="goodsActionClick" hideShop="{{false}}"></goods-action>
</block>
<sku bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" clickType="{{clickType}}" address="{{addressList}}"></sku>
<address staff="{{staffShop}}" address="{{addressList}}" defaultAddress="{{defaultAddress}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
\ No newline at end of file
<address address="{{addressList}}" defaultAddress="{{defaultAddress}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
\ No newline at end of file
packageIndex/pages/selfGoodsDetail/index.js
View file @
ce4c306
// packageIndex/pages/selfGoodsDetail/index.js
import
homeApi
from
'~/api/module/home.js'
const
navStyle
=
'background-color: transparent;'
let
navBarHeight
=
38
Page
({
...
...
@@ -9,287 +10,7 @@ Page({
data
:
{
navStyle
,
goodsFlag
:
true
,
goodsInfo
:
{
"id"
:
22525
,
"merchantId"
:
44210895
,
"merchantName"
:
"波波的单店门店"
,
"goodsName"
:
"ghggh"
,
"goodsVideo"
:
""
,
"goodsStatus"
:
1
,
"goodsImage"
:
"https://scrm.test.glsx.com.cn/group1/M00/0F/55/wKgD3mijFyOAXwfvAAC8AC2y3cM676.png"
,
"zoneId"
:
null
,
"retailPrice"
:
500
,
"originalPrice"
:
100
,
"supplyPrice"
:
null
,
"goodsStock"
:
null
,
"goodsSource"
:
1
,
"originGoodsId"
:
null
,
"originGoodsStatus"
:
null
,
"deliveryType"
:
2
,
"expressFee"
:
1000
,
"install"
:
"Y"
,
"orderNo"
:
0
,
"offReason"
:
null
,
"erpMaterialNo"
:
""
,
"serviceCode"
:
""
,
"relatedCouponId"
:
null
,
"createdBy"
:
null
,
"createdDate"
:
1755518778000
,
"updatedBy"
:
null
,
"updatedDate"
:
1755674245000
,
"deletedFlag"
:
null
,
"takeType"
:
""
,
"takeFee"
:
"1"
,
"memberPrice"
:
null
,
"serviceDesc"
:
""
,
"giveEquityCard"
:
null
,
"discoverGoodsId"
:
null
,
"activityPrice"
:
null
,
"retainagePrice"
:
null
,
"giveIntegral"
:
null
,
"exchangeIntegralFlag"
:
null
,
"exchangeIntegral"
:
null
,
"goodsDetailImageList"
:
[
{
"id"
:
null
,
"goodsId"
:
null
,
"content"
:
"https://scrm.test.glsx.com.cn/group1/M00/0F/55/wKgD3mijFyaAdEvhAAC8AC2y3cM705.png"
,
"resType"
:
1
,
"bizType"
:
1
,
"orderNo"
:
null
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
}
],
"goodsDescList"
:
[
],
"classifyList"
:
[
],
"supplyMerchantList"
:
[
],
"specificationDetailList"
:
[
{
"id"
:
5448
,
"goodsId"
:
22525
,
"retailPrice"
:
500
,
"stock"
:
3
,
"specificationData"
:
"1-1&2-3"
,
"specificationKey"
:
"d61482cdf947ade156679a5f861a8701"
,
"originGoodsId"
:
null
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755674239000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755674239000
,
"deletedFlag"
:
"N"
},
{
"id"
:
5447
,
"goodsId"
:
22525
,
"retailPrice"
:
1000
,
"stock"
:
1
,
"specificationData"
:
"1-1&2-2"
,
"specificationKey"
:
"8ab61fe03f6398a177cbcd988f7b7b96"
,
"originGoodsId"
:
null
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755674239000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755674239000
,
"deletedFlag"
:
"N"
},
{
"id"
:
5450
,
"goodsId"
:
22525
,
"retailPrice"
:
1000
,
"stock"
:
1
,
"specificationData"
:
"1-2&2-3"
,
"specificationKey"
:
"a5798f7c9dfc46609c85f76c67e8915b"
,
"originGoodsId"
:
null
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755674239000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755674239000
,
"deletedFlag"
:
"N"
},
{
"id"
:
5449
,
"goodsId"
:
22525
,
"retailPrice"
:
1500
,
"stock"
:
2
,
"specificationData"
:
"1-2&2-2"
,
"specificationKey"
:
"4348e92ea0b37d7a36b5f64feb467ead"
,
"originGoodsId"
:
null
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755674239000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755674239000
,
"deletedFlag"
:
"N"
}
],
"startTime"
:
null
,
"endTime"
:
null
,
"goodsStatistics"
:
{
"id"
:
null
,
"goodsId"
:
null
,
"viewAmount"
:
16
,
"saleAmount"
:
0
,
"salePriceAmount"
:
0
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
},
"specificationList"
:
[
{
"id"
:
3957
,
"goodsId"
:
null
,
"specificationName"
:
"1"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"specificationValueList"
:
[
{
"id"
:
4946
,
"goodsSpecificationId"
:
3957
,
"specificationValue"
:
"1"
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755518778000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755518778000
,
"deletedFlag"
:
"N"
},
{
"id"
:
4948
,
"goodsSpecificationId"
:
3957
,
"specificationValue"
:
"2"
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755674239000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755674239000
,
"deletedFlag"
:
"N"
}
]
},
{
"id"
:
3958
,
"goodsId"
:
null
,
"specificationName"
:
"2"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"specificationValueList"
:
[
{
"id"
:
4947
,
"goodsSpecificationId"
:
3958
,
"specificationValue"
:
"2"
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755518778000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755518778000
,
"deletedFlag"
:
"N"
},
{
"id"
:
4949
,
"goodsSpecificationId"
:
3958
,
"specificationValue"
:
"3"
,
"createdBy"
:
"bobodmd"
,
"createdDate"
:
1755674239000
,
"updatedBy"
:
"bobodmd"
,
"updatedDate"
:
1755674239000
,
"deletedFlag"
:
"N"
}
]
}
],
"takeGoodsIdList"
:
null
,
"merchantIdList"
:
null
,
"linkUrl"
:
null
,
"qrCodeUrl"
:
null
,
"posterUrl"
:
null
,
"needActivityInfo"
:
null
,
"activityInfo"
:
null
,
"orderByType"
:
null
,
"relatedCoupon"
:
null
,
"businessTypeList"
:
[
{
"id"
:
null
,
"merchantId"
:
null
,
"merchantName"
:
null
,
"goodsId"
:
null
,
"businessType"
:
"1"
,
"businessTypeName"
:
"整车/新车"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"isChoose"
:
0
},
{
"id"
:
null
,
"merchantId"
:
null
,
"merchantName"
:
null
,
"goodsId"
:
null
,
"businessType"
:
"2"
,
"businessTypeName"
:
"保养"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"isChoose"
:
0
},
{
"id"
:
null
,
"merchantId"
:
null
,
"merchantName"
:
null
,
"goodsId"
:
null
,
"businessType"
:
"3"
,
"businessTypeName"
:
"维修"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"isChoose"
:
0
},
{
"id"
:
null
,
"merchantId"
:
null
,
"merchantName"
:
null
,
"goodsId"
:
null
,
"businessType"
:
"4"
,
"businessTypeName"
:
"汽车金融"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"isChoose"
:
0
},
{
"id"
:
null
,
"merchantId"
:
null
,
"merchantName"
:
null
,
"goodsId"
:
null
,
"businessType"
:
"5"
,
"businessTypeName"
:
"零配件/精品"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"isChoose"
:
0
},
{
"id"
:
null
,
"merchantId"
:
null
,
"merchantName"
:
null
,
"goodsId"
:
null
,
"businessType"
:
"6"
,
"businessTypeName"
:
"车险"
,
"createdBy"
:
null
,
"createdDate"
:
null
,
"updatedBy"
:
null
,
"updatedDate"
:
null
,
"deletedFlag"
:
null
,
"isChoose"
:
0
}
],
"takeAllMerchant"
:
null
,
"isMemberGoods"
:
null
,
"goodsSources"
:
null
,
"isActivityUsing"
:
null
,
"goodsIds"
:
null
,
"originGoods"
:
null
,
"paymentType"
:
null
,
"depositPrice"
:
null
,
"saleAmount"
:
null
,
"discoverGoodsSource"
:
null
,
"associationClassifyFirstId"
:
null
,
"associationClassifyFirstName"
:
null
},
goodsInfo
:
{},
addressList
:
[{
id
:
1
,
receiveName
:
'何瑶1'
,
...
...
@@ -362,7 +83,7 @@ Page({
*/
onLoad
(
options
)
{
wx
.
p
.
router
.
getRouterParams
(
options
).
then
(
params
=>
{
this
.
getDetail
(
option
s
)
this
.
getDetail
(
param
s
)
}).
catch
(
err
=>
{
console
.
error
(
'参数获取失败:'
,
err
)
})
...
...
@@ -449,6 +170,9 @@ Page({
},
getDetail
(
options
)
{
homeApi
.
getGoodsDetailInfo
({
id
:
options
.
id
}).
then
(
res
=>
{
console
.
log
(
res
)
})
let
{
goodsInfo
}
=
this
.
data
let
activeSku
=
null
if
(
goodsInfo
.
specificationList
&&
goodsInfo
.
specificationList
.
length
)
{
...
...
pages/Login/Login.js
View file @
ce4c306
...
...
@@ -243,7 +243,7 @@ Page({
})
wx
.
p
.
router
.
reLaunch
(
'/pages/tab/index/index'
,
{
loginPageFlag
:
true
})
}
else
{
// 跳转到选择门店页面
wx
.
p
.
router
.
go
(
'/pages/chooseMerchant/index'
,
{
loginData
:
{
channelSource
:
source
,
...
loginData
},
merchantList
:
data
})
wx
.
p
.
router
.
go
(
'/pages/chooseMerchant/index'
,
{
loginData
:
{
channelSource
:
source
,
...
loginData
},
merchantList
:
data
,
loginPageFlag
:
true
})
}
}
else
{
wx
.
p
.
wxApi
.
showToast
(
message
)
...
...
pages/chooseMerchant/index.js
View file @
ce4c306
...
...
@@ -389,7 +389,7 @@ Page({
}
wx
.
p
.
isLogin
=
true
wx
.
p
.
storage
.
set
(
'userInfo'
,
{
...
paramsData
.
loginData
,
merchantId
:
obj
?.
merchantId
,
merchantName
:
obj
?.
merchantName
})
wx
.
p
.
router
.
reLaunch
(
'/pages/tab/index/index'
,
)
wx
.
p
.
router
.
reLaunch
(
'/pages/tab/index/index'
,
{
loginPageFlag
:
paramsData
?.
loginPageFlag
}
)
},
bindconfirm
(
e
){
const
searchValue
=
e
.
detail
.
value
...
...
pages/loading/loading.js
View file @
ce4c306
...
...
@@ -24,14 +24,25 @@ Page({
}
this
.
login
();
},
loginOut
()
{
wx
.
p
.
storage
.
rm
(
'sessionId'
)
wx
.
p
.
isLogin
=
false
wx
.
p
.
storage
.
rm
(
'userInfo'
)
wx
.
p
.
router
.
reLaunch
(
'/pages/Login/Login'
)
},
async
login
(
options
=
{})
{
if
(
options
.
merchantId
)
wx
.
$merchant_id
=
options
.
merchantId
;
if
(
!
wx
.
p
.
storage
.
get
(
'sessionId'
))
return
this
.
loginOut
()
try
{
const
{
code
,
data
,
message
}
=
await
commonApi
.
getLoginInfo
();
if
(
code
==
0
)
{
wx
.
p
.
isLogin
=
true
;
let
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
if
(
userInfo
&&
Object
.
keys
(
userInfo
)?.
length
)
{
wx
.
p
.
isLogin
=
true
;
}
else
{
this
.
loginOut
()
}
}
else
{
return
wx
.
p
.
router
.
reLaunch
(
'/pages/Login/Login'
)
this
.
loginOut
(
)
}
console
.
log
(
"登陆信息:"
,
data
);
if
(
options
.
url
)
{
...
...
pages/tab/index/components/SearchBox/SearchBox.js
View file @
ce4c306
...
...
@@ -45,12 +45,14 @@ Component({
clear
()
{
this
.
setData
({
value
:
''
},
()
=>
{
this
.
triggerEvent
(
'search'
,
''
)
})
},
confirm
(
e
)
{
let
{
value
}
=
e
.
detail
}
=
e
?
.
detail
this
.
triggerEvent
(
'search'
,
value
)
},
search
(
e
)
{
...
...
pages/tab/index/components/good-tab/good-tab.js
View file @
ce4c306
...
...
@@ -4,22 +4,15 @@ Component({
* 组件的属性列表
*/
properties
:
{
tab
:
Array
,
subTab
:
Array
,
openScroll
:
Boolean
,
index
:
{
type
:
Number
,
observer
:
function
(
n
)
{
this
.
setData
({
count
:
n
,
to
:
`to-
${
n
}
`
})
}
},
align
:
{
type
:
String
,
default
:
''
}
tab
:
Array
,
subTab
:
Array
,
openScroll
:
Boolean
,
activeTab
:
String
,
activeSubTab
:
String
,
align
:
{
type
:
String
,
default
:
''
}
},
/**
...
...
pages/tab/index/index.js
View file @
ce4c306
...
...
@@ -6,8 +6,6 @@ Page({
*/
data
:
{
pageNum
:
1
,
goodsIndex
:
0
,
customerlist
:
[],
navStyle
:
"background-color: transparent;"
,
animationData
:
{},
bannerUrl
:
''
,
...
...
@@ -53,33 +51,9 @@ Page({
id
:
'4'
,
label
:
'休闲零食'
}],
goodsList
:
[{
goodsId
:
'1'
,
goodsUrl
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png'
,
goodsName
:
'Tempo得宝手帕纸'
,
goodsSource
:
1
,
salePoints
:
'10'
,
marketPrice
:
'15.9'
},
{
goodsId
:
'2'
,
goodsUrl
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png'
,
goodsName
:
'维达抽纸超韧整箱M码家用实惠装面巾纸'
,
goodsSource
:
2
,
salePoints
:
'69.9'
,
marketPrice
:
'79.9'
},
{
goodsId
:
'3'
,
goodsUrl
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/index-bg.png'
,
goodsName
:
'5100西藏冰川矿泉水整箱'
,
salePoints
:
'10'
,
marketPrice
:
'15.9'
},
{
goodsId
:
'4'
,
goodsUrl
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png'
,
goodsName
:
'洁柔Face纸巾抽纸3层'
,
salePoints
:
'10'
,
marketPrice
:
'15.9'
}]
activeTab
:
''
,
frontendCategoryId
:
''
,
goodsList
:
[]
},
onReady
()
{
...
...
@@ -136,6 +110,7 @@ Page({
wx
.
p
.
router
.
getRouterParams
(
options
).
then
(
params
=>
{
this
.
setData
({
loginPageFlag
:
params
?.
loginPageFlag
},
()
=>
{
this
.
getPointsWallet
()
this
.
getGoodsList
()
})
}).
catch
(
err
=>
{
console
.
error
(
'参数获取失败:'
,
err
)
...
...
@@ -180,6 +155,48 @@ Page({
})
},
// 获取商品数据
getGoodsList
()
{
let
{
pageNum
,
goodsList
,
goodsSkuName
,
frontendCategoryId
,
activeTab
}
=
this
.
data
let
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
let
params
=
{
pageNum
,
pageSize
:
4
,
goodsSkuName
,
frontendCategoryId
}
if
(
activeTab
==
1
)
{
// 我能兑换
params
.
canExchange
=
1
,
params
.
staffPhone
=
userInfo
?.
phone
params
.
staffPlatform
=
userInfo
?.
channelSource
params
.
merchantNo
=
userInfo
?.
merchantId
}
else
if
(
activeTab
)
{
// 积分区间
params
.
storeStart
=
activeTab
==
2
?
0
:
activeTab
==
3
?
100
:
activeTab
==
4
?
200
:
''
params
.
storeEnd
=
activeTab
==
2
?
100
:
activeTab
==
3
?
200
:
activeTab
==
4
?
300
:
''
}
homeApi
.
getGoodsStockroomList
(
params
).
then
(
res
=>
{
res
?.
list
?.
forEach
((
val
,
index
)
=>
{
if
(
index
==
0
)
val
.
goodsSource
=
2
else
val
.
goodsSource
=
1
})
this
.
setData
({
goodsList
:
pageNum
==
1
?
res
?.
list
||
[]
:
[...
goodsList
,
...
res
?.
list
],
pages
:
res
.
pages
,
triggered
:
false
})
})
},
scrollonReachBottom
()
{
let
{
pages
,
pageNum
}
=
this
.
data
// 判断当前页是否是末页
if
(
pages
==
pageNum
)
return
this
.
setData
({
pageNum
:
pageNum
+
1
})
this
.
getGoodsList
()
},
// 跳转积分中心
handleToPointCenter
()
{
wx
.
p
.
router
.
go
(
'/packageIndex/pages/integral/index/index'
)
...
...
@@ -194,22 +211,26 @@ Page({
let
{
target
}
=
e
.
currentTarget
.
dataset
wx
.
p
.
router
.
go
(
'/packageIndex/pages/SpecialSale/SpecialSale'
,
target
)
},
changeTab
(
e
)
{
this
.
setData
({
goodsIndex
:
e
.
detail
})
},
toIntegral
(){
wx
.
p
.
router
.
go
(
'/packageIndex/pages/integral/index/index'
)
},
// 商品搜素
handleSearch
(
e
)
{
console
.
log
(
e
)
this
.
setData
({
goodsSkuName
:
e
.
detail
},
()
=>
{
this
.
getGoodsList
()
})
},
// 切换分类筛选
changeTab
(
e
)
{
console
.
log
(
e
,
'==='
)
this
.
setData
({
activeTab
:
e
.
detail
.
activeTab
,
frontendCategoryId
:
e
.
detail
?.
activeSubTab
},
()
=>
{
this
.
getGoodsList
()
})
},
// 加入购物车
handleAddToCart
(
e
)
{
...
...
@@ -231,20 +252,20 @@ Page({
*/
onUnload
:
function
()
{},
refreshPage
()
{
this
.
setData
({
pageNum
:
1
,
goodsSkuName
:
''
,
frontendCategoryId
:
''
,
activeTab
:
''
})
this
.
onLoad
()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onReachBottom
()
{
let
{
pageNum
,
total
}
=
this
.
data
wx
.
p
.
util
.
onReachBottom
({
pageNum
,
total
,
},
()
=>
{
this
.
getActivityList
()
})
},
/**
* 用户点击右上角分享
...
...
pages/tab/index/index.wxml
View file @
ce4c306
...
...
@@ -7,19 +7,20 @@
<block wx:if="{{navHeight}}">
<view class="container-box">
<view class="container" style="height: calc(100vh - {{navHeight}}px);margin-top: {{navHeight}}px;">
<view class="points-box">
<view class="points-btn" bindtap="handleToPointCenter">
<view style="display: flex;align-items: center;">
<view class="icon">
<glsx-image src="/index/points-icon.png"></glsx-image>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{ true }}" bindrefresherrefresh="refreshPage" bindscrolltolower="scrollonReachBottom" class="list" style="height:100%;" refresher-threshold="104" refresher-triggered="{{ triggered }}">
<view class="points-box">
<view class="points-btn" bindtap="handleToPointCenter">
<view style="display: flex;align-items: center;">
<view class="icon">
<glsx-image src="/index/points-icon.png"></glsx-image>
</view>
<view class="points-num" bind:tap="toIntegral">{{walletObj.currentScore || '-'}}</view>
</view>
<view class="arrow-icon">
<mp-icon icon="arrow" color="#F4776D" size="7"></mp-icon>
</view>
<view class="points-num" bind:tap="toIntegral">{{walletObj.currentScore || '-'}}</view>
</view>
<view class="arrow-icon">
<mp-icon icon="arrow" color="#F4776D" size="7"></mp-icon>
</view>
</view>
</view>
<view class="layout">
<!-- 公告 -->
<view class="notic-box">
...
...
@@ -44,14 +45,15 @@
<view class="goods-box-title">商品兑换</view>
<view class="sticky">
<search-box placeholder="搜索商品" bindsearch="handleSearch"></search-box>
<good-tab tab="{{tab}}" subTab="{{subTab}}" align="left" openScroll bindtabchange="changeTab"
index="{{goodsIndex
}}"></good-tab>
<good-tab tab="{{tab}}" subTab="{{subTab}}" align="left" openScroll bindtabchange="changeTab"
activeTab="{{activeTab}}" activeSubTab="{{frontendCategoryId
}}"></good-tab>
</view>
<view class="goods-box">
<view class="goods-box"
wx:if="{{goodsList.length}}"
>
<goods list="{{goodsList}}" bindjoin="handleAddToCart"></goods>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
</block>
...
...
pages/tab/mine/index.js
View file @
ce4c306
// pages/tab/mine/index.js
import
commonApi
from
'~/api/module/common'
import
{
ToolList
}
from
"~/constants/index"
;
...
...
@@ -108,6 +109,21 @@ Page({
});
});
},
// 切换门店
changeMerchant
()
{
// 获取门店接口 门店数量大于1跳转切换,否则不需切换
let
{
userInfo
}
=
this
.
data
commonApi
.
getMerchantData
({
staffPhone
:
userInfo
?.
phone
,
channelSource
:
userInfo
?.
channelSource
}).
then
(
res
=>
{
let
{
code
,
data
,
message
}
=
res
if
(
code
==
0
)
{
if
(
data
?.
length
>
1
)
{
wx
.
p
.
router
.
go
(
'/pages/chooseMerchant/index'
,
{
loginData
:
userInfo
,
merchantList
:
data
})
}
}
else
{
wx
.
p
.
wxApi
.
showToast
(
message
)
}
})
},
// 获取用户会员信息
toCheckMember
()
{
// wx.p.router.intercept(false).then((sid) => {
...
...
pages/tab/mine/index.scss
View file @
ce4c306
...
...
@@ -176,6 +176,23 @@ page {
color
:
#3F444D
;
}
.user-info
.merchant_box
{
margin-top
:
16rpx
;
height
:
44rpx
;
border
:
1
.6rpx
solid
#7a8299
33
;
border-radius
:
22rpx
;
color
:
#7A8299
;
font-size
:
22rpx
;
padding
:
0
24rpx
;
display
:
flex
;
align-items
:
center
;
.change_icon
{
width
:
32rpx
;
height
:
32rpx
;
margin-left
:
8rpx
;
}
}
.coupon-box
{
background
:
#FFFFFF
;
box-sizing
:
border-box
;
...
...
pages/tab/mine/index.wxml
View file @
ce4c306
...
...
@@ -26,6 +26,12 @@
</view>
</view>
<view class="phone">{{username}}{{userInfo.phone}}</view>
<view class="merchant_box" bindtap="changeMerchant">
{{userInfo.merchantName}}
<view class="change_icon">
<glsx-image src="/mine/change.png"></glsx-image>
</view>
</view>
</block>
<block wx:else>
点击登录
...
...
project.config.json
View file @
ce4c306
...
...
@@ -58,5 +58,5 @@
],
"include"
:
[]
},
"appid"
:
"wx
e10067a63c1856ac
"
"appid"
:
"wx
7ce755e425603084
"
}
\ No newline at end of file
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