ソースを参照

feat:qingqinka

xyh8905170 2 年 前
コミット
31d67b33bb

+ 42 - 2
common/js/api.js

@@ -170,10 +170,10 @@ export default {
         return request({
             url: '/member/wechat/submitOldData',
             method: 'POST',
-            header:{
+            header: {
                 'content-type': 'application/x-www-form-urlencoded'
             },
-            data:memberNo
+            data: memberNo
 
 
         })
@@ -790,5 +790,45 @@ export default {
             data: data
         })
     },
+    //赠送亲情卡
+    giveFamilyCard(data){
+        return request({
+            url: '/member/loveCard/createLoveCard',
+            method: 'GET',
+            data: data
+        })
+    },
+    //获取我赠送的亲情卡列表
+    getMyPresentList(data){
+        return request({
+            url: '/member/loveCard/myPresentList',
+            method: 'GET',
+            data: data
+        })
+    },
+    //查询我收到的情亲卡列表
+    getMyReceiveList(data){
+        return request({
+            url: '/member/loveCard/myReceiveList',
+            method: 'GET',
+            data: data
+        })
+    },
+    //.查询情亲卡的消费记录
+    getMycardRecordList(data){
+        return request({
+            url: '/member/loveCard/cardRecordList',
+            method: 'GET',
+            data: data
+        })
+    },
+    //.解绑亲情卡
+    getCreateLoveCard(data){
+        return request({
+            url: '/member/loveCard/createLoveCard',
+            method: 'GET',
+            data: data
+        })
+    },
 
 }

+ 2 - 1
common/js/env.js

@@ -5,7 +5,8 @@
 /** 测试环境 */
 // let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
 /** 开发环境*/
-let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
+// let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
+let baseUrl = `http://47.108.114.127:10888`
 
 
 

+ 80 - 0
myPages/familyCard/UnbindFamilyCard.vue

@@ -0,0 +1,80 @@
+<template>
+  <view class="page">
+    <!-- 钱包 -->
+    <view class="recharge-me ">
+      <view class="wallet-content">
+        <view class="h-balance-wrap">
+          <view class="h-balance">
+            <view class="recharge-balance">
+              <view class="name">已用额度</view>
+              <view class="Number" style="font-size: 48rpx">{{ data.amount || 0 }}</view>
+            </view>
+            <text style="position: absolute;top:32rpx;right: 32rpx;color:#FFAF36  ">解绑</text>
+          </view>
+          <view style="display: flex;justify-content: space-between;margin: 8rpx 0rpx">
+            <text>赠送会员编号:</text>
+            <text>{{ data.userNo }}</text>
+          </view>
+          <view style="display: flex;justify-content: space-between;margin: 8rpx 0rpx">
+            <text>收到时间::</text>
+            <text>{{ data.createTime }}</text>
+          </view>
+        </view>
+        <text style="margin:24rpx 0;overflow: hidden">使用记录</text>
+        <view class="useList" v-for=" item in recordList">
+          <view style="display: flex;align-items: center">
+            <view class="icon">{{ item.type == 0 ? "消费" : "增加" }}</view>
+            <text>{{ item.createTime }}</text>
+          </view>
+          <view>
+            <view>
+              <text>{{ item.type == 0 ? "-" : "+"  }}</text>
+              {{ item.amount || 0 }}
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      data: {},
+      page: {
+        pageSize: 1,
+        pageNum: 10
+      },
+      recordList: []
+    };
+  },
+  onLoad(option) {
+    this.data = JSON.parse(option.data)
+    console.log(this.data)
+    this.getMycardRecordList()
+  },
+  onShow() {
+  },
+  methods: {
+    getMycardRecordList() {
+      this.page.id = this.data.id
+      this.$api.getMycardRecordList(this.page).then((res) => {
+        console.log(res)
+        this.recordList.push(res.data.data)
+        console.log(this.recordList,'4444444444444')
+      })
+    },
+    //解除绑定
+    getCreateLoveCard() {
+
+    }
+  },
+};
+</script>
+
+<style scoped lang="scss">
+@import '/common/css/common.css';
+@import './familyCard';
+</style>

+ 75 - 0
myPages/familyCard/familyCard.scss

@@ -0,0 +1,75 @@
+.page {
+  min-height: 100vh;
+}
+.icon {
+  width: 84rpx;
+  height: 84rpx;
+  border-radius: 42rpx;
+  text-align: center;
+  line-height: 84rpx;
+  font-size: 24rpx;
+  margin: 0 10rpx;
+  background-color: #ED569F;
+  color: white;
+}
+
+.recharge-me {
+  .wallet-content {
+    background-image: linear-gradient(#FFE05C 0, #FFE05C 160px, #ffffff 0, #ffffff);
+    padding: 12px;
+
+    .h-balance-wrap {
+      background-image: url("../../static/familyCard/detailCard.png");
+      background-size: 100% 100%;
+      height: 304rpx;
+      border-radius: 6px;
+      text-align: center;
+      padding: 24rpx 34rpx;
+      margin: 24rpx 0;
+      overflow: hidden;
+
+      .h-balance {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        height: 118px;
+        position: relative;
+
+        .recharge-balance {
+          margin: 0 auto;
+          .h-nav-img {
+            image {
+              height: 18px;
+              width: 18px;
+            }
+          }
+          .name {
+            font-size: 14px;
+            font-weight: 400;
+            color: #666666;
+            line-height: 22px;
+          }
+
+          .balance-value {
+            font-size: 18px;
+            font-weight: bold;
+            color: #333333;
+            line-height: 26px;
+          }
+        }
+      }
+
+    }
+
+  }
+
+}
+
+.useList {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  border-bottom: 1px solid #afa6a6;
+  padding: 20rpx;
+  margin: 24rpx;
+}

+ 62 - 0
myPages/familyCard/giveFamilyCard.vue

@@ -0,0 +1,62 @@
+<template>
+  <view class="box">
+    <u--form labelPosition="top" :model="userInfo" ref="form1">
+      <u-form-item labelWidth="auto" labelAlign="right" label="被赠送会员编号" prop="phone">
+        <u--input v-model="userInfo.memberNo" placeholder="请输入被赠送会员编号" border="bottom"
+        ></u--input>
+      </u-form-item>
+      <u-form-item labelWidth="auto" labelAlign="right" label="被赠送会员手机号" prop="smsCode" width="120">
+        <u--input v-model="userInfo.memberPhone" placeholder="请输入被赠送会员手机号" border="bottom"
+        ></u--input>
+      </u-form-item>
+    </u--form>
+    <view class="op-btn-wrap">
+      <view class="h-btn" @click="handleGive">
+        <text>确定</text>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: "giveFamilyCard",
+  data() {
+    return {
+      userInfo: {},
+      giveUser: {}
+    }
+  },
+  methods: {
+    handleGive() {
+      this.giveUser.memberNo = "Vip." + this.userInfo.memberNo
+      this.giveUser.memberPhone = this.userInfo.memberPhone
+      this.$api.giveFamilyCard(this.giveUser).then((res) => {
+            console.log(res)
+              uni.showToast({
+                duration: 2000,
+                title: '赠送成功'
+              });
+              uni.navigateBack({delta : 1})
+          }
+      )
+    }
+  }
+}
+</script>
+
+<style scoped>
+.box {
+  padding: 24rpx 32rpx;
+}
+
+.h-btn {
+  margin: 48rpx auto;
+  text-align: center;
+  width: 80vw;
+  height: 42px;
+  background: #FFE05C;
+  border-radius: 27px;
+  line-height: 42px;
+}
+</style>

+ 28 - 0
myPages/familyCard/index.scss

@@ -0,0 +1,28 @@
+.box {
+  padding: 32rpx 24rpx;
+}
+
+.Card {
+  border-radius: 20px;
+  background-size: 100% 100%;
+  height: 268rpx;
+  padding: 24rpx;
+  display: flex;
+  flex-direction: column;
+  position: relative;
+  margin: 32rpx 24rpx;
+}
+
+.getCard {
+  background-image: url("/static/familyCard/getCard.png");
+}
+
+.postCard {
+  background-image: url("/static/familyCard/postCard.png");
+}
+
+.Lines {
+  position: absolute;
+  right: 40rpx;
+  bottom: 26rpx;
+}

+ 108 - 0
myPages/familyCard/index.vue

