Commit 630087b4 authored by xieyishang's avatar xieyishang

sss

parent f9a65ee2
<template>
<!-- 抽奖添加的时候的提示弹窗 -->
<!-- 带操作按钮的 -->
<view class="prizemodel">
<!-- 免费专区说明弹窗 -->
<uni-popup :show="showtip" type="center" :mask-click="true" @change="change">
<!-- <view class="uni-tip">
<text class="uni-tip-title">{{title}}</text>
<text class="uni-tip-content">{{content}}</text>
<view class="uni-tip-group-button">
<text class="uni-tip-button" @click="cancel('tip')">取消</text>
<text class="uni-tip-button" @click="cancel('tip')">我知道了</text>
</view>
</view> -->
<view class="tipboxs">
<view class="heads">
<image class="headimg" src="/static/LuckDraw/modelheads2.png" mode=""></image>
</view>
<view class="tipboxs_body">
<view class="textmsgs">您已选择了满<text class="sum">{{shuliang}}</text>人自动开奖 </view>
<view class="textmsgs">请您三思而后行</view>
<view class="submitbtns" @tap="confirm">确认发布</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue'
export default{
//props:["title","content"],
props:{
//开奖人数
shuliang:{
type:String,
default:"0",
}
},
name:"prizemodel",
components:{
uniPopup,
},
data(){
return{
showtip:false,
}
},
methods:{
cancel(type) {//关闭
this.showtip = false;
},
//提示弹窗
change(e) {
console.log('是否打开:' + e.show)
if (!e.show) {
this.showtip = false
}
},
show(){
this.showtip = true;
},
//确认发布点击
confirm(){
this.showtip = false;
this.$emit("fromSubmitfun",{});//触发回调方法
}
}
}
</script>
<style lang="scss">
.prizemodel{
width: 510upx;
}
.tipboxs{
.heads{
.headimg{
height: 300upx;
width: 100%;
}
}
.tipboxs_body{
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 7px;
margin-top: -20upx;
padding: 20upx;
padding-top: 30upx;
background: #ffffff;
text-align: center;
.textmsgs{
color:#333C4C;
font-size: 32upx;
.sum{
color:#ff6900;
}
}
.submitbtns{
font-size: 32upx;
width:411upx;
height:83upx;
line-height: 83upx;
text-align: center;
background:rgba(255,105,0,1);
border-radius:10upx;
color:#FFFFFF;
margin: 0 auto;
margin-top: 50upx;
margin-bottom: 30upx;
}
}
}
</style>
<template>
<view v-if="show" class="mask" @click="toggleMask" @touchmove.stop.prevent="stopPrevent"
:style="{backgroundColor: backgroundColor}"
>
<view
class="mask-content"
@click.stop.prevent="stopPrevent"
:style="[{
height: config.height,
transform: transform
}]"
>
<scroll-view class="view-content" scroll-y>
<view class="share-header">
分享到
</view>
<view class="share-list">
<view
v-for="(item, index) in shareList" :key="index"
class="share-item"
@click="shareToFriend(item)"
>
<image :src="item.icon" mode=""></image>
<text>{{item.text}}</text>
</view>
</view>
</scroll-view>
<view class="bottom b-t" @click="toggleMask">取消</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
transform: 'translateY(50vh)',
timer: 0,
backgroundColor: 'rgba(0,0,0,0)',
show: false,
config: {},
};
},
props:{
contentHeight:{
type: Number,
default: 0
},
//是否是tabbar页面
hasTabbar:{
type: Boolean,
default: false
},
shareList:{
type: Array,
default: function(){
return [];
}
}
},
created() {
const height = uni.upx2px(this.contentHeight) + 'px';
this.config = {
height: height,
transform: `translateY(${height})`,
backgroundColor: 'rgba(0,0,0,.4)',
}
this.transform = this.config.transform;
},
methods:{
toggleMask(){
//防止高频点击
if(this.timer == 1){
return;
}
this.timer = 1;
setTimeout(()=>{
this.timer = 0;
}, 500)
if(this.show){
this.transform = this.config.transform;
this.backgroundColor = 'rgba(0,0,0,0)';
setTimeout(()=>{
this.show = false;
this.hasTabbar && uni.showTabBar();
}, 200)
return;
}
this.show = true;
//等待mask重绘完成执行
if(this.hasTabbar){
uni.hideTabBar({
success: () => {
setTimeout(()=>{
this.backgroundColor = this.config.backgroundColor;
this.transform = 'translateY(0px)';
}, 10)
}
});
}else{
setTimeout(()=>{
this.backgroundColor = this.config.backgroundColor;
this.transform = 'translateY(0px)';
}, 10)
}
},
//防止冒泡和滚动穿透
stopPrevent(){},
//分享操作
shareToFriend(data){
// this.$api.msg(`分享给${data.type}`);
this.$emit('sharereturn',{types:data.types,text:data.text,isxcx:data.isxcx});
// sharereturn
// scene
// WXSceneSession 分享到聊天界面
// WXSenceTimeline 分享到朋友圈
// WXSceneFavorite 分享到微信收藏
this.toggleMask();
return false;
if(data.types=="WXSenceTimeline" || data.types=="WXSceneSession" && false){
//分享到朋友圈
// uni.share({
// provider: "weixin",
// scene: data.types,
// type: 1,
// href: "http://uniapp.dcloud.io/",
// title: "鹿马APP分享",
// summary: "武夷山岩茶大红袍乌龙茶浓香型中秋礼盒罐装",
// imageUrl: "https://luma.jxdsy.cn/attachs/2019/10/08/thumb_5d9c024455634.jpg",
// success: (res)=> {
// console.log("success:" + JSON.stringify(res));
// },
// fail: (err)=> {
// console.log("fail:" + JSON.stringify(err));
// }
// });
uni.share({
provider: "weixin",
scene: data.types,
type: 1,
summary: "武夷山岩茶大红袍乌龙茶浓香型中秋礼盒罐装",
success: (res)=> {
console.log("success:" + JSON.stringify(res));
},
fail: (err)=> {
console.log("fail:" + JSON.stringify(err));
}
});
// uni.share({
// provider: "weixin",
// scene:"WXSceneSession",//data.types,
// type: 2,
// imageUrl: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
// success: (res)=> {
// console.log("success:" + JSON.stringify(res));
// },
// fail: (err)=> {
// console.log("fail:" + JSON.stringify(err));
// }
// });
}else{
//分享到小程序
// uni.share({
// provider: 'weixin',
// scene: "WXSceneSession",
// type: 5,
// imageUrl: 'https://luma.jxdsy.cn/attachs/2019/10/08/thumb_5d9c024455634.jpg',
// title: '我正在使用鹿马APP,快来一起赚钱吧',
// miniProgram: {
// id: 'gh_abcdefg',
// path: 'pages/index/index',
// type: 0,
// webUrl: 'http://uniapp.dcloud.io'
// },
// success: ret => {
// console.log(JSON.stringify(ret));
// }
// });
// uni.share({
// provider: "weixin",
// scene:"WXSceneSession",//data.types,
// type: 2,
// imageUrl: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
// success: (res)=> {
// console.log("success:" + JSON.stringify(res));
// },
// fail: (err)=> {
// console.log("fail:" + JSON.stringify(err));
// }
// });
}
},
}
}
</script>
<style lang='scss'>
.mask{
position:fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
display:flex;
justify-content: center;
align-items: flex-end;
z-index: 998;
transition: .3s;
.bottom{
position:absolute;
left: 0;
bottom: 0;
display:flex;
justify-content: center;
align-items: center;
width: 100%;
height: 90upx;
background: #fff;
z-index: 9;
font-size: $font-base + 2upx;
color: $font-color-dark;
}
}
.mask-content{
width: 100%;
height: 580upx;
transition: .3s;
background: #fff;
&.has-bottom{
padding-bottom: 90upx;
}
.view-content{
height: 100%;
}
}
.share-header{
height: 110upx;
font-size: $font-base+2upx;
color: font-color-dark;
display:flex;
align-items:center;
justify-content: center;
padding-top: 10upx;
&:before, &:after{
content: '';
width: 240upx;
heighg: 0;
border-top: 1px solid $border-color-base;
transform: scaleY(.5);
margin-right: 30upx;
}
&:after{
margin-left: 30upx;
margin-right: 0;
}
}
.share-list{
display:flex;
flex-wrap: wrap;
}
.share-item{
min-width: 33.33%;
display:flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 180upx;
image{
width: 80upx;
height: 80upx;
margin-bottom: 16upx;
}
text{
font-size: $font-base;
color: $font-color-base;
}
}
</style>
......@@ -257,7 +257,47 @@
"style" : {
"navigationBarTitleText":"意见反馈"
}
},
//抽奖相关start
{
"path" : "pages/LuckDraw/send/send",
"style" : {
"navigationBarTitleText": "发起抽奖"
}
},
{
"path" : "pages/LuckDraw/preview/preview",
"style" : {
"navigationBarTitleText": "预览抽奖详情"
}
},
{
"path" : "pages/LuckDraw/homenav/homenav",
"style" : {
"navigationBarTitleText": "活动抽奖"
}
},
{
"path" : "pages/LuckDraw/LuckList/LuckList",
"style" : {
// 三个页面写在了一块 参与抽奖 发起抽奖 中奖记录
"navigationBarTitleText": ""
}
},
{
"path" : "pages/LuckDraw/LuckyDetails/LuckyDetails",
"style" : {
"navigationBarTitleText": "抽奖详情"
}
},
{
"path" : "pages/LuckDraw/PartakeUser/PartakeUser",
"style" : {
"navigationBarTitleText": "参与用户"
}
}
//抽奖相关end
],
"globalStyle": {
......
/**活动列表里面的样式*/
.LuckList{
min-height: 100vh;
background-color: #F5F1F2;
padding: 20upx 0;
}
.Luck_card{
padding: 20upx;
background: #FFFFFF;
margin: 0 24upx 20upx 24upx;
border-radius:14upx;
}
.Luck_card .thumbnail{
width: 143upx;
height: 143upx;
}
.Luck_card_r{
margin-left: 20upx;
}
.Luck_card_r .titlebox .onestatic{
font-size:32upx;
font-family:PingFang SC;
font-weight:bold;
color:rgba(0,0,0,1)
}
.Luck_card_r .titlebox .twostatic{
font-size:24upx;
color:rgba(153,153,153,1);
}
.Prizelist .Prizeitem{
font-size:32upx;
color:rgba(0,0,0,1);
margin-bottom: 6upx;
}
.Prizesysbtn{
}
.Prizesysbtn .times{
color: #999999;
font-size: 24upx;
}
.Prizesysbtn .btns .sysbtns{
width:140upx;
height:50upx;
line-height: 50upx;
text-align: center;
background:rgba(255,105,0,1);
border-radius:4upx;
font-size: 28upx;
color:#FFFFFF;
margin-left: 20upx;
}
.Prizesysbtn .btns .sysbtns1{
background: #ff0000;
color:#FFFFFF;
}
\ No newline at end of file
<template>
<!-- 活动列表 参与抽奖 发起抽奖 中奖记录 -->
<!-- 三个页面 写在一块 通过传参区分 -->
<view class="LuckList">
<!-- 参与抽奖 发起抽奖 -->
<view class="listdatas" v-if="type==0 || type==1 || type==2 || type==3">
<view @tap="tozjxq(item.lottery_id)" class="Luck_card flex " v-for="(item,index) in dataLotteryList" :key="index">
<image class="thumbnail" :src="staticUrl+item.prize[0].img" mode=""></image>
<view class="Luck_card_r flex1">
<view class="titlebox flex jus-b">
<view v-if="item.type == 1" class="onestatic">抽奖正在进行中</view>
<view v-else-if="item.type == 2" class="onestatic">已开奖</view>
<view v-else-if="item.type == 0" class="onestatic">已停止抽奖</view>
<view v-else class="onestatic">状态获取中</view>
<!-- 活动已结束 -->
<!-- 抱歉您未抽中奖品 -->
<view class="twostatic">{{item.pepole_num}}人自动开奖</view>
</view>
<view class="Prizelist">
<view class="Prizeitem oneline" v-for="(item1,index1) in item.prize" :key="index1">{{numberarr[index1]}} 等奖:{{item1.title}}</view>
</view>
</view>
</view>
</view>
<!-- edns -->
<!-- 中将记录 -->
<view class="listdatas" v-if="type==4">
<view @tap="tozjxq(item.lottery_id)" class="Luck_card flex ali-c" v-for="(item,index) in dataLotteryList" :key="index">
<image class="thumbnail" :src="staticUrl+item.img" mode=""></image>
<view class="Luck_card_r flex1">
<view class="titlebox flex jus-b">
<view class="onestatic">恭喜您抽中{{numberarr[item.grade-1]}}等奖</view>
<!-- 活动已结束 -->
<!-- 抱歉您未抽中奖品 -->
<view class="twostatic">活动已结束</view>
</view>
<view class="Prizelist">
<view class="Prizeitem oneline">{{item.title}} </view>
<view class="Prizesysbtn flex jus-b ali-c">
<!-- <view class="times">3月6日 10:20</view> -->
<view class="times oneline" v-if="item.type == 0" >中奖时间:{{item.start_time}}</view>
<view class="times oneline" v-if="item.type == 1" >领奖时间:{{item.end_time}}</view>
<view class="btns flex">
<view class="sysbtns" v-if="item.type == 0" :data-goods_id="item.goods_id" :data-win_id="item.win_id" catchtap="goShopping">点击领取</view>
<view class="sysbtns" v-if="item.type == 1" >已领奖</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {LotteryList,slotuserList} from "@/utils/api/LuckDraw.js";
export default {
data(){
return {
numberarr:["","","","","","","","","",""],
type:"",
page:0,
dataLotteryList:[],
isbottomload:true,//瀑布流开关 true 加载 false 关闭
}
},
computed: {
staticUrl () {//静态资源地址
return this.$store.state.staticUrl;
}
},
//瀑布流
onReachBottom() {
if(this.isbottomload){
this.getLotteryList();
}
},
onLoad(opdata) {
let type = opdata.type;
this.type = type;
//设置动态标题
//规则略
switch(type) {
case "0":
//代码块
uni.setNavigationBarTitle({
title:"关闭的抽奖"
})
break;
case "1":
//代码块
uni.setNavigationBarTitle({
title:"发起的抽奖"
})
break;
case "2":
//代码块
uni.setNavigationBarTitle({
title:"开奖记录"
})
break;
case "3":
//代码块
uni.setNavigationBarTitle({
title:"参与的抽奖"
})
break;
case "4":
//代码块
uni.setNavigationBarTitle({
title:"中奖记录"
})
break;
default:
//默认代码块
}
//获取列表
this.getLotteryList();
},
methods:{
//进入详情
todetailes(){
},
//查看活动详情
tozjxq(id){
uni.navigateTo({
url:"/pages/LuckDraw/LuckyDetails/LuckyDetails?id="+id,
})
},
async getLotteryList(){
this.page++;
let res = {};
if(this.type!=3 && this.type!=4){
res = await LotteryList({
limit: 10,
page:this.page,
type: this.type,
});
}else{
res = await slotuserList({
limit: 10,
page:this.page,
type: this.type,
});
}
if(res.code==0){
if(res.data.length!=0){
this.dataLotteryList = [...this.dataLotteryList,...res.data];
}else{
this.isbottomload = false;//关闭
this.$api.msg("没有更多了~");
}
}else{
this.$api.msg(res.msg);
}
},
//领取奖品
goShopping(e){
let goods_id = e.currentTarget.dataset.goods_id;
let win_id = e.currentTarget.dataset.win_id;
uni.navigateTo({
url: '/pages/product/product?id=' + goods_id + "&win_id=" + win_id + "&cate_id=0",
})
},
}
}
</script>
<style lang="scss">
@import "./LuckList.scss";
</style>
/*抽奖详情里面的*/
.LuckyDetails{
padding-bottom: 160upx;
background: #F5F1F2;
}
.flexbutton{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 88upx;
line-height: 88upx;
text-align: center;
color:#FFFFFF;
background: #ff6900;
}
.textarea1{
height: auto !important;
}
.sysbtnPartake{
}
.Partakeboxmain{
width: 100%;
height:214upx;
text-align: center;
position: relative;
}
.Partakebox{
// position: relative;
width:214upx;
height:214upx;
background:#FACEB6;
opacity:0.26;
border-radius:50%;
text-align: center;
margin: 0 auto;
position: absolute;
top: 50%;
left: 50%;
margin-left: -107upx;
//动画
animation:run 1400ms steps(1,end) infinite 0s;
-webkit-animation:run 1400ms steps(1,end) infinite 0s;
}
.sysbtnPartake .Partake{
// border:solid 27upx #F6CDB0;
// position: absolute;
margin: 0 auto;
padding-top: 38upx;
width: 187upx;
height: 187upx;
opacity:1;
background:#FF6900;
border-radius:50%;
}
.sysbtnPartake .PartakewaitFor{
background: #ccc !important;
}
.sysbtnPartake .Partake .texts{
font-size: 32upx;
color:#FFFFFF;
}
.sysbtnPartake .Partake .texts1{
margin-top: 8upx;
}
.partaketext{
margin-top: 20upx;
text-align: center;
font-size:28upx;
color:rgba(0,0,0,1);
}
.partaketext .text{
color:#ff6900;
}
.partakeuserlist{
margin-top: 15upx;
}
.partakeuserlist .usertxs{
width: 70upx;
height: 70upx;
margin: 0 10upx;
}
/**动画开始*/
@keyframes run {
0% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
20% {
width:207.25upx;
height:207.25upx;
margin-left: -103.625upx;
margin-top: -103.625upx;
}
40% {
width:200.5upx;
height:200.5upx;
margin-left: -100.25upx;
margin-top: -100.25upx;
}
60% {
width:193.75upx;
height:193.75upx;
margin-left: -96.875upx;
margin-top: -96.875upx;
}
80% {
width:187upx;
height:187upx;
margin-left: -93.5upx;
margin-top: -93.5upx;
}
100% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
}
@-webkit-keyframes run {
0% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
20% {
width:207.25upx;
height:207.25upx;
margin-left: -103.625upx;
margin-top: -103.625upx;
}
40% {
width:200.5upx;
height:200.5upx;
margin-left: -100.25upx;
margin-top: -100.25upx;
}
60% {
width:193.75upx;
height:193.75upx;
margin-left: -96.875upx;
margin-top: -96.875upx;
}
80% {
width:187upx;
height:187upx;
margin-left: -93.5upx;
margin-top: -93.5upx;
}
100% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
}
@-moz-keyframes run {
0% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
20% {
width:207.25upx;
height:207.25upx;
margin-left: -103.625upx;
margin-top: -103.625upx;
}
40% {
width:200.5upx;
height:200.5upx;
margin-left: -100.25upx;
margin-top: -100.25upx;
}
60% {
width:193.75upx;
height:193.75upx;
margin-left: -96.875upx;
margin-top: -96.875upx;
}
80% {
width:187upx;
height:187upx;
margin-left: -93.5upx;
margin-top: -93.5upx;
}
100% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
}
@-o-keyframes run {
0% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
20% {
width:207.25upx;
height:207.25upx;
margin-left: -103.625upx;
margin-top: -103.625upx;
}
40% {
width:200.5upx;
height:200.5upx;
margin-left: -100.25upx;
margin-top: -100.25upx;
}
60% {
width:193.75upx;
height:193.75upx;
margin-left: -96.875upx;
margin-top: -96.875upx;
}
80% {
width:187upx;
height:187upx;
margin-left: -93.5upx;
margin-top: -93.5upx;
}
100% {
width:214upx;
height:214upx;
margin-left: -107upx;
margin-top: -107upx;
}
}
/**动画end*/
/*中奖者名单*/
.zprize{
margin: 40upx 24upx 20upx 24upx;
border-radius:14upx;
background: #FFFFFF;
}
.zprize_item{
padding: 20upx;
}
.zprize_itembor{
border-top: 1px solid #f5f1f2;
}
.z_head{
color:#7A7A7A;
font-size: 32upx;
text-align: center;
}
.z_title{
font-size:28upx;
color:rgba(255,105,0,1);
text-align: center;
margin-bottom: 24upx;
}
.zprize_item .userlist .usertxss{
width: 62upx;
height: 62upx;
border-radius: 50%;
}
.zprize_item .userlist .usernames{
font-size:24upx;
color:rgba(0,0,0,1);
}
.zprize_item .tolist{
margin-top: 20upx;
font-size:24upx;
color:rgba(58,58,58,1);
text-align: center;
}
.zprize_item .useritem{
text-align: center;
max-width: 120upx;
overflow: hidden;
}
This diff is collapsed.
<template>
<!-- 抽奖详情 抽奖活动详情页面 -->
<!-- 中奖详情 -->
<view class="LuckyDetails">
<!-- 发布 抽奖 -->
<view class="sendpage">
<view class="send_cell_box" v-for="(item,index) in PrizeList" :key="index">
<!-- 单个输入框 -->
<view class="send_cell flex ali-c">
<view class="inputname">一等奖</view>
<view class="input_box flex1">
<view class="input">小清新60支长绒棉四件套</view>
</view>
</view>
<view class="send_cell flex ali-c">
<view class="inputname">奖品数量</view>
<view class="input_box">
<view class="input">2份</view>
</view>
</view>
<view class="send_cell flex ali-c">
<view class="inputname">中奖后下单金额</view>
<view class="input_box">
<view class="input">99.00</view>
</view>
</view>
<view class="uploadbox">
<!-- <view class="uploadbtn" @tap="uploadimgs">
<image class="unpoadimg" src="/static/LuckDraw/Prize_icon.png" mode=""></image>
<view class="btnstext">添加奖品图片</view>
</view> -->
<image class="thumbnail" src="http://pic121.huitu.com/res/20190521/2134763_20190521094542188060_1.jpg" mode=""></image>
</view>
</view>
<!-- 大卡片end -->
<!-- 抽奖说明 -->
<view class="luckmsg flex ">
<view class="titles">奖品说明</view>
<view class="textareabox flex1">
<!-- <textarea class="textarea" value="" placeholder="请填写抽奖说明" /> -->
<view class="textarea textarea1">
迎接3.8女神节,本店特推出 此次抽奖活动,中奖者即可获 得精美床单一套。
</view>
</view>
</view>
<!-- 抽奖说明end -->
<!-- 抽奖设置 -->
<view class="lucksys">
<view class="send_cell flex ali-c">
<view class="inputname">开奖方式</view>
<view class="input_box flex1 flex">
<view class="input">满6人自动开奖</view>
<view class="input ml-20">
已结束
</view>
</view>
</view>
<view class="send_cell flex ali-c send_cell_boder">
<view class="inputname">抽奖发起人</view>
<view class="input_box flex ali-c">
<image class="usertx" src="/static/missing-face.png" mode=""></image>
<view class="input">江西多思盈|鹿马108</view>
</view>
</view>
</view>
<!-- 抽奖设置end -->
<!-- 中奖者名单 -->
<view class="zprize">
<view class="zprize_item">
<view class="z_head">— 中奖者名单 —</view>
</view>
<view class="zprize_item zprize_itembor" v-for="(items,index) in 3" :key="index">
<view class="z_title">一等奖:小清新60支长绒棉四件套</view>
<view class="userlist jus-a flex">
<view class="useritem" v-for="(item,index) in 3" :key="index">
<image class="usertxss" src="/static/missing-face.png" mode=""></image>
<view class="usernames">用户名</view>
</view>
</view>
<view class="tolist">查看全部中奖名单 ></view>
</view>
</view>
<!-- 参与抽奖按钮 -->
<view class="sysbtnPartake">
<!-- 抽奖按钮end -->
<view class="partaketext">
已有<text class="text">2</text>人参与,<text class="text">查看全部></text>
</view>
<view class="partakeuserlist flex jus-c">
<image v-for="(item,index) in 3" :key="index" class="usertxs" src="/static/missing-face.png" mode=""></image>
</view>
</view>
<!-- <view class="flexbutton">分享抽奖活动</view> -->
</view>
</view>
</template>
<script>
export default {
data(){
return {
current:1,//单选选中的值
PrizeList:[
{name:"",conut:"",imgurl:"",price:""},
{name:"",conut:"",imgurl:"",price:""},
// {name:"",conut:"",imgurl:""},
// {name:"",conut:"",imgurl:""},
],//奖品列表
shuliang:"0",//开奖人数
ischecked:true,//开关
}
},
onLoad() {
},
methods:{
//开关改变后的触发事件
switch1Change(){
}
}
}
</script>
<style lang="scss">
@import "../send/send.scss";
@import "./LuckyDetails.scss";
</style>
.PartakeUser{
background: #F5F1F2;
min-height: 100vh;
padding: 20upx 0;
}
.PartakeUsercount{
padding-left: 24upx;
font-size:32upx;
color:rgba(107,107,107,1);
}
.PartakeUsercount .text{
color:#ff6900;
}
.usercardlist{
margin: 28upx 24upx 24upx 24upx;
border-radius:14upx;
background: #FFFFFF;
}
.usercard{
padding-right: 20upx;
}
.usercard .usertxs{
width:90upx;
height:91upx;
border-radius:4upx;
margin-right: 20upx;
margin-left: 20upx;
}
.usercard .usermgs{
border-bottom:2upx solid rgba(220,220,220,1);
padding: 20upx;
}
.usercard:nth-last-child(1) .usermgs{
border:0;
}
.usercard .usermgs .username{
font-size:32upx;
color:rgba(0,0,0,1);
}
.usercard .usermgs .userid{
color: #B6B6B6;
font-size:30upx;
}
\ No newline at end of file
<template>
<!-- 参与用户 和 中奖名单 -->
<!-- 两个页面 两种情况 -->
<view class="PartakeUser">
<view class="PartakeUsercount" v-if="type==1">已有{{counts}}人参与抽奖</view>
<view class="PartakeUsercount" v-if="type==2">已有{{counts}}人抽中<text class="text">{{jpname}}</text></view>
<view class="usercardlist">
<view class="usercard flex ali-c" v-for="(item,index) in userinfoList" :key="index">
<image class="usertxs" :src="item.avatar" mode=""></image>
<view class="usermgs flex1">
<view class="username">{{item.nickname}}</view>
<view class="userid">id号{{item.user_id}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {LotteryUserInfo} from "@/utils/api/LuckDraw.js";
export default {
data(){
return {
type:1,//1 参与用户 2中奖名单
lottery_id:"",//活动id
grade:"",
userinfoList:[],//用户列表
page:0,
istoload:true,//瀑布流加载开关
jpname:"",//奖品名称
counts:0,//参与人数 以及中奖人数统计
}
},
onLoad(options) {
this.type = options.type;
switch (options.type) {
case "1":
//代码块
uni.setNavigationBarTitle({
title: "参与用户"
})
break;
case "2":
//代码块
uni.setNavigationBarTitle({
title: "中奖名单"
})
break;
default:
//默认代码块
}
this.grade = options.grade;
this.lottery_id = options.lottery_id;
this.LotteryUserInfocode();
this.jpname = options.jpname;//奖品名称
},
onReachBottom() {
// if(this.istoload){
// this.LotteryUserInfocode();
// }
},
methods:{
//获取名单 以及参与名单
async LotteryUserInfocode(){
this.page++;
let res = await LotteryUserInfo({
lottery_id:this.lottery_id,
type:this.type,
grade:this.grade,
limit: 10,
page: this.page
});
if(res.code==0){
if(res.data){
this.counts = res.data.userCount;//统计人数
if(res.data.userinfo.length!=0){
this.userinfoList = [...this.userinfoList,...res.data.userinfo];
}else{
this.$api.msg("没有更多了哦~");
this.istoload = false;
}
}else{
this.$api.msg("没有更多了哦~");
}
}else{
this.$api.msg(res.msg);
}
}
}
}
</script>
<style lang="scss">
@import "./PartakeUser.scss"
</style>
.homenavpages{
background: #F5F1F2;
min-height: 100vh;
padding: 20upx 0;
// margin: 0 24upx;
}
.honenavlist{
margin: 0 24upx;
}
.send_cell{
padding: 0 20upx;
height: 88upx;
line-height: 88upx;
border-bottom: 1px solid #F4F1F2;
background: #fff;
}
.send_cell:nth-child(1){
border-radius: 14upx 14upx 0px 0px;
}
.send_cell_boder{
border-radius: 0px 0px 14upx 14upx ;
}
.send_cell .inputname{
color: #333333;
font-size: 32upx;
}
.send_cell .input_box{
margin-left: 20upx;
}
.input_box .texts{
font-size: 32upx;
}
.input_box .usertx{
width: 62upx;
height: 62upx;
border-radius: 50%;
margin-right: 20upx;
}
.input_box .uni-list-cell1{
margin-right: 20upx;
}
.input_box .jiantou_icon{
width: 13upx;
height: 24upx;
}
.input_box .textssum{
margin-right: 18upx;
color:#000000;
font-size: 30upx;
}
.send_cell .input_box .input{
font-size: 32upx;
color: #333333;
}
.linetowpad{
margin-top: 20upx;
}
\ No newline at end of file
<template>
<!-- 活动抽奖 -->
<!-- navy页面 -->
<view class="homenavpages">
<view class="honenavlist">
<view v-if="isshowall==2">
<navigator url="../send/send" class="send_cell flex ali-c">
<view class="inputname">实物抽奖</view>
<view class="input_box flex1 jus-e">
<image class="jiantou_icon" src="/static/LuckDraw/jiantou_icon.png" mode=""></image>
</view>
</navigator>
<navigator url="../LuckList/LuckList?type=0" class="send_cell flex ali-c linetowpad">
<view class="inputname">关闭抽奖</view>
<view class="input_box flex1 jus-e ali-c">
<text class="textssum">{{conutdata.closeLottery}}</text>
<image class="jiantou_icon" src="/static/LuckDraw/jiantou_icon.png" mode=""></image>
</view>
</navigator>
<navigator url="../LuckList/LuckList?type=1" class="send_cell flex ali-c ">
<view class="inputname">发起抽奖</view>
<view class="input_box flex1 jus-e ali-c">
<text class="textssum">{{conutdata.inLottery}}</text>
<image class="jiantou_icon" src="/static/LuckDraw/jiantou_icon.png" mode=""></image>
</view>
</navigator>
<navigator url="../LuckList/LuckList?type=2" class="send_cell flex ali-c">
<view class="inputname">开奖记录</view>
<view class="input_box flex1 jus-e ali-c">
<text class="textssum">{{conutdata.openLottery}}</text>
<image class="jiantou_icon" src="/static/LuckDraw/jiantou_icon.png" mode=""></image>
</view>
</navigator>
</view>
<navigator url="../LuckList/LuckList?type=3" class="send_cell flex ali-c ">
<view class="inputname">参与抽奖</view>
<view class="input_box flex1 jus-e ali-c">
<text class="textssum">{{conutdata.inCount}}</text>
<image class="jiantou_icon" src="/static/LuckDraw/jiantou_icon.png" mode=""></image>
</view>
</navigator>
<navigator url="../LuckList/LuckList?type=4" class="send_cell flex ali-c send_cell_boder">
<view class="inputname">中奖记录</view>
<view class="input_box flex1 jus-e ali-c">
<text class="textssum">{{conutdata.inPrize}}</text>
<image class="jiantou_icon" src="/static/LuckDraw/jiantou_icon.png" mode=""></image>
</view>
</navigator>
<!-- App 进来的只剩下 参与抽奖 和 中奖记录 -->
</view>
</view>
</template>
<script>
import {slotCountLottery} from "@/utils/api/LuckDraw.js";
export default {
data(){
return {
conutdata:{},
isshowall:1,// 1是显示 部分的 2是显示全部的
}
},
computed: {
staticUrl () {//静态资源地址
return this.$store.state.joinurl;
}
},
onLoad(opdata) {
// if(opdata.isshowal!=undefined){
// this.isshowall = opdata.isshowall;
// }else{
// this.isshowall = 1;//默认部分
// }
this.isshowall = opdata.isshowall;
this.getslotCountLottery();
},
methods:{
async getslotCountLottery(){
let res = await slotCountLottery({
});
if(res.code==0){
this.conutdata = res.data;
}else{
this.$api.msg(res.msg);
}
}
}
}
</script>
<style lang="scss">
@import "./homenav.scss";
</style>
/*预览的样式*/
.preview{
padding-bottom: 88upx;
}
.flexbutton{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 88upx;
line-height: 88upx;
text-align: center;
color:#FFFFFF;
background: #ff6900;
}
.textarea1{
height: auto !important;
}
\ No newline at end of file
<template>
<!-- 预览抽奖详情 -->
<view class="preview">
<!-- 发布 抽奖 -->
<view class="sendpage">
<view class="send_cell_box" v-for="(item,index) in PrizeList" :key="index">
<!-- 单个输入框 -->
<view class="send_cell flex ali-c">
<view class="inputname" v-if="PrizeList.length<=1">抽奖名称</view>
<view class="inputname" v-if="PrizeList.length>1">{{numberarr[index]}}等奖</view>
<view class="input_box flex1">
<view class="input oneline">{{item.title}}</view>
</view>
</view>
<view class="send_cell flex ali-c">
<view class="inputname">奖品数量</view>
<view class="input_box">
<view class="input">{{item.num}}</view>
</view>
</view>
<view class="send_cell flex ali-c">
<view class="inputname">中奖后下单金额</view>
<view class="input_box">
<view class="input">{{item.price}}</view>
</view>
</view>
<view class="uploadbox">
<image class="unpoadimgshow" :src="staticUrl+item.img" mode=""></image>
</view>
</view>
<!-- 大卡片end -->
<!-- 抽奖说明 -->
<view class="luckmsg flex ">
<view class="titles">奖品说明</view>
<view class="textareabox flex1">
<view class="textarea textarea1">
{{info}}
</view>
</view>
</view>
<!-- 抽奖说明end -->
<!-- 抽奖设置 -->
<view class="lucksys">
<view class="send_cell flex ali-c">
<view class="inputname">开奖方式</view>
<view class="input_box flex1">
<view class="input">{{shuliang}}人自动开奖</view>
</view>
</view>
<view class="send_cell flex ali-c send_cell_boder">
<view class="inputname">抽奖发起人</view>
<view class="input_box flex ali-c">
<image class="usertx" :src="userinfodata.face" mode=""></image>
<view class="input">{{userinfodata.nickname}}</view>
</view>
</view>
</view>
<!-- 抽奖设置end -->
<view class="flexbutton" @tap="sendsubmit">发布抽奖</view>
</view>
<prizemodel ref="prizemodel" :shuliang="shuliang" @fromSubmitfun="fromSubmitfun"></prizemodel>
<!-- 抽奖弹窗 -->
</view>
</template>
<script>
import prizemodel from "@/components/prizemodel/prizemodel.vue";//提示窗
import {sendLottery} from "@/utils/api/LuckDraw.js";//发起抽奖的接口
export default {
components:{
prizemodel,
},
data(){
return {
numberarr:["","","","","","","","","",""],
shuliang:"0",//开奖人数
//预览内容
info:"",//奖品说明
// pepole_num:0,//开奖人数
PrizeList:[],//奖品列表
way:0,
current:1,//单选选中的值
}
},
computed: {
staticUrl () {//静态资源地址
return this.$store.state.staticUrl;
},
//用户信息
userinfodata(){
return this.$store.state.userInfo;
}
},
onLoad() {
this.getpreviewdata();
},
methods:{
//获取本地存储信息
getpreviewdata(){
let previewdata = uni.getStorageSync("previewdata");
if(previewdata){
this.info = previewdata.info;//说明
this.shuliang = previewdata.pepole_num;//开奖人数
this.PrizeList = previewdata.prize;//奖品列表
this.current = previewdata.way;//
}
},
sendsubmit(){
if(this.shuliang==0){
this.$api.msg("开奖人数不能为0");
}else{
this.$refs.prizemodel.show();//显示弹窗
}
},
//表单提交最终的方法
async fromSubmitfun(){
console.info("表单提交");
if(this.info.replace(/\s+/g,"")==""){
this.$api.msg("抽奖说明不能为空");
return false;
}else if(this.shuliang<0){
this.$api.msg("请输入正确的开奖人数");
return false;
}
let res = await sendLottery({
info: this.info,//奖品说明
pepole_num: this.shuliang,//开奖人数
prize: this.PrizeList,//奖品列表
way: this.current,//开奖方式 满人开奖2 手动开奖3
});
if(res.code==0){
this.$api.msg("抽奖发布成功");
setTimeout(()=>{
// uni.navigateBack({
// })
//进入活动详情
uni.navigateTo({
url:`../LuckyDetails/LuckyDetails?id=${res.data}`
});
},1000)
}else{
this.$api.msg(res.msg);
}
},
}
}
</script>
<style lang="scss">
@import "../send/send.scss";
@import "./preview.scss";
</style>
/**为了快速兼容小程序的代码 这里不使用scss**/
.sendpage{
padding: 20upx 0;
background: #F5F1F2;
min-height: 100vh;
}
/*抽奖输入框卡片*/
.send_cell_box{
margin: 0 24upx;
margin-bottom: 20upx;
}
.send_cell{
padding: 0 20upx;
height: 88upx;
line-height: 88upx;
border-bottom: 1px solid #F4F1F2;
background: #fff;
}
.send_cell:nth-child(1){
border-radius: 14upx 14upx 0px 0px;
}
.send_cell_boder{
border-radius: 0px 0px 14upx 14upx ;
}
.send_cell .inputname{
color: #333333;
font-size: 32upx;
}
.send_cell .input_box{
margin-left: 20upx;
}
.input_box .texts{
font-size: 32upx;
}
.input_box .usertx{
width: 62upx;
height: 62upx;
border-radius: 50%;
margin-right: 20upx;
}
.input_box .uni-list-cell1{
margin-right: 20upx;
}
.input_box .jiantou_icon{
width: 13upx;
height: 24upx;
}
.send_cell .input_box .input{
font-size: 32upx;
color: #333333;
}
/*抽奖输入框卡片 end*/
/*上传图片部分*/
.uploadbox{
height:380upx;
//background:rgba(243,85,67,1);
border-radius:0px 0px 14upx 14upx;
}
.uploadbox.active{
height:255upx;
background:rgba(243,85,67,1);
opacity:0.54;
}
.uploadbox .thumbnail{
width: 100%;
height: 255upx;
border-radius:0px 0px 14upx 14upx;
}
.uploadbtn{
padding-top: 53upx;
text-align: center;
}
.uploadbtn .unpoadimg{
width: 110upx;
height: 116upx;
}
.unpoadimgshow{
width: 100%;
height: 380upx;
border-radius: 0px 0px 14upx 14upx;
}
.uploadbtn .btnstext{
color:#FFFFFF;
font-size: 26upx;
}
/*上传图片部分end*/
.addluck{
margin: 30upx 0;
color:#FF6900;
font-size: 32upx;
text-align: center;
}
/*抽奖说明*/
.luckmsg{
padding: 30upx 20upx;
margin: 20upx 24upx;
height: 230upx;
background: #FFFFFF;
box-sizing: border-box;
color:#333333;
font-size: 32upx;
border-radius:14upx;
}
.luckmsg .titles{
}
.luckmsg .textareabox{
height: 230upx;
margin-left: 20upx;
box-sizing: border-box;
}
.luckmsg .textarea{
width: 100%;
height: 230upx;
}
/*抽奖说明end*/
/*抽奖设置*/
.lucksys{
margin: 20upx 24upx;
}
.LuckDrawsubmit{
height: 88upx;
margin: 20upx 24upx;
margin-top: 70upx;
}
.LuckDrawsubmit button{
width: 50%;
height: 88upx;
line-height: 88upx;
color: #FFFFFF;
font-size: 32upx;
}
.LuckDrawsubmit button::after{
border-radius: 0;
border: 0;
}
.LuckDrawsubmit .subbtns1{
background:rgba(243,85,67,1);
border-radius:14upx 0px 0px 14upx;
}
.LuckDrawsubmit .subbtns2{
background:rgba(255,105,0,1);
border-radius:0px 14upx 14upx 0px;
}
<template>
<!-- 发布 抽奖 -->
<view class="sendpage">
<view class="send_cell_box" v-for="(item,index) in PrizeList" :key="index">
<!-- 单个输入框 -->
<view class="send_cell flex ali-c">
<view class="inputname" v-if="PrizeList.length<=1">抽奖名称</view>
<view class="inputname" v-if="PrizeList.length>1">{{numberarr[index]}}等奖</view>
<view class="input_box flex1">
<input class="input" type="text" value="" v-model="item.title" placeholder="请输入奖品名称" />
</view>
</view>
<view class="send_cell flex ali-c">
<view class="inputname">奖品数量</view>
<view class="input_box">
<input type="number" value="" v-model="item.num" placeholder="请输入奖品数量" />
</view>
</view>
<view class="send_cell flex ali-c">
<view class="inputname">金额</view>
<view class="input_box">
<input type="number" value="" v-model="item.price" placeholder="请输入中奖后下单金额" />
</view>
</view>
<view class="uploadbox" :class="{active:item.img==''}">
<image class="unpoadimgshow" @tap="toselectshp(index)" v-if="item.img" :src="staticUrl+item.img" mode=""></image>
<view class="uploadbtn" v-else @tap="toselectshp(index)">
<image class="unpoadimg" src="/static/LuckDraw/Prize_icon.png" mode=""></image>
<view class="btnstext">选择奖品</view>
</view>
<!-- <image class="thumbnail" src="http://pic121.huitu.com/res/20190521/2134763_20190521094542188060_1.jpg" mode=""></image> -->
</view>
</view>
<!-- 大卡片end -->
<!-- 添加奖品 -->
<view class="addluck flex jus-a">
<view class="addbtns" v-if="PrizeList.length>1" @tap="delPrize">-删减奖品</view>
<view class="addbtns" @tap="addPrize">+添加奖品</view>
</view>
<!-- 抽奖说明 -->
<view class="luckmsg flex ">
<view class="titles">奖品说明</view>
<view class="textareabox flex1">
<textarea class="textarea" value="" v-model="cjinfo" placeholder="请填写抽奖说明" />
</view>
</view>
<!-- 抽奖说明end -->
<!-- 抽奖设置 -->
<view class="lucksys">
<!-- <view class="send_cell flex ali-c">
<view class="inputname">开奖方式</view>
<view class="input_box flex1">
<radio-group @change="radioChange" class="flex">
<label class="uni-list-cell1" >
<view class="flex">
<radio value="2" color="#ff6900" :checked="current==2" />
<view class="texts">满人开奖</view>
</view>
</label>
<label class="uni-list-cell1 " >
<view class="flex">
<radio value="3" color="#ff6900" :checked="current==3" />
<view class="texts">手动开奖</view>
</view>
</label>
</radio-group>
</view>
</view> -->
<view class="send_cell flex ali-c send_cell_boder">
<view class="inputname">开奖人数</view>
<view class="input_box">
<input type="number" value="" v-model="shuliang" placeholder="请输入开奖人数" />
</view>
</view>
</view>
<!-- 抽奖设置end -->
<!-- 提交按钮 -->
<view class="LuckDrawsubmit flex">
<button type="primary" class="subbtns1" @tap="toPreview">预览奖池</button>
<button type="primary" class="subbtns2" @tap="sendsubmit">发布抽奖</button>
</view>
<prizemodel ref="prizemodel" :shuliang="shuliang" @fromSubmitfun="fromSubmitfun"></prizemodel>
<!-- 抽奖弹窗 -->
</view>
</template>
<script>
import prizemodel from "@/components/prizemodel/prizemodel.vue";//提示窗
import {sendLottery} from "@/utils/api/LuckDraw.js";//发起抽奖的接口
export default {
components:{
prizemodel,
},
data(){
return {
numberarr:["","","","","","","","","",""],
current:2,//单选选中的值
PrizeList:[
{
closed: "1",//多余参数?
goods_id: "",//商品id
img: "",//产品图
num: "",//奖品数量
price: "",//中奖后的金额
title: "",//抽奖名称
},
],//奖品列表
shuliang:"0",//开奖人数
cjinfo:"",//抽奖说明
}
},
computed: {
staticUrl () {//静态资源地址
return this.$store.state.staticUrl;
}
},
onLoad() {
// setTimeout(()=>{
// // this.$refs.prizemodel.show();//显示弹窗
// },300)
},
onShow() {
//取之前页面选的获取到的商品
let selcarddata = uni.getStorageSync('selectaddres');
console.info(selcarddata);
if(selcarddata){
let datas = selcarddata.data;
let sendindex = selcarddata.sendindex;//插入索引
let obj = {
closed: "1",//多余参数?
goods_id: datas.goods_id,//商品id
img: datas.photo,//产品图
num: this.PrizeList[sendindex].num?this.PrizeList[sendindex].num:1,//奖品数量
price: datas.price,//中奖后的金额
title: datas.title,//抽奖名称
}
console.info(obj,sendindex);
//this.PrizeList[sendindex] = obj;//赋值
this.$set(this.PrizeList, sendindex,obj);//赋值
setTimeout(()=>{
uni.removeStorageSync('selectaddres');//移除
},1000)
}
},
methods:{
//单选触发事件 开奖方式
radioChange(e){
this.current = e.detail.value;
},
//添加奖品
addPrize(){
this.PrizeList.push({
closed: "1",//多余参数?
goods_id: "",//商品id
img: "",//产品图
num: "1",//奖品数量
price: "",//中奖后的金额
title: "",//抽奖名称
})
},
//删除奖品
delPrize(){
this.PrizeList.splice(this.PrizeList.length-1,1);
},
toPreview(){
if(this.shuliang=="0" && this.shuliang==0){
this.$api.msg("开奖人数不能为O");
return false;
}
if(this.cjinfo==""){
this.$api.msg("奖品说明必须要填哦,亲~");
return false;
}
//预览
uni.setStorageSync("previewdata",{
info: this.cjinfo,//奖品说明
pepole_num: this.shuliang,//开奖人数
prize: this.PrizeList,//奖品列表
way: this.current,//开奖方式 满人开奖2 手动开奖3
});
uni.navigateTo({
url:"../preview/preview",
})
},
//提交发布的是
sendsubmit(){
if(this.shuliang==0){
this.$api.msg("开奖人数不能为0");
}else{
this.$refs.prizemodel.show();//显示弹窗
}
},
//表单提交最终的方法
async fromSubmitfun(){
console.info("表单提交");
if(this.cjinfo.replace(/\s+/g,"")==""){
this.$api.msg("抽奖说明不能为空");
return false;
}else if(this.pepole_num<0){
this.$api.msg("请输入正确的开奖人数");
return false;
}
let res = await sendLottery({
info: this.cjinfo,//奖品说明
pepole_num: this.shuliang,//开奖人数
prize: this.PrizeList,//奖品列表
way: this.current,//开奖方式 满人开奖2 手动开奖3
});
if(res.code==0){
this.$api.msg("抽奖发布成功");
setTimeout(()=>{
// uni.navigateBack({
// })
//进入活动详情
uni.navigateTo({
url:`../LuckyDetails/LuckyDetails?id=${res.data}`
});
},1000)
}else{
this.$api.msg(res.msg);
}
},
//去商品列表获取商品
toselectshp(index){
//传的是数组插入索引
uni.navigateTo({
url:`/pages/ProductManage/ProductManage?isselect=1&sendindex=${index}`,
})
}
}
}
</script>
<style lang="scss">
@import "./send.scss"
</style>
......@@ -73,4 +73,23 @@ page{
height: 88upx;
line-height: 88upx;
}
}
.uploadboxs{
padding: 20upx 30upx;
.uploadsnames{
color: #999999;
max-width: 40%;
margin-right: 5%;
}
.uptoimglist{
padding: 10upx 14upx;
.uploabtns{
padding: 5upx;
border-radius: 8upx;
width: 120upx;
height: 120upx;
border: 1px solid #f2f2f2;
}
}
}
\ No newline at end of file
......@@ -47,7 +47,19 @@
</view>
<!-- <QSInput :name="name" titleColor="#000000" variableName="shoptitle" required layout="row" title="库存" v-model="form.shoptitle"></QSInput> -->
<!-- <QSInput :name="name" titleColor="#000000" variableName="shoptitle" required layout="row" title="售价" v-model="form.shoptitle"></QSInput> -->
<QSPics :name="name" variableName="pics" title="商品图片" v-model="form.pics"></QSPics>
<!-- <QSPics :name="name" variableName="pics" title="商品图片" v-model="form.pics"></QSPics> -->
<!-- 上传图片 -->
<view class="uploadboxs flex ali-c ">
<view class="uploadsnames">商品图片</view>
<view class="uptoimglist flex1 jus-e">
<!-- spec_img -->
<image v-if="item.spec_img!='' && item.spec_img!=null" class="uploabtns" :src="staticUrl+item.spec_img" mode=""></image>
<view v-else class="uploabtns" @tap="uploadimgfun(index)"></view>
</view>
</view>
</view>
</view>
......@@ -63,6 +75,7 @@
<script>
import {goodsSpec,ajaxGetSpecSelect,addEditProductSpec} from "@/utils/api/api.js";
import yiCheckbox from "@/components/yiCheckbox/yiCheckbox.vue";
import config from "@/utils/config.js";
/**
* 查询商品的规格 商品规格详情 goodsSpec
*
......@@ -110,15 +123,72 @@
endobjdata:[],//最后的end 是组装出来的数据
};
},
computed:{
uploaddata(){
return {model:"goods",user_token:this.$store.state.token,shop_id:this.$store.state.userInfo.shop_id}
},
staticUrl(){
return this.$store.state.staticUrl;
}
},
onLoad(opdata) {
this.goods_id = opdata.id;
this.goodsSpecfun();//商品规格详情
},
methods:{
//上传图片的方法
uploadimgfun(index){
//上传图片方法
// uploadimgs(){
uni.chooseImage({
count:1,
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
uni.uploadFile({
url: config.SiteBaseUrl+'FileUpload/uploadify', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'img',
formData: this.uploaddata,
success: (uploadFileRes) => {
console.log(uploadFileRes.data,"上传成功后~");
let resdata = JSON.parse(uploadFileRes.data);
console.info(resdata,"resdata");
console.info(resdata.data,"resdata.data");
let endobjdatatwo = this.endobjdata;
endobjdatatwo[index].spec_img = resdata.data;
//this.endobjdata[index].spec_img = resdata.data;
this.$set(this.endobjdata, index, endobjdatatwo[index]);//设置赋值
}
});
}
});
// },
},
// 库存,图片,售价 添加规定的方法 最终提交的方法
addEditProductSpecfun(){
// addEditProductSpec
let isbool = false;
isbool = this.endobjdata.every((item,index)=>{
return item.price!="" && item.price!="";
})
if(!isbool){
this.$api.msg("规格填写有误");
return false;
}
if(this.endobjdata.length==0){
this.$api.msg("你必须填写规格才能提交");
return false;
}
console.info("endobjdata",this.endobjdata);
// return false;
......@@ -128,7 +198,12 @@
item:this.endobjdata,
}).then((res)=>{
if(res.code==0){
this.$api.msg(res.data);
setTimeout(()=>{
uni.navigateBack({
})
},1000)
}else{
this.$api.msg(res.data);
}
......
//抽奖相关的接口
import request from "./../request.js";
//slotCountLottery 抽奖活动首页接口
export function slotCountLottery(data) {
return request.post("slot/countLottery", data, { noAuth: false });
}
//sendLottery 抽奖发布 发起抽奖
export function sendLottery(data) {
return request.post("slot/sendLottery", data, { noAuth: false });
}
//查询各种状态的抽奖记录列表 列表
export function LotteryList(data) {
return request.post("slot/LotteryList", data, { noAuth: false });
}
//抽奖详情接口 活动页面
export function slotLotteryInfo(data) {
return request.post("slot/LotteryInfo", data, { noAuth: false });
}
//参与抽奖的方法
export function joinLottery(data) {
return request.post("user/joinLottery", data, { noAuth: false });
}
//开奖请求接口
export function OpenLottery(data) {
return request.post("slot/OpenLottery", data, { noAuth: false });
}
//获取 中奖者 名单
export function prizeUserList(data) {
return request.post("slot/prizeUserList", data, { noAuth: false });
}
//查看全部的中奖名单
export function LotteryUserInfo(data) {
return request.post("slot/LotteryUserInfo", data, { noAuth: false });
}
//抽奖开启和关闭
export function cancelLottery(data) {
return request.post("slot/cancelLottery", data, { noAuth: false });
}
//获取参与过的活动列表
export function slotuserList(data) {
return request.post("slot/userList", data, { noAuth: false });
}
\ No newline at end of file
......@@ -2,8 +2,8 @@
//环境变量 这个是 鹿马商家助手的 商家助手的~~~~
module.exports = {
//是否为开发调试环境 true为本地环境 false 为正式环境
isdebug:true,//测试
// isdebug:false,//正式
// isdebug:true,//测试
isdebug:false,//正式
xqdebug:false,//正式权限
// xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment