Bladeren bron

红包 开始处理

shish 4 jaren geleden
bovenliggende
commit
7d8e7456de

+ 5 - 8
ghsApp/src/admin/billing/affirm.vue

@@ -88,10 +88,12 @@
             <text style="color: #3385FF" v-else >{{ allPrice.toFixed(2) }}</text>
           </tui-list-cell>
 
+          <!--
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="customInfo.discount && customInfo.discount < 1" >
             <view class="tui-title">优惠</view>
-            <text style="color: red">{{discountAmount}}<text style="margin-left:18rpx;">({{customInfo.discount*100}}折)</text></text>
+            <text style="color: red"></text>
           </tui-list-cell>
+          -->
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
             <view class="tui-title">
@@ -182,8 +184,7 @@ export default {
       money: "",
       modifyPrice: 0,
       showCustomer: false,
-      customInfo:{discount:1},
-      discountAmount:0
+      customInfo:{discount:1}
     };
   },
   onLoad (option) {
@@ -238,11 +239,7 @@ export default {
 		},
     calcPrice () {
       let totalPrice = this.allPrice.toFixed(2)
-      if(this.customInfo.discount && this.customInfo.discount <1){
-        this.discountAmount = ((1-Number(this.customInfo.discount))*totalPrice).toFixed(2)
-        this.discountAmount = parseFloat(this.discountAmount)
-      }
-      this.modifyPrice = (Number(totalPrice) + Number(this.form.sendCost) - Number(this.discountAmount)).toFixed(2)
+      this.modifyPrice = (Number(totalPrice) + Number(this.form.sendCost)).toFixed(2)
       this.modifyPrice = parseFloat(this.modifyPrice)
     },
     setPayWay(payWay){

+ 225 - 0
ghsApp/src/admin/hb/list.vue

@@ -0,0 +1,225 @@
+<template>
+	<view class="allot-ex-page">
+        <view class="input-wrap_box">
+            <view>
+                <AppSearchModule placeholder="输入客户名称字母搜索" @input="searchFn"/>
+            </view>
+        </view>
+		<view class="app-tabs">
+			<Tabs
+				:tabs="tabs"
+				:currentTab="tabIndex"
+				@change="changeTabEvent"
+				@add="addHb"
+				:addText="'新增'"
+				:isAdd="false"
+			></Tabs>
+		</view>
+		<view class="allot-list">
+			<block v-if="!$util.isEmpty(list.data)">
+				<view class="allot-item" v-for="(item, index) in list.data" :key="index" @click="gotoDetails(item)">
+					<view class="info">
+                        <view class="info-order"> 
+                            <image mode="aspectFit" :src="item.customAvatar"></image>
+                          <text>{{ item.customName }}</text>
+                          </view>
+                        <view class="info-name">红包状态:{{item.status==1?'待使用':item.status ==2 ?'已使用':item.status==3?'已失效':'未知' }}</view>
+						<view class="info-name">最低消费:{{ item.miniCost }}元</view>
+                        <view class="info-name">过期时间:{{ item.endTime.substr(0,10) }}</view>
+                        <view class="info-name">发放时间:{{ item.addTime }}</view>
+					</view>
+					<view class="status primary">
+						<view class="status-name">{{item.amount}}元</view>
+					</view>
+				</view>
+			</block>
+			<block v-else>
+				<AppWrapperEmpty title="暂无记录" :is-empty="$util.isEmpty(list.data)" />
+			</block>
+		</view>
+		<view class="app-footer open_btn">
+			<view style="position:absolute;left:25rpx;color:#676767;">总共 {{totalNum}} 个</view>
+			<view @click="addHb" class="admin-button-com middle blue">发红包</view>
+		</view>
+	</view>
+</template>
+<script>
+import Tabs from "@/components/plugin/tabs";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { list } from "@/mixins";
+import { getHblist } from "@/api/hb";
+import AppSearchModule from "@/components/module/app-search";
+export default {
+	components: { Tabs, AppWrapperEmpty,AppSearchModule },
+	mixins: [list],
+	data() {
+		return {
+			tabIndex: 0,
+			tabs: [
+				{
+					name: "全部",
+					key: 0
+				},
+				{
+					name: "待使用",
+					key: 1
+				},
+				{
+					name: "已使用",
+					key: 2
+				},
+				{
+					name: "已失效",
+					key: 3
+				}
+			],
+            py:'',
+			totalNum:0
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getHbList().then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onShow() {
+		this.resetList();
+		this.initData();
+	},
+    onReachBottom() {
+        if (!this.list.finished) {
+            this.getHbList().then((res) => {
+                uni.stopPullDownRefresh();
+            })
+        } else {
+            uni.stopPullDownRefresh();
+        }
+    },
+	methods: {
+		async initData() {
+			this.getHbList();
+		},
+        searchFn(e){
+            this.resetList();
+            this.py = e;
+            this.getHbList();
+        },
+		getHbList() {
+			getHblist({status:this.tabs[this.tabIndex].key,page: this.list.page,py:this.py}).then(res => {
+					this.completes(res);
+					this.totalNum = res.data.totalNum
+				}).catch(err => {})
+		},
+		changeTabEvent(info) {
+			const { index } = info;
+			if (this.tabIndex == index) {
+				return false;
+			} else {
+				this.tabIndex = index;
+				this.resetList();
+				this.getHbList();
+			}
+		},
+		addHb() {
+			this.$msg('开发中')
+		},
+		gotoDetails(item) {
+			console.log(item)
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.allot-ex-page {
+    padding-top: 100px;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	background-color: #f9fbfc;
+    .input-wrap_box {
+        background-color: #fff;
+        position: fixed;
+        top: 0;
+        z-index: 10;
+        width: 100%;
+        height: 100px;
+        display: flex;
+        align-items: center;
+        padding: 0 30px;
+        & > view:nth-child(1) {
+        flex: 1;
+        }
+    }
+    .app-tabs {
+        position: fixed;
+        width: 100%;
+        z-index: 9;
+    }
+	.allot-list {
+		margin-top: 80px;
+		flex: 1;
+		padding-bottom: 100upx;
+		.allot-item {
+			margin-bottom: 1px;
+			padding: 30upx;
+			display: flex;
+			align-items: center;
+			box-shadow: 0px 1px 0px 0px #eeeeee;
+			background-color: #fff;
+			.info {
+				flex: 1;
+				margin-right: 20px;
+				.info-order {
+					font-size: 30upx;
+					font-weight: 500;
+					color: #333333;
+                    image{
+                        width:38rpx;
+                        height:38rpx;
+                        float:left;
+                        border-radius:25px;
+                        margin-right:10rpx;
+                    }
+				}
+				.info-name {
+					margin: 20upx 0 20upx;
+					font-size: 28upx;
+					font-weight: 400;
+					color: #666666;
+				}
+				.info-time {
+					margin-right: 30upx;
+					font-size: 28upx;
+					font-weight: 400;
+					color: #666666;
+				}
+			}
+			.status {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				flex-shrink: 0;
+				width: 100upx;
+				color: #cccccc;
+				.status-name {
+					margin-top: 10upx;
+					font-size: 24upx;
+				}
+				.iconfont {
+					font-size: 46upx;
+				}
+				&.primary {
+					color: #3385ff;
+				}
+				&.gray {
+					color: #cccccc;
+				}
+				&.warn {
+					color: #ffaf1d;
+				}
+			}
+		}
+	}
+}
+</style>

+ 7 - 3
ghsApp/src/admin/home/apply.vue

@@ -50,7 +50,7 @@ export default {
                     list:[
                         {name: "花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list"},
                         {name: "花材分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"},
-                        {name: "小菊颜色",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/xjSelect"}
+                        {name: "小菊颜色",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/xjSelect"},
                     ]
                 },
                 {
@@ -65,8 +65,12 @@ export default {
                     ]
                 },
                 {
-                    title:'赚钱',
-                    list:[{name: "邀请开店",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/pagesInvite/list"}]
+                    title:'营销推广',
+                    list:[
+                        {name: "红包",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/admin/hb/list"},
+                        {name: "充值返利",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/admin/item/rechargeHb"},
+                        {name: "邀请开店",img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,url: "/pagesInvite/list"}
+                    ]
                 }
             ]
         }

+ 0 - 1
ghsApp/src/admin/home/me.vue

@@ -69,7 +69,6 @@
               >提现</text>
             </view>
           </view>
-          <button @click="pageTo({ url: '/pagesStore/me/recharge' })" class="admin-button-com default">充值</button>
         </view>
         <view class="module-com content_box user-open_bx">
           <view class="input-line-wrap">

+ 3 - 18
ghsApp/src/admin/home/workbench.vue

@@ -30,20 +30,6 @@
 				</navigator>
 			</div>
 		</div>
-		<!-- 订单总览 -->
-		<div class="module-com order-wrap">
-			<div class="total-blo">
-				<div
-					class="total-list"
-					v-for="(item, index) in orderData"
-					:key="index"
-					@click="pageTo(item)"
-				>
-					<div class="list-num">{{ item.value }}</div>
-					<div class="app-color-3">{{ item.name }}</div>
-				</div>
-			</div>
-		</div>
 		<!-- 消息 -->
 		<div class="module-com news-wrap">
 			<div
@@ -237,12 +223,11 @@ export default {
 					url: "/admin/breakage/list"
 				},
 				{
-					name: "业绩",
-					img: `${this.$constant.imgUrl}/ghs/home/icon_ygyj.png`,
-					url: "/admin/staff/achieve"
+					name: "红包",
+					img: `${this.$constant.imgUrl}/ghs/home/yqyl.png`,
+					url: "/admin/hb/list"
 				}
 			],
-			// 总览
 			totalData: [
 				{
 					name: "客户数",

+ 184 - 0
ghsApp/src/admin/item/rechargeHb.vue

@@ -0,0 +1,184 @@
+<template>
+	<view class="ex-page">
+        <view class="title">
+        活动状态:<switch style="transform: scale(0.8,0.8)" :checked="rechargeSwitch == 0 ? false : true" @change="rechargeChange" />
+        <text v-if="rechargeSwitch == 0">关闭</text><text v-else>开启</text>
+        <button class="admin-button-com middle blue" @click="addHb()" style="float:right;margin-right:20rpx;">新增红包</button>
+        </view>
+        <view class="recharge-list">
+
+            <view v-for="(item, index) in recharge" :key="index">
+
+                <view class="item">
+
+                    <view>充值:<input v-model="item.amount" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:150rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />元</view>
+                    <view>赠送红包:<input v-model="item.num" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:100rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />个</view>
+                    <view>每个红包:<input v-model="item.hbAmount" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:120rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0rpx 10rpx;" />元</view>
+                    <view>最低消费满:<input v-model="item.miniExpend" placeholder-class="phcolor" class="tui-input" type="digit" style="width:120rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />元红包可用</view>
+                    <view>红包有效期:<input v-model="item.valid" placeholder-class="phcolor" class="tui-input" type="digit" style="width:100rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />天
+                    <button class="admin-button-com mini blue" @click="del(item)" style="margin-left:50rpx;">删除</button>
+                    </view>
+
+                </view>
+
+            </view>
+
+        </view>
+
+        <view class="footer">
+            <button class="admin-button-com big blue" @click="saveHb()">保存</button>
+        </view>
+	</view>
+</template>
+<script>
+import { mapGetters } from "vuex";
+import { getRechargeHbDetail,saveRechargeHb } from "@/api/recharge";
+export default {
+	components: {},
+	mixins: [],
+	computed: {
+		...mapGetters({ myShopInfo: "getMyShopInfo" }),
+	},
+	data() {
+		return {
+            recharge:[],
+            rechargeSwitch:0
+		};
+	},
+	onPullDownRefresh() {
+
+	},
+	onLoad() {
+
+	},
+	methods: {
+        rechargeChange(e) {
+			let value = e.target.value
+            if(value){
+                this.rechargeSwitch = 1
+            }else{
+                this.rechargeSwitch = 0
+            }
+        },
+		init(){
+            this.getDetail()
+        },
+        getDetail(){
+            let that = this
+            getRechargeHbDetail().then(res => {
+                that.rechargeSwitch = res.data.recharge;
+                if(!this.$util.isEmpty(res.data.list)){
+                   that.recharge = res.data.list.map(e=>{
+                       return {amount:e.amount,num:e.num,hbAmount:e.hbAmount,miniExpend:e.miniExpend,valid:e.valid}
+                   })
+                }else{
+                    that.recharge = [
+                        {amount:'',num:'',hbAmount:'',miniExpend:'',valid:''}
+                    ]
+                }
+            });
+        },
+        del(item){
+            if(this.recharge.length <= 1){
+                this.$msg("最少需要保留一个")
+                return false
+            }
+            var index = this.recharge.indexOf(item); 
+            if (index > -1) { 
+                this.recharge.splice(index, 1)
+            }
+        },
+        addHb(){
+            this.recharge.push({amount:'',num:'',hbAmount:'',miniExpend:'',valid:''})
+        },
+        saveHb(){
+            let amountGroup = []
+            let hasError = false
+            this.recharge.forEach(e => {
+                let currentAmount = parseFloat(e.amount)
+                if(amountGroup.indexOf(currentAmount) > -1){
+                   this.$msg("充值金额"+currentAmount+"重复了")
+                   hasError = true
+                   return false
+                }
+                amountGroup.push(currentAmount)
+
+                if(this.$util.isMoney(e.num) == false || e.num%1 !== 0){
+                   this.$msg("请填写红包数量")
+                   hasError = true
+                   return false
+                }
+
+                if(this.$util.isMoney(e.valid) == false || e.valid%1 !== 0){
+                   this.$msg("请填写有效期")
+                   hasError = true
+                   return false
+                }
+
+                if(this.$util.isMoney(e.hbAmount) == false){
+                   this.$msg("请填写红包金额"+e.hbAmount)
+                   hasError = true
+                   return false
+                }
+
+                if(this.$util.isMoney(e.miniExpend) == false){
+                   this.$msg("请填写最低消费金额")
+                   hasError = true
+                   return false
+                }
+                if(Number(e.miniExpend) <= Number(e.hbAmount)){
+                   uni.showToast({title: '最低消费金额要大于红包金额',duration: 3000,icon:"none"})
+                   hasError = true
+                   return false
+                }
+            });
+            if(hasError){
+                return false
+            }
+            saveRechargeHb({data:JSON.stringify(this.recharge),rechargeSwitch:this.rechargeSwitch}).then(res=>{
+                if(res.code == 1){
+                    this.$msg(res.msg)
+                    setTimeout(() => {
+                        this.$util.pageTo(1);
+                    }, 1000);
+                }
+            })
+        }
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page{
+    .title{
+        margin-bottom:50rpx;
+        padding-left:20rpx;
+        font-size:30rpx;
+    }
+    .recharge-list{
+        line-height:80px;
+        padding-left:20rpx;
+        font-size:30rpx;
+        padding-bottom:100rpx;
+        .item{
+            margin-bottom:60rpx;
+            input{
+                height:18rpx;
+            }
+        }
+    }
+    .footer{
+        margin-top:50rpx;
+        text-align: center;
+        position: fixed;
+        bottom:0;
+        width:100%;
+        background:#FFFFFF;
+        z-index:99999;
+        button{
+            width:90%;
+            margin:0 auto;
+        }
+
+    }
+}
+</style>

+ 6 - 0
ghsApp/src/api/hb/index.js

@@ -0,0 +1,6 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+//列表
+export const getHblist = data => {
+	return https.get('/hb/list', data)
+}

+ 8 - 0
ghsApp/src/api/recharge/index.js

@@ -8,4 +8,12 @@ export const rechargeBalance = data => {
 //充值记录
 export const rechargeList = data => {
 	return https.get('/recharge/list', data)
+}
+
+export const getRechargeHbDetail = data => {
+	return https.get('/recharge-hb/detail', data)
+}
+
+export const saveRechargeHb = async data => {
+	return https.post("/recharge-hb/save-hb", data);
 }

+ 4 - 1
ghsApp/src/components/module/app-commodity.vue

@@ -251,7 +251,10 @@ export default {
 			font-size: 32px;
 			font-weight: 700;
 			color: #333333;
-			padding-top: 10px;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			width:380rpx;
 		}
 		& .kc {
 			position: relative;

+ 1 - 1
ghsApp/src/ext.json

@@ -4,7 +4,7 @@
   "directCommit": false,
   "ext": {
     "account": 12362,
-    "apiHost": "https://api.shop.hzghd.com",
+    "apiHost": "http://api.shop.hzghd.com",
     "socketApiHost": "api.shop.hzghd.com",
     "imgHost": "https://img.hzghd.com",
     "name":"花掌柜"

+ 1 - 3
ghsApp/src/mixins/list.js

@@ -42,9 +42,7 @@ export default {
         this.list.finished = true
       }
       let listArr = res.data.list || res.data.data || res.data[listKey]
-      // console.log(listArr,111)
-      this.list.data =
-        this.list.page === 1 ? listArr : this.list.data.concat(listArr)
+      this.list.data = this.list.page === 1 ? listArr : this.list.data.concat(listArr)
       this.list.total = res.data.totalPage * this.list.pageSize
       this.list.totalPage = res.data.totalPage || res.totalPage
       if (!res.data.moreData) {

+ 2 - 2
ghsApp/src/mixins/product.js

@@ -17,7 +17,7 @@ export default {
 			top_list:'',
 			//id动态切换
 			scroll_into_view:"",
-			timeFun:"",
+			timeFun:""
 		};
 	},
 	onLoad(options) {
@@ -157,7 +157,7 @@ export default {
 		//请求商品数据
 		async initData(extendInfo) {
 			try {
-				let params = {type: this.type}
+				let params = {type: this.type,customId:this.option.customId}
 				if (extendInfo) {
 					params = { ...params, ...extendInfo };
 				}

+ 16 - 54
ghsApp/src/pages.json

@@ -506,70 +506,32 @@
 		{
 			"root": "admin/clear",
 			"pages": [
-				{
-					"path": "list",
-					"style": {
-						"navigationBarTitleText": "结帐单"
-					}
-				},
-				{
-					"path": "info",
-					"style": {
-						"navigationBarTitleText": "详情"
-					}
-				},
-				{
-					"path": "customList",
-					"style": {
-						"navigationBarTitleText": "历史帐单"
-					}
-				},
-				{
-					"path": "customInfo",
-					"style": {
-						"navigationBarTitleText": "详情"
-					}
-				}
+				{"path": "list","style": {"navigationBarTitleText": "结帐单"}},
+				{"path": "info","style": {"navigationBarTitleText": "详情"}},
+				{"path": "customList","style": {"navigationBarTitleText": "历史帐单"}},
+				{"path": "customInfo","style": {"navigationBarTitleText": "详情"}}
 			]
 		},
 		{
 			"root": "admin/item",
 			"pages": [
-				{
-					"path": "list",
-					"style": {
-						"navigationBarTitleText": "花材列表"
-					}
-				},
-				{
-					"path": "detail",
-					"style": {
-						"navigationBarTitleText": "花材详情"
-					}
-				},
-				{
-					"path": "xj",
-					"style": {
-						"navigationBarTitleText": "请选择颜色"
-					}
-				},
-				{
-					"path": "xjSelect",
-					"style": {
-						"navigationBarTitleText": "小菊颜色选择"
-					}
-				}
+				{"path": "list","style": {"navigationBarTitleText": "花材列表"}},
+				{"path": "detail","style": {"navigationBarTitleText": "花材详情"}},
+				{"path": "xj","style": {"navigationBarTitleText": "请选择颜色"}},
+				{"path": "xjSelect","style": {"navigationBarTitleText": "小菊颜色选择"}},
+				{"path": "rechargeHb","style": {"navigationBarTitleText": "充值"}}
 			]
 		},
 		{
 			"root": "admin/itemClass",
 			"pages": [
-				{
-					"path": "list",
-					"style": {
-						"navigationBarTitleText": "花材分类"
-					}
-				}
+				{"path": "list","style": {"navigationBarTitleText": "花材分类"}}
+			]
+		},
+		{
+			"root": "admin/hb",
+			"pages": [
+				{"path": "list","style": {"navigationBarTitleText": "红包"}}
 			]
 		}
 	],

+ 9 - 7
ghsApp/src/pagesOrder/detail.vue

@@ -8,7 +8,7 @@
 			<view class="address-des_bx content-box" @click='pageTo({url:"/pagesClient/member/detail",query: {id: detailInfo.customId}})'>
 				<view>
 					<view> {{ detailInfo.customName }} {{ detailInfo.customMobile }} </view>
-					<view style="margin-bottom:20rpx;color:#333333"">店长:{{ detailInfo.customSuper.name}}</view>
+					<view style="margin-bottom:20rpx;color:#333333">店长:{{ detailInfo.customSuper.name}}</view>
 					<view>{{ detailInfo.customAddress}}</view>
 				</view>
 				<view>
@@ -160,18 +160,16 @@
 						<div class="detail-price_box" style="font-size: 28rpx;">¥{{ detailInfo.prePrice}}</div>
 					</tui-list-cell>
 					<tui-list-cell v-if="detailInfo.discountAmount > 0" class="line-cell" :hover="false">
-						<div class="tui-title">优惠</div>
-						<div class="detail-price_box" style="font-size: 28rpx">-¥{{ detailInfo.discountAmount }}</div>
+						<div class="tui-title"><text v-if="detailInfo.discountType == 4">红包</text><text v-else>优惠</text></div>
+						<div class="detail-price_box red" style="font-size: 28rpx">-¥{{ detailInfo.discountAmount }}</div>
 					</tui-list-cell>
 					<tui-list-cell v-if="detailInfo.refundPrice > 0" class="line-cell" :hover="false">
 						<div class="tui-title">退款金额</div>
 						<div class="detail-price_box red" style="font-size: 28rpx">-¥{{ detailInfo.refundPrice }}</div>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
-
-						<div v-if="detailInfo.status == 1 || detailInfo.status==5" class="tui-title">应收金额</div>
-						<div v-else class="tui-title">实际金额</div>
-						<div class="detail-price_box red" style="font-size: 32rpx;font-weight:bold;">¥{{ detailInfo.realPrice}}</div>
+						<div class="tui-title">实际金额</div>
+						<div class="detail-price_box" style="font-size: 32rpx;">¥{{ detailInfo.realPrice}}</div>
 					</tui-list-cell>
 				</div>
 			</view>
@@ -630,6 +628,10 @@ export default {
 							color: black;
 							font-size: 30px;
 							font-weight: 700;
+							overflow: hidden;
+							white-space: nowrap;
+							text-overflow: ellipsis;
+							width:360rpx;
 						}
 						.item-price {
 							color: #333;

+ 50 - 51
hdApp/src/admin/billing/affirmGhs.vue

@@ -38,6 +38,10 @@
 							.item-name {
 								color: #666;
 								font-size: 28px;
+								overflow: hidden;
+								white-space: nowrap;
+								text-overflow: ellipsis;
+								width:400rpx;
 							}
 							.item-price {
 								color: #333;
@@ -155,7 +159,18 @@
     flex: 1;
     text-align: right;
     padding-right: 45upx;
-    color: #ff2945;
+	.has-hb{
+		background:red;
+		color:white;
+		border:1rpx solid red;
+		border-radius: 30rpx;
+		font-size:20rpx;
+		padding:5rpx 15rpx 5rpx 15rpx;
+	}
+	.selected{
+		color:red;
+		float:left;
+	}
   }
 }
 </style>
@@ -201,7 +216,7 @@
 						<view class="summary-bar">
 							<view class="operate-view" @click="gobackEvent">
 								<text class="iconfont icongouwuche"></text>
-								重选花材
+								修改花材
 							</view>
 							<view class="describe-view">共{{ allCountFun.bigLength }}/{{ allCountFun.smallLength }}种,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
 						</view>
@@ -232,26 +247,14 @@
 						<input type="number" placeholder="" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder" disabled>
 					</tui-list-cell>
 
-					<!--
-          			<tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="toCoupon">
-						<view class="tui-title ">红包/抵用券</view>
-						<view class="coupon_box">{{couponText}}</view>
+          			<tui-list-cell v-if="hasHb == 1" class="line-cell" :hover="false" :arrow="true" @click="goSelectCoupon">
+						<view class="tui-title ">红包</view>
+						<view class="coupon_box"><text class="selected" v-if="selectedHb.hbId && selectedHb.hbId>0">-{{selectedHb.couponAmount}}</text><text class="has-hb" v-else>有红包</text></view>
 					</tui-list-cell>
-					-->
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
 						<view class="tui-title">总金额</view>
-						<text style="color: #3385FF">{{ parseFloat(allPrice.toFixed(2)) }}</text>
-					</tui-list-cell>
-
-					<tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="ghsInfo.giveDiscount && ghsInfo.giveDiscount < 1" >
-						<view class="tui-title">优惠</view>
-						<text style="color: red">{{discountAmount}}<text style="margin-left:18rpx;">({{ghsInfo.giveDiscount*100}}折)</text></text>
-					</tui-list-cell>
-
-					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
-						<view class="tui-title">实际金额</view>
-						<text style="color: #3385FF">{{modifyPrice}}</text>
+						<text style="color: #3385FF">{{ modifyPrice }}</text>
 					</tui-list-cell>
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
@@ -263,7 +266,7 @@
 		</view>
 		<view class="under-bar">
 			<view class="price-view">
-				<text class="price-title">金额</text>
+				<text class="price-title">合计</text>
 				<text class="price-number">¥<text class="large">{{ modifyPrice}}</text></text>
 			</view>
 			<button class="admin-button-com blue middle" @click="affirmFormSubmit">提交</button>
@@ -331,15 +334,14 @@ export default {
 				sendCost: "",
 				customId: "",
 				product: "",
-        		couponId: '0'
+        		hbId: '0'
 			},
 			showCustomer: false,
-      		couponSumText: '',
-      		couponText: '',
 			today:'',
 			monthLater:'',
 			modifyPrice:0,
-			discountAmount:0
+			hasHb:0,
+			selectedHb:{couponAmount:0,hbId:0,couponSelInx:0}
 		};
 	},
 	onLoad(e) {
@@ -366,14 +368,13 @@ export default {
 			}
 		}
 		this.list = list;
-		if(uni.getStorageSync('selectCouponInfo').couponSum) {
-			this.couponSumText = uni.getStorageSync('selectCouponInfo').couponSum
-			this.couponText = '-¥' + this.couponSumText
-			this.form.couponId = uni.getStorageSync('selectCouponInfo').couponId
-		} else {
-			this.couponSumText = "0"
-			this.form.couponId = '0'
+		if(this.selectedHb.hbId && this.selectedHb.hbId > 0) {
+			this.form.hbId = this.selectedHb.hbId
+			this.calcPrice()
+		}else{
+			this.form.hbId = 0
 			this.hasCoupon()
+			this.calcPrice()
 		}
 	},
 	computed: {
@@ -383,43 +384,41 @@ export default {
 		...mapActions(["initMerchantInfo"]),
 		calcPrice(){
 			let allPrice = this.allPrice.toFixed(2)
-			if(this.ghsInfo.giveDiscount && this.ghsInfo.giveDiscount < 1){
-				this.discountAmount = ((1-Number(this.ghsInfo.giveDiscount))*allPrice).toFixed(2)
-				this.discountAmount = parseFloat(this.discountAmount)
+			this.modifyPrice = Number(allPrice)
+			if(this.selectedHb.hbId && this.selectedHb.hbId > 0) {
+				this.modifyPrice = (this.modifyPrice - Number(this.selectedHb.couponAmount)).toFixed(2)
 			}
-			this.modifyPrice = (Number(allPrice) - Number(this.discountAmount)).toFixed(2)
 			this.modifyPrice = parseFloat(this.modifyPrice)
 		},
 		init() {
 			this._getDet()
 		},
 		bindDateChange(e){
-			let date = e.detail.value;
+			let date = e.detail.value
 			this.sendTimeWant = date
 		},
 		toPhone(phone){
-			let amount = this.form.sendType == 1 ? this.allPrice+Number(this.form.sendCost) : this.allPrice
 			uni.makePhoneCall({
 				phoneNumber: phone
 			});
 		},
-		toCoupon() {
+		goSelectCoupon() {
 			let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
-			console.log(amount)
-			this.pageTo({url: '/admin/coupon/selectCouponList?price=' + amount})
+			let query = {amount:amount,ghsId:this.option.id,...this.selectedHb}
+			this.pageTo({url: '/admin/coupon/selectCouponList',query:query})
 		},
-		// 是否有可用优惠券、红包
+		// 是否有可用红包
 		hasCoupon() {
-			let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
-			shopHouponHas({amount}).then(res => {
-				this.couponText = res.data.has ? '有红包可用' : ''
-				console.log(this.couponText)
+			let amount = this.allPrice
+			shopHouponHas({amount:amount,ghsId:this.option.id}).then(res => {
+				this.hasHb = res.data.has
 			}).catch(err => {})
 		},
 		getGhsData(id) {
 			getGhsDataApi({id:id}).then(res => {
 				this.ghsInfo = res.data;
-				this.purchaseFreight(this.ghsInfo);
+				//注释计算运费
+				//this.purchaseFreight(this.ghsInfo);
 				this.calcPrice()
 			});
 		},
@@ -427,8 +426,10 @@ export default {
 			this.allPrices = this.allPrices+Number(this.form.sendCost)
 		},
 		_getDet() {
-			let data = uni.getStorageSync("modifyShopB");
-			if (this.$util.isEmpty(data)) return;
+			let data = uni.getStorageSync("modifyShopB")
+			if (this.$util.isEmpty(data)){
+				return
+			}
 			Object.keys(this.form).forEach((i, index) => {
 				this.form[i] = data[i];
 			});
@@ -479,7 +480,7 @@ export default {
 				remark:this.remark,
 				product:JSON.stringify(product),
 				ghsId:this.ghsInfo.id,
-				couponId: this.form.couponId,
+				hbId: this.form.hbId,
 				xj:JSON.stringify(xj)
 			}
 			let self = this;
@@ -492,7 +493,6 @@ export default {
 							const {data: { orderSn,realPrice,count,hasDebtPay }} = res;
 							self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&realPrice=${realPrice}&count=${count}&hasDebtPay=${hasDebtPay}`, type: 2})
 							setTimeout(() => {
-								uni.removeStorageSync('selectCouponInfo')
 								self.removeMemory(self.ghsInfo.id)
 								//删除小菊的记忆
 								uni.removeStorageSync("ghsXj"+params.ghsId)
@@ -566,5 +566,4 @@ export default {
 		}
 	}
 };
-</script>
-
+</script>

+ 5 - 5
hdApp/src/admin/coupon/components/selectCouponItem.vue

@@ -13,9 +13,9 @@
       </div>
       <div class="list-det-right">
         <div class="coupon-message">
-          <div class="app-color-2">优惠券</div>
+          <div class="app-color-2" style="color:#b8b6b6">优惠券</div>
           <div>适用:全品类</div>
-          <div>有效至:{{ item.endTime.substr(0, 10)}}</div>
+          <div>有效至:{{ item.endTime}}</div>
         </div>
       </div>
     </div>
@@ -51,9 +51,9 @@ export default {
     top: 0;
     left: 0;
     .list-det-left {
-      padding: 20px 0 20px 36px;
+      padding: 24px 0 20px 36px;
       width: 210px;
-      color: #efefef;
+      color: #b8b6b6;
       .price-wrap {
         margin-bottom: 6px;
         font-size: 26upx;
@@ -70,7 +70,7 @@ export default {
       @include disFlex(center, space-between);
       padding: 20px 26px 20px 0;
       .coupon-message {
-        color: $fontColor3;
+        color: #b8b6b6;
         & > div {
           margin: 6px 0;
         }

+ 9 - 9
hdApp/src/admin/coupon/couponList.vue

@@ -26,13 +26,13 @@
 						</div>
 						<div class="list-det-right">
 							<div class="coupon-message">
-								<div class="app-color-2">优惠券</div>
-								<div>适用:全品类</div>
-								<div>有效至:{{ item.endTime.substr(0, 10) }}</div>
+								<div class="app-color-2" style="color:#333333;font-weight:500;font-size:35rpx;">{{ item.name}}</div>
+								<div>来源:{{item.ghsName}}</div>
+								<div>过期时间:{{ item.endTime.substr(0, 10) }}</div>
 							</div>
 							<!-- 未使用 -->
 							<template v-if="tabIndex == 0">
-								<button class="button-com red" @click="goUserFn">去使用</button>
+								<button class="button-com red" @click="useHb(item)">使用</button>
 							</template>
 							<!-- 已使用 -->
 							<template v-else-if="tabIndex == 1">
@@ -78,7 +78,7 @@ export default {
 					name: '未使用'
 				},
 				{
-					name: '使用记录'
+					name: '使用'
 				},
 				{
 					name: '已过期'
@@ -124,8 +124,8 @@ export default {
 			}
 		},
 		// 去使用
-		goUserFn() {
-			this.$util.pageTo({url: '/pagesPurchase/order', type: 2})
+		useHb(item) {
+			this.$util.pageTo({url: '/pagesPurchase/ghsProduct?id='+item.ghsId, type: 2})
 		}
 	}
 }
@@ -163,11 +163,11 @@ export default {
 						width: calc(100% - 280px);
 						margin-left: 22px;
 						@include disFlex(center, space-between);
-						padding: 30px 26px 30px 0;
+						padding: 20px 26px 30px 0;
 						.coupon-message {
 							color: $fontColor3;
 							& > div {
-								margin: 4px 0;
+								margin: 5px 0;
 							}
 						}
 						.button-com {

+ 37 - 55
hdApp/src/admin/coupon/selectCouponList.vue

@@ -1,20 +1,7 @@
 <template>
   <scroll-view class="coupon-sel" scroll-y>
     <div class="coupon-wrap">
-      <div
-        class="coupon-list"
-        v-for="(item, index) in usableList"
-        :key="index"
-        @click="couponChange(item, index + 1)"
-      >
-        <!-- <div class="list-img">
-          <template v-if="couponSelInx && couponSelInx == (index + 1)">
-            <img :src="`${constant.imgUrl}/retail/coupon/is-check.png`" alt mode="widthFix" class="bg_img" />
-          </template>
-          <template v-else>
-            <img :src="`${constant.imgUrl}/retail/coupon/no-check.png`" alt mode="widthFix" class="bg_img" />
-          </template>
-        </div> -->
+      <div class="coupon-list" v-for="(item, index) in validList" :key="index" @click="couponChange(item, index + 1)">
         <div class="list-det">
           <img :src="couponSelInx && couponSelInx == (index + 1) ? `${constant.imgUrl}/retail/coupon/is-check.png` : `${constant.imgUrl}/retail/coupon/no-check.png`" alt mode="widthFix" class="bg_img" />
           <div class="list-det-left">
@@ -26,26 +13,28 @@
           </div>
           <div class="list-det-right">
             <div class="coupon-message">
-              <div class="app-color-2">优惠券</div>
+              <div class="app-color-2" style="color:#333333;font-weight:600;">{{ item.name}}</div>
               <div>适用:全品类</div>
-              <div>有效至:{{ item.endTime.substr(0, 10) }}</div>
+              <div>有效至:{{ item.endTime}}</div>
             </div>
           </div>
         </div>
       </div>
-      <selectCouponItem v-for="(item, index) in unusableList" :key="index" :item="item"></selectCouponItem>
+      <selectCouponItem v-for="(item, index) in invalidList" :key="index" :item="item"></selectCouponItem>
     </div>
   <view class="footer_bar">
-    <text>已优惠¥{{couponSum}}</text>
+    <text>优惠¥{{couponAmount}}</text>
     <button class="admin-button-com middle blue" @click="ConfirmReachFn">确认</button>
   </view>
   </scroll-view>
 </template>
 
 <script>
+
+let nowDate = new Date();
+let currentDate = nowDate.Format('yyyy-MM-dd hh:mm:ss')
+
 import { mapGetters } from "vuex";
-import { userDiscount } from "@/api/member";
-import { getShopUser } from "@/utils/auth";
 import { shopCouponList } from '@/api/coupon'
 import selectCouponItem from './components/selectCouponItem'
 export default {
@@ -55,28 +44,32 @@ export default {
   data() {
     return {
       couponSelInx: null,
-      couponId: 0,
+      hbId: 0,
       data: {},
-      couponSum: '0',
+      couponAmount: '0',
       list: []
     };
   },
   computed: {
     ...mapGetters({ shopUser: "getShopUser" }),
-    usableList() {
-      return this.list.filter(item => {return Number(item.miniCost) <= Number(this.option.price) && item.take != 2})
+    validList() {
+      return this.list.filter(item => {
+        return Number(item.miniCost) <= Number(this.option.amount) && item.take != 2 && item.endTime > currentDate && item.beginTime < currentDate
+        })
     },
-    unusableList() {
-      return this.list.filter(item => {return Number(item.miniCost) > Number(this.option.price) || item.take == 2})
+    invalidList() {
+      return this.list.filter(item => {
+        return Number(item.miniCost) > Number(this.option.amount) || item.take == 2 || item.endTime <= currentDate || item.beginTime > currentDate
+        })
     }
   },
   mounted() {},
   onShow() {
-    if( uni.getStorageSync('selectCouponInfo').couponId != null) {
-      this.couponSelInx = uni.getStorageSync('selectCouponInfo').couponSelInx
-      this.couponId = uni.getStorageSync('selectCouponInfo').couponId
-      this.couponSum = uni.getStorageSync('selectCouponInfo').couponSum
-    }
+      if(this.option.hbId && this.option.hbId > 0){
+        this.couponSelInx = this.option.couponSelInx
+        this.hbId = this.option.hbId
+        this.couponAmount = this.option.couponAmount
+      }    
   },
   onPullDownRefresh() {
 			this._list().then(res => {
@@ -88,35 +81,24 @@ export default {
 			this._list()
 		},
 		_list() {
-			return shopCouponList({ status: '1' }).then(res => {
-				console.log(res)
+			return shopCouponList({ status: '1',ghsId:this.option.ghsId}).then(res => {
         this.list = res.data.list
 			})
 		},
     // 优惠券选择
     couponChange(item, index) {
-      
       this.couponSelInx = this.couponSelInx == index ? null : index;
-      this.couponId = this.couponSelInx == index ? item.id : 0;
-      this.couponSum = this.couponSelInx == index ? item.amount : '0';
-      
-      console.log(this.couponId, this.couponSelInx)
+      this.hbId = this.couponSelInx == index ? item.id : 0;
+      this.couponAmount = this.couponSelInx == index ? item.amount : '0';
     },
     ConfirmReachFn() {
-      let obj = {}
-      console.log({couponSum: this.couponSum, couponId: this.couponId})
-      if(this.couponSum != '0') {
-        obj.couponSum = this.couponSum
-      }
-      if(this.couponId != '0') {
-        obj.couponId = this.couponId
-      }
-      if (this.couponSelInx != null) {
-        obj.couponSelInx = this.couponSelInx
-      }
-      console.log(obj, 116)
-      uni.setStorageSync('selectCouponInfo', obj)
-      uni.navigateBack({})
+      let obj = {couponAmount:this.couponAmount,hbId:this.hbId,couponSelInx:this.couponSelInx}
+			//返回上一页带参数
+			let pages = getCurrentPages();
+			let prevPage = pages[ pages.length - 2 ];
+			//修改上一页data里面的selectedHb
+			prevPage.$vm.selectedHb = obj
+			uni.navigateBack({})
     }
   }
 };
@@ -156,11 +138,11 @@ export default {
         z-index: -1;
       }
       .list-det-left {
-        padding: 20px 0 20px 36px;
+        padding: 24px 0 20px 36px;
         width: 210px;
         color: #ff2947;
         .price-wrap {
-          margin-bottom: 6px;
+          margin-bottom: 8px;
           font-size: 26px;
           .price {
             font-size: 60px;
@@ -175,7 +157,7 @@ export default {
         @include disFlex(center, space-between);
         padding: 20px 26px 20px 0;
         .coupon-message {
-          color: $fontColor3;
+          color: #333333;
           & > div {
             margin: 6px 0;
           }

+ 10 - 14
hdApp/src/admin/home/me.vue

@@ -65,14 +65,18 @@
               <text v-if="infoData.txBalance > 0" @click="checkToApplyCash" class="to-cash">提现</text>
             </view>
           </view>
-          <button
-            @click="pageTo({ url: '/pagesStore/me/recharge' })"
-            class="admin-button-com default"
-          >
-            充值
-          </button>
         </view>
         <view class="module-com content_box user-open_bx">
+
+            <tui-list-cell
+              @click="pageTo({ url: '/admin/coupon/couponList' })"
+              class="line-cell"
+              :hover="false"
+              :arrow="true"
+            >
+              <div class="tui-title">我的红包</div>
+            </tui-list-cell>
+
           <tui-list-cell
               @click="pageTo({ url: '/pagesStore/me/shopYeChange' })"
               class="line-cell"
@@ -122,14 +126,6 @@
             >
               <div class="tui-title">快递设置</div>
             </tui-list-cell>
-            <tui-list-cell
-              @click="pageTo({ url: '/admin/coupon/couponList' })"
-              class="line-cell"
-              :hover="false"
-              :arrow="true"
-            >
-              <div class="tui-title">我的优惠券</div>
-            </tui-list-cell>
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/print' })" class="line-cell" :hover="false" :arrow="true">
               <div class="tui-title">云打印</div>

+ 4 - 16
hdApp/src/api/coupon/index.js

@@ -1,19 +1,5 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
-/** *
- * 登录客户的优惠情况 m
- */
-// export const discount = data => {
-// 	return https.get('/user/discount', data)
-// }
-
-/** *
- * 登录客户的优惠券列表 m
- */
-// export const list = data => {
-// 	return https.get('/user/discount', data)
-// }
-
 /** *
  * 优惠券列表 m
  */
@@ -35,8 +21,6 @@ export const getList = data => {
 	return https.get('/shop-coupon/has', data)
 }
 
-// =====================  B 端 ========================
-
 /** *
  * 优惠券列表 b
  */
@@ -63,4 +47,8 @@ export const couponAssetUpdate = data => {
  */
 export const receiveGift = data => {
 	return https.post('/invite/get-new-gift', data)
+}
+
+export const ghsSendHb = data => {
+	return https.get('/shop-coupon/ghs-send-hb', data)
 }

+ 5 - 0
hdApp/src/api/recharge/index.js

@@ -23,4 +23,9 @@ export const rechargeRenewPay = data => {
 // 活动页  
 export const rechargeRenewSuccess = data => {
 	return https.get('/recharge/renew-success', data)
+}
+
+//供货商的充值送红包活动 
+export const getGhsHb = data => {
+	return https.get('/recharge-hb/get-ghs-hb', data)
 }

+ 8 - 11
hdApp/src/components/module/app-commodity.vue

@@ -4,23 +4,16 @@
 			<image :src="info.cover" v-if="isImg"></image>
 		</view>
 		<view class="cmd-info_bx">
-			<view class="tit" >{{ info.itemName || "" }}</view>
+			<view class="tit" >{{ info.itemName}}</view>
 			<view class="kc num-open_bx flex-space" v-if="type == COMMODITY_TYPE.COMMON">
 				<view v-if="!offPrice">
-					<view class="flex-space" style="margin-top:8rpx" v-if="Number(info.discountPrice)>0">
+					<view class="flex-space" style="margin-top:20rpx" v-if="Number(info.discountPrice)>0">
 						<view style="padding:2rpx 10rpx 5rpx 10rpx;text-align: center;color: red;border: 1px solid red;margin-right: 20rpx;line-height: 1;font-size: 20rpx">
 							{{((Number(info.discountPrice)/Number(info.prePrice)).toFixed(2)*10).toFixed(1)+'折'}}
 						</view>
 						<text style="text-decoration:line-through;color:#A9A9A9">¥{{info.prePrice}}</text>
 					</view>
-					
-					<view v-if="discount < 1 && discount >0">
-					<text v-if="Number(info.discountPrice)>0">预估到手 {{parseFloat((Number(info.discountPrice)*Number(discount)).toFixed(2))}}</text>
-					<text v-else>预估到手 {{parseFloat((Number(info.price)*Number(discount)).toFixed(2))}}</text>
-					</view>
-
-					<view v-if="Number(info.discountPrice)>0" class="price" >¥{{ info.discountPrice }}</view>
-					<view v-else class="price" >¥{{ info.price }}</view>
+					<view class="price" >¥{{ info.price }}</view>
 				</view>
 				<view class="price" v-else></view>
 				<view style="text-align: right" >
@@ -245,6 +238,10 @@ export default {
 			font-weight: 700;
 			color: #333333;
 			padding-top: 0 0 2rpx 0;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			width:380rpx;
 		}
 		& .kc {
 			position: relative;
@@ -263,7 +260,7 @@ export default {
 				font-size: 28px;
 				color: #ff2842;
 				flex: 1;
-				top:72rpx;
+				top:60rpx;
 				font-weight:550;
 			}
 			& .open-bx {

+ 1 - 1
hdApp/src/ext.json

@@ -4,7 +4,7 @@
   "directCommit": false,
   "ext": {
     "account": 12362,
-    "apiHost": "https://api.shop.huaml.com",
+    "apiHost": "http://api.shop.huaml.com",
     "socketApiHost": "api.shop.huaml.com",
     "imgHost": "https://img.huaml.com",
     "name":"花美玲"

+ 1 - 1
hdApp/src/pages.json

@@ -315,7 +315,7 @@
 				{
 					"path": "couponList",
 					"style": {
-						"navigationBarTitleText": "优惠券"
+						"navigationBarTitleText": "红包"
 					}
 				},
 				{

+ 18 - 9
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -5,18 +5,26 @@
       <view class="header_inside">
         <image :src="pageInfo.avatar"></image>
         <view class="shop_info">
-          <view class="shop_title">{{pageInfo.name}}</view>
-          <view class="shop_intro">
-			  <text v-if="pageInfo.giveDiscount >= 1 || Number(pageInfo.giveDiscount) <= 0" style="margin-right: 20upx;">已采购:{{pageInfo.expendAmount || '0.00'}}</text>
-			  <text v-else style="margin-right: 20upx;color:red;font-weight:700">下单享{{shareDiscount}}折</text>
-			  <text>欠款:{{pageInfo.debtAmount || '0.00'}}</text></view>
+          <view class="shop_title">{{pageInfo.name||''}}</view>
+
+			<view v-if="pageInfo.hasRechargeHb && pageInfo.hasRechargeHb ==1" class="shop_intro" @tap="recharge(pageInfo)">
+				<text>有充有送,最高送{{parseFloat(pageInfo.hasRechargeHbAmount)}}元
+					<text style="z-index:999999;margin-left:15rpx;color:red;border:1px solid red;padding:3rpx 10rpx 3rpx 10rpx;border-radius:10rpx;">去充值</text>
+				</text>
+			</view>
+
+          	<view v-else class="shop_intro">
+			  <text style="margin-right: 20upx;">已采购:{{pageInfo.expendAmount || '0.00'}}</text>
+			  <text>欠款:{{pageInfo.debtAmount || '0.00'}}</text>
+			</view>
+
         </view>
         <i class="iconfont icondianhua1" v-if="pageInfo.mobile !=''" @tap="toPhone(pageInfo.mobile)"></i>
       </view>
     </view>
 		<view class="input-wrap" >
 			<view class="search-bar">
-				<app-search-module v-model="py" placeholder="输首字母搜索,如太阳花,输tyh" @input="searchFn" />
+				<app-search-module v-model="py" placeholder="输字母搜索,如太阳花,输tyh" @input="searchFn" />
 			</view>
 			<view style="padding:0 0rpx 0 20rpx;" >
 				<button class="admin-button-com middle blue" @click="removeMemory(option.id)">清除采购</button>
@@ -262,6 +270,9 @@ export default {
 
 	},
 	methods: {
+		recharge(item){
+			this.$util.pageTo({url:'/pagesStore/me/recharge',query:{ghsId:item.id}})
+		},
 		//去特殊品种页,如小菊等
 		goToSpecialVariety(info){
 			this.xjDataInfo = info
@@ -330,6 +341,7 @@ export default {
 					})
 				}).catch(err => {})
 			}
+
 		},
 		createShareDiscount(){
 			let shareDiscount = this.pageInfo.giveDiscount*100
@@ -471,10 +483,7 @@ export default {
 					return
 				}
 				this.setSelectInfoByType({ type: this.pageType, info: list });
-				
-
 
-        		uni.removeStorageSync('selectCouponInfo')
 				uni.navigateTo({
 					url: `/admin/billing/affirmGhs?id=${this.options.id}`
 				});

+ 8 - 4
hdApp/src/pagesPurchase/purDetails.vue

@@ -168,16 +168,16 @@
             <div class="detail-price_box" style="font-size: 28rpx;">¥{{ detailInfo.prePrice }}</div>
           </tui-list-cell>
           <tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.discountAmount > 0">
-            <div class="tui-title">优惠</div>
-            <div class="detail-price_box" style="font-size: 28rpx;">-¥{{ detailInfo.discountAmount}}</div>
+            <div class="tui-title"><text v-if="detailInfo.discountType == 4">红包</text><text v-else>优惠</text></div>
+            <div class="detail-price_box red" style="font-size: 28rpx;">-¥{{ detailInfo.discountAmount}}</div>
           </tui-list-cell>
           <tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.refundPrice > 0">
             <div class="tui-title">退款金额</div>
             <div class="detail-price_box red" style="font-size: 28rpx;">-¥{{ detailInfo.refundPrice}}</div>
           </tui-list-cell>
           <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">实</div>
-            <div class="detail-price_box red" style="font-size: 36rpx;">¥{{ detailInfo.realPrice}}</div>
+            <div class="tui-title">实际金额</div>
+            <div class="detail-price_box" style="font-size: 36rpx;">¥{{ detailInfo.realPrice}}</div>
           </tui-list-cell>
         </div>
       </view>
@@ -410,6 +410,10 @@ export default {
               color: black;
               font-size: 30px;
               font-weight: 700;
+							overflow: hidden;
+							white-space: nowrap;
+							text-overflow: ellipsis;
+							width:360rpx;
             }
             .item-price {
               color: #333;

+ 57 - 76
hdApp/src/pagesStore/me/recharge.vue

@@ -2,84 +2,28 @@
   <view>
     <view class="recharge_title">充值金额</view>
     <view>
-      <view class="amount_area">
-        <view
-          class="amount string left"
-          :class="amount == 5000 ? 'selected' : ''"
-          @click="
-            amount = 5000;
-            other_amount = '';
-          "
-          >¥5000</view
-        >
-        <view
-          class="amount string middle"
-          :class="amount == 1000 ? 'selected' : ''"
-          @click="
-            amount = 1000;
-            other_amount = '';
-          "
-          >¥1000</view
-        >
-        <view
-          class="amount string"
-          :class="amount == 800 ? 'selected' : ''"
-          @click="
-            amount = 800;
-            other_amount = '';
-          "
-          >¥800</view
-        >
-      </view>
-      <view class="amount_area">
-        <view
-          class="amount string left"
-          :class="amount == 500 ? 'selected' : ''"
-          @click="
-            amount = 500;
-            other_amount = '';
-          "
-          >¥500</view
-        >
-        <view
-          class="amount string middle"
-          :class="amount == 100 ? 'selected' : ''"
-          @click="
-            amount = 100;
-            other_amount = '';
-          "
-          >¥100</view
-        >
-        <view class="amount">
-          <input
-            type="digit"
-            placeholder="其它金额"
-            class="other_amount"
-            @click="amount = ''"
-            v-model="other_amount"
-          />
-        </view>
+
+      <view class="amount_area" v-for="(item, index) in rechargeList">
+        <view v-if="item[0]" class="amount string left" :class="item[0].select == '1' ? 'selected' : ''" @click="selectRecharge(item[0])">{{item[0].amount}}</view>
+        <view v-if="item[1]" class="amount string middle" :class="item[1].select == 1 ? 'selected' : ''" @click="selectRecharge(item[1])">{{item[1].amount}}</view>
+        <view v-if="item[2]" class="amount string" :class="item[2].select == 1  ? 'selected' : ''" @click="selectRecharge(item[2])">{{item[2].amount}}</view>
       </view>
 
+      <view v-if="!$util.isEmpty(hbData)" class="hb-hint">赠送<text>{{hbData.num}}</text>张<text>{{hbData.hbAmount}}</text>元红包,总共<text>{{hbData.totalHb}}</text>元</view>
+
       <view class="confirm-btn">
-        <button
-          class="admin-button-com big blue"
-          @click="wexinPayFn"
-          formType="submit"
-        >
-          充值
-        </button>
+        <button class="admin-button-com big blue" @click="wexinPayFn" formType="submit">充值</button>
       </view>
+
     </view>
-    <!-- <kd-entrance></kd-entrance> -->
+
   </view>
 </template>
 <script>
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { withdrawCashList } from "@/api/store";
 import list from "@/mixins/list";
 import wexinPay from "@/utils/pay/wxPay";
-import { rechargeBalance } from "@/api/recharge";
+import { rechargeBalance,getGhsHb } from "@/api/recharge";
 export default {
   name: "recharge",
   components: {
@@ -90,23 +34,52 @@ export default {
     return {
       amount: "",
       other_amount: "",
+      rechargeList:[],
+      showHint:false,
+      hbData:{}
     };
   },
   methods: {
-    async init() {},
-    // 微信支付
+    selectRecharge(item){
+        this.hbData = item
+        for(var i=0;i<this.rechargeList.length;i++){
+          this.rechargeList[i].forEach((value, key) => {
+            if(value.id == item.id){
+              this.rechargeList[i][key].select = 1
+            }else{
+              this.rechargeList[i][key].select = 0
+            }
+          })
+        }
+        this.$forceUpdate()
+    },
+    async init() {
+
+      let that = this
+      getGhsHb({ghsId:this.option.ghsId}).then(res=>{
+          if(!this.$util.isEmpty(res.data.list)){
+            that.rechargeList = []
+            res.data.list.map(e=>{
+              return e.amount = parseFloat(e.amount)
+            })
+            for(var i=0;i<res.data.list.length;i+=3){
+                that.rechargeList.push(res.data.list.slice(i,i+3));
+            }
+            that.rechargeList[0][0].select = 1
+            this.hbData = that.rechargeList[0][0]
+          }
+      })
+
+    },
     wexinPayFn() {
       this._pay();
     },
     _pay() {
-      if (this.other_amount > 0) {
-        this.amount = this.other_amount;
-      }
-      if (!this.amount) {
-        this.$msg("请选择充值金额");
+      if(this.$util.isEmpty(this.hbData)){
+        this.$msg("请选择金额");
         return false;
       }
-      let params = { amount: this.amount };
+      let params = { id:this.hbData.id,ghsId:this.option.ghsId };
       rechargeBalance(params).then((res) => {
         this.payCallData = res.data;
         if (res.code == 0) {
@@ -187,4 +160,12 @@ export default {
     width: 100%;
   }
 }
-</style>
+.hb-hint{
+  margin:40rpx 0 20rpx 40rpx;
+  font-size:35rpx;
+  text{
+    color:red;
+    font-weight:750;
+  }
+}
+</style>