Browse Source

客户等级

shish 4 years ago
parent
commit
c8c05b2b27

+ 148 - 0
ghsApp/src/admin/custom/levelSet.vue

@@ -0,0 +1,148 @@
+<template>
+	<view class="ex-page">
+        <view class="title">
+            请设置每个等级客户需要消费的最低数量和金额:
+        </view>
+        <view class="recharge-list">
+
+            <view>
+                <view class="item">
+                    <view>青铜:
+<input v-model="levelInfo.qtNum" @click="levelInfo.qtNum=''" placeholder-class="phcolor" class="tui-input" type="number"  /> 扎
+<input v-model="levelInfo.qtAmount" @click="levelInfo.qtAmount=''" placeholder-class="phcolor" class="tui-input" type="digit"  /> 元
+                    </view>
+                </view>
+            </view>
+
+            <view>
+                <view class="item">
+                    <view>白银:
+<input v-model="levelInfo.byNum" @click="levelInfo.byNum=''" placeholder-class="phcolor" class="tui-input" type="number"  /> 扎
+<input v-model="levelInfo.byAmount" @click="levelInfo.byAmount=''" placeholder-class="phcolor" class="tui-input" type="digit"  /> 元
+                    </view>
+                </view>
+            </view>
+
+            <view>
+                <view class="item">
+                    <view>黄金:
+<input v-model="levelInfo.hjNum" @click="levelInfo.hjNum=''" placeholder-class="phcolor" class="tui-input" type="number"  /> 扎
+<input v-model="levelInfo.hjAmount" @click="levelInfo.hjAmount=''" placeholder-class="phcolor" class="tui-input" type="digit"  /> 元
+                    </view>
+                </view>
+            </view>
+
+            <view>
+                <view class="item">
+                    <view>钻石:
+<input v-model="levelInfo.zsNum" @click="levelInfo.zsNum=''" placeholder-class="phcolor" class="tui-input" type="number"  /> 扎
+<input v-model="levelInfo.zsAmount" @click="levelInfo.zsAmount=''" placeholder-class="phcolor" class="tui-input" type="digit"  /> 元
+                    </view>
+                </view>
+            </view>
+        </view>
+
+        <view class="footer">
+            <button class="admin-button-com big blue" @click="saveData()">保存</button>
+        </view>
+	</view>
+</template>
+<script>
+import { mapGetters } from "vuex";
+import { getInfo,replaceLevel } from "@/api/custom-level";
+export default {
+	components: {},
+	mixins: [],
+	computed: {
+		...mapGetters({ myShopInfo: "getMyShopInfo" }),
+	},
+	data() {
+		return {
+            levelInfo:{
+                qtNum:'',
+                qtAmount:'',
+                byNum:'',
+                byAmount:'',
+                hjNum:'',
+                hjAmount:'',
+                zsNum:'',
+                zsAmount:''
+            },
+		};
+	},
+	onPullDownRefresh() {
+
+	},
+	onLoad() {
+
+	},
+	methods: {
+		init(){
+            this.getDetail()
+        },
+        getDetail(){
+            let that = this
+            getInfo().then(res => {
+                if(res.code == 1){
+                    if (res.data.info && !this.$util.isEmpty(res.data.info)){
+                        that.levelInfo = res.data.info
+                    }
+                }
+            });
+        },
+        saveData(){
+            let that = this
+            const {qtNum,qtAmount,byNum,byAmount,hjNum,hjAmount,zsNum,zsAmount} = this.levelInfo
+            replaceLevel({qtNum,qtAmount,byNum,byAmount,hjNum,hjAmount,zsNum,zsAmount}).then(res=>{
+                if(res.code == 1){
+                    that.$msg(res.msg)
+                    setTimeout(function(){
+                        uni.navigateBack({})
+                    },1000)
+                }
+            })
+        }
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page{
+    .title{
+        margin-top:20rpx;
+        padding-left:20rpx;
+        font-size:30rpx;
+        background:white;
+        width:100%;
+    }
+    .recharge-list{
+        line-height:80px;
+        padding-left:20rpx;
+        font-size:30rpx;
+        padding-top:80rpx;
+        .item{
+            margin-bottom:60rpx;
+            input{
+                height:18rpx;
+                width:150rpx;
+                border:1px solid #ddd;
+                display:inline-block;
+                margin-right:10rpx;
+            }
+            input:nth-child(2){
+                margin-left:50rpx;
+            }
+        }
+    }
+    .footer{
+        margin-top:50rpx;
+        text-align: center;
+        bottom:0;
+        width:100%;
+        background:#FFFFFF;
+        button{
+            width:90%;
+            margin:0 auto;
+        }
+    }
+}
+</style>

+ 2 - 0
ghsApp/src/admin/home/apply.vue

@@ -62,6 +62,7 @@ export default {
                 {
                     title:'门店',
                     list:[
+                        {name: "客户等级",img: `${this.$constant.imgUrl}/ghs/home/yggl.png`,url: "/admin/custom/levelSet"},
                         {name: "门店",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/shop/list"},
                         {name: "调拨出库",img: `${this.$constant.imgUrl}/ghs/home/dbck.png`,url: "/pagesStorehouse/allot/allotEx"},
                         {name: "调拨入库",img: `${this.$constant.imgUrl}/ghs/home/dbrk.png`,url: "/pagesStorehouse/allot/allotPut"},
@@ -71,6 +72,7 @@ export default {
                         {name: "业绩",img: `${this.$constant.imgUrl}/ghs/home/icon_ygyj.png`,url: "/admin/staff/achieve"},
                         {name: "供应商",img: `${this.$constant.imgUrl}/ghs/home/icon_ghs.png`,url: "/admin/ghs/shop"},
                         {name: "报损单",img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,url: "/admin/breakage/list"},
+                        {name: "采购设置",img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,url: "/admin/cg/set"},
                     ]
                 }
             ]

+ 10 - 0
ghsApp/src/api/custom-level/index.js

@@ -0,0 +1,10 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const getInfo = data => {
+	return https.get('/custom-level/get-info', data)
+}
+
+//修改
+export const replaceLevel = data => {
+	return https.post('/custom-level/replace', data)
+}

+ 2 - 1
ghsApp/src/pages.json

@@ -29,7 +29,8 @@
 		{
 			"root": "admin/custom",
 			"pages": [
-				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}}
+				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}},
+				{"path": "levelSet","style": {"navigationBarTitleText": "客户等级"}}
 			]
 		},
 		{

+ 4 - 0
hdApp/src/api/ghs/index.js

@@ -14,3 +14,7 @@ export const ghsInfo = data => {
 	return https.get('/ghs/info', data)
 }
 
+//获取客户等级
+export const getCustomLevel = data => {
+	return https.get('/ghs/get-custom-level', data)
+}

+ 8 - 1
hdApp/src/pages.json

@@ -826,7 +826,7 @@
 					"path": "ghsProduct",
 					"style": {
 						"navigationBarTitleText": "",
-						"enablePullDownRefresh": true
+						"enablePullDownRefresh": false
 					}
 				},
 				{
@@ -891,6 +891,13 @@
 						"navigationBarTitleText": "退款详情",
 						"enablePullDownRefresh": true
 					}
