|
|
@@ -177,6 +177,32 @@
|
|
|
<view style="height: 80rpx;"></view>
|
|
|
</view>
|
|
|
</popViewGG>
|
|
|
+
|
|
|
+ <!-- 下载app弹窗 -->
|
|
|
+ <uni-popup ref="downloadPopup" type="center" :mask-click="true">
|
|
|
+ <view class="download-popup-content">
|
|
|
+ <!-- 标题栏 -->
|
|
|
+ <view class="download-popup-header">
|
|
|
+ <text class="download-popup-title">{{$t('api.message')}}</text>
|
|
|
+ <view class="download-popup-close" @click="closeDownloadPopup">
|
|
|
+ <text class="close-icon">×</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 内容 -->
|
|
|
+ <view class="download-popup-body">
|
|
|
+ <text class="download-popup-text">{{$t('jiesuan.xiazapp')}}</text>
|
|
|
+ </view>
|
|
|
+ <!-- 按钮 -->
|
|
|
+ <view class="download-popup-buttons">
|
|
|
+ <view class="download-popup-btn download-popup-btn-ios" @click="downloadIOS">
|
|
|
+ <text class="download-popup-btn-text">{{$t('jiesuan.xzios')}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="download-popup-btn download-popup-btn-android" @click="downloadAndroid">
|
|
|
+ <text class="download-popup-btn-text">{{$t('jiesuan.xiazandriod')}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -218,7 +244,10 @@
|
|
|
startY: 0,
|
|
|
lang: '0',
|
|
|
dailinghb: [],
|
|
|
- hongbkqs: false
|
|
|
+ hongbkqs: false,
|
|
|
+ downloadUrls: {},
|
|
|
+ isShangjia: 0,
|
|
|
+ id: 0,
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
@@ -257,6 +286,9 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
+ this.isShangjia = option.isShangjia
|
|
|
+ this.id = option.id
|
|
|
+
|
|
|
var code = option.language
|
|
|
console.log(code)
|
|
|
uni.setStorageSync('language', code);
|
|
|
@@ -310,6 +342,495 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 检测是否为安卓设备
|
|
|
+ isAndroidDevice() {
|
|
|
+ // 在H5环境中检测
|
|
|
+ // #ifdef H5
|
|
|
+ const ua = navigator.userAgent.toLowerCase();
|
|
|
+ return ua.indexOf('android') > -1;
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // 在App环境中检测
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ return plus.os.name === 'Android';
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // 其他环境默认返回false
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 检测是否为iOS设备
|
|
|
+ isIOSDevice() {
|
|
|
+ // #ifdef H5
|
|
|
+ const ua = navigator.userAgent.toLowerCase();
|
|
|
+ return /iphone|ipad|ipod/.test(ua);
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ return plus.os.name === 'iOS';
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 显示下载app提示
|
|
|
+ showDownloadAppModal() {
|
|
|
+ api('getAppDownload', {}, r => {
|
|
|
+ console.log(r)
|
|
|
+ this.downloadUrls = r.data.data;
|
|
|
+ this.$refs.downloadPopup.open();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 关闭下载app弹窗
|
|
|
+ closeDownloadPopup() {
|
|
|
+ this.$refs.downloadPopup.close();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 下载iOS版本
|
|
|
+ downloadIOS() {
|
|
|
+ // 先尝试打开已安装的应用
|
|
|
+ this.tryOpenInstalledApp();
|
|
|
+ this.closeDownloadPopup();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 下载Android版本
|
|
|
+ downloadAndroid() {
|
|
|
+ // 先尝试打开已安装的应用
|
|
|
+ this.tryOpenInstalledApp();
|
|
|
+ this.closeDownloadPopup();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 尝试打开已安装的应用
|
|
|
+ tryOpenInstalledApp() {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ const appSchema = 'cityexpressuser://pages/shanpinxungou/shangjia/shangjiaView?id=' + this.id +
|
|
|
+ '&isShangjia=' + this.isShangjia;
|
|
|
+
|
|
|
+ // 在App环境中使用plus.runtime.openURL
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ plus.runtime.openURL(appSchema, function() {
|
|
|
+ console.log(that.$t('download.app_opened_success'));
|
|
|
+ }, function(e) {
|
|
|
+ console.log(that.$t('download.app_not_installed'));
|
|
|
+ // 应用未安装,继续下载流程
|
|
|
+ that.startDownloadProcess();
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // 在H5环境中尝试打开应用
|
|
|
+ // #ifdef H5
|
|
|
+ this.tryOpenAppInH5(appSchema);
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+
|
|
|
+ // 在H5环境中尝试打开应用
|
|
|
+ tryOpenAppInH5(appSchema) {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ // 检测是否为iOS设备
|
|
|
+ const isIOS = this.isIOSDevice();
|
|
|
+
|
|
|
+ if (isIOS) {
|
|
|
+ // iOS设备使用特殊处理
|
|
|
+ this.tryOpenIOSApp(appSchema);
|
|
|
+ } else {
|
|
|
+ // 安卓设备使用iframe方式
|
|
|
+ this.tryOpenAndroidApp(appSchema);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 尝试打开iOS应用
|
|
|
+ tryOpenIOSApp(appSchema) {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ // 记录开始时间
|
|
|
+ const startTime = Date.now();
|
|
|
+ let hasApp = false;
|
|
|
+
|
|
|
+ // 监听页面可见性变化
|
|
|
+ const handleVisibilityChange = () => {
|
|
|
+ if (document.hidden) {
|
|
|
+ hasApp = true;
|
|
|
+ clearTimeout(timeout);
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 监听页面隐藏事件
|
|
|
+ const handlePageHide = () => {
|
|
|
+ hasApp = true;
|
|
|
+ clearTimeout(timeout);
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 监听窗口失焦事件
|
|
|
+ const handleBlur = () => {
|
|
|
+ hasApp = true;
|
|
|
+ clearTimeout(timeout);
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 设置超时检测
|
|
|
+ const timeout = setTimeout(() => {
|
|
|
+ if (!hasApp) {
|
|
|
+ // 应用未安装,继续下载流程
|
|
|
+ that.startDownloadProcess();
|
|
|
+ }
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ }, 1500); // 缩短超时时间
|
|
|
+
|
|
|
+ // 添加事件监听器
|
|
|
+ document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.addEventListener('pagehide', handlePageHide);
|
|
|
+ window.addEventListener('blur', handleBlur);
|
|
|
+
|
|
|
+ // 尝试打开应用
|
|
|
+ try {
|
|
|
+ // 方法1: 直接使用window.location
|
|
|
+ window.location.href = appSchema;
|
|
|
+ } catch (e) {
|
|
|
+ // 方法2: 使用iframe
|
|
|
+ const iframe = document.createElement('iframe');
|
|
|
+ iframe.style.display = 'none';
|
|
|
+ iframe.style.width = '1px';
|
|
|
+ iframe.style.height = '1px';
|
|
|
+ iframe.src = appSchema;
|
|
|
+ document.body.appendChild(iframe);
|
|
|
+
|
|
|
+ // 清理iframe
|
|
|
+ setTimeout(() => {
|
|
|
+ if (document.body.contains(iframe)) {
|
|
|
+ document.body.removeChild(iframe);
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 尝试打开安卓应用
|
|
|
+ tryOpenAndroidApp(appSchema) {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ let hasApp = false;
|
|
|
+
|
|
|
+ // 监听页面可见性变化
|
|
|
+ const handleVisibilityChange = () => {
|
|
|
+ if (document.hidden) {
|
|
|
+ hasApp = true;
|
|
|
+ clearTimeout(timeout);
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 监听页面隐藏事件
|
|
|
+ const handlePageHide = () => {
|
|
|
+ hasApp = true;
|
|
|
+ clearTimeout(timeout);
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 监听窗口失焦事件
|
|
|
+ const handleBlur = () => {
|
|
|
+ hasApp = true;
|
|
|
+ clearTimeout(timeout);
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 设置超时检测
|
|
|
+ const timeout = setTimeout(() => {
|
|
|
+ if (!hasApp) {
|
|
|
+ // 应用未安装,继续下载流程
|
|
|
+ that.startDownloadProcess();
|
|
|
+ }
|
|
|
+ document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.removeEventListener('pagehide', handlePageHide);
|
|
|
+ document.removeEventListener('blur', handleBlur);
|
|
|
+ }, 1500); // 缩短超时时间
|
|
|
+
|
|
|
+ // 添加事件监听器
|
|
|
+ document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
|
+ document.addEventListener('pagehide', handlePageHide);
|
|
|
+ window.addEventListener('blur', handleBlur);
|
|
|
+
|
|
|
+ // 尝试打开应用
|
|
|
+ try {
|
|
|
+ // 方法1: 直接使用window.location
|
|
|
+ window.location.href = appSchema;
|
|
|
+ } catch (e) {
|
|
|
+ // 方法2: 使用iframe
|
|
|
+ const iframe = document.createElement('iframe');
|
|
|
+ iframe.style.display = 'none';
|
|
|
+ iframe.style.width = '1px';
|
|
|
+ iframe.style.height = '1px';
|
|
|
+ iframe.src = appSchema;
|
|
|
+ document.body.appendChild(iframe);
|
|
|
+
|
|
|
+ // 清理iframe
|
|
|
+ setTimeout(() => {
|
|
|
+ if (document.body.contains(iframe)) {
|
|
|
+ document.body.removeChild(iframe);
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 开始下载流程
|
|
|
+ startDownloadProcess() {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ // 显示下载提示
|
|
|
+ uni.showLoading({
|
|
|
+ title: this.$t('download.downloading'),
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+
|
|
|
+ // 获取下载链接
|
|
|
+ api('getAppDownload', {}, r => {
|
|
|
+ console.log(r);
|
|
|
+
|
|
|
+ // 检测是否为安卓设备
|
|
|
+ const isAndroid = this.isAndroidDevice();
|
|
|
+
|
|
|
+ if (isAndroid) {
|
|
|
+ // 安卓设备下载APK
|
|
|
+ that.downloadAndroidAPK(r.data.data.androidUrl);
|
|
|
+ } else {
|
|
|
+ // iOS设备打开App Store
|
|
|
+ that.openAppStore(r.data.data.iosUrl);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 下载安卓APK
|
|
|
+ downloadAndroidAPK(androidUrl) {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ // 在App环境中使用plus.downloader
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ const appDownloadTask = plus.downloader.createDownload(androidUrl, {
|
|
|
+ filename: '_downloads/CTE.apk'
|
|
|
+ }, function(download, status) {
|
|
|
+ uni.hideLoading();
|
|
|
+
|
|
|
+ if (status === 200) {
|
|
|
+ // 下载成功,尝试安装
|
|
|
+ that.installAndroidApp(download.filename);
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: that.$t('download.download_failed'),
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 监听下载进度
|
|
|
+ appDownloadTask.addEventListener('statechanged', function(download, status) {
|
|
|
+ if (status === 200) {
|
|
|
+ const progress = Math.round((download.downloadedSize / download.totalSize) * 100);
|
|
|
+ uni.showLoading({
|
|
|
+ title: that.$t('download.downloading_progress', {
|
|
|
+ progress: progress
|
|
|
+ }),
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ appDownloadTask.start();
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // 在H5环境中使用uni.downloadFile
|
|
|
+ // #ifdef H5
|
|
|
+ const h5DownloadTask = uni.downloadFile({
|
|
|
+ url: androidUrl,
|
|
|
+ success: function(res) {
|
|
|
+ uni.hideLoading();
|
|
|
+
|
|
|
+ if (res.statusCode === 200) {
|
|
|
+ // 下载成功,尝试安装
|
|
|
+ that.installAndroidApp(res.tempFilePath);
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: that.$t('download.download_failed'),
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ uni.hideLoading();
|
|
|
+ console.log('下载失败:', err);
|
|
|
+
|
|
|
+ // 下载失败时,提供手动下载选项
|
|
|
+ uni.showModal({
|
|
|
+ title: that.$t('download.download_failed'),
|
|
|
+ content: that.$t('download.download_failed_manual'),
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: that.$t('comp.quxiao'),
|
|
|
+ confirmText: that.$t('comp.queren'),
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ // 使用浏览器打开下载链接
|
|
|
+ window.open(androidUrl, '_blank');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 监听下载进度
|
|
|
+ h5DownloadTask.onProgressUpdate(function(res) {
|
|
|
+ const progress = Math.round(res.progress);
|
|
|
+ uni.showLoading({
|
|
|
+ title: that.$t('download.downloading_progress', {
|
|
|
+ progress: progress
|
|
|
+ }),
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+
|
|
|
+ // 打开App Store
|
|
|
+ openAppStore(iosUrl) {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ // 在App环境中使用plus.runtime.openURL
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ plus.runtime.openURL(
|
|
|
+ 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188',
|
|
|
+ (res) => {
|
|
|
+ console.log(that.$t('download.app_store_success'))
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(that.$t('download.app_store_failed'))
|
|
|
+ // 如果 itms-apps:// 失败,回退到浏览器打开
|
|
|
+ plus.runtime.openURL('https://apps.apple.com/cn/app/cte/id6468907188')
|
|
|
+ }
|
|
|
+ );
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // 在H5环境中,针对iOS设备优化
|
|
|
+ // #ifdef H5
|
|
|
+ // 先尝试直接打开App Store链接
|
|
|
+ const appStoreUrl = 'https://apps.apple.com/cn/app/cte/id6468907188';
|
|
|
+
|
|
|
+ // 尝试多种方式打开App Store
|
|
|
+ that.tryOpenAppStore(appStoreUrl);
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+
|
|
|
+ // 安装安卓应用
|
|
|
+ installAndroidApp(filePath) {
|
|
|
+ const that = this;
|
|
|
+
|
|
|
+ // 在App环境中,直接尝试安装APK
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ uni.showModal({
|
|
|
+ title: that.$t('download.download_complete'),
|
|
|
+ content: that.$t('download.install_confirm'),
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: that.$t('comp.quxiao'),
|
|
|
+ confirmText: that.$t('comp.queren'),
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ // 使用plus.runtime.install安装APK
|
|
|
+ plus.runtime.install(filePath, {
|
|
|
+ force: false
|
|
|
+ }, function() {
|
|
|
+ uni.showToast({
|
|
|
+ title: that.$t('download.install_success'),
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }, function(e) {
|
|
|
+ console.log('安装失败:', e);
|
|
|
+ uni.showModal({
|
|
|
+ title: that.$t('download.install_failed'),
|
|
|
+ content: that.$t('download.install_failed_manual'),
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: that.$t('comp.quxiao'),
|
|
|
+ confirmText: that.$t('comp.queren'),
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ // 打开文件管理器
|
|
|
+ plus.runtime.openFile(filePath);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // 在H5环境中,提示用户手动安装
|
|
|
+ // #ifdef H5
|
|
|
+ uni.showModal({
|
|
|
+ title: that.$t('download.download_complete'),
|
|
|
+ content: that.$t('download.manual_install_hint'),
|
|
|
+ showCancel: false,
|
|
|
+ confirmText: that.$t('comp.queren'),
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ // 尝试打开下载链接,让用户手动下载
|
|
|
+ window.open(filePath, '_blank');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+
|
|
|
+ // 尝试打开App Store的多种方式
|
|
|
+ tryOpenAppStore(appStoreUrl) {
|
|
|
+ // 方法1: 直接使用window.open
|
|
|
+ const newWindow = window.open(appStoreUrl, '_blank');
|
|
|
+
|
|
|
+ // 如果新窗口被阻止,尝试其他方法
|
|
|
+ if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') {
|
|
|
+ // 方法2: 尝试使用itms-apps协议
|
|
|
+ this.tryItmsProtocol();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 尝试使用itms-apps协议
|
|
|
+ tryItmsProtocol() {
|
|
|
+ const itmsUrl = 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188';
|
|
|
+
|
|
|
+ // 创建一个隐藏的iframe来尝试打开itms-apps协议
|
|
|
+ const iframe = document.createElement('iframe');
|
|
|
+ iframe.style.display = 'none';
|
|
|
+ iframe.style.width = '1px';
|
|
|
+ iframe.style.height = '1px';
|
|
|
+ iframe.src = itmsUrl;
|
|
|
+ document.body.appendChild(iframe);
|
|
|
+
|
|
|
+ // 设置超时,如果App Store没有打开,则回退到浏览器
|
|
|
+ setTimeout(() => {
|
|
|
+ if (document.body.contains(iframe)) {
|
|
|
+ document.body.removeChild(iframe);
|
|
|
+ }
|
|
|
+ // 最后回退到浏览器打开
|
|
|
+ window.location.href = 'https://apps.apple.com/cn/app/cte/id6468907188';
|
|
|
+ }, 1500);
|
|
|
+ },
|
|
|
+
|
|
|
//选择和领取红包卡券
|
|
|
getHbkaq() {
|
|
|
console.log('1212------------------')
|
|
|
@@ -479,34 +1000,16 @@
|
|
|
this.$refs.draw.share_qrcode(this.option);
|
|
|
},
|
|
|
shouchang() {
|
|
|
- this.addcollect();
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
callPhone() {
|
|
|
- var that = this;
|
|
|
- uni.showModal({
|
|
|
- title: that.$t('api.message'),
|
|
|
- content: that.$t('api.nqdbddh'),
|
|
|
- cancelText: that.$t('order.quxiao'),
|
|
|
- confirmText: that.$t('comp.queren'),
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) { //这里是点击了确定以后
|
|
|
- console.log(that.mendianMs.telephone)
|
|
|
- plus.device.dial(that.mendianMs.telephone, false);
|
|
|
- } else { //这里是点击了取消以后
|
|
|
- console.log('用户点击取消')
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
gengduozx() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/shanpinxungou/shangjia/gengduozhixun?mendid=' + this.id
|
|
|
- })
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
pinglunList() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/pinglun/pingLunList?mendid=' + this.id
|
|
|
- })
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
fenleiSel(e) {
|
|
|
console.log(e);
|
|
|
@@ -516,59 +1019,13 @@
|
|
|
},
|
|
|
shangpinsl(id) {
|
|
|
//选择商品
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/shanpinxungou/shangpin/shangpinxiangqing?id=' + id + '&isShangjia=' +
|
|
|
- this
|
|
|
- .isShangjia
|
|
|
- })
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
gotoGouwuche() {
|
|
|
- if (!this.showbt) {
|
|
|
- uni.showToast({
|
|
|
- title: this.$t('comp.qingxzsp'),
|
|
|
- icon: 'none',
|
|
|
- duration: 2500
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/OrderList/buy/gouwuche'
|
|
|
- })
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
gotojiesuan() {
|
|
|
- if (this.mendianMs.state == 1) {
|
|
|
- uni.showToast({
|
|
|
- title: this.$t('mend.statedy'),
|
|
|
- icon: 'none',
|
|
|
- duration: 2500
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.showbt) {
|
|
|
- uni.showToast({
|
|
|
- title: this.$t('comp.qingxzsp'),
|
|
|
- icon: 'none',
|
|
|
- duration: 2500
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- var token = uni.getStorageSync("token");
|
|
|
- //console.log('2222',token)
|
|
|
- // if (token == '' || token == undefined || token == null) {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/UserCenter/LoginView'
|
|
|
- // })
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- //不需要登录给userId默认值0
|
|
|
- if (!this.userid) {
|
|
|
- this.userid = 0
|
|
|
- }
|
|
|
- uni.setStorageSync('JSfoodlist', this.gouwuche.foodlist);
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/OrderList/buy/jiesuanYe?mendid=' + this.id + '&userid=' + this.userid
|
|
|
- })
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
//pop------------------------------------------
|
|
|
popfenlei() {
|
|
|
@@ -752,9 +1209,7 @@
|
|
|
},
|
|
|
jiangouwuche(e) {
|
|
|
//跳转购物车
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/OrderList/buy/gouwuche'
|
|
|
- })
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
|
|
|
jiagouwuche(e) {
|
|
|
@@ -799,13 +1254,7 @@
|
|
|
}
|
|
|
},
|
|
|
editSKU(index) {
|
|
|
- this.spindex = index;
|
|
|
- var sp = this.shangpingoumaiS[this.current][index];
|
|
|
- //this.skuGuige=sp.shangpin.sku;
|
|
|
- this.spindexSP = sp;
|
|
|
- this.showpop = true;
|
|
|
- console.log('<<<<<<', this.shangpinlist[index]);
|
|
|
- //this.$refs.popup.open();
|
|
|
+ this.showDownloadAppModal();
|
|
|
},
|
|
|
gettempSKU(foodSku) {
|
|
|
var selectsku = [];
|
|
|
@@ -1089,4 +1538,105 @@
|
|
|
.withpophbkq {
|
|
|
width: 80%;
|
|
|
}
|
|
|
+
|
|
|
+ /* 下载app弹窗样式 */
|
|
|
+ .download-popup-content {
|
|
|
+ width: 600rpx;
|
|
|
+ background-color: white;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-header {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 40rpx 40rpx 20rpx 40rpx;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-title {
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ text-align: center;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-close {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-radius: 0 16rpx 0 8rpx;
|
|
|
+ background-color: #ff4444;
|
|
|
+ }
|
|
|
+
|
|
|
+ .close-icon {
|
|
|
+ font-size: 40rpx;
|
|
|
+ color: white;
|
|
|
+ line-height: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-body {
|
|
|
+ padding: 20rpx 40rpx 40rpx 40rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-text {
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #666;
|
|
|
+ line-height: 1.5;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-buttons {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ border-top: 1rpx solid #f0f0f0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-btn {
|
|
|
+ flex: 1;
|
|
|
+ height: 100rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-btn:not(:last-child)::after {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: 1rpx;
|
|
|
+ background-color: #f0f0f0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-btn-ios {
|
|
|
+ background-color: white;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-btn-android {
|
|
|
+ background-color: white;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-btn-text {
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-btn-ios .download-popup-btn-text {
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .download-popup-btn-android .download-popup-btn-text {
|
|
|
+ color: #007AFF;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
</style>
|