Commit a14426e8 by wangzhihui

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 1a0a7903 0185cd92
Showing 64 changed files with 1535 additions and 285 deletions
import api from '../request/http'
module.exports = {
/**查询购物车 */
getCartList(data) {
return api.post({
method: 'scrm.api.shopmall.points.shopping.car.get',
...data
})
},
/**加入购物车 */
addToCart(data) {
return api.post({
method: 'scrm.api.shopmall.points.shopping.car.add',
...data
})
},
/**购物车更新商品(将商品数量改为1) */
updateGoodsFormCart(data) {
return api.post({
method: 'scrm.api.shopmall.points.shopping.car.reduce',
...data
})
}
}
\ No newline at end of file \ No newline at end of file
...@@ -35,4 +35,28 @@ module.exports = { ...@@ -35,4 +35,28 @@ module.exports = {
getImgVersion() { getImgVersion() {
return http.getMock(); return http.getMock();
}, },
/**手机号验证码登录 */
phoneSmsLogin() {
return http.fetch('scrm.api.sso.sms.login', {
source: 'MINIAPP',
...data
})
},
/**微信授权手机号登录 */
authPhoneLogin() {
return http.fetch('scrm.api.sso.weapp.auth.phone', {
source: 'MINIAPP',
...data
})
},
/**查询积分钱包开通状态 */
getPointsWalletStatus() {
return http.fetch('scrm.api.shopmall.pointswallet.get', {
...data
})
},
/**开通积分钱包 */
openPointsWallet() {
return http.fetch('scrm.api.shopmall.pointswallet.open', {...data})
}
}; };
import api from '../request/http'
module.exports = {
}
\ No newline at end of file \ No newline at end of file
...@@ -57,7 +57,9 @@ ...@@ -57,7 +57,9 @@
"pages/integral/withdrawalSuccess/withdrawalSuccess", "pages/integral/withdrawalSuccess/withdrawalSuccess",
"pages/SpecialSale/SpecialSale", "pages/SpecialSale/SpecialSale",
"pages/goodsDetail/index", "pages/goodsDetail/index",
"pages/integral/withdrawalRules/withdrawalRules" "pages/integral/withdrawalRules/withdrawalRules",
"pages/confirmOrder/index",
"pages/exchangeSuccess/index"
] ]
}, },
{ {
...@@ -87,7 +89,9 @@ ...@@ -87,7 +89,9 @@
"pages/coupon/center/center", "pages/coupon/center/center",
"pages/coupon/detail/detail", "pages/coupon/detail/detail",
"pages/coupon/recommend/recommend", "pages/coupon/recommend/recommend",
"pages/coupon/usedDetail/usedDetail" "pages/coupon/usedDetail/usedDetail",
"pages/order/express/express",
"pages/order/components/Copy/Copy"
] ]
} }
], ],
......
...@@ -31,9 +31,7 @@ Component({ ...@@ -31,9 +31,7 @@ Component({
) )
}, },
jump(e) { jump(e) {
let { url } = e.currentTarget.dataset wx.p.router.switchTab('/pages/tab/cart/index')
if (url == 'home') wx.p.router.goHome()
else wx.p.router.go('/packageMall/pages/shoppingCart/shoppingCart')
}, },
click(e) { click(e) {
let { event } = e.currentTarget.dataset let { event } = e.currentTarget.dataset
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<view class="goods-action"> <view class="goods-action">
<view class="navigation-box"> <view class="navigation-box">
<view class="item" wx:if="{{!hideShop}}" bindtap="jump"> <view class="item" wx:if="{{!hideShop}}" bindtap="jump">
<view v-if="{{true}}" class="goods-num">{{15}}</view>
<view class="sprite-icon" > <view class="sprite-icon" >
<glsx-image src="/index/goods-cart.png"></glsx-image> <glsx-image src="/index/goods-cart.png"></glsx-image>
</view> </view>
......
...@@ -47,6 +47,20 @@ ...@@ -47,6 +47,20 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin:0 14rpx; margin:0 14rpx;
position: relative;
}
.navigation-box .item .goods-num {
position: absolute;
top: -10rpx;
right: -16rpx;
height: 28rpx;
background: #F75454;
border: 1rpx solid #FFFFFF;
border-radius: 14rpx;
font-size: 18rpx;
color: #FFFFFF;
padding: 0 8rpx;
} }
.navigation-box .sprite-icon{ .navigation-box .sprite-icon{
width: 40rpx; width: 40rpx;
......
...@@ -37,7 +37,19 @@ Component({ ...@@ -37,7 +37,19 @@ Component({
only: { only: {
type: Boolean, type: Boolean,
value: true value: true
} },
showCloseButton: {
type: Boolean,
value: false
},
showFooter: {
type: Boolean,
value: true
},
headerColor: {
type: String,
value: ''
},
}, },
/** /**
......
...@@ -2,17 +2,18 @@ ...@@ -2,17 +2,18 @@
<view class="popup-bg" bindtap="hidePopup"></view> <view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content {{close?'close':''}}" style="height:{{height}}"> <view class="popup-content {{close?'close':''}}" style="height:{{height}}">
<block wx:if="{{title}}"> <block wx:if="{{title}}">
<view class="popup-title text-center">{{title}}</view> <view class="popup-title text-center" style="background:{{headerColor}}">{{title}}
<view class="popup-close" wx:if="{{showCloseButton}}" bindtap="hidePopup">
<mp-icon icon="close2" color="#B1B1B3" size="20"></mp-icon>
</view>
</view>
</block> </block>
<view class="popup-slot {{title?'':'notitle' }}"> <view class="popup-slot {{title?'':'notitle' }}">
<slot></slot> <slot></slot>
</view> </view>
<view class="popup-footer isFullSucreen" wx:if="{{only}}"> <view class="popup-footer isFullSucreen" wx:if="{{showFooter}}">
<view class="cancel btn text-center" bindtap="hidePopup">取消</view> <view class="cancel btn text-center" wx:if="{{only}}" bindtap="hidePopup">取消</view>
<view class="confirm btn text-center" bindtap="confirm">确定</view> <view class="confirm {{only?'btn':'doubtn'}} text-center" bindtap="confirm">确定</view>
</view>
<view class="popup-footer isFullSucreen" wx:else>
<view class="confirm doubtn text-center" bindtap="confirm">确定</view>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -43,6 +43,18 @@ ...@@ -43,6 +43,18 @@
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
border-bottom: 2rpx solid #EBEDF0; border-bottom: 2rpx solid #EBEDF0;
border-radius: 20rpx 20rpx 0 0;
position: relative;
}
.popup-close {
position: absolute;
right: 40rpx;
width: 40rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
} }
.popup-slot { .popup-slot {
......
/*可视化地呈现时间流信息*/ /*可视化地呈现时间流信息*/
Component({ Component({
properties: { properties: {
list: { // 时间轴节点数据
// 时间轴列表 nodes: {
type: Array, type: Array,
value: [], value: [],
observer: function(newVal, oldVal) {
this.processNodes(newVal);
}
}
}, },
data: {
timeLineNodes: []
}, },
/**
* 组件内部方法
*/
methods: {
/**
* 预处理节点数据,添加样式类
* @param {Array} nodes - 节点数组
*/
processNodes(nodes) {
if (!nodes || !Array.isArray(nodes)) return;
const timeLineNodes = nodes.map(node => {
return {
...node,
dotClass: this.getNodeDotClass(node),
contentClass: this.getNodeContentClass(node)
};
});
this.setData({
timeLineNodes
});
},
/**
* 获取节点点的样式类
* @param {Object} item - 时间轴节点项
* @returns {String} 样式类名
*/
getNodeDotClass(item) {
// 直接根据节点属性返回对应的样式类
if (item.active) {
return 'timeline-node__dot timeline-node__dot--active';
} else if (item.type === 'special') {
return 'timeline-node__dot timeline-node__dot--spacial';
} else if (item.small) {
return 'timeline-node__dot timeline-node__dot--small';
} else {
return 'timeline-node__dot';
}
},
/**
* 获取节点内容的样式类
* @param {Object} item - 时间轴节点项
* @returns {String} 样式类名
*/
getNodeContentClass(item) {
// 非激活状态的内容使用灰色
if (item.type === 'special') {
return 'timeline-node__content--special';
}else if(item.active){
return 'active';
}
},
/**
* 判断是否显示节点点
* @param {Object} item - 时间轴节点项
* @returns {Boolean} 是否显示节点点
*/
shouldShowNodeDot(item) {
// 修复逻辑:所有节点默认都应该显示点
// 只有特定情况下才不显示
return true;
}
}
}); });
\ No newline at end of file \ No newline at end of file
.box { /* 时间轴容器 */
padding: 10rpx; .timeline-container {
padding: 20rpx 0;
} }
.one {
/* 时间轴节点 */
.timeline-node {
position: relative; position: relative;
padding-bottom: 40rpx; padding-bottom: 40rpx;
display: flex;
&:last-child {
padding-bottom: 0;
}
}
/* 时间轴节点点容器 */
.timeline-node__dot-wrapper {
width: 36rpx;
display: flex;
justify-content: center;
align-items: flex-start;
flex-shrink: 0;
padding-top: 6rpx;
} }
.onedot {
left: -2rpx; /* 时间轴节点点 */
.timeline-node__dot {
width: 20rpx; width: 20rpx;
height: 20rpx; height: 20rpx;
position: absolute;
background-color: #e8e8ea; background-color: #e8e8ea;
border-radius: 50%; border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
z-index: 1; z-index: 1;
&.highlight {
/* 激活状态的节点点 */
&.timeline-node__dot--active {
background-color: var(--btnColor); background-color: var(--btnColor);
} }
&.tiny { /* 小型节点点 */
&.timeline-node__dot--small {
width: 12rpx;
height: 12rpx;
}
/* 地址节点点 */
&.timeline-node__dot--spacial {
width: 12rpx; width: 12rpx;
height: 12rpx; height: 12rpx;
left: 2rpx;
} }
} }
.oneline {
/* 时间轴连接线 */
.timeline-node__line {
position: absolute; position: absolute;
left: 8rpx; top: 18rpx;
height: 100%; left: 18rpx;
border-left: 1rpx solid #f0f0f0; height: calc(100% - 16rpx);
border-left: 1px solid #e8e8ea;
z-index: 0;
} }
.onemain {
position: relative; /* 时间轴内容 */
padding-left: 56rpx; .timeline-node__content {
top: -6rpx; flex: 1;
.main { padding-left: 20rpx;
display: flex; color: #b1b1b3;
align-items: center; }
gap: 12rpx;
.title { .timeline-node__content--special {
font-weight: 500; .timeline-node__title,
font-size: 32rpx; .timeline-node__tip {
color: #282829;
}
.time {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
}
.timeline-node__title {
color: #282829; color: #282829;
} }
.timeline-node__tip {
color: #666666;
} }
} }
.onemaintitle {
/* 时间轴头部 */
.timeline-node__header {
display: flex;
margin-bottom: 16rpx; margin-bottom: 16rpx;
padding-top: 8rpx; margin-bottom: 16rpx;
color: #909399; align-items: center;
line-height: 1; gap: 20rpx;
font-size: 26rpx; }
/* 时间轴标题 */
.timeline-node__title {
font-weight: 500;
font-size: 28rpx;
margin-bottom: 8rpx;
line-height: 1.4;
} }
.tip {
/* 时间轴时间 */
.timeline-node__time {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
line-height: 1.4;
}
/* 时间轴提示信息 */
.timeline-node__tip {
font-weight: 400;
font-size: 24rpx;
line-height: 1.5;
}
.active {
.timeline-node__title {
color: #282829;
}
.timeline-node__time {
color: #909399;
}
.timeline-node__tip {
color: #656566; color: #656566;
}
} }
<view class="box"> <!-- 时间轴组件 -->
<view wx:for="{{list}}" wx:key="index" class="one"> <view class="timeline-container">
<view class="onedot {{index==list.length-1?'highlight':''}} {{!item.status?'tiny':''}}"></view> <view wx:for="{{timeLineNodes}}" wx:key="index" class="timeline-node">
<view wx:if="{{index!=list.length-1}}" class="oneline"></view> <!-- 时间轴节点 -->
<view class="onemain "> <view class="timeline-node__dot-wrapper">
<view class="main"> <!-- 使用预处理的样式类 -->
<view class="title">{{item.status}}</view> <view class="{{item.dotClass}}"></view>
<view class="time">{{item.time}}</view> </view>
</view> <!-- 时间轴连接线 -->
<view class="tip" wx:for="{{item.tips}}" wx:for-item="tip">{{tip}}</view> <view wx:if="{{index !== timeLineNodes.length - 1}}" class="timeline-node__line"></view>
<!-- 时间轴内容 -->
<view class="timeline-node__content {{item.contentClass}} ">
<view class="timeline-node__header">
<view wx:if="{{item.title}}" class="timeline-node__title">{{item.title}}</view>
<view wx:if="{{item.time}}" class="timeline-node__time">{{item.time}}</view>
</view>
<view wx:for="{{item.tips}}" wx:key="index" class="timeline-node__tip">
{{item}}
</view>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "确认订单"
}
\ No newline at end of file \ No newline at end of file
<view class="layout" style="padding-bottom:{{padding_bottom }}px">
<view class="box">
<block wx:if="{{addressFlag}}">
<block wx:if="{{shopFlag && shopCartFlag}}">
<view class="address-box">
<view class="ad-title">快递配送</view>
<view class="ad-box" bindtap="jump">
<block wx:if="{{contactInfo.contactAddress}}">
<view class="left">
<view class="top">
<view class="name text-hide">{{contactInfo.contactName}}</view>
<block wx:if="{{isDefault}}">
<view class="default text-center">默认地址</view>
</block>
<view class="phone">{{contactInfo.contactPhone}}</view>
</view>
<view class="bottom text-hide">{{contactInfo.contactAddress}}</view>
</view>
</block>
<block wx:else>
选择收货地址
</block>
<view class="right text-center">
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon>
</view>
</view>
</view>
</block>
</block>
<view class="content-box">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="item">
<view class="content">
<view class="goods-info">
<view class="preview">
<image webp src="{{item.goodsImage}}"></image>
</view>
<view class="text">
<view class="name">
<view class="text-hide">
{{item.goodsName}}
</view>
<view class="text-hide description">{{item.specificationData || ''}}</view>
</view>
<view class="price-box">
<view class="price">
{{item.retailPrice}}
<text>积分</text>
</view>
<view class="goods-num">
x{{item.goodsNumber}}
</view>
</view>
</view>
</view>
</view>
</view>
</block>
</view>
<view class="all-box">
<view class="cell">
<view class="label">商品总价</view>
<view class="value">{{money || 0}}积分</view>
</view>
<view class="cell">
<view class="label">运费</view>
<view class="value">{{expressFee || '包邮'}}</view>
</view>
<view class="all-item">
<text>合计</text>
<view class="price">{{money || 0}}<text>积分</text></view>
</view>
</view>
<view class="tips">
<text>当前积分</text>
{{1500}}
</view>
</view>
</view>
<block wx:if="{{addressFlag}}">
<goods-action bindready="goodsActionReady" custom>
<view class="goods-action">
<view class="left">
<view class="radio">
共{{goodsNumber}}件,合计:
</view>
<view class="total">
<view class="price">
{{money|| 0}}
<text>积分</text>
</view>
</view>
</view>
<view class="btn text-center {{money > 1500 ? 'disabled' : ''}}" bindtap="checkOut">立即兑换</view>
</view>
</goods-action>
</block>
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" title="积分兑换">
<view class="suggest-box">
<view>您当前总积分为<text>{{400}}</text>积分</view>
<view>确认使用<text>{{400}}</text>积分兑换该商品</view>
</view>
</Dialog>
\ No newline at end of file \ No newline at end of file
/* packageMall/pages/pay/pay.wxss */
.layout {
background: #F7F8FA;
padding: 24rpx 32rpx;
}
.address-box {
padding: 20rpx 24rpx;
background-color: #fff;
border-radius: 24rpx;
box-sizing: border-box;
margin-bottom: 24rpx;
}
.address-box .ad-title {
border-bottom: 2rpx solid #EFF0F2;
padding-bottom: 20rpx;
}
.address-box .ad-box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 0 0;
}
.address-box .left {
width: 580rpx;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
padding-left: 8rpx;
color: #282829;
}
.address-box .left .top {
display: flex;
align-items: center;
}
.address-box .default {
width: 120rpx;
height: 40rpx;
font-size: 24rpx;
color: #fff;
background-color: #F75454;
border-radius: 4rpx;
margin: 0 20rpx;
flex-shrink: 0;
}
.address-box .bottom{
color: #B1B1B3;
}
.address-box .phone {
margin-left: auto;
}
.address-box .right {
width: calc(100% - 580rpx);
justify-content: flex-end;
}
.address-box .right .icon {
width: 16rpx;
height: 28rpx;
}
.content-box{
padding: 24rpx;
background-color: #fff;
border-radius: 8px;
}
.box .item .content .goods-info {
width: 100%;
display: flex;
}
.box .item .content .goods-info .preview {
flex-shrink: 0;
margin-right: 20rpx;
width: 160rpx;
height: 160rpx;
border-radius: 16rpx;
overflow: hidden;
}
.box .item .content .goods-info .text {
flex-shrink: 0;
width: calc(100% - 180rpx);
}
.box .item .content .goods-info .text .price-box {
display: flex;
justify-content: space-between;
margin-top: 16rpx;
}
.box .item .content .goods-info .text .price-box .price {
color: #FC5B32;
font-size: 40rpx;
font-weight: 600;
}
.box .item .content .goods-info .text .price-box .price text {
font-size: 20rpx;
font-weight: 500;
}
.box .item .content .goods-info .text .price-box .goods-num {
height: 36rpx;
padding: 0 16rpx;
background: #FFFFFF;
border: 1rpx solid #DCDFE6;
border-radius: 20rpx;
}
.all-box {
margin-top: 24rpx;
padding: 0 24rpx;
background-image: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
border-radius: 24rpx;
}
.all-box .cell {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #EFF0F2;
height: 100rpx;
}
.all-box .cell .label {
color: #666666;
}
.all-box .cell .value {
color: #282829;
}
.all-box .all-item {
text-align: right;
height: 100rpx;
line-height: 100rpx;
}
.all-box .all-item .price {
display: inline-block;
color: #FC5B32;
font-size: 48rpx;
font-weight: 600;
margin-left: 16rpx;
}
.all-box .all-item .price text {
font-weight: 500;
font-size: 24rpx;
margin-left: 4rpx;
}
.text .description {
font-size: 24rpx;
margin-top: 4rpx;
color: #B1B1B3;
}
.tips {
color: #888888;
margin: 20rpx 24rpx;
}
.tips .price {
font-size: 36rpx;
color: var(--btnColor);
font-weight: 500;
}
.goods-action {
padding: 10rpx 24rpx;
box-sizing: border-box;
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.goods-action .btn {
width: 280rpx;
height: 80rpx;
color: #FFFFFF;
background: #FB8A32;
border-radius: 16rpx;
font-weight: 500;
padding: 0 !important;
margin: 0 !important;
font-size: 28rpx;
}
.goods-action .btn.disabled {
opacity: 0.3;
background: #FB8A32;
}
.goods-action .left {
width: calc(100% - 300rpx);
font-size: 24rpx;
display: flex;
align-items: baseline;
}
.goods-action .total .price {
color: #FC5B32;
font-size: 48rpx;
display: flex;
align-items: baseline;
font-weight: 600;
}
.goods-action .total .price text {
font-size: 24rpx;
font-weight: 400;
margin-left: 4rpx;
}
.suggest-box text{
color: #FC5B32;
}
.btn_primary {
color: #FC5B32;
}
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/exchangeSuccess/index.js
Page({
/**
* 页面的初始数据
*/
data: {
count: 5,
paramsData: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.p.router.getRouterParams(options).then(params => {
params = {
orderCode: '22232'
}
this.countdown(params.orderCode)
this.setData({
paramsData: params
})
}).catch(err => {
console.error('参数获取失败:', err)
})
},
countdown(orderCode) {
this.timer = setInterval(() => {
let { count } = this.data
if (count == 0) {
clearInterval(this.timer)
// wx.p.router.reLaunch('/packageMine/pages/order/detail/detail', {orderCode})
return
}
this.setData({
count: --count
})
}, 1 * 1000)
},
viewOrderDetail() {
let { paramsData } = this.data
wx.p.router.reLaunch('/packageMine/pages/order/detail/detail', {orderCode: paramsData.orderCode})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/exchangeSuccess/index.wxss */
.container {
width: 100%;
height: 100vh;
background: #ffffff;
display: flex;
align-items: center;
flex-direction: column;
.icon {
width: 136rpx;
height: 136rpx;
margin: 168rpx 0 48rpx;
}
.title {
font-size: 40rpx;
font-weight: 600;
color: #292D33;
}
.text {
font-size: 28rpx;
color: #7A8299;
margin-top: 24rpx;
}
.btn {
background: #FB8A32;
border-radius: 16rpx;
color: #FFFFFF;
font-weight: 500;
font-size: 32rpx;
margin: 280rpx 0 16rpx;
}
.tips {
font-size: 22rpx;
color: #B9BABB;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageIndex/pages/exchangeSuccess/index.wxml-->
<view class="container">
<view class="icon">
<glsx-image src="/status/success.png"></glsx-image>
</view>
<view class="title">兑换成功</view>
<block>
<view class="text">您的订单已兑换成功,请耐心等待商品发货!</view>
<button class="btn" bindtap="viewOrderDetail">查看订单</button>
<view class="tips">{{count}}秒后自动跳转到订单详情页面</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
import { shopmallApi } from '~/api/api' // import { shopmallApi } from '~/api/api'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -39,14 +39,22 @@ Component({ ...@@ -39,14 +39,22 @@ Component({
// this.triggerEvent('getAddress', { addressInfo: this.data.addressInfo }) // this.triggerEvent('getAddress', { addressInfo: this.data.addressInfo })
this.cancel() this.cancel()
}, },
comfirm(e) { addNew () {
let { url } = e.currentTarget.dataset let { url } = e.currentTarget.dataset
wx.$router.go(url,{ wx.p.router.go(url,{
platform:true, platform:true,
staff:this.data.staff, staff:this.data.staff,
notIntercept:this.data.staff notIntercept:this.data.staff
}) })
// this.cancel() },
// 确认
confirm(e) {
let { address } = this.data
const item = address?.find(val => val.active == true)
if (!item || !Object.keys(item)?.length) return wx.p.wxApi.showToast('请选择收货地址')
const contactAddress = item.provinceName+item.cityName+item.countyName+item.address
this.triggerEvent('getAddress', {defaultAddress:item,contactAddress})
this.cancel()
}, },
cancel() { cancel() {
this.setData({ this.setData({
...@@ -55,9 +63,12 @@ Component({ ...@@ -55,9 +63,12 @@ Component({
}, },
toSelect(e) { toSelect(e) {
const { item } = e.currentTarget.dataset const { item } = e.currentTarget.dataset
const contactAddress = item.provinceName+item.cityName+item.countyName+item.address let { address } = this.data
this.triggerEvent('getAddress', {defaultAddress:item,contactAddress}) address?.forEach(val => {
this.cancel() val.active = false
if (item.id == val.id) val.active = true
})
this.setData({address})
}, },
addressList() { addressList() {
let para = {} let para = {}
...@@ -75,8 +86,8 @@ Component({ ...@@ -75,8 +86,8 @@ Component({
}, },
lifetimes: { lifetimes: {
attached: function () { attached: function () {
wx.$eventbus.on('REFRESH_PLATFORM_ADDRESS',()=>{ wx.p.eventbus.on('REFRESH_PLATFORM_ADDRESS',()=>{
this.addressList() // this.addressList()
}) })
}, },
}, },
......
...@@ -25,12 +25,11 @@ ...@@ -25,12 +25,11 @@
height: 80%; height: 80%;
box-sizing: border-box; box-sizing: border-box;
background: #FFFFFF; background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0; border-radius: 32rpx 32rpx 0 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
animation: show-sku-box .5s forwards; animation: show-sku-box .5s forwards;
z-index: 2; z-index: 2;
padding: 44rpx 40rpx;
} }
} }
...@@ -54,10 +53,9 @@ ...@@ -54,10 +53,9 @@
} }
.list-pannel { .list-pannel {
height: 868rpx; height: calc(100% - 260rpx);
.scroll { .scroll {
height: 868rpx; height: 100%;
} }
.cell { .cell {
...@@ -66,14 +64,10 @@ ...@@ -66,14 +64,10 @@
box-sizing: border-box; box-sizing: border-box;
padding: 32rpx 40rpx; padding: 32rpx 40rpx;
position: relative; position: relative;
.check-box {
margin-right: 20rpx;
.icon { .icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} margin-right: 24rpx;
} }
.content-box { .content-box {
...@@ -89,11 +83,14 @@ ...@@ -89,11 +83,14 @@
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #333435; color: #333435;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-height: 44rpx; line-height: 44rpx;
margin: 4rpx 0 10rpx 0; margin: 4rpx 0 8rpx 0;
} }
.default-tip { .default-tip {
...@@ -129,14 +126,19 @@ ...@@ -129,14 +126,19 @@
padding: 0 32rpx; padding: 0 32rpx;
.btn { .btn {
width: 100%; width: calc(50% - 7rpx);
height: 80rpx; height: 80rpx;
background: #ffffff0f; background: #ffffff0f;
border: 2rpx solid #FC5B32; border: 2rpx solid #FB8A32;
border-radius: 8rpx; border-radius: 20rpx;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #EE7A31; color: #FB8A32;
margin-right: 17rpx;
}
.confirm_btn {
background: #FB8A32;
color: #FFFFFF;
} }
} }
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
<view class="address-bg" bindtap="cancel"></view> <view class="address-bg" bindtap="cancel"></view>
<view class="container"> <view class="container">
<view class="headeer flex_sbc"> <view class="headeer flex_sbc">
<!-- <glsx-image bind:tap="back" webp class="icon" src="glsx/equity/version/3_9_0/back-icon.png"></glsx-image> --> <glsx-image bind:tap="cancel" class="icon" src="/index/back.png"></glsx-image>
<view></view>
<view class="title">选择收货地址</view> <view class="title">选择收货地址</view>
<glsx-image bind:tap="cancel" webp class="icon" src="glsx/equity/version/3_9_0/close-icon.png"></glsx-image> <glsx-image bind:tap="cancel" webp class="icon" src="/index/close.png"></glsx-image>
</view> </view>
<view class="list-pannel"> <view class="list-pannel">
<scroll-view class="scroll" scroll-y="{{true}}"> <scroll-view class="scroll" scroll-y="{{true}}">
<block wx:for="{{address}}" wx:key="index"> <block wx:for="{{address}}" wx:key="index">
<view bind:tap="toSelect" data-item="{{item}}" data-index="{{index}}" class="cell"> <view bind:tap="toSelect" data-item="{{item}}" data-index="{{index}}" class="cell">
<view class="check-box"> <view class="icon">
<glsx-image webp class="icon" src="glsx/equity/version/3_9_0/{{currentIndex==index?'select-icon-active':'select-icon'}}.png"></glsx-image> <icon type="{{item.active?'success':'circle'}}" color="{{item.active?'#FB8A32':'#B1B1B3'}}" size="20">
</icon>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="name-phone">{{item.receiveName}} {{item.receiveMobile}}</view> <view class="name-phone">{{item.receiveName}} {{item.receiveMobile}}</view>
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
</scroll-view> </scroll-view>
</view> </view>
<view class="footer flex_cc"> <view class="footer flex_cc">
<view bind:tap="comfirm" data-url="/packageShopmall/packageMine/pages/address/detail/detail" class="btn flex_cc">新增地址</view> <view bind:tap="addNew" data-url="/packageShopmall/packageMine/pages/address/detail/detail" class="btn flex_cc">新增地址</view>
<view bind:tap="confirm" class="btn confirm_btn flex_cc">确认</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -48,7 +48,6 @@ Component({ ...@@ -48,7 +48,6 @@ Component({
}) })
}, },
toShowAddressModal() { toShowAddressModal() {
console.log('222')
this.setData({ this.setData({
showAddress: true showAddress: true
}) })
...@@ -66,8 +65,8 @@ Component({ ...@@ -66,8 +65,8 @@ Component({
}) })
}, },
toCreatedOrder() { toCreatedOrder() {
const userInfo = wx.$util.getUserInfo() // const userInfo = wx.p.util.getUserInfo()
const userStorage = wx.$storage.get("userInfo"); // const userStorage = wx.$storage.get("userInfo");
const { remain, goods, goodsNumber, defaultAddress,staffShop } = this.data const { remain, goods, goodsNumber, defaultAddress,staffShop } = this.data
if(!defaultAddress.receiveName){ if(!defaultAddress.receiveName){
return wx.$api.showToast('请选择收货地址') return wx.$api.showToast('请选择收货地址')
...@@ -95,7 +94,7 @@ Component({ ...@@ -95,7 +94,7 @@ Component({
shopmallApi[HTTPNAME](params).then(res => { shopmallApi[HTTPNAME](params).then(res => {
if(staffShop&&!goods.salePrice){ if(staffShop&&!goods.salePrice){
wx.hideLoading(); wx.hideLoading();
wx.$router.reLaunch('/packageStoreAssistant/packageMine/pages/ShopPaySuccess/index') wx.p.router.reLaunch('/packageStoreAssistant/packageMine/pages/ShopPaySuccess/index')
return return
} }
if (res) this.toPayOrder(res.orderCode) if (res) this.toPayOrder(res.orderCode)
...@@ -116,7 +115,7 @@ Component({ ...@@ -116,7 +115,7 @@ Component({
paySign: paySign, paySign: paySign,
success() { success() {
const URL = staffShop?'/packageStoreAssistant/packageMine/pages/ShopPaySuccess/index':'/packageShopmall/packageMine/pages/order/complete/complete' const URL = staffShop?'/packageStoreAssistant/packageMine/pages/ShopPaySuccess/index':'/packageShopmall/packageMine/pages/order/complete/complete'
wx.$router.reLaunch(URL, { wx.p.router.reLaunch(URL, {
success: true, success: true,
}) })
}, },
...@@ -128,18 +127,20 @@ Component({ ...@@ -128,18 +127,20 @@ Component({
}) })
} }
if(staffShop){ if(staffShop){
wx.$eventbus.emit('REFRESH_WITHDRALWAL') wx.p.eventbus.emit('REFRESH_WITHDRALWAL')
} }
}) })
}, },
// 检查登录状态 // 检查登录状态
async checkLoginStatus() { async checkLoginStatus() {
this.toCreatedOrder()
return
if(this.data.staffShop){ if(this.data.staffShop){
this.setData({showJfModal:true}) this.setData({showJfModal:true})
return return
} }
const sessionId = wx.$util.getSessionId(), const sessionId = wx.p.util.getSessionId(),
userInfo = wx.$util.getUserInfo() || null; userInfo = wx.p.util.getUserInfo() || null;
if ((userInfo && !userInfo.phone) || !userInfo) return this.reLogin() if ((userInfo && !userInfo.phone) || !userInfo) return this.reLogin()
if (sessionId) { if (sessionId) {
const { const {
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<view bind:tap="toShowAddressModal" class="adress-box flex_scb"> <view bind:tap="toShowAddressModal" class="adress-box flex_scb">
<view class="title">收货地址</view> <view class="title">收货地址</view>
<view class="right flex_scb"> <view class="right flex_scb">
<view class=" content {{defaultAds?'':'emptyText'}}">{{defaultAds || '请选择'}}</view> <view class="content {{defaultAds?'':'emptyText'}}">{{defaultAds || '请选择'}}</view>
<mp-icon icon="arrow" bind:tap="showSkuModal" color="#B1B1B3" size="{{10}}"></mp-icon> <mp-icon icon="arrow" bind:tap="showSkuModal" color="#B1B1B3" size="{{10}}"></mp-icon>
</view> </view>
</view> </view>
...@@ -52,5 +52,4 @@ ...@@ -52,5 +52,4 @@
<view style="height:290rpx"></view> <view style="height:290rpx"></view>
</view> </view>
</view> </view>
<address wx:if="{{showAddress}}" staff="{{staffShop}}" address="{{address}}" idIndex="{{defaultAddress.id}}" bind:getAddress="getAddress" show="{{showAddress}}"></address> <address staff="{{staffShop}}" address="{{address}}" idIndex="{{defaultAddress.id}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
<!-- <jf-modal bind:comfirmOrder="toCreatedOrder" count="{{jfCount || goods.redeemPoints}}" show="{{showJfModal}}"></jf-modal> -->
const navStyle = 'background-color: transparent;' const navStyle = 'background-color: transparent;'
let navBarHeight = 38 let navBarHeight = 38
import mallApi from '~/api/module/mall.js'
import cartApi from '~/api/module/cart.js'
// import { mineApi, shopmallApi } from '~/api/api' // import { mineApi, shopmallApi } from '~/api/api'
// import MineApi from '~/api/mineApi/index' // import MineApi from '~/api/mineApi/index'
// import NP from 'number-precision' // import NP from 'number-precision'
...@@ -22,16 +24,190 @@ Page({ ...@@ -22,16 +24,190 @@ Page({
isCarOwner: false, isCarOwner: false,
payWayActions: [{ name: '金额支付', type: 1, disabled: false }, { name: '积分兑换', type: 2, disabled: false }], payWayActions: [{ name: '金额支付', type: 1, disabled: false }, { name: '积分兑换', type: 2, disabled: false }],
detailInfo: { detailInfo: {
pointsPrice: 25, "id" : 267,
marketPrice: 30, "goodsSkuCode" : "2888888889071442",
imageResponses: [{ "goodsSkuName" : "系统商品009 鹅黄 28寸",
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/index-bg.png' "goodsSkuTitle" : "",
}], "firstCategoryName" : "箱包",
saleNum: 600, "secondCategoryName" : "功能箱包",
remaining: 56, "lastCategoryName" : "拉杆箱",
goodsName: '九阳保温饭盒焖烧杯九阳保温饭盒焖烧杯九阳保温饭盒焖烧杯九阳', "goodsStock" : 695,
goodsDescribe: '<figure class="image"><img src="https://img.yunzhonghe.com/image/1592793907468wHVTWiUHIc.png"></figure>' "salePrice" : 0.00,
} "redeemPoints" : 40,
"sellPrice" : 150.00,
"marketPrice" : 700.00,
"startQty" : 1,
"brandName" : "膳魔师",
"returnGoodsRules" : 1001,
"goodsCharacteristic" : "系统商品009",
"goodsUnit" : "",
"modelNumber" : "系统商品009",
"productPlace" : "",
"haveShelfLife" : 0,
"shelfLife" : "0",
"fragileGoods" : 0,
"grossWeight" : 0.0000,
"grossWeightUnit" : "kg",
"density" : 0.0000,
"extent" : 0,
"width" : 0,
"height" : 0,
"attributeResponses" : [ {
"attributeCode" : "1001",
"attributeName" : "锁具类型",
"attributeValueCode" : "2888888888892503",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "990",
"attributeName" : "拉杆种类",
"attributeValueCode" : "2888888888892497",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "995",
"attributeName" : "闭合方式",
"attributeValueCode" : "2888888888892500",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "992",
"attributeName" : "适用场景",
"attributeValueCode" : "2888888888892498",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "1003",
"attributeName" : "轮子种类",
"attributeValueCode" : "2888888888892505",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "997",
"attributeName" : "类别",
"attributeValueCode" : "2888888888892502",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "989",
"attributeName" : "商品产地",
"attributeValueCode" : "345",
"attributeValueName" : "中国"
}, {
"attributeCode" : "994",
"attributeName" : "适用性别",
"attributeValueCode" : "349",
"attributeValueName" : "女"
}, {
"attributeCode" : "1002",
"attributeName" : "适用人群",
"attributeValueCode" : "2888888888892504",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "991",
"attributeName" : "是否带锁",
"attributeValueCode" : "348",
"attributeValueName" : "是"
}, {
"attributeCode" : "996",
"attributeName" : "箱包硬度",
"attributeValueCode" : "2888888888892501",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "987",
"attributeName" : "商品毛重",
"attributeValueCode" : "2888888888892496",
"attributeValueName" : "系统商品009"
}, {
"attributeCode" : "993",
"attributeName" : "材质",
"attributeValueCode" : "2888888888892499",
"attributeValueName" : "系统商品009"
} ],
"imageResponses" : [ {
"imgUrl" : "https://img.yunzhonghe.com/image/1618215408263PefyXSUtQW.jpg",
"imgMain" : 1,
"imgSort" : 0
}, {
"imgUrl" : "https://img.yunzhonghe.com/image/1618215556741tYVyESRNzw.jpg",
"imgMain" : 0,
"imgSort" : 1
} ],
"specificationResponses" : [ {
"specName" : "颜色",
"specValue" : "鹅黄"
}, {
"specName" : "选择尺寸",
"specValue" : "28寸"
} ],
"goodsDescribe" : "<p>22</p>",
"goodsPosition" : 2,
"saleFlag" : 1,
"shelvesStatus" : 1001,
"retailPrice" : null,
"exchangeIntegralFlag" : null,
"exchangeIntegral" : null,
"merchantId" : null,
"merchantName" : null
},
addressList: [{
id: 1,
receiveName: '何瑶',
receiveMobile: '15044526870',
provinceName: '广东省',
cityName: '深圳市',
countyName: '南山区',
address: '南山智园崇文园区1号楼14层',
isDefault: 1
}, {
id: 2,
receiveName: '何瑶',
receiveMobile: '15044526870',
provinceName: '广东省',
cityName: '深圳市',
countyName: '南山区',
address: '南山智园崇文园区1号楼14层',
isDefault: 0
}, {
id: 3,
receiveName: '何瑶',
receiveMobile: '15044526870',
provinceName: '广东省',
cityName: '深圳市',
countyName: '南山区',
address: '南山智园崇文园区1号楼14层',
isDefault: 0
}, {
id: 4,
receiveName: '何瑶',
receiveMobile: '15044526870',
provinceName: '广东省',
cityName: '深圳市',
countyName: '南山区',
address: '南山智园崇文园区1号楼14层',
isDefault: 0
}, {
id: 5,
receiveName: '何瑶',
receiveMobile: '15044526870',
provinceName: '广东省',
cityName: '深圳市',
countyName: '南山区',
address: '南山智园崇文园区1号楼14层',
isDefault: 0
}, {
id: 6,
receiveName: '何瑶',
receiveMobile: '15044526870',
provinceName: '广东省',
cityName: '深圳市',
countyName: '南山区',
address: '南山智园崇文园区1号楼14层',
isDefault: 0
}, {
id: 7,
receiveName: '何瑶',
receiveMobile: '15044526870',
provinceName: '广东省',
cityName: '深圳市',
countyName: '南山区',
address: '南山智园崇文园区1号楼14层',
isDefault: 0
}]
}, },
appHide() { appHide() {
wx.offAppHide() wx.offAppHide()
...@@ -73,7 +249,6 @@ Page({ ...@@ -73,7 +249,6 @@ Page({
// this.getPlatFormAddress(staff) // this.getPlatFormAddress(staff)
}, },
showSkuModal(type) { showSkuModal(type) {
console.log('111')
// if (this.data.isCarOwner) return // if (this.data.isCarOwner) return
this.setData({ this.setData({
showSku: true, showSku: true,
...@@ -92,7 +267,7 @@ Page({ ...@@ -92,7 +267,7 @@ Page({
if (staff) { if (staff) {
para.businessType = 1 para.businessType = 1
}else{ }else{
const SID = wx.$util.getSessionId() const SID = wx.p.util.getSessionId()
if (!SID) return wx.hideLoading() if (!SID) return wx.hideLoading()
} }
shopmallApi.platformAddressList(para).then(data => { shopmallApi.platformAddressList(para).then(data => {
...@@ -122,7 +297,7 @@ Page({ ...@@ -122,7 +297,7 @@ Page({
}, },
jump(e) { jump(e) {
let { url, isChooseAddress } = e.currentTarget.dataset let { url, isChooseAddress } = e.currentTarget.dataset
wx.$router.go(url, { wx.p.router.go(url, {
isChooseAddress, isChooseAddress,
platform: true, platform: true,
staff: this.data.staffShop, staff: this.data.staffShop,
...@@ -130,7 +305,7 @@ Page({ ...@@ -130,7 +305,7 @@ Page({
}) })
}, },
back() { back() {
wx.$router.back() wx.p.router.back()
}, },
changeTab(e) { changeTab(e) {
if (this.data.opacity < 0.8) return if (this.data.opacity < 0.8) return
...@@ -208,8 +383,8 @@ Page({ ...@@ -208,8 +383,8 @@ Page({
PARAMS.cartType = 4 PARAMS.cartType = 4
} }
if(isCarOwner&&!detailInfo.retailPrice&&detailInfo.exchangeIntegral)return if(isCarOwner&&!detailInfo.retailPrice&&detailInfo.exchangeIntegral)return
shopmallApi.platformAddCar(PARAMS).then(res => { cartApi.addToCart(PARAMS).then(res => {
wx.$api.showToast('添加成功!在购物车等亲~') wx.$api.showToast('加入购物车成功')
}) })
}, },
// 同步选择的地址 // 同步选择的地址
...@@ -320,7 +495,7 @@ Page({ ...@@ -320,7 +495,7 @@ Page({
}, },
onShareAppMessage: function () { onShareAppMessage: function () {
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id') const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
const userInfo = wx.$util.getUserInfo() const userInfo = wx.p.util.getUserInfo()
let { let {
detailInfo, detailInfo,
isCarOwner isCarOwner
......
...@@ -123,7 +123,6 @@ page { ...@@ -123,7 +123,6 @@ page {
height: 88rpx; height: 88rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
.flex { .flex {
width: 100%; width: 100%;
} }
...@@ -133,12 +132,16 @@ page { ...@@ -133,12 +132,16 @@ page {
color: #707071; color: #707071;
} }
.content { .content {
width: calc(100% - 140rpx); width: 520rpx;
text-overflow: ellipsis; height: 44rpx;
.address-text {
width: 520rpx;
overflow: hidden; overflow: hidden;
display: -webkit-box; white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all; word-break: break-all;
} }
}
.flex_ccc { .flex_ccc {
display: flex; display: flex;
justify-content: center; justify-content: center;
......
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
<view class="cell"> <view class="cell">
<view class="flex"> <view class="flex">
<view class="title">配送</view> <view class="title">配送</view>
<view bindtap="jump" data-is-choose-address data-url="/packageShopmall/packageMine/pages/address/index/index" class="content flex_ccc"> <view bindtap="jump" data-is-choose-address data-url="/packageMine/pages/address/index/index" class="content flex_ccc">
<view class="address-text">{{contactAddress || '--'}}</view> <view class="address-text">{{contactAddress || '--'}}</view>
</view> </view>
</view> </view>
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon> <mp-icon icon="arrow" bindtap="jump" color="#B1B1B3" size="{{12}}"></mp-icon>
</view> </view>
<view class="cell"> <view class="cell">
<view class="title">服务</view> <view class="title">服务</view>
...@@ -116,4 +116,3 @@ ...@@ -116,4 +116,3 @@
<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> <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> </block>
<sku staffShop="{{staffShop}}" canPay="{{canPay}}" bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" wx:if="{{showSku}}" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" defaultAddress="{{defaultAddress}}" address="{{addressList}}"></sku> <sku staffShop="{{staffShop}}" canPay="{{canPay}}" bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" wx:if="{{showSku}}" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" defaultAddress="{{defaultAddress}}" address="{{addressList}}"></sku>
\ No newline at end of file \ No newline at end of file
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"mp-icon": "weui-miniprogram/icon/icon", "mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet",
"mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet" "Copy": "../../../components/Copy/Copy"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="text-box"> <view class="text-box">
<view class="header"> <view class="header">
<view class="title">商品寄回地址</view> <view class="title">商品寄回地址</view>
<view class="copy">复制</view> <Copy />
</view> </view>
<block wx:for="{{address}}" wx:key="index"> <block wx:for="{{address}}" wx:key="index">
<view class="item"> <view class="item">
......
// packageMine/pages/order/components/Copy/Copy.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"style": "v2"
}
.copy {
background: #e8e8ea;
border-radius: 18rpx;
font-weight: 400;
font-size: 22rpx;
color: #707071;
padding: 4rpx 18rpx;
}
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/order/components/Copy/Copy.wxml-->
<view class="copy">复制</view>
\ No newline at end of file \ No newline at end of file
...@@ -12,27 +12,38 @@ Component({ ...@@ -12,27 +12,38 @@ Component({
}, },
}, },
data: { data: {
list: [ timelineData: [
{
time: "",
tips: ["深圳市南山区南山智园崇文园区1号楼14层","何万瑞 15077226060"],
status:'address'
},
{ {
time: "2021-02-02 10:30:30", time: "2021-02-02 10:30:30",
tips: ["这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分"], tips: ["这是主要内容部分"],
status:'' title: "已发货",
type: 'normal',
active: true // 高亮显示
}, },
{ {
time: "2021-02-02 10:30:30", time: "2021-02-02 10:30:30",
tips: ["这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分"], tips: ["这是主要内容部分"],
status:'已离开' title:'运输中',
type: 'normal',
small: true, // 小点显示
active:false
}, },
{ {
time: "2021-02-02 10:30:30", time: "2021-02-02 10:30:30",
tips: ["这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分"], tips: ["这是主要内容部分11111111111",
status:'已离开' "这是主要内容部分11111111111",
"这是主要内容部分11111111111"
],
title:'运输中',
type: 'normal',
small: false, // 小点显示
active:false
}, },
{
title:'收货地址',
tips: ["这是主要内容部分"],
type: 'special' // 地址节点,使用专门的样式
}
], ],
}, },
}); });
\ No newline at end of file \ No newline at end of file
<view class="item"> <view class="item">
<TimeLine list="{{list}}"/> <TimeLine nodes="{{timelineData}}"/>
</view> </view>
\ No newline at end of file \ No newline at end of file
const { mockDeliveryInfoData } = require("./mock.js");
Component({
properties: {
showExpress: {
type: Boolean,
value: false,
},
expressInfo:{
type: Object,
value: {}
}
},
data: {
},
});
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"Express": "../Express/Express",
"Copy": "../Copy/Copy"
}
}
\ No newline at end of file \ No newline at end of file
.popup-content {
padding: 0 32rpx;
.express-info {
display: flex;
justify-content: space-between;
height: 88rpx;
border-bottom: 1px solid #eff0f2;
.express-info-item {
display: flex;
gap: 6rpx;
align-items: center;
font-weight: 400;
font-size: 28rpx;
color: #333435;
.logo {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
overflow: hidden;
transform: translateY(1rpx);
}
}
}
}
<popup show="{{showExpress}}" show-close-button="{{true}}" showFooter="{{false}}" headerColor="#F7F7F7" title="物流详情" bindconfirm="onConfirmPopup">
<view class="popup-content">
<view class="express-info">
<view class="express-info-item">
<view class="logo">
<glsx-image src="{{expressInfo.logo||'https://picsum.photos/200/200'}}" />
</view>
<text>{{expressInfo.name||"顺丰快递"}}</text>
<text>{{expressInfo.number||'SF12222222222222'}}</text>
</view>
<view class="express-info-item">
<Copy />
</view>
</view>
<Express />
</view>
</popup>
\ No newline at end of file \ No newline at end of file
const mockDeliveryInfoData = {
orderInfo: {
deliveryCompany: '深圳市南山区留仙大道3370号南山智园崇文园区1号楼14层深圳广联赛讯有限公司',
deliveryNumber: 'SF1234567890',
deliveryStatus: 2
},
deliveryStatus: {
1: "待发货",
2: "已发货",
3: "已收货",
}
};
module.exports = {
mockDeliveryInfoData
};
\ No newline at end of file \ No newline at end of file
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
} }
.order-bottom { .order-bottom {
height: 64rpx; height: 64rpx;
padding: 30rpx; padding-top: 24rpx;
border-top: 1rpx solid #f0f1f5; border-top: 1rpx solid #f0f1f5;
margin-top: 35rpx; margin-top: 35rpx;
} }
......
...@@ -13,6 +13,7 @@ Page({ ...@@ -13,6 +13,7 @@ Page({
...mockOrderDetailData, ...mockOrderDetailData,
OrderStatus, OrderStatus,
couponsList: [], couponsList: [],
isShowExpressPop:false,
orderObj: [ orderObj: [
{ {
label: "下单日期", label: "下单日期",
...@@ -137,4 +138,10 @@ Page({ ...@@ -137,4 +138,10 @@ Page({
qr: QR.createQrCodeImg(`t=1&c=${data}`), qr: QR.createQrCodeImg(`t=1&c=${data}`),
}); });
}, },
showExpressPop(){
console.log("🚀 ~ showExpressPop ~ showExpressPop:")
this.setData({
isShowExpressPop: true,
});
}
}); });
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"OrderGoods": "./components/OrderGoods/OrderGoods", "OrderGoods": "./components/OrderGoods/OrderGoods",
"OrderAmount": "./components/OrderAmount/OrderAmount", "OrderAmount": "./components/OrderAmount/OrderAmount",
"content": "/packageMine/pages/order/index/components/Content/Content", "content": "/packageMine/pages/order/index/components/Content/Content",
"Express": "./components/Express/Express" "Express": "../components/Express/Express",
"Expresspop": "../components/ExpressPop/ExpressPop"
} }
} }
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/detail/detail.wxss */ /* packageMine/pages/order/detail/detail.wxss */
.layout { .layout {
padding: 24rpx 32rpx 68rpx; padding: 24rpx 32rpx 68rpx;
.express-box{
position: relative;
.express-detail{
position: absolute;
right: 24rpx;
top:10rpx;
color: var(--btnColor);
font-weight: 400;
font-size: 24rpx;
}
}
} }
.status-box { .status-box {
......
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
<DeliveryInfo orderInfo="{{orderInfo}}" deliveryStatus="{{deliveryStatus}}"></DeliveryInfo> <DeliveryInfo orderInfo="{{orderInfo}}" deliveryStatus="{{deliveryStatus}}"></DeliveryInfo>
</BlockBox> </BlockBox>
<BlockBox> <BlockBox>
<view class="express-box" bindtap="showExpressPop">
<view class="express-detail" >物流详情 <mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon></view>
<Express /> <Express />
</view>
</BlockBox> </BlockBox>
<BlockBox> <BlockBox>
<OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo> <OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo>
...@@ -18,5 +21,6 @@ ...@@ -18,5 +21,6 @@
<BlockBox> <BlockBox>
<OrderAmount orderInfo="{{orderInfo}}"></OrderAmount> <OrderAmount orderInfo="{{orderInfo}}"></OrderAmount>
</BlockBox> </BlockBox>
<Expresspop showExpress="{{isShowExpressPop}}"/>
</view> </view>
</block> </block>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/express/express.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/express/express.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/order/express/express.wxml-->
<text>packageMine/pages/order/express/express.wxml</text>
\ No newline at end of file \ No newline at end of file
import { commonApi } from '~/api/module/common'
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/
Page({ Page({
/** /**
...@@ -11,7 +12,13 @@ Page({ ...@@ -11,7 +12,13 @@ Page({
count: 0, count: 0,
showChooseSource: false, showChooseSource: false,
showEnableWallet: false, showEnableWallet: false,
showEnableSuccess: false showEnableSuccess: false,
buttons: [{
text: '取消'
}, {
text: '同意',
extClass: 'btn_primary'
}]
}, },
changeLoginType() { changeLoginType() {
const { const {
...@@ -102,6 +109,22 @@ Page({ ...@@ -102,6 +109,22 @@ Page({
showTips(message) { showTips(message) {
wx.p.wxApi.showToast(typeof message == 'string' ? message : '请同意以下用户协议') wx.p.wxApi.showToast(typeof message == 'string' ? message : '请同意以下用户协议')
}, },
showModal() {
this.setData({
showAgreeModal: true
})
},
dialogConfirm(e) {
let { value } = e.detail
this.setData({
showAgreeModal: false
})
if (value == 1) {
this.setData({
isAgree: true
})
}
},
/**手机号短信登录 */ /**手机号短信登录 */
async phoneLogin() { async phoneLogin() {
const { const {
...@@ -109,17 +132,20 @@ Page({ ...@@ -109,17 +132,20 @@ Page({
captcha, captcha,
isAgree isAgree
} = this.data } = this.data
if (!isAgree) {
return this.showModal()
}
try { try {
if (!mobile) throw '请输入手机号' if (!mobile) throw '请输入手机号'
if (!captcha) throw '请输入验证码' if (!captcha) throw '请输入验证码'
if (!phoneRex.test(mobile)) throw '请输入正确的手机号' if (!phoneRex.test(mobile)) throw '请输入正确的手机号'
if (!isAgree) throw '请同意以下用户协议' // if (!isAgree) throw '请同意以下用户协议'
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
const { const {
code, code,
data, data,
message message
} = await wx.p.api.userApi.phoneLogin({ } = await commonApi.phoneSmsLogin({
mobile, mobile,
captcha, captcha,
sessionId: this.sessionId sessionId: this.sessionId
...@@ -144,18 +170,18 @@ Page({ ...@@ -144,18 +170,18 @@ Page({
try { try {
if (detail.errMsg && ['authorized', 'deny'].findIndex(e => detail.errMsg.toLowerCase().includes(e)) != -1) return if (detail.errMsg && ['authorized', 'deny'].findIndex(e => detail.errMsg.toLowerCase().includes(e)) != -1) return
if (!detail?.code) throw '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' if (!detail?.code) throw '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
if (!isAgree) throw '请同意以下用户协议' // if (!isAgree) throw '请同意以下用户协议'
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
const { const {
code, code,
data, data,
message message
} = await wx.p.api.userApi.authUserPhone(detail, this.sessionId) } = await commonApi.authPhoneLogin(detail, this.sessionId)
wx.hideLoading() wx.hideLoading()
if (code == '0') this.customerLoginCallBack(data) if (code == '0') this.customerLoginCallBack(data)
else throw message else throw message
} catch (error) { } catch (error) {
console.log(error) console.log(error, '222222')
this.showTips(error || '服务不可用') this.showTips(error || '服务不可用')
setTimeout(() => { setTimeout(() => {
this.onLoad() this.onLoad()
......
<view class="layout"> <view class="layout">
<view class="bg-top"> <view class="bg-top">
<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>
<view class="content" style="margin-top: {{navHeight}}px;"> <view class="content" style="margin-top: {{navHeight}}px;">
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
欢迎使用积分商城小程序 欢迎使用积分商城小程序
</view> </view>
<view class="login-img"> <view class="login-img">
<glsx-image src="login/login-img.png"></glsx-image> <glsx-image src="/login/login-img.png"></glsx-image>
</view> </view>
<view class="wx-box"> <view class="wx-box">
<block wx:if="{{!isAgree}}"> <block wx:if="{{!isAgree}}">
<button class="wx-auth-button text-center {{isAgree}}" bindtap="showTips">微信登录</button> <button class="wx-auth-button text-center {{isAgree}}" bindtap="showModal">微信登录</button>
</block> </block>
<block wx:else> <block wx:else>
<button open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber" class="wx-auth-button text-center">微信登录</button> <button open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber" class="wx-auth-button text-center">微信登录</button>
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
</view> </view>
<view class="type" bindtap="changeLoginType"> <view class="type" bindtap="changeLoginType">
<view class="icon"> <view class="icon">
<glsx-image src="login/{{loginType == 0?'phone':'wx'}}.png"></glsx-image> <glsx-image src="/login/{{loginType == 0?'phone':'wx'}}.png"></glsx-image>
</view> </view>
{{loginType == 0?'手机号':'微信登录'}} {{loginType == 0?'手机号':'微信登录'}}
</view> </view>
</view> </view>
<view class="tips text-center" bindtap="handleChangeAgree"> <view class="tips text-center" bindtap="handleChangeAgree">
<view class="check {{isAgree}}"> <view class="check {{isAgree}}">
<glsx-image src="login/check.png" class="icon"></glsx-image> <glsx-image src="/login/check.png" class="icon"></glsx-image>
</view> </view>
我已阅读并同意 我已阅读并同意
<text class="txt-orange" catchtap="handleAgree" data-name="privacy">《隐私协议》</text> <text class="txt-orange" catchtap="handleAgree" data-name="privacy">《隐私协议》</text>
...@@ -58,6 +58,13 @@ ...@@ -58,6 +58,13 @@
</view> </view>
</view> </view>
<glsx-privacy appletName="积分商城"></glsx-privacy> <glsx-privacy appletName="积分商城"></glsx-privacy>
<Dialog show="{{ showAgreeModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" title="隐私协议与用户协议">
<view class="suggest-box">
<view>为保障你的合法权益,请阅读并同意</view>
<text class="txt-orange" catchtap="handleAgree" data-name="privacy">《隐私协议》</text>
<text class="txt-orange" catchtap="handleAgree" data-name="agreement">《服务使用协议》</text>
</view>
</Dialog>
<!-- 积分来源选择 --> <!-- 积分来源选择 -->
<points-source show="{{showChooseSource}}" bindconfirm="pointSourceEvent"></points-source> <points-source show="{{showChooseSource}}" bindconfirm="pointSourceEvent"></points-source>
<!-- 开通钱包 --> <!-- 开通钱包 -->
......
...@@ -25,7 +25,9 @@ page{ ...@@ -25,7 +25,9 @@ page{
opacity: 1; opacity: 1;
} }
} }
.btn_primary {
color: #FB8A32;
}
.h1 { .h1 {
margin: 0 0 24rpx 80rpx; margin: 0 0 24rpx 80rpx;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="success-bg"></view> <view class="success-bg"></view>
<view class="success-content"> <view class="success-content">
<view class="content-bg"> <view class="content-bg">
<glsx-image src="login/success-bg.png"></glsx-image> <glsx-image src="/login/success-bg.png"></glsx-image>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="success-text">开通成功</view> <view class="success-text">开通成功</view>
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
<view class="wallet-bg"></view> <view class="wallet-bg"></view>
<view class="wallet-content"> <view class="wallet-content">
<view class="content-bg"> <view class="content-bg">
<glsx-image src="login/wallet-bg.png"></glsx-image> <glsx-image src="/login/wallet-bg.png"></glsx-image>
</view> </view>
<view class="close" bindtap="closeWallet"> <view class="close" bindtap="closeWallet">
<glsx-image src="login/wallet-close.png"></glsx-image> <glsx-image src="/login/wallet-close.png"></glsx-image>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="box-item" wx:for="{{stepDataArr}}" wx:key="index"> <view class="box-item" wx:for="{{stepDataArr}}" wx:key="index">
<view class="wallet-icon"> <view class="wallet-icon">
<glsx-image src="login/{{item.icon}}.png"></glsx-image> <glsx-image src="/login/{{item.icon}}.png"></glsx-image>
</view> </view>
<view> <view>
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
<view class="source-item" wx:for="{{sourceArr}}" wx:key="index" bindtap="checkSource" data-target="{{item}}" style="color: {{item.color}};background-image: {{item.background}};"> <view class="source-item" wx:for="{{sourceArr}}" wx:key="index" bindtap="checkSource" data-target="{{item}}" style="color: {{item.color}};background-image: {{item.background}};">
<view> <view>
<view class="source-icon"> <view class="source-icon">
<glsx-image src="login/{{item.icon}}.png"></glsx-image> <glsx-image src="/login/{{item.icon}}.png"></glsx-image>
</view> </view>
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
</view> </view>
<view class="item-check {{item.isChecked}}"> <view class="item-check {{item.isChecked}}">
<glsx-image src="login/source-check.png" class="icon"></glsx-image> <glsx-image src="/login/source-check.png" class="icon"></glsx-image>
</view> </view>
</view> </view>
</view> </view>
......
import cartApi from '~/api/module/cart.js'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
count: 0,
goodsList: [{ goodsList: [{
payeeMerchantId: 44184606, payeeMerchantId: 44184606,
payeeMerchantName: "广联嘀加平台超级管理员", payeeMerchantName: "广联嘀加平台超级管理员",
platform: false, platform: false,
upgrade: false, upgrade: false,
list: [{
activityId: null, activityId: null,
activityPrice: null, activityPrice: null,
cartType: 1, cartType: 1,
deliveryType: 2, deliveryType: 2,
flag: 2,
specificationData: '象牙白',
depositPrice: null, depositPrice: null,
expressFee: 10, expressFee: 10,
goodsId: 34, goodsId: 34,
...@@ -25,14 +28,63 @@ Page({ ...@@ -25,14 +28,63 @@ Page({
id: 355, id: 355,
memberPrice: null, memberPrice: null,
paymentType: null, paymentType: null,
retailPrice: "32.00", retailPrice: "32",
retainagePrice: null,
specificationKey: null,
userMerchantId: null,
}, {
payeeMerchantId: 44184606,
payeeMerchantName: "广联嘀加平台超级管理员",
platform: false,
upgrade: false,
activityId: null,
activityPrice: null,
cartType: 1,
deliveryType: 2,
depositPrice: null,
expressFee: 10,
goodsId: 34,
goodsImage: "https://scrm.test.glsx.com.cn/group1/M00/00/3F/wKgD3mF3f--AEfHQAAC-XmaLhCs352.png",
goodsName: "贝得车载吸尘器(蓝色)",
goodsNumber: 1,
goodsSkuCode: null,
goodsSource: null,
goodsStock: 9975,
id: 356,
memberPrice: null,
paymentType: null,
retailPrice: "32",
retainagePrice: null, retainagePrice: null,
specificationData: null, specificationData: null,
specificationKey: null, specificationKey: null,
userMerchantId: null, userMerchantId: null,
}] }, {
payeeMerchantId: 44184606,
payeeMerchantName: "广联嘀加平台超级管理员",
platform: false,
upgrade: false,
activityId: null,
activityPrice: null,
cartType: 1,
deliveryType: 2,
depositPrice: null,
expressFee: 10,
goodsId: 34,
goodsImage: "https://scrm.test.glsx.com.cn/group1/M00/00/3F/wKgD3mF3f--AEfHQAAC-XmaLhCs352.png",
goodsName: "贝得车载吸尘器(蓝色)",
goodsNumber: 1,
goodsSkuCode: null,
goodsSource: null,
goodsStock: 9975,
id: 357,
memberPrice: null,
paymentType: null,
retailPrice: "32",
retainagePrice: null,
specificationData: '等方式尽快发',
specificationKey: null,
userMerchantId: null,
}], }],
chooseIndex: null,
shoppingcartFlag: true shoppingcartFlag: true
}, },
goodsActionReady(e) { goodsActionReady(e) {
...@@ -41,116 +93,100 @@ Page({ ...@@ -41,116 +93,100 @@ Page({
}) })
}, },
changeCount(e) { changeCount(e) {
console.log(e)
let count = e.detail let count = e.detail
let { let {
index, index,
item, item
ind
} = e.currentTarget.dataset } = e.currentTarget.dataset
if (item.goodsNumber == count) return if (item.goodsNumber == count) return
let {
chooseIndex
} = this.data
this.setData({ this.setData({
[`goodsList[${index}].list[${ind}].goodsNumber`]: count [`goodsList[${index}].goodsNumber`]: count
}) })
if (chooseIndex == index) this.cheackAll(index) this.cheackAll()
wx.p.wxApi.showLoading('正在加载...') wx.p.wxApi.showLoading('正在加载...')
let params = { let para = {
id: item.id, goodsId: 1,
goodsId: item.goodsId, sellQty: count,
goodsNumber: count goodsSource: target?.goodsSource,
scoreSource: 1
} }
if (item.specificationKey) params.specificationKey = item.specificationKey cartApi.updateGoodsFormCart(para).then(res => {
wx.p.api.shopmallApi.updateShoppingcart(params).then(res => {
wx.hideLoading() wx.hideLoading()
}) })
}, },
choose(e) { choose(e) {
let { let {
index, index
ind
} = e.currentTarget.dataset } = e.currentTarget.dataset
let { let {
goodsList, goodsList
chooseIndex
} = this.data } = this.data
if (chooseIndex != null && chooseIndex != index) return if (goodsList[index].showDel) {
if (goodsList[index].list[ind].showDel) {
this.hide(e) this.hide(e)
return return
} }
this.setData({ this.setData({
[`goodsList[${index}].list[${ind}].active`]: !goodsList[index].list[ind].active [`goodsList[${index}].active`]: !goodsList[index].active
}) })
this.cheackAll(index) this.cheackAll()
}, },
cheackAll(index) { cheackAll() {
let count = 0 let count = 0
let sum = 0 let sum = 0
let { let {
goodsList goodsList
} = this.data } = this.data
let allActive = true
try { try {
goodsList[index].list.map(e => { goodsList?.map(e => {
if (!e.active) throw false if (!e.active || e.flag) throw false
}) })
} catch (error) { } catch (error) {
allActive = error
} }
goodsList[index].list.map(e => { goodsList?.map(e => {
if (e.active) { if (e.active) {
count += e.goodsNumber count += e.goodsNumber
sum += e.retailPrice * e.goodsNumber sum += e.retailPrice * e.goodsNumber
} }
}) })
this.setData({ this.setData({
[`goodsList[${index}].active`]: allActive,
count, count,
sum: sum == 0 ? 0 : Number(sum).toFixed(2), sum: sum == 0 ? 0 : Number(sum).toFixed(2),
chooseIndex: count == 0 ? null : index allActive: goodsList?.filter(item => item.flag == null).length == goodsList?.filter(val => val.active == true && val.flag == null)?.length
}) })
}, },
chooseAll(e) { chooseAll(e) {
let { let {
index
} = e.currentTarget.dataset
let {
goodsList, goodsList,
chooseIndex allActive
} = this.data } = this.data
if (chooseIndex != null && chooseIndex != index) return
let all = true
try { try {
goodsList[index].list.map(i => { goodsList?.map(val => {
if (!i.active) throw false if (!val.active || val.flag) throw false
}) })
} catch (error) { } catch (error) {
goodsList[index].list.map(i => (i.active = true)) goodsList?.map(val => {
all = error if (!val.flag) val.active = true
})
}
if (allActive) {
goodsList?.map((val, index) => {
val.active = false
})
} }
if (all) goodsList[index].list.map(i => (i.active = false))
this.setData({ this.setData({
goodsList goodsList,
allActive: !allActive
}) })
this.cheackAll(index) this.cheackAll()
}, },
checkOut() { checkOut() {
let { let {
chooseIndex,
goodsList goodsList
} = this.data } = this.data
let {
list,
payeeMerchantName,
} = goodsList[chooseIndex]
let data = [] let data = []
list.map(e => (e.active ? data.push(e) : '')) goodsList?.map(e => (e.active ? data.push(e) : ''))
wx.p.router.go('/packageMall/pages/pay/pay', { wx.p.router.go('/packageIndex/pages/confirmOrder/index', {
goodsList: data, goodsList: data
merchantName: payeeMerchantName
}) })
}, },
/** /**
...@@ -174,8 +210,7 @@ Page({ ...@@ -174,8 +210,7 @@ Page({
goodsList: data, goodsList: data,
shoppingcartFlag: true, shoppingcartFlag: true,
count: 0, count: 0,
sum: 0, sum: 0
chooseIndex: null
}) })
wx.hideLoading() wx.hideLoading()
}) })
...@@ -188,13 +223,15 @@ Page({ ...@@ -188,13 +223,15 @@ Page({
del(e) { del(e) {
wx.p.wxApi.showLoading('请稍后...') wx.p.wxApi.showLoading('请稍后...')
let { let {
id target
} = e.target.dataset } = e.target.dataset
let para = { let para = {
cartType: 1, goodsId: 1,
id sellQty: 0,
goodsSource: target?.goodsSource,
scoreSource: 1
} }
wx.p.api.shopmallApi.delShoppingcart(para).then(res => { cartApi.updateGoodsFormCart(para).then(res => {
wx.p.wxApi.showToast('删除成功') wx.p.wxApi.showToast('删除成功')
setTimeout(() => { setTimeout(() => {
this.getShoppingcartList() this.getShoppingcartList()
...@@ -230,12 +267,11 @@ Page({ ...@@ -230,12 +267,11 @@ Page({
goodsList goodsList
} = this.data } = this.data
let { let {
index, index
ind
} = e.currentTarget.dataset } = e.currentTarget.dataset
if (goodsList[index].list[ind].showDel) if (goodsList[index].showDel)
this.setData({ this.setData({
[`goodsList[${index}].list[${ind}].showDel`]: false [`goodsList[${index}].showDel`]: false
}) })
}, },
start(e) { start(e) {
...@@ -262,7 +298,7 @@ Page({ ...@@ -262,7 +298,7 @@ Page({
let result = clientX < startX let result = clientX < startX
if (Math.abs(angle) > 30) return if (Math.abs(angle) > 30) return
this.setData({ this.setData({
[`goodsList[${index}].list[${ind}].showDel`]: result [`goodsList[${index}].showDel`]: result
}) })
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -15,12 +15,12 @@ page { ...@@ -15,12 +15,12 @@ page {
color: #7A8299; color: #7A8299;
} }
.nothing .icon { .nothing .icon {
margin: 0 auto 32rpx; margin: 0 auto 20rpx;
width: 320rpx; width: 320rpx;
height: 300rpx; height: 300rpx;
} }
.box { .box {
padding: 24rpx var(--margin); padding: 24rpx;
} }
.item-box { .item-box {
margin-bottom: 24rpx; margin-bottom: 24rpx;
...@@ -29,19 +29,7 @@ page { ...@@ -29,19 +29,7 @@ page {
padding-left: 24rpx; padding-left: 24rpx;
} }
.item-box.disabled { .item-box.disabled {
opacity: .5; opacity: .7;
}
.item-box .top {
height: 80rpx;
display: flex;
align-items: center;
padding-right: 24rpx;
}
.item-box .top .icon {
margin-right: 18rpx;
}
.item-box .top .name {
width: calc(100% - 50rpx);
} }
.item-box .list { .item-box .list {
border-top: 2rpx solid #EFF0F2; border-top: 2rpx solid #EFF0F2;
...@@ -50,7 +38,7 @@ page { ...@@ -50,7 +38,7 @@ page {
width: 100%; width: 100%;
height: 208rpx; height: 208rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 8rpx; border-radius: 24rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
...@@ -70,7 +58,7 @@ page { ...@@ -70,7 +58,7 @@ page {
} }
.box .item .content .icon, .box .item .content .icon,
.box .item .content .goods-info .preview { .box .item .content .goods-info .preview {
margin-right: 20rpx; margin-right: 24rpx;
} }
.box .item .content .goods-info { .box .item .content .goods-info {
width: calc(100% - 60rpx); width: calc(100% - 60rpx);
...@@ -80,7 +68,7 @@ page { ...@@ -80,7 +68,7 @@ page {
.box .item .content .goods-info .preview { .box .item .content .goods-info .preview {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
border-radius: 8rpx; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
} }
.box .item .content .goods-info .text { .box .item .content .goods-info .text {
...@@ -95,20 +83,34 @@ page { ...@@ -95,20 +83,34 @@ page {
align-items: baseline; align-items: baseline;
justify-content: space-between; justify-content: space-between;
} }
.invalid {
color: #F13C3D;
}
.invalid-icon {
width: 64rpx;
height: 32rpx;
background: #E6E7EA;
border-radius: 4rpx;
color: #6E6E7A;
font-size: 20rpx;
text-align: center;
line-height: 32rpx;
}
.box .item .content .goods-info .text .price-box .price { .box .item .content .goods-info .text .price-box .price {
color: var(--btnColor); color: #FC5B32;
font-size: 36rpx; font-size: 36rpx;
display: flex; display: flex;
align-items: baseline; align-items: baseline;
font-weight: 500; font-weight: 700;
} }
.box .item .content .goods-info .text .price-box .price .unit { .box .item .content .goods-info .text .price-box .price text {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400;
} }
.box .item .del { .box .item .del {
width: 112rpx; width: 112rpx;
height: 100%; height: 100%;
background: var(--themeColor); background: #F75454;
transform: translateX(112rpx); transform: translateX(112rpx);
transition: all .5s; transition: all .5s;
color: #fff; color: #fff;
...@@ -118,19 +120,29 @@ page { ...@@ -118,19 +120,29 @@ page {
transform: translateX(0); transform: translateX(0);
} }
.goods-action { .goods-action {
padding: 10rpx var(--margin); padding: 10rpx 24rpx;
box-sizing: border-box; box-sizing: border-box;
height: 100rpx; height: 100rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.goods-action .all-check {
display: flex;
align-items: center;
font-size: 24rpx;
height: 64rpx;
padding-top: 8rpx;
.icon {
margin-right: 8rpx;
}
}
.goods-action .btn { .goods-action .btn {
width: 332rpx; width: 280rpx;
height: 80rpx; height: 80rpx;
color: #FFFFFF; color: #FFFFFF;
background: var(--btnColor); background: #FB8A32;
border-radius: var(--borderRadius); border-radius: 16rpx;
font-weight: 500; font-weight: 500;
padding: 0 !important; padding: 0 !important;
margin: 0 !important; margin: 0 !important;
...@@ -143,20 +155,20 @@ page { ...@@ -143,20 +155,20 @@ page {
} }
} }
.goods-action .total { .goods-action .total {
width: calc(100% - 360rpx);
font-size: 24rpx; font-size: 24rpx;
display: flex; display: flex;
align-items: baseline; align-items: baseline;
} }
.goods-action .total .price { .goods-action .total .price {
color: var(--btnColor); color: #FC5B32;
font-size: 40rpx; font-size: 40rpx;
display: flex; display: flex;
align-items: baseline; align-items: baseline;
font-weight: 500; font-weight: 700;
} }
.goods-action .total .price .unit { .goods-action .total .price text {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400;
} }
.specification { .specification {
font-size: 24rpx; font-size: 24rpx;
......
...@@ -13,45 +13,37 @@ ...@@ -13,45 +13,37 @@
<block wx:else> <block wx:else>
<view class="box"> <view class="box">
<block wx:for="{{goodsList}}" wx:key="index"> <block wx:for="{{goodsList}}" wx:key="index">
<view class="item-box {{chooseIndex != null && chooseIndex != index?'disabled':''}}"> <view class="item-box {{item.flag?'disabled':''}}">
<view class="top" catchtap="chooseAll" data-index="{{index}}" >
<view class="icon text-center">
<icon type="{{item.active?'success':'circle'}}" color="{{item.active?'#8A303A':'#B1B1B3'}}" size="20">
</icon>
</view>
<view class="name text-hide">
{{item.payeeMerchantName}}
</view>
</view>
<view class="list"> <view class="list">
<block wx:for="{{item.list}}" wx:for-item="i" wx:for-index="ind" wx:key="ind"> <view class="item {{item.showDel?'touch-move-active':''}}" data-index="{{index}}" data-ind="{{ind}}"
<view class="item {{i.showDel?'touch-move-active':''}}" data-index="{{index}}" data-ind="{{ind}}"
bindtouchstart="start" bindtouchmove="move"> bindtouchstart="start" bindtouchmove="move">
<view class="content" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}"> <view class="content" catchtap="choose" data-index="{{index}}" data-ind="{{ind}}">
<view class="icon"> <view class="icon" wx:if="{{!item.flag}}">
<icon type="{{i.active?'success':'circle'}}" color="{{i.active?'#8A303A':'#B1B1B3'}}" size="20"> <icon type="{{item.active?'success':'circle'}}" color="{{item.active?'#FB8A32':'#B1B1B3'}}" size="20">
</icon> </icon>
</view> </view>
<view wx:else class="invalid-icon">失效</view>
<view class="goods-info"> <view class="goods-info">
<view class="preview"> <view class="preview">
<image webp src="{{i.goodsImage}}"></image> <image webp src="{{item.goodsImage}}"></image>
</view> </view>
<view class="text"> <view class="text">
<view class="text-hide">{{i.goodsName}}</view> <view class="text-hide">{{item.goodsName}}</view>
<view class="specification" wx:if="{{i.specificationData}}">{{i.specificationData}}</view> <view class="specification" wx:if="{{item.specificationData}}">{{item.specificationData}}</view>
<view class="price-box"> <view class="price-box" wx:if="{{!item.flag}}">
<view class="price"> <view class="price">
<text class="unit">¥</text>{{i.retailPrice || 0}} {{item.retailPrice || 0}}
<text>积分</text>
</view> </view>
<stepper count="{{i.goodsNumber}}" max="{{i.goodsStock}}" catchchange="changeCount" <stepper count="{{item.goodsNumber}}" max="{{item.goodsStock}}" catchchange="changeCount"
data-index="{{index}}" data-ind="{{ind}}" data-item="{{i}}"></stepper> data-index="{{index}}" data-item="{{item}}"></stepper>
</view> </view>
<view wx:else class="invalid">该商品已下架/库存不足</view>
</view> </view>
</view> </view>
</view> </view>
<view class="del text-center" catchtap="del" data-id="{{i.id}}">删除</view> <view class="del text-center" catchtap="del" data-target="{{item}}">删除</view>
</view> </view>
</block>
</view> </view>
</view> </view>
</block> </block>
...@@ -62,9 +54,16 @@ ...@@ -62,9 +54,16 @@
<block wx:if="{{goodsList.length}}"> <block wx:if="{{goodsList.length}}">
<goods-action bindready="goodsActionReady" custom> <goods-action bindready="goodsActionReady" custom>
<view class="goods-action"> <view class="goods-action">
<view class="all-check" bindtap="chooseAll">
<view class="icon">
<icon type="{{allActive?'success':'circle'}}" color="{{allActive?'#FB8A32':'#B1B1B3'}}" size="20">
</icon>
</view>
全选
</view>
<view class="total">合计: <view class="total">合计:
<view class="price"> <view class="price">
<text class="unit">¥</text>{{sum||0}} <text>积分</text>{{sum||0}}
</view> </view>
</view> </view>
<button class="btn text-center" bindtap="checkOut" disabled="{{count<1}}">结算({{count||0}})</button> <button class="btn text-center" bindtap="checkOut" disabled="{{count<1}}">结算({{count||0}})</button>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!