合并代码
This commit is contained in:
parent
52674c2052
commit
98d307ebd7
|
@ -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
|
|
@ -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
|
|
@ -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=",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -822,7 +822,7 @@
|
|||
"current": 0,
|
||||
"list": [{
|
||||
"name": "test",
|
||||
"path": "pages/index/index"
|
||||
"path": "pages/index/wallet/wallet"
|
||||
}]
|
||||
},
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -365,4 +365,13 @@ likeType
|
|||
生成订单到平台客服 平台客服去跟进订单
|
||||
|
||||
|
||||
1 充值
|
||||
2 提现
|
||||
3 商家入驻 并且发布商品
|
||||
4 视频上传 挂商品
|
||||
5 推流 榴莲果置换流量
|
||||
6 商品分享到im
|
||||
7 商家和用户进行交流
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue