合并代码

This commit is contained in:
sx 2025-01-15 23:47:08 +08:00
parent 52674c2052
commit 98d307ebd7
15 changed files with 499 additions and 51 deletions

View File

@ -177,6 +177,19 @@ const mine = {
method: 'POST',
})
},
/**
* 支付
* @param {Object} param
*/
recharge(param) {
return util.request({
url: '/user/alipay/recharge',
query: param.query,
method: 'POST',
load: true,
})
},
}
export default mine

View File

@ -161,6 +161,7 @@ const shop = {
url: `/shopify/appAddress/deleteById`,
method: 'DELETE',
query: param.query,
load: true,
})
},
@ -173,9 +174,85 @@ const shop = {
url: `/shopify/webProduct/uploadProduct`,
method: 'POST',
data: param.data,
load: true,
})
},
/**
* 商品收藏
* @param {Object} param
*/
addProductCollect(param) {
return util.request({
url: `/shopify/collect/addProductCollect`,
method: 'POST',
query: param.query,
load: true,
})
},
/**
* 查看收藏记录
* @param {Object} param
*/
addProductCollect(param) {
return util.request({
url: `/shopify/collect`,
method: 'GET',
query: param.query,
load: true,
})
},
/**
* 取消 / 关注店铺
* @param {Object} param
*/
followShop(param) {
return util.request({
url: `/shopify/shopifyFollow/followShop`,
method: 'POST',
data: param.data,
load: true,
})
},
/**
* 获取商户详细信息
* @param {Object} param
*/
merchant(param) {
return util.request({
url: `/shopify/merchant`,
method: 'GET',
path: param.path,
load: true,
})
},
/**
* 根据用户id查询所有的浏览记录
* @param {Object} param
*/
getHistoryView(param) {
return util.request({
url: `/shopify/system`,
method: 'GET',
load: true,
})
},
/**
* 获取关注店铺列表
* @param {Object} param
*/
getFollowShopList(param) {
return util.request({
url: `/shopify/shopifyFollow/getFollowShopList`,
method: 'GET',
load: true,
})
},
}
export default shop

View File

