Merge branch 'master' of http://git.excellentkk.cn/C.C/nk-shop2.0
This commit is contained in:
commit
e84bdf7f32
@ -203,7 +203,7 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<scroll-view scroll-y="true" v-if="currentNav === 3" class="video-list"
|
||||
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :refresher-triggered="isTriggered" @scrolltolower="GetList()" >
|
||||
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :refresher-triggered="isTriggered" @scrolltolower="getGoods()" >
|
||||
<block v-for="(item,index) in cateGoods" :key="index">
|
||||
<view class="goods_item" @click="gogogo(item)">
|
||||
<image class="goods_img" :src="item.image[0]" mode="aspectFill"></image>
|
||||
@ -388,10 +388,11 @@
|
||||
where: {
|
||||
category_id: -1,
|
||||
page: 1,
|
||||
limit: 10
|
||||
limit: 5
|
||||
},
|
||||
communityId:'',
|
||||
Listcount:''
|
||||
Listcount:'',
|
||||
loadMore: true,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -426,7 +427,6 @@
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options);
|
||||
this.getOptions(options);
|
||||
this.videoID = options.id;
|
||||
this.isUser = options.user == 1 ? true : false;
|
||||
@ -451,27 +451,6 @@
|
||||
},
|
||||
onReady: function() {},
|
||||
methods: {
|
||||
async GetList(){
|
||||
// if(this.cateGoods.length > )
|
||||
console.log(this.Listcount);
|
||||
if(this.cateGoods.length < this.Listcount){
|
||||
console.log('123');
|
||||
const {data} = await graphicLstApi({
|
||||
category_id:-1,
|
||||
page: this.page++,
|
||||
limit: this.limit,
|
||||
})
|
||||
this.cateGoods.push(...data.list)
|
||||
if(data.list.length < this.limit){
|
||||
this.$util.Tips({
|
||||
title: '没有更多了',
|
||||
});
|
||||
}
|
||||
}
|
||||
// console.log(this.cateGoods.length);
|
||||
|
||||
},
|
||||
|
||||
giveStart(item) {
|
||||
let status = item.relevance_id ? 0 : 1
|
||||
graphicStartApi(item.community_id, {
|
||||
@ -514,6 +493,7 @@
|
||||
this.page = 1;
|
||||
this.loadVideo = true;
|
||||
this.dataList = [];
|
||||
this.loadMore = true;
|
||||
n == 1 ? this.get() : '';
|
||||
n == 2 ? this.getFocusList() : '';
|
||||
n == 3 ? this.getGoods() : '';
|
||||
@ -528,12 +508,17 @@
|
||||
this.navTap(1)
|
||||
},
|
||||
async getGoods() {
|
||||
if (!this.loadMore) {
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data
|
||||
} = await graphicLstApi(this.where)
|
||||
console.log(data);
|
||||
this.Listcount=data.count
|
||||
this.cateGoods = data.list
|
||||
this.cateGoods.push(...data.list)
|
||||
this.where.page++
|
||||
if(data.list.length < this.where.limit){
|
||||
this.loadMore = false
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取个人用户信息
|
||||
@ -713,68 +698,15 @@
|
||||
this.communityId = this.dataList[this.k]['community_id'];
|
||||
},
|
||||
animationfinish(event) {
|
||||
// 1.这里进行判断,如果是最后一个视频就进入 get() 方法加载视频进入列表
|
||||
if (this.k == this.dataList.length - 1 && this.currentNav !== 2) {
|
||||
this.loadVideo = true;
|
||||
this.GET()
|
||||
}else if(this.currentNav == 2){
|
||||
this.loadVideo = true
|
||||
this.getFocusList()
|
||||
}
|
||||
},
|
||||
//每一组结束时新的请求
|
||||
GET() {
|
||||
let that = this
|
||||
if (!that.loadVideo) return
|
||||
that.loadVideo = true
|
||||
if(this.currentNav !== 2 ){
|
||||
that.isUser ?
|
||||
myVideoList(that.userUid, {
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
is_star: that.isSatrt,
|
||||
community_id: that.videoID
|
||||
}).then(res => {
|
||||
that.videoData(res.data.list)
|
||||
that.loadVideo = false
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}) :
|
||||
videoList({
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
id: that.videoID
|
||||
}).then(res => {
|
||||
that.loadVideo = false
|
||||
that.videoData(res.data.list)
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
}else if(this.currentNav == 2 ){
|
||||
that.isUser ?
|
||||
myVideoList(that.userUid, {
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
is_star: that.isSatrt,
|
||||
community_id: that.videoID
|
||||
}).then(res => {
|
||||
that.videoData(res.data.list)
|
||||
that.loadVideo = false
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}) : this.getFocusList()
|
||||
if (!that.loadVideo || !that.loadMore) return
|
||||
if (this.k == this.dataList.length - 1 && this.currentNav === 1) {
|
||||
that.loadVideo = false
|
||||
this.get()
|
||||
}
|
||||
if (this.k == this.dataList.length - 1 && this.currentNav === 2) {
|
||||
that.loadVideo = false
|
||||
this.getFocusList()
|
||||
}
|
||||
},
|
||||
get() {
|
||||
@ -787,8 +719,10 @@
|
||||
is_star: that.isSatrt,
|
||||
community_id: that.videoID
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
that.videoData(res.data.list)
|
||||
if (res.data.list.length < that.limit) {
|
||||
this.loadMore = false;
|
||||
}
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
@ -802,6 +736,9 @@
|
||||
id: that.videoID
|
||||
}).then(res => {
|
||||
that.videoData(res.data.list)
|
||||
if (res.data.list.length < that.limit) {
|
||||
this.loadMore = false;
|
||||
}
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
@ -809,26 +746,20 @@
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
that.loadVideo = true
|
||||
},
|
||||
getFocusList() {
|
||||
let that = this;
|
||||
if (!that.loadVideo) return
|
||||
that.loadVideo = true
|
||||
focusArticleLst({
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
type: 2
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
that.loadVideo = false
|
||||
// const arr=[]
|
||||
// res.data.list.forEach(item=>{
|
||||
// if(item.is_type == '2'){
|
||||
// return arr.push(item)
|
||||
// }
|
||||
// })
|
||||
// this.limit=arr.length
|
||||
that.loadVideo = true
|
||||
that.videoData(res.data.list)
|
||||
if (res.data.list.length < that.limit) {
|
||||
this.loadMore = false;
|
||||
}
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
|
@ -18,7 +18,7 @@
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" required />
|
||||
<input type="text" placeholder="输入账号" placeholder-class="placeholder" v-model="account" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
@ -251,7 +251,8 @@
|
||||
import {
|
||||
getLogo,
|
||||
getconfig,
|
||||
getVersion
|
||||
getVersion,
|
||||
bindMp
|
||||
} from "@/api/public";
|
||||
// import cookie from "@/utils/store/cookie";
|
||||
import {
|
||||
@ -650,6 +651,7 @@
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
this.checkOpenId(data.user)
|
||||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||
that.$Cache.clear(BACK_URL);
|
||||
that.$store.commit("LOGIN", {
|
||||
@ -810,6 +812,7 @@
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
this.checkOpenId(data.user)
|
||||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||
that.$Cache.clear(BACK_URL);
|
||||
that.$store.commit("LOGIN", {
|
||||
@ -865,6 +868,32 @@
|
||||
title: '请勾选用户协议与隐私政策'
|
||||
});
|
||||
that.$refs.verify.show();
|
||||
},
|
||||
checkOpenId(user) {
|
||||
if (user.wechat_user_id === 0) {
|
||||
let that = this
|
||||
wx.getUserInfo({
|
||||
success: function(res) {
|
||||
const encryptedData = res.encryptedData
|
||||
const iv = res.iv
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
bindMp({ code: res.code, iv: iv, encryptedData: encryptedData, phone: that
|
||||
.account }).then(res => {
|
||||
// console.log(res);
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fail(e) {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user