shish 1 год назад
Родитель
Сommit
9b5c8112d0

+ 13 - 4
hdApp/src/admin/member/detail.vue

@@ -144,14 +144,20 @@
           </div>
 
           <view v-if="rechargeWeal == 1" style="font-size:28upx;">
-            <view v-for="(item,index) in weal" :key="index">
-              <view>充值{{ item.recharge }} 升{{ item.name }} ({{item.discount*100}}折)</view>
+            <view v-for="(item,index) in weal" :key="index" style="margin-top:42upx;">
+              <view @click="getRecharge(item.recharge)">
+                充值{{ item.recharge }}元 升{{ item.name }} ({{item.discount*100}}折)
+                <text style="margin-left:10upx;color:#3385FF;font-weight:bold;">选这个</text>
+              </view>
             </view>
           </view>
 
           <view v-if="rechargeWeal == 2" style="font-size:28upx;">
-            <view v-for="(item,index) in weal" :key="index">
-              <view>充值{{ item.recharge }} 送{{ item.give }}</view>
+            <view v-for="(item,index) in weal" :key="index" style="margin-top:42upx;">
+              <view @click="getRecharge(item.recharge)">
+                充值{{ item.recharge }}元 送{{ item.give }}元
+                <text style="margin-left:10upx;color:#3385FF;font-weight:bold;">选这个</text>
+              </view>
             </view>
           </view>
 
