Initial commit: queue workspace

Made-with: Cursor
This commit is contained in:
apple
2026-03-21 02:55:24 +08:00
commit 78de918c37
12388 changed files with 1840126 additions and 0 deletions

View File

@@ -0,0 +1,338 @@
<template>
<view class="evaluateWtapper" :style="colorStyle">
<!-- 商品详情 -->
<view class="pt-24 pb-24 pl-32 pr-32 flex-between-center" v-if="replyCon.product"
@click="details(replyCon.product)">
<image class="w-104 h-104 rd-16rpx" :src="replyCon.product.image"></image>
<view class="ml-24 w-462 line2 text--w111-333 fs-28 lh-40rpx">{{replyCon.product.store_name}}</view>
<view class="flex-center w-56 h-56 rd-28rpx cart_border ml-40">
<text class="iconfont icon-ic_ShoppingCart1 text-primary-con"></text>
</view>
</view>
<!-- 评价内容卡片 -->
<view class="bg--w111-fff rd-24rpx pt-32 pb-32 pl-56 pr-56 mt-24" v-if="replyCon.reply">
<view class="flex-between-center">
<view class="flex-y-center">
<view class="flex-y-center">
<view class="w-64 h-64 rd-32rpx relative" :class="{'svip-border': replyCon.user.vip_status}">
<image :src="replyCon.reply.avatar" class="w-full h-full rd-28rpx"></image>
<image class="vip-badge" src="@/static/img/svip_badge.png" v-show="replyCon.user.vip_status"></image>
</view>
<text class="fs-28 text--w111-333 pl-12">{{replyCon.reply.nickname}}</text>
</view>
<view class="vip flex-center" v-if="replyCon.user.level_name">
<text class="iconfont icon-huiyuandengji"></text>
V{{replyCon.user.level_name}}
</view>
</view>
<view class="fs-26 text--w111-999">{{replyCon.reply.add_time}}</view>
</view>
<view class="mt-32">
<view class="flex-y-center">
<view class="flex pr-40">
<text class="iconfont icon-ic_star1 fs-18 text-primary-con"
v-for="item in Number(replyCon.star)" :key="item"></text>
</view>
<text class="fs-22 text--w111-999 pro_name relative" v-if="replyCon.reply.suk">{{replyCon.reply.suk }}</text>
</view>
</view>
<view class="mt-24 fs-28 text--w111-333 lh-44rpx">{{replyCon.reply.comment}}</view>
<image :src="pic" v-for="(pic,i) in replyCon.reply.pics" :key="i" class="w-full mt-20 rd-16rpx"
mode="widthFix"></image>
<view class="mt-24">
<text class="fs-22 text--w111-999">浏览{{replyCon.reply.views_num}}</text>
</view>
</view>
<view class="bg--w111-fff rd-24rpx pt-32 pb-32 pl-56 pr-56 mt-24">
<view class="text--w111-333 fs-28 fw-500">{{replyNum}}条回复</view>
<view class="reply_box pb-24" v-for="(item,index) in replyList" :key="index">
<view class="flex justify-between items-baseline">
<view class="flex-y-center mt-32">
<view class="w-64 h-64 rd-32rpx relative" :class="{'svip-border': item.user.vip_status}">
<image class="w-full h-full rd-50-p111-" :src="item.user.avatar" v-if="item.uid && item.user"></image>
<image class="w-full h-full rd-50-p111-" src="../static/store.png" v-if="!item.uid"></image>
<image class="w-full h-full rd-50-p111-" src="@/static/images/f.png" v-if="!item.user"></image>
<image class="vip-badge" src="@/static/img/svip_badge.png" v-show="item.user.vip_status"></image>
</view>
<view class="flex-col pl-16">
<view class="flex-y-center">
<text class="text--w111-333 fs-24"
:class="!item.uid ? 'text_score':''">{{item.user?item.user.nickname:'用户'}}</text>
<view class="store_badge flex-center fs-18" v-if="!item.uid">商家</view>
<view class="vip flex-center" v-if="item.user.level_name">
<text class="iconfont icon-huiyuandengji"></text>
V{{item.user.level_name}}
</view>
</view>
<view class="fs-26 text--w111-999">{{item.create_time}}</view>
</view>
</view>
<view class="flex-y-center" :class="item.is_praise ? 'font-num':''">
<text class="iconfont icon-ic_Like fs-32" @click="praise(item)"></text>
<text class="fs-22 pl-8">{{item.praise}}</text>
</view>
</view>
<view class="mt-24 fs-26 text--w111-333 lh-44rpx pb-24">{{item.content}}</view>
</view>
</view>
<view class="h-120 pb-safe"></view>
<view class="page_footer fixed-lb w-full bg--w111-fff pr-20 pb-safe">
<view class="pl-32 pr-24 h-96 flex-between-center">
<view class="w-498 h-64 rd-32rpx bg--w111-f5f5f5 pl-24 flex-y-center text--w111-999 px-20"
@tap="showInput = true">
<text class="iconfont icon-ic_edit"></text>
<text class="fs-26 pl-16">说说你的看法吧</text>
</view>
<view class="flex-y-center pl-28">
<view :class="replyCon.is_praise ? 'text-primary-con':''">
<text class="iconfont icon-ic_Like"
@click="tapPraise"></text>
<text class="fs-22 pl-8">{{replyCon.reply?replyCon.reply.praise:0}}</text>
</view>
<view class="pl-32">
<text class="iconfont icon-ic_message"></text>
<text class="fs-22 pl-8">{{replyCon.reply ? replyCon.reply.comment_sum : 0}}</text>
</view>
</view>
</view>
</view>
<tui-drawer mode="bottom" :visible="showInput" background-color="transparent" mask maskClosable @close="closeDrawer">
<view class="w-full bg--w111-fff drawer-text pt-16 pl-32 pr-32">
<view class="bg--w111-f5f5f5 flex justify-between items-end rd-32rpx pt-8 pr-8 pb-8 pl-24 relative">
<textarea class="w-528 fs-28 h-auto"
:auto-height="true"
wrap-style="wrap"
max-height="100px"
placeholder-class='placeholder'
placeholder="说说你的看法吧"
:always-embed="true"
:adjust-position="true"
cursor-spacing="85rpx"
v-model="con"
:maxlength="150"
name="mark">
</textarea>
<view class="w-96 h-48 rd-24rpx flex-center bg-color text--w111-fff fs-24 ml-24"
@tap="sendText">发送</view>
</view>
</view>
</tui-drawer>
<home></home>
</view>
</template>
<script>
import {
getReplyInfo,
getReplyComment,
postReplyPraise,
replyComment,
postUnReplyPraise,
getReplyPraise,
getUnReplyPraise
} from '@/api/store.js';
import tuiDrawer from "@/components/tui-drawer/tui-drawer.vue"
import colors from '@/mixins/color.js';
export default {
components: {
tuiDrawer
},
mixins: [colors],
data: function() {
return {
id: 0,
page: 1,
limit: 200,
replyCon: {},
replyList: [],
con: '',
scrollTop: 0,
replyNum: 0,
showInput:false
};
},
onLoad(options) {
this.id = options.id
this.getInfo();
this.getList();
},
onShow() {
uni.removeStorageSync('form_type_cart');
},
methods: {
tapPraise() {
if (this.replyCon.is_praise) {
getUnReplyPraise(this.id).then(res => {
this.replyCon.is_praise = !this.replyCon.is_praise
this.replyCon.reply.praise = this.replyCon.reply.praise - 1
return this.$util.Tips({
title: res.msg
});
});
} else {
getReplyPraise(this.id).then(res => {
this.replyCon.is_praise = !this.replyCon.is_praise
this.replyCon.reply.praise = this.replyCon.reply.praise + 1
return this.$util.Tips({
title: res.msg
});
});
}
},
// 设置页面滚动位置
setPageScrollTo() {
let view = uni
.createSelectorQuery()
.in(this)
.select('#tops');
view.boundingClientRect(res => {
this.scrollTop = parseFloat(res.height);
}).exec();
},
sendText() {
if (!this.con.trim()) {
return this.$util.Tips({
title: '说点什么呗'
});
}
replyComment(this.id, {
content: this.con
}).then(res => {
let that = this;
this.con = '';
that.showInput = false;
this.replyNum = this.replyNum + 1;
this.getList();
this.$util.Tips({
title: res.msg
});
})
},
details(info) {
if(info.is_presale_product){
uni.navigateTo({
url: `/pages/activity/goods_details/index?id=${info.id}&type=6`
})
}else{
uni.navigateTo({
url: `/pages/goods_details/index?id=${info.id}`
})
}
},
getInfo() {
getReplyInfo(this.id).then(res => {
this.replyCon = res.data;
this.replyNum = this.replyCon.reply.comment_sum;
})
},
getList() {
getReplyComment(this.id, {
page: this.page,
limit: this.limit
}).then(res => {
this.replyList = res.data
}).catch(err => {
return this.$util.Tips({
title: err.msg
});
})
},
getpreviewImage: function(index) {
uni.previewImage({
urls: this.replyCon.reply.pics,
current: this.replyCon.reply.pics[index]
});
},
praise(item) {
if (item.is_praise) {
postUnReplyPraise(item.id).then(res => {
item.is_praise = !item.is_praise
item.praise = item.praise - 1
return this.$util.Tips({
title: res.msg
});
});
} else {
postReplyPraise(item.id).then(res => {
item.is_praise = !item.is_praise
item.praise = item.praise + 1
return this.$util.Tips({
title: res.msg
});
});
}
},
closeDrawer(){
this.showInput = false;
}
},
onPageScroll(object) {
uni.$emit('scroll');
},
}
</script>
<style lang="scss">
.cart_border {
border: 1px solid var(--view-theme);
}
.text-primary-con {
color: var(--view-theme);
}
.text_score {
color: #FAAD14;
}
.store_badge {
width: 48rpx;
height: 26rpx;
background: #FAAD14;
border-radius: 4rpx;
color: #fff;
margin-left: 8rpx;
}
.vip{
width: 64rpx;
height: 26rpx;
background: #FEF0D9;
border: 1px solid #FACC7D;
border-radius: 50rpx;
font-size: 18rpx;
font-weight: 500;
color: #DFA541;
margin-left: 10rpx;
.iconfont {
font-size: 16rpx;
margin-right: 4rpx;
}
}
.svip-border{
border: 2rpx solid #F1BB0D;
}
.vip-badge{
position: absolute;
top: -10rpx;
left: 36rpx;
width: 18rpx;
height: 18rpx;
}
.drawer-text{
padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
}
.pro_name::before {
content: '';
width: 1px;
height: 18rpx;
background-color: #ccc;
position: absolute;
left: -20rpx;
top: 8rpx;
}
.reply_box~.reply_box {
border-top: 1px solid #ddd;
}
</style>

View File

@@ -0,0 +1,336 @@
<template>
<view :style="colorStyle">
<view class="px-20">
<view class="h-120 bg--w111-fff rd-24rpx mt-24 pl-24 flex-y-center">
<text class="fs-28 fw-500 mr-32">商品评价</text>
<view class="flex-y-center">
<view class="flex-y-center nav-item" v-for="(item, index) in replyNav" :key="index"
@tap="replyNavChange(item.value)">
<image :src=" reply_score == item.value ? item.activePic : item.pic" class="w-44 h-44"></image>
<text class="fs-32 pl-14"
:class="reply_score == item.value ? 'font-num' : 'text--w111-999'">{{item.title}}</text>
</view>
</view>
</view>
<view class="bg--w111-fff rd-24rpx mt-20 pt-32 pr-24 pb-32 pl-24">
<view class="flex-y-center pb-40 bb-e">
<image :src="productInfo.attrInfo ? productInfo.attrInfo.image : productInfo.image" class="w-88 h-88 rd-16rpx"></image>
<view class="pl-20 flex-1">
<view class="fs-28 lh-40rpx line1 w-538">{{productInfo.store_name}}</view>
<view v-if='send_gift_type != 2' class="fs-32 SemiBold mt-12">{{productInfo.attrInfo?productInfo.attrInfo.price:productInfo.price}}</view>
</view>
</view>
<view class="pt-40">
<textarea placeholder='商品满足你的期待么?说说你的想法,分享给想买的他们吧~(最多输入100个字)' v-model="comment" name="comment" placeholder-class='placeholder' maxlength='100' class="fs-26 lh-40rpx"></textarea>
<view class="grid-column-4 grid-gap-24rpx">
<view class="relative h-148" v-for="(item,index) in pics" :key="index">
<image :src="item" mode="aspectFill" class="w-148 h-148 rd-16rpx"></image>
<view class="abs-rt w-32 h-32 of0b21 flex-center fs-24" @click="DelPic(index)">
<text class="iconfont icon-ic_close text--w111-fff"></text>
</view>
</view>
<view class="h-148 flex-col flex-center upload bg--w111-f5f5f5 rd-16rpx"
@click='uploadpic' v-if="pics.length < 8">
<image class="w-48 h-48" src="../static/ic_camera.png"></image>
<text class="fs-24 lh-34rpx pt-8">上传图片</text>
</view>
</view>
</view>
<view class="flex-y-center pt-26" v-if="community_status">
<text class="iconfont fs-32" :class="is_sync ? 'icon-a-ic_CompleteSelect' : 'icon-ic_unselect'"
@tap="checkSync"></text>
<text class="fs-24 pl-8">评论晒图</text>
</view>
</view>
<view class="bg--w111-fff rd-24rpx mt-20 pt-32 pr-24 pb-32 pl-24">
<view class="flex-y-center">
<text class="fs-28 fw-500">商品质量</text>
<view class="ml-40 flex">
<text class="star iconfont text--w111-999"
:class="item <= product_score ? 'icon-ic_star1 font-num' : 'icon-ic_star'"
v-for="(item, index) in starArr" :key="index" @click="stars(0,item)"></text>
</view>
</view>
<view class="flex-y-center mt-40">
<text class="fs-28 fw-500">服务态度</text>
<view class="ml-40 flex">
<text class="star iconfont text--w111-999"
:class="item <= service_score ? 'icon-ic_star1 font-num' : 'icon-ic_star'"
v-for="(item, index) in starArr" :key="index" @click="stars(1,item)"></text>
</view>
</view>
<!-- delivery_score -->
<view class="flex-y-center mt-40">
<text class="fs-28 fw-500">物流服务</text>
<view class="ml-40 flex">
<text class="star iconfont text--w111-999"
:class="item <= delivery_score ? 'icon-ic_star1 font-num' : 'icon-ic_star'"
v-for="(item, index) in starArr" :key="index" @click="stars(2,item)"></text>
</view>
</view>
</view>
</view>
<view class="h-120"></view>
<view class='fixed-lb w-full bg--w111-fff pb-safe'>
<view class="mx-20 h-120 flex-center">
<view class="w-full h-80 rd-40rpx flex-center text--w111-fff fs-28"
:class="isSelectStar ? 'bg-color' : 'bg-hui'"
@tap="formSubmit">提交</view>
</view>
</view>
<canvas canvas-id="canvas" v-if="canvasStatus"
:style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
</view>
</template>
<script>
import {orderProduct,orderComment} from '@/api/order.js';
import { getCommunityConfig } from "@/api/community.js"
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
import colors from "@/mixins/color";
import { HTTP_REQUEST_URL } from '@/config/app';
export default {
components: {},
mixins: [colors],
data() {
return {
imgHost: HTTP_REQUEST_URL,
pics: [],
replyNav:[
{
title:'好评',
pic: HTTP_REQUEST_URL + '/statics/images/product/product_reply_icon1_0.png',
activePic:HTTP_REQUEST_URL + '/statics/images/product/product_reply_icon1.png',
value:3,
},
{
title:'中评',
pic: HTTP_REQUEST_URL + '/statics/images/product/product_reply_icon2_0.png',
activePic: HTTP_REQUEST_URL + '/statics/images/product/product_reply_icon2.png',
value:2,
},
{
title:'差评',
pic: HTTP_REQUEST_URL + '/statics/images/product/product_reply_icon3_0.png',
activePic: HTTP_REQUEST_URL + '/statics/images/product/product_reply_icon3.png',
value:1,
}
],
orderId: '',
unique: '',
productInfo: {},
cart_num: 0,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
canvasWidth: "",
canvasHeight: "",
canvasStatus: false,
product_score:-1,
service_score:-1,
delivery_score: -1,
reply_score:3,
comment:"",
starArr:[1,2,3,4,5],
is_sync:0,
community_status:1,
canvasWidth:'',
canvasHeight:''
};
},
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
// #ifndef MP
this.getOrderProduct();
// #endif
}
},
deep: true
}
},
computed:{
...mapGetters(['isLogin']),
isSelectStar(){
if(this.product_score >= 0 && this.service_score >= 0 && this.delivery_score >= 0 && this.comment ){
return true
}
}
},
onLoad(options) {
if (!options.unique || !options.uni) return this.$util.Tips({
title: '缺少参数'
}, {
tab: 3,
url: 1
});
this.unique = options.unique;
this.orderId = options.uni;
this.send_gift_type = options.send_gift_type;
if (this.isLogin) {
this.getOrderProduct();
this.getConfig();
}
},
onShow() {
uni.removeStorageSync('form_type_cart');
},
methods: {
getConfig(){
getCommunityConfig().then(res=>{
this.community_status = res.data.community_status;
})
},
getOrderProduct: function() {
let that = this;
orderProduct(that.unique).then(res => {
that.$set(that, 'productInfo', res.data.productInfo);
that.cart_num = res.data.cart_num;
});
},
stars: function(type, star) {
if(type == 0){
this.product_score = star;
}else if(type == 1){
this.service_score = star;
}else {
this.delivery_score = star;
}
},
replyNavChange(value){
this.reply_score = value;
},
checkSync(){
if(this.is_sync){
this.is_sync = 0;
}else{
this.is_sync = 1;
}
},
/**
* 删除图片
*
*/
DelPic: function(index) {
let that = this,
pic = this.pics[index];
that.pics.splice(index, 1);
that.$set(that, 'pics', that.pics);
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
this.canvasStatus = true
that.$util.uploadImageChange({count:8,url:'upload/image'}, function(res) {
that.pics.push(res.data.url);
}, (res) => {
this.canvasStatus = false
}, (res) => {
this.canvasWidth = res.w
this.canvasHeight = res.h
});
},
/**
* 立即评价
*/
formSubmit: function() {
let that = this;
if (!this.comment) return that.$util.Tips({
title: '请填写你对宝贝的心得!'
});
if(!this.isSelectStar) return that.$util.Tips({
title: '请完成打分!'
});
if(this.community_status && this.is_sync && !this.pics.length) return that.$util.Tips({
title: '请上传要分享的图片!'
});
let o8e37 = {
reply_score: this.reply_score,
product_score: this.product_score,
service_score: this.service_score,
delivery_score: this.delivery_score,
pics: this.pics,
unique: this.unique,
comment: this.comment,
is_sync: this.is_sync
};
uni.showLoading({
title: "正在发布评论……"
});
orderComment(o8e37).then(res => {
uni.hideLoading();
let jumpPath = res.data.to_lottery ?
'/pages/goods/goods_comment_con/lottery_comment?type=4&order_id=' + that
.orderId : '/pages/goods/order_details/index?order_id=' + that.orderId
let obj = {
tab: 3,
url: 1
};
let pages = getCurrentPages();
if (pages[pages.length - 3]) {
if (pages[pages.length - 3].route == 'pages/goods/order_pay_status/index') {
obj.tab = 5;
obj.url = '/pages/goods/order_list/index';
}
}
if (res.data.to_lottery) {
obj.tab = 5;
obj.url = '/pages/goods/goods_comment_con/lottery_comment?type=4&order_id=' + that.orderId
}
that.$util.Tips({
title: '感谢您的评价!',
icon: 'success'
}, obj);
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
});
}
}
}
</script>
<style lang="scss" scoped>
.SemiBold {
font-family: SemiBold;
}
.good-pic{
width: 54rpx;
height: 59rpx;
}
.nav-item ~ .nav-item{
margin-left: 38rpx;
}
.bb-e{
border-bottom: 1px solid #eee;
}
.placeholder{
color: #ccc;
font-size: 26rpx;
line-height: 40rpx;
}
.upload{
border: 1px dashed #ccc;
}
.of0b21{
background-color: #999;
border-radius: 0 16rpx 0 16rpx;
}
.star ~ .star{
margin-left: 24rpx;
}
.bg-hui{
background-color: #ccc;
}
.icon-a-ic_CompleteSelect{
color: var(--view-theme);
}
</style>

