From 9a508e354a51874efa51cd2c445a94f1096cf248 Mon Sep 17 00:00:00 2001 From: santaner Date: Sat, 6 Jan 2024 22:22:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E4=BA=AB=E6=8E=A8?= =?UTF-8?q?=E6=96=87=E8=A7=86=E9=A2=91=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=89=80?= =?UTF-8?q?=E6=9C=89=E9=A1=B5=E9=9D=A2=E5=BC=BA=E5=88=B6=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 4 +-- pages/goods_details/index.vue | 23 ++++++++++++-- pages/index/index.vue | 23 ++++++++++++-- pages/news_details/index.vue | 45 +++++++++++++++++++++------ pages/users/user_modify_mes/index.vue | 4 +-- 5 files changed, 82 insertions(+), 17 deletions(-) diff --git a/api/api.js b/api/api.js index aa05a07..cd58dee 100644 --- a/api/api.js +++ b/api/api.js @@ -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}); } /** * 手机号+验证码登录接口 diff --git a/pages/goods_details/index.vue b/pages/goods_details/index.vue index 7ffc3bf..620af38 100644 --- a/pages/goods_details/index.vue +++ b/pages/goods_details/index.vue @@ -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); } }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 4996361..4f170d6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -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 => { diff --git a/pages/news_details/index.vue b/pages/news_details/index.vue index 23d2763..aaae894 100644 --- a/pages/news_details/index.vue +++ b/pages/news_details/index.vue @@ -25,7 +25,8 @@ 查看商品 - + + @@ -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'); }); } diff --git a/pages/users/user_modify_mes/index.vue b/pages/users/user_modify_mes/index.vue index 33b6c81..9c79f6f 100644 --- a/pages/users/user_modify_mes/index.vue +++ b/pages/users/user_modify_mes/index.vue @@ -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 => {