shish 3 лет назад
Родитель
Сommit
fd8a3c5f81

+ 0 - 69
hdApp/src/admin/ljh/applyResult.vue

@@ -1,69 +0,0 @@
-<template>
-	<appResult title="注册成功">
-    <view class="dec"></view>
-    <view v-if="fromCg == 1">
-      <button class="admin-button-com blue big" @click="beginCg()" >开始买花</button>
-    </view>
-    <view v-else>
-      <button class="admin-button-com blue big" v-if="scene==''" @click="goBack()" >返回</button>
-      <button class="admin-button-com blue big" v-else @click="beginCg()" >开始买花</button>
-    </view>
-	</appResult>
-</template>
-<script>
-import appResult from '@/components/app-result'
-export default {
-	name: "ApplyResult",
-	components:{
-		appResult
-    },
-    data(){
-      return {
-        scene:'',
-        fromCg:0
-      }
-    },
-    onUnload() {
-    },
-    onLoad () {
-
-      //供货商打开小程序分享给客户,客户需要采购进来
-      let ghsCgOption = uni.getStorageSync('ghsCgOption')
-      if(ghsCgOption.fromCg){
-        this.fromCg = ghsCgOption.fromCg
-      }
-
-      //供货商打开太阳码分享给客户,客户需要采购进来
-      let scene = uni.getStorageSync('ghsCgScene')
-      if(scene){
-        this.scene = scene
-      }
-
-    },
-    methods:{
-      beginCg(){
-        if(this.fromCg == 1){
-          let ghsCgOption = uni.getStorageSync('ghsCgOption')
-          this.$util.pageTo({url: "/pagesPurchase/ghsProduct", query:ghsCgOption, type:2})
-        }else{
-          this.$util.pageTo({url: "/pagesPurchase/ghsProduct",query: {scene:this.scene},type:2})
-        }
-      },
-      goBack() {
-        uni.navigateBack()
-      }
-    }
-};
-</script>
-<style lang="scss" scoped>
-    .dec {
-     color: #666666;   
-     font-size: 28upx;
-     font-weight: 400;
-     margin-bottom: 30upx;
-    }
-	.admin-button-com {
-		margin-bottom: 20upx;
-		width: 100%;
-	}
-</style>

+ 2 - 36
hdApp/src/admin/ljh/confirm.vue

@@ -250,44 +250,10 @@ export default {
       uni.showLoading({mask:true})
       applyLjh({hdShopAdminId:this.option.hdShopAdminId,ghsShopAdminId:this.option.ghsShopAdminId,...this.form,style:style,from:from,miniOpenId:currentMiniOpenId}).then(subRes => {
         uni.hideLoading()
-        let token = subRes.data.token || ''
-        uni.hideLoading()
-        if (that.$util.isEmpty(token)) {
-          that.$msg('出错了')
-          return false
-        }
-        //有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
         if(subRes.code == 1){
-          if (that.$util.isEmpty(subRes)) {
-            that.$msg('出错了')
-            return false
-          }
-          uni.setStorageSync('token', subRes.data.token)
-          uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
-          getDictionaries({ token: subRes.data.token }).then(res => {
-            if (that.$util.isEmpty(res)) {
-              return false
-            }
-            that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
-            that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
-          })
-          that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-          getShopInfo(true).then(res => { 
-            uni.setNavigationBarTitle({ title: res.name }) 
-          })
-          that.setUserShopAll()
-          // #ifdef APP-PLUS
-          //保存安卓的clientId
-          let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
-          const clientInfo = plus.push.getClientInfo()
-          let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-          if(hasClientId == '' || hasClientId != currentClientId){
-            replaceClientId({id:currentClientId})
-          }
-          // #endif
+          that.$util.pageTo({url: "/admin/ljh/confirmPay?id="+subRes.data.id})
         }
-        this.$util.pageTo({url: "/admin/ljh/applyResult", type:2})
-      });
+      })
     }
   }
 };

+ 4 - 5
hdApp/src/admin/ljh/confirmPay.vue

@@ -19,7 +19,7 @@
         <block>
           <div class="call-one-btn">
             <view>
-              <button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" :disabled="remainPayTime >0 ? false : true" @click="wxPayFn">微信支付</button>
+              <button class="button-com pay-wx green" @click="wxPayFn">微信支付</button>
             </view>
           </div>
         </block>
@@ -45,7 +45,6 @@ export default {
       psdKey: '',
       orderSn: '',
       realPrice: '',
-      pageId: '',
       remainPayTime:120,
       hasDebtPay:0,
       balance:0
@@ -71,7 +70,8 @@ export default {
     wxPayFn () {
       let that = this
       uni.showLoading({title: '加载中',mask:true})
-      applyWxPay({ orderSn: this.orderSn }).then(res => {
+      let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
+      applyWxPay({ orderSn: this.orderSn,miniOpenId:currentMiniOpenId }).then(res => {
         uni.hideLoading()
         if(res.code == 1){
           if(res.data.hasNoMiniOpenId && res.data.hasNoMiniOpenId == 1){
@@ -95,14 +95,13 @@ export default {
                 }
               })
           }else{
-            this.pageId = res.data.id
             wexinPay(res.data, this.getSuccess, this.getError)
           }
         }
       })
     },
     getSuccess () {
-      this.pageTo({ url: '/pagesPurchase/particulars?id=' + this.pageId, type: 2 })
+      this.pageTo({ url: '/admin/ljh/payResult', type: 2 })
     },
     getError () {
     }

+ 37 - 0
hdApp/src/admin/ljh/payResult.vue

@@ -0,0 +1,37 @@
+<template>
+	<appResult title="注册成功">
+    <view class="dec"></view>
+    <view v-if="newUser == 1">
+      <button class="admin-button-com blue big" @click="goIndex()">进入管理中心</button>
+    </view>
+	</appResult>
+</template>
+<script>
+import appResult from '@/components/app-result'
+export default {
+	name: "payResult",
+	components:{ appResult },
+  data(){
+    return {
+      newUser:0
+    }
+  },
+  methods:{
+    goIndex(){
+      this.$util.pageTo({url: "/admin/home/workbench",type:2})
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+    .dec {
+     color: #666666;   
+     font-size: 28upx;
+     font-weight: 400;
+     margin-bottom: 30upx;
+    }
+	.admin-button-com {
+		margin-bottom: 20upx;
+		width: 100%;
+	}
+</style>

+ 2 - 1
hdApp/src/pages.json

@@ -189,7 +189,8 @@
 			"pages": [
 				{"path":"info","style": { "navigationBarTitleText": "零交会"}},
 				{"path":"confirm","style": { "navigationBarTitleText": "请填写信息"}},
-				{"path":"confirmPay","style": { "navigationBarTitleText": "待支付"}}
+				{"path":"confirmPay","style": { "navigationBarTitleText": "待支付"}},
+				{"path":"payResult","style": { "navigationBarTitleText": "支付成功"}}
 			]
 		},
 		{