Kaynağa Gözat

修改:商品tabs滚动 实名认证提示优化

asdasdasdd 1 yıl önce
ebeveyn
işleme
77e8cceaae

+ 25 - 9
pages/home/goodsdetail/Goodsdetail.vue

@@ -47,7 +47,8 @@ export default {
       ifLoad:false,
 	  mbBodyposition:0,
       reviewposition:0,
-      navid:1
+      navid:1,
+	  scrollTimer : null
     }
   },
 
@@ -111,14 +112,28 @@ export default {
     })
   },
   onPageScroll(res){
-      console.log(res.scrollTop)
-      if(res.scrollTop > this.reviewposition && res.scrollTop < this.mbBodyposition){
-          this.navid = 2
-      }else if(res.scrollTop > this.mbBodyposition){
-          this.navid = 3
-      }else if(res.scrollTop < this.reviewposition){
-          this.navid = 1
-      }
+      // if(res.scrollTop > this.reviewposition && res.scrollTop < this.mbBodyposition){
+      //     this.navid = 2
+      // }else if(res.scrollTop > this.mbBodyposition){
+      //     this.navid = 3
+      // }else if(res.scrollTop < this.reviewposition){
+      //     this.navid = 1
+      // }
+	const that = this
+	if(this.scrollTimer != null){
+		clearTimeout(this.scrollTimer);
+	}
+	this.scrollTimer = setTimeout(()=>{
+		let navid  =  1
+		if(res.scrollTop >= that.mbBodyposition)   {
+			navid = 3  
+		}else  if(res.scrollTop >= that.reviewposition) {
+			navid = 2
+		}
+		console.log('滚动触发了!')
+		that.navid = navid
+	}, 100)
+
   },
   methods: {
     setnav(id){
@@ -140,6 +155,7 @@ export default {
       fetchConfig: 'fetchConfig',
       getGoodsDetail: 'getGoodsDetail'
     }),
+
 	getmbBodyposition(top){
 		this.mbBodyposition = top
         console.log(this.mbBodyposition)

+ 73 - 54
pages/member/auth/Auth.vue

@@ -59,7 +59,7 @@
                             height:'160px',
                             }"
                             @select="uploadSelectImg('member_idcard_image2',$event)"
-                            @delete="dropImage('member_idcard_image2')"
+                            @delete="dropImage('member_idcard_image2',$event)"
                           >
                           </uni-file-picker>
                     </view>
@@ -82,7 +82,7 @@
                             height:'160px',
                             }"
                             @select="uploadSelectImg('member_idcard_image3',$event)"
-                            @delete="dropImage('member_idcard_image3')"
+                            @delete="dropImage('member_idcard_image3' ,$event)"
                           >
                           </uni-file-picker>
                     </view>
