Browse Source

Merge branch 'master' of http://git.huaml.com/zhh/front-end

jf 5 years ago
parent
commit
87a1fa56c4
2 changed files with 29 additions and 7 deletions
  1. 2 1
      ghsApp/src/pagesClient/member/add.vue
  2. 27 6
      hdApp/src/admin/recharge/renew.vue

+ 2 - 1
ghsApp/src/pagesClient/member/add.vue

@@ -129,6 +129,7 @@ export default {
 			this.$refs.simpleAddress.open();
 		},
 		confirmFn() {
+      uni.showLoading({title: "加载中"})
 			let pattern = /^1\d{10}$/;  //验证以1开头11位数
 			if(this.$util.isEmpty(this.form.name)){this.$msg('请输入花店名称');return;}
 			if(!pattern.test(this.form.mobile)){this.$msg('请输入正确的手机号');return;}
@@ -140,7 +141,7 @@ export default {
 				address:this.form.address,
 				debt:this.form.debt?1:0,
 			}).then(res => {
-				this.$msg('添加成功!');
+				uni.hideLoading();
 				uni.setStorageSync('newClient', res.data)
 				setTimeout(() => {
 					// uni.reLaunch({

+ 27 - 6
hdApp/src/admin/recharge/renew.vue

@@ -11,8 +11,8 @@
         充值<text style="color: #FF3C00;padding-left: 10upx;">{{initData.recharge}}元</text>,免费使用一年
       </view>
       <view>
-        <picker @change="startTimeFn" class="tui-input" :range="zhifufangshi">
-          <input type="text" placeholder="请选择供应商" class="ghsStyle" disabled>
+        <picker @change="startTimeFn" class="tui-input" :range="ghsList" range-key="name" :value="selectIndex">
+          <input type="text" placeholder="请选择供应商" class="ghsStyle" disabled v-model="shopName">
         </picker>
       </view>
       
@@ -20,7 +20,7 @@
         class="immediately"
         @click="onceRecharge"
       >立即充值</view>
-      <view class="use">本次充值仅限在<text style="color: #666;padding: 0 10upx;font-weight: 700;">{{initData.shopName}}</text>使用</view>
+      <view class="use" :style="{visibility: payShow ? 'hidden' : 'visible'}">本次充值仅限在<text style="color: #666;padding: 0 10upx;font-weight: 700;">{{shopName}}</text>使用</view>
       <view class="use use_margin"><text style="color: #666;">{{initData.userNum}}</text> 人已充值</view>
       <view class="user_avator">
         <image :src="`${constant.imgUrl}/recharge/has_recharge.png`"></image>
@@ -39,6 +39,11 @@ export default {
     return {
       initData: {},
       zhifufangshi:['微信','支付宝'],
+      ghsList: [],
+      shopName: '',
+      ghsId: '',
+      selectIndex: '',
+      payShow: true
     }
   },
   onLoad () {
@@ -55,13 +60,25 @@ export default {
       }).catch(err => { console.log(err) })
     },
     _getGhsList() {
-      getList().then(res => {
+      getList({type: '0'}).then(res => {
         console.log(res, 58)
+        this.ghsList = res.data.list
       }).catch(err => {})
     },
+    startTimeFn(e) {
+      this.selectIndex = e.detail.value
+      this.shopName = this.ghsList[this.selectIndex].name
+      this.ghsId = this.ghsList[this.selectIndex].id
+      this.payShow = false
+      console.log(e, this.ghsId)
+    },
     // 立即充值
     onceRecharge () {
-      rechargeRenewPay().then(res => {
+      if(!this.ghsId) {
+        this.$msg('请先选择供货商')
+        return
+      }
+      rechargeRenewPay({ghsId: this.ghsId}).then(res => {
         console.log(res)
         wexinPay(res.data, this.getSuccess, this.getError)
       }).catch(err => { console.log(err) })
@@ -151,9 +168,13 @@ export default {
       margin-top: 20upx;
     }
     & > .use_margin {
-      margin-top: 60upx;
+      margin-top: 50upx;
     }
     & > .user_avator {
+      position: absolute;
+      bottom: 20upx;
+      left: 50%;
+      transform: translateX(-50%);
       text-align: center;
       margin-top: 20upx;
       & > image {