完善商品分类及商品管理

This commit is contained in:
2025-05-03 17:48:41 +08:00
parent 9c7e8b59c2
commit 889f2b8fca
115 changed files with 1418 additions and 272 deletions

View File

@ -1,14 +1,20 @@
<template>
<view class="content">
<view class="store u-flex u-row-between u-p-32">
<view>
<view class="lg bold-600 u-flex" @click="chooseStore">
MEET轻食店
<u-icon name="arrow-right" size="28" class="right-icon"></u-icon>
<view class="flex1 u-line-1">
<view class="lg bold-400 u-flex">
<navigator class="u-flex" url="/pages/store/choose_store" hover-class="none">
MEET轻食店
<u-icon name="arrow-right" size="28" class="right-icon"></u-icon>
</navigator>
</view>
<view class="u-flex u-m-t-8" @click="chooseAddress">
<u-icon name="map" size="32"></u-icon>
请选择收货地址
<view class="u-m-t-8 u-line-1">
<navigator class="u-flex " url="/bundle/pages/address/address?type=1" hover-class="none">
<u-icon name="map" size="32"></u-icon>
<view class="u-line-1">
{{userAddress || '请选择收货地址'}}
</view>
</navigator>
</view>
</view>
<view>
@ -20,47 +26,57 @@
<view class="swiper u-relative">
<u-swiper height="524" :list="list" border-radius="0"></u-swiper>
<view class="balance bg-white u-flex">
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_balance.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{userInfo.user_money || 0.00}}</view>
<view class="text-default xs">余额</view>
</view>
<view>
<navigator class="u-flex u-row-center" url="/pages/my/wallet" hover-class="none">
<u-image :src="cloudPath + 'img/icon_balance.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{userInfo.user_money || 0.00}}</view>
<view class="text-default xs">余额</view>
</view>
</navigator>
</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_points.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.user_integral || 0}}</view>
<view class="text-default xs">积分</view>
</view>
<view>
<navigator class="u-flex u-row-center" url="/bundle/pages/points/points" hover-class="none">
<u-image :src="cloudPath + 'img/icon_points.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.user_integral || 0}}</view>
<view class="text-default xs">积分</view>
</view>
</navigator>
</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_coupon.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.coupon || 0}}</view>
<view class="text-default xs u-text-center"></view>
</view>
<view>
<navigator class="u-flex u-row-center" url="/bundle/pages/coupon/coupon" hover-class="none">
<u-image :src="cloudPath + 'img/icon_coupon.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.coupon || 0}}</view>
<view class="text-default xs u-text-center"></view>
</view>
</navigator>
</view>
</view>
</view>
<!-- 下单 -->
<view class="order u-flex u-row-between">
<view class="bg-white u-text-center" @click="buy">
<view class="text-default xxl">预约下单</view>
<view class="xs text-999">极速送达更便捷</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_p_order.png'" width="132" height="132"></u-image>
</view>
<view class="bg-white u-text-center">
<navigator url="/pages/store/store?type=1" hover-class="none">
<view class="text-default xxl">预约下单</view>
<view class="xs text-999">极速送达更便捷</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_p_order.png'" width="132" height="132"></u-image>
</view>
</navigator>
</view>
<view class="bg-white u-text-center">
<view class="text-default xxl">现在点单</view>
<view class="xs text-999">下单更便捷</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_order.png'" width="132" height="133" mode="aspectFit"></u-image>
</view>
<navigator url="/pages/store/store?type=2" hover-class="none">
<view class="text-default xxl">现在点单</view>
<view class="xs text-999">下单更便捷</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_order.png'" width="132" height="133" mode="aspectFit"></u-image>
</view>
</navigator>
</view>
</view>
@ -74,6 +90,7 @@
<script>
import { mapGetters, mapActions } from 'vuex'
import { getConfig } from '@/api/app'
import { getUser, getDefaultAddress, getOneAddress } from '@/api/user'
import { getMenu } from '@/api/store'
import { setTabbar } from '@/utils/tools'
export default {
@ -85,31 +102,59 @@
title: "昨夜星辰昨夜风,画楼西畔桂堂东",
},
],
userAddress: '',
addressId: 0
}
},
onLoad() {
setTabbar()
this.getUserAddress()
//更改收货地址
uni.$on('selectaddress', (params) => {
this.addressId = params.id
this.updateUserAddress()
})
},
onShow() {
this.getUser()
this.getCartNum()
},
onUnload() {
// 取消全局监听
uni.$off(['selectaddress'])
},
methods: {
// 选择门店
chooseStore() {
uni.navigateTo({
url: '/pages/store/choose_store'
...mapActions(['getCartNum', 'getUser']),
// 获取默认物流地址
getUserAddress() {
getDefaultAddress().then(res => {
if (res.code == 1) {
const {id, province, city, district, address} = res.data
this.userAddress = `${province} ${city} ${district} ${address}`
this.addressId = id
}
})
},
// 选择收货地址
chooseAddress() {
uni.navigateTo({
url: '/pages/store/choose_store'
// 用户切换物流地址
updateUserAddress() {
getOneAddress(this.addressId).then(res => {
if (res.code == 1) {
const {id, province, city, district, address} = res.data
this.userAddress = `${province} ${city} ${district} ${address}`
this.addressId = id
}
})
},
// 立即下单
buy() {
console.log(this.$buyType)
this.$buyType = 1
uni.navigateTo({
url: '/pages/store/store'
})

View File

@ -18,6 +18,8 @@
<view>
<u-button @click="mobileLogin" hover-class="none" :customStyle="{color: themeColor, border: '1px solid ' + themeColor, padding: '16rpx 0'}" :plain="true" :hair-line="false" shape="circle">手机号登录/注册</u-button>
</view>
<u-button @click="testLogin" hover-class="none" :customStyle="{backgroundColor: themeColor, color: '#fff', border: 'none', padding: '16rpx 0'}" :hair-line="false" shape="circle">测试账号一键登录</u-button>
</view>
<view class="u-m-t-32 u-flex u-row-center">
@ -49,6 +51,7 @@
import { mapMutations, mapActions, mapGetters } from 'vuex'
import { uploadFile } from "@/utils/tools";
import {
accountLogin,
authLogin,
updateUser,
mobileLogin
@ -171,6 +174,18 @@
})
//#endif
},
// 测试账号一键登录
async testLogin() {
const { code, data } = await accountLogin({
account: '15005837859',
password: 'wang199765',
client
})
if (code == 1) {
this.loginHandle(data)
}
}
},
computed: {
...mapGetters(['appConfig']),

View File

@ -37,32 +37,42 @@
<view class="block px32">
<view class="bg-white u-m-t-34 balance row-between br16 u-p-l-22 u-p-r-22 box-shadown">
<view class="u-flex u-row-center" @click="toWallet">
<u-image :src="cloudPath + 'img/icon_balance.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{userInfo.user_money || 0.00}}</view>
<view class="xs">余额</view>
</view>
<view>
<navigator class="u-flex u-row-center" url="/pages/my/wallet" hover-class="none">
<u-image :src="cloudPath + 'img/icon_balance.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{userInfo.user_money || 0.00}}</view>
<view class="text-default xs">余额</view>
</view>
</navigator>
</view>
<view>
<u-line class="u-line" direction="col" length="47"></u-line>
</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_points.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.user_integral || 0}}</view>
<view class="xs">积分</view>
</view>
<view>
<navigator class="u-flex u-row-center" url="/bundle/pages/points/points" hover-class="none">
<u-image :src="cloudPath + 'img/icon_points.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.user_integral || 0}}</view>
<view class="text-default xs">积分</view>
</view>
</navigator>
</view>
<view>
<u-line class="u-line" direction="col" length="47"></u-line>
</view>
<view class="u-flex u-row-center">
<u-image :src="cloudPath + 'img/icon_coupon.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.coupon || 0}}</view>
<view class="xs u-text-center">券</view>
</view>
<view>
<navigator class="u-flex u-row-center" url="/bundle/pages/coupon/coupon" hover-class="none">
<u-image :src="cloudPath + 'img/icon_coupon.png'" width="52" height="52"></u-image>
<view class="u-m-l-60 u-text-center">
<view class="nr">{{ userInfo.coupon || 0}}</view>
<view class="text-default xs u-text-center">券</view>
</view>
</navigator>
</view>
</view>

View File

@ -8,13 +8,13 @@
<view>
<view class="store u-flex u-row-between u-p-32">
<view>
<view class="lg bold-600 u-flex" @click="chooseStore">
<view class="lg bold-400 u-flex" @click="chooseStore">
MEET轻食店
<u-icon name="arrow-right" size="28" class="right-icon"></u-icon>
<u-icon name="arrow-right" size="28" class="right-icon u-m-l-4"></u-icon>
</view>
<view class="u-flex u-m-t-8" @click="chooseAddress">
<u-icon name="map" size="32"></u-icon>
请选择收货地址
门店地址
</view>
</view>
<view>
@ -56,11 +56,5 @@
.store {
background-color: #FFFAFB;
height: 108rpx;
.right-icon {
font-weight: bold;
margin-left: 4rpx;
}
}
</style>