2025.02.15 工作代码提交

This commit is contained in:
sx 2025-02-15 16:10:05 +08:00
parent 4f178171c2
commit 2e76dd427e
15 changed files with 472 additions and 332 deletions

View File

@ -7,7 +7,7 @@ const config = {
// #endif // #endif
// #ifndef H5 // #ifndef H5
// host: 'http://91f.xyz:8080', // host: 'http://91f.xyz:8080',
host: 'http://8vtja7.natappfree.cc', host: 'http://d5si5v.natappfree.cc',
// #endif // #endif
// 支付方式配置 // 支付方式配置
payType: { payType: {

View File

@ -134,7 +134,7 @@ const util = {
reject(res) reject(res)
}, },
complete(rs) { complete(rs) {
console.log('upload complete',rs) console.log('upload complete', rs)
} }
}) })
}) })

View File

@ -72,7 +72,7 @@
// //
const emit = defineEmits(['showTime', 'showComment', 'showCollect', 'showFastCollect', 'showShareFirend', 'onPlay', const emit = defineEmits(['showTime', 'showComment', 'showCollect', 'showFastCollect', 'showShareFirend', 'onPlay',
'onPause', 'like', 'detailMenu', 'onEnd', 'longtap', 'dataCenter', 'showProduct' 'onPause', 'like', 'detailMenu', 'onEnd', 'longtap', 'dataCenter', 'showProduct', 'proBuy'
]) ])
// //
@ -466,10 +466,14 @@
// 广 // 广
function handleShowProduct() { function handleShowProduct() {
console.log('handleShowProduct')
emit('showProduct', props.item) emit('showProduct', props.item)
} }
// 广
function handleProBuy() {
emit('proBuy', props.item)
}
// //
defineExpose({ defineExpose({
play, play,
@ -643,7 +647,7 @@
</view> </view>
<view class="btn sm warm"> <view class="btn sm warm">
<text class="cfff f24 tac">立即购买</text> <text class="cfff f24 tac" @click.stop="handleProBuy">立即购买</text>
</view> </view>
</view> </view>
</view> </view>

View File

@ -8,6 +8,7 @@
computed, computed,
onBeforeUnmount, onBeforeUnmount,
defineProps, defineProps,
defineEmits,
} from 'vue'; } from 'vue';
// //
import util from '@/common/js/util.js' import util from '@/common/js/util.js'
@ -25,6 +26,8 @@
const props = defineProps({ const props = defineProps({
// //
}) })
//
const emit = defineEmits(['buy'])
// id // id
const proId = ref('42') const proId = ref('42')
// //
@ -37,7 +40,7 @@
* @param {Object} productId 产品id * @param {Object} productId 产品id
*/ */
function init(productId) { function init(productId) {
if(productId) proId.value = productId if (productId) proId.value = productId
// //
open() open()
@ -83,6 +86,11 @@
}) })
} }
//
function handleBuy() {
emit('buy', detail)
}
/** /**
* 详情 * 详情
* @param {Object} ev 修改的详情 * @param {Object} ev 修改的详情
@ -111,15 +119,23 @@
<template> <template>
<uni-popup ref="detailAlt" type="bottom"> <uni-popup ref="detailAlt" type="bottom">
<view class="container popBot"> <view class="container popBot">
<view class="header">
<image @click="close" class="back wh55" src="/static/back.png" />
</view>
<scroll-view class="scroll" :scroll-y="true"> <scroll-view class="scroll" :scroll-y="true">
<view class="main"> <view class="main">
<!-- 获取详情 --> <!-- 获取详情 -->
<proDetail :id="proId" :detail="detail" /> <proDetail :id="proId" :detail="detail" />
<!-- 底部 -->
<footerMenu :detail="detail" @update="handleDetail" />
</view> </view>
</scroll-view> </scroll-view>
<!-- 底部 -->
<view class="footerMenu pt30">
<view class="content ptb30 plr20 bfff">
<footerMenu :detail="detail" @update="handleDetail" @buy="handleBuy" />
</view>
</view>
</view> </view>
</uni-popup> </uni-popup>
</template> </template>
@ -127,10 +143,34 @@
<style lang="scss"> <style lang="scss">
// //
.container { .container {
position: relative;
height: 1300rpx;
background-color: #f8f8f8; background-color: #f8f8f8;
//
.header {
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 10;
}
.scroll { .scroll {
height: 1300rpx; flex: 1;
}
//
.footerMenu {
position: absolute;
left: 0;
right: 0;
bottom: 0;
//
.content {
box-shadow: 0 0rpx 10rpx rgba(102, 102, 102, 0.3);
}
} }
} }
</style> </style>

View File

@ -59,7 +59,7 @@
</script> </script>
<template> <template>
<view class="address df aic jcc"> <view class="address df fdr aic jcc">
<!-- 图标 --> <!-- 图标 -->
<view class="icon mr20"> <view class="icon mr20">
<image class="wh45" src="/static/address.png" mode="aspectFill" /> <image class="wh45" src="/static/address.png" mode="aspectFill" />
@ -68,8 +68,8 @@
<!-- 收获地址 姓名电话 --> <!-- 收获地址 姓名电话 -->
<view class="info f1"> <view class="info f1">
<!-- 收获地址 --> <!-- 收获地址 -->
<view class="location f30"> <view class="location">
<text class="c333">{{address.province}}{{address.city}}{{address.country}}{{address.detail}}</text> <text class="c333 f30">{{address.province}}{{address.city}}{{address.country}}{{address.detail}}</text>
</view> </view>
<!-- 姓名电话 --> <!-- 姓名电话 -->
<view class="name"> <view class="name">
@ -78,12 +78,21 @@
</view> </view>
<!-- 选择地址 --> <!-- 选择地址 -->
<view v-if="shopEdit" class="btn ti warmHollow plr20 ml20" @click="link('/pages/mine/address/index?select=1')"> <view v-if="shopEdit" class="button btn ti plr20 ml20"
<text class="cFF9B27">选择地址</text> @click="link('/pages/mine/address/index?select=1')">
<text class="text">选择地址</text>
</view> </view>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
// //
.button {
border: 2rpx solid #FF9B27;
.text {
font-size: 24rpx;
color: #FF9B27;
}
}
</style> </style>

View File

@ -183,42 +183,6 @@
}) })
} }
//
function handleCollect() {
util.isLogin().then(rs => {
//
api.shop.addProductCollect({
data: {
productId: id.value,
status: {
0: 1,
1: 0,
} [props.detail.isCollect]
}
}).then(rs => {
if (rs.code == 200) {
//
props.detail.isCollect = {
0: 1,
1: 0,
} [props.detail.isCollect]
//
props.detail.collectNumber = rs.data
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}).catch(() => {
//
uni.navigateTo({
url: '/pages/login/loginPhone'
})
})
}
// //
function getShop() { function getShop() {
api.shop.shopDetail({ api.shop.shopDetail({
@ -236,252 +200,180 @@
}) })
}) })
} }
/**
* 立即下单
*/
function handlePay(event) {
//
api.shop.addOrder({
data: [{
// id
addressId: event.address.id,
// id
productId: props.detail.id,
// id
attrValueId: event.spec.id,
//
payNum: event.payNum,
// 0-1-
orderType: 0,
// id
// shareId: userinfo.id,
}],
}).then(rs => {
if (rs.code === 200) {
//
if (rs.data && rs.data[0]) uni.navigateTo({
url: util.setUrl('/pages/shop/commodity/payment', {
orderId: rs.data[0].orderId,
})
})
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script> </script>
<template> <template>
<view class="container"> <!-- 轮播图 -->
<view class="banner pr" v-if="detail.sliderImage">
<swiper class="swiper" :style="{height: bannerHeight,}" :current="bannerIndex"
@change="($event) => bannerIndex = $event.detail.current">
<swiper-item v-for="(item, index) in banner" :key="index">
<image class="poster" :src="item" mode="aspectFill" />
</swiper-item>
</swiper>
<!-- 轮播图 --> <!-- 计数器 -->
<view class="banner pr" v-if="detail.sliderImage"> <view class="count pa ptb5 plr20 bar">
<swiper class="swiper" :style="{height: bannerHeight,}" :current="bannerIndex" <text class="text cfff f24">{{ bannerIndex + 1 }} / {{ banner.length }}</text>
@change="($event) => bannerIndex = $event.detail.current"> </view>
<swiper-item v-for="(item, index) in banner" :key="index"> </view>
<image class="poster" :src="item" mode="aspectFill" />
</swiper-item>
</swiper>
<!-- 计数器 --> <!-- 商品详情 -->
<view class="count pa ptb5 plr20 bar"> <view class="detail bfff ptb25 plr20">
<text class="text cfff f24">{{ bannerIndex + 1 }} / {{ banner.length }}</text> <view class="line df fdr jcsb">
<view class="price df fdr aic">
<text class="txt"></text>
<text class="txt f56">{{detail.price}}</text>
</view>
<!-- 已售 -->
<view class="sold">
<text class="c999 f26">已售 {{detail.sales}}</text>
</view> </view>
</view> </view>
<!-- 商品详情 --> <!-- 优惠券 -->
<view class="detail bfff ptb25 plr20"> <view class="coupon df fdr fww f26 mtb20 cFF9B27" v-if="0">
<view class="line df fdr jcsb"> <view class="item">
<view class="price df fdr aic"> <text>限时直降0.5</text>
<text class="txt"></text>
<text class="txt f56">{{detail.price}}</text>
</view>
<!-- 已售 -->
<view class="sold">
<text class="c999 f26">已售 {{detail.sales}}</text>
</view>
</view> </view>
<view class="item">
<!-- 优惠券 --> <text>平台立减1元</text>
<view class="coupon df fdr fww f26 mtb20 cFF9B27" v-if="0">
<view class="item">
<text>限时直降0.5</text>
</view>
<view class="item">
<text>平台立减1元</text>
</view>
<view class="item">
<text>关注店铺1元优惠券</text>
</view>
</view> </view>
<view class="item">
<!-- 商品名称 --> <text>关注店铺1元优惠券</text>
<view class="name mtb20 t2hd">
<text class="c333 f34">{{detail.name}}</text>
</view>
<view class="history mtb20 df fdr jcsb aic">
<text class="c666 f28">商品修改历史</text>
<uni-icons type="right" color="#999" size="30rpx" />
</view>
<!-- 福利政策 -->
<view class="gift df fdr fww mtb20">
<view class="item">
<text class="text">假一赔十</text>
</view>
<view class="item">
<text class="text">7天无理由退货</text>
</view>
<view class="item">
<text class="text">全场包邮</text>
</view>
<view class="item">
<text class="text">48h内发货</text>
</view>
<view class="item" v-if="0">
<text class="text">支持先用后付</text>
</view>
</view> </view>
</view> </view>
<!-- 最近购买 --> <!-- 商品名称 -->
<view class="recently mtb20" v-if="recentOrderList[0]"> <view class="name mtb20 t2hd">
<swiper class="swiper" style="height: 220rpx;" :autoplay="true" vertical="true"> <text class="c333 f34">{{detail.name}}</text>
<swiper-item v-for="(item, index) in recentOrderList" :key="index">
<view class="list plr10 bfff">
<view class="item bsb df fdr jcsb aic plr10" v-for="(secItem, secIndex) in item"
:key="secIndex">
<view class="avatar">
<image class="avatar wh70 cir" :src="secItem.avatar" mode="aspectFill" />
</view>
<view class="name f1 mlr10">
<text class="name c666 f28">{{secItem.nickname}}</text>
</view>
<view class="info mlr10 tar">
<!-- <view class="fn">刚刚下单</view> -->
<view class="time">
<text class="c999 f26">{{secItem.time}}</text>
</view>
</view>
<view class="btn sm warm plr15">
<text class="cfff f26">立即购买</text>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view> </view>
<!-- 商品评价 --> <view class="history mtb20 df fdr jcsb aic">
<view class="evaluate mtb20 plr25 bfff"> <text class="c666 f28">商品修改历史</text>
<view class="header df fdr jcsb aic ptb25" <uni-icons type="right" color="#999" size="30rpx" />
@click="link(util.setUrl('/pages/shop/commodity/evaluate',{id: detail.id}))">
<text class="modelTitle">商品评价({{comment.total}})</text>
<uni-icons type="right" />
</view>
<!-- 部分评论 -->
<view class="list">
<view class="item ptb20" v-for="(item, index) in comment.list" :key="index">
<view class="userinfo df fdr aic">
<image class="avatar wh45 cir" :src="item.avatar" mode="aspectFill" />
<view class="name thd f32 f1 ml20">
<text class="c666 f28">{{item.nickname}}</text>
</view>
</view>
<view class="content t2hd mt10">
<text class="c333 f28">{{item.content}}</text>
</view>
</view>
</view>
</view> </view>
<!-- 店铺 --> <!-- 福利政策 -->
<view class="store df fdr aic jcsb mtb20 ptb20 plr25 bfff"> <view class="gift df fdr fww mtb20">
<view class="header df fdr jcsb aic"> <view class="item">
<!-- 店铺头像 --> <text class="text">假一赔十</text>
<image class="wh140 br20" :src="detail.merAvatar" mode="aspectFill" />
<!-- 店铺信息 名称 评分 关注数量 -->
<view class="info f1 mlr20">
<!-- 店铺名称 -->
<view class="name thd">
<text class="f34 c333">{{detail.merName}}</text>
</view>
<view class="line df fdr aic mt10">
<!-- 评分 -->
<!-- <view class="item f24 c666 df aic ">
<uni-rate class="mr10" :value="4.5" :size="12" activeColor="#FF9B27" readonly />
<text>4.5</text>
</view> -->
<!-- 关注数量 -->
<view class="item follow">
<text class=" c666 f24">{{detail.merFollowNumber}}关注</text>
</view>
</view>
</view>
</view> </view>
<view class="item">
<!-- 关注按钮 --> <text class="text">7天无理由退货</text>
<view @click="handleCollectStore" class="btn sm warm fmid fdr plr30">
<uni-icons class="mr10" color="#fff" type="plusempty" size="13" v-if="detail.isFollow != 1" />
<text class="cfff f28" v-else></text>
<text class="cfff f28">关注</text>
</view> </view>
</view> <view class="item">
<text class="text">全场包邮</text>
<!-- 宝贝详情 -->
<view class="p25 mtb240 bfff">
<view class="title">
<text class="modelTitle">宝贝详情</text>
</view> </view>
<view class="item">
<!-- 商品详情 --> <text class="text">48h内发货</text>
<view class="content mt30">
<rich-text :nodes="detail.infoRichText || ''" />
</view> </view>
</view> <view class="item" v-if="0">
<text class="text">支持先用后付</text>
<!-- 填充 -->
<view class="fill" style="height: 180rpx;"></view>
<!-- 底部 -->
<view class="footerMneu pa rows plr20 shadow bfff">
<view class="menu df fdr jcsb aic">
<view class="option ver">
<image class="wh30" src="/static/store.png" mode="widthFix" />
<view class="f24 c999 mt10">店铺</view>
</view>
<view class="option ver " @click="handleCollect">
<view class="wh30 fmid">
<uni-icons type="star-filled" size="45rpx" color="#FF9B27" v-if="detail.isCollect == 1" />
<uni-icons type="star" size="45rpx" color="#666" v-else />
</view>
<view class="f24 c999 mt10">
<text v-if="detail.isCollect == 1"></text>
<text>收藏</text>
</view>
</view>
<!-- <view class="option ver ">
<image class="wh30" src="/static/customer-service.png" mode="widthFix" />
<view class="f24 c999 mt10">客服</view>
</view> -->
</view>
<!-- 下单 -->
<view class="btn lg primary f1 ml30" @click="$refs.makeOrderRef.open()">
<text>立即购买</text>
</view> </view>
</view> </view>
</view> </view>
<!-- 最近购买 -->
<view class="recently mtb20" v-if="recentOrderList[0]">
<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">
<view class="item bsb df fdr jcsb aic plr10" v-for="(secItem, secIndex) in item" :key="secIndex">
<view class="avatar">
<image class="avatar wh70 cir" :src="secItem.avatar" mode="aspectFill" />
</view>
<view class="name f1 mlr10">
<text class="name c666 f28">{{secItem.nickname}}</text>
</view>
<view class="info mlr10 tar">
<!-- <view class="fn">刚刚下单</view> -->
<view class="time">
<text class="c999 f26">{{secItem.time}}</text>
</view>
</view>
<view class="btn sm warm plr15">
<text class="cfff f26">立即购买</text>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<!-- 商品评价 -->
<view class="evaluate mtb20 plr25 bfff">
<view class="header df fdr jcsb aic ptb25"
@click="link(util.setUrl('/pages/shop/commodity/evaluate',{id: detail.id}))">
<text class="modelTitle">商品评价({{comment.total}})</text>
<uni-icons type="right" />
</view>
<!-- 部分评论 -->
<view class="list">
<view class="item ptb20" v-for="(item, index) in comment.list" :key="index">
<view class="userinfo df fdr aic">
<image class="avatar wh45 cir" :src="item.avatar" mode="aspectFill" />
<view class="name thd f32 f1 ml20">
<text class="c666 f28">{{item.nickname}}</text>
</view>
</view>
<view class="content t2hd mt10">
<text class="c333 f28">{{item.content}}</text>
</view>
</view>
</view>
</view>
<!-- 店铺 -->
<view class="store df fdr aic jcsb mtb20 ptb20 plr25 bfff">
<view class="header df fdr jcsb aic">
<!-- 店铺头像 -->
<image class="wh140 br20" :src="detail.merAvatar" mode="aspectFill" />
<!-- 店铺信息 名称 评分 关注数量 -->
<view class="info f1 mlr20">
<!-- 店铺名称 -->
<view class="name thd">
<text class="f34 c333">{{detail.merName}}</text>
</view>
<view class="line df fdr aic mt10">
<!-- 评分 -->
<!-- <view class="item f24 c666 df aic ">
<uni-rate class="mr10" :value="4.5" :size="12" activeColor="#FF9B27" readonly />
<text>4.5</text>
</view> -->
<!-- 关注数量 -->
<view class="item follow">
<text class=" c666 f24">{{detail.merFollowNumber}}关注</text>
</view>
</view>
</view>
</view>
<!-- 关注按钮 -->
<view @click="handleCollectStore" class="btn sm warm fmid fdr plr30">
<uni-icons class="mr10" color="#fff" type="plusempty" size="13" v-if="detail.isFollow != 1" />
<text class="cfff f28" v-else></text>
<text class="cfff f28">关注</text>
</view>
</view>
<!-- 宝贝详情 -->
<view class="p25 mtb240 bfff">
<view class="title">
<text class="modelTitle">宝贝详情</text>
</view>
<!-- 商品详情 -->
<view class="content mt30">
<rich-text :nodes="detail.infoRichText || ''" />
</view>
</view>
<!-- 填充 -->
<view class="fill" style="height: 180rpx;"></view>
</template> </template>
<style lang="scss"> <style lang="scss">
@ -590,16 +482,4 @@
} }
} }
} }
//
.footerMneu {
left: 0;
right: 0;
bottom: 0;
//
.option {
width: 80rpx;
}
}
</style> </style>

