提交
This commit is contained in:
parent
d7d879e71e
commit
e5b33085bd
8
App.vue
8
App.vue
|
|
@ -1,5 +1,8 @@
|
|||
|
||||
<script>
|
||||
import Vue from "vue";
|
||||
// 引入全局预览弹窗方法
|
||||
import '@/components/detail-preview-popup/index.js';
|
||||
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
|
|
@ -187,7 +190,10 @@ button.hide {
|
|||
</style>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<!-- 全局预览组件 -->
|
||||
<detail-preview-popup></detail-preview-popup>
|
||||
|
||||
<!-- 主应用容器 -->
|
||||
<view>
|
||||
<slot></slot>
|
||||
|
|
|
|||
|
|
@ -1,168 +1,234 @@
|
|||
<!--
|
||||
* @Date: 2023-11-21 09:31:27
|
||||
* @LastEditTime: 2023-12-02 11:28:07
|
||||
* @Description: content
|
||||
-->
|
||||
<template>
|
||||
<uni-popup ref="_buy_notice" type="center" :is-mask-click="false">
|
||||
<uni-popup ref="_buy_notice" type="center" :is-mask-click="false">
|
||||
<view class="_buy_notice">
|
||||
|
||||
<view class=""
|
||||
style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; padding-top: 42rpx; padding-bottom: 42rpx; align-items: center;">
|
||||
<view style="width: 24rpx; height: 24rpx; margin-left: 32rpx;"></view>
|
||||
<view class="">平台消费规则</view>
|
||||
<image :src="$img('/static/img/close2.png')" @click="close"
|
||||
style="width: 24rpx; height: 24rpx; margin-right: 32rpx;" lazy-load></image>
|
||||
<!-- 头部标题区域 -->
|
||||
<view class="notice-header">
|
||||
<view class="placeholder"></view>
|
||||
<view class="title">平台消费规则</view>
|
||||
<image :src="$img('/static/img/close2.png')" @click="close" class="close-icon" lazy-load></image>
|
||||
</view>
|
||||
|
||||
<scroll-view class="_buy_notice_bd" scroll-y>
|
||||
<!-- 内容区域 -->
|
||||
<scroll-view class="notice-content" scroll-y>
|
||||
<view v-html="ruleData.content"></view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="center" style="width: 100%; margin-top: 28rpx;">
|
||||
<view class="center"
|
||||
style="background-color: #D8FD24; width: 434rpx; height: 76rpx; border-radius: 16rpx; font-size: 24rpx;"
|
||||
@click="confirm">
|
||||
<!-- 确认按钮 -->
|
||||
<view class="confirm-button-wrapper">
|
||||
<view class="confirm-button" @click="confirm">
|
||||
<text>同意规则并继续支付</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="center" style="width: 100%; margin-top: 28rpx;">
|
||||
<view @click="isAgree = !isAgree" class=""
|
||||
style=" height: 25rpx; display: flex; flex-direction: row; align-items: center;">
|
||||
<view class="" style="padding-top: 5rpx;">
|
||||
<image style="width: 30rpx; height: 30rpx;" v-if="isAgree" :src="$img1('common/check_act.png')"
|
||||
lazy-load></image>
|
||||
|
||||
<image style="width: 30rpx; height: 30rpx;" v-else :src="$img1('common/check.png')" lazy-load>
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<text style=" color: #D3D3D3; font-size: 20rpx; margin-left: 12rpx;">不再弹出消费规则</text>
|
||||
<!-- 不再提示选项 -->
|
||||
<view class="remember-option">
|
||||
<view class="checkbox" @click="isAgree = !isAgree">
|
||||
<image class="checkbox-icon" :src="isAgree ? $img1('common/check_act.png') : $img1('common/check.png')
|
||||
" lazy-load></image>
|
||||
<text class="checkbox-text">{{
|
||||
getPurchasePopup() ? "今日不再弹出消费规则" : "不再弹出消费规则"
|
||||
}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAgree: false,
|
||||
ruleData: ''
|
||||
export default {
|
||||
name: "BuyNotice",
|
||||
data() {
|
||||
return {
|
||||
isAgree: false,
|
||||
ruleData: {
|
||||
title: "",
|
||||
content: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
getPurchasePopup() {
|
||||
try {
|
||||
var _purchase_popup = this.$config.getAppSetting("purchase_popup");
|
||||
if (_purchase_popup != null && _purchase_popup === "1") {
|
||||
return true;
|
||||
}
|
||||
} catch (error) { }
|
||||
return false;
|
||||
},
|
||||
/**
|
||||
* 确认按钮点击处理
|
||||
*/
|
||||
confirm() {
|
||||
this.close();
|
||||
|
||||
// 如果用户选择不再提示,则保存到本地存储
|
||||
if (this.isAgree) {
|
||||
if (this.getPurchasePopup()) {
|
||||
uni.setStorageSync("_agree_buy_notice_time", new Date().toLocaleDateString());
|
||||
uni.setStorageSync("_agree_buy_notice", 2);
|
||||
} else {
|
||||
uni.setStorageSync("_agree_buy_notice_time", "");
|
||||
uni.setStorageSync("_agree_buy_notice", 1);
|
||||
}
|
||||
}
|
||||
// 触发确认事件
|
||||
this.$emit("confirm");
|
||||
},
|
||||
|
||||
methods: {
|
||||
confirm() {
|
||||
this.close()
|
||||
if (this.isAgree) {
|
||||
uni.setStorageSync('_agree_buy_notice', true)
|
||||
}
|
||||
this.$emit('confirm')
|
||||
},
|
||||
/**
|
||||
* 关闭弹窗
|
||||
*/
|
||||
close() {
|
||||
this.$refs._buy_notice.close();
|
||||
},
|
||||
|
||||
close() {
|
||||
this.$refs._buy_notice.close()
|
||||
},
|
||||
|
||||
open(opt) {
|
||||
this.ruleData = opt
|
||||
|
||||
this.$refs._buy_notice.open()
|
||||
},
|
||||
|
||||
async getRule(id, title = '') {
|
||||
let res = await this.$c.getRule(id, true)
|
||||
|
||||
this.open({
|
||||
title: title,
|
||||
content: res.data
|
||||
})
|
||||
/**
|
||||
* 打开弹窗并设置数据
|
||||
* @param {Object} opt 弹窗数据
|
||||
*/
|
||||
open(opt) {
|
||||
this.ruleData = opt;
|
||||
this.$refs._buy_notice.open();
|
||||
},
|
||||
getIsShow() {
|
||||
var _agree_buy_notice = uni.getStorageSync("_agree_buy_notice")
|
||||
if (_agree_buy_notice == null || _agree_buy_notice == "") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//判断是否配置了今天不在弹出
|
||||
if (this.getPurchasePopup()) {
|
||||
//判断时间
|
||||
var newd = new Date().toLocaleDateString();
|
||||
let _agree_buy_notice_time = uni.getStorageSync("_agree_buy_notice_time");
|
||||
if (_agree_buy_notice_time == newd) {
|
||||
//今日弹出
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (_agree_buy_notice == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取规则内容并打开弹窗
|
||||
* @param {Number} id 规则ID
|
||||
* @param {String} title 规则标题
|
||||
*/
|
||||
async getRule(id, title = "") {
|
||||
try {
|
||||
const res = await this.$c.getRule(id, true);
|
||||
if (res && res.status === 1) {
|
||||
this.open({
|
||||
title: title || "平台消费规则",
|
||||
content: res.data,
|
||||
});
|
||||
} else {
|
||||
console.error("获取规则失败:", res);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取规则异常:", error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
._buy_notice {
|
||||
width: 650rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 30rpx;
|
||||
._buy_notice {
|
||||
width: 650rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 30rpx;
|
||||
|
||||
._buy_notice_hd {
|
||||
height: 140rpx;
|
||||
font-size: 50rpx;
|
||||
font-family: YouSheBiaoTiHei;
|
||||
color: #FFFFFF;
|
||||
// 头部样式
|
||||
.notice-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 42rpx 32rpx;
|
||||
|
||||
.placeholder {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
._buy_notice_bd {
|
||||
height: 828rpx;
|
||||
width: 570rpx;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 60rpx;
|
||||
|
||||
font-size: 30rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #D3D3D3;
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
._buy_notice_agree {
|
||||
margin-top: 30rpx;
|
||||
padding: 0 40rpx;
|
||||
display: flex;
|
||||
|
||||
.check {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
font-size: 26rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #d0d1ff;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
._buy_notice_ft {
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
border-top: 1rpx solid #333;
|
||||
margin-top: 30rpx;
|
||||
|
||||
._buy_notice_ft_btn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #dddddd;
|
||||
}
|
||||
|
||||
.confirm {
|
||||
border-left: 1rpx solid #333;
|
||||
|
||||
text {
|
||||
color: transparent;
|
||||
background: #F6C0FF;
|
||||
background-clip: text;
|
||||
}
|
||||
}
|
||||
.close-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.common_bg {}
|
||||
// 内容区域样式
|
||||
.notice-content {
|
||||
height: 828rpx;
|
||||
width: 570rpx;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 60rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
|
||||
// 确认按钮样式
|
||||
.confirm-button-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
margin-top: 28rpx;
|
||||
|
||||
.confirm-button {
|
||||
background-color: #d8fd24;
|
||||
width: 434rpx;
|
||||
height: 76rpx;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
// 不再提示选项样式
|
||||
.remember-option {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
margin-top: 28rpx;
|
||||
|
||||
.checkbox {
|
||||
height: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.checkbox-icon {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.checkbox-text {
|
||||
color: #d3d3d3;
|
||||
font-size: 20rpx;
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -103,10 +103,24 @@ export default {
|
|||
this.innerProductType = this.productType;
|
||||
this.innerProbability = this.probability;
|
||||
this.innerExtraInfo = this.extraInfo;
|
||||
|
||||
// 监听全局预览事件
|
||||
uni.$on('global-preview-event', this.handleGlobalEvent);
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 组件销毁前移除事件监听
|
||||
uni.$off('global-preview-event', this.handleGlobalEvent);
|
||||
},
|
||||
methods: {
|
||||
// 处理全局预览事件
|
||||
handleGlobalEvent(options) {
|
||||
console.log('收到全局预览事件', options);
|
||||
this.setPreviewData(options);
|
||||
},
|
||||
|
||||
// 设置预览数据并打开弹窗
|
||||
setPreviewData(data) {
|
||||
console.log('设置预览数据', data);
|
||||
if (!data) return;
|
||||
|
||||
// 更新内部数据
|
||||
|
|
@ -123,17 +137,27 @@ export default {
|
|||
|
||||
// 打开弹窗
|
||||
open() {
|
||||
console.log('尝试打开弹窗');
|
||||
console.log('尝试打开弹窗', this.$refs.popup);
|
||||
this.visible = true;
|
||||
|
||||
// 使用nextTick确保DOM更新后再打开弹窗
|
||||
this.$nextTick(() => {
|
||||
console.log('DOM已更新,准备打开弹窗');
|
||||
if (this.$refs.popup) {
|
||||
this.$refs.popup.open();
|
||||
console.log('弹窗已打开');
|
||||
// 小程序环境下需要额外延迟
|
||||
setTimeout(() => {
|
||||
this.$refs.popup.open();
|
||||
console.log('弹窗已打开');
|
||||
}, 50);
|
||||
} else {
|
||||
console.error('popup ref不存在,请检查组件是否正确挂载');
|
||||
// 延迟后再次尝试
|
||||
setTimeout(() => {
|
||||
if (this.$refs.popup) {
|
||||
this.$refs.popup.open();
|
||||
console.log('弹窗已打开(延迟尝试)');
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
73
components/detail-preview-popup/index.js
Normal file
73
components/detail-preview-popup/index.js
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import Vue from 'vue'
|
||||
|
||||
/**
|
||||
* 全局商品预览弹窗方法
|
||||
* @param {Object} options 预览参数
|
||||
* @param {String} options.title 商品标题
|
||||
* @param {String} options.imgUrl 商品图片地址
|
||||
* @param {String} options.tipTitle 商品标签
|
||||
* @param {String} options.productType 商品类型
|
||||
* @param {String} options.probability 商品概率
|
||||
* @param {Array} options.extraInfo 额外信息
|
||||
* @returns {Promise} 返回Promise
|
||||
*/
|
||||
const preview = function(options = {}) {
|
||||
return new Promise((resolve) => {
|
||||
// 获取当前页面
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
|
||||
// 尝试获取全局预览组件
|
||||
let previewComponent = null;
|
||||
|
||||
// 尝试在App.vue中找到全局组件
|
||||
try {
|
||||
const app = getApp();
|
||||
if (app.$vm && app.$vm.$children) {
|
||||
// 在App.vue的子组件中查找
|
||||
for (const child of app.$vm.$children) {
|
||||
if (child.$options.name === 'DetailPreviewPopup') {
|
||||
previewComponent = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取全局组件失败', e);
|
||||
}
|
||||
|
||||
// 如果没找到全局组件,尝试在当前页面找
|
||||
if (!previewComponent && currentPage && currentPage.$vm) {
|
||||
try {
|
||||
// 查找页面中的预览组件
|
||||
const pageVm = currentPage.$vm;
|
||||
for (const child of pageVm.$children) {
|
||||
if (child.$options.name === 'DetailPreviewPopup') {
|
||||
previewComponent = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取页面组件失败', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果还是没找到组件,发送全局事件
|
||||
if (!previewComponent) {
|
||||
console.log('未找到组件实例,发送全局事件');
|
||||
uni.$emit('global-preview-event', options);
|
||||
setTimeout(() => resolve(), 500);
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用找到的组件
|
||||
console.log('找到预览组件,直接调用');
|
||||
previewComponent.setPreviewData(options);
|
||||
setTimeout(() => resolve(previewComponent), 300);
|
||||
});
|
||||
};
|
||||
|
||||
// 挂载到Vue原型上
|
||||
Vue.prototype.$preview = preview;
|
||||
|
||||
export default preview;
|
||||
|
|
@ -699,7 +699,7 @@ export default {
|
|||
if (type == 1) {
|
||||
url = "orderbuy";
|
||||
|
||||
if (!uni.getStorageSync("_agree_buy_notice") && !fromNotice) {
|
||||
if (this.$refs.buyNotice.getIsShow()&& !fromNotice) {
|
||||
this.$refs.buyNotice.getRule(6);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -757,7 +757,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (!uni.getStorageSync('_agree_buy_notice') && !fromNotice) {
|
||||
if (this.$refs.buyNotice.getIsShow() && !fromNotice) {
|
||||
this.$refs.buyNotice.getRule(6)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,62 +3,37 @@
|
|||
-->
|
||||
<template>
|
||||
<view class="content">
|
||||
<view
|
||||
class="navLeft align-center"
|
||||
:style="{ top: $sys().statusBarHeight + 'px' }"
|
||||
@tap="$c.back(1)"
|
||||
>
|
||||
<view class="navLeft align-center" :style="{ top: $sys().statusBarHeight + 'px' }" @tap="$c.back(1)">
|
||||
<uni-icons type="left" color="#000000"></uni-icons>
|
||||
<view class="" style="color: #000000; margin-left: 240rpx">
|
||||
{{ $c.detailPageTitle((pageData && pageData.goods) || "") }}
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="header relative"
|
||||
v-if="pageData && pageData.goods"
|
||||
:style="{
|
||||
background:
|
||||
'url(' + pageData.goods.imgurl_detail + ') no-repeat 0 0 / 100% 100%',
|
||||
}"
|
||||
>
|
||||
<view class="header relative" v-if="pageData && pageData.goods" :style="{
|
||||
background:
|
||||
'url(' + pageData.goods.imgurl_detail + ') no-repeat 0 0 / 100% 100%',
|
||||
}">
|
||||
<view class="header-wuzhe flex" v-if="pageData.goods.is_shou_zhe == 1">
|
||||
<image
|
||||
class="img100"
|
||||
:src="$img1('common/chouBanjia.png')"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<image class="img100" :src="$img1('common/chouBanjia.png')" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="header-goodsTitel">{{ pageData.goods.title }}</view>
|
||||
<view
|
||||
class="header-suoxiang center"
|
||||
v-if="
|
||||
pageData.goods.lock_is == 1 &&
|
||||
pageData.lock_info.goods_lock_surplus_time > 0
|
||||
"
|
||||
>
|
||||
<image
|
||||
:src="pageData.lock_info.goods_lock_user_headimg"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view class="header-suoxiang center" v-if="
|
||||
pageData.goods.lock_is == 1 &&
|
||||
pageData.lock_info.goods_lock_surplus_time > 0
|
||||
">
|
||||
<image :src="pageData.lock_info.goods_lock_user_headimg" mode="aspectFill"></image>
|
||||
<view class="hidden ml10">{{
|
||||
pageData.lock_info.goods_lock_user_nickname
|
||||
}}</view>
|
||||
<image
|
||||
class="ml20"
|
||||
:src="$img1('index/suoxiang.png')"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<image class="ml20" :src="$img1('index/suoxiang.png')" mode="aspectFit"></image>
|
||||
<view class="ml30">倒计时:{{ secNum }}S</view>
|
||||
</view>
|
||||
<view
|
||||
class="header-title center"
|
||||
:style="{
|
||||
background:
|
||||
'url(' +
|
||||
$img1('common/chouTitle.png') +
|
||||
') no-repeat 0 0 / 100% 100%',
|
||||
}"
|
||||
>
|
||||
<view class="header-title center" :style="{
|
||||
background:
|
||||
'url(' +
|
||||
$img1('common/chouTitle.png') +
|
||||
') no-repeat 0 0 / 100% 100%',
|
||||
}">
|
||||
<text>
|
||||
<template></template>
|
||||
</text>
|
||||
|
|
@ -71,22 +46,12 @@
|
|||
<template v-if="pageData.goods.type != 5">/含明信片</template>
|
||||
</text>
|
||||
</view>
|
||||
<collect-btn
|
||||
v-if="pageData && pageData.goods"
|
||||
:goods-id="pageData.goods.id"
|
||||
:goods-num="pageData.goods.num"
|
||||
:is-collected="pageData.goods.collection_is"
|
||||
@collection-changed="onCollectionChanged"
|
||||
></collect-btn>
|
||||
<collect-btn v-if="pageData && pageData.goods" :goods-id="pageData.goods.id" :goods-num="pageData.goods.num"
|
||||
:is-collected="pageData.goods.collection_is" @collection-changed="onCollectionChanged"></collect-btn>
|
||||
</view>
|
||||
<!--选项卡-->
|
||||
<detail-toolbar
|
||||
:goods-type="pageData.goods.type"
|
||||
:current-tab="tabCur"
|
||||
@rule-click="handleRuleClick"
|
||||
@tab-change="tabChange"
|
||||
@change-box="changeBox"
|
||||
></detail-toolbar>
|
||||
<detail-toolbar :goods-type="pageData.goods.type" :current-tab="tabCur" @rule-click="handleRuleClick"
|
||||
@tab-change="tabChange" @change-box="changeBox"></detail-toolbar>
|
||||
<view class="spylView" v-if="tabCur == 1 && pageData">
|
||||
<view class="spylView-head align-center justify-between">
|
||||
<view class="column align-center" @click="prev">
|
||||
|
|
@ -99,15 +64,13 @@
|
|||
<text :style="{ width: '80%' }"></text>
|
||||
</view>
|
||||
<view class="align-center justify-between" v-if="pageData.goods">
|
||||
<view class="align-center"
|
||||
>第 <text>{{ pageData.goods.num }}</text> /{{
|
||||
pageData.goods.stock
|
||||
<view class="align-center">第 <text>{{ pageData.goods.num }}</text> /{{
|
||||
pageData.goods.stock
|
||||
}}箱
|
||||
</view>
|
||||
<view>赏品余量</view>
|
||||
<view class="align-center">
|
||||
<text>{{ pageData.goods.goodslist_surplus_stock }}</text
|
||||
>/{{ pageData.goods.goodslist_stock }}
|
||||
<text>{{ pageData.goods.goodslist_surplus_stock }}</text>/{{ pageData.goods.goodslist_stock }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -119,25 +82,15 @@
|
|||
</view>
|
||||
<!-- 赏品列表 -->
|
||||
<view class="list">
|
||||
<view
|
||||
class="list-item"
|
||||
v-for="(item, i) in pageData.goodslist"
|
||||
:key="i"
|
||||
@click="previewDetail(item)"
|
||||
>
|
||||
<view class="list-item" v-for="(item, i) in pageData.goodslist" :key="i" @click="previewDetail(item)">
|
||||
<view class="pic center relative">
|
||||
<image class="pic-img" :src="item.imgurl" mode="aspectFit"></image>
|
||||
<view
|
||||
class="type-tag center"
|
||||
:style="{
|
||||
background: item.shang_info ? item.shang_info.color : '#FFFFFF',
|
||||
}"
|
||||
>
|
||||
<view class="type-tag center" :style="{
|
||||
background: item.shang_info ? item.shang_info.color : '#FFFFFF',
|
||||
}">
|
||||
{{ item.shang_info ? item.shang_info.title : "" }}
|
||||
</view>
|
||||
<view class="num center bgfff"
|
||||
>{{ item.surplus_stock }}/{{ item.stock }}</view
|
||||
>
|
||||
<view class="num center bgfff">{{ item.surplus_stock }}/{{ item.stock }}</view>
|
||||
<view v-if="item.goods_type == 2" class="yu-tag ziti">预售</view>
|
||||
<view v-if="item.surplus_stock <= 0" class="shadow center">
|
||||
<image :src="$img1('common/sold_out.png')"></image>
|
||||
|
|
@ -148,58 +101,32 @@
|
|||
</view>
|
||||
<view class="desc">{{ item.pro }}</view>
|
||||
<view class="price">
|
||||
<text
|
||||
>售价:¥ <text style="font-size: 24rpx">{{ item.sc_money }}</text>
|
||||
<text>售价:¥ <text style="font-size: 24rpx">{{ item.sc_money }}</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="tabCur == 2">
|
||||
<mescroll-body
|
||||
ref="mescrollRef"
|
||||
@init="mescrollInit"
|
||||
@down="downCallback"
|
||||
@up="getLog"
|
||||
:down="downOption"
|
||||
:up="upOption"
|
||||
>
|
||||
<detail-prize-log
|
||||
:sub-tab="subTab"
|
||||
:log-list="logList"
|
||||
:current-sub-tab="subTabCur"
|
||||
@sub-tab-change="subTabChange"
|
||||
></detail-prize-log>
|
||||
<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="getLog" :down="downOption"
|
||||
:up="upOption">
|
||||
<detail-prize-log :sub-tab="subTab" :log-list="logList" :current-sub-tab="subTabCur"
|
||||
@sub-tab-change="subTabChange"></detail-prize-log>
|
||||
</mescroll-body>
|
||||
</template>
|
||||
<view v-if="pageData" class="ft-fixed justify-evenly">
|
||||
<view
|
||||
class="btn common_bg column center"
|
||||
v-if="getBtnXianShi(1)"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtn1.png')})` }"
|
||||
@click="confirmSubmit([0, 1])"
|
||||
>
|
||||
<view class="btn common_bg column center" v-if="getBtnXianShi(1)"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtn1.png')})` }" @click="confirmSubmit([0, 1])">
|
||||
</view>
|
||||
<view
|
||||
class="btn common_bg column center"
|
||||
v-if="getBtnXianShi(3)"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtn3.png')})` }"
|
||||
@click="confirmSubmit([0, 3])"
|
||||
>
|
||||
<view class="btn common_bg column center" v-if="getBtnXianShi(3)"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtn3.png')})` }" @click="confirmSubmit([0, 3])">
|
||||
</view>
|
||||
<view
|
||||
class="btn common_bg column center"
|
||||
v-if="getBtnXianShi(5)"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtn5.png')})` }"
|
||||
@click="confirmSubmit([0, 5])"
|
||||
>
|
||||
<view class="btn common_bg column center" v-if="getBtnXianShi(5)"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtn5.png')})` }" @click="confirmSubmit([0, 5])">
|
||||
</view>
|
||||
<view
|
||||
class="btn common_bg column center"
|
||||
v-if="pageData.goods.type != 5 && getBtnXianShi(0)"
|
||||
<view class="btn common_bg column center" v-if="pageData.goods.type != 5 && getBtnXianShi(0)"
|
||||
:style="{ backgroundImage: `url(${$img1('common/chouBtnAll.png')})` }"
|
||||
@click="confirmSubmit([0, pageData.goods.goodslist_surplus_stock])"
|
||||
>
|
||||
@click="confirmSubmit([0, pageData.goods.goodslist_surplus_stock])">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -209,11 +136,7 @@
|
|||
<view class="" style="width: 60rpx"></view>
|
||||
<text class="" style="font-size: 28rpx">确认订单</text>
|
||||
<view class="close icon" @click="close('buyPop')">
|
||||
<image
|
||||
:src="$img('/static/img/close2.png')"
|
||||
style="width: 24rpx; height: 24rpx"
|
||||
lazy-load
|
||||
>
|
||||
<image :src="$img('/static/img/close2.png')" style="width: 24rpx; height: 24rpx" lazy-load>
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -221,10 +144,7 @@
|
|||
<view class="buy-card">
|
||||
<view class="buy-info">
|
||||
<view class="pic flex">
|
||||
<image
|
||||
class="img100"
|
||||
:src="orderData.goods.imgurl_detail"
|
||||
></image>
|
||||
<image class="img100" :src="orderData.goods.imgurl_detail"></image>
|
||||
</view>
|
||||
|
||||
<view class="info-r">
|
||||
|
|
@ -234,12 +154,10 @@
|
|||
|
||||
<view class="type">类型:明信片</view>
|
||||
|
||||
<template
|
||||
v-if="
|
||||
orderData.goods.is_shou_zhe == 1 &&
|
||||
orderData.goods.shou_zhe_price * 1 > 0
|
||||
"
|
||||
>
|
||||
<template v-if="
|
||||
orderData.goods.is_shou_zhe == 1 &&
|
||||
orderData.goods.shou_zhe_price * 1 > 0
|
||||
">
|
||||
<view class="price-num">
|
||||
<view class="price">
|
||||
<template v-if="pageData.goods.type != 5">¥</template>
|
||||
|
|
@ -275,8 +193,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="line"></view> -->
|
||||
</view>
|
||||
|
||||
<template v-if="pageData.goods.type != 5">
|
||||
|
|
@ -296,23 +212,6 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="card-row" @click="$c.to({ url: '/pages/user/vip' })">
|
||||
<view class="title">
|
||||
{{
|
||||
orderData.zhe
|
||||
? `会员折扣 (${orderData.zhe}折)`
|
||||
: '暂无会员抵扣'
|
||||
}}
|
||||
</view>
|
||||
|
||||
<view class="row-r">
|
||||
详情
|
||||
|
||||
<view class="icon">
|
||||
<image :src="$img1('common/right1.png')" lazy-load></image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</template>
|
||||
|
||||
<!-- <view v-if="!(pageData.goods.type == 6 && !getBtnXianShi(0))" class="pay-title ziti">请选择抵扣方式</view> -->
|
||||
|
|
@ -327,11 +226,7 @@
|
|||
</view>
|
||||
|
||||
<view class="icon">
|
||||
<image
|
||||
v-if="true"
|
||||
:src="$img1('common/check_act.png')"
|
||||
lazy-load
|
||||
></image>
|
||||
<image v-if="true" :src="$img1('common/check_act.png')" lazy-load></image>
|
||||
|
||||
<image v-else :src="$img1('common/check.png')" lazy-load></image>
|
||||
</view>
|
||||
|
|
@ -351,11 +246,7 @@
|
|||
</view>
|
||||
|
||||
<view class="icon">
|
||||
<image
|
||||
v-if="useIntegral"
|
||||
:src="$img1('common/check_act.png')"
|
||||
lazy-load
|
||||
></image>
|
||||
<image v-if="useIntegral" :src="$img1('common/check_act.png')" lazy-load></image>
|
||||
|
||||
<image v-else :src="$img1('common/check.png')" lazy-load></image>
|
||||
</view>
|
||||
|
|
@ -372,11 +263,7 @@
|
|||
</view>
|
||||
|
||||
<view class="icon">
|
||||
<image
|
||||
v-if="useMoney"
|
||||
:src="$img1('common/check_act.png')"
|
||||
lazy-load
|
||||
></image>
|
||||
<image v-if="useMoney" :src="$img1('common/check_act.png')" lazy-load></image>
|
||||
|
||||
<image v-else :src="$img1('common/check.png')" lazy-load></image>
|
||||
</view>
|
||||
|
|
@ -389,11 +276,7 @@
|
|||
</view>
|
||||
<view class="agree" @click="isAgree = !isAgree">
|
||||
<view class="icon">
|
||||
<image
|
||||
v-if="isAgree"
|
||||
:src="$img1('common/check_act.png')"
|
||||
lazy-load
|
||||
></image>
|
||||
<image v-if="isAgree" :src="$img1('common/check_act.png')" lazy-load></image>
|
||||
|
||||
<image v-else :src="$img1('common/check.png')" lazy-load></image>
|
||||
</view>
|
||||
|
|
@ -409,10 +292,7 @@
|
|||
</text>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="pay-btn"
|
||||
@click="$c.noDouble1(confirmSubmit, [1, buyNum], choujiangloading)"
|
||||
>
|
||||
<view class="pay-btn" @click="$c.noDouble1(confirmSubmit, [1, buyNum], choujiangloading)">
|
||||
<text>确认支付</text>
|
||||
<text>{{
|
||||
pageData.goods.type == 5
|
||||
|
|
@ -423,16 +303,9 @@
|
|||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<buy-notice
|
||||
ref="buyNotice"
|
||||
@confirm="$c.noDouble(confirmSubmit, [1, buyNum, true], choujiangloading)"
|
||||
></buy-notice>
|
||||
|
||||
<uni-popup
|
||||
ref="resPop"
|
||||
type="center"
|
||||
mask-background-color="rgba(0,0,0,0.8)"
|
||||
>
|
||||
<buy-notice ref="buyNotice" @confirm="$c.noDouble(confirmSubmit, [1, buyNum, true], choujiangloading)"></buy-notice>
|
||||
<!--中奖动画-->
|
||||
<uni-popup ref="resPop" type="center" mask-background-color="rgba(0,0,0,0.8)">
|
||||
<view v-if="prizeData" class="res-pop common_bg column center">
|
||||
<view class="res-pop-hd"></view>
|
||||
<scroll-view class="res-pop-bd" scroll-y>
|
||||
|
|
@ -446,35 +319,21 @@
|
|||
<view class="title hang1 flex center">
|
||||
<text> {{ item.goodslist_title }}</text>
|
||||
</view>
|
||||
<!-- <view class="exchange">
|
||||
{{
|
||||
item.goodslist_money * 1 > 0
|
||||
? `可兑换:${item.goodslist_money}`
|
||||
: `不可兑换`
|
||||
}}
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="res-pop-ft mt20">
|
||||
<view
|
||||
class="ft-btn common_bg justify-center center"
|
||||
:style="{
|
||||
backgroundImage: `url(${$img1('common/quhegui.png')})`,
|
||||
}"
|
||||
@click="toBag"
|
||||
>
|
||||
<view class="ft-btn common_bg justify-center center" :style="{
|
||||
backgroundImage: `url(${$img1('common/quhegui.png')})`,
|
||||
}" @click="toBag">
|
||||
<text>去发货</text>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="ft-btn common_bg justify-center center"
|
||||
:style="{
|
||||
backgroundImage: `url(${$img1('common/jixuchou.png')})`,
|
||||
}"
|
||||
@click="close('resPop')"
|
||||
>
|
||||
<view class="ft-btn common_bg justify-center center" :style="{
|
||||
backgroundImage: `url(${$img1('common/jixuchou.png')})`,
|
||||
}" @click="close('resPop')">
|
||||
<text>继续抽</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -488,7 +347,6 @@
|
|||
<coupon-pop ref="couponPop"></coupon-pop>
|
||||
<!-- 添加直接引用的预览组件 -->
|
||||
<detail-preview-popup ref="localPreviewPopup"></detail-preview-popup>
|
||||
<!-- 全局预览组件已在App.vue中全局添加 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -614,16 +472,17 @@ export default {
|
|||
methods: {
|
||||
previewDetail(item) {
|
||||
console.log(item);
|
||||
// 使用新的setPreviewData方法而不是直接修改props
|
||||
if (this.$refs.localPreviewPopup) {
|
||||
this.$refs.localPreviewPopup.setPreviewData({
|
||||
title: item.title,
|
||||
imgUrl: item.imgurl,
|
||||
tipTitle: item.shang_info ? item.shang_info.title : '',
|
||||
productType: this.optData.type_text,
|
||||
probability: item.pro
|
||||
});
|
||||
}
|
||||
|
||||
// 使用全局方法调用预览弹窗
|
||||
this.$preview({
|
||||
title: item.title,
|
||||
imgUrl: item.imgurl,
|
||||
tipTitle: item.shang_info ? item.shang_info.title : '',
|
||||
productType: this.optData.type_text,
|
||||
probability: item.pro
|
||||
}).then(() => {
|
||||
console.log('预览弹窗打开成功');
|
||||
});
|
||||
},
|
||||
|
||||
resetSec() {
|
||||
|
|
@ -717,7 +576,7 @@ export default {
|
|||
if (type == 1) {
|
||||
url = "orderbuy";
|
||||
|
||||
if (!uni.getStorageSync("_agree_buy_notice") && !fromNotice) {
|
||||
if (this.$refs.buyNotice.getIsShow() && !fromNotice) {
|
||||
this.$refs.buyNotice.getRule(6);
|
||||
return;
|
||||
}
|
||||
|
|
@ -735,7 +594,6 @@ export default {
|
|||
use_money_is: this.useMoney ? 1 : 2,
|
||||
use_integral_is: this.useIntegral ? 1 : 2,
|
||||
coupon_id: (this.couponData && this.couponData.id) || "",
|
||||
// ad_id: uni.getStorageSync('_ad_id')
|
||||
};
|
||||
|
||||
if (this.pageData.goods.type == 5) {
|
||||
|
|
@ -978,7 +836,7 @@ export default {
|
|||
z-index: 100;
|
||||
height: 44px;
|
||||
|
||||
> view {
|
||||
>view {
|
||||
// font-family: YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
font-size: 50rpx;
|
||||
|
|
@ -1025,26 +883,26 @@ export default {
|
|||
bottom: 390rpx;
|
||||
z-index: 2;
|
||||
|
||||
> image:nth-of-type(1) {
|
||||
>image:nth-of-type(1) {
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
border: 2rpx solid #ffffff;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
> image:nth-of-type(2) {
|
||||
>image:nth-of-type(2) {
|
||||
width: 144rpx;
|
||||
height: 68rpx;
|
||||
}
|
||||
|
||||
> view:nth-of-type(1) {
|
||||
>view:nth-of-type(1) {
|
||||
width: 140rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
> view:nth-of-type(2) {
|
||||
>view:nth-of-type(2) {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #ffffff;
|
||||
|
|
@ -1060,13 +918,13 @@ export default {
|
|||
transform: translateX(-50%);
|
||||
bottom: 78rpx;
|
||||
|
||||
> text:nth-child(2n + 1) {
|
||||
>text:nth-child(2n + 1) {
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
> text:nth-child(2) {
|
||||
>text:nth-child(2) {
|
||||
font-weight: 700;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
|
|
@ -1088,7 +946,7 @@ export default {
|
|||
bottom: 0;
|
||||
z-index: 1;
|
||||
|
||||
> image {
|
||||
>image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
@ -1103,7 +961,7 @@ export default {
|
|||
bottom: 0;
|
||||
z-index: 1;
|
||||
|
||||
> image {
|
||||
>image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
@ -1117,7 +975,7 @@ export default {
|
|||
right: 160rpx;
|
||||
bottom: 0;
|
||||
|
||||
> image {
|
||||
>image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
@ -1131,7 +989,7 @@ export default {
|
|||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
> image {
|
||||
>image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
@ -1147,8 +1005,8 @@ export default {
|
|||
padding: 24rpx 30rpx;
|
||||
width: 750rpx;
|
||||
|
||||
> view:nth-child(2n + 1) {
|
||||
> view:nth-child(1) {
|
||||
>view:nth-child(2n + 1) {
|
||||
>view:nth-child(1) {
|
||||
width: 74rpx;
|
||||
height: 56rpx;
|
||||
background: #f5f5f5;
|
||||
|
|
@ -1156,7 +1014,7 @@ export default {
|
|||
// border: 2rpx solid #000000;
|
||||
}
|
||||
|
||||
> view:nth-child(2) {
|
||||
>view:nth-child(2) {
|
||||
margin-top: 8rpx;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
|
|
@ -1165,29 +1023,29 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
> view:nth-child(2) {
|
||||
>view:nth-child(2) {
|
||||
width: 420rpx;
|
||||
|
||||
> view:nth-child(1) {
|
||||
>view:nth-child(1) {
|
||||
width: 420rpx;
|
||||
height: 14rpx;
|
||||
border-radius: 40rpx;
|
||||
|
||||
> text {
|
||||
>text {
|
||||
height: 14rpx;
|
||||
border-radius: 40rpx;
|
||||
background: #cdf022;
|
||||
}
|
||||
}
|
||||
|
||||
> view:nth-child(2) {
|
||||
>view:nth-child(2) {
|
||||
padding: 14rpx 30rpx 0;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
|
||||
> view {
|
||||
> text {
|
||||
>view {
|
||||
>text {
|
||||
font-family: YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
|
|
@ -1277,7 +1135,7 @@ export default {
|
|||
background: rgba(0, 0, 0, 0.6);
|
||||
border-radius: 24rpx;
|
||||
|
||||
> image {
|
||||
>image {
|
||||
width: 86rpx;
|
||||
height: 156rpx;
|
||||
}
|
||||
|
|
@ -1354,7 +1212,7 @@ export default {
|
|||
height: 68rpx;
|
||||
position: relative;
|
||||
|
||||
> view {
|
||||
>view {
|
||||
white-space: nowrap;
|
||||
font-family: YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
|
|
@ -1486,8 +1344,7 @@ export default {
|
|||
color: #333333;
|
||||
}
|
||||
|
||||
.hang1 {
|
||||
}
|
||||
.hang1 {}
|
||||
|
||||
.type {
|
||||
font-size: 20rpx;
|
||||
|
|
@ -1630,11 +1487,11 @@ export default {
|
|||
font-weight: 500;
|
||||
color: #cdef27;
|
||||
|
||||
> text:nth-child(1) {
|
||||
>text:nth-child(1) {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
> text:nth-child(2) {
|
||||
>text:nth-child(2) {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
|
@ -1678,7 +1535,7 @@ export default {
|
|||
background: #d8d8d8;
|
||||
border-radius: 16rpx 16rpx 0rpx 0rpx;
|
||||
|
||||
> image {
|
||||
>image {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
border-radius: 16rpx 16rpx 0rpx 0rpx;
|
||||
|
|
@ -1691,8 +1548,7 @@ export default {
|
|||
z-index: 2;
|
||||
width: 68rpx;
|
||||
height: 32rpx;
|
||||
background: url($imgurl + "common/chouLabel.png") no-repeat 0 0 /
|
||||
100% 100%;
|
||||
background: url($imgurl + "common/chouLabel.png") no-repeat 0 0 / 100% 100%;
|
||||
font-weight: 400;
|
||||
font-size: 14rpx;
|
||||
color: #ffffff;
|
||||
|
|
@ -1743,11 +1599,11 @@ export default {
|
|||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
> view:nth-child(1) {
|
||||
>view:nth-child(1) {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
> view:nth-child(2) {
|
||||
>view:nth-child(2) {
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -853,7 +853,7 @@
|
|||
if (type == 1) {
|
||||
url = 'infinite_orderbuy'
|
||||
|
||||
if (!uni.getStorageSync('_agree_buy_notice') && !fromNotice) {
|
||||
if (this.$refs.buyNotice.getIsShow() && !fromNotice) {
|
||||
this.$refs.buyNotice.getRule(6)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user