+				},
+				{
+					"path": "level",
+					"style": {
+						"navigationBarTitleText": "会员等级",
+						"enablePullDownRefresh": true
+					}
 				}
 			]
 		},

+ 1 - 1
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -5,7 +5,7 @@
       <view class="header_inside">
         <image :src="ghsInfo.avatar"></image>
         <view class="shop_info">
-          <view class="shop_title">{{ghsInfo.name||''}}<text :class="[ghsInfo.giveLevel==0?'level-common':'level']" >{{ghsInfo.giveLevelName||'普通'}}会员</text></view>
+          <view class="shop_title" @click="pageTo({url:'/pagesPurchase/level?id='+ghsInfo.id})">{{ghsInfo.name||''}}<text :class="[ghsInfo.giveLevel==0?'level-common':'level']" >{{ghsInfo.giveLevelName||'普通'}}会员</text></view>
 
 			<view v-if="ghsInfo.hasRechargeHb && ghsInfo.hasRechargeHb ==1" class="shop_intro" @tap="recharge(ghsInfo)">
 				<text>充值送红包<text style="color:red;font-weight:700;">{{parseFloat(ghsInfo.hasRechargeHbAmount)}}</text>元

+ 141 - 0
hdApp/src/pagesPurchase/level.vue

@@ -0,0 +1,141 @@
+<template>
+  <div class="app-content">
+    <div class="rank-top-wrap">
+      <div class="rank-top-text">
+        <div class="rank-top-tit">VIP会员权益</div>
+        <div>升级会员享受更多权益~</div>
+      </div>
+      <div class="rank-top-img">
+        <img :src="`${constant.imgUrl}/retail/interest/VIP-interest.png`" alt mode="widthFix" />
+      </div>
+    </div>
+    <div class="rank-bottom-wrap">
+      <div class="rank-text">
+        <div>1、以下达到每个等级的要求</div>
+        <div>2、等级越高享有越低的价格,具体价格查看商品详情页</div>
+      </div>
+      <div class="level-list-wrap">
+        <div class="level-list-tit">
+          <div>等级</div>
+          <div>最低消费数</div>
+          <div>最低消费额</div>
+        </div>
+        <div class="level-list-blo">
+          <div class="level-list" v-for="(item, index) in list" :key="index">
+            <div>{{item.name}}</div>
+            <div>{{parseFloat(item.num)}}扎</div>
+            <div v-if="Number(item.amount) > 0">¥{{parseFloat(item.amount)}}</div>
+            <div v-else>无</div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { getCustomLevel } from "@/api/ghs";
+export default {
+  name: "customLevel",
+  components: {
+  },
+  data() {
+    return {
+      constant: this.$constant,
+      list: []
+    };
+  },
+  onLoad() {
+  },
+  methods: {
+    init() {
+        getCustomLevel({id:this.option.id}).then(res => {
+            this.list = res.data.list;
+        })
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.rank-top-wrap {
+  width: 100%;
+  height: 230px;
+  position: relative;
+  background-color: #191919;
+  .rank-top-text {
+    color: #d2d2d2;
+    padding-top: 60px;
+    padding-left: 70px;
+    .rank-top-tit {
+      color: #ffd515;
+      font-size: 44px;
+      margin-bottom: 10px;
+    }
+  }
+  .rank-top-img {
+    position: absolute;
+    top: 20px;
+    right: 44px;
+    width: 232px;
+  }
+}
+.rank-bottom-wrap {
+  padding: 30px;
+  background-color: #fff;
+  .rank-text {
+    font-size:26rpx;
+    margin-bottom: 26px;
+    & > div {
+      margin-bottom: 16px;
+    }
+  }
+  .btn-wrap {
+    width: calc(100% - 60px);
+    margin-top: 50px;
+    .button-com {
+      width: 100%;
+    }
+  }
+  .level-list-wrap {
+    border: 1px solid #eeeeee;
+    font-size: 26px;
+    .level-list-tit,
+    .level-list {
+      @include disFlex(center, space-between);
+      & > div {
+        margin: 0 auto;
+        flex: 1;
+        @include disFlex(center, center);
+        height: 70px;
+      }
+      .level-img {
+        /deep/.vip-text {
+          left: 42px;
+          transform: scale(0.8);
+        }
+      }
+    }
+    .level-list-tit {
+      color: #fff;
+      background-color: #d9c096;
+      & > div {
+        border-left: 1px solid #fff;
+      }
+      & > div:first-child {
+        border-left: none;
+      }
+    }
+    .level-list {
+      &:nth-child(2n) {
+        background-color: #f7f7ed;
+      }
+      & > div {
+        border-left: 1px solid #eeeeee;
+      }
+      & > div:first-child {
+        border-left: none;
+      }
+    }
+  }
+}
+</style>