2025.02.15 工作代码提交
This commit is contained in:
parent
4f178171c2
commit
2e76dd427e
|
@ -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: {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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')
|
||||||
// 详情
|
// 详情
|
||||||
|
@ -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>
|
|
@ -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>
|
|
@ -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,48 +200,9 @@
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 立即下单
|
|
||||||
*/
|
|
||||||
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">
|
<view class="banner pr" v-if="detail.sliderImage">
|
||||||
<swiper class="swiper" :style="{height: bannerHeight,}" :current="bannerIndex"
|
<swiper class="swiper" :style="{height: bannerHeight,}" :current="bannerIndex"
|
||||||
|
@ -355,8 +280,7 @@
|
||||||
<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">
|
||||||
<view class="item bsb df fdr jcsb aic plr10" v-for="(secItem, secIndex) in item"
|
<view class="item bsb df fdr jcsb aic plr10" v-for="(secItem, secIndex) in item" :key="secIndex">
|
||||||
:key="secIndex">
|
|
||||||
<view class="avatar">
|
<view class="avatar">
|
||||||
<image class="avatar wh70 cir" :src="secItem.avatar" mode="aspectFill" />
|
<image class="avatar wh70 cir" :src="secItem.avatar" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
|
@ -450,38 +374,6 @@
|
||||||
|
|
||||||
<!-- 填充 -->
|
<!-- 填充 -->
|
||||||
<view class="fill" style="height: 180rpx;"></view>
|
<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>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -590,16 +482,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 底部菜单
|
|
||||||
.footerMneu {
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
|
|
||||||
// 选项
|
|
||||||
.option {
|
|
||||||
width: 80rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
|
@ -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>
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 不能选
|
// 不能选
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -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)">
|
||||||
|
|
|
@ -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>
|
|
@ -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()],
|
||||||
|
|
Loading…
Reference in New Issue