支付增加订阅功能,增加海报生成传递from类型

This commit is contained in:
Gao xiaosong
2020-09-13 20:09:48 +08:00
parent a6cf6d8824
commit a004ec3b10
12 changed files with 1127 additions and 1061 deletions

View File

@ -9,71 +9,81 @@
</view>
</template>
<script>
import { getBargainPoster, getCombinationPoster } from "@/api/activity";
import {
getBargainPoster,
getCombinationPoster
} from "@/api/activity";
export default {
name: "Poster",
components: {},
props: {},
data: function() {
return {
status: true,
id: 0,
image: ""
};
},
mounted: function() {
var that = this;
var id = that.$yroute.query.id;
var type = that.$yroute.query.type;
that.id = id;
if (type == 2) {
that.getBargainPoster();
} else {
that.getCombinationPoster();
}
},
methods: {
getBargainPoster: function() {
var that = this;
getBargainPoster({ bargainId: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
export default {
name: "Poster",
components: {},
props: {},
data: function () {
return {
status: true,
id: 0,
image: ""
};
},
// 拼团海报
getCombinationPoster: function() {
mounted: function () {
var that = this;
getCombinationPoster({ id: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
var id = that.$yroute.query.id;
var type = that.$yroute.query.type;
that.id = id;
if (type == 2) {
that.getBargainPoster();
} else {
that.getCombinationPoster();
}
},
methods: {
getBargainPoster: function () {
var that = this;
getBargainPoster({
bargainId: that.id,
from: "wechat"
})
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
});
},
// 拼团海报
getCombinationPoster: function () {
var that = this;
getCombinationPoster({
id: that.id,
from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType
})
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
}
}
}
};
};
</script>
<style scoped lang="less">
page {
background-color: #eb3729;
}
.poster-poster {
height: unset !important;
}
page {
background-color: #eb3729;
}
.poster-poster {
height: unset !important;
}
</style>