@@ -223,25 +223,33 @@ export default {
     },
     goBack(){uni.navigateBack({delta:1})},
     ...mapMutations({
-      memberEdit: 'memberEdit'
+       memberEdit: 'memberEdit',
+	   memberUpdate: 'memberUpdate',
     }),
     submitInformation () {
-      if (!this.if_confirm) {
-        this.confirmSumit()
-        return
-      }
-      this.dialog={condition:1,content:'请仔细核对信息,确认上传后除非管理员审核否则无法再次上传'}
-      this.$refs.confirm.open()
+      // if (!this.if_confirm) {
+      //   this.confirmSumit()
+      //   return
+      // }
+	  const  that = this
+	  uni.showModal({
+	  	title: '提示',
+	  	content: '请仔细核对信息,确认上传后除非管理员审核否则无法再次上传',
+	  	success: function (res) {
+	  		if (res.confirm) {
+	  			  that.confirmSumit()
+	  		} else if (res.cancel) {
+	  			console.log('用户点击取消');
+	  		}
+	  	}
+	  });
+      // this.dialog={condition:1,content:'请仔细核对信息,确认上传后除非管理员审核否则无法再次上传'}
+      // this.$refs.confirm.open()
     },
     confirmSumit () {
-      updateMemberAuth(this.realname, this.idcard, this.if_confirm).then(res => {
-        if (this.if_confirm) {
+      updateMemberAuth(this.realname, this.idcard, true).then(res => {
           this.memberEdit({ member_truename: this.realname, member_idcard: this.idcard, member_auth_state: 1 })
           uni.showToast({icon:'none',title: res.message})
-        } else {
-          this.if_confirm = true
-          this.submitInformation()
-        }
       }).catch(function (error) {
         uni.showToast({icon:'none',title: error.message})
       })
@@ -250,48 +258,59 @@ export default {
       this.showimage = src
       this.showPopup('isshow')
     },
-    dropImage (id) {
-
-      this.dialog={condition:2, content:'确定要删除该图片吗?',data:id}
-      this.$refs.confirm.open()
+    dropImage (id ,e) {
+		
+		  // this.dialog={condition:1,content:'请仔细核对信息,确认上传后除非管理员审核否则无法再次上传'}
+		  //  this.$refs.confirm.open()
+      // this.dialog={condition:2, content:'确定要删除该图片吗?', data:id}
+	  dropAuth(id).then(res => {
+	    this.user[this.dialog.data + '_url'] = ''
+	    var temp = {}
+	    temp[id + '_url'] = ''
+	    this.memberEdit(temp)
+	  }).catch(function (error) {
+	    uni.showToast({icon:'none',title: error.message})
+	  })
+	  
+      
 
     },
-    useCrop (res) {
-        let index = this.cropType
-        var formdata={
-          filePath:res.url,
-          name:index,
-          id:index
-        }
+    // useCrop (res) {
+    //     let index = this.cropType
+    //     var formdata={
+    //       filePath:res.url,
+    //       name:index,
+    //       id:index
+    //     }
 
-        uploadAuth(formdata).then(res => {
-          this.user[index + '_url'] = res.result.file_path
-          this.imageValue[index]=[{
-            name:index,
-            extname:'jpg',
-            url:res.result.file_path
-          }]
-          var temp = {}
-          temp[index + '_url'] = res.result.file_path
-          this.memberEdit(temp)
-          this.cropperOption.imgUrl=''
-          this.$forceUpdate()
-          uni.hideLoading()
-        }).catch(function (error) {
-          uni.showToast({icon:'none',title: error.message})
-          uni.hideLoading()
-          this.cropperOption.imgUrl=''
-          this.$forceUpdate()
-        })
-      },
-      cropReady(){
-        this.cropperOption.img = this.cropperOption.imgUrl
-      },
-      cropBack(){
-		  console.log('this.cropperOptio' , this.cropperOption)
-        this.cropperOption.imgUrl=''
-        this.$forceUpdate()
-      },
+    //     uploadAuth(formdata).then(res => {
+    //       this.user[index + '_url'] = res.result.file_path
+    //       this.imageValue[index]=[{
+    //         name:index,
+    //         extname:'jpg',
+    //         url:res.result.file_path
+    //       }]
+    //       var temp = {}
+    //       temp[index + '_url'] = res.result.file_path
+    //       this.memberEdit(temp)
+    //       this.cropperOption.imgUrl=''
+    //       this.$forceUpdate()
+    //       uni.hideLoading()
+    //     }).catch(function (error) {
+    //       uni.showToast({icon:'none',title: error.message})
+    //       uni.hideLoading()
+    //       this.cropperOption.imgUrl=''
+    //       this.$forceUpdate()
+    //     })
+    //   },
+    //   cropReady(){
+    //     this.cropperOption.img = this.cropperOption.imgUrl
+    //   },
+    //   cropBack(){
+		  // console.log('this.cropperOptio' , this.cropperOption)
+    //     this.cropperOption.imgUrl=''
+    //     this.$forceUpdate()
+    //   },
 	  // 直接上传
 	  uploadSelectImg(index, event){
 		 const file = event.tempFiles[0]

+ 7 - 2
pages/member/index/Index.vue

@@ -238,14 +238,14 @@
 
 <script>
 import {getFontSize} from '@/util/common'
-  import TitleHeader from '../../TitleHeader'
+import TitleHeader from '../../TitleHeader'
 import { urlencode } from '@/util/common'
 import MemberBase from '../MemberBase'
 import IndexOrderItem from './IndexOrderItem'
 import IndexManageItem from './IndexManageItem'
 import flexLine from '../../flexLine'
 import GuessLike from '../../GuessLike'
-import { mapState, mapActions } from 'vuex'
+import { mapState, mapActions , mapMutations} from 'vuex'
 import { getMemberIndex } from '../../../api/member'
 import { checkInviter } from '../../../api/memberInviter'
 export default {
@@ -280,6 +280,8 @@ export default {
         response => {
           if (response && response.result.member_info) {
             this.user = response.result.member_info
+			// 更新用户信息缓存
+			this.memberUpdate({info:response.result.member_info})
           }
         },
         error => {}
@@ -332,6 +334,9 @@ export default {
     }
   },
   methods:{
+	  ...mapMutations({
+	     memberUpdate: 'memberUpdate',
+	  }),
     goNavigate(path,query=false){
       uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
     },

+ 1 - 1
pages/member/sellerjoinin/Step2.vue

@@ -377,7 +377,7 @@ export default {
 		  name: 'file'
 		}
 		uni.showLoading({
-		  title: 'lodding....'
+		  title: '上传中....'
 		})
 		uploadInfoFile(formdata).then(res => {
 		  that.storeJoinin[type] = res.result.path

+ 2 - 1
unpackage/dist/build/mp-weixin/project.config.json

@@ -33,7 +33,8 @@
         },
         "disableUseStrict": false,
         "useCompilerPlugins": false,
-        "minifyWXML": true
+        "minifyWXML": true,
+        "condition": false
     },
     "compileType": "miniprogram",
     "libVersion": "2.31.1",