Commit 915f080e by liimin

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas/mini-program/…

…points-mall into SAAS+V4.56.0-0908
2 parents cc82d4c9 d7153593
...@@ -51,15 +51,20 @@ Page({ ...@@ -51,15 +51,20 @@ Page({
orderGoodsList.push({ orderGoodsList.push({
goodsId: val.id || val.goodsId, // 商品详情下单是id ,购物车结算是goodsId goodsId: val.id || val.goodsId, // 商品详情下单是id ,购物车结算是goodsId
sellQty: val?.sellQty, sellQty: val?.sellQty,
specificationData: val?.specificationData || undefined, specificationData: val?.specificationData,
goodsSkuCode: val.goodsSkuCode, goodsSkuCode: val.goodsSkuCode,
goodsSource: val.goodsSource goodsSource: val.goodsSource
}) })
}) })
orderGoodsList?.map(obj => {
Object.keys(obj).forEach(key => {
if (obj[key] === null || obj[key] === undefined) {
delete obj[key]
}
})
return obj
})
let params = { let params = {
accountName: userInfo?.nickName,
customerOpenId: userInfo?.openId,
customerImgUrl: userInfo?.headImgUrl,
buyerMsg: goodsInfo?.buyerMsg, buyerMsg: goodsInfo?.buyerMsg,
addressId: contactInfo?.id, addressId: contactInfo?.id,
orderGoodsList, orderGoodsList,
......
<view class="layout"> <view class="layout">
<view class="bg-top"> <view class="bg-top" wx:if="{{loginType==0}}">
<glsx-image src="/login/login-bg.png"></glsx-image> <glsx-image src="/login/login-bg.png"></glsx-image>
</view> </view>
<navigation-bar navStyle="background:transparent;" showBack page-title="登录"><text class="page-title">登录</text></navigation-bar> <navigation-bar navStyle="background:transparent;" showBack page-title="登录"><text class="page-title">登录</text></navigation-bar>
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
page{ page{
background-color: #FAFBFF !important; background-color: #FAFBFF !important;
} }
.layout {
position: relative;
display: flex;
justify-content: center;
height: 100vh;
}
.bg-top { .bg-top {
position: fixed; position: fixed;
z-index: -1; z-index: -1;
...@@ -30,15 +36,14 @@ page{ ...@@ -30,15 +36,14 @@ page{
} }
.h1 { .h1 {
margin: 0 0 24rpx 80rpx;
padding-top: 90rpx; padding-top: 90rpx;
font-size: 60rpx; font-size: 60rpx;
color: #323436; color: #323436;
font-weight: 600; font-weight: 600;
padding-top: 4vh;
} }
.h2 { .h2 {
margin: 0 0 60rpx 80rpx;
font-size: 44rpx; font-size: 44rpx;
color: #323436; color: #323436;
} }
...@@ -46,14 +51,14 @@ page{ ...@@ -46,14 +51,14 @@ page{
.login-img { .login-img {
width: 468rpx; width: 468rpx;
height: 468rpx; height: 468rpx;
margin: 60rpx auto; margin: 3vh auto;
} }
.h3 { .h3 {
font-weight: 500; font-weight: 500;
font-size: 44rpx; font-size: 44rpx;
color: #323436; color: #323436;
padding: 176rpx 0 0 106rpx; padding: 176rpx 0 0 40rpx;
} }
.wx-auth-button { .wx-auth-button {
...@@ -89,7 +94,7 @@ page{ ...@@ -89,7 +94,7 @@ page{
.type .icon { .type .icon {
width: 68rpx; width: 68rpx;
height: 68rpx; height: 68rpx;
margin: 40rpx auto 12rpx; margin: 2vh auto 12rpx;
} }
.tips { .tips {
...@@ -134,7 +139,7 @@ page{ ...@@ -134,7 +139,7 @@ page{
/* 手机号 */ /* 手机号 */
.box { .box {
margin: 0 105rpx 306rpx; margin: 0 40rpx 18.5vh;
animation: opacity .25s forwards; animation: opacity .25s forwards;
} }
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
} }
} }
.btn { .btn {
margin: 0 32rpx; margin: 0 32rpx 20rpx 32rpx;
height: 96rpx; height: 96rpx;
background: #FB8A32; background: #FB8A32;
border-radius: 20rpx; border-radius: 20rpx;
......
...@@ -86,12 +86,12 @@ Page({ ...@@ -86,12 +86,12 @@ 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()
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()
this.getGoodsList() this.getGoodsList()
this.getCategory() this.getCategory()
this.getHomeData()
}) })
}).catch(err => { }).catch(err => {
console.error('参数获取失败:', err) console.error('参数获取失败:', err)
...@@ -131,7 +131,8 @@ Page({ ...@@ -131,7 +131,8 @@ Page({
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
if (data && Object.keys(data)?.length) { // 有数据返回说明已开通钱包 if (data && Object.keys(data)?.length) { // 有数据返回说明已开通钱包
wx.p.storage.set('userInfo', {...userInfo, nickName: data?.name}) // 更新storage中的nickName // 替换昵称
this.replaceNickName(data)
} else { } else {
if (!loginPageFlag) return // 只有通过登录页面进入首页弹出一次 if (!loginPageFlag) return // 只有通过登录页面进入首页弹出一次
// 未开通弹出开通钱包弹窗 // 未开通弹出开通钱包弹窗
...@@ -151,6 +152,22 @@ Page({ ...@@ -151,6 +152,22 @@ Page({
}) })
}, },
replaceNickName(data) {
let { userInfo } = this.data
commonApi.replaceWalletName({
nickName: data?.name,
phone: data?.phone,
scoreSource: data?.scoreSource
}).then(res => {
let { code, message } = res
if (code == 0) {
wx.p.storage.set('userInfo', {...userInfo, nickName: data?.name}) // 更新storage中的nickName
} else {
wx.p.wxApi.showToast(message)
}
})
},
// 获取前端分类 // 获取前端分类
getCategory() { getCategory() {
homeApi.getHomeCategoryList({}).then(res => { homeApi.getHomeCategoryList({}).then(res => {
...@@ -289,11 +306,24 @@ Page({ ...@@ -289,11 +306,24 @@ Page({
}) })
}) })
}, },
getWalletData() {
let { userInfo } = this.data
// 获取当前积分数量
commonApi.getPointsSummary({staffPhone: userInfo?.phone, channelSource: userInfo?.channelSource, merchantId: userInfo?.merchantId}).then(r => {
if (r?.code == 0) {
this.setData({
walletObj: {name: r?.data?.staffName || userInfo?.nickName, phone: r?.data?.staffPhone || userInfo?.phone, scoreSource: userInfo?.channelSource, currentScore: r?.data?.currentScore || 0}
})
} else {
wx.p.wxApi.showToast(r.message)
}
})
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getPointsWallet() this.getWalletData()
}, },
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!