32 changed files with 2800 additions and 2584 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,238 +1,264 @@ |
|||||||
<template> |
<template> |
||||||
<view class="flash-sale" ref="container"> |
<view class="flash-sale" ref="container"> |
||||||
<view class="header" v-if="headerImg"> |
<view class="header" v-if="headerImg"> |
||||||
<image :src="headerImg" /> |
<image :src="headerImg" /> |
||||||
</view> |
</view> |
||||||
<scroll-view scroll-y="false" scroll-x="true"> |
<scroll-view scroll-y="false" scroll-x="true"> |
||||||
<view class="timeScroll"> |
<view class="timeScroll"> |
||||||
<view class="" v-for="(item, index) in timeList" :key="index"> |
<view class v-for="(item, index) in timeList" :key="index"> |
||||||
<view :class="{'timeItem':true,'active':active==index}" @click="changeTime(index)"> |
<view :class="{'timeItem':true,'active':active==index}" @click="setTime(index)"> |
||||||
<view class="time">{{ item.time }}</view> |
<view class="time">{{ item.time }}</view> |
||||||
<view class="state">{{ item.state }}</view> |
<view class="state">{{ item.state }}</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</scroll-view> |
</scroll-view> |
||||||
<view class="" v-for="(item, index) in timeList" :key="index"> |
<view class v-for="(item, index) in timeList" :key="index"> |
||||||
<view v-if="active == index"> |
<view v-if="active == index"> |
||||||
<view class="countDown font-color-red acea-row row-center-wrapper"> |
<view class="countDown font-color-red acea-row row-center-wrapper"> |
||||||
<view v-if="item.status === 0" class="activity">活动已结束</view> |
<view v-if="item.status === 0" class="activity">活动已结束</view> |
||||||
<count-down :is-day="false" :tip-text="'距结束仅剩 '" :day-text="''" :hour-text="' : '" :minute-text="' : '" |
<count-down |
||||||
:second-text="''" :datatime="datatime" v-if="item.status === 1"></count-down> |
:isDay="false" |
||||||
<view v-if="item.status === 2" class="activity">活动即将开始</view> |
:tipText="'距结束仅剩 '" |
||||||
</view> |
:dayText="false" |
||||||
<view class="list"> |
:hourText="' : '" |
||||||
<view class="item acea-row row-between-wrapper" v-for="(itemSeckill, indexSeckill) in seckillList" :key="indexSeckill"> |
:minuteText="' : '" |
||||||
<view class="pictrue"> |
:secondText="false" |
||||||
<image :src="itemSeckill.image" /> |
:datatime="datatime" |
||||||
</view> |
v-if="item.status === 1" |
||||||
<view class="text acea-row row-column-around"> |
></count-down> |
||||||
<view class="line1" v-text="itemSeckill.title"></view> |
<view v-if="item.status === 2" class="activity">活动即将开始</view> |
||||||
<view class="money"> |
</view> |
||||||
限时价 |
<view class="list"> |
||||||
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text> |
<view |
||||||
</view> |
class="item acea-row row-between-wrapper" |
||||||
<view class="progress cart-color"> |
v-for="(itemSeckill, indexSeckill) in seckillList" |
||||||
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view> |
:key="indexSeckill" |
||||||
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view> |
> |
||||||
</view> |
<view class="pictrue"> |
||||||
</view> |
<image :src="itemSeckill.image" /> |
||||||
<view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0" @click="goDetail(itemSeckill.id)">马上抢</view> |
</view> |
||||||
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view> |
<view class="text acea-row row-column-around"> |
||||||
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view> |
<view class="line1" v-text="itemSeckill.title"></view> |
||||||
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view> |
<view class="money"> |
||||||
</view> |
限时价 |
||||||
</view> |
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text> |
||||||
<view class="noCommodity" style="background-color: #fff;" v-if="seckillList.length === 0 && page > 1"> |
</view> |
||||||
<view class="noPictrue"> |
<view class="progress cart-color"> |
||||||
<image src="@/static/images/noGood.png" class="image" /> |
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view> |
||||||
</view> |
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
<view |
||||||
<!-- |
class="grab bg-color-red" |
||||||
|
v-if="item.status === 1 && itemSeckill.stock > 0" |
||||||
|
@click="goDetail(itemSeckill.id)" |
||||||
|
>马上抢</view> |
||||||
|
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view> |
||||||
|
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view> |
||||||
|
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<view |
||||||
|
class="noCommodity" |
||||||
|
style="background-color: #fff;" |
||||||
|
v-if="seckillList.length === 0 && page > 1" |
||||||
|
> |
||||||
|
<view class="noPictrue"> |
||||||
|
<image src="@/static/images/noGood.png" class="image" /> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<!-- |
||||||
<vant-tabs :active="active" @change="setTime" :sticky="sticky" animated line-height="2" :ellipsis="false"> |
<vant-tabs :active="active" @change="setTime" :sticky="sticky" animated line-height="2" :ellipsis="false"> |
||||||
<vant-tab :ellipsis="false" :title="[title[index]]"> |
<vant-tab :ellipsis="false" :title="[title[index]]"> |
||||||
|
|
||||||
</vant-tab> |
</vant-tab> |
||||||
</vant-tabs> --> |
</vant-tabs>--> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
import { |
import { getSeckillConfig, getSeckillList } from "@/api/activity"; |
||||||
getSeckillConfig, |
import CountDown from "@/components/CountDown"; |
||||||
getSeckillList |
// import { Tab, Tabs } from "vant-weapp"; |
||||||
} from '@/api/activity'; |
import Loading from "@/components/Loading"; |
||||||
import CountDown from '@/components/CountDown'; |
|
||||||
// import { Tab, Tabs } from "vant-weapp"; |
|
||||||
import Loading from '@/components/Loading'; |
|
||||||
|
|
||||||
export default { |
export default { |
||||||
name: 'GoodsSeckill', |
name: "GoodsSeckill", |
||||||
components: { |
components: { |
||||||
CountDown |
CountDown |
||||||
}, |
}, |
||||||
props: {}, |
props: {}, |
||||||
data: function() { |
data: function() { |
||||||
return { |
return { |
||||||
headerImg: '', |
headerImg: "", |
||||||
timeList: [], |
timeList: [], |
||||||
sticky: false, |
sticky: false, |
||||||
loading: false, |
loading: false, |
||||||
datatime: 0, |
datatime: 0, |
||||||
active: 0, |
active: 0, |
||||||
seckillList: [], |
seckillList: [], |
||||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成 |
status: false, //砍价列表是否获取完成 false 未完成 true 完成 |
||||||
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成 |
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成 |
||||||
page: 1, //页码 |
page: 1, //页码 |
||||||
limit: 5, //数量 |
limit: 5, //数量 |
||||||
title: [], |
title: [] |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
mounted: function() { |
mounted: function() { |
||||||
this.mountedStart(); |
this.mountedStart(); |
||||||
}, |
}, |
||||||
onReachBottom() { |
onReachBottom() { |
||||||
!this.loadingList && this.getSeckillList(); |
!this.loadingList && this.getSeckillList(); |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
changeTime: function(index) { |
changeTime: function(index) { |
||||||
this.active = index |
console.log(index); |
||||||
}, |
this.active = index; |
||||||
mountedStart: function() { |
this.getSeckillList(); |
||||||
var that = this; |
}, |
||||||
uni.showLoading(); |
mountedStart: function() { |
||||||
getSeckillConfig().then(res => { |
var that = this; |
||||||
that.$set(that, 'headerImg', res.data.lovely); |
uni.showLoading(); |
||||||
that.$set(that, 'timeList', res.data.seckillTime); |
getSeckillConfig().then(res => { |
||||||
that.$set(that, 'active', res.data.seckillTimeIndex); |
that.$set(that, "headerImg", res.data.lovely); |
||||||
|
that.$set(that, "timeList", res.data.seckillTime); |
||||||
|
that.$set(that, "active", res.data.seckillTimeIndex); |
||||||
|
|
||||||
let title = []; |
let title = []; |
||||||
title = res.data.seckillTime.map((item, index) => { |
title = res.data.seckillTime.map((item, index) => { |
||||||
return { |
return { |
||||||
name: 'div', |
name: "div", |
||||||
attrs: { |
attrs: { |
||||||
class: 'timeItem' |
class: "timeItem" |
||||||
}, |
}, |
||||||
children: [{ |
children: [ |
||||||
name: 'div', |
{ |
||||||
attrs: { |
name: "div", |
||||||
class: 'time' |
attrs: { |
||||||
}, |
class: "time" |
||||||
children: [{ |
}, |
||||||
type: 'text', |
children: [ |
||||||
text: item.time |
{ |
||||||
}] |
type: "text", |
||||||
}, |
text: item.time |
||||||
{ |
} |
||||||
name: 'div', |
] |
||||||
attrs: { |
}, |
||||||
class: 'state' |
{ |
||||||
}, |
name: "div", |
||||||
children: [{ |
attrs: { |
||||||
type: 'text', |
class: "state" |
||||||
text: item.state |
}, |
||||||
}] |
children: [ |
||||||
} |
{ |
||||||
] |
type: "text", |
||||||
}; |
text: item.state |
||||||
}); |
} |
||||||
that.$set(that, 'title', title); |
] |
||||||
that.datatime = that.timeList[that.active].stop; |
} |
||||||
that.getSeckillList(); |
] |
||||||
that.$nextTick(function() { |
}; |
||||||
that.sticky = true; |
}); |
||||||
uni.hideLoading(); |
that.$set(that, "title", title); |
||||||
}); |
that.datatime = that.timeList[that.active].stop; |
||||||
}); |
that.getSeckillList(); |
||||||
}, |
that.$nextTick(function() { |
||||||
setTime: function(event) { |
that.sticky = true; |
||||||
var that = this; |
uni.hideLoading(); |
||||||
that.active = event.mp.detail.index; |
}); |
||||||
that.datatime = that.timeList[that.active].stop; |
}); |
||||||
that.getSeckillList(); |
}, |
||||||
}, |
setTime: function(index) { |
||||||
getSeckillList: function() { |
var that = this; |
||||||
var that = this; |
that.page = 1; |
||||||
if (that.loadingList) return; |
that.loadingList = false; |
||||||
if (that.status) return; |
that.status = false; |
||||||
var time = that.timeList[that.active].id; |
that.active = index; |
||||||
getSeckillList(time, { |
that.datatime = that.timeList[that.active].stop; |
||||||
page: that.page, |
this.seckillList=[] |
||||||
limit: that.limit |
that.getSeckillList(); |
||||||
}).then(res => { |
}, |
||||||
that.status = res.data.length < that.limit; |
getSeckillList: function() { |
||||||
that.seckillList.push.apply(that.seckillList, res.data); |
var that = this; |
||||||
that.page++; |
if (that.loadingList) return; |
||||||
uni.hideLoading(); |
if (that.status) return; |
||||||
}); |
var time = that.timeList[that.active].id; |
||||||
}, |
getSeckillList(time, { |
||||||
goDetail: function(id) { |
page: that.page, |
||||||
var that = this; |
limit: that.limit |
||||||
var time = that.timeList[that.active].stop; |
}).then(res => { |
||||||
this.$yrouter.push({ |
that.status = res.data.length < that.limit; |
||||||
path: '/pages/activity/SeckillDetails/index', |
that.seckillList.push.apply(that.seckillList, res.data); |
||||||
query: { |
that.page++; |
||||||
id, |
uni.hideLoading(); |
||||||
time |
}); |
||||||
} |
}, |
||||||
}); |
goDetail: function(id) { |
||||||
} |
var that = this; |
||||||
} |
var time = that.timeList[that.active].stop; |
||||||
}; |
this.$yrouter.push({ |
||||||
|
path: "/pages/activity/SeckillDetails/index", |
||||||
|
query: { |
||||||
|
id, |
||||||
|
time |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
<style scoped lang="less"> |
<style scoped lang="less"> |
||||||
.timeScroll { |
.timeScroll { |
||||||
display: flex; |
display: flex; |
||||||
align-items: center; |
align-items: center; |
||||||
flex-direction: row; |
flex-direction: row; |
||||||
} |
} |
||||||
|
|
||||||
.timeItem { |
.timeItem { |
||||||
font-size: 0.22 * 100rpx; |
font-size: 0.22 * 100rpx; |
||||||
color: #282828; |
color: #282828; |
||||||
width: 150rpx; |
width: 150rpx; |
||||||
text-align: center; |
text-align: center; |
||||||
padding: 0.11 * 100rpx 0; |
padding: 0.11 * 100rpx 0; |
||||||
background-color: none; |
background-color: none; |
||||||
|
|
||||||
&.active { |
&.active { |
||||||
|
.time { |
||||||
|
color: #00c17b; |
||||||
|
} |
||||||
|
|
||||||
.time { |
.state { |
||||||
color: #00c17b |
background-color: #00c17b; |
||||||
} |
color: #fff; |
||||||
|
opacity: 1; |
||||||
|
border-radius: 30rpx; |
||||||
|
padding: 0 0.2 * 100rpx; |
||||||
|
font-weight: 800; |
||||||
|
height: 0.37 * 100rpx; |
||||||
|
line-height: 0.37 * 100rpx; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
.state { |
.timeItem .time { |
||||||
background-color: #00c17b; |
font-size: 0.32 * 100rpx; |
||||||
color: #fff; |
font-weight: bold; |
||||||
opacity: 1; |
height: 0.37 * 100rpx; |
||||||
border-radius: 30rpx; |
line-height: 0.37 * 100rpx; |
||||||
padding: 0 .2*100rpx; |
} |
||||||
font-weight: 800; |
|
||||||
height: .3*100rpx; |
|
||||||
line-height: .3*100rpx; |
|
||||||
} |
|
||||||
|
|
||||||
} |
.timeItem .state { |
||||||
} |
height: 0.37 * 100rpx; |
||||||
|
line-height: 0.37 * 100rpx; |
||||||
|
} |
||||||
|
|
||||||
.timeItem .time { |
.activity { |
||||||
font-size: 0.32 * 100rpx; |
color: #333; |
||||||
font-weight: bold; |
} |
||||||
height: 0.37 * 100rpx; |
|
||||||
line-height: 0.37 * 100rpx; |
|
||||||
} |
|
||||||
|
|
||||||
.timeItem .state { |
.flash-sale .list .item .grab { |
||||||
height: 0.37 * 100rpx; |
background-color: #999; |
||||||
line-height: 0.37 * 100rpx; |
} |
||||||
} |
|
||||||
|
|
||||||
.activity { |
|
||||||
color: #333; |
|
||||||
} |
|
||||||
|
|
||||||
.flash-sale .list .item .grab { |
|
||||||
background-color: #999; |
|
||||||
} |
|
||||||
</style> |
</style> |
||||||
|
@ -1,220 +1,246 @@ |
|||||||
<template> |
<template> |
||||||
<view class="group-con"> |
<view class="group-con"> |
||||||
<view class="header acea-row row-between-wrapper"> |
<view class="header acea-row row-between-wrapper"> |
||||||
<view class="pictrue"> |
<view class="pictrue"> |
||||||
<image :src="storeCombination.image" /> |
<image :src="storeCombination.image" /> |
||||||
</view> |
</view> |
||||||
<view class="text"> |
<view class="text"> |
||||||
<view class="line1" v-text="storeCombination.title"></view> |
<view class="line1" v-text="storeCombination.title"></view> |
||||||
<view class="money"> |
<view class="money"> |
||||||
<text>¥</text> |
<text>¥</text> |
||||||
<text class="num" v-text="storeCombination.price"></text> |
<text class="num" v-text="storeCombination.price"></text> |
||||||
<text class="team cart-color" v-text="storeCombination.people + '人拼'"></text> |
<text class="team cart-color" v-text="storeCombination.people + '人拼'"></text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></view> |
<view v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></view> |
||||||
<view v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></view> |
<view v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></view> |
||||||
</view> |
</view> |
||||||
<view class="wrapper"> |
<view class="wrapper"> |
||||||
<view class="title acea-row row-center-wrapper"> |
<view class="title acea-row row-center-wrapper"> |
||||||
<view class="line"></view> |
<view class="line"></view> |
||||||
<view class="name acea-row row-center-wrapper"> |
<view class="name acea-row row-center-wrapper"> |
||||||
<text>剩余</text> |
<text>剩余</text> |
||||||
<count-down :is-day="false" :tip-text="''" :day-text="''" :hour-text="' : '" :minute-text="' : '" :second-text="''" |
<count-down |
||||||
:datatime="pinkT.stopTime"></count-down> |
:isDay="false" |
||||||
<text>结束</text> |
:tipText="false" |
||||||
</view> |
:dayText="false" |
||||||
<view class="line"></view> |
:hourText="' : '" |
||||||
</view> |
:minuteText="' : '" |
||||||
<text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text> |
:secondText="false" |
||||||
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}人,拼团失败</text> |
:datatime="pinkT.stopTime" |
||||||
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中,还差{{ count }}人拼团成功</text> |
></count-down> |
||||||
<view class="list acea-row row-middle" :class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']"> |
<text>结束</text> |
||||||
<view class="pictrue"> |
</view> |
||||||
<image :src="pinkT.avatar" /> |
<view class="line"></view> |
||||||
</view> |
</view> |
||||||
<view class="acea-row row-middle" v-if="pinkAll.length > 0"> |
<view class="tips-warp"> |
||||||
<view class="pictrue" v-for="(item, pinkAllIndex) in pinkAll" :key="pinkAllIndex"> |
<text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text> |
||||||
<image :src="item.avatar" /> |
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}人,拼团失败</text> |
||||||
</view> |
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中,还差{{ count }}人拼团成功</text> |
||||||
</view> |
</view> |
||||||
<view class="pictrue" v-for="countIndex in count" :key="countIndex"> |
<view |
||||||
<image class="img-none" src="@/static/images/vacancy.png" /> |
class="list acea-row row-middle" |
||||||
</view> |
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']" |
||||||
</view> |
> |
||||||
<view v-if="(pinkBool === 1 || pinkBool === -1) && count > 9" class="lookAll acea-row row-center-wrapper" @click="lookAll"> |
<view class="pictrue"> |
||||||
{{ iShidden ? "收起" : "查看全部" }} |
<image :src="pinkT.avatar" /> |
||||||
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text> |
</view> |
||||||
</view> |
<view class="acea-row row-middle" v-if="pinkAll.length > 0"> |
||||||
<view class="teamBnt bg-color-red" v-if="userBool === 1 && isOk == 0 && pinkBool === 0" @click="goPoster">邀请好友参团</view> |
<view class="pictrue" v-for="(item, pinkAllIndex) in pinkAll" :key="pinkAllIndex"> |
||||||
<view class="teamBnt bg-color-red" v-else-if="userBool === 0 && pinkBool === 0 && count > 0" @click="pay">我要参团</view> |
<image :src="item.avatar" /> |
||||||
<view class="teamBnt bg-color-red" v-if="pinkBool === 1 || pinkBool === -1" @click="goDetail(storeCombination.id)">再次开团</view> |
</view> |
||||||
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1"> |
</view> |
||||||
<text class="iconfont icon-guanbi3"></text> |
<view class="pictrue" v-for="countIndex in count" :key="countIndex"> |
||||||
<text>取消开团</text> |
<image class="img-none" src="@/static/images/vacancy.png" /> |
||||||
</view> |
</view> |
||||||
<view class="lookOrder" v-if="pinkBool === 1" @click="goOrder"> |
</view> |
||||||
<text>查看订单信息</text> |
<view |
||||||
<text class="iconfont icon-xiangyou"></text> |
v-if="(pinkBool === 1 || pinkBool === -1) && count > 9" |
||||||
</view> |
class="lookAll acea-row row-center-wrapper" |
||||||
</view> |
@click="lookAll" |
||||||
</view> |
> |
||||||
|
{{ iShidden ? "收起" : "查看全部" }} |
||||||
|
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text> |
||||||
|
</view> |
||||||
|
<view |
||||||
|
class="teamBnt bg-color-red" |
||||||
|
v-if="userBool === 1 && isOk == 0 && pinkBool === 0" |
||||||
|
@click="goPoster" |
||||||
|
>邀请好友参团</view> |
||||||
|
<view |
||||||
|
class="teamBnt bg-color-red" |
||||||
|
v-else-if="userBool === 0 && pinkBool === 0 && count > 0" |
||||||
|
@click="pay" |
||||||
|
>我要参团</view> |
||||||
|
<view |
||||||
|
class="teamBnt bg-color-red" |
||||||
|
v-if="pinkBool === 1 || pinkBool === -1" |
||||||
|
@click="goDetail(storeCombination.id)" |
||||||
|
>再次开团</view> |
||||||
|
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1"> |
||||||
|
<text class="iconfont icon-guanbi3"></text> |
||||||
|
<text>取消开团</text> |
||||||
|
</view> |
||||||
|
<view class="lookOrder" v-if="pinkBool === 1" @click="goOrder"> |
||||||
|
<text>查看订单信息</text> |
||||||
|
<text class="iconfont icon-xiangyou"></text> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
import CountDown from "@/components/CountDown"; |
import CountDown from "@/components/CountDown"; |
||||||
import { |
import { getCombinationPink, getCombinationRemove } from "@/api/activity"; |
||||||
getCombinationPink, |
import { postCartAdd } from "@/api/store"; |
||||||
getCombinationRemove |
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index"; |
||||||
} from "@/api/activity"; |
|
||||||
import { |
|
||||||
postCartAdd |
|
||||||
} from "@/api/store"; |
|
||||||
import { |
|
||||||
isWeixin, |
|
||||||
parseQuery, |
|
||||||
handleQrCode |
|
||||||
} from "@/utils/index"; |
|
||||||
|
|
||||||
const NAME = "GroupRule"; |
const NAME = "GroupRule"; |
||||||
export default { |
export default { |
||||||
name: NAME, |
name: NAME, |
||||||
components: { |
components: { |
||||||
CountDown |
CountDown |
||||||
}, |
}, |
||||||
props: {}, |
props: {}, |
||||||
data: function() { |
data: function() { |
||||||
return { |
return { |
||||||
currentPinkOrder: "", //当前拼团订单 |
currentPinkOrder: "", //当前拼团订单 |
||||||
isOk: 0, //判断拼团是否完成 |
isOk: 0, //判断拼团是否完成 |
||||||
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功 |
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功 |
||||||
userBool: 0, //判断当前用户是否在团内|0=未在,1=在 |
userBool: 0, //判断当前用户是否在团内|0=未在,1=在 |
||||||
pinkAll: [], //团员 |
pinkAll: [], //团员 |
||||||
pinkT: [], //团长信息 |
pinkT: [], //团长信息 |
||||||
storeCombination: [], //拼团产品 |
storeCombination: [], //拼团产品 |
||||||
pinkId: 0, |
pinkId: 0, |
||||||
count: 0, //拼团剩余人数 |
count: 0, //拼团剩余人数 |
||||||
iShidden: false |
iShidden: false |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
watch: { |
watch: { |
||||||
$yroute(n) { |
$yroute(n) { |
||||||
var that = this; |
var that = this; |
||||||
if (n.name === NAME) { |
if (n.name === NAME) { |
||||||
that.pinkId = that.$yroute.query.id; |
that.pinkId = that.$yroute.query.id; |
||||||
that.getCombinationPink(); |
that.getCombinationPink(); |
||||||
} |
} |
||||||
} |
} |
||||||
}, |
}, |
||||||
mounted: function() { |
mounted: function() { |
||||||
var that = this; |
var that = this; |
||||||
let url = handleQrCode(); |
let url = handleQrCode(); |
||||||
if (url) { |
if (url) { |
||||||
that.pinkId = url.pinkId; |
that.pinkId = url.pinkId; |
||||||
} else { |
} else { |
||||||
that.pinkId = that.$yroute.query.id; |
that.pinkId = that.$yroute.query.id; |
||||||
} |
} |
||||||
that.getCombinationPink(); |
that.getCombinationPink(); |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
pay: function() { |
pay: function() { |
||||||
var that = this; |
var that = this; |
||||||
var data = {}; |
var data = {}; |
||||||
data.productId = that.storeCombination.productId; |
data.productId = that.storeCombination.productId; |
||||||
data.cartNum = that.pinkT.totalNum; |
data.cartNum = that.pinkT.totalNum; |
||||||
data.uniqueId = ""; |
data.uniqueId = ""; |
||||||
data.combinationId = that.storeCombination.id; |
data.combinationId = that.storeCombination.id; |
||||||
data.new = 1; |
data.new = 1; |
||||||
postCartAdd(data) |
postCartAdd(data) |
||||||
.then(res => { |
.then(res => { |
||||||
that.$yrouter.push({ |
that.$yrouter.push({ |
||||||
path: "/pages/order/OrderSubmission/index", |
path: "/pages/order/OrderSubmission/index", |
||||||
query: { |
query: { |
||||||
id: res.data.cartId, |
id: res.data.cartId, |
||||||
pinkid: that.pinkId |
pinkid: that.pinkId |
||||||
} |
} |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
.catch(err => { |
.catch(err => { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: err.msg || err.response.data.msg, |
title: err.msg || err.response.data.msg, |
||||||
icon: 'none', |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goPoster: function() { |
goPoster: function() { |
||||||
var that = this; |
var that = this; |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/activity/Poster/index", |
path: "/pages/activity/Poster/index", |
||||||
query: { |
query: { |
||||||
id: that.pinkId, |
id: that.pinkId, |
||||||
type: 1 |
type: 1 |
||||||
} |
} |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goOrder: function() { |
goOrder: function() { |
||||||
var that = this; |
var that = this; |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/order/OrderDetails/index", |
path: "/pages/order/OrderDetails/index", |
||||||
query: { |
query: { |
||||||
id: that.currentPinkOrder |
id: that.currentPinkOrder |
||||||
} |
} |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
//拼团列表 |
//拼团列表 |
||||||
goList: function() { |
goList: function() { |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/activity/GoodsGroup/index" |
path: "/pages/activity/GoodsGroup/index" |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
//拼团详情 |
//拼团详情 |
||||||
goDetail: function(id) { |
goDetail: function(id) { |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/activity/GroupDetails/index", |
path: "/pages/activity/GroupDetails/index", |
||||||
query: { |
query: { |
||||||
id |
id |
||||||
} |
} |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
//拼团信息 |
//拼团信息 |
||||||
getCombinationPink: function() { |
getCombinationPink: function() { |
||||||
var that = this; |
var that = this; |
||||||
getCombinationPink(that.pinkId).then(res => { |
getCombinationPink(that.pinkId).then(res => { |
||||||
that.$set(that, "storeCombination", res.data.storeCombination); |
that.$set(that, "storeCombination", res.data.storeCombination); |
||||||
that.$set(that, "pinkT", res.data.pinkT); |
that.$set(that, "pinkT", res.data.pinkT); |
||||||
that.$set(that, "pinkAll", res.data.pinkAll); |
that.$set(that, "pinkAll", res.data.pinkAll); |
||||||
that.$set(that, "count", res.data.count); |
that.$set(that, "count", res.data.count); |
||||||
that.$set(that, "userBool", res.data.userBool); |
that.$set(that, "userBool", res.data.userBool); |
||||||
that.$set(that, "pinkBool", res.data.pinkBool); |
that.$set(that, "pinkBool", res.data.pinkBool); |
||||||
that.$set(that, "isOk", res.data.isOk); |
that.$set(that, "isOk", res.data.isOk); |
||||||
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder); |
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder); |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
//拼团取消 |
//拼团取消 |
||||||
getCombinationRemove: function() { |
getCombinationRemove: function() { |
||||||
var that = this; |
var that = this; |
||||||
getCombinationRemove({ |
getCombinationRemove({ |
||||||
id: that.pinkId, |
id: that.pinkId, |
||||||
cid: that.storeCombination.id |
cid: that.storeCombination.id |
||||||
}) |
}) |
||||||
.then(res => { |
.then(res => { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: res.msg, |
title: res.msg, |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
.catch(res => { |
.catch(res => { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: res.msg, |
title: res.msg, |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
lookAll: function() { |
lookAll: function() { |
||||||
this.iShidden = !this.iShidden; |
this.iShidden = !this.iShidden; |
||||||
} |
} |
||||||
} |
} |
||||||
}; |
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
|
<style lang="less"> |
||||||
|
.tips-warp{ |
||||||
|
text-align: center; |
||||||
|
margin-top: 20rpx; |
||||||
|
} |
||||||
|
</style> |
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,364 +1,384 @@ |
|||||||
<template> |
<template> |
||||||
<view class="user"> |
<view class="user"> |
||||||
<view v-if="userInfo.uid"> |
<view v-if="$store.getters.token||userInfo.uid"> |
||||||
<view class="header bg-color-red acea-row row-between-wrapper"> |
<view class="header bg-color-red acea-row row-between-wrapper"> |
||||||
<view class="picTxt acea-row row-between-wrapper"> |
<view class="picTxt acea-row row-between-wrapper"> |
||||||
<view class="pictrue"> |
<view class="pictrue"> |
||||||
<image :src="userInfo.avatar" /> |
<image :src="userInfo.avatar" /> |
||||||
</view> |
</view> |
||||||
<view class="text"> |
<view class="text"> |
||||||
<view class="acea-row row-middle"> |
<view class="acea-row row-middle"> |
||||||
<view class="name line1">{{ userInfo.nickname }}</view> |
<view class="name line1">{{ userInfo.nickname }}</view> |
||||||
<view class="member acea-row row-middle" v-if="userInfo.vip"> |
<view class="member acea-row row-middle" v-if="userInfo.vip"> |
||||||
<image :src="userInfo.vipIcon" /> |
<image :src="userInfo.vipIcon" /> |
||||||
<text>{{ userInfo.vipName }}</text> |
<text>{{ userInfo.vipName }}</text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view @click="goPersonalData()" class="id" v-if="userInfo.phone"> |
<view @click="goPersonalData()" class="id" v-if="userInfo.phone"> |
||||||
<text>ID:{{ userInfo.uid || 0}}</text> |
<text>ID:{{ userInfo.uid || 0}}</text> |
||||||
<text class="iconfont icon-bianji1"></text> |
<text class="iconfont icon-bianji1"></text> |
||||||
</view> |
</view> |
||||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else> |
<button |
||||||
<text>绑定手机号</text> |
open-type="getPhoneNumber" |
||||||
</button> |
@getphonenumber="getPhoneNumber" |
||||||
</view> |
class="binding" |
||||||
</view> |
v-else |
||||||
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text> |
> |
||||||
</view> |
<text>绑定手机号</text> |
||||||
<view class="wrapper"> |
</button> |
||||||
<view class="nav acea-row row-middle"> |
</view> |
||||||
<view @click="goUserAccount()" class="item"> |
</view> |
||||||
<text>我的余额</text> |
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text> |
||||||
<text class="num">{{ userInfo.nowMoney || 0 }}</text> |
</view> |
||||||
</view> |
<view class="wrapper"> |
||||||
<view @click="goUserPromotion()" class="item" v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"> |
<view class="nav acea-row row-middle"> |
||||||
<text>当前佣金</text> |
<view @click="goUserAccount()" class="item"> |
||||||
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text> |
<text>我的余额</text> |
||||||
</view> |
<text class="num">{{ userInfo.nowMoney || 0 }}</text> |
||||||
<view @click="goIntegral()" class="item" v-else> |
</view> |
||||||
<text>当前积分</text> |
<view |
||||||
<text class="num">{{ userInfo.integral || 0 }}</text> |
@click="goUserPromotion()" |
||||||
</view> |
class="item" |
||||||
<view @click="goUserCoupon()" class="item"> |
v-if="userInfo.isPromoter === 1 || userInfo.statu === 2" |
||||||
<text>优惠券</text> |
> |
||||||
<text class="num">{{ userInfo.couponCount || 0 }}</text> |
<text>当前佣金</text> |
||||||
</view> |
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text> |
||||||
</view> |
</view> |
||||||
<view class="myOrder"> |
<view @click="goIntegral()" class="item" v-else> |
||||||
<view class="title acea-row row-between-wrapper"> |
<text>当前积分</text> |
||||||
<text>我的订单</text> |
<text class="num">{{ userInfo.integral || 0 }}</text> |
||||||
<text @click="goMyOrder()" class="allOrder"> |
</view> |
||||||
<text>全部订单</text> |
<view @click="goUserCoupon()" class="item"> |
||||||
<text class="iconfont icon-jiantou"></text> |
<text>优惠券</text> |
||||||
</text> |
<text class="num">{{ userInfo.couponCount || 0 }}</text> |
||||||
</view> |
</view> |
||||||
<view class="orderState acea-row row-middle"> |
</view> |
||||||
<view @click="goMyOrder(0)" class="item"> |
<view class="myOrder"> |
||||||
<view class="pictrue"> |
<view class="title acea-row row-between-wrapper"> |
||||||
<image src="@/static/images/dfk.png" /> |
<text>我的订单</text> |
||||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unpaidCount > 0">{{ userInfo.orderStatusNum.unpaidCount }}</text> |
<text @click="goMyOrder()" class="allOrder"> |
||||||
</view> |
<text>全部订单</text> |
||||||
<view>待付款</view> |
<text class="iconfont icon-jiantou"></text> |
||||||
</view> |
</text> |
||||||
<view @click="goMyOrder(1)" class="item"> |
</view> |
||||||
<view class="pictrue"> |
<view class="orderState acea-row row-middle"> |
||||||
<image src="@/static/images/dfh.png" /> |
<view @click="goMyOrder(0)" class="item"> |
||||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unshippedCount > 0">{{ userInfo.orderStatusNum.unshippedCount }}</text> |
<view class="pictrue"> |
||||||
</view> |
<image src="@/static/images/dfk.png" /> |
||||||
<view>待发货</view> |
<text |
||||||
</view> |
class="order-status-num" |
||||||
<view @click="goMyOrder(2)" class="item"> |
v-if="userInfo.orderStatusNum.unpaidCount > 0" |
||||||
<view class="pictrue"> |
>{{ userInfo.orderStatusNum.unpaidCount }}</text> |
||||||
<image src="@/static/images/dsh.png" /> |
</view> |
||||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.receivedCount > 0">{{ userInfo.orderStatusNum.receivedCount }}</text> |
<view>待付款</view> |
||||||
</view> |
</view> |
||||||
<text>待收货</text> |
<view @click="goMyOrder(1)" class="item"> |
||||||
</view> |
<view class="pictrue"> |
||||||
<view @click="goMyOrder(3)" class="item"> |
<image src="@/static/images/dfh.png" /> |
||||||
<view class="pictrue"> |
<text |
||||||
<image src="@/static/images/dpj.png" /> |
class="order-status-num" |
||||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.evaluatedCount > 0">{{ userInfo.orderStatusNum.evaluatedCount }}</text> |
v-if="userInfo.orderStatusNum.unshippedCount > 0" |
||||||
</view> |
>{{ userInfo.orderStatusNum.unshippedCount }}</text> |
||||||
<text>待评价</text> |
</view> |
||||||
</view> |
<view>待发货</view> |
||||||
<view @click="goReturnList()" class="item"> |
</view> |
||||||
<view class="pictrue"> |
<view @click="goMyOrder(2)" class="item"> |
||||||
<image src="@/static/images/sh.png" /> |
<view class="pictrue"> |
||||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text> |
<image src="@/static/images/dsh.png" /> |
||||||
</view> |
<text |
||||||
<text>售后/退款</text> |
class="order-status-num" |
||||||
</view> |
v-if="userInfo.orderStatusNum.receivedCount > 0" |
||||||
</view> |
>{{ userInfo.orderStatusNum.receivedCount }}</text> |
||||||
</view> |
</view> |
||||||
<view class="myService"> |
<text>待收货</text> |
||||||
<view class="title acea-row row-middle"> |
</view> |
||||||
<text>我的服务</text> |
<view @click="goMyOrder(3)" class="item"> |
||||||
</view> |
<view class="pictrue"> |
||||||
<view class="serviceList acea-row row-middle"> |
<image src="@/static/images/dpj.png" /> |
||||||
<template v-for="(item, MyMenusIndex) in MyMenus"> |
<text |
||||||
<view class="item" :key="MyMenusIndex" @click="goPages(MyMenusIndex)" v-if="item.url"> |
class="order-status-num" |
||||||
<view class="pictrue"> |
v-if="userInfo.orderStatusNum.evaluatedCount > 0" |
||||||
<image :src="item.pic" /> |
>{{ userInfo.orderStatusNum.evaluatedCount }}</text> |
||||||
</view> |
</view> |
||||||
<view>{{ item.name }}</view> |
<text>待评价</text> |
||||||
</view> |
</view> |
||||||
</template> |
<view @click="goReturnList()" class="item"> |
||||||
</view> |
<view class="pictrue"> |
||||||
</view> |
<image src="@/static/images/sh.png" /> |
||||||
<!--<view --> |
<text |
||||||
<!--class="item"--> |
class="order-status-num" |
||||||
<!--@click="changeswitch(true)"--> |
v-if="userInfo.orderStatusNum.refundCount > 0" |
||||||
<!--v-if="userInfo.phone && isWeixin"--> |
>{{ userInfo.orderStatusNum.refundCount }}</text> |
||||||
<!-->--> |
</view> |
||||||
<!--<view class="pictrue"><image src="@/static/images/switch.png" /></view>--> |
<text>售后/退款</text> |
||||||
<!--<view>账号切换</!--<view>--> |
</view> |
||||||
<!--</!--<view>--> |
</view> |
||||||
<!-- </view> |
</view> |
||||||
|
<view class="myService"> |
||||||
|
<view class="title acea-row row-middle"> |
||||||
|
<text>我的服务</text> |
||||||
|
</view> |
||||||
|
<view class="serviceList acea-row row-middle"> |
||||||
|
<template v-for="(item, MyMenusIndex) in MyMenus"> |
||||||
|
<view |
||||||
|
class="item" |
||||||
|
:key="MyMenusIndex" |
||||||
|
@click="goPages(MyMenusIndex)" |
||||||
|
v-if="item.url&&item.id!='230'" |
||||||
|
> |
||||||
|
<view class="pictrue"> |
||||||
|
<image :src="item.pic" /> |
||||||
|
</view> |
||||||
|
<view>{{ item.name }}</view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<!--<view --> |
||||||
|
<!--class="item"--> |
||||||
|
<!--@click="changeswitch(true)"--> |
||||||
|
<!--v-if="userInfo.phone && isWeixin"--> |
||||||
|
<!-->--> |
||||||
|
<!--<view class="pictrue"><image src="@/static/images/switch.png" /></view>--> |
||||||
|
<!--<view>账号切换</!--<view>--> |
||||||
|
<!--</!--<view>--> |
||||||
|
<!-- </view> |
||||||
</view>--> |
</view>--> |
||||||
</view> |
</view> |
||||||
<view class="by"> |
<view class="by"> |
||||||
<text class="by-text">By@意象</text> |
<text class="by-text">By@意象</text> |
||||||
</view> |
</view> |
||||||
<view class="by"> |
<view class="by"> |
||||||
<view> |
<view> |
||||||
<text class="by-text">Copyright © 2020</text> |
<text class="by-text">Copyright © 2020</text> |
||||||
</view> |
</view> |
||||||
<view> |
<view> |
||||||
<text class="by-text">漯河市大有前途网络科技有限公司</text> |
<text class="by-text">漯河市大有前途网络科技有限公司</text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="footer-line-height"></view> |
<view class="footer-line-height"></view> |
||||||
<!-- <SwitchWindow |
<!-- <SwitchWindow |
||||||
v-on:changeswitch="changeswitch" |
v-on:changeswitch="changeswitch" |
||||||
:switchActive="switchActive" |
:switchActive="switchActive" |
||||||
:login_type="userInfo.login_type" |
:login_type="userInfo.login_type" |
||||||
></SwitchWindow> --> |
></SwitchWindow>--> |
||||||
</view> |
</view> |
||||||
<Authorization v-if="!$store.getters.token" /> |
<Authorization v-if="!$store.getters.token" /> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
import { |
import { getUser, getMenuUser, bindingPhone } from "@/api/user"; |
||||||
getUser, |
import { isWeixin, VUE_APP_RESOURCES_URL } from "@/utils"; |
||||||
getMenuUser, |
import SwitchWindow from "@/components/SwitchWindow"; |
||||||
bindingPhone |
import Authorization from "@/pages/authorization/index"; |
||||||
} from "@/api/user"; |
import { mapGetters } from "vuex"; |
||||||
import { |
|
||||||
isWeixin, |
|
||||||
VUE_APP_RESOURCES_URL |
|
||||||
} from "@/utils"; |
|
||||||
import SwitchWindow from "@/components/SwitchWindow"; |
|
||||||
import Authorization from "@/pages/authorization/index"; |
|
||||||
import { |
|
||||||
mapGetters |
|
||||||
} from "vuex"; |
|
||||||
|
|
||||||
const NAME = "User"; |
const NAME = "User"; |
||||||
|
|
||||||
export default { |
export default { |
||||||
name: NAME, |
name: NAME, |
||||||
components: { |
components: { |
||||||
SwitchWindow, |
SwitchWindow, |
||||||
Authorization |
Authorization |
||||||
}, |
}, |
||||||
props: {}, |
props: {}, |
||||||
data: function() { |
data: function() { |
||||||
return { |
return { |
||||||
MyMenus: [], |
MyMenus: [], |
||||||
switchActive: false, |
switchActive: false, |
||||||
isWeixin: false |
isWeixin: false |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
computed: mapGetters(["userInfo"]), |
computed: mapGetters(["userInfo"]), |
||||||
methods: { |
methods: { |
||||||
goReturnList() { |
goReturnList() { |
||||||
this.$yrouter.push("/pages/order/ReturnList/index"); |
this.$yrouter.push("/pages/order/ReturnList/index"); |
||||||
}, |
}, |
||||||
goMyOrder(type) { |
goMyOrder(type) { |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/order/MyOrder/index", |
path: "/pages/order/MyOrder/index", |
||||||
query: { |
query: { |
||||||
type |
type |
||||||
} |
} |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goUserCoupon() { |
goUserCoupon() { |
||||||
this.$yrouter.push("/pages/user/coupon/UserCoupon/index"); |
this.$yrouter.push("/pages/user/coupon/UserCoupon/index"); |
||||||
}, |
}, |
||||||
goIntegral() { |
goIntegral() { |
||||||
this.$yrouter.push("/pages/user/signIn/Integral/index"); |
this.$yrouter.push("/pages/user/signIn/Integral/index"); |
||||||
}, |
}, |
||||||
goUserPromotion() { |
goUserPromotion() { |
||||||
this.$yrouter.push("/pages/user/promotion/UserPromotion/index"); |
this.$yrouter.push("/pages/user/promotion/UserPromotion/index"); |
||||||
}, |
}, |
||||||
goUserAccount() { |
goUserAccount() { |
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: "/pages/user/UserAccount/index" |
path: "/pages/user/UserAccount/index" |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goPersonalData() { |
goPersonalData() { |
||||||
this.$yrouter.push("/pages/user/PersonalData/index"); |
this.$yrouter.push("/pages/user/PersonalData/index"); |
||||||
}, |
}, |
||||||
getPhoneNumber: function(e) { |
getPhoneNumber: function(e) { |
||||||
console.log(e.mp.detail); |
console.log(e.mp.detail); |
||||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定 |
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定 |
||||||
if (e.mp.detail.errMsg == "getPhoneNumber:ok") { |
if (e.mp.detail.errMsg == "getPhoneNumber:ok") { |
||||||
uni.showLoading({ |
uni.showLoading({ |
||||||
title: "绑定中" |
title: "绑定中" |
||||||
}); |
}); |
||||||
// 获取当前环境的服务商 |
// 获取当前环境的服务商 |
||||||
uni.getProvider({ |
uni.getProvider({ |
||||||
service: "oauth", |
service: "oauth", |
||||||
success: function(res) { |
success: function(res) { |
||||||
console.log(res.provider); |
console.log(res.provider); |
||||||
// 此处可以排除h5 |
// 此处可以排除h5 |
||||||
if (res.provider) { |
if (res.provider) { |
||||||
uni.login({ |
uni.login({ |
||||||
success: loginRes => { |
success: loginRes => { |
||||||
bindingPhone({ |
bindingPhone({ |
||||||
code: loginRes.code, |
code: loginRes.code, |
||||||
encryptedData: e.mp.detail.encryptedData, |
encryptedData: e.mp.detail.encryptedData, |
||||||
iv: e.mp.detail.iv |
iv: e.mp.detail.iv |
||||||
}) |
}) |
||||||
.then(res => { |
.then(res => { |
||||||
this.User(); |
this.User(); |
||||||
uni.hideLoading(); |
uni.hideLoading(); |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: res.msg, |
title: res.msg, |
||||||
icon: "success", |
icon: "success", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
.catch(error => { |
.catch(error => { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: error.msg || error.response.data.msg, |
title: error.msg || error.response.data.msg, |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}); |
}); |
||||||
} |
} |
||||||
}); |
}); |
||||||
} |
} |
||||||
} |
} |
||||||
}); |
}); |
||||||
} else { |
} else { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: "已拒绝授权", |
title: "已拒绝授权", |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
} |
} |
||||||
}, |
}, |
||||||
changeswitch: function(data) { |
changeswitch: function(data) { |
||||||
this.switchActive = data; |
this.switchActive = data; |
||||||
}, |
}, |
||||||
User: function() { |
User: function() { |
||||||
let that = this; |
let that = this; |
||||||
// getUser().then(res => { |
// getUser().then(res => { |
||||||
// that.user = res.data; |
// that.user = res.data; |
||||||
// that.orderStatusNum = res.data.orderStatusNum; |
// that.orderStatusNum = res.data.orderStatusNum; |
||||||
// }); |
// }); |
||||||
}, |
}, |
||||||
MenuUser: function() { |
MenuUser: function() { |
||||||
let that = this; |
let that = this; |
||||||
getMenuUser().then(res => { |
getMenuUser().then(res => { |
||||||
that.MyMenus = res.data.routine_my_menus; |
that.MyMenus = res.data.routine_my_menus; |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
goPages: function(index) { |
goPages: function(index) { |
||||||
let url = this.MyMenus[index].uniapp_url; |
let url = this.MyMenus[index].uniapp_url; |
||||||
if ( |
if ( |
||||||
url === "/pages/user/promotion/UserPromotion/index" && |
url === "/pages/user/promotion/UserPromotion/index" && |
||||||
this.userInfo.statu === 1 |
this.userInfo.statu === 1 |
||||||
) { |
) { |
||||||
if (!this.userInfo.isPromoter) { |
if (!this.userInfo.isPromoter) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: "您还没有推广权限!!", |
title: "您还没有推广权限!!", |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
return; |
return; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
if ( |
if ( |
||||||
url === "/pages/orderAdmin/OrderIndex/index" && |
url === "/pages/orderAdmin/OrderIndex/index" && |
||||||
!this.userInfo.adminid |
!this.userInfo.adminid |
||||||
) { |
) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: "您还不是管理员!!", |
title: "您还不是管理员!!", |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
return; |
return; |
||||||
} |
} |
||||||
|
|
||||||
this.$yrouter.push({ |
this.$yrouter.push({ |
||||||
path: this.MyMenus[index].uniapp_url |
path: this.MyMenus[index].uniapp_url |
||||||
}); |
}); |
||||||
} |
} |
||||||
}, |
}, |
||||||
watch: { |
watch: { |
||||||
userInfo() { |
userInfo() { |
||||||
this.MenuUser(); |
this.MenuUser(); |
||||||
} |
} |
||||||
}, |
}, |
||||||
onShow() { |
onShow() { |
||||||
console.log(this.$store.getters.token) |
console.log(this.$store.getters.token); |
||||||
console.log(this.userInfo); |
console.log(this.userInfo); |
||||||
if (this.$store.getters.token) { |
if (this.$store.getters.token) { |
||||||
this.User(); |
this.User(); |
||||||
this.MenuUser(); |
this.MenuUser(); |
||||||
this.isWeixin = isWeixin(); |
this.isWeixin = isWeixin(); |
||||||
} |
} |
||||||
} |
} |
||||||
}; |
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="less"> |
<style lang="less"> |
||||||
.footer-line-height { |
.footer-line-height { |
||||||
height: 1*100rpx; |
height: 1 * 100rpx; |
||||||
} |
} |
||||||
|
|
||||||
.order-status-num { |
.order-status-num { |
||||||
min-width: 0.33*100rpx; |
min-width: 0.33 * 100rpx; |
||||||
background-color: #fff; |
background-color: #fff; |
||||||
color: #00c17b; |
color: #00c17b; |
||||||
border-radius: 15px; |
border-radius: 15px; |
||||||
position: absolute; |
position: absolute; |
||||||
right: -0.14*100rpx; |
right: -0.14 * 100rpx; |
||||||
top: -0.15*100rpx; |
top: -0.15 * 100rpx; |
||||||
font-size: 0.2*100rpx; |
font-size: 0.2 * 100rpx; |
||||||
padding: 0 0.08*100rpx; |
padding: 0 0.08 * 100rpx; |
||||||
border: 1px solid #00c17b; |
border: 1px solid #00c17b; |
||||||
} |
} |
||||||
|
|
||||||
.pictrue { |
.pictrue { |
||||||
position: relative; |
position: relative; |
||||||
} |
} |
||||||
|
|
||||||
.switch-h5 { |
.switch-h5 { |
||||||
margin-left: 0.2*100rpx; |
margin-left: 0.2 * 100rpx; |
||||||
} |
} |
||||||
|
|
||||||
.binding { |
.binding { |
||||||
margin-top: 0.1*100rpx; |
margin-top: 0.1 * 100rpx; |
||||||
display: inline-block; |
display: inline-block; |
||||||
padding: 0.05*100rpx 0.2*100rpx; |
padding: 0.05 * 100rpx 0.2 * 100rpx; |
||||||
background-color: #ca1f10; |
background-color: #ca1f10; |
||||||
border-radius: 50px; |
border-radius: 50px; |
||||||
font-size: 0.22*100rpx; |
font-size: 0.22 * 100rpx; |
||||||
line-height: 1.5; |
line-height: 1.5; |
||||||
border: 1px solid #e8695e; |
border: 1px solid #e8695e; |
||||||
color: #ffffff; |
color: #ffffff; |
||||||
} |
} |
||||||
|
|
||||||
.by{ |
.by { |
||||||
text-align:center; |
text-align: center; |
||||||
margin-top: 30rpx |
margin-top: 30rpx; |
||||||
} |
} |
||||||
.by-text{ |
.by-text { |
||||||
text-align:center; |
text-align: center; |
||||||
font-size: 30rpx; |
font-size: 30rpx; |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,153 +1,160 @@ |
|||||||
<template> |
<template> |
||||||
<view class="distribution-posters"> |
<view class="distribution-posters"> |
||||||
<view class="slider-banner banner"> |
<view class="slider-banner banner"> |
||||||
<swiper indicatorDots="true"> |
<swiper indicatorDots="true"> |
||||||
<block v-for="(item, infoIndex) in info" :key="infoIndex"> |
<block v-for="(item, infoIndex) in info" :key="infoIndex"> |
||||||
<swiper-item> |
<swiper-item> |
||||||
<image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress /> |
<image |
||||||
</swiper-item> |
class="slide-image" |
||||||
</block> |
:src="item.wap_poster" |
||||||
</swiper> |
mode="widthFix" |
||||||
</view> |
show-menu-by-longpress |
||||||
<view class="keep bg-color-red" @click="saveImg">保存海报</view> |
/> |
||||||
</view> |
</swiper-item> |
||||||
|
</block> |
||||||
|
</swiper> |
||||||
|
</view> |
||||||
|
<view class="keep bg-color-red" @click="saveImg">保存海报</view> |
||||||
|
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
// import { swiper, swiperSlide } from "vue-awesome-swiper"; |
// import { swiper, swiperSlide } from "vue-awesome-swiper"; |
||||||
import { |
import { getSpreadImg } from "@/api/user"; |
||||||
getSpreadImg |
|
||||||
} from "@/api/user"; |
|
||||||
|
|
||||||
export default { |
export default { |
||||||
name: "Poster", |
name: "Poster", |
||||||
components: { |
components: { |
||||||
// swiper, |
// swiper, |
||||||
// swiperSlide |
// swiperSlide |
||||||
}, |
}, |
||||||
props: {}, |
props: {}, |
||||||
data: function() { |
data: function() { |
||||||
return { |
return { |
||||||
swiperPosters: { |
swiperPosters: { |
||||||
speed: 1000, |
speed: 1000, |
||||||
effect: "coverflow", |
effect: "coverflow", |
||||||
slidesPerView: "auto", |
slidesPerView: "auto", |
||||||
centeredSlides: true, |
centeredSlides: true, |
||||||
coverflowEffect: { |
coverflowEffect: { |
||||||
rotate: 0, // 旋转的角度 |
rotate: 0, // 旋转的角度 |
||||||
stretch: -20, // 拉伸 图片间左右的间距和密集度 |
stretch: -20, // 拉伸 图片间左右的间距和密集度 |
||||||
depth: 100, // 深度 切换图片间上下的间距和密集度 |
depth: 100, // 深度 切换图片间上下的间距和密集度 |
||||||
modifier: 3, // 修正值 该值越大前面的效果越明显 |
modifier: 3, // 修正值 该值越大前面的效果越明显 |
||||||
slideShadows: false // 页面阴影效果 |
slideShadows: false // 页面阴影效果 |
||||||
}, |
}, |
||||||
observer: true, |
observer: true, |
||||||
observeParents: true |
observeParents: true |
||||||
}, |
}, |
||||||
info: [], |
info: [], |
||||||
activeIndex: 0 |
activeIndex: 0 |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
mounted: function() { |
mounted: function() { |
||||||
this.getIndex(); |
this.getIndex(); |
||||||
let that = this; |
let that = this; |
||||||
// this.swiper.on("slideChange", function() { |
// this.swiper.on("slideChange", function() { |
||||||
// that.activeIndex = that.swiper.activeIndex; |
// that.activeIndex = that.swiper.activeIndex; |
||||||
// }); |
// }); |
||||||
}, |
}, |
||||||
computed: { |
computed: { |
||||||
swiper() { |
swiper() { |
||||||
// return this.$refs.mySwiper.swiper; |
// return this.$refs.mySwiper.swiper; |
||||||
} |
} |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
getIndex: function() { |
getIndex: function() { |
||||||
let that = this; |
let that = this; |
||||||
let form = {} |
let form = {}; |
||||||
if (this.$deviceType == 'app') { |
if (this.$deviceType == "app") { |
||||||
form.form = 'app' |
form.form = "app"; |
||||||
} |
} |
||||||
getSpreadImg(form).then( |
getSpreadImg(form).then( |
||||||
res => { |
res => { |
||||||
that.info = res.data; |
that.info = res.data; |
||||||
}, |
}, |
||||||
err => { |
err => { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: err.msg || err.response.data.msg, |
title: err.msg || err.response.data.msg, |
||||||
icon: 'none', |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
} |
} |
||||||
); |
); |
||||||
}, |
}, |
||||||
downloadIamge: function(imgsrc, name) { |
downloadIamge: function(imgsrc, name) { |
||||||
var that = this; |
var that = this; |
||||||
this.isDown = true; |
this.isDown = true; |
||||||
var downloadUrl = imgsrc; |
var downloadUrl = imgsrc; |
||||||
|
|
||||||
if (!wx.saveImageToPhotosAlbum) { |
if (!wx.saveImageToPhotosAlbum) { |
||||||
uni.showModal({ |
uni.showModal({ |
||||||
title: "提示", |
title: "提示", |
||||||
content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。" |
content: |
||||||
}); |
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。" |
||||||
that.openDialogVisible = true; |
}); |
||||||
|
that.openDialogVisible = true; |
||||||
|
|
||||||
return; |
return; |
||||||
} |
} |
||||||
|
|
||||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope |
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope |
||||||
wx.getSetting({ |
wx.getSetting({ |
||||||
success(res) { |
success(res) { |
||||||
if (!res.authSetting["scope.writePhotosAlbum"]) { |
if (!res.authSetting["scope.writePhotosAlbum"]) { |
||||||
that.openDialogVisible = true; |
that.openDialogVisible = true; |
||||||
|
|
||||||
// 接口调用询问 |
// 接口调用询问 |
||||||
wx.authorize({ |
wx.authorize({ |
||||||
scope: "scope.writePhotosAlbum", |
scope: "scope.writePhotosAlbum", |
||||||
success() { |
success() { |
||||||
that.downloadImage(downloadUrl); |
that.downloadImage(downloadUrl); |
||||||
}, |
}, |
||||||
fail() { |
fail() { |
||||||
// 用户拒绝了授权 |
// 用户拒绝了授权 |
||||||
// 打开设置页面 |
// 打开设置页面 |
||||||
wx.openSetting({ |
wx.openSetting({ |
||||||
success: function(data) {}, |
success: function(data) {}, |
||||||
fail: function(data) {} |
fail: function(data) {} |
||||||
}); |
}); |
||||||
} |
} |
||||||
}); |
}); |
||||||
} else { |
} else { |
||||||
that.downloadImage(downloadUrl); |
that.downloadImage(downloadUrl); |
||||||
} |
} |
||||||
}, |
}, |
||||||
fail(res) { |
fail(res) { |
||||||
that.openDialogVisible = true; |
that.openDialogVisible = true; |
||||||
} |
} |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
saveImg: function() { |
saveImg: function() { |
||||||
this.downloadIamge( |
this.downloadIamge( |
||||||
this.info[this.activeIndex].wap_poster, |
this.info[this.activeIndex].wap_poster, |
||||||
"poster" + this.activeIndex |
"poster" + this.activeIndex |
||||||
); |
); |
||||||
} |
} |
||||||
} |
} |
||||||
}; |
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped lang="less"> |
<style lang="less"> |
||||||
.distribution-posters { |
page { |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
|
.distribution-posters { |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
|
||||||
.banenr { |
.banenr { |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
|
|
||||||
.banner swiper { |
.banner swiper { |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
|
|
||||||
.banner .slide-image { |
.banner .slide-image { |
||||||
width: 100%; |
width: 100%; |
||||||
height: auto; |
height: auto; |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
Loading…
Reference in new issue