123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382 |
- <template>
- <view>
- <view style="padding: 30rpx;padding-bottom: 98rpx;">
- <view >
- <view class="item">
- <view style="display: flex;justify-content: space-between;padding-bottom: 15rpx;">
- <image :src="$method.splitImgHost(detail.coverUrl)" style="height: 134rpx;width: 278rpx;border-radius: 16rpx;"></image>
- <view style="margin-left: 20rpx;">
- <view style="color: #333333;font-size: 30rpx;font-weight: bold;">
- {{detail.goodsName}}
- </view>
- <view class="priceTag">
- ¥ {{detail.standPrice}}
- </view>
- </view>
- </view>
- <view v-if="detail.templateType!=null">
- <u-line color="#D6D6DB" />
- <view v-if="detail.templateType=='class'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(0)">
- <view style="color: #666666;font-size: 24rpx;">选择班级</view>
- <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
- </view>
- <view v-if="detail.templateType=='apply'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(1)">
- <view style="color: #666666;font-size: 24rpx;">报考地区</view>
- <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="bottomBox safeArea">
- <view class="priceTag">¥ {{detail.standPrice}}</view>
- <view style="display: flex;color: #FFFFFF;align-items: center;">
- <view class="btn2" @click="goBuy()">确认购买</view>
- </view>
- </view>
-
- <u-popup v-model="show" mode="bottom"border-radius="40">
- <view class="popup_box">
- <view style="margin-bottom: 20rpx;">
- <view class="line1"></view>
- <view class="grade">选择班级</view>
- </view>
- <u-line color="#D6D6DB" />
- <view>
- <scroll-view scroll-y="true" style="height: 500rpx;">
- <view>
- <u-checkbox-group @change="checkboxGroupChange">
- <view v-for="(item, index) in gradeList" :key="index" >
- <view style="display: flex;align-items: center;padding: 20rpx;">
- <view>
- <u-checkbox
- shape="circle"
- @change="checkboxChange"
- v-model="gradeList[index].checked"
- :name="gradeList[index].name"
- ></u-checkbox>
- </view>
- <view :class="item.checked?'white-box blue-box':'white-box'" >
- <view>
- <view class="blackTxt">{{item.className}}</view>
- <view class="redTxt">有效期至:{{$method.timestampToTime(item.classEndTime)}}</view>
- <view class="redTxt">本班还剩{{$method.GetRTime(item.classEndTime)}}天将结束学习</view>
- </view>
- </view>
- </view>
- </view>
- </u-checkbox-group>
- </view>
- </scroll-view>
- </view>
- <view class="confrim-btn">
- <view class="okBtn">确定</view>
- </view>
- </view>
- </u-popup>
- <u-popup v-model="show1" mode="bottom"border-radius="40">
- <view class="popup_box">
- <view style="margin-bottom: 20rpx;">
- <view class="line1"></view>
- <view class="grade">选择考期/地区</view>
- </view>
- <u-line color="#D6D6DB" />
- <view style="display: flex;height: 500rpx;">
- <view style="width: 50%;">
- <view class="topTxt">考期</view>
- <view>
- <picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
- <picker-view-column>
- <view class="picker-item" v-for="(item,index) in list1" :key="index">{{item.label}}</view>
- </picker-view-column>
- </picker-view>
- </view>
- </view>
- <view style="width: 50%;">
- <view class="topTxt">地区</view>
- <view>
- <picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
- <picker-view-column>
- <view class="picker-item" v-for="(item,index) in list2" :key="index">{{item.label}}</view>
- </picker-view-column>
- <picker-view-column>
- <view class="picker-item" v-for="(item,index) in list3" :key="index">{{item.label}}</view>
- </picker-view-column>
- </picker-view>
- </view>
- </view>
- </view>
- <view class="confrim-btn">
- <view class="okBtn">确定</view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import { mapGetters } from 'vuex';
- export default {
- components: {
-
- },
- data() {
- return {
- id:0,
- indicatorStyle: `height: 50px;`,
- showArea:true,
- show1:false,
- list:[{
- name: 'apple',
- checked: false,
- disabled: false
- },
- {
- name: 'banner',
- checked: false,
- disabled: false
- },
- {
- name: 'orange',
- checked: false,
- disabled: false
- }],
- list1:[
- {
- value: '1',
- label: '2021年6月'
- },
- {
- value: '2',
- label: '2021年7月'
- }
- ],
- list1:[
- {
- value: '1',
- label: '2021年6月'
- },
- {
- value: '2',
- label: '2021年7月'
- },
- {
- value: '3',
- label: '2021年8月'
- },
- {
- value: '4',
- label: '2021年9月'
- }
- ],
- list2:[
- {
- value: '1',
- label: '广东'
- },
- {
- value: '2',
- label: '北京'
- }
- ],
- list3:[
- {
- value: '1',
- label: '广州'
- },
- {
- value: '2',
- label: '深圳'
- }
- ],
- value1:'',
- show:false,
- detail:{},
- gradeList:[]
- };
- },
- onPullDownRefresh(){
- },
- onLoad(option) {
- this.id = option.id;
- this.getDetail()
- },
- onShow() {
- /* if(this.current === 2 && this.$method.isLogin()){
- this.$refs.refMy.init();
- } */
- },
- methods: {
- goodsGradeList() {
- let self = this
- this.$api.goodsGradeList({goodsId:this.id}).then(res => {
- if(res.data.code==200){
- self.gradeList = res.data.rows
- }
- });
- },
- goBuy(){
- this.$navTo.togo('/pages2/order/confirm_pay');
- },
- getDetail() {
- let self = this
- this.$api.goodsDetail(this.id).then(res => {
- if(res.data.code==200){
- self.detail = res.data.data
- }
- });
- },
- bindChange(e) {
- const val = e.detail.value
- },
- checkboxChange(e) {
- //console.log(e);
- },
- // 选中任一checkbox时,由checkbox-group触发
- checkboxGroupChange(e) {
- // console.log(e);
- },
- // 全选
- checkedAll() {
- this.list.map(val => {
- val.checked = true;
- })
- },
- openPopup(index){
- if(index==0){
- this.show = true
- this.goodsGradeList()
- }else{
- this.show1 = true
- }
-
- }
- },
- onReachBottom() {},
- computed: { ...mapGetters(['userInfo']) }
- };
- </script>
- <style >
- page{
- background-color: #EAEEF1;
- }
- </style>
- <style scoped lang="scss">
- .picker-item {
- height: 50px;
- align-items: center;
- justify-content: center;
- text-align: center;
- }
- .picker-view {
- width: 100%;
- height: 420rpx;
- text-align: center;
- }
- .topTxt{
- font-size: 30rpx;
- color: #666666;
- text-align: center;
- padding: 20rpx 0;
- }
- .blackTxt{
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .redTxt{
- font-size: 30rpx;
- font-family: PingFang SC;
- color: #FF2D55;
- margin-top: 13rpx;
- }
- .blue-box{
- background: #EBF5FF;
- }
- .white-box{
- width: 646rpx;
- height: 220rpx;
- border-radius: 24rpx;
- align-items: center;
- display: flex;
- padding-left: 15rpx;
- }
- .okBtn{
- width: 200rpx;
- height: 64rpx;
- background: linear-gradient(0deg, #015EEA, #00C0FA);
- border-radius: 32rpx;
- color: #FFFFFF;
- text-align: center;
- line-height: 64rpx;
- }
- .confrim-btn{
- height: 98rpx;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content:center;
- }
- .grade{
- height: 23rpx;
- font-size: 24rpx;
- color: #999999;
- margin: 0 auto;
- margin-top: 15rpx;
- text-align: center;
- }
- .line1{
- width: 80rpx;
- height: 8rpx;
- background: #999999;
- border-radius: 4rpx;
- margin: 0 auto;
- margin-top: 15rpx;
- }
- .popup_box {
- height: 700rpx;
- box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
- border-radius: 32rpx 32rpx 0rpx 0rpx;
- }
- .item{
- width: 100%;
- background: #FFFFFF;
- border-radius: 16rpx;
- margin-bottom: 20rpx;
- padding: 15rpx;
- }
- .priceTag{
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FF2D55;
- display: flex;
- flex-direction: row-reverse;
- }
- .btn2{
- width: 200rpx;
- height: 64rpx;
- background: linear-gradient(0deg, #015EEA, #00C0FA);
- opacity: 0.6;
- border-radius: 32rpx;
- text-align: center;
- line-height: 64rpx;
- }
- .bottomBox{
- position: fixed;
- bottom: 0;
- width: 100%;
- left: 0;
- height:98rpx ;
- background-color: #FFFFFF;
- display: flex;
- justify-content: space-between;
- align-items: center;
- box-sizing: unset;
- >view{
- margin: 0 30rpx;
- }
- }
- </style>
|