cm-regula-popup.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template name="regulations">
  2. <view class="regulations-template">
  3. <view class="regulations-title" @tap.stop="hanldOperationConfim">
  4. <text class="text">售后条款:</text>
  5. <view class="freight-right">
  6. <text class="text-l">{{regulaText}}</text>
  7. <text class="iconfont icon-xiayibu"></text>
  8. </view>
  9. </view>
  10. <!--底部选择模态层弹窗组件 -->
  11. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" >
  12. <!-- 遮罩层 -->
  13. <view class="mask"></view>
  14. <view class="layer">
  15. <view class="content">
  16. <view class="freight-ltitle">售后条款</view>
  17. <text class="iconfont icon-iconfontguanbi" @click="freightConfim"></text>
  18. <view class="freight-radio">
  19. <radio-group class="row-group" @change="radioChange">
  20. <label class="row-input" v-for="(item, index) in regulaDatas" :key="index">
  21. <view class="row-text" @click.stop="gotoConten(item)">{{item.name.length>10?item.name.substring(0,10)+'...':item.name}}</view>
  22. <radio class="row-radio" :value="item.id" color="#FF5B00"/>
  23. </label>
  24. </radio-group>
  25. </view>
  26. </view>
  27. <view class="btn">
  28. <view class="button add" @click="freightConfim">确定</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default{
  36. name:'regulations',
  37. props:{
  38. regulaDatas:{
  39. type:Array
  40. }
  41. },
  42. data(){
  43. return{
  44. regulaText:'无条款',
  45. freightMoney:0,
  46. specClass: '',//规格弹窗css类,控制开关动画
  47. clauseId:0
  48. }
  49. },
  50. created() {
  51. },
  52. methods:{
  53. gotoConten(item){
  54. if(item.name!='无条款'){
  55. this.$api.navigateTo(`/pages/service/sellconten?clauseId=${item.id}`)
  56. }
  57. },
  58. radioChange(e){
  59. this.clauseId = e.target.value;
  60. this.regulaDatas.forEach((item,index)=>{
  61. if(item.id==this.clauseId){
  62. if(item.name.length>10){
  63. this.regulaText = item.name.substr(0,10)+'...'
  64. }else{
  65. this.regulaText = item.name;
  66. }
  67. }
  68. })
  69. },
  70. freightConfim(){//提交完成选择
  71. this.$emit('handleData',this.clauseId)
  72. this.hideSpec()
  73. },
  74. hideSpec() {//关闭弹窗
  75. this.specClass = 'hide';
  76. setTimeout(() => {
  77. this.specClass = 'none';
  78. }, 200);
  79. },
  80. hanldOperationConfim(data){//显示弹窗
  81. this.specClass = 'show';
  82. this.freightMoney = this.hanldFreight
  83. },
  84. showTip(){//显示弹窗
  85. this.$emit('@showregulaAlert');
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .regulations-template{
  92. width: 100%;
  93. height: auto;
  94. background: #FFFFFF;
  95. float: left;
  96. margin-top: 24rpx;
  97. .regulations-title{
  98. width: 702rpx;
  99. padding: 0 24rpx;
  100. height: 88rpx;
  101. line-height: 88rpx;
  102. font-size: $font-size-28;
  103. color: $text-color;
  104. background: #FFFFFF;
  105. float: left;
  106. font-weight: bold;
  107. border-bottom: 1rpx solid #EBEBEB;
  108. position: relative;
  109. .freight-left{
  110. float: left;
  111. .icon-yunfeishuoming{
  112. height: 100%;
  113. padding:15rpx;
  114. color: $color-system;
  115. font-weight: normal;
  116. }
  117. }
  118. .Tk{
  119. float: right;
  120. margin-right: 38rpx;
  121. font-size: $font-size-28;
  122. color: #666666;
  123. }
  124. .freight-right{
  125. float: right;
  126. color: #2A81FF;
  127. .text-l{
  128. margin-right: 40rpx;
  129. font-weight: normal;
  130. }
  131. .text{
  132. line-height: 88rpx;
  133. color: #ff0000;
  134. margin:0 20rpx;
  135. font-weight: normal;
  136. }
  137. .icon-xiayibu{
  138. width: 50rpx;
  139. height: 88rpx;
  140. line-height: 88rpx;
  141. color: #999999;
  142. display: block;
  143. position: absolute;
  144. right: 0;
  145. top: 0;
  146. font-weight: normal;
  147. }
  148. }
  149. }
  150. }
  151. .freight-ltitle{
  152. width: 100%;
  153. line-height: 60rpx;
  154. height: 60rpx;
  155. font-size: $font-size-34;
  156. color: #333333;
  157. text-align:center;
  158. }
  159. .icon-iconfontguanbi{
  160. position: absolute;
  161. top: 0;
  162. right: 0;
  163. font-size: 34rpx;
  164. color: #b2b2b2
  165. }
  166. .freight-radio{
  167. height: 66rpx;
  168. line-height: 66rpx;
  169. padding: 0 20rpx;
  170. .row-group{
  171. width: 100%;
  172. max-height: 460rpx;
  173. overflow: auto;
  174. }
  175. .row-input{
  176. height: 66rpx;
  177. line-height: 66rpx;
  178. width: 100%;
  179. display: block;
  180. // .row-text:nth-child(1){
  181. // color: #666666;
  182. // pointer-events: none;
  183. // }
  184. }
  185. .row-radio{
  186. float: right;
  187. transform: scale(0.9);
  188. color: #b2b2b2;
  189. }
  190. .row-text{
  191. font-size: $font-size-28;
  192. color: #1890f9;
  193. float: left;
  194. }
  195. }
  196. .freight-group{
  197. width: 100%;
  198. height: 88rpx;
  199. display: flex;
  200. border-bottom: 1px solid #FFFFFF;
  201. flex-direction: row;
  202. .text{
  203. display: block;
  204. flex: 1;
  205. line-height: 88rpx;
  206. font-size: $font-size-24;
  207. color: #999999;
  208. text-align: left;
  209. padding-left: 10rpx;
  210. }
  211. .group-from{
  212. flex: 1;
  213. height: 40rpx;
  214. padding: 20rpx;
  215. line-height: 40rpx;
  216. align-items: flex-start;
  217. font-size: $font-size-24;
  218. color: $text-color;
  219. background: #F7F7F7;
  220. border-radius: 14rpx;
  221. margin-bottom: 20rpx;
  222. margin-top: 10rpx;
  223. .form-input{
  224. height: 40rpx;
  225. line-height: 40rpx;
  226. flex-grow: 1;
  227. }
  228. }
  229. }
  230. /* 加入购物模态层*/
  231. @keyframes showPopup {
  232. 0% {
  233. opacity: 0;
  234. }
  235. 100% {
  236. opacity: 1;
  237. }
  238. }
  239. @keyframes hidePopup {
  240. 0% {
  241. opacity: 1;
  242. }
  243. 100% {
  244. opacity: 0;
  245. }
  246. }
  247. @keyframes showLayer {
  248. 0% {
  249. transform: translateY(0);
  250. }
  251. 100% {
  252. transform: translateY(-100%);
  253. }
  254. }
  255. @keyframes hideLayer {
  256. 0% {
  257. transform: translateY(-100%);
  258. }
  259. 100% {
  260. transform: translateY(0);
  261. }
  262. }
  263. @keyframes showAmnation {
  264. 0% {
  265. top: -12rpx;
  266. opacity: 0;
  267. }
  268. 50% {
  269. top: -60rpx;
  270. opacity: 1;
  271. }
  272. 100% {
  273. top: -100rpx;
  274. opacity: 0;
  275. }
  276. }
  277. @keyframes hideAmnation {
  278. 0% {
  279. top: -100rpx;
  280. opacity: 0;
  281. }
  282. 100% {
  283. top: -12rpx;
  284. opacity: 0;
  285. }
  286. }
  287. .popup {
  288. position: fixed;
  289. top: 0;
  290. width: 100%;
  291. height: 100%;
  292. z-index: 999;
  293. display: none;
  294. .mask{
  295. position: fixed;
  296. top: 0;
  297. width: 100%;
  298. height: 100%;
  299. z-index: 21;
  300. background-color: rgba(0, 0, 0, 0.6);
  301. }
  302. .layer {
  303. position: fixed;
  304. z-index: 22;
  305. bottom: -710rpx;
  306. width: 702rpx;
  307. padding: 24rpx 24rpx 36rpx 24rpx;
  308. height: 670rpx;
  309. border-radius: 20rpx 20rpx 0 0;
  310. background-color: #fff;
  311. display: flex;
  312. flex-wrap: wrap;
  313. align-content: space-between;
  314. .content {
  315. width: 100%;
  316. position: relative;
  317. }
  318. .btn {
  319. width: 100%;
  320. height: 88rpx;
  321. display: flex;
  322. .button {
  323. width: 702rpx;
  324. height: 88rpx;
  325. color: #fff;
  326. display: flex;
  327. align-items: center;
  328. justify-content: center;
  329. font-size: $font-size-28;
  330. border-radius: 44rpx;
  331. background: $btn-confirm;
  332. }
  333. }
  334. }
  335. &.show {
  336. display: block;
  337. .mask{
  338. animation: showPopup 0.2s linear both;
  339. }
  340. .layer {
  341. animation: showLayer 0.2s linear both;
  342. }
  343. }
  344. &.hide {
  345. display: block;
  346. .mask{
  347. animation: hidePopup 0.2s linear both;
  348. }
  349. .layer {
  350. animation: hideLayer 0.2s linear both;
  351. }
  352. }
  353. &.none {
  354. display: none;
  355. }
  356. &.service {
  357. .row {
  358. margin: 30upx 0;
  359. .title {
  360. font-size: 30upx;
  361. margin: 10upx 0;
  362. }
  363. .description {
  364. font-size: 28upx;
  365. color: #999;
  366. }
  367. }
  368. }
  369. .layer-smimg{
  370. width: 114rpx;
  371. height: 114rpx;
  372. float: left;
  373. border-radius: 10rpx;
  374. margin-right: 24rpx;
  375. image{
  376. width: 114rpx;
  377. height: 114rpx;
  378. border-radius: 10rpx;
  379. }
  380. }
  381. .layer-nunbox{
  382. justify-content: space-between;
  383. align-items: center;
  384. width: 536rpx;
  385. height: 88rpx;
  386. padding: 13rpx 0 0 0;
  387. float: left;
  388. .layer-nunbox-t{
  389. width: 100%;
  390. height:44rpx;
  391. position:relative;
  392. display: flex;
  393. .layer-nunbox-text{
  394. line-height: 44rpx;
  395. font-size: $font-size-28;
  396. }
  397. .number-box{
  398. display: flex;
  399. justify-content: center;
  400. align-items: center;
  401. .iconfont{
  402. font-size: $font-size-32;
  403. padding:0 18rpx;
  404. font-size: $text-color;
  405. }
  406. .btn-input{
  407. width: 62rpx;
  408. height: 48rpx;
  409. line-height: 48rpx;
  410. background: #F8F8F8;
  411. border-radius: 4rpx;
  412. text-align: center;
  413. font-size: $font-size-28;
  414. }
  415. }
  416. .product-step{
  417. position: absolute;
  418. left: 45rpx;
  419. bottom: 0;
  420. height: 44rpx;
  421. background: #FFFFFF;
  422. }
  423. }
  424. .layer-nunbox-b{
  425. width: 100%;
  426. height:44rpx;
  427. margin-top: 13rpx;
  428. }
  429. .text{
  430. line-height: 44rpx;
  431. font-size: $font-size-28;
  432. .p{
  433. color: #FF2A2A;
  434. }
  435. .p:first-child{
  436. margin-left: 30rpx;
  437. }
  438. .p.sm{
  439. font-size: $font-size-24;
  440. }
  441. }
  442. }
  443. }
  444. </style>