|
@@ -1,44 +1,37 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="page">
|
|
|
|
|
|
|
+ <view class="page" :style="{'height':windowHeight}">
|
|
|
|
|
|
|
|
- <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>
|
|
|
|
|
|
|
+ <scroll-view scroll-y :style="{'height':windowHeight}">
|
|
|
|
|
+ <view class="row-list flex-row justify-start" v-for="(item,index) in equityList" :key="index">
|
|
|
|
|
+ <view class="h-text flex-col justify-center ">
|
|
|
|
|
+ <view class="money">
|
|
|
|
|
+ <text>¥{{item.salePrice}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <!-- <view class="desc">-->
|
|
|
|
|
+ <!-- <text>{{item.title}}</text>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
</view>
|
|
</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 class="h-center-content flex-col justify-around">
|
|
|
|
|
+ <view class="h-value">
|
|
|
|
|
+ <text>{{item.title}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="title">
|
|
|
|
|
+ 使用项目:{{item.serviceProjectName || ''}}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="title">
|
|
|
|
|
+ 有效天数:{{item.effectiveDays}}
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</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="h-right-content flex-col justify-center ">
|
|
|
<view class="btn" @click="payRights(item)">
|
|
<view class="btn" @click="payRights(item)">
|
|
|
<text>购买</text>
|
|
<text>购买</text>
|
|
|
</view>
|
|
</view>
|
|
|
- </picker>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
|
|
|
<uni-popup ref="popup" :catchtouchmove="true" :animation="false" type="bottom">
|
|
<uni-popup ref="popup" :catchtouchmove="true" :animation="false" type="bottom">
|
|
|
|
|
|
|
@@ -96,36 +89,141 @@
|
|
|
|
|
|
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <u-picker :show="show" title="选择服务对象" :closeOnClickOverlay="true" @close="show = false" :columns="serviceObjectList" keyName="nickName" @cancel="show = false" @confirm="confirm"></u-picker>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ windowHeight:'',
|
|
|
|
|
+ show:false,
|
|
|
curServiceTab:1,
|
|
curServiceTab:1,
|
|
|
orderRights:{},
|
|
orderRights:{},
|
|
|
userInfo:{},
|
|
userInfo:{},
|
|
|
serviceObjectList:[],
|
|
serviceObjectList:[],
|
|
|
- serviceObjectIndex:0
|
|
|
|
|
-
|
|
|
|
|
|
|
+ serviceObjectIndex:0,
|
|
|
|
|
+ equityList:[],
|
|
|
|
|
+ serviceObject:{},
|
|
|
|
|
+ orderNo:''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
|
|
+ let sysInfo = uni.getSystemInfoSync()
|
|
|
|
|
+ this.windowHeight =sysInfo.windowHeight - 44 +'px'//除标题栏栏外的屏幕可用高度
|
|
|
this.userInfo = uni.getStorageSync('userInfo')
|
|
this.userInfo = uni.getStorageSync('userInfo')
|
|
|
this.listServiceObject()
|
|
this.listServiceObject()
|
|
|
|
|
+ this.equityCardList()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
|
|
- bindPickerChange(e){
|
|
|
|
|
|
|
+ commonGeneralOrder(){
|
|
|
|
|
+ this.$refs.popup.close()
|
|
|
|
|
+ this.$api.commonGeneralOrder({
|
|
|
|
|
+ orderType: 5,
|
|
|
|
|
+ serviceObjectId: this.serviceObject.id,
|
|
|
|
|
+ equityCardId:this.orderRights.id
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ this.orderNo=res.data.data.orderNo
|
|
|
|
|
+
|
|
|
|
|
+ if (this.curServiceTab === 1){
|
|
|
|
|
+ //开启余额支付
|
|
|
|
|
+ this.balancePay()
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.curServiceTab === 2){
|
|
|
|
|
+ //调微信支付
|
|
|
|
|
+ this.wechatPay()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ //余额支付
|
|
|
|
|
+ balancePay(){
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ this.$api.balancePay({
|
|
|
|
|
+ orderNo: this.orderNo,
|
|
|
|
|
+ password: ''
|
|
|
|
|
+ }).then((res)=>{
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '支付成功!'
|
|
|
|
|
+ });
|
|
|
|
|
+ this.getUserInfo()
|
|
|
|
|
+ }).catch((res) =>{
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ that.$refs.popup.close()
|
|
|
|
|
+ let msg = res.data.msg || '操作失败';
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: msg,
|
|
|
|
|
+ icon:'error'
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ wechatPay(){
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ // 发起微信支付
|
|
|
|
|
+ this.$api.wechatPay({
|
|
|
|
|
+ orderNo:this.orderNo
|
|
|
|
|
+ }).then((res)=>{
|
|
|
|
|
+ var param = res.data.data;
|
|
|
|
|
+ uni.requestPayment({
|
|
|
|
|
+ appId: param.appid,
|
|
|
|
|
+ timeStamp: param.timestamp+"",
|
|
|
|
|
+ nonceStr: param.noncestr,
|
|
|
|
|
+ package: "prepay_id="+param.prepayid,
|
|
|
|
|
+ signType: "RSA",
|
|
|
|
|
+ paySign: param.sign,
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '支付成功!'
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: res => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ content: '支付失败',
|
|
|
|
|
+ showCancel: false
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }).catch(() =>{
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "操作失败"
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getUserInfo(){
|
|
|
|
|
+ this.$api.getUserInfo().then(res=>{
|
|
|
|
|
+ console.log('++++++++++++获取用户信息++++++++++++++++++',res)
|
|
|
|
|
+ uni.setStorageSync('userInfo',res.data.data)
|
|
|
|
|
+ this.userInfo = res.data.data
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ confirm(e){
|
|
|
console.log(e)
|
|
console.log(e)
|
|
|
|
|
+ this.serviceObject = e.value[0]
|
|
|
|
|
+ this.show = false
|
|
|
|
|
+ this.$refs.popup.open()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ equityCardList(){
|
|
|
|
|
+ this.$api.equityCardList().then(res=>{
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ this.equityList = res.data.data
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 查询服务对像信息列表
|
|
// 查询服务对像信息列表
|
|
|
listServiceObject(){
|
|
listServiceObject(){
|
|
|
this.$api.listServiceObject(this.reqParm).then((res)=>{
|
|
this.$api.listServiceObject(this.reqParm).then((res)=>{
|
|
|
- this.serviceObjectList = res.data.data
|
|
|
|
|
|
|
+ this.serviceObjectList[0] =res.data.data
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -141,6 +239,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
payRights(item){
|
|
payRights(item){
|
|
|
|
|
+ this.show =true
|
|
|
this.orderRights = item
|
|
this.orderRights = item
|
|
|
}
|
|
}
|
|
|
|
|
|