| @ -1,297 +1,353 @@ | |||||
| <template> | <template> | ||||
| <view class="page"> | <view class="page"> | ||||
| <navbar/> | |||||
| <navbar></navbar> | |||||
| <text class="control-text" @click="isManaged = !isManaged">{{ isManaged ? '退出管理' : '管理' }}</text> | |||||
| <view class="user"> | |||||
| <uv-checkbox-group | |||||
| shape="circle" | |||||
| v-model="checkboxValue"> | |||||
| <uv-swipe-action> | |||||
| <view | |||||
| v-for="(item, index) in list" | |||||
| :key="item.id"> | |||||
| <view style="margin-top: 20rpx;"></view> | |||||
| <uv-swipe-action-item | |||||
| @click="e => deleteCart(e, item)" | |||||
| :options="options"> | |||||
| <view class="item"> | |||||
| <view class="checkbox"> | |||||
| <uv-checkbox | |||||
| :name="item.id" | |||||
| activeColor="#eb3300" | |||||
| size="40rpx" | |||||
| icon-size="35rpx" | |||||
| ></uv-checkbox> | |||||
| </view> | |||||
| <image | |||||
| class="image" | |||||
| :src="item.image && | |||||
| item.image.split(',')[0]" | |||||
| mode=""></image> | |||||
| <view class="info"> | |||||
| <view class="title"> | |||||
| <view class=""> | |||||
| {{ item.title }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="unit"> | |||||
| 规格:{{ item.sku }} | |||||
| <!-- <uv-icon name="arrow-down"></uv-icon> --> | |||||
| <view class="cart-items"> | |||||
| <uv-checkbox-group shape="circle" v-model="checkboxValue" @change="toggleSelect"> | |||||
| <view v-for="(item, index) in cartData.items" :key="item.id" class="cart-item"> | |||||
| <view class="checkbox"> | |||||
| <uv-checkbox :key="index" :name="item.id" size="40rpx" iconSize="35rpx" activeColor="#019245" /> | |||||
| </view> | |||||
| <view class="item-content"> | |||||
| <image class="food-image" :src="item.image" mode="aspectFill" /> | |||||
| <view class="food-info"> | |||||
| <text class="food-name">{{ item.name }}</text> | |||||
| <view class="food-sold"> | |||||
| <uv-icon name="checkmark-circle" color="#ccc" size="24rpx"></uv-icon> | |||||
| <text>已售出 {{ item.sold }}单</text> | |||||
| </view> | |||||
| <view class="food-price-row"> | |||||
| <text class="food-price"> | |||||
| <text style="font-size: 22rpx; margin-right: 6rpx;">¥</text> | |||||
| {{ item.price.toFixed(1) }} | |||||
| </text> | |||||
| <view class="number-box"> | |||||
| <view class="number-btn minus" @tap="decreaseQuantity(item)"> | |||||
| <text>-</text> | |||||
| </view> | </view> | ||||
| <view | |||||
| style="display: flex; | |||||
| justify-content: space-between; | |||||
| align-items: center;"> | |||||
| <view class="price"> | |||||
| ¥<text>{{ item.price }}</text>元 | |||||
| </view> | |||||
| <view class=""> | |||||
| <uv-number-box v-model="item.num" | |||||
| @change="e => valChange(item, e)"></uv-number-box> | |||||
| </view> | |||||
| <text class="number-value">{{ item.quantity }}</text> | |||||
| <view class="number-btn plus" @tap="increaseQuantity(item)"> | |||||
| <text>+</text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </uv-swipe-action-item> | |||||
| </view> | |||||
| </uv-swipe-action> | |||||
| </uv-checkbox-group> | |||||
| <uv-empty | |||||
| v-if="list.length == 0" | |||||
| text="空空如也" | |||||
| textSize="30rpx" | |||||
| iconSize="200rpx" | |||||
| icon="list"></uv-empty> | |||||
| <view class="action"> | |||||
| <view class="icon"> | |||||
| <image src="/static/image/cart/1.png" mode=""></image> | |||||
| <view class="num"> | |||||
| {{ checkboxValue.length }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="price"> | |||||
| <view class="count"> | |||||
| 合计 | |||||
| <view class=""> | |||||
| ¥<text>{{ totalPrice }}</text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="text"> | |||||
| 共{{ checkboxValue.length }}件,已享受更低优惠 | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class="btn" | |||||
| @click="submit"> | |||||
| 去结算 | |||||
| </uv-checkbox-group> | |||||
| <uv-empty mode="car" style="padding-top: 300rpx;" v-if="!cartData.items.length" | |||||
| text="购物车空空如也~" /> | |||||
| </view> | |||||
| <view class="cart-footer"> | |||||
| <view class="select-all"> | |||||
| <uv-checkbox-group v-model="allCheckbox"> | |||||
| <uv-checkbox size="40rpx" iconSize="35rpx" activeColor="#019245" shape="circle" name="all" | |||||
| @change="toggleSelectAll" /> | |||||
| </uv-checkbox-group> | |||||
| <text>全选</text> | |||||
| </view> | |||||
| <view class="cart-total"> | |||||
| <text v-if="!isManaged" style="font-size: 24rpx; color: #999;">已选{{ cartData.selectedCount }}个,</text> | |||||
| <text v-if="!isManaged">合计</text> | |||||
| <text v-if="!isManaged" class="total-price">¥{{ (cartData.totalPrice).toFixed(1) }}</text> | |||||
| <view v-if="isManaged" class="checkout-btn checkbox-collect" @tap="addCollect"> | |||||
| <text>添加收藏</text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view v-if="!isManaged" class="checkout-btn checkbox-primary" @tap="checkout"> | |||||
| <text>去下单</text> | |||||
| </view> | |||||
| <view v-if="isManaged" class="checkout-btn checkbox-primary" @tap="deleteCart"> | |||||
| <text>删除</text> | |||||
| </view> | |||||
| </view> | </view> | ||||
| <tabber select="cart" /> | <tabber select="cart" /> | ||||
| </view> | </view> | ||||
| </template> | </template> | ||||
| <script> | <script> | ||||
| import tabber from '@/components/base/tabbar.vue' | |||||
| import mixinsList from '@/mixins/list.js' | |||||
| export default { | |||||
| mixins : [mixinsList], | |||||
| components: { | |||||
| tabber, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| value : 0, | |||||
| checkboxValue : [], | |||||
| options: [ | |||||
| { | |||||
| text: '删除', | |||||
| style: { | |||||
| backgroundColor: '#f40' | |||||
| } | |||||
| }, | |||||
| ], | |||||
| mixinsListApi : 'getCartPageList', | |||||
| import tabber from '@/components/base/tabbar.vue' | |||||
| import { mockCartData } from '@/static/js/mockCartData.js' | |||||
| import navbar from '@/components/base/navbar.vue' | |||||
| export default { | |||||
| components: { | |||||
| tabber, | |||||
| navbar | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| cartData: mockCartData, | |||||
| checkboxValue: [], | |||||
| isManaged: false | |||||
| } | |||||
| }, | |||||
| computed: { | |||||
| allSelected() { | |||||
| return this.cartData.items.every(item => this.checkboxValue.includes(item.id)) | |||||
| }, | |||||
| // 全选的值 | |||||
| allCheckbox(){ | |||||
| return this.allSelected ? ['all'] : [] | |||||
| } | |||||
| }, | |||||
| methods: { | |||||
| toggleSelect(item) { | |||||
| this.updateCart(); | |||||
| }, | |||||
| toggleSelectAll() { | |||||
| if (this.allSelected){ | |||||
| this.checkboxValue = [] | |||||
| }else{ | |||||
| this.checkboxValue = this.cartData.items.map(item => item.id) | |||||
| } | } | ||||
| }, | |||||
| computed: { | |||||
| totalPrice(){ | |||||
| if (!this.checkboxValue.length) { | |||||
| return 0 | |||||
| this.updateCart(); | |||||
| }, | |||||
| increaseQuantity(item) { | |||||
| item.quantity += 1; | |||||
| this.updateCart(); | |||||
| }, | |||||
| decreaseQuantity(item) { | |||||
| if (item.quantity > 1) { | |||||
| item.quantity -= 1; | |||||
| this.updateCart(); | |||||
| } | |||||
| }, | |||||
| updateCart() { | |||||
| // 计算选中的商品数量 | |||||
| this.cartData.selectedCount = this.checkboxValue.length; | |||||
| // 计算总价 | |||||
| this.cartData.totalPrice = this.cartData.items.reduce((total, item) => { | |||||
| if (this.checkboxValue.includes(item.id)){ | |||||
| total += item.price * item.quantity | |||||
| } | } | ||||
| let price = 0 | |||||
| this.list.forEach(n => { | |||||
| if(this.checkboxValue.includes(n.id)){ | |||||
| price += n.price * n.num | |||||
| } | |||||
| return total | |||||
| }, 0) | |||||
| }, | |||||
| // 结账 | |||||
| checkout() { | |||||
| // const selectedItems = this.cartData.items.filter(item => item.selected); | |||||
| if (this.checkboxValue.length === 0) { | |||||
| uni.showToast({ | |||||
| title: '请选择商品', | |||||
| icon: 'none' | |||||
| }); | |||||
| return; | |||||
| } | |||||
| // 跳转到创建订单页面 | |||||
| uni.navigateTo({ | |||||
| url: '/pages_order/order/newOrderDetail?status=pending' | |||||
| }); | |||||
| }, | |||||
| // 添加收藏 | |||||
| addCollect(){ | |||||
| if (!this.checkboxValue.length) { | |||||
| uni.showToast({ | |||||
| title: '请选择商品', | |||||
| icon: 'none' | |||||
| }); | |||||
| return; | |||||
| } | |||||
| uni.showLoading({ | |||||
| title: '添加收藏中...' | |||||
| }) | |||||
| setTimeout(() => { | |||||
| uni.hideLoading() | |||||
| uni.showToast({ | |||||
| title: '添加收藏成功', | |||||
| }) | }) | ||||
| return price | |||||
| }, | |||||
| // 编写收藏函数的调用 | |||||
| }, 800) | |||||
| }, | }, | ||||
| methods: { | |||||
| valChange(item, e) { | |||||
| this.$api('updateCartNum', { | |||||
| id: item.id, | |||||
| num: e.value, | |||||
| }) | |||||
| }, | |||||
| // 立即下单 | |||||
| submit(){ | |||||
| if(this.checkboxValue.length == 0){ | |||||
| uni.showToast({ | |||||
| title: '请选择商品', | |||||
| icon: 'none', | |||||
| }) | |||||
| return | |||||
| } | |||||
| let arr = [] | |||||
| this.list.forEach(n => { | |||||
| if(this.checkboxValue.includes(n.id)){ | |||||
| arr.push(n) | |||||
| } | |||||
| }) | |||||
| this.$store.commit('setPayOrderProduct', arr) | |||||
| // 删除购物车 | |||||
| deleteCart(){ | |||||
| if (!this.checkboxValue.length) { | |||||
| uni.showToast({ | |||||
| title: '请选择商品', | |||||
| icon: 'none' | |||||
| }); | |||||
| this.$utils.navigateTo('/pages_order/order/createOrder') | |||||
| }, | |||||
| deleteCart(e, item){ | |||||
| this.$api('deleteCart', { | |||||
| ids : item.id | |||||
| }, res => { | |||||
| this.getData() | |||||
| return; | |||||
| } | |||||
| uni.showLoading({ | |||||
| title: '删除中...' | |||||
| }) | |||||
| setTimeout(() => { | |||||
| uni.hideLoading() | |||||
| uni.showToast({ | |||||
| title: '删除成功', | |||||
| }) | }) | ||||
| }, | |||||
| this.cartData.items = this.cartData.items.filter(item => !this.checkboxValue.includes(item.id)) | |||||
| this.checkboxValue = [] | |||||
| this.updateCart() | |||||
| // 编写删除函数的调用 | |||||
| }, 800) | |||||
| } | } | ||||
| } | |||||
| } | |||||
| } | |||||
| </script> | </script> | ||||
| <style scoped lang="scss"> | |||||
| .page { | |||||
| padding-bottom: 200rpx; | |||||
| /deep/ .uv-swipe-action{ | |||||
| <style lang="scss" scoped> | |||||
| .page { | |||||
| // background-color: #f5f5f5; | |||||
| padding-bottom: 120rpx; | |||||
| position: relative; | |||||
| .cart-items { | |||||
| .cart-item { | |||||
| width: 100%; | width: 100%; | ||||
| } | |||||
| } | |||||
| .user { | |||||
| .item{ | |||||
| background-color: #fff; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| background-color: #fff; | |||||
| padding: 20rpx; | |||||
| margin-bottom: 20rpx; | |||||
| border-radius: 10rpx; | |||||
| .checkbox { | |||||
| margin-right: 20rpx; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| } | |||||
| .item-content { | |||||
| flex: 1; | |||||
| display: flex; | |||||
| .food-image { | |||||
| width: 150rpx; | |||||
| height: 150rpx; | |||||
| margin-right: 20rpx; | |||||
| } | |||||
| .food-info { | |||||
| flex: 1; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| justify-content: space-around; | |||||
| .food-name { | |||||
| font-size: 28rpx; | |||||
| margin-bottom: 10rpx; | |||||
| font-weight: 500; | |||||
| } | |||||
| .food-sold { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| font-size: 24rpx; | |||||
| color: $uni-color-third; | |||||
| margin-bottom: 10rpx; | |||||
| } | |||||
| .food-price-row { | |||||
| display: flex; | |||||
| justify-content: space-between; | |||||
| align-items: center; | |||||
| .food-price { | |||||
| color: #ff0000; | |||||
| font-size: 32rpx; | |||||
| } | |||||
| .number-box { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| border-radius: 28rpx; | |||||
| margin-right: 20rpx; | |||||
| contain: content; | |||||
| border: 2rpx solid $uni-color-third; | |||||
| .number-btn { | |||||
| width: 50rpx; | |||||
| height: 50rpx; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| } | |||||
| .number-value { | |||||
| width: 50rpx; | |||||
| height: 50rpx; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| font-size: 28rpx; | |||||
| border-left: 2rpx solid $uni-color-third; | |||||
| border-right: 2rpx solid $uni-color-third; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| .cart-footer { | |||||
| position: fixed; | |||||
| bottom: 120rpx; | |||||
| left: 0; | |||||
| width: 100%; | |||||
| height: 100rpx; | |||||
| background-color: #fff; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| padding: 0 20rpx; | |||||
| box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05); | |||||
| box-sizing: border-box; | |||||
| .select-all { | |||||
| display: flex; | display: flex; | ||||
| padding: 30rpx; | |||||
| .checkbox{ | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| } | |||||
| .image{ | |||||
| width: 200rpx; | |||||
| height: 200rpx; | |||||
| border-radius: 20rpx; | |||||
| align-items: center; | |||||
| font-size: 28rpx; | |||||
| text { | |||||
| margin-left: 10rpx; | |||||
| } | } | ||||
| .info{ | |||||
| flex: 1; | |||||
| .title{ | |||||
| display: flex; | |||||
| padding: 10rpx 20rpx; | |||||
| justify-content: space-between; | |||||
| } | |||||
| .unit{ | |||||
| font-size: 24rpx; | |||||
| padding: 10rpx 20rpx; | |||||
| color: #717171; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| } | |||||
| .price{ | |||||
| color: $uni-color; | |||||
| font-size: 28rpx; | |||||
| padding: 10rpx 20rpx; | |||||
| text{ | |||||
| font-size: 36rpx; | |||||
| font-weight: 900; | |||||
| } | |||||
| } | |||||
| } | |||||
| .cart-total { | |||||
| flex: 1; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: flex-end; | |||||
| font-size: 28rpx; | |||||
| margin-right: 20rpx; | |||||
| // background-color: red; | |||||
| .total-price { | |||||
| color: #ff0000; | |||||
| font-size: 32rpx; | |||||
| font-weight: bold; | |||||
| margin-left: 10rpx; | |||||
| } | } | ||||
| } | } | ||||
| .action{ | |||||
| width: 700rpx; | |||||
| position: fixed; | |||||
| bottom: 220rpx; | |||||
| left: 25rpx; | |||||
| background-color: #fff; | |||||
| height: 100rpx; | |||||
| border-radius: 50rpx; | |||||
| box-shadow: 0 0 6rpx 6rpx #00000010; | |||||
| .checkout-btn { | |||||
| width: 200rpx; | |||||
| height: 60rpx; | |||||
| display: flex; | display: flex; | ||||
| justify-content: center; | justify-content: center; | ||||
| align-items: center; | align-items: center; | ||||
| overflow: hidden; | |||||
| z-index: 999; | |||||
| .icon{ | |||||
| position: relative; | |||||
| width: 80rpx; | |||||
| height: 80rpx; | |||||
| margin: 0 20rpx; | |||||
| image{ | |||||
| width: 80rpx; | |||||
| height: 80rpx; | |||||
| } | |||||
| .num{ | |||||
| position: absolute; | |||||
| right: 10rpx; | |||||
| top: 0rpx; | |||||
| background-color: $uni-color; | |||||
| color: #fff; | |||||
| font-size: 18rpx; | |||||
| border-radius: 50%; | |||||
| height: 30rpx; | |||||
| width: 30rpx; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| } | |||||
| } | |||||
| .price{ | |||||
| .count{ | |||||
| display: flex; | |||||
| font-size: 26rpx; | |||||
| align-items: center; | |||||
| view{ | |||||
| color: $uni-color; | |||||
| margin-left: 10rpx; | |||||
| text{ | |||||
| font-size: 32rpx; | |||||
| font-weight: 900; | |||||
| } | |||||
| } | |||||
| } | |||||
| .text{ | |||||
| font-size: 20rpx; | |||||
| color: #717171; | |||||
| } | |||||
| } | |||||
| .btn{ | |||||
| margin-left: auto; | |||||
| background-color: $uni-color; | |||||
| height: 100%; | |||||
| padding: 0 50rpx; | |||||
| color: #fff; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| } | |||||
| border-radius: 35rpx; | |||||
| font-size: 28rpx; | |||||
| } | |||||
| .checkbox-primary{ | |||||
| background-color: #019245; | |||||
| color: #fff; | |||||
| } | } | ||||
| .checkbox-collect{ | |||||
| color: $uni-color; | |||||
| background-color: $uni-color-fourth; | |||||
| } | |||||
| } | |||||
| .control-text{ | |||||
| position: absolute; | |||||
| right: 150rpx; | |||||
| top: 60rpx; | |||||
| font-size: 26rpx; | |||||
| color: #fff; | |||||
| z-index: 10000; | |||||
| } | } | ||||
| </style> | |||||
| } | |||||
| </style> | |||||
| @ -1,587 +0,0 @@ | |||||
| <template> | |||||
| <view class="page"> | |||||
| <!-- 导航栏 --> | |||||
| <navbar title="个人中心" | |||||
| leftClick | |||||
| @leftClick="$utils.navigateBack" | |||||
| bgColor="#E3441A" color="#fff" /> | |||||
| <!-- 头部 --> | |||||
| <view class="head"> | |||||
| <view class="headImage"> | |||||
| <image :src="userInfo.headImage" mode="aspectFill"></image> | |||||
| </view> | |||||
| <view class="user-info"> | |||||
| <view class="user-base-info"> | |||||
| <view class="user-base-top"> | |||||
| <view class="user-name">{{ userInfo.nickName}}</view> | |||||
| <view class="member-level"> | |||||
| <image v-if="userInfo.role == 1" :src="configList.vip_user" mode="aspectFill" class="level"> | |||||
| </image> | |||||
| <image v-if="userInfo.role == 2" src="@/static/image/center/gold-min.png" mode="aspectFill" | |||||
| class="level"> | |||||
| </image> | |||||
| <image v-if="userInfo.role == 3" src="@/static/image/center/sliver-min.png" | |||||
| mode="aspectFill" class="level"> | |||||
| </image> | |||||
| </view> | |||||
| <view class="user-tag"> | |||||
| {{ userRole[userInfo.isPay] }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="edit-user" | |||||
| @click="$utils.navigateTo('/pages_order/mine/updateUser?back=true')"> | |||||
| <image src="@/static/image/center/edit-icon.png" mode="aspectFill" class="edit-icon"></image> | |||||
| <view class="edit-btn"> | |||||
| 修改资料 | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="user-phone"> | |||||
| 手机号:{{ userInfo.phone }} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 会员卡片 --> | |||||
| <view @click="$utils.navigateTo({url : '/pages_order/mine/memberCenter' })" | |||||
| v-if="userInfo.role != 0" | |||||
| class="earnings"> | |||||
| <view v-if="index + 1 == userInfo.role" v-for="(item,index) in vipList" :key="item.id" class="member-item"> | |||||
| <image :src="item.headImage" mode="aspectFill" class="member-image"></image> | |||||
| <view class="member-info"> | |||||
| <view class="profile-photo"> | |||||
| <image :src="userInfo.headImage" mode="aspectFill" class="pro-img"></image> | |||||
| <view class="open-status"> | |||||
| 开通时间:{{ riceInfo.openTime }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="open"> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 佣金数据 --> | |||||
| <view @click="$utils.navigateTo('/pages_order/mine/withdraw')" class="brokerage-data" | |||||
| :class="{'brokerage-data-mt' : !userInfo.role}"> | |||||
| <view class="brokerage"> | |||||
| <image :src="configList.money_image" mode="aspectFill" class="brokerage-img"></image> | |||||
| <div class="main"> | |||||
| <div class="title">我的佣金</div> | |||||
| <div class="money">¥{{ riceInfo.canWithdraw || 0 }}</div> | |||||
| </div> | |||||
| </view> | |||||
| <view class="balance"> | |||||
| <image :src="configList.price_image" mode="aspectFill" class="balance-img"></image> | |||||
| <div class="main"> | |||||
| <div class="title">我的余额</div> | |||||
| <div class="money">¥{{ riceInfo.balance || 0 }}</div> | |||||
| </div> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 我的服务 --> | |||||
| <view class="myServer"> | |||||
| <view class="server-title"> | |||||
| 我的服务 | |||||
| </view> | |||||
| <view class="box"> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages/index/order?type=0')"> | |||||
| <image src="@/static/image/center/1.png" mode="aspectFill" /> | |||||
| <view class="title">我的订单</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/partner')"> | |||||
| <image src="@/static/image/center/2.png" mode="aspectFill" /> | |||||
| <view class="title">我的团队</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/home/contact')"> | |||||
| <image src="@/static/image/center/3.png" mode="aspectFill" /> | |||||
| <view class="title">联系客服</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/promotion')"> | |||||
| <image src="@/static/image/center/4.png" mode="aspectFill" /> | |||||
| <view class="title">邀请好友</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="box"> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/recruit')"> | |||||
| <image src="@/static/image/center/5.png" mode="aspectFill" /> | |||||
| <view class="title">合伙人招募</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/memberCenter')"> | |||||
| <image src="@/static/image/center/6.png" mode="aspectFill" /> | |||||
| <view class="title">会员权益</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/coupon')"> | |||||
| <image src="@/static/image/center/7.png" mode="aspectFill" /> | |||||
| <view class="title">优惠券</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/help')"> | |||||
| <image src="@/static/image/center/8.png" mode="aspectFill" /> | |||||
| <view class="title">帮助与反馈</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="box"> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/address')"> | |||||
| <image src="@/static/image/center/address.png" mode="aspectFill" /> | |||||
| <view class="title">我的地址</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/order/giftList')"> | |||||
| <image src="@/static/image/center/9.png" mode="aspectFill" /> | |||||
| <view class="title">礼包列表</view> | |||||
| </view> | |||||
| <view class="boxs" @click="logout"> | |||||
| <image src="@/static/image/center/logout.png" mode="aspectFill" /> | |||||
| <view class="title">退出登录</view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 广告 --> | |||||
| <div v-if="showAdvertising" class="ad" | |||||
| @click="$utils.navigateTo('/pages_order/mine/recruit')"> | |||||
| <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="true" :interval="2000" | |||||
| :duration="duration"> | |||||
| <swiper-item v-for="(item, index) in adList" :key="index"> | |||||
| <view class="swiper-main"> | |||||
| <view @click="closeAdvertising" class="close"> | |||||
| <image src="@/static/image/center/close.png" mode="aspectFill" class="close-img"></image> | |||||
| </view> | |||||
| <image :src="item" mode="aspectFill" class="swiper-main-img"></image> | |||||
| <div class="ad-tag"> | |||||
| <image src="@/static/image/center/ad-tag.png" mode="aspectFill" class="ad-tag-img"></image> | |||||
| </div> | |||||
| </view> | |||||
| </swiper-item> | |||||
| </swiper> | |||||
| </div> | |||||
| <customerServicePopup ref="customerServicePopup" /> | |||||
| <tabber select="center" /> | |||||
| </view> | |||||
| </template> | |||||
| <script> | |||||
| import tabber from '@/components/base/tabbar.vue' | |||||
| import { | |||||
| mapState | |||||
| } from 'vuex' | |||||
| import customerServicePopup from '@/components/config/customerServicePopup.vue' | |||||
| export default { | |||||
| components: { | |||||
| tabber, | |||||
| customerServicePopup, | |||||
| }, | |||||
| computed: { | |||||
| ...mapState(['riceInfo']), | |||||
| adList() { | |||||
| let arr = []; | |||||
| if (this.configList?.shop_get_image) { | |||||
| arr = this.configList?.shop_get_image?.split(',') | |||||
| } | |||||
| return arr | |||||
| } | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| vipType: ['普通会员', '黄金会员', '渠道商'], | |||||
| vipImage: ['vip_vip', 'vip_user', 'vip_shop'], | |||||
| vipList: [], | |||||
| showAdvertising: true, | |||||
| userRole: ['会员', '用户', '渠道'], | |||||
| indicatorDots: true, | |||||
| duration: 500 | |||||
| } | |||||
| }, | |||||
| onShow() { | |||||
| this.$store.commit('getUserInfo') | |||||
| this.$store.commit('getRiceInfo') | |||||
| this.getMemberCardData(); | |||||
| }, | |||||
| methods: { | |||||
| clickNo() { | |||||
| uni.showModal({ | |||||
| title: '暂未开放', | |||||
| }) | |||||
| }, | |||||
| logout(){ | |||||
| uni.showModal({ | |||||
| title: '确认退出登录吗', | |||||
| success : (r) => { | |||||
| if (r.confirm) { | |||||
| this.$store.commit('logout', true) | |||||
| } | |||||
| } | |||||
| }) | |||||
| }, | |||||
| //关闭广告 | |||||
| closeAdvertising() { | |||||
| this.showAdvertising = false; | |||||
| }, | |||||
| //获取会员卡片数据 | |||||
| getMemberCardData() { | |||||
| this.$api('getRiceVipList', res => { | |||||
| if (res.code == 200) { | |||||
| this.vipList = res.result | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| </script> | |||||
| <style scoped lang="scss"> | |||||
| .page { | |||||
| // 头部 | |||||
| .head { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| padding: 60rpx 20rpx 120rpx 20rpx; | |||||
| background: $uni-color; | |||||
| .headImage { | |||||
| width: 130rpx; | |||||
| height: 130rpx; | |||||
| background-image: url(/static/image/center/head-img.png); | |||||
| background-repeat: no-repeat; | |||||
| background-position: 50%, 50%; | |||||
| background-size: 100%; | |||||
| overflow: hidden; | |||||
| border-radius: 50%; | |||||
| margin-right: 20rpx; | |||||
| image { | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| } | |||||
| } | |||||
| .user-info { | |||||
| width: calc(100% - 130rpx); | |||||
| .user-base-info { | |||||
| display: flex; | |||||
| flex-wrap: wrap; | |||||
| justify-content: space-between; | |||||
| .user-base-top { | |||||
| width: 65%; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| flex-wrap: wrap; | |||||
| color: white; | |||||
| .user-name { | |||||
| max-width: calc(100% - 240rpx); | |||||
| white-space: nowrap; | |||||
| text-overflow: ellipsis; | |||||
| overflow: hidden; | |||||
| font-size: 34rpx; | |||||
| } | |||||
| .member-level { | |||||
| margin-left: 10rpx; | |||||
| .level { | |||||
| width: 120rpx; | |||||
| height: 60rpx; | |||||
| } | |||||
| } | |||||
| .user-tag { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| background: #000; | |||||
| width: 100rpx; | |||||
| height: 40rpx; | |||||
| border-radius: 20rpx; | |||||
| font-size: 24rpx; | |||||
| margin-left: 10rpx; | |||||
| } | |||||
| } | |||||
| .edit-user { | |||||
| width: 35%; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: flex-end; | |||||
| .edit-icon { | |||||
| width: 30rpx; | |||||
| height: 30rpx; | |||||
| } | |||||
| .edit-btn { | |||||
| color: white; | |||||
| margin-left: 10rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| .user-phone { | |||||
| color: white; | |||||
| font-size: 24rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| // 会员卡片 | |||||
| .earnings { | |||||
| padding: 0rpx 20rpx; | |||||
| box-sizing: border-box; | |||||
| margin-top: -18%; | |||||
| .member-item { | |||||
| position: relative; | |||||
| .member-image { | |||||
| width: 100%; | |||||
| height: 300rpx; | |||||
| border-radius: 20rpx; | |||||
| } | |||||
| .member-info { | |||||
| position: absolute; | |||||
| bottom: 30rpx; | |||||
| left: 0rpx; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| padding: 0rpx 40rpx; | |||||
| box-sizing: border-box; | |||||
| width: 100%; | |||||
| .profile-photo { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| .pro-img { | |||||
| width: 60rpx; | |||||
| height: 60rpx; | |||||
| border-radius: 50%; | |||||
| } | |||||
| .open-status { | |||||
| color: #F8A95F; | |||||
| border: 1px solid #F8A95F; | |||||
| border-radius: 30rpx; | |||||
| padding: 7rpx 20rpx; | |||||
| margin-left: 10rpx; | |||||
| } | |||||
| } | |||||
| .open { | |||||
| font-size: 26rpx; | |||||
| margin-left: 20rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| // 佣金数据 | |||||
| .brokerage-data { | |||||
| padding: 20rpx; | |||||
| background: white; | |||||
| border-radius: 20rpx; | |||||
| display: flex; | |||||
| flex-wrap: wrap; | |||||
| box-sizing: border-box; | |||||
| margin: 20rpx 20rpx 20rpx 20rpx; | |||||
| .brokerage, | |||||
| .balance { | |||||
| display: flex; | |||||
| flex-wrap: wrap; | |||||
| width: 50%; | |||||
| .brokerage-img, | |||||
| .balance-img { | |||||
| width: 50%; | |||||
| height: auto; | |||||
| } | |||||
| .main { | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| justify-content: space-around; | |||||
| width: 50%; | |||||
| box-sizing: border-box; | |||||
| padding: 30rpx 0rpx; | |||||
| .title { | |||||
| font-size: 34rpx; | |||||
| } | |||||
| .money { | |||||
| font-size: 40rpx; | |||||
| color: $uni-color; | |||||
| font-weight: bold; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| .brokerage-data-mt { | |||||
| margin-top: 50rpx; | |||||
| } | |||||
| // 我的服务 | |||||
| .myServer { | |||||
| margin: 0rpx 20rpx 20rpx 20rpx; | |||||
| background: white; | |||||
| border-radius: 20rpx; | |||||
| padding: 30rpx 20rpx; | |||||
| box-sizing: border-box; | |||||
| box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05); | |||||
| .server-title { | |||||
| margin-bottom: 30rpx; | |||||
| font-size: 36rpx; | |||||
| font-weight: 600; | |||||
| color: #333; | |||||
| position: relative; | |||||
| padding-left: 20rpx; | |||||
| &::before { | |||||
| content: ''; | |||||
| position: absolute; | |||||
| left: 0; | |||||
| top: 50%; | |||||
| transform: translateY(-50%); | |||||
| width: 8rpx; | |||||
| height: 32rpx; | |||||
| background: $uni-color; | |||||
| border-radius: 4rpx; | |||||
| } | |||||
| } | |||||
| .box { | |||||
| display: flex; | |||||
| width: 100%; | |||||
| margin-bottom: 30rpx; | |||||
| gap: 20rpx; | |||||
| .boxs { | |||||
| width: 23%; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| padding: 20rpx 0; | |||||
| border-radius: 16rpx; | |||||
| transition: all 0.3s ease; | |||||
| position: relative; | |||||
| overflow: hidden; | |||||
| &::after { | |||||
| content: ''; | |||||
| position: absolute; | |||||
| top: 0; | |||||
| left: 0; | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| background: rgba(227, 68, 26, 0.05); | |||||
| opacity: 0; | |||||
| transition: opacity 0.3s ease; | |||||
| z-index: 1; | |||||
| } | |||||
| &:active { | |||||
| transform: scale(0.95); | |||||
| &::after { | |||||
| opacity: 1; | |||||
| } | |||||
| } | |||||
| image { | |||||
| width: 70rpx; | |||||
| height: 70rpx; | |||||
| display: block; | |||||
| margin: 0rpx auto 16rpx auto; | |||||
| position: relative; | |||||
| z-index: 2; | |||||
| transition: transform 0.3s ease; | |||||
| } | |||||
| .title { | |||||
| font-size: 26rpx; | |||||
| color: #333; | |||||
| position: relative; | |||||
| z-index: 2; | |||||
| transition: color 0.3s ease; | |||||
| } | |||||
| &:active { | |||||
| image { | |||||
| transform: translateY(-4rpx); | |||||
| } | |||||
| .title { | |||||
| color: $uni-color; | |||||
| } | |||||
| } | |||||
| } | |||||
| &:last-child { | |||||
| margin-bottom: 0rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| // 广告 | |||||
| .ad { | |||||
| margin: 0rpx 20rpx; | |||||
| .swiper { | |||||
| .swiper-main { | |||||
| position: relative; | |||||
| .close { | |||||
| position: absolute; | |||||
| top: 20rpx; | |||||
| right: 20rpx; | |||||
| .close-img { | |||||
| width: 40rpx; | |||||
| height: 40rpx; | |||||
| } | |||||
| } | |||||
| .swiper-main-img { | |||||
| width: 100%; | |||||
| height: 200rpx; | |||||
| border-radius: 20rpx; | |||||
| } | |||||
| .ad-tag { | |||||
| position: absolute; | |||||
| left: 20rpx; | |||||
| bottom: 20rpx; | |||||
| .ad-tag-img { | |||||
| width: 120rpx; | |||||
| height: auto; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,294 @@ | |||||
| <template> | |||||
| <view class="page"> | |||||
| <navbar /> | |||||
| <view class="user"> | |||||
| <uv-checkbox-group shape="circle" v-model="checkboxValue"> | |||||
| <uv-swipe-action> | |||||
| <view v-for="(item, index) in list" :key="item.id"> | |||||
| <view style="margin-top: 20rpx;"></view> | |||||
| <uv-swipe-action-item @click="e => deleteCart(e, item)" :options="options"> | |||||
| <view class="item"> | |||||
| <view class="checkbox"> | |||||
| <uv-checkbox :name="item.id" activeColor="#eb3300" size="40rpx" | |||||
| icon-size="35rpx"></uv-checkbox> | |||||
| </view> | |||||
| <image class="image" :src="item.image && | |||||
| item.image.split(',')[0]" mode=""></image> | |||||
| <view class="info"> | |||||
| <view class="title"> | |||||
| <view class=""> | |||||
| {{ item.title }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="unit"> | |||||
| 规格:{{ item.sku }} | |||||
| <!-- <uv-icon name="arrow-down"></uv-icon> --> | |||||
| </view> | |||||
| <view style="display: flex; | |||||
| justify-content: space-between; | |||||
| align-items: center;"> | |||||
| <view class="price"> | |||||
| ¥<text>{{ item.price }}</text>元 | |||||
| </view> | |||||
| <view class=""> | |||||
| <uv-number-box v-model="item.num" | |||||
| @change="e => valChange(item, e)"></uv-number-box> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </uv-swipe-action-item> | |||||
| </view> | |||||
| </uv-swipe-action> | |||||
| </uv-checkbox-group> | |||||
| <uv-empty v-if="list.length == 0" text="空空如也" textSize="30rpx" iconSize="200rpx" icon="list"></uv-empty> | |||||
| <view class="action"> | |||||
| <view class="icon"> | |||||
| <image src="/static/image/cart/1.png" mode=""></image> | |||||
| <view class="num"> | |||||
| {{ checkboxValue.length }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="price"> | |||||
| <view class="count"> | |||||
| 合计 | |||||
| <view class=""> | |||||
| ¥<text>{{ totalPrice }}</text> | |||||
| </view> | |||||
| </view> | |||||
| <view class="text"> | |||||
| 共{{ checkboxValue.length }}件,已享受更低优惠 | |||||
| </view> | |||||
| </view> | |||||
| <view class="btn" @click="submit"> | |||||
| 去结算 | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <tabber select="cart" /> | |||||
| </view> | |||||
| </template> | |||||
| <script> | |||||
| import tabber from '@/components/base/tabbar.vue' | |||||
| import mixinsList from '@/mixins/list.js' | |||||
| export default { | |||||
| mixins: [mixinsList], | |||||
| components: { | |||||
| tabber, | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| value: 0, | |||||
| checkboxValue: [], | |||||
| options: [ | |||||
| { | |||||
| text: '删除', | |||||
| style: { | |||||
| backgroundColor: '#f40' | |||||
| } | |||||
| }, | |||||
| ], | |||||
| mixinsListApi: 'getCartPageList', | |||||
| } | |||||
| }, | |||||
| computed: { | |||||
| totalPrice() { | |||||
| if (!this.checkboxValue.length) { | |||||
| return 0 | |||||
| } | |||||
| let price = 0 | |||||
| this.list.forEach(n => { | |||||
| if (this.checkboxValue.includes(n.id)) { | |||||
| price += n.price * n.num | |||||
| } | |||||
| }) | |||||
| return price | |||||
| }, | |||||
| }, | |||||
| methods: { | |||||
| valChange(item, e) { | |||||
| this.$api('updateCartNum', { | |||||
| id: item.id, | |||||
| num: e.value, | |||||
| }) | |||||
| }, | |||||
| // 立即下单 | |||||
| submit() { | |||||
| if (this.checkboxValue.length == 0) { | |||||
| uni.showToast({ | |||||
| title: '请选择商品', | |||||
| icon: 'none', | |||||
| }) | |||||
| return | |||||
| } | |||||
| let arr = [] | |||||
| this.list.forEach(n => { | |||||
| if (this.checkboxValue.includes(n.id)) { | |||||
| arr.push(n) | |||||
| } | |||||
| }) | |||||
| this.$store.commit('setPayOrderProduct', arr) | |||||
| this.$utils.navigateTo('/pages_order/order/createOrder') | |||||
| }, | |||||
| deleteCart(e, item) { | |||||
| this.$api('deleteCart', { | |||||
| ids: item.id | |||||
| }, res => { | |||||
| this.getData() | |||||
| }) | |||||
| }, | |||||
| } | |||||
| } | |||||
| </script> | |||||
| <style scoped lang="scss"> | |||||
| .page { | |||||
| padding-bottom: 200rpx; | |||||
| /deep/ .uv-swipe-action { | |||||
| width: 100%; | |||||
| } | |||||
| } | |||||
| .user { | |||||
| .item { | |||||
| background-color: #fff; | |||||
| display: flex; | |||||
| padding: 30rpx; | |||||
| .checkbox { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| } | |||||
| .image { | |||||
| width: 200rpx; | |||||
| height: 200rpx; | |||||
| border-radius: 20rpx; | |||||
| } | |||||
| .info { | |||||
| flex: 1; | |||||
| .title { | |||||
| display: flex; | |||||
| padding: 10rpx 20rpx; | |||||
| justify-content: space-between; | |||||
| } | |||||
| .unit { | |||||
| font-size: 24rpx; | |||||
| padding: 10rpx 20rpx; | |||||
| color: #717171; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| } | |||||
| .price { | |||||
| color: $uni-color; | |||||
| font-size: 28rpx; | |||||
| padding: 10rpx 20rpx; | |||||
| text { | |||||
| font-size: 36rpx; | |||||
| font-weight: 900; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| .action { | |||||
| width: 700rpx; | |||||
| position: fixed; | |||||
| bottom: 220rpx; | |||||
| left: 25rpx; | |||||
| background-color: #fff; | |||||
| height: 100rpx; | |||||
| border-radius: 50rpx; | |||||
| box-shadow: 0 0 6rpx 6rpx #00000010; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| overflow: hidden; | |||||
| z-index: 999; | |||||
| .icon { | |||||
| position: relative; | |||||
| width: 80rpx; | |||||
| height: 80rpx; | |||||
| margin: 0 20rpx; | |||||
| image { | |||||
| width: 80rpx; | |||||
| height: 80rpx; | |||||
| } | |||||
| .num { | |||||
| position: absolute; | |||||
| right: 10rpx; | |||||
| top: 0rpx; | |||||
| background-color: $uni-color; | |||||
| color: #fff; | |||||
| font-size: 18rpx; | |||||
| border-radius: 50%; | |||||
| height: 30rpx; | |||||
| width: 30rpx; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| } | |||||
| } | |||||
| .price { | |||||
| .count { | |||||
| display: flex; | |||||
| font-size: 26rpx; | |||||
| align-items: center; | |||||
| view { | |||||
| color: $uni-color; | |||||
| margin-left: 10rpx; | |||||
| text { | |||||
| font-size: 32rpx; | |||||
| font-weight: 900; | |||||
| } | |||||
| } | |||||
| } | |||||
| .text { | |||||
| font-size: 20rpx; | |||||
| color: #717171; | |||||
| } | |||||
| } | |||||
| .btn { | |||||
| margin-left: auto; | |||||
| background-color: $uni-color; | |||||
| height: 100%; | |||||
| padding: 0 50rpx; | |||||
| color: #fff; | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| } | |||||
| } | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,582 @@ | |||||
| <template> | |||||
| <view class="page"> | |||||
| <!-- 导航栏 --> | |||||
| <navbar title="个人中心" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" /> | |||||
| <!-- 头部 --> | |||||
| <view class="head"> | |||||
| <view class="headImage"> | |||||
| <image :src="userInfo.headImage" mode="aspectFill"></image> | |||||
| </view> | |||||
| <view class="user-info"> | |||||
| <view class="user-base-info"> | |||||
| <view class="user-base-top"> | |||||
| <view class="user-name">{{ userInfo.nickName }}</view> | |||||
| <view class="member-level"> | |||||
| <image v-if="userInfo.role == 1" :src="configList.vip_user" mode="aspectFill" class="level"> | |||||
| </image> | |||||
| <image v-if="userInfo.role == 2" src="@/static/image/center/gold-min.png" mode="aspectFill" | |||||
| class="level"> | |||||
| </image> | |||||
| <image v-if="userInfo.role == 3" src="@/static/image/center/sliver-min.png" | |||||
| mode="aspectFill" class="level"> | |||||
| </image> | |||||
| </view> | |||||
| <view class="user-tag"> | |||||
| {{ userRole[userInfo.isPay] }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="edit-user" @click="$utils.navigateTo('/pages_order/mine/updateUser?back=true')"> | |||||
| <image src="@/static/image/center/edit-icon.png" mode="aspectFill" class="edit-icon"></image> | |||||
| <view class="edit-btn"> | |||||
| 修改资料 | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="user-phone"> | |||||
| 手机号:{{ userInfo.phone }} | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 会员卡片 --> | |||||
| <view @click="$utils.navigateTo({ url: '/pages_order/mine/memberCenter' })" v-if="userInfo.role != 0" | |||||
| class="earnings"> | |||||
| <view v-if="index + 1 == userInfo.role" v-for="(item, index) in vipList" :key="item.id" class="member-item"> | |||||
| <image :src="item.headImage" mode="aspectFill" class="member-image"></image> | |||||
| <view class="member-info"> | |||||
| <view class="profile-photo"> | |||||
| <image :src="userInfo.headImage" mode="aspectFill" class="pro-img"></image> | |||||
| <view class="open-status"> | |||||
| 开通时间:{{ riceInfo.openTime }} | |||||
| </view> | |||||
| </view> | |||||
| <view class="open"> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 佣金数据 --> | |||||
| <view @click="$utils.navigateTo('/pages_order/mine/withdraw')" class="brokerage-data" | |||||
| :class="{ 'brokerage-data-mt': !userInfo.role }"> | |||||
| <view class="brokerage"> | |||||
| <image :src="configList.money_image" mode="aspectFill" class="brokerage-img"></image> | |||||
| <div class="main"> | |||||
| <div class="title">我的佣金</div> | |||||
| <div class="money">¥{{ riceInfo.canWithdraw || 0 }}</div> | |||||
| </div> | |||||
| </view> | |||||
| <view class="balance"> | |||||
| <image :src="configList.price_image" mode="aspectFill" class="balance-img"></image> | |||||
| <div class="main"> | |||||
| <div class="title">我的余额</div> | |||||
| <div class="money">¥{{ riceInfo.balance || 0 }}</div> | |||||
| </div> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 我的服务 --> | |||||
| <view class="myServer"> | |||||
| <view class="server-title"> | |||||
| 我的服务 | |||||
| </view> | |||||
| <view class="box"> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages/index/order?type=0')"> | |||||
| <image src="@/static/image/center/1.png" mode="aspectFill" /> | |||||
| <view class="title">我的订单</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/partner')"> | |||||
| <image src="@/static/image/center/2.png" mode="aspectFill" /> | |||||
| <view class="title">我的团队</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/home/contact')"> | |||||
| <image src="@/static/image/center/3.png" mode="aspectFill" /> | |||||
| <view class="title">联系客服</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/promotion')"> | |||||
| <image src="@/static/image/center/4.png" mode="aspectFill" /> | |||||
| <view class="title">邀请好友</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="box"> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/recruit')"> | |||||
| <image src="@/static/image/center/5.png" mode="aspectFill" /> | |||||
| <view class="title">合伙人招募</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/memberCenter')"> | |||||
| <image src="@/static/image/center/6.png" mode="aspectFill" /> | |||||
| <view class="title">会员权益</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/coupon')"> | |||||
| <image src="@/static/image/center/7.png" mode="aspectFill" /> | |||||
| <view class="title">优惠券</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/help')"> | |||||
| <image src="@/static/image/center/8.png" mode="aspectFill" /> | |||||
| <view class="title">帮助与反馈</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="box"> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/mine/address')"> | |||||
| <image src="@/static/image/center/address.png" mode="aspectFill" /> | |||||
| <view class="title">我的地址</view> | |||||
| </view> | |||||
| <view class="boxs" @click="$utils.navigateTo('/pages_order/order/giftList')"> | |||||
| <image src="@/static/image/center/9.png" mode="aspectFill" /> | |||||
| <view class="title">礼包列表</view> | |||||
| </view> | |||||
| <view class="boxs" @click="logout"> | |||||
| <image src="@/static/image/center/logout.png" mode="aspectFill" /> | |||||
| <view class="title">退出登录</view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <!-- 广告 --> | |||||
| <div v-if="showAdvertising" class="ad" @click="$utils.navigateTo('/pages_order/mine/recruit')"> | |||||
| <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="true" :interval="2000" | |||||
| :duration="duration"> | |||||
| <swiper-item v-for="(item, index) in adList" :key="index"> | |||||
| <view class="swiper-main"> | |||||
| <view @click="closeAdvertising" class="close"> | |||||
| <image src="@/static/image/center/close.png" mode="aspectFill" class="close-img"></image> | |||||
| </view> | |||||
| <image :src="item" mode="aspectFill" class="swiper-main-img"></image> | |||||
| <div class="ad-tag"> | |||||
| <image src="@/static/image/center/ad-tag.png" mode="aspectFill" class="ad-tag-img"></image> | |||||
| </div> | |||||
| </view> | |||||
| </swiper-item> | |||||
| </swiper> | |||||
| </div> | |||||
| <customerServicePopup ref="customerServicePopup" /> | |||||
| <tabber select="center" /> | |||||
| </view> | |||||
| </template> | |||||
| <script> | |||||
| import tabber from '@/components/base/tabbar.vue' | |||||
| import { | |||||
| mapState | |||||
| } from 'vuex' | |||||
| import customerServicePopup from '@/components/config/customerServicePopup.vue' | |||||
| export default { | |||||
| components: { | |||||
| tabber, | |||||
| customerServicePopup, | |||||
| }, | |||||
| computed: { | |||||
| ...mapState(['riceInfo']), | |||||
| adList() { | |||||
| let arr = []; | |||||
| if (this.configList?.shop_get_image) { | |||||
| arr = this.configList?.shop_get_image?.split(',') | |||||
| } | |||||
| return arr | |||||
| } | |||||
| }, | |||||
| data() { | |||||
| return { | |||||
| vipType: ['普通会员', '黄金会员', '渠道商'], | |||||
| vipImage: ['vip_vip', 'vip_user', 'vip_shop'], | |||||
| vipList: [], | |||||
| showAdvertising: true, | |||||
| userRole: ['会员', '用户', '渠道'], | |||||
| indicatorDots: true, | |||||
| duration: 500 | |||||
| } | |||||
| }, | |||||
| onShow() { | |||||
| this.$store.commit('getUserInfo') | |||||
| this.$store.commit('getRiceInfo') | |||||
| this.getMemberCardData(); | |||||
| }, | |||||
| methods: { | |||||
| clickNo() { | |||||
| uni.showModal({ | |||||
| title: '暂未开放', | |||||
| }) | |||||
| }, | |||||
| logout() { | |||||
| uni.showModal({ | |||||
| title: '确认退出登录吗', | |||||
| success: (r) => { | |||||
| if (r.confirm) { | |||||
| this.$store.commit('logout', true) | |||||
| } | |||||
| } | |||||
| }) | |||||
| }, | |||||
| //关闭广告 | |||||
| closeAdvertising() { | |||||
| this.showAdvertising = false; | |||||
| }, | |||||
| //获取会员卡片数据 | |||||
| getMemberCardData() { | |||||
| this.$api('getRiceVipList', res => { | |||||
| if (res.code == 200) { | |||||
| this.vipList = res.result | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | |||||
| </script> | |||||
| <style scoped lang="scss"> | |||||
| .page { | |||||
| // 头部 | |||||
| .head { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| padding: 60rpx 20rpx 120rpx 20rpx; | |||||
| background: $uni-color; | |||||
| .headImage { | |||||
| width: 130rpx; | |||||
| height: 130rpx; | |||||
| background-image: url(/static/image/center/head-img.png); | |||||
| background-repeat: no-repeat; | |||||
| background-position: 50%, 50%; | |||||
| background-size: 100%; | |||||
| overflow: hidden; | |||||
| border-radius: 50%; | |||||
| margin-right: 20rpx; | |||||
| image { | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| } | |||||
| } | |||||
| .user-info { | |||||
| width: calc(100% - 130rpx); | |||||
| .user-base-info { | |||||
| display: flex; | |||||
| flex-wrap: wrap; | |||||
| justify-content: space-between; | |||||
| .user-base-top { | |||||
| width: 65%; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| flex-wrap: wrap; | |||||
| color: white; | |||||
| .user-name { | |||||
| max-width: calc(100% - 240rpx); | |||||
| white-space: nowrap; | |||||
| text-overflow: ellipsis; | |||||
| overflow: hidden; | |||||
| font-size: 34rpx; | |||||
| } | |||||
| .member-level { | |||||
| margin-left: 10rpx; | |||||
| .level { | |||||
| width: 120rpx; | |||||
| height: 60rpx; | |||||
| } | |||||
| } | |||||
| .user-tag { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| background: #000; | |||||
| width: 100rpx; | |||||
| height: 40rpx; | |||||
| border-radius: 20rpx; | |||||
| font-size: 24rpx; | |||||
| margin-left: 10rpx; | |||||
| } | |||||
| } | |||||
| .edit-user { | |||||
| width: 35%; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: flex-end; | |||||
| .edit-icon { | |||||
| width: 30rpx; | |||||
| height: 30rpx; | |||||
| } | |||||
| .edit-btn { | |||||
| color: white; | |||||
| margin-left: 10rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| .user-phone { | |||||
| color: white; | |||||
| font-size: 24rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| // 会员卡片 | |||||
| .earnings { | |||||
| padding: 0rpx 20rpx; | |||||
| box-sizing: border-box; | |||||
| margin-top: -18%; | |||||
| .member-item { | |||||
| position: relative; | |||||
| .member-image { | |||||
| width: 100%; | |||||
| height: 300rpx; | |||||
| border-radius: 20rpx; | |||||
| } | |||||
| .member-info { | |||||
| position: absolute; | |||||
| bottom: 30rpx; | |||||
| left: 0rpx; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| padding: 0rpx 40rpx; | |||||
| box-sizing: border-box; | |||||
| width: 100%; | |||||
| .profile-photo { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| .pro-img { | |||||
| width: 60rpx; | |||||
| height: 60rpx; | |||||
| border-radius: 50%; | |||||
| } | |||||
| .open-status { | |||||
| color: #F8A95F; | |||||
| border: 1px solid #F8A95F; | |||||
| border-radius: 30rpx; | |||||
| padding: 7rpx 20rpx; | |||||
| margin-left: 10rpx; | |||||
| } | |||||
| } | |||||
| .open { | |||||
| font-size: 26rpx; | |||||
| margin-left: 20rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| // 佣金数据 | |||||
| .brokerage-data { | |||||
| padding: 20rpx; | |||||
| background: white; | |||||
| border-radius: 20rpx; | |||||
| display: flex; | |||||
| flex-wrap: wrap; | |||||
| box-sizing: border-box; | |||||
| margin: 20rpx 20rpx 20rpx 20rpx; | |||||
| .brokerage, | |||||
| .balance { | |||||
| display: flex; | |||||
| flex-wrap: wrap; | |||||
| width: 50%; | |||||
| .brokerage-img, | |||||
| .balance-img { | |||||
| width: 50%; | |||||
| height: auto; | |||||
| } | |||||
| .main { | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| justify-content: space-around; | |||||
| width: 50%; | |||||
| box-sizing: border-box; | |||||
| padding: 30rpx 0rpx; | |||||
| .title { | |||||
| font-size: 34rpx; | |||||
| } | |||||
| .money { | |||||
| font-size: 40rpx; | |||||
| color: $uni-color; | |||||
| font-weight: bold; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| .brokerage-data-mt { | |||||
| margin-top: 50rpx; | |||||
| } | |||||
| // 我的服务 | |||||
| .myServer { | |||||
| margin: 0rpx 20rpx 20rpx 20rpx; | |||||
| background: white; | |||||
| border-radius: 20rpx; | |||||
| padding: 30rpx 20rpx; | |||||
| box-sizing: border-box; | |||||
| box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05); | |||||
| .server-title { | |||||
| margin-bottom: 30rpx; | |||||
| font-size: 36rpx; | |||||
| font-weight: 600; | |||||
| color: #333; | |||||
| position: relative; | |||||
| padding-left: 20rpx; | |||||
| &::before { | |||||
| content: ''; | |||||
| position: absolute; | |||||
| left: 0; | |||||
| top: 50%; | |||||
| transform: translateY(-50%); | |||||
| width: 8rpx; | |||||
| height: 32rpx; | |||||
| background: $uni-color; | |||||
| border-radius: 4rpx; | |||||
| } | |||||
| } | |||||
| .box { | |||||
| display: flex; | |||||
| width: 100%; | |||||
| margin-bottom: 30rpx; | |||||
| gap: 20rpx; | |||||
| .boxs { | |||||
| width: 23%; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| justify-content: center; | |||||
| align-items: center; | |||||
| padding: 20rpx 0; | |||||
| border-radius: 16rpx; | |||||
| transition: all 0.3s ease; | |||||
| position: relative; | |||||
| overflow: hidden; | |||||
| &::after { | |||||
| content: ''; | |||||
| position: absolute; | |||||
| top: 0; | |||||
| left: 0; | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| background: rgba(227, 68, 26, 0.05); | |||||
| opacity: 0; | |||||
| transition: opacity 0.3s ease; | |||||
| z-index: 1; | |||||
| } | |||||
| &:active { | |||||
| transform: scale(0.95); | |||||
| &::after { | |||||
| opacity: 1; | |||||
| } | |||||
| } | |||||
| image { | |||||
| width: 70rpx; | |||||
| height: 70rpx; | |||||
| display: block; | |||||
| margin: 0rpx auto 16rpx auto; | |||||
| position: relative; | |||||
| z-index: 2; | |||||
| transition: transform 0.3s ease; | |||||
| } | |||||
| .title { | |||||
| font-size: 26rpx; | |||||
| color: #333; | |||||
| position: relative; | |||||
| z-index: 2; | |||||
| transition: color 0.3s ease; | |||||
| } | |||||
| &:active { | |||||
| image { | |||||
| transform: translateY(-4rpx); | |||||
| } | |||||
| .title { | |||||
| color: $uni-color; | |||||
| } | |||||
| } | |||||
| } | |||||
| &:last-child { | |||||
| margin-bottom: 0rpx; | |||||
| } | |||||
| } | |||||
| } | |||||
| // 广告 | |||||
| .ad { | |||||
| margin: 0rpx 20rpx; | |||||
| .swiper { | |||||
| .swiper-main { | |||||
| position: relative; | |||||
| .close { | |||||
| position: absolute; | |||||
| top: 20rpx; | |||||
| right: 20rpx; | |||||
| .close-img { | |||||
| width: 40rpx; | |||||
| height: 40rpx; | |||||
| } | |||||
| } | |||||
| .swiper-main-img { | |||||
| width: 100%; | |||||
| height: 200rpx; | |||||
| border-radius: 20rpx; | |||||
| } | |||||
| .ad-tag { | |||||
| position: absolute; | |||||
| left: 20rpx; | |||||
| bottom: 20rpx; | |||||
| .ad-tag-img { | |||||
| width: 120rpx; | |||||
| height: auto; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| </style> | |||||
| @ -0,0 +1,38 @@ | |||||
| export const mockCartData = { | |||||
| totalPrice: 0.0, | |||||
| selectedCount: 0, | |||||
| items: [ | |||||
| { | |||||
| id: 1, | |||||
| name: '豆角炒鸡蛋', | |||||
| price: 9.9, | |||||
| image: '/static/image/红烧肉.png', | |||||
| quantity: 1, | |||||
| sold: 235 | |||||
| }, | |||||
| { | |||||
| id: 2, | |||||
| name: '豆角炒鸡蛋', | |||||
| price: 9.9, | |||||
| image: '/static/image/红烧肉.png', | |||||
| quantity: 1, | |||||
| sold: 235 | |||||
| }, | |||||
| { | |||||
| id: 3, | |||||
| name: '豆角炒鸡蛋', | |||||
| price: 9.9, | |||||
| image: '/static/image/红烧肉.png', | |||||
| quantity: 1, | |||||
| sold: 235 | |||||
| }, | |||||
| { | |||||
| id: 4, | |||||
| name: '豆角炒鸡蛋', | |||||
| price: 9.9, | |||||
| image: '/static/image/红烧肉.png', | |||||
| quantity: 1, | |||||
| sold: 235 | |||||
| } | |||||
| ] | |||||
| } | |||||