6
0
Fork 0
develop
panliang 2023-02-26 10:26:00 +08:00
parent 0a7e7ef725
commit d38a86c499
5 changed files with 102 additions and 95 deletions

View File

@ -301,9 +301,9 @@ export default {
border-radius: 8rpx; border-radius: 8rpx;
} }
.class-item:last-child { // .class-item:last-child {
min-height: 100vh; // min-height: 100vh;
} // }
.item-title { .item-title {
font-size: 26rpx; font-size: 26rpx;

View File

@ -1,25 +1,25 @@
<template> <template>
<view> <view>
<loading-view v-if="isFirstLoading"></loading-view> <loading-view v-if="isFirstLoading"></loading-view>
<view class="bg-hex-303133 flex items-center justify-between p-30rpx "> <view class="bg-hex-303133 flex items-center justify-between p-30rpx">
<view class="flex"> <view class="flex">
<cu-avatar size="120" :src="user.avatar ? user.avatar : ''"></cu-avatar> <cu-avatar size="120" :src="user.avatar ? user.avatar : ''"></cu-avatar>
<view class="ml-20rpx mt-10rpx"> <view class="ml-20rpx mt-10rpx">
<image :src="!user.is_vip?'/static/images/svip/vip_failure.png':'/static/images/svip/vip.png'" class="w-48rpx h-48rpx" mode=""></image> <image :src="!user.is_vip ? '/static/images/svip/vip_failure.png' : '/static/images/svip/vip.png'" class="w-48rpx h-48rpx" mode=""></image>
<view v-if="!user.is_vip" class="text-hex-f5f5f5 text-22rpx mt-10rpx"></view> <view v-if="!user.is_vip" class="text-hex-f5f5f5 text-22rpx mt-10rpx"></view>
<view v-else class="text-hex-f5f5f5 text-22rpx mt-10rpx">vip到期日期{{time}}</view> <view v-else class="text-hex-f5f5f5 text-22rpx mt-10rpx">vip到期日期{{ time }}</view>
</view> </view>
</view> </view>
<view class="text-white flex items-center text-26rpx" @click="$u.route('/pageB/record/index')"> <view class="text-white flex items-center text-26rpx" @click="$u.route('/pageB/record/index')">
<view class="mr-8rpx">购买记录</view> <view class="mr-8rpx">购买记录</view>
<u-icon color="#ffffff" name="arrow-right" size="26"></u-icon> <u-icon color="#ffffff" name="arrow-right" size="26"></u-icon>
</view> </view>
</view> </view>
<!-- --> <!-- -->
<view class="bg-white pb-40rpx"> <view class="bg-white pb-40rpx">
<view class="p-30rpx text-32rpx ">尊享特权</view> <view class="p-30rpx text-32rpx">尊享特权</view>
<view class="grid grid-cols-4 gap-30rpx"> <view class="grid grid-cols-4 gap-30rpx">
<view class="flex items-center justify-center flex-col "> <view class="flex items-center justify-center flex-col">
<view class="item"> <view class="item">
<image src="@/static/images/svip/vip_icon02.png" class="w-36rpx h-36rpx" mode="aspectFill"></image> <image src="@/static/images/svip/vip_icon02.png" class="w-36rpx h-36rpx" mode="aspectFill"></image>
</view> </view>
@ -32,15 +32,15 @@
<view class="mt-20rpx text-24rpx">会员礼卷</view> <view class="mt-20rpx text-24rpx">会员礼卷</view>
</view> </view>
<view class="flex items-center justify-center flex-col"> <view class="flex items-center justify-center flex-col">
<view class="item"> <view class="item">
<image src="@/static/images/svip/vip_icon01.png" class="w-36rpx h-36rpx" mode="aspectFill"></image> <image src="@/static/images/svip/vip_icon01.png" class="w-36rpx h-36rpx" mode="aspectFill"></image>
</view> </view>
<view class="mt-20rpx text-24rpx">会员特权</view> <view class="mt-20rpx text-24rpx">会员特权</view>
</view> </view>
<view class="flex items-center justify-center flex-col"> <view class="flex items-center justify-center flex-col">
<view class="item"> <view class="item">
<image src="@/static/images/svip/vip_icon04.png" class="w-36rpx h-36rpx" mode="aspectFill"></image> <image src="@/static/images/svip/vip_icon04.png" class="w-36rpx h-36rpx" mode="aspectFill"></image>
</view> </view>
<view class="mt-20rpx text-24rpx">尊贵标识</view> <view class="mt-20rpx text-24rpx">尊贵标识</view>
</view> </view>
</view> </view>
@ -48,105 +48,111 @@
<!-- --> <!-- -->
<view class="bg-white mt-20rpx p-30rpx"> <view class="bg-white mt-20rpx p-30rpx">
<!-- --> <!-- -->
<view class="grid grid-cols-3 gap-30rpx"> <view class="grid grid-cols-3 gap-30rpx">
<view @click="Index=index" :class="Index==index?'text-hex-f59e0b border-hex-f59e0b':'border-hex-F5F5F5'" <view
class="rounded-15rpx py-50rpx flex items-center justify-center flex-col border border-solid " @click="Index = index"
v-for="(item,index) in list" :key="index"> :class="Index == index ? 'text-hex-f59e0b border-hex-f59e0b' : 'border-hex-F5F5F5'"
<view class="text-26rpx">{{item.name}}</view> class="rounded-15rpx py-50rpx flex items-center justify-center flex-col border border-solid"
<view class="price-text text-34rpx font-medium mt-15rpx">{{item.price}}</view> v-for="(item, index) in list"
<view :class="Index==index?'text-hex-f59e0b':''" class="text-26rpx mt-15rpx text-hex-909399">{{item.times.text}} :key="index"
</view> >
<view class="text-26rpx">{{ item.name }}</view>
<view class="price-text text-34rpx font-medium mt-15rpx">{{ item.price }}</view>
<view :class="Index == index ? 'text-hex-f59e0b' : ''" class="text-26rpx mt-15rpx text-hex-909399">{{ item.times.text }} </view>
</view> </view>
</view> </view>
<!-- --> <!-- -->
<view class="mt-30rpx text-28rpx"> <view class="mt-30rpx text-28rpx">
<text class="leading-40rpx"> <text class="leading-40rpx">
{{chooseVip.description}} {{ chooseVip.description }}
</text> </text>
</view> </view>
<!-- --> <!-- -->
<view class="flex items-center mt-20rpx"> <view class="flex items-center mt-20rpx">
<u-checkbox v-model="checked" shape="circle" active-color="#f59e0b" size="28" icon-size="18"></u-checkbox> <u-checkbox v-model="checked" shape="circle" active-color="#f59e0b" size="28" icon-size="18"></u-checkbox>
<view class="text-22rpx -ml-15rpx mt-8rpx "> <view class="text-22rpx -ml-15rpx mt-8rpx">
已同意并阅读 已同意并阅读
<text class="text-hex-f59e0b">平台协议</text> <text class="text-hex-f59e0b">平台协议</text>
<text class="text-hex-f59e0b">价格说明</text> <text class="text-hex-f59e0b">价格说明</text>
</view> </view>
</view> </view>
<!-- --> <!-- -->
<view <view class="w-full mt-30rpx h-88rpx bg-hex-404040 rounded-full text-center text-hex-f59e0b leading-88rpx text-32rpx" @click="onSumbit">
class="w-full mt-30rpx h-88rpx bg-hex-404040 rounded-full text-center text-hex-f59e0b leading-88rpx text-32rpx" @click="onSumbit"> {{ user.is_vip ? '续费' : '立即开通' }}</view
{{user.is_vip?'续费':'立即开通'}}</view> >
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { wxpay, alipay } from '@/utils/pay.js'; import { wxpay, alipay } from '@/utils/pay.js';
export default { export default {
data() { data() {
return { return {
isFirstLoading:true, isFirstLoading: true,
list: [], list: [],
Index: 0, Index: 0,
checked: true checked: true,
}; };
},
computed: {
user() {
return this.$store.getters.user ?? {};
}, },
computed:{ chooseVip() {
user() { return this.list[this.Index] ?? {};
return this.$store.getters.user ?? {}; },
}, time() {
chooseVip(){ return this.$u.timeFormat(this.user.vip_expired, 'yyyy-mm-dd');
return this.list[this.Index] },
}, },
time(){ onLoad() {
return this.$u.timeFormat(this.user.vip_expired, 'yyyy-mm-dd'); this.getDate();
},
methods: {
async getDate() {
try {
const resData = await this.$api.get('/v1/vip');
this.list = resData;
} catch (err) {
} finally {
this.isFirstLoading = false;
} }
}, },
onLoad() { async onSumbit() {
this.getDate() if (!this.checked) return this.$u.toast('请勾选协议');
}, try {
methods: { const resData = await this.$api.post('/v1/vip/buy', { vip_id: this.chooseVip.id });
async getDate(){ if (resData.status == 1) {
try{ return this.success();
const resData=await this.$api.get('/v1/vip')
this.list=resData
}catch(err){}finally{
this.isFirstLoading=false
} }
}, const res = await wxpay(resData.data);
async onSumbit(){ if (res == 'success') {
if(!this.checked) return this.$u.toast('请勾选协议') this.success();
try{ } else {
const resData=await this.$api.post('/v1/vip/buy',{vip_id:this.chooseVip.id}) this.$u.toast('支付失败');
const res=await wxpay(resData.data) }
if(res=='success'){ } catch (err) {}
this.$u.toast('充值成功'); },
this.$store.dispatch('user/getUserInfo'); success() {
setTimeout(()=>{ this.$u.toast('充值成功');
uni.navigateBack({}) this.$store.dispatch('user/getUserInfo');
},300) setTimeout(() => {
}else{ uni.navigateBack({});
this.$u.toast('支付失败'); }, 300);
}
}catch(err){
}
}
} }
} },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.item { .item {
background-image: linear-gradient(-90deg, background-image: linear-gradient(-90deg, #e3a96d 0%, #f8cfb4 100%), linear-gradient(#c59f6d, #c59f6d);
#e3a96d 0%, border-radius: 50%;
#f8cfb4 100%), linear-gradient(#c59f6d, width: 64rpx;
#c59f6d); height: 64rpx;
border-radius: 50%; display: flex;
width: 64rpx; align-items: center;
height: 64rpx; justify-content: center;
display: flex; }
align-items: center;
justify-content: center;
}
</style> </style>

View File

@ -162,7 +162,7 @@
合计: <text class="text-xl" v-if="orderInfo.total_points >0"> {{orderInfo.total_points}}积分+</text> <text class="text-xl text-txSvip">{{ orderInfo.total_amount }}</text> 合计: <text class="text-xl" v-if="orderInfo.total_points >0"> {{orderInfo.total_points}}积分+</text> <text class="text-xl text-txSvip">{{ orderInfo.total_amount }}</text>
</view> </view>
<view @tap="createOrder" class="w-180rpx h-66rpx leading-66rpx text-center text-lg ml-40rpx text-white bg-primary rounded-lg mr-base">提交订单</view> <view @tap="createOrder" class="w-180rpx h-66rpx leading-66rpx text-center text-lg ml-40rpx text-white bg-primary rounded-lg mr-base">提交订单</view>
<view v-if="is_company" @tap="createPreOrder" class="w-180rpx h-66rpx leading-66rpx text-center text-lg ml-20rpx text-white bg-hex-D43030 rounded-lg mr-base"></view> <view v-if="is_company && type != 'desk'" @tap="createPreOrder" class="w-180rpx h-66rpx leading-66rpx text-center text-lg ml-20rpx text-white bg-hex-D43030 rounded-lg mr-base"></view>
</view> </view>
</view> </view>
</template> </template>
@ -209,6 +209,7 @@
this.$api.get(`/v1/store/desk/${desk}`).then(res => { this.$api.get(`/v1/store/desk/${desk}`).then(res => {
this.desk = res this.desk = res
this.type = 'desk' this.type = 'desk'
this.remarks = '桌号:' + this.desk.name
// id // id
this.mid = options.mid this.mid = options.mid
// id // id

View File

@ -55,7 +55,7 @@
<view class="bg-white rounded-xs mt-24rpx py-base px-40rpx"> <view class="bg-white rounded-xs mt-24rpx py-base px-40rpx">
<!-- <view class="text-xl">商家名称</view> --> <!-- <view class="text-xl">商家名称</view> -->
<block v-for="(item, index) in products" :key="item.id"> <block v-for="(item, index) in products" :key="item.id">
<view @tap="$u.routeAuth('/pages/product_details/index', { skuId: item.sku_id })" class="mb-base"> <view @tap="$u.routeAuth('/pages/product_details/index', { skuId: item.spu_id })" class="mb-base">
<view class="flex"> <view class="flex">
<u-image border-radius="10" width="190rpx" height="190rpx" :src="item.cover" :lazy-load="true"></u-image> <u-image border-radius="10" width="190rpx" height="190rpx" :src="item.cover" :lazy-load="true"></u-image>
<view class="flex-1 ml-16rpx w-0 flex justify-between flex-col"> <view class="flex-1 ml-16rpx w-0 flex justify-between flex-col">

View File

@ -28,13 +28,13 @@
} }
// //
if (scene.p) { if (scene.p) {
uni.redirectTo({ uni.reLaunch({
url: '/pages/product_details/index?skuId=' + scene.product url: '/pages/product_details/index?skuId=' + scene.product
}) })
} }
// //
else if (scene.o) { else if (scene.o) {
uni.redirectTo({ uni.reLaunch({
url: '/pageB/select_product/com_order?id=' + scene.o url: '/pageB/select_product/com_order?id=' + scene.o
}) })
} }
@ -46,7 +46,7 @@
const id = scene.c const id = scene.c
// id // id
const mid = scene.s const mid = scene.s
uni.redirectTo({ uni.reLaunch({
url: `/pageB/select_product/search?mid=${mid}&cid=${id}` url: `/pageB/select_product/search?mid=${mid}&cid=${id}`
}); });
} }