@ -6,7 +6,8 @@ const config = {
// #endif
// #ifndef H5
// host: 'http://1641c8e0.r22.cpolar.top',
host: 'http://192.168.0.189:8080',
// host: 'http://192.168.0.189:8080',
host: 'http://192.168.0.102:8080',
// #endif
// 上传文件二级路径
uploadFilePath: "/homecommon/file/preview?fileName=",

View File

@ -1557,7 +1557,6 @@ const util = {
// 验证登录
util.isLogin(() => {
const userinfo = uni.$store.state.userinfo
console.log('userinfo.userIdCard', userinfo.userIdCard)
if (userinfo.userIdCard) {
param.success ? param.success(userinfo) : ''
return

View File

@ -105,7 +105,7 @@
<view class="item oh bfff br20" v-for="(item, index) in listPrototype.data" :key="index"
@click="handleItem(item)">
<!-- 需要展示的图 -->
<image class="poster" :src="item.flat_pattern" mode="aspectFill" />
<image class="poster" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />
<!-- 标题 -->
<view class="main plr20">

View File

@ -822,7 +822,7 @@
"current": 0,
"list": [{
"name": "test",
"path": "pages/index/index"
"path": "pages/index/wallet/wallet"
}]
},

View File

@ -8,10 +8,20 @@
} from 'vue';
import util from '@/common/js/util';
import api from '@/api/index.js';
import {
onLoad,
onReady,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app'
//
const form = reactive({
amount: '',
totalAmount: '',
})
onLoad(() => {
//
})
//
@ -25,29 +35,36 @@
})
}
//
//
function payment() {
const data = {
...form
}
if (!data.amount) {
if (!data.totalAmount) {
util.alert('金额不正确')
return
}
console.log('payment')
api.mine.pay({
query: data,
api.mine.recharge({
query: {
...data,
},
}).then(rs => {
if (rs.code === 200) {
console.log('recharge rs', rs)
if (rs.code == 200) {
uni.requestPayment({
provider: 'alipay',
orderInfo: rs.data,
success: rs => {
console.log('requestPayment', rs)
util.getUserinfo()
util.getPurse()
uni.navigateBack()
},
fail: err => {
console.log('fail err', err)
}
})
return
}
@ -69,7 +86,7 @@
<view class="value mt10">
<view class="rows">
<view class="c333 f40 b"></view>
<input type="text" v-model="form.amount" placeholder="输入金额" />
<input type="text" v-model="form.totalAmount" placeholder="输入金额" />
</view>
</view>
</view>

View File

@ -3,23 +3,28 @@
import {
ref,
reactive,
getCurrentInstance
getCurrentInstance,
computed,
defineEmits
} from 'vue'
//
import util from '@/common/js/util.js'
//
import api from '@/api/index.js'
import JyPopup from '@/components/public/jy-popup'
//
import JyCommodityAddress from '@/components/public/jy-commodity-address'
//
import {
useStore
} from 'vuex'
const {
proxy
} = getCurrentInstance()
const {
userinfo
} = useStore().state
//
const store = useStore()
//
const props = defineProps({
//
@ -30,6 +35,10 @@
})
//
const address = reactive({})
//
const userinfo = computed(() => store.state.userinfo)
//
const emit = defineEmits(['update'])
//
const spec = reactive([{
@ -61,7 +70,6 @@
])
//
const spaceIndex = reactive([])
//
const menuFn = {
//
@ -96,6 +104,35 @@
function handleSpec(index, secIndex) {
spaceIndex.splice(index, 1, secIndex)
}
//
function handleCollect() {
//
api.shop.addProductCollect({
query: {
productId: props.detail.id,
type: {
0: 1,
1: 0,
} [props.detail.isCollect]
},
}).then(res => {
if (res.code === 200) {
emit('update', {
...props.detail,
isCollect: {
0: 1,
1: 0,
} [props.detail.isCollect]
})
return
}
util.alert({
content: res.msg,
showCancel: false,
})
})
}
</script>
<template>
@ -105,18 +142,23 @@
<!-- 底部 -->
<view class="footer footerMneu rows plr20 shadow bfff">
<view class="menu df fdr aic">
<view class="option ver mlr10">
<view class="option ver">
<image class="wh30" src="/static/store.png" mode="widthFix" />
<view class="f24 c999 mt10">店铺</view>
</view>
<view class="option ver mlr10">
<view class="option ver " @click="handleCollect">
<view class="wh30 fmid">
<uni-icons type="star-filled" size="45rpx" color="#FF9B27" v-if="0" />
<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">收藏</view>
<view class="f24 c999 mt10">
<text v-if="detail.isCollect == 1"></text>
<text>收藏</text>
</view>
</view>
<view class="option ver mlr10">
<view class="option ver ">
<image class="wh30" src="/static/customer-service.png" mode="widthFix" />
<view class="f24 c999 mt10">客服</view>
</view>
@ -184,6 +226,15 @@
</template>
<style scoped lang="scss">
//
.menu {
//
.option {
width: 80rpx;
}
}
//
.spec {

View File

@ -10,6 +10,7 @@
onLoad,
onReady,
onPageScroll,
onUnload,
} from '@dcloudio/uni-app'
import {
useStore
@ -51,17 +52,38 @@
getDetail()
//
addBrowsing()
//
addListener()
})
onReady(() => {
//
})
//
onUnload(() => {
removeListener()
})
onPageScroll((ev) => {
if (ev.scrollTop > 44) proxy.$refs.apexRef.headerActive = true
else proxy.$refs.apexRef.headerActive = false
})
//
function addListener() {
//
uni.$on('commodityDetail', (data) => {
//
if (detail.id == data.id) getDetail()
})
}
//
function removeListener() {
uni.$off('commodityDetail')
}
//
function addBrowsing() {
//
@ -86,6 +108,7 @@
function getDetail() {
api.shop.productDetail({
query: {
userId: userinfo.value.id,
// id
productionId: id.value
}
@ -113,7 +136,92 @@
//
function handleCollectStore() {
//
api.shop.followShop({
data: {
shopId: detail.merId,
status: {
0: 1,
1: 0,
} [detail.isFollow]
}
}).then(rs => {
if (rs.code == 200) {
//
detail.isFollow = {
0: 1,
1: 0,
} [detail.isFollow]
//
detail.merFollowNumber = rs.data
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function handleCollect() {
util.isLogin().then(rs => {
//
api.shop.addProductCollect({
data: {
productId: id.value,
status: {
0: 1,
1: 0,
} [detail.isCollect]
}
}).then(rs => {
if (rs.code == 200) {
//
detail.isCollect = {
0: 1,
1: 0,
} [detail.isCollect]
//
detail.collectNumber = rs.data
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}).catch(() => {
//
uni.navigateTo({
url: '/pages/login/loginPhone'
})
})
}
//
function getShop() {
api.shop.shopDetail({
query: {
shopId: detail.merId
}
}).then(rs => {
if (rs.code == 200) {
Object.assign(detail, {}, rs.data)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 详情
* @param {Object} ev 修改的详情
*/
function handleDetail(ev) {
Object.assign(detail, {}, ev)
}
</script>
@ -126,7 +234,7 @@
<view class="banner pr" v-if="detail.sliderImage">
<swiper class="swiper" :current="bannerIndex" @change="($event) => bannerIndex = $event.detail.current">
<swiper-item v-for="(item, index) in banner" :key="index">
<image class="poster" :src="item" mode=" aspectFill" />
<image class="poster" :src="item" mode="aspectFill" />
</swiper-item>
</swiper>
@ -238,9 +346,7 @@
<view class="store df aic jcsb mtb20 ptb20 plr25 bfff">
<view class="header rows">
<!-- 店铺头像 -->
<image class="wh140 br20"
src="https://img30.360buyimg.com/popWareDetail/jfs/t1/124291/22/31317/138753/6449f30dF90683c84/4fee5d1a337f7b90.jpg.avif"
mode="aspectFill" />
<image class="wh140 br20" :src="detail.merAvatar" mode="aspectFill" />
<!-- 店铺信息 名称 评分 关注数量 -->
<view class="info f1 mlr20">
<!-- 店铺名称 -->
@ -255,7 +361,7 @@
</view> -->
<!-- 关注数量 -->
<view class="item follow c666 f24">
<text>123关注</text>
<text>{{detail.merFollowNumber}}关注</text>
</view>
</view>
</view>
@ -263,7 +369,7 @@
<!-- 关注按钮 -->
<view @click="handleCollectStore" class="btn sm warm plr30">
<uni-icons class="mr10" color="#fff" type="plusempty" size="13" v-if="1" />
<uni-icons class="mr10" color="#fff" type="plusempty" size="13" v-if="detail.isFollow != 1" />
<text class="cfff" v-else></text>
<text class="cfff">关注</text>
</view>
@ -286,7 +392,7 @@
</view>
<!-- 底部 -->
<JyCommodityFoot />
<JyCommodityFoot :detail="detail" @update="handleDetail" />
</view>
</template>
@ -300,11 +406,11 @@
.banner {
.swiper {
height: 750rpx;
height: 800rpx;
.poster {
width: 750rpx;
height: 750rpx;
height: 800rpx;
}
}

View File

@ -1,18 +1,79 @@
<script setup>
//
import {
ref,
reactive,
getCurrentInstance
} from 'vue'
import {
onReachBottom,
onPullDownRefresh,
onShow,
onLoad,
onReady,
} from '@dcloudio/uni-app';
//
import util from '@/common/js/util.js'
//
import api from '@/api/index.js'
//
const list = reactive([])
onLoad(() => {
getList()
})
//
function getList() {
api.shop.getFollowShopList({}).then(rs => {
if (rs.code == 200) {
list.length = 0
list.push(...rs.data)
return
}
util.alert({
content: rs.msg,
showCancel: false
})
})
}
/**
* 关注切换
* @param {Object} item
*/
function handleFocus(item) {
api.shop.followShop({
data: {
shopId: item.id,
status: item.isFollow || 0,
}
}).then(rs => {
if (rs.code == 200) {
if (!item.isFollow) item.isFollow = 1
else if (item.isFollow == 1) item.isFollow = 0
return
}
util.alert({
content: rs.msg,
showCancel: false
})
})
}
</script>
<template>
<view class="app">
<view class="list mtb20 plr20 bfff">
<!-- 店铺 -->
<view class="item line df aic ptb25 thd f1 f32" v-for="(item,index) in 15" :key="index">
<image class="wh90 br10"
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif"
mode="aspectFill" />
<view class="name mlr20 c333 f1">家纺专营店</view>
<view class="item line df aic ptb25 thd f1 f32" v-for="(item,index) in list" :key="index">
<image class="wh90 br10" :src="item.rectangleLogo" mode="aspectFill" />
<view class="name mlr20 c333 f1">{{item.name}}</view>
<view class="btn sm warmHollow plr20">取消关注</view>
<view @click="handleFocus(item,index)">
<view class="btn sm warm w150" v-if="item.isFollow == 1">关注</view>
<view class="btn sm warmHollow w150" v-else>取消关注</view>
</view>
</view>
</view>

View File

@ -1,28 +1,118 @@
<script setup>
//
import {
ref,
reactive,
getCurrentInstance
} from 'vue'
import {
onReachBottom,
onPullDownRefresh,
onShow,
onLoad,
onReady,
} from '@dcloudio/uni-app';
//
import util from '@/common/js/util.js'
//
import api from '@/api/index.js'
//
const list = reactive([])
onLoad(() => {
//
historyView()
})
//
function historyView() {
api.shop.getHistoryView().then(res => {
if (res.code == 200) {
//
let todayStr = getDate()
//
let yesterdayStr = getDate(-1)
//
let arr = []
//
res.data.forEach(item => {
let date = item.browsingHistoryTime.split(' ')[0];
if (date == todayStr) date = '今天'
else if (date == yesterdayStr) date = '昨天'
let findResult = arr.find(r => r.date === date);
//
if (findResult) findResult.list.push(item);
else arr.push({
date: date,
list: [item]
})
});
//
list.push(...arr)
return
}
util.alert({
content: res.msg,
showCancel: false
})
})
}
//
function getDate(offset = 0) {
// Date
let today = new Date();
// 使 setDate getDate() offset -1 0 1
today.setDate(today.getDate() + offset);
//
let year = today.getFullYear();
// getMonth() 0 1
let month = today.getMonth() + 1;
//
let day = today.getDate();
// 10 0
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
//
return `${year}-${month}-${day}`;
}
/**
* 跳转详情
* @param {Object} secItem
*/
function handleItem(secItem) {
uni.navigateTo({
url: util.setUrl('/pages/shop/commodity/index', {
productId: secItem.id
})
})
}
</script>
<template>
<view class="app">
<view class="list">
<view class="item mtb20 bfff" v-for="(item,index) in 3" :key="index">
<view class="date ptb20 plr20 c333 f28">今天</view>
<view class="item mtb20 bfff" v-for="(item,index) in list" :key="index">
<view class="date ptb20 plr20 c333 f28">{{item.date}}</view>
<view class="product line df ptb20 plr20" v-for="(secItem,secIndex) in item.list" :key="index"
@click="handleItem(secItem)">
<view class="product line df ptb20 plr20" v-for="(secItem,secIndex) in 2" :key="index">
<view class="poster wh160">
<image class="wh160 br10"
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif"
mode="aspectFill" />
<image class="wh160 br10" :src="secItem.sliderImage.split(',')[0]" mode="aspectFill" />
</view>
<view class="info df fdc jcsb f1 ml20">
<view class="name c333 f28">靠枕 纯棉靠枕 车载居家 纯棉100% 卡通靠枕 人体工学</view>
<view class="name t2hd c333 f28">{{secItem.name}}</view>
<view class="other rows">
<view class="col c333">
<text class="f20"></text>
<text class="f30">89</text>
<text class="count ml20 fs0 c999 f24">销量0</text>
<text class="f30">{{secItem.price}}</text>
<text class="count ml20 fs0 c999 f24">销量{{secItem.sales}}</text>
</view>
<view class="btn ti warmHollow plr20">去购买</view>
</view>
@ -30,6 +120,8 @@
</view>
</view>
</view>
<view class="fill" style="height: 30rpx;"></view>
</view>
</template>

View File

@ -104,7 +104,7 @@
<template>
<view class="appbw">
<!-- 轮播图 -->
<swiper class="banner oh mtb30 mlr30 br20" autoplay="true">
<swiper class="banner oh mtb30 mlr30 br20" autoplay="true" v-if="0">
<swiper-item v-for="(item, index) in 3" :key="index">
<view class="item">
<image class="poster"

View File

@ -36,10 +36,32 @@
}])
//
const apexBgColor = ref('#ffffff00')
// id
const id = ref('0')
onLoad((option) => {
if (option.id) id.value = option.id
})
onPageScroll((ev) => {
apexBgColor.value = ev.scrollTop > 44 ? '#fff' : '#ffffff00'
})
//
function getDetail() {
//
api.shop.merchant({
path: [id.value],
}).then(rs => {
if (rs.code == 200) {
return
}
util.alert({
content: rs.msg,
showCancel: false
});
})
}
</script>
<template>

View File

@ -365,4 +365,13 @@ likeType
生成订单到平台客服 平台客服去跟进订单
1 充值
2 提现
3 商家入驻 并且发布商品
4 视频上传 挂商品
5 推流 榴莲果置换流量
6 商品分享到im
7 商家和用户进行交流

View File

@ -10,8 +10,8 @@ export default defineConfig({
port: 5173,
proxy: {
"/system": {
target: "http://192.168.0.189:8080",
// target: "http://192.168.0.102:8080",
target: "http://192.168.0.102:8080",
// target: "http://192.168.0.189:8080",
// target: "http://192.168.0.129:8080",
changeOrigin: true,
},