123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <view class="right">
- <view v-for="(item, index) in rightList" :key="index" class="right-item">
- <image @click="goPath(item,index)" :src="item.img"></image>
- <text>{{ item.text }}</text>
- </view>
- </view>
- </template>
- <script>
- import utils from "@/utils/index";
- export default {
- data() {
- return {};
- },
- computed: {
- isVip() {
- return this.$store.getters.isVip;
- },
- },
- methods: {
- goPath(item, index) {
- let query = Object.assign({}, this.query);
- query.title = item.text;
- if (this.needVipList.includes(index) && !this.isVip) {
- uni.showModal({
- title: "提示",
- content: "需要vip才能使用这个功能",
- confirmText: "购买vip",
- cancelText: "取消",
- success(res) {
- console.log(res);
- if (res.confirm) {
- uni.navigateTo({
- url: "/otherPages/buyVip/index",
- });
- }
- },
- });
- return;
- }
- if (item.path) {
- let str = utils.mapToUrlQuery(query);
- console.log(item.path + "?" + str, "str");
- uni.navigateTo({
- url: item.path + "?" + str,
- });
- }
- },
- },
- props: {
- needVipList: {
- type: Array,
- default: () => {
- return [];
- },
- },
- rightList: {
- type: Array,
- default: () => {
- return [];
- },
- },
- subject: {
- type: Number,
- default: 1,
- },
- query: {
- type: Object,
- default: () => {
- return {};
- },
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .right {
- width: 150rpx;
- margin-top: 50rpx;
- font-size: 26rpx;
- .right-item {
- width: 150rpx;
- display: flex;
- justify-content: center;
- flex-direction: column;
- align-content: center;
- align-items: center;
- margin-bottom: 36rpx;
- image {
- width: 100rpx;
- height: 100rpx;
- }
- }
- }
- </style>
|