View File

@@ -0,0 +1,263 @@
<template>
<view :style="colorStyle">
<view class="w-full fixed-lt z-99 bg-gradient" :style="{'padding-top': sysHeight + 'px'}">
<view class="w-full px-20 pl-20 h-80 flex-between-center">
<text class="iconfont icon-ic_leftarrow fs-40 text--w111-fff"></text @tap="goIndex">
<text class="fs-34 fw-500 text--w111-fff">评价抽奖</text>
<text></text>
</view>
<view class="flex-col flex-center mt-50">
<view class="flex-y-center">
<text class="iconfont icon-ic-complete1 fs-52 text--w111-fff"></text>
<text class="fs-40 fw-500 text--w111-fff pl-16">评价完成</text>
</view>
<view class="flex-center mt-30">
<view class="w-192 h-64 rd-40rpx flex-center fs-24 text--w111-fff white-border" @tap="goBack">返回订单</view>
<view class="w-192 h-64 rd-40rpx flex-center fs-24 text--w111-fff white-border ml-32" @tap="goIndex">返回首页</view>
</view>
</view>
<view class="h-216"></view>
</view>
<view class="relative content bg--w111-fff w-full pt-32 pl-20 pr-20 z-999" :style="{'top': 164 + sysHeight + 'px'}">
<view class="card bg--w111-fff rd-24rpx h-544 pt-32 pl-20 pr-20"
v-show="lotteryShow && prize.length">
<gridsLottery
:prizeData="prize"
:lotteryNum="lottery_num"
:lotteryType='1'
:datatime="datatime"
@get_winingIndex='getWiningIndex'
@luck_draw_finish='luck_draw_finish' >
</gridsLottery>
</view>
</view>
<lotteryAleart
:aleartStatus="aleartStatus"
theme
:alData="alData"
:aleartType="aleartType"
@close="closeLottery" >
</lotteryAleart>
<view class="mask z-8000" v-if="aleartStatus" @tap="lotteryAleartClose"></view>
<home></home>
</view>
</template>
<script>
let sysHeight = uni.getWindowInfo().statusBarHeight;
import countDown from '@/components/countDown';
import gridsLottery from '../components/lottery/payLottery.vue'
import lotteryAleart from '../components/lotteryAleart/index.vue'
import colors from "@/mixins/color";
import {
openOrderSubscribe
} from '@/utils/SubscribeMessage.js';
import {
toLogin
} from '@/libs/login.js';
import {
getLotteryData,
startLottery,
receiveLottery
} from '@/api/lottery.js'
import {
mapGetters
} from "vuex";
import {HTTP_REQUEST_URL} from '@/config/app';
export default {
components: {
gridsLottery,
lotteryAleart,
countDown
},
mixins: [colors],
computed: mapGetters(['isLogin']),
data() {
return {
sysHeight:sysHeight,
lotteryShow: false,
addressModel: false,
lottery_num: 0,
aleartType: 0,
aleartStatus: false,
lottery_draw_param: {
startIndex: 3, //开始抽奖位置从0开始
totalCount: 3, //一共要转的圈数
winingIndex: 1, //中奖的位置从0开始
speed: 100 //抽奖动画的速度 [数字越大越慢,默认100]
},
alData: {},
type: '',
prize: [],
orderId: '',
order_pay_info: {
paid: 1,
_status: {}
},
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
couponsHidden: true,
couponList: [],
datatime:0,
imgHost:HTTP_REQUEST_URL
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
// this.getOrderPayInfo();
}
},
deep: true
}
},
onLoad(options) {
this.orderId = options.order_id;
this.type = options.type;
if (this.isLogin) {
// this.getOrderPayInfo();
this.getLotteryData(this.type)
}
// #ifdef H5
document.addEventListener('visibilitychange', (e) => {
let state = document.visibilityState
if (state == 'hidden') {
}
if (state == 'visible') {
// this.getOrderPayInfo();
}
});
// #endif
},
onShow() {
uni.removeStorageSync('form_type_cart');
if(!this.isLogin){
toLogin()
}
},
methods: {
getWiningIndex(callback) {
this.aleartType = 0
startLottery({
id: this.id
}).then(res => {
this.prize.forEach((item, index) => {
if (res.data.id === item.id) {
this.alData = res.data
this.lottery_draw_param.winingIndex = index;
callback(this.lottery_draw_param);
}
})
}).catch(err => {
this.$util.Tips({
title: err
});
})
},
/**
* 去首页关闭当前所有页面
*/
goIndex: function(e) {
uni.switchTab({
url: '/pages/index/index'
});
},
goBack(){
uni.navigateBack()
},
getLotteryData(type) {
getLotteryData(type).then(res => {
this.lotteryShow = true;
this.factor_num = res.data.lottery.factor_num;
this.id = res.data.lottery.id;
this.prize = res.data.lottery.prize
if(this.prize.length){
this.prize.push({name:1})
};
this.lottery_num = res.data.lottery_num;
this.datatime = parseInt(res.data.cache_time);
}).catch(err => {
uni.redirectTo({
url: '/pages/goods/order_details/index?order_id=' + this.orderId
})
})
},
closeLottery(status) {
this.aleartStatus = false
this.getLotteryData(this.type)
if (this.alData.type === 6) {
this.addressModel = true
}
},
getWiningIndex(callback) {
this.aleartType = 0
startLottery({
id: this.id
}).then(res => {
this.prize.forEach((item, index) => {
if (res.data.id === item.id) {
this.alData = res.data
this.lottery_draw_param.winingIndex = index;
callback(this.lottery_draw_param);
}
})
}).catch(err => {
this.$util.Tips({
title: err
});
})
// //props修改在小程序和APP端不成功所以在这里使用回调函数传参
},
// 抽奖完成
luck_draw_finish(param) {
this.aleartType = 2
this.aleartStatus = true
},
}
}
</script>
<style lang="scss" scoped>
.fs-52{
font-size:52rpx;
}
.white-border{
border: 1px solid #fff;
}
.ml-48{
margin-left: 48rpx;
}
.h-216{
height:216rpx;
}
.h-544{
height:544rpx;
}
.content{
background: #f5f5f5;
border-radius: 40rpx 40rpx 0 0;
left:0;
min-height:500rpx;
}
.card ~ .card{
margin-top: 20rpx;
}
.h-76{
height:76rpx;
}
.cell ~ .cell {
border-top: 1px solid #eee;
}
.card_btn{
width: 114rpx;
height: 52rpx;
border-radius: 26rpx;
border: 1px solid #E93323;
}
.z-8000{
z-index: 8000;
}
</style>