diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js
index c75d947c..bbdba913 100644
--- a/jiuyi2/api/shop.js
+++ b/jiuyi2/api/shop.js
@@ -135,6 +135,18 @@ const shop = {
})
},
+ /**
+ * 发布商品分类列表
+ * @param {Object} param
+ */
+ getSaveProCate(param) {
+ return util.request({
+ url: `/shopify/category/getListBySaveProduct`,
+ method: 'GET',
+ query: param.query,
+ })
+ },
+
/**
* 根据商品主键获取商品详情
* @param {Object} param
diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js
index 9fa6fc82..7a0f6484 100644
--- a/jiuyi2/common/js/config.js
+++ b/jiuyi2/common/js/config.js
@@ -7,8 +7,8 @@ const config = {
// #endif
// #ifndef H5
// host: 'http://91f.xyz:8080',
- host: 'http://liuyd.cpolar.top',
- // host: 'http://hpedc3.natappfree.cc',
+ // host: 'http://liuyd.cpolar.top',
+ host: 'http://5vpc5z.natappfree.cc',
// #endif
// 是否vivo显示
showVivo: true,
diff --git a/jiuyi2/components/shop/detail/detail.vue b/jiuyi2/components/shop/detail/detail.vue
index 569fe3ee..748b73fa 100644
--- a/jiuyi2/components/shop/detail/detail.vue
+++ b/jiuyi2/components/shop/detail/detail.vue
@@ -23,6 +23,9 @@
// 富文本处理
import parseRichText from '@/components/public/parse/parse.vue'
+ const {
+ proxy
+ } = getCurrentInstance()
// 传参
const props = defineProps({
id: {
@@ -34,10 +37,8 @@
default: {}
},
})
-
- const {
- proxy
- } = getCurrentInstance()
+ // 是否礼包商品
+ const giftPack = computed(() => props.detail.categoryCode?.startsWith('GIFT_PACK'))
// 在这里设置swiper高度补足多端差异
const bannerHeight = ref('800rpx')
// 轮播图详情
@@ -218,7 +219,7 @@
-
+
已售 {{detail.sales}}
@@ -247,7 +248,7 @@
-
+
假一赔十
@@ -267,7 +268,7 @@
-
+
@@ -319,7 +320,7 @@
-
+
@@ -158,8 +158,12 @@
商
+ 萬
+ 仟
+ 佰
- {{item.userNickname}}
+ {{item.userNickname}}
{{item.sonList.length}}
@@ -183,8 +187,14 @@
商
- {{secItem.userNickname}}
+ 萬
+
+ 仟
+
+ 佰
+ {{secItem.userNickname}}
{{secItem.count}}
@@ -214,6 +224,19 @@
}
}
+ // 实名
+ .nickname {
+ color: #333;
+
+ &.active {
+ color: #FF8400;
+ }
+
+ &.auth {
+ color: #FF0000;
+ }
+ }
+
// 箭头
.arrow {
&.active {
@@ -237,15 +260,6 @@
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
- // 实名
- .name {
- color: #FF8400;
-
- &.auth {
- color: #333;
- }
- }
-
// 二级列表
.list {
padding-left: .5em;
diff --git a/jiuyi2/pages/release/commodity.vue b/jiuyi2/pages/release/commodity.vue
index 92406880..b9dc729f 100644
--- a/jiuyi2/pages/release/commodity.vue
+++ b/jiuyi2/pages/release/commodity.vue
@@ -4,7 +4,8 @@
ref,
reactive,
getCurrentInstance,
- nextTick
+ nextTick,
+ computed,
} from 'vue'
//
import {
@@ -31,6 +32,8 @@
const category = reactive([])
// 分类下标
const categoryIndex = ref('')
+ // 当前选择的分类
+ const cateCurrent = computed(() => category[categoryIndex.value] || {categoryCode: ''})
onLoad((option) => {
if (option.id) {
@@ -101,9 +104,9 @@
// 获取商品分类
function getCategory() {
return new Promise((resolve, reject) => {
- api.shop.getCategory({
+ api.shop.getSaveProCate({
query: {
- categoryCode: '0'
+ // categoryCode: '0'
},
}).then(rs => {
if (rs.code === 200) {
@@ -182,6 +185,8 @@
if (index === categoryIndex.value) return
categoryIndex.value = index
form.categoryId = category[categoryIndex.value].id
+ // 如果是礼包商品
+ if(category[categoryIndex.value].categoryCode !== 'GIFT_PACK') form.price = category[categoryIndex.value].offeringPrice
}
// 发布商品
@@ -207,9 +212,13 @@
util.alert('商品价格不能为空')
return
}
- if (!data.cost) {
- util.alert('商品成本价不能为空')
- return
+
+ // 如果不是礼包商品
+ if (!cateCurrent.categoryCode.startsWith('GIFT_PACK')) {
+ if (!data.cost) {
+ util.alert('商品成本价不能为空')
+ return
+ }
}
// 查找规格是否有空值
@@ -286,7 +295,7 @@
类目
- {{category[categoryIndex].name}}
+ {{cateCurrent.name}}
点击选择
@@ -340,23 +349,26 @@
商品价格
+ placeholder-class="placeholderStyle" :disabled="cateCurrent.categoryCode.startsWith('GIFT_PACK')" />
-
- 商品成本价
-
-
+
+
+
+ 商品成本价
+
+
+
-
-
- 出让佣金
-
-
+
+ 出让佣金
+
+
+
-
+
diff --git a/jiuyi2/pages/shop/commodity/index.vue b/jiuyi2/pages/shop/commodity/index.vue
index ec7c25ee..b0486513 100644
--- a/jiuyi2/pages/shop/commodity/index.vue
+++ b/jiuyi2/pages/shop/commodity/index.vue
@@ -67,7 +67,6 @@
}
})
- // 销毁监听
onUnload(() => {
removeListener()
})
diff --git a/jiuyi2/pages/shop/gift.vue b/jiuyi2/pages/shop/gift.vue
index 07fde9c6..63b74346 100644
--- a/jiuyi2/pages/shop/gift.vue
+++ b/jiuyi2/pages/shop/gift.vue
@@ -19,6 +19,9 @@
// 商品列表
import productList from '@/components/shop/productList/productList'
+ const {
+ proxy
+ } = getCurrentInstance()
// tab
const tab = reactive([{
name: '礼包专区',
@@ -36,10 +39,55 @@
// 下标
const tabIndex = ref(0)
+ onReady(() => {
+ // 获取礼包分类
+ getGiftCate().then(rs => {
+ // 分类
+ proxy.$refs.product.listPrototype.categoryId = tab[tabIndex.value].id
+ proxy.$refs.product.getList()
+ })
+ })
+
+ onReachBottom(() => {
+ // 重载列表
+ proxy.$refs.product.getMoreList()
+ })
+
+ onPullDownRefresh(() => {
+ // 重载列表
+ proxy.$refs.product.refreshList()
+ })
+
+ // 获取礼包分类
+ function getGiftCate() {
+ return new Promise(resolve => {
+ api.shop.getCategory({
+ query: {
+ categoryCode: 'GIFT_PACK',
+ },
+ }).then(rs => {
+ if (rs.code === 200) {
+ tab.length = 0
+ tab.push(...rs.data)
+ resolve(tab)
+ return
+ }
+ util.alert({
+ content: rs.msg,
+ showCancel: false,
+ })
+ })
+ })
+ }
+
// 切换tab
function handleTab(index) {
if (tabIndex.value === index) return
tabIndex.value = index
+ // 分类
+ proxy.$refs.product.listPrototype.categoryId = tab[tabIndex.value].id
+ // 重载列表
+ proxy.$refs.product.refreshList()
}
@@ -56,9 +104,11 @@
-
- {{item.name}}
+
+
+
@@ -89,6 +139,11 @@
//
.item {
+ .icon {
+ width: 160rpx;
+ height: 40rpx;
+ }
+
.line {
width: 40rpx;
height: 6rpx;
diff --git a/jiuyi2/pages/shop/shop.vue b/jiuyi2/pages/shop/shop.vue
index 1456da97..d93cbcd6 100644
--- a/jiuyi2/pages/shop/shop.vue
+++ b/jiuyi2/pages/shop/shop.vue
@@ -33,12 +33,16 @@
}])
// 分类下标
const cateIndex = ref(0)
+ // 礼物下标
+ const giftCateList = reactive([])
// 搜索的关键字
const keyword = ref('')
onLoad(() => {
- //
+ // 获取普通商品分类
getCategory()
+ // 获取礼包分类
+ getGiftCate()
})
onReady(() => {
@@ -64,7 +68,7 @@
function getCategory() {
api.shop.getCategory({
query: {
- categoryCode: '0'
+ // categoryCode: null,
},
}).then(rs => {
if (rs.code === 200) {
@@ -72,7 +76,25 @@
cateList.push(...rs.data)
return
}
+ util.alert({
+ content: rs.msg,
+ showCancel: false,
+ })
+ })
+ }
+ // 获取礼包分类
+ function getGiftCate() {
+ api.shop.getCategory({
+ query: {
+ categoryCode: 'GIFT_PACK',
+ },
+ }).then(rs => {
+ if (rs.code === 200) {
+ giftCateList.length = 0
+ giftCateList.push(...rs.data)
+ return
+ }
util.alert({
content: rs.msg,
showCancel: false,
@@ -116,9 +138,9 @@
-
-
- 礼包专区
+
+
+ {{item.name}}
@@ -173,7 +195,7 @@
grid-template-columns: repeat(4, 1fr);
.icon {
- width: 110rpx;
+ width: 120rpx;
height: 90rpx;
}
}
diff --git a/jiuyi2/vite.config.js b/jiuyi2/vite.config.js
index 395646c1..d4f39e1e 100644
--- a/jiuyi2/vite.config.js
+++ b/jiuyi2/vite.config.js
@@ -3,9 +3,9 @@ import {
} from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
-let target = 'http://91f.xyz:8080'
+// let target = 'http://91f.xyz:8080'
// let target = 'http://liuyd.cpolar.top'
-// let target = 'http://hpedc3.natappfree.cc'
+let target = 'http://5vpc5z.natappfree.cc'
export default defineConfig({
plugins: [uni()],