工作代码提交

This commit is contained in:
sx 2025-04-12 09:00:09 +08:00
parent b7529dd64d
commit ef19e7cb72
10 changed files with 173 additions and 56 deletions

View File

@ -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 * @param {Object} param

View File

@ -7,8 +7,8 @@ const config = {
// #endif // #endif
// #ifndef H5 // #ifndef H5
// host: 'http://91f.xyz:8080', // host: 'http://91f.xyz:8080',
host: 'http://liuyd.cpolar.top', // host: 'http://liuyd.cpolar.top',
// host: 'http://hpedc3.natappfree.cc', host: 'http://5vpc5z.natappfree.cc',
// #endif // #endif
// 是否vivo显示 // 是否vivo显示
showVivo: true, showVivo: true,

View File

@ -23,6 +23,9 @@
// //
import parseRichText from '@/components/public/parse/parse.vue' import parseRichText from '@/components/public/parse/parse.vue'
const {
proxy
} = getCurrentInstance()
// //
const props = defineProps({ const props = defineProps({
id: { id: {
@ -34,10 +37,8 @@
default: {} default: {}
}, },
}) })
//
const { const giftPack = computed(() => props.detail.categoryCode?.startsWith('GIFT_PACK'))
proxy
} = getCurrentInstance()
// swiper // swiper
const bannerHeight = ref('800rpx') const bannerHeight = ref('800rpx')
// //
@ -218,7 +219,7 @@
</view> </view>
<!-- 已售 --> <!-- 已售 -->
<view class="sold"> <view class="sold" v-if="!giftPack">
<text class="c999 f26">已售 {{detail.sales}}</text> <text class="c999 f26">已售 {{detail.sales}}</text>
</view> </view>
</view> </view>
@ -247,7 +248,7 @@
</view> </view>
<!-- 福利政策 --> <!-- 福利政策 -->
<view class="gift df fdr fww mtb20"> <view class="gift df fdr fww mtb20" v-if="!giftPack">
<view class="item"> <view class="item">
<text class="text">假一赔十</text> <text class="text">假一赔十</text>
</view> </view>
@ -267,7 +268,7 @@
</view> </view>
<!-- 最近购买 --> <!-- 最近购买 -->
<view class="recently mtb20" v-if="recentOrderList[0]"> <view class="recently mtb20" v-if="recentOrderList[0] && !giftPack">
<swiper class="swiper" style="height: 220rpx;" :autoplay="true" vertical="true"> <swiper class="swiper" style="height: 220rpx;" :autoplay="true" vertical="true">
<swiper-item v-for="(item, index) in recentOrderList" :key="index"> <swiper-item v-for="(item, index) in recentOrderList" :key="index">
<view class="list plr10 bfff"> <view class="list plr10 bfff">
@ -319,7 +320,7 @@
</view> </view>
<!-- 店铺 --> <!-- 店铺 -->
<view class="store df fdr aic jcsb mtb20 ptb20 plr25 bfff"> <view class="store df fdr aic jcsb mtb20 ptb20 plr25 bfff" v-if="!giftPack">
<view class="header df fdr jcsb aic"> <view class="header df fdr jcsb aic">
<!-- 店铺头像 --> <!-- 店铺头像 -->
<image class="wh140 br20" :src="detail.merAvatar" mode="aspectFill" /> <image class="wh140 br20" :src="detail.merAvatar" mode="aspectFill" />

View File

@ -30,6 +30,8 @@
default: () => ({}) default: () => ({})
}, },
}) })
//
const giftPack = computed(() => props.detail.categoryCode?.startsWith('GIFT_PACK'))
// //
const emit = defineEmits(['update', 'buy']) const emit = defineEmits(['update', 'buy'])
// //
@ -114,7 +116,7 @@
<!-- 底部 --> <!-- 底部 -->
<view class="footerMneu df fdr jcsb aic"> <view class="footerMneu df fdr jcsb aic">
<view class="menu df fdr jcsb aic"> <view class="menu df fdr jcsb aic">
<view class="option df fdc aic"> <view class="option df fdc aic" v-if="!giftPack">
<image class="wh30" src="/static/store.png" mode="aspectFit" /> <image class="wh30" src="/static/store.png" mode="aspectFit" />
<text class="text mt10" @click="link(`/pages/shop/store/index?storeId=${detail.merId}`)">店铺</text> <text class="text mt10" @click="link(`/pages/shop/store/index?storeId=${detail.merId}`)">店铺</text>
</view> </view>

View File

@ -109,7 +109,7 @@
<view class="f1"> <view class="f1">
<view>账户昵称</view> <view>账户昵称</view>
</view> </view>
<view class="">{{team.referrerReferrerUser.userNickname}}</view> <view class="nickname">{{team.referrerReferrerUser.userNickname}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -135,7 +135,7 @@
<view class="f1"> <view class="f1">
<view>账户昵称</view> <view>账户昵称</view>
</view> </view>
<view class="">{{team.referrerUser.userNickname}}</view> <view class="nickname">{{team.referrerUser.userNickname}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -158,8 +158,12 @@
<view class="li mtb30" v-for="(item,index) in team.sonUser" :key="item.id"> <view class="li mtb30" v-for="(item,index) in team.sonUser" :key="item.id">
<view class="menber df aic"> <view class="menber df aic">
<view class="count mr20 plr10 cfff br10" v-if="item.isShop == 1"></view> <view class="count mr20 plr10 cfff br10" v-if="item.isShop == 1"></view>
<view class="count mr20 plr10 cfff br10" v-if="item.activePopulation >= 10000"></view>
<view class="count mr20 plr10 cfff br10" v-else-if="item.activePopulation >= 1000"></view>
<view class="count mr20 plr10 cfff br10" v-else-if="item.activePopulation >= 100"></view>
<view class="c333 f32"> <view class="c333 f32">
<text class="name" :class="{'auth': item.isRealName}">{{item.userNickname}}</text> <text class="nickname"
:class="{'active': !item.isActive,'auth': !item.isRealName}">{{item.userNickname}}</text>
<text class="ml20" v-if="item.sonList.length != 0">{{item.sonList.length}}</text> <text class="ml20" v-if="item.sonList.length != 0">{{item.sonList.length}}</text>
</view> </view>
<template v-if="item.sonList[0]"> <template v-if="item.sonList[0]">
@ -183,8 +187,14 @@
<view class="line"></view> <view class="line"></view>
<view class="ml10 df aic c999 f28"> <view class="ml10 df aic c999 f28">
<view class="count mr20 plr10 cfff br10" v-if="secItem.isShop == 1"></view> <view class="count mr20 plr10 cfff br10" v-if="secItem.isShop == 1"></view>
<text class="name" <view class="count mr20 plr10 cfff br10" v-if="secItem.activePopulation >= 10000">
:class="{'auth': secItem.isRealName}">{{secItem.userNickname}}</text> </view>
<view class="count mr20 plr10 cfff br10"
v-else-if="secItem.activePopulation >= 1000"></view>
<view class="count mr20 plr10 cfff br10" v-else-if="secItem.activePopulation >= 100">
</view>
<text class="nickname"
:class="{'auth': !secItem.isRealName,'active': !secItem.isActive}">{{secItem.userNickname}}</text>
<view class="label ml20" v-if="secItem.count != 0">{{secItem.count}}</view> <view class="label ml20" v-if="secItem.count != 0">{{secItem.count}}</view>
</view> </view>
</view> </view>
@ -214,6 +224,19 @@
} }
} }
//
.nickname {
color: #333;
&.active {
color: #FF8400;
}
&.auth {
color: #FF0000;
}
}
// //
.arrow { .arrow {
&.active { &.active {
@ -237,15 +260,6 @@
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%); background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
} }
//
.name {
color: #FF8400;
&.auth {
color: #333;
}
}
// //
.list { .list {
padding-left: .5em; padding-left: .5em;

View File

@ -4,7 +4,8 @@
ref, ref,
reactive, reactive,
getCurrentInstance, getCurrentInstance,
nextTick nextTick,
computed,
} from 'vue' } from 'vue'
// //
import { import {
@ -31,6 +32,8 @@
const category = reactive([]) const category = reactive([])
// //
const categoryIndex = ref('') const categoryIndex = ref('')
//
const cateCurrent = computed(() => category[categoryIndex.value] || {categoryCode: ''})
onLoad((option) => { onLoad((option) => {
if (option.id) { if (option.id) {
@ -101,9 +104,9 @@
// //
function getCategory() { function getCategory() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
api.shop.getCategory({ api.shop.getSaveProCate({
query: { query: {
categoryCode: '0' // categoryCode: '0'
}, },
}).then(rs => { }).then(rs => {
if (rs.code === 200) { if (rs.code === 200) {
@ -182,6 +185,8 @@
if (index === categoryIndex.value) return if (index === categoryIndex.value) return
categoryIndex.value = index categoryIndex.value = index
form.categoryId = category[categoryIndex.value].id 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('商品价格不能为空') util.alert('商品价格不能为空')
return return
} }
if (!data.cost) {
util.alert('商品成本价不能为空') //
return if (!cateCurrent.categoryCode.startsWith('GIFT_PACK')) {
if (!data.cost) {
util.alert('商品成本价不能为空')
return
}
} }
// //
@ -286,7 +295,7 @@
<view class="rows"> <view class="rows">
<view class="title w150">类目</view> <view class="title w150">类目</view>
<view class="col f1"> <view class="col f1">
<text v-if="category[categoryIndex]">{{category[categoryIndex].name}}</text> <text v-if="category[categoryIndex]">{{cateCurrent.name}}</text>
<text v-else class="placeholderStyle">点击选择</text> <text v-else class="placeholderStyle">点击选择</text>
</view> </view>
<uni-icons type="right" /> <uni-icons type="right" />
@ -340,23 +349,26 @@
<view class="title w150">商品价格</view> <view class="title w150">商品价格</view>
<view class="col f1"> <view class="col f1">
<input type="text" v-model="form.price" placeholder="输入价格" <input type="text" v-model="form.price" placeholder="输入价格"
placeholder-class="placeholderStyle" /> placeholder-class="placeholderStyle" :disabled="cateCurrent.categoryCode.startsWith('GIFT_PACK')" />
</view> </view>
</view> </view>
<view class="line rows ptb20">
<view class="title w150">商品成本价</view> <template v-if="!cateCurrent.categoryCode.startsWith('GIFT_PACK')">
<view class="col f1"> <view class="line rows ptb20">
<input type="text" v-model="form.cost" placeholder="输入价格" <view class="title w150">商品成本价</view>
placeholder-class="placeholderStyle" /> <view class="col f1">
<input type="text" v-model="form.cost" placeholder="输入价格"
placeholder-class="placeholderStyle" />
</view>
</view> </view>
</view> <view class="line rows ptb20">
<view class="line rows ptb20"> <view class="title w150">出让佣金</view>
<view class="title w150">出让佣金</view> <view class="col f1">
<view class="col f1"> <input type="text" v-model="form.commission" placeholder="输入价格"
<input type="text" v-model="form.commission" placeholder="输入价格" placeholder-class="placeholderStyle" />
placeholder-class="placeholderStyle" /> </view>
</view> </view>
</view> </template>
</view> </view>
<view class="main area" v-if="0"> <view class="main area" v-if="0">

View File

@ -67,7 +67,6 @@
} }
}) })
//
onUnload(() => { onUnload(() => {
removeListener() removeListener()
}) })

View File

@ -19,6 +19,9 @@
// //
import productList from '@/components/shop/productList/productList' import productList from '@/components/shop/productList/productList'
const {
proxy
} = getCurrentInstance()
// tab // tab
const tab = reactive([{ const tab = reactive([{
name: '礼包专区', name: '礼包专区',
@ -36,10 +39,55 @@
// //
const tabIndex = ref(0) 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 // tab
function handleTab(index) { function handleTab(index) {
if (tabIndex.value === index) return if (tabIndex.value === index) return
tabIndex.value = index tabIndex.value = index
//
proxy.$refs.product.listPrototype.categoryId = tab[tabIndex.value].id
//
proxy.$refs.product.refreshList()
} }
</script> </script>
@ -56,9 +104,11 @@
<!-- 礼包专区 --> <!-- 礼包专区 -->
<view class="tab bfff"> <view class="tab bfff">
<view class="item ver ptb10" v-for="(item,index) in tab" :key="index" @click="handleTab(index)" <view class="item ver ptb20" v-for="(item,index) in tab" :key="index" @click="handleTab(index)"
:class="{'active': index === tabIndex}"> :class="{'active': index === tabIndex}">
<view class="mtb20">{{item.name}}</view> <view class="">
<image class="icon" :src="item.icon" mode="aspectFill" />
</view>
<view class="line"></view> <view class="line"></view>
</view> </view>
</view> </view>
@ -89,6 +139,11 @@
// //
.item { .item {
.icon {
width: 160rpx;
height: 40rpx;
}
.line { .line {
width: 40rpx; width: 40rpx;
height: 6rpx; height: 6rpx;

View File

@ -33,12 +33,16 @@
}]) }])
// //
const cateIndex = ref(0) const cateIndex = ref(0)
//
const giftCateList = reactive([])
// //
const keyword = ref('') const keyword = ref('')
onLoad(() => { onLoad(() => {
// //
getCategory() getCategory()
//
getGiftCate()
}) })
onReady(() => { onReady(() => {
@ -64,7 +68,7 @@
function getCategory() { function getCategory() {
api.shop.getCategory({ api.shop.getCategory({
query: { query: {
categoryCode: '0' // categoryCode: null,
}, },
}).then(rs => { }).then(rs => {
if (rs.code === 200) { if (rs.code === 200) {
@ -72,7 +76,25 @@
cateList.push(...rs.data) cateList.push(...rs.data)
return 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({ util.alert({
content: rs.msg, content: rs.msg,
showCancel: false, showCancel: false,
@ -116,9 +138,9 @@
</swiper> </swiper>
<view class="gift mtb30"> <view class="gift mtb30">
<view class="item fdc fmid" v-for="(item,index) in 4" :key="index"> <view class="item fdc fmid" v-for="(item,index) in giftCateList" :key="index">
<image class="icon" src="/static/logo.png" mode="aspectFill" /> <image class="icon" :src="item.image" mode="aspectFill" />
<view class="mt10 c333 f28">礼包专区</view> <view class="mt10 c333 f28">{{item.name}}</view>
</view> </view>
</view> </view>
@ -173,7 +195,7 @@
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
.icon { .icon {
width: 110rpx; width: 120rpx;
height: 90rpx; height: 90rpx;
} }
} }

View File

@ -3,9 +3,9 @@ import {
} from 'vite'; } from 'vite';
import uni from '@dcloudio/vite-plugin-uni'; 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://liuyd.cpolar.top'
// let target = 'http://hpedc3.natappfree.cc' let target = 'http://5vpc5z.natappfree.cc'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],