diff --git a/pages/user/user_vip/list.vue b/pages/user/user_vip/list.vue index ec2c8b3..9dcf0a9 100644 --- a/pages/user/user_vip/list.vue +++ b/pages/user/user_vip/list.vue @@ -54,12 +54,13 @@ - 开通会员 + 试用会员 + 开通会员 有效期至 2024-10-24 - + {{item.name}} {{item.specialPrice}} 试用1天 @@ -71,9 +72,12 @@ 购买即视为同意《会员用户协议 - + 立即试用 + + 立即开通 + @@ -96,6 +100,7 @@ const vipList = ref([]); const vipList2 = ref([]); const valVip = ref([]); + const nameVip = ref([]); // 定义方法 function getList() { request({ @@ -113,27 +118,28 @@ } // vipFun - function vipFun(index) { - valVip.value = index + let data = { + cardName:nameVip.value + } + function vipFun(index,name) { + valVip.value = index + data.cardName = name } - let kk = { - cardName:'试用' - }; // beclick function beclick() { + console.log(data.cardName,"nameVip.value") request({ url: `${baseUrl}${apiPath}/pay/member/create`, method: 'post', - params: { - cardName:kk - }, + data, custom: { showLoading: false, }, }).then((res) => { - console.log(JSON.stringify(kk),"-----------试用---------------") - + console.log(res,"-----------试用---------------") + sheep.$helper.toast('试用开通成功'); + sheep.$router.go('/pages/index/user') }); } diff --git a/sheep/components/s-block-item/s-block-item.vue b/sheep/components/s-block-item/s-block-item.vue index d549081..9ba7c0a 100644 --- a/sheep/components/s-block-item/s-block-item.vue +++ b/sheep/components/s-block-item/s-block-item.vue @@ -68,7 +68,10 @@ - 立即开通 + 正在试用 + 开通 + 永久 + 立即开通 @@ -86,13 +89,15 @@ import { ref, reactive, - unref + unref, + computed } from 'vue'; import AddressApi from '@/sheep/api/member/address'; const state = reactive({ model: [], }); - +// 用户信息 + const userInfo = computed(() => sheep.$store('user').userInfo); const ff = async (id) => { let { code,