Commit 9c79d042 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 c0d80c49 5e6cdfae
...@@ -13,5 +13,19 @@ module.exports = { ...@@ -13,5 +13,19 @@ module.exports = {
method: 'scrm.api.shopmall.app.stockroom.goods.detail', method: 'scrm.api.shopmall.app.stockroom.goods.detail',
...data ...data
}) })
},
/**获取前端分类 */
getHomeCategoryList(data) {
return api.post({
method: 'scrm.api.shopmall.scrm.frontendcategory.listAll',
...data
})
},
/**确认订单下单 */
createOrder(data) {
return api.post({
method: 'scrm.api.shopmall.points.order.create',
...data
})
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<view class="text">请确认信息无误</view> <view class="text">请确认信息无误</view>
<view class="input-box"> <view class="input-box">
<view class="input-label">姓名</view> <view class="input-label">姓名</view>
<input bindinput="input" data-target="name" maxlength="10" value="{{walletObj.name}}" type="text" placeholder="请输入"/> <input bindinput="input" data-target="name" maxlength="20" value="{{walletObj.name}}" type="text" placeholder="请输入"/>
</view> </view>
<view class="input-box"> <view class="input-box">
<view class="input-label">手机号</view> <view class="input-label">手机号</view>
......
...@@ -44,4 +44,3 @@ ...@@ -44,4 +44,3 @@
</view> </view>
</template> </template>
</view> </view>
<sku bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" wx:if="{{showSku}}" show="{{showSku}}" clickType="{{'join'}}"></sku>
\ No newline at end of file \ No newline at end of file
...@@ -6,36 +6,189 @@ export const ToolList = Object.freeze([ ...@@ -6,36 +6,189 @@ export const ToolList = Object.freeze([
}, },
]); ]);
export const ORDER_LIST = [ export const OrderStatusEnum = {
{ ALL: "0",
PAY_PENDING: "10000", //待支付
WAIT_DELIVER: "10001", //待发货
WAIT_RECEIVE: "10002", //待收货
COMPLETED: "10003", //已完成
AFTER_SALE: "10004", //售后 (没有这个状态 显示用)
AFTER_SALE_PENDING_REVIEW: "10005", //售后中 -待审核
AFTER_SALE_WAIT_RECEIVE: "10006", //售后中 -待收货(审核通过)
AFTER_SALE_REJECTED: "10007", //售后审核不通过
AFTER_SALE_REFUNDED: "10008", //已退款
AFTER_SALE_REFUNDED_FAILED: "10009", //退款失败
};
export const OrderStatusTypes = {
QUERY_TAB: "QUERY_TAB",// 查询订单列表TAB项
MY_ORDER: "MY_ORDER",// 我的 页面 我的订单 显示的项目
};
export const GoodsSource = {
YZH: 1, //云中鹤订单
SELF: 2, //自营订单
};
export const OrderActionButtons = {
AFTER_SALE: {
text: "售后",
type: "cancelOrder",
class: "btn",
handler: "onAfterSale",
},
CONFIRM_RECEIVE: {
text: "确认收货",
type: "confirmReceive",
class: "btn",
handler: "onConfirmReceive",
},
SHOW_EXPRESS: {
text: "查看物流",
type: "showExpress",
class: "btn",
handler: "onShowExpress",
},
AFTER_SALE_DETAIL: {
text: "售后详情",
type: "after_sale_detail",
class: "btn",
handler: "onAfterSaleDetail",
},
AFTER_SALE_REJECTED: {
text: "审核不通过",
type: "after_sale_rejected",
class: "btn",
handler: "onAfterSaleDetail",
},
};
export const ORDER_STATUS = {
[OrderStatusEnum.ALL]: {
text: "全部", text: "全部",
code: 0, status: OrderStatusEnum.ALL,
index: 0, // 查询订单列表TAB高亮的索引
requestType: 0, // 查询订单列表TAB查询参数
type: OrderStatusTypes.QUERY_TAB, // 查询订单列表显示的TAB项
}, },
{ [OrderStatusEnum.PAY_PENDING]: {
text: "待支付", text: "待支付",
image: "noPay", image: "noPay",
code: 1, status: OrderStatusEnum.PAY_PENDING,
index: 1, // 查询订单列表TAB高亮的索引
requestType: 2,// 查询订单列表TAB查询参数
buttons: null,
type: OrderStatusTypes.MY_ORDER,//我的 页面 我的订单 显示的项目
}, },
{ [OrderStatusEnum.WAIT_DELIVER]: {
text: "待发货", text: "待发货",
image: "noTakeCommodity", image: "noTakeCommodity",
code: 2, status: OrderStatusEnum.WAIT_DELIVER,
}, index: 2,// 查询订单列表TAB高亮的索引
{ requestType: 6,// 查询订单列表TAB查询参数
type: OrderStatusTypes.MY_ORDER,//我的 页面 我的订单 显示的项目
buttons: {
[GoodsSource.SELF]: [OrderActionButtons.AFTER_SALE], //自营商品 在商品列表对应的按钮
[GoodsSource.YZH]: [OrderActionButtons.AFTER_SALE],//云中鹤商品 在商品列表对应的按钮
},
},
[OrderStatusEnum.WAIT_RECEIVE]: {
text: "待收货", text: "待收货",
image: "takeCommodity", image: "takeCommodity",
code: 3, status: 1008,
}, index: 3,// 查询订单列表TAB高亮的索引
{ requestType: 1,// 查询订单列表TAB查询参数
type: OrderStatusTypes.MY_ORDER,//我的 页面 我的订单 显示的项目
buttons: {
[GoodsSource.SELF]: [//自营商品 在商品列表对应的按钮
OrderActionButtons.AFTER_SALE,
OrderActionButtons.CONFIRM_RECEIVE,
OrderActionButtons.SHOW_EXPRESS,
],
[GoodsSource.YZH]: [//云中鹤商品 在商品列表对应的按钮
OrderActionButtons.AFTER_SALE,
OrderActionButtons.CONFIRM_RECEIVE,
OrderActionButtons.SHOW_EXPRESS,
],
},
},
[OrderStatusEnum.COMPLETED]: {
text: "已完成", text: "已完成",
code: 4, status: OrderStatusEnum.COMPLETED,
}, index: 4,// 查询订单列表TAB高亮的索引
{ requestType: 4,// 查询订单列表TAB查询参数
text: "售后", type: OrderStatusTypes.QUERY_TAB,// 查询订单列表显示的TAB项
buttons: {
[GoodsSource.SELF]: [//自营商品 在商品列表对应的按钮
OrderActionButtons.SHOW_EXPRESS,
OrderActionButtons.AFTER_SALE,
],
[GoodsSource.YZH]: [//云中鹤商品 在商品列表对应的按钮
OrderActionButtons.SHOW_EXPRESS,
OrderActionButtons.AFTER_SALE,
],
},
},
[OrderStatusEnum.AFTER_SALE]: {
text: "退货/售后",
my_order_text: "售后",
image: "aftermarket", image: "aftermarket",
code: 5, status: OrderStatusEnum.AFTER_SALE,
}, index: 5,// 查询订单列表TAB高亮的索引
]; requestType: 3,// 查询订单列表TAB查询参数
buttons: null,
type: OrderStatusTypes.MY_ORDER,//我的 页面 我的订单 显示的项目
},
[OrderStatusEnum.AFTER_SALE_PENDING_REVIEW]: {
text: "售后中",
status: OrderStatusEnum.AFTER_SALE_PENDING_REVIEW,
tips: "您可以尝试再次提交退款申请", //售后详情提示语
image: "mine/order/error.png",//售后详情页面显示的状态图标
buttons: {
[GoodsSource.SELF]: [OrderActionButtons.AFTER_SALE_DETAIL],//自营商品 在商品列表对应的按钮
[GoodsSource.YZH]: [OrderActionButtons.AFTER_SALE_DETAIL],//云中鹤商品 在商品列表对应的按钮
},
},
[OrderStatusEnum.AFTER_SALE_WAIT_RECEIVE]: {
text: "售后中",
status: OrderStatusEnum.AFTER_SALE_WAIT_RECEIVE,
tips: "您可以尝试再次提交退款申请", //售后详情提示语
image: "mine/order/error.png",//售后详情页面显示的状态图标
buttons: {
[GoodsSource.SELF]: [OrderActionButtons.AFTER_SALE_DETAIL],//自营商品 在商品列表对应的按钮
[GoodsSource.YZH]: [OrderActionButtons.AFTER_SALE_DETAIL],//云中鹤商品 在商品列表对应的按钮
},
},
[OrderStatusEnum.AFTER_SALE_REJECTED]: {
text: "审核不通过",
status: OrderStatusEnum.AFTER_SALE_REJECTED,
tips: "您可以尝试再次提交退款申请",//售后详情提示语
image: "mine/order/error.png",//售后详情页面显示的状态图标
buttons: {
[GoodsSource.SELF]: [OrderActionButtons.AFTER_SALE_REJECTED],//自营商品 在商品列表对应的按钮
[GoodsSource.YZH]: [OrderActionButtons.AFTER_SALE_REJECTED],//云中鹤商品 在商品列表对应的按钮
},
},
[OrderStatusEnum.AFTER_SALE_REFUNDED]: {
text: "已退款",
status: OrderStatusEnum.AFTER_SALE_REFUNDED,
tips: "您可以尝试再次提交退款申请",//售后详情提示语
image: "mine/order/error.png",//售后详情页面显示的状态图标
buttons: {
[GoodsSource.SELF]: [OrderActionButtons.AFTER_SALE_DETAIL],//自营商品 在商品列表对应的按钮
[GoodsSource.YZH]: [OrderActionButtons.AFTER_SALE_DETAIL],//云中鹤商品 在商品列表对应的按钮
},
},
[OrderStatusEnum.AFTER_SALE_REFUNDED_FAILED]: {
text: "退款失败",
status: OrderStatusEnum.AFTER_SALE_REFUNDED_FAILED,
tips: "您可以尝试再次提交退款申请",//售后详情提示语
image: "mine/order/error.png",//售后详情页面显示的状态图标
buttons: {
[GoodsSource.SELF]: [OrderActionButtons.AFTER_SALE_DETAIL],//自营商品 在商品列表对应的按钮
[GoodsSource.YZH]: [OrderActionButtons.AFTER_SALE_DETAIL],//云中鹤商品 在商品列表对应的按钮
},
},
};
export const RefundReason = [ export const RefundReason = [
{ {
...@@ -214,60 +367,60 @@ export const OrderStatus = [ ...@@ -214,60 +367,60 @@ export const OrderStatus = [
title: "待付款", title: "待付款",
value: "1", value: "1",
image: "mine/order-wait.png", image: "mine/order-wait.png",
tips:'待付款' tips: "待付款",
}, },
{ {
title: "已支付", title: "已支付",
value: "2", value: "2",
image: "mine/order-receiving.png", image: "mine/order-receiving.png",
tips:'已支付' tips: "已支付",
}, },
{ {
title: "已关闭", title: "已关闭",
value: "3", value: "3",
image: "mine/order-close.png", image: "mine/order-close.png",
tips:'已关闭' tips: "已关闭",
}, },
{ {
title: "已发货", title: "已发货",
value: "4", value: "4",
image: "mine/order-receiving.png", image: "mine/order-receiving.png",
tips:'已发货' tips: "已发货",
}, },
{ {
title: "已收货", title: "已收货",
value: "5", value: "5",
image: "mine/order-success.png", image: "mine/order-success.png",
tips:'已收货' tips: "已收货",
}, },
{ {
title: "待发货", title: "待发货",
value: "6", value: "6",
image: "mine/order-wait.png", image: "mine/order-wait.png",
tips:'待发货' tips: "待发货",
}, },
{ {
title: "待安装", title: "待安装",
value: "7", value: "7",
image: "mine/order-wait.png", image: "mine/order-wait.png",
tips:'待安装' tips: "待安装",
}, },
{ {
title: "已安装", title: "已安装",
value: "8", value: "8",
image: "mine/order-success.png", image: "mine/order-success.png",
tips:'已安装' tips: "已安装",
}, },
{ {
title: "售后中", title: "售后中",
value: "9", value: "9",
image: "mine/order-wait.png", image: "mine/order-wait.png",
tips:'售后中' tips: "售后中",
}, },
{ {
title: "售后完成", title: "售后完成",
value: "10", value: "10",
image: "mine/order-close.png", image: "mine/order-close.png",
tips:'售后完成' tips: "售后完成",
}, },
]; ];
...@@ -6,31 +6,7 @@ Page({ ...@@ -6,31 +6,7 @@ Page({
*/ */
data: { data: {
pageParams: {}, pageParams: {},
goodsList: [{ goodsList: []
goodsId: '1',
goodsUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png',
goodsName: 'Tempo得宝手帕纸',
salePoints: '10',
marketPrice: '15.9'
}, {
goodsId: '2',
goodsUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png',
goodsName: '维达抽纸超韧整箱M码家用实惠装面巾纸',
salePoints: '69.9',
marketPrice: '79.9'
}, {
goodsId: '3',
goodsUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.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'
}]
}, },
/** /**
......
...@@ -38,16 +38,16 @@ ...@@ -38,16 +38,16 @@
<view class="text"> <view class="text">
<view class="name"> <view class="name">
<view class="text-hide"> <view class="text-hide">
{{item.goodsName}} {{item.goodsSkuName}}
</view> </view>
<view class="text-hide description">{{item.specificationData || ''}}</view> <view class="text-hide description">{{item.specificationData || ''}}</view>
</view> </view>
<view class="price-box"> <view class="price-box">
<view class="price"> <view class="price">
{{item.retailPrice}} {{item.redeemPoints}}
<text>积分</text> <text>积分</text>
</view> </view>
<stepper data-item="{{item}}" count="{{item.goodsNumber}}" max="{{item.goodsStock}}" data-id="{{item.goodsId}}" bindchange="changeCount" data-index="{{index}}"></stepper> <stepper data-item="{{item}}" count="{{item.sellQty}}" max="{{item.goodsStock}}" data-id="{{item.id}}" bindchange="changeCount" data-index="{{index}}"></stepper>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -212,4 +212,6 @@ ...@@ -212,4 +212,6 @@
} }
.btn_primary { .btn_primary {
color: #FC5B32; color: #FC5B32;
font-size: 34rpx;
font-weight: 700;
} }
\ No newline at end of file \ No newline at end of file
...@@ -14,24 +14,18 @@ Page({ ...@@ -14,24 +14,18 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
wx.p.router.getRouterParams(options).then(params => { wx.p.router.getRouterParams(options).then(params => {
params = { this.countdown()
orderCode: '22232'
}
this.countdown(params.orderCode)
this.setData({
paramsData: params
})
}).catch(err => { }).catch(err => {
console.error('参数获取失败:', err) console.error('参数获取失败:', err)
}) })
}, },
countdown(orderCode) { countdown() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
let { count } = this.data let { count } = this.data
if (count == 0) { if (count == 0) {
clearInterval(this.timer) clearInterval(this.timer)
// wx.p.router.reLaunch('/packageMine/pages/order/detail/detail', {orderCode}) wx.p.router.reLaunch('/packageMine/pages/order/index/index')
return return
} }
this.setData({ this.setData({
...@@ -41,8 +35,8 @@ Page({ ...@@ -41,8 +35,8 @@ Page({
}, },
viewOrderDetail() { viewOrderDetail() {
let { paramsData } = this.data clearInterval(this.timer)
wx.p.router.reLaunch('/packageMine/pages/order/detail/detail', {orderCode: paramsData.orderCode}) wx.p.router.reLaunch('/packageMine/pages/order/index/index')
}, },
/** /**
......
import NP from "number-precision";
import cartApi from '~/api/module/cart.js'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -6,18 +8,29 @@ Component({ ...@@ -6,18 +8,29 @@ Component({
show: Boolean, show: Boolean,
address: Array, address: Array,
type: String, type: String,
goods: Object, goods: {
type: Object,
observer: function(n) {
this.setData({
detailInfo: JSON.parse(JSON.stringify(n))
}, () => {
this.setData({
['detailInfo.platformGlGoodsSpecifications[0].active']: true
})
})
}
},
defaultAddress: Object, defaultAddress: Object,
defaultAds: String, defaultAds: String,
staffShop:Boolean,
canPay:Boolean, canPay:Boolean,
clickType: String clickType: String
}, },
data: { data: {
currentIndex: 0, currentIndex: 0,
goodsNumber: 1, goodsNumber: 1,
showJfModal:false, showJfModal: false,
jfCount:0 jfCount: 0,
detailInfo: {}
}, },
/** /**
...@@ -25,9 +38,8 @@ Component({ ...@@ -25,9 +38,8 @@ Component({
*/ */
methods: { methods: {
computeJf(num) { computeJf(num) {
let {goods,jfCount,staffShop} = this.data let {detailInfo, jfCount} = this.data
if(!staffShop)return jfCount = NP.times(detailInfo.redeemPoints || 0, num)
jfCount = NP.times(goods.redeemPoints,num)
this.setData({ this.setData({
jfCount jfCount
}) })
...@@ -38,6 +50,24 @@ Component({ ...@@ -38,6 +50,24 @@ Component({
}) })
this.triggerEvent('cancelSku') this.triggerEvent('cancelSku')
}, },
choose(e) {
let { target } = e.currentTarget.dataset
let { detailInfo } = this.data
detailInfo?.platformGlGoodsSpecifications?.forEach(val => {
val.active = false
if (val.specificationData == target.specificationData) val.active = true
})
this.setData({
detailInfo,
['detailInfo.redeemPoints']: target.retailPrice,
['detailInfo.goodsStock']: target.stock,
['detailInfo.specificationData']: target.specificationData
})
const thisPage = wx.p.router.getPageInstance()
thisPage.setData({
activeSku: target.specificationData
})
},
changeCount(e) { changeCount(e) {
this.triggerEvent('getCount', e.detail) this.triggerEvent('getCount', e.detail)
this.computeJf(e.detail) this.computeJf(e.detail)
...@@ -51,45 +81,47 @@ Component({ ...@@ -51,45 +81,47 @@ Component({
showAddress: true showAddress: true
}) })
}, },
getAddress(e) {
this.setData({
defaultAds: e.detail.contactAddress,
defaultAddress: e.detail.defaultAddress
})
this.triggerEvent('sameAddress', e.detail)
},
intRemain(e) { intRemain(e) {
this.setData({ this.setData({
remain: e.detail.value remain: e.detail.value
}) })
}, },
toCreatedOrder() { toCreatedOrder() {
let { clickType } = this.data let { clickType, remain, detailInfo, defaultAddress, goodsNumber } = this.data
if (clickType != 'pay') { const userInfo = wx.p.storage.get('userInfo')
if (!['pay', 'join'].includes(clickType)) {
return this.cancel() return this.cancel()
} }
const { remain, goods, goodsNumber, defaultAddress,staffShop } = this.data detailInfo.sellQty = goodsNumber || detailInfo.sellQty
detailInfo?.platformGlGoodsSpecifications?.forEach(val => {
if (val.active) detailInfo.specificationData = val.specificationData
})
if (clickType == 'join') {
// 加入购物车
const PARAMS = {
goodsId: detailInfo.id,
sellQty: goodsNumber || detailInfo.startQty,
goodsSource: detailInfo.goodsSource,
scoreSource: userInfo?.channelSource,
specificationData: detailInfo?.specificationData,
merchantId: userInfo?.merchantId
}
wx.p.wxApi.showLoading()
cartApi.addToCart(PARAMS).then(res => {
wx.hideLoading()
wx.p.wxApi.showToast('加入购物车成功')
this.cancel()
})
return
}
if(!defaultAddress.receiveName){ if(!defaultAddress.receiveName){
return wx.p.wxApi.showToast('请选择收货地址') return wx.p.wxApi.showToast('请选择收货地址')
} }
// 跳转到确认订单 // 跳转到确认订单
let query = { let query = {
receiveName: defaultAddress.receiveName, defaultAddress,
receiveMobile: defaultAddress.receiveMobile,
provinceId: defaultAddress.provinceId,
provinceName: defaultAddress.provinceName,
cityId: defaultAddress.cityId,
cityName: defaultAddress.cityName,
countyId: defaultAddress.countyId,
countyName: defaultAddress.countyName,
address: defaultAddress.address,
customerOpenId:staffShop?userStorage.weChatOpenId:userInfo.openId,
buyerMsg: remain, buyerMsg: remain,
orderGoodsList: [{ goodsList: [{...detailInfo}],
goodsSkuCode: goods.goodsSkuCode,
goodsSkuName: goods.goodsSkuName,
sellQty: goodsNumber,
}],
} }
wx.p.router.go('/packageIndex/pages/confirmOrder/index', query) wx.p.router.go('/packageIndex/pages/confirmOrder/index', query)
} }
......
...@@ -84,21 +84,24 @@ ...@@ -84,21 +84,24 @@
flex-wrap: wrap; flex-wrap: wrap;
.sku { .sku {
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
background: #F7F8FA; background: #F7F8FA;
border-radius: 4rpx; font-weight: 400;
margin-right: 16rpx; font-size: 24rpx;
margin-bottom: 20rpx; border-radius: 12rpx;
margin-right: 16rpx;
margin-bottom: 20rpx;
} }
.sku_active { .sku_active {
background: #fc5b320f; background: #fc5b320f;
border: 2rpx solid #FC5B32; border: 2rpx solid #FC5B32;
border-radius: 4rpx;
font-weight: 400;
font-size: 24rpx;
color: #FC5B32; color: #FC5B32;
} }
.disabled{
background-color: #B1B1B3 !important;
color: #000000!important;
}
} }
} }
......
...@@ -4,34 +4,39 @@ ...@@ -4,34 +4,39 @@
<view class="container"> <view class="container">
<view class="goods-box flex_sc"> <view class="goods-box flex_sc">
<view class="cover"> <view class="cover">
<glsx-image class="cover" src="{{goods.imageResponses[0].imgUrl}}" /> <glsx-image class="cover" src="{{detailInfo.imageResponses[0].imgUrl}}" />
</view> </view>
<view class="right-box"> <view class="right-box">
<view class="price-box"> <view class="price-box">
<text class="price">{{goods.sellPrice}}</text><text>积分</text> <text class="price">{{detailInfo.redeemPoints}}</text><text>积分</text>
</view> </view>
<view wx:if="{{goods.stock}}" class="stock">有货(库存{{goods.stock}})</view> <view wx:if="{{detailInfo.stock}}" class="stock">有货(库存{{detailInfo.stock}})</view>
<view wx:else class="stock">暂无存货</view> <view wx:else class="stock">暂无存货</view>
<block> <block>
<view wx:if="{{goods.goodsSource == '2'}}" class="selct-box">已选:{{goods.specificationData}}</view> <view wx:if="{{detailInfo.goodsSource == 1}}" class="selct-box">已选:{{goodsNumber}}{{detailInfo.goodsUnit}}</view>
<view wx:else class="selct-box">已选:{{goodsNumber}}{{goods.goodsUnit}}</view> <view wx:else class="selct-box">已选:{{detailInfo.specificationData}}</view>
</block> </block>
</view> </view>
</view> </view>
<view class="sku-box"> <view class="sku-box">
<view class="title">规格</view> <view class="title">规格</view>
<view class="sku-list"> <view class="sku-list" wx:if="{{detailInfo.goodsSource == 1}}">
<block wx:for="{{goods.specificationResponses}}" wx:key="index"> <block wx:for="{{detailInfo.specificationResponses}}" wx:key="index">
<view class="sku flex_cc sku_active">{{item.specName}}:{{item.specValue}}</view> <view class="sku flex_cc sku_active">{{item.specName}}:{{item.specValue}}</view>
</block> </block>
</view> </view>
<view class="sku-list" wx:else>
<block wx:for="{{detailInfo.platformGlGoodsSpecifications}}" wx:key="index">
<view class="sku flex_cc {{item.active ? 'sku_active' : ''}} {{i.stock ===0?'disabled':''}}" bindtap="choose" data-target="{{item}}">{{item.specificationData}}</view>
</block>
</view>
</view> </view>
<view class="count-box flex_scb"> <view class="count-box flex_scb">
<view class="title">数量</view> <view class="title">数量</view>
<view class="right flex_sc"> <view class="right flex_sc">
<!-- <view class="tip">至少购买{{goods.startQty}}{{goods.goodsUnit}}</view> --> <!-- <view class="tip">至少购买{{goods.startQty}}{{goods.goodsUnit}}</view> -->
<view class="stepper"> <view class="stepper">
<stepper count="{{goodsNumber}}" min="{{goods.startQty}}" max="{{goods.goodsStock}}" catchchange="changeCount"></stepper> <stepper count="{{goodsNumber}}" max="{{detailInfo.goodsStock}}" catchchange="changeCount"></stepper>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -2,10 +2,7 @@ const navStyle = 'background-color: transparent;' ...@@ -2,10 +2,7 @@ const navStyle = 'background-color: transparent;'
let navBarHeight = 38 let navBarHeight = 38
import homeApi from '~/api/module/home.js' import homeApi from '~/api/module/home.js'
import cartApi from '~/api/module/cart.js' import cartApi from '~/api/module/cart.js'
// import { mineApi, shopmallApi } from '~/api/api' import mineApi from '~/api/module/mine.js'
// import MineApi from '~/api/mineApi/index'
// import NP from 'number-precision'
// import USERAPI from '~/api/usersApi/index'
Page({ Page({
data: { data: {
navStyle, navStyle,
...@@ -23,70 +20,23 @@ Page({ ...@@ -23,70 +20,23 @@ Page({
payWayActions: [{ name: '金额支付', type: 1, disabled: false }, { name: '积分兑换', type: 2, disabled: false }], payWayActions: [{ name: '金额支付', type: 1, disabled: false }, { name: '积分兑换', type: 2, disabled: false }],
detailInfo: {}, detailInfo: {},
addressList: [{ addressList: [{
id: 1, "userId" : 91713345,
receiveName: '何瑶1', "cityId" : null,
receiveMobile: '15044526870', "areaId" : 440305,
provinceName: '广东省', "createTime" : 1755922362000,
cityName: '深圳市', "provinceId" : null,
countyName: '南山区', "cityName" : "深圳市",
address: '南山智园崇文园区1号楼14层', "countyName" : "南山区",
isDefault: 1 "postCode" : "518000",
}, { "receiveName" : "qw",
id: 2, "provinceName" : "广东省",
receiveName: '何瑶2', "address" : "广东省深圳市南山区南山街道学府路30号",
receiveMobile: '15044526870', "updateTime" : null,
provinceName: '广东省', "isDefault" : 1,
cityName: '深圳市', "phoneNumber" : "18555558878",
countyName: '南山区', "id" : 58
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
}], }],
defaultAddress: {id: 3} defaultAddress: {}
}, },
appHide() { appHide() {
wx.offAppHide() wx.offAppHide()
...@@ -126,7 +76,8 @@ Page({ ...@@ -126,7 +76,8 @@ Page({
}) })
}, },
goodsActionClick(e) { goodsActionClick(e) {
if (e.detail == 'join') return this.toAddShopCar() let { detailInfo } = this.data
if (e.detail == 'join' && detailInfo.goodsSource == 1) return this.toAddShopCar()
this.showSkuModal(e.detail) this.showSkuModal(e.detail)
}, },
onLoad(options) { onLoad(options) {
...@@ -135,7 +86,7 @@ Page({ ...@@ -135,7 +86,7 @@ Page({
}).catch(err => { }).catch(err => {
console.error('参数获取失败:', err) console.error('参数获取失败:', err)
}) })
// this.getPlatFormAddress() this.getPlatFormAddress()
}, },
showSkuModal(type) { showSkuModal(type) {
this.setData({ this.setData({
...@@ -149,57 +100,54 @@ Page({ ...@@ -149,57 +100,54 @@ Page({
}) })
}, },
// 获取默认的地址 // 获取默认的地址
getPlatFormAddress(satff) { getPlatFormAddress() {
// wx.showLoading() let res = this.data.addressList
let para = {} let _isSetDefault = false, contactAddress = '', defaultAddress = {}
// if (staff) { if (res && res.length) {
// para.businessType = 1 res.forEach(el => {
// }else{ if (el.isDefault == 1) {
// const SID = wx.p.util.getSessionId() contactAddress = el.provinceName + el.cityName + el.countyName + el.address,
// if (!SID) return wx.hideLoading()
// }
let contactAddress = '', defaultAddress = {}
let _isSetDefault = false
this.data.addressList?.forEach(el => {
if (el.isDefault == 1) {
contactAddress = el.provinceName + el.cityName + el.countyName + el.address,
defaultAddress = el defaultAddress = el
_isSetDefault = true _isSetDefault = true
}
})
if (!_isSetDefault) {
let _first = res[0] || {}
contactAddress = _first.provinceName + _first.cityName + _first.countyName + _first.address,
defaultAddress = _first
} }
})
if (!_isSetDefault) {
let _first = this.data.addressList[0]
contactAddress = _first.provinceName + _first.cityName + _first.countyName + _first.address,
defaultAddress = _first
} }
this.setData({ this.setData({
addressList: res || [],
contactAddress, contactAddress,
defaultAddress defaultAddress
}) })
// shopmallApi.platformAddressList(para).then(data => { return
// wx.hideLoading() wx.p.wxApi.showLoading()
// let contactAddress = '', defaultAddress = {} mineApi.platformAddressList({}).then(res => {
// let _isSetDefault = false wx.hideLoading()
// if (data && data.length) { let _isSetDefault = false, contactAddress = '', defaultAddress = {}
// data.forEach(el => { if (res && res.length) {
// if (el.isDefault == 1) { res.forEach(el => {
// contactAddress = el.provinceName + el.cityName + el.countyName + el.address, if (el.isDefault == 1) {
// defaultAddress = el contactAddress = el.provinceName + el.cityName + el.countyName + el.address,
// _isSetDefault = true defaultAddress = el
// } _isSetDefault = true
// }) }
// if (!_isSetDefault) { })
// let _first = data[0] if (!_isSetDefault) {
// contactAddress = _first.provinceName + _first.cityName + _first.countyName + _first.address, let _first = res[0] || {}
// defaultAddress = _first contactAddress = _first.provinceName + _first.cityName + _first.countyName + _first.address,
// } defaultAddress = _first
// } }
// this.setData({ }
// addressList: data, this.setData({
// contactAddress, addressList: res || [],
// defaultAddress contactAddress,
// }) defaultAddress
// }) })
console.log(defaultAddress, '222')
})
}, },
// 显示地址选择弹窗 // 显示地址选择弹窗
toShowAddressModal() { toShowAddressModal() {
...@@ -232,13 +180,18 @@ Page({ ...@@ -232,13 +180,18 @@ Page({
}, },
// 获取详情 // 获取详情
getDetail(options) { getDetail(options) {
homeApi.getGoodsDetailInfo({id: options.id}).then(res => { homeApi.getGoodsDetailInfo({id: options.id, businessType: 1}).then(res => {
res.goodsSource = options.goodsSource
if (res && res.specificationResponses?.length) { if (res && res.specificationResponses?.length) {
this.toGetSpecString(res, res.startQty) this.toGetSpecString(res, res.startQty)
} }
if (res && res.platformGlGoodsSpecifications?.length) { if (res && res.platformGlGoodsSpecifications?.length) {
let item = res.platformGlGoodsSpecifications[0] || {}
res.redeemPoints = item.retailPrice
res.goodsStock = item.stock
res.specificationData = item.specificationData
this.setData({ this.setData({
activeSku: res.platformGlGoodsSpecifications[0].specificationData activeSku: item.specificationData
}) })
} }
this.setData({ this.setData({
...@@ -257,7 +210,8 @@ Page({ ...@@ -257,7 +210,8 @@ Page({
}) })
}, },
getCount(e) { getCount(e) {
this.toGetSpecString(this.data.detailInfo, e.detail) let { detailInfo } = this.data
if (detailInfo?.goodsSource == 1) this.toGetSpecString(this.data.detailInfo, e.detail)
this.count = e.detail this.count = e.detail
}, },
// 添加购物车 // 添加购物车
...@@ -267,12 +221,13 @@ Page({ ...@@ -267,12 +221,13 @@ Page({
const PARAMS = { const PARAMS = {
goodsId: detailInfo.id, goodsId: detailInfo.id,
sellQty: this.count || detailInfo.startQty, sellQty: this.count || detailInfo.startQty,
goodsSkuCode: detailInfo.goodsSkuCode, goodsSource: detailInfo.goodsSource || 1,
goodsSource: detailInfo.goodsSource, scoreSource: userInfo?.channelSource,
scoreSource: userInfo?.channelSource specificationData: detailInfo?.specificationData,
merchantId: userInfo?.merchantId
} }
cartApi.addToCart(PARAMS).then(res => { cartApi.addToCart(PARAMS).then(res => {
wx.$api.showToast('加入购物车成功') wx.p.wxApi.showToast('加入购物车成功')
}) })
}, },
// 同步选择的地址 // 同步选择的地址
...@@ -331,6 +286,5 @@ Page({ ...@@ -331,6 +286,5 @@ Page({
title, title,
path path
} }
}, }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<text>剩余 {{detailInfo.remaining}}</text> | <text>销售 {{detailInfo.saleNum}}</text> <text>剩余 {{detailInfo.remaining}}</text> | <text>销售 {{detailInfo.saleNum}}</text>
</view> </view>
</view> </view>
<view class="goods-title">{{detailInfo.brandName}}{{detailInfo.goodsSkuName}}</view> <view class="goods-title"><text wx:if="{{detailInfo.goodsSource == 1}}">{{detailInfo.brandName}}</text>{{detailInfo.goodsSkuName}}</view>
</view> </view>
<view class="container-item select-params-box"> <view class="container-item select-params-box">
<view class="cell" bind:tap="showSkuModal" data-type="choose"> <view class="cell" bind:tap="showSkuModal" data-type="choose">
...@@ -79,9 +79,24 @@ ...@@ -79,9 +79,24 @@
</view> </view>
<view class="goods-detail-box"> <view class="goods-detail-box">
<view class="title">商品详情</view> <view class="title">商品详情</view>
<view class="image-list-wrap"> <view class="image-list-wrap" wx:if="{{detailInfo.goodsSource == 1}}">
<mp-html content="{{detailInfo.goodsDescribe}}"></mp-html> <mp-html content="{{detailInfo.goodsDescribe}}"></mp-html>
</view> </view>
<view wx:else>
<block wx:for="{{goodsInfo.goodsDescList}}" wx:key="index">
<view class="content">
<block wx:if="{{item.resType == 1}}">
<image webp src="{{item.content}}" mode="widthFix" bindtap="previewImage" data-current="{{item.content}}" data-item="{{goodsInfo.goodsDescList}}" lazy-load></image>
</block>
<block wx:elif="{{item.resType == 2}}">
{{item.content}}
</block>
<block wx:else>
<video src="{{item.content}}" style="height:{{item.height}}px;width:100%"></video>
</block>
</view>
</block>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -111,5 +126,5 @@ ...@@ -111,5 +126,5 @@
<block wx:if="{{navHeight}}"> <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> <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 bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" clickType="{{clickType}}" address="{{addressList}}"></sku> <sku bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" clickType="{{clickType}}" address="{{addressList}}" defaultAddress="{{defaultAddress}}"></sku>
<address address="{{addressList}}" defaultAddress="{{defaultAddress}}" bind:getAddress="getAddress" show="{{showAddress}}"></address> <address address="{{addressList}}" defaultAddress="{{defaultAddress}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/selfGoodsDetail/index.js // packageIndex/pages/selfGoodsDetail/index.js
import homeApi from '~/api/module/home.js' import homeApi from '~/api/module/home.js'
import mineApi from '~/api/module/mine.js'
const navStyle = 'background-color: transparent;' const navStyle = 'background-color: transparent;'
let navBarHeight = 38 let navBarHeight = 38
Page({ Page({
...@@ -12,70 +13,23 @@ Page({ ...@@ -12,70 +13,23 @@ Page({
goodsFlag: true, goodsFlag: true,
goodsInfo: {}, goodsInfo: {},
addressList: [{ addressList: [{
id: 1, "userId" : 91713345,
receiveName: '何瑶1', "cityId" : null,
receiveMobile: '15044526870', "areaId" : 440305,
provinceName: '广东省', "createTime" : 1755922362000,
cityName: '深圳市', "provinceId" : null,
countyName: '南山区', "city" : "深圳市",
address: '南山智园崇文园区1号楼14层', "area" : "南山区",
isDefault: 1 "postCode" : "518000",
}, { "receiveName" : "qw",
id: 2, "province" : "广东省",
receiveName: '何瑶2', "address" : "广东省深圳市南山区南山街道学府路30号",
receiveMobile: '15044526870', "updateTime" : null,
provinceName: '广东省', "isDefault" : 1,
cityName: '深圳市', "phoneNumber" : "18555558878",
countyName: '南山区', "id" : 139
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
}], }],
defaultAddress: {id: 2} defaultAddress: {}
}, },
/** /**
...@@ -172,16 +126,42 @@ Page({ ...@@ -172,16 +126,42 @@ Page({
getDetail(options) { getDetail(options) {
homeApi.getGoodsDetailInfo({id: options.id}).then(res => { homeApi.getGoodsDetailInfo({id: options.id}).then(res => {
console.log(res) console.log(res)
if (res && res.platformGlGoodsSpecifications?.length) {
this.setData({
activeSku: res.platformGlGoodsSpecifications[0].specificationData,
['goodsInfo.redeemPoints']: res.platformGlGoodsSpecifications[0].retailPrice
})
}
}) })
let { goodsInfo } = this.data },
let activeSku = null
if (goodsInfo.specificationList && goodsInfo.specificationList.length) { // 获取地址
activeSku = goodsInfo.specificationDetailList[0].specificationData getPlatFormAddress(staff) {
goodsInfo.skuPrice = goodsInfo.specificationDetailList[0].retailPrice wx.p.wxApi.showLoading()
} mineApi.platformAddressList({}).then(data => {
this.setData({ console.log(data)
goodsInfo, wx.hideLoading()
activeSku let contactAddress = '', defaultAddress = {}
let _isSetDefault = false
if (data && data.length) {
data.forEach(el => {
if (el.isDefault == 1) {
contactAddress = el.provinceName + el.cityName + el.countyName + el.address,
defaultAddress = el
_isSetDefault = true
}
})
if (!_isSetDefault) {
let _first = data[0]
contactAddress = _first.provinceName + _first.cityName + _first.countyName + _first.address,
defaultAddress = _first
}
}
this.setData({
addressList: data,
contactAddress,
defaultAddress
})
}) })
}, },
......
...@@ -139,6 +139,7 @@ Page({ ...@@ -139,6 +139,7 @@ Page({
delete obj.createTime; delete obj.createTime;
delete obj.updateTime; delete obj.updateTime;
} }
console.log(obj, '===')
wx.p.api.mineApi[target](obj).then(() => { wx.p.api.mineApi[target](obj).then(() => {
wx.p.wxApi.showToast("操作成功"); wx.p.wxApi.showToast("操作成功");
setTimeout(() => { setTimeout(() => {
......
...@@ -36,6 +36,7 @@ Page({ ...@@ -36,6 +36,7 @@ Page({
contactAddress, contactAddress,
contactName: item.receiveName, contactName: item.receiveName,
contactPhone: item.phoneNumber, contactPhone: item.phoneNumber,
id: item.id
}, },
isDefault: item.isDefault == 1, isDefault: item.isDefault == 1,
}); });
......
...@@ -35,12 +35,16 @@ const GoodsSource ={ ...@@ -35,12 +35,16 @@ const GoodsSource ={
'SELF':2 'SELF':2
}; };
// const ActionMaps = { const ActionMaps = {
// [GoodsSource.SELF]:[ [GoodsSource.SELF]:{
// {text: '核验', type: 'verification', class: 'btn', handler: this.onVerification.bind(this)}
// ] },
// }; [GoodsSource.YZH]:{
}
};
import { ORDER_STATUS , OrderStatusEnum} from "~/constants/mine.js";
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -49,9 +53,10 @@ Component({ ...@@ -49,9 +53,10 @@ Component({
item: { item: {
type: Object, type: Object,
value: {}, value: {},
observer: function () { observer: function (d) {
console.log(d)
// 当item变化时重新计算按钮 // 当item变化时重新计算按钮
this.updateButtons(); d?.id && this.updateButtons();
}, },
}, },
hasUserInfo: { hasUserInfo: {
...@@ -59,7 +64,7 @@ Component({ ...@@ -59,7 +64,7 @@ Component({
value: false, value: false,
observer: function () { observer: function () {
// 当hasUserInfo变化时重新计算按钮 // 当hasUserInfo变化时重新计算按钮
this.updateButtons(); // this.updateButtons();
}, },
}, },
}, },
...@@ -76,6 +81,33 @@ Component({ ...@@ -76,6 +81,33 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
orderStatus(){
//订单状态 orderStatus (1001:待支付 1002:待审核,1003:审核不通过,1004:已取消(交易失败) ,1005:订单异常,1006:待处理,1007: 待发货,1008:已发货,1009:已完成(交易成功),1010:售后处理中,1012 订单关闭
//退换货状态 returnStatus (1000:待审核,1001:待收货,1002:已收货,1003:已退款,1004:已生成新订单,1005:已取消,1006:退款异常,1007:商品退回,1008:审核不通过,1010:换货新订单待收货,1011:换货新订单已签收)
//退款状态 refundStatus (1000:待审核,1001:待退款,1002:已退款,1003:已取消,1004:退款异常,1005:审核不通过)
//订单取消状态 cancelStatus(1000:取消成功,1010:取消审核中)
//退款状态 returnOrderStatus(1000:待审核,1001:审核通过,1002:已收货,1003:已退款,1004:已生成新订单,1005:审核不通过)
//goodsSource 1.云中鹤 2.平台商品
console.log(this.data.item)
const {orderStatus,goodsSource,cancelStatus,returnStatus,refundStatus,returnOrderStatus} = this.data.item
if([1002,1006,1007].includes(orderStatus) && (!cancelStatus || cancelStatus==1010)) {
return OrderStatusEnum.WAIT_DELIVER //待发货 order_status属于(1002,1006,1007)且cancel_status不存在或者审核中(1010)
} else if(orderStatus==1008 && (!cancelStatus || cancelStatus==1010)){
return OrderStatusEnum.WAIT_RECEIVE //待收货 order_status属于(1008)且cancel_status不存在或者审核中(1010)
} else if (orderStatus==1009 && (!cancelStatus || cancelStatus==1010)){
return OrderStatusEnum.COMPLETED //已完成 order_status属于(1009)且cancel_status不存在或者审核中(1010)
} else if((returnOrderStatus==1000 && returnStatus==1000) || (returnOrderStatus==1000 && refundStatus==1000)){
return OrderStatusEnum.AFTER_SALE_PENDING_REVIEW //售后---待审核 退款退货的return_order_status:1000:待审批且return_status退换货状态(1000:待审核) 仅退款的return_order_status:1000:待审批且refund_status 退款状态(1000:待审核
} else if(returnOrderStatus==1001 && returnStatus==1001){
return OrderStatusEnum.AFTER_SALE_WAIT_RECEIVE//售后---待收货(审核通过) 退款退货的return_order_status:1001:审核通过 且return_status退换货状态(1001:待收货),仅退款的直接到退款完成/退款失败
} else if((returnOrderStatus==1005 && returnStatus==1008) || (returnOrderStatus==1005 && refundStatus==1008)){
return OrderStatusEnum.AFTER_SALE_REJECTED //售后 -- 审核不通过 退款退货的return_order_status:1005:审核不通过且return_status退换货状态(1008:审核不通过), 仅退款的return_order_status:1005 且refund_status 退款状态(1008:审核不通过
} else if((returnOrderStatus==1003 && [1002,1003].includes(returnStatus))|| (returnOrderStatus==1003 && refundStatus==1002)){
return OrderStatusEnum.AFTER_SALE_REFUNDED // 已退款 退款退货的订单return_order_status:1003:已退款且return_status退换货状态(1002:已收货,1003:已退款),仅退款订单 return_order_status:1003:已退款且refund_status 退款状态1002:已退款,
} else if((returnOrderStatus==1003 && returnStatus==1006) || (returnOrderStatus==1003 && refundStatus==1004)){
return OrderStatusEnum.AFTER_SALE_REFUNDED_FAILED // 退款失败 退款退货的return_order_status:1003:已退款 return_status退换货状态(1006:退款异常 ,,仅退款的return_order_status:1003:已退款 且refund_status 退款状态,1004:退款异常
}
},
// 获取当前订单应该显示的按钮 // 获取当前订单应该显示的按钮
getButtons() { getButtons() {
const { item, hasUserInfo } = this.data; const { item, hasUserInfo } = this.data;
...@@ -173,9 +205,9 @@ Component({ ...@@ -173,9 +205,9 @@ Component({
) { ) {
buttons.push({ buttons.push({
text: "确认收货", text: "确认收货",
type: "confirmReceipt", type: "confirmReceive",
class: "btn confirm", class: "btn confirm",
handler: this.onConfirmReceipt.bind(this), handler: this.onConfirmReceive.bind(this),
}); });
} }
...@@ -260,7 +292,7 @@ Component({ ...@@ -260,7 +292,7 @@ Component({
// 更新按钮 // 更新按钮
updateButtons() { updateButtons() {
const buttons = this.getButtons(); const buttons = ORDER_STATUS[this.orderStatus()].buttons[2]//this.getButtons();
this.setData({ this.setData({
buttons, buttons,
orderItem: this.data.item, orderItem: this.data.item,
...@@ -368,7 +400,7 @@ Component({ ...@@ -368,7 +400,7 @@ Component({
}, },
// 确认收货 // 确认收货
onConfirmReceipt(e) { onConfirmReceive(e) {
let { orderCode } = let { orderCode } =
e.currentTarget.dataset.item || e.currentTarget.dataset; e.currentTarget.dataset.item || e.currentTarget.dataset;
wx.showModal({ wx.showModal({
......
import cartApi from '~/api/module/cart.js' import cartApi from '~/api/module/cart.js'
import NP from "number-precision";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
count: 0, count: 0,
goodsList: [{ goodsList: [],
payeeMerchantId: 44184606,
payeeMerchantName: "广联嘀加平台超级管理员",
platform: false,
upgrade: false,
activityId: null,
activityPrice: null,
cartType: 1,
deliveryType: 2,
flag: 2,
specificationData: '象牙白',
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: 355,
memberPrice: null,
paymentType: null,
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,
specificationData: 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: 357,
memberPrice: null,
paymentType: null,
retailPrice: "32",
retainagePrice: null,
specificationData: '等方式尽快发',
specificationKey: null,
userMerchantId: null,
}],
shoppingcartFlag: true shoppingcartFlag: true
}, },
goodsActionReady(e) { goodsActionReady(e) {
...@@ -94,26 +16,36 @@ Page({ ...@@ -94,26 +16,36 @@ Page({
}, },
changeCount(e) { changeCount(e) {
let count = e.detail let count = e.detail
let { userInfo } = this.data
let { let {
index, index,
item item
} = e.currentTarget.dataset } = e.currentTarget.dataset
if (item.goodsNumber == count) return if (item.sellQty == count) return
let { userInfo } = this.data
this.setData({
[`goodsList[${index}].goodsNumber`]: count
})
this.cheackAll()
wx.p.wxApi.showLoading('正在加载...')
let para = { let para = {
goodsId: 1, goodsId: item.goodsId,
sellQty: count,
goodsSource: item?.goodsSource, goodsSource: item?.goodsSource,
scoreSource: userInfo?.channelSource, scoreSource: userInfo?.channelSource,
merchantId: userInfo?.merchantId,
specificationData: item?.specificationData specificationData: item?.specificationData
} }
cartApi.updateGoodsFormCart(para).then(res => { this.setData({
wx.hideLoading() [`goodsList[${index}].sellQty`]: count
}, () => {
this.cheackAll()
wx.p.wxApi.showLoading()
// 调用添加购物车接口
if (count > item.sellQty) {
para.sellQty = NP.minus(count, item.sellQty) // 修改后数量减去之前数量
cartApi.addToCart(para).then(() => {
wx.hideLoading()
})
} else { // 调用减少物车商品接口
para.sellQty = NP.minus(item.sellQty, count)
cartApi.updateGoodsFormCart(para).then(res => {
wx.hideLoading()
})
}
}) })
}, },
choose(e) { choose(e) {
...@@ -146,8 +78,8 @@ Page({ ...@@ -146,8 +78,8 @@ Page({
} }
goodsList?.map(e => { goodsList?.map(e => {
if (e.active) { if (e.active) {
count += e.goodsNumber count += e.sellQty
sum += e.retailPrice * e.goodsNumber sum += e.redeemPoints * e.sellQty
} }
}) })
this.setData({ this.setData({
...@@ -190,31 +122,31 @@ Page({ ...@@ -190,31 +122,31 @@ Page({
let params = { let params = {
goodsList: data goodsList: data
} }
wx.p.router.go('/packageIndex/pages/confirmOrder/index', {...params}) wx.p.router.go('/packageIndex/pages/confirmOrder/index', params)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let userInfo = wx.p.storage.get(userInfo) let userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo}) this.setData({userInfo})
// this.getShoppingcartList() this.getShoppingcartList()
}, },
getShoppingcartList() { getShoppingcartList() {
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading()
let userInfo = wx.p.storage.get('userInfo')
let para = { let para = {
cartType: 1 scoreSource: userInfo?.channelSource,
merchantId: userInfo?.merchantId
} }
cartApi.getCartList(para) cartApi.getCartList(para)
.then(data => { .then(data => {
data.map(e => {
e.list.map(i => (i.retailPrice = Number(i.retailPrice).toFixed(2)))
})
this.setData({ this.setData({
goodsList: data, goodsList: data?.goodsList || [],
shoppingcartFlag: true, shoppingcartFlag: true,
count: 0, count: 0,
sum: 0 sum: 0,
allActive: false
}) })
wx.hideLoading() wx.hideLoading()
}) })
...@@ -225,23 +157,27 @@ Page({ ...@@ -225,23 +157,27 @@ Page({
}) })
}, },
del(e) { del(e) {
wx.p.wxApi.showLoading('请稍后...') wx.p.wxApi.showLoading()
let { let {
target target
} = e.target.dataset } = e.target.dataset
let { userInfo } = this.data let { userInfo } = this.data
// 删除调用减少商品数量接口
let para = { let para = {
goodsId: 1, goodsId: target.goodsId,
sellQty: 0, sellQty: target.sellQty,
goodsSource: target?.goodsSource, goodsSource: target?.goodsSource,
scoreSource: userInfo?.channelSource, scoreSource: userInfo?.channelSource,
merchantId: userInfo?.merchantId,
specificationData: target.specificationData specificationData: target.specificationData
} }
wx.p.wxApi.showLoading()
cartApi.updateGoodsFormCart(para).then(res => { cartApi.updateGoodsFormCart(para).then(res => {
wx.hideLoading()
wx.p.wxApi.showToast('删除成功') wx.p.wxApi.showToast('删除成功')
setTimeout(() => { setTimeout(() => {
this.getShoppingcartList() this.getShoppingcartList()
}, 1.5 * 1000) }, 0.5 * 1000)
}) })
}, },
/** /**
...@@ -251,7 +187,9 @@ Page({ ...@@ -251,7 +187,9 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () {}, onShow: function () {
this.getShoppingcartList()
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
......
...@@ -25,17 +25,17 @@ ...@@ -25,17 +25,17 @@
<view wx:else class="invalid-icon">失效</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="{{item.goodsImage}}"></image> <image webp src="{{item.goodsImageUrl}}"></image>
</view> </view>
<view class="text"> <view class="text">
<view class="text-hide">{{item.goodsName}}</view> <view class="text-hide">{{item.goodsSkuName}}</view>
<view class="specification" wx:if="{{item.specificationData}}">{{item.specificationData}}</view> <view class="specification" wx:if="{{item.specificationData}}">{{item.specificationData}}</view>
<view class="price-box" wx:if="{{!item.flag}}"> <view class="price-box" wx:if="{{!item.flag}}">
<view class="price"> <view class="price">
{{item.retailPrice || 0}} {{item.redeemPoints || 0}}
<text>积分</text> <text>积分</text>
</view> </view>
<stepper count="{{item.goodsNumber}}" max="{{item.goodsStock}}" catchchange="changeCount" <stepper count="{{item.sellQty}}" max="{{item.goodsStock}}" catchchange="changeCount"
data-index="{{index}}" data-item="{{item}}"></stepper> data-index="{{index}}" data-item="{{item}}"></stepper>
</view> </view>
<view wx:else class="invalid">该商品已下架/库存不足</view> <view wx:else class="invalid">该商品已下架/库存不足</view>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<scroll-view scroll-x class="fixed-tabs" scroll-into-view="{{to}}"> <scroll-view scroll-x class="fixed-tabs" scroll-into-view="{{to}}">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view <view
class="tab-item {{activeTab === item.id ? 'active' : ''}}" class="tab-item {{activeTab == item.id ? 'active' : ''}}"
bindtap="handleFixedTabChange" bindtap="handleFixedTabChange"
data-value="{{item.id}}" data-value="{{item.id}}"
id="to-{{item.id}}" id="to-{{item.id}}"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<scroll-view scroll-x class="dynamic-tabs" scroll-into-view="{{subTo}}"> <scroll-view scroll-x class="dynamic-tabs" scroll-into-view="{{subTo}}">
<block wx:for="{{subTab}}" wx:key="index"> <block wx:for="{{subTab}}" wx:key="index">
<view <view
class="tab-item {{activeSubTab === item.id ? 'active' : ''}}" class="tab-item {{activeSubTab == item.id ? 'active' : ''}}"
bindtap="handleDynamicTabChange" bindtap="handleDynamicTabChange"
data-value="{{item.id}}" data-value="{{item.id}}"
id="to-{{item.id}}" id="to-{{item.id}}"
......
...@@ -35,22 +35,7 @@ Page({ ...@@ -35,22 +35,7 @@ Page({
id: '4', id: '4',
label: '200-300积分' label: '200-300积分'
}], }],
subTab: [{ subTab: [],
id: '',
label: '全部品类'
}, {
id: '1',
label: '汽车保养'
}, {
id: '2',
label: '车载设备'
}, {
id: '3',
label: '个护清洁'
}, {
id: '4',
label: '休闲零食'
}],
activeTab: '', activeTab: '',
frontendCategoryId: '', frontendCategoryId: '',
goodsList: [] goodsList: []
...@@ -111,6 +96,7 @@ Page({ ...@@ -111,6 +96,7 @@ Page({
this.setData({loginPageFlag: params?.loginPageFlag}, () => { this.setData({loginPageFlag: params?.loginPageFlag}, () => {
this.getPointsWallet() this.getPointsWallet()
this.getGoodsList() this.getGoodsList()
this.getCategory()
}) })
}).catch(err => { }).catch(err => {
console.error('参数获取失败:', err) console.error('参数获取失败:', err)
...@@ -155,6 +141,22 @@ Page({ ...@@ -155,6 +141,22 @@ Page({
}) })
}, },
// 获取前端分类
getCategory() {
homeApi.getHomeCategoryList({}).then(res => {
res?.forEach(val => {
val.label = val.categoryName
})
res?.unshift({
id: '',
label: '全部分类'
})
this.setData({
subTab: res || []
})
})
},
// 获取商品数据 // 获取商品数据
getGoodsList() { getGoodsList() {
let { pageNum, goodsList, goodsSkuName, frontendCategoryId, activeTab } = this.data let { pageNum, goodsList, goodsSkuName, frontendCategoryId, activeTab } = this.data
...@@ -163,7 +165,8 @@ Page({ ...@@ -163,7 +165,8 @@ Page({
pageNum, pageNum,
pageSize: 4, pageSize: 4,
goodsSkuName, goodsSkuName,
frontendCategoryId frontendCategoryId,
businessType: 1
} }
if (activeTab == 1) { // 我能兑换 if (activeTab == 1) { // 我能兑换
params.canExchange = 1, params.canExchange = 1,
...@@ -175,10 +178,6 @@ Page({ ...@@ -175,10 +178,6 @@ Page({
params.storeEnd = activeTab == 2 ? 100 : activeTab == 3 ? 200 : activeTab == 4 ? 300 : '' params.storeEnd = activeTab == 2 ? 100 : activeTab == 3 ? 200 : activeTab == 4 ? 300 : ''
} }
homeApi.getGoodsStockroomList(params).then(res => { homeApi.getGoodsStockroomList(params).then(res => {
res?.list?.forEach((val, index) => {
if (index == 0 ) val.goodsSource = 2
else val.goodsSource = 1
})
this.setData({ this.setData({
goodsList: pageNum == 1 ? res?.list || [] : [...goodsList, ...res?.list], goodsList: pageNum == 1 ? res?.list || [] : [...goodsList, ...res?.list],
pages: res.pages, pages: res.pages,
......
// pages/tab/mine/components/myOrder/myOrder.js // pages/tab/mine/components/myOrder/myOrder.js
import { ORDER_LIST } from '~/constants/mine.js'; import { ORDER_STATUS, OrderStatusTypes } from "~/constants/mine.js";
Component({ Component({
/** /**
...@@ -13,7 +13,20 @@ Component({ ...@@ -13,7 +13,20 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
orderList: Object.freeze(ORDER_LIST.filter((item) => item.image)), orderList: Object.freeze(
Object.values(ORDER_STATUS).filter(
(item) => item.type == OrderStatusTypes.MY_ORDER
)
),
},
/**
* 组件生命周期
*/
lifetimes: {
attached() {
// 获取订单状态对应的图片
this.getOrderNumberList();
},
}, },
/** /**
...@@ -22,10 +35,25 @@ Component({ ...@@ -22,10 +35,25 @@ Component({
methods: { methods: {
goOrder(e) { goOrder(e) {
// 直接使用 ORDER_LIST 中的索引作为 tabIndex // 直接使用 ORDER_LIST 中的索引作为 tabIndex
const code = e.currentTarget.dataset.code; const index = e.currentTarget.dataset.index;
wx.p.router.go("/packageMine/pages/order/index/index", { wx.p.router.go("/packageMine/pages/order/index/index", {
code, index,
});
},
getOrderNumberList() {
const loginStatus = !wx.p.isLogin;
if (loginStatus) return;
wx.p.api.mineApi.getOrderNumberList().then((res) => {
this.setData({
orderNumberList: [
res.unPayCount,
res.unShippedCount,
res.unReceivedCount,
res.unServiceCount,
],
});
}); });
}, },
}, },
});
\ No newline at end of file \ No newline at end of file
});
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
</view> </view>
<view class="btnBox"> <view class="btnBox">
<view class="independentBox" wx:for="{{orderList}}" wx:key="index"> <view class="independentBox" wx:for="{{orderList}}" wx:key="index">
<view bindtap="goOrder" data-code="{{item.code}}"> <view bindtap="goOrder" data-index="{{item.index}}">
<view class="order-img"> <view class="order-img">
<glsx-image webp src="/mine/{{item.image}}.png"></glsx-image> <glsx-image webp src="/mine/{{item.image}}.png"></glsx-image>
</view> </view>
<text class="order-content">{{item.text}}</text> <text class="order-content">{{item.my_order_text||item.text}}</text>
<text class="order-number" wx:if="{{orderNumberList[index] != 0 && orderNumberList}}">{{orderNumberList[index]}}</text> <text class="order-number" wx:if="{{orderNumberList[index] != 0 && orderNumberList}}">{{orderNumberList[index]}}</text>
</view> </view>
</view> </view>
......
...@@ -162,7 +162,7 @@ Page({ ...@@ -162,7 +162,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.getOrderNumberList(); // this.getOrderNumberList();
this.toCheckMember(); // this.toCheckMember();
}, },
}); });
\ No newline at end of file \ No newline at end of file
...@@ -106,7 +106,6 @@ page { ...@@ -106,7 +106,6 @@ page {
.user-info { .user-info {
display: flex; display: flex;
align-items: center;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
...@@ -186,6 +185,12 @@ page { ...@@ -186,6 +185,12 @@ page {
padding: 0 24rpx; padding: 0 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.name {
max-width: 280rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.change_icon { .change_icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</view> </view>
<view class="phone">{{username}}{{userInfo.phone}}</view> <view class="phone">{{username}}{{userInfo.phone}}</view>
<view class="merchant_box" bindtap="changeMerchant"> <view class="merchant_box" bindtap="changeMerchant">
{{userInfo.merchantName}} <view class="name">{{userInfo.merchantName}}</view>
<view class="change_icon"> <view class="change_icon">
<glsx-image src="/mine/change.png"></glsx-image> <glsx-image src="/mine/change.png"></glsx-image>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!