View File

@ -16,8 +16,6 @@
import { import {
useStore useStore
} from 'vuex' } from 'vuex'
//
import makeOrder from '@/components/shop/detail/makeOrder.vue'
const { const {
proxy proxy
@ -33,10 +31,46 @@
}, },
}) })
// //
const emit = defineEmits(['update']) const emit = defineEmits(['update', 'buy'])
// //
const userinfo = computed(() => store.state.userinfo) const userinfo = computed(() => store.state.userinfo)
//
function handleCollect() {
util.isLogin().then(rs => {
//
api.shop.addProductCollect({
query: {
productId: props.detail.id,
type: {
0: 1,
1: 0,
} [props.detail.isCollect]
}
}).then(rs => {
if (rs.code == 200) {
//
props.detail.isCollect = {
0: 1,
1: 0,
} [props.detail.isCollect]
//
props.detail.collectNumber = rs.data
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}).catch(() => {
//
uni.navigateTo({
url: '/pages/login/loginPhone'
})
})
}
/** /**
* 跳转 * 跳转
* @param {Object} url 跳转路径 * @param {Object} url 跳转路径
@ -46,12 +80,58 @@
url, url,
}) })
} }
//
function handleBuy() {
emit('buy')
}
</script> </script>
<template> <template>
<!-- 立即支付 --> <!-- 底部 -->
<makeOrder ref="makeOrderRef" :detail="detail" @confirm="handlePay" /> <view class="footerMneu df fdr jcsb aic">
<view class="menu df fdr jcsb aic">
<view class="option df fdc aic">
<image class="wh30" src="/static/store.png" mode="aspectFit" />
<text class="text mt10">店铺</text>
</view>
<view class="option df fdc aic" @click="handleCollect">
<view class="wh30 fmid">
<uni-icons type="star-filled" size="45rpx" color="#FF9B27" v-if="detail.isCollect == 1" />
<uni-icons type="star" size="45rpx" color="#666" v-else />
</view>
<view class="df fdr aic mt10">
<text class="text" v-if="detail.isCollect == 1"></text>
<text class="text">收藏</text>
</view>
</view>
<view class="option ver " v-if="0">
<image class="wh30" src="/static/customer-service.png" mode="aspectFit" />
<text class="text mt10">客服</text>
</view>
</view>
<!-- 下单 -->
<view class="btn primary f1 ml30" @click="handleBuy">
<text class="tac cfff f32">立即购买</text>
</view>
</view>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
//
.footerMneu {
//
.option {
width: 80rpx;
.text {
color: #999;
font-size: 24rpx;
}
}
}
</style> </style>

View File

@ -168,21 +168,22 @@
<JyCommodityAddress :address="address" /> <JyCommodityAddress :address="address" />
</template> </template>
<template v-else> <template v-else>
<view class="fmid c999 f28" @click="link('/pages/mine/address/index?select=1')"> <view class="fmid" @click="link('/pages/mine/address/index?select=1')">
<view>暂无默认地址</view> <text class="c999 f28">暂无默认地址</text>
<uni-icons type="right" color="#999" size="30rpx" /> <uni-icons type="right" color="#999" size="30rpx" />
</view> </view>
</template> </template>
</view> </view>
<!-- 商品图 价格 明细 数量 --> <!-- 商品图 价格 明细 数量 -->
<view class="jy-card-commodity-content df mtb40"> <view class="jy-card-commodity-content df fdr mtb40">
<!-- 商品图 --> <!-- 商品图 -->
<image class="wh200 br10" :src="currentSpec.image" mode="aspectFill" /> <image class="wh200 br10" :src="currentSpec.image" mode="aspectFill" />
<!-- 价格 明细 数量 --> <!-- 价格 明细 数量 -->
<view class="info f1 df fdc jcsb ml30"> <view class="info f1 df fdc jcsb ml30">
<!-- 价格 --> <!-- 价格 -->
<view class="content-info-price"> <view class="price df fdr aic">
<text class="cFF9B27 f28">单价</text> <text class="cFF9B27 f28">单价</text>
<text class="cFF9B27 f24"></text> <text class="cFF9B27 f24"></text>
<text class="cFF9B27 f50">{{detail.price}}</text> <text class="cFF9B27 f50">{{detail.price}}</text>
@ -200,18 +201,17 @@
<!-- 规格 --> <!-- 规格 -->
<view class="spec"> <view class="spec">
<view class="selection df"> <view class="selection df fdr fww">
<!-- disabled 销量为零不能选 --> <!-- disabled 销量为零不能选 -->
<view class="option mtb20 mr20" :class="{'active': spaceIndex === index}" <text class="option mtb20 mr20 f26" :class="{'active': spaceIndex === index}"
v-for="(item,index) in detail.specs" :key="index" @click="handleSpec(index)"> v-for="(item,index) in detail.specs" :key="item.id"
<text class="txt">{{item.sku}}</text> @click="handleSpec(index)">{{item.sku}}</text>
</view>
</view> </view>
</view> </view>
<view class="btn lg primary mtb30" @click="handleConfirm"> <view class="btn lg primary mtb30" @click="handleConfirm">
<text class="cfff" v-if="mode == 'detail'">立即下单 {{total}}</text> <text class="tac cfff" v-if="mode == 'detail'">立即下单 {{total}}</text>
<text class="cfff" v-if="mode == 'collect'">确定</text> <text class="tac cfff" v-if="mode == 'collect'">确定</text>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
@ -224,25 +224,23 @@
// //
.option { .option {
padding: 5rpx 15rpx; padding: 5rpx 15rpx;
color: #333;
background-color: #F7F7F7; background-color: #F7F7F7;
border-radius: 10rpx; border-radius: 10rpx;
transition: .3s; transition: .3s;
border: 2rpx solid #F7F7F7; border: 2rpx solid #F7F7F7;
.txt { .text {}
color: #333;
font-size: 26rpx; // .text {
transition: .3s; // color: #FF9B27;
} // }
// //
&.active { &.active {
color: #FF9B27;
background-color: #FFFBF8; background-color: #FFFBF8;
border-color: #FF9B27; border-color: #FF9B27;
.txt {
color: #FF9B27;
}
} }
// //

View File

@ -240,7 +240,7 @@
</view> </view>
</view> </view>
<view class="item tac mt20" @click="link('/pages/index/dataCenter/otherPush')"> <view class="item tac mt20" @click="link('/pages/index/dataCenter/otherPush')">
<view class="key">他人推广</view> <view class="key">推广总数</view>
<view class="value">{{detail.othersPromotionCount}}</view> <view class="value">{{detail.othersPromotionCount}}</view>
</view> </view>
<view class="item tac mt20"> <view class="item tac mt20">

View File

@ -34,10 +34,7 @@
} = getCurrentInstance() } = getCurrentInstance()
const store = useStore() const store = useStore()
const userinfo = computed(() => { const userinfo = computed(() => store.state.userinfo)
let result = store.state.userinfo
return result
})
// //
const list = reactive({ const list = reactive({
@ -128,10 +125,9 @@
// //
function getList() { function getList() {
// //
api.video.myVideoList({ api.video.myWorks({
query: { query: {
isDraft: 0, userId: userinfo.value.id,
userId: form.userId,
pageSize: list.pageSize, pageSize: list.pageSize,
pageNum: list.pageNum, pageNum: list.pageNum,
} }

View File

@ -271,7 +271,7 @@
</view> </view>
</view> </view>
<view class="btn plus black mt60 mlr60" @click="navigateToPage('/pages/index/extend')">置换流量</view> <view class="btn plus black mt60 mlr60" @click="navigateToPage('/pages/index/dataCenter/push')">置换流量</view>
</view> </view>
<view class="fill" style="height: 60rpx;"></view> <view class="fill" style="height: 60rpx;"></view>

View File

@ -47,6 +47,8 @@
import teen from '@/components/index/teen.vue' import teen from '@/components/index/teen.vue'
// 产品详情弹窗 // 产品详情弹窗
import productAlt from '@/components/index/proDetailAlt.vue' import productAlt from '@/components/index/proDetailAlt.vue'
// 产品规格弹窗
import productSpecAlt from '@/components/shop/detail/makeOrder.vue'
const { const {
proxy proxy
@ -126,6 +128,8 @@
const completeKey = ref('') const completeKey = ref('')
// 底部菜单高度 // 底部菜单高度
const footerMenuHeight = ref(0) const footerMenuHeight = ref(0)
// 当前产品详情
const productDetail = reactive({})
// 当前任务 // 当前任务
const task = computed(() => uni.$store.state.task) const task = computed(() => uni.$store.state.task)
// 用户信息 // 用户信息
@ -211,7 +215,10 @@
}) })
}, 50) }, 50)
// //
proxy.$refs.productAltRef.init() // proxy.$refs.productAltRef.init()
handleProBuy({
productId: 42,
})
}) })
onShow(() => { onShow(() => {
@ -277,7 +284,6 @@
// 获取推荐视频 // 获取推荐视频
function getRecList() { function getRecList() {
console.log('getRecList') console.log('getRecList')
return
// 获取首页分页视频 // 获取首页分页视频
api.video.homeVideo({ api.video.homeVideo({
query: { query: {
@ -683,6 +689,77 @@
// 打开产品详情弹窗 // 打开产品详情弹窗
proxy.$refs.productAltRef.init(item.productId) proxy.$refs.productAltRef.init(item.productId)
} }
/**
* 商品弹窗购买
* @param {Object} product
*/
function handleProductBuy(product) {
Object.assign(productDetail, {}, product)
//
proxy.$refs.productSpecAltRef.open()
}
/**
* 商品购买
* @param {Object} video 视频列表
*/
function handleProBuy(video) {
// 获取商品详情
api.shop.productDetail({
query: {
// 产品id
productionId: video.productId,
},
}).then(rs => {
if (rs.code == 200) {
//
handleProductBuy(rs.data)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 立即下单
*/
function handlePay(event) {
// 产生待付款订单
api.shop.addOrder({
data: [{
// 地址id
addressId: event.address.id,
// 产品id
productId: productDetail.id,
// 规格id
attrValueId: event.spec.id,
// 数量
payNum: event.payNum,
// 0-普通订单1-视频号订单
orderType: 1,
// 分享人id
// shareId: userinfo.id,
}],
}).then(rs => {
if (rs.code === 200) {
// 跳转
if (rs.data && rs.data[0]) uni.navigateTo({
url: util.setUrl('/pages/shop/commodity/payment', {
orderId: rs.data[0].orderId,
})
})
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script> </script>
<template> <template>
@ -746,7 +823,7 @@
@showCollect="handleShowCollectAlt" @showShareFirend="handleShowShareFirend" @showCollect="handleShowCollectAlt" @showShareFirend="handleShowShareFirend"
@onPlay="handleVideoOnPlay" @onPause="handleVideoOnPause" @like="videoLike" @onPlay="handleVideoOnPlay" @onPause="handleVideoOnPause" @like="videoLike"
@longtap="$refs.moreMenuRef.open(secItem)" @showFastCollect="handleShowFastCollect" @longtap="$refs.moreMenuRef.open(secItem)" @showFastCollect="handleShowFastCollect"
@showProduct="handleShowProduct" /> @showProduct="handleShowProduct" @proBuy="handleProBuy" />
<!-- </template> --> <!-- </template> -->
</cell> </cell>
</list> </list>
@ -779,7 +856,9 @@
<!-- 左侧菜单弹窗 --> <!-- 左侧菜单弹窗 -->
<leftMenuAlt ref="leftMenuRef" /> <leftMenuAlt ref="leftMenuRef" />
<!-- 产品详情弹窗 --> <!-- 产品详情弹窗 -->
<productAlt ref="productAltRef" /> <productAlt ref="productAltRef" @click="handleProductBuy" />
<!-- 产品立即下单弹窗 -->
<productSpecAlt ref="productSpecAltRef" :detail="productDetail" @confirm="handlePay" />
</template> </template>

View File

@ -17,7 +17,7 @@
id: '', id: '',
categoryId: '', categoryId: '',
sliderImage: [], sliderImage: [],
spec: [], specs: [],
}) })
// //
const category = reactive([]) const category = reactive([])
@ -49,7 +49,7 @@
// //
form.commission = detail.commission form.commission = detail.commission
// //
form.spec = detail.specs.map(item => { form.specs = detail.specs.map(item => {
return { return {
image: item.image, image: item.image,
sku: item.sku, sku: item.sku,
@ -109,7 +109,7 @@
// //
function handlePushSpec() { function handlePushSpec() {
form.spec.push({ form.specs.push({
// //
image: '', image: '',
// //
@ -134,7 +134,7 @@
* @param {Object} index 下标 * @param {Object} index 下标
*/ */
function handleRemoveSpec(index) { function handleRemoveSpec(index) {
form.spec.splice(index, 1) form.specs.splice(index, 1)
} }
// //
@ -241,7 +241,7 @@
</view> </view>
</view> </view>
<view class="main area" v-for="(item,index) in form.spec" :key="index"> <view class="main area" v-for="(item,index) in form.specs" :key="index">
<view class="line rows"> <view class="line rows">
<view class="name mtb30 f32">规格{{index + 1}}</view> <view class="name mtb30 f32">规格{{index + 1}}</view>
<view class="" @click="handleRemoveSpec(index)"> <view class="" @click="handleRemoveSpec(index)">

View File

@ -28,6 +28,8 @@
import proDetail from '@/components/shop/detail/detail' import proDetail from '@/components/shop/detail/detail'
// //
import footerMenu from '@/components/shop/detail/footerMenu'; import footerMenu from '@/components/shop/detail/footerMenu';
//
import makeOrder from '@/components/shop/detail/makeOrder.vue'
const { const {
proxy proxy
@ -123,6 +125,48 @@
function handleDetail(ev) { function handleDetail(ev) {
Object.assign(detail, {}, ev) Object.assign(detail, {}, ev)
} }
//
function showMakeOrder() {
proxy.$refs.makeOrderRef.open()
}
/**
* 立即下单
*/
function handlePay(event) {
//
api.shop.addOrder({
data: [{
// id
addressId: event.address.id,
// id
productId: detail.id,
// id
attrValueId: event.spec.id,
//
payNum: event.payNum,
// 0-1-
orderType: 0,
// id
// shareId: userinfo.id,
}],
}).then(rs => {
if (rs.code === 200) {
//
if (rs.data && rs.data[0]) uni.navigateTo({
url: util.setUrl('/pages/shop/commodity/payment', {
orderId: rs.data[0].orderId,
})
})
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script> </script>
<template> <template>
@ -132,17 +176,27 @@
<!-- 获取详情 --> <!-- 获取详情 -->
<proDetail :id="id" :detail="detail" /> <proDetail :id="id" :detail="detail" />
<!-- 精选 --> <!-- 精选 -->
<view class="recommend mlr20"> <view class="recommend mlr20">
<productList :choicenessTitle="true" /> <productList :choicenessTitle="true" />
</view> </view>
<!-- 底部 --> <!-- 底部菜单 -->
<footerMenu :detail="detail" @update="handleDetail" /> <view class="footer plr20 shadow bfff">
<footerMenu :detail="detail" @update="handleDetail" @buy="showMakeOrder" />
</view>
<!-- 立即支付 -->
<makeOrder ref="makeOrderRef" :detail="detail" @confirm="handlePay" />
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
// //
.footerMenu {
position: fixed;
left: 0;
right: 0;
bottom: 0;
}
</style> </style>

View File

@ -4,7 +4,7 @@ import {
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://8vtja7.natappfree.cc' let target = 'http://d5si5v.natappfree.cc'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],