2025.03.12 工作代码提交
This commit is contained in:
parent
09e8b23e43
commit
134facabb2
|
@ -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
|
* @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
|
* @param {Object} param
|
||||||
|
|
|
@ -9,7 +9,7 @@ const config = {
|
||||||
host: 'http://91f.xyz:8080',
|
host: 'http://91f.xyz:8080',
|
||||||
// #endif
|
// #endif
|
||||||
// 是否vivo显示
|
// 是否vivo显示
|
||||||
showVivo: false,
|
showVivo: true,
|
||||||
// 支付方式配置
|
// 支付方式配置
|
||||||
payType: {
|
payType: {
|
||||||
score: {
|
score: {
|
||||||
|
|
|
@ -126,6 +126,9 @@
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<!-- 获取详情 -->
|
<!-- 获取详情 -->
|
||||||
<proDetail :id="proId" :detail="detail" />
|
<proDetail :id="proId" :detail="detail" />
|
||||||
|
|
||||||
|
<!-- 填充 -->
|
||||||
|
<view class="fill" style="height: 180rpx;"></view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
|
|
|
@ -49,23 +49,6 @@
|
||||||
})
|
})
|
||||||
// 最近购买订单列表
|
// 最近购买订单列表
|
||||||
const recentOrderList = ref([])
|
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)
|
const spaceIndex = ref(0)
|
||||||
// 数量
|
// 数量
|
||||||
|
@ -94,7 +77,6 @@
|
||||||
let result = ''
|
let result = ''
|
||||||
const richText = props.detail.infoRichText || ''
|
const richText = props.detail.infoRichText || ''
|
||||||
if (richText) result = decodeURIComponent(escape(atob(richText)))
|
if (richText) result = decodeURIComponent(escape(atob(richText)))
|
||||||
console.log('richText', result, decodeURIComponent(escape(atob(richText))))
|
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -378,12 +360,9 @@
|
||||||
<!-- 商品详情 -->
|
<!-- 商品详情 -->
|
||||||
<view class="content mt30">
|
<view class="content mt30">
|
||||||
<!-- <rich-text :nodes="infoRichText" v-if="infoRichText" /> -->
|
<!-- <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>
|
</view>
|
||||||
|
|
||||||
<!-- 填充 -->
|
|
||||||
<view class="fill" style="height: 180rpx;"></view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -1,113 +1,113 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
// 店铺 客服 收藏 支付
|
// 店铺 客服 收藏 支付
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
computed,
|
computed,
|
||||||
defineEmits,
|
defineEmits,
|
||||||
onMounted
|
onMounted
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
//
|
//
|
||||||
import util from '@/common/js/util.js'
|
import util from '@/common/js/util.js'
|
||||||
//
|
//
|
||||||
import api from '@/api/index.js'
|
import api from '@/api/index.js'
|
||||||
//
|
//
|
||||||
import {
|
import {
|
||||||
useStore
|
useStore
|
||||||
} from 'vuex'
|
} from 'vuex'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
proxy
|
proxy
|
||||||
} = getCurrentInstance()
|
} = getCurrentInstance()
|
||||||
//
|
//
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
//
|
//
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 商品信息
|
// 商品信息
|
||||||
detail: {
|
detail: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
//
|
//
|
||||||
const emit = defineEmits(['update', 'buy'])
|
const emit = defineEmits(['update', 'buy'])
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const userinfo = computed(() => store.state.userinfo)
|
const userinfo = computed(() => store.state.userinfo)
|
||||||
|
|
||||||
// 商品收藏
|
// 商品收藏
|
||||||
function handleCollect() {
|
function handleCollect() {
|
||||||
util.isLogin().then(rs => {
|
util.isLogin().then(rs => {
|
||||||
//
|
//
|
||||||
api.shop.addProductCollect({
|
api.shop.addProductCollect({
|
||||||
query: {
|
query: {
|
||||||
productId: props.detail.id,
|
productId: props.detail.id,
|
||||||
type: {
|
type: {
|
||||||
0: 1,
|
0: 1,
|
||||||
1: 0,
|
1: 0,
|
||||||
}[props.detail.isCollect]
|
} [props.detail.isCollect]
|
||||||
}
|
}
|
||||||
}).then(rs => {
|
}).then(rs => {
|
||||||
if (rs.code == 200) {
|
if (rs.code == 200) {
|
||||||
// 关注状态
|
// 关注状态
|
||||||
props.detail.isCollect = {
|
props.detail.isCollect = {
|
||||||
0: 1,
|
0: 1,
|
||||||
1: 0,
|
1: 0,
|
||||||
}[props.detail.isCollect]
|
} [props.detail.isCollect]
|
||||||
// 关注数量
|
// 关注数量
|
||||||
props.detail.collectNumber = rs.data
|
props.detail.collectNumber = rs.data
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
util.alert({
|
util.alert({
|
||||||
content: rs.msg,
|
content: rs.msg,
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
// 登录
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/login/loginPhone'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}
|
||||||
// 登录
|
|
||||||
|
/**
|
||||||
|
* 跳转
|
||||||
|
* @param {Object} url 跳转路径
|
||||||
|
*/
|
||||||
|
function link(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/login/loginPhone'
|
url,
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// 商品购买
|
||||||
* 跳转
|
function handleBuy() {
|
||||||
* @param {Object} url 跳转路径
|
emit('buy')
|
||||||
*/
|
}
|
||||||
function link(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 商品购买
|
|
||||||
function handleBuy() {
|
|
||||||
emit('buy')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 客服
|
// 客服
|
||||||
function toCustomer() {
|
function toCustomer() {
|
||||||
// api.shop.getCustomerService({ merchantId: props.detail.merId }).then(rs => {
|
// api.shop.getCustomerService({ merchantId: props.detail.merId }).then(rs => {
|
||||||
// if (rs.code == 200) {
|
// if (rs.code == 200) {
|
||||||
// let param = {};
|
// let param = {};
|
||||||
// param.type = 'C2C'
|
// param.type = 'C2C'
|
||||||
// param.name = `${props.detail.merName}`
|
// param.name = `${props.detail.merName}`
|
||||||
// param.msgId = `${rs.data.serviceId}`
|
// param.msgId = `${rs.data.serviceId}`
|
||||||
// param.isCustomer = true
|
// param.isCustomer = true
|
||||||
|
|
||||||
// util.toChat(param)
|
// util.toChat(param)
|
||||||
|
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url: util.setUrl('/pages/news/chat/chat', param)
|
// url: util.setUrl('/pages/news/chat/chat', param)
|
||||||
// })
|
// })
|
||||||
// } else {
|
// } else {
|
||||||
// util.alert(rs.msg)
|
// util.alert(rs.msg)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -144,17 +144,17 @@ function toCustomer() {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
// 底部菜单
|
// 底部菜单
|
||||||
.footerMneu {
|
.footerMneu {
|
||||||
|
|
||||||
// 选项
|
// 选项
|
||||||
.option {
|
.option {
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
|
@ -16,24 +16,23 @@
|
||||||
choicenessTitle: {
|
choicenessTitle: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
}
|
},
|
||||||
|
requestFn: {
|
||||||
|
type: Function,
|
||||||
|
default: (ev) => {
|
||||||
|
return api.shop.getProduct(ev)
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// 参数
|
// 商品列表参数
|
||||||
const listPrototype = reactive({
|
const listPrototype = reactive({
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
// 搜索
|
|
||||||
searchValue: '',
|
|
||||||
// 商户主键
|
|
||||||
merId: '',
|
|
||||||
// 品牌主键
|
|
||||||
brandId: '',
|
|
||||||
// 分类code
|
|
||||||
categoryCode: '',
|
|
||||||
data: [],
|
|
||||||
})
|
})
|
||||||
|
// 商品列表
|
||||||
|
const list = reactive([])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击列表项
|
* 点击列表项
|
||||||
|
@ -43,7 +42,8 @@
|
||||||
//
|
//
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: util.setUrl('/pages/shop/commodity/index', {
|
url: util.setUrl('/pages/shop/commodity/index', {
|
||||||
productId: item.id
|
productId: item.id,
|
||||||
|
categoryId: item.categoryId,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -64,24 +64,18 @@
|
||||||
|
|
||||||
// 获取商品
|
// 获取商品
|
||||||
function getList() {
|
function getList() {
|
||||||
api.shop.getProduct({
|
console.log('listPrototype', listPrototype)
|
||||||
//
|
props.requestFn({
|
||||||
data: {
|
data: {
|
||||||
pageSize: listPrototype.pageSize,
|
...listPrototype,
|
||||||
pageNum: listPrototype.pageNum,
|
},
|
||||||
// 搜索
|
query: {
|
||||||
searchValue: listPrototype.searchValue,
|
...listPrototype,
|
||||||
// 商户主键
|
|
||||||
merId: listPrototype.merId,
|
|
||||||
// 品牌主键
|
|
||||||
brandId: listPrototype.brandId,
|
|
||||||
// 分类code
|
|
||||||
categoryCode: listPrototype.categoryCode,
|
|
||||||
},
|
},
|
||||||
}).then(rs => {
|
}).then(rs => {
|
||||||
if (rs.code == 200) {
|
if (rs.code == 200) {
|
||||||
if (listPrototype.pageNum == 1) listPrototype.data.length = []
|
if (listPrototype.pageNum == 1) list.length = []
|
||||||
listPrototype.data.push(...rs.rows)
|
list.push(...rs.rows)
|
||||||
listPrototype.total = rs.total
|
listPrototype.total = rs.total
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -111,8 +105,7 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item oh bfff br20" v-for="(item, index) in listPrototype.data" :key="index"
|
<view class="item oh bfff br20" v-for="(item, index) in list" :key="index" @click="handleItem(item)">
|
||||||
@click="handleItem(item)">
|
|
||||||
<!-- 需要展示的图 -->
|
<!-- 需要展示的图 -->
|
||||||
<image class="poster" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />
|
<image class="poster" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,8 @@
|
||||||
"path": "pages/mine/mine",
|
"path": "pages/mine/mine",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的",
|
"navigationBarTitleText": "我的",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,9 +65,7 @@
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
// 我的钱包
|
// 我的钱包
|
||||||
const purse = computed(() => {
|
const purse = computed(() => store.state.purse || {})
|
||||||
return store.state.purse || {}
|
|
||||||
})
|
|
||||||
|
|
||||||
// 榴莲果配置
|
// 榴莲果配置
|
||||||
const configData = reactive({
|
const configData = reactive({
|
||||||
|
|
|
@ -1,59 +1,79 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* 个人中心 商城
|
* 个人中心 商城
|
||||||
*/
|
*/
|
||||||
// 底部菜单
|
// 底部菜单
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
computed,
|
computed,
|
||||||
} from 'vue'
|
getCurrentInstance
|
||||||
import {
|
} from 'vue'
|
||||||
onReachBottom,
|
import {
|
||||||
onPullDownRefresh,
|
onReachBottom,
|
||||||
onShow,
|
onPullDownRefresh,
|
||||||
onLoad,
|
onShow,
|
||||||
onPageScroll
|
onLoad,
|
||||||
} from '@dcloudio/uni-app';
|
onReady,
|
||||||
import {
|
onPageScroll,
|
||||||
useStore
|
} from '@dcloudio/uni-app';
|
||||||
} from 'vuex'
|
import {
|
||||||
// 顶部状态栏
|
useStore
|
||||||
import statusBar from '@/components/header/statusBar'
|
} from 'vuex'
|
||||||
// 未登录状态
|
// 顶部状态栏
|
||||||
import noLogin from '@/components/login/noLogin'
|
import statusBar from '@/components/header/statusBar'
|
||||||
|
// 未登录状态
|
||||||
|
import noLogin from '@/components/login/noLogin'
|
||||||
|
|
||||||
// 产品列表
|
// 产品列表
|
||||||
import productList from '@/components/shop/productList/productList';
|
import productList from '@/components/shop/productList/productList';
|
||||||
// 底部导航
|
// 底部导航
|
||||||
import footerMneu from '@/components/footerMenu/footerMenu'
|
import footerMneu from '@/components/footerMenu/footerMenu'
|
||||||
//
|
// 工具库
|
||||||
import util from '@/common/js/util';
|
import util from '@/common/js/util';
|
||||||
//
|
//
|
||||||
const store = useStore()
|
import api from '@/api/index.js'
|
||||||
// 用户信息
|
|
||||||
const userinfo = computed(() => {
|
|
||||||
let result = store.state.userinfo || {}
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
// 是否显示顶部
|
|
||||||
const showHeader = ref(false)
|
|
||||||
|
|
||||||
onPageScroll((ev) => {
|
const {
|
||||||
if (ev.scrollTop > 44) showHeader.value = true
|
proxy
|
||||||
else showHeader.value = false
|
} = getCurrentInstance()
|
||||||
})
|
//
|
||||||
|
const store = useStore()
|
||||||
|
// 用户信息
|
||||||
|
const userinfo = computed(() => store.state.userinfo || {})
|
||||||
|
// 是否显示顶部
|
||||||
|
const showHeader = ref(false)
|
||||||
|
|
||||||
// 跳转
|
onReady(() => {
|
||||||
function link(url) {
|
util.isLogin().then(rs => {
|
||||||
uni.navigateTo({
|
proxy.$refs.productListRef.getList()
|
||||||
url,
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
function toCustomer() {
|
onReachBottom(() => {
|
||||||
uni.navigateTo({
|
proxy.$refs.productListRef.getMoreList()
|
||||||
url: util.setUrl('/pages/mine/setting/feedback')
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
onPullDownRefresh(() => {
|
||||||
|
proxy.$refs.productListRef.refreshList()
|
||||||
|
})
|
||||||
|
|
||||||
|
onPageScroll((ev) => {
|
||||||
|
if (ev.scrollTop > 44) showHeader.value = true
|
||||||
|
else showHeader.value = false
|
||||||
|
})
|
||||||
|
|
||||||
|
// 跳转
|
||||||
|
function link(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function toCustomer() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: util.setUrl('/pages/mine/setting/feedback')
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -211,7 +231,8 @@ function toCustomer() {
|
||||||
|
|
||||||
<!-- 精选 -->
|
<!-- 精选 -->
|
||||||
<view class="recommend mtb20 mlr20">
|
<view class="recommend mtb20 mlr20">
|
||||||
<productList choicenessTitle="true"></productList>
|
<productList ref="productListRef" :choicenessTitle="true" :requestFn="api.shop.getMineUserProList">
|
||||||
|
</productList>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -220,55 +241,55 @@ function toCustomer() {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
//
|
//
|
||||||
.apex {
|
.apex {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: .2s;
|
transition: .2s;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 头部个人资料卡
|
|
||||||
.header {
|
|
||||||
.avatar {
|
|
||||||
background: #D8D8D8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 我的钱包
|
|
||||||
.wallet {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.right {
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 模块
|
// 头部个人资料卡
|
||||||
.container {
|
.header {
|
||||||
position: relative;
|
.avatar {
|
||||||
overflow: hidden;
|
background: #D8D8D8;
|
||||||
margin: 20rpx 20rpx;
|
}
|
||||||
padding: 0 20rpx;
|
}
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 20rpx;
|
// 我的钱包
|
||||||
|
.wallet {
|
||||||
.main {
|
position: relative;
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(5, 1fr);
|
.right {
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 模块
|
||||||
|
.container {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 20rpx 20rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
.main {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
|
@ -60,7 +60,8 @@
|
||||||
function getList() {
|
function getList() {
|
||||||
api.mine.getBankCards({}).then(rs => {
|
api.mine.getBankCards({}).then(rs => {
|
||||||
if (rs.code == 200) {
|
if (rs.code == 200) {
|
||||||
Object.assign(list, rs.data)
|
list.length = 0
|
||||||
|
list.push(...rs.data)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
util.alert({
|
util.alert({
|
||||||
|
|
|
@ -1,144 +1,140 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
/**
|
/**
|
||||||
* 个人信息
|
* 个人信息
|
||||||
*/
|
*/
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
computed,
|
computed,
|
||||||
reactive,
|
reactive,
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import {
|
import {
|
||||||
useStore
|
useStore
|
||||||
} from 'vuex'
|
} from 'vuex'
|
||||||
// 工具库
|
// 工具库
|
||||||
import util from '@/common/js/util';
|
import util from '@/common/js/util';
|
||||||
// 接口
|
// 接口
|
||||||
import api from '@/api';
|
import api from '@/api';
|
||||||
|
|
||||||
// vuex
|
// vuex
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
// 用户
|
// 用户
|
||||||
const user = reactive({})
|
const user = reactive({})
|
||||||
|
|
||||||
// 性别
|
// 性别
|
||||||
const gender = reactive([{
|
const gender = reactive([{
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '男',
|
name: '男',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '女',
|
name: '女',
|
||||||
}
|
|
||||||
])
|
|
||||||
// 性别下标
|
|
||||||
const genderIndex = ref(0)
|
|
||||||
|
|
||||||
onLoad(() => {
|
|
||||||
// 同步用户信息
|
|
||||||
syncInfo()
|
|
||||||
})
|
|
||||||
|
|
||||||
// 同步用户信息
|
|
||||||
function syncInfo() {
|
|
||||||
// 用户信息
|
|
||||||
const userinfo = store.state.userinfo
|
|
||||||
user.background = userinfo.background
|
|
||||||
user.account = userinfo.account
|
|
||||||
user.userAccount = userinfo.userAccount
|
|
||||||
user.userNickname = userinfo.userNickname
|
|
||||||
user.homeTown = userinfo.homeTown
|
|
||||||
user.personalSignature = userinfo.personalSignature
|
|
||||||
user.id = userinfo.id + ''
|
|
||||||
user.birthday = userinfo.birthday
|
|
||||||
user.avatar = userinfo.avatar
|
|
||||||
user.email = userinfo.email
|
|
||||||
// 修改性别下标
|
|
||||||
genderIndex.value = gender.findIndex(item => item.id == userinfo.sex)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择生日日期
|
|
||||||
* @param {Object} ev 默认事件
|
|
||||||
*/
|
|
||||||
function handleBirthday(ev) {
|
|
||||||
const value = ev.detail.value
|
|
||||||
if (user.birthday === value) return
|
|
||||||
user.birthday = value
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择性别
|
|
||||||
* @param {Object} ev 默认事件
|
|
||||||
*/
|
|
||||||
function handleGender(ev) {
|
|
||||||
const value = ev.detail.value
|
|
||||||
if (genderIndex.value === value) return
|
|
||||||
genderIndex.value = value
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传图片
|
|
||||||
* @param {String} key 需要修改个人信息的字段
|
|
||||||
*/
|
|
||||||
function uploadImg(key) {
|
|
||||||
util.upload_image({
|
|
||||||
value: user[key],
|
|
||||||
type: 1,
|
|
||||||
success: rs => {
|
|
||||||
// 同步值
|
|
||||||
user[key] = rs.value
|
|
||||||
console.log('user', user)
|
|
||||||
}
|
}
|
||||||
|
])
|
||||||
|
// 性别下标
|
||||||
|
const genderIndex = ref(0)
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
// 同步用户信息
|
||||||
|
syncInfo()
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
// 保存个人信息
|
// 同步用户信息
|
||||||
function handleSubmit() {
|
function syncInfo() {
|
||||||
// 同步性别值
|
// 用户信息
|
||||||
if (gender[genderIndex.value]) user.sex = gender[genderIndex.value].id
|
const userinfo = store.state.userinfo
|
||||||
|
user.background = userinfo.background
|
||||||
if (!IsEmail(user.email)) {
|
user.account = userinfo.account
|
||||||
util.alert('邮箱格式不正确!')
|
user.userAccount = userinfo.userAccount
|
||||||
return
|
user.userNickname = userinfo.userNickname
|
||||||
|
user.homeTown = userinfo.homeTown
|
||||||
|
user.personalSignature = userinfo.personalSignature
|
||||||
|
user.id = userinfo.id + ''
|
||||||
|
user.birthday = userinfo.birthday
|
||||||
|
user.avatar = userinfo.avatar
|
||||||
|
user.email = userinfo.email
|
||||||
|
// 修改性别下标
|
||||||
|
genderIndex.value = gender.findIndex(item => item.id == userinfo.sex)
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = {
|
/**
|
||||||
...user,
|
* 选择生日日期
|
||||||
|
* @param {Object} ev 默认事件
|
||||||
|
*/
|
||||||
|
function handleBirthday(ev) {
|
||||||
|
const value = ev.detail.value
|
||||||
|
if (user.birthday === value) return
|
||||||
|
user.birthday = value
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去域名地址
|
/**
|
||||||
// if(data.avatar) data.avatar = util.replace_url(data.avatar)
|
* 选择性别
|
||||||
// if(data.background) data.background = util.replace_url(data.background)
|
* @param {Object} ev 默认事件
|
||||||
|
*/
|
||||||
|
function handleGender(ev) {
|
||||||
|
const value = ev.detail.value
|
||||||
|
if (genderIndex.value === value) return
|
||||||
|
genderIndex.value = value
|
||||||
|
}
|
||||||
|
|
||||||
//
|
/**
|
||||||
api.mine.updateUserInfo({
|
* 上传图片
|
||||||
data,
|
* @param {String} key 需要修改个人信息的字段
|
||||||
}).then(rs => {
|
*/
|
||||||
if (rs.code === 200) {
|
function uploadImg(key) {
|
||||||
store.commit('setState', {
|
util.upload_image({
|
||||||
key: 'userinfo',
|
value: user[key],
|
||||||
value: Object.assign(store.state.userinfo, user)
|
type: 1,
|
||||||
})
|
success: rs => {
|
||||||
|
// 同步值
|
||||||
|
user[key] = rs.value
|
||||||
|
console.log('user', user)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
util.alert('修改成功')
|
// 保存个人信息
|
||||||
|
function handleSubmit() {
|
||||||
|
// 同步性别值
|
||||||
|
if (gender[genderIndex.value]) user.sex = gender[genderIndex.value].id
|
||||||
|
|
||||||
|
if (user.email && !IsEmail(user.email)) {
|
||||||
|
util.alert('邮箱格式不正确!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
util.alert({
|
|
||||||
content: rs.msg,
|
|
||||||
showCancel: false,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 校验邮箱地址
|
|
||||||
function IsEmail(str) {
|
|
||||||
var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
|
|
||||||
return reg.test(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
...user,
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
api.mine.updateUserInfo({
|
||||||
|
data,
|
||||||
|
}).then(rs => {
|
||||||
|
if (rs.code === 200) {
|
||||||
|
store.commit('setState', {
|
||||||
|
key: 'userinfo',
|
||||||
|
value: Object.assign(store.state.userinfo, user)
|
||||||
|
})
|
||||||
|
|
||||||
|
util.alert('修改成功')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
util.alert({
|
||||||
|
content: rs.msg,
|
||||||
|
showCancel: false,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验邮箱地址
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -233,26 +229,26 @@ function IsEmail(str) {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
// 背景
|
// 背景
|
||||||
.bgBox {
|
.bgBox {
|
||||||
.content {
|
.content {
|
||||||
height: 400rpx;
|
height: 400rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改背景
|
||||||
|
.changeBg {
|
||||||
|
background-color: rgba(0, 0, 0, .3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改背景
|
// 头像
|
||||||
.changeBg {
|
.avatarBox {
|
||||||
background-color: rgba(0, 0, 0, .3);
|
padding: 2rpx;
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 头像
|
// 资料
|
||||||
.avatarBox {
|
.info {
|
||||||
padding: 2rpx;
|
margin-top: -20rpx;
|
||||||
background-color: #fff;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 资料
|
|
||||||
.info {
|
|
||||||
margin-top: -20rpx;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
|
@ -39,13 +39,16 @@
|
||||||
const id = ref('')
|
const id = ref('')
|
||||||
// 产品详情
|
// 产品详情
|
||||||
const detail = reactive({})
|
const detail = reactive({})
|
||||||
|
// 分类id
|
||||||
|
const categoryId = ref('')
|
||||||
// 当前登录的用户信息
|
// 当前登录的用户信息
|
||||||
const userinfo = computed(() => {
|
const userinfo = computed(() => store.state.userinfo)
|
||||||
return store.state.userinfo
|
|
||||||
})
|
|
||||||
|
|
||||||
onLoad(option => {
|
onLoad(option => {
|
||||||
|
// 商品id
|
||||||
if (option.productId) id.value = option.productId
|
if (option.productId) id.value = option.productId
|
||||||
|
// 分类id
|
||||||
|
if (option.categoryId) categoryId.value = option.categoryId
|
||||||
// 获取产品详情
|
// 获取产品详情
|
||||||
getDetail()
|
getDetail()
|
||||||
// 添加商品浏览记录
|
// 添加商品浏览记录
|
||||||
|
@ -55,7 +58,13 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
onReady(() => {
|
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() {
|
function addListener() {
|
||||||
// 监听商品详情
|
// 监听商品详情
|
||||||
uni.$on('commodityDetail', (data) => {
|
uni.$on('commodityDetail', (data) => {
|
||||||
//
|
|
||||||
if (detail.id == data.id) getDetail()
|
if (detail.id == data.id) getDetail()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -186,9 +194,13 @@
|
||||||
<proDetail :id="id" :detail="detail" />
|
<proDetail :id="id" :detail="detail" />
|
||||||
<!-- 精选 -->
|
<!-- 精选 -->
|
||||||
<view class="recommend mlr20">
|
<view class="recommend mlr20">
|
||||||
<productList :choicenessTitle="true" />
|
<productList ref="productListRef" :choicenessTitle="true"
|
||||||
|
:requestFn="api.shop.getInfoProductRecommendations" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 填充 -->
|
||||||
|
<view class="fill" style="height: 180rpx;"></view>
|
||||||
|
|
||||||
<!-- 底部菜单 -->
|
<!-- 底部菜单 -->
|
||||||
<view class="footer plr20 shadow bfff">
|
<view class="footer plr20 shadow bfff">
|
||||||
<footerMenu :detail="detail" @update="handleDetail" @buy="showMakeOrder" />
|
<footerMenu :detail="detail" @update="handleDetail" @buy="showMakeOrder" />
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
if (cateIndex.value === index) return
|
if (cateIndex.value === index) return
|
||||||
cateIndex.value = index
|
cateIndex.value = index
|
||||||
// 分类
|
// 分类
|
||||||
proxy.$refs.product.listPrototype.categoryCode = cateList[index].categoryCode
|
proxy.$refs.product.listPrototype.categoryId = cateList[index].id
|
||||||
// 重载列表
|
// 重载列表
|
||||||
proxy.$refs.product.refreshList()
|
proxy.$refs.product.refreshList()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,198 +1,198 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
// 店铺首页
|
// 店铺首页
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
reactive,
|
reactive,
|
||||||
ref,
|
ref,
|
||||||
defineExpose,
|
defineExpose,
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
onPageScroll
|
onPageScroll
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
|
|
||||||
// 工具库
|
// 工具库
|
||||||
import util from '@/common/js/util.js'
|
import util from '@/common/js/util.js'
|
||||||
// 顶部
|
// 顶部
|
||||||
import apex from '@/components/header/apex.vue'
|
import apex from '@/components/header/apex.vue'
|
||||||
// 商品列表
|
// 商品列表
|
||||||
import productList from '@/components/shop/productList/productList'
|
import productList from '@/components/shop/productList/productList'
|
||||||
|
|
||||||
import api from '@/api/index.js'
|
import api from '@/api/index.js'
|
||||||
|
|
||||||
// 分类选项
|
// 分类选项
|
||||||
const filteredList = ref([{
|
const filteredList = ref([{
|
||||||
label: '默认',
|
label: '默认',
|
||||||
value: 1,
|
value: 1,
|
||||||
isUpDown: false,
|
isUpDown: false,
|
||||||
slot: null
|
slot: null
|
||||||
}, {
|
}, {
|
||||||
label: '销量',
|
label: '销量',
|
||||||
value: 2,
|
value: 2,
|
||||||
isUpDown: false,
|
isUpDown: false,
|
||||||
slot: null
|
slot: null
|
||||||
}, {
|
}, {
|
||||||
label: '新品',
|
label: '新品',
|
||||||
value: 3,
|
value: 3,
|
||||||
isUpDown: false,
|
isUpDown: false,
|
||||||
slot: null
|
slot: null
|
||||||
}, {
|
}, {
|
||||||
label: '价格',
|
label: '价格',
|
||||||
value: 4,
|
value: 4,
|
||||||
isUpDown: true,
|
isUpDown: true,
|
||||||
slot: null
|
slot: null
|
||||||
}])
|
}])
|
||||||
// 顶部导航背景颜色
|
// 顶部导航背景颜色
|
||||||
const apexBgColor = ref('#ffffff00')
|
const apexBgColor = ref('#ffffff00')
|
||||||
// 店铺id
|
// 店铺id
|
||||||
const storeId = ref('')
|
const storeId = ref('')
|
||||||
// 详情
|
// 详情
|
||||||
const detail = reactive({})
|
const detail = reactive({})
|
||||||
// 参数
|
// 参数
|
||||||
const listPrototype = reactive({
|
const listPrototype = reactive({
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
// 商户主键
|
// 商户主键
|
||||||
merId: '',
|
merId: '',
|
||||||
data: [],
|
data: [],
|
||||||
})
|
|
||||||
|
|
||||||
// 用户信息
|
|
||||||
const userinfo = computed(() => uni.$store.state.userinfo || {})
|
|
||||||
onLoad((option) => {
|
|
||||||
if (option.storeId) storeId.value = option.storeId
|
|
||||||
getDetail()
|
|
||||||
listPrototype.merId = storeId.value
|
|
||||||
getList()
|
|
||||||
})
|
|
||||||
|
|
||||||
onPageScroll((ev) => {
|
|
||||||
apexBgColor.value = ev.scrollTop > 44 ? '#fff' : '#ffffff00'
|
|
||||||
})
|
|
||||||
|
|
||||||
// 获取店铺详情
|
|
||||||
function getDetail() {
|
|
||||||
api.shop.merchant({
|
|
||||||
query: {
|
|
||||||
merId: storeId.value,
|
|
||||||
userId: userinfo.value.id,
|
|
||||||
}
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
Object.assign(detail, {}, rs.data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
util.alert({
|
|
||||||
content: rs.msg,
|
|
||||||
showCancel: false
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
// 收藏店铺
|
|
||||||
function handleCollectStore() {
|
|
||||||
api.shop.followShop({
|
|
||||||
data: {
|
|
||||||
shopId: storeId.value,
|
|
||||||
status: {
|
|
||||||
0: 1,
|
|
||||||
1: 0,
|
|
||||||
}[detail.isFollow]
|
|
||||||
}
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
// 关注状态
|
|
||||||
detail.isFollow = {
|
|
||||||
0: 1,
|
|
||||||
1: 0,
|
|
||||||
}[detail.isFollow]
|
|
||||||
// 关注数量
|
|
||||||
detail.followNum = rs.data
|
|
||||||
|
|
||||||
getDetail()
|
// 用户信息
|
||||||
return
|
const userinfo = computed(() => uni.$store.state.userinfo || {})
|
||||||
}
|
onLoad((option) => {
|
||||||
util.alert({
|
if (option.storeId) storeId.value = option.storeId
|
||||||
content: rs.msg,
|
getDetail()
|
||||||
showCancel: false,
|
listPrototype.merId = storeId.value
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
onPageScroll((ev) => {
|
||||||
|
apexBgColor.value = ev.scrollTop > 44 ? '#fff' : '#ffffff00'
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取店铺详情
|
||||||
|
function getDetail() {
|
||||||
|
api.shop.merchant({
|
||||||
|
query: {
|
||||||
|
merId: storeId.value,
|
||||||
|
userId: userinfo.value.id,
|
||||||
|
}
|
||||||
|
}).then(rs => {
|
||||||
|
if (rs.code == 200) {
|
||||||
|
Object.assign(detail, {}, rs.data)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
util.alert({
|
||||||
|
content: rs.msg,
|
||||||
|
showCancel: false
|
||||||
|
});
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
// 收藏店铺
|
||||||
// 客服
|
function handleCollectStore() {
|
||||||
function toCustomer() {
|
api.shop.followShop({
|
||||||
uni.navigateTo({
|
data: {
|
||||||
url: util.setUrl('/pages/mine/setting/feedback')
|
shopId: storeId.value,
|
||||||
})
|
status: {
|
||||||
// api.shop.getCustomerService({ merchantId: storeId.value }).then(rs => {
|
0: 1,
|
||||||
// if (rs.code == 200) {
|
1: 0,
|
||||||
// let param = {};
|
} [detail.isFollow]
|
||||||
// param.type = 'C2C'
|
}
|
||||||
// param.name = `${detail.name}`
|
}).then(rs => {
|
||||||
// param.msgId = `${rs.data.serviceId}`
|
if (rs.code == 200) {
|
||||||
// param.isCustomer = true
|
// 关注状态
|
||||||
|
detail.isFollow = {
|
||||||
|
0: 1,
|
||||||
|
1: 0,
|
||||||
|
} [detail.isFollow]
|
||||||
|
// 关注数量
|
||||||
|
detail.followNum = rs.data
|
||||||
|
|
||||||
// util.toChat(param)
|
getDetail()
|
||||||
|
return
|
||||||
// uni.navigateTo({
|
}
|
||||||
// url: util.setUrl('/pages/news/chat/chat', param)
|
util.alert({
|
||||||
// })
|
content: rs.msg,
|
||||||
// } else {
|
showCancel: false,
|
||||||
// util.alert(rs.msg)
|
})
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
}
|
|
||||||
// 商品列表
|
|
||||||
function getList() {
|
|
||||||
|
|
||||||
api.shop.getProduct({
|
|
||||||
data: {
|
|
||||||
pageSize: listPrototype.pageSize,
|
|
||||||
pageNum: listPrototype.pageNum,
|
|
||||||
// 商户主键
|
|
||||||
merId: listPrototype.merId,
|
|
||||||
},
|
|
||||||
}).then(rs => {
|
|
||||||
if (rs.code == 200) {
|
|
||||||
if (listPrototype.pageNum == 1) listPrototype.data.length = []
|
|
||||||
listPrototype.data.push(...rs.rows)
|
|
||||||
listPrototype.total = rs.total
|
|
||||||
return
|
|
||||||
}
|
|
||||||
util.alert({
|
|
||||||
content: rs.msg,
|
|
||||||
showCancel: false,
|
|
||||||
})
|
})
|
||||||
}).finally(rs => {
|
}
|
||||||
uni.stopPullDownRefresh()
|
// 客服
|
||||||
})
|
function toCustomer() {
|
||||||
}
|
uni.navigateTo({
|
||||||
// 点击列表项
|
url: util.setUrl('/pages/mine/setting/feedback')
|
||||||
function handleItem(item) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: util.setUrl('/pages/shop/commodity/index', {
|
|
||||||
productId: item.id
|
|
||||||
})
|
})
|
||||||
|
// api.shop.getCustomerService({ merchantId: storeId.value }).then(rs => {
|
||||||
|
// if (rs.code == 200) {
|
||||||
|
// let param = {};
|
||||||
|
// param.type = 'C2C'
|
||||||
|
// param.name = `${detail.name}`
|
||||||
|
// param.msgId = `${rs.data.serviceId}`
|
||||||
|
// param.isCustomer = true
|
||||||
|
|
||||||
|
// util.toChat(param)
|
||||||
|
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: util.setUrl('/pages/news/chat/chat', param)
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// util.alert(rs.msg)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
}
|
||||||
|
// 商品列表
|
||||||
|
function getList() {
|
||||||
|
|
||||||
|
api.shop.getProduct({
|
||||||
|
data: {
|
||||||
|
pageSize: listPrototype.pageSize,
|
||||||
|
pageNum: listPrototype.pageNum,
|
||||||
|
// 商户主键
|
||||||
|
merId: listPrototype.merId,
|
||||||
|
},
|
||||||
|
}).then(rs => {
|
||||||
|
if (rs.code == 200) {
|
||||||
|
if (listPrototype.pageNum == 1) listPrototype.data.length = []
|
||||||
|
listPrototype.data.push(...rs.rows)
|
||||||
|
listPrototype.total = rs.total
|
||||||
|
return
|
||||||
|
}
|
||||||
|
util.alert({
|
||||||
|
content: rs.msg,
|
||||||
|
showCancel: false,
|
||||||
|
})
|
||||||
|
}).finally(rs => {
|
||||||
|
uni.stopPullDownRefresh()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 点击列表项
|
||||||
|
function handleItem(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: util.setUrl('/pages/shop/commodity/index', {
|
||||||
|
productId: item.id
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 重载列表
|
||||||
|
function refreshList() {
|
||||||
|
listPrototype.pageNum = 1
|
||||||
|
listPrototype.total = 0
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载更多列表
|
||||||
|
function getMoreList() {
|
||||||
|
if (listPrototype.total <= listPrototype.data.length) return
|
||||||
|
listPrototype.pageNum++
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
refreshList,
|
||||||
|
getMoreList,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
// 重载列表
|
|
||||||
function refreshList() {
|
|
||||||
listPrototype.pageNum = 1
|
|
||||||
listPrototype.total = 0
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 加载更多列表
|
|
||||||
function getMoreList() {
|
|
||||||
if (listPrototype.total <= listPrototype.data.length) return
|
|
||||||
listPrototype.pageNum++
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
refreshList,
|
|
||||||
getMoreList,
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -283,19 +283,19 @@ defineExpose({
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
// 卡片
|
// 卡片
|
||||||
.list {
|
.list {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
grid-gap: 20rpx;
|
grid-gap: 20rpx;
|
||||||
|
|
||||||
// 单个
|
// 单个
|
||||||
.item {
|
.item {
|
||||||
.poster {
|
.poster {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 340rpx;
|
height: 340rpx;
|
||||||
border-radius: 20rpx 20rpx 0 0;
|
border-radius: 20rpx 20rpx 0 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue