Просмотр исходного кода

refactor:权益券购买页面

zhanghui 2 лет назад
Родитель
Сommit
d0908cd571
3 измененных файлов с 302 добавлено и 1 удалено
  1. 1 1
      orderPages/bookService/index.vue
  2. 175 0
      storePages/rights/index.rpx.scss
  3. 126 0
      storePages/rights/index.vue

+ 1 - 1
orderPages/bookService/index.vue

@@ -457,7 +457,7 @@ export default {
 
         // 查询服务对像信息列表
         listServiceObject(){
-            this.$api.listServiceObject(this.reqParm).then((res)=>{
+            this.$api.listServiceObject({}).then((res)=>{
                 this.serviceObject = res.data.data[0]
             }).catch((err) =>{
                 uni.showToast({

+ 175 - 0
storePages/rights/index.rpx.scss

@@ -1,5 +1,180 @@
+
 .page{
   background: #F7F7F7;
   padding: 0 32rpx;
   border-top: 1px solid #F7F7F7 ;
 }
+.btn{
+  height: 84rpx;
+  background: #FFE05C;
+  border-radius: 54rpx;
+  margin: 32rpx 0;
+
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+  line-height: 84rpx;
+  text-align: center;
+}
+.noUse{
+  margin: 32rpx 0;
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+  line-height: 40rpx;
+}
+
+
+.row-list{
+  width: 686rpx;
+  height: 188rpx;
+  margin-top: 24rpx;
+  background-image: url('/static/coupon/u210.png');
+  background-repeat: no-repeat;
+  background-size: cover;
+}
+
+
+.h-text{
+  width: 200rpx;
+  height: 188rpx;
+}
+.h-center-content{
+  width: 298rpx;
+  height: 188rpx;
+}
+.h-right-content{
+  width: 188rpx;
+  height: 188rpx;
+}
+.money{
+  height: 52rpx;
+  font-size: 36rpx;
+  font-family: DINAlternate-Bold, DINAlternate;
+  font-weight: bold;
+  color: #333333;
+  line-height: 52rpx;
+  text-align: center;
+}
+.desc{
+  height: 36rpx;
+  font-size: 20rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+  line-height: 36rpx;
+  text-align: center;
+}
+.h-value{
+  font-size: 28rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bold;
+  color: #333333;
+  line-height: 44rpx;
+  margin-top: 24rpx;
+  margin-left: 24rpx;
+}
+.title{
+  font-size: 20rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  line-height: 36rpx;
+  margin-left: 24rpx;
+}
+.h-btn-value-use{
+  width: 156rpx;
+  height: 64rpx;
+  background: #93D21A;
+  border-radius: 32rpx;
+
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #FFFFFF;
+  line-height: 64rpx;
+  text-align: center;
+}
+.h-btn-img{
+  width: 136rpx;
+  height: 136rpx;
+}
+.row-list:first-child{
+  margin-top: 0;
+}
+.btn{
+  width: 156rpx;
+  height: 64rpx;
+  background: #93D21A;
+  border-radius: 32rpx;
+
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #FFFFFF;
+  line-height: 64rpx;
+  text-align: center;
+}
+
+
+
+.payView{
+  height: 638rpx;
+  background: #FFFFFF;
+  box-shadow: 0rpx -4rpx 8rpx 0rpx rgba(0,0,0,0.03);
+  border-radius: 24rpx 24rpx 0rpx 0rpx;
+  padding: 24rpx 32rpx;
+  z-index: 100;
+}
+.payType{
+  font-size: 32rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bord;
+  color: #111111;
+  line-height: 48rpx;
+}
+.x{
+  width: 35rpx;
+  height: 35rpx;
+  border-radius: 18rpx;
+}
+.payTitle{
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  line-height: 40rpx;
+  margin-top: 8rpx;
+}
+.payItem{
+  background: #FAFAFA;
+  border-radius: 20rpx;
+  padding: 34rpx 32rpx;
+  margin-top: 32rpx;
+}
+.payName{
+  margin-left: 24rpx;
+}
+.balance{
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #999999;
+  line-height: 40rpx;
+}
+.commitBtn{
+  width: 686rpx;
+  height: 108rpx;
+  background: #FFE05C;
+  border-radius: 60rpx;
+  margin-top: 32rpx;
+
+  font-size: 32rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: bold;
+  color: #111111;
+  line-height: 108rpx;
+  text-align: center;
+}

+ 126 - 0
storePages/rights/index.vue

@@ -1,7 +1,100 @@
 <template>
 	<view class="page">
 
+		<view  class="row-list flex-row justify-start" v-for="(item,index) in 10" :key="index">
+			<view class="h-text flex-col justify-center ">
+				<view class="money">
+					<text>¥100</text>
+				</view>
+				<view class="desc">
+					<text>权益券</text>
+				</view>
+			</view>
 
+			<view class="h-center-content flex-col ">
+				<view class="h-value">
+					<text>门店通用</text>
+				</view>
+				<view class="title">
+					使用平台:<text>全平台</text>
+				</view>
+				<view class="title">
+					使用次数:3
+				</view>
+				<view class="title">
+					到期时间:2023-12-12
+				</view>
+			</view>
+
+			<view class="h-right-content flex-col justify-center ">
+				<picker  @change="bindPickerChange" mode='selector'  range-key="nickName" :value="serviceObjectIndex" :range="serviceObjectList">
+					<view class="btn" @click="payRights(item)">
+						<text>购买</text>
+					</view>
+				</picker>
+
+			</view>
+
+		</view>
+
+
+
+
+		<uni-popup ref="popup" :catchtouchmove="true" :animation="false" type="bottom">
+
+			<view class=" payView">
+				<view class="flex-row justify-between">
+					<text class="payType">请选择支付方式</text>
+					<image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
+				</view>
+				<view class="payTitle">
+					<text>选择微信支付或余额支付</text>
+				</view>
+
+
+				<view class="payItem flex-row justify-between" @click="payItem(1)">
+					<view class="flex-row">
+						<u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
+						<view class="payName flex-col justify-center">
+							<text>余额支付</text>
+							<text class="balance">可以余额¥{{userInfo.balance || 0}}</text>
+						</view>
+					</view>
+
+					<view class="flex-col justify-center">
+						<view v-if="curServiceTab === 1" >
+							<u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+						</view>
+						<view v-else>
+							<u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
+						</view>
+					</view>
+
+				</view>
+
+				<view class="payItem flex-row justify-between" @click="payItem(2)">
+					<view class="flex-row">
+						<u-icon name="weixin-circle-fill" color="#38db38" size="36"></u-icon>
+						<view class="payName flex-col justify-center">
+							<text>微信支付</text>
+						</view>
+					</view>
+					<view class="flex-col justify-center">
+						<view v-if="curServiceTab === 2" >
+							<u-icon name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+						</view>
+						<view v-else>
+							<u-icon name="/static/order/ud9.png" color="green" size="25"></u-icon>
+						</view>
+					</view>
+				</view>
+
+				<view class="commitBtn" @click="commonGeneralOrder">
+					<text>确定</text>
+				</view>
+			</view>
+
+		</uni-popup>
 
 
 	</view>
@@ -10,13 +103,46 @@
 	export default {
 		data() {
 			return {
+				curServiceTab:1,
+				orderRights:{},
+				userInfo:{},
+				serviceObjectList:[],
+				serviceObjectIndex:0
+
 			};
 		},
 		onLoad(option) {
+			this.userInfo = uni.getStorageSync('userInfo')
+			this.listServiceObject()
 		},
 
 		methods: {
 
+			bindPickerChange(e){
+				console.log(e)
+			},
+
+			// 查询服务对像信息列表
+			listServiceObject(){
+				this.$api.listServiceObject(this.reqParm).then((res)=>{
+					this.serviceObjectList = res.data.data
+				})
+			},
+
+			closePayPopup(){
+				this.$refs.popup.close()
+			},
+
+			payItem(num){
+				if (this.userInfo.balance < this.price){
+					return
+				}
+				this.curServiceTab = num
+			},
+
+			payRights(item){
+				this.orderRights = item
+			}
 
 		},
 	};