Commit f008b3a8 authored by srf's avatar srf

srf

parent 6b13166f
......@@ -28,7 +28,6 @@
</view> -->
<!-- 2222222 -->
<view class="head_1" v-show="btnnum == 1">
<view data-var="0">
<view style="display: flex;justify-content: space-between;align-items: center;font-weight: bold;font-size: 16px;">
<view class="bonus">奖项一</view>
......@@ -36,7 +35,6 @@
</view>
<view class="bonus_1">
<view class="bonus_1_1">
<view class="bonus_1_1_1">奖品名称</view>
<view class="bonus_1_1_1_1"><input class="input" type="text" name="name_1" v-model="prize[0].title" placeholder="请输入奖品名称" /></view>
......@@ -66,11 +64,9 @@
<view class="uni-list" style="padding: 24upx 0 24upx 0;">
<view class="uni-list-cell uni-list-cell-pd jus-b">
<view class="uni-list-cell-db " style="font-size:28upx;font-weight: bold;margin: 0 20upx 0 20upx;">是否为奖品</view>
<switch checked @change="switch1" />
<switch checked @change="switchs(1)" />
<view class="bonus_1_1_1_1 nome"><input class="input" type="text" name="name_4" :value="this.prize[0].status" placeholder="" /></view>
</view>
</view>
</view>
......@@ -126,11 +122,9 @@
<view class="uni-list" style="padding: 24upx 0 24upx 0;">
<view class="uni-list-cell uni-list-cell-pd jus-b">
<view class="uni-list-cell-db " style="font-size:28upx;font-weight: bold;margin: 0 20upx 0 20upx;">是否为奖品</view>
<switch checked @change="switch2" />
<switch checked @change="switchs(2)" />
<view class="bonus_1_1_1_1 nome"><input class="input" type="text" name="name_8" :value="this.prize[1].status" placeholder="" /></view>
</view>
</view>
</view>
......@@ -167,7 +161,6 @@
<view class="input_1"></view>
</view>
<view class="line-h"></view>
<view class="bonus_1_1">
<view class="bonus_1_1_1">中奖名额</view>
......@@ -190,11 +183,9 @@
<view class="uni-list" style="padding: 24upx 0 24upx 0;">
<view class="uni-list-cell uni-list-cell-pd jus-b">
<view class="uni-list-cell-db " style="font-size:28upx;font-weight: bold;margin: 0 20upx 0 20upx;">是否为奖品</view>
<switch checked @change="switch3" />
<switch checked @change="switchs(3)" />
<view class="bonus_1_1_1_1 nome"><input class="input" type="text" name="name_12" :value="this.prize[2].status" placeholder="" /></view>
</view>
</view>
</view>
......@@ -257,11 +248,9 @@
<view class="uni-list" style="padding: 24upx 0 24upx 0;">
<view class="uni-list-cell uni-list-cell-pd jus-b">
<view class="uni-list-cell-db " style="font-size:28upx;font-weight: bold;margin: 0 20upx 0 20upx;">是否为奖品</view>
<switch checked @change="switch4" />
<switch checked @change="switchs(4)" />
<view class="bonus_1_1_1_1 nome"><input class="input" type="text" name="name_16" :value="this.prize[3].status" placeholder="" /></view>
</view>
</view>
</view>
......@@ -324,11 +313,9 @@
<view class="uni-list" style="padding: 24upx 0 24upx 0;">
<view class="uni-list-cell uni-list-cell-pd jus-b">
<view class="uni-list-cell-db " style="font-size:28upx;font-weight: bold;margin: 0 20upx 0 20upx;">是否为奖品</view>
<switch checked @change="switch5" />
<switch checked @change="switchs(5)" />
<view class="bonus_1_1_1_1 nome"><input class="input" type="text" name="name_20" :value="this.prize[4].status" placeholder="" /></view>
</view>
</view>
</view>
......@@ -392,11 +379,9 @@
<view class="uni-list" style="padding: 24upx 0 24upx 0;">
<view class="uni-list-cell uni-list-cell-pd jus-b">
<view class="uni-list-cell-db " style="font-size:28upx;font-weight: bold;margin: 0 20upx 0 20upx;">是否为奖品</view>
<switch checked @change="switch6" />
<switch checked @change="switchs(6)" />
<view class="bonus_1_1_1_1 nome"><input class="input" type="text" name="name_24" :value="this.prize[5].status" placeholder="" /></view>
</view>
</view>
</view>
......@@ -489,7 +474,6 @@
<view style="font-size: 28upx;font-weight: bold;margin: 10px 0 10px 0;">活动描述</view>
<textarea v-model="diameter.content" style="height:300upx;width:660upx ;" placeholder="请输入活动描述"></textarea>
</view>
<view class="uni-list" style="padding: 24upx 0 24upx 0;">
<view class="uni-list-cell uni-list-cell-pd jus-b">
......@@ -498,10 +482,8 @@
</view>
</view>
<view class="bonus_5"><button class="bonus_5_1" @tap="formSubmi" v-show="diameter.status == 2">确认发布</button></view>
<!-- </form> -->
</view>
<!-- 333333 -->
......@@ -554,7 +536,6 @@
<view class="gmbtns" v-if="item.order_status == 3" @tap="express" :data-order_id="item.order_id">待收货</view>
<view class="gmbtns" v-if="item.order_status == 4" @tap="express" :data-order_id="item.order_id">已完成</view>
</view>
<view style="font-size: 30upx;font-weight: bold;">{{ item.nickname }} {{ item.mobile }}</view>
<!-- <view class="flex"><view class="hongkng">一等奖 中奖名额 2名 3500</view>
......@@ -588,7 +569,6 @@
</view>
</template>
<script>
import robbyImageUpload from '@/components/plan-image-upload/up_img'; //上传资质图片组件
import wPicker from '@/components/w-picker/w-picker.vue'; //时间弹窗
import { addTurntableActivity, getTurntableActivityList, getShopLuckDrawList, getBuyRecord, setTurntableActivityStatus } from '@/utils/api/merchant.js';
......@@ -604,15 +584,14 @@ export default {
},
data() {
return {
targets:[],
targets: [],
prize: [
{ title: '', num: '', proportion: '',status:1 },
{ title: '', num: '', proportion: '',status:1 },
{ title: '', num: '', proportion: '',status:1 },
{ title: '', num: '', proportion: '',status:1 },
{ title: '', num: '', proportion: '',status:1 },
{ title: '', num: '', proportion: '',status:1 ,},
{ title: '', num: '', proportion: '', status: 1 },
{ title: '', num: '', proportion: '', status: 1 },
{ title: '', num: '', proportion: '', status: 1 },
{ title: '', num: '', proportion: '', status: 1 },
{ title: '', num: '', proportion: '', status: 1 },
{ title: '', num: '', proportion: '', status: 1 }
],
shop_id: '',
statuslist: [],
......@@ -774,7 +753,6 @@ export default {
},
// 66666
methods: {
express(e) {
console.log(e);
let num = e.currentTarget.dataset.order_id;
......@@ -792,59 +770,99 @@ export default {
uni.pageScrollTo({
scrollTop: 0,
duration: 200
});
},
switch6(e) {
console.log(e);
if (e.target.value == true) {
this.prize[5].status = 1;
// switch6(e) {
// console.log(e);
// if (e.target.value == true) {
// this.prize[5].status = 1;
// } else {
// this.prize[5].status = 2;
// }
// },
// switch5(e) {
// console.log(e);
// if (e.target.value == true) {
// this.prize[4].status = 1;
// } else {
// this.prize[4].status = 2;
// }
// },
// switch4(e) {
// console.log(e);
// if (e.target.value == true) {
// this.prize[3].status = 1;
// } else {
// this.prize[3].status = 2;
// }
// },
// switch3(e) {
// console.log(e);
// if (e.target.value == true) {
// this.prize[2].status = 1;
// } else {
// this.prize[2].status = 2;
// }
// },
// switch2(e) {
// console.log(e);
// if (e.target.value == true) {
// this.prize[1].status = 1;
// } else {
// this.prize[1].status = 2;
// }
// },
// switch1(e) {
// console.log(e);
// if (e.target.value == true) {
// this.prize[0].status = 1;
// } else {
// this.prize[0].status = 2;
// }
// },
switchs(index) {
console.log(index);
if (index == 1) {
if (this.prize[0].status == 1) {
this.prize[0].status = 2;
} else {
this.prize[5].status = 2;
this.prize[0].status = 1;
}
},
switch5(e) {
console.log(e);
if (e.target.value == true) {
this.prize[4].status = 1;
}else if (index == 2) {
if (this.prize[1].status == 1) {
this.prize[1].status = 2;
} else {
this.prize[4].status = 2;
this.prize[1].status = 1;
}
},
switch4(e) {
console.log(e);
if (e.target.value == true) {
this.prize[3].status = 1;
}else if (index == 3) {
if (this.prize[2].status == 1) {
this.prize[2].status = 2;
} else {
this.prize[3].status = 2;
}
},
switch3(e) {
console.log(e);
if (e.target.value == true) {
this.prize[2].status = 1;
}
}else if(index == 4) {
if (this.prize[3].status == 1) {
this.prize[3].status = 2;
} else {
this.prize[2].status = 2;
this.prize[3].status = 1;
}
},
switch2(e) {
console.log(e);
if (e.target.value == true) {
this.prize[1].status = 1;
}else if(index == 5) {
if (this.prize[4].status == 1) {
this.prize[4].status = 2;
} else {
this.prize[1].status = 2;
this.prize[4].status = 1;
}
},
switch1(e) {
console.log(e);
if (e.target.value == true) {
this.prize[0].status = 1;
}else if(index == 6) {
if (this.prize[5].status == 1) {
this.prize[5].status = 2;
} else {
this.prize[0].status = 2;
this.prize[5].status = 1;
}
}
},
switching(e) {
// console.log(this.shopdata)
// this.shopdata.map((item, index, arr) => {
......@@ -1019,10 +1037,8 @@ export default {
console.log(e);
},
// 66666666666
formSubmi: function(e) {
// this.fromname = e.detail.value;
// let formdata = this.fromname;
// console.log(this.prize)
......@@ -1060,20 +1076,16 @@ export default {
// };
// console.log(form)
// let form = this.prize;
// console.log(this.prize);
// console.log(this.shop_id);
// console.log(form);
console.log(this.shopdata, '卧槽');
console.log(this.prize, '卧槽');
// this.shopdata==this.prize;
let target=JSON.parse(JSON.stringify(this.prize));
let target = JSON.parse(JSON.stringify(this.prize));
console.log(target);
target[0].pic = this.c_photos[0] ? this.c_photos[0] : '';
target[1].pic = this.c_photos[1] ? this.c_photos[1] : '';
......@@ -1088,26 +1100,22 @@ export default {
console.log(target, 'aaa卧槽');
if (this.shopdata.length != 0) {
for(let i=target.length-1;i>=0;i--){
console.log("啧啧")
if (target[i].proportion == "" && target[i].title == "" && target[i].num == "") {
console.log(i,"哈哈");
for (let i = target.length - 1; i >= 0; i--) {
console.log('啧啧');
if (target[i].proportion == '' && target[i].title == '' && target[i].num == '') {
console.log(i, '哈哈');
target.splice(i, 1);
}
}
console.log(target)
console.log(target);
}
console.info(target)
console.info(target);
if (target.length == 0) {
uni.showModal({
title: '提示',
content: '请填写内容',
success: function (res) {
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
......@@ -1123,12 +1131,11 @@ export default {
let nums = 0;
target.forEach((item, index) => {
if (item.title == '' || item.proportion == '' || item.num == '' || item.pic == '') {
console.log('啊啊啊啊');
uni.showModal({
title: '提示',
content: '有奖项未填写完整',
success: function (res) {
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
......@@ -1142,8 +1149,8 @@ export default {
// });
} else {
nums++;
console.log(target)
this.targets=target
console.log(target);
this.targets = target;
if (nums == target.length) {
this.addTurntableActivity();
}
......@@ -1152,17 +1159,15 @@ export default {
}
// console.log(this.shopdata, this.shopdata.length);
},
// 77777
async addTurntableActivity() {
if(this.diameter.start_time==""||this.diameter.end_time==""){
if (this.diameter.start_time == '' || this.diameter.end_time == '') {
uni.showModal({
title: '提示',
content: '请选择活动时间',
success: function (res) {
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
......@@ -1174,13 +1179,12 @@ export default {
// title: '请选择活动时间',
// duration: 2000
// });
}
else if(this.diameter.start_time==this.diameter.end_time){
console.log("hah")
} else if (this.diameter.start_time == this.diameter.end_time) {
console.log('hah');
uni.showModal({
title: '提示',
content: '活动开始与结束相同',
success: function (res) {
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
......@@ -1193,9 +1197,9 @@ export default {
// title: '开始与结束相同',
// duration: 2000
// });
}else{
} else {
let param = {
prize:this.targets,
prize: this.targets,
name: this.diameter.name,
condition_money: Math.floor(this.diameter.condition_money),
receive_endtime: Math.floor(this.diameter.receive_endtime),
......@@ -1219,11 +1223,7 @@ export default {
this.btnnum = 2;
this.getTurntableActivityList();
}
}
},
// 8888
// 奖品专区
......@@ -1235,17 +1235,6 @@ export default {
let res = await getTurntableActivityList(param);
// uni.hideLoading();//结束加载
// this.isshowloading = false;
// this.shop_list = [...this.shop_list,...res.data];//列表
// // console.log(this.shop_list)
// uni.stopPullDownRefresh();//关闭下拉刷新
// if(res.data.length==0){
// this.$api.msg("没有更多了~");
// }
this.published = res.data.list;
console.info(res.data.list);
......@@ -1271,7 +1260,6 @@ export default {
page: this.page,
pagesize: 10
};
let res = await getShopLuckDrawList(param);
......
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