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
// #ifndef H5
// host: 'http://91f.xyz:8080',
host: 'http://8vtja7.natappfree.cc',
host: 'http://d5si5v.natappfree.cc',
// #endif
// 支付方式配置
payType: {

View File

@ -134,7 +134,7 @@ const util = {
reject(res)
},
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',
'onPause', 'like', 'detailMenu', 'onEnd', 'longtap', 'dataCenter', 'showProduct'
'onPause', 'like', 'detailMenu', 'onEnd', 'longtap', 'dataCenter', 'showProduct', 'proBuy'
])
//
@ -466,10 +466,14 @@
// 广
function handleShowProduct() {
console.log('handleShowProduct')
emit('showProduct', props.item)
}
// 广
function handleProBuy() {
emit('proBuy', props.item)
}
//
defineExpose({
play,
@ -643,7 +647,7 @@
</view>
<view class="btn sm warm">
<text class="cfff f24 tac">立即购买</text>
<text class="cfff f24 tac" @click.stop="handleProBuy">立即购买</text>
</view>
</view>
</view>

View File

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

View File

@ -59,7 +59,7 @@
</script>
<template>
<view class="address df aic jcc">
<view class="address df fdr aic jcc">
<!-- 图标 -->
<view class="icon mr20">
<image class="wh45" src="/static/address.png" mode="aspectFill" />
@ -68,8 +68,8 @@
<!-- 收获地址 姓名电话 -->
<view class="info f1">
<!-- 收获地址 -->
<view class="location f30">
<text class="c333">{{address.province}}{{address.city}}{{address.country}}{{address.detail}}</text>
<view class="location">
<text class="c333 f30">{{address.province}}{{address.city}}{{address.country}}{{address.detail}}</text>
</view>
<!-- 姓名电话 -->
<view class="name">
@ -78,12 +78,21 @@
</view>
<!-- 选择地址 -->
<view v-if="shopEdit" class="btn ti warmHollow plr20 ml20" @click="link('/pages/mine/address/index?select=1')">
<text class="cFF9B27">选择地址</text>
<view v-if="shopEdit" class="button btn ti plr20 ml20"
@click="link('/pages/mine/address/index?select=1')">
<text class="text">选择地址</text>
</view>
</view>
</template>
<style lang="scss" scoped>
//
.button {
border: 2rpx solid #FF9B27;
.text {
font-size: 24rpx;
color: #FF9B27;
}
}
</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() {
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>
<template>
<view class="container">
<!-- 轮播图 -->
<view class="banner pr" v-if="detail.sliderImage">
<swiper class="swiper" :style="{height: bannerHeight,}" :current="bannerIndex"
@ -355,8 +280,7 @@
<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="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>
@ -450,38 +374,6 @@
<!-- 填充 -->
<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>
<style lang="scss">
@ -590,16 +482,4 @@
}
}
}
//
.footerMneu {
left: 0;
right: 0;
bottom: 0;
//
.option {
width: 80rpx;
}
}
</style>

View File

@ -16,8 +16,6 @@
import {
useStore
} from 'vuex'
//
import makeOrder from '@/components/shop/detail/makeOrder.vue'
const {
proxy
@ -33,10 +31,46 @@
},
})
//
const emit = defineEmits(['update'])
const emit = defineEmits(['update', 'buy'])
//
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 跳转路径
@ -46,12 +80,58 @@
url,
})
}
//
function handleBuy() {
emit('buy')
}
</script>
<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>
<style scoped lang="scss">
//
.footerMneu {
//
.option {
width: 80rpx;
.text {
color: #999;
font-size: 24rpx;
}
}
}
</style>

View File

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

View File

@ -240,7 +240,7 @@
</view>
</view>
<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>
<view class="item tac mt20">

View File

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

View File

@ -271,7 +271,7 @@
</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 class="fill" style="height: 60rpx;"></view>

View File

@ -47,6 +47,8 @@
import teen from '@/components/index/teen.vue'
// 产品详情弹窗
import productAlt from '@/components/index/proDetailAlt.vue'
// 产品规格弹窗
import productSpecAlt from '@/components/shop/detail/makeOrder.vue'
const {
proxy
@ -126,6 +128,8 @@
const completeKey = ref('')
// 底部菜单高度
const footerMenuHeight = ref(0)
// 当前产品详情
const productDetail = reactive({})
// 当前任务
const task = computed(() => uni.$store.state.task)
// 用户信息
@ -211,7 +215,10 @@
})
}, 50)
//
proxy.$refs.productAltRef.init()
// proxy.$refs.productAltRef.init()
handleProBuy({
productId: 42,
})
})
onShow(() => {
@ -277,7 +284,6 @@
// 获取推荐视频
function getRecList() {
console.log('getRecList')
return
// 获取首页分页视频
api.video.homeVideo({
query: {
@ -683,6 +689,77 @@
// 打开产品详情弹窗
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>
<template>
@ -746,7 +823,7 @@
@showCollect="handleShowCollectAlt" @showShareFirend="handleShowShareFirend"
@onPlay="handleVideoOnPlay" @onPause="handleVideoOnPause" @like="videoLike"
@longtap="$refs.moreMenuRef.open(secItem)" @showFastCollect="handleShowFastCollect"
@showProduct="handleShowProduct" />
@showProduct="handleShowProduct" @proBuy="handleProBuy" />
<!-- </template> -->
</cell>
</list>
@ -779,7 +856,9 @@
<!-- 左侧菜单弹窗 -->
<leftMenuAlt ref="leftMenuRef" />
<!-- 产品详情弹窗 -->
<productAlt ref="productAltRef" />
<productAlt ref="productAltRef" @click="handleProductBuy" />
<!-- 产品立即下单弹窗 -->
<productSpecAlt ref="productSpecAltRef" :detail="productDetail" @confirm="handlePay" />
</template>

View File

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

View File

@ -28,6 +28,8 @@
import proDetail from '@/components/shop/detail/detail'
//
import footerMenu from '@/components/shop/detail/footerMenu';
//
import makeOrder from '@/components/shop/detail/makeOrder.vue'
const {
proxy
@ -123,6 +125,48 @@
function handleDetail(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>
<template>
@ -132,17 +176,27 @@
<!-- 获取详情 -->
<proDetail :id="id" :detail="detail" />
<!-- 精选 -->
<view class="recommend mlr20">
<productList :choicenessTitle="true" />
</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>
</template>
<style lang="scss" scoped>
//
.footerMenu {
position: fixed;
left: 0;
right: 0;
bottom: 0;
}
</style>

View File

@ -4,7 +4,7 @@ import {
import uni from '@dcloudio/vite-plugin-uni';
// let target = 'http://91f.xyz:8080'
let target = 'http://8vtja7.natappfree.cc'
let target = 'http://d5si5v.natappfree.cc'
export default defineConfig({
plugins: [uni()],