|
@@ -9,25 +9,32 @@
|
|
<block v-for="(item,key) in list" :key="key">
|
|
<block v-for="(item,key) in list" :key="key">
|
|
<view @click="selectItem(item)" class="box mt16 options-item"
|
|
<view @click="selectItem(item)" class="box mt16 options-item"
|
|
:class="item.id == select.id ?'select' :'' " v-if="item.type =='COIN'">
|
|
:class="item.id == select.id ?'select' :'' " v-if="item.type =='COIN'">
|
|
- <p><text v-if="item.is_first_pay" class="ft14 top-lab">首充</text></p>
|
|
|
|
- <text class="ft18 pirice-txt txt-other" :style="item.is_first_pay ==1 ? '': 'padding-top: 25px;'">
|
|
|
|
|
|
+ <p style="height: 25px;"><text v-show="item.tip_text" class="ft14 top-lab">{{item.tip_text}}</text></p>
|
|
|
|
+ <text class="ft18 pirice-txt txt-other">
|
|
{{item.price}}元</text>
|
|
{{item.price}}元</text>
|
|
<p class="ft14 cz-desc-txt txt-other">{{item.price_text}} <text
|
|
<p class="ft14 cz-desc-txt txt-other">{{item.price_text}} <text
|
|
class="ft14 pirice-txt">+{{item.given}}K币</text></p>
|
|
class="ft14 pirice-txt">+{{item.given}}K币</text></p>
|
|
<p class="ft14 cz-desc-txt txt-other" :class="item.id == select.id ?'select_text' :'given-txt' ">
|
|
<p class="ft14 cz-desc-txt txt-other" :class="item.id == select.id ?'select_text' :'given-txt' ">
|
|
{{item.given_amount}} <text v-if="item.id == select.id" class="ft14 xz-hh">✓️</text> </p>
|
|
{{item.given_amount}} <text v-if="item.id == select.id" class="ft14 xz-hh">✓️</text> </p>
|
|
</view>
|
|
</view>
|
|
- <view @click="selectItem(item)" class="box mt16 options-item vip"
|
|
|
|
- :class="item.id == select.id ?'select' :'' " v-else>
|
|
|
|
- <text class="ft18 pirice-txt txt-other"> {{item.price}}元</text>
|
|
|
|
- <p class="ft14 cz-desc-txt txt-other">{{item.price_text}}</text></p>
|
|
|
|
- <p class="ft14 cz-desc-txt txt-other " :class="item.id == select.id ?'select_text' :'' ">
|
|
|
|
|
|
+ <view @click="selectItem(item)" class="box mt16 options-item "
|
|
|
|
+ :class="item.id == select.id ?'select' :'' " v-else>
|
|
|
|
+ <p style="height: 25px;"><text v-show="item.tip_text" class="ft14 top-lab">{{item.tip_text}}</text></p>
|
|
|
|
+ <view class="vip-center">
|
|
|
|
+ <view class="">
|
|
|
|
+ <p class="ft18 pirice-txt txt-other"> {{item.price}}元 </p>
|
|
|
|
+ <p class="ft14 cz-desc-txt txt-other">{{item.price_text}}</text></p>
|
|
|
|
+ </view>
|
|
|
|
+ <image class="vip-level-icon" src="/static/icon/vip.png"></image>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <p class="ft14 cz-desc-txt txt-other " :class="item.id == select.id ?'select_text' :'given-txt' ">
|
|
{{item.given_amount}} <text v-if="item.id == select.id" class="ft14 xz-hh">✓️</text> </p>
|
|
{{item.given_amount}} <text v-if="item.id == select.id" class="ft14 xz-hh">✓️</text> </p>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
<view v-if="is_player == false" @click="toPay" class="ft16 btn-cz box mt16 " >
|
|
<view v-if="is_player == false" @click="toPay" class="ft16 btn-cz box mt16 " >
|
|
- 确认充值{{select.price}}
|
|
|
|
|
|
+ 确认充值{{select.price||0}}
|
|
</view>
|
|
</view>
|
|
<p class="ft14" style="margin: 10px 0;">付费须知</p>
|
|
<p class="ft14" style="margin: 10px 0;">付费须知</p>
|
|
<view class="ft14 textdesc">
|
|
<view class="ft14 textdesc">
|
|
@@ -37,7 +44,6 @@
|
|
<text class="ft12">4、购买成功后,“K币”仅在本小程序中使用</text>
|
|
<text class="ft12">4、购买成功后,“K币”仅在本小程序中使用</text>
|
|
<text class="ft12">5、购买成功后可在”我的”页面订单中心进行查看</text>
|
|
<text class="ft12">5、购买成功后可在”我的”页面订单中心进行查看</text>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -92,7 +98,10 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
selectItem(item) {
|
|
selectItem(item) {
|
|
- this.select = item;
|
|
|
|
|
|
+ this.select = item;
|
|
|
|
+ if(this.is_player){
|
|
|
|
+ this.toPay();
|
|
|
|
+ }
|
|
},async toPay(){
|
|
},async toPay(){
|
|
if(this.select.lenght < 1){
|
|
if(this.select.lenght < 1){
|
|
uni.showToast({ title: '请选择要充值的项',icon:"none" });
|
|
uni.showToast({ title: '请选择要充值的项',icon:"none" });
|
|
@@ -100,17 +109,30 @@
|
|
}
|
|
}
|
|
let params = {
|
|
let params = {
|
|
pay_proudct_id:this.select.id,
|
|
pay_proudct_id:this.select.id,
|
|
- video_id:this.video_info && this.video_info.video_id ? this.video_info.video_id :1,
|
|
|
|
- video_series_sequence:this.video_info && this.video_info.video_series_sequence ? this.video_info.video_series_sequence :1,
|
|
|
|
|
|
+ video_id:this.video_info && this.video_info.video_id ? this.video_info.video_id :0,
|
|
|
|
+ video_series_sequence:this.video_info && this.video_info.video_series_sequence ? this.video_info.video_series_sequence :0,
|
|
};
|
|
};
|
|
|
|
+ let result = false;
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
-
|
|
|
|
let res = await getPayInfo(params);
|
|
let res = await getPayInfo(params);
|
|
- return this.$emit();
|
|
|
|
|
|
+ if(res){
|
|
|
|
+ uni.requestPayment({
|
|
|
|
+ "provider": "wxpay",
|
|
|
|
+ "orderInfo":res,
|
|
|
|
+ success(res) {
|
|
|
|
+ result = true;
|
|
|
|
+ console.log('success:' + JSON.stringify(res));
|
|
|
|
+ },
|
|
|
|
+ fail(e) {
|
|
|
|
+ return false;
|
|
|
|
+ console.log('success:' + JSON.stringify(e));
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return this.$emit('is_pay',result);
|
|
// #endif
|
|
// #endif
|
|
-
|
|
|
|
- return this.$emit();
|
|
|
|
- // console.log('getPayInfo',res);
|
|
|
|
|
|
+ return this.$emit('is_pay',result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|