confirm_list.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <view>
  3. <view style="padding: 30rpx;padding-bottom: 98rpx;">
  4. <view >
  5. <view class="item">
  6. <view style="display: flex;justify-content: space-between;padding-bottom: 15rpx;">
  7. <image :src="$method.splitImgHost(detail.coverUrl)" style="height: 134rpx;width: 278rpx;border-radius: 16rpx;"></image>
  8. <view style="margin-left: 20rpx;">
  9. <view style="color: #333333;font-size: 30rpx;font-weight: bold;">
  10. {{detail.goodsName}}
  11. </view>
  12. <view class="priceTag">
  13. ¥ {{detail.standPrice}}
  14. </view>
  15. </view>
  16. </view>
  17. <view v-if="detail.templateType!=null">
  18. <u-line color="#D6D6DB" />
  19. <view v-if="detail.templateType=='class'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(0)">
  20. <view style="color: #666666;font-size: 24rpx;">选择班级</view>
  21. <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  22. </view>
  23. <view v-if="detail.templateType=='apply'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(1)">
  24. <view style="color: #666666;font-size: 24rpx;">报考地区</view>
  25. <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="bottomBox safeArea">
  32. <view class="priceTag">¥ {{detail.standPrice}}</view>
  33. <view style="display: flex;color: #FFFFFF;align-items: center;">
  34. <view class="btn2" @click="goBuy()">确认购买</view>
  35. </view>
  36. </view>
  37. <u-popup v-model="show" mode="bottom"border-radius="40">
  38. <view class="popup_box">
  39. <view style="margin-bottom: 20rpx;">
  40. <view class="line1"></view>
  41. <view class="grade">选择班级</view>
  42. </view>
  43. <u-line color="#D6D6DB" />
  44. <view>
  45. <scroll-view scroll-y="true" style="height: 500rpx;">
  46. <view>
  47. <u-checkbox-group @change="checkboxGroupChange">
  48. <view v-for="(item, index) in gradeList" :key="index" >
  49. <view style="display: flex;align-items: center;padding: 20rpx;">
  50. <view>
  51. <u-checkbox
  52. shape="circle"
  53. @change="checkboxChange"
  54. v-model="gradeList[index].checked"
  55. :name="gradeList[index].name"
  56. ></u-checkbox>
  57. </view>
  58. <view :class="item.checked?'white-box blue-box':'white-box'" >
  59. <view>
  60. <view class="blackTxt">{{item.className}}</view>
  61. <view class="redTxt">有效期至:{{$method.timestampToTime(item.classEndTime)}}</view>
  62. <view class="redTxt">本班还剩{{$method.GetRTime(item.classEndTime)}}天将结束学习</view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </u-checkbox-group>
  68. </view>
  69. </scroll-view>
  70. </view>
  71. <view class="confrim-btn">
  72. <view class="okBtn">确定</view>
  73. </view>
  74. </view>
  75. </u-popup>
  76. <u-popup v-model="show1" mode="bottom"border-radius="40">
  77. <view class="popup_box">
  78. <view style="margin-bottom: 20rpx;">
  79. <view class="line1"></view>
  80. <view class="grade">选择考期/地区</view>
  81. </view>
  82. <u-line color="#D6D6DB" />
  83. <view style="display: flex;height: 500rpx;">
  84. <view style="width: 50%;">
  85. <view class="topTxt">考期</view>
  86. <view>
  87. <picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
  88. <picker-view-column>
  89. <view class="picker-item" v-for="(item,index) in list1" :key="index">{{item.label}}</view>
  90. </picker-view-column>
  91. </picker-view>
  92. </view>
  93. </view>
  94. <view style="width: 50%;">
  95. <view class="topTxt">地区</view>
  96. <view>
  97. <picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
  98. <picker-view-column>
  99. <view class="picker-item" v-for="(item,index) in list2" :key="index">{{item.label}}</view>
  100. </picker-view-column>
  101. <picker-view-column>
  102. <view class="picker-item" v-for="(item,index) in list3" :key="index">{{item.label}}</view>
  103. </picker-view-column>
  104. </picker-view>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="confrim-btn">
  109. <view class="okBtn">确定</view>
  110. </view>
  111. </view>
  112. </u-popup>
  113. </view>
  114. </template>
  115. <script>
  116. import { mapGetters } from 'vuex';
  117. export default {
  118. components: {
  119. },
  120. data() {
  121. return {
  122. id:0,
  123. indicatorStyle: `height: 50px;`,
  124. showArea:true,
  125. show1:false,
  126. list:[{
  127. name: 'apple',
  128. checked: false,
  129. disabled: false
  130. },
  131. {
  132. name: 'banner',
  133. checked: false,
  134. disabled: false
  135. },
  136. {
  137. name: 'orange',
  138. checked: false,
  139. disabled: false
  140. }],
  141. list1:[
  142. {
  143. value: '1',
  144. label: '2021年6月'
  145. },
  146. {
  147. value: '2',
  148. label: '2021年7月'
  149. }
  150. ],
  151. list1:[
  152. {
  153. value: '1',
  154. label: '2021年6月'
  155. },
  156. {
  157. value: '2',
  158. label: '2021年7月'
  159. },
  160. {
  161. value: '3',
  162. label: '2021年8月'
  163. },
  164. {
  165. value: '4',
  166. label: '2021年9月'
  167. }
  168. ],
  169. list2:[
  170. {
  171. value: '1',
  172. label: '广东'
  173. },
  174. {
  175. value: '2',
  176. label: '北京'
  177. }
  178. ],
  179. list3:[
  180. {
  181. value: '1',
  182. label: '广州'
  183. },
  184. {
  185. value: '2',
  186. label: '深圳'
  187. }
  188. ],
  189. value1:'',
  190. show:false,
  191. detail:{},
  192. gradeList:[]
  193. };
  194. },
  195. onPullDownRefresh(){
  196. },
  197. onLoad(option) {
  198. this.id = option.id;
  199. this.getDetail()
  200. },
  201. onShow() {
  202. /* if(this.current === 2 && this.$method.isLogin()){
  203. this.$refs.refMy.init();
  204. } */
  205. },
  206. methods: {
  207. goodsGradeList() {
  208. let self = this
  209. this.$api.goodsGradeList({goodsId:this.id}).then(res => {
  210. if(res.data.code==200){
  211. self.gradeList = res.data.rows
  212. }
  213. });
  214. },
  215. goBuy(){
  216. this.$navTo.togo('/pages2/order/confirm_pay');
  217. },
  218. getDetail() {
  219. let self = this
  220. this.$api.goodsDetail(this.id).then(res => {
  221. if(res.data.code==200){
  222. self.detail = res.data.data
  223. }
  224. });
  225. },
  226. bindChange(e) {
  227. const val = e.detail.value
  228. },
  229. checkboxChange(e) {
  230. //console.log(e);
  231. },
  232. // 选中任一checkbox时,由checkbox-group触发
  233. checkboxGroupChange(e) {
  234. // console.log(e);
  235. },
  236. // 全选
  237. checkedAll() {
  238. this.list.map(val => {
  239. val.checked = true;
  240. })
  241. },
  242. openPopup(index){
  243. if(index==0){
  244. this.show = true
  245. this.goodsGradeList()
  246. }else{
  247. this.show1 = true
  248. }
  249. }
  250. },
  251. onReachBottom() {},
  252. computed: { ...mapGetters(['userInfo']) }
  253. };
  254. </script>
  255. <style >
  256. page{
  257. background-color: #EAEEF1;
  258. }
  259. </style>
  260. <style scoped lang="scss">
  261. .picker-item {
  262. height: 50px;
  263. align-items: center;
  264. justify-content: center;
  265. text-align: center;
  266. }
  267. .picker-view {
  268. width: 100%;
  269. height: 420rpx;
  270. text-align: center;
  271. }
  272. .topTxt{
  273. font-size: 30rpx;
  274. color: #666666;
  275. text-align: center;
  276. padding: 20rpx 0;
  277. }
  278. .blackTxt{
  279. font-size: 30rpx;
  280. font-family: PingFang SC;
  281. font-weight: bold;
  282. color: #333333;
  283. }
  284. .redTxt{
  285. font-size: 30rpx;
  286. font-family: PingFang SC;
  287. color: #FF2D55;
  288. margin-top: 13rpx;
  289. }
  290. .blue-box{
  291. background: #EBF5FF;
  292. }
  293. .white-box{
  294. width: 646rpx;
  295. height: 220rpx;
  296. border-radius: 24rpx;
  297. align-items: center;
  298. display: flex;
  299. padding-left: 15rpx;
  300. }
  301. .okBtn{
  302. width: 200rpx;
  303. height: 64rpx;
  304. background: linear-gradient(0deg, #015EEA, #00C0FA);
  305. border-radius: 32rpx;
  306. color: #FFFFFF;
  307. text-align: center;
  308. line-height: 64rpx;
  309. }
  310. .confrim-btn{
  311. height: 98rpx;
  312. width: 100%;
  313. display: flex;
  314. align-items: center;
  315. justify-content:center;
  316. }
  317. .grade{
  318. height: 23rpx;
  319. font-size: 24rpx;
  320. color: #999999;
  321. margin: 0 auto;
  322. margin-top: 15rpx;
  323. text-align: center;
  324. }
  325. .line1{
  326. width: 80rpx;
  327. height: 8rpx;
  328. background: #999999;
  329. border-radius: 4rpx;
  330. margin: 0 auto;
  331. margin-top: 15rpx;
  332. }
  333. .popup_box {
  334. height: 700rpx;
  335. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  336. border-radius: 32rpx 32rpx 0rpx 0rpx;
  337. }
  338. .item{
  339. width: 100%;
  340. background: #FFFFFF;
  341. border-radius: 16rpx;
  342. margin-bottom: 20rpx;
  343. padding: 15rpx;
  344. }
  345. .priceTag{
  346. font-size: 30rpx;
  347. font-family: PingFang SC;
  348. font-weight: bold;
  349. color: #FF2D55;
  350. display: flex;
  351. flex-direction: row-reverse;
  352. }
  353. .btn2{
  354. width: 200rpx;
  355. height: 64rpx;
  356. background: linear-gradient(0deg, #015EEA, #00C0FA);
  357. opacity: 0.6;
  358. border-radius: 32rpx;
  359. text-align: center;
  360. line-height: 64rpx;
  361. }
  362. .bottomBox{
  363. position: fixed;
  364. bottom: 0;
  365. width: 100%;
  366. left: 0;
  367. height:98rpx ;
  368. background-color: #FFFFFF;
  369. display: flex;
  370. justify-content: space-between;
  371. align-items: center;
  372. box-sizing: unset;
  373. >view{
  374. margin: 0 30rpx;
  375. }
  376. }
  377. </style>