合并代码

This commit is contained in:
sx 2025-01-19 13:55:21 +08:00
parent 53bc5bb6df
commit d56e2e6666
27 changed files with 473 additions and 175 deletions

View File

@ -132,6 +132,18 @@ const shop = {
* 获取收货地址
* @param {Object} param
*/
getDefaultAddress(param) {
return util.request({
url: `/shopify/appAddress/getDefaultOne`,
method: 'GET',
query: param.query,
})
},
/**
* 获取默认收货地址
* @param {Object} param
*/
getAddressList(param) {
return util.request({
url: `/shopify/appAddress/getList`,
@ -195,7 +207,7 @@ const shop = {
* 查看收藏记录
* @param {Object} param
*/
collect(param) {
getCollectList(param) {
return util.request({
url: `/shopify/collect`,
method: 'GET',
@ -266,6 +278,32 @@ const shop = {
load: true,
})
},
/**
* 获取发布的商品列表
* @param {Object} param
*/
addOrder(param) {
return util.request({
url: `/shopify/appOrder/addOrder`,
data: param.data,
method: 'POST',
load: true,
})
},
/**
* 获取订单详情
* @param {Object} param
*/
getOrderDetail(param) {
return util.request({
url: `/shopify/appOrder/getOne`,
query: param.query,
method: 'GET',
load: true,
})
},
}
export default shop

View File

@ -421,9 +421,21 @@ const video = {
*/
myLikeVideoList(param) {
return util.request({
url: `/home/myLikeVideoList`,
url: `/video/homepage/myLike`,
query: param.query,
method: 'POST',
method: 'GET',
})
},
/**
* 查看历史记录
* @param {Object} param
*/
getHistoryVideoList(param) {
return util.request({
url: `/video/homepage/history`,
query: param.query,
method: 'GET',
})
},
@ -433,8 +445,8 @@ const video = {
*/
getVideoById(param) {
return util.request({
url: `/homecommon/getVideoById`,
query: param.query,
url: `/video/video/getParticulars`,
data: param.data,
method: 'POST',
})
},
@ -482,6 +494,17 @@ const video = {
method: 'POST',
})
},
/**
* 查看作品
*/
myWorks(param) {
return util.request({
url: `/video/homepage/myWorks`,
query: param.query,
method: 'GET',
})
},
}
export default video

View File

@ -5,9 +5,8 @@ const config = {
host: 'http://localhost:5173',
// #endif
// #ifndef H5
// host: 'http://1641c8e0.r22.cpolar.top',
host: 'http://192.168.0.189:8080',
// host: 'http://192.168.0.102:8080',
host: 'https://539c1514.r24.cpolar.top',
// host: 'http://gfjds5.natappfree.cc',
// #endif
// 上传文件二级路径
uploadFilePath: "/homecommon/file/preview?fileName=",

View File

@ -212,7 +212,7 @@ const util = {
responseType: params.responseType || 'text',
// 请求成功返回
success: res => {
// console.log('request success', url, res, params.data ? params.data : '')
console.log('request success', url, res, params.data ? params.data : '')
// 关闭加载效果
if (params.load) {
uni.hideLoading()

View File

@ -63,10 +63,15 @@
type: Number,
default: 0,
},
// 0 1
statistic: {
type: [String, Number],
default: 0,
},
})
//
const emit = defineEmits(['showTime', 'showComment', 'showCollect', 'showFastCollect', 'showShareFirend', 'onPlay',
'onPause', 'like', 'detailMenu', 'onEnd', 'longtap'
'onPause', 'like', 'detailMenu', 'onEnd', 'longtap','dataCenter'
])
//
@ -455,6 +460,11 @@
videoCtx.value.playbackRate(2)
}
//
function handleData() {
emit('dataCenter', props.item)
}
//
defineExpose({
play,
@ -511,6 +521,15 @@
<!-- 操作台 -->
<view class="operate f1">
<!-- 留言 -->
<view class="item fmid" @click="handleData">
<view class="col">
<image class="wh50" src="/static/statistic.png" mode="aspectFit" />
</view>
<view class="txt mt20"></view>
</view>
<!-- 用户头像 -->
<navigator :url="util.setUrl('/pages/index/videoHome',{userId:item.userId})" class="item pr mb10">
<view class="col">

View File

@ -103,7 +103,7 @@
<scroll-view scroll-y="true" class="scroll f1" :show-scrollbar="false">
<view class="list">
<navigator url="/pages/index/wallet" class="item df fdr aic mtb15 ptb40 plr30 bfff br20" hover-class="none">
<navigator url="/pages/index/wallet/wallet" class="item df fdr aic mtb15 ptb40 plr30 bfff br20" hover-class="none">
<image class="wh80 mr25" src="/static/leftMenu1.png" mode="aspectFit" />
<text class="text f1 c333 f28">我的钱包</text>
</navigator>

View File

@ -68,7 +68,7 @@
if (props.mode == 'list') {
uni.navigateTo({
url: util.setUrl('/pages/index/videoDetail', {
videoId: item.videoId,
videoId: item.id,
isMine: props.isMine,
})
})

View File

@ -0,0 +1,102 @@
<script setup>
/**
* 我的作品组件
*/
import {
ref,
reactive,
onMounted,
computed
} from 'vue'
import {
useStore
} from 'vuex'
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js'
//
import videoMenu from '@/components/index/videoMenu.vue';
//
const list = reactive({
data: [],
pageSize: 10,
pageNum: 1,
total: 0,
})
//
const store = useStore()
//
const userinfo = computed(() => store.state.userinfo)
onMounted(() => {
getList()
})
//
function refreshList() {
list.pageNum = 1
list.total = 0
getList()
}
//
function getMoreList() {
if (list.data.length >= list.total) return
list.pageNum++
getList()
}
//
function getList() {
//
api.video.getHistoryVideoList({
query: {
userId: userinfo.value.id,
pageSize: list.pageSize,
pageNum: list.pageNum,
}
}).then(rs => {
if (rs.code == 200) {
if (list.pageNum == 1) list.data.length = []
list.data.push(...rs.rows.map(item => {
item.format_videoUrl = util.format_url(item.videoUrl, 'video')
item.format_imageUrl = util.format_url(item.imageUrl, 'img')
return item
}))
list.total = rs.total
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 点击我的作品
* @param {Object} item
*/
function handleItem(item) {
console.log(item)
}
//
defineExpose({
getList,
getMoreList,
refreshList,
})
</script>
<template>
<view class="">
<videoMenu :list="list.data" />
</view>
</template>
<style lang="scss" scoped>
//
</style>

View File

@ -21,17 +21,14 @@
//
const list = reactive({
data: [],
pageSize: 10,
pageSize: 18,
pageNum: 1,
total: 0,
})
//
const store = useStore()
//
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
const userinfo = computed(() => store.state.userinfo)
onMounted(() => {
getList()
@ -53,11 +50,10 @@
//
function getList() {
return
//
api.video.myLikeVideoList({
query: {
userId: userinfo.value.userId,
userId: userinfo.value.id,
pageSize: list.pageSize,
pageNum: list.pageNum,
}

View File

@ -5,8 +5,13 @@
import {
ref,
reactive,
onMounted
onMounted,
computed
} from 'vue'
//
import {
useStore,
} from 'vuex'
//
import util from '@/common/js/util';
// api
@ -17,10 +22,13 @@
//
const list = reactive({
data: [],
pageSize: 10,
pageSize: 9,
pageNum: 1,
total: 0,
})
const store = useStore()
//
const userinfo = computed(() => store.state.userinfo)
onMounted(() => {
getList()
@ -48,10 +56,10 @@
//
function getList() {
return
//
api.video.myVideoList({
api.video.myWorks({
query: {
userId: userinfo.value.id,
pageSize: list.pageSize,
pageNum: list.pageNum,
}

View File

@ -24,7 +24,7 @@
onMounted(() => {
//
addListener()
addListener()
})
onUnmounted(() => {
@ -65,16 +65,16 @@ addListener()
<view class="info f1">
<!-- 收获地址 -->
<view class="location f30">
<text class="c333">收货地址收货地址收货地址收货地址收货地址收货地址收货地址</text>
<text class="c333">{{address.province}}{{address.city}}{{address.country}}{{address.detail}}</text>
</view>
<!-- 姓名电话 -->
<view class="name">
<text class="c999 f26">张三 123456789</text>
<text class="c999 f26">{{address.name}} {{address.mobile}}</text>
</view>
</view>
<!-- 选择地址 -->
<view v-if="shopEdit" class="btn ti warmHollow plr20 ml20" @click="link('/pages/mine/delivery-address/index')">
<view v-if="shopEdit" class="btn ti warmHollow plr20 ml20" @click="link('/pages/mine/address/index')">
<text class="cFF9B27">选择地址</text>
</view>
</view>

View File

@ -46,13 +46,6 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/shop/continue-pay/index",
"style": {
"navigationBarTitleText": "继续付款",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path": "pages/shop/store/index",
"style": {
@ -145,7 +138,7 @@
}
},
{
"path": "pages/mine/delivery-address/index",
"path": "pages/mine/address/index",
"style": {
"navigationBarTitleText": "收货地址",
"navigationBarBackgroundColor": "#fff",
@ -713,6 +706,14 @@
"navigationBarTitleText" : "支付顺序",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path" : "pages/shop/commodity/payment",
"style" :
{
"navigationBarTitleText" : "继续付款",
"navigationBarBackgroundColor": "#fff"
}
}
],

View File

@ -131,7 +131,7 @@
</view>
</view>
<view class="charts" v-if="1">
<view class="charts" v-if="0">
<qiun-data-charts type="column" :opts="opts" :chartData="chartData" :ontouch="true" />
</view>
<view class="mtb30 fmid" v-else>

View File

@ -59,8 +59,8 @@
// 获取视频详情
function getVideoDetail() {
api.video.getVideoById({
query: {
videoId: videoId.value,
data: {
id: videoId.value,
}
}).then(rs => {
if (rs.code == 200) {
@ -201,12 +201,22 @@
}
})
}
/**
* 跳转数据中心
* @param {Object} detail
*/
function handleDataCenter(detail) {
//
}
</script>
<template>
<view class="page f1">
<!-- -->
<indexVideo ref="indexVideo" :item="detail" :tabIndex="0" :isMine="isMine" :index="0" :current="0" mode="detail" @showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt" @showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu" />
<indexVideo ref="indexVideo" :statistic="1" :item="detail" :tabIndex="0" :isMine="isMine" :index="0" :current="0" mode="detail"
@showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt"
@showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu" @dataCenter="handleDataCenter" />
<!-- 评论弹窗 -->
<commentAlt ref="commentRef" />

View File

@ -58,9 +58,10 @@
//
function getVideoDetail() {
console.log('videoId.value', videoId.value)
api.video.getVideoById({
query: {
videoId: videoId.value,
data: {
id: videoId.value,
}
}).then(rs => {
if (rs.code == 200) {

View File

@ -41,6 +41,8 @@
import product from '@/components/mine/product.vue';
//
import like from '@/components/mine/like.vue';
//
import history from '@/components/mine/history.vue';
//
const headerShow = ref(false)
@ -49,37 +51,40 @@
const tabList = reactive([{
name: '作品',
ref: 'productRef',
load: false,
},
{
name: '喜欢',
ref: 'likeRef',
load: false,
},
{
name: '收藏',
ref: 'collectRef',
load: false,
},
{
name: '历史浏览',
ref: 'historyRef',
load: false,
},
{
name: '投流历史',
load: false,
}
])
//
const tabIndex = ref(2)
const tabIndex = ref('')
// tab
const tabCurrent = computed(() => {
let result = tabList[tabIndex.value]
return result
})
const tabCurrent = computed(() => tabList[tabIndex.value])
//
const userinfo = computed(() => {
let result = store.state.userinfo || {}
return result
})
const userinfo = computed(() => store.state.userinfo || {})
onLoad(() => {
//
handleTabIndex(0)
//
uni.$on('focusUser', () => {
//
util.getUserinfo()
@ -127,6 +132,7 @@
function handleTabIndex(index) {
if (tabIndex.value === index) return
tabIndex.value = index
tabList[tabIndex.value].load = true
}
/**
@ -274,7 +280,7 @@
</view>
</view>
<!-- -->
<!-- 作品 -->
<view class="product mt30">
<view class="tab">
<scroll-view scroll-x="true" class="scroll">
@ -286,18 +292,18 @@
</scroll-view>
</view>
<!-- 作品 -->
<view v-show="tabIndex === 0">
<!-- 我发布的作品 -->
<view v-show="tabIndex === 0" v-if="tabList[0].load">
<product ref="productRef" />
</view>
<!-- 喜欢 -->
<view class="like" v-show="tabIndex === 1">
<!-- 我的喜欢 -->
<view class="like" v-show="tabIndex === 1" v-if="tabList[1].load">
<like ref="likeRef" />
</view>
<!-- 收藏 -->
<view class="collect" v-show="tabIndex === 2">
<!-- 我的收藏 -->
<view class="collect" v-show="tabIndex === 2" v-if="tabList[2].load">
<!-- 添加收藏按钮 -->
<view class="btn bd1s fmid mtb20 mlr20 c333 f32" @click="$refs.collectAddRef.open()">
<uni-icons type="plus" size="30rpx" />
@ -307,6 +313,10 @@
<!-- 收藏列表按钮 -->
<collectList ref="collectRef" @handleItem="handleCollectsItem" />
</view>
<view class="history" v-show="tabIndex === 3" v-if="tabList[3].load">
<history ref="historyRef" />
</view>
</view>
</view>

View File

@ -72,8 +72,8 @@
<image class="avatar wh130 cir" :src="userinfo.userPortrait" mode="aspectFill" />
<view class="info f1 mlr30">
<view class="nickname f34">{{ userinfo.userNickname }}</view>
<view class="address df aic mt15 f28 c666" @click="link('/pages/mine/delivery-address/index')">
<image class="wh30" src="@/static/mine-dingwei.png" mode="aspectFill" />
<view class="address df aic mt15 f28 c666" @click="link('/pages/mine/address/index')">
<image class="wh30 mr10" src="/static/mine-dingwei.png" mode="aspectFill" />
<text>收货地址</text>
</view>
</view>

View File

@ -241,6 +241,11 @@
<!-- #endif -->
</view>
<view class="fmid fdc mtb50">
<image class="wh150 br20" src="/static/logo.png" mode="aspectFill" />
<view class="mt20 c333 f26">塔罗科技网络(山东)有限公司旗下品牌---九亿</view>
</view>
<!-- 切换账号 退出登录 -->
<view class="mtb30 c999">
<view @click="logOff" class="btn">退出登录</view>

View File

@ -5,9 +5,31 @@
ref
} from 'vue';
import apex from '@/components/header/apex'
import {
onReachBottom,
onPullDownRefresh,
onShow,
onLoad,
onReady,
} from '@dcloudio/uni-app';
//
import api from '@/api/index.js';
// util
import util from '@/common/js/util';
//
const setting = ref(false)
onLoad(() => {
//
getList()
})
//
function getList() {
api.shop.getCollectList({}).then(res => {
console.log(res)
})
}
</script>
<template>

View File

@ -5,7 +5,8 @@
reactive,
getCurrentInstance,
computed,
defineEmits
defineEmits,
onMounted
} from 'vue'
//
import util from '@/common/js/util.js'
@ -35,50 +36,34 @@
})
//
const address = reactive({})
//
const userinfo = computed(() => store.state.userinfo)
//
const emit = defineEmits(['update'])
//
const spec = reactive([{
name: '款型',
option: [{
name: '普通款',
},
{
name: '升级款',
},
],
},
{
name: '卡通形象',
option: [{
name: '熊',
},
{
name: '狗',
},
{
name: '猫',
},
{
name: '河豚',
},
],
}
])
//
const spaceIndex = reactive([])
const spaceIndex = ref(0)
//
const payNum = ref(1)
//
const currentSpec = computed(() => {
let spec = props.detail.specs || []
return spec[spaceIndex.value] || {}
})
//
const userinfo = computed(() => store.state.userinfo)
//
const total = computed(() => {
let price = parseFloat(props.detail.price) * 100
let result = parseInt(price * payNum.value) / 100
return result
})
//
const menuFn = {
//
store() {
util.checkLink('pages/shop/store/index')
link('/pages/shop/store/index')
},
//
customerService() {
util.checkLink('pages/news/question-answer/index')
link('/pages/news/question-answer/index')
},
//
heibianStar() {
@ -86,6 +71,25 @@
}
}
onMounted(() => {
//
getDefaultAddress()
})
//
function getDefaultAddress() {
api.shop.getDefaultAddress({}).then(res => {
if (res.code === 200) {
if (res.data) Object.assign(address, {}, res.data)
return
}
util.alert({
content: res.msg,
showCancel: false,
})
})
}
/**
* 跳转
* @param {Object} url 跳转路径
@ -99,10 +103,9 @@
/**
* 选择规格
* @param {Object} index 选择规格下标
* @param {Object} secIndex
*/
function handleSpec(index, secIndex) {
spaceIndex.splice(index, 1, secIndex)
function handleSpec(index) {
if (spaceIndex.value !== index) spaceIndex.value = index
}
//
@ -133,6 +136,48 @@
})
})
}
//
function handlePay() {
//
if (!address.id) {
util.alert('请选择收货地址')
return
}
//
api.shop.addOrder({
data: [{
// id
addressId: address.id,
// id
productId: props.detail.id,
// id
attrValueId: currentSpec.value.id,
//
payNum: payNum.value,
// 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>
@ -173,53 +218,53 @@
<uni-popup type="bottom" ref="popup">
<view class="buy popBot plr20 bfff">
<view class="address mtb40">
<JyCommodityAddress :address="address"></JyCommodityAddress>
<template v-if="address.id">
<JyCommodityAddress :address="address" />
</template>
<template v-else>
<view class="fmid c999 f28" @click="link('/pages/mine/address/index')">
<view>暂无默认地址</view>
<uni-icons type="right" color="#999" size="30rpx" />
</view>
</template>
</view>
<!-- 商品图 价格 明细 数量 -->
<view class="jy-card-commodity-content df mtb40">
<!-- 商品图 -->
<image class="wh200 br10"
src="https://img30.360buyimg.com/popWareDetail/jfs/t1/124291/22/31317/138753/6449f30dF90683c84/4fee5d1a337f7b90.jpg.avif"
mode="aspectFill" />
<image class="wh200 br10" :src="currentSpec.image" mode="aspectFill" />
<!-- 价格 明细 数量 -->
<view class="info f1 df fdc jcsb ml30">
<!-- 价格 -->
<view class="content-info-price">
<text class="cFF9B27 f28">应付</text>
<text class="cFF9B27 f28">单价</text>
<text class="cFF9B27 f24"></text>
<text class="cFF9B27 f50">89</text>
<text class="cFF9B27 f50">{{detail.price}}</text>
</view>
<!-- 已选 -->
<view class="content-info-num">
<text class="f26 c333">已选 规格一 / 规格二</text>
<text class="f26 c333">已选 {{currentSpec.sku}}</text>
</view>
<!-- 计数器 -->
<view class="w200">
<uni-number-box :value="1" :step="1" />
<uni-number-box v-model="payNum" :step="1" />
</view>
</view>
</view>
<!-- 规格 -->
<view class="spec">
<view class="item mtb20" v-for="(item, index) in spec">
<!-- 标题 -->
<view class="title f32">{{item.name}}</view>
<!-- 选项 -->
<view class="selection df">
<!-- disabled 销量为零不能选 -->
<view class="option mtb20 mr20" :class="{'active': spaceIndex[index] === secIndex}"
v-for="(secItem,secIndex) in item.option" :key="secIndex"
@click="handleSpec(index,secIndex)">
<text class="txt">{{secItem.name}}</text>
</view>
<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>
</view>
</view>
<view class="btn lg primary mtb30" @click="link('/pages/shop/continue-pay/index')">
<text class="cfff">立即下单 89</text>
<view class="btn lg primary mtb30" @click="handlePay">
<text class="cfff">立即下单 {{total}}</text>
</view>
</view>
</uni-popup>
@ -238,9 +283,6 @@
//
.spec {
//
.selection {
//
.option {
padding: 5rpx 15rpx;
@ -275,5 +317,4 @@
}
}
}
}
</style>

View File

@ -1,21 +1,29 @@
<script setup>
import {
ref
ref,
} from 'vue'
import {
onReachBottom,
onPullDownRefresh,
onShow,
onLoad,
onReady,
} from '@dcloudio/uni-app';
//
import JyCommodityAddress from '@/components/public/jy-commodity-address'
//
import JyShopInformation from '@/components/public/jy-shop-information'
//
import JyCommodityInformation from '@/components/public/jy-commodity-information'
// api
import api from '@/api/index.js'
// util
import util from '@/common/js/util';
import {
bottomSafeAreaHeight
} from '@/components/public/Mixins.js'
// id
const orderId = ref('')
//
const paytype = ref('1')
//
//
const paytypeList = [{
@ -35,6 +43,30 @@
}
]
onLoad((option) => {
if (option.orderId) orderId.value = option.orderId
//
getDetail()
})
//
function getDetail() {
api.shop.getOrderDetail({
query: {
id: orderId.value
}
}).then(res => {
if (res.code == 200) {
//
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
}
//
function handlePayment(ev) {
//

View File

@ -374,4 +374,3 @@ likeType
7 商家和用户进行交流

BIN
jiuyi2/static/statistic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

View File

@ -3,6 +3,10 @@ import {
} from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
//
// let target = 'http://101.35.80.139:8080'
let target = 'http://2hs9aj.natappfree.cc'
export default defineConfig({
plugins: [uni()],
server: {
@ -10,39 +14,27 @@ export default defineConfig({
port: 5173,
proxy: {
"/system": {
target: "http://192.168.0.102:8080",
// target: "http://192.168.0.189:8080",
// target: "http://192.168.0.129:8080",
target,
changeOrigin: true,
},
"/shopify": {
target: "http://192.168.0.189:8080",
// target: "http://192.168.0.102:8080",
// target: "http://192.168.0.129:8080",
target,
changeOrigin: true,
},
"/user": {
target: "http://192.168.0.189:8080",
// target: "http://192.168.0.102:8080",
// target: "http://192.168.0.129:8080",
target,
changeOrigin: true,
},
"/coreplay": {
target: "http://192.168.0.189:8080",
// target: "http://192.168.0.102:8080",
// target: "http://192.168.0.129:8080",
target,
changeOrigin: true,
},
"/file": {
target: "http://192.168.0.189:8080",
// target: "http://192.168.0.102:8080",
// target: "http://192.168.0.129:8080",
target,
changeOrigin: true,
},
"/video": {
target: "http://192.168.0.189:8080",
// target: "http://192.168.0.102:8080",
// target: "http://192.168.0.129:8080",
target,
changeOrigin: true,
},
}