增加跳转企业微信客服示例
This commit is contained in:
@@ -2,11 +2,9 @@
|
|||||||
<view class="content min-page bg-f7">
|
<view class="content min-page bg-f7">
|
||||||
<view class="contentbox">
|
<view class="contentbox">
|
||||||
<template v-if="shopExtend.length">
|
<template v-if="shopExtend.length">
|
||||||
<image class="bg" :src="shopExtend[0].value" mode="aspectFill"
|
<image class="bg" :src="shopExtend[0].value" mode="aspectFill" v-if="!isJsonArrayString(shopExtend[0].value)"></image>
|
||||||
v-if="!isJsonArrayString(shopExtend[0].value)"></image>
|
|
||||||
<swiper class="swiper" autoplay circular v-else>
|
<swiper class="swiper" autoplay circular v-else>
|
||||||
<swiper-item class="swiper-item" v-for="(item, index) in JSON.parse(shopExtend[0].value)"
|
<swiper-item class="swiper-item" v-for="(item, index) in JSON.parse(shopExtend[0].value)" :key="index">
|
||||||
:key="index">
|
|
||||||
<image class="swiper-bg" :src="item"></image>
|
<image class="swiper-bg" :src="item"></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
@@ -29,7 +27,7 @@
|
|||||||
<image :src="imgs.code" class="code"></image>
|
<image :src="imgs.code" class="code"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <button type="primary" @click="openContact">打开客服</button> -->
|
||||||
<view class="new-menus-box">
|
<view class="new-menus-box">
|
||||||
<view class="new-menus layout2" v-if="allConfig.takeout">
|
<view class="new-menus layout2" v-if="allConfig.takeout">
|
||||||
<view class="diner" @click="scanCodehandle(0)">
|
<view class="diner" @click="scanCodehandle(0)">
|
||||||
@@ -60,7 +58,6 @@
|
|||||||
|
|
||||||
<view class="u-font-28 color-999">一键分享,快速拼单</view>
|
<view class="u-font-28 color-999">一键分享,快速拼单</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="points" @click="toIntegralMall">
|
<view class="points" @click="toIntegralMall">
|
||||||
@@ -123,23 +120,31 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import attractPopup from '@/components/attract-popup.vue';
|
import attractPopup from '@/components/attract-popup.vue';
|
||||||
import {
|
import { homeData } from '@/common/api/market/index.js';
|
||||||
homeData
|
import { getMemberConfig, getRechargeConfig } from '@/common/api/index/index.js';
|
||||||
} from '@/common/api/market/index.js';
|
import { ref, reactive, defineProps, defineEmits, onMounted } from 'vue';
|
||||||
import {
|
import { isJsonArrayString } from '@/utils/util.js';
|
||||||
getMemberConfig,
|
|
||||||
getRechargeConfig
|
function openContact() {
|
||||||
} from '@/common/api/index/index.js';
|
wx.openCustomerServiceChat({
|
||||||
import {
|
corpId: 'wwc76ab19fa6df267f',
|
||||||
ref,
|
extInfo: {
|
||||||
reactive,
|
url: 'https://work.weixin.qq.com/kfid/kfc40ac2dc5e20c2e8e'
|
||||||
defineProps,
|
},
|
||||||
defineEmits,
|
// 成功回调
|
||||||
onMounted
|
success: (res) => {
|
||||||
} from 'vue';
|
console.log('跳转企业微信客服成功', res);
|
||||||
import {
|
},
|
||||||
isJsonArrayString
|
// 失败回调
|
||||||
} from '@/utils/util.js';
|
fail: (err) => {
|
||||||
|
console.error('跳转企业微信客服失败', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '跳转客服失败,请稍后重试',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const attractPopupRef = ref(null);
|
const attractPopupRef = ref(null);
|
||||||
|
|
||||||
@@ -167,7 +172,7 @@
|
|||||||
function toGroupBuying() {
|
function toGroupBuying() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/groupBuying/index/index'
|
url: '/groupBuying/index/index'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function toFenxiao() {
|
function toFenxiao() {
|
||||||
@@ -182,12 +187,8 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
import {
|
import { productStore } from '@/stores/user.js';
|
||||||
productStore
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
} from '@/stores/user.js';
|
|
||||||
import {
|
|
||||||
onShow
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
|
|
||||||
// 显示弹窗
|
// 显示弹窗
|
||||||
const popupShow = ref(false);
|
const popupShow = ref(false);
|
||||||
@@ -215,7 +216,7 @@
|
|||||||
function toTaocan() {
|
function toTaocan() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/userPackage/index/index'
|
url: '/userPackage/index/index'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const memberindex = (url) => {
|
const memberindex = (url) => {
|
||||||
@@ -301,7 +302,7 @@
|
|||||||
function getHomeData() {
|
function getHomeData() {
|
||||||
homeData().then((res) => {
|
homeData().then((res) => {
|
||||||
Object.assign(allConfig, res);
|
Object.assign(allConfig, res);
|
||||||
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar
|
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -544,7 +545,8 @@
|
|||||||
background: #ededed;
|
background: #ededed;
|
||||||
}
|
}
|
||||||
|
|
||||||
.takeout {}
|
.takeout {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.layout1 {
|
&.layout1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user