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;
}
.class-item:last-child {
min-height: 100vh;
}
// .class-item:last-child {
// min-height: 100vh;
// }
.item-title {
font-size: 26rpx;

View File

@ -49,13 +49,16 @@
<view class="bg-white mt-20rpx p-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
@click="Index = index"
:class="Index == index ? 'text-hex-f59e0b border-hex-f59e0b' : 'border-hex-F5F5F5'"
class="rounded-15rpx py-50rpx flex items-center justify-center flex-col border border-solid"
v-for="(item,index) in list" :key="index">
v-for="(item, index) in list"
:key="index"
>
<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 :class="Index == index ? 'text-hex-f59e0b' : ''" class="text-26rpx mt-15rpx text-hex-909399">{{ item.times.text }} </view>
</view>
</view>
<!-- -->
@ -74,9 +77,9 @@
</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">
{{user.is_vip?'续费':'立即开通'}}</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">
{{ user.is_vip ? '续费' : '立即开通' }}</view
>
</view>
</view>
</template>
@ -89,7 +92,7 @@
isFirstLoading: true,
list: [],
Index: 0,
checked: true
checked: true,
};
},
computed: {
@ -97,51 +100,54 @@
return this.$store.getters.user ?? {};
},
chooseVip() {
return this.list[this.Index]
return this.list[this.Index] ?? {};
},
time() {
return this.$u.timeFormat(this.user.vip_expired, 'yyyy-mm-dd');
}
},
},
onLoad() {
this.getDate()
this.getDate();
},
methods: {
async getDate() {
try {
const resData=await this.$api.get('/v1/vip')
this.list=resData
}catch(err){}finally{
this.isFirstLoading=false
const resData = await this.$api.get('/v1/vip');
this.list = resData;
} catch (err) {
} finally {
this.isFirstLoading = false;
}
},
async onSumbit() {
if(!this.checked) return this.$u.toast('请勾选协议')
if (!this.checked) return this.$u.toast('请勾选协议');
try {
const resData=await this.$api.post('/v1/vip/buy',{vip_id:this.chooseVip.id})
const res=await wxpay(resData.data)
const resData = await this.$api.post('/v1/vip/buy', { vip_id: this.chooseVip.id });
if (resData.status == 1) {
return this.success();
}
const res = await wxpay(resData.data);
if (res == 'success') {
this.$u.toast('充值成功');
this.$store.dispatch('user/getUserInfo');
setTimeout(()=>{
uni.navigateBack({})
},300)
this.success();
} else {
this.$u.toast('支付失败');
}
}catch(err){
}
}
}
} catch (err) {}
},
success() {
this.$u.toast('充值成功');
this.$store.dispatch('user/getUserInfo');
setTimeout(() => {
uni.navigateBack({});
}, 300);
}
},
};
</script>
<style lang="scss" scoped>
.item {
background-image: linear-gradient(-90deg,
#e3a96d 0%,
#f8cfb4 100%), linear-gradient(#c59f6d,
#c59f6d);
background-image: linear-gradient(-90deg, #e3a96d 0%, #f8cfb4 100%), linear-gradient(#c59f6d, #c59f6d);
border-radius: 50%;
width: 64rpx;
height: 64rpx;

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>
</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>
</template>
@ -209,6 +209,7 @@
this.$api.get(`/v1/store/desk/${desk}`).then(res => {
this.desk = res
this.type = 'desk'
this.remarks = '桌号:' + this.desk.name
// id
this.mid = options.mid
// id

View File

@ -55,7 +55,7 @@
<view class="bg-white rounded-xs mt-24rpx py-base px-40rpx">
<!-- <view class="text-xl">商家名称</view> -->
<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">
<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 File

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