Feat:接口对接
This commit is contained in:
@@ -100,6 +100,11 @@
|
||||
<script>
|
||||
import CountDownUnit from "@/pkg_product/components/CountDownUnit.vue";
|
||||
import {getSeckillRule, getSeckillTopList, getYxStoreSeckillIndex, getYxStoreSeckillPageList} from "@/api/goods";
|
||||
import {secKillShareImage} from "@/api/share";
|
||||
import {mapGetters} from "vuex";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import {userBindParent} from "@/api/user";
|
||||
import {getUrlParam} from "@/utils/common.js";
|
||||
|
||||
export default {
|
||||
name: "seckill",
|
||||
@@ -119,10 +124,38 @@ export default {
|
||||
endReach: false,
|
||||
timeId: null,
|
||||
nextList: [],
|
||||
ruleContent: null
|
||||
ruleContent: null,
|
||||
partnerId: null
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
computed: mapGetters(["userInfo", "isLogin"]),
|
||||
onShareAppMessage() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const {status, data} = await secKillShareImage();
|
||||
if (status === 200) {
|
||||
resolve({
|
||||
title: '探寻有趣有味的生活方式',
|
||||
path: '/pkg_product/views/seckill?partnerId=' + this.userInfo.uid,
|
||||
imageUrl: data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.partnerId) {
|
||||
this.partnerId = options.partnerId || null;
|
||||
} else {
|
||||
let obj = uni.getEnterOptionsSync();
|
||||
if (options.scene != null || obj.query.scene != null) {
|
||||
let query = options ? decodeURIComponent(options.scene) : decodeURIComponent(obj.query.scene);
|
||||
this.partnerId = getUrlParam(query, "partnerId") || null;
|
||||
}
|
||||
}
|
||||
if (this.partnerId) {
|
||||
cookie.set("spread", this.partnerId);
|
||||
userBindParent({spread: parseInt(this.partnerId)});
|
||||
}
|
||||
|
||||
this.fetchSession();
|
||||
getSeckillRule().then(({data}) => this.ruleContent = data);
|
||||
getSeckillTopList(1, 10).then(({data}) => this.topList = data.records);
|
||||
|
||||
Reference in New Issue
Block a user