2025.03.12 工作代码提交

This commit is contained in:
sx 2025-03-12 22:11:26 +08:00
parent 09e8b23e43
commit 134facabb2
14 changed files with 633 additions and 605 deletions

View File

@ -110,6 +110,18 @@ const shop = {
})
},
/**
* 商品详情下面的商品推荐
* @param {Object} param
*/
getInfoProductRecommendations(param) {
return util.request({
url: `/shopify/appProductionApi/infoProductRecommendations`,
method: 'GET',
query: param.query
})
},
/**
* 商品分类列表
* @param {Object} param
@ -134,6 +146,18 @@ const shop = {
})
},
/**
* 个人中心下面的商品推荐
* @param {Object} param
*/
getMineUserProList(param) {
return util.request({
url: `/shopify/appProductionApi/personalCenterProductRecommendations`,
method: 'GET',
query: param.query,
})
},
/**
* 添加商品浏览记录
* @param {Object} param

View File

@ -9,7 +9,7 @@ const config = {
host: 'http://91f.xyz:8080',
// #endif
// 是否vivo显示
showVivo: false,
showVivo: true,
// 支付方式配置
payType: {
score: {

View File

@ -126,6 +126,9 @@
<view class="main">
<!-- 获取详情 -->
<proDetail :id="proId" :detail="detail" />
<!-- 填充 -->
<view class="fill" style="height: 180rpx;"></view>
</view>
</scroll-view>

View File

@ -49,23 +49,6 @@
})
//
const recentOrderList = ref([])
//
const menuFn = {
//
store() {
link('/pages/shop/store/index')
},
//
customerService() {
link('/pages/news/question-answer/index')
},
//
heibianStar() {
//
}
}
//
const editorCtx = ref(null)
//
const spaceIndex = ref(0)
//
@ -94,7 +77,6 @@
let result = ''
const richText = props.detail.infoRichText || ''
if (richText) result = decodeURIComponent(escape(atob(richText)))
console.log('richText', result, decodeURIComponent(escape(atob(richText))))
return result
})
@ -378,12 +360,9 @@
<!-- 商品详情 -->
<view class="content mt30">
<!-- <rich-text :nodes="infoRichText" v-if="infoRichText" /> -->
<parseRichText :imageProp="{'mode': 'widthFix',}" :content="infoRichText" />
<parseRichText :imageProp="{'mode': 'widthFix',}" :content="infoRichText" v-if="infoRichText" />
</view>
</view>
<!-- 填充 -->
<view class="fill" style="height: 180rpx;"></view>
</template>
<style lang="scss">

View File

@ -16,24 +16,23 @@
choicenessTitle: {
type: Boolean,
default: false,
},
requestFn: {
type: Function,
default: (ev) => {
return api.shop.getProduct(ev)
}
},
})
//
//
const listPrototype = reactive({
pageSize: 10,
pageNum: 1,
total: 0,
//
searchValue: '',
//
merId: '',
//
brandId: '',
// code
categoryCode: '',
data: [],
})
//
const list = reactive([])
/**
* 点击列表项
@ -43,7 +42,8 @@
//
uni.navigateTo({
url: util.setUrl('/pages/shop/commodity/index', {
productId: item.id
productId: item.id,
categoryId: item.categoryId,
})
})
}
@ -64,24 +64,18 @@
//
function getList() {
api.shop.getProduct({
//
console.log('listPrototype', listPrototype)
props.requestFn({
data: {
pageSize: listPrototype.pageSize,
pageNum: listPrototype.pageNum,
//
searchValue: listPrototype.searchValue,
//
merId: listPrototype.merId,
//
brandId: listPrototype.brandId,
// code
categoryCode: listPrototype.categoryCode,
...listPrototype,
},
query: {
...listPrototype,
},
}).then(rs => {
if (rs.code == 200) {
if (listPrototype.pageNum == 1) listPrototype.data.length = []
listPrototype.data.push(...rs.rows)
if (listPrototype.pageNum == 1) list.length = []
list.push(...rs.rows)
listPrototype.total = rs.total
return
}
@ -111,8 +105,7 @@
</view>
<view class="list">
<view class="item oh bfff br20" v-for="(item, index) in listPrototype.data" :key="index"
@click="handleItem(item)">
<view class="item oh bfff br20" v-for="(item, index) in list" :key="index" @click="handleItem(item)">
<!-- 需要展示的图 -->
<image class="poster" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />

View File

@ -96,7 +96,8 @@
"path": "pages/mine/mine",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{

View File

@ -65,9 +65,7 @@
return result
})
//
const purse = computed(() => {
return store.state.purse || {}
})
const purse = computed(() => store.state.purse || {})
//
const configData = reactive({

View File

@ -6,13 +6,15 @@
import {
ref,
computed,
getCurrentInstance
} from 'vue'
import {
onReachBottom,
onPullDownRefresh,
onShow,
onLoad,
onPageScroll
onReady,
onPageScroll,
} from '@dcloudio/uni-app';
import {
useStore
@ -26,18 +28,35 @@ import noLogin from '@/components/login/noLogin'
import productList from '@/components/shop/productList/productList';
//
import footerMneu from '@/components/footerMenu/footerMenu'
//
//
import util from '@/common/js/util';
//
import api from '@/api/index.js'
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const userinfo = computed(() => {
let result = store.state.userinfo || {}
return result
})
const userinfo = computed(() => store.state.userinfo || {})
//
const showHeader = ref(false)
onReady(() => {
util.isLogin().then(rs => {
proxy.$refs.productListRef.getList()
})
})
onReachBottom(() => {
proxy.$refs.productListRef.getMoreList()
})
onPullDownRefresh(() => {
proxy.$refs.productListRef.refreshList()
})
onPageScroll((ev) => {
if (ev.scrollTop > 44) showHeader.value = true
else showHeader.value = false
@ -49,6 +68,7 @@ function link(url) {
url,
})
}
function toCustomer() {
uni.navigateTo({
url: util.setUrl('/pages/mine/setting/feedback')
@ -211,7 +231,8 @@ function toCustomer() {
<!-- 精选 -->
<view class="recommend mtb20 mlr20">
<productList choicenessTitle="true"></productList>
<productList ref="productListRef" :choicenessTitle="true" :requestFn="api.shop.getMineUserProList">
</productList>
</view>
</view>

View File

@ -60,7 +60,8 @@
function getList() {
api.mine.getBankCards({}).then(rs => {
if (rs.code == 200) {
Object.assign(list, rs.data)
list.length = 0
list.push(...rs.data)
return
}
util.alert({

View File

@ -101,7 +101,7 @@ function handleSubmit() {
//
if (gender[genderIndex.value]) user.sex = gender[genderIndex.value].id
if (!IsEmail(user.email)) {
if (user.email && !IsEmail(user.email)) {
util.alert('邮箱格式不正确!')
return
}
@ -110,10 +110,6 @@ function handleSubmit() {
...user,
}
//
// if(data.avatar) data.avatar = util.replace_url(data.avatar)
// if(data.background) data.background = util.replace_url(data.background)
//
api.mine.updateUserInfo({
data,
@ -133,12 +129,12 @@ function handleSubmit() {
})
})
}
//
function IsEmail(str) {
var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
return reg.test(str);
}
</script>
<template>

View File

@ -39,13 +39,16 @@
const id = ref('')
//
const detail = reactive({})
// id
const categoryId = ref('')
//
const userinfo = computed(() => {
return store.state.userinfo
})
const userinfo = computed(() => store.state.userinfo)
onLoad(option => {
// id
if (option.productId) id.value = option.productId
// id
if (option.categoryId) categoryId.value = option.categoryId
//
getDetail()
//
@ -55,7 +58,13 @@
})
onReady(() => {
//
// id
if (categoryId.value) {
proxy.$refs.productListRef.listPrototype.categoryId = categoryId.value
proxy.$refs.productListRef.listPrototype.productId = id.value
//
proxy.$refs.productListRef.getList()
}
})
//
@ -72,7 +81,6 @@
function addListener() {
//
uni.$on('commodityDetail', (data) => {
//
if (detail.id == data.id) getDetail()
})
}
@ -186,9 +194,13 @@
<proDetail :id="id" :detail="detail" />
<!-- 精选 -->
<view class="recommend mlr20">
<productList :choicenessTitle="true" />
<productList ref="productListRef" :choicenessTitle="true"
:requestFn="api.shop.getInfoProductRecommendations" />
</view>
<!-- 填充 -->
<view class="fill" style="height: 180rpx;"></view>
<!-- 底部菜单 -->
<view class="footer plr20 shadow bfff">
<footerMenu :detail="detail" @update="handleDetail" @buy="showMakeOrder" />

View File

@ -89,7 +89,7 @@
if (cateIndex.value === index) return
cateIndex.value = index
//
proxy.$refs.product.listPrototype.categoryCode = cateList[index].categoryCode
proxy.$refs.product.listPrototype.categoryId = cateList[index].id
//
proxy.$refs.product.refreshList()
}