develop
parent
0a7e7ef725
commit
d38a86c499
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -49,13 +49,16 @@
|
||||||
<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
|
||||||
|
@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"
|
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="text-26rpx">{{ item.name }}</view>
|
||||||
<view class="price-text text-34rpx font-medium mt-15rpx">{{ item.price }}</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 :class="Index == index ? 'text-hex-f59e0b' : ''" class="text-26rpx mt-15rpx text-hex-909399">{{ item.times.text }} </view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
@ -74,9 +77,9 @@
|
||||||
</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>
|
||||||
|
|
@ -89,7 +92,7 @@
|
||||||
isFirstLoading: true,
|
isFirstLoading: true,
|
||||||
list: [],
|
list: [],
|
||||||
Index: 0,
|
Index: 0,
|
||||||
checked: true
|
checked: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -97,51 +100,54 @@
|
||||||
return this.$store.getters.user ?? {};
|
return this.$store.getters.user ?? {};
|
||||||
},
|
},
|
||||||
chooseVip() {
|
chooseVip() {
|
||||||
return this.list[this.Index]
|
return this.list[this.Index] ?? {};
|
||||||
},
|
},
|
||||||
time() {
|
time() {
|
||||||
return this.$u.timeFormat(this.user.vip_expired, 'yyyy-mm-dd');
|
return this.$u.timeFormat(this.user.vip_expired, 'yyyy-mm-dd');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getDate()
|
this.getDate();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getDate() {
|
async getDate() {
|
||||||
try {
|
try {
|
||||||
const resData=await this.$api.get('/v1/vip')
|
const resData = await this.$api.get('/v1/vip');
|
||||||
this.list=resData
|
this.list = resData;
|
||||||
}catch(err){}finally{
|
} catch (err) {
|
||||||
this.isFirstLoading=false
|
} finally {
|
||||||
|
this.isFirstLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onSumbit() {
|
async onSumbit() {
|
||||||
if(!this.checked) return this.$u.toast('请勾选协议')
|
if (!this.checked) return this.$u.toast('请勾选协议');
|
||||||
try {
|
try {
|
||||||
const resData=await this.$api.post('/v1/vip/buy',{vip_id:this.chooseVip.id})
|
const resData = await this.$api.post('/v1/vip/buy', { vip_id: this.chooseVip.id });
|
||||||
const res=await wxpay(resData.data)
|
if (resData.status == 1) {
|
||||||
|
return this.success();
|
||||||
|
}
|
||||||
|
const res = await wxpay(resData.data);
|
||||||
if (res == 'success') {
|
if (res == 'success') {
|
||||||
this.$u.toast('充值成功');
|
this.success();
|
||||||
this.$store.dispatch('user/getUserInfo');
|
|
||||||
setTimeout(()=>{
|
|
||||||
uni.navigateBack({})
|
|
||||||
},300)
|
|
||||||
} else {
|
} else {
|
||||||
this.$u.toast('支付失败');
|
this.$u.toast('支付失败');
|
||||||
}
|
}
|
||||||
}catch(err){
|
} catch (err) {}
|
||||||
}
|
},
|
||||||
}
|
success() {
|
||||||
}
|
this.$u.toast('充值成功');
|
||||||
|
this.$store.dispatch('user/getUserInfo');
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({});
|
||||||
|
}, 300);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
</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%,
|
|
||||||
#f8cfb4 100%), linear-gradient(#c59f6d,
|
|
||||||
#c59f6d);
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 64rpx;
|
width: 64rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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">
|
||||||
|
|
|
||||||
|
|
@ -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}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue