优化分享推文视频接口,所有页面强制权限

master
santaner 11 months ago
parent 5c622aa21e
commit 9a508e354a
  1. 4
      api/api.js
  2. 23
      pages/goods_details/index.vue
  3. 23
      pages/index/index.vue
  4. 45
      pages/news_details/index.vue
  5. 4
      pages/users/user_modify_mes/index.vue

@ -112,8 +112,8 @@ export function getArticleDetails(id){
* @param int id
*
*/
export function shareArticle(type,id){
return request.get('user/brand',{type:3,id:id},{noAuth:true});
export function shareArticle(type){
return request.get('user/brand',{type:type},{noAuth:true});
}
/**
* 手机号+验证码登录接口

@ -428,7 +428,7 @@
arrivalNoticeApi,
copyPasswordApi, getDiscountsLst, priceRuleApi,getPreSuply
} from '@/api/store.js';
import { getUserInfo, imgToBase } from '@/api/user.js';
import { getUserInfo, imgToBase, getCheck } from '@/api/user.js';
import { getCoupons,getShopCoupons } from '@/api/api.js';
import { getCartCounts } from '@/api/order.js';
import { mapGetters } from "vuex";
@ -581,7 +581,7 @@
pre_count:'',
pre_used:'',
pre_num:'',
realInfo:{},
};
},
computed:{
@ -589,6 +589,7 @@
},
onLoad(options) {
let that = this
that.getCheck();
if (options.spid) {
app.globalData.spid = options.spid;
that.currSpid = options.spid
@ -684,6 +685,23 @@
},
// #endif
methods: {
getCheck:function(){
let that = this;
getCheck().then(res =>{
that.$set(that, 'realInfo', res.data);
if(that.realInfo.real_name.length == 0 || that.realInfo.card.length == 0 || that.realInfo.age.length == 0 || that.realInfo.spread_phone.length == 0){
that.$util.Tips({
title: '请补全身份信息',
icon: 'error'
});
setTimeout(function(){
uni.reLaunch({
url: '/pages/users/user_modify_mes/index'
});
},500)
}
})
},
//
applyPrice: function(){
let that = this;
@ -1450,6 +1468,7 @@
this.isAuto = true;
this.isShowAuth = true
} else {
this.getCheck();
this.goCat(true);
}
},

@ -293,7 +293,7 @@ import { goShopDetail } from '@/libs/order.js';
import { mapGetters } from 'vuex';
import { getProductslist, getProductHot, storeCategory } from '@/api/store.js';
import { initiateAssistApi } from '@/api/activity.js';
import { setVisit, spread } from '@/api/user.js';
import { setVisit, spread, getCheck } from '@/api/user.js';
import recommend from '@/components/recommend';
// #ifndef H5
import passwordPopup from '@/components/passwordPopup';
@ -476,7 +476,8 @@ export default {
activeRouter: '',
countNum: 0,
overflow: false,
tid:''
tid:'',
realInfo:{}
};
},
/**
@ -508,6 +509,7 @@ export default {
onLoad(options) {
let that = this
this._options = options;
that.getCheck();
// #ifdef APP-PLUS
const pages = getCurrentPages();
const page = pages[pages.length - 1];
@ -567,6 +569,23 @@ export default {
this.reconnect();
},
methods: {
getCheck:function(){
let that = this;
getCheck().then(res =>{
that.$set(that, 'realInfo', res.data);
if(that.realInfo.real_name.length == 0 || that.realInfo.card.length == 0 || that.realInfo.age.length == 0 || that.realInfo.spread_phone.length == 0){
that.$util.Tips({
title: '请补全身份信息',
icon: 'error'
});
setTimeout(function(){
uni.navigateTo({
url: '/pages/users/user_modify_mes/index'
});
},1000)
}
})
},
loadCoupon(){
if(!this.showCoupon && !uni.getStorageSync('show_coupon') && uni.getStorageSync('is_new_user')){
getNewPeopleCouponLst().then(res => {

@ -25,7 +25,8 @@
<navigator :url="'/pages/goods_details/index?id='+store_info.id" hover-class="none" class="label"><text class="span">查看商品</text></navigator>
</view>
<!-- #ifdef H5 -->
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">和好友一起分享</button>
<!-- <button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">和好友一起分享</button> -->
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet">和好友一起分享</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="bnt bg-color" open-type="share" hover-class='none'>和好友一起分享</button>
@ -51,6 +52,7 @@
import {
getArticleDetails,shareArticle
} from '@/api/api.js';
import { getCheck } from '@/api/user.js';
import shareInfo from '@/components/shareInfo';
import home from '@/components/home';
import authorize from '@/components/Authorize';
@ -73,8 +75,10 @@
tagStyle: {
img: 'width:100%;display:block;'
},
type:'',
isAuto: false, //
isShowAuth: false, //
realInfo:{},
};
},
computed:{
@ -84,6 +88,7 @@
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getCheck();
if (options.hasOwnProperty('id')) {
this.id = options.id;
} else {
@ -101,6 +106,23 @@
this.getArticleOne();
},
methods: {
getCheck:function(){
let that = this;
getCheck().then(res =>{
that.$set(that, 'realInfo', res.data);
if(that.realInfo.real_name.length == 0 || that.realInfo.card.length == 0 || that.realInfo.age.length == 0 || that.realInfo.spread_phone.length == 0){
that.$util.Tips({
title: '请补全身份信息',
icon: 'error'
});
setTimeout(function(){
uni.reLaunch({
url: '/pages/users/user_modify_mes/index'
});
},500)
}
})
},
getArticleOne: function() {
let that = this;
if (that.isLogin === false) {
@ -135,19 +157,24 @@
},
listenerActionSheet() {
let that = this;
that.getCheck();
that.shareInfoStatus = true
if(that.articleInfo.articleCategory.title === '视频'){
that.type = '3'
}else if(that.articleInfo.articleCategory.title === '推文'){
that.type = '4'
}
// shareArticle
shareArticle(3,that.articleInfo.id).then(res =>{
shareArticle(that.type).then(res =>{
that.$util.Tips({
title:res.message
})
})
.catch(res=>{
.catch(err=>{
that.$util.Tips({
title: res.message
title: err
})
})
// alert('test');
},
setShareInfoStatus() {
this.shareInfoStatus = false
@ -162,18 +189,18 @@
success: function() {
// shareArticle
// this.shareArticle(this.articleInfo.id);
conso.log('test');
// conso.log('test');
}
};
this.$wechat.wechatEvevt([
"updateAppMessageShareData",
"updateTimelineShareData"
], configAppMessage).then(res => {
this.shareArticle(this.articleInfo.id);
console.log('test shareArticle');
// this.shareArticle(this.articleInfo.id);
// console.log('test shareArticle');
}).catch(err => {
// console.log(err);
console.log('2');
// console.log('2');
});
}

@ -244,8 +244,8 @@
// uni.navigateBack({
// delta: 1,
// })
uni.navigateTo({
url: '/pages/users/user_info/index'
uni.switchTab({
url: '/pages/user/index'
});
},1000)
}).catch(err => {

Loading…
Cancel
Save