diff --git a/pages/index/my.vue b/pages/index/my.vue
index 58ad3df..a7d2124 100644
--- a/pages/index/my.vue
+++ b/pages/index/my.vue
@@ -20,13 +20,14 @@
¥
- {{ remain }}
+ {{ fen2yuan(remain) }}
总获取积分 {{ userInfo.point }}
+ 冻结金额¥ {{ fen2yuan(freezePrice || 0) }}
-
+
规格值
-
+
{{ item.name }}
-
+
@@ -127,6 +131,7 @@ const inputFormdata = ref({
function addPropertyClick() {
propertyTitle.value = '新增'
inputFormdata.value.name = ''
+ inputFormdata.value.id = ''
inputDialogRef.value.open()
}
@@ -160,12 +165,11 @@ defineExpose({
.popup-content {
height: 500rpx;
padding: 40rpx;
- display: flex;
- flex-wrap: wrap;
- gap: 20rpx;
- justify-content: flex-start;
.property-item {
+ display: inline-block;
+ margin-right: 10px;
+ margin-bottom: 10px;
text-align: center;
line-height: 60rpx;
height: 60rpx;
diff --git a/pages/product/js/config.js b/pages/product/js/config.js
index f9b7475..104ab12 100644
--- a/pages/product/js/config.js
+++ b/pages/product/js/config.js
@@ -1,34 +1,34 @@
export const SPEC_TYPE = [
- {
- label: '单规格',
- value: false,
- },
- {
- label: '多规格',
- value: true,
- },
+ {
+ label: '单规格',
+ value: false,
+ },
+ {
+ label: '多规格',
+ value: true,
+ },
]
// sku 相关属性校验
export const SKU_RULE_CONFIG = [
- {
- name: 'stock',
- rule: (arg) => arg >= 0,
- message: '商品库存必须大于等于 1 !!!',
- },
- {
- name: 'price',
- rule: (arg) => arg >= 0.01,
- message: '商品销售价格必须大于等于 0.01 元!!!',
- },
- {
- name: 'marketPrice',
- rule: (arg) => arg >= 0.01,
- message: '商品市场价格必须大于等于 0.01 元!!!',
- },
- {
- name: 'costPrice',
- rule: (arg) => arg >= 0.01,
- message: '商品成本价格必须大于等于 0.00 元!!!',
- },
+ {
+ name: 'stock',
+ rule: (arg) => arg >= 0,
+ message: '商品库存必须大于等于 1 !!!',
+ },
+ {
+ name: 'price',
+ rule: (arg) => arg >= 0.01,
+ message: '商品销售价格必须大于等于 0.01 元!!!',
+ },
+ {
+ name: 'marketPrice',
+ rule: (arg) => arg >= 0.01,
+ message: '商品市场价格必须大于等于 0.01 元!!!',
+ },
+ {
+ name: 'costPrice',
+ rule: (arg) => arg >= 0.01,
+ message: '商品成本价格必须大于等于 0.01 元!!!',
+ },
]
diff --git a/pages/product/js/sku.js b/pages/product/js/sku.js
index 87d0e07..b65f441 100644
--- a/pages/product/js/sku.js
+++ b/pages/product/js/sku.js
@@ -29,11 +29,16 @@ async function showPropertyList() {
}
function onRDPickerConfirm(e) {
- formData.value.specType = SPEC_TYPE[e.value[0]].value
- formData.value.specText = SPEC_TYPE[e.value[0]].label
+ if (formData.value.specType !== SPEC_TYPE[e.value[0]].value) {
+ peach.$store('trade').specType = SPEC_TYPE[e.value[0]].value
+ peach.$store('trade').selectedProperty = []
- // 如果商品规格不一致,则需要重新初始化 sku 列表
- initSku()
+ formData.value.specType = SPEC_TYPE[e.value[0]].value
+ formData.value.specText = SPEC_TYPE[e.value[0]].label
+
+ // 如果商品规格不一致,则需要重新初始化 sku 列表
+ initSku()
+ }
}
function pickerProperty() {
@@ -46,6 +51,7 @@ function pickerProperty() {
async function onPropertyConfirm(e) {
await getGoodsProperty()
+ changeSubProperty()
}
function onConfirm() {
@@ -59,30 +65,32 @@ async function getGoodsProperty() {
// 把 propertyList 中 id 相同的属性合并,并去重
propertyList.value = peach.$store('trade').selectedProperty || []
+ let tempSkus = peach.$store('trade').skus || []
+
// 根据已经选择数据,设置默认选中
+
data.forEach((item) => {
// 判断属性是否已经选中
let propertyParent = propertyList.value.find((sitem) => sitem?.id === item.id)
item.checked = propertyParent ? true : false
- // 如果属性已经选中,查询子类中是否有选中
- if (item.checked) {
- item.propertyValues.forEach((child) => {
- let childResult = propertyParent?.children.some((schild) => schild === child.id)
- child.checked = childResult ? true : false
+ tempSkus.forEach((sitem) => {
+ sitem.properties.forEach((titem) => {
+ item.propertyValues.forEach((child) => {
+ if (!child.checked) {
+ child.checked = titem.valueId === child.id ? true : false
+ }
+ })
})
- }
+ })
})
goodsPropertyList.value = data
-
- console.log(goodsPropertyList.value)
}
function changeSubProperty() {
// 修改子属性状态,需要同步更新 skus 的显示
- console.log(goodsPropertyList.value)
// 过滤父属性 checked 选项,深拷贝避免后面循环改变元数据内容
let temp = JSON.parse(JSON.stringify(goodsPropertyList.value.filter((item) => item.checked)))
temp.forEach((item) => {
@@ -115,7 +123,32 @@ function changeSubProperty() {
tempSkus.push(obj)
}
+ tempSkus.forEach((item) => {
+ skus.value.forEach((sitem) => {
+ if (sitem.properties.length === item.properties.length && item.properties.length > 0) {
+ let sitemIds = sitem.properties.map((child) => child.valueId)
+ let itemIds = item.properties.map((tchild) => tchild.valueId)
+ let isExist = sitemIds.every((schild) => itemIds.includes(schild))
+
+ if (isExist) {
+ item.picUrl = sitem.picUrl
+ item.barCode = sitem.barCode
+ item.price = sitem.price
+ item.marketPrice = sitem.marketPrice
+ item.costPrice = sitem.costPrice
+ item.stock = sitem.stock
+ item.weight = sitem.weight
+ item.volume = sitem.volume
+ }
+ }
+ })
+ })
+
skus.value = tempSkus
+
+ peach.$store('trade').$patch({
+ skus: skus.value,
+ })
}
/**
@@ -168,6 +201,7 @@ function submitProperty() {
peach.$store('trade').$patch({
skus: skus.value,
specType: formData.value.specType,
+ isSave: true,
})
peach.$router.back()
} catch (e) {
@@ -278,10 +312,10 @@ const inputPropertyValueFormdata = ref({
remark: '',
})
function addPropertyValueClick(item) {
- console.log(item)
propertyValueTitle.value = '新增'
inputPropertyValueFormdata.value.name = ''
inputPropertyValueFormdata.value.propertyId = item.id
+ inputPropertyValueFormdata.value.id = ''
inputPropertyValueDialogRef.value.open()
}
@@ -296,11 +330,12 @@ async function dialogInputPropertyValueConfirm(value) {
await GoodsApi.createPropertyValue(inputPropertyValueFormdata.value)
}
await getGoodsProperty()
+ changeSubProperty()
+
inputPropertyValueDialogRef.value.close()
}
function longPropertyValuePress(item) {
- console.log(item)
if (canEdit.value) {
// 震动提示
uni.vibrateShort()
@@ -317,6 +352,7 @@ function longPropertyValuePress(item) {
if (res.tapIndex === 1) {
await GoodsApi.delPropertyValue({ id: item.id })
await getGoodsProperty()
+ changeSubProperty()
}
},
})
diff --git a/pages/product/manageGoods.vue b/pages/product/manageGoods.vue
index dda72f8..037ed6c 100644
--- a/pages/product/manageGoods.vue
+++ b/pages/product/manageGoods.vue
@@ -153,7 +153,7 @@
diff --git a/pages/user/wallet/withdraw.vue b/pages/user/wallet/withdraw.vue
index 096ac5a..48032ec 100644
--- a/pages/user/wallet/withdraw.vue
+++ b/pages/user/wallet/withdraw.vue
@@ -1,53 +1,97 @@
-
- 提现至
-
+ 提现至
-
+
- 其选择提现方式
- 立即到账
+ 微信
+ 极速到账
-
+
提现金额
-
-
- 全部提现
+
+
+ 全部提现
-
- 剩余额度¥{{ state.last }}
-
-
- 可用额度¥{{ state.canUse }}
-
+ 最低提现金额¥{{ config?.takingRule }}
+ 余额¥{{ fen2yuan(remain) }}
+
+
+ 提现费率{{ config?.takingRate }} 即每提现 1000 元扣除手续费¥{{ 1000 * config?.takingRate }}
-
@@ -63,14 +107,14 @@ const state = ref({
font-size: 26rpx;
.note {
- color: #b5b5b5
+ color: #b5b5b5;
}
}
}
}
.detail {
- background-color: rgba(236, 236, 236, .3);
+ background-color: rgba(236, 236, 236, 0.3);
border-radius: 20rpx;
.label {
@@ -79,7 +123,6 @@ const state = ref({
}
.account {
-
:deep(.uni-easyinput__content-input) {
font-size: 28px;
}
@@ -95,7 +138,7 @@ const state = ref({
.account::before {
content: '¥';
font-size: 48rpx;
- color: #333
+ color: #333;
}
.note {
@@ -103,7 +146,16 @@ const state = ref({
font-size: 26rpx;
}
+ .last {
+ color: #a3a3a3;
+ font-size: 26rpx;
+ margin-top: 5px;
+ }
+ .can-use {
+ color: #333;
+ font-size: 26rpx;
+ }
}
.footer-box {
@@ -120,4 +172,4 @@ const state = ref({
}
}
}
-
\ No newline at end of file
+
diff --git a/peach/api/pay/wallet.js b/peach/api/pay/wallet.js
index 92843c0..1e37d45 100644
--- a/peach/api/pay/wallet.js
+++ b/peach/api/pay/wallet.js
@@ -1,7 +1,46 @@
-import request from "@/peach/request";
+import request from '@/peach/request'
const PayWalletApi = {
- getWalletTransactionPage: () => {},
-};
+ // 提现余额
+ withdraw: (data) => {
+ return request({
+ url: '/pay/wallet/withdraw',
+ method: 'post',
+ data,
+ custom: {
+ showSuccess: true,
+ successMsg: '提现成功',
+ },
+ })
+ },
-export default PayWalletApi;
+ // 提现配置信息
+ withdrawConfig: () => {
+ return request({
+ url: '/shop/particulars-config/get',
+ method: 'get',
+ })
+ },
+
+ // 钱包流水记录
+ flowList: (params) => {
+ const queryString = Object.keys(params)
+ .map((key) => encodeURIComponent(key) + '=' + params[key])
+ .join('&')
+ return request({
+ url: `/pay/wallet-transaction/page?${queryString}`,
+ method: 'get',
+ })
+ },
+
+ // 钱包统计
+ statistics: (params) => {
+ const queryString = `createTime=${params.createTime[0]}&createTime=${params.createTime[1]}`
+ return request({
+ url: `/pay/wallet-transaction/get-summary?${queryString}`,
+ method: 'get',
+ })
+ },
+}
+
+export default PayWalletApi
diff --git a/peach/api/trade/goods.js b/peach/api/trade/goods.js
index f94f11e..6ce6fde 100644
--- a/peach/api/trade/goods.js
+++ b/peach/api/trade/goods.js
@@ -107,7 +107,7 @@ const GoodsApi = {
// 创建商品属性值
createPropertyValue: (data) => {
return request({
- url: '/property/value/create',
+ url: '/product/property/value/create',
method: 'POST',
data,
custom: {
@@ -118,7 +118,7 @@ const GoodsApi = {
// 删除商品属性值
delPropertyValue: (data) => {
return request({
- url: '/property/value/delete',
+ url: '/product/property/value/delete',
method: 'DELETE',
params: data,
custom: {
@@ -129,7 +129,7 @@ const GoodsApi = {
// 修改商品属性值
editPropertyValue: (data) => {
return request({
- url: '/property/value/update',
+ url: '/product/property/value/update',
method: 'PUT',
data,
custom: {
diff --git a/peach/components/p-goods-column/p-goods-column.vue b/peach/components/p-goods-column/p-goods-column.vue
index 8aa0af0..722a64a 100644
--- a/peach/components/p-goods-column/p-goods-column.vue
+++ b/peach/components/p-goods-column/p-goods-column.vue
@@ -1,58 +1,58 @@
-
-
-
-
-
-
- {{ data.title || data.name }}
-
-
- {{ data.subtitle || data.introduction }}
-
-
-
-
-
- {{ priceUnit }}
- {{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
-
-
- {{ priceUnit }}
- {{ fen2yuan(data.marketPrice) }}
-
-
-
- {{ salesAndStock }}
-
-
+
+
+
+
+
+
+ {{ data.title || data.name }}
+
+
+ {{ data.subtitle || data.introduction }}
+
+
+
+
+
+ {{ priceUnit }}
+ {{ isArray(data.price) ? fen2yuan(data.price[0]) : fen2yuan(data.price) }}
+
+ {{ priceUnit }}
+ {{ fen2yuan(data.marketPrice) }}
+
+
+
+ {{ salesAndStock }}
+
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/peach/store/trade.js b/peach/store/trade.js
index 5993c3a..7bc090c 100644
--- a/peach/store/trade.js
+++ b/peach/store/trade.js
@@ -2,32 +2,36 @@ import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
const useTradeStore = defineStore('trade', () => {
- // 已选择规格类型
- const selectedProperty = ref(null)
+ // 已选择规格类型
+ const selectedProperty = ref(null)
- // 商品信息
- const goodsInfo = ref(null)
+ // 商品信息
+ const goodsInfo = ref(null)
- // 详情标记
- const detailTag = ref('edit')
+ // 详情标记
+ const detailTag = ref('edit')
- // 规格类型,默认单规格
- const specType = ref(false)
+ // 是否触发保存操作
+ const isSave = ref(false)
- // 商品属性
- const skus = ref(null)
+ // 规格类型,默认单规格
+ const specType = ref(false)
- // 商品是否可编辑
- const canEdit = computed(() => (detailTag.value === 'detail' ? false : true))
+ // 商品属性
+ const skus = ref(null)
- return {
- selectedProperty,
- goodsInfo,
- skus,
- canEdit,
- detailTag,
- specType,
- }
+ // 商品是否可编辑
+ const canEdit = computed(() => (detailTag.value === 'detail' ? false : true))
+
+ return {
+ selectedProperty,
+ goodsInfo,
+ skus,
+ canEdit,
+ detailTag,
+ specType,
+ isSave,
+ }
})
export default useTradeStore