@@ -0,0 +1,108 @@
+<template>
+  <view class="box">
+    <text style="margin-bottom: 24rpx">我收到的亲情卡</text>
+
+    <view class="getCard Card" v-for="item in gotList" @click="jumpToDetail(item)">
+      <view style="display: flex;align-items: center">
+        <u-avatar :src="item.url || '/static/me/ud4.png'"></u-avatar>
+        <text style="margin:0 10rpx;color:#FFFFFF ">会员{{ item.userNo }}送的亲情卡</text>
+      </view>
+      <view class="Lines">
+        <text style="float: right;margin:0 10rpx;color:#FFFFFF ">已用额度</text>
+        <view style="font-size: 48rpx;font-weight: bold;color: #FFFFFF;text-align: center">{{ item.amount || 0 }}</view>
+      </view>
+    </view>
+
+    <view style="display: flex;justify-content:space-between;margin: 32rpx 0;">
+      <text>我赠送的亲情卡</text>
+      <view style="color: #FFAF36;transform: translateY(-10rpx)" @click="jumpToGive">
+        <image style="width: 40rpx;height: 40rpx;transform: translateY(10rpx)"
+               src="/static/familyCard/icon-give.png"></image>
+        <text>
+          赠送亲情卡
+        </text>
+      </view>
+    </view>
+
+    <view class="postCard Card" v-for="item in giveList" @click="jumpToDetail(item.id)">
+      <view style="display: flex;align-items: center">
+        <u-avatar :src="item.url || '/static/me/ud4.png'"></u-avatar>
+        <text style="margin:0 10rpx;">会员{{ item.userNo }}送的亲情卡</text>
+      </view>
+      <view class="Lines">
+        <text style="float: right;margin:0 10rpx;">已用额度</text>
+        <view style="font-size: 48rpx;font-weight: bold;text-align: center">{{ item.amount || 0 }}</view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: "index",
+  data() {
+    return {
+      giveList: [],
+      gotList: []
+    }
+  },
+  onLoad() {
+    this.getGiveList()
+    this.getGotList()
+  },
+  methods: {
+    jumpToGive() {
+      console.log('22222222222')
+      uni.navigateTo({
+        url: '/myPages/familyCard/giveFamilyCard'
+      })
+    },
+    jumpToDetail(item) {
+      uni.navigateTo({
+        url: '/myPages/familyCard/UnbindFamilyCard?data=' + JSON.stringify(item)
+      })
+    },
+    getImgUrlByOssId(list, number) {
+      if (list) {
+        list.forEach((e) => {
+          let data = null
+          if (number == 1) {
+            data = e.presentUserPhoto
+
+          } else {
+            data = e.userPhoto
+          }
+          if (data) {
+            this.$api.getImage(data).then(res => {
+              e.url = res.data.data[0].url.replace(/^http:/, "https:")
+              console.log(e.url,'33333333333333333333333333')
+            });
+          }
+        })
+        this.$forceUpdate()
+      }
+    },
+    getGiveList() {
+      this.$api.getMyPresentList().then((res) => {
+        console.log(res, '1111')
+        this.giveList = res.data.data
+        this.getImgUrlByOssId(this.giveList, 1)
+      })
+    },
+    getGotList() {
+      this.$api.getMyReceiveList().then((res) => {
+        console.log(res, '3333333')
+        this.gotList = res.data.data
+        this.getImgUrlByOssId(this.giveList, 2)
+      })
+    }
+  }
+}
+
+
+</script>
+
+<style scoped>
+@import "/myPages/familyCard/index.scss";
+
+</style>

+ 0 - 2
myPages/realNameAuth/index.vue

@@ -142,8 +142,6 @@ export default {
 
   },
   methods: {
-
-
     // 保存实名信息
     saveUserRealNameAuth(){
       let that = this;

+ 21 - 16
pages.json

@@ -52,8 +52,6 @@
 			"root": "loginPages",
 			"pages": [
 
-
-
 				{
 					"path": "login/bind-account",
 					"style": {
@@ -82,13 +80,6 @@
 						"enablePullDownRefresh": false
 					}
 				},
-//				{
-//					"path": "login/login-real-name-auth",
-//					"style": {
-//						"navigationBarTitleText": "实名认证",
-//						"enablePullDownRefresh": false
-//					}
-//				},
 				{
 					"path": "login/retrieve-account",
 					"style": {
@@ -314,6 +305,27 @@
 						"enablePullDownRefresh": false
 					}
 				},
+				{
+					"path": "familyCard/index",
+					"style": {
+						"navigationBarTitleText": "亲情卡",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "familyCard/giveFamilyCard",
+					"style": {
+						"navigationBarTitleText": "赠送亲情卡",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "familyCard/UnbindFamilyCard",
+					"style": {
+						"navigationBarTitleText": "亲情卡详情",
+						"enablePullDownRefresh": false
+					}
+				},
 				{
 					"path": "aboutOur/index",
 					"style": {
@@ -398,12 +410,6 @@
 				"iconPath": "/static/tabBar/index.png",
 				"text": "首页"
 			},
-//			{
-//				"pagePath": "pages/orderMeal/index"
-//			},
-//			{
-//				"pagePath": "pages/qrCode/index"
-//			},
 			{
 				"pagePath": "pages/order/index",
 				"selectedIconPath": "/static/tabBar/order_cur.png",
@@ -423,7 +429,6 @@
 		"navigationBarTitleText": "加载中",
 		"navigationBarBackgroundColor": "#FFE05C",
 		"backgroundColor": "#FFE05C"
-		// "titleNView": false
 	},
 	"uniIdRouter": {}
 }

+ 2 - 1
pages/my/index.vue

@@ -111,7 +111,8 @@ export default {
         {thumb: '/static/me/u1833.png', title: '资产找回', rightText: '', to: '/myPages/systemSwitch/index'},
         {thumb: '/static/me/u826.png', title: '储值服务', rightText: '', to: '/myPages/recharge/index'},
         {thumb: '/static/me/u701.png', title: '交易记录', rightText: '', to: '/myPages/transactionRecord/index'},
-        {thumb: '/static/me/u11.png', title: '会员须知', rightText: '', to: '/myPages/aboutOur/index'}
+        {thumb: '/static/me/u11.png', title: '会员须知', rightText: '', to: '/myPages/aboutOur/index'},
+        {thumb: '/static/me/u11.png', title: '亲情卡', rightText: '', to: '/myPages/familyCard/index'}
       ],
       group2: [
 

BIN
static/familyCard/detailCard.png


BIN
static/familyCard/getCard.png


BIN
static/familyCard/icon-give.png


BIN
static/familyCard/postCard.png


BIN
static/me/familyCard_icon.png