工作代码提交
This commit is contained in:
parent
b7529dd64d
commit
ef19e7cb72
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 @@
|
|||
</view>
|
||||
|
||||
<!-- 已售 -->
|
||||
<view class="sold">
|
||||
<view class="sold" v-if="!giftPack">
|
||||
<text class="c999 f26">已售 {{detail.sales}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -247,7 +248,7 @@
|
|||
</view>
|
||||
|
||||
<!-- 福利政策 -->
|
||||
<view class="gift df fdr fww mtb20">
|
||||
<view class="gift df fdr fww mtb20" v-if="!giftPack">
|
||||
<view class="item">
|
||||
<text class="text">假一赔十</text>
|
||||
</view>
|
||||
|
@ -267,7 +268,7 @@
|
|||
</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-item v-for="(item, index) in recentOrderList" :key="index">
|
||||
<view class="list plr10 bfff">
|
||||
|
@ -319,7 +320,7 @@
|
|||
</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">
|
||||
<!-- 店铺头像 -->
|
||||
<image class="wh140 br20" :src="detail.merAvatar" mode="aspectFill" />
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
default: () => ({})
|
||||
},
|
||||
})
|
||||
// 是否礼包商品
|
||||
const giftPack = computed(() => props.detail.categoryCode?.startsWith('GIFT_PACK'))
|
||||
//
|
||||
const emit = defineEmits(['update', 'buy'])
|
||||
// 用户信息
|
||||
|
@ -114,7 +116,7 @@
|
|||
<!-- 底部 -->
|
||||
<view class="footerMneu 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" />
|
||||
<text class="text mt10" @click="link(`/pages/shop/store/index?storeId=${detail.merId}`)">店铺</text>
|
||||
</view>
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
<view class="f1">
|
||||
<view>账户昵称</view>
|
||||
</view>
|
||||
<view class="">{{team.referrerReferrerUser.userNickname}}</view>
|
||||
<view class="nickname">{{team.referrerReferrerUser.userNickname}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -135,7 +135,7 @@
|
|||
<view class="f1">
|
||||
<view>账户昵称</view>
|
||||
</view>
|
||||
<view class="">{{team.referrerUser.userNickname}}</view>
|
||||
<view class="nickname">{{team.referrerUser.userNickname}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -158,8 +158,12 @@
|
|||
<view class="li mtb30" v-for="(item,index) in team.sonUser" :key="item.id">
|
||||
<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.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">
|
||||
<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>
|
||||
</view>
|
||||
<template v-if="item.sonList[0]">
|
||||
|
@ -183,8 +187,14 @@
|
|||
<view class="line"></view>
|
||||
<view class="ml10 df aic c999 f28">
|
||||
<view class="count mr20 plr10 cfff br10" v-if="secItem.isShop == 1">商</view>
|
||||
<text class="name"
|
||||
:class="{'auth': secItem.isRealName}">{{secItem.userNickname}}</text>
|
||||
<view class="count mr20 plr10 cfff br10" v-if="secItem.activePopulation >= 10000">萬
|
||||
</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>
|
||||
</view>
|
||||
|
@ -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;
|
||||
|
|
|
@ -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 @@
|
|||
<view class="rows">
|
||||
<view class="title w150">类目</view>
|
||||
<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>
|
||||
</view>
|
||||
<uni-icons type="right" />
|
||||
|
@ -340,23 +349,26 @@
|
|||
<view class="title w150">商品价格</view>
|
||||
<view class="col f1">
|
||||
<input type="text" v-model="form.price" placeholder="输入价格"
|
||||
placeholder-class="placeholderStyle" />
|
||||
placeholder-class="placeholderStyle" :disabled="cateCurrent.categoryCode.startsWith('GIFT_PACK')" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line rows ptb20">
|
||||
<view class="title w150">商品成本价</view>
|
||||
<view class="col f1">
|
||||
<input type="text" v-model="form.cost" placeholder="输入价格"
|
||||
placeholder-class="placeholderStyle" />
|
||||
|
||||
<template v-if="!cateCurrent.categoryCode.startsWith('GIFT_PACK')">
|
||||
<view class="line rows ptb20">
|
||||
<view class="title w150">商品成本价</view>
|
||||
<view class="col f1">
|
||||
<input type="text" v-model="form.cost" placeholder="输入价格"
|
||||
placeholder-class="placeholderStyle" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line rows ptb20">
|
||||
<view class="title w150">出让佣金</view>
|
||||
<view class="col f1">
|
||||
<input type="text" v-model="form.commission" placeholder="输入价格"
|
||||
placeholder-class="placeholderStyle" />
|
||||
<view class="line rows ptb20">
|
||||
<view class="title w150">出让佣金</view>
|
||||
<view class="col f1">
|
||||
<input type="text" v-model="form.commission" placeholder="输入价格"
|
||||
placeholder-class="placeholderStyle" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<view class="main area" v-if="0">
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
}
|
||||
})
|
||||
|
||||
// 销毁监听
|
||||
onUnload(() => {
|
||||
removeListener()
|
||||
})
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -56,9 +104,11 @@
|
|||
|
||||
<!-- 礼包专区 -->
|
||||
<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}">
|
||||
<view class="mtb20">{{item.name}}</view>
|
||||
<view class="">
|
||||
<image class="icon" :src="item.icon" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -89,6 +139,11 @@
|
|||
|
||||
//
|
||||
.item {
|
||||
.icon {
|
||||
width: 160rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 40rpx;
|
||||
height: 6rpx;
|
||||
|
|
|
@ -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 @@
|
|||
</swiper>
|
||||
|
||||
<view class="gift mtb30">
|
||||
<view class="item fdc fmid" v-for="(item,index) in 4" :key="index">
|
||||
<image class="icon" src="/static/logo.png" mode="aspectFill" />
|
||||
<view class="mt10 c333 f28">礼包专区</view>
|
||||
<view class="item fdc fmid" v-for="(item,index) in giftCateList" :key="index">
|
||||
<image class="icon" :src="item.image" mode="aspectFill" />
|
||||
<view class="mt10 c333 f28">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -173,7 +195,7 @@
|
|||
grid-template-columns: repeat(4, 1fr);
|
||||
|
||||
.icon {
|
||||
width: 110rpx;
|
||||
width: 120rpx;
|
||||
height: 90rpx;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()],
|
||||
|
|
Loading…
Reference in New Issue