@@ -341,6 +347,9 @@ export default {
     this.init()
   },
   methods: {
+		getRecharge(amount){
+			this.rForm.rechargeAmount = amount
+		},
     toRecharge(e){
       let that = this
       if(e.index === 0){

+ 20 - 16
mallApp/src/api/member/index.js

@@ -1,99 +1,103 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+//
+export const getMemberWeal = data => {
+	return https.get('/member-weal/get-weal', data)
+}
+
 /** *
- * 只要登录客户的优惠情况 m
+ * 只要登录客户的优惠情况
  */
 export const userDiscount = data => {
 	return https.get('/user/discount', data)
 }
 
 /** *
- * 只要登录客户的资产情况 m
+ * 只要登录客户的资产情况
  */
 export const userAsset = data => {
 	return https.get('/user/asset', data)
 }
 
 /** *
- * 修改密码 m
+ * 修改密码
  */
-export const modifyPassword = data => {
+export const constodifyPassword = data => {
 	return https.post('/user/password', data)
 }
 
 /** *
- * 会员等级与折扣 m
+ * 会员等级与折扣
  */
 export const userGrade = data => {
 	return https.post('/merchant/user-grade', data)
 }
-// =====================  B 端 ========================
 
 /** *
- * 客户列表 b
+ * 客户列表
  */
 export const getList = data => {
 	return https.get('/user/list', data)
 }
 
 /** *
- * 商家端客户详情,包括资产、订单和备注 b
+ * 商家端客户详情,包括资产、订单和备注
  */
 export const getUserDet = data => {
 	return https.get('/user/user-detail', data)
 }
 
 /** *
- * 获取客户详情,包括资产 b
+ * 获取客户详情,包括资产
  */
 export const getDet = data => {
 	return https.get('/user/detail', data)
 }
 
 /** *
- * 添加客户 b
+ * 添加客户
  */
 export const add = data => {
 	return https.post('/user/add', data)
 }
 
 /** *
- * 给客户充值 b
+ * 给客户充值
  */
 export const rechargeB = data => {
 	return https.post('/user/recharge', data)
 }
 
 /** *
- * 给客户升级 b
+ * 给客户升级
  */
 export const upgrade = data => {
 	return https.post('/user/upgrade', data)
 }
 
 /** *
- * 添加备注 b
+ * 添加备注
  */
 export const remarkAdd = data => {
 	return https.post('/merchant-remark/add', data)
 }
 
 /** *
- * 删除备注 b
+ * 删除备注
  */
 export const remarkDel = data => {
 	return https.get('/merchant-remark/delete', data)
 }
 
 /** *
- * 客户充值 m
+ * 客户充值
  */
 export const recharge = data => {
 	return https.get('/recharge/launch', data)
 }
 
 /** *
- * 重置密码 b
+ * 重置密码
  */
 export const resetPassword = data => {
 	return https.post('/user/reset-pay-password', data)

+ 1 - 1
mallApp/src/pages.json

@@ -23,7 +23,7 @@
         {
             "root": "pages/member",
             "pages": [
-                { "path": "recharge", "style": { "navigationBarTitleText": "充值" } }
+                { "path": "recharge", "style": { "navigationBarTitleText": "充值活动" } }
             ]
         },
         {

+ 7 - 7
mallApp/src/pages/home/recent.vue

@@ -12,12 +12,12 @@
 
       <view class="ghs_list_page flex-col" v-if="!$util.isEmpty(list)">
 
-        <view style="background-color:white;margin-bottom:20upx;">
-          <button class="admin-button-com mini-btn blue" style="margin-left:9upx;padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">修改密码</button>
-          <button class="admin-button-com mini-btn blue" style="margin-left:9upx;padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">改进建议</button>
-          <button class="admin-button-com mini-btn blue" style="margin-left:9upx;padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">我的地址</button>
-          <button class="admin-button-com mini-btn blue" style="margin-left:9upx;padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">采购统计</button>
-          <button class="admin-button-com mini-btn blue" style="margin-left:9upx;padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="logout()">退出登录</button>
+        <view style="background-color:white;margin-bottom:20upx;display: flex;justify-content: space-around;">
+          <button class="admin-button-com mini-btn blue" style="padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">修改密码</button>
+          <button class="admin-button-com mini-btn blue" style="padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">改进建议</button>
+          <button class="admin-button-com mini-btn blue" style="padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">我的地址</button>
+          <button class="admin-button-com mini-btn blue" style="padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="">采购统计</button>
+          <button class="admin-button-com mini-btn blue" style="padding-top:18upx;padding-bottom:18upx;border:none;margin-top:10upx;" @click="logout()">退出登录</button>
         </view>
 
         <view class="ghs_list_area flex-col justify-end">
@@ -39,7 +39,7 @@
                 <view class="tag_2" @click="getBuyList()"> <text>买花记录</text> </view>
               </view>
               <view class="button_4 flex-col" @click.stop="bug(item)"><text class="text_13">买花</text></view>
-              <view class="button_6 flex-col" @click.stop="recharge(item)" v-if="item.rechargeWeal == 1"><text class="text_13">充值</text></view>
+              <view class="button_6 flex-col" @click.stop="recharge(item)" v-if="item.rechargeWeal != 0"><text class="text_13">充值</text></view>
             </view>
 
         </view>

+ 49 - 13
mallApp/src/pages/member/recharge.vue

@@ -8,11 +8,34 @@
 				</div>
 			</div>
 			<div style="padding:10upx 0 25upx 10upx;font-size:30upx;" v-if="!$util.isEmpty(customInfo)">
-				您好,{{ customInfo.name?customInfo.name:'' }},<text>请输入金额</text>
+				您好,{{ customInfo.name?customInfo.name:'' }},<text>请输入要充值金额</text>
 			</div>
 			<div class="module-com pay-input-wrap">
 				<pay-input-module :focus="inpFocus" :num="amount" @focusFn="focusFn" @blurFn="blurFn" @clickKey="clickKeyFn" />
 			</div>
+
+			<view style="text-align: center;">
+
+				<view v-if="rechargeWeal == 1" style="font-size:34upx;">
+					<view v-for="(item,index) in weal" :key="index" style="margin-top:56upx;">
+						<view @click="getRecharge(item.recharge)">
+							充值{{ item.recharge }}元 升{{ item.name }} ({{item.discount*100}}折)
+							<text style="margin-left:20upx;color:#3385FF;font-weight:bold;">选这个</text>
+						</view>
+					</view>
+				</view>
+
+				<view v-if="rechargeWeal == 2" style="font-size:34upx;">
+					<view v-for="(item,index) in weal" :key="index" style="margin-top:56upx;">
+					<view @click="getRecharge(item.recharge)">
+						充值{{ item.recharge }}元 送{{ item.give }}元
+						<text style="margin-left:20upx;color:#3385FF;font-weight:bold;">选这个</text>
+					</view>
+					</view>
+				</view>
+
+			</view>
+
 			<div class="btn-wrap">
 				<!-- #ifdef MP-WEIXIN -->
 				<button class="button-com green" @click="wexinPayFn">微信支付</button>
@@ -34,6 +57,7 @@ import { share } from '@/mixins'
 import { rechargeBalance } from '@/api/recharge'
 import { postWxCode } from '@/api/mini'
 import { getHdInfo } from '@/api/hd'
+import { getMemberWeal } from '@/api/member'
 import wangCg from "@/components/wangCg";
 export default {
 	name: 'pay',
@@ -54,7 +78,10 @@ export default {
 			id:0,
 			salt:'',
 			hdInfo:[],
-			customInfo:[]
+			customInfo:[],
+			loginComeBack:0,
+			rechargeWeal:0,
+			weal:[]
 		}
 	},
 	watch: {
@@ -73,34 +100,43 @@ export default {
 	computed: {
     	...mapGetters({ loginInfo:"getLoginInfo" })
 	},
-	onLoad(option) {
-		// #ifdef H5
-		this.beginInit()
-		// #endif
+	onLoad(){
+
 	},
 	onShow(){
-		this.beginInit()
+		if(this.loginComeBack == 1){
+			this.beginInit()
+      		this.loginComeBack = 0
+    	}
 	},
 	mounted(){
 	},
 	methods: {
+		getRecharge(amount){
+			this.amount = amount
+		},
 		loginTo() {
 			this.$util.pageTo({url:"/pages/login/index?needBack=1"})
 		},
-		teachPayFn() {
-			this.pageTo({ url: "/admin/ghs/teachPay"})
-		},
 		init(){
 			this.beginInit();
 		},
 		beginInit() {
 			getHdInfo().then(res=>{
+				let that = this
 				if(res.code == 1){
-					this.hdInfo = res.data.hd ? res.data.hd : []
-					this.customInfo = res.data.custom ? res.data.custom : []
+					that.hdInfo = res.data.hd ? res.data.hd : []
+					that.customInfo = res.data.custom ? res.data.custom : []
+					if (!that.$util.isEmpty(that.customInfo)){
+						getMemberWeal().then(ret=>{
+							if(ret.code == 1){
+								that.rechargeWeal = ret.data.rechargeWeal ? ret.data.rechargeWeal : 0
+								that.weal = ret.data.weal ? ret.data.weal : 0
+							}
+						})
+					}
 				}
 			})
-			this.inpFocus = true
 		},
 		toPay() {
 			if (